@brainai/satp-client 2.0.6 → 2.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +63 -35
- package/idls/v3/attestations_v3.json +439 -0
- package/idls/v3/escrow_v3.json +972 -0
- package/idls/v3/identity_v3.json +1344 -0
- package/idls/v3/reputation_v3.json +140 -0
- package/idls/v3/reviews_v3.json +300 -0
- package/idls/v3/validation_v3.json +146 -0
- package/package.json +12 -4
- package/src/attestation-request.js +176 -0
- package/src/index.d.ts +221 -0
- package/src/index.js +12 -1
- package/src/runtime-authorization-evidence.js +350 -0
- package/src/runtime-policy-adapter.js +335 -5
- package/examples/adoption-quickstarts.js +0 -173
- package/examples/integration-patterns.js +0 -495
- package/examples/runtime-policy-adapter.js +0 -107
- package/examples/x402-discovery-evidence-lookup.js +0 -66
- package/examples/x402-reputation-evidence-lookup-client.js +0 -182
|
@@ -0,0 +1,439 @@
|
|
|
1
|
+
{
|
|
2
|
+
"address": "",
|
|
3
|
+
"metadata": {
|
|
4
|
+
"name": "attestations_v3",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"spec": "0.1.0",
|
|
7
|
+
"description": "SATP Attestations V3 — agent_id-based attestations with CPI from Reviews"
|
|
8
|
+
},
|
|
9
|
+
"instructions": [
|
|
10
|
+
{
|
|
11
|
+
"name": "create_attestation",
|
|
12
|
+
"docs": [
|
|
13
|
+
"Create an attestation for an agent (identified by agent_id).",
|
|
14
|
+
"PDA: `[b\"attestation_v3\", SHA256(agent_id), issuer, attestation_type]`"
|
|
15
|
+
],
|
|
16
|
+
"discriminator": [
|
|
17
|
+
49,
|
|
18
|
+
24,
|
|
19
|
+
67,
|
|
20
|
+
80,
|
|
21
|
+
12,
|
|
22
|
+
249,
|
|
23
|
+
96,
|
|
24
|
+
239
|
|
25
|
+
],
|
|
26
|
+
"accounts": [
|
|
27
|
+
{
|
|
28
|
+
"name": "attestation",
|
|
29
|
+
"writable": true
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "issuer",
|
|
33
|
+
"writable": true,
|
|
34
|
+
"signer": true
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"name": "system_program"
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"args": [
|
|
41
|
+
{
|
|
42
|
+
"name": "agent_id",
|
|
43
|
+
"type": "string"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "attestation_type",
|
|
47
|
+
"type": "string"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "proof_data",
|
|
51
|
+
"type": "string"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "expires_at",
|
|
55
|
+
"type": {
|
|
56
|
+
"option": "i64"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"name": "create_verified_attestation",
|
|
63
|
+
"docs": [
|
|
64
|
+
"Create an attestation that is pre-verified (issuer self-verifies at creation).",
|
|
65
|
+
"Same as create_attestation but sets verified = true.",
|
|
66
|
+
"Use when the issuer IS the verification authority (e.g., platform backend)."
|
|
67
|
+
],
|
|
68
|
+
"discriminator": [
|
|
69
|
+
86,
|
|
70
|
+
95,
|
|
71
|
+
88,
|
|
72
|
+
56,
|
|
73
|
+
42,
|
|
74
|
+
225,
|
|
75
|
+
35,
|
|
76
|
+
29
|
|
77
|
+
],
|
|
78
|
+
"accounts": [
|
|
79
|
+
{
|
|
80
|
+
"name": "attestation",
|
|
81
|
+
"writable": true
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"name": "issuer",
|
|
85
|
+
"writable": true,
|
|
86
|
+
"signer": true
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"name": "system_program"
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
"args": [
|
|
93
|
+
{
|
|
94
|
+
"name": "agent_id",
|
|
95
|
+
"type": "string"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"name": "attestation_type",
|
|
99
|
+
"type": "string"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"name": "proof_data",
|
|
103
|
+
"type": "string"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"name": "expires_at",
|
|
107
|
+
"type": {
|
|
108
|
+
"option": "i64"
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"name": "verify_attestation",
|
|
115
|
+
"docs": [
|
|
116
|
+
"Verify an attestation (issuer only)."
|
|
117
|
+
],
|
|
118
|
+
"discriminator": [
|
|
119
|
+
144,
|
|
120
|
+
30,
|
|
121
|
+
116,
|
|
122
|
+
186,
|
|
123
|
+
33,
|
|
124
|
+
176,
|
|
125
|
+
35,
|
|
126
|
+
60
|
|
127
|
+
],
|
|
128
|
+
"accounts": [
|
|
129
|
+
{
|
|
130
|
+
"name": "attestation",
|
|
131
|
+
"writable": true
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"name": "issuer",
|
|
135
|
+
"signer": true
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
"args": []
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"name": "revoke_attestation",
|
|
142
|
+
"docs": [
|
|
143
|
+
"Revoke an attestation (issuer only)."
|
|
144
|
+
],
|
|
145
|
+
"discriminator": [
|
|
146
|
+
12,
|
|
147
|
+
156,
|
|
148
|
+
103,
|
|
149
|
+
161,
|
|
150
|
+
194,
|
|
151
|
+
246,
|
|
152
|
+
211,
|
|
153
|
+
179
|
|
154
|
+
],
|
|
155
|
+
"accounts": [
|
|
156
|
+
{
|
|
157
|
+
"name": "attestation",
|
|
158
|
+
"writable": true
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"name": "issuer",
|
|
162
|
+
"signer": true
|
|
163
|
+
}
|
|
164
|
+
],
|
|
165
|
+
"args": []
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"name": "create_review_attestation",
|
|
169
|
+
"docs": [
|
|
170
|
+
"CPI-only: Called by Reviews V3 to auto-create a review attestation.",
|
|
171
|
+
"Auto-verified (programmatic attestation)."
|
|
172
|
+
],
|
|
173
|
+
"discriminator": [
|
|
174
|
+
10,
|
|
175
|
+
168,
|
|
176
|
+
98,
|
|
177
|
+
89,
|
|
178
|
+
138,
|
|
179
|
+
54,
|
|
180
|
+
148,
|
|
181
|
+
202
|
|
182
|
+
],
|
|
183
|
+
"accounts": [
|
|
184
|
+
{
|
|
185
|
+
"name": "attestation",
|
|
186
|
+
"writable": true
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"name": "reviews_authority",
|
|
190
|
+
"docs": [
|
|
191
|
+
"Reviews program PDA authority — must sign via CPI"
|
|
192
|
+
],
|
|
193
|
+
"signer": true
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"name": "payer",
|
|
197
|
+
"writable": true,
|
|
198
|
+
"signer": true
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"name": "system_program"
|
|
202
|
+
}
|
|
203
|
+
],
|
|
204
|
+
"args": [
|
|
205
|
+
{
|
|
206
|
+
"name": "agent_id",
|
|
207
|
+
"type": "string"
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"name": "reviewer",
|
|
211
|
+
"type": "pubkey"
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"name": "rating",
|
|
215
|
+
"type": "u8"
|
|
216
|
+
}
|
|
217
|
+
]
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"name": "recompute_score",
|
|
221
|
+
"docs": [
|
|
222
|
+
"Recompute attestation-based score and verification level for an agent.",
|
|
223
|
+
"Reads all attestations for the agent (via remaining_accounts), computes:",
|
|
224
|
+
"- Score = sum of platform weights for verified, non-revoked, non-expired attestations",
|
|
225
|
+
"- Level = threshold-based on score (L1≥identity, L2≥50, L3≥100, L4≥150, L5≥200)",
|
|
226
|
+
"Then CPIs to identity_v3::update_score_and_level to persist on the genesis PDA.",
|
|
227
|
+
"Permissionless — anyone can trigger a recompute (read-only on attestations)."
|
|
228
|
+
],
|
|
229
|
+
"discriminator": [
|
|
230
|
+
205,
|
|
231
|
+
1,
|
|
232
|
+
251,
|
|
233
|
+
248,
|
|
234
|
+
240,
|
|
235
|
+
27,
|
|
236
|
+
66,
|
|
237
|
+
214
|
|
238
|
+
],
|
|
239
|
+
"accounts": [
|
|
240
|
+
{
|
|
241
|
+
"name": "genesis",
|
|
242
|
+
"docs": [
|
|
243
|
+
"The agent's genesis record — will be updated via CPI"
|
|
244
|
+
],
|
|
245
|
+
"writable": true
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"name": "attestations_authority",
|
|
249
|
+
"docs": [
|
|
250
|
+
"Attestations program PDA authority for CPI signing"
|
|
251
|
+
]
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"name": "identity_program",
|
|
255
|
+
"docs": [
|
|
256
|
+
"Identity program for CPI"
|
|
257
|
+
]
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"name": "caller",
|
|
261
|
+
"docs": [
|
|
262
|
+
"Permissionless caller — anyone can trigger recompute"
|
|
263
|
+
],
|
|
264
|
+
"signer": true
|
|
265
|
+
}
|
|
266
|
+
],
|
|
267
|
+
"args": []
|
|
268
|
+
}
|
|
269
|
+
],
|
|
270
|
+
"accounts": [
|
|
271
|
+
{
|
|
272
|
+
"name": "attestations_v3::Attestation",
|
|
273
|
+
"discriminator": [
|
|
274
|
+
152,
|
|
275
|
+
125,
|
|
276
|
+
183,
|
|
277
|
+
86,
|
|
278
|
+
36,
|
|
279
|
+
146,
|
|
280
|
+
121,
|
|
281
|
+
73
|
|
282
|
+
]
|
|
283
|
+
}
|
|
284
|
+
],
|
|
285
|
+
"types": [
|
|
286
|
+
{
|
|
287
|
+
"name": "attestations_v3::Attestation",
|
|
288
|
+
"type": {
|
|
289
|
+
"kind": "struct",
|
|
290
|
+
"fields": [
|
|
291
|
+
{
|
|
292
|
+
"name": "agent_id",
|
|
293
|
+
"type": "string"
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
"name": "agent_id_hash",
|
|
297
|
+
"type": {
|
|
298
|
+
"array": [
|
|
299
|
+
"u8",
|
|
300
|
+
32
|
|
301
|
+
]
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
"name": "attestation_type",
|
|
306
|
+
"type": "string"
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
"name": "issuer",
|
|
310
|
+
"type": "pubkey"
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
"name": "proof_data",
|
|
314
|
+
"type": "string"
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
"name": "verified",
|
|
318
|
+
"type": "bool"
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
"name": "created_at",
|
|
322
|
+
"type": "i64"
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
"name": "expires_at",
|
|
326
|
+
"type": {
|
|
327
|
+
"option": "i64"
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
"name": "is_revoked",
|
|
332
|
+
"type": "bool"
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
"name": "bump",
|
|
336
|
+
"type": "u8"
|
|
337
|
+
}
|
|
338
|
+
]
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
"name": "attestations_v3::identity_v3::accounts::GenesisRecord",
|
|
343
|
+
"type": {
|
|
344
|
+
"kind": "struct",
|
|
345
|
+
"fields": [
|
|
346
|
+
{
|
|
347
|
+
"name": "agent_id_hash",
|
|
348
|
+
"type": {
|
|
349
|
+
"array": [
|
|
350
|
+
"u8",
|
|
351
|
+
32
|
|
352
|
+
]
|
|
353
|
+
}
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
"name": "agent_name",
|
|
357
|
+
"type": "string"
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
"name": "description",
|
|
361
|
+
"type": "string"
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
"name": "category",
|
|
365
|
+
"type": "string"
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
"name": "capabilities",
|
|
369
|
+
"type": {
|
|
370
|
+
"vec": "string"
|
|
371
|
+
}
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
"name": "metadata_uri",
|
|
375
|
+
"type": "string"
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
"name": "face_image",
|
|
379
|
+
"type": "string"
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
"name": "face_mint",
|
|
383
|
+
"type": "pubkey"
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
"name": "face_burn_tx",
|
|
387
|
+
"type": "string"
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
"name": "genesis_record",
|
|
391
|
+
"type": "i64"
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
"name": "is_active",
|
|
395
|
+
"type": "bool"
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
"name": "authority",
|
|
399
|
+
"type": "pubkey"
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
"name": "pending_authority",
|
|
403
|
+
"type": {
|
|
404
|
+
"option": "pubkey"
|
|
405
|
+
}
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
"name": "reputation_score",
|
|
409
|
+
"type": "u64"
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
"name": "verification_level",
|
|
413
|
+
"type": "u8"
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
"name": "reputation_updated_at",
|
|
417
|
+
"type": "i64"
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
"name": "verification_updated_at",
|
|
421
|
+
"type": "i64"
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
"name": "created_at",
|
|
425
|
+
"type": "i64"
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
"name": "updated_at",
|
|
429
|
+
"type": "i64"
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
"name": "bump",
|
|
433
|
+
"type": "u8"
|
|
434
|
+
}
|
|
435
|
+
]
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
]
|
|
439
|
+
}
|