MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / processAgentDefinitions

Function processAgentDefinitions

sdk/src/run-state.ts:87–104  ·  view source on GitHub ↗

* Processes agent definitions array and converts handleSteps functions to strings

(
  agentDefinitions: AgentDefinition[],
)

Source from the content-addressed store, hash-verified

85 * Processes agent definitions array and converts handleSteps functions to strings
86 */
87function processAgentDefinitions(
88 agentDefinitions: AgentDefinition[],
89): Record<string, any> {
90 const processedAgentTemplates: Record<string, any> = {}
91 agentDefinitions.forEach((definition) => {
92 const processedConfig = { ...definition } as Record<string, any>
93 if (
94 processedConfig.handleSteps &&
95 typeof processedConfig.handleSteps === 'function'
96 ) {
97 processedConfig.handleSteps = processedConfig.handleSteps.toString()
98 }
99 if (processedConfig.id) {
100 processedAgentTemplates[processedConfig.id] = processedConfig
101 }
102 })
103 return processedAgentTemplates
104}
105
106/**
107 * Processes custom tool definitions into the format expected by SessionState.

Callers 2

initialSessionStateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected