@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":"contextQualifierProvider.js","sourceRoot":"","sources":["../../../../src/packlets/runtime/context/contextQualifierProvider.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AA0GH;;;;GAIG;AACH,MAAsB,wBAAwB;CAwC7C;AAxCD,4DAwCC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Result } from '@fgv/ts-utils';\nimport { QualifierName, QualifierContextValue, QualifierIndex } from '../../common';\nimport { IReadOnlyQualifierCollector, Qualifier } from '../../qualifiers';\n\n/**\n * 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.d.ts","sourceRoot":"","sources":["../../../../src/packlets/runtime/context/contextQualifierProviderValidator.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,MAAM,EAA6B,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAA+B,MAAM,cAAc,CAAC;AAClF,OAAO,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EACL,yBAAyB,EACzB,iCAAiC,EACjC,gCAAgC,EACjC,MAAM,4BAA4B,CAAC;AAEpC;;;;GAIG;AACH,MAAM,WAAW,sCAAsC,CACrD,CAAC,SAAS,yBAAyB,GAAG,yBAAyB;IAE/D;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;IAErB;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,2BAA2B,CAAC;IAEjD;;;;;OAKG;IACH,GAAG,CAAC,IA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;;;;OAMG;IACI,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,qBAAqB,CAAC;IActE;;;;;OAKG;IACI,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,qBAAqB,CAAC;CAK3D"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contextQualifierProviderValidator.js","sourceRoot":"","sources":["../../../../src/packlets/runtime/context/contextQualifierProviderValidator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAAkE;AAClE,yCAAkF;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,EAAE,EAAE;YACjF,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACI,YAAY,CAAC,IAAY;QAC9B,OAAO,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,aAAa,EAAE,EAAE;YAC9E,OAAO,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;QACnD,CAAC,C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AAK,CAAC,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE,EAAE,CACzD,SAAS,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAAC,SAAS,CAAC,CAAC,cAAc,EAAE,EAAE;YACvE,OAAO,IAAA,wBAAa,EAAC,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,IAAA,wBAAa,EAAC,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;AApDD,4FAoDC","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.d.ts","sourceRoot":"","sources":["../../../../src/packlets/runtime/context/index.ts"],"names":[],"mappings":"AAsBA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qCAAqC,CAAC;AACpD,cAAc,kCAAkC,CAAC;AACjD,cAAc,4CAA4C,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/packlets/runtime/context/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;AAEH,6DAA2C;AAC3C,sEAAoD;AACpD,mEAAiD;AACjD,6EAA2D","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nexport * from './contextQualifierProvider';\nexport * from './contextQualifierProviderValidator';\nexport * from './simpleContextQualifierProvider';\nexport * from './validatingSimpleContextQualifierProvider';\n"]}
@@ -13,8 +13,15 @@ export interface ISimpleContextQualifierProviderCreateParams {
13
13
  qualifiers: IReadOnlyQualifierCollector;
14
14
  /**
15
15
  * Optional record of initial qualifier name-value pairs to populate the provider.
16
- */
17
- qualifierValues?: Record<string, QualifierContextValue>;
16
+ *
17
+ * @remarks
18
+ * Typed as `Readonly<Partial<Record<string, QualifierContextValue>>>` so a
19
+ * caller can naturally express conditional context construction, e.g.
20
+ * `tone === 'formal' ? { tone: 'formal' } : {}`. Entries whose value is
21
+ * `undefined` are skipped on load - semantically equivalent to omitting
22
+ * the key, which is how the candidate selector treats a missing key.
23
+ */
24
+ qualifierValues?: Readonly<Partial<Record<string, QualifierContextValue>>>;
18
25
  }
19
26
  /**
20
27
  * Simple concrete implementation of {@link Runtime.Context.IContextQualifierProvider | IContextQualifierProvider}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simpleContextQualifierProvider.d.ts","sourceRoot":"","sources":["../../../../src/packlets/runtime/context/simpleContextQualifierProvider.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,MAAM,EAAoE,MAAM,eAAe,CAAC;AACzG,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,cAAc,EAGf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,2BAA2B,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAE,wBAAwB,EAAE,gCAAgC,EAAE,MAAM,4BAA4B,CAAC;AAExG;;;GAGG;AACH,MAAM,WAAW,2CAA2C;IAC1D;;OAEG;IACH,UAAU,EAAE,2BAA2B,CAAC;IAExC;;;;;;;;;OASG;IACH,eAAe,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAAC;CAC5E;AAED;;;;GAIG;AACH,qBAAa,8BACX,SAAQ,wBACR,YAAW,gCAAgC;IAE3C;;;OAGG;IACH,SAAgB,OAAO,EAAE,IAAI,CAAiB;IAE9C;;OAEG;IACH,SAAgB,UAAU,EAAE,2BAA2B,CAAC;IAExD;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAkD;IAEnF;;;OAGG;IACH,SAAS,aAAa,MAAM,EAAE,2CAA2C;IAgBzE;;;;;;OAMG;WACW,MAAM,CAClB,MAAM,EAAE,2CAA2C,GAClD,MAAM,CAAC,8BAA8B,CAAC;IAIzC;;;;;OAKG;IACI,GAAG,CACR,sBAAsB,EAAE,aAAa,GAAG,cAAc,GAAG,SAAS,GACjE,MAAM,CAAC,qBAAqB,CAAC;IAMhC;;;;;;OAMG;IACI,YAAY,CACjB,sBAAsB,EAAE,aAAa,GAAG,cAAc,GAAG,SAAS,GACjE,MAAM,CAAC,qBAAqB,CAAC;IAQhC;;;;;OAKG;IACI,GAAG,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC;IAIhD;;;;OAIG;IACI,QAAQ,IAAI,MAAM,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC;IAIvD;;;;;;;OAOG;IACI,GAAG,CAAC,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,qBAAqB,GAAG,MAAM,CAAC,qBAAqB,CAAC;IAK5F;;;;;;OAMG;IACI,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAAC,qBAAqB,CAAC;IAOjE;;;;OAIG;IACH,IAAW,IAAI,IAAI,MAAM,CAExB;IAED;;;OAGG;IACI,KAAK,IAAI,IAAI;IAIpB;;;;;;OAMG;IACH,OAAO,CAAC,iBAAiB;IAwBzB;;;;;;OAMG;IACH,OAAO,CAAC,qBAAqB;IAM7B;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,+BAA+B;CAc/C"}
@@ -47,6 +47,9 @@ class SimpleContextQualifierProvider extends contextQualifierProvider_1.ContextQ
47
47
  this._qualifierValues = new ts_utils_1.ResultMap();
48
48
  if (params.qualifierValues) {
49
49
  for (const [name, value] of Object.entries(params.qualifierValues)) {
50
+ if (value === undefined) {
51
+ continue;
52
+ }
50
53
  const qualifierName = common_1.Validate.toQualifierName(name).orThrow();
51
54
  this._qualifierValues.set(qualifierName, value);
52
55
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simpleContextQualifierProvider.js","sourceRoot":"","sources":["../../../../src/packlets/runtime/context/simpleContextQualifierProvider.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAAyG;AACzG,yCAMsB;AACtB,iDAA0E;AAC1E,yEAAwG;AAyBxG;;;;GAIG;AACH,MAAa,8BACX,SAAQ,mDAAwB;IAmBhC;;;OAGG;IACH,YAAsB,MAAmD;QACvE,KAAK,EAAE,CAAC;QArBV;;;WAGG;QACa,YAAO,GAAS,IAAa,CAAC;QAkB5C,IAAI,CAAC,UAAU,GAAG,MAA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,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;aAC1D,OAAO,CAAC,sBAAsB,CAAC,CAAC;IACrC,CAAC;CACF;AApND,wEAoNC","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"]}
@@ -14,8 +14,15 @@ export interface IValidatingSimpleContextQualifierProviderCreateParams {
14
14
  /**
15
15
  * Optional record of initial qualifier name-value pairs to populate the provider.
16
16
  * Accepts string keys and values which will be converted to strongly-typed values.
17
+ *
18
+ * @remarks
19
+ * Typed as `Readonly<Partial<Record<string, string>>>` so callers can
20
+ * naturally express conditional context construction, e.g.
21
+ * `tone === 'formal' ? { tone: 'formal' } : {}`. Entries whose value is
22
+ * `undefined` are skipped on load - semantically equivalent to omitting
23
+ * the key.
17
24
  */
18
- qualifierValues?: Record<string, string>;
25
+ qualifierValues?: Readonly<Partial<Record<string, string>>>;
19
26
  }
