@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.
- package/dist/index.mjs +10 -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
|
-
|
|
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
|
-
|
|
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();
|