@hashgraphonline/standards-sdk 0.1.141-canary.31 → 0.1.141-canary.34

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 (78) hide show
  1. package/dist/cjs/hcs-21/base-client.d.ts +2 -1
  2. package/dist/cjs/hcs-21/base-client.d.ts.map +1 -1
  3. package/dist/cjs/hcs-21/sdk.d.ts +26 -0
  4. package/dist/cjs/hcs-21/sdk.d.ts.map +1 -1
  5. package/dist/cjs/hcs-21/types.d.ts +11 -1
  6. package/dist/cjs/hcs-21/types.d.ts.map +1 -1
  7. package/dist/cjs/services/types.d.ts +1 -0
  8. package/dist/cjs/services/types.d.ts.map +1 -1
  9. package/dist/cjs/standards-sdk.cjs +1 -1
  10. package/dist/cjs/standards-sdk.cjs.map +1 -1
  11. package/dist/es/hcs-21/base-client.d.ts +2 -1
  12. package/dist/es/hcs-21/base-client.d.ts.map +1 -1
  13. package/dist/es/hcs-21/sdk.d.ts +26 -0
  14. package/dist/es/hcs-21/sdk.d.ts.map +1 -1
  15. package/dist/es/hcs-21/types.d.ts +11 -1
  16. package/dist/es/hcs-21/types.d.ts.map +1 -1
  17. package/dist/es/services/types.d.ts +1 -0
  18. package/dist/es/services/types.d.ts.map +1 -1
  19. package/dist/es/standards-sdk.es100.js +1 -1
  20. package/dist/es/standards-sdk.es104.js +1 -1
  21. package/dist/es/standards-sdk.es110.js +1 -1
  22. package/dist/es/standards-sdk.es111.js +5 -5
  23. package/dist/es/standards-sdk.es121.js +1 -1
  24. package/dist/es/standards-sdk.es122.js +1 -1
  25. package/dist/es/standards-sdk.es123.js +5 -5
  26. package/dist/es/standards-sdk.es125.js +1 -1
  27. package/dist/es/standards-sdk.es126.js +1 -1
  28. package/dist/es/standards-sdk.es128.js +1 -1
  29. package/dist/es/standards-sdk.es13.js +1 -1
  30. package/dist/es/standards-sdk.es138.js +42 -766
  31. package/dist/es/standards-sdk.es138.js.map +1 -1
  32. package/dist/es/standards-sdk.es139.js +12265 -33
  33. package/dist/es/standards-sdk.es139.js.map +1 -1
  34. package/dist/es/standards-sdk.es141.js +766 -172
  35. package/dist/es/standards-sdk.es141.js.map +1 -1
  36. package/dist/es/standards-sdk.es142.js +55 -321
  37. package/dist/es/standards-sdk.es142.js.map +1 -1
  38. package/dist/es/standards-sdk.es143.js +120 -294
  39. package/dist/es/standards-sdk.es143.js.map +1 -1
  40. package/dist/es/standards-sdk.es144.js +191 -322
  41. package/dist/es/standards-sdk.es144.js.map +1 -1
  42. package/dist/es/standards-sdk.es145.js +294 -279
  43. package/dist/es/standards-sdk.es145.js.map +1 -1
  44. package/dist/es/standards-sdk.es146.js +440 -63
  45. package/dist/es/standards-sdk.es146.js.map +1 -1
  46. package/dist/es/standards-sdk.es147.js +267 -12210
  47. package/dist/es/standards-sdk.es147.js.map +1 -1
  48. package/dist/es/standards-sdk.es148.js +69 -49
  49. package/dist/es/standards-sdk.es148.js.map +1 -1
  50. package/dist/es/standards-sdk.es17.js +1 -1
  51. package/dist/es/standards-sdk.es19.js +3 -3
  52. package/dist/es/standards-sdk.es20.js +2 -2
  53. package/dist/es/standards-sdk.es23.js +1 -1
  54. package/dist/es/standards-sdk.es28.js +2 -2
  55. package/dist/es/standards-sdk.es31.js +1 -1
  56. package/dist/es/standards-sdk.es32.js +1 -1
  57. package/dist/es/standards-sdk.es36.js +2 -2
  58. package/dist/es/standards-sdk.es37.js +2 -2
  59. package/dist/es/standards-sdk.es38.js +1 -1
  60. package/dist/es/standards-sdk.es54.js +1 -1
  61. package/dist/es/standards-sdk.es57.js +1 -1
  62. package/dist/es/standards-sdk.es59.js +1 -1
  63. package/dist/es/standards-sdk.es61.js +1 -1
  64. package/dist/es/standards-sdk.es69.js +1 -1
  65. package/dist/es/standards-sdk.es70.js +1 -1
  66. package/dist/es/standards-sdk.es72.js +1 -1
  67. package/dist/es/standards-sdk.es78.js +1 -1
  68. package/dist/es/standards-sdk.es79.js +1 -1
  69. package/dist/es/standards-sdk.es8.js +1 -1
  70. package/dist/es/standards-sdk.es80.js +4 -3
  71. package/dist/es/standards-sdk.es80.js.map +1 -1
  72. package/dist/es/standards-sdk.es82.js +1 -1
  73. package/dist/es/standards-sdk.es83.js +24 -0
  74. package/dist/es/standards-sdk.es83.js.map +1 -1
  75. package/dist/es/standards-sdk.es84.js +70 -1
  76. package/dist/es/standards-sdk.es84.js.map +1 -1
  77. package/dist/es/standards-sdk.es92.js +1 -1
  78. package/package.json +63 -61
