@happyvertical/smrt-places 0.35.4 → 0.36.1

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.
@@ -1,542 +1,170 @@
1
1
  {
2
2
  "version": "1.0.0",
3
- "timestamp": 1782366357269,
3
+ "timestamp": 1782444853154,
4
4
  "packageName": "@happyvertical/smrt-places",
5
- "packageVersion": "0.35.4",
5
+ "packageVersion": "0.36.1",
6
6
  "objects": {
7
- "@happyvertical/smrt-places:Place": {
8
- "name": "place",
9
- "className": "Place",
10
- "qualifiedName": "@happyvertical/smrt-places:Place",
11
- "collection": "places",
12
- "filePath": "/home/runner/_work/smrt/smrt/packages/places/src/models/Place.ts",
7
+ "@happyvertical/smrt-places:PlaceAssetCollection": {
8
+ "name": "placeassetcollection",
9
+ "className": "PlaceAssetCollection",
10
+ "qualifiedName": "@happyvertical/smrt-places:PlaceAssetCollection",
11
+ "collection": "placeassets",
12
+ "filePath": "/home/runner/_work/smrt/smrt/packages/places/src/collections/PlaceAssetCollection.ts",
13
13
  "packageName": "@happyvertical/smrt-places",
14
- "fields": {
15
- "created_at": {
16
- "type": "datetime",
17
- "required": false
18
- },
19
- "updated_at": {
20
- "type": "datetime",
21
- "required": false
22
- },
23
- "parentId": {
24
- "type": "foreignKey",
25
- "required": false,
26
- "related": "Place",
27
- "_meta": {
28
- "nullable": true
29
- }
30
- },
31
- "tenantId": {
32
- "type": "text",
33
- "required": false,
34
- "_meta": {
35
- "sqlType": "UUID",
36
- "nullable": true,
37
- "__tenancy": {
38
- "isTenantIdField": true,
39
- "autoFilter": true,
40
- "required": false,
41
- "autoPopulate": true,
42
- "nullable": true,
43
- "mode": "optional",
44
- "field": "tenantId",
45
- "allowSuperAdminBypass": false
46
- }
47
- }
48
- },
49
- "typeId": {
50
- "type": "foreignKey",
51
- "required": false,
52
- "related": "PlaceType"
53
- },
54
- "name": {
55
- "type": "text",
56
- "required": false
57
- },
58
- "description": {
59
- "type": "text",
60
- "required": false
61
- },
62
- "latitude": {
63
- "type": "decimal",
64
- "required": false,
65
- "_meta": {}
66
- },
67
- "longitude": {
68
- "type": "decimal",
69
- "required": false,
70
- "_meta": {}
71
- },
72
- "streetNumber": {
73
- "type": "text",
74
- "required": false
75
- },
76
- "streetName": {
77
- "type": "text",
78
- "required": false
79
- },
80
- "city": {
81
- "type": "text",
82
- "required": false
83
- },
84
- "region": {
85
- "type": "text",
86
- "required": false
87
- },
88
- "country": {
89
- "type": "text",
90
- "required": false
91
- },
92
- "postalCode": {
93
- "type": "text",
94
- "required": false
95
- },
96
- "countryCode": {
97
- "type": "text",
98
- "required": false
99
- },
100
- "timezone": {
101
- "type": "text",
102
- "required": false
103
- },
104
- "externalId": {
105
- "type": "text",
106
- "required": false
107
- },
108
- "source": {
109
- "type": "text",
110
- "required": false
111
- },
112
- "metadata": {
113
- "type": "text",
114
- "required": false
115
- },
116
- "createdAt": {
117
- "type": "text",
118
- "required": false
119
- },
120
- "updatedAt": {
121
- "type": "text",
122
- "required": false
123
- }
124
- },
14
+ "fields": {},
125
15
  "methods": {
126
- "getAiUsageSnapshot": {
127
- "name": "getAiUsageSnapshot",
128
- "async": false,
129
- "parameters": [],
130
- "returnType": "AiUsageSnapshot | undefined",
131
- "isStatic": false,
132
- "isPublic": true
133
- },
134
- "resetAiUsage": {
135
- "name": "resetAiUsage",
136
- "async": false,
137
- "parameters": [],
138
- "returnType": "void",
139
- "isStatic": false,
140
- "isPublic": true
141
- },
142
- "listAiUsage": {
143
- "name": "listAiUsage",
144
- "async": true,
145
- "parameters": [
146
- {
147
- "name": "options",
148
- "type": "AiUsageListOptions",
149
- "optional": true
150
- }
151
- ],
152
- "returnType": "Promise<SmrtAiUsageRecord[]>",
153
- "isStatic": false,
154
- "isPublic": true
155
- },
156
- "summarizeAiUsage": {
157
- "name": "summarizeAiUsage",
158
- "async": true,
159
- "parameters": [
160
- {
161
- "name": "options",
162
- "type": "AiUsageSummaryOptions",
163
- "optional": true
164
- }
165
- ],
166
- "returnType": "Promise<Record<string, AiUsageStats>>",
167
- "isStatic": false,
168
- "isPublic": true
169
- },
170
- "destroy": {
171
- "name": "destroy",
172
- "async": false,
173
- "parameters": [],
174
- "returnType": "void",
175
- "isStatic": false,
176
- "isPublic": true
177
- },
178
- "markAsPersisted": {
179
- "name": "markAsPersisted",
180
- "async": false,
181
- "parameters": [],
182
- "returnType": "void",
183
- "isStatic": false,
184
- "isPublic": true
185
- },
186
- "initialize": {
187
- "name": "initialize",
188
- "async": true,
189
- "parameters": [],
190
- "returnType": "Promise",
191
- "isStatic": false,
192
- "isPublic": true
193
- },
194
- "loadDataFromDb": {
195
- "name": "loadDataFromDb",
196
- "async": true,
197
- "parameters": [
198
- {
199
- "name": "data",
200
- "type": "any",
201
- "optional": false
202
- }
203
- ],
204
- "returnType": "any",
205
- "isStatic": false,
206
- "isPublic": true
207
- },
208
- "getFields": {
209
- "name": "getFields",
210
- "async": true,
211
- "parameters": [],
212
- "returnType": "any",
213
- "isStatic": false,
214
- "isPublic": true
215
- },
216
- "toJSON": {
217
- "name": "toJSON",
218
- "async": false,
219
- "parameters": [],
220
- "returnType": "any",
221
- "isStatic": false,
222
- "isPublic": true
223
- },
224
- "toPlainObject": {
225
- "name": "toPlainObject",
226
- "async": false,
227
- "parameters": [],
228
- "returnType": "Record<string>",
229
- "isStatic": false,
230
- "isPublic": true
231
- },
232
- "toPublicJSON": {
233
- "name": "toPublicJSON",
234
- "async": false,
235
- "parameters": [],
236
- "returnType": "Record<string>",
237
- "isStatic": false,
238
- "isPublic": true
239
- },
240
- "getId": {
241
- "name": "getId",
242
- "async": true,
243
- "parameters": [],
244
- "returnType": "any",
245
- "isStatic": false,
246
- "isPublic": true
247
- },
248
- "getSlug": {
249
- "name": "getSlug",
250
- "async": true,
251
- "parameters": [],
252
- "returnType": "any",
253
- "isStatic": false,
254
- "isPublic": true
255
- },
256
- "getSavedId": {
257
- "name": "getSavedId",
258
- "async": true,
259
- "parameters": [],
260
- "returnType": "any",
261
- "isStatic": false,
262
- "isPublic": true
263
- },
264
- "isSaved": {
265
- "name": "isSaved",
266
- "async": true,
267
- "parameters": [],
268
- "returnType": "any",
269
- "isStatic": false,
270
- "isPublic": true
271
- },
272
- "save": {
273
- "name": "save",
274
- "async": true,
275
- "parameters": [],
276
- "returnType": "any",
277
- "isStatic": false,
278
- "isPublic": true
279
- },
280
- "classifyConstraintError": {
281
- "name": "classifyConstraintError",
282
- "async": false,
283
- "parameters": [
284
- {
285
- "name": "message",
286
- "type": "string",
287
- "optional": false
288
- }
289
- ],
290
- "returnType": "'unique' | 'not_null' | null",
291
- "isStatic": true,
292
- "isPublic": true
293
- },
294
- "loadFromId": {
295
- "name": "loadFromId",
296
- "async": true,
297
- "parameters": [],
298
- "returnType": "any",
299
- "isStatic": false,
300
- "isPublic": true
301
- },
302
- "loadFromSlug": {
303
- "name": "loadFromSlug",
304
- "async": true,
305
- "parameters": [],
306
- "returnType": "any",
307
- "isStatic": false,
308
- "isPublic": true
309
- },
310
- "is": {
311
- "name": "is",
16
+ "byLeft": {
17
+ "name": "byLeft",
312
18
  "async": true,
313
19
  "parameters": [
314
20
  {
315
- "name": "criteria",
21
+ "name": "leftId",
316
22
  "type": "string",
317
23
  "optional": false
318
24
  },
319
25
  {
320
- "name": "options",
321
- "type": "any",
26
+ "name": "opts",
27
+ "type": "JunctionFilterOptions",
322
28
  "optional": true
323
29
  }
324
30
  ],
325
- "returnType": "any",
31
+ "returnType": "Promise<TItem[]>",
326
32
  "isStatic": false,
327
33
  "isPublic": true
328
34
  },
329
- "do": {
330
- "name": "do",
35
+ "byRight": {
36
+ "name": "byRight",
331
37
  "async": true,
332
38
  "parameters": [
333
39
  {
334
- "name": "instructions",
40
+ "name": "rightId",
335
41
  "type": "string",
336
42
  "optional": false
337
43
  },
338
44
  {
339
- "name": "options",
340
- "type": "any",
45
+ "name": "opts",
46
+ "type": "JunctionFilterOptions",
341
47
  "optional": true
342
48
  }
343
49
  ],
344
- "returnType": "any",
50
+ "returnType": "Promise<TItem[]>",
345
51
  "isStatic": false,
346
52
  "isPublic": true
347
53
  },
348
- "describe": {
349
- "name": "describe",
54
+ "attach": {
55
+ "name": "attach",
350
56
  "async": true,
351
57
  "parameters": [
352
58
  {
353
- "name": "options",
354
- "type": "any",
355
- "optional": true
356
- }
357
- ],
358
- "returnType": "any",
359
- "isStatic": false,
360
- "isPublic": true
361
- },
362
- "delete": {
363
- "name": "delete",
364
- "async": true,
365
- "parameters": [],
366
- "returnType": "Promise<void>",
367
- "isStatic": false,
368
- "isPublic": true
369
- },
370
- "isRelatedLoaded": {
371
- "name": "isRelatedLoaded",
372
- "async": false,
373
- "parameters": [
374
- {
375
- "name": "fieldName",
59
+ "name": "leftId",
376
60
  "type": "string",
377
61
  "optional": false
378
- }
379
- ],
380
- "returnType": "boolean",
381
- "isStatic": false,
382
- "isPublic": true
383
- },
384
- "loadRelated": {
385
- "name": "loadRelated",
386
- "async": true,
387
- "parameters": [
62
+ },
388
63
  {
389
- "name": "fieldName",
64
+ "name": "rightId",
390
65
  "type": "string",
391
66
  "optional": false
392
67
  },
393
68
  {
394
69
  "name": "opts",
395
- "type": "LoadRelatedOptions",
70
+ "type": "JunctionAttachOptions",
396
71
  "optional": true
397
72
  }
398
73
  ],
399
- "returnType": "Promise<any>",
74
+ "returnType": "Promise<TItem>",
400
75
  "isStatic": false,
401
76
  "isPublic": true
402
77
  },
403
- "loadRelatedMany": {
404
- "name": "loadRelatedMany",
78
+ "detach": {
79
+ "name": "detach",
405
80
  "async": true,
406
81
  "parameters": [
407
82
  {
408
- "name": "fieldName",
83
+ "name": "leftId",
409
84
  "type": "string",
410
85
  "optional": false
411
86
  },
412
87
  {
413
- "name": "opts",
414
- "type": "LoadRelatedOptions",
415
- "optional": true
416
- }
417
- ],
418
- "returnType": "Promise<any[]>",
419
- "isStatic": false,
420
- "isPublic": true
421
- },
422
- "getRelated": {
423
- "name": "getRelated",
424
- "async": true,
425
- "parameters": [
426
- {
427
- "name": "fieldName",
88
+ "name": "rightId",
428
89
  "type": "string",
429
90
  "optional": false
430
91
  },
431
92
  {
432
93
  "name": "opts",
433
- "type": "LoadRelatedOptions",
94
+ "type": "JunctionFilterOptions",
434
95
  "optional": true
435
96
  }
436
97
  ],
437
- "returnType": "Promise<any>",
438
- "isStatic": false,
439
- "isPublic": true
440
- },
441
- "getAvailableTools": {
442
- "name": "getAvailableTools",
443
- "async": false,
444
- "parameters": [],
445
- "returnType": "AITool[]",
446
- "isStatic": false,
447
- "isPublic": true
448
- },
449
- "executeToolCall": {
450
- "name": "executeToolCall",
451
- "async": true,
452
- "parameters": [
453
- {
454
- "name": "toolCall",
455
- "type": "ToolCall",
456
- "optional": false
457
- }
458
- ],
459
- "returnType": "Promise<ToolCallResult>",
460
- "isStatic": false,
461
- "isPublic": true
462
- },
463
- "remember": {
464
- "name": "remember",
465
- "async": true,
466
- "parameters": [
467
- {
468
- "name": "options",
469
- "type": "object",
470
- "optional": false
471
- }
472
- ],
473
98
  "returnType": "Promise<void>",
474
99
  "isStatic": false,
475
100
  "isPublic": true
476
101
  },
477
- "recall": {
478
- "name": "recall",
102
+ "setLinks": {
103
+ "name": "setLinks",
479
104
  "async": true,
480
105
  "parameters": [
481
106
  {
482
- "name": "options",
483
- "type": "object",
107
+ "name": "leftId",
108
+ "type": "string",
484
109
  "optional": false
485
- }
486
- ],
487
- "returnType": "Promise<any | null>",
488
- "isStatic": false,
489
- "isPublic": true
490
- },
491
- "recallAll": {
492
- "name": "recallAll",
493
- "async": true,
494
- "parameters": [
495
- {
496
- "name": "options",
497
- "type": "object",
498
- "optional": true
499
- }
500
- ],
501
- "returnType": "Promise<Map<string, any>>",
502
- "isStatic": false,
503
- "isPublic": true
504
- },
505
- "forget": {
506
- "name": "forget",
507
- "async": true,
508
- "parameters": [
110
+ },
509
111
  {
510
- "name": "options",
511
- "type": "object",
112
+ "name": "rightIds",
113
+ "type": "string[]",
512
114
  "optional": false
115
+ },
116
+ {
117
+ "name": "opts",
118
+ "type": "JunctionAttachOptions",
119
+ "optional": true
513
120
  }
514
121
  ],
515
122
  "returnType": "Promise<void>",
516
123
  "isStatic": false,
517
124
  "isPublic": true
518
125
  },
519
- "forgetScope": {
520
- "name": "forgetScope",
126
+ "getAssets": {
127
+ "name": "getAssets",
521
128
  "async": true,
522
129
  "parameters": [
523
130
  {
524
- "name": "options",
525
- "type": "object",
131
+ "name": "placeId",
132
+ "type": "string",
526
133
  "optional": false
134
+ },
135
+ {
136
+ "name": "relationship",
137
+ "type": "string",
138
+ "optional": true
527
139
  }
528
140
  ],
529
- "returnType": "Promise<number>",
141
+ "returnType": "Promise<Asset[]>",
530
142
  "isStatic": false,
531
143
  "isPublic": true
532
144
  },
533
- "generateEmbeddings": {
534
- "name": "generateEmbeddings",
145
+ "addAsset": {
146
+ "name": "addAsset",
535
147
  "async": true,
536
148
  "parameters": [
537
149
  {
538
- "name": "options",
539
- "type": "GenerateEmbeddingsOptions",
150
+ "name": "placeId",
151
+ "type": "string",
152
+ "optional": false
153
+ },
154
+ {
155
+ "name": "asset",
156
+ "type": "Asset",
157
+ "optional": false
158
+ },
159
+ {
160
+ "name": "relationship",
161
+ "type": "any",
162
+ "optional": true,
163
+ "default": "attachment"
164
+ },
165
+ {
166
+ "name": "sortOrder",
167
+ "type": "any",
540
168
  "optional": true
541
169
  }
542
170
  ],
@@ -544,151 +172,212 @@
544
172
  "isStatic": false,
545
173
  "isPublic": true
546
174
  },
547
- "getEmbedding": {
548
- "name": "getEmbedding",
175
+ "removeAsset": {
176
+ "name": "removeAsset",
549
177
  "async": true,
550
178
  "parameters": [
551
179
  {
552
- "name": "fieldName",
180
+ "name": "placeId",
553
181
  "type": "string",
554
182
  "optional": false
555
183
  },
556
184
  {
557
- "name": "model",
185
+ "name": "assetId",
186
+ "type": "string",
187
+ "optional": false
188
+ },
189
+ {
190
+ "name": "relationship",
558
191
  "type": "string",
559
192
  "optional": true
560
193
  }
561
194
  ],
562
- "returnType": "Promise<number[] | null>",
563
- "isStatic": false,
564
- "isPublic": true
565
- },
566
- "hasStaleEmbeddings": {
567
- "name": "hasStaleEmbeddings",
568
- "async": true,
569
- "parameters": [],
570
- "returnType": "Promise<boolean>",
571
- "isStatic": false,
572
- "isPublic": true
573
- },
574
- "clearEmbeddings": {
575
- "name": "clearEmbeddings",
576
- "async": true,
577
- "parameters": [],
578
195
  "returnType": "Promise<void>",
579
196
  "isStatic": false,
580
197
  "isPublic": true
198
+ }
199
+ },
200
+ "decoratorConfig": {
201
+ "api": false,
202
+ "mcp": false,
203
+ "cli": false,
204
+ "tableName": "place_assets"
205
+ },
206
+ "extends": "SmrtJunction",
207
+ "extendsTypeArg": "PlaceAsset",
208
+ "exportName": "PlaceAssetCollection",
209
+ "collectionExportName": "PlaceAssetCollectionCollection",
210
+ "schema": {
211
+ "tableName": "place_assets",
212
+ "ddl": "CREATE TABLE IF NOT EXISTS \"place_assets\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
213
+ "columns": {
214
+ "id": {
215
+ "type": "UUID",
216
+ "primaryKey": true,
217
+ "referenceKind": "id",
218
+ "notNull": true
219
+ },
220
+ "slug": {
221
+ "type": "TEXT",
222
+ "notNull": true
223
+ },
224
+ "context": {
225
+ "type": "TEXT",
226
+ "notNull": true,
227
+ "default": ""
228
+ },
229
+ "created_at": {
230
+ "type": "TIMESTAMP",
231
+ "notNull": true,
232
+ "default": "current_timestamp"
233
+ },
234
+ "updated_at": {
235
+ "type": "TIMESTAMP",
236
+ "notNull": true,
237
+ "default": "current_timestamp"
238
+ }
581
239
  },
582
- "getParent": {
583
- "name": "getParent",
584
- "async": true,
585
- "parameters": [],
586
- "returnType": "Promise<null>",
587
- "isStatic": false,
588
- "isPublic": true
589
- },
590
- "getChildren": {
591
- "name": "getChildren",
592
- "async": true,
593
- "parameters": [],
594
- "returnType": "Promise",
595
- "isStatic": false,
596
- "isPublic": true
597
- },
598
- "getAncestors": {
599
- "name": "getAncestors",
600
- "async": true,
601
- "parameters": [],
602
- "returnType": "Promise",
603
- "isStatic": false,
604
- "isPublic": true
605
- },
606
- "getDescendants": {
607
- "name": "getDescendants",
240
+ "indexes": [
241
+ {
242
+ "name": "place_assets_id_idx",
243
+ "columns": [
244
+ "id"
245
+ ]
246
+ },
247
+ {
248
+ "name": "place_assets_slug_context_idx",
249
+ "columns": [
250
+ "slug",
251
+ "context"
252
+ ],
253
+ "unique": true
254
+ }
255
+ ],
256
+ "version": "ceff1c5e"
257
+ }
258
+ },
259
+ "@happyvertical/smrt-places:PlaceCollection": {
260
+ "name": "placecollection",
261
+ "className": "PlaceCollection",
262
+ "qualifiedName": "@happyvertical/smrt-places:PlaceCollection",
263
+ "collection": "places",
264
+ "filePath": "/home/runner/_work/smrt/smrt/packages/places/src/collections/PlaceCollection.ts",
265
+ "packageName": "@happyvertical/smrt-places",
266
+ "fields": {},
267
+ "methods": {
268
+ "lookupOrCreate": {
269
+ "name": "lookupOrCreate",
608
270
  "async": true,
609
- "parameters": [],
610
- "returnType": "Promise",
271
+ "parameters": [
272
+ {
273
+ "name": "query",
274
+ "type": "string",
275
+ "optional": false
276
+ },
277
+ {
278
+ "name": "options",
279
+ "type": "LookupOrCreateOptions",
280
+ "optional": true
281
+ }
282
+ ],
283
+ "returnType": "Promise<Place | null>",
611
284
  "isStatic": false,
612
285
  "isPublic": true
613
286
  },
614
- "getHierarchy": {
615
- "name": "getHierarchy",
287
+ "discoverNearby": {
288
+ "name": "discoverNearby",
616
289
  "async": true,
617
- "parameters": [],
618
- "returnType": "Promise<HierarchyView>",
290
+ "parameters": [
291
+ {
292
+ "name": "latitude",
293
+ "type": "number",
294
+ "optional": false
295
+ },
296
+ {
297
+ "name": "longitude",
298
+ "type": "number",
299
+ "optional": false
300
+ },
301
+ {
302
+ "name": "radiusMeters",
303
+ "type": "number",
304
+ "optional": false
305
+ },
306
+ {
307
+ "name": "options",
308
+ "type": "DiscoverNearbyOptions",
309
+ "optional": true
310
+ }
311
+ ],
312
+ "returnType": "Promise<Place[]>",
619
313
  "isStatic": false,
620
314
  "isPublic": true
621
315
  },
622
- "moveTo": {
623
- "name": "moveTo",
316
+ "resolveTrackPlaces": {
317
+ "name": "resolveTrackPlaces",
624
318
  "async": true,
625
319
  "parameters": [
626
320
  {
627
- "name": "newParent",
628
- "type": "string | null",
321
+ "name": "points",
322
+ "type": "ReadonlyArray<TrackPoint>",
629
323
  "optional": false
324
+ },
325
+ {
326
+ "name": "options",
327
+ "type": "ResolveTrackPlacesOptions",
328
+ "optional": true
630
329
  }
631
330
  ],
632
- "returnType": "Promise<void>",
633
- "isStatic": false,
634
- "isPublic": true
635
- },
636
- "getGeoData": {
637
- "name": "getGeoData",
638
- "async": false,
639
- "parameters": [],
640
- "returnType": "GeoData",
641
- "isStatic": false,
642
- "isPublic": true
643
- },
644
- "hasCoordinates": {
645
- "name": "hasCoordinates",
646
- "async": false,
647
- "parameters": [],
648
- "returnType": "boolean",
649
- "isStatic": false,
650
- "isPublic": true
651
- },
652
- "getMetadata": {
653
- "name": "getMetadata",
654
- "async": false,
655
- "parameters": [],
656
- "returnType": "Record<string>",
331
+ "returnType": "Promise<TrackPlacesResult>",
657
332
  "isStatic": false,
658
333
  "isPublic": true
659
334
  },
660
- "setMetadata": {
661
- "name": "setMetadata",
662
- "async": false,
335
+ "getChildren": {
336
+ "name": "getChildren",
337
+ "async": true,
663
338
  "parameters": [
664
339
  {
665
- "name": "data",
666
- "type": "Record<string>",
340
+ "name": "parentId",
341
+ "type": "string",
667
342
  "optional": false
668
343
  }
669
344
  ],
670
- "returnType": "void",
345
+ "returnType": "Promise<Place[]>",
671
346
  "isStatic": false,
672
347
  "isPublic": true
673
348
  },
674
- "updateMetadata": {
675
- "name": "updateMetadata",
676
- "async": false,
349
+ "getRootPlaces": {
350
+ "name": "getRootPlaces",
351
+ "async": true,
352
+ "parameters": [],
353
+ "returnType": "Promise<Place[]>",
354
+ "isStatic": false,
355
+ "isPublic": true
356
+ },
357
+ "getByType": {
358
+ "name": "getByType",
359
+ "async": true,
677
360
  "parameters": [
678
361
  {
679
- "name": "updates",
680
- "type": "Record<string>",
362
+ "name": "typeSlug",
363
+ "type": "string",
681
364
  "optional": false
682
365
  }
683
366
  ],
684
- "returnType": "void",
367
+ "returnType": "Promise<Place[]>",
685
368
  "isStatic": false,
686
369
  "isPublic": true
687
370
  },
688
- "getType": {
689
- "name": "getType",
371
+ "getHierarchy": {
372
+ "name": "getHierarchy",
690
373
  "async": true,
691
- "parameters": [],
374
+ "parameters": [
375
+ {
376
+ "name": "placeId",
377
+ "type": "string",
378
+ "optional": false
379
+ }
380
+ ],
692
381
  "returnType": "any",
693
382
  "isStatic": false,
694
383
  "isPublic": true
@@ -697,6 +386,11 @@
697
386
  "name": "getAssets",
698
387
  "async": true,
699
388
  "parameters": [
389
+ {
390
+ "name": "placeId",
391
+ "type": "string",
392
+ "optional": false
393
+ },
700
394
  {
701
395
  "name": "relationship",
702
396
  "type": "string",
@@ -711,6 +405,11 @@
711
405
  "name": "addAsset",
712
406
  "async": true,
713
407
  "parameters": [
408
+ {
409
+ "name": "placeId",
410
+ "type": "string",
411
+ "optional": false
412
+ },
714
413
  {
715
414
  "name": "asset",
716
415
  "type": "Asset",
@@ -736,6 +435,11 @@
736
435
  "name": "removeAsset",
737
436
  "async": true,
738
437
  "parameters": [
438
+ {
439
+ "name": "placeId",
440
+ "type": "string",
441
+ "optional": false
442
+ },
739
443
  {
740
444
  "name": "assetId",
741
445
  "type": "string",
@@ -750,38 +454,76 @@
750
454
  "returnType": "Promise<void>",
751
455
  "isStatic": false,
752
456
  "isPublic": true
753
- }
754
- },
755
- "decoratorConfig": {
756
- "tableStrategy": "sti",
757
- "api": {
758
- "include": [
759
- "list",
760
- "get",
761
- "create",
762
- "update",
763
- "delete"
764
- ]
765
457
  },
766
- "mcp": {
767
- "include": [
768
- "list",
769
- "get",
770
- "create",
771
- "update"
772
- ]
458
+ "searchByProximity": {
459
+ "name": "searchByProximity",
460
+ "async": true,
461
+ "parameters": [
462
+ {
463
+ "name": "latitude",
464
+ "type": "number",
465
+ "optional": false
466
+ },
467
+ {
468
+ "name": "longitude",
469
+ "type": "number",
470
+ "optional": false
471
+ },
472
+ {
473
+ "name": "radiusKm",
474
+ "type": "number",
475
+ "optional": true
476
+ }
477
+ ],
478
+ "returnType": "Promise<Place[]>",
479
+ "isStatic": false,
480
+ "isPublic": true
773
481
  },
774
- "cli": true,
775
- "tenantScoped": {
776
- "mode": "optional"
482
+ "findByTenant": {
483
+ "name": "findByTenant",
484
+ "async": true,
485
+ "parameters": [
486
+ {
487
+ "name": "tenantId",
488
+ "type": "string",
489
+ "optional": false
490
+ }
491
+ ],
492
+ "returnType": "Promise<Place[]>",
493
+ "isStatic": false,
494
+ "isPublic": true
495
+ },
496
+ "findGlobal": {
497
+ "name": "findGlobal",
498
+ "async": true,
499
+ "parameters": [],
500
+ "returnType": "Promise<Place[]>",
501
+ "isStatic": false,
502
+ "isPublic": true
503
+ },
504
+ "findWithGlobals": {
505
+ "name": "findWithGlobals",
506
+ "async": true,
507
+ "parameters": [
508
+ {
509
+ "name": "tenantId",
510
+ "type": "string",
511
+ "optional": false
512
+ }
513
+ ],
514
+ "returnType": "Promise<Place[]>",
515
+ "isStatic": false,
516
+ "isPublic": true
777
517
  }
778
518
  },
779
- "extends": "SmrtHierarchical",
780
- "exportName": "Place",
781
- "collectionExportName": "PlaceCollection",
519
+ "decoratorConfig": {},
520
+ "extends": "SmrtCollection",
521
+ "extendsTypeArg": "Place",
522
+ "exportName": "PlaceCollection",
523
+ "collectionExportName": "PlaceCollectionCollection",
782
524
  "schema": {
783
- "tableName": "places",
784
- "ddl": "CREATE TABLE IF NOT EXISTS \"places\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"parent_id\" UUID,\n \"tenant_id\" UUID,\n \"type_id\" UUID,\n \"name\" TEXT,\n \"description\" TEXT,\n \"latitude\" REAL,\n \"longitude\" REAL,\n \"street_number\" TEXT,\n \"street_name\" TEXT,\n \"city\" TEXT,\n \"region\" TEXT,\n \"country\" TEXT,\n \"postal_code\" TEXT,\n \"country_code\" TEXT,\n \"timezone\" TEXT,\n \"external_id\" TEXT,\n \"source\" TEXT,\n \"metadata\" TEXT\n);",
525
+ "tableName": "place_collections",
526
+ "ddl": "CREATE TABLE IF NOT EXISTS \"place_collections\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
785
527
  "columns": {
786
528
  "id": {
787
529
  "type": "UUID",
@@ -798,13 +540,110 @@
798
540
  "notNull": true,
799
541
  "default": ""
800
542
  },
801
- "_meta_type": {
543
+ "created_at": {
544
+ "type": "TIMESTAMP",
545
+ "notNull": true,
546
+ "default": "current_timestamp"
547
+ },
548
+ "updated_at": {
549
+ "type": "TIMESTAMP",
550
+ "notNull": true,
551
+ "default": "current_timestamp"
552
+ }
553
+ },
554
+ "indexes": [
555
+ {
556
+ "name": "place_collections_id_idx",
557
+ "columns": [
558
+ "id"
559
+ ]
560
+ },
561
+ {
562
+ "name": "place_collections_slug_context_idx",
563
+ "columns": [
564
+ "slug",
565
+ "context"
566
+ ],
567
+ "unique": true
568
+ }
569
+ ],
570
+ "version": "d0da2f8d"
571
+ }
572
+ },
573
+ "@happyvertical/smrt-places:PlaceTypeCollection": {
574
+ "name": "placetypecollection",
575
+ "className": "PlaceTypeCollection",
576
+ "qualifiedName": "@happyvertical/smrt-places:PlaceTypeCollection",
577
+ "collection": "placetypes",
578
+ "filePath": "/home/runner/_work/smrt/smrt/packages/places/src/collections/PlaceTypeCollection.ts",
579
+ "packageName": "@happyvertical/smrt-places",
580
+ "fields": {},
581
+ "methods": {
582
+ "getOrCreate": {
583
+ "name": "getOrCreate",
584
+ "async": true,
585
+ "parameters": [
586
+ {
587
+ "name": "slug",
588
+ "type": "string",
589
+ "optional": false
590
+ },
591
+ {
592
+ "name": "name",
593
+ "type": "string",
594
+ "optional": true
595
+ }
596
+ ],
597
+ "returnType": "Promise<PlaceType>",
598
+ "isStatic": false,
599
+ "isPublic": true
600
+ },
601
+ "getBySlug": {
602
+ "name": "getBySlug",
603
+ "async": true,
604
+ "parameters": [
605
+ {
606
+ "name": "slug",
607
+ "type": "string",
608
+ "optional": false
609
+ }
610
+ ],
611
+ "returnType": "Promise<PlaceType | null>",
612
+ "isStatic": false,
613
+ "isPublic": true
614
+ },
615
+ "initializeDefaults": {
616
+ "name": "initializeDefaults",
617
+ "async": true,
618
+ "parameters": [],
619
+ "returnType": "Promise<PlaceType[]>",
620
+ "isStatic": false,
621
+ "isPublic": true
622
+ }
623
+ },
624
+ "decoratorConfig": {},
625
+ "extends": "SmrtCollection",
626
+ "extendsTypeArg": "PlaceType",
627
+ "exportName": "PlaceTypeCollection",
628
+ "collectionExportName": "PlaceTypeCollectionCollection",
629
+ "schema": {
630
+ "tableName": "place_type_collections",
631
+ "ddl": "CREATE TABLE IF NOT EXISTS \"place_type_collections\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
632
+ "columns": {
633
+ "id": {
634
+ "type": "UUID",
635
+ "primaryKey": true,
636
+ "referenceKind": "id",
637
+ "notNull": true
638
+ },
639
+ "slug": {
802
640
  "type": "TEXT",
803
641
  "notNull": true
804
642
  },
805
- "_meta_data": {
806
- "type": "JSON",
807
- "notNull": false
643
+ "context": {
644
+ "type": "TEXT",
645
+ "notNull": true,
646
+ "default": ""
808
647
  },
809
648
  "created_at": {
810
649
  "type": "TIMESTAMP",
@@ -815,117 +654,51 @@
815
654
  "type": "TIMESTAMP",
816
655
  "notNull": true,
817
656
  "default": "current_timestamp"
818
- },
819
- "parent_id": {
820
- "type": "UUID",
821
- "referenceKind": "foreignKey",
822
- "notNull": false
823
- },
824
- "tenant_id": {
825
- "type": "UUID",
826
- "referenceKind": "tenantId",
827
- "notNull": false
828
- },
829
- "type_id": {
830
- "type": "UUID",
831
- "referenceKind": "foreignKey",
832
- "notNull": false
833
- },
834
- "name": {
835
- "type": "TEXT",
836
- "notNull": false
837
- },
838
- "description": {
839
- "type": "TEXT",
840
- "notNull": false
841
- },
842
- "latitude": {
843
- "type": "REAL",
844
- "notNull": false
845
- },
846
- "longitude": {
847
- "type": "REAL",
848
- "notNull": false
849
- },
850
- "street_number": {
851
- "type": "TEXT",
852
- "notNull": false
853
- },
854
- "street_name": {
855
- "type": "TEXT",
856
- "notNull": false
857
- },
858
- "city": {
859
- "type": "TEXT",
860
- "notNull": false
861
- },
862
- "region": {
863
- "type": "TEXT",
864
- "notNull": false
865
- },
866
- "country": {
867
- "type": "TEXT",
868
- "notNull": false
869
- },
870
- "postal_code": {
871
- "type": "TEXT",
872
- "notNull": false
873
- },
874
- "country_code": {
875
- "type": "TEXT",
876
- "notNull": false
877
- },
878
- "timezone": {
879
- "type": "TEXT",
880
- "notNull": false
881
- },
882
- "external_id": {
883
- "type": "TEXT",
884
- "notNull": false
885
- },
886
- "source": {
887
- "type": "TEXT",
888
- "notNull": false
889
- },
890
- "metadata": {
891
- "type": "TEXT",
892
- "notNull": false
893
657
  }
894
658
  },
895
659
  "indexes": [
896
660
  {
897
- "name": "places_id_idx",
661
+ "name": "place_type_collections_id_idx",
898
662
  "columns": [
899
663
  "id"
900
664
  ]
901
665
  },
902
666
  {
903
- "name": "places_slug_context_meta_type_idx",
667
+ "name": "place_type_collections_slug_context_idx",
904
668
  "columns": [
905
669
  "slug",
906
- "context",
907
- "_meta_type"
670
+ "context"
908
671
  ],
909
672
  "unique": true
910
- },
911
- {
912
- "name": "places_meta_type_idx",
913
- "columns": [
914
- "_meta_type"
915
- ]
916
673
  }
917
674
  ],
918
- "version": "1fe43eb8"
675
+ "version": "b6691888"
919
676
  }
920
677
  },
921
- "@happyvertical/smrt-places:PlaceAsset": {
922
- "name": "placeasset",
923
- "className": "PlaceAsset",
924
- "qualifiedName": "@happyvertical/smrt-places:PlaceAsset",
925
- "collection": "placeassets",
926
- "filePath": "/home/runner/_work/smrt/smrt/packages/places/src/models/PlaceAsset.ts",
678
+ "@happyvertical/smrt-places:Place": {
679
+ "name": "place",
680
+ "className": "Place",
681
+ "qualifiedName": "@happyvertical/smrt-places:Place",
682
+ "collection": "places",
683
+ "filePath": "/home/runner/_work/smrt/smrt/packages/places/src/models/Place.ts",
927
684
  "packageName": "@happyvertical/smrt-places",
928
685
  "fields": {
686
+ "created_at": {
687
+ "type": "datetime",
688
+ "required": false
689
+ },
690
+ "updated_at": {
691
+ "type": "datetime",
692
+ "required": false
693
+ },
694
+ "parentId": {
695
+ "type": "foreignKey",
696
+ "required": false,
697
+ "related": "Place",
698
+ "_meta": {
699
+ "nullable": true
700
+ }
701
+ },
929
702
  "tenantId": {
930
703
  "type": "text",
931
704
  "required": false,
@@ -944,176 +717,70 @@
944
717
  }
945
718
  }
946
719
  },
947
- "placeId": {
720
+ "typeId": {
948
721
  "type": "foreignKey",
949
- "required": true,
950
- "related": "Place",
951
- "_meta": {
952
- "required": true
953
- }
722
+ "required": false,
723
+ "related": "PlaceType"
954
724
  },
955
- "assetId": {
956
- "type": "crossPackageRef",
957
- "required": true,
958
- "related": "@happyvertical/smrt-assets:Asset"
725
+ "name": {
726
+ "type": "text",
727
+ "required": false
959
728
  },
960
- "relationship": {
729
+ "description": {
961
730
  "type": "text",
962
- "required": true,
963
- "_meta": {
964
- "required": true
965
- }
731
+ "required": false
966
732
  },
967
- "sortOrder": {
968
- "type": "integer",
969
- "required": true,
970
- "default": 0
971
- }
972
- },
973
- "methods": {},
974
- "decoratorConfig": {
975
- "tableName": "place_assets",
976
- "conflictColumns": [
977
- "place_id",
978
- "asset_id",
979
- "relationship"
980
- ],
981
- "api": false,
982
- "mcp": false,
983
- "cli": false,
984
- "tenantScoped": {
985
- "mode": "optional"
986
- }
987
- },
988
- "extends": "SmrtObject",
989
- "exportName": "PlaceAsset",
990
- "collectionExportName": "PlaceAssetCollection",
991
- "validationRules": [
992
- {
993
- "field": "placeId",
994
- "rule": "required",
995
- "fieldType": "foreignKey"
733
+ "latitude": {
734
+ "type": "decimal",
735
+ "required": false,
736
+ "_meta": {}
996
737
  },
997
- {
998
- "field": "assetId",
999
- "rule": "required",
1000
- "fieldType": "crossPackageRef"
738
+ "longitude": {
739
+ "type": "decimal",
740
+ "required": false,
741
+ "_meta": {}
1001
742
  },
1002
- {
1003
- "field": "relationship",
1004
- "rule": "required",
1005
- "fieldType": "text"
743
+ "streetNumber": {
744
+ "type": "text",
745
+ "required": false
1006
746
  },
1007
- {
1008
- "field": "sortOrder",
1009
- "rule": "required",
1010
- "fieldType": "integer"
1011
- }
1012
- ],
1013
- "schema": {
1014
- "tableName": "place_assets",
1015
- "ddl": "CREATE TABLE IF NOT EXISTS \"place_assets\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"place_id\" UUID NOT NULL,\n \"asset_id\" UUID NOT NULL,\n \"relationship\" TEXT NOT NULL,\n \"sort_order\" INTEGER NOT NULL DEFAULT 0\n);",
1016
- "columns": {
1017
- "id": {
1018
- "type": "UUID",
1019
- "primaryKey": true,
1020
- "referenceKind": "id",
1021
- "notNull": true
1022
- },
1023
- "slug": {
1024
- "type": "TEXT",
1025
- "notNull": true
1026
- },
1027
- "context": {
1028
- "type": "TEXT",
1029
- "notNull": true,
1030
- "default": ""
1031
- },
1032
- "created_at": {
1033
- "type": "TIMESTAMP",
1034
- "notNull": true,
1035
- "default": "current_timestamp"
1036
- },
1037
- "updated_at": {
1038
- "type": "TIMESTAMP",
1039
- "notNull": true,
1040
- "default": "current_timestamp"
1041
- },
1042
- "tenant_id": {
1043
- "type": "UUID",
1044
- "referenceKind": "tenantId",
1045
- "notNull": false,
1046
- "unique": false
1047
- },
1048
- "place_id": {
1049
- "type": "UUID",
1050
- "referenceKind": "foreignKey",
1051
- "notNull": true,
1052
- "unique": false
1053
- },
1054
- "asset_id": {
1055
- "type": "UUID",
1056
- "referenceKind": "crossPackageRef",
1057
- "notNull": true,
1058
- "unique": false
1059
- },
1060
- "relationship": {
1061
- "type": "TEXT",
1062
- "notNull": true,
1063
- "unique": false
1064
- },
1065
- "sort_order": {
1066
- "type": "INTEGER",
1067
- "notNull": true,
1068
- "unique": false,
1069
- "default": 0
1070
- }
747
+ "streetName": {
748
+ "type": "text",
749
+ "required": false
1071
750
  },
1072
- "indexes": [
1073
- {
1074
- "name": "place_assets_id_idx",
1075
- "columns": [
1076
- "id"
1077
- ]
1078
- },
1079
- {
1080
- "name": "place_assets_place_id_asset_id_idx",
1081
- "columns": [
1082
- "place_id",
1083
- "asset_id",
1084
- "relationship"
1085
- ],
1086
- "unique": true
1087
- }
1088
- ],
1089
- "version": "34bbdfbb"
1090
- }
1091
- },
1092
- "@happyvertical/smrt-places:PlaceType": {
1093
- "name": "placetype",
1094
- "className": "PlaceType",
1095
- "qualifiedName": "@happyvertical/smrt-places:PlaceType",
1096
- "collection": "placetypes",
1097
- "filePath": "/home/runner/_work/smrt/smrt/packages/places/src/models/PlaceType.ts",
1098
- "packageName": "@happyvertical/smrt-places",
1099
- "fields": {
1100
- "created_at": {
1101
- "type": "datetime",
751
+ "city": {
752
+ "type": "text",
1102
753
  "required": false
1103
754
  },
1104
- "updated_at": {
1105
- "type": "datetime",
755
+ "region": {
756
+ "type": "text",
1106
757
  "required": false
1107
758
  },
1108
- "name": {
759
+ "country": {
1109
760
  "type": "text",
1110
- "required": true,
1111
- "default": "",
1112
- "_meta": {
1113
- "required": true
1114
- }
761
+ "required": false
1115
762
  },
1116
- "description": {
763
+ "postalCode": {
764
+ "type": "text",
765
+ "required": false
766
+ },
767
+ "countryCode": {
768
+ "type": "text",
769
+ "required": false
770
+ },
771
+ "timezone": {
772
+ "type": "text",
773
+ "required": false
774
+ },
775
+ "externalId": {
776
+ "type": "text",
777
+ "required": false
778
+ },
779
+ "source": {
780
+ "type": "text",
781
+ "required": false
782
+ },
783
+ "metadata": {
1117
784
  "type": "text",
1118
785
  "required": false
1119
786
  },
@@ -1583,18 +1250,176 @@
1583
1250
  "isStatic": false,
1584
1251
  "isPublic": true
1585
1252
  },
1586
- "getBySlug": {
1587
- "name": "getBySlug",
1253
+ "getParent": {
1254
+ "name": "getParent",
1255
+ "async": true,
1256
+ "parameters": [],
1257
+ "returnType": "Promise<null>",
1258
+ "isStatic": false,
1259
+ "isPublic": true
1260
+ },
1261
+ "getChildren": {
1262
+ "name": "getChildren",
1263
+ "async": true,
1264
+ "parameters": [],
1265
+ "returnType": "Promise",
1266
+ "isStatic": false,
1267
+ "isPublic": true
1268
+ },
1269
+ "getAncestors": {
1270
+ "name": "getAncestors",
1271
+ "async": true,
1272
+ "parameters": [],
1273
+ "returnType": "Promise",
1274
+ "isStatic": false,
1275
+ "isPublic": true
1276
+ },
1277
+ "getDescendants": {
1278
+ "name": "getDescendants",
1279
+ "async": true,
1280
+ "parameters": [],
1281
+ "returnType": "Promise",
1282
+ "isStatic": false,
1283
+ "isPublic": true
1284
+ },
1285
+ "getHierarchy": {
1286
+ "name": "getHierarchy",
1287
+ "async": true,
1288
+ "parameters": [],
1289
+ "returnType": "Promise<HierarchyView>",
1290
+ "isStatic": false,
1291
+ "isPublic": true
1292
+ },
1293
+ "moveTo": {
1294
+ "name": "moveTo",
1588
1295
  "async": true,
1589
1296
  "parameters": [
1590
1297
  {
1591
- "name": "_slug",
1298
+ "name": "newParent",
1299
+ "type": "string | null",
1300
+ "optional": false
1301
+ }
1302
+ ],
1303
+ "returnType": "Promise<void>",
1304
+ "isStatic": false,
1305
+ "isPublic": true
1306
+ },
1307
+ "getGeoData": {
1308
+ "name": "getGeoData",
1309
+ "async": false,
1310
+ "parameters": [],
1311
+ "returnType": "GeoData",
1312
+ "isStatic": false,
1313
+ "isPublic": true
1314
+ },
1315
+ "hasCoordinates": {
1316
+ "name": "hasCoordinates",
1317
+ "async": false,
1318
+ "parameters": [],
1319
+ "returnType": "boolean",
1320
+ "isStatic": false,
1321
+ "isPublic": true
1322
+ },
1323
+ "getMetadata": {
1324
+ "name": "getMetadata",
1325
+ "async": false,
1326
+ "parameters": [],
1327
+ "returnType": "Record<string>",
1328
+ "isStatic": false,
1329
+ "isPublic": true
1330
+ },
1331
+ "setMetadata": {
1332
+ "name": "setMetadata",
1333
+ "async": false,
1334
+ "parameters": [
1335
+ {
1336
+ "name": "data",
1337
+ "type": "Record<string>",
1338
+ "optional": false
1339
+ }
1340
+ ],
1341
+ "returnType": "void",
1342
+ "isStatic": false,
1343
+ "isPublic": true
1344
+ },
1345
+ "updateMetadata": {
1346
+ "name": "updateMetadata",
1347
+ "async": false,
1348
+ "parameters": [
1349
+ {
1350
+ "name": "updates",
1351
+ "type": "Record<string>",
1352
+ "optional": false
1353
+ }
1354
+ ],
1355
+ "returnType": "void",
1356
+ "isStatic": false,
1357
+ "isPublic": true
1358
+ },
1359
+ "getType": {
1360
+ "name": "getType",
1361
+ "async": true,
1362
+ "parameters": [],
1363
+ "returnType": "any",
1364
+ "isStatic": false,
1365
+ "isPublic": true
1366
+ },
1367
+ "getAssets": {
1368
+ "name": "getAssets",
1369
+ "async": true,
1370
+ "parameters": [
1371
+ {
1372
+ "name": "relationship",
1373
+ "type": "string",
1374
+ "optional": true
1375
+ }
1376
+ ],
1377
+ "returnType": "Promise<Asset[]>",
1378
+ "isStatic": false,
1379
+ "isPublic": true
1380
+ },
1381
+ "addAsset": {
1382
+ "name": "addAsset",
1383
+ "async": true,
1384
+ "parameters": [
1385
+ {
1386
+ "name": "asset",
1387
+ "type": "Asset",
1388
+ "optional": false
1389
+ },
1390
+ {
1391
+ "name": "relationship",
1392
+ "type": "any",
1393
+ "optional": true,
1394
+ "default": "attachment"
1395
+ },
1396
+ {
1397
+ "name": "sortOrder",
1398
+ "type": "any",
1399
+ "optional": true
1400
+ }
1401
+ ],
1402
+ "returnType": "Promise<void>",
1403
+ "isStatic": false,
1404
+ "isPublic": true
1405
+ },
1406
+ "removeAsset": {
1407
+ "name": "removeAsset",
1408
+ "async": true,
1409
+ "parameters": [
1410
+ {
1411
+ "name": "assetId",
1592
1412
  "type": "string",
1593
1413
  "optional": false
1414
+ },
1415
+ {
1416
+ "name": "relationship",
1417
+ "type": "string",
1418
+ "optional": true
1594
1419
  }
1595
1420
  ],
1596
- "returnType": "Promise<PlaceType | null>",
1597
- "isStatic": true,
1421
+ "returnType": "Promise<void>",
1422
+ "isStatic": false,
1598
1423
  "isPublic": true
1599
1424
  }
1600
1425
  },
@@ -1613,24 +1438,21 @@
1613
1438
  "include": [
1614
1439
  "list",
1615
1440
  "get",
1616
- "create"
1441
+ "create",
1442
+ "update"
1617
1443
  ]
1618
1444
  },
1619
- "cli": true
1620
- },
1621
- "extends": "SmrtObject",
1622
- "exportName": "PlaceType",
1623
- "collectionExportName": "PlaceTypeCollection",
1624
- "validationRules": [
1625
- {
1626
- "field": "name",
1627
- "rule": "required",
1628
- "fieldType": "text"
1445
+ "cli": true,
1446
+ "tenantScoped": {
1447
+ "mode": "optional"
1629
1448
  }
1630
- ],
1449
+ },
1450
+ "extends": "SmrtHierarchical",
1451
+ "exportName": "Place",
1452
+ "collectionExportName": "PlaceCollection",
1631
1453
  "schema": {
1632
- "tableName": "place_types",
1633
- "ddl": "CREATE TABLE IF NOT EXISTS \"place_types\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"name\" TEXT DEFAULT '',\n \"description\" TEXT\n);",
1454
+ "tableName": "places",
1455
+ "ddl": "CREATE TABLE IF NOT EXISTS \"places\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"parent_id\" UUID,\n \"tenant_id\" UUID,\n \"type_id\" UUID,\n \"name\" TEXT,\n \"description\" TEXT,\n \"latitude\" REAL,\n \"longitude\" REAL,\n \"street_number\" TEXT,\n \"street_name\" TEXT,\n \"city\" TEXT,\n \"region\" TEXT,\n \"country\" TEXT,\n \"postal_code\" TEXT,\n \"country_code\" TEXT,\n \"timezone\" TEXT,\n \"external_id\" TEXT,\n \"source\" TEXT,\n \"metadata\" TEXT\n);",
1634
1456
  "columns": {
1635
1457
  "id": {
1636
1458
  "type": "UUID",
@@ -1665,25 +1487,91 @@
1665
1487
  "notNull": true,
1666
1488
  "default": "current_timestamp"
1667
1489
  },
1490
+ "parent_id": {
1491
+ "type": "UUID",
1492
+ "referenceKind": "foreignKey",
1493
+ "notNull": false
1494
+ },
1495
+ "tenant_id": {
1496
+ "type": "UUID",
1497
+ "referenceKind": "tenantId",
1498
+ "notNull": false
1499
+ },
1500
+ "type_id": {
1501
+ "type": "UUID",
1502
+ "referenceKind": "foreignKey",
1503
+ "notNull": false
1504
+ },
1668
1505
  "name": {
1669
1506
  "type": "TEXT",
1670
- "notNull": false,
1671
- "default": ""
1507
+ "notNull": false
1672
1508
  },
1673
1509
  "description": {
1674
1510
  "type": "TEXT",
1675
1511
  "notNull": false
1512
+ },
1513
+ "latitude": {
1514
+ "type": "REAL",
1515
+ "notNull": false
1516
+ },
1517
+ "longitude": {
1518
+ "type": "REAL",
1519
+ "notNull": false
1520
+ },
1521
+ "street_number": {
1522
+ "type": "TEXT",
1523
+ "notNull": false
1524
+ },
1525
+ "street_name": {
1526
+ "type": "TEXT",
1527
+ "notNull": false
1528
+ },
1529
+ "city": {
1530
+ "type": "TEXT",
1531
+ "notNull": false
1532
+ },
1533
+ "region": {
1534
+ "type": "TEXT",
1535
+ "notNull": false
1536
+ },
1537
+ "country": {
1538
+ "type": "TEXT",
1539
+ "notNull": false
1540
+ },
1541
+ "postal_code": {
1542
+ "type": "TEXT",
1543
+ "notNull": false
1544
+ },
1545
+ "country_code": {
1546
+ "type": "TEXT",
1547
+ "notNull": false
1548
+ },
1549
+ "timezone": {
1550
+ "type": "TEXT",
1551
+ "notNull": false
1552
+ },
1553
+ "external_id": {
1554
+ "type": "TEXT",
1555
+ "notNull": false
1556
+ },
1557
+ "source": {
1558
+ "type": "TEXT",
1559
+ "notNull": false
1560
+ },
1561
+ "metadata": {
1562
+ "type": "TEXT",
1563
+ "notNull": false
1676
1564
  }
1677
1565
  },
1678
1566
  "indexes": [
1679
1567
  {
1680
- "name": "place_types_id_idx",
1568
+ "name": "places_id_idx",
1681
1569
  "columns": [
1682
1570
  "id"
1683
1571
  ]
1684
1572
  },
1685
1573
  {
1686
- "name": "place_types_slug_context_meta_type_idx",
1574
+ "name": "places_slug_context_meta_type_idx",
1687
1575
  "columns": [
1688
1576
  "slug",
1689
1577
  "context",
@@ -1692,606 +1580,677 @@
1692
1580
  "unique": true
1693
1581
  },
1694
1582
  {
1695
- "name": "place_types_meta_type_idx",
1583
+ "name": "places_meta_type_idx",
1696
1584
  "columns": [
1697
1585
  "_meta_type"
1698
1586
  ]
1699
1587
  }
1700
1588
  ],
1701
- "version": "8c3bb691"
1589
+ "version": "1fe43eb8"
1702
1590
  }
1703
1591
  },
1704
- "@happyvertical/smrt-places:PlaceAssetCollection": {
1705
- "name": "placeassetcollection",
1706
- "className": "PlaceAssetCollection",
1707
- "qualifiedName": "@happyvertical/smrt-places:PlaceAssetCollection",
1592
+ "@happyvertical/smrt-places:PlaceAsset": {
1593
+ "name": "placeasset",
1594
+ "className": "PlaceAsset",
1595
+ "qualifiedName": "@happyvertical/smrt-places:PlaceAsset",
1708
1596
  "collection": "placeassets",
1709
- "filePath": "/home/runner/_work/smrt/smrt/packages/places/src/collections/PlaceAssetCollection.ts",
1597
+ "filePath": "/home/runner/_work/smrt/smrt/packages/places/src/models/PlaceAsset.ts",
1598
+ "packageName": "@happyvertical/smrt-places",
1599
+ "fields": {
1600
+ "tenantId": {
1601
+ "type": "text",
1602
+ "required": false,
1603
+ "_meta": {
1604
+ "sqlType": "UUID",
1605
+ "nullable": true,
1606
+ "__tenancy": {
1607
+ "isTenantIdField": true,
1608
+ "autoFilter": true,
1609
+ "required": false,
1610
+ "autoPopulate": true,
1611
+ "nullable": true,
1612
+ "mode": "optional",
1613
+ "field": "tenantId",
1614
+ "allowSuperAdminBypass": false
1615
+ }
1616
+ }
1617
+ },
1618
+ "placeId": {
1619
+ "type": "foreignKey",
1620
+ "required": true,
1621
+ "related": "Place",
1622
+ "_meta": {
1623
+ "required": true
1624
+ }
1625
+ },
1626
+ "assetId": {
1627
+ "type": "crossPackageRef",
1628
+ "required": true,
1629
+ "related": "@happyvertical/smrt-assets:Asset"
1630
+ },
1631
+ "relationship": {
1632
+ "type": "text",
1633
+ "required": true,
1634
+ "_meta": {
1635
+ "required": true
1636
+ }
1637
+ },
1638
+ "sortOrder": {
1639
+ "type": "integer",
1640
+ "required": true,
1641
+ "default": 0
1642
+ }
1643
+ },
1644
+ "methods": {},
1645
+ "decoratorConfig": {
1646
+ "tableName": "place_assets",
1647
+ "conflictColumns": [
1648
+ "place_id",
1649
+ "asset_id",
1650
+ "relationship"
1651
+ ],
1652
+ "api": false,
1653
+ "mcp": false,
1654
+ "cli": false,
1655
+ "tenantScoped": {
1656
+ "mode": "optional"
1657
+ }
1658
+ },
1659
+ "extends": "SmrtObject",
1660
+ "exportName": "PlaceAsset",
1661
+ "collectionExportName": "PlaceAssetCollection",
1662
+ "validationRules": [
1663
+ {
1664
+ "field": "placeId",
1665
+ "rule": "required",
1666
+ "fieldType": "foreignKey"
1667
+ },
1668
+ {
1669
+ "field": "assetId",
1670
+ "rule": "required",
1671
+ "fieldType": "crossPackageRef"
1672
+ },
1673
+ {
1674
+ "field": "relationship",
1675
+ "rule": "required",
1676
+ "fieldType": "text"
1677
+ },
1678
+ {
1679
+ "field": "sortOrder",
1680
+ "rule": "required",
1681
+ "fieldType": "integer"
1682
+ }
1683
+ ],
1684
+ "schema": {
1685
+ "tableName": "place_assets",
1686
+ "ddl": "CREATE TABLE IF NOT EXISTS \"place_assets\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"place_id\" UUID NOT NULL,\n \"asset_id\" UUID NOT NULL,\n \"relationship\" TEXT NOT NULL,\n \"sort_order\" INTEGER NOT NULL DEFAULT 0\n);",
1687
+ "columns": {
1688
+ "id": {
1689
+ "type": "UUID",
1690
+ "primaryKey": true,
1691
+ "referenceKind": "id",
1692
+ "notNull": true
1693
+ },
1694
+ "slug": {
1695
+ "type": "TEXT",
1696
+ "notNull": true
1697
+ },
1698
+ "context": {
1699
+ "type": "TEXT",
1700
+ "notNull": true,
1701
+ "default": ""
1702
+ },
1703
+ "created_at": {
1704
+ "type": "TIMESTAMP",
1705
+ "notNull": true,
1706
+ "default": "current_timestamp"
1707
+ },
1708
+ "updated_at": {
1709
+ "type": "TIMESTAMP",
1710
+ "notNull": true,
1711
+ "default": "current_timestamp"
1712
+ },
1713
+ "tenant_id": {
1714
+ "type": "UUID",
1715
+ "referenceKind": "tenantId",
1716
+ "notNull": false,
1717
+ "unique": false
1718
+ },
1719
+ "place_id": {
1720
+ "type": "UUID",
1721
+ "referenceKind": "foreignKey",
1722
+ "notNull": true,
1723
+ "unique": false
1724
+ },
1725
+ "asset_id": {
1726
+ "type": "UUID",
1727
+ "referenceKind": "crossPackageRef",
1728
+ "notNull": true,
1729
+ "unique": false
1730
+ },
1731
+ "relationship": {
1732
+ "type": "TEXT",
1733
+ "notNull": true,
1734
+ "unique": false
1735
+ },
1736
+ "sort_order": {
1737
+ "type": "INTEGER",
1738
+ "notNull": true,
1739
+ "unique": false,
1740
+ "default": 0
1741
+ }
1742
+ },
1743
+ "indexes": [
1744
+ {
1745
+ "name": "place_assets_id_idx",
1746
+ "columns": [
1747
+ "id"
1748
+ ]
1749
+ },
1750
+ {
1751
+ "name": "place_assets_place_id_asset_id_idx",
1752
+ "columns": [
1753
+ "place_id",
1754
+ "asset_id",
1755
+ "relationship"
1756
+ ],
1757
+ "unique": true
1758
+ }
1759
+ ],
1760
+ "version": "34bbdfbb"
1761
+ }
1762
+ },
1763
+ "@happyvertical/smrt-places:PlaceType": {
1764
+ "name": "placetype",
1765
+ "className": "PlaceType",
1766
+ "qualifiedName": "@happyvertical/smrt-places:PlaceType",
1767
+ "collection": "placetypes",
1768
+ "filePath": "/home/runner/_work/smrt/smrt/packages/places/src/models/PlaceType.ts",
1710
1769
  "packageName": "@happyvertical/smrt-places",
1711
- "fields": {},
1770
+ "fields": {
1771
+ "created_at": {
1772
+ "type": "datetime",
1773
+ "required": false
1774
+ },
1775
+ "updated_at": {
1776
+ "type": "datetime",
1777
+ "required": false
1778
+ },
1779
+ "name": {
1780
+ "type": "text",
1781
+ "required": true,
1782
+ "default": "",
1783
+ "_meta": {
1784
+ "required": true
1785
+ }
1786
+ },
1787
+ "description": {
1788
+ "type": "text",
1789
+ "required": false
1790
+ },
1791
+ "createdAt": {
1792
+ "type": "text",
1793
+ "required": false
1794
+ },
1795
+ "updatedAt": {
1796
+ "type": "text",
1797
+ "required": false
1798
+ }
1799
+ },
1712
1800
  "methods": {
1713
- "byLeft": {
1714
- "name": "byLeft",
1801
+ "getAiUsageSnapshot": {
1802
+ "name": "getAiUsageSnapshot",
1803
+ "async": false,
1804
+ "parameters": [],
1805
+ "returnType": "AiUsageSnapshot | undefined",
1806
+ "isStatic": false,
1807
+ "isPublic": true
1808
+ },
1809
+ "resetAiUsage": {
1810
+ "name": "resetAiUsage",
1811
+ "async": false,
1812
+ "parameters": [],
1813
+ "returnType": "void",
1814
+ "isStatic": false,
1815
+ "isPublic": true
1816
+ },
1817
+ "listAiUsage": {
1818
+ "name": "listAiUsage",
1715
1819
  "async": true,
1716
1820
  "parameters": [
1717
1821
  {
1718
- "name": "leftId",
1719
- "type": "string",
1720
- "optional": false
1721
- },
1722
- {
1723
- "name": "opts",
1724
- "type": "JunctionFilterOptions",
1822
+ "name": "options",
1823
+ "type": "AiUsageListOptions",
1725
1824
  "optional": true
1726
1825
  }
1727
1826
  ],
1728
- "returnType": "Promise<TItem[]>",
1827
+ "returnType": "Promise<SmrtAiUsageRecord[]>",
1729
1828
  "isStatic": false,
1730
1829
  "isPublic": true
1731
1830
  },
1732
- "byRight": {
1733
- "name": "byRight",
1831
+ "summarizeAiUsage": {
1832
+ "name": "summarizeAiUsage",
1734
1833
  "async": true,
1735
1834
  "parameters": [
1736
1835
  {
1737
- "name": "rightId",
1738
- "type": "string",
1739
- "optional": false
1740
- },
1741
- {
1742
- "name": "opts",
1743
- "type": "JunctionFilterOptions",
1836
+ "name": "options",
1837
+ "type": "AiUsageSummaryOptions",
1744
1838
  "optional": true
1745
1839
  }
1746
1840
  ],
1747
- "returnType": "Promise<TItem[]>",
1841
+ "returnType": "Promise<Record<string, AiUsageStats>>",
1748
1842
  "isStatic": false,
1749
1843
  "isPublic": true
1750
1844
  },
1751
- "attach": {
1752
- "name": "attach",
1845
+ "destroy": {
1846
+ "name": "destroy",
1847
+ "async": false,
1848
+ "parameters": [],
1849
+ "returnType": "void",
1850
+ "isStatic": false,
1851
+ "isPublic": true
1852
+ },
1853
+ "markAsPersisted": {
1854
+ "name": "markAsPersisted",
1855
+ "async": false,
1856
+ "parameters": [],
1857
+ "returnType": "void",
1858
+ "isStatic": false,
1859
+ "isPublic": true
1860
+ },
1861
+ "initialize": {
1862
+ "name": "initialize",
1753
1863
  "async": true,
1754
- "parameters": [
1755
- {
1756
- "name": "leftId",
1757
- "type": "string",
1758
- "optional": false
1759
- },
1760
- {
1761
- "name": "rightId",
1762
- "type": "string",
1763
- "optional": false
1764
- },
1765
- {
1766
- "name": "opts",
1767
- "type": "JunctionAttachOptions",
1768
- "optional": true
1769
- }
1770
- ],
1771
- "returnType": "Promise<TItem>",
1864
+ "parameters": [],
1865
+ "returnType": "Promise",
1772
1866
  "isStatic": false,
1773
1867
  "isPublic": true
1774
1868
  },
1775
- "detach": {
1776
- "name": "detach",
1869
+ "loadDataFromDb": {
1870
+ "name": "loadDataFromDb",
1777
1871
  "async": true,
1778
1872
  "parameters": [
1779
1873
  {
1780
- "name": "leftId",
1781
- "type": "string",
1782
- "optional": false
1783
- },
1784
- {
1785
- "name": "rightId",
1786
- "type": "string",
1874
+ "name": "data",
1875
+ "type": "any",
1787
1876
  "optional": false
1788
- },
1789
- {
1790
- "name": "opts",
1791
- "type": "JunctionFilterOptions",
1792
- "optional": true
1793
1877
  }
1794
1878
  ],
1795
- "returnType": "Promise<void>",
1879
+ "returnType": "any",
1796
1880
  "isStatic": false,
1797
1881
  "isPublic": true
1798
1882
  },
1799
- "setLinks": {
1800
- "name": "setLinks",
1883
+ "getFields": {
1884
+ "name": "getFields",
1801
1885
  "async": true,
1802
- "parameters": [
1803
- {
1804
- "name": "leftId",
1805
- "type": "string",
1806
- "optional": false
1807
- },
1808
- {
1809
- "name": "rightIds",
1810
- "type": "string[]",
1811
- "optional": false
1812
- },
1813
- {
1814
- "name": "opts",
1815
- "type": "JunctionAttachOptions",
1816
- "optional": true
1817
- }
1818
- ],
1819
- "returnType": "Promise<void>",
1886
+ "parameters": [],
1887
+ "returnType": "any",
1820
1888
  "isStatic": false,
1821
1889
  "isPublic": true
1822
1890
  },
1823
- "getAssets": {
1824
- "name": "getAssets",
1891
+ "toJSON": {
1892
+ "name": "toJSON",
1893
+ "async": false,
1894
+ "parameters": [],
1895
+ "returnType": "any",
1896
+ "isStatic": false,
1897
+ "isPublic": true
1898
+ },
1899
+ "toPlainObject": {
1900
+ "name": "toPlainObject",
1901
+ "async": false,
1902
+ "parameters": [],
1903
+ "returnType": "Record<string>",
1904
+ "isStatic": false,
1905
+ "isPublic": true
1906
+ },
1907
+ "toPublicJSON": {
1908
+ "name": "toPublicJSON",
1909
+ "async": false,
1910
+ "parameters": [],
1911
+ "returnType": "Record<string>",
1912
+ "isStatic": false,
1913
+ "isPublic": true
1914
+ },
1915
+ "getId": {
1916
+ "name": "getId",
1825
1917
  "async": true,
1826
- "parameters": [
1827
- {
1828
- "name": "placeId",
1829
- "type": "string",
1830
- "optional": false
1831
- },
1832
- {
1833
- "name": "relationship",
1834
- "type": "string",
1835
- "optional": true
1836
- }
1837
- ],
1838
- "returnType": "Promise<Asset[]>",
1918
+ "parameters": [],
1919
+ "returnType": "any",
1839
1920
  "isStatic": false,
1840
1921
  "isPublic": true
1841
1922
  },
1842
- "addAsset": {
1843
- "name": "addAsset",
1923
+ "getSlug": {
1924
+ "name": "getSlug",
1844
1925
  "async": true,
1845
- "parameters": [
1846
- {
1847
- "name": "placeId",
1848
- "type": "string",
1849
- "optional": false
1850
- },
1851
- {
1852
- "name": "asset",
1853
- "type": "Asset",
1854
- "optional": false
1855
- },
1856
- {
1857
- "name": "relationship",
1858
- "type": "any",
1859
- "optional": true,
1860
- "default": "attachment"
1861
- },
1862
- {
1863
- "name": "sortOrder",
1864
- "type": "any",
1865
- "optional": true
1866
- }
1867
- ],
1868
- "returnType": "Promise<void>",
1926
+ "parameters": [],
1927
+ "returnType": "any",
1928
+ "isStatic": false,
1929
+ "isPublic": true
1930
+ },
1931
+ "getSavedId": {
1932
+ "name": "getSavedId",
1933
+ "async": true,
1934
+ "parameters": [],
1935
+ "returnType": "any",
1936
+ "isStatic": false,
1937
+ "isPublic": true
1938
+ },
1939
+ "isSaved": {
1940
+ "name": "isSaved",
1941
+ "async": true,
1942
+ "parameters": [],
1943
+ "returnType": "any",
1869
1944
  "isStatic": false,
1870
1945
  "isPublic": true
1871
1946
  },
1872
- "removeAsset": {
1873
- "name": "removeAsset",
1947
+ "save": {
1948
+ "name": "save",
1874
1949
  "async": true,
1950
+ "parameters": [],
1951
+ "returnType": "any",
1952
+ "isStatic": false,
1953
+ "isPublic": true
1954
+ },
1955
+ "classifyConstraintError": {
1956
+ "name": "classifyConstraintError",
1957
+ "async": false,
1875
1958
  "parameters": [
1876
1959
  {
1877
- "name": "placeId",
1878
- "type": "string",
1879
- "optional": false
1880
- },
1881
- {
1882
- "name": "assetId",
1960
+ "name": "message",
1883
1961
  "type": "string",
1884
1962
  "optional": false
1885
- },
1886
- {
1887
- "name": "relationship",
1888
- "type": "string",
1889
- "optional": true
1890
1963
  }
1891
1964
  ],
1892
- "returnType": "Promise<void>",
1965
+ "returnType": "'unique' | 'not_null' | null",
1966
+ "isStatic": true,
1967
+ "isPublic": true
1968
+ },
1969
+ "loadFromId": {
1970
+ "name": "loadFromId",
1971
+ "async": true,
1972
+ "parameters": [],
1973
+ "returnType": "any",
1893
1974
  "isStatic": false,
1894
1975
  "isPublic": true
1895
- }
1896
- },
1897
- "decoratorConfig": {
1898
- "api": false,
1899
- "mcp": false,
1900
- "cli": false,
1901
- "tableName": "place_assets"
1902
- },
1903
- "extends": "SmrtJunction",
1904
- "extendsTypeArg": "PlaceAsset",
1905
- "exportName": "PlaceAssetCollection",
1906
- "collectionExportName": "PlaceAssetCollectionCollection",
1907
- "schema": {
1908
- "tableName": "place_assets",
1909
- "ddl": "CREATE TABLE IF NOT EXISTS \"place_assets\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
1910
- "columns": {
1911
- "id": {
1912
- "type": "UUID",
1913
- "primaryKey": true,
1914
- "referenceKind": "id",
1915
- "notNull": true
1916
- },
1917
- "slug": {
1918
- "type": "TEXT",
1919
- "notNull": true
1920
- },
1921
- "context": {
1922
- "type": "TEXT",
1923
- "notNull": true,
1924
- "default": ""
1925
- },
1926
- "created_at": {
1927
- "type": "TIMESTAMP",
1928
- "notNull": true,
1929
- "default": "current_timestamp"
1930
- },
1931
- "updated_at": {
1932
- "type": "TIMESTAMP",
1933
- "notNull": true,
1934
- "default": "current_timestamp"
1935
- }
1936
1976
  },
1937
- "indexes": [
1938
- {
1939
- "name": "place_assets_id_idx",
1940
- "columns": [
1941
- "id"
1942
- ]
1943
- },
1944
- {
1945
- "name": "place_assets_slug_context_idx",
1946
- "columns": [
1947
- "slug",
1948
- "context"
1949
- ],
1950
- "unique": true
1951
- }
1952
- ],
1953
- "version": "ceff1c5e"
1954
- }
1955
- },
1956
- "@happyvertical/smrt-places:PlaceCollection": {
1957
- "name": "placecollection",
1958
- "className": "PlaceCollection",
1959
- "qualifiedName": "@happyvertical/smrt-places:PlaceCollection",
1960
- "collection": "places",
1961
- "filePath": "/home/runner/_work/smrt/smrt/packages/places/src/collections/PlaceCollection.ts",
1962
- "packageName": "@happyvertical/smrt-places",
1963
- "fields": {},
1964
- "methods": {
1965
- "lookupOrCreate": {
1966
- "name": "lookupOrCreate",
1977
+ "loadFromSlug": {
1978
+ "name": "loadFromSlug",
1979
+ "async": true,
1980
+ "parameters": [],
1981
+ "returnType": "any",
1982
+ "isStatic": false,
1983
+ "isPublic": true
1984
+ },
1985
+ "is": {
1986
+ "name": "is",
1967
1987
  "async": true,
1968
1988
  "parameters": [
1969
1989
  {
1970
- "name": "query",
1990
+ "name": "criteria",
1971
1991
  "type": "string",
1972
1992
  "optional": false
1973
1993
  },
1974
1994
  {
1975
1995
  "name": "options",
1976
- "type": "LookupOrCreateOptions",
1996
+ "type": "any",
1977
1997
  "optional": true
1978
1998
  }
1979
1999
  ],
1980
- "returnType": "Promise<Place | null>",
2000
+ "returnType": "any",
1981
2001
  "isStatic": false,
1982
2002
  "isPublic": true
1983
2003
  },
1984
- "discoverNearby": {
1985
- "name": "discoverNearby",
2004
+ "do": {
2005
+ "name": "do",
1986
2006
  "async": true,
1987
2007
  "parameters": [
1988
2008
  {
1989
- "name": "latitude",
1990
- "type": "number",
1991
- "optional": false
1992
- },
1993
- {
1994
- "name": "longitude",
1995
- "type": "number",
1996
- "optional": false
1997
- },
1998
- {
1999
- "name": "radiusMeters",
2000
- "type": "number",
2009
+ "name": "instructions",
2010
+ "type": "string",
2001
2011
  "optional": false
2002
2012
  },
2003
2013
  {
2004
2014
  "name": "options",
2005
- "type": "DiscoverNearbyOptions",
2015
+ "type": "any",
2006
2016
  "optional": true
2007
2017
  }
2008
2018
  ],
2009
- "returnType": "Promise<Place[]>",
2019
+ "returnType": "any",
2010
2020
  "isStatic": false,
2011
2021
  "isPublic": true
2012
2022
  },
2013
- "resolveTrackPlaces": {
2014
- "name": "resolveTrackPlaces",
2023
+ "describe": {
2024
+ "name": "describe",
2015
2025
  "async": true,
2016
2026
  "parameters": [
2017
- {
2018
- "name": "points",
2019
- "type": "ReadonlyArray<TrackPoint>",
2020
- "optional": false
2021
- },
2022
2027
  {
2023
2028
  "name": "options",
2024
- "type": "ResolveTrackPlacesOptions",
2029
+ "type": "any",
2025
2030
  "optional": true
2026
2031
  }
2027
2032
  ],
2028
- "returnType": "Promise<TrackPlacesResult>",
2033
+ "returnType": "any",
2029
2034
  "isStatic": false,
2030
2035
  "isPublic": true
2031
2036
  },
2032
- "getChildren": {
2033
- "name": "getChildren",
2037
+ "delete": {
2038
+ "name": "delete",
2034
2039
  "async": true,
2040
+ "parameters": [],
2041
+ "returnType": "Promise<void>",
2042
+ "isStatic": false,
2043
+ "isPublic": true
2044
+ },
2045
+ "isRelatedLoaded": {
2046
+ "name": "isRelatedLoaded",
2047
+ "async": false,
2035
2048
  "parameters": [
2036
2049
  {
2037
- "name": "parentId",
2050
+ "name": "fieldName",
2038
2051
  "type": "string",
2039
2052
  "optional": false
2040
2053
  }
2041
2054
  ],
2042
- "returnType": "Promise<Place[]>",
2043
- "isStatic": false,
2044
- "isPublic": true
2045
- },
2046
- "getRootPlaces": {
2047
- "name": "getRootPlaces",
2048
- "async": true,
2049
- "parameters": [],
2050
- "returnType": "Promise<Place[]>",
2055
+ "returnType": "boolean",
2051
2056
  "isStatic": false,
2052
2057
  "isPublic": true
2053
2058
  },
2054
- "getByType": {
2055
- "name": "getByType",
2059
+ "loadRelated": {
2060
+ "name": "loadRelated",
2056
2061
  "async": true,
2057
2062
  "parameters": [
2058
2063
  {
2059
- "name": "typeSlug",
2064
+ "name": "fieldName",
2060
2065
  "type": "string",
2061
2066
  "optional": false
2067
+ },
2068
+ {
2069
+ "name": "opts",
2070
+ "type": "LoadRelatedOptions",
2071
+ "optional": true
2062
2072
  }
2063
2073
  ],
2064
- "returnType": "Promise<Place[]>",
2074
+ "returnType": "Promise<any>",
2065
2075
  "isStatic": false,
2066
2076
  "isPublic": true
2067
2077
  },
2068
- "getHierarchy": {
2069
- "name": "getHierarchy",
2078
+ "loadRelatedMany": {
2079
+ "name": "loadRelatedMany",
2070
2080
  "async": true,
2071
2081
  "parameters": [
2072
2082
  {
2073
- "name": "placeId",
2083
+ "name": "fieldName",
2074
2084
  "type": "string",
2075
2085
  "optional": false
2086
+ },
2087
+ {
2088
+ "name": "opts",
2089
+ "type": "LoadRelatedOptions",
2090
+ "optional": true
2076
2091
  }
2077
2092
  ],
2078
- "returnType": "any",
2093
+ "returnType": "Promise<any[]>",
2079
2094
  "isStatic": false,
2080
2095
  "isPublic": true
2081
2096
  },
2082
- "getAssets": {
2083
- "name": "getAssets",
2097
+ "getRelated": {
2098
+ "name": "getRelated",
2084
2099
  "async": true,
2085
2100
  "parameters": [
2086
2101
  {
2087
- "name": "placeId",
2102
+ "name": "fieldName",
2088
2103
  "type": "string",
2089
2104
  "optional": false
2090
2105
  },
2091
2106
  {
2092
- "name": "relationship",
2093
- "type": "string",
2107
+ "name": "opts",
2108
+ "type": "LoadRelatedOptions",
2094
2109
  "optional": true
2095
2110
  }
2096
2111
  ],
2097
- "returnType": "Promise<Asset[]>",
2112
+ "returnType": "Promise<any>",
2098
2113
  "isStatic": false,
2099
2114
  "isPublic": true
2100
2115
  },
2101
- "addAsset": {
2102
- "name": "addAsset",
2116
+ "getAvailableTools": {
2117
+ "name": "getAvailableTools",
2118
+ "async": false,
2119
+ "parameters": [],
2120
+ "returnType": "AITool[]",
2121
+ "isStatic": false,
2122
+ "isPublic": true
2123
+ },
2124
+ "executeToolCall": {
2125
+ "name": "executeToolCall",
2103
2126
  "async": true,
2104
2127
  "parameters": [
2105
2128
  {
2106
- "name": "placeId",
2107
- "type": "string",
2108
- "optional": false
2109
- },
2110
- {
2111
- "name": "asset",
2112
- "type": "Asset",
2129
+ "name": "toolCall",
2130
+ "type": "ToolCall",
2113
2131
  "optional": false
2114
- },
2115
- {
2116
- "name": "relationship",
2117
- "type": "any",
2118
- "optional": true,
2119
- "default": "attachment"
2120
- },
2132
+ }
2133
+ ],
2134
+ "returnType": "Promise<ToolCallResult>",
2135
+ "isStatic": false,
2136
+ "isPublic": true
2137
+ },
2138
+ "remember": {
2139
+ "name": "remember",
2140
+ "async": true,
2141
+ "parameters": [
2121
2142
  {
2122
- "name": "sortOrder",
2123
- "type": "any",
2124
- "optional": true
2143
+ "name": "options",
2144
+ "type": "object",
2145
+ "optional": false
2125
2146
  }
2126
2147
  ],
2127
2148
  "returnType": "Promise<void>",
2128
2149
  "isStatic": false,
2129
2150
  "isPublic": true
2130
2151
  },
2131
- "removeAsset": {
2132
- "name": "removeAsset",
2152
+ "recall": {
2153
+ "name": "recall",
2133
2154
  "async": true,
2134
2155
  "parameters": [
2135
2156
  {
2136
- "name": "placeId",
2137
- "type": "string",
2138
- "optional": false
2139
- },
2140
- {
2141
- "name": "assetId",
2142
- "type": "string",
2157
+ "name": "options",
2158
+ "type": "object",
2143
2159
  "optional": false
2144
- },
2145
- {
2146
- "name": "relationship",
2147
- "type": "string",
2148
- "optional": true
2149
2160
  }
2150
2161
  ],
2151
- "returnType": "Promise<void>",
2162
+ "returnType": "Promise<any | null>",
2152
2163
  "isStatic": false,
2153
2164
  "isPublic": true
2154
2165
  },
2155
- "searchByProximity": {
2156
- "name": "searchByProximity",
2166
+ "recallAll": {
2167
+ "name": "recallAll",
2157
2168
  "async": true,
2158
2169
  "parameters": [
2159
2170
  {
2160
- "name": "latitude",
2161
- "type": "number",
2162
- "optional": false
2163
- },
2164
- {
2165
- "name": "longitude",
2166
- "type": "number",
2167
- "optional": false
2168
- },
2169
- {
2170
- "name": "radiusKm",
2171
- "type": "number",
2171
+ "name": "options",
2172
+ "type": "object",
2172
2173
  "optional": true
2173
2174
  }
2174
2175
  ],
2175
- "returnType": "Promise<Place[]>",
2176
+ "returnType": "Promise<Map<string, any>>",
2176
2177
  "isStatic": false,
2177
2178
  "isPublic": true
2178
2179
  },
2179
- "findByTenant": {
2180
- "name": "findByTenant",
2180
+ "forget": {
2181
+ "name": "forget",
2181
2182
  "async": true,
2182
2183
  "parameters": [
2183
2184
  {
2184
- "name": "tenantId",
2185
- "type": "string",
2185
+ "name": "options",
2186
+ "type": "object",
2186
2187
  "optional": false
2187
2188
  }
2188
2189
  ],
2189
- "returnType": "Promise<Place[]>",
2190
+ "returnType": "Promise<void>",
2190
2191
  "isStatic": false,
2191
2192
  "isPublic": true
2192
2193
  },
2193
- "findGlobal": {
2194
- "name": "findGlobal",
2194
+ "forgetScope": {
2195
+ "name": "forgetScope",
2195
2196
  "async": true,
2196
- "parameters": [],
2197
- "returnType": "Promise<Place[]>",
2197
+ "parameters": [
2198
+ {
2199
+ "name": "options",
2200
+ "type": "object",
2201
+ "optional": false
2202
+ }
2203
+ ],
2204
+ "returnType": "Promise<number>",
2198
2205
  "isStatic": false,
2199
2206
  "isPublic": true
2200
2207
  },
2201
- "findWithGlobals": {
2202
- "name": "findWithGlobals",
2208
+ "generateEmbeddings": {
2209
+ "name": "generateEmbeddings",
2203
2210
  "async": true,
2204
2211
  "parameters": [
2205
2212
  {
2206
- "name": "tenantId",
2207
- "type": "string",
2208
- "optional": false
2213
+ "name": "options",
2214
+ "type": "GenerateEmbeddingsOptions",
2215
+ "optional": true
2209
2216
  }
2210
2217
  ],
2211
- "returnType": "Promise<Place[]>",
2218
+ "returnType": "Promise<void>",
2212
2219
  "isStatic": false,
2213
2220
  "isPublic": true
2214
- }
2215
- },
2216
- "decoratorConfig": {},
2217
- "extends": "SmrtCollection",
2218
- "extendsTypeArg": "Place",
2219
- "exportName": "PlaceCollection",
2220
- "collectionExportName": "PlaceCollectionCollection",
2221
- "schema": {
2222
- "tableName": "place_collections",
2223
- "ddl": "CREATE TABLE IF NOT EXISTS \"place_collections\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
2224
- "columns": {
2225
- "id": {
2226
- "type": "UUID",
2227
- "primaryKey": true,
2228
- "referenceKind": "id",
2229
- "notNull": true
2230
- },
2231
- "slug": {
2232
- "type": "TEXT",
2233
- "notNull": true
2234
- },
2235
- "context": {
2236
- "type": "TEXT",
2237
- "notNull": true,
2238
- "default": ""
2239
- },
2240
- "created_at": {
2241
- "type": "TIMESTAMP",
2242
- "notNull": true,
2243
- "default": "current_timestamp"
2244
- },
2245
- "updated_at": {
2246
- "type": "TIMESTAMP",
2247
- "notNull": true,
2248
- "default": "current_timestamp"
2249
- }
2250
2221
  },
2251
- "indexes": [
2252
- {
2253
- "name": "place_collections_id_idx",
2254
- "columns": [
2255
- "id"
2256
- ]
2257
- },
2258
- {
2259
- "name": "place_collections_slug_context_idx",
2260
- "columns": [
2261
- "slug",
2262
- "context"
2263
- ],
2264
- "unique": true
2265
- }
2266
- ],
2267
- "version": "d0da2f8d"
2268
- }
2269
- },
2270
- "@happyvertical/smrt-places:PlaceTypeCollection": {
2271
- "name": "placetypecollection",
2272
- "className": "PlaceTypeCollection",
2273
- "qualifiedName": "@happyvertical/smrt-places:PlaceTypeCollection",
2274
- "collection": "placetypes",
2275
- "filePath": "/home/runner/_work/smrt/smrt/packages/places/src/collections/PlaceTypeCollection.ts",
2276
- "packageName": "@happyvertical/smrt-places",
2277
- "fields": {},
2278
- "methods": {
2279
- "getOrCreate": {
2280
- "name": "getOrCreate",
2222
+ "getEmbedding": {
2223
+ "name": "getEmbedding",
2281
2224
  "async": true,
2282
2225
  "parameters": [
2283
2226
  {
2284
- "name": "slug",
2227
+ "name": "fieldName",
2285
2228
  "type": "string",
2286
2229
  "optional": false
2287
2230
  },
2288
2231
  {
2289
- "name": "name",
2232
+ "name": "model",
2290
2233
  "type": "string",
2291
2234
  "optional": true
2292
2235
  }
2293
2236
  ],
2294
- "returnType": "Promise<PlaceType>",
2237
+ "returnType": "Promise<number[] | null>",
2238
+ "isStatic": false,
2239
+ "isPublic": true
2240
+ },
2241
+ "hasStaleEmbeddings": {
2242
+ "name": "hasStaleEmbeddings",
2243
+ "async": true,
2244
+ "parameters": [],
2245
+ "returnType": "Promise<boolean>",
2246
+ "isStatic": false,
2247
+ "isPublic": true
2248
+ },
2249
+ "clearEmbeddings": {
2250
+ "name": "clearEmbeddings",
2251
+ "async": true,
2252
+ "parameters": [],
2253
+ "returnType": "Promise<void>",
2295
2254
  "isStatic": false,
2296
2255
  "isPublic": true
2297
2256
  },
@@ -2300,32 +2259,49 @@
2300
2259
  "async": true,
2301
2260
  "parameters": [
2302
2261
  {
2303
- "name": "slug",
2262
+ "name": "_slug",
2304
2263
  "type": "string",
2305
2264
  "optional": false
2306
2265
  }
2307
2266
  ],
2308
2267
  "returnType": "Promise<PlaceType | null>",
2309
- "isStatic": false,
2310
- "isPublic": true
2311
- },
2312
- "initializeDefaults": {
2313
- "name": "initializeDefaults",
2314
- "async": true,
2315
- "parameters": [],
2316
- "returnType": "Promise<PlaceType[]>",
2317
- "isStatic": false,
2268
+ "isStatic": true,
2318
2269
  "isPublic": true
2319
2270
  }
2320
2271
  },
2321
- "decoratorConfig": {},
2322
- "extends": "SmrtCollection",
2323
- "extendsTypeArg": "PlaceType",
2324
- "exportName": "PlaceTypeCollection",
2325
- "collectionExportName": "PlaceTypeCollectionCollection",
2272
+ "decoratorConfig": {
2273
+ "tableStrategy": "sti",
2274
+ "api": {
2275
+ "include": [
2276
+ "list",
2277
+ "get",
2278
+ "create",
2279
+ "update",
2280
+ "delete"
2281
+ ]
2282
+ },
2283
+ "mcp": {
2284
+ "include": [
2285
+ "list",
2286
+ "get",
2287
+ "create"
2288
+ ]
2289
+ },
2290
+ "cli": true
2291
+ },
2292
+ "extends": "SmrtObject",
2293
+ "exportName": "PlaceType",
2294
+ "collectionExportName": "PlaceTypeCollection",
2295
+ "validationRules": [
2296
+ {
2297
+ "field": "name",
2298
+ "rule": "required",
2299
+ "fieldType": "text"
2300
+ }
2301
+ ],
2326
2302
  "schema": {
2327
- "tableName": "place_type_collections",
2328
- "ddl": "CREATE TABLE IF NOT EXISTS \"place_type_collections\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
2303
+ "tableName": "place_types",
2304
+ "ddl": "CREATE TABLE IF NOT EXISTS \"place_types\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"name\" TEXT DEFAULT '',\n \"description\" TEXT\n);",
2329
2305
  "columns": {
2330
2306
  "id": {
2331
2307
  "type": "UUID",
@@ -2342,6 +2318,14 @@
2342
2318
  "notNull": true,
2343
2319
  "default": ""
2344
2320
  },
2321
+ "_meta_type": {
2322
+ "type": "TEXT",
2323
+ "notNull": true
2324
+ },
2325
+ "_meta_data": {
2326
+ "type": "JSON",
2327
+ "notNull": false
2328
+ },
2345
2329
  "created_at": {
2346
2330
  "type": "TIMESTAMP",
2347
2331
  "notNull": true,
@@ -2351,25 +2335,41 @@
2351
2335
  "type": "TIMESTAMP",
2352
2336
  "notNull": true,
2353
2337
  "default": "current_timestamp"
2338
+ },
2339
+ "name": {
2340
+ "type": "TEXT",
2341
+ "notNull": false,
2342
+ "default": ""
2343
+ },
2344
+ "description": {
2345
+ "type": "TEXT",
2346
+ "notNull": false
2354
2347
  }
2355
2348
  },
2356
2349
  "indexes": [
2357
2350
  {
2358
- "name": "place_type_collections_id_idx",
2351
+ "name": "place_types_id_idx",
2359
2352
  "columns": [
2360
2353
  "id"
2361
2354
  ]
2362
2355
  },
2363
2356
  {
2364
- "name": "place_type_collections_slug_context_idx",
2357
+ "name": "place_types_slug_context_meta_type_idx",
2365
2358
  "columns": [
2366
2359
  "slug",
2367
- "context"
2360
+ "context",
2361
+ "_meta_type"
2368
2362
  ],
2369
2363
  "unique": true
2364
+ },
2365
+ {
2366
+ "name": "place_types_meta_type_idx",
2367
+ "columns": [
2368
+ "_meta_type"
2369
+ ]
2370
2370
  }
2371
2371
  ],
2372
- "version": "b6691888"
2372
+ "version": "8c3bb691"
2373
2373
  }
2374
2374
  }
2375
2375
  },