@hashgraphonline/standards-sdk 0.1.143-feat-solana-register.canary.74a004d.74 → 0.1.143-feat-solana-register.canary.5634c6d.76

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.
Files changed (124) hide show
  1. package/dist/cjs/hcs-10/base-client.d.ts.map +1 -1
  2. package/dist/cjs/hcs-16/tx.d.ts +1 -1
  3. package/dist/cjs/hcs-16/tx.d.ts.map +1 -1
  4. package/dist/cjs/services/registry-broker/client/base-client.d.ts +14 -1
  5. package/dist/cjs/services/registry-broker/client/base-client.d.ts.map +1 -1
  6. package/dist/cjs/services/registry-broker/client/feedback.d.ts +9 -0
  7. package/dist/cjs/services/registry-broker/client/feedback.d.ts.map +1 -0
  8. package/dist/cjs/services/registry-broker/client.d.ts +1 -0
  9. package/dist/cjs/services/registry-broker/client.d.ts.map +1 -1
  10. package/dist/cjs/services/registry-broker/schemas.d.ts +731 -310
  11. package/dist/cjs/services/registry-broker/schemas.d.ts.map +1 -1
  12. package/dist/cjs/services/registry-broker/types.d.ts +20 -1
  13. package/dist/cjs/services/registry-broker/types.d.ts.map +1 -1
  14. package/dist/cjs/standards-sdk.cjs +2 -2
  15. package/dist/cjs/standards-sdk.cjs.map +1 -1
  16. package/dist/es/hcs-10/base-client.d.ts.map +1 -1
  17. package/dist/es/hcs-16/tx.d.ts +1 -1
  18. package/dist/es/hcs-16/tx.d.ts.map +1 -1
  19. package/dist/es/services/registry-broker/client/base-client.d.ts +14 -1
  20. package/dist/es/services/registry-broker/client/base-client.d.ts.map +1 -1
  21. package/dist/es/services/registry-broker/client/feedback.d.ts +9 -0
  22. package/dist/es/services/registry-broker/client/feedback.d.ts.map +1 -0
  23. package/dist/es/services/registry-broker/client.d.ts +1 -0
  24. package/dist/es/services/registry-broker/client.d.ts.map +1 -1
  25. package/dist/es/services/registry-broker/schemas.d.ts +731 -310
  26. package/dist/es/services/registry-broker/schemas.d.ts.map +1 -1
  27. package/dist/es/services/registry-broker/types.d.ts +20 -1
  28. package/dist/es/services/registry-broker/types.d.ts.map +1 -1
  29. package/dist/es/standards-sdk.es.js +10 -8
  30. package/dist/es/standards-sdk.es.js.map +1 -1
  31. package/dist/es/standards-sdk.es110.js +2 -1
  32. package/dist/es/standards-sdk.es110.js.map +1 -1
  33. package/dist/es/standards-sdk.es111.js +5 -5
  34. package/dist/es/standards-sdk.es121.js +1 -1
  35. package/dist/es/standards-sdk.es122.js +1 -1
  36. package/dist/es/standards-sdk.es123.js +5 -5
  37. package/dist/es/standards-sdk.es125.js +1 -1
  38. package/dist/es/standards-sdk.es126.js +1 -1
  39. package/dist/es/standards-sdk.es128.js +3 -3
  40. package/dist/es/standards-sdk.es129.js +4 -4
  41. package/dist/es/standards-sdk.es130.js +3 -3
  42. package/dist/es/standards-sdk.es131.js +4 -4
  43. package/dist/es/standards-sdk.es132.js +4 -4
  44. package/dist/es/standards-sdk.es133.js +4 -4
  45. package/dist/es/standards-sdk.es134.js +2 -2
  46. package/dist/es/standards-sdk.es135.js +4 -4
  47. package/dist/es/standards-sdk.es136.js +8 -366
  48. package/dist/es/standards-sdk.es136.js.map +1 -1
  49. package/dist/es/standards-sdk.es137.js +461 -14
  50. package/dist/es/standards-sdk.es137.js.map +1 -1
  51. package/dist/es/standards-sdk.es138.js +15 -79
  52. package/dist/es/standards-sdk.es138.js.map +1 -1
  53. package/dist/es/standards-sdk.es139.js +71 -77
  54. package/dist/es/standards-sdk.es139.js.map +1 -1
  55. package/dist/es/standards-sdk.es140.js +80 -152
  56. package/dist/es/standards-sdk.es140.js.map +1 -1
  57. package/dist/es/standards-sdk.es141.js +159 -7
  58. package/dist/es/standards-sdk.es141.js.map +1 -1
  59. package/dist/es/standards-sdk.es142.js +7 -86
  60. package/dist/es/standards-sdk.es142.js.map +1 -1
  61. package/dist/es/standards-sdk.es143.js +64 -43
  62. package/dist/es/standards-sdk.es143.js.map +1 -1
  63. package/dist/es/standards-sdk.es144.js +65 -30
  64. package/dist/es/standards-sdk.es144.js.map +1 -1
  65. package/dist/es/standards-sdk.es145.js +30 -34
  66. package/dist/es/standards-sdk.es145.js.map +1 -1
  67. package/dist/es/standards-sdk.es146.js +34 -28
  68. package/dist/es/standards-sdk.es146.js.map +1 -1
  69. package/dist/es/standards-sdk.es147.js +28 -12289
  70. package/dist/es/standards-sdk.es147.js.map +1 -1
  71. package/dist/es/standards-sdk.es150.js +12250 -133
  72. package/dist/es/standards-sdk.es150.js.map +1 -1
  73. package/dist/es/standards-sdk.es151.js +958 -322
  74. package/dist/es/standards-sdk.es151.js.map +1 -1
  75. package/dist/es/standards-sdk.es152.js +13 -342
  76. package/dist/es/standards-sdk.es152.js.map +1 -1
  77. package/dist/es/standards-sdk.es153.js +129 -410
  78. package/dist/es/standards-sdk.es153.js.map +1 -1
  79. package/dist/es/standards-sdk.es154.js +200 -209
  80. package/dist/es/standards-sdk.es154.js.map +1 -1
  81. package/dist/es/standards-sdk.es155.js +334 -64
  82. package/dist/es/standards-sdk.es155.js.map +1 -1
  83. package/dist/es/standards-sdk.es156.js +449 -13
  84. package/dist/es/standards-sdk.es156.js.map +1 -1
  85. package/dist/es/standards-sdk.es157.js +330 -55
  86. package/dist/es/standards-sdk.es157.js.map +1 -1
  87. package/dist/es/standards-sdk.es158.js +60 -66
  88. package/dist/es/standards-sdk.es158.js.map +1 -1
  89. package/dist/es/standards-sdk.es159.js +56 -871
  90. package/dist/es/standards-sdk.es159.js.map +1 -1
  91. package/dist/es/standards-sdk.es160.js +65 -222
  92. package/dist/es/standards-sdk.es160.js.map +1 -1
  93. package/dist/es/standards-sdk.es161.js +218 -223
  94. package/dist/es/standards-sdk.es161.js.map +1 -1
  95. package/dist/es/standards-sdk.es162.js +247 -0
  96. package/dist/es/standards-sdk.es162.js.map +1 -0
  97. package/dist/es/standards-sdk.es17.js +2 -1
  98. package/dist/es/standards-sdk.es17.js.map +1 -1
  99. package/dist/es/standards-sdk.es19.js +3 -2
  100. package/dist/es/standards-sdk.es19.js.map +1 -1
  101. package/dist/es/standards-sdk.es20.js +3 -2
  102. package/dist/es/standards-sdk.es20.js.map +1 -1
  103. package/dist/es/standards-sdk.es28.js +4 -3
  104. package/dist/es/standards-sdk.es28.js.map +1 -1
  105. package/dist/es/standards-sdk.es31.js +1 -1
  106. package/dist/es/standards-sdk.es32.js +1 -1
  107. package/dist/es/standards-sdk.es36.js +3 -2
  108. package/dist/es/standards-sdk.es36.js.map +1 -1
  109. package/dist/es/standards-sdk.es37.js +1 -1
  110. package/dist/es/standards-sdk.es38.js +1 -1
  111. package/dist/es/standards-sdk.es57.js +1 -1
  112. package/dist/es/standards-sdk.es59.js +1 -1
  113. package/dist/es/standards-sdk.es60.js +1 -1
  114. package/dist/es/standards-sdk.es61.js +2 -1
  115. package/dist/es/standards-sdk.es61.js.map +1 -1
  116. package/dist/es/standards-sdk.es63.js +1 -1
  117. package/dist/es/standards-sdk.es65.js +1 -1
  118. package/dist/es/standards-sdk.es66.js +1 -1
  119. package/dist/es/standards-sdk.es78.js +2 -1
  120. package/dist/es/standards-sdk.es78.js.map +1 -1
  121. package/dist/es/standards-sdk.es88.js +2 -2
  122. package/dist/es/standards-sdk.es92.js +1 -1
  123. package/dist/es/standards-sdk.es92.js.map +1 -1
  124. package/package.json +1 -1
