@axiom-lattice/local-stores 3.3.0 → 4.0.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.
- package/.turbo/turbo-build.log +10 -10
- package/CHANGELOG.md +38 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/__tests__/LocalEvalStore.test.ts +13 -0
- package/src/__tests__/LocalTaskStore.test.ts +14 -0
- package/src/stores/LocalEvalStore.ts +10 -0
- package/src/stores/LocalTaskStore.ts +1 -0
package/dist/index.mjs
CHANGED
|
@@ -3397,6 +3397,7 @@ CREATE TABLE IF NOT EXISTS lt_eval_runs (
|
|
|
3397
3397
|
interrupted_cases INTEGER NOT NULL DEFAULT 0,
|
|
3398
3398
|
avg_score REAL NOT NULL DEFAULT 0,
|
|
3399
3399
|
error TEXT,
|
|
3400
|
+
cancel_requested INTEGER NOT NULL DEFAULT 0,
|
|
3400
3401
|
holdout INTEGER NOT NULL DEFAULT 0,
|
|
3401
3402
|
env_project_id TEXT,
|
|
3402
3403
|
env_workspace_id TEXT,
|
|
@@ -3456,6 +3457,7 @@ var LocalEvalStore = class {
|
|
|
3456
3457
|
this.ensureColumn("lt_eval_run_results", "interrupted", "interrupted INTEGER NOT NULL DEFAULT 0");
|
|
3457
3458
|
this.ensureColumn("lt_eval_cases", "interrupt_policy", "interrupt_policy TEXT");
|
|
3458
3459
|
this.ensureColumn("lt_eval_runs", "task_id", "task_id TEXT");
|
|
3460
|
+
this.ensureColumn("lt_eval_runs", "cancel_requested", "cancel_requested INTEGER NOT NULL DEFAULT 0");
|
|
3459
3461
|
this.db.exec(`
|
|
3460
3462
|
UPDATE lt_eval_suites
|
|
3461
3463
|
SET project_id = (
|
|
@@ -3827,6 +3829,12 @@ var LocalEvalStore = class {
|
|
|
3827
3829
|
).run(...vals);
|
|
3828
3830
|
return this.getRunById(tenantId, id);
|
|
3829
3831
|
}
|
|
3832
|
+
async requestCancel(tenantId, id) {
|
|
3833
|
+
const result = this.db.prepare(
|
|
3834
|
+
`UPDATE lt_eval_runs SET cancel_requested = 1 WHERE tenant_id = ? AND id = ? AND status = 'running'`
|
|
3835
|
+
).run(tenantId, id);
|
|
3836
|
+
return result.changes > 0;
|
|
3837
|
+
}
|
|
3830
3838
|
async deleteRun(tenantId, id) {
|
|
3831
3839
|
const result = this.db.prepare(`DELETE FROM lt_eval_runs WHERE tenant_id = ? AND id = ?`).run(tenantId, id);
|
|
3832
3840
|
return result.changes > 0;
|
|
@@ -4006,6 +4014,7 @@ var LocalEvalStore = class {
|
|
|
4006
4014
|
interruptedCases: row.interrupted_cases ?? 0,
|
|
4007
4015
|
avgScore: row.avg_score ?? 0,
|
|
4008
4016
|
error: row.error,
|
|
4017
|
+
cancelRequested: Boolean(row.cancel_requested),
|
|
4009
4018
|
holdout: row.holdout ? Boolean(row.holdout) : void 0,
|
|
4010
4019
|
envProjectId: row.env_project_id,
|
|
4011
4020
|
envWorkspaceId: row.env_workspace_id,
|
|
@@ -5714,6 +5723,10 @@ var LocalTaskStore = class {
|
|
|
5714
5723
|
conditions.push("priority = ?");
|
|
5715
5724
|
params.push(filter.priority);
|
|
5716
5725
|
}
|
|
5726
|
+
if (filter.threadId) {
|
|
5727
|
+
conditions.push("json_extract(context, '$.thread_id') = ?");
|
|
5728
|
+
params.push(filter.threadId);
|
|
5729
|
+
}
|
|
5717
5730
|
if (filter.workspaceId) {
|
|
5718
5731
|
conditions.push("workspace_id = ?");
|
|
5719
5732
|
params.push(filter.workspaceId);
|