@ottocode/database 0.1.295 → 0.1.296

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 ADDED
@@ -0,0 +1,17 @@
1
+ # @ottocode/database
2
+
3
+ ## 0.1.296
4
+
5
+ ### Patch Changes
6
+
7
+ - Added session pinning support across the API, database, runtime, and web session list UI.
8
+
9
+ Improved message thread performance with virtualized rendering support and added a performance optimization plan for future work.
10
+
11
+ Improved simulator startup by waiting for localhost preview readiness before marking browser previews as connected.
12
+
13
+ Tightened server route schemas and OpenAPI usage with more explicit Zod schemas for documented endpoints.
14
+
15
+ Improved smart-edge hover handling so UI elements can opt out of right-rail hover behavior.
16
+
17
+ - @ottocode/sdk@0.1.296
@@ -0,0 +1 @@
1
+ ALTER TABLE `sessions` ADD `pinned_at` integer;
@@ -0,0 +1,629 @@
1
+ {
2
+ "version": "6",
3
+ "dialect": "sqlite",
4
+ "id": "86ce56a0-2b18-45fc-9829-95c9ff2c8b7e",
5
+ "prevId": "0ca48337-31d2-4d7d-af4c-c9f592deb7c2",
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
+ "step_index": {
107
+ "name": "step_index",
108
+ "type": "integer",
109
+ "primaryKey": false,
110
+ "notNull": false,
111
+ "autoincrement": false
112
+ },
113
+ "type": {
114
+ "name": "type",
115
+ "type": "text",
116
+ "primaryKey": false,
117
+ "notNull": true,
118
+ "autoincrement": false
119
+ },
120
+ "content": {
121
+ "name": "content",
122
+ "type": "text",
123
+ "primaryKey": false,
124
+ "notNull": true,
125
+ "autoincrement": false
126
+ },
127
+ "agent": {
128
+ "name": "agent",
129
+ "type": "text",
130
+ "primaryKey": false,
131
+ "notNull": true,
132
+ "autoincrement": false
133
+ },
134
+ "provider": {
135
+ "name": "provider",
136
+ "type": "text",
137
+ "primaryKey": false,
138
+ "notNull": true,
139
+ "autoincrement": false
140
+ },
141
+ "model": {
142
+ "name": "model",
143
+ "type": "text",
144
+ "primaryKey": false,
145
+ "notNull": true,
146
+ "autoincrement": false
147
+ },
148
+ "started_at": {
149
+ "name": "started_at",
150
+ "type": "integer",
151
+ "primaryKey": false,
152
+ "notNull": false,
153
+ "autoincrement": false
154
+ },
155
+ "completed_at": {
156
+ "name": "completed_at",
157
+ "type": "integer",
158
+ "primaryKey": false,
159
+ "notNull": false,
160
+ "autoincrement": false
161
+ },
162
+ "compacted_at": {
163
+ "name": "compacted_at",
164
+ "type": "integer",
165
+ "primaryKey": false,
166
+ "notNull": false,
167
+ "autoincrement": false
168
+ },
169
+ "tool_name": {
170
+ "name": "tool_name",
171
+ "type": "text",
172
+ "primaryKey": false,
173
+ "notNull": false,
174
+ "autoincrement": false
175
+ },
176
+ "tool_call_id": {
177
+ "name": "tool_call_id",
178
+ "type": "text",
179
+ "primaryKey": false,
180
+ "notNull": false,
181
+ "autoincrement": false
182
+ },
183
+ "tool_duration_ms": {
184
+ "name": "tool_duration_ms",
185
+ "type": "integer",
186
+ "primaryKey": false,
187
+ "notNull": false,
188
+ "autoincrement": false
189
+ }
190
+ },
191
+ "indexes": {},
192
+ "foreignKeys": {
193
+ "message_parts_message_id_messages_id_fk": {
194
+ "name": "message_parts_message_id_messages_id_fk",
195
+ "tableFrom": "message_parts",
196
+ "tableTo": "messages",
197
+ "columnsFrom": ["message_id"],
198
+ "columnsTo": ["id"],
199
+ "onDelete": "cascade",
200
+ "onUpdate": "no action"
201
+ }
202
+ },
203
+ "compositePrimaryKeys": {},
204
+ "uniqueConstraints": {},
205
+ "checkConstraints": {}
206
+ },
207
+ "messages": {
208
+ "name": "messages",
209
+ "columns": {
210
+ "id": {
211
+ "name": "id",
212
+ "type": "text",
213
+ "primaryKey": true,
214
+ "notNull": true,
215
+ "autoincrement": false
216
+ },
217
+ "session_id": {
218
+ "name": "session_id",
219
+ "type": "text",
220
+ "primaryKey": false,
221
+ "notNull": true,
222
+ "autoincrement": false
223
+ },
224
+ "role": {
225
+ "name": "role",
226
+ "type": "text",
227
+ "primaryKey": false,
228
+ "notNull": true,
229
+ "autoincrement": false
230
+ },
231
+ "status": {
232
+ "name": "status",
233
+ "type": "text",
234
+ "primaryKey": false,
235
+ "notNull": true,
236
+ "autoincrement": false
237
+ },
238
+ "agent": {
239
+ "name": "agent",
240
+ "type": "text",
241
+ "primaryKey": false,
242
+ "notNull": true,
243
+ "autoincrement": false
244
+ },
245
+ "provider": {
246
+ "name": "provider",
247
+ "type": "text",
248
+ "primaryKey": false,
249
+ "notNull": true,
250
+ "autoincrement": false
251
+ },
252
+ "model": {
253
+ "name": "model",
254
+ "type": "text",
255
+ "primaryKey": false,
256
+ "notNull": true,
257
+ "autoincrement": false
258
+ },
259
+ "created_at": {
260
+ "name": "created_at",
261
+ "type": "integer",
262
+ "primaryKey": false,
263
+ "notNull": true,
264
+ "autoincrement": false
265
+ },
266
+ "completed_at": {
267
+ "name": "completed_at",
268
+ "type": "integer",
269
+ "primaryKey": false,
270
+ "notNull": false,
271
+ "autoincrement": false
272
+ },
273
+ "latency_ms": {
274
+ "name": "latency_ms",
275
+ "type": "integer",
276
+ "primaryKey": false,
277
+ "notNull": false,
278
+ "autoincrement": false
279
+ },
280
+ "prompt_tokens": {
281
+ "name": "prompt_tokens",
282
+ "type": "integer",
283
+ "primaryKey": false,
284
+ "notNull": false,
285
+ "autoincrement": false
286
+ },
287
+ "completion_tokens": {
288
+ "name": "completion_tokens",
289
+ "type": "integer",
290
+ "primaryKey": false,
291
+ "notNull": false,
292
+ "autoincrement": false
293
+ },
294
+ "total_tokens": {
295
+ "name": "total_tokens",
296
+ "type": "integer",
297
+ "primaryKey": false,
298
+ "notNull": false,
299
+ "autoincrement": false
300
+ },
301
+ "cached_input_tokens": {
302
+ "name": "cached_input_tokens",
303
+ "type": "integer",
304
+ "primaryKey": false,
305
+ "notNull": false,
306
+ "autoincrement": false
307
+ },
308
+ "cache_creation_input_tokens": {
309
+ "name": "cache_creation_input_tokens",
310
+ "type": "integer",
311
+ "primaryKey": false,
312
+ "notNull": false,
313
+ "autoincrement": false
314
+ },
315
+ "reasoning_tokens": {
316
+ "name": "reasoning_tokens",
317
+ "type": "integer",
318
+ "primaryKey": false,
319
+ "notNull": false,
320
+ "autoincrement": false
321
+ },
322
+ "error": {
323
+ "name": "error",
324
+ "type": "text",
325
+ "primaryKey": false,
326
+ "notNull": false,
327
+ "autoincrement": false
328
+ },
329
+ "error_type": {
330
+ "name": "error_type",
331
+ "type": "text",
332
+ "primaryKey": false,
333
+ "notNull": false,
334
+ "autoincrement": false
335
+ },
336
+ "error_details": {
337
+ "name": "error_details",
338
+ "type": "text",
339
+ "primaryKey": false,
340
+ "notNull": false,
341
+ "autoincrement": false
342
+ },
343
+ "is_aborted": {
344
+ "name": "is_aborted",
345
+ "type": "integer",
346
+ "primaryKey": false,
347
+ "notNull": false,
348
+ "autoincrement": false
349
+ }
350
+ },
351
+ "indexes": {},
352
+ "foreignKeys": {
353
+ "messages_session_id_sessions_id_fk": {
354
+ "name": "messages_session_id_sessions_id_fk",
355
+ "tableFrom": "messages",
356
+ "tableTo": "sessions",
357
+ "columnsFrom": ["session_id"],
358
+ "columnsTo": ["id"],
359
+ "onDelete": "cascade",
360
+ "onUpdate": "no action"
361
+ }
362
+ },
363
+ "compositePrimaryKeys": {},
364
+ "uniqueConstraints": {},
365
+ "checkConstraints": {}
366
+ },
367
+ "sessions": {
368
+ "name": "sessions",
369
+ "columns": {
370
+ "id": {
371
+ "name": "id",
372
+ "type": "text",
373
+ "primaryKey": true,
374
+ "notNull": true,
375
+ "autoincrement": false
376
+ },
377
+ "title": {
378
+ "name": "title",
379
+ "type": "text",
380
+ "primaryKey": false,
381
+ "notNull": false,
382
+ "autoincrement": false
383
+ },
384
+ "agent": {
385
+ "name": "agent",
386
+ "type": "text",
387
+ "primaryKey": false,
388
+ "notNull": true,
389
+ "autoincrement": false
390
+ },
391
+ "provider": {
392
+ "name": "provider",
393
+ "type": "text",
394
+ "primaryKey": false,
395
+ "notNull": true,
396
+ "autoincrement": false
397
+ },
398
+ "model": {
399
+ "name": "model",
400
+ "type": "text",
401
+ "primaryKey": false,
402
+ "notNull": true,
403
+ "autoincrement": false
404
+ },
405
+ "project_path": {
406
+ "name": "project_path",
407
+ "type": "text",
408
+ "primaryKey": false,
409
+ "notNull": true,
410
+ "autoincrement": false
411
+ },
412
+ "created_at": {
413
+ "name": "created_at",
414
+ "type": "integer",
415
+ "primaryKey": false,
416
+ "notNull": true,
417
+ "autoincrement": false
418
+ },
419
+ "last_active_at": {
420
+ "name": "last_active_at",
421
+ "type": "integer",
422
+ "primaryKey": false,
423
+ "notNull": false,
424
+ "autoincrement": false
425
+ },
426
+ "last_viewed_at": {
427
+ "name": "last_viewed_at",
428
+ "type": "integer",
429
+ "primaryKey": false,
430
+ "notNull": false,
431
+ "autoincrement": false
432
+ },
433
+ "pinned_at": {
434
+ "name": "pinned_at",
435
+ "type": "integer",
436
+ "primaryKey": false,
437
+ "notNull": false,
438
+ "autoincrement": false
439
+ },
440
+ "total_input_tokens": {
441
+ "name": "total_input_tokens",
442
+ "type": "integer",
443
+ "primaryKey": false,
444
+ "notNull": false,
445
+ "autoincrement": false
446
+ },
447
+ "total_output_tokens": {
448
+ "name": "total_output_tokens",
449
+ "type": "integer",
450
+ "primaryKey": false,
451
+ "notNull": false,
452
+ "autoincrement": false
453
+ },
454
+ "total_cached_tokens": {
455
+ "name": "total_cached_tokens",
456
+ "type": "integer",
457
+ "primaryKey": false,
458
+ "notNull": false,
459
+ "autoincrement": false
460
+ },
461
+ "total_cache_creation_tokens": {
462
+ "name": "total_cache_creation_tokens",
463
+ "type": "integer",
464
+ "primaryKey": false,
465
+ "notNull": false,
466
+ "autoincrement": false
467
+ },
468
+ "total_reasoning_tokens": {
469
+ "name": "total_reasoning_tokens",
470
+ "type": "integer",
471
+ "primaryKey": false,
472
+ "notNull": false,
473
+ "autoincrement": false
474
+ },
475
+ "total_tool_time_ms": {
476
+ "name": "total_tool_time_ms",
477
+ "type": "integer",
478
+ "primaryKey": false,
479
+ "notNull": false,
480
+ "autoincrement": false
481
+ },
482
+ "tool_counts_json": {
483
+ "name": "tool_counts_json",
484
+ "type": "text",
485
+ "primaryKey": false,
486
+ "notNull": false,
487
+ "autoincrement": false
488
+ },
489
+ "current_context_tokens": {
490
+ "name": "current_context_tokens",
491
+ "type": "integer",
492
+ "primaryKey": false,
493
+ "notNull": false,
494
+ "autoincrement": false
495
+ },
496
+ "context_summary": {
497
+ "name": "context_summary",
498
+ "type": "text",
499
+ "primaryKey": false,
500
+ "notNull": false,
501
+ "autoincrement": false
502
+ },
503
+ "last_compacted_at": {
504
+ "name": "last_compacted_at",
505
+ "type": "integer",
506
+ "primaryKey": false,
507
+ "notNull": false,
508
+ "autoincrement": false
509
+ },
510
+ "parent_session_id": {
511
+ "name": "parent_session_id",
512
+ "type": "text",
513
+ "primaryKey": false,
514
+ "notNull": false,
515
+ "autoincrement": false
516
+ },
517
+ "branch_point_message_id": {
518
+ "name": "branch_point_message_id",
519
+ "type": "text",
520
+ "primaryKey": false,
521
+ "notNull": false,
522
+ "autoincrement": false
523
+ },
524
+ "session_type": {
525
+ "name": "session_type",
526
+ "type": "text",
527
+ "primaryKey": false,
528
+ "notNull": false,
529
+ "autoincrement": false,
530
+ "default": "'main'"
531
+ }
532
+ },
533
+ "indexes": {},
534
+ "foreignKeys": {},
535
+ "compositePrimaryKeys": {},
536
+ "uniqueConstraints": {},
537
+ "checkConstraints": {}
538
+ },
539
+ "shares": {
540
+ "name": "shares",
541
+ "columns": {
542
+ "session_id": {
543
+ "name": "session_id",
544
+ "type": "text",
545
+ "primaryKey": true,
546
+ "notNull": true,
547
+ "autoincrement": false
548
+ },
549
+ "share_id": {
550
+ "name": "share_id",
551
+ "type": "text",
552
+ "primaryKey": false,
553
+ "notNull": true,
554
+ "autoincrement": false
555
+ },
556
+ "secret": {
557
+ "name": "secret",
558
+ "type": "text",
559
+ "primaryKey": false,
560
+ "notNull": true,
561
+ "autoincrement": false
562
+ },
563
+ "url": {
564
+ "name": "url",
565
+ "type": "text",
566
+ "primaryKey": false,
567
+ "notNull": true,
568
+ "autoincrement": false
569
+ },
570
+ "title": {
571
+ "name": "title",
572
+ "type": "text",
573
+ "primaryKey": false,
574
+ "notNull": false,
575
+ "autoincrement": false
576
+ },
577
+ "description": {
578
+ "name": "description",
579
+ "type": "text",
580
+ "primaryKey": false,
581
+ "notNull": false,
582
+ "autoincrement": false
583
+ },
584
+ "created_at": {
585
+ "name": "created_at",
586
+ "type": "integer",
587
+ "primaryKey": false,
588
+ "notNull": true,
589
+ "autoincrement": false
590
+ },
591
+ "last_synced_at": {
592
+ "name": "last_synced_at",
593
+ "type": "integer",
594
+ "primaryKey": false,
595
+ "notNull": true,
596
+ "autoincrement": false
597
+ },
598
+ "last_synced_message_id": {
599
+ "name": "last_synced_message_id",
600
+ "type": "text",
601
+ "primaryKey": false,
602
+ "notNull": true,
603
+ "autoincrement": false
604
+ }
605
+ },
606
+ "indexes": {
607
+ "shares_share_id_unique": {
608
+ "name": "shares_share_id_unique",
609
+ "columns": ["share_id"],
610
+ "isUnique": true
611
+ }
612
+ },
613
+ "foreignKeys": {},
614
+ "compositePrimaryKeys": {},
615
+ "uniqueConstraints": {},
616
+ "checkConstraints": {}
617
+ }
618
+ },
619
+ "views": {},
620
+ "enums": {},
621
+ "_meta": {
622
+ "schemas": {},
623
+ "tables": {},
624
+ "columns": {}
625
+ },
626
+ "internal": {
627
+ "indexes": {}
628
+ }
629
+ }
@@ -15,6 +15,13 @@
15
15
  "when": 1779359925155,
