@fgv/ts-res 5.0.0-2 → 5.0.0-21

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 (557) hide show
  1. package/.vscode/4.json +3 -0
  2. package/.vscode/launch.json +16 -0
  3. package/.vscode/settings.json +3 -0
  4. package/config/api-extractor.json +343 -0
  5. package/config/rig.json +16 -0
  6. package/dist/ts-res.d.ts +1528 -161
  7. package/dist/tsdoc-metadata.json +1 -1
  8. package/lib/index.d.ts +11 -2
  9. package/lib/index.js +25 -2
  10. package/lib/packlets/bundle/bundleBuilder.d.ts +41 -0
  11. package/lib/packlets/bundle/bundleBuilder.js +134 -0
  12. package/lib/packlets/bundle/bundleLoader.d.ts +72 -0
  13. package/lib/packlets/bundle/bundleLoader.js +105 -0
  14. package/lib/packlets/bundle/bundleNormalizer.d.ts +73 -0
  15. package/lib/packlets/bundle/bundleNormalizer.js +142 -0
  16. package/lib/packlets/bundle/bundleUtils.d.ts +70 -0
  17. package/lib/packlets/bundle/bundleUtils.js +117 -0
  18. package/lib/packlets/bundle/convert.d.ts +33 -0
  19. package/lib/packlets/bundle/convert.js +78 -0
  20. package/lib/packlets/bundle/index.d.ts +21 -0
  21. package/lib/packlets/bundle/index.js +83 -0
  22. package/lib/packlets/bundle/model.d.ts +100 -0
  23. package/lib/packlets/bundle/model.js +24 -0
  24. package/lib/packlets/common/helpers/resources.d.ts +7 -0
  25. package/lib/packlets/common/helpers/resources.js +12 -0
  26. package/lib/packlets/common/resources.d.ts +8 -0
  27. package/lib/packlets/conditions/conditionSet.d.ts +9 -0
  28. package/lib/packlets/conditions/conditionSet.js +74 -1
  29. package/lib/packlets/config/configInitFactory.d.ts +78 -0
  30. package/lib/packlets/config/configInitFactory.js +147 -0
  31. package/lib/packlets/config/convert.d.ts +9 -0
  32. package/lib/packlets/config/convert.js +11 -0
  33. package/lib/packlets/config/index.d.ts +1 -0
  34. package/lib/packlets/config/index.js +1 -0
  35. package/lib/packlets/config/systemConfiguration.d.ts +16 -3
  36. package/lib/packlets/config/systemConfiguration.js +19 -40
  37. package/lib/packlets/import/fsItem.js +8 -13
  38. package/lib/packlets/import/importers/jsonImporter.js +1 -0
  39. package/lib/packlets/qualifier-types/config/json.d.ts +13 -0
  40. package/lib/packlets/qualifier-types/config/json.js +11 -0
  41. package/lib/packlets/qualifier-types/literalValueHierarchy.js +1 -1
  42. package/lib/packlets/qualifiers/qualifierCollector.js +1 -2
  43. package/lib/packlets/resource-types/jsonResourceType.d.ts +9 -4
  44. package/lib/packlets/resource-types/jsonResourceType.js +8 -1
  45. package/lib/packlets/resource-types/resourceType.d.ts +102 -13
  46. package/lib/packlets/resource-types/resourceType.js +34 -2
  47. package/lib/packlets/resources/common.d.ts +26 -0
  48. package/lib/packlets/resources/resource.d.ts +6 -6
  49. package/lib/packlets/resources/resource.js +3 -8
  50. package/lib/packlets/resources/resourceCandidate.d.ts +5 -1
  51. package/lib/packlets/resources/resourceCandidate.js +6 -0
  52. package/lib/packlets/resources/resourceManagerBuilder.d.ts +182 -11
  53. package/lib/packlets/resources/resourceManagerBuilder.js +469 -15
  54. package/lib/packlets/runtime/cacheListener.d.ts +9 -0
  55. package/lib/packlets/runtime/cacheListener.js +6 -0
  56. package/lib/packlets/runtime/cacheMetrics.d.ts +6 -0
  57. package/lib/packlets/runtime/cacheMetrics.js +11 -0
  58. package/lib/packlets/runtime/compiledResourceCollection.d.ts +3 -3
  59. package/lib/packlets/runtime/compiledResourceCollection.js +7 -0
  60. package/lib/packlets/runtime/iResourceManager.d.ts +13 -5
  61. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts +7 -7
  62. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js +5 -5
  63. package/lib/packlets/runtime/resourceResolver.d.ts +21 -0
  64. package/lib/packlets/runtime/resourceResolver.js +39 -17
  65. package/lib/packlets/runtime/validate.js +1 -0
  66. package/lib/packlets/zip-archive/convert.d.ts +52 -0
  67. package/lib/packlets/zip-archive/convert.js +104 -0
  68. package/lib/packlets/zip-archive/index.d.ts +23 -0
  69. package/lib/packlets/zip-archive/index.js +95 -0
  70. package/lib/packlets/zip-archive/json.d.ts +64 -0
  71. package/lib/packlets/zip-archive/json.js +24 -0
  72. package/lib/packlets/zip-archive/types.d.ts +98 -0
  73. package/lib/packlets/zip-archive/types.js +39 -0
  74. package/lib/packlets/zip-archive/zipArchiveCreator.d.ts +35 -0
  75. package/lib/packlets/zip-archive/zipArchiveCreator.js +194 -0
  76. package/lib/packlets/zip-archive/zipArchiveFormat.d.ts +70 -0
  77. package/lib/packlets/zip-archive/zipArchiveFormat.js +184 -0
  78. package/lib/packlets/zip-archive/zipArchiveLoader.d.ts +70 -0
  79. package/lib/packlets/zip-archive/zipArchiveLoader.js +285 -0
  80. package/lib/test/data/sample.json +32 -0
  81. package/lib/test/unit/bundle/bundleBuilder.test.d.ts +2 -0
  82. package/lib/test/unit/bundle/bundleLoader.test.d.ts +2 -0
  83. package/lib/test/unit/bundle/bundleUtils.test.d.ts +2 -0
  84. package/lib/test/unit/bundle/convert.test.d.ts +2 -0
  85. package/lib/test/unit/bundle/integration.test.d.ts +2 -0
  86. package/lib/test/unit/bundle/model.test.d.ts +2 -0
  87. package/lib/test/unit/bundle/normalization.test.d.ts +2 -0
  88. package/lib/test/unit/common/conditions.test.d.ts +2 -0
  89. package/lib/test/unit/common/helpers/conditions.test.d.ts +2 -0
  90. package/lib/test/unit/common/helpers/contexts.test.d.ts +2 -0
  91. package/lib/test/unit/common/helpers/qualifierDefaultValues.test.d.ts +2 -0
  92. package/lib/test/unit/common/resources.test.d.ts +2 -0
  93. package/lib/test/unit/conditions/condition.test.d.ts +2 -0
  94. package/lib/test/unit/conditions/conditionCollector.test.d.ts +2 -0
  95. package/lib/test/unit/conditions/conditionScoreAsDefault.test.d.ts +2 -0
  96. package/lib/test/unit/conditions/conditionSet.test.d.ts +2 -0
  97. package/lib/test/unit/conditions/conditionSetCollector.test.d.ts +2 -0
  98. package/lib/test/unit/conditions/conditionToken.test.d.ts +2 -0
  99. package/lib/test/unit/conditions/convert.test.d.ts +2 -0
  100. package/lib/test/unit/config/common.test.d.ts +2 -0
  101. package/lib/test/unit/config/convert.test.d.ts +2 -0
  102. package/lib/test/unit/config/predefined/default.test.d.ts +2 -0
  103. package/lib/test/unit/config/predefined/extended.test.d.ts +2 -0
  104. package/lib/test/unit/config/systemConfiguration.test.d.ts +2 -0
  105. package/lib/test/unit/config/systemConfigurationInitParams.test.d.ts +2 -0
  106. package/lib/test/unit/context/contextToken.test.d.ts +2 -0
  107. package/lib/test/unit/context/convert.test.d.ts +2 -0
  108. package/lib/test/unit/decisions/abstractDecision.test.d.ts +2 -0
  109. package/lib/test/unit/decisions/abstractDecisionCollector.test.d.ts +2 -0
  110. package/lib/test/unit/decisions/candidate.test.d.ts +2 -0
  111. package/lib/test/unit/decisions/concreteDecision.test.d.ts +2 -0
  112. package/lib/test/unit/decisions/decision.test.d.ts +2 -0
  113. package/lib/test/unit/import/collectionImporter.test.d.ts +2 -0
  114. package/lib/test/unit/import/fsItem.test.d.ts +2 -0
  115. package/lib/test/unit/import/fsItemImporter.test.d.ts +2 -0
  116. package/lib/test/unit/import/importContext.test.d.ts +2 -0
  117. package/lib/test/unit/import/importManager.test.d.ts +2 -0
  118. package/lib/test/unit/import/jsonImporter.test.d.ts +2 -0
  119. package/lib/test/unit/import/pathImporter.test.d.ts +2 -0
  120. package/lib/test/unit/qualifier-types/convert.test.d.ts +2 -0
  121. package/lib/test/unit/qualifier-types/helpers.test.d.ts +2 -0
  122. package/lib/test/unit/qualifier-types/languageQualifierType.test.d.ts +2 -0
  123. package/lib/test/unit/qualifier-types/literalQualifierType.test.d.ts +2 -0
  124. package/lib/test/unit/qualifier-types/literalValueHierarchy.test.d.ts +2 -0
  125. package/lib/test/unit/qualifier-types/qualifierType.test.d.ts +2 -0
  126. package/lib/test/unit/qualifier-types/qualifierTypeCollector.test.d.ts +2 -0
  127. package/lib/test/unit/qualifier-types/territoryQualifierType.test.d.ts +2 -0
  128. package/lib/test/unit/qualifier-types/testQualifierType.d.ts +15 -0
  129. package/lib/test/unit/qualifier-types/testQualifierType.js +89 -0
  130. package/lib/test/unit/qualifiers/convert.test.d.ts +2 -0
  131. package/lib/test/unit/qualifiers/qualifierCollector.test.d.ts +2 -0
  132. package/lib/test/unit/qualifiers/qualifierDefaultValue.test.d.ts +2 -0
  133. package/lib/test/unit/qualifiers/qualifierDefaultValueToken.test.d.ts +2 -0
  134. package/lib/test/unit/resource-json/convert.test.d.ts +2 -0
  135. package/lib/test/unit/resource-json/nameInheritance.test.d.ts +2 -0
  136. package/lib/test/unit/resource-json/resourceDeclCollection.test.d.ts +2 -0
  137. package/lib/test/unit/resource-json/resourceDeclTree.test.d.ts +2 -0
  138. package/lib/test/unit/resource-types/jsonResourceType.test.d.ts +2 -0
  139. package/lib/test/unit/resource-types/resourceTypeCollector.test.d.ts +2 -0
  140. package/lib/test/unit/resources/candidateReducer.integration.test.d.ts +2 -0
  141. package/lib/test/unit/resources/candidateReducer.test.d.ts +2 -0
  142. package/lib/test/unit/resources/reduceCandidates.test.d.ts +2 -0
  143. package/lib/test/unit/resources/reduceQualifiers.comprehensive.test.d.ts +2 -0
  144. package/lib/test/unit/resources/reduceQualifiers.test.d.ts +2 -0
  145. package/lib/test/unit/resources/resource.test.d.ts +2 -0
  146. package/lib/test/unit/resources/resourceBuilder.test.d.ts +2 -0
  147. package/lib/test/unit/resources/resourceCandidate.test.d.ts +2 -0
  148. package/lib/test/unit/resources/resourceManagerBuilder.clone.test.d.ts +2 -0
  149. package/lib/test/unit/resources/resourceManagerBuilder.getBuiltResourceTree.test.d.ts +2 -0
  150. package/lib/test/unit/resources/resourceManagerBuilder.test.d.ts +2 -0
  151. package/lib/test/unit/runtime/cacheListener.test.d.ts +2 -0
  152. package/lib/test/unit/runtime/cacheMetrics.test.d.ts +2 -0
  153. package/lib/test/unit/runtime/compiledResourceCollection.test.d.ts +2 -0
  154. package/lib/test/unit/runtime/conditionSetResolutionResult.comprehensive.test.d.ts +2 -0
  155. package/lib/test/unit/runtime/conditionSetResolutionResult.test.d.ts +2 -0
  156. package/lib/test/unit/runtime/context/contextQualifierProvider.test.d.ts +2 -0
  157. package/lib/test/unit/runtime/context/contextQualifierProviderValidator.test.d.ts +2 -0
  158. package/lib/test/unit/runtime/context/simpleContextQualifierProvider.test.d.ts +2 -0
  159. package/lib/test/unit/runtime/context/validatingSimpleContextQualifierProvider.test.d.ts +2 -0
  160. package/lib/test/unit/runtime/resource-tree/readOnlyResourceTree.test.d.ts +2 -0
  161. package/lib/test/unit/runtime/resource-tree/resourceTreeChildren.test.d.ts +2 -0
  162. package/lib/test/unit/runtime/resource-tree/resourceTreeChildrenValidator.test.d.ts +2 -0
  163. package/lib/test/unit/runtime/resourceResolver.defaultResolution.test.d.ts +2 -0
  164. package/lib/test/unit/runtime/resourceResolver.test.d.ts +2 -0
  165. package/lib/test/unit/runtime/validate.test.d.ts +2 -0
  166. package/lib/test/unit/zip-archive/convert.test.d.ts +2 -0
  167. package/lib/test/unit/zip-archive/json.test.d.ts +2 -0
  168. package/lib/test/unit/zip-archive/zipArchiveCreator.test.d.ts +2 -0
  169. package/lib/test/unit/zip-archive/zipArchiveFormat.test.d.ts +2 -0
  170. package/lib/test/unit/zip-archive/zipArchiveIdempotency.test.d.ts +2 -0
  171. package/lib/test/unit/zip-archive/zipArchiveLoader.test.d.ts +2 -0
  172. package/package.json +19 -25
  173. package/src/index.ts +75 -0
  174. package/src/packlets/bundle/bundleBuilder.ts +159 -0
  175. package/src/packlets/bundle/bundleLoader.ts +157 -0
  176. package/src/packlets/bundle/bundleNormalizer.ts +173 -0
  177. package/src/packlets/bundle/bundleUtils.ts +142 -0
  178. package/src/packlets/bundle/convert.ts +87 -0
  179. package/src/packlets/bundle/index.ts +52 -0
  180. package/src/packlets/bundle/model.ts +138 -0
  181. package/src/packlets/common/conditions.ts +226 -0
  182. package/src/packlets/common/convert.ts +184 -0
  183. package/src/packlets/common/helpers/conditions.ts +84 -0
  184. package/src/packlets/common/helpers/context.ts +88 -0
  185. package/src/packlets/common/helpers/index.ts +26 -0
  186. package/src/packlets/common/helpers/qualifierDefaultValues.ts +91 -0
  187. package/src/packlets/common/helpers/resources.ts +96 -0
  188. package/src/packlets/common/index.ts +30 -0
  189. package/src/packlets/common/resources.ts +78 -0
  190. package/src/packlets/common/validate/conditions.ts +595 -0
  191. package/src/packlets/common/validate/index.ts +27 -0
  192. package/src/packlets/common/validate/regularExpressions.ts +92 -0
  193. package/src/packlets/common/validate/resources.ts +170 -0
  194. package/src/packlets/conditions/condition.ts +351 -0
  195. package/src/packlets/conditions/conditionCollector.ts +103 -0
  196. package/src/packlets/conditions/conditionDecls.ts +50 -0
  197. package/src/packlets/conditions/conditionSet.ts +318 -0
  198. package/src/packlets/conditions/conditionSetCollector.ts +127 -0
  199. package/src/packlets/conditions/conditionSetDecls.ts +41 -0
  200. package/src/packlets/conditions/conditionToken.ts +180 -0
  201. package/src/packlets/conditions/convert/conditionSetDecls.ts +72 -0
  202. package/src/packlets/conditions/convert/decls.ts +95 -0
  203. package/src/packlets/conditions/convert/index.ts +24 -0
  204. package/src/packlets/conditions/index.ts +33 -0
  205. package/src/packlets/config/common.ts +107 -0
  206. package/src/packlets/config/configInitFactory.ts +142 -0
  207. package/src/packlets/config/convert.ts +61 -0
  208. package/src/packlets/config/index.ts +30 -0
  209. package/src/packlets/config/json.ts +43 -0
  210. package/src/packlets/config/predefined/default.ts +150 -0
  211. package/src/packlets/config/predefined/extended.ts +198 -0
  212. package/src/packlets/config/predefined/index.ts +26 -0
  213. package/src/packlets/config/systemConfiguration.ts +217 -0
  214. package/src/packlets/context/contextDecls.ts +76 -0
  215. package/src/packlets/context/contextToken.ts +252 -0
  216. package/src/packlets/context/convert/decls.ts +126 -0
  217. package/src/packlets/context/convert/index.ts +23 -0
  218. package/src/packlets/context/index.ts +27 -0
  219. package/src/packlets/decisions/abstractDecision.ts +87 -0
  220. package/src/packlets/decisions/abstractDecisionCollector.ts +122 -0
  221. package/src/packlets/decisions/candidate.ts +101 -0
  222. package/src/packlets/decisions/common.ts +37 -0
  223. package/src/packlets/decisions/concreteDecision.ts +157 -0
  224. package/src/packlets/decisions/decision.ts +172 -0
  225. package/src/packlets/decisions/index.ts +28 -0
  226. package/src/packlets/import/fsItem.ts +212 -0
  227. package/src/packlets/import/importContext.ts +183 -0
  228. package/src/packlets/import/importManager.ts +187 -0
  229. package/src/packlets/import/importable.ts +107 -0
  230. package/src/packlets/import/importers/collectionImporter.ts +153 -0
  231. package/src/packlets/import/importers/fsItemImporter.ts +154 -0
  232. package/src/packlets/import/importers/importer.ts +58 -0
  233. package/src/packlets/import/importers/index.ts +27 -0
  234. package/src/packlets/import/importers/jsonImporter.ts +133 -0
  235. package/src/packlets/import/importers/pathImporter.ts +134 -0
  236. package/src/packlets/import/index.ts +29 -0
  237. package/src/packlets/qualifier-types/config/convert.ts +108 -0
  238. package/src/packlets/qualifier-types/config/index.ts +27 -0
  239. package/src/packlets/qualifier-types/config/json.ts +126 -0
  240. package/src/packlets/qualifier-types/convert.ts +77 -0
  241. package/src/packlets/qualifier-types/helpers.ts +94 -0
  242. package/src/packlets/qualifier-types/index.ts +34 -0
  243. package/src/packlets/qualifier-types/languageQualifierType.ts +143 -0
  244. package/src/packlets/qualifier-types/literalQualifierType.ts +244 -0
  245. package/src/packlets/qualifier-types/literalValueHierarchy.ts +332 -0
  246. package/src/packlets/qualifier-types/qualifierType.ts +360 -0
  247. package/src/packlets/qualifier-types/qualifierTypeCollector.ts +102 -0
  248. package/src/packlets/qualifier-types/territoryQualifierType.ts +255 -0
  249. package/src/packlets/qualifiers/convert/decls.ts +90 -0
  250. package/src/packlets/qualifiers/convert/index.ts +24 -0
  251. package/src/packlets/qualifiers/convert/qualifier.ts +55 -0
  252. package/src/packlets/qualifiers/index.ts +31 -0
  253. package/src/packlets/qualifiers/qualifier.ts +169 -0
  254. package/src/packlets/qualifiers/qualifierCollector.ts +194 -0
  255. package/src/packlets/qualifiers/qualifierDecl.ts +80 -0
  256. package/src/packlets/qualifiers/qualifierDefaultValueDecls.ts +57 -0
  257. package/src/packlets/qualifiers/qualifierDefaultValueToken.ts +230 -0
  258. package/src/packlets/resource-json/compiled/common.ts +35 -0
  259. package/src/packlets/resource-json/compiled/convert.ts +143 -0
  260. package/src/packlets/resource-json/compiled/index.ts +27 -0
  261. package/src/packlets/resource-json/compiled/json.ts +239 -0
  262. package/src/packlets/resource-json/convert.ts +236 -0
  263. package/src/packlets/resource-json/helpers.ts +284 -0
  264. package/src/packlets/resource-json/index.ts +33 -0
  265. package/src/packlets/resource-json/json.ts +295 -0
  266. package/src/packlets/resource-json/normalized.ts +211 -0
  267. package/src/packlets/resource-json/resourceDeclCollection.ts +117 -0
  268. package/src/packlets/resource-json/resourceDeclContainer.ts +48 -0
  269. package/src/packlets/resource-json/resourceDeclTree.ts +116 -0
  270. package/src/packlets/resource-types/config/convert.ts +36 -0
  271. package/src/packlets/resource-types/config/index.ts +27 -0
  272. package/src/packlets/resource-types/config/json.ts +30 -0
  273. package/src/packlets/resource-types/helpers.ts +44 -0
  274. package/src/packlets/resource-types/index.ts +30 -0
  275. package/src/packlets/resource-types/jsonResourceType.ts +104 -0
  276. package/src/packlets/resource-types/resourceType.ts +259 -0
  277. package/src/packlets/resource-types/resourceTypeCollector.ts +79 -0
  278. package/src/packlets/resources/candidateReducer.ts +331 -0
  279. package/src/packlets/resources/common.ts +114 -0
  280. package/src/packlets/resources/index.ts +28 -0
  281. package/src/packlets/resources/resource.ts +307 -0
  282. package/src/packlets/resources/resourceBuilder.ts +269 -0
  283. package/src/packlets/resources/resourceCandidate.ts +333 -0
  284. package/src/packlets/resources/resourceManagerBuilder.ts +1169 -0
  285. package/src/packlets/runtime/cacheListener.ts +113 -0
  286. package/src/packlets/runtime/cacheMetrics.ts +206 -0
  287. package/src/packlets/runtime/compiledResourceCollection.ts +607 -0
  288. package/src/packlets/runtime/conditionSetResolutionResult.ts +160 -0
  289. package/src/packlets/runtime/context/contextQualifierProvider.ts +117 -0
  290. package/src/packlets/runtime/context/contextQualifierProviderValidator.ts +281 -0
  291. package/src/packlets/runtime/context/index.ts +26 -0
  292. package/src/packlets/runtime/context/simpleContextQualifierProvider.ts +225 -0
  293. package/src/packlets/runtime/context/validatingSimpleContextQualifierProvider.ts +96 -0
  294. package/src/packlets/runtime/iResourceManager.ts +130 -0
  295. package/src/packlets/runtime/index.ts +35 -0
  296. package/src/packlets/runtime/resource-tree/common.ts +126 -0
  297. package/src/packlets/runtime/resource-tree/index.ts +26 -0
  298. package/src/packlets/runtime/resource-tree/readOnlyResourceTree.ts +342 -0
  299. package/src/packlets/runtime/resource-tree/resourceTreeChildren.ts +125 -0
  300. package/src/packlets/runtime/resource-tree/resourceTreeChildrenValidator.ts +187 -0
  301. package/src/packlets/runtime/resourceResolver.ts +626 -0
  302. package/src/packlets/runtime/validate.ts +63 -0
  303. package/src/packlets/zip-archive/convert.ts +121 -0
  304. package/src/packlets/zip-archive/index.ts +76 -0
  305. package/src/packlets/zip-archive/json.ts +91 -0
  306. package/src/packlets/zip-archive/types.ts +140 -0
  307. package/src/packlets/zip-archive/zipArchiveCreator.ts +229 -0
  308. package/src/packlets/zip-archive/zipArchiveFormat.ts +158 -0
  309. package/src/packlets/zip-archive/zipArchiveLoader.ts +370 -0
  310. package/CHANGELOG.md +0 -14
  311. package/CLAUDE.md +0 -186
  312. package/EXAMPLE_INIT_PARAMS.md +0 -88
  313. package/PROGRESS_SUMMARY.md +0 -48
  314. package/lib/index.d.ts.map +0 -1
  315. package/lib/index.js.map +0 -1
  316. package/lib/packlets/common/conditions.d.ts.map +0 -1
  317. package/lib/packlets/common/conditions.js.map +0 -1
  318. package/lib/packlets/common/convert.d.ts.map +0 -1
  319. package/lib/packlets/common/convert.js.map +0 -1
  320. package/lib/packlets/common/helpers/conditions.d.ts.map +0 -1
  321. package/lib/packlets/common/helpers/conditions.js.map +0 -1
  322. package/lib/packlets/common/helpers/context.d.ts.map +0 -1
  323. package/lib/packlets/common/helpers/context.js.map +0 -1
  324. package/lib/packlets/common/helpers/index.d.ts.map +0 -1
  325. package/lib/packlets/common/helpers/index.js.map +0 -1
  326. package/lib/packlets/common/helpers/qualifierDefaultValues.d.ts.map +0 -1
  327. package/lib/packlets/common/helpers/qualifierDefaultValues.js.map +0 -1
  328. package/lib/packlets/common/helpers/resources.d.ts.map +0 -1
  329. package/lib/packlets/common/helpers/resources.js.map +0 -1
  330. package/lib/packlets/common/index.d.ts.map +0 -1
  331. package/lib/packlets/common/index.js.map +0 -1
  332. package/lib/packlets/common/resources.d.ts.map +0 -1
  333. package/lib/packlets/common/resources.js.map +0 -1
  334. package/lib/packlets/common/validate/conditions.d.ts.map +0 -1
  335. package/lib/packlets/common/validate/conditions.js.map +0 -1
  336. package/lib/packlets/common/validate/index.d.ts.map +0 -1
  337. package/lib/packlets/common/validate/index.js.map +0 -1
  338. package/lib/packlets/common/validate/regularExpressions.d.ts.map +0 -1
  339. package/lib/packlets/common/validate/regularExpressions.js.map +0 -1
  340. package/lib/packlets/common/validate/resources.d.ts.map +0 -1
  341. package/lib/packlets/common/validate/resources.js.map +0 -1
  342. package/lib/packlets/conditions/condition.d.ts.map +0 -1
  343. package/lib/packlets/conditions/condition.js.map +0 -1
  344. package/lib/packlets/conditions/conditionCollector.d.ts.map +0 -1
  345. package/lib/packlets/conditions/conditionCollector.js.map +0 -1
  346. package/lib/packlets/conditions/conditionDecls.d.ts.map +0 -1
  347. package/lib/packlets/conditions/conditionDecls.js.map +0 -1
  348. package/lib/packlets/conditions/conditionSet.d.ts.map +0 -1
  349. package/lib/packlets/conditions/conditionSet.js.map +0 -1
  350. package/lib/packlets/conditions/conditionSetCollector.d.ts.map +0 -1
  351. package/lib/packlets/conditions/conditionSetCollector.js.map +0 -1
  352. package/lib/packlets/conditions/conditionSetDecls.d.ts.map +0 -1
  353. package/lib/packlets/conditions/conditionSetDecls.js.map +0 -1
  354. package/lib/packlets/conditions/conditionToken.d.ts.map +0 -1
  355. package/lib/packlets/conditions/conditionToken.js.map +0 -1
  356. package/lib/packlets/conditions/convert/conditionSetDecls.d.ts.map +0 -1
  357. package/lib/packlets/conditions/convert/conditionSetDecls.js.map +0 -1
  358. package/lib/packlets/conditions/convert/decls.d.ts.map +0 -1
  359. package/lib/packlets/conditions/convert/decls.js.map +0 -1
  360. package/lib/packlets/conditions/convert/index.d.ts.map +0 -1
  361. package/lib/packlets/conditions/convert/index.js.map +0 -1
  362. package/lib/packlets/conditions/index.d.ts.map +0 -1
  363. package/lib/packlets/conditions/index.js.map +0 -1
  364. package/lib/packlets/config/common.d.ts.map +0 -1
  365. package/lib/packlets/config/common.js.map +0 -1
  366. package/lib/packlets/config/convert.d.ts.map +0 -1
  367. package/lib/packlets/config/convert.js.map +0 -1
  368. package/lib/packlets/config/index.d.ts.map +0 -1
  369. package/lib/packlets/config/index.js.map +0 -1
  370. package/lib/packlets/config/json.d.ts.map +0 -1
  371. package/lib/packlets/config/json.js.map +0 -1
  372. package/lib/packlets/config/predefined/default.d.ts.map +0 -1
  373. package/lib/packlets/config/predefined/default.js.map +0 -1
  374. package/lib/packlets/config/predefined/extended.d.ts.map +0 -1
  375. package/lib/packlets/config/predefined/extended.js.map +0 -1
  376. package/lib/packlets/config/predefined/index.d.ts.map +0 -1
  377. package/lib/packlets/config/predefined/index.js.map +0 -1
  378. package/lib/packlets/config/systemConfiguration.d.ts.map +0 -1
  379. package/lib/packlets/config/systemConfiguration.js.map +0 -1
  380. package/lib/packlets/context/contextDecls.d.ts.map +0 -1
  381. package/lib/packlets/context/contextDecls.js.map +0 -1
  382. package/lib/packlets/context/contextToken.d.ts.map +0 -1
  383. package/lib/packlets/context/contextToken.js.map +0 -1
  384. package/lib/packlets/context/convert/decls.d.ts.map +0 -1
  385. package/lib/packlets/context/convert/decls.js.map +0 -1
  386. package/lib/packlets/context/convert/index.d.ts.map +0 -1
  387. package/lib/packlets/context/convert/index.js.map +0 -1
  388. package/lib/packlets/context/index.d.ts.map +0 -1
  389. package/lib/packlets/context/index.js.map +0 -1
  390. package/lib/packlets/decisions/abstractDecision.d.ts.map +0 -1
  391. package/lib/packlets/decisions/abstractDecision.js.map +0 -1
  392. package/lib/packlets/decisions/abstractDecisionCollector.d.ts.map +0 -1
  393. package/lib/packlets/decisions/abstractDecisionCollector.js.map +0 -1
  394. package/lib/packlets/decisions/candidate.d.ts.map +0 -1
  395. package/lib/packlets/decisions/candidate.js.map +0 -1
  396. package/lib/packlets/decisions/common.d.ts.map +0 -1
  397. package/lib/packlets/decisions/common.js.map +0 -1
  398. package/lib/packlets/decisions/concreteDecision.d.ts.map +0 -1
  399. package/lib/packlets/decisions/concreteDecision.js.map +0 -1
  400. package/lib/packlets/decisions/decision.d.ts.map +0 -1
  401. package/lib/packlets/decisions/decision.js.map +0 -1
  402. package/lib/packlets/decisions/index.d.ts.map +0 -1
  403. package/lib/packlets/decisions/index.js.map +0 -1
  404. package/lib/packlets/import/fsItem.d.ts.map +0 -1
  405. package/lib/packlets/import/fsItem.js.map +0 -1
  406. package/lib/packlets/import/importContext.d.ts.map +0 -1
  407. package/lib/packlets/import/importContext.js.map +0 -1
  408. package/lib/packlets/import/importManager.d.ts.map +0 -1
  409. package/lib/packlets/import/importManager.js.map +0 -1
  410. package/lib/packlets/import/importable.d.ts.map +0 -1
  411. package/lib/packlets/import/importable.js.map +0 -1
  412. package/lib/packlets/import/importers/collectionImporter.d.ts.map +0 -1
  413. package/lib/packlets/import/importers/collectionImporter.js.map +0 -1
  414. package/lib/packlets/import/importers/fsItemImporter.d.ts.map +0 -1
  415. package/lib/packlets/import/importers/fsItemImporter.js.map +0 -1
  416. package/lib/packlets/import/importers/importer.d.ts.map +0 -1
  417. package/lib/packlets/import/importers/importer.js.map +0 -1
  418. package/lib/packlets/import/importers/index.d.ts.map +0 -1
  419. package/lib/packlets/import/importers/index.js.map +0 -1
  420. package/lib/packlets/import/importers/jsonImporter.d.ts.map +0 -1
  421. package/lib/packlets/import/importers/jsonImporter.js.map +0 -1
  422. package/lib/packlets/import/importers/pathImporter.d.ts.map +0 -1
  423. package/lib/packlets/import/importers/pathImporter.js.map +0 -1
  424. package/lib/packlets/import/index.d.ts.map +0 -1
  425. package/lib/packlets/import/index.js.map +0 -1
  426. package/lib/packlets/qualifier-types/config/convert.d.ts.map +0 -1
  427. package/lib/packlets/qualifier-types/config/convert.js.map +0 -1
  428. package/lib/packlets/qualifier-types/config/index.d.ts.map +0 -1
  429. package/lib/packlets/qualifier-types/config/index.js.map +0 -1
  430. package/lib/packlets/qualifier-types/config/json.d.ts.map +0 -1
  431. package/lib/packlets/qualifier-types/config/json.js.map +0 -1
  432. package/lib/packlets/qualifier-types/convert.d.ts.map +0 -1
  433. package/lib/packlets/qualifier-types/convert.js.map +0 -1
  434. package/lib/packlets/qualifier-types/helpers.d.ts.map +0 -1
  435. package/lib/packlets/qualifier-types/helpers.js.map +0 -1
  436. package/lib/packlets/qualifier-types/index.d.ts.map +0 -1
  437. package/lib/packlets/qualifier-types/index.js.map +0 -1
  438. package/lib/packlets/qualifier-types/languageQualifierType.d.ts.map +0 -1
  439. package/lib/packlets/qualifier-types/languageQualifierType.js.map +0 -1
  440. package/lib/packlets/qualifier-types/literalQualifierType.d.ts.map +0 -1
  441. package/lib/packlets/qualifier-types/literalQualifierType.js.map +0 -1
  442. package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts.map +0 -1
  443. package/lib/packlets/qualifier-types/literalValueHierarchy.js.map +0 -1
  444. package/lib/packlets/qualifier-types/qualifierType.d.ts.map +0 -1
  445. package/lib/packlets/qualifier-types/qualifierType.js.map +0 -1
  446. package/lib/packlets/qualifier-types/qualifierTypeCollector.d.ts.map +0 -1
  447. package/lib/packlets/qualifier-types/qualifierTypeCollector.js.map +0 -1
  448. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts.map +0 -1
  449. package/lib/packlets/qualifier-types/territoryQualifierType.js.map +0 -1
  450. package/lib/packlets/qualifiers/convert/decls.d.ts.map +0 -1
  451. package/lib/packlets/qualifiers/convert/decls.js.map +0 -1
  452. package/lib/packlets/qualifiers/convert/index.d.ts.map +0 -1
  453. package/lib/packlets/qualifiers/convert/index.js.map +0 -1
  454. package/lib/packlets/qualifiers/convert/qualifier.d.ts.map +0 -1
  455. package/lib/packlets/qualifiers/convert/qualifier.js.map +0 -1
  456. package/lib/packlets/qualifiers/index.d.ts.map +0 -1
  457. package/lib/packlets/qualifiers/index.js.map +0 -1
  458. package/lib/packlets/qualifiers/qualifier.d.ts.map +0 -1
  459. package/lib/packlets/qualifiers/qualifier.js.map +0 -1
  460. package/lib/packlets/qualifiers/qualifierCollector.d.ts.map +0 -1
  461. package/lib/packlets/qualifiers/qualifierCollector.js.map +0 -1
  462. package/lib/packlets/qualifiers/qualifierDecl.d.ts.map +0 -1
  463. package/lib/packlets/qualifiers/qualifierDecl.js.map +0 -1
  464. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.d.ts.map +0 -1
  465. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.js.map +0 -1
  466. package/lib/packlets/qualifiers/qualifierDefaultValueToken.d.ts.map +0 -1
  467. package/lib/packlets/qualifiers/qualifierDefaultValueToken.js.map +0 -1
  468. package/lib/packlets/resource-json/compiled/common.d.ts.map +0 -1
  469. package/lib/packlets/resource-json/compiled/common.js.map +0 -1
  470. package/lib/packlets/resource-json/compiled/convert.d.ts.map +0 -1
  471. package/lib/packlets/resource-json/compiled/convert.js.map +0 -1
  472. package/lib/packlets/resource-json/compiled/index.d.ts.map +0 -1
  473. package/lib/packlets/resource-json/compiled/index.js.map +0 -1
  474. package/lib/packlets/resource-json/compiled/json.d.ts.map +0 -1
  475. package/lib/packlets/resource-json/compiled/json.js.map +0 -1
  476. package/lib/packlets/resource-json/convert.d.ts.map +0 -1
  477. package/lib/packlets/resource-json/convert.js.map +0 -1
  478. package/lib/packlets/resource-json/helpers.d.ts.map +0 -1
  479. package/lib/packlets/resource-json/helpers.js.map +0 -1
  480. package/lib/packlets/resource-json/index.d.ts.map +0 -1
  481. package/lib/packlets/resource-json/index.js.map +0 -1
  482. package/lib/packlets/resource-json/json.d.ts.map +0 -1
  483. package/lib/packlets/resource-json/json.js.map +0 -1
  484. package/lib/packlets/resource-json/normalized.d.ts.map +0 -1
  485. package/lib/packlets/resource-json/normalized.js.map +0 -1
  486. package/lib/packlets/resource-json/resourceDeclCollection.d.ts.map +0 -1
  487. package/lib/packlets/resource-json/resourceDeclCollection.js.map +0 -1
  488. package/lib/packlets/resource-json/resourceDeclContainer.d.ts.map +0 -1
  489. package/lib/packlets/resource-json/resourceDeclContainer.js.map +0 -1
  490. package/lib/packlets/resource-json/resourceDeclTree.d.ts.map +0 -1
  491. package/lib/packlets/resource-json/resourceDeclTree.js.map +0 -1
  492. package/lib/packlets/resource-types/config/convert.d.ts.map +0 -1
  493. package/lib/packlets/resource-types/config/convert.js.map +0 -1
  494. package/lib/packlets/resource-types/config/index.d.ts.map +0 -1
  495. package/lib/packlets/resource-types/config/index.js.map +0 -1
  496. package/lib/packlets/resource-types/config/json.d.ts.map +0 -1
  497. package/lib/packlets/resource-types/config/json.js.map +0 -1
  498. package/lib/packlets/resource-types/helpers.d.ts.map +0 -1
  499. package/lib/packlets/resource-types/helpers.js.map +0 -1
  500. package/lib/packlets/resource-types/index.d.ts.map +0 -1
  501. package/lib/packlets/resource-types/index.js.map +0 -1
  502. package/lib/packlets/resource-types/jsonResourceType.d.ts.map +0 -1
  503. package/lib/packlets/resource-types/jsonResourceType.js.map +0 -1
  504. package/lib/packlets/resource-types/resourceType.d.ts.map +0 -1
  505. package/lib/packlets/resource-types/resourceType.js.map +0 -1
  506. package/lib/packlets/resource-types/resourceTypeCollector.d.ts.map +0 -1
  507. package/lib/packlets/resource-types/resourceTypeCollector.js.map +0 -1
  508. package/lib/packlets/resources/candidateReducer.d.ts.map +0 -1
  509. package/lib/packlets/resources/candidateReducer.js.map +0 -1
  510. package/lib/packlets/resources/common.d.ts.map +0 -1
  511. package/lib/packlets/resources/common.js.map +0 -1
  512. package/lib/packlets/resources/index.d.ts.map +0 -1
  513. package/lib/packlets/resources/index.js.map +0 -1
  514. package/lib/packlets/resources/resource.d.ts.map +0 -1
  515. package/lib/packlets/resources/resource.js.map +0 -1
  516. package/lib/packlets/resources/resourceBuilder.d.ts.map +0 -1
  517. package/lib/packlets/resources/resourceBuilder.js.map +0 -1
  518. package/lib/packlets/resources/resourceCandidate.d.ts.map +0 -1
  519. package/lib/packlets/resources/resourceCandidate.js.map +0 -1
  520. package/lib/packlets/resources/resourceManagerBuilder.d.ts.map +0 -1
  521. package/lib/packlets/resources/resourceManagerBuilder.js.map +0 -1
  522. package/lib/packlets/runtime/cacheListener.d.ts.map +0 -1
  523. package/lib/packlets/runtime/cacheListener.js.map +0 -1
  524. package/lib/packlets/runtime/cacheMetrics.d.ts.map +0 -1
  525. package/lib/packlets/runtime/cacheMetrics.js.map +0 -1
  526. package/lib/packlets/runtime/compiledResourceCollection.d.ts.map +0 -1
  527. package/lib/packlets/runtime/compiledResourceCollection.js.map +0 -1
  528. package/lib/packlets/runtime/conditionSetResolutionResult.d.ts.map +0 -1
  529. package/lib/packlets/runtime/conditionSetResolutionResult.js.map +0 -1
  530. package/lib/packlets/runtime/context/contextQualifierProvider.d.ts.map +0 -1
  531. package/lib/packlets/runtime/context/contextQualifierProvider.js.map +0 -1
  532. package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts.map +0 -1
  533. package/lib/packlets/runtime/context/contextQualifierProviderValidator.js.map +0 -1
  534. package/lib/packlets/runtime/context/index.d.ts.map +0 -1
  535. package/lib/packlets/runtime/context/index.js.map +0 -1
  536. package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts.map +0 -1
  537. package/lib/packlets/runtime/context/simpleContextQualifierProvider.js.map +0 -1
  538. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts.map +0 -1
  539. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +0 -1
  540. package/lib/packlets/runtime/iResourceManager.d.ts.map +0 -1
  541. package/lib/packlets/runtime/iResourceManager.js.map +0 -1
  542. package/lib/packlets/runtime/index.d.ts.map +0 -1
  543. package/lib/packlets/runtime/index.js.map +0 -1
  544. package/lib/packlets/runtime/resource-tree/common.d.ts.map +0 -1
  545. package/lib/packlets/runtime/resource-tree/common.js.map +0 -1
  546. package/lib/packlets/runtime/resource-tree/index.d.ts.map +0 -1
  547. package/lib/packlets/runtime/resource-tree/index.js.map +0 -1
  548. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.d.ts.map +0 -1
  549. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +0 -1
  550. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.d.ts.map +0 -1
  551. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.js.map +0 -1
  552. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts.map +0 -1
  553. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +0 -1
  554. package/lib/packlets/runtime/resourceResolver.d.ts.map +0 -1
  555. package/lib/packlets/runtime/resourceResolver.js.map +0 -1
  556. package/lib/packlets/runtime/validate.d.ts.map +0 -1
  557. package/lib/packlets/runtime/validate.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"resourceManagerBuilder.js","sourceRoot":"","sources":["../../../src/packlets/resources/resourceManagerBuilder.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4CAauB;AACvB,8CAKuB;AACvB,4CAA4F;AAG5F,sCAA0D;AAE1D,uDAAiF;AACjF,yCAAsC;AAGtC,+DAAiD;AACjD,oDAAsC;AAmBtC;;;;;;GAMG;AACH,MAAa,sBAAsB;IAYjC;;;;OAIG;IACH,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED;;;;OAIG;IACH,IA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AAC,CAAC;IACL,CAAC;IAED;;;;;;;OAOG;IACH,wFAAwF;IACjF,KAAK,CAAC,OAAqC;QAChD,OAAO,IAAI,CAAC,yBAAyB,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,EAAE;YACtE,OAAO,sBAAsB,CAAC,MAAM,CAAC;gBACnC,UAAU,EAAE,IAAI,CAAC,UAAU;gBAC3B,aAAa,EAAE,IAAI,CAAC,aAAa;aAClC,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,EAAE;gBAC1B,oEAAoE;gBACpE,IAAI,UAAU,CAAC,SAAS,EAAE,CAAC;oBACzB,KAAK,MAAM,YAAY,IAAI,UAAU,CAAC,SAAS,EAAE,CAAC;wBAChD,MAAM,SAAS,GAAG,UAAU,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;wBACvD,IAAI,SAAS,CAAC,SAAS,EAAE,EAAE,CAAC;4BAC1B,OAAO,IAAA,eAAI,EACT,GAAG,YAAY,CAAC,EAAE,+CAA+C,SAAS,CAAC,OAAO,EAAE,CACrF,CAAC;wBACJ,CAAC;oBACH,CAAC;gBACH,CAAC;gBACD,OAAO,IAAA,kBAAO,EAAC,UAAU,CAAC,CAAC;YAC7B,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAvdD,wDAudC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport {\n captureResult,\n Collections,\n DetailedResult,\n fail,\n failWithDetail,\n Hash,\n mapResults,\n MessageAggregator,\n Result,\n succeed,\n succeedWithDetail,\n ValidatingResultMap\n} from '@fgv/ts-utils';\nimport {\n ConditionCollector,\n ConditionSetCollector,\n ReadOnlyConditionCollector,\n ReadOnlyConditionSetCollector\n} from '../conditions';\nimport { AbstractDecisionCollector, ReadOnlyAbstractDecisionCollector } from '../decisions';\nimport { IReadOnlyQualifierCollector } from '../qualifiers';\nimport { ReadOnlyResourceTypeCollector } from '../resource-types';\nimport { Convert, ResourceId, Validate } from '../common';\nimport { IResourceManager } from '../runtime';\nimport { ResourceBuilder, ResourceBuilderResultDetail } from './resourceBuilder';\nimport { Resource } from './resource';\nimport { ResourceCandidate } from './resourceCandidate';\nimport { IResourceDeclarationOptions } from './common';\nimport * as ResourceJson from '../resource-json';\nimport * as Context from '../context';\n\n/**\n * Interface for parameters to the {@link Resources.ResourceManagerBuilder.create | ResourceManagerBuilder create method}.\n * @public\n */\nexport interface IResourceManagerBuilderCreateParams {\n qualifiers: IReadOnlyQualifierCollector;\n resourceTypes: ReadOnlyResourceTypeCollector;\n}\n\n/**\n * Error details that can be returned by a {@link Resources.ResourceManagerBuilder | ResourceManagerBuilder}.\n * @public\n */\nexport type ResourceManagerBuilderResultDetail =\n | Collections.ResultMapResultDetail\n | ResourceBuilderResultDetail;\n\n/**\n * Builder for a collection of {@link Resources.Resource | resources}. Collects\n * {@link Resources.ResourceCandidate | candidates} for each resource into a\n * {@link Resources.ResourceBuilder | ResourceBuilder} per resource, validates them against each other,\n * and builds a collection of {@link Resources.Resource | resources} once all candidates are collected.\n * @public\n */\nexport class ResourceManagerBuilder implements IResourceManager {\n public readonly qualifiers: IReadOnlyQualifierCollector;\n public readonly resourceTypes: ReadOnlyResourceTypeCollector;\n\n protected readonly _conditions: ConditionCollector;\n protected readonly _conditionSets: ConditionSetCollector;\n protected readonly _decisions: AbstractDecisionCollector;\n protected readonly _resources: ValidatingResultMap<ResourceId, ResourceBuilder>;\n public readonly _builtResources: ValidatingResultMap<ResourceId, Resource>;\n\n protected _built: boolean;\n\n /**\n * A {@link Conditions.ConditionCollector | ConditionCollector} which\n * contains the {@link Conditions.Condition | conditions} used so far by\n * the {@link Resources.ResourceCandidate | resource candidates} in this manager.\n */\n public get conditions(): ReadOnlyConditionCollector {\n return this._conditions;\n }\n\n /**\n * A {@link Conditions.ConditionSetCollector | ConditionSetCollector} which\n * contains the {@link Conditions.ConditionSet | condition sets} used so far by\n * the {@link Resources.ResourceCandidate | resource candidates} in this manager.\n */\n public get conditionSets(): ReadOnlyConditionSetCollector {\n return this._conditionSets;\n }\n\n /**\n * A {@link Decisions.AbstractDecisionCollector | AbstractDecisionCollector} which\n * contains the {@link Decisions.Decision | abstract decisions} used so far by\n * the {@link Resources.ResourceCandidate | resource candidates} in this manager.\n */\n public get decisions(): ReadOnlyAbstractDecisionCollector {\n return this._decisions;\n }\n\n /**\n * A read-only map of {@link Resources.ResourceBuilder | resource builders} used by the manager.\n */\n public get resources(): Collections.IReadOnlyValidatingResultMap<ResourceId, ResourceBuilder> {\n return this._resources;\n }\n\n /**\n * The number of {@link Resources.Resource | resources} contained by the manager.\n */\n public get size(): number {\n return this._resources.size;\n }\n\n /**\n * {@inheritdoc Runtime.IResourceManager.numResources}\n */\n public get numResources(): number {\n return this._resources.size;\n }\n\n /**\n * The number of candidates in this resource manager.\n */\n protected _numCandidates?: number;\n\n /**\n * {@inheritdoc Runtime.IResourceManager.numCandidates}\n */\n public get numCandidates(): number {\n if (this._numCandidates === undefined) {\n this._numCandidates = this.getAllCandidates().length;\n }\n return this._numCandidates;\n }\n\n /**\n * {@inheritdoc Runtime.IResourceManager.builtResources}\n */\n public get builtResources(): Collections.IReadOnlyValidatingResultMap<ResourceId, Resource> {\n return this._performBuild().orThrow();\n }\n\n /**\n * Constructor for a {@link Resources.ResourceManagerBuilder | ResourceManagerBuilder} object.\n * @param params - Parameters to create a new {@link Resources.ResourceManagerBuilder | ResourceManagerBuilder}.\n * @public\n */\n protected constructor(params: IResourceManagerBuilderCreateParams) {\n this.qualifiers = params.qualifiers;\n this.resourceTypes = params.resourceTypes;\n this._conditions = ConditionCollector.create({ qualifiers: params.qualifiers }).orThrow();\n this._conditionSets = ConditionSetCollector.create({ conditions: this._conditions }).orThrow();\n this._decisions = AbstractDecisionCollector.create({ conditionSets: this._conditionSets }).orThrow();\n this._resources = new ValidatingResultMap({\n converters: new Collections.KeyValueConverters<ResourceId, ResourceBuilder>({\n key: Convert.resourceId,\n /* c8 ignore next 2 - defense in depth against internal error */\n value: (from: unknown) =>\n from instanceof ResourceBuilder ? succeed(from) : fail('not a resource builder')\n })\n });\n this._builtResources = new ValidatingResultMap({\n converters: new Collections.KeyValueConverters<ResourceId, Resource>({\n key: Convert.resourceId,\n /* c8 ignore next 1 - defense in depth against internal error */\n value: (from: unknown) => (from instanceof Resource ? succeed(from) : fail('not a resource'))\n })\n });\n this._built = false;\n }\n\n /**\n * Creates a new {@link Resources.ResourceManagerBuilder | ResourceManagerBuilder} object.\n * @param params - Parameters to create a new {@link Resources.ResourceManagerBuilder | ResourceManagerBuilder}.\n * @returns `Success` with the new {@link Resources.ResourceManagerBuilder | ResourceManagerBuilder} object if successful,\n * or `Failure` with an error message if not.\n * @public\n */\n public static create(params: IResourceManagerBuilderCreateParams): Result<ResourceManagerBuilder> {\n return captureResult(() => new ResourceManagerBuilder(params));\n }\n\n /**\n * Given a {@link ResourceJson.Json.ILooseResourceCandidateDecl | resource candidate declaration}, builds and adds\n * a {@link Resources.ResourceCandidate | candidate} to the manager.\n * @param candidate - The {@link Resources.ResourceCandidate | candidate} to add.\n * @returns `Success` with the candidate if successful, or `Failure` with an error message if not.\n * @public\n */\n public addLooseCandidate(\n decl: ResourceJson.Json.ILooseResourceCandidateDecl\n ): DetailedResult<ResourceCandidate, ResourceBuilderResultDetail> {\n const { value: id, message } = Validate.toResourceId(decl.id);\n if (message !== undefined) {\n return failWithDetail(`${id}: invalid id - ${message}`, 'failure');\n }\n\n const builderResult = this._resources.getOrAdd(id, () =>\n ResourceBuilder.create({\n id,\n resourceTypes: this.resourceTypes,\n conditionSets: this._conditionSets,\n decisions: this._decisions\n })\n );\n /* c8 ignore next 6 - defense in depth against internal error */\n if (builderResult.isFailure()) {\n return failWithDetail(\n `${id}: unable to get or add resource\\n${builderResult.message}`,\n builderResult.detail\n );\n }\n return builderResult.value.addLooseCandidate(decl).onSuccess((c, d) => {\n this._builtResources.delete(id);\n this._built = false;\n this._numCandidates = undefined;\n return succeedWithDetail(c, d);\n });\n }\n\n public addResource(\n decl: ResourceJson.Json.ILooseResourceDecl\n ): DetailedResult<ResourceBuilder, ResourceBuilderResultDetail> {\n const { value: id, message } = Validate.toResourceId(decl.id);\n if (message !== undefined) {\n return failWithDetail(`${id}: invalid id - ${message}`, 'failure');\n }\n\n const {\n value: builder,\n message: getOrAddMessage,\n detail\n } = this._resources.getOrAdd(id, () =>\n ResourceBuilder.create({\n id,\n typeName: decl.resourceTypeName,\n resourceTypes: this.resourceTypes,\n conditionSets: this._conditionSets,\n decisions: this._decisions\n })\n );\n /* c8 ignore next 3 - defense in depth against internal error */\n if (getOrAddMessage !== undefined) {\n return failWithDetail(`${id}: unable to get or add resource\\n${getOrAddMessage}`, detail);\n }\n\n if (detail === 'exists') {\n const { message } = builder.setResourceType(decl.resourceTypeName);\n if (message !== undefined) {\n return failWithDetail(`${id}: unable to set resource type\\n${message}`, 'type-mismatch');\n }\n }\n\n const candidates = decl.candidates ?? [];\n return mapResults(candidates.map((c) => builder.addChildCandidate(c)))\n .onSuccess(() => {\n return succeed(builder);\n })\n .withDetail('failure', detail);\n }\n\n /**\n * Gets a read-only array of all {@link Resources.ResourceBuilder | resource builders} present in the manager.\n * @returns `Success` with the {@link Resources.ResourceBuilder | resource builder} if successful,\n * or `Failure` with an error message if not.\n */\n public getAllResources(): ReadonlyArray<ResourceBuilder> {\n return Array.from(this._resources.values()).sort((a, b) => a.id.localeCompare(b.id));\n }\n\n /**\n * Gets a read-only array of all {@link Resources.ResourceCandidate | resource candidates} present in the manager.\n */\n public getAllCandidates(): ReadonlyArray<ResourceCandidate> {\n return this.getAllResources().flatMap((r) => r.candidates);\n }\n\n /**\n * Gets an individual {@link Resources.Resource | built resource} from the manager.\n * @param id - The {@link ResourceId | id} of the resource to get.\n * @returns `Success` with the resource if successful, or `Failure` with an error message if not.\n * @public\n */\n public getBuiltResource(id: string): Result<Resource> {\n return this._resources.validating\n .get(id)\n .onSuccess((builder) => this._builtResources.validating.getOrAdd(id, () => builder.build()));\n }\n\n /**\n * Validates a context declaration against the qualifiers managed by this resource manager.\n * @param context - The context declaration to validate\n * @returns Success with the validated context if successful, Failure otherwise\n * @public\n */\n /* c8 ignore next 5 - functional code path tested but coverage intermittently missed */\n public validateContext(context: Context.IContextDecl): Result<Context.IValidatedContextDecl> {\n return Context.Convert.validatedContextDecl.convert(context, {\n qualifiers: this.qualifiers\n });\n }\n\n /**\n * Gets a read-only array of all {@link Resources.Resource | built resources} in the manager.\n * @returns `Success` with an array of resources if successful, or `Failure` with an error message if not.\n * @public\n */\n public getAllBuiltResources(): Result<ReadonlyArray<Resource>> {\n return this.build().onSuccess((manager) =>\n succeed(Array.from(manager._builtResources.values()).sort((a, b) => a.id.localeCompare(b.id)))\n );\n }\n\n /**\n * Gets a read-only array of all {@link Resources.Resource | built resources} in the manager.\n * @returns `Success` with an array of resources if successful, or `Failure` with an error message if not.\n * @public\n */\n public getAllBuiltCandidates(): Result<ReadonlyArray<ResourceCandidate>> {\n return this.getAllBuiltResources().onSuccess((built) => succeed(built.flatMap((r) => r.candidates)));\n }\n\n /**\n * Internal helper method that performs the actual building of resources.\n * @returns `Success` with the built resources if all resources were built successfully, `Failure` otherwise.\n * @internal\n */\n public _performBuild(): Result<Collections.IReadOnlyValidatingResultMap<ResourceId, Resource>> {\n if (this._built) {\n return succeed(this._builtResources);\n }\n\n const errors: MessageAggregator = new MessageAggregator();\n this._resources.forEach((r, id) => {\n this._builtResources.getOrAdd(id, () => r.build()).aggregateError(errors);\n });\n /* c8 ignore next 3 - defense in depth against internal error */\n if (errors.hasMessages) {\n return fail(`build failed: ${errors.toString()}`);\n }\n this._built = true;\n return succeed(this._builtResources);\n }\n\n /**\n * Builds the {@link Resources.Resource | resources} from the collected {@link Resources.ResourceCandidate | candidates}.\n * @returns `Success` with the {@link Resources.ResourceManagerBuilder | ResourceManagerBuilder} object if successful,\n * or `Failure` with an error message if not.\n * @public\n */\n public build(): Result<this> {\n return this._performBuild().onSuccess(() => succeed(this));\n }\n\n /**\n * Gets a read-only array of all {@link Resources.ResourceCandidate | resource candidates} that can match the supplied context.\n * @param context - The {@link Context.IValidatedContextDecl | context} to match against.\n * @param options - {@link Context.IContextMatchOptions | options} for the context match.\n * @returns A read-only array of {@link Resources.ResourceCandidate | candidates} that can match the context.\n * @public\n */\n public getCandidatesForContext(\n context: Context.IValidatedContextDecl,\n options?: Context.IContextMatchOptions\n ): ReadonlyArray<ResourceCandidate> {\n return this.getAllCandidates().filter((candidate) => candidate.canMatchPartialContext(context, options));\n }\n\n /**\n * Gets a read-only array of all {@link Resources.ResourceBuilder | resource builders} that have at least one candidate\n * that can match the supplied context.\n * @param context - The {@link Context.IValidatedContextDecl | context} to match against.\n * @param options - {@link Context.IContextMatchOptions | options} for the context match.\n * @returns A read-only array of {@link Resources.ResourceBuilder | resource builders} with matching candidates.\n * @public\n */\n public getResourcesForContext(\n context: Context.IValidatedContextDecl,\n options?: Context.IContextMatchOptions\n ): ReadonlyArray<ResourceBuilder> {\n return this.getAllResources().filter(\n (resource) => resource.getCandidatesForContext(context, options).length > 0\n );\n }\n\n /**\n * Gets a read-only array of all {@link Resources.ResourceCandidate | built resource candidates} that can match the supplied context.\n * @param context - The {@link Context.IValidatedContextDecl | context} to match against.\n * @param options - {@link Context.IContextMatchOptions | options} for the context match.\n * @returns `Success` with an array of {@link Resources.ResourceCandidate | candidates} if successful, or `Failure` with an error message if not.\n * @public\n */\n public getBuiltCandidatesForContext(\n context: Context.IValidatedContextDecl,\n options?: Context.IContextMatchOptions\n ): Result<ReadonlyArray<ResourceCandidate>> {\n return this.getAllBuiltCandidates().onSuccess((candidates) =>\n succeed(candidates.filter((candidate) => candidate.canMatchPartialContext(context, options)))\n );\n }\n\n /**\n * Gets a read-only array of all {@link Resources.Resource | built resources} that have at least one candidate\n * that can match the supplied context.\n * @param context - The {@link Context.IValidatedContextDecl | context} to match against.\n * @param options - {@link Context.IContextMatchOptions | options} for the context match.\n * @returns `Success` with an array of {@link Resources.Resource | resources} if successful, or `Failure` with an error message if not.\n * @public\n */\n public getBuiltResourcesForContext(\n context: Context.IValidatedContextDecl,\n options?: Context.IContextMatchOptions\n ): Result<ReadonlyArray<Resource>> {\n return this.getAllBuiltResources().onSuccess((resources) =>\n succeed(resources.filter((resource) => resource.getCandidatesForContext(context, options).length > 0))\n );\n }\n\n /**\n * Gets a compiled resource collection from the current state of the resource manager builder.\n * This method generates an optimized, index-based representation of all resources, conditions,\n * and decisions that can be used for serialization or efficient runtime processing.\n * @param options - Optional compilation options controlling the output format.\n * @returns Success with the compiled resource collection if successful, Failure otherwise.\n * @public\n */\n public getCompiledResourceCollection(\n options?: ResourceJson.Compiled.ICompiledResourceOptions\n ): Result<ResourceJson.Compiled.ICompiledResourceCollection> {\n // Build resources first to ensure all data is available\n const buildResult = this._performBuild();\n if (buildResult.isFailure()) {\n return fail(`Failed to build resources: ${buildResult.message}`);\n }\n\n // Generate compiled data from internal collections using the new toCompiled methods\n // Note: All objects have a defined index property due to the collector pattern - indices are assigned during collection building\n const compiledData = {\n qualifierTypes: Array.from(this.qualifiers.qualifierTypes.values()).map((qt) => ({\n name: qt.name\n })),\n qualifiers: Array.from(this.qualifiers.values()).map((q) => ({\n name: q.name,\n type: q.type.index!,\n defaultPriority: q.defaultPriority\n })),\n resourceTypes: Array.from(this.resourceTypes.values()).map((rt) => ({\n name: rt.key\n })),\n conditions: Array.from(this._conditions.values()).map((c) => c.toCompiled(options)),\n conditionSets: Array.from(this._conditionSets.values()).map((cs) => cs.toCompiled(options)),\n decisions: Array.from(this._decisions.values()).map((d) => d.toCompiled(options)),\n resources: Array.from(this._builtResources.values()).map((r) => r.toCompiled(options))\n };\n\n // Apply validation through the converter\n return ResourceJson.Compiled.Convert.compiledResourceCollection.convert(compiledData);\n }\n\n /**\n * Gets a resource collection declaration containing all built resources in a flat array structure.\n * This method returns all built resources as an {@link ResourceJson.Normalized.IResourceCollectionDecl | IResourceCollectionDecl}\n * that can be used for serialization, export, or re-import. Resources are sorted by ID for consistent ordering.\n * @param options - Optional {@link Resources.IResourceDeclarationOptions | declaration options} controlling the output format.\n * If `options.normalized` is `true`, applies hash-based normalization for additional consistency guarantees.\n * @returns Success with the resource collection declaration if successful, Failure otherwise.\n * @public\n */\n public getResourceCollectionDecl(\n options?: IResourceDeclarationOptions\n ): Result<ResourceJson.Normalized.IResourceCollectionDecl> {\n return this._performBuild().onSuccess(() => {\n // Get all built resources and convert to loose resource declarations\n const resources = Array.from(this._builtResources.values()).map((resource) =>\n resource.toLooseResourceDecl(options)\n );\n\n // Sort resources by ID for consistent ordering\n resources.sort((a, b) => a.id.localeCompare(b.id));\n\n // Create the collection declaration structure\n const collectionData = {\n resources\n };\n\n // Convert and validate using the normalized converter\n return ResourceJson.Convert.resourceCollectionDecl\n .convert(collectionData)\n .onSuccess((compiledCollection) => {\n // Apply hash-based normalization only if requested\n if (options?.normalized === true) {\n const normalizer = new Hash.Crc32Normalizer();\n return normalizer\n .normalize(compiledCollection)\n .withErrorFormat((e) => `Failed to normalize resource collection: ${e}`);\n }\n return succeed(compiledCollection);\n });\n });\n }\n\n /**\n * Creates a filtered clone of this ResourceManagerBuilder using the specified context.\n * This is a convenience method that creates a new ResourceManagerBuilder with the same\n * configuration but filtered to include only candidates that match the provided context.\n * @param options - Options for the cloning operation, including the strongly-typed filterForContext property.\n * @returns A Result containing the new filtered ResourceManagerBuilder.\n * @public\n */\n /* c8 ignore next 21 - functional code path tested but coverage intermittently missed */\n public clone(options?: IResourceDeclarationOptions): Result<ResourceManagerBuilder> {\n return this.getResourceCollectionDecl(options).onSuccess((collection) => {\n return ResourceManagerBuilder.create({\n qualifiers: this.qualifiers,\n resourceTypes: this.resourceTypes\n }).onSuccess((newManager) => {\n // Add each resource from the filtered collection to the new manager\n if (collection.resources) {\n for (const resourceDecl of collection.resources) {\n const addResult = newManager.addResource(resourceDecl);\n if (addResult.isFailure()) {\n return fail(\n `${resourceDecl.id}: Failed to add resource to cloned manager: ${addResult.message}`\n );\n }\n }\n }\n return succeed(newManager);\n });\n });\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"cacheListener.d.ts","sourceRoot":"","sources":["../../../src/packlets/runtime/cacheListener.ts"],"names":[],"mappings":"AAsBA;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG,WAAW,GAAG,cAAc,GAAG,UAAU,CAAC;AAElF;;;GAGG;AACH,MAAM,MAAM,6BAA6B,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AAE/E;;;GAGG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;;;OAIG;IACH,UAAU,CAAC,KAAK,EAAE,yBAAyB,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAElE;;;;OAIG;IACH,WAAW,CAAC,KAAK,EAAE,yBAAyB,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAEnE;;;;OAIG;IACH,YAAY,CAAC,KAAK,EAAE,yBAAyB,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAEpE;;;OAGG;IACH,YAAY,CAAC,KAAK,EAAE,yBAAyB,GAAG,IAAI,CAAC;CACtD;AAED;;;GAGG;AACH,qBAAa,iCAAkC,YAAW,8BAA8B;IACtF;;OAEG;IACI,UAAU,CAAC,KAAK,EAAE,yBAAyB,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAIxE;;OAEG;IACI,WAAW,CAAC,KAAK,EAAE,yBAAyB,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAIzE;;OAEG;IACI,YAAY,CAAC,KAAK,EAAE,yBAAyB,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAI1E;;OAEG;IACI,YAAY,CAAC,KAAK,EAAE,yBAAyB,GAAG,IAAI;CAG5D"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"cacheListener.js","sourceRoot":"","sources":["../../../src/packlets/runtime/cacheListener.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AA+CH;;;GAGG;AACH,MAAa,iCAAiC;IAC5C;;OAEG;IACI,UAAU,CAAC,KAAgC,EAAE,KAAa;QAC/D,QAAQ;IACV,CAAC;IAED;;OAEG;IACI,WAAW,CAAC,KAAgC,EAAE,KAAa;QAChE,QAAQ;IACV,CAAC;IAED;;OAEG;IACI,YAAY,CAAC,KAAgC,EAAE,KAAa;QACjE,QAAQ;IACV,CAAC;IAED;;OAEG;IACI,YAAY,CAAC,KAAgC;QAClD,QAAQ;IACV,CAAC;CACF;AA5BD,8EA4BC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/**\n * Type indicating which {@link Runtime.ResourceResolver | ResourceResolver} cache is affected.\n * @public\n */\nexport type ResourceResolverCacheType = 'condition' | 'conditionSet' | 'decision';\n\n/**\n * Type indicating the action performed on a {@link Runtime.ResourceResolver | ResourceResolver} cache.\n * @public\n */\nexport type ResourceResolverCacheActivity = 'hit' | 'miss' | 'error' | 'clear';\n\n/**\n * A listener for {@link Runtime.ResourceResolver | ResourceResolver} cache activity.\n * @public\n */\nexport interface IResourceResolverCacheListener {\n /**\n * Called when a cache hit occurs.\n * @param cache - The type of cache that was hit.\n * @param index - The index of the cache that was hit.\n */\n onCacheHit(cache: ResourceResolverCacheType, index: number): void;\n\n /**\n * Called when a cache miss occurs.\n * @param cache - The type of cache that was missed.\n * @param index - The index of the cache that was missed.\n */\n onCacheMiss(cache: ResourceResolverCacheType, index: number): void;\n\n /**\n * Called when a cache error occurs.\n * @param cache - The type of cache that had an error.\n * @param index - The index of the cache that had an error.\n */\n onCacheError(cache: ResourceResolverCacheType, index: number): void;\n\n /**\n * Called when a cache is cleared.\n * @param cache - The type of cache that was cleared.\n */\n onCacheClear(cache: ResourceResolverCacheType): void;\n}\n\n/**\n * A no-op implementation of {@link Runtime.IResourceResolverCacheListener}.\n * @public\n */\nexport class NoOpResourceResolverCacheListener implements IResourceResolverCacheListener {\n /**\n * {@inheritDoc Runtime.IResourceResolverCacheListener.onCacheHit}\n */\n public onCacheHit(cache: ResourceResolverCacheType, index: number): void {\n // no-op\n }\n\n /**\n * {@inheritDoc Runtime.IResourceResolverCacheListener.onCacheMiss}\n */\n public onCacheMiss(cache: ResourceResolverCacheType, index: number): void {\n // no-op\n }\n\n /**\n * {@inheritDoc Runtime.IResourceResolverCacheListener.onCacheError}\n */\n public onCacheError(cache: ResourceResolverCacheType, index: number): void {\n // no-op\n }\n\n /**\n * {@inheritDoc Runtime.IResourceResolverCacheListener.onCacheClear}\n */\n public onCacheClear(cache: ResourceResolverCacheType): void {\n // no-op\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"cacheMetrics.d.ts","sourceRoot":"","sources":["../../../src/packlets/runtime/cacheMetrics.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,8BAA8B,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAE5F;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,OAAO,IAAI,IAAI,CAAC;IAChB,KAAK,IAAI,IAAI,CAAC;CACf;AAED;;;GAGG;AACH,qBAAa,qBAAsB,YAAW,aAAa;IACzD,OAAO,CAAC,KAAK,CAAa;IAC1B,OAAO,CAAC,OAAO,CAAa;IAC5B,OAAO,CAAC,OAAO,CAAa;IAC5B,OAAO,CAAC,OAAO,CAAa;;IASrB,KAAK,CAAC,OAAO,EAAE,M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CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;IAED;;OAEG;IACI,YAAY,CAAC,KAAgC,EAAE,KAAa;QACjE,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACI,YAAY,CAAC,KAAgC;QAClD,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC;IACjC,CAAC;IAED;;OAEG;IACI,KAAK;QACV,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;QAChC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC;QACnC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;IACjC,CAAC;CACF;AA/DD,oFA+DC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { IResourceResolverCacheListener, ResourceResolverCacheType } from './cacheListener';\n\n/**\n * Cache metrics interface for tracking cache performance.\n * @public\n */\nexport interface ICacheMetrics {\n hits: number;\n misses: number;\n errors: number;\n clears: number;\n totalAccesses: number;\n hitRate: number;\n onHit(index: number): void;\n onMiss(index: number): void;\n onError(index: number): void;\n onClear(): void;\n reset(): void;\n}\n\n/**\n * Aggregate cache metrics for a specific cache type.\n * @public\n */\nexport class AggregateCacheMetrics implements ICacheMetrics {\n private _hits: number = 0;\n private _misses: number = 0;\n private _errors: number = 0;\n private _clears: number = 0;\n\n public constructor() {\n this._hits = 0;\n this._misses = 0;\n this._errors = 0;\n this._clears = 0;\n }\n\n public onHit(__index: number): void {\n this._hits++;\n }\n\n public onMiss(__index: number): void {\n this._misses++;\n }\n\n public onError(__index: number): void {\n this._errors++;\n }\n\n public onClear(): void {\n this._hits = 0;\n this._misses = 0;\n this._errors = 0;\n this._clears++;\n }\n\n public get hits(): number {\n return this._hits;\n }\n\n public get misses(): number {\n return this._misses;\n }\n\n public get errors(): number {\n return this._errors;\n }\n\n public get clears(): number {\n return this._clears;\n }\n\n public get totalAccesses(): number {\n return this._hits + this._misses + this._errors;\n }\n\n public get hitRate(): number {\n return this.totalAccesses > 0 ? (this._hits / this.totalAccesses) * 100 : 0;\n }\n\n public get errorRate(): number {\n return this.totalAccesses > 0 ? (this._errors / this.totalAccesses) * 100 : 0;\n }\n\n public reset(): void {\n this._hits = 0;\n this._misses = 0;\n this._errors = 0;\n this._clears = 0;\n }\n}\n\n/**\n * Overall cache metrics across all cache types.\n * @public\n */\nexport type OverallCacheMetrics<TM extends ICacheMetrics = ICacheMetrics> = Record<\n ResourceResolverCacheType,\n TM\n>;\n\n/**\n * A metrics implementation of {@link Runtime.IResourceResolverCacheListener} that tracks\n * hit counts and rates across all cache types.\n * @public\n */\nexport class ResourceResolverCacheMetricsListener<TM extends ICacheMetrics>\n implements IResourceResolverCacheListener\n{\n private readonly _metrics: OverallCacheMetrics<TM>;\n\n public constructor(factory: () => TM);\n public constructor(metrics: OverallCacheMetrics<TM>);\n public constructor(factoryOrMetrics: OverallCacheMetrics<TM> | (() => TM)) {\n if (typeof factoryOrMetrics === 'function') {\n this._metrics = {\n condition: factoryOrMetrics(),\n conditionSet: factoryOrMetrics(),\n decision: factoryOrMetrics()\n };\n } else {\n this._metrics = factoryOrMetrics;\n }\n }\n\n /**\n * Get the metrics for all cache types.\n * @returns The metrics for all cache types.\n */\n public get metrics(): Readonly<OverallCacheMetrics> {\n return this._metrics;\n }\n\n /**\n * {@inheritDoc Runtime.IResourceResolverCacheListener.onCacheHit}\n */\n public onCacheHit(cache: ResourceResolverCacheType, index: number): void {\n this._metrics[cache].onHit(index);\n }\n\n /**\n * {@inheritDoc Runtime.IResourceResolverCacheListener.onCacheMiss}\n */\n public onCacheMiss(cache: ResourceResolverCacheType, index: number): void {\n this._metrics[cache].onMiss(index);\n }\n\n /**\n * {@inheritDoc Runtime.IResourceResolverCacheListener.onCacheError}\n */\n public onCacheError(cache: ResourceResolverCacheType, index: number): void {\n this._metrics[cache].onError(index);\n }\n\n /**\n * {@inheritDoc Runtime.IResourceResolverCacheListener.onCacheClear}\n */\n public onCacheClear(cache: ResourceResolverCacheType): void {\n this._metrics[cache].onClear();\n }\n\n /**\n * Reset all metrics to zero.\n */\n public reset(): void {\n this._metrics.condition.reset();\n this._metrics.conditionSet.reset();\n this._metrics.decision.reset();\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"compiledResourceCollection.d.ts","sourceRoot":"","sources":["../../../src/packlets/runtime/compiledResourceCollection.ts"],"names":[],"mappings":"AAsBA,OAAO,EAEL,WAAW,EAIX,MAAM,EAGP,MAAM,eAAe,CAAC;AACvB,OAAO,EAGL,0BAA0B,EAC1B,6BAA6B,EAC9B,MAAM,eAAe,CAAC;AACvB,OAAO,EAA6B,iCAAiC,EAAE,MAAM,cAAc,CAAC;AAC5F,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAC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AEG;IACH,IAAW,cAAc,IAAI,WAAW,CAAC,4BAA4B,CAAC,UAAU,EAAE,SAAS,CAAC,CAE3F;IAED;;OAEG;IACH,IAAW,YAAY,IAAI,MAAM,CAEhC;IAED,SAAS,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IAElC;;OAEG;IACH,IAAW,aAAa,IAAI,MAAM,CAQjC;IAED;;;;OAIG;IACH,SAAS,aAAa,MAAM,EAAE,uCAAuC;IAgCrE;;;;;;OAMG;WACW,MAAM,CAAC,MAAM,EAAE,uCAAuC,GAAG,MAAM,CAAC,0BAA0B,CAAC;IAIzG;;OAEG;IACI,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC;IAItD;;OAEG;IACI,eAAe,CAAC,OAAO,EAAE,OAAO,CAAC,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC,qBAAqB,CAAC;IAM5F;;;;;;;;;;;;OAYG;IACI,oBAAoB,IAAI,MAAM,CAAC,yBAAyB,CAAC,SAAS,CAAC,CAAC;IAkB3E;;;;;;OAMG;IACH,OAAO,CAAC,oBAAoB;IAa5B;;;;;;OAMG;IACH,OAAO,CAAC,gBAAgB;IAsBxB;;;;;;OAMG;IACH,OAAO,CAAC,mBAAmB;IAa3B;;;;;;OAMG;IACH,OAAO,CAAC,gBAAgB;IA6DxB;;;;;;OAMG;IACH,OAAO,CAAC,mBAAmB;IAqD3B;;;;;;OAMG;IACH,OAAO,CAAC,eAAe;IAqDvB;;;;;;;OAOG;IACH,OAAO,CAAC,eAAe;CAkGxB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"compiledResourceCollection.js","sourceRoot":"","sources":["../../../src/packlets/runtime/compiledResourceCollection.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4CASuB;AACvB,8CAKuB;AACvB,4CAA4F;AAC5F,8CAAmD;AACnD,sDAAwE;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ACF;AA1gBD,gEA0gBC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport {\n captureResult,\n Collections,\n fail,\n mapResults,\n MessageAggregator,\n Result,\n succeed,\n ValidatingResultMap\n} from '@fgv/ts-utils';\nimport {\n ConditionCollector,\n ConditionSetCollector,\n ReadOnlyConditionCollector,\n ReadOnlyConditionSetCollector\n} from '../conditions';\nimport { AbstractDecisionCollector, ReadOnlyAbstractDecisionCollector } from '../decisions';\nimport { QualifierCollector } from '../qualifiers';\nimport { ResourceType, ResourceTypeCollector } from '../resource-types';\nimport { QualifierType, QualifierTypeCollector } from '../qualifier-types';\nimport { Convert, ResourceId } from '../common';\nimport { Converters } from '@fgv/ts-json-base';\nimport { IResourceManager, IResource, IResourceCandidate } from './iResourceManager';\nimport { ConcreteDecision } from '../decisions';\nimport * as Validate from './validate';\nimport * as ResourceJson from '../resource-json';\nimport { ReadOnlyResourceTreeRoot, IReadOnlyResourceTreeRoot } from './resource-tree';\nimport * as Context from '../context';\n\n/**\n * Interface for parameters to create a {@link Runtime.CompiledResourceCollection | CompiledResourceCollection}.\n * @public\n */\nexport interface ICompiledResourceCollectionCreateParams {\n /**\n * The compiled resource collection data.\n */\n compiledCollection: ResourceJson.Compiled.ICompiledResourceCollection;\n /**\n * Map of qualifier type names to qualifier type objects.\n */\n qualifierTypes: Collections.IReadOnlyResultMap<string, QualifierType>;\n /**\n * Map of resource type names to resource type objects.\n */\n resourceTypes: Collections.IReadOnlyResultMap<string, ResourceType>;\n}\n\n/**\n * A compiled resource collection implements {@link Runtime.IResourceManager | IResourceManager}\n * by reconstructing runtime objects from compiled data. This provides an efficient way to load\n * and use pre-compiled resource collections without rebuilding them from scratch.\n * @public\n */\nexport class CompiledResourceCollection implements IResourceManager {\n public readonly conditions: ReadOnlyConditionCollector;\n public readonly conditionSets: ReadOnlyConditionSetCollector;\n public readonly decisions: ReadOnlyAbstractDecisionCollector;\n\n private readonly _qualifierTypes: QualifierTypeCollector;\n private readonly _qualifiers: QualifierCollector;\n private readonly _resourceTypes: ResourceTypeCollector;\n private readonly _builtResources: ValidatingResultMap<ResourceId, IResource>;\n private _cachedResourceTree?: ReadOnlyResourceTreeRoot<IResource>;\n\n /**\n * A {@link QualifierTypes.QualifierTypeCollector | QualifierTypeCollector} which\n * contains the {@link QualifierTypes.QualifierType | qualifier types} used in this collection.\n */\n public get qualifierTypes(): QualifierTypeCollector {\n return this._qualifierTypes;\n }\n\n /**\n * A {@link Qualifiers.QualifierCollector | QualifierCollector} which\n * contains the {@link Qualifiers.Qualifier | qualifiers} used in this collection.\n */\n public get qualifiers(): QualifierCollector {\n return this._qualifiers;\n }\n\n /**\n * A {@link ResourceTypes.ResourceTypeCollector | ResourceTypeCollector} which\n * contains the {@link ResourceTypes.ResourceType | resource types} used in this collection.\n */\n public get resourceTypes(): ResourceTypeCollector {\n return this._resourceTypes;\n }\n\n /**\n * {@inheritdoc Runtime.IResourceManager.builtResources}\n */\n public get builtResources(): Collections.IReadOnlyValidatingResultMap<ResourceId, IResource> {\n return this._builtResources;\n }\n\n /**\n * {@inheritdoc Runtime.IResourceManager.numResources}\n */\n public get numResources(): number {\n return this._builtResources.size;\n }\n\n protected _numCandidates?: number;\n\n /**\n * {@inheritdoc Runtime.IResourceManager.numCandidates}\n */\n public get numCandidates(): number {\n if (this._numCandidates === undefined) {\n this._numCandidates = [...this._builtResources.values()].reduce(\n (acc, resource) => acc + resource.candidates.length,\n 0\n );\n }\n return this._numCandidates;\n }\n\n /**\n * Constructor for a {@link Runtime.CompiledResourceCollection | CompiledResourceCollection} object.\n * @param params - Parameters to create a new {@link Runtime.CompiledResourceCollection | CompiledResourceCollection}.\n * @internal\n */\n protected constructor(params: ICompiledResourceCollectionCreateParams) {\n // Reconstruct collectors from compiled data\n this._qualifierTypes = this._buildQualifierTypes(\n params.compiledCollection,\n params.qualifierTypes\n ).orThrow();\n this._qualifiers = this._buildQualifiers(params.compiledCollection, this._qualifierTypes).orThrow();\n this._resourceTypes = this._buildResourceTypes(params.compiledCollection, params.resourceTypes).orThrow();\n\n // Build collectors from compiled data\n const conditionCollector = this._buildConditions(params.compiledCollection, this._qualifiers).orThrow();\n const conditionSetCollector = this._buildConditionSets(\n params.compiledCollection,\n conditionCollector\n ).orThrow();\n const decisionCollector = this._buildDecisions(\n params.compiledCollection,\n conditionSetCollector\n ).orThrow();\n\n this.conditions = conditionCollector;\n this.conditionSets = conditionSetCollector;\n this.decisions = decisionCollector;\n\n // Build resources from compiled data\n this._builtResources = this._buildResources(\n params.compiledCollection,\n this._resourceTypes,\n decisionCollector\n ).orThrow();\n }\n\n /**\n * Creates a new {@link Runtime.CompiledResourceCollection | CompiledResourceCollection} object.\n * @param params - Parameters to create a new {@link Runtime.CompiledResourceCollection | CompiledResourceCollection}.\n * @returns `Success` with the new {@link Runtime.CompiledResourceCollection | CompiledResourceCollection} object if successful,\n * or `Failure` with an error message if not.\n * @public\n */\n public static create(params: ICompiledResourceCollectionCreateParams): Result<CompiledResourceCollection> {\n return captureResult(() => new CompiledResourceCollection(params));\n }\n\n /**\n * {@inheritdoc Runtime.IResourceManager.getBuiltResource}\n */\n public getBuiltResource(id: string): Result<IResource> {\n return this._builtResources.validating.get(id);\n }\n\n /**\n * {@inheritdoc Runtime.IResourceManager.validateContext}\n */\n public validateContext(context: Context.IContextDecl): Result<Context.IValidatedContextDecl> {\n return Context.Convert.validatedContextDecl.convert(context, {\n qualifiers: this._qualifiers\n });\n }\n\n /**\n * Gets a resource tree built from the resources in this collection.\n * The tree provides hierarchical access to resources based on their ResourceId structure.\n * For example, resources with IDs like \"app.messages.welcome\" create a tree structure\n * where \"app\" and \"messages\" are branch nodes, and \"welcome\" is a leaf containing the resource.\n *\n * String-based validation is available through the `children.validating` property,\n * allowing callers to use `tree.children.validating.getById(stringId)` for validated access.\n *\n * Uses lazy initialization with caching for performance.\n * @returns Result containing the resource tree root, or failure if tree construction fails\n * @public\n */\n public getBuiltResourceTree(): Result<IReadOnlyResourceTreeRoot<IResource>> {\n if (this._cachedResourceTree) {\n return succeed(this._cachedResourceTree);\n }\n\n // Convert all built resources to [ResourceId, IResource] pairs\n const resources: [ResourceId, IResource][] = [];\n for (const [id, resource] of this._builtResources.entries()) {\n resources.push([id, resource]);\n }\n\n // Create the resource tree with lazy initialization\n return ReadOnlyResourceTreeRoot.create(resources).onSuccess((tree) => {\n this._cachedResourceTree = tree;\n return succeed(tree);\n });\n }\n\n /**\n * Reconstructs a QualifierTypeCollector from compiled data.\n * @param compiled - The compiled resource collection\n * @param qualifierTypes - Map of qualifier type names to qualifier type objects\n * @returns The reconstructed QualifierTypeCollector\n * @internal\n */\n private _buildQualifierTypes(\n compiled: ResourceJson.Compiled.ICompiledResourceCollection,\n qualifierTypes: Collections.IReadOnlyResultMap<string, QualifierType>\n ): Result<QualifierTypeCollector> {\n return mapResults(\n compiled.qualifierTypes.map((compiledQualifierType) => qualifierTypes.get(compiledQualifierType.name))\n ).onSuccess((referencedQualifierTypes) => {\n return QualifierTypeCollector.create({\n qualifierTypes: referencedQualifierTypes\n });\n });\n }\n\n /**\n * Reconstructs a QualifierCollector from compiled data.\n * @param compiled - The compiled resource collection\n * @param qualifierTypes - The reconstructed QualifierTypeCollector\n * @returns The reconstructed QualifierCollector\n * @internal\n */\n private _buildQualifiers(\n compiled: ResourceJson.Compiled.ICompiledResourceCollection,\n qualifierTypes: QualifierTypeCollector\n ): Result<QualifierCollector> {\n return mapResults(\n compiled.qualifiers.map((compiledQualifier) => {\n return qualifierTypes.getAt(compiledQualifier.type).onSuccess((qualifierType) => {\n return succeed({\n name: compiledQualifier.name,\n typeName: qualifierType.name,\n defaultPriority: compiledQualifier.defaultPriority\n });\n });\n })\n ).onSuccess((qualifierDecls) => {\n return QualifierCollector.create({\n qualifierTypes,\n qualifiers: qualifierDecls\n });\n });\n }\n\n /**\n * Reconstructs a ResourceTypeCollector from compiled data.\n * @param compiled - The compiled resource collection\n * @param resourceTypes - Map of resource type names to resource type objects\n * @returns The reconstructed ResourceTypeCollector\n * @internal\n */\n private _buildResourceTypes(\n compiled: ResourceJson.Compiled.ICompiledResourceCollection,\n resourceTypes: Collections.IReadOnlyResultMap<string, ResourceType>\n ): Result<ResourceTypeCollector> {\n return mapResults(\n compiled.resourceTypes.map((compiledResourceType) => resourceTypes.get(compiledResourceType.name))\n ).onSuccess((referencedResourceTypes) => {\n return ResourceTypeCollector.create({\n resourceTypes: referencedResourceTypes\n });\n });\n }\n\n /**\n * Reconstructs a ConditionCollector from compiled data.\n * @param compiled - The compiled resource collection\n * @param qualifiers - The reconstructed QualifierCollector\n * @returns The reconstructed ConditionCollector\n * @internal\n */\n private _buildConditions(\n compiled: ResourceJson.Compiled.ICompiledResourceCollection,\n qualifiers: QualifierCollector\n ): Result<ConditionCollector> {\n const errors = new MessageAggregator();\n\n const conditionCollectorResult = ConditionCollector.create({ qualifiers });\n /* c8 ignore next 3 - defensive coding for ConditionCollector creation failure */\n if (conditionCollectorResult.isFailure()) {\n return conditionCollectorResult;\n }\n const conditionCollector = conditionCollectorResult.value;\n\n for (const [index, compiledCondition] of compiled.conditions.entries()) {\n const qualifierResult = qualifiers.getAt(compiledCondition.qualifierIndex);\n if (qualifierResult.isFailure()) {\n errors.addMessage(\n `Invalid qualifier index ${compiledCondition.qualifierIndex} at condition ${index}: ${qualifierResult.message}`\n );\n continue;\n }\n const qualifier = qualifierResult.value;\n\n /* c8 ignore next 1 - not really testable atm as \"matches\" is the only supported operator */\n const operator = compiledCondition.operator ?? 'matches'; // Default to 'matches' if not provided\n const conditionDecl = {\n qualifierName: qualifier.name,\n value: compiledCondition.value,\n operator,\n priority: compiledCondition.priority,\n scoreAsDefault: compiledCondition.scoreAsDefault\n };\n\n const conditionResult = conditionCollector.validating.add(conditionDecl);\n /* c8 ignore next 4 - defensive coding for condition addition failure */\n if (conditionResult.isFailure()) {\n errors.addMessage(`Failed to add condition at index ${index}: ${conditionResult.message}`);\n continue;\n }\n const condition = conditionResult.value;\n\n // Validate that the assigned index matches our expected index\n const expectedIndexResult = Convert.conditionIndex.convert(index);\n /* c8 ignore next 4 - defensive coding for invalid condition index conversion */\n if (expectedIndexResult.isFailure()) {\n errors.addMessage(`Invalid condition index ${index}: ${expectedIndexResult.message}`);\n continue;\n }\n const expectedIndex = expectedIndexResult.value;\n\n /* c8 ignore next 5 - defensive coding for condition index mismatch */\n if (condition.index !== expectedIndex) {\n errors.addMessage(\n `Index mismatch at condition ${index}: expected ${expectedIndex}, got ${condition.index}`\n );\n }\n }\n\n return errors.hasMessages ? fail(errors.toString()) : succeed(conditionCollector);\n }\n\n /**\n * Reconstructs a ConditionSetCollector from compiled data.\n * @param compiled - The compiled resource collection\n * @param conditions - The reconstructed ConditionCollector\n * @returns The reconstructed ConditionSetCollector\n * @internal\n */\n private _buildConditionSets(\n compiled: ResourceJson.Compiled.ICompiledResourceCollection,\n conditions: ConditionCollector\n ): Result<ConditionSetCollector> {\n const errors = new MessageAggregator();\n\n const conditionSetCollectorResult = ConditionSetCollector.create({ conditions });\n /* c8 ignore next 3 - defensive coding for ConditionSetCollector creation failure */\n if (conditionSetCollectorResult.isFailure()) {\n return conditionSetCollectorResult;\n }\n const conditionSetCollector = conditionSetCollectorResult.value;\n\n for (const [index, compiledConditionSet] of compiled.conditionSets.entries()) {\n const referencedConditionsResult = mapResults(\n compiledConditionSet.conditions.map((conditionIndex) => conditions.getAt(conditionIndex))\n );\n if (referencedConditionsResult.isFailure()) {\n errors.addMessage(\n `Failed to resolve conditions for condition set ${index}: ${referencedConditionsResult.message}`\n );\n continue;\n }\n const referencedConditions = referencedConditionsResult.value;\n\n const conditionSetResult = conditionSetCollector.validating.getOrAdd(referencedConditions);\n /* c8 ignore next 4 - defensive coding for condition set addition failure */\n if (conditionSetResult.isFailure()) {\n errors.addMessage(`Failed to add condition set at index ${index}: ${conditionSetResult.message}`);\n continue;\n }\n const conditionSet = conditionSetResult.value;\n\n // Validate that the assigned index matches our expected index\n const expectedIndexResult = Convert.conditionSetIndex.convert(index);\n /* c8 ignore next 4 - defensive coding for invalid condition set index conversion */\n if (expectedIndexResult.isFailure()) {\n errors.addMessage(`Invalid condition set index ${index}: ${expectedIndexResult.message}`);\n continue;\n }\n const expectedIndex = expectedIndexResult.value;\n\n /* c8 ignore next 5 - defensive coding for condition set index mismatch */\n if (conditionSet.index !== expectedIndex) {\n errors.addMessage(\n `Index mismatch at condition set ${index}: expected ${expectedIndex}, got ${conditionSet.index}`\n );\n }\n }\n\n return errors.hasMessages ? fail(errors.toString()) : succeed(conditionSetCollector);\n }\n\n /**\n * Reconstructs an AbstractDecisionCollector from compiled data.\n * @param compiled - The compiled resource collection\n * @param conditionSets - The reconstructed ConditionSetCollector\n * @returns The reconstructed AbstractDecisionCollector\n * @internal\n */\n private _buildDecisions(\n compiled: ResourceJson.Compiled.ICompiledResourceCollection,\n conditionSets: ConditionSetCollector\n ): Result<AbstractDecisionCollector> {\n const errors = new MessageAggregator();\n\n const decisionCollectorResult = AbstractDecisionCollector.create({ conditionSets });\n /* c8 ignore next 3 - defensive coding for AbstractDecisionCollector creation failure */\n if (decisionCollectorResult.isFailure()) {\n return decisionCollectorResult;\n }\n const decisionCollector = decisionCollectorResult.value;\n\n for (const [index, compiledDecision] of compiled.decisions.entries()) {\n const referencedConditionSetsResult = mapResults(\n compiledDecision.conditionSets.map((conditionSetIndex) => conditionSets.getAt(conditionSetIndex))\n );\n if (referencedConditionSetsResult.isFailure()) {\n errors.addMessage(\n `Failed to resolve condition sets for decision ${index}: ${referencedConditionSetsResult.message}`\n );\n continue;\n }\n const referencedConditionSets = referencedConditionSetsResult.value;\n\n const decisionResult = decisionCollector.validating.getOrAdd(referencedConditionSets);\n /* c8 ignore next 4 - defensive coding for decision addition failure */\n if (decisionResult.isFailure()) {\n errors.addMessage(`Failed to add decision at index ${index}: ${decisionResult.message}`);\n continue;\n }\n const decision = decisionResult.value;\n\n // Validate that the assigned index matches our expected index\n const expectedIndexResult = Convert.decisionIndex.convert(index);\n /* c8 ignore next 4 - defensive coding for invalid decision index conversion */\n if (expectedIndexResult.isFailure()) {\n errors.addMessage(`Invalid decision index ${index}: ${expectedIndexResult.message}`);\n continue;\n }\n const expectedIndex = expectedIndexResult.value;\n\n /* c8 ignore next 5 - defensive coding for decision index mismatch */\n if (decision.index !== expectedIndex) {\n errors.addMessage(\n `Index mismatch at decision ${index}: expected ${expectedIndex}, got ${decision.index}`\n );\n }\n }\n\n return errors.hasMessages ? fail(errors.toString()) : succeed(decisionCollector);\n }\n\n /**\n * Reconstructs a ValidatingResultMap of resources from compiled data.\n * @param compiled - The compiled resource collection\n * @param resourceTypes - The reconstructed ResourceTypeCollector\n * @param decisions - The reconstructed AbstractDecisionCollector\n * @returns The reconstructed ValidatingResultMap of resources\n * @internal\n */\n private _buildResources(\n compiled: ResourceJson.Compiled.ICompiledResourceCollection,\n resourceTypes: ResourceTypeCollector,\n decisions: AbstractDecisionCollector\n ): Result<ValidatingResultMap<ResourceId, IResource>> {\n const errors = new MessageAggregator();\n\n const resourceMap = new ValidatingResultMap<ResourceId, IResource>({\n converters: new Collections.KeyValueConverters<ResourceId, IResource>({\n key: Convert.resourceId,\n value: (from: unknown): Result<IResource> => {\n return Validate.resource.validate(from);\n }\n })\n });\n\n for (const compiledResource of compiled.resources) {\n const resourceTypeResult = resourceTypes.getAt(compiledResource.type);\n if (resourceTypeResult.isFailure()) {\n errors.addMessage(\n `Invalid resource type index ${compiledResource.type} for resource ${compiledResource.id}: ${resourceTypeResult.message}`\n );\n continue;\n }\n const resourceType = resourceTypeResult.value;\n\n const decisionResult = decisions.getAt(compiledResource.decision);\n if (decisionResult.isFailure()) {\n errors.addMessage(\n `Invalid decision index ${compiledResource.decision} for resource ${compiledResource.id}: ${decisionResult.message}`\n );\n continue;\n }\n const decision = decisionResult.value;\n\n // Build candidates from compiled data\n const candidateDeclsResult = mapResults(\n compiledResource.candidates.map((compiledCandidate) =>\n Converters.jsonObject.convert(compiledCandidate.json).onSuccess((json) => {\n return succeed({\n json,\n isPartial: compiledCandidate.isPartial,\n mergeMethod: compiledCandidate.mergeMethod\n });\n })\n )\n );\n if (candidateDeclsResult.isFailure()) {\n errors.addMessage(\n `Failed to convert candidate JSON for resource ${compiledResource.id}: ${candidateDeclsResult.message}`\n );\n continue;\n }\n const candidateDecls = candidateDeclsResult.value;\n\n // Create minimal candidates that implement IResourceCandidate\n const candidates: IResourceCandidate[] = candidateDecls.map((candidateDecl) => ({\n json: candidateDecl.json,\n isPartial: candidateDecl.isPartial,\n mergeMethod: candidateDecl.mergeMethod\n }));\n\n // Create a ConcreteDecision from the abstract decision and candidate values\n const candidatesWithConditionSets = decision.candidates.map((baseCandidate, idx) => ({\n conditionSet: baseCandidate.conditionSet,\n value: candidates[idx].json\n }));\n\n const concreteDecisionResult = ConcreteDecision.create({\n decisions,\n candidates: candidatesWithConditionSets\n });\n /* c8 ignore next 6 - defensive coding for ConcreteDecision creation failure */\n if (concreteDecisionResult.isFailure()) {\n errors.addMessage(\n `Failed to create concrete decision for resource ${compiledResource.id}: ${concreteDecisionResult.message}`\n );\n continue;\n }\n const concreteDecision = concreteDecisionResult.value;\n\n // Create minimal resource that implements IResource\n const resource: IResource = {\n id: compiledResource.id,\n resourceType,\n decision: concreteDecision,\n candidates\n };\n\n const setResult = resourceMap.set(compiledResource.id, resource);\n /* c8 ignore next 3 - defensive coding for resource map set failure */\n if (setResult.isFailure()) {\n errors.addMessage(`Failed to add resource ${compiledResource.id}: ${setResult.message}`);\n }\n }\n\n return errors.hasMessages ? fail(errors.toString()) : succeed(resourceMap);\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"conditionSetResolutionResult.d.ts","sourceRoot":"","sources":["../../../src/packlets/runtime/conditionSetResolutionResult.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAiB,MAAM,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEnE;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,gBAAgB,GAAG,SAAS,CAAC;AAExE;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IACrC,QAAQ,CAAC,SAAS,EAAE,kBAAkB,CAAC;IACvC,QAAQ,CAAC,KAAK,EAAE,mBAAmB,CAAC;CACrC;AAED;;;;GAIG;AACH,qBAAa,4BAA4B;IACvC,SAAgB,SAAS,EAAE,kBAAkB,CAAC;IAC9C,SAAgB,OAAO,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC;IAE9D;;;;OAIG;IACH,OAAO;IAKP;;;;;;OAMG;WACW,MAAM,CAClB,SAAS,EAAE,kBAAkB,EAC7B,OAAO,EAAE,aAAa,CAAC,qBAAqB,CAAC,GAC5C,MAAM,CAAC,4BAA4B,CAAC;IAIvC;;;;;;;;;;;;;;;;OAgBG;WACW,OAAO,CAAC,CAAC,EAAE,4BAA4B,EAAE,CAAC,EAAE,4BAA4B,GAAG,MAAM;IA6C/F;;;;OAIG;IACH,IAAW,WAAW,IAAI,iBAAiB,CAK1C;IAED;;;;OAIG;IACH,IAAW,UAAU,IAAI,mBAAmB,CAK3C;CACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"conditionSetResolutionResult.js","sourceRoot":"","sources":["../../../src/packlets/runtime/conditionSetResolutionResult.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAAsD;AAmBtD;;;;GAIG;AACH,MAAa,4BAA4B;IAIvC;;;;OAIG;IACH,YAAoB,SAA6B,EAAE,OAA6C;QAC9F,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,OAAO,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC;IAC9B,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,MAAM,CAClB,SAA6B,EAC7B,OAA6C;QAE7C,OAAO,IAAA,wBAAa,EAAC,GAAG,EAAE,CAAC,IAAI,4BAA4B,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;IACnF,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACI,MAAM,CAAC,OAAO,CAAC,CAA+B,EAAE,CAA+B;QACpF,yFAAyF;QACzF,IAAI,CAAC,CAAC,SAAS,KAAK,OAAO,EAAE,CAAC;YAC5B,IAAI,CAAC,CAAC,SAAS,KAAK,OAAO;gBAAE,OAAO,CAAC,CAAC,CAAC;QACzC,CAAC;aAAM,IAAI,CAAC,CAAC,SAAS,KAAK,gBAAgB,EAAE,CAAC;YAC5C,IAAI,CAAC,CAAC,SAAS,KAAK,OAAO,EAAE,CAAC;gBAC5B,OAAO,CAAC,CAAC;YACX,CAAC;iBAAM,IAAI,CAAC,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;gBACrC,OAAO,CAAC,CAAC,CAAC;YACZ,CAAC;QACH,CAAC;aAAM,CAAC;YACN,4BAA4B;YAC5B,IAAI,CA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CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAsB,CAAC;IAC/E,CAAC;IAED;;;;OAIG;IACH,IAAW,UAAU;QACnB,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC9D,OAAO,CAAwB,CAAC;QAClC,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC,CAAwB,CAAC;IAC1F,CAAC;CACF;AAjHD,oEAiHC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { captureResult, Result } from '@fgv/ts-utils';\nimport { QualifierMatchScore, ConditionPriority } from '../common';\n\n/**\n * The outcome of a condition match.\n * @public\n */\nexport type ConditionMatchType = 'match' | 'matchAsDefault' | 'noMatch';\n\n/**\n * Represents a single condition match result with priority and outcome.\n * @public\n */\nexport interface IConditionMatchResult {\n readonly priority: ConditionPriority;\n readonly matchType: ConditionMatchType;\n readonly score: QualifierMatchScore;\n}\n\n/**\n * Represents the result of resolving a condition set.\n * Contains either a failure indicator or a list of condition priority/score tuples sorted by priority then score.\n * @public\n */\nexport class ConditionSetResolutionResult {\n public readonly matchType: ConditionMatchType;\n public readonly matches: ReadonlyArray<IConditionMatchResult>;\n\n /**\n * Constructor for a {@link Runtime.ConditionSetResolutionResult | ConditionSetResolutionResult}.\n * @param success - Whether the condition set resolution was successful.\n * @param matches - Array of condition match results, if successful.\n */\n private constructor(matchType: ConditionMatchType, matches: ReadonlyArray<IConditionMatchResult>) {\n this.matchType = matchType;\n this.matches = [...matches];\n }\n\n /**\n * Creates a new condition set resolution result.\n * @param matchType - The type of match.\n * @param matches - Array of condition match results.\n * @returns A new {@link Runtime.ConditionSetResolutionResult | ConditionSetResolutionResult}.\n * @public\n */\n public static create(\n matchType: ConditionMatchType,\n matches: ReadonlyArray<IConditionMatchResult>\n ): Result<ConditionSetResolutionResult> {\n return captureResult(() => new ConditionSetResolutionResult(matchType, matches));\n }\n\n /**\n * Compares two condition set resolution results for sorting purposes.\n * The priority of a condition set result cannot be boiled down to a single number -\n * we have to examine each condition result in turn.\n *\n * Comparison logic:\n * - If priority differs, return the higher priority\n * - If priority matches but score is different, return the higher score\n * - If priority and score both match, proceed to the next condition\n * - Failed results are considered lower priority than successful results\n *\n * @param a - The first condition set resolution result to compare.\n * @param b - The second condition set resolution result to compare.\n * @returns A negative number if a should come before b, a positive number if a should\n * come after b, or zero if they are equivalent.\n * @public\n */\n public static compare(a: ConditionSetResolutionResult, b: ConditionSetResolutionResult): number {\n // Failed results are always lower priority than default match which are lower than match\n if (a.matchType === 'match') {\n if (b.matchType !== 'match') return -1;\n } else if (a.matchType === 'matchAsDefault') {\n if (b.matchType === 'match') {\n return 1;\n } else if (b.matchType === 'noMatch') {\n return -1;\n }\n } else {\n // a.matchType === 'noMatch'\n if (b.matchType === 'noMatch') {\n return 0;\n } else {\n return 1; // noMatch comes after any other match type\n }\n }\n\n // Both are successful with the same match type - compare condition by condition\n const minLength = Math.min(a.matches.length, b.matches.length);\n\n for (let i = 0; i < minLength; i++) {\n const matchA = a.matches[i];\n const matchB = b.matches[i];\n\n // Compare priority first\n const priorityDiff = matchB.priority - matchA.priority;\n if (priorityDiff !== 0) {\n return priorityDiff;\n }\n\n // If priority matches, compare score\n const scoreDiff = matchB.score - matchA.score;\n if (scoreDiff !== 0) {\n return scoreDiff;\n }\n\n // If both priority and score match, continue to next condition\n }\n\n // If all compared conditions are equal, the one with more conditions wins\n return b.matches.length - a.matches.length;\n }\n\n /**\n * Gets the highest priority among all condition matches.\n * @returns The highest priority, or 0 if no matches.\n * @public\n */\n public get maxPriority(): ConditionPriority {\n if (this.matchType === 'noMatch' || this.matches.length === 0) {\n return 0 as ConditionPriority;\n }\n return Math.max(...this.matches.map((m) => m.priority)) as ConditionPriority;\n }\n\n /**\n * Gets the total score by summing all condition match scores.\n * @returns The total score, or 0 if no matches.\n * @public\n */\n public get totalScore(): QualifierMatchScore {\n if (this.matchType === 'noMatch' || this.matches.length === 0) {\n return 0 as QualifierMatchScore;\n }\n return this.matches.reduce((sum, match) => sum + match.score, 0) as QualifierMatchScore;\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"contextQualifierProvider.d.ts","sourceRoot":"","sources":["../../../../src/packlets/runtime/context/contextQualifierProvider.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACpF,OAAO,EAAE,2BAA2B,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE1E;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;;;OAKG;IACH,GAAG,CAAC,sBAAsB,EAAE,aAAa,GAAG,cAAc,GAAG,SAAS,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;IAEvG;;;;;OAKG;IACH,YAAY,CACV,sBAAsB,EAAE,aAAa,GAAG,cAAc,GAAG,SAAS,GACjE,MAAM,CAAC,qBAAqB,CAAC,CAAC;IAEjC;;;;;OAKG;IACH,GAAG,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IAE1C;;;;OAIG;IACH,QAAQ,IAAI,MAAM,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC;IAEjD;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,2BAA2B,CAAC;CAClD;AAED;;;;GAIG;AACH,8BAAsB,wBAAyB,YAAW,yBAAyB;IACjF;;OAEG;IACH,kBAAyB,UAAU,EAAE,2BAA2B,CAAC;IAEjE;;;;;OAKG;aACa,GAAG,CACjB,sBAAsB,EAAE,aAAa,GAAG,cAAc,GAAG,SAAS,GACjE,MAAM,CAAC,qBAAqB,CAAC;IAEhC;;;;;OAKG;aACa,YAAY,CAC1B,sBAAsB,EAAE,aAAa,GAAG,cAAc,GAAG,SAAS,GACjE,MAAM,CAAC,qBAAqB,CAAC;IAEhC;;;;;OAKG;aACa,GAAG,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC;IAEzD;;;;OAIG;aACa,QAAQ,IAAI,MAAM,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC;CACjE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"contextQualifierProvider.js","sourceRoot":"","sources":["../../../../src/packlets/runtime/context/contextQualifierProvider.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAmDH;;;;GAIG;AACH,MAAsB,wBAAwB;CAwC7C;AAxCD,4DAwCC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Result } from '@fgv/ts-utils';\nimport { QualifierName, QualifierContextValue, QualifierIndex } from '../../common';\nimport { IReadOnlyQualifierCollector, Qualifier } from '../../qualifiers';\n\n/**\n * Abstract interface for providing qualifier values in an optimized runtime context.\n * Acts as a property bag using the Result pattern for qualifier value lookups.\n * @public\n */\nexport interface IContextQualifierProvider {\n /**\n * Gets a qualifier value by its name, index, or qualifier object.\n * @param nameOrIndexOrQualifier - The {@link QualifierName | qualifier name}, {@link QualifierIndex | index}, or {@link Qualifiers.Qualifier | qualifier object} to look up.\n * @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,\n * or `Failure` with an error message if not found or an error occurs.\n */\n get(nameOrIndexOrQualifier: QualifierName | QualifierIndex | Qualifier): Result<QualifierContextValue>;\n\n /**\n * Gets a validated qualifier context value by its name, index, or qualifier object.\n * @param nameOrIndexOrQualifier - The {@link QualifierName | qualifier name}, {@link QualifierIndex | index}, or {@link Qualifiers.Qualifier | qualifier object} to look up.\n * @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,\n * or `Failure` with an error message if not found, invalid, or an error occurs.\n */\n getValidated(\n nameOrIndexOrQualifier: QualifierName | QualifierIndex | Qualifier\n ): Result<QualifierContextValue>;\n\n /**\n * Checks if a qualifier value exists with the given name.\n * @param name - The {@link QualifierName | qualifier name} to check.\n * @returns `Success` with `true` if the qualifier value exists, `false` if it doesn't,\n * or `Failure` with an error message if an error occurs during the check.\n */\n has(name: QualifierName): Result<boolean>;\n\n /**\n * Gets all available qualifier names in this context.\n * @returns `Success` with an array of all {@link QualifierName | qualifier names},\n * or `Failure` with an error message if an error occurs.\n */\n getNames(): Result<ReadonlyArray<QualifierName>>;\n\n /**\n * The readonly qualifier collector that defines and validates the qualifiers for this context.\n */\n readonly qualifiers: IReadOnlyQualifierCollector;\n}\n\n/**\n * Abstract base class for implementing context qualifier providers.\n * Provides common functionality and enforces the contract for derived classes.\n * @public\n */\nexport abstract class ContextQualifierProvider implements IContextQualifierProvider {\n /**\n * The readonly qualifier collector that defines and validates the qualifiers for this context.\n */\n public abstract readonly qualifiers: IReadOnlyQualifierCollector;\n\n /**\n * Gets a qualifier value by its name, index, or qualifier object.\n * @param nameOrIndexOrQualifier - The {@link QualifierName | qualifier name}, {@link QualifierIndex | index}, or {@link Qualifiers.Qualifier | qualifier object} to look up.\n * @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,\n * or `Failure` with an error message if not found or an error occurs.\n */\n public abstract get(\n nameOrIndexOrQualifier: QualifierName | QualifierIndex | Qualifier\n ): Result<QualifierContextValue>;\n\n /**\n * Gets a validated qualifier context value by its name, index, or qualifier object.\n * @param nameOrIndexOrQualifier - The {@link QualifierName | qualifier name}, {@link QualifierIndex | index}, or {@link Qualifiers.Qualifier | qualifier object} to look up.\n * @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,\n * or `Failure` with an error message if not found, invalid, or an error occurs.\n */\n public abstract getValidated(\n nameOrIndexOrQualifier: QualifierName | QualifierIndex | Qualifier\n ): Result<QualifierContextValue>;\n\n /**\n * Checks if a qualifier value exists with the given name.\n * @param name - The {@link QualifierName | qualifier name} to check.\n * @returns `Success` with `true` if the qualifier value exists, `false` if it doesn't,\n * or `Failure` with an error message if an error occurs during the check.\n */\n public abstract has(name: QualifierName): Result<boolean>;\n\n /**\n * Gets all available qualifier names in this context.\n * @returns `Success` with an array of all {@link QualifierName | qualifier names},\n * or `Failure` with an error message if an error occurs.\n */\n public abstract getNames(): Result<ReadonlyArray<QualifierName>>;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"contextQualifierProviderValidator.d.ts","sourceRoot":"","sources":["../../../../src/packlets/runtime/context/contextQualifierProviderValidator.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,MAAM,EAAiB,MAAM,eAAe,CAAC;AACtD,OAAO,EAAiB,qBAAqB,EAAkB,MAAM,cAAc,CAAC;AACpF,OAAO,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAEvE;;;GAGG;AACH,MAAM,WAAW,0CAA0C;IACzD;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,yBAAyB,CAAC;IAE7C;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,2BAA2B,CAAC;IAEjD;;;;;OAKG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;IAEjD;;;;;OAKG;IACH,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;IAEzD;;;;;OAKG;IACH,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;IAE1D;;;;;OAKG;IACH,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;IAElE;;;;;OAKG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,MA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/B;;;;OAIG;IACH,OAAO,CAAC,8BAA8B;CAMvC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"contextQualifierProviderValidator.js","sourceRoot":"","sources":["../../../../src/packlets/runtime/context/contextQualifierProviderValidator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAAsD;AAsFtD;;;;;GAKG;AACH,MAAa,iCAAiC;IAM5C;;OAEG;IACH,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC;IAClC,CAAC;IAED;;;OAGG;IACH,YAAmB,MAAsD;QACvE,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;IAClC,CAAC;IAED;;;;;OAKG;IACI,GAAG,CAAC,IAAY;QACrB,OAAO,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,aAAa,EAAE,EAAE;YACnE,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QAC1C,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACI,UAAU,CAAC,KAAa;QAC7B,OAAO,IAAI,CAAC,uBAAuB,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,cAAc,EAAE,EAAE;YACtE,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACI,YAAY,CAAC,IAAY;QAC9B,OAAO,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,aAAa,EAAE,EAAE;YACnE,OAAO,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACI,mBAAmB,CAAC,KAAa;QACtC,OAAO,IAAI,CAAC,uBAAuB,C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, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Result, fail, succeed } from '@fgv/ts-utils';\nimport { QualifierName, QualifierContextValue, QualifierIndex } from '../../common';\nimport { IReadOnlyQualifierCollector } from '../../qualifiers';\nimport { IContextQualifierProvider } from './contextQualifierProvider';\n\n/**\n * A read-only interface exposing non-mutating methods of a {@link Runtime.Context.ContextQualifierProviderValidator | ContextQualifierProviderValidator}.\n * @public\n */\nexport interface IReadOnlyContextQualifierProviderValidator {\n /**\n * {@inheritdoc Runtime.Context.ContextQualifierProviderValidator.provider}\n */\n readonly provider: IContextQualifierProvider;\n\n /**\n * {@inheritdoc Runtime.Context.ContextQualifierProviderValidator.qualifiers}\n */\n readonly qualifiers: IReadOnlyQualifierCollector;\n\n /**\n * Gets a qualifier value by its string name, converting to strongly-typed QualifierName.\n * @param name - The string name to convert and look up.\n * @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,\n * or `Failure` with an error message if not found or an error occurs.\n */\n get(name: string): Result<QualifierContextValue>;\n\n /**\n * Gets a qualifier value by its number index, converting to strongly-typed QualifierIndex.\n * @param index - The number index to convert and look up.\n * @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,\n * or `Failure` with an error message if not found or an error occurs.\n */\n getByIndex(index: number): Result<QualifierContextValue>;\n\n /**\n * Gets a validated qualifier context value by its string name.\n * @param name - The string name to convert and look up.\n * @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,\n * or `Failure` with an error message if not found, invalid, or an error occurs.\n */\n getValidated(name: string): Result<QualifierContextValue>;\n\n /**\n * Gets a validated qualifier context value by its number index.\n * @param index - The number index to convert and look up.\n * @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,\n * or `Failure` with an error message if not found, invalid, or an error occurs.\n */\n getValidatedByIndex(index: number): Result<QualifierContextValue>;\n\n /**\n * Checks if a qualifier value exists with the given string name.\n * @param name - The string name to convert and check.\n * @returns `Success` with `true` if the qualifier value exists, `false` if it doesn't,\n * or `Failure` with an error message if an error occurs during the check.\n */\n has(name: string): Result<boolean>;\n\n /**\n * Sets a qualifier value using string inputs, converting to strongly-typed values.\n * @param name - The string name to convert.\n * @param value - The string value to convert.\n * @returns `Success` with the set {@link QualifierContextValue | qualifier context value} if successful,\n * or `Failure` with an error message if an error occurs.\n */\n set(name: string, value: string): Result<QualifierContextValue>;\n\n /**\n * Removes a qualifier value using string input, converting to strongly-typed QualifierName.\n * @param name - The string name to convert.\n * @returns `Success` with the removed {@link QualifierContextValue | qualifier context value} if successful,\n * or `Failure` with an error message if an error occurs.\n */\n remove(name: string): Result<QualifierContextValue>;\n}\n\n/**\n * Parameters for constructing a {@link Runtime.Context.ContextQualifierProviderValidator | ContextQualifierProviderValidator}.\n * @public\n */\nexport interface IContextQualifierProviderValidatorCreateParams {\n provider: IContextQualifierProvider;\n}\n\n/**\n * A wrapper for {@link Runtime.Context.IContextQualifierProvider | IContextQualifierProvider} that accepts\n * string inputs and converts them to strongly-typed values before calling the wrapped provider.\n * This eliminates the need for type casting in consumer code while maintaining type safety.\n * @public\n */\nexport class ContextQualifierProviderValidator implements IReadOnlyContextQualifierProviderValidator {\n /**\n * The wrapped context qualifier provider.\n */\n public readonly provider: IContextQualifierProvider;\n\n /**\n * The readonly qualifier collector that defines and validates the qualifiers for this context.\n */\n public get qualifiers(): IReadOnlyQualifierCollector {\n return this.provider.qualifiers;\n }\n\n /**\n * Constructs a new {@link Runtime.Context.ContextQualifierProviderValidator | ContextQualifierProviderValidator}.\n * @param params - Required parameters for constructing the validator.\n */\n public constructor(params: IContextQualifierProviderValidatorCreateParams) {\n this.provider = params.provider;\n }\n\n /**\n * Gets a qualifier value by its string name, converting to strongly-typed QualifierName.\n * @param name - The string name to convert and look up.\n * @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,\n * or `Failure` with an error message if not found or an error occurs.\n */\n public get(name: string): Result<QualifierContextValue> {\n return this._validateQualifierName(name).onSuccess((qualifierName) => {\n return this.provider.get(qualifierName);\n });\n }\n\n /**\n * Gets a qualifier value by its number index, converting to strongly-typed QualifierIndex.\n * @param index - The number index to convert and look up.\n * @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,\n * or `Failure` with an error message if not found or an error occurs.\n */\n public getByIndex(index: number): Result<QualifierContextValue> {\n return this._validateQualifierIndex(index).onSuccess((qualifierIndex) => {\n return this.provider.get(qualifierIndex);\n });\n }\n\n /**\n * Gets a validated qualifier context value by its string name.\n * @param name - The string name to convert and look up.\n * @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,\n * or `Failure` with an error message if not found, invalid, or an error occurs.\n */\n public getValidated(name: string): Result<QualifierContextValue> {\n return this._validateQualifierName(name).onSuccess((qualifierName) => {\n return this.provider.getValidated(qualifierName);\n });\n }\n\n /**\n * Gets a validated qualifier context value by its number index.\n * @param index - The number index to convert and look up.\n * @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,\n * or `Failure` with an error message if not found, invalid, or an error occurs.\n */\n public getValidatedByIndex(index: number): Result<QualifierContextValue> {\n return this._validateQualifierIndex(index).onSuccess((qualifierIndex) => {\n return this.provider.getValidated(qualifierIndex);\n });\n }\n\n /**\n * Checks if a qualifier value exists with the given string name.\n * @param name - The string name to convert and check.\n * @returns `Success` with `true` if the qualifier value exists, `false` if it doesn't,\n * or `Failure` with an error message if an error occurs during the check.\n */\n public has(name: string): Result<boolean> {\n return this._validateQualifierName(name).onSuccess((qualifierName) => {\n return this.provider.has(qualifierName);\n });\n }\n\n /**\n * Sets a qualifier value using string inputs, converting to strongly-typed values.\n * @param name - The string name to convert.\n * @param value - The string value to convert.\n * @returns `Success` with the set {@link QualifierContextValue | qualifier context value} if successful,\n * or `Failure` with an error message if an error occurs.\n */\n public set(name: string, value: string): Result<QualifierContextValue> {\n return this._validateQualifierName(name)\n .onSuccess((qualifierName) => this._validateQualifierContextValue(value))\n .onSuccess((qualifierValue) => {\n // Check if the provider has a set method (only available on mutable providers)\n if ('set' in this.provider && typeof this.provider.set === 'function') {\n try {\n return (\n this.provider.set as (\n name: QualifierName,\n value: QualifierContextValue\n ) => Result<QualifierContextValue>\n )(name as QualifierName, qualifierValue);\n } catch {\n return fail(`Provider does not support setting values`);\n }\n }\n return fail(`Provider does not support setting values`);\n });\n }\n\n /**\n * Removes a qualifier value using string input, converting to strongly-typed QualifierName.\n * @param name - The string name to convert.\n * @returns `Success` with the removed {@link QualifierContextValue | qualifier context value} if successful,\n * or `Failure` with an error message if an error occurs.\n */\n public remove(name: string): Result<QualifierContextValue> {\n return this._validateQualifierName(name).onSuccess((qualifierName) => {\n // Check if the provider has a remove method (only available on mutable providers)\n if ('remove' in this.provider && typeof this.provider.remove === 'function') {\n try {\n return (this.provider.remove as (name: QualifierName) => Result<QualifierContextValue>)(\n qualifierName\n );\n } catch {\n return fail(`Provider does not support removing values`);\n }\n }\n return fail(`Provider does not support removing values`);\n });\n }\n\n /**\n * Validates a string as a QualifierName.\n * @param name - The string to validate.\n * @returns `Success` with the strongly-typed QualifierName, or `Failure` if invalid.\n */\n private _validateQualifierName(name: string): Result<QualifierName> {\n if (typeof name !== 'string' || name.length === 0) {\n return fail(`Invalid qualifier name: \"${name}\"`);\n }\n return succeed(name as QualifierName);\n }\n\n /**\n * Validates a number as a QualifierIndex.\n * @param index - The number to validate.\n * @returns `Success` with the strongly-typed QualifierIndex, or `Failure` if invalid.\n */\n private _validateQualifierIndex(index: number): Result<QualifierIndex> {\n if (typeof index !== 'number' || !Number.isInteger(index) || index < 0) {\n return fail(`Invalid qualifier index: ${index}`);\n }\n return succeed(index as QualifierIndex);\n }\n\n /**\n * Validates a string as a QualifierContextValue.\n * @param value - The string to validate.\n * @returns `Success` with the strongly-typed QualifierContextValue, or `Failure` if invalid.\n */\n private _validateQualifierContextValue(value: string): Result<QualifierContextValue> {\n if (typeof value !== 'string') {\n return fail(`Invalid qualifier context value: \"${value}\"`);\n }\n return succeed(value as QualifierContextValue);\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/packlets/runtime/context/index.ts"],"names":[],"mappings":"AAsBA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qCAAqC,CAAC;AACpD,cAAc,kCAAkC,CAAC;AACjD,cAAc,4CAA4C,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/packlets/runtime/context/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;AAEH,6DAA2C;AAC3C,sEAAoD;AACpD,mEAAiD;AACjD,6EAA2D","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nexport * from './contextQualifierProvider';\nexport * from './contextQualifierProviderValidator';\nexport * from './simpleContextQualifierProvider';\nexport * from './validatingSimpleContextQualifierProvider';\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"simpleContextQualifierProvider.d.ts","sourceRoot":"","sources":["../../../../src/packlets/runtime/context/simpleContextQualifierProvider.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,MAAM,EAA8D,MAAM,eAAe,CAAC;AACnG,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,cAAc,EAAY,MAAM,cAAc,CAAC;AAC9F,OAAO,EAAE,2BAA2B,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE;;;GAGG;AACH,MAAM,WAAW,2CAA2C;IAC1D;;OAEG;IACH,UAAU,EAAE,2BAA2B,CAAC;IAExC;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;CACzD;AAED;;;;GAIG;AACH,qBAAa,8BAA+B,SAAQ,wBAAwB;IAC1E;;OAEG;IACH,SAAgB,UAAU,EAAE,2BAA2B,CAAC;IAExD;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAkD;IAEnF;;;OAGG;IACH,SAAS,aAAa,MAAM,EAAE,2CAA2C;IAazE;;;;;;OAMG;WACW,MAAM,CAClB,MAAM,EAAE,2CAA2C,GAClD,MAAM,CAAC,8BAA8B,CAAC;IAIzC;;;;;OAKG;IACI,GAAG,CACR,sBAAsB,EAAE,aAAa,GAAG,cAAc,GAAG,SAAS,GACjE,MAAM,CAAC,qBAAqB,CAAC;IAShC;;;;;;OAMG;IACI,YAAY,CACjB,sBAAsB,EAAE,aAAa,GAAG,cAAc,GAAG,SAAS,GACjE,MAAM,CAAC,qBAAqB,CAAC;IAShC;;;;;OAKG;IACI,GAAG,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC;IAIhD;;;;OAIG;IACI,QAAQ,IAAI,MAAM,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC;IAIvD;;;;;;;OAOG;IACI,GAAG,CAAC,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,qBAAqB,GAAG,MAAM,CAAC,qBAAqB,CAAC;IAK5F;;;;;;OAMG;IACI,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAAC,qBAAqB,CAAC;IAOjE;;;;OAIG;IACH,IAAW,IAAI,IAAI,MAAM,CAExB;IAED;;;OAGG;IACI,KAAK,IAAI,IAAI;IAIpB;;;;;;OAMG;IACH,OAAO,CAAC,qBAAqB;CA8B9B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"simpleContextQualifierProvider.js","sourceRoot":"","sources":["../../../../src/packlets/runtime/context/simpleContextQualifierProvider.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAAmG;AACnG,yCAA8F;AAE9F,yEAAsE;AAkBtE;;;;GAIG;AACH,MAAa,8BAA+B,SAAQ,mDAAwB;IAW1E;;;OAGG;IACH,YAAsB,MAAmD;QACvE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QACpC,IAAI,CAAC,gBAAgB,GA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IAAI;YAC/B,MAAM,IAAI,sBAAsB,EAChC,CAAC;YACD,OAAO,IAAA,kBAAO,EAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;QAC9C,CAAC;QAED,oDAAoD;QACpD,uFAAuF;QACvF,IAAI,OAAO,sBAAsB,KAAK,QAAQ,EAAE,CAAC;YAC/C,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,sBAAwC,CAAC,CAAC;YAClF,IAAI,SAAS,CAAC,SAAS,EAAE,EAAE,CAAC;gBAC1B,OAAO,IAAA,kBAAO,EAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACvC,CAAC;YACD,OAAO,IAAA,eAAI,EAAC,gCAAgC,sBAAsB,EAAE,CAAC,CAAC;QACxE,CAAC;QAED,OAAO,IAAA,eAAI,EAAC,gCAAgC,sBAAsB,EAAE,CAAC,CAAC;IACxE,CAAC;CACF;AAhLD,wEAgLC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Result, ResultMap, captureResult, succeed, fail, succeedWithDetail } from '@fgv/ts-utils';\nimport { QualifierName, QualifierContextValue, QualifierIndex, Validate } from '../../common';\nimport { IReadOnlyQualifierCollector, Qualifier } from '../../qualifiers';\nimport { ContextQualifierProvider } from './contextQualifierProvider';\n\n/**\n * Parameters for creating a {@link Runtime.SimpleContextQualifierProvider | SimpleContextQualifierProvider}.\n * @public\n */\nexport interface ISimpleContextQualifierProviderCreateParams {\n /**\n * The {@link Qualifiers.IReadOnlyQualifierCollector | readonly qualifier collector} that defines and validates qualifiers.\n */\n qualifiers: IReadOnlyQualifierCollector;\n\n /**\n * Optional record of initial qualifier name-value pairs to populate the provider.\n */\n qualifierValues?: Record<string, QualifierContextValue>;\n}\n\n/**\n * Simple concrete implementation of {@link Runtime.Context.IContextQualifierProvider | IContextQualifierProvider}\n * using a `ResultMap` for qualifier value storage.\n * @public\n */\nexport class SimpleContextQualifierProvider extends ContextQualifierProvider {\n /**\n * The readonly qualifier collector that defines and validates the qualifiers for this context.\n */\n public readonly qualifiers: IReadOnlyQualifierCollector;\n\n /**\n * Internal storage for qualifier values using a ResultMap.\n */\n private readonly _qualifierValues: ResultMap<QualifierName, QualifierContextValue>;\n\n /**\n * Constructor for a {@link Runtime.SimpleContextQualifierProvider | SimpleContextQualifierProvider} object.\n * @param params - {@link Runtime.ISimpleContextQualifierProviderCreateParams | Parameters} used to create the provider.\n */\n protected constructor(params: ISimpleContextQualifierProviderCreateParams) {\n super();\n this.qualifiers = params.qualifiers;\n this._qualifierValues = new ResultMap<QualifierName, QualifierContextValue>();\n\n if (params.qualifierValues) {\n for (const [name, value] of Object.entries(params.qualifierValues)) {\n const qualifierName = Validate.toQualifierName(name).orThrow();\n this._qualifierValues.set(qualifierName, value);\n }\n }\n }\n\n /**\n * Creates a new {@link Runtime.SimpleContextQualifierProvider | SimpleContextQualifierProvider} object.\n * @param params - {@link Runtime.ISimpleContextQualifierProviderCreateParams | Parameters} used to create the provider.\n * @returns `Success` with the new {@link Runtime.SimpleContextQualifierProvider | SimpleContextQualifierProvider} object if successful,\n * or `Failure` with an error message if not.\n * @public\n */\n public static create(\n params: ISimpleContextQualifierProviderCreateParams\n ): Result<SimpleContextQualifierProvider> {\n return captureResult(() => new SimpleContextQualifierProvider(params));\n }\n\n /**\n * Gets a qualifier value by its name, index, or qualifier object.\n * @param nameOrIndexOrQualifier - The {@link QualifierName | qualifier name}, {@link QualifierIndex | index}, or {@link Qualifiers.Qualifier | qualifier object} to look up.\n * @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,\n * or `Failure` with an error message if not found or an error occurs.\n */\n public get(\n nameOrIndexOrQualifier: QualifierName | QualifierIndex | Qualifier\n ): Result<QualifierContextValue> {\n const qualifierName = this._resolveQualifierName(nameOrIndexOrQualifier);\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (qualifierName.isFailure()) {\n return fail(qualifierName.message);\n }\n return this._qualifierValues.get(qualifierName.value);\n }\n\n /**\n * Gets a validated qualifier context value by its name, index, or qualifier object.\n * TODO: Implement validation logic using qualifier collectors.\n * @param nameOrIndexOrQualifier - The {@link QualifierName | qualifier name}, {@link QualifierIndex | index}, or {@link Qualifiers.Qualifier | qualifier object} to look up.\n * @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,\n * or `Failure` with an error message if not found, invalid, or an error occurs.\n */\n public getValidated(\n nameOrIndexOrQualifier: QualifierName | QualifierIndex | Qualifier\n ): Result<QualifierContextValue> {\n const qualifierName = this._resolveQualifierName(nameOrIndexOrQualifier);\n if (qualifierName.isFailure()) {\n return fail(qualifierName.message);\n }\n // TODO: Implement validation logic\n return fail(`getValidated not yet implemented for qualifier \"${qualifierName.value}\"`);\n }\n\n /**\n * Checks if a qualifier value exists with the given name.\n * @param name - The {@link QualifierName | qualifier name} to check.\n * @returns `Success` with `true` if the qualifier value exists, `false` if it doesn't,\n * or `Failure` with an error message if an error occurs during the check.\n */\n public has(name: QualifierName): Result<boolean> {\n return succeed(this._qualifierValues.has(name));\n }\n\n /**\n * Gets all available qualifier names in this context.\n * @returns `Success` with an array of all {@link QualifierName | qualifier names},\n * or `Failure` with an error message if an error occurs.\n */\n public getNames(): Result<ReadonlyArray<QualifierName>> {\n return succeed(Array.from(this._qualifierValues.keys()));\n }\n\n /**\n * Sets a qualifier value in this provider.\n * @param name - The {@link QualifierName | qualifier name} to set.\n * @param value - The {@link QualifierContextValue | qualifier context value} to set.\n * @returns `Success` with the set {@link QualifierContextValue | qualifier context value} if successful,\n * or `Failure` with an error message if not.\n * @public\n */\n public set(name: QualifierName, value: QualifierContextValue): Result<QualifierContextValue> {\n this._qualifierValues.set(name, value);\n return succeed(value);\n }\n\n /**\n * Removes a qualifier value from this provider.\n * @param name - The {@link QualifierName | qualifier name} to remove.\n * @returns `Success` with the removed {@link QualifierContextValue | qualifier context value} if successful,\n * or `Failure` with an error message if not found or an error occurs.\n * @public\n */\n public remove(name: QualifierName): Result<QualifierContextValue> {\n return this._qualifierValues.get(name).onSuccess((value) => {\n this._qualifierValues.delete(name);\n return succeedWithDetail(value, 'success');\n });\n }\n\n /**\n * Gets the number of qualifier values in this provider.\n * @returns The count of qualifier values.\n * @public\n */\n public get size(): number {\n return this._qualifierValues.size;\n }\n\n /**\n * Clears all qualifier values from this provider.\n * @public\n */\n public clear(): void {\n this._qualifierValues.clear();\n }\n\n /**\n * Resolves a qualifier name from a name, index, or qualifier object.\n * @param nameOrIndexOrQualifier - The input to resolve.\n * @returns `Success` with the {@link QualifierName | qualifier name} if successful,\n * or `Failure` with an error message if not found or invalid.\n * @internal\n */\n private _resolveQualifierName(\n nameOrIndexOrQualifier: QualifierName | QualifierIndex | Qualifier\n ): Result<QualifierName> {\n // If it's already a QualifierName (string type with brand)\n if (typeof nameOrIndexOrQualifier === 'string') {\n /* c8 ignore next 1 - functional code path tested but coverage intermittently missed */\n return succeed(nameOrIndexOrQualifier as QualifierName);\n }\n\n // If it's a Qualifier object\n if (\n typeof nameOrIndexOrQualifier === 'object' &&\n nameOrIndexOrQualifier !== null &&\n 'name' in nameOrIndexOrQualifier\n ) {\n return succeed(nameOrIndexOrQualifier.name);\n }\n\n // If it's a QualifierIndex (number type with brand)\n /* c8 ignore next 8 - functional code path tested but coverage intermittently missed */\n if (typeof nameOrIndexOrQualifier === 'number') {\n const qualifier = this.qualifiers.getAt(nameOrIndexOrQualifier as QualifierIndex);\n if (qualifier.isSuccess()) {\n return succeed(qualifier.value.name);\n }\n return fail(`Qualifier not found at index ${nameOrIndexOrQualifier}`);\n }\n\n return fail(`Invalid qualifier parameter: ${nameOrIndexOrQualifier}`);\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"validatingSimpleContextQualifierProvider.d.ts","sourceRoot":"","sources":["../../../../src/packlets/runtime/context/validatingSimpleContextQualifierProvider.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,MAAM,EAAiB,MAAM,eAAe,CAAC;AAEtD,OAAO,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAEL,0CAA0C,EAC3C,MAAM,qCAAqC,CAAC;AAE7C;;;GAGG;AACH,MAAM,WAAW,qDAAqD;IACpE;;OAEG;IACH,UAAU,EAAE,2BAA2B,CAAC;IAExC;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC1C;AAED;;;;;;GAMG;AACH,qBAAa,wCAAyC,SAAQ,8BAA8B;IAC1F;;;OAGG;IACH,SAAgB,UAAU,EAAE,0CAA0C,CAAC;IAEvE;;;OAGG;IACH,SAAS,aAAa,MAAM,EAAE,qDAAqD;IAiBnF;;;;;;OAMG;WACW,MAAM,CAClB,MAAM,EAAE,qDAAqD,GAC5D,MAAM,CAAC,wCAAwC,CAAC;CAGpD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"validatingSimpleContextQualifierProvider.js","sourceRoot":"","sources":["../../../../src/packlets/runtime/context/validatingSimpleContextQualifierProvider.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAAsD;AAGtD,qFAAkF;AAClF,2FAG6C;AAmB7C;;;;;;GAMG;AACH,MAAa,wCAAyC,SAAQ,+DAA8B;IAO1F;;;OAGG;IACH,YAAsB,MAA6D;QACjF,oEAAoE;QACpE,uFAAuF;QACvF,MAAM,eAAe,GAAsD,MAAM,CAAC,eAAe;YAC/F,CAAC,CAAC,MAAM,CAAC,WAAW,CAChB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,KAA8B,CAAC,CAAC,CACpG;YACH,CAAC,CAAC,SAAS,CAAC;QAEd,KAAK,CAAC;YACJ,UAAU,EAAE,MAAM,CAAC,UAAU;YAC7B,eAAe,EAAE,eAAe;SACjC,CAAC,CAAC;QAEH,IAAI,CAAC,UAAU,GAAG,IAAI,qEAAiC,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IAC9E,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,MAAM,CAClB,MAA6D;QAE7D,OAAO,IAAA,wBAAa,EAAC,GAAG,EAAE,CAAC,IAAI,wCAAwC,CAAC,MAAM,CAAC,CAAC,CAAC;IACnF,CAAC;CACF;AAxCD,4FAwCC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Result, captureResult } from '@fgv/ts-utils';\nimport { QualifierContextValue } from '../../common';\nimport { IReadOnlyQualifierCollector } from '../../qualifiers';\nimport { SimpleContextQualifierProvider } from './simpleContextQualifierProvider';\nimport {\n ContextQualifierProviderValidator,\n IReadOnlyContextQualifierProviderValidator\n} from './contextQualifierProviderValidator';\n\n/**\n * Parameters for creating a {@link Runtime.ValidatingSimpleContextQualifierProvider | ValidatingSimpleContextQualifierProvider}.\n * @public\n */\nexport interface IValidatingSimpleContextQualifierProviderCreateParams {\n /**\n * The {@link Qualifiers.IReadOnlyQualifierCollector | readonly qualifier collector} that defines and validates qualifiers.\n */\n qualifiers: IReadOnlyQualifierCollector;\n\n /**\n * Optional record of initial qualifier name-value pairs to populate the provider.\n * Accepts string keys and values which will be converted to strongly-typed values.\n */\n qualifierValues?: Record<string, string>;\n}\n\n/**\n * A {@link Runtime.SimpleContextQualifierProvider | SimpleContextQualifierProvider} with a\n * {@link Runtime.Context.ContextQualifierProviderValidator | validator} property that enables\n * validated use of the underlying provider with string keys and values.\n * This eliminates the need for type casting in consumer code.\n * @public\n */\nexport class ValidatingSimpleContextQualifierProvider extends SimpleContextQualifierProvider {\n /**\n * A {@link Runtime.Context.ContextQualifierProviderValidator | ContextQualifierProviderValidator} which validates\n * string inputs before passing them to this provider.\n */\n public readonly validating: IReadOnlyContextQualifierProviderValidator;\n\n /**\n * Constructor for a {@link Runtime.ValidatingSimpleContextQualifierProvider | ValidatingSimpleContextQualifierProvider} object.\n * @param params - {@link Runtime.IValidatingSimpleContextQualifierProviderCreateParams | Parameters} used to create the provider.\n */\n protected constructor(params: IValidatingSimpleContextQualifierProviderCreateParams) {\n // Convert string values to QualifierContextValue for the base class\n /* c8 ignore next 5 - functional code path tested but coverage intermittently missed */\n const convertedValues: Record<string, QualifierContextValue> | undefined = params.qualifierValues\n ? Object.fromEntries(\n Object.entries(params.qualifierValues).map(([key, value]) => [key, value as QualifierContextValue])\n )\n : undefined;\n\n super({\n qualifiers: params.qualifiers,\n qualifierValues: convertedValues\n });\n\n this.validating = new ContextQualifierProviderValidator({ provider: this });\n }\n\n /**\n * Creates a new {@link Runtime.ValidatingSimpleContextQualifierProvider | ValidatingSimpleContextQualifierProvider} object.\n * @param params - {@link Runtime.IValidatingSimpleContextQualifierProviderCreateParams | Parameters} used to create the provider.\n * @returns `Success` with the new {@link Runtime.ValidatingSimpleContextQualifierProvider | ValidatingSimpleContextQualifierProvider} object if successful,\n * or `Failure` with an error message if not.\n * @public\n */\n public static create(\n params: IValidatingSimpleContextQualifierProviderCreateParams\n ): Result<ValidatingSimpleContextQualifierProvider> {\n return captureResult(() => new ValidatingSimpleContextQualifierProvider(params));\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"iResourceManager.d.ts","sourceRoot":"","sources":["../../../src/packlets/runtime/iResourceManager.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,0BAA0B,EAAE,6BAA6B,EAAE,MAAM,eAAe,CAAC;AAC1F,OAAO,EAAE,iCAAiC,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,wBAAwB,E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AAY,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;CACvE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"iResourceManager.js","sourceRoot":"","sources":["../../../src/packlets/runtime/iResourceManager.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Result, Collections } from '@fgv/ts-utils';\nimport { JsonObject } from '@fgv/ts-json-base';\nimport { ReadOnlyConditionCollector, ReadOnlyConditionSetCollector } from '../conditions';\nimport { ReadOnlyAbstractDecisionCollector, ConcreteDecision } from '../decisions';\nimport { ResourceId, ResourceValueMergeMethod } from '../common';\nimport { ResourceType } from '../resource-types';\nimport { IContextDecl, IValidatedContextDecl } from '../context';\n\n/**\n * Runtime representation of a resource candidate with the minimal data needed for resolution.\n * @public\n */\nexport interface IResourceCandidate {\n /** The JSON value for this candidate */\n readonly json: JsonObject;\n\n /**\n * Indicates if this candidate is a partial resource.\n */\n readonly isPartial: boolean;\n\n /**\n * Specifies the resource type of this candidate.\n */\n readonly mergeMethod: ResourceValueMergeMethod;\n}\n\n/**\n * Interface for a resource that can be used in the runtime layer.\n * This provides the minimal properties needed from a resource without requiring\n * the full Resources layer dependencies.\n * @public\n */\nexport interface IResource {\n /** The resource identifier */\n readonly id: string;\n /** The resource type */\n readonly resourceType: ResourceType;\n /** The decision used to select candidates */\n readonly decision: ConcreteDecision;\n /** The available candidates for this resource */\n readonly candidates: ReadonlyArray<IResourceCandidate>;\n}\n\n/**\n * Interface defining the read-only properties that the runtime resource resolver needs\n * from a resource manager. This abstraction allows the runtime to work with different\n * implementations without requiring the full ResourceManagerBuilder build mechanics.\n * @public\n */\nexport interface IResourceManager {\n /**\n * A {@link Conditions.ReadOnlyConditionCollector | ReadOnlyConditionCollector} which\n * contains the {@link Conditions.Condition | conditions} used by resource candidates.\n */\n readonly conditions: ReadOnlyConditionCollector;\n\n /**\n * A {@link Conditions.ReadOnlyConditionSetCollector | ReadOnlyConditionSetCollector} which\n * contains the {@link Conditions.ConditionSet | condition sets} used by resource candidates.\n */\n readonly conditionSets: ReadOnlyConditionSetCollector;\n\n /**\n * A {@link Decisions.ReadOnlyAbstractDecisionCollector | ReadOnlyAbstractDecisionCollector} which\n * contains the {@link Decisions.Decision | abstract decisions} used by resource candidates.\n */\n readonly decisions: ReadOnlyAbstractDecisionCollector;\n\n /**\n * Gets a built resource by ID for runtime resolution.\n * @param id - The resource identifier\n * @returns Success with the runtime resource if found, Failure otherwise\n */\n getBuiltResource(id: string): Result<IResource>;\n\n /**\n * A read-only result map of all built resources, keyed by resource ID.\n * Resources are built on-demand when accessed and returns Results for error handling.\n */\n readonly builtResources: Collections.IReadOnlyValidatingResultMap<ResourceId, IResource>;\n\n /**\n * The number of resources in this resource manager.\n */\n readonly numResources: number;\n\n /**\n * The number of candidates in this resource manager.\n */\n readonly numCandidates: number;\n\n /**\n * Validates a context declaration against the qualifiers managed by this resource manager.\n * @param context - The context declaration to validate\n * @returns Success with the validated context if successful, Failure otherwise\n */\n validateContext(context: IContextDecl): Result<IValidatedContextDecl>;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packlets/runtime/index.ts"],"names":[],"mappings":"AAsBA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,0CAA0C,CAAC;AACzD,cAAc,oDAAoD,CAAC;AACnE,cAAc,oBAAoB,CAAC;AACnC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAE/B,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,YAAY,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/runtime/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,+DAA6C;AAC7C,qDAAmC;AACnC,2EAAyD;AACzD,qFAAmE;AACnE,qDAAmC;AACnC,iEAA+C;AAC/C,kDAAgC;AAChC,iDAA+B;AAE/B,mDAAqC;AAG5B,0BAAO;AAFhB,8DAAgD;AAE9B,oCAAY","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nexport * from './compiledResourceCollection';\nexport * from './iResourceManager';\nexport * from './context/simpleContextQualifierProvider';\nexport * from './context/validatingSimpleContextQualifierProvider';\nexport * from './resourceResolver';\nexport * from './conditionSetResolutionResult';\nexport * from './cacheListener';\nexport * from './cacheMetrics';\n\nimport * as Context from './context';\nimport * as ResourceTree from './resource-tree';\n\nexport { Context, ResourceTree };\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/packlets/runtime/resource-tree/common.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAExD;;;;;;GAMG;AACH,MAAM,WAAW,yBAAyB,CAAC,CAAC;IAC1C,QAAQ,CAAC,EAAE,EAAE,UAAU,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC;CACxB;AAED;;;;;GAKG;AACH,MAAM,WAAW,2BAA2B,CAAC,CAAC;IAC5C,QAAQ,CAAC,EAAE,EAAE,UAAU,CAA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AC,CAAC,CAAC,CAAC,CAAC;IAE/D;;;;OAIG;IACH,aAAa,CAAC,EAAE,EAAE,GAAG,GAAG,MAAM,CAAC,2BAA2B,CAAC,CAAC,CAAC,CAAC,CAAC;CAChE;AAED;;;GAGG;AACH,MAAM,WAAW,uCAAuC,CAAC,CAAC,CAAE,SAAQ,6BAA6B,CAAC,CAAC,CAAC;IAClG,QAAQ,CAAC,UAAU,EAAE,6BAA6B,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;CACvE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../src/packlets/runtime/resource-tree/common.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { IReadOnlyResultMap, Result } from '@fgv/ts-utils';\nimport { ResourceId, ResourceName } from '../../common';\n\n/**\n * Interface for leaf nodes in a resource tree.\n * Leaf nodes contain resource values and cannot have child nodes.\n * In a valid resource tree, if a path has child resources (e.g., 'app.messages.welcome'),\n * then that path cannot itself be a resource (i.e., 'app' cannot be both a resource and have children).\n * @public\n */\nexport interface IReadOnlyResourceTreeLeaf<T> {\n readonly id: ResourceId;\n readonly name: ResourceName;\n readonly resource: T;\n readonly isLeaf: true;\n readonly isBranch: false;\n readonly isRoot: false;\n}\n\n/**\n * Interface for branch nodes in a resource tree that contain child nodes.\n * Branch nodes organize the tree structure and cannot have resource values.\n * If a path has child resources, it must be a branch and cannot itself be a resource.\n * @public\n */\nexport interface IReadOnlyResourceTreeBranch<T> {\n readonly id: ResourceId;\n readonly name: ResourceName;\n readonly children: IReadOnlyValidatingResourceTreeChildren<T>;\n readonly isLeaf: false;\n readonly isBranch: true;\n readonly isRoot: false;\n}\n\n/**\n * Interface for the root node of a resource tree.\n * @public\n */\nexport interface IReadOnlyResourceTreeRoot<T> {\n readonly children: IReadOnlyValidatingResourceTreeChildren<T>;\n readonly isRoot: true;\n readonly isLeaf: false;\n readonly isBranch: false;\n}\n\n/**\n * Union type representing any node in the resource tree, which can be a leaf or a branch.\n * This allows for flexible handling of different node types in the tree structure.\n * @public\n */\nexport type IReadOnlyResourceTreeNode<T> = IReadOnlyResourceTreeLeaf<T> | IReadOnlyResourceTreeBranch<T>;\n\n/**\n * Interface for a read-only result-based resource tree with navigation methods.\n * @public\n */\nexport interface IReadOnlyResourceTreeChildren<\n T,\n TID extends string = ResourceId,\n TNAME extends string = ResourceName\n> extends IReadOnlyResultMap<ResourceName, IReadOnlyResourceTreeNode<T>> {\n /**\n * Gets a tree node by its full ResourceId path.\n * @param id - The ResourceId path to look up\n * @returns Result containing the node if found, or failure if not found\n */\n getById(id: TID): Result<IReadOnlyResourceTreeNode<T>>;\n\n /**\n * Gets a resource node by its direct name (single component).\n * @param name - The ResourceName to look up\n * @returns Result containing the node if it's a resource, or failure if not found or not a resource\n */\n getResource(name: TNAME): Result<IReadOnlyResourceTreeNode<T>>;\n\n /**\n * Gets a branch node by its direct name (single component).\n * @param name - The ResourceName to look up\n * @returns Result containing the node if it's a branch, or failure if not found or not a branch\n */\n getBranch(name: TNAME): Result<IReadOnlyResourceTreeNode<T>>;\n\n /**\n * Gets a resource leaf node by its full ResourceId path.\n * @param id - The ResourceId path to look up\n * @returns Result containing the leaf if found and is a resource, or failure otherwise\n */\n getResourceById(id: TID): Result<IReadOnlyResourceTreeLeaf<T>>;\n\n /**\n * Gets a branch node by its full ResourceId path.\n * @param id - The ResourceId path to look up\n * @returns Result containing the branch if found and has children, or failure otherwise\n */\n getBranchById(id: TID): Result<IReadOnlyResourceTreeBranch<T>>;\n}\n\n/**\n * A read-only interface for accessing resource tree children using weakly-typed string keys.\n * @public\n */\nexport interface IReadOnlyValidatingResourceTreeChildren<T> extends IReadOnlyResourceTreeChildren<T> {\n readonly validating: IReadOnlyResourceTreeChildren<T, string, string>;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/packlets/runtime/resource-tree/index.ts"],"names":[],"mappings":"AAsBA,cAAc,UAAU,CAAC;AACzB,cAAc,wBAAwB,CAAC;AACvC,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/packlets/runtime/resource-tree/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;AAEH,2CAAyB;AACzB,yDAAuC;AACvC,kEAAgD;AAChD,yDAAuC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nexport * from './common';\nexport * from './resourceTreeChildren';\nexport * from './resourceTreeChildrenValidator';\nexport * from './readOnlyResourceTree';\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"readOnlyResourceTree.d.ts","sourceRoot":"","sources":["../../../../src/packlets/runtime/resource-tree/readOnlyResourceTree.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAqB,MAAM,EAAsC,MAAM,eAAe,CAAC;AAC9F,OAAO,EAAE,UAAU,EAAE,YAAY,EAAW,MAAM,cAAc,CAAC;AACjE,OAAO,EAEL,yBAAyB,EACzB,2BAA2B,EAC3B,yBAAyB,EACzB,uCAAuC,EACxC,MAAM,UAAU,CAAC;AAGlB;;;GAGG;AACH,MAAM,WAAW,qBAAqB,CAAC,CAAC;IACtC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,YAAY,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC;CAClE;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB,CAAC,CAAC;IACtC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAuB,CAAC,CAAC;IACxC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,YAAY,EAAE,oBAAoB,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,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;CA6CxG"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"readOnlyResourceTree.js","sourceRoot":"","sources":["../../../../src/packlets/runtime/resource-tree/readOnlyResourceTree.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAkDH,oEAIC;AAQD,wDAEC;AA9DD,4CAA8F;AAC9F,yCAAiE;AAQjE,iEAAsE;AAgCtE,cAAc;AACd;;;;;GAKG;AACH,SAAgB,4BAA4B,CAC1C,IAAwD;IAExD,OAAO,UAAU,IAAI,IAAI,CAAC;AAC5B,CAAC;AAED;;;;;GAKG;AACH,SAAgB,sBAAsB,CAAI,IAA6B;IACrE,OAAO,UAAU,IAAI,IAAI,IAAI,CAAC,CAAC,UAAU,IAAI,IAAI,CAAC,CAAC;AACrD,CAAC;AAED;;;;GAIG;AACH,MAAa,wBAAwB;IAKnC,IAAW,MAAM;QACf,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAW,QAAQ;QACjB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAW,MAAM;QACf,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACH,YAAsB,IAAkB,EAAE,UAAkC,EAAE,QAAW;QACvF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,EAAE,GAAG,gBAAO,CAAC,eAAe,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;QAC9D,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,MAAM,CAClB,IAAkB,EAClB,UAAkC,EAClC,QAAW;QAEX,OAAO,IAAA,wBAAa,EAAC,GAAG,EAAE,CAAC,IAAI,wBAAwB,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;IACvF,CAAC;C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B,CAAC,WAAW,CAAC,EACnC,CAAC;wBACD,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,uCAAuC,CAAC,CAAC;wBAChE,MAAM;oBACR,CAAC,CAAC,0EAA0E;yBAAM,CAAC;wBACjF,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,yCAAyC,CAAC,CAAC;oBACpE,CAAC;gBACH,CAAC;gBAED,IAAI,4BAA4B,CAAC,WAAW,CAAC,EAAE,CAAC;oBAC9C,IAAI,YAAY,IAAI,WAAW,CAAC,QAAQ,EAAE,CAAC;wBACzC,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,+BAA+B,CAAC,CAAC;oBAC1D,CAAC;yBAAM,CAAC;wBACN,WAAW,CAAC,QAAQ,CAAC,YAAY,CAAC,GAAG,EAAE,QAAQ,EAAE,CAAC;oBACpD,CAAC,CAAC,0EAA0E;gBAC9E,CAAC;qBAAM,CAAC;oBACN,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,uCAAuC,CAAC,CAAC;gBAClE,CAAC;gBACD,OAAO,IAAA,kBAAO,EAAC,WAAW,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC;YACrD,CAAC,CAAC;iBACD,cAAc,CAAC,MAAM,CAAC,CAAC;QAC5B,CAAC;QACD,OAAO,MAAM,CAAC,cAAc,CAAC,IAAA,kBAAO,EAAC,IAAI,CAAC,CAAC,CAAC;IAC9C,CAAC;CACF;AA1HD,4DA0HC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { MessageAggregator, Result, captureResult, mapResults, succeed } from '@fgv/ts-utils';\nimport { ResourceId, ResourceName, Helpers } from '../../common';\nimport {\n IReadOnlyResourceTreeNode,\n IReadOnlyResourceTreeLeaf,\n IReadOnlyResourceTreeBranch,\n IReadOnlyResourceTreeRoot,\n IReadOnlyValidatingResourceTreeChildren\n} from './common';\nimport { ReadOnlyResourceTreeChildren } from './resourceTreeChildren';\n\n/**\n * Interface for initializing a resource tree root with child nodes.\n * @public\n */\nexport interface IResourceTreeRootInit<T> {\n readonly children: Record<ResourceName, ResourceTreeNodeInit<T>>;\n}\n\n/**\n * Interface for initializing a leaf node with a resource value.\n * @public\n */\nexport interface IResourceTreeLeafInit<T> {\n readonly resource: T;\n}\n\n/**\n * Interface for initializing a branch node with child nodes.\n * @public\n */\nexport interface IResourceTreeBranchInit<T> {\n readonly children: Record<ResourceName, ResourceTreeNodeInit<T>>;\n}\n\n/**\n * Union type for tree node initialization data.\n * @public\n */\nexport type ResourceTreeNodeInit<T> = IResourceTreeLeafInit<T> | IResourceTreeBranchInit<T>;\n\n// Type guards\n/**\n * Type guard to determine if an init object represents a branch or root with children.\n * @param init - The initialization object to test\n * @returns True if the init object has children property\n * @public\n */\nexport function isResourceTreeRootOrNodeInit<T>(\n init: ResourceTreeNodeInit<T> | IResourceTreeRootInit<T>\n): init is IResourceTreeBranchInit<T> {\n return 'children' in init;\n}\n\n/**\n * Type guard to determine if an init object represents a leaf node with a resource.\n * @param init - The initialization object to test\n * @returns True if the init object has a resource but no children\n * @public\n */\nexport function isResourceTreeLeafInit<T>(init: ResourceTreeNodeInit<T>): init is IResourceTreeLeafInit<T> {\n return 'resource' in init && !('children' in init);\n}\n\n/**\n * Implementation of a read-only resource tree leaf node that contains a resource value.\n * Leaf nodes represent the actual resources in the tree and cannot have children.\n * @public\n */\nexport class ReadOnlyResourceTreeLeaf<T> implements IReadOnlyResourceTreeLeaf<T> {\n public readonly name: ResourceName;\n public readonly id: ResourceId;\n public readonly resource: T;\n\n public get isRoot(): false {\n return false;\n }\n\n public get isBranch(): false {\n return false;\n }\n\n public get isLeaf(): true {\n return true;\n }\n\n /**\n * Creates a new leaf node. Use the static create method instead.\n * @param name - The name of this node (last segment of the path)\n * @param parentPath - The path to the parent node (undefined for root-level nodes)\n * @param resource - The resource value stored in this leaf\n */\n protected constructor(name: ResourceName, parentPath: ResourceId | undefined, resource: T) {\n this.name = name;\n this.id = Helpers.joinResourceIds(parentPath, name).orThrow();\n this.resource = resource;\n }\n\n /**\n * Creates a new ReadOnlyResourceTreeLeaf instance.\n * @param name - The name of this node (last segment of the path)\n * @param parentPath - The path to the parent node (undefined for root-level nodes)\n * @param resource - The resource value to store in this leaf\n * @returns Result containing the new leaf node or failure if construction fails\n */\n public static create<T>(\n name: ResourceName,\n parentPath: ResourceId | undefined,\n resource: T\n ): Result<ReadOnlyResourceTreeLeaf<T>> {\n return captureResult(() => new ReadOnlyResourceTreeLeaf(name, parentPath, resource));\n }\n}\n\n/**\n * Implementation of a read-only resource tree branch node that contains child nodes.\n * Branch nodes organize other nodes in a hierarchical structure and may optionally contain a resource value.\n * @public\n */\nexport class ReadOnlyResourceTreeBranch<T> implements IReadOnlyResourceTreeBranch<T> {\n public readonly children: IReadOnlyValidatingResourceTreeChildren<T>;\n public readonly name: ResourceName;\n public readonly id: ResourceId;\n\n public get isRoot(): false {\n return false;\n }\n\n public get isBranch(): true {\n return true;\n }\n\n public get isLeaf(): false {\n return false;\n }\n\n /**\n * Creates a new branch node. Use the static create method instead.\n * @param name - The name of this node (last segment of the path)\n * @param parentPath - The path to the parent node (undefined for root-level nodes)\n * @param init - Initialization data containing child nodes\n */\n private constructor(\n name: ResourceName,\n parentPath: ResourceId | undefined,\n init: IResourceTreeBranchInit<T>\n ) {\n this.name = name;\n this.id = Helpers.joinResourceIds(parentPath, name).orThrow();\n\n const children = mapResults<IReadOnlyResourceTreeNode<T>>(\n (\n Array.from(Object.entries(init.children)) as [\n ResourceName,\n IResourceTreeBranchInit<T> | IResourceTreeLeafInit<T>\n ][]\n ).map(([childName, childInit]) => {\n if (isResourceTreeLeafInit(childInit)) {\n return ReadOnlyResourceTreeLeaf.create(childName, this.id, childInit.resource);\n }\n return ReadOnlyResourceTreeBranch.create(childName, this.id, childInit);\n })\n ).orThrow();\n\n this.children = new ReadOnlyResourceTreeChildren(\n this.id,\n children.map((c): [ResourceName, IReadOnlyResourceTreeNode<T>] => [c.name, c])\n );\n }\n\n /**\n * Creates a new ReadOnlyResourceTreeBranch instance.\n * @param childName - The name of this node (last segment of the path)\n * @param path - The path to the parent node (undefined for root-level nodes)\n * @param childInit - Initialization data containing child nodes\n * @returns Result containing the new branch node or failure if construction fails\n */\n public static create<T>(\n childName: ResourceName,\n path: ResourceId | undefined,\n childInit: IResourceTreeBranchInit<T>\n ): Result<ReadOnlyResourceTreeBranch<T>> {\n return captureResult(() => new ReadOnlyResourceTreeBranch(childName, path, childInit));\n }\n}\n\n/**\n * Union type representing any node in a read-only resource tree.\n * @public\n */\nexport type ReadOnlyResourceTreeNode<T> = ReadOnlyResourceTreeBranch<T> | ReadOnlyResourceTreeLeaf<T>;\n\n/**\n * Implementation of a read-only resource tree root that organizes resources hierarchically.\n * The root provides the entry point for tree navigation and resource access by ResourceId paths.\n * @public\n */\nexport class ReadOnlyResourceTreeRoot<T> implements IReadOnlyResourceTreeRoot<T> {\n public readonly children: IReadOnlyValidatingResourceTreeChildren<T>;\n\n public get isRoot(): true {\n return true;\n }\n\n public get isBranch(): false {\n return false;\n }\n\n public get isLeaf(): false {\n return false;\n }\n\n /**\n * Creates a new root node. Use the static create method instead.\n * @param init - Initialization data containing child nodes\n */\n protected constructor(init: IResourceTreeRootInit<T>) {\n const children = mapResults<ReadOnlyResourceTreeBranch<T> | ReadOnlyResourceTreeLeaf<T>>(\n (\n Array.from(Object.entries(init.children)) as [\n ResourceName,\n IResourceTreeBranchInit<T> | IResourceTreeLeafInit<T>\n ][]\n ).map(([childName, childInit]) => {\n if (isResourceTreeLeafInit(childInit)) {\n return ReadOnlyResourceTreeLeaf.create(childName, undefined, childInit.resource);\n }\n return ReadOnlyResourceTreeBranch.create(childName, undefined, childInit);\n })\n ).orThrow();\n\n this.children = new ReadOnlyResourceTreeChildren(\n undefined,\n children.map((c): [ResourceName, IReadOnlyResourceTreeNode<T>] => [c.name, c])\n );\n }\n\n /**\n * Creates a new ReadOnlyResourceTreeRoot from an array of resources.\n * @param resources - Array of [ResourceId, resource] pairs to build the tree from\n * @returns Result containing the new root or failure if construction fails\n */\n public static create<T>(resources: [ResourceId, T][]): Result<ReadOnlyResourceTreeRoot<T>>;\n\n /**\n * Creates a new ReadOnlyResourceTreeRoot from initialization data.\n * @param init - Tree initialization structure\n * @returns Result containing the new root or failure if construction fails\n */\n public static create<T>(init: IResourceTreeRootInit<T>): Result<ReadOnlyResourceTreeRoot<T>>;\n\n /**\n * Creates a new ReadOnlyResourceTreeRoot from either resources or initialization data.\n * @param init - Either an array of [ResourceId, resource] pairs or tree initialization structure\n * @returns Result containing the new root or failure if construction fails\n */\n public static create<T>(\n init: IResourceTreeRootInit<T> | [ResourceId, T][]\n ): Result<ReadOnlyResourceTreeRoot<T>> {\n if (Array.isArray(init)) {\n return ReadOnlyResourceTreeRoot.createResourceTreeInit(init).onSuccess((treeInit) =>\n captureResult(() => new ReadOnlyResourceTreeRoot(treeInit))\n );\n }\n return captureResult(() => new ReadOnlyResourceTreeRoot(init));\n }\n\n /**\n * Converts an array of resources into tree initialization data.\n * Validates that resource paths do not conflict - if a path has child resources,\n * it cannot itself be a resource (e.g., if 'app.messages.welcome' exists, then 'app' cannot be a resource).\n * @param resources - Array of [ResourceId, resource] pairs to convert\n * @returns Result containing the initialization structure or failure if validation fails\n */\n public static createResourceTreeInit<T>(resources: [ResourceId, T][]): Result<IResourceTreeRootInit<T>> {\n const errors: MessageAggregator = new MessageAggregator();\n const root: IResourceTreeRootInit<T> = { children: {} };\n\n for (const [id, resource] of resources) {\n Helpers.splitResourceId(id)\n .onSuccess((pathComponents) => {\n let currentNode: IResourceTreeBranchInit<T> | IResourceTreeRootInit<T> = root;\n const resourceName = pathComponents.pop()!;\n\n for (const nodeName of pathComponents) {\n if (isResourceTreeRootOrNodeInit(currentNode)) {\n if (!(nodeName in currentNode.children)) {\n currentNode.children[nodeName] = { children: {} };\n }\n if (isResourceTreeLeafInit(currentNode.children[nodeName])) {\n errors.addMessage(`${id}: Expected a branch but found a leaf at ${nodeName}.`);\n } else {\n currentNode = currentNode.children[nodeName];\n }\n } /* c8 ignore next 4 - defense in depth, not reachable without chicanery */ else if (\n isResourceTreeLeafInit(currentNode)\n ) {\n errors.addMessage(`${id}: Expected a branch but found a leaf.`);\n break;\n } /* c8 ignore next 3 - defense in depth, not reachable without chicanery */ else {\n errors.addMessage(`${id}: Unexpected structure in resource tree`);\n }\n }\n\n if (isResourceTreeRootOrNodeInit(currentNode)) {\n if (resourceName in currentNode.children) {\n errors.addMessage(`${id}: Duplicate resource at path.`);\n } else {\n currentNode.children[resourceName] = { resource };\n } /* c8 ignore next 3 - defense in depth, not reachable without chicanery */\n } else {\n errors.addMessage(`${id}: Expected a branch but found a leaf.`);\n }\n return succeed(currentNode.children[resourceName]);\n })\n .aggregateError(errors);\n }\n return errors.returnOrReport(succeed(root));\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"resourceTreeChildren.d.ts","sourceRoot":"","sources":["../../../../src/packlets/runtime/resource-tree/resourceTreeChildren.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAe,MAAM,EAAE,SAAS,EAAiB,MAAM,eAAe,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,YAAY,EAAW,MAAM,cAAc,CAAC;AACjE,OAAO,EACL,2BAA2B,EAC3B,6BAA6B,EAC7B,yBAAyB,EACzB,yBAAyB,EACzB,uCAAuC,EACxC,MAAM,UAAU,CAAC;AAGlB;;;;GAIG;AACH,qBAAa,4BAA4B,CAAC,CAAC,CACzC,SAAQ,SAAS,CAAC,YAAY,EAAE,yBAAyB,CAAC,CAAC,CAAC,CAC5D,YAAW,uCAAuC,CAAC,CAAC,CAAC;IAErD,SAAS,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,CAAC;IAChC,UAAU,EAAE,6BAA6B,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAEpE;;;;OAIG;gBACgB,IAAI,EAAE,UAAU,GAAG,SAAS,EAAE,OAAO,EAAE,CAAC,YAAY,EAAE,yBAAyB,CAAC,CAAC,CAAC,CAAC,EAAE;IAMjG,WAAW,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC;IAWrE,SAAS,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC;IAWnE,OAAO,CAAC,EAAE,EAAE,UAAU,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC;IAqB7D,eAAe,CAAC,EAAE,EAAE,UAAU,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC;IAarE,aAAa,CAAC,EAAE,EAAE,UAAU,GAAG,MAAM,CAAC,2BAA2B,CAAC,CAAC,CAAC,CAAC;CAY7E"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"resourceTreeChildren.js","sourceRoot":"","sources":["../../../../src/packlets/runtime/resource-tree/resourceTreeChildren.ts"],"names":[],"mappings":";A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EAAE,CAAC;gBAChB,OAAO,IAAA,kBAAO,EAAC,IAAoC,CAAC,CAAC,UAAU,CAC7D,SAAS,CACV,CAAC;YACJ,CAAC;YACD,OAAO,IAAA,eAAI,EACT,GAAG,EAAE,mBAAmB,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,CAC/D,CAAC,UAAU,CAAoC,SAAS,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;IACL,CAAC;IAEM,aAAa,CAAC,EAAc;QACjC,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE;YACzC,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAClB,OAAO,IAAA,kBAAO,EAAC,IAAsC,CAAC,CAAC,UAAU,CAC/D,SAAS,CACV,CAAC;YACJ,CAAC;YACD,OAAO,IAAA,eAAI,EACT,GAAG,EAAE,iBAAiB,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,CAC7D,CAAC,UAAU,CAAoC,SAAS,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAtFD,oEAsFC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Collections, Result, ResultMap, fail, succeed } from '@fgv/ts-utils';\nimport { ResourceId, ResourceName, Helpers } from '../../common';\nimport {\n IReadOnlyResourceTreeBranch,\n IReadOnlyResourceTreeChildren,\n IReadOnlyResourceTreeLeaf,\n IReadOnlyResourceTreeNode,\n IReadOnlyValidatingResourceTreeChildren\n} from './common';\nimport { ResourceTreeChildrenValidator } from './resourceTreeChildrenValidator';\n\n/**\n * Implementation of a result-based resource tree that provides hierarchical access to resources.\n * Extends ResultMap to provide collection-like access while adding tree-specific navigation methods.\n * @public\n */\nexport class ReadOnlyResourceTreeChildren<T>\n extends ResultMap<ResourceName, IReadOnlyResourceTreeNode<T>>\n implements IReadOnlyValidatingResourceTreeChildren<T>\n{\n protected path: ResourceId | undefined;\n public validating: IReadOnlyResourceTreeChildren<T, string, string>;\n\n /**\n * Creates a new ReadOnlyResourceTreeChildren instance.\n * @param path - The path to this tree node (undefined for root)\n * @param entries - Array of [name, node] tuples to populate the tree\n */\n public constructor(path: ResourceId | undefined, entries: [ResourceName, IReadOnlyResourceTreeNode<T>][]) {\n super(entries);\n this.path = path;\n this.validating = new ResourceTreeChildrenValidator<T>(this);\n }\n\n public getResource(name: ResourceName): Result<IReadOnlyResourceTreeNode<T>> {\n return this.get(name).onSuccess((node) => {\n if (node.isLeaf) {\n return succeed(node).withDetail<Collections.ResultMapResultDetail>('success');\n }\n return fail<IReadOnlyResourceTreeNode<T>>(\n `${name}: not a resource${this.path ? ` in ${this.path}` : ''}.`\n ).withDetail<Collections.ResultMapResultDetail>('failure');\n });\n }\n\n public getBranch(name: ResourceName): Result<IReadOnlyResourceTreeNode<T>> {\n return this.get(name).onSuccess((node) => {\n if (node.isBranch) {\n return succeed(node).withDetail<Collections.ResultMapResultDetail>('success');\n }\n return fail<IReadOnlyResourceTreeNode<T>>(\n `${name}: not a branch${this.path ? ` in ${this.path}` : ''}.`\n ).withDetail<Collections.ResultMapResultDetail>('failure');\n });\n }\n\n public getById(id: ResourceId): Result<IReadOnlyResourceTreeNode<T>> {\n return Helpers.splitResourceId(id).onSuccess((names) => {\n let name = names.shift();\n if (name !== undefined) {\n let node = this.get(name).orDefault();\n while (node) {\n name = names.shift();\n if (name === undefined) {\n return succeed(node);\n }\n if (node.isLeaf) {\n /* c8 ignore next 1 - defense in depth */\n return fail(`${id}: resource not found${this.path ? ` in ${this.path}` : ''}.`);\n }\n node = (node as IReadOnlyResourceTreeBranch<T>).children.get(name).orDefault();\n }\n }\n return fail(`${id}: resource not found${this.path ? ` in ${this.path}` : ''}.`);\n });\n }\n\n public getResourceById(id: ResourceId): Result<IReadOnlyResourceTreeLeaf<T>> {\n return this.getById(id).onSuccess((node) => {\n if (node.isLeaf) {\n return succeed(node as IReadOnlyResourceTreeLeaf<T>).withDetail<Collections.ResultMapResultDetail>(\n 'success'\n );\n }\n return fail<IReadOnlyResourceTreeLeaf<T>>(\n `${id}: not a resource${this.path ? ` in ${this.path}` : ''}.`\n ).withDetail<Collections.ResultMapResultDetail>('failure');\n });\n }\n\n public getBranchById(id: ResourceId): Result<IReadOnlyResourceTreeBranch<T>> {\n return this.getById(id).onSuccess((node) => {\n if (node.isBranch) {\n return succeed(node as IReadOnlyResourceTreeBranch<T>).withDetail<Collections.ResultMapResultDetail>(\n 'success'\n );\n }\n return fail<IReadOnlyResourceTreeBranch<T>>(\n `${id}: not a branch${this.path ? ` in ${this.path}` : ''}.`\n ).withDetail<Collections.ResultMapResultDetail>('failure');\n });\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"resourceTreeChildrenVal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