@fgv/ts-res 5.1.0-3 → 5.1.0-30

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 (545) hide show
  1. package/dist/index.browser.js.map +1 -0
  2. package/dist/index.js.map +1 -0
  3. package/dist/packlets/bundle/bundleBuilder.js.map +1 -0
  4. package/dist/packlets/bundle/bundleLoader.js.map +1 -0
  5. package/dist/packlets/bundle/bundleNormalizer.js.map +1 -0
  6. package/dist/packlets/bundle/bundleUtils.js.map +1 -0
  7. package/dist/packlets/bundle/convert.js.map +1 -0
  8. package/dist/packlets/bundle/index.js.map +1 -0
  9. package/dist/packlets/bundle/model.js.map +1 -0
  10. package/dist/packlets/common/conditions.js.map +1 -0
  11. package/dist/packlets/common/convert.js.map +1 -0
  12. package/dist/packlets/common/helpers/conditions.js.map +1 -0
  13. package/dist/packlets/common/helpers/context.js.map +1 -0
  14. package/dist/packlets/common/helpers/index.js.map +1 -0
  15. package/dist/packlets/common/helpers/qualifierDefaultValues.js.map +1 -0
  16. package/dist/packlets/common/helpers/resources.js +2 -4
  17. package/dist/packlets/common/helpers/resources.js.map +1 -0
  18. package/dist/packlets/common/index.js.map +1 -0
  19. package/dist/packlets/common/resources.js.map +1 -0
  20. package/dist/packlets/common/validate/conditions.js +4 -4
  21. package/dist/packlets/common/validate/conditions.js.map +1 -0
  22. package/dist/packlets/common/validate/index.js.map +1 -0
  23. package/dist/packlets/common/validate/regularExpressions.js +2 -2
  24. package/dist/packlets/common/validate/regularExpressions.js.map +1 -0
  25. package/dist/packlets/common/validate/resources.js +1 -1
  26. package/dist/packlets/common/validate/resources.js.map +1 -0
  27. package/dist/packlets/conditions/condition.js +3 -7
  28. package/dist/packlets/conditions/condition.js.map +1 -0
  29. package/dist/packlets/conditions/conditionCollector.js.map +1 -0
  30. package/dist/packlets/conditions/conditionDecls.js.map +1 -0
  31. package/dist/packlets/conditions/conditionSet.js +14 -5
  32. package/dist/packlets/conditions/conditionSet.js.map +1 -0
  33. package/dist/packlets/conditions/conditionSetCollector.js.map +1 -0
  34. package/dist/packlets/conditions/conditionSetDecls.js.map +1 -0
  35. package/dist/packlets/conditions/conditionToken.js.map +1 -0
  36. package/dist/packlets/conditions/convert/conditionSetDecls.js +50 -6
  37. package/dist/packlets/conditions/convert/conditionSetDecls.js.map +1 -0
  38. package/dist/packlets/conditions/convert/decls.js +61 -5
  39. package/dist/packlets/conditions/convert/decls.js.map +1 -0
  40. package/dist/packlets/conditions/convert/index.js.map +1 -0
  41. package/dist/packlets/conditions/index.js.map +1 -0
  42. package/dist/packlets/config/common.js.map +1 -0
  43. package/dist/packlets/config/configInitFactory.js.map +1 -0
  44. package/dist/packlets/config/convert.js.map +1 -0
  45. package/dist/packlets/config/index.browser.js.map +1 -0
  46. package/dist/packlets/config/index.js.map +1 -0
  47. package/dist/packlets/config/json.js.map +1 -0
  48. package/dist/packlets/config/predefined/default.js.map +1 -0
  49. package/dist/packlets/config/predefined/extended.js.map +1 -0
  50. package/dist/packlets/config/predefined/index.js.map +1 -0
  51. package/dist/packlets/config/systemConfiguration.js.map +1 -0
  52. package/dist/packlets/context/contextDecls.js.map +1 -0
  53. package/dist/packlets/context/contextToken.js.map +1 -0
  54. package/dist/packlets/context/convert/decls.js.map +1 -0
  55. package/dist/packlets/context/convert/index.js.map +1 -0
  56. package/dist/packlets/context/index.js.map +1 -0
  57. package/dist/packlets/decisions/abstractDecision.js.map +1 -0
  58. package/dist/packlets/decisions/abstractDecisionCollector.js.map +1 -0
  59. package/dist/packlets/decisions/candidate.js.map +1 -0
  60. package/dist/packlets/decisions/common.js.map +1 -0
  61. package/dist/packlets/decisions/concreteDecision.js.map +1 -0
  62. package/dist/packlets/decisions/decision.js +1 -1
  63. package/dist/packlets/decisions/decision.js.map +1 -0
  64. package/dist/packlets/decisions/index.js.map +1 -0
  65. package/dist/packlets/import/fsItem.js +1 -4
  66. package/dist/packlets/import/fsItem.js.map +1 -0
  67. package/dist/packlets/import/importContext.js +3 -3
  68. package/dist/packlets/import/importContext.js.map +1 -0
  69. package/dist/packlets/import/importManager.js +7 -3
  70. package/dist/packlets/import/importManager.js.map +1 -0
  71. package/dist/packlets/import/importable.js.map +1 -0
  72. package/dist/packlets/import/importers/collectionImporter.js +2 -2
  73. package/dist/packlets/import/importers/collectionImporter.js.map +1 -0
  74. package/dist/packlets/import/importers/fsItemImporter.js +30 -14
  75. package/dist/packlets/import/importers/fsItemImporter.js.map +1 -0
  76. package/dist/packlets/import/importers/importer.js.map +1 -0
  77. package/dist/packlets/import/importers/index.browser.js.map +1 -0
  78. package/dist/packlets/import/importers/index.js.map +1 -0
  79. package/dist/packlets/import/importers/jsonImporter.js +2 -2
  80. package/dist/packlets/import/importers/jsonImporter.js.map +1 -0
  81. package/dist/packlets/import/importers/pathImporter.js +1 -1
  82. package/dist/packlets/import/importers/pathImporter.js.map +1 -0
  83. package/dist/packlets/import/index.browser.js.map +1 -0
  84. package/dist/packlets/import/index.js.map +1 -0
  85. package/dist/packlets/qualifier-types/config/convert.js.map +1 -0
  86. package/dist/packlets/qualifier-types/config/index.js.map +1 -0
  87. package/dist/packlets/qualifier-types/config/json.js.map +1 -0
  88. package/dist/packlets/qualifier-types/convert.js.map +1 -0
  89. package/dist/packlets/qualifier-types/helpers.js.map +1 -0
  90. package/dist/packlets/qualifier-types/index.js.map +1 -0
  91. package/dist/packlets/qualifier-types/languageQualifierType.js +6 -7
  92. package/dist/packlets/qualifier-types/languageQualifierType.js.map +1 -0
  93. package/dist/packlets/qualifier-types/literalQualifierType.js +7 -10
  94. package/dist/packlets/qualifier-types/literalQualifierType.js.map +1 -0
  95. package/dist/packlets/qualifier-types/literalValueHierarchy.js.map +1 -0
  96. package/dist/packlets/qualifier-types/qualifierType.js +12 -13
  97. package/dist/packlets/qualifier-types/qualifierType.js.map +1 -0
  98. package/dist/packlets/qualifier-types/qualifierTypeCollector.js.map +1 -0
  99. package/dist/packlets/qualifier-types/territoryQualifierType.js +5 -5
  100. package/dist/packlets/qualifier-types/territoryQualifierType.js.map +1 -0
  101. package/dist/packlets/qualifiers/convert/decls.js.map +1 -0
  102. package/dist/packlets/qualifiers/convert/index.js.map +1 -0
  103. package/dist/packlets/qualifiers/convert/qualifier.js.map +1 -0
  104. package/dist/packlets/qualifiers/index.js.map +1 -0
  105. package/dist/packlets/qualifiers/qualifier.js +6 -7
  106. package/dist/packlets/qualifiers/qualifier.js.map +1 -0
  107. package/dist/packlets/qualifiers/qualifierCollector.js +153 -9
  108. package/dist/packlets/qualifiers/qualifierCollector.js.map +1 -0
  109. package/dist/packlets/qualifiers/qualifierDecl.js.map +1 -0
  110. package/dist/packlets/qualifiers/qualifierDefaultValueDecls.js.map +1 -0
  111. package/dist/packlets/qualifiers/qualifierDefaultValueToken.js.map +1 -0
  112. package/dist/packlets/resource-json/compiled/common.js.map +1 -0
  113. package/dist/packlets/resource-json/compiled/convert.js.map +1 -0
  114. package/dist/packlets/resource-json/compiled/index.js.map +1 -0
  115. package/dist/packlets/resource-json/compiled/json.js.map +1 -0
  116. package/dist/packlets/resource-json/convert.js +225 -0
  117. package/dist/packlets/resource-json/convert.js.map +1 -0
  118. package/dist/packlets/resource-json/helpers.js.map +1 -0
  119. package/dist/packlets/resource-json/index.js.map +1 -0
  120. package/dist/packlets/resource-json/json.js +2 -2
  121. package/dist/packlets/resource-json/json.js.map +1 -0
  122. package/dist/packlets/resource-json/normalized.js.map +1 -0
  123. package/dist/packlets/resource-json/resourceDeclCollection.js +1 -1
  124. package/dist/packlets/resource-json/resourceDeclCollection.js.map +1 -0
  125. package/dist/packlets/resource-json/resourceDeclContainer.js.map +1 -0
  126. package/dist/packlets/resource-json/resourceDeclTree.js +1 -1
  127. package/dist/packlets/resource-json/resourceDeclTree.js.map +1 -0
  128. package/dist/packlets/resource-types/config/convert.js.map +1 -0
  129. package/dist/packlets/resource-types/config/index.js.map +1 -0
  130. package/dist/packlets/resource-types/config/json.js.map +1 -0
  131. package/dist/packlets/resource-types/helpers.js.map +1 -0
  132. package/dist/packlets/resource-types/index.js.map +1 -0
  133. package/dist/packlets/resource-types/jsonResourceType.js +2 -2
  134. package/dist/packlets/resource-types/jsonResourceType.js.map +1 -0
  135. package/dist/packlets/resource-types/resourceType.js +2 -2
  136. package/dist/packlets/resource-types/resourceType.js.map +1 -0
  137. package/dist/packlets/resource-types/resourceTypeCollector.js.map +1 -0
  138. package/dist/packlets/resources/candidateReducer.js.map +1 -0
  139. package/dist/packlets/resources/candidateValue.js.map +1 -0
  140. package/dist/packlets/resources/candidateValueCollector.js.map +1 -0
  141. package/dist/packlets/resources/common.js.map +1 -0
  142. package/dist/packlets/resources/deltaGenerator.js.map +1 -0
  143. package/dist/packlets/resources/index.js.map +1 -0
  144. package/dist/packlets/resources/resource.js.map +1 -0
  145. package/dist/packlets/resources/resourceBuilder.js +2 -2
  146. package/dist/packlets/resources/resourceBuilder.js.map +1 -0
  147. package/dist/packlets/resources/resourceCandidate.js.map +1 -0
  148. package/dist/packlets/resources/resourceManagerBuilder.js +5 -5
  149. package/dist/packlets/resources/resourceManagerBuilder.js.map +1 -0
  150. package/dist/packlets/runtime/cacheListener.js.map +1 -0
  151. package/dist/packlets/runtime/cacheMetrics.js.map +1 -0
  152. package/dist/packlets/runtime/compiledResourceCollection.js +5 -5
  153. package/dist/packlets/runtime/compiledResourceCollection.js.map +1 -0
  154. package/dist/packlets/runtime/conditionSetResolutionResult.js.map +1 -0
  155. package/dist/packlets/runtime/context/contextQualifierProvider.js.map +1 -0
  156. package/dist/packlets/runtime/context/contextQualifierProviderValidator.js.map +1 -0
  157. package/dist/packlets/runtime/context/index.js.map +1 -0
  158. package/dist/packlets/runtime/context/simpleContextQualifierProvider.js +3 -0
  159. package/dist/packlets/runtime/context/simpleContextQualifierProvider.js.map +1 -0
  160. package/dist/packlets/runtime/context/validatingSimpleContextQualifierProvider.js +3 -5
  161. package/dist/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +1 -0
  162. package/dist/packlets/runtime/iResourceManager.js.map +1 -0
  163. package/dist/packlets/runtime/index.js.map +1 -0
  164. package/dist/packlets/runtime/resource-tree/common.js.map +1 -0
  165. package/dist/packlets/runtime/resource-tree/index.js.map +1 -0
  166. package/dist/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +1 -0
  167. package/dist/packlets/runtime/resource-tree/resourceTreeChildren.js.map +1 -0
  168. package/dist/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +1 -0
  169. package/dist/packlets/runtime/resourceResolver.js.map +1 -0
  170. package/dist/packlets/runtime/resourceTreeResolver.js.map +1 -0
  171. package/dist/packlets/runtime/validate.js.map +1 -0
  172. package/dist/packlets/zip-archive/convert.js.map +1 -0
  173. package/dist/packlets/zip-archive/index.browser.js.map +1 -0
  174. package/dist/packlets/zip-archive/index.js.map +1 -0
  175. package/dist/packlets/zip-archive/json.js.map +1 -0
  176. package/dist/packlets/zip-archive/types.js.map +1 -0
  177. package/dist/packlets/zip-archive/zipArchiveCreator.js.map +1 -0
  178. package/dist/packlets/zip-archive/zipArchiveFormat.js.map +1 -0
  179. package/dist/packlets/zip-archive/zipArchiveLoader.js.map +1 -0
  180. package/dist/ts-res.d.ts +576 -164
  181. package/dist/tsdoc-metadata.json +1 -1
  182. package/lib/index.browser.d.ts.map +1 -0
  183. package/lib/index.browser.js.map +1 -0
  184. package/lib/index.d.ts.map +1 -0
  185. package/lib/index.js.map +1 -0
  186. package/lib/packlets/bundle/bundleBuilder.d.ts.map +1 -0
  187. package/lib/packlets/bundle/bundleBuilder.js.map +1 -0
  188. package/lib/packlets/bundle/bundleLoader.d.ts.map +1 -0
  189. package/lib/packlets/bundle/bundleLoader.js.map +1 -0
  190. package/lib/packlets/bundle/bundleNormalizer.d.ts.map +1 -0
  191. package/lib/packlets/bundle/bundleNormalizer.js.map +1 -0
  192. package/lib/packlets/bundle/bundleUtils.d.ts.map +1 -0
  193. package/lib/packlets/bundle/bundleUtils.js.map +1 -0
  194. package/lib/packlets/bundle/convert.d.ts.map +1 -0
  195. package/lib/packlets/bundle/convert.js.map +1 -0
  196. package/lib/packlets/bundle/index.d.ts.map +1 -0
  197. package/lib/packlets/bundle/index.js.map +1 -0
  198. package/lib/packlets/bundle/model.d.ts.map +1 -0
  199. package/lib/packlets/bundle/model.js.map +1 -0
  200. package/lib/packlets/common/conditions.d.ts.map +1 -0
  201. package/lib/packlets/common/conditions.js.map +1 -0
  202. package/lib/packlets/common/convert.d.ts.map +1 -0
  203. package/lib/packlets/common/convert.js.map +1 -0
  204. package/lib/packlets/common/helpers/conditions.d.ts.map +1 -0
  205. package/lib/packlets/common/helpers/conditions.js.map +1 -0
  206. package/lib/packlets/common/helpers/context.d.ts.map +1 -0
  207. package/lib/packlets/common/helpers/context.js.map +1 -0
  208. package/lib/packlets/common/helpers/index.d.ts.map +1 -0
  209. package/lib/packlets/common/helpers/index.js.map +1 -0
  210. package/lib/packlets/common/helpers/qualifierDefaultValues.d.ts.map +1 -0
  211. package/lib/packlets/common/helpers/qualifierDefaultValues.js.map +1 -0
  212. package/lib/packlets/common/helpers/resources.d.ts +2 -4
  213. package/lib/packlets/common/helpers/resources.d.ts.map +1 -0
  214. package/lib/packlets/common/helpers/resources.js +2 -4
  215. package/lib/packlets/common/helpers/resources.js.map +1 -0
  216. package/lib/packlets/common/index.d.ts.map +1 -0
  217. package/lib/packlets/common/index.js.map +1 -0
  218. package/lib/packlets/common/resources.d.ts.map +1 -0
  219. package/lib/packlets/common/resources.js.map +1 -0
  220. package/lib/packlets/common/validate/conditions.d.ts +4 -4
  221. package/lib/packlets/common/validate/conditions.d.ts.map +1 -0
  222. package/lib/packlets/common/validate/conditions.js +4 -4
  223. package/lib/packlets/common/validate/conditions.js.map +1 -0
  224. package/lib/packlets/common/validate/index.d.ts.map +1 -0
  225. package/lib/packlets/common/validate/index.js.map +1 -0
  226. package/lib/packlets/common/validate/regularExpressions.d.ts +2 -2
  227. package/lib/packlets/common/validate/regularExpressions.d.ts.map +1 -0
  228. package/lib/packlets/common/validate/regularExpressions.js +2 -2
  229. package/lib/packlets/common/validate/regularExpressions.js.map +1 -0
  230. package/lib/packlets/common/validate/resources.d.ts +1 -1
  231. package/lib/packlets/common/validate/resources.d.ts.map +1 -0
  232. package/lib/packlets/common/validate/resources.js +1 -1
  233. package/lib/packlets/common/validate/resources.js.map +1 -0
  234. package/lib/packlets/conditions/condition.d.ts +3 -7
  235. package/lib/packlets/conditions/condition.d.ts.map +1 -0
  236. package/lib/packlets/conditions/condition.js +3 -7
  237. package/lib/packlets/conditions/condition.js.map +1 -0
  238. package/lib/packlets/conditions/conditionCollector.d.ts.map +1 -0
  239. package/lib/packlets/conditions/conditionCollector.js.map +1 -0
  240. package/lib/packlets/conditions/conditionDecls.d.ts +6 -1
  241. package/lib/packlets/conditions/conditionDecls.d.ts.map +1 -0
  242. package/lib/packlets/conditions/conditionDecls.js.map +1 -0
  243. package/lib/packlets/conditions/conditionSet.d.ts.map +1 -0
  244. package/lib/packlets/conditions/conditionSet.js +14 -5
  245. package/lib/packlets/conditions/conditionSet.js.map +1 -0
  246. package/lib/packlets/conditions/conditionSetCollector.d.ts.map +1 -0
  247. package/lib/packlets/conditions/conditionSetCollector.js.map +1 -0
  248. package/lib/packlets/conditions/conditionSetDecls.d.ts +7 -2
  249. package/lib/packlets/conditions/conditionSetDecls.d.ts.map +1 -0
  250. package/lib/packlets/conditions/conditionSetDecls.js.map +1 -0
  251. package/lib/packlets/conditions/conditionToken.d.ts.map +1 -0
  252. package/lib/packlets/conditions/conditionToken.js.map +1 -0
  253. package/lib/packlets/conditions/convert/conditionSetDecls.d.ts +30 -2
  254. package/lib/packlets/conditions/convert/conditionSetDecls.d.ts.map +1 -0
  255. package/lib/packlets/conditions/convert/conditionSetDecls.js +51 -5
  256. package/lib/packlets/conditions/convert/conditionSetDecls.js.map +1 -0
  257. package/lib/packlets/conditions/convert/decls.d.ts +39 -3
  258. package/lib/packlets/conditions/convert/decls.d.ts.map +1 -0
  259. package/lib/packlets/conditions/convert/decls.js +63 -5
  260. package/lib/packlets/conditions/convert/decls.js.map +1 -0
  261. package/lib/packlets/conditions/convert/index.d.ts.map +1 -0
  262. package/lib/packlets/conditions/convert/index.js.map +1 -0
  263. package/lib/packlets/conditions/index.d.ts.map +1 -0
  264. package/lib/packlets/conditions/index.js.map +1 -0
  265. package/lib/packlets/config/common.d.ts.map +1 -0
  266. package/lib/packlets/config/common.js.map +1 -0
  267. package/lib/packlets/config/configInitFactory.d.ts.map +1 -0
  268. package/lib/packlets/config/configInitFactory.js.map +1 -0
  269. package/lib/packlets/config/convert.d.ts.map +1 -0
  270. package/lib/packlets/config/convert.js.map +1 -0
  271. package/lib/packlets/config/index.browser.d.ts.map +1 -0
  272. package/lib/packlets/config/index.browser.js.map +1 -0
  273. package/lib/packlets/config/index.d.ts.map +1 -0
  274. package/lib/packlets/config/index.js.map +1 -0
  275. package/lib/packlets/config/json.d.ts.map +1 -0
  276. package/lib/packlets/config/json.js.map +1 -0
  277. package/lib/packlets/config/predefined/default.d.ts.map +1 -0
  278. package/lib/packlets/config/predefined/default.js.map +1 -0
  279. package/lib/packlets/config/predefined/extended.d.ts.map +1 -0
  280. package/lib/packlets/config/predefined/extended.js.map +1 -0
  281. package/lib/packlets/config/predefined/index.d.ts.map +1 -0
  282. package/lib/packlets/config/predefined/index.js.map +1 -0
  283. package/lib/packlets/config/systemConfiguration.d.ts.map +1 -0
  284. package/lib/packlets/config/systemConfiguration.js.map +1 -0
  285. package/lib/packlets/context/contextDecls.d.ts.map +1 -0
  286. package/lib/packlets/context/contextDecls.js.map +1 -0
  287. package/lib/packlets/context/contextToken.d.ts.map +1 -0
  288. package/lib/packlets/context/contextToken.js.map +1 -0
  289. package/lib/packlets/context/convert/decls.d.ts.map +1 -0
  290. package/lib/packlets/context/convert/decls.js.map +1 -0
  291. package/lib/packlets/context/convert/index.d.ts.map +1 -0
  292. package/lib/packlets/context/convert/index.js.map +1 -0
  293. package/lib/packlets/context/index.d.ts.map +1 -0
  294. package/lib/packlets/context/index.js.map +1 -0
  295. package/lib/packlets/decisions/abstractDecision.d.ts.map +1 -0
  296. package/lib/packlets/decisions/abstractDecision.js.map +1 -0
  297. package/lib/packlets/decisions/abstractDecisionCollector.d.ts.map +1 -0
  298. package/lib/packlets/decisions/abstractDecisionCollector.js.map +1 -0
  299. package/lib/packlets/decisions/candidate.d.ts.map +1 -0
  300. package/lib/packlets/decisions/candidate.js.map +1 -0
  301. package/lib/packlets/decisions/common.d.ts.map +1 -0
  302. package/lib/packlets/decisions/common.js.map +1 -0
  303. package/lib/packlets/decisions/concreteDecision.d.ts.map +1 -0
  304. package/lib/packlets/decisions/concreteDecision.js.map +1 -0
  305. package/lib/packlets/decisions/decision.d.ts +1 -1
  306. package/lib/packlets/decisions/decision.d.ts.map +1 -0
  307. package/lib/packlets/decisions/decision.js +1 -1
  308. package/lib/packlets/decisions/decision.js.map +1 -0
  309. package/lib/packlets/decisions/index.d.ts.map +1 -0
  310. package/lib/packlets/decisions/index.js.map +1 -0
  311. package/lib/packlets/import/fsItem.d.ts +1 -4
  312. package/lib/packlets/import/fsItem.d.ts.map +1 -0
  313. package/lib/packlets/import/fsItem.js +1 -4
  314. package/lib/packlets/import/fsItem.js.map +1 -0
  315. package/lib/packlets/import/importContext.d.ts +5 -5
  316. package/lib/packlets/import/importContext.d.ts.map +1 -0
  317. package/lib/packlets/import/importContext.js +3 -3
  318. package/lib/packlets/import/importContext.js.map +1 -0
  319. package/lib/packlets/import/importManager.d.ts +15 -1
  320. package/lib/packlets/import/importManager.d.ts.map +1 -0
  321. package/lib/packlets/import/importManager.js +7 -3
  322. package/lib/packlets/import/importManager.js.map +1 -0
  323. package/lib/packlets/import/importable.d.ts.map +1 -0
  324. package/lib/packlets/import/importable.js.map +1 -0
  325. package/lib/packlets/import/importers/collectionImporter.d.ts +2 -2
  326. package/lib/packlets/import/importers/collectionImporter.d.ts.map +1 -0
  327. package/lib/packlets/import/importers/collectionImporter.js +2 -2
  328. package/lib/packlets/import/importers/collectionImporter.js.map +1 -0
  329. package/lib/packlets/import/importers/fsItemImporter.d.ts +16 -2
  330. package/lib/packlets/import/importers/fsItemImporter.d.ts.map +1 -0
  331. package/lib/packlets/import/importers/fsItemImporter.js +29 -13
  332. package/lib/packlets/import/importers/fsItemImporter.js.map +1 -0
  333. package/lib/packlets/import/importers/importer.d.ts.map +1 -0
  334. package/lib/packlets/import/importers/importer.js.map +1 -0
  335. package/lib/packlets/import/importers/index.browser.d.ts.map +1 -0
  336. package/lib/packlets/import/importers/index.browser.js.map +1 -0
  337. package/lib/packlets/import/importers/index.d.ts.map +1 -0
  338. package/lib/packlets/import/importers/index.js.map +1 -0
  339. package/lib/packlets/import/importers/jsonImporter.d.ts +2 -2
  340. package/lib/packlets/import/importers/jsonImporter.d.ts.map +1 -0
  341. package/lib/packlets/import/importers/jsonImporter.js +2 -2
  342. package/lib/packlets/import/importers/jsonImporter.js.map +1 -0
  343. package/lib/packlets/import/importers/pathImporter.d.ts +1 -1
  344. package/lib/packlets/import/importers/pathImporter.d.ts.map +1 -0
  345. package/lib/packlets/import/importers/pathImporter.js +1 -1
  346. package/lib/packlets/import/importers/pathImporter.js.map +1 -0
  347. package/lib/packlets/import/index.browser.d.ts.map +1 -0
  348. package/lib/packlets/import/index.browser.js.map +1 -0
  349. package/lib/packlets/import/index.d.ts.map +1 -0
  350. package/lib/packlets/import/index.js.map +1 -0
  351. package/lib/packlets/qualifier-types/config/convert.d.ts.map +1 -0
  352. package/lib/packlets/qualifier-types/config/convert.js.map +1 -0
  353. package/lib/packlets/qualifier-types/config/index.d.ts.map +1 -0
  354. package/lib/packlets/qualifier-types/config/index.js.map +1 -0
  355. package/lib/packlets/qualifier-types/config/json.d.ts.map +1 -0
  356. package/lib/packlets/qualifier-types/config/json.js.map +1 -0
  357. package/lib/packlets/qualifier-types/convert.d.ts.map +1 -0
  358. package/lib/packlets/qualifier-types/convert.js.map +1 -0
  359. package/lib/packlets/qualifier-types/helpers.d.ts.map +1 -0
  360. package/lib/packlets/qualifier-types/helpers.js.map +1 -0
  361. package/lib/packlets/qualifier-types/index.d.ts.map +1 -0
  362. package/lib/packlets/qualifier-types/index.js.map +1 -0
  363. package/lib/packlets/qualifier-types/languageQualifierType.d.ts +6 -7
  364. package/lib/packlets/qualifier-types/languageQualifierType.d.ts.map +1 -0
  365. package/lib/packlets/qualifier-types/languageQualifierType.js +6 -7
  366. package/lib/packlets/qualifier-types/languageQualifierType.js.map +1 -0
  367. package/lib/packlets/qualifier-types/literalQualifierType.d.ts +7 -10
  368. package/lib/packlets/qualifier-types/literalQualifierType.d.ts.map +1 -0
  369. package/lib/packlets/qualifier-types/literalQualifierType.js +7 -10
  370. package/lib/packlets/qualifier-types/literalQualifierType.js.map +1 -0
  371. package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts.map +1 -0
  372. package/lib/packlets/qualifier-types/literalValueHierarchy.js.map +1 -0
  373. package/lib/packlets/qualifier-types/qualifierType.d.ts +17 -18
  374. package/lib/packlets/qualifier-types/qualifierType.d.ts.map +1 -0
  375. package/lib/packlets/qualifier-types/qualifierType.js +12 -13
  376. package/lib/packlets/qualifier-types/qualifierType.js.map +1 -0
  377. package/lib/packlets/qualifier-types/qualifierTypeCollector.d.ts.map +1 -0
  378. package/lib/packlets/qualifier-types/qualifierTypeCollector.js.map +1 -0
  379. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts +8 -8
  380. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts.map +1 -0
  381. package/lib/packlets/qualifier-types/territoryQualifierType.js +5 -5
  382. package/lib/packlets/qualifier-types/territoryQualifierType.js.map +1 -0
  383. package/lib/packlets/qualifiers/convert/decls.d.ts.map +1 -0
  384. package/lib/packlets/qualifiers/convert/decls.js.map +1 -0
  385. package/lib/packlets/qualifiers/convert/index.d.ts.map +1 -0
  386. package/lib/packlets/qualifiers/convert/index.js.map +1 -0
  387. package/lib/packlets/qualifiers/convert/qualifier.d.ts.map +1 -0
  388. package/lib/packlets/qualifiers/convert/qualifier.js.map +1 -0
  389. package/lib/packlets/qualifiers/index.d.ts.map +1 -0
  390. package/lib/packlets/qualifiers/index.js.map +1 -0
  391. package/lib/packlets/qualifiers/qualifier.d.ts +6 -7
  392. package/lib/packlets/qualifiers/qualifier.d.ts.map +1 -0
  393. package/lib/packlets/qualifiers/qualifier.js +6 -7
  394. package/lib/packlets/qualifiers/qualifier.js.map +1 -0
  395. package/lib/packlets/qualifiers/qualifierCollector.d.ts +107 -9
  396. package/lib/packlets/qualifiers/qualifierCollector.d.ts.map +1 -0
  397. package/lib/packlets/qualifiers/qualifierCollector.js +152 -8
  398. package/lib/packlets/qualifiers/qualifierCollector.js.map +1 -0
  399. package/lib/packlets/qualifiers/qualifierDecl.d.ts.map +1 -0
  400. package/lib/packlets/qualifiers/qualifierDecl.js.map +1 -0
  401. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.d.ts.map +1 -0
  402. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.js.map +1 -0
  403. package/lib/packlets/qualifiers/qualifierDefaultValueToken.d.ts.map +1 -0
  404. package/lib/packlets/qualifiers/qualifierDefaultValueToken.js.map +1 -0
  405. package/lib/packlets/resource-json/compiled/common.d.ts.map +1 -0
  406. package/lib/packlets/resource-json/compiled/common.js.map +1 -0
  407. package/lib/packlets/resource-json/compiled/convert.d.ts.map +1 -0
  408. package/lib/packlets/resource-json/compiled/convert.js.map +1 -0
  409. package/lib/packlets/resource-json/compiled/index.d.ts.map +1 -0
  410. package/lib/packlets/resource-json/compiled/index.js.map +1 -0
  411. package/lib/packlets/resource-json/compiled/json.d.ts.map +1 -0
  412. package/lib/packlets/resource-json/compiled/json.js.map +1 -0
  413. package/lib/packlets/resource-json/convert.d.ts +85 -0
  414. package/lib/packlets/resource-json/convert.d.ts.map +1 -0
  415. package/lib/packlets/resource-json/convert.js +237 -0
  416. package/lib/packlets/resource-json/convert.js.map +1 -0
  417. package/lib/packlets/resource-json/helpers.d.ts.map +1 -0
  418. package/lib/packlets/resource-json/helpers.js.map +1 -0
  419. package/lib/packlets/resource-json/index.d.ts.map +1 -0
  420. package/lib/packlets/resource-json/index.js.map +1 -0
  421. package/lib/packlets/resource-json/json.d.ts +128 -39
  422. package/lib/packlets/resource-json/json.d.ts.map +1 -0
  423. package/lib/packlets/resource-json/json.js +2 -2
  424. package/lib/packlets/resource-json/json.js.map +1 -0
  425. package/lib/packlets/resource-json/normalized.d.ts.map +1 -0
  426. package/lib/packlets/resource-json/normalized.js.map +1 -0
  427. package/lib/packlets/resource-json/resourceDeclCollection.d.ts +1 -1
  428. package/lib/packlets/resource-json/resourceDeclCollection.d.ts.map +1 -0
  429. package/lib/packlets/resource-json/resourceDeclCollection.js +1 -1
  430. package/lib/packlets/resource-json/resourceDeclCollection.js.map +1 -0
  431. package/lib/packlets/resource-json/resourceDeclContainer.d.ts.map +1 -0
  432. package/lib/packlets/resource-json/resourceDeclContainer.js.map +1 -0
  433. package/lib/packlets/resource-json/resourceDeclTree.d.ts +1 -1
  434. package/lib/packlets/resource-json/resourceDeclTree.d.ts.map +1 -0
  435. package/lib/packlets/resource-json/resourceDeclTree.js +1 -1
  436. package/lib/packlets/resource-json/resourceDeclTree.js.map +1 -0
  437. package/lib/packlets/resource-types/config/convert.d.ts.map +1 -0
  438. package/lib/packlets/resource-types/config/convert.js.map +1 -0
  439. package/lib/packlets/resource-types/config/index.d.ts.map +1 -0
  440. package/lib/packlets/resource-types/config/index.js.map +1 -0
  441. package/lib/packlets/resource-types/config/json.d.ts.map +1 -0
  442. package/lib/packlets/resource-types/config/json.js.map +1 -0
  443. package/lib/packlets/resource-types/helpers.d.ts.map +1 -0
  444. package/lib/packlets/resource-types/helpers.js.map +1 -0
  445. package/lib/packlets/resource-types/index.d.ts.map +1 -0
  446. package/lib/packlets/resource-types/index.js.map +1 -0
  447. package/lib/packlets/resource-types/jsonResourceType.d.ts +17 -5
  448. package/lib/packlets/resource-types/jsonResourceType.d.ts.map +1 -0
  449. package/lib/packlets/resource-types/jsonResourceType.js +2 -2
  450. package/lib/packlets/resource-types/jsonResourceType.js.map +1 -0
  451. package/lib/packlets/resource-types/resourceType.d.ts +5 -5
  452. package/lib/packlets/resource-types/resourceType.d.ts.map +1 -0
  453. package/lib/packlets/resource-types/resourceType.js +2 -2
  454. package/lib/packlets/resource-types/resourceType.js.map +1 -0
  455. package/lib/packlets/resource-types/resourceTypeCollector.d.ts.map +1 -0
  456. package/lib/packlets/resource-types/resourceTypeCollector.js.map +1 -0
  457. package/lib/packlets/resources/candidateReducer.d.ts.map +1 -0
  458. package/lib/packlets/resources/candidateReducer.js.map +1 -0
  459. package/lib/packlets/resources/candidateValue.d.ts.map +1 -0
  460. package/lib/packlets/resources/candidateValue.js.map +1 -0
  461. package/lib/packlets/resources/candidateValueCollector.d.ts.map +1 -0
  462. package/lib/packlets/resources/candidateValueCollector.js.map +1 -0
  463. package/lib/packlets/resources/common.d.ts.map +1 -0
  464. package/lib/packlets/resources/common.js.map +1 -0
  465. package/lib/packlets/resources/deltaGenerator.d.ts.map +1 -0
  466. package/lib/packlets/resources/deltaGenerator.js.map +1 -0
  467. package/lib/packlets/resources/index.d.ts.map +1 -0
  468. package/lib/packlets/resources/index.js.map +1 -0
  469. package/lib/packlets/resources/resource.d.ts.map +1 -0
  470. package/lib/packlets/resources/resource.js.map +1 -0
  471. package/lib/packlets/resources/resourceBuilder.d.ts +2 -2
  472. package/lib/packlets/resources/resourceBuilder.d.ts.map +1 -0
  473. package/lib/packlets/resources/resourceBuilder.js +2 -2
  474. package/lib/packlets/resources/resourceBuilder.js.map +1 -0
  475. package/lib/packlets/resources/resourceCandidate.d.ts.map +1 -0
  476. package/lib/packlets/resources/resourceCandidate.js.map +1 -0
  477. package/lib/packlets/resources/resourceManagerBuilder.d.ts +5 -5
  478. package/lib/packlets/resources/resourceManagerBuilder.d.ts.map +1 -0
  479. package/lib/packlets/resources/resourceManagerBuilder.js +5 -5
  480. package/lib/packlets/resources/resourceManagerBuilder.js.map +1 -0
  481. package/lib/packlets/runtime/cacheListener.d.ts.map +1 -0
  482. package/lib/packlets/runtime/cacheListener.js.map +1 -0
  483. package/lib/packlets/runtime/cacheMetrics.d.ts.map +1 -0
  484. package/lib/packlets/runtime/cacheMetrics.js.map +1 -0
  485. package/lib/packlets/runtime/compiledResourceCollection.d.ts +5 -5
  486. package/lib/packlets/runtime/compiledResourceCollection.d.ts.map +1 -0
  487. package/lib/packlets/runtime/compiledResourceCollection.js +5 -5
  488. package/lib/packlets/runtime/compiledResourceCollection.js.map +1 -0
  489. package/lib/packlets/runtime/conditionSetResolutionResult.d.ts.map +1 -0
  490. package/lib/packlets/runtime/conditionSetResolutionResult.js.map +1 -0
  491. package/lib/packlets/runtime/context/contextQualifierProvider.d.ts.map +1 -0
  492. package/lib/packlets/runtime/context/contextQualifierProvider.js.map +1 -0
  493. package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts.map +1 -0
  494. package/lib/packlets/runtime/context/contextQualifierProviderValidator.js.map +1 -0
  495. package/lib/packlets/runtime/context/index.d.ts.map +1 -0
  496. package/lib/packlets/runtime/context/index.js.map +1 -0
  497. package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts +9 -2
  498. package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts.map +1 -0
  499. package/lib/packlets/runtime/context/simpleContextQualifierProvider.js +3 -0
  500. package/lib/packlets/runtime/context/simpleContextQualifierProvider.js.map +1 -0
  501. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts +8 -1
  502. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts.map +1 -0
  503. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js +3 -5
  504. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +1 -0
  505. package/lib/packlets/runtime/iResourceManager.d.ts.map +1 -0
  506. package/lib/packlets/runtime/iResourceManager.js.map +1 -0
  507. package/lib/packlets/runtime/index.d.ts.map +1 -0
  508. package/lib/packlets/runtime/index.js.map +1 -0
  509. package/lib/packlets/runtime/resource-tree/common.d.ts.map +1 -0
  510. package/lib/packlets/runtime/resource-tree/common.js.map +1 -0
  511. package/lib/packlets/runtime/resource-tree/index.d.ts.map +1 -0
  512. package/lib/packlets/runtime/resource-tree/index.js.map +1 -0
  513. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.d.ts.map +1 -0
  514. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +1 -0
  515. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.d.ts.map +1 -0
  516. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.js.map +1 -0
  517. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts.map +1 -0
  518. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +1 -0
  519. package/lib/packlets/runtime/resourceResolver.d.ts.map +1 -0
  520. package/lib/packlets/runtime/resourceResolver.js.map +1 -0
  521. package/lib/packlets/runtime/resourceTreeResolver.d.ts.map +1 -0
  522. package/lib/packlets/runtime/resourceTreeResolver.js.map +1 -0
  523. package/lib/packlets/runtime/validate.d.ts.map +1 -0
  524. package/lib/packlets/runtime/validate.js.map +1 -0
  525. package/lib/packlets/zip-archive/convert.d.ts.map +1 -0
  526. package/lib/packlets/zip-archive/convert.js.map +1 -0
  527. package/lib/packlets/zip-archive/index.browser.d.ts.map +1 -0
  528. package/lib/packlets/zip-archive/index.browser.js.map +1 -0
  529. package/lib/packlets/zip-archive/index.d.ts.map +1 -0
  530. package/lib/packlets/zip-archive/index.js.map +1 -0
  531. package/lib/packlets/zip-archive/json.d.ts.map +1 -0
  532. package/lib/packlets/zip-archive/json.js.map +1 -0
  533. package/lib/packlets/zip-archive/types.d.ts.map +1 -0
  534. package/lib/packlets/zip-archive/types.js.map +1 -0
  535. package/lib/packlets/zip-archive/zipArchiveCreator.d.ts.map +1 -0
  536. package/lib/packlets/zip-archive/zipArchiveCreator.js.map +1 -0
  537. package/lib/packlets/zip-archive/zipArchiveFormat.d.ts.map +1 -0
  538. package/lib/packlets/zip-archive/zipArchiveFormat.js.map +1 -0
  539. package/lib/packlets/zip-archive/zipArchiveLoader.d.ts.map +1 -0
  540. package/lib/packlets/zip-archive/zipArchiveLoader.js.map +1 -0
  541. package/package.json +12 -10
  542. package/dist/test/data/sample.json +0 -32
  543. package/dist/test/unit/qualifier-types/testQualifierType.js +0 -76
  544. package/dist/test/unit/resource-types/testDerivedResourceType.js +0 -109
  545. package/dist/test/unit/resources/deltaGenerator.helpers.js +0 -282
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resourceManagerBuilder.js","sourceRoot":"","sources":["../../../src/packlets/resources/resourceManagerBuilder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EACL,aAAa,EACb,WAAW,EAEX,IAAI,EACJ,cAAc,EACd,IAAI,EACJ,UAAU,EACV,iBAAiB,EAEjB,OAAO,EACP,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UAAU,IAAI,cAAc,EAAa,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EAGrB,OAAO,IAAI,iBAAiB,EAC5B,SAAS,EACT,YAAY,EAEb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,yBAAyB,EAAqC,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAG9G,OAAO,EAAE,OAAO,EAAc,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAoB,YAAY,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAE,eAAe,EAA+B,MAAM,mBAAmB,CAAC;AACjF,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,OAAO,KAAK,YAAY,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,MAAM,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 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 { Converters as JsonConverters, JsonValue } from '@fgv/ts-json-base';\nimport {\n ConditionCollector,\n ConditionSetCollector,\n ReadOnlyConditionCollector,\n ReadOnlyConditionSetCollector,\n Convert as ConditionsConvert,\n Condition,\n ConditionSet,\n IConditionSetDecl\n} from '../conditions';\nimport { AbstractDecisionCollector, ReadOnlyAbstractDecisionCollector, AbstractDecision } from '../decisions';\nimport { IReadOnlyQualifierCollector } from '../qualifiers';\nimport { ReadOnlyResourceTypeCollector, ResourceType } from '../resource-types';\nimport { Convert, ResourceId, Validate } from '../common';\nimport { IResourceManager, ResourceTree } from '../runtime';\nimport { ResourceBuilder, ResourceBuilderResultDetail } from './resourceBuilder';\nimport { Resource } from './resource';\nimport { ResourceCandidate } from './resourceCandidate';\nimport { CandidateValueCollector } from './candidateValueCollector';\nimport { IResourceDeclarationOptions, IResourceManagerCloneOptions } from './common';\nimport * as ResourceJson from '../resource-json';\nimport * as Context from '../context';\nimport * as Config from '../config';\nimport { JsonEditor } from '@fgv/ts-json';\nimport { ReadOnlyQualifierTypeCollector } from '../qualifier-types';\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<Resource> {\n /**\n * The {@link Qualifiers.IReadOnlyQualifierCollector | qualifiers} used by this resource manager.\n */\n public readonly qualifiers: IReadOnlyQualifierCollector;\n\n /**\n * The {@link ResourceTypes.ReadOnlyResourceTypeCollector | resource types} used by this resource manager.\n */\n public readonly resourceTypes: ReadOnlyResourceTypeCollector;\n\n /**\n * The {@link Conditions.ConditionCollector | condition collector} used by this resource manager.\n * @internal\n */\n protected readonly _conditions: ConditionCollector;\n\n /**\n * The {@link Conditions.ConditionSetCollector | condition set collector} used by this resource manager.\n * @internal\n */\n protected readonly _conditionSets: ConditionSetCollector;\n\n /**\n * The {@link Decisions.AbstractDecisionCollector | abstract decision collector} used by this resource manager.\n * @internal\n */\n protected readonly _decisions: AbstractDecisionCollector;\n\n /**\n * The candidate value collector used by this resource manager.\n * @internal\n */\n protected readonly _candidateValues: CandidateValueCollector;\n\n /**\n * The {@link Resources.ResourceBuilder | resource builders} used by this resource manager.\n * @internal\n */\n protected readonly _resources: ValidatingResultMap<ResourceId, ResourceBuilder>;\n\n /**\n * The {@link Resources.Resource | resources} built by this resource manager.\n * @internal\n */\n protected readonly _builtResources: ValidatingResultMap<ResourceId, Resource>;\n\n /**\n * Whether the resources have been built.\n * @internal\n */\n protected _built: boolean;\n\n /**\n * The cached resource tree for this resource manager.\n * @internal\n */\n protected _cachedResourceTree?: ResourceTree.IReadOnlyResourceTreeRoot<Resource>;\n\n /**\n * The {@link QualifierTypes.ReadOnlyQualifierTypeCollector | qualifier types} used by this resource manager.\n */\n public get qualifierTypes(): ReadOnlyQualifierTypeCollector {\n /* c8 ignore next 1 - functional code tested but coverage intermittently missed */\n return this.qualifiers.qualifierTypes;\n }\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 * The resource IDs that this resource manager can resolve.\n */\n public get resourceIds(): ReadonlyArray<ResourceId> {\n return Array.from(this._resources.keys()).sort();\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._candidateValues = CandidateValueCollector.create().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 this._cachedResourceTree = undefined;\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 * Creates a new {@link Resources.ResourceManagerBuilder | ResourceManagerBuilder} object from a predefined system configuration.\n * @param name - The name of the predefined system configuration to use.\n * @param qualifierDefaultValues - Optional default values for qualifiers.\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 createPredefined(\n name: Config.PredefinedSystemConfiguration,\n qualifierDefaultValues?: Config.ISystemConfigurationInitParams['qualifierDefaultValues']\n ): Result<ResourceManagerBuilder> {\n return Config.getPredefinedSystemConfiguration(\n name,\n /* c8 ignore next 1 - defense in depth */\n qualifierDefaultValues ? { qualifierDefaultValues } : undefined\n ).onSuccess((systemConfig) => {\n return ResourceManagerBuilder.create({\n qualifiers: systemConfig.qualifiers,\n resourceTypes: systemConfig.resourceTypes\n });\n });\n }\n\n /**\n * Creates a new {@link Resources.ResourceManagerBuilder | ResourceManagerBuilder} from a\n * {@link ResourceJson.Compiled.ICompiledResourceCollection | compiled resource collection}.\n * This method reconstructs an exactly equivalent builder where all qualifier, condition,\n * condition set, and decision indices match the original compiled collection.\n * @param compiledCollection - The compiled resource collection to reconstruct from.\n * @param systemConfig - The system configuration containing qualifiers and resource types.\n * @returns `Success` with the new manager if successful, or `Failure` with an error message if not.\n * @public\n */\n public static createFromCompiledResourceCollection(\n compiledCollection: ResourceJson.Compiled.ICompiledResourceCollection,\n systemConfig: Config.SystemConfiguration\n ): Result<ResourceManagerBuilder> {\n // Create the base builder with system configuration\n return ResourceManagerBuilder.create({\n qualifiers: systemConfig.qualifiers,\n resourceTypes: systemConfig.resourceTypes\n }).onSuccess((builder) => {\n // Reconstruct all entities in order to preserve indices\n return ResourceManagerBuilder._reconstructConditions(builder, compiledCollection)\n .onSuccess(() => ResourceManagerBuilder._reconstructConditionSets(builder, compiledCollection))\n .onSuccess(() => ResourceManagerBuilder._reconstructDecisions(builder, compiledCollection))\n .onSuccess(() => ResourceManagerBuilder._reconstructResources(builder, compiledCollection))\n .onSuccess(() => succeed(builder));\n });\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 decl - The {@link ResourceJson.Json.ILooseResourceCandidateDecl | loose resource candidate declaration} 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 candidateValues: this._candidateValues\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 this._cachedResourceTree = 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 /* c8 ignore next 3 - defensive coding: resource ID validation should prevent invalid IDs */\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 candidateValues: this._candidateValues\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 /* c8 ignore next 4 - defensive coding: resource type mismatch on existing resources should not occur */\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 * Adds a condition to the manager.\n * @param decl - The condition declaration to add.\n * @returns `Success` with the condition if successful, or `Failure` with an error message if not.\n * @public\n */\n public addCondition(decl: ResourceJson.Json.ILooseConditionDecl): Result<Condition> {\n return ConditionsConvert.validatedConditionDecl\n .convert(decl, { qualifiers: this.qualifiers })\n .onSuccess((validated) => {\n return Condition.getKeyForDecl(validated).onSuccess((key) => {\n return this._conditions.validating.getOrAdd(key, () => Condition.create(validated));\n });\n });\n }\n\n /**\n * Adds a condition set to the manager.\n * @param conditions - The {@link ResourceJson.Normalized.ConditionSetDecl | condition set declaration} to add.\n * @returns `Success` with the condition set if successful, or `Failure` with an error message if not.\n * @public\n */\n public addConditionSet(conditions: ResourceJson.Normalized.ConditionSetDecl): Result<ConditionSet> {\n const decl: IConditionSetDecl = { conditions: [...conditions] };\n return ConditionsConvert.validatedConditionSetDecl\n .convert(decl, { conditions: this._conditions })\n .onSuccess((validated) => {\n return ConditionSet.getKeyForDecl(validated).onSuccess((key) => {\n return this._conditionSets.validating.getOrAdd(key, () => ConditionSet.create(validated));\n });\n });\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 * Builds and returns a hierarchical tree representation of all resources managed by this builder.\n * Resources are organized based on their dot-separated resource IDs (e.g., \"app.messages.welcome\"\n * becomes a tree with \"app\" as root, \"messages\" as branch, and \"welcome\" as leaf).\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<ResourceTree.IReadOnlyResourceTreeRoot<Resource>> {\n // Ensure resources are built first\n return this.build().onSuccess((manager) => {\n if (manager._cachedResourceTree) {\n return succeed(manager._cachedResourceTree);\n }\n\n // Convert all built resources to [ResourceId, Resource] pairs\n const resources: [ResourceId, Resource][] = [];\n for (const [id, resource] of manager._builtResources.entries()) {\n resources.push([id, resource]);\n }\n\n // Create the resource tree with lazy initialization\n return ResourceTree.ReadOnlyResourceTreeRoot.create(resources).onSuccess((tree) => {\n manager._cachedResourceTree = tree;\n return succeed(tree);\n });\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 /* c8 ignore next 3 - defensive coding: build failure should not occur after successful validation */\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 candidateValues: this._candidateValues.getValuesByIndex(),\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 /* c8 ignore next 5 - functional code tested but coverage intermittently missed */\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 clone of this ResourceManagerBuilder with optional configuration overrides.\n * This method creates a new ResourceManagerBuilder that can optionally use different\n * qualifiers and/or resource types than the original. It can also be filtered to include\n * only candidates that match the provided context and apply candidate edits.\n *\n * @param options - Options for the cloning operation:\n * - `qualifiers`: Optional qualifier collector to use instead of the original\n * - `resourceTypes`: Optional resource type collector to use instead of the original\n * - `filterForContext`: Optional context filter for candidates\n * - `candidates`: Optional candidate edits to apply during cloning\n * @returns A Result containing the new ResourceManagerBuilder with the specified configuration.\n * @public\n */\n /* c8 ignore next 21 - functional code path tested but coverage intermittently missed */\n public clone(options?: IResourceManagerCloneOptions): Result<ResourceManagerBuilder> {\n return this.getResourceCollectionDecl(options).onSuccess((collection) => {\n return ResourceManagerBuilder.create({\n qualifiers: options?.qualifiers ?? this.qualifiers,\n resourceTypes: options?.resourceTypes ?? this.resourceTypes\n }).onSuccess((newManager) => {\n // Check if we have candidates to apply as edits\n const editCandidates = options?.candidates || [];\n const candidatesByResourceResult =\n editCandidates.length > 0\n ? ResourceManagerBuilder._createCandidatesByResourceMap(editCandidates)\n : succeed(new Map());\n\n return candidatesByResourceResult.onSuccess((candidatesByResource) => {\n // Track which resource IDs have been processed from the original collection\n const processedResourceIds = new Set<ResourceId>();\n\n // Add each resource from the filtered collection to the new manager\n if (collection.resources) {\n for (const resourceDecl of collection.resources) {\n processedResourceIds.add(resourceDecl.id as ResourceId);\n\n // Apply edits if there are candidates for this resource\n const editedDeclResult = ResourceManagerBuilder._applyEditsToResourceDeclaration(\n resourceDecl,\n candidatesByResource,\n this._conditions\n );\n\n /* c8 ignore next 2 - functional code tested but coverage intermittently missed */\n if (editedDeclResult.isFailure()) {\n return fail(`${resourceDecl.id}: Failed to apply edits: ${editedDeclResult.message}`);\n }\n\n const addResult = newManager.addResource(editedDeclResult.value);\n /* c8 ignore next 5 - edge case (nearly?) impossible to reproduce */\n if (addResult.isFailure()) {\n return fail(\n `${resourceDecl.id}: Failed to add resource to cloned manager: ${addResult.message}`\n );\n }\n }\n }\n\n // Handle any remaining candidates that target new resources not in the original collection\n const errors = new MessageAggregator();\n /* c8 ignore next 9 - functional code tested but coverage intermittently missed */\n for (const [resourceId, candidates] of candidatesByResource) {\n if (!processedResourceIds.has(resourceId)) {\n // Create a new resource declaration for candidates targeting a new resource ID\n ResourceManagerBuilder._createResourceDeclFromCandidates(\n resourceId,\n candidates,\n this._conditions\n )\n .withErrorFormat((e) => `${resourceId}: Failed to create new resource from candidates: ${e}`)\n /* c8 ignore next 7 - functional code tested but coverage intermittently missed */\n .onSuccess((newResourceDecl) => {\n return newManager\n .addResource(newResourceDecl)\n .withErrorFormat(\n (e) => `${resourceId}: Failed to add new resource to cloned manager: ${e}`\n );\n })\n .aggregateError(errors);\n }\n }\n\n return errors.returnOrReport(succeed(newManager));\n });\n });\n });\n }\n\n /**\n * Creates a resource ID keyed map from an array of loose resource candidate declarations.\n * This enables efficient detection of edit collisions by grouping candidates by their target resource.\n * @param candidates - Array of loose resource candidate declarations to organize\n * @returns A Result containing a Map where keys are validated ResourceIds and values are arrays of candidates for that resource\n * @internal\n */\n private static _createCandidatesByResourceMap(\n candidates: ReadonlyArray<ResourceJson.Json.ILooseResourceCandidateDecl>\n ): Result<Map<ResourceId, ResourceJson.Json.ILooseResourceCandidateDecl[]>> {\n const candidatesByResource = new Map<ResourceId, ResourceJson.Json.ILooseResourceCandidateDecl[]>();\n\n for (const candidate of candidates) {\n const { value: resourceId, message } = Validate.toResourceId(candidate.id);\n if (message !== undefined) {\n return fail(`Invalid resource ID \"${candidate.id}\": ${message}`);\n }\n\n const existingCandidates = candidatesByResource.get(resourceId);\n if (existingCandidates) {\n existingCandidates.push(candidate);\n } else {\n candidatesByResource.set(resourceId, [candidate]);\n }\n }\n\n return succeed(candidatesByResource);\n }\n\n /**\n * Generates a proper ConditionSet token for collision detection using the existing ConditionSet.getKeyForDecl method.\n * @param conditionSet - The condition set to generate a token for\n * @param conditionCollector - The condition collector needed for validation context\n * @returns A Result containing the ConditionSet token if successful, or failure if validation fails\n * @internal\n */\n\n /**\n * Applies candidate edits to a resource declaration, handling collisions using condition set tokens.\n * If there's no collision, adds the candidate. If there's a collision, replaces the original candidate with the edit.\n * @param resourceDecl - The original resource declaration to potentially modify\n * @param candidatesByResource - Map of resource IDs to arrays of candidate edits\n * @param conditionCollector - The condition collector needed for generating condition tokens\n * @returns A Result containing the resource declaration to use (original or modified)\n * @internal\n */\n private static _applyEditsToResourceDeclaration(\n resourceDecl: ResourceJson.Json.ILooseResourceDecl,\n candidatesByResource: Map<ResourceId, ResourceJson.Json.ILooseResourceCandidateDecl[]>,\n conditionCollector: ConditionCollector\n ): Result<ResourceJson.Json.ILooseResourceDecl> {\n const { value: resourceId, message } = Validate.toResourceId(resourceDecl.id);\n /* c8 ignore next 3 - defensive validation: resource IDs are validated when added to builder, but this protects against corrupted data */\n if (message !== undefined) {\n return fail(`Invalid resource ID \"${resourceDecl.id}\": ${message}`);\n }\n\n /* c8 ignore next 4 - functional code tested but coverage intermittently missed */\n const editCandidates = candidatesByResource.get(resourceId);\n if (!editCandidates || editCandidates.length === 0) {\n return succeed(resourceDecl);\n }\n\n // Use Map approach: apply original candidates first, then replace with edits on collision\n const candidatesByConditionKey = new Map<string, ResourceJson.Json.IChildResourceCandidateDecl>();\n\n /* c8 ignore next 1 - ?? is defense in depth */\n const declCandidates = resourceDecl.candidates ?? [];\n\n // First, add all original candidates keyed by their condition set token\n for (const candidate of declCandidates) {\n const conditionTokenResult = ConditionSet.getKeyFromLooseDecl(candidate.conditions, conditionCollector);\n /* c8 ignore next 5 - edge case or internal error (nearly?) impossible to reproduce */\n if (conditionTokenResult.isFailure()) {\n return fail(\n `Failed to generate condition token for original candidate: ${conditionTokenResult.message}`\n );\n }\n candidatesByConditionKey.set(conditionTokenResult.value, candidate);\n }\n\n // Then, apply edits (this replaces any colliding original candidates)\n // Convert edit candidates (which have ids) to child candidates (without ids) for merging\n /* c8 ignore next 37 - functional code tested but coverage intermittently missed */\n for (const editCandidate of editCandidates) {\n const conditionTokenResult = ConditionSet.getKeyFromLooseDecl(\n editCandidate.conditions,\n conditionCollector\n );\n if (conditionTokenResult.isFailure()) {\n return fail(`Failed to generate condition token for edit candidate: ${conditionTokenResult.message}`);\n }\n let editedJson = editCandidate.json;\n const previousJson = candidatesByConditionKey.get(conditionTokenResult.value)?.json;\n if (previousJson && previousJson !== editedJson) {\n editedJson = JsonEditor.create({\n merge: {\n arrayMergeBehavior: 'replace',\n nullAsDelete: false\n }\n })\n .onSuccess((editor) => {\n return editor.mergeObjectsInPlace({}, [previousJson, editedJson]);\n })\n .orThrow();\n }\n\n const childCandidate: ResourceJson.Json.IChildResourceCandidateDecl = {\n json: editedJson,\n conditions: editCandidate.conditions,\n isPartial: editCandidate.isPartial,\n mergeMethod: editCandidate.mergeMethod\n };\n candidatesByConditionKey.set(conditionTokenResult.value, childCandidate);\n }\n\n // Extract the final merged candidate list\n const mergedCandidates = Array.from(candidatesByConditionKey.values());\n\n const modifiedDecl: ResourceJson.Json.ILooseResourceDecl = {\n ...resourceDecl,\n candidates: mergedCandidates\n };\n\n return succeed(modifiedDecl);\n }\n\n /**\n * Creates a new resource declaration from an array of candidate declarations.\n * This is used when cloning to create new resources that don't exist in the original manager.\n * @param resourceId - The validated resource ID for the new resource\n * @param candidates - Array of loose candidate declarations for the new resource\n * @param conditionCollector - The condition collector for validation context\n * @returns A Result containing the new resource declaration if successful, or failure if validation fails\n * @internal\n */\n private static _createResourceDeclFromCandidates(\n resourceId: ResourceId,\n candidates: ResourceJson.Json.ILooseResourceCandidateDecl[],\n conditionCollector: ConditionCollector\n ): Result<ResourceJson.Json.ILooseResourceDecl> {\n // Convert candidate declarations to child candidate declarations\n const childCandidates: ResourceJson.Json.IChildResourceCandidateDecl[] = [];\n\n // Ensure we have candidates\n /* c8 ignore next 3 - defense in depth against internal error */\n if (candidates.length === 0) {\n return fail('Cannot create resource declaration from empty candidates array');\n }\n\n // Extract resourceTypeName from the first candidate (all candidates for the same resource should have the same type)\n const resourceTypeName = candidates[0].resourceTypeName;\n /* c8 ignore next 3 - defense in depth */\n if (!resourceTypeName) {\n return fail('resourceTypeName is required for new resource candidates');\n }\n\n for (const candidate of candidates) {\n const childCandidate: ResourceJson.Json.IChildResourceCandidateDecl = {\n json: candidate.json,\n conditions: candidate.conditions,\n isPartial: candidate.isPartial,\n mergeMethod: candidate.mergeMethod\n };\n childCandidates.push(childCandidate);\n }\n\n // Create the new resource declaration\n const newResourceDecl: ResourceJson.Json.ILooseResourceDecl = {\n id: resourceId,\n candidates: childCandidates,\n resourceTypeName\n };\n\n return succeed(newResourceDecl);\n }\n\n /**\n * Reconstructs conditions from a compiled collection and adds them to the builder.\n * @param builder - The builder to add conditions to.\n * @param compiledCollection - The compiled collection containing conditions.\n * @returns `Success` if all conditions were added successfully, `Failure` otherwise.\n * @internal\n */\n private static _reconstructConditions(\n builder: ResourceManagerBuilder,\n compiledCollection: ResourceJson.Compiled.ICompiledResourceCollection\n ): Result<boolean> {\n const errors = new MessageAggregator();\n\n for (const compiledCondition of compiledCollection.conditions) {\n // Get the qualifier by index\n const qualifierResult = builder.qualifiers.getAt(compiledCondition.qualifierIndex);\n /* c8 ignore next 4 - edge case or internal error (nearly?) impossible to reproduce */\n if (qualifierResult.isFailure()) {\n qualifierResult.aggregateError(errors);\n continue;\n }\n\n // Create condition declaration from compiled condition\n const conditionDecl: ResourceJson.Json.ILooseConditionDecl = {\n qualifierName: qualifierResult.value.name,\n operator: compiledCondition.operator,\n value: compiledCondition.value,\n priority: compiledCondition.priority,\n scoreAsDefault: compiledCondition.scoreAsDefault\n };\n\n // Add condition to builder (it will get the next sequential index)\n builder.addCondition(conditionDecl).aggregateError(errors);\n }\n\n return errors.returnOrReport(succeed(true));\n }\n\n /**\n * Reconstructs condition sets from a compiled collection and adds them to the builder.\n * @param builder - The builder to add condition sets to.\n * @param compiledCollection - The compiled collection containing condition sets.\n * @returns `Success` if all condition sets were added successfully, `Failure` otherwise.\n * @internal\n */\n private static _reconstructConditionSets(\n builder: ResourceManagerBuilder,\n compiledCollection: ResourceJson.Compiled.ICompiledResourceCollection\n ): Result<boolean> {\n const errors = new MessageAggregator();\n\n for (const compiledConditionSet of compiledCollection.conditionSets) {\n // Get conditions by their indices\n const conditionResults = compiledConditionSet.conditions.map((idx) => builder._conditions.getAt(idx));\n\n // Check for any failures\n const failedIndex = conditionResults.findIndex((r) => r.isFailure());\n /* c8 ignore next 4 - edge case or internal error (nearly?) impossible to reproduce */\n if (failedIndex >= 0) {\n conditionResults[failedIndex].aggregateError(errors);\n continue;\n }\n\n // Create condition set from conditions (not declarations)\n const conditions = conditionResults.map((r) => r.orThrow());\n // Convert conditions to declarations for addConditionSet\n const conditionDecls = conditions.map((c) => c.toLooseConditionDecl());\n builder.addConditionSet(conditionDecls).aggregateError(errors);\n }\n\n return errors.returnOrReport(succeed(true));\n }\n\n /**\n * Reconstructs decisions from a compiled collection and adds them to the builder.\n * @param builder - The builder to add decisions to.\n * @param compiledCollection - The compiled collection containing decisions.\n * @returns `Success` if all decisions were added successfully, `Failure` otherwise.\n * @internal\n */\n private static _reconstructDecisions(\n builder: ResourceManagerBuilder,\n compiledCollection: ResourceJson.Compiled.ICompiledResourceCollection\n ): Result<boolean> {\n const errors = new MessageAggregator();\n\n for (const compiledDecision of compiledCollection.decisions) {\n // Get condition sets by their indices\n const conditionSetResults = compiledDecision.conditionSets.map((idx) =>\n builder._conditionSets.getAt(idx)\n );\n\n // Check for any failures\n const failedIndex = conditionSetResults.findIndex((r) => r.isFailure());\n if (failedIndex >= 0) {\n conditionSetResults[failedIndex].aggregateError(errors);\n continue;\n }\n\n // Get condition sets from successful results\n const conditionSets = conditionSetResults.map((r) => r.orThrow());\n // Create AbstractDecision from condition sets and add to collector\n AbstractDecision.createAbstractDecision({ conditionSets })\n .onSuccess((decision) => builder._decisions.getOrAdd(decision))\n .aggregateError(errors);\n }\n\n return errors.returnOrReport(succeed(true));\n }\n\n /**\n * Reconstructs resources and their candidates from a compiled collection and adds them to the builder.\n * @param builder - The builder to add resources to.\n * @param compiledCollection - The compiled collection containing resources.\n * @returns `Success` if all resources were added successfully, `Failure` otherwise.\n * @internal\n */\n private static _reconstructResources(\n builder: ResourceManagerBuilder,\n compiledCollection: ResourceJson.Compiled.ICompiledResourceCollection\n ): Result<boolean> {\n const errors = new MessageAggregator();\n\n for (const compiledResource of compiledCollection.resources) {\n // Get the resource type by index\n const resourceTypeResult = builder.resourceTypes.getAt(compiledResource.type);\n /* c8 ignore next 4 - edge case or internal error (nearly?) impossible to reproduce */\n if (resourceTypeResult.isFailure()) {\n resourceTypeResult.aggregateError(errors);\n continue;\n }\n\n // Get the decision by index\n const decisionResult = builder._decisions.getAt(compiledResource.decision);\n /* c8 ignore next 4 - edge case or internal error (nearly?) impossible to reproduce */\n if (decisionResult.isFailure()) {\n decisionResult.aggregateError(errors);\n continue;\n }\n\n const decision = decisionResult.value;\n const resourceType = resourceTypeResult.value;\n\n // Create candidates from the decision's condition sets\n ResourceManagerBuilder._createCandidatesFromDecision(\n compiledResource,\n decision,\n resourceType,\n builder,\n compiledCollection.candidateValues\n ).aggregateError(errors);\n }\n\n return errors.returnOrReport(succeed(true));\n }\n\n /**\n * Helper method to create candidates from a decision's condition sets.\n * @param compiledResource - The compiled resource containing candidates.\n * @param decision - The decision containing condition sets.\n * @param resourceType - The resource type for the candidates.\n * @param builder - The builder to add candidates to.\n * @param candidateValues - Array of candidate values indexed by valueIndex.\n * @returns `Success` if all candidates were added successfully, `Failure` otherwise.\n * @internal\n */\n private static _createCandidatesFromDecision(\n compiledResource: ResourceJson.Compiled.ICompiledResource,\n decision: AbstractDecision,\n resourceType: ResourceType,\n builder: ResourceManagerBuilder,\n candidateValues: ReadonlyArray<JsonValue>\n ): Result<boolean> {\n const errors = new MessageAggregator();\n\n // Match each candidate to its corresponding condition set\n for (let i = 0; i < compiledResource.candidates.length; i++) {\n const candidate = compiledResource.candidates[i];\n\n // Build conditions from the corresponding condition set (if available)\n let conditions: Record<string, string> | undefined;\n if (i < decision.candidates.length) {\n const decisionCandidate = decision.candidates[i];\n conditions = {};\n for (const condition of decisionCandidate.conditionSet.conditions) {\n conditions[condition.qualifier.name] = condition.value;\n }\n /* c8 ignore next 3 - defense in depth */\n if (Object.keys(conditions).length === 0) {\n conditions = undefined;\n }\n }\n\n // Get json value from candidateValues array using valueIndex\n /* c8 ignore next 1 - defense in depth */\n const rawJson = candidateValues[candidate.valueIndex] ?? {};\n JsonConverters.jsonObject\n .convert(rawJson)\n .onSuccess((json) => {\n const candidateDecl: ResourceJson.Json.ILooseResourceCandidateDecl = {\n id: compiledResource.id,\n json,\n conditions,\n isPartial: candidate.isPartial,\n mergeMethod: candidate.mergeMethod,\n resourceTypeName: resourceType.key\n };\n\n return builder.addLooseCandidate(candidateDecl).aggregateError(errors);\n })\n .aggregateError(errors);\n }\n\n return errors.returnOrReport(succeed(true));\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cacheListener.js","sourceRoot":"","sources":["../../../src/packlets/runtime/cacheListener.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAqDH;;;GAGG;AACH,MAAM,OAAO,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,cAAc,CAAC,SAAiB,EAAE,KAAa;QACpD,QAAQ;IACV,CAAC;IAED;;OAEG;IACI,YAAY,CAAC,KAAgC;QAClD,QAAQ;IACV,CAAC;CACF","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 context error occurs.\n * @param error - The error that occurred.\n */\n onContextError(qualifier: string, error: string): 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.onContextError}\n */\n public onContextError(qualifier: string, error: string): 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"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cacheMetrics.js","sourceRoot":"","sources":["../../../src/packlets/runtime/cacheMetrics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAsBH;;;GAGG;AACH,MAAM,OAAO,qBAAqB;IAMhC;QALQ,UAAK,GAAW,CAAC,CAAC;QAClB,YAAO,GAAW,CAAC,CAAC;QACpB,YAAO,GAAW,CAAC,CAAC;QACpB,YAAO,GAAW,CAAC,CAAC;QAG1B,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;QACf,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;IACnB,CAAC;IAEM,KAAK,CAAC,OAAe;QAC1B,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;IAEM,MAAM,CAAC,OAAe;QAC3B,IAAI,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;IAEM,OAAO,CAAC,OAAe;QAC5B,IAAI,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;IAEM,OAAO;QACZ,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;QACf,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;QACjB,IAAI,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;IAED,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO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CAAC;QACD,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC;IAC1B,CAAC;IAED;;;OAGG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED;;OAEG;IACI,UAAU,CAAC,KAAgC,EAAE,KAAa;QAC/D,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;IAED;;OAEG;IACI,WAAW,CAAC,KAAgC,EAAE,KAAa;QAChE,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,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,cAAc,CAAC,SAAiB,EAAE,KAAa;QACpD,IAAI,CAAC,cAAc,EAAE,CAAC;IACxB,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;QAC/B,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC;IAC1B,CAAC;CACF","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 private _contextErrors: number;\n\n public get numContextErrors(): number {\n return this._contextErrors;\n }\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 this._contextErrors = 0;\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.onContextError}\n */\n public onContextError(qualifier: string, error: string): void {\n this._contextErrors++;\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 this._contextErrors = 0;\n }\n}\n"]}
@@ -72,19 +72,19 @@ export class CompiledResourceCollection {
72
72
  return this._candidateValues;
73
73
  }
74
74
  /**
75
- * {@inheritdoc Runtime.IResourceManager.builtResources}
75
+ * {@inheritDoc Runtime.IResourceManager.builtResources}
76
76
  */
77
77
  get builtResources() {
78
78
  return this._builtResources;
79
79
  }
80
80
  /**
81
- * {@inheritdoc Runtime.IResourceManager.numResources}
81
+ * {@inheritDoc Runtime.IResourceManager.numResources}
82
82
  */
83
83
  get numResources() {
84
84
  return this._builtResources.size;
85
85
  }
86
86
  /**
87
- * {@inheritdoc Runtime.IResourceManager.numCandidates}
87
+ * {@inheritDoc Runtime.IResourceManager.numCandidates}
88
88
  */
89
89
  get numCandidates() {
90
90
  if (this._numCandidates === undefined) {
@@ -124,13 +124,13 @@ export class CompiledResourceCollection {
124
124
  return captureResult(() => new CompiledResourceCollection(params));
125
125
  }
126
126
  /**
127
- * {@inheritdoc Runtime.IResourceManager.getBuiltResource}
127
+ * {@inheritDoc Runtime.IResourceManager.getBuiltResource}
128
128
  */
129
129
  getBuiltResource(id) {
130
130
  return this._builtResources.validating.get(id);
131
131
  }
132
132
  /**
133
- * {@inheritdoc Runtime.IResourceManager.validateContext}
133
+ * {@inheritDoc Runtime.IResourceManager.validateContext}
134
134
  */
135
135
  validateContext(context) {
136
136
  return Context.Convert.validatedContextDecl.convert(context, {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compiledResourceCollection.js","sourceRoot":"","sources":["../../../src/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BAC1B,UAAU;aACX,CAAC;YAEF,WAAW;iBACR,GAAG,CAAC,gBAAgB,CAAC,EAAE,EAAE,QAAQ,CAAC;iBAClC,cAAc,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,0BAA0B,gBAAgB,CAAC,EAAE,KAAK,OAAO,EAAE,CAAC,CAAC;QACtG,CAAC;QAED,OAAO,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC;IACrD,CAAC;CACF","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, IReadOnlyQualifierCollector } from '../qualifiers';\nimport { ResourceType, ResourceTypeCollector, ReadOnlyResourceTypeCollector } from '../resource-types';\nimport { QualifierType, QualifierTypeCollector, ReadOnlyQualifierTypeCollector } from '../qualifier-types';\nimport { Convert, ResourceId, Helpers } from '../common';\nimport { JsonObject, JsonValue, isJsonObject } 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 } 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<IResource> {\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 _candidateValues: JsonValue[];\n private readonly _builtResources: ValidatingResultMap<ResourceId, IResource>;\n private _cachedResourceTree?: ReadOnlyResourceTreeRoot<IResource>;\n\n /**\n * A {@link QualifierTypes.ReadOnlyQualifierTypeCollector | ReadOnlyQualifierTypeCollector} which\n * contains the {@link QualifierTypes.QualifierType | qualifier types} used in this collection.\n */\n public get qualifierTypes(): ReadOnlyQualifierTypeCollector {\n return this._qualifierTypes;\n }\n\n /**\n * A {@link Qualifiers.IReadOnlyQualifierCollector | ReadOnlyQualifierCollector} which\n * contains the {@link Qualifiers.Qualifier | qualifiers} used in this collection.\n */\n public get qualifiers(): IReadOnlyQualifierCollector {\n return this._qualifiers;\n }\n\n /**\n * The resource IDs contained in this compiled resource collection.\n */\n public get resourceIds(): ReadonlyArray<ResourceId> {\n return Array.from(this._builtResources.keys()).sort();\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(): ReadOnlyResourceTypeCollector {\n return this._resourceTypes;\n }\n\n /**\n * The candidate values in the collection.\n */\n public get candidateValues(): ReadonlyArray<JsonValue> {\n return this._candidateValues;\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 this._candidateValues = [...params.compiledCollection.candidateValues];\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<ReadOnlyResourceTreeRoot<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 /* c8 ignore next 5 - defensive coding: invalid qualifier index should not occur in compiled data */\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 /* c8 ignore next 5 - defensive coding: condition set resolution should not fail with valid compiled data */\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 * Gets a candidate value from the collection.\n * @param valueIndex - The index of the candidate value to get.\n * @returns\n */\n private _getCandidateValue(valueIndex: number): Result<JsonObject> {\n /* c8 ignore next 3 - defensive coding: candidate value index should be valid in compiled data */\n if (valueIndex < 0 || valueIndex >= this._candidateValues.length) {\n return fail(`Invalid candidate value index ${valueIndex}`);\n }\n /* c8 ignore next 3 - defensive coding for invalid candidate value conversion */\n if (!isJsonObject(this._candidateValues[valueIndex])) {\n return fail(`${valueIndex}: candidate value not a JSON object.`);\n }\n return succeed(this._candidateValues[valueIndex]);\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 /* c8 ignore next 3 - covered but coverage is confused */\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 resourceType = resourceTypes\n .getAt(compiledResource.type)\n .aggregateError(\n errors,\n (message) =>\n `Invalid resource type index ${compiledResource.type} for resource ${compiledResource.id}: ${message}`\n )\n .orDefault();\n\n /* c8 ignore next 3 - defensive coding: resource type index should be valid in compiled data */\n if (resourceType === undefined) {\n continue;\n }\n\n const decision = decisions\n .getAt(compiledResource.decision)\n .aggregateError(\n errors,\n (message) =>\n `Invalid decision index ${compiledResource.decision} for resource ${compiledResource.id}: ${message}`\n )\n .orDefault();\n\n /* c8 ignore next 3 - defensive coding: decision index should be valid in compiled data */\n if (decision === undefined) {\n continue;\n }\n\n // Build candidates from compiled data\n const candidateDecls = mapResults(\n compiledResource.candidates.map((compiledCandidate) =>\n this._getCandidateValue(compiledCandidate.valueIndex)\n .aggregateError(\n errors,\n (message) => `Failed to convert candidate JSON for resource ${compiledResource.id}: ${message}`\n )\n .onSuccess((json) => {\n return succeed({\n json,\n isPartial: compiledCandidate.isPartial,\n mergeMethod: compiledCandidate.mergeMethod\n });\n })\n )\n )\n .aggregateError(\n errors,\n (message) => `Failed to convert candidate JSON for resource ${compiledResource.id}: ${message}`\n )\n .orDefault();\n\n /* c8 ignore next 3 - defensive coding: candidate JSON conversion should not fail with valid compiled data */\n if (candidateDecls === undefined) {\n continue;\n }\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 const candidatesWithConditionSets = decision.candidates.map((baseCandidate, idx) => ({\n conditionSet: baseCandidate.conditionSet,\n value: candidates[idx].json\n }));\n\n const concreteDecision = ConcreteDecision.create({\n decisions,\n candidates: candidatesWithConditionSets\n })\n .aggregateError(\n errors,\n (message) => `Failed to create concrete decision for resource ${compiledResource.id}: ${message}`\n )\n .orDefault();\n\n /* c8 ignore next 3 - defensive coding for ConcreteDecision creation failure */\n if (concreteDecision === undefined) {\n continue;\n }\n\n const name = Helpers.getNameForResourceId(compiledResource.id)\n .aggregateError(\n errors,\n (message) => `Failed to get name for resource ${compiledResource.id}: ${message}`\n )\n .orDefault();\n\n /* c8 ignore next 3 - defensive coding: name should be valid in compiled data */\n if (name === undefined) {\n continue;\n }\n\n // Create minimal resource that implements IResource\n const resource: IResource = {\n id: compiledResource.id,\n name,\n resourceType,\n decision: concreteDecision,\n candidates\n };\n\n resourceMap\n .set(compiledResource.id, resource)\n .aggregateError(errors, (message) => `Failed to add resource ${compiledResource.id}: ${message}`);\n }\n\n return errors.returnOrReport(succeed(resourceMap));\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conditionSetResolutionResult.js","sourceRoot":"","sources":["../../../src/packlets/runtime/conditionSetResolutionResult.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,aAAa,EAAU,MAAM,eAAe,CAAC;AAmBtD;;;;GAIG;AACH,MAAM,OAAO,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,aAAa,CAAC,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;gBAA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C;YAED,+DAA+D;QACjE,CAAC;QAED,0EAA0E;QAC1E,OAAO,CAAC,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;IAC7C,CAAC;IAED;;;;OAIG;IACH,IAAW,WAAW;QACpB,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC9D,OAAO,CAAsB,CAAC;QAChC,CAAC;QACD,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,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","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 /* c8 ignore next 5 - edge case comparison for matchAsDefault rarely hit in practice */\n if (b.matchType === 'match') {\n return 1;\n } else if (b.matchType === 'noMatch') {\n return -1;\n }\n } else {\n /* c8 ignore next 7 - edge case comparison for noMatch rarely hit in practice */\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 /* c8 ignore next 3 - edge case: score comparison when priorities are equal */\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"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contextQualifierProvider.js","sourceRoot":"","sources":["../../../../src/packlets/runtime/context/contextQualifierProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AA0GH;;;;GAIG;AACH,MAAM,OAAgB,wBAAwB;CAwC7C","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 * Base interface for providing qualifier values in an optimized runtime context.\n * Contains common read-only operations shared by both mutable and immutable providers.\n * Acts as a property bag using the Result pattern for qualifier value lookups.\n * @public\n */\nexport interface IContextQualifierProviderBase {\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 * Read-only interface for providing qualifier values in an optimized runtime context.\n * Explicitly marked as immutable with compile-time type discrimination.\n * @public\n */\nexport interface IReadOnlyContextQualifierProvider extends IContextQualifierProviderBase {\n /**\n * Explicit mutability marker for compile-time type discrimination.\n * Always `false` for read-only providers.\n */\n readonly mutable: false;\n}\n\n/**\n * Mutable interface for providing qualifier values in an optimized runtime context.\n * Extends the base interface with mutation operations and explicit mutability marker.\n * @public\n */\nexport interface IMutableContextQualifierProvider extends IContextQualifierProviderBase {\n /**\n * Explicit mutability marker for compile-time type discrimination.\n * Always `true` for mutable providers.\n */\n readonly mutable: true;\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 */\n set(name: QualifierName, value: QualifierContextValue): Result<QualifierContextValue>;\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 */\n remove(name: QualifierName): Result<QualifierContextValue>;\n\n /**\n * Clears all qualifier values from this provider.\n */\n clear(): void;\n}\n\n/**\n * Union type for context qualifier providers that can be either read-only or mutable.\n * Provides compile-time type discrimination via the `mutable` property.\n * @public\n */\nexport type IContextQualifierProvider = IReadOnlyContextQualifierProvider | IMutableContextQualifierProvider;\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 IContextQualifierProviderBase {\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"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contextQualifierProviderValidator.js","sourceRoot":"","sources":["../../../../src/packlets/runtime/context/contextQualifierProviderValidator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAU,aAAa,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAyB,OAAO,IAAI,gBAAgB,EAAE,MAAM,cAAc,CAAC;AA4IlF;;;GAGG;AACH,MAAe,qCAAqC;IASlD;;OAEG;IACH,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC;IAClC,CAAC;IAED;;;;;OAKG;IACI,GAAG,CAAC,IAAY;QACrB,OAAO,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,aAAa,EAAE,EAAE;YAC9E,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QAC1C,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACI,UAAU,CAAC,KAAa;QAC7B,OAAO,gBAAgB,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,cAAc,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IAED;;;;;;OAMG;IACI,GAAG,CAAC,IAAY,EAAE,KAAa;QACpC,OAAO,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,aAAa,EAAE,EAAE,CAC9E,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,SAAS,EAAE,EAAE,CAC7E,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE,EAAE,CACzD,SAAS,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAAC,SAAS,CAAC,CAAC,cAAc,EAAE,EAAE;YACvE,OAAO,aAAa,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC,CAAC,SAAS,CACpF,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CACnB,CAAC;QACJ,CAAC,CAAC,CACH,CACF,CACF,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,IAAY;QACxB,OAAO,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,aAAa,EAAE,EAAE;YAC9E,OAAO,aAAa,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC;QAChG,CAAC,CAAC,CAAC;IACL,CAAC;CACF","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, Converters } from '@fgv/ts-utils';\nimport { QualifierContextValue, Convert as CommonConverters } from '../../common';\nimport { IReadOnlyQualifierCollector } from '../../qualifiers';\nimport {\n IContextQualifierProvider,\n IReadOnlyContextQualifierProvider,\n IMutableContextQualifierProvider\n} from './contextQualifierProvider';\n\n/**\n * Base interface for shared operations between read-only and mutable context qualifier provider validators.\n * Contains common methods that don't depend on provider mutability.\n * @public\n */\nexport interface IContextQualifierProviderValidatorBase<\n T extends IContextQualifierProvider = IContextQualifierProvider\n> {\n /**\n * The wrapped context qualifier provider.\n */\n readonly provider: T;\n\n /**\n * The readonly qualifier collector that defines and validates the qualifiers for this context.\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/**\n * A read-only interface for validators wrapping read-only context qualifier providers.\n * Only exposes read operations, providing compile-time type safety by excluding mutation methods.\n * @public\n */\nexport interface IReadOnlyContextQualifierProviderValidator<\n T extends IReadOnlyContextQualifierProvider = IReadOnlyContextQualifierProvider\n> {\n /**\n * The wrapped read-only context qualifier provider.\n */\n readonly provider: T;\n}\n\n/**\n * A mutable interface for validators wrapping mutable context qualifier providers.\n * Extends the base interface with mutation operations and provides compile-time type safety.\n * @public\n */\nexport interface IMutableContextQualifierProviderValidator<\n T extends IMutableContextQualifierProvider = IMutableContextQualifierProvider\n> extends IContextQualifierProviderValidatorBase<T> {\n /**\n * The wrapped mutable context qualifier provider.\n */\n readonly provider: T;\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 read-only context qualifier provider validator.\n * @public\n */\nexport interface IReadOnlyContextQualifierProviderValidatorCreateParams<\n T extends IReadOnlyContextQualifierProvider = IReadOnlyContextQualifierProvider\n> {\n provider: T;\n}\n\n/**\n * Parameters for constructing a mutable context qualifier provider validator.\n * @public\n */\nexport interface IMutableContextQualifierProviderValidatorCreateParams<\n T extends IMutableContextQualifierProvider = IMutableContextQualifierProvider\n> {\n provider: T;\n}\n\n/**\n * Union type for validator constructor parameters.\n * @public\n */\nexport type IContextQualifierProviderValidatorCreateParams =\n | IReadOnlyContextQualifierProviderValidatorCreateParams\n | IMutableContextQualifierProviderValidatorCreateParams;\n\n/**\n * Base implementation class containing shared validation logic for both read-only and mutable validators.\n * @internal\n */\nabstract class BaseContextQualifierProviderValidator<\n T extends IContextQualifierProvider = IContextQualifierProvider\n> implements IContextQualifierProviderValidatorBase<T>\n{\n /**\n * The wrapped context qualifier provider.\n */\n public abstract readonly provider: T;\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 * 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 CommonConverters.qualifierName.convert(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 CommonConverters.qualifierIndex.convert(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 CommonConverters.qualifierName.convert(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 CommonConverters.qualifierIndex.convert(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 CommonConverters.qualifierName.convert(name).onSuccess((qualifierName) => {\n return this.provider.has(qualifierName);\n });\n }\n}\n\n/**\n * A validator for read-only context qualifier providers that accepts string inputs\n * and converts them to strongly-typed values before calling the wrapped provider.\n * Only provides read operations for compile-time type safety.\n * @public\n */\nexport class ReadOnlyContextQualifierProviderValidator<\n T extends IReadOnlyContextQualifierProvider = IReadOnlyContextQualifierProvider\n >\n extends BaseContextQualifierProviderValidator<T>\n implements IReadOnlyContextQualifierProviderValidator<T>\n{\n /**\n * The wrapped read-only context qualifier provider.\n */\n public readonly provider: T;\n\n /**\n * Constructs a new {@link Runtime.Context.ReadOnlyContextQualifierProviderValidator | ReadOnlyContextQualifierProviderValidator}.\n * @param params - Required parameters for constructing the validator.\n */\n public constructor(params: IReadOnlyContextQualifierProviderValidatorCreateParams<T>) {\n super();\n this.provider = params.provider;\n }\n}\n\n/**\n * A validator for mutable context qualifier providers that accepts string inputs\n * and converts them to strongly-typed values before calling the wrapped provider.\n * Provides both read and mutation operations.\n * @public\n */\nexport class MutableContextQualifierProviderValidator<\n T extends IMutableContextQualifierProvider = IMutableContextQualifierProvider\n >\n extends BaseContextQualifierProviderValidator<T>\n implements IMutableContextQualifierProviderValidator<T>\n{\n /**\n * The wrapped mutable context qualifier provider.\n */\n public readonly provider: T;\n\n /**\n * Constructs a new {@link Runtime.Context.MutableContextQualifierProviderValidator | MutableContextQualifierProviderValidator}.\n * @param params - Required parameters for constructing the validator.\n */\n public constructor(params: IMutableContextQualifierProviderValidatorCreateParams<T>) {\n super();\n this.provider = params.provider;\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 CommonConverters.qualifierName.convert(name).onSuccess((qualifierName) =>\n this.provider.qualifiers.validating.get(name).asResult.onSuccess((qualifier) =>\n Converters.string.convert(value).onSuccess((stringValue) =>\n qualifier.validateContextValue(stringValue).onSuccess((qualifierValue) => {\n return captureResult(() => this.provider.set(qualifierName, qualifierValue)).onSuccess(\n (result) => result\n );\n })\n )\n )\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 CommonConverters.qualifierName.convert(name).onSuccess((qualifierName) => {\n return captureResult(() => this.provider.remove(qualifierName)).onSuccess((result) => result);\n });\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/packlets/runtime/context/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qCAAqC,CAAC;AACpD,cAAc,kCAAkC,CAAC;AACjD,cAAc,4CAA4C,CAAC","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"]}
@@ -44,6 +44,9 @@ export class SimpleContextQualifierProvider extends ContextQualifierProvider {
44
44
  this._qualifierValues = new ResultMap();
45
45
  if (params.qualifierValues) {
46
46
  for (const [name, value] of Object.entries(params.qualifierValues)) {
47
+ if (value === undefined) {
48
+ continue;
49
+ }
47
50
  const qualifierName = Validate.toQualifierName(name).orThrow();
48
51
  this._qualifierValues.set(qualifierName, value);
49
52
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simpleContextQualifierProvider.js","sourceRoot":"","sources":["../../../../src/packlets/runtime/context/simpleContextQualifierProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;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SAAS,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1G,CAAC;IAED;;;;;;OAMG;IACK,MAAM,CAAC,+BAA+B,CAC5C,sBAAkE;QAElE,OAAO,UAAU,CAAC,GAAG,CACnB,uBAAuB,EACvB,CAAC,CAAC,EAAgC,EAAE,CAClC,OAAO,CAAC,KAAK,QAAQ;YACrB,CAAC,KAAK,IAAI;YACV,MAAM,IAAI,CAAC;YACX,OAAQ,CAA6B,CAAC,IAAI,KAAK,QAAQ,CAC1D;aACE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;aAC1D,OAAO,CAAC,sBAAsB,CAAC,CAAC;IACrC,CAAC;CACF","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, succeedWithDetail, Converters } from '@fgv/ts-utils';\nimport {\n QualifierName,\n QualifierContextValue,\n QualifierIndex,\n Validate,\n Convert as CommonConverters\n} from '../../common';\nimport { IReadOnlyQualifierCollector, Qualifier } from '../../qualifiers';\nimport { ContextQualifierProvider, IMutableContextQualifierProvider } 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 * @remarks\n * Typed as `Readonly<Partial<Record<string, QualifierContextValue>>>` so a\n * caller can naturally express conditional context construction, e.g.\n * `tone === 'formal' ? { tone: 'formal' } : {}`. Entries whose value is\n * `undefined` are skipped on load - semantically equivalent to omitting\n * the key, which is how the candidate selector treats a missing key.\n */\n qualifierValues?: Readonly<Partial<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\n extends ContextQualifierProvider\n implements IMutableContextQualifierProvider\n{\n /**\n * Explicit mutability marker for compile-time type discrimination.\n * Always `true` for mutable providers.\n */\n public readonly mutable: true = true as const;\n\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 if (value === undefined) {\n continue;\n }\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 return this._resolveQualifierName(nameOrIndexOrQualifier).onSuccess((qualifierName) => {\n return this._qualifierValues.get(qualifierName);\n });\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 return this._resolveQualifier(nameOrIndexOrQualifier).onSuccess((qualifier) => {\n return this._qualifierValues.get(qualifier.name).asResult.onSuccess((value) => {\n return qualifier.validateContextValue(value);\n });\n });\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 from a name, index, or qualifier object.\n * @param nameOrIndexOrQualifier - The input to resolve.\n * @returns `Success` with the {@link Qualifier | qualifier} if successful,\n * or `Failure` with an error message if not found or invalid.\n * @internal\n */\n private _resolveQualifier(\n nameOrIndexOrQualifier: QualifierName | QualifierIndex | Qualifier\n ): Result<Qualifier> {\n if (nameOrIndexOrQualifier instanceof Qualifier) {\n return succeed(nameOrIndexOrQualifier);\n }\n /* c8 ignore next 16 - functional code tested but coverage intermittently missed */\n if (typeof nameOrIndexOrQualifier === 'string') {\n return this.qualifiers.validating\n .get(nameOrIndexOrQualifier)\n .withErrorFormat((error) => `${nameOrIndexOrQualifier}: invalid qualifier name.`);\n }\n\n if (typeof nameOrIndexOrQualifier === 'number') {\n return this.qualifiers\n .getAt(nameOrIndexOrQualifier)\n .withErrorFormat((error) => `${nameOrIndexOrQualifier}: invalid qualifier index.`);\n }\n\n return SimpleContextQualifierProvider._qualifierNameFromQualifierLike(nameOrIndexOrQualifier)\n .onSuccess((qualifierName) => this.qualifiers.validating.get(qualifierName))\n .withErrorFormat((error) => `${nameOrIndexOrQualifier}: invalid Qualifier, name or index.`);\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 return this._resolveQualifier(nameOrIndexOrQualifier).onSuccess((qualifier) => succeed(qualifier.name));\n }\n\n /**\n * Resolves a qualifier name from a qualifier-like 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 static _qualifierNameFromQualifierLike(\n nameOrIndexOrQualifier: QualifierName | QualifierIndex | Qualifier\n ): Result<QualifierName> {\n return Converters.isA(\n 'Qualifier-like object',\n (v): v is { name: QualifierName } =>\n typeof v === 'object' &&\n v !== null &&\n 'name' in v &&\n typeof (v as Record<string, unknown>).name === 'string'\n )\n .map((v) => CommonConverters.qualifierName.convert(v.name))\n .convert(nameOrIndexOrQualifier);\n }\n}\n"]}
@@ -35,11 +35,9 @@ export class ValidatingSimpleContextQualifierProvider extends SimpleContextQuali
35
35
  * @param params - {@link Runtime.IValidatingSimpleContextQualifierProviderCreateParams | Parameters} used to create the provider.
36
36
  */
37
37
  constructor(params) {
38
- // Convert string values to QualifierContextValue for the base class
39
- /* c8 ignore next 5 - functional code path tested but coverage intermittently missed */
40
- const convertedValues = params.qualifierValues
41
- ? Object.fromEntries(Object.entries(params.qualifierValues).map(([key, value]) => [key, value]))
42
- : undefined;
38
+ // The branded QualifierContextValue is structurally a string; widen via cast
39
+ // and let the base class skip undefined entries on load.
40
+ const convertedValues = params.qualifierValues;
43
41
  super({
44
42
  qualifiers: params.qualifiers,
45
43
  qualifierValues: convertedValues
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validatingSimpleContextQualifierProvider.js","sourceRoot":"","sources":["../../../../src/packlets/runtime/context/validatingSimpleContextQualifierProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAU,aAAa,EAAE,MAAM,eAAe,CAAC;AAGtD,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAEL,wCAAwC,EACzC,MAAM,qCAAqC,CAAC;AA0B7C;;;;;;GAMG;AACH,MAAM,OAAO,wCAAyC,SAAQ,8BAA8B;IAO1F;;;OAGG;IACH,YAAsB,MAA6D;QACjF,6EAA6E;QAC7E,yDAAyD;QACzD,MAAM,eAAe,GAAG,MAAM,CAAC,eAElB,CAAC;QAEd,KAAK,CAAC;YACJ,UAAU,EAAE,MAAM,CAAC,UAAU;YAC7B,eAAe,EAAE,eAAe;SACjC,CAAC,CAAC;QAEH,IAAI,CAAC,UAAU,GAAG,IAAI,wCAAwC,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IACrF,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,MAAM,CAClB,MAA6D;QAE7D,OAAO,aAAa,CAAC,GAAG,EAAE,CAAC,IAAI,wCAAwC,CAAC,MAAM,CAAC,CAAC,CAAC;IACnF,CAAC;CACF","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 IMutableContextQualifierProviderValidator,\n MutableContextQualifierProviderValidator\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 * @remarks\n * Typed as `Readonly<Partial<Record<string, string>>>` so callers can\n * naturally express conditional context construction, e.g.\n * `tone === 'formal' ? { tone: 'formal' } : {}`. Entries whose value is\n * `undefined` are skipped on load - semantically equivalent to omitting\n * the key.\n */\n qualifierValues?: Readonly<Partial<Record<string, string>>>;\n}\n\n/**\n * A {@link Runtime.SimpleContextQualifierProvider | SimpleContextQualifierProvider} with a\n * {@link Runtime.Context.MutableContextQualifierProviderValidator | 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.MutableContextQualifierProviderValidator | MutableContextQualifierProviderValidator} which validates\n * string inputs before passing them to this provider.\n */\n public readonly validating: IMutableContextQualifierProviderValidator;\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 // The branded QualifierContextValue is structurally a string; widen via cast\n // and let the base class skip undefined entries on load.\n const convertedValues = params.qualifierValues as\n | Readonly<Partial<Record<string, QualifierContextValue>>>\n | undefined;\n\n super({\n qualifiers: params.qualifiers,\n qualifierValues: convertedValues\n });\n\n this.validating = new MutableContextQualifierProviderValidator({ 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"]}
@@ -0,0 +1 @@
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 { IResourceType } from '../resource-types';\nimport { IContextDecl, IValidatedContextDecl } from '../context';\nimport { IReadOnlyResourceTreeRoot } from './resource-tree';\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 name */\n readonly name: string;\n /** The resource type */\n readonly resourceType: IResourceType;\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<TR extends IResource = IResource> {\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<TR>;\n\n /**\n * Gets a resource tree built from the resources in this resource manager.\n * @returns Result containing the resource tree root, or failure if tree construction fails\n */\n getBuiltResourceTree(): Result<IReadOnlyResourceTreeRoot<TR>>;\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, TR>;\n\n /**\n * The number of resources in this resource manager.\n */\n readonly numResources: number;\n\n /**\n * The resource IDs that this resource manager can resolve.\n */\n readonly resourceIds: ReadonlyArray<ResourceId>;\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"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/runtime/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,0CAA0C,CAAC;AACzD,cAAc,oDAAoD,CAAC;AACnE,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,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","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 './resourceTreeResolver';\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"]}
@@ -0,0 +1 @@
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<TNAME, 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"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/packlets/runtime/resource-tree/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,wBAAwB,CAAC;AACvC,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC","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"]}