MCPcopy Create free account
hub / github.com/IgorWarzocha/howcode / mapComposerModel

Function mapComposerModel

desktop/runtime/composer-state.ts:38–52  ·  view source on GitHub ↗
(
  model: AgentSession['model'] | ComposerSourceModel | null | undefined,
)

Source from the content-addressed store, hash-verified

36const contextUsageCache = new WeakMap<AgentSession, ComposerContextUsage | null>()
37
38function mapComposerModel(
39 model: AgentSession['model'] | ComposerSourceModel | null | undefined,
40): ComposerModel | null {
41 if (!model) {
42 return null
43 }
44
45 return {
46 provider: model.provider,
47 id: model.id,
48 name: model.name ?? model.id,
49 reasoning: Boolean(model.reasoning),
50 input: (model.input ?? ['text']) as Array<'text' | 'image'>,
51 }
52}
53
54function mapThinkingLevels(levels: ThinkingLevel[]) {
55 return levels as ComposerThinkingLevel[]

Callers 2

buildComposerStateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected