@honua/app-platform 0.1.1-beta.0 → 0.1.4-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (383) hide show
  1. package/collaboration/client.d.ts.map +1 -1
  2. package/connect-url-safety.d.ts +53 -0
  3. package/connect-url-safety.js +189 -0
  4. package/contract/discovery.d.ts +34 -0
  5. package/contract/discovery.d.ts.map +1 -1
  6. package/contract/index.d.ts +7 -5
  7. package/contract/index.d.ts.map +1 -1
  8. package/contract/index.js +3 -2
  9. package/contract/pmtiles.d.ts +10 -1
  10. package/contract/pmtiles.d.ts.map +1 -1
  11. package/contract/pmtiles.js +10 -2
  12. package/contract/protocol-module.d.ts +84 -9
  13. package/contract/protocol-module.d.ts.map +1 -1
  14. package/contract/query-filter-fes.d.ts +18 -0
  15. package/contract/query-filter-fes.d.ts.map +1 -0
  16. package/contract/query-filter-fes.js +122 -0
  17. package/contract/query-filter.d.ts +300 -0
  18. package/contract/query-filter.d.ts.map +1 -0
  19. package/contract/query-filter.js +883 -0
  20. package/contract/schema.d.ts +12 -0
  21. package/contract/schema.d.ts.map +1 -1
  22. package/contract/schema.js +34 -0
  23. package/contract/source-capability-support.d.ts.map +1 -1
  24. package/contract/source-capability-support.js +15 -3
  25. package/contract/source.d.ts +45 -25
  26. package/contract/source.d.ts.map +1 -1
  27. package/contract/source.js +719 -479
  28. package/contract/types.d.ts +87 -18
  29. package/contract/types.d.ts.map +1 -1
  30. package/contract/widget-source.d.ts.map +1 -1
  31. package/controls/basemap-switcher.d.ts +19 -11
  32. package/controls/basemap-switcher.d.ts.map +1 -1
  33. package/controls/basemap-switcher.js +58 -25
  34. package/controls/catalog.d.ts +105 -0
  35. package/controls/catalog.d.ts.map +1 -0
  36. package/controls/catalog.js +341 -0
  37. package/controls/element-utils.d.ts +9 -0
  38. package/controls/element-utils.d.ts.map +1 -1
  39. package/controls/element-utils.js +17 -0
  40. package/controls/index.d.ts +29 -8
  41. package/controls/index.d.ts.map +1 -1
  42. package/controls/index.js +26 -8
  43. package/controls/layer-list.d.ts +13 -5
  44. package/controls/layer-list.d.ts.map +1 -1
  45. package/controls/layer-list.js +72 -15
  46. package/controls/legend.d.ts +32 -5
  47. package/controls/legend.d.ts.map +1 -1
  48. package/controls/legend.js +95 -25
  49. package/controls/qualification.d.ts +152 -0
  50. package/controls/qualification.d.ts.map +1 -0
  51. package/controls/qualification.js +1265 -0
  52. package/controls/registry.d.ts +104 -0
  53. package/controls/registry.d.ts.map +1 -0
  54. package/controls/registry.js +150 -0
  55. package/controls/swipe-control.d.ts +6 -1
  56. package/controls/swipe-control.d.ts.map +1 -1
  57. package/controls/swipe-control.js +82 -20
  58. package/core/client.d.ts +45 -21
  59. package/core/client.d.ts.map +1 -1
  60. package/core/client.js +224 -46
  61. package/core/error-classifications.d.ts +6 -0
  62. package/core/error-classifications.d.ts.map +1 -1
  63. package/core/error-classifications.js +6 -0
  64. package/core/error-code-registry.d.ts +6 -0
  65. package/core/error-code-registry.d.ts.map +1 -1
  66. package/core/error-code-registry.js +6 -0
  67. package/core/error-envelope.js +2 -0
  68. package/core/errors.d.ts +1 -1
  69. package/core/errors.js +1 -1
  70. package/core/geoparquet-sql.d.ts +68 -4
  71. package/core/geoparquet-sql.d.ts.map +1 -1
  72. package/core/geoparquet-sql.js +325 -8
  73. package/core/odata-write-codec.d.ts.map +1 -1
  74. package/core/odata-write-codec.js +0 -1
  75. package/core/odata.d.ts +6 -0
  76. package/core/odata.d.ts.map +1 -1
  77. package/core/odata.js +6 -1
  78. package/core/ogc-processes.d.ts +182 -25
  79. package/core/ogc-processes.d.ts.map +1 -1
  80. package/core/ogc-processes.js +602 -30
  81. package/core/process-runner.d.ts +8 -1
  82. package/core/process-runner.d.ts.map +1 -1
  83. package/core/process-runner.js +1 -0
  84. package/core/protocol-transport.d.ts +2 -0
  85. package/core/protocol-transport.d.ts.map +1 -1
  86. package/core/stac.d.ts +31 -0
  87. package/core/stac.d.ts.map +1 -1
  88. package/core/stac.js +136 -19
  89. package/core/surfaces.d.ts.map +1 -1
  90. package/core/surfaces.js +273 -68
  91. package/core/types.d.ts +123 -9
  92. package/core/types.d.ts.map +1 -1
  93. package/core/wfs-axis-order.d.ts +18 -0
  94. package/core/wfs-axis-order.d.ts.map +1 -0
  95. package/core/wfs-axis-order.js +108 -0
  96. package/core/wfs-capabilities.d.ts +65 -24
  97. package/core/wfs-capabilities.d.ts.map +1 -1
  98. package/core/wfs-capabilities.js +237 -27
  99. package/core/wfs-filter.d.ts +26 -3
  100. package/core/wfs-filter.d.ts.map +1 -1
  101. package/core/wfs-filter.js +48 -53
  102. package/core/wfs-protocol-error.d.ts +12 -0
  103. package/core/wfs-protocol-error.d.ts.map +1 -0
  104. package/core/wfs-protocol-error.js +13 -0
  105. package/core/wfs.d.ts +53 -1
  106. package/core/wfs.d.ts.map +1 -1
  107. package/core/wfs.js +251 -29
  108. package/core/wms-feature-info.d.ts +92 -0
  109. package/core/wms-feature-info.d.ts.map +1 -0
  110. package/core/wms-feature-info.js +285 -0
  111. package/core/wms.d.ts +9 -0
  112. package/core/wms.d.ts.map +1 -1
  113. package/core/wms.js +17 -5
  114. package/esri-compat/event-bus.d.ts +20 -0
  115. package/esri-compat/event-bus.d.ts.map +1 -1
  116. package/esri-compat/feature-filter.d.ts +46 -1
  117. package/esri-compat/feature-filter.d.ts.map +1 -1
  118. package/esri-compat/feature-filter.js +49 -0
  119. package/esri-compat/geojson-layer.d.ts +4 -2
  120. package/esri-compat/geojson-layer.d.ts.map +1 -1
  121. package/esri-compat/geojson-layer.js +4 -2
  122. package/esri-compat/identity-manager.js +2 -2
  123. package/esri-compat/imagery-layer.d.ts +2 -1
  124. package/esri-compat/imagery-layer.d.ts.map +1 -1
  125. package/esri-compat/imagery-layer.js +2 -1
  126. package/esri-compat/layer-list.d.ts +8 -1
  127. package/esri-compat/layer-list.d.ts.map +1 -1
  128. package/esri-compat/layer-list.js +11 -4
  129. package/esri-compat/legend.d.ts.map +1 -1
  130. package/esri-compat/legend.js +1 -1
  131. package/esri-compat/locator.d.ts +297 -0
  132. package/esri-compat/locator.d.ts.map +1 -0
  133. package/esri-compat/locator.js +579 -0
  134. package/esri-compat/map-image-layer.d.ts.map +1 -1
  135. package/esri-compat/map-view.d.ts.map +1 -1
  136. package/esri-compat/map-view.js +1 -1
  137. package/esri-compat/scene-view.d.ts.map +1 -1
  138. package/esri-compat/time-slider.d.ts +29 -0
  139. package/esri-compat/time-slider.d.ts.map +1 -1
  140. package/esri-compat/time-slider.js +117 -0
  141. package/esri-compat/wfs-layer.d.ts +2 -1
  142. package/esri-compat/wfs-layer.d.ts.map +1 -1
  143. package/esri-compat/wfs-layer.js +2 -1
  144. package/esri-compat/widget-host.d.ts +42 -6
  145. package/esri-compat/widget-host.d.ts.map +1 -1
  146. package/esri-compat/widget-host.js +99 -10
  147. package/generated-app/projection.d.ts.map +1 -1
  148. package/generated-app/runtime.d.ts.map +1 -1
  149. package/map/data-to-map-bridge.d.ts +1 -1
  150. package/map/data-to-map-bridge.d.ts.map +1 -1
  151. package/map/data-to-map-bridge.js +1 -2
  152. package/map/honua-map.d.ts.map +1 -1
  153. package/map/honua-map.js +1 -1
  154. package/map/index.d.ts +2 -0
  155. package/map/index.d.ts.map +1 -1
  156. package/map/index.js +2 -0
  157. package/map/realtime-reconciliation-adapter.d.ts +98 -0
  158. package/map/realtime-reconciliation-adapter.d.ts.map +1 -0
  159. package/map/realtime-reconciliation-adapter.js +84 -0
  160. package/map/temporal-playback.d.ts +25 -0
  161. package/map/temporal-playback.d.ts.map +1 -1
  162. package/map/temporal-playback.js +29 -1
  163. package/operator/workspace/workspace.d.ts.map +1 -1
  164. package/operator/workspace/workspace.js +0 -2
  165. package/package.json +4 -3
  166. package/query-planner/canonical-filter.d.ts +30 -0
  167. package/query-planner/canonical-filter.d.ts.map +1 -0
  168. package/query-planner/canonical-filter.js +30 -0
  169. package/query-planner/columnar-plan.d.ts +63 -0
  170. package/query-planner/columnar-plan.d.ts.map +1 -0
  171. package/query-planner/columnar-plan.js +94 -0
  172. package/query-planner/diagnostics.d.ts +3 -3
  173. package/query-planner/diagnostics.d.ts.map +1 -1
  174. package/query-planner/diagnostics.js +17 -4
  175. package/query-planner/duckdb.d.ts.map +1 -1
  176. package/query-planner/duckdb.js +16 -2
  177. package/query-planner/execution-context.d.ts.map +1 -1
  178. package/query-planner/execution-context.js +3 -1
  179. package/query-planner/executor.d.ts.map +1 -1
  180. package/query-planner/executor.js +7 -1
  181. package/query-planner/geoservices.d.ts.map +1 -1
  182. package/query-planner/geoservices.js +24 -5
  183. package/query-planner/grpc.d.ts.map +1 -1
  184. package/query-planner/grpc.js +29 -5
  185. package/query-planner/index.d.ts +20 -5
  186. package/query-planner/index.d.ts.map +1 -1
  187. package/query-planner/index.js +16 -3
  188. package/query-planner/ir.d.ts +6 -1
  189. package/query-planner/ir.d.ts.map +1 -1
  190. package/query-planner/ir.js +63 -1
  191. package/query-planner/odata-protocol-module.d.ts +54 -0
  192. package/query-planner/odata-protocol-module.d.ts.map +1 -0
  193. package/query-planner/odata-protocol-module.js +199 -0
  194. package/query-planner/odata-v1.d.ts +23 -0
  195. package/query-planner/odata-v1.d.ts.map +1 -0
  196. package/query-planner/odata-v1.js +202 -0
  197. package/query-planner/odata.d.ts +0 -3
  198. package/query-planner/odata.d.ts.map +1 -1
  199. package/query-planner/odata.js +0 -143
  200. package/query-planner/ogc-features.d.ts.map +1 -1
  201. package/query-planner/ogc-features.js +23 -1
  202. package/query-planner/planner.d.ts +2 -2
  203. package/query-planner/planner.d.ts.map +1 -1
  204. package/query-planner/planner.js +146 -27
  205. package/query-planner/representation.d.ts +59 -0
  206. package/query-planner/representation.d.ts.map +1 -0
  207. package/query-planner/representation.js +140 -0
  208. package/query-planner/types.d.ts +153 -3
  209. package/query-planner/types.d.ts.map +1 -1
  210. package/query-planner/wfs-protocol-module.d.ts +57 -0
  211. package/query-planner/wfs-protocol-module.d.ts.map +1 -0
  212. package/query-planner/wfs-protocol-module.js +731 -0
  213. package/query-planner/wfs-v1.d.ts +41 -0
  214. package/query-planner/wfs-v1.d.ts.map +1 -0
  215. package/query-planner/wfs-v1.js +366 -0
  216. package/query-planner/wfs.d.ts +1 -3
  217. package/query-planner/wfs.d.ts.map +1 -1
  218. package/query-planner/wfs.js +1 -70
  219. package/realtime/checkpoint-store.d.ts +206 -0
  220. package/realtime/checkpoint-store.d.ts.map +1 -0
  221. package/realtime/checkpoint-store.js +504 -0
  222. package/realtime/honua-server.d.ts +8 -0
  223. package/realtime/honua-server.d.ts.map +1 -1
  224. package/realtime/honua-server.js +123 -14
  225. package/realtime/index.d.ts +4 -0
  226. package/realtime/index.d.ts.map +1 -1
  227. package/realtime/index.js +2 -0
  228. package/realtime/reconciliation.d.ts +245 -0
  229. package/realtime/reconciliation.d.ts.map +1 -0
  230. package/realtime/reconciliation.js +377 -0
  231. package/realtime/resumable-transport.d.ts.map +1 -1
  232. package/realtime/sse.d.ts.map +1 -1
  233. package/realtime/websocket.d.ts.map +1 -1
  234. package/realtime/wire.d.ts +2 -1
  235. package/realtime/wire.d.ts.map +1 -1
  236. package/realtime/wire.js +24 -8
  237. package/replica-sync/errors.d.ts +19 -1
  238. package/replica-sync/errors.d.ts.map +1 -1
  239. package/replica-sync/errors.js +16 -0
  240. package/replica-sync/geoservices.d.ts +260 -0
  241. package/replica-sync/geoservices.d.ts.map +1 -0
  242. package/replica-sync/geoservices.js +1093 -0
  243. package/replica-sync/index.d.ts +5 -1
  244. package/replica-sync/index.d.ts.map +1 -1
  245. package/replica-sync/index.js +3 -1
  246. package/replica-sync/transport-conformance.d.ts +58 -0
  247. package/replica-sync/transport-conformance.d.ts.map +1 -0
  248. package/replica-sync/transport-conformance.js +265 -0
  249. package/replica-sync/types.d.ts +22 -0
  250. package/replica-sync/types.d.ts.map +1 -1
  251. package/runtime/index.d.ts +6 -2
  252. package/runtime/index.d.ts.map +1 -1
  253. package/runtime/index.js +3 -1
  254. package/runtime/load-package.d.ts +24 -0
  255. package/runtime/load-package.d.ts.map +1 -1
  256. package/runtime/load-package.js +45 -1
  257. package/runtime/maplibre-renderer.d.ts +11 -0
  258. package/runtime/maplibre-renderer.d.ts.map +1 -1
  259. package/runtime/maplibre-renderer.js +32 -7
  260. package/runtime/offline-region-protocol.d.ts +73 -0
  261. package/runtime/offline-region-protocol.d.ts.map +1 -0
  262. package/runtime/offline-region-protocol.js +63 -0
  263. package/runtime/offline-region-style.d.ts +78 -0
  264. package/runtime/offline-region-style.d.ts.map +1 -0
  265. package/runtime/offline-region-style.js +147 -0
  266. package/runtime/pmtiles-protocol.d.ts +7 -8
  267. package/runtime/pmtiles-protocol.d.ts.map +1 -1
  268. package/runtime/pmtiles-protocol.js +19 -66
  269. package/runtime/protocol-registry.d.ts +55 -0
  270. package/runtime/protocol-registry.d.ts.map +1 -0
  271. package/runtime/protocol-registry.js +103 -0
  272. package/runtime/runtime.d.ts +2 -0
  273. package/runtime/runtime.d.ts.map +1 -1
  274. package/runtime/runtime.js +6 -1
  275. package/scene-workspace/analysis-widgets.d.ts +4 -2
  276. package/scene-workspace/analysis-widgets.d.ts.map +1 -1
  277. package/scene-workspace/analysis-widgets.js +4 -2
  278. package/scene-workspace/camera-correspondence.d.ts +151 -0
  279. package/scene-workspace/camera-correspondence.d.ts.map +1 -0
  280. package/scene-workspace/camera-correspondence.js +220 -0
  281. package/scene-workspace/cesium-adapter.d.ts +230 -29
  282. package/scene-workspace/cesium-adapter.d.ts.map +1 -1
  283. package/scene-workspace/cesium-adapter.js +741 -56
  284. package/scene-workspace/cesium-mount.d.ts +205 -0
  285. package/scene-workspace/cesium-mount.d.ts.map +1 -0
  286. package/scene-workspace/cesium-mount.js +392 -0
  287. package/scene-workspace/cesium-scene-owner.d.ts +160 -0
  288. package/scene-workspace/cesium-scene-owner.d.ts.map +1 -0
  289. package/scene-workspace/cesium-scene-owner.js +205 -0
  290. package/scene-workspace/cesium-state-sync.d.ts +101 -0
  291. package/scene-workspace/cesium-state-sync.d.ts.map +1 -0
  292. package/scene-workspace/cesium-state-sync.js +432 -0
  293. package/scene-workspace/cesium-time.d.ts +346 -0
  294. package/scene-workspace/cesium-time.d.ts.map +1 -0
  295. package/scene-workspace/cesium-time.js +403 -0
  296. package/scene-workspace/index.d.ts +42 -10
  297. package/scene-workspace/index.d.ts.map +1 -1
  298. package/scene-workspace/index.js +32 -7
  299. package/scene-workspace/maplibre-state-sync.d.ts +112 -0
  300. package/scene-workspace/maplibre-state-sync.d.ts.map +1 -0
  301. package/scene-workspace/maplibre-state-sync.js +400 -0
  302. package/scene-workspace/primitives.d.ts +237 -3
  303. package/scene-workspace/primitives.d.ts.map +1 -1
  304. package/scene-workspace/primitives.js +1087 -17
  305. package/scene-workspace/scene-discovery.d.ts +5 -2
  306. package/scene-workspace/scene-discovery.d.ts.map +1 -1
  307. package/scene-workspace/scene-discovery.js +5 -2
  308. package/scene-workspace/scene-view.d.ts +5 -2
  309. package/scene-workspace/scene-view.d.ts.map +1 -1
  310. package/scene-workspace/scene-view.js +5 -2
  311. package/scene-workspace/source-to-cesium.d.ts +141 -8
  312. package/scene-workspace/source-to-cesium.d.ts.map +1 -1
  313. package/scene-workspace/source-to-cesium.js +497 -72
  314. package/scene-workspace/state-sync-port-kit.d.ts +156 -0
  315. package/scene-workspace/state-sync-port-kit.d.ts.map +1 -0
  316. package/scene-workspace/state-sync-port-kit.js +319 -0
  317. package/scene-workspace/state-sync.d.ts +34 -1
  318. package/scene-workspace/state-sync.d.ts.map +1 -1
  319. package/scene-workspace/state-sync.js +48 -0
  320. package/scene-workspace/types.d.ts +8 -0
  321. package/scene-workspace/types.d.ts.map +1 -1
  322. package/scene-workspace/types.js +2 -0
  323. package/scene-workspace/workspace.d.ts +12 -1
  324. package/scene-workspace/workspace.d.ts.map +1 -1
  325. package/scene-workspace/workspace.js +13 -0
  326. package/studio/index.d.ts +24 -7
  327. package/studio/index.d.ts.map +1 -1
  328. package/studio/index.js +21 -7
  329. package/studio/lifecycle-client.d.ts +164 -0
  330. package/studio/lifecycle-client.d.ts.map +1 -0
  331. package/studio/lifecycle-client.js +299 -0
  332. package/studio/lifecycle-errors.d.ts +91 -0
  333. package/studio/lifecycle-errors.d.ts.map +1 -0
  334. package/studio/lifecycle-errors.js +77 -0
  335. package/studio/lifecycle-types.d.ts +321 -0
  336. package/studio/lifecycle-types.d.ts.map +1 -0
  337. package/studio/lifecycle-types.js +22 -0
  338. package/web-components/controller.d.ts.map +1 -1
  339. package/web-components/csp-styles.d.ts +6 -0
  340. package/web-components/csp-styles.d.ts.map +1 -0
  341. package/web-components/csp-styles.js +53 -0
  342. package/web-components/elements.d.ts +158 -2
  343. package/web-components/elements.d.ts.map +1 -1
  344. package/web-components/elements.js +1302 -215
  345. package/web-components/export-redaction.d.ts +252 -0
  346. package/web-components/export-redaction.d.ts.map +1 -0
  347. package/web-components/export-redaction.js +588 -0
  348. package/web-components/export.d.ts +417 -0
  349. package/web-components/export.d.ts.map +1 -0
  350. package/web-components/export.js +719 -0
  351. package/web-components/feature-editor-model.d.ts +265 -0
  352. package/web-components/feature-editor-model.d.ts.map +1 -0
  353. package/web-components/feature-editor-model.js +438 -0
  354. package/web-components/feature-editor-sketch.d.ts +125 -0
  355. package/web-components/feature-editor-sketch.d.ts.map +1 -0
  356. package/web-components/feature-editor-sketch.js +194 -0
  357. package/web-components/feature-editor-workflow.d.ts +286 -0
  358. package/web-components/feature-editor-workflow.d.ts.map +1 -0
  359. package/web-components/feature-editor-workflow.js +889 -0
  360. package/web-components/feature-editor.d.ts +83 -0
  361. package/web-components/feature-editor.d.ts.map +1 -0
  362. package/web-components/feature-editor.js +829 -0
  363. package/web-components/feature-table-engine.d.ts +465 -0
  364. package/web-components/feature-table-engine.d.ts.map +1 -0
  365. package/web-components/feature-table-engine.js +1360 -0
  366. package/web-components/feature-table-view.d.ts +95 -0
  367. package/web-components/feature-table-view.d.ts.map +1 -0
  368. package/web-components/feature-table-view.js +343 -0
  369. package/web-components/index.d.ts +34 -3
  370. package/web-components/index.d.ts.map +1 -1
  371. package/web-components/index.js +35 -2
  372. package/web-components/maplibre-renderer.d.ts.map +1 -1
  373. package/web-components/maplibre-renderer.js +13 -4
  374. package/web-components/measurement.d.ts +3 -1
  375. package/web-components/measurement.d.ts.map +1 -1
  376. package/web-components/measurement.js +62 -18
  377. package/web-components/time-slider.d.ts +122 -0
  378. package/web-components/time-slider.d.ts.map +1 -0
  379. package/web-components/time-slider.js +740 -0
  380. package/web-components/types.d.ts +310 -0
  381. package/web-components/types.d.ts.map +1 -1
  382. package/webmap/convert-label.js +0 -1
  383. package/webmap/convert-symbol.d.ts.map +1 -1
