@shadowob/sdk 1.1.3-dev.251 → 1.1.3-dev.261
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +28 -2
- package/dist/index.d.cts +44 -4
- package/dist/index.d.ts +44 -4
- package/dist/index.js +28 -2
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -217,8 +217,11 @@ var ShadowClient = class {
|
|
|
217
217
|
});
|
|
218
218
|
}
|
|
219
219
|
// ── Agents ────────────────────────────────────────────────────────────
|
|
220
|
-
async listAgents() {
|
|
221
|
-
|
|
220
|
+
async listAgents(options) {
|
|
221
|
+
const params = new URLSearchParams();
|
|
222
|
+
if (options?.includeRentals) params.set("includeRentals", "true");
|
|
223
|
+
const query = params.toString();
|
|
224
|
+
return this.request(`/api/agents${query ? `?${query}` : ""}`);
|
|
222
225
|
}
|
|
223
226
|
async createAgent(data) {
|
|
224
227
|
return this.request("/api/agents", {
|
|
@@ -675,6 +678,14 @@ var ShadowClient = class {
|
|
|
675
678
|
`/api/attachments/${attachmentId}/media-url?disposition=${disposition}`
|
|
676
679
|
);
|
|
677
680
|
}
|
|
681
|
+
async resolveWorkspaceMediaUrl(serverId, fileId, options) {
|
|
682
|
+
const params = new URLSearchParams();
|
|
683
|
+
params.set("disposition", options?.disposition ?? "inline");
|
|
684
|
+
if (options?.contentRef) params.set("contentRef", options.contentRef);
|
|
685
|
+
return this.request(
|
|
686
|
+
`/api/servers/${serverId}/workspace/files/${fileId}/media-url?${params}`
|
|
687
|
+
);
|
|
688
|
+
}
|
|
678
689
|
/**
|
|
679
690
|
* Download a file from a URL and upload it to the Shadow media service.
|
|
680
691
|
* Supports local filesystem paths, file:// URLs, tilde paths, and HTTP(S) URLs.
|
|
@@ -1028,6 +1039,21 @@ var ShadowClient = class {
|
|
|
1028
1039
|
body: JSON.stringify({ appId })
|
|
1029
1040
|
});
|
|
1030
1041
|
}
|
|
1042
|
+
async sendOAuthChannelMessage(channelId, content, opts) {
|
|
1043
|
+
return this.request(`/api/oauth/channels/${channelId}/messages`, {
|
|
1044
|
+
method: "POST",
|
|
1045
|
+
body: JSON.stringify({
|
|
1046
|
+
content,
|
|
1047
|
+
...opts?.metadata ? { metadata: opts.metadata } : {}
|
|
1048
|
+
})
|
|
1049
|
+
});
|
|
1050
|
+
}
|
|
1051
|
+
async sendOAuthBuddyMessage(buddyId, data) {
|
|
1052
|
+
return this.request(`/api/oauth/buddies/${buddyId}/messages`, {
|
|
1053
|
+
method: "POST",
|
|
1054
|
+
body: JSON.stringify(data)
|
|
1055
|
+
});
|
|
1056
|
+
}
|
|
1031
1057
|
// ── Marketplace / Rentals ─────────────────────────────────────────────
|
|
1032
1058
|
async browseListings(params) {
|
|
1033
1059
|
const qs = new URLSearchParams();
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MessageMention, MentionSuggestionTrigger, MentionSuggestion } from '@shadowob/shared';
|
|
1
|
+
import { MessageMention, OAuthLinkCard, MentionSuggestionTrigger, MentionSuggestion } from '@shadowob/shared';
|
|
2
2
|
export { CLIENT_EVENTS, ClientEvent, SERVER_EVENTS, ServerEvent } from '@shadowob/shared';
|
|
3
3
|
import { Socket } from 'socket.io-client';
|
|
4
4
|
|
|
@@ -94,6 +94,7 @@ interface ShadowMessageMetadata {
|
|
|
94
94
|
interactiveResponse?: ShadowInteractiveResponse;
|
|
95
95
|
interactiveState?: ShadowInteractiveState;
|
|
96
96
|
commerceCards?: Array<ShadowCommerceProductCard | ShadowCommerceOfferCardInput>;
|
|
97
|
+
oauthLinkCards?: ShadowOAuthLinkCard[];
|
|
97
98
|
[key: string]: unknown;
|
|
98
99
|
}
|
|
99
100
|
interface ShadowCommerceOfferCardInput {
|
|
@@ -102,6 +103,7 @@ interface ShadowCommerceOfferCardInput {
|
|
|
102
103
|
offerId: string;
|
|
103
104
|
}
|
|
104
105
|
type ShadowMessageMention = MessageMention;
|
|
106
|
+
type ShadowOAuthLinkCard = OAuthLinkCard;
|
|
105
107
|
type ShadowMentionSuggestion = MentionSuggestion;
|
|
106
108
|
type ShadowMentionSuggestionTrigger = MentionSuggestionTrigger;
|
|
107
109
|
interface ShadowAttachment {
|
|
@@ -385,7 +387,15 @@ interface ShadowChannelPolicy {
|
|
|
385
387
|
listen: boolean;
|
|
386
388
|
reply: boolean;
|
|
387
389
|
mentionOnly: boolean;
|
|
388
|
-
config:
|
|
390
|
+
config: ShadowChannelPolicyConfig;
|
|
391
|
+
}
|
|
392
|
+
interface ShadowChannelPolicyConfig {
|
|
393
|
+
allowedTriggerUserIds?: string[];
|
|
394
|
+
triggerUserIds?: string[];
|
|
395
|
+
ownerId?: string;
|
|
396
|
+
activeTenantIds?: string[];
|
|
397
|
+
replyRequiresMention?: boolean;
|
|
398
|
+
[key: string]: unknown;
|
|
389
399
|
}
|
|
390
400
|
interface ShadowSlashCommand {
|
|
391
401
|
name: string;
|
|
@@ -418,6 +428,11 @@ interface ShadowRemoteServer {
|
|
|
418
428
|
interface ShadowRemoteConfig {
|
|
419
429
|
agentId: string;
|
|
420
430
|
botUserId: string;
|
|
431
|
+
ownerId?: string;
|
|
432
|
+
buddyMode?: 'private' | 'shareable';
|
|
433
|
+
allowedServerIds?: string[];
|
|
434
|
+
activeTenantIds?: string[];
|
|
435
|
+
allowedTriggerUserIds?: string[];
|
|
421
436
|
slashCommands?: ShadowSlashCommand[];
|
|
422
437
|
servers: ShadowRemoteServer[];
|
|
423
438
|
}
|
|
@@ -1426,10 +1441,15 @@ declare class ShadowClient {
|
|
|
1426
1441
|
getOfficialModelProxyBilling(): Promise<ShadowModelProxyBilling>;
|
|
1427
1442
|
createOfficialChatCompletion(data: ShadowModelProxyChatCompletionRequest): Promise<ShadowModelProxyChatCompletionResponse>;
|
|
1428
1443
|
createOfficialChatCompletionStream(data: ShadowModelProxyChatCompletionRequest): Promise<Response>;
|
|
1429
|
-
listAgents(
|
|
1444
|
+
listAgents(options?: {
|
|
1445
|
+
includeRentals?: boolean;
|
|
1446
|
+
}): Promise<{
|
|
1430
1447
|
id: string;
|
|
1431
|
-
name
|
|
1448
|
+
name?: string;
|
|
1432
1449
|
status: string;
|
|
1450
|
+
accessRole?: 'owner' | 'tenant';
|
|
1451
|
+
activeContractId?: string | null;
|
|
1452
|
+
config?: Record<string, unknown>;
|
|
1433
1453
|
}[]>;
|
|
1434
1454
|
createAgent(data: {
|
|
1435
1455
|
name: string;
|
|
@@ -1439,6 +1459,8 @@ declare class ShadowClient {
|
|
|
1439
1459
|
avatarUrl?: string | null;
|
|
1440
1460
|
kernelType?: string;
|
|
1441
1461
|
config?: Record<string, unknown>;
|
|
1462
|
+
buddyMode?: 'private' | 'shareable';
|
|
1463
|
+
allowedServerIds?: string[];
|
|
1442
1464
|
}): Promise<{
|
|
1443
1465
|
id: string;
|
|
1444
1466
|
token: string;
|
|
@@ -1454,6 +1476,8 @@ declare class ShadowClient {
|
|
|
1454
1476
|
name?: string;
|
|
1455
1477
|
displayName?: string;
|
|
1456
1478
|
avatarUrl?: string | null;
|
|
1479
|
+
buddyMode?: 'private' | 'shareable';
|
|
1480
|
+
allowedServerIds?: string[];
|
|
1457
1481
|
}): Promise<{
|
|
1458
1482
|
id: string;
|
|
1459
1483
|
name: string;
|
|
@@ -1700,6 +1724,10 @@ declare class ShadowClient {
|
|
|
1700
1724
|
resolveAttachmentMediaUrl(attachmentId: string, options?: {
|
|
1701
1725
|
disposition?: 'inline' | 'attachment';
|
|
1702
1726
|
}): Promise<ShadowSignedMediaUrl>;
|
|
1727
|
+
resolveWorkspaceMediaUrl(serverId: string, fileId: string, options?: {
|
|
1728
|
+
disposition?: 'inline' | 'attachment';
|
|
1729
|
+
contentRef?: string;
|
|
1730
|
+
}): Promise<ShadowSignedMediaUrl>;
|
|
1703
1731
|
/**
|
|
1704
1732
|
* Download a file from a URL and upload it to the Shadow media service.
|
|
1705
1733
|
* Supports local filesystem paths, file:// URLs, tilde paths, and HTTP(S) URLs.
|
|
@@ -1883,6 +1911,18 @@ declare class ShadowClient {
|
|
|
1883
1911
|
revokeOAuthConsent(appId: string): Promise<{
|
|
1884
1912
|
success: boolean;
|
|
1885
1913
|
}>;
|
|
1914
|
+
sendOAuthChannelMessage(channelId: string, content: string, opts?: {
|
|
1915
|
+
metadata?: {
|
|
1916
|
+
oauthLinkCards?: ShadowOAuthLinkCard[];
|
|
1917
|
+
};
|
|
1918
|
+
}): Promise<ShadowMessage>;
|
|
1919
|
+
sendOAuthBuddyMessage(buddyId: string, data: {
|
|
1920
|
+
channelId: string;
|
|
1921
|
+
content: string;
|
|
1922
|
+
metadata?: {
|
|
1923
|
+
oauthLinkCards?: ShadowOAuthLinkCard[];
|
|
1924
|
+
};
|
|
1925
|
+
}): Promise<ShadowMessage>;
|
|
1886
1926
|
browseListings(params?: {
|
|
1887
1927
|
search?: string;
|
|
1888
1928
|
tags?: string[];
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MessageMention, MentionSuggestionTrigger, MentionSuggestion } from '@shadowob/shared';
|
|
1
|
+
import { MessageMention, OAuthLinkCard, MentionSuggestionTrigger, MentionSuggestion } from '@shadowob/shared';
|
|
2
2
|
export { CLIENT_EVENTS, ClientEvent, SERVER_EVENTS, ServerEvent } from '@shadowob/shared';
|
|
3
3
|
import { Socket } from 'socket.io-client';
|
|
4
4
|
|
|
@@ -94,6 +94,7 @@ interface ShadowMessageMetadata {
|
|
|
94
94
|
interactiveResponse?: ShadowInteractiveResponse;
|
|
95
95
|
interactiveState?: ShadowInteractiveState;
|
|
96
96
|
commerceCards?: Array<ShadowCommerceProductCard | ShadowCommerceOfferCardInput>;
|
|
97
|
+
oauthLinkCards?: ShadowOAuthLinkCard[];
|
|
97
98
|
[key: string]: unknown;
|
|
98
99
|
}
|
|
99
100
|
interface ShadowCommerceOfferCardInput {
|
|
@@ -102,6 +103,7 @@ interface ShadowCommerceOfferCardInput {
|
|
|
102
103
|
offerId: string;
|
|
103
104
|
}
|
|
104
105
|
type ShadowMessageMention = MessageMention;
|
|
106
|
+
type ShadowOAuthLinkCard = OAuthLinkCard;
|
|
105
107
|
type ShadowMentionSuggestion = MentionSuggestion;
|
|
106
108
|
type ShadowMentionSuggestionTrigger = MentionSuggestionTrigger;
|
|
107
109
|
interface ShadowAttachment {
|
|
@@ -385,7 +387,15 @@ interface ShadowChannelPolicy {
|
|
|
385
387
|
listen: boolean;
|
|
386
388
|
reply: boolean;
|
|
387
389
|
mentionOnly: boolean;
|
|
388
|
-
config:
|
|
390
|
+
config: ShadowChannelPolicyConfig;
|
|
391
|
+
}
|
|
392
|
+
interface ShadowChannelPolicyConfig {
|
|
393
|
+
allowedTriggerUserIds?: string[];
|
|
394
|
+
triggerUserIds?: string[];
|
|
395
|
+
ownerId?: string;
|
|
396
|
+
activeTenantIds?: string[];
|
|
397
|
+
replyRequiresMention?: boolean;
|
|
398
|
+
[key: string]: unknown;
|
|
389
399
|
}
|
|
390
400
|
interface ShadowSlashCommand {
|
|
391
401
|
name: string;
|
|
@@ -418,6 +428,11 @@ interface ShadowRemoteServer {
|
|
|
418
428
|
interface ShadowRemoteConfig {
|
|
419
429
|
agentId: string;
|
|
420
430
|
botUserId: string;
|
|
431
|
+
ownerId?: string;
|
|
432
|
+
buddyMode?: 'private' | 'shareable';
|
|
433
|
+
allowedServerIds?: string[];
|
|
434
|
+
activeTenantIds?: string[];
|
|
435
|
+
allowedTriggerUserIds?: string[];
|
|
421
436
|
slashCommands?: ShadowSlashCommand[];
|
|
422
437
|
servers: ShadowRemoteServer[];
|
|
423
438
|
}
|
|
@@ -1426,10 +1441,15 @@ declare class ShadowClient {
|
|
|
1426
1441
|
getOfficialModelProxyBilling(): Promise<ShadowModelProxyBilling>;
|
|
1427
1442
|
createOfficialChatCompletion(data: ShadowModelProxyChatCompletionRequest): Promise<ShadowModelProxyChatCompletionResponse>;
|
|
1428
1443
|
createOfficialChatCompletionStream(data: ShadowModelProxyChatCompletionRequest): Promise<Response>;
|
|
1429
|
-
listAgents(
|
|
1444
|
+
listAgents(options?: {
|
|
1445
|
+
includeRentals?: boolean;
|
|
1446
|
+
}): Promise<{
|
|
1430
1447
|
id: string;
|
|
1431
|
-
name
|
|
1448
|
+
name?: string;
|
|
1432
1449
|
status: string;
|
|
1450
|
+
accessRole?: 'owner' | 'tenant';
|
|
1451
|
+
activeContractId?: string | null;
|
|
1452
|
+
config?: Record<string, unknown>;
|
|
1433
1453
|
}[]>;
|
|
1434
1454
|
createAgent(data: {
|
|
1435
1455
|
name: string;
|
|
@@ -1439,6 +1459,8 @@ declare class ShadowClient {
|
|
|
1439
1459
|
avatarUrl?: string | null;
|
|
1440
1460
|
kernelType?: string;
|
|
1441
1461
|
config?: Record<string, unknown>;
|
|
1462
|
+
buddyMode?: 'private' | 'shareable';
|
|
1463
|
+
allowedServerIds?: string[];
|
|
1442
1464
|
}): Promise<{
|
|
1443
1465
|
id: string;
|
|
1444
1466
|
token: string;
|
|
@@ -1454,6 +1476,8 @@ declare class ShadowClient {
|
|
|
1454
1476
|
name?: string;
|
|
1455
1477
|
displayName?: string;
|
|
1456
1478
|
avatarUrl?: string | null;
|
|
1479
|
+
buddyMode?: 'private' | 'shareable';
|
|
1480
|
+
allowedServerIds?: string[];
|
|
1457
1481
|
}): Promise<{
|
|
1458
1482
|
id: string;
|
|
1459
1483
|
name: string;
|
|
@@ -1700,6 +1724,10 @@ declare class ShadowClient {
|
|
|
1700
1724
|
resolveAttachmentMediaUrl(attachmentId: string, options?: {
|
|
1701
1725
|
disposition?: 'inline' | 'attachment';
|
|
1702
1726
|
}): Promise<ShadowSignedMediaUrl>;
|
|
1727
|
+
resolveWorkspaceMediaUrl(serverId: string, fileId: string, options?: {
|
|
1728
|
+
disposition?: 'inline' | 'attachment';
|
|
1729
|
+
contentRef?: string;
|
|
1730
|
+
}): Promise<ShadowSignedMediaUrl>;
|
|
1703
1731
|
/**
|
|
1704
1732
|
* Download a file from a URL and upload it to the Shadow media service.
|
|
1705
1733
|
* Supports local filesystem paths, file:// URLs, tilde paths, and HTTP(S) URLs.
|
|
@@ -1883,6 +1911,18 @@ declare class ShadowClient {
|
|
|
1883
1911
|
revokeOAuthConsent(appId: string): Promise<{
|
|
1884
1912
|
success: boolean;
|
|
1885
1913
|
}>;
|
|
1914
|
+
sendOAuthChannelMessage(channelId: string, content: string, opts?: {
|
|
1915
|
+
metadata?: {
|
|
1916
|
+
oauthLinkCards?: ShadowOAuthLinkCard[];
|
|
1917
|
+
};
|
|
1918
|
+
}): Promise<ShadowMessage>;
|
|
1919
|
+
sendOAuthBuddyMessage(buddyId: string, data: {
|
|
1920
|
+
channelId: string;
|
|
1921
|
+
content: string;
|
|
1922
|
+
metadata?: {
|
|
1923
|
+
oauthLinkCards?: ShadowOAuthLinkCard[];
|
|
1924
|
+
};
|
|
1925
|
+
}): Promise<ShadowMessage>;
|
|
1886
1926
|
browseListings(params?: {
|
|
1887
1927
|
search?: string;
|
|
1888
1928
|
tags?: string[];
|
package/dist/index.js
CHANGED
|
@@ -175,8 +175,11 @@ var ShadowClient = class {
|
|
|
175
175
|
});
|
|
176
176
|
}
|
|
177
177
|
// ── Agents ────────────────────────────────────────────────────────────
|
|
178
|
-
async listAgents() {
|
|
179
|
-
|
|
178
|
+
async listAgents(options) {
|
|
179
|
+
const params = new URLSearchParams();
|
|
180
|
+
if (options?.includeRentals) params.set("includeRentals", "true");
|
|
181
|
+
const query = params.toString();
|
|
182
|
+
return this.request(`/api/agents${query ? `?${query}` : ""}`);
|
|
180
183
|
}
|
|
181
184
|
async createAgent(data) {
|
|
182
185
|
return this.request("/api/agents", {
|
|
@@ -633,6 +636,14 @@ var ShadowClient = class {
|
|
|
633
636
|
`/api/attachments/${attachmentId}/media-url?disposition=${disposition}`
|
|
634
637
|
);
|
|
635
638
|
}
|
|
639
|
+
async resolveWorkspaceMediaUrl(serverId, fileId, options) {
|
|
640
|
+
const params = new URLSearchParams();
|
|
641
|
+
params.set("disposition", options?.disposition ?? "inline");
|
|
642
|
+
if (options?.contentRef) params.set("contentRef", options.contentRef);
|
|
643
|
+
return this.request(
|
|
644
|
+
`/api/servers/${serverId}/workspace/files/${fileId}/media-url?${params}`
|
|
645
|
+
);
|
|
646
|
+
}
|
|
636
647
|
/**
|
|
637
648
|
* Download a file from a URL and upload it to the Shadow media service.
|
|
638
649
|
* Supports local filesystem paths, file:// URLs, tilde paths, and HTTP(S) URLs.
|
|
@@ -986,6 +997,21 @@ var ShadowClient = class {
|
|
|
986
997
|
body: JSON.stringify({ appId })
|
|
987
998
|
});
|
|
988
999
|
}
|
|
1000
|
+
async sendOAuthChannelMessage(channelId, content, opts) {
|
|
1001
|
+
return this.request(`/api/oauth/channels/${channelId}/messages`, {
|
|
1002
|
+
method: "POST",
|
|
1003
|
+
body: JSON.stringify({
|
|
1004
|
+
content,
|
|
1005
|
+
...opts?.metadata ? { metadata: opts.metadata } : {}
|
|
1006
|
+
})
|
|
1007
|
+
});
|
|
1008
|
+
}
|
|
1009
|
+
async sendOAuthBuddyMessage(buddyId, data) {
|
|
1010
|
+
return this.request(`/api/oauth/buddies/${buddyId}/messages`, {
|
|
1011
|
+
method: "POST",
|
|
1012
|
+
body: JSON.stringify(data)
|
|
1013
|
+
});
|
|
1014
|
+
}
|
|
989
1015
|
// ── Marketplace / Rentals ─────────────────────────────────────────────
|
|
990
1016
|
async browseListings(params) {
|
|
991
1017
|
const qs = new URLSearchParams();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shadowob/sdk",
|
|
3
|
-
"version": "1.1.3-dev.
|
|
3
|
+
"version": "1.1.3-dev.261",
|
|
4
4
|
"description": "Shadow SDK — typed REST client and real-time Socket.IO event listener for Shadow servers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"socket.io-client": "^4.8.1",
|
|
24
|
-
"@shadowob/shared": "1.1.3-dev.
|
|
24
|
+
"@shadowob/shared": "1.1.3-dev.261"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"tsup": "^8.5.0",
|