(userId: string)
| 16 | import { eq } from 'drizzle-orm'; |
| 17 | |
| 18 | async function createTestInstance(userId: string): Promise<string> { |
| 19 | const [row] = await db |
| 20 | .insert(kiloclaw_instances) |
| 21 | .values({ |
| 22 | id: crypto.randomUUID(), |
| 23 | user_id: userId, |
| 24 | sandbox_id: `ki_${crypto.randomUUID().replace(/-/g, '')}`, |
| 25 | }) |
| 26 | .returning({ id: kiloclaw_instances.id }); |
| 27 | |
| 28 | if (!row) { |
| 29 | throw new Error('Failed to create KiloClaw test instance'); |
| 30 | } |
| 31 | |
| 32 | return row.id; |
| 33 | } |
| 34 | |
| 35 | async function getRunStatus(runId: string) { |
| 36 | const [row] = await db |
no test coverage detected