@shadowob/sdk 1.1.7 → 1.1.9

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,1879 +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.cjs';
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.cjs';
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.cjs';
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
- type ShadowServerAppApprovalMode = 'none' | 'first_time' | 'every_time' | 'policy';
128
- interface ShadowServerAppCommand {
129
- name: string;
130
- title?: string;
131
- description?: string;
132
- path: string;
133
- method?: 'POST';
134
- input?: 'json' | 'multipart';
135
- inputSchema?: Record<string, unknown>;
136
- permission: string;
137
- action: ShadowServerAppAction;
138
- dataClass: ShadowServerAppDataClass;
139
- approvalMode?: ShadowServerAppApprovalMode;
140
- binary?: {
141
- supported?: boolean;
142
- field?: string;
143
- maxBytes?: number;
144
- contentTypes?: string[];
145
- };
146
- }
147
- interface ShadowServerAppManifest {
148
- schemaVersion: 'shadow.app/1';
149
- appKey: string;
150
- name: string;
151
- description?: string;
152
- version?: string;
153
- iconUrl: string;
154
- iframe?: {
155
- entry: string;
156
- allowedOrigins: string[];
157
- };
158
- api: {
159
- baseUrl: string;
160
- auth?: {
161
- type: 'oauth2-bearer';
162
- };
163
- };
164
- access?: {
165
- defaultPermissions?: string[];
166
- defaultApprovalMode?: ShadowServerAppApprovalMode;
167
- };
168
- commands: ShadowServerAppCommand[];
169
- skills?: Array<{
170
- name: string;
171
- description: string;
172
- commandHints?: string[];
173
- }>;
174
- events?: string[];
175
- binary?: {
176
- supported: boolean;
177
- maxBytes?: number;
178
- contentTypes?: string[];
179
- };
180
- }
181
- interface ShadowServerAppIntegration {
182
- id: string;
183
- serverId: string;
184
- appKey: string;
185
- name: string;
186
- description?: string | null;
187
- iconUrl?: string | null;
188
- manifestUrl?: string | null;
189
- manifest: ShadowServerAppManifest;
190
- iframeEntry?: string | null;
191
- allowedOrigins: string[];
192
- apiBaseUrl: string;
193
- defaultPermissions: string[];
194
- defaultApprovalMode: ShadowServerAppApprovalMode;
195
- status: string;
196
- installedByUserId: string;
197
- createdAt: string;
198
- updatedAt: string;
199
- }
200
- interface ShadowServerAppDiscovery {
201
- manifest: ShadowServerAppManifest;
202
- installed: ShadowServerAppIntegration | null;
203
- permissions: Array<{
204
- name: string;
205
- title: string;
206
- description?: string | null;
207
- permission: string;
208
- action: ShadowServerAppAction;
209
- dataClass: ShadowServerAppDataClass;
210
- approvalMode: ShadowServerAppApprovalMode;
211
- }>;
212
- }
213
- interface ShadowServerAppCommandApproval {
214
- appKey: string;
215
- appName: string;
216
- commandName: string;
217
- commandTitle: string;
218
- commandDescription?: string | null;
219
- permission: string;
220
- action: ShadowServerAppAction;
221
- dataClass: ShadowServerAppDataClass;
222
- actorKind: string;
223
- subjectKind: 'user' | 'buddy';
224
- buddyAgentId?: string | null;
225
- approvalMode: ShadowServerAppApprovalMode;
226
- reason: 'not_default' | 'first_time' | 'every_time' | 'restricted' | 'policy';
227
- }
228
- interface ShadowServerAppCommandConsent {
229
- id: string;
230
- serverAppId: string;
231
- appKey: string;
232
- command: string;
233
- permission: string;
234
- subjectKind: 'user' | 'buddy';
235
- subjectUserId?: string | null;
236
- buddyAgentId?: string | null;
237
- expiresAt?: string | null;
238
- }
239
- interface ShadowServerAppCatalogEntry {
240
- id: string;
241
- appKey: string;
242
- name: string;
243
- description?: string | null;
244
- iconUrl?: string | null;
245
- manifestUrl?: string | null;
246
- manifest: ShadowServerAppManifest;
247
- status: string;
248
- installed?: ShadowServerAppIntegration | null;
249
- permissions?: ShadowServerAppDiscovery['permissions'];
250
- createdAt: string;
251
- updatedAt: string;
252
- }
253
- interface ShadowServerAppLaunchContext {
254
- serverId: string;
255
- serverAppId: string;
256
- appKey: string;
257
- iframeEntry: string | null;
258
- allowedOrigins: string[];
259
- launchToken: string;
260
- eventStreamPath: string;
261
- expiresIn: number;
262
- }
263
- interface ShadowServerAppSkillDocument {
264
- appKey: string;
265
- markdown: string;
266
- skills: Array<{
267
- name: string;
268
- description: string;
269
- commandHints?: string[];
270
- }>;
271
- }
272
- interface ShadowServerAppTokenIntrospection {
273
- active: boolean;
274
- token_type?: 'Bearer';
275
- iss?: string;
276
- aud?: string;
277
- sub?: string;
278
- scope?: string;
279
- client_id?: string;
280
- exp?: number;
281
- iat?: number;
282
- shadow?: {
283
- protocol: 'shadow.app/1';
284
- serverId: string;
285
- serverAppId: string;
286
- appKey: string;
287
- command?: string;
288
- actor: {
289
- kind?: string;
290
- userId?: string | null;
291
- buddyAgentId?: string | null;
292
- ownerId?: string | null;
293
- };
294
- channelId?: string | null;
295
- permission?: string;
296
- action?: string;
297
- dataClass?: string;
298
- };
299
- }
300
- interface ShadowChannel {
301
- id: string;
302
- name: string;
303
- type: string;
304
- kind: 'server' | 'dm';
305
- serverId: string | null;
306
- description?: string | null;
307
- position?: number;
308
- isPrivate?: boolean;
309
- isMember?: boolean;
310
- otherUser?: ShadowUser | null;
311
- }
312
- type ShadowChannelJoinRequestStatus = 'pending' | 'approved' | 'rejected';
313
- interface ShadowChannelAccess {
314
- channel: ShadowChannel;
315
- isServerMember: boolean;
316
- isChannelMember: boolean;
317
- canManage: boolean;
318
- canAccess: boolean;
319
- requiresApproval: boolean;
320
- joinRequestStatus: ShadowChannelJoinRequestStatus | null;
321
- joinRequestId: string | null;
322
- }
323
- interface ShadowChannelJoinRequestResult {
324
- ok: boolean;
325
- status: ShadowChannelJoinRequestStatus;
326
- requestId?: string;
327
- }
328
- interface ShadowVoiceParticipant {
329
- id: string;
330
- channelId: string;
331
- userId: string;
332
- uid: number;
333
- screenUid: number;
334
- username: string;
335
- displayName: string | null;
336
- avatarUrl: string | null;
337
- isBot: boolean;
338
- isMuted: boolean;
339
- isDeafened: boolean;
340
- isSpeaking: boolean;
341
- isScreenSharing: boolean;
342
- joinedAt: string;
343
- updatedAt: string;
344
- clientId: string | null;
345
- }
346
- interface ShadowVoiceCredentials {
347
- appId: string;
348
- channelId: string;
349
- agoraChannelName: string;
350
- uid: number;
351
- screenUid: number;
352
- token: string | null;
353
- screenToken: string | null;
354
- expiresAt: string | null;
355
- }
356
- interface ShadowVoiceState {
357
- channelId: string;
358
- agoraChannelName: string;
359
- participants: ShadowVoiceParticipant[];
360
- participantCount: number;
361
- emptySince: string | null;
362
- graceEndsAt: string | null;
363
- }
364
- interface ShadowVoiceJoinResult {
365
- credentials: ShadowVoiceCredentials;
366
- participant: ShadowVoiceParticipant;
367
- state: ShadowVoiceState;
368
- }
369
- interface ShadowVoiceLeaveResult {
370
- participant: ShadowVoiceParticipant | null;
371
- state: ShadowVoiceState;
372
- left?: boolean;
373
- }
374
- interface ShadowVoiceRenewResult {
375
- credentials: ShadowVoiceCredentials;
376
- state: ShadowVoiceState;
377
- }
378
- interface ShadowVoicePolicy {
379
- agentId: string;
380
- channelId: string;
381
- listen: boolean;
382
- autoJoin: boolean;
383
- consumeAudio: boolean;
384
- consumeScreenShare: boolean;
385
- screenshotIntervalSeconds: number | null;
386
- }
387
- type ShadowServerJoinRequestStatus = 'pending' | 'approved' | 'rejected';
388
- interface ShadowServerAccess {
389
- server: ShadowServer;
390
- isMember: boolean;
391
- canManage: boolean;
392
- canAccess: boolean;
393
- requiresApproval: boolean;
394
- joinRequestStatus: ShadowServerJoinRequestStatus | null;
395
- joinRequestId: string | null;
396
- }
397
- interface ShadowServerJoinRequestResult {
398
- ok: boolean;
399
- status: ShadowServerJoinRequestStatus;
400
- requestId?: string;
401
- }
402
- interface ShadowThread {
403
- id: string;
404
- name: string;
405
- channelId: string;
406
- parentMessageId: string;
407
- createdAt: string;
408
- }
409
- interface ShadowMember {
410
- userId: string;
411
- serverId: string;
412
- role: string;
413
- isBot?: boolean;
414
- uid?: string;
415
- nickname?: string;
416
- avatar?: string | null;
417
- status?: 'online' | 'idle' | 'dnd' | 'offline';
418
- membershipTier?: string;
419
- membershipLevel?: number;
420
- isMember?: boolean;
421
- totalOnlineSeconds?: number;
422
- buddyTag?: string | null;
423
- creator?: {
424
- uid: string;
425
- nickname: string;
426
- username?: string;
427
- displayName?: string | null;
428
- avatarUrl?: string | null;
429
- } | null;
430
- user?: ShadowUser;
431
- }
432
- interface ShadowAddAgentsToServerResult {
433
- added: string[];
434
- failed: Array<{
435
- agentId: string;
436
- error: string;
437
- }>;
438
- }
439
- interface ShadowInviteCode {
440
- id: string;
441
- code: string;
442
- createdBy: string;
443
- usedBy?: string | null;
444
- usedAt?: string | null;
445
- isActive: boolean;
446
- note?: string | null;
447
- createdAt: string;
448
- }
449
- interface ShadowServer {
450
- id: string;
451
- name: string;
452
- slug: string;
453
- description: string | null;
454
- iconUrl: string | null;
455
- bannerUrl: string | null;
456
- isPublic: boolean;
457
- }
458
- interface ShadowUser {
459
- id: string;
460
- email?: string;
461
- username: string;
462
- displayName?: string;
463
- avatarUrl?: string;
464
- isBot?: boolean;
465
- agentId?: string;
466
- membership?: ShadowMembership;
467
- }
468
- interface ShadowMembership {
469
- status: string;
470
- tier: {
471
- id: string;
472
- level: number;
473
- label: string;
474
- capabilities: string[];
475
- };
476
- level: number;
477
- isMember: boolean;
478
- memberSince?: string | null;
479
- inviteCodeId?: string | null;
480
- capabilities: string[];
481
- }
482
- interface ShadowAuthResponse {
483
- user: ShadowUser;
484
- accessToken: string;
485
- refreshToken: string;
486
- }
487
- type ShadowPlayAction = {
488
- kind: 'public_channel';
489
- serverId?: string;
490
- serverSlug?: string;
491
- channelId?: string;
492
- channelName?: string;
493
- inviteCode?: string;
494
- buddyUserIds?: string[];
495
- buddyTemplateSlug?: string;
496
- greeting?: string;
497
- } | {
498
- kind: 'private_room';
499
- serverId?: string;
500
- serverSlug?: string;
501
- namePrefix?: string;
502
- buddyUserIds?: string[];
503
- buddyTemplateSlug?: string;
504
- greeting?: string;
505
- } | {
506
- kind: 'cloud_deploy';
507
- templateSlug: string;
508
- buddyTemplateSlug?: string;
509
- buddyUserIds?: string[];
510
- greeting?: string;
511
- resourceTier?: 'lightweight' | 'standard' | 'pro';
512
- defaultChannelName?: string;
513
- } | {
514
- kind: 'external_oauth_app';
515
- clientId: string;
516
- redirectUri: string;
517
- scopes?: string[];
518
- state?: string;
519
- } | {
520
- kind: 'landing_page';
521
- url: string;
522
- };
523
- type ShadowPlayAvailability = 'available' | 'gated' | 'coming_soon' | 'misconfigured';
524
- interface ShadowHomePlayCatalogItem {
525
- id: string;
526
- image: string;
527
- title: string;
528
- titleEn: string;
529
- desc: string;
530
- descEn: string;
531
- category: string;
532
- categoryEn: string;
533
- starts: string;
534
- accentColor: string;
535
- hot?: boolean;
536
- status: ShadowPlayAvailability;
537
- action?: ShadowPlayAction;
538
- gates?: {
539
- auth?: 'optional' | 'required';
540
- membership?: 'none' | 'required';
541
- profile?: 'optional' | 'required';
542
- };
543
- template?: {
544
- kind: 'cloud';
545
- slug: string;
546
- path: string;
547
- };
548
- materials?: {
549
- cover: string;
550
- };
551
- }
552
- interface ShadowPlayLaunchResult {
553
- ok: boolean;
554
- status: string;
555
- playId?: string | null;
556
- redirectUrl?: string;
557
- serverId?: string;
558
- channelId?: string;
559
- deploymentId?: string;
560
- deploymentStatus?: string;
561
- templateSlug?: string;
562
- }
563
- interface ShadowModelProxyModel {
564
- id: string;
565
- object: 'model';
566
- created: number;
567
- owned_by: string;
568
- }
569
- interface ShadowModelProxyModelsResponse {
570
- object: 'list';
571
- data: ShadowModelProxyModel[];
572
- }
573
- interface ShadowModelProxyBilling {
574
- enabled: boolean;
575
- currency: 'shrimp';
576
- model: string;
577
- models: string[];
578
- shrimpMicrosPerCoin: number;
579
- shrimpPerCny: number;
580
- inputTokensPerShrimp: number | null;
581
- outputTokensPerShrimp: number | null;
582
- inputCacheHitCnyPerMillionTokens: number;
583
- inputCacheMissCnyPerMillionTokens: number;
584
- outputCnyPerMillionTokens: number;
585
- inputCacheHitShrimpPerMillionTokens: number;
586
- inputCacheMissShrimpPerMillionTokens: number;
587
- outputShrimpPerMillionTokens: number;
588
- }
589
- type ShadowModelProxyChatCompletionRequest = Record<string, unknown> & {
590
- model?: string;
591
- messages: unknown[];
592
- stream?: boolean;
593
- };
594
- type ShadowModelProxyChatCompletionResponse = Record<string, unknown>;
595
- interface ShadowNotification {
596
- id: string;
597
- userId: string;
598
- type: string;
599
- kind?: string | null;
600
- title: string;
601
- body: string | null;
602
- referenceId?: string | null;
603
- referenceType?: string | null;
604
- senderId?: string | null;
605
- senderAvatarUrl?: string | null;
606
- scopeServerId?: string | null;
607
- scopeChannelId?: string | null;
608
- aggregationKey?: string | null;
609
- aggregatedCount?: number | null;
610
- lastAggregatedAt?: string | null;
611
- metadata?: Record<string, unknown> | null;
612
- isRead: boolean;
613
- createdAt: string;
614
- expiresAt?: string | null;
615
- }
616
- interface ShadowScopedUnread {
617
- channelUnread: Record<string, number>;
618
- serverUnread: Record<string, number>;
619
- dmUnread?: Record<string, number>;
620
- }
621
- interface ShadowChannelPolicy {
622
- listen: boolean;
623
- reply: boolean;
624
- mentionOnly: boolean;
625
- config: ShadowChannelPolicyConfig;
626
- }
627
- interface ShadowChannelPolicyConfig {
628
- allowedTriggerUserIds?: string[];
629
- triggerUserIds?: string[];
630
- ownerId?: string;
631
- activeTenantIds?: string[];
632
- replyRequiresMention?: boolean;
633
- [key: string]: unknown;
634
- }
635
- interface ShadowSlashCommand {
636
- name: string;
637
- description?: string;
638
- aliases?: string[];
639
- packId?: string;
640
- sourcePath?: string;
641
- interaction?: ShadowInteractiveBlock;
642
- }
643
- interface ShadowChannelSlashCommand extends ShadowSlashCommand {
644
- agentId: string;
645
- botUserId: string;
646
- botUsername: string;
647
- botDisplayName?: string | null;
648
- }
649
- interface ShadowChannelBootstrap {
650
- access: ShadowChannelAccess;
651
- channel: ShadowChannel;
652
- server: ShadowServer | null;
653
- channels: ShadowChannel[];
654
- members: ShadowMember[];
655
- messages: {
656
- messages: ShadowMessage[];
657
- hasMore: boolean;
658
- };
659
- slashCommands: {
660
- commands: ShadowChannelSlashCommand[];
661
- };
662
- }
663
- interface ShadowRemoteChannel {
664
- id: string;
665
- name: string;
666
- type: string;
667
- policy: ShadowChannelPolicy;
668
- }
669
- interface ShadowRemoteServer {
670
- id: string;
671
- name: string;
672
- slug?: string;
673
- iconUrl?: string | null;
674
- defaultPolicy: ShadowChannelPolicy;
675
- channels: ShadowRemoteChannel[];
676
- }
677
- interface ShadowRemoteConfig {
678
- agentId: string;
679
- botUserId: string;
680
- ownerId?: string;
681
- buddyMode?: 'private' | 'shareable';
682
- allowedServerIds?: string[];
683
- activeTenantIds?: string[];
684
- allowedTriggerUserIds?: string[];
685
- slashCommands?: ShadowSlashCommand[];
686
- servers: ShadowRemoteServer[];
687
- }
688
- interface ShadowUsageProviderSnapshot {
689
- provider: string;
690
- amountUsd?: number | null;
691
- usageLabel?: string | null;
692
- raw?: string | null;
693
- inputTokens?: number | null;
694
- outputTokens?: number | null;
695
- totalTokens?: number | null;
696
- }
697
- interface ShadowAgentUsageSnapshotInput {
698
- source?: string;
699
- model?: string | null;
700
- totalUsd?: number | null;
701
- inputTokens?: number | null;
702
- outputTokens?: number | null;
703
- cacheReadTokens?: number | null;
704
- cacheWriteTokens?: number | null;
705
- totalTokens?: number | null;
706
- providers?: ShadowUsageProviderSnapshot[];
707
- raw?: Record<string, unknown>;
708
- generatedAt?: string;
709
- }
710
- interface TypingPayload {
711
- channelId: string;
712
- userId: string;
713
- username: string;
714
- displayName?: string | null;
715
- typing?: boolean;
716
- }
717
- interface PresenceChangePayload {
718
- userId: string;
719
- status: 'online' | 'idle' | 'dnd' | 'offline';
720
- }
721
- interface PresenceActivityPayload {
722
- userId: string;
723
- activity: string | null;
724
- channelId: string;
725
- username?: string;
726
- displayName?: string | null;
727
- }
728
- interface MemberJoinPayload {
729
- channelId: string;
730
- userId: string;
731
- }
732
- interface MemberLeavePayload {
733
- channelId: string;
734
- userId: string;
735
- }
736
- interface SlashCommandsUpdatedPayload {
737
- channelId: string;
738
- serverId?: string;
739
- agentId?: string;
740
- botUserId?: string;
741
- commandCount?: number;
742
- }
743
- interface ReactionPayload {
744
- messageId: string;
745
- userId: string;
746
- emoji: string;
747
- }
748
- interface MessageDeletedPayload {
749
- id: string;
750
- channelId: string;
751
- }
752
- interface ChannelCreatedPayload {
753
- id: string;
754
- name: string;
755
- type: string;
756
- serverId: string;
757
- }
758
- interface ChannelMemberAddedPayload {
759
- channelId: string;
760
- serverId?: string;
761
- userId?: string;
762
- }
763
- interface ChannelMemberRemovedPayload {
764
- channelId: string;
765
- serverId?: string;
766
- userId?: string;
767
- }
768
- interface ServerJoinedPayload {
769
- serverId: string;
770
- serverName: string;
771
- }
772
- interface PolicyChangedPayload {
773
- agentId: string;
774
- serverId: string;
775
- channelId?: string | null;
776
- }
777
- interface VoiceParticipantPayload {
778
- channelId: string;
779
- participant: ShadowVoiceParticipant | null;
780
- state: ShadowVoiceState;
781
- }
782
- interface VoicePolicyUpdatedPayload {
783
- channelId: string;
784
- agentId: string;
785
- }
786
- interface ShadowFriendship {
787
- id: string;
788
- userId: string;
789
- friendId: string;
790
- status: 'pending' | 'accepted' | 'rejected';
791
- createdAt: string;
792
- user?: ShadowUser;
793
- friend?: ShadowUser;
794
- }
795
- interface ShadowOAuthApp {
796
- id: string;
797
- name: string;
798
- clientId: string;
799
- clientSecret?: string;
800
- redirectUris: string[];
801
- scopes: string[];
802
- createdAt: string;
803
- }
804
- interface ShadowOAuthConsent {
805
- id: string;
806
- appId: string;
807
- appName: string;
808
- scopes: string[];
809
- createdAt: string;
810
- }
811
- interface ShadowOAuthToken {
812
- access_token: string;
813
- token_type: string;
814
- expires_in: number;
815
- refresh_token?: string;
816
- scope: string;
817
- }
818
- interface ShadowListing {
819
- id: string;
820
- agentId: string;
821
- title: string;
822
- description: string;
823
- pricePerHour: number;
824
- currency: string;
825
- tags: string[];
826
- isActive: boolean;
827
- createdAt: string;
828
- agent?: {
829
- id: string;
830
- name: string;
831
- status: string;
832
- };
833
- }
834
- interface ShadowContract {
835
- id: string;
836
- listingId: string;
837
- tenantId: string;
838
- ownerId: string;
839
- status: string;
840
- startedAt: string;
841
- expiresAt: string;
842
- totalCost: number;
843
- createdAt: string;
844
- }
845
- interface ShadowShop {
846
- id: string;
847
- scopeKind?: 'server' | 'user';
848
- serverId?: string | null;
849
- ownerUserId?: string | null;
850
- visibility?: string;
851
- name: string;
852
- description?: string | null;
853
- isEnabled: boolean;
854
- }
855
- type ShadowCommunityAssetType = 'badge' | 'gift' | 'coupon' | 'service_ticket' | 'collectible' | 'content_pass' | 'reward';
856
- interface ShadowCommunityAssetDefinition {
857
- id: string;
858
- issuerKind: 'platform' | 'server' | 'user' | 'shop';
859
- issuerId?: string | null;
860
- shopId?: string | null;
861
- assetType: ShadowCommunityAssetType;
862
- name: string;
863
- description?: string | null;
864
- imageUrl?: string | null;
865
- giftable: boolean;
866
- transferable: boolean;
867
- consumable: boolean;
868
- revocable: boolean;
869
- expiresAfterDays?: number | null;
870
- status: 'draft' | 'active' | 'paused' | 'archived';
871
- metadata?: Record<string, unknown> | null;
872
- createdAt?: string;
873
- updatedAt?: string;
874
- }
875
- interface ShadowCommunityAssetGrant {
876
- id: string;
877
- definitionId: string;
878
- ownerUserId: string;
879
- sourceKind: string;
880
- sourceId?: string | null;
881
- quantity: number;
882
- remainingQuantity: number;
883
- status: 'active' | 'locked' | 'consumed' | 'revoked' | 'expired';
884
- expiresAt?: string | null;
885
- metadata?: Record<string, unknown> | null;
886
- createdAt?: string;
887
- updatedAt?: string;
888
- }
889
- interface ShadowCommunityAsset {
890
- grant: ShadowCommunityAssetGrant;
891
- definition: ShadowCommunityAssetDefinition;
892
- }
893
- interface ShadowEconomyTip {
894
- id: string;
895
- senderUserId: string;
896
- recipientUserId: string;
897
- amount: number;
898
- sellerNet: number;
899
- status: 'succeeded' | 'failed' | 'reversed' | 'held';
900
- contextKind?: string | null;
901
- contextId?: string | null;
902
- message?: string | null;
903
- createdAt?: string;
904
- }
905
- interface ShadowEconomyGift {
906
- id: string;
907
- senderUserId: string;
908
- recipientUserId: string;
909
- status: 'succeeded' | 'failed' | 'reversed' | 'held';
910
- message?: string | null;
911
- metadata?: Record<string, unknown> | null;
912
- createdAt?: string;
913
- }
914
- interface ShadowSettlementLine {
915
- id: string;
916
- sellerUserId: string;
917
- shopId?: string | null;
918
- sourceType: 'order' | 'tip' | 'gift' | 'adjustment';
919
- sourceId: string;
920
- grossAmount: number;
921
- platformFee: number;
922
- netAmount: number;
923
- status: 'pending' | 'available' | 'settled' | 'failed' | 'held' | 'reversed';
924
- availableAt?: string | null;
925
- settledAt?: string | null;
926
- createdAt?: string;
927
- updatedAt?: string;
928
- }
929
- interface ShadowCommerceProductCard {
930
- id: string;
931
- kind: 'offer' | 'product';
932
- offerId?: string;
933
- shopId: string;
934
- shopScope: {
935
- kind: 'server' | 'user';
936
- id: string;
937
- };
938
- productId: string;
939
- skuId?: string;
940
- snapshot: {
941
- name: string;
942
- summary?: string | null;
943
- imageUrl?: string | null;
944
- shopName?: string | null;
945
- deliveryPromise?: string | null;
946
- price: number;
947
- currency: string;
948
- productType: 'physical' | 'entitlement';
949
- billingMode?: 'one_time' | 'fixed_duration' | 'subscription';
950
- durationSeconds?: number | null;
951
- resourceType?: string;
952
- resourceId?: string;
953
- capability?: string;
954
- };
955
- purchase: {
956
- mode: 'direct' | 'select_sku' | 'open_detail';
957
- };
958
- }
959
- interface ShadowCommerceProductPickerGroup {
960
- key: string;
961
- labelKey: string;
962
- shopId: string;
963
- shopName: string;
964
- shopScope: {
965
- kind: 'server' | 'user';
966
- id: string;
967
- };
968
- cards: ShadowCommerceProductCard[];
969
- }
970
- interface ShadowCommerceProductPickerResponse {
971
- cards: ShadowCommerceProductCard[];
972
- groups?: ShadowCommerceProductPickerGroup[];
973
- }
974
- interface ShadowEntitlementProvisioning {
975
- status: 'provisioned' | 'manual_pending' | 'failed' | string;
976
- code: string;
977
- provisionedAt?: string;
978
- checkedAt?: string;
979
- resourceType?: string | null;
980
- resourceId?: string | null;
981
- capability?: string | null;
982
- }
983
- interface ShadowEntitlement {
984
- id: string;
985
- userId: string;
986
- serverId?: string | null;
987
- shopId?: string | null;
988
- orderId?: string | null;
989
- productId?: string | null;
990
- offerId?: string | null;
991
- scopeKind?: 'server' | 'user' | string;
992
- resourceType: string;
993
- resourceId: string;
994
- capability: string;
995
- status: string;
996
- isActive: boolean;
997
- startsAt?: string;
998
- expiresAt?: string | null;
999
- nextRenewalAt?: string | null;
1000
- cancelledAt?: string | null;
1001
- revokedAt?: string | null;
1002
- metadata?: Record<string, unknown> | null;
1003
- createdAt?: string;
1004
- updatedAt?: string;
1005
- shop?: {
1006
- id: string;
1007
- scopeKind: 'server' | 'user' | string;
1008
- serverId?: string | null;
1009
- ownerUserId?: string | null;
1010
- name: string;
1011
- logoUrl?: string | null;
1012
- } | null;
1013
- product?: {
1014
- id: string;
1015
- shopId: string;
1016
- name: string;
1017
- summary?: string | null;
1018
- type: 'physical' | 'entitlement' | string;
1019
- basePrice: number;
1020
- currency: string;
1021
- billingMode: 'one_time' | 'fixed_duration' | 'subscription' | string;
1022
- entitlementConfig?: Record<string, unknown> | Record<string, unknown>[] | null;
1023
- } | null;
1024
- offer?: {
1025
- id: string;
1026
- shopId: string;
1027
- productId: string;
1028
- priceOverride?: number | null;
1029
- currency: string;
1030
- status: string;
1031
- } | null;
1032
- paidFile?: {
1033
- id: string;
1034
- name: string;
1035
- mime?: string | null;
1036
- sizeBytes?: number | null;
1037
- previewUrl?: string | null;
1038
- } | null;
1039
- buyer?: {
1040
- id: string;
1041
- username: string;
1042
- displayName?: string | null;
1043
- avatarUrl?: string | null;
1044
- } | null;
1045
- order?: (Omit<ShadowOrder, 'items' | 'currency'> & {
1046
- currency?: string | null;
1047
- items?: ShadowOrder['items'];
1048
- }) | null;
1049
- fulfillmentJobs?: Array<Record<string, unknown>>;
1050
- }
1051
- interface ShadowOAuthCommerceEntitlementSummary {
1052
- id: string;
1053
- status: string;
1054
- capability: string;
1055
- resourceType: string;
1056
- resourceId: string;
1057
- productId?: string | null;
1058
- shopId?: string | null;
1059
- orderId?: string | null;
1060
- offerId?: string | null;
1061
- expiresAt?: string | null;
1062
- }
1063
- interface ShadowOAuthCommerceEntitlementAccess {
1064
- allowed: boolean;
1065
- status: string;
1066
- reasonCode?: string | null;
1067
- resourceType: string;
1068
- resourceId: string;
1069
- capability: string;
1070
- app: {
1071
- id: string;
1072
- };
1073
- entitlement?: ShadowOAuthCommerceEntitlementSummary | null;
1074
- }
1075
- interface ShadowOAuthCommerceEntitlementRedeemInput {
1076
- idempotencyKey: string;
1077
- resourceType?: string;
1078
- resourceId?: string;
1079
- capability?: string;
1080
- metadata?: Record<string, string | number | boolean | null>;
1081
- }
1082
- interface ShadowOAuthCommerceEntitlementRedemption {
1083
- appId: string;
1084
- resourceType: string;
1085
- resourceId: string;
1086
- capability: string;
1087
- idempotencyKey: string;
1088
- redeemedAt: string;
1089
- metadata?: Record<string, string | number | boolean | null>;
1090
- }
1091
- interface ShadowOAuthCommerceEntitlementRedeemResult {
1092
- redeemed: true;
1093
- resourceType: string;
1094
- resourceId: string;
1095
- capability: string;
1096
- app: {
1097
- id: string;
1098
- };
1099
- entitlement: ShadowOAuthCommerceEntitlementSummary;
1100
- redemption: ShadowOAuthCommerceEntitlementRedemption;
1101
- }
1102
- interface ShadowEntitlementPurchaseResult {
1103
- order: {
1104
- id: string;
1105
- orderNo: string;
1106
- status: string;
1107
- totalAmount: number;
1108
- };
1109
- entitlement: Record<string, unknown>;
1110
- provisioning?: ShadowEntitlementProvisioning;
1111
- fulfillmentJobs?: Record<string, unknown>[];
1112
- nextAction?: 'open_paid_file' | 'view_entitlement' | string;
1113
- }
1114
- interface ShadowCommerceCheckoutPreview {
1115
- offer: {
1116
- id: string;
1117
- status: string;
1118
- available: boolean;
1119
- allowedSurfaces?: string[] | null;
1120
- };
1121
- shop: {
1122
- id: string;
1123
- name: string;
1124
- scopeKind: 'server' | 'user' | string;
1125
- logoUrl?: string | null;
1126
- };
1127
- product: {
1128
- id: string;
1129
- name: string;
1130
- summary?: string | null;
1131
- imageUrl?: string | null;
1132
- type: 'physical' | 'entitlement' | string;
1133
- billingMode?: 'one_time' | 'fixed_duration' | 'subscription' | string;
1134
- price: number;
1135
- currency: string;
1136
- durationSeconds?: number | null;
1137
- };
1138
- entitlement?: {
1139
- resourceType: string;
1140
- resourceId: string;
1141
- capability: string;
1142
- access: {
1143
- allowed: boolean;
1144
- status: string;
1145
- reasonCode?: string | null;
1146
- entitlement?: Record<string, unknown> | null;
1147
- };
1148
- } | null;
1149
- paidFile?: {
1150
- id: string;
1151
- name: string;
1152
- mime?: string | null;
1153
- sizeBytes?: number | null;
1154
- previewUrl?: string | null;
1155
- } | null;
1156
- deliverables?: Record<string, unknown>[];
1157
- viewerState: 'not_purchased' | 'active' | 'expired' | 'revoked' | 'cancelled' | 'unavailable';
1158
- primaryAction?: 'purchase' | 'open_content' | 'renew' | 'view_detail' | 'view_progress' | 'unavailable' | string;
1159
- displayState?: {
1160
- viewerState: string;
1161
- primaryAction: string;
1162
- price: {
1163
- amount: number;
1164
- currency: string;
1165
- };
1166
- balance?: {
1167
- current: number;
1168
- afterPurchase?: number;
1169
- shortfall?: number;
1170
- } | null;
1171
- seller?: {
1172
- shopId: string;
1173
- shopName: string;
1174
- buddyUserId?: string | null;
1175
- };
1176
- entitlement?: Record<string, unknown> | null;
1177
- delivery?: Record<string, unknown> | null;
1178
- content?: Record<string, unknown> | null;
1179
- };
1180
- nextAction: 'purchase' | 'open_paid_file' | 'view_entitlement' | string;
1181
- }
1182
- interface ShadowCommerceProductContext {
1183
- product: ShadowProduct;
1184
- shop: ShadowShop & {
1185
- logoUrl?: string | null;
1186
- bannerUrl?: string | null;
1187
- };
1188
- server: {
1189
- id: string;
1190
- name: string;
1191
- slug?: string | null;
1192
- description?: string | null;
1193
- iconUrl?: string | null;
1194
- bannerUrl?: string | null;
1195
- ownerId?: string | null;
1196
- } | null;
1197
- provider: {
1198
- id: string;
1199
- username: string;
1200
- displayName?: string | null;
1201
- avatarUrl?: string | null;
1202
- isBot?: boolean;
1203
- } | null;
1204
- buddy: {
1205
- id: string;
1206
- userId: string;
1207
- ownerId: string;
1208
- status: string;
1209
- totalOnlineSeconds?: number | null;
1210
- lastHeartbeat?: string | null;
1211
- } | null;
1212
- offer: {
1213
- id: string;
1214
- status: string;
1215
- priceOverride?: number | null;
1216
- currency: string;
1217
- allowedSurfaces?: string[] | null;
1218
- sellerUserId?: string | null;
1219
- sellerBuddyUserId?: string | null;
1220
- } | null;
1221
- fulfillment: {
1222
- status: string;
1223
- resourceType?: string | null;
1224
- resourceId?: string | null;
1225
- capability?: string | null;
1226
- deliverables: Array<{
1227
- id: string;
1228
- kind: string;
1229
- resourceType?: string | null;
1230
- resourceId?: string | null;
1231
- deliveryTiming?: string | null;
1232
- status: string;
1233
- }>;
1234
- };
1235
- refund: {
1236
- policy: string;
1237
- status: string;
1238
- supportPath?: string | null;
1239
- };
1240
- credit: {
1241
- salesCount: number;
1242
- avgRating: number;
1243
- ratingCount: number;
1244
- completedOrders: number;
1245
- };
1246
- links: {
1247
- product: string;
1248
- shop?: string | null;
1249
- server?: string | null;
1250
- providerProfile?: string | null;
1251
- buddyProfile?: string | null;
1252
- assetHome?: string | null;
1253
- checkoutPreview?: string | null;
1254
- };
1255
- }
1256
- interface ShadowPaidFileOpenResult {
1257
- grant: {
1258
- id: string;
1259
- fileId: string;
1260
- status: string;
1261
- expiresAt: string;
1262
- };
1263
- viewerUrl: string;
1264
- }
1265
- interface ShadowCategory {
1266
- id: string;
1267
- shopId: string;
1268
- name: string;
1269
- description?: string | null;
1270
- position: number;
1271
- }
1272
- interface ShadowProductMedia {
1273
- id?: string;
1274
- type?: 'image' | 'video' | string;
1275
- url: string;
1276
- thumbnailUrl?: string | null;
1277
- position?: number;
1278
- }
1279
- interface ShadowProductSku {
1280
- id: string;
1281
- specValues: string[];
1282
- price: number;
1283
- stock: number;
1284
- imageUrl?: string | null;
1285
- skuCode?: string | null;
1286
- isActive?: boolean;
1287
- }
1288
- interface ShadowProductEntitlementConfig {
1289
- resourceType?: string;
1290
- resourceId?: string;
1291
- capability?: string;
1292
- durationSeconds?: number | null;
1293
- renewalPeriodSeconds?: number | null;
1294
- privilegeDescription?: string;
1295
- }
1296
- interface ShadowProduct {
1297
- id: string;
1298
- shopId: string;
1299
- categoryId?: string | null;
1300
- name: string;
1301
- slug?: string;
1302
- type?: 'physical' | 'entitlement' | string;
1303
- description?: string | null;
1304
- summary?: string | null;
1305
- price?: number;
1306
- basePrice?: number;
1307
- currency: string;
1308
- stock?: number;
1309
- status: string;
1310
- specNames?: string[];
1311
- tags?: string[];
1312
- salesCount?: number;
1313
- avgRating?: number;
1314
- ratingCount?: number;
1315
- billingMode?: 'one_time' | 'fixed_duration' | 'subscription';
1316
- entitlementConfig?: ShadowProductEntitlementConfig | ShadowProductEntitlementConfig[] | null;
1317
- media?: ShadowProductMedia[];
1318
- skus?: ShadowProductSku[];
1319
- images?: string[];
1320
- createdAt: string;
1321
- }
1322
- interface ShadowCartItem {
1323
- id: string;
1324
- productId: string;
1325
- quantity: number;
1326
- product?: ShadowProduct;
1327
- }
1328
- interface ShadowOrder {
1329
- id: string;
1330
- orderNo?: string;
1331
- shopId: string;
1332
- buyerId: string;
1333
- status: 'pending' | 'paid' | 'processing' | 'shipped' | 'delivered' | 'completed' | 'cancelled' | 'refunded' | string;
1334
- totalAmount: number;
1335
- currency: string;
1336
- trackingNo?: string | null;
1337
- buyerNote?: string | null;
1338
- sellerNote?: string | null;
1339
- paidAt?: string | null;
1340
- shippedAt?: string | null;
1341
- completedAt?: string | null;
1342
- cancelledAt?: string | null;
1343
- items: Array<{
1344
- id?: string;
1345
- productId: string;
1346
- skuId?: string | null;
1347
- productName?: string;
1348
- specValues?: string[];
1349
- quantity: number;
1350
- price: number;
1351
- imageUrl?: string | null;
1352
- }>;
1353
- createdAt: string;
1354
- }
1355
- interface ShadowReview {
1356
- id: string;
1357
- orderId: string;
1358
- productId: string;
1359
- userId: string;
1360
- rating: number;
1361
- content: string;
1362
- reply?: string | null;
1363
- createdAt: string;
1364
- }
1365
- interface ShadowWallet {
1366
- id: string;
1367
- userId: string;
1368
- balance: number;
1369
- currency: string;
1370
- }
1371
- interface ShadowTransaction {
1372
- id: string;
1373
- walletId: string;
1374
- type: string;
1375
- amount: number;
1376
- balanceAfter?: number;
1377
- currency?: string;
1378
- referenceId?: string | null;
1379
- referenceType?: string | null;
1380
- note?: string | null;
1381
- description?: string | null;
1382
- display?: {
1383
- title?: string | null;
1384
- subtitle?: string | null;
1385
- } | null;
1386
- order?: Record<string, unknown> | null;
1387
- counterparty?: Record<string, unknown> | null;
1388
- createdAt: string;
1389
- }
1390
- type ShadowDiyCloudStepId = 'think' | 'search' | 'generate' | 'validate' | 'review';
1391
- interface ShadowDiyCloudGenerateInput {
1392
- prompt: string;
1393
- feedback?: string;
1394
- previousConfig?: Record<string, unknown>;
1395
- locale?: string;
1396
- timezone?: string;
1397
- }
1398
- interface ShadowDiyCloudAgentStepOutput {
1399
- type: 'agent_step_output';
1400
- schemaVersion: 1;
1401
- step: ShadowDiyCloudStepId;
1402
- status: ShadowDiyCloudProgressStatus;
1403
- title: string;
1404
- locale: string;
1405
- timezone: string;
1406
- generatedAt: string;
1407
- result: Record<string, unknown>;
1408
- reasons: string[];
1409
- confidence?: number;
1410
- }
1411
- interface ShadowDiyCloudDraft {
1412
- slug: string;
1413
- title: string;
1414
- description: string;
1415
- score: number;
1416
- steps: Array<{
1417
- id: ShadowDiyCloudStepId;
1418
- title: string;
1419
- detail: string;
1420
- }>;
1421
- matchedPlugins: Array<{
1422
- id: string;
1423
- name: string;
1424
- description: string;
1425
- reason: string;
1426
- capabilities: string[];
1427
- requiredKeys: string[];
1428
- matchedTerms: string[];
1429
- }>;
1430
- referenceTemplates: Array<{
1431
- slug: string;
1432
- title: string;
1433
- description: string;
1434
- category: string;
1435
- plugins: string[];
1436
- channels: string[];
1437
- buddyNames: string[];
1438
- reason: string;
1439
- }>;
1440
- suggestedSkills: string[];
1441
- requiredKeys: Array<{
1442
- key: string;
1443
- label: string;
1444
- description: string;
1445
- source: string;
1446
- sourcePluginId: string;
1447
- sensitive: boolean;
1448
- setupSteps: string[];
1449
- skipImpact: string;
1450
- }>;
1451
- toolTrace: Array<{
1452
- tool: 'search_plugins' | 'inspect_plugin' | 'search_templates' | 'inspect_template' | 'compile_template_dsl' | 'validate_template_dsl' | 'collect_required_keys';
1453
- query?: string;
1454
- resultIds: string[];
1455
- }>;
1456
- agentOutputs: ShadowDiyCloudAgentStepOutput[];
1457
- agentReport: {
1458
- objective: string;
1459
- assumptions: string[];
1460
- reasoning: Array<{
1461
- step: ShadowDiyCloudStepId;
1462
- title: string;
1463
- detail: string;
1464
- evidence: string[];
1465
- }>;
1466
- pluginDecisions: Array<{
1467
- id: string;
1468
- name: string;
1469
- reason: string;
1470
- capabilities: string[];
1471
- matchedTerms: string[];
1472
- requiredKeys: string[];
1473
- }>;
1474
- templateDecisions: Array<{
1475
- slug: string;
1476
- title: string;
1477
- reason: string;
1478
- plugins: string[];
1479
- channels: string[];
1480
- }>;
1481
- validationChecks: Array<{
1482
- name: string;
1483
- status: 'passed' | 'warning' | 'failed';
1484
- detail: string;
1485
- }>;
1486
- repairNotes: string[];
1487
- };
1488
- guidebook: {
1489
- summary: string;
1490
- beforeDeploy: string[];
1491
- howToUse: string[];
1492
- reviewNotes: string[];
1493
- };
1494
- template: Record<string, unknown>;
1495
- validation: {
1496
- valid: boolean;
1497
- agents: number;
1498
- configurations: number;
1499
- violations: Array<{
1500
- path: string;
1501
- prefix: string;
1502
- }>;
1503
- extendsErrors: string[];
1504
- templateRefs: {
1505
- env: number;
1506
- secret: number;
1507
- file: number;
1508
- };
1509
- };
1510
- }
1511
- type ShadowDiyCloudProgressStatus = 'running' | 'completed' | 'warning' | 'error';
1512
- type ShadowDiyCloudRunStatus = 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
1513
- interface ShadowDiyCloudRun {
1514
- runId: string;
1515
- input: ShadowDiyCloudGenerateInput;
1516
- status: ShadowDiyCloudRunStatus;
1517
- createdAt: string;
1518
- updatedAt: string;
1519
- expiresAt: string;
1520
- draft?: ShadowDiyCloudDraft;
1521
- error?: string;
1522
- }
1523
- type ShadowDiyCloudRunEvent = {
1524
- schemaVersion: 2;
1525
- seq: number;
1526
- runId: string;
1527
- eventId: string;
1528
- timestamp: string;
1529
- type: 'run.created' | 'run.started' | 'run.cancelled';
1530
- status?: ShadowDiyCloudRunStatus;
1531
- input?: ShadowDiyCloudGenerateInput;
1532
- expiresAt?: string;
1533
- } | {
1534
- schemaVersion: 2;
1535
- seq: number;
1536
- runId: string;
1537
- eventId: string;
1538
- timestamp: string;
1539
- type: 'step.created';
1540
- stepId: ShadowDiyCloudStepId;
1541
- title: string;
1542
- intent: string;
1543
- order: number;
1544
- iconHint?: string;
1545
- } | {
1546
- schemaVersion: 2;
1547
- seq: number;
1548
- runId: string;
1549
- eventId: string;
1550
- timestamp: string;
1551
- type: 'step.delta';
1552
- stepId: ShadowDiyCloudStepId;
1553
- channel: 'summary' | 'rationale' | 'status';
1554
- delta: string;
1555
- status?: ShadowDiyCloudProgressStatus;
1556
- title?: string;
1557
- meta?: Record<string, unknown>;
1558
- } | {
1559
- schemaVersion: 2;
1560
- seq: number;
1561
- runId: string;
1562
- eventId: string;
1563
- timestamp: string;
1564
- type: 'decision';
1565
- stepId: ShadowDiyCloudStepId;
1566
- decisionId: string;
1567
- title: string;
1568
- selected: string;
1569
- basis: {
1570
- observations: string[];
1571
- constraints: string[];
1572
- evidence: Array<{
1573
- source: string;
1574
- ref: string;
1575
- summary: string;
1576
- }>;
1577
- rejectedOptions: Array<{
1578
- option: string;
1579
- reason: string;
1580
- }>;
1581
- confidence?: number | null;
1582
- needsUserReview: boolean;
1583
- };
1584
- output?: ShadowDiyCloudAgentStepOutput;
1585
- } | {
1586
- schemaVersion: 2;
1587
- seq: number;
1588
- runId: string;
1589
- eventId: string;
1590
- timestamp: string;
1591
- type: 'artifact.patch';
1592
- stepId: ShadowDiyCloudStepId;
1593
- artifact: 'templateDsl' | 'cloudConfig' | 'guidebook' | 'requiredKeys';
1594
- patch: unknown;
1595
- } | {
1596
- schemaVersion: 2;
1597
- seq: number;
1598
- runId: string;
1599
- eventId: string;
1600
- timestamp: string;
1601
- type: 'guardrail.result';
1602
- stepId: ShadowDiyCloudStepId;
1603
- name: string;
1604
- status: 'passed' | 'warning' | 'failed' | 'error';
1605
- detail: string;
1606
- blocksRun: boolean;
1607
- } | {
1608
- schemaVersion: 2;
1609
- seq: number;
1610
- runId: string;
1611
- eventId: string;
1612
- timestamp: string;
1613
- type: 'draft.completed';
1614
- draft: ShadowDiyCloudDraft;
1615
- } | {
1616
- schemaVersion: 2;
1617
- seq: number;
1618
- runId: string;
1619
- eventId: string;
1620
- timestamp: string;
1621
- type: 'run.failed';
1622
- error: string;
1623
- code?: string;
1624
- retryable: boolean;
1625
- };
1626
- type ShadowCloudDeploymentStatus = 'pending' | 'deploying' | 'cancelling' | 'deployed' | 'paused' | 'resuming' | 'failed' | 'destroying' | 'destroyed';
1627
- interface ShadowCloudDeploymentRuntimeResponse {
1628
- ok: boolean;
1629
- status: ShadowCloudDeploymentStatus;
1630
- deployment?: Record<string, unknown>;
1631
- }
1632
- interface ShadowCloudDeploymentManifest {
1633
- deploymentId: string;
1634
- namespace: string;
1635
- name: string;
1636
- templateSlug: string | null;
1637
- template: Record<string, unknown> | null;
1638
- manifest: Record<string, unknown> | null;
1639
- drift: {
1640
- status: 'up-to-date' | 'template-updated' | 'missing-template' | 'unlinked' | 'unknown';
1641
- templateAvailable: boolean;
1642
- templateChanged: boolean;
1643
- deployedTemplateHash: string | null;
1644
- currentTemplateHash: string | null;
1645
- configHash: string | null;
1646
- };
1647
- configSnapshot: Record<string, unknown> | null;
1648
- }
1649
- interface ShadowCloudDeploymentTemplateSyncResult {
1650
- ok: boolean;
1651
- action: 'updated' | 'forked';
1652
- template: Record<string, unknown>;
1653
- manifest: ShadowCloudDeploymentManifest;
1654
- }
1655
- interface ShadowCloudDeploymentBackup {
1656
- id: string;
1657
- deploymentId: string;
1658
- namespace: string;
1659
- agentId: string;
1660
- sandboxName: string | null;
1661
- pvcName: string;
1662
- driver: 'volumeSnapshot' | 'restic' | string;
1663
- snapshotName: string | null;
1664
- objectKey: string | null;
1665
- status: 'pending' | 'running' | 'succeeded' | 'failed' | 'expired' | string;
1666
- phase: string;
1667
- error: string | null;
1668
- expiresAt: string | null;
1669
- createdAt: string;
1670
- updatedAt: string;
1671
- }
1672
- interface ShadowCloudProviderCatalog {
1673
- pluginId: string;
1674
- pluginName: string;
1675
- provider: Record<string, unknown>;
1676
- secretFields?: Record<string, unknown>[];
1677
- }
1678
- interface ShadowCloudProviderEnvVar {
1679
- key: string;
1680
- maskedValue: string;
1681
- isSecret: boolean;
1682
- }
1683
- interface ShadowCloudProviderModel {
1684
- id: string;
1685
- name?: string;
1686
- tags?: string[];
1687
- contextWindow?: number;
1688
- maxTokens?: number;
1689
- cost?: {
1690
- input?: number;
1691
- output?: number;
1692
- };
1693
- capabilities?: {
1694
- vision?: boolean;
1695
- tools?: boolean;
1696
- reasoning?: boolean;
1697
- };
1698
- }
1699
- interface ShadowCloudProviderProfile {
1700
- id: string;
1701
- providerId: string;
1702
- name: string;
1703
- scope: string;
1704
- enabled: boolean;
1705
- config: {
1706
- baseUrl?: string;
1707
- apiFormat?: 'openai' | 'anthropic' | 'gemini';
1708
- authType?: 'api_key';
1709
- discoveredAt?: string;
1710
- models?: ShadowCloudProviderModel[];
1711
- [key: string]: unknown;
1712
- };
1713
- envVars: ShadowCloudProviderEnvVar[];
1714
- updatedAt?: string;
1715
- }
1716
- interface ShadowTask {
1717
- key: string;
1718
- title: string;
1719
- description: string;
1720
- reward: number;
1721
- status: string;
1722
- claimedAt?: string | null;
1723
- }
1724
- interface ShadowRechargeTier {
1725
- key: string;
1726
- shrimpCoins: number;
1727
- usdCents: number;
1728
- label: string;
1729
- }
1730
- interface ShadowRechargeConfig {
1731
- tiers: ShadowRechargeTier[];
1732
- customAmountMin: number;
1733
- customAmountMax: number;
1734
- exchangeRate: number;
1735
- stripePublishableKey: string;
1736
- }
1737
- interface ShadowRechargeIntent {
1738
- clientSecret: string;
1739
- paymentIntentId: string;
1740
- orderNo: string;
1741
- amount: {
1742
- shrimpCoins: number;
1743
- usdCents: number;
1744
- };
1745
- }
1746
- interface ShadowPaymentOrder {
1747
- id: string;
1748
- orderNo: string;
1749
- shrimpCoinAmount: number;
1750
- usdAmount: number;
1751
- status: string;
1752
- localCurrencyAmount?: number | null;
1753
- localCurrency?: string | null;
1754
- createdAt: string;
1755
- paidAt?: string | null;
1756
- }
1757
- interface ShadowRechargeHistory {
1758
- items: ShadowPaymentOrder[];
1759
- total: number;
1760
- limit: number;
1761
- offset: number;
1762
- }
1763
- interface ShadowNotificationPreferences {
1764
- strategy: 'all' | 'mention_only' | 'none';
1765
- mutedServerIds: string[];
1766
- mutedChannelIds: string[];
1767
- }
1768
- /** Events the server pushes to the client */
1769
- interface ServerEventMap {
1770
- 'message:new': (message: ShadowMessage) => void;
1771
- 'message:updated': (message: ShadowMessage) => void;
1772
- 'message:deleted': (payload: MessageDeletedPayload) => void;
1773
- 'message:typing': (payload: TypingPayload) => void;
1774
- 'member:typing': (payload: TypingPayload) => void;
1775
- 'member:join': (payload: MemberJoinPayload) => void;
1776
- 'member:joined': (payload: MemberJoinPayload & {
1777
- isBot?: boolean;
1778
- }) => void;
1779
- 'member:leave': (payload: MemberLeavePayload) => void;
1780
- 'member:left': (payload: MemberLeavePayload) => void;
1781
- 'presence:change': (payload: PresenceChangePayload) => void;
1782
- 'presence:activity': (payload: PresenceActivityPayload) => void;
1783
- 'reaction:add': (payload: ReactionPayload) => void;
1784
- 'reaction:remove': (payload: ReactionPayload) => void;
1785
- 'notification:new': (notification: ShadowNotification) => void;
1786
- 'channel:created': (payload: ChannelCreatedPayload) => void;
1787
- 'channel:member-added': (payload: ChannelMemberAddedPayload) => void;
1788
- 'channel:member-removed': (payload: ChannelMemberRemovedPayload) => void;
1789
- 'channel:slash-commands-updated': (payload: SlashCommandsUpdatedPayload) => void;
1790
- 'voice:state': (payload: ShadowVoiceState) => void;
1791
- 'voice:participant-joined': (payload: VoiceParticipantPayload) => void;
1792
- 'voice:participant-left': (payload: VoiceParticipantPayload) => void;
1793
- 'voice:participant-updated': (payload: VoiceParticipantPayload) => void;
1794
- 'voice:policy-updated': (payload: VoicePolicyUpdatedPayload) => void;
1795
- 'server:joined': (payload: ServerJoinedPayload) => void;
1796
- 'agent:policy-changed': (payload: PolicyChangedPayload) => void;
1797
- error: (payload: {
1798
- message: string;
1799
- }) => void;
1800
- }
1801
- /** Events the client sends to the server */
1802
- interface ClientEventMap {
1803
- 'channel:join': (data: {
1804
- channelId: string;
1805
- }, ack?: (res: {
1806
- ok: boolean;
1807
- }) => void) => void;
1808
- 'channel:leave': (data: {
1809
- channelId: string;
1810
- }) => void;
1811
- 'voice:join': (data: {
1812
- channelId: string;
1813
- clientId?: string;
1814
- muted?: boolean;
1815
- deafened?: boolean;
1816
- }, ack?: (res: {
1817
- ok: boolean;
1818
- data?: ShadowVoiceJoinResult;
1819
- error?: string;
1820
- code?: string;
1821
- }) => void) => void;
1822
- 'voice:leave': (data: {
1823
- channelId: string;
1824
- clientId?: string | null;
1825
- }, ack?: (res: {
1826
- ok: boolean;
1827
- data?: ShadowVoiceLeaveResult;
1828
- error?: string;
1829
- code?: string;
1830
- }) => void) => void;
1831
- 'voice:state:update': (data: {
1832
- channelId: string;
1833
- clientId?: string | null;
1834
- muted?: boolean;
1835
- deafened?: boolean;
1836
- speaking?: boolean;
1837
- screenSharing?: boolean;
1838
- }, ack?: (res: {
1839
- ok: boolean;
1840
- data?: unknown;
1841
- error?: string;
1842
- code?: string;
1843
- }) => void) => void;
1844
- 'voice:token:renew': (data: {
1845
- channelId: string;
1846
- clientId?: string | null;
1847
- }, ack?: (res: {
1848
- ok: boolean;
1849
- data?: ShadowVoiceRenewResult;
1850
- error?: string;
1851
- code?: string;
1852
- }) => void) => void;
1853
- 'voice:heartbeat': (data: {
1854
- channelId: string;
1855
- clientId?: string | null;
1856
- }) => void;
1857
- 'message:send': (data: {
1858
- channelId: string;
1859
- content: string;
1860
- threadId?: string;
1861
- replyToId?: string;
1862
- mentions?: ShadowMessageMention[];
1863
- metadata?: Record<string, unknown>;
1864
- }) => void;
1865
- 'message:typing': (data: {
1866
- channelId: string;
1867
- typing?: boolean;
1868
- }) => void;
1869
- 'presence:update': (data: {
1870
- status: 'online' | 'idle' | 'dnd' | 'offline';
1871
- }) => void;
1872
- 'presence:activity': (data: {
1873
- channelId: string;
1874
- activity: string | null;
1875
- }) => void;
1876
- }
6
+ export { CLIENT_EVENTS, ClientEvent, SERVER_EVENTS, ServerEvent } from '@shadowob/shared';
1877
7
 
