MCPcopy
hub / github.com/CodebuffAI/codebuff / fetchAgent

Function fetchAgent

packages/internal/src/templates/fetch-agent.ts:6–25  ·  view source on GitHub ↗
(
  agentId: string,
  version: string,
  publisher: string,
)

Source from the content-addressed store, hash-verified

4import * as schema from '@codebuff/internal/db/schema'
5
6export async function fetchAgent(
7 agentId: string,
8 version: string,
9 publisher: string,
10) {
11 // Find the agent template
12 const agent = await db
13 .select()
14 .from(schema.agentConfig)
15 .where(
16 and(
17 eq(schema.agentConfig.id, agentId),
18 eq(schema.agentConfig.version, version),
19 eq(schema.agentConfig.publisher_id, publisher),
20 ),
21 )
22 .then((rows) => rows[0])
23
24 return agent
25}

Callers 1

validateSpawnableAgentsFunction · 0.90

Calls 1

fromMethod · 0.80

Tested by

no test coverage detected