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