@agent-commons/sdk 0.4.0 → 0.5.0
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/LICENSE +21 -0
- package/README.md +230 -0
- package/dist/index.cjs +656 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +942 -15
- package/dist/index.d.ts +942 -15
- package/dist/index.mjs +656 -22
- package/dist/index.mjs.map +1 -1
- package/package.json +27 -3
package/dist/index.d.mts
CHANGED
|
@@ -51,12 +51,34 @@ interface Agent {
|
|
|
51
51
|
isLiaison?: boolean;
|
|
52
52
|
externalUrl?: string;
|
|
53
53
|
createdAt: string;
|
|
54
|
+
isDefault?: boolean;
|
|
55
|
+
isSystemManaged?: boolean;
|
|
56
|
+
copilotAccessMode?: "full" | "scoped" | "confirm" | null;
|
|
57
|
+
copilotScopes?: string[];
|
|
54
58
|
runtimeType?: AgentRuntimeType;
|
|
55
59
|
runtimeVersion?: string | null;
|
|
56
60
|
runtimeStatus?: AgentRuntimeStatus;
|
|
57
61
|
runtimeConfig?: AgentRuntimeConfig;
|
|
58
62
|
runtimeCapabilities?: Record<string, boolean>;
|
|
59
63
|
}
|
|
64
|
+
interface CopilotChange {
|
|
65
|
+
changeId: string;
|
|
66
|
+
agentId: string;
|
|
67
|
+
ownerUserId: string;
|
|
68
|
+
scope: string;
|
|
69
|
+
resourceType: string;
|
|
70
|
+
resourceId?: string | null;
|
|
71
|
+
action: "create" | "update" | "delete";
|
|
72
|
+
status: "pending" | "applied" | "rejected" | "reverted";
|
|
73
|
+
title: string;
|
|
74
|
+
description?: string | null;
|
|
75
|
+
before?: unknown;
|
|
76
|
+
after?: unknown;
|
|
77
|
+
diff?: unknown;
|
|
78
|
+
createdAt: string;
|
|
79
|
+
reviewedAt?: string | null;
|
|
80
|
+
appliedAt?: string | null;
|
|
81
|
+
}
|
|
60
82
|
/** Agent computers are durable. Runtime pods may be replaced, but this identity persists. */
|
|
61
83
|
type AgentComputerLifecycle = "persistent";
|
|
62
84
|
type ComputerPersistence = AgentComputerLifecycle;
|
|
@@ -409,6 +431,11 @@ interface WorkflowNode {
|
|
|
409
431
|
id: string;
|
|
410
432
|
type: WorkflowNodeType | string;
|
|
411
433
|
toolId?: string;
|
|
434
|
+
toolName?: string;
|
|
435
|
+
agentId?: string;
|
|
436
|
+
agentAvatar?: string;
|
|
437
|
+
workflowId?: string;
|
|
438
|
+
label?: string;
|
|
412
439
|
position?: {
|
|
413
440
|
x: number;
|
|
414
441
|
y: number;
|
|
@@ -423,6 +450,9 @@ interface WorkflowEdge {
|
|
|
423
450
|
sourceHandle?: string;
|
|
424
451
|
targetHandle?: string;
|
|
425
452
|
mapping?: Record<string, string>;
|
|
453
|
+
/** Runtime target types used for dynamic (`any`) values and safe coercion. */
|
|
454
|
+
targetTypes?: Record<string, string>;
|
|
455
|
+
mappingMode?: "exact" | "dynamic" | "coerce";
|
|
426
456
|
}
|
|
427
457
|
interface WorkflowExecution {
|
|
428
458
|
executionId: string;
|
|
@@ -431,7 +461,11 @@ interface WorkflowExecution {
|
|
|
431
461
|
startedAt?: string;
|
|
432
462
|
completedAt?: string;
|
|
433
463
|
outputData?: any;
|
|
464
|
+
/** Alias returned by the immediate execute/status REST response. */
|
|
465
|
+
result?: any;
|
|
434
466
|
nodeResults?: Record<string, any>;
|
|
467
|
+
/** Alias returned by the immediate execute/status REST response. */
|
|
468
|
+
stepResults?: Record<string, any>;
|
|
435
469
|
errorMessage?: string;
|
|
436
470
|
currentNode?: string;
|
|
437
471
|
/** Set when status is 'awaiting_approval' */
|
|
@@ -547,13 +581,16 @@ interface ToolKey {
|
|
|
547
581
|
}
|
|
548
582
|
interface CreateToolKeyParams {
|
|
549
583
|
toolId?: string;
|
|
550
|
-
|
|
551
|
-
|
|
584
|
+
/** @deprecated Ownership is derived from the authenticated principal. */
|
|
585
|
+
ownerId?: string;
|
|
586
|
+
/** @deprecated Ownership is derived from the authenticated principal. */
|
|
587
|
+
ownerType?: "user" | "agent";
|
|
552
588
|
keyName: string;
|
|
553
589
|
value: string;
|
|
554
590
|
displayName?: string;
|
|
555
591
|
description?: string;
|
|
556
|
-
keyType?:
|
|
592
|
+
keyType?: "api-key" | "bearer-token" | "oauth-token" | "secret";
|
|
593
|
+
expiresAt?: string;
|
|
557
594
|
}
|
|
558
595
|
interface ToolPermission {
|
|
559
596
|
id: string;
|
|
@@ -679,6 +716,13 @@ interface McpPrompt {
|
|
|
679
716
|
interface CommonsClientConfig {
|
|
680
717
|
/** Defaults to the unified Commons API platform. */
|
|
681
718
|
baseUrl?: string;
|
|
719
|
+
/** Commons Identity origin used for developer projects and project API keys. */
|
|
720
|
+
identityUrl?: string;
|
|
721
|
+
/**
|
|
722
|
+
* Commons account session or OAuth access token for Commons Identity.
|
|
723
|
+
* This is distinct from `apiKey`, which authenticates platform API calls.
|
|
724
|
+
*/
|
|
725
|
+
identityToken?: string;
|
|
682
726
|
apiKey?: string;
|
|
683
727
|
initiator?: string;
|
|
684
728
|
/** Fetch implementation — defaults to global fetch */
|
|
@@ -843,8 +887,39 @@ interface CreditBalance {
|
|
|
843
887
|
principalId: string;
|
|
844
888
|
workspaceId?: string | null;
|
|
845
889
|
balance: number;
|
|
890
|
+
reserved: number;
|
|
891
|
+
available: number;
|
|
846
892
|
currency: "credits";
|
|
847
893
|
}
|
|
894
|
+
interface CreditCampaign {
|
|
895
|
+
campaignKey: string;
|
|
896
|
+
name: string;
|
|
897
|
+
description?: string | null;
|
|
898
|
+
rewardCredits: number;
|
|
899
|
+
triggerType: "once" | "daily" | "monthly" | "event";
|
|
900
|
+
sourcePlatform: CreditPlatform;
|
|
901
|
+
claimable: boolean;
|
|
902
|
+
claimed: boolean;
|
|
903
|
+
}
|
|
904
|
+
interface CreditTransfer {
|
|
905
|
+
transferId: string;
|
|
906
|
+
senderPrincipalId: string;
|
|
907
|
+
recipientPrincipalId: string;
|
|
908
|
+
amount: number;
|
|
909
|
+
message?: string | null;
|
|
910
|
+
status: "completed" | "reversed";
|
|
911
|
+
createdAt: string;
|
|
912
|
+
}
|
|
913
|
+
interface CreditSummary {
|
|
914
|
+
balance: CreditBalance;
|
|
915
|
+
month: {
|
|
916
|
+
earned: number;
|
|
917
|
+
spent: number;
|
|
918
|
+
};
|
|
919
|
+
recent: CreditLedgerEntry[];
|
|
920
|
+
campaigns: CreditCampaign[];
|
|
921
|
+
transfers: CreditTransfer[];
|
|
922
|
+
}
|
|
848
923
|
interface CreditWriteParams {
|
|
849
924
|
principalId: string;
|
|
850
925
|
principalType?: "user" | "agent" | "service";
|
|
@@ -863,6 +938,221 @@ interface CreditWriteParams {
|
|
|
863
938
|
usageEventId?: string;
|
|
864
939
|
metadata?: Record<string, unknown>;
|
|
865
940
|
}
|
|
941
|
+
type PlanKey = "free" | "plus" | "pro" | "max";
|
|
942
|
+
type ComputeProfile = "starter" | "standard" | "performance" | "gpu";
|
|
943
|
+
type ModelTier = "frontier" | "standard" | "fast" | "local";
|
|
944
|
+
interface PlanEntitlements {
|
|
945
|
+
computerUse: boolean;
|
|
946
|
+
allowedProfiles: ComputeProfile[];
|
|
947
|
+
maxComputerAgents: number;
|
|
948
|
+
maxConcurrentComputers: number;
|
|
949
|
+
modelTiers: ModelTier[];
|
|
950
|
+
maxConcurrentRuns: number;
|
|
951
|
+
}
|
|
952
|
+
interface BillingCatalog {
|
|
953
|
+
creditsPerUsd: number;
|
|
954
|
+
plans: Array<{
|
|
955
|
+
key: PlanKey;
|
|
956
|
+
name: string;
|
|
957
|
+
priceUsd: number;
|
|
958
|
+
monthlyCredits: number;
|
|
959
|
+
entitlements: PlanEntitlements;
|
|
960
|
+
}>;
|
|
961
|
+
topups: Array<{
|
|
962
|
+
key: string;
|
|
963
|
+
name: string;
|
|
964
|
+
credits: number;
|
|
965
|
+
priceUsd: number;
|
|
966
|
+
}>;
|
|
967
|
+
}
|
|
968
|
+
interface SubscriptionInfo {
|
|
969
|
+
planKey: PlanKey;
|
|
970
|
+
planName: string;
|
|
971
|
+
monthlyCredits: number;
|
|
972
|
+
entitlements: PlanEntitlements;
|
|
973
|
+
status: string;
|
|
974
|
+
currentPeriodEnd: string | null;
|
|
975
|
+
cancelAtPeriodEnd: boolean;
|
|
976
|
+
}
|
|
977
|
+
interface FlagEvaluation {
|
|
978
|
+
key: string;
|
|
979
|
+
enabled: boolean;
|
|
980
|
+
variant: string | null;
|
|
981
|
+
payload?: unknown;
|
|
982
|
+
}
|
|
983
|
+
interface ActivityEvent {
|
|
984
|
+
eventId?: string;
|
|
985
|
+
actorId: string;
|
|
986
|
+
actorType?: "user" | "agent" | "service" | string;
|
|
987
|
+
eventType: string;
|
|
988
|
+
resourceType?: string | null;
|
|
989
|
+
resourceId?: string | null;
|
|
990
|
+
metadata?: Record<string, unknown> | null;
|
|
991
|
+
createdAt: string;
|
|
992
|
+
}
|
|
993
|
+
interface AgentLog {
|
|
994
|
+
logId?: string;
|
|
995
|
+
agentId: string;
|
|
996
|
+
sessionId?: string | null;
|
|
997
|
+
action?: string;
|
|
998
|
+
message?: string | null;
|
|
999
|
+
status?: "success" | "error" | "warning" | string;
|
|
1000
|
+
responseTime?: number | null;
|
|
1001
|
+
tools?: unknown[];
|
|
1002
|
+
timestamp: string;
|
|
1003
|
+
[key: string]: unknown;
|
|
1004
|
+
}
|
|
1005
|
+
interface FileArtifact {
|
|
1006
|
+
fileId: string;
|
|
1007
|
+
name?: string;
|
|
1008
|
+
originalName?: string;
|
|
1009
|
+
mimeType?: string;
|
|
1010
|
+
size?: number;
|
|
1011
|
+
storageProvider?: "s3" | "ipfs" | string;
|
|
1012
|
+
agentId?: string | null;
|
|
1013
|
+
sessionId?: string | null;
|
|
1014
|
+
ownerId?: string | null;
|
|
1015
|
+
workspaceId?: string | null;
|
|
1016
|
+
createdAt?: string;
|
|
1017
|
+
[key: string]: unknown;
|
|
1018
|
+
}
|
|
1019
|
+
interface FileContent {
|
|
1020
|
+
fileId?: string;
|
|
1021
|
+
content?: string;
|
|
1022
|
+
mimeType?: string;
|
|
1023
|
+
offset?: number;
|
|
1024
|
+
nextOffset?: number | null;
|
|
1025
|
+
truncated?: boolean;
|
|
1026
|
+
imageUrls?: string[];
|
|
1027
|
+
downloadUrl?: string;
|
|
1028
|
+
[key: string]: unknown;
|
|
1029
|
+
}
|
|
1030
|
+
interface UploadFileInput {
|
|
1031
|
+
data: Blob;
|
|
1032
|
+
name?: string;
|
|
1033
|
+
}
|
|
1034
|
+
interface LibraryItem extends FileArtifact {
|
|
1035
|
+
itemId?: string;
|
|
1036
|
+
description?: string | null;
|
|
1037
|
+
isFavorite?: boolean;
|
|
1038
|
+
source?: string;
|
|
1039
|
+
grants?: LibraryGrant[];
|
|
1040
|
+
shareLinks?: LibraryShareLink[];
|
|
1041
|
+
}
|
|
1042
|
+
interface LibraryGrant {
|
|
1043
|
+
grantId: string;
|
|
1044
|
+
subjectType: "user" | "agent" | "workspace";
|
|
1045
|
+
subjectId: string;
|
|
1046
|
+
permission: "read" | "edit" | "manage";
|
|
1047
|
+
expiresAt?: string | null;
|
|
1048
|
+
[key: string]: unknown;
|
|
1049
|
+
}
|
|
1050
|
+
interface LibraryShareLink {
|
|
1051
|
+
shareId: string;
|
|
1052
|
+
token?: string;
|
|
1053
|
+
url?: string;
|
|
1054
|
+
expiresAt?: string | null;
|
|
1055
|
+
[key: string]: unknown;
|
|
1056
|
+
}
|
|
1057
|
+
interface Space {
|
|
1058
|
+
spaceId: string;
|
|
1059
|
+
name: string;
|
|
1060
|
+
description?: string | null;
|
|
1061
|
+
visibility?: string;
|
|
1062
|
+
createdBy?: string;
|
|
1063
|
+
createdByType?: "agent" | "human";
|
|
1064
|
+
createdAt?: string;
|
|
1065
|
+
updatedAt?: string;
|
|
1066
|
+
members?: SpaceMember[];
|
|
1067
|
+
[key: string]: unknown;
|
|
1068
|
+
}
|
|
1069
|
+
interface SpaceMember {
|
|
1070
|
+
memberId: string;
|
|
1071
|
+
memberType: "agent" | "human";
|
|
1072
|
+
role?: string;
|
|
1073
|
+
status?: string;
|
|
1074
|
+
permissions?: Record<string, unknown>;
|
|
1075
|
+
[key: string]: unknown;
|
|
1076
|
+
}
|
|
1077
|
+
interface SpaceMessage {
|
|
1078
|
+
messageId: string;
|
|
1079
|
+
spaceId: string;
|
|
1080
|
+
senderId: string;
|
|
1081
|
+
senderType: "agent" | "human";
|
|
1082
|
+
content: string;
|
|
1083
|
+
metadata?: Record<string, unknown>;
|
|
1084
|
+
createdAt?: string;
|
|
1085
|
+
updatedAt?: string;
|
|
1086
|
+
[key: string]: unknown;
|
|
1087
|
+
}
|
|
1088
|
+
interface CodeProjectFile {
|
|
1089
|
+
path: string;
|
|
1090
|
+
content: string;
|
|
1091
|
+
}
|
|
1092
|
+
interface CodeProject {
|
|
1093
|
+
projectId: string;
|
|
1094
|
+
agentId: string;
|
|
1095
|
+
name: string;
|
|
1096
|
+
description?: string | null;
|
|
1097
|
+
sessionId?: string | null;
|
|
1098
|
+
files?: CodeProjectFile[];
|
|
1099
|
+
previewSlug?: string | null;
|
|
1100
|
+
previewUrl?: string | null;
|
|
1101
|
+
createdAt?: string;
|
|
1102
|
+
updatedAt?: string;
|
|
1103
|
+
[key: string]: unknown;
|
|
1104
|
+
}
|
|
1105
|
+
interface Goal {
|
|
1106
|
+
goalId: string;
|
|
1107
|
+
status: "pending" | "started" | "completed" | "failed";
|
|
1108
|
+
progress: number;
|
|
1109
|
+
title?: string;
|
|
1110
|
+
description?: string;
|
|
1111
|
+
agentId?: string;
|
|
1112
|
+
[key: string]: unknown;
|
|
1113
|
+
}
|
|
1114
|
+
interface OAuthProvider {
|
|
1115
|
+
providerKey: string;
|
|
1116
|
+
displayName: string;
|
|
1117
|
+
isActive: boolean;
|
|
1118
|
+
scopes?: string[];
|
|
1119
|
+
scopeGroups?: Record<string, string[]>;
|
|
1120
|
+
[key: string]: unknown;
|
|
1121
|
+
}
|
|
1122
|
+
interface OAuthConnection {
|
|
1123
|
+
connectionId: string;
|
|
1124
|
+
providerKey: string;
|
|
1125
|
+
providerDisplayName?: string;
|
|
1126
|
+
providerUserId?: string | null;
|
|
1127
|
+
providerUserEmail?: string | null;
|
|
1128
|
+
providerUserName?: string | null;
|
|
1129
|
+
scopes: string[];
|
|
1130
|
+
status: string;
|
|
1131
|
+
lastUsedAt?: string | null;
|
|
1132
|
+
expiresAt?: string | null;
|
|
1133
|
+
metadata?: Record<string, unknown> | null;
|
|
1134
|
+
[key: string]: unknown;
|
|
1135
|
+
}
|
|
1136
|
+
interface BillingInvoice {
|
|
1137
|
+
id: string;
|
|
1138
|
+
status?: string | null;
|
|
1139
|
+
currency?: string;
|
|
1140
|
+
amountDue?: number;
|
|
1141
|
+
amountPaid?: number;
|
|
1142
|
+
created?: number | string;
|
|
1143
|
+
hostedInvoiceUrl?: string | null;
|
|
1144
|
+
invoicePdf?: string | null;
|
|
1145
|
+
[key: string]: unknown;
|
|
1146
|
+
}
|
|
1147
|
+
interface BillingPaymentMethod {
|
|
1148
|
+
id: string;
|
|
1149
|
+
type: string;
|
|
1150
|
+
brand?: string;
|
|
1151
|
+
last4?: string;
|
|
1152
|
+
expMonth?: number;
|
|
1153
|
+
expYear?: number;
|
|
1154
|
+
[key: string]: unknown;
|
|
1155
|
+
}
|
|
866
1156
|
type WalletType = "eoa" | "erc4337" | "external";
|
|
867
1157
|
interface AgentWallet {
|
|
868
1158
|
id: string;
|
|
@@ -908,15 +1198,70 @@ interface CreateApiKeyParams {
|
|
|
908
1198
|
interface CreatedApiKey extends ApiKey {
|
|
909
1199
|
key: string;
|
|
910
1200
|
}
|
|
1201
|
+
type DeveloperProjectEnvironment = "production" | "development" | "staging";
|
|
1202
|
+
interface DeveloperProject {
|
|
1203
|
+
id: string;
|
|
1204
|
+
workspaceId: string;
|
|
1205
|
+
name: string;
|
|
1206
|
+
slug: string;
|
|
1207
|
+
environment: DeveloperProjectEnvironment;
|
|
1208
|
+
status: string;
|
|
1209
|
+
createdAt: string;
|
|
1210
|
+
}
|
|
1211
|
+
interface DeveloperApiKey {
|
|
1212
|
+
id: string;
|
|
1213
|
+
projectId: string;
|
|
1214
|
+
keyPrefix: string;
|
|
1215
|
+
name: string;
|
|
1216
|
+
scopes: string[];
|
|
1217
|
+
status: string;
|
|
1218
|
+
expiresAt?: string | null;
|
|
1219
|
+
lastUsedAt?: string | null;
|
|
1220
|
+
createdAt: string;
|
|
1221
|
+
}
|
|
1222
|
+
interface CreatedDeveloperApiKey extends DeveloperApiKey {
|
|
1223
|
+
/** Plaintext key — shown once at creation time. */
|
|
1224
|
+
key: string;
|
|
1225
|
+
}
|
|
1226
|
+
type WorkflowValueKind = "text" | "markdown" | "number" | "boolean" | "json" | "image" | "audio" | "video" | "file" | "link" | "email" | "calendar_event" | "tool_result";
|
|
1227
|
+
interface WorkflowValue {
|
|
1228
|
+
kind: WorkflowValueKind;
|
|
1229
|
+
/** Canonical string representation — always present. */
|
|
1230
|
+
text: string;
|
|
1231
|
+
data?: Record<string, any>;
|
|
1232
|
+
mime?: string;
|
|
1233
|
+
label?: string;
|
|
1234
|
+
meta?: Record<string, any>;
|
|
1235
|
+
}
|
|
1236
|
+
/** Optional hint a tool/node declares for how its output should be presented. */
|
|
1237
|
+
interface OutputPresentation {
|
|
1238
|
+
kind?: WorkflowValueKind;
|
|
1239
|
+
textPath?: string;
|
|
1240
|
+
fieldMap?: Record<string, string>;
|
|
1241
|
+
label?: string;
|
|
1242
|
+
}
|
|
911
1243
|
|
|
1244
|
+
interface CommonsRequestOptions {
|
|
1245
|
+
headers?: Record<string, string>;
|
|
1246
|
+
signal?: AbortSignal;
|
|
1247
|
+
}
|
|
912
1248
|
declare class CommonsClient {
|
|
913
1249
|
private readonly baseUrl;
|
|
1250
|
+
private readonly identityUrl;
|
|
1251
|
+
private readonly identityToken?;
|
|
914
1252
|
private readonly apiKey?;
|
|
915
1253
|
private readonly initiator?;
|
|
916
1254
|
private readonly _fetch;
|
|
917
1255
|
constructor(config: CommonsClientConfig);
|
|
918
1256
|
private headers;
|
|
919
|
-
|
|
1257
|
+
/**
|
|
1258
|
+
* Call an API route that is not yet represented by a resource namespace.
|
|
1259
|
+
* Most applications should use the typed helpers below.
|
|
1260
|
+
*/
|
|
1261
|
+
request<T>(method: string, path: string, body?: unknown, options?: CommonsRequestOptions): Promise<T>;
|
|
1262
|
+
private errorPayload;
|
|
1263
|
+
private errorMessage;
|
|
1264
|
+
private identityRequest;
|
|
920
1265
|
get models(): {
|
|
921
1266
|
/** List all available LLM models from the registry */
|
|
922
1267
|
list: () => Promise<{
|
|
@@ -957,6 +1302,13 @@ declare class CommonsClient {
|
|
|
957
1302
|
restartRuntime: (agentId: string) => Promise<{
|
|
958
1303
|
data: AgentRuntime;
|
|
959
1304
|
}>;
|
|
1305
|
+
manageRuntimeChannel: (agentId: string, channel: string, action: string, params?: {
|
|
1306
|
+
pairingCode?: string;
|
|
1307
|
+
target?: string;
|
|
1308
|
+
message?: string;
|
|
1309
|
+
}) => Promise<{
|
|
1310
|
+
data: unknown;
|
|
1311
|
+
}>;
|
|
960
1312
|
/** List tools assigned to an agent. */
|
|
961
1313
|
listTools: (agentId: string) => Promise<{
|
|
962
1314
|
data: any[];
|
|
@@ -968,6 +1320,13 @@ declare class CommonsClient {
|
|
|
968
1320
|
}) => Promise<{
|
|
969
1321
|
data: any;
|
|
970
1322
|
}>;
|
|
1323
|
+
/** Update an agent tool assignment. */
|
|
1324
|
+
updateTool: (assignmentId: string, params: {
|
|
1325
|
+
usageComments?: string;
|
|
1326
|
+
enabled?: boolean;
|
|
1327
|
+
}) => Promise<{
|
|
1328
|
+
data: any;
|
|
1329
|
+
}>;
|
|
971
1330
|
/** Remove a tool assignment from an agent. */
|
|
972
1331
|
removeTool: (assignmentId: string) => Promise<void>;
|
|
973
1332
|
/** Create a liaison agent for an external agent. */
|
|
@@ -982,6 +1341,11 @@ declare class CommonsClient {
|
|
|
982
1341
|
* }
|
|
983
1342
|
*/
|
|
984
1343
|
stream: (params: RunParams) => AsyncGenerator<StreamEvent>;
|
|
1344
|
+
/** Resume a streamed run after executing a caller-owned CLI tool. */
|
|
1345
|
+
submitCliToolResult: (requestId: string, result: string) => Promise<{
|
|
1346
|
+
data?: unknown;
|
|
1347
|
+
message?: string;
|
|
1348
|
+
}>;
|
|
985
1349
|
/** Get the current heartbeat status for an agent. */
|
|
986
1350
|
getAutonomy: (agentId: string) => Promise<{
|
|
987
1351
|
data: {
|
|
@@ -1068,9 +1432,19 @@ declare class CommonsClient {
|
|
|
1068
1432
|
readComputerFile: (agentId: string, pathOrLegacyComputerId: string, legacyPath?: string) => Promise<{
|
|
1069
1433
|
data: ComputerFile;
|
|
1070
1434
|
}>;
|
|
1435
|
+
writeComputerFile: (agentId: string, params: {
|
|
1436
|
+
path: string;
|
|
1437
|
+
content: string;
|
|
1438
|
+
encoding?: "utf8" | "base64";
|
|
1439
|
+
}) => Promise<{
|
|
1440
|
+
data: ComputerFile;
|
|
1441
|
+
}>;
|
|
1071
1442
|
openComputerBrowser: (agentId: string, paramsOrLegacyComputerId: ComputerBrowserOpenParams | string, legacyParams?: ComputerBrowserOpenParams) => Promise<{
|
|
1072
1443
|
data: any;
|
|
1073
1444
|
}>;
|
|
1445
|
+
testComputerBrowser: (agentId: string) => Promise<{
|
|
1446
|
+
data: Record<string, unknown>;
|
|
1447
|
+
}>;
|
|
1074
1448
|
listComputerEvents: (agentId: string, limitOrLegacyComputerId?: number | string, legacyLimit?: number) => Promise<{
|
|
1075
1449
|
data: AgentComputerEvent[];
|
|
1076
1450
|
}>;
|
|
@@ -1111,6 +1485,33 @@ declare class CommonsClient {
|
|
|
1111
1485
|
data: any[];
|
|
1112
1486
|
}>;
|
|
1113
1487
|
};
|
|
1488
|
+
get copilot(): {
|
|
1489
|
+
get: () => Promise<{
|
|
1490
|
+
data: Agent | null;
|
|
1491
|
+
}>;
|
|
1492
|
+
updateSettings: (params: {
|
|
1493
|
+
accessMode: "full" | "scoped" | "confirm";
|
|
1494
|
+
scopes?: string[];
|
|
1495
|
+
}) => Promise<{
|
|
1496
|
+
data: Agent;
|
|
1497
|
+
}>;
|
|
1498
|
+
listChanges: (filter?: {
|
|
1499
|
+
status?: string;
|
|
1500
|
+
resourceType?: string;
|
|
1501
|
+
resourceId?: string;
|
|
1502
|
+
}) => Promise<{
|
|
1503
|
+
data: CopilotChange[];
|
|
1504
|
+
}>;
|
|
1505
|
+
acceptChange: (changeId: string) => Promise<{
|
|
1506
|
+
data: CopilotChange;
|
|
1507
|
+
}>;
|
|
1508
|
+
rejectChange: (changeId: string) => Promise<{
|
|
1509
|
+
data: CopilotChange;
|
|
1510
|
+
}>;
|
|
1511
|
+
revertChange: (changeId: string) => Promise<{
|
|
1512
|
+
data: CopilotChange;
|
|
1513
|
+
}>;
|
|
1514
|
+
};
|
|
1114
1515
|
get run(): {
|
|
1115
1516
|
once: (params: RunParams) => Promise<any>;
|
|
1116
1517
|
};
|
|
@@ -1126,11 +1527,34 @@ declare class CommonsClient {
|
|
|
1126
1527
|
tags?: string[];
|
|
1127
1528
|
}) => Promise<Workflow>;
|
|
1128
1529
|
list: (ownerId: string, ownerType: "user" | "agent") => Promise<Workflow[]>;
|
|
1530
|
+
discoverPublic: (filter?: {
|
|
1531
|
+
category?: string;
|
|
1532
|
+
tags?: string[];
|
|
1533
|
+
limit?: number;
|
|
1534
|
+
}) => Promise<Workflow[]>;
|
|
1129
1535
|
get: (workflowId: string) => Promise<Workflow>;
|
|
1130
1536
|
update: (workflowId: string, updates: Partial<Workflow>) => Promise<Workflow>;
|
|
1131
1537
|
delete: (workflowId: string) => Promise<{
|
|
1132
1538
|
success: boolean;
|
|
1133
1539
|
}>;
|
|
1540
|
+
fork: (workflowId: string, params: {
|
|
1541
|
+
newOwnerId: string;
|
|
1542
|
+
newOwnerType: "user" | "agent";
|
|
1543
|
+
customizations?: {
|
|
1544
|
+
name?: string;
|
|
1545
|
+
description?: string;
|
|
1546
|
+
isPublic?: boolean;
|
|
1547
|
+
};
|
|
1548
|
+
}) => Promise<Workflow>;
|
|
1549
|
+
getWebhook: (workflowId: string) => Promise<Record<string, unknown>>;
|
|
1550
|
+
rotateWebhookToken: (workflowId: string) => Promise<{
|
|
1551
|
+
token: string;
|
|
1552
|
+
webhookUrl: string;
|
|
1553
|
+
}>;
|
|
1554
|
+
disableWebhook: (workflowId: string) => Promise<{
|
|
1555
|
+
success: boolean;
|
|
1556
|
+
}>;
|
|
1557
|
+
executeWebhook: (token: string, payload: unknown, query?: Record<string, string>) => Promise<unknown>;
|
|
1134
1558
|
execute: (workflowId: string, params: {
|
|
1135
1559
|
agentId?: string;
|
|
1136
1560
|
sessionId?: string;
|
|
@@ -1239,6 +1663,18 @@ declare class CommonsClient {
|
|
|
1239
1663
|
getFull: (sessionId: string) => Promise<{
|
|
1240
1664
|
data: any;
|
|
1241
1665
|
}>;
|
|
1666
|
+
/** Rename a session. */
|
|
1667
|
+
rename: (sessionId: string, title: string) => Promise<{
|
|
1668
|
+
data: Session;
|
|
1669
|
+
}>;
|
|
1670
|
+
/** Delete a session and its owned session data. */
|
|
1671
|
+
delete: (sessionId: string) => Promise<{
|
|
1672
|
+
data: unknown;
|
|
1673
|
+
}>;
|
|
1674
|
+
/** Get the full chat transcript for a session. */
|
|
1675
|
+
getChat: (sessionId: string) => Promise<{
|
|
1676
|
+
data: unknown;
|
|
1677
|
+
}>;
|
|
1242
1678
|
};
|
|
1243
1679
|
get tools(): {
|
|
1244
1680
|
list: (filter?: {
|
|
@@ -1269,11 +1705,11 @@ declare class CommonsClient {
|
|
|
1269
1705
|
get oauth(): {
|
|
1270
1706
|
/** List OAuth providers available on the platform (Google Workspace, GitHub, …). */
|
|
1271
1707
|
listProviders: () => Promise<{
|
|
1272
|
-
providers:
|
|
1708
|
+
providers: OAuthProvider[];
|
|
1273
1709
|
}>;
|
|
1274
1710
|
/** Get one provider's details, including its scope groups. */
|
|
1275
1711
|
getProvider: (providerKey: string) => Promise<{
|
|
1276
|
-
provider:
|
|
1712
|
+
provider: OAuthProvider;
|
|
1277
1713
|
}>;
|
|
1278
1714
|
/**
|
|
1279
1715
|
* List the caller's OAuth connections (the accounts agents act with).
|
|
@@ -1283,7 +1719,19 @@ declare class CommonsClient {
|
|
|
1283
1719
|
ownerId?: string;
|
|
1284
1720
|
ownerType?: "user" | "agent";
|
|
1285
1721
|
}) => Promise<{
|
|
1286
|
-
connections:
|
|
1722
|
+
connections: OAuthConnection[];
|
|
1723
|
+
}>;
|
|
1724
|
+
/** Get one OAuth connection. */
|
|
1725
|
+
getConnection: (connectionId: string) => Promise<{
|
|
1726
|
+
connection: OAuthConnection;
|
|
1727
|
+
}>;
|
|
1728
|
+
/** Update connection metadata or its active status. */
|
|
1729
|
+
updateConnection: (connectionId: string, params: {
|
|
1730
|
+
displayName?: string;
|
|
1731
|
+
isActive?: boolean;
|
|
1732
|
+
}) => Promise<{
|
|
1733
|
+
success: boolean;
|
|
1734
|
+
connection: OAuthConnection;
|
|
1287
1735
|
}>;
|
|
1288
1736
|
/**
|
|
1289
1737
|
* Start an OAuth connect flow. Returns the authorization URL the user
|
|
@@ -1316,11 +1764,7 @@ declare class CommonsClient {
|
|
|
1316
1764
|
}>;
|
|
1317
1765
|
};
|
|
1318
1766
|
get toolKeys(): {
|
|
1319
|
-
list: (
|
|
1320
|
-
ownerId?: string;
|
|
1321
|
-
ownerType?: string;
|
|
1322
|
-
toolId?: string;
|
|
1323
|
-
}) => Promise<{
|
|
1767
|
+
list: () => Promise<{
|
|
1324
1768
|
success: boolean;
|
|
1325
1769
|
data: ToolKey[];
|
|
1326
1770
|
}>;
|
|
@@ -1328,28 +1772,112 @@ declare class CommonsClient {
|
|
|
1328
1772
|
success: boolean;
|
|
1329
1773
|
data: ToolKey;
|
|
1330
1774
|
}>;
|
|
1775
|
+
get: (keyId: string) => Promise<{
|
|
1776
|
+
success: boolean;
|
|
1777
|
+
data: ToolKey;
|
|
1778
|
+
}>;
|
|
1779
|
+
updateMetadata: (keyId: string, params: {
|
|
1780
|
+
displayName?: string;
|
|
1781
|
+
description?: string;
|
|
1782
|
+
isActive?: boolean;
|
|
1783
|
+
expiresAt?: string;
|
|
1784
|
+
}) => Promise<{
|
|
1785
|
+
success: boolean;
|
|
1786
|
+
data: ToolKey;
|
|
1787
|
+
}>;
|
|
1788
|
+
updateValue: (keyId: string, value: string) => Promise<{
|
|
1789
|
+
success: boolean;
|
|
1790
|
+
data: unknown;
|
|
1791
|
+
}>;
|
|
1792
|
+
test: (keyId: string) => Promise<{
|
|
1793
|
+
success: boolean;
|
|
1794
|
+
data: unknown;
|
|
1795
|
+
}>;
|
|
1796
|
+
mapToTool: (params: {
|
|
1797
|
+
toolId: string;
|
|
1798
|
+
keyId: string;
|
|
1799
|
+
contextId: string;
|
|
1800
|
+
contextType: "user" | "agent" | "global";
|
|
1801
|
+
priority?: number;
|
|
1802
|
+
}) => Promise<{
|
|
1803
|
+
success: boolean;
|
|
1804
|
+
data: unknown;
|
|
1805
|
+
}>;
|
|
1806
|
+
removeMapping: (mappingId: string) => Promise<{
|
|
1807
|
+
success: boolean;
|
|
1808
|
+
}>;
|
|
1331
1809
|
delete: (keyId: string) => Promise<{
|
|
1332
1810
|
success: boolean;
|
|
1333
1811
|
}>;
|
|
1334
1812
|
};
|
|
1335
1813
|
get toolPermissions(): {
|
|
1336
|
-
|
|
1814
|
+
/** @deprecated Use listForTool with a tool ID. */
|
|
1815
|
+
list: (toolId: string) => Promise<{
|
|
1816
|
+
success: boolean;
|
|
1817
|
+
data: ToolPermission[];
|
|
1818
|
+
}>;
|
|
1819
|
+
listForTool: (toolId: string) => Promise<{
|
|
1337
1820
|
success: boolean;
|
|
1338
1821
|
data: ToolPermission[];
|
|
1339
1822
|
}>;
|
|
1823
|
+
listForSubject: (subjectId: string, subjectType: "user" | "agent") => Promise<{
|
|
1824
|
+
success: boolean;
|
|
1825
|
+
data: ToolPermission[];
|
|
1826
|
+
}>;
|
|
1827
|
+
accessibleTools: (subjectId: string, subjectType: "user" | "agent") => Promise<{
|
|
1828
|
+
success: boolean;
|
|
1829
|
+
data: Tool[];
|
|
1830
|
+
}>;
|
|
1340
1831
|
grant: (params: {
|
|
1341
1832
|
toolId: string;
|
|
1342
1833
|
subjectId: string;
|
|
1343
1834
|
subjectType: "user" | "agent";
|
|
1344
1835
|
permission: "read" | "execute" | "admin";
|
|
1345
|
-
grantedBy
|
|
1836
|
+
grantedBy: string;
|
|
1837
|
+
expiresAt?: string;
|
|
1346
1838
|
}) => Promise<{
|
|
1347
1839
|
success: boolean;
|
|
1348
1840
|
data: ToolPermission;
|
|
1349
1841
|
}>;
|
|
1842
|
+
batchGrant: (params: {
|
|
1843
|
+
toolId: string;
|
|
1844
|
+
subjects: Array<{
|
|
1845
|
+
subjectId: string;
|
|
1846
|
+
subjectType: "user" | "agent";
|
|
1847
|
+
}>;
|
|
1848
|
+
permission: "read" | "execute" | "admin";
|
|
1849
|
+
grantedBy: string;
|
|
1850
|
+
expiresAt?: string;
|
|
1851
|
+
}) => Promise<{
|
|
1852
|
+
success: boolean;
|
|
1853
|
+
data: ToolPermission[];
|
|
1854
|
+
}>;
|
|
1350
1855
|
revoke: (permissionId: string) => Promise<{
|
|
1351
1856
|
success: boolean;
|
|
1352
1857
|
}>;
|
|
1858
|
+
check: (params: {
|
|
1859
|
+
toolId: string;
|
|
1860
|
+
subjectId: string;
|
|
1861
|
+
subjectType: "user" | "agent";
|
|
1862
|
+
permission: "read" | "execute" | "admin";
|
|
1863
|
+
}) => Promise<{
|
|
1864
|
+
success: boolean;
|
|
1865
|
+
data: {
|
|
1866
|
+
hasPermission: boolean;
|
|
1867
|
+
};
|
|
1868
|
+
}>;
|
|
1869
|
+
checkAgentAccess: (toolId: string, agentId: string, userId?: string) => Promise<{
|
|
1870
|
+
success: boolean;
|
|
1871
|
+
data: unknown;
|
|
1872
|
+
}>;
|
|
1873
|
+
transferOwnership: (params: {
|
|
1874
|
+
toolId: string;
|
|
1875
|
+
newOwnerId: string;
|
|
1876
|
+
newOwnerType: "user" | "agent";
|
|
1877
|
+
}) => Promise<{
|
|
1878
|
+
success: boolean;
|
|
1879
|
+
data: Tool;
|
|
1880
|
+
}>;
|
|
1353
1881
|
};
|
|
1354
1882
|
get skills(): {
|
|
1355
1883
|
list: (filter?: {
|
|
@@ -1424,6 +1952,38 @@ declare class CommonsClient {
|
|
|
1424
1952
|
principalType: string | null;
|
|
1425
1953
|
}>;
|
|
1426
1954
|
};
|
|
1955
|
+
get developer(): {
|
|
1956
|
+
scopes: () => Promise<{
|
|
1957
|
+
data: string[];
|
|
1958
|
+
}>;
|
|
1959
|
+
listProjects: () => Promise<{
|
|
1960
|
+
data: DeveloperProject[];
|
|
1961
|
+
}>;
|
|
1962
|
+
createProject: (params: {
|
|
1963
|
+
workspaceId: string;
|
|
1964
|
+
name: string;
|
|
1965
|
+
environment?: DeveloperProjectEnvironment;
|
|
1966
|
+
}) => Promise<{
|
|
1967
|
+
data: DeveloperProject;
|
|
1968
|
+
}>;
|
|
1969
|
+
listApiKeys: (projectId: string) => Promise<{
|
|
1970
|
+
data: DeveloperApiKey[];
|
|
1971
|
+
}>;
|
|
1972
|
+
createApiKey: (projectId: string, params: {
|
|
1973
|
+
name: string;
|
|
1974
|
+
scopes?: string[];
|
|
1975
|
+
expiresAt?: string | null;
|
|
1976
|
+
}) => Promise<{
|
|
1977
|
+
data: CreatedDeveloperApiKey;
|
|
1978
|
+
}>;
|
|
1979
|
+
revokeApiKey: (keyId: string) => Promise<void>;
|
|
1980
|
+
};
|
|
1981
|
+
/**
|
|
1982
|
+
* Legacy per-principal keys (`sk-ac-*`).
|
|
1983
|
+
*
|
|
1984
|
+
* New developer integrations should use `client.developer`, which creates
|
|
1985
|
+
* project-scoped `csk_*` keys with explicit environments and scopes.
|
|
1986
|
+
*/
|
|
1427
1987
|
get apiKeys(): {
|
|
1428
1988
|
/**
|
|
1429
1989
|
* Generate a new API key for a principal (user or agent).
|
|
@@ -1593,6 +2153,298 @@ declare class CommonsClient {
|
|
|
1593
2153
|
data: UsageAggregation;
|
|
1594
2154
|
}>;
|
|
1595
2155
|
};
|
|
2156
|
+
get activity(): {
|
|
2157
|
+
list: (filter?: {
|
|
2158
|
+
actorId?: string;
|
|
2159
|
+
eventType?: string;
|
|
2160
|
+
since?: string;
|
|
2161
|
+
limit?: number;
|
|
2162
|
+
}) => Promise<{
|
|
2163
|
+
data: ActivityEvent[];
|
|
2164
|
+
}>;
|
|
2165
|
+
};
|
|
2166
|
+
get logs(): {
|
|
2167
|
+
list: (agentId: string, filter?: {
|
|
2168
|
+
sessionId?: string;
|
|
2169
|
+
limit?: number;
|
|
2170
|
+
}) => Promise<{
|
|
2171
|
+
data: AgentLog[];
|
|
2172
|
+
}>;
|
|
2173
|
+
observability: (agentId: string, filter?: {
|
|
2174
|
+
from?: string;
|
|
2175
|
+
to?: string;
|
|
2176
|
+
limit?: number;
|
|
2177
|
+
}) => Promise<Record<string, unknown>>;
|
|
2178
|
+
};
|
|
2179
|
+
get files(): {
|
|
2180
|
+
upload: (files: UploadFileInput[], params?: {
|
|
2181
|
+
agentId?: string;
|
|
2182
|
+
sessionId?: string;
|
|
2183
|
+
workspaceId?: string;
|
|
2184
|
+
storageProvider?: "s3" | "ipfs";
|
|
2185
|
+
}) => Promise<{
|
|
2186
|
+
data: FileArtifact[];
|
|
2187
|
+
}>;
|
|
2188
|
+
get: (fileId: string, context?: {
|
|
2189
|
+
agentId?: string;
|
|
2190
|
+
sessionId?: string;
|
|
2191
|
+
}) => Promise<{
|
|
2192
|
+
data: FileArtifact;
|
|
2193
|
+
}>;
|
|
2194
|
+
content: (fileId: string, options?: {
|
|
2195
|
+
agentId?: string;
|
|
2196
|
+
sessionId?: string;
|
|
2197
|
+
offset?: number;
|
|
2198
|
+
maxChars?: number;
|
|
2199
|
+
includeImageUrls?: boolean;
|
|
2200
|
+
includeDownloadUrl?: boolean;
|
|
2201
|
+
}) => Promise<{
|
|
2202
|
+
data: FileContent;
|
|
2203
|
+
}>;
|
|
2204
|
+
};
|
|
2205
|
+
get library(): {
|
|
2206
|
+
list: (filter?: {
|
|
2207
|
+
query?: string;
|
|
2208
|
+
view?: string;
|
|
2209
|
+
source?: string;
|
|
2210
|
+
favorite?: boolean;
|
|
2211
|
+
sessionId?: string;
|
|
2212
|
+
limit?: number;
|
|
2213
|
+
offset?: number;
|
|
2214
|
+
}) => Promise<{
|
|
2215
|
+
data: LibraryItem[];
|
|
2216
|
+
total?: number;
|
|
2217
|
+
}>;
|
|
2218
|
+
get: (itemId: string) => Promise<{
|
|
2219
|
+
data: LibraryItem;
|
|
2220
|
+
}>;
|
|
2221
|
+
download: (itemId: string) => Promise<Record<string, unknown>>;
|
|
2222
|
+
preview: (itemId: string) => Promise<Record<string, unknown>>;
|
|
2223
|
+
update: (itemId: string, params: {
|
|
2224
|
+
name?: string;
|
|
2225
|
+
description?: string;
|
|
2226
|
+
isFavorite?: boolean;
|
|
2227
|
+
}) => Promise<{
|
|
2228
|
+
data: LibraryItem;
|
|
2229
|
+
}>;
|
|
2230
|
+
delete: (itemId: string) => Promise<{
|
|
2231
|
+
success?: boolean;
|
|
2232
|
+
}>;
|
|
2233
|
+
storagePreference: () => Promise<{
|
|
2234
|
+
data?: {
|
|
2235
|
+
defaultStorageProvider: "s3" | "ipfs";
|
|
2236
|
+
};
|
|
2237
|
+
defaultStorageProvider?: "s3" | "ipfs";
|
|
2238
|
+
}>;
|
|
2239
|
+
setStoragePreference: (defaultStorageProvider: "s3" | "ipfs") => Promise<{
|
|
2240
|
+
data?: {
|
|
2241
|
+
defaultStorageProvider: "s3" | "ipfs";
|
|
2242
|
+
};
|
|
2243
|
+
defaultStorageProvider?: "s3" | "ipfs";
|
|
2244
|
+
}>;
|
|
2245
|
+
grant: (itemId: string, params: {
|
|
2246
|
+
subjectType: "user" | "agent" | "workspace";
|
|
2247
|
+
subjectId: string;
|
|
2248
|
+
permission?: "read" | "edit" | "manage";
|
|
2249
|
+
expiresAt?: string | null;
|
|
2250
|
+
}) => Promise<{
|
|
2251
|
+
data: LibraryGrant;
|
|
2252
|
+
}>;
|
|
2253
|
+
revokeGrant: (itemId: string, grantId: string) => Promise<{
|
|
2254
|
+
success?: boolean;
|
|
2255
|
+
}>;
|
|
2256
|
+
createShareLink: (itemId: string, expiresAt?: string | null) => Promise<{
|
|
2257
|
+
data: LibraryShareLink;
|
|
2258
|
+
}>;
|
|
2259
|
+
revokeShareLink: (itemId: string, shareId: string) => Promise<{
|
|
2260
|
+
success?: boolean;
|
|
2261
|
+
}>;
|
|
2262
|
+
resolveShare: (token: string) => Promise<{
|
|
2263
|
+
data: LibraryItem;
|
|
2264
|
+
}>;
|
|
2265
|
+
};
|
|
2266
|
+
get spaces(): {
|
|
2267
|
+
list: (filter?: {
|
|
2268
|
+
memberId?: string;
|
|
2269
|
+
memberType?: "agent" | "human";
|
|
2270
|
+
agentIds?: string[];
|
|
2271
|
+
publicOnly?: boolean;
|
|
2272
|
+
search?: string;
|
|
2273
|
+
includeMembers?: boolean;
|
|
2274
|
+
limit?: number;
|
|
2275
|
+
offset?: number;
|
|
2276
|
+
}) => Promise<{
|
|
2277
|
+
data: Space[];
|
|
2278
|
+
total?: number;
|
|
2279
|
+
limit?: number;
|
|
2280
|
+
offset?: number;
|
|
2281
|
+
}>;
|
|
2282
|
+
create: (params: {
|
|
2283
|
+
name: string;
|
|
2284
|
+
description?: string;
|
|
2285
|
+
sessionId?: string;
|
|
2286
|
+
isPublic?: boolean;
|
|
2287
|
+
maxMembers?: number;
|
|
2288
|
+
image?: string;
|
|
2289
|
+
settings?: Record<string, unknown>;
|
|
2290
|
+
}, creator: {
|
|
2291
|
+
id: string;
|
|
2292
|
+
type: "agent" | "human";
|
|
2293
|
+
}) => Promise<{
|
|
2294
|
+
data: Space;
|
|
2295
|
+
}>;
|
|
2296
|
+
get: (spaceId: string) => Promise<{
|
|
2297
|
+
data: Space;
|
|
2298
|
+
}>;
|
|
2299
|
+
getFull: (spaceId: string) => Promise<{
|
|
2300
|
+
data: Space;
|
|
2301
|
+
}>;
|
|
2302
|
+
update: (spaceId: string, params: Partial<{
|
|
2303
|
+
name: string;
|
|
2304
|
+
description: string;
|
|
2305
|
+
sessionId: string;
|
|
2306
|
+
isPublic: boolean;
|
|
2307
|
+
maxMembers: number;
|
|
2308
|
+
image: string;
|
|
2309
|
+
settings: Record<string, unknown>;
|
|
2310
|
+
}>) => Promise<{
|
|
2311
|
+
data: Space;
|
|
2312
|
+
}>;
|
|
2313
|
+
delete: (spaceId: string) => Promise<{
|
|
2314
|
+
success?: boolean;
|
|
2315
|
+
}>;
|
|
2316
|
+
issueRtcTicket: (spaceId: string) => Promise<{
|
|
2317
|
+
data: {
|
|
2318
|
+
ticket: string;
|
|
2319
|
+
};
|
|
2320
|
+
}>;
|
|
2321
|
+
listMembers: (spaceId: string) => Promise<{
|
|
2322
|
+
data: SpaceMember[];
|
|
2323
|
+
}>;
|
|
2324
|
+
addMember: (spaceId: string, params: {
|
|
2325
|
+
memberId: string;
|
|
2326
|
+
memberType: "agent" | "human";
|
|
2327
|
+
role?: string;
|
|
2328
|
+
permissions?: Record<string, unknown>;
|
|
2329
|
+
}) => Promise<{
|
|
2330
|
+
data: SpaceMember;
|
|
2331
|
+
}>;
|
|
2332
|
+
updateMember: (spaceId: string, memberId: string, memberType: "agent" | "human", params: {
|
|
2333
|
+
role?: string;
|
|
2334
|
+
permissions?: Record<string, unknown>;
|
|
2335
|
+
status?: string;
|
|
2336
|
+
}) => Promise<{
|
|
2337
|
+
data: SpaceMember;
|
|
2338
|
+
}>;
|
|
2339
|
+
removeMember: (spaceId: string, memberId: string, memberType: "agent" | "human") => Promise<{
|
|
2340
|
+
success?: boolean;
|
|
2341
|
+
}>;
|
|
2342
|
+
listMessages: (spaceId: string, filter?: {
|
|
2343
|
+
limit?: number;
|
|
2344
|
+
offset?: number;
|
|
2345
|
+
memberId?: string;
|
|
2346
|
+
}) => Promise<{
|
|
2347
|
+
data: SpaceMessage[];
|
|
2348
|
+
}>;
|
|
2349
|
+
sendMessage: (spaceId: string, params: {
|
|
2350
|
+
content: string;
|
|
2351
|
+
targetType?: "broadcast" | "direct" | "group";
|
|
2352
|
+
targetIds?: string[];
|
|
2353
|
+
messageType?: string;
|
|
2354
|
+
metadata?: Record<string, unknown>;
|
|
2355
|
+
sessionId?: string;
|
|
2356
|
+
}, sender: {
|
|
2357
|
+
id: string;
|
|
2358
|
+
type: "agent" | "human";
|
|
2359
|
+
}) => Promise<{
|
|
2360
|
+
data: SpaceMessage;
|
|
2361
|
+
}>;
|
|
2362
|
+
updateMessage: (spaceId: string, messageId: string, params: {
|
|
2363
|
+
content?: string;
|
|
2364
|
+
metadata?: Record<string, unknown>;
|
|
2365
|
+
}) => Promise<{
|
|
2366
|
+
data: SpaceMessage;
|
|
2367
|
+
}>;
|
|
2368
|
+
deleteMessage: (spaceId: string, messageId: string) => Promise<{
|
|
2369
|
+
success?: boolean;
|
|
2370
|
+
}>;
|
|
2371
|
+
};
|
|
2372
|
+
get projects(): {
|
|
2373
|
+
list: (agentId: string) => Promise<{
|
|
2374
|
+
data: CodeProject[];
|
|
2375
|
+
}>;
|
|
2376
|
+
create: (agentId: string, params: {
|
|
2377
|
+
name: string;
|
|
2378
|
+
description?: string;
|
|
2379
|
+
sessionId?: string;
|
|
2380
|
+
files?: CodeProjectFile[];
|
|
2381
|
+
}) => Promise<{
|
|
2382
|
+
data: CodeProject;
|
|
2383
|
+
}>;
|
|
2384
|
+
get: (agentId: string, projectId: string) => Promise<{
|
|
2385
|
+
data: CodeProject;
|
|
2386
|
+
}>;
|
|
2387
|
+
writeFiles: (agentId: string, projectId: string, files: CodeProjectFile[], replace?: boolean) => Promise<{
|
|
2388
|
+
data: CodeProject;
|
|
2389
|
+
}>;
|
|
2390
|
+
publish: (agentId: string, projectId: string) => Promise<{
|
|
2391
|
+
data: Record<string, unknown>;
|
|
2392
|
+
}>;
|
|
2393
|
+
verify: (agentId: string, projectId: string, actions?: Array<Record<string, unknown>>) => Promise<{
|
|
2394
|
+
data: Record<string, unknown>;
|
|
2395
|
+
}>;
|
|
2396
|
+
exportToComputer: (agentId: string, projectId: string, params?: {
|
|
2397
|
+
directory?: string;
|
|
2398
|
+
sessionId?: string;
|
|
2399
|
+
}) => Promise<{
|
|
2400
|
+
data: Record<string, unknown>;
|
|
2401
|
+
}>;
|
|
2402
|
+
exportToGitHub: (agentId: string, projectId: string, params?: {
|
|
2403
|
+
repositoryName?: string;
|
|
2404
|
+
private?: boolean;
|
|
2405
|
+
}) => Promise<{
|
|
2406
|
+
data: Record<string, unknown>;
|
|
2407
|
+
}>;
|
|
2408
|
+
};
|
|
2409
|
+
get goals(): {
|
|
2410
|
+
create: (params: Record<string, unknown>) => Promise<{
|
|
2411
|
+
data: Goal;
|
|
2412
|
+
}>;
|
|
2413
|
+
get: (goalId: string) => Promise<{
|
|
2414
|
+
data: Goal;
|
|
2415
|
+
}>;
|
|
2416
|
+
updateProgress: (goalId: string, progress: number, status: Goal["status"]) => Promise<{
|
|
2417
|
+
data: Goal;
|
|
2418
|
+
}>;
|
|
2419
|
+
};
|
|
2420
|
+
get audio(): {
|
|
2421
|
+
transcribe: (file: UploadFileInput, options?: {
|
|
2422
|
+
durationMs?: number;
|
|
2423
|
+
idempotencyKey?: string;
|
|
2424
|
+
}) => Promise<{
|
|
2425
|
+
data: {
|
|
2426
|
+
text: string;
|
|
2427
|
+
};
|
|
2428
|
+
}>;
|
|
2429
|
+
};
|
|
2430
|
+
get liaisons(): {
|
|
2431
|
+
create: (params: {
|
|
2432
|
+
name: string;
|
|
2433
|
+
owner: string;
|
|
2434
|
+
externalOwner: string;
|
|
2435
|
+
persona?: string;
|
|
2436
|
+
instructions?: string;
|
|
2437
|
+
externalUrl?: string;
|
|
2438
|
+
externalEndpoint?: string;
|
|
2439
|
+
}) => Promise<{
|
|
2440
|
+
data: Agent;
|
|
2441
|
+
liaisonKey: string;
|
|
2442
|
+
note: string;
|
|
2443
|
+
}>;
|
|
2444
|
+
interact: (liaisonAgentId: string, liaisonKey: string, message?: string) => Promise<{
|
|
2445
|
+
data: unknown;
|
|
2446
|
+
}>;
|
|
2447
|
+
};
|
|
1596
2448
|
get credits(): {
|
|
1597
2449
|
balance: (filter?: {
|
|
1598
2450
|
principalId?: string;
|
|
@@ -1607,6 +2459,31 @@ declare class CommonsClient {
|
|
|
1607
2459
|
}) => Promise<{
|
|
1608
2460
|
data: CreditLedgerEntry[];
|
|
1609
2461
|
}>;
|
|
2462
|
+
summary: () => Promise<{
|
|
2463
|
+
data: CreditSummary;
|
|
2464
|
+
}>;
|
|
2465
|
+
campaigns: () => Promise<{
|
|
2466
|
+
data: CreditCampaign[];
|
|
2467
|
+
}>;
|
|
2468
|
+
claimCampaign: (params: {
|
|
2469
|
+
campaignKey: string;
|
|
2470
|
+
eventId?: string;
|
|
2471
|
+
}) => Promise<{
|
|
2472
|
+
data: {
|
|
2473
|
+
alreadyClaimed: boolean;
|
|
2474
|
+
};
|
|
2475
|
+
}>;
|
|
2476
|
+
transfers: () => Promise<{
|
|
2477
|
+
data: CreditTransfer[];
|
|
2478
|
+
}>;
|
|
2479
|
+
gift: (params: {
|
|
2480
|
+
recipientPrincipalId: string;
|
|
2481
|
+
amount: number;
|
|
2482
|
+
message?: string;
|
|
2483
|
+
idempotencyKey: string;
|
|
2484
|
+
}) => Promise<{
|
|
2485
|
+
data: CreditTransfer;
|
|
2486
|
+
}>;
|
|
1610
2487
|
grant: (params: CreditWriteParams) => Promise<{
|
|
1611
2488
|
data: CreditLedgerEntry;
|
|
1612
2489
|
}>;
|
|
@@ -1614,6 +2491,56 @@ declare class CommonsClient {
|
|
|
1614
2491
|
data: CreditLedgerEntry;
|
|
1615
2492
|
}>;
|
|
1616
2493
|
};
|
|
2494
|
+
get billing(): {
|
|
2495
|
+
/** Public product catalog served from the backend source of truth. */
|
|
2496
|
+
catalog: () => Promise<{
|
|
2497
|
+
data: BillingCatalog;
|
|
2498
|
+
}>;
|
|
2499
|
+
/** Current plan, status, and entitlements for the caller. */
|
|
2500
|
+
subscription: () => Promise<{
|
|
2501
|
+
data: SubscriptionInfo;
|
|
2502
|
+
}>;
|
|
2503
|
+
/** Entitlements only (what paid features the caller may use). */
|
|
2504
|
+
entitlements: () => Promise<{
|
|
2505
|
+
data: PlanEntitlements;
|
|
2506
|
+
}>;
|
|
2507
|
+
/** Stripe invoice history for the caller. */
|
|
2508
|
+
invoices: () => Promise<{
|
|
2509
|
+
data: BillingInvoice[];
|
|
2510
|
+
}>;
|
|
2511
|
+
/** Saved Stripe payment methods for the caller. */
|
|
2512
|
+
paymentMethods: () => Promise<{
|
|
2513
|
+
data: BillingPaymentMethod[];
|
|
2514
|
+
}>;
|
|
2515
|
+
/** Create a Stripe Checkout session for a subscription plan. */
|
|
2516
|
+
subscribe: (planKey: "plus" | "pro" | "max") => Promise<{
|
|
2517
|
+
data: {
|
|
2518
|
+
url: string;
|
|
2519
|
+
};
|
|
2520
|
+
}>;
|
|
2521
|
+
/** Create a Stripe Checkout session for a one-time credit top-up. */
|
|
2522
|
+
topup: (packKey: string) => Promise<{
|
|
2523
|
+
data: {
|
|
2524
|
+
url: string;
|
|
2525
|
+
};
|
|
2526
|
+
}>;
|
|
2527
|
+
/** Open the Stripe billing portal. */
|
|
2528
|
+
portal: () => Promise<{
|
|
2529
|
+
data: {
|
|
2530
|
+
url: string;
|
|
2531
|
+
};
|
|
2532
|
+
}>;
|
|
2533
|
+
};
|
|
2534
|
+
get flags(): {
|
|
2535
|
+
/** Evaluate all active flags for the caller (call once at boot). */
|
|
2536
|
+
all: () => Promise<{
|
|
2537
|
+
data: Record<string, FlagEvaluation>;
|
|
2538
|
+
}>;
|
|
2539
|
+
/** Evaluate a single flag for the caller. */
|
|
2540
|
+
evaluate: (key: string) => Promise<{
|
|
2541
|
+
data: FlagEvaluation;
|
|
2542
|
+
}>;
|
|
2543
|
+
};
|
|
1617
2544
|
}
|
|
1618
2545
|
declare class CommonsError extends Error {
|
|
1619
2546
|
readonly status: number;
|
|
@@ -1657,4 +2584,4 @@ declare function listWorkflowTemplates(): readonly [{
|
|
|
1657
2584
|
}];
|
|
1658
2585
|
declare function buildWorkflowTemplate(templateName: WorkflowTemplateName, ctx: WorkflowTemplateContext): WorkflowTemplateBuild;
|
|
1659
2586
|
|
|
1660
|
-
export { type A2AArtifact, type A2ADataPart, type A2AFilePart, type A2AMessage, type A2AMessagePart, type A2ASendTaskParams, type A2ASkill, type A2ATask, type A2ATaskState, type A2ATextPart, type Agent, type AgentCard, type AgentComputer, type AgentComputerBrowser, type AgentComputerConfig, type AgentComputerDesiredState, type AgentComputerEvent, type AgentComputerGpu, type AgentComputerGpuType, type AgentComputerInstance, type AgentComputerLifecycle, type AgentComputerResourceMode, type AgentComputerResourceProfile, type AgentComputerResources, type AgentComputerStatus, type AgentComputerTerminal, type AgentMemory, type AgentWallet, type ApiKey, type ApiKeyPrincipalType, type ChatMessage, CommonsClient, type CommonsClientConfig, CommonsError, type ComputerActionParams, type ComputerBrowserOpenParams, type ComputerCommandParams, type ComputerConfigUpdate, type ComputerFile, type ComputerGpu, type ComputerGpuType, type ComputerLifecycle, type ComputerNetworkAccess, type ComputerPersistence, type ComputerResizeParams, type ComputerResourceMode, type ComputerResourceProfile, type ComputerResourceUpdate, type ComputerResources, type CreateAgentParams, type CreateApiKeyParams, type CreateMemoryParams, type CreateSkillParams, type CreateTaskParams, type CreateToolKeyParams, type CreateToolParams, type CreateWalletParams, type CreatedApiKey, type McpConnectionType, type McpPrompt, type McpResource, type McpServer, type MemorySourceType, type MemoryStats, type MemoryType, type ModelConfig, type ModelProvider, type RunParams, type Session, type Skill, type SkillIndex, type StreamEvent, type StreamEventType, type Task, type Tool, type ToolKey, type ToolPermission, type UpdateMemoryParams, type UsageAggregation, type UsageEvent, type WalletBalance, type WalletType, type Workflow, type WorkflowDefinition, type WorkflowEdge, type WorkflowExecution, type WorkflowNode, type WorkflowNodeType, type WorkflowTemplateBuild, type WorkflowTemplateContext, type WorkflowTemplateName, type WorkflowTemplateTool, buildWorkflowTemplate, listWorkflowTemplates };
|
|
2587
|
+
export { type A2AArtifact, type A2ADataPart, type A2AFilePart, type A2AMessage, type A2AMessagePart, type A2ASendTaskParams, type A2ASkill, type A2ATask, type A2ATaskState, type A2ATextPart, type ActivityEvent, type Agent, type AgentCard, type AgentComputer, type AgentComputerBrowser, type AgentComputerConfig, type AgentComputerDesiredState, type AgentComputerEvent, type AgentComputerGpu, type AgentComputerGpuType, type AgentComputerInstance, type AgentComputerLifecycle, type AgentComputerResourceMode, type AgentComputerResourceProfile, type AgentComputerResources, type AgentComputerStatus, type AgentComputerTerminal, type AgentLog, type AgentMemory, type AgentWallet, type ApiKey, type ApiKeyPrincipalType, type BillingCatalog, type BillingInvoice, type BillingPaymentMethod, type ChatMessage, type CodeProject, type CodeProjectFile, CommonsClient, type CommonsClientConfig, CommonsError, type CommonsRequestOptions, type ComputeProfile, type ComputerActionParams, type ComputerBrowserOpenParams, type ComputerCommandParams, type ComputerConfigUpdate, type ComputerFile, type ComputerGpu, type ComputerGpuType, type ComputerLifecycle, type ComputerNetworkAccess, type ComputerPersistence, type ComputerResizeParams, type ComputerResourceMode, type ComputerResourceProfile, type ComputerResourceUpdate, type ComputerResources, type CreateAgentParams, type CreateApiKeyParams, type CreateMemoryParams, type CreateSkillParams, type CreateTaskParams, type CreateToolKeyParams, type CreateToolParams, type CreateWalletParams, type CreatedApiKey, type CreatedDeveloperApiKey, type CreditBalance, type CreditCampaign, type CreditDirection, type CreditLedgerEntry, type CreditPlatform, type CreditSummary, type CreditTransfer, type CreditWriteParams, type DeveloperApiKey, type DeveloperProject, type DeveloperProjectEnvironment, type FileArtifact, type FileContent, type FlagEvaluation, type Goal, type LibraryGrant, type LibraryItem, type LibraryShareLink, type McpConnectionType, type McpPrompt, type McpResource, type McpServer, type MemorySourceType, type MemoryStats, type MemoryType, type ModelConfig, type ModelProvider, type ModelTier, type OAuthConnection, type OAuthProvider, type OutputPresentation, type PlanEntitlements, type PlanKey, type RunParams, type Session, type Skill, type SkillIndex, type Space, type SpaceMember, type SpaceMessage, type StreamEvent, type StreamEventType, type SubscriptionInfo, type Task, type Tool, type ToolKey, type ToolPermission, type UpdateMemoryParams, type UploadFileInput, type UsageAggregation, type UsageEvent, type WalletBalance, type WalletType, type Workflow, type WorkflowDefinition, type WorkflowEdge, type WorkflowExecution, type WorkflowNode, type WorkflowNodeType, type WorkflowTemplateBuild, type WorkflowTemplateContext, type WorkflowTemplateName, type WorkflowTemplateTool, type WorkflowValue, type WorkflowValueKind, buildWorkflowTemplate, listWorkflowTemplates };
|