@happyvertical/smrt-subscriptions 0.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/AGENTS.md +26 -0
  2. package/CLAUDE.md +1 -0
  3. package/LICENSE +7 -0
  4. package/dist/.tsbuildinfo +1 -0
  5. package/dist/__smrt-register__.d.ts +2 -0
  6. package/dist/__smrt-register__.d.ts.map +1 -0
  7. package/dist/collections/SubscriptionPlanCollection.d.ts +9 -0
  8. package/dist/collections/SubscriptionPlanCollection.d.ts.map +1 -0
  9. package/dist/collections/TenantSubscriptionCollection.d.ts +29 -0
  10. package/dist/collections/TenantSubscriptionCollection.d.ts.map +1 -0
  11. package/dist/collections/TenantUsageMetricCollection.d.ts +28 -0
  12. package/dist/collections/TenantUsageMetricCollection.d.ts.map +1 -0
  13. package/dist/collections/index.d.ts +4 -0
  14. package/dist/collections/index.d.ts.map +1 -0
  15. package/dist/index.d.ts +6 -0
  16. package/dist/index.d.ts.map +1 -0
  17. package/dist/index.js +1271 -0
  18. package/dist/index.js.map +1 -0
  19. package/dist/manifest.json +1291 -0
  20. package/dist/models/SubscriptionPlan.d.ts +30 -0
  21. package/dist/models/SubscriptionPlan.d.ts.map +1 -0
  22. package/dist/models/TenantSubscription.d.ts +59 -0
  23. package/dist/models/TenantSubscription.d.ts.map +1 -0
  24. package/dist/models/TenantUsageMetric.d.ts +35 -0
  25. package/dist/models/TenantUsageMetric.d.ts.map +1 -0
  26. package/dist/models/index.d.ts +4 -0
  27. package/dist/models/index.d.ts.map +1 -0
  28. package/dist/services/index.d.ts +5 -0
  29. package/dist/services/index.d.ts.map +1 -0
  30. package/dist/services/subscription-resolver.d.ts +96 -0
  31. package/dist/services/subscription-resolver.d.ts.map +1 -0
  32. package/dist/services/threshold-evaluator.d.ts +4 -0
  33. package/dist/services/threshold-evaluator.d.ts.map +1 -0
  34. package/dist/services/usage-meter.d.ts +32 -0
  35. package/dist/services/usage-meter.d.ts.map +1 -0
  36. package/dist/smrt-knowledge.json +883 -0
  37. package/dist/svelte/PlanPicker.svelte +82 -0
  38. package/dist/svelte/PlanPicker.svelte.d.ts +10 -0
  39. package/dist/svelte/PlanPicker.svelte.d.ts.map +1 -0
  40. package/dist/svelte/SubscriptionSummary.svelte +65 -0
  41. package/dist/svelte/SubscriptionSummary.svelte.d.ts +8 -0
  42. package/dist/svelte/SubscriptionSummary.svelte.d.ts.map +1 -0
  43. package/dist/svelte/UsageThresholds.svelte +71 -0
  44. package/dist/svelte/UsageThresholds.svelte.d.ts +8 -0
  45. package/dist/svelte/UsageThresholds.svelte.d.ts.map +1 -0
  46. package/dist/svelte/i18n.d.ts +5 -0
  47. package/dist/svelte/i18n.d.ts.map +1 -0
  48. package/dist/svelte/i18n.js +9 -0
  49. package/dist/svelte/index.d.ts +4 -0
  50. package/dist/svelte/index.d.ts.map +1 -0
  51. package/dist/svelte/index.js +3 -0
  52. package/dist/types.d.ts +175 -0
  53. package/dist/types.d.ts.map +1 -0
  54. package/dist/types.js +2 -0
  55. package/dist/types.js.map +1 -0
  56. package/dist/utils.d.ts +59 -0
  57. package/dist/utils.d.ts.map +1 -0
  58. package/package.json +80 -0
  59. package/scripts/migrate-1454-drop-legacy-conflict-index.ts +110 -0
