@ykurilov/agent-chat-background 0.0.0-stage → 0.55.0
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/CHANGELOG.md +369 -0
- package/LICENSE +21 -0
- package/README.md +92 -2
- package/dist/chunk-4RA3JT6K.js +9 -0
- package/dist/chunk-4RA3JT6K.js.map +1 -0
- package/dist/chunk-4XFSUFM6.js +53 -0
- package/dist/chunk-4XFSUFM6.js.map +1 -0
- package/dist/index.js +756 -0
- package/dist/index.js.map +1 -0
- package/dist/labels.js +14 -0
- package/dist/labels.js.map +1 -0
- package/dist/postgres.js +212 -0
- package/dist/postgres.js.map +1 -0
- package/dist/sqlite.js +184 -0
- package/dist/sqlite.js.map +1 -0
- package/dist/types/background-tasks.d.ts +18 -0
- package/dist/types/background-tool.d.ts +16 -0
- package/dist/types/helper-task.d.ts +17 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/keyed-lock.d.ts +3 -0
- package/dist/types/labels.d.ts +10 -0
- package/dist/types/postgres.d.ts +9 -0
- package/dist/types/sqlite.d.ts +8 -0
- package/dist/types/store/memory.d.ts +3 -0
- package/dist/types/store/migration-settings.d.ts +4 -0
- package/dist/types/store/postgres-schema.d.ts +406 -0
- package/dist/types/store/postgres.d.ts +12 -0
- package/dist/types/store/sqlite-schema.d.ts +431 -0
- package/dist/types/store/sqlite.d.ts +6 -0
- package/dist/types/store/task-store.d.ts +23 -0
- package/dist/types/task-delivery.d.ts +24 -0
- package/dist/types/task-runner.d.ts +51 -0
- package/dist/types/task-tools.d.ts +13 -0
- package/dist/types/types.d.ts +97 -0
- package/drizzle/postgres/0000_init.sql +28 -0
- package/drizzle/postgres/0001_delivery_key.sql +1 -0
- package/drizzle/postgres/meta/0000_snapshot.json +229 -0
- package/drizzle/postgres/meta/0001_snapshot.json +235 -0
- package/drizzle/postgres/meta/_journal.json +20 -0
- package/drizzle/sqlite/0000_init.sql +28 -0
- package/drizzle/sqlite/0001_delivery_key.sql +1 -0
- package/drizzle/sqlite/meta/0000_snapshot.json +208 -0
- package/drizzle/sqlite/meta/0001_snapshot.json +215 -0
- package/drizzle/sqlite/meta/_journal.json +20 -0
- package/package.json +75 -3
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
CREATE TABLE "agent_chat"."background_tasks" (
|
|
2
|
+
"id" text PRIMARY KEY NOT NULL,
|
|
3
|
+
"owner_id" text NOT NULL,
|
|
4
|
+
"chat_id" text NOT NULL,
|
|
5
|
+
"message_id" text NOT NULL,
|
|
6
|
+
"tool_call_id" text NOT NULL,
|
|
7
|
+
"channel" text NOT NULL,
|
|
8
|
+
"kind" text NOT NULL,
|
|
9
|
+
"name" text NOT NULL,
|
|
10
|
+
"input" jsonb,
|
|
11
|
+
"title" text NOT NULL,
|
|
12
|
+
"status" text NOT NULL,
|
|
13
|
+
"helper_messages" jsonb,
|
|
14
|
+
"progress" jsonb,
|
|
15
|
+
"result" jsonb,
|
|
16
|
+
"error" text,
|
|
17
|
+
"lease_owner" text,
|
|
18
|
+
"lease_until" timestamp (3) with time zone,
|
|
19
|
+
"attempt" integer DEFAULT 0 NOT NULL,
|
|
20
|
+
"created_at" timestamp (3) with time zone NOT NULL,
|
|
21
|
+
"started_at" timestamp (3) with time zone,
|
|
22
|
+
"finished_at" timestamp (3) with time zone,
|
|
23
|
+
"delivered_at" timestamp (3) with time zone
|
|
24
|
+
);
|
|
25
|
+
--> statement-breakpoint
|
|
26
|
+
CREATE INDEX "background_tasks_status_lease_idx" ON "agent_chat"."background_tasks" USING btree ("status","lease_until");--> statement-breakpoint
|
|
27
|
+
CREATE INDEX "background_tasks_owner_status_idx" ON "agent_chat"."background_tasks" USING btree ("owner_id","status");--> statement-breakpoint
|
|
28
|
+
CREATE INDEX "background_tasks_chat_delivered_idx" ON "agent_chat"."background_tasks" USING btree ("chat_id","delivered_at");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ALTER TABLE "agent_chat"."background_tasks" ADD COLUMN "delivery_key" text;
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "ff2350f8-5229-4c3e-9394-d4d88fc1f225",
|
|
3
|
+
"prevId": "00000000-0000-0000-0000-000000000000",
|
|
4
|
+
"version": "7",
|
|
5
|
+
"dialect": "postgresql",
|
|
6
|
+
"tables": {
|
|
7
|
+
"agent_chat.background_tasks": {
|
|
8
|
+
"name": "background_tasks",
|
|
9
|
+
"schema": "agent_chat",
|
|
10
|
+
"columns": {
|
|
11
|
+
"id": {
|
|
12
|
+
"name": "id",
|
|
13
|
+
"type": "text",
|
|
14
|
+
"primaryKey": true,
|
|
15
|
+
"notNull": true
|
|
16
|
+
},
|
|
17
|
+
"owner_id": {
|
|
18
|
+
"name": "owner_id",
|
|
19
|
+
"type": "text",
|
|
20
|
+
"primaryKey": false,
|
|
21
|
+
"notNull": true
|
|
22
|
+
},
|
|
23
|
+
"chat_id": {
|
|
24
|
+
"name": "chat_id",
|
|
25
|
+
"type": "text",
|
|
26
|
+
"primaryKey": false,
|
|
27
|
+
"notNull": true
|
|
28
|
+
},
|
|
29
|
+
"message_id": {
|
|
30
|
+
"name": "message_id",
|
|
31
|
+
"type": "text",
|
|
32
|
+
"primaryKey": false,
|
|
33
|
+
"notNull": true
|
|
34
|
+
},
|
|
35
|
+
"tool_call_id": {
|
|
36
|
+
"name": "tool_call_id",
|
|
37
|
+
"type": "text",
|
|
38
|
+
"primaryKey": false,
|
|
39
|
+
"notNull": true
|
|
40
|
+
},
|
|
41
|
+
"channel": {
|
|
42
|
+
"name": "channel",
|
|
43
|
+
"type": "text",
|
|
44
|
+
"primaryKey": false,
|
|
45
|
+
"notNull": true
|
|
46
|
+
},
|
|
47
|
+
"kind": {
|
|
48
|
+
"name": "kind",
|
|
49
|
+
"type": "text",
|
|
50
|
+
"primaryKey": false,
|
|
51
|
+
"notNull": true
|
|
52
|
+
},
|
|
53
|
+
"name": {
|
|
54
|
+
"name": "name",
|
|
55
|
+
"type": "text",
|
|
56
|
+
"primaryKey": false,
|
|
57
|
+
"notNull": true
|
|
58
|
+
},
|
|
59
|
+
"input": {
|
|
60
|
+
"name": "input",
|
|
61
|
+
"type": "jsonb",
|
|
62
|
+
"primaryKey": false,
|
|
63
|
+
"notNull": false
|
|
64
|
+
},
|
|
65
|
+
"title": {
|
|
66
|
+
"name": "title",
|
|
67
|
+
"type": "text",
|
|
68
|
+
"primaryKey": false,
|
|
69
|
+
"notNull": true
|
|
70
|
+
},
|
|
71
|
+
"status": {
|
|
72
|
+
"name": "status",
|
|
73
|
+
"type": "text",
|
|
74
|
+
"primaryKey": false,
|
|
75
|
+
"notNull": true
|
|
76
|
+
},
|
|
77
|
+
"helper_messages": {
|
|
78
|
+
"name": "helper_messages",
|
|
79
|
+
"type": "jsonb",
|
|
80
|
+
"primaryKey": false,
|
|
81
|
+
"notNull": false
|
|
82
|
+
},
|
|
83
|
+
"progress": {
|
|
84
|
+
"name": "progress",
|
|
85
|
+
"type": "jsonb",
|
|
86
|
+
"primaryKey": false,
|
|
87
|
+
"notNull": false
|
|
88
|
+
},
|
|
89
|
+
"result": {
|
|
90
|
+
"name": "result",
|
|
91
|
+
"type": "jsonb",
|
|
92
|
+
"primaryKey": false,
|
|
93
|
+
"notNull": false
|
|
94
|
+
},
|
|
95
|
+
"error": {
|
|
96
|
+
"name": "error",
|
|
97
|
+
"type": "text",
|
|
98
|
+
"primaryKey": false,
|
|
99
|
+
"notNull": false
|
|
100
|
+
},
|
|
101
|
+
"lease_owner": {
|
|
102
|
+
"name": "lease_owner",
|
|
103
|
+
"type": "text",
|
|
104
|
+
"primaryKey": false,
|
|
105
|
+
"notNull": false
|
|
106
|
+
},
|
|
107
|
+
"lease_until": {
|
|
108
|
+
"name": "lease_until",
|
|
109
|
+
"type": "timestamp (3) with time zone",
|
|
110
|
+
"primaryKey": false,
|
|
111
|
+
"notNull": false
|
|
112
|
+
},
|
|
113
|
+
"attempt": {
|
|
114
|
+
"name": "attempt",
|
|
115
|
+
"type": "integer",
|
|
116
|
+
"primaryKey": false,
|
|
117
|
+
"notNull": true,
|
|
118
|
+
"default": 0
|
|
119
|
+
},
|
|
120
|
+
"created_at": {
|
|
121
|
+
"name": "created_at",
|
|
122
|
+
"type": "timestamp (3) with time zone",
|
|
123
|
+
"primaryKey": false,
|
|
124
|
+
"notNull": true
|
|
125
|
+
},
|
|
126
|
+
"started_at": {
|
|
127
|
+
"name": "started_at",
|
|
128
|
+
"type": "timestamp (3) with time zone",
|
|
129
|
+
"primaryKey": false,
|
|
130
|
+
"notNull": false
|
|
131
|
+
},
|
|
132
|
+
"finished_at": {
|
|
133
|
+
"name": "finished_at",
|
|
134
|
+
"type": "timestamp (3) with time zone",
|
|
135
|
+
"primaryKey": false,
|
|
136
|
+
"notNull": false
|
|
137
|
+
},
|
|
138
|
+
"delivered_at": {
|
|
139
|
+
"name": "delivered_at",
|
|
140
|
+
"type": "timestamp (3) with time zone",
|
|
141
|
+
"primaryKey": false,
|
|
142
|
+
"notNull": false
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"indexes": {
|
|
146
|
+
"background_tasks_status_lease_idx": {
|
|
147
|
+
"name": "background_tasks_status_lease_idx",
|
|
148
|
+
"columns": [
|
|
149
|
+
{
|
|
150
|
+
"expression": "status",
|
|
151
|
+
"isExpression": false,
|
|
152
|
+
"asc": true,
|
|
153
|
+
"nulls": "last"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"expression": "lease_until",
|
|
157
|
+
"isExpression": false,
|
|
158
|
+
"asc": true,
|
|
159
|
+
"nulls": "last"
|
|
160
|
+
}
|
|
161
|
+
],
|
|
162
|
+
"isUnique": false,
|
|
163
|
+
"concurrently": false,
|
|
164
|
+
"method": "btree",
|
|
165
|
+
"with": {}
|
|
166
|
+
},
|
|
167
|
+
"background_tasks_owner_status_idx": {
|
|
168
|
+
"name": "background_tasks_owner_status_idx",
|
|
169
|
+
"columns": [
|
|
170
|
+
{
|
|
171
|
+
"expression": "owner_id",
|
|
172
|
+
"isExpression": false,
|
|
173
|
+
"asc": true,
|
|
174
|
+
"nulls": "last"
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"expression": "status",
|
|
178
|
+
"isExpression": false,
|
|
179
|
+
"asc": true,
|
|
180
|
+
"nulls": "last"
|
|
181
|
+
}
|
|
182
|
+
],
|
|
183
|
+
"isUnique": false,
|
|
184
|
+
"concurrently": false,
|
|
185
|
+
"method": "btree",
|
|
186
|
+
"with": {}
|
|
187
|
+
},
|
|
188
|
+
"background_tasks_chat_delivered_idx": {
|
|
189
|
+
"name": "background_tasks_chat_delivered_idx",
|
|
190
|
+
"columns": [
|
|
191
|
+
{
|
|
192
|
+
"expression": "chat_id",
|
|
193
|
+
"isExpression": false,
|
|
194
|
+
"asc": true,
|
|
195
|
+
"nulls": "last"
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"expression": "delivered_at",
|
|
199
|
+
"isExpression": false,
|
|
200
|
+
"asc": true,
|
|
201
|
+
"nulls": "last"
|
|
202
|
+
}
|
|
203
|
+
],
|
|
204
|
+
"isUnique": false,
|
|
205
|
+
"concurrently": false,
|
|
206
|
+
"method": "btree",
|
|
207
|
+
"with": {}
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
"foreignKeys": {},
|
|
211
|
+
"compositePrimaryKeys": {},
|
|
212
|
+
"uniqueConstraints": {},
|
|
213
|
+
"policies": {},
|
|
214
|
+
"checkConstraints": {},
|
|
215
|
+
"isRLSEnabled": false
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
"enums": {},
|
|
219
|
+
"schemas": {},
|
|
220
|
+
"sequences": {},
|
|
221
|
+
"roles": {},
|
|
222
|
+
"policies": {},
|
|
223
|
+
"views": {},
|
|
224
|
+
"_meta": {
|
|
225
|
+
"columns": {},
|
|
226
|
+
"schemas": {},
|
|
227
|
+
"tables": {}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "91b4552b-82f6-4ece-a401-81d8c9873358",
|
|
3
|
+
"prevId": "ff2350f8-5229-4c3e-9394-d4d88fc1f225",
|
|
4
|
+
"version": "7",
|
|
5
|
+
"dialect": "postgresql",
|
|
6
|
+
"tables": {
|
|
7
|
+
"agent_chat.background_tasks": {
|
|
8
|
+
"name": "background_tasks",
|
|
9
|
+
"schema": "agent_chat",
|
|
10
|
+
"columns": {
|
|
11
|
+
"id": {
|
|
12
|
+
"name": "id",
|
|
13
|
+
"type": "text",
|
|
14
|
+
"primaryKey": true,
|
|
15
|
+
"notNull": true
|
|
16
|
+
},
|
|
17
|
+
"owner_id": {
|
|
18
|
+
"name": "owner_id",
|
|
19
|
+
"type": "text",
|
|
20
|
+
"primaryKey": false,
|
|
21
|
+
"notNull": true
|
|
22
|
+
},
|
|
23
|
+
"chat_id": {
|
|
24
|
+
"name": "chat_id",
|
|
25
|
+
"type": "text",
|
|
26
|
+
"primaryKey": false,
|
|
27
|
+
"notNull": true
|
|
28
|
+
},
|
|
29
|
+
"message_id": {
|
|
30
|
+
"name": "message_id",
|
|
31
|
+
"type": "text",
|
|
32
|
+
"primaryKey": false,
|
|
33
|
+
"notNull": true
|
|
34
|
+
},
|
|
35
|
+
"tool_call_id": {
|
|
36
|
+
"name": "tool_call_id",
|
|
37
|
+
"type": "text",
|
|
38
|
+
"primaryKey": false,
|
|
39
|
+
"notNull": true
|
|
40
|
+
},
|
|
41
|
+
"channel": {
|
|
42
|
+
"name": "channel",
|
|
43
|
+
"type": "text",
|
|
44
|
+
"primaryKey": false,
|
|
45
|
+
"notNull": true
|
|
46
|
+
},
|
|
47
|
+
"kind": {
|
|
48
|
+
"name": "kind",
|
|
49
|
+
"type": "text",
|
|
50
|
+
"primaryKey": false,
|
|
51
|
+
"notNull": true
|
|
52
|
+
},
|
|
53
|
+
"name": {
|
|
54
|
+
"name": "name",
|
|
55
|
+
"type": "text",
|
|
56
|
+
"primaryKey": false,
|
|
57
|
+
"notNull": true
|
|
58
|
+
},
|
|
59
|
+
"input": {
|
|
60
|
+
"name": "input",
|
|
61
|
+
"type": "jsonb",
|
|
62
|
+
"primaryKey": false,
|
|
63
|
+
"notNull": false
|
|
64
|
+
},
|
|
65
|
+
"title": {
|
|
66
|
+
"name": "title",
|
|
67
|
+
"type": "text",
|
|
68
|
+
"primaryKey": false,
|
|
69
|
+
"notNull": true
|
|
70
|
+
},
|
|
71
|
+
"status": {
|
|
72
|
+
"name": "status",
|
|
73
|
+
"type": "text",
|
|
74
|
+
"primaryKey": false,
|
|
75
|
+
"notNull": true
|
|
76
|
+
},
|
|
77
|
+
"helper_messages": {
|
|
78
|
+
"name": "helper_messages",
|
|
79
|
+
"type": "jsonb",
|
|
80
|
+
"primaryKey": false,
|
|
81
|
+
"notNull": false
|
|
82
|
+
},
|
|
83
|
+
"progress": {
|
|
84
|
+
"name": "progress",
|
|
85
|
+
"type": "jsonb",
|
|
86
|
+
"primaryKey": false,
|
|
87
|
+
"notNull": false
|
|
88
|
+
},
|
|
89
|
+
"result": {
|
|
90
|
+
"name": "result",
|
|
91
|
+
"type": "jsonb",
|
|
92
|
+
"primaryKey": false,
|
|
93
|
+
"notNull": false
|
|
94
|
+
},
|
|
95
|
+
"error": {
|
|
96
|
+
"name": "error",
|
|
97
|
+
"type": "text",
|
|
98
|
+
"primaryKey": false,
|
|
99
|
+
"notNull": false
|
|
100
|
+
},
|
|
101
|
+
"lease_owner": {
|
|
102
|
+
"name": "lease_owner",
|
|
103
|
+
"type": "text",
|
|
104
|
+
"primaryKey": false,
|
|
105
|
+
"notNull": false
|
|
106
|
+
},
|
|
107
|
+
"lease_until": {
|
|
108
|
+
"name": "lease_until",
|
|
109
|
+
"type": "timestamp (3) with time zone",
|
|
110
|
+
"primaryKey": false,
|
|
111
|
+
"notNull": false
|
|
112
|
+
},
|
|
113
|
+
"attempt": {
|
|
114
|
+
"name": "attempt",
|
|
115
|
+
"type": "integer",
|
|
116
|
+
"primaryKey": false,
|
|
117
|
+
"notNull": true,
|
|
118
|
+
"default": 0
|
|
119
|
+
},
|
|
120
|
+
"created_at": {
|
|
121
|
+
"name": "created_at",
|
|
122
|
+
"type": "timestamp (3) with time zone",
|
|
123
|
+
"primaryKey": false,
|
|
124
|
+
"notNull": true
|
|
125
|
+
},
|
|
126
|
+
"started_at": {
|
|
127
|
+
"name": "started_at",
|
|
128
|
+
"type": "timestamp (3) with time zone",
|
|
129
|
+
"primaryKey": false,
|
|
130
|
+
"notNull": false
|
|
131
|
+
},
|
|
132
|
+
"finished_at": {
|
|
133
|
+
"name": "finished_at",
|
|
134
|
+
"type": "timestamp (3) with time zone",
|
|
135
|
+
"primaryKey": false,
|
|
136
|
+
"notNull": false
|
|
137
|
+
},
|
|
138
|
+
"delivered_at": {
|
|
139
|
+
"name": "delivered_at",
|
|
140
|
+
"type": "timestamp (3) with time zone",
|
|
141
|
+
"primaryKey": false,
|
|
142
|
+
"notNull": false
|
|
143
|
+
},
|
|
144
|
+
"delivery_key": {
|
|
145
|
+
"name": "delivery_key",
|
|
146
|
+
"type": "text",
|
|
147
|
+
"primaryKey": false,
|
|
148
|
+
"notNull": false
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
"indexes": {
|
|
152
|
+
"background_tasks_status_lease_idx": {
|
|
153
|
+
"name": "background_tasks_status_lease_idx",
|
|
154
|
+
"columns": [
|
|
155
|
+
{
|
|
156
|
+
"expression": "status",
|
|
157
|
+
"isExpression": false,
|
|
158
|
+
"asc": true,
|
|
159
|
+
"nulls": "last"
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"expression": "lease_until",
|
|
163
|
+
"isExpression": false,
|
|
164
|
+
"asc": true,
|
|
165
|
+
"nulls": "last"
|
|
166
|
+
}
|
|
167
|
+
],
|
|
168
|
+
"isUnique": false,
|
|
169
|
+
"concurrently": false,
|
|
170
|
+
"method": "btree",
|
|
171
|
+
"with": {}
|
|
172
|
+
},
|
|
173
|
+
"background_tasks_owner_status_idx": {
|
|
174
|
+
"name": "background_tasks_owner_status_idx",
|
|
175
|
+
"columns": [
|
|
176
|
+
{
|
|
177
|
+
"expression": "owner_id",
|
|
178
|
+
"isExpression": false,
|
|
179
|
+
"asc": true,
|
|
180
|
+
"nulls": "last"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"expression": "status",
|
|
184
|
+
"isExpression": false,
|
|
185
|
+
"asc": true,
|
|
186
|
+
"nulls": "last"
|
|
187
|
+
}
|
|
188
|
+
],
|
|
189
|
+
"isUnique": false,
|
|
190
|
+
"concurrently": false,
|
|
191
|
+
"method": "btree",
|
|
192
|
+
"with": {}
|
|
193
|
+
},
|
|
194
|
+
"background_tasks_chat_delivered_idx": {
|
|
195
|
+
"name": "background_tasks_chat_delivered_idx",
|
|
196
|
+
"columns": [
|
|
197
|
+
{
|
|
198
|
+
"expression": "chat_id",
|
|
199
|
+
"isExpression": false,
|
|
200
|
+
"asc": true,
|
|
201
|
+
"nulls": "last"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"expression": "delivered_at",
|
|
205
|
+
"isExpression": false,
|
|
206
|
+
"asc": true,
|
|
207
|
+
"nulls": "last"
|
|
208
|
+
}
|
|
209
|
+
],
|
|
210
|
+
"isUnique": false,
|
|
211
|
+
"concurrently": false,
|
|
212
|
+
"method": "btree",
|
|
213
|
+
"with": {}
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
"foreignKeys": {},
|
|
217
|
+
"compositePrimaryKeys": {},
|
|
218
|
+
"uniqueConstraints": {},
|
|
219
|
+
"policies": {},
|
|
220
|
+
"checkConstraints": {},
|
|
221
|
+
"isRLSEnabled": false
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
"enums": {},
|
|
225
|
+
"schemas": {},
|
|
226
|
+
"sequences": {},
|
|
227
|
+
"roles": {},
|
|
228
|
+
"policies": {},
|
|
229
|
+
"views": {},
|
|
230
|
+
"_meta": {
|
|
231
|
+
"columns": {},
|
|
232
|
+
"schemas": {},
|
|
233
|
+
"tables": {}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "7",
|
|
3
|
+
"dialect": "postgresql",
|
|
4
|
+
"entries": [
|
|
5
|
+
{
|
|
6
|
+
"idx": 0,
|
|
7
|
+
"version": "7",
|
|
8
|
+
"when": 1791177856034,
|
|
9
|
+
"tag": "0000_init",
|
|
10
|
+
"breakpoints": true
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"idx": 1,
|
|
14
|
+
"version": "7",
|
|
15
|
+
"when": 1791184440303,
|
|
16
|
+
"tag": "0001_delivery_key",
|
|
17
|
+
"breakpoints": true
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
CREATE TABLE `background_tasks` (
|
|
2
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
3
|
+
`owner_id` text NOT NULL,
|
|
4
|
+
`chat_id` text NOT NULL,
|
|
5
|
+
`message_id` text NOT NULL,
|
|
6
|
+
`tool_call_id` text NOT NULL,
|
|
7
|
+
`channel` text NOT NULL,
|
|
8
|
+
`kind` text NOT NULL,
|
|
9
|
+
`name` text NOT NULL,
|
|
10
|
+
`input` text,
|
|
11
|
+
`title` text NOT NULL,
|
|
12
|
+
`status` text NOT NULL,
|
|
13
|
+
`helper_messages` text,
|
|
14
|
+
`progress` text,
|
|
15
|
+
`result` text,
|
|
16
|
+
`error` text,
|
|
17
|
+
`lease_owner` text,
|
|
18
|
+
`lease_until` integer,
|
|
19
|
+
`attempt` integer DEFAULT 0 NOT NULL,
|
|
20
|
+
`created_at` integer NOT NULL,
|
|
21
|
+
`started_at` integer,
|
|
22
|
+
`finished_at` integer,
|
|
23
|
+
`delivered_at` integer
|
|
24
|
+
);
|
|
25
|
+
--> statement-breakpoint
|
|
26
|
+
CREATE INDEX `background_tasks_status_lease_idx` ON `background_tasks` (`status`,`lease_until`);--> statement-breakpoint
|
|
27
|
+
CREATE INDEX `background_tasks_owner_status_idx` ON `background_tasks` (`owner_id`,`status`);--> statement-breakpoint
|
|
28
|
+
CREATE INDEX `background_tasks_chat_delivered_idx` ON `background_tasks` (`chat_id`,`delivered_at`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ALTER TABLE `background_tasks` ADD `delivery_key` text;
|