20
27
  /**
21
28
  * A {@link Runtime.SimpleContextQualifierProvider | SimpleContextQualifierProvider} with a
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validatingSimpleContextQualifierProvider.d.ts","sourceRoot":"","sources":["../../../../src/packlets/runtime/context/validatingSimpleContextQualifierProvider.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,MAAM,EAAiB,MAAM,eAAe,CAAC;AAEtD,OAAO,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EACL,yCAAyC,EAE1C,MAAM,qCAAqC,CAAC;AAE7C;;;GAGG;AACH,MAAM,WAAW,qDAAqD;IACpE;;OAEG;IACH,UAAU,EAAE,2BAA2B,CAAC;IAExC;;;;;;;;;;OAUG;IACH,eAAe,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;CAC7D;AAED;;;;;;GAMG;AACH,qBAAa,wCAAyC,SAAQ,8BAA8B;IAC1F;;;OAGG;IACH,SAAgB,UAAU,EAAE,yCAAyC,CAAC;IAEtE;;;OAGG;IACH,SAAS,aAAa,MAAM,EAAE,qDAAqD;IAenF;;;;;;OAMG;WACW,MAAM,CAClB,MAAM,EAAE,qDAAqD,GAC5D,MAAM,CAAC,wCAAwC,CAAC;CAGpD"}
@@ -38,11 +38,9 @@ class ValidatingSimpleContextQualifierProvider extends simpleContextQualifierPro
38
38
  * @param params - {@link Runtime.IValidatingSimpleContextQualifierProviderCreateParams | Parameters} used to create the provider.
39
39
  */
