@cohesivesystems/presentation-core 0.1.0-alpha.1

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 (447) hide show
  1. package/LICENSE +55 -0
  2. package/dist/api-scope-request.d.ts +43 -0
  3. package/dist/api-scope-request.d.ts.map +1 -0
  4. package/dist/api-scope-request.js +96 -0
  5. package/dist/api-scope-request.js.map +1 -0
  6. package/dist/collection-chrome-icons.d.ts +18 -0
  7. package/dist/collection-chrome-icons.d.ts.map +1 -0
  8. package/dist/collection-chrome-icons.js +57 -0
  9. package/dist/collection-chrome-icons.js.map +1 -0
  10. package/dist/collection-chrome-runtime.d.ts +25 -0
  11. package/dist/collection-chrome-runtime.d.ts.map +1 -0
  12. package/dist/collection-chrome-runtime.js +72 -0
  13. package/dist/collection-chrome-runtime.js.map +1 -0
  14. package/dist/collection-chrome-slot-renderer-registry.d.ts +110 -0
  15. package/dist/collection-chrome-slot-renderer-registry.d.ts.map +1 -0
  16. package/dist/collection-chrome-slot-renderer-registry.js +136 -0
  17. package/dist/collection-chrome-slot-renderer-registry.js.map +1 -0
  18. package/dist/collection-selection-state.d.ts +18 -0
  19. package/dist/collection-selection-state.d.ts.map +1 -0
  20. package/dist/collection-selection-state.js +2 -0
  21. package/dist/collection-selection-state.js.map +1 -0
  22. package/dist/data-source-projection.d.ts +475 -0
  23. package/dist/data-source-projection.d.ts.map +1 -0
  24. package/dist/data-source-projection.js +880 -0
  25. package/dist/data-source-projection.js.map +1 -0
  26. package/dist/data-source-query-lowering.d.ts +35 -0
  27. package/dist/data-source-query-lowering.d.ts.map +1 -0
  28. package/dist/data-source-query-lowering.js +104 -0
  29. package/dist/data-source-query-lowering.js.map +1 -0
  30. package/dist/date-time-filter-model.d.ts +20 -0
  31. package/dist/date-time-filter-model.d.ts.map +1 -0
  32. package/dist/date-time-filter-model.js +115 -0
  33. package/dist/date-time-filter-model.js.map +1 -0
  34. package/dist/document-badge-icons.d.ts +4 -0
  35. package/dist/document-badge-icons.d.ts.map +1 -0
  36. package/dist/document-badge-icons.js +4 -0
  37. package/dist/document-badge-icons.js.map +1 -0
  38. package/dist/document-module.d.ts +268 -0
  39. package/dist/document-module.d.ts.map +1 -0
  40. package/dist/document-module.js +347 -0
  41. package/dist/document-module.js.map +1 -0
  42. package/dist/document-summary-model.d.ts +2 -0
  43. package/dist/document-summary-model.d.ts.map +1 -0
  44. package/dist/document-summary-model.js +2 -0
  45. package/dist/document-summary-model.js.map +1 -0
  46. package/dist/document-workspace-chrome-projection.d.ts +18 -0
  47. package/dist/document-workspace-chrome-projection.d.ts.map +1 -0
  48. package/dist/document-workspace-chrome-projection.js +35 -0
  49. package/dist/document-workspace-chrome-projection.js.map +1 -0
  50. package/dist/document-workspace-surface-slots.d.ts +75 -0
  51. package/dist/document-workspace-surface-slots.d.ts.map +1 -0
  52. package/dist/document-workspace-surface-slots.js +268 -0
  53. package/dist/document-workspace-surface-slots.js.map +1 -0
  54. package/dist/endpoint-executor.d.ts +62 -0
  55. package/dist/endpoint-executor.d.ts.map +1 -0
  56. package/dist/endpoint-executor.js +35 -0
  57. package/dist/endpoint-executor.js.map +1 -0
  58. package/dist/field-display-resolution.d.ts +5 -0
  59. package/dist/field-display-resolution.d.ts.map +1 -0
  60. package/dist/field-display-resolution.js +50 -0
  61. package/dist/field-display-resolution.js.map +1 -0
  62. package/dist/index.d.ts +90 -0
  63. package/dist/index.d.ts.map +1 -0
  64. package/dist/index.js +89 -0
  65. package/dist/index.js.map +1 -0
  66. package/dist/module.d.ts +48 -0
  67. package/dist/module.d.ts.map +1 -0
  68. package/dist/module.js +108 -0
  69. package/dist/module.js.map +1 -0
  70. package/dist/navigation-shell-frame-renderer-registry.d.ts +12 -0
  71. package/dist/navigation-shell-frame-renderer-registry.d.ts.map +1 -0
  72. package/dist/navigation-shell-frame-renderer-registry.js +29 -0
  73. package/dist/navigation-shell-frame-renderer-registry.js.map +1 -0
  74. package/dist/navigation-shell-layout-runtime.d.ts +29 -0
  75. package/dist/navigation-shell-layout-runtime.d.ts.map +1 -0
  76. package/dist/navigation-shell-layout-runtime.js +50 -0
  77. package/dist/navigation-shell-layout-runtime.js.map +1 -0
  78. package/dist/navigation-shell-region-component-registry.d.ts +96 -0
  79. package/dist/navigation-shell-region-component-registry.d.ts.map +1 -0
  80. package/dist/navigation-shell-region-component-registry.js +108 -0
  81. package/dist/navigation-shell-region-component-registry.js.map +1 -0
  82. package/dist/navigation-shell-runtime.d.ts +48 -0
  83. package/dist/navigation-shell-runtime.d.ts.map +1 -0
  84. package/dist/navigation-shell-runtime.js +457 -0
  85. package/dist/navigation-shell-runtime.js.map +1 -0
  86. package/dist/navigation-shell-slot-renderer-registry.d.ts +15 -0
  87. package/dist/navigation-shell-slot-renderer-registry.d.ts.map +1 -0
  88. package/dist/navigation-shell-slot-renderer-registry.js +48 -0
  89. package/dist/navigation-shell-slot-renderer-registry.js.map +1 -0
  90. package/dist/navigation.d.ts +84 -0
  91. package/dist/navigation.d.ts.map +1 -0
  92. package/dist/navigation.js +167 -0
  93. package/dist/navigation.js.map +1 -0
  94. package/dist/object-path.d.ts +23 -0
  95. package/dist/object-path.d.ts.map +1 -0
  96. package/dist/object-path.js +63 -0
  97. package/dist/object-path.js.map +1 -0
  98. package/dist/page-host-renderer-registry.d.ts +119 -0
  99. package/dist/page-host-renderer-registry.d.ts.map +1 -0
  100. package/dist/page-host-renderer-registry.js +305 -0
  101. package/dist/page-host-renderer-registry.js.map +1 -0
  102. package/dist/presentation-action-endpoint-request-projection.d.ts +23 -0
  103. package/dist/presentation-action-endpoint-request-projection.d.ts.map +1 -0
  104. package/dist/presentation-action-endpoint-request-projection.js +117 -0
  105. package/dist/presentation-action-endpoint-request-projection.js.map +1 -0
  106. package/dist/presentation-action-endpoint.d.ts +24 -0
  107. package/dist/presentation-action-endpoint.d.ts.map +1 -0
  108. package/dist/presentation-action-endpoint.js +56 -0
  109. package/dist/presentation-action-endpoint.js.map +1 -0
  110. package/dist/presentation-action-icons.d.ts +4 -0
  111. package/dist/presentation-action-icons.d.ts.map +1 -0
  112. package/dist/presentation-action-icons.js +4 -0
  113. package/dist/presentation-action-icons.js.map +1 -0
  114. package/dist/presentation-action-result-state.d.ts +48 -0
  115. package/dist/presentation-action-result-state.d.ts.map +1 -0
  116. package/dist/presentation-action-result-state.js +109 -0
  117. package/dist/presentation-action-result-state.js.map +1 -0
  118. package/dist/presentation-action-runtime-binding.d.ts +48 -0
  119. package/dist/presentation-action-runtime-binding.d.ts.map +1 -0
  120. package/dist/presentation-action-runtime-binding.js +52 -0
  121. package/dist/presentation-action-runtime-binding.js.map +1 -0
  122. package/dist/presentation-action-runtime-diagnostics.d.ts +18 -0
  123. package/dist/presentation-action-runtime-diagnostics.d.ts.map +1 -0
  124. package/dist/presentation-action-runtime-diagnostics.js +69 -0
  125. package/dist/presentation-action-runtime-diagnostics.js.map +1 -0
  126. package/dist/presentation-action-runtime-labels.d.ts +15 -0
  127. package/dist/presentation-action-runtime-labels.d.ts.map +1 -0
  128. package/dist/presentation-action-runtime-labels.js +28 -0
  129. package/dist/presentation-action-runtime-labels.js.map +1 -0
  130. package/dist/presentation-action-runtime-projection.d.ts +17 -0
  131. package/dist/presentation-action-runtime-projection.d.ts.map +1 -0
  132. package/dist/presentation-action-runtime-projection.js +31 -0
  133. package/dist/presentation-action-runtime-projection.js.map +1 -0
  134. package/dist/presentation-badge-resolution.d.ts +8 -0
  135. package/dist/presentation-badge-resolution.d.ts.map +1 -0
  136. package/dist/presentation-badge-resolution.js +73 -0
  137. package/dist/presentation-badge-resolution.js.map +1 -0
  138. package/dist/presentation-collection-pagination.d.ts +32 -0
  139. package/dist/presentation-collection-pagination.d.ts.map +1 -0
  140. package/dist/presentation-collection-pagination.js +275 -0
  141. package/dist/presentation-collection-pagination.js.map +1 -0
  142. package/dist/presentation-content-diagnostics.d.ts +17 -0
  143. package/dist/presentation-content-diagnostics.d.ts.map +1 -0
  144. package/dist/presentation-content-diagnostics.js +61 -0
  145. package/dist/presentation-content-diagnostics.js.map +1 -0
  146. package/dist/presentation-content-resolution.d.ts +9 -0
  147. package/dist/presentation-content-resolution.d.ts.map +1 -0
  148. package/dist/presentation-content-resolution.js +19 -0
  149. package/dist/presentation-content-resolution.js.map +1 -0
  150. package/dist/presentation-data-source-binding-model.d.ts +81 -0
  151. package/dist/presentation-data-source-binding-model.d.ts.map +1 -0
  152. package/dist/presentation-data-source-binding-model.js +56 -0
  153. package/dist/presentation-data-source-binding-model.js.map +1 -0
  154. package/dist/presentation-data-source-runtime.d.ts +62 -0
  155. package/dist/presentation-data-source-runtime.d.ts.map +1 -0
  156. package/dist/presentation-data-source-runtime.js +80 -0
  157. package/dist/presentation-data-source-runtime.js.map +1 -0
  158. package/dist/presentation-design-intent-diagnostics.d.ts +25 -0
  159. package/dist/presentation-design-intent-diagnostics.d.ts.map +1 -0
  160. package/dist/presentation-design-intent-diagnostics.js +55 -0
  161. package/dist/presentation-design-intent-diagnostics.js.map +1 -0
  162. package/dist/presentation-icon-diagnostics.d.ts +45 -0
  163. package/dist/presentation-icon-diagnostics.d.ts.map +1 -0
  164. package/dist/presentation-icon-diagnostics.js +235 -0
  165. package/dist/presentation-icon-diagnostics.js.map +1 -0
  166. package/dist/presentation-icon-registry.d.ts +36 -0
  167. package/dist/presentation-icon-registry.d.ts.map +1 -0
  168. package/dist/presentation-icon-registry.js +81 -0
  169. package/dist/presentation-icon-registry.js.map +1 -0
  170. package/dist/presentation-navigation-action-runtime-bindings.d.ts +13 -0
  171. package/dist/presentation-navigation-action-runtime-bindings.d.ts.map +1 -0
  172. package/dist/presentation-navigation-action-runtime-bindings.js +29 -0
  173. package/dist/presentation-navigation-action-runtime-bindings.js.map +1 -0
  174. package/dist/presentation-pagination.d.ts +98 -0
  175. package/dist/presentation-pagination.d.ts.map +1 -0
  176. package/dist/presentation-pagination.js +427 -0
  177. package/dist/presentation-pagination.js.map +1 -0
  178. package/dist/presentation-projection-coverage.d.ts +38 -0
  179. package/dist/presentation-projection-coverage.d.ts.map +1 -0
  180. package/dist/presentation-projection-coverage.js +2429 -0
  181. package/dist/presentation-projection-coverage.js.map +1 -0
  182. package/dist/presentation-projection-diagnostics.d.ts +33 -0
  183. package/dist/presentation-projection-diagnostics.d.ts.map +1 -0
  184. package/dist/presentation-projection-diagnostics.js +17 -0
  185. package/dist/presentation-projection-diagnostics.js.map +1 -0
  186. package/dist/presentation-projection-trace.d.ts +97 -0
  187. package/dist/presentation-projection-trace.d.ts.map +1 -0
  188. package/dist/presentation-projection-trace.js +110 -0
  189. package/dist/presentation-projection-trace.js.map +1 -0
  190. package/dist/presentation-query-form-state.d.ts +15 -0
  191. package/dist/presentation-query-form-state.d.ts.map +1 -0
  192. package/dist/presentation-query-form-state.js +20 -0
  193. package/dist/presentation-query-form-state.js.map +1 -0
  194. package/dist/presentation-renderer-registry.d.ts +86 -0
  195. package/dist/presentation-renderer-registry.d.ts.map +1 -0
  196. package/dist/presentation-renderer-registry.js +108 -0
  197. package/dist/presentation-renderer-registry.js.map +1 -0
  198. package/dist/presentation-semantics.d.ts +288 -0
  199. package/dist/presentation-semantics.d.ts.map +1 -0
  200. package/dist/presentation-semantics.js +560 -0
  201. package/dist/presentation-semantics.js.map +1 -0
  202. package/dist/presentation-standards.d.ts +8 -0
  203. package/dist/presentation-standards.d.ts.map +1 -0
  204. package/dist/presentation-standards.js +9 -0
  205. package/dist/presentation-standards.js.map +1 -0
  206. package/dist/presentation-test-selectors.d.ts +146 -0
  207. package/dist/presentation-test-selectors.d.ts.map +1 -0
  208. package/dist/presentation-test-selectors.js +113 -0
  209. package/dist/presentation-test-selectors.js.map +1 -0
  210. package/dist/presentation-value-formatting.d.ts +12 -0
  211. package/dist/presentation-value-formatting.d.ts.map +1 -0
  212. package/dist/presentation-value-formatting.js +33 -0
  213. package/dist/presentation-value-formatting.js.map +1 -0
  214. package/dist/presentation-value-resolution.d.ts +7 -0
  215. package/dist/presentation-value-resolution.d.ts.map +1 -0
  216. package/dist/presentation-value-resolution.js +69 -0
  217. package/dist/presentation-value-resolution.js.map +1 -0
  218. package/dist/presentation-view-tree.d.ts +6 -0
  219. package/dist/presentation-view-tree.d.ts.map +1 -0
  220. package/dist/presentation-view-tree.js +15 -0
  221. package/dist/presentation-view-tree.js.map +1 -0
  222. package/dist/process-task-model.d.ts +80 -0
  223. package/dist/process-task-model.d.ts.map +1 -0
  224. package/dist/process-task-model.js +52 -0
  225. package/dist/process-task-model.js.map +1 -0
  226. package/dist/process-task-projection.d.ts +46 -0
  227. package/dist/process-task-projection.d.ts.map +1 -0
  228. package/dist/process-task-projection.js +233 -0
  229. package/dist/process-task-projection.js.map +1 -0
  230. package/dist/projected-action-status-projection.d.ts +18 -0
  231. package/dist/projected-action-status-projection.d.ts.map +1 -0
  232. package/dist/projected-action-status-projection.js +19 -0
  233. package/dist/projected-action-status-projection.js.map +1 -0
  234. package/dist/projected-activity-state-model.d.ts +22 -0
  235. package/dist/projected-activity-state-model.d.ts.map +1 -0
  236. package/dist/projected-activity-state-model.js +87 -0
  237. package/dist/projected-activity-state-model.js.map +1 -0
  238. package/dist/projected-collection-action-runtime-bindings.d.ts +12 -0
  239. package/dist/projected-collection-action-runtime-bindings.d.ts.map +1 -0
  240. package/dist/projected-collection-action-runtime-bindings.js +37 -0
  241. package/dist/projected-collection-action-runtime-bindings.js.map +1 -0
  242. package/dist/projected-collection-action-runtime-diagnostics.d.ts +23 -0
  243. package/dist/projected-collection-action-runtime-diagnostics.d.ts.map +1 -0
  244. package/dist/projected-collection-action-runtime-diagnostics.js +168 -0
  245. package/dist/projected-collection-action-runtime-diagnostics.js.map +1 -0
  246. package/dist/projected-collection-runtime.d.ts +475 -0
  247. package/dist/projected-collection-runtime.d.ts.map +1 -0
  248. package/dist/projected-collection-runtime.js +832 -0
  249. package/dist/projected-collection-runtime.js.map +1 -0
  250. package/dist/projected-document-action-diagnostics.d.ts +16 -0
  251. package/dist/projected-document-action-diagnostics.d.ts.map +1 -0
  252. package/dist/projected-document-action-diagnostics.js +113 -0
  253. package/dist/projected-document-action-diagnostics.js.map +1 -0
  254. package/dist/projected-document-action-enablements.d.ts +25 -0
  255. package/dist/projected-document-action-enablements.d.ts.map +1 -0
  256. package/dist/projected-document-action-enablements.js +38 -0
  257. package/dist/projected-document-action-enablements.js.map +1 -0
  258. package/dist/projected-document-action-projection.d.ts +45 -0
  259. package/dist/projected-document-action-projection.d.ts.map +1 -0
  260. package/dist/projected-document-action-projection.js +201 -0
  261. package/dist/projected-document-action-projection.js.map +1 -0
  262. package/dist/projected-document-action-runtime-profile-diagnostics.d.ts +16 -0
  263. package/dist/projected-document-action-runtime-profile-diagnostics.d.ts.map +1 -0
  264. package/dist/projected-document-action-runtime-profile-diagnostics.js +168 -0
  265. package/dist/projected-document-action-runtime-profile-diagnostics.js.map +1 -0
  266. package/dist/projected-document-action-runtime-profile.d.ts +64 -0
  267. package/dist/projected-document-action-runtime-profile.d.ts.map +1 -0
  268. package/dist/projected-document-action-runtime-profile.js +33 -0
  269. package/dist/projected-document-action-runtime-profile.js.map +1 -0
  270. package/dist/projected-document-action-status-notice-diagnostics.d.ts +10 -0
  271. package/dist/projected-document-action-status-notice-diagnostics.d.ts.map +1 -0
  272. package/dist/projected-document-action-status-notice-diagnostics.js +64 -0
  273. package/dist/projected-document-action-status-notice-diagnostics.js.map +1 -0
  274. package/dist/projected-document-badge-formatting.d.ts +2 -0
  275. package/dist/projected-document-badge-formatting.d.ts.map +1 -0
  276. package/dist/projected-document-badge-formatting.js +7 -0
  277. package/dist/projected-document-badge-formatting.js.map +1 -0
  278. package/dist/projected-document-editor-model.d.ts +4 -0
  279. package/dist/projected-document-editor-model.d.ts.map +1 -0
  280. package/dist/projected-document-editor-model.js +2 -0
  281. package/dist/projected-document-editor-model.js.map +1 -0
  282. package/dist/projected-document-field-navigation.d.ts +72 -0
  283. package/dist/projected-document-field-navigation.d.ts.map +1 -0
  284. package/dist/projected-document-field-navigation.js +143 -0
  285. package/dist/projected-document-field-navigation.js.map +1 -0
  286. package/dist/projected-document-field-semantics.d.ts +5 -0
  287. package/dist/projected-document-field-semantics.d.ts.map +1 -0
  288. package/dist/projected-document-field-semantics.js +16 -0
  289. package/dist/projected-document-field-semantics.js.map +1 -0
  290. package/dist/projected-document-workspace-data-source-bindings.d.ts +69 -0
  291. package/dist/projected-document-workspace-data-source-bindings.d.ts.map +1 -0
  292. package/dist/projected-document-workspace-data-source-bindings.js +81 -0
  293. package/dist/projected-document-workspace-data-source-bindings.js.map +1 -0
  294. package/dist/projected-document-workspace-notice-diagnostics.d.ts +12 -0
  295. package/dist/projected-document-workspace-notice-diagnostics.d.ts.map +1 -0
  296. package/dist/projected-document-workspace-notice-diagnostics.js +13 -0
  297. package/dist/projected-document-workspace-notice-diagnostics.js.map +1 -0
  298. package/dist/projected-input-form-runtime.d.ts +62 -0
  299. package/dist/projected-input-form-runtime.d.ts.map +1 -0
  300. package/dist/projected-input-form-runtime.js +2 -0
  301. package/dist/projected-input-form-runtime.js.map +1 -0
  302. package/dist/projected-process-task-notice-diagnostics.d.ts +13 -0
  303. package/dist/projected-process-task-notice-diagnostics.d.ts.map +1 -0
  304. package/dist/projected-process-task-notice-diagnostics.js +170 -0
  305. package/dist/projected-process-task-notice-diagnostics.js.map +1 -0
  306. package/dist/projected-query-form-runtime.d.ts +46 -0
  307. package/dist/projected-query-form-runtime.d.ts.map +1 -0
  308. package/dist/projected-query-form-runtime.js +2 -0
  309. package/dist/projected-query-form-runtime.js.map +1 -0
  310. package/dist/prompt-document-preview-projection.d.ts +46 -0
  311. package/dist/prompt-document-preview-projection.d.ts.map +1 -0
  312. package/dist/prompt-document-preview-projection.js +173 -0
  313. package/dist/prompt-document-preview-projection.js.map +1 -0
  314. package/dist/prompt-icons.d.ts +4 -0
  315. package/dist/prompt-icons.d.ts.map +1 -0
  316. package/dist/prompt-icons.js +4 -0
  317. package/dist/prompt-icons.js.map +1 -0
  318. package/dist/prompt-status-message-resolution.d.ts +18 -0
  319. package/dist/prompt-status-message-resolution.d.ts.map +1 -0
  320. package/dist/prompt-status-message-resolution.js +83 -0
  321. package/dist/prompt-status-message-resolution.js.map +1 -0
  322. package/dist/query-form-lowering.d.ts +16 -0
  323. package/dist/query-form-lowering.d.ts.map +1 -0
  324. package/dist/query-form-lowering.js +38 -0
  325. package/dist/query-form-lowering.js.map +1 -0
  326. package/dist/query-form-url-state.d.ts +44 -0
  327. package/dist/query-form-url-state.d.ts.map +1 -0
  328. package/dist/query-form-url-state.js +197 -0
  329. package/dist/query-form-url-state.js.map +1 -0
  330. package/dist/query-offset-page.d.ts +13 -0
  331. package/dist/query-offset-page.d.ts.map +1 -0
  332. package/dist/query-offset-page.js +24 -0
  333. package/dist/query-offset-page.js.map +1 -0
  334. package/dist/relation-query-input-form-target.d.ts +10 -0
  335. package/dist/relation-query-input-form-target.d.ts.map +1 -0
  336. package/dist/relation-query-input-form-target.js +30 -0
  337. package/dist/relation-query-input-form-target.js.map +1 -0
  338. package/dist/scope-selection.d.ts +94 -0
  339. package/dist/scope-selection.d.ts.map +1 -0
  340. package/dist/scope-selection.js +95 -0
  341. package/dist/scope-selection.js.map +1 -0
  342. package/dist/target-bindings.d.ts +39 -0
  343. package/dist/target-bindings.d.ts.map +1 -0
  344. package/dist/target-bindings.js +40 -0
  345. package/dist/target-bindings.js.map +1 -0
  346. package/dist/view-chrome-content-diagnostics.d.ts +8 -0
  347. package/dist/view-chrome-content-diagnostics.d.ts.map +1 -0
  348. package/dist/view-chrome-content-diagnostics.js +84 -0
  349. package/dist/view-chrome-content-diagnostics.js.map +1 -0
  350. package/dist/view-chrome-icons.d.ts +12 -0
  351. package/dist/view-chrome-icons.d.ts.map +1 -0
  352. package/dist/view-chrome-icons.js +50 -0
  353. package/dist/view-chrome-icons.js.map +1 -0
  354. package/dist/view-chrome-slot-renderer-registry.d.ts +19 -0
  355. package/dist/view-chrome-slot-renderer-registry.d.ts.map +1 -0
  356. package/dist/view-chrome-slot-renderer-registry.js +62 -0
  357. package/dist/view-chrome-slot-renderer-registry.js.map +1 -0
  358. package/package.json +53 -0
  359. package/src/api-scope-request.ts +186 -0
  360. package/src/collection-chrome-icons.ts +89 -0
  361. package/src/collection-chrome-runtime.ts +151 -0
  362. package/src/collection-chrome-slot-renderer-registry.ts +227 -0
  363. package/src/collection-selection-state.ts +32 -0
  364. package/src/data-source-projection.ts +2149 -0
  365. package/src/data-source-query-lowering.ts +217 -0
  366. package/src/date-time-filter-model.ts +156 -0
  367. package/src/document-badge-icons.ts +3 -0
  368. package/src/document-module.ts +741 -0
  369. package/src/document-summary-model.ts +1 -0
  370. package/src/document-workspace-chrome-projection.ts +62 -0
  371. package/src/document-workspace-surface-slots.ts +458 -0
  372. package/src/endpoint-executor.ts +122 -0
  373. package/src/field-display-resolution.ts +99 -0
  374. package/src/index.ts +104 -0
  375. package/src/module.ts +281 -0
  376. package/src/navigation-shell-frame-renderer-registry.ts +65 -0
  377. package/src/navigation-shell-layout-runtime.ts +124 -0
  378. package/src/navigation-shell-region-component-registry.ts +242 -0
  379. package/src/navigation-shell-runtime.ts +579 -0
  380. package/src/navigation-shell-slot-renderer-registry.ts +94 -0
  381. package/src/navigation.ts +364 -0
  382. package/src/object-path.ts +99 -0
  383. package/src/page-host-renderer-registry.ts +615 -0
  384. package/src/presentation-action-endpoint-request-projection.ts +223 -0
  385. package/src/presentation-action-endpoint.ts +130 -0
  386. package/src/presentation-action-icons.ts +3 -0
  387. package/src/presentation-action-result-state.ts +189 -0
  388. package/src/presentation-action-runtime-binding.ts +177 -0
  389. package/src/presentation-action-runtime-diagnostics.ts +120 -0
  390. package/src/presentation-action-runtime-labels.ts +57 -0
  391. package/src/presentation-action-runtime-projection.ts +67 -0
  392. package/src/presentation-badge-resolution.ts +138 -0
  393. package/src/presentation-collection-pagination.ts +436 -0
  394. package/src/presentation-content-diagnostics.ts +121 -0
  395. package/src/presentation-content-resolution.ts +46 -0
  396. package/src/presentation-data-source-binding-model.ts +140 -0
  397. package/src/presentation-data-source-runtime.ts +190 -0
  398. package/src/presentation-design-intent-diagnostics.ts +104 -0
  399. package/src/presentation-icon-diagnostics.ts +368 -0
  400. package/src/presentation-icon-registry.ts +181 -0
  401. package/src/presentation-navigation-action-runtime-bindings.ts +54 -0
  402. package/src/presentation-pagination.ts +694 -0
  403. package/src/presentation-projection-coverage.ts +3257 -0
  404. package/src/presentation-projection-diagnostics.ts +71 -0
  405. package/src/presentation-projection-trace.ts +293 -0
  406. package/src/presentation-query-form-state.ts +54 -0
  407. package/src/presentation-renderer-registry.ts +269 -0
  408. package/src/presentation-semantics.ts +1028 -0
  409. package/src/presentation-standards.ts +14 -0
  410. package/src/presentation-test-selectors.ts +312 -0
  411. package/src/presentation-value-formatting.ts +65 -0
  412. package/src/presentation-value-resolution.ts +100 -0
  413. package/src/presentation-view-tree.ts +33 -0
  414. package/src/process-task-model.ts +158 -0
  415. package/src/process-task-projection.ts +398 -0
  416. package/src/projected-action-status-projection.ts +43 -0
  417. package/src/projected-activity-state-model.ts +123 -0
  418. package/src/projected-collection-action-runtime-bindings.ts +76 -0
  419. package/src/projected-collection-action-runtime-diagnostics.ts +289 -0
  420. package/src/projected-collection-runtime.ts +1772 -0
  421. package/src/projected-document-action-diagnostics.ts +196 -0
  422. package/src/projected-document-action-enablements.ts +99 -0
  423. package/src/projected-document-action-projection.ts +464 -0
  424. package/src/projected-document-action-runtime-profile-diagnostics.ts +250 -0
  425. package/src/projected-document-action-runtime-profile.ts +133 -0
  426. package/src/projected-document-action-status-notice-diagnostics.ts +116 -0
  427. package/src/projected-document-badge-formatting.ts +7 -0
  428. package/src/projected-document-editor-model.ts +7 -0
  429. package/src/projected-document-field-navigation.ts +300 -0
  430. package/src/projected-document-field-semantics.ts +27 -0
  431. package/src/projected-document-workspace-data-source-bindings.ts +182 -0
  432. package/src/projected-document-workspace-notice-diagnostics.ts +41 -0
  433. package/src/projected-input-form-runtime.ts +86 -0
  434. package/src/projected-process-task-notice-diagnostics.ts +283 -0
  435. package/src/projected-query-form-runtime.ts +62 -0
  436. package/src/prompt-document-preview-projection.ts +345 -0
  437. package/src/prompt-icons.ts +3 -0
  438. package/src/prompt-status-message-resolution.ts +158 -0
  439. package/src/query-form-lowering.ts +77 -0
  440. package/src/query-form-url-state.ts +346 -0
  441. package/src/query-offset-page.ts +50 -0
  442. package/src/relation-query-input-form-target.ts +61 -0
  443. package/src/scope-selection.ts +201 -0
  444. package/src/target-bindings.ts +123 -0
  445. package/src/view-chrome-content-diagnostics.ts +139 -0
  446. package/src/view-chrome-icons.ts +81 -0
  447. package/src/view-chrome-slot-renderer-registry.ts +128 -0
