@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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @axiom-lattice/pg-stores@1.0.90 build /home/runner/work/agentic/agentic/packages/pg-stores
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
  CLI Building entry: src/index.ts
@@ -8,13 +8,13 @@
8
8
  CLI Target: es2020
9
9
  CJS Build start
10
10
  ESM Build start
11
- ESM dist/index.mjs 257.42 KB
12
- ESM dist/index.mjs.map 493.17 KB
13
- ESM ⚡️ Build success in 858ms
14
- CJS dist/index.js 263.71 KB
15
- CJS dist/index.js.map 493.42 KB
16
- CJS ⚡️ Build success in 859ms
11
+ CJS dist/index.js 264.35 KB
12
+ CJS dist/index.js.map 494.59 KB
13
+ CJS ⚡️ Build success in 649ms
14
+ ESM dist/index.mjs 258.06 KB
15
+ ESM dist/index.mjs.map 494.34 KB
16
+ ESM ⚡️ Build success in 652ms
17
17
  DTS Build start
18
- DTS ⚡️ Build success in 16012ms
19
- DTS dist/index.d.ts 60.60 KB
20
- DTS dist/index.d.mts 60.60 KB
18
+ DTS ⚡️ Build success in 15828ms
19
+ DTS dist/index.d.ts 60.77 KB
20
+ DTS dist/index.d.mts 60.77 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @axiom-lattice/pg-stores
2
2
 
3
+ ## 1.0.91
4
+
5
+ ### Patch Changes
6
+
7
+ - 2feab5c: add sse enhance
8
+ - Updated dependencies [2feab5c]
9
+ - @axiom-lattice/core@2.1.100
10
+
3
11
  ## 1.0.90
4
12
 
5
13
  ### Patch Changes
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();