( agentId: string, version: string, publisher: string, )
| 4 | import * as schema from '@codebuff/internal/db/schema' |
| 5 | |
| 6 | export 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 | } |
no test coverage detected