@economic/agents 2.3.12 → 2.3.13

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.
Files changed (2) hide show
  1. package/dist/index.mjs +10 -2
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -387,9 +387,17 @@ function getChatRetentionMs(days) {
387
387
  //#endregion
388
388
  //#region src/server/features/migration.ts
389
389
  async function listLegacyConversations(db, userId) {
390
- const { results } = await db.prepare(`SELECT durable_object_name, title, summary, created_at, updated_at
390
+ try {
391
+ const { results } = await db.prepare(`SELECT durable_object_name, title, summary, created_at, updated_at
391
392
  FROM conversations WHERE durable_object_name LIKE ? ORDER BY updated_at ASC`).bind(`${userId}:%`).all();
392
- return results ?? [];
393
+ return results ?? [];
394
+ } catch (error) {
395
+ if (error instanceof Error && error.message.includes(`no such table: conversations`)) {
396
+ console.warn("[Migration] Legacy conversations table missing; skipping v1 migration", { userId });
397
+ return [];
398
+ }
399
+ throw error;
400
+ }
393
401
  }
394
402
  async function listLegacyFeedback(db, durableObjectName) {
395
403
  const { results } = await db.prepare(`SELECT message_id, rating, comment FROM message_ratings WHERE durable_object_name = ?`).bind(durableObjectName).all();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@economic/agents",
3
- "version": "2.3.12",
3
+ "version": "2.3.13",
4
4
  "description": "A starter for creating a TypeScript package.",
5
5
  "license": "MIT",
6
6
  "files": [