@svsprotocol/solana 0.1.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 (38) hide show
  1. package/LICENSE +158 -0
  2. package/README.md +365 -0
  3. package/dist/action-production-proof-evidence.js +553 -0
  4. package/dist/adapter-catalog.d.ts +29 -0
  5. package/dist/adapter-catalog.js +146 -0
  6. package/dist/adapter-core.d.ts +48 -0
  7. package/dist/adapter-core.js +249 -0
  8. package/dist/approval-signature.js +197 -0
  9. package/dist/base58.js +69 -0
  10. package/dist/bot-auth.js +50 -0
  11. package/dist/bot-certification-evidence.js +342 -0
  12. package/dist/bot-first-action-runbook.js +299 -0
  13. package/dist/bot-integration-contract.js +41 -0
  14. package/dist/certified-submit-status.js +176 -0
  15. package/dist/common.d.ts +1135 -0
  16. package/dist/elizaos.d.ts +43 -0
  17. package/dist/elizaos.js +227 -0
  18. package/dist/goat.d.ts +47 -0
  19. package/dist/goat.js +261 -0
  20. package/dist/index.d.ts +330 -0
  21. package/dist/index.js +128 -0
  22. package/dist/protocol.d.ts +205 -0
  23. package/dist/protocol.js +900 -0
  24. package/dist/receipt.js +51 -0
  25. package/dist/signed-proof-read-protection.js +495 -0
  26. package/dist/solana-agent-kit.d.ts +35 -0
  27. package/dist/solana-agent-kit.js +151 -0
  28. package/dist/svs-client.js +1232 -0
  29. package/dist/vercel-ai.d.ts +47 -0
  30. package/dist/vercel-ai.js +266 -0
  31. package/dist/verified-agent-adoption-kit.js +471 -0
  32. package/dist/verified-agent-profile.js +329 -0
  33. package/dist/verified-agent-registry-consumer.js +421 -0
  34. package/dist/verified-agent-registry.d.ts +36 -0
  35. package/dist/verified-agent-registry.js +826 -0
  36. package/dist/verified-agent-trust-score.js +335 -0
  37. package/dist/webhooks.js +834 -0
  38. package/package.json +72 -0
