@sanctuary-framework/mcp-server 0.8.0 → 0.10.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.
- package/dist/cli.cjs +6334 -1915
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +6339 -1920
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +1579 -71
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +385 -4
- package/dist/index.d.ts +385 -4
- package/dist/index.js +1575 -72
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
package/dist/index.d.cts
CHANGED
|
@@ -6,7 +6,6 @@ import { SSEClientTransport } from '@modelcontextprotocol/sdk/client/sse.js';
|
|
|
6
6
|
interface SanctuaryConfig {
|
|
7
7
|
version: string;
|
|
8
8
|
storage_path: string;
|
|
9
|
-
principal_id?: string;
|
|
10
9
|
state: {
|
|
11
10
|
encryption: "aes-256-gcm";
|
|
12
11
|
key_protection: "passphrase" | "hardware-key" | "none";
|
|
@@ -146,17 +145,31 @@ interface AuditEntry {
|
|
|
146
145
|
result: "success" | "failure";
|
|
147
146
|
details?: Record<string, unknown>;
|
|
148
147
|
}
|
|
148
|
+
interface AuditLogConfig {
|
|
149
|
+
/** Maximum total size of stored audit entries in bytes. Default: 100 MB. */
|
|
150
|
+
maxTotalSizeBytes?: number;
|
|
151
|
+
/** Maximum number of stored audit entry files to retain. Default: 100_000. */
|
|
152
|
+
maxEntries?: number;
|
|
153
|
+
}
|
|
149
154
|
declare class AuditLog {
|
|
150
155
|
private storage;
|
|
151
156
|
private encryptionKey;
|
|
152
157
|
private entries;
|
|
153
158
|
private counter;
|
|
154
|
-
|
|
159
|
+
private readonly maxTotalSizeBytes;
|
|
160
|
+
private readonly maxEntries;
|
|
161
|
+
private rotationInFlight;
|
|
162
|
+
constructor(storage: StorageBackend, masterKey: Uint8Array, config?: AuditLogConfig);
|
|
155
163
|
/**
|
|
156
164
|
* Append an audit entry.
|
|
157
165
|
*/
|
|
158
166
|
append(layer: AuditEntry["layer"], operation: string, identityId: string, details?: Record<string, unknown>, result?: "success" | "failure"): void;
|
|
159
167
|
private persistEntry;
|
|
168
|
+
/**
|
|
169
|
+
* Prune oldest audit entries when storage exceeds configured limits.
|
|
170
|
+
* Entries are sorted by key (timestamp-based) so oldest are pruned first.
|
|
171
|
+
*/
|
|
172
|
+
private maybeRotate;
|
|
160
173
|
/**
|
|
161
174
|
* Query the audit log with filtering.
|
|
162
175
|
*/
|
|
@@ -762,7 +775,18 @@ declare class StateStore {
|
|
|
762
775
|
private masterKey;
|
|
763
776
|
private versionCache;
|
|
764
777
|
private contentHashes;
|
|
778
|
+
private namespaceKeyCache;
|
|
779
|
+
private static readonly KEY_CACHE_TTL_MS;
|
|
780
|
+
private static readonly KEY_CACHE_MAX_ENTRIES;
|
|
765
781
|
constructor(storage: StorageBackend, masterKey: Uint8Array);
|
|
782
|
+
/**
|
|
783
|
+
* Get or derive a namespace encryption key, with caching.
|
|
784
|
+
* Cache entries expire after 15 minutes and are evicted LRU when
|
|
785
|
+
* the cache exceeds 128 entries.
|
|
786
|
+
*/
|
|
787
|
+
private getNamespaceKey;
|
|
788
|
+
/** Invalidate all cached namespace keys (call on master key rotation). */
|
|
789
|
+
invalidateKeyCache(): void;
|
|
766
790
|
private versionKey;
|
|
767
791
|
/**
|
|
768
792
|
* Get or initialize the content hash map for a namespace.
|
|
@@ -906,6 +930,10 @@ declare class IdentityManager {
|
|
|
906
930
|
getDefault(): StoredIdentity | undefined;
|
|
907
931
|
getPrimaryIdentityId(): string | null;
|
|
908
932
|
list(): PublicIdentity[];
|
|
933
|
+
/** List identities with rotation count (for dashboard display). */
|
|
934
|
+
listWithRotationCount(): Array<PublicIdentity & {
|
|
935
|
+
rotation_count: number;
|
|
936
|
+
}>;
|
|
909
937
|
}
|
|
910
938
|
|
|
911
939
|
/**
|
|
@@ -1185,7 +1213,7 @@ declare class PolicyStore {
|
|
|
1185
1213
|
*/
|
|
1186
1214
|
type LayerStatus = "active" | "degraded" | "inactive";
|
|
1187
1215
|
type DegradationSeverity = "info" | "warning" | "critical";
|
|
1188
|
-
type DegradationCode = "NO_TEE" | "PROCESS_ISOLATION_ONLY" | "COMMITMENT_ONLY" | "NO_ZK_PROOFS" | "SELF_REPORTED_ATTESTATION" | "NO_SELECTIVE_DISCLOSURE" | "BASIC_SYBIL_ONLY";
|
|
1216
|
+
type DegradationCode = "NO_TEE" | "PROCESS_ISOLATION_ONLY" | "COMMITMENT_ONLY" | "NO_ZK_PROOFS" | "SELF_REPORTED_ATTESTATION" | "NO_SELECTIVE_DISCLOSURE" | "BASIC_SYBIL_ONLY" | "NO_REPUTATION_HISTORY" | "LOW_TIER_DOMINANCE" | "STALE_REPUTATION" | "DISPUTE_ON_RECORD" | "NO_VERASCORE_LINK";
|
|
1189
1217
|
interface SHRLayerL1 {
|
|
1190
1218
|
status: LayerStatus;
|
|
1191
1219
|
encryption: string;
|
|
@@ -1478,6 +1506,23 @@ interface ReputationSummary {
|
|
|
1478
1506
|
};
|
|
1479
1507
|
aggregate_metrics: Record<string, MetricAggregate>;
|
|
1480
1508
|
}
|
|
1509
|
+
/**
|
|
1510
|
+
* L4 attestation evidence summary for the SHR degradation emitter and the
|
|
1511
|
+
* dashboard evidence widget. Derived from the stored attestations; does not
|
|
1512
|
+
* include Verascore-link state (tracked separately via audit log).
|
|
1513
|
+
*/
|
|
1514
|
+
interface L4AttestationSummary {
|
|
1515
|
+
/** Total number of attestations covered by the summary */
|
|
1516
|
+
attestation_count: number;
|
|
1517
|
+
/** Count of attestations at each sovereignty tier */
|
|
1518
|
+
tier_distribution: Record<SovereigntyTier, number>;
|
|
1519
|
+
/** ISO timestamp of the most recent attestation, or null if none */
|
|
1520
|
+
most_recent_attestation_at: string | null;
|
|
1521
|
+
/** Count of attestations with outcome_result === "disputed" */
|
|
1522
|
+
dispute_count: number;
|
|
1523
|
+
/** Count of attestations per context label */
|
|
1524
|
+
context_breakdown: Record<string, number>;
|
|
1525
|
+
}
|
|
1481
1526
|
/** Portable reputation bundle */
|
|
1482
1527
|
interface ReputationBundle {
|
|
1483
1528
|
version: "SANCTUARY_REP_V1";
|
|
@@ -1557,6 +1602,20 @@ declare class ReputationStore {
|
|
|
1557
1602
|
* Create a principal's guarantee for a new agent.
|
|
1558
1603
|
*/
|
|
1559
1604
|
createGuarantee(principalIdentity: StoredIdentity, agentDid: string, scope: string, durationSeconds: number, identityEncryptionKey: Uint8Array, maxLiability?: number): Promise<Guarantee>;
|
|
1605
|
+
/**
|
|
1606
|
+
* Summarize attestations for the L4 degradation emitter and dashboard widget.
|
|
1607
|
+
*
|
|
1608
|
+
* Returns aggregate evidence about the identity's reputation state —
|
|
1609
|
+
* counts, tier distribution, recency, dispute counts, context coverage —
|
|
1610
|
+
* without exposing raw attestations. The caller combines this with an
|
|
1611
|
+
* audit-log check for Verascore link state to produce the final
|
|
1612
|
+
* `L4Evidence` struct consumed by the SHR generator.
|
|
1613
|
+
*
|
|
1614
|
+
* @param participantDid - If provided, only count attestations where the
|
|
1615
|
+
* `participant_did` matches. If omitted, covers all attestations in the
|
|
1616
|
+
* store.
|
|
1617
|
+
*/
|
|
1618
|
+
summarizeForSHR(participantDid?: string): Promise<L4AttestationSummary>;
|
|
1560
1619
|
/**
|
|
1561
1620
|
* Load attestations for tier-weighted scoring.
|
|
1562
1621
|
* Applies basic context/counterparty filtering, returns full StoredAttestations
|
|
@@ -1567,6 +1626,11 @@ declare class ReputationStore {
|
|
|
1567
1626
|
counterparty_did?: string;
|
|
1568
1627
|
}): Promise<StoredAttestation[]>;
|
|
1569
1628
|
private loadAll;
|
|
1629
|
+
/**
|
|
1630
|
+
* Cursor-based async iterator that loads attestations in pages.
|
|
1631
|
+
* Prevents OOM at 100K+ records by reading and decrypting in batches.
|
|
1632
|
+
*/
|
|
1633
|
+
loadAllPaginated(pageSize?: number): AsyncGenerator<StoredAttestation[]>;
|
|
1570
1634
|
}
|
|
1571
1635
|
|
|
1572
1636
|
/**
|
|
@@ -2664,12 +2728,56 @@ declare function loadPrincipalPolicy(storagePath: string): Promise<PrincipalPoli
|
|
|
2664
2728
|
* signs it with a specified identity, and returns the complete signed SHR.
|
|
2665
2729
|
*/
|
|
2666
2730
|
|
|
2731
|
+
/**
|
|
2732
|
+
* Observed L4 reputation state used by the emitter. Callers gather these
|
|
2733
|
+
* facts from the reputation store + audit log; the emitter derives
|
|
2734
|
+
* degradations from them. Keeping evidence as plain data keeps the
|
|
2735
|
+
* generator synchronous and easy to test.
|
|
2736
|
+
*/
|
|
2737
|
+
interface L4Evidence {
|
|
2738
|
+
/** Total attestations attributed to the signing identity */
|
|
2739
|
+
attestation_count: number;
|
|
2740
|
+
/** Count of attestations at each sovereignty tier */
|
|
2741
|
+
tier_distribution: Record<SovereigntyTier, number>;
|
|
2742
|
+
/** ISO timestamp of most recent attestation, or null when none exist */
|
|
2743
|
+
most_recent_attestation_at: string | null;
|
|
2744
|
+
/** Count of attestations with outcome_result === "disputed" */
|
|
2745
|
+
dispute_count: number;
|
|
2746
|
+
/** Attestation count per context label (optional; used by dashboard) */
|
|
2747
|
+
context_breakdown?: Record<string, number>;
|
|
2748
|
+
/**
|
|
2749
|
+
* True iff the `reputation_publish` tool has been successfully invoked
|
|
2750
|
+
* for this identity (i.e., there is at least one success audit entry).
|
|
2751
|
+
*/
|
|
2752
|
+
verascore_linked: boolean;
|
|
2753
|
+
/**
|
|
2754
|
+
* Optional overrides for the emitter thresholds. Defaults apply when
|
|
2755
|
+
* omitted or when a field is missing.
|
|
2756
|
+
*/
|
|
2757
|
+
thresholds?: {
|
|
2758
|
+
freshness_window_days?: number;
|
|
2759
|
+
low_tier_dominance_threshold?: number;
|
|
2760
|
+
};
|
|
2761
|
+
}
|
|
2667
2762
|
interface SHRGeneratorOptions {
|
|
2668
2763
|
config: SanctuaryConfig;
|
|
2669
2764
|
identityManager: IdentityManager;
|
|
2670
2765
|
masterKey: Uint8Array;
|
|
2671
2766
|
/** Override validity window (milliseconds). Default: 1 hour. */
|
|
2672
2767
|
validityMs?: number;
|
|
2768
|
+
/**
|
|
2769
|
+
* Optional L4 reputation evidence. When provided, the generator emits
|
|
2770
|
+
* L4 degradations (NO_REPUTATION_HISTORY, LOW_TIER_DOMINANCE,
|
|
2771
|
+
* STALE_REPUTATION, DISPUTE_ON_RECORD, NO_VERASCORE_LINK) accordingly
|
|
2772
|
+
* and downgrades `layers.l4.status` to `degraded` when any fire.
|
|
2773
|
+
* When omitted, L4 is left at "active" (backward-compatible).
|
|
2774
|
+
*/
|
|
2775
|
+
l4Evidence?: L4Evidence;
|
|
2776
|
+
/**
|
|
2777
|
+
* Clock override for deterministic testing of staleness behavior.
|
|
2778
|
+
* Defaults to the current wall clock.
|
|
2779
|
+
*/
|
|
2780
|
+
now?: Date;
|
|
2673
2781
|
}
|
|
2674
2782
|
/**
|
|
2675
2783
|
* Generate and sign a Sovereignty Health Report.
|
|
@@ -3364,6 +3472,279 @@ declare function createBridgeCommitment(outcome: ConcordiaOutcome, identity: Sto
|
|
|
3364
3472
|
*/
|
|
3365
3473
|
declare function verifyBridgeCommitment(commitment: BridgeCommitment, outcome: ConcordiaOutcome, committerPublicKey: Uint8Array): BridgeVerificationResult;
|
|
3366
3474
|
|
|
3475
|
+
/**
|
|
3476
|
+
* Sanctuary Dashboard — Protection Snapshot Aggregator
|
|
3477
|
+
*
|
|
3478
|
+
* Pulls unified protection state from the existing subsystems
|
|
3479
|
+
* (IdentityManager, AuditLog, ClientManager, BaselineTracker, policy)
|
|
3480
|
+
* and returns a single typed snapshot consumed by the API + HTML.
|
|
3481
|
+
*
|
|
3482
|
+
* The aggregator is the single source of truth for dashboard state.
|
|
3483
|
+
* It is pure (no I/O beyond what the injected sources already do) and
|
|
3484
|
+
* safe to call repeatedly — callers control freshness.
|
|
3485
|
+
*/
|
|
3486
|
+
|
|
3487
|
+
type LayerState = "full" | "degraded" | "compromised";
|
|
3488
|
+
type OverallStatus = "healthy" | "degraded" | "compromised";
|
|
3489
|
+
interface AgentInfo {
|
|
3490
|
+
display_name: string;
|
|
3491
|
+
did: string | null;
|
|
3492
|
+
did_fingerprint: string | null;
|
|
3493
|
+
identity_count: number;
|
|
3494
|
+
primary_identity_id: string | null;
|
|
3495
|
+
}
|
|
3496
|
+
interface L1Status {
|
|
3497
|
+
label: string;
|
|
3498
|
+
state: LayerState;
|
|
3499
|
+
headline: string;
|
|
3500
|
+
encryption: string;
|
|
3501
|
+
injection_blocked_today: number;
|
|
3502
|
+
memory_attest_ready: boolean;
|
|
3503
|
+
}
|
|
3504
|
+
interface L2Status {
|
|
3505
|
+
label: string;
|
|
3506
|
+
state: LayerState;
|
|
3507
|
+
headline: string;
|
|
3508
|
+
isolation_type: string;
|
|
3509
|
+
tee_available: boolean;
|
|
3510
|
+
tee_status: string;
|
|
3511
|
+
sandbox_status: string;
|
|
3512
|
+
}
|
|
3513
|
+
interface L3Status {
|
|
3514
|
+
label: string;
|
|
3515
|
+
state: LayerState;
|
|
3516
|
+
headline: string;
|
|
3517
|
+
did_active: boolean;
|
|
3518
|
+
vc_count: number;
|
|
3519
|
+
proofs_today: number;
|
|
3520
|
+
}
|
|
3521
|
+
/** A single L4 degradation surfaced to the dashboard widget. */
|
|
3522
|
+
interface L4ActiveDegradation {
|
|
3523
|
+
code: string;
|
|
3524
|
+
severity: "info" | "warning" | "critical";
|
|
3525
|
+
description: string;
|
|
3526
|
+
mitigation?: string;
|
|
3527
|
+
}
|
|
3528
|
+
interface L4Status {
|
|
3529
|
+
label: string;
|
|
3530
|
+
state: LayerState;
|
|
3531
|
+
headline: string;
|
|
3532
|
+
score: number | null;
|
|
3533
|
+
profile_url: string | null;
|
|
3534
|
+
claim_cta: string | null;
|
|
3535
|
+
/**
|
|
3536
|
+
* Evidence surfaced under the L4 tile so users can tell what underlies
|
|
3537
|
+
* the reputation state. Null when no reputation store is wired in
|
|
3538
|
+
* (standalone mode, some tests).
|
|
3539
|
+
*/
|
|
3540
|
+
evidence?: {
|
|
3541
|
+
attestation_count: number;
|
|
3542
|
+
tier_distribution: Record<SovereigntyTier, number>;
|
|
3543
|
+
most_recent_attestation_at: string | null;
|
|
3544
|
+
dispute_count: number;
|
|
3545
|
+
context_breakdown: Record<string, number>;
|
|
3546
|
+
verascore_linked: boolean;
|
|
3547
|
+
};
|
|
3548
|
+
/**
|
|
3549
|
+
* SHR-aligned L4 layer score (0-100) when evidence is available.
|
|
3550
|
+
* Computed with the same scoring model the gateway adapter uses so
|
|
3551
|
+
* counterparties and the dashboard agree on the number.
|
|
3552
|
+
*/
|
|
3553
|
+
layer_score?: number;
|
|
3554
|
+
/** Active L4 degradations rendered under the widget. */
|
|
3555
|
+
active_degradations?: L4ActiveDegradation[];
|
|
3556
|
+
}
|
|
3557
|
+
interface ActivityEntry {
|
|
3558
|
+
timestamp: string;
|
|
3559
|
+
tool: string;
|
|
3560
|
+
server: string;
|
|
3561
|
+
tier: 1 | 2 | 3;
|
|
3562
|
+
result: "allowed" | "denied" | "approved" | "pending";
|
|
3563
|
+
}
|
|
3564
|
+
interface PendingApproval {
|
|
3565
|
+
id: string;
|
|
3566
|
+
operation: string;
|
|
3567
|
+
tier: 1 | 2;
|
|
3568
|
+
reason: string;
|
|
3569
|
+
created_at: string;
|
|
3570
|
+
}
|
|
3571
|
+
interface UpstreamServerStatus {
|
|
3572
|
+
name: string;
|
|
3573
|
+
state: string;
|
|
3574
|
+
tool_count: number;
|
|
3575
|
+
error?: string;
|
|
3576
|
+
}
|
|
3577
|
+
interface ProtectionSnapshot {
|
|
3578
|
+
overall: {
|
|
3579
|
+
status: OverallStatus;
|
|
3580
|
+
light: "green" | "yellow" | "red";
|
|
3581
|
+
headline: string;
|
|
3582
|
+
};
|
|
3583
|
+
agent: AgentInfo;
|
|
3584
|
+
layers: {
|
|
3585
|
+
l1: L1Status;
|
|
3586
|
+
l2: L2Status;
|
|
3587
|
+
l3: L3Status;
|
|
3588
|
+
l4: L4Status;
|
|
3589
|
+
};
|
|
3590
|
+
activity: ActivityEntry[];
|
|
3591
|
+
pending_approvals: PendingApproval[];
|
|
3592
|
+
audit: AuditEntry[];
|
|
3593
|
+
upstream_servers: UpstreamServerStatus[];
|
|
3594
|
+
mode: "co-located" | "standalone";
|
|
3595
|
+
server_version: string;
|
|
3596
|
+
generated_at: string;
|
|
3597
|
+
}
|
|
3598
|
+
interface ReputationLookup {
|
|
3599
|
+
score: number | null;
|
|
3600
|
+
profile_url: string | null;
|
|
3601
|
+
}
|
|
3602
|
+
interface AggregatorSources {
|
|
3603
|
+
mode: "co-located" | "standalone";
|
|
3604
|
+
server_version: string;
|
|
3605
|
+
identityManager?: IdentityManager;
|
|
3606
|
+
auditLog?: AuditLog;
|
|
3607
|
+
clientManager?: ClientManager;
|
|
3608
|
+
baseline?: BaselineTracker;
|
|
3609
|
+
policy?: PrincipalPolicy;
|
|
3610
|
+
activity?: ActivityEntry[];
|
|
3611
|
+
pendingApprovals?: PendingApproval[];
|
|
3612
|
+
reputation?: ReputationLookup;
|
|
3613
|
+
teeAvailable?: boolean;
|
|
3614
|
+
/**
|
|
3615
|
+
* Pre-computed L4 reputation evidence for the primary identity. When
|
|
3616
|
+
* present the dashboard renders the evidence widget under the L4 tile
|
|
3617
|
+
* and computes an SHR-aligned L4 layer score. Providers build this
|
|
3618
|
+
* via `gatherL4Evidence` from `shr/tools.ts`.
|
|
3619
|
+
*/
|
|
3620
|
+
l4Evidence?: L4Evidence;
|
|
3621
|
+
/** Clock override for deterministic staleness rendering in tests. */
|
|
3622
|
+
l4Now?: Date;
|
|
3623
|
+
}
|
|
3624
|
+
/**
|
|
3625
|
+
* Pull a unified protection snapshot from the injected sources.
|
|
3626
|
+
*
|
|
3627
|
+
* Any missing source degrades gracefully — standalone mode may have
|
|
3628
|
+
* no ClientManager or live activity feed, for example, and the
|
|
3629
|
+
* aggregator returns a coherent snapshot with empty arrays rather
|
|
3630
|
+
* than throwing.
|
|
3631
|
+
*/
|
|
3632
|
+
declare function getProtectionSnapshot(sources: AggregatorSources): Promise<ProtectionSnapshot>;
|
|
3633
|
+
|
|
3634
|
+
/**
|
|
3635
|
+
* Sanctuary Dashboard — HTTP API + SSE
|
|
3636
|
+
*
|
|
3637
|
+
* Request router for the unified dashboard. Pure functions that
|
|
3638
|
+
* take a request + sources and produce a response so the transport
|
|
3639
|
+
* layer (node:http) and tests can exercise the same code paths.
|
|
3640
|
+
*/
|
|
3641
|
+
|
|
3642
|
+
interface ApprovalHandlers {
|
|
3643
|
+
allow: (id: string) => Promise<boolean>;
|
|
3644
|
+
deny: (id: string) => Promise<boolean>;
|
|
3645
|
+
}
|
|
3646
|
+
interface StreamEvent {
|
|
3647
|
+
type: "snapshot" | "activity" | "approval";
|
|
3648
|
+
data: unknown;
|
|
3649
|
+
}
|
|
3650
|
+
|
|
3651
|
+
/**
|
|
3652
|
+
* Sanctuary Dashboard — HTTP Server
|
|
3653
|
+
*
|
|
3654
|
+
* Thin wrapper around node:http that wires the request handler
|
|
3655
|
+
* from api.ts. No Express. Listens on 127.0.0.1 by default.
|
|
3656
|
+
*
|
|
3657
|
+
* Exposes a minimal event emitter (publish / subscribe) so callers
|
|
3658
|
+
* can push live activity + approval events to SSE clients without
|
|
3659
|
+
* the server layer needing to know about aggregator internals.
|
|
3660
|
+
*/
|
|
3661
|
+
|
|
3662
|
+
interface DashboardServerOptions {
|
|
3663
|
+
port?: number;
|
|
3664
|
+
host?: string;
|
|
3665
|
+
authToken?: string;
|
|
3666
|
+
mode: "co-located" | "standalone";
|
|
3667
|
+
sources: AggregatorSources;
|
|
3668
|
+
approvals?: ApprovalHandlers;
|
|
3669
|
+
}
|
|
3670
|
+
interface DashboardHandle {
|
|
3671
|
+
url: string;
|
|
3672
|
+
port: number;
|
|
3673
|
+
host: string;
|
|
3674
|
+
stop: () => Promise<void>;
|
|
3675
|
+
/** Push an event to all connected SSE clients. */
|
|
3676
|
+
publish: (event: StreamEvent) => void;
|
|
3677
|
+
/**
|
|
3678
|
+
* Push a fresh activity entry. Exposes a simple shortcut so callers
|
|
3679
|
+
* (e.g. the Sanctuary proxy / upstream clients) can report tool calls
|
|
3680
|
+
* without constructing a StreamEvent themselves.
|
|
3681
|
+
*/
|
|
3682
|
+
publishActivity: (entry: ActivityEntry) => void;
|
|
3683
|
+
/** Push a new pending approval (already added by the approval channel). */
|
|
3684
|
+
publishApproval: (approval: PendingApproval) => void;
|
|
3685
|
+
}
|
|
3686
|
+
declare function startDashboardServer(options: DashboardServerOptions): Promise<DashboardHandle>;
|
|
3687
|
+
|
|
3688
|
+
/**
|
|
3689
|
+
* Sanctuary Dashboard — Single-Page HTML
|
|
3690
|
+
*
|
|
3691
|
+
* Hero shield + four layer cards + live activity feed + approval queue +
|
|
3692
|
+
* audit trail. Vanilla HTML/CSS/JS in one string, matching the convention
|
|
3693
|
+
* established by server/src/cocoon/fortress-view.ts.
|
|
3694
|
+
*
|
|
3695
|
+
* The initial snapshot is embedded server-side so the page renders
|
|
3696
|
+
* correctly without JavaScript. Live updates layer on via SSE + REST.
|
|
3697
|
+
*/
|
|
3698
|
+
|
|
3699
|
+
/** Hero copy. Change here if we ever A/B test. */
|
|
3700
|
+
declare const HERO_COPY = "Your agent is protected.";
|
|
3701
|
+
interface DashboardHTMLOptions {
|
|
3702
|
+
snapshot: ProtectionSnapshot;
|
|
3703
|
+
authToken?: string;
|
|
3704
|
+
}
|
|
3705
|
+
declare function renderDashboardHTML(options: DashboardHTMLOptions): string;
|
|
3706
|
+
|
|
3707
|
+
/**
|
|
3708
|
+
* Sanctuary Sovereignty Dashboard — public surface.
|
|
3709
|
+
*
|
|
3710
|
+
* Consumers import `startDashboard` to bring up the hero-shield UI
|
|
3711
|
+
* on port 3501 (default). The rest of the exports are types + utilities
|
|
3712
|
+
* for tests and callers that want to wire in live events.
|
|
3713
|
+
*/
|
|
3714
|
+
|
|
3715
|
+
interface StartDashboardOptions {
|
|
3716
|
+
port?: number;
|
|
3717
|
+
host?: string;
|
|
3718
|
+
authToken?: string;
|
|
3719
|
+
mode: "co-located" | "standalone";
|
|
3720
|
+
serverVersion: string;
|
|
3721
|
+
auditLog?: AuditLog;
|
|
3722
|
+
identityManager?: IdentityManager;
|
|
3723
|
+
clientManager?: ClientManager;
|
|
3724
|
+
baseline?: BaselineTracker;
|
|
3725
|
+
policy?: PrincipalPolicy;
|
|
3726
|
+
reputation?: ReputationLookup;
|
|
3727
|
+
teeAvailable?: boolean;
|
|
3728
|
+
approvals?: ApprovalHandlers;
|
|
3729
|
+
/** Seed activity entries (most recent first). Runtime entries arrive via publishActivity. */
|
|
3730
|
+
initialActivity?: ActivityEntry[];
|
|
3731
|
+
/** Seed pending approvals. Runtime approvals arrive via publishApproval. */
|
|
3732
|
+
initialPendingApprovals?: PendingApproval[];
|
|
3733
|
+
/**
|
|
3734
|
+
* Pre-computed L4 reputation evidence. When provided the dashboard
|
|
3735
|
+
* renders the L4 evidence widget (attestation count, tier distribution,
|
|
3736
|
+
* disputes, freshness, active degradations). Typically supplied by the
|
|
3737
|
+
* server after L4 tools are constructed.
|
|
3738
|
+
*/
|
|
3739
|
+
l4Evidence?: L4Evidence;
|
|
3740
|
+
}
|
|
3741
|
+
/**
|
|
3742
|
+
* High-level entry point used by callers (CLI, standalone service).
|
|
3743
|
+
* Returns a DashboardHandle that exposes `stop()` and `publish*`
|
|
3744
|
+
* helpers for driving live updates.
|
|
3745
|
+
*/
|
|
3746
|
+
declare function startDashboard(options: StartDashboardOptions): Promise<DashboardHandle>;
|
|
3747
|
+
|
|
3367
3748
|
/**
|
|
3368
3749
|
* Sanctuary MCP Server — Main Entry Point
|
|
3369
3750
|
*
|
|
@@ -3397,4 +3778,4 @@ declare function createSanctuaryServer(options?: {
|
|
|
3397
3778
|
storage?: StorageBackend;
|
|
3398
3779
|
}): Promise<SanctuaryServer>;
|
|
3399
3780
|
|
|
3400
|
-
export { ATTESTATION_VERSION, ApprovalGate, type AttestationBody, type AttestationVerificationResult, AuditLog, AutoApproveChannel, BaselineTracker, type BridgeAttestationRequest, type BridgeAttestationResult, type BridgeCommitment, type BridgeVerificationResult, TEMPLATES as CONTEXT_GATE_TEMPLATES, CallbackApprovalChannel, ClientManager, CommitmentStore, type ConcordiaOutcome, type ConnectionState, type ContextAction, type ContextFilterResult, ContextGateEnforcer, type ContextGatePolicy, ContextGatePolicyStore, type ContextGateRule, type ContextGateTemplate, DashboardApprovalChannel, type DashboardConfig, type DetectionResult, type EnforcerConfig, type FederationCapabilities, type FederationPeer, FederationRegistry, type FieldClassification, type FieldFilterResult, FilesystemStorage, type GateResult, type HandshakeChallenge, type HandshakeCompletion, type HandshakeResponse, type HandshakeResult, InMemoryModelProvenanceStore, InjectionDetector, type InjectionDetectorConfig, type InjectionSignal, MODEL_PRESETS, MemoryStorage, type ModelProvenance, type ModelProvenanceStore, type PedersenCommitment, type PeerTrustEvaluation, type PolicyRecommendation, PolicyStore, type PrincipalPolicy, type ProviderCategory, ProxyRouter, type ProxyRouterOptions, ReputationStore, type SHRBody, type SHRGeneratorOptions, type SHRVerificationResult, type SanctuaryConfig, type SanctuaryServer, type SignedAttestation, type SignedSHR, type SovereigntyProfile, SovereigntyProfileStore, type SovereigntyProfileUpdate, type SovereigntyTier, StateStore, StderrApprovalChannel, TIER_WEIGHTS, type TierMetadata, type TieredAttestation, type UpstreamConnection, type UpstreamServer, type UpstreamTool, WebhookApprovalChannel, type WebhookCallbackPayload, type WebhookConfig, type WebhookPayload, type ZKProofOfKnowledge, type ZKRangeProof, canonicalize, classifyField, completeHandshake, computeWeightedScore, createBridgeCommitment, createDefaultProfile, createPedersenCommitment, createProofOfKnowledge, createRangeProof, createSanctuaryServer, evaluateField, filterContext, generateAttestation, generateSHR, generateSystemPrompt, getTemplate, initiateHandshake, listTemplateIds, loadConfig, loadPrincipalPolicy, recommendPolicy, resolveTier, respondToHandshake, signPayload, tierDistribution, verifyAttestation, verifyBridgeCommitment, verifyCompletion, verifyPedersenCommitment, verifyProofOfKnowledge, verifyRangeProof, verifySHR, verifySignature };
|
|
3781
|
+
export { ATTESTATION_VERSION, type ActivityEntry, type AggregatorSources, ApprovalGate, type ApprovalHandlers, type AttestationBody, type AttestationVerificationResult, AuditLog, AutoApproveChannel, BaselineTracker, type BridgeAttestationRequest, type BridgeAttestationResult, type BridgeCommitment, type BridgeVerificationResult, TEMPLATES as CONTEXT_GATE_TEMPLATES, CallbackApprovalChannel, ClientManager, CommitmentStore, type ConcordiaOutcome, type ConnectionState, type ContextAction, type ContextFilterResult, ContextGateEnforcer, type ContextGatePolicy, ContextGatePolicyStore, type ContextGateRule, type ContextGateTemplate, DashboardApprovalChannel, type DashboardConfig, type DashboardHandle, type DashboardServerOptions, type DetectionResult, type EnforcerConfig, type FederationCapabilities, type FederationPeer, FederationRegistry, type FieldClassification, type FieldFilterResult, FilesystemStorage, type GateResult, HERO_COPY, type HandshakeChallenge, type HandshakeCompletion, type HandshakeResponse, type HandshakeResult, InMemoryModelProvenanceStore, InjectionDetector, type InjectionDetectorConfig, type InjectionSignal, type L1Status, type L2Status, type L3Status, type L4Status, MODEL_PRESETS, MemoryStorage, type ModelProvenance, type ModelProvenanceStore, type PedersenCommitment, type PeerTrustEvaluation, type PendingApproval, type PolicyRecommendation, PolicyStore, type PrincipalPolicy, type ProtectionSnapshot, type ProviderCategory, ProxyRouter, type ProxyRouterOptions, type ReputationLookup, ReputationStore, type SHRBody, type SHRGeneratorOptions, type SHRVerificationResult, type SanctuaryConfig, type SanctuaryServer, type SignedAttestation, type SignedSHR, type SovereigntyProfile, SovereigntyProfileStore, type SovereigntyProfileUpdate, type SovereigntyTier, type StartDashboardOptions, StateStore, StderrApprovalChannel, type StreamEvent, TIER_WEIGHTS, type TierMetadata, type TieredAttestation, type UpstreamConnection, type UpstreamServer, type UpstreamTool, WebhookApprovalChannel, type WebhookCallbackPayload, type WebhookConfig, type WebhookPayload, type ZKProofOfKnowledge, type ZKRangeProof, canonicalize, classifyField, completeHandshake, computeWeightedScore, createBridgeCommitment, createDefaultProfile, createPedersenCommitment, createProofOfKnowledge, createRangeProof, createSanctuaryServer, evaluateField, filterContext, generateAttestation, generateSHR, generateSystemPrompt, getProtectionSnapshot, getTemplate, initiateHandshake, listTemplateIds, loadConfig, loadPrincipalPolicy, recommendPolicy, renderDashboardHTML, resolveTier, respondToHandshake, signPayload, startDashboard, startDashboardServer, tierDistribution, verifyAttestation, verifyBridgeCommitment, verifyCompletion, verifyPedersenCommitment, verifyProofOfKnowledge, verifyRangeProof, verifySHR, verifySignature };
|