@sentry/junior-memory 0.214.0 → 0.215.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/README.md +2 -2
- package/dist/index.d.ts +18 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/migrations/0011_memory_conversation_id.sql +11 -0
- package/migrations/meta/0011_snapshot.json +417 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +2 -2
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
ALTER TABLE "junior_memory_memories" ADD COLUMN "conversation_id" text;
|
|
2
|
+
--> statement-breakpoint
|
|
3
|
+
UPDATE "junior_memory_memories"
|
|
4
|
+
SET "conversation_id" = "source_key"
|
|
5
|
+
WHERE "conversation_id" IS NULL
|
|
6
|
+
AND "source_platform" IN ('web', 'local');
|
|
7
|
+
--> statement-breakpoint
|
|
8
|
+
UPDATE "junior_memory_memories"
|
|
9
|
+
SET "conversation_id" = 'slack:' || split_part("source_key", ':', 3) || ':' || split_part("source_key", ':', 4)
|
|
10
|
+
WHERE "conversation_id" IS NULL
|
|
11
|
+
AND "source_platform" = 'slack';
|
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "90b7d7a0-b8df-402b-afbd-dcf6dc898261",
|
|
3
|
+
"prevId": "3094a78d-54ba-42dc-926d-7563a6a651bd",
|
|
4
|
+
"version": "7",
|
|
5
|
+
"dialect": "postgresql",
|
|
6
|
+
"tables": {
|
|
7
|
+
"public.junior_memory_embeddings": {
|
|
8
|
+
"name": "junior_memory_embeddings",
|
|
9
|
+
"schema": "",
|
|
10
|
+
"columns": {
|
|
11
|
+
"memory_id": {
|
|
12
|
+
"name": "memory_id",
|
|
13
|
+
"type": "text",
|
|
14
|
+
"primaryKey": true,
|
|
15
|
+
"notNull": true
|
|
16
|
+
},
|
|
17
|
+
"provider": {
|
|
18
|
+
"name": "provider",
|
|
19
|
+
"type": "text",
|
|
20
|
+
"primaryKey": false,
|
|
21
|
+
"notNull": true
|
|
22
|
+
},
|
|
23
|
+
"model": {
|
|
24
|
+
"name": "model",
|
|
25
|
+
"type": "text",
|
|
26
|
+
"primaryKey": false,
|
|
27
|
+
"notNull": true
|
|
28
|
+
},
|
|
29
|
+
"dimensions": {
|
|
30
|
+
"name": "dimensions",
|
|
31
|
+
"type": "integer",
|
|
32
|
+
"primaryKey": false,
|
|
33
|
+
"notNull": true
|
|
34
|
+
},
|
|
35
|
+
"metric": {
|
|
36
|
+
"name": "metric",
|
|
37
|
+
"type": "text",
|
|
38
|
+
"primaryKey": false,
|
|
39
|
+
"notNull": true
|
|
40
|
+
},
|
|
41
|
+
"content_hash": {
|
|
42
|
+
"name": "content_hash",
|
|
43
|
+
"type": "text",
|
|
44
|
+
"primaryKey": false,
|
|
45
|
+
"notNull": true
|
|
46
|
+
},
|
|
47
|
+
"embedding": {
|
|
48
|
+
"name": "embedding",
|
|
49
|
+
"type": "vector(1536)",
|
|
50
|
+
"primaryKey": false,
|
|
51
|
+
"notNull": true
|
|
52
|
+
},
|
|
53
|
+
"created_at_ms": {
|
|
54
|
+
"name": "created_at_ms",
|
|
55
|
+
"type": "bigint",
|
|
56
|
+
"primaryKey": false,
|
|
57
|
+
"notNull": true
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"indexes": {
|
|
61
|
+
"junior_memory_embeddings_model_idx": {
|
|
62
|
+
"name": "junior_memory_embeddings_model_idx",
|
|
63
|
+
"columns": [
|
|
64
|
+
{
|
|
65
|
+
"expression": "provider",
|
|
66
|
+
"isExpression": false,
|
|
67
|
+
"asc": true,
|
|
68
|
+
"nulls": "last"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"expression": "model",
|
|
72
|
+
"isExpression": false,
|
|
73
|
+
"asc": true,
|
|
74
|
+
"nulls": "last"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"expression": "dimensions",
|
|
78
|
+
"isExpression": false,
|
|
79
|
+
"asc": true,
|
|
80
|
+
"nulls": "last"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"expression": "metric",
|
|
84
|
+
"isExpression": false,
|
|
85
|
+
"asc": true,
|
|
86
|
+
"nulls": "last"
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
"isUnique": false,
|
|
90
|
+
"concurrently": false,
|
|
91
|
+
"method": "btree",
|
|
92
|
+
"with": {}
|
|
93
|
+
},
|
|
94
|
+
"junior_memory_embeddings_embedding_hnsw_idx": {
|
|
95
|
+
"name": "junior_memory_embeddings_embedding_hnsw_idx",
|
|
96
|
+
"columns": [
|
|
97
|
+
{
|
|
98
|
+
"expression": "embedding",
|
|
99
|
+
"isExpression": false,
|
|
100
|
+
"asc": true,
|
|
101
|
+
"nulls": "last",
|
|
102
|
+
"opclass": "vector_cosine_ops"
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
"isUnique": false,
|
|
106
|
+
"concurrently": false,
|
|
107
|
+
"method": "hnsw",
|
|
108
|
+
"with": {
|
|
109
|
+
"m": 16,
|
|
110
|
+
"ef_construction": 64
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"foreignKeys": {
|
|
115
|
+
"junior_memory_embeddings_memory_id_junior_memory_memories_id_fk": {
|
|
116
|
+
"name": "junior_memory_embeddings_memory_id_junior_memory_memories_id_fk",
|
|
117
|
+
"tableFrom": "junior_memory_embeddings",
|
|
118
|
+
"tableTo": "junior_memory_memories",
|
|
119
|
+
"columnsFrom": ["memory_id"],
|
|
120
|
+
"columnsTo": ["id"],
|
|
121
|
+
"onDelete": "cascade",
|
|
122
|
+
"onUpdate": "no action"
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"compositePrimaryKeys": {},
|
|
126
|
+
"uniqueConstraints": {},
|
|
127
|
+
"policies": {},
|
|
128
|
+
"checkConstraints": {
|
|
129
|
+
"junior_memory_embeddings_metric_check": {
|
|
130
|
+
"name": "junior_memory_embeddings_metric_check",
|
|
131
|
+
"value": "\"junior_memory_embeddings\".\"metric\" IN ('cosine')"
|
|
132
|
+
},
|
|
133
|
+
"junior_memory_embeddings_dimensions_check": {
|
|
134
|
+
"name": "junior_memory_embeddings_dimensions_check",
|
|
135
|
+
"value": "\"junior_memory_embeddings\".\"dimensions\" = 1536"
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
"isRLSEnabled": false
|
|
139
|
+
},
|
|
140
|
+
"public.junior_memory_memories": {
|
|
141
|
+
"name": "junior_memory_memories",
|
|
142
|
+
"schema": "",
|
|
143
|
+
"columns": {
|
|
144
|
+
"id": {
|
|
145
|
+
"name": "id",
|
|
146
|
+
"type": "text",
|
|
147
|
+
"primaryKey": true,
|
|
148
|
+
"notNull": true
|
|
149
|
+
},
|
|
150
|
+
"scope": {
|
|
151
|
+
"name": "scope",
|
|
152
|
+
"type": "text",
|
|
153
|
+
"primaryKey": false,
|
|
154
|
+
"notNull": true
|
|
155
|
+
},
|
|
156
|
+
"scope_key": {
|
|
157
|
+
"name": "scope_key",
|
|
158
|
+
"type": "text",
|
|
159
|
+
"primaryKey": false,
|
|
160
|
+
"notNull": true
|
|
161
|
+
},
|
|
162
|
+
"type": {
|
|
163
|
+
"name": "type",
|
|
164
|
+
"type": "text",
|
|
165
|
+
"primaryKey": false,
|
|
166
|
+
"notNull": true
|
|
167
|
+
},
|
|
168
|
+
"subject_type": {
|
|
169
|
+
"name": "subject_type",
|
|
170
|
+
"type": "text",
|
|
171
|
+
"primaryKey": false,
|
|
172
|
+
"notNull": true
|
|
173
|
+
},
|
|
174
|
+
"subject_key": {
|
|
175
|
+
"name": "subject_key",
|
|
176
|
+
"type": "text",
|
|
177
|
+
"primaryKey": false,
|
|
178
|
+
"notNull": false
|
|
179
|
+
},
|
|
180
|
+
"content": {
|
|
181
|
+
"name": "content",
|
|
182
|
+
"type": "text",
|
|
183
|
+
"primaryKey": false,
|
|
184
|
+
"notNull": true
|
|
185
|
+
},
|
|
186
|
+
"search_vector": {
|
|
187
|
+
"name": "search_vector",
|
|
188
|
+
"type": "tsvector",
|
|
189
|
+
"primaryKey": false,
|
|
190
|
+
"notNull": false,
|
|
191
|
+
"generated": {
|
|
192
|
+
"as": "to_tsvector('english', \"content\")",
|
|
193
|
+
"type": "stored"
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
"source_platform": {
|
|
197
|
+
"name": "source_platform",
|
|
198
|
+
"type": "text",
|
|
199
|
+
"primaryKey": false,
|
|
200
|
+
"notNull": true
|
|
201
|
+
},
|
|
202
|
+
"source_key": {
|
|
203
|
+
"name": "source_key",
|
|
204
|
+
"type": "text",
|
|
205
|
+
"primaryKey": false,
|
|
206
|
+
"notNull": true
|
|
207
|
+
},
|
|
208
|
+
"location_id": {
|
|
209
|
+
"name": "location_id",
|
|
210
|
+
"type": "text",
|
|
211
|
+
"primaryKey": false,
|
|
212
|
+
"notNull": false
|
|
213
|
+
},
|
|
214
|
+
"conversation_id": {
|
|
215
|
+
"name": "conversation_id",
|
|
216
|
+
"type": "text",
|
|
217
|
+
"primaryKey": false,
|
|
218
|
+
"notNull": false
|
|
219
|
+
},
|
|
220
|
+
"idempotency_key": {
|
|
221
|
+
"name": "idempotency_key",
|
|
222
|
+
"type": "text",
|
|
223
|
+
"primaryKey": false,
|
|
224
|
+
"notNull": false
|
|
225
|
+
},
|
|
226
|
+
"observed_at_ms": {
|
|
227
|
+
"name": "observed_at_ms",
|
|
228
|
+
"type": "bigint",
|
|
229
|
+
"primaryKey": false,
|
|
230
|
+
"notNull": true
|
|
231
|
+
},
|
|
232
|
+
"created_at_ms": {
|
|
233
|
+
"name": "created_at_ms",
|
|
234
|
+
"type": "bigint",
|
|
235
|
+
"primaryKey": false,
|
|
236
|
+
"notNull": true
|
|
237
|
+
},
|
|
238
|
+
"expires_at_ms": {
|
|
239
|
+
"name": "expires_at_ms",
|
|
240
|
+
"type": "bigint",
|
|
241
|
+
"primaryKey": false,
|
|
242
|
+
"notNull": false
|
|
243
|
+
},
|
|
244
|
+
"superseded_at_ms": {
|
|
245
|
+
"name": "superseded_at_ms",
|
|
246
|
+
"type": "bigint",
|
|
247
|
+
"primaryKey": false,
|
|
248
|
+
"notNull": false
|
|
249
|
+
},
|
|
250
|
+
"superseded_by_id": {
|
|
251
|
+
"name": "superseded_by_id",
|
|
252
|
+
"type": "text",
|
|
253
|
+
"primaryKey": false,
|
|
254
|
+
"notNull": false
|
|
255
|
+
},
|
|
256
|
+
"archived_at_ms": {
|
|
257
|
+
"name": "archived_at_ms",
|
|
258
|
+
"type": "bigint",
|
|
259
|
+
"primaryKey": false,
|
|
260
|
+
"notNull": false
|
|
261
|
+
},
|
|
262
|
+
"archive_reason": {
|
|
263
|
+
"name": "archive_reason",
|
|
264
|
+
"type": "text",
|
|
265
|
+
"primaryKey": false,
|
|
266
|
+
"notNull": false
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
"indexes": {
|
|
270
|
+
"junior_memory_memories_visible_idx": {
|
|
271
|
+
"name": "junior_memory_memories_visible_idx",
|
|
272
|
+
"columns": [
|
|
273
|
+
{
|
|
274
|
+
"expression": "scope",
|
|
275
|
+
"isExpression": false,
|
|
276
|
+
"asc": true,
|
|
277
|
+
"nulls": "last"
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"expression": "scope_key",
|
|
281
|
+
"isExpression": false,
|
|
282
|
+
"asc": true,
|
|
283
|
+
"nulls": "last"
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"expression": "created_at_ms",
|
|
287
|
+
"isExpression": false,
|
|
288
|
+
"asc": false,
|
|
289
|
+
"nulls": "last"
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
"expression": "id",
|
|
293
|
+
"isExpression": false,
|
|
294
|
+
"asc": true,
|
|
295
|
+
"nulls": "last"
|
|
296
|
+
}
|
|
297
|
+
],
|
|
298
|
+
"isUnique": false,
|
|
299
|
+
"where": "\"junior_memory_memories\".\"archived_at_ms\" IS NULL AND \"junior_memory_memories\".\"superseded_at_ms\" IS NULL AND \"junior_memory_memories\".\"superseded_by_id\" IS NULL",
|
|
300
|
+
"concurrently": false,
|
|
301
|
+
"method": "btree",
|
|
302
|
+
"with": {}
|
|
303
|
+
},
|
|
304
|
+
"junior_memory_memories_expiration_idx": {
|
|
305
|
+
"name": "junior_memory_memories_expiration_idx",
|
|
306
|
+
"columns": [
|
|
307
|
+
{
|
|
308
|
+
"expression": "expires_at_ms",
|
|
309
|
+
"isExpression": false,
|
|
310
|
+
"asc": true,
|
|
311
|
+
"nulls": "last"
|
|
312
|
+
}
|
|
313
|
+
],
|
|
314
|
+
"isUnique": false,
|
|
315
|
+
"where": "\"junior_memory_memories\".\"archived_at_ms\" IS NULL AND \"junior_memory_memories\".\"expires_at_ms\" IS NOT NULL",
|
|
316
|
+
"concurrently": false,
|
|
317
|
+
"method": "btree",
|
|
318
|
+
"with": {}
|
|
319
|
+
},
|
|
320
|
+
"junior_memory_memories_search_idx": {
|
|
321
|
+
"name": "junior_memory_memories_search_idx",
|
|
322
|
+
"columns": [
|
|
323
|
+
{
|
|
324
|
+
"expression": "scope",
|
|
325
|
+
"isExpression": false,
|
|
326
|
+
"asc": true,
|
|
327
|
+
"nulls": "last"
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
"expression": "scope_key",
|
|
331
|
+
"isExpression": false,
|
|
332
|
+
"asc": true,
|
|
333
|
+
"nulls": "last"
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
"expression": "search_vector",
|
|
337
|
+
"isExpression": false,
|
|
338
|
+
"asc": true,
|
|
339
|
+
"nulls": "last"
|
|
340
|
+
}
|
|
341
|
+
],
|
|
342
|
+
"isUnique": false,
|
|
343
|
+
"where": "\"junior_memory_memories\".\"archived_at_ms\" IS NULL AND \"junior_memory_memories\".\"superseded_at_ms\" IS NULL AND \"junior_memory_memories\".\"superseded_by_id\" IS NULL",
|
|
344
|
+
"concurrently": false,
|
|
345
|
+
"method": "gin",
|
|
346
|
+
"with": {}
|
|
347
|
+
},
|
|
348
|
+
"junior_memory_memories_idempotency_idx": {
|
|
349
|
+
"name": "junior_memory_memories_idempotency_idx",
|
|
350
|
+
"columns": [
|
|
351
|
+
{
|
|
352
|
+
"expression": "scope",
|
|
353
|
+
"isExpression": false,
|
|
354
|
+
"asc": true,
|
|
355
|
+
"nulls": "last"
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
"expression": "scope_key",
|
|
359
|
+
"isExpression": false,
|
|
360
|
+
"asc": true,
|
|
361
|
+
"nulls": "last"
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
"expression": "idempotency_key",
|
|
365
|
+
"isExpression": false,
|
|
366
|
+
"asc": true,
|
|
367
|
+
"nulls": "last"
|
|
368
|
+
}
|
|
369
|
+
],
|
|
370
|
+
"isUnique": true,
|
|
371
|
+
"where": "\"junior_memory_memories\".\"idempotency_key\" IS NOT NULL AND \"junior_memory_memories\".\"archived_at_ms\" IS NULL AND \"junior_memory_memories\".\"superseded_at_ms\" IS NULL AND \"junior_memory_memories\".\"superseded_by_id\" IS NULL",
|
|
372
|
+
"concurrently": false,
|
|
373
|
+
"method": "btree",
|
|
374
|
+
"with": {}
|
|
375
|
+
}
|
|
376
|
+
},
|
|
377
|
+
"foreignKeys": {},
|
|
378
|
+
"compositePrimaryKeys": {},
|
|
379
|
+
"uniqueConstraints": {},
|
|
380
|
+
"policies": {},
|
|
381
|
+
"checkConstraints": {
|
|
382
|
+
"junior_memory_memories_scope_check": {
|
|
383
|
+
"name": "junior_memory_memories_scope_check",
|
|
384
|
+
"value": "\"junior_memory_memories\".\"scope\" IN ('private', 'public')"
|
|
385
|
+
},
|
|
386
|
+
"junior_memory_memories_kind_check": {
|
|
387
|
+
"name": "junior_memory_memories_kind_check",
|
|
388
|
+
"value": "\"junior_memory_memories\".\"type\" IN (\n 'preference',\n 'procedure',\n 'knowledge'\n )"
|
|
389
|
+
},
|
|
390
|
+
"junior_memory_memories_subject_type_check": {
|
|
391
|
+
"name": "junior_memory_memories_subject_type_check",
|
|
392
|
+
"value": "\"junior_memory_memories\".\"subject_type\" IN ('user', 'conversation', 'general')"
|
|
393
|
+
},
|
|
394
|
+
"junior_memory_memories_subject_key_check": {
|
|
395
|
+
"name": "junior_memory_memories_subject_key_check",
|
|
396
|
+
"value": "(\"junior_memory_memories\".\"subject_type\" = 'general' AND \"junior_memory_memories\".\"subject_key\" IS NULL) OR (\"junior_memory_memories\".\"subject_type\" IN ('user', 'conversation') AND \"junior_memory_memories\".\"subject_key\" IS NOT NULL AND length(\"junior_memory_memories\".\"subject_key\") > 0)"
|
|
397
|
+
},
|
|
398
|
+
"junior_memory_memories_source_platform_check": {
|
|
399
|
+
"name": "junior_memory_memories_source_platform_check",
|
|
400
|
+
"value": "\"junior_memory_memories\".\"source_platform\" IN ('slack', 'local', 'web')"
|
|
401
|
+
}
|
|
402
|
+
},
|
|
403
|
+
"isRLSEnabled": false
|
|
404
|
+
}
|
|
405
|
+
},
|
|
406
|
+
"enums": {},
|
|
407
|
+
"schemas": {},
|
|
408
|
+
"sequences": {},
|
|
409
|
+
"roles": {},
|
|
410
|
+
"policies": {},
|
|
411
|
+
"views": {},
|
|
412
|
+
"_meta": {
|
|
413
|
+
"columns": {},
|
|
414
|
+
"schemas": {},
|
|
415
|
+
"tables": {}
|
|
416
|
+
}
|
|
417
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/junior-memory",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.215.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"commander": "^14.0.3",
|
|
27
27
|
"drizzle-orm": "^0.45.2",
|
|
28
28
|
"zod": "^4.5.4",
|
|
29
|
-
"@sentry/junior-plugin-api": "0.
|
|
29
|
+
"@sentry/junior-plugin-api": "0.215.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@oxlint/plugins": "1.79.0",
|