16
16
  "tag": "0001_elite_ego",
17
17
  "breakpoints": true
18
+ },
19
+ {
20
+ "idx": 2,
21
+ "version": "6",
22
+ "when": 1780499685486,
23
+ "tag": "0002_flawless_stature",
24
+ "breakpoints": true
18
25
  }
19
26
  ]
20
27
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ottocode/database",
3
- "version": "0.1.295",
3
+ "version": "0.1.296",
4
4
  "description": "Database and persistence layer for ottocode",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -22,7 +22,7 @@
22
22
  "typecheck": "tsc --noEmit"
23
23
  },
24
24
  "dependencies": {
25
- "@ottocode/sdk": "0.1.295",
25
+ "@ottocode/sdk": "0.1.296",
26
26
  "drizzle-orm": "^0.44.5"
27
27
  },
28
28
  "devDependencies": {
@@ -2,8 +2,12 @@ import mig0000 from '../../drizzle/0000_material_swarm.sql' with {
2
2
  type: 'text',
3
3
  };
4
4
  import mig0001 from '../../drizzle/0001_elite_ego.sql' with { type: 'text' };
5
+ import mig0002 from '../../drizzle/0002_flawless_stature.sql' with {
6
+ type: 'text',
7
+ };
5
8
 
6
9
  export const bundledMigrations: Array<{ name: string; content: string }> = [
7
10
  { name: '0000_material_swarm.sql', content: mig0000 },
8
11
  { name: '0001_elite_ego.sql', content: mig0001 },
12
+ { name: '0002_flawless_stature.sql', content: mig0002 },
9
13
  ];
@@ -11,6 +11,7 @@ export const sessions = sqliteTable('sessions', {
11
11
  // Metadata
12
12
  lastActiveAt: integer('last_active_at', { mode: 'number' }),
13
13
  lastViewedAt: integer('last_viewed_at', { mode: 'number' }),
14
+ pinnedAt: integer('pinned_at', { mode: 'number' }),
14
15
  totalInputTokens: integer('total_input_tokens'),
15
16
  totalOutputTokens: integer('total_output_tokens'),
16
17
  totalCachedTokens: integer('total_cached_tokens'),