@sanctuary-framework/mcp-server 0.2.0 → 0.3.1
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/README.md +54 -7
- package/dist/cli.cjs +3761 -171
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +3764 -174
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +3735 -169
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +965 -189
- package/dist/index.d.ts +965 -189
- package/dist/index.js +3721 -173
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.d.cts
CHANGED
|
@@ -37,6 +37,29 @@ interface SanctuaryConfig {
|
|
|
37
37
|
};
|
|
38
38
|
transport: "stdio" | "http";
|
|
39
39
|
http_port: number;
|
|
40
|
+
dashboard: {
|
|
41
|
+
enabled: boolean;
|
|
42
|
+
port: number;
|
|
43
|
+
host: string;
|
|
44
|
+
/** Bearer token for dashboard auth. If "auto", one is generated at startup. */
|
|
45
|
+
auth_token?: string;
|
|
46
|
+
/** TLS cert/key paths for HTTPS dashboard. */
|
|
47
|
+
tls?: {
|
|
48
|
+
cert_path: string;
|
|
49
|
+
key_path: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
webhook: {
|
|
53
|
+
enabled: boolean;
|
|
54
|
+
/** URL to POST approval requests to */
|
|
55
|
+
url: string;
|
|
56
|
+
/** Shared secret for HMAC-SHA256 signatures */
|
|
57
|
+
secret: string;
|
|
58
|
+
/** Port for callback listener (receives approval responses) */
|
|
59
|
+
callback_port: number;
|
|
60
|
+
/** Host for callback listener */
|
|
61
|
+
callback_host: string;
|
|
62
|
+
};
|
|
40
63
|
}
|
|
41
64
|
/**
|
|
42
65
|
* Load configuration from file, falling back to defaults.
|
|
@@ -232,9 +255,11 @@ declare class StateStore {
|
|
|
232
255
|
/**
|
|
233
256
|
* Import a previously exported state bundle.
|
|
234
257
|
*/
|
|
235
|
-
import(bundleBase64: string, conflictResolution
|
|
258
|
+
import(bundleBase64: string, conflictResolution: "skip" | "overwrite" | "version" | undefined, publicKeyResolver: (kid: string) => Uint8Array | null): Promise<{
|
|
236
259
|
imported_keys: number;
|
|
237
260
|
skipped_keys: number;
|
|
261
|
+
skipped_invalid_sig: number;
|
|
262
|
+
skipped_unknown_kid: number;
|
|
238
263
|
conflicts: number;
|
|
239
264
|
namespaces: string[];
|
|
240
265
|
imported_at: string;
|
|
@@ -347,6 +372,150 @@ declare class CommitmentStore {
|
|
|
347
372
|
markRevealed(id: string): Promise<void>;
|
|
348
373
|
}
|
|
349
374
|
|
|
375
|
+
/**
|
|
376
|
+
* Sanctuary MCP Server — L3 Selective Disclosure: Zero-Knowledge Proofs
|
|
377
|
+
*
|
|
378
|
+
* Upgrades the commitment-only L3 to support real zero-knowledge proofs.
|
|
379
|
+
* Uses Ristretto255 (prime-order curve group, no cofactor issues) for:
|
|
380
|
+
*
|
|
381
|
+
* 1. Pedersen commitments: C = v*G + b*H (computationally hiding, perfectly binding)
|
|
382
|
+
* 2. ZK proof of knowledge: Schnorr sigma protocol via Fiat-Shamir
|
|
383
|
+
* 3. ZK range proofs: Prove value ∈ [min, max] without revealing it
|
|
384
|
+
*
|
|
385
|
+
* Ristretto255 is available via @noble/curves/ed25519, which we already depend on.
|
|
386
|
+
* This is genuine zero-knowledge — proofs reveal nothing beyond the stated property.
|
|
387
|
+
*
|
|
388
|
+
* Architecture note:
|
|
389
|
+
* The existing commitment scheme (SHA-256 based) remains available for backward
|
|
390
|
+
* compatibility. The ZK proofs operate on a separate Pedersen commitment system
|
|
391
|
+
* that provides algebraic structure for proper ZK properties.
|
|
392
|
+
*
|
|
393
|
+
* Security invariants:
|
|
394
|
+
* - Generator H is derived via hash-to-curve (nothing-up-my-sleeve)
|
|
395
|
+
* - Blinding factors are cryptographically random (32 bytes)
|
|
396
|
+
* - Fiat-Shamir challenges use domain-separated hashing
|
|
397
|
+
* - Range proofs use a bit-decomposition approach (sound but logarithmic size)
|
|
398
|
+
*/
|
|
399
|
+
/** A Pedersen commitment: C = v*G + b*H */
|
|
400
|
+
interface PedersenCommitment {
|
|
401
|
+
/** The commitment point (encoded as base64url) */
|
|
402
|
+
commitment: string;
|
|
403
|
+
/** The blinding factor b (base64url, 32 bytes) — keep secret */
|
|
404
|
+
blinding_factor: string;
|
|
405
|
+
/** When the commitment was created */
|
|
406
|
+
committed_at: string;
|
|
407
|
+
}
|
|
408
|
+
/** A non-interactive ZK proof of knowledge of a commitment's opening */
|
|
409
|
+
interface ZKProofOfKnowledge {
|
|
410
|
+
/** Proof type identifier */
|
|
411
|
+
type: "schnorr-pedersen-ristretto255";
|
|
412
|
+
/** The commitment this proof is for */
|
|
413
|
+
commitment: string;
|
|
414
|
+
/** Announcement point R (base64url) */
|
|
415
|
+
announcement: string;
|
|
416
|
+
/** Response scalar s_v (base64url) */
|
|
417
|
+
response_v: string;
|
|
418
|
+
/** Response scalar s_b (base64url) */
|
|
419
|
+
response_b: string;
|
|
420
|
+
/** Proof generated at */
|
|
421
|
+
generated_at: string;
|
|
422
|
+
}
|
|
423
|
+
/** A ZK range proof: proves value ∈ [min, max] */
|
|
424
|
+
interface ZKRangeProof {
|
|
425
|
+
/** Proof type identifier */
|
|
426
|
+
type: "range-pedersen-ristretto255";
|
|
427
|
+
/** The commitment this proof is for */
|
|
428
|
+
commitment: string;
|
|
429
|
+
/** Minimum value (inclusive) */
|
|
430
|
+
min: number;
|
|
431
|
+
/** Maximum value (inclusive) */
|
|
432
|
+
max: number;
|
|
433
|
+
/** Bit commitments for the shifted value (v - min) */
|
|
434
|
+
bit_commitments: string[];
|
|
435
|
+
/** Proofs that each bit commitment is 0 or 1 */
|
|
436
|
+
bit_proofs: Array<{
|
|
437
|
+
announcement_0: string;
|
|
438
|
+
announcement_1: string;
|
|
439
|
+
challenge_0: string;
|
|
440
|
+
challenge_1: string;
|
|
441
|
+
response_0: string;
|
|
442
|
+
response_1: string;
|
|
443
|
+
}>;
|
|
444
|
+
/** Sum proof: bit commitments sum to the value commitment */
|
|
445
|
+
sum_proof: {
|
|
446
|
+
announcement: string;
|
|
447
|
+
response: string;
|
|
448
|
+
};
|
|
449
|
+
/** Proof generated at */
|
|
450
|
+
generated_at: string;
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* Create a Pedersen commitment to a numeric value.
|
|
454
|
+
*
|
|
455
|
+
* C = v*G + b*H
|
|
456
|
+
*
|
|
457
|
+
* Properties:
|
|
458
|
+
* - Computationally hiding (under discrete log assumption)
|
|
459
|
+
* - Perfectly binding (information-theoretic)
|
|
460
|
+
* - Homomorphic: C(v1) + C(v2) = C(v1+v2) with adjusted blinding
|
|
461
|
+
*
|
|
462
|
+
* @param value - The value to commit to (integer)
|
|
463
|
+
* @returns The commitment and blinding factor
|
|
464
|
+
*/
|
|
465
|
+
declare function createPedersenCommitment(value: number): PedersenCommitment;
|
|
466
|
+
/**
|
|
467
|
+
* Verify a Pedersen commitment against a revealed value and blinding factor.
|
|
468
|
+
*
|
|
469
|
+
* Recomputes C' = v*G + b*H and checks C' == C.
|
|
470
|
+
*/
|
|
471
|
+
declare function verifyPedersenCommitment(commitment: string, value: number, blindingFactor: string): boolean;
|
|
472
|
+
/**
|
|
473
|
+
* Create a non-interactive ZK proof that you know the opening (v, b)
|
|
474
|
+
* of a Pedersen commitment C = v*G + b*H.
|
|
475
|
+
*
|
|
476
|
+
* Schnorr sigma protocol with Fiat-Shamir transform:
|
|
477
|
+
* 1. Pick random r_v, r_b
|
|
478
|
+
* 2. Compute R = r_v*G + r_b*H (announcement)
|
|
479
|
+
* 3. Compute e = H_FS(C || R) (challenge via Fiat-Shamir)
|
|
480
|
+
* 4. Compute s_v = r_v + e*v, s_b = r_b + e*b (responses)
|
|
481
|
+
* 5. Proof = (R, s_v, s_b)
|
|
482
|
+
*
|
|
483
|
+
* Zero-knowledge: the transcript (R, e, s_v, s_b) can be simulated
|
|
484
|
+
* without knowing (v, b), so it reveals nothing.
|
|
485
|
+
*
|
|
486
|
+
* @param value - The committed value
|
|
487
|
+
* @param blindingFactor - The blinding factor (base64url)
|
|
488
|
+
* @param commitment - The commitment (base64url)
|
|
489
|
+
*/
|
|
490
|
+
declare function createProofOfKnowledge(value: number, blindingFactor: string, commitment: string): ZKProofOfKnowledge;
|
|
491
|
+
/**
|
|
492
|
+
* Verify a ZK proof of knowledge of a commitment's opening.
|
|
493
|
+
*
|
|
494
|
+
* Check: s_v*G + s_b*H == R + e*C
|
|
495
|
+
*/
|
|
496
|
+
declare function verifyProofOfKnowledge(proof: ZKProofOfKnowledge): boolean;
|
|
497
|
+
/**
|
|
498
|
+
* Create a ZK range proof: prove value ∈ [min, max] without revealing value.
|
|
499
|
+
*
|
|
500
|
+
* Approach: bit-decomposition of (value - min) into n bits where 2^n > max - min.
|
|
501
|
+
* Each bit gets a Pedersen commitment and a proof it's 0 or 1.
|
|
502
|
+
* A sum proof shows the bit commitments reconstruct the original commitment
|
|
503
|
+
* (shifted by min).
|
|
504
|
+
*
|
|
505
|
+
* @param value - The committed value
|
|
506
|
+
* @param blindingFactor - The blinding factor (base64url)
|
|
507
|
+
* @param commitment - The commitment (base64url)
|
|
508
|
+
* @param min - Minimum value (inclusive)
|
|
509
|
+
* @param max - Maximum value (inclusive)
|
|
510
|
+
*/
|
|
511
|
+
declare function createRangeProof(value: number, blindingFactor: string, commitment: string, min: number, max: number): ZKRangeProof | {
|
|
512
|
+
error: string;
|
|
513
|
+
};
|
|
514
|
+
/**
|
|
515
|
+
* Verify a ZK range proof.
|
|
516
|
+
*/
|
|
517
|
+
declare function verifyRangeProof(proof: ZKRangeProof): boolean;
|
|
518
|
+
|
|
350
519
|
/**
|
|
351
520
|
* Sanctuary MCP Server — L3 Selective Disclosure: Disclosure Policies
|
|
352
521
|
*
|
|
@@ -445,6 +614,225 @@ interface StoredIdentity extends PublicIdentity {
|
|
|
445
614
|
}>;
|
|
446
615
|
}
|
|
447
616
|
|
|
617
|
+
/**
|
|
618
|
+
* Sanctuary MCP Server — Sovereignty Health Report (SHR) Types
|
|
619
|
+
*
|
|
620
|
+
* Machine-readable, signed, versioned sovereignty capability advertisement.
|
|
621
|
+
* An agent presents its SHR to counterparties to prove its sovereignty posture.
|
|
622
|
+
* The SHR is signed by one of the instance's Ed25519 identities and can be
|
|
623
|
+
* independently verified by any party without trusting the presenter.
|
|
624
|
+
*
|
|
625
|
+
* SHR version: 1.0
|
|
626
|
+
*/
|
|
627
|
+
type LayerStatus = "active" | "degraded" | "inactive";
|
|
628
|
+
type DegradationSeverity = "info" | "warning" | "critical";
|
|
629
|
+
type DegradationCode = "NO_TEE" | "PROCESS_ISOLATION_ONLY" | "COMMITMENT_ONLY" | "NO_ZK_PROOFS" | "SELF_REPORTED_ATTESTATION" | "NO_SELECTIVE_DISCLOSURE" | "BASIC_SYBIL_ONLY";
|
|
630
|
+
interface SHRLayerL1 {
|
|
631
|
+
status: LayerStatus;
|
|
632
|
+
encryption: string;
|
|
633
|
+
key_custody: "self" | "delegated" | "platform";
|
|
634
|
+
integrity: string;
|
|
635
|
+
identity_type: string;
|
|
636
|
+
state_portable: boolean;
|
|
637
|
+
}
|
|
638
|
+
interface SHRLayerL2 {
|
|
639
|
+
status: LayerStatus;
|
|
640
|
+
isolation_type: string;
|
|
641
|
+
attestation_available: boolean;
|
|
642
|
+
}
|
|
643
|
+
interface SHRLayerL3 {
|
|
644
|
+
status: LayerStatus;
|
|
645
|
+
proof_system: string;
|
|
646
|
+
selective_disclosure: boolean;
|
|
647
|
+
}
|
|
648
|
+
interface SHRLayerL4 {
|
|
649
|
+
status: LayerStatus;
|
|
650
|
+
reputation_mode: string;
|
|
651
|
+
attestation_format: string;
|
|
652
|
+
reputation_portable: boolean;
|
|
653
|
+
}
|
|
654
|
+
interface SHRDegradation {
|
|
655
|
+
layer: "l1" | "l2" | "l3" | "l4";
|
|
656
|
+
code: DegradationCode;
|
|
657
|
+
severity: DegradationSeverity;
|
|
658
|
+
description: string;
|
|
659
|
+
mitigation?: string;
|
|
660
|
+
}
|
|
661
|
+
interface SHRCapabilities {
|
|
662
|
+
handshake: boolean;
|
|
663
|
+
shr_exchange: boolean;
|
|
664
|
+
reputation_verify: boolean;
|
|
665
|
+
encrypted_channel: boolean;
|
|
666
|
+
}
|
|
667
|
+
/**
|
|
668
|
+
* The SHR body — the content that gets signed.
|
|
669
|
+
* Canonical form: JSON with sorted keys, no whitespace.
|
|
670
|
+
*/
|
|
671
|
+
interface SHRBody {
|
|
672
|
+
shr_version: "1.0";
|
|
673
|
+
instance_id: string;
|
|
674
|
+
generated_at: string;
|
|
675
|
+
expires_at: string;
|
|
676
|
+
layers: {
|
|
677
|
+
l1: SHRLayerL1;
|
|
678
|
+
l2: SHRLayerL2;
|
|
679
|
+
l3: SHRLayerL3;
|
|
680
|
+
l4: SHRLayerL4;
|
|
681
|
+
};
|
|
682
|
+
capabilities: SHRCapabilities;
|
|
683
|
+
degradations: SHRDegradation[];
|
|
684
|
+
}
|
|
685
|
+
/**
|
|
686
|
+
* The complete signed SHR — body + signature envelope.
|
|
687
|
+
*/
|
|
688
|
+
interface SignedSHR {
|
|
689
|
+
body: SHRBody;
|
|
690
|
+
signed_by: string;
|
|
691
|
+
signature: string;
|
|
692
|
+
}
|
|
693
|
+
interface SHRVerificationResult {
|
|
694
|
+
valid: boolean;
|
|
695
|
+
errors: string[];
|
|
696
|
+
warnings: string[];
|
|
697
|
+
sovereignty_level: "full" | "degraded" | "minimal";
|
|
698
|
+
counterparty_id: string;
|
|
699
|
+
expires_at: string;
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
/**
|
|
703
|
+
* Sanctuary MCP Server — Sovereignty Handshake Types
|
|
704
|
+
*
|
|
705
|
+
* The sovereignty handshake is a mutual verification protocol between
|
|
706
|
+
* two Sanctuary instances. Each party presents its SHR and proves
|
|
707
|
+
* liveness via nonce challenge-response.
|
|
708
|
+
*
|
|
709
|
+
* Protocol:
|
|
710
|
+
* A → B: HandshakeChallenge (A's SHR + nonce)
|
|
711
|
+
* B → A: HandshakeResponse (B's SHR + B's nonce + signature over A's nonce)
|
|
712
|
+
* A → B: HandshakeCompletion (signature over B's nonce)
|
|
713
|
+
* Result: Both hold a HandshakeResult with verified counterparty status
|
|
714
|
+
*/
|
|
715
|
+
|
|
716
|
+
/** Trust tier derived from sovereignty handshake */
|
|
717
|
+
type TrustTier = "verified-sovereign" | "verified-degraded" | "unverified";
|
|
718
|
+
/** Sovereignty level from SHR assessment */
|
|
719
|
+
type SovereigntyLevel = "full" | "degraded" | "minimal" | "unverified";
|
|
720
|
+
/**
|
|
721
|
+
* Step 1: Initiator sends challenge
|
|
722
|
+
*/
|
|
723
|
+
interface HandshakeChallenge {
|
|
724
|
+
protocol_version: "1.0";
|
|
725
|
+
shr: SignedSHR;
|
|
726
|
+
nonce: string;
|
|
727
|
+
initiated_at: string;
|
|
728
|
+
}
|
|
729
|
+
/**
|
|
730
|
+
* Step 2: Responder sends response
|
|
731
|
+
*/
|
|
732
|
+
interface HandshakeResponse {
|
|
733
|
+
protocol_version: "1.0";
|
|
734
|
+
shr: SignedSHR;
|
|
735
|
+
responder_nonce: string;
|
|
736
|
+
initiator_nonce_signature: string;
|
|
737
|
+
responded_at: string;
|
|
738
|
+
}
|
|
739
|
+
/**
|
|
740
|
+
* Step 3: Initiator sends completion
|
|
741
|
+
*/
|
|
742
|
+
interface HandshakeCompletion {
|
|
743
|
+
protocol_version: "1.0";
|
|
744
|
+
responder_nonce_signature: string;
|
|
745
|
+
completed_at: string;
|
|
746
|
+
}
|
|
747
|
+
/**
|
|
748
|
+
* Final result: both parties hold this after a successful handshake
|
|
749
|
+
*/
|
|
750
|
+
interface HandshakeResult {
|
|
751
|
+
counterparty_id: string;
|
|
752
|
+
counterparty_shr: SignedSHR;
|
|
753
|
+
verified: boolean;
|
|
754
|
+
sovereignty_level: SovereigntyLevel;
|
|
755
|
+
trust_tier: TrustTier;
|
|
756
|
+
completed_at: string;
|
|
757
|
+
expires_at: string;
|
|
758
|
+
errors: string[];
|
|
759
|
+
}
|
|
760
|
+
/**
|
|
761
|
+
* In-progress handshake state (stored on initiator side)
|
|
762
|
+
*/
|
|
763
|
+
interface HandshakeSession {
|
|
764
|
+
session_id: string;
|
|
765
|
+
role: "initiator" | "responder";
|
|
766
|
+
state: "initiated" | "responded" | "completed" | "failed";
|
|
767
|
+
our_nonce: string;
|
|
768
|
+
their_nonce?: string;
|
|
769
|
+
our_shr: SignedSHR;
|
|
770
|
+
their_shr?: SignedSHR;
|
|
771
|
+
initiated_at: string;
|
|
772
|
+
result?: HandshakeResult;
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
/**
|
|
776
|
+
* Sanctuary MCP Server — Sovereignty-Gated Reputation Tiers
|
|
777
|
+
*
|
|
778
|
+
* Attestations carry a sovereignty_tier field reflecting the signer's
|
|
779
|
+
* sovereignty posture at the time of recording. When querying or evaluating
|
|
780
|
+
* reputation, attestations from verified-sovereign agents carry more weight
|
|
781
|
+
* than those from unverified agents.
|
|
782
|
+
*
|
|
783
|
+
* Tier hierarchy (descending credibility):
|
|
784
|
+
* 1. "verified-sovereign" — signer completed a handshake with full sovereignty
|
|
785
|
+
* 2. "verified-degraded" — signer completed a handshake with degraded sovereignty
|
|
786
|
+
* 3. "self-attested" — signer has a Sanctuary identity but no handshake verification
|
|
787
|
+
* 4. "unverified" — no Sanctuary identity or sovereignty proof
|
|
788
|
+
*
|
|
789
|
+
* Weight multipliers are applied during reputation scoring. They are NOT
|
|
790
|
+
* gatekeeping — unverified attestations still count, just less.
|
|
791
|
+
*/
|
|
792
|
+
|
|
793
|
+
type SovereigntyTier = "verified-sovereign" | "verified-degraded" | "self-attested" | "unverified";
|
|
794
|
+
/** Weight multipliers for each tier */
|
|
795
|
+
declare const TIER_WEIGHTS: Record<SovereigntyTier, number>;
|
|
796
|
+
/** Tier metadata embedded in attestations */
|
|
797
|
+
interface TierMetadata {
|
|
798
|
+
sovereignty_tier: SovereigntyTier;
|
|
799
|
+
/** If verified, the handshake that established it */
|
|
800
|
+
handshake_completed_at?: string;
|
|
801
|
+
/** Counterparty ID from handshake (if applicable) */
|
|
802
|
+
verified_by?: string;
|
|
803
|
+
}
|
|
804
|
+
/**
|
|
805
|
+
* Resolve the sovereignty tier for a counterparty based on handshake history.
|
|
806
|
+
*
|
|
807
|
+
* @param counterpartyId - The counterparty's instance ID
|
|
808
|
+
* @param handshakeResults - Map of counterparty ID → most recent handshake result
|
|
809
|
+
* @param hasSanctuaryIdentity - Whether the counterparty has a known Sanctuary identity
|
|
810
|
+
* @returns TierMetadata for embedding in attestations
|
|
811
|
+
*/
|
|
812
|
+
declare function resolveTier(counterpartyId: string, handshakeResults: Map<string, HandshakeResult>, hasSanctuaryIdentity: boolean): TierMetadata;
|
|
813
|
+
/** An attestation with its tier for weighted scoring */
|
|
814
|
+
interface TieredAttestation {
|
|
815
|
+
/** The raw metric value */
|
|
816
|
+
value: number;
|
|
817
|
+
/** The sovereignty tier of the attestation signer */
|
|
818
|
+
tier: SovereigntyTier;
|
|
819
|
+
}
|
|
820
|
+
/**
|
|
821
|
+
* Compute a weighted reputation score from tiered attestations.
|
|
822
|
+
*
|
|
823
|
+
* Each attestation's contribution is multiplied by its tier weight.
|
|
824
|
+
* The result is normalized by total weight (not count), so adding
|
|
825
|
+
* low-tier attestations doesn't dilute high-tier ones.
|
|
826
|
+
*
|
|
827
|
+
* @param attestations - Array of value + tier pairs
|
|
828
|
+
* @returns Weighted score, or null if no attestations
|
|
829
|
+
*/
|
|
830
|
+
declare function computeWeightedScore(attestations: TieredAttestation[]): number | null;
|
|
831
|
+
/**
|
|
832
|
+
* Compute a tier distribution summary for a set of attestations.
|
|
833
|
+
*/
|
|
834
|
+
declare function tierDistribution(tiers: SovereigntyTier[]): Record<SovereigntyTier, number>;
|
|
835
|
+
|
|
448
836
|
/**
|
|
449
837
|
* Sanctuary MCP Server — L4 Verifiable Reputation: Reputation Store
|
|
450
838
|
*
|
|
@@ -481,6 +869,8 @@ interface Attestation {
|
|
|
481
869
|
metrics: Record<string, number>;
|
|
482
870
|
context: string;
|
|
483
871
|
timestamp: string;
|
|
872
|
+
/** Sovereignty tier of the signer at time of recording */
|
|
873
|
+
sovereignty_tier?: SovereigntyTier;
|
|
484
874
|
};
|
|
485
875
|
signature: string;
|
|
486
876
|
signer: string;
|
|
@@ -552,7 +942,7 @@ declare class ReputationStore {
|
|
|
552
942
|
/**
|
|
553
943
|
* Record an interaction outcome as a signed attestation.
|
|
554
944
|
*/
|
|
555
|
-
record(interactionId: string, counterpartyDid: string, outcome: InteractionOutcome, context: string, identity: StoredIdentity, identityEncryptionKey: Uint8Array, counterpartyAttestation?: string): Promise<StoredAttestation>;
|
|
945
|
+
record(interactionId: string, counterpartyDid: string, outcome: InteractionOutcome, context: string, identity: StoredIdentity, identityEncryptionKey: Uint8Array, counterpartyAttestation?: string, sovereigntyTier?: SovereigntyTier): Promise<StoredAttestation>;
|
|
556
946
|
/**
|
|
557
947
|
* Query reputation data with filtering.
|
|
558
948
|
* Returns aggregates only — not raw interaction data.
|
|
@@ -593,37 +983,167 @@ declare class ReputationStore {
|
|
|
593
983
|
* Create a principal's guarantee for a new agent.
|
|
594
984
|
*/
|
|
595
985
|
createGuarantee(principalIdentity: StoredIdentity, agentDid: string, scope: string, durationSeconds: number, identityEncryptionKey: Uint8Array, maxLiability?: number): Promise<Guarantee>;
|
|
986
|
+
/**
|
|
987
|
+
* Load attestations for tier-weighted scoring.
|
|
988
|
+
* Applies basic context/counterparty filtering, returns full StoredAttestations
|
|
989
|
+
* so callers can access sovereignty_tier from attestation data.
|
|
990
|
+
*/
|
|
991
|
+
loadAllForTierScoring(options?: {
|
|
992
|
+
context?: string;
|
|
993
|
+
counterparty_did?: string;
|
|
994
|
+
}): Promise<StoredAttestation[]>;
|
|
596
995
|
private loadAll;
|
|
597
996
|
}
|
|
598
997
|
|
|
599
998
|
/**
|
|
600
|
-
* Sanctuary MCP Server —
|
|
999
|
+
* Sanctuary MCP Server — Federation Types
|
|
601
1000
|
*
|
|
602
|
-
*
|
|
603
|
-
*
|
|
1001
|
+
* MCP-to-MCP federation enables two Sanctuary instances to:
|
|
1002
|
+
* 1. Discover each other's capabilities (SIM exchange)
|
|
1003
|
+
* 2. Establish mutual trust (sovereignty handshake)
|
|
1004
|
+
* 3. Exchange signed reputation attestations
|
|
1005
|
+
* 4. Evaluate trust for cross-instance interactions
|
|
1006
|
+
*
|
|
1007
|
+
* Federation operates as a protocol layer atop the handshake:
|
|
1008
|
+
* Handshake establishes trust → Federation uses that trust for ongoing operations.
|
|
1009
|
+
*
|
|
1010
|
+
* Key constraint: Federation MUST respect each party's sovereignty.
|
|
1011
|
+
* Neither party can compel the other to share data they haven't disclosed
|
|
1012
|
+
* via their disclosure policy.
|
|
604
1013
|
*/
|
|
605
1014
|
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
1015
|
+
/** A known federation peer */
|
|
1016
|
+
interface FederationPeer {
|
|
1017
|
+
/** The peer's instance ID (from their SHR) */
|
|
1018
|
+
peer_id: string;
|
|
1019
|
+
/** The peer's DID (identity) */
|
|
1020
|
+
peer_did: string;
|
|
1021
|
+
/** When this peer was first seen */
|
|
1022
|
+
first_seen: string;
|
|
1023
|
+
/** When last handshake completed */
|
|
1024
|
+
last_handshake: string;
|
|
1025
|
+
/** Current trust tier from most recent handshake */
|
|
1026
|
+
trust_tier: SovereigntyTier;
|
|
1027
|
+
/** Handshake result (for tier resolution) */
|
|
1028
|
+
handshake_result: HandshakeResult;
|
|
1029
|
+
/** Peer's advertised capabilities (from their SIM) */
|
|
1030
|
+
capabilities: FederationCapabilities;
|
|
1031
|
+
/** Whether we have a valid (non-expired) handshake */
|
|
1032
|
+
active: boolean;
|
|
1033
|
+
}
|
|
1034
|
+
/** Capabilities a peer advertises for federation */
|
|
1035
|
+
interface FederationCapabilities {
|
|
1036
|
+
/** Whether the peer supports reputation exchange */
|
|
1037
|
+
reputation_exchange: boolean;
|
|
1038
|
+
/** Whether the peer supports mutual attestation */
|
|
1039
|
+
mutual_attestation: boolean;
|
|
1040
|
+
/** Whether the peer supports encrypted channels */
|
|
1041
|
+
encrypted_channel: boolean;
|
|
1042
|
+
/** Supported attestation formats */
|
|
1043
|
+
attestation_formats: string[];
|
|
1044
|
+
}
|
|
1045
|
+
/** Trust evaluation result for a federation peer */
|
|
1046
|
+
interface PeerTrustEvaluation {
|
|
1047
|
+
peer_id: string;
|
|
1048
|
+
/** Current sovereignty tier (from handshake) */
|
|
1049
|
+
sovereignty_tier: SovereigntyTier;
|
|
1050
|
+
/** Whether handshake is current (not expired) */
|
|
1051
|
+
handshake_current: boolean;
|
|
1052
|
+
/** Reputation summary (if available) */
|
|
1053
|
+
reputation_score?: number;
|
|
1054
|
+
/** How many mutual attestations we share */
|
|
1055
|
+
mutual_attestation_count: number;
|
|
1056
|
+
/** Overall trust assessment */
|
|
1057
|
+
trust_level: "high" | "medium" | "low" | "none";
|
|
1058
|
+
/** Reasoning for the assessment */
|
|
1059
|
+
factors: string[];
|
|
1060
|
+
/** Evaluated at */
|
|
1061
|
+
evaluated_at: string;
|
|
617
1062
|
}
|
|
618
1063
|
|
|
619
1064
|
/**
|
|
620
|
-
* Sanctuary MCP Server —
|
|
1065
|
+
* Sanctuary MCP Server — Federation Peer Registry
|
|
621
1066
|
*
|
|
622
|
-
*
|
|
623
|
-
*
|
|
1067
|
+
* Manages known federation peers. Peers are discovered through handshakes
|
|
1068
|
+
* and tracked for ongoing federation operations.
|
|
1069
|
+
*
|
|
1070
|
+
* The registry is the source of truth for:
|
|
1071
|
+
* - Who we've federated with
|
|
1072
|
+
* - Current trust status of each peer
|
|
1073
|
+
* - Peer capabilities (what operations they support)
|
|
624
1074
|
*
|
|
625
1075
|
* Security invariants:
|
|
626
|
-
* -
|
|
1076
|
+
* - Peers are ONLY added through completed handshakes (not self-registration)
|
|
1077
|
+
* - Trust tiers degrade automatically when handshakes expire
|
|
1078
|
+
* - Peer data is stored encrypted under L1 sovereignty
|
|
1079
|
+
*/
|
|
1080
|
+
|
|
1081
|
+
declare class FederationRegistry {
|
|
1082
|
+
private peers;
|
|
1083
|
+
/**
|
|
1084
|
+
* Register or update a peer from a completed handshake.
|
|
1085
|
+
* This is the ONLY way peers enter the registry.
|
|
1086
|
+
*/
|
|
1087
|
+
registerFromHandshake(result: HandshakeResult, peerDid: string, capabilities?: Partial<FederationCapabilities>): FederationPeer;
|
|
1088
|
+
/**
|
|
1089
|
+
* Get a peer by instance ID.
|
|
1090
|
+
* Automatically updates active status based on handshake expiry.
|
|
1091
|
+
*/
|
|
1092
|
+
getPeer(peerId: string): FederationPeer | null;
|
|
1093
|
+
/**
|
|
1094
|
+
* List all known peers, optionally filtered by status.
|
|
1095
|
+
*/
|
|
1096
|
+
listPeers(filter?: {
|
|
1097
|
+
active_only?: boolean;
|
|
1098
|
+
}): FederationPeer[];
|
|
1099
|
+
/**
|
|
1100
|
+
* Evaluate trust for a federation peer.
|
|
1101
|
+
*
|
|
1102
|
+
* Trust assessment considers:
|
|
1103
|
+
* - Handshake status (current vs expired)
|
|
1104
|
+
* - Sovereignty tier (verified-sovereign vs degraded vs unverified)
|
|
1105
|
+
* - Reputation data (if available)
|
|
1106
|
+
* - Mutual attestation history
|
|
1107
|
+
*/
|
|
1108
|
+
evaluateTrust(peerId: string, mutualAttestationCount?: number, reputationScore?: number): PeerTrustEvaluation;
|
|
1109
|
+
/**
|
|
1110
|
+
* Remove a peer from the registry.
|
|
1111
|
+
*/
|
|
1112
|
+
removePeer(peerId: string): boolean;
|
|
1113
|
+
/**
|
|
1114
|
+
* Get the handshake results map (for tier resolution integration).
|
|
1115
|
+
*/
|
|
1116
|
+
getHandshakeResults(): Map<string, HandshakeResult>;
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
/**
|
|
1120
|
+
* Sanctuary MCP Server — In-Memory Storage Backend
|
|
1121
|
+
*
|
|
1122
|
+
* Used for testing. Implements the same interface as filesystem storage
|
|
1123
|
+
* but stores everything in memory. Data does not persist across restarts.
|
|
1124
|
+
*/
|
|
1125
|
+
|
|
1126
|
+
declare class MemoryStorage implements StorageBackend {
|
|
1127
|
+
private store;
|
|
1128
|
+
private storageKey;
|
|
1129
|
+
write(namespace: string, key: string, data: Uint8Array): Promise<void>;
|
|
1130
|
+
read(namespace: string, key: string): Promise<Uint8Array | null>;
|
|
1131
|
+
delete(namespace: string, key: string, _secureOverwrite?: boolean): Promise<boolean>;
|
|
1132
|
+
list(namespace: string, prefix?: string): Promise<StorageEntryMeta[]>;
|
|
1133
|
+
exists(namespace: string, key: string): Promise<boolean>;
|
|
1134
|
+
totalSize(): Promise<number>;
|
|
1135
|
+
/** Clear all stored data (useful in tests) */
|
|
1136
|
+
clear(): void;
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
/**
|
|
1140
|
+
* Sanctuary MCP Server — Filesystem Storage Backend
|
|
1141
|
+
*
|
|
1142
|
+
* Default storage backend using the local filesystem.
|
|
1143
|
+
* Files are stored as: {basePath}/{namespace}/{key}.enc
|
|
1144
|
+
*
|
|
1145
|
+
* Security invariants:
|
|
1146
|
+
* - Secure deletion overwrites file content with random bytes before unlinking
|
|
627
1147
|
* - Directory creation uses restrictive permissions (0o700)
|
|
628
1148
|
* - File creation uses restrictive permissions (0o600)
|
|
629
1149
|
*/
|
|
@@ -669,7 +1189,13 @@ interface Tier2Config {
|
|
|
669
1189
|
interface ApprovalChannelConfig {
|
|
670
1190
|
type: "stderr" | "webhook" | "callback";
|
|
671
1191
|
timeout_seconds: number;
|
|
672
|
-
|
|
1192
|
+
/**
|
|
1193
|
+
* SEC-002: auto_deny is hardcoded to true and not configurable.
|
|
1194
|
+
* Timeout on any approval channel ALWAYS results in denial.
|
|
1195
|
+
* This field is retained for backward compatibility with existing
|
|
1196
|
+
* policy files but is ignored — timeout always denies.
|
|
1197
|
+
*/
|
|
1198
|
+
auto_deny?: boolean;
|
|
673
1199
|
webhook_url?: string;
|
|
674
1200
|
webhook_secret?: string;
|
|
675
1201
|
}
|
|
@@ -697,7 +1223,7 @@ interface ApprovalRequest {
|
|
|
697
1223
|
interface ApprovalResponse {
|
|
698
1224
|
decision: "approve" | "deny";
|
|
699
1225
|
decided_at: string;
|
|
700
|
-
decided_by: "human" | "timeout" | "auto";
|
|
1226
|
+
decided_by: "human" | "timeout" | "auto" | "stderr:non-interactive";
|
|
701
1227
|
}
|
|
702
1228
|
/** Result of the approval gate evaluation */
|
|
703
1229
|
interface GateResult {
|
|
@@ -740,22 +1266,25 @@ interface ApprovalChannel {
|
|
|
740
1266
|
requestApproval(request: ApprovalRequest): Promise<ApprovalResponse>;
|
|
741
1267
|
}
|
|
742
1268
|
/**
|
|
743
|
-
* Stderr approval channel —
|
|
1269
|
+
* Stderr approval channel — non-interactive informational channel.
|
|
744
1270
|
*
|
|
745
1271
|
* In the MCP stdio model:
|
|
746
1272
|
* - stdin/stdout carry the MCP protocol (JSON-RPC)
|
|
747
1273
|
* - stderr is available for out-of-band human communication
|
|
748
1274
|
*
|
|
749
|
-
*
|
|
750
|
-
*
|
|
751
|
-
*
|
|
1275
|
+
* Because stdin is consumed by the MCP JSON-RPC transport, this channel
|
|
1276
|
+
* CANNOT read interactive human input. It is strictly informational:
|
|
1277
|
+
* the prompt is displayed so the human sees what is happening, and the
|
|
1278
|
+
* operation is denied immediately.
|
|
752
1279
|
*
|
|
753
|
-
*
|
|
754
|
-
*
|
|
1280
|
+
* SEC-002 + SEC-016 invariants:
|
|
1281
|
+
* - This channel ALWAYS denies. No configuration can change this.
|
|
1282
|
+
* - There is no timeout or async delay — denial is synchronous.
|
|
1283
|
+
* - The `auto_deny` config field is ignored (SEC-002).
|
|
1284
|
+
* - For interactive approval, use the dashboard or webhook channel.
|
|
755
1285
|
*/
|
|
756
1286
|
declare class StderrApprovalChannel implements ApprovalChannel {
|
|
757
|
-
|
|
758
|
-
constructor(config: ApprovalChannelConfig);
|
|
1287
|
+
constructor(_config: ApprovalChannelConfig);
|
|
759
1288
|
requestApproval(request: ApprovalRequest): Promise<ApprovalResponse>;
|
|
760
1289
|
private formatPrompt;
|
|
761
1290
|
}
|
|
@@ -915,6 +1444,229 @@ declare class ApprovalGate {
|
|
|
915
1444
|
*/
|
|
916
1445
|
declare function loadPrincipalPolicy(storagePath: string): Promise<PrincipalPolicy>;
|
|
917
1446
|
|
|
1447
|
+
/**
|
|
1448
|
+
* Sanctuary MCP Server — Principal Dashboard
|
|
1449
|
+
*
|
|
1450
|
+
* HTTP-based approval channel that serves a real-time web dashboard
|
|
1451
|
+
* for human principals to approve/deny agent operations.
|
|
1452
|
+
*
|
|
1453
|
+
* Architecture:
|
|
1454
|
+
* - Node.js built-in `http`/`https` modules (no Express or external deps)
|
|
1455
|
+
* - SSE (Server-Sent Events) for real-time push to browser
|
|
1456
|
+
* - Pending approval requests block the MCP tool call via Promise
|
|
1457
|
+
* - Human clicks approve/deny in browser → POST /api/approve/:id → Promise resolves
|
|
1458
|
+
* - Timeout fallback: auto-deny (or auto-approve) if no response
|
|
1459
|
+
*
|
|
1460
|
+
* Security invariants:
|
|
1461
|
+
* - Binds to 127.0.0.1 by default (localhost only)
|
|
1462
|
+
* - Optional bearer token authentication for non-localhost deployments
|
|
1463
|
+
* - Optional TLS (HTTPS) via cert/key paths
|
|
1464
|
+
* - All decisions are audit-logged
|
|
1465
|
+
* - Agent cannot access the dashboard (it runs outside MCP stdin/stdout)
|
|
1466
|
+
*/
|
|
1467
|
+
|
|
1468
|
+
interface DashboardConfig {
|
|
1469
|
+
port: number;
|
|
1470
|
+
host: string;
|
|
1471
|
+
timeout_seconds: number;
|
|
1472
|
+
/** SEC-002: auto_deny is always true. Field retained for interface compat but ignored. */
|
|
1473
|
+
auto_deny?: boolean;
|
|
1474
|
+
/** Bearer token for API authentication. If omitted, auth is disabled. */
|
|
1475
|
+
auth_token?: string;
|
|
1476
|
+
/** TLS configuration for HTTPS. If omitted, plain HTTP is used. */
|
|
1477
|
+
tls?: {
|
|
1478
|
+
cert_path: string;
|
|
1479
|
+
key_path: string;
|
|
1480
|
+
};
|
|
1481
|
+
}
|
|
1482
|
+
declare class DashboardApprovalChannel implements ApprovalChannel {
|
|
1483
|
+
private config;
|
|
1484
|
+
private pending;
|
|
1485
|
+
private sseClients;
|
|
1486
|
+
private httpServer;
|
|
1487
|
+
private policy;
|
|
1488
|
+
private baseline;
|
|
1489
|
+
private auditLog;
|
|
1490
|
+
private dashboardHTML;
|
|
1491
|
+
private authToken;
|
|
1492
|
+
private useTLS;
|
|
1493
|
+
/** SEC-012: Short-lived session store. Sessions replace URL query tokens. */
|
|
1494
|
+
private sessions;
|
|
1495
|
+
private sessionCleanupTimer;
|
|
1496
|
+
constructor(config: DashboardConfig);
|
|
1497
|
+
/**
|
|
1498
|
+
* Inject dependencies after construction.
|
|
1499
|
+
* Called from index.ts after all components are initialized.
|
|
1500
|
+
*/
|
|
1501
|
+
setDependencies(deps: {
|
|
1502
|
+
policy: PrincipalPolicy;
|
|
1503
|
+
baseline: BaselineTracker;
|
|
1504
|
+
auditLog: AuditLog;
|
|
1505
|
+
}): void;
|
|
1506
|
+
/**
|
|
1507
|
+
* Start the HTTP(S) server for the dashboard.
|
|
1508
|
+
*/
|
|
1509
|
+
start(): Promise<void>;
|
|
1510
|
+
/**
|
|
1511
|
+
* Stop the HTTP server and clean up.
|
|
1512
|
+
*/
|
|
1513
|
+
stop(): Promise<void>;
|
|
1514
|
+
/**
|
|
1515
|
+
* Request approval from the human via the dashboard.
|
|
1516
|
+
* Blocks until the human approves/denies or timeout occurs.
|
|
1517
|
+
*/
|
|
1518
|
+
requestApproval(request: ApprovalRequest): Promise<ApprovalResponse>;
|
|
1519
|
+
/**
|
|
1520
|
+
* Verify bearer token authentication.
|
|
1521
|
+
*
|
|
1522
|
+
* SEC-012: The long-lived auth token is ONLY accepted via the Authorization
|
|
1523
|
+
* header — never in URL query strings. For SSE and page loads that cannot
|
|
1524
|
+
* set headers, a short-lived session token (obtained via POST /auth/session)
|
|
1525
|
+
* is accepted via ?session= query parameter.
|
|
1526
|
+
*
|
|
1527
|
+
* Returns true if auth passes, false if blocked (response already sent).
|
|
1528
|
+
*/
|
|
1529
|
+
private checkAuth;
|
|
1530
|
+
/**
|
|
1531
|
+
* Create a short-lived session by exchanging the long-lived auth token
|
|
1532
|
+
* (provided in the Authorization header) for a session ID.
|
|
1533
|
+
*/
|
|
1534
|
+
private createSession;
|
|
1535
|
+
/**
|
|
1536
|
+
* Validate a session ID — must exist and not be expired.
|
|
1537
|
+
*/
|
|
1538
|
+
private validateSession;
|
|
1539
|
+
/**
|
|
1540
|
+
* Remove all expired sessions.
|
|
1541
|
+
*/
|
|
1542
|
+
private cleanupSessions;
|
|
1543
|
+
private handleRequest;
|
|
1544
|
+
/**
|
|
1545
|
+
* SEC-012: Exchange a long-lived auth token (in Authorization header)
|
|
1546
|
+
* for a short-lived session ID. The session ID can be used in URL
|
|
1547
|
+
* query parameters without exposing the long-lived credential.
|
|
1548
|
+
*
|
|
1549
|
+
* This endpoint performs its OWN auth check (header-only) because it
|
|
1550
|
+
* must reject query-parameter tokens and is called before the
|
|
1551
|
+
* normal checkAuth flow.
|
|
1552
|
+
*/
|
|
1553
|
+
private handleSessionExchange;
|
|
1554
|
+
private serveDashboard;
|
|
1555
|
+
private handleSSE;
|
|
1556
|
+
private handleStatus;
|
|
1557
|
+
private handlePendingList;
|
|
1558
|
+
private handleAuditLog;
|
|
1559
|
+
private handleDecision;
|
|
1560
|
+
private broadcastSSE;
|
|
1561
|
+
/**
|
|
1562
|
+
* Broadcast an audit entry to connected dashboards.
|
|
1563
|
+
* Called externally when audit events happen.
|
|
1564
|
+
*/
|
|
1565
|
+
broadcastAuditEntry(entry: {
|
|
1566
|
+
timestamp: string;
|
|
1567
|
+
layer: string;
|
|
1568
|
+
operation: string;
|
|
1569
|
+
identity_id: string;
|
|
1570
|
+
}): void;
|
|
1571
|
+
/**
|
|
1572
|
+
* Broadcast a baseline update to connected dashboards.
|
|
1573
|
+
* Called externally after baseline changes.
|
|
1574
|
+
*/
|
|
1575
|
+
broadcastBaselineUpdate(): void;
|
|
1576
|
+
/** Get the number of pending requests */
|
|
1577
|
+
get pendingCount(): number;
|
|
1578
|
+
/** Get the number of connected SSE clients */
|
|
1579
|
+
get clientCount(): number;
|
|
1580
|
+
}
|
|
1581
|
+
|
|
1582
|
+
/**
|
|
1583
|
+
* Sanctuary MCP Server — Webhook Approval Channel
|
|
1584
|
+
*
|
|
1585
|
+
* Sends approval requests to an external webhook URL and listens for
|
|
1586
|
+
* callback responses. Enables integration with Slack, Discord, PagerDuty,
|
|
1587
|
+
* or any HTTP-based approval workflow.
|
|
1588
|
+
*
|
|
1589
|
+
* Architecture:
|
|
1590
|
+
* - Outbound: POST approval request to configured webhook_url
|
|
1591
|
+
* - Inbound: HTTP callback server listens for POST /webhook/respond/:id
|
|
1592
|
+
* - HMAC-SHA256 signatures on both outbound and inbound payloads
|
|
1593
|
+
* - Timeout fallback: auto-deny (or auto-approve) if no callback received
|
|
1594
|
+
*
|
|
1595
|
+
* Security invariants:
|
|
1596
|
+
* - All outbound payloads signed with HMAC-SHA256 (webhook_secret)
|
|
1597
|
+
* - All inbound callbacks verified with same HMAC-SHA256 signature
|
|
1598
|
+
* - Callback server binds to configurable host (default 127.0.0.1)
|
|
1599
|
+
* - Replay protection via request ID + pending map (can't approve twice)
|
|
1600
|
+
* - All decisions are audit-logged
|
|
1601
|
+
*/
|
|
1602
|
+
|
|
1603
|
+
interface WebhookConfig {
|
|
1604
|
+
/** URL to POST approval requests to */
|
|
1605
|
+
webhook_url: string;
|
|
1606
|
+
/** Shared secret for HMAC-SHA256 signatures */
|
|
1607
|
+
webhook_secret: string;
|
|
1608
|
+
/** Port for the callback listener */
|
|
1609
|
+
callback_port: number;
|
|
1610
|
+
/** Host for the callback listener (default: 127.0.0.1) */
|
|
1611
|
+
callback_host: string;
|
|
1612
|
+
/** Seconds to wait for a callback before timeout */
|
|
1613
|
+
timeout_seconds: number;
|
|
1614
|
+
/** SEC-002: auto_deny is always true. Field retained for interface compat but ignored. */
|
|
1615
|
+
auto_deny?: boolean;
|
|
1616
|
+
}
|
|
1617
|
+
/** Outbound webhook payload */
|
|
1618
|
+
interface WebhookPayload {
|
|
1619
|
+
/** Unique request ID */
|
|
1620
|
+
request_id: string;
|
|
1621
|
+
/** The approval request details */
|
|
1622
|
+
operation: string;
|
|
1623
|
+
tier: 1 | 2;
|
|
1624
|
+
reason: string;
|
|
1625
|
+
context: Record<string, unknown>;
|
|
1626
|
+
timestamp: string;
|
|
1627
|
+
/** URL to POST the response back to */
|
|
1628
|
+
callback_url: string;
|
|
1629
|
+
/** Seconds until auto-resolution */
|
|
1630
|
+
timeout_seconds: number;
|
|
1631
|
+
}
|
|
1632
|
+
/** Inbound callback payload */
|
|
1633
|
+
interface WebhookCallbackPayload {
|
|
1634
|
+
/** The request ID being responded to */
|
|
1635
|
+
request_id: string;
|
|
1636
|
+
/** The decision */
|
|
1637
|
+
decision: "approve" | "deny";
|
|
1638
|
+
}
|
|
1639
|
+
/**
|
|
1640
|
+
* Generate HMAC-SHA256 signature for a payload.
|
|
1641
|
+
*/
|
|
1642
|
+
declare function signPayload(body: string, secret: string): string;
|
|
1643
|
+
/**
|
|
1644
|
+
* Verify HMAC-SHA256 signature. Uses timing-safe comparison.
|
|
1645
|
+
*/
|
|
1646
|
+
declare function verifySignature(body: string, signature: string, secret: string): boolean;
|
|
1647
|
+
declare class WebhookApprovalChannel implements ApprovalChannel {
|
|
1648
|
+
private config;
|
|
1649
|
+
private pending;
|
|
1650
|
+
private callbackServer;
|
|
1651
|
+
constructor(config: WebhookConfig);
|
|
1652
|
+
/**
|
|
1653
|
+
* Start the callback listener server.
|
|
1654
|
+
*/
|
|
1655
|
+
start(): Promise<void>;
|
|
1656
|
+
/**
|
|
1657
|
+
* Stop the callback server and clean up pending requests.
|
|
1658
|
+
*/
|
|
1659
|
+
stop(): Promise<void>;
|
|
1660
|
+
/**
|
|
1661
|
+
* Request approval by POSTing to the webhook and waiting for a callback.
|
|
1662
|
+
*/
|
|
1663
|
+
requestApproval(request: ApprovalRequest): Promise<ApprovalResponse>;
|
|
1664
|
+
private sendWebhook;
|
|
1665
|
+
private handleCallback;
|
|
1666
|
+
/** Get the number of pending requests */
|
|
1667
|
+
get pendingCount(): number;
|
|
1668
|
+
}
|
|
1669
|
+
|
|
918
1670
|
/**
|
|
919
1671
|
* Sanctuary MCP Server — L1 Cognitive Sovereignty: Tool Definitions
|
|
920
1672
|
*
|
|
@@ -939,91 +1691,6 @@ declare class IdentityManager {
|
|
|
939
1691
|
list(): PublicIdentity[];
|
|
940
1692
|
}
|
|
941
1693
|
|
|
942
|
-
/**
|
|
943
|
-
* Sanctuary MCP Server — Sovereignty Health Report (SHR) Types
|
|
944
|
-
*
|
|
945
|
-
* Machine-readable, signed, versioned sovereignty capability advertisement.
|
|
946
|
-
* An agent presents its SHR to counterparties to prove its sovereignty posture.
|
|
947
|
-
* The SHR is signed by one of the instance's Ed25519 identities and can be
|
|
948
|
-
* independently verified by any party without trusting the presenter.
|
|
949
|
-
*
|
|
950
|
-
* SHR version: 1.0
|
|
951
|
-
*/
|
|
952
|
-
type LayerStatus = "active" | "degraded" | "inactive";
|
|
953
|
-
type DegradationSeverity = "info" | "warning" | "critical";
|
|
954
|
-
type DegradationCode = "NO_TEE" | "PROCESS_ISOLATION_ONLY" | "COMMITMENT_ONLY" | "NO_ZK_PROOFS" | "SELF_REPORTED_ATTESTATION" | "NO_SELECTIVE_DISCLOSURE" | "BASIC_SYBIL_ONLY";
|
|
955
|
-
interface SHRLayerL1 {
|
|
956
|
-
status: LayerStatus;
|
|
957
|
-
encryption: string;
|
|
958
|
-
key_custody: "self" | "delegated" | "platform";
|
|
959
|
-
integrity: string;
|
|
960
|
-
identity_type: string;
|
|
961
|
-
state_portable: boolean;
|
|
962
|
-
}
|
|
963
|
-
interface SHRLayerL2 {
|
|
964
|
-
status: LayerStatus;
|
|
965
|
-
isolation_type: string;
|
|
966
|
-
attestation_available: boolean;
|
|
967
|
-
}
|
|
968
|
-
interface SHRLayerL3 {
|
|
969
|
-
status: LayerStatus;
|
|
970
|
-
proof_system: string;
|
|
971
|
-
selective_disclosure: boolean;
|
|
972
|
-
}
|
|
973
|
-
interface SHRLayerL4 {
|
|
974
|
-
status: LayerStatus;
|
|
975
|
-
reputation_mode: string;
|
|
976
|
-
attestation_format: string;
|
|
977
|
-
reputation_portable: boolean;
|
|
978
|
-
}
|
|
979
|
-
interface SHRDegradation {
|
|
980
|
-
layer: "l1" | "l2" | "l3" | "l4";
|
|
981
|
-
code: DegradationCode;
|
|
982
|
-
severity: DegradationSeverity;
|
|
983
|
-
description: string;
|
|
984
|
-
mitigation?: string;
|
|
985
|
-
}
|
|
986
|
-
interface SHRCapabilities {
|
|
987
|
-
handshake: boolean;
|
|
988
|
-
shr_exchange: boolean;
|
|
989
|
-
reputation_verify: boolean;
|
|
990
|
-
encrypted_channel: boolean;
|
|
991
|
-
}
|
|
992
|
-
/**
|
|
993
|
-
* The SHR body — the content that gets signed.
|
|
994
|
-
* Canonical form: JSON with sorted keys, no whitespace.
|
|
995
|
-
*/
|
|
996
|
-
interface SHRBody {
|
|
997
|
-
shr_version: "1.0";
|
|
998
|
-
instance_id: string;
|
|
999
|
-
generated_at: string;
|
|
1000
|
-
expires_at: string;
|
|
1001
|
-
layers: {
|
|
1002
|
-
l1: SHRLayerL1;
|
|
1003
|
-
l2: SHRLayerL2;
|
|
1004
|
-
l3: SHRLayerL3;
|
|
1005
|
-
l4: SHRLayerL4;
|
|
1006
|
-
};
|
|
1007
|
-
capabilities: SHRCapabilities;
|
|
1008
|
-
degradations: SHRDegradation[];
|
|
1009
|
-
}
|
|
1010
|
-
/**
|
|
1011
|
-
* The complete signed SHR — body + signature envelope.
|
|
1012
|
-
*/
|
|
1013
|
-
interface SignedSHR {
|
|
1014
|
-
body: SHRBody;
|
|
1015
|
-
signed_by: string;
|
|
1016
|
-
signature: string;
|
|
1017
|
-
}
|
|
1018
|
-
interface SHRVerificationResult {
|
|
1019
|
-
valid: boolean;
|
|
1020
|
-
errors: string[];
|
|
1021
|
-
warnings: string[];
|
|
1022
|
-
sovereignty_level: "full" | "degraded" | "minimal";
|
|
1023
|
-
counterparty_id: string;
|
|
1024
|
-
expires_at: string;
|
|
1025
|
-
}
|
|
1026
|
-
|
|
1027
1694
|
/**
|
|
1028
1695
|
* Sanctuary MCP Server — SHR Generator
|
|
1029
1696
|
*
|
|
@@ -1066,79 +1733,6 @@ declare function generateSHR(identityId: string | undefined, opts: SHRGeneratorO
|
|
|
1066
1733
|
*/
|
|
1067
1734
|
declare function verifySHR(shr: SignedSHR, now?: Date): SHRVerificationResult;
|
|
1068
1735
|
|
|
1069
|
-
/**
|
|
1070
|
-
* Sanctuary MCP Server — Sovereignty Handshake Types
|
|
1071
|
-
*
|
|
1072
|
-
* The sovereignty handshake is a mutual verification protocol between
|
|
1073
|
-
* two Sanctuary instances. Each party presents its SHR and proves
|
|
1074
|
-
* liveness via nonce challenge-response.
|
|
1075
|
-
*
|
|
1076
|
-
* Protocol:
|
|
1077
|
-
* A → B: HandshakeChallenge (A's SHR + nonce)
|
|
1078
|
-
* B → A: HandshakeResponse (B's SHR + B's nonce + signature over A's nonce)
|
|
1079
|
-
* A → B: HandshakeCompletion (signature over B's nonce)
|
|
1080
|
-
* Result: Both hold a HandshakeResult with verified counterparty status
|
|
1081
|
-
*/
|
|
1082
|
-
|
|
1083
|
-
/** Trust tier derived from sovereignty handshake */
|
|
1084
|
-
type TrustTier = "verified-sovereign" | "verified-degraded" | "unverified";
|
|
1085
|
-
/** Sovereignty level from SHR assessment */
|
|
1086
|
-
type SovereigntyLevel = "full" | "degraded" | "minimal" | "unverified";
|
|
1087
|
-
/**
|
|
1088
|
-
* Step 1: Initiator sends challenge
|
|
1089
|
-
*/
|
|
1090
|
-
interface HandshakeChallenge {
|
|
1091
|
-
protocol_version: "1.0";
|
|
1092
|
-
shr: SignedSHR;
|
|
1093
|
-
nonce: string;
|
|
1094
|
-
initiated_at: string;
|
|
1095
|
-
}
|
|
1096
|
-
/**
|
|
1097
|
-
* Step 2: Responder sends response
|
|
1098
|
-
*/
|
|
1099
|
-
interface HandshakeResponse {
|
|
1100
|
-
protocol_version: "1.0";
|
|
1101
|
-
shr: SignedSHR;
|
|
1102
|
-
responder_nonce: string;
|
|
1103
|
-
initiator_nonce_signature: string;
|
|
1104
|
-
responded_at: string;
|
|
1105
|
-
}
|
|
1106
|
-
/**
|
|
1107
|
-
* Step 3: Initiator sends completion
|
|
1108
|
-
*/
|
|
1109
|
-
interface HandshakeCompletion {
|
|
1110
|
-
protocol_version: "1.0";
|
|
1111
|
-
responder_nonce_signature: string;
|
|
1112
|
-
completed_at: string;
|
|
1113
|
-
}
|
|
1114
|
-
/**
|
|
1115
|
-
* Final result: both parties hold this after a successful handshake
|
|
1116
|
-
*/
|
|
1117
|
-
interface HandshakeResult {
|
|
1118
|
-
counterparty_id: string;
|
|
1119
|
-
counterparty_shr: SignedSHR;
|
|
1120
|
-
verified: boolean;
|
|
1121
|
-
sovereignty_level: SovereigntyLevel;
|
|
1122
|
-
trust_tier: TrustTier;
|
|
1123
|
-
completed_at: string;
|
|
1124
|
-
expires_at: string;
|
|
1125
|
-
errors: string[];
|
|
1126
|
-
}
|
|
1127
|
-
/**
|
|
1128
|
-
* In-progress handshake state (stored on initiator side)
|
|
1129
|
-
*/
|
|
1130
|
-
interface HandshakeSession {
|
|
1131
|
-
session_id: string;
|
|
1132
|
-
role: "initiator" | "responder";
|
|
1133
|
-
state: "initiated" | "responded" | "completed" | "failed";
|
|
1134
|
-
our_nonce: string;
|
|
1135
|
-
their_nonce?: string;
|
|
1136
|
-
our_shr: SignedSHR;
|
|
1137
|
-
their_shr?: SignedSHR;
|
|
1138
|
-
initiated_at: string;
|
|
1139
|
-
result?: HandshakeResult;
|
|
1140
|
-
}
|
|
1141
|
-
|
|
1142
1736
|
/**
|
|
1143
1737
|
* Sanctuary MCP Server — Sovereignty Handshake Protocol
|
|
1144
1738
|
*
|
|
@@ -1181,6 +1775,188 @@ declare function completeHandshake(response: HandshakeResponse, session: Handsha
|
|
|
1181
1775
|
*/
|
|
1182
1776
|
declare function verifyCompletion(completion: HandshakeCompletion, session: HandshakeSession): HandshakeResult;
|
|
1183
1777
|
|
|
1778
|
+
/**
|
|
1779
|
+
* Sanctuary MCP Server — Concordia Bridge: Type Definitions
|
|
1780
|
+
*
|
|
1781
|
+
* Defines the interface contract between the Concordia negotiation protocol
|
|
1782
|
+
* and Sanctuary's sovereignty infrastructure. This is the Sanctuary side of
|
|
1783
|
+
* the bridge — when Concordia is present, its `accept` can trigger a
|
|
1784
|
+
* Sanctuary commitment for cryptographic binding. When Concordia is absent,
|
|
1785
|
+
* these types and tools still function independently.
|
|
1786
|
+
*
|
|
1787
|
+
* Design principle: the bridge is additive, never required. Sanctuary and
|
|
1788
|
+
* Concordia remain non-dependent. These types define the contract Concordia
|
|
1789
|
+
* implements against, not a dependency Sanctuary requires.
|
|
1790
|
+
*/
|
|
1791
|
+
|
|
1792
|
+
/**
|
|
1793
|
+
* Concordia negotiation outcome — the data Concordia sends when an
|
|
1794
|
+
* `accept` triggers a Sanctuary commitment.
|
|
1795
|
+
*
|
|
1796
|
+
* This type is defined by Sanctuary (the receiver) to specify the
|
|
1797
|
+
* contract Concordia must fulfill. Field names align with Concordia's
|
|
1798
|
+
* protocol semantics.
|
|
1799
|
+
*/
|
|
1800
|
+
interface ConcordiaOutcome {
|
|
1801
|
+
/** Concordia session identifier */
|
|
1802
|
+
session_id: string;
|
|
1803
|
+
/** Protocol version (e.g., "concordia-v1") */
|
|
1804
|
+
protocol_version: string;
|
|
1805
|
+
/** DID of the party who proposed the accepted terms */
|
|
1806
|
+
proposer_did: string;
|
|
1807
|
+
/** DID of the party who accepted */
|
|
1808
|
+
acceptor_did: string;
|
|
1809
|
+
/** The accepted terms — opaque to Sanctuary, meaningful to Concordia */
|
|
1810
|
+
terms: Record<string, unknown>;
|
|
1811
|
+
/** SHA-256 hash of the canonical terms serialization (computed by Concordia) */
|
|
1812
|
+
terms_hash: string;
|
|
1813
|
+
/** Number of rounds in the negotiation (propose/counter cycles) */
|
|
1814
|
+
rounds: number;
|
|
1815
|
+
/** ISO 8601 timestamp when accept was issued */
|
|
1816
|
+
accepted_at: string;
|
|
1817
|
+
/** Optional: Concordia session receipt (signed transcript) */
|
|
1818
|
+
session_receipt?: string;
|
|
1819
|
+
}
|
|
1820
|
+
/**
|
|
1821
|
+
* A Sanctuary commitment binding a Concordia negotiation outcome.
|
|
1822
|
+
*
|
|
1823
|
+
* This is the cryptographic anchor: a SHA-256 commitment over the
|
|
1824
|
+
* canonical serialization of the ConcordiaOutcome, plus a Pedersen
|
|
1825
|
+
* commitment if ZK proofs are needed (e.g., proving negotiation
|
|
1826
|
+
* took ≤ N rounds without revealing exact count).
|
|
1827
|
+
*/
|
|
1828
|
+
interface BridgeCommitment {
|
|
1829
|
+
/** Unique bridge commitment identifier */
|
|
1830
|
+
bridge_commitment_id: string;
|
|
1831
|
+
/** The Concordia session this commitment binds */
|
|
1832
|
+
session_id: string;
|
|
1833
|
+
/** SHA-256 commitment: hash(canonical_outcome || blinding_factor) */
|
|
1834
|
+
sha256_commitment: string;
|
|
1835
|
+
/** Blinding factor for the SHA-256 commitment (base64url) */
|
|
1836
|
+
blinding_factor: string;
|
|
1837
|
+
/** DID of the Sanctuary identity that created this commitment */
|
|
1838
|
+
committer_did: string;
|
|
1839
|
+
/** Ed25519 signature over the commitment by the committer */
|
|
1840
|
+
signature: string;
|
|
1841
|
+
/** Optional: Pedersen commitment over the round count (for ZK range proofs) */
|
|
1842
|
+
pedersen_commitment?: {
|
|
1843
|
+
commitment: string;
|
|
1844
|
+
blinding_factor: string;
|
|
1845
|
+
};
|
|
1846
|
+
/** ISO 8601 timestamp */
|
|
1847
|
+
committed_at: string;
|
|
1848
|
+
/** Protocol metadata */
|
|
1849
|
+
bridge_version: "sanctuary-concordia-bridge-v1";
|
|
1850
|
+
}
|
|
1851
|
+
/** Result of verifying a bridge commitment against a revealed outcome */
|
|
1852
|
+
interface BridgeVerificationResult {
|
|
1853
|
+
/** Whether the commitment matches the revealed outcome */
|
|
1854
|
+
valid: boolean;
|
|
1855
|
+
/** Which checks passed/failed */
|
|
1856
|
+
checks: {
|
|
1857
|
+
sha256_match: boolean;
|
|
1858
|
+
signature_valid: boolean;
|
|
1859
|
+
session_id_match: boolean;
|
|
1860
|
+
terms_hash_match: boolean;
|
|
1861
|
+
pedersen_match?: boolean;
|
|
1862
|
+
};
|
|
1863
|
+
/** The commitment that was verified */
|
|
1864
|
+
bridge_commitment_id: string;
|
|
1865
|
+
/** ISO 8601 timestamp of verification */
|
|
1866
|
+
verified_at: string;
|
|
1867
|
+
}
|
|
1868
|
+
/**
|
|
1869
|
+
* A bridge attestation links a Concordia negotiation to Sanctuary's
|
|
1870
|
+
* L4 reputation system. When a negotiation completes successfully,
|
|
1871
|
+
* both the commitment (L3) and the reputation attestation (L4) are
|
|
1872
|
+
* recorded — the commitment proves the terms were agreed, the
|
|
1873
|
+
* attestation feeds the sovereignty-weighted reputation score.
|
|
1874
|
+
*/
|
|
1875
|
+
interface BridgeAttestationRequest {
|
|
1876
|
+
/** The bridge commitment ID that anchors this attestation */
|
|
1877
|
+
bridge_commitment_id: string;
|
|
1878
|
+
/** Concordia session ID */
|
|
1879
|
+
session_id: string;
|
|
1880
|
+
/** DID of the counterparty in the negotiation */
|
|
1881
|
+
counterparty_did: string;
|
|
1882
|
+
/** Negotiation outcome for reputation scoring */
|
|
1883
|
+
outcome_result: "completed" | "partial" | "failed" | "disputed";
|
|
1884
|
+
/** Optional metrics (e.g., rounds, response_time_ms, terms_complexity) */
|
|
1885
|
+
metrics?: Record<string, number>;
|
|
1886
|
+
/** Identity to sign the attestation (uses default if omitted) */
|
|
1887
|
+
identity_id?: string;
|
|
1888
|
+
}
|
|
1889
|
+
/** Result of creating a bridge attestation */
|
|
1890
|
+
interface BridgeAttestationResult {
|
|
1891
|
+
/** The L4 attestation ID created */
|
|
1892
|
+
attestation_id: string;
|
|
1893
|
+
/** The bridge commitment ID that anchors it */
|
|
1894
|
+
bridge_commitment_id: string;
|
|
1895
|
+
/** Concordia session ID */
|
|
1896
|
+
session_id: string;
|
|
1897
|
+
/** Sovereignty tier applied to the attestation */
|
|
1898
|
+
sovereignty_tier: SovereigntyTier;
|
|
1899
|
+
/** ISO 8601 timestamp */
|
|
1900
|
+
attested_at: string;
|
|
1901
|
+
}
|
|
1902
|
+
|
|
1903
|
+
/**
|
|
1904
|
+
* Sanctuary MCP Server — Concordia Bridge: Core Module
|
|
1905
|
+
*
|
|
1906
|
+
* Implements the Sanctuary side of the Concordia bridge:
|
|
1907
|
+
* 1. bridge_commit — Create a cryptographic commitment binding a negotiation outcome
|
|
1908
|
+
* 2. bridge_verify — Verify a commitment against a revealed outcome
|
|
1909
|
+
* 3. bridge_attest — Link a negotiation to L4 reputation via the commitment
|
|
1910
|
+
*
|
|
1911
|
+
* The bridge composes L3 (selective disclosure) and L4 (verifiable reputation)
|
|
1912
|
+
* to serve negotiation-specific needs. It introduces no new cryptographic
|
|
1913
|
+
* primitives — everything delegates to the existing L3 commitment/ZK layer
|
|
1914
|
+
* and L4 reputation store.
|
|
1915
|
+
*
|
|
1916
|
+
* Non-dependency principle: this module can be used without Concordia
|
|
1917
|
+
* running. Any system that provides a ConcordiaOutcome-shaped object
|
|
1918
|
+
* can create bridge commitments. Concordia is the expected caller, but
|
|
1919
|
+
* the interface is protocol-agnostic.
|
|
1920
|
+
*/
|
|
1921
|
+
|
|
1922
|
+
/**
|
|
1923
|
+
* Produce a canonical byte representation of a ConcordiaOutcome.
|
|
1924
|
+
* Sorts all keys recursively to ensure determinism.
|
|
1925
|
+
*/
|
|
1926
|
+
declare function canonicalize(outcome: ConcordiaOutcome): Uint8Array;
|
|
1927
|
+
/**
|
|
1928
|
+
* Create a cryptographic commitment binding a Concordia negotiation outcome
|
|
1929
|
+
* to Sanctuary's L3 proof layer.
|
|
1930
|
+
*
|
|
1931
|
+
* Creates:
|
|
1932
|
+
* 1. A SHA-256 commitment over the canonical outcome (always)
|
|
1933
|
+
* 2. A Pedersen commitment over the round count (optional, for ZK range proofs)
|
|
1934
|
+
* 3. An Ed25519 signature over the commitment by the committer's identity
|
|
1935
|
+
*
|
|
1936
|
+
* @param outcome - The Concordia negotiation outcome to bind
|
|
1937
|
+
* @param identity - The Sanctuary identity creating the commitment
|
|
1938
|
+
* @param identityEncryptionKey - Key to decrypt the identity's private key
|
|
1939
|
+
* @param includePedersen - Whether to create a Pedersen commitment on round count
|
|
1940
|
+
* @returns The bridge commitment
|
|
1941
|
+
*/
|
|
1942
|
+
declare function createBridgeCommitment(outcome: ConcordiaOutcome, identity: StoredIdentity, identityEncryptionKey: Uint8Array, includePedersen?: boolean): BridgeCommitment;
|
|
1943
|
+
/**
|
|
1944
|
+
* Verify a bridge commitment against a revealed Concordia outcome.
|
|
1945
|
+
*
|
|
1946
|
+
* Checks:
|
|
1947
|
+
* 1. SHA-256 commitment matches the canonical outcome + blinding factor
|
|
1948
|
+
* 2. Ed25519 signature is valid for the committer's public key
|
|
1949
|
+
* 3. Session IDs match
|
|
1950
|
+
* 4. Terms hash matches (Concordia's own hash of the terms)
|
|
1951
|
+
* 5. Pedersen commitment matches round count (if present)
|
|
1952
|
+
*
|
|
1953
|
+
* @param commitment - The bridge commitment to verify
|
|
1954
|
+
* @param outcome - The revealed Concordia outcome
|
|
1955
|
+
* @param committerPublicKey - The committer's Ed25519 public key
|
|
1956
|
+
* @returns Verification result with per-check detail
|
|
1957
|
+
*/
|
|
1958
|
+
declare function verifyBridgeCommitment(commitment: BridgeCommitment, outcome: ConcordiaOutcome, committerPublicKey: Uint8Array): BridgeVerificationResult;
|
|
1959
|
+
|
|
1184
1960
|
/**
|
|
1185
1961
|
* Sanctuary MCP Server — Main Entry Point
|
|
1186
1962
|
*
|
|
@@ -1204,4 +1980,4 @@ declare function createSanctuaryServer(options?: {
|
|
|
1204
1980
|
storage?: StorageBackend;
|
|
1205
1981
|
}): Promise<SanctuaryServer>;
|
|
1206
1982
|
|
|
1207
|
-
export { ApprovalGate, AuditLog, AutoApproveChannel, BaselineTracker, CallbackApprovalChannel, CommitmentStore, FilesystemStorage, type GateResult, type HandshakeChallenge, type HandshakeCompletion, type HandshakeResponse, type HandshakeResult, MemoryStorage, PolicyStore, type PrincipalPolicy, ReputationStore, type SHRBody, type SHRVerificationResult, type SanctuaryConfig, type SanctuaryServer, type SignedSHR, StateStore, StderrApprovalChannel, completeHandshake, createSanctuaryServer, generateSHR, initiateHandshake, loadConfig, loadPrincipalPolicy, respondToHandshake, verifyCompletion, verifySHR };
|
|
1983
|
+
export { ApprovalGate, AuditLog, AutoApproveChannel, BaselineTracker, type BridgeAttestationRequest, type BridgeAttestationResult, type BridgeCommitment, type BridgeVerificationResult, CallbackApprovalChannel, CommitmentStore, type ConcordiaOutcome, DashboardApprovalChannel, type DashboardConfig, type FederationCapabilities, type FederationPeer, FederationRegistry, FilesystemStorage, type GateResult, type HandshakeChallenge, type HandshakeCompletion, type HandshakeResponse, type HandshakeResult, MemoryStorage, type PedersenCommitment, type PeerTrustEvaluation, PolicyStore, type PrincipalPolicy, ReputationStore, type SHRBody, type SHRVerificationResult, type SanctuaryConfig, type SanctuaryServer, type SignedSHR, type SovereigntyTier, StateStore, StderrApprovalChannel, TIER_WEIGHTS, type TierMetadata, type TieredAttestation, WebhookApprovalChannel, type WebhookCallbackPayload, type WebhookConfig, type WebhookPayload, type ZKProofOfKnowledge, type ZKRangeProof, canonicalize, completeHandshake, computeWeightedScore, createBridgeCommitment, createPedersenCommitment, createProofOfKnowledge, createRangeProof, createSanctuaryServer, generateSHR, initiateHandshake, loadConfig, loadPrincipalPolicy, resolveTier, respondToHandshake, signPayload, tierDistribution, verifyBridgeCommitment, verifyCompletion, verifyPedersenCommitment, verifyProofOfKnowledge, verifyRangeProof, verifySHR, verifySignature };
|