@@ -0,0 +1 @@
1
+ export const documentSummaryStructuralMessageFieldPath = 'StructuralMessage'
@@ -0,0 +1,62 @@
1
+ import {
2
+ findPresentationView,
3
+ type PresentationModuleDefinition,
4
+ type ViewDefinition,
5
+ } from './module'
6
+ import {
7
+ viewChromeSlotKinds,
8
+ viewRegionKinds,
9
+ } from '@cohesivesystems/presentation-contracts'
10
+
11
+ /**
12
+ * Resolves document workspace metadata fields from page/header chrome.
13
+ *
14
+ * The document editor surface renders these same badge-strip field ids. Keeping
15
+ * this helper in the projection layer lets adapters build field renderers and
16
+ * diagnostics from the same IR locations instead of repeating view ids.
17
+ */
18
+ export function resolveDocumentWorkspaceMetadataFieldIds(
19
+ module: Pick<PresentationModuleDefinition, 'Views'> | null,
20
+ pageView: ViewDefinition | null,
21
+ ) {
22
+ const headerView = findHostedView(module, pageView, viewRegionKinds.header, 'Header')
23
+ const badgeSlot = headerView?.Chrome?.Slots?.find((slot) =>
24
+ matchesEnum(slot.Kind, viewChromeSlotKinds.badgeStrip, 'BadgeStrip'))
25
+
26
+ return badgeSlot?.FieldIds ?? []
27
+ }
28
+
29
+ /**
30
+ * Resolves the page-region id used for document workspace header chrome.
31
+ *
32
+ * Profile-level notices target region ids, while page layout regions carry
33
+ * enum kinds. This helper keeps that cross-reference in the projection layer
34
+ * instead of repeating product constants in workspace hosts.
35
+ */
36
+ export function resolveDocumentWorkspaceHeaderRegionId(pageView: ViewDefinition | null) {
37
+ return pageView?.Regions?.find((region) =>
38
+ matchesEnum(region.Kind, viewRegionKinds.header, 'Header'))?.Id ?? null
39
+ }
40
+
41
+ function findHostedView(
42
+ module: Pick<PresentationModuleDefinition, 'Views'> | null,
43
+ view: ViewDefinition | null,
44
+ regionKind: string | number,
45
+ regionKindLabel: string,
46
+ ) {
47
+ const region = view?.Regions?.find((candidate) =>
48
+ matchesEnum(candidate.Kind, regionKind, regionKindLabel))
49
+ const viewId = region?.ViewIds?.[0]
50
+
51
+ return viewId ? findPresentationView(module, viewId) : null
52
+ }
53
+
54
+ function matchesEnum(
55
+ value: string | number | null | undefined,
56
+ numericValue: string | number,
57
+ label: string,
58
+ ) {
59
+ return value === numericValue ||
60
+ String(value) === String(numericValue) ||
61
+ String(value) === label
62
+ }
@@ -0,0 +1,458 @@
1
+ import {
2
+ findPresentationView,
3
+ type DocumentWorkspaceSurfaceSlotDefinition,
4
+ type DocumentWorkspaceSurfaceSlotRole,
5
+ type PresentationBindingDefinition,
6
+ type PresentationModuleDefinition,
7
+ type ViewDefinition,
8
+ type ViewRegionDefinition,
9
+ type WorkspaceDefinition,
10
+ } from './module'
11
+ import {
12
+ createPresentationProjectionDiagnostic,
13
+ type PresentationProjectionDiagnostic,
14
+ } from './presentation-projection-diagnostics'
15
+ import {
16
+ documentWorkspaceSurfaceSlotRoleLabels,
17
+ documentWorkspaceSurfaceSlotRoles,
18
+ viewRegionKindLabels,
19
+ viewRegionKinds,
20
+ } from '@cohesivesystems/presentation-contracts'
21
+
22
+ export interface DocumentWorkspaceSurfaceSlotDescriptor {
23
+ readonly expectsHostedView: boolean
24
+ readonly id: string
25
+ readonly regionKind?: string | number | null
26
+ readonly regionKindLabel?: string
27
+ readonly role: string | number
28
+ readonly roleLabel?: string
29
+ readonly renderer?: PresentationBindingDefinition | null
30
+ }
31
+
32
+ export interface ResolvedDocumentWorkspaceSurfaceSlot {
33
+ readonly descriptor: DocumentWorkspaceSurfaceSlotDescriptor
34
+ readonly expectsHostedView: boolean
35
+ readonly id: string
36
+ readonly region: ViewRegionDefinition | null
37
+ readonly role: string | number
38
+ readonly roleLabel?: string
39
+ readonly renderer?: PresentationBindingDefinition | null
40
+ readonly view: ViewDefinition | null
41
+ }
42
+
43
+ export interface ResolvedDocumentWorkspaceSurfaceSlots {
44
+ readonly all: readonly ResolvedDocumentWorkspaceSurfaceSlot[]
45
+ readonly auxiliary: ResolvedDocumentWorkspaceSurfaceSlot
46
+ readonly header: ResolvedDocumentWorkspaceSurfaceSlot
47
+ readonly primarySurface: ResolvedDocumentWorkspaceSurfaceSlot
48
+ }
49
+
50
+ export const documentWorkspaceSurfaceSlotRoleKeys = {
51
+ header: 'header',
52
+ primarySurface: 'primarySurface',
53
+ auxiliary: 'auxiliary',
54
+ custom: 'custom',
55
+ } as const
56
+
57
+ export const documentWorkspaceSurfaceSlotIds = {
58
+ auxiliary: 'auxiliary',
59
+ header: 'header',
60
+ workspace: 'workspace',
61
+ } as const
62
+
63
+ export const documentWorkspaceSurfaceSlotDescriptors = {
64
+ header: {
65
+ expectsHostedView: true,
66
+ id: documentWorkspaceSurfaceSlotIds.header,
67
+ regionKind: viewRegionKinds.header,
68
+ regionKindLabel: viewRegionKindLabels[viewRegionKinds.header],
69
+ role: documentWorkspaceSurfaceSlotRoles.header,
70
+ roleLabel: documentWorkspaceSurfaceSlotRoleLabels[
71
+ documentWorkspaceSurfaceSlotRoles.header
72
+ ],
73
+ renderer: null,
74
+ },
75
+ workspace: {
76
+ expectsHostedView: true,
77
+ id: documentWorkspaceSurfaceSlotIds.workspace,
78
+ regionKind: viewRegionKinds.surface,
79
+ regionKindLabel: viewRegionKindLabels[viewRegionKinds.surface],
80
+ role: documentWorkspaceSurfaceSlotRoles.primarySurface,
81
+ roleLabel: documentWorkspaceSurfaceSlotRoleLabels[
82
+ documentWorkspaceSurfaceSlotRoles.primarySurface
83
+ ],
84
+ renderer: null,
85
+ },
86
+ auxiliary: {
87
+ expectsHostedView: false,
88
+ id: documentWorkspaceSurfaceSlotIds.auxiliary,
89
+ role: documentWorkspaceSurfaceSlotRoles.auxiliary,
90
+ roleLabel: documentWorkspaceSurfaceSlotRoleLabels[
91
+ documentWorkspaceSurfaceSlotRoles.auxiliary
92
+ ],
93
+ renderer: null,
94
+ },
95
+ } as const satisfies Record<string, DocumentWorkspaceSurfaceSlotDescriptor>
96
+
97
+ export function resolveDocumentWorkspaceSurfaceSlots(
98
+ module: Pick<PresentationModuleDefinition, 'Views'> | null,
99
+ pageView: ViewDefinition | null,
100
+ workspace?: Pick<WorkspaceDefinition, 'SurfaceSlots'> | null,
101
+ ): ResolvedDocumentWorkspaceSurfaceSlots {
102
+ const descriptors = resolveDocumentWorkspaceSurfaceSlotDescriptors(workspace)
103
+ const resolvedSlots = descriptors.map((descriptor) =>
104
+ resolveDocumentWorkspaceSurfaceSlot(
105
+ module,
106
+ pageView,
107
+ descriptor,
108
+ ))
109
+ const header = resolveDocumentWorkspaceSurfaceSlotByRole(
110
+ resolvedSlots,
111
+ module,
112
+ pageView,
113
+ documentWorkspaceSurfaceSlotDescriptors.header,
114
+ )
115
+ const primarySurface = resolveDocumentWorkspaceSurfaceSlotByRole(
116
+ resolvedSlots,
117
+ module,
118
+ pageView,
119
+ documentWorkspaceSurfaceSlotDescriptors.workspace,
120
+ )
121
+ const auxiliary = resolveDocumentWorkspaceSurfaceSlotByRole(
122
+ resolvedSlots,
123
+ module,
124
+ pageView,
125
+ documentWorkspaceSurfaceSlotDescriptors.auxiliary,
126
+ )
127
+
128
+ return {
129
+ all: resolvedSlots,
130
+ auxiliary,
131
+ header,
132
+ primarySurface,
133
+ }
134
+ }
135
+
136
+ export function projectDocumentWorkspaceSurfaceSlotDiagnostics({
137
+ declaredSlots,
138
+ pageView,
139
+ renderedSlots,
140
+ sourceId,
141
+ }: {
142
+ readonly declaredSlots: readonly ResolvedDocumentWorkspaceSurfaceSlot[]
143
+ readonly pageView: ViewDefinition | null
144
+ readonly renderedSlots: readonly ResolvedDocumentWorkspaceSurfaceSlot[]
145
+ readonly sourceId: string
146
+ }): readonly PresentationProjectionDiagnostic[] {
147
+ const diagnostics: PresentationProjectionDiagnostic[] = []
148
+ const declaredSlotIds = new Set(declaredSlots.map((slot) => slot.id))
149
+ const renderedSlotIds = new Set(renderedSlots.map((slot) => slot.id))
150
+
151
+ diagnostics.push(...projectDuplicateDocumentWorkspaceSurfaceSlotRoleDiagnostics({
152
+ declaredSlots,
153
+ sourceId,
154
+ }))
155
+
156
+ for (const slotId of declaredSlotIds) {
157
+ if (!renderedSlotIds.has(slotId)) {
158
+ diagnostics.push(createPresentationProjectionDiagnostic({
159
+ category: 'incomplete-projection',
160
+ id: `document-workspace-surface-slot:${slotId}:not-rendered`,
161
+ interpretation: {
162
+ status: 'unbound',
163
+ target: 'react',
164
+ },
165
+ message:
166
+ `Document workspace surface slot '${slotId}' is declared but is not rendered by the ` +
167
+ 'document editor surface interpreter.',
168
+ severity: 'warning',
169
+ source: sourceId,
170
+ subject: {
171
+ id: slotId,
172
+ kind: 'document-workspace-surface-slot',
173
+ },
174
+ suggestedNextStep:
175
+ 'Bind a surface-slot renderer for this slot role or remove it from the workspace SurfaceSlots IR.',
176
+ }))
177
+ }
178
+ }
179
+
180
+ for (const slot of distinctDocumentWorkspaceSurfaceSlots([
181
+ ...declaredSlots,
182
+ ...renderedSlots,
183
+ ])) {
184
+ if (slot.expectsHostedView && !slot.view) {
185
+ diagnostics.push(createPresentationProjectionDiagnostic({
186
+ category: 'missing-definition',
187
+ details: {
188
+ pageViewId: pageView?.Id ?? null,
189
+ regionId: slot.region?.Id ?? null,
190
+ role: resolveDocumentWorkspaceSurfaceSlotRoleKey(slot.role, slot.roleLabel),
191
+ },
192
+ id: `document-workspace-surface-slot:${slot.id}:missing-hosted-view`,
193
+ interpretation: {
194
+ status: 'unbound',
195
+ target: 'react',
196
+ },
197
+ message:
198
+ `Document workspace surface slot '${slot.id}' requires a hosted view but has no ` +
199
+ 'hosted view on the page view.',
200
+ severity: 'warning',
201
+ source: sourceId,
202
+ subject: {
203
+ id: slot.id,
204
+ kind: 'document-workspace-surface-slot',
205
+ },
206
+ suggestedNextStep:
207
+ 'Declare a page region with the expected ViewRegionKind and a hosted view id for this slot.',
208
+ }))
209
+ }
210
+ }
211
+
212
+ for (const slot of renderedSlots) {
213
+ if (!declaredSlotIds.has(slot.id)) {
214
+ diagnostics.push(createPresentationProjectionDiagnostic({
215
+ category: 'local-interpretation',
216
+ id: `document-workspace-surface-slot:${slot.id}:fallback`,
217
+ interpretation: {
218
+ status: 'locally-interpreted',
219
+ target: 'react',
220
+ },
221
+ message:
222
+ `Document workspace surface slot '${slot.id}' is rendered through the default ` +
223
+ 'surface-slot fallback because it is not declared on the workspace SurfaceSlots IR.',
224
+ severity: 'info',
225
+ source: sourceId,
226
+ subject: {
227
+ id: slot.id,
228
+ kind: 'document-workspace-surface-slot',
229
+ },
230
+ suggestedNextStep:
231
+ 'Add this slot to the workspace SurfaceSlots declaration if it is a first-class slot.',
232
+ }))
233
+ }
234
+ }
235
+
236
+ return diagnostics
237
+ }
238
+
239
+ export function resolveDocumentWorkspaceSurfaceSlotRoleKey(
240
+ role: string | number,
241
+ roleLabel?: string,
242
+ ) {
243
+ for (const [roleKey, roleValue] of Object.entries(documentWorkspaceSurfaceSlotRoles)) {
244
+ if (
245
+ isEnumDiscriminator(
246
+ role,
247
+ roleValue,
248
+ documentWorkspaceSurfaceSlotRoleLabels[
249
+ roleValue as keyof typeof documentWorkspaceSurfaceSlotRoleLabels
250
+ ],
251
+ )
252
+ ) {
253
+ return roleKey
254
+ }
255
+ }
256
+
257
+ return normalizeEnumDiscriminator(roleLabel ?? role)
258
+ }
259
+
260
+ export function isStandardDocumentWorkspaceSurfaceSlotRoleKey(roleKey: string) {
261
+ return (
262
+ roleKey === documentWorkspaceSurfaceSlotRoleKeys.header ||
263
+ roleKey === documentWorkspaceSurfaceSlotRoleKeys.primarySurface ||
264
+ roleKey === documentWorkspaceSurfaceSlotRoleKeys.auxiliary
265
+ )
266
+ }
267
+
268
+ function resolveDocumentWorkspaceSurfaceSlotDescriptors(
269
+ workspace?: Pick<WorkspaceDefinition, 'SurfaceSlots'> | null,
270
+ ): readonly DocumentWorkspaceSurfaceSlotDescriptor[] {
271
+ const slots = workspace?.SurfaceSlots ?? []
272
+ if (slots.length === 0) {
273
+ return Object.values(documentWorkspaceSurfaceSlotDescriptors)
274
+ }
275
+
276
+ return slots.map(createDocumentWorkspaceSurfaceSlotDescriptor)
277
+ }
278
+
279
+ function createDocumentWorkspaceSurfaceSlotDescriptor(
280
+ slot: DocumentWorkspaceSurfaceSlotDefinition,
281
+ ): DocumentWorkspaceSurfaceSlotDescriptor {
282
+ const regionKind = slot.RegionKind ?? undefined
283
+ return {
284
+ expectsHostedView: slot.RequiresHostedView,
285
+ id: slot.Id,
286
+ regionKind,
287
+ regionKindLabel: resolveViewRegionKindLabel(regionKind),
288
+ role: slot.Role,
289
+ roleLabel: resolveDocumentWorkspaceSurfaceSlotRoleLabel(slot.Role),
290
+ renderer: slot.Renderer ?? null,
291
+ }
292
+ }
293
+
294
+ function resolveDocumentWorkspaceSurfaceSlotByRole(
295
+ resolvedSlots: readonly ResolvedDocumentWorkspaceSurfaceSlot[],
296
+ module: Pick<PresentationModuleDefinition, 'Views'> | null,
297
+ pageView: ViewDefinition | null,
298
+ fallbackDescriptor: DocumentWorkspaceSurfaceSlotDescriptor,
299
+ ): ResolvedDocumentWorkspaceSurfaceSlot {
300
+ return (
301
+ resolvedSlots.find((slot) =>
302
+ isEnumDiscriminator(
303
+ slot.role,
304
+ fallbackDescriptor.role,
305
+ fallbackDescriptor.roleLabel ?? String(fallbackDescriptor.role),
306
+ )) ??
307
+ resolveDocumentWorkspaceSurfaceSlot(module, pageView, fallbackDescriptor)
308
+ )
309
+ }
310
+
311
+ function resolveDocumentWorkspaceSurfaceSlot(
312
+ module: Pick<PresentationModuleDefinition, 'Views'> | null,
313
+ pageView: ViewDefinition | null,
314
+ descriptor: DocumentWorkspaceSurfaceSlotDescriptor,
315
+ ): ResolvedDocumentWorkspaceSurfaceSlot {
316
+ const regionKind = descriptor.regionKind
317
+ const regionKindLabel = descriptor.regionKindLabel
318
+ const region =
319
+ regionKind === undefined || regionKind === null || regionKindLabel === undefined
320
+ ? null
321
+ : pageView?.Regions?.find((candidate) =>
322
+ isEnumDiscriminator(
323
+ candidate.Kind,
324
+ regionKind,
325
+ regionKindLabel,
326
+ )) ?? null
327
+ const viewId = region?.ViewIds?.[0]
328
+
329
+ return {
330
+ descriptor,
331
+ expectsHostedView: descriptor.expectsHostedView,
332
+ id: descriptor.id,
333
+ region,
334
+ role: descriptor.role,
335
+ roleLabel: descriptor.roleLabel,
336
+ renderer: descriptor.renderer ?? null,
337
+ view: viewId ? findPresentationView(module, viewId) : null,
338
+ }
339
+ }
340
+
341
+ function isEnumDiscriminator(
342
+ value: string | number,
343
+ expected: string | number,
344
+ expectedLabel: string,
345
+ ) {
346
+ const valueLabel = resolveViewRegionKindLabel(value)
347
+
348
+ return (
349
+ value === expected ||
350
+ String(value) === String(expected) ||
351
+ (valueLabel !== undefined &&
352
+ normalizeEnumDiscriminator(valueLabel) === normalizeEnumDiscriminator(expectedLabel)) ||
353
+ normalizeEnumDiscriminator(value) === normalizeEnumDiscriminator(expectedLabel)
354
+ )
355
+ }
356
+
357
+ function normalizeEnumDiscriminator(value: string | number) {
358
+ return String(value).replace(/[-_\s]/g, '').toLocaleLowerCase()
359
+ }
360
+
361
+ function resolveViewRegionKindLabel(regionKind: string | number | null | undefined) {
362
+ if (regionKind === null || regionKind === undefined) {
363
+ return undefined
364
+ }
365
+
366
+ if (
367
+ typeof regionKind === 'number' &&
368
+ Object.prototype.hasOwnProperty.call(viewRegionKindLabels, regionKind)
369
+ ) {
370
+ return viewRegionKindLabels[regionKind as keyof typeof viewRegionKindLabels]
371
+ }
372
+
373
+ return String(regionKind)
374
+ }
375
+
376
+ function resolveDocumentWorkspaceSurfaceSlotRoleLabel(
377
+ role: DocumentWorkspaceSurfaceSlotRole | string | number | null | undefined,
378
+ ) {
379
+ if (role === null || role === undefined) {
380
+ return undefined
381
+ }
382
+
383
+ if (
384
+ typeof role === 'number' &&
385
+ Object.prototype.hasOwnProperty.call(documentWorkspaceSurfaceSlotRoleLabels, role)
386
+ ) {
387
+ return documentWorkspaceSurfaceSlotRoleLabels[
388
+ role as keyof typeof documentWorkspaceSurfaceSlotRoleLabels
389
+ ]
390
+ }
391
+
392
+ return String(role)
393
+ }
394
+
395
+ function projectDuplicateDocumentWorkspaceSurfaceSlotRoleDiagnostics({
396
+ declaredSlots,
397
+ sourceId,
398
+ }: {
399
+ readonly declaredSlots: readonly ResolvedDocumentWorkspaceSurfaceSlot[]
400
+ readonly sourceId: string
401
+ }): readonly PresentationProjectionDiagnostic[] {
402
+ const slotsByRoleKey = new Map<string, ResolvedDocumentWorkspaceSurfaceSlot[]>()
403
+
404
+ for (const slot of declaredSlots) {
405
+ const roleKey = resolveDocumentWorkspaceSurfaceSlotRoleKey(slot.role, slot.roleLabel)
406
+ if (!isStandardDocumentWorkspaceSurfaceSlotRoleKey(roleKey)) {
407
+ continue
408
+ }
409
+
410
+ const slots = slotsByRoleKey.get(roleKey) ?? []
411
+ slots.push(slot)
412
+ slotsByRoleKey.set(roleKey, slots)
413
+ }
414
+
415
+ const diagnostics: PresentationProjectionDiagnostic[] = []
416
+ for (const [roleKey, slots] of slotsByRoleKey) {
417
+ if (slots.length <= 1) {
418
+ continue
419
+ }
420
+
421
+ diagnostics.push(createPresentationProjectionDiagnostic({
422
+ category: 'incomplete-projection',
423
+ details: {
424
+ role: roleKey,
425
+ slotIds: slots.map((slot) => slot.id),
426
+ },
427
+ id: `document-workspace-surface-slot-role:${roleKey}:duplicate`,
428
+ interpretation: {
429
+ status: 'unbound',
430
+ target: 'react',
431
+ },
432
+ message:
433
+ `Document workspace surface role '${roleKey}' is declared by multiple slots: ` +
434
+ slots.map((slot) => `'${slot.id}'`).join(', '),
435
+ severity: 'warning',
436
+ source: sourceId,
437
+ subject: {
438
+ id: roleKey,
439
+ kind: 'document-workspace-surface-slot-role',
440
+ },
441
+ suggestedNextStep:
442
+ 'Keep one standard slot per role, or introduce a custom role with an explicit renderer.',
443
+ }))
444
+ }
445
+
446
+ return diagnostics
447
+ }
448
+
449
+ function distinctDocumentWorkspaceSurfaceSlots(
450
+ slots: readonly ResolvedDocumentWorkspaceSurfaceSlot[],
451
+ ) {
452
+ const distinctSlots = new Map<string, ResolvedDocumentWorkspaceSurfaceSlot>()
453
+ for (const slot of slots) {
454
+ distinctSlots.set(slot.id, slot)
455
+ }
456
+
457
+ return [...distinctSlots.values()]
458
+ }
@@ -0,0 +1,122 @@
1
+ /**
2
+ * Transport-neutral request envelope passed to an endpoint executor after a
3
+ * presentation runtime has projected semantic inputs into concrete API inputs.
4
+ *
5
+ * @typeParam TBody - Request body payload shape.
6
+ * @typeParam TQuery - Query payload shape.
7
+ */
8
+ export interface EndpointExecutionRequest<TBody = unknown, TQuery = unknown> {
9
+ /** Request body payload for mutation/action endpoints. */
10
+ readonly body?: TBody
11
+
12
+ /** Query payload for query/read endpoints. */
13
+ readonly query?: TQuery | null
14
+
15
+ /** Route parameters substituted into endpoint paths by the host adapter. */
16
+ readonly routeParameters?: Readonly<Record<string, string | null | undefined>>
17
+ }
18
+
19
+ /**
20
+ * Executes a concrete endpoint request.
21
+ *
22
+ * Endpoint executors are supplied by applications or adapters because only the
23
+ * host knows how endpoint ids map to generated clients, fetch calls, auth, and
24
+ * transport concerns.
25
+ *
26
+ * @typeParam TResult - Result shape returned by the endpoint executor.
27
+ * @typeParam TBody - Request body payload shape.
28
+ * @typeParam TQuery - Query payload shape.
29
+ */
30
+ export type EndpointExecutor<
31
+ TResult = unknown,
32
+ TBody = unknown,
33
+ TQuery = unknown,
34
+ > = (request: EndpointExecutionRequest<TBody, TQuery>) => Promise<TResult>
35
+
36
+ /**
37
+ * Registry keyed by semantic endpoint id.
38
+ */
39
+ export type EndpointExecutorRegistry = Readonly<Record<string, EndpointExecutor>>
40
+
41
+ /**
42
+ * Dispatches an endpoint id through a host-provided endpoint executor registry.
43
+ *
44
+ * @typeParam TResult - Result shape returned by the selected executor.
45
+ * @typeParam TBody - Request body payload shape.
46
+ * @typeParam TQuery - Query payload shape.
47
+ */
48
+ export type EndpointRegistryExecutor = <
49
+ TResult = unknown,
50
+ TBody = unknown,
51
+ TQuery = unknown,
52
+ >(
53
+ endpointId: string,
54
+ request?: EndpointExecutionRequest<TBody, TQuery>,
55
+ ) => Promise<TResult>
56
+
57
+ /**
58
+ * Options for creating an endpoint registry dispatcher.
59
+ */
60
+ export interface CreateEndpointExecutorOptions {
61
+ /** Human-readable endpoint family label used in diagnostic errors. */
62
+ readonly label?: string
63
+ }
64
+
65
+ /**
66
+ * Creates a generic dispatcher from semantic endpoint ids to concrete endpoint
67
+ * executors.
68
+ */
69
+ export function createEndpointExecutor(
70
+ registry: EndpointExecutorRegistry,
71
+ { label = 'API' }: CreateEndpointExecutorOptions = {},
72
+ ): EndpointRegistryExecutor {
73
+ return async function executeEndpoint<
74
+ TResult = unknown,
75
+ TBody = unknown,
76
+ TQuery = unknown,
77
+ >(
78
+ endpointId: string,
79
+ request: EndpointExecutionRequest<TBody, TQuery> = {},
80
+ ): Promise<TResult> {
81
+ const executor = registry[endpointId]
82
+ if (!executor) {
83
+ throw new Error(`No ${label} endpoint executor is registered for endpoint '${endpointId}'.`)
84
+ }
85
+
86
+ return await executor(request) as TResult
87
+ }
88
+ }
89
+
90
+ /**
91
+ * Reads a required route parameter from a projected endpoint request.
92
+ */
93
+ export function readRequiredEndpointRouteParameter(
94
+ endpointId: string,
95
+ request: EndpointExecutionRequest,
96
+ parameterName: string,
97
+ ): string {
98
+ const value = request.routeParameters?.[parameterName]
99
+ if (value === null || value === undefined || value === '') {
100
+ throw new Error(
101
+ `Endpoint '${endpointId}' requires route parameter '${parameterName}'.`,
102
+ )
103
+ }
104
+
105
+ return value
106
+ }
107
+
108
+ /**
109
+ * Reads a required request body from a projected endpoint request.
110
+ *
111
+ * @typeParam TBody - Expected request body payload shape.
112
+ */
113
+ export function readRequiredEndpointBody<TBody>(
114
+ endpointId: string,
115
+ request: EndpointExecutionRequest,
116
+ ): TBody {
117
+ if (request.body === undefined) {
118
+ throw new Error(`Endpoint '${endpointId}' requires a request body.`)
119
+ }
120
+
121
+ return request.body as TBody
122
+ }