@agi-cli/database 0.1.55

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.
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,45 @@
1
+ CREATE TABLE `artifacts` (
2
+ `id` text PRIMARY KEY NOT NULL,
3
+ `message_part_id` text,
4
+ `kind` text NOT NULL,
5
+ `path` text,
6
+ `mime` text,
7
+ `size` integer,
8
+ `sha256` text,
9
+ FOREIGN KEY (`message_part_id`) REFERENCES `message_parts`(`id`) ON UPDATE no action ON DELETE cascade
10
+ );
11
+ --> statement-breakpoint
12
+ CREATE UNIQUE INDEX `artifacts_message_part_id_unique` ON `artifacts` (`message_part_id`);--> statement-breakpoint
13
+ CREATE TABLE `message_parts` (
14
+ `id` text PRIMARY KEY NOT NULL,
15
+ `message_id` text NOT NULL,
16
+ `index` integer NOT NULL,
17
+ `type` text NOT NULL,
18
+ `content` text NOT NULL,
19
+ `agent` text NOT NULL,
20
+ `provider` text NOT NULL,
21
+ `model` text NOT NULL,
22
+ FOREIGN KEY (`message_id`) REFERENCES `messages`(`id`) ON UPDATE no action ON DELETE cascade
23
+ );
24
+ --> statement-breakpoint
25
+ CREATE TABLE `messages` (
26
+ `id` text PRIMARY KEY NOT NULL,
27
+ `session_id` text NOT NULL,
28
+ `role` text NOT NULL,
29
+ `status` text NOT NULL,
30
+ `agent` text NOT NULL,
31
+ `provider` text NOT NULL,
32
+ `model` text NOT NULL,
33
+ `created_at` integer NOT NULL,
34
+ FOREIGN KEY (`session_id`) REFERENCES `sessions`(`id`) ON UPDATE no action ON DELETE cascade
35
+ );
36
+ --> statement-breakpoint
37
+ CREATE TABLE `sessions` (
38
+ `id` text PRIMARY KEY NOT NULL,
39
+ `title` text,
40
+ `agent` text NOT NULL,
41
+ `provider` text NOT NULL,
42
+ `model` text NOT NULL,
43
+ `project_path` text NOT NULL,
44
+ `created_at` integer NOT NULL
45
+ );
@@ -0,0 +1,16 @@
1
+ ALTER TABLE `message_parts` ADD `started_at` integer;--> statement-breakpoint
2
+ ALTER TABLE `message_parts` ADD `completed_at` integer;--> statement-breakpoint
3
+ ALTER TABLE `message_parts` ADD `tool_name` text;--> statement-breakpoint
4
+ ALTER TABLE `message_parts` ADD `tool_call_id` text;--> statement-breakpoint
5
+ ALTER TABLE `message_parts` ADD `tool_duration_ms` integer;--> statement-breakpoint
6
+ ALTER TABLE `messages` ADD `completed_at` integer;--> statement-breakpoint
7
+ ALTER TABLE `messages` ADD `latency_ms` integer;--> statement-breakpoint
8
+ ALTER TABLE `messages` ADD `prompt_tokens` integer;--> statement-breakpoint
9
+ ALTER TABLE `messages` ADD `completion_tokens` integer;--> statement-breakpoint
10
+ ALTER TABLE `messages` ADD `total_tokens` integer;--> statement-breakpoint
11
+ ALTER TABLE `messages` ADD `error` text;--> statement-breakpoint
12
+ ALTER TABLE `sessions` ADD `last_active_at` integer;--> statement-breakpoint
13
+ ALTER TABLE `sessions` ADD `total_input_tokens` integer;--> statement-breakpoint
14
+ ALTER TABLE `sessions` ADD `total_output_tokens` integer;--> statement-breakpoint
15
+ ALTER TABLE `sessions` ADD `total_tool_time_ms` integer;--> statement-breakpoint
16
+ ALTER TABLE `sessions` ADD `tool_counts_json` text;
@@ -0,0 +1 @@
1
+ ALTER TABLE `message_parts` ADD `step_index` integer;
@@ -0,0 +1,3 @@
1
+ ALTER TABLE `messages` ADD `error_type` text;--> statement-breakpoint
2
+ ALTER TABLE `messages` ADD `error_details` text;--> statement-breakpoint
3
+ ALTER TABLE `messages` ADD `is_aborted` integer;
@@ -0,0 +1,304 @@
1
+ {
2
+ "version": "6",
3
+ "dialect": "sqlite",
4
+ "id": "81f1bf57-02b8-4986-ac2a-b13dbc70cbc6",
5
+ "prevId": "00000000-0000-0000-0000-000000000000",
6
+ "tables": {
7
+ "artifacts": {
8
+ "name": "artifacts",
9
+ "columns": {
10
+ "id": {
11
+ "name": "id",
12
+ "type": "text",
13
+ "primaryKey": true,
14
+ "notNull": true,
15
+ "autoincrement": false
16
+ },
17
+ "message_part_id": {
18
+ "name": "message_part_id",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": false,
22
+ "autoincrement": false
23
+ },
24
+ "kind": {
25
+ "name": "kind",
26
+ "type": "text",
27
+ "primaryKey": false,
28
+ "notNull": true,
29
+ "autoincrement": false
30
+ },
31
+ "path": {
32
+ "name": "path",
33
+ "type": "text",
34
+ "primaryKey": false,
35
+ "notNull": false,
36
+ "autoincrement": false
37
+ },
38
+ "mime": {
39
+ "name": "mime",
40
+ "type": "text",
41
+ "primaryKey": false,
42
+ "notNull": false,
43
+ "autoincrement": false
44
+ },
45
+ "size": {
46
+ "name": "size",
47
+ "type": "integer",
48
+ "primaryKey": false,
49
+ "notNull": false,
50
+ "autoincrement": false
51
+ },
52
+ "sha256": {
53
+ "name": "sha256",
54
+ "type": "text",
55
+ "primaryKey": false,
56
+ "notNull": false,
57
+ "autoincrement": false
58
+ }
59
+ },
60
+ "indexes": {
61
+ "artifacts_message_part_id_unique": {
62
+ "name": "artifacts_message_part_id_unique",
63
+ "columns": ["message_part_id"],
64
+ "isUnique": true
65
+ }
66
+ },
67
+ "foreignKeys": {
68
+ "artifacts_message_part_id_message_parts_id_fk": {
69
+ "name": "artifacts_message_part_id_message_parts_id_fk",
70
+ "tableFrom": "artifacts",
71
+ "tableTo": "message_parts",
72
+ "columnsFrom": ["message_part_id"],
73
+ "columnsTo": ["id"],
74
+ "onDelete": "cascade",
75
+ "onUpdate": "no action"
76
+ }
77
+ },
78
+ "compositePrimaryKeys": {},
79
+ "uniqueConstraints": {},
80
+ "checkConstraints": {}
81
+ },
82
+ "message_parts": {
83
+ "name": "message_parts",
84
+ "columns": {
85
+ "id": {
86
+ "name": "id",
87
+ "type": "text",
88
+ "primaryKey": true,
89
+ "notNull": true,
90
+ "autoincrement": false
91
+ },
92
+ "message_id": {
93
+ "name": "message_id",
94
+ "type": "text",
95
+ "primaryKey": false,
96
+ "notNull": true,
97
+ "autoincrement": false
98
+ },
99
+ "index": {
100
+ "name": "index",
101
+ "type": "integer",
102
+ "primaryKey": false,
103
+ "notNull": true,
104
+ "autoincrement": false
105
+ },
106
+ "type": {
107
+ "name": "type",
108
+ "type": "text",
109
+ "primaryKey": false,
110
+ "notNull": true,
111
+ "autoincrement": false
112
+ },
113
+ "content": {
114
+ "name": "content",
115
+ "type": "text",
116
+ "primaryKey": false,
117
+ "notNull": true,
118
+ "autoincrement": false
119
+ },
120
+ "agent": {
121
+ "name": "agent",
122
+ "type": "text",
123
+ "primaryKey": false,
124
+ "notNull": true,
125
+ "autoincrement": false
126
+ },
127
+ "provider": {
128
+ "name": "provider",
129
+ "type": "text",
130
+ "primaryKey": false,
131
+ "notNull": true,
132
+ "autoincrement": false
133
+ },
134
+ "model": {
135
+ "name": "model",
136
+ "type": "text",
137
+ "primaryKey": false,
138
+ "notNull": true,
139
+ "autoincrement": false
140
+ }
141
+ },
142
+ "indexes": {},
143
+ "foreignKeys": {
144
+ "message_parts_message_id_messages_id_fk": {
145
+ "name": "message_parts_message_id_messages_id_fk",
146
+ "tableFrom": "message_parts",
147
+ "tableTo": "messages",
148
+ "columnsFrom": ["message_id"],
149
+ "columnsTo": ["id"],
150
+ "onDelete": "cascade",
151
+ "onUpdate": "no action"
152
+ }
153
+ },
154
+ "compositePrimaryKeys": {},
155
+ "uniqueConstraints": {},
156
+ "checkConstraints": {}
157
+ },
158
+ "messages": {
159
+ "name": "messages",
160
+ "columns": {
161
+ "id": {
162
+ "name": "id",
163
+ "type": "text",
164
+ "primaryKey": true,
165
+ "notNull": true,
166
+ "autoincrement": false
167
+ },
168
+ "session_id": {
169
+ "name": "session_id",
170
+ "type": "text",
171
+ "primaryKey": false,
172
+ "notNull": true,
173
+ "autoincrement": false
174
+ },
175
+ "role": {
176
+ "name": "role",
177
+ "type": "text",
178
+ "primaryKey": false,
179
+ "notNull": true,
180
+ "autoincrement": false
181
+ },
182
+ "status": {
183
+ "name": "status",
184
+ "type": "text",
185
+ "primaryKey": false,
186
+ "notNull": true,
187
+ "autoincrement": false
188
+ },
189
+ "agent": {
190
+ "name": "agent",
191
+ "type": "text",
192
+ "primaryKey": false,
193
+ "notNull": true,
194
+ "autoincrement": false
195
+ },
196
+ "provider": {
197
+ "name": "provider",
198
+ "type": "text",
199
+ "primaryKey": false,
200
+ "notNull": true,
201
+ "autoincrement": false
202
+ },
203
+ "model": {
204
+ "name": "model",
205
+ "type": "text",
206
+ "primaryKey": false,
207
+ "notNull": true,
208
+ "autoincrement": false
209
+ },
210
+ "created_at": {
211
+ "name": "created_at",
212
+ "type": "integer",
213
+ "primaryKey": false,
214
+ "notNull": true,
215
+ "autoincrement": false
216
+ }
217
+ },
218
+ "indexes": {},
219
+ "foreignKeys": {
220
+ "messages_session_id_sessions_id_fk": {
221
+ "name": "messages_session_id_sessions_id_fk",
222
+ "tableFrom": "messages",
223
+ "tableTo": "sessions",
224
+ "columnsFrom": ["session_id"],
225
+ "columnsTo": ["id"],
226
+ "onDelete": "cascade",
227
+ "onUpdate": "no action"
228
+ }
229
+ },
230
+ "compositePrimaryKeys": {},
231
+ "uniqueConstraints": {},
232
+ "checkConstraints": {}
233
+ },
234
+ "sessions": {
235
+ "name": "sessions",
236
+ "columns": {
237
+ "id": {
238
+ "name": "id",
239
+ "type": "text",
240
+ "primaryKey": true,
241
+ "notNull": true,
242
+ "autoincrement": false
243
+ },
244
+ "title": {
245
+ "name": "title",
246
+ "type": "text",
247
+ "primaryKey": false,
248
+ "notNull": false,
249
+ "autoincrement": false
250
+ },
251
+ "agent": {
252
+ "name": "agent",
253
+ "type": "text",
254
+ "primaryKey": false,
255
+ "notNull": true,
256
+ "autoincrement": false
257
+ },
258
+ "provider": {
259
+ "name": "provider",
260
+ "type": "text",
261
+ "primaryKey": false,
262
+ "notNull": true,
263
+ "autoincrement": false
264
+ },
265
+ "model": {
266
+ "name": "model",
267
+ "type": "text",
268
+ "primaryKey": false,
269
+ "notNull": true,
270
+ "autoincrement": false
271
+ },
272
+ "project_path": {
273
+ "name": "project_path",
274
+ "type": "text",
275
+ "primaryKey": false,
276
+ "notNull": true,
277
+ "autoincrement": false
278
+ },
279
+ "created_at": {
280
+ "name": "created_at",
281
+ "type": "integer",
282
+ "primaryKey": false,
283
+ "notNull": true,
284
+ "autoincrement": false
285
+ }
286
+ },
287
+ "indexes": {},
288
+ "foreignKeys": {},
289
+ "compositePrimaryKeys": {},
290
+ "uniqueConstraints": {},
291
+ "checkConstraints": {}
292
+ }
293
+ },
294
+ "views": {},
295
+ "enums": {},
296
+ "_meta": {
297
+ "schemas": {},
298
+ "tables": {},
299
+ "columns": {}
300
+ },
301
+ "internal": {
302
+ "indexes": {}
303
+ }
304
+ }