@shadowob/sdk 1.1.6 → 1.1.8

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,1846 +1,9 @@
1
- import { MessageMention, OAuthLinkCard, MentionSuggestionTrigger, MentionSuggestion } from '@shadowob/shared';
2
- export { CLIENT_EVENTS, ClientEvent, SERVER_EVENTS, ServerEvent } from '@shadowob/shared';
1
+ export { ShadowBridge, ShadowBridgeBuddyInbox, ShadowBridgeCommandMap, ShadowBridgeCommandSpec, ShadowBridgeEnqueueInboxTaskInput, ShadowBridgeOptions } from './bridge.js';
2
+ import { S as ShadowAuthResponse, a as ShadowUser, b as ShadowMembership, c as ShadowPlayLaunchResult, d as ShadowHomePlayCatalogItem, e as ShadowModelProxyModelsResponse, f as ShadowModelProxyBilling, g as ShadowModelProxyChatCompletionRequest, h as ShadowModelProxyChatCompletionResponse, i as ShadowConnectorComputer, j as ShadowConnectorBootstrapResult, k as ShadowAgentUsageSnapshotInput, l as ShadowRemoteConfig, m as ShadowSlashCommand, n as ShadowChannelSlashCommand, o as ShadowServer, p as ShadowServerAccess, q as ShadowServerAppIntegration, r as ShadowServerAppCatalogEntry, s as ShadowServerAppManifest, t as ShadowServerAppDiscovery, u as ShadowServerAppApprovalMode, v as ShadowServerAppCommandConsent, w as ShadowServerAppSkillDocument, x as ShadowServerAppLaunchContext, y as ShadowServerAppTokenIntrospection, z as ShadowServerJoinRequestResult, A as ShadowServerJoinRequestStatus, B as ShadowMember, C as ShadowAddAgentsToServerResult, D as ShadowChannel, E as ShadowChannelBootstrap, F as ShadowChannelAccess, G as ShadowChannelJoinRequestResult, H as ShadowChannelJoinRequestStatus, I as ShadowVoiceState, J as ShadowVoiceJoinResult, K as ShadowVoiceRenewResult, L as ShadowVoiceLeaveResult, M as ShadowVoicePolicy, N as ShadowMessageMention, O as ShadowMessage, P as ShadowMentionSuggestionTrigger, Q as ShadowMentionSuggestion, R as ShadowBuddyInboxSummary, T as ShadowEnsureBuddyInboxResult, U as ShadowBuddyInboxAdmissionPolicyResult, V as ShadowBuddyInboxAdmissionPolicy, W as ShadowBuddyInboxAdmissionPendingResult, X as ShadowBuddyInboxAdmissionPendingActionResult, Y as ShadowInboxTaskInput, Z as ShadowMessageCard, _ as ShadowInteractiveActionInput, $ as ShadowInteractiveActionResult, a0 as ShadowInteractiveState, a1 as ShadowThread, a2 as ShadowNotification, a3 as ShadowInviteCode, a4 as ShadowAttachment, a5 as ShadowMediaVariant, a6 as ShadowSignedMediaUrl, a7 as ShadowFriendship, a8 as ShadowScopedUnread, a9 as ShadowNotificationPreferences, aa as ShadowOAuthApp, ab as ShadowOAuthToken, ac as ShadowOAuthConsent, ad as ShadowOAuthLinkCard, ae as ShadowListing, af as ShadowContract, ag as ShadowShop, ah as ShadowProduct, ai as ShadowCommerceProductContext, aj as ShadowEntitlementPurchaseResult, ak as ShadowCommerceCheckoutPreview, al as ShadowCommunityAssetDefinition, am as ShadowCommerceProductPickerResponse, an as ShadowPaidFileOpenResult, ao as ShadowCategory, ap as ShadowCartItem, aq as ShadowOrder, ar as ShadowReview, as as ShadowWallet, at as ShadowTransaction, au as ShadowCommunityAsset, av as ShadowCommunityAssetGrant, aw as ShadowEconomyTip, ax as ShadowEconomyGift, ay as ShadowSettlementLine, az as ShadowDiyCloudGenerateInput, aA as ShadowDiyCloudRunStatus, aB as ShadowDiyCloudRun, aC as ShadowDiyCloudRunEvent, aD as ShadowCloudDeploymentManifest, aE as ShadowCloudDeploymentTemplateSyncResult, aF as ShadowCloudDeploymentRuntimeResponse, aG as ShadowCloudDeploymentBackup, aH as ShadowCloudProviderCatalog, aI as ShadowCloudProviderProfile, aJ as ShadowCloudProviderModel, aK as ShadowRechargeConfig, aL as ShadowRechargeIntent, aM as ShadowRechargeHistory, aN as ShadowPaymentOrder, aO as ShadowEntitlement, aP as ShadowOAuthCommerceEntitlementAccess, aQ as ShadowOAuthCommerceEntitlementRedeemInput, aR as ShadowOAuthCommerceEntitlementRedeemResult, aS as ShadowEntitlementProvisioning, aT as ShadowTask, aU as ShadowMarketplaceProductsResponse, aV as ShadowMarketplaceCategoriesResponse, aW as ServerEventMap } from './server-app-qqsBtGmE.js';
3
+ export { aX as ChannelCreatedPayload, aY as ChannelMemberAddedPayload, aZ as ChannelMemberRemovedPayload, a_ as ClientEventMap, a$ as JsonSchemaToType, b0 as MemberJoinPayload, b1 as MemberLeavePayload, b2 as MessageDeletedPayload, b3 as PolicyChangedPayload, b4 as PresenceActivityPayload, b5 as PresenceChangePayload, b6 as ReactionPayload, b7 as SHADOW_SERVER_APP_COMMAND_COMPLETED_EVENT, b8 as SHADOW_SERVER_APP_COMMAND_EVENTS, b9 as SHADOW_SERVER_APP_COMMAND_FAILED_EVENT, ba as SHADOW_SERVER_APP_PROTOCOL, bb as ServerJoinedPayload, bc as ShadowBuddyInboxAdmissionMode, bd as ShadowBuddyInboxAdmissionPendingDelivery, be as ShadowBuddyInboxAdmissionRule, bf as ShadowBuddyInboxAdmissionSubjectKind, bg as ShadowChannelPolicy, bh as ShadowCloudDeploymentStatus, bi as ShadowCloudProviderEnvVar, bj as ShadowCommerceProductCard, bk as ShadowCommerceProductPickerGroup, bl as ShadowConnectorRuntimeInfo, bm as ShadowInteractiveBlock, bn as ShadowInteractiveResponse, bo as ShadowInteractiveSubmissionPending, bp as ShadowMarketplaceCategory, bq as ShadowMarketplaceProduct, br as ShadowMessageCardSource, bs as ShadowModelProxyModel, bt as ShadowOAuthCommerceEntitlementRedemption, bu as ShadowOAuthCommerceEntitlementSummary, bv as ShadowProductEntitlementConfig, bw as ShadowProductMedia, bx as ShadowProductSku, by as ShadowRemoteChannel, bz as ShadowRemoteServer, bA as ShadowServerAppActorProfile, bB as ShadowServerAppActorRef, bC as ShadowServerAppBridgeCommandRequest, bD as ShadowServerAppBridgeEnqueueInboxTaskRequest, bE as ShadowServerAppBridgeFailureResponse, bF as ShadowServerAppBridgeInboxesRequest, bG as ShadowServerAppBridgeRequest, bH as ShadowServerAppBridgeResponse, bI as ShadowServerAppBridgeResponseType, bJ as ShadowServerAppBridgeSuccessResponse, bK as ShadowServerAppChannelMessageDelivery, bL as ShadowServerAppChannelMessageDeliveryError, bM as ShadowServerAppChannelMessageOutbox, bN as ShadowServerAppCommand, bO as ShadowServerAppCommandApproval, bP as ShadowServerAppCommandContext, bQ as ShadowServerAppCommandEnvelope, bR as ShadowServerAppCommandError, bS as ShadowServerAppCommandEventType, bT as ShadowServerAppCommandFailureResponse, bU as ShadowServerAppCommandHandler, bV as ShadowServerAppCommandHandlerContext, bW as ShadowServerAppCommandHandlers, bX as ShadowServerAppCommandInput, bY as ShadowServerAppCommandName, bZ as ShadowServerAppCommandParseError, b_ as ShadowServerAppCommandParseResult, b$ as ShadowServerAppCommandParseSuccess, c0 as ShadowServerAppCommandRequestInput, c1 as ShadowServerAppCommandResponse, c2 as ShadowServerAppCommandSuccessResponse, c3 as ShadowServerAppExecutionFailure, c4 as ShadowServerAppExecutionResult, c5 as ShadowServerAppExecutionSuccess, c6 as ShadowServerAppFetch, c7 as ShadowServerAppHostAppRef, c8 as ShadowServerAppHostInboxTaskRequestInput, c9 as ShadowServerAppInboxDelivery, ca as ShadowServerAppInboxDeliveryError, cb as ShadowServerAppInboxDeliveryFromMessageInput, cc as ShadowServerAppInboxTarget, cd as ShadowServerAppInboxTaskOutbox, ce as ShadowServerAppInboxTaskPriority, cf as ShadowServerAppInboxTaskResource, cg as ShadowServerAppIntrospectionInput, ch as ShadowServerAppManifestOptions, ci as ShadowServerAppOutbox, cj as ShadowServerAppOutboxPayload, ck as ShadowServerAppRealtimeSpec, cl as ShadowServerAppResolvedInboxTaskRequest, cm as ShadowServerAppResultShadow, cn as ShadowServerAppResultWithShadow, co as ShadowServerAppRuntime, cp as ShadowServerAppRuntimeOptions, cq as ShadowServerAppValidationIssue, cr as ShadowUsageProviderSnapshot, cs as ShadowVoiceCredentials, ct as ShadowVoiceParticipant, cu as TypingPayload, cv as VoiceParticipantPayload, cw as VoicePolicyUpdatedPayload, cx as buildShadowServerAppInboxDelivery, cy as buildShadowServerAppInboxTaskRequest, cz as createShadowServerAppManifest, cA as defineShadowServerApp, cB as extractShadowServerAppBearerToken, cC as getShadowServerAppChannelMessageDeliveries, cD as getShadowServerAppChannelMessageErrors, cE as getShadowServerAppTaskCardId, cF as introspectShadowServerAppToken, cG as normalizeShadowServerAppCommandInput, cH as parseShadowServerAppCommandRequest, cI as shadowServerAppActorAvatarUrl, cJ as shadowServerAppActorDisplayName, cK as shadowServerAppActorRef, cL as shadowServerAppError, cM as shadowServerAppInboxTaskEndpoint, cN as validateShadowServerAppJsonSchema } from './server-app-qqsBtGmE.js';
3
4
  import { Socket } from 'socket.io-client';
