(data: {
name: string;
repository_url?: string;
default_cwd: string;
ai_assistant_type?: string;
})
| 5 | import { Codebase } from '../types'; |
| 6 | |
| 7 | export async function createCodebase(data: { |
| 8 | name: string; |
| 9 | repository_url?: string; |
| 10 | default_cwd: string; |
| 11 | ai_assistant_type?: string; |
| 12 | }): Promise<Codebase> { |
| 13 | const assistantType = data.ai_assistant_type || 'claude'; |
| 14 | const result = await pool.query<Codebase>( |
| 15 | 'INSERT INTO remote_agent_codebases (name, repository_url, default_cwd, ai_assistant_type) VALUES ($1, $2, $3, $4) RETURNING *', |
| 16 | [data.name, data.repository_url || null, data.default_cwd, assistantType] |
| 17 | ); |
| 18 | return result.rows[0]; |
| 19 | } |
| 20 | |
| 21 | export async function getCodebase(id: string): Promise<Codebase | null> { |
| 22 | const result = await pool.query<Codebase>('SELECT * FROM remote_agent_codebases WHERE id = $1', [ |
nothing calls this directly
no outgoing calls
no test coverage detected