@economic/agents 2.14.2 → 2.14.3
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/package.json +1 -1
- package/schema/0003_agent_chats.sql +24 -0
package/package.json
CHANGED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
-- ─── Global chat list ─────────────────────────────────────────────────────────────
|
|
2
|
+
-- One row per chat across every Assistant, synced by the owning Assistant DO
|
|
3
|
+
-- whenever a chat is created, updated, or deleted. Lets dashboards list and
|
|
4
|
+
-- page through chats without waking each DO.
|
|
5
|
+
--
|
|
6
|
+
-- Same DDL as the eva-dashboard migration 0005_agent_chats.sql; both apply to
|
|
7
|
+
-- the shared D1 database, so IF NOT EXISTS keeps this a no-op there.
|
|
8
|
+
|
|
9
|
+
CREATE TABLE IF NOT EXISTS agent_chats (
|
|
10
|
+
agent_name TEXT NOT NULL,
|
|
11
|
+
assistant_name TEXT NOT NULL,
|
|
12
|
+
chat_id TEXT NOT NULL,
|
|
13
|
+
title TEXT,
|
|
14
|
+
summary TEXT,
|
|
15
|
+
created_at INTEGER NOT NULL,
|
|
16
|
+
updated_at INTEGER NOT NULL,
|
|
17
|
+
positive_feedback_count INTEGER NOT NULL DEFAULT 0,
|
|
18
|
+
negative_feedback_count INTEGER NOT NULL DEFAULT 0,
|
|
19
|
+
|
|
20
|
+
PRIMARY KEY (agent_name, assistant_name, chat_id)
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
CREATE INDEX IF NOT EXISTS agent_chats_page
|
|
24
|
+
ON agent_chats(agent_name, updated_at DESC, assistant_name, chat_id);
|