4
5
  import { IRemoteAudioTrack, IRemoteVideoTrack } from 'agora-rtc-sdk-ng';
5
-
6
- /** Message returned by the Shadow REST API and Socket.IO broadcasts */
7
- interface ShadowMessage {
8
- id: string;
9
- content: string;
10
- channelId: string;
11
- authorId: string;
12
- threadId?: string | null;
13
- replyToId?: string | null;
14
- isPinned?: boolean;
15
- createdAt: string;
16
- updatedAt: string;
17
- author?: {
18
- id: string;
19
- username: string;
20
- displayName?: string | null;
21
- avatarUrl?: string | null;
22
- isBot?: boolean;
23
- };
24
- attachments?: ShadowAttachment[];
25
- metadata?: ShadowMessageMetadata | null;
26
- }
27
- interface ShadowInteractiveButtonItem {
28
- id: string;
29
- label: string;
30
- style?: 'primary' | 'secondary' | 'destructive';
31
- value?: string;
32
- }
33
- interface ShadowInteractiveSelectItem {
34
- id: string;
35
- label: string;
36
- value: string;
37
- }
38
- interface ShadowInteractiveFormField {
39
- id: string;
40
- kind: 'text' | 'textarea' | 'number' | 'checkbox' | 'select';
41
- label: string;
42
- placeholder?: string;
43
- defaultValue?: string;
44
- required?: boolean;
45
- options?: ShadowInteractiveSelectItem[];
46
- maxLength?: number;
47
- min?: number;
48
- max?: number;
49
- }
50
- interface ShadowInteractiveBlock {
51
- id: string;
52
- kind: 'buttons' | 'select' | 'form' | 'approval';
53
- prompt?: string;
54
- buttons?: ShadowInteractiveButtonItem[];
55
- options?: ShadowInteractiveSelectItem[];
56
- fields?: ShadowInteractiveFormField[];
57
- submitLabel?: string;
58
- responsePrompt?: string;
59
- approvalCommentLabel?: string;
60
- oneShot?: boolean;
61
- }
62
- interface ShadowInteractiveResponse {
63
- blockId: string;
64
- sourceMessageId: string;
65
- actionId: string;
66
- value: string;
67
- values?: Record<string, string>;
68
- submissionId?: string;
69
- responseMessageId?: string | null;
70
- submittedAt?: string;
71
- }
72
- interface ShadowInteractiveState {
73
- sourceMessageId: string;
74
- blockId: string;
75
- submitted: boolean;
76
- response?: ShadowInteractiveResponse;
77
- }
78
- interface ShadowInteractiveActionInput {
79
- blockId: string;
80
- actionId: string;
81
- value?: string;
82
- label?: string;
83
- values?: Record<string, string>;
84
- }
85
- interface ShadowInteractiveSubmissionPending {
86
- ok: true;
87
- pending: true;
88
- interactiveState?: ShadowInteractiveState;
89
- }
90
- type ShadowInteractiveActionResult = ShadowMessage | ShadowInteractiveSubmissionPending;
91
- interface ShadowMessageMetadata {
92
- mentions?: ShadowMessageMention[];
93
- agentChain?: Record<string, unknown>;
94
- interactive?: ShadowInteractiveBlock;
95
- interactiveResponse?: ShadowInteractiveResponse;
96
- interactiveState?: ShadowInteractiveState;
97
- commerceCards?: Array<ShadowCommerceProductCard | ShadowCommerceOfferCardInput>;
98
- oauthLinkCards?: ShadowOAuthLinkCard[];
99
- [key: string]: unknown;
100
- }
101
- interface ShadowCommerceOfferCardInput {
102
- id?: string;
103
- kind: 'offer';
104
- offerId: string;
105
- }
106
- type ShadowMessageMention = MessageMention;
107
- type ShadowOAuthLinkCard = OAuthLinkCard;
108
- type ShadowMentionSuggestion = MentionSuggestion;
109
- type ShadowMentionSuggestionTrigger = MentionSuggestionTrigger;
110
- interface ShadowAttachment {
111
- id: string;
112
- filename: string;
113
- url: string;
114
- contentType: string;
115
- size: number;
116
- width?: number | null;
117
- height?: number | null;
118
- workspaceNodeId?: string | null;
119
- }
120
- interface ShadowSignedMediaUrl {
121
- url: string;
122
- expiresAt: string;
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
- }
267
- interface ShadowChannel {
268
- id: string;
269
- name: string;
270
- type: string;
271
- kind: 'server' | 'dm';
272
- serverId: string | null;
273
- description?: string | null;
274
- position?: number;
275
- isPrivate?: boolean;
276
- isMember?: boolean;
277
- otherUser?: ShadowUser | null;
278
- }
279
- type ShadowChannelJoinRequestStatus = 'pending' | 'approved' | 'rejected';
280
- interface ShadowChannelAccess {
281
- channel: ShadowChannel;
282
- isServerMember: boolean;
283
- isChannelMember: boolean;
284
- canManage: boolean;
285
- canAccess: boolean;
286
- requiresApproval: boolean;
287
- joinRequestStatus: ShadowChannelJoinRequestStatus | null;
288
- joinRequestId: string | null;
289
- }
290
- interface ShadowChannelJoinRequestResult {
291
- ok: boolean;
292
- status: ShadowChannelJoinRequestStatus;
293
- requestId?: string;
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
- }
354
- type ShadowServerJoinRequestStatus = 'pending' | 'approved' | 'rejected';
355
- interface ShadowServerAccess {
356
- server: ShadowServer;
357
- isMember: boolean;
358
- canManage: boolean;
359
- canAccess: boolean;
360
- requiresApproval: boolean;
361
- joinRequestStatus: ShadowServerJoinRequestStatus | null;
362
- joinRequestId: string | null;
363
- }
364
- interface ShadowServerJoinRequestResult {
365
- ok: boolean;
366
- status: ShadowServerJoinRequestStatus;
367
- requestId?: string;
368
- }
369
- interface ShadowThread {
370
- id: string;
371
- name: string;
372
- channelId: string;
373
- parentMessageId: string;
374
- createdAt: string;
375
- }
376
- interface ShadowMember {
377
- userId: string;
378
- serverId: string;
379
- role: string;
380
- isBot?: boolean;
381
- uid?: string;
382
- nickname?: string;
383
- avatar?: string | null;
384
- status?: 'online' | 'idle' | 'dnd' | 'offline';
385
- membershipTier?: string;
386
- membershipLevel?: number;
387
- isMember?: boolean;
388
- totalOnlineSeconds?: number;
389
- buddyTag?: string | null;
390
- creator?: {
391
- uid: string;
392
- nickname: string;
393
- username?: string;
394
- displayName?: string | null;
395
- avatarUrl?: string | null;
396
- } | null;
397
- user?: ShadowUser;
398
- }
399
- interface ShadowAddAgentsToServerResult {
400
- added: string[];
401
- failed: Array<{
402
- agentId: string;
403
- error: string;
404
- }>;
405
- }
406
- interface ShadowInviteCode {
407
- id: string;
408
- code: string;
409
- createdBy: string;
410
- usedBy?: string | null;
411
- usedAt?: string | null;
412
- isActive: boolean;
413
- note?: string | null;
414
- createdAt: string;
415
- }
416
- interface ShadowServer {
417
- id: string;
418
- name: string;
419
- slug: string;
420
- description: string | null;
421
- iconUrl: string | null;
422
- bannerUrl: string | null;
423
- isPublic: boolean;
424
- }
425
- interface ShadowUser {
426
- id: string;
427
- email?: string;
428
- username: string;
429
- displayName?: string;
430
- avatarUrl?: string;
431
- isBot?: boolean;
432
- agentId?: string;
433
- membership?: ShadowMembership;
434
- }
435
- interface ShadowMembership {
436
- status: string;
437
- tier: {
438
- id: string;
439
- level: number;
440
- label: string;
441
- capabilities: string[];
442
- };
443
- level: number;
444
- isMember: boolean;
445
- memberSince?: string | null;
446
- inviteCodeId?: string | null;
447
- capabilities: string[];
448
- }
449
- interface ShadowAuthResponse {
450
- user: ShadowUser;
451
- accessToken: string;
452
- refreshToken: string;
453
- }
454
- type ShadowPlayAction = {
455
- kind: 'public_channel';
456
- serverId?: string;
457
- serverSlug?: string;
458
- channelId?: string;
459
- channelName?: string;
460
- inviteCode?: string;
461
- buddyUserIds?: string[];
462
- buddyTemplateSlug?: string;
463
- greeting?: string;
464
- } | {
465
- kind: 'private_room';
466
- serverId?: string;
467
- serverSlug?: string;
468
- namePrefix?: string;
469
- buddyUserIds?: string[];
470
- buddyTemplateSlug?: string;
471
- greeting?: string;
472
- } | {
473
- kind: 'cloud_deploy';
474
- templateSlug: string;
475
- buddyTemplateSlug?: string;
476
- buddyUserIds?: string[];
477
- greeting?: string;
478
- resourceTier?: 'lightweight' | 'standard' | 'pro';
479
- defaultChannelName?: string;
480
- } | {
481
- kind: 'external_oauth_app';
482
- clientId: string;
483
- redirectUri: string;
484
- scopes?: string[];
485
- state?: string;
486
- } | {
487
- kind: 'landing_page';
488
- url: string;
489
- };
490
- type ShadowPlayAvailability = 'available' | 'gated' | 'coming_soon' | 'misconfigured';
491
- interface ShadowHomePlayCatalogItem {
492
- id: string;
493
- image: string;
494
- title: string;
495
- titleEn: string;
496
- desc: string;
497
- descEn: string;
498
- category: string;
499
- categoryEn: string;
500
- starts: string;
501
- accentColor: string;
502
- hot?: boolean;
503
- status: ShadowPlayAvailability;
504
- action?: ShadowPlayAction;
505
- gates?: {
506
- auth?: 'optional' | 'required';
507
- membership?: 'none' | 'required';
508
- profile?: 'optional' | 'required';
509
- };
510
- template?: {
511
- kind: 'cloud';
512
- slug: string;
513
- path: string;
514
- };
515
- materials?: {
516
- cover: string;
517
- };
518
- }
519
- interface ShadowPlayLaunchResult {
520
- ok: boolean;
521
- status: string;
522
- playId?: string | null;
523
- redirectUrl?: string;
524
- serverId?: string;
525
- channelId?: string;
526
- deploymentId?: string;
527
- deploymentStatus?: string;
528
- templateSlug?: string;
529
- }
530
- interface ShadowModelProxyModel {
531
- id: string;
532
- object: 'model';
533
- created: number;
534
- owned_by: string;
535
- }
536
- interface ShadowModelProxyModelsResponse {
537
- object: 'list';
538
- data: ShadowModelProxyModel[];
539
- }
540
- interface ShadowModelProxyBilling {
541
- enabled: boolean;
542
- currency: 'shrimp';
543
- model: string;
544
- models: string[];
545
- shrimpMicrosPerCoin: number;
546
- shrimpPerCny: number;
547
- inputTokensPerShrimp: number | null;
548
- outputTokensPerShrimp: number | null;
549
- inputCacheHitCnyPerMillionTokens: number;
550
- inputCacheMissCnyPerMillionTokens: number;
551
- outputCnyPerMillionTokens: number;
552
- inputCacheHitShrimpPerMillionTokens: number;
553
- inputCacheMissShrimpPerMillionTokens: number;
554
- outputShrimpPerMillionTokens: number;
555
- }
556
- type ShadowModelProxyChatCompletionRequest = Record<string, unknown> & {
557
- model?: string;
558
- messages: unknown[];
559
- stream?: boolean;
560
- };
561
- type ShadowModelProxyChatCompletionResponse = Record<string, unknown>;
562
- interface ShadowNotification {
563
- id: string;
564
- userId: string;
565
- type: string;
566
- kind?: string | null;
567
- title: string;
568
- body: string | null;
569
- referenceId?: string | null;
570
- referenceType?: string | null;
571
- senderId?: string | null;
572
- senderAvatarUrl?: string | null;
573
- scopeServerId?: string | null;
574
- scopeChannelId?: string | null;
575
- aggregationKey?: string | null;
576
- aggregatedCount?: number | null;
577
- lastAggregatedAt?: string | null;
578
- metadata?: Record<string, unknown> | null;
579
- isRead: boolean;
580
- createdAt: string;
581
- expiresAt?: string | null;
582
- }
583
- interface ShadowScopedUnread {
584
- channelUnread: Record<string, number>;
585
- serverUnread: Record<string, number>;
586
- dmUnread?: Record<string, number>;
587
- }
588
- interface ShadowChannelPolicy {
589
- listen: boolean;
590
- reply: boolean;
591
- mentionOnly: boolean;
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;
601
- }
602
- interface ShadowSlashCommand {
603
- name: string;
604
- description?: string;
605
- aliases?: string[];
606
- packId?: string;
607
- sourcePath?: string;
608
- interaction?: ShadowInteractiveBlock;
609
- }
610
- interface ShadowChannelSlashCommand extends ShadowSlashCommand {
611
- agentId: string;
612
- botUserId: string;
613
- botUsername: string;
614
- botDisplayName?: string | null;
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
- }
630
- interface ShadowRemoteChannel {
631
- id: string;
632
- name: string;
633
- type: string;
634
- policy: ShadowChannelPolicy;
635
- }
636
- interface ShadowRemoteServer {
637
- id: string;
638
- name: string;
639
- slug?: string;
640
- iconUrl?: string | null;
641
- defaultPolicy: ShadowChannelPolicy;
642
- channels: ShadowRemoteChannel[];
643
- }
644
- interface ShadowRemoteConfig {
645
- agentId: string;
646
- botUserId: string;
647
- ownerId?: string;
648
- buddyMode?: 'private' | 'shareable';
649
- allowedServerIds?: string[];
650
- activeTenantIds?: string[];
651
- allowedTriggerUserIds?: string[];
652
- slashCommands?: ShadowSlashCommand[];
653
- servers: ShadowRemoteServer[];
654
- }
655
- interface ShadowUsageProviderSnapshot {
656
- provider: string;
657
- amountUsd?: number | null;
658
- usageLabel?: string | null;
659
- raw?: string | null;
660
- inputTokens?: number | null;
661
- outputTokens?: number | null;
662
- totalTokens?: number | null;
663
- }
664
- interface ShadowAgentUsageSnapshotInput {
665
- source?: string;
666
- model?: string | null;
667
- totalUsd?: number | null;
668
- inputTokens?: number | null;
669
- outputTokens?: number | null;
670
- cacheReadTokens?: number | null;
671
- cacheWriteTokens?: number | null;
672
- totalTokens?: number | null;
673
- providers?: ShadowUsageProviderSnapshot[];
674
- raw?: Record<string, unknown>;
675
- generatedAt?: string;
676
- }
677
- interface TypingPayload {
678
- channelId: string;
679
- userId: string;
680
- username: string;
681
- displayName?: string | null;
682
- typing?: boolean;
683
- }
684
- interface PresenceChangePayload {
685
- userId: string;
686
- status: 'online' | 'idle' | 'dnd' | 'offline';
687
- }
688
- interface PresenceActivityPayload {
689
- userId: string;
690
- activity: string | null;
691
- channelId: string;
692
- username?: string;
693
- displayName?: string | null;
694
- }
695
- interface MemberJoinPayload {
696
- channelId: string;
697
- userId: string;
698
- }
699
- interface MemberLeavePayload {
700
- channelId: string;
701
- userId: string;
702
- }
703
- interface SlashCommandsUpdatedPayload {
704
- channelId: string;
705
- serverId?: string;
706
- agentId?: string;
707
- botUserId?: string;
708
- commandCount?: number;
709
- }
710
- interface ReactionPayload {
711
- messageId: string;
712
- userId: string;
713
- emoji: string;
714
- }
715
- interface MessageDeletedPayload {
716
- id: string;
717
- channelId: string;
718
- }
719
- interface ChannelCreatedPayload {
720
- id: string;
721
- name: string;
722
- type: string;
723
- serverId: string;
724
- }
725
- interface ChannelMemberAddedPayload {
726
- channelId: string;
727
- serverId?: string;
728
- userId?: string;
729
- }
730
- interface ChannelMemberRemovedPayload {
731
- channelId: string;
732
- serverId?: string;
733
- userId?: string;
734
- }
735
- interface ServerJoinedPayload {
736
- serverId: string;
737
- serverName: string;
738
- }
739
- interface PolicyChangedPayload {
740
- agentId: string;
741
- serverId: string;
742
- channelId?: string | null;
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
- }
753
- interface ShadowFriendship {
754
- id: string;
755
- userId: string;
756
- friendId: string;
757
- status: 'pending' | 'accepted' | 'rejected';
758
- createdAt: string;
759
- user?: ShadowUser;
760
- friend?: ShadowUser;
761
- }
762
- interface ShadowOAuthApp {
763
- id: string;
764
- name: string;
765
- clientId: string;
766
- clientSecret?: string;
767
- redirectUris: string[];
768
- scopes: string[];
769
- createdAt: string;
770
- }
771
- interface ShadowOAuthConsent {
772
- id: string;
773
- appId: string;
774
- appName: string;
775
- scopes: string[];
776
- createdAt: string;
777
- }
778
- interface ShadowOAuthToken {
779
- access_token: string;
780
- token_type: string;
781
- expires_in: number;
782
- refresh_token?: string;
783
- scope: string;
784
- }
785
- interface ShadowListing {
786
- id: string;
787
- agentId: string;
788
- title: string;
789
- description: string;
790
- pricePerHour: number;
791
- currency: string;
792
- tags: string[];
793
- isActive: boolean;
794
- createdAt: string;
795
- agent?: {
796
- id: string;
797
- name: string;
798
- status: string;
799
- };
800
- }
801
- interface ShadowContract {
802
- id: string;
803
- listingId: string;
804
- tenantId: string;
805
- ownerId: string;
806
- status: string;
807
- startedAt: string;
808
- expiresAt: string;
809
- totalCost: number;
810
- createdAt: string;
811
- }
812
- interface ShadowShop {
813
- id: string;
814
- scopeKind?: 'server' | 'user';
815
- serverId?: string | null;
816
- ownerUserId?: string | null;
817
- visibility?: string;
818
- name: string;
819
- description?: string | null;
820
- isEnabled: boolean;
821
- }
822
- type ShadowCommunityAssetType = 'badge' | 'gift' | 'coupon' | 'service_ticket' | 'collectible' | 'content_pass' | 'reward';
823
- interface ShadowCommunityAssetDefinition {
824
- id: string;
825
- issuerKind: 'platform' | 'server' | 'user' | 'shop';
826
- issuerId?: string | null;
827
- shopId?: string | null;
828
- assetType: ShadowCommunityAssetType;
829
- name: string;
830
- description?: string | null;
831
- imageUrl?: string | null;
832
- giftable: boolean;
833
- transferable: boolean;
834
- consumable: boolean;
835
- revocable: boolean;
836
- expiresAfterDays?: number | null;
837
- status: 'draft' | 'active' | 'paused' | 'archived';
838
- metadata?: Record<string, unknown> | null;
839
- createdAt?: string;
840
- updatedAt?: string;
841
- }
842
- interface ShadowCommunityAssetGrant {
843
- id: string;
844
- definitionId: string;
845
- ownerUserId: string;
846
- sourceKind: string;
847
- sourceId?: string | null;
848
- quantity: number;
849
- remainingQuantity: number;
850
- status: 'active' | 'locked' | 'consumed' | 'revoked' | 'expired';
851
- expiresAt?: string | null;
852
- metadata?: Record<string, unknown> | null;
853
- createdAt?: string;
854
- updatedAt?: string;
855
- }
856
- interface ShadowCommunityAsset {
857
- grant: ShadowCommunityAssetGrant;
858
- definition: ShadowCommunityAssetDefinition;
859
- }
860
- interface ShadowEconomyTip {
861
- id: string;
862
- senderUserId: string;
863
- recipientUserId: string;
864
- amount: number;
865
- sellerNet: number;
866
- status: 'succeeded' | 'failed' | 'reversed' | 'held';
867
- contextKind?: string | null;
868
- contextId?: string | null;
869
- message?: string | null;
870
- createdAt?: string;
871
- }
872
- interface ShadowEconomyGift {
873
- id: string;
874
- senderUserId: string;
875
- recipientUserId: string;
876
- status: 'succeeded' | 'failed' | 'reversed' | 'held';
877
- message?: string | null;
878
- metadata?: Record<string, unknown> | null;
879
- createdAt?: string;
880
- }
881
- interface ShadowSettlementLine {
882
- id: string;
883
- sellerUserId: string;
884
- shopId?: string | null;
885
- sourceType: 'order' | 'tip' | 'gift' | 'adjustment';
886
- sourceId: string;
887
- grossAmount: number;
888
- platformFee: number;
889
- netAmount: number;
890
- status: 'pending' | 'available' | 'settled' | 'failed' | 'held' | 'reversed';
891
- availableAt?: string | null;
892
- settledAt?: string | null;
893
- createdAt?: string;
894
- updatedAt?: string;
895
- }
896
- interface ShadowCommerceProductCard {
897
- id: string;
898
- kind: 'offer' | 'product';
899
- offerId?: string;
900
- shopId: string;
901
- shopScope: {
902
- kind: 'server' | 'user';
903
- id: string;
904
- };
905
- productId: string;
906
- skuId?: string;
907
- snapshot: {
908
- name: string;
909
- summary?: string | null;
910
- imageUrl?: string | null;
911
- shopName?: string | null;
912
- deliveryPromise?: string | null;
913
- price: number;
914
- currency: string;
915
- productType: 'physical' | 'entitlement';
916
- billingMode?: 'one_time' | 'fixed_duration' | 'subscription';
917
- durationSeconds?: number | null;
918
- resourceType?: string;
919
- resourceId?: string;
920
- capability?: string;
921
- };
922
- purchase: {
923
- mode: 'direct' | 'select_sku' | 'open_detail';
924
- };
925
- }
926
- interface ShadowCommerceProductPickerGroup {
927
- key: string;
928
- labelKey: string;
929
- shopId: string;
930
- shopName: string;
931
- shopScope: {
932
- kind: 'server' | 'user';
933
- id: string;
934
- };
935
- cards: ShadowCommerceProductCard[];
936
- }
937
- interface ShadowCommerceProductPickerResponse {
938
- cards: ShadowCommerceProductCard[];
939
- groups?: ShadowCommerceProductPickerGroup[];
940
- }
941
- interface ShadowEntitlementProvisioning {
942
- status: 'provisioned' | 'manual_pending' | 'failed' | string;
943
- code: string;
944
- provisionedAt?: string;
945
- checkedAt?: string;
946
- resourceType?: string | null;
947
- resourceId?: string | null;
948
- capability?: string | null;
949
- }
950
- interface ShadowEntitlement {
951
- id: string;
952
- userId: string;
953
- serverId?: string | null;
954
- shopId?: string | null;
955
- orderId?: string | null;
956
- productId?: string | null;
957
- offerId?: string | null;
958
- scopeKind?: 'server' | 'user' | string;
959
- resourceType: string;
960
- resourceId: string;
961
- capability: string;
962
- status: string;
963
- isActive: boolean;
964
- startsAt?: string;
965
- expiresAt?: string | null;
966
- nextRenewalAt?: string | null;
967
- cancelledAt?: string | null;
968
- revokedAt?: string | null;
969
- metadata?: Record<string, unknown> | null;
970
- createdAt?: string;
971
- updatedAt?: string;
972
- shop?: {
973
- id: string;
974
- scopeKind: 'server' | 'user' | string;
975
- serverId?: string | null;
976
- ownerUserId?: string | null;
977
- name: string;
978
- logoUrl?: string | null;
979
- } | null;
980
- product?: {
981
- id: string;
982
- shopId: string;
983
- name: string;
984
- summary?: string | null;
985
- type: 'physical' | 'entitlement' | string;
986
- basePrice: number;
987
- currency: string;
988
- billingMode: 'one_time' | 'fixed_duration' | 'subscription' | string;
989
- entitlementConfig?: Record<string, unknown> | Record<string, unknown>[] | null;
990
- } | null;
991
- offer?: {
992
- id: string;
993
- shopId: string;
994
- productId: string;
995
- priceOverride?: number | null;
996
- currency: string;
997
- status: string;
998
- } | null;
999
- paidFile?: {
1000
- id: string;
1001
- name: string;
1002
- mime?: string | null;
1003
- sizeBytes?: number | null;
1004
- previewUrl?: string | null;
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;
1068
- }
1069
- interface ShadowEntitlementPurchaseResult {
1070
- order: {
1071
- id: string;
1072
- orderNo: string;
1073
- status: string;
1074
- totalAmount: number;
1075
- };
1076
- entitlement: Record<string, unknown>;
1077
- provisioning?: ShadowEntitlementProvisioning;
1078
- fulfillmentJobs?: Record<string, unknown>[];
1079
- nextAction?: 'open_paid_file' | 'view_entitlement' | string;
1080
- }
1081
- interface ShadowCommerceCheckoutPreview {
1082
- offer: {
1083
- id: string;
1084
- status: string;
1085
- available: boolean;
1086
- allowedSurfaces?: string[] | null;
1087
- };
1088
- shop: {
1089
- id: string;
1090
- name: string;
1091
- scopeKind: 'server' | 'user' | string;
1092
- logoUrl?: string | null;
1093
- };
1094
- product: {
1095
- id: string;
1096
- name: string;
1097
- summary?: string | null;
1098
- imageUrl?: string | null;
1099
- type: 'physical' | 'entitlement' | string;
1100
- billingMode?: 'one_time' | 'fixed_duration' | 'subscription' | string;
1101
- price: number;
1102
- currency: string;
1103
- durationSeconds?: number | null;
1104
- };
1105
- entitlement?: {
1106
- resourceType: string;
1107
- resourceId: string;
1108
- capability: string;
1109
- access: {
1110
- allowed: boolean;
1111
- status: string;
1112
- reasonCode?: string | null;
1113
- entitlement?: Record<string, unknown> | null;
1114
- };
1115
- } | null;
1116
- paidFile?: {
1117
- id: string;
1118
- name: string;
1119
- mime?: string | null;
1120
- sizeBytes?: number | null;
1121
- previewUrl?: string | null;
1122
- } | null;
1123
- deliverables?: Record<string, unknown>[];
1124
- viewerState: 'not_purchased' | 'active' | 'expired' | 'revoked' | 'cancelled' | 'unavailable';
1125
- primaryAction?: 'purchase' | 'open_content' | 'renew' | 'view_detail' | 'view_progress' | 'unavailable' | string;
1126
- displayState?: {
1127
- viewerState: string;
1128
- primaryAction: string;
1129
- price: {
1130
- amount: number;
1131
- currency: string;
1132
- };
1133
- balance?: {
1134
- current: number;
1135
- afterPurchase?: number;
1136
- shortfall?: number;
1137
- } | null;
1138
- seller?: {
1139
- shopId: string;
1140
- shopName: string;
1141
- buddyUserId?: string | null;
1142
- };
1143
- entitlement?: Record<string, unknown> | null;
1144
- delivery?: Record<string, unknown> | null;
1145
- content?: Record<string, unknown> | null;
1146
- };
1147
- nextAction: 'purchase' | 'open_paid_file' | 'view_entitlement' | string;
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
- }
1223
- interface ShadowPaidFileOpenResult {
1224
- grant: {
1225
- id: string;
1226
- fileId: string;
1227
- status: string;
1228
- expiresAt: string;
1229
- };
1230
- viewerUrl: string;
1231
- }
1232
- interface ShadowCategory {
1233
- id: string;
1234
- shopId: string;
1235
- name: string;
1236
- description?: string | null;
1237
- position: number;
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
- }
1263
- interface ShadowProduct {
1264
- id: string;
1265
- shopId: string;
1266
- categoryId?: string | null;
1267
- name: string;
1268
- slug?: string;
1269
- type?: 'physical' | 'entitlement' | string;
1270
- description?: string | null;
1271
- summary?: string | null;
1272
- price?: number;
1273
- basePrice?: number;
1274
- currency: string;
1275
- stock?: number;
1276
- status: string;
1277
- specNames?: string[];
1278
- tags?: string[];
1279
- salesCount?: number;
1280
- avgRating?: number;
1281
- ratingCount?: number;
1282
- billingMode?: 'one_time' | 'fixed_duration' | 'subscription';
1283
- entitlementConfig?: ShadowProductEntitlementConfig | ShadowProductEntitlementConfig[] | null;
1284
- media?: ShadowProductMedia[];
1285
- skus?: ShadowProductSku[];
1286
- images?: string[];
1287
- createdAt: string;
1288
- }
1289
- interface ShadowCartItem {
1290
- id: string;
1291
- productId: string;
1292
- quantity: number;
1293
- product?: ShadowProduct;
1294
- }
1295
- interface ShadowOrder {
1296
- id: string;
1297
- orderNo?: string;
1298
- shopId: string;
1299
- buyerId: string;
1300
- status: 'pending' | 'paid' | 'processing' | 'shipped' | 'delivered' | 'completed' | 'cancelled' | 'refunded' | string;
1301
- totalAmount: number;
1302
- currency: string;
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;
1312
- productId: string;
1313
- skuId?: string | null;
1314
- productName?: string;
1315
- specValues?: string[];
1316
- quantity: number;
1317
- price: number;
1318
- imageUrl?: string | null;
1319
- }>;
1320
- createdAt: string;
1321
- }
1322
- interface ShadowReview {
1323
- id: string;
1324
- orderId: string;
1325
- productId: string;
1326
- userId: string;
1327
- rating: number;
1328
- content: string;
1329
- reply?: string | null;
1330
- createdAt: string;
1331
- }
1332
- interface ShadowWallet {
1333
- id: string;
1334
- userId: string;
1335
- balance: number;
1336
- currency: string;
1337
- }
1338
- interface ShadowTransaction {
1339
- id: string;
1340
- walletId: string;
1341
- type: string;
1342
- amount: number;
1343
- balanceAfter?: number;
1344
- currency?: string;
1345
- referenceId?: string | null;
1346
- referenceType?: string | null;
1347
- note?: string | null;
1348
- description?: string | null;
1349
- display?: {
1350
- title?: string | null;
1351
- subtitle?: string | null;
1352
- } | null;
1353
- order?: Record<string, unknown> | null;
1354
- counterparty?: Record<string, unknown> | null;
1355
- createdAt: string;
1356
- }
1357
- type ShadowDiyCloudStepId = 'think' | 'search' | 'generate' | 'validate' | 'review';
1358
- interface ShadowDiyCloudGenerateInput {
1359
- prompt: string;
1360
- feedback?: string;
1361
- previousConfig?: Record<string, unknown>;
1362
- locale?: string;
1363
- timezone?: string;
1364
- }
1365
- interface ShadowDiyCloudAgentStepOutput {
1366
- type: 'agent_step_output';
1367
- schemaVersion: 1;
1368
- step: ShadowDiyCloudStepId;
1369
- status: ShadowDiyCloudProgressStatus;
1370
- title: string;
1371
- locale: string;
1372
- timezone: string;
1373
- generatedAt: string;
1374
- result: Record<string, unknown>;
1375
- reasons: string[];
1376
- confidence?: number;
1377
- }
1378
- interface ShadowDiyCloudDraft {
1379
- slug: string;
1380
- title: string;
1381
- description: string;
1382
- score: number;
1383
- steps: Array<{
1384
- id: ShadowDiyCloudStepId;
1385
- title: string;
1386
- detail: string;
1387
- }>;
1388
- matchedPlugins: Array<{
1389
- id: string;
1390
- name: string;
1391
- description: string;
1392
- reason: string;
1393
- capabilities: string[];
1394
- requiredKeys: string[];
1395
- matchedTerms: string[];
1396
- }>;
1397
- referenceTemplates: Array<{
1398
- slug: string;
1399
- title: string;
1400
- description: string;
1401
- category: string;
1402
- plugins: string[];
1403
- channels: string[];
1404
- buddyNames: string[];
1405
- reason: string;
1406
- }>;
1407
- suggestedSkills: string[];
1408
- requiredKeys: Array<{
1409
- key: string;
1410
- label: string;
1411
- description: string;
1412
- source: string;
1413
- sourcePluginId: string;
1414
- sensitive: boolean;
1415
- setupSteps: string[];
1416
- skipImpact: string;
1417
- }>;
1418
- toolTrace: Array<{
1419
- tool: 'search_plugins' | 'inspect_plugin' | 'search_templates' | 'inspect_template' | 'compile_template_dsl' | 'validate_template_dsl' | 'collect_required_keys';
1420
- query?: string;
1421
- resultIds: string[];
1422
- }>;
1423
- agentOutputs: ShadowDiyCloudAgentStepOutput[];
1424
- agentReport: {
1425
- objective: string;
1426
- assumptions: string[];
1427
- reasoning: Array<{
1428
- step: ShadowDiyCloudStepId;
1429
- title: string;
1430
- detail: string;
1431
- evidence: string[];
1432
- }>;
1433
- pluginDecisions: Array<{
1434
- id: string;
1435
- name: string;
1436
- reason: string;
1437
- capabilities: string[];
1438
- matchedTerms: string[];
1439
- requiredKeys: string[];
1440
- }>;
1441
- templateDecisions: Array<{
1442
- slug: string;
1443
- title: string;
1444
- reason: string;
1445
- plugins: string[];
1446
- channels: string[];
1447
- }>;
1448
- validationChecks: Array<{
1449
- name: string;
1450
- status: 'passed' | 'warning' | 'failed';
1451
- detail: string;
1452
- }>;
1453
- repairNotes: string[];
1454
- };
1455
- guidebook: {
1456
- summary: string;
1457
- beforeDeploy: string[];
1458
- howToUse: string[];
1459
- reviewNotes: string[];
1460
- };
1461
- template: Record<string, unknown>;
1462
- validation: {
1463
- valid: boolean;
1464
- agents: number;
1465
- configurations: number;
1466
- violations: Array<{
1467
- path: string;
1468
- prefix: string;
1469
- }>;
1470
- extendsErrors: string[];
1471
- templateRefs: {
1472
- env: number;
1473
- secret: number;
1474
- file: number;
1475
- };
1476
- };
1477
- }
1478
- type ShadowDiyCloudProgressStatus = 'running' | 'completed' | 'warning' | 'error';
1479
- type ShadowDiyCloudRunStatus = 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
1480
- interface ShadowDiyCloudRun {
1481
- runId: string;
1482
- input: ShadowDiyCloudGenerateInput;
1483
- status: ShadowDiyCloudRunStatus;
1484
- createdAt: string;
1485
- updatedAt: string;
1486
- expiresAt: string;
1487
- draft?: ShadowDiyCloudDraft;
1488
- error?: string;
1489
- }
1490
- type ShadowDiyCloudRunEvent = {
1491
- schemaVersion: 2;
1492
- seq: number;
1493
- runId: string;
1494
- eventId: string;
1495
- timestamp: string;
1496
- type: 'run.created' | 'run.started' | 'run.cancelled';
1497
- status?: ShadowDiyCloudRunStatus;
1498
- input?: ShadowDiyCloudGenerateInput;
1499
- expiresAt?: string;
1500
- } | {
1501
- schemaVersion: 2;
1502
- seq: number;
1503
- runId: string;
1504
- eventId: string;
1505
- timestamp: string;
1506
- type: 'step.created';
1507
- stepId: ShadowDiyCloudStepId;
1508
- title: string;
1509
- intent: string;
1510
- order: number;
1511
- iconHint?: string;
1512
- } | {
1513
- schemaVersion: 2;
1514
- seq: number;
1515
- runId: string;
1516
- eventId: string;
1517
- timestamp: string;
1518
- type: 'step.delta';
1519
- stepId: ShadowDiyCloudStepId;
1520
- channel: 'summary' | 'rationale' | 'status';
1521
- delta: string;
1522
- status?: ShadowDiyCloudProgressStatus;
1523
- title?: string;
1524
- meta?: Record<string, unknown>;
1525
- } | {
1526
- schemaVersion: 2;
1527
- seq: number;
1528
- runId: string;
1529
- eventId: string;
1530
- timestamp: string;
1531
- type: 'decision';
1532
- stepId: ShadowDiyCloudStepId;
1533
- decisionId: string;
1534
- title: string;
1535
- selected: string;
1536
- basis: {
1537
- observations: string[];
1538
- constraints: string[];
1539
- evidence: Array<{
1540
- source: string;
1541
- ref: string;
1542
- summary: string;
1543
- }>;
1544
- rejectedOptions: Array<{
1545
- option: string;
1546
- reason: string;
1547
- }>;
1548
- confidence?: number | null;
1549
- needsUserReview: boolean;
1550
- };
1551
- output?: ShadowDiyCloudAgentStepOutput;
1552
- } | {
1553
- schemaVersion: 2;
1554
- seq: number;
1555
- runId: string;
1556
- eventId: string;
1557
- timestamp: string;
1558
- type: 'artifact.patch';
1559
- stepId: ShadowDiyCloudStepId;
1560
- artifact: 'templateDsl' | 'cloudConfig' | 'guidebook' | 'requiredKeys';
1561
- patch: unknown;
1562
- } | {
1563
- schemaVersion: 2;
1564
- seq: number;
1565
- runId: string;
1566
- eventId: string;
1567
- timestamp: string;
1568
- type: 'guardrail.result';
1569
- stepId: ShadowDiyCloudStepId;
1570
- name: string;
1571
- status: 'passed' | 'warning' | 'failed' | 'error';
1572
- detail: string;
1573
- blocksRun: boolean;
1574
- } | {
1575
- schemaVersion: 2;
1576
- seq: number;
1577
- runId: string;
1578
- eventId: string;
1579
- timestamp: string;
1580
- type: 'draft.completed';
1581
- draft: ShadowDiyCloudDraft;
1582
- } | {
1583
- schemaVersion: 2;
1584
- seq: number;
1585
- runId: string;
1586
- eventId: string;
1587
- timestamp: string;
1588
- type: 'run.failed';
1589
- error: string;
1590
- code?: string;
1591
- retryable: boolean;
1592
- };
1593
- type ShadowCloudDeploymentStatus = 'pending' | 'deploying' | 'cancelling' | 'deployed' | 'paused' | 'resuming' | 'failed' | 'destroying' | 'destroyed';
1594
- interface ShadowCloudDeploymentRuntimeResponse {
1595
- ok: boolean;
1596
- status: ShadowCloudDeploymentStatus;
1597
- deployment?: Record<string, unknown>;
1598
- }
1599
- interface ShadowCloudDeploymentManifest {
1600
- deploymentId: string;
1601
- namespace: string;
1602
- name: string;
1603
- templateSlug: string | null;
1604
- template: Record<string, unknown> | null;
1605
- manifest: Record<string, unknown> | null;
1606
- drift: {
1607
- status: 'up-to-date' | 'template-updated' | 'missing-template' | 'unlinked' | 'unknown';
1608
- templateAvailable: boolean;
1609
- templateChanged: boolean;
1610
- deployedTemplateHash: string | null;
1611
- currentTemplateHash: string | null;
1612
- configHash: string | null;
1613
- };
1614
- configSnapshot: Record<string, unknown> | null;
1615
- }
1616
- interface ShadowCloudDeploymentTemplateSyncResult {
1617
- ok: boolean;
1618
- action: 'updated' | 'forked';
1619
- template: Record<string, unknown>;
1620
- manifest: ShadowCloudDeploymentManifest;
1621
- }
1622
- interface ShadowCloudDeploymentBackup {
1623
- id: string;
1624
- deploymentId: string;
1625
- namespace: string;
1626
- agentId: string;
1627
- sandboxName: string | null;
1628
- pvcName: string;
1629
- driver: 'volumeSnapshot' | 'restic' | string;
1630
- snapshotName: string | null;
1631
- objectKey: string | null;
1632
- status: 'pending' | 'running' | 'succeeded' | 'failed' | 'expired' | string;
1633
- phase: string;
1634
- error: string | null;
1635
- expiresAt: string | null;
1636
- createdAt: string;
1637
- updatedAt: string;
1638
- }
1639
- interface ShadowCloudProviderCatalog {
1640
- pluginId: string;
1641
- pluginName: string;
1642
- provider: Record<string, unknown>;
1643
- secretFields?: Record<string, unknown>[];
1644
- }
1645
- interface ShadowCloudProviderEnvVar {
1646
- key: string;
1647
- maskedValue: string;
1648
- isSecret: boolean;
1649
- }
1650
- interface ShadowCloudProviderModel {
1651
- id: string;
1652
- name?: string;
1653
- tags?: string[];
1654
- contextWindow?: number;
1655
- maxTokens?: number;
1656
- cost?: {
1657
- input?: number;
1658
- output?: number;
1659
- };
1660
- capabilities?: {
1661
- vision?: boolean;
1662
- tools?: boolean;
1663
- reasoning?: boolean;
1664
- };
1665
- }
1666
- interface ShadowCloudProviderProfile {
1667
- id: string;
1668
- providerId: string;
1669
- name: string;
1670
- scope: string;
1671
- enabled: boolean;
1672
- config: {
1673
- baseUrl?: string;
1674
- apiFormat?: 'openai' | 'anthropic' | 'gemini';
1675
- authType?: 'api_key';
1676
- discoveredAt?: string;
1677
- models?: ShadowCloudProviderModel[];
1678
- [key: string]: unknown;
1679
- };
1680
- envVars: ShadowCloudProviderEnvVar[];
1681
- updatedAt?: string;
1682
- }
1683
- interface ShadowTask {
1684
- key: string;
1685
- title: string;
1686
- description: string;
1687
- reward: number;
1688
- status: string;
1689
- claimedAt?: string | null;
1690
- }
1691
- interface ShadowRechargeTier {
1692
- key: string;
1693
- shrimpCoins: number;
1694
- usdCents: number;
1695
- label: string;
1696
- }
1697
- interface ShadowRechargeConfig {
1698
- tiers: ShadowRechargeTier[];
1699
- customAmountMin: number;
1700
- customAmountMax: number;
1701
- exchangeRate: number;
1702
- stripePublishableKey: string;
1703
- }
1704
- interface ShadowRechargeIntent {
1705
- clientSecret: string;
1706
- paymentIntentId: string;
1707
- orderNo: string;
1708
- amount: {
1709
- shrimpCoins: number;
1710
- usdCents: number;
1711
- };
1712
- }
1713
- interface ShadowPaymentOrder {
1714
- id: string;
1715
- orderNo: string;
1716
- shrimpCoinAmount: number;
1717
- usdAmount: number;
1718
- status: string;
1719
- localCurrencyAmount?: number | null;
1720
- localCurrency?: string | null;
1721
- createdAt: string;
1722
- paidAt?: string | null;
1723
- }
1724
- interface ShadowRechargeHistory {
1725
- items: ShadowPaymentOrder[];
1726
- total: number;
1727
- limit: number;
1728
- offset: number;
1729
- }
1730
- interface ShadowNotificationPreferences {
1731
- strategy: 'all' | 'mention_only' | 'none';
1732
- mutedServerIds: string[];
1733
- mutedChannelIds: string[];
1734
- }
1735
- /** Events the server pushes to the client */
1736
- interface ServerEventMap {
1737
- 'message:new': (message: ShadowMessage) => void;
1738
- 'message:updated': (message: ShadowMessage) => void;
1739
- 'message:deleted': (payload: MessageDeletedPayload) => void;
1740
- 'message:typing': (payload: TypingPayload) => void;
1741
- 'member:typing': (payload: TypingPayload) => void;
1742
- 'member:join': (payload: MemberJoinPayload) => void;
1743
- 'member:joined': (payload: MemberJoinPayload & {
1744
- isBot?: boolean;
1745
- }) => void;
1746
- 'member:leave': (payload: MemberLeavePayload) => void;
1747
- 'member:left': (payload: MemberLeavePayload) => void;
1748
- 'presence:change': (payload: PresenceChangePayload) => void;
1749
- 'presence:activity': (payload: PresenceActivityPayload) => void;
1750
- 'reaction:add': (payload: ReactionPayload) => void;
1751
- 'reaction:remove': (payload: ReactionPayload) => void;
1752
- 'notification:new': (notification: ShadowNotification) => void;
1753
- 'channel:created': (payload: ChannelCreatedPayload) => void;
1754
- 'channel:member-added': (payload: ChannelMemberAddedPayload) => void;
1755
- 'channel:member-removed': (payload: ChannelMemberRemovedPayload) => void;
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;
1762
- 'server:joined': (payload: ServerJoinedPayload) => void;
1763
- 'agent:policy-changed': (payload: PolicyChangedPayload) => void;
1764
- error: (payload: {
1765
- message: string;
1766
- }) => void;
1767
- }
1768
- /** Events the client sends to the server */
1769
- interface ClientEventMap {
1770
- 'channel:join': (data: {
1771
- channelId: string;
1772
- }, ack?: (res: {
1773
- ok: boolean;
1774
- }) => void) => void;
1775
- 'channel:leave': (data: {
1776
- channelId: string;
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;
1824
- 'message:send': (data: {
1825
- channelId: string;
1826
- content: string;
1827
- threadId?: string;
1828
- replyToId?: string;
1829
- mentions?: ShadowMessageMention[];
1830
- metadata?: Record<string, unknown>;
1831
- }) => void;
1832
- 'message:typing': (data: {
1833
- channelId: string;
1834
- typing?: boolean;
1835
- }) => void;
1836
- 'presence:update': (data: {
1837
- status: 'online' | 'idle' | 'dnd' | 'offline';
1838
- }) => void;
1839
- 'presence:activity': (data: {
1840
- channelId: string;
1841
- activity: string | null;
1842
- }) => void;
1843
- }
6
+ export { CLIENT_EVENTS, ClientEvent, SERVER_EVENTS, ServerEvent } from '@shadowob/shared';
1844
7
 
1845
8
  /**
1846
9
  * Shadow REST API client.
@@ -1851,6 +14,7 @@ declare class ShadowClient {
1851
14
  private token;
1852
15
  private baseUrl;
1853
16
  constructor(baseUrl: string, token: string);
17
+ serverAppEventStreamUrl(eventStreamPath: string): string;
1854
18
  private isShadowPrivateMediaUrl;
1855
19
  private request;
1856
20
  private requestRaw;
@@ -1878,6 +42,21 @@ declare class ShadowClient {
1878
42
  code: string;
1879
43
  displayName?: string;
1880
44
  }): Promise<ShadowAuthResponse>;
45
+ startPasswordReset(data: {
46
+ email: string;
47
+ locale?: string;
48
+ }): Promise<{
49
+ ok: true;
50
+ expiresIn: number;
51
+ devToken?: string;
52
+ }>;
53
+ completePasswordReset(data: {
54
+ token: string;
55
+ newPassword: string;
56
+ confirmPassword: string;
57
+ }): Promise<{
58
+ ok: boolean;
59
+ }>;
1881
60
  refreshToken(refreshToken: string): Promise<{
1882
61
  accessToken: string;
1883
62
  refreshToken: string;
@@ -1950,6 +129,45 @@ declare class ShadowClient {
1950
129
  generateAgentToken(agentId: string): Promise<{
1951
130
  token: string;
1952
131
  }>;
132
+ listConnectorComputers(): Promise<{
133
+ computers: ShadowConnectorComputer[];
134
+ }>;
135
+ createConnectorBootstrap(data: {
136
+ serverUrl: string;
137
+ name?: string;
138
+ }): Promise<ShadowConnectorBootstrapResult>;
139
+ createAgentOnConnectorComputer(computerId: string, data: {
140
+ runtimeId: string;
141
+ serverUrl: string;
142
+ name: string;
143
+ username: string;
144
+ description?: string;
145
+ avatarUrl?: string | null;
146
+ buddyMode?: 'private' | 'shareable';
147
+ allowedServerIds?: string[];
148
+ }): Promise<{
149
+ agent: {
150
+ id: string;
151
+ userId: string;
152
+ status: string;
153
+ };
154
+ job: {
155
+ id: string;
156
+ } | null;
157
+ }>;
158
+ configureAgentOnConnectorComputer(computerId: string, agentId: string, data: {
159
+ runtimeId: string;
160
+ serverUrl: string;
161
+ }): Promise<{
162
+ agent: {
163
+ id: string;
164
+ userId: string;
165
+ status: string;
166
+ };
167
+ job: {
168
+ id: string;
169
+ } | null;
170
+ }>;
1953
171
  startAgent(agentId: string): Promise<{
1954
172
  ok: boolean;
1955
173
  }>;
@@ -1984,6 +202,7 @@ declare class ShadowClient {
1984
202
  }[]>;
1985
203
  upsertPolicy(agentId: string, serverId: string, data: {
1986
204
  channelId?: string | null;
205
+ listen?: boolean;
1987
206
  mentionOnly?: boolean;
1988
207
  reply?: boolean;
1989
208
  config?: Record<string, unknown>;
@@ -2031,19 +250,43 @@ declare class ShadowClient {
2031
250
  buddyAgentId: string;
2032
251
  permissions: string[];
2033
252
  resourceRules?: Record<string, unknown>;
2034
- approvalMode?: 'none' | 'first_time' | 'every_time' | 'policy';
253
+ approvalMode?: ShadowServerAppApprovalMode;
2035
254
  expiresAt?: string;
2036
255
  }): Promise<Record<string, unknown>>;
256
+ updateServerAppAccessPolicy(serverIdOrSlug: string, appKey: string, data: {
257
+ defaultPermissions: string[];
258
+ defaultApprovalMode?: ShadowServerAppApprovalMode;
259
+ }): Promise<ShadowServerAppIntegration & {
260
+ grants?: Record<string, unknown>[];
261
+ }>;
262
+ approveServerAppCommand(serverIdOrSlug: string, appKey: string, data: {
263
+ commandName: string;
264
+ buddyAgentId?: string;
265
+ remember?: boolean;
266
+ }): Promise<{
267
+ ok: true;
268
+ consent: ShadowServerAppCommandConsent;
269
+ }>;
2037
270
  getServerAppSkills(serverIdOrSlug: string, appKey: string): Promise<ShadowServerAppSkillDocument>;
2038
271
  createServerAppLaunch(serverIdOrSlug: string, appKey: string): Promise<ShadowServerAppLaunchContext>;
2039
272
  introspectServerAppToken(serverIdOrSlug: string, appKey: string, token: string): Promise<ShadowServerAppTokenIntrospection>;
2040
273
  callServerAppCommand(serverIdOrSlug: string, appKey: string, commandName: string, data?: {
2041
274
  input?: unknown;
2042
275
  channelId?: string;
276
+ task?: {
277
+ messageId: string;
278
+ cardId: string;
279
+ claimId?: string;
280
+ };
2043
281
  }): Promise<unknown>;
2044
282
  callServerAppCommandMultipart(serverIdOrSlug: string, appKey: string, commandName: string, data: {
2045
283
  input?: unknown;
2046
284
  channelId?: string;
285
+ task?: {
286
+ messageId: string;
287
+ cardId: string;
288
+ claimId?: string;
289
+ };
2047
290
  file: Blob;
2048
291
  filename: string;
2049
292
  field?: string;
@@ -2183,6 +426,44 @@ declare class ShadowClient {
2183
426
  hasMore: boolean;
2184
427
  }>;
2185
428
  getMessage(messageId: string): Promise<ShadowMessage>;
429
+ listBuddyInboxes(): Promise<ShadowBuddyInboxSummary[]>;
430
+ listServerBuddyInboxes(serverIdOrSlug: string): Promise<ShadowBuddyInboxSummary[]>;
431
+ ensureBuddyInbox(serverIdOrSlug: string, agentId: string): Promise<ShadowEnsureBuddyInboxResult>;
432
+ getBuddyInboxAdmissionPolicy(serverIdOrSlug: string, agentId: string): Promise<ShadowBuddyInboxAdmissionPolicyResult>;
433
+ updateBuddyInboxAdmissionPolicy(serverIdOrSlug: string, agentId: string, policy: ShadowBuddyInboxAdmissionPolicy): Promise<ShadowBuddyInboxAdmissionPolicyResult>;
434
+ listBuddyInboxAdmissionPending(serverIdOrSlug: string, agentId: string): Promise<ShadowBuddyInboxAdmissionPendingResult>;
435
+ approveBuddyInboxAdmissionPending(serverIdOrSlug: string, agentId: string, pendingId: string): Promise<ShadowBuddyInboxAdmissionPendingActionResult>;
436
+ rejectBuddyInboxAdmissionPending(serverIdOrSlug: string, agentId: string, pendingId: string): Promise<ShadowBuddyInboxAdmissionPendingActionResult>;
437
+ enqueueInboxTaskForAgent(serverIdOrSlug: string, agentId: string, task: ShadowInboxTaskInput): Promise<ShadowMessage>;
438
+ enqueueInboxTask(channelId: string, task: ShadowInboxTaskInput): Promise<ShadowMessage>;
439
+ claimTaskCard(messageId: string, cardId: string, data?: {
440
+ ttlSeconds?: number;
441
+ note?: string;
442
+ }): Promise<ShadowMessage>;
443
+ updateTaskCard(messageId: string, cardId: string, data: {
444
+ status: 'queued' | 'claimed' | 'running' | 'completed' | 'failed' | 'canceled' | 'transferred';
445
+ note?: string;
446
+ }): Promise<ShadowMessage>;
447
+ retryTaskCard(messageId: string, cardId: string, data?: {
448
+ note?: string;
449
+ }): Promise<{
450
+ original: ShadowMessage;
451
+ retry: ShadowMessage;
452
+ }>;
453
+ claimNextInboxTask(serverIdOrSlug: string, agentId: string, data?: {
454
+ ttlSeconds?: number;
455
+ note?: string;
456
+ }): Promise<{
457
+ channel: ShadowChannel;
458
+ message: ShadowMessage | null;
459
+ card: ShadowMessageCard | null;
460
+ }>;
461
+ promoteMessageToInboxTask(messageId: string, data: {
462
+ serverId: string;
463
+ agentId: string;
464
+ title?: string;
465
+ priority?: 'low' | 'normal' | 'high' | 'urgent';
466
+ }): Promise<ShadowMessage>;
2186
467
  submitInteractiveAction(messageId: string, input: ShadowInteractiveActionInput): Promise<ShadowInteractiveActionResult>;
2187
468
  getInteractiveState(messageId: string, blockId?: string): Promise<ShadowInteractiveState>;
2188
469
  editMessage(messageId: string, content: string): Promise<ShadowMessage>;
@@ -2248,10 +529,53 @@ declare class ShadowClient {
2248
529
  }>;
2249
530
  uploadMedia(file: Blob | ArrayBuffer, filename: string, contentType: string, messageId?: string | {
2250
531
  messageId?: string;
532
+ kind?: 'file' | 'image' | 'voice';
533
+ durationMs?: number;
534
+ waveformPeaks?: number[];
535
+ transcriptText?: string;
536
+ transcriptLanguage?: string;
537
+ transcriptSource?: 'client' | 'runtime';
2251
538
  }): Promise<{
2252
539
  url: string;
2253
540
  key: string;
2254
541
  size: number;
542
+ kind?: 'file' | 'image' | 'voice';
543
+ durationMs?: number | null;
544
+ waveformPeaks?: number[] | null;
545
+ }>;
546
+ sendVoiceMessage(channelId: string, file: Blob | ArrayBuffer, filename: string, contentType: string, opts: {
547
+ durationMs: number;
548
+ threadId?: string;
549
+ replyToId?: string;
550
+ waveformPeaks?: number[];
551
+ transcriptText?: string;
552
+ transcriptLanguage?: string;
553
+ transcriptSource?: 'client' | 'runtime';
554
+ }): Promise<ShadowMessage>;
555
+ markVoicePlayed(attachmentId: string, input?: {
556
+ positionMs?: number;
557
+ completed?: boolean;
558
+ }): Promise<{
559
+ ok: true;
560
+ playback: {
561
+ played: boolean;
562
+ completed: boolean;
563
+ lastPositionMs: number;
564
+ };
565
+ }>;
566
+ requestVoiceTranscript(attachmentId: string, input?: {
567
+ language?: string | null;
568
+ }): Promise<{
569
+ ok: true;
570
+ transcript: NonNullable<ShadowAttachment['transcript']>;
571
+ }>;
572
+ updateVoiceTranscript(attachmentId: string, input: {
573
+ text: string;
574
+ language?: string | null;
575
+ source?: 'client' | 'runtime';
576
+ }): Promise<{
577
+ ok: true;
578
+ transcript: NonNullable<ShadowAttachment['transcript']>;
2255
579
  }>;
2256
580
  resolveAttachmentMediaUrl(attachmentId: string, options?: {
2257
581
  disposition?: 'inline' | 'attachment';
@@ -2267,6 +591,12 @@ declare class ShadowClient {
2267
591
  */
2268
592
  uploadMediaFromUrl(mediaUrl: string, messageId?: string | {
2269
593
  messageId?: string;
594
+ kind?: 'file' | 'image' | 'voice';
595
+ durationMs?: number;
596
+ waveformPeaks?: number[];
597
+ transcriptText?: string;
598
+ transcriptLanguage?: string;
599
+ transcriptSource?: 'client' | 'runtime';
2270
600
  }): Promise<{
2271
601
  url: string;
2272
602
  key: string;
@@ -2372,13 +702,25 @@ declare class ShadowClient {
2372
702
  ok: boolean;
2373
703
  }>;
2374
704
  changePassword(data: {
2375
- currentPassword: string;
705
+ currentPassword?: string;
706
+ oldPassword?: string;
2376
707
  newPassword: string;
708
+ confirmPassword?: string;
2377
709
  }): Promise<{
2378
710
  ok: boolean;
2379
711
  }>;
2380
712
  getDashboard(): Promise<Record<string, unknown>>;
2381
713
  loginWithGoogleIdToken(idToken: string): Promise<ShadowAuthResponse>;
714
+ loginWithAppleIdentityToken(data: {
715
+ identityToken: string;
716
+ email?: string | null;
717
+ fullName?: {
718
+ givenName?: string | null;
719
+ familyName?: string | null;
720
+ middleName?: string | null;
721
+ nickname?: string | null;
722
+ } | null;
723
+ }): Promise<ShadowAuthResponse>;
2382
724
  sendFriendRequest(username: string): Promise<ShadowFriendship>;
2383
725
  acceptFriendRequest(requestId: string): Promise<ShadowFriendship>;
2384
726
  rejectFriendRequest(requestId: string): Promise<ShadowFriendship>;
@@ -2957,6 +1299,18 @@ declare class ShadowClient {
2957
1299
  q?: string;
2958
1300
  limit?: number;
2959
1301
  }): Promise<Record<string, unknown>>;
1302
+ discoverMarketplaceProducts(params?: {
1303
+ q?: string;
1304
+ tag?: string;
1305
+ category?: string;
1306
+ scope?: 'server' | 'user';
1307
+ limit?: number;
1308
+ offset?: number;
1309
+ }): Promise<ShadowMarketplaceProductsResponse>;
1310
+ discoverMarketplaceCategories(params?: {
1311
+ q?: string;
1312
+ limit?: number;
1313
+ }): Promise<ShadowMarketplaceCategoriesResponse>;
2960
1314
  discoverBusinessHub(params?: {
2961
1315
  q?: string;
2962
1316
  limit?: number;
@@ -3183,4 +1537,4 @@ declare class ShadowVoiceConsumer {
3183
1537
  private renewTokens;
3184
1538
  }
3185
1539
 
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 };
1540
+ export { ServerEventMap, ShadowAddAgentsToServerResult, ShadowAgentUsageSnapshotInput, ShadowAttachment, ShadowBuddyInboxAdmissionPendingActionResult, ShadowBuddyInboxAdmissionPendingResult, ShadowBuddyInboxAdmissionPolicy, ShadowBuddyInboxAdmissionPolicyResult, ShadowBuddyInboxSummary, ShadowCartItem, ShadowCategory, ShadowChannel, ShadowChannelAccess, ShadowChannelBootstrap, ShadowChannelJoinRequestResult, ShadowChannelJoinRequestStatus, ShadowChannelSlashCommand, ShadowClient, ShadowCloudDeploymentBackup, ShadowCloudDeploymentRuntimeResponse, ShadowCloudProviderCatalog, ShadowCloudProviderModel, ShadowCloudProviderProfile, ShadowCommerceCheckoutPreview, ShadowCommerceProductContext, ShadowCommerceProductPickerResponse, ShadowCommunityAsset, ShadowCommunityAssetDefinition, ShadowCommunityAssetGrant, ShadowConnectorBootstrapResult, ShadowConnectorComputer, ShadowContract, ShadowDiyCloudRun, ShadowDiyCloudRunEvent, ShadowDiyCloudRunStatus, ShadowEnsureBuddyInboxResult, ShadowFriendship, ShadowInboxTaskInput, ShadowInteractiveActionInput, ShadowInteractiveActionResult, ShadowInteractiveState, ShadowInviteCode, ShadowListing, ShadowMarketplaceCategoriesResponse, ShadowMarketplaceProductsResponse, ShadowMediaVariant, ShadowMember, ShadowMentionSuggestion, ShadowMentionSuggestionTrigger, ShadowMessage, ShadowMessageCard, ShadowMessageMention, ShadowModelProxyBilling, ShadowModelProxyChatCompletionRequest, ShadowModelProxyChatCompletionResponse, ShadowModelProxyModelsResponse, ShadowNotification, ShadowNotificationPreferences, ShadowOAuthApp, ShadowOAuthCommerceEntitlementAccess, ShadowOAuthCommerceEntitlementRedeemInput, ShadowOAuthCommerceEntitlementRedeemResult, ShadowOAuthConsent, ShadowOAuthToken, ShadowOrder, ShadowPaidFileOpenResult, ShadowProduct, ShadowRemoteConfig, ShadowReview, ShadowServer, ShadowServerAccess, ShadowServerAppApprovalMode, ShadowServerAppCatalogEntry, ShadowServerAppCommandConsent, ShadowServerAppDiscovery, ShadowServerAppIntegration, ShadowServerAppLaunchContext, ShadowServerAppManifest, ShadowServerAppSkillDocument, ShadowServerAppTokenIntrospection, ShadowServerJoinRequestResult, ShadowServerJoinRequestStatus, ShadowSettlementLine, ShadowShop, ShadowSlashCommand, ShadowSocket, type ShadowSocketOptions, ShadowTask, ShadowThread, ShadowTransaction, ShadowUser, ShadowVoiceConsumer, type ShadowVoiceConsumerOptions, ShadowVoiceJoinResult, ShadowVoiceLeaveResult, ShadowVoicePolicy, ShadowVoiceState, ShadowWallet, channelRoom, threadRoom, userRoom };