40
40
  constructor(params) {
41
- // Convert string values to QualifierContextValue for the base class
42
- /* c8 ignore next 5 - functional code path tested but coverage intermittently missed */
43
- const convertedValues = params.qualifierValues
44
- ? Object.fromEntries(Object.entries(params.qualifierValues).map(([key, value]) => [key, value]))
45
- : undefined;
41
+ // The branded QualifierContextValue is structurally a string; widen via cast
42
+ // and let the base class skip undefined entries on load.
43
+ const convertedValues = params.qualifierValues;
46
44
  super({
47
45
  qualifiers: params.qualifiers,
48
46
  qualifierValues: convertedValues
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validatingSimpleContextQualifierProvider.js","sourceRoot":"","sources":["../../../../src/packlets/runtime/context/validatingSimpleContextQualifierProvider.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAAsD;AAGtD,qFAAkF;AAClF,2FAG6C;AA0B7C;;;;;;GAMG;AACH,MAAa,wCAAyC,SAAQ,+DAA8B;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,4EAAwC,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IACrF,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,MAAM,CAClB,MAA6D;QAE7D,OAAO,IAAA,wBAAa,EAAC,GAAG,EAAE,CAAC,IAAI,wCAAwC,CAAC,MAAM,CAAC,CAAC,CAAC;IACnF,CAAC;CACF;AAtCD,4FAsCC","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.d.ts","sourceRoot":"","sources":["../../../src/packlets/runtime/iResourceManager.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,0BAA0B,EAAE,6BAA6B,EAAE,MAAM,eAAe,CAAC;AAC1F,OAAO,EAAE,iCAAiC,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACnF,OAAO,EAAE,UAAU,EA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H,QAAQ,CAAC,cAAc,EAAE,WAAW,CAAC,4BAA4B,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IAElF;;OAEG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAE9B;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;IAEhD;;OAEG;IACH,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAE/B;;;;OAIG;IACH,eAAe,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;CACvE"}
@@ -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.d.ts","sourceRoot":"","sources":["../../../src/packlets/runtime/index.ts"],"names":[],"mappings":"AAsBA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,0CAA0C,CAAC;AACzD,cAAc,oDAAoD,CAAC;AACnE,cAAc,oBAAoB,CAAC;AACnC,cAAc,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"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/runtime/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,+DAA6C;AAC7C,qDAAmC;AACnC,2EAAyD;AACzD,qFAAmE;AACnE,qDAAmC;AACnC,yDAAuC;AACvC,iEAA+C;AAC/C,kDAAgC;AAChC,iDAA+B;AAE/B,mDAAqC;AAG5B,0BAAO;AAFhB,8DAAgD;AAE9B,oCAAY","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nexport * from './compiledResourceCollection';\nexport * from './iResourceManager';\nexport * from './context/simpleContextQualifierProvider';\nexport * from './context/validatingSimpleContextQualifierProvider';\nexport * from './resourceResolver';\nexport * from './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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AAG,2BAA2B,CAAC,CAAC,CAAC,CAAC;AAEzG;;;GAGG;AACH,MAAM,WAAW,6BAA6B,CAC5C,CAAC,EACD,GAAG,SAAS,MAAM,GAAG,UAAU,EAC/B,KAAK,SAAS,MAAM,GAAG,YAAY,CACnC,SAAQ,kBAAkB,CAAC,KAAK,EAAE,yBAAyB,CAAC,CAAC,CAAC,CAAC;IAC/D;;;;OAIG;IACH,OAAO,CAAC,EAAE,EAAE,GAAG,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,CAAC;IAEvD;;;;OAIG;IACH,WAAW,CAAC,IAAI,EAAE,KAAK,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,CAAC;IAE/D;;;;OAIG;IACH,SAAS,CAAC,IAAI,EAAE,KAAK,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,CAAC;IAE7D;;;;OAIG;IACH,eAAe,CAAC,EAAE,EAAE,GAAG,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,CAAC;IAE/D;;;;OAIG;IACH,aAAa,CAAC,EAAE,EAAE,GAAG,GAAG,MAAM,CAAC,2BAA2B,CAAC,CAAC,CAAC,CAAC,CAAC;CAChE;AAED;;;GAGG;AACH,MAAM,WAAW,uCAAuC,CAAC,CAAC,CAAE,SAAQ,6BAA6B,CAAC,CAAC,CAAC;IAClG,QAAQ,CAAC,UAAU,EAAE,6BAA6B,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;CACvE"}
@@ -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.d.ts","sourceRoot":"","sources":["../../../../src/packlets/runtime/resource-tree/index.ts"],"names":[],"mappings":"AAsBA,cAAc,UAAU,CAAC;AACzB,cAAc,wBAAwB,CAAC;AACvC,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/packlets/runtime/resource-tree/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;AAEH,2CAAyB;AACzB,yDAAuC;AACvC,kEAAgD;AAChD,yDAAuC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nexport * from './common';\nexport * from './resourceTreeChildren';\nexport * from './resourceTreeChildrenValidator';\nexport * from './readOnlyResourceTree';\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readOnlyResourceTree.d.ts","sourceR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,CAAC,CAAE,YAAW,yBAAyB,CAAC,CAAC,CAAC;IAC9E,SAAgB,QAAQ,EAAE,uCAAuC,CAAC,CAAC,CAAC,CAAC;IAErE,IAAW,MAAM,IAAI,IAAI,CAExB;IAED,IAAW,QAAQ,IAAI,KAAK,CAE3B;IAED,IAAW,MAAM,IAAI,KAAK,CAEzB;IAED;;;OAGG;IACH,SAAS,aAAa,IAAI,EAAE,qBAAqB,CAAC,CAAC,CAAC;IAqBpD;;;;OAIG;WACW,MAAM,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,UAAU,EAAE,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC;IAE1F;;;;OAIG;WACW,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC;IAkB5F;;;;;;OAMG;WACW,sBAAsB,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,UAAU,EAAE,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;CA6CxG"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readOnlyResourceTree.js","sourceRoot":"","sources":["../../../../src/packlets/runtime/resource-tree/readOnlyResourceTree.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAkDH,oEAIC;AAQD,wDAEC;AA9DD,4CAA8F;AAC9F,yCAAiE;AAQjE,iEAAsE;AAgCtE,cAAc;AACd;;;;;GAKG;AACH,SAAgB,4BAA4B,CAC1C,IAAwD;IAExD,OAAO,UAAU,IAAI,IAAI,CAAC;AAC5B,CAAC;AAED;;;;;GAKG;AACH,SAAgB,sBAAsB,CAAI,IAA6B;IACrE,OAAO,UAAU,IAAI,IAAI,IAAI,CAAC,CAAC,UAAU,IAAI,IAAI,CAAC,CAAC;AACrD,CAAC;AAED;;;;GAIG;AACH,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AAU,CAAC,GAAG,EAAE,uCAAuC,CAAC,CAAC;gBAClE,CAAC;gBACD,OAAO,IAAA,kBAAO,EAAC,WAAW,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC;YACrD,CAAC,CAAC;iBACD,cAAc,CAAC,MAAM,CAAC,CAAC;QAC5B,CAAC;QACD,OAAO,MAAM,CAAC,cAAc,CAAC,IAAA,kBAAO,EAAC,IAAI,CAAC,CAAC,CAAC;IAC9C,CAAC;CACF;AA1HD,4DA0HC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { MessageAggregator, Result, captureResult, mapResults, succeed } from '@fgv/ts-utils';\nimport { ResourceId, ResourceName, Helpers } from '../../common';\nimport {\n IReadOnlyResourceTreeNode,\n IReadOnlyResourceTreeLeaf,\n IReadOnlyResourceTreeBranch,\n IReadOnlyResourceTreeRoot,\n IReadOnlyValidatingResourceTreeChildren\n} from './common';\nimport { ReadOnlyResourceTreeChildren } from './resourceTreeChildren';\n\n/**\n * Interface for initializing a resource tree root with child nodes.\n * @public\n */\nexport interface IResourceTreeRootInit<T> {\n readonly children: Record<ResourceName, ResourceTreeNodeInit<T>>;\n}\n\n/**\n * Interface for initializing a leaf node with a resource value.\n * @public\n */\nexport interface IResourceTreeLeafInit<T> {\n readonly resource: T;\n}\n\n/**\n * Interface for initializing a branch node with child nodes.\n * @public\n */\nexport interface IResourceTreeBranchInit<T> {\n readonly children: Record<ResourceName, ResourceTreeNodeInit<T>>;\n}\n\n/**\n * Union type for tree node initialization data.\n * @public\n */\nexport type ResourceTreeNodeInit<T> = IResourceTreeLeafInit<T> | IResourceTreeBranchInit<T>;\n\n// Type guards\n/**\n * Type guard to determine if an init object represents a branch or root with children.\n * @param init - The initialization object to test\n * @returns True if the init object has children property\n * @public\n */\nexport function isResourceTreeRootOrNodeInit<T>(\n init: ResourceTreeNodeInit<T> | IResourceTreeRootInit<T>\n): init is IResourceTreeBranchInit<T> {\n return 'children' in init;\n}\n\n/**\n * Type guard to determine if an init object represents a leaf node with a resource.\n * @param init - The initialization object to test\n * @returns True if the init object has a resource but no children\n * @public\n */\nexport function isResourceTreeLeafInit<T>(init: ResourceTreeNodeInit<T>): init is IResourceTreeLeafInit<T> {\n return 'resource' in init && !('children' in init);\n}\n\n/**\n * Implementation of a read-only resource tree leaf node that contains a resource value.\n * Leaf nodes represent the actual resources in the tree and cannot have children.\n * @public\n */\nexport class ReadOnlyResourceTreeLeaf<T> implements IReadOnlyResourceTreeLeaf<T> {\n public readonly name: ResourceName;\n public readonly id: ResourceId;\n public readonly resource: T;\n\n public get isRoot(): false {\n return false;\n }\n\n public get isBranch(): false {\n return false;\n }\n\n public get isLeaf(): true {\n return true;\n }\n\n /**\n * Creates a new leaf node. Use the static create method instead.\n * @param name - The name of this node (last segment of the path)\n * @param parentPath - The path to the parent node (undefined for root-level nodes)\n * @param resource - The resource value stored in this leaf\n */\n protected constructor(name: ResourceName, parentPath: ResourceId | undefined, resource: T) {\n this.name = name;\n this.id = Helpers.joinResourceIds(parentPath, name).orThrow();\n this.resource = resource;\n }\n\n /**\n * Creates a new ReadOnlyResourceTreeLeaf instance.\n * @param name - The name of this node (last segment of the path)\n * @param parentPath - The path to the parent node (undefined for root-level nodes)\n * @param resource - The resource value to store in this leaf\n * @returns Result containing the new leaf node or failure if construction fails\n */\n public static create<T>(\n name: ResourceName,\n parentPath: ResourceId | undefined,\n resource: T\n ): Result<ReadOnlyResourceTreeLeaf<T>> {\n return captureResult(() => new ReadOnlyResourceTreeLeaf(name, parentPath, resource));\n }\n}\n\n/**\n * Implementation of a read-only resource tree branch node that contains child nodes.\n * Branch nodes organize other nodes in a hierarchical structure and may optionally contain a resource value.\n * @public\n */\nexport class ReadOnlyResourceTreeBranch<T> implements IReadOnlyResourceTreeBranch<T> {\n public readonly children: IReadOnlyValidatingResourceTreeChildren<T>;\n public readonly name: ResourceName;\n public readonly id: ResourceId;\n\n public get isRoot(): false {\n return false;\n }\n\n public get isBranch(): true {\n return true;\n }\n\n public get isLeaf(): false {\n return false;\n }\n\n /**\n * Creates a new branch node. Use the static create method instead.\n * @param name - The name of this node (last segment of the path)\n * @param parentPath - The path to the parent node (undefined for root-level nodes)\n * @param init - Initialization data containing child nodes\n */\n private constructor(\n name: ResourceName,\n parentPath: ResourceId | undefined,\n init: IResourceTreeBranchInit<T>\n ) {\n this.name = name;\n this.id = Helpers.joinResourceIds(parentPath, name).orThrow();\n\n const children = mapResults<IReadOnlyResourceTreeNode<T>>(\n (\n Array.from(Object.entries(init.children)) as [\n ResourceName,\n IResourceTreeBranchInit<T> | IResourceTreeLeafInit<T>\n ][]\n ).map(([childName, childInit]) => {\n if (isResourceTreeLeafInit(childInit)) {\n return ReadOnlyResourceTreeLeaf.create(childName, this.id, childInit.resource);\n }\n return ReadOnlyResourceTreeBranch.create(childName, this.id, childInit);\n })\n ).orThrow();\n\n this.children = new ReadOnlyResourceTreeChildren(\n this.id,\n children.map((c): [ResourceName, IReadOnlyResourceTreeNode<T>] => [c.name, c])\n );\n }\n\n /**\n * Creates a new ReadOnlyResourceTreeBranch instance.\n * @param childName - The name of this node (last segment of the path)\n * @param path - The path to the parent node (undefined for root-level nodes)\n * @param childInit - Initialization data containing child nodes\n * @returns Result containing the new branch node or failure if construction fails\n */\n public static create<T>(\n childName: ResourceName,\n path: ResourceId | undefined,\n childInit: IResourceTreeBranchInit<T>\n ): Result<ReadOnlyResourceTreeBranch<T>> {\n return captureResult(() => new ReadOnlyResourceTreeBranch(childName, path, childInit));\n }\n}\n\n/**\n * Union type representing any node in a read-only resource tree.\n * @public\n */\nexport type ReadOnlyResourceTreeNode<T> = ReadOnlyResourceTreeBranch<T> | ReadOnlyResourceTreeLeaf<T>;\n\n/**\n * Implementation of a read-only resource tree root that organizes resources hierarchically.\n * The root provides the entry point for tree navigation and resource access by ResourceId paths.\n * @public\n */\nexport class ReadOnlyResourceTreeRoot<T> implements IReadOnlyResourceTreeRoot<T> {\n public readonly children: IReadOnlyValidatingResourceTreeChildren<T>;\n\n public get isRoot(): true {\n return true;\n }\n\n public get isBranch(): false {\n return false;\n }\n\n public get isLeaf(): false {\n return false;\n }\n\n /**\n * Creates a new root node. Use the static create method instead.\n * @param init - Initialization data containing child nodes\n */\n protected constructor(init: IResourceTreeRootInit<T>) {\n const children = mapResults<ReadOnlyResourceTreeBranch<T> | ReadOnlyResourceTreeLeaf<T>>(\n (\n Array.from(Object.entries(init.children)) as [\n ResourceName,\n IResourceTreeBranchInit<T> | IResourceTreeLeafInit<T>\n ][]\n ).map(([childName, childInit]) => {\n if (isResourceTreeLeafInit(childInit)) {\n return ReadOnlyResourceTreeLeaf.create(childName, undefined, childInit.resource);\n }\n return ReadOnlyResourceTreeBranch.create(childName, undefined, childInit);\n })\n ).orThrow();\n\n this.children = new ReadOnlyResourceTreeChildren(\n undefined,\n children.map((c): [ResourceName, IReadOnlyResourceTreeNode<T>] => [c.name, c])\n );\n }\n\n /**\n * Creates a new ReadOnlyResourceTreeRoot from an array of resources.\n * @param resources - Array of [ResourceId, resource] pairs to build the tree from\n * @returns Result containing the new root or failure if construction fails\n */\n public static create<T>(resources: [ResourceId, T][]): Result<ReadOnlyResourceTreeRoot<T>>;\n\n /**\n * Creates a new ReadOnlyResourceTreeRoot from initialization data.\n * @param init - Tree initialization structure\n * @returns Result containing the new root or failure if construction fails\n */\n public static create<T>(init: IResourceTreeRootInit<T>): Result<ReadOnlyResourceTreeRoot<T>>;\n\n /**\n * Creates a new ReadOnlyResourceTreeRoot from either resources or initialization data.\n * @param init - Either an array of [ResourceId, resource] pairs or tree initialization structure\n * @returns Result containing the new root or failure if construction fails\n */\n public static create<T>(\n init: IResourceTreeRootInit<T> | [ResourceId, T][]\n ): Result<ReadOnlyResourceTreeRoot<T>> {\n if (Array.isArray(init)) {\n return ReadOnlyResourceTreeRoot.createResourceTreeInit(init).onSuccess((treeInit) =>\n captureResult(() => new ReadOnlyResourceTreeRoot(treeInit))\n );\n }\n return captureResult(() => new ReadOnlyResourceTreeRoot(init));\n }\n\n /**\n * Converts an array of resources into tree initialization data.\n * Validates that resource paths do not conflict - if a path has child resources,\n * it cannot itself be a resource (e.g., if 'app.messages.welcome' exists, then 'app' cannot be a resource).\n * @param resources - Array of [ResourceId, resource] pairs to convert\n * @returns Result containing the initialization structure or failure if validation fails\n */\n public static createResourceTreeInit<T>(resources: [ResourceId, T][]): Result<IResourceTreeRootInit<T>> {\n const errors: MessageAggregator = new MessageAggregator();\n const root: IResourceTreeRootInit<T> = { children: {} };\n\n for (const [id, resource] of resources) {\n Helpers.splitResourceId(id)\n .onSuccess((pathComponents) => {\n let currentNode: IResourceTreeBranchInit<T> | IResourceTreeRootInit<T> = root;\n const resourceName = pathComponents.pop()!;\n\n for (const nodeName of pathComponents) {\n if (isResourceTreeRootOrNodeInit(currentNode)) {\n if (!(nodeName in currentNode.children)) {\n currentNode.children[nodeName] = { children: {} };\n }\n if (isResourceTreeLeafInit(currentNode.children[nodeName])) {\n errors.addMessage(`${id}: Expected a branch but found a leaf at ${nodeName}.`);\n } else {\n currentNode = currentNode.children[nodeName];\n }\n } /* c8 ignore next 4 - defense in depth, not reachable without chicanery */ else if (\n isResourceTreeLeafInit(currentNode)\n ) {\n errors.addMessage(`${id}: Expected a branch but found a leaf.`);\n break;\n } /* c8 ignore next 3 - defense in depth, not reachable without chicanery */ else {\n errors.addMessage(`${id}: Unexpected structure in resource tree`);\n }\n }\n\n if (isResourceTreeRootOrNodeInit(currentNode)) {\n if (resourceName in currentNode.children) {\n errors.addMessage(`${id}: Duplicate resource at path.`);\n } else {\n currentNode.children[resourceName] = { resource };\n } /* c8 ignore next 3 - defense in depth, not reachable without chicanery */\n } else {\n errors.addMessage(`${id}: Expected a branch but found a leaf.`);\n }\n return succeed(currentNode.children[resourceName]);\n })\n .aggregateError(errors);\n }\n return errors.returnOrReport(succeed(root));\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resourceTreeChildren.d.ts","sourceRoot":"","sources":["../../../../src/packlets/runtime/resource-tree/resourceTreeChildren.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAe,MAAM,EAAE,SAAS,EAAiB,MAAM,eAAe,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,YAAY,EAAW,MAAM,cAAc,CAAC;AACjE,OAAO,EACL,2BAA2B,EAC3B,6BAA6B,EAC7B,yBAAyB,EACzB,yBAAyB,EACzB,uCAAuC,EACxC,MAAM,UAAU,CAAC;AAGlB;;;;GAIG;AACH,qBAAa,4BAA4B,CAAC,CAAC,CACzC,SAAQ,SAAS,CAAC,YAAY,EAAE,yBAAyB,CAAC,CAAC,CAAC,CAC5D,YAAW,uCAAuC,CAAC,CAAC,CAAC;IAErD,SAAS,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,CAAC;IAChC,UAAU,EAAE,6BAA6B,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAEpE;;;;OAIG;gBACgB,IAAI,EAAE,UAAU,GAAG,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AAS,CACV,CAAC;YACJ,CAAC;YACD,kFAAkF;YAClF,OAAO,IAAA,eAAI,EACT,GAAG,EAAE,iBAAiB,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,CAC7D,CAAC,UAAU,CAAoC,SAAS,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAzFD,oEAyFC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Collections, Result, ResultMap, fail, succeed } from '@fgv/ts-utils';\nimport { ResourceId, ResourceName, Helpers } from '../../common';\nimport {\n IReadOnlyResourceTreeBranch,\n IReadOnlyResourceTreeChildren,\n IReadOnlyResourceTreeLeaf,\n IReadOnlyResourceTreeNode,\n IReadOnlyValidatingResourceTreeChildren\n} from './common';\nimport { ResourceTreeChildrenValidator } from './resourceTreeChildrenValidator';\n\n/**\n * Implementation of a result-based resource tree that provides hierarchical access to resources.\n * Extends ResultMap to provide collection-like access while adding tree-specific navigation methods.\n * @public\n */\nexport class ReadOnlyResourceTreeChildren<T>\n extends ResultMap<ResourceName, IReadOnlyResourceTreeNode<T>>\n implements IReadOnlyValidatingResourceTreeChildren<T>\n{\n protected path: ResourceId | undefined;\n public validating: IReadOnlyResourceTreeChildren<T, string, string>;\n\n /**\n * Creates a new ReadOnlyResourceTreeChildren instance.\n * @param path - The path to this tree node (undefined for root)\n * @param entries - Array of [name, node] tuples to populate the tree\n */\n public constructor(path: ResourceId | undefined, entries: [ResourceName, IReadOnlyResourceTreeNode<T>][]) {\n super(entries);\n this.path = path;\n this.validating = new ResourceTreeChildrenValidator<T>(this);\n }\n\n public getResource(name: ResourceName): Result<IReadOnlyResourceTreeNode<T>> {\n return this.get(name).onSuccess((node) => {\n if (node.isLeaf) {\n return succeed(node).withDetail<Collections.ResultMapResultDetail>('success');\n }\n /* c8 ignore next 3 - functional code tested but coverage intermittently missed */\n return fail<IReadOnlyResourceTreeNode<T>>(\n `${name}: not a resource${this.path ? ` in ${this.path}` : ''}.`\n ).withDetail<Collections.ResultMapResultDetail>('failure');\n });\n }\n\n public getBranch(name: ResourceName): Result<IReadOnlyResourceTreeNode<T>> {\n return this.get(name).onSuccess((node) => {\n if (node.isBranch) {\n return succeed(node).withDetail<Collections.ResultMapResultDetail>('success');\n }\n /* c8 ignore next 3 - functional code tested but coverage intermittently missed */\n return fail<IReadOnlyResourceTreeNode<T>>(\n `${name}: not a branch${this.path ? ` in ${this.path}` : ''}.`\n ).withDetail<Collections.ResultMapResultDetail>('failure');\n });\n }\n\n public getById(id: ResourceId): Result<IReadOnlyResourceTreeNode<T>> {\n return Helpers.splitResourceId(id).onSuccess((names) => {\n let name = names.shift();\n if (name !== undefined) {\n let node = this.get(name).orDefault();\n while (node) {\n name = names.shift();\n if (name === undefined) {\n return succeed(node);\n }\n if (node.isLeaf) {\n /* c8 ignore next 1 - defense in depth */\n return fail(`${id}: resource not found${this.path ? ` in ${this.path}` : ''}.`);\n }\n node = (node as IReadOnlyResourceTreeBranch<T>).children.get(name).orDefault();\n }\n }\n return fail(`${id}: resource not found${this.path ? ` in ${this.path}` : ''}.`);\n });\n }\n\n public getResourceById(id: ResourceId): Result<IReadOnlyResourceTreeLeaf<T>> {\n return this.getById(id).onSuccess((node) => {\n if (node.isLeaf) {\n return succeed(node as IReadOnlyResourceTreeLeaf<T>).withDetail<Collections.ResultMapResultDetail>(\n 'success'\n );\n }\n return fail<IReadOnlyResourceTreeLeaf<T>>(\n `${id}: not a resource${this.path ? ` in ${this.path}` : ''}.`\n ).withDetail<Collections.ResultMapResultDetail>('failure');\n });\n }\n\n public getBranchById(id: ResourceId): Result<IReadOnlyResourceTreeBranch<T>> {\n return this.getById(id).onSuccess((node) => {\n if (node.isBranch) {\n return succeed(node as IReadOnlyResourceTreeBranch<T>).withDetail<Collections.ResultMapResultDetail>(\n 'success'\n );\n }\n /* c8 ignore next 3 - functional code tested but coverage intermittently missed */\n return fail<IReadOnlyResourceTreeBranch<T>>(\n `${id}: not a branch${this.path ? ` in ${this.path}` : ''}.`\n ).withDetail<Collections.ResultMapResultDetail>('failure');\n });\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resourceTreeChildrenValidator.d.ts","sourceRoot":"","sources":["../../../../src/packlets/runtime/resource-tree/resourceTreeChildrenValidator.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,cAAc,EAAE,WAAW,EAAkB,MAAM,eAAe,CAAC;AACxG,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EACL,2BAA2B,EAC3B,6BAA6B,EAC7B,yBAAyB,EACzB,yBAAyB,EAC1B,MAAM,UAAU,CAAC;AAElB;;;;;;;;;;;;;;GAcG;AACH,qBAAa,6BAA6B,CAAC,CAAC,CAAE,YAAW,6BAA6B,CAAC,CAAC,EAAE,MAAM,EAA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I,IAAI,gBAAgB,CAAC,YAAY,CAAC;IAI7C;;;OAGG;IACI,MAAM,IAAI,gBAAgB,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC;IAI/D;;;OAGG;IACI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,gBAAgB,CAAC,CAAC,YAAY,EAAE,yBAAyB,CAAC,CAAC,CAAC,CAAC,CAAC;CAG3F"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resourceTreeChildrenValidator.js","sourceRoot":"","sources":["../../../../src/packlets/runtime/resource-tree/resourceTreeChildrenValidator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,yCAAwC;AACxC,4CAAwG;AASxG;;;;;;;;;;;;;;GAcG;AACH,MAAa,6BAA6B;IAGxC;;;OAGG;IACH,YAAmB,KAAuC;QACxD,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAED;;;;OAIG;IACI,OAAO,CAAC,EAAU;QACvB,OAAO,iBAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,EAAE;YACxD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACI,WAAW,CAAC,IAAY;QAC7B,OAAO,iBAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,YAAY,EAAE,EAAE;YAC9D,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACI,SAAS,CAAC,IAAY;QAC3B,OAAO,iBAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,YAAY,EAAE,EAAE;YAC9D,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,YA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ACI,GAAG,CAAC,GAAW;QACpB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAmB,CAAC,CAAC;IAC9C,CAAC;IAED;;;OAGG;IACI,IAAI;QACT,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IAC5B,CAAC;IAED;;;OAGG;IACI,MAAM;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;IAC9B,CAAC;IAED;;;OAGG;IACI,CAAC,MAAM,CAAC,QAAQ,CAAC;QACtB,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;IACxC,CAAC;CACF;AA3ID,sEA2IC","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 { Validate } from '../../common';\nimport { Result, IReadOnlyResultMap, DetailedResult, Collections, failWithDetail } from '@fgv/ts-utils';\nimport { ResourceName } from '../../common';\nimport {\n IReadOnlyResourceTreeBranch,\n IReadOnlyResourceTreeChildren,\n IReadOnlyResourceTreeLeaf,\n IReadOnlyResourceTreeNode\n} from './common';\n\n/**\n * A validator wrapper for resource tree children that validates string inputs before\n * delegating to the underlying tree children collection.\n *\n * This class implements {@link Runtime.ResourceTree.IReadOnlyValidatingResourceTreeChildren | IReadOnlyValidatingResourceTreeChildren}\n * by wrapping an {@link Runtime.ResourceTree.IReadOnlyResourceTreeChildren | IReadOnlyResourceTreeChildren} instance and\n * providing string-based access to all tree operations. All string inputs are validated using the library's\n * validation utilities before being passed to the underlying collection.\n *\n * The validator acts as a bridge between string-based external APIs and the\n * strongly-typed internal tree operations, ensuring type safety and consistent\n * error handling throughout the resource tree navigation.\n *\n * @public\n */\nexport class ResourceTreeChildrenValidator<T> implements IReadOnlyResourceTreeChildren<T, string, string> {\n private readonly _inner: IReadOnlyResourceTreeChildren<T>;\n\n /**\n * Creates a new validator wrapper for resource tree children.\n * @param inner - The underlying resource tree children collection to wrap with validation\n */\n public constructor(inner: IReadOnlyResourceTreeChildren<T>) {\n this._inner = inner;\n }\n\n /**\n * Gets a tree node by its string ResourceId path, validating the input.\n * @param id - The string ResourceId path to validate and look up\n * @returns Result containing the node if found, or failure if validation fails or not found\n */\n public getById(id: string): Result<IReadOnlyResourceTreeNode<T>> {\n return Validate.toResourceId(id).onSuccess((resourceId) => {\n return this._inner.getById(resourceId);\n });\n }\n\n /**\n * Gets a resource node by its string name (single component), validating the input.\n * @param name - The string ResourceName to validate and look up\n * @returns Result containing the node if it's a resource, or failure if validation fails or not found\n */\n public getResource(name: string): Result<IReadOnlyResourceTreeNode<T>> {\n return Validate.toResourceName(name).onSuccess((resourceName) => {\n return this._inner.getResource(resourceName);\n });\n }\n\n /**\n * Gets a branch node by its string name (single component), validating the input.\n * @param name - The string ResourceName to validate and look up\n * @returns Result containing the node if it's a branch, or failure if validation fails or not found\n */\n public getBranch(name: string): Result<IReadOnlyResourceTreeNode<T>> {\n return Validate.toResourceName(name).onSuccess((resourceName) => {\n return this._inner.getBranch(resourceName);\n });\n }\n\n /**\n * Gets a resource leaf node by its string ResourceId path, validating the input.\n * @param id - The string ResourceId path to validate and look up\n * @returns Result containing the leaf if found and is a resource, or failure otherwise\n */\n public getResourceById(id: string): Result<IReadOnlyResourceTreeLeaf<T>> {\n return Validate.toResourceId(id).onSuccess((resourceId) => {\n return this._inner.getResourceById(resourceId);\n });\n }\n\n /**\n * Gets a branch node by its string ResourceId path, validating the input.\n * @param id - The string ResourceId path to validate and look up\n * @returns Result containing the branch if found and has children, or failure otherwise\n */\n public getBranchById(id: string): Result<IReadOnlyResourceTreeBranch<T>> {\n return Validate.toResourceId(id).onSuccess((resourceId) => {\n return this._inner.getBranchById(resourceId);\n });\n }\n\n /**\n * The number of direct child nodes in this collection.\n */\n public get size(): number {\n return this._inner.size;\n }\n\n /**\n * Returns an iterator of [ResourceName, node] pairs for all child nodes.\n * @returns Map iterator for all child nodes\n */\n public entries(): IterableIterator<[ResourceName, IReadOnlyResourceTreeNode<T>]> {\n return this._inner.entries();\n }\n\n /**\n * Executes a callback function for each child node in the collection.\n * @param cb - The callback function to execute for each child node\n * @param arg - Optional argument to pass to the callback\n */\n public forEach(\n cb: (value: unknown, key: string, map: IReadOnlyResultMap<string, unknown>, thisArg?: unknown) => void,\n arg?: unknown\n ): void {\n for (const [key, value] of this._inner.entries()) {\n cb(value, key as ResourceName, this, arg);\n }\n }\n\n /**\n * Gets a child node by its string key with detailed error information.\n * @param key - The string key to look up\n * @returns DetailedResult containing the node if found, or failure with details\n */\n public get(key: string): DetailedResult<IReadOnlyResourceTreeNode<T>, Collections.ResultMapResultDetail> {\n if (Validate.isValidResourceName(key)) {\n return this._inner.get(key);\n }\n return failWithDetail(`${key}: invalid resource name.`, 'invalid-key');\n }\n\n /**\n * Checks if a child node exists at the given string key.\n * @param key - The string key to check\n * @returns True if a child node exists at the key, false otherwise\n */\n public has(key: string): boolean {\n return this._inner.has(key as ResourceName);\n }\n\n /**\n * Returns an iterator of ResourceName keys for all child nodes.\n * @returns Map iterator for all child node keys\n */\n public keys(): IterableIterator<ResourceName> {\n return this._inner.keys();\n }\n\n /**\n * Returns an iterator of child node values.\n * @returns Map iterator for all child node values\n */\n public values(): IterableIterator<IReadOnlyResourceTreeNode<T>> {\n return this._inner.values();\n }\n\n /**\n * Returns an iterator for [ResourceName, node] pairs, enabling for...of iteration.\n * @returns Iterable iterator for all child nodes\n */\n public [Symbol.iterator](): IterableIterator<[ResourceName, IReadOnlyResourceTreeNode<T>]> {\n return this._inner[Symbol.iterator]();\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resourceResolver.d.ts","sourceRoot":"","sources":["../../../src/packlets/runtime/resourceResolver.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,MAAM,EAAgC,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,SAAS,EAA4B,MAAM,mBAAmB,CAAC;AAExE,OAAO,EAAE,iBAAiB,EAAW,UAAU,EAAE,MAAM,WAAW,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,yBAAyB,EAA4C,MAAM,WAAW,CAAC;AAChG,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACrF,OAAO,EAEL,4BAA4B,EAC5B,qBAAqB,EACtB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,8BAA8B,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAE5D;;;;;GAKG;AACH,MAAM,MAAM,wBAAwB,GAChC;IAAE,OAAO,EAAE,KAAK,CAAA;CAAE,GAClB;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,eAAe,EA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AC;IAe7E;;;;;OAKG;IACI,mBAAmB,IAAI,IAAI;IAUlC;;;;OAIG;IACH,IAAW,kBAAkB,IAAI,MAAM,CAEtC;IAED;;;;OAIG;IACH,IAAW,qBAAqB,IAAI,MAAM,CAEzC;IAED;;;;OAIG;IACH,IAAW,iBAAiB,IAAI,MAAM,CAErC;CACF"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resourceResolver.js","sourceRoot":"","sources":["../../../src/packlets/runtime/resourceResolver.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAAqE;AACrE,oDAAwE;AACxE,0CAA0C;AAC1C,sCAAmE;AAInE,uCAAgG;AAEhG,iFAIwC;AA8DxC;;;;;GAKG;AACH,MAAa,gBAAgB;IAqB3B;;OAEG;IACH,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,wBAAwB,CAAC,UAAU,CAAC;IAClD,CAAC;IAED;;OAEG;IACH,IAAW,WAAW;QACpB,OAAO,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC;IAC1C,CAAC;IAED;;;;OAIG;IACH,IAAW,cAAc;QACvB,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;IAED;;;OAGG;IACH,IAAW,iBAAiB;QAC1B,OAAO,IAAI,CAAC,kBAAkB,CAAC;IACjC,CAAC;IAED;;;OAGG;IACH,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAyBD;;;OAGG;IACH,YAAsB,MAAqC;;QACzD,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,eAAe,CAAC;QAC9C,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;QAC5C,IAAI,CAAC,wBAAwB,GAAG,MAAM,CAAC,wBAAwB,CAAC;QAChE,IAAI,CAAC,OAAO,GAAG;YACb,oBAAoB,EAAE,MAAA,MAAA,MAAM,CAAC,OAAO,0CAAE,oBAAoB,mCAAI,KAAK;SACpE,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025 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, fail, succeed } from '@fgv/ts-utils';\nimport { JsonValue, JsonObject, isJsonObject } from '@fgv/ts-json-base';\nimport { JsonEditor } from '@fgv/ts-json';\nimport { IResourceResolver, NoMatch, ResourceId } from '../common';\nimport { Condition, ConditionSet } from '../conditions';\nimport { AbstractDecision } from '../decisions';\nimport { ReadOnlyQualifierTypeCollector } from '../qualifier-types';\nimport { IContextQualifierProvider, ValidatingSimpleContextQualifierProvider } from './context';\nimport { IResourceManager, IResource, IResourceCandidate } from './iResourceManager';\nimport {\n ConditionMatchType,\n ConditionSetResolutionResult,\n IConditionMatchResult\n} from './conditionSetResolutionResult';\nimport { IResourceResolverCacheListener } from './cacheListener';\nimport { IReadOnlyQualifierCollector } from '../qualifiers';\n\n/**\n * Represents the cached result of resolving a decision.\n * Contains either a failure indicator or a list of instance indices for matching condition sets,\n * ordered by condition set priority.\n * @public\n */\nexport type DecisionResolutionResult =\n | { success: false }\n | { success: true; instanceIndices: ReadonlyArray<number>; defaultInstanceIndices: ReadonlyArray<number> };\n\n/**\n * Options for configuring a {@link Runtime.ResourceResolver | ResourceResolver}.\n * @public\n */\nexport interface IResourceResolverOptions {\n /**\n * Controls whether null values in resource composition should suppress properties\n * instead of setting them to null. When true, properties with null values from\n * higher-priority partial candidates will be omitted from the final composed resource.\n * @defaultValue false\n */\n suppressNullAsDelete?: boolean;\n}\n\n/**\n * Parameters for creating a {@link Runtime.ResourceResolver | ResourceResolver}.\n * @public\n */\nexport interface IResourceResolverCreateParams {\n /**\n * The {@link Runtime.IResourceManager | resource manager} that defines the resources available\n * and provides access to qualifiers and conditions.\n */\n resourceManager: IResourceManager;\n\n /**\n * The {@link QualifierTypes.ReadOnlyQualifierTypeCollector | readonly qualifier type collector}\n * that provides qualifier implementations for condition evaluation.\n */\n qualifierTypes: ReadOnlyQualifierTypeCollector;\n\n /**\n * The {@link Runtime.Context.IContextQualifierProvider | context qualifier provider} that resolves\n * qualifier values for the current context.\n */\n contextQualifierProvider: IContextQualifierProvider;\n\n /**\n * An optional listener for {@link Runtime.ResourceResolver | ResourceResolver} cache activity.\n */\n listener?: IResourceResolverCacheListener;\n\n /**\n * Optional configuration options for the {@link Runtime.ResourceResolver | ResourceResolver}.\n */\n options?: IResourceResolverOptions;\n}\n\n/**\n * High-performance runtime resource resolver with O(1) condition caching.\n * Resolves resources for a given context by evaluating conditions against qualifier values\n * and caching results for optimal performance.\n * @public\n */\nexport class ResourceResolver implements IResourceResolver {\n /**\n * The resource manager that defines available resources and provides condition access.\n */\n public readonly resourceManager: IResourceManager;\n\n /**\n * The readonly qualifier type collector that provides qualifier implementations.\n */\n public readonly qualifierTypes: ReadOnlyQualifierTypeCollector;\n\n /**\n * The context qualifier provider that resolves qualifier values.\n */\n public readonly contextQualifierProvider: IContextQualifierProvider;\n\n /**\n * The configuration options for this resource resolver.\n */\n public readonly options: IResourceResolverOptions;\n\n /**\n * The readonly qualifier collector that provides qualifier implementations.\n */\n public get qualifiers(): IReadOnlyQualifierCollector {\n return this.contextQualifierProvider.qualifiers;\n }\n\n /**\n * The resource IDs that this resolver can resolve.\n */\n public get resourceIds(): ReadonlyArray<ResourceId> {\n return this.resourceManager.resourceIds;\n }\n\n /**\n * The cache array for resolved conditions, indexed by condition index for O(1) lookup.\n * Each entry stores the resolved {@link Runtime.IConditionMatchResult | condition match result} for\n * the corresponding condition.\n */\n public get conditionCache(): ReadonlyArray<IConditionMatchResult | undefined> {\n return this._conditionCache;\n }\n\n /**\n * The cache array for resolved condition sets, indexed by condition set index for O(1) lookup.\n * Each entry stores the resolved ConditionSetResolutionResult for the corresponding condition set.\n */\n public get conditionSetCache(): ReadonlyArray<ConditionSetResolutionResult | undefined> {\n return this._conditionSetCache;\n }\n\n /**\n * The cache array for resolved decisions, indexed by decision index for O(1) lookup.\n * Each entry stores the resolved DecisionResolutionResult for the corresponding decision.\n */\n public get decisionCache(): ReadonlyArray<DecisionResolutionResult | undefined> {\n return this._decisionCache;\n }\n\n /**\n * Cache array for resolved conditions, indexed by condition index for O(1) lookup.\n * Each entry stores the resolved QualifierMatchScore for the corresponding condition.\n */\n private readonly _conditionCache: Array<IConditionMatchResult | undefined>;\n\n /**\n * Cache array for resolved condition sets, indexed by condition set index for O(1) lookup.\n * Each entry stores the resolved ConditionSetResolutionResult for the corresponding condition set.\n */\n private readonly _conditionSetCache: Array<ConditionSetResolutionResult | undefined>;\n\n /**\n * Cache array for resolved decisions, indexed by decision index for O(1) lookup.\n * Each entry stores the resolved DecisionResolutionResult for the corresponding decision.\n */\n private readonly _decisionCache: Array<DecisionResolutionResult | undefined>;\n\n /**\n * The listener for {@link Runtime.ResourceResolver | ResourceResolver} cache activity.\n */\n private readonly _listener?: IResourceResolverCacheListener;\n\n /**\n * Constructor for a {@link Runtime.ResourceResolver | ResourceResolver} object.\n * @param params - {@link Runtime.IResourceResolverCreateParams | Parameters} used to create the resolver.\n */\n protected constructor(params: IResourceResolverCreateParams) {\n this.resourceManager = params.resourceManager;\n this.qualifierTypes = params.qualifierTypes;\n this.contextQualifierProvider = params.contextQualifierProvider;\n this.options = {\n suppressNullAsDelete: params.options?.suppressNullAsDelete ?? false\n };\n\n // Initialize condition cache array with size matching the condition collector\n const conditionCollectorSize = this.resourceManager.conditions.size;\n this._conditionCache = new Array<IConditionMatchResult | undefined>(conditionCollectorSize);\n\n // Initialize condition set cache array with size matching the condition set collector\n const conditionSetCollectorSize = this.resourceManager.conditionSets.size;\n this._conditionSetCache = new Array<ConditionSetResolutionResult | undefined>(conditionSetCollectorSize);\n\n // Initialize decision cache array with size matching the decision collector\n const decisionCollectorSize = this.resourceManager.decisions.size;\n this._decisionCache = new Array<DecisionResolutionResult | undefined>(decisionCollectorSize);\n\n this._listener = params.listener;\n }\n\n /**\n * Creates a new {@link Runtime.ResourceResolver | ResourceResolver} object.\n * @param params - {@link Runtime.IResourceResolverCreateParams | Parameters} used to create the resolver.\n * @returns `Success` with the new {@link Runtime.ResourceResolver | ResourceResolver} object if successful,\n * or `Failure` with an error message if not.\n * @public\n */\n public static create(params: IResourceResolverCreateParams): Result<ResourceResolver> {\n return captureResult(() => new ResourceResolver(params));\n }\n\n /**\n * Resolves a condition by evaluating it against the current context.\n * Uses O(1) caching based on the condition's globally unique sequential index.\n * @param condition - The {@link Conditions.Condition | condition} to resolve.\n * @returns `Success` with the {@link QualifierMatchScore | match score} if successful,\n * or `Failure` with an error message if the condition cannot be resolved.\n * @public\n */\n public resolveCondition(condition: Condition): Result<IConditionMatchResult> {\n // Get the condition's index for cache lookup\n const conditionIndex = condition.index;\n if (conditionIndex === undefined) {\n return fail(`Condition \"${condition.key}\" does not have a valid index`);\n }\n\n // Check cache first for O(1) lookup\n const cachedResult = this._conditionCache[conditionIndex];\n if (cachedResult !== undefined) {\n this._listener?.onCacheHit('condition', conditionIndex);\n return succeed(cachedResult);\n }\n\n // Resolve the condition by getting qualifier value and evaluating with qualifier type\n const score = this.contextQualifierProvider\n .get(condition.qualifier)\n .onSuccess((qualifierValue) => {\n // Evaluate the condition using the qualifier type's matching logic\n return succeed(condition.qualifier.type.matches(condition.value, qualifierValue, condition.operator));\n })\n .onFailure((err) => {\n this._listener?.onContextError(condition.qualifier.name, err);\n return fail(err);\n })\n .orDefault(NoMatch);\n\n const priority = condition.priority;\n const scoreAsDefault = condition.scoreAsDefault ?? NoMatch;\n const matchResult: IConditionMatchResult =\n score > NoMatch\n ? { score, priority, matchType: 'match' }\n : scoreAsDefault > NoMatch\n ? { score: scoreAsDefault, priority, matchType: 'matchAsDefault' }\n : { score: NoMatch, priority, matchType: 'noMatch' };\n\n // Cache the resolved value for future O(1) lookup\n this._conditionCache[conditionIndex] = matchResult;\n this._listener?.onCacheMiss('condition', conditionIndex);\n\n return succeed(matchResult);\n }\n\n /**\n * Resolves a condition set by evaluating all its constituent conditions against the current context.\n * Uses O(1) caching based on the condition set's globally unique sequential index.\n * @param conditionSet - The {@link Conditions.ConditionSet | condition set} to resolve.\n * @returns `Success` with the {@link Runtime.ConditionSetResolutionResult | resolution result} if successful,\n * or `Failure` with an error message if the condition set cannot be resolved.\n * @public\n */\n public resolveConditionSet(conditionSet: ConditionSet): Result<ConditionSetResolutionResult> {\n // Get the condition set's index for cache lookup\n const conditionSetIndex = conditionSet.index;\n if (conditionSetIndex === undefined) {\n return fail(`ConditionSet \"${conditionSet.key}\" does not have a valid index`);\n }\n\n // Check cache first for O(1) lookup\n const cachedResult = this._conditionSetCache[conditionSetIndex];\n if (cachedResult !== undefined) {\n this._listener?.onCacheHit('conditionSet', conditionSetIndex);\n return succeed(cachedResult);\n }\n\n // Resolve all conditions in the condition set\n const conditions: Array<IConditionMatchResult> = [];\n let matchType: ConditionMatchType = 'match';\n\n for (const condition of conditionSet.conditions) {\n const { value: conditionResult, message: conditionMessage } = this.resolveCondition(condition);\n\n /* c8 ignore next 4 - defensive coding: extreme internal error scenario not reachable in normal operation */\n if (conditionMessage !== undefined) {\n this._listener?.onCacheError('conditionSet', conditionSetIndex);\n return fail(`Failed to resolve condition \"${condition.key}\": ${conditionMessage}`);\n }\n\n conditions.push(conditionResult);\n\n if (conditionResult.matchType === 'noMatch') {\n // Cache the failure result\n return ConditionSetResolutionResult.create('noMatch', conditions)\n .onSuccess((result) => {\n this._conditionSetCache[conditionSetIndex] = result;\n this._listener?.onCacheMiss('conditionSet', conditionSetIndex);\n return succeed(result);\n })\n .onFailure((err) => {\n /* c8 ignore next 4 - defensive coding: extreme internal error scenario not reachable in normal operation */\n this._conditionSetCache[conditionSetIndex] = undefined;\n this._listener?.onCacheError('conditionSet', conditionSetIndex);\n return fail(`${conditionSetIndex}: error creating condition set resolution result: ${err}`);\n });\n }\n\n /* c8 ignore next 3 - edge case: matchAsDefault fallback logic rarely triggered */\n if (conditionResult.matchType === 'matchAsDefault') {\n matchType = 'matchAsDefault';\n }\n }\n\n // Cache the successful result\n return ConditionSetResolutionResult.create(matchType, conditions)\n .onSuccess((result) => {\n this._conditionSetCache[conditionSetIndex] = result;\n this._listener?.onCacheMiss('conditionSet', conditionSetIndex);\n return succeed(result);\n })\n .onFailure((err) => {\n /* c8 ignore next 4 - defensive coding: extreme internal error scenario not reachable in normal operation */\n this._conditionSetCache[conditionSetIndex] = undefined;\n this._listener?.onCacheError('conditionSet', conditionSetIndex);\n return fail(`${conditionSetIndex}: error creating condition set resolution result: ${err}`);\n });\n }\n\n /**\n * Resolves a decision by evaluating all its constituent condition sets against the current context.\n * Uses O(1) caching based on the decision's globally unique sequential index.\n * @param decision - The {@link Decisions.AbstractDecision | abstract decision} to resolve.\n * @returns `Success` with the {@link Runtime.DecisionResolutionResult | resolution result} if successful,\n * or `Failure` with an error message if the decision cannot be resolved.\n * @public\n */\n public resolveDecision(decision: AbstractDecision): Result<DecisionResolutionResult> {\n // Get the decision's index for cache lookup\n const decisionIndex = decision.index;\n if (decisionIndex === undefined) {\n return fail(`Decision \"${decision.key}\" does not have a valid index`);\n }\n\n // Check cache first for O(1) lookup\n const cachedResult = this._decisionCache[decisionIndex];\n if (cachedResult !== undefined) {\n this._listener?.onCacheHit('decision', decisionIndex);\n return succeed(cachedResult);\n }\n\n // Resolve all condition sets in the decision\n const matchingInstanceResults: Array<{ index: number; result: ConditionSetResolutionResult }> = [];\n const matchingDefaultInstanceResults: Array<{ index: number; result: ConditionSetResolutionResult }> = [];\n\n for (let instanceIndex = 0; instanceIndex < decision.candidates.length; instanceIndex++) {\n const candidate = decision.candidates[instanceIndex];\n const conditionSetResult = this.resolveConditionSet(candidate.conditionSet);\n\n /* c8 ignore next 4 - defensive in depth */\n if (conditionSetResult.isFailure()) {\n this._listener?.onCacheError('decision', decisionIndex);\n return fail(`${decision.key}: Failed to resolve condition set\": ${conditionSetResult.message}`);\n }\n\n const resolution = conditionSetResult.value;\n\n // Only include condition sets that match\n if (resolution.matchType === 'match') {\n matchingInstanceResults.push({\n index: instanceIndex,\n result: resolution\n });\n } else if (resolution.matchType === 'matchAsDefault') {\n matchingDefaultInstanceResults.push({\n index: instanceIndex,\n result: resolution\n });\n }\n // If condition set doesn't match, we simply skip it and continue (don't fail the decision)\n }\n\n // Sort by condition set resolution priority using the proper comparison logic\n matchingInstanceResults.sort((a, b) => ConditionSetResolutionResult.compare(a.result, b.result));\n matchingDefaultInstanceResults.sort((a, b) => ConditionSetResolutionResult.compare(a.result, b.result));\n\n // Extract just the instance indices in priority order\n const instanceIndices = matchingInstanceResults.map((item) => item.index);\n const defaultInstanceIndices = matchingDefaultInstanceResults.map((item) => item.index);\n\n // Cache the successful result\n const successResult: DecisionResolutionResult = {\n success: true,\n instanceIndices,\n defaultInstanceIndices\n };\n this._decisionCache[decisionIndex] = successResult;\n this._listener?.onCacheMiss('decision', decisionIndex);\n\n return succeed(successResult);\n }\n\n /**\n * Resolves a resource by finding the best matching candidate.\n * Uses the resource's associated decision to determine the best match based on the current context.\n * @param resource - The {@link Resources.Resource | resource} to resolve.\n * @returns `Success` with the best matching candidate if successful,\n * or `Failure` with an error message if no candidates match or resolution fails.\n * @public\n */\n public resolveResource(resource: IResource): Result<IResourceCandidate>;\n\n /**\n * Resolves a resource by finding the best matching candidate.\n * Uses the resource's associated decision to determine the best match based on the current context.\n * @param resource - The string id of the resource to resolve.\n * @returns `Success` with the best matching candidate if successful,\n * or `Failure` with an error message if no candidates match or resolution fails.\n * @public\n */\n public resolveResource(resource: string): Result<IResourceCandidate>;\n public resolveResource(idOrResource: string | IResource): Result<IResourceCandidate> {\n /* c8 ignore next 4 - defensive coding: string resource resolution should use direct resource calls */\n if (typeof idOrResource === 'string') {\n return this.resourceManager\n .getBuiltResource(idOrResource)\n .onSuccess((resource) => this.resolveResource(resource));\n }\n\n const resource = idOrResource;\n\n // Get the abstract decision from the resource's concrete decision\n const abstractDecision = resource.decision.baseDecision;\n\n // Resolve the decision to get candidate indices in priority order\n const decisionResult = this.resolveDecision(abstractDecision);\n /* c8 ignore next 3 - defense in depth almost impossible to hit */\n if (decisionResult.isFailure()) {\n return fail(`Failed to resolve decision for resource \"${resource.id}\": ${decisionResult.message}`);\n }\n\n const resolution = decisionResult.value;\n\n // Check if any candidates matched (regular or default)\n if (\n !resolution.success ||\n (resolution.instanceIndices.length === 0 && resolution.defaultInstanceIndices.length === 0)\n ) {\n return fail(`No matching candidates found for resource \"${resource.id}\"`);\n }\n\n // Prefer regular matches over default matches\n const candidateIndex =\n resolution.instanceIndices.length > 0\n ? resolution.instanceIndices[0] // Best regular match\n : resolution.defaultInstanceIndices[0]; // Best default match\n\n if (candidateIndex >= resource.candidates.length) {\n return fail(`Invalid candidate index ${candidateIndex} for resource \"${resource.id}\"`);\n }\n\n const bestCandidate = resource.candidates[candidateIndex];\n return succeed(bestCandidate);\n }\n\n /**\n * Resolves all matching resource candidates in priority order.\n * Uses the resource's associated decision to determine all matching candidates based on the current context.\n * @param resource - The {@link Resources.Resource | resource} to resolve.\n * @returns `Success` with an array of all matching candidates in priority order if successful,\n * or `Failure` with an error message if no candidates match or resolution fails.\n * @public\n */\n public resolveAllResourceCandidates(resource: IResource): Result<ReadonlyArray<IResourceCandidate>>;\n\n /**\n * Resolves all matching resource candidates in priority order.\n * Uses the resource's associated decision to determine all matching candidates based on the current context.\n * @param resource - The string id of the resource to resolve.\n * @returns `Success` with an array of all matching candidates in priority order if successful,\n * or `Failure` with an error message if no candidates match or resolution fails.\n * @public\n */\n public resolveAllResourceCandidates(resource: string): Result<ReadonlyArray<IResourceCandidate>>;\n public resolveAllResourceCandidates(\n idOrResource: string | IResource\n ): Result<ReadonlyArray<IResourceCandidate>> {\n if (typeof idOrResource === 'string') {\n return this.resourceManager\n .getBuiltResource(idOrResource)\n .onSuccess((resource) => this.resolveAllResourceCandidates(resource));\n }\n\n const resource = idOrResource;\n\n // Get the abstract decision from the resource's concrete decision\n const abstractDecision = resource.decision.baseDecision;\n\n // Resolve the decision to get candidate indices in priority order\n const decisionResult = this.resolveDecision(abstractDecision);\n /* c8 ignore next 3 - defense in depth almost impossible to hit */\n if (decisionResult.isFailure()) {\n return fail(`Failed to resolve decision for resource \"${resource.id}\": ${decisionResult.message}`);\n }\n\n const resolution = decisionResult.value;\n\n // Check if any candidates matched (regular or default)\n if (\n !resolution.success ||\n (resolution.instanceIndices.length === 0 && resolution.defaultInstanceIndices.length === 0)\n ) {\n return fail(`No matching candidates found for resource \"${resource.id}\"`);\n }\n\n // Get all matching candidates: regular matches first, then default matches\n const candidates: IResourceCandidate[] = [];\n\n // Add all regular matches first (already sorted by priority)\n for (const candidateIndex of resolution.instanceIndices) {\n if (candidateIndex >= resource.candidates.length) {\n return fail(`Invalid candidate index ${candidateIndex} for resource \"${resource.id}\"`);\n }\n const candidate = resource.candidates[candidateIndex];\n candidates.push(candidate);\n }\n\n // Add all default matches after regular matches (already sorted by priority)\n for (const candidateIndex of resolution.defaultInstanceIndices) {\n /* c8 ignore next 3 - defense in depth should not happen */\n if (candidateIndex >= resource.candidates.length) {\n return fail(`Invalid candidate index ${candidateIndex} for resource \"${resource.id}\"`);\n }\n const candidate = resource.candidates[candidateIndex];\n candidates.push(candidate);\n }\n\n return succeed(candidates);\n }\n\n /**\n * Resolves a resource to a composed value by merging matching candidates according to their merge methods.\n * Starting from the highest priority candidates, finds the first \"full\" candidate and merges all higher\n * priority \"partial\" candidates into it in ascending order of priority.\n * @param resource - The {@link Resources.Resource | resource} to resolve.\n * @returns `Success` with the composed JsonValue if successful,\n * or `Failure` with an error message if no candidates match or resolution fails.\n * @public\n */\n public resolveComposedResourceValue(resource: IResource): Result<JsonValue>;\n\n /**\n * Resolves a resource to a composed value by merging matching candidates according to their merge methods.\n * Starting from the highest priority candidates, finds the first \"full\" candidate and merges all higher\n * priority \"partial\" candidates into it in ascending order of priority.\n * @param resource - The string id of the resource to resolve.\n * @returns `Success` with the composed JsonValue if successful,\n * or `Failure` with an error message if no candidates match or resolution fails.\n * @public\n */\n public resolveComposedResourceValue(resource: string): Result<JsonValue>;\n public resolveComposedResourceValue(idOrResource: string | IResource): Result<JsonValue> {\n /* c8 ignore next 4 - defensive coding: string resource resolution should use direct resource calls */\n if (typeof idOrResource === 'string') {\n return this.resourceManager\n .getBuiltResource(idOrResource)\n .onSuccess((resource) => this.resolveComposedResourceValue(resource));\n }\n\n const resource = idOrResource;\n\n return this.resolveAllResourceCandidates(resource).onSuccess((candidates) => {\n /* c8 ignore next 3 - defense in depth should never occur */\n if (candidates.length === 0) {\n return fail(`${resource.id}: No matching candidates found.`);\n }\n\n // Find the first full candidate and collect all partial candidates above it\n let fullCandidateIndex = -1;\n const partialCandidates: IResourceCandidate[] = [];\n\n for (let i = 0; i < candidates.length; i++) {\n const candidate = candidates[i];\n if (!candidate.isPartial) {\n // Found the first full candidate\n fullCandidateIndex = i;\n break;\n } else {\n // Collect partial candidates (these are in ascending priority order)\n partialCandidates.unshift(candidate);\n }\n }\n\n // If no full candidate found, use the last candidate as the base\n const baseCandidateIndex = fullCandidateIndex >= 0 ? fullCandidateIndex : candidates.length - 1;\n const baseCandidate = candidates[baseCandidateIndex];\n\n // If there are no partial candidates to merge, but null-as-delete is enabled,\n // still process through JsonEditor to handle null properties in the base candidate\n if (partialCandidates.length === 0) {\n if (this.options.suppressNullAsDelete || !isJsonObject(baseCandidate.json)) {\n return succeed(baseCandidate.json);\n }\n\n // Process single candidate through JsonEditor to apply null-as-delete\n const editor = JsonEditor.create({\n merge: {\n arrayMergeBehavior: 'replace',\n nullAsDelete: true\n }\n }).orThrow(); // Should never fail with valid options\n\n return editor\n .mergeObjectsInPlace({}, [baseCandidate.json])\n .withErrorFormat((err) => `${resource.id}: Composition failed: ${err}`);\n }\n\n const allCandidates = [\n baseCandidate.json,\n ...partialCandidates.map((candidate) => candidate.json)\n ].filter((v): v is JsonObject => isJsonObject(v));\n\n /* c8 ignore next 3 - defensive check: non-object values in resource candidates should be prevented at validation time */\n if (allCandidates.length !== partialCandidates.length + 1) {\n return fail(`${resource.id}: Unable to compose non-object candidate values.`);\n }\n\n // Create JsonEditor with array replacement behavior and null-as-delete for resource composition\n const editor = JsonEditor.create({\n merge: {\n arrayMergeBehavior: 'replace',\n nullAsDelete: !this.options.suppressNullAsDelete\n }\n }).orThrow(); // Should never fail with valid options\n\n return editor\n .mergeObjectsInPlace({}, allCandidates)\n .withErrorFormat((err) => `${resource.id}: Composition failed: ${err}`);\n });\n }\n\n /**\n * {@inheritDoc IResourceResolver.withContext}\n */\n public withContext(context: Record<string, string>): Result<ResourceResolver> {\n const { resourceManager, qualifierTypes, options } = this;\n return ValidatingSimpleContextQualifierProvider.create({\n qualifiers: this.qualifiers,\n qualifierValues: context\n }).onSuccess((contextQualifierProvider) => {\n return ResourceResolver.create({\n resourceManager,\n qualifierTypes,\n options,\n contextQualifierProvider\n });\n });\n }\n\n /**\n * Clears all caches (condition, condition set, and decision), forcing all cached items\n * to be re-evaluated on next access. This should be called when the context changes and cached\n * results are no longer valid.\n * @public\n */\n public clearConditionCache(): void {\n this._conditionCache.fill(undefined);\n this._conditionSetCache.fill(undefined);\n this._decisionCache.fill(undefined);\n\n this._listener?.onCacheClear('condition');\n this._listener?.onCacheClear('conditionSet');\n this._listener?.onCacheClear('decision');\n }\n\n /**\n * Gets the current size of the condition cache array.\n * @returns The size of the condition cache array.\n * @public\n */\n public get conditionCacheSize(): number {\n return this._conditionCache.length;\n }\n\n /**\n * Gets the current size of the condition set cache array.\n * @returns The size of the condition set cache array.\n * @public\n */\n public get conditionSetCacheSize(): number {\n return this._conditionSetCache.length;\n }\n\n /**\n * Gets the current size of the decision cache array.\n * @returns The size of the decision cache array.\n * @public\n */\n public get decisionCacheSize(): number {\n return this._decisionCache.length;\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resourceTreeResolver.d.ts","sourceRoot":"","sources":["../../../src/packlets/runtime/resourceTreeResolver.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,MAAM,EAAmD,MAAM,eAAe,CAAC;AACxF,OAAO,EAAE,SAAS,EAAE,UAAU,EAAgC,MAAM,mBAAmB,CAAC;AACxF,OAAO,EAAoB,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAC9F,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;;;;;;GAQG;AACH,MAAM,MAAM,oBAAoB,GAAG,CACjC,QAAQ,EAAE,SAAS,EACnB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,gBAAgB,KACvB,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC;AAEnC;;;;;;;;GAQG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAC/B,UAAU,EAAE,yBAAyB,CAAC,SAAS,CAAC,EAChD,gBAAgB,EAAE,MAAM,EAAE,EAC1B,QAAQ,EAAE,gBAAgB,KACvB,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC;AAEnC;;;GAGG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,oBAAoB,CA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