1878
8
  /**
1879
9
  * Shadow REST API client.
@@ -1884,6 +14,7 @@ declare class ShadowClient {
1884
14
  private token;
1885
15
  private baseUrl;
1886
16
  constructor(baseUrl: string, token: string);
17
+ serverAppEventStreamUrl(eventStreamPath: string): string;
1887
18
  private isShadowPrivateMediaUrl;
1888
19
  private request;
1889
20
  private requestRaw;
@@ -1911,6 +42,21 @@ declare class ShadowClient {
1911
42
  code: string;
1912
43
  displayName?: string;
1913
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
+ }>;
1914
60
  refreshToken(refreshToken: string): Promise<{
1915
61
  accessToken: string;
1916
62
  refreshToken: string;
@@ -1983,6 +129,45 @@ declare class ShadowClient {
1983
129
  generateAgentToken(agentId: string): Promise<{
1984
130
  token: string;
1985
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
+ }>;
1986
171
  startAgent(agentId: string): Promise<{
1987
172
  ok: boolean;
1988
173
  }>;
@@ -2017,6 +202,7 @@ declare class ShadowClient {
2017
202
  }[]>;
2018
203
  upsertPolicy(agentId: string, serverId: string, data: {
2019
204
  channelId?: string | null;
205
+ listen?: boolean;
2020
206
  mentionOnly?: boolean;
2021
207
  reply?: boolean;
2022
208
  config?: Record<string, unknown>;
@@ -2087,10 +273,20 @@ declare class ShadowClient {
2087
273
  callServerAppCommand(serverIdOrSlug: string, appKey: string, commandName: string, data?: {
2088
274
  input?: unknown;
2089
275
  channelId?: string;
276
+ task?: {
277
+ messageId: string;
278
+ cardId: string;
279
+ claimId?: string;
280
+ };
2090
281
  }): Promise<unknown>;
2091
282
  callServerAppCommandMultipart(serverIdOrSlug: string, appKey: string, commandName: string, data: {
2092
283
  input?: unknown;
2093
284
  channelId?: string;
285
+ task?: {
286
+ messageId: string;
287
+ cardId: string;
288
+ claimId?: string;
289
+ };
2094
290
  file: Blob;
2095
291
  filename: string;
2096
292
  field?: string;
@@ -2230,6 +426,44 @@ declare class ShadowClient {
2230
426
  hasMore: boolean;
2231
427
  }>;
2232
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>;
2233
467
  submitInteractiveAction(messageId: string, input: ShadowInteractiveActionInput): Promise<ShadowInteractiveActionResult>;
2234
468
  getInteractiveState(messageId: string, blockId?: string): Promise<ShadowInteractiveState>;
2235
469
  editMessage(messageId: string, content: string): Promise<ShadowMessage>;
@@ -2295,10 +529,53 @@ declare class ShadowClient {
2295
529
  }>;
2296
530
  uploadMedia(file: Blob | ArrayBuffer, filename: string, contentType: string, messageId?: string | {
2297
531
  messageId?: string;
532
+ kind?: 'file' | 'image' | 'voice';
533
+ durationMs?: number;
534
+ waveformPeaks?: number[];
535
+ transcriptText?: string;
536
+ transcriptLanguage?: string;
537
+ transcriptSource?: 'client' | 'runtime';
2298
538
  }): Promise<{
2299
539
  url: string;
2300
540
  key: string;
2301
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']>;
2302
579
  }>;
2303
580
  resolveAttachmentMediaUrl(attachmentId: string, options?: {
2304
581
  disposition?: 'inline' | 'attachment';
@@ -2314,6 +591,12 @@ declare class ShadowClient {
2314
591
  */
