caik-cli 0.1.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/README.md +8 -7
  2. package/dist/api-6OX4ICXN.js +9 -0
  3. package/dist/auto-improve-skills-2COKTU5C.js +8 -0
  4. package/dist/autoresearch-Y7WW6L4O.js +24 -0
  5. package/dist/chunk-2YHUDOJL.js +54 -0
  6. package/dist/chunk-3TXNZINH.js +775 -0
  7. package/dist/chunk-5MHNQAV4.js +317 -0
  8. package/dist/chunk-7AIZTHHZ.js +152 -0
  9. package/dist/chunk-D4IM3YRX.js +166 -0
  10. package/dist/chunk-DJJHS7KK.js +62 -0
  11. package/dist/chunk-DKZBQRR3.js +91 -0
  12. package/dist/chunk-FLSHJZLC.js +613 -0
  13. package/dist/chunk-H2ZKCXMJ.js +202 -0
  14. package/dist/chunk-ILMOSMD3.js +83 -0
  15. package/dist/chunk-KYTHKH6V.js +79 -0
  16. package/dist/chunk-LTKHLRM4.js +272 -0
  17. package/dist/chunk-T32AEP3O.js +146 -0
  18. package/dist/chunk-T73Z5UMA.js +14437 -0
  19. package/dist/chunk-TFKT7V7H.js +1545 -0
  20. package/dist/chunk-US4CYDNS.js +524 -0
  21. package/dist/chunk-ZLRN7Q7C.js +27 -0
  22. package/dist/claude-code-6DF4YARB.js +8 -0
  23. package/dist/config-CS7734SA.js +24 -0
  24. package/dist/correction-classifier-TLPKRNLI.js +93 -0
  25. package/dist/cursor-Z4XXDCAM.js +8 -0
  26. package/dist/daemon/autoresearch-2MAEM2YI.js +272 -0
  27. package/dist/daemon/chunk-545XA5CB.js +77 -0
  28. package/dist/daemon/chunk-HEYFAUHL.js +90 -0
  29. package/dist/daemon/chunk-MLKGABMK.js +9 -0
  30. package/dist/daemon/chunk-NJICGNCK.js +150 -0
  31. package/dist/daemon/chunk-OD5NUFH2.js +181 -0
  32. package/dist/daemon/chunk-SM2FSXIP.js +60 -0
  33. package/dist/daemon/chunk-UMDJFPN6.js +163 -0
  34. package/dist/daemon/config-F7HE3JRY.js +23 -0
  35. package/dist/daemon/db-QEXVVTAL.js +15 -0
  36. package/dist/daemon/eval-generator-OR2FAYLB.js +316 -0
  37. package/dist/daemon/improver-TGEK6MPE.js +186 -0
  38. package/dist/daemon/llm-FUJ2TBYT.js +11 -0
  39. package/dist/daemon/nudge-detector-NFRHWZY6.js +140 -0
  40. package/dist/daemon/platform-7N3LQDIB.js +16381 -0
  41. package/dist/daemon/registry-FI4GTO3H.js +20 -0
  42. package/dist/daemon/server.js +356 -0
  43. package/dist/daemon/trace-store-T7XFGQSX.js +19 -0
  44. package/dist/daemon-UXYMG46V.js +85 -0
  45. package/dist/db-TLNRIXLK.js +18 -0
  46. package/dist/eval-generator-GGMRPO3K.js +21 -0
  47. package/dist/eval-runner-EF4K6T5Y.js +15 -0
  48. package/dist/index.js +8033 -568
  49. package/dist/llm-3UUZX6PX.js +12 -0
  50. package/dist/platform-52NREMBS.js +33 -0
  51. package/dist/repo-installer-K6ADOW3E.js +25 -0
  52. package/dist/setup-P744STZE.js +16 -0
  53. package/dist/test-loop-Y7QQE55P.js +127 -0
  54. package/dist/trace-store-FVLMNNDK.js +20 -0
  55. package/package.json +9 -3