@@ -1,325 +1,961 @@
1
- import { proto } from "@hashgraph/proto";
2
- import { Long } from "@hashgraph/sdk";
3
- import { hasTransactionType, parseKey } from "./standards-sdk.es155.js";
4
- import { Buffer } from "buffer";
5
- class FileParser {
6
- /**
7
- * Parse File Service transaction using unified dual-branch approach
8
- * This handles both regular transactions and signed transaction variants
9
- */
10
- static parseFileTransaction(transaction, originalBytes) {
11
- try {
12
- if (originalBytes || transaction.toBytes) {
13
- try {
14
- const bytesToParse = originalBytes || transaction.toBytes();
15
- const decoded = proto.TransactionList.decode(bytesToParse);
16
- if (decoded.transactionList && decoded.transactionList.length > 0) {
17
- const tx = decoded.transactionList[0];
18
- let txBody = null;
19
- if (tx.bodyBytes && tx.bodyBytes.length > 0) {
20
- txBody = proto.TransactionBody.decode(tx.bodyBytes);
21
- } else if (tx.signedTransactionBytes && tx.signedTransactionBytes.length > 0) {
22
- const signedTx = proto.SignedTransaction.decode(
23
- tx.signedTransactionBytes
24
- );
25
- if (signedTx.bodyBytes) {
26
- txBody = proto.TransactionBody.decode(signedTx.bodyBytes);
27
- }
28
- }
29
- if (txBody) {
30
- const protoResult = this.parseFromProtobufTxBody(txBody);
31
- if (protoResult.type && protoResult.type !== "UNKNOWN") {
32
- return protoResult;
33
- }
34
- }
35
- }
36
- } catch (protoError) {
37
- }
38
- }
39
- return this.parseFromTransactionInternals(transaction);
40
- } catch (error) {
41
- return { type: "UNKNOWN", humanReadableType: "Unknown File Transaction" };
42
- }
43
- }
44
- /**
45
- * Parse file transaction from protobuf TransactionBody
46
- * Handles all file operations from decoded protobuf data
47
- */
48
- static parseFromProtobufTxBody(txBody) {
49
- if (txBody.fileCreate) {
50
- const fileCreate = this.parseFileCreate(txBody.fileCreate);
51
- if (fileCreate) {
52
- return {
53
- type: "FILECREATE",
54
- humanReadableType: "File Create",
55
- fileCreate
56
- };
57
- }
58
- }
59
- if (txBody.fileAppend) {
60
- const fileAppend = this.parseFileAppend(txBody.fileAppend);
61
- if (fileAppend) {
62
- return {
63
- type: "FILEAPPEND",
64
- humanReadableType: "File Append",
65
- fileAppend
66
- };
67
- }
68
- }
69
- if (txBody.fileUpdate) {
70
- const fileUpdate = this.parseFileUpdate(txBody.fileUpdate);
71
- if (fileUpdate) {
72
- return {
73
- type: "FILEUPDATE",
74
- humanReadableType: "File Update",
75
- fileUpdate
76
- };
77
- }
78
- }
79
- if (txBody.fileDelete) {
80
- const fileDelete = this.parseFileDelete(txBody.fileDelete);
81
- if (fileDelete) {
82
- return {
83
- type: "FILEDELETE",
84
- humanReadableType: "File Delete",
85
- fileDelete
86
- };
87
- }
88
- }
89
- return {};
90
- }
91
- /**
92
- * Extract file data from Transaction internal fields
93
- * This handles cases where data is stored in Transaction object internals
94
- */
95
- static parseFromTransactionInternals(transaction) {
96
- try {
97
- const tx = transaction;
98
- if (hasTransactionType(transaction, "fileCreate")) {
99
- const fileCreate = {};
100
- if (tx._contents) {
101
- const contentInfo = this.analyzeContent(tx._contents);
102
- fileCreate.contents = contentInfo.encoded;
103
- if (contentInfo.contentType) {
104
- fileCreate.contentType = contentInfo.contentType;
105
- }
106
- if (contentInfo.size) {
107
- fileCreate.contentSize = contentInfo.size;
108
- }
109
- }
110
- if (tx._keys && tx._keys.length > 0) {
111
- const keyList = {
112
- keys: tx._keys
113
- };
114
- fileCreate.keys = parseKey({ keyList });
115
- }
116
- if (tx._expirationTime) {
117
- fileCreate.expirationTime = tx._expirationTime.toString();
118
- }
119
- if (tx._memo) {
120
- fileCreate.memo = tx._memo;
121
- }
122
- return {
123
- type: "FILECREATE",
124
- humanReadableType: "File Create",
125
- fileCreate
126
- };
127
- }
128
- if (hasTransactionType(transaction, "fileAppend")) {
129
- const fileAppend = {
130
- fileId: tx._fileId.toString()
131
- };
132
- if (tx._contents) {
133
- const contentInfo = this.analyzeContent(tx._contents);
134
- fileAppend.contents = contentInfo.encoded;
135
- if (contentInfo.size) {
136
- fileAppend.contentSize = contentInfo.size;
137
- }
138
- }
139
- return {
140
- type: "FILEAPPEND",
141
- humanReadableType: "File Append",
142
- fileAppend
143
- };
144
- }
145
- if (hasTransactionType(transaction, "fileUpdate")) {
146
- const fileUpdate = {
147
- fileId: tx._fileId.toString()
148
- };
149
- if (tx._contents) {
150
- const contentInfo = this.analyzeContent(tx._contents);
151
- fileUpdate.contents = contentInfo.encoded;
152
- if (contentInfo.size) {
153
- fileUpdate.contentSize = contentInfo.size;
154
- }
155
- }
156
- if (tx._keys && tx._keys.length > 0) {
157
- const keyList = {
158
- keys: tx._keys
159
- };
160
- fileUpdate.keys = parseKey({ keyList });
161
- }
162
- if (tx._expirationTime) {
163
- fileUpdate.expirationTime = tx._expirationTime.toString();
164
- }
165
- if (tx._memo) {
166
- fileUpdate.memo = tx._memo;
167
- }
168
- return {
169
- type: "FILEUPDATE",
170
- humanReadableType: "File Update",
171
- fileUpdate
172
- };
173
- }
174
- if (hasTransactionType(transaction, "fileDelete")) {
175
- const fileDelete = {
176
- fileId: tx._fileId.toString()
177
- };
178
- return {
179
- type: "FILEDELETE",
180
- humanReadableType: "File Delete",
181
- fileDelete
182
- };
183
- }
184
- return {};
185
- } catch (error) {
186
- return {};
187
- }
188
- }
189
- /**
190
- * Enhanced content analysis with type detection and metadata
191
- */
192
- static analyzeContent(contents) {
193
- const size = contents.length;
194
- const contentBuffer = Buffer.from(contents);
195
- let contentType;
196
- if (size >= 4) {
197
- const header = contentBuffer.subarray(0, 4);
198
- const headerHex = header.toString("hex");
199
- const signatures = {
200
- "89504e47": "image/png",
201
- ffd8ffe0: "image/jpeg",
202
- ffd8ffe1: "image/jpeg",
203
- "47494638": "image/gif",
204
- "25504446": "application/pdf",
205
- "504b0304": "application/zip",
206
- "7f454c46": "application/x-executable",
207
- d0cf11e0: "application/msoffice"
208
- };
209
- contentType = signatures[headerHex.toLowerCase()];
210
- }
211
- if (!contentType) {
212
- try {
213
- const textContent = contentBuffer.toString("utf8");
214
- const hasControlChars = /[\x00-\x08\x0B\x0E-\x1F\x7F]/.test(
215
- textContent
216
- );
217
- const hasReplacementChars = textContent.includes("�");
218
- if (!hasControlChars && !hasReplacementChars) {
219
- if (textContent.trim().startsWith("{") && textContent.trim().endsWith("}")) {
220
- contentType = "application/json";
221
- } else if (textContent.includes("<?xml") || textContent.includes("<html")) {
222
- contentType = "text/xml";
223
- } else if (textContent.includes("<!DOCTYPE html")) {
224
- contentType = "text/html";
225
- } else {
226
- contentType = "text/plain";
227
- }
228
- } else {
229
- contentType = "application/octet-stream";
230
- }
231
- } catch {
232
- contentType = "application/octet-stream";
233
- }
234
- }
235
- let encoded;
236
- if (contentType?.startsWith("text/") || contentType === "application/json") {
237
- try {
238
- encoded = contentBuffer.toString("utf8");
239
- if (encoded.includes("�") || /[\x00-\x08\x0B\x0E-\x1F\x7F]/.test(encoded)) {
240
- encoded = contentBuffer.toString("base64");
241
- }
242
- } catch {
243
- encoded = contentBuffer.toString("base64");
244
- }
245
- } else {
246
- encoded = contentBuffer.toString("base64");
247
- }
248
- return {
249
- encoded,
250
- contentType,
251
- size
252
- };
253
- }
254
- static parseFileCreate(body) {
255
- if (!body) return void 0;
256
- const data = {};
257
- if (body.expirationTime?.seconds) {
258
- data.expirationTime = `${Long.fromValue(
259
- body.expirationTime.seconds
260
- ).toString()}.${body.expirationTime.nanos}`;
261
- }
262
- if (body.keys) {
263
- data.keys = parseKey({ keyList: body.keys });
264
- }
265
- if (body.contents) {
266
- data.contents = Buffer.from(body.contents).toString("base64");
267
- }
268
- if (body.memo) {
269
- data.memo = body.memo;
270
- }
271
- return data;
272
- }
273
- static parseFileAppend(body) {
274
- if (!body) return void 0;
275
- const data = {};
276
- if (body.fileID) {
277
- data.fileId = `${body.fileID.shardNum ?? 0}.${body.fileID.realmNum ?? 0}.${body.fileID.fileNum ?? 0}`;
278
- }
279
- if (body.contents) {
280
- data.contents = Buffer.from(body.contents).toString("base64");
281
- }
282
- return data;
283
- }
284
- static parseFileUpdate(body) {
285
- if (!body) return void 0;
286
- const data = {};
287
- if (body.fileID) {
288
- data.fileId = `${body.fileID.shardNum ?? 0}.${body.fileID.realmNum ?? 0}.${body.fileID.fileNum ?? 0}`;
289
- }
290
- if (body.expirationTime?.seconds) {
291
- data.expirationTime = `${Long.fromValue(
292
- body.expirationTime.seconds
293
- ).toString()}.${body.expirationTime.nanos}`;
294
- }
295
- if (body.keys) {
296
- data.keys = parseKey({ keyList: body.keys });
297
- }
298
- if (body.contents) {
299
- data.contents = Buffer.from(body.contents).toString("base64");
300
- }
301
- if (body.memo?.value !== void 0) {
302
- data.memo = body.memo.value;
303
- }
304
- return data;
305
- }
306
- static parseFileDelete(body) {
307
- if (!body) return void 0;
308
- const data = {};
309
- if (body.fileID) {
310
- data.fileId = `${body.fileID.shardNum ?? 0}.${body.fileID.realmNum ?? 0}.${body.fileID.fileNum ?? 0}`;
311
- }
312
- return data;
313
- }
314
- /**
315
- * Parse File Service transaction from Transaction object
316
- * This is the unified entry point that delegates to the comprehensive parsing logic
317
- */
318
- static parseFromTransactionObject(transaction) {
319
- return this.parseFileTransaction(transaction);
320
- }
321
- }
1
+ import { z } from "zod";
2
+ import { adapterDeclarationSchema } from "./standards-sdk.es80.js";
3
+ var AIAgentType = /* @__PURE__ */ ((AIAgentType2) => {
4
+ AIAgentType2[AIAgentType2["MANUAL"] = 0] = "MANUAL";
5
+ AIAgentType2[AIAgentType2["AUTONOMOUS"] = 1] = "AUTONOMOUS";
6
+ return AIAgentType2;
7
+ })(AIAgentType || {});
8
+ var AIAgentCapability = /* @__PURE__ */ ((AIAgentCapability2) => {
9
+ AIAgentCapability2[AIAgentCapability2["TEXT_GENERATION"] = 0] = "TEXT_GENERATION";
10
+ AIAgentCapability2[AIAgentCapability2["IMAGE_GENERATION"] = 1] = "IMAGE_GENERATION";
11
+ AIAgentCapability2[AIAgentCapability2["AUDIO_GENERATION"] = 2] = "AUDIO_GENERATION";
12
+ AIAgentCapability2[AIAgentCapability2["VIDEO_GENERATION"] = 3] = "VIDEO_GENERATION";
13
+ AIAgentCapability2[AIAgentCapability2["CODE_GENERATION"] = 4] = "CODE_GENERATION";
14
+ AIAgentCapability2[AIAgentCapability2["LANGUAGE_TRANSLATION"] = 5] = "LANGUAGE_TRANSLATION";
15
+ AIAgentCapability2[AIAgentCapability2["SUMMARIZATION_EXTRACTION"] = 6] = "SUMMARIZATION_EXTRACTION";
16
+ AIAgentCapability2[AIAgentCapability2["KNOWLEDGE_RETRIEVAL"] = 7] = "KNOWLEDGE_RETRIEVAL";
17
+ AIAgentCapability2[AIAgentCapability2["DATA_INTEGRATION"] = 8] = "DATA_INTEGRATION";
18
+ AIAgentCapability2[AIAgentCapability2["MARKET_INTELLIGENCE"] = 9] = "MARKET_INTELLIGENCE";
19
+ AIAgentCapability2[AIAgentCapability2["TRANSACTION_ANALYTICS"] = 10] = "TRANSACTION_ANALYTICS";
20
+ AIAgentCapability2[AIAgentCapability2["SMART_CONTRACT_AUDIT"] = 11] = "SMART_CONTRACT_AUDIT";
21
+ AIAgentCapability2[AIAgentCapability2["GOVERNANCE_FACILITATION"] = 12] = "GOVERNANCE_FACILITATION";
22
+ AIAgentCapability2[AIAgentCapability2["SECURITY_MONITORING"] = 13] = "SECURITY_MONITORING";
23
+ AIAgentCapability2[AIAgentCapability2["COMPLIANCE_ANALYSIS"] = 14] = "COMPLIANCE_ANALYSIS";
24
+ AIAgentCapability2[AIAgentCapability2["FRAUD_DETECTION"] = 15] = "FRAUD_DETECTION";
25
+ AIAgentCapability2[AIAgentCapability2["MULTI_AGENT_COORDINATION"] = 16] = "MULTI_AGENT_COORDINATION";
26
+ AIAgentCapability2[AIAgentCapability2["API_INTEGRATION"] = 17] = "API_INTEGRATION";
27
+ AIAgentCapability2[AIAgentCapability2["WORKFLOW_AUTOMATION"] = 18] = "WORKFLOW_AUTOMATION";
28
+ return AIAgentCapability2;
29
+ })(AIAgentCapability || {});
30
+ const capabilitySchema = z.nativeEnum(AIAgentCapability);
31
+ const capabilityValueSchema = z.union([z.number(), z.string()]);
32
+ const jsonPrimitiveSchema = z.union([
33
+ z.string(),
34
+ z.number(),
35
+ z.boolean(),
36
+ z.null()
37
+ ]);
38
+ const jsonValueSchema = z.lazy(
39
+ () => z.union([
40
+ jsonPrimitiveSchema,
41
+ z.array(jsonValueSchema),
42
+ z.record(jsonValueSchema)
43
+ ])
44
+ );
45
+ const agentProfileSchema = z.object({
46
+ version: z.string(),
47
+ type: z.number(),
48
+ display_name: z.string(),
49
+ alias: z.string().optional(),
50
+ bio: z.string().optional(),
51
+ socials: z.array(jsonValueSchema).optional(),
52
+ aiAgent: z.object({
53
+ type: z.nativeEnum(AIAgentType),
54
+ creator: z.string().optional(),
55
+ model: z.string().optional(),
56
+ capabilities: z.array(z.union([capabilitySchema, z.number()])).optional()
57
+ }).optional(),
58
+ uaid: z.string().optional()
59
+ }).catchall(jsonValueSchema);
60
+ const cipherEnvelopeRecipientSchema = z.object({
61
+ uaid: z.string().optional(),
62
+ ledgerAccountId: z.string().optional(),
63
+ userId: z.string().optional(),
64
+ email: z.string().optional(),
65
+ encryptedShare: z.string()
66
+ });
67
+ const cipherEnvelopeSchema = z.object({
68
+ algorithm: z.string(),
69
+ ciphertext: z.string(),
70
+ nonce: z.string(),
71
+ associatedData: z.string().optional(),
72
+ keyLocator: z.object({
73
+ sessionId: z.string().optional(),
74
+ revision: z.number().optional()
75
+ }).optional(),
76
+ recipients: z.array(cipherEnvelopeRecipientSchema)
77
+ });
78
+ const peerSummarySchema = z.object({
79
+ keyType: z.string(),
80
+ publicKey: z.string(),
81
+ uaid: z.string().optional(),
82
+ ledgerAccountId: z.string().optional(),
83
+ userId: z.string().optional(),
84
+ email: z.string().optional()
85
+ });
86
+ const handshakeParticipantSchema = z.object({
87
+ role: z.enum(["requester", "responder"]),
88
+ uaid: z.string().optional(),
89
+ userId: z.string().optional(),
90
+ ledgerAccountId: z.string().optional(),
91
+ keyType: z.string(),
92
+ longTermPublicKey: z.string().optional(),
93
+ ephemeralPublicKey: z.string(),
94
+ signature: z.string().optional(),
95
+ metadata: z.record(jsonValueSchema).optional(),
96
+ submittedAt: z.string()
97
+ });
98
+ const encryptionHandshakeRecordSchema = z.object({
99
+ sessionId: z.string(),
100
+ algorithm: z.string(),
101
+ createdAt: z.string(),
102
+ expiresAt: z.number(),
103
+ status: z.enum(["pending", "complete"]),
104
+ requester: handshakeParticipantSchema.optional(),
105
+ responder: handshakeParticipantSchema.optional()
106
+ });
107
+ const sessionEncryptionSummarySchema = z.object({
108
+ enabled: z.boolean(),
109
+ algorithm: z.string(),
110
+ requireCiphertext: z.boolean(),
111
+ requester: peerSummarySchema.nullable().optional(),
112
+ responder: peerSummarySchema.nullable().optional(),
113
+ handshake: encryptionHandshakeRecordSchema.nullable().optional()
114
+ });
115
+ const chatHistoryEntrySchema = z.object({
116
+ messageId: z.string(),
117
+ role: z.enum(["user", "agent"]),
118
+ content: z.string(),
119
+ timestamp: z.string(),
120
+ cipherEnvelope: cipherEnvelopeSchema.optional(),
121
+ metadata: z.record(jsonValueSchema).optional()
122
+ });
123
+ const metadataFacetSchema = z.record(
124
+ z.union([
125
+ z.array(jsonValueSchema),
126
+ z.record(jsonValueSchema),
127
+ jsonValueSchema
128
+ ])
129
+ ).optional();
130
+ const searchHitSchema = z.object({
131
+ id: z.string(),
132
+ uaid: z.string(),
133
+ registry: z.string(),
134
+ name: z.string(),
135
+ description: z.string().optional(),
136
+ capabilities: z.array(capabilityValueSchema),
137
+ endpoints: z.union([z.record(jsonValueSchema), z.array(z.string())]).optional(),
138
+ metadata: z.record(jsonValueSchema).optional(),
139
+ metadataFacet: metadataFacetSchema,
140
+ profile: agentProfileSchema.optional(),
141
+ protocols: z.array(z.string()).optional(),
142
+ adapter: z.string().optional(),
143
+ originalId: z.string().optional(),
144
+ communicationSupported: z.boolean().optional(),
145
+ routingSupported: z.boolean().optional(),
146
+ available: z.boolean().optional(),
147
+ availabilityStatus: z.string().optional(),
148
+ availabilityCheckedAt: z.string().optional(),
149
+ availabilitySource: z.string().optional(),
150
+ availabilityLatencyMs: z.number().optional(),
151
+ availabilityScore: z.number().optional(),
152
+ capabilityLabels: z.array(z.string()).optional(),
153
+ capabilityTokens: z.array(z.string()).optional(),
154
+ image: z.string().optional(),
155
+ createdAt: z.string().optional(),
156
+ updatedAt: z.string().optional(),
157
+ lastSeen: z.string().optional(),
158
+ lastIndexed: z.string().optional()
159
+ }).passthrough();
160
+ const searchResponseSchema = z.object({
161
+ hits: z.array(searchHitSchema),
162
+ total: z.number(),
163
+ page: z.number(),
164
+ limit: z.number()
165
+ });
166
+ const statsResponseSchema = z.object({
167
+ totalAgents: z.number(),
168
+ registries: z.record(z.number()),
169
+ capabilities: z.record(z.number()),
170
+ lastUpdate: z.string(),
171
+ status: z.string()
172
+ });
173
+ const registriesResponseSchema = z.object({
174
+ registries: z.array(z.string())
175
+ });
176
+ const popularResponseSchema = z.object({
177
+ searches: z.array(z.string())
178
+ });
179
+ const resolveResponseSchema = z.object({
180
+ agent: searchHitSchema
181
+ });
182
+ const agentFeedbackSummarySchema = z.object({
183
+ averageScore: z.number(),
184
+ totalFeedbacks: z.number(),
185
+ registry: z.string().optional(),
186
+ network: z.string().optional(),
187
+ updatedAt: z.string().optional()
188
+ });
189
+ const agentFeedbackEntrySchema = z.object({
190
+ registry: z.string(),
191
+ network: z.string().optional(),
192
+ agentId: z.number(),
193
+ client: z.string(),
194
+ score: z.number(),
195
+ tag1: z.string().nullable().optional(),
196
+ tag2: z.string().nullable().optional(),
197
+ revoked: z.boolean(),
198
+ feedbackIndex: z.number().nullable().optional(),
199
+ fileUri: z.string().nullable().optional(),
200
+ fileHash: z.string().nullable().optional(),
201
+ createdAt: z.string().nullable().optional()
202
+ });
203
+ const agentFeedbackResponseSchema = z.object({
204
+ uaid: z.string(),
205
+ summary: agentFeedbackSummarySchema,
206
+ entries: z.array(agentFeedbackEntrySchema)
207
+ });
208
+ const agentFeedbackEligibilityResponseSchema = z.object({
209
+ uaid: z.string(),
210
+ sessionId: z.string(),
211
+ eligible: z.boolean(),
212
+ messageCount: z.number(),
213
+ minimumMessages: z.number(),
214
+ reason: z.string().optional(),
215
+ onchain: z.object({
216
+ eligible: z.boolean(),
217
+ reason: z.string().optional(),
218
+ estimatedCredits: z.number().optional(),
219
+ usdEstimate: z.number().optional(),
220
+ nativeFeeEstimate: z.number().optional()
221
+ }).optional()
222
+ });
223
+ const agentFeedbackSubmissionResponseSchema = z.object({
224
+ uaid: z.string(),
225
+ registry: z.string(),
226
+ network: z.string().optional(),
227
+ agentId: z.number(),
228
+ score: z.number(),
229
+ tag1: z.string().nullable().optional(),
230
+ tag2: z.string().nullable().optional(),
231
+ fileUri: z.string().nullable().optional(),
232
+ fileHash: z.string().nullable().optional(),
233
+ feedbackIndex: z.number().nullable().optional(),
234
+ transactionHash: z.string().nullable().optional(),
235
+ signature: z.string().nullable().optional(),
236
+ submittedAt: z.string()
237
+ });
238
+ const agentFeedbackIndexResponseSchema = z.object({
239
+ page: z.number(),
240
+ limit: z.number(),
241
+ total: z.number(),
242
+ items: z.array(
243
+ z.object({
244
+ uaid: z.string(),
245
+ registry: z.string(),
246
+ network: z.string().optional(),
247
+ agentId: z.number().nullable().optional(),
248
+ summary: agentFeedbackSummarySchema.nullable(),
249
+ trustScore: z.number().nullable().optional()
250
+ })
251
+ )
252
+ });
253
+ const agentFeedbackEntriesIndexResponseSchema = z.object({
254
+ page: z.number(),
255
+ limit: z.number(),
256
+ total: z.number(),
257
+ items: z.array(
258
+ z.object({
259
+ uaid: z.string(),
260
+ entry: agentFeedbackEntrySchema
261
+ })
262
+ )
263
+ });
264
+ const createSessionResponseSchema = z.object({
265
+ sessionId: z.string(),
266
+ uaid: z.string().nullable().optional(),
267
+ agent: z.object({
268
+ name: z.string(),
269
+ description: z.string().optional(),
270
+ capabilities: z.record(jsonValueSchema).nullable().optional(),
271
+ skills: z.array(z.string()).optional()
272
+ }),
273
+ history: z.array(chatHistoryEntrySchema).optional().default([]),
274
+ historyTtlSeconds: z.number().nullable().optional(),
275
+ encryption: sessionEncryptionSummarySchema.nullable().optional()
276
+ });
277
+ const sendMessageResponseSchema = z.object({
278
+ sessionId: z.string(),
279
+ uaid: z.string().nullable().optional(),
280
+ message: z.string(),
281
+ timestamp: z.string(),
282
+ rawResponse: jsonValueSchema.optional(),
283
+ content: z.string().optional(),
284
+ history: z.array(chatHistoryEntrySchema).optional(),
285
+ historyTtlSeconds: z.number().nullable().optional(),
286
+ encrypted: z.boolean().optional()
287
+ });
288
+ const chatHistorySnapshotResponseSchema = z.object({
289
+ sessionId: z.string(),
290
+ history: z.array(chatHistoryEntrySchema),
291
+ historyTtlSeconds: z.number()
292
+ });
293
+ z.object({
294
+ preserveEntries: z.number().int().min(0).optional()
295
+ }).strict();
296
+ const chatHistoryCompactionResponseSchema = z.object({
297
+ sessionId: z.string(),
298
+ history: z.array(chatHistoryEntrySchema),
299
+ summaryEntry: chatHistoryEntrySchema,
300
+ preservedEntries: z.array(chatHistoryEntrySchema),
301
+ historyTtlSeconds: z.number(),
302
+ creditsDebited: z.number(),
303
+ metadata: z.record(jsonValueSchema).optional()
304
+ });
305
+ const sessionEncryptionStatusResponseSchema = z.object({
306
+ sessionId: z.string(),
307
+ encryption: sessionEncryptionSummarySchema.nullable()
308
+ });
309
+ const encryptionHandshakeResponseSchema = z.object({
310
+ sessionId: z.string(),
311
+ handshake: encryptionHandshakeRecordSchema
312
+ });
313
+ const registerEncryptionKeyResponseSchema = z.object({
314
+ id: z.string(),
315
+ keyType: z.string(),
316
+ publicKey: z.string(),
317
+ uaid: z.string().nullable(),
318
+ ledgerAccountId: z.string().nullable(),
319
+ ledgerNetwork: z.string().nullable().optional(),
320
+ userId: z.string().nullable().optional(),
321
+ email: z.string().nullable().optional(),
322
+ createdAt: z.string(),
323
+ updatedAt: z.string()
324
+ });
325
+ const ledgerChallengeResponseSchema = z.object({
326
+ challengeId: z.string(),
327
+ message: z.string(),
328
+ expiresAt: z.string()
329
+ });
330
+ const ledgerApiKeySummarySchema = z.object({
331
+ id: z.string(),
332
+ label: z.string().optional(),
333
+ prefix: z.string(),
334
+ lastFour: z.string(),
335
+ createdAt: z.string(),
336
+ lastUsedAt: z.string().nullable().optional(),
337
+ ownerType: z.literal("ledger"),
338
+ ledgerAccountId: z.string().optional(),
339
+ ledgerNetwork: z.string().optional(),
340
+ ledgerNetworkCanonical: z.string().optional()
341
+ });
342
+ const ledgerVerifyResponseSchema = z.object({
343
+ key: z.string(),
344
+ apiKey: ledgerApiKeySummarySchema,
345
+ accountId: z.string(),
346
+ network: z.string(),
347
+ networkCanonical: z.string().optional()
348
+ });
349
+ const protocolsResponseSchema = z.object({
350
+ protocols: z.array(z.string())
351
+ });
352
+ const detectProtocolResponseSchema = z.object({
353
+ protocol: z.string().nullable()
354
+ });
355
+ const registrySearchByNamespaceSchema = z.object({
356
+ hits: z.array(searchHitSchema),
357
+ total: z.number(),
358
+ page: z.number().optional(),
359
+ limit: z.number().optional()
360
+ });
361
+ const capabilityFilterValueSchema = z.union([z.string(), z.number()]);
362
+ const vectorSearchFilterSchema = z.object({
363
+ capabilities: z.array(capabilityFilterValueSchema).optional(),
364
+ type: z.enum(["ai-agents", "mcp-servers"]).optional(),
365
+ registry: z.string().optional(),
366
+ protocols: z.array(z.string()).optional(),
367
+ adapter: z.array(z.string()).optional()
368
+ }).strict();
369
+ z.object({
370
+ query: z.string(),
371
+ filter: vectorSearchFilterSchema.optional(),
372
+ limit: z.number().int().min(1).max(100).optional(),
373
+ offset: z.number().int().min(0).optional()
374
+ }).strict();
375
+ const vectorSearchHitSchema = z.object({
376
+ agent: searchHitSchema,
377
+ score: z.number().optional(),
378
+ highlights: z.record(z.array(z.string())).optional()
379
+ });
380
+ const vectorSearchResponseSchema = z.object({
381
+ hits: z.array(vectorSearchHitSchema),
382
+ total: z.number(),
383
+ took: z.number(),
384
+ totalAvailable: z.number().optional(),
385
+ visible: z.number().optional(),
386
+ limited: z.boolean().optional(),
387
+ credits_used: z.number().optional()
388
+ });
389
+ const vectorStatusSchema = z.object({
390
+ enabled: z.boolean(),
391
+ healthy: z.boolean(),
392
+ mode: z.enum(["disabled", "initializing", "healthy", "degraded", "error"]),
393
+ lastUpdated: z.string(),
394
+ details: z.record(z.any()).optional(),
395
+ lastError: z.object({
396
+ message: z.string(),
397
+ stack: z.string().optional(),
398
+ timestamp: z.string().optional()
399
+ }).optional()
400
+ });
401
+ const searchStatusResponseSchema = z.object({
402
+ storageMode: z.string(),
403
+ vectorStatus: vectorStatusSchema
404
+ });
405
+ const websocketStatsResponseSchema = z.object({
406
+ clients: z.number(),
407
+ stats: z.object({
408
+ totalClients: z.number().optional(),
409
+ clientsByRegistry: z.record(z.number()).optional(),
410
+ clientsByEventType: z.record(z.number()).optional()
411
+ }).passthrough()
412
+ });
413
+ const durationStatsSchema = z.object({
414
+ p50: z.number(),
415
+ p90: z.number(),
416
+ p95: z.number(),
417
+ p99: z.number()
418
+ });
419
+ const metricsSummaryResponseSchema = z.object({
420
+ http: z.object({
421
+ requestsTotal: z.number(),
422
+ activeConnections: z.number(),
423
+ requestDuration: durationStatsSchema
424
+ }),
425
+ search: z.object({
426
+ queriesTotal: z.number(),
427
+ queryDuration: durationStatsSchema
428
+ }),
429
+ indexing: z.object({ agentsTotal: z.number(), crawlErrors: z.number() }),
430
+ registration: z.object({
431
+ total: z.number(),
432
+ failures: z.number(),
433
+ duration: durationStatsSchema
434
+ }),
435
+ cache: z.object({
436
+ hits: z.number(),
437
+ misses: z.number(),
438
+ hitRate: z.number()
439
+ }),
440
+ websocket: z.object({ connections: z.number() })
441
+ });
442
+ const uaidValidationResponseSchema = z.object({
443
+ uaid: z.string(),
444
+ valid: z.boolean(),
445
+ formats: z.array(z.string())
446
+ });
447
+ const adapterConnectionSchema = z.object({
448
+ id: z.string(),
449
+ agentId: z.string(),
450
+ protocol: z.string(),
451
+ endpoint: z.string(),
452
+ status: z.enum(["connected", "disconnected", "error"]),
453
+ metadata: z.record(jsonPrimitiveSchema).optional(),
454
+ createdAt: z.string()
455
+ });
456
+ const uaidConnectionStatusSchema = z.object({
457
+ connected: z.boolean(),
458
+ connection: adapterConnectionSchema.optional(),
459
+ adapter: z.string().optional(),
460
+ agentId: z.string().optional()
461
+ });
462
+ const dashboardStatsResponseSchema = z.object({
463
+ operatorId: z.string().optional(),
464
+ adapters: z.array(
465
+ z.object({
466
+ name: z.string(),
467
+ version: z.string(),
468
+ status: z.string(),
469
+ agentCount: z.number(),
470
+ lastDiscovery: z.string(),
471
+ registryType: z.string(),
472
+ health: z.string()
473
+ })
474
+ ).optional(),
475
+ totalAgents: z.number().optional(),
476
+ elasticsearchDocumentCount: z.number().optional(),
477
+ agentsByAdapter: z.record(z.number()).optional(),
478
+ agentsByRegistry: z.record(z.number()).optional(),
479
+ systemInfo: z.object({
480
+ uptime: z.number().optional(),
481
+ version: z.string().optional(),
482
+ network: z.string().optional()
483
+ }).optional()
484
+ });
485
+ const registrationAgentSchema = z.object({
486
+ id: z.string(),
487
+ name: z.string(),
488
+ type: z.string(),
489
+ endpoint: z.string().optional(),
490
+ capabilities: z.array(capabilityValueSchema),
491
+ registry: z.string().optional(),
492
+ protocol: z.string().optional(),
493
+ profile: agentProfileSchema.optional(),
494
+ nativeId: z.string().optional(),
495
+ metadata: z.record(jsonValueSchema).optional()
496
+ });
497
+ const registrationProfileInfoSchema = z.object({
498
+ tId: z.string().nullable(),
499
+ sizeBytes: z.number().optional()
500
+ });
501
+ const profileRegistrySchema = z.object({
502
+ topicId: z.string().optional(),
503
+ sequenceNumber: z.number().optional(),
504
+ profileReference: z.string().optional(),
505
+ profileTopicId: z.string().optional()
506
+ }).passthrough().nullable().optional();
507
+ const additionalRegistryResultSchema = z.object({
508
+ registry: z.string(),
509
+ status: z.enum([
510
+ "created",
511
+ "duplicate",
512
+ "skipped",
513
+ "error",
514
+ "updated",
515
+ "pending"
516
+ ]),
517
+ agentId: z.string().nullable().optional(),
518
+ agentUri: z.string().nullable().optional(),
519
+ error: z.string().optional(),
520
+ metadata: z.record(jsonValueSchema).optional(),
521
+ registryKey: z.string().optional(),
522
+ networkId: z.string().optional(),
523
+ networkName: z.string().optional(),
524
+ chainId: z.number().optional(),
525
+ estimatedCredits: z.number().nullable().optional(),
526
+ gasEstimateCredits: z.number().nullable().optional(),
527
+ gasEstimateUsd: z.number().nullable().optional(),
528
+ gasPriceGwei: z.number().nullable().optional(),
529
+ gasLimit: z.number().nullable().optional(),
530
+ creditMode: z.enum(["fixed", "gas"]).nullable().optional(),
531
+ minCredits: z.number().nullable().optional(),
532
+ consumedCredits: z.number().nullable().optional(),
533
+ cost: z.object({
534
+ credits: z.number(),
535
+ usd: z.number(),
536
+ eth: z.number(),
537
+ gasUsedWei: z.string(),
538
+ effectiveGasPriceWei: z.string().nullable().optional(),
539
+ transactions: z.array(
540
+ z.object({
541
+ hash: z.string(),
542
+ gasUsedWei: z.string(),
543
+ effectiveGasPriceWei: z.string().nullable().optional(),
544
+ costWei: z.string()
545
+ })
546
+ ).optional()
547
+ }).optional()
548
+ });
549
+ const registrationCreditsSchema = z.object({
550
+ base: z.number(),
551
+ additional: z.number(),
552
+ total: z.number()
553
+ });
554
+ const hcs10RegistrySchema = z.object({
555
+ status: z.string(),
556
+ uaid: z.string().optional(),
557
+ transactionId: z.string().optional(),
558
+ consensusTimestamp: z.string().optional(),
559
+ registryTopicId: z.string().optional(),
560
+ topicSequenceNumber: z.number().optional(),
561
+ payloadHash: z.string().optional(),
562
+ profileReference: z.string().optional(),
563
+ tId: z.string().optional(),
564
+ profileSizeBytes: z.number().optional(),
565
+ error: z.string().optional()
566
+ }).passthrough();
567
+ const additionalRegistryNetworkSchema = z.object({
568
+ key: z.string(),
569
+ registryId: z.string().optional(),
570
+ networkId: z.string().optional(),
571
+ name: z.string().optional(),
572
+ chainId: z.number().optional(),
573
+ label: z.string().optional(),
574
+ estimatedCredits: z.number().nullable().optional(),
575
+ baseCredits: z.number().nullable().optional(),
576
+ gasPortionCredits: z.number().nullable().optional(),
577
+ gasPortionUsd: z.number().nullable().optional(),
578
+ gasEstimateCredits: z.number().nullable().optional(),
579
+ gasEstimateUsd: z.number().nullable().optional(),
580
+ gasPriceGwei: z.number().nullable().optional(),
581
+ gasLimit: z.number().nullable().optional(),
582
+ minCredits: z.number().nullable().optional(),
583
+ creditMode: z.string().nullable().optional()
584
+ }).passthrough();
585
+ const additionalRegistryDescriptorSchema = z.object({
586
+ id: z.string(),
587
+ label: z.string(),
588
+ networks: z.array(additionalRegistryNetworkSchema)
589
+ });
590
+ const additionalRegistryCatalogResponseSchema = z.object({
591
+ registries: z.array(additionalRegistryDescriptorSchema)
592
+ });
593
+ const registerAgentSuccessResponse = z.object({
594
+ success: z.literal(true),
595
+ status: z.enum(["created", "duplicate", "updated"]).optional(),
596
+ uaid: z.string(),
597
+ agentId: z.string(),
598
+ message: z.string().optional(),
599
+ registry: z.string().optional(),
600
+ attemptId: z.string().nullable().optional(),
601
+ agent: registrationAgentSchema,
602
+ openConvAI: z.object({
603
+ compatible: z.boolean(),
604
+ hcs11Profile: agentProfileSchema.optional(),
605
+ bridgeEndpoint: z.string().optional()
606
+ }).optional(),
607
+ profile: registrationProfileInfoSchema.optional(),
608
+ profileRegistry: profileRegistrySchema.nullable().optional(),
609
+ hcs10Registry: hcs10RegistrySchema.nullable().optional(),
610
+ credits: registrationCreditsSchema.optional(),
611
+ additionalRegistries: z.array(additionalRegistryResultSchema).optional(),
612
+ additionalRegistryCredits: z.array(additionalRegistryResultSchema).optional(),
613
+ additionalRegistryCostPerRegistry: z.number().optional()
614
+ });
615
+ const registerAgentPendingResponse = z.object({
616
+ success: z.literal(true),
617
+ status: z.literal("pending"),
618
+ message: z.string(),
619
+ uaid: z.string(),
620
+ agentId: z.string(),
621
+ registry: z.string().optional(),
622
+ attemptId: z.string().nullable(),
623
+ agent: registrationAgentSchema,
624
+ openConvAI: z.object({
625
+ compatible: z.boolean(),
626
+ hcs11Profile: agentProfileSchema.optional(),
627
+ bridgeEndpoint: z.string().optional()
628
+ }).optional(),
629
+ profile: registrationProfileInfoSchema.optional(),
630
+ profileRegistry: profileRegistrySchema.nullable().optional(),
631
+ hcs10Registry: hcs10RegistrySchema.nullable().optional(),
632
+ credits: registrationCreditsSchema,
633
+ additionalRegistries: z.array(additionalRegistryResultSchema),
634
+ additionalRegistryCredits: z.array(additionalRegistryResultSchema).optional(),
635
+ additionalRegistryCostPerRegistry: z.number().optional()
636
+ });
637
+ const registerAgentPartialResponse = z.object({
638
+ success: z.literal(false),
639
+ status: z.literal("partial"),
640
+ message: z.string(),
641
+ uaid: z.string(),
642
+ agentId: z.string(),
643
+ registry: z.string().optional(),
644
+ attemptId: z.string().nullable().optional(),
645
+ agent: registrationAgentSchema,
646
+ openConvAI: z.object({
647
+ compatible: z.boolean(),
648
+ hcs11Profile: agentProfileSchema.optional(),
649
+ bridgeEndpoint: z.string().optional()
650
+ }).optional(),
651
+ profile: registrationProfileInfoSchema.optional(),
652
+ profileRegistry: profileRegistrySchema.nullable().optional(),
653
+ hcs10Registry: hcs10RegistrySchema.nullable().optional(),
654
+ credits: registrationCreditsSchema.optional(),
655
+ additionalRegistries: z.array(additionalRegistryResultSchema).optional(),
656
+ additionalRegistryCredits: z.array(additionalRegistryResultSchema).optional(),
657
+ additionalRegistryCostPerRegistry: z.number().optional(),
658
+ errors: z.array(
659
+ z.object({
660
+ registry: z.string(),
661
+ registryKey: z.string().nullable().optional(),
662
+ error: z.string()
663
+ })
664
+ ).min(1)
665
+ });
666
+ const registerAgentResponseSchema = z.union([
667
+ registerAgentSuccessResponse,
668
+ registerAgentPendingResponse,
669
+ registerAgentPartialResponse
670
+ ]);
671
+ const registrationProgressAdditionalEntry = z.object({
672
+ registryId: z.string(),
673
+ registryKey: z.string(),
674
+ networkId: z.string().optional(),
675
+ networkName: z.string().optional(),
676
+ chainId: z.number().optional(),
677
+ label: z.string().optional(),
678
+ status: z.enum(["pending", "in_progress", "completed", "failed"]),
679
+ error: z.string().optional(),
680
+ credits: z.number().nullable().optional(),
681
+ agentId: z.string().nullable().optional(),
682
+ agentUri: z.string().nullable().optional(),
683
+ metadata: z.record(jsonValueSchema).optional(),
684
+ lastUpdated: z.string()
685
+ });
686
+ const registrationProgressRecord = z.object({
687
+ attemptId: z.string(),
688
+ mode: z.enum(["register", "update"]),
689
+ status: z.enum(["pending", "partial", "completed", "failed"]),
690
+ uaid: z.string().optional(),
691
+ agentId: z.string().optional(),
692
+ registryNamespace: z.string(),
693
+ accountId: z.string().optional(),
694
+ startedAt: z.string(),
695
+ completedAt: z.string().optional(),
696
+ primary: z.object({
697
+ status: z.enum(["pending", "completed", "failed"]),
698
+ finishedAt: z.string().optional(),
699
+ error: z.string().optional()
700
+ }),
701
+ additionalRegistries: z.record(
702
+ z.string(),
703
+ registrationProgressAdditionalEntry
704
+ ),
705
+ errors: z.array(z.string()).optional()
706
+ });
707
+ const registrationProgressResponseSchema = z.object({
708
+ progress: registrationProgressRecord
709
+ });
710
+ const registrationQuoteResponseSchema = z.object({
711
+ accountId: z.string().nullable().optional(),
712
+ registry: z.string().optional(),
713
+ protocol: z.string().optional(),
714
+ requiredCredits: z.number(),
715
+ availableCredits: z.number().nullable().optional(),
716
+ shortfallCredits: z.number().nullable().optional(),
717
+ creditsPerHbar: z.number().nullable().optional(),
718
+ estimatedHbar: z.number().nullable().optional()
719
+ });
720
+ const creditPurchaseResponseSchema = z.object({
721
+ success: z.boolean().optional(),
722
+ purchaser: z.string(),
723
+ credits: z.number(),
724
+ hbarAmount: z.number(),
725
+ transactionId: z.string(),
726
+ consensusTimestamp: z.string().nullable().optional()
727
+ });
728
+ const x402SettlementSchema = z.object({
729
+ success: z.boolean().optional(),
730
+ transaction: z.string().optional(),
731
+ network: z.string().optional(),
732
+ payer: z.string().optional(),
733
+ errorReason: z.string().optional()
734
+ }).strict();
735
+ const x402CreditPurchaseResponseSchema = z.object({
736
+ success: z.boolean(),
737
+ accountId: z.string(),
738
+ creditedCredits: z.number(),
739
+ usdAmount: z.number(),
740
+ balance: z.number(),
741
+ payment: z.object({
742
+ payer: z.string().optional(),
743
+ requirement: z.record(jsonValueSchema).optional(),
744
+ settlement: x402SettlementSchema.optional()
745
+ }).optional()
746
+ });
747
+ const x402MinimumsResponseSchema = z.object({
748
+ minimums: z.record(
749
+ z.object({
750
+ network: z.string().optional(),
751
+ gasLimit: z.number().optional(),
752
+ gasPriceWei: z.string().optional(),
753
+ gasUsd: z.number().optional(),
754
+ minUsd: z.number().optional(),
755
+ ethUsd: z.number().optional(),
756
+ fetchedAt: z.string().optional(),
757
+ source: z.string().optional()
758
+ })
759
+ ).optional(),
760
+ creditUnitUsd: z.number().optional()
761
+ });
762
+ const adaptersResponseSchema = z.object({
763
+ adapters: z.array(z.string())
764
+ });
765
+ const adapterRegistryCategorySchema = z.object({
766
+ id: z.number().int(),
767
+ network: z.string(),
768
+ type: z.string(),
769
+ slug: z.string(),
770
+ name: z.string(),
771
+ description: z.string().nullable().optional(),
772
+ topicId: z.string(),
773
+ versionTopicId: z.string(),
774
+ registryTransactionId: z.string().nullable().optional(),
775
+ versionTransactionId: z.string().nullable().optional(),
776
+ metadataPointer: z.string().nullable().optional(),
777
+ metadataSequence: z.number().int().nullable().optional(),
778
+ createdAt: z.string(),
779
+ updatedAt: z.string(),
780
+ metadata: jsonValueSchema.optional().nullable()
781
+ });
782
+ const adapterRegistryCategoriesResponseSchema = z.object({
783
+ categories: z.array(adapterRegistryCategorySchema)
784
+ });
785
+ const adapterRegistryAdapterSchema = z.object({
786
+ id: z.union([z.string(), z.number()]).optional(),
787
+ network: z.string().optional(),
788
+ categoryId: z.union([z.string(), z.number()]).nullable().optional(),
789
+ operation: z.string().optional(),
790
+ adapterId: z.string(),
791
+ adapterName: z.string(),
792
+ entity: z.string(),
793
+ manifestPointer: z.string().nullable().optional(),
794
+ manifestSequence: z.number().int().nullable().optional(),
795
+ packageRegistry: z.string().nullable().optional(),
796
+ packageName: z.string().nullable().optional(),
797
+ packageVersion: z.string().nullable().optional(),
798
+ packageIntegrity: z.string().nullable().optional(),
799
+ stateModel: z.string().nullable().optional(),
800
+ config: jsonValueSchema.nullable().optional(),
801
+ signature: z.string().nullable().optional(),
802
+ manifest: jsonValueSchema.nullable().optional(),
803
+ keywords: z.array(z.string()).optional(),
804
+ searchText: z.string().nullable().optional(),
805
+ creditAccountId: z.string().nullable().optional(),
806
+ registeredByUserId: z.string().nullable().optional(),
807
+ registeredByEmail: z.string().nullable().optional(),
808
+ totalCostHbar: z.number().nullable().optional(),
809
+ totalCostCredits: z.number().nullable().optional(),
810
+ consensusTimestamp: z.string().nullable().optional(),
811
+ sequenceNumber: z.number().int().nullable().optional(),
812
+ payerAccountId: z.string().nullable().optional(),
813
+ mirrorNodePayload: jsonValueSchema.nullable().optional(),
814
+ versionTopicId: z.string().nullable().optional(),
815
+ declarationTopicId: z.string().nullable().optional(),
816
+ categoryEntrySequence: z.number().int().nullable().optional(),
817
+ categoryEntryTransactionId: z.string().nullable().optional(),
818
+ versionPointerSequence: z.number().int().nullable().optional(),
819
+ versionPointerTransactionId: z.string().nullable().optional(),
820
+ transactionId: z.string().nullable().optional(),
821
+ createdAt: z.string().optional(),
822
+ category: adapterRegistryCategorySchema.optional()
823
+ }).passthrough();
824
+ const adapterRegistryAdaptersResponseSchema = z.object({
825
+ network: z.string(),
826
+ adapters: z.array(adapterRegistryAdapterSchema)
827
+ });
828
+ const adapterRegistryCreateCategoryResponseSchema = z.object({
829
+ category: adapterRegistryCategorySchema
830
+ });
831
+ z.object({
832
+ adapter: z.record(jsonValueSchema),
833
+ declaration: adapterDeclarationSchema,
834
+ transactionId: z.string().optional().nullable(),
835
+ category: adapterRegistryCategorySchema
836
+ });
837
+ const adapterRegistrySubmitAdapterAcceptedResponseSchema = z.object({
838
+ submissionId: z.string(),
839
+ status: z.string().optional(),
840
+ network: z.string().optional(),
841
+ message: z.string().optional()
842
+ }).passthrough();
843
+ const adapterRegistrySubmissionStatusResponseSchema = z.object({
844
+ submission: z.object({
845
+ id: z.string(),
846
+ network: z.string(),
847
+ status: z.enum(["pending", "running", "completed", "failed"]),
848
+ adapterId: z.string(),
849
+ categorySlug: z.string().nullable().optional(),
850
+ creditAccountId: z.string().nullable().optional(),
851
+ registeredByUserId: z.string().nullable().optional(),
852
+ registeredByEmail: z.string().nullable().optional(),
853
+ requestPayload: jsonValueSchema.optional(),
854
+ resultPayload: jsonValueSchema.nullable().optional(),
855
+ error: z.string().nullable().optional(),
856
+ createdAt: z.string().optional(),
857
+ updatedAt: z.string().optional(),
858
+ startedAt: z.string().nullable().optional(),
859
+ completedAt: z.string().nullable().optional()
860
+ }).passthrough()
861
+ });
862
+ const adapterChatProfileSchema = z.object({
863
+ supportsChat: z.boolean(),
864
+ delivery: z.string().optional(),
865
+ transport: z.string().optional(),
866
+ streaming: z.boolean().optional(),
867
+ requiresAuth: z.array(z.string()).optional(),
868
+ notes: z.string().optional()
869
+ });
870
+ const adapterCapabilitiesSchema = z.object({
871
+ discovery: z.boolean(),
872
+ routing: z.boolean(),
873
+ communication: z.boolean(),
874
+ translation: z.boolean(),
875
+ protocols: z.array(z.string())
876
+ });
877
+ const adapterDescriptorSchema = z.object({
878
+ id: z.string(),
879
+ name: z.string(),
880
+ version: z.string(),
881
+ author: z.string(),
882
+ description: z.string(),
883
+ supportedProtocols: z.array(z.string()),
884
+ registryType: z.enum(["web2", "web3", "hybrid"]),
885
+ chatProfile: adapterChatProfileSchema.optional(),
886
+ capabilities: adapterCapabilitiesSchema,
887
+ enabled: z.boolean(),
888
+ priority: z.number(),
889
+ status: z.enum(["running", "stopped"])
890
+ });
891
+ const adapterDetailsResponseSchema = z.object({
892
+ adapters: z.array(adapterDescriptorSchema)
893
+ });
894
+ const metadataFacetOptionSchema = z.object({
895
+ value: z.union([z.string(), z.number(), z.boolean()]),
896
+ label: z.string()
897
+ });
898
+ const searchFacetSchema = z.object({
899
+ key: z.string(),
900
+ label: z.string(),
901
+ description: z.string().optional(),
902
+ type: z.enum(["string", "boolean", "number"]),
903
+ adapters: z.array(z.string()).optional(),
904
+ options: z.array(metadataFacetOptionSchema).optional()
905
+ });
906
+ const searchFacetsResponseSchema = z.object({
907
+ facets: z.array(searchFacetSchema)
908
+ });
322
909
  export {
323
- FileParser
910
+ AIAgentCapability,
911
+ AIAgentType,
912
+ adapterChatProfileSchema,
913
+ adapterDescriptorSchema,
914
+ adapterDetailsResponseSchema,
915
+ adapterRegistryAdapterSchema,
916
+ adapterRegistryAdaptersResponseSchema,
917
+ adapterRegistryCategoriesResponseSchema,
918
+ adapterRegistryCategorySchema,
919
+ adapterRegistryCreateCategoryResponseSchema,
920
+ adapterRegistrySubmissionStatusResponseSchema,
921
+ adapterRegistrySubmitAdapterAcceptedResponseSchema,
922
+ adaptersResponseSchema,
923
+ additionalRegistryCatalogResponseSchema,
924
+ agentFeedbackEligibilityResponseSchema,
925
+ agentFeedbackEntriesIndexResponseSchema,
926
+ agentFeedbackIndexResponseSchema,
927
+ agentFeedbackResponseSchema,
928
+ agentFeedbackSubmissionResponseSchema,
929
+ chatHistoryCompactionResponseSchema,
930
+ chatHistorySnapshotResponseSchema,
931
+ createSessionResponseSchema,
932
+ creditPurchaseResponseSchema,
933
+ dashboardStatsResponseSchema,
934
+ detectProtocolResponseSchema,
935
+ encryptionHandshakeResponseSchema,
936
+ ledgerChallengeResponseSchema,
937
+ ledgerVerifyResponseSchema,
938
+ metricsSummaryResponseSchema,
939
+ popularResponseSchema,
940
+ protocolsResponseSchema,
941
+ registerAgentResponseSchema,
942
+ registerEncryptionKeyResponseSchema,
943
+ registrationProgressResponseSchema,
944
+ registrationQuoteResponseSchema,
945
+ registriesResponseSchema,
946
+ registrySearchByNamespaceSchema,
947
+ resolveResponseSchema,
948
+ searchFacetsResponseSchema,
949
+ searchResponseSchema,
950
+ searchStatusResponseSchema,
951
+ sendMessageResponseSchema,
952
+ sessionEncryptionStatusResponseSchema,
953
+ statsResponseSchema,
954
+ uaidConnectionStatusSchema,
955
+ uaidValidationResponseSchema,
956
+ vectorSearchResponseSchema,
957
+ websocketStatsResponseSchema,
958
+ x402CreditPurchaseResponseSchema,
959
+ x402MinimumsResponseSchema
324
960
  };
325
961
  //# sourceMappingURL=standards-sdk.es151.js.map