@0gfoundation/0g-agentdna 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. package/GUIDE.md +975 -0
  2. package/LICENSE +21 -0
  3. package/MIGRATION.md +84 -0
  4. package/MIGRATION.zh.md +70 -0
  5. package/PROVIDERS.md +273 -0
  6. package/PROVIDERS.zh.md +234 -0
  7. package/README.md +334 -2
  8. package/dist/AgentClient.d.ts +312 -0
  9. package/dist/AgentClient.d.ts.map +1 -0
  10. package/dist/AgentClient.js +715 -0
  11. package/dist/AgentClient.js.map +1 -0
  12. package/dist/AgenticID.d.ts +823 -0
  13. package/dist/AgenticID.d.ts.map +1 -0
  14. package/dist/AgenticID.js +1188 -0
  15. package/dist/AgenticID.js.map +1 -0
  16. package/dist/AgenticIDClient.d.ts +68 -0
  17. package/dist/AgenticIDClient.d.ts.map +1 -0
  18. package/dist/AgenticIDClient.js +198 -0
  19. package/dist/AgenticIDClient.js.map +1 -0
  20. package/dist/AttestorClient.d.ts +465 -0
  21. package/dist/AttestorClient.d.ts.map +1 -0
  22. package/dist/AttestorClient.js +1030 -0
  23. package/dist/AttestorClient.js.map +1 -0
  24. package/dist/Providers.d.ts +72 -0
  25. package/dist/Providers.d.ts.map +1 -0
  26. package/dist/Providers.js +182 -0
  27. package/dist/Providers.js.map +1 -0
  28. package/dist/ReputationClient.d.ts +213 -0
  29. package/dist/ReputationClient.d.ts.map +1 -0
  30. package/dist/ReputationClient.js +708 -0
  31. package/dist/ReputationClient.js.map +1 -0
  32. package/dist/SandboxClient.d.ts +107 -0
  33. package/dist/SandboxClient.d.ts.map +1 -0
  34. package/dist/SandboxClient.js +200 -0
  35. package/dist/SandboxClient.js.map +1 -0
  36. package/dist/ServeProof.d.ts +161 -0
  37. package/dist/ServeProof.d.ts.map +1 -0
  38. package/dist/ServeProof.js +230 -0
  39. package/dist/ServeProof.js.map +1 -0
  40. package/dist/ServeSession.d.ts +180 -0
  41. package/dist/ServeSession.d.ts.map +1 -0
  42. package/dist/ServeSession.js +336 -0
  43. package/dist/ServeSession.js.map +1 -0
  44. package/dist/Settings.d.ts +179 -0
  45. package/dist/Settings.d.ts.map +1 -0
  46. package/dist/Settings.js +247 -0
  47. package/dist/Settings.js.map +1 -0
  48. package/dist/abi.d.ts +2216 -0
  49. package/dist/abi.d.ts.map +1 -0
  50. package/dist/abi.js +1248 -0
  51. package/dist/abi.js.map +1 -0
  52. package/dist/cli/commands/cells.d.ts +34 -0
  53. package/dist/cli/commands/cells.d.ts.map +1 -0
  54. package/dist/cli/commands/cells.js +66 -0
  55. package/dist/cli/commands/cells.js.map +1 -0
  56. package/dist/cli/commands/doctor.d.ts +15 -0
  57. package/dist/cli/commands/doctor.d.ts.map +1 -0
  58. package/dist/cli/commands/doctor.js +236 -0
  59. package/dist/cli/commands/doctor.js.map +1 -0
  60. package/dist/cli/commands/interactive.d.ts +107 -0
  61. package/dist/cli/commands/interactive.d.ts.map +1 -0
  62. package/dist/cli/commands/interactive.js +3034 -0
  63. package/dist/cli/commands/interactive.js.map +1 -0
  64. package/dist/cli/commands/list.d.ts +31 -0
  65. package/dist/cli/commands/list.d.ts.map +1 -0
  66. package/dist/cli/commands/list.js +115 -0
  67. package/dist/cli/commands/list.js.map +1 -0
  68. package/dist/cli/commands/providers.d.ts +3 -0
  69. package/dist/cli/commands/providers.d.ts.map +1 -0
  70. package/dist/cli/commands/providers.js +21 -0
  71. package/dist/cli/commands/providers.js.map +1 -0
  72. package/dist/cli/commands/settings.d.ts +22 -0
  73. package/dist/cli/commands/settings.d.ts.map +1 -0
  74. package/dist/cli/commands/settings.js +188 -0
  75. package/dist/cli/commands/settings.js.map +1 -0
  76. package/dist/cli/commands/status.d.ts +16 -0
  77. package/dist/cli/commands/status.d.ts.map +1 -0
  78. package/dist/cli/commands/status.js +148 -0
  79. package/dist/cli/commands/status.js.map +1 -0
  80. package/dist/cli/commands/update.d.ts +21 -0
  81. package/dist/cli/commands/update.d.ts.map +1 -0
  82. package/dist/cli/commands/update.js +95 -0
  83. package/dist/cli/commands/update.js.map +1 -0
  84. package/dist/cli/config.d.ts +73 -0
  85. package/dist/cli/config.d.ts.map +1 -0
  86. package/dist/cli/config.js +239 -0
  87. package/dist/cli/config.js.map +1 -0
  88. package/dist/cli/env.d.ts +36 -0
  89. package/dist/cli/env.d.ts.map +1 -0
  90. package/dist/cli/env.js +74 -0
  91. package/dist/cli/env.js.map +1 -0
  92. package/dist/cli/envelope.d.ts +33 -0
  93. package/dist/cli/envelope.d.ts.map +1 -0
  94. package/dist/cli/envelope.js +62 -0
  95. package/dist/cli/envelope.js.map +1 -0
  96. package/dist/cli/errors.d.ts +48 -0
  97. package/dist/cli/errors.d.ts.map +1 -0
  98. package/dist/cli/errors.js +81 -0
  99. package/dist/cli/errors.js.map +1 -0
  100. package/dist/cli/inference.d.ts +21 -0
  101. package/dist/cli/inference.d.ts.map +1 -0
  102. package/dist/cli/inference.js +60 -0
  103. package/dist/cli/inference.js.map +1 -0
  104. package/dist/cli/logo.d.ts +21 -0
  105. package/dist/cli/logo.d.ts.map +1 -0
  106. package/dist/cli/logo.js +131 -0
  107. package/dist/cli/logo.js.map +1 -0
  108. package/dist/cli/main.d.ts +14 -0
  109. package/dist/cli/main.d.ts.map +1 -0
  110. package/dist/cli/main.js +223 -0
  111. package/dist/cli/main.js.map +1 -0
  112. package/dist/cli/proofs.d.ts +67 -0
  113. package/dist/cli/proofs.d.ts.map +1 -0
  114. package/dist/cli/proofs.js +133 -0
  115. package/dist/cli/proofs.js.map +1 -0
  116. package/dist/cli/ref.d.ts +39 -0
  117. package/dist/cli/ref.d.ts.map +1 -0
  118. package/dist/cli/ref.js +48 -0
  119. package/dist/cli/ref.js.map +1 -0
  120. package/dist/cli/sdk.d.ts +24 -0
  121. package/dist/cli/sdk.d.ts.map +1 -0
  122. package/dist/cli/sdk.js +65 -0
  123. package/dist/cli/sdk.js.map +1 -0
  124. package/dist/cli/settings.d.ts +66 -0
  125. package/dist/cli/settings.d.ts.map +1 -0
  126. package/dist/cli/settings.js +137 -0
  127. package/dist/cli/settings.js.map +1 -0
  128. package/dist/cli/tokenize.d.ts +61 -0
  129. package/dist/cli/tokenize.d.ts.map +1 -0
  130. package/dist/cli/tokenize.js +157 -0
  131. package/dist/cli/tokenize.js.map +1 -0
  132. package/dist/cli/types.d.ts +25 -0
  133. package/dist/cli/types.d.ts.map +1 -0
  134. package/dist/cli/types.js +8 -0
  135. package/dist/cli/types.js.map +1 -0
  136. package/dist/constants.d.ts +107 -0
  137. package/dist/constants.d.ts.map +1 -0
  138. package/dist/constants.js +74 -0
  139. package/dist/constants.js.map +1 -0
  140. package/dist/context.d.ts +108 -0
  141. package/dist/context.d.ts.map +1 -0
  142. package/dist/context.js +64 -0
  143. package/dist/context.js.map +1 -0
  144. package/dist/index.d.ts +45 -0
  145. package/dist/index.d.ts.map +1 -0
  146. package/dist/index.js +118 -0
  147. package/dist/index.js.map +1 -0
  148. package/dist/provider-catalog.json +23 -0
  149. package/dist/seal.d.ts +47 -0
  150. package/dist/seal.d.ts.map +1 -0
  151. package/dist/seal.js +145 -0
  152. package/dist/seal.js.map +1 -0
  153. package/dist/secretEnv.d.ts +119 -0
  154. package/dist/secretEnv.d.ts.map +1 -0
  155. package/dist/secretEnv.js +199 -0
  156. package/dist/secretEnv.js.map +1 -0
  157. package/dist/taskHash.d.ts +39 -0
  158. package/dist/taskHash.d.ts.map +1 -0
  159. package/dist/taskHash.js +119 -0
  160. package/dist/taskHash.js.map +1 -0
  161. package/dist/types.d.ts +336 -0
  162. package/dist/types.d.ts.map +1 -0
  163. package/dist/types.js +19 -0
  164. package/dist/types.js.map +1 -0
  165. package/package.json +75 -4
  166. package/scripts/sync-providers.cjs +8 -0
  167. package/src/AgentClient.ts +897 -0
  168. package/src/AgenticID.ts +1382 -0
  169. package/src/AgenticIDClient.ts +238 -0
  170. package/src/AttestorClient.ts +1306 -0
  171. package/src/Providers.ts +176 -0
  172. package/src/ReputationClient.ts +821 -0
  173. package/src/SandboxClient.ts +227 -0
  174. package/src/ServeProof.ts +290 -0
  175. package/src/ServeSession.ts +421 -0
  176. package/src/Settings.ts +296 -0
  177. package/src/abi.ts +1282 -0
  178. package/src/cli/commands/cells.ts +61 -0
  179. package/src/cli/commands/doctor.ts +235 -0
  180. package/src/cli/commands/interactive.ts +2715 -0
  181. package/src/cli/commands/list.ts +117 -0
  182. package/src/cli/commands/providers.ts +16 -0
  183. package/src/cli/commands/settings.ts +197 -0
  184. package/src/cli/commands/status.ts +170 -0
  185. package/src/cli/commands/update.ts +86 -0
  186. package/src/cli/config.ts +225 -0
  187. package/src/cli/env.ts +90 -0
  188. package/src/cli/envelope.ts +57 -0
  189. package/src/cli/errors.ts +114 -0
  190. package/src/cli/inference.ts +57 -0
  191. package/src/cli/logo.ts +125 -0
  192. package/src/cli/main.ts +235 -0
  193. package/src/cli/proofs.ts +160 -0
  194. package/src/cli/ref.ts +58 -0
  195. package/src/cli/sdk.ts +65 -0
  196. package/src/cli/settings.ts +153 -0
  197. package/src/cli/tokenize.ts +131 -0
  198. package/src/cli/types.ts +27 -0
  199. package/src/constants.ts +106 -0
  200. package/src/context.ts +161 -0
  201. package/src/index.ts +129 -0
  202. package/src/provider-catalog.json +23 -0
  203. package/src/seal.ts +163 -0
  204. package/src/secretEnv.ts +250 -0
  205. package/src/taskHash.ts +100 -0
  206. package/src/types.ts +357 -0
