MCPcopy Create free account
hub / github.com/freecodexyz/free-code / computeStandaloneAgentContext

Function computeStandaloneAgentContext

src/utils/sessionRestore.ts:175–188  ·  view source on GitHub ↗
(
  agentName: string | undefined,
  agentColor: string | undefined,
)

Source from the content-addressed store, hash-verified

173 * Returns undefined if no name/color is set on the session.
174 */
175export function computeStandaloneAgentContext(
176 agentName: string | undefined,
177 agentColor: string | undefined,
178): AppState['standaloneAgentContext'] | undefined {
179 if (!agentName && !agentColor) {
180 return undefined
181 }
182 return {
183 name: agentName ?? '',
184 color: (agentColor === 'default' ? undefined : agentColor) as
185 | AgentColorName
186 | undefined,
187 }
188}
189
190/**
191 * Restore agent setting from a resumed session.

Callers 3

onSelectFunction · 0.85
REPLFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected