@axiom-lattice/pg-stores 5.0.0 → 5.0.2

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/dist/index.mjs CHANGED
@@ -3494,6 +3494,7 @@ var PostgreSQLUserTenantLinkStore = class {
3494
3494
  };
3495
3495
 
3496
3496
  // src/stores/PostgreSQLWorkflowTrackingStore.ts
3497
+ import { randomUUID } from "crypto";
3497
3498
  import { Pool as Pool11 } from "pg";
3498
3499
 
3499
3500
  // src/migrations/workflow_tracking_migrations.ts
@@ -3654,7 +3655,7 @@ var PostgreSQLWorkflowTrackingStore = class {
3654
3655
  async createWorkflowRun(request) {
3655
3656
  await this.ensureInitialized();
3656
3657
  const now = /* @__PURE__ */ new Date();
3657
- const id = `${request.threadId}_${Date.now()}`;
3658
+ const id = `${request.threadId}_${Date.now()}_${randomUUID()}`;
3658
3659
  await this.pool.query(
3659
3660
  `INSERT INTO lattice_workflow_runs (id, tenant_id, assistant_id, thread_id, status, topology_edges, total_edges, completed_edges, metadata, started_at, created_at, updated_at)
3660
3661
  VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)`,
@@ -4540,8 +4541,8 @@ var PostgreSQLEvalStore = class {
4540
4541
  data.name,
4541
4542
  data.description || null,
4542
4543
  data.version || null,
4543
- JSON.stringify(data.judgeModelConfig),
4544
- JSON.stringify(data.targetServerConfig),
4544
+ JSON.stringify(data.judgeModelConfig ?? {}),
4545
+ JSON.stringify(data.targetServerConfig ?? {}),
4545
4546
  data.concurrency ?? 3,
4546
4547
  data.reportConfig === void 0 ? null : JSON.stringify(data.reportConfig)
4547
4548
  ]
@@ -5044,7 +5045,7 @@ var PostgreSQLEvalStore = class {
5044
5045
  AND run_id IN (SELECT id FROM lattice_eval_runs WHERE tenant_id = $${i + 1})
5045
5046
  RETURNING id, run_id, suite_name, case_id,
5046
5047
  pass, score, summary, dimension_results,
5047
- duration_ms, messages, logs, error, created_at`,
5048
+ duration_ms, messages, logs, error, interrupted, created_at`,
5048
5049
  vals
5049
5050
  );
5050
5051
  return rows.length ? this.mapRowToRunResult(rows[0]) : null;
@@ -6288,9 +6289,9 @@ var addApiKeyGrants = {
6288
6289
 
6289
6290
  // src/stores/PostgreSQLA2AApiKeyStore.ts
6290
6291
  import { encrypt as encrypt5, decrypt, safeDecrypt as safeDecrypt5 } from "@axiom-lattice/core";
6291
- import { randomUUID } from "crypto";
6292
+ import { randomUUID as randomUUID2 } from "crypto";
6292
6293
  function generateApiKey() {
6293
- return `a2a_${randomUUID().replace(/-/g, "")}`;
6294
+ return `a2a_${randomUUID2().replace(/-/g, "")}`;
6294
6295
  }
6295
6296
  function mapRowToRecord(row) {
6296
6297
  return {
@@ -6655,7 +6656,7 @@ var PostgreSQLOpenAuditStore = class {
6655
6656
  };
6656
6657
 
6657
6658
  // src/stores/PostgreSQLAgentWebAppStore.ts
6658
- import { randomUUID as randomUUID2 } from "crypto";
6659
+ import { randomUUID as randomUUID3 } from "crypto";
6659
6660
  import { Pool as Pool18 } from "pg";
6660
6661
 
6661
6662
  // src/migrations/agent_web_apps_migration.ts
@@ -6835,7 +6836,7 @@ var PostgreSQLAgentWebAppStore = class {
6835
6836
  }
6836
6837
  async create(tenantId, input) {
6837
6838
  await this.ensureInitialized();
6838
- const id = `webapp_${randomUUID2().replace(/-/g, "")}`;
6839
+ const id = `webapp_${randomUUID3().replace(/-/g, "")}`;
6839
6840
  const result = await this.pool.query(
6840
6841
  `INSERT INTO lattice_agent_web_apps
6841
6842
  (id, tenant_id, assistant_id, name, description, status, integration, scope, features, appearance, identity)
@@ -9728,7 +9729,7 @@ var PGVectorStoreProvider = class {
9728
9729
  );
9729
9730
  if (!embeddings) {
9730
9731
  throw new Error(
9731
- `No embedding model "${embeddingKey}" registered for tenant "${tenantId}", and no tenant or deployment default. Configure one in the model service panel.`
9732
+ `No embedding model "${embeddingKey}" registered for tenant "${tenantId}", and no default model available. Configure one in the model service panel.`
9732
9733
  );
9733
9734
  }
9734
9735
  return PGVectorStore.initialize(embeddings, {
@@ -10903,7 +10904,7 @@ var addModelProviderKindDefault = {
10903
10904
  };
10904
10905
 
10905
10906
  // src/stores/PostgreSQLCapabilityBundleStore.ts
10906
- import { randomUUID as randomUUID3 } from "crypto";
10907
+ import { randomUUID as randomUUID4 } from "crypto";
10907
10908
  import { Pool as Pool26 } from "pg";
10908
10909
  var duplicateMessage = "Capability bundle key already exists for tenant";
10909
10910
  function map(row) {
@@ -11008,7 +11009,7 @@ var PostgreSQLCapabilityBundleStore = class {
11008
11009
  VALUES ($1, $2, $3, $4, $5, $6::jsonb)
11009
11010
  RETURNING id, tenant_id, bundle_key, name, description, capabilities, created_at, updated_at::text AS updated_at`,
11010
11011
  [
11011
- randomUUID3(),
11012
+ randomUUID4(),
11012
11013
  tenantId,
11013
11014
  input.key,
11014
11015
  input.name,
@@ -11812,7 +11813,7 @@ var PostgreSQLProjectRoomReadStateStore = class {
11812
11813
  };
11813
11814
 
11814
11815
  // src/stores/PostgreSQLUserPushSubscriptionStore.ts
11815
- import { randomUUID as randomUUID4 } from "crypto";
11816
+ import { randomUUID as randomUUID5 } from "crypto";
11816
11817
  var columns4 = "id, tenant_id, user_id, endpoint, p256dh, auth, user_agent, created_at";
11817
11818
  function mapRow7(row) {
11818
11819
  if (typeof row.id !== "string" || typeof row.tenant_id !== "string" || typeof row.user_id !== "string" || typeof row.endpoint !== "string" || typeof row.p256dh !== "string" || typeof row.auth !== "string" || !(row.created_at instanceof Date) || Number.isNaN(row.created_at.getTime())) {
@@ -11849,7 +11850,7 @@ var PostgreSQLUserPushSubscriptionStore = class {
11849
11850
  ON CONFLICT (tenant_id, user_id, endpoint) DO UPDATE
11850
11851
  SET p256dh = EXCLUDED.p256dh, auth = EXCLUDED.auth, user_agent = EXCLUDED.user_agent
11851
11852
  RETURNING ${columns4}`,
11852
- [randomUUID4(), input.tenantId, input.userId, input.endpoint, input.keys.p256dh, input.keys.auth, input.userAgent ?? null]
11853
+ [randomUUID5(), input.tenantId, input.userId, input.endpoint, input.keys.p256dh, input.keys.auth, input.userAgent ?? null]
11853
11854
  );
11854
11855
  return mapRow7(result.rows[0]);
11855
11856
  }
@@ -15085,7 +15086,7 @@ var PostgreSQLSkillStore = class {
15085
15086
  WHERE tenant_id = $1 AND sub_skills @> to_jsonb($2::text)
15086
15087
  ORDER BY created_at DESC
15087
15088
  `,
15088
- [tenantId, JSON.stringify([parentSkillName])]
15089
+ [tenantId, parentSkillName]
15089
15090
  );
15090
15091
  return result.rows.map(this.mapRowToSkill);
15091
15092
  }