@axiom-lattice/local-stores 2.0.7 → 2.0.8
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 +11 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +46 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +46 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/__tests__/LocalTaskStore.test.ts +84 -0
- package/src/stores/LocalEvalStore.ts +6 -3
- package/src/stores/LocalTaskStore.ts +47 -9
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @axiom-lattice/local-stores@2.0.
|
|
2
|
+
> @axiom-lattice/local-stores@2.0.8 build /home/runner/work/agentic/agentic/packages/local-stores
|
|
3
3
|
> tsup src/index.ts --format cjs,esm --dts --sourcemap
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
[34mCLI[39m Target: es2020
|
|
9
9
|
[34mCJS[39m Build start
|
|
10
10
|
[34mESM[39m Build start
|
|
11
|
-
[
|
|
12
|
-
[
|
|
13
|
-
[
|
|
14
|
-
[
|
|
15
|
-
[
|
|
16
|
-
[
|
|
11
|
+
[32mCJS[39m [1mdist/index.js [22m[32m135.76 KB[39m
|
|
12
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m253.30 KB[39m
|
|
13
|
+
[32mCJS[39m ⚡️ Build success in 361ms
|
|
14
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m132.29 KB[39m
|
|
15
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m250.45 KB[39m
|
|
16
|
+
[32mESM[39m ⚡️ Build success in 363ms
|
|
17
17
|
[34mDTS[39m Build start
|
|
18
|
-
[32mDTS[39m ⚡️ Build success in
|
|
19
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m29.
|
|
20
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[32m29.
|
|
18
|
+
[32mDTS[39m ⚡️ Build success in 15194ms
|
|
19
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m29.36 KB[39m
|
|
20
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m29.36 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @axiom-lattice/local-stores
|
|
2
2
|
|
|
3
|
+
## 2.0.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 668f089: Fix `LocalTaskStore.list` metadata filter: callers pass stringified JSON values (`"true"`/`"false"`) per the PostgreSQL `metadata->>` text convention, but SQLite `json_extract` returns INTEGER 1/0 for JSON booleans, so boolean metadata filters (e.g. training-round queries) silently matched nothing. The filter now accepts both the text and integer forms.
|
|
8
|
+
- ecc456c: add agent workstation
|
|
9
|
+
- Updated dependencies [b4a8f17]
|
|
10
|
+
- Updated dependencies [ecc456c]
|
|
11
|
+
- @axiom-lattice/core@3.1.0
|
|
12
|
+
- @axiom-lattice/protocols@3.0.3
|
|
13
|
+
|
|
3
14
|
## 2.0.7
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -588,6 +588,8 @@ declare class LocalScheduleStorage implements ScheduleStorage {
|
|
|
588
588
|
declare class LocalTaskStore implements TaskStore {
|
|
589
589
|
private db;
|
|
590
590
|
constructor(db: DatabaseWrapper);
|
|
591
|
+
/** Add a column if it does not exist (SQLite version compatible). */
|
|
592
|
+
private ensureColumn;
|
|
591
593
|
create(params: CreateTaskRequest & {
|
|
592
594
|
tenantId: string;
|
|
593
595
|
ownerType: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -588,6 +588,8 @@ declare class LocalScheduleStorage implements ScheduleStorage {
|
|
|
588
588
|
declare class LocalTaskStore implements TaskStore {
|
|
589
589
|
private db;
|
|
590
590
|
constructor(db: DatabaseWrapper);
|
|
591
|
+
/** Add a column if it does not exist (SQLite version compatible). */
|
|
592
|
+
private ensureColumn;
|
|
591
593
|
create(params: CreateTaskRequest & {
|
|
592
594
|
tenantId: string;
|
|
593
595
|
ownerType: string;
|
package/dist/index.js
CHANGED
|
@@ -2010,6 +2010,7 @@ CREATE TABLE IF NOT EXISTS lt_eval_runs (
|
|
|
2010
2010
|
holdout INTEGER NOT NULL DEFAULT 0,
|
|
2011
2011
|
env_project_id TEXT,
|
|
2012
2012
|
env_workspace_id TEXT,
|
|
2013
|
+
task_id TEXT,
|
|
2013
2014
|
created_at TEXT NOT NULL,
|
|
2014
2015
|
started_at TEXT,
|
|
2015
2016
|
completed_at TEXT,
|
|
@@ -2064,6 +2065,7 @@ var LocalEvalStore = class {
|
|
|
2064
2065
|
this.ensureColumn("lt_eval_runs", "interrupted_cases", "interrupted_cases INTEGER NOT NULL DEFAULT 0");
|
|
2065
2066
|
this.ensureColumn("lt_eval_run_results", "interrupted", "interrupted INTEGER NOT NULL DEFAULT 0");
|
|
2066
2067
|
this.ensureColumn("lt_eval_cases", "interrupt_policy", "interrupt_policy TEXT");
|
|
2068
|
+
this.ensureColumn("lt_eval_runs", "task_id", "task_id TEXT");
|
|
2067
2069
|
this.db.exec(`
|
|
2068
2070
|
UPDATE lt_eval_suites
|
|
2069
2071
|
SET project_id = (
|
|
@@ -2365,9 +2367,9 @@ var LocalEvalStore = class {
|
|
|
2365
2367
|
async createRun(tenantId, projectId, id, data) {
|
|
2366
2368
|
const actualId = id || (0, import_crypto.randomUUID)();
|
|
2367
2369
|
this.db.prepare(
|
|
2368
|
-
`INSERT INTO lt_eval_runs (id, project_id, tenant_id, status, concurrency, total_cases, passed_cases, failed_cases, avg_score, holdout, env_project_id, env_workspace_id, created_at)
|
|
2369
|
-
VALUES (?, ?, ?, 'running', ?, ?, 0, 0, 0, ?, ?, ?, ?)`
|
|
2370
|
-
).run(actualId, projectId, tenantId, data.concurrency, data.totalCases, data.holdout ? 1 : 0, data.envProjectId || null, data.envWorkspaceId || null, nowISO());
|
|
2370
|
+
`INSERT INTO lt_eval_runs (id, project_id, tenant_id, status, concurrency, total_cases, passed_cases, failed_cases, avg_score, holdout, env_project_id, env_workspace_id, task_id, created_at)
|
|
2371
|
+
VALUES (?, ?, ?, 'running', ?, ?, 0, 0, 0, ?, ?, ?, ?, ?)`
|
|
2372
|
+
).run(actualId, projectId, tenantId, data.concurrency, data.totalCases, data.holdout ? 1 : 0, data.envProjectId || null, data.envWorkspaceId || null, data.taskId || null, nowISO());
|
|
2371
2373
|
return await this.getRunById(tenantId, actualId);
|
|
2372
2374
|
}
|
|
2373
2375
|
async updateRunStatus(tenantId, id, updates) {
|
|
@@ -2591,6 +2593,7 @@ var LocalEvalStore = class {
|
|
|
2591
2593
|
holdout: row.holdout ? Boolean(row.holdout) : void 0,
|
|
2592
2594
|
envProjectId: row.env_project_id,
|
|
2593
2595
|
envWorkspaceId: row.env_workspace_id,
|
|
2596
|
+
taskId: row.task_id,
|
|
2594
2597
|
createdAt: parseISO(row.created_at),
|
|
2595
2598
|
startedAt: row.started_at ? parseISO(row.started_at) : void 0,
|
|
2596
2599
|
completedAt: row.completed_at ? parseISO(row.completed_at) : void 0
|
|
@@ -3738,11 +3741,22 @@ CREATE TABLE IF NOT EXISTS lt_tasks (
|
|
|
3738
3741
|
failure_reason TEXT,
|
|
3739
3742
|
workspace_id TEXT,
|
|
3740
3743
|
project_id TEXT,
|
|
3744
|
+
files TEXT,
|
|
3741
3745
|
created_at TEXT NOT NULL,
|
|
3742
3746
|
updated_at TEXT NOT NULL,
|
|
3743
3747
|
PRIMARY KEY (tenant_id, id)
|
|
3744
3748
|
);
|
|
3745
3749
|
`;
|
|
3750
|
+
function parseTaskFiles(raw) {
|
|
3751
|
+
if (!raw) return void 0;
|
|
3752
|
+
try {
|
|
3753
|
+
const parsed = typeof raw === "string" ? JSON.parse(raw) : raw;
|
|
3754
|
+
if (!Array.isArray(parsed)) return void 0;
|
|
3755
|
+
return parsed;
|
|
3756
|
+
} catch {
|
|
3757
|
+
return void 0;
|
|
3758
|
+
}
|
|
3759
|
+
}
|
|
3746
3760
|
function mapRowToTask2(row) {
|
|
3747
3761
|
return {
|
|
3748
3762
|
id: row.id,
|
|
@@ -3764,6 +3778,7 @@ function mapRowToTask2(row) {
|
|
|
3764
3778
|
failureReason: row.failure_reason || void 0,
|
|
3765
3779
|
workspaceId: row.workspace_id ?? void 0,
|
|
3766
3780
|
projectId: row.project_id ?? void 0,
|
|
3781
|
+
files: parseTaskFiles(row.files),
|
|
3767
3782
|
createdAt: parseISO(row.created_at),
|
|
3768
3783
|
updatedAt: parseISO(row.updated_at)
|
|
3769
3784
|
};
|
|
@@ -3772,18 +3787,26 @@ var LocalTaskStore = class {
|
|
|
3772
3787
|
constructor(db) {
|
|
3773
3788
|
this.db = db;
|
|
3774
3789
|
ensureTable(db, DDL20);
|
|
3775
|
-
this.
|
|
3776
|
-
this.
|
|
3777
|
-
this.
|
|
3778
|
-
this.
|
|
3779
|
-
this.
|
|
3780
|
-
this.
|
|
3790
|
+
this.ensureColumn("lt_tasks", "require_review", "require_review INTEGER DEFAULT 0");
|
|
3791
|
+
this.ensureColumn("lt_tasks", "dependencies", "dependencies TEXT");
|
|
3792
|
+
this.ensureColumn("lt_tasks", "result", "result TEXT");
|
|
3793
|
+
this.ensureColumn("lt_tasks", "failure_reason", "failure_reason TEXT");
|
|
3794
|
+
this.ensureColumn("lt_tasks", "workspace_id", "workspace_id TEXT");
|
|
3795
|
+
this.ensureColumn("lt_tasks", "project_id", "project_id TEXT");
|
|
3796
|
+
this.ensureColumn("lt_tasks", "files", "files TEXT");
|
|
3797
|
+
}
|
|
3798
|
+
/** Add a column if it does not exist (SQLite version compatible). */
|
|
3799
|
+
ensureColumn(table, column, ddl) {
|
|
3800
|
+
const cols = this.db.prepare(`PRAGMA table_info(${table})`).all();
|
|
3801
|
+
if (!cols.some((c) => c.name === column)) {
|
|
3802
|
+
this.db.exec(`ALTER TABLE ${table} ADD COLUMN ${ddl}`);
|
|
3803
|
+
}
|
|
3781
3804
|
}
|
|
3782
3805
|
async create(params) {
|
|
3783
3806
|
const id = (0, import_crypto5.randomUUID)();
|
|
3784
3807
|
const now = nowISO();
|
|
3785
3808
|
this.db.prepare(
|
|
3786
|
-
`INSERT INTO lt_tasks (id, tenant_id, owner_type, owner_id, title, description, status, priority, due_date, metadata, parent_id, source_id, context, require_review, dependencies, result, failure_reason, workspace_id, project_id, created_at, updated_at)
|
|
3809
|
+
`INSERT INTO lt_tasks (id, tenant_id, owner_type, owner_id, title, description, status, priority, due_date, metadata, parent_id, source_id, context, require_review, dependencies, result, failure_reason, workspace_id, project_id, files, created_at, updated_at)
|
|
3787
3810
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`
|
|
3788
3811
|
).run(
|
|
3789
3812
|
id,
|
|
@@ -3805,6 +3828,7 @@ var LocalTaskStore = class {
|
|
|
3805
3828
|
params.failureReason || null,
|
|
3806
3829
|
params.workspaceId || null,
|
|
3807
3830
|
params.projectId || null,
|
|
3831
|
+
params.files ? JSON.stringify(params.files) : null,
|
|
3808
3832
|
now,
|
|
3809
3833
|
now
|
|
3810
3834
|
);
|
|
@@ -3857,8 +3881,14 @@ var LocalTaskStore = class {
|
|
|
3857
3881
|
for (const [key, value] of Object.entries(filter.metadata)) {
|
|
3858
3882
|
const safeKey = key.replace(/[^a-zA-Z0-9_]/g, "");
|
|
3859
3883
|
if (safeKey) {
|
|
3860
|
-
|
|
3861
|
-
|
|
3884
|
+
const strVal = String(value);
|
|
3885
|
+
if (strVal === "true" || strVal === "false") {
|
|
3886
|
+
conditions.push(`(json_extract(metadata, '$.${safeKey}') = ? OR json_extract(metadata, '$.${safeKey}') = ?)`);
|
|
3887
|
+
params.push(strVal, strVal === "true" ? 1 : 0);
|
|
3888
|
+
} else {
|
|
3889
|
+
conditions.push(`json_extract(metadata, '$.${safeKey}') = ?`);
|
|
3890
|
+
params.push(strVal);
|
|
3891
|
+
}
|
|
3862
3892
|
}
|
|
3863
3893
|
}
|
|
3864
3894
|
}
|
|
@@ -3944,6 +3974,10 @@ var LocalTaskStore = class {
|
|
|
3944
3974
|
setClauses.push("project_id = ?");
|
|
3945
3975
|
values.push(updates.projectId);
|
|
3946
3976
|
}
|
|
3977
|
+
if (updates.files !== void 0) {
|
|
3978
|
+
setClauses.push("files = ?");
|
|
3979
|
+
values.push(JSON.stringify(updates.files));
|
|
3980
|
+
}
|
|
3947
3981
|
if (setClauses.length === 1) return existing;
|
|
3948
3982
|
values.push(tenantId, id);
|
|
3949
3983
|
this.db.prepare(
|