package/src/abi.ts ADDED
@@ -0,0 +1,1282 @@
1
+ /**
2
+ * @file abi.ts
3
+ * @description Contract ABIs for the 0G AgenticID protocol, manually authored from Solidity source.
4
+ */
5
+
6
+ /**
7
+ * ABI for the AgenticID contract.
8
+ * Inherits ERC-8004 and ERC-7857.
9
+ */
10
+ export const agenticIDAbi = [
11
+ // ── Registration ──
12
+ {
13
+ type: 'function',
14
+ name: 'register',
15
+ stateMutability: 'nonpayable',
16
+ inputs: [
17
+ { name: 'agentURI', type: 'string' },
18
+ { name: 'metadata', type: 'tuple[]', components: [
19
+ { name: 'metadataKey', type: 'string' },
20
+ { name: 'metadataValue', type: 'bytes' },
21
+ ] },
22
+ { name: 'intelligentDatas', type: 'tuple[]', components: [
23
+ { name: 'dataDescription', type: 'string' },
24
+ { name: 'dataHash', type: 'bytes32' },
25
+ ] },
26
+ { name: 'sealedKeys', type: 'bytes[]' },
27
+ ],
28
+ outputs: [{ name: 'agentId', type: 'uint256' }],
29
+ },
30
+ {
31
+ type: 'function',
32
+ name: 'registerWithSeal',
33
+ stateMutability: 'nonpayable',
34
+ inputs: [
35
+ { name: 'to', type: 'address' },
36
+ { name: 'agentURI', type: 'string' },
37
+ { name: 'metadata', type: 'tuple[]', components: [
38
+ { name: 'metadataKey', type: 'string' },
39
+ { name: 'metadataValue', type: 'bytes' },
40
+ ] },
41
+ { name: 'intelligentDatas', type: 'tuple[]', components: [
42
+ { name: 'dataDescription', type: 'string' },
43
+ { name: 'dataHash', type: 'bytes32' },
44
+ ] },
45
+ { name: 'sealedKeys', type: 'bytes[]' },
46
+ { name: 'agentSeal_', type: 'address' },
47
+ { name: 'sealId', type: 'bytes32' },
48
+ ],
49
+ outputs: [{ name: 'agentId', type: 'uint256' }],
50
+ },
51
+
52
+ {
53
+ type: 'function',
54
+ name: 'tokenURI',
55
+ stateMutability: 'view',
56
+ inputs: [{ name: 'tokenId', type: 'uint256' }],
57
+ outputs: [{ name: '', type: 'string' }],
58
+ },
59
+ {
60
+ type: 'function',
61
+ name: 'getAgentSeal',
62
+ stateMutability: 'view',
63
+ inputs: [{ name: 'agentId', type: 'uint256' }],
64
+ outputs: [{ name: '', type: 'address' }],
65
+ },
66
+ {
67
+ type: 'function',
68
+ name: 'getSealId',
69
+ stateMutability: 'view',
70
+ inputs: [{ name: 'agentId', type: 'uint256' }],
71
+ outputs: [{ name: '', type: 'bytes32' }],
72
+ },
73
+ {
74
+ type: 'function',
75
+ name: 'getAgentIdBySealId',
76
+ stateMutability: 'view',
77
+ inputs: [{ name: 'sealId', type: 'bytes32' }],
78
+ outputs: [{ name: '', type: 'uint256' }],
79
+ },
80
+ {
81
+ type: 'function',
82
+ name: 'isSealIdBound',
83
+ stateMutability: 'view',
84
+ inputs: [{ name: 'sealId', type: 'bytes32' }],
85
+ outputs: [{ name: '', type: 'bool' }],
86
+ },
87
+
88
+ // ── Trusted Attestors ──
89
+ {
90
+ type: 'function',
91
+ name: 'addTrustedAttestor',
92
+ stateMutability: 'nonpayable',
93
+ inputs: [{ name: 'attestor', type: 'address' }],
94
+ outputs: [],
95
+ },
96
+ {
97
+ type: 'function',
98
+ name: 'removeTrustedAttestor',
99
+ stateMutability: 'nonpayable',
100
+ inputs: [{ name: 'attestor', type: 'address' }],
101
+ outputs: [],
102
+ },
103
+ {
104
+ type: 'function',
105
+ name: 'isTrustedAttestor',
106
+ stateMutability: 'view',
107
+ inputs: [{ name: 'attestor', type: 'address' }],
108
+ outputs: [{ name: '', type: 'bool' }],
109
+ },
110
+
111
+ // ── Framework Hashes ──
112
+ {
113
+ type: 'function',
114
+ name: 'addValidFrameworkHash',
115
+ stateMutability: 'nonpayable',
116
+ inputs: [{ name: 'frameworkHash', type: 'bytes32' }],
117
+ outputs: [],
118
+ },
119
+ {
120
+ type: 'function',
121
+ name: 'removeValidFrameworkHash',
122
+ stateMutability: 'nonpayable',
123
+ inputs: [{ name: 'frameworkHash', type: 'bytes32' }],
124
+ outputs: [],
125
+ },
126
+ {
127
+ type: 'function',
128
+ name: 'isValidFrameworkHash',
129
+ stateMutability: 'view',
130
+ inputs: [{ name: 'frameworkHash', type: 'bytes32' }],
131
+ outputs: [{ name: '', type: 'bool' }],
132
+ },
133
+
134
+ // ── Transfer (seal-bound only) ──
135
+ {
136
+ type: 'function',
137
+ name: 'transferFrom',
138
+ stateMutability: 'nonpayable',
139
+ inputs: [
140
+ { name: 'from', type: 'address' },
141
+ { name: 'to', type: 'address' },
142
+ { name: 'tokenId', type: 'uint256' },
143
+ ],
144
+ outputs: [],
145
+ },
146
+ {
147
+ type: 'function',
148
+ name: 'safeTransferFrom',
149
+ stateMutability: 'nonpayable',
150
+ inputs: [
151
+ { name: 'from', type: 'address' },
152
+ { name: 'to', type: 'address' },
153
+ { name: 'tokenId', type: 'uint256' },
154
+ { name: 'data', type: 'bytes' },
155
+ ],
156
+ outputs: [],
157
+ },
158
+
159
+ // ── Intelligent Transfer ──
160
+ {
161
+ type: 'function',
162
+ name: 'iTransferFrom',
163
+ stateMutability: 'nonpayable',
164
+ inputs: [
165
+ { name: 'from', type: 'address' },
166
+ { name: 'to', type: 'address' },
167
+ { name: 'tokenId', type: 'uint256' },
168
+ { name: 'proofs', type: 'tuple[]', components: [
169
+ { name: 'accessProof', type: 'tuple', components: [
170
+ { name: 'dataHash', type: 'bytes32' },
171
+ { name: 'targetPubkey', type: 'bytes' },
172
+ { name: 'nonce', type: 'bytes' },
173
+ { name: 'deadline', type: 'uint256' },
174
+ { name: 'proof', type: 'bytes' },
175
+ ] },
176
+ { name: 'ownershipProof', type: 'tuple', components: [
177
+ { name: 'oracleType', type: 'uint8' },
178
+ { name: 'dataHash', type: 'bytes32' },
179
+ { name: 'sealedKey', type: 'bytes' },
180
+ { name: 'targetPubkey', type: 'bytes' },
181
+ { name: 'nonce', type: 'bytes' },
182
+ { name: 'deadline', type: 'uint256' },
183
+ { name: 'proof', type: 'bytes' },
184
+ ] },
185
+ ] },
186
+ ],
187
+ outputs: [{ name: '', type: 'tuple[]', components: [
188
+ { name: 'dataHash', type: 'bytes32' },
189
+ { name: 'sealedKey', type: 'bytes' },
190
+ ] }],
191
+ },
192
+ {
193
+ type: 'function',
194
+ name: 'iCloneFrom',
195
+ stateMutability: 'nonpayable',
196
+ inputs: [
197
+ { name: 'from', type: 'address' },
198
+ { name: 'to', type: 'address' },
199
+ { name: 'tokenId', type: 'uint256' },
200
+ { name: 'proofs', type: 'tuple[]', components: [
201
+ { name: 'accessProof', type: 'tuple', components: [
202
+ { name: 'dataHash', type: 'bytes32' },
203
+ { name: 'targetPubkey', type: 'bytes' },
204
+ { name: 'nonce', type: 'bytes' },
205
+ { name: 'deadline', type: 'uint256' },
206
+ { name: 'proof', type: 'bytes' },
207
+ ] },
208
+ { name: 'ownershipProof', type: 'tuple', components: [
209
+ { name: 'oracleType', type: 'uint8' },
210
+ { name: 'dataHash', type: 'bytes32' },
211
+ { name: 'sealedKey', type: 'bytes' },
212
+ { name: 'targetPubkey', type: 'bytes' },
213
+ { name: 'nonce', type: 'bytes' },
214
+ { name: 'deadline', type: 'uint256' },
215
+ { name: 'proof', type: 'bytes' },
216
+ ] },
217
+ ] },
218
+ ],
219
+ outputs: [{ name: 'newTokenId', type: 'uint256' }],
220
+ },
221
+
222
+ // ── Update Agent Data ──
223
+ {
224
+ type: 'function',
225
+ name: 'update',
226
+ stateMutability: 'nonpayable',
227
+ inputs: [
228
+ { name: 'tokenId', type: 'uint256' },
229
+ { name: 'newDatas', type: 'tuple[]', components: [
230
+ { name: 'dataDescription', type: 'string' },
231
+ { name: 'dataHash', type: 'bytes32' },
232
+ ] },
233
+ { name: 'sealedKeys', type: 'bytes[]' },
234
+ ],
235
+ outputs: [],
236
+ },
237
+ {
238
+ type: 'function',
239
+ name: 'updateAt',
240
+ stateMutability: 'nonpayable',
241
+ inputs: [
242
+ { name: 'tokenId', type: 'uint256' },
243
+ { name: 'index', type: 'uint256' },
244
+ { name: 'newData', type: 'tuple', components: [
245
+ { name: 'dataDescription', type: 'string' },
246
+ { name: 'dataHash', type: 'bytes32' },
247
+ ] },
248
+ { name: 'sealedKey', type: 'bytes' },
249
+ ],
250
+ outputs: [],
251
+ },
252
+
253
+ // ── Read Agent Data ──
254
+ {
255
+ type: 'function',
256
+ name: 'intelligentDatasOf',
257
+ stateMutability: 'view',
258
+ inputs: [{ name: 'tokenId', type: 'uint256' }],
259
+ outputs: [{ name: '', type: 'tuple[]', components: [
260
+ { name: 'dataDescription', type: 'string' },
261
+ { name: 'dataHash', type: 'bytes32' },
262
+ ] }],
263
+ },
264
+ {
265
+ type: 'function',
266
+ name: 'sealedKeysOf',
267
+ stateMutability: 'view',
268
+ inputs: [{ name: 'tokenId', type: 'uint256' }],
269
+ outputs: [{ name: '', type: 'bytes[]' }],
270
+ },
271
+
272
+ // ── Agent URI ──
273
+ {
274
+ type: 'function',
275
+ name: 'setAgentURI',
276
+ stateMutability: 'nonpayable',
277
+ inputs: [
278
+ { name: 'agentId', type: 'uint256' },
279
+ { name: 'newURI', type: 'string' },
280
+ ],
281
+ outputs: [],
282
+ },
283
+
284
+ // ── Metadata ──
285
+ {
286
+ type: 'function',
287
+ name: 'getMetadata',
288
+ stateMutability: 'view',
289
+ inputs: [
290
+ { name: 'agentId', type: 'uint256' },
291
+ { name: 'metadataKey', type: 'string' },
292
+ ],
293
+ outputs: [{ name: '', type: 'bytes' }],
294
+ },
295
+ {
296
+ type: 'function',
297
+ name: 'setMetadata',
298
+ stateMutability: 'nonpayable',
299
+ inputs: [
300
+ { name: 'agentId', type: 'uint256' },
301
+ { name: 'metadataKey', type: 'string' },
302
+ { name: 'metadataValue', type: 'bytes' },
303
+ ],
304
+ outputs: [],
305
+ },
306
+
307
+ // ── Agent Wallet ──
308
+ {
309
+ type: 'function',
310
+ name: 'setAgentWallet',
311
+ stateMutability: 'nonpayable',
312
+ inputs: [
313
+ { name: 'agentId', type: 'uint256' },
314
+ { name: 'newWallet', type: 'address' },
315
+ { name: 'deadline', type: 'uint256' },
316
+ { name: 'signature', type: 'bytes' },
317
+ ],
318
+ outputs: [],
319
+ },
320
+ {
321
+ type: 'function',
322
+ name: 'getAgentWallet',
323
+ stateMutability: 'view',
324
+ inputs: [{ name: 'agentId', type: 'uint256' }],
325
+ outputs: [{ name: '', type: 'address' }],
326
+ },
327
+ {
328
+ type: 'function',
329
+ name: 'unsetAgentWallet',
330
+ stateMutability: 'nonpayable',
331
+ inputs: [{ name: 'agentId', type: 'uint256' }],
332
+ outputs: [],
333
+ },
334
+
335
+ // ── Authorization ──
336
+ {
337
+ type: 'function',
338
+ name: 'authorizeUsage',
339
+ stateMutability: 'nonpayable',
340
+ inputs: [
341
+ { name: 'tokenId', type: 'uint256' },
342
+ { name: 'user', type: 'address' },
343
+ ],
344
+ outputs: [],
345
+ },
346
+ {
347
+ type: 'function',
348
+ name: 'batchAuthorizeUsage',
349
+ stateMutability: 'nonpayable',
350
+ inputs: [
351
+ { name: 'tokenId', type: 'uint256' },
352
+ { name: 'users', type: 'address[]' },
353
+ ],
354
+ outputs: [],
355
+ },
356
+ {
357
+ type: 'function',
358
+ name: 'revokeAuthorization',
359
+ stateMutability: 'nonpayable',
360
+ inputs: [
361
+ { name: 'tokenId', type: 'uint256' },
362
+ { name: 'user', type: 'address' },
363
+ ],
364
+ outputs: [],
365
+ },
366
+ {
367
+ type: 'function',
368
+ name: 'clearAuthorizedUsers',
369
+ stateMutability: 'nonpayable',
370
+ inputs: [{ name: 'tokenId', type: 'uint256' }],
371
+ outputs: [],
372
+ },
373
+ {
374
+ type: 'function',
375
+ name: 'authorizedUsersOf',
376
+ stateMutability: 'view',
377
+ inputs: [{ name: 'tokenId', type: 'uint256' }],
378
+ outputs: [{ name: '', type: 'address[]' }],
379
+ },
380
+
381
+ // ── Access Delegate ──
382
+ {
383
+ type: 'function',
384
+ name: 'setAccessDelegate',
385
+ stateMutability: 'nonpayable',
386
+ inputs: [{ name: 'delegate', type: 'address' }],
387
+ outputs: [],
388
+ },
389
+ {
390
+ type: 'function',
391
+ name: 'getAccessDelegate',
392
+ stateMutability: 'view',
393
+ inputs: [{ name: 'user', type: 'address' }],
394
+ outputs: [{ name: '', type: 'address' }],
395
+ },
396
+
397
+ // ── ERC-721 Standard ──
398
+ {
399
+ type: 'function',
400
+ name: 'ownerOf',
401
+ stateMutability: 'view',
402
+ inputs: [{ name: 'tokenId', type: 'uint256' }],
403
+ outputs: [{ name: '', type: 'address' }],
404
+ },
405
+ {
406
+ type: 'function',
407
+ name: 'getApproved',
408
+ stateMutability: 'view',
409
+ inputs: [{ name: 'tokenId', type: 'uint256' }],
410
+ outputs: [{ name: '', type: 'address' }],
411
+ },
412
+ {
413
+ type: 'function',
414
+ name: 'isApprovedForAll',
415
+ stateMutability: 'view',
416
+ inputs: [
417
+ { name: 'owner', type: 'address' },
418
+ { name: 'operator', type: 'address' },
419
+ ],
420
+ outputs: [{ name: '', type: 'bool' }],
421
+ },
422
+ {
423
+ type: 'function',
424
+ name: 'balanceOf',
425
+ stateMutability: 'view',
426
+ inputs: [{ name: 'owner', type: 'address' }],
427
+ outputs: [{ name: '', type: 'uint256' }],
428
+ },
429
+
430
+ // ── Pause ──
431
+ {
432
+ type: 'function',
433
+ name: 'pause',
434
+ stateMutability: 'nonpayable',
435
+ inputs: [],
436
+ outputs: [],
437
+ },
438
+ {
439
+ type: 'function',
440
+ name: 'unpause',
441
+ stateMutability: 'nonpayable',
442
+ inputs: [],
443
+ outputs: [],
444
+ },
445
+ {
446
+ type: 'function',
447
+ name: 'pauser',
448
+ stateMutability: 'view',
449
+ inputs: [],
450
+ outputs: [{ name: '', type: 'address' }],
451
+ },
452
+ {
453
+ type: 'function',
454
+ name: 'setPauser',
455
+ stateMutability: 'nonpayable',
456
+ inputs: [{ name: 'newPauser', type: 'address' }],
457
+ outputs: [],
458
+ },
459
+ {
460
+ type: 'function',
461
+ name: 'setVerifier',
462
+ stateMutability: 'nonpayable',
463
+ inputs: [{ name: 'newVerifier', type: 'address' }],
464
+ outputs: [],
465
+ },
466
+
467
+ // ── Events ──
468
+ // Registration has no AgenticID-local event: watch the ERC-721 `Transfer`
469
+ // (from zero) below, plus `AgentSealSet`; the canonical identity registry
470
+ // emits its own `Registered`.
471
+ {
472
+ type: 'event',
473
+ name: 'AgentSealSet',
474
+ inputs: [
475
+ { name: 'agentId', type: 'uint256', indexed: true },
476
+ { name: 'agentSeal', type: 'address', indexed: true },
477
+ { name: 'sealId', type: 'bytes32', indexed: true },
478
+ ],
479
+ },
480
+ {
481
+ type: 'event',
482
+ name: 'Updated',
483
+ inputs: [
484
+ { name: 'tokenId', type: 'uint256', indexed: true },
485
+ { name: 'oldDatas', type: 'tuple[]', indexed: false, components: [
486
+ { name: 'dataDescription', type: 'string' },
487
+ { name: 'dataHash', type: 'bytes32' },
488
+ ] },
489
+ { name: 'newDatas', type: 'tuple[]', indexed: false, components: [
490
+ { name: 'dataDescription', type: 'string' },
491
+ { name: 'dataHash', type: 'bytes32' },
492
+ ] },
493
+ { name: 'sealedKeys', type: 'bytes[]', indexed: false },
494
+ ],
495
+ },
496
+ {
497
+ type: 'event',
498
+ name: 'Transfer',
499
+ inputs: [
500
+ { name: 'from', type: 'address', indexed: true },
501
+ { name: 'to', type: 'address', indexed: true },
502
+ { name: 'tokenId', type: 'uint256', indexed: true },
503
+ ],
504
+ },
505
+ {
506
+ type: 'event',
507
+ name: 'Paused',
508
+ inputs: [{ name: 'account', type: 'address', indexed: false }],
509
+ },
510
+ {
511
+ type: 'event',
512
+ name: 'Unpaused',
513
+ inputs: [{ name: 'account', type: 'address', indexed: false }],
514
+ },
515
+ ] as const;
516
+
517
+ /**
518
+ * Official canonical ERC-8004 ReputationRegistry (the fixed 0x8004B… singleton;
519
+ * v2.0.0). Feedback STORAGE lives here — clients call `giveFeedback` directly,
520
+ * so attribution is native msg.sender and every 8004 reader sees it. It has no
521
+ * ServeProof parameter and no custom errors (plain require strings).
522
+ * TEE verification marks live in the separate VerifiedFeedbackRegistry
523
+ * (`verifiedFeedbackAbi` below).
524
+ */
525
+ export const canonicalReputationAbi = [
526
+ // ── Give Feedback (canonical 8-arg form, attribution = msg.sender) ──
527
+ {
528
+ type: 'function',
529
+ name: 'giveFeedback',
530
+ stateMutability: 'nonpayable',
531
+ inputs: [
532
+ { name: 'agentId', type: 'uint256' },
533
+ { name: 'value', type: 'int128' },
534
+ { name: 'valueDecimals', type: 'uint8' },
535
+ { name: 'tag1', type: 'string' },
536
+ { name: 'tag2', type: 'string' },
537
+ { name: 'endpoint', type: 'string' },
538
+ { name: 'feedbackURI', type: 'string' },
539
+ { name: 'feedbackHash', type: 'bytes32' },
540
+ ],
541
+ outputs: [],
542
+ },
543
+
544
+ // ── Revoke Feedback ──
545
+ {
546
+ type: 'function',
547
+ name: 'revokeFeedback',
548
+ stateMutability: 'nonpayable',
549
+ inputs: [
550
+ { name: 'agentId', type: 'uint256' },
551
+ { name: 'feedbackIndex', type: 'uint64' },
552
+ ],
553
+ outputs: [],
554
+ },
555
+
556
+ // ── Append Response ──
557
+ {
558
+ type: 'function',
559
+ name: 'appendResponse',
560
+ stateMutability: 'nonpayable',
561
+ inputs: [
562
+ { name: 'agentId', type: 'uint256' },
563
+ { name: 'clientAddress', type: 'address' },
564
+ { name: 'feedbackIndex', type: 'uint64' },
565
+ { name: 'responseURI', type: 'string' },
566
+ { name: 'responseHash', type: 'bytes32' },
567
+ ],
568
+ outputs: [],
569
+ },
570
+
571
+ // ── Read Feedback ──
572
+ {
573
+ type: 'function',
574
+ name: 'readFeedback',
575
+ stateMutability: 'view',
576
+ inputs: [
577
+ { name: 'agentId', type: 'uint256' },
578
+ { name: 'clientAddress', type: 'address' },
579
+ { name: 'feedbackIndex', type: 'uint64' },
580
+ ],
581
+ outputs: [
582
+ { name: 'value', type: 'int128' },
583
+ { name: 'valueDecimals', type: 'uint8' },
584
+ { name: 'tag1', type: 'string' },
585
+ { name: 'tag2', type: 'string' },
586
+ { name: 'isRevoked', type: 'bool' },
587
+ ],
588
+ },
589
+
590
+ // ── Read All Feedback ──
591
+ {
592
+ type: 'function',
593
+ name: 'readAllFeedback',
594
+ stateMutability: 'view',
595
+ inputs: [
596
+ { name: 'agentId', type: 'uint256' },
597
+ { name: 'clientAddresses', type: 'address[]' },
598
+ { name: 'tag1', type: 'string' },
599
+ { name: 'tag2', type: 'string' },
600
+ { name: 'includeRevoked', type: 'bool' },
601
+ ],
602
+ outputs: [
603
+ { name: 'clients', type: 'address[]' },
604
+ { name: 'feedbackIndexes', type: 'uint64[]' },
605
+ { name: 'values', type: 'int128[]' },
606
+ { name: 'valueDecimals', type: 'uint8[]' },
607
+ { name: 'tag1s', type: 'string[]' },
608
+ { name: 'tag2s', type: 'string[]' },
609
+ { name: 'revokedStatuses', type: 'bool[]' },
610
+ ],
611
+ },
612
+
613
+ // ── Get Summary ──
614
+ {
615
+ type: 'function',
616
+ name: 'getSummary',
617
+ stateMutability: 'view',
618
+ inputs: [
619
+ { name: 'agentId', type: 'uint256' },
620
+ { name: 'clientAddresses', type: 'address[]' },
621
+ { name: 'tag1', type: 'string' },
622
+ { name: 'tag2', type: 'string' },
623
+ ],
624
+ outputs: [
625
+ { name: 'count', type: 'uint64' },
626
+ { name: 'summaryValue', type: 'int128' },
627
+ { name: 'summaryValueDecimals', type: 'uint8' },
628
+ ],
629
+ },
630
+
631
+ // ── Get Response Count ──
632
+ {
633
+ type: 'function',
634
+ name: 'getResponseCount',
635
+ stateMutability: 'view',
636
+ inputs: [
637
+ { name: 'agentId', type: 'uint256' },
638
+ { name: 'clientAddress', type: 'address' },
639
+ { name: 'feedbackIndex', type: 'uint64' },
640
+ { name: 'responders', type: 'address[]' },
641
+ ],
642
+ outputs: [{ name: 'count', type: 'uint64' }],
643
+ },
644
+
645
+ // ── Get Clients ──
646
+ {
647
+ type: 'function',
648
+ name: 'getClients',
649
+ stateMutability: 'view',
650
+ inputs: [{ name: 'agentId', type: 'uint256' }],
651
+ outputs: [{ name: '', type: 'address[]' }],
652
+ },
653
+
654
+ // ── Get Last Index ──
655
+ {
656
+ type: 'function',
657
+ name: 'getLastIndex',
658
+ stateMutability: 'view',
659
+ inputs: [
660
+ { name: 'agentId', type: 'uint256' },
661
+ { name: 'clientAddress', type: 'address' },
662
+ ],
663
+ outputs: [{ name: '', type: 'uint64' }],
664
+ },
665
+
666
+ // ── Environment sanity reads ──
667
+ {
668
+ type: 'function',
669
+ name: 'getIdentityRegistry',
670
+ stateMutability: 'view',
671
+ inputs: [],
672
+ outputs: [{ name: '', type: 'address' }],
673
+ },
674
+ {
675
+ type: 'function',
676
+ name: 'getVersion',
677
+ stateMutability: 'pure',
678
+ inputs: [],
679
+ outputs: [{ name: '', type: 'string' }],
680
+ },
681
+
682
+ // ── Events (canonical v2.0.0 shapes) ──
683
+ {
684
+ type: 'event',
685
+ name: 'NewFeedback',
686
+ inputs: [
687
+ { name: 'agentId', type: 'uint256', indexed: true },
688
+ { name: 'clientAddress', type: 'address', indexed: true },
689
+ { name: 'feedbackIndex', type: 'uint64', indexed: false },
690
+ { name: 'value', type: 'int128', indexed: false },
691
+ { name: 'valueDecimals', type: 'uint8', indexed: false },
692
+ { name: 'indexedTag1', type: 'string', indexed: true },
693
+ { name: 'tag1', type: 'string', indexed: false },
694
+ { name: 'tag2', type: 'string', indexed: false },
695
+ { name: 'endpoint', type: 'string', indexed: false },
696
+ { name: 'feedbackURI', type: 'string', indexed: false },
697
+ { name: 'feedbackHash', type: 'bytes32', indexed: false },
698
+ ],
699
+ },
700
+ {
701
+ type: 'event',
702
+ name: 'FeedbackRevoked',
703
+ inputs: [
704
+ { name: 'agentId', type: 'uint256', indexed: true },
705
+ { name: 'clientAddress', type: 'address', indexed: true },
706
+ { name: 'feedbackIndex', type: 'uint64', indexed: true },
707
+ ],
708
+ },
709
+ {
710
+ type: 'event',
711
+ name: 'ResponseAppended',
712
+ inputs: [
713
+ { name: 'agentId', type: 'uint256', indexed: true },
714
+ { name: 'clientAddress', type: 'address', indexed: true },
715
+ { name: 'feedbackIndex', type: 'uint64', indexed: false },
716
+ { name: 'responder', type: 'address', indexed: true },
717
+ { name: 'responseURI', type: 'string', indexed: false },
718
+ { name: 'responseHash', type: 'bytes32', indexed: false },
719
+ ],
720
+ },
721
+ ] as const;
722
+
723
+ /**
724
+ * VerifiedFeedbackRegistry — the local TEE-verification layer over the
725
+ * canonical ERC-8004 ReputationRegistry. `attestFeedback` marks a canonical
726
+ * entry as backed by a ServeProof; the `getVerified*` reads expose the marks
727
+ * so readers can intersect them with canonical entries.
728
+ */
729
+ export const verifiedFeedbackAbi = [
730
+ // Custom errors — so viem decodes reverts instead of showing a 4-byte selector.
731
+ {"type":"error","name":"ECDSAInvalidSignature","inputs":[]},
732
+ {"type":"error","name":"ECDSAInvalidSignatureLength","inputs":[{"name":"length","type":"uint256"}]},
733
+ {"type":"error","name":"ECDSAInvalidSignatureS","inputs":[{"name":"s","type":"bytes32"}]},
734
+ {"type":"error","name":"EnforcedPause","inputs":[]},
735
+ {"type":"error","name":"ExpectedPause","inputs":[]},
736
+ {"type":"error","name":"InvalidInitialization","inputs":[]},
737
+ {"type":"error","name":"NonceAlreadyUsed","inputs":[{"name":"key","type":"bytes32"}]},
738
+ {"type":"error","name":"NonceDeadlineTooFar","inputs":[{"name":"deadline","type":"uint256"},{"name":"maxDeadline","type":"uint256"}]},
739
+ {"type":"error","name":"NonceExpired","inputs":[{"name":"deadline","type":"uint256"},{"name":"nowTimestamp","type":"uint256"}]},
740
+ {"type":"error","name":"NonceMaxAgeDecrease","inputs":[{"name":"currentMaxAge","type":"uint256"},{"name":"newMaxAge","type":"uint256"}]},
741
+ {"type":"error","name":"NonceMaxAgeOutOfRange","inputs":[{"name":"maxAge","type":"uint256"}]},
742
+ {"type":"error","name":"NotInitializing","inputs":[]},
743
+ {"type":"error","name":"OwnableInvalidOwner","inputs":[{"name":"owner","type":"address"}]},
744
+ {"type":"error","name":"OwnableUnauthorizedAccount","inputs":[{"name":"account","type":"address"}]},
745
+ {"type":"error","name":"VerifiedFeedbackAlreadyVerified","inputs":[{"name":"agentId","type":"uint256"},{"name":"clientAddress","type":"address"},{"name":"feedbackIndex","type":"uint64"}]},
746
+ {"type":"error","name":"VerifiedFeedbackClientsRequired","inputs":[]},
747
+ {"type":"error","name":"VerifiedFeedbackInvalidProofSignature","inputs":[]},
748
+ {"type":"error","name":"VerifiedFeedbackNoAgentSeal","inputs":[]},
749
+ {"type":"error","name":"VerifiedFeedbackNoSuchEntry","inputs":[{"name":"agentId","type":"uint256"},{"name":"clientAddress","type":"address"},{"name":"feedbackIndex","type":"uint64"},{"name":"lastIndex","type":"uint64"}]},
750
+ {"type":"error","name":"VerifiedFeedbackNotPauser","inputs":[]},
751
+ {"type":"error","name":"VerifiedFeedbackNotVerified","inputs":[{"name":"agentId","type":"uint256"},{"name":"clientAddress","type":"address"},{"name":"feedbackIndex","type":"uint64"}]},
752
+ {"type":"error","name":"VerifiedFeedbackProofAgentMismatch","inputs":[{"name":"agentId","type":"uint256"},{"name":"proofAgentId","type":"uint256"}]},
753
+ {"type":"error","name":"VerifiedFeedbackProofSubmitterMismatch","inputs":[{"name":"submitter","type":"address"},{"name":"sender","type":"address"}]},
754
+ {"type":"error","name":"VerifiedFeedbackSelfFeedback","inputs":[{"name":"agentId","type":"uint256"},{"name":"submitter","type":"address"}]},
755
+ {"type":"error","name":"VerifiedFeedbackSummaryOverflow","inputs":[]},
756
+ {"type":"error","name":"VerifiedFeedbackTaskMismatch","inputs":[{"name":"expected","type":"bytes32"},{"name":"actual","type":"bytes32"}]},
757
+ {"type":"error","name":"VerifiedFeedbackInvalidTaskReveal","inputs":[]},
758
+ {"type":"error","name":"VerifiedFeedbackValueOutOfRange","inputs":[{"name":"value","type":"int128"},{"name":"valueDecimals","type":"uint8"}]},
759
+ {"type":"error","name":"VerifiedFeedbackEndpointRequired","inputs":[]},
760
+ {"type":"error","name":"VerifiedFeedbackInvalidProofTimestamp","inputs":[]},
761
+
762
+ // ── Attest ──
763
+ {
764
+ type: 'function',
765
+ name: 'attestFeedback',
766
+ stateMutability: 'nonpayable',
767
+ inputs: [
768
+ { name: 'agentId', type: 'uint256' },
769
+ { name: 'feedbackIndex', type: 'uint64' },
770
+ { name: 'proof', type: 'tuple', components: [
771
+ { name: 'agentId', type: 'uint256' },
772
+ { name: 'submitter', type: 'address' },
773
+ { name: 'timestamp', type: 'uint256' },
774
+ { name: 'deadline', type: 'uint256' },
775
+ { name: 'taskHash', type: 'bytes32' },
776
+ { name: 'dataHashes', type: 'bytes32[]' },
777
+ { name: 'frameworkHash', type: 'bytes32' },
778
+ { name: 'signature', type: 'bytes' },
779
+ ] },
780
+ ],
781
+ outputs: [],
782
+ },
783
+ {
784
+ type: 'function',
785
+ name: 'attestFeedbackWithTask',
786
+ stateMutability: 'nonpayable',
787
+ inputs: [
788
+ { name: 'agentId', type: 'uint256' },
789
+ { name: 'feedbackIndex', type: 'uint64' },
790
+ { name: 'proof', type: 'tuple', components: [
791
+ { name: 'agentId', type: 'uint256' },
792
+ { name: 'submitter', type: 'address' },
793
+ { name: 'timestamp', type: 'uint256' },
794
+ { name: 'deadline', type: 'uint256' },
795
+ { name: 'taskHash', type: 'bytes32' },
796
+ { name: 'dataHashes', type: 'bytes32[]' },
797
+ { name: 'frameworkHash', type: 'bytes32' },
798
+ { name: 'signature', type: 'bytes' },
799
+ ] },
800
+ { name: 'task', type: 'tuple', components: [
801
+ { name: 'method', type: 'string' },
802
+ { name: 'uri', type: 'string' },
803
+ { name: 'reqBodyHash', type: 'bytes32' },
804
+ { name: 'respBodyHash', type: 'bytes32' },
805
+ { name: 'statusCode', type: 'uint16' },
806
+ ] },
807
+ ],
808
+ outputs: [],
809
+ },
810
+
811
+ // ── Reads ──
812
+ {
813
+ type: 'function',
814
+ name: 'isVerified',
815
+ stateMutability: 'view',
816
+ inputs: [
817
+ { name: 'agentId', type: 'uint256' },
818
+ { name: 'clientAddress', type: 'address' },
819
+ { name: 'feedbackIndex', type: 'uint64' },
820
+ ],
821
+ outputs: [{ name: '', type: 'bool' }],
822
+ },
823
+ {
824
+ type: 'function',
825
+ name: 'getServeData',
826
+ stateMutability: 'view',
827
+ inputs: [
828
+ { name: 'agentId', type: 'uint256' },
829
+ { name: 'clientAddress', type: 'address' },
830
+ { name: 'feedbackIndex', type: 'uint64' },
831
+ ],
832
+ outputs: [
833
+ { name: 'dataHashes', type: 'bytes32[]' },
834
+ { name: 'frameworkHash', type: 'bytes32' },
835
+ ],
836
+ },
837
+ {
838
+ type: 'function',
839
+ name: 'getVerifiedIndexes',
840
+ stateMutability: 'view',
841
+ inputs: [
842
+ { name: 'agentId', type: 'uint256' },
843
+ { name: 'clientAddress', type: 'address' },
844
+ ],
845
+ outputs: [{ name: '', type: 'uint64[]' }],
846
+ },
847
+ {
848
+ type: 'function',
849
+ name: 'getVerifiedClients',
850
+ stateMutability: 'view',
851
+ inputs: [{ name: 'agentId', type: 'uint256' }],
852
+ outputs: [{ name: '', type: 'address[]' }],
853
+ },
854
+ {
855
+ type: 'function',
856
+ name: 'getVerifiedEndpoint',
857
+ stateMutability: 'view',
858
+ inputs: [
859
+ { name: 'agentId', type: 'uint256' },
860
+ { name: 'clientAddress', type: 'address' },
861
+ { name: 'feedbackIndex', type: 'uint64' },
862
+ ],
863
+ outputs: [{ name: '', type: 'string' }],
864
+ },
865
+ {
866
+ type: 'function',
867
+ name: 'getVerifiedSummaryForEndpoint',
868
+ stateMutability: 'view',
869
+ inputs: [
870
+ { name: 'agentId', type: 'uint256' },
871
+ { name: 'clientAddresses', type: 'address[]' },
872
+ { name: 'uri', type: 'string' },
873
+ ],
874
+ outputs: [
875
+ { name: 'count', type: 'uint64' },
876
+ { name: 'summaryValue', type: 'int128' },
877
+ { name: 'summaryValueDecimals', type: 'uint8' },
878
+ ],
879
+ },
880
+ {
881
+ type: 'function',
882
+ name: 'getVerifiedSummary',
883
+ stateMutability: 'view',
884
+ inputs: [
885
+ { name: 'agentId', type: 'uint256' },
886
+ { name: 'clientAddresses', type: 'address[]' },
887
+ { name: 'tag1', type: 'string' },
888
+ { name: 'tag2', type: 'string' },
889
+ ],
890
+ outputs: [
891
+ { name: 'count', type: 'uint64' },
892
+ { name: 'summaryValue', type: 'int128' },
893
+ { name: 'summaryValueDecimals', type: 'uint8' },
894
+ ],
895
+ },
896
+ {
897
+ type: 'function',
898
+ name: 'getIdentityRegistry',
899
+ stateMutability: 'view',
900
+ inputs: [],
901
+ outputs: [{ name: '', type: 'address' }],
902
+ },
903
+ {
904
+ type: 'function',
905
+ name: 'getCanonicalReputation',
906
+ stateMutability: 'view',
907
+ inputs: [],
908
+ outputs: [{ name: '', type: 'address' }],
909
+ },
910
+ // NonceRegistry view: a ServeProof's nonce key is
911
+ // keccak256(abi.encode(keccak256("SERVEPROOF"), agentId, signature)).
912
+ {
913
+ type: 'function',
914
+ name: 'isNonceConsumed',
915
+ stateMutability: 'view',
916
+ inputs: [{ name: 'key', type: 'bytes32' }],
917
+ outputs: [{ name: '', type: 'bool' }],
918
+ },
919
+
920
+ // ── Events ──
921
+ {
922
+ type: 'event',
923
+ name: 'FeedbackVerified',
924
+ inputs: [
925
+ { name: 'agentId', type: 'uint256', indexed: true },
926
+ { name: 'clientAddress', type: 'address', indexed: true },
927
+ { name: 'feedbackIndex', type: 'uint64', indexed: true },
928
+ { name: 'dataHashes', type: 'bytes32[]', indexed: false },
929
+ { name: 'frameworkHash', type: 'bytes32', indexed: false },
930
+ { name: 'taskHash', type: 'bytes32', indexed: false },
931
+ { name: 'uri', type: 'string', indexed: false },
932
+ ],
933
+ },
934
+ ] as const;
935
+
936
+ /**
937
+ * FeedbackBatcher — EIP-7702 delegate target. A client EOA attaches this code
938
+ * to itself (type-4 authorization) and self-calls to execute the canonical
939
+ * giveFeedback + attestFeedback pair atomically, with msg.sender = the EOA
940
+ * for both inner calls.
941
+ */
942
+ export const feedbackBatcherAbi = [
943
+ {"type":"error","name":"BatcherNotSelf","inputs":[]},
944
+ {
945
+ type: 'function',
946
+ name: 'giveFeedbackAndAttest',
947
+ stateMutability: 'nonpayable',
948
+ inputs: [
949
+ { name: 'agentId', type: 'uint256' },
950
+ { name: 'value', type: 'int128' },
951
+ { name: 'valueDecimals', type: 'uint8' },
952
+ { name: 'tag1', type: 'string' },
953
+ { name: 'tag2', type: 'string' },
954
+ { name: 'endpoint', type: 'string' },
955
+ { name: 'feedbackURI', type: 'string' },
956
+ { name: 'feedbackHash', type: 'bytes32' },
957
+ { name: 'proof', type: 'tuple', components: [
958
+ { name: 'agentId', type: 'uint256' },
959
+ { name: 'submitter', type: 'address' },
960
+ { name: 'timestamp', type: 'uint256' },
961
+ { name: 'deadline', type: 'uint256' },
962
+ { name: 'taskHash', type: 'bytes32' },
963
+ { name: 'dataHashes', type: 'bytes32[]' },
964
+ { name: 'frameworkHash', type: 'bytes32' },
965
+ { name: 'signature', type: 'bytes' },
966
+ ] },
967
+ { name: 'task', type: 'tuple', components: [
968
+ { name: 'method', type: 'string' },
969
+ { name: 'uri', type: 'string' },
970
+ { name: 'reqBodyHash', type: 'bytes32' },
971
+ { name: 'respBodyHash', type: 'bytes32' },
972
+ { name: 'statusCode', type: 'uint16' },
973
+ ] },
974
+ ],
975
+ outputs: [{ name: 'feedbackIndex', type: 'uint64' }],
976
+ },
977
+ {
978
+ type: 'function',
979
+ name: 'canonicalReputation',
980
+ stateMutability: 'view',
981
+ inputs: [],
982
+ outputs: [{ name: '', type: 'address' }],
983
+ },
984
+ {
985
+ type: 'function',
986
+ name: 'verifiedFeedback',
987
+ stateMutability: 'view',
988
+ inputs: [],
989
+ outputs: [{ name: '', type: 'address' }],
990
+ },
991
+ ] as const;
992
+
993
+
994
+ /**
995
+ * CloneGate — policy-mode cloning SATELLITE of AgenticID (the core contract
996
+ * sits at the EIP-170 bytecode ceiling; clone policy + lineage live here).
997
+ * The owner opts in with setCloneAuthorizer; the attestor mints through
998
+ * cloneFrom, which consults the policy atomically. cloneAuthorizerOf returns
999
+ * the EFFECTIVE authorizer: 0 when unset, cleared, or auto-invalidated by an
1000
+ * ownership transfer since it was set.
1001
+ */
1002
+ export const cloneGateAbi = [
1003
+ {"type":"error","name":"CloneGateNotTrustedAttestor","inputs":[]},
1004
+ {"type":"error","name":"CloneGateNotTokenOwner","inputs":[{"name":"caller","type":"address"},{"name":"tokenId","type":"uint256"},{"name":"owner","type":"address"}]},
1005
+ {"type":"error","name":"CloneGateDenied","inputs":[{"name":"sourceAgentId","type":"uint256"},{"name":"authorizer","type":"address"}]},
1006
+ {"type":"error","name":"CloneGateDataHashMismatch","inputs":[{"name":"index","type":"uint256"},{"name":"onChain","type":"bytes32"},{"name":"submitted","type":"bytes32"}]},
1007
+ {"type":"error","name":"CloneGateArityMismatch","inputs":[{"name":"expected","type":"uint256"},{"name":"got","type":"uint256"}]},
1008
+ {
1009
+ type: 'function',
1010
+ name: 'setCloneAuthorizer',
1011
+ stateMutability: 'nonpayable',
1012
+ inputs: [
1013
+ { name: 'tokenId', type: 'uint256' },
1014
+ { name: 'authorizer', type: 'address' },
1015
+ ],
1016
+ outputs: [],
1017
+ },
1018
+ {
1019
+ type: 'function',
1020
+ name: 'cloneAuthorizerOf',
1021
+ stateMutability: 'view',
1022
+ inputs: [{ name: 'tokenId', type: 'uint256' }],
1023
+ outputs: [{ name: '', type: 'address' }],
1024
+ },
1025
+ {
1026
+ type: 'function',
1027
+ name: 'cloneSourceOf',
1028
+ stateMutability: 'view',
1029
+ inputs: [{ name: 'agentId_', type: 'uint256' }],
1030
+ outputs: [{ name: '', type: 'uint256' }],
1031
+ },
1032
+ {
1033
+ type: 'function',
1034
+ name: 'cloneFrom',
1035
+ stateMutability: 'nonpayable',
1036
+ inputs: [
1037
+ { name: 'sourceAgentId', type: 'uint256' },
1038
+ { name: 'to', type: 'address' },
1039
+ { name: 'dataHashes', type: 'bytes32[]' },
1040
+ { name: 'sealedKeys', type: 'bytes[]' },
1041
+ { name: 'newAgentSeal', type: 'address' },
1042
+ { name: 'newSealId', type: 'bytes32' },
1043
+ { name: 'caller', type: 'address' },
1044
+ { name: 'authData', type: 'bytes' },
1045
+ ],
1046
+ outputs: [{ name: 'agentId_', type: 'uint256' }],
1047
+ },
1048
+ {
1049
+ type: 'event',
1050
+ name: 'CloneAuthorizerSet',
1051
+ inputs: [
1052
+ { name: 'tokenId', type: 'uint256', indexed: true },
1053
+ { name: 'authorizer', type: 'address', indexed: true },
1054
+ { name: 'owner', type: 'address', indexed: false },
1055
+ ],
1056
+ },
1057
+ {
1058
+ type: 'event',
1059
+ name: 'ClonedFrom',
1060
+ inputs: [
1061
+ { name: 'sourceAgentId', type: 'uint256', indexed: true },
1062
+ { name: 'newAgentId', type: 'uint256', indexed: true },
1063
+ { name: 'to', type: 'address', indexed: true },
1064
+ { name: 'caller', type: 'address', indexed: false },
1065
+ ],
1066
+ },
1067
+
1068
+ {
1069
+ type: 'function',
1070
+ name: 'agenticId',
1071
+ stateMutability: 'view',
1072
+ inputs: [],
1073
+ outputs: [{ name: '', type: 'address' }],
1074
+ },
1075
+ ] as const;
1076
+
1077
+ /**
1078
+ * StandardCloneAuthorizer — the OFFICIAL stock clone policy: a per-buyer
1079
+ * permission switch keyed (sourceAgentId, buyer), grant/revoke gated on the
1080
+ * source's current owner. The SDK's grantClone/revokeClone/cloneGrantOf
1081
+ * helpers speak this ABI to whatever authorizer the token has configured —
1082
+ * they only work when that policy IS the standard one (a custom policy has
1083
+ * its own management surface).
1084
+ */
1085
+ export const standardCloneAuthorizerAbi = [
1086
+ {
1087
+ type: 'function',
1088
+ name: 'grant',
1089
+ stateMutability: 'nonpayable',
1090
+ inputs: [
1091
+ { name: 'sourceAgentId', type: 'uint256' },
1092
+ { name: 'buyer', type: 'address' },
1093
+ ],
1094
+ outputs: [],
1095
+ },
1096
+ {
1097
+ type: 'function',
1098
+ name: 'revoke',
1099
+ stateMutability: 'nonpayable',
1100
+ inputs: [
1101
+ { name: 'sourceAgentId', type: 'uint256' },
1102
+ { name: 'buyer', type: 'address' },
1103
+ ],
1104
+ outputs: [],
1105
+ },
1106
+ {
1107
+ type: 'function',
1108
+ name: 'grantOf',
1109
+ stateMutability: 'view',
1110
+ inputs: [
1111
+ { name: 'sourceAgentId', type: 'uint256' },
1112
+ { name: 'buyer', type: 'address' },
1113
+ ],
1114
+ outputs: [
1115
+ { name: 'grantor', type: 'address' },
1116
+ { name: 'effective', type: 'bool' },
1117
+ ],
1118
+ },
1119
+ {
1120
+ type: 'function',
1121
+ name: 'canClone',
1122
+ stateMutability: 'view',
1123
+ inputs: [
1124
+ { name: 'sourceAgentId', type: 'uint256' },
1125
+ { name: 'targetOwner', type: 'address' },
1126
+ { name: 'caller', type: 'address' },
1127
+ { name: 'data', type: 'bytes' },
1128
+ ],
1129
+ outputs: [{ name: '', type: 'bool' }],
1130
+ },
1131
+ {
1132
+ type: 'error',
1133
+ name: 'StdCloneAuthNotSeller',
1134
+ inputs: [
1135
+ { name: 'caller', type: 'address' },
1136
+ { name: 'sourceAgentId', type: 'uint256' },
1137
+ { name: 'seller', type: 'address' },
1138
+ ],
1139
+ },
1140
+ {
1141
+ type: 'event',
1142
+ name: 'CloneGranted',
1143
+ inputs: [
1144
+ { name: 'sourceAgentId', type: 'uint256', indexed: true },
1145
+ { name: 'buyer', type: 'address', indexed: true },
1146
+ { name: 'seller', type: 'address', indexed: false },
1147
+ ],
1148
+ },
1149
+ {
1150
+ type: 'event',
1151
+ name: 'CloneRevoked',
1152
+ inputs: [
1153
+ { name: 'sourceAgentId', type: 'uint256', indexed: true },
1154
+ { name: 'buyer', type: 'address', indexed: true },
1155
+ { name: 'seller', type: 'address', indexed: false },
1156
+ ],
1157
+ },
1158
+ ] as const;
1159
+
1160
+ /**
1161
+ * TappRegistry — trust-root acknowledgement. `ack` acknowledges the set of
1162
+ * TEE components (attestor, kms, sandbox) the deploy/sandbox flow depends on.
1163
+ */
1164
+ export const tappRegistryAbi = [
1165
+ {
1166
+ type: 'function',
1167
+ name: 'acknowledgeApps',
1168
+ stateMutability: 'nonpayable',
1169
+ inputs: [{ name: 'appIds', type: 'string[]' }],
1170
+ outputs: [],
1171
+ },
1172
+ {
1173
+ type: 'function',
1174
+ name: 'isAcknowledged',
1175
+ stateMutability: 'view',
1176
+ inputs: [
1177
+ { name: 'user', type: 'address' },
1178
+ { name: 'appId', type: 'string' },
1179
+ ],
1180
+ outputs: [{ name: '', type: 'bool' }],
1181
+ },
1182
+ {
1183
+ type: 'function',
1184
+ name: 'getAckVersion',
1185
+ stateMutability: 'view',
1186
+ inputs: [{ name: 'appId', type: 'string' }],
1187
+ outputs: [{ name: '', type: 'uint256' }],
1188
+ },
1189
+ {
1190
+ type: 'function',
1191
+ name: 'getAppInfo',
1192
+ stateMutability: 'view',
1193
+ inputs: [{ name: 'appId', type: 'string' }],
1194
+ outputs: [{
1195
+ name: '', type: 'tuple', components: [
1196
+ { name: 'composeHash', type: 'bytes' },
1197
+ { name: 'volumesHash', type: 'bytes' },
1198
+ { name: 'imageHashes', type: 'bytes[]' },
1199
+ { name: 'owner', type: 'address' },
1200
+ { name: 'registeredAt', type: 'uint256' },
1201
+ ],
1202
+ }],
1203
+ },
1204
+ {
1205
+ type: 'function',
1206
+ name: 'getNodeList',
1207
+ stateMutability: 'view',
1208
+ inputs: [{ name: 'appId', type: 'string' }],
1209
+ outputs: [{ name: '', type: 'address[]' }],
1210
+ },
1211
+ ] as const;
1212
+
1213
+ /**
1214
+ * SandboxServing — prepaid sandbox balance. `deposit` funds the caller's (or a
1215
+ * recipient's) balance held against a provider; `getBalance` reads it.
1216
+ */
1217
+ export const sandboxServingAbi = [
1218
+ {
1219
+ type: 'function',
1220
+ name: 'deposit',
1221
+ stateMutability: 'payable',
1222
+ inputs: [
1223
+ { name: 'recipient', type: 'address' },
1224
+ { name: 'provider', type: 'address' },
1225
+ ],
1226
+ outputs: [],
1227
+ },
1228
+ {
1229
+ type: 'function',
1230
+ name: 'requestRefund',
1231
+ stateMutability: 'nonpayable',
1232
+ inputs: [
1233
+ { name: 'provider', type: 'address' },
1234
+ { name: 'amount', type: 'uint256' },
1235
+ ],
1236
+ outputs: [],
1237
+ },
1238
+ {
1239
+ type: 'function',
1240
+ name: 'withdrawRefund',
1241
+ stateMutability: 'nonpayable',
1242
+ inputs: [{ name: 'provider', type: 'address' }],
1243
+ outputs: [],
1244
+ },
1245
+ {
1246
+ type: 'function',
1247
+ name: 'getBalance',
1248
+ stateMutability: 'view',
1249
+ inputs: [
1250
+ { name: 'user', type: 'address' },
1251
+ { name: 'provider', type: 'address' },
1252
+ ],
1253
+ outputs: [
1254
+ { name: 'balance', type: 'uint256' },
1255
+ { name: 'pendingRefund', type: 'uint256' },
1256
+ { name: 'refundUnlockAt', type: 'uint256' },
1257
+ ],
1258
+ },
1259
+ {
1260
+ type: 'function',
1261
+ name: 'services',
1262
+ stateMutability: 'view',
1263
+ inputs: [{ name: 'provider', type: 'address' }],
1264
+ outputs: [
1265
+ { name: 'url', type: 'string' },
1266
+ { name: 'appId', type: 'string' },
1267
+ { name: 'pricePerCPUPerMin', type: 'uint256' },
1268
+ { name: 'pricePerMemGBPerMin', type: 'uint256' },
1269
+ { name: 'createFee', type: 'uint256' },
1270
+ ],
1271
+ },
1272
+ {
1273
+ type: 'function',
1274
+ name: 'isTEEAcknowledged',
1275
+ stateMutability: 'view',
1276
+ inputs: [
1277
+ { name: 'user', type: 'address' },
1278
+ { name: 'provider', type: 'address' },
1279
+ ],
1280
+ outputs: [{ name: '', type: 'bool' }],
1281
+ },
1282
+ ] as const;