MCPcopy
hub / github.com/anomalyco/opencode / updateField

Function updateField

packages/opencode/src/mcp/auth.ts:112–120  ·  view source on GitHub ↗
(field: K, spanName: string)

Source from the content-addressed store, hash-verified

110 })
111
112 const updateField = <K extends keyof Entry>(field: K, spanName: string) =>
113 Effect.fn(`McpAuth.${spanName}`)(function* (mcpName: string, value: NonNullable<Entry[K]>, serverUrl?: string) {
114 yield* mutate((data) => {
115 const entry = data[mcpName] ?? {}
116 entry[field] = value
117 if (serverUrl) entry.serverUrl = serverUrl
118 return { ...data, [mcpName]: entry }
119 })
120 })
121
122 const clearField = (field: keyof Entry, spanName: string) =>
123 Effect.fn(`McpAuth.${spanName}`)(function* (mcpName: string) {

Callers 1

auth.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected