@leostera/evalkit 0.5.0 → 0.6.1
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.
- package/CHANGELOG.md +70 -6
- package/README.md +10 -8
- package/dist/cli.mjs +1227 -258
- package/dist/dashboard/assets/index-CTJpd8q8.js +34 -0
- package/dist/dashboard/assets/index-YAabTN3X.css +2 -0
- package/dist/dashboard/index.html +2 -2
- package/dist/files-C-U0-PWW.mjs +0 -2
- package/dist/index-db-vbqEGFaU.mjs +0 -2
- package/dist/index.d.mts +1346 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -4
- package/dist/runner.d.mts +809 -11
- package/dist/runner.d.mts.map +1 -1
- package/dist/runner.mjs +2 -2
- package/dist/share-worker.d.mts +76 -1
- package/dist/share-worker.d.mts.map +1 -1
- package/dist/share-worker.mjs +0 -2
- package/dist/share.d.mts +149 -6
- package/dist/share.d.mts.map +1 -1
- package/dist/share.mjs +1 -1
- package/dist/skills/evalkit/SKILL.md +32 -0
- package/dist/skills/evalkit-agents/SKILL.md +16 -0
- package/dist/skills/evalkit-datasets/SKILL.md +17 -0
- package/dist/skills/evalkit-evals/SKILL.md +19 -0
- package/dist/skills/evalkit-judges/SKILL.md +17 -0
- package/dist/skills/evalkit-matrices/SKILL.md +14 -0
- package/dist/skills/evalkit-results/SKILL.md +14 -0
- package/dist/{src-DoPs9Yug.mjs → src-CKqOzeBi.mjs} +448 -116
- package/dist/{src-ButXPY8P.mjs → src-CZPufWN_.mjs} +419 -94
- package/dist/{src-DzZueFn3.mjs → src-CZnDXP1K.mjs} +46 -10
- package/package.json +3 -2
- package/dist/cli.mjs.map +0 -1
- package/dist/dashboard/assets/index-D9NtA46z.css +0 -2
- package/dist/dashboard/assets/index-DrBwLKJD.js +0 -30
- package/dist/files-C-U0-PWW.mjs.map +0 -1
- package/dist/index-db-HdZXelOS.d.mts +0 -142
- package/dist/index-db-HdZXelOS.d.mts.map +0 -1
- package/dist/index-db-vbqEGFaU.mjs.map +0 -1
- package/dist/index-lOw0fmak.d.mts +0 -1028
- package/dist/index-lOw0fmak.d.mts.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/share-worker.mjs.map +0 -1
- package/dist/src-ButXPY8P.mjs.map +0 -1
- package/dist/src-DoPs9Yug.mjs.map +0 -1
- package/dist/src-DzZueFn3.mjs.map +0 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { n as asyncIndex, r as createShareApp, t as ShareIndexDb } from "./index-db-vbqEGFaU.mjs";
|
|
2
2
|
import { mkdir, readFile, readdir, rename, writeFile } from "node:fs/promises";
|
|
3
3
|
import { dirname, join, relative, resolve, sep } from "node:path";
|
|
4
|
-
import { Database } from "bun:sqlite";
|
|
5
4
|
//#region ../share/src/fs-files.ts
|
|
6
5
|
/** Result files in a directory, for `evalkit share serve` and tests. */
|
|
7
6
|
function directoryFiles(root) {
|
|
@@ -45,18 +44,57 @@ function directoryFiles(root) {
|
|
|
45
44
|
};
|
|
46
45
|
}
|
|
47
46
|
//#endregion
|
|
48
|
-
//#region ../share/src/index-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
//#region ../share/src/index-sqlite.ts
|
|
48
|
+
const onBun = typeof globalThis.Bun !== "undefined";
|
|
49
|
+
/**
|
|
50
|
+
* The index in a SQLite file, for `evalkit share serve` and tests: bun:sqlite
|
|
51
|
+
* on Bun, node:sqlite on Node. Imported lazily so neither runtime loads the
|
|
52
|
+
* other's module.
|
|
53
|
+
*/
|
|
54
|
+
async function sqliteIndex(path) {
|
|
55
|
+
return asyncIndex(new ShareIndexDb(onBun ? await bunSql(path) : await nodeSql(path)));
|
|
56
|
+
}
|
|
57
|
+
async function bunSql(path) {
|
|
58
|
+
const { Database } = await import("bun:sqlite");
|
|
51
59
|
const db = new Database(path, { create: true });
|
|
52
60
|
db.run("PRAGMA journal_mode = WAL");
|
|
53
|
-
return
|
|
61
|
+
return {
|
|
54
62
|
all: (query, ...params) => db.query(query).all(...params),
|
|
55
63
|
run: (query, ...params) => {
|
|
56
64
|
db.query(query).run(...params);
|
|
57
65
|
},
|
|
58
66
|
transaction: (work) => db.transaction(work)()
|
|
59
|
-
}
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
async function nodeSql(path) {
|
|
70
|
+
const { DatabaseSync } = await import("node:sqlite");
|
|
71
|
+
const db = new DatabaseSync(path);
|
|
72
|
+
db.exec("PRAGMA journal_mode = WAL");
|
|
73
|
+
let depth = 0;
|
|
74
|
+
return {
|
|
75
|
+
all: (query, ...params) => db.prepare(query).all(...params),
|
|
76
|
+
run: (query, ...params) => {
|
|
77
|
+
db.prepare(query).run(...params);
|
|
78
|
+
},
|
|
79
|
+
transaction(work) {
|
|
80
|
+
if (depth++) try {
|
|
81
|
+
return work();
|
|
82
|
+
} finally {
|
|
83
|
+
depth--;
|
|
84
|
+
}
|
|
85
|
+
db.exec("BEGIN");
|
|
86
|
+
try {
|
|
87
|
+
const result = work();
|
|
88
|
+
db.exec("COMMIT");
|
|
89
|
+
return result;
|
|
90
|
+
} catch (error) {
|
|
91
|
+
db.exec("ROLLBACK");
|
|
92
|
+
throw error;
|
|
93
|
+
} finally {
|
|
94
|
+
depth--;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
};
|
|
60
98
|
}
|
|
61
99
|
//#endregion
|
|
62
100
|
//#region ../share/src/node.ts
|
|
@@ -83,16 +121,14 @@ function directoryAssets(root) {
|
|
|
83
121
|
}
|
|
84
122
|
};
|
|
85
123
|
}
|
|
86
|
-
/** A share server on Bun: files and `index.sqlite` live in `dir`. */
|
|
124
|
+
/** A share server on Bun or Node: files and `index.sqlite` live in `dir`. */
|
|
87
125
|
async function createDirectoryShareApp(options) {
|
|
88
126
|
await mkdir(options.dir, { recursive: true });
|
|
89
127
|
return createShareApp({
|
|
90
128
|
files: directoryFiles(join(options.dir, "files")),
|
|
91
|
-
index: sqliteIndex(join(options.dir, "index.sqlite")),
|
|
129
|
+
index: await sqliteIndex(join(options.dir, "index.sqlite")),
|
|
92
130
|
assets: directoryAssets(options.dashboardRoot)
|
|
93
131
|
});
|
|
94
132
|
}
|
|
95
133
|
//#endregion
|
|
96
134
|
export { directoryFiles as i, directoryAssets as n, sqliteIndex as r, createDirectoryShareApp as t };
|
|
97
|
-
|
|
98
|
-
//# sourceMappingURL=src-DzZueFn3.mjs.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leostera/evalkit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "Author and run agent evals as code",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -47,7 +47,8 @@
|
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"effect": "^3.22.2",
|
|
50
|
-
"hono": "^4.11.6"
|
|
50
|
+
"hono": "^4.11.6",
|
|
51
|
+
"jiti": "^2.7.0"
|
|
51
52
|
},
|
|
52
53
|
"scripts": {
|
|
53
54
|
"build": "bun run --filter './packages/*' build && bun scripts/sync-package.ts",
|