MCPcopy
hub / github.com/infinitered/reactotron / resolveEffectiveRules

Function resolveEffectiveRules

lib/reactotron-mcp/src/redaction.ts:70–91  ·  view source on GitHub ↗
(
  serverConfig: McpRedactionServerConfig,
  clientConfig?: McpRedactionConfig
)

Source from the content-addressed store, hash-verified

68 * require the matching server-side permission.
69 */
70export function resolveEffectiveRules(
71 serverConfig: McpRedactionServerConfig,
72 clientConfig?: McpRedactionConfig
73): McpRedactionRules | null {
74 if (!clientConfig) return serverConfig.defaults
75
76 if (clientConfig.disableRedaction && serverConfig.allowClientDisable) {
77 return null
78 }
79
80 let rules = deepCopyRules(serverConfig.defaults)
81
82 if (clientConfig.removeRules && serverConfig.allowClientRemoveRules) {
83 rules = subtractRules(rules, clientConfig.removeRules)
84 }
85
86 if (clientConfig.additionalRules) {
87 rules = mergeRules(rules, clientConfig.additionalRules)
88 }
89
90 return rules
91}
92
93/**
94 * Get a client's McpRedactionConfig. With no clientId, returns the lone

Callers 3

redaction.test.tsFile · 0.90
parsedForFunction · 0.85

Calls 3

deepCopyRulesFunction · 0.85
subtractRulesFunction · 0.85
mergeRulesFunction · 0.85

Tested by

no test coverage detected