MCPcopy Create free account
hub / github.com/TanStack/ai / resolveHeaderValue

Function resolveHeaderValue

packages/ai-codex/src/adapters/projection.ts:67–74  ·  view source on GitHub ↗

* Resolve a single MCP header value: a `SecretRef` resolves to its plaintext, a * `bearer(ref)` marker resolves to `Bearer `, and a plain string is * passed through unchanged.

(
  value: string | SecretRef | BearerRef,
  resolveSecret: (ref: SecretRef) => string,
)

Source from the content-addressed store, hash-verified

65 * passed through unchanged.
66 */
67function resolveHeaderValue(
68 value: string | SecretRef | BearerRef,
69 resolveSecret: (ref: SecretRef) => string,
70): string {
71 if (isSecretRef(value)) return resolveSecret(value)
72 if (isBearerMarker(value)) return `Bearer ${resolveSecret(value.__bearerRef)}`
73 return value
74}
75
76/** Escape a string for use as a double-quoted TOML basic string. */
77function tomlString(value: string): string {

Callers 1

buildMcpServersFunction · 0.70

Calls 3

isSecretRefFunction · 0.90
resolveSecretFunction · 0.85
isBearerMarkerFunction · 0.70

Tested by

no test coverage detected