@@ -1,175 +1,769 @@
1
- import { Long, AccountId } from "@hashgraph/sdk";
2
- import { parseKey } from "./standards-sdk.es146.js";
3
- import { Buffer } from "buffer";
4
- class HCSParser {
5
- static parseConsensusCreateTopic(body) {
6
- if (!body) return void 0;
7
- const data = {};
8
- if (body.memo) {
9
- data.memo = body.memo;
10
- }
11
- data.adminKey = parseKey(body.adminKey);
12
- data.submitKey = parseKey(body.submitKey);
13
- if (body.autoRenewPeriod?.seconds) {
14
- data.autoRenewPeriod = Long.fromValue(
15
- body.autoRenewPeriod.seconds
16
- ).toString();
17
- }
18
- if (body.autoRenewAccount) {
19
- data.autoRenewAccountId = new AccountId(
20
- body.autoRenewAccount.shardNum ?? 0,
21
- body.autoRenewAccount.realmNum ?? 0,
22
- body.autoRenewAccount.accountNum ?? 0
23
- ).toString();
24
- }
25
- return data;
26
- }
27
- static parseConsensusSubmitMessage(body) {
28
- if (!body) return void 0;
29
- const data = {};
30
- if (body.topicID) {
31
- data.topicId = `${body.topicID.shardNum ?? 0}.${body.topicID.realmNum ?? 0}.${body.topicID.topicNum ?? 0}`;
32
- }
33
- if (body.message?.length > 0) {
34
- const messageBuffer = Buffer.from(body.message);
35
- const utf8String = messageBuffer.toString("utf8");
36
- if (/[\x00-\x08\x0B\x0E-\x1F\x7F]/.test(utf8String) || utf8String.includes("�")) {
37
- data.message = messageBuffer.toString("base64");
38
- data.messageEncoding = "base64";
39
- } else {
40
- data.message = utf8String;
41
- data.messageEncoding = "utf8";
42
- }
43
- }
44
- if (body.chunkInfo) {
45
- if (body.chunkInfo.initialTransactionID) {
46
- const txId = body.chunkInfo.initialTransactionID.accountID;
47
- const taValidStart = body.chunkInfo.initialTransactionID.transactionValidStart;
48
- if (txId && taValidStart) {
49
- data.chunkInfoInitialTransactionID = `${txId.shardNum ?? 0}.${txId.realmNum ?? 0}.${txId.accountNum ?? 0}@${taValidStart.seconds ?? 0}.${taValidStart.nanos ?? 0}`;
50
- }
51
- }
52
- if (body.chunkInfo.number !== void 0 && body.chunkInfo.number !== null) {
53
- data.chunkInfoNumber = body.chunkInfo.number;
54
- }
55
- if (body.chunkInfo.total !== void 0 && body.chunkInfo.total !== null) {
56
- data.chunkInfoTotal = body.chunkInfo.total;
57
- }
58
- }
59
- return data;
60
- }
61
- static parseConsensusUpdateTopic(body) {
62
- if (!body) return void 0;
63
- const data = {};
64
- if (body.topicID) {
65
- data.topicId = `${body.topicID.shardNum}.${body.topicID.realmNum}.${body.topicID.topicNum}`;
66
- }
67
- if (body.memo?.value !== void 0) {
68
- data.memo = body.memo.value;
69
- }
70
- if (body.adminKey === null) {
71
- data.clearAdminKey = true;
72
- data.adminKey = void 0;
73
- } else if (body.adminKey) {
74
- data.adminKey = parseKey(body.adminKey);
75
- } else {
76
- data.adminKey = void 0;
77
- }
78
- if (body.submitKey === null) {
79
- data.clearSubmitKey = true;
80
- data.submitKey = void 0;
81
- } else if (body.submitKey) {
82
- data.submitKey = parseKey(body.submitKey);
83
- } else {
84
- data.submitKey = void 0;
85
- }
86
- if (body.autoRenewPeriod?.seconds) {
87
- data.autoRenewPeriod = Long.fromValue(
88
- body.autoRenewPeriod.seconds
89
- ).toString();
90
- }
91
- if (body.autoRenewAccount) {
92
- data.autoRenewAccountId = new AccountId(
93
- body.autoRenewAccount.shardNum ?? 0,
94
- body.autoRenewAccount.realmNum ?? 0,
95
- body.autoRenewAccount.accountNum ?? 0
96
- ).toString();
97
- }
98
- return data;
99
- }
100
- static parseConsensusDeleteTopic(body) {
101
- if (!body) return void 0;
102
- const data = {};
103
- if (body.topicID) {
104
- data.topicId = `${body.topicID.shardNum}.${body.topicID.realmNum ?? 0}.${body.topicID.topicNum ?? 0}`;
105
- }
106
- return data;
107
- }
108
- /**
109
- * Parse HCS transaction from Transaction object with comprehensive extraction
110
- * This is the unified entry point that handles both protobuf and internal field extraction
111
- */
112
- static parseFromTransactionObject(transaction) {
113
- try {
114
- const transactionBody = transaction._transactionBody;
115
- if (!transactionBody) {
116
- return {};
117
- }
118
- if (transactionBody.consensusCreateTopic) {
119
- const consensusCreateTopic = this.parseConsensusCreateTopic(
120
- transactionBody.consensusCreateTopic
121
- );
122
- if (consensusCreateTopic) {
123
- return {
124
- type: "TOPICCREATE",
125
- humanReadableType: "Topic Create",
126
- consensusCreateTopic
127
- };
128
- }
129
- }
130
- if (transactionBody.consensusSubmitMessage) {
131
- const consensusSubmitMessage = this.parseConsensusSubmitMessage(
132
- transactionBody.consensusSubmitMessage
133
- );
134
- if (consensusSubmitMessage) {
135
- return {
136
- type: "CONSENSUSSUBMITMESSAGE",
137
- humanReadableType: "Submit Message",
138
- consensusSubmitMessage
139
- };
140
- }
141
- }
142
- if (transactionBody.consensusUpdateTopic) {
143
- const consensusUpdateTopic = this.parseConsensusUpdateTopic(
144
- transactionBody.consensusUpdateTopic
145
- );
146
- if (consensusUpdateTopic) {
147
- return {
148
- type: "TOPICUPDATE",
149
- humanReadableType: "Topic Update",
150
- consensusUpdateTopic
151
- };
152
- }
153
- }
154
- if (transactionBody.consensusDeleteTopic) {
155
- const consensusDeleteTopic = this.parseConsensusDeleteTopic(
156
- transactionBody.consensusDeleteTopic
157
- );
158
- if (consensusDeleteTopic) {
159
- return {
160
- type: "TOPICDELETE",
161
- humanReadableType: "Topic Delete",
162
- consensusDeleteTopic
163
- };
164
- }
165
- }
166
- return {};
167
- } catch (error) {
168
- return {};
169
- }
170
- }
171
- }
1
+ import { z } from "zod";
2
+ var AIAgentType = /* @__PURE__ */ ((AIAgentType2) => {
3
+ AIAgentType2[AIAgentType2["MANUAL"] = 0] = "MANUAL";
4
+ AIAgentType2[AIAgentType2["AUTONOMOUS"] = 1] = "AUTONOMOUS";
5
+ return AIAgentType2;
6
+ })(AIAgentType || {});
7
+ var AIAgentCapability = /* @__PURE__ */ ((AIAgentCapability2) => {
8
+ AIAgentCapability2[AIAgentCapability2["TEXT_GENERATION"] = 0] = "TEXT_GENERATION";
9
+ AIAgentCapability2[AIAgentCapability2["IMAGE_GENERATION"] = 1] = "IMAGE_GENERATION";
10
+ AIAgentCapability2[AIAgentCapability2["AUDIO_GENERATION"] = 2] = "AUDIO_GENERATION";
11
+ AIAgentCapability2[AIAgentCapability2["VIDEO_GENERATION"] = 3] = "VIDEO_GENERATION";
12
+ AIAgentCapability2[AIAgentCapability2["CODE_GENERATION"] = 4] = "CODE_GENERATION";
13
+ AIAgentCapability2[AIAgentCapability2["LANGUAGE_TRANSLATION"] = 5] = "LANGUAGE_TRANSLATION";
14
+ AIAgentCapability2[AIAgentCapability2["SUMMARIZATION_EXTRACTION"] = 6] = "SUMMARIZATION_EXTRACTION";
15
+ AIAgentCapability2[AIAgentCapability2["KNOWLEDGE_RETRIEVAL"] = 7] = "KNOWLEDGE_RETRIEVAL";
16
+ AIAgentCapability2[AIAgentCapability2["DATA_INTEGRATION"] = 8] = "DATA_INTEGRATION";
17
+ AIAgentCapability2[AIAgentCapability2["MARKET_INTELLIGENCE"] = 9] = "MARKET_INTELLIGENCE";
18
+ AIAgentCapability2[AIAgentCapability2["TRANSACTION_ANALYTICS"] = 10] = "TRANSACTION_ANALYTICS";
19
+ AIAgentCapability2[AIAgentCapability2["SMART_CONTRACT_AUDIT"] = 11] = "SMART_CONTRACT_AUDIT";
20
+ AIAgentCapability2[AIAgentCapability2["GOVERNANCE_FACILITATION"] = 12] = "GOVERNANCE_FACILITATION";
21
+ AIAgentCapability2[AIAgentCapability2["SECURITY_MONITORING"] = 13] = "SECURITY_MONITORING";
22
+ AIAgentCapability2[AIAgentCapability2["COMPLIANCE_ANALYSIS"] = 14] = "COMPLIANCE_ANALYSIS";
23
+ AIAgentCapability2[AIAgentCapability2["FRAUD_DETECTION"] = 15] = "FRAUD_DETECTION";
24
+ AIAgentCapability2[AIAgentCapability2["MULTI_AGENT_COORDINATION"] = 16] = "MULTI_AGENT_COORDINATION";
25
+ AIAgentCapability2[AIAgentCapability2["API_INTEGRATION"] = 17] = "API_INTEGRATION";
26
+ AIAgentCapability2[AIAgentCapability2["WORKFLOW_AUTOMATION"] = 18] = "WORKFLOW_AUTOMATION";
27
+ return AIAgentCapability2;
28
+ })(AIAgentCapability || {});
29
+ const capabilitySchema = z.nativeEnum(AIAgentCapability);
30
+ const capabilityValueSchema = z.union([capabilitySchema, z.string()]);
31
+ const jsonPrimitiveSchema = z.union([
32
+ z.string(),
33
+ z.number(),
34
+ z.boolean(),
35
+ z.null()
36
+ ]);
37
+ const jsonValueSchema = z.lazy(
38
+ () => z.union([
39
+ jsonPrimitiveSchema,
40
+ z.array(jsonValueSchema),
41
+ z.record(jsonValueSchema)
42
+ ])
43
+ );
44
+ const agentProfileSchema = z.object({
45
+ version: z.string(),
46
+ type: z.number(),
47
+ display_name: z.string(),
48
+ alias: z.string().optional(),
49
+ bio: z.string().optional(),
50
+ socials: z.array(jsonValueSchema).optional(),
51
+ aiAgent: z.object({
52
+ type: z.nativeEnum(AIAgentType),
53
+ creator: z.string().optional(),
54
+ model: z.string().optional(),
55
+ capabilities: z.array(capabilitySchema).optional()
56
+ }).optional(),
57
+ uaid: z.string().optional()
58
+ }).catchall(jsonValueSchema);
59
+ const cipherEnvelopeRecipientSchema = z.object({
60
+ uaid: z.string().optional(),
61
+ ledgerAccountId: z.string().optional(),
62
+ userId: z.string().optional(),
63
+ email: z.string().optional(),
64
+ encryptedShare: z.string()
65
+ });
66
+ const cipherEnvelopeSchema = z.object({
67
+ algorithm: z.string(),
68
+ ciphertext: z.string(),
69
+ nonce: z.string(),
70
+ associatedData: z.string().optional(),
71
+ keyLocator: z.object({
72
+ sessionId: z.string().optional(),
73
+ revision: z.number().optional()
74
+ }).optional(),
75
+ recipients: z.array(cipherEnvelopeRecipientSchema)
76
+ });
77
+ const peerSummarySchema = z.object({
78
+ keyType: z.string(),
79
+ publicKey: z.string(),
80
+ uaid: z.string().optional(),
81
+ ledgerAccountId: z.string().optional(),
82
+ userId: z.string().optional(),
83
+ email: z.string().optional()
84
+ });
85
+ const handshakeParticipantSchema = z.object({
86
+ role: z.enum(["requester", "responder"]),
87
+ uaid: z.string().optional(),
88
+ userId: z.string().optional(),
89
+ ledgerAccountId: z.string().optional(),
90
+ keyType: z.string(),
91
+ longTermPublicKey: z.string().optional(),
92
+ ephemeralPublicKey: z.string(),
93
+ signature: z.string().optional(),
94
+ metadata: z.record(jsonValueSchema).optional(),
95
+ submittedAt: z.string()
96
+ });
97
+ const encryptionHandshakeRecordSchema = z.object({
98
+ sessionId: z.string(),
99
+ algorithm: z.string(),
100
+ createdAt: z.string(),
101
+ expiresAt: z.number(),
102
+ status: z.enum(["pending", "complete"]),
103
+ requester: handshakeParticipantSchema.optional(),
104
+ responder: handshakeParticipantSchema.optional()
105
+ });
106
+ const sessionEncryptionSummarySchema = z.object({
107
+ enabled: z.boolean(),
108
+ algorithm: z.string(),
109
+ requireCiphertext: z.boolean(),
110
+ requester: peerSummarySchema.nullable().optional(),
111
+ responder: peerSummarySchema.nullable().optional(),
112
+ handshake: encryptionHandshakeRecordSchema.nullable().optional()
113
+ });
114
+ const chatHistoryEntrySchema = z.object({
115
+ messageId: z.string(),
116
+ role: z.enum(["user", "agent"]),
117
+ content: z.string(),
118
+ timestamp: z.string(),
119
+ cipherEnvelope: cipherEnvelopeSchema.optional(),
120
+ metadata: z.record(jsonValueSchema).optional()
121
+ });
122
+ const metadataFacetSchema = z.record(
123
+ z.union([
124
+ z.array(jsonValueSchema),
125
+ z.record(jsonValueSchema),
126
+ jsonValueSchema
127
+ ])
128
+ ).optional();
129
+ const searchHitSchema = z.object({
130
+ id: z.string(),
131
+ uaid: z.string(),
132
+ registry: z.string(),
133
+ name: z.string(),
134
+ description: z.string().optional(),
135
+ capabilities: z.array(capabilityValueSchema),
136
+ endpoints: z.union([z.record(jsonValueSchema), z.array(z.string())]).optional(),
137
+ metadata: z.record(jsonValueSchema).optional(),
138
+ metadataFacet: metadataFacetSchema,
139
+ profile: agentProfileSchema.optional(),
140
+ protocols: z.array(z.string()).optional(),
141
+ adapter: z.string().optional(),
142
+ originalId: z.string().optional(),
143
+ communicationSupported: z.boolean().optional(),
144
+ routingSupported: z.boolean().optional(),
145
+ available: z.boolean().optional(),
146
+ availabilityStatus: z.string().optional(),
147
+ availabilityCheckedAt: z.string().optional(),
148
+ availabilitySource: z.string().optional(),
149
+ availabilityLatencyMs: z.number().optional(),
150
+ availabilityScore: z.number().optional(),
151
+ capabilityLabels: z.array(z.string()).optional(),
152
+ capabilityTokens: z.array(z.string()).optional(),
153
+ image: z.string().optional(),
154
+ createdAt: z.string().optional(),
155
+ updatedAt: z.string().optional(),
156
+ lastSeen: z.string().optional(),
157
+ lastIndexed: z.string().optional()
158
+ }).passthrough();
159
+ const searchResponseSchema = z.object({
160
+ hits: z.array(searchHitSchema),
161
+ total: z.number(),
162
+ page: z.number(),
163
+ limit: z.number()
164
+ });
165
+ const statsResponseSchema = z.object({
166
+ totalAgents: z.number(),
167
+ registries: z.record(z.number()),
168
+ capabilities: z.record(z.number()),
169
+ lastUpdate: z.string(),
170
+ status: z.string()
171
+ });
172
+ const registriesResponseSchema = z.object({
173
+ registries: z.array(z.string())
174
+ });
175
+ const popularResponseSchema = z.object({
176
+ searches: z.array(z.string())
177
+ });
178
+ const resolveResponseSchema = z.object({
179
+ agent: searchHitSchema
180
+ });
181
+ const createSessionResponseSchema = z.object({
182
+ sessionId: z.string(),
183
+ uaid: z.string().nullable().optional(),
184
+ agent: z.object({
185
+ name: z.string(),
186
+ description: z.string().optional(),
187
+ capabilities: z.record(jsonValueSchema).nullable().optional(),
188
+ skills: z.array(z.string()).optional()
189
+ }),
190
+ history: z.array(chatHistoryEntrySchema).optional().default([]),
191
+ historyTtlSeconds: z.number().nullable().optional(),
192
+ encryption: sessionEncryptionSummarySchema.nullable().optional()
193
+ });
194
+ const sendMessageResponseSchema = z.object({
195
+ sessionId: z.string(),
196
+ uaid: z.string().nullable().optional(),
197
+ message: z.string(),
198
+ timestamp: z.string(),
199
+ rawResponse: jsonValueSchema.optional(),
200
+ content: z.string().optional(),
201
+ history: z.array(chatHistoryEntrySchema).optional(),
202
+ historyTtlSeconds: z.number().nullable().optional(),
203
+ encrypted: z.boolean().optional()
204
+ });
205
+ const chatHistorySnapshotResponseSchema = z.object({
206
+ sessionId: z.string(),
207
+ history: z.array(chatHistoryEntrySchema),
208
+ historyTtlSeconds: z.number()
209
+ });
210
+ z.object({
211
+ preserveEntries: z.number().int().min(0).optional()
212
+ }).strict();
213
+ const chatHistoryCompactionResponseSchema = z.object({
214
+ sessionId: z.string(),
215
+ history: z.array(chatHistoryEntrySchema),
216
+ summaryEntry: chatHistoryEntrySchema,
217
+ preservedEntries: z.array(chatHistoryEntrySchema),
218
+ historyTtlSeconds: z.number(),
219
+ creditsDebited: z.number(),
220
+ metadata: z.record(jsonValueSchema).optional()
221
+ });
222
+ const sessionEncryptionStatusResponseSchema = z.object({
223
+ sessionId: z.string(),
224
+ encryption: sessionEncryptionSummarySchema.nullable()
225
+ });
226
+ const encryptionHandshakeResponseSchema = z.object({
227
+ sessionId: z.string(),
228
+ handshake: encryptionHandshakeRecordSchema
229
+ });
230
+ const registerEncryptionKeyResponseSchema = z.object({
231
+ id: z.string(),
232
+ keyType: z.string(),
233
+ publicKey: z.string(),
234
+ uaid: z.string().nullable(),
235
+ ledgerAccountId: z.string().nullable(),
236
+ ledgerNetwork: z.string().nullable().optional(),
237
+ userId: z.string().nullable().optional(),
238
+ email: z.string().nullable().optional(),
239
+ createdAt: z.string(),
240
+ updatedAt: z.string()
241
+ });
242
+ const ledgerChallengeResponseSchema = z.object({
243
+ challengeId: z.string(),
244
+ message: z.string(),
245
+ expiresAt: z.string()
246
+ });
247
+ const ledgerApiKeySummarySchema = z.object({
248
+ id: z.string(),
249
+ label: z.string().optional(),
250
+ prefix: z.string(),
251
+ lastFour: z.string(),
252
+ createdAt: z.string(),
253
+ lastUsedAt: z.string().nullable().optional(),
254
+ ownerType: z.literal("ledger"),
255
+ ledgerAccountId: z.string().optional(),
256
+ ledgerNetwork: z.string().optional(),
257
+ ledgerNetworkCanonical: z.string().optional()
258
+ });
259
+ const ledgerVerifyResponseSchema = z.object({
260
+ key: z.string(),
261
+ apiKey: ledgerApiKeySummarySchema,
262
+ accountId: z.string(),
263
+ network: z.string(),
264
+ networkCanonical: z.string().optional()
265
+ });
266
+ const protocolsResponseSchema = z.object({
267
+ protocols: z.array(z.string())
268
+ });
269
+ const detectProtocolResponseSchema = z.object({
270
+ protocol: z.string().nullable()
271
+ });
272
+ const registrySearchByNamespaceSchema = z.object({
273
+ hits: z.array(searchHitSchema),
274
+ total: z.number(),
275
+ page: z.number().optional(),
276
+ limit: z.number().optional()
277
+ });
278
+ const capabilityFilterValueSchema = z.union([z.string(), z.number()]);
279
+ const vectorSearchFilterSchema = z.object({
280
+ capabilities: z.array(capabilityFilterValueSchema).optional(),
281
+ type: z.enum(["ai-agents", "mcp-servers"]).optional(),
282
+ registry: z.string().optional(),
283
+ protocols: z.array(z.string()).optional(),
284
+ adapter: z.array(z.string()).optional()
285
+ }).strict();
286
+ z.object({
287
+ query: z.string(),
288
+ filter: vectorSearchFilterSchema.optional(),
289
+ limit: z.number().int().min(1).max(100).optional(),
290
+ offset: z.number().int().min(0).optional()
291
+ }).strict();
292
+ const vectorSearchHitSchema = z.object({
293
+ agent: searchHitSchema,
294
+ score: z.number().optional(),
295
+ highlights: z.record(z.array(z.string())).optional()
296
+ });
297
+ const vectorSearchResponseSchema = z.object({
298
+ hits: z.array(vectorSearchHitSchema),
299
+ total: z.number(),
300
+ took: z.number(),
301
+ totalAvailable: z.number().optional(),
302
+ visible: z.number().optional(),
303
+ limited: z.boolean().optional(),
304
+ credits_used: z.number().optional()
305
+ });
306
+ const vectorStatusSchema = z.object({
307
+ enabled: z.boolean(),
308
+ healthy: z.boolean(),
309
+ mode: z.enum(["disabled", "initializing", "healthy", "degraded", "error"]),
310
+ lastUpdated: z.string(),
311
+ details: z.record(z.any()).optional(),
312
+ lastError: z.object({
313
+ message: z.string(),
314
+ stack: z.string().optional(),
315
+ timestamp: z.string().optional()
316
+ }).optional()
317
+ });
318
+ const searchStatusResponseSchema = z.object({
319
+ storageMode: z.string(),
320
+ vectorStatus: vectorStatusSchema
321
+ });
322
+ const websocketStatsResponseSchema = z.object({
323
+ clients: z.number(),
324
+ stats: z.object({
325
+ totalClients: z.number().optional(),
326
+ clientsByRegistry: z.record(z.number()).optional(),
327
+ clientsByEventType: z.record(z.number()).optional()
328
+ }).passthrough()
329
+ });
330
+ const durationStatsSchema = z.object({
331
+ p50: z.number(),
332
+ p90: z.number(),
333
+ p95: z.number(),
334
+ p99: z.number()
335
+ });
336
+ const metricsSummaryResponseSchema = z.object({
337
+ http: z.object({
338
+ requestsTotal: z.number(),
339
+ activeConnections: z.number(),
340
+ requestDuration: durationStatsSchema
341
+ }),
342
+ search: z.object({
343
+ queriesTotal: z.number(),
344
+ queryDuration: durationStatsSchema
345
+ }),
346
+ indexing: z.object({ agentsTotal: z.number(), crawlErrors: z.number() }),
347
+ registration: z.object({
348
+ total: z.number(),
349
+ failures: z.number(),
350
+ duration: durationStatsSchema
351
+ }),
352
+ cache: z.object({
353
+ hits: z.number(),
354
+ misses: z.number(),
355
+ hitRate: z.number()
356
+ }),
357
+ websocket: z.object({ connections: z.number() })
358
+ });
359
+ const uaidValidationResponseSchema = z.object({
360
+ uaid: z.string(),
361
+ valid: z.boolean(),
362
+ formats: z.array(z.string())
363
+ });
364
+ const adapterConnectionSchema = z.object({
365
+ id: z.string(),
366
+ agentId: z.string(),
367
+ protocol: z.string(),
368
+ endpoint: z.string(),
369
+ status: z.enum(["connected", "disconnected", "error"]),
370
+ metadata: z.record(jsonPrimitiveSchema).optional(),
371
+ createdAt: z.string()
372
+ });
373
+ const uaidConnectionStatusSchema = z.object({
374
+ connected: z.boolean(),
375
+ connection: adapterConnectionSchema.optional(),
376
+ adapter: z.string().optional(),
377
+ agentId: z.string().optional()
378
+ });
379
+ const dashboardStatsResponseSchema = z.object({
380
+ operatorId: z.string().optional(),
381
+ adapters: z.array(
382
+ z.object({
383
+ name: z.string(),
384
+ version: z.string(),
385
+ status: z.string(),
386
+ agentCount: z.number(),
387
+ lastDiscovery: z.string(),
388
+ registryType: z.string(),
389
+ health: z.string()
390
+ })
391
+ ).optional(),
392
+ totalAgents: z.number().optional(),
393
+ elasticsearchDocumentCount: z.number().optional(),
394
+ agentsByAdapter: z.record(z.number()).optional(),
395
+ agentsByRegistry: z.record(z.number()).optional(),
396
+ systemInfo: z.object({
397
+ uptime: z.number().optional(),
398
+ version: z.string().optional(),
399
+ network: z.string().optional()
400
+ }).optional()
401
+ });
402
+ const registrationAgentSchema = z.object({
403
+ id: z.string(),
404
+ name: z.string(),
405
+ type: z.string(),
406
+ endpoint: z.string().optional(),
407
+ capabilities: z.array(capabilityValueSchema),
408
+ registry: z.string().optional(),
409
+ protocol: z.string().optional(),
410
+ profile: agentProfileSchema.optional(),
411
+ nativeId: z.string().optional(),
412
+ metadata: z.record(jsonValueSchema).optional()
413
+ });
414
+ const registrationProfileInfoSchema = z.object({
415
+ tId: z.string().nullable(),
416
+ sizeBytes: z.number().optional()
417
+ });
418
+ const profileRegistrySchema = z.object({
419
+ topicId: z.string().optional(),
420
+ sequenceNumber: z.number().optional(),
421
+ profileReference: z.string().optional(),
422
+ profileTopicId: z.string().optional()
423
+ }).passthrough().nullable().optional();
424
+ const additionalRegistryResultSchema = z.object({
425
+ registry: z.string(),
426
+ status: z.enum([
427
+ "created",
428
+ "duplicate",
429
+ "skipped",
430
+ "error",
431
+ "updated",
432
+ "pending"
433
+ ]),
434
+ agentId: z.string().nullable().optional(),
435
+ agentUri: z.string().nullable().optional(),
436
+ error: z.string().optional(),
437
+ metadata: z.record(jsonValueSchema).optional(),
438
+ registryKey: z.string().optional(),
439
+ networkId: z.string().optional(),
440
+ networkName: z.string().optional(),
441
+ chainId: z.number().optional(),
442
+ estimatedCredits: z.number().nullable().optional(),
443
+ gasEstimateCredits: z.number().nullable().optional(),
444
+ gasEstimateUsd: z.number().nullable().optional(),
445
+ gasPriceGwei: z.number().nullable().optional(),
446
+ gasLimit: z.number().nullable().optional(),
447
+ creditMode: z.enum(["fixed", "gas"]).nullable().optional(),
448
+ minCredits: z.number().nullable().optional(),
449
+ consumedCredits: z.number().nullable().optional(),
450
+ cost: z.object({
451
+ credits: z.number(),
452
+ usd: z.number(),
453
+ eth: z.number(),
454
+ gasUsedWei: z.string(),
455
+ effectiveGasPriceWei: z.string().nullable().optional(),
456
+ transactions: z.array(
457
+ z.object({
458
+ hash: z.string(),
459
+ gasUsedWei: z.string(),
460
+ effectiveGasPriceWei: z.string().nullable().optional(),
461
+ costWei: z.string()
462
+ })
463
+ ).optional()
464
+ }).optional()
465
+ });
466
+ const registrationCreditsSchema = z.object({
467
+ base: z.number(),
468
+ additional: z.number(),
469
+ total: z.number()
470
+ });
471
+ const hcs10RegistrySchema = z.object({
472
+ status: z.string(),
473
+ uaid: z.string().optional(),
474
+ transactionId: z.string().optional(),
475
+ consensusTimestamp: z.string().optional(),
476
+ registryTopicId: z.string().optional(),
477
+ topicSequenceNumber: z.number().optional(),
478
+ payloadHash: z.string().optional(),
479
+ profileReference: z.string().optional(),
480
+ tId: z.string().optional(),
481
+ profileSizeBytes: z.number().optional(),
482
+ error: z.string().optional()
483
+ }).passthrough();
484
+ const additionalRegistryNetworkSchema = z.object({
485
+ key: z.string(),
486
+ registryId: z.string().optional(),
487
+ networkId: z.string().optional(),
488
+ name: z.string().optional(),
489
+ chainId: z.number().optional(),
490
+ label: z.string().optional(),
491
+ estimatedCredits: z.number().nullable().optional(),
492
+ baseCredits: z.number().nullable().optional(),
493
+ gasPortionCredits: z.number().nullable().optional(),
494
+ gasPortionUsd: z.number().nullable().optional(),
495
+ gasEstimateCredits: z.number().nullable().optional(),
496
+ gasEstimateUsd: z.number().nullable().optional(),
497
+ gasPriceGwei: z.number().nullable().optional(),
498
+ gasLimit: z.number().nullable().optional(),
499
+ minCredits: z.number().nullable().optional(),
500
+ creditMode: z.string().nullable().optional()
501
+ }).passthrough();
502
+ const additionalRegistryDescriptorSchema = z.object({
503
+ id: z.string(),
504
+ label: z.string(),
505
+ networks: z.array(additionalRegistryNetworkSchema)
506
+ });
507
+ const additionalRegistryCatalogResponseSchema = z.object({
508
+ registries: z.array(additionalRegistryDescriptorSchema)
509
+ });
510
+ const registerAgentSuccessResponse = z.object({
511
+ success: z.literal(true),
512
+ status: z.enum(["created", "duplicate", "updated"]).optional(),
513
+ uaid: z.string(),
514
+ agentId: z.string(),
515
+ message: z.string().optional(),
516
+ registry: z.string().optional(),
517
+ attemptId: z.string().nullable().optional(),
518
+ agent: registrationAgentSchema,
519
+ openConvAI: z.object({
520
+ compatible: z.boolean(),
521
+ hcs11Profile: agentProfileSchema.optional(),
522
+ bridgeEndpoint: z.string().optional()
523
+ }).optional(),
524
+ profile: registrationProfileInfoSchema.optional(),
525
+ profileRegistry: profileRegistrySchema.nullable().optional(),
526
+ hcs10Registry: hcs10RegistrySchema.nullable().optional(),
527
+ credits: registrationCreditsSchema.optional(),
528
+ additionalRegistries: z.array(additionalRegistryResultSchema).optional(),
529
+ additionalRegistryCredits: z.array(additionalRegistryResultSchema).optional(),
530
+ additionalRegistryCostPerRegistry: z.number().optional()
531
+ });
532
+ const registerAgentPendingResponse = z.object({
533
+ success: z.literal(true),
534
+ status: z.literal("pending"),
535
+ message: z.string(),
536
+ uaid: z.string(),
537
+ agentId: z.string(),
538
+ registry: z.string().optional(),
539
+ attemptId: z.string().nullable(),
540
+ agent: registrationAgentSchema,
541
+ openConvAI: z.object({
542
+ compatible: z.boolean(),
543
+ hcs11Profile: agentProfileSchema.optional(),
544
+ bridgeEndpoint: z.string().optional()
545
+ }).optional(),
546
+ profile: registrationProfileInfoSchema.optional(),
547
+ profileRegistry: profileRegistrySchema.nullable().optional(),
548
+ hcs10Registry: hcs10RegistrySchema.nullable().optional(),
549
+ credits: registrationCreditsSchema,
550
+ additionalRegistries: z.array(additionalRegistryResultSchema),
551
+ additionalRegistryCredits: z.array(additionalRegistryResultSchema).optional(),
552
+ additionalRegistryCostPerRegistry: z.number().optional()
553
+ });
554
+ const registerAgentPartialResponse = z.object({
555
+ success: z.literal(false),
556
+ status: z.literal("partial"),
557
+ message: z.string(),
558
+ uaid: z.string(),
559
+ agentId: z.string(),
560
+ registry: z.string().optional(),
561
+ attemptId: z.string().nullable().optional(),
562
+ agent: registrationAgentSchema,
563
+ openConvAI: z.object({
564
+ compatible: z.boolean(),
565
+ hcs11Profile: agentProfileSchema.optional(),
566
+ bridgeEndpoint: z.string().optional()
567
+ }).optional(),
568
+ profile: registrationProfileInfoSchema.optional(),
569
+ profileRegistry: profileRegistrySchema.nullable().optional(),
570
+ hcs10Registry: hcs10RegistrySchema.nullable().optional(),
571
+ credits: registrationCreditsSchema.optional(),
572
+ additionalRegistries: z.array(additionalRegistryResultSchema).optional(),
573
+ additionalRegistryCredits: z.array(additionalRegistryResultSchema).optional(),
574
+ additionalRegistryCostPerRegistry: z.number().optional(),
575
+ errors: z.array(
576
+ z.object({
577
+ registry: z.string(),
578
+ registryKey: z.string().nullable().optional(),
579
+ error: z.string()
580
+ })
581
+ ).min(1)
582
+ });
583
+ const registerAgentResponseSchema = z.union([
584
+ registerAgentSuccessResponse,
585
+ registerAgentPendingResponse,
586
+ registerAgentPartialResponse
587
+ ]);
588
+ const registrationProgressAdditionalEntry = z.object({
589
+ registryId: z.string(),
590
+ registryKey: z.string(),
591
+ networkId: z.string().optional(),
592
+ networkName: z.string().optional(),
593
+ chainId: z.number().optional(),
594
+ label: z.string().optional(),
595
+ status: z.enum(["pending", "in_progress", "completed", "failed"]),
596
+ error: z.string().optional(),
597
+ credits: z.number().nullable().optional(),
598
+ agentId: z.string().nullable().optional(),
599
+ agentUri: z.string().nullable().optional(),
600
+ metadata: z.record(jsonValueSchema).optional(),
601
+ lastUpdated: z.string()
602
+ });
603
+ const registrationProgressRecord = z.object({
604
+ attemptId: z.string(),
605
+ mode: z.enum(["register", "update"]),
606
+ status: z.enum(["pending", "partial", "completed", "failed"]),
607
+ uaid: z.string().optional(),
608
+ agentId: z.string().optional(),
609
+ registryNamespace: z.string(),
610
+ accountId: z.string().optional(),
611
+ startedAt: z.string(),
612
+ completedAt: z.string().optional(),
613
+ primary: z.object({
614
+ status: z.enum(["pending", "completed", "failed"]),
615
+ finishedAt: z.string().optional(),
616
+ error: z.string().optional()
617
+ }),
618
+ additionalRegistries: z.record(
619
+ z.string(),
620
+ registrationProgressAdditionalEntry
621
+ ),
622
+ errors: z.array(z.string()).optional()
623
+ });
624
+ const registrationProgressResponseSchema = z.object({
625
+ progress: registrationProgressRecord
626
+ });
627
+ const registrationQuoteResponseSchema = z.object({
628
+ accountId: z.string().nullable().optional(),
629
+ registry: z.string().optional(),
630
+ protocol: z.string().optional(),
631
+ requiredCredits: z.number(),
632
+ availableCredits: z.number().nullable().optional(),
633
+ shortfallCredits: z.number().nullable().optional(),
634
+ creditsPerHbar: z.number().nullable().optional(),
635
+ estimatedHbar: z.number().nullable().optional()
636
+ });
637
+ const creditPurchaseResponseSchema = z.object({
638
+ success: z.boolean().optional(),
639
+ purchaser: z.string(),
640
+ credits: z.number(),
641
+ hbarAmount: z.number(),
642
+ transactionId: z.string(),
643
+ consensusTimestamp: z.string().nullable().optional()
644
+ });
645
+ const x402SettlementSchema = z.object({
646
+ success: z.boolean().optional(),
647
+ transaction: z.string().optional(),
648
+ network: z.string().optional(),
649
+ payer: z.string().optional(),
650
+ errorReason: z.string().optional()
651
+ }).strict();
652
+ const x402CreditPurchaseResponseSchema = z.object({
653
+ success: z.boolean(),
654
+ accountId: z.string(),
655
+ creditedCredits: z.number(),
656
+ usdAmount: z.number(),
657
+ balance: z.number(),
658
+ payment: z.object({
659
+ payer: z.string().optional(),
660
+ requirement: z.record(jsonValueSchema).optional(),
661
+ settlement: x402SettlementSchema.optional()
662
+ }).optional()
663
+ });
664
+ const x402MinimumsResponseSchema = z.object({
665
+ minimums: z.record(
666
+ z.object({
667
+ network: z.string().optional(),
668
+ gasLimit: z.number().optional(),
669
+ gasPriceWei: z.string().optional(),
670
+ gasUsd: z.number().optional(),
671
+ minUsd: z.number().optional(),
672
+ ethUsd: z.number().optional(),
673
+ fetchedAt: z.string().optional(),
674
+ source: z.string().optional()
675
+ })
676
+ ).optional(),
677
+ creditUnitUsd: z.number().optional()
678
+ });
679
+ const adaptersResponseSchema = z.object({
680
+ adapters: z.array(z.string())
681
+ });
682
+ const adapterChatProfileSchema = z.object({
683
+ supportsChat: z.boolean(),
684
+ delivery: z.string().optional(),
685
+ transport: z.string().optional(),
686
+ streaming: z.boolean().optional(),
687
+ requiresAuth: z.array(z.string()).optional(),
688
+ notes: z.string().optional()
689
+ });
690
+ const adapterCapabilitiesSchema = z.object({
691
+ discovery: z.boolean(),
692
+ routing: z.boolean(),
693
+ communication: z.boolean(),
694
+ translation: z.boolean(),
695
+ protocols: z.array(z.string())
696
+ });
697
+ const adapterDescriptorSchema = z.object({
698
+ id: z.string(),
699
+ name: z.string(),
700
+ version: z.string(),
701
+ author: z.string(),
702
+ description: z.string(),
703
+ supportedProtocols: z.array(z.string()),
704
+ registryType: z.enum(["web2", "web3", "hybrid"]),
705
+ chatProfile: adapterChatProfileSchema.optional(),
706
+ capabilities: adapterCapabilitiesSchema,
707
+ enabled: z.boolean(),
708
+ priority: z.number(),
709
+ status: z.enum(["running", "stopped"])
710
+ });
711
+ const adapterDetailsResponseSchema = z.object({
712
+ adapters: z.array(adapterDescriptorSchema)
713
+ });
714
+ const metadataFacetOptionSchema = z.object({
715
+ value: z.union([z.string(), z.number(), z.boolean()]),
716
+ label: z.string()
717
+ });
718
+ const searchFacetSchema = z.object({
719
+ key: z.string(),
720
+ label: z.string(),
721
+ description: z.string().optional(),
722
+ type: z.enum(["string", "boolean", "number"]),
723
+ adapters: z.array(z.string()).optional(),
724
+ options: z.array(metadataFacetOptionSchema).optional()
725
+ });
726
+ const searchFacetsResponseSchema = z.object({
727
+ facets: z.array(searchFacetSchema)
728
+ });
172
729
  export {
173
- HCSParser
730
+ AIAgentCapability,
731
+ AIAgentType,
732
+ adapterChatProfileSchema,
733
+ adapterDescriptorSchema,
734
+ adapterDetailsResponseSchema,
735
+ adaptersResponseSchema,
736
+ additionalRegistryCatalogResponseSchema,
737
+ chatHistoryCompactionResponseSchema,
738
+ chatHistorySnapshotResponseSchema,
739
+ createSessionResponseSchema,
740
+ creditPurchaseResponseSchema,
741
+ dashboardStatsResponseSchema,
742
+ detectProtocolResponseSchema,
743
+ encryptionHandshakeResponseSchema,
744
+ ledgerChallengeResponseSchema,
745
+ ledgerVerifyResponseSchema,
746
+ metricsSummaryResponseSchema,
747
+ popularResponseSchema,
748
+ protocolsResponseSchema,
749
+ registerAgentResponseSchema,
750
+ registerEncryptionKeyResponseSchema,
751
+ registrationProgressResponseSchema,
752
+ registrationQuoteResponseSchema,
753
+ registriesResponseSchema,
754
+ registrySearchByNamespaceSchema,
755
+ resolveResponseSchema,
756
+ searchFacetsResponseSchema,
757
+ searchResponseSchema,
758
+ searchStatusResponseSchema,
759
+ sendMessageResponseSchema,
760
+ sessionEncryptionStatusResponseSchema,
761
+ statsResponseSchema,
762
+ uaidConnectionStatusSchema,
763
+ uaidValidationResponseSchema,
764
+ vectorSearchResponseSchema,
765
+ websocketStatsResponseSchema,
766
+ x402CreditPurchaseResponseSchema,
767
+ x402MinimumsResponseSchema
174
768
  };
175
769
  //# sourceMappingURL=standards-sdk.es141.js.map