MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / createTestInstance

Function createTestInstance

apps/web/src/lib/kiloclaw/cli-runs.test.ts:18–33  ·  view source on GitHub ↗
(userId: string)

Source from the content-addressed store, hash-verified

16import { eq } from 'drizzle-orm';
17
18async 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
35async function getRunStatus(runId: string) {
36 const [row] = await db

Callers 1

cli-runs.test.tsFile · 0.85

Calls 2

valuesMethod · 0.65
replaceMethod · 0.65

Tested by

no test coverage detected