MCPcopy Create free account
hub / github.com/apache/maka / agentProfilesForDefinitions

Function agentProfilesForDefinitions

packages/runtime/src/agent-catalog.ts:233–242  ·  view source on GitHub ↗
(
  definitions: readonly AgentDefinition[],
)

Source from the content-addressed store, hash-verified

231}
232
233export function agentProfilesForDefinitions(
234 definitions: readonly AgentDefinition[],
235): [AgentProfile, ...AgentProfile[]] {
236 const profiles = definitions.map((definition) => definition.profile);
237 if (profiles.length === 0) throw new Error('At least one agent definition is required');
238 if (new Set(profiles).size !== profiles.length) {
239 throw new Error('Agent definitions must have unique profiles');
240 }
241 return profiles as [AgentProfile, ...AgentProfile[]];
242}
243
244export function requireAgentDefinitionByProfile(
245 definitions: readonly AgentDefinition[],

Callers 1

buildSubagentSpawnToolFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected