@axiom-lattice/pg-stores 1.0.90 → 1.0.91
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 +8 -0
- package/dist/index.d.mts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +19 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/PostgreSQLWorkflowTrackingStore.test.ts +1 -1
- package/src/stores/PostgreSQLConnectionStore.ts +8 -0
- package/src/stores/PostgreSQLEvalStore.ts +12 -0
- package/src/stores/PostgreSQLWorkflowTrackingStore.ts +3 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @axiom-lattice/pg-stores@1.0.
|
|
2
|
+
> @axiom-lattice/pg-stores@1.0.91 build /home/runner/work/agentic/agentic/packages/pg-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[32m264.35 KB[39m
|
|
12
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m494.59 KB[39m
|
|
13
|
+
[32mCJS[39m ⚡️ Build success in 649ms
|
|
14
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m258.06 KB[39m
|
|
15
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m494.34 KB[39m
|
|
16
|
+
[32mESM[39m ⚡️ Build success in 652ms
|
|
17
17
|
[34mDTS[39m Build start
|
|
18
|
-
[32mDTS[39m ⚡️ Build success in
|
|
19
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m60.
|
|
20
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[32m60.
|
|
18
|
+
[32mDTS[39m ⚡️ Build success in 15828ms
|
|
19
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m60.77 KB[39m
|
|
20
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m60.77 KB[39m
|
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -275,6 +275,7 @@ declare class PostgreSQLDatabaseConfigStore implements DatabaseConfigStore {
|
|
|
275
275
|
declare class PostgreSQLConnectionStore implements ConnectionStore {
|
|
276
276
|
private db;
|
|
277
277
|
constructor(db: Pool);
|
|
278
|
+
listByTenant(tenantId: string): Promise<ConnectionEntry[]>;
|
|
278
279
|
listByType(tenantId: string, type: string): Promise<ConnectionEntry[]>;
|
|
279
280
|
getByKey(tenantId: string, type: string, key: string): Promise<ConnectionEntry | null>;
|
|
280
281
|
create(entry: Omit<ConnectionEntry, "id" | "createdAt" | "updatedAt">): Promise<ConnectionEntry>;
|
|
@@ -879,6 +880,8 @@ declare class PostgreSQLEvalStore implements EvalStore {
|
|
|
879
880
|
createRunResult(tenantId: string, runId: string, id: string, data: Omit<EvalRunResult, "id" | "runId" | "createdAt">): Promise<EvalRunResult>;
|
|
880
881
|
/** Update a run result with tenant isolation via the parent run */
|
|
881
882
|
updateRunResult(tenantId: string, id: string, updates: Partial<EvalRunResult>): Promise<EvalRunResult | null>;
|
|
883
|
+
/** Delete a run result by ID */
|
|
884
|
+
deleteRunResult(tenantId: string, id: string): Promise<boolean>;
|
|
882
885
|
/** Get a single run result by ID with tenant isolation */
|
|
883
886
|
private getRunResultById;
|
|
884
887
|
/** Aggregate report for a project including all runs */
|
package/dist/index.d.ts
CHANGED
|
@@ -275,6 +275,7 @@ declare class PostgreSQLDatabaseConfigStore implements DatabaseConfigStore {
|
|
|
275
275
|
declare class PostgreSQLConnectionStore implements ConnectionStore {
|
|
276
276
|
private db;
|
|
277
277
|
constructor(db: Pool);
|
|
278
|
+
listByTenant(tenantId: string): Promise<ConnectionEntry[]>;
|
|
278
279
|
listByType(tenantId: string, type: string): Promise<ConnectionEntry[]>;
|
|
279
280
|
getByKey(tenantId: string, type: string, key: string): Promise<ConnectionEntry | null>;
|
|
280
281
|
create(entry: Omit<ConnectionEntry, "id" | "createdAt" | "updatedAt">): Promise<ConnectionEntry>;
|
|
@@ -879,6 +880,8 @@ declare class PostgreSQLEvalStore implements EvalStore {
|
|
|
879
880
|
createRunResult(tenantId: string, runId: string, id: string, data: Omit<EvalRunResult, "id" | "runId" | "createdAt">): Promise<EvalRunResult>;
|
|
880
881
|
/** Update a run result with tenant isolation via the parent run */
|
|
881
882
|
updateRunResult(tenantId: string, id: string, updates: Partial<EvalRunResult>): Promise<EvalRunResult | null>;
|
|
883
|
+
/** Delete a run result by ID */
|
|
884
|
+
deleteRunResult(tenantId: string, id: string): Promise<boolean>;
|
|
882
885
|
/** Get a single run result by ID with tenant isolation */
|
|
883
886
|
private getRunResultById;
|
|
884
887
|
/** Aggregate report for a project including all runs */
|
package/dist/index.js
CHANGED
|
@@ -1356,6 +1356,13 @@ var PostgreSQLConnectionStore = class {
|
|
|
1356
1356
|
constructor(db) {
|
|
1357
1357
|
this.db = db;
|
|
1358
1358
|
}
|
|
1359
|
+
async listByTenant(tenantId) {
|
|
1360
|
+
const result = await this.db.query(
|
|
1361
|
+
`SELECT * FROM ${TABLE} WHERE tenant_id = $1 ORDER BY created_at`,
|
|
1362
|
+
[tenantId]
|
|
1363
|
+
);
|
|
1364
|
+
return result.rows.map((row) => this.mapRow(row));
|
|
1365
|
+
}
|
|
1359
1366
|
async listByType(tenantId, type) {
|
|
1360
1367
|
const result = await this.db.query(
|
|
1361
1368
|
`SELECT * FROM ${TABLE} WHERE tenant_id = $1 AND type = $2 ORDER BY created_at`,
|
|
@@ -3762,7 +3769,7 @@ function mapRowToRunStep(row) {
|
|
|
3762
3769
|
edgeTo: row.edge_to,
|
|
3763
3770
|
edgePurpose: row.edge_purpose,
|
|
3764
3771
|
input: safeParse(row.input, void 0),
|
|
3765
|
-
output: safeParse(row.output, void 0
|
|
3772
|
+
output: typeof row.output === "string" ? safeParse(row.output, row.output) : row.output ?? void 0,
|
|
3766
3773
|
status: row.status,
|
|
3767
3774
|
errorMessage: row.error_message,
|
|
3768
3775
|
startedAt: row.started_at,
|
|
@@ -4657,6 +4664,17 @@ var PostgreSQLEvalStore = class {
|
|
|
4657
4664
|
);
|
|
4658
4665
|
return rows.length ? this.mapRowToRunResult(rows[0]) : null;
|
|
4659
4666
|
}
|
|
4667
|
+
/** Delete a run result by ID */
|
|
4668
|
+
async deleteRunResult(tenantId, id) {
|
|
4669
|
+
await this.ensureInitialized();
|
|
4670
|
+
const result = await this.pool.query(
|
|
4671
|
+
`DELETE FROM lattice_eval_run_results
|
|
4672
|
+
WHERE id = $1
|
|
4673
|
+
AND run_id IN (SELECT id FROM lattice_eval_runs WHERE tenant_id = $2)`,
|
|
4674
|
+
[id, tenantId]
|
|
4675
|
+
);
|
|
4676
|
+
return (result.rowCount ?? 0) > 0;
|
|
4677
|
+
}
|
|
4660
4678
|
/** Get a single run result by ID with tenant isolation */
|
|
4661
4679
|
async getRunResultById(tenantId, id) {
|
|
4662
4680
|
await this.ensureInitialized();
|