@@ -0,0 +1,20 @@
1
+ import {
2
+ cleanupFiles,
3
+ findRegistryEntry,
4
+ listRegistryEntries,
5
+ readRegistry,
6
+ removeRegistryEntry,
7
+ upsertRegistryEntry,
8
+ writeRegistry
9
+ } from "./chunk-HEYFAUHL.js";
10
+ import "./chunk-545XA5CB.js";
11
+ import "./chunk-MLKGABMK.js";
12
+ export {
13
+ cleanupFiles,
14
+ findRegistryEntry,
15
+ listRegistryEntries,
16
+ readRegistry,
17
+ removeRegistryEntry,
18
+ upsertRegistryEntry,
19
+ writeRegistry
20
+ };
@@ -0,0 +1,356 @@
1
+ import {
2
+ getDb
3
+ } from "./chunk-OD5NUFH2.js";
4
+ import "./chunk-MLKGABMK.js";
5
+
6
+ // src/daemon/server.ts
7
+ import { createServer } from "http";
8
+ import {
9
+ mkdirSync,
10
+ writeFileSync,
11
+ readFileSync,
12
+ appendFileSync,
13
+ existsSync,
14
+ unlinkSync
15
+ } from "fs";
16
+ import { join } from "path";
17
+ import { homedir } from "os";
18
+ var CAIK_DIR = join(homedir(), ".caik");
19
+ var PID_PATH = join(CAIK_DIR, "daemon.pid");
20
+ var LOG_PATH = join(CAIK_DIR, "daemon.log");
21
+ var OBS_DIR = join(CAIK_DIR, "observations");
22
+ var PORT = parseInt(process.env.CAIK_DAEMON_PORT ?? "37778", 10);
23
+ var IDLE_TIMEOUT_MS = 30 * 60 * 1e3;
24
+ function ensureDirs() {
25
+ if (!existsSync(CAIK_DIR)) mkdirSync(CAIK_DIR, { recursive: true, mode: 448 });
26
+ if (!existsSync(OBS_DIR)) mkdirSync(OBS_DIR, { recursive: true, mode: 448 });
27
+ }
28
+ function log(msg) {
29
+ const line = `[${(/* @__PURE__ */ new Date()).toISOString()}] ${msg}
30
+ `;
31
+ try {
32
+ appendFileSync(LOG_PATH, line, "utf-8");
33
+ } catch {
34
+ }
35
+ }
36
+ var sessions = /* @__PURE__ */ new Map();
37
+ var totalObservationCount = 0;
38
+ var startTime = Date.now();
39
+ function appendObservation(obs) {
40
+ const filePath = join(OBS_DIR, `${obs.slug}.jsonl`);
41
+ try {
42
+ appendFileSync(filePath, JSON.stringify(obs) + "\n", "utf-8");
43
+ } catch {
44
+ log(`Failed to write observation for slug=${obs.slug}`);
45
+ }
46
+ }
47
+ function insertObservation(obs) {
48
+ try {
49
+ const db = getDb();
50
+ db.prepare(`
51
+ INSERT INTO observations (session_id, slug, tool, success, platform, correction_type, correction_source, timestamp)
52
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?)
53
+ `).run(
54
+ obs.sessionId,
55
+ obs.slug,
56
+ obs.tool,
57
+ obs.success ? 1 : 0,
58
+ obs.platform ?? null,
59
+ obs.correctionType ?? null,
60
+ obs.correctionSource ?? null,
61
+ obs.timestamp
62
+ );
63
+ } catch (err) {
64
+ log(`insertObservation failed: ${err instanceof Error ? err.message : String(err)}`);
65
+ }
66
+ }
67
+ function cleanupOldObservations() {
68
+ try {
69
+ const db = getDb();
70
+ db.prepare("DELETE FROM observations WHERE created_at < datetime('now', '-30 days')").run();
71
+ } catch {
72
+ }
73
+ }
74
+ function readObservationsForSlug(slug) {
75
+ const filePath = join(OBS_DIR, `${slug}.jsonl`);
76
+ if (!existsSync(filePath)) return [];
77
+ try {
78
+ const lines = readFileSync(filePath, "utf-8").trim().split("\n").filter(Boolean);
79
+ return lines.map((l) => JSON.parse(l));
80
+ } catch {
81
+ return [];
82
+ }
83
+ }
84
+ async function runImprovementCycle(sessionId) {
85
+ const observations = sessions.get(sessionId) ?? [];
86
+ const result = { improved: [], skipped: [] };
87
+ const slugs = new Set(observations.map((o) => o.slug));
88
+ const isDemo = process.env.CAIK_DEMO === "1";
89
+ const minObs = isDemo ? 1 : 5;
90
+ const minRate = isDemo ? 0 : 0.3;
91
+ for (const slug of slugs) {
92
+ const allObs = readObservationsForSlug(slug);
93
+ const corrections = allObs.filter((o) => o.correctionType);
94
+ const correctionRate = allObs.length > 0 ? corrections.length / allObs.length : 0;
95
+ if (allObs.length < minObs || correctionRate <= minRate) {
96
+ result.skipped.push(slug);
97
+ continue;
98
+ }
99
+ try {
100
+ let usedAutoResearch = false;
101
+ try {
102
+ const { getDb: getDb2 } = await import("./db-QEXVVTAL.js");
103
+ const { getEvalSuite, shouldGenerateEvals, generateEvalSuite, validateJudges } = await import("./eval-generator-OR2FAYLB.js");
104
+ const { autoResearchLoop, shouldAutoApply, applyImprovement, proposeImprovement } = await import("./autoresearch-2MAEM2YI.js");
105
+ const { getAnthropicApiKey } = await import("./llm-FUJ2TBYT.js");
106
+ const { readConfig } = await import("./config-F7HE3JRY.js");
107
+ const { findRegistryEntry } = await import("./registry-FI4GTO3H.js");
108
+ const config = readConfig();
109
+ const arSettings = config.autoResearch ?? {};
110
+ if (arSettings.enabled === false) throw new Error("AutoResearch disabled");
111
+ const apiKey = getAnthropicApiKey();
112
+ if (!apiKey) throw new Error("No API key");
113
+ const db = getDb2();
114
+ const entry = findRegistryEntry(slug);
115
+ const skillPath = entry?.files[0];
116
+ if (!entry || !skillPath || !existsSync(skillPath)) throw new Error("Skill file not found");
117
+ const skillContent = readFileSync(skillPath, "utf-8");
118
+ if (shouldGenerateEvals(db, slug)) {
119
+ await generateEvalSuite(db, slug, apiKey, arSettings.mutationModel);
120
+ await validateJudges(db, slug, apiKey, skillContent, arSettings.mutationModel);
121
+ }
122
+ const suite = getEvalSuite(db, slug);
123
+ if (suite && suite.tpr !== void 0 && suite.tpr > 0.7 && (suite.tnr === void 0 || suite.tnr > 0.7) && suite.cases.length >= 3) {
124
+ if (!isDemo && entry.lastImprovedAt) {
125
+ const hoursSince = (Date.now() - new Date(entry.lastImprovedAt).getTime()) / 36e5;
126
+ if (hoursSince < 24) {
127
+ result.skipped.push(slug);
128
+ continue;
129
+ }
130
+ }
131
+ const loopConfig = {
132
+ maxIterations: arSettings.maxIterations ?? 5,
133
+ mutationsPerIteration: arSettings.mutationsPerIteration ?? 3,
134
+ maxLLMCalls: arSettings.maxLLMCalls ?? 30,
135
+ mutationModel: arSettings.mutationModel ?? "claude-haiku-4-5-20251001"
136
+ };
137
+ const loopResult = await autoResearchLoop(slug, skillPath, suite, loopConfig, apiKey);
138
+ if (loopResult.bestContent) {
139
+ const mode = arSettings.mode ?? "autonomous";
140
+ if (shouldAutoApply(mode, loopResult)) {
141
+ applyImprovement(slug, skillPath, loopResult.bestContent, loopResult, db);
142
+ log(`AutoResearch auto-applied for slug=${slug} (${loopResult.baselineScore.passRate} -> ${loopResult.bestScore.passRate})`);
143
+ } else {
144
+ proposeImprovement(slug, skillPath, loopResult.bestContent, loopResult, db);
145
+ log(`AutoResearch proposed for slug=${slug} (${loopResult.baselineScore.passRate} -> ${loopResult.bestScore.passRate})`);
146
+ }
147
+ result.improved.push(slug);
148
+ usedAutoResearch = true;
149
+ } else {
150
+ log(`AutoResearch: no improvement found for slug=${slug}`);
151
+ }
152
+ }
153
+ } catch (arErr) {
154
+ log(`AutoResearch unavailable for slug=${slug}: ${arErr instanceof Error ? arErr.message : String(arErr)}`);
155
+ }
156
+ if (!usedAutoResearch) {
157
+ const improver = await import("./improver-TGEK6MPE.js");
158
+ await improver.runImprovement(slug, allObs);
159
+ result.improved.push(slug);
160
+ log(`One-shot improvement triggered for slug=${slug} (${allObs.length} obs, ${(correctionRate * 100).toFixed(0)}% correction rate)`);
161
+ }
162
+ } catch (err) {
163
+ log(`Improvement failed for slug=${slug}: ${err instanceof Error ? err.message : String(err)}`);
164
+ result.skipped.push(slug);
165
+ }
166
+ }
167
+ sessions.delete(sessionId);
168
+ return result;
169
+ }
170
+ function readBody(req) {
171
+ return new Promise((resolve, reject) => {
172
+ const chunks = [];
173
+ req.on("data", (chunk) => chunks.push(chunk));
174
+ req.on("end", () => resolve(Buffer.concat(chunks).toString("utf-8")));
175
+ req.on("error", reject);
176
+ });
177
+ }
178
+ function json(res, status, data) {
179
+ const body = JSON.stringify(data);
180
+ res.writeHead(status, {
181
+ "Content-Type": "application/json",
182
+ "Content-Length": Buffer.byteLength(body)
183
+ });
184
+ res.end(body);
185
+ }
186
+ function notFound(res) {
187
+ json(res, 404, { error: "not found" });
188
+ }
189
+ function badRequest(res, message) {
190
+ json(res, 400, { error: message });
191
+ }
192
+ async function handleRequest(req, res) {
193
+ const url = new URL(req.url ?? "/", `http://localhost:${PORT}`);
194
+ const path = url.pathname;
195
+ const method = req.method ?? "GET";
196
+ if (method === "GET" && path === "/health") {
197
+ json(res, 200, {
198
+ status: "ok",
199
+ uptime: Math.floor((Date.now() - startTime) / 1e3),
200
+ observationCount: totalObservationCount,
201
+ pid: process.pid
202
+ });
203
+ return;
204
+ }
205
+ if (method === "POST" && path === "/observations") {
206
+ let body;
207
+ try {
208
+ const raw = await readBody(req);
209
+ body = JSON.parse(raw);
210
+ } catch {
211
+ badRequest(res, "invalid JSON body");
212
+ return;
213
+ }
214
+ if (!body.sessionId || !body.slug || !body.tool) {
215
+ badRequest(res, "missing required fields: sessionId, slug, tool");
216
+ return;
217
+ }
218
+ if (!body.timestamp) {
219
+ body.timestamp = (/* @__PURE__ */ new Date()).toISOString();
220
+ }
221
+ if (!sessions.has(body.sessionId)) {
222
+ sessions.set(body.sessionId, []);
223
+ }
224
+ sessions.get(body.sessionId).push(body);
225
+ totalObservationCount++;
226
+ appendObservation(body);
227
+ insertObservation(body);
228
+ json(res, 200, { ok: true, count: totalObservationCount });
229
+ return;
230
+ }
231
+ const sessionEndMatch = path.match(/^\/sessions\/([^/]+)\/end$/);
232
+ if (method === "POST" && sessionEndMatch) {
233
+ const sessionId = decodeURIComponent(sessionEndMatch[1]);
234
+ log(`Session end: ${sessionId}`);
235
+ const result = await runImprovementCycle(sessionId);
236
+ try {
237
+ const { detectContributionNudges, writeNudgeFile } = await import("./nudge-detector-NFRHWZY6.js");
238
+ const { listRegistryEntries } = await import("./platform-7N3LQDIB.js");
239
+ const entries = listRegistryEntries();
240
+ const registrySlugs = new Set(entries.map((e) => e.slug));
241
+ const nudges = detectContributionNudges(OBS_DIR, registrySlugs);
242
+ if (nudges.length > 0) {
243
+ writeNudgeFile(nudges);
244
+ log(`Contribution nudges: ${nudges.length} detected (${nudges.map((n) => n.displayName).join(", ")})`);
245
+ }
246
+ } catch {
247
+ }
248
+ json(res, 200, result);
249
+ return;
250
+ }
251
+ const statusMatch = path.match(/^\/status\/([^/]+)$/);
252
+ if (method === "GET" && statusMatch) {
253
+ const slug = decodeURIComponent(statusMatch[1]);
254
+ const observations = readObservationsForSlug(slug);
255
+ const corrections = observations.filter((o) => o.correctionType);
256
+ json(res, 200, {
257
+ slug,
258
+ totalObservations: observations.length,
259
+ corrections: corrections.length,
260
+ correctionRate: observations.length > 0 ? Math.round(corrections.length / observations.length * 100) : 0,
261
+ lastObservation: observations.length > 0 ? observations[observations.length - 1].timestamp : null
262
+ });
263
+ return;
264
+ }
265
+ const arStatusMatch = path.match(/^\/autoresearch\/status\/([^/]+)$/);
266
+ if (method === "GET" && arStatusMatch) {
267
+ try {
268
+ const slug = decodeURIComponent(arStatusMatch[1]);
269
+ const { getDb: getDb2 } = await import("./db-QEXVVTAL.js");
270
+ const db = getDb2();
271
+ const row = db.prepare(
272
+ "SELECT * FROM loop_results WHERE slug = ? ORDER BY created_at DESC LIMIT 1"
273
+ ).get(slug);
274
+ json(res, 200, row ?? { slug, message: "No autoresearch runs yet" });
275
+ } catch (err) {
276
+ json(res, 200, { error: err instanceof Error ? err.message : String(err) });
277
+ }
278
+ return;
279
+ }
280
+ const evalsMatch = path.match(/^\/evals\/([^/]+)$/);
281
+ if (method === "GET" && evalsMatch) {
282
+ try {
283
+ const slug = decodeURIComponent(evalsMatch[1]);
284
+ const { getDb: getDb2 } = await import("./db-QEXVVTAL.js");
285
+ const { getEvalSuite } = await import("./eval-generator-OR2FAYLB.js");
286
+ const suite = getEvalSuite(getDb2(), slug);
287
+ json(res, 200, suite ?? { slug, message: "No eval suite" });
288
+ } catch (err) {
289
+ json(res, 200, { error: err instanceof Error ? err.message : String(err) });
290
+ }
291
+ return;
292
+ }
293
+ const tracesCountMatch = path.match(/^\/traces\/([^/]+)\/count$/);
294
+ if (method === "GET" && tracesCountMatch) {
295
+ try {
296
+ const slug = decodeURIComponent(tracesCountMatch[1]);
297
+ const { getDb: getDb2 } = await import("./db-QEXVVTAL.js");
298
+ const { getTraceCount } = await import("./trace-store-T7XFGQSX.js");
299
+ const counts = getTraceCount(getDb2(), slug);
300
+ json(res, 200, counts);
301
+ } catch {
302
+ json(res, 200, { total: 0, corrections: 0, successes: 0 });
303
+ }
304
+ return;
305
+ }
306
+ notFound(res);
307
+ }
308
+ var idleTimer = null;
309
+ function resetIdleTimer() {
310
+ if (idleTimer) clearTimeout(idleTimer);
311
+ idleTimer = setTimeout(() => {
312
+ log("Shutting down due to inactivity");
313
+ shutdown();
314
+ }, IDLE_TIMEOUT_MS);
315
+ }
316
+ function writePidFile() {
317
+ ensureDirs();
318
+ writeFileSync(PID_PATH, String(process.pid), "utf-8");
319
+ }
320
+ function removePidFile() {
321
+ try {
322
+ if (existsSync(PID_PATH)) unlinkSync(PID_PATH);
323
+ } catch {
324
+ }
325
+ }
326
+ function shutdown() {
327
+ log("Daemon shutting down");
328
+ removePidFile();
329
+ server.close(() => {
330
+ process.exit(0);
331
+ });
332
+ setTimeout(() => process.exit(0), 5e3).unref();
333
+ }
334
+ var server = createServer((req, res) => {
335
+ resetIdleTimer();
336
+ handleRequest(req, res).catch((err) => {
337
+ log(`Request error: ${err instanceof Error ? err.message : String(err)}`);
338
+ json(res, 500, { error: "internal server error" });
339
+ });
340
+ });
341
+ process.on("SIGTERM", shutdown);
342
+ process.on("SIGINT", shutdown);
343
+ ensureDirs();
344
+ writePidFile();
345
+ cleanupOldObservations();
346
+ try {
347
+ const db = getDb();
348
+ const check = db.prepare("SELECT count(*) as cnt FROM observations").get();
349
+ log(`Observations table: ${check.cnt} rows at startup`);
350
+ } catch (err) {
351
+ log(`Observations table check failed: ${err instanceof Error ? err.message : String(err)}`);
352
+ }
353
+ server.listen(PORT, "127.0.0.1", () => {
354
+ log(`Daemon started on port ${PORT} (pid=${process.pid})`);
355
+ resetIdleTimer();
356
+ });
@@ -0,0 +1,19 @@
1
+ import {
2
+ bufferPrompt,
3
+ bufferToolCall,
4
+ buildTraces,
5
+ clearSessionBuffer,
6
+ getTraceCount,
7
+ getTraces,
8
+ persistTraces
9
+ } from "./chunk-NJICGNCK.js";
10
+ import "./chunk-MLKGABMK.js";
11
+ export {
12
+ bufferPrompt,
13
+ bufferToolCall,
14
+ buildTraces,
15
+ clearSessionBuffer,
16
+ getTraceCount,
17
+ getTraces,
18
+ persistTraces
19
+ };
@@ -0,0 +1,85 @@
1
+ #!/usr/bin/env node
2
+ import "./chunk-ZLRN7Q7C.js";
3
+
4
+ // src/daemon/manager.ts
5
+ import { spawn } from "child_process";
6
+ import { readFileSync, existsSync } from "fs";
7
+ import { join } from "path";
8
+ import { homedir } from "os";
9
+ import { fileURLToPath } from "url";
10
+ var DAEMON_PORT = parseInt(process.env.CAIK_DAEMON_PORT ?? "37778", 10);
11
+ var CAIK_DIR = join(homedir(), ".caik");
12
+ var PID_PATH = join(CAIK_DIR, "daemon.pid");
13
+ var HEALTH_URL = `http://127.0.0.1:${DAEMON_PORT}/health`;
14
+ async function healthCheck() {
15
+ try {
16
+ const res = await fetch(HEALTH_URL, { signal: AbortSignal.timeout(2e3) });
17
+ if (!res.ok) return null;
18
+ return await res.json();
19
+ } catch {
20
+ return null;
21
+ }
22
+ }
23
+ function sleep(ms) {
24
+ return new Promise((resolve) => setTimeout(resolve, ms));
25
+ }
26
+ async function ensureDaemonRunning() {
27
+ const existing = await healthCheck();
28
+ if (existing) return true;
29
+ const thisFile = fileURLToPath(import.meta.url);
30
+ const serverPath = join(thisFile, "..", "daemon", "server.js");
31
+ const child = spawn(process.execPath, [serverPath], {
32
+ detached: true,
33
+ stdio: ["ignore", "ignore", "ignore"],
34
+ env: { ...process.env, CAIK_DAEMON_PORT: String(DAEMON_PORT) }
35
+ });
36
+ child.unref();
37
+ for (let i = 0; i < 6; i++) {
38
+ await sleep(500);
39
+ const health = await healthCheck();
40
+ if (health) return true;
41
+ }
42
+ return false;
43
+ }
44
+ async function stopDaemon() {
45
+ let pid = null;
46
+ try {
47
+ if (existsSync(PID_PATH)) {
48
+ pid = parseInt(readFileSync(PID_PATH, "utf-8").trim(), 10);
49
+ }
50
+ } catch {
51
+ }
52
+ if (!pid || isNaN(pid)) return;
53
+ try {
54
+ process.kill(pid, "SIGTERM");
55
+ } catch {
56
+ return;
57
+ }
58
+ for (let i = 0; i < 10; i++) {
59
+ await sleep(500);
60
+ try {
61
+ process.kill(pid, 0);
62
+ } catch {
63
+ return;
64
+ }
65
+ }
66
+ try {
67
+ process.kill(pid, "SIGKILL");
68
+ } catch {
69
+ }
70
+ }
71
+ async function getDaemonStatus() {
72
+ const health = await healthCheck();
73
+ if (!health) return { running: false };
74
+ return {
75
+ running: true,
76
+ uptime: health.uptime,
77
+ observationCount: health.observationCount
78
+ };
79
+ }
80
+ export {
81
+ DAEMON_PORT,
82
+ ensureDaemonRunning,
83
+ getDaemonStatus,
84
+ stopDaemon
85
+ };
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ closeDb,
4
+ getDb,
5
+ getDefaultDbPath,
6
+ initSchema,
7
+ init_db,
8
+ openDb
9
+ } from "./chunk-H2ZKCXMJ.js";
10
+ import "./chunk-ZLRN7Q7C.js";
11
+ init_db();
12
+ export {
13
+ closeDb,
14
+ getDb,
15
+ getDefaultDbPath,
16
+ initSchema,
17
+ openDb
18
+ };
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ generateEvalCase,
4
+ generateEvalSuite,
5
+ getEvalSuite,
6
+ isBehavioralCorrection,
7
+ shouldGenerateEvals,
8
+ validateJudges
9
+ } from "./chunk-5MHNQAV4.js";
10
+ import "./chunk-7AIZTHHZ.js";
11
+ import "./chunk-D4IM3YRX.js";
12
+ import "./chunk-DJJHS7KK.js";
13
+ import "./chunk-ZLRN7Q7C.js";
14
+ export {
15
+ generateEvalCase,
16
+ generateEvalSuite,
17
+ getEvalSuite,
18
+ isBehavioralCorrection,
19
+ shouldGenerateEvals,
20
+ validateJudges
21
+ };
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ checkCodeAssertion,
4
+ checkPatternAssertion,
5
+ runEvalSuite,
6
+ runSingleCase
7
+ } from "./chunk-D4IM3YRX.js";
8
+ import "./chunk-DJJHS7KK.js";
9
+ import "./chunk-ZLRN7Q7C.js";
10
+ export {
11
+ checkCodeAssertion,
12
+ checkPatternAssertion,
13
+ runEvalSuite,
14
+ runSingleCase
15
+ };