@shadowob/sdk 1.1.7 → 1.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/shadow-server-app.mjs +58 -0
- package/dist/bridge.cjs +364 -0
- package/dist/bridge.d.cts +105 -0
- package/dist/bridge.d.ts +105 -0
- package/dist/bridge.js +26 -0
- package/dist/chunk-5QQ7ZR6B.js +192 -0
- package/dist/chunk-OMTGSMTQ.js +525 -0
- package/dist/index.cjs +925 -4
- package/dist/index.d.cts +183 -1876
- package/dist/index.d.ts +183 -1876
- package/dist/index.js +252 -3
- package/dist/server-app-node.cjs +82 -0
- package/dist/server-app-node.d.cts +21 -0
- package/dist/server-app-node.d.ts +21 -0
- package/dist/server-app-node.js +56 -0
- package/dist/server-app-qqsBtGmE.d.cts +2445 -0
- package/dist/server-app-qqsBtGmE.d.ts +2445 -0
- package/dist/server-app.cjs +575 -0
- package/dist/server-app.d.cts +2 -0
- package/dist/server-app.d.ts +2 -0
- package/dist/server-app.js +58 -0
- package/package.json +29 -2
|
@@ -0,0 +1,2445 @@
|
|
|
1
|
+
import { MessageCardSource, MessageMention, MessageCard, OAuthLinkCard, BuddyInboxAdmissionMode, BuddyInboxAdmissionPendingDelivery, BuddyInboxAdmissionPolicy, BuddyInboxAdmissionRule, BuddyInboxAdmissionSubjectKind, MentionSuggestionTrigger, MentionSuggestion } from '@shadowob/shared';
|
|
2
|
+
|
|
3
|
+
/** Message returned by the Shadow REST API and Socket.IO broadcasts */
|
|
4
|
+
interface ShadowMessage {
|
|
5
|
+
id: string;
|
|
6
|
+
content: string;
|
|
7
|
+
channelId: string;
|
|
8
|
+
authorId: string;
|
|
9
|
+
threadId?: string | null;
|
|
10
|
+
replyToId?: string | null;
|
|
11
|
+
isPinned?: boolean;
|
|
12
|
+
createdAt: string;
|
|
13
|
+
updatedAt: string;
|
|
14
|
+
author?: {
|
|
15
|
+
id: string;
|
|
16
|
+
username: string;
|
|
17
|
+
displayName?: string | null;
|
|
18
|
+
avatarUrl?: string | null;
|
|
19
|
+
isBot?: boolean;
|
|
20
|
+
};
|
|
21
|
+
attachments?: ShadowAttachment[];
|
|
22
|
+
metadata?: ShadowMessageMetadata | null;
|
|
23
|
+
}
|
|
24
|
+
interface ShadowInteractiveButtonItem {
|
|
25
|
+
id: string;
|
|
26
|
+
label: string;
|
|
27
|
+
style?: 'primary' | 'secondary' | 'destructive';
|
|
28
|
+
value?: string;
|
|
29
|
+
}
|
|
30
|
+
interface ShadowInteractiveSelectItem {
|
|
31
|
+
id: string;
|
|
32
|
+
label: string;
|
|
33
|
+
value: string;
|
|
34
|
+
}
|
|
35
|
+
interface ShadowInteractiveFormField {
|
|
36
|
+
id: string;
|
|
37
|
+
kind: 'text' | 'textarea' | 'number' | 'checkbox' | 'select';
|
|
38
|
+
label: string;
|
|
39
|
+
placeholder?: string;
|
|
40
|
+
defaultValue?: string;
|
|
41
|
+
required?: boolean;
|
|
42
|
+
options?: ShadowInteractiveSelectItem[];
|
|
43
|
+
maxLength?: number;
|
|
44
|
+
min?: number;
|
|
45
|
+
max?: number;
|
|
46
|
+
}
|
|
47
|
+
interface ShadowInteractiveBlock {
|
|
48
|
+
id: string;
|
|
49
|
+
kind: 'buttons' | 'select' | 'form' | 'approval';
|
|
50
|
+
prompt?: string;
|
|
51
|
+
buttons?: ShadowInteractiveButtonItem[];
|
|
52
|
+
options?: ShadowInteractiveSelectItem[];
|
|
53
|
+
fields?: ShadowInteractiveFormField[];
|
|
54
|
+
submitLabel?: string;
|
|
55
|
+
responsePrompt?: string;
|
|
56
|
+
approvalCommentLabel?: string;
|
|
57
|
+
oneShot?: boolean;
|
|
58
|
+
}
|
|
59
|
+
interface ShadowInteractiveResponse {
|
|
60
|
+
blockId: string;
|
|
61
|
+
sourceMessageId: string;
|
|
62
|
+
actionId: string;
|
|
63
|
+
value: string;
|
|
64
|
+
values?: Record<string, string>;
|
|
65
|
+
submissionId?: string;
|
|
66
|
+
responseMessageId?: string | null;
|
|
67
|
+
submittedAt?: string;
|
|
68
|
+
}
|
|
69
|
+
interface ShadowInteractiveState {
|
|
70
|
+
sourceMessageId: string;
|
|
71
|
+
blockId: string;
|
|
72
|
+
submitted: boolean;
|
|
73
|
+
response?: ShadowInteractiveResponse;
|
|
74
|
+
}
|
|
75
|
+
interface ShadowInteractiveActionInput {
|
|
76
|
+
blockId: string;
|
|
77
|
+
actionId: string;
|
|
78
|
+
value?: string;
|
|
79
|
+
label?: string;
|
|
80
|
+
values?: Record<string, string>;
|
|
81
|
+
}
|
|
82
|
+
interface ShadowInteractiveSubmissionPending {
|
|
83
|
+
ok: true;
|
|
84
|
+
pending: true;
|
|
85
|
+
interactiveState?: ShadowInteractiveState;
|
|
86
|
+
}
|
|
87
|
+
type ShadowInteractiveActionResult = ShadowMessage | ShadowInteractiveSubmissionPending;
|
|
88
|
+
interface ShadowMessageMetadata {
|
|
89
|
+
mentions?: ShadowMessageMention[];
|
|
90
|
+
agentChain?: Record<string, unknown>;
|
|
91
|
+
interactive?: ShadowInteractiveBlock;
|
|
92
|
+
interactiveResponse?: ShadowInteractiveResponse;
|
|
93
|
+
interactiveState?: ShadowInteractiveState;
|
|
94
|
+
cards?: ShadowMessageCard[];
|
|
95
|
+
commerceCards?: Array<ShadowCommerceProductCard | ShadowCommerceOfferCardInput>;
|
|
96
|
+
oauthLinkCards?: ShadowOAuthLinkCard[];
|
|
97
|
+
[key: string]: unknown;
|
|
98
|
+
}
|
|
99
|
+
interface ShadowCommerceOfferCardInput {
|
|
100
|
+
id?: string;
|
|
101
|
+
kind: 'offer';
|
|
102
|
+
offerId: string;
|
|
103
|
+
}
|
|
104
|
+
type ShadowMessageMention = MessageMention;
|
|
105
|
+
type ShadowMessageCard = MessageCard;
|
|
106
|
+
type ShadowMessageCardSource = MessageCardSource;
|
|
107
|
+
type ShadowOAuthLinkCard = OAuthLinkCard;
|
|
108
|
+
type ShadowMentionSuggestion = MentionSuggestion;
|
|
109
|
+
type ShadowMentionSuggestionTrigger = MentionSuggestionTrigger;
|
|
110
|
+
type ShadowBuddyInboxAdmissionMode = BuddyInboxAdmissionMode;
|
|
111
|
+
type ShadowBuddyInboxAdmissionSubjectKind = BuddyInboxAdmissionSubjectKind;
|
|
112
|
+
type ShadowBuddyInboxAdmissionRule = BuddyInboxAdmissionRule;
|
|
113
|
+
type ShadowBuddyInboxAdmissionPolicy = BuddyInboxAdmissionPolicy;
|
|
114
|
+
type ShadowBuddyInboxAdmissionPendingDelivery = BuddyInboxAdmissionPendingDelivery;
|
|
115
|
+
interface ShadowBuddyInboxSummary {
|
|
116
|
+
agent: {
|
|
117
|
+
id: string;
|
|
118
|
+
ownerId: string;
|
|
119
|
+
status?: string | null;
|
|
120
|
+
user?: ShadowUser | null;
|
|
121
|
+
};
|
|
122
|
+
channel: ShadowChannel | null;
|
|
123
|
+
canManage: boolean;
|
|
124
|
+
server?: {
|
|
125
|
+
id: string;
|
|
126
|
+
name: string;
|
|
127
|
+
slug?: string | null;
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
interface ShadowEnsureBuddyInboxResult {
|
|
131
|
+
channel: ShadowChannel;
|
|
132
|
+
agent: ShadowBuddyInboxSummary['agent'];
|
|
133
|
+
created: boolean;
|
|
134
|
+
}
|
|
135
|
+
interface ShadowBuddyInboxAdmissionPolicyResult {
|
|
136
|
+
channel: ShadowChannel | null;
|
|
137
|
+
policy: ShadowBuddyInboxAdmissionPolicy;
|
|
138
|
+
}
|
|
139
|
+
interface ShadowBuddyInboxAdmissionPendingResult {
|
|
140
|
+
channel: ShadowChannel | null;
|
|
141
|
+
pending: ShadowBuddyInboxAdmissionPendingDelivery[];
|
|
142
|
+
}
|
|
143
|
+
interface ShadowBuddyInboxAdmissionPendingActionResult {
|
|
144
|
+
channel: ShadowChannel | null;
|
|
145
|
+
pending: ShadowBuddyInboxAdmissionPendingDelivery;
|
|
146
|
+
message?: ShadowMessage;
|
|
147
|
+
policy?: ShadowBuddyInboxAdmissionPolicy;
|
|
148
|
+
}
|
|
149
|
+
interface ShadowInboxTaskInput {
|
|
150
|
+
title: string;
|
|
151
|
+
body?: string;
|
|
152
|
+
priority?: 'low' | 'normal' | 'high' | 'urgent';
|
|
153
|
+
idempotencyKey?: string;
|
|
154
|
+
source?: ShadowMessageCardSource;
|
|
155
|
+
data?: Record<string, unknown>;
|
|
156
|
+
}
|
|
157
|
+
interface ShadowAttachment {
|
|
158
|
+
id: string;
|
|
159
|
+
filename: string;
|
|
160
|
+
url: string;
|
|
161
|
+
contentType: string;
|
|
162
|
+
size: number;
|
|
163
|
+
width?: number | null;
|
|
164
|
+
height?: number | null;
|
|
165
|
+
workspaceNodeId?: string | null;
|
|
166
|
+
kind?: 'file' | 'image' | 'voice';
|
|
167
|
+
durationMs?: number | null;
|
|
168
|
+
audioCodec?: string | null;
|
|
169
|
+
audioContainer?: string | null;
|
|
170
|
+
waveformPeaks?: number[] | null;
|
|
171
|
+
waveformVersion?: number | null;
|
|
172
|
+
transcript?: {
|
|
173
|
+
id: string;
|
|
174
|
+
status: 'pending' | 'processing' | 'ready' | 'failed';
|
|
175
|
+
text: string | null;
|
|
176
|
+
language: string | null;
|
|
177
|
+
source: 'client' | 'server' | 'runtime';
|
|
178
|
+
provider?: string | null;
|
|
179
|
+
confidence?: number | null;
|
|
180
|
+
errorCode?: string | null;
|
|
181
|
+
updatedAt?: string;
|
|
182
|
+
} | null;
|
|
183
|
+
playback?: {
|
|
184
|
+
played: boolean;
|
|
185
|
+
completed: boolean;
|
|
186
|
+
lastPositionMs: number;
|
|
187
|
+
playedCount?: number;
|
|
188
|
+
} | null;
|
|
189
|
+
}
|
|
190
|
+
interface ShadowSignedMediaUrl {
|
|
191
|
+
url: string;
|
|
192
|
+
expiresAt: string;
|
|
193
|
+
}
|
|
194
|
+
type ShadowMediaVariant = 'avatar' | 'preview' | 'banner';
|
|
195
|
+
type ShadowServerAppAction = 'read' | 'write' | 'manage' | 'delete' | 'generate';
|
|
196
|
+
type ShadowServerAppDataClass = 'public' | 'server-private' | 'channel-private' | 'financial' | 'secret' | 'cloud-secret';
|
|
197
|
+
type ShadowServerAppApprovalMode = 'none' | 'first_time' | 'every_time' | 'policy';
|
|
198
|
+
interface ShadowServerAppCommand {
|
|
199
|
+
name: string;
|
|
200
|
+
title?: string;
|
|
201
|
+
description?: string;
|
|
202
|
+
help?: {
|
|
203
|
+
summary?: string;
|
|
204
|
+
usage?: string;
|
|
205
|
+
details?: string;
|
|
206
|
+
examples?: readonly {
|
|
207
|
+
title?: string;
|
|
208
|
+
command?: string;
|
|
209
|
+
input?: unknown;
|
|
210
|
+
}[];
|
|
211
|
+
schemaRef?: string;
|
|
212
|
+
};
|
|
213
|
+
path: string;
|
|
214
|
+
method?: 'POST';
|
|
215
|
+
input?: 'json' | 'multipart';
|
|
216
|
+
inputSchema?: Record<string, unknown>;
|
|
217
|
+
permission: string;
|
|
218
|
+
action: ShadowServerAppAction;
|
|
219
|
+
dataClass: ShadowServerAppDataClass;
|
|
220
|
+
approvalMode?: ShadowServerAppApprovalMode;
|
|
221
|
+
binary?: {
|
|
222
|
+
supported?: boolean;
|
|
223
|
+
field?: string;
|
|
224
|
+
maxBytes?: number;
|
|
225
|
+
contentTypes?: readonly string[];
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
interface ShadowServerAppRealtimeSpec {
|
|
229
|
+
transports?: readonly ('sse' | 'websocket')[];
|
|
230
|
+
subscribe?: {
|
|
231
|
+
events?: readonly string[];
|
|
232
|
+
help?: string;
|
|
233
|
+
};
|
|
234
|
+
publish?: {
|
|
235
|
+
command?: string;
|
|
236
|
+
events?: readonly string[];
|
|
237
|
+
help?: string;
|
|
238
|
+
};
|
|
239
|
+
stateSync?: {
|
|
240
|
+
model?: 'snapshot-patch' | 'frame-sync' | 'lockstep';
|
|
241
|
+
authority?: 'server' | 'client';
|
|
242
|
+
tickRate?: number;
|
|
243
|
+
help?: string;
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
interface ShadowServerAppManifest {
|
|
247
|
+
schemaVersion: 'shadow.app/1';
|
|
248
|
+
appKey: string;
|
|
249
|
+
name: string;
|
|
250
|
+
description?: string;
|
|
251
|
+
version?: string;
|
|
252
|
+
updatedAt?: string;
|
|
253
|
+
iconUrl: string;
|
|
254
|
+
iframe?: {
|
|
255
|
+
entry: string;
|
|
256
|
+
allowedOrigins: readonly string[];
|
|
257
|
+
};
|
|
258
|
+
api: {
|
|
259
|
+
baseUrl: string;
|
|
260
|
+
auth?: {
|
|
261
|
+
type: 'oauth2-bearer';
|
|
262
|
+
};
|
|
263
|
+
};
|
|
264
|
+
access?: {
|
|
265
|
+
defaultPermissions?: string[];
|
|
266
|
+
defaultApprovalMode?: ShadowServerAppApprovalMode;
|
|
267
|
+
};
|
|
268
|
+
commands: readonly ShadowServerAppCommand[];
|
|
269
|
+
skills?: readonly {
|
|
270
|
+
name: string;
|
|
271
|
+
description: string;
|
|
272
|
+
commandHints?: readonly string[];
|
|
273
|
+
}[];
|
|
274
|
+
events?: readonly string[];
|
|
275
|
+
help?: {
|
|
276
|
+
overview?: string;
|
|
277
|
+
usage?: string;
|
|
278
|
+
details?: string;
|
|
279
|
+
commandIndex?: string;
|
|
280
|
+
};
|
|
281
|
+
realtime?: ShadowServerAppRealtimeSpec;
|
|
282
|
+
binary?: {
|
|
283
|
+
supported: boolean;
|
|
284
|
+
maxBytes?: number;
|
|
285
|
+
contentTypes?: readonly string[];
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
interface ShadowServerAppIntegration {
|
|
289
|
+
id: string;
|
|
290
|
+
serverId: string;
|
|
291
|
+
appKey: string;
|
|
292
|
+
name: string;
|
|
293
|
+
description?: string | null;
|
|
294
|
+
iconUrl?: string | null;
|
|
295
|
+
manifestUrl?: string | null;
|
|
296
|
+
manifest: ShadowServerAppManifest;
|
|
297
|
+
manifestVersion?: string | null;
|
|
298
|
+
manifestUpdatedAt?: string | null;
|
|
299
|
+
manifestFetchedAt?: string | null;
|
|
300
|
+
iframeEntry?: string | null;
|
|
301
|
+
allowedOrigins: string[];
|
|
302
|
+
apiBaseUrl: string;
|
|
303
|
+
defaultPermissions: string[];
|
|
304
|
+
defaultApprovalMode: ShadowServerAppApprovalMode;
|
|
305
|
+
status: string;
|
|
306
|
+
installedByUserId: string;
|
|
307
|
+
createdAt: string;
|
|
308
|
+
updatedAt: string;
|
|
309
|
+
}
|
|
310
|
+
interface ShadowServerAppDiscovery {
|
|
311
|
+
manifest: ShadowServerAppManifest;
|
|
312
|
+
installed: ShadowServerAppIntegration | null;
|
|
313
|
+
permissions: Array<{
|
|
314
|
+
name: string;
|
|
315
|
+
title: string;
|
|
316
|
+
description?: string | null;
|
|
317
|
+
permission: string;
|
|
318
|
+
action: ShadowServerAppAction;
|
|
319
|
+
dataClass: ShadowServerAppDataClass;
|
|
320
|
+
approvalMode: ShadowServerAppApprovalMode;
|
|
321
|
+
}>;
|
|
322
|
+
}
|
|
323
|
+
interface ShadowServerAppCommandApproval {
|
|
324
|
+
appKey: string;
|
|
325
|
+
appName: string;
|
|
326
|
+
commandName: string;
|
|
327
|
+
commandTitle: string;
|
|
328
|
+
commandDescription?: string | null;
|
|
329
|
+
permission: string;
|
|
330
|
+
action: ShadowServerAppAction;
|
|
331
|
+
dataClass: ShadowServerAppDataClass;
|
|
332
|
+
actorKind: string;
|
|
333
|
+
subjectKind: 'user' | 'buddy';
|
|
334
|
+
buddyAgentId?: string | null;
|
|
335
|
+
approvalMode: ShadowServerAppApprovalMode;
|
|
336
|
+
reason: 'not_default' | 'first_time' | 'every_time' | 'restricted' | 'policy';
|
|
337
|
+
}
|
|
338
|
+
interface ShadowServerAppCommandConsent {
|
|
339
|
+
id: string;
|
|
340
|
+
serverAppId: string;
|
|
341
|
+
appKey: string;
|
|
342
|
+
command: string;
|
|
343
|
+
permission: string;
|
|
344
|
+
subjectKind: 'user' | 'buddy';
|
|
345
|
+
subjectUserId?: string | null;
|
|
346
|
+
buddyAgentId?: string | null;
|
|
347
|
+
expiresAt?: string | null;
|
|
348
|
+
}
|
|
349
|
+
interface ShadowServerAppCatalogEntry {
|
|
350
|
+
id: string;
|
|
351
|
+
appKey: string;
|
|
352
|
+
name: string;
|
|
353
|
+
description?: string | null;
|
|
354
|
+
iconUrl?: string | null;
|
|
355
|
+
manifestUrl?: string | null;
|
|
356
|
+
manifest: ShadowServerAppManifest;
|
|
357
|
+
status: string;
|
|
358
|
+
installed?: ShadowServerAppIntegration | null;
|
|
359
|
+
permissions?: ShadowServerAppDiscovery['permissions'];
|
|
360
|
+
createdAt: string;
|
|
361
|
+
updatedAt: string;
|
|
362
|
+
}
|
|
363
|
+
interface ShadowServerAppLaunchContext {
|
|
364
|
+
serverId: string;
|
|
365
|
+
serverAppId: string;
|
|
366
|
+
appKey: string;
|
|
367
|
+
iframeEntry: string | null;
|
|
368
|
+
allowedOrigins: string[];
|
|
369
|
+
launchToken: string;
|
|
370
|
+
eventStreamPath: string;
|
|
371
|
+
expiresIn: number;
|
|
372
|
+
}
|
|
373
|
+
interface ShadowServerAppSkillDocument {
|
|
374
|
+
appKey: string;
|
|
375
|
+
markdown: string;
|
|
376
|
+
skills: Array<{
|
|
377
|
+
name: string;
|
|
378
|
+
description: string;
|
|
379
|
+
commandHints?: string[];
|
|
380
|
+
}>;
|
|
381
|
+
}
|
|
382
|
+
interface ShadowServerAppActorProfile {
|
|
383
|
+
id?: string | null;
|
|
384
|
+
username?: string | null;
|
|
385
|
+
displayName?: string | null;
|
|
386
|
+
avatarUrl?: string | null;
|
|
387
|
+
}
|
|
388
|
+
interface ShadowServerAppTokenIntrospection {
|
|
389
|
+
active: boolean;
|
|
390
|
+
token_type?: 'Bearer';
|
|
391
|
+
iss?: string;
|
|
392
|
+
aud?: string;
|
|
393
|
+
sub?: string;
|
|
394
|
+
scope?: string;
|
|
395
|
+
client_id?: string;
|
|
396
|
+
exp?: number;
|
|
397
|
+
iat?: number;
|
|
398
|
+
shadow?: {
|
|
399
|
+
protocol: 'shadow.app/1';
|
|
400
|
+
serverId: string;
|
|
401
|
+
serverAppId: string;
|
|
402
|
+
appKey: string;
|
|
403
|
+
command?: string;
|
|
404
|
+
actor: {
|
|
405
|
+
kind?: string;
|
|
406
|
+
userId?: string | null;
|
|
407
|
+
buddyAgentId?: string | null;
|
|
408
|
+
ownerId?: string | null;
|
|
409
|
+
profile?: ShadowServerAppActorProfile | null;
|
|
410
|
+
};
|
|
411
|
+
channelId?: string | null;
|
|
412
|
+
task?: {
|
|
413
|
+
messageId: string;
|
|
414
|
+
cardId: string;
|
|
415
|
+
claimId?: string | null;
|
|
416
|
+
workspaceId?: string | null;
|
|
417
|
+
scopes?: string[];
|
|
418
|
+
};
|
|
419
|
+
permission?: string;
|
|
420
|
+
action?: string;
|
|
421
|
+
dataClass?: string;
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
interface ShadowChannel {
|
|
425
|
+
id: string;
|
|
426
|
+
name: string;
|
|
427
|
+
type: string;
|
|
428
|
+
kind: 'server' | 'dm';
|
|
429
|
+
serverId: string | null;
|
|
430
|
+
description?: string | null;
|
|
431
|
+
position?: number;
|
|
432
|
+
isPrivate?: boolean;
|
|
433
|
+
isMember?: boolean;
|
|
434
|
+
otherUser?: ShadowUser | null;
|
|
435
|
+
}
|
|
436
|
+
type ShadowChannelJoinRequestStatus = 'pending' | 'approved' | 'rejected';
|
|
437
|
+
interface ShadowChannelAccess {
|
|
438
|
+
channel: ShadowChannel;
|
|
439
|
+
isServerMember: boolean;
|
|
440
|
+
isChannelMember: boolean;
|
|
441
|
+
canManage: boolean;
|
|
442
|
+
canAccess: boolean;
|
|
443
|
+
requiresApproval: boolean;
|
|
444
|
+
joinRequestStatus: ShadowChannelJoinRequestStatus | null;
|
|
445
|
+
joinRequestId: string | null;
|
|
446
|
+
}
|
|
447
|
+
interface ShadowChannelJoinRequestResult {
|
|
448
|
+
ok: boolean;
|
|
449
|
+
status: ShadowChannelJoinRequestStatus;
|
|
450
|
+
requestId?: string;
|
|
451
|
+
}
|
|
452
|
+
interface ShadowVoiceParticipant {
|
|
453
|
+
id: string;
|
|
454
|
+
channelId: string;
|
|
455
|
+
userId: string;
|
|
456
|
+
uid: number;
|
|
457
|
+
screenUid: number;
|
|
458
|
+
username: string;
|
|
459
|
+
displayName: string | null;
|
|
460
|
+
avatarUrl: string | null;
|
|
461
|
+
isBot: boolean;
|
|
462
|
+
isMuted: boolean;
|
|
463
|
+
isDeafened: boolean;
|
|
464
|
+
isSpeaking: boolean;
|
|
465
|
+
isScreenSharing: boolean;
|
|
466
|
+
joinedAt: string;
|
|
467
|
+
updatedAt: string;
|
|
468
|
+
clientId: string | null;
|
|
469
|
+
}
|
|
470
|
+
interface ShadowVoiceCredentials {
|
|
471
|
+
appId: string;
|
|
472
|
+
channelId: string;
|
|
473
|
+
agoraChannelName: string;
|
|
474
|
+
uid: number;
|
|
475
|
+
screenUid: number;
|
|
476
|
+
token: string | null;
|
|
477
|
+
screenToken: string | null;
|
|
478
|
+
expiresAt: string | null;
|
|
479
|
+
}
|
|
480
|
+
interface ShadowVoiceState {
|
|
481
|
+
channelId: string;
|
|
482
|
+
agoraChannelName: string;
|
|
483
|
+
participants: ShadowVoiceParticipant[];
|
|
484
|
+
participantCount: number;
|
|
485
|
+
emptySince: string | null;
|
|
486
|
+
graceEndsAt: string | null;
|
|
487
|
+
}
|
|
488
|
+
interface ShadowVoiceJoinResult {
|
|
489
|
+
credentials: ShadowVoiceCredentials;
|
|
490
|
+
participant: ShadowVoiceParticipant;
|
|
491
|
+
state: ShadowVoiceState;
|
|
492
|
+
}
|
|
493
|
+
interface ShadowVoiceLeaveResult {
|
|
494
|
+
participant: ShadowVoiceParticipant | null;
|
|
495
|
+
state: ShadowVoiceState;
|
|
496
|
+
left?: boolean;
|
|
497
|
+
}
|
|
498
|
+
interface ShadowVoiceRenewResult {
|
|
499
|
+
credentials: ShadowVoiceCredentials;
|
|
500
|
+
state: ShadowVoiceState;
|
|
501
|
+
}
|
|
502
|
+
interface ShadowVoicePolicy {
|
|
503
|
+
agentId: string;
|
|
504
|
+
channelId: string;
|
|
505
|
+
listen: boolean;
|
|
506
|
+
autoJoin: boolean;
|
|
507
|
+
consumeAudio: boolean;
|
|
508
|
+
consumeScreenShare: boolean;
|
|
509
|
+
screenshotIntervalSeconds: number | null;
|
|
510
|
+
}
|
|
511
|
+
type ShadowServerJoinRequestStatus = 'pending' | 'approved' | 'rejected';
|
|
512
|
+
interface ShadowServerAccess {
|
|
513
|
+
server: ShadowServer;
|
|
514
|
+
isMember: boolean;
|
|
515
|
+
canManage: boolean;
|
|
516
|
+
canAccess: boolean;
|
|
517
|
+
requiresApproval: boolean;
|
|
518
|
+
joinRequestStatus: ShadowServerJoinRequestStatus | null;
|
|
519
|
+
joinRequestId: string | null;
|
|
520
|
+
}
|
|
521
|
+
interface ShadowServerJoinRequestResult {
|
|
522
|
+
ok: boolean;
|
|
523
|
+
status: ShadowServerJoinRequestStatus;
|
|
524
|
+
requestId?: string;
|
|
525
|
+
}
|
|
526
|
+
interface ShadowThread {
|
|
527
|
+
id: string;
|
|
528
|
+
name: string;
|
|
529
|
+
channelId: string;
|
|
530
|
+
parentMessageId: string;
|
|
531
|
+
createdAt: string;
|
|
532
|
+
}
|
|
533
|
+
interface ShadowMember {
|
|
534
|
+
userId: string;
|
|
535
|
+
serverId: string;
|
|
536
|
+
role: string;
|
|
537
|
+
isBot?: boolean;
|
|
538
|
+
uid?: string;
|
|
539
|
+
nickname?: string;
|
|
540
|
+
avatar?: string | null;
|
|
541
|
+
status?: 'online' | 'idle' | 'dnd' | 'offline';
|
|
542
|
+
membershipTier?: string;
|
|
543
|
+
membershipLevel?: number;
|
|
544
|
+
isMember?: boolean;
|
|
545
|
+
totalOnlineSeconds?: number;
|
|
546
|
+
buddyTag?: string | null;
|
|
547
|
+
creator?: {
|
|
548
|
+
uid: string;
|
|
549
|
+
nickname: string;
|
|
550
|
+
username?: string;
|
|
551
|
+
displayName?: string | null;
|
|
552
|
+
avatarUrl?: string | null;
|
|
553
|
+
} | null;
|
|
554
|
+
user?: ShadowUser;
|
|
555
|
+
}
|
|
556
|
+
interface ShadowAddAgentsToServerResult {
|
|
557
|
+
added: string[];
|
|
558
|
+
failed: Array<{
|
|
559
|
+
agentId: string;
|
|
560
|
+
error: string;
|
|
561
|
+
}>;
|
|
562
|
+
}
|
|
563
|
+
interface ShadowInviteCode {
|
|
564
|
+
id: string;
|
|
565
|
+
code: string;
|
|
566
|
+
createdBy: string;
|
|
567
|
+
usedBy?: string | null;
|
|
568
|
+
usedAt?: string | null;
|
|
569
|
+
isActive: boolean;
|
|
570
|
+
note?: string | null;
|
|
571
|
+
createdAt: string;
|
|
572
|
+
}
|
|
573
|
+
interface ShadowServer {
|
|
574
|
+
id: string;
|
|
575
|
+
name: string;
|
|
576
|
+
slug: string;
|
|
577
|
+
description: string | null;
|
|
578
|
+
iconUrl: string | null;
|
|
579
|
+
bannerUrl: string | null;
|
|
580
|
+
isPublic: boolean;
|
|
581
|
+
}
|
|
582
|
+
interface ShadowUser {
|
|
583
|
+
id: string;
|
|
584
|
+
email?: string;
|
|
585
|
+
username: string;
|
|
586
|
+
displayName?: string;
|
|
587
|
+
avatarUrl?: string;
|
|
588
|
+
isBot?: boolean;
|
|
589
|
+
agentId?: string;
|
|
590
|
+
membership?: ShadowMembership;
|
|
591
|
+
}
|
|
592
|
+
interface ShadowMembership {
|
|
593
|
+
status: string;
|
|
594
|
+
tier: {
|
|
595
|
+
id: string;
|
|
596
|
+
level: number;
|
|
597
|
+
label: string;
|
|
598
|
+
capabilities: string[];
|
|
599
|
+
};
|
|
600
|
+
level: number;
|
|
601
|
+
isMember: boolean;
|
|
602
|
+
memberSince?: string | null;
|
|
603
|
+
inviteCodeId?: string | null;
|
|
604
|
+
capabilities: string[];
|
|
605
|
+
}
|
|
606
|
+
interface ShadowAuthResponse {
|
|
607
|
+
user: ShadowUser;
|
|
608
|
+
accessToken: string;
|
|
609
|
+
refreshToken: string;
|
|
610
|
+
}
|
|
611
|
+
type ShadowPlayAction = {
|
|
612
|
+
kind: 'public_channel';
|
|
613
|
+
serverId?: string;
|
|
614
|
+
serverSlug?: string;
|
|
615
|
+
channelId?: string;
|
|
616
|
+
channelName?: string;
|
|
617
|
+
inviteCode?: string;
|
|
618
|
+
buddyUserIds?: string[];
|
|
619
|
+
buddyTemplateSlug?: string;
|
|
620
|
+
} | {
|
|
621
|
+
kind: 'private_room';
|
|
622
|
+
serverId?: string;
|
|
623
|
+
serverSlug?: string;
|
|
624
|
+
namePrefix?: string;
|
|
625
|
+
buddyUserIds?: string[];
|
|
626
|
+
buddyTemplateSlug?: string;
|
|
627
|
+
} | {
|
|
628
|
+
kind: 'cloud_deploy';
|
|
629
|
+
templateSlug: string;
|
|
630
|
+
buddyTemplateSlug?: string;
|
|
631
|
+
buddyUserIds?: string[];
|
|
632
|
+
resourceTier?: 'lightweight' | 'standard' | 'pro';
|
|
633
|
+
} | {
|
|
634
|
+
kind: 'external_oauth_app';
|
|
635
|
+
clientId: string;
|
|
636
|
+
redirectUri: string;
|
|
637
|
+
scopes?: string[];
|
|
638
|
+
state?: string;
|
|
639
|
+
} | {
|
|
640
|
+
kind: 'landing_page';
|
|
641
|
+
url: string;
|
|
642
|
+
};
|
|
643
|
+
type ShadowPlayAvailability = 'available' | 'gated' | 'coming_soon' | 'misconfigured';
|
|
644
|
+
interface ShadowHomePlayCatalogItem {
|
|
645
|
+
id: string;
|
|
646
|
+
image: string;
|
|
647
|
+
title: string;
|
|
648
|
+
titleEn: string;
|
|
649
|
+
desc: string;
|
|
650
|
+
descEn: string;
|
|
651
|
+
category: string;
|
|
652
|
+
categoryEn: string;
|
|
653
|
+
starts: string;
|
|
654
|
+
accentColor: string;
|
|
655
|
+
hot?: boolean;
|
|
656
|
+
status: ShadowPlayAvailability;
|
|
657
|
+
action?: ShadowPlayAction;
|
|
658
|
+
gates?: {
|
|
659
|
+
auth?: 'optional' | 'required';
|
|
660
|
+
membership?: 'none' | 'required';
|
|
661
|
+
profile?: 'optional' | 'required';
|
|
662
|
+
};
|
|
663
|
+
template?: {
|
|
664
|
+
kind: 'cloud';
|
|
665
|
+
slug: string;
|
|
666
|
+
path: string;
|
|
667
|
+
};
|
|
668
|
+
materials?: {
|
|
669
|
+
cover: string;
|
|
670
|
+
};
|
|
671
|
+
}
|
|
672
|
+
interface ShadowPlayLaunchResult {
|
|
673
|
+
ok: boolean;
|
|
674
|
+
status: string;
|
|
675
|
+
playId?: string | null;
|
|
676
|
+
redirectUrl?: string;
|
|
677
|
+
serverId?: string;
|
|
678
|
+
channelId?: string;
|
|
679
|
+
deploymentId?: string;
|
|
680
|
+
deploymentStatus?: string;
|
|
681
|
+
templateSlug?: string;
|
|
682
|
+
}
|
|
683
|
+
interface ShadowModelProxyModel {
|
|
684
|
+
id: string;
|
|
685
|
+
object: 'model';
|
|
686
|
+
created: number;
|
|
687
|
+
owned_by: string;
|
|
688
|
+
}
|
|
689
|
+
interface ShadowModelProxyModelsResponse {
|
|
690
|
+
object: 'list';
|
|
691
|
+
data: ShadowModelProxyModel[];
|
|
692
|
+
}
|
|
693
|
+
interface ShadowModelProxyBilling {
|
|
694
|
+
enabled: boolean;
|
|
695
|
+
currency: 'shrimp';
|
|
696
|
+
model: string;
|
|
697
|
+
models: string[];
|
|
698
|
+
shrimpMicrosPerCoin: number;
|
|
699
|
+
shrimpPerCny: number;
|
|
700
|
+
inputTokensPerShrimp: number | null;
|
|
701
|
+
outputTokensPerShrimp: number | null;
|
|
702
|
+
inputCacheHitCnyPerMillionTokens: number;
|
|
703
|
+
inputCacheMissCnyPerMillionTokens: number;
|
|
704
|
+
outputCnyPerMillionTokens: number;
|
|
705
|
+
inputCacheHitShrimpPerMillionTokens: number;
|
|
706
|
+
inputCacheMissShrimpPerMillionTokens: number;
|
|
707
|
+
outputShrimpPerMillionTokens: number;
|
|
708
|
+
}
|
|
709
|
+
type ShadowModelProxyChatCompletionRequest = Record<string, unknown> & {
|
|
710
|
+
model?: string;
|
|
711
|
+
messages: unknown[];
|
|
712
|
+
stream?: boolean;
|
|
713
|
+
};
|
|
714
|
+
type ShadowModelProxyChatCompletionResponse = Record<string, unknown>;
|
|
715
|
+
interface ShadowNotification {
|
|
716
|
+
id: string;
|
|
717
|
+
userId: string;
|
|
718
|
+
type: string;
|
|
719
|
+
kind?: string | null;
|
|
720
|
+
title: string;
|
|
721
|
+
body: string | null;
|
|
722
|
+
referenceId?: string | null;
|
|
723
|
+
referenceType?: string | null;
|
|
724
|
+
senderId?: string | null;
|
|
725
|
+
senderAvatarUrl?: string | null;
|
|
726
|
+
scopeServerId?: string | null;
|
|
727
|
+
scopeChannelId?: string | null;
|
|
728
|
+
aggregationKey?: string | null;
|
|
729
|
+
aggregatedCount?: number | null;
|
|
730
|
+
lastAggregatedAt?: string | null;
|
|
731
|
+
metadata?: Record<string, unknown> | null;
|
|
732
|
+
isRead: boolean;
|
|
733
|
+
createdAt: string;
|
|
734
|
+
expiresAt?: string | null;
|
|
735
|
+
}
|
|
736
|
+
interface ShadowScopedUnread {
|
|
737
|
+
channelUnread: Record<string, number>;
|
|
738
|
+
serverUnread: Record<string, number>;
|
|
739
|
+
dmUnread?: Record<string, number>;
|
|
740
|
+
}
|
|
741
|
+
interface ShadowChannelPolicy {
|
|
742
|
+
listen: boolean;
|
|
743
|
+
reply: boolean;
|
|
744
|
+
mentionOnly: boolean;
|
|
745
|
+
config: ShadowChannelPolicyConfig;
|
|
746
|
+
}
|
|
747
|
+
interface ShadowChannelPolicyConfig {
|
|
748
|
+
allowedTriggerUserIds?: string[];
|
|
749
|
+
triggerUserIds?: string[];
|
|
750
|
+
ownerId?: string;
|
|
751
|
+
activeTenantIds?: string[];
|
|
752
|
+
replyRequiresMention?: boolean;
|
|
753
|
+
[key: string]: unknown;
|
|
754
|
+
}
|
|
755
|
+
interface ShadowSlashCommand {
|
|
756
|
+
name: string;
|
|
757
|
+
description?: string;
|
|
758
|
+
aliases?: string[];
|
|
759
|
+
packId?: string;
|
|
760
|
+
sourcePath?: string;
|
|
761
|
+
interaction?: ShadowInteractiveBlock;
|
|
762
|
+
}
|
|
763
|
+
interface ShadowChannelSlashCommand extends ShadowSlashCommand {
|
|
764
|
+
agentId: string;
|
|
765
|
+
botUserId: string;
|
|
766
|
+
botUsername: string;
|
|
767
|
+
botDisplayName?: string | null;
|
|
768
|
+
}
|
|
769
|
+
interface ShadowChannelBootstrap {
|
|
770
|
+
access: ShadowChannelAccess;
|
|
771
|
+
channel: ShadowChannel;
|
|
772
|
+
server: ShadowServer | null;
|
|
773
|
+
channels: ShadowChannel[];
|
|
774
|
+
members: ShadowMember[];
|
|
775
|
+
messages: {
|
|
776
|
+
messages: ShadowMessage[];
|
|
777
|
+
hasMore: boolean;
|
|
778
|
+
};
|
|
779
|
+
slashCommands: {
|
|
780
|
+
commands: ShadowChannelSlashCommand[];
|
|
781
|
+
};
|
|
782
|
+
}
|
|
783
|
+
interface ShadowRemoteChannel {
|
|
784
|
+
id: string;
|
|
785
|
+
name: string;
|
|
786
|
+
type: string;
|
|
787
|
+
policy: ShadowChannelPolicy;
|
|
788
|
+
}
|
|
789
|
+
interface ShadowRemoteServer {
|
|
790
|
+
id: string;
|
|
791
|
+
name: string;
|
|
792
|
+
slug?: string;
|
|
793
|
+
iconUrl?: string | null;
|
|
794
|
+
defaultPolicy: ShadowChannelPolicy;
|
|
795
|
+
channels: ShadowRemoteChannel[];
|
|
796
|
+
}
|
|
797
|
+
interface ShadowRemoteConfig {
|
|
798
|
+
agentId: string;
|
|
799
|
+
botUserId: string;
|
|
800
|
+
ownerId?: string;
|
|
801
|
+
buddyMode?: 'private' | 'shareable';
|
|
802
|
+
allowedServerIds?: string[];
|
|
803
|
+
activeTenantIds?: string[];
|
|
804
|
+
allowedTriggerUserIds?: string[];
|
|
805
|
+
slashCommands?: ShadowSlashCommand[];
|
|
806
|
+
servers: ShadowRemoteServer[];
|
|
807
|
+
}
|
|
808
|
+
interface ShadowUsageProviderSnapshot {
|
|
809
|
+
provider: string;
|
|
810
|
+
amountUsd?: number | null;
|
|
811
|
+
usageLabel?: string | null;
|
|
812
|
+
raw?: string | null;
|
|
813
|
+
inputTokens?: number | null;
|
|
814
|
+
outputTokens?: number | null;
|
|
815
|
+
totalTokens?: number | null;
|
|
816
|
+
}
|
|
817
|
+
interface ShadowAgentUsageSnapshotInput {
|
|
818
|
+
source?: string;
|
|
819
|
+
model?: string | null;
|
|
820
|
+
totalUsd?: number | null;
|
|
821
|
+
inputTokens?: number | null;
|
|
822
|
+
outputTokens?: number | null;
|
|
823
|
+
cacheReadTokens?: number | null;
|
|
824
|
+
cacheWriteTokens?: number | null;
|
|
825
|
+
totalTokens?: number | null;
|
|
826
|
+
providers?: ShadowUsageProviderSnapshot[];
|
|
827
|
+
raw?: Record<string, unknown>;
|
|
828
|
+
generatedAt?: string;
|
|
829
|
+
}
|
|
830
|
+
interface ShadowConnectorRuntimeInfo {
|
|
831
|
+
id: string;
|
|
832
|
+
label: string;
|
|
833
|
+
kind: 'openclaw' | 'cli';
|
|
834
|
+
status: 'available' | 'missing';
|
|
835
|
+
version?: string | null;
|
|
836
|
+
command?: string | null;
|
|
837
|
+
detectedAt?: string | null;
|
|
838
|
+
}
|
|
839
|
+
interface ShadowConnectorComputer {
|
|
840
|
+
id: string;
|
|
841
|
+
name: string;
|
|
842
|
+
status: 'pending' | 'online' | 'offline';
|
|
843
|
+
hostname: string | null;
|
|
844
|
+
os: string | null;
|
|
845
|
+
arch: string | null;
|
|
846
|
+
daemonVersion: string | null;
|
|
847
|
+
runtimes: ShadowConnectorRuntimeInfo[];
|
|
848
|
+
lastSeenAt: string | null;
|
|
849
|
+
createdAt: string;
|
|
850
|
+
updatedAt: string;
|
|
851
|
+
}
|
|
852
|
+
interface ShadowConnectorBootstrapResult {
|
|
853
|
+
computer: ShadowConnectorComputer;
|
|
854
|
+
apiKey: string;
|
|
855
|
+
command: string;
|
|
856
|
+
}
|
|
857
|
+
interface TypingPayload {
|
|
858
|
+
channelId: string;
|
|
859
|
+
userId: string;
|
|
860
|
+
username: string;
|
|
861
|
+
displayName?: string | null;
|
|
862
|
+
typing?: boolean;
|
|
863
|
+
}
|
|
864
|
+
interface PresenceChangePayload {
|
|
865
|
+
userId: string;
|
|
866
|
+
status: 'online' | 'idle' | 'dnd' | 'offline';
|
|
867
|
+
}
|
|
868
|
+
interface PresenceActivityPayload {
|
|
869
|
+
userId: string;
|
|
870
|
+
activity: string | null;
|
|
871
|
+
channelId: string;
|
|
872
|
+
username?: string;
|
|
873
|
+
displayName?: string | null;
|
|
874
|
+
}
|
|
875
|
+
interface MemberJoinPayload {
|
|
876
|
+
channelId: string;
|
|
877
|
+
userId: string;
|
|
878
|
+
}
|
|
879
|
+
interface MemberLeavePayload {
|
|
880
|
+
channelId: string;
|
|
881
|
+
userId: string;
|
|
882
|
+
}
|
|
883
|
+
interface SlashCommandsUpdatedPayload {
|
|
884
|
+
channelId: string;
|
|
885
|
+
serverId?: string;
|
|
886
|
+
agentId?: string;
|
|
887
|
+
botUserId?: string;
|
|
888
|
+
commandCount?: number;
|
|
889
|
+
}
|
|
890
|
+
interface ReactionPayload {
|
|
891
|
+
messageId: string;
|
|
892
|
+
userId: string;
|
|
893
|
+
emoji: string;
|
|
894
|
+
}
|
|
895
|
+
interface MessageDeletedPayload {
|
|
896
|
+
id: string;
|
|
897
|
+
channelId: string;
|
|
898
|
+
}
|
|
899
|
+
interface ChannelCreatedPayload {
|
|
900
|
+
id: string;
|
|
901
|
+
name: string;
|
|
902
|
+
type: string;
|
|
903
|
+
serverId: string;
|
|
904
|
+
}
|
|
905
|
+
interface ChannelMemberAddedPayload {
|
|
906
|
+
channelId: string;
|
|
907
|
+
serverId?: string;
|
|
908
|
+
userId?: string;
|
|
909
|
+
}
|
|
910
|
+
interface ChannelMemberRemovedPayload {
|
|
911
|
+
channelId: string;
|
|
912
|
+
serverId?: string;
|
|
913
|
+
userId?: string;
|
|
914
|
+
}
|
|
915
|
+
interface ServerJoinedPayload {
|
|
916
|
+
serverId: string;
|
|
917
|
+
serverName: string;
|
|
918
|
+
}
|
|
919
|
+
interface PolicyChangedPayload {
|
|
920
|
+
agentId: string;
|
|
921
|
+
serverId: string;
|
|
922
|
+
channelId?: string | null;
|
|
923
|
+
}
|
|
924
|
+
interface VoiceParticipantPayload {
|
|
925
|
+
channelId: string;
|
|
926
|
+
participant: ShadowVoiceParticipant | null;
|
|
927
|
+
state: ShadowVoiceState;
|
|
928
|
+
}
|
|
929
|
+
interface VoicePolicyUpdatedPayload {
|
|
930
|
+
channelId: string;
|
|
931
|
+
agentId: string;
|
|
932
|
+
}
|
|
933
|
+
interface ShadowFriendship {
|
|
934
|
+
id: string;
|
|
935
|
+
userId: string;
|
|
936
|
+
friendId: string;
|
|
937
|
+
status: 'pending' | 'accepted' | 'rejected';
|
|
938
|
+
createdAt: string;
|
|
939
|
+
user?: ShadowUser;
|
|
940
|
+
friend?: ShadowUser;
|
|
941
|
+
}
|
|
942
|
+
interface ShadowOAuthApp {
|
|
943
|
+
id: string;
|
|
944
|
+
name: string;
|
|
945
|
+
clientId: string;
|
|
946
|
+
clientSecret?: string;
|
|
947
|
+
redirectUris: string[];
|
|
948
|
+
scopes: string[];
|
|
949
|
+
createdAt: string;
|
|
950
|
+
}
|
|
951
|
+
interface ShadowOAuthConsent {
|
|
952
|
+
id: string;
|
|
953
|
+
appId: string;
|
|
954
|
+
appName: string;
|
|
955
|
+
scopes: string[];
|
|
956
|
+
createdAt: string;
|
|
957
|
+
}
|
|
958
|
+
interface ShadowOAuthToken {
|
|
959
|
+
access_token: string;
|
|
960
|
+
token_type: string;
|
|
961
|
+
expires_in: number;
|
|
962
|
+
refresh_token?: string;
|
|
963
|
+
scope: string;
|
|
964
|
+
}
|
|
965
|
+
interface ShadowListing {
|
|
966
|
+
id: string;
|
|
967
|
+
agentId: string;
|
|
968
|
+
title: string;
|
|
969
|
+
description: string;
|
|
970
|
+
pricePerHour: number;
|
|
971
|
+
currency: string;
|
|
972
|
+
tags: string[];
|
|
973
|
+
isActive: boolean;
|
|
974
|
+
createdAt: string;
|
|
975
|
+
agent?: {
|
|
976
|
+
id: string;
|
|
977
|
+
name: string;
|
|
978
|
+
status: string;
|
|
979
|
+
};
|
|
980
|
+
}
|
|
981
|
+
interface ShadowContract {
|
|
982
|
+
id: string;
|
|
983
|
+
listingId: string;
|
|
984
|
+
tenantId: string;
|
|
985
|
+
ownerId: string;
|
|
986
|
+
status: string;
|
|
987
|
+
startedAt: string;
|
|
988
|
+
expiresAt: string;
|
|
989
|
+
totalCost: number;
|
|
990
|
+
createdAt: string;
|
|
991
|
+
}
|
|
992
|
+
interface ShadowShop {
|
|
993
|
+
id: string;
|
|
994
|
+
scopeKind?: 'server' | 'user';
|
|
995
|
+
serverId?: string | null;
|
|
996
|
+
ownerUserId?: string | null;
|
|
997
|
+
visibility?: string;
|
|
998
|
+
name: string;
|
|
999
|
+
description?: string | null;
|
|
1000
|
+
isEnabled: boolean;
|
|
1001
|
+
}
|
|
1002
|
+
type ShadowCommunityAssetType = 'badge' | 'gift' | 'coupon' | 'service_ticket' | 'collectible' | 'content_pass' | 'reward';
|
|
1003
|
+
interface ShadowCommunityAssetDefinition {
|
|
1004
|
+
id: string;
|
|
1005
|
+
issuerKind: 'platform' | 'server' | 'user' | 'shop';
|
|
1006
|
+
issuerId?: string | null;
|
|
1007
|
+
shopId?: string | null;
|
|
1008
|
+
assetType: ShadowCommunityAssetType;
|
|
1009
|
+
name: string;
|
|
1010
|
+
description?: string | null;
|
|
1011
|
+
imageUrl?: string | null;
|
|
1012
|
+
giftable: boolean;
|
|
1013
|
+
transferable: boolean;
|
|
1014
|
+
consumable: boolean;
|
|
1015
|
+
revocable: boolean;
|
|
1016
|
+
expiresAfterDays?: number | null;
|
|
1017
|
+
status: 'draft' | 'active' | 'paused' | 'archived';
|
|
1018
|
+
metadata?: Record<string, unknown> | null;
|
|
1019
|
+
createdAt?: string;
|
|
1020
|
+
updatedAt?: string;
|
|
1021
|
+
}
|
|
1022
|
+
interface ShadowCommunityAssetGrant {
|
|
1023
|
+
id: string;
|
|
1024
|
+
definitionId: string;
|
|
1025
|
+
ownerUserId: string;
|
|
1026
|
+
sourceKind: string;
|
|
1027
|
+
sourceId?: string | null;
|
|
1028
|
+
quantity: number;
|
|
1029
|
+
remainingQuantity: number;
|
|
1030
|
+
status: 'active' | 'locked' | 'consumed' | 'revoked' | 'expired';
|
|
1031
|
+
expiresAt?: string | null;
|
|
1032
|
+
metadata?: Record<string, unknown> | null;
|
|
1033
|
+
createdAt?: string;
|
|
1034
|
+
updatedAt?: string;
|
|
1035
|
+
}
|
|
1036
|
+
interface ShadowCommunityAsset {
|
|
1037
|
+
grant: ShadowCommunityAssetGrant;
|
|
1038
|
+
definition: ShadowCommunityAssetDefinition;
|
|
1039
|
+
}
|
|
1040
|
+
interface ShadowEconomyTip {
|
|
1041
|
+
id: string;
|
|
1042
|
+
senderUserId: string;
|
|
1043
|
+
recipientUserId: string;
|
|
1044
|
+
amount: number;
|
|
1045
|
+
sellerNet: number;
|
|
1046
|
+
status: 'succeeded' | 'failed' | 'reversed' | 'held';
|
|
1047
|
+
contextKind?: string | null;
|
|
1048
|
+
contextId?: string | null;
|
|
1049
|
+
message?: string | null;
|
|
1050
|
+
createdAt?: string;
|
|
1051
|
+
}
|
|
1052
|
+
interface ShadowEconomyGift {
|
|
1053
|
+
id: string;
|
|
1054
|
+
senderUserId: string;
|
|
1055
|
+
recipientUserId: string;
|
|
1056
|
+
status: 'succeeded' | 'failed' | 'reversed' | 'held';
|
|
1057
|
+
message?: string | null;
|
|
1058
|
+
metadata?: Record<string, unknown> | null;
|
|
1059
|
+
createdAt?: string;
|
|
1060
|
+
}
|
|
1061
|
+
interface ShadowSettlementLine {
|
|
1062
|
+
id: string;
|
|
1063
|
+
sellerUserId: string;
|
|
1064
|
+
shopId?: string | null;
|
|
1065
|
+
sourceType: 'order' | 'tip' | 'gift' | 'adjustment';
|
|
1066
|
+
sourceId: string;
|
|
1067
|
+
grossAmount: number;
|
|
1068
|
+
platformFee: number;
|
|
1069
|
+
netAmount: number;
|
|
1070
|
+
status: 'pending' | 'available' | 'settled' | 'failed' | 'held' | 'reversed';
|
|
1071
|
+
availableAt?: string | null;
|
|
1072
|
+
settledAt?: string | null;
|
|
1073
|
+
createdAt?: string;
|
|
1074
|
+
updatedAt?: string;
|
|
1075
|
+
}
|
|
1076
|
+
interface ShadowCommerceProductCard {
|
|
1077
|
+
id: string;
|
|
1078
|
+
kind: 'offer' | 'product';
|
|
1079
|
+
offerId?: string;
|
|
1080
|
+
shopId: string;
|
|
1081
|
+
shopScope: {
|
|
1082
|
+
kind: 'server' | 'user';
|
|
1083
|
+
id: string;
|
|
1084
|
+
};
|
|
1085
|
+
productId: string;
|
|
1086
|
+
skuId?: string;
|
|
1087
|
+
snapshot: {
|
|
1088
|
+
name: string;
|
|
1089
|
+
summary?: string | null;
|
|
1090
|
+
imageUrl?: string | null;
|
|
1091
|
+
shopName?: string | null;
|
|
1092
|
+
deliveryPromise?: string | null;
|
|
1093
|
+
price: number;
|
|
1094
|
+
currency: string;
|
|
1095
|
+
productType: 'physical' | 'entitlement';
|
|
1096
|
+
billingMode?: 'one_time' | 'fixed_duration' | 'subscription';
|
|
1097
|
+
durationSeconds?: number | null;
|
|
1098
|
+
resourceType?: string;
|
|
1099
|
+
resourceId?: string;
|
|
1100
|
+
capability?: string;
|
|
1101
|
+
};
|
|
1102
|
+
purchase: {
|
|
1103
|
+
mode: 'direct' | 'select_sku' | 'open_detail';
|
|
1104
|
+
};
|
|
1105
|
+
}
|
|
1106
|
+
interface ShadowCommerceProductPickerGroup {
|
|
1107
|
+
key: string;
|
|
1108
|
+
labelKey: string;
|
|
1109
|
+
shopId: string;
|
|
1110
|
+
shopName: string;
|
|
1111
|
+
shopScope: {
|
|
1112
|
+
kind: 'server' | 'user';
|
|
1113
|
+
id: string;
|
|
1114
|
+
};
|
|
1115
|
+
cards: ShadowCommerceProductCard[];
|
|
1116
|
+
}
|
|
1117
|
+
interface ShadowCommerceProductPickerResponse {
|
|
1118
|
+
cards: ShadowCommerceProductCard[];
|
|
1119
|
+
groups?: ShadowCommerceProductPickerGroup[];
|
|
1120
|
+
}
|
|
1121
|
+
interface ShadowEntitlementProvisioning {
|
|
1122
|
+
status: 'provisioned' | 'manual_pending' | 'failed' | string;
|
|
1123
|
+
code: string;
|
|
1124
|
+
provisionedAt?: string;
|
|
1125
|
+
checkedAt?: string;
|
|
1126
|
+
resourceType?: string | null;
|
|
1127
|
+
resourceId?: string | null;
|
|
1128
|
+
capability?: string | null;
|
|
1129
|
+
}
|
|
1130
|
+
interface ShadowEntitlement {
|
|
1131
|
+
id: string;
|
|
1132
|
+
userId: string;
|
|
1133
|
+
serverId?: string | null;
|
|
1134
|
+
shopId?: string | null;
|
|
1135
|
+
orderId?: string | null;
|
|
1136
|
+
productId?: string | null;
|
|
1137
|
+
offerId?: string | null;
|
|
1138
|
+
scopeKind?: 'server' | 'user' | string;
|
|
1139
|
+
resourceType: string;
|
|
1140
|
+
resourceId: string;
|
|
1141
|
+
capability: string;
|
|
1142
|
+
status: string;
|
|
1143
|
+
isActive: boolean;
|
|
1144
|
+
startsAt?: string;
|
|
1145
|
+
expiresAt?: string | null;
|
|
1146
|
+
nextRenewalAt?: string | null;
|
|
1147
|
+
cancelledAt?: string | null;
|
|
1148
|
+
revokedAt?: string | null;
|
|
1149
|
+
metadata?: Record<string, unknown> | null;
|
|
1150
|
+
createdAt?: string;
|
|
1151
|
+
updatedAt?: string;
|
|
1152
|
+
shop?: {
|
|
1153
|
+
id: string;
|
|
1154
|
+
scopeKind: 'server' | 'user' | string;
|
|
1155
|
+
serverId?: string | null;
|
|
1156
|
+
ownerUserId?: string | null;
|
|
1157
|
+
name: string;
|
|
1158
|
+
logoUrl?: string | null;
|
|
1159
|
+
} | null;
|
|
1160
|
+
product?: {
|
|
1161
|
+
id: string;
|
|
1162
|
+
shopId: string;
|
|
1163
|
+
name: string;
|
|
1164
|
+
summary?: string | null;
|
|
1165
|
+
type: 'physical' | 'entitlement' | string;
|
|
1166
|
+
basePrice: number;
|
|
1167
|
+
currency: string;
|
|
1168
|
+
billingMode: 'one_time' | 'fixed_duration' | 'subscription' | string;
|
|
1169
|
+
entitlementConfig?: Record<string, unknown> | Record<string, unknown>[] | null;
|
|
1170
|
+
} | null;
|
|
1171
|
+
offer?: {
|
|
1172
|
+
id: string;
|
|
1173
|
+
shopId: string;
|
|
1174
|
+
productId: string;
|
|
1175
|
+
priceOverride?: number | null;
|
|
1176
|
+
currency: string;
|
|
1177
|
+
status: string;
|
|
1178
|
+
} | null;
|
|
1179
|
+
paidFile?: {
|
|
1180
|
+
id: string;
|
|
1181
|
+
name: string;
|
|
1182
|
+
mime?: string | null;
|
|
1183
|
+
sizeBytes?: number | null;
|
|
1184
|
+
previewUrl?: string | null;
|
|
1185
|
+
} | null;
|
|
1186
|
+
buyer?: {
|
|
1187
|
+
id: string;
|
|
1188
|
+
username: string;
|
|
1189
|
+
displayName?: string | null;
|
|
1190
|
+
avatarUrl?: string | null;
|
|
1191
|
+
} | null;
|
|
1192
|
+
order?: (Omit<ShadowOrder, 'items' | 'currency'> & {
|
|
1193
|
+
currency?: string | null;
|
|
1194
|
+
items?: ShadowOrder['items'];
|
|
1195
|
+
}) | null;
|
|
1196
|
+
fulfillmentJobs?: Array<Record<string, unknown>>;
|
|
1197
|
+
}
|
|
1198
|
+
interface ShadowOAuthCommerceEntitlementSummary {
|
|
1199
|
+
id: string;
|
|
1200
|
+
status: string;
|
|
1201
|
+
capability: string;
|
|
1202
|
+
resourceType: string;
|
|
1203
|
+
resourceId: string;
|
|
1204
|
+
productId?: string | null;
|
|
1205
|
+
shopId?: string | null;
|
|
1206
|
+
orderId?: string | null;
|
|
1207
|
+
offerId?: string | null;
|
|
1208
|
+
expiresAt?: string | null;
|
|
1209
|
+
}
|
|
1210
|
+
interface ShadowOAuthCommerceEntitlementAccess {
|
|
1211
|
+
allowed: boolean;
|
|
1212
|
+
status: string;
|
|
1213
|
+
reasonCode?: string | null;
|
|
1214
|
+
resourceType: string;
|
|
1215
|
+
resourceId: string;
|
|
1216
|
+
capability: string;
|
|
1217
|
+
app: {
|
|
1218
|
+
id: string;
|
|
1219
|
+
};
|
|
1220
|
+
entitlement?: ShadowOAuthCommerceEntitlementSummary | null;
|
|
1221
|
+
}
|
|
1222
|
+
interface ShadowOAuthCommerceEntitlementRedeemInput {
|
|
1223
|
+
idempotencyKey: string;
|
|
1224
|
+
resourceType?: string;
|
|
1225
|
+
resourceId?: string;
|
|
1226
|
+
capability?: string;
|
|
1227
|
+
metadata?: Record<string, string | number | boolean | null>;
|
|
1228
|
+
}
|
|
1229
|
+
interface ShadowOAuthCommerceEntitlementRedemption {
|
|
1230
|
+
appId: string;
|
|
1231
|
+
resourceType: string;
|
|
1232
|
+
resourceId: string;
|
|
1233
|
+
capability: string;
|
|
1234
|
+
idempotencyKey: string;
|
|
1235
|
+
redeemedAt: string;
|
|
1236
|
+
metadata?: Record<string, string | number | boolean | null>;
|
|
1237
|
+
}
|
|
1238
|
+
interface ShadowOAuthCommerceEntitlementRedeemResult {
|
|
1239
|
+
redeemed: true;
|
|
1240
|
+
resourceType: string;
|
|
1241
|
+
resourceId: string;
|
|
1242
|
+
capability: string;
|
|
1243
|
+
app: {
|
|
1244
|
+
id: string;
|
|
1245
|
+
};
|
|
1246
|
+
entitlement: ShadowOAuthCommerceEntitlementSummary;
|
|
1247
|
+
redemption: ShadowOAuthCommerceEntitlementRedemption;
|
|
1248
|
+
}
|
|
1249
|
+
interface ShadowEntitlementPurchaseResult {
|
|
1250
|
+
order: {
|
|
1251
|
+
id: string;
|
|
1252
|
+
orderNo: string;
|
|
1253
|
+
status: string;
|
|
1254
|
+
totalAmount: number;
|
|
1255
|
+
};
|
|
1256
|
+
entitlement: Record<string, unknown>;
|
|
1257
|
+
provisioning?: ShadowEntitlementProvisioning;
|
|
1258
|
+
fulfillmentJobs?: Record<string, unknown>[];
|
|
1259
|
+
nextAction?: 'open_paid_file' | 'view_entitlement' | string;
|
|
1260
|
+
}
|
|
1261
|
+
interface ShadowCommerceCheckoutPreview {
|
|
1262
|
+
offer: {
|
|
1263
|
+
id: string;
|
|
1264
|
+
status: string;
|
|
1265
|
+
available: boolean;
|
|
1266
|
+
allowedSurfaces?: string[] | null;
|
|
1267
|
+
};
|
|
1268
|
+
shop: {
|
|
1269
|
+
id: string;
|
|
1270
|
+
name: string;
|
|
1271
|
+
scopeKind: 'server' | 'user' | string;
|
|
1272
|
+
logoUrl?: string | null;
|
|
1273
|
+
};
|
|
1274
|
+
product: {
|
|
1275
|
+
id: string;
|
|
1276
|
+
name: string;
|
|
1277
|
+
summary?: string | null;
|
|
1278
|
+
imageUrl?: string | null;
|
|
1279
|
+
type: 'physical' | 'entitlement' | string;
|
|
1280
|
+
billingMode?: 'one_time' | 'fixed_duration' | 'subscription' | string;
|
|
1281
|
+
price: number;
|
|
1282
|
+
currency: string;
|
|
1283
|
+
durationSeconds?: number | null;
|
|
1284
|
+
};
|
|
1285
|
+
entitlement?: {
|
|
1286
|
+
resourceType: string;
|
|
1287
|
+
resourceId: string;
|
|
1288
|
+
capability: string;
|
|
1289
|
+
access: {
|
|
1290
|
+
allowed: boolean;
|
|
1291
|
+
status: string;
|
|
1292
|
+
reasonCode?: string | null;
|
|
1293
|
+
entitlement?: Record<string, unknown> | null;
|
|
1294
|
+
};
|
|
1295
|
+
} | null;
|
|
1296
|
+
paidFile?: {
|
|
1297
|
+
id: string;
|
|
1298
|
+
name: string;
|
|
1299
|
+
mime?: string | null;
|
|
1300
|
+
sizeBytes?: number | null;
|
|
1301
|
+
previewUrl?: string | null;
|
|
1302
|
+
} | null;
|
|
1303
|
+
deliverables?: Record<string, unknown>[];
|
|
1304
|
+
viewerState: 'not_purchased' | 'active' | 'expired' | 'revoked' | 'cancelled' | 'unavailable';
|
|
1305
|
+
primaryAction?: 'purchase' | 'open_content' | 'renew' | 'view_detail' | 'view_progress' | 'unavailable' | string;
|
|
1306
|
+
displayState?: {
|
|
1307
|
+
viewerState: string;
|
|
1308
|
+
primaryAction: string;
|
|
1309
|
+
price: {
|
|
1310
|
+
amount: number;
|
|
1311
|
+
currency: string;
|
|
1312
|
+
};
|
|
1313
|
+
balance?: {
|
|
1314
|
+
current: number;
|
|
1315
|
+
afterPurchase?: number;
|
|
1316
|
+
shortfall?: number;
|
|
1317
|
+
} | null;
|
|
1318
|
+
seller?: {
|
|
1319
|
+
shopId: string;
|
|
1320
|
+
shopName: string;
|
|
1321
|
+
buddyUserId?: string | null;
|
|
1322
|
+
};
|
|
1323
|
+
entitlement?: Record<string, unknown> | null;
|
|
1324
|
+
delivery?: Record<string, unknown> | null;
|
|
1325
|
+
content?: Record<string, unknown> | null;
|
|
1326
|
+
};
|
|
1327
|
+
nextAction: 'purchase' | 'open_paid_file' | 'view_entitlement' | string;
|
|
1328
|
+
}
|
|
1329
|
+
interface ShadowCommerceProductContext {
|
|
1330
|
+
product: ShadowProduct;
|
|
1331
|
+
shop: ShadowShop & {
|
|
1332
|
+
logoUrl?: string | null;
|
|
1333
|
+
bannerUrl?: string | null;
|
|
1334
|
+
};
|
|
1335
|
+
server: {
|
|
1336
|
+
id: string;
|
|
1337
|
+
name: string;
|
|
1338
|
+
slug?: string | null;
|
|
1339
|
+
description?: string | null;
|
|
1340
|
+
iconUrl?: string | null;
|
|
1341
|
+
bannerUrl?: string | null;
|
|
1342
|
+
ownerId?: string | null;
|
|
1343
|
+
} | null;
|
|
1344
|
+
provider: {
|
|
1345
|
+
id: string;
|
|
1346
|
+
username: string;
|
|
1347
|
+
displayName?: string | null;
|
|
1348
|
+
avatarUrl?: string | null;
|
|
1349
|
+
isBot?: boolean;
|
|
1350
|
+
} | null;
|
|
1351
|
+
buddy: {
|
|
1352
|
+
id: string;
|
|
1353
|
+
userId: string;
|
|
1354
|
+
ownerId: string;
|
|
1355
|
+
status: string;
|
|
1356
|
+
totalOnlineSeconds?: number | null;
|
|
1357
|
+
lastHeartbeat?: string | null;
|
|
1358
|
+
} | null;
|
|
1359
|
+
offer: {
|
|
1360
|
+
id: string;
|
|
1361
|
+
status: string;
|
|
1362
|
+
priceOverride?: number | null;
|
|
1363
|
+
currency: string;
|
|
1364
|
+
allowedSurfaces?: string[] | null;
|
|
1365
|
+
sellerUserId?: string | null;
|
|
1366
|
+
sellerBuddyUserId?: string | null;
|
|
1367
|
+
} | null;
|
|
1368
|
+
fulfillment: {
|
|
1369
|
+
status: string;
|
|
1370
|
+
resourceType?: string | null;
|
|
1371
|
+
resourceId?: string | null;
|
|
1372
|
+
capability?: string | null;
|
|
1373
|
+
deliverables: Array<{
|
|
1374
|
+
id: string;
|
|
1375
|
+
kind: string;
|
|
1376
|
+
resourceType?: string | null;
|
|
1377
|
+
resourceId?: string | null;
|
|
1378
|
+
deliveryTiming?: string | null;
|
|
1379
|
+
status: string;
|
|
1380
|
+
}>;
|
|
1381
|
+
};
|
|
1382
|
+
refund: {
|
|
1383
|
+
policy: string;
|
|
1384
|
+
status: string;
|
|
1385
|
+
supportPath?: string | null;
|
|
1386
|
+
};
|
|
1387
|
+
credit: {
|
|
1388
|
+
salesCount: number;
|
|
1389
|
+
avgRating: number;
|
|
1390
|
+
ratingCount: number;
|
|
1391
|
+
completedOrders: number;
|
|
1392
|
+
};
|
|
1393
|
+
links: {
|
|
1394
|
+
product: string;
|
|
1395
|
+
shop?: string | null;
|
|
1396
|
+
server?: string | null;
|
|
1397
|
+
providerProfile?: string | null;
|
|
1398
|
+
buddyProfile?: string | null;
|
|
1399
|
+
assetHome?: string | null;
|
|
1400
|
+
checkoutPreview?: string | null;
|
|
1401
|
+
};
|
|
1402
|
+
}
|
|
1403
|
+
interface ShadowPaidFileOpenResult {
|
|
1404
|
+
grant: {
|
|
1405
|
+
id: string;
|
|
1406
|
+
fileId: string;
|
|
1407
|
+
status: string;
|
|
1408
|
+
expiresAt: string;
|
|
1409
|
+
};
|
|
1410
|
+
viewerUrl: string;
|
|
1411
|
+
}
|
|
1412
|
+
interface ShadowCategory {
|
|
1413
|
+
id: string;
|
|
1414
|
+
shopId: string;
|
|
1415
|
+
name: string;
|
|
1416
|
+
description?: string | null;
|
|
1417
|
+
position: number;
|
|
1418
|
+
}
|
|
1419
|
+
interface ShadowProductMedia {
|
|
1420
|
+
id?: string;
|
|
1421
|
+
type?: 'image' | 'video' | string;
|
|
1422
|
+
url: string;
|
|
1423
|
+
thumbnailUrl?: string | null;
|
|
1424
|
+
position?: number;
|
|
1425
|
+
}
|
|
1426
|
+
interface ShadowProductSku {
|
|
1427
|
+
id: string;
|
|
1428
|
+
specValues: string[];
|
|
1429
|
+
price: number;
|
|
1430
|
+
stock: number;
|
|
1431
|
+
imageUrl?: string | null;
|
|
1432
|
+
skuCode?: string | null;
|
|
1433
|
+
isActive?: boolean;
|
|
1434
|
+
}
|
|
1435
|
+
interface ShadowProductEntitlementConfig {
|
|
1436
|
+
resourceType?: string;
|
|
1437
|
+
resourceId?: string;
|
|
1438
|
+
capability?: string;
|
|
1439
|
+
durationSeconds?: number | null;
|
|
1440
|
+
renewalPeriodSeconds?: number | null;
|
|
1441
|
+
privilegeDescription?: string;
|
|
1442
|
+
}
|
|
1443
|
+
interface ShadowProduct {
|
|
1444
|
+
id: string;
|
|
1445
|
+
shopId: string;
|
|
1446
|
+
categoryId?: string | null;
|
|
1447
|
+
name: string;
|
|
1448
|
+
slug?: string;
|
|
1449
|
+
type?: 'physical' | 'entitlement' | string;
|
|
1450
|
+
description?: string | null;
|
|
1451
|
+
summary?: string | null;
|
|
1452
|
+
price?: number;
|
|
1453
|
+
basePrice?: number;
|
|
1454
|
+
currency: string;
|
|
1455
|
+
stock?: number;
|
|
1456
|
+
status: string;
|
|
1457
|
+
specNames?: string[];
|
|
1458
|
+
tags?: string[];
|
|
1459
|
+
globalPublic?: boolean;
|
|
1460
|
+
salesCount?: number;
|
|
1461
|
+
avgRating?: number;
|
|
1462
|
+
ratingCount?: number;
|
|
1463
|
+
billingMode?: 'one_time' | 'fixed_duration' | 'subscription';
|
|
1464
|
+
entitlementConfig?: ShadowProductEntitlementConfig | ShadowProductEntitlementConfig[] | null;
|
|
1465
|
+
media?: ShadowProductMedia[];
|
|
1466
|
+
skus?: ShadowProductSku[];
|
|
1467
|
+
images?: string[];
|
|
1468
|
+
createdAt: string;
|
|
1469
|
+
}
|
|
1470
|
+
interface ShadowMarketplaceProduct extends ShadowProduct {
|
|
1471
|
+
price: number;
|
|
1472
|
+
imageUrl?: string | null;
|
|
1473
|
+
shop: {
|
|
1474
|
+
id: string;
|
|
1475
|
+
name: string;
|
|
1476
|
+
scopeKind: 'server' | 'user' | string;
|
|
1477
|
+
logoUrl?: string | null;
|
|
1478
|
+
bannerUrl?: string | null;
|
|
1479
|
+
server?: {
|
|
1480
|
+
id: string;
|
|
1481
|
+
name: string;
|
|
1482
|
+
slug?: string | null;
|
|
1483
|
+
iconUrl?: string | null;
|
|
1484
|
+
} | null;
|
|
1485
|
+
owner?: {
|
|
1486
|
+
id: string;
|
|
1487
|
+
username: string;
|
|
1488
|
+
displayName?: string | null;
|
|
1489
|
+
avatarUrl?: string | null;
|
|
1490
|
+
} | null;
|
|
1491
|
+
};
|
|
1492
|
+
links?: {
|
|
1493
|
+
product?: string | null;
|
|
1494
|
+
shop?: string | null;
|
|
1495
|
+
server?: string | null;
|
|
1496
|
+
providerProfile?: string | null;
|
|
1497
|
+
};
|
|
1498
|
+
}
|
|
1499
|
+
interface ShadowMarketplaceProductsResponse {
|
|
1500
|
+
products: ShadowMarketplaceProduct[];
|
|
1501
|
+
total: number;
|
|
1502
|
+
hasMore: boolean;
|
|
1503
|
+
filters?: {
|
|
1504
|
+
q?: string | null;
|
|
1505
|
+
tags?: string[];
|
|
1506
|
+
scope?: string | null;
|
|
1507
|
+
};
|
|
1508
|
+
}
|
|
1509
|
+
interface ShadowMarketplaceCategory {
|
|
1510
|
+
tag: string;
|
|
1511
|
+
title: string;
|
|
1512
|
+
productCount: number;
|
|
1513
|
+
salesCount: number;
|
|
1514
|
+
ratingCount: number;
|
|
1515
|
+
avgRating: number;
|
|
1516
|
+
score: number;
|
|
1517
|
+
href: string;
|
|
1518
|
+
}
|
|
1519
|
+
interface ShadowMarketplaceCategoriesResponse {
|
|
1520
|
+
categories: ShadowMarketplaceCategory[];
|
|
1521
|
+
total: number;
|
|
1522
|
+
filters?: {
|
|
1523
|
+
q?: string | null;
|
|
1524
|
+
};
|
|
1525
|
+
}
|
|
1526
|
+
interface ShadowCartItem {
|
|
1527
|
+
id: string;
|
|
1528
|
+
productId: string;
|
|
1529
|
+
quantity: number;
|
|
1530
|
+
product?: ShadowProduct;
|
|
1531
|
+
}
|
|
1532
|
+
interface ShadowOrder {
|
|
1533
|
+
id: string;
|
|
1534
|
+
orderNo?: string;
|
|
1535
|
+
shopId: string;
|
|
1536
|
+
buyerId: string;
|
|
1537
|
+
status: 'pending' | 'paid' | 'processing' | 'shipped' | 'delivered' | 'completed' | 'cancelled' | 'refunded' | string;
|
|
1538
|
+
totalAmount: number;
|
|
1539
|
+
currency: string;
|
|
1540
|
+
trackingNo?: string | null;
|
|
1541
|
+
buyerNote?: string | null;
|
|
1542
|
+
sellerNote?: string | null;
|
|
1543
|
+
paidAt?: string | null;
|
|
1544
|
+
shippedAt?: string | null;
|
|
1545
|
+
completedAt?: string | null;
|
|
1546
|
+
cancelledAt?: string | null;
|
|
1547
|
+
items: Array<{
|
|
1548
|
+
id?: string;
|
|
1549
|
+
productId: string;
|
|
1550
|
+
skuId?: string | null;
|
|
1551
|
+
productName?: string;
|
|
1552
|
+
specValues?: string[];
|
|
1553
|
+
quantity: number;
|
|
1554
|
+
price: number;
|
|
1555
|
+
imageUrl?: string | null;
|
|
1556
|
+
}>;
|
|
1557
|
+
createdAt: string;
|
|
1558
|
+
}
|
|
1559
|
+
interface ShadowReview {
|
|
1560
|
+
id: string;
|
|
1561
|
+
orderId: string;
|
|
1562
|
+
productId: string;
|
|
1563
|
+
userId: string;
|
|
1564
|
+
rating: number;
|
|
1565
|
+
content: string;
|
|
1566
|
+
reply?: string | null;
|
|
1567
|
+
createdAt: string;
|
|
1568
|
+
}
|
|
1569
|
+
interface ShadowWallet {
|
|
1570
|
+
id: string;
|
|
1571
|
+
userId: string;
|
|
1572
|
+
balance: number;
|
|
1573
|
+
currency: string;
|
|
1574
|
+
}
|
|
1575
|
+
interface ShadowTransaction {
|
|
1576
|
+
id: string;
|
|
1577
|
+
walletId: string;
|
|
1578
|
+
type: string;
|
|
1579
|
+
amount: number;
|
|
1580
|
+
balanceAfter?: number;
|
|
1581
|
+
currency?: string;
|
|
1582
|
+
referenceId?: string | null;
|
|
1583
|
+
referenceType?: string | null;
|
|
1584
|
+
note?: string | null;
|
|
1585
|
+
description?: string | null;
|
|
1586
|
+
display?: {
|
|
1587
|
+
title?: string | null;
|
|
1588
|
+
subtitle?: string | null;
|
|
1589
|
+
} | null;
|
|
1590
|
+
order?: Record<string, unknown> | null;
|
|
1591
|
+
counterparty?: Record<string, unknown> | null;
|
|
1592
|
+
createdAt: string;
|
|
1593
|
+
}
|
|
1594
|
+
type ShadowDiyCloudStepId = 'think' | 'search' | 'generate' | 'validate' | 'review';
|
|
1595
|
+
interface ShadowDiyCloudGenerateInput {
|
|
1596
|
+
prompt: string;
|
|
1597
|
+
feedback?: string;
|
|
1598
|
+
previousConfig?: Record<string, unknown>;
|
|
1599
|
+
locale?: string;
|
|
1600
|
+
timezone?: string;
|
|
1601
|
+
}
|
|
1602
|
+
interface ShadowDiyCloudAgentStepOutput {
|
|
1603
|
+
type: 'agent_step_output';
|
|
1604
|
+
schemaVersion: 1;
|
|
1605
|
+
step: ShadowDiyCloudStepId;
|
|
1606
|
+
status: ShadowDiyCloudProgressStatus;
|
|
1607
|
+
title: string;
|
|
1608
|
+
locale: string;
|
|
1609
|
+
timezone: string;
|
|
1610
|
+
generatedAt: string;
|
|
1611
|
+
result: Record<string, unknown>;
|
|
1612
|
+
reasons: string[];
|
|
1613
|
+
confidence?: number;
|
|
1614
|
+
}
|
|
1615
|
+
interface ShadowDiyCloudDraft {
|
|
1616
|
+
slug: string;
|
|
1617
|
+
title: string;
|
|
1618
|
+
description: string;
|
|
1619
|
+
score: number;
|
|
1620
|
+
steps: Array<{
|
|
1621
|
+
id: ShadowDiyCloudStepId;
|
|
1622
|
+
title: string;
|
|
1623
|
+
detail: string;
|
|
1624
|
+
}>;
|
|
1625
|
+
matchedPlugins: Array<{
|
|
1626
|
+
id: string;
|
|
1627
|
+
name: string;
|
|
1628
|
+
description: string;
|
|
1629
|
+
reason: string;
|
|
1630
|
+
capabilities: string[];
|
|
1631
|
+
requiredKeys: string[];
|
|
1632
|
+
matchedTerms: string[];
|
|
1633
|
+
}>;
|
|
1634
|
+
referenceTemplates: Array<{
|
|
1635
|
+
slug: string;
|
|
1636
|
+
title: string;
|
|
1637
|
+
description: string;
|
|
1638
|
+
category: string;
|
|
1639
|
+
plugins: string[];
|
|
1640
|
+
channels: string[];
|
|
1641
|
+
buddyNames: string[];
|
|
1642
|
+
reason: string;
|
|
1643
|
+
}>;
|
|
1644
|
+
suggestedSkills: string[];
|
|
1645
|
+
requiredKeys: Array<{
|
|
1646
|
+
key: string;
|
|
1647
|
+
label: string;
|
|
1648
|
+
description: string;
|
|
1649
|
+
source: string;
|
|
1650
|
+
sourcePluginId: string;
|
|
1651
|
+
sensitive: boolean;
|
|
1652
|
+
setupSteps: string[];
|
|
1653
|
+
skipImpact: string;
|
|
1654
|
+
}>;
|
|
1655
|
+
toolTrace: Array<{
|
|
1656
|
+
tool: 'search_plugins' | 'inspect_plugin' | 'search_templates' | 'inspect_template' | 'compile_template_dsl' | 'validate_template_dsl' | 'collect_required_keys';
|
|
1657
|
+
query?: string;
|
|
1658
|
+
resultIds: string[];
|
|
1659
|
+
}>;
|
|
1660
|
+
agentOutputs: ShadowDiyCloudAgentStepOutput[];
|
|
1661
|
+
agentReport: {
|
|
1662
|
+
objective: string;
|
|
1663
|
+
assumptions: string[];
|
|
1664
|
+
reasoning: Array<{
|
|
1665
|
+
step: ShadowDiyCloudStepId;
|
|
1666
|
+
title: string;
|
|
1667
|
+
detail: string;
|
|
1668
|
+
evidence: string[];
|
|
1669
|
+
}>;
|
|
1670
|
+
pluginDecisions: Array<{
|
|
1671
|
+
id: string;
|
|
1672
|
+
name: string;
|
|
1673
|
+
reason: string;
|
|
1674
|
+
capabilities: string[];
|
|
1675
|
+
matchedTerms: string[];
|
|
1676
|
+
requiredKeys: string[];
|
|
1677
|
+
}>;
|
|
1678
|
+
templateDecisions: Array<{
|
|
1679
|
+
slug: string;
|
|
1680
|
+
title: string;
|
|
1681
|
+
reason: string;
|
|
1682
|
+
plugins: string[];
|
|
1683
|
+
channels: string[];
|
|
1684
|
+
}>;
|
|
1685
|
+
validationChecks: Array<{
|
|
1686
|
+
name: string;
|
|
1687
|
+
status: 'passed' | 'warning' | 'failed';
|
|
1688
|
+
detail: string;
|
|
1689
|
+
}>;
|
|
1690
|
+
repairNotes: string[];
|
|
1691
|
+
};
|
|
1692
|
+
guidebook: {
|
|
1693
|
+
summary: string;
|
|
1694
|
+
beforeDeploy: string[];
|
|
1695
|
+
howToUse: string[];
|
|
1696
|
+
reviewNotes: string[];
|
|
1697
|
+
};
|
|
1698
|
+
template: Record<string, unknown>;
|
|
1699
|
+
validation: {
|
|
1700
|
+
valid: boolean;
|
|
1701
|
+
agents: number;
|
|
1702
|
+
configurations: number;
|
|
1703
|
+
violations: Array<{
|
|
1704
|
+
path: string;
|
|
1705
|
+
prefix: string;
|
|
1706
|
+
}>;
|
|
1707
|
+
extendsErrors: string[];
|
|
1708
|
+
templateRefs: {
|
|
1709
|
+
env: number;
|
|
1710
|
+
secret: number;
|
|
1711
|
+
file: number;
|
|
1712
|
+
};
|
|
1713
|
+
};
|
|
1714
|
+
}
|
|
1715
|
+
type ShadowDiyCloudProgressStatus = 'running' | 'completed' | 'warning' | 'error';
|
|
1716
|
+
type ShadowDiyCloudRunStatus = 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
1717
|
+
interface ShadowDiyCloudRun {
|
|
1718
|
+
runId: string;
|
|
1719
|
+
input: ShadowDiyCloudGenerateInput;
|
|
1720
|
+
status: ShadowDiyCloudRunStatus;
|
|
1721
|
+
createdAt: string;
|
|
1722
|
+
updatedAt: string;
|
|
1723
|
+
expiresAt: string;
|
|
1724
|
+
draft?: ShadowDiyCloudDraft;
|
|
1725
|
+
error?: string;
|
|
1726
|
+
}
|
|
1727
|
+
type ShadowDiyCloudRunEvent = {
|
|
1728
|
+
schemaVersion: 2;
|
|
1729
|
+
seq: number;
|
|
1730
|
+
runId: string;
|
|
1731
|
+
eventId: string;
|
|
1732
|
+
timestamp: string;
|
|
1733
|
+
type: 'run.created' | 'run.started' | 'run.cancelled';
|
|
1734
|
+
status?: ShadowDiyCloudRunStatus;
|
|
1735
|
+
input?: ShadowDiyCloudGenerateInput;
|
|
1736
|
+
expiresAt?: string;
|
|
1737
|
+
} | {
|
|
1738
|
+
schemaVersion: 2;
|
|
1739
|
+
seq: number;
|
|
1740
|
+
runId: string;
|
|
1741
|
+
eventId: string;
|
|
1742
|
+
timestamp: string;
|
|
1743
|
+
type: 'step.created';
|
|
1744
|
+
stepId: ShadowDiyCloudStepId;
|
|
1745
|
+
title: string;
|
|
1746
|
+
intent: string;
|
|
1747
|
+
order: number;
|
|
1748
|
+
iconHint?: string;
|
|
1749
|
+
} | {
|
|
1750
|
+
schemaVersion: 2;
|
|
1751
|
+
seq: number;
|
|
1752
|
+
runId: string;
|
|
1753
|
+
eventId: string;
|
|
1754
|
+
timestamp: string;
|
|
1755
|
+
type: 'step.delta';
|
|
1756
|
+
stepId: ShadowDiyCloudStepId;
|
|
1757
|
+
channel: 'summary' | 'rationale' | 'status';
|
|
1758
|
+
delta: string;
|
|
1759
|
+
status?: ShadowDiyCloudProgressStatus;
|
|
1760
|
+
title?: string;
|
|
1761
|
+
meta?: Record<string, unknown>;
|
|
1762
|
+
} | {
|
|
1763
|
+
schemaVersion: 2;
|
|
1764
|
+
seq: number;
|
|
1765
|
+
runId: string;
|
|
1766
|
+
eventId: string;
|
|
1767
|
+
timestamp: string;
|
|
1768
|
+
type: 'decision';
|
|
1769
|
+
stepId: ShadowDiyCloudStepId;
|
|
1770
|
+
decisionId: string;
|
|
1771
|
+
title: string;
|
|
1772
|
+
selected: string;
|
|
1773
|
+
basis: {
|
|
1774
|
+
observations: string[];
|
|
1775
|
+
constraints: string[];
|
|
1776
|
+
evidence: Array<{
|
|
1777
|
+
source: string;
|
|
1778
|
+
ref: string;
|
|
1779
|
+
summary: string;
|
|
1780
|
+
}>;
|
|
1781
|
+
rejectedOptions: Array<{
|
|
1782
|
+
option: string;
|
|
1783
|
+
reason: string;
|
|
1784
|
+
}>;
|
|
1785
|
+
confidence?: number | null;
|
|
1786
|
+
needsUserReview: boolean;
|
|
1787
|
+
};
|
|
1788
|
+
output?: ShadowDiyCloudAgentStepOutput;
|
|
1789
|
+
} | {
|
|
1790
|
+
schemaVersion: 2;
|
|
1791
|
+
seq: number;
|
|
1792
|
+
runId: string;
|
|
1793
|
+
eventId: string;
|
|
1794
|
+
timestamp: string;
|
|
1795
|
+
type: 'artifact.patch';
|
|
1796
|
+
stepId: ShadowDiyCloudStepId;
|
|
1797
|
+
artifact: 'templateDsl' | 'cloudConfig' | 'guidebook' | 'requiredKeys';
|
|
1798
|
+
patch: unknown;
|
|
1799
|
+
} | {
|
|
1800
|
+
schemaVersion: 2;
|
|
1801
|
+
seq: number;
|
|
1802
|
+
runId: string;
|
|
1803
|
+
eventId: string;
|
|
1804
|
+
timestamp: string;
|
|
1805
|
+
type: 'guardrail.result';
|
|
1806
|
+
stepId: ShadowDiyCloudStepId;
|
|
1807
|
+
name: string;
|
|
1808
|
+
status: 'passed' | 'warning' | 'failed' | 'error';
|
|
1809
|
+
detail: string;
|
|
1810
|
+
blocksRun: boolean;
|
|
1811
|
+
} | {
|
|
1812
|
+
schemaVersion: 2;
|
|
1813
|
+
seq: number;
|
|
1814
|
+
runId: string;
|
|
1815
|
+
eventId: string;
|
|
1816
|
+
timestamp: string;
|
|
1817
|
+
type: 'draft.completed';
|
|
1818
|
+
draft: ShadowDiyCloudDraft;
|
|
1819
|
+
} | {
|
|
1820
|
+
schemaVersion: 2;
|
|
1821
|
+
seq: number;
|
|
1822
|
+
runId: string;
|
|
1823
|
+
eventId: string;
|
|
1824
|
+
timestamp: string;
|
|
1825
|
+
type: 'run.failed';
|
|
1826
|
+
error: string;
|
|
1827
|
+
code?: string;
|
|
1828
|
+
retryable: boolean;
|
|
1829
|
+
};
|
|
1830
|
+
type ShadowCloudDeploymentStatus = 'pending' | 'deploying' | 'cancelling' | 'deployed' | 'paused' | 'resuming' | 'failed' | 'destroying' | 'destroyed';
|
|
1831
|
+
interface ShadowCloudDeploymentRuntimeResponse {
|
|
1832
|
+
ok: boolean;
|
|
1833
|
+
status: ShadowCloudDeploymentStatus;
|
|
1834
|
+
deployment?: Record<string, unknown>;
|
|
1835
|
+
}
|
|
1836
|
+
interface ShadowCloudDeploymentManifest {
|
|
1837
|
+
deploymentId: string;
|
|
1838
|
+
namespace: string;
|
|
1839
|
+
name: string;
|
|
1840
|
+
templateSlug: string | null;
|
|
1841
|
+
template: Record<string, unknown> | null;
|
|
1842
|
+
manifest: Record<string, unknown> | null;
|
|
1843
|
+
drift: {
|
|
1844
|
+
status: 'up-to-date' | 'template-updated' | 'missing-template' | 'unlinked' | 'unknown';
|
|
1845
|
+
templateAvailable: boolean;
|
|
1846
|
+
templateChanged: boolean;
|
|
1847
|
+
deployedTemplateHash: string | null;
|
|
1848
|
+
currentTemplateHash: string | null;
|
|
1849
|
+
configHash: string | null;
|
|
1850
|
+
};
|
|
1851
|
+
configSnapshot: Record<string, unknown> | null;
|
|
1852
|
+
}
|
|
1853
|
+
interface ShadowCloudDeploymentTemplateSyncResult {
|
|
1854
|
+
ok: boolean;
|
|
1855
|
+
action: 'updated' | 'forked';
|
|
1856
|
+
template: Record<string, unknown>;
|
|
1857
|
+
manifest: ShadowCloudDeploymentManifest;
|
|
1858
|
+
}
|
|
1859
|
+
interface ShadowCloudDeploymentBackup {
|
|
1860
|
+
id: string;
|
|
1861
|
+
deploymentId: string;
|
|
1862
|
+
namespace: string;
|
|
1863
|
+
agentId: string;
|
|
1864
|
+
sandboxName: string | null;
|
|
1865
|
+
pvcName: string;
|
|
1866
|
+
driver: 'volumeSnapshot' | 'restic' | string;
|
|
1867
|
+
snapshotName: string | null;
|
|
1868
|
+
objectKey: string | null;
|
|
1869
|
+
status: 'pending' | 'running' | 'succeeded' | 'failed' | 'expired' | string;
|
|
1870
|
+
phase: string;
|
|
1871
|
+
error: string | null;
|
|
1872
|
+
expiresAt: string | null;
|
|
1873
|
+
createdAt: string;
|
|
1874
|
+
updatedAt: string;
|
|
1875
|
+
}
|
|
1876
|
+
interface ShadowCloudProviderCatalog {
|
|
1877
|
+
pluginId: string;
|
|
1878
|
+
pluginName: string;
|
|
1879
|
+
provider: Record<string, unknown>;
|
|
1880
|
+
secretFields?: Record<string, unknown>[];
|
|
1881
|
+
}
|
|
1882
|
+
interface ShadowCloudProviderEnvVar {
|
|
1883
|
+
key: string;
|
|
1884
|
+
maskedValue: string;
|
|
1885
|
+
isSecret: boolean;
|
|
1886
|
+
}
|
|
1887
|
+
interface ShadowCloudProviderModel {
|
|
1888
|
+
id: string;
|
|
1889
|
+
name?: string;
|
|
1890
|
+
tags?: string[];
|
|
1891
|
+
contextWindow?: number;
|
|
1892
|
+
maxTokens?: number;
|
|
1893
|
+
cost?: {
|
|
1894
|
+
input?: number;
|
|
1895
|
+
output?: number;
|
|
1896
|
+
};
|
|
1897
|
+
capabilities?: {
|
|
1898
|
+
vision?: boolean;
|
|
1899
|
+
tools?: boolean;
|
|
1900
|
+
reasoning?: boolean;
|
|
1901
|
+
};
|
|
1902
|
+
}
|
|
1903
|
+
interface ShadowCloudProviderProfile {
|
|
1904
|
+
id: string;
|
|
1905
|
+
providerId: string;
|
|
1906
|
+
name: string;
|
|
1907
|
+
scope: string;
|
|
1908
|
+
enabled: boolean;
|
|
1909
|
+
config: {
|
|
1910
|
+
baseUrl?: string;
|
|
1911
|
+
apiFormat?: 'openai' | 'anthropic' | 'gemini';
|
|
1912
|
+
authType?: 'api_key';
|
|
1913
|
+
discoveredAt?: string;
|
|
1914
|
+
models?: ShadowCloudProviderModel[];
|
|
1915
|
+
[key: string]: unknown;
|
|
1916
|
+
};
|
|
1917
|
+
envVars: ShadowCloudProviderEnvVar[];
|
|
1918
|
+
updatedAt?: string;
|
|
1919
|
+
}
|
|
1920
|
+
interface ShadowTask {
|
|
1921
|
+
key: string;
|
|
1922
|
+
title: string;
|
|
1923
|
+
description: string;
|
|
1924
|
+
reward: number;
|
|
1925
|
+
status: string;
|
|
1926
|
+
claimedAt?: string | null;
|
|
1927
|
+
}
|
|
1928
|
+
interface ShadowRechargeTier {
|
|
1929
|
+
key: string;
|
|
1930
|
+
shrimpCoins: number;
|
|
1931
|
+
usdCents: number;
|
|
1932
|
+
label: string;
|
|
1933
|
+
}
|
|
1934
|
+
interface ShadowRechargeConfig {
|
|
1935
|
+
tiers: ShadowRechargeTier[];
|
|
1936
|
+
customAmountMin: number;
|
|
1937
|
+
customAmountMax: number;
|
|
1938
|
+
exchangeRate: number;
|
|
1939
|
+
stripePublishableKey: string;
|
|
1940
|
+
}
|
|
1941
|
+
interface ShadowRechargeIntent {
|
|
1942
|
+
clientSecret: string;
|
|
1943
|
+
paymentIntentId: string;
|
|
1944
|
+
orderNo: string;
|
|
1945
|
+
amount: {
|
|
1946
|
+
shrimpCoins: number;
|
|
1947
|
+
usdCents: number;
|
|
1948
|
+
};
|
|
1949
|
+
}
|
|
1950
|
+
interface ShadowPaymentOrder {
|
|
1951
|
+
id: string;
|
|
1952
|
+
orderNo: string;
|
|
1953
|
+
shrimpCoinAmount: number;
|
|
1954
|
+
usdAmount: number;
|
|
1955
|
+
status: string;
|
|
1956
|
+
localCurrencyAmount?: number | null;
|
|
1957
|
+
localCurrency?: string | null;
|
|
1958
|
+
createdAt: string;
|
|
1959
|
+
paidAt?: string | null;
|
|
1960
|
+
}
|
|
1961
|
+
interface ShadowRechargeHistory {
|
|
1962
|
+
items: ShadowPaymentOrder[];
|
|
1963
|
+
total: number;
|
|
1964
|
+
limit: number;
|
|
1965
|
+
offset: number;
|
|
1966
|
+
}
|
|
1967
|
+
interface ShadowNotificationPreferences {
|
|
1968
|
+
strategy: 'all' | 'mention_only' | 'none';
|
|
1969
|
+
mutedServerIds: string[];
|
|
1970
|
+
mutedChannelIds: string[];
|
|
1971
|
+
}
|
|
1972
|
+
/** Events the server pushes to the client */
|
|
1973
|
+
interface ServerEventMap {
|
|
1974
|
+
'message:new': (message: ShadowMessage) => void;
|
|
1975
|
+
'message:updated': (message: ShadowMessage) => void;
|
|
1976
|
+
'message:deleted': (payload: MessageDeletedPayload) => void;
|
|
1977
|
+
'message:typing': (payload: TypingPayload) => void;
|
|
1978
|
+
'member:typing': (payload: TypingPayload) => void;
|
|
1979
|
+
'member:join': (payload: MemberJoinPayload) => void;
|
|
1980
|
+
'member:joined': (payload: MemberJoinPayload & {
|
|
1981
|
+
isBot?: boolean;
|
|
1982
|
+
}) => void;
|
|
1983
|
+
'member:leave': (payload: MemberLeavePayload) => void;
|
|
1984
|
+
'member:left': (payload: MemberLeavePayload) => void;
|
|
1985
|
+
'presence:change': (payload: PresenceChangePayload) => void;
|
|
1986
|
+
'presence:activity': (payload: PresenceActivityPayload) => void;
|
|
1987
|
+
'reaction:add': (payload: ReactionPayload) => void;
|
|
1988
|
+
'reaction:remove': (payload: ReactionPayload) => void;
|
|
1989
|
+
'notification:new': (notification: ShadowNotification) => void;
|
|
1990
|
+
'channel:created': (payload: ChannelCreatedPayload) => void;
|
|
1991
|
+
'channel:member-added': (payload: ChannelMemberAddedPayload) => void;
|
|
1992
|
+
'channel:member-removed': (payload: ChannelMemberRemovedPayload) => void;
|
|
1993
|
+
'channel:slash-commands-updated': (payload: SlashCommandsUpdatedPayload) => void;
|
|
1994
|
+
'voice:state': (payload: ShadowVoiceState) => void;
|
|
1995
|
+
'voice:participant-joined': (payload: VoiceParticipantPayload) => void;
|
|
1996
|
+
'voice:participant-left': (payload: VoiceParticipantPayload) => void;
|
|
1997
|
+
'voice:participant-updated': (payload: VoiceParticipantPayload) => void;
|
|
1998
|
+
'voice:policy-updated': (payload: VoicePolicyUpdatedPayload) => void;
|
|
1999
|
+
'server:joined': (payload: ServerJoinedPayload) => void;
|
|
2000
|
+
'agent:policy-changed': (payload: PolicyChangedPayload) => void;
|
|
2001
|
+
error: (payload: {
|
|
2002
|
+
message: string;
|
|
2003
|
+
}) => void;
|
|
2004
|
+
}
|
|
2005
|
+
/** Events the client sends to the server */
|
|
2006
|
+
interface ClientEventMap {
|
|
2007
|
+
'channel:join': (data: {
|
|
2008
|
+
channelId: string;
|
|
2009
|
+
}, ack?: (res: {
|
|
2010
|
+
ok: boolean;
|
|
2011
|
+
}) => void) => void;
|
|
2012
|
+
'channel:leave': (data: {
|
|
2013
|
+
channelId: string;
|
|
2014
|
+
}) => void;
|
|
2015
|
+
'voice:join': (data: {
|
|
2016
|
+
channelId: string;
|
|
2017
|
+
clientId?: string;
|
|
2018
|
+
muted?: boolean;
|
|
2019
|
+
deafened?: boolean;
|
|
2020
|
+
}, ack?: (res: {
|
|
2021
|
+
ok: boolean;
|
|
2022
|
+
data?: ShadowVoiceJoinResult;
|
|
2023
|
+
error?: string;
|
|
2024
|
+
code?: string;
|
|
2025
|
+
}) => void) => void;
|
|
2026
|
+
'voice:leave': (data: {
|
|
2027
|
+
channelId: string;
|
|
2028
|
+
clientId?: string | null;
|
|
2029
|
+
}, ack?: (res: {
|
|
2030
|
+
ok: boolean;
|
|
2031
|
+
data?: ShadowVoiceLeaveResult;
|
|
2032
|
+
error?: string;
|
|
2033
|
+
code?: string;
|
|
2034
|
+
}) => void) => void;
|
|
2035
|
+
'voice:state:update': (data: {
|
|
2036
|
+
channelId: string;
|
|
2037
|
+
clientId?: string | null;
|
|
2038
|
+
muted?: boolean;
|
|
2039
|
+
deafened?: boolean;
|
|
2040
|
+
speaking?: boolean;
|
|
2041
|
+
screenSharing?: boolean;
|
|
2042
|
+
}, ack?: (res: {
|
|
2043
|
+
ok: boolean;
|
|
2044
|
+
data?: unknown;
|
|
2045
|
+
error?: string;
|
|
2046
|
+
code?: string;
|
|
2047
|
+
}) => void) => void;
|
|
2048
|
+
'voice:token:renew': (data: {
|
|
2049
|
+
channelId: string;
|
|
2050
|
+
clientId?: string | null;
|
|
2051
|
+
}, ack?: (res: {
|
|
2052
|
+
ok: boolean;
|
|
2053
|
+
data?: ShadowVoiceRenewResult;
|
|
2054
|
+
error?: string;
|
|
2055
|
+
code?: string;
|
|
2056
|
+
}) => void) => void;
|
|
2057
|
+
'voice:heartbeat': (data: {
|
|
2058
|
+
channelId: string;
|
|
2059
|
+
clientId?: string | null;
|
|
2060
|
+
}) => void;
|
|
2061
|
+
'message:send': (data: {
|
|
2062
|
+
channelId: string;
|
|
2063
|
+
content: string;
|
|
2064
|
+
threadId?: string;
|
|
2065
|
+
replyToId?: string;
|
|
2066
|
+
mentions?: ShadowMessageMention[];
|
|
2067
|
+
metadata?: Record<string, unknown>;
|
|
2068
|
+
}) => void;
|
|
2069
|
+
'message:typing': (data: {
|
|
2070
|
+
channelId: string;
|
|
2071
|
+
typing?: boolean;
|
|
2072
|
+
}) => void;
|
|
2073
|
+
'presence:update': (data: {
|
|
2074
|
+
status: 'online' | 'idle' | 'dnd' | 'offline';
|
|
2075
|
+
}) => void;
|
|
2076
|
+
'presence:activity': (data: {
|
|
2077
|
+
channelId: string;
|
|
2078
|
+
activity: string | null;
|
|
2079
|
+
}) => void;
|
|
2080
|
+
}
|
|
2081
|
+
|
|
2082
|
+
type ShadowServerAppFetch = typeof fetch;
|
|
2083
|
+
interface ShadowServerAppCommandContext {
|
|
2084
|
+
protocol: 'shadow.app/1';
|
|
2085
|
+
serverId: string;
|
|
2086
|
+
serverAppId: string;
|
|
2087
|
+
appKey: string;
|
|
2088
|
+
command: string;
|
|
2089
|
+
actor: {
|
|
2090
|
+
kind: string;
|
|
2091
|
+
userId: string | null;
|
|
2092
|
+
buddyAgentId?: string | null;
|
|
2093
|
+
ownerId?: string | null;
|
|
2094
|
+
profile?: ShadowServerAppActorProfile | null;
|
|
2095
|
+
};
|
|
2096
|
+
channelId?: string | null;
|
|
2097
|
+
task?: {
|
|
2098
|
+
messageId: string;
|
|
2099
|
+
cardId: string;
|
|
2100
|
+
claimId?: string | null;
|
|
2101
|
+
channelId?: string | null;
|
|
2102
|
+
workspaceId?: string | null;
|
|
2103
|
+
scopes?: string[];
|
|
2104
|
+
};
|
|
2105
|
+
permission: string;
|
|
2106
|
+
action: string;
|
|
2107
|
+
dataClass: string;
|
|
2108
|
+
}
|
|
2109
|
+
interface ShadowServerAppCommandEnvelope<T = unknown> {
|
|
2110
|
+
input: T;
|
|
2111
|
+
context: ShadowServerAppCommandContext;
|
|
2112
|
+
}
|
|
2113
|
+
declare const SHADOW_SERVER_APP_PROTOCOL: "shadow.app/1";
|
|
2114
|
+
declare const SHADOW_SERVER_APP_COMMAND_COMPLETED_EVENT: "server_app.command.completed";
|
|
2115
|
+
declare const SHADOW_SERVER_APP_COMMAND_FAILED_EVENT: "server_app.command.failed";
|
|
2116
|
+
declare const SHADOW_SERVER_APP_COMMAND_EVENTS: readonly ["server_app.command.completed", "server_app.command.failed"];
|
|
2117
|
+
type ShadowServerAppCommandEventType = (typeof SHADOW_SERVER_APP_COMMAND_EVENTS)[number];
|
|
2118
|
+
type ShadowServerAppInboxTaskPriority = 'low' | 'normal' | 'high' | 'urgent';
|
|
2119
|
+
interface ShadowServerAppInboxTaskResource {
|
|
2120
|
+
kind: string;
|
|
2121
|
+
id: string;
|
|
2122
|
+
label?: string;
|
|
2123
|
+
url?: string;
|
|
2124
|
+
[key: string]: unknown;
|
|
2125
|
+
}
|
|
2126
|
+
interface ShadowServerAppInboxTaskOutbox {
|
|
2127
|
+
title: string;
|
|
2128
|
+
body?: string;
|
|
2129
|
+
priority?: ShadowServerAppInboxTaskPriority;
|
|
2130
|
+
agentId?: string;
|
|
2131
|
+
agentUserId?: string;
|
|
2132
|
+
assigneeLabel?: string;
|
|
2133
|
+
idempotencyKey?: string;
|
|
2134
|
+
resource?: ShadowServerAppInboxTaskResource;
|
|
2135
|
+
data?: Record<string, unknown>;
|
|
2136
|
+
required?: boolean;
|
|
2137
|
+
}
|
|
2138
|
+
interface ShadowServerAppInboxDelivery {
|
|
2139
|
+
agentId?: string;
|
|
2140
|
+
agentUserId?: string;
|
|
2141
|
+
channelId?: string;
|
|
2142
|
+
messageId?: string;
|
|
2143
|
+
cardId?: string | null;
|
|
2144
|
+
taskId?: string | null;
|
|
2145
|
+
pendingId?: string | null;
|
|
2146
|
+
idempotencyKey?: string;
|
|
2147
|
+
error?: string;
|
|
2148
|
+
}
|
|
2149
|
+
interface ShadowServerAppInboxDeliveryError {
|
|
2150
|
+
agentId?: string;
|
|
2151
|
+
agentUserId?: string;
|
|
2152
|
+
assigneeLabel?: string;
|
|
2153
|
+
title?: string;
|
|
2154
|
+
error: string;
|
|
2155
|
+
}
|
|
2156
|
+
interface ShadowServerAppChannelMessageOutbox {
|
|
2157
|
+
content: string;
|
|
2158
|
+
channelId?: string;
|
|
2159
|
+
channelName?: string;
|
|
2160
|
+
metadata?: Record<string, unknown>;
|
|
2161
|
+
idempotencyKey?: string;
|
|
2162
|
+
}
|
|
2163
|
+
interface ShadowServerAppChannelMessageDelivery {
|
|
2164
|
+
channelId: string;
|
|
2165
|
+
messageId: string;
|
|
2166
|
+
idempotencyKey?: string;
|
|
2167
|
+
}
|
|
2168
|
+
interface ShadowServerAppChannelMessageDeliveryError {
|
|
2169
|
+
channelId?: string;
|
|
2170
|
+
channelName?: string;
|
|
2171
|
+
idempotencyKey?: string;
|
|
2172
|
+
error: string;
|
|
2173
|
+
}
|
|
2174
|
+
type ShadowServerAppInboxTarget = {
|
|
2175
|
+
agentId: string;
|
|
2176
|
+
channelId?: string;
|
|
2177
|
+
} | {
|
|
2178
|
+
channelId: string;
|
|
2179
|
+
agentId?: string;
|
|
2180
|
+
};
|
|
2181
|
+
interface ShadowServerAppOutboxPayload {
|
|
2182
|
+
inboxTasks?: ShadowServerAppInboxTaskOutbox[];
|
|
2183
|
+
channelMessages?: ShadowServerAppChannelMessageOutbox[];
|
|
2184
|
+
deliveries?: ShadowServerAppInboxDelivery[];
|
|
2185
|
+
errors?: ShadowServerAppInboxDeliveryError[];
|
|
2186
|
+
channelMessageDeliveries?: ShadowServerAppChannelMessageDelivery[];
|
|
2187
|
+
channelMessageErrors?: ShadowServerAppChannelMessageDeliveryError[];
|
|
2188
|
+
}
|
|
2189
|
+
interface ShadowServerAppResultShadow {
|
|
2190
|
+
protocol: typeof SHADOW_SERVER_APP_PROTOCOL;
|
|
2191
|
+
outbox?: ShadowServerAppOutboxPayload;
|
|
2192
|
+
}
|
|
2193
|
+
type ShadowServerAppResultWithShadow<TResult extends Record<string, unknown>> = TResult & {
|
|
2194
|
+
shadow?: ShadowServerAppResultShadow;
|
|
2195
|
+
};
|
|
2196
|
+
interface ShadowServerAppCommandSuccessResponse<TResult = unknown> {
|
|
2197
|
+
ok: true;
|
|
2198
|
+
result: TResult;
|
|
2199
|
+
shadow?: ShadowServerAppResultShadow;
|
|
2200
|
+
}
|
|
2201
|
+
interface ShadowServerAppCommandFailureResponse {
|
|
2202
|
+
ok: false;
|
|
2203
|
+
error: string;
|
|
2204
|
+
issues?: ShadowServerAppValidationIssue[] | unknown;
|
|
2205
|
+
}
|
|
2206
|
+
type ShadowServerAppCommandResponse<TResult = unknown> = ShadowServerAppCommandSuccessResponse<TResult> | ShadowServerAppCommandFailureResponse;
|
|
2207
|
+
interface ShadowServerAppBridgeCommandRequest {
|
|
2208
|
+
type: 'shadow.app.command.request';
|
|
2209
|
+
requestId: string;
|
|
2210
|
+
appKey?: string;
|
|
2211
|
+
commandName: string;
|
|
2212
|
+
input?: unknown;
|
|
2213
|
+
channelId?: string;
|
|
2214
|
+
task?: {
|
|
2215
|
+
messageId: string;
|
|
2216
|
+
cardId: string;
|
|
2217
|
+
claimId?: string;
|
|
2218
|
+
};
|
|
2219
|
+
}
|
|
2220
|
+
interface ShadowServerAppBridgeInboxesRequest {
|
|
2221
|
+
type: 'shadow.app.inboxes.request';
|
|
2222
|
+
requestId: string;
|
|
2223
|
+
appKey?: string;
|
|
2224
|
+
}
|
|
2225
|
+
interface ShadowServerAppBridgeEnqueueInboxTaskRequest {
|
|
2226
|
+
type: 'shadow.app.inbox.enqueue.request';
|
|
2227
|
+
requestId: string;
|
|
2228
|
+
appKey?: string;
|
|
2229
|
+
target: ShadowServerAppInboxTarget;
|
|
2230
|
+
task: ShadowServerAppInboxTaskOutbox;
|
|
2231
|
+
}
|
|
2232
|
+
type ShadowServerAppBridgeRequest = ShadowServerAppBridgeCommandRequest | ShadowServerAppBridgeInboxesRequest | ShadowServerAppBridgeEnqueueInboxTaskRequest;
|
|
2233
|
+
interface ShadowServerAppHostAppRef {
|
|
2234
|
+
id?: string | null;
|
|
2235
|
+
appId?: string | null;
|
|
2236
|
+
appKey: string;
|
|
2237
|
+
serverId?: string | null;
|
|
2238
|
+
name?: string | null;
|
|
2239
|
+
label?: string | null;
|
|
2240
|
+
}
|
|
2241
|
+
interface ShadowServerAppHostInboxTaskRequestInput {
|
|
2242
|
+
serverIdOrSlug: string;
|
|
2243
|
+
target: ShadowServerAppInboxTarget;
|
|
2244
|
+
task: ShadowServerAppInboxTaskOutbox;
|
|
2245
|
+
app: ShadowServerAppHostAppRef;
|
|
2246
|
+
commandName?: string;
|
|
2247
|
+
}
|
|
2248
|
+
interface ShadowServerAppResolvedInboxTaskRequest {
|
|
2249
|
+
endpoint: string;
|
|
2250
|
+
body: ShadowInboxTaskInput;
|
|
2251
|
+
}
|
|
2252
|
+
interface ShadowServerAppInboxDeliveryFromMessageInput {
|
|
2253
|
+
target: ShadowServerAppInboxTarget;
|
|
2254
|
+
message: unknown;
|
|
2255
|
+
idempotencyKey?: string;
|
|
2256
|
+
}
|
|
2257
|
+
type ShadowServerAppBridgeResponseType = 'shadow.app.command.response' | 'shadow.app.inboxes.response' | 'shadow.app.inbox.enqueue.response';
|
|
2258
|
+
interface ShadowServerAppBridgeSuccessResponse<TResult = unknown> {
|
|
2259
|
+
type: ShadowServerAppBridgeResponseType;
|
|
2260
|
+
requestId: string;
|
|
2261
|
+
ok: true;
|
|
2262
|
+
result: TResult;
|
|
2263
|
+
}
|
|
2264
|
+
interface ShadowServerAppBridgeFailureResponse {
|
|
2265
|
+
type: ShadowServerAppBridgeResponseType;
|
|
2266
|
+
requestId: string;
|
|
2267
|
+
ok: false;
|
|
2268
|
+
error: string;
|
|
2269
|
+
}
|
|
2270
|
+
type ShadowServerAppBridgeResponse<TResult = unknown> = ShadowServerAppBridgeSuccessResponse<TResult> | ShadowServerAppBridgeFailureResponse;
|
|
2271
|
+
declare function shadowServerAppInboxTaskEndpoint(serverIdOrSlug: string, target: ShadowServerAppInboxTarget): string;
|
|
2272
|
+
declare function buildShadowServerAppInboxTaskRequest(input: ShadowServerAppHostInboxTaskRequestInput): ShadowServerAppResolvedInboxTaskRequest;
|
|
2273
|
+
declare function getShadowServerAppTaskCardId(message: unknown): string | null;
|
|
2274
|
+
declare function buildShadowServerAppInboxDelivery(input: ShadowServerAppInboxDeliveryFromMessageInput): ShadowServerAppInboxDelivery;
|
|
2275
|
+
declare function getShadowServerAppInboxDeliveries(payload: unknown): ShadowServerAppInboxDelivery[];
|
|
2276
|
+
declare function getShadowServerAppInboxErrors(payload: unknown): ShadowServerAppInboxDeliveryError[];
|
|
2277
|
+
declare function getShadowServerAppChannelMessageDeliveries(payload: unknown): ShadowServerAppChannelMessageDelivery[];
|
|
2278
|
+
declare function getShadowServerAppChannelMessageErrors(payload: unknown): ShadowServerAppChannelMessageDeliveryError[];
|
|
2279
|
+
declare function unwrapShadowServerAppCommandPayload<TResult = unknown>(payload: unknown): TResult;
|
|
2280
|
+
declare class ShadowServerAppOutbox {
|
|
2281
|
+
private readonly inboxTasks;
|
|
2282
|
+
private readonly channelMessages;
|
|
2283
|
+
enqueueInboxTask(task: ShadowServerAppInboxTaskOutbox): this;
|
|
2284
|
+
enqueueInboxTasks(tasks: ShadowServerAppInboxTaskOutbox[]): this;
|
|
2285
|
+
sendChannelMessage(message: ShadowServerAppChannelMessageOutbox): this;
|
|
2286
|
+
sendChannelMessages(messages: ShadowServerAppChannelMessageOutbox[]): this;
|
|
2287
|
+
toShadow(): ShadowServerAppResultShadow;
|
|
2288
|
+
attachTo<TResult extends Record<string, unknown>>(result: TResult): ShadowServerAppResultWithShadow<TResult>;
|
|
2289
|
+
}
|
|
2290
|
+
interface ShadowServerAppActorRef {
|
|
2291
|
+
kind: string;
|
|
2292
|
+
id: string;
|
|
2293
|
+
userId: string | null;
|
|
2294
|
+
buddyAgentId: string | null;
|
|
2295
|
+
ownerId: string | null;
|
|
2296
|
+
displayName: string;
|
|
2297
|
+
avatarUrl: string | null;
|
|
2298
|
+
}
|
|
2299
|
+
interface ShadowServerAppCommandParseError {
|
|
2300
|
+
ok: false;
|
|
2301
|
+
status: 400 | 401 | 403 | 502;
|
|
2302
|
+
error: string;
|
|
2303
|
+
issues?: ShadowServerAppValidationIssue[];
|
|
2304
|
+
}
|
|
2305
|
+
interface ShadowServerAppCommandParseSuccess<T = unknown> {
|
|
2306
|
+
ok: true;
|
|
2307
|
+
envelope: ShadowServerAppCommandEnvelope<T>;
|
|
2308
|
+
}
|
|
2309
|
+
type ShadowServerAppCommandParseResult<T = unknown> = ShadowServerAppCommandParseSuccess<T> | ShadowServerAppCommandParseError;
|
|
2310
|
+
interface ShadowServerAppManifestOptions {
|
|
2311
|
+
publicBaseUrl?: string;
|
|
2312
|
+
apiBaseUrl?: string;
|
|
2313
|
+
port?: number;
|
|
2314
|
+
iframePath?: string;
|
|
2315
|
+
iconPath?: string;
|
|
2316
|
+
allowedOrigins?: string[];
|
|
2317
|
+
}
|
|
2318
|
+
interface ShadowServerAppIntrospectionInput {
|
|
2319
|
+
token: string;
|
|
2320
|
+
serverId: string;
|
|
2321
|
+
appKey: string;
|
|
2322
|
+
shadowBaseUrl?: string;
|
|
2323
|
+
fetchImpl?: ShadowServerAppFetch;
|
|
2324
|
+
}
|
|
2325
|
+
interface ShadowServerAppCommandRequestInput {
|
|
2326
|
+
authorizationHeader?: string | null;
|
|
2327
|
+
serverIdHeader?: string | null;
|
|
2328
|
+
appKeyHeader?: string | null;
|
|
2329
|
+
expectedCommand: string;
|
|
2330
|
+
requestBody?: string;
|
|
2331
|
+
requestInput?: unknown;
|
|
2332
|
+
shadowBaseUrl?: string;
|
|
2333
|
+
fetchImpl?: ShadowServerAppFetch;
|
|
2334
|
+
}
|
|
2335
|
+
interface ShadowServerAppCommandRuntimeRequest {
|
|
2336
|
+
authorizationHeader?: string | null;
|
|
2337
|
+
serverIdHeader?: string | null;
|
|
2338
|
+
appKeyHeader?: string | null;
|
|
2339
|
+
requestBody?: string;
|
|
2340
|
+
requestInput?: unknown;
|
|
2341
|
+
}
|
|
2342
|
+
interface ShadowServerAppRuntimeOptions {
|
|
2343
|
+
shadowBaseUrl?: string;
|
|
2344
|
+
fetchImpl?: ShadowServerAppFetch;
|
|
2345
|
+
}
|
|
2346
|
+
interface ShadowServerAppCommandHandlerContext {
|
|
2347
|
+
context: ShadowServerAppCommandContext;
|
|
2348
|
+
actor: ShadowServerAppActorRef;
|
|
2349
|
+
}
|
|
2350
|
+
type ShadowServerAppCommandHandler<TInput = unknown, TResult = unknown> = (input: TInput, context: ShadowServerAppCommandHandlerContext) => TResult | Promise<TResult>;
|
|
2351
|
+
type ShadowServerAppCommandHandlers<TManifest extends ShadowServerAppManifest> = {
|
|
2352
|
+
[TCommand in TManifest['commands'][number] as TCommand['name']]: ShadowServerAppCommandHandler<ShadowServerAppCommandInput<TManifest, TCommand['name']>>;
|
|
2353
|
+
};
|
|
2354
|
+
interface ShadowServerAppExecutionSuccess<TResult = unknown> {
|
|
2355
|
+
ok: true;
|
|
2356
|
+
status: 200;
|
|
2357
|
+
body: ShadowServerAppCommandSuccessResponse<TResult>;
|
|
2358
|
+
}
|
|
2359
|
+
interface ShadowServerAppExecutionFailure {
|
|
2360
|
+
ok: false;
|
|
2361
|
+
status: number;
|
|
2362
|
+
body: ShadowServerAppCommandFailureResponse;
|
|
2363
|
+
}
|
|
2364
|
+
type ShadowServerAppExecutionResult<TResult = unknown> = ShadowServerAppExecutionSuccess<TResult> | ShadowServerAppExecutionFailure;
|
|
2365
|
+
interface ShadowServerAppValidationIssue {
|
|
2366
|
+
path: string;
|
|
2367
|
+
message: string;
|
|
2368
|
+
}
|
|
2369
|
+
type ShadowServerAppCommandName<TManifest extends ShadowServerAppManifest> = TManifest['commands'][number]['name'];
|
|
2370
|
+
type JsonSchemaEnum<TSchema> = TSchema extends {
|
|
2371
|
+
enum: readonly (infer TValue)[];
|
|
2372
|
+
} ? TValue : never;
|
|
2373
|
+
type JsonSchemaProperties<TSchema> = TSchema extends {
|
|
2374
|
+
properties: infer TProperties;
|
|
2375
|
+
} ? TProperties : Record<string, never>;
|
|
2376
|
+
type JsonSchemaRequiredKeys<TSchema, TProperties> = TSchema extends {
|
|
2377
|
+
required: readonly (infer TKey)[];
|
|
2378
|
+
} ? string extends TKey ? never : Extract<TKey, keyof TProperties> : never;
|
|
2379
|
+
type Simplify<T> = {
|
|
2380
|
+
[TKey in keyof T]: T[TKey];
|
|
2381
|
+
} & {};
|
|
2382
|
+
type JsonSchemaAdditionalProperties<TSchema> = TSchema extends {
|
|
2383
|
+
additionalProperties: infer TAdditionalProperties;
|
|
2384
|
+
} ? TAdditionalProperties extends false ? unknown : TAdditionalProperties extends true ? Record<string, unknown> : TAdditionalProperties extends Record<string, unknown> ? Record<string, JsonSchemaToType<TAdditionalProperties>> : unknown : unknown;
|
|
2385
|
+
type JsonSchemaToType<TSchema> = TSchema extends {
|
|
2386
|
+
oneOf: readonly (infer TOption)[];
|
|
2387
|
+
} ? JsonSchemaToType<TOption> : [JsonSchemaEnum<TSchema>] extends [never] ? TSchema extends {
|
|
2388
|
+
type: 'string';
|
|
2389
|
+
} ? string : TSchema extends {
|
|
2390
|
+
type: 'number' | 'integer';
|
|
2391
|
+
} ? number : TSchema extends {
|
|
2392
|
+
type: 'boolean';
|
|
2393
|
+
} ? boolean : TSchema extends {
|
|
2394
|
+
type: 'array';
|
|
2395
|
+
items: infer TItems;
|
|
2396
|
+
} ? JsonSchemaToType<TItems>[] : TSchema extends {
|
|
2397
|
+
type: 'object';
|
|
2398
|
+
} ? JsonSchemaObjectToType<TSchema> : unknown : JsonSchemaEnum<TSchema>;
|
|
2399
|
+
type JsonSchemaObjectToType<TSchema> = JsonSchemaProperties<TSchema> extends infer TProperties ? Simplify<{
|
|
2400
|
+
[TKey in JsonSchemaRequiredKeys<TSchema, TProperties>]: JsonSchemaToType<TProperties[TKey]>;
|
|
2401
|
+
} & {
|
|
2402
|
+
[TKey in Exclude<keyof TProperties, JsonSchemaRequiredKeys<TSchema, TProperties>>]?: JsonSchemaToType<TProperties[TKey]>;
|
|
2403
|
+
}> & JsonSchemaAdditionalProperties<TSchema> : Record<string, unknown>;
|
|
2404
|
+
type ExtractShadowServerAppCommand<TManifest extends ShadowServerAppManifest, TCommandName extends ShadowServerAppCommandName<TManifest>> = Extract<TManifest['commands'][number], {
|
|
2405
|
+
name: TCommandName;
|
|
2406
|
+
}>;
|
|
2407
|
+
type ShadowServerAppCommandInput<TManifest extends ShadowServerAppManifest, TCommandName extends ShadowServerAppCommandName<TManifest>> = ExtractShadowServerAppCommand<TManifest, TCommandName> extends {
|
|
2408
|
+
inputSchema: infer TSchema;
|
|
2409
|
+
} ? JsonSchemaToType<TSchema> : Record<string, never>;
|
|
2410
|
+
declare function extractShadowServerAppBearerToken(value?: string | null): string | null;
|
|
2411
|
+
declare function normalizeShadowServerAppCommandInput(value: unknown): unknown;
|
|
2412
|
+
declare function createShadowServerAppManifest<TManifest extends ShadowServerAppManifest>(manifest: TManifest, options?: ShadowServerAppManifestOptions): TManifest;
|
|
2413
|
+
declare function defineShadowServerApp<const TManifest extends ShadowServerAppManifest>(manifest: TManifest, options?: ShadowServerAppRuntimeOptions): ShadowServerAppRuntime<TManifest>;
|
|
2414
|
+
declare class ShadowServerAppCommandError extends Error {
|
|
2415
|
+
readonly status: number;
|
|
2416
|
+
readonly issues?: ShadowServerAppValidationIssue[] | unknown;
|
|
2417
|
+
constructor(status: number, error: string, issues?: ShadowServerAppValidationIssue[] | unknown);
|
|
2418
|
+
}
|
|
2419
|
+
declare function shadowServerAppError(status: number, error: string, issues?: ShadowServerAppValidationIssue[] | unknown): ShadowServerAppCommandError;
|
|
2420
|
+
declare class ShadowServerAppRuntime<const TManifest extends ShadowServerAppManifest> {
|
|
2421
|
+
readonly sourceManifest: TManifest;
|
|
2422
|
+
private readonly options;
|
|
2423
|
+
constructor(sourceManifest: TManifest, options?: ShadowServerAppRuntimeOptions);
|
|
2424
|
+
manifest(options?: ShadowServerAppManifestOptions): TManifest;
|
|
2425
|
+
defineCommands(handlers: ShadowServerAppCommandHandlers<TManifest>): ShadowServerAppCommandHandlers<TManifest>;
|
|
2426
|
+
actor(envelopeOrContext: ShadowServerAppCommandEnvelope | ShadowServerAppCommandContext): ShadowServerAppActorRef;
|
|
2427
|
+
error(status: number, error: string, issues?: ShadowServerAppValidationIssue[] | unknown): ShadowServerAppCommandError;
|
|
2428
|
+
parseCommand<TCommandName extends ShadowServerAppCommandName<TManifest>>(commandName: TCommandName, request: ShadowServerAppCommandRuntimeRequest): Promise<ShadowServerAppCommandParseResult<ShadowServerAppCommandInput<TManifest, TCommandName>>>;
|
|
2429
|
+
executeCommand<TCommandName extends ShadowServerAppCommandName<TManifest>>(commandName: TCommandName, request: ShadowServerAppCommandRuntimeRequest, handlers: ShadowServerAppCommandHandlers<TManifest>): Promise<ShadowServerAppExecutionResult>;
|
|
2430
|
+
executeLocal<TCommandName extends ShadowServerAppCommandName<TManifest>>(commandName: TCommandName, input: unknown, context: ShadowServerAppCommandContext, handlers: ShadowServerAppCommandHandlers<TManifest>): Promise<ShadowServerAppExecutionResult>;
|
|
2431
|
+
private executeEnvelope;
|
|
2432
|
+
}
|
|
2433
|
+
declare function introspectShadowServerAppToken(input: ShadowServerAppIntrospectionInput): Promise<ShadowServerAppTokenIntrospection | null>;
|
|
2434
|
+
declare function parseShadowServerAppCommandRequest<T = unknown>(input: ShadowServerAppCommandRequestInput): Promise<ShadowServerAppCommandParseResult<T>>;
|
|
2435
|
+
declare function validateShadowServerAppJsonSchema(schema: Readonly<Record<string, unknown>> | undefined, value: unknown): {
|
|
2436
|
+
ok: true;
|
|
2437
|
+
} | {
|
|
2438
|
+
ok: false;
|
|
2439
|
+
issues: ShadowServerAppValidationIssue[];
|
|
2440
|
+
};
|
|
2441
|
+
declare function shadowServerAppActorDisplayName(envelopeOrContext: ShadowServerAppCommandEnvelope | ShadowServerAppCommandContext): string;
|
|
2442
|
+
declare function shadowServerAppActorAvatarUrl(envelopeOrContext: ShadowServerAppCommandEnvelope | ShadowServerAppCommandContext): string | null;
|
|
2443
|
+
declare function shadowServerAppActorRef(envelopeOrContext: ShadowServerAppCommandEnvelope | ShadowServerAppCommandContext): ShadowServerAppActorRef;
|
|
2444
|
+
|
|
2445
|
+
export { type ShadowInteractiveActionResult as $, type ShadowServerJoinRequestStatus as A, type ShadowMember as B, type ShadowAddAgentsToServerResult as C, type ShadowChannel as D, type ShadowChannelBootstrap as E, type ShadowChannelAccess as F, type ShadowChannelJoinRequestResult as G, type ShadowChannelJoinRequestStatus as H, type ShadowVoiceState as I, type ShadowVoiceJoinResult as J, type ShadowVoiceRenewResult as K, type ShadowVoiceLeaveResult as L, type ShadowVoicePolicy as M, type ShadowMessageMention as N, type ShadowMessage as O, type ShadowMentionSuggestionTrigger as P, type ShadowMentionSuggestion as Q, type ShadowBuddyInboxSummary as R, type ShadowAuthResponse as S, type ShadowEnsureBuddyInboxResult as T, type ShadowBuddyInboxAdmissionPolicyResult as U, type ShadowBuddyInboxAdmissionPolicy as V, type ShadowBuddyInboxAdmissionPendingResult as W, type ShadowBuddyInboxAdmissionPendingActionResult as X, type ShadowInboxTaskInput as Y, type ShadowMessageCard as Z, type ShadowInteractiveActionInput as _, type ShadowUser as a, type JsonSchemaToType as a$, type ShadowInteractiveState as a0, type ShadowThread as a1, type ShadowNotification as a2, type ShadowInviteCode as a3, type ShadowAttachment as a4, type ShadowMediaVariant as a5, type ShadowSignedMediaUrl as a6, type ShadowFriendship as a7, type ShadowScopedUnread as a8, type ShadowNotificationPreferences as a9, type ShadowDiyCloudRunStatus as aA, type ShadowDiyCloudRun as aB, type ShadowDiyCloudRunEvent as aC, type ShadowCloudDeploymentManifest as aD, type ShadowCloudDeploymentTemplateSyncResult as aE, type ShadowCloudDeploymentRuntimeResponse as aF, type ShadowCloudDeploymentBackup as aG, type ShadowCloudProviderCatalog as aH, type ShadowCloudProviderProfile as aI, type ShadowCloudProviderModel as aJ, type ShadowRechargeConfig as aK, type ShadowRechargeIntent as aL, type ShadowRechargeHistory as aM, type ShadowPaymentOrder as aN, type ShadowEntitlement as aO, type ShadowOAuthCommerceEntitlementAccess as aP, type ShadowOAuthCommerceEntitlementRedeemInput as aQ, type ShadowOAuthCommerceEntitlementRedeemResult as aR, type ShadowEntitlementProvisioning as aS, type ShadowTask as aT, type ShadowMarketplaceProductsResponse as aU, type ShadowMarketplaceCategoriesResponse as aV, type ServerEventMap as aW, type ChannelCreatedPayload as aX, type ChannelMemberAddedPayload as aY, type ChannelMemberRemovedPayload as aZ, type ClientEventMap as a_, type ShadowOAuthApp as aa, type ShadowOAuthToken as ab, type ShadowOAuthConsent as ac, type ShadowOAuthLinkCard as ad, type ShadowListing as ae, type ShadowContract as af, type ShadowShop as ag, type ShadowProduct as ah, type ShadowCommerceProductContext as ai, type ShadowEntitlementPurchaseResult as aj, type ShadowCommerceCheckoutPreview as ak, type ShadowCommunityAssetDefinition as al, type ShadowCommerceProductPickerResponse as am, type ShadowPaidFileOpenResult as an, type ShadowCategory as ao, type ShadowCartItem as ap, type ShadowOrder as aq, type ShadowReview as ar, type ShadowWallet as as, type ShadowTransaction as at, type ShadowCommunityAsset as au, type ShadowCommunityAssetGrant as av, type ShadowEconomyTip as aw, type ShadowEconomyGift as ax, type ShadowSettlementLine as ay, type ShadowDiyCloudGenerateInput as az, type ShadowMembership as b, type ShadowServerAppCommandParseSuccess as b$, type MemberJoinPayload as b0, type MemberLeavePayload as b1, type MessageDeletedPayload as b2, type PolicyChangedPayload as b3, type PresenceActivityPayload as b4, type PresenceChangePayload as b5, type ReactionPayload as b6, SHADOW_SERVER_APP_COMMAND_COMPLETED_EVENT as b7, SHADOW_SERVER_APP_COMMAND_EVENTS as b8, SHADOW_SERVER_APP_COMMAND_FAILED_EVENT as b9, type ShadowServerAppActorProfile as bA, type ShadowServerAppActorRef as bB, type ShadowServerAppBridgeCommandRequest as bC, type ShadowServerAppBridgeEnqueueInboxTaskRequest as bD, type ShadowServerAppBridgeFailureResponse as bE, type ShadowServerAppBridgeInboxesRequest as bF, type ShadowServerAppBridgeRequest as bG, type ShadowServerAppBridgeResponse as bH, type ShadowServerAppBridgeResponseType as bI, type ShadowServerAppBridgeSuccessResponse as bJ, type ShadowServerAppChannelMessageDelivery as bK, type ShadowServerAppChannelMessageDeliveryError as bL, type ShadowServerAppChannelMessageOutbox as bM, type ShadowServerAppCommand as bN, type ShadowServerAppCommandApproval as bO, type ShadowServerAppCommandContext as bP, type ShadowServerAppCommandEnvelope as bQ, ShadowServerAppCommandError as bR, type ShadowServerAppCommandEventType as bS, type ShadowServerAppCommandFailureResponse as bT, type ShadowServerAppCommandHandler as bU, type ShadowServerAppCommandHandlerContext as bV, type ShadowServerAppCommandHandlers as bW, type ShadowServerAppCommandInput as bX, type ShadowServerAppCommandName as bY, type ShadowServerAppCommandParseError as bZ, type ShadowServerAppCommandParseResult as b_, SHADOW_SERVER_APP_PROTOCOL as ba, type ServerJoinedPayload as bb, type ShadowBuddyInboxAdmissionMode as bc, type ShadowBuddyInboxAdmissionPendingDelivery as bd, type ShadowBuddyInboxAdmissionRule as be, type ShadowBuddyInboxAdmissionSubjectKind as bf, type ShadowChannelPolicy as bg, type ShadowCloudDeploymentStatus as bh, type ShadowCloudProviderEnvVar as bi, type ShadowCommerceProductCard as bj, type ShadowCommerceProductPickerGroup as bk, type ShadowConnectorRuntimeInfo as bl, type ShadowInteractiveBlock as bm, type ShadowInteractiveResponse as bn, type ShadowInteractiveSubmissionPending as bo, type ShadowMarketplaceCategory as bp, type ShadowMarketplaceProduct as bq, type ShadowMessageCardSource as br, type ShadowModelProxyModel as bs, type ShadowOAuthCommerceEntitlementRedemption as bt, type ShadowOAuthCommerceEntitlementSummary as bu, type ShadowProductEntitlementConfig as bv, type ShadowProductMedia as bw, type ShadowProductSku as bx, type ShadowRemoteChannel as by, type ShadowRemoteServer as bz, type ShadowPlayLaunchResult as c, type ShadowServerAppCommandRequestInput as c0, type ShadowServerAppCommandResponse as c1, type ShadowServerAppCommandSuccessResponse as c2, type ShadowServerAppExecutionFailure as c3, type ShadowServerAppExecutionResult as c4, type ShadowServerAppExecutionSuccess as c5, type ShadowServerAppFetch as c6, type ShadowServerAppHostAppRef as c7, type ShadowServerAppHostInboxTaskRequestInput as c8, type ShadowServerAppInboxDelivery as c9, defineShadowServerApp as cA, extractShadowServerAppBearerToken as cB, getShadowServerAppChannelMessageDeliveries as cC, getShadowServerAppChannelMessageErrors as cD, getShadowServerAppTaskCardId as cE, introspectShadowServerAppToken as cF, normalizeShadowServerAppCommandInput as cG, parseShadowServerAppCommandRequest as cH, shadowServerAppActorAvatarUrl as cI, shadowServerAppActorDisplayName as cJ, shadowServerAppActorRef as cK, shadowServerAppError as cL, shadowServerAppInboxTaskEndpoint as cM, validateShadowServerAppJsonSchema as cN, type ShadowServerAppCommandRuntimeRequest as cO, getShadowServerAppInboxDeliveries as cP, getShadowServerAppInboxErrors as cQ, unwrapShadowServerAppCommandPayload as cR, type ShadowServerAppInboxDeliveryError as ca, type ShadowServerAppInboxDeliveryFromMessageInput as cb, type ShadowServerAppInboxTarget as cc, type ShadowServerAppInboxTaskOutbox as cd, type ShadowServerAppInboxTaskPriority as ce, type ShadowServerAppInboxTaskResource as cf, type ShadowServerAppIntrospectionInput as cg, type ShadowServerAppManifestOptions as ch, ShadowServerAppOutbox as ci, type ShadowServerAppOutboxPayload as cj, type ShadowServerAppRealtimeSpec as ck, type ShadowServerAppResolvedInboxTaskRequest as cl, type ShadowServerAppResultShadow as cm, type ShadowServerAppResultWithShadow as cn, ShadowServerAppRuntime as co, type ShadowServerAppRuntimeOptions as cp, type ShadowServerAppValidationIssue as cq, type ShadowUsageProviderSnapshot as cr, type ShadowVoiceCredentials as cs, type ShadowVoiceParticipant as ct, type TypingPayload as cu, type VoiceParticipantPayload as cv, type VoicePolicyUpdatedPayload as cw, buildShadowServerAppInboxDelivery as cx, buildShadowServerAppInboxTaskRequest as cy, createShadowServerAppManifest as cz, type ShadowHomePlayCatalogItem as d, type ShadowModelProxyModelsResponse as e, type ShadowModelProxyBilling as f, type ShadowModelProxyChatCompletionRequest as g, type ShadowModelProxyChatCompletionResponse as h, type ShadowConnectorComputer as i, type ShadowConnectorBootstrapResult as j, type ShadowAgentUsageSnapshotInput as k, type ShadowRemoteConfig as l, type ShadowSlashCommand as m, type ShadowChannelSlashCommand as n, type ShadowServer as o, type ShadowServerAccess as p, type ShadowServerAppIntegration as q, type ShadowServerAppCatalogEntry as r, type ShadowServerAppManifest as s, type ShadowServerAppDiscovery as t, type ShadowServerAppApprovalMode as u, type ShadowServerAppCommandConsent as v, type ShadowServerAppSkillDocument as w, type ShadowServerAppLaunchContext as x, type ShadowServerAppTokenIntrospection as y, type ShadowServerJoinRequestResult as z };
|