MCPcopy Create free account
hub / github.com/simstudioai/sim / redactToolCallResult

Function redactToolCallResult

apps/sim/lib/copilot/chat/sim-key-redaction.ts:71–84  ·  view source on GitHub ↗
(
  toolName: string | undefined,
  result: { success: boolean; output?: unknown; error?: string } | undefined
)

Source from the content-addressed store, hash-verified

69 * call's outcome and metadata; only the secret is stripped.
70 */
71export function redactToolCallResult(
72 toolName: string | undefined,
73 result: { success: boolean; output?: unknown; error?: string } | undefined
74): { success: boolean; output?: unknown; error?: string } | undefined {
75 if (!result || toolName !== GenerateApiKey.id) return result
76 const output = result.output
77 if (!output || typeof output !== 'object') return result
78 const record = output as Record<string, unknown>
79 if (typeof record.key !== 'string') return result
80 return {
81 ...result,
82 output: { ...record, key: REDACTED_MARKER, redacted: true },
83 }
84}
85
86function isMergeableAssistantTextBlock(block: PersistedContentBlock): boolean {
87 return (

Callers 1

mapContentBlockBodyFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected