@hashgraphonline/standards-sdk 0.1.182 → 0.1.184

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 (155) hide show
  1. package/dist/browser/services/registry-broker/client/base-client.d.ts +2 -1
  2. package/dist/browser/services/registry-broker/client/base-client.d.ts.map +1 -1
  3. package/dist/browser/services/registry-broker/client/chat.d.ts +3 -1
  4. package/dist/browser/services/registry-broker/client/chat.d.ts.map +1 -1
  5. package/dist/browser/services/registry-broker/index.d.ts +1 -0
  6. package/dist/browser/services/registry-broker/index.d.ts.map +1 -1
  7. package/dist/browser/services/registry-broker/schemas.d.ts +313 -28
  8. package/dist/browser/services/registry-broker/schemas.d.ts.map +1 -1
  9. package/dist/browser/services/registry-broker/types.d.ts +12 -1
  10. package/dist/browser/services/registry-broker/types.d.ts.map +1 -1
  11. package/dist/browser/standards-sdk.browser.js +45 -0
  12. package/dist/browser/standards-sdk.browser.js.map +1 -1
  13. package/dist/browser-root/services/registry-broker/client/base-client.d.ts +2 -1
  14. package/dist/browser-root/services/registry-broker/client/base-client.d.ts.map +1 -1
  15. package/dist/browser-root/services/registry-broker/client/chat.d.ts +3 -1
  16. package/dist/browser-root/services/registry-broker/client/chat.d.ts.map +1 -1
  17. package/dist/browser-root/services/registry-broker/index.d.ts +1 -0
  18. package/dist/browser-root/services/registry-broker/index.d.ts.map +1 -1
  19. package/dist/browser-root/services/registry-broker/schemas.d.ts +313 -28
  20. package/dist/browser-root/services/registry-broker/schemas.d.ts.map +1 -1
  21. package/dist/browser-root/services/registry-broker/types.d.ts +12 -1
  22. package/dist/browser-root/services/registry-broker/types.d.ts.map +1 -1
  23. package/dist/browser-root/standards-sdk.root-browser.js +77 -0
  24. package/dist/browser-root/standards-sdk.root-browser.js.map +1 -1
  25. package/dist/cjs/services/registry-broker/client/base-client.d.ts +2 -1
  26. package/dist/cjs/services/registry-broker/client/base-client.d.ts.map +1 -1
  27. package/dist/cjs/services/registry-broker/client/chat.d.ts +3 -1
  28. package/dist/cjs/services/registry-broker/client/chat.d.ts.map +1 -1
  29. package/dist/cjs/services/registry-broker/index.d.ts +1 -0
  30. package/dist/cjs/services/registry-broker/index.d.ts.map +1 -1
  31. package/dist/cjs/services/registry-broker/schemas.d.ts +313 -28
  32. package/dist/cjs/services/registry-broker/schemas.d.ts.map +1 -1
  33. package/dist/cjs/services/registry-broker/types.d.ts +12 -1
  34. package/dist/cjs/services/registry-broker/types.d.ts.map +1 -1
  35. package/dist/cjs/standards-sdk.cjs +2 -2
  36. package/dist/cjs/standards-sdk.cjs.map +1 -1
  37. package/dist/es/services/registry-broker/client/base-client.d.ts +2 -1
  38. package/dist/es/services/registry-broker/client/base-client.d.ts.map +1 -1
  39. package/dist/es/services/registry-broker/client/chat.d.ts +3 -1
  40. package/dist/es/services/registry-broker/client/chat.d.ts.map +1 -1
  41. package/dist/es/services/registry-broker/index.d.ts +1 -0
  42. package/dist/es/services/registry-broker/index.d.ts.map +1 -1
  43. package/dist/es/services/registry-broker/schemas.d.ts +313 -28
  44. package/dist/es/services/registry-broker/schemas.d.ts.map +1 -1
  45. package/dist/es/services/registry-broker/types.d.ts +12 -1
  46. package/dist/es/services/registry-broker/types.d.ts.map +1 -1
  47. package/dist/es/standards-sdk.es.js +12 -4
  48. package/dist/es/standards-sdk.es.js.map +1 -1
  49. package/dist/es/standards-sdk.es104.js +1 -1
  50. package/dist/es/standards-sdk.es106.js +1 -1
  51. package/dist/es/standards-sdk.es108.js +1 -1
  52. package/dist/es/standards-sdk.es11.js +1 -1
  53. package/dist/es/standards-sdk.es110.js +1 -1
  54. package/dist/es/standards-sdk.es116.js +1 -1
  55. package/dist/es/standards-sdk.es12.js +1 -1
  56. package/dist/es/standards-sdk.es121.js +1 -1
  57. package/dist/es/standards-sdk.es127.js +1 -1
  58. package/dist/es/standards-sdk.es128.js +5 -5
  59. package/dist/es/standards-sdk.es138.js +1 -1
  60. package/dist/es/standards-sdk.es139.js +1 -1
  61. package/dist/es/standards-sdk.es140.js +5 -5
  62. package/dist/es/standards-sdk.es142.js +1 -1
  63. package/dist/es/standards-sdk.es145.js +7 -4
  64. package/dist/es/standards-sdk.es145.js.map +1 -1
  65. package/dist/es/standards-sdk.es147.js +1 -1
  66. package/dist/es/standards-sdk.es148.js.map +1 -1
  67. package/dist/es/standards-sdk.es149.js +1 -1
  68. package/dist/es/standards-sdk.es152.js +2547 -159
  69. package/dist/es/standards-sdk.es152.js.map +1 -1
  70. package/dist/es/standards-sdk.es153.js +159 -7
  71. package/dist/es/standards-sdk.es153.js.map +1 -1
  72. package/dist/es/standards-sdk.es154.js +7 -86
  73. package/dist/es/standards-sdk.es154.js.map +1 -1
  74. package/dist/es/standards-sdk.es155.js +64 -43
  75. package/dist/es/standards-sdk.es155.js.map +1 -1
  76. package/dist/es/standards-sdk.es156.js +65 -30
  77. package/dist/es/standards-sdk.es156.js.map +1 -1
  78. package/dist/es/standards-sdk.es157.js +30 -34
  79. package/dist/es/standards-sdk.es157.js.map +1 -1
  80. package/dist/es/standards-sdk.es158.js +34 -48
  81. package/dist/es/standards-sdk.es158.js.map +1 -1
  82. package/dist/es/standards-sdk.es159.js +48 -138
  83. package/dist/es/standards-sdk.es159.js.map +1 -1
  84. package/dist/es/standards-sdk.es16.js +1 -1
  85. package/dist/es/standards-sdk.es160.js +133 -37
  86. package/dist/es/standards-sdk.es160.js.map +1 -1
  87. package/dist/es/standards-sdk.es161.js +42 -2494
  88. package/dist/es/standards-sdk.es161.js.map +1 -1
  89. package/dist/es/standards-sdk.es163.js +54 -15
  90. package/dist/es/standards-sdk.es163.js.map +1 -1
  91. package/dist/es/standards-sdk.es164.js +102 -47
  92. package/dist/es/standards-sdk.es164.js.map +1 -1
  93. package/dist/es/standards-sdk.es165.js +64 -94
  94. package/dist/es/standards-sdk.es165.js.map +1 -1
  95. package/dist/es/standards-sdk.es166.js +180 -61
  96. package/dist/es/standards-sdk.es166.js.map +1 -1
  97. package/dist/es/standards-sdk.es167.js +14 -197
  98. package/dist/es/standards-sdk.es167.js.map +1 -1
  99. package/dist/es/standards-sdk.es168.js +658 -158
  100. package/dist/es/standards-sdk.es168.js.map +1 -1
  101. package/dist/es/standards-sdk.es169.js +139 -289
  102. package/dist/es/standards-sdk.es169.js.map +1 -1
  103. package/dist/es/standards-sdk.es170.js +274 -298
  104. package/dist/es/standards-sdk.es170.js.map +1 -1
  105. package/dist/es/standards-sdk.es171.js +262 -369
  106. package/dist/es/standards-sdk.es171.js.map +1 -1
  107. package/dist/es/standards-sdk.es172.js +316 -194
  108. package/dist/es/standards-sdk.es172.js.map +1 -1
  109. package/dist/es/standards-sdk.es173.js +319 -64
  110. package/dist/es/standards-sdk.es173.js.map +1 -1
  111. package/dist/es/standards-sdk.es174.js +68 -664
  112. package/dist/es/standards-sdk.es174.js.map +1 -1
  113. package/dist/es/standards-sdk.es176.js +1 -1
  114. package/dist/es/standards-sdk.es177.js +24 -1
  115. package/dist/es/standards-sdk.es177.js.map +1 -1
  116. package/dist/es/standards-sdk.es179.js +2 -2
  117. package/dist/es/standards-sdk.es18.js +3 -3
  118. package/dist/es/standards-sdk.es180.js +1 -1
  119. package/dist/es/standards-sdk.es181.js +1 -1
  120. package/dist/es/standards-sdk.es182.js +2 -2
  121. package/dist/es/standards-sdk.es183.js +1 -1
  122. package/dist/es/standards-sdk.es184.js +1 -1
  123. package/dist/es/standards-sdk.es185.js +1 -1
  124. package/dist/es/standards-sdk.es19.js +1 -1
  125. package/dist/es/standards-sdk.es22.js +1 -1
  126. package/dist/es/standards-sdk.es27.js +3 -3
  127. package/dist/es/standards-sdk.es35.js +1 -1
  128. package/dist/es/standards-sdk.es36.js +2 -2
  129. package/dist/es/standards-sdk.es4.js +1 -1
  130. package/dist/es/standards-sdk.es53.js +1 -1
  131. package/dist/es/standards-sdk.es56.js +1 -1
  132. package/dist/es/standards-sdk.es59.js +1 -1
  133. package/dist/es/standards-sdk.es60.js +1 -1
  134. package/dist/es/standards-sdk.es62.js +1 -1
  135. package/dist/es/standards-sdk.es63.js +2 -2
  136. package/dist/es/standards-sdk.es64.js +1 -1
  137. package/dist/es/standards-sdk.es65.js +1 -1
  138. package/dist/es/standards-sdk.es66.js +1 -1
  139. package/dist/es/standards-sdk.es67.js +2 -2
  140. package/dist/es/standards-sdk.es69.js +1 -1
  141. package/dist/es/standards-sdk.es7.js +1 -1
  142. package/dist/es/standards-sdk.es71.js +1 -1
  143. package/dist/es/standards-sdk.es72.js +2 -2
  144. package/dist/es/standards-sdk.es75.js +2 -2
  145. package/dist/es/standards-sdk.es76.js +1 -1
  146. package/dist/es/standards-sdk.es78.js +1 -1
  147. package/dist/es/standards-sdk.es83.js +1 -1
  148. package/dist/es/standards-sdk.es84.js +1 -1
  149. package/dist/es/standards-sdk.es85.js +1 -1
  150. package/dist/es/standards-sdk.es88.js +1 -1
  151. package/dist/es/standards-sdk.es90.js +1 -1
  152. package/dist/es/standards-sdk.es94.js +3 -3
  153. package/dist/es/standards-sdk.es98.js +1 -1
  154. package/dist/es/standards-sdk.es99.js +1 -1
  155. package/package.json +1 -1