@@ -0,0 +1,1135 @@
1
+ export type JsonPrimitive = string | number | boolean | null;
2
+ export type JsonValue = JsonPrimitive | JsonObject | JsonValue[];
3
+ export interface JsonObject {
4
+ [key: string]: JsonValue;
5
+ }
6
+
7
+ export interface SvsNextAction {
8
+ code: string;
9
+ message: string;
10
+ [key: string]: unknown;
11
+ }
12
+
13
+ export interface SvsCheck {
14
+ name?: string;
15
+ id?: string;
16
+ label?: string;
17
+ ok: boolean;
18
+ detail?: string | null;
19
+ remediation?: string | null;
20
+ [key: string]: unknown;
21
+ }
22
+
23
+ export interface SvsActionIntent {
24
+ [key: string]: JsonValue | undefined;
25
+ botId?: string;
26
+ controllerWallet?: string;
27
+ txType?: string;
28
+ programId?: string;
29
+ summary?: string;
30
+ }
31
+
32
+ export interface SvsCertifiedActionPayload {
33
+ requestId?: string | null;
34
+ idempotencyKey?: string | null;
35
+ intent: SvsActionIntent | JsonObject;
36
+ policyId: string;
37
+ serializedTransaction: string;
38
+ rpcUrl?: string | null;
39
+ simulation?: JsonValue;
40
+ metadata?: JsonValue;
41
+ source?: JsonObject;
42
+ }
43
+
44
+ export interface SvsSubmitActionOptions {
45
+ idempotencyKey?: string | null;
46
+ requestSigningSecret?: string | null;
47
+ requestTimestamp?: string | null;
48
+ requestNonce?: string | null;
49
+ retry?: SvsRequestOptions["retry"];
50
+ }
51
+
52
+ export interface SvsBotReadinessOptions {
53
+ botId?: string | null;
54
+ runSelfTest?: boolean;
55
+ pendingProofMaxAgeMs?: number;
56
+ requireNoExpiredPreviousSigningSecrets?: boolean;
57
+ requestSigningSecret?: string | null;
58
+ requestTimestamp?: string | null;
59
+ requestNonce?: string | null;
60
+ }
61
+
62
+ export interface SvsProductionCertificationOptions {
63
+ botId: string;
64
+ staleAfterMs?: number;
65
+ requireCurrentIntegrationContract?: boolean;
66
+ expectedIntegrationContractHash?: string | null;
67
+ }
68
+
69
+ export interface SvsCertifiedActionSubmitOptions {
70
+ botId?: string | null;
71
+ certificationStaleAfterMs?: number;
72
+ requireCurrentIntegrationContract?: boolean;
73
+ idempotencyKey?: string | null;
74
+ requestSigningSecret?: string | null;
75
+ requestTimestamp?: string | null;
76
+ requestNonce?: string | null;
77
+ }
78
+
79
+ export interface SvsCertifiedActionProofWaitOptions extends SvsCertifiedActionSubmitOptions {
80
+ waitAttempts?: number;
81
+ waitIntervalMs?: number;
82
+ fetchProof?: boolean;
83
+ checkReceiptRegistryChain?: boolean;
84
+ }
85
+
86
+ export interface SvsActionProductionProofOptions {
87
+ checkReceiptRegistryChain?: boolean;
88
+ signRequest?: boolean;
89
+ requestSigningSecret?: string | null;
90
+ requestTimestamp?: string | null;
91
+ }
92
+
93
+ export interface SvsProductionProofWaitOptions {
94
+ attempts?: number;
95
+ intervalMs?: number;
96
+ fetchProof?: boolean;
97
+ checkReceiptRegistryChain?: boolean;
98
+ }
99
+
100
+ export interface SvsClientLike {
101
+ checkBotReadiness(options?: SvsBotReadinessOptions): Promise<SvsBotReadinessResult>;
102
+ requireProductionCertification(options: SvsProductionCertificationOptions): Promise<SvsProductionCertificationCheck>;
103
+ submitCertifiedAction(payload: SvsCertifiedActionPayload, options?: SvsCertifiedActionSubmitOptions): Promise<SvsCertifiedActionSubmission>;
104
+ submitCertifiedActionAndWaitForProof(payload: SvsCertifiedActionPayload, options?: SvsCertifiedActionProofWaitOptions): Promise<SvsCertifiedActionProductionProofWait>;
105
+ }
106
+
107
+ export interface SvsClientOptions {
108
+ baseUrl?: string;
109
+ apiKey?: string | null;
110
+ requestSigningSecret?: string | null;
111
+ expectedIntegrationContractHash?: string | null;
112
+ timestampProvider?: () => string;
113
+ fetchImpl?: typeof fetch;
114
+ retry?: Partial<SvsRetryOptions> | false | null;
115
+ sleep?: (ms: number) => Promise<void>;
116
+ }
117
+
118
+ export interface SvsRetryOptions {
119
+ maxRetries: number;
120
+ baseDelayMs: number;
121
+ maxDelayMs: number;
122
+ retryableStatuses: number[];
123
+ }
124
+
125
+ export interface SvsRequestOptions {
126
+ method?: string;
127
+ body?: unknown;
128
+ headers?: Record<string, string>;
129
+ requestSigningSecret?: string | null;
130
+ requestTimestamp?: string | null;
131
+ signRequest?: boolean;
132
+ retry?: Partial<SvsRetryOptions> | false | null;
133
+ retrySafe?: boolean;
134
+ }
135
+
136
+ export interface SvsSignedBotRequest {
137
+ body: string;
138
+ headers: Record<string, string>;
139
+ }
140
+
141
+ export interface SvsSignedBotRequestOptions {
142
+ body?: unknown;
143
+ requestSigningSecret: string;
144
+ timestamp?: string;
145
+ headers?: Record<string, string>;
146
+ }
147
+
148
+ export interface SvsBotRequestSignatureOptions {
149
+ body?: unknown;
150
+ timestamp: string;
151
+ secret: string;
152
+ }
153
+
154
+ export interface SvsBotRequestSignatureVerificationOptions {
155
+ body?: unknown;
156
+ timestamp?: string | null;
157
+ signature?: string | null;
158
+ secret?: string | null;
159
+ now?: Date;
160
+ maxAgeMs?: number;
161
+ }
162
+
163
+ export interface SvsWebhookSignatureOptions {
164
+ body: unknown;
165
+ webhookSecret: string;
166
+ timestamp: string;
167
+ }
168
+
169
+ export interface SvsWebhookSignatureHeadersOptions {
170
+ body: unknown;
171
+ webhookSecret?: string | null;
172
+ timestamp?: string;
173
+ }
174
+
175
+ export interface SvsWebhookSignatureVerificationOptions {
176
+ body: unknown;
177
+ webhookSecret?: string | null;
178
+ timestamp?: string | null;
179
+ signature?: string | null;
180
+ toleranceMs?: number | null;
181
+ now?: Date;
182
+ }
183
+
184
+ export interface SvsWebhookSignatureVerification {
185
+ ok: boolean;
186
+ reason: "valid" | "missing_signature_fields" | "invalid_timestamp" | "timestamp_outside_tolerance" | "signature_mismatch" | string;
187
+ scheme?: "hmac-sha256" | string;
188
+ signatureVersion?: string;
189
+ [key: string]: unknown;
190
+ }
191
+
192
+ export type SvsWebhookHeaders = Headers | Record<string, string | string[] | null | undefined>;
193
+
194
+ export interface SvsWebhookRequestVerificationOptions {
195
+ body?: unknown;
196
+ headers?: SvsWebhookHeaders;
197
+ webhookSecret?: string | null;
198
+ seenEventIds?: {
199
+ has(eventId: string): boolean;
200
+ add(eventId: string): unknown;
201
+ } | null;
202
+ toleranceMs?: number | null;
203
+ now?: Date;
204
+ }
205
+
206
+ export interface SvsWebhookRequestReplayStoreOptions extends SvsWebhookRequestVerificationOptions {
207
+ replayStorePath?: string;
208
+ replayTtlMs?: number;
209
+ maxReplayEvents?: number;
210
+ }
211
+
212
+ export interface SvsWebhookRequestVerification {
213
+ ok: boolean;
214
+ reason: "valid" | "invalid_json" | "unsupported_event_version" | "event_type_header_mismatch" | "event_id_header_mismatch" | "payload_hash_header_mismatch" | "payload_hash_mismatch" | "replayed_event" | string;
215
+ event: JsonValue | null;
216
+ checks: {
217
+ eventVersion?: string;
218
+ payloadHash?: string;
219
+ expectedPayloadHash?: string;
220
+ signature?: SvsWebhookSignatureVerification;
221
+ [key: string]: unknown;
222
+ };
223
+ replayStore?: {
224
+ path: string;
225
+ eventCount: number;
226
+ [key: string]: unknown;
227
+ };
228
+ [key: string]: unknown;
229
+ }
230
+
231
+ export interface SvsBotIntegrationContract {
232
+ version: "svs.bot-integration-contract.v1" | string;
233
+ generatedAt?: string;
234
+ quickstart?: JsonObject;
235
+ endpoints?: JsonObject;
236
+ capabilities?: JsonValue;
237
+ [key: string]: JsonValue | undefined;
238
+ }
239
+
240
+ export interface SvsBotFirstActionRunbookStep {
241
+ version: "svs.bot-first-action-runbook-step.v1" | string;
242
+ order: number;
243
+ actor: "operator" | "bot" | "auditor" | string;
244
+ title: string;
245
+ command?: string | null;
246
+ dashboardAction?: string | null;
247
+ successSignal: string;
248
+ [key: string]: unknown;
249
+ }
250
+
251
+ export interface SvsBotFirstActionRunbook {
252
+ version: "svs.bot-first-action-runbook.v1" | string;
253
+ generatedAt: string;
254
+ objective: string;
255
+ audience: string[];
256
+ serverUrl: string;
257
+ envPath: string;
258
+ contract: {
259
+ version: string;
260
+ quickstartVersion: string;
261
+ hashAlgorithm: "sha256" | string;
262
+ hash: string | null;
263
+ source: string;
264
+ };
265
+ noSecretGuarantees: string[];
266
+ commandSet: Record<string, string | null>;
267
+ orderedSteps: SvsBotFirstActionRunbookStep[];
268
+ fallbackPath: {
269
+ when: string;
270
+ commands: string[];
271
+ operatorAction: string;
272
+ };
273
+ successDefinition: {
274
+ botSide: string;
275
+ operatorSide: string;
276
+ auditorSide: string;
277
+ };
278
+ nextAction: SvsNextAction;
279
+ runbookHashAlgorithm: "sha256" | string;
280
+ runbookHash: string;
281
+ [key: string]: unknown;
282
+ }
283
+
284
+ export interface SvsClientCompatibilityReport {
285
+ version: "svs.bot-client-compatibility.v1";
286
+ ok: boolean;
287
+ status: "compatible" | "incompatible" | string;
288
+ client?: JsonObject;
289
+ contract?: JsonObject | null;
290
+ missingCapabilities?: string[];
291
+ checks?: SvsCheck[];
292
+ [key: string]: unknown;
293
+ }
294
+
295
+ export interface SvsBotSelfTestResult {
296
+ version: "svs.bot-self-test.v1" | string;
297
+ ok: boolean;
298
+ status: "passed" | "failed" | string;
299
+ botId?: string | null;
300
+ authenticatedBotId?: string | null;
301
+ requestNonce?: string | null;
302
+ requestSignatureVerified?: boolean;
303
+ requestSignatureSlot?: "primary" | "pending" | "previous" | string | null;
304
+ createdAt?: string | null;
305
+ error?: string | null;
306
+ [key: string]: unknown;
307
+ }
308
+
309
+ export interface SvsBotCredentialReadinessOptions {
310
+ pendingProofMaxAgeMs?: number;
311
+ requireSignedRequestProof?: boolean;
312
+ requireNoExpiredPreviousSigningSecrets?: boolean;
313
+ }
314
+
315
+ export interface SvsBotCredentialSignedRequestSummary {
316
+ recordId?: string | null;
317
+ createdAt?: string | null;
318
+ requestId?: string | null;
319
+ idempotencyKey?: string | null;
320
+ requestNonce?: string | null;
321
+ requestTimestamp?: string | null;
322
+ authenticatedBotId?: string | null;
323
+ secretSlot?: "primary" | "pending" | "previous" | string | null;
324
+ productionCertification?: JsonObject | null;
325
+ [key: string]: unknown;
326
+ }
327
+
328
+ export interface SvsBotCredentialCleanupEvidence {
329
+ version?: string;
330
+ status?: "current" | "cleanup_required" | string;
331
+ expiredPreviousSecretCount?: number;
332
+ lastCleanupAction?: JsonObject | null;
333
+ [key: string]: unknown;
334
+ }
335
+
336
+ export interface SvsBotCredentialLifecycleSummary {
337
+ eventCount?: number;
338
+ startRotationCount?: number;
339
+ blockedPromoteCount?: number;
340
+ successfulPromoteCount?: number;
341
+ persistedEvidenceCount?: number;
342
+ latestEventHash?: string | null;
343
+ latestEventAt?: string | null;
344
+ [key: string]: unknown;
345
+ }
346
+
347
+ export interface SvsBotCredentialReadinessBot {
348
+ botId: string;
349
+ name?: string | null;
350
+ status: string;
351
+ ignored: boolean;
352
+ productionReady: boolean;
353
+ readinessStatus: "production_ready" | "not_ready" | "ignored" | string;
354
+ credentialRotationStatus: "missing_secret" | "primary_confirmed" | "ready_to_promote" | "previous_grace_observed" | "expired_pending_secret" | string | null;
355
+ keyFingerprint?: string | null;
356
+ requireRequestSignature: boolean;
357
+ requireFreshRequestTimestamp?: boolean;
358
+ requestSigningSecretSlots: string[];
359
+ lastSuccessfulSignedRequest: SvsBotCredentialSignedRequestSummary | null;
360
+ lastSuccessfulSignedRequestAgeMs: number | null;
361
+ selfTest: JsonObject | null;
362
+ adoption: JsonObject | null;
363
+ pendingRequestSigningSecretConfigured: boolean;
364
+ pendingRequestSigningSecretExpiresAt: string | null;
365
+ pendingRequestSigningSecretExpired: boolean;
366
+ previousRequestSigningSecretConfigured: boolean;
367
+ previousRequestSigningSecretExpiresAt: string | null;
368
+ previousRequestSigningSecretExpired: boolean;
369
+ cleanupRequired: boolean;
370
+ stalePendingProof: boolean;
371
+ checks: SvsCheck[];
372
+ blockingReasons: Array<{
373
+ code: string;
374
+ message: string;
375
+ }>;
376
+ [key: string]: unknown;
377
+ }
378
+
379
+ export interface SvsBotCredentialReadiness {
380
+ version: "svs.bot-credential-readiness.v1";
381
+ generatedAt: string;
382
+ status: "production_ready" | "not_ready" | string;
383
+ productionReady: boolean;
384
+ evidenceHash: string | null;
385
+ readinessHash: string;
386
+ policy: {
387
+ pendingProofMaxAgeMs: number | null;
388
+ requireSignedRequestProof: boolean;
389
+ requireNoExpiredPreviousSigningSecrets: boolean;
390
+ [key: string]: unknown;
391
+ };
392
+ summary: {
393
+ botCount: number;
394
+ activeBotCount: number;
395
+ ignoredBotCount: number;
396
+ productionReadyCount: number;
397
+ notReadyCount: number;
398
+ cleanupRequiredCount: number;
399
+ readyToPromoteCount: number;
400
+ primaryConfirmedCount: number;
401
+ stalePendingProofCount: number;
402
+ selfTestObservedCount: number;
403
+ selfTestPassedCount: number;
404
+ adoptionAverageScore: number;
405
+ adoptionCompleteCount: number;
406
+ adoptionNeedsActionCount: number;
407
+ [key: string]: unknown;
408
+ };
409
+ credentialCleanup: SvsBotCredentialCleanupEvidence;
410
+ credentialLifecycle: SvsBotCredentialLifecycleSummary;
411
+ bots: SvsBotCredentialReadinessBot[];
412
+ [key: string]: unknown;
413
+ }
414
+
415
+ export interface SvsBotCredentialRotationMissingProof {
416
+ code: string;
417
+ message: string;
418
+ nextAction: SvsNextAction;
419
+ operatorSteps: string[];
420
+ [key: string]: unknown;
421
+ }
422
+
423
+ export interface SvsBotCredentialRotationReceipt {
424
+ version: "svs.bot-credential-rotation-receipt.v1";
425
+ generatedAt: string;
426
+ ok: boolean;
427
+ status: "ready_to_promote" | "missing_proof" | "not_ready" | "bot_not_found" | string;
428
+ readyToPromote: boolean;
429
+ botId: string | null;
430
+ authenticatedBot: {
431
+ id: string;
432
+ name: string;
433
+ } | null;
434
+ evidenceHash: string | null;
435
+ pendingProofMaxAgeMs: number | null;
436
+ credentialRotationStatus: string | null;
437
+ pendingRequestSigningSecretConfigured: boolean;
438
+ pendingRequestSigningSecretCreatedAt: string | null;
439
+ pendingRequestSigningSecretExpiresAt: string | null;
440
+ pendingRequestSigningSecretExpired: boolean;
441
+ lastSuccessfulSignedRequest: SvsBotCredentialSignedRequestSummary | null;
442
+ checks: SvsCheck[];
443
+ missingProof: SvsBotCredentialRotationMissingProof[];
444
+ nextAction: SvsNextAction;
445
+ links: {
446
+ rotationDryRun: string | null;
447
+ credentialReadiness: string | null;
448
+ [key: string]: unknown;
449
+ };
450
+ receiptHash: string;
451
+ [key: string]: unknown;
452
+ }
453
+
454
+ export interface SvsBotCredentialRotationReadinessCheck {
455
+ version: "svs.bot-credential-rotation-readiness-check.v1";
456
+ checkedAt: string;
457
+ ok: boolean;
458
+ status: "ready_to_promote" | "missing_proof" | "not_ready" | string;
459
+ botId: string | null;
460
+ readyToPromote: boolean;
461
+ receiptHash: string | null;
462
+ receipt: SvsBotCredentialRotationReceipt;
463
+ missingProof: SvsBotCredentialRotationMissingProof[];
464
+ nextAction: SvsNextAction;
465
+ operatorSteps: string[];
466
+ [key: string]: unknown;
467
+ }
468
+
469
+ export interface SvsBotIntegrationCertificationStatus {
470
+ version: "svs.bot-integration-certification-bot-status.v1";
471
+ ok: boolean;
472
+ status: "ready" | "missing" | "stale" | "drifted" | "not_ready" | string;
473
+ botId: string | null;
474
+ checkedAt: string;
475
+ authenticated?: boolean;
476
+ certification?: JsonObject | null;
477
+ contract?: JsonObject | null;
478
+ proofs?: JsonObject | null;
479
+ quality?: JsonObject | null;
480
+ qualityTarget?: JsonObject | null;
481
+ failedChecks?: SvsCheck[];
482
+ checks?: SvsCheck[];
483
+ nextAction?: SvsNextAction;
484
+ [key: string]: unknown;
485
+ }
486
+
487
+ export type SvsApprovalMessageDomain =
488
+ | "svs-solana-verification-system"
489
+ | "solana-human-verification-system";
490
+
491
+ export type SvsApprovalDomainStatus =
492
+ | "current"
493
+ | "legacy_compatible"
494
+ | "unsupported"
495
+ | "missing";
496
+
497
+ export interface SvsApprovalDomainSummary {
498
+ domain: SvsApprovalMessageDomain | string | null;
499
+ status: SvsApprovalDomainStatus;
500
+ current: boolean;
501
+ legacyCompatible: boolean;
502
+ supported: boolean;
503
+ }
504
+
505
+ export interface SvsApprovalSignatureLike {
506
+ domain?: SvsApprovalMessageDomain | string | null;
507
+ message?: string | null;
508
+ messageHash?: string | null;
509
+ signer?: string | null;
510
+ signature?: string | null;
511
+ version?: string | null;
512
+ scheme?: string | null;
513
+ [key: string]: unknown;
514
+ }
515
+
516
+ export interface SvsActionProductionProofStatus {
517
+ version: "svs.action-production-proof-status.v1";
518
+ ready: boolean;
519
+ status: "ready" | "not_ready" | string;
520
+ recordId: string | null;
521
+ botId: string | null;
522
+ authenticatedBotId?: string | null;
523
+ queueStatus?: string | null;
524
+ txType?: string | null;
525
+ receiptId: string | null;
526
+ receiptRegistry?: {
527
+ confirmationStatus: string | null;
528
+ signature: string | null;
529
+ receiptAccount: string | null;
530
+ [key: string]: unknown;
531
+ };
532
+ actionRecordVerification?: {
533
+ ok: boolean;
534
+ version: string | null;
535
+ receiptAccount: string | null;
536
+ registryTransactionSignature: string | null;
537
+ [key: string]: unknown;
538
+ };
539
+ nextAction: SvsNextAction | null;
540
+ checks: SvsCheck[];
541
+ missing?: string[];
542
+ links?: {
543
+ action: string | null;
544
+ productionProof: string | null;
545
+ productionProofStatus: string | null;
546
+ [key: string]: unknown;
547
+ };
548
+ [key: string]: unknown;
549
+ }
550
+
551
+ export interface SvsActionProductionProofResponse {
552
+ version: "svs.action-production-proof-response.v1";
553
+ ready: true;
554
+ status: "ready";
555
+ recordId: string;
556
+ botId: string | null;
557
+ proof: JsonObject;
558
+ proofHash: string | null;
559
+ export: {
560
+ version: string | null;
561
+ actionRecordVerificationHash: string | null;
562
+ receiptRegistrySubmissionHash: string | null;
563
+ [key: string]: unknown;
564
+ };
565
+ [key: string]: unknown;
566
+ }
567
+
568
+ export interface SvsActionProductionProofWaitResult {
569
+ status: SvsActionProductionProofStatus | null;
570
+ proof: SvsActionProductionProofResponse | null;
571
+ }
572
+
573
+ export interface SvsActionRecordResponse {
574
+ path: string;
575
+ record: JsonObject;
576
+ links: {
577
+ receipt: string;
578
+ approvalMessage: string;
579
+ [key: string]: unknown;
580
+ };
581
+ [key: string]: unknown;
582
+ }
583
+
584
+ export interface SvsReceiptExport {
585
+ version?: string;
586
+ receiptId?: string;
587
+ issuedAt?: string;
588
+ botId?: string;
589
+ controllerWallet?: string;
590
+ policyId?: string;
591
+ policyHash?: string;
592
+ authorizationType?: string;
593
+ allowed?: boolean;
594
+ riskScore?: number;
595
+ riskFindings?: JsonValue;
596
+ simulationHash?: string;
597
+ intentHash?: string;
598
+ transactionSignature?: string | null;
599
+ receiptHash?: string;
600
+ [key: string]: JsonValue | undefined;
601
+ }
602
+
603
+ export interface SvsReceiptVerificationResult {
604
+ version?: string;
605
+ ok: boolean;
606
+ status?: string;
607
+ receiptHash?: string | null;
608
+ computedReceiptHash?: string | null;
609
+ failedCheckCount?: number;
610
+ failedChecks?: SvsCheck[];
611
+ checks?: SvsCheck[];
612
+ [key: string]: unknown;
613
+ }
614
+
615
+ export interface SvsActionProductionProofEvidence {
616
+ version: "svs.action-production-proof-evidence.v1";
617
+ generatedAt: string;
618
+ source: {
619
+ recordPath: string | null;
620
+ statusVersion: string | null;
621
+ };
622
+ productionProof: {
623
+ ready: boolean;
624
+ status: string | null;
625
+ recordId: string | null;
626
+ botId: string | null;
627
+ receiptId: string | null;
628
+ nextAction: SvsNextAction | null;
629
+ checks: SvsCheck[];
630
+ };
631
+ request: {
632
+ authenticatedBotId: string | null;
633
+ requestSignatureVerified: boolean;
634
+ requestSignatureSlot: "primary" | "pending" | "previous" | string | null;
635
+ requestSignatureVersion: string | null;
636
+ requestNonce: string | null;
637
+ requestId: string | null;
638
+ idempotencyKey: string | null;
639
+ requestTimestamp: string | null;
640
+ };
641
+ humanApproval: {
642
+ approved: boolean;
643
+ reviewer: string | null;
644
+ signer: string | null;
645
+ verified: boolean;
646
+ messageHash: string | null;
647
+ domain: SvsApprovalMessageDomain | string | null;
648
+ domainStatus: SvsApprovalDomainStatus;
649
+ currentDomain: boolean;
650
+ legacyDomainCompatible: boolean;
651
+ };
652
+ broadcast: {
653
+ confirmed: boolean;
654
+ signature: string | null;
655
+ confirmationStatus: "confirmed" | "finalized" | string | null;
656
+ slot: number | null;
657
+ rpcUrl: string | null;
658
+ };
659
+ receiptRegistry: {
660
+ confirmed: boolean;
661
+ signature: string | null;
662
+ confirmationStatus: "confirmed" | "finalized" | string | null;
663
+ slot: number | null;
664
+ programId: string | null;
665
+ receiptAccount: string | null;
666
+ planHash: string | null;
667
+ transactionPlanHash: string | null;
668
+ };
669
+ actionRecordVerification: {
670
+ ok: boolean;
671
+ version: string | null;
672
+ checkedAt: string | null;
673
+ receiptId: string | null;
674
+ receiptAccount: string | null;
675
+ registryTransactionSignature: string | null;
676
+ failedCheckCount: number | null;
677
+ };
678
+ productionProofWebhook?: JsonObject;
679
+ policy: {
680
+ controllerWallet: string | null;
681
+ policyHash: string | null;
682
+ intentHash: string | null;
683
+ simulationHash: string | null;
684
+ };
685
+ reportSafety: {
686
+ secretsIncluded: boolean;
687
+ redactedFields: string[];
688
+ };
689
+ evidenceHash: string;
690
+ }
691
+
692
+ export interface SvsActionProductionProofEvidenceVerification {
693
+ version: "svs.action-production-proof-evidence-verification.v1";
694
+ ok: boolean;
695
+ status: "verified" | "stale" | "failed" | string;
696
+ checkedAt: string;
697
+ found: boolean;
698
+ generatedAt: string | null;
699
+ stale: boolean;
700
+ ageMs: number | null;
701
+ staleAfterMs: number | null;
702
+ evidenceHash: string | null;
703
+ computedEvidenceHash: string | null;
704
+ recordId: string | null;
705
+ failedCheckCount: number;
706
+ failedChecks: SvsCheck[];
707
+ checks: SvsCheck[];
708
+ [key: string]: unknown;
709
+ }
710
+
711
+ export interface SvsCurrentApprovalDomainRequirementResult {
712
+ version: "svs.current-approval-domain-requirement.v1";
713
+ ok: true;
714
+ status: "current";
715
+ domain: "svs-solana-verification-system";
716
+ expectedDomain: "svs-solana-verification-system";
717
+ action: string | null;
718
+ nextAction: SvsNextAction;
719
+ }
720
+
721
+ export interface SvsBotReadinessResult {
722
+ version: "svs.bot-readiness-check.v1";
723
+ checkedAt: string;
724
+ ok: boolean;
725
+ status: "ready" | "not_ready" | string;
726
+ botId: string | null;
727
+ selfTest: JsonObject | null;
728
+ readiness: {
729
+ version: string | null;
730
+ productionReady: boolean;
731
+ activeBotCount: number | null;
732
+ adoptionAverageScore: number | null;
733
+ adoptionNeedsActionCount: number | null;
734
+ };
735
+ bot: JsonObject | null;
736
+ adoption: JsonObject | null;
737
+ nextAction: SvsNextAction;
738
+ }
739
+
740
+ export interface SvsProductionCertificationCheck {
741
+ version: "svs.bot-production-certification-check.v1";
742
+ checkedAt: string;
743
+ ok: boolean;
744
+ status: "ready" | "not_ready" | string;
745
+ botId: string | null;
746
+ certification: JsonObject;
747
+ integrationContract: SvsProductionCertificationContractBinding;
748
+ quality?: JsonValue;
749
+ qualityTarget?: JsonValue;
750
+ nextAction: SvsNextAction;
751
+ }
752
+
753
+ export interface SvsProductionCertificationContractBinding {
754
+ version: "svs.production-certification-contract-binding.v1";
755
+ required: boolean;
756
+ ok: boolean;
757
+ status: "current" | "not_required" | "client_contract_mismatch" | "drifted" | "mismatch" | "unavailable" | string;
758
+ localContractHash: string | null;
759
+ dashboardContractHash?: string | null;
760
+ certifiedContractHash: string | null;
761
+ currentContractHash: string | null;
762
+ drifted: boolean;
763
+ contractVersion?: string | null;
764
+ error?: string;
765
+ nextActionMessage: string;
766
+ }
767
+
768
+ export interface SvsCertifiedSubmitOperatorStatus {
769
+ version: "svs.certified-submit-operator-status.v1";
770
+ ok: boolean;
771
+ status: "ready" | "production_ready" | "missing" | "failed" | string;
772
+ serverUrl: string | null;
773
+ staleAfterMs: number | null;
774
+ endpoints: {
775
+ status: string;
776
+ evidence: string;
777
+ [key: string]: unknown;
778
+ };
779
+ production: JsonObject | null;
780
+ candidate: JsonObject | null;
781
+ nextAction: SvsNextAction;
782
+ [key: string]: unknown;
783
+ }
784
+
785
+ export interface SvsCertifiedActionSubmission {
786
+ version: "svs.certified-action-submission.v1";
787
+ ok: boolean;
788
+ status: "submitted" | string;
789
+ botId: string | null;
790
+ certification: SvsProductionCertificationCheck;
791
+ submitted: JsonObject;
792
+ }
793
+
794
+ export interface SvsCertifiedActionProductionProofWait {
795
+ version: "svs.certified-action-production-proof-wait.v1";
796
+ ok: boolean;
797
+ status: "production_proof_ready" | "production_proof_not_ready" | "submitted_record_missing" | string;
798
+ botId: string | null;
799
+ recordId: string | null;
800
+ submission: SvsCertifiedActionSubmission;
801
+ productionProof: JsonObject | null;
802
+ nextAction: SvsNextAction;
803
+ }
804
+
805
+ export interface SvsAdapterReadinessResult {
806
+ version: string;
807
+ ok: true;
808
+ status: "ready";
809
+ botId: string;
810
+ readiness: SvsBotReadinessResult;
811
+ certification: SvsProductionCertificationCheck;
812
+ nextAction: SvsNextAction;
813
+ }
814
+
815
+ export interface SvsAdapterActionResult {
816
+ version: string;
817
+ ok: boolean;
818
+ status: string;
819
+ botId: string;
820
+ requestId: string | null;
821
+ idempotencyKey: string | null;
822
+ policyId: string;
823
+ adapter: string;
824
+ readiness: SvsAdapterReadinessResult | null;
825
+ result: SvsCertifiedActionSubmission | SvsCertifiedActionProductionProofWait | JsonObject;
826
+ recordId: string | null;
827
+ productionProofReady: boolean;
828
+ nextAction: SvsNextAction;
829
+ }
830
+
831
+ export interface SvsAdapterOptions {
832
+ client?: SvsClientLike | unknown;
833
+ baseUrl?: string;
834
+ apiKey?: string;
835
+ requestSigningSecret?: string;
836
+ expectedIntegrationContractHash?: string;
837
+ botId: string;
838
+ policyId?: string | null;
839
+ rpcUrl?: string | null;
840
+ certificationStaleAfterMs?: number;
841
+ requireCurrentIntegrationContract?: boolean;
842
+ waitForProof?: boolean;
843
+ waitAttempts?: number;
844
+ waitIntervalMs?: number;
845
+ fetchProof?: boolean;
846
+ checkReceiptRegistryChain?: boolean;
847
+ requireReadinessOnSubmit?: boolean;
848
+ }
849
+
850
+ export interface SvsAdapterActionInput extends Partial<SvsCertifiedActionPayload> {
851
+ intent: SvsActionIntent | JsonObject;
852
+ serializedTransaction: string;
853
+ waitForProof?: boolean;
854
+ waitAttempts?: number;
855
+ waitIntervalMs?: number;
856
+ fetchProof?: boolean;
857
+ checkReceiptRegistryChain?: boolean;
858
+ requireReadinessOnSubmit?: boolean;
859
+ }
860
+
861
+ export interface SvsVerifiedAgentProfile {
862
+ version: "svs.verified-agent-profile.v1";
863
+ generatedAt: string;
864
+ agent: {
865
+ botId: string;
866
+ name: string | null;
867
+ url: string | null;
868
+ profileUrl: string | null;
869
+ badgeUrl: string | null;
870
+ };
871
+ status: {
872
+ ok: boolean;
873
+ value: "verified" | "stale" | "not_verified" | string;
874
+ label: string;
875
+ nextAction: SvsNextAction | null;
876
+ };
877
+ certification: JsonObject;
878
+ qualityTarget: JsonObject | null;
879
+ proofs: JsonObject;
880
+ display: JsonObject;
881
+ reportSafety: JsonObject;
882
+ profileHash: string;
883
+ }
884
+
885
+ export interface SvsVerifiedAgentProfileOptions {
886
+ certificationEvidence: JsonObject;
887
+ agentName?: string | null;
888
+ agentUrl?: string | null;
889
+ profileUrl?: string | null;
890
+ badgeUrl?: string | null;
891
+ generatedAt?: string | Date;
892
+ staleAfterMs?: number | null;
893
+ now?: Date | string;
894
+ }
895
+
896
+ export interface SvsVerifiedAgentProfileVerificationOptions {
897
+ expectedBotId?: string | null;
898
+ requireVerified?: boolean;
899
+ staleAfterMs?: number | null;
900
+ now?: Date | string;
901
+ }
902
+
903
+ export interface SvsVerifiedAgentProfileVerification {
904
+ version: "svs.verified-agent-profile-verification.v1";
905
+ ok: boolean;
906
+ status: "verified" | "stale" | "failed" | string;
907
+ checkedAt: string;
908
+ botId: string | null;
909
+ profileHash: string | null;
910
+ computedProfileHash: string | null;
911
+ failedCheckCount: number;
912
+ failedChecks: SvsCheck[];
913
+ checks: SvsCheck[];
914
+ [key: string]: unknown;
915
+ }
916
+
917
+ export interface SvsVerifiedAgentTrustScoreSignal {
918
+ id: string;
919
+ label: string;
920
+ weight: number;
921
+ earned: number;
922
+ required: boolean;
923
+ ok: boolean;
924
+ detail: string;
925
+ evidence: JsonObject;
926
+ }
927
+
928
+ export interface SvsVerifiedAgentTrustScoreSignalDefinition {
929
+ id: string;
930
+ label: string;
931
+ weight: number;
932
+ required: boolean;
933
+ }
934
+
935
+ export interface SvsVerifiedAgentTrustScorePolicy {
936
+ version: "svs.verified-agent-trust-score-policy.v1";
937
+ scoreVersion: "svs.verified-agent-trust-score.v1";
938
+ maxScore: 100;
939
+ highTrustMinimumScore: number;
940
+ highTrustRequiresEvidenceComplete: boolean;
941
+ requiredSignalIds: string[];
942
+ optionalSignalIds: string[];
943
+ signals: SvsVerifiedAgentTrustScoreSignalDefinition[];
944
+ }
945
+
946
+ export interface SvsVerifiedAgentTrustScoreOptions {
947
+ profile?: SvsVerifiedAgentProfile | JsonObject | null;
948
+ profileVerification?: SvsVerifiedAgentProfileVerification | JsonObject | null;
949
+ registryVerification?: SvsVerifiedAgentRegistryVerification | JsonObject | null;
950
+ actionProductionProofEvidence?: SvsActionProductionProofEvidence | JsonObject | null;
951
+ actionProductionProofVerification?: SvsActionProductionProofEvidenceVerification | JsonObject | null;
952
+ credentialReadiness?: SvsBotCredentialReadiness | JsonObject | null;
953
+ hostValidation?: JsonObject | null;
954
+ generatedAt?: Date | string;
955
+ }
956
+
957
+ export interface SvsVerifiedAgentTrustScore {
958
+ version: "svs.verified-agent-trust-score.v1";
959
+ generatedAt: string;
960
+ status: "high_trust" | "needs_review" | "low_trust" | string;
961
+ score: number;
962
+ maxScore: 100;
963
+ evidenceComplete: boolean;
964
+ botId: string | null;
965
+ recordId: string | null;
966
+ profileHash: string | null;
967
+ registryHash: string | null;
968
+ signalCount: number;
969
+ passedSignalCount: number;
970
+ failedSignalCount: number;
971
+ blockingSignalCount: number;
972
+ signals: SvsVerifiedAgentTrustScoreSignal[];
973
+ nextAction: SvsNextAction;
974
+ trustScoreHash: string;
975
+ computedTrustScoreHash?: string | null;
976
+ }
977
+
978
+ export interface SvsVerifiedAgentRegistryAgent {
979
+ botId: string;
980
+ name: string;
981
+ status: string;
982
+ profileHash: string;
983
+ certificationHash: string | null;
984
+ recordId: string | null;
985
+ profilePath: string;
986
+ badgePath: string;
987
+ pagePath: string;
988
+ proofs?: JsonObject;
989
+ trustScore?: SvsVerifiedAgentTrustScore | JsonObject | null;
990
+ qualityTarget?: JsonObject | null;
991
+ verification?: JsonObject;
992
+ }
993
+
994
+ export interface SvsVerifiedAgentRegistry {
995
+ version: "svs.verified-agent-registry.v1";
996
+ generatedAt: string;
997
+ title: string;
998
+ profileCount: number;
999
+ agents: SvsVerifiedAgentRegistryAgent[];
1000
+ registryHash: string;
1001
+ }
1002
+
1003
+ export interface SvsVerifiedAgentRegistryTrustManifest {
1004
+ version: "svs.verified-agent-registry-trust-manifest.v1";
1005
+ title: string;
1006
+ generatedAt: string;
1007
+ registry: {
1008
+ version: string | null;
1009
+ title: string;
1010
+ profileCount: number | null;
1011
+ registryHash: string | null;
1012
+ registryPath: string;
1013
+ indexPath: string;
1014
+ };
1015
+ hostedPaths: {
1016
+ registryJson: string;
1017
+ trustManifestJson: string;
1018
+ registryIndex: string;
1019
+ };
1020
+ verifierInstructions: {
1021
+ cli: string;
1022
+ localCli: string;
1023
+ sdkImport: string;
1024
+ sdkCall: string;
1025
+ requiredChecks: string[];
1026
+ };
1027
+ trustScorePolicy?: SvsVerifiedAgentTrustScorePolicy | JsonObject | null;
1028
+ trustStates: JsonObject;
1029
+ agents: JsonObject[];
1030
+ reportSafety: JsonObject;
1031
+ trustManifestHash: string;
1032
+ }
1033
+
1034
+ export interface SvsVerifiedAgentRegistryVerification {
1035
+ version: "svs.verified-agent-registry-verification.v1" | "svs.verified-agent-registry-consumer-verification.v1";
1036
+ ok: boolean;
1037
+ status: "verified" | "failed" | "stale" | string;
1038
+ registryHash?: string | null;
1039
+ computedRegistryHash?: string | null;
1040
+ expectedRegistryHash?: string | null;
1041
+ profileCount?: number;
1042
+ verifiedAgentCount?: number;
1043
+ failedCheckCount: number;
1044
+ failedChecks: SvsCheck[];
1045
+ checks: SvsCheck[];
1046
+ agents?: JsonObject[];
1047
+ trustManifest?: JsonObject;
1048
+ [key: string]: unknown;
1049
+ }
1050
+
1051
+ export interface SvsVerifiedAgentRegistryBuildOptions {
1052
+ profiles: Array<JsonObject | SvsVerifiedAgentProfile | string>;
1053
+ outputDir?: string;
1054
+ title?: string;
1055
+ generatedAt?: Date | string;
1056
+ staleAfterMs?: number | null;
1057
+ requireVerified?: boolean;
1058
+ now?: Date | string;
1059
+ }
1060
+
1061
+ export interface SvsVerifiedAgentRegistryVerificationOptions {
1062
+ registry?: SvsVerifiedAgentRegistry | null;
1063
+ registryPath?: string | null;
1064
+ baseDir?: string | null;
1065
+ requireVerified?: boolean;
1066
+ staleAfterMs?: number | null;
1067
+ now?: Date | string;
1068
+ }
1069
+
1070
+ export interface SvsVerifiedAgentRegistryUrlVerificationOptions extends SvsVerifiedAgentRegistryVerificationOptions {
1071
+ registryUrl?: string;
1072
+ trustManifestUrl?: string | null;
1073
+ expectedRegistryHash?: string | null;
1074
+ fetchImpl?: typeof fetch;
1075
+ }
1076
+
1077
+ export interface SvsVerifiedAgentAdoptionKitOptions {
1078
+ profile: SvsVerifiedAgentProfile;
1079
+ registry: SvsVerifiedAgentRegistry;
1080
+ registryUrl?: string | null;
1081
+ expectedRegistryHash?: string | null;
1082
+ trustManifestUrl?: string | null;
1083
+ registryIndexUrl?: string | null;
1084
+ profileUrl?: string | null;
1085
+ badgeUrl?: string | null;
1086
+ previewReadiness?: JsonObject | null;
1087
+ consumerEvidence?: JsonObject | null;
1088
+ protocolId?: string;
1089
+ generatedAt?: Date | string;
1090
+ }
1091
+
1092
+ export interface SvsVerifiedAgentAdoptionKit {
1093
+ version: "svs.verified-agent-adoption-kit.v1";
1094
+ ok: boolean;
1095
+ status: "ready" | "failed" | string;
1096
+ generatedAt: string;
1097
+ bot: JsonObject;
1098
+ registry: JsonObject;
1099
+ urls: JsonObject;
1100
+ copy: {
1101
+ protocolEnv: string;
1102
+ sdkSnippet: string;
1103
+ verificationCommands: JsonObject;
1104
+ adoptionChecklist: string[];
1105
+ };
1106
+ proofs: JsonObject;
1107
+ reportSafety: JsonObject;
1108
+ checkCount: number;
1109
+ passedCheckCount: number;
1110
+ failedCheckCount: number;
1111
+ checks: SvsCheck[];
1112
+ failedChecks: SvsCheck[];
1113
+ nextAction: SvsNextAction;
1114
+ adoptionKitHash: string;
1115
+ }
1116
+
1117
+ export interface SvsVerifiedAgentAdoptionKitPersistOptions extends SvsVerifiedAgentAdoptionKitOptions {
1118
+ outputDir?: string;
1119
+ }
1120
+
1121
+ export interface SvsProtocolVerifiedAgentResult {
1122
+ version: "svs.verified-agent-requirement.v1";
1123
+ ok: true;
1124
+ status: "verified";
1125
+ minCertification: string;
1126
+ botId: string;
1127
+ agentWallet: string | null;
1128
+ action: string | null;
1129
+ certificationHash: string | null;
1130
+ recordId: string | null;
1131
+ qualityTarget: JsonValue;
1132
+ integrationContract: JsonValue;
1133
+ proofs: JsonValue;
1134
+ nextAction: SvsNextAction;
1135
+ }