@@ -0,0 +1,883 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "generatedAt": "2026-06-23T01:11:17.827Z",
4
+ "packageName": "@happyvertical/smrt-subscriptions",
5
+ "packageVersion": "0.30.0",
6
+ "sourceManifestPath": "dist/manifest.json",
7
+ "agentDocPath": "AGENTS.md",
8
+ "sourceHashes": {
9
+ "manifest": "21d671ccc292797a700eaaa48c95ebc99bdd311585ba2b721c234bb9282ba863",
10
+ "packageJson": "d70f5db6de742a563be0d78dadffca940906ee2c488dbbe020206548ff5e1aef",
11
+ "agents": "97061be30df384ee234135e176165d3ecc6303146e596d3dd64c58ce508ae3b4"
12
+ },
13
+ "exports": [
14
+ ".",
15
+ "./manifest",
16
+ "./manifest.json",
17
+ "./svelte"
18
+ ],
19
+ "dependencies": {
20
+ "@happyvertical/smrt-core": "workspace:*",
21
+ "@happyvertical/smrt-tenancy": "workspace:*",
22
+ "@happyvertical/smrt-ui": "workspace:*",
23
+ "@happyvertical/sql": "catalog:",
24
+ "@happyvertical/smrt-vitest": "workspace:*",
25
+ "@sveltejs/package": "^2.5.7",
26
+ "@types/node": "24.10.9",
27
+ "svelte": "^5.18.0",
28
+ "svelte-check": "^4.3.5",
29
+ "typescript": "^5.9.3",
30
+ "vite": "^7.3.1",
31
+ "vitest": "^4.0.17"
32
+ },
33
+ "smrtDependencies": [
34
+ "@happyvertical/smrt-core",
35
+ "@happyvertical/smrt-tenancy",
36
+ "@happyvertical/smrt-ui",
37
+ "@happyvertical/smrt-vitest"
38
+ ],
39
+ "sdkDependencies": [
40
+ "@happyvertical/sql"
41
+ ],
42
+ "tags": [],
43
+ "risks": [],
44
+ "objects": [
45
+ {
46
+ "name": "SubscriptionPlanCollection",
47
+ "qualifiedName": "@happyvertical/smrt-subscriptions:SubscriptionPlanCollection",
48
+ "collection": "subscriptionplans",
49
+ "tableName": "_smrt_subscription_plans",
50
+ "packageName": "@happyvertical/smrt-subscriptions",
51
+ "extends": "SmrtCollection",
52
+ "fields": [],
53
+ "relationships": [],
54
+ "methods": [
55
+ "findActive",
56
+ "findByPlanKey",
57
+ "findByStripePriceId"
58
+ ],
59
+ "surfaces": [],
60
+ "relationshipFeatures": [
61
+ "uuidColumns"
62
+ ],
63
+ "tags": [],
64
+ "risks": []
65
+ },
66
+ {
67
+ "name": "TenantSubscriptionCollection",
68
+ "qualifiedName": "@happyvertical/smrt-subscriptions:TenantSubscriptionCollection",
69
+ "collection": "tenantsubscriptions",
70
+ "tableName": "_smrt_tenant_subscriptions",
71
+ "packageName": "@happyvertical/smrt-subscriptions",
72
+ "extends": "SmrtCollection",
73
+ "fields": [],
74
+ "relationships": [],
75
+ "methods": [
76
+ "findByStripeSubscriptionId",
77
+ "findByTenant",
78
+ "findCurrentForSubscriber",
79
+ "findCurrentForTenant"
80
+ ],
81
+ "surfaces": [],
82
+ "relationshipFeatures": [
83
+ "uuidColumns"
84
+ ],
85
+ "tags": [],
86
+ "risks": []
87
+ },
88
+ {
89
+ "name": "TenantUsageMetricCollection",
90
+ "qualifiedName": "@happyvertical/smrt-subscriptions:TenantUsageMetricCollection",
91
+ "collection": "tenantusagemetrics",
92
+ "tableName": "_smrt_tenant_usage_metrics",
93
+ "packageName": "@happyvertical/smrt-subscriptions",
94
+ "extends": "SmrtCollection",
95
+ "fields": [],
96
+ "relationships": [],
97
+ "methods": [
98
+ "findByTenantAndMetric",
99
+ "recordUsage",
100
+ "summarizeTenantAiUsage",
101
+ "summarizeUsage",
102
+ "summarizeUsageBatch"
103
+ ],
104
+ "surfaces": [],
105
+ "relationshipFeatures": [
106
+ "uuidColumns"
107
+ ],
108
+ "tags": [],
109
+ "risks": []
110
+ },
111
+ {
112
+ "name": "SubscriptionPlan",
113
+ "qualifiedName": "@happyvertical/smrt-subscriptions:SubscriptionPlan",
114
+ "collection": "subscriptionplans",
115
+ "tableName": "_smrt_subscription_plans",
116
+ "packageName": "@happyvertical/smrt-subscriptions",
117
+ "extends": "SmrtObject",
118
+ "fields": [
119
+ {
120
+ "name": "tenantId",
121
+ "type": "text",
122
+ "required": false,
123
+ "columnType": "UUID"
124
+ },
125
+ {
126
+ "name": "planKey",
127
+ "type": "text",
128
+ "required": false,
129
+ "columnType": "TEXT"
130
+ },
131
+ {
132
+ "name": "name",
133
+ "type": "text",
134
+ "required": false,
135
+ "columnType": "TEXT"
136
+ },
137
+ {
138
+ "name": "description",
139
+ "type": "text",
140
+ "required": false,
141
+ "columnType": "TEXT"
142
+ },
143
+ {
144
+ "name": "status",
145
+ "type": "text",
146
+ "required": false,
147
+ "columnType": "TEXT"
148
+ },
149
+ {
150
+ "name": "sortOrder",
151
+ "type": "integer",
152
+ "required": false,
153
+ "columnType": "INTEGER"
154
+ },
155
+ {
156
+ "name": "priceAmount",
157
+ "type": "decimal",
158
+ "required": false,
159
+ "columnType": "REAL"
160
+ },
161
+ {
162
+ "name": "currency",
163
+ "type": "text",
164
+ "required": false,
165
+ "columnType": "TEXT"
166
+ },
167
+ {
168
+ "name": "billingInterval",
169
+ "type": "text",
170
+ "required": false,
171
+ "columnType": "TEXT"
172
+ },
173
+ {
174
+ "name": "externalProvider",
175
+ "type": "text",
176
+ "required": false,
177
+ "columnType": "TEXT"
178
+ },
179
+ {
180
+ "name": "stripeProductId",
181
+ "type": "text",
182
+ "required": false,
183
+ "columnType": "TEXT"
184
+ },
185
+ {
186
+ "name": "stripePriceId",
187
+ "type": "text",
188
+ "required": false,
189
+ "columnType": "TEXT"
190
+ },
191
+ {
192
+ "name": "features",
193
+ "type": "text",
194
+ "required": false,
195
+ "columnType": "TEXT"
196
+ },
197
+ {
198
+ "name": "thresholds",
199
+ "type": "text",
200
+ "required": false,
201
+ "columnType": "TEXT"
202
+ },
203
+ {
204
+ "name": "metadata",
205
+ "type": "text",
206
+ "required": false,
207
+ "columnType": "TEXT"
208
+ }
209
+ ],
210
+ "relationships": [],
211
+ "methods": [
212
+ "getFeatureGrants",
213
+ "getFeatureKeys",
214
+ "getMetadata",
215
+ "getThresholds",
216
+ "isActive",
217
+ "setFeatureGrants",
218
+ "setMetadata",
219
+ "setThresholds"
220
+ ],
221
+ "surfaces": [
222
+ {
223
+ "kind": "api",
224
+ "name": "subscriptionplans.list",
225
+ "operation": "list",
226
+ "objectName": "@happyvertical/smrt-subscriptions:SubscriptionPlan",
227
+ "path": "/subscriptionplans",
228
+ "method": "GET"
229
+ },
230
+ {
231
+ "kind": "api",
232
+ "name": "subscriptionplans.get",
233
+ "operation": "get",
234
+ "objectName": "@happyvertical/smrt-subscriptions:SubscriptionPlan",
235
+ "path": "/subscriptionplans/[id]",
236
+ "method": "GET"
237
+ },
238
+ {
239
+ "kind": "api",
240
+ "name": "subscriptionplans.create",
241
+ "operation": "create",
242
+ "objectName": "@happyvertical/smrt-subscriptions:SubscriptionPlan",
243
+ "path": "/subscriptionplans",
244
+ "method": "POST"
245
+ },
246
+ {
247
+ "kind": "api",
248
+ "name": "subscriptionplans.update",
249
+ "operation": "update",
250
+ "objectName": "@happyvertical/smrt-subscriptions:SubscriptionPlan",
251
+ "path": "/subscriptionplans/[id]",
252
+ "method": "PATCH"
253
+ },
254
+ {
255
+ "kind": "cli",
256
+ "name": "subscriptionplan_list",
257
+ "operation": "list",
258
+ "objectName": "@happyvertical/smrt-subscriptions:SubscriptionPlan"
259
+ },
260
+ {
261
+ "kind": "cli",
262
+ "name": "subscriptionplan_get",
263
+ "operation": "get",
264
+ "objectName": "@happyvertical/smrt-subscriptions:SubscriptionPlan"
265
+ },
266
+ {
267
+ "kind": "cli",
268
+ "name": "subscriptionplan_create",
269
+ "operation": "create",
270
+ "objectName": "@happyvertical/smrt-subscriptions:SubscriptionPlan"
271
+ },
272
+ {
273
+ "kind": "cli",
274
+ "name": "subscriptionplan_update",
275
+ "operation": "update",
276
+ "objectName": "@happyvertical/smrt-subscriptions:SubscriptionPlan"
277
+ },
278
+ {
279
+ "kind": "cli",
280
+ "name": "subscriptionplan_delete",
281
+ "operation": "delete",
282
+ "objectName": "@happyvertical/smrt-subscriptions:SubscriptionPlan"
283
+ },
284
+ {
285
+ "kind": "mcp",
286
+ "name": "subscriptionplan_list",
287
+ "operation": "list",
288
+ "objectName": "@happyvertical/smrt-subscriptions:SubscriptionPlan"
289
+ },
290
+ {
291
+ "kind": "mcp",
292
+ "name": "subscriptionplan_get",
293
+ "operation": "get",
294
+ "objectName": "@happyvertical/smrt-subscriptions:SubscriptionPlan"
295
+ }
296
+ ],
297
+ "relationshipFeatures": [
298
+ "uuidColumns"
299
+ ],
300
+ "tags": [],
301
+ "risks": []
302
+ },
303
+ {
304
+ "name": "TenantSubscription",
305
+ "qualifiedName": "@happyvertical/smrt-subscriptions:TenantSubscription",
306
+ "collection": "tenantsubscriptions",
307
+ "tableName": "_smrt_tenant_subscriptions",
308
+ "packageName": "@happyvertical/smrt-subscriptions",
309
+ "extends": "SmrtObject",
310
+ "fields": [
311
+ {
312
+ "name": "tenantId",
313
+ "type": "text",
314
+ "required": true,
315
+ "columnType": "UUID"
316
+ },
317
+ {
318
+ "name": "subscriberKind",
319
+ "type": "text",
320
+ "required": false,
321
+ "columnType": "TEXT"
322
+ },
323
+ {
324
+ "name": "subscriberExternalId",
325
+ "type": "text",
326
+ "required": false,
327
+ "columnType": "TEXT"
328
+ },
329
+ {
330
+ "name": "planId",
331
+ "type": "foreignKey",
332
+ "required": false,
333
+ "related": "SubscriptionPlan",
334
+ "columnType": "UUID"
335
+ },
336
+ {
337
+ "name": "status",
338
+ "type": "text",
339
+ "required": false,
340
+ "columnType": "TEXT"
341
+ },
342
+ {
343
+ "name": "startedAt",
344
+ "type": "datetime",
345
+ "required": false,
346
+ "columnType": "TIMESTAMP"
347
+ },
348
+ {
349
+ "name": "currentPeriodStart",
350
+ "type": "datetime",
351
+ "required": false,
352
+ "columnType": "TIMESTAMP"
353
+ },
354
+ {
355
+ "name": "currentPeriodEnd",
356
+ "type": "datetime",
357
+ "required": false,
358
+ "columnType": "TIMESTAMP"
359
+ },
360
+ {
361
+ "name": "trialEndsAt",
362
+ "type": "datetime",
363
+ "required": false,
364
+ "columnType": "TIMESTAMP"
365
+ },
366
+ {
367
+ "name": "cancelAtPeriodEnd",
368
+ "type": "boolean",
369
+ "required": false,
370
+ "columnType": "BOOLEAN"
371
+ },
372
+ {
373
+ "name": "canceledAt",
374
+ "type": "datetime",
375
+ "required": false,
376
+ "columnType": "TIMESTAMP"
377
+ },
378
+ {
379
+ "name": "externalProvider",
380
+ "type": "text",
381
+ "required": false,
382
+ "columnType": "TEXT"
383
+ },
384
+ {
385
+ "name": "stripeCustomerId",
386
+ "type": "text",
387
+ "required": false,
388
+ "columnType": "TEXT"
389
+ },
390
+ {
391
+ "name": "stripeSubscriptionId",
392
+ "type": "text",
393
+ "required": false,
394
+ "columnType": "TEXT"
395
+ },
396
+ {
397
+ "name": "stripeCheckoutSessionId",
398
+ "type": "text",
399
+ "required": false,
400
+ "columnType": "TEXT"
401
+ },
402
+ {
403
+ "name": "metadata",
404
+ "type": "text",
405
+ "required": false,
406
+ "columnType": "TEXT"
407
+ }
408
+ ],
409
+ "relationships": [
410
+ {
411
+ "name": "planId",
412
+ "type": "foreignKey",
413
+ "required": false,
414
+ "related": "SubscriptionPlan",
415
+ "columnType": "UUID"
416
+ }
417
+ ],
418
+ "methods": [
419
+ "getMetadata",
420
+ "getSubscriber",
421
+ "isEntitled",
422
+ "setMetadata"
423
+ ],
424
+ "surfaces": [
425
+ {
426
+ "kind": "api",
427
+ "name": "tenantsubscriptions.list",
428
+ "operation": "list",
429
+ "objectName": "@happyvertical/smrt-subscriptions:TenantSubscription",
430
+ "path": "/tenantsubscriptions",
431
+ "method": "GET"
432
+ },
433
+ {
434
+ "kind": "api",
435
+ "name": "tenantsubscriptions.get",
436
+ "operation": "get",
437
+ "objectName": "@happyvertical/smrt-subscriptions:TenantSubscription",
438
+ "path": "/tenantsubscriptions/[id]",
439
+ "method": "GET"
440
+ },
441
+ {
442
+ "kind": "api",
443
+ "name": "tenantsubscriptions.create",
444
+ "operation": "create",
445
+ "objectName": "@happyvertical/smrt-subscriptions:TenantSubscription",
446
+ "path": "/tenantsubscriptions",
447
+ "method": "POST"
448
+ },
449
+ {
450
+ "kind": "api",
451
+ "name": "tenantsubscriptions.update",
452
+ "operation": "update",
453
+ "objectName": "@happyvertical/smrt-subscriptions:TenantSubscription",
454
+ "path": "/tenantsubscriptions/[id]",
455
+ "method": "PATCH"
456
+ },
457
+ {
458
+ "kind": "cli",
459
+ "name": "tenantsubscription_list",
460
+ "operation": "list",
461
+ "objectName": "@happyvertical/smrt-subscriptions:TenantSubscription"
462
+ },
463
+ {
464
+ "kind": "cli",
465
+ "name": "tenantsubscription_get",
466
+ "operation": "get",
467
+ "objectName": "@happyvertical/smrt-subscriptions:TenantSubscription"
468
+ },
469
+ {
470
+ "kind": "cli",
471
+ "name": "tenantsubscription_create",
472
+ "operation": "create",
473
+ "objectName": "@happyvertical/smrt-subscriptions:TenantSubscription"
474
+ },
475
+ {
476
+ "kind": "cli",
477
+ "name": "tenantsubscription_update",
478
+ "operation": "update",
479
+ "objectName": "@happyvertical/smrt-subscriptions:TenantSubscription"
480
+ },
481
+ {
482
+ "kind": "cli",
483
+ "name": "tenantsubscription_delete",
484
+ "operation": "delete",
485
+ "objectName": "@happyvertical/smrt-subscriptions:TenantSubscription"
486
+ },
487
+ {
488
+ "kind": "mcp",
489
+ "name": "tenantsubscription_list",
490
+ "operation": "list",
491
+ "objectName": "@happyvertical/smrt-subscriptions:TenantSubscription"
492
+ },
493
+ {
494
+ "kind": "mcp",
495
+ "name": "tenantsubscription_get",
496
+ "operation": "get",
497
+ "objectName": "@happyvertical/smrt-subscriptions:TenantSubscription"
498
+ }
499
+ ],
500
+ "relationshipFeatures": [
501
+ "foreignKey",
502
+ "uuidColumns"
503
+ ],
504
+ "tags": [],
505
+ "risks": []
506
+ },
507
+ {
508
+ "name": "TenantUsageMetric",
509
+ "qualifiedName": "@happyvertical/smrt-subscriptions:TenantUsageMetric",
510
+ "collection": "tenantusagemetrics",
511
+ "tableName": "_smrt_tenant_usage_metrics",
512
+ "packageName": "@happyvertical/smrt-subscriptions",
513
+ "extends": "SmrtObject",
514
+ "fields": [
515
+ {
516
+ "name": "tenantId",
517
+ "type": "text",
518
+ "required": true,
519
+ "columnType": "UUID"
520
+ },
521
+ {
522
+ "name": "subscriberKind",
523
+ "type": "text",
524
+ "required": false,
525
+ "columnType": "TEXT"
526
+ },
527
+ {
528
+ "name": "subscriberExternalId",
529
+ "type": "text",
530
+ "required": false,
531
+ "columnType": "TEXT"
532
+ },
533
+ {
534
+ "name": "metricKey",
535
+ "type": "text",
536
+ "required": false,
537
+ "columnType": "TEXT"
538
+ },
539
+ {
540
+ "name": "quantity",
541
+ "type": "decimal",
542
+ "required": false,
543
+ "columnType": "REAL"
544
+ },
545
+ {
546
+ "name": "windowStart",
547
+ "type": "datetime",
548
+ "required": false,
549
+ "columnType": "TIMESTAMP"
550
+ },
551
+ {
552
+ "name": "windowEnd",
553
+ "type": "datetime",
554
+ "required": false,
555
+ "columnType": "TIMESTAMP"
556
+ },
557
+ {
558
+ "name": "source",
559
+ "type": "text",
560
+ "required": false,
561
+ "columnType": "TEXT"
562
+ },
563
+ {
564
+ "name": "sourceId",
565
+ "type": "text",
566
+ "required": false,
567
+ "columnType": "TEXT"
568
+ },
569
+ {
570
+ "name": "dimensions",
571
+ "type": "text",
572
+ "required": false,
573
+ "columnType": "TEXT"
574
+ }
575
+ ],
576
+ "relationships": [],
577
+ "methods": [
578
+ "getDimensions",
579
+ "getSubscriber",
580
+ "setDimensions"
581
+ ],
582
+ "surfaces": [
583
+ {
584
+ "kind": "api",
585
+ "name": "tenantusagemetrics.list",
586
+ "operation": "list",
587
+ "objectName": "@happyvertical/smrt-subscriptions:TenantUsageMetric",
588
+ "path": "/tenantusagemetrics",
589
+ "method": "GET"
590
+ },
591
+ {
592
+ "kind": "api",
593
+ "name": "tenantusagemetrics.get",
594
+ "operation": "get",
595
+ "objectName": "@happyvertical/smrt-subscriptions:TenantUsageMetric",
596
+ "path": "/tenantusagemetrics/[id]",
597
+ "method": "GET"
598
+ },
599
+ {
600
+ "kind": "api",
601
+ "name": "tenantusagemetrics.create",
602
+ "operation": "create",
603
+ "objectName": "@happyvertical/smrt-subscriptions:TenantUsageMetric",
604
+ "path": "/tenantusagemetrics",
605
+ "method": "POST"
606
+ },
607
+ {
608
+ "kind": "cli",
609
+ "name": "tenantusagemetric_list",
610
+ "operation": "list",
611
+ "objectName": "@happyvertical/smrt-subscriptions:TenantUsageMetric"
612
+ },
613
+ {
614
+ "kind": "cli",
615
+ "name": "tenantusagemetric_get",
616
+ "operation": "get",
617
+ "objectName": "@happyvertical/smrt-subscriptions:TenantUsageMetric"
618
+ },
619
+ {
620
+ "kind": "cli",
621
+ "name": "tenantusagemetric_create",
622
+ "operation": "create",
623
+ "objectName": "@happyvertical/smrt-subscriptions:TenantUsageMetric"
624
+ },
625
+ {
626
+ "kind": "cli",
627
+ "name": "tenantusagemetric_update",
628
+ "operation": "update",
629
+ "objectName": "@happyvertical/smrt-subscriptions:TenantUsageMetric"
630
+ },
631
+ {
632
+ "kind": "cli",
633
+ "name": "tenantusagemetric_delete",
634
+ "operation": "delete",
635
+ "objectName": "@happyvertical/smrt-subscriptions:TenantUsageMetric"
636
+ },
637
+ {
638
+ "kind": "mcp",
639
+ "name": "tenantusagemetric_list",
640
+ "operation": "list",
641
+ "objectName": "@happyvertical/smrt-subscriptions:TenantUsageMetric"
642
+ },
643
+ {
644
+ "kind": "mcp",
645
+ "name": "tenantusagemetric_get",
646
+ "operation": "get",
647
+ "objectName": "@happyvertical/smrt-subscriptions:TenantUsageMetric"
648
+ }
649
+ ],
650
+ "relationshipFeatures": [
651
+ "uuidColumns"
652
+ ],
653
+ "tags": [],
654
+ "risks": []
655
+ }
656
+ ],
657
+ "surfaces": [
658
+ {
659
+ "kind": "api",
660
+ "name": "subscriptionplans.list",
661
+ "operation": "list",
662
+ "objectName": "@happyvertical/smrt-subscriptions:SubscriptionPlan",
663
+ "path": "/subscriptionplans",
664
+ "method": "GET"
665
+ },
666
+ {
667
+ "kind": "api",
668
+ "name": "subscriptionplans.get",
669
+ "operation": "get",
670
+ "objectName": "@happyvertical/smrt-subscriptions:SubscriptionPlan",
671
+ "path": "/subscriptionplans/[id]",
672
+ "method": "GET"
673
+ },
674
+ {
675
+ "kind": "api",
676
+ "name": "subscriptionplans.create",
677
+ "operation": "create",
678
+ "objectName": "@happyvertical/smrt-subscriptions:SubscriptionPlan",
679
+ "path": "/subscriptionplans",
680
+ "method": "POST"
681
+ },
682
+ {
683
+ "kind": "api",
684
+ "name": "subscriptionplans.update",
685
+ "operation": "update",
686
+ "objectName": "@happyvertical/smrt-subscriptions:SubscriptionPlan",
687
+ "path": "/subscriptionplans/[id]",
688
+ "method": "PATCH"
689
+ },
690
+ {
691
+ "kind": "cli",
692
+ "name": "subscriptionplan_list",
693
+ "operation": "list",
694
+ "objectName": "@happyvertical/smrt-subscriptions:SubscriptionPlan"
695
+ },
696
+ {
697
+ "kind": "cli",
698
+ "name": "subscriptionplan_get",
699
+ "operation": "get",
700
+ "objectName": "@happyvertical/smrt-subscriptions:SubscriptionPlan"
701
+ },
702
+ {
703
+ "kind": "cli",
704
+ "name": "subscriptionplan_create",
705
+ "operation": "create",
706
+ "objectName": "@happyvertical/smrt-subscriptions:SubscriptionPlan"
707
+ },
708
+ {
709
+ "kind": "cli",
710
+ "name": "subscriptionplan_update",
711
+ "operation": "update",
712
+ "objectName": "@happyvertical/smrt-subscriptions:SubscriptionPlan"
713
+ },
714
+ {
715
+ "kind": "cli",
716
+ "name": "subscriptionplan_delete",
717
+ "operation": "delete",
718
+ "objectName": "@happyvertical/smrt-subscriptions:SubscriptionPlan"
719
+ },
720
+ {
721
+ "kind": "mcp",
722
+ "name": "subscriptionplan_list",
723
+ "operation": "list",
724
+ "objectName": "@happyvertical/smrt-subscriptions:SubscriptionPlan"
725
+ },
726
+ {
727
+ "kind": "mcp",
728
+ "name": "subscriptionplan_get",
729
+ "operation": "get",
730
+ "objectName": "@happyvertical/smrt-subscriptions:SubscriptionPlan"
731
+ },
732
+ {
733
+ "kind": "api",
734
+ "name": "tenantsubscriptions.list",
735
+ "operation": "list",
736
+ "objectName": "@happyvertical/smrt-subscriptions:TenantSubscription",
737
+ "path": "/tenantsubscriptions",
738
+ "method": "GET"
739
+ },
740
+ {
741
+ "kind": "api",
742
+ "name": "tenantsubscriptions.get",
743
+ "operation": "get",
744
+ "objectName": "@happyvertical/smrt-subscriptions:TenantSubscription",
745
+ "path": "/tenantsubscriptions/[id]",
746
+ "method": "GET"
747
+ },
748
+ {
749
+ "kind": "api",
750
+ "name": "tenantsubscriptions.create",
751
+ "operation": "create",
752
+ "objectName": "@happyvertical/smrt-subscriptions:TenantSubscription",
753
+ "path": "/tenantsubscriptions",
754
+ "method": "POST"
755
+ },
756
+ {
757
+ "kind": "api",
758
+ "name": "tenantsubscriptions.update",
759
+ "operation": "update",
760
+ "objectName": "@happyvertical/smrt-subscriptions:TenantSubscription",
761
+ "path": "/tenantsubscriptions/[id]",
762
+ "method": "PATCH"
763
+ },
764
+ {
765
+ "kind": "cli",
766
+ "name": "tenantsubscription_list",
767
+ "operation": "list",
768
+ "objectName": "@happyvertical/smrt-subscriptions:TenantSubscription"
769
+ },
770
+ {
771
+ "kind": "cli",
772
+ "name": "tenantsubscription_get",
773
+ "operation": "get",
774
+ "objectName": "@happyvertical/smrt-subscriptions:TenantSubscription"
775
+ },
776
+ {
777
+ "kind": "cli",
778
+ "name": "tenantsubscription_create",
779
+ "operation": "create",
780
+ "objectName": "@happyvertical/smrt-subscriptions:TenantSubscription"
781
+ },
782
+ {
783
+ "kind": "cli",
784
+ "name": "tenantsubscription_update",
785
+ "operation": "update",
786
+ "objectName": "@happyvertical/smrt-subscriptions:TenantSubscription"
787
+ },
788
+ {
789
+ "kind": "cli",
790
+ "name": "tenantsubscription_delete",
791
+ "operation": "delete",
792
+ "objectName": "@happyvertical/smrt-subscriptions:TenantSubscription"
793
+ },
794
+ {
795
+ "kind": "mcp",
796
+ "name": "tenantsubscription_list",
797
+ "operation": "list",
798
+ "objectName": "@happyvertical/smrt-subscriptions:TenantSubscription"
799
+ },
800
+ {
801
+ "kind": "mcp",
802
+ "name": "tenantsubscription_get",
803
+ "operation": "get",
804
+ "objectName": "@happyvertical/smrt-subscriptions:TenantSubscription"
805
+ },
806
+ {
807
+ "kind": "api",
808
+ "name": "tenantusagemetrics.list",
809
+ "operation": "list",
810
+ "objectName": "@happyvertical/smrt-subscriptions:TenantUsageMetric",
811
+ "path": "/tenantusagemetrics",
812
+ "method": "GET"
813
+ },
814
+ {
815
+ "kind": "api",
816
+ "name": "tenantusagemetrics.get",
817
+ "operation": "get",
818
+ "objectName": "@happyvertical/smrt-subscriptions:TenantUsageMetric",
819
+ "path": "/tenantusagemetrics/[id]",
820
+ "method": "GET"
821
+ },
822
+ {
823
+ "kind": "api",
824
+ "name": "tenantusagemetrics.create",
825
+ "operation": "create",
826
+ "objectName": "@happyvertical/smrt-subscriptions:TenantUsageMetric",
827
+ "path": "/tenantusagemetrics",
828
+ "method": "POST"
829
+ },
830
+ {
831
+ "kind": "cli",
832
+ "name": "tenantusagemetric_list",
833
+ "operation": "list",
834
+ "objectName": "@happyvertical/smrt-subscriptions:TenantUsageMetric"
835
+ },
836
+ {
837
+ "kind": "cli",
838
+ "name": "tenantusagemetric_get",
839
+ "operation": "get",
840
+ "objectName": "@happyvertical/smrt-subscriptions:TenantUsageMetric"
841
+ },
842
+ {
843
+ "kind": "cli",
844
+ "name": "tenantusagemetric_create",
845
+ "operation": "create",
846
+ "objectName": "@happyvertical/smrt-subscriptions:TenantUsageMetric"
847
+ },
848
+ {
849
+ "kind": "cli",
850
+ "name": "tenantusagemetric_update",
851
+ "operation": "update",
852
+ "objectName": "@happyvertical/smrt-subscriptions:TenantUsageMetric"
853
+ },
854
+ {
855
+ "kind": "cli",
856
+ "name": "tenantusagemetric_delete",
857
+ "operation": "delete",
858
+ "objectName": "@happyvertical/smrt-subscriptions:TenantUsageMetric"
859
+ },
860
+ {
861
+ "kind": "mcp",
862
+ "name": "tenantusagemetric_list",
863
+ "operation": "list",
864
+ "objectName": "@happyvertical/smrt-subscriptions:TenantUsageMetric"
865
+ },
866
+ {
867
+ "kind": "mcp",
868
+ "name": "tenantusagemetric_get",
869
+ "operation": "get",
870
+ "objectName": "@happyvertical/smrt-subscriptions:TenantUsageMetric"
871
+ }
872
+ ],
873
+ "prompts": [],
874
+ "relationshipsV2": {
875
+ "foreignKeyFields": 1,
876
+ "crossPackageRefFields": 0,
877
+ "junctionCollections": 0,
878
+ "hierarchicalObjects": 0,
879
+ "polymorphicAssociations": 0,
880
+ "uuidColumns": 10
881
+ },
882
+ "agentDoc": "# @happyvertical/smrt-subscriptions\n\nTenant subscriptions, plan features, usage thresholds, and entitlement\nresolution for SMRT applications.\n\n## Validation\n\n```bash\npnpm --filter @happyvertical/smrt-subscriptions test\npnpm --filter @happyvertical/smrt-subscriptions typecheck\npnpm --filter @happyvertical/smrt-subscriptions build\n```\n\n## Notes\n\n- Keep Stripe-specific fields as provider binding metadata. Runtime Stripe API\n calls belong in the HappyVertical SDK accounting provider.\n- Thresholds are evaluated from tenant usage metrics and optional AI usage\n summaries. Resolve multiple thresholds with the batch usage path where\n available; do not bypass tenant context in application code.\n- Use `SubscriptionResolver.create()` or an explicitly injected\n `SubscriptionResolver` once per request when resolving entitlements multiple\n times. Load and pass `EntitlementResolutionContext` to avoid re-reading the\n current subscription and plan.\n- Subscription UI components should stay provider-neutral and receive actions\n from the host app.\n"
883
+ }