@@ -1,2497 +1,45 @@
1
- import { z } from "zod";
2
- import { adapterDeclarationSchema } from "./standards-sdk.es86.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([
118
- "user",
119
- "agent",
120
- "system",
121
- "tool",
122
- "payment",
123
- "delivery",
124
- "error"
125
- ]),
126
- content: z.string(),
127
- timestamp: z.string(),
128
- cipherEnvelope: cipherEnvelopeSchema.optional(),
129
- metadata: z.record(jsonValueSchema).optional()
130
- });
131
- const chatDeliveryStateSchema = z.enum([
132
- "draft",
133
- "queued",
134
- "persisted",
135
- "delivered",
136
- "streaming",
137
- "responded",
138
- "failed",
139
- "timeout",
140
- "cancelled"
141
- ]);
142
- const chatReadinessStatusSchema = z.enum([
143
- "responsive",
144
- "delivery_only",
145
- "degraded",
146
- "blocked",
147
- "unknown"
148
- ]);
149
- const chatReplyModeSchema = z.enum([
150
- "direct",
151
- "stream",
152
- "poll",
153
- "delivery_only",
154
- "none"
155
- ]);
156
- const chatRouteTypeSchema = z.enum([
157
- "a2a",
158
- "hcs-10",
159
- "mcp",
160
- "openrouter",
161
- "acp",
162
- "xmtp",
163
- "moltbook",
164
- "agentverse",
165
- "nanda",
166
- "http",
167
- "erc-8004",
168
- "x402",
169
- "unknown"
170
- ]);
171
- const chatSessionStateSchema = z.enum([
172
- "connecting",
173
- "ready",
174
- "blocked",
175
- "ended",
176
- "expired"
177
- ]);
178
- const chatErrorCodeSchema = z.enum([
179
- "AUTH_REQUIRED",
180
- "CREDITS_REQUIRED",
181
- "PAYMENT_REQUIRED",
182
- "AGENT_UNRESPONSIVE",
183
- "ROUTE_UNAVAILABLE",
184
- "PROTOCOL_UNSUPPORTED",
185
- "BROKER_NOT_EXECUTABLE",
186
- "NETWORK_TIMEOUT",
187
- "STREAM_STALLED",
188
- "HISTORY_UNAVAILABLE",
189
- "ENCRYPTION_REQUIRED",
190
- "RATE_LIMITED",
191
- "VALIDATION_ERROR",
192
- "UNKNOWN_ERROR"
193
- ]);
194
- const chatRouteSummarySchema = z.object({
195
- type: chatRouteTypeSchema,
196
- replyMode: chatReplyModeSchema,
197
- transport: z.string(),
198
- endpoint: z.string().optional()
199
- });
200
- const chatPaymentStateSchema = z.object({
201
- required: z.boolean(),
202
- provider: z.enum(["credits", "x402", "acp", "openrouter"]).optional(),
203
- status: z.enum([
204
- "not_required",
205
- "preflight",
206
- "required",
207
- "approved",
208
- "paid",
209
- "failed"
210
- ]),
211
- estimatedCredits: z.number().nullable().optional(),
212
- estimatedUsd: z.number().nullable().optional()
213
- });
214
- const chatReadinessResponseSchema = z.object({
215
- status: chatReadinessStatusSchema,
216
- routeType: chatRouteTypeSchema,
217
- replyMode: chatReplyModeSchema,
218
- transport: z.string(),
219
- endpoint: z.string().optional(),
220
- checkedAt: z.string(),
221
- cachedUntil: z.string(),
222
- latencyMs: z.number().nullable().optional(),
223
- lastSuccessfulReplyAt: z.string().nullable().optional(),
224
- lastDeliveryConfirmationAt: z.string().nullable().optional(),
225
- lastFailureCode: chatErrorCodeSchema.nullable().optional(),
226
- supportsStreaming: z.boolean(),
227
- supportsHistory: z.boolean(),
228
- supportsEncryption: z.boolean(),
229
- supportsPayments: z.boolean(),
230
- supportsAttachments: z.boolean(),
231
- requiresAuth: z.boolean(),
232
- operatorActionRequired: z.boolean(),
233
- issue: z.object({
234
- code: z.string(),
235
- message: z.string(),
236
- details: z.string().optional()
237
- }).optional()
238
- });
239
- const metadataFacetSchema = z.record(
240
- z.union([
241
- z.array(jsonValueSchema),
242
- z.record(jsonValueSchema),
243
- jsonValueSchema
244
- ])
245
- ).optional();
246
- const searchHitSchema = z.object({
247
- id: z.string(),
248
- uaid: z.string(),
249
- registry: z.string(),
250
- name: z.string(),
251
- description: z.string().optional(),
252
- capabilities: z.array(capabilityValueSchema),
253
- endpoints: z.union([z.record(jsonValueSchema), z.array(z.string())]).optional(),
254
- metadata: z.record(jsonValueSchema).optional(),
255
- metadataFacet: metadataFacetSchema,
256
- profile: agentProfileSchema.optional(),
257
- protocols: z.array(z.string()).optional(),
258
- adapter: z.string().optional(),
259
- originalId: z.string().optional(),
260
- communicationSupported: z.boolean().optional(),
261
- routingSupported: z.boolean().optional(),
262
- available: z.boolean().optional(),
263
- availabilityStatus: z.string().optional(),
264
- availabilityCheckedAt: z.string().optional(),
265
- availabilitySource: z.string().optional(),
266
- availabilityLatencyMs: z.number().optional(),
267
- availabilityScore: z.number().optional(),
268
- capabilityLabels: z.array(z.string()).optional(),
269
- capabilityTokens: z.array(z.string()).optional(),
270
- image: z.string().optional(),
271
- createdAt: z.string().optional(),
272
- updatedAt: z.string().optional(),
273
- lastSeen: z.string().optional(),
274
- lastIndexed: z.string().optional()
275
- }).passthrough();
276
- const searchResponseSchema = z.object({
277
- hits: z.array(searchHitSchema),
278
- total: z.number(),
279
- page: z.number(),
280
- limit: z.number()
281
- });
282
- const statsResponseSchema = z.object({
283
- totalAgents: z.number(),
284
- registries: z.record(z.number()),
285
- capabilities: z.record(z.number()),
286
- lastUpdate: z.string(),
287
- status: z.string()
288
- });
289
- const registriesResponseSchema = z.object({
290
- registries: z.array(z.string())
291
- });
292
- const popularResponseSchema = z.object({
293
- searches: z.array(z.string())
294
- });
295
- const resolveResponseSchema = z.object({
296
- agent: searchHitSchema
297
- });
298
- const delegationPlanCandidateSchema = z.object({
299
- uaid: z.string(),
300
- score: z.number(),
301
- displayName: z.string().optional(),
302
- summary: z.string().optional(),
303
- protocols: z.array(z.string()).optional(),
304
- surfaces: z.array(z.string()).optional(),
305
- languages: z.array(z.string()).optional(),
306
- artifacts: z.array(z.string()).optional(),
307
- availability: z.boolean().optional(),
308
- explanation: z.string().optional()
309
- }).passthrough();
310
- const delegationOpportunitySchema = z.object({
311
- id: z.string(),
312
- title: z.string(),
313
- reason: z.string(),
314
- role: z.string(),
315
- type: z.enum(["ai-agents", "mcp-servers"]),
316
- suggestedMode: z.enum(["best-match", "fallback", "parallel"]),
317
- searchQueries: z.array(z.string()),
318
- protocols: z.array(z.string()).optional(),
319
- surfaces: z.array(z.string()).optional(),
320
- languages: z.array(z.string()).optional(),
321
- artifacts: z.array(z.string()).optional(),
322
- candidates: z.array(delegationPlanCandidateSchema)
323
- }).passthrough();
324
- const delegationRecommendationSchema = z.object({
325
- action: z.enum(["delegate-now", "review-shortlist", "handle-locally"]),
326
- confidence: z.number(),
327
- reason: z.string(),
328
- opportunityId: z.string().optional(),
329
- candidate: delegationPlanCandidateSchema.optional()
330
- }).passthrough();
331
- const delegationPlanResponseSchema = z.object({
332
- task: z.string(),
333
- context: z.string().optional(),
334
- summary: z.string().optional(),
335
- intents: z.array(z.string()),
336
- protocols: z.array(z.string()),
337
- surfaces: z.array(z.string()),
338
- languages: z.array(z.string()).optional(),
339
- artifacts: z.array(z.string()).optional(),
340
- shouldDelegate: z.boolean(),
341
- localFirstReason: z.string().optional(),
342
- recommendation: delegationRecommendationSchema.optional(),
343
- opportunities: z.array(delegationOpportunitySchema)
344
- }).passthrough();
345
- const agentFeedbackSummarySchema = z.object({
346
- averageScore: z.number(),
347
- totalFeedbacks: z.number(),
348
- registry: z.string().optional(),
349
- network: z.string().optional(),
350
- updatedAt: z.string().optional()
351
- });
352
- const agentFeedbackEntrySchema = z.object({
353
- registry: z.string(),
354
- network: z.string().optional(),
355
- agentId: z.number(),
356
- client: z.string(),
357
- score: z.number(),
358
- tag1: z.string().nullable().optional(),
359
- tag2: z.string().nullable().optional(),
360
- revoked: z.boolean(),
361
- feedbackIndex: z.number().nullable().optional(),
362
- fileUri: z.string().nullable().optional(),
363
- fileHash: z.string().nullable().optional(),
364
- createdAt: z.string().nullable().optional()
365
- });
366
- const agentFeedbackResponseSchema = z.object({
367
- uaid: z.string(),
368
- summary: agentFeedbackSummarySchema,
369
- entries: z.array(agentFeedbackEntrySchema)
370
- });
371
- const agentFeedbackEligibilityResponseSchema = z.object({
372
- uaid: z.string(),
373
- sessionId: z.string(),
374
- eligible: z.boolean(),
375
- messageCount: z.number(),
376
- minimumMessages: z.number(),
377
- reason: z.string().optional(),
378
- onchain: z.object({
379
- eligible: z.boolean(),
380
- reason: z.string().optional(),
381
- estimatedCredits: z.number().optional(),
382
- usdEstimate: z.number().optional(),
383
- nativeFeeEstimate: z.number().optional()
384
- }).optional()
385
- });
386
- const agentFeedbackSubmissionResponseSchema = z.object({
387
- uaid: z.string(),
388
- registry: z.string(),
389
- network: z.string().optional(),
390
- agentId: z.number(),
391
- score: z.number(),
392
- tag1: z.string().nullable().optional(),
393
- tag2: z.string().nullable().optional(),
394
- fileUri: z.string().nullable().optional(),
395
- fileHash: z.string().nullable().optional(),
396
- feedbackIndex: z.number().nullable().optional(),
397
- transactionHash: z.string().nullable().optional(),
398
- signature: z.string().nullable().optional(),
399
- submittedAt: z.string()
400
- });
401
- const agentFeedbackIndexResponseSchema = z.object({
402
- page: z.number(),
403
- limit: z.number(),
404
- total: z.number(),
405
- items: z.array(
406
- z.object({
407
- uaid: z.string(),
408
- registry: z.string(),
409
- network: z.string().optional(),
410
- agentId: z.number().nullable().optional(),
411
- summary: agentFeedbackSummarySchema.nullable(),
412
- trustScore: z.number().nullable().optional()
413
- })
414
- )
415
- });
416
- const agentFeedbackEntriesIndexResponseSchema = z.object({
417
- page: z.number(),
418
- limit: z.number(),
419
- total: z.number(),
420
- items: z.array(
421
- z.object({
422
- uaid: z.string(),
423
- entry: agentFeedbackEntrySchema
424
- })
425
- )
426
- });
427
- const createSessionResponseSchema = z.object({
428
- sessionId: z.string(),
429
- uaid: z.string().nullable().optional(),
430
- agent: z.object({
431
- name: z.string(),
432
- description: z.string().optional(),
433
- capabilities: z.record(jsonValueSchema).nullable().optional(),
434
- skills: z.array(z.string()).optional()
435
- }),
436
- history: z.array(chatHistoryEntrySchema).optional().default([]),
437
- historyTtlSeconds: z.number().nullable().optional(),
438
- encryption: sessionEncryptionSummarySchema.nullable().optional(),
439
- route: chatRouteSummarySchema.optional(),
440
- transport: z.string().optional(),
441
- senderUaid: z.string().nullable().optional(),
442
- visibility: z.enum(["private", "public"]).optional(),
443
- payment: chatPaymentStateSchema.optional(),
444
- readiness: chatReadinessResponseSchema.optional(),
445
- state: chatSessionStateSchema.optional(),
446
- traceId: z.string().optional(),
447
- expiresAt: z.string().nullable().optional()
448
- });
449
- const sendMessageResponseSchema = z.object({
450
- sessionId: z.string(),
451
- uaid: z.string().nullable().optional(),
452
- message: z.string(),
453
- timestamp: z.string(),
454
- rawResponse: jsonValueSchema.optional(),
455
- content: z.string().optional(),
456
- ops: z.array(z.record(jsonValueSchema)).optional(),
457
- history: z.array(chatHistoryEntrySchema).optional(),
458
- historyTtlSeconds: z.number().nullable().optional(),
459
- encrypted: z.boolean().optional(),
460
- messageId: z.string().optional(),
461
- assistantMessageId: z.string().nullable().optional(),
462
- deliveryState: chatDeliveryStateSchema.optional(),
463
- replyMode: chatReplyModeSchema.optional(),
464
- deliveryConfirmation: z.boolean().optional(),
465
- idempotent: z.boolean().optional(),
466
- metadata: z.record(jsonValueSchema).optional(),
467
- errorCode: chatErrorCodeSchema.optional()
468
- });
469
- const chatSessionEndResponseSchema = z.object({
470
- message: z.string(),
471
- sessionId: z.string(),
472
- state: chatSessionStateSchema.optional()
473
- });
474
- const chatHistorySnapshotResponseSchema = z.object({
475
- sessionId: z.string(),
476
- history: z.array(chatHistoryEntrySchema),
477
- historyTtlSeconds: z.number()
478
- });
479
- z.object({
480
- preserveEntries: z.number().int().min(0).optional()
481
- }).strict();
482
- const chatHistoryCompactionResponseSchema = z.object({
483
- sessionId: z.string(),
484
- history: z.array(chatHistoryEntrySchema),
485
- summaryEntry: chatHistoryEntrySchema,
486
- preservedEntries: z.array(chatHistoryEntrySchema),
487
- historyTtlSeconds: z.number(),
488
- creditsDebited: z.number(),
489
- metadata: z.record(jsonValueSchema).optional()
490
- });
491
- const sessionEncryptionStatusResponseSchema = z.object({
492
- sessionId: z.string(),
493
- encryption: sessionEncryptionSummarySchema.nullable()
494
- });
495
- const encryptionHandshakeResponseSchema = z.object({
496
- sessionId: z.string(),
497
- handshake: encryptionHandshakeRecordSchema
498
- });
499
- const registerEncryptionKeyResponseSchema = z.object({
500
- id: z.string(),
501
- keyType: z.string(),
502
- publicKey: z.string(),
503
- uaid: z.string().nullable(),
504
- ledgerAccountId: z.string().nullable(),
505
- ledgerNetwork: z.string().nullable().optional(),
506
- userId: z.string().nullable().optional(),
507
- email: z.string().nullable().optional(),
508
- createdAt: z.string(),
509
- updatedAt: z.string()
510
- });
511
- const ledgerChallengeResponseSchema = z.object({
512
- challengeId: z.string(),
513
- message: z.string(),
514
- expiresAt: z.string()
515
- });
516
- const ledgerApiKeySummarySchema = z.object({
517
- id: z.string(),
518
- label: z.string().optional(),
519
- prefix: z.string(),
520
- lastFour: z.string(),
521
- createdAt: z.string(),
522
- lastUsedAt: z.string().nullable().optional(),
523
- ownerType: z.literal("ledger"),
524
- ledgerAccountId: z.string().optional(),
525
- ledgerNetwork: z.string().optional(),
526
- ledgerNetworkCanonical: z.string().optional()
527
- });
528
- const ledgerVerifyResponseSchema = z.object({
529
- key: z.string(),
530
- apiKey: ledgerApiKeySummarySchema,
531
- accountId: z.string(),
532
- network: z.string(),
533
- networkCanonical: z.string().optional()
534
- });
535
- const protocolsResponseSchema = z.object({
536
- protocols: z.array(z.string())
537
- });
538
- const detectProtocolResponseSchema = z.object({
539
- protocol: z.string().nullable()
540
- });
541
- const registrySearchByNamespaceSchema = z.object({
542
- hits: z.array(searchHitSchema),
543
- total: z.number(),
544
- page: z.number().optional(),
545
- limit: z.number().optional()
546
- });
547
- const capabilityFilterValueSchema = z.union([z.string(), z.number()]);
548
- const vectorSearchFilterSchema = z.object({
549
- capabilities: z.array(capabilityFilterValueSchema).optional(),
550
- type: z.enum(["ai-agents", "mcp-servers"]).optional(),
551
- registry: z.string().optional(),
552
- protocols: z.array(z.string()).optional(),
553
- adapter: z.array(z.string()).optional()
554
- }).strict();
555
- z.object({
556
- query: z.string(),
557
- filter: vectorSearchFilterSchema.optional(),
558
- limit: z.number().int().min(1).max(100).optional(),
559
- offset: z.number().int().min(0).optional()
560
- }).strict();
561
- const vectorSearchHitSchema = z.object({
562
- agent: searchHitSchema,
563
- score: z.number().optional(),
564
- highlights: z.record(z.array(z.string())).optional()
565
- });
566
- const vectorSearchResponseSchema = z.object({
567
- hits: z.array(vectorSearchHitSchema),
568
- total: z.number(),
569
- took: z.number(),
570
- totalAvailable: z.number().optional(),
571
- visible: z.number().optional(),
572
- limited: z.boolean().optional(),
573
- credits_used: z.number().optional()
574
- });
575
- const vectorStatusSchema = z.object({
576
- enabled: z.boolean(),
577
- healthy: z.boolean(),
578
- mode: z.enum(["disabled", "initializing", "healthy", "degraded", "error"]),
579
- lastUpdated: z.string(),
580
- details: z.record(z.any()).optional(),
581
- lastError: z.object({
582
- message: z.string(),
583
- stack: z.string().optional(),
584
- timestamp: z.string().optional()
585
- }).optional()
586
- });
587
- const searchStatusResponseSchema = z.object({
588
- storageMode: z.string(),
589
- vectorStatus: vectorStatusSchema
590
- });
591
- const websocketStatsResponseSchema = z.object({
592
- clients: z.number(),
593
- stats: z.object({
594
- totalClients: z.number().optional(),
595
- clientsByRegistry: z.record(z.number()).optional(),
596
- clientsByEventType: z.record(z.number()).optional()
597
- }).passthrough()
598
- });
599
- const durationStatsSchema = z.object({
600
- p50: z.number(),
601
- p90: z.number(),
602
- p95: z.number(),
603
- p99: z.number()
604
- });
605
- const metricsSummaryResponseSchema = z.object({
606
- http: z.object({
607
- requestsTotal: z.number(),
608
- activeConnections: z.number(),
609
- requestDuration: durationStatsSchema
610
- }),
611
- search: z.object({
612
- queriesTotal: z.number(),
613
- queryDuration: durationStatsSchema
614
- }),
615
- indexing: z.object({ agentsTotal: z.number(), crawlErrors: z.number() }),
616
- registration: z.object({
617
- total: z.number(),
618
- failures: z.number(),
619
- duration: durationStatsSchema
620
- }),
621
- cache: z.object({
622
- hits: z.number(),
623
- misses: z.number(),
624
- hitRate: z.number()
625
- }),
626
- websocket: z.object({ connections: z.number() })
627
- });
628
- const uaidValidationResponseSchema = z.object({
629
- uaid: z.string(),
630
- valid: z.boolean(),
631
- formats: z.array(z.string())
632
- });
633
- const adapterConnectionSchema = z.object({
634
- id: z.string(),
635
- agentId: z.string(),
636
- protocol: z.string(),
637
- endpoint: z.string(),
638
- status: z.enum(["connected", "disconnected", "error"]),
639
- metadata: z.record(jsonPrimitiveSchema).optional(),
640
- createdAt: z.string()
641
- });
642
- const uaidConnectionStatusSchema = z.object({
643
- connected: z.boolean(),
644
- connection: adapterConnectionSchema.optional(),
645
- adapter: z.string().optional(),
646
- agentId: z.string().optional()
647
- });
648
- const dashboardStatsResponseSchema = z.object({
649
- operatorId: z.string().optional(),
650
- adapters: z.array(
651
- z.object({
652
- name: z.string(),
653
- version: z.string(),
654
- status: z.string(),
655
- agentCount: z.number(),
656
- lastDiscovery: z.string(),
657
- registryType: z.string(),
658
- health: z.string()
659
- })
660
- ).optional(),
661
- totalAgents: z.number().optional(),
662
- elasticsearchDocumentCount: z.number().optional(),
663
- agentsByAdapter: z.record(z.number()).optional(),
664
- agentsByRegistry: z.record(z.number()).optional(),
665
- systemInfo: z.object({
666
- uptime: z.number().optional(),
667
- version: z.string().optional(),
668
- network: z.string().optional()
669
- }).optional()
670
- });
671
- const registrationAgentSchema = z.object({
672
- id: z.string(),
673
- name: z.string(),
674
- type: z.string(),
675
- endpoint: z.string().optional(),
676
- capabilities: z.array(capabilityValueSchema),
677
- registry: z.string().optional(),
678
- protocol: z.string().optional(),
679
- profile: agentProfileSchema.optional(),
680
- nativeId: z.string().optional(),
681
- metadata: z.record(jsonValueSchema).optional()
682
- });
683
- const registrationProfileInfoSchema = z.object({
684
- tId: z.string().nullable(),
685
- sizeBytes: z.number().optional()
686
- });
687
- const profileRegistrySchema = z.object({
688
- topicId: z.string().optional(),
689
- sequenceNumber: z.number().optional(),
690
- profileReference: z.string().optional(),
691
- profileTopicId: z.string().optional()
692
- }).passthrough().nullable().optional();
693
- const additionalRegistryResultSchema = z.object({
694
- registry: z.string(),
695
- status: z.enum([
696
- "created",
697
- "duplicate",
698
- "skipped",
699
- "error",
700
- "updated",
701
- "pending"
702
- ]),
703
- agentId: z.string().nullable().optional(),
704
- agentUri: z.string().nullable().optional(),
705
- error: z.string().optional(),
706
- metadata: z.record(jsonValueSchema).optional(),
707
- registryKey: z.string().optional(),
708
- networkId: z.string().optional(),
709
- networkName: z.string().optional(),
710
- chainId: z.number().optional(),
711
- estimatedCredits: z.number().nullable().optional(),
712
- gasEstimateCredits: z.number().nullable().optional(),
713
- gasEstimateUsd: z.number().nullable().optional(),
714
- gasPriceGwei: z.number().nullable().optional(),
715
- gasLimit: z.number().nullable().optional(),
716
- creditMode: z.enum(["fixed", "gas"]).nullable().optional(),
717
- minCredits: z.number().nullable().optional(),
718
- consumedCredits: z.number().nullable().optional(),
719
- cost: z.object({
720
- credits: z.number(),
721
- usd: z.number(),
722
- eth: z.number(),
723
- gasUsedWei: z.string(),
724
- effectiveGasPriceWei: z.string().nullable().optional(),
725
- transactions: z.array(
726
- z.object({
727
- hash: z.string(),
728
- gasUsedWei: z.string(),
729
- effectiveGasPriceWei: z.string().nullable().optional(),
730
- costWei: z.string()
731
- })
732
- ).optional()
733
- }).optional()
734
- });
735
- const registrationCreditsSchema = z.object({
736
- base: z.number(),
737
- additional: z.number(),
738
- total: z.number()
739
- });
740
- const hcs10RegistrySchema = z.object({
741
- status: z.string(),
742
- uaid: z.string().optional(),
743
- transactionId: z.string().optional(),
744
- consensusTimestamp: z.string().optional(),
745
- registryTopicId: z.string().optional(),
746
- topicSequenceNumber: z.number().optional(),
747
- payloadHash: z.string().optional(),
748
- profileReference: z.string().optional(),
749
- tId: z.string().optional(),
750
- profileSizeBytes: z.number().optional(),
751
- error: z.string().optional()
752
- }).passthrough();
753
- const additionalRegistryNetworkSchema = z.object({
754
- key: z.string(),
755
- registryId: z.string().optional(),
756
- networkId: z.string().optional(),
757
- name: z.string().optional(),
758
- chainId: z.number().optional(),
759
- label: z.string().optional(),
760
- estimatedCredits: z.number().nullable().optional(),
761
- baseCredits: z.number().nullable().optional(),
762
- gasPortionCredits: z.number().nullable().optional(),
763
- gasPortionUsd: z.number().nullable().optional(),
764
- gasEstimateCredits: z.number().nullable().optional(),
765
- gasEstimateUsd: z.number().nullable().optional(),
766
- gasPriceGwei: z.number().nullable().optional(),
767
- gasLimit: z.number().nullable().optional(),
768
- minCredits: z.number().nullable().optional(),
769
- creditMode: z.string().nullable().optional()
770
- }).passthrough();
771
- const additionalRegistryDescriptorSchema = z.object({
772
- id: z.string(),
773
- label: z.string(),
774
- networks: z.array(additionalRegistryNetworkSchema)
775
- });
776
- const additionalRegistryCatalogResponseSchema = z.object({
777
- registries: z.array(additionalRegistryDescriptorSchema)
778
- });
779
- const registerAgentSuccessResponse = z.object({
780
- success: z.literal(true),
781
- status: z.enum(["created", "duplicate", "updated"]).optional(),
782
- uaid: z.string(),
783
- agentId: z.string(),
784
- message: z.string().optional(),
785
- registry: z.string().optional(),
786
- attemptId: z.string().nullable().optional(),
787
- agent: registrationAgentSchema,
788
- openConvAI: z.object({
789
- compatible: z.boolean(),
790
- hcs11Profile: agentProfileSchema.optional(),
791
- bridgeEndpoint: z.string().optional()
792
- }).optional(),
793
- profile: registrationProfileInfoSchema.optional(),
794
- profileRegistry: profileRegistrySchema.nullable().optional(),
795
- hcs10Registry: hcs10RegistrySchema.nullable().optional(),
796
- credits: registrationCreditsSchema.optional(),
797
- additionalRegistries: z.array(additionalRegistryResultSchema).optional(),
798
- additionalRegistryCredits: z.array(additionalRegistryResultSchema).optional(),
799
- additionalRegistryCostPerRegistry: z.number().optional(),
800
- additionalRegistrySecrets: z.record(z.string(), z.record(jsonValueSchema)).optional()
801
- });
802
- const registerAgentPendingResponse = z.object({
803
- success: z.literal(true),
804
- status: z.literal("pending"),
805
- message: z.string(),
806
- uaid: z.string(),
807
- agentId: z.string(),
808
- registry: z.string().optional(),
809
- attemptId: z.string().nullable(),
810
- agent: registrationAgentSchema,
811
- openConvAI: z.object({
812
- compatible: z.boolean(),
813
- hcs11Profile: agentProfileSchema.optional(),
814
- bridgeEndpoint: z.string().optional()
815
- }).optional(),
816
- profile: registrationProfileInfoSchema.optional(),
817
- profileRegistry: profileRegistrySchema.nullable().optional(),
818
- hcs10Registry: hcs10RegistrySchema.nullable().optional(),
819
- credits: registrationCreditsSchema,
820
- additionalRegistries: z.array(additionalRegistryResultSchema),
821
- additionalRegistryCredits: z.array(additionalRegistryResultSchema).optional(),
822
- additionalRegistryCostPerRegistry: z.number().optional(),
823
- additionalRegistrySecrets: z.record(z.string(), z.record(jsonValueSchema)).optional()
824
- });
825
- const registerAgentPartialResponse = z.object({
826
- success: z.literal(false),
827
- status: z.literal("partial"),
828
- message: z.string(),
829
- uaid: z.string(),
830
- agentId: z.string(),
831
- registry: z.string().optional(),
832
- attemptId: z.string().nullable().optional(),
833
- agent: registrationAgentSchema,
834
- openConvAI: z.object({
835
- compatible: z.boolean(),
836
- hcs11Profile: agentProfileSchema.optional(),
837
- bridgeEndpoint: z.string().optional()
838
- }).optional(),
839
- profile: registrationProfileInfoSchema.optional(),
840
- profileRegistry: profileRegistrySchema.nullable().optional(),
841
- hcs10Registry: hcs10RegistrySchema.nullable().optional(),
842
- credits: registrationCreditsSchema.optional(),
843
- additionalRegistries: z.array(additionalRegistryResultSchema).optional(),
844
- additionalRegistryCredits: z.array(additionalRegistryResultSchema).optional(),
845
- additionalRegistryCostPerRegistry: z.number().optional(),
846
- additionalRegistrySecrets: z.record(z.string(), z.record(jsonValueSchema)).optional(),
847
- errors: z.array(
848
- z.object({
849
- registry: z.string(),
850
- registryKey: z.string().nullable().optional(),
851
- error: z.string()
852
- })
853
- ).min(1)
854
- });
855
- const registerAgentResponseSchema = z.union([
856
- registerAgentSuccessResponse,
857
- registerAgentPendingResponse,
858
- registerAgentPartialResponse
859
- ]);
860
- const registrationProgressAdditionalEntry = z.object({
861
- registryId: z.string(),
862
- registryKey: z.string(),
863
- networkId: z.string().optional(),
864
- networkName: z.string().optional(),
865
- chainId: z.number().optional(),
866
- label: z.string().optional(),
867
- status: z.enum(["pending", "in_progress", "completed", "failed"]),
868
- error: z.string().optional(),
869
- credits: z.number().nullable().optional(),
870
- agentId: z.string().nullable().optional(),
871
- agentUri: z.string().nullable().optional(),
872
- metadata: z.record(jsonValueSchema).optional(),
873
- lastUpdated: z.string()
874
- });
875
- const registrationProgressRecord = z.object({
876
- attemptId: z.string(),
877
- mode: z.enum(["register", "update"]),
878
- status: z.enum(["pending", "partial", "completed", "failed"]),
879
- uaid: z.string().optional(),
880
- agentId: z.string().optional(),
881
- registryNamespace: z.string(),
882
- accountId: z.string().optional(),
883
- startedAt: z.string(),
884
- completedAt: z.string().optional(),
885
- primary: z.object({
886
- status: z.enum(["pending", "completed", "failed"]),
887
- finishedAt: z.string().optional(),
888
- error: z.string().optional()
889
- }),
890
- additionalRegistries: z.record(
891
- z.string(),
892
- registrationProgressAdditionalEntry
893
- ),
894
- errors: z.array(z.string()).optional()
895
- });
896
- const registrationProgressResponseSchema = z.object({
897
- progress: registrationProgressRecord
898
- });
899
- const registrationQuoteResponseSchema = z.object({
900
- accountId: z.string().nullable().optional(),
901
- registry: z.string().optional(),
902
- protocol: z.string().optional(),
903
- requiredCredits: z.number(),
904
- availableCredits: z.number().nullable().optional(),
905
- shortfallCredits: z.number().nullable().optional(),
906
- creditsPerHbar: z.number().nullable().optional(),
907
- estimatedHbar: z.number().nullable().optional()
908
- });
909
- const creditPurchaseResponseSchema = z.object({
910
- success: z.boolean().optional(),
911
- purchaser: z.string(),
912
- credits: z.number(),
913
- hbarAmount: z.number(),
914
- transactionId: z.string(),
915
- consensusTimestamp: z.string().nullable().optional()
916
- });
917
- const creditProviderSummarySchema = z.object({
918
- name: z.string(),
919
- publishableKey: z.string().optional(),
920
- currency: z.string().optional(),
921
- centsPerHbar: z.number().nullable().optional()
922
- });
923
- const creditProvidersResponseSchema = z.object({
924
- providers: z.array(creditProviderSummarySchema)
925
- });
926
- const creditBalanceResponseSchema = z.object({
927
- accountId: z.string(),
928
- balance: z.number(),
929
- balanceRecord: jsonValueSchema.optional(),
930
- timestamp: z.string().optional()
931
- });
932
- const guardPlanIdSchema = z.enum(["free", "pro", "team", "enterprise"]);
933
- const guardBucketBalanceSchema = z.object({
934
- bucketId: z.enum([
935
- "registry_credits",
936
- "chat_credits",
937
- "guard_credits",
938
- "org_policy_credits"
939
- ]),
940
- label: z.string(),
941
- availableCredits: z.number(),
942
- includedMonthlyCredits: z.number().nullable().optional()
943
- });
944
- const guardPrincipalSchema = z.object({
945
- signedIn: z.boolean(),
946
- principalType: z.enum(["user", "service"]).default("user"),
947
- userId: z.string().optional(),
948
- email: z.string().optional(),
949
- accountId: z.string().optional(),
950
- stripeCustomerId: z.string().optional(),
951
- serviceId: z.string().optional(),
952
- workspaceId: z.string().optional(),
953
- serviceLabel: z.string().optional(),
954
- roles: z.array(z.string())
955
- });
956
- const guardEntitlementsSchema = z.object({
957
- planId: guardPlanIdSchema,
958
- includedMonthlyCredits: z.number(),
959
- deviceLimit: z.number(),
960
- retentionDays: z.number(),
961
- syncEnabled: z.boolean(),
962
- premiumFeedsEnabled: z.boolean(),
963
- teamPolicyEnabled: z.boolean()
964
- });
965
- const guardSessionResponseSchema = z.object({
966
- principal: guardPrincipalSchema,
967
- entitlements: guardEntitlementsSchema,
968
- balance: z.object({
969
- accountId: z.string(),
970
- availableCredits: z.number()
971
- }).nullable(),
972
- bucketingMode: z.enum(["shared-ledger", "product-bucketed"]),
973
- buckets: z.array(guardBucketBalanceSchema)
974
- });
975
- const guardBalanceResponseSchema = z.object({
976
- generatedAt: z.string(),
977
- bucketingMode: z.enum(["shared-ledger", "product-bucketed"]),
978
- buckets: z.array(guardBucketBalanceSchema)
979
- });
980
- const guardFeedItemSchema = z.object({
981
- id: z.string(),
982
- artifactType: z.enum(["skill", "plugin"]),
983
- slug: z.string(),
984
- name: z.string(),
985
- href: z.string(),
986
- ecosystem: z.string().optional(),
987
- safetyScore: z.number().nullable().optional(),
988
- trustScore: z.number().nullable().optional(),
989
- verified: z.boolean(),
990
- recommendation: z.enum(["monitor", "review", "block"]),
991
- updatedAt: z.string()
992
- });
993
- const guardFeedSummarySchema = z.object({
994
- total: z.number(),
995
- monitorCount: z.number(),
996
- reviewCount: z.number(),
997
- blockCount: z.number()
998
- });
999
- const guardFeedResponseSchema = z.object({
1000
- generatedAt: z.string(),
1001
- items: z.array(guardFeedItemSchema),
1002
- summary: guardFeedSummarySchema
1003
- });
1004
- const guardIntegrationSchema = z.object({
1005
- id: z.enum(["openclaw", "hermes"]),
1006
- name: z.string(),
1007
- status: z.enum(["available", "planned"]),
1008
- href: z.string().nullable(),
1009
- summary: z.string()
1010
- });
1011
- const guardActionItemSchema = z.object({
1012
- title: z.string(),
1013
- description: z.string(),
1014
- href: z.string()
1015
- });
1016
- const guardOverviewResponseSchema = z.object({
1017
- generatedAt: z.string(),
1018
- principal: guardPrincipalSchema,
1019
- entitlements: guardEntitlementsSchema,
1020
- balance: z.object({
1021
- accountId: z.string(),
1022
- availableCredits: z.number()
1023
- }).nullable(),
1024
- trustFeed: guardFeedResponseSchema,
1025
- integrations: z.array(guardIntegrationSchema),
1026
- actionItems: z.array(guardActionItemSchema)
1027
- });
1028
- const guardPolicySchema = z.object({
1029
- mode: z.enum(["observe", "prompt", "enforce"]),
1030
- defaultAction: z.enum(["allow", "warn", "block"]),
1031
- unknownPublisherAction: z.enum(["review", "block", "allow"]),
1032
- changedHashAction: z.enum(["allow", "warn", "require-reapproval", "block"]),
1033
- newNetworkDomainAction: z.enum(["allow", "warn", "block"]),
1034
- subprocessAction: z.enum(["allow", "warn", "block"]),
1035
- telemetryEnabled: z.boolean(),
1036
- syncEnabled: z.boolean(),
1037
- updatedAt: z.string()
1038
- });
1039
- const guardTrustMatchSchema = z.object({
1040
- artifactId: z.string(),
1041
- artifactName: z.string(),
1042
- artifactType: z.enum(["skill", "plugin"]),
1043
- artifactSlug: z.string(),
1044
- recommendation: z.enum(["monitor", "review", "block"]),
1045
- verified: z.boolean(),
1046
- safetyScore: z.number().nullable().optional(),
1047
- trustScore: z.number().nullable().optional(),
1048
- href: z.string().optional(),
1049
- ecosystem: z.string().optional()
1050
- });
1051
- const guardTrustByHashResponseSchema = z.object({
1052
- generatedAt: z.string(),
1053
- query: z.object({
1054
- sha256: z.string()
1055
- }),
1056
- match: guardTrustMatchSchema.nullable(),
1057
- evidence: z.array(z.string())
1058
- });
1059
- const guardTrustResolveResponseSchema = z.object({
1060
- generatedAt: z.string(),
1061
- query: z.object({
1062
- ecosystem: z.string().optional(),
1063
- name: z.string().optional(),
1064
- version: z.string().optional()
1065
- }),
1066
- items: z.array(guardTrustMatchSchema)
1067
- });
1068
- const guardRevocationSchema = z.object({
1069
- id: z.string(),
1070
- artifactId: z.string(),
1071
- artifactName: z.string(),
1072
- reason: z.string(),
1073
- severity: z.enum(["low", "medium", "high"]),
1074
- publishedAt: z.string(),
1075
- confidence: z.number().optional(),
1076
- remediation: z.string().nullable().optional(),
1077
- scope: z.enum(["artifact", "publisher", "domain", "workspace", "ecosystem"]).optional(),
1078
- source: z.string().optional(),
1079
- firstSeenAt: z.string().optional(),
1080
- lastUpdatedAt: z.string().optional()
1081
- });
1082
- const guardRevocationResponseSchema = z.object({
1083
- generatedAt: z.string(),
1084
- items: z.array(guardRevocationSchema)
1085
- });
1086
- const guardReceiptSchema = z.object({
1087
- receiptId: z.string(),
1088
- capturedAt: z.string(),
1089
- harness: z.string(),
1090
- deviceId: z.string(),
1091
- deviceName: z.string(),
1092
- artifactId: z.string(),
1093
- artifactName: z.string(),
1094
- artifactType: z.enum(["skill", "plugin"]),
1095
- artifactSlug: z.string(),
1096
- artifactHash: z.string(),
1097
- policyDecision: z.enum([
1098
- "allow",
1099
- "warn",
1100
- "block",
1101
- "review",
1102
- "require-reapproval",
1103
- "sandbox-required"
1104
- ]),
1105
- recommendation: z.enum(["monitor", "review", "block"]),
1106
- changedSinceLastApproval: z.boolean(),
1107
- publisher: z.string().optional(),
1108
- capabilities: z.array(z.string()),
1109
- summary: z.string()
1110
- });
1111
- const guardHistoryArtifactSchema = z.object({
1112
- artifactId: z.string(),
1113
- artifactName: z.string(),
1114
- artifactType: z.enum(["skill", "plugin"]),
1115
- artifactSlug: z.string(),
1116
- publisher: z.string().optional(),
1117
- harnesses: z.array(z.string()),
1118
- eventCount: z.number(),
1119
- firstSeenAt: z.string(),
1120
- lastSeenAt: z.string(),
1121
- latestDecision: z.enum([
1122
- "allow",
1123
- "warn",
1124
- "block",
1125
- "review",
1126
- "require-reapproval",
1127
- "sandbox-required"
1128
- ]),
1129
- latestRecommendation: z.enum(["monitor", "review", "block"])
1130
- });
1131
- const guardReceiptHistoryResponseSchema = z.object({
1132
- generatedAt: z.string(),
1133
- artifacts: z.array(guardHistoryArtifactSchema)
1134
- });
1135
- const guardInventoryArtifactSchema = z.object({
1136
- artifactId: z.string(),
1137
- artifactName: z.string(),
1138
- artifactType: z.enum(["skill", "plugin"]),
1139
- artifactSlug: z.string(),
1140
- publisher: z.string().optional(),
1141
- harnesses: z.array(z.string()),
1142
- devices: z.array(z.string()),
1143
- eventCount: z.number(),
1144
- firstSeenAt: z.string(),
1145
- lastSeenAt: z.string(),
1146
- latestDecision: z.enum([
1147
- "allow",
1148
- "warn",
1149
- "block",
1150
- "review",
1151
- "require-reapproval",
1152
- "sandbox-required"
1153
- ]),
1154
- latestRecommendation: z.enum(["monitor", "review", "block"]),
1155
- latestHash: z.string(),
1156
- latestSummary: z.string()
1157
- });
1158
- const guardInventoryDiffEntrySchema = z.object({
1159
- artifactId: z.string(),
1160
- artifactName: z.string(),
1161
- artifactType: z.enum(["skill", "plugin"]),
1162
- changeType: z.enum(["new", "changed", "removed"]),
1163
- previousHash: z.string().nullable(),
1164
- currentHash: z.string().nullable()
1165
- });
1166
- const guardInventoryDiffResponseSchema = z.object({
1167
- generatedAt: z.string(),
1168
- items: z.array(guardInventoryDiffEntrySchema)
1169
- });
1170
- const guardReceiptSyncResponseSchema = z.object({
1171
- syncedAt: z.string(),
1172
- receiptsStored: z.number(),
1173
- inventoryStored: z.number().optional(),
1174
- inventoryDiff: guardInventoryDiffResponseSchema.optional(),
1175
- advisories: z.array(guardRevocationSchema).optional(),
1176
- policy: guardPolicySchema.optional(),
1177
- alertPreferences: z.lazy(() => guardAlertPreferencesSchema).optional(),
1178
- exceptions: z.array(z.lazy(() => guardExceptionItemSchema)).optional(),
1179
- teamPolicyPack: z.lazy(() => guardTeamPolicyPackSchema).optional()
1180
- });
1181
- const guardInventoryResponseSchema = z.object({
1182
- generatedAt: z.string(),
1183
- items: z.array(guardInventoryArtifactSchema)
1184
- });
1185
- const guardAbomSummarySchema = z.object({
1186
- totalArtifacts: z.number(),
1187
- totalDevices: z.number(),
1188
- totalHarnesses: z.number(),
1189
- blockedArtifacts: z.number(),
1190
- reviewArtifacts: z.number()
1191
- });
1192
- const guardAbomResponseSchema = z.object({
1193
- generatedAt: z.string(),
1194
- summary: guardAbomSummarySchema,
1195
- items: z.array(guardInventoryArtifactSchema)
1196
- });
1197
- const guardTimelineEventSchema = z.object({
1198
- receiptId: z.string(),
1199
- capturedAt: z.string(),
1200
- harness: z.string(),
1201
- deviceId: z.string(),
1202
- deviceName: z.string(),
1203
- artifactHash: z.string(),
1204
- policyDecision: z.enum([
1205
- "allow",
1206
- "warn",
1207
- "block",
1208
- "review",
1209
- "require-reapproval",
1210
- "sandbox-required"
1211
- ]),
1212
- recommendation: z.enum(["monitor", "review", "block"]),
1213
- changedSinceLastApproval: z.boolean(),
1214
- summary: z.string(),
1215
- capabilities: z.array(z.string()),
1216
- publisher: z.string().optional()
1217
- });
1218
- const guardArtifactTimelineResponseSchema = z.object({
1219
- generatedAt: z.string(),
1220
- artifactId: z.string(),
1221
- artifactName: z.string(),
1222
- artifactType: z.enum(["skill", "plugin"]),
1223
- artifactSlug: z.string(),
1224
- events: z.array(guardTimelineEventSchema)
1225
- });
1226
- const guardReceiptExportSummarySchema = z.object({
1227
- totalReceipts: z.number(),
1228
- blockedCount: z.number(),
1229
- reviewCount: z.number(),
1230
- approvedCount: z.number()
1231
- });
1232
- const guardExportSignatureSchema = z.object({
1233
- algorithm: z.enum(["hmac-sha256", "none"]),
1234
- digest: z.string()
1235
- });
1236
- const guardReceiptExportResponseSchema = z.object({
1237
- generatedAt: z.string(),
1238
- summary: guardReceiptExportSummarySchema,
1239
- provenanceSummary: z.array(z.string()),
1240
- items: z.array(guardReceiptSchema),
1241
- signature: guardExportSignatureSchema
1242
- });
1243
- const guardAlertPreferencesSchema = z.object({
1244
- emailEnabled: z.boolean(),
1245
- digestMode: z.enum(["immediate", "daily", "weekly"]),
1246
- watchlistEnabled: z.boolean(),
1247
- advisoriesEnabled: z.boolean(),
1248
- repeatedWarningsEnabled: z.boolean(),
1249
- teamAlertsEnabled: z.boolean(),
1250
- updatedAt: z.string()
1251
- });
1252
- const guardWatchlistItemSchema = z.object({
1253
- artifactId: z.string(),
1254
- artifactName: z.string(),
1255
- artifactType: z.enum(["skill", "plugin"]),
1256
- artifactSlug: z.string(),
1257
- reason: z.string(),
1258
- source: z.enum(["manual", "synced", "team-policy"]),
1259
- createdAt: z.string()
1260
- });
1261
- const guardWatchlistResponseSchema = z.object({
1262
- generatedAt: z.string(),
1263
- items: z.array(guardWatchlistItemSchema)
1264
- });
1265
- const guardWatchlistLookupMatchSchema = z.object({
1266
- artifactId: z.string().nullable(),
1267
- publisher: z.string().nullable(),
1268
- domain: z.string().nullable(),
1269
- source: z.enum(["watchlist", "team-policy"]),
1270
- reason: z.string()
1271
- });
1272
- const guardWatchlistLookupResponseSchema = z.object({
1273
- generatedAt: z.string(),
1274
- matched: z.boolean(),
1275
- scope: z.enum(["artifact", "publisher", "domain", "none"]),
1276
- item: guardWatchlistLookupMatchSchema.nullable()
1277
- });
1278
- const guardPainSignalSchema = z.object({
1279
- signalId: z.string(),
1280
- signalName: z.string(),
1281
- artifactId: z.string(),
1282
- artifactName: z.string(),
1283
- artifactType: z.enum(["skill", "plugin"]),
1284
- harness: z.string(),
1285
- latestSummary: z.string(),
1286
- firstSeenAt: z.string(),
1287
- lastSeenAt: z.string(),
1288
- count: z.number(),
1289
- source: z.literal("scanner"),
1290
- publisher: z.string().optional()
1291
- });
1292
- const guardPainSignalListResponseSchema = z.object({
1293
- generatedAt: z.string(),
1294
- items: z.array(guardPainSignalSchema)
1295
- });
1296
- const guardPainSignalAggregateSchema = z.object({
1297
- artifactId: z.string(),
1298
- artifactName: z.string(),
1299
- artifactType: z.enum(["skill", "plugin"]),
1300
- signalName: z.string(),
1301
- latestSummary: z.string(),
1302
- firstSeenAt: z.string(),
1303
- lastSeenAt: z.string(),
1304
- totalCount: z.number(),
1305
- consumerCount: z.number(),
1306
- harnesses: z.array(z.string()),
1307
- publishers: z.array(z.string())
1308
- });
1309
- const guardPainSignalAggregateResponseSchema = z.object({
1310
- generatedAt: z.string(),
1311
- summary: z.object({
1312
- totalSignals: z.number(),
1313
- uniqueArtifacts: z.number(),
1314
- uniqueConsumers: z.number()
1315
- }),
1316
- items: z.array(guardPainSignalAggregateSchema)
1317
- });
1318
- const guardExceptionItemSchema = z.object({
1319
- exceptionId: z.string(),
1320
- scope: z.enum(["artifact", "publisher", "harness", "global"]),
1321
- harness: z.string().nullable(),
1322
- artifactId: z.string().nullable(),
1323
- publisher: z.string().nullable(),
1324
- reason: z.string(),
1325
- owner: z.string(),
1326
- source: z.enum(["manual", "team-policy"]),
1327
- expiresAt: z.string(),
1328
- createdAt: z.string(),
1329
- updatedAt: z.string()
1330
- });
1331
- const guardExceptionListResponseSchema = z.object({
1332
- generatedAt: z.string(),
1333
- items: z.array(guardExceptionItemSchema)
1334
- });
1335
- const guardPreflightEvidenceSchema = z.object({
1336
- category: z.enum([
1337
- "policy",
1338
- "trust",
1339
- "watchlist",
1340
- "team-policy",
1341
- "exception"
1342
- ]),
1343
- source: z.string(),
1344
- detail: z.string()
1345
- });
1346
- z.object({
1347
- harness: z.string(),
1348
- artifactName: z.string(),
1349
- artifactType: z.enum(["skill", "plugin"]),
1350
- artifactId: z.string().optional(),
1351
- artifactSlug: z.string().optional(),
1352
- artifactHash: z.string().optional(),
1353
- publisher: z.string().optional(),
1354
- domain: z.string().optional(),
1355
- launchSummary: z.string().optional(),
1356
- capabilities: z.array(z.string()).optional(),
1357
- workspacePath: z.string().optional()
1358
- });
1359
- const guardPreflightVerdictResponseSchema = z.object({
1360
- generatedAt: z.string(),
1361
- principal: guardPrincipalSchema,
1362
- decision: z.enum(["allow", "review", "block"]),
1363
- recommendation: z.enum(["monitor", "review", "block"]),
1364
- rationale: z.string(),
1365
- category: z.enum(["exception", "team-policy", "watchlist", "trust", "policy"]).optional(),
1366
- confidence: z.number().optional(),
1367
- freshnessTimestamp: z.string().optional(),
1368
- evidenceSources: z.array(z.string()).optional(),
1369
- scope: z.enum(["artifact", "publisher", "domain", "policy"]),
1370
- matchedEvidence: z.array(guardPreflightEvidenceSchema),
1371
- matchedException: guardExceptionItemSchema.nullable(),
1372
- trustMatch: guardTrustMatchSchema.nullable()
1373
- });
1374
- const guardTeamPolicyAuditItemSchema = z.object({
1375
- changedAt: z.string(),
1376
- actor: z.string(),
1377
- change: z.enum(["created", "updated"]),
1378
- summary: z.string()
1379
- });
1380
- const guardTeamPolicyPackSchema = z.object({
1381
- name: z.string(),
1382
- sharedHarnessDefaults: z.record(
1383
- z.string(),
1384
- z.enum(["observe", "prompt", "enforce"])
1385
- ),
1386
- allowedPublishers: z.array(z.string()),
1387
- blockedPublishers: z.array(z.string()).optional(),
1388
- blockedDomains: z.array(z.string()).optional(),
1389
- blockedArtifacts: z.array(z.string()),
1390
- alertChannel: z.enum(["email", "slack", "teams", "webhook"]),
1391
- updatedAt: z.string(),
1392
- auditTrail: z.array(guardTeamPolicyAuditItemSchema)
1393
- });
1394
- const guardDeviceSchema = z.object({
1395
- deviceId: z.string(),
1396
- deviceName: z.string(),
1397
- harnesses: z.array(z.string()),
1398
- receiptCount: z.number(),
1399
- lastSeenAt: z.string()
1400
- });
1401
- const guardDeviceListResponseSchema = z.object({
1402
- generatedAt: z.string(),
1403
- items: z.array(guardDeviceSchema)
1404
- });
1405
- const hbarPurchaseIntentResponseSchema = z.object({
1406
- transaction: z.string(),
1407
- transactionId: z.string(),
1408
- network: z.enum(["mainnet", "testnet"]),
1409
- accountId: z.string(),
1410
- treasuryAccountId: z.string(),
1411
- hbarAmount: z.number(),
1412
- credits: z.number(),
1413
- tinybarAmount: z.number(),
1414
- memo: z.string(),
1415
- centsPerHbar: z.number(),
1416
- validStart: z.string(),
1417
- validDurationSeconds: z.number(),
1418
- requiresManualSubmit: z.literal(true),
1419
- purchaseId: z.string()
1420
- });
1421
- const x402SettlementSchema = z.object({
1422
- success: z.boolean().optional(),
1423
- transaction: z.string().optional(),
1424
- network: z.string().optional(),
1425
- payer: z.string().optional(),
1426
- errorReason: z.string().optional()
1427
- }).strict();
1428
- const x402CreditPurchaseResponseSchema = z.object({
1429
- success: z.boolean(),
1430
- accountId: z.string(),
1431
- creditedCredits: z.number(),
1432
- usdAmount: z.number(),
1433
- balance: z.number(),
1434
- payment: z.object({
1435
- payer: z.string().optional(),
1436
- requirement: z.record(jsonValueSchema).optional(),
1437
- settlement: x402SettlementSchema.optional()
1438
- }).optional()
1439
- });
1440
- const x402MinimumsResponseSchema = z.object({
1441
- minimums: z.record(
1442
- z.object({
1443
- network: z.string().optional(),
1444
- gasLimit: z.number().optional(),
1445
- gasPriceWei: z.string().optional(),
1446
- gasUsd: z.number().optional(),
1447
- minUsd: z.number().optional(),
1448
- ethUsd: z.number().optional(),
1449
- fetchedAt: z.string().optional(),
1450
- source: z.string().optional()
1451
- })
1452
- ).optional(),
1453
- creditUnitUsd: z.number().optional()
1454
- });
1455
- const adaptersResponseSchema = z.object({
1456
- adapters: z.array(z.string())
1457
- });
1458
- const adapterRegistryCategorySchema = z.object({
1459
- id: z.number().int(),
1460
- network: z.string(),
1461
- type: z.string(),
1462
- slug: z.string(),
1463
- name: z.string(),
1464
- description: z.string().nullable().optional(),
1465
- topicId: z.string(),
1466
- versionTopicId: z.string(),
1467
- registryTransactionId: z.string().nullable().optional(),
1468
- versionTransactionId: z.string().nullable().optional(),
1469
- metadataPointer: z.string().nullable().optional(),
1470
- metadataSequence: z.number().int().nullable().optional(),
1471
- createdAt: z.string(),
1472
- updatedAt: z.string(),
1473
- metadata: jsonValueSchema.optional().nullable()
1474
- });
1475
- const adapterRegistryCategoriesResponseSchema = z.object({
1476
- categories: z.array(adapterRegistryCategorySchema)
1477
- });
1478
- const adapterRegistryAdapterSchema = z.object({
1479
- id: z.union([z.string(), z.number()]).optional(),
1480
- network: z.string().optional(),
1481
- categoryId: z.union([z.string(), z.number()]).nullable().optional(),
1482
- operation: z.string().optional(),
1483
- adapterId: z.string(),
1484
- adapterName: z.string(),
1485
- entity: z.string(),
1486
- manifestPointer: z.string().nullable().optional(),
1487
- manifestSequence: z.number().int().nullable().optional(),
1488
- packageRegistry: z.string().nullable().optional(),
1489
- packageName: z.string().nullable().optional(),
1490
- packageVersion: z.string().nullable().optional(),
1491
- packageIntegrity: z.string().nullable().optional(),
1492
- stateModel: z.string().nullable().optional(),
1493
- config: jsonValueSchema.nullable().optional(),
1494
- signature: z.string().nullable().optional(),
1495
- manifest: jsonValueSchema.nullable().optional(),
1496
- keywords: z.array(z.string()).optional(),
1497
- searchText: z.string().nullable().optional(),
1498
- creditAccountId: z.string().nullable().optional(),
1499
- registeredByUserId: z.string().nullable().optional(),
1500
- registeredByEmail: z.string().nullable().optional(),
1501
- totalCostHbar: z.number().nullable().optional(),
1502
- totalCostCredits: z.number().nullable().optional(),
1503
- consensusTimestamp: z.string().nullable().optional(),
1504
- sequenceNumber: z.number().int().nullable().optional(),
1505
- payerAccountId: z.string().nullable().optional(),
1506
- mirrorNodePayload: jsonValueSchema.nullable().optional(),
1507
- versionTopicId: z.string().nullable().optional(),
1508
- declarationTopicId: z.string().nullable().optional(),
1509
- categoryEntrySequence: z.number().int().nullable().optional(),
1510
- categoryEntryTransactionId: z.string().nullable().optional(),
1511
- versionPointerSequence: z.number().int().nullable().optional(),
1512
- versionPointerTransactionId: z.string().nullable().optional(),
1513
- transactionId: z.string().nullable().optional(),
1514
- createdAt: z.string().optional(),
1515
- category: adapterRegistryCategorySchema.optional()
1516
- }).passthrough();
1517
- const adapterRegistryAdaptersResponseSchema = z.object({
1518
- network: z.string(),
1519
- adapters: z.array(adapterRegistryAdapterSchema)
1520
- });
1521
- const adapterRegistryCreateCategoryResponseSchema = z.object({
1522
- category: adapterRegistryCategorySchema
1523
- });
1524
- z.object({
1525
- adapter: z.record(jsonValueSchema),
1526
- declaration: adapterDeclarationSchema,
1527
- transactionId: z.string().optional().nullable(),
1528
- category: adapterRegistryCategorySchema
1529
- });
1530
- const adapterRegistrySubmitAdapterAcceptedResponseSchema = z.object({
1531
- submissionId: z.string(),
1532
- status: z.string().optional(),
1533
- network: z.string().optional(),
1534
- message: z.string().optional()
1535
- }).passthrough();
1536
- const adapterRegistrySubmissionStatusResponseSchema = z.object({
1537
- submission: z.object({
1538
- id: z.string(),
1539
- network: z.string(),
1540
- status: z.enum(["pending", "running", "completed", "failed"]),
1541
- adapterId: z.string(),
1542
- categorySlug: z.string().nullable().optional(),
1543
- creditAccountId: z.string().nullable().optional(),
1544
- registeredByUserId: z.string().nullable().optional(),
1545
- registeredByEmail: z.string().nullable().optional(),
1546
- requestPayload: jsonValueSchema.optional(),
1547
- resultPayload: jsonValueSchema.nullable().optional(),
1548
- error: z.string().nullable().optional(),
1549
- createdAt: z.string().optional(),
1550
- updatedAt: z.string().optional(),
1551
- startedAt: z.string().nullable().optional(),
1552
- completedAt: z.string().nullable().optional()
1553
- }).passthrough()
1554
- });
1555
- const adapterChatProfileSchema = z.object({
1556
- supportsChat: z.boolean(),
1557
- delivery: z.string().optional(),
1558
- transport: z.string().optional(),
1559
- streaming: z.boolean().optional(),
1560
- requiresAuth: z.array(z.string()).optional(),
1561
- notes: z.string().optional()
1562
- });
1563
- const adapterCapabilitiesSchema = z.object({
1564
- discovery: z.boolean(),
1565
- routing: z.boolean(),
1566
- communication: z.boolean(),
1567
- translation: z.boolean(),
1568
- protocols: z.array(z.string())
1569
- });
1570
- const adapterDescriptorSchema = z.object({
1571
- id: z.string(),
1572
- name: z.string(),
1573
- version: z.string(),
1574
- author: z.string(),
1575
- description: z.string(),
1576
- supportedProtocols: z.array(z.string()),
1577
- registryType: z.enum(["web2", "web3", "hybrid"]),
1578
- chatProfile: adapterChatProfileSchema.optional(),
1579
- capabilities: adapterCapabilitiesSchema,
1580
- enabled: z.boolean(),
1581
- priority: z.number(),
1582
- status: z.enum(["running", "stopped"])
1583
- });
1584
- const adapterDetailsResponseSchema = z.object({
1585
- adapters: z.array(adapterDescriptorSchema)
1586
- });
1587
- const metadataFacetOptionSchema = z.object({
1588
- value: z.union([z.string(), z.number(), z.boolean()]),
1589
- label: z.string()
1590
- });
1591
- const searchFacetSchema = z.object({
1592
- key: z.string(),
1593
- label: z.string(),
1594
- description: z.string().optional(),
1595
- type: z.enum(["string", "boolean", "number"]),
1596
- adapters: z.array(z.string()).optional(),
1597
- options: z.array(metadataFacetOptionSchema).optional()
1598
- });
1599
- const searchFacetsResponseSchema = z.object({
1600
- facets: z.array(searchFacetSchema)
1601
- });
1602
- const verificationExistingOwnershipSchema = z.object({
1603
- ownerType: z.string(),
1604
- ownerId: z.string(),
1605
- ownerHandle: z.string().optional(),
1606
- verifiedAt: z.string().optional(),
1607
- method: z.string().optional()
1608
- }).passthrough();
1609
- const verificationChallengeResponseSchema = z.object({
1610
- challengeId: z.string(),
1611
- code: z.string(),
1612
- expiresAt: z.string(),
1613
- expectedHandle: z.string(),
1614
- instructions: z.string(),
1615
- existingOwnership: verificationExistingOwnershipSchema.optional()
1616
- }).passthrough();
1617
- const verificationChallengeDetailsResponseSchema = z.object({
1618
- challengeId: z.string(),
1619
- uaid: z.string(),
1620
- code: z.string(),
1621
- expiresAt: z.string(),
1622
- status: z.string(),
1623
- message: z.string().optional()
1624
- }).passthrough();
1625
- const verificationVerifyResponseSchema = z.object({
1626
- verified: z.boolean(),
1627
- uaid: z.string(),
1628
- ownerType: z.string(),
1629
- ownerId: z.string(),
1630
- ownerHandle: z.string().optional(),
1631
- method: z.string().optional(),
1632
- verificationPostUrl: z.string().optional()
1633
- }).passthrough();
1634
- const verificationOwnershipResponseSchema = z.object({
1635
- uaid: z.string(),
1636
- ownerType: z.string(),
1637
- ownerId: z.string(),
1638
- ownerHandle: z.string().optional(),
1639
- chain: z.string(),
1640
- verifiedAt: z.string(),
1641
- method: z.string()
1642
- }).passthrough();
1643
- const verificationStatusResponseSchema = z.object({
1644
- uaid: z.string(),
1645
- verified: z.boolean(),
1646
- chain: z.string().nullable()
1647
- }).passthrough();
1648
- const verificationVerifySenderResponseSchema = z.object({
1649
- verified: z.boolean(),
1650
- uaid: z.string(),
1651
- ownerType: z.string(),
1652
- ownerId: z.string()
1653
- }).passthrough();
1654
- const verificationDnsErrorSchema = z.object({
1655
- code: z.string(),
1656
- message: z.string(),
1657
- details: z.record(jsonValueSchema).optional()
1658
- }).passthrough();
1659
- const verificationDnsStatusResponseSchema = z.object({
1660
- uaid: z.string(),
1661
- verified: z.boolean(),
1662
- profileId: z.string(),
1663
- checkedAt: z.string(),
1664
- nativeId: z.string().optional(),
1665
- dnsName: z.string().optional(),
1666
- verificationLevel: z.string().optional(),
1667
- resolutionMode: z.string().optional(),
1668
- reconstructedUaid: z.string().optional(),
1669
- selectedFollowupProfile: z.string().optional(),
1670
- error: verificationDnsErrorSchema.optional(),
1671
- source: z.string().optional(),
1672
- persisted: z.boolean().optional()
1673
- }).passthrough();
1674
- const registerStatusResponseSchema = z.object({
1675
- registered: z.boolean(),
1676
- agent: jsonValueSchema.optional()
1677
- }).passthrough();
1678
- const moltbookOwnerRegistrationUpdateResponseSchema = z.object({
1679
- ok: z.boolean(),
1680
- uaid: z.string(),
1681
- registered: z.boolean(),
1682
- registeredAt: z.string().optional(),
1683
- agent: jsonValueSchema.optional(),
1684
- warning: z.string().optional()
1685
- }).passthrough();
1686
- const skillRegistryFileRoleSchema = z.union([
1687
- z.literal("skill-md"),
1688
- z.literal("skill-json"),
1689
- z.literal("skill-icon"),
1690
- z.literal("file")
1691
- ]);
1692
- const trustScoreBreakdownSchema = z.record(z.number()).refine(
1693
- (record) => typeof record.total === "number" && Number.isFinite(record.total),
1694
- { message: "trustScores.total is required" }
1695
- );
1696
- const skillSafetyLabelSchema = z.enum(["safe", "review", "caution", "unsafe"]);
1697
- const skillSafetySummarySchema = z.object({
1698
- score: z.number(),
1699
- label: skillSafetyLabelSchema,
1700
- findingsTotal: z.number().int(),
1701
- highFindings: z.number().int(),
1702
- scriptsTotal: z.number().int(),
1703
- permissionsMissing: z.array(z.string())
1704
- }).passthrough();
1705
- const skillSafetyFindingSeveritySchema = z.enum(["low", "medium", "high"]);
1706
- const skillSafetyFindingSchema = z.object({
1707
- ruleId: z.string(),
1708
- severity: skillSafetyFindingSeveritySchema,
1709
- file: z.string(),
1710
- message: z.string()
1711
- }).passthrough();
1712
- const skillRegistryFileDescriptorSchema = z.object({
1713
- name: z.string(),
1714
- mimeType: z.string(),
1715
- role: skillRegistryFileRoleSchema,
1716
- topicId: z.string().optional(),
1717
- hrl: z.string().optional(),
1718
- packageSequenceNumber: z.number().int().optional()
1719
- }).passthrough();
1720
- const skillRegistryPublishSummarySchema = z.object({
1721
- jobId: z.string(),
1722
- network: z.union([z.literal("mainnet"), z.literal("testnet")]),
1723
- name: z.string(),
1724
- version: z.string(),
1725
- description: z.string().optional(),
1726
- createdAt: z.string(),
1727
- directoryTopicId: z.string(),
1728
- skillUid: z.number().int().optional(),
1729
- directorySequenceNumber: z.number().int().optional(),
1730
- versionRegistryTopicId: z.string().optional(),
1731
- packageTopicId: z.string(),
1732
- manifestHrl: z.string().optional(),
1733
- skillJsonHrl: z.string(),
1734
- iconHcs1: z.string().optional(),
1735
- tags: z.array(z.string()).optional(),
1736
- category: z.string().optional(),
1737
- featured: z.boolean().optional(),
1738
- verified: z.boolean().optional(),
1739
- upvotes: z.number().int().optional(),
1740
- trustScore: z.number().optional(),
1741
- trustScores: trustScoreBreakdownSchema.optional(),
1742
- safety: skillSafetySummarySchema.optional(),
1743
- safetyFindings: z.array(skillSafetyFindingSchema).optional(),
1744
- files: z.array(skillRegistryFileDescriptorSchema).optional()
1745
- }).passthrough();
1746
- const skillRegistryListResponseSchema = z.object({
1747
- items: z.array(skillRegistryPublishSummarySchema),
1748
- nextCursor: z.string().nullable()
1749
- }).passthrough();
1750
- z.enum([
1751
- "stable",
1752
- "prerelease",
1753
- "all"
1754
- ]);
1755
- z.enum([
1756
- "trending",
1757
- "upvotes",
1758
- "updated",
1759
- "name"
1760
- ]);
1761
- const skillCatalogVersionSummarySchema = z.object({
1762
- version: z.string(),
1763
- publishedAt: z.string(),
1764
- verified: z.boolean().optional()
1765
- }).passthrough();
1766
- const skillCatalogItemSchema = z.object({
1767
- name: z.string(),
1768
- description: z.string().optional(),
1769
- iconHcs1: z.string().optional(),
1770
- category: z.string().optional(),
1771
- tags: z.array(z.string()).optional(),
1772
- latest: skillCatalogVersionSummarySchema,
1773
- latestStable: skillCatalogVersionSummarySchema.optional(),
1774
- recommended: skillCatalogVersionSummarySchema,
1775
- upvotes: z.number().int(),
1776
- verified: z.boolean(),
1777
- repoStamped: z.boolean(),
1778
- trustScore: z.number().optional(),
1779
- safetyScore: z.number().optional()
1780
- }).passthrough();
1781
- const skillCatalogResponseSchema = z.object({
1782
- items: z.array(skillCatalogItemSchema),
1783
- nextCursor: z.string().nullable()
1784
- }).passthrough();
1785
- const skillRecommendedVersionResponseSchema = z.object({
1786
- name: z.string(),
1787
- version: z.string(),
1788
- updatedAt: z.string(),
1789
- setBy: z.string()
1790
- }).passthrough();
1791
- const skillDeprecationRecordSchema = z.object({
1792
- name: z.string(),
1793
- version: z.string().optional(),
1794
- reason: z.string(),
1795
- replacementRef: z.string().optional(),
1796
- deprecatedAt: z.string(),
1797
- deprecatedBy: z.string()
1798
- }).passthrough();
1799
- const skillDeprecationsResponseSchema = z.object({
1800
- name: z.string(),
1801
- items: z.array(skillDeprecationRecordSchema)
1802
- }).passthrough();
1803
- const skillSecurityBreakdownResponseSchema = z.object({
1804
- jobId: z.string(),
1805
- score: z.number().nullable().optional(),
1806
- findings: z.array(jsonValueSchema).optional(),
1807
- summary: jsonValueSchema.optional(),
1808
- generatedAt: z.string().nullable().optional(),
1809
- scannerVersion: z.string().nullable().optional()
1810
- }).passthrough();
1811
- const skillBadgeMetricSchema = z.enum([
1812
- "version",
1813
- "version_verification",
1814
- "status",
1815
- "verification",
1816
- "repo_commit",
1817
- "manifest",
1818
- "domain",
1819
- "trust",
1820
- "tier",
1821
- "safety",
1822
- "upvotes",
1823
- "updated"
1824
- ]);
1825
- const skillBadgeStyleSchema = z.enum([
1826
- "flat",
1827
- "flat-square",
1828
- "for-the-badge",
1829
- "plastic",
1830
- "social"
1831
- ]);
1832
- const skillBadgeResponseSchema = z.object({
1833
- schemaVersion: z.number().int(),
1834
- label: z.string(),
1835
- message: z.string(),
1836
- color: z.string(),
1837
- style: skillBadgeStyleSchema.optional(),
1838
- isError: z.boolean().optional(),
1839
- cacheSeconds: z.number().int().optional()
1840
- }).passthrough();
1841
- const skillRegistryTagsResponseSchema = z.object({
1842
- tags: z.array(z.string())
1843
- }).passthrough();
1844
- const skillRegistryCategoriesResponseSchema = z.object({
1845
- categories: z.array(z.string())
1846
- }).passthrough();
1847
- const skillResolverManifestResponseSchema = z.record(jsonValueSchema);
1848
- const skillRegistryQuoteFileBreakdownSchema = z.object({
1849
- name: z.string(),
1850
- mimeType: z.string(),
1851
- estimatedCostHbar: z.number()
1852
- }).passthrough();
1853
- const skillRegistryQuoteResponseSchema = z.object({
1854
- quoteId: z.string(),
1855
- name: z.string(),
1856
- version: z.string(),
1857
- directoryTopicId: z.string(),
1858
- estimatedCostHbar: z.number(),
1859
- credits: z.number(),
1860
- usdCents: z.number(),
1861
- expiresAt: z.string(),
1862
- files: z.array(skillRegistryQuoteFileBreakdownSchema)
1863
- }).passthrough();
1864
- const skillRegistryJobStatusSchema = z.union([
1865
- z.literal("pending"),
1866
- z.literal("in_progress"),
1867
- z.literal("completed"),
1868
- z.literal("failed")
1869
- ]);
1870
- const skillRegistryPublishResponseSchema = z.object({
1871
- jobId: z.string(),
1872
- status: skillRegistryJobStatusSchema,
1873
- credits: z.number().nullable().optional(),
1874
- usdCents: z.number().nullable().optional(),
1875
- quoteId: z.string().nullable().optional(),
1876
- createdAt: z.string(),
1877
- updatedAt: z.string(),
1878
- network: z.union([z.literal("mainnet"), z.literal("testnet")])
1879
- }).passthrough();
1880
- const skillRegistryJobStatusResponseSchema = z.object({
1881
- jobId: z.string(),
1882
- status: skillRegistryJobStatusSchema,
1883
- network: z.union([z.literal("mainnet"), z.literal("testnet")]),
1884
- name: z.string(),
1885
- version: z.string(),
1886
- directoryTopicId: z.string(),
1887
- skillUid: z.number().int().nullable().optional(),
1888
- directorySequenceNumber: z.number().int().nullable().optional(),
1889
- versionRegistryTopicId: z.string().nullable().optional(),
1890
- packageTopicId: z.string().nullable().optional(),
1891
- manifestHrl: z.string().nullable().optional(),
1892
- skillJsonHrl: z.string().nullable().optional(),
1893
- iconHcs1: z.string().nullable().optional(),
1894
- tags: z.array(z.string()).nullable().optional(),
1895
- category: z.string().nullable().optional(),
1896
- files: z.array(skillRegistryFileDescriptorSchema).nullable().optional(),
1897
- quoteCredits: z.number().nullable().optional(),
1898
- quoteUsdCents: z.number().nullable().optional(),
1899
- safety: skillSafetySummarySchema.nullable().optional(),
1900
- reservationId: z.string().nullable().optional(),
1901
- totalCostHbar: z.number().nullable().optional(),
1902
- totalCostCredits: z.number().nullable().optional(),
1903
- failureReason: z.string().nullable().optional(),
1904
- createdAt: z.string(),
1905
- updatedAt: z.string()
1906
- }).passthrough();
1907
- const skillRegistryVersionItemSchema = z.object({
1908
- jobId: z.string(),
1909
- version: z.string(),
1910
- createdAt: z.string(),
1911
- verified: z.boolean().optional()
1912
- }).passthrough();
1913
- const skillRegistryVersionsResponseSchema = z.object({
1914
- name: z.string(),
1915
- items: z.array(skillRegistryVersionItemSchema)
1916
- }).passthrough();
1917
- const skillRegistryMineItemSchema = z.object({
1918
- name: z.string(),
1919
- latestVersion: z.string(),
1920
- latestCreatedAt: z.string(),
1921
- verified: z.boolean().optional(),
1922
- iconHcs1: z.string().optional(),
1923
- versions: z.array(z.string())
1924
- }).passthrough();
1925
- const skillRegistryMineResponseSchema = z.object({
1926
- items: z.array(skillRegistryMineItemSchema)
1927
- }).passthrough();
1928
- const skillRegistryMyListResponseSchema = z.object({
1929
- owned: skillRegistryMineResponseSchema,
1930
- upvoted: skillRegistryListResponseSchema
1931
- }).passthrough();
1932
- const skillRegistryConfigResponseSchema = z.object({
1933
- enabled: z.boolean(),
1934
- directoryTopicId: z.string().nullable().optional(),
1935
- maxFiles: z.number().int().nullable().optional(),
1936
- maxTotalSizeBytes: z.number().int().nullable().optional(),
1937
- allowedMimeTypes: z.array(z.string()).nullable().optional(),
1938
- network: z.union([z.literal("mainnet"), z.literal("testnet")]).nullable().optional(),
1939
- publisher: z.object({
1940
- cliPackageUrl: z.string(),
1941
- cliCommand: z.string(),
1942
- actionMarketplaceUrl: z.string(),
1943
- repositoryUrl: z.string(),
1944
- guideUrl: z.string().nullable().optional(),
1945
- docsUrl: z.string().nullable().optional(),
1946
- submitUrl: z.string().nullable().optional(),
1947
- skillsIndexUrl: z.string().nullable().optional(),
1948
- quickstartCommands: z.array(
1949
- z.object({
1950
- id: z.string(),
1951
- label: z.string(),
1952
- description: z.string(),
1953
- command: z.string(),
1954
- href: z.string().nullable().optional()
1955
- }).passthrough()
1956
- ).optional().default([]),
1957
- templatePresets: z.array(
1958
- z.object({
1959
- presetId: z.string(),
1960
- label: z.string(),
1961
- description: z.string(),
1962
- recommendedFor: z.string(),
1963
- command: z.string()
1964
- }).passthrough()
1965
- ).optional().default([])
1966
- }).nullable().optional()
1967
- }).passthrough();
1968
- const skillRegistryOwnershipResponseSchema = z.object({
1969
- name: z.string(),
1970
- exists: z.boolean(),
1971
- isOwner: z.boolean()
1972
- }).passthrough();
1973
- const skillRegistryVoteStatusResponseSchema = z.object({
1974
- name: z.string(),
1975
- upvotes: z.number().int(),
1976
- hasUpvoted: z.boolean()
1977
- }).passthrough();
1978
- const skillTrustTierSchema = z.enum([
1979
- "unclaimed",
1980
- "validated",
1981
- "published",
1982
- "verified",
1983
- "hardened"
1984
- ]);
1985
- const skillStatusNextStepSchema = z.object({
1986
- kind: z.enum([
1987
- "setup_validate",
1988
- "publish_first_release",
1989
- "verify_domain",
1990
- "harden_workflow",
1991
- "share_status"
1992
- ]),
1993
- priority: z.number().int(),
1994
- id: z.string(),
1995
- label: z.string(),
1996
- description: z.string(),
1997
- url: z.string().nullable().optional(),
1998
- href: z.string().nullable().optional(),
1999
- command: z.string().nullable().optional()
2000
- }).passthrough();
2001
- const skillPreviewSuggestedNextStepSchema = z.object({
2002
- id: z.string(),
2003
- label: z.string(),
2004
- description: z.string(),
2005
- command: z.string().optional(),
2006
- href: z.string().optional()
2007
- }).passthrough();
2008
- const skillPreviewReportSchema = z.object({
2009
- schema_version: z.literal("skill-preview.v1"),
2010
- tool_version: z.string(),
2011
- preview_id: z.string(),
2012
- repo_url: z.string(),
2013
- repo_owner: z.string(),
2014
- repo_name: z.string(),
2015
- default_branch: z.string(),
2016
- commit_sha: z.string(),
2017
- ref: z.string(),
2018
- event_name: z.string(),
2019
- workflow_run_url: z.string(),
2020
- skill_dir: z.string(),
2021
- name: z.string(),
2022
- version: z.string(),
2023
- validation_status: z.literal("passed"),
2024
- findings: z.array(z.unknown()),
2025
- package_summary: z.record(z.string(), z.unknown()),
2026
- suggested_next_steps: z.array(skillPreviewSuggestedNextStepSchema),
2027
- generated_at: z.string()
2028
- }).passthrough();
2029
- const skillPreviewRecordSchema = z.object({
2030
- id: z.string(),
2031
- previewId: z.string(),
2032
- source: z.literal("github-oidc"),
2033
- report: skillPreviewReportSchema,
2034
- generatedAt: z.string(),
2035
- expiresAt: z.string(),
2036
- statusUrl: z.string(),
2037
- authoritative: z.boolean()
2038
- }).passthrough();
2039
- const skillPreviewLookupResponseSchema = z.object({
2040
- found: z.boolean(),
2041
- authoritative: z.boolean(),
2042
- preview: skillPreviewRecordSchema.nullable(),
2043
- statusUrl: z.string().nullable(),
2044
- expiresAt: z.string().nullable()
2045
- }).passthrough();
2046
- const skillStatusPreviewMetadataSchema = z.object({
2047
- previewId: z.string(),
2048
- repoUrl: z.string(),
2049
- repoOwner: z.string(),
2050
- repoName: z.string(),
2051
- commitSha: z.string(),
2052
- ref: z.string(),
2053
- eventName: z.string(),
2054
- skillDir: z.string(),
2055
- generatedAt: z.string(),
2056
- expiresAt: z.string(),
2057
- statusUrl: z.string()
2058
- }).passthrough();
2059
- const skillStatusChecksSchema = z.object({
2060
- repoCommitIntegrity: z.boolean(),
2061
- manifestIntegrity: z.boolean(),
2062
- domainProof: z.boolean()
2063
- }).passthrough();
2064
- const skillStatusVerificationSignalsSchema = z.object({
2065
- publisherBound: z.boolean(),
2066
- domainProof: z.boolean(),
2067
- verifiedDomain: z.boolean(),
2068
- previewValidated: z.boolean()
2069
- }).passthrough();
2070
- const skillStatusProvenanceSignalsSchema = z.object({
2071
- repoCommitIntegrity: z.boolean(),
2072
- manifestIntegrity: z.boolean(),
2073
- canonicalRelease: z.boolean(),
2074
- previewAvailable: z.boolean(),
2075
- previewAuthoritative: z.boolean()
2076
- }).passthrough();
2077
- const skillStatusResponseSchema = z.object({
2078
- name: z.string(),
2079
- version: z.string().nullable(),
2080
- published: z.boolean(),
2081
- verifiedDomain: z.boolean(),
2082
- trustTier: skillTrustTierSchema,
2083
- badgeMetric: skillBadgeMetricSchema,
2084
- checks: skillStatusChecksSchema,
2085
- nextSteps: z.array(skillStatusNextStepSchema),
2086
- verificationSignals: skillStatusVerificationSignalsSchema,
2087
- provenanceSignals: skillStatusProvenanceSignalsSchema,
2088
- publisher: skillRegistryConfigResponseSchema.shape.publisher,
2089
- preview: skillStatusPreviewMetadataSchema.nullable().optional(),
2090
- statusUrl: z.string().nullable().optional()
2091
- }).passthrough();
2092
- const skillQuotePreviewRangeSchema = z.object({
2093
- min: z.number(),
2094
- max: z.number()
2095
- }).passthrough();
2096
- const skillQuotePreviewResponseSchema = z.object({
2097
- estimatedCredits: skillQuotePreviewRangeSchema,
2098
- estimatedHbar: skillQuotePreviewRangeSchema,
2099
- pricingVersion: z.string(),
2100
- assumptions: z.array(z.string()),
2101
- purchaseUrl: z.string().nullable(),
2102
- publishUrl: z.string().nullable(),
2103
- verificationUrl: z.string().nullable()
2104
- }).passthrough();
2105
- const skillConversionSignalsResponseSchema = z.object({
2106
- repoUrl: z.string(),
2107
- skillDir: z.string(),
2108
- trustTier: skillTrustTierSchema,
2109
- actionInstalled: z.boolean(),
2110
- previewUploaded: z.boolean(),
2111
- previewId: z.string().nullable(),
2112
- lastValidateSuccessAt: z.string().nullable(),
2113
- stalePreviewAgeDays: z.number().nullable(),
2114
- published: z.boolean(),
2115
- verified: z.boolean(),
2116
- publishReady: z.boolean(),
2117
- publishBlockedByMissingAuth: z.boolean(),
2118
- statusUrl: z.string().nullable(),
2119
- purchaseUrl: z.string().nullable(),
2120
- publishUrl: z.string().nullable(),
2121
- verificationUrl: z.string().nullable(),
2122
- nextSteps: z.array(skillStatusNextStepSchema)
2123
- }).passthrough();
2124
- const skillInstallArtifactDescriptorSchema = z.object({
2125
- url: z.string(),
2126
- pointer: z.string().nullable(),
2127
- sha256: z.string().nullable()
2128
- }).passthrough();
2129
- const skillInstallResolverDescriptorSchema = z.object({
2130
- skillRef: z.string(),
2131
- skillMdUrl: z.string(),
2132
- manifestUrl: z.string()
2133
- }).passthrough();
2134
- const skillInstallBadgeDescriptorSchema = z.object({
2135
- apiUrl: z.string(),
2136
- imageUrl: z.string(),
2137
- markdown: z.string(),
2138
- html: z.string()
2139
- }).passthrough();
2140
- const skillInstallShareDescriptorSchema = z.object({
2141
- canonicalUrl: z.string().nullable(),
2142
- latestUrl: z.string().nullable(),
2143
- markdownLink: z.string().nullable(),
2144
- htmlLink: z.string().nullable(),
2145
- badge: skillInstallBadgeDescriptorSchema.nullable()
2146
- }).passthrough();
2147
- const skillInstallSnippetSetSchema = z.object({
2148
- cli: z.string(),
2149
- claude: z.string(),
2150
- cursor: z.string(),
2151
- codex: z.string(),
2152
- openclaw: z.string()
2153
- }).passthrough();
2154
- const skillInstallResponseSchema = z.object({
2155
- name: z.string(),
2156
- version: z.string(),
2157
- skillRef: z.string(),
2158
- network: z.union([z.literal("mainnet"), z.literal("testnet")]),
2159
- detailUrl: z.string().nullable(),
2160
- artifacts: z.object({
2161
- skillMd: skillInstallArtifactDescriptorSchema,
2162
- manifest: skillInstallArtifactDescriptorSchema
2163
- }).passthrough(),
2164
- resolvers: z.object({
2165
- pinned: skillInstallResolverDescriptorSchema,
2166
- latest: skillInstallResolverDescriptorSchema
2167
- }).passthrough(),
2168
- share: skillInstallShareDescriptorSchema,
2169
- snippets: skillInstallSnippetSetSchema
2170
- }).passthrough();
2171
- const skillInstallCopyTelemetryResponseSchema = z.object({
2172
- accepted: z.boolean()
2173
- }).passthrough();
2174
- const skillVerificationTierSchema = z.enum(["basic", "express"]);
2175
- const skillVerificationStatusSchema = z.enum([
2176
- "pending",
2177
- "approved",
2178
- "rejected"
2179
- ]);
2180
- const skillVerificationStatusLabelSchema = z.enum([
2181
- "not_requested",
2182
- "pending",
2183
- "approved",
2184
- "rejected"
2185
- ]);
2186
- const skillVerificationSignalFailureReasonSchema = z.enum([
2187
- "missing_owner",
2188
- "missing_repo_or_commit",
2189
- "unsupported_repo",
2190
- "repo_fetch_failed",
2191
- "manifest_pointer_missing",
2192
- "manifest_fetch_failed",
2193
- "manifest_parse_failed",
2194
- "missing_file_hashes",
2195
- "missing_domain",
2196
- "challenge_invalid",
2197
- "challenge_expired",
2198
- "dns_lookup_failed",
2199
- "dns_record_missing",
2200
- "mismatch"
2201
- ]);
2202
- const skillVerificationPublisherBoundSignalSchema = z.object({
2203
- ok: z.boolean(),
2204
- ownerAccountId: z.string().nullable(),
2205
- ownerUserId: z.string().nullable(),
2206
- checkedAt: z.string(),
2207
- reason: skillVerificationSignalFailureReasonSchema.optional()
2208
- }).passthrough();
2209
- const skillVerificationRepoCommitIntegrityMismatchSchema = z.object({
2210
- path: z.string(),
2211
- expectedSha256: z.string(),
2212
- actualSha256: z.string().optional(),
2213
- error: z.string().optional()
2214
- }).passthrough();
2215
- const skillVerificationRepoCommitIntegritySignalSchema = z.object({
2216
- ok: z.boolean(),
2217
- repo: z.string().nullable(),
2218
- commit: z.string().nullable(),
2219
- checkedAt: z.string(),
2220
- filesChecked: z.number().int().min(0),
2221
- mismatches: z.array(skillVerificationRepoCommitIntegrityMismatchSchema),
2222
- partial: z.boolean().optional(),
2223
- reason: skillVerificationSignalFailureReasonSchema.optional()
2224
- }).passthrough();
2225
- const skillVerificationManifestIntegrityShaMismatchSchema = z.object({
2226
- path: z.string(),
2227
- expectedSha256: z.string(),
2228
- actualSha256: z.string().optional()
2229
- }).passthrough();
2230
- const skillVerificationManifestIntegritySignalSchema = z.object({
2231
- ok: z.boolean(),
2232
- manifestHrl: z.string().nullable(),
2233
- manifestSha256: z.string().nullable(),
2234
- checkedAt: z.string(),
2235
- missingFiles: z.array(z.string()),
2236
- shaMismatches: z.array(skillVerificationManifestIntegrityShaMismatchSchema),
2237
- extraFiles: z.array(z.string()).optional(),
2238
- reason: skillVerificationSignalFailureReasonSchema.optional()
2239
- }).passthrough();
2240
- const skillVerificationDomainProofSignalSchema = z.object({
2241
- ok: z.boolean(),
2242
- domain: z.string().optional(),
2243
- method: z.literal("dns_txt").optional(),
2244
- checkedAt: z.string().optional(),
2245
- details: z.string().optional(),
2246
- txtRecordName: z.string().optional(),
2247
- reason: skillVerificationSignalFailureReasonSchema.optional()
2248
- }).passthrough();
2249
- const skillVerificationSignalsSchema = z.object({
2250
- publisherBound: skillVerificationPublisherBoundSignalSchema,
2251
- repoCommitIntegrity: skillVerificationRepoCommitIntegritySignalSchema,
2252
- manifestIntegrity: skillVerificationManifestIntegritySignalSchema,
2253
- domainProof: skillVerificationDomainProofSignalSchema.optional()
2254
- }).passthrough();
2255
- const skillVerificationRequestSchema = z.object({
2256
- id: z.string(),
2257
- network: z.union([z.literal("mainnet"), z.literal("testnet")]),
2258
- name: z.string(),
2259
- version: z.string().optional(),
2260
- tier: skillVerificationTierSchema,
2261
- status: skillVerificationStatusSchema,
2262
- usdCents: z.number(),
2263
- creditsCharged: z.number(),
2264
- creditAccountId: z.string().optional(),
2265
- signals: skillVerificationSignalsSchema.optional(),
2266
- reviewNotes: z.string().optional(),
2267
- requestedBy: z.object({
2268
- userId: z.string().optional(),
2269
- accountId: z.string().optional(),
2270
- email: z.string().optional()
2271
- }).optional(),
2272
- approvedBy: z.object({
2273
- userId: z.string().optional(),
2274
- email: z.string().optional()
2275
- }).optional(),
2276
- approvedAt: z.string().optional(),
2277
- rejectedBy: z.object({
2278
- userId: z.string().optional(),
2279
- email: z.string().optional()
2280
- }).optional(),
2281
- rejectedAt: z.string().optional(),
2282
- createdAt: z.string(),
2283
- updatedAt: z.string()
2284
- }).passthrough();
2285
- const skillVerificationRequestCreateResponseSchema = z.object({
2286
- request: skillVerificationRequestSchema
2287
- }).passthrough();
2288
- const skillVerificationStatusResponseSchema = z.object({
2289
- name: z.string(),
2290
- version: z.string(),
2291
- status: skillVerificationStatusLabelSchema,
2292
- verified: z.boolean(),
2293
- previouslyVerified: z.boolean(),
2294
- signals: skillVerificationSignalsSchema.nullable().optional(),
2295
- reviewNotes: z.string().nullable().optional(),
2296
- pendingRequest: skillVerificationRequestSchema.nullable().optional()
2297
- }).passthrough();
2298
- z.object({
2299
- name: z.string().min(1),
2300
- version: z.string().min(1).optional(),
2301
- domain: z.string().min(1).optional()
2302
- }).passthrough();
2303
- const skillVerificationDomainProofChallengeResponseSchema = z.object({
2304
- challengeId: z.string().min(1),
2305
- name: z.string().min(1),
2306
- version: z.string().min(1),
2307
- domain: z.string().min(1),
2308
- method: z.literal("dns_txt"),
2309
- txtRecordName: z.string().min(1),
2310
- txtRecordValue: z.string().min(1),
2311
- expiresAt: z.string().min(1)
2312
- }).passthrough();
2313
- z.object({
2314
- name: z.string().min(1),
2315
- version: z.string().min(1).optional(),
2316
- domain: z.string().min(1).optional(),
2317
- challengeToken: z.string().min(1)
2318
- }).passthrough();
2319
- const skillVerificationDomainProofVerifyResponseSchema = z.object({
2320
- name: z.string().min(1),
2321
- version: z.string().min(1),
2322
- signal: skillVerificationDomainProofSignalSchema
2323
- }).passthrough();
1
+ import { TopicMessageSubmitTransaction, TopicId, TopicCreateTransaction, PublicKey, KeyList } from "@hashgraph/sdk";
2
+ function encodeHcs2RegistryMemo(indexedFlag, ttl) {
3
+ return `hcs-2:${indexedFlag}:${ttl}`;
4
+ }
5
+ function buildTopicCreateTx(params) {
6
+ const { memo, adminKey, submitKey, operatorPublicKey } = params;
7
+ const tx = new TopicCreateTransaction().setTopicMemo(memo);
8
+ const coerceKey = (k) => {
9
+ if (!k) return void 0;
10
+ if (k instanceof PublicKey || k instanceof KeyList) return k;
11
+ if (typeof k === "boolean") {
12
+ return k ? operatorPublicKey : void 0;
13
+ }
14
+ if (typeof k === "string") {
15
+ try {
16
+ return PublicKey.fromString(k);
17
+ } catch {
18
+ return void 0;
19
+ }
20
+ }
21
+ return void 0;
22
+ };
23
+ const admin = coerceKey(adminKey);
24
+ if (admin) {
25
+ tx.setAdminKey(admin);
26
+ }
27
+ const submit = coerceKey(submitKey);
28
+ if (submit) {
29
+ tx.setSubmitKey(submit);
30
+ }
31
+ return tx;
32
+ }
33
+ function buildMessageTx(params) {
34
+ const tx = new TopicMessageSubmitTransaction().setTopicId(TopicId.fromString(params.topicId)).setMessage(params.message);
35
+ if (params.transactionMemo) {
36
+ tx.setTransactionMemo(params.transactionMemo);
37
+ }
38
+ return tx;
39
+ }
2324
40
  export {
2325
- AIAgentCapability,
2326
- AIAgentType,
2327
- adapterChatProfileSchema,
2328
- adapterDescriptorSchema,
2329
- adapterDetailsResponseSchema,
2330
- adapterRegistryAdapterSchema,
2331
- adapterRegistryAdaptersResponseSchema,
2332
- adapterRegistryCategoriesResponseSchema,
2333
- adapterRegistryCategorySchema,
2334
- adapterRegistryCreateCategoryResponseSchema,
2335
- adapterRegistrySubmissionStatusResponseSchema,
2336
- adapterRegistrySubmitAdapterAcceptedResponseSchema,
2337
- adaptersResponseSchema,
2338
- additionalRegistryCatalogResponseSchema,
2339
- agentFeedbackEligibilityResponseSchema,
2340
- agentFeedbackEntriesIndexResponseSchema,
2341
- agentFeedbackIndexResponseSchema,
2342
- agentFeedbackResponseSchema,
2343
- agentFeedbackSubmissionResponseSchema,
2344
- chatHistoryCompactionResponseSchema,
2345
- chatHistorySnapshotResponseSchema,
2346
- chatPaymentStateSchema,
2347
- chatReadinessResponseSchema,
2348
- chatRouteSummarySchema,
2349
- chatSessionEndResponseSchema,
2350
- createSessionResponseSchema,
2351
- creditBalanceResponseSchema,
2352
- creditProviderSummarySchema,
2353
- creditProvidersResponseSchema,
2354
- creditPurchaseResponseSchema,
2355
- dashboardStatsResponseSchema,
2356
- delegationPlanResponseSchema,
2357
- detectProtocolResponseSchema,
2358
- encryptionHandshakeResponseSchema,
2359
- guardAbomResponseSchema,
2360
- guardAbomSummarySchema,
2361
- guardActionItemSchema,
2362
- guardAlertPreferencesSchema,
2363
- guardArtifactTimelineResponseSchema,
2364
- guardBalanceResponseSchema,
2365
- guardBucketBalanceSchema,
2366
- guardDeviceListResponseSchema,
2367
- guardDeviceSchema,
2368
- guardEntitlementsSchema,
2369
- guardExceptionItemSchema,
2370
- guardExceptionListResponseSchema,
2371
- guardExportSignatureSchema,
2372
- guardFeedItemSchema,
2373
- guardFeedResponseSchema,
2374
- guardFeedSummarySchema,
2375
- guardHistoryArtifactSchema,
2376
- guardIntegrationSchema,
2377
- guardInventoryArtifactSchema,
2378
- guardInventoryDiffEntrySchema,
2379
- guardInventoryDiffResponseSchema,
2380
- guardInventoryResponseSchema,
2381
- guardOverviewResponseSchema,
2382
- guardPainSignalAggregateResponseSchema,
2383
- guardPainSignalAggregateSchema,
2384
- guardPainSignalListResponseSchema,
2385
- guardPainSignalSchema,
2386
- guardPlanIdSchema,
2387
- guardPolicySchema,
2388
- guardPreflightEvidenceSchema,
2389
- guardPreflightVerdictResponseSchema,
2390
- guardPrincipalSchema,
2391
- guardReceiptExportResponseSchema,
2392
- guardReceiptExportSummarySchema,
2393
- guardReceiptHistoryResponseSchema,
2394
- guardReceiptSchema,
2395
- guardReceiptSyncResponseSchema,
2396
- guardRevocationResponseSchema,
2397
- guardRevocationSchema,
2398
- guardSessionResponseSchema,
2399
- guardTeamPolicyAuditItemSchema,
2400
- guardTeamPolicyPackSchema,
2401
- guardTimelineEventSchema,
2402
- guardTrustByHashResponseSchema,
2403
- guardTrustMatchSchema,
2404
- guardTrustResolveResponseSchema,
2405
- guardWatchlistItemSchema,
2406
- guardWatchlistLookupMatchSchema,
2407
- guardWatchlistLookupResponseSchema,
2408
- guardWatchlistResponseSchema,
2409
- hbarPurchaseIntentResponseSchema,
2410
- ledgerChallengeResponseSchema,
2411
- ledgerVerifyResponseSchema,
2412
- metricsSummaryResponseSchema,
2413
- moltbookOwnerRegistrationUpdateResponseSchema,
2414
- popularResponseSchema,
2415
- protocolsResponseSchema,
2416
- registerAgentResponseSchema,
2417
- registerEncryptionKeyResponseSchema,
2418
- registerStatusResponseSchema,
2419
- registrationProgressResponseSchema,
2420
- registrationQuoteResponseSchema,
2421
- registriesResponseSchema,
2422
- registrySearchByNamespaceSchema,
2423
- resolveResponseSchema,
2424
- searchFacetsResponseSchema,
2425
- searchResponseSchema,
2426
- searchStatusResponseSchema,
2427
- sendMessageResponseSchema,
2428
- sessionEncryptionStatusResponseSchema,
2429
- skillBadgeMetricSchema,
2430
- skillBadgeResponseSchema,
2431
- skillBadgeStyleSchema,
2432
- skillCatalogItemSchema,
2433
- skillCatalogResponseSchema,
2434
- skillCatalogVersionSummarySchema,
2435
- skillConversionSignalsResponseSchema,
2436
- skillDeprecationRecordSchema,
2437
- skillDeprecationsResponseSchema,
2438
- skillInstallArtifactDescriptorSchema,
2439
- skillInstallBadgeDescriptorSchema,
2440
- skillInstallCopyTelemetryResponseSchema,
2441
- skillInstallResolverDescriptorSchema,
2442
- skillInstallResponseSchema,
2443
- skillInstallShareDescriptorSchema,
2444
- skillInstallSnippetSetSchema,
2445
- skillPreviewLookupResponseSchema,
2446
- skillPreviewRecordSchema,
2447
- skillPreviewReportSchema,
2448
- skillPreviewSuggestedNextStepSchema,
2449
- skillQuotePreviewRangeSchema,
2450
- skillQuotePreviewResponseSchema,
2451
- skillRecommendedVersionResponseSchema,
2452
- skillRegistryCategoriesResponseSchema,
2453
- skillRegistryConfigResponseSchema,
2454
- skillRegistryFileDescriptorSchema,
2455
- skillRegistryJobStatusResponseSchema,
2456
- skillRegistryListResponseSchema,
2457
- skillRegistryMineItemSchema,
2458
- skillRegistryMineResponseSchema,
2459
- skillRegistryMyListResponseSchema,
2460
- skillRegistryOwnershipResponseSchema,
2461
- skillRegistryPublishResponseSchema,
2462
- skillRegistryPublishSummarySchema,
2463
- skillRegistryQuoteFileBreakdownSchema,
2464
- skillRegistryQuoteResponseSchema,
2465
- skillRegistryTagsResponseSchema,
2466
- skillRegistryVersionItemSchema,
2467
- skillRegistryVersionsResponseSchema,
2468
- skillRegistryVoteStatusResponseSchema,
2469
- skillResolverManifestResponseSchema,
2470
- skillSecurityBreakdownResponseSchema,
2471
- skillStatusChecksSchema,
2472
- skillStatusNextStepSchema,
2473
- skillStatusPreviewMetadataSchema,
2474
- skillStatusProvenanceSignalsSchema,
2475
- skillStatusResponseSchema,
2476
- skillStatusVerificationSignalsSchema,
2477
- skillTrustTierSchema,
2478
- skillVerificationDomainProofChallengeResponseSchema,
2479
- skillVerificationDomainProofVerifyResponseSchema,
2480
- skillVerificationRequestCreateResponseSchema,
2481
- skillVerificationStatusResponseSchema,
2482
- statsResponseSchema,
2483
- uaidConnectionStatusSchema,
2484
- uaidValidationResponseSchema,
2485
- vectorSearchResponseSchema,
2486
- verificationChallengeDetailsResponseSchema,
2487
- verificationChallengeResponseSchema,
2488
- verificationDnsStatusResponseSchema,
2489
- verificationOwnershipResponseSchema,
2490
- verificationStatusResponseSchema,
2491
- verificationVerifyResponseSchema,
2492
- verificationVerifySenderResponseSchema,
2493
- websocketStatsResponseSchema,
2494
- x402CreditPurchaseResponseSchema,
2495
- x402MinimumsResponseSchema
41
+ buildMessageTx,
42
+ buildTopicCreateTx,
43
+ encodeHcs2RegistryMemo
2496
44
  };
2497
45
  //# sourceMappingURL=standards-sdk.es161.js.map