@sanctuary-framework/mcp-server 0.6.1 → 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 +1733 -117
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +1734 -118
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +1278 -117
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +42 -7
- package/dist/index.d.ts +42 -7
- package/dist/index.js +1278 -117
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1534,7 +1534,7 @@ declare class InjectionDetector {
|
|
|
1534
1534
|
constructor(config?: Partial<InjectionDetectorConfig>);
|
|
1535
1535
|
/**
|
|
1536
1536
|
* Scan tool arguments for injection signals.
|
|
1537
|
-
* @param toolName Full tool name (e.g., "
|
|
1537
|
+
* @param toolName Full tool name (e.g., "state_read")
|
|
1538
1538
|
* @param args Tool arguments
|
|
1539
1539
|
* @returns DetectionResult with all detected signals
|
|
1540
1540
|
*/
|
|
@@ -1953,7 +1953,7 @@ declare class ApprovalGate {
|
|
|
1953
1953
|
/**
|
|
1954
1954
|
* Evaluate a tool call against the Principal Policy.
|
|
1955
1955
|
*
|
|
1956
|
-
* @param toolName - Full MCP tool name (e.g., "
|
|
1956
|
+
* @param toolName - Full MCP tool name (e.g., "state_export")
|
|
1957
1957
|
* @param args - Tool call arguments (for context extraction)
|
|
1958
1958
|
* @returns GateResult indicating whether the call is allowed
|
|
1959
1959
|
*/
|
|
@@ -2028,7 +2028,7 @@ interface EnforcerConfig {
|
|
|
2028
2028
|
enabled: boolean;
|
|
2029
2029
|
/** Policy ID to use when no specific one is set */
|
|
2030
2030
|
default_policy_id?: string;
|
|
2031
|
-
/** Tool name prefixes to skip filtering (e.g., ["
|
|
2031
|
+
/** Tool name prefixes to skip filtering (e.g., ["*"] to skip all system tools) */
|
|
2032
2032
|
bypass_prefixes: string[];
|
|
2033
2033
|
/** Log but don't filter — for gradual rollout (default: false) */
|
|
2034
2034
|
log_only: boolean;
|
|
@@ -2083,10 +2083,13 @@ declare class ContextGateEnforcer {
|
|
|
2083
2083
|
* Check if a tool should be filtered based on bypass prefixes.
|
|
2084
2084
|
*
|
|
2085
2085
|
* SEC-033: Uses exact namespace component matching, not bare startsWith().
|
|
2086
|
-
* A prefix of "
|
|
2087
|
-
*
|
|
2088
|
-
*
|
|
2089
|
-
*
|
|
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.
|
|
2090
2093
|
*/
|
|
2091
2094
|
shouldFilter(toolName: string): boolean;
|
|
2092
2095
|
/**
|
|
@@ -2481,6 +2484,15 @@ interface ProxyRouterOptions {
|
|
|
2481
2484
|
contextGateFilter?: (toolName: string, args: Record<string, unknown>) => Promise<Record<string, unknown>>;
|
|
2482
2485
|
/** Optional call governor for runtime governance */
|
|
2483
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;
|
|
2484
2496
|
}
|
|
2485
2497
|
declare class ProxyRouter {
|
|
2486
2498
|
private clientManager;
|
|
@@ -2511,6 +2523,10 @@ declare class ProxyRouter {
|
|
|
2511
2523
|
* The handler runs the full enforcement chain before forwarding.
|
|
2512
2524
|
*/
|
|
2513
2525
|
private createHandler;
|
|
2526
|
+
/**
|
|
2527
|
+
* Notify the onProxyCall callback if configured.
|
|
2528
|
+
*/
|
|
2529
|
+
private notifyProxyCall;
|
|
2514
2530
|
/**
|
|
2515
2531
|
* Call an upstream tool with a timeout.
|
|
2516
2532
|
*/
|
|
@@ -2710,6 +2726,7 @@ declare class DashboardApprovalChannel implements ApprovalChannel {
|
|
|
2710
2726
|
private profileStore;
|
|
2711
2727
|
private clientManager;
|
|
2712
2728
|
private dashboardHTML;
|
|
2729
|
+
private fortressHTML;
|
|
2713
2730
|
private loginHTML;
|
|
2714
2731
|
private authToken;
|
|
2715
2732
|
private useTLS;
|
|
@@ -2815,6 +2832,24 @@ declare class DashboardApprovalChannel implements ApprovalChannel {
|
|
|
2815
2832
|
private handleSessionExchange;
|
|
2816
2833
|
private serveLoginPage;
|
|
2817
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;
|
|
2818
2853
|
private handleSSE;
|
|
2819
2854
|
private handleStatus;
|
|
2820
2855
|
private handlePendingList;
|
package/dist/index.d.ts
CHANGED
|
@@ -1534,7 +1534,7 @@ declare class InjectionDetector {
|
|
|
1534
1534
|
constructor(config?: Partial<InjectionDetectorConfig>);
|
|
1535
1535
|
/**
|
|
1536
1536
|
* Scan tool arguments for injection signals.
|
|
1537
|
-
* @param toolName Full tool name (e.g., "
|
|
1537
|
+
* @param toolName Full tool name (e.g., "state_read")
|
|
1538
1538
|
* @param args Tool arguments
|
|
1539
1539
|
* @returns DetectionResult with all detected signals
|
|
1540
1540
|
*/
|
|
@@ -1953,7 +1953,7 @@ declare class ApprovalGate {
|
|
|
1953
1953
|
/**
|
|
1954
1954
|
* Evaluate a tool call against the Principal Policy.
|
|
1955
1955
|
*
|
|
1956
|
-
* @param toolName - Full MCP tool name (e.g., "
|
|
1956
|
+
* @param toolName - Full MCP tool name (e.g., "state_export")
|
|
1957
1957
|
* @param args - Tool call arguments (for context extraction)
|
|
1958
1958
|
* @returns GateResult indicating whether the call is allowed
|
|
1959
1959
|
*/
|
|
@@ -2028,7 +2028,7 @@ interface EnforcerConfig {
|
|
|
2028
2028
|
enabled: boolean;
|
|
2029
2029
|
/** Policy ID to use when no specific one is set */
|
|
2030
2030
|
default_policy_id?: string;
|
|
2031
|
-
/** Tool name prefixes to skip filtering (e.g., ["
|
|
2031
|
+
/** Tool name prefixes to skip filtering (e.g., ["*"] to skip all system tools) */
|
|
2032
2032
|
bypass_prefixes: string[];
|
|
2033
2033
|
/** Log but don't filter — for gradual rollout (default: false) */
|
|
2034
2034
|
log_only: boolean;
|
|
@@ -2083,10 +2083,13 @@ declare class ContextGateEnforcer {
|
|
|
2083
2083
|
* Check if a tool should be filtered based on bypass prefixes.
|
|
2084
2084
|
*
|
|
2085
2085
|
* SEC-033: Uses exact namespace component matching, not bare startsWith().
|
|
2086
|
-
* A prefix of "
|
|
2087
|
-
*
|
|
2088
|
-
*
|
|
2089
|
-
*
|
|
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.
|
|
2090
2093
|
*/
|
|
2091
2094
|
shouldFilter(toolName: string): boolean;
|
|
2092
2095
|
/**
|
|
@@ -2481,6 +2484,15 @@ interface ProxyRouterOptions {
|
|
|
2481
2484
|
contextGateFilter?: (toolName: string, args: Record<string, unknown>) => Promise<Record<string, unknown>>;
|
|
2482
2485
|
/** Optional call governor for runtime governance */
|
|
2483
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;
|
|
2484
2496
|
}
|
|
2485
2497
|
declare class ProxyRouter {
|
|
2486
2498
|
private clientManager;
|
|
@@ -2511,6 +2523,10 @@ declare class ProxyRouter {
|
|
|
2511
2523
|
* The handler runs the full enforcement chain before forwarding.
|
|
2512
2524
|
*/
|
|
2513
2525
|
private createHandler;
|
|
2526
|
+
/**
|
|
2527
|
+
* Notify the onProxyCall callback if configured.
|
|
2528
|
+
*/
|
|
2529
|
+
private notifyProxyCall;
|
|
2514
2530
|
/**
|
|
2515
2531
|
* Call an upstream tool with a timeout.
|
|
2516
2532
|
*/
|
|
@@ -2710,6 +2726,7 @@ declare class DashboardApprovalChannel implements ApprovalChannel {
|
|
|
2710
2726
|
private profileStore;
|
|
2711
2727
|
private clientManager;
|
|
2712
2728
|
private dashboardHTML;
|
|
2729
|
+
private fortressHTML;
|
|
2713
2730
|
private loginHTML;
|
|
2714
2731
|
private authToken;
|
|
2715
2732
|
private useTLS;
|
|
@@ -2815,6 +2832,24 @@ declare class DashboardApprovalChannel implements ApprovalChannel {
|
|
|
2815
2832
|
private handleSessionExchange;
|
|
2816
2833
|
private serveLoginPage;
|
|
2817
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;
|
|
2818
2853
|
private handleSSE;
|
|
2819
2854
|
private handleStatus;
|
|
2820
2855
|
private handlePendingList;
|