@happyvertical/smrt-assets 0.51.39 → 0.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/asset-conventions.d.ts +4 -1
- package/dist/asset-conventions.d.ts.map +1 -1
- package/dist/asset-tag.d.ts +29 -0
- package/dist/asset-tag.d.ts.map +1 -0
- package/dist/asset-tags.d.ts +16 -0
- package/dist/asset-tags.d.ts.map +1 -0
- package/dist/asset.d.ts +13 -3
- package/dist/asset.d.ts.map +1 -1
- package/dist/assets.d.ts +42 -14
- package/dist/assets.d.ts.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +281 -89
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +450 -5
- package/dist/owned-asset-helpers.d.ts +15 -0
- package/dist/owned-asset-helpers.d.ts.map +1 -1
- package/dist/smrt-knowledge.json +307 -15
- package/package.json +14 -14
package/dist/smrt-knowledge.json
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
"sensitiveFieldsExcluded": true,
|
|
4
4
|
"generatedAt": "1970-01-01T00:00:00.000Z",
|
|
5
5
|
"packageName": "@happyvertical/smrt-assets",
|
|
6
|
-
"packageVersion": "0.
|
|
6
|
+
"packageVersion": "0.52.0",
|
|
7
7
|
"sourceManifestPath": "dist/manifest.json",
|
|
8
8
|
"agentDocPath": "AGENTS.md",
|
|
9
9
|
"sourceHashes": {
|
|
10
|
-
"manifest": "
|
|
11
|
-
"packageJson": "
|
|
10
|
+
"manifest": "e671342445926a793ef28452dc635b43ba6a63f15b11959e5f781cbe167d5f30",
|
|
11
|
+
"packageJson": "e65913a27bf64dd1be8aa22ccd89be516bb38ce1467cb234cac55ff77c0c2b01",
|
|
12
12
|
"agents": "b20a644cf88ab66f1086b329be02d127f5396026260fbc2c515d5842cfe3d3de"
|
|
13
13
|
},
|
|
14
14
|
"exports": [
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@sveltejs/package": "^2.5.8",
|
|
40
40
|
"@sveltejs/vite-plugin-svelte": "^7.3.0",
|
|
41
41
|
"@types/node": "24.13.6",
|
|
42
|
-
"svelte": "^5.57.
|
|
42
|
+
"svelte": "^5.57.0",
|
|
43
43
|
"svelte-check": "^4.7.6",
|
|
44
44
|
"tslib": "^2.8.1",
|
|
45
45
|
"typescript": "6.0.3",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"versioning"
|
|
74
74
|
],
|
|
75
75
|
"risks": [
|
|
76
|
-
"cross-package-refs:
|
|
76
|
+
"cross-package-refs:3",
|
|
77
77
|
"polymorphic-associations:1",
|
|
78
78
|
"sensitive-fields-excluded",
|
|
79
79
|
"sti-inheritance"
|
|
@@ -955,6 +955,181 @@
|
|
|
955
955
|
"tags": [],
|
|
956
956
|
"risks": []
|
|
957
957
|
},
|
|
958
|
+
{
|
|
959
|
+
"name": "AssetTag",
|
|
960
|
+
"qualifiedName": "@happyvertical/smrt-assets:AssetTag",
|
|
961
|
+
"collection": "assettags",
|
|
962
|
+
"tableName": "asset_tags",
|
|
963
|
+
"packageName": "@happyvertical/smrt-assets",
|
|
964
|
+
"extends": "SmrtObject",
|
|
965
|
+
"fields": [
|
|
966
|
+
{
|
|
967
|
+
"name": "tenantId",
|
|
968
|
+
"type": "text",
|
|
969
|
+
"required": false,
|
|
970
|
+
"columnType": "UUID"
|
|
971
|
+
},
|
|
972
|
+
{
|
|
973
|
+
"name": "assetId",
|
|
974
|
+
"type": "foreignKey",
|
|
975
|
+
"required": true,
|
|
976
|
+
"related": "Asset",
|
|
977
|
+
"columnType": "UUID"
|
|
978
|
+
},
|
|
979
|
+
{
|
|
980
|
+
"name": "tagId",
|
|
981
|
+
"type": "crossPackageRef",
|
|
982
|
+
"required": true,
|
|
983
|
+
"related": "@happyvertical/smrt-tags:Tag",
|
|
984
|
+
"columnType": "UUID"
|
|
985
|
+
}
|
|
986
|
+
],
|
|
987
|
+
"relationships": [
|
|
988
|
+
{
|
|
989
|
+
"name": "assetId",
|
|
990
|
+
"type": "foreignKey",
|
|
991
|
+
"required": true,
|
|
992
|
+
"related": "Asset",
|
|
993
|
+
"columnType": "UUID"
|
|
994
|
+
},
|
|
995
|
+
{
|
|
996
|
+
"name": "tagId",
|
|
997
|
+
"type": "crossPackageRef",
|
|
998
|
+
"required": true,
|
|
999
|
+
"related": "@happyvertical/smrt-tags:Tag",
|
|
1000
|
+
"columnType": "UUID"
|
|
1001
|
+
}
|
|
1002
|
+
],
|
|
1003
|
+
"methods": [],
|
|
1004
|
+
"tenant": {
|
|
1005
|
+
"scoped": true,
|
|
1006
|
+
"mode": "optional",
|
|
1007
|
+
"field": "tenantId"
|
|
1008
|
+
},
|
|
1009
|
+
"conflictColumns": [
|
|
1010
|
+
"asset_id",
|
|
1011
|
+
"tag_id"
|
|
1012
|
+
],
|
|
1013
|
+
"surfaces": [],
|
|
1014
|
+
"relationshipFeatures": [
|
|
1015
|
+
"crossPackageRef",
|
|
1016
|
+
"foreignKey",
|
|
1017
|
+
"uuidColumns"
|
|
1018
|
+
],
|
|
1019
|
+
"tags": [],
|
|
1020
|
+
"risks": []
|
|
1021
|
+
},
|
|
1022
|
+
{
|
|
1023
|
+
"name": "AssetTagCollection",
|
|
1024
|
+
"qualifiedName": "@happyvertical/smrt-assets:AssetTagCollection",
|
|
1025
|
+
"collection": "assettags",
|
|
1026
|
+
"tableName": "asset_tags",
|
|
1027
|
+
"packageName": "@happyvertical/smrt-assets",
|
|
1028
|
+
"extends": "SmrtJunction",
|
|
1029
|
+
"fields": [],
|
|
1030
|
+
"relationships": [],
|
|
1031
|
+
"methods": [
|
|
1032
|
+
"attach",
|
|
1033
|
+
"byLeft",
|
|
1034
|
+
"byRight",
|
|
1035
|
+
"detach",
|
|
1036
|
+
"setLinks"
|
|
1037
|
+
],
|
|
1038
|
+
"methodSignatures": [
|
|
1039
|
+
{
|
|
1040
|
+
"name": "attach",
|
|
1041
|
+
"async": true,
|
|
1042
|
+
"params": [
|
|
1043
|
+
"leftId: string",
|
|
1044
|
+
"rightId: string",
|
|
1045
|
+
"opts?: JunctionAttachOptions"
|
|
1046
|
+
],
|
|
1047
|
+
"returns": "Promise<TItem>"
|
|
1048
|
+
},
|
|
1049
|
+
{
|
|
1050
|
+
"name": "byLeft",
|
|
1051
|
+
"async": true,
|
|
1052
|
+
"params": [
|
|
1053
|
+
"leftId: string",
|
|
1054
|
+
"opts?: JunctionFilterOptions"
|
|
1055
|
+
],
|
|
1056
|
+
"returns": "Promise<TItem[]>"
|
|
1057
|
+
},
|
|
1058
|
+
{
|
|
1059
|
+
"name": "byRight",
|
|
1060
|
+
"async": true,
|
|
1061
|
+
"params": [
|
|
1062
|
+
"rightId: string",
|
|
1063
|
+
"opts?: JunctionFilterOptions"
|
|
1064
|
+
],
|
|
1065
|
+
"returns": "Promise<TItem[]>"
|
|
1066
|
+
},
|
|
1067
|
+
{
|
|
1068
|
+
"name": "detach",
|
|
1069
|
+
"async": true,
|
|
1070
|
+
"params": [
|
|
1071
|
+
"leftId: string",
|
|
1072
|
+
"rightId: string",
|
|
1073
|
+
"opts?: JunctionFilterOptions"
|
|
1074
|
+
],
|
|
1075
|
+
"returns": "Promise<void>"
|
|
1076
|
+
},
|
|
1077
|
+
{
|
|
1078
|
+
"name": "setLinks",
|
|
1079
|
+
"async": true,
|
|
1080
|
+
"params": [
|
|
1081
|
+
"leftId: string",
|
|
1082
|
+
"rightIds: string[]",
|
|
1083
|
+
"opts?: JunctionAttachOptions"
|
|
1084
|
+
],
|
|
1085
|
+
"returns": "Promise<void>"
|
|
1086
|
+
}
|
|
1087
|
+
],
|
|
1088
|
+
"surfaces": [],
|
|
1089
|
+
"withheldSurfaces": [
|
|
1090
|
+
{
|
|
1091
|
+
"kind": "api",
|
|
1092
|
+
"operation": "attach",
|
|
1093
|
+
"code": "api-disabled",
|
|
1094
|
+
"reason": "api is disabled",
|
|
1095
|
+
"objectName": "@happyvertical/smrt-assets:AssetTagCollection"
|
|
1096
|
+
},
|
|
1097
|
+
{
|
|
1098
|
+
"kind": "api",
|
|
1099
|
+
"operation": "byLeft",
|
|
1100
|
+
"code": "api-disabled",
|
|
1101
|
+
"reason": "api is disabled",
|
|
1102
|
+
"objectName": "@happyvertical/smrt-assets:AssetTagCollection"
|
|
1103
|
+
},
|
|
1104
|
+
{
|
|
1105
|
+
"kind": "api",
|
|
1106
|
+
"operation": "byRight",
|
|
1107
|
+
"code": "api-disabled",
|
|
1108
|
+
"reason": "api is disabled",
|
|
1109
|
+
"objectName": "@happyvertical/smrt-assets:AssetTagCollection"
|
|
1110
|
+
},
|
|
1111
|
+
{
|
|
1112
|
+
"kind": "api",
|
|
1113
|
+
"operation": "detach",
|
|
1114
|
+
"code": "api-disabled",
|
|
1115
|
+
"reason": "api is disabled",
|
|
1116
|
+
"objectName": "@happyvertical/smrt-assets:AssetTagCollection"
|
|
1117
|
+
},
|
|
1118
|
+
{
|
|
1119
|
+
"kind": "api",
|
|
1120
|
+
"operation": "setLinks",
|
|
1121
|
+
"code": "api-disabled",
|
|
1122
|
+
"reason": "api is disabled",
|
|
1123
|
+
"objectName": "@happyvertical/smrt-assets:AssetTagCollection"
|
|
1124
|
+
}
|
|
1125
|
+
],
|
|
1126
|
+
"relationshipFeatures": [
|
|
1127
|
+
"SmrtJunction",
|
|
1128
|
+
"uuidColumns"
|
|
1129
|
+
],
|
|
1130
|
+
"tags": [],
|
|
1131
|
+
"risks": []
|
|
1132
|
+
},
|
|
958
1133
|
{
|
|
959
1134
|
"name": "AssetType",
|
|
960
1135
|
"qualifiedName": "@happyvertical/smrt-assets:AssetType",
|
|
@@ -1365,6 +1540,7 @@
|
|
|
1365
1540
|
"getExternalRef",
|
|
1366
1541
|
"getExternalRefs",
|
|
1367
1542
|
"getMetadata",
|
|
1543
|
+
"getSlug",
|
|
1368
1544
|
"getSource",
|
|
1369
1545
|
"getStatus",
|
|
1370
1546
|
"getTags",
|
|
@@ -1419,6 +1595,11 @@
|
|
|
1419
1595
|
"name": "getMetadata",
|
|
1420
1596
|
"returns": "Record<string, unknown>"
|
|
1421
1597
|
},
|
|
1598
|
+
{
|
|
1599
|
+
"name": "getSlug",
|
|
1600
|
+
"async": true,
|
|
1601
|
+
"returns": "Promise<string | null | undefined>"
|
|
1602
|
+
},
|
|
1422
1603
|
{
|
|
1423
1604
|
"name": "getSource",
|
|
1424
1605
|
"async": true,
|
|
@@ -1443,7 +1624,8 @@
|
|
|
1443
1624
|
"name": "hasTag",
|
|
1444
1625
|
"async": true,
|
|
1445
1626
|
"params": [
|
|
1446
|
-
"tagSlug: string"
|
|
1627
|
+
"tagSlug: string",
|
|
1628
|
+
"context?: string"
|
|
1447
1629
|
],
|
|
1448
1630
|
"returns": "Promise<boolean>"
|
|
1449
1631
|
},
|
|
@@ -1718,6 +1900,13 @@
|
|
|
1718
1900
|
"reason": "not listed in api.include",
|
|
1719
1901
|
"objectName": "@happyvertical/smrt-assets:Asset"
|
|
1720
1902
|
},
|
|
1903
|
+
{
|
|
1904
|
+
"kind": "api",
|
|
1905
|
+
"operation": "getSlug",
|
|
1906
|
+
"code": "lifecycle-method",
|
|
1907
|
+
"reason": "`getSlug` is a framework lifecycle method, not a distinct operation",
|
|
1908
|
+
"objectName": "@happyvertical/smrt-assets:Asset"
|
|
1909
|
+
},
|
|
1721
1910
|
{
|
|
1722
1911
|
"kind": "api",
|
|
1723
1912
|
"operation": "getSource",
|
|
@@ -1806,9 +1995,11 @@
|
|
|
1806
1995
|
"getByType",
|
|
1807
1996
|
"getDerivatives",
|
|
1808
1997
|
"getLatestVersion",
|
|
1998
|
+
"getTagsForAssets",
|
|
1809
1999
|
"listVersions",
|
|
1810
2000
|
"removeTag",
|
|
1811
|
-
"rollbackToVersion"
|
|
2001
|
+
"rollbackToVersion",
|
|
2002
|
+
"setTags"
|
|
1812
2003
|
],
|
|
1813
2004
|
"methodSignatures": [
|
|
1814
2005
|
{
|
|
@@ -1816,9 +2007,10 @@
|
|
|
1816
2007
|
"async": true,
|
|
1817
2008
|
"params": [
|
|
1818
2009
|
"assetId: string",
|
|
1819
|
-
"
|
|
2010
|
+
"tag: string",
|
|
2011
|
+
"options?: AssetTagInput"
|
|
1820
2012
|
],
|
|
1821
|
-
"returns": "Promise<
|
|
2013
|
+
"returns": "Promise<Tag>"
|
|
1822
2014
|
},
|
|
1823
2015
|
{
|
|
1824
2016
|
"name": "createNewVersion",
|
|
@@ -1887,7 +2079,8 @@
|
|
|
1887
2079
|
"name": "getByTag",
|
|
1888
2080
|
"async": true,
|
|
1889
2081
|
"params": [
|
|
1890
|
-
"
|
|
2082
|
+
"tag: string",
|
|
2083
|
+
"options?: Pick<AssetTagInput, 'context'>"
|
|
1891
2084
|
],
|
|
1892
2085
|
"returns": "Promise<Asset[]>"
|
|
1893
2086
|
},
|
|
@@ -1915,6 +2108,14 @@
|
|
|
1915
2108
|
],
|
|
1916
2109
|
"returns": "Promise<Asset | null>"
|
|
1917
2110
|
},
|
|
2111
|
+
{
|
|
2112
|
+
"name": "getTagsForAssets",
|
|
2113
|
+
"async": true,
|
|
2114
|
+
"params": [
|
|
2115
|
+
"assetIds: string[]"
|
|
2116
|
+
],
|
|
2117
|
+
"returns": "Promise<Map<string, Tag[]>>"
|
|
2118
|
+
},
|
|
1918
2119
|
{
|
|
1919
2120
|
"name": "listVersions",
|
|
1920
2121
|
"async": true,
|
|
@@ -1928,7 +2129,8 @@
|
|
|
1928
2129
|
"async": true,
|
|
1929
2130
|
"params": [
|
|
1930
2131
|
"assetId: string",
|
|
1931
|
-
"
|
|
2132
|
+
"tag: string",
|
|
2133
|
+
"options?: Pick<AssetTagInput, 'context'>"
|
|
1932
2134
|
],
|
|
1933
2135
|
"returns": "Promise<void>"
|
|
1934
2136
|
},
|
|
@@ -1940,6 +2142,16 @@
|
|
|
1940
2142
|
"targetVersion: number"
|
|
1941
2143
|
],
|
|
1942
2144
|
"returns": "Promise<Asset>"
|
|
2145
|
+
},
|
|
2146
|
+
{
|
|
2147
|
+
"name": "setTags",
|
|
2148
|
+
"async": true,
|
|
2149
|
+
"params": [
|
|
2150
|
+
"assetId: string",
|
|
2151
|
+
"tags: string[]",
|
|
2152
|
+
"options?: Pick<AssetTagInput, 'context'>"
|
|
2153
|
+
],
|
|
2154
|
+
"returns": "Promise<Tag[]>"
|
|
1943
2155
|
}
|
|
1944
2156
|
],
|
|
1945
2157
|
"surfaces": [
|
|
@@ -1983,6 +2195,22 @@
|
|
|
1983
2195
|
"path": "/assets/removeTag",
|
|
1984
2196
|
"method": "POST"
|
|
1985
2197
|
},
|
|
2198
|
+
{
|
|
2199
|
+
"kind": "api",
|
|
2200
|
+
"name": "assets.setTags",
|
|
2201
|
+
"operation": "setTags",
|
|
2202
|
+
"objectName": "@happyvertical/smrt-assets:AssetCollection",
|
|
2203
|
+
"path": "/assets/setTags",
|
|
2204
|
+
"method": "POST"
|
|
2205
|
+
},
|
|
2206
|
+
{
|
|
2207
|
+
"kind": "api",
|
|
2208
|
+
"name": "assets.getTagsForAssets",
|
|
2209
|
+
"operation": "getTagsForAssets",
|
|
2210
|
+
"objectName": "@happyvertical/smrt-assets:AssetCollection",
|
|
2211
|
+
"path": "/assets/getTagsForAssets",
|
|
2212
|
+
"method": "POST"
|
|
2213
|
+
},
|
|
1986
2214
|
{
|
|
1987
2215
|
"kind": "api",
|
|
1988
2216
|
"name": "assets.getByTag",
|
|
@@ -2093,6 +2321,18 @@
|
|
|
2093
2321
|
"operation": "removeTag",
|
|
2094
2322
|
"objectName": "@happyvertical/smrt-assets:AssetCollection"
|
|
2095
2323
|
},
|
|
2324
|
+
{
|
|
2325
|
+
"kind": "cli",
|
|
2326
|
+
"name": "assetcollection_setTags",
|
|
2327
|
+
"operation": "setTags",
|
|
2328
|
+
"objectName": "@happyvertical/smrt-assets:AssetCollection"
|
|
2329
|
+
},
|
|
2330
|
+
{
|
|
2331
|
+
"kind": "cli",
|
|
2332
|
+
"name": "assetcollection_getTagsForAssets",
|
|
2333
|
+
"operation": "getTagsForAssets",
|
|
2334
|
+
"objectName": "@happyvertical/smrt-assets:AssetCollection"
|
|
2335
|
+
},
|
|
2096
2336
|
{
|
|
2097
2337
|
"kind": "cli",
|
|
2098
2338
|
"name": "assetcollection_getByTag",
|
|
@@ -2189,6 +2429,18 @@
|
|
|
2189
2429
|
"operation": "removeTag",
|
|
2190
2430
|
"objectName": "@happyvertical/smrt-assets:AssetCollection"
|
|
2191
2431
|
},
|
|
2432
|
+
{
|
|
2433
|
+
"kind": "mcp",
|
|
2434
|
+
"name": "assetcollection_settags",
|
|
2435
|
+
"operation": "setTags",
|
|
2436
|
+
"objectName": "@happyvertical/smrt-assets:AssetCollection"
|
|
2437
|
+
},
|
|
2438
|
+
{
|
|
2439
|
+
"kind": "mcp",
|
|
2440
|
+
"name": "assetcollection_gettagsforassets",
|
|
2441
|
+
"operation": "getTagsForAssets",
|
|
2442
|
+
"objectName": "@happyvertical/smrt-assets:AssetCollection"
|
|
2443
|
+
},
|
|
2192
2444
|
{
|
|
2193
2445
|
"kind": "mcp",
|
|
2194
2446
|
"name": "assetcollection_getbytag",
|
|
@@ -3566,6 +3818,22 @@
|
|
|
3566
3818
|
"path": "/assets/removeTag",
|
|
3567
3819
|
"method": "POST"
|
|
3568
3820
|
},
|
|
3821
|
+
{
|
|
3822
|
+
"kind": "api",
|
|
3823
|
+
"name": "assets.setTags",
|
|
3824
|
+
"operation": "setTags",
|
|
3825
|
+
"objectName": "@happyvertical/smrt-assets:AssetCollection",
|
|
3826
|
+
"path": "/assets/setTags",
|
|
3827
|
+
"method": "POST"
|
|
3828
|
+
},
|
|
3829
|
+
{
|
|
3830
|
+
"kind": "api",
|
|
3831
|
+
"name": "assets.getTagsForAssets",
|
|
3832
|
+
"operation": "getTagsForAssets",
|
|
3833
|
+
"objectName": "@happyvertical/smrt-assets:AssetCollection",
|
|
3834
|
+
"path": "/assets/getTagsForAssets",
|
|
3835
|
+
"method": "POST"
|
|
3836
|
+
},
|
|
3569
3837
|
{
|
|
3570
3838
|
"kind": "api",
|
|
3571
3839
|
"name": "assets.getByTag",
|
|
@@ -3676,6 +3944,18 @@
|
|
|
3676
3944
|
"operation": "removeTag",
|
|
3677
3945
|
"objectName": "@happyvertical/smrt-assets:AssetCollection"
|
|
3678
3946
|
},
|
|
3947
|
+
{
|
|
3948
|
+
"kind": "cli",
|
|
3949
|
+
"name": "assetcollection_setTags",
|
|
3950
|
+
"operation": "setTags",
|
|
3951
|
+
"objectName": "@happyvertical/smrt-assets:AssetCollection"
|
|
3952
|
+
},
|
|
3953
|
+
{
|
|
3954
|
+
"kind": "cli",
|
|
3955
|
+
"name": "assetcollection_getTagsForAssets",
|
|
3956
|
+
"operation": "getTagsForAssets",
|
|
3957
|
+
"objectName": "@happyvertical/smrt-assets:AssetCollection"
|
|
3958
|
+
},
|
|
3679
3959
|
{
|
|
3680
3960
|
"kind": "cli",
|
|
3681
3961
|
"name": "assetcollection_getByTag",
|
|
@@ -3772,6 +4052,18 @@
|
|
|
3772
4052
|
"operation": "removeTag",
|
|
3773
4053
|
"objectName": "@happyvertical/smrt-assets:AssetCollection"
|
|
3774
4054
|
},
|
|
4055
|
+
{
|
|
4056
|
+
"kind": "mcp",
|
|
4057
|
+
"name": "assetcollection_settags",
|
|
4058
|
+
"operation": "setTags",
|
|
4059
|
+
"objectName": "@happyvertical/smrt-assets:AssetCollection"
|
|
4060
|
+
},
|
|
4061
|
+
{
|
|
4062
|
+
"kind": "mcp",
|
|
4063
|
+
"name": "assetcollection_gettagsforassets",
|
|
4064
|
+
"operation": "getTagsForAssets",
|
|
4065
|
+
"objectName": "@happyvertical/smrt-assets:AssetCollection"
|
|
4066
|
+
},
|
|
3775
4067
|
{
|
|
3776
4068
|
"kind": "mcp",
|
|
3777
4069
|
"name": "assetcollection_getbytag",
|
|
@@ -4041,12 +4333,12 @@
|
|
|
4041
4333
|
],
|
|
4042
4334
|
"prompts": [],
|
|
4043
4335
|
"relationshipsV2": {
|
|
4044
|
-
"foreignKeyFields":
|
|
4045
|
-
"crossPackageRefFields":
|
|
4046
|
-
"junctionCollections":
|
|
4336
|
+
"foreignKeyFields": 6,
|
|
4337
|
+
"crossPackageRefFields": 3,
|
|
4338
|
+
"junctionCollections": 2,
|
|
4047
4339
|
"hierarchicalObjects": 1,
|
|
4048
4340
|
"polymorphicAssociations": 1,
|
|
4049
|
-
"uuidColumns":
|
|
4341
|
+
"uuidColumns": 40
|
|
4050
4342
|
},
|
|
4051
4343
|
"agentDoc": "# @happyvertical/smrt-assets\n\nProvider-agnostic asset management with versioning, type classification, and generic/provenance associations.\n\n## Models\n\n- **Asset** (STI base): versioning via `primaryVersionId` chain + `version` number. `ownerProfileId`, `typeSlug`, `statusSlug`, `mimeType`, `sourceUri`. Derivation chain via `sourceAssetId` (R3-D — was `parentId` before the rename; column `source_asset_id`).\n- **AssetType** / **AssetStatus**: lookup tables for classification and lifecycle.\n- **AssetMetafield**: custom metadata field definitions with JSON validation rules.\n- **Folder**: hierarchical container for assets. Own `SmrtHierarchical` model with its own `folders` table (R3-D — was an STI subclass of Asset before). `Asset.folderId` points to the folder.\n- **AssetAssociation**: generic/provenance polymorphic join — `assetId` + `metaType` + `metaId` + `role` + `sortOrder`. Use it when a relationship is not owned by a base/domain model join table like `content_assets`, `profile_assets`, `event_assets`, `place_assets`, or `product_assets`.\n\n## Key Patterns\n\n- **Versioning**: `createNewVersion()` increments version, chains via `primaryVersionId`. `findVersions()` to retrieve history.\n- **Tag integration**: `addTag()`/`removeTag()` use raw `db.upsert()` on `asset_tags` join table (not a SMRT model).\n- **AssetStore**: abstraction for provider-agnostic file I/O (S3, local, etc.).\n- **Ownership rule**: base/domain-owned asset relationships should live on noun join tables such as `content_assets`, `profile_assets`, `event_assets`, `place_assets`, and `product_assets`; keep `AssetAssociation` for generic/provenance links like image derivation.\n\n## Runtime surface\n\nApps and agents should depend on the public **asset runtime** rather than hand-wiring a collection + store per-package (#1128).\n\n- `createAssetRuntime({ db, storage })` → `AssetRuntime` bundling `AssetCollection`, `AssetAssociationCollection`, and an initialized `AssetStore`.\n- `AssetRuntime.storeSourceAsset(name, data, opts)` — create a new source asset (record + bytes).\n- `AssetRuntime.storeDerivedAsset(source, name, data, opts)` — create a derivative with `sourceAssetId` set and (by default) a provenance `AssetAssociation` under a chosen role.\n- `AssetRuntime.linkDerivation(source, derivative, { role })` — record provenance without touching bytes.\n- `AssetRuntime.setExtractionStatus(asset, status, { error?, extractedAt? })` — write canonical extraction metadata into the asset's description JSON sidecar. Non-destructive: if `description` is free-form prose or non-object JSON, the original value is preserved under the reserved `text` key instead of being overwritten. Existing JSON objects are merged into.\n\nAgents that need asset I/O should accept an `AssetRuntimeLike` in their options rather than asking callers to pass a store + collection separately.\n\n## Serving contract\n\n- `serveAsset({ runtime, asset, tenantId?, disposition?, canAccess?, headers?, remoteMode? })` → standard Web `Response`.\n - `404` when the id doesn't resolve; `403` when the tenant mismatches or `canAccess` denies; `302` when `remoteMode: 'redirect'` and the asset's `sourceUri` is `http(s)`; `502` when `remoteMode: 'proxy'` and the origin fetch fails; `500` on store read errors or unexpected failures; `200` otherwise with `Content-Type`, `Content-Length`, and `Content-Disposition` set.\n - Assets whose `sourceUri` is `http(s)` are supported via `remoteMode`: `'proxy'` (default, fetch and return bytes), `'redirect'` (302 to the origin), or `'error'` (treat as misconfiguration). Pass `fetchImpl` to swap the fetch client.\n - `Content-Disposition` uses an ASCII-safe quoted `filename` fallback and retains the Unicode download name in UTF-8 `filename*` ([RFC 6266](https://www.rfc-editor.org/rfc/rfc6266#section-4.3), [RFC 8187](https://www.rfc-editor.org/rfc/rfc8187#section-3.2.1)). Both names strip C0/DEL/C1 controls and replace `\"` / `\\` / `/` to prevent header injection; isolated UTF-16 surrogates become U+FFFD before encoding, while valid pairs are preserved.\n - The 500 body is a generic `'Internal error serving asset'`; the underlying error is logged via `console.error` so operators can debug without leaking paths/bucket names to clients.\n - Works in SvelteKit `+server.ts` endpoints, Hono, and any runtime with a global `Response` (Node 18+). Pass `responseCtor` for older runtimes.\n- `resolveAssetForServing(options)` → `{ asset, data, contentType, filename, size }` when callers want to render their own framework response. Throws `AssetServeError(status)` on the same failure modes.\n\n## Source/derived vocabulary\n\nThe following roles are exported as `ASSET_ROLES` and should be preferred over ad-hoc strings when apps want cross-package tooling (serving, UI pickers) to agree on meaning:\n\n| Role | Use |\n|------|-----|\n| `source_document` | original upstream document (agenda PDF, minutes) |\n| `document_image` | page/extracted image derived from a source document |\n| `thumbnail` | preview rendition of another asset |\n| `proof` | non-canonical evidence asset backing a fact |\n| `derivation_source` | \"came from\" link on generated media |\n| `attachment` | generic owner-join link |\n| `hero` | primary/featured asset on an owner |\n\nCanonical metadata keys are exported as `ASSET_METADATA_KEYS`: `extractionStatus`, `extractionError`, `extractedAt`, `sourceUrl`, `sourceHash`, `pageNumber`. Extraction status values live in `ASSET_EXTRACTION_STATUS` (`pending | running | succeeded | failed`).\n\n## UI Registry\n\nThe `./ui` subpath exports `ASSETS_MODULE_META` and `ASSETS_UI_SLOTS` so registry-driven hosts (smrt-chat, dynamic admin shells) can discover the package's Svelte components without a hard import.\n\n```ts\nimport { ASSETS_MODULE_META, ASSETS_UI_SLOTS } from '@happyvertical/smrt-assets/ui';\nimport '@happyvertical/smrt-assets/svelte'; // side-effect: ModuleUIRegistry.register(...)\nimport { ModuleUIRegistry } from '@happyvertical/smrt-ui/registry';\n\nconst AssetManager = ModuleUIRegistry.get('@happyvertical/smrt-assets', 'asset-manager');\n```\n\nRegistered slots: `asset-manager` (admin), `asset-grid` / `asset-list` (list), `asset-detail` (detail), `asset-toolbar` / `asset-action-bar` (action), `asset-create-modal` (form). Slot IDs are stable contracts — host apps reference them by string.\n\n## Gotchas\n\n- **Files SDK is a lazy boundary (#1979)**: `AssetStore` loads `@happyvertical/files` through `src/files-runtime.ts` (bundler-invisible), because smrt-assets is reachable from provider-neutral consumer graphs via profiles. Node/tsx/vite-dev runtimes resolve it on first file operation; fully-bundled deployments import `@happyvertical/smrt-assets/filesystem` at startup. Never import the files SDK statically from modules reachable from `src/index.ts`.\n- **Version history manual**: `findVersions()` chaining required — no ORM shortcut\n- **Tag management uses raw SQL**: `asset_tags` is a join table, not an SMRT model\n- **Folder tree traversal**: via `SmrtHierarchical` (`getParent`/`getChildren`/`getAncestors`/`getDescendants`/`getHierarchy`/`moveTo`); `FolderCollection.getTree(rootId?)` and `getPath(folderId)` wrap these for convenience\n- **AssetAssociation polymorphic FK**: requires manual `metaType` string matching\n- **Optional tenancy**: assets can be global (tenantId=null) or tenant-scoped\n"
|
|
4052
4344
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/smrt-assets",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.52.0",
|
|
4
4
|
"smrtJsdoc": "strict",
|
|
5
5
|
"description": "Asset management system with versioning, metadata, and AI-powered operations for SMRT framework",
|
|
6
6
|
"type": "module",
|
|
@@ -43,19 +43,19 @@
|
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@happyvertical/ai": "^0.96.
|
|
47
|
-
"@happyvertical/files": "^0.96.
|
|
48
|
-
"@happyvertical/logger": "^0.96.
|
|
49
|
-
"@happyvertical/smrt-core": "0.
|
|
50
|
-
"@happyvertical/smrt-tags": "0.
|
|
51
|
-
"@happyvertical/smrt-tenancy": "0.
|
|
52
|
-
"@happyvertical/smrt-types": "0.
|
|
53
|
-
"@happyvertical/smrt-ui": "0.
|
|
54
|
-
"@happyvertical/sql": "^0.96.
|
|
55
|
-
"@happyvertical/utils": "^0.96.
|
|
46
|
+
"@happyvertical/ai": "^0.96.1",
|
|
47
|
+
"@happyvertical/files": "^0.96.1",
|
|
48
|
+
"@happyvertical/logger": "^0.96.1",
|
|
49
|
+
"@happyvertical/smrt-core": "0.52.0",
|
|
50
|
+
"@happyvertical/smrt-tags": "0.52.0",
|
|
51
|
+
"@happyvertical/smrt-tenancy": "0.52.0",
|
|
52
|
+
"@happyvertical/smrt-types": "0.52.0",
|
|
53
|
+
"@happyvertical/smrt-ui": "0.52.0",
|
|
54
|
+
"@happyvertical/sql": "^0.96.1",
|
|
55
|
+
"@happyvertical/utils": "^0.96.1"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"svelte": "^5.57.
|
|
58
|
+
"svelte": "^5.57.0"
|
|
59
59
|
},
|
|
60
60
|
"peerDependenciesMeta": {
|
|
61
61
|
"svelte": {
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@happyvertical/smrt-playground": "0.
|
|
67
|
-
"@happyvertical/smrt-vitest": "0.
|
|
66
|
+
"@happyvertical/smrt-playground": "0.52.0",
|
|
67
|
+
"@happyvertical/smrt-vitest": "0.52.0",
|
|
68
68
|
"@sveltejs/adapter-auto": "^7.0.1",
|
|
69
69
|
"@sveltejs/kit": "2.69.1",
|
|
70
70
|
"@sveltejs/package": "^2.5.8",
|