@happyvertical/smrt-places 0.35.2 → 0.35.4

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