2315
592
  uploadMediaFromUrl(mediaUrl: string, messageId?: string | {
2316
593
  messageId?: string;
594
+ kind?: 'file' | 'image' | 'voice';
595
+ durationMs?: number;
596
+ waveformPeaks?: number[];
597
+ transcriptText?: string;
598
+ transcriptLanguage?: string;
599
+ transcriptSource?: 'client' | 'runtime';
2317
600
  }): Promise<{
2318
601
  url: string;
2319
602
  key: string;
@@ -2419,13 +702,25 @@ declare class ShadowClient {
2419
702
  ok: boolean;
2420
703
  }>;
2421
704
  changePassword(data: {
2422
- currentPassword: string;
705
+ currentPassword?: string;
706
+ oldPassword?: string;
2423
707
  newPassword: string;
708
+ confirmPassword?: string;
2424
709
  }): Promise<{
2425
710
  ok: boolean;
2426
711
  }>;
2427
712
  getDashboard(): Promise<Record<string, unknown>>;
2428
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>;
2429
724
  sendFriendRequest(username: string): Promise<ShadowFriendship>;
2430
725
  acceptFriendRequest(requestId: string): Promise<ShadowFriendship>;
2431
726
  rejectFriendRequest(requestId: string): Promise<ShadowFriendship>;
@@ -3004,6 +1299,18 @@ declare class ShadowClient {
3004
1299
  q?: string;
3005
1300
  limit?: number;
3006
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>;
3007
1314
  discoverBusinessHub(params?: {
3008
1315
  q?: string;
3009
1316
  limit?: number;
@@ -3230,4 +1537,4 @@ declare class ShadowVoiceConsumer {
3230
1537
  private renewTokens;
3231
1538
  }
3232
1539
 
3233
- 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 ShadowServerAppApprovalMode, type ShadowServerAppCatalogEntry, type ShadowServerAppCommand, type ShadowServerAppCommandApproval, type ShadowServerAppCommandConsent, 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 };