@@ -88,9 +88,32 @@ export function decodeHonuaServerRealtimeEvent(payload) {
88
88
  throw new HonuaRealtimeResumeError("invalid-event", "honua-server streaming payload must be a JSON object.");
89
89
  }
90
90
  const envelope = payload;
91
- // Status / heartbeat / error envelopes already use the SDK vocabulary.
92
- if (typeof envelope.type === "string" && envelope.type !== "change" && envelope.type !== "feature-change") {
93
- return decodeRealtimeServerSentEvent(payload);
91
+ // A current-server change discriminator always wins over generic `type`.
92
+ // Otherwise a malformed/colliding payload could masquerade as status or
93
+ // error and bypass the stricter operation/after-image validation below.
94
+ const currentServerChange = envelope.operation !== undefined;
95
+ // Snapshot / status / heartbeat / error envelopes already use the SDK
96
+ // vocabulary. Their `cursor`, however, is honua-server's global event-store
97
+ // position: a JSON number on the batched `snapshot` baseline frame, where the
98
+ // SDK's resume gate requires the string form it checkpoints. Normalizing it
99
+ // here — the one place that already owns honua-server's wire dialect — keeps
100
+ // a batched baseline from failing closed as a checkpoint conflict.
101
+ if (!currentServerChange &&
102
+ typeof envelope.type === "string" &&
103
+ envelope.type !== "change" &&
104
+ envelope.type !== "feature-change") {
105
+ const framed = withNormalizedNumericCursor(payload);
106
+ if (envelope.type === "status" && (payload.status === "connected" || payload.status === "subscribed")) {
107
+ return decodeRealtimeServerSentEvent({ ...framed, status: "live" });
108
+ }
109
+ return decodeRealtimeServerSentEvent(framed);
110
+ }
111
+ const serviceId = optionalNonEmptyText(envelope.serviceId, "serviceId");
112
+ optionalNonEmptyText(envelope.sourceId, "sourceId");
113
+ const cursor = normalizeCursor(envelope.cursor);
114
+ const sequence = optionalSequence(envelope.sequence);
115
+ if (currentServerChange && serviceId === undefined) {
116
+ throw new HonuaRealtimeResumeError("invalid-event", "honua-server current feature-change envelope is missing serviceId.");
94
117
  }
95
118
  const changes = collectChanges(envelope);
96
119
  if (changes.length === 0) {
@@ -98,8 +121,8 @@ export function decodeHonuaServerRealtimeEvent(payload) {
98
121
  }
99
122
  const base = {
100
123
  eventId: envelope.eventId,
101
- sequence: envelope.sequence,
102
- cursor: envelope.cursor,
124
+ sequence,
125
+ cursor,
103
126
  watermark: envelope.watermark,
104
127
  timestamp: envelope.timestamp,
105
128
  deltaToken: envelope.deltaToken,
@@ -110,19 +133,18 @@ export function decodeHonuaServerRealtimeEvent(payload) {
110
133
  if (!isRecord(change)) {
111
134
  throw new HonuaRealtimeResumeError("invalid-event", "honua-server feature change must be an object.");
112
135
  }
113
- if (change.featureId === undefined) {
114
- throw new HonuaRealtimeResumeError("invalid-event", "honua-server feature change is missing featureId.");
115
- }
116
- if (change.op === "delete") {
117
- deletes.push({ id: change.featureId, version: change.version, updatedAt: change.updatedAt });
136
+ const operation = featureChangeOperation(change.op);
137
+ const featureId = featureIdValue(change.featureId);
138
+ if (operation === "delete") {
139
+ deletes.push({ id: featureId, version: change.version, updatedAt: change.updatedAt });
118
140
  continue;
119
141
  }
120
142
  if (change.feature === undefined) {
121
- throw new HonuaRealtimeResumeError("invalid-event", `honua-server ${change.op} change is missing feature payload.`);
143
+ throw new HonuaRealtimeResumeError("invalid-event", `honua-server ${operation} change is missing feature payload.`);
122
144
  }
123
145
  upserts.push({
124
- id: change.featureId,
125
- sourceId: envelope.serviceId,
146
+ id: featureId,
147
+ sourceId: serviceId,
126
148
  feature: change.feature,
127
149
  version: change.version,
128
150
  updatedAt: change.updatedAt,
@@ -132,7 +154,7 @@ export function decodeHonuaServerRealtimeEvent(payload) {
132
154
  type: "delta",
133
155
  ...base,
134
156
  ...(upserts.length ? { upserts } : {}),
135
- ...(deletes.length ? { deletes: deletes.map((entry) => ({ ...entry, sourceId: envelope.serviceId })) } : {}),
157
+ ...(deletes.length ? { deletes: deletes.map((entry) => ({ ...entry, sourceId: serviceId })) } : {}),
136
158
  };
137
159
  }
138
160
  /**
@@ -173,6 +195,19 @@ function resolveStreamingUrl(baseUrl) {
173
195
  return `${trimTrailingSlashes(baseUrl)}${HONUA_SERVER_STREAMING_FEATURES_PATH}`;
174
196
  }
175
197
  function collectChanges(envelope) {
198
+ if (envelope.operation !== undefined) {
199
+ const operation = currentServerOperation(envelope.operation);
200
+ const featureId = envelope.featureId === "" || envelope.featureId === undefined ? envelope.objectId : envelope.featureId;
201
+ return [
202
+ {
203
+ op: operation,
204
+ featureId,
205
+ feature: operation === "delete" ? undefined : projectCurrentServerFeature(envelope, featureId),
206
+ version: envelope.version,
207
+ updatedAt: envelope.updatedAt ?? envelope.timestamp,
208
+ },
209
+ ];
210
+ }
176
211
  if (Array.isArray(envelope.changes))
177
212
  return envelope.changes;
178
213
  if (envelope.op !== undefined) {
@@ -188,6 +223,80 @@ function collectChanges(envelope) {
188
223
  }
189
224
  return [];
190
225
  }
226
+ function projectCurrentServerFeature(envelope, featureId) {
227
+ if (!Object.hasOwn(envelope, "geometry") || envelope.geometry === undefined) {
228
+ throw new HonuaRealtimeResumeError("invalid-event", "honua-server insert/update change is missing a complete geometry after-image.");
229
+ }
230
+ if (!isAttributeRecord(envelope.attributes)) {
231
+ throw new HonuaRealtimeResumeError("invalid-event", "honua-server insert/update change is missing a complete attributes after-image.");
232
+ }
233
+ return {
234
+ type: "Feature",
235
+ ...(featureId === undefined ? {} : { id: featureId }),
236
+ geometry: envelope.geometry,
237
+ properties: envelope.attributes,
238
+ };
239
+ }
240
+ /**
241
+ * Render a numeric `cursor` in its string form, leaving every other payload
242
+ * untouched. A malformed numeric cursor is deliberately left as-is so the
243
+ * resume gate still reports it, rather than being converted into a decode
244
+ * failure that would hide which contract was actually violated.
245
+ */
246
+ function withNormalizedNumericCursor(payload) {
247
+ const cursor = payload.cursor;
248
+ if (typeof cursor !== "number")
249
+ return payload;
250
+ if (!Number.isSafeInteger(cursor) || cursor < 0)
251
+ return payload;
252
+ return { ...payload, cursor: String(cursor) };
253
+ }
254
+ function normalizeCursor(cursor) {
255
+ if (cursor === undefined)
256
+ return undefined;
257
+ if (typeof cursor === "number") {
258
+ if (Number.isSafeInteger(cursor) && cursor >= 0)
259
+ return String(cursor);
260
+ }
261
+ else if (typeof cursor === "string" && cursor.length > 0) {
262
+ return cursor;
263
+ }
264
+ throw new HonuaRealtimeResumeError("invalid-event", "honua-server feature-change cursor must be a non-empty string or non-negative safe integer.");
265
+ }
266
+ function optionalSequence(sequence) {
267
+ if (sequence === undefined)
268
+ return undefined;
269
+ if (typeof sequence === "number" && Number.isSafeInteger(sequence) && sequence >= 0)
270
+ return sequence;
271
+ throw new HonuaRealtimeResumeError("invalid-event", "honua-server feature-change sequence must be a non-negative safe integer.");
272
+ }
273
+ function optionalNonEmptyText(value, field) {
274
+ if (value === undefined || value === null)
275
+ return undefined;
276
+ if (typeof value === "string" && value.length > 0)
277
+ return value;
278
+ throw new HonuaRealtimeResumeError("invalid-event", `honua-server feature-change ${field} must be a non-empty string.`);
279
+ }
280
+ function featureIdValue(value) {
281
+ if (typeof value === "string" && value.length > 0)
282
+ return value;
283
+ if (typeof value === "number" && Number.isSafeInteger(value))
284
+ return value;
285
+ throw new HonuaRealtimeResumeError("invalid-event", "honua-server feature change featureId must be a non-empty string or safe integer.");
286
+ }
287
+ function featureChangeOperation(value) {
288
+ if (value === "insert" || value === "update" || value === "delete" || value === "snapshot")
289
+ return value;
290
+ throw new HonuaRealtimeResumeError("invalid-event", "honua-server feature change operation must be insert, update, delete, or snapshot.");
291
+ }
292
+ function currentServerOperation(value) {
293
+ if (value === "insert" || value === "update" || value === "delete")
294
+ return value;
295
+ throw new HonuaRealtimeResumeError("invalid-event", "honua-server current feature-change operation must be insert, update, or delete.");
296
+ }
297
+ function isAttributeRecord(value) {
298
+ return isRecord(value) && !Array.isArray(value);
299
+ }
191
300
  function isRecord(value) {
192
301
  return typeof value === "object" && value !== null;
193
302
  }
@@ -20,6 +20,8 @@ export { createRealtimeFeatureStore } from "./store.js";
20
20
  export type { RealtimeFeatureStore } from "./store.js";
21
21
  export { REALTIME_DURABLE_CHECKPOINT_VERSION, HonuaRealtimeResumeError, createResumableRealtimeSubscription, evaluateRealtimeCheckpoint, } from "./resumable.js";
22
22
  export type { CreateResumableRealtimeSubscriptionOptions, RealtimeCheckpointCompatibility, RealtimeCheckpointCompatibilityCode, RealtimeCheckpointStore, RealtimeDurableCheckpointV1, RealtimeExternalResnapshotReason, RealtimeResumeContextV1, RealtimeSequencedEvent, ResumableRealtimeDelivery, ResumableRealtimeDeliveryStatus, ResumableRealtimePhase, ResumableRealtimeReasonCode, ResumableRealtimeState, ResumableRealtimeSubscription, } from "./resumable.js";
23
+ export { createIndexedDbCheckpointStorage, createIndexedDbRealtimeCheckpointStore, createMemoryCheckpointStorage, createMemoryRealtimeCheckpointStore, createRealtimeCheckpointStore, DEFAULT_REALTIME_CHECKPOINT_MAX_AGE_MS, DEFAULT_REALTIME_CHECKPOINT_MAX_RECORDS, HONUA_REALTIME_CHECKPOINT_STORE_FORMAT, MAX_REALTIME_CHECKPOINT_MAX_AGE_MS, MAX_REALTIME_CHECKPOINT_RECORDS, realtimeAuthorizationScopeDigest, realtimeCheckpointScopeKey, } from "./checkpoint-store.js";
24
+ export type { IndexedDbRealtimeCheckpointStoreOptions, RealtimeCheckpointRecordStorage, RealtimeCheckpointRecordV1, RealtimeCheckpointStoreDiagnosticV1, RealtimeCheckpointStoreHandle, RealtimeCheckpointStoreOptions, RealtimeCheckpointStoreReason, RealtimeStoredResumePosition, } from "./checkpoint-store.js";
23
25
  export { assertRealtimePlanIdentity, deriveRealtimeContractAuthority, realtimePlanFingerprint, redactRealtimeCheckpoint, serializeRealtimeCheckpoint, serializeRedactedRealtimeCheckpoint, } from "./contract.js";
24
26
  export type { DeriveRealtimeContractAuthorityOptions, RealtimeContractAuthority, RealtimeContractAuthorityState, RedactedRealtimeCheckpointV1, RedactedRealtimeResumePosition, RedactedResumePosition, } from "./contract.js";
25
27
  export { createRealtimeWebSocketTransport } from "./websocket.js";
@@ -29,6 +31,8 @@ export type { OdataDeltaEntity, OdataDeltaInitialQuery, OdataDeltaPollTelemetry,
29
31
  export { computeReconnectDelayMs, createResumableRealtimeTransport, createResumableServerSentEventsTransport, createResumableWebSocketTransport, } from "./resumable-transport.js";
30
32
  export type { RealtimeReconnectPolicy, RealtimeResumableTransportOptions, RealtimeResumableTransportTelemetry, } from "./resumable-transport.js";
31
33
  export { filterRealtimeSelection, reconcileRealtimeSelection } from "./exploration.js";
34
+ export { HonuaRealtimeReconciliationError, createRealtimeReconciledCache, createRealtimeReconciler, diffRealtimeFeatureState, realtimeReconciliationVersion, reconcileRealtimeKeyedState, reconcileRealtimeViewport, } from "./reconciliation.js";
35
+ export type { RealtimeKeyedStateReconciliation, RealtimeReconciledCache, RealtimeReconciledCacheSnapshot, RealtimeReconciler, RealtimeReconcilerOptions, RealtimeReconciliationChange, RealtimeReconciliationChangeKind, RealtimeReconciliationDiff, RealtimeReconciliationErrorCode, RealtimeReconciliationInvalidation, RealtimeReconciliationInvalidationReason, RealtimeReconciliationMode, RealtimeReconciliationRebuildReason, RealtimeReconciliationResetReasonCode, RealtimeReconciliationResult, RealtimeReconciliationTrigger, RealtimeReconciliationVersion, RealtimeViewportReconciliation, } from "./reconciliation.js";
32
36
  export { selectRealtimeDetail, selectRealtimeFeatureRecordMap, selectRealtimeFeatureRecords, selectRealtimeFeatureTombstones, selectRealtimeFeatures, } from "./projections.js";
33
37
  export type { RealtimeDetailSelectorOptions, RealtimeDetailState, RealtimeFeatureRecordSelectorOptions, RealtimeFeatureReference, } from "./projections.js";
34
38
  export type { RealtimeConnectionStatus, RealtimeDeleteEvent, RealtimeDeletePatch, RealtimeDeltaEvent, RealtimeErrorEvent, RealtimeFeatureEvent, RealtimeFeatureEventBase, RealtimeFeatureObserver, RealtimeFeaturePatch, RealtimeFeatureRecord, RealtimeFeatureState, RealtimeFeatureTombstone, RealtimeFeatureTransport, RealtimeHeartbeatEvent, RealtimeReducerOptions, RealtimeResumeCheckpoint, RealtimeResumeMode, RealtimeSnapshotEvent, RealtimeStateListener, RealtimeStatusEvent, RealtimeStalenessOptions, RealtimeSubscriptionIdentity, RealtimeSubscriptionHandle, RealtimeSubscriptionMode, RealtimeSubscriptionRequest, RealtimeTransportCapabilities, RealtimeTransportKind, RealtimeUpsertEvent, } from "./types.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/realtime/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EACL,uCAAuC,EACvC,6BAA6B,EAC7B,4BAA4B,GAC7B,MAAM,UAAU,CAAC;AAClB,YAAY,EACV,6BAA6B,EAC7B,oCAAoC,EACpC,wCAAwC,GACzC,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,qCAAqC,EACrC,8BAA8B,EAC9B,gCAAgC,EAChC,yBAAyB,EACzB,oCAAoC,GACrC,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,4CAA4C,EAC5C,wBAAwB,EACxB,gCAAgC,GACjC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,yBAAyB,EACzB,0BAA0B,EAC1B,0BAA0B,EAC1B,kBAAkB,EAClB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AACxD,YAAY,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EACL,mCAAmC,EACnC,wBAAwB,EACxB,mCAAmC,EACnC,0BAA0B,GAC3B,MAAM,gBAAgB,CAAC;AACxB,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BAAkB,CAAC;AAC1B,YAAY,EACV,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,EACxB,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACxB,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,wBAAwB,EACxB,4BAA4B,EAC5B,0BAA0B,EAC1B,wBAAwB,EACxB,2BAA2B,EAC3B,6BAA6B,EAC7B,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/realtime/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EACL,uCAAuC,EACvC,6BAA6B,EAC7B,4BAA4B,GAC7B,MAAM,UAAU,CAAC;AAClB,YAAY,EACV,6BAA6B,EAC7B,oCAAoC,EACpC,wCAAwC,GACzC,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,qCAAqC,EACrC,8BAA8B,EAC9B,gCAAgC,EAChC,yBAAyB,EACzB,oCAAoC,GACrC,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,4CAA4C,EAC5C,wBAAwB,EACxB,gCAAgC,GACjC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,yBAAyB,EACzB,0BAA0B,EAC1B,0BAA0B,EAC1B,kBAAkB,EAClB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AACxD,YAAY,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EACL,mCAAmC,EACnC,wBAAwB,EACxB,mCAAmC,EACnC,0BAA0B,GAC3B,MAAM,gBAAgB,CAAC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B,6BAA6B,EAC7B,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,YAAY,CAAC"}
package/realtime/index.js CHANGED
@@ -16,9 +16,11 @@ export { createHonuaServerRealtimeSubscription, decodeHonuaServerRealtimeEvent,
16
16
  export { emptyRealtimeFeatureState, reconcileRealtimeStaleness, reduceRealtimeFeatureState, realtimeFeatureKey, realtimeResumeCheckpoint, realtimeSubscriptionKey, } from "./reducer.js";
17
17
  export { createRealtimeFeatureStore } from "./store.js";
18
18
  export { REALTIME_DURABLE_CHECKPOINT_VERSION, HonuaRealtimeResumeError, createResumableRealtimeSubscription, evaluateRealtimeCheckpoint, } from "./resumable.js";
19
+ export { createIndexedDbCheckpointStorage, createIndexedDbRealtimeCheckpointStore, createMemoryCheckpointStorage, createMemoryRealtimeCheckpointStore, createRealtimeCheckpointStore, DEFAULT_REALTIME_CHECKPOINT_MAX_AGE_MS, DEFAULT_REALTIME_CHECKPOINT_MAX_RECORDS, HONUA_REALTIME_CHECKPOINT_STORE_FORMAT, MAX_REALTIME_CHECKPOINT_MAX_AGE_MS, MAX_REALTIME_CHECKPOINT_RECORDS, realtimeAuthorizationScopeDigest, realtimeCheckpointScopeKey, } from "./checkpoint-store.js";
19
20
  export { assertRealtimePlanIdentity, deriveRealtimeContractAuthority, realtimePlanFingerprint, redactRealtimeCheckpoint, serializeRealtimeCheckpoint, serializeRedactedRealtimeCheckpoint, } from "./contract.js";
20
21
  export { createRealtimeWebSocketTransport } from "./websocket.js";
21
22
  export { createOdataDeltaTransport } from "./odata-delta.js";
22
23
  export { computeReconnectDelayMs, createResumableRealtimeTransport, createResumableServerSentEventsTransport, createResumableWebSocketTransport, } from "./resumable-transport.js";
23
24
  export { filterRealtimeSelection, reconcileRealtimeSelection } from "./exploration.js";
25
+ export { HonuaRealtimeReconciliationError, createRealtimeReconciledCache, createRealtimeReconciler, diffRealtimeFeatureState, realtimeReconciliationVersion, reconcileRealtimeKeyedState, reconcileRealtimeViewport, } from "./reconciliation.js";
24
26
  export { selectRealtimeDetail, selectRealtimeFeatureRecordMap, selectRealtimeFeatureRecords, selectRealtimeFeatureTombstones, selectRealtimeFeatures, } from "./projections.js";
@@ -0,0 +1,245 @@
1
+ /**
2
+ * Renderer-neutral reconciliation of accepted realtime deltas (issue #559).
3
+ *
4
+ * `reducer.ts` already folds `snapshot`/`upsert`/`delete`/`delta` events into
5
+ * one authoritative `RealtimeFeatureState` (`records`/`tombstones`, keyed by
6
+ * {@link realtimeFeatureKey}) — that state is the accepted realtime store this
7
+ * module builds on. This module adds the piece #556/#557 deliberately left
8
+ * open: turning a `(previous, next, trigger)` state transition into an
9
+ * explicit, identity-stable **patch** (create/update/delete) or **rebuild**
10
+ * (replacement snapshot, schema change, or policy-driven queue overflow)
11
+ * decision, plus the derived-state reconciliation that keeps caches,
12
+ * selection, filters, and viewport deterministic across it:
13
+ *
14
+ * - {@link diffRealtimeFeatureState} — pure REQ-001 identity/patch-rebuild
15
+ * classification for one event or explicit reset trigger.
16
+ * - {@link createRealtimeReconciler} — stateful REQ-004 policy: bounds the
17
+ * pending-patch queue and switches `mode` to `"rebuild"` once a single
18
+ * event or the accumulated queue crosses an explicit threshold, so a
19
+ * renderer never has to apply an unbounded patch backlog.
20
+ * - {@link realtimeReconciliationVersion} — the resume-position fields a
21
+ * derived cache should record so it can state exactly which cursor/sequence
22
+ * it reflects (the accepted store in `store.ts`/`reducer.ts` remains the
23
+ * sole authority; nothing here re-derives truth from a cache).
24
+ * - {@link createRealtimeReconciledCache} — a REQ-002 generic, renderer-neutral
25
+ * feature cache driven by reconciliation results; adapt its snapshot into a
26
+ * `Result<T>`-shaped or `HonuaQueryCache`-backed cache as needed.
27
+ * - {@link reconcileRealtimeKeyedState} / {@link reconcileRealtimeViewport} —
28
+ * REQ-003 deterministic preservation of any identity-keyed UI state
29
+ * (selection, an active client-side filter's matched-feature set) and of an
30
+ * opaque viewport value, both with a structured invalidation reason instead
31
+ * of a silent reset.
32
+ *
33
+ * `@honua/sdk-js/map`'s `realtime-reconciliation-adapter.ts` is the only
34
+ * place a `RealtimeReconciliationResult` is projected onto MapLibre
35
+ * (`setFeatureState` for `"patch"`, a caller-supplied rebuild callback for
36
+ * `"rebuild"`) — this module never imports `maplibre-gl` and has no
37
+ * renderer-specific dependency (REQ-005). deck.gl/Cesium adapters and the
38
+ * transport implementations that feed `previous`/`next` state are out of
39
+ * scope for #559.
40
+ *
41
+ * @module
42
+ */
43
+ import type { FeatureId, SourceId } from "../contract/types.js";
44
+ import { type HonuaErrorOptions, HonuaSdkError } from "../core/error-envelope.js";
45
+ import type { RealtimeFeatureEvent, RealtimeFeatureRecord, RealtimeFeatureState, RealtimeFeatureTombstone } from "./types.js";
46
+ /** Error codes raised by the reconciliation core (and, by reuse, its MapLibre adapter). @experimental */
47
+ export type RealtimeReconciliationErrorCode = "disposed" | "invalid-option";
48
+ /** A stable, machine-readable reconciliation failure. @experimental */
49
+ export declare class HonuaRealtimeReconciliationError extends HonuaSdkError {
50
+ readonly code: RealtimeReconciliationErrorCode;
51
+ readonly detail?: Readonly<Record<string, unknown>> | undefined;
52
+ constructor(code: RealtimeReconciliationErrorCode, message: string, detail?: Readonly<Record<string, unknown>> | undefined, options?: HonuaErrorOptions);
53
+ }
54
+ /** Identity-level change classification. @experimental */
55
+ export type RealtimeReconciliationChangeKind = "create" | "update" | "delete";
56
+ /** One identity-stable change, keyed exactly like the accepted store ({@link realtimeFeatureKey}). @experimental */
57
+ export interface RealtimeReconciliationChange<TFeature = unknown> {
58
+ readonly kind: RealtimeReconciliationChangeKind;
59
+ readonly key: string;
60
+ readonly id: FeatureId;
61
+ readonly sourceId?: SourceId;
62
+ /** Present for `"create"`/`"update"`; the accepted store's record (carries `cursor`/`sequence`/`receivedAt`). */
63
+ readonly record?: RealtimeFeatureRecord<TFeature>;
64
+ /** Present for `"delete"`; the accepted store's tombstone, when the reducer still retains it. */
65
+ readonly tombstone?: RealtimeFeatureTombstone;
66
+ }
67
+ /** Why a reconciliation declared a full reset instead of an incremental patch. @experimental */
68
+ export type RealtimeReconciliationResetReasonCode = "replacement-snapshot" | "schema-changed" | "source-changed" | "authorization-scope-changed" | "manual";
69
+ /**
70
+ * What drove one `(previous, next)` transition: an accepted `RealtimeFeatureEvent`
71
+ * (the common case — `snapshot`/`upsert`/`delete`/`delta`/`heartbeat`/`status`/`error`),
72
+ * or an explicit reset the caller derived from outside the event stream (a
73
+ * `schema-version-changed` / `source-version-changed` / `authorization-scope-changed`
74
+ * checkpoint incompatibility from `resumable.ts`'s `evaluateRealtimeCheckpoint`, or a
75
+ * caller-initiated manual reset). @experimental
76
+ */
77
+ export type RealtimeReconciliationTrigger<TFeature = unknown> = {
78
+ readonly kind: "event";
79
+ readonly event: RealtimeFeatureEvent<TFeature>;
80
+ } | {
81
+ readonly kind: "reset";
82
+ readonly reason: RealtimeReconciliationResetReasonCode;
83
+ readonly detail?: string;
84
+ };
85
+ /** Pure REQ-001 output: the identity changes for one transition, and whether it was a reset. @experimental */
86
+ export interface RealtimeReconciliationDiff<TFeature = unknown> {
87
+ readonly changes: readonly RealtimeReconciliationChange<TFeature>[];
88
+ readonly reset: boolean;
89
+ readonly resetReason?: RealtimeReconciliationResetReasonCode;
90
+ readonly resetDetail?: string;
91
+ }
92
+ /**
93
+ * Classify one `(previous, next)` accepted-store transition into identity-stable
94
+ * create/update/delete changes, or an explicit reset (replacement snapshot,
95
+ * schema change, source-version change, authorization-scope change, or a
96
+ * caller-initiated manual reset). Pure and side-effect free — `next` must
97
+ * already be the reducer's output for `trigger` (`reduceRealtimeFeatureState`
98
+ * when `trigger.kind === "event"`); this function never re-derives store state.
99
+ *
100
+ * @experimental
101
+ */
102
+ export declare function diffRealtimeFeatureState<TFeature>(previous: RealtimeFeatureState<TFeature>, next: RealtimeFeatureState<TFeature>, trigger: RealtimeReconciliationTrigger<TFeature>): RealtimeReconciliationDiff<TFeature>;
103
+ /** The resume-position fields a derived cache should record alongside its data. @experimental */
104
+ export interface RealtimeReconciliationVersion {
105
+ readonly cursor?: string;
106
+ readonly watermark?: string;
107
+ readonly timestamp?: string;
108
+ readonly sequence?: number;
109
+ readonly deltaToken?: string;
110
+ }
111
+ /** Project the accepted store's current resume position — what a derived cache built from `state` reflects. @experimental */
112
+ export declare function realtimeReconciliationVersion<TFeature>(state: RealtimeFeatureState<TFeature>): RealtimeReconciliationVersion;
113
+ /** `"patch"` applies `changes` incrementally; `"rebuild"` requires a full re-materialization. @experimental */
114
+ export type RealtimeReconciliationMode = "patch" | "rebuild";
115
+ /** Why {@link RealtimeReconciliationResult.mode} is `"rebuild"` even when `reset` is `false`. @experimental */
116
+ export type RealtimeReconciliationRebuildReason = "reset" | "event-exceeds-patch-bound" | "queue-threshold-exceeded";
117
+ /** Result of one {@link RealtimeReconciler.reconcile} call. @experimental */
118
+ export interface RealtimeReconciliationResult<TFeature = unknown> {
119
+ readonly mode: RealtimeReconciliationMode;
120
+ readonly rebuildReason?: RealtimeReconciliationRebuildReason;
121
+ /**
122
+ * For `"patch"`, the transition's incremental changes. For `"rebuild"`,
123
+ * always the full accepted store as `"create"` changes (plus the triggering
124
+ * event's `"delete"` changes on a non-reset rebuild), so a derived cache can
125
+ * re-materialize wholesale from the result alone without dropping live
126
+ * features that were not part of the triggering event.
127
+ */
128
+ readonly changes: readonly RealtimeReconciliationChange<TFeature>[];
129
+ readonly version: RealtimeReconciliationVersion;
130
+ readonly reset: boolean;
131
+ readonly resetReason?: RealtimeReconciliationResetReasonCode;
132
+ /** Patches accumulated since the last rebuild, including this result. Always `0` immediately after a rebuild. @experimental */
133
+ readonly pendingPatchCount: number;
134
+ }
135
+ /** Options for {@link createRealtimeReconciler}. @experimental */
136
+ export interface RealtimeReconcilerOptions {
137
+ /** A single event/trigger producing more identity changes than this forces an immediate rebuild. @default 500 */
138
+ readonly maxChangesPerEvent?: number;
139
+ /** Cumulative pending patches (since the last rebuild) that force the next reconciliation to rebuild. @default 2000 */
140
+ readonly rebuildThreshold?: number;
141
+ }
142
+ /** Stateful REQ-004 policy wrapper around {@link diffRealtimeFeatureState}. @experimental */
143
+ export interface RealtimeReconciler<TFeature = unknown> {
144
+ readonly disposed: boolean;
145
+ /** Patches accumulated since the last rebuild. */
146
+ readonly pendingPatchCount: number;
147
+ /**
148
+ * Reconcile one accepted transition. Throws {@link HonuaRealtimeReconciliationError}
149
+ * (`"disposed"`) once {@link RealtimeReconciler.dispose} has been called —
150
+ * a disposed reconciler must never hand a caller another patch.
151
+ */
152
+ reconcile(previous: RealtimeFeatureState<TFeature>, next: RealtimeFeatureState<TFeature>, trigger: RealtimeReconciliationTrigger<TFeature>): RealtimeReconciliationResult<TFeature>;
153
+ /** Stop accepting reconciliations. Idempotent. */
154
+ dispose(): void;
155
+ }
156
+ /**
157
+ * Create a bounded, renderer-neutral reconciliation policy: identity changes
158
+ * classify through {@link diffRealtimeFeatureState}; a single oversized event,
159
+ * or an accumulated pending-patch count over `rebuildThreshold`, switches
160
+ * `mode` to `"rebuild"` by explicit policy rather than growing an unbounded
161
+ * patch queue.
162
+ *
163
+ * @experimental
164
+ */
165
+ export declare function createRealtimeReconciler<TFeature = unknown>(options?: RealtimeReconcilerOptions): RealtimeReconciler<TFeature>;
166
+ /** Snapshot returned by {@link RealtimeReconciledCache.snapshot} / `.apply`. @experimental */
167
+ export interface RealtimeReconciledCacheSnapshot<TFeature = unknown> {
168
+ /** Insertion-ordered (creation order; unaffected by updates) live features. */
169
+ readonly features: readonly TFeature[];
170
+ /** The cursor/sequence this snapshot reflects — see {@link realtimeReconciliationVersion}. */
171
+ readonly version: RealtimeReconciliationVersion;
172
+ }
173
+ /** A renderer-neutral, identity-keyed feature cache kept in sync by reconciliation results. @experimental */
174
+ export interface RealtimeReconciledCache<TFeature = unknown> {
175
+ readonly disposed: boolean;
176
+ snapshot(): RealtimeReconciledCacheSnapshot<TFeature>;
177
+ /**
178
+ * Apply one {@link RealtimeReconciliationResult}: `"rebuild"` replaces the
179
+ * cache wholesale (creates only — the caller's rebuild path already
180
+ * re-materializes from the authoritative store); `"patch"` applies each
181
+ * change in place. Throws {@link HonuaRealtimeReconciliationError}
182
+ * (`"disposed"`) once disposed.
183
+ */
184
+ apply(result: RealtimeReconciliationResult<TFeature>): RealtimeReconciledCacheSnapshot<TFeature>;
185
+ /** Discard cached data. Idempotent. */
186
+ dispose(): void;
187
+ }
188
+ /**
189
+ * Create a generic, renderer-neutral cache of live features keyed exactly
190
+ * like the accepted realtime store. Adapt {@link RealtimeReconciledCache.snapshot}
191
+ * into a `Result<T>`-shaped or `HonuaQueryCache`-backed cache entry as needed —
192
+ * this module intentionally does not import either.
193
+ *
194
+ * @experimental
195
+ */
196
+ export declare function createRealtimeReconciledCache<TFeature = unknown>(): RealtimeReconciledCache<TFeature>;
197
+ /** Why an identity-keyed entry (selection, active filter membership) was invalidated instead of preserved. @experimental */
198
+ export type RealtimeReconciliationInvalidationReason = "feature-deleted" | "reset" | "schema-changed";
199
+ /** One structured invalidation of a previously identity-keyed entry. @experimental */
200
+ export interface RealtimeReconciliationInvalidation {
201
+ readonly key: string;
202
+ readonly reason: RealtimeReconciliationInvalidationReason;
203
+ }
204
+ /** Result of {@link reconcileRealtimeKeyedState}. @experimental */
205
+ export interface RealtimeKeyedStateReconciliation {
206
+ readonly next: ReadonlySet<string>;
207
+ readonly invalidations: readonly RealtimeReconciliationInvalidation[];
208
+ }
209
+ /**
210
+ * Deterministically preserve or invalidate an identity-keyed set of feature
211
+ * keys (a selection, or the matched-key set of an active client-side filter)
212
+ * across one reconciliation result:
213
+ *
214
+ * - `result.reset` (replacement snapshot, schema/source/scope change, or
215
+ * manual reset): every key is invalidated with reason `"reset"` (or
216
+ * `"schema-changed"` when that was the reset reason) and `next` is empty —
217
+ * a rebuild replaces identity wholesale, so no prior key is safe to assume
218
+ * still exists.
219
+ * - Otherwise: a key backed by a feature the delta deleted is invalidated
220
+ * with reason `"feature-deleted"`; every other key is preserved unchanged.
221
+ *
222
+ * Reused for both selection and filter membership — both are "a set of
223
+ * feature keys that must stay valid or be explicitly dropped."
224
+ *
225
+ * @experimental
226
+ */
227
+ export declare function reconcileRealtimeKeyedState(keys: ReadonlySet<string>, result: Pick<RealtimeReconciliationResult<unknown>, "changes" | "reset" | "resetReason">): RealtimeKeyedStateReconciliation;
228
+ /** Result of {@link reconcileRealtimeViewport}. @experimental */
229
+ export interface RealtimeViewportReconciliation<TViewport> {
230
+ /** Always the input `viewport`; this module never mutates or resets camera state itself. */
231
+ readonly viewport: TViewport;
232
+ readonly invalidated: boolean;
233
+ readonly reason?: RealtimeReconciliationInvalidationReason;
234
+ }
235
+ /**
236
+ * Preserve an opaque viewport value across a reconciliation result. The
237
+ * viewport itself is always passed through unchanged (this module never
238
+ * moves a camera); `invalidated` is `true` only on `result.reset`, so a
239
+ * caller can decide whether to refit bounds — deterministic, and never a
240
+ * silent no-op on a schema/replacement-snapshot reset.
241
+ *
242
+ * @experimental
243
+ */
244
+ export declare function reconcileRealtimeViewport<TViewport>(viewport: TViewport, result: Pick<RealtimeReconciliationResult<unknown>, "reset" | "resetReason">): RealtimeViewportReconciliation<TViewport>;
245
+ //# sourceMappingURL=reconciliation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reconciliation.d.ts","sourceRoot":"","sources":["../../../src/realtime/reconciliation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,KAAK,iBAAiB,EAAE,aAAa,EAA0B,MAAM,2BAA2B,CAAC;AAE1G,OAAO,KAAK,EAEV,oBAAoB,EAEpB,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,EACzB,MAAM,YAAY,CAAC;AAIpB,yGAAyG;AACzG,MAAM,MAAM,+BAA+B,GAAG,UAAU,GAAG,gBAAgB,CAAC;AAE5E,uEAAuE;AACvE,qBAAa,gCAAiC,SAAQ,aAAa;aAE/C,IAAI,EAAE,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