@sanctuary-framework/mcp-server 0.5.16 → 0.7.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 +2526 -340
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +2527 -341
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +2070 -341
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +51 -7
- package/dist/index.d.ts +51 -7
- package/dist/index.js +2070 -341
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -60,6 +60,15 @@ interface SanctuaryConfig {
|
|
|
60
60
|
/** Host for callback listener */
|
|
61
61
|
callback_host: string;
|
|
62
62
|
};
|
|
63
|
+
/** Verascore integration (agent reputation surface) */
|
|
64
|
+
verascore: {
|
|
65
|
+
/** Base URL of the Verascore deployment. */
|
|
66
|
+
url: string;
|
|
67
|
+
/** Whether to auto-publish handshake attestations to Verascore. */
|
|
68
|
+
auto_publish_to_verascore: boolean;
|
|
69
|
+
/** Whether to auto-publish on successful handshake_respond calls. */
|
|
70
|
+
auto_publish_handshakes: boolean;
|
|
71
|
+
};
|
|
63
72
|
}
|
|
64
73
|
/**
|
|
65
74
|
* Load configuration from file, falling back to defaults.
|
|
@@ -1525,7 +1534,7 @@ declare class InjectionDetector {
|
|
|
1525
1534
|
constructor(config?: Partial<InjectionDetectorConfig>);
|
|
1526
1535
|
/**
|
|
1527
1536
|
* Scan tool arguments for injection signals.
|
|
1528
|
-
* @param toolName Full tool name (e.g., "
|
|
1537
|
+
* @param toolName Full tool name (e.g., "state_read")
|
|
1529
1538
|
* @param args Tool arguments
|
|
1530
1539
|
* @returns DetectionResult with all detected signals
|
|
1531
1540
|
*/
|
|
@@ -1944,7 +1953,7 @@ declare class ApprovalGate {
|
|
|
1944
1953
|
/**
|
|
1945
1954
|
* Evaluate a tool call against the Principal Policy.
|
|
1946
1955
|
*
|
|
1947
|
-
* @param toolName - Full MCP tool name (e.g., "
|
|
1956
|
+
* @param toolName - Full MCP tool name (e.g., "state_export")
|
|
1948
1957
|
* @param args - Tool call arguments (for context extraction)
|
|
1949
1958
|
* @returns GateResult indicating whether the call is allowed
|
|
1950
1959
|
*/
|
|
@@ -2019,7 +2028,7 @@ interface EnforcerConfig {
|
|
|
2019
2028
|
enabled: boolean;
|
|
2020
2029
|
/** Policy ID to use when no specific one is set */
|
|
2021
2030
|
default_policy_id?: string;
|
|
2022
|
-
/** Tool name prefixes to skip filtering (e.g., ["
|
|
2031
|
+
/** Tool name prefixes to skip filtering (e.g., ["*"] to skip all system tools) */
|
|
2023
2032
|
bypass_prefixes: string[];
|
|
2024
2033
|
/** Log but don't filter — for gradual rollout (default: false) */
|
|
2025
2034
|
log_only: boolean;
|
|
@@ -2074,10 +2083,13 @@ declare class ContextGateEnforcer {
|
|
|
2074
2083
|
* Check if a tool should be filtered based on bypass prefixes.
|
|
2075
2084
|
*
|
|
2076
2085
|
* SEC-033: Uses exact namespace component matching, not bare startsWith().
|
|
2077
|
-
* A prefix of "
|
|
2078
|
-
*
|
|
2079
|
-
*
|
|
2080
|
-
*
|
|
2086
|
+
* A prefix of "proxy/" matches "proxy/server/tool" but NOT "proxyevil/steal".
|
|
2087
|
+
* The prefix must match exactly up to its length, and the prefix must end
|
|
2088
|
+
* with "/" to enforce namespace boundaries (if it doesn't, we add one).
|
|
2089
|
+
*
|
|
2090
|
+
* Special sentinel: "*" bypasses ALL tools (used when all Sanctuary-internal
|
|
2091
|
+
* tools should skip context gating — the default). Only proxy/external tools
|
|
2092
|
+
* should be filtered in production.
|
|
2081
2093
|
*/
|
|
2082
2094
|
shouldFilter(toolName: string): boolean;
|
|
2083
2095
|
/**
|
|
@@ -2472,6 +2484,15 @@ interface ProxyRouterOptions {
|
|
|
2472
2484
|
contextGateFilter?: (toolName: string, args: Record<string, unknown>) => Promise<Record<string, unknown>>;
|
|
2473
2485
|
/** Optional call governor for runtime governance */
|
|
2474
2486
|
governor?: CallGovernor;
|
|
2487
|
+
/** Optional callback after each proxy call decision (for dashboard feed) */
|
|
2488
|
+
onProxyCall?: (data: {
|
|
2489
|
+
tool: string;
|
|
2490
|
+
server: string;
|
|
2491
|
+
decision: string;
|
|
2492
|
+
reason?: string;
|
|
2493
|
+
tier?: number;
|
|
2494
|
+
timestamp: string;
|
|
2495
|
+
}) => void;
|
|
2475
2496
|
}
|
|
2476
2497
|
declare class ProxyRouter {
|
|
2477
2498
|
private clientManager;
|
|
@@ -2502,6 +2523,10 @@ declare class ProxyRouter {
|
|
|
2502
2523
|
* The handler runs the full enforcement chain before forwarding.
|
|
2503
2524
|
*/
|
|
2504
2525
|
private createHandler;
|
|
2526
|
+
/**
|
|
2527
|
+
* Notify the onProxyCall callback if configured.
|
|
2528
|
+
*/
|
|
2529
|
+
private notifyProxyCall;
|
|
2505
2530
|
/**
|
|
2506
2531
|
* Call an upstream tool with a timeout.
|
|
2507
2532
|
*/
|
|
@@ -2701,6 +2726,7 @@ declare class DashboardApprovalChannel implements ApprovalChannel {
|
|
|
2701
2726
|
private profileStore;
|
|
2702
2727
|
private clientManager;
|
|
2703
2728
|
private dashboardHTML;
|
|
2729
|
+
private fortressHTML;
|
|
2704
2730
|
private loginHTML;
|
|
2705
2731
|
private authToken;
|
|
2706
2732
|
private useTLS;
|
|
@@ -2806,6 +2832,24 @@ declare class DashboardApprovalChannel implements ApprovalChannel {
|
|
|
2806
2832
|
private handleSessionExchange;
|
|
2807
2833
|
private serveLoginPage;
|
|
2808
2834
|
private serveDashboard;
|
|
2835
|
+
private serveFortressView;
|
|
2836
|
+
/**
|
|
2837
|
+
* Enable Fortress View (Cocoon mode) with the given upstream server count.
|
|
2838
|
+
* Once enabled, the root path `/` serves the Fortress View instead of the
|
|
2839
|
+
* standard dashboard. The standard dashboard remains available at `/dashboard`.
|
|
2840
|
+
*/
|
|
2841
|
+
enableFortressView(upstreamServerCount: number): void;
|
|
2842
|
+
/**
|
|
2843
|
+
* Broadcast a proxy call event to connected dashboards (Fortress View feed).
|
|
2844
|
+
*/
|
|
2845
|
+
broadcastProxyCall(data: {
|
|
2846
|
+
tool: string;
|
|
2847
|
+
server: string;
|
|
2848
|
+
decision: string;
|
|
2849
|
+
reason?: string;
|
|
2850
|
+
tier?: number;
|
|
2851
|
+
timestamp: string;
|
|
2852
|
+
}): void;
|
|
2809
2853
|
private handleSSE;
|
|
2810
2854
|
private handleStatus;
|
|
2811
2855
|
private handlePendingList;
|
package/dist/index.d.ts
CHANGED
|
@@ -60,6 +60,15 @@ interface SanctuaryConfig {
|
|
|
60
60
|
/** Host for callback listener */
|
|
61
61
|
callback_host: string;
|
|
62
62
|
};
|
|
63
|
+
/** Verascore integration (agent reputation surface) */
|
|
64
|
+
verascore: {
|
|
65
|
+
/** Base URL of the Verascore deployment. */
|
|
66
|
+
url: string;
|
|
67
|
+
/** Whether to auto-publish handshake attestations to Verascore. */
|
|
68
|
+
auto_publish_to_verascore: boolean;
|
|
69
|
+
/** Whether to auto-publish on successful handshake_respond calls. */
|
|
70
|
+
auto_publish_handshakes: boolean;
|
|
71
|
+
};
|
|
63
72
|
}
|
|
64
73
|
/**
|
|
65
74
|
* Load configuration from file, falling back to defaults.
|
|
@@ -1525,7 +1534,7 @@ declare class InjectionDetector {
|
|
|
1525
1534
|
constructor(config?: Partial<InjectionDetectorConfig>);
|
|
1526
1535
|
/**
|
|
1527
1536
|
* Scan tool arguments for injection signals.
|
|
1528
|
-
* @param toolName Full tool name (e.g., "
|
|
1537
|
+
* @param toolName Full tool name (e.g., "state_read")
|
|
1529
1538
|
* @param args Tool arguments
|
|
1530
1539
|
* @returns DetectionResult with all detected signals
|
|
1531
1540
|
*/
|
|
@@ -1944,7 +1953,7 @@ declare class ApprovalGate {
|
|
|
1944
1953
|
/**
|
|
1945
1954
|
* Evaluate a tool call against the Principal Policy.
|
|
1946
1955
|
*
|
|
1947
|
-
* @param toolName - Full MCP tool name (e.g., "
|
|
1956
|
+
* @param toolName - Full MCP tool name (e.g., "state_export")
|
|
1948
1957
|
* @param args - Tool call arguments (for context extraction)
|
|
1949
1958
|
* @returns GateResult indicating whether the call is allowed
|
|
1950
1959
|
*/
|
|
@@ -2019,7 +2028,7 @@ interface EnforcerConfig {
|
|
|
2019
2028
|
enabled: boolean;
|
|
2020
2029
|
/** Policy ID to use when no specific one is set */
|
|
2021
2030
|
default_policy_id?: string;
|
|
2022
|
-
/** Tool name prefixes to skip filtering (e.g., ["
|
|
2031
|
+
/** Tool name prefixes to skip filtering (e.g., ["*"] to skip all system tools) */
|
|
2023
2032
|
bypass_prefixes: string[];
|
|
2024
2033
|
/** Log but don't filter — for gradual rollout (default: false) */
|
|
2025
2034
|
log_only: boolean;
|
|
@@ -2074,10 +2083,13 @@ declare class ContextGateEnforcer {
|
|
|
2074
2083
|
* Check if a tool should be filtered based on bypass prefixes.
|
|
2075
2084
|
*
|
|
2076
2085
|
* SEC-033: Uses exact namespace component matching, not bare startsWith().
|
|
2077
|
-
* A prefix of "
|
|
2078
|
-
*
|
|
2079
|
-
*
|
|
2080
|
-
*
|
|
2086
|
+
* A prefix of "proxy/" matches "proxy/server/tool" but NOT "proxyevil/steal".
|
|
2087
|
+
* The prefix must match exactly up to its length, and the prefix must end
|
|
2088
|
+
* with "/" to enforce namespace boundaries (if it doesn't, we add one).
|
|
2089
|
+
*
|
|
2090
|
+
* Special sentinel: "*" bypasses ALL tools (used when all Sanctuary-internal
|
|
2091
|
+
* tools should skip context gating — the default). Only proxy/external tools
|
|
2092
|
+
* should be filtered in production.
|
|
2081
2093
|
*/
|
|
2082
2094
|
shouldFilter(toolName: string): boolean;
|
|
2083
2095
|
/**
|
|
@@ -2472,6 +2484,15 @@ interface ProxyRouterOptions {
|
|
|
2472
2484
|
contextGateFilter?: (toolName: string, args: Record<string, unknown>) => Promise<Record<string, unknown>>;
|
|
2473
2485
|
/** Optional call governor for runtime governance */
|
|
2474
2486
|
governor?: CallGovernor;
|
|
2487
|
+
/** Optional callback after each proxy call decision (for dashboard feed) */
|
|
2488
|
+
onProxyCall?: (data: {
|
|
2489
|
+
tool: string;
|
|
2490
|
+
server: string;
|
|
2491
|
+
decision: string;
|
|
2492
|
+
reason?: string;
|
|
2493
|
+
tier?: number;
|
|
2494
|
+
timestamp: string;
|
|
2495
|
+
}) => void;
|
|
2475
2496
|
}
|
|
2476
2497
|
declare class ProxyRouter {
|
|
2477
2498
|
private clientManager;
|
|
@@ -2502,6 +2523,10 @@ declare class ProxyRouter {
|
|
|
2502
2523
|
* The handler runs the full enforcement chain before forwarding.
|
|
2503
2524
|
*/
|
|
2504
2525
|
private createHandler;
|
|
2526
|
+
/**
|
|
2527
|
+
* Notify the onProxyCall callback if configured.
|
|
2528
|
+
*/
|
|
2529
|
+
private notifyProxyCall;
|
|
2505
2530
|
/**
|
|
2506
2531
|
* Call an upstream tool with a timeout.
|
|
2507
2532
|
*/
|
|
@@ -2701,6 +2726,7 @@ declare class DashboardApprovalChannel implements ApprovalChannel {
|
|
|
2701
2726
|
private profileStore;
|
|
2702
2727
|
private clientManager;
|
|
2703
2728
|
private dashboardHTML;
|
|
2729
|
+
private fortressHTML;
|
|
2704
2730
|
private loginHTML;
|
|
2705
2731
|
private authToken;
|
|
2706
2732
|
private useTLS;
|
|
@@ -2806,6 +2832,24 @@ declare class DashboardApprovalChannel implements ApprovalChannel {
|
|
|
2806
2832
|
private handleSessionExchange;
|
|
2807
2833
|
private serveLoginPage;
|
|
2808
2834
|
private serveDashboard;
|
|
2835
|
+
private serveFortressView;
|
|
2836
|
+
/**
|
|
2837
|
+
* Enable Fortress View (Cocoon mode) with the given upstream server count.
|
|
2838
|
+
* Once enabled, the root path `/` serves the Fortress View instead of the
|
|
2839
|
+
* standard dashboard. The standard dashboard remains available at `/dashboard`.
|
|
2840
|
+
*/
|
|
2841
|
+
enableFortressView(upstreamServerCount: number): void;
|
|
2842
|
+
/**
|
|
2843
|
+
* Broadcast a proxy call event to connected dashboards (Fortress View feed).
|
|
2844
|
+
*/
|
|
2845
|
+
broadcastProxyCall(data: {
|
|
2846
|
+
tool: string;
|
|
2847
|
+
server: string;
|
|
2848
|
+
decision: string;
|
|
2849
|
+
reason?: string;
|
|
2850
|
+
tier?: number;
|
|
2851
|
+
timestamp: string;
|
|
2852
|
+
}): void;
|
|
2809
2853
|
private handleSSE;
|
|
2810
2854
|
private handleStatus;
|
|
2811
2855
|
private handlePendingList;
|