@agentic-trust/agentic-trust-sdk 1.0.43
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 +22 -0
- package/README.md +213 -0
- package/abis/BaseRegistrarImplementation.json +1013 -0
- package/abis/ETHRegistrarController.json +1004 -0
- package/abis/IdentityRegistry.json +1044 -0
- package/abis/NameWrapper.json +2026 -0
- package/abis/PublicResolver.json +1772 -0
- package/abis/ReputationRegistry.json +701 -0
- package/abis/ValidationRegistry.json +505 -0
- package/dist/AIAgentAssociationClient.d.ts +58 -0
- package/dist/AIAgentAssociationClient.d.ts.map +1 -0
- package/dist/AIAgentAssociationClient.js +100 -0
- package/dist/AIAgentAssociationClient.js.map +1 -0
- package/dist/AIAgentDiscoveryClient.d.ts +673 -0
- package/dist/AIAgentDiscoveryClient.d.ts.map +1 -0
- package/dist/AIAgentDiscoveryClient.js +3184 -0
- package/dist/AIAgentDiscoveryClient.js.map +1 -0
- package/dist/AIAgentENSClient.d.ts +149 -0
- package/dist/AIAgentENSClient.d.ts.map +1 -0
- package/dist/AIAgentENSClient.js +958 -0
- package/dist/AIAgentENSClient.js.map +1 -0
- package/dist/AIAgentIdentityClient.d.ts +159 -0
- package/dist/AIAgentIdentityClient.d.ts.map +1 -0
- package/dist/AIAgentIdentityClient.js +660 -0
- package/dist/AIAgentIdentityClient.js.map +1 -0
- package/dist/AIAgentL2ENSDurenClient.d.ts +120 -0
- package/dist/AIAgentL2ENSDurenClient.d.ts.map +1 -0
- package/dist/AIAgentL2ENSDurenClient.js +735 -0
- package/dist/AIAgentL2ENSDurenClient.js.map +1 -0
- package/dist/AIAgentL2ENSNamespaceClient.d.ts +58 -0
- package/dist/AIAgentL2ENSNamespaceClient.d.ts.map +1 -0
- package/dist/AIAgentL2ENSNamespaceClient.js +214 -0
- package/dist/AIAgentL2ENSNamespaceClient.js.map +1 -0
- package/dist/AIAgentReputationClient.d.ts +69 -0
- package/dist/AIAgentReputationClient.d.ts.map +1 -0
- package/dist/AIAgentReputationClient.js +203 -0
- package/dist/AIAgentReputationClient.js.map +1 -0
- package/dist/AIAgentValidationClient.d.ts +60 -0
- package/dist/AIAgentValidationClient.d.ts.map +1 -0
- package/dist/AIAgentValidationClient.js +123 -0
- package/dist/AIAgentValidationClient.js.map +1 -0
- package/dist/OrgIdentityClient.d.ts +27 -0
- package/dist/OrgIdentityClient.d.ts.map +1 -0
- package/dist/OrgIdentityClient.js +169 -0
- package/dist/OrgIdentityClient.js.map +1 -0
- package/dist/abis/BaseRegistrarImplementation.json +1013 -0
- package/dist/abis/ETHRegistrarController.json +1004 -0
- package/dist/abis/IdentityRegistry.json +1044 -0
- package/dist/abis/NameWrapper.json +2026 -0
- package/dist/abis/PublicResolver.json +1772 -0
- package/dist/abis/ReputationRegistry.json +701 -0
- package/dist/abis/ValidationRegistry.json +505 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -0
- package/dist/schema.d.ts +13 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +696 -0
- package/dist/schema.js.map +1 -0
- package/dist/schemaKb.d.ts +12 -0
- package/dist/schemaKb.d.ts.map +1 -0
- package/dist/schemaKb.js +593 -0
- package/dist/schemaKb.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/utils/did8004.d.ts +57 -0
- package/dist/utils/did8004.d.ts.map +1 -0
- package/dist/utils/did8004.js +127 -0
- package/dist/utils/did8004.js.map +1 -0
- package/dist/utils/didEns.d.ts +46 -0
- package/dist/utils/didEns.d.ts.map +1 -0
- package/dist/utils/didEns.js +107 -0
- package/dist/utils/didEns.js.map +1 -0
- package/dist/utils/didEthr.d.ts +40 -0
- package/dist/utils/didEthr.d.ts.map +1 -0
- package/dist/utils/didEthr.js +87 -0
- package/dist/utils/didEthr.js.map +1 -0
- package/package.json +79 -0
|
@@ -0,0 +1,673 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI Agent Discovery Client
|
|
3
|
+
*
|
|
4
|
+
* Fronts for discovery-index GraphQL requests to the indexer
|
|
5
|
+
* Provides a clean interface for querying agent data
|
|
6
|
+
*/
|
|
7
|
+
import { GraphQLClient } from 'graphql-request';
|
|
8
|
+
/**
|
|
9
|
+
* Agent data interface (raw data from GraphQL)
|
|
10
|
+
*/
|
|
11
|
+
export interface AgentData {
|
|
12
|
+
agentId?: number | string;
|
|
13
|
+
uaid?: string | null;
|
|
14
|
+
agentName?: string;
|
|
15
|
+
chainId?: number;
|
|
16
|
+
agentAccount?: string;
|
|
17
|
+
agentIdentityOwnerAccount?: string;
|
|
18
|
+
eoaAgentIdentityOwnerAccount?: string | null;
|
|
19
|
+
eoaAgentAccount?: string | null;
|
|
20
|
+
agentCategory?: string | null;
|
|
21
|
+
didIdentity?: string | null;
|
|
22
|
+
didAccount?: string | null;
|
|
23
|
+
didName?: string | null;
|
|
24
|
+
agentUri?: string | null;
|
|
25
|
+
createdAtBlock?: number;
|
|
26
|
+
createdAtTime?: string | number;
|
|
27
|
+
updatedAtTime?: string | number;
|
|
28
|
+
type?: string | null;
|
|
29
|
+
description?: string | null;
|
|
30
|
+
image?: string | null;
|
|
31
|
+
a2aEndpoint?: string | null;
|
|
32
|
+
did?: string | null;
|
|
33
|
+
mcp?: boolean | null;
|
|
34
|
+
x402support?: boolean | null;
|
|
35
|
+
active?: boolean | null;
|
|
36
|
+
supportedTrust?: string | null;
|
|
37
|
+
rawJson?: string | null;
|
|
38
|
+
onchainMetadataJson?: string | null;
|
|
39
|
+
agentCardJson?: string | null;
|
|
40
|
+
agentCardReadAt?: number | null;
|
|
41
|
+
feedbackCount?: number | null;
|
|
42
|
+
feedbackAverageScore?: number | null;
|
|
43
|
+
validationPendingCount?: number | null;
|
|
44
|
+
validationCompletedCount?: number | null;
|
|
45
|
+
validationRequestedCount?: number | null;
|
|
46
|
+
initiatedAssociationCount?: number | null;
|
|
47
|
+
approvedAssociationCount?: number | null;
|
|
48
|
+
atiOverallScore?: number | null;
|
|
49
|
+
atiOverallConfidence?: number | null;
|
|
50
|
+
atiVersion?: string | null;
|
|
51
|
+
atiComputedAt?: number | null;
|
|
52
|
+
atiBundleJson?: string | null;
|
|
53
|
+
trustLedgerScore?: number | null;
|
|
54
|
+
trustLedgerBadgeCount?: number | null;
|
|
55
|
+
trustLedgerBadges?: unknown[] | null;
|
|
56
|
+
trustLedgerOverallRank?: number | null;
|
|
57
|
+
trustLedgerCapabilityRank?: number | null;
|
|
58
|
+
identity8004Did?: string | null;
|
|
59
|
+
identity8122Did?: string | null;
|
|
60
|
+
identityEnsDid?: string | null;
|
|
61
|
+
identityHolDid?: string | null;
|
|
62
|
+
identityHolUaid?: string | null;
|
|
63
|
+
identity8004DescriptorJson?: string | null;
|
|
64
|
+
identity8122DescriptorJson?: string | null;
|
|
65
|
+
identityEnsDescriptorJson?: string | null;
|
|
66
|
+
identityHolDescriptorJson?: string | null;
|
|
67
|
+
identity8004OnchainMetadataJson?: string | null;
|
|
68
|
+
identity8122OnchainMetadataJson?: string | null;
|
|
69
|
+
identityEnsOnchainMetadataJson?: string | null;
|
|
70
|
+
identityHolOnchainMetadataJson?: string | null;
|
|
71
|
+
identity8122?: unknown | null;
|
|
72
|
+
[key: string]: unknown;
|
|
73
|
+
}
|
|
74
|
+
export interface SemanticAgentMetadataEntry {
|
|
75
|
+
key: string;
|
|
76
|
+
valueText?: string | null;
|
|
77
|
+
}
|
|
78
|
+
export interface SemanticAgentMatch {
|
|
79
|
+
score?: number | null;
|
|
80
|
+
matchReasons?: string[] | null;
|
|
81
|
+
agent: AgentData & {
|
|
82
|
+
metadata?: SemanticAgentMetadataEntry[] | null;
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
export interface SemanticAgentSearchResult {
|
|
86
|
+
total: number;
|
|
87
|
+
matches: SemanticAgentMatch[];
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* KB v2 GraphQL types (graphql-kb).
|
|
91
|
+
*/
|
|
92
|
+
export type KbDescriptor = {
|
|
93
|
+
iri: string;
|
|
94
|
+
name?: string | null;
|
|
95
|
+
description?: string | null;
|
|
96
|
+
image?: string | null;
|
|
97
|
+
};
|
|
98
|
+
export type KbProtocolDescriptor = {
|
|
99
|
+
iri: string;
|
|
100
|
+
name?: string | null;
|
|
101
|
+
description?: string | null;
|
|
102
|
+
image?: string | null;
|
|
103
|
+
agentCardJson?: string | null;
|
|
104
|
+
};
|
|
105
|
+
export type KbProtocol = {
|
|
106
|
+
iri: string;
|
|
107
|
+
protocol: string;
|
|
108
|
+
serviceUrl: string;
|
|
109
|
+
protocolVersion?: string | null;
|
|
110
|
+
descriptor?: KbProtocolDescriptor | null;
|
|
111
|
+
skills: string[];
|
|
112
|
+
domains: string[];
|
|
113
|
+
};
|
|
114
|
+
export type KbIdentityDescriptor = {
|
|
115
|
+
iri: string;
|
|
116
|
+
kind: string;
|
|
117
|
+
name?: string | null;
|
|
118
|
+
description?: string | null;
|
|
119
|
+
image?: string | null;
|
|
120
|
+
registrationJson?: string | null;
|
|
121
|
+
nftMetadataJson?: string | null;
|
|
122
|
+
registeredBy?: string | null;
|
|
123
|
+
registryNamespace?: string | null;
|
|
124
|
+
skills: string[];
|
|
125
|
+
domains: string[];
|
|
126
|
+
};
|
|
127
|
+
export type KbServiceEndpoint = {
|
|
128
|
+
iri: string;
|
|
129
|
+
name?: string | null;
|
|
130
|
+
descriptor?: KbDescriptor | null;
|
|
131
|
+
protocol?: KbProtocol | null;
|
|
132
|
+
};
|
|
133
|
+
export type KbIdentity = {
|
|
134
|
+
iri: string;
|
|
135
|
+
kind: string;
|
|
136
|
+
did: string;
|
|
137
|
+
uaidHOL?: string | null;
|
|
138
|
+
descriptor?: KbIdentityDescriptor | null;
|
|
139
|
+
serviceEndpoints?: KbServiceEndpoint[] | null;
|
|
140
|
+
};
|
|
141
|
+
export type KbIdentity8004 = {
|
|
142
|
+
iri: string;
|
|
143
|
+
kind: string;
|
|
144
|
+
did: string;
|
|
145
|
+
did8004?: string | null;
|
|
146
|
+
agentId8004?: number | null;
|
|
147
|
+
isSmartAgent?: boolean | null;
|
|
148
|
+
descriptor?: KbIdentityDescriptor | null;
|
|
149
|
+
serviceEndpoints?: KbServiceEndpoint[] | null;
|
|
150
|
+
ownerAccount?: KbAccount | null;
|
|
151
|
+
operatorAccount?: KbAccount | null;
|
|
152
|
+
walletAccount?: KbAccount | null;
|
|
153
|
+
ownerEOAAccount?: KbAccount | null;
|
|
154
|
+
agentAccount?: KbAccount | null;
|
|
155
|
+
};
|
|
156
|
+
export type KbIdentity8122 = {
|
|
157
|
+
iri: string;
|
|
158
|
+
kind: string;
|
|
159
|
+
did: string;
|
|
160
|
+
did8122?: string | null;
|
|
161
|
+
agentId8122?: string | null;
|
|
162
|
+
registryAddress?: string | null;
|
|
163
|
+
/**
|
|
164
|
+
* Human-friendly collection/registry name (when KB schema supports it).
|
|
165
|
+
* Note: some KB deployments may use alternate names like `collectionName`.
|
|
166
|
+
*/
|
|
167
|
+
registryName?: string | null;
|
|
168
|
+
collectionName?: string | null;
|
|
169
|
+
endpointType?: string | null;
|
|
170
|
+
endpoint?: string | null;
|
|
171
|
+
descriptor?: KbIdentityDescriptor | null;
|
|
172
|
+
serviceEndpoints?: KbServiceEndpoint[] | null;
|
|
173
|
+
ownerAccount?: KbAccount | null;
|
|
174
|
+
agentAccount?: KbAccount | null;
|
|
175
|
+
};
|
|
176
|
+
export type KbAccount = {
|
|
177
|
+
iri: string;
|
|
178
|
+
chainId?: number | null;
|
|
179
|
+
address?: string | null;
|
|
180
|
+
accountType?: string | null;
|
|
181
|
+
didEthr?: string | null;
|
|
182
|
+
};
|
|
183
|
+
export type KbAssertionsSummary = {
|
|
184
|
+
reviewResponses?: {
|
|
185
|
+
total: number;
|
|
186
|
+
} | null;
|
|
187
|
+
validationResponses?: {
|
|
188
|
+
total: number;
|
|
189
|
+
} | null;
|
|
190
|
+
total?: number | null;
|
|
191
|
+
};
|
|
192
|
+
export type KbAgentDescriptor = {
|
|
193
|
+
iri: string;
|
|
194
|
+
name?: string | null;
|
|
195
|
+
description?: string | null;
|
|
196
|
+
image?: string | null;
|
|
197
|
+
};
|
|
198
|
+
export type KbAgent = {
|
|
199
|
+
iri: string;
|
|
200
|
+
uaid?: string | null;
|
|
201
|
+
agentName?: string | null;
|
|
202
|
+
agentDescription?: string | null;
|
|
203
|
+
agentImage?: string | null;
|
|
204
|
+
agentDescriptor?: KbAgentDescriptor | null;
|
|
205
|
+
agentTypes: string[];
|
|
206
|
+
did8004?: string | null;
|
|
207
|
+
agentId8004?: number | null;
|
|
208
|
+
isSmartAgent?: boolean | null;
|
|
209
|
+
createdAtBlock?: number | null;
|
|
210
|
+
createdAtTime?: number | string | null;
|
|
211
|
+
updatedAtTime?: number | string | null;
|
|
212
|
+
trustLedgerTotalPoints?: number | null;
|
|
213
|
+
trustLedgerBadgeCount?: number | null;
|
|
214
|
+
trustLedgerComputedAt?: number | null;
|
|
215
|
+
atiOverallScore?: number | null;
|
|
216
|
+
atiOverallConfidence?: number | null;
|
|
217
|
+
atiVersion?: string | null;
|
|
218
|
+
atiComputedAt?: number | null;
|
|
219
|
+
assertions?: KbAssertionsSummary | null;
|
|
220
|
+
/** Primary identity (GraphDB KB v2); prefer identity8004/identityEns when absent */
|
|
221
|
+
identity?: KbIdentity | null;
|
|
222
|
+
identity8004?: KbIdentity8004 | null;
|
|
223
|
+
identity8122?: KbIdentity8122 | null;
|
|
224
|
+
identityHol?: KbIdentity | null;
|
|
225
|
+
identityEns?: KbIdentity | null;
|
|
226
|
+
serviceEndpoints?: KbServiceEndpoint[] | null;
|
|
227
|
+
};
|
|
228
|
+
/**
|
|
229
|
+
* OASF taxonomy types (served by discovery GraphQL when enabled)
|
|
230
|
+
*/
|
|
231
|
+
export interface OasfSkill {
|
|
232
|
+
key: string;
|
|
233
|
+
nameKey?: string | null;
|
|
234
|
+
uid?: number | null;
|
|
235
|
+
caption?: string | null;
|
|
236
|
+
extendsKey?: string | null;
|
|
237
|
+
category?: string | null;
|
|
238
|
+
}
|
|
239
|
+
export interface OasfDomain {
|
|
240
|
+
key: string;
|
|
241
|
+
nameKey?: string | null;
|
|
242
|
+
uid?: number | null;
|
|
243
|
+
caption?: string | null;
|
|
244
|
+
extendsKey?: string | null;
|
|
245
|
+
category?: string | null;
|
|
246
|
+
}
|
|
247
|
+
/** Intent type from discovery GraphQL */
|
|
248
|
+
export interface DiscoveryIntentType {
|
|
249
|
+
key: string;
|
|
250
|
+
label?: string | null;
|
|
251
|
+
description?: string | null;
|
|
252
|
+
}
|
|
253
|
+
/** Task type from discovery GraphQL */
|
|
254
|
+
export interface DiscoveryTaskType {
|
|
255
|
+
key: string;
|
|
256
|
+
label?: string | null;
|
|
257
|
+
description?: string | null;
|
|
258
|
+
}
|
|
259
|
+
/** Intent-to-task mapping from discovery GraphQL */
|
|
260
|
+
export interface DiscoveryIntentTaskMapping {
|
|
261
|
+
intent: DiscoveryIntentType;
|
|
262
|
+
task: DiscoveryTaskType;
|
|
263
|
+
requiredSkills: string[];
|
|
264
|
+
optionalSkills: string[];
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Discovery query response types
|
|
268
|
+
*/
|
|
269
|
+
export interface ListAgentsResponse {
|
|
270
|
+
agents: AgentData[];
|
|
271
|
+
}
|
|
272
|
+
export interface GetAgentResponse {
|
|
273
|
+
agent: AgentData;
|
|
274
|
+
}
|
|
275
|
+
export interface GetAgentByNameResponse {
|
|
276
|
+
agentByName: AgentData | null;
|
|
277
|
+
}
|
|
278
|
+
export interface SearchAgentsResponse {
|
|
279
|
+
searchAgents: AgentData[];
|
|
280
|
+
}
|
|
281
|
+
export interface SearchAgentsAdvancedOptions {
|
|
282
|
+
query?: string;
|
|
283
|
+
params?: Record<string, unknown>;
|
|
284
|
+
limit?: number;
|
|
285
|
+
offset?: number;
|
|
286
|
+
orderBy?: string;
|
|
287
|
+
orderDirection?: 'ASC' | 'DESC';
|
|
288
|
+
}
|
|
289
|
+
export interface ValidationResponseData {
|
|
290
|
+
id?: string;
|
|
291
|
+
agentId?: string | number;
|
|
292
|
+
validatorAddress?: string;
|
|
293
|
+
requestHash?: string;
|
|
294
|
+
response?: number;
|
|
295
|
+
responseUri?: string;
|
|
296
|
+
responseJson?: string;
|
|
297
|
+
responseHash?: string;
|
|
298
|
+
tag?: string;
|
|
299
|
+
txHash?: string;
|
|
300
|
+
blockNumber?: number;
|
|
301
|
+
timestamp?: string | number;
|
|
302
|
+
createdAt?: string;
|
|
303
|
+
updatedAt?: string;
|
|
304
|
+
[key: string]: unknown;
|
|
305
|
+
}
|
|
306
|
+
export interface ValidationRequestData {
|
|
307
|
+
id?: string;
|
|
308
|
+
agentId?: string | number;
|
|
309
|
+
validatorAddress?: string;
|
|
310
|
+
requestUri?: string;
|
|
311
|
+
requestJson?: string;
|
|
312
|
+
requestHash?: string;
|
|
313
|
+
txHash?: string;
|
|
314
|
+
blockNumber?: number;
|
|
315
|
+
timestamp?: string | number;
|
|
316
|
+
createdAt?: string;
|
|
317
|
+
updatedAt?: string;
|
|
318
|
+
[key: string]: unknown;
|
|
319
|
+
}
|
|
320
|
+
/** Review assertion item (was FeedbackData; renamed to align with schema review/validation) */
|
|
321
|
+
export interface ReviewData {
|
|
322
|
+
id?: string;
|
|
323
|
+
agentId?: string | number;
|
|
324
|
+
clientAddress?: string;
|
|
325
|
+
score?: number;
|
|
326
|
+
feedbackUri?: string;
|
|
327
|
+
/** JSON payload; schema field is `json` */
|
|
328
|
+
reviewJson?: string;
|
|
329
|
+
comment?: string;
|
|
330
|
+
ratingPct?: number;
|
|
331
|
+
txHash?: string;
|
|
332
|
+
blockNumber?: number;
|
|
333
|
+
timestamp?: string | number;
|
|
334
|
+
isRevoked?: boolean;
|
|
335
|
+
responseCount?: number;
|
|
336
|
+
[key: string]: unknown;
|
|
337
|
+
}
|
|
338
|
+
/** @deprecated use ReviewData */
|
|
339
|
+
export type FeedbackData = ReviewData;
|
|
340
|
+
export interface SearchReviewsAdvancedOptions {
|
|
341
|
+
uaid: string;
|
|
342
|
+
limit?: number;
|
|
343
|
+
offset?: number;
|
|
344
|
+
orderBy?: string;
|
|
345
|
+
orderDirection?: 'ASC' | 'DESC';
|
|
346
|
+
}
|
|
347
|
+
/** @deprecated use SearchReviewsAdvancedOptions with uaid (build uaid from did:8004:chainId:agentId) */
|
|
348
|
+
export interface SearchFeedbackAdvancedOptions {
|
|
349
|
+
uaid?: string;
|
|
350
|
+
chainId?: number;
|
|
351
|
+
agentId?: string | number;
|
|
352
|
+
limit?: number;
|
|
353
|
+
offset?: number;
|
|
354
|
+
orderBy?: string;
|
|
355
|
+
orderDirection?: 'ASC' | 'DESC';
|
|
356
|
+
}
|
|
357
|
+
export interface SearchValidationRequestsAdvancedOptions {
|
|
358
|
+
uaid: string;
|
|
359
|
+
limit?: number;
|
|
360
|
+
offset?: number;
|
|
361
|
+
orderBy?: string;
|
|
362
|
+
orderDirection?: 'ASC' | 'DESC';
|
|
363
|
+
}
|
|
364
|
+
export interface RefreshAgentResponse {
|
|
365
|
+
indexAgent: {
|
|
366
|
+
success: boolean;
|
|
367
|
+
message: string;
|
|
368
|
+
processedChains: number[];
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* Configuration for AIAgentDiscoveryClient
|
|
373
|
+
*/
|
|
374
|
+
export interface AIAgentDiscoveryClientConfig {
|
|
375
|
+
/**
|
|
376
|
+
* GraphQL endpoint URL
|
|
377
|
+
*/
|
|
378
|
+
endpoint: string;
|
|
379
|
+
/**
|
|
380
|
+
* Optional API key for authentication
|
|
381
|
+
*/
|
|
382
|
+
apiKey?: string;
|
|
383
|
+
/**
|
|
384
|
+
* Request timeout in milliseconds
|
|
385
|
+
*/
|
|
386
|
+
timeout?: number;
|
|
387
|
+
/**
|
|
388
|
+
* Additional headers to include in requests
|
|
389
|
+
*/
|
|
390
|
+
headers?: Record<string, string>;
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* AI Agent Discovery Client
|
|
394
|
+
*
|
|
395
|
+
* Provides methods for querying agent data from the indexer
|
|
396
|
+
*/
|
|
397
|
+
export declare class AIAgentDiscoveryClient {
|
|
398
|
+
private client;
|
|
399
|
+
private config;
|
|
400
|
+
private searchStrategy?;
|
|
401
|
+
private searchStrategyPromise?;
|
|
402
|
+
private typeFieldsCache;
|
|
403
|
+
private enumValuesCache;
|
|
404
|
+
private tokenMetadataCollectionSupported?;
|
|
405
|
+
private agentMetadataValueField?;
|
|
406
|
+
private queryFieldsCache?;
|
|
407
|
+
private queryFieldsPromise?;
|
|
408
|
+
private kbV2SupportCache?;
|
|
409
|
+
private kbV2SupportPromise?;
|
|
410
|
+
constructor(config: AIAgentDiscoveryClientConfig);
|
|
411
|
+
private extractOperationName;
|
|
412
|
+
private decorateGraphqlError;
|
|
413
|
+
private gqlRequest;
|
|
414
|
+
private getQueryFields;
|
|
415
|
+
private getEnumValues;
|
|
416
|
+
private pickKbAgentOrderBy;
|
|
417
|
+
private buildKbIdentityAndAccountsSelectionBase;
|
|
418
|
+
private hasQueryField;
|
|
419
|
+
private supportsKbV2Queries;
|
|
420
|
+
/**
|
|
421
|
+
* Map a KB v2 agent node into the legacy AgentData shape used across the monorepo.
|
|
422
|
+
*/
|
|
423
|
+
private mapKbAgentToAgentData;
|
|
424
|
+
private kbAgentSelectionCache;
|
|
425
|
+
private kbAgentSelectionPromise;
|
|
426
|
+
private getKbAgentSelection;
|
|
427
|
+
private supportsQueryField;
|
|
428
|
+
private normalizeAgent;
|
|
429
|
+
/**
|
|
430
|
+
* List agents with a deterministic default ordering (agentId DESC).
|
|
431
|
+
*
|
|
432
|
+
* @param limit - Maximum number of agents to return per page
|
|
433
|
+
* @param offset - Number of agents to skip
|
|
434
|
+
* @returns List of agents
|
|
435
|
+
*/
|
|
436
|
+
listAgents(limit?: number, offset?: number): Promise<AgentData[]>;
|
|
437
|
+
/**
|
|
438
|
+
* Run a semantic search over agents using the discovery indexer's
|
|
439
|
+
* `semanticAgentSearch` GraphQL field.
|
|
440
|
+
*
|
|
441
|
+
* NOTE: This expects the KB GraphQL schema. If the backend does not expose
|
|
442
|
+
* `kbSemanticAgentSearch`, it will throw.
|
|
443
|
+
*/
|
|
444
|
+
semanticAgentSearch(params: {
|
|
445
|
+
text?: string;
|
|
446
|
+
intentJson?: string;
|
|
447
|
+
topK?: number;
|
|
448
|
+
requiredSkills?: string[];
|
|
449
|
+
intentType?: string;
|
|
450
|
+
}): Promise<SemanticAgentSearchResult>;
|
|
451
|
+
/**
|
|
452
|
+
* Fetch OASF skills taxonomy from the discovery GraphQL endpoint (best-effort).
|
|
453
|
+
* Returns [] if the backend does not expose `oasfSkills`.
|
|
454
|
+
*/
|
|
455
|
+
oasfSkills(params?: {
|
|
456
|
+
key?: string;
|
|
457
|
+
nameKey?: string;
|
|
458
|
+
category?: string;
|
|
459
|
+
extendsKey?: string;
|
|
460
|
+
limit?: number;
|
|
461
|
+
offset?: number;
|
|
462
|
+
orderBy?: string;
|
|
463
|
+
orderDirection?: string;
|
|
464
|
+
}): Promise<OasfSkill[]>;
|
|
465
|
+
/**
|
|
466
|
+
* Fetch OASF domains taxonomy from the discovery GraphQL endpoint (best-effort).
|
|
467
|
+
* Returns [] if the backend does not expose `oasfDomains`.
|
|
468
|
+
*/
|
|
469
|
+
oasfDomains(params?: {
|
|
470
|
+
key?: string;
|
|
471
|
+
nameKey?: string;
|
|
472
|
+
category?: string;
|
|
473
|
+
extendsKey?: string;
|
|
474
|
+
limit?: number;
|
|
475
|
+
offset?: number;
|
|
476
|
+
orderBy?: string;
|
|
477
|
+
orderDirection?: string;
|
|
478
|
+
}): Promise<OasfDomain[]>;
|
|
479
|
+
/**
|
|
480
|
+
* Fetch intent types from the discovery GraphQL endpoint (best-effort).
|
|
481
|
+
* Returns [] if the backend does not expose `intentTypes`.
|
|
482
|
+
*/
|
|
483
|
+
intentTypes(params?: {
|
|
484
|
+
key?: string;
|
|
485
|
+
label?: string;
|
|
486
|
+
limit?: number;
|
|
487
|
+
offset?: number;
|
|
488
|
+
}): Promise<DiscoveryIntentType[]>;
|
|
489
|
+
/**
|
|
490
|
+
* Fetch task types from the discovery GraphQL endpoint (best-effort).
|
|
491
|
+
* Returns [] if the backend does not expose `taskTypes`.
|
|
492
|
+
*/
|
|
493
|
+
taskTypes(params?: {
|
|
494
|
+
key?: string;
|
|
495
|
+
label?: string;
|
|
496
|
+
limit?: number;
|
|
497
|
+
offset?: number;
|
|
498
|
+
}): Promise<DiscoveryTaskType[]>;
|
|
499
|
+
/**
|
|
500
|
+
* Fetch intent-task mappings from the discovery GraphQL endpoint (best-effort).
|
|
501
|
+
* Returns [] if the backend does not expose `intentTaskMappings`.
|
|
502
|
+
*/
|
|
503
|
+
intentTaskMappings(params?: {
|
|
504
|
+
intentKey?: string;
|
|
505
|
+
taskKey?: string;
|
|
506
|
+
limit?: number;
|
|
507
|
+
offset?: number;
|
|
508
|
+
}): Promise<DiscoveryIntentTaskMapping[]>;
|
|
509
|
+
searchAgentsAdvanced(options: SearchAgentsAdvancedOptions): Promise<{
|
|
510
|
+
agents: AgentData[];
|
|
511
|
+
total?: number | null;
|
|
512
|
+
} | null>;
|
|
513
|
+
/**
|
|
514
|
+
* Search agents using the strongly-typed AgentWhereInput / searchAgentsGraph API.
|
|
515
|
+
* This is tailored to the indexer schema that exposes AgentWhereInput and
|
|
516
|
+
* searchAgentsGraph(where:, first:, skip:, orderBy:, orderDirection:).
|
|
517
|
+
*/
|
|
518
|
+
searchAgentsGraph(options: {
|
|
519
|
+
where?: Record<string, unknown>;
|
|
520
|
+
first?: number;
|
|
521
|
+
skip?: number;
|
|
522
|
+
orderBy?: 'agentId' | 'agentName' | 'createdAtTime' | 'createdAtBlock' | 'agentIdentityOwnerAccount' | 'eoaAgentIdentityOwnerAccount' | 'eoaAgentAccount' | 'agentCategory' | 'trustLedgerScore' | 'trustLedgerBadgeCount' | 'trustLedgerOverallRank' | 'trustLedgerCapabilityRank';
|
|
523
|
+
orderDirection?: 'ASC' | 'DESC';
|
|
524
|
+
}): Promise<{
|
|
525
|
+
agents: AgentData[];
|
|
526
|
+
total: number;
|
|
527
|
+
hasMore: boolean;
|
|
528
|
+
}>;
|
|
529
|
+
erc8122Registries(params: {
|
|
530
|
+
chainId: number;
|
|
531
|
+
first?: number;
|
|
532
|
+
skip?: number;
|
|
533
|
+
}): Promise<Array<{
|
|
534
|
+
iri?: string | null;
|
|
535
|
+
chainId: number;
|
|
536
|
+
registryAddress: string;
|
|
537
|
+
registrarAddress?: string | null;
|
|
538
|
+
registryName?: string | null;
|
|
539
|
+
registryImplementationAddress?: string | null;
|
|
540
|
+
registrarImplementationAddress?: string | null;
|
|
541
|
+
registeredAgentCount?: number | null;
|
|
542
|
+
lastAgentUpdatedAtTime?: number | null;
|
|
543
|
+
}>>;
|
|
544
|
+
private detectSearchStrategy;
|
|
545
|
+
private buildStrategyFromField;
|
|
546
|
+
private getTypeFields;
|
|
547
|
+
/**
|
|
548
|
+
* Some indexers expose `metadata { key valueText }`, others expose `metadata { key value }`.
|
|
549
|
+
* Introspect once and cache so we can query metadata reliably.
|
|
550
|
+
*/
|
|
551
|
+
private getAgentMetadataValueField;
|
|
552
|
+
/**
|
|
553
|
+
* Get all token metadata from The Graph indexer for an agent
|
|
554
|
+
* Uses agentMetadata_collection (The Graph subgraph) or agentMetadata (custom schema) query
|
|
555
|
+
* to get all metadata key-value pairs. Tries subgraph format first, falls back to custom schema.
|
|
556
|
+
* Handles pagination if an agent has more than 1000 metadata entries
|
|
557
|
+
* @param chainId - Chain ID
|
|
558
|
+
* @param agentId - Agent ID
|
|
559
|
+
* @returns Record of all metadata key-value pairs, or null if not available
|
|
560
|
+
*/
|
|
561
|
+
/**
|
|
562
|
+
* @deprecated Use getAllAgentMetadata instead. This method name is misleading.
|
|
563
|
+
*/
|
|
564
|
+
getTokenMetadata(chainId: number, agentId: number | string): Promise<Record<string, string> | null>;
|
|
565
|
+
/**
|
|
566
|
+
* Get all agent metadata entries from the discovery GraphQL backend.
|
|
567
|
+
* Uses agentMetadata_collection (The Graph subgraph) or agentMetadata (custom schema) query.
|
|
568
|
+
* Tries subgraph format first, falls back to custom schema.
|
|
569
|
+
* Handles pagination if an agent has more than 1000 metadata entries.
|
|
570
|
+
* @param chainId - Chain ID
|
|
571
|
+
* @param agentId - Agent ID
|
|
572
|
+
* @returns Record of all metadata key-value pairs, or null if not available
|
|
573
|
+
*/
|
|
574
|
+
getAllAgentMetadata(chainId: number, agentId: number | string): Promise<Record<string, string> | null>;
|
|
575
|
+
/**
|
|
576
|
+
* Fallback method: Uses agentMetadata query (custom schema format) to get all metadata key-value pairs
|
|
577
|
+
* @param chainId - Chain ID
|
|
578
|
+
* @param agentId - Agent ID
|
|
579
|
+
* @returns Record of all metadata key-value pairs, or null if not available
|
|
580
|
+
*/
|
|
581
|
+
private getTokenMetadataCustomSchema;
|
|
582
|
+
/**
|
|
583
|
+
* Get a single agent by chainId+agentId (convenience).
|
|
584
|
+
* Discovery is UAID-only: builds uaid and calls getAgentByUaid(uaid).
|
|
585
|
+
*/
|
|
586
|
+
getAgent(chainId: number, agentId: number | string): Promise<AgentData | null>;
|
|
587
|
+
getAgentByName(agentName: string): Promise<AgentData | null>;
|
|
588
|
+
/**
|
|
589
|
+
* Resolve a single agent by UAID (KB v2). UAID-only; no fallback to chainId/agentId.
|
|
590
|
+
*/
|
|
591
|
+
getAgentByUaid(uaid: string): Promise<AgentData | null>;
|
|
592
|
+
/**
|
|
593
|
+
* Resolve a single agent by UAID including identity/accounts (KB v2). UAID-only; no fallback.
|
|
594
|
+
*/
|
|
595
|
+
getAgentByUaidFull(uaid: string): Promise<AgentData | null>;
|
|
596
|
+
/**
|
|
597
|
+
* Search agents by name
|
|
598
|
+
* @param searchTerm - Search term to match against agent names
|
|
599
|
+
* @param limit - Maximum number of results
|
|
600
|
+
* @returns List of matching agents
|
|
601
|
+
*/
|
|
602
|
+
searchAgents(searchTerm: string, limit?: number): Promise<AgentData[]>;
|
|
603
|
+
/**
|
|
604
|
+
* Refresh/Index an agent in the indexer
|
|
605
|
+
* Triggers the indexer to re-index the specified agent
|
|
606
|
+
* @param agentId - Agent ID to refresh (required)
|
|
607
|
+
* @param chainId - Optional chain ID (if not provided, indexer may use default)
|
|
608
|
+
* @param apiKey - Optional API key override (uses config API key if not provided)
|
|
609
|
+
* @returns Refresh result with success status and processed chains
|
|
610
|
+
*/
|
|
611
|
+
refreshAgent(agentId: string | number, chainId?: number, apiKey?: string): Promise<RefreshAgentResponse['indexAgent']>;
|
|
612
|
+
/**
|
|
613
|
+
* Normalize identifier to UAID form required by KB GraphQL.
|
|
614
|
+
*
|
|
615
|
+
* Important: kbAgentByUaid expects the *canonical UAID key* (prefix up to the first ';').
|
|
616
|
+
* Any routing metadata after ';' is not part of the lookup key.
|
|
617
|
+
*/
|
|
618
|
+
private normalizeUaidForKb;
|
|
619
|
+
/**
|
|
620
|
+
* Search validation requests for an agent by UAID (GraphQL kbAgentByUaid + validationAssertions)
|
|
621
|
+
*/
|
|
622
|
+
searchValidationRequestsAdvanced(options: SearchValidationRequestsAdvancedOptions): Promise<{
|
|
623
|
+
validationRequests: ValidationRequestData[];
|
|
624
|
+
} | null>;
|
|
625
|
+
/**
|
|
626
|
+
* Search reviews for an agent by UAID (GraphQL kbAgentByUaid + reviewAssertions)
|
|
627
|
+
*/
|
|
628
|
+
searchReviewsAdvanced(options: SearchReviewsAdvancedOptions): Promise<{
|
|
629
|
+
reviews: ReviewData[];
|
|
630
|
+
} | null>;
|
|
631
|
+
/**
|
|
632
|
+
* Search feedback/reviews for an agent (UAID or legacy chainId+agentId). Prefer searchReviewsAdvanced(uaid).
|
|
633
|
+
*/
|
|
634
|
+
searchFeedbackAdvanced(options: SearchFeedbackAdvancedOptions): Promise<{
|
|
635
|
+
feedbacks: FeedbackData[];
|
|
636
|
+
} | null>;
|
|
637
|
+
/**
|
|
638
|
+
* Execute a raw GraphQL query
|
|
639
|
+
* @param query - GraphQL query string
|
|
640
|
+
* @param variables - Query variables
|
|
641
|
+
* @returns Query response
|
|
642
|
+
*/
|
|
643
|
+
request<T = any>(query: string, variables?: Record<string, any>): Promise<T>;
|
|
644
|
+
/**
|
|
645
|
+
* Execute a raw GraphQL mutation
|
|
646
|
+
* @param mutation - GraphQL mutation string
|
|
647
|
+
* @param variables - Mutation variables
|
|
648
|
+
* @returns Mutation response
|
|
649
|
+
*/
|
|
650
|
+
mutate<T = any>(mutation: string, variables?: Record<string, any>): Promise<T>;
|
|
651
|
+
/**
|
|
652
|
+
* Get the underlying GraphQLClient instance
|
|
653
|
+
* @returns The GraphQLClient instance
|
|
654
|
+
*/
|
|
655
|
+
getClient(): GraphQLClient;
|
|
656
|
+
/**
|
|
657
|
+
* Get agents owned by a specific EOA address
|
|
658
|
+
* @param eoaAddress - The EOA (Externally Owned Account) address to search for
|
|
659
|
+
* @param options - Optional search options (limit, offset, orderBy, orderDirection)
|
|
660
|
+
* @returns List of agents owned by the EOA address
|
|
661
|
+
*/
|
|
662
|
+
getOwnedAgents(eoaAddress: string, options?: {
|
|
663
|
+
limit?: number;
|
|
664
|
+
offset?: number;
|
|
665
|
+
orderBy?: 'agentId' | 'agentName' | 'createdAtTime' | 'createdAtBlock' | 'agentIdentityOwnerAccount' | 'eoaAgentIdentityOwnerAccount' | 'eoaAgentAccount' | 'agentCategory' | 'trustLedgerScore' | 'trustLedgerBadgeCount' | 'trustLedgerOverallRank' | 'trustLedgerCapabilityRank';
|
|
666
|
+
orderDirection?: 'ASC' | 'DESC';
|
|
667
|
+
}): Promise<AgentData[]>;
|
|
668
|
+
/**
|
|
669
|
+
* UAID-native ownership check (KB v2).
|
|
670
|
+
*/
|
|
671
|
+
isOwnerByUaid(uaid: string, walletAddress: string): Promise<boolean>;
|
|
672
|
+
}
|
|
673
|
+
//# sourceMappingURL=AIAgentDiscoveryClient.d.ts.map
|