@despia-native/kernel 0.0.0-coming-soon.0 → 0.3.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 (661) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +1414 -0
  3. package/README.md +16 -1
  4. package/dist/.dsx-build-stamp.json +7 -0
  5. package/dist/api-cohort.d.ts +27 -0
  6. package/dist/api-cohort.d.ts.map +1 -0
  7. package/dist/api-cohort.js +94 -0
  8. package/dist/api-cohort.js.map +1 -0
  9. package/dist/api.d.ts +454 -0
  10. package/dist/api.d.ts.map +1 -0
  11. package/dist/api.js +2442 -0
  12. package/dist/api.js.map +1 -0
  13. package/dist/app-consts.d.ts +10 -0
  14. package/dist/app-consts.d.ts.map +1 -0
  15. package/dist/app-consts.js +39 -0
  16. package/dist/app-consts.js.map +1 -0
  17. package/dist/app-update.d.ts +12 -0
  18. package/dist/app-update.d.ts.map +1 -0
  19. package/dist/app-update.js +32 -0
  20. package/dist/app-update.js.map +1 -0
  21. package/dist/aria.d.ts +152 -0
  22. package/dist/aria.d.ts.map +1 -0
  23. package/dist/aria.js +524 -0
  24. package/dist/aria.js.map +1 -0
  25. package/dist/audio-core.d.ts +260 -0
  26. package/dist/audio-core.d.ts.map +1 -0
  27. package/dist/audio-core.js +1440 -0
  28. package/dist/audio-core.js.map +1 -0
  29. package/dist/audio-edit.d.ts +100 -0
  30. package/dist/audio-edit.d.ts.map +1 -0
  31. package/dist/audio-edit.js +489 -0
  32. package/dist/audio-edit.js.map +1 -0
  33. package/dist/audio-mix.d.ts +84 -0
  34. package/dist/audio-mix.d.ts.map +1 -0
  35. package/dist/audio-mix.js +393 -0
  36. package/dist/audio-mix.js.map +1 -0
  37. package/dist/auth-proof.d.ts +145 -0
  38. package/dist/auth-proof.d.ts.map +1 -0
  39. package/dist/auth-proof.js +644 -0
  40. package/dist/auth-proof.js.map +1 -0
  41. package/dist/availability-explain.d.ts +3 -0
  42. package/dist/availability-explain.d.ts.map +1 -0
  43. package/dist/availability-explain.js +322 -0
  44. package/dist/availability-explain.js.map +1 -0
  45. package/dist/availability.d.ts +246 -0
  46. package/dist/availability.d.ts.map +1 -0
  47. package/dist/availability.js +615 -0
  48. package/dist/availability.js.map +1 -0
  49. package/dist/background.d.ts +116 -0
  50. package/dist/background.d.ts.map +1 -0
  51. package/dist/background.js +235 -0
  52. package/dist/background.js.map +1 -0
  53. package/dist/boot-tables-flag.d.ts +2 -0
  54. package/dist/boot-tables-flag.d.ts.map +1 -0
  55. package/dist/boot-tables-flag.js +16 -0
  56. package/dist/boot-tables-flag.js.map +1 -0
  57. package/dist/boot-tables.d.ts +40 -0
  58. package/dist/boot-tables.d.ts.map +1 -0
  59. package/dist/boot-tables.js +102 -0
  60. package/dist/boot-tables.js.map +1 -0
  61. package/dist/border-edges.d.ts +5 -0
  62. package/dist/border-edges.d.ts.map +1 -0
  63. package/dist/border-edges.js +47 -0
  64. package/dist/border-edges.js.map +1 -0
  65. package/dist/bus.d.ts +1203 -0
  66. package/dist/bus.d.ts.map +1 -0
  67. package/dist/bus.js +2647 -0
  68. package/dist/bus.js.map +1 -0
  69. package/dist/calendar-core.d.ts +143 -0
  70. package/dist/calendar-core.d.ts.map +1 -0
  71. package/dist/calendar-core.js +372 -0
  72. package/dist/calendar-core.js.map +1 -0
  73. package/dist/call-value.d.ts +16 -0
  74. package/dist/call-value.d.ts.map +1 -0
  75. package/dist/call-value.js +54 -0
  76. package/dist/call-value.js.map +1 -0
  77. package/dist/camera-core.d.ts +222 -0
  78. package/dist/camera-core.d.ts.map +1 -0
  79. package/dist/camera-core.js +980 -0
  80. package/dist/camera-core.js.map +1 -0
  81. package/dist/canvas-core.d.ts +404 -0
  82. package/dist/canvas-core.d.ts.map +1 -0
  83. package/dist/canvas-core.js +2186 -0
  84. package/dist/canvas-core.js.map +1 -0
  85. package/dist/capture-core.d.ts +74 -0
  86. package/dist/capture-core.d.ts.map +1 -0
  87. package/dist/capture-core.js +158 -0
  88. package/dist/capture-core.js.map +1 -0
  89. package/dist/compile/codegen.d.ts +146 -0
  90. package/dist/compile/codegen.d.ts.map +1 -0
  91. package/dist/compile/codegen.js +1949 -0
  92. package/dist/compile/codegen.js.map +1 -0
  93. package/dist/compile/jstier.d.ts +44 -0
  94. package/dist/compile/jstier.d.ts.map +1 -0
  95. package/dist/compile/jstier.js +181 -0
  96. package/dist/compile/jstier.js.map +1 -0
  97. package/dist/compile/tier-door.d.ts +41 -0
  98. package/dist/compile/tier-door.d.ts.map +1 -0
  99. package/dist/compile/tier-door.js +167 -0
  100. package/dist/compile/tier-door.js.map +1 -0
  101. package/dist/compile/tier-realm.d.ts +49 -0
  102. package/dist/compile/tier-realm.d.ts.map +1 -0
  103. package/dist/compile/tier-realm.js +368 -0
  104. package/dist/compile/tier-realm.js.map +1 -0
  105. package/dist/compile/tier.d.ts +23 -0
  106. package/dist/compile/tier.d.ts.map +1 -0
  107. package/dist/compile/tier.js +157 -0
  108. package/dist/compile/tier.js.map +1 -0
  109. package/dist/compose-core.d.ts +86 -0
  110. package/dist/compose-core.d.ts.map +1 -0
  111. package/dist/compose-core.js +112 -0
  112. package/dist/compose-core.js.map +1 -0
  113. package/dist/config-validate.d.ts +31 -0
  114. package/dist/config-validate.d.ts.map +1 -0
  115. package/dist/config-validate.js +147 -0
  116. package/dist/config-validate.js.map +1 -0
  117. package/dist/config-values.d.ts +106 -0
  118. package/dist/config-values.d.ts.map +1 -0
  119. package/dist/config-values.js +340 -0
  120. package/dist/config-values.js.map +1 -0
  121. package/dist/contacts-core.d.ts +127 -0
  122. package/dist/contacts-core.d.ts.map +1 -0
  123. package/dist/contacts-core.js +211 -0
  124. package/dist/contacts-core.js.map +1 -0
  125. package/dist/content-transition.d.ts +58 -0
  126. package/dist/content-transition.d.ts.map +1 -0
  127. package/dist/content-transition.js +94 -0
  128. package/dist/content-transition.js.map +1 -0
  129. package/dist/controls-core.d.ts +227 -0
  130. package/dist/controls-core.d.ts.map +1 -0
  131. package/dist/controls-core.js +652 -0
  132. package/dist/controls-core.js.map +1 -0
  133. package/dist/cookies.d.ts +78 -0
  134. package/dist/cookies.d.ts.map +1 -0
  135. package/dist/cookies.js +265 -0
  136. package/dist/cookies.js.map +1 -0
  137. package/dist/corner-shape-core.d.ts +69 -0
  138. package/dist/corner-shape-core.d.ts.map +1 -0
  139. package/dist/corner-shape-core.js +261 -0
  140. package/dist/corner-shape-core.js.map +1 -0
  141. package/dist/crypto-core.d.ts +57 -0
  142. package/dist/crypto-core.d.ts.map +1 -0
  143. package/dist/crypto-core.js +128 -0
  144. package/dist/crypto-core.js.map +1 -0
  145. package/dist/dataviz.d.ts +436 -0
  146. package/dist/dataviz.d.ts.map +1 -0
  147. package/dist/dataviz.js +956 -0
  148. package/dist/dataviz.js.map +1 -0
  149. package/dist/debug.d.ts +293 -0
  150. package/dist/debug.d.ts.map +1 -0
  151. package/dist/debug.js +767 -0
  152. package/dist/debug.js.map +1 -0
  153. package/dist/device-ownership.d.ts +50 -0
  154. package/dist/device-ownership.d.ts.map +1 -0
  155. package/dist/device-ownership.js +105 -0
  156. package/dist/device-ownership.js.map +1 -0
  157. package/dist/effects.d.ts +86 -0
  158. package/dist/effects.d.ts.map +1 -0
  159. package/dist/effects.js +98 -0
  160. package/dist/effects.js.map +1 -0
  161. package/dist/element.d.ts +108 -0
  162. package/dist/element.d.ts.map +1 -0
  163. package/dist/element.js +63 -0
  164. package/dist/element.js.map +1 -0
  165. package/dist/file-watch.d.ts +16 -0
  166. package/dist/file-watch.d.ts.map +1 -0
  167. package/dist/file-watch.js +49 -0
  168. package/dist/file-watch.js.map +1 -0
  169. package/dist/filepaths.d.ts +72 -0
  170. package/dist/filepaths.d.ts.map +1 -0
  171. package/dist/filepaths.js +271 -0
  172. package/dist/filepaths.js.map +1 -0
  173. package/dist/film.d.ts +264 -0
  174. package/dist/film.d.ts.map +1 -0
  175. package/dist/film.js +313 -0
  176. package/dist/film.js.map +1 -0
  177. package/dist/fonts.d.ts +66 -0
  178. package/dist/fonts.d.ts.map +1 -0
  179. package/dist/fonts.js +135 -0
  180. package/dist/fonts.js.map +1 -0
  181. package/dist/forms.d.ts +191 -0
  182. package/dist/forms.d.ts.map +1 -0
  183. package/dist/forms.js +663 -0
  184. package/dist/forms.js.map +1 -0
  185. package/dist/geo.d.ts +289 -0
  186. package/dist/geo.d.ts.map +1 -0
  187. package/dist/geo.js +460 -0
  188. package/dist/geo.js.map +1 -0
  189. package/dist/handler-announce.d.ts +46 -0
  190. package/dist/handler-announce.d.ts.map +1 -0
  191. package/dist/handler-announce.js +96 -0
  192. package/dist/handler-announce.js.map +1 -0
  193. package/dist/handoff.d.ts +71 -0
  194. package/dist/handoff.d.ts.map +1 -0
  195. package/dist/handoff.js +250 -0
  196. package/dist/handoff.js.map +1 -0
  197. package/dist/identity-durability.d.ts +76 -0
  198. package/dist/identity-durability.d.ts.map +1 -0
  199. package/dist/identity-durability.js +150 -0
  200. package/dist/identity-durability.js.map +1 -0
  201. package/dist/image-core.d.ts +240 -0
  202. package/dist/image-core.d.ts.map +1 -0
  203. package/dist/image-core.js +618 -0
  204. package/dist/image-core.js.map +1 -0
  205. package/dist/image-schemes.d.ts +10 -0
  206. package/dist/image-schemes.d.ts.map +1 -0
  207. package/dist/image-schemes.js +28 -0
  208. package/dist/image-schemes.js.map +1 -0
  209. package/dist/index.d.ts +143 -0
  210. package/dist/index.d.ts.map +1 -0
  211. package/dist/index.js +299 -0
  212. package/dist/index.js.map +1 -0
  213. package/dist/ink-core.d.ts +53 -0
  214. package/dist/ink-core.d.ts.map +1 -0
  215. package/dist/ink-core.js +119 -0
  216. package/dist/ink-core.js.map +1 -0
  217. package/dist/input.d.ts +148 -0
  218. package/dist/input.d.ts.map +1 -0
  219. package/dist/input.js +358 -0
  220. package/dist/input.js.map +1 -0
  221. package/dist/integrity.d.ts +63 -0
  222. package/dist/integrity.d.ts.map +1 -0
  223. package/dist/integrity.js +150 -0
  224. package/dist/integrity.js.map +1 -0
  225. package/dist/intents.d.ts +95 -0
  226. package/dist/intents.d.ts.map +1 -0
  227. package/dist/intents.js +282 -0
  228. package/dist/intents.js.map +1 -0
  229. package/dist/interpolate-core.d.ts +37 -0
  230. package/dist/interpolate-core.d.ts.map +1 -0
  231. package/dist/interpolate-core.js +443 -0
  232. package/dist/interpolate-core.js.map +1 -0
  233. package/dist/jse/color.d.ts +12 -0
  234. package/dist/jse/color.d.ts.map +1 -0
  235. package/dist/jse/color.js +196 -0
  236. package/dist/jse/color.js.map +1 -0
  237. package/dist/jse/core.d.ts +54 -0
  238. package/dist/jse/core.d.ts.map +1 -0
  239. package/dist/jse/core.js +1519 -0
  240. package/dist/jse/core.js.map +1 -0
  241. package/dist/jse/dispatch.d.ts +28 -0
  242. package/dist/jse/dispatch.d.ts.map +1 -0
  243. package/dist/jse/dispatch.js +116 -0
  244. package/dist/jse/dispatch.js.map +1 -0
  245. package/dist/jse/highlight-grammar.d.ts +15 -0
  246. package/dist/jse/highlight-grammar.d.ts.map +1 -0
  247. package/dist/jse/highlight-grammar.js +161 -0
  248. package/dist/jse/highlight-grammar.js.map +1 -0
  249. package/dist/jse/highlight-grammars.generated.d.ts +2 -0
  250. package/dist/jse/highlight-grammars.generated.d.ts.map +1 -0
  251. package/dist/jse/highlight-grammars.generated.js +4 -0
  252. package/dist/jse/highlight-grammars.generated.js.map +1 -0
  253. package/dist/jse/highlight.d.ts +37 -0
  254. package/dist/jse/highlight.d.ts.map +1 -0
  255. package/dist/jse/highlight.js +323 -0
  256. package/dist/jse/highlight.js.map +1 -0
  257. package/dist/jse/jse.d.ts +674 -0
  258. package/dist/jse/jse.d.ts.map +1 -0
  259. package/dist/jse/jse.js +5841 -0
  260. package/dist/jse/jse.js.map +1 -0
  261. package/dist/jse/pathmatch.d.ts +10 -0
  262. package/dist/jse/pathmatch.d.ts.map +1 -0
  263. package/dist/jse/pathmatch.js +73 -0
  264. package/dist/jse/pathmatch.js.map +1 -0
  265. package/dist/jse/regex.d.ts +33 -0
  266. package/dist/jse/regex.d.ts.map +1 -0
  267. package/dist/jse/regex.js +375 -0
  268. package/dist/jse/regex.js.map +1 -0
  269. package/dist/jse/stdlib.d.ts +8 -0
  270. package/dist/jse/stdlib.d.ts.map +1 -0
  271. package/dist/jse/stdlib.js +765 -0
  272. package/dist/jse/stdlib.js.map +1 -0
  273. package/dist/jse/tokens.d.ts +102 -0
  274. package/dist/jse/tokens.d.ts.map +1 -0
  275. package/dist/jse/tokens.js +982 -0
  276. package/dist/jse/tokens.js.map +1 -0
  277. package/dist/jse/values.d.ts +206 -0
  278. package/dist/jse/values.d.ts.map +1 -0
  279. package/dist/jse/values.js +846 -0
  280. package/dist/jse/values.js.map +1 -0
  281. package/dist/keyboard.d.ts +196 -0
  282. package/dist/keyboard.d.ts.map +1 -0
  283. package/dist/keyboard.js +186 -0
  284. package/dist/keyboard.js.map +1 -0
  285. package/dist/label-choices.d.ts +3 -0
  286. package/dist/label-choices.d.ts.map +1 -0
  287. package/dist/label-choices.js +168 -0
  288. package/dist/label-choices.js.map +1 -0
  289. package/dist/language.d.ts +33 -0
  290. package/dist/language.d.ts.map +1 -0
  291. package/dist/language.js +50 -0
  292. package/dist/language.js.map +1 -0
  293. package/dist/length-units.d.ts +30 -0
  294. package/dist/length-units.d.ts.map +1 -0
  295. package/dist/length-units.js +83 -0
  296. package/dist/length-units.js.map +1 -0
  297. package/dist/lightsensor.d.ts +48 -0
  298. package/dist/lightsensor.d.ts.map +1 -0
  299. package/dist/lightsensor.js +97 -0
  300. package/dist/lightsensor.js.map +1 -0
  301. package/dist/link-refresh.d.ts +27 -0
  302. package/dist/link-refresh.d.ts.map +1 -0
  303. package/dist/link-refresh.js +166 -0
  304. package/dist/link-refresh.js.map +1 -0
  305. package/dist/link.d.ts +57 -0
  306. package/dist/link.d.ts.map +1 -0
  307. package/dist/link.js +333 -0
  308. package/dist/link.js.map +1 -0
  309. package/dist/linkpreview.d.ts +114 -0
  310. package/dist/linkpreview.d.ts.map +1 -0
  311. package/dist/linkpreview.js +439 -0
  312. package/dist/linkpreview.js.map +1 -0
  313. package/dist/list-presence.d.ts +32 -0
  314. package/dist/list-presence.d.ts.map +1 -0
  315. package/dist/list-presence.js +48 -0
  316. package/dist/list-presence.js.map +1 -0
  317. package/dist/live-stream.d.ts +27 -0
  318. package/dist/live-stream.d.ts.map +1 -0
  319. package/dist/live-stream.js +274 -0
  320. package/dist/live-stream.js.map +1 -0
  321. package/dist/livelogs.d.ts +134 -0
  322. package/dist/livelogs.d.ts.map +1 -0
  323. package/dist/livelogs.js +409 -0
  324. package/dist/livelogs.js.map +1 -0
  325. package/dist/logs.d.ts +80 -0
  326. package/dist/logs.d.ts.map +1 -0
  327. package/dist/logs.js +206 -0
  328. package/dist/logs.js.map +1 -0
  329. package/dist/mcp/apps.d.ts +82 -0
  330. package/dist/mcp/apps.d.ts.map +1 -0
  331. package/dist/mcp/apps.js +219 -0
  332. package/dist/mcp/apps.js.map +1 -0
  333. package/dist/mcp/entities.d.ts +25 -0
  334. package/dist/mcp/entities.d.ts.map +1 -0
  335. package/dist/mcp/entities.js +71 -0
  336. package/dist/mcp/entities.js.map +1 -0
  337. package/dist/mcp/result.d.ts +73 -0
  338. package/dist/mcp/result.d.ts.map +1 -0
  339. package/dist/mcp/result.js +119 -0
  340. package/dist/mcp/result.js.map +1 -0
  341. package/dist/mcp/webmcp.d.ts +162 -0
  342. package/dist/mcp/webmcp.d.ts.map +1 -0
  343. package/dist/mcp/webmcp.js +214 -0
  344. package/dist/mcp/webmcp.js.map +1 -0
  345. package/dist/mcp.d.ts +5 -0
  346. package/dist/mcp.d.ts.map +1 -0
  347. package/dist/mcp.js +14 -0
  348. package/dist/mcp.js.map +1 -0
  349. package/dist/media-core.d.ts +191 -0
  350. package/dist/media-core.d.ts.map +1 -0
  351. package/dist/media-core.js +446 -0
  352. package/dist/media-core.js.map +1 -0
  353. package/dist/media-timeline-core.d.ts +94 -0
  354. package/dist/media-timeline-core.d.ts.map +1 -0
  355. package/dist/media-timeline-core.js +620 -0
  356. package/dist/media-timeline-core.js.map +1 -0
  357. package/dist/message.d.ts +42 -0
  358. package/dist/message.d.ts.map +1 -0
  359. package/dist/message.js +582 -0
  360. package/dist/message.js.map +1 -0
  361. package/dist/missing-element.d.ts +29 -0
  362. package/dist/missing-element.d.ts.map +1 -0
  363. package/dist/missing-element.js +76 -0
  364. package/dist/missing-element.js.map +1 -0
  365. package/dist/motion-core.d.ts +160 -0
  366. package/dist/motion-core.d.ts.map +1 -0
  367. package/dist/motion-core.js +752 -0
  368. package/dist/motion-core.js.map +1 -0
  369. package/dist/motion-pose.d.ts +65 -0
  370. package/dist/motion-pose.d.ts.map +1 -0
  371. package/dist/motion-pose.js +143 -0
  372. package/dist/motion-pose.js.map +1 -0
  373. package/dist/motion.d.ts +132 -0
  374. package/dist/motion.d.ts.map +1 -0
  375. package/dist/motion.js +260 -0
  376. package/dist/motion.js.map +1 -0
  377. package/dist/mount-core.d.ts +203 -0
  378. package/dist/mount-core.d.ts.map +1 -0
  379. package/dist/mount-core.js +437 -0
  380. package/dist/mount-core.js.map +1 -0
  381. package/dist/net-core.d.ts +110 -0
  382. package/dist/net-core.d.ts.map +1 -0
  383. package/dist/net-core.js +225 -0
  384. package/dist/net-core.js.map +1 -0
  385. package/dist/notify.d.ts +399 -0
  386. package/dist/notify.d.ts.map +1 -0
  387. package/dist/notify.js +964 -0
  388. package/dist/notify.js.map +1 -0
  389. package/dist/orientation-binding.d.ts +39 -0
  390. package/dist/orientation-binding.d.ts.map +1 -0
  391. package/dist/orientation-binding.js +64 -0
  392. package/dist/orientation-binding.js.map +1 -0
  393. package/dist/orientation.d.ts +55 -0
  394. package/dist/orientation.d.ts.map +1 -0
  395. package/dist/orientation.js +89 -0
  396. package/dist/orientation.js.map +1 -0
  397. package/dist/ota.d.ts +52 -0
  398. package/dist/ota.d.ts.map +1 -0
  399. package/dist/ota.js +122 -0
  400. package/dist/ota.js.map +1 -0
  401. package/dist/passkeys.d.ts +91 -0
  402. package/dist/passkeys.d.ts.map +1 -0
  403. package/dist/passkeys.js +307 -0
  404. package/dist/passkeys.js.map +1 -0
  405. package/dist/payment.d.ts +85 -0
  406. package/dist/payment.d.ts.map +1 -0
  407. package/dist/payment.js +270 -0
  408. package/dist/payment.js.map +1 -0
  409. package/dist/pending-presenter.d.ts +31 -0
  410. package/dist/pending-presenter.d.ts.map +1 -0
  411. package/dist/pending-presenter.js +119 -0
  412. package/dist/pending-presenter.js.map +1 -0
  413. package/dist/permission-core.d.ts +59 -0
  414. package/dist/permission-core.d.ts.map +1 -0
  415. package/dist/permission-core.js +102 -0
  416. package/dist/permission-core.js.map +1 -0
  417. package/dist/persist.d.ts +169 -0
  418. package/dist/persist.d.ts.map +1 -0
  419. package/dist/persist.js +361 -0
  420. package/dist/persist.js.map +1 -0
  421. package/dist/phase-plan.d.ts +114 -0
  422. package/dist/phase-plan.d.ts.map +1 -0
  423. package/dist/phase-plan.js +837 -0
  424. package/dist/phase-plan.js.map +1 -0
  425. package/dist/playback-core.d.ts +64 -0
  426. package/dist/playback-core.d.ts.map +1 -0
  427. package/dist/playback-core.js +176 -0
  428. package/dist/playback-core.js.map +1 -0
  429. package/dist/player-sources.d.ts +12 -0
  430. package/dist/player-sources.d.ts.map +1 -0
  431. package/dist/player-sources.js +44 -0
  432. package/dist/player-sources.js.map +1 -0
  433. package/dist/proxy-denylist.d.ts +11 -0
  434. package/dist/proxy-denylist.d.ts.map +1 -0
  435. package/dist/proxy-denylist.js +44 -0
  436. package/dist/proxy-denylist.js.map +1 -0
  437. package/dist/public-config.d.ts +20 -0
  438. package/dist/public-config.d.ts.map +1 -0
  439. package/dist/public-config.js +109 -0
  440. package/dist/public-config.js.map +1 -0
  441. package/dist/qoe-core.d.ts +72 -0
  442. package/dist/qoe-core.d.ts.map +1 -0
  443. package/dist/qoe-core.js +113 -0
  444. package/dist/qoe-core.js.map +1 -0
  445. package/dist/reactive-request.d.ts +80 -0
  446. package/dist/reactive-request.d.ts.map +1 -0
  447. package/dist/reactive-request.js +192 -0
  448. package/dist/reactive-request.js.map +1 -0
  449. package/dist/read-cache.d.ts +129 -0
  450. package/dist/read-cache.d.ts.map +1 -0
  451. package/dist/read-cache.js +566 -0
  452. package/dist/read-cache.js.map +1 -0
  453. package/dist/recorder-core.d.ts +57 -0
  454. package/dist/recorder-core.d.ts.map +1 -0
  455. package/dist/recorder-core.js +136 -0
  456. package/dist/recorder-core.js.map +1 -0
  457. package/dist/ref.d.ts +41 -0
  458. package/dist/ref.d.ts.map +1 -0
  459. package/dist/ref.js +98 -0
  460. package/dist/ref.js.map +1 -0
  461. package/dist/refusal.d.ts +82 -0
  462. package/dist/refusal.d.ts.map +1 -0
  463. package/dist/refusal.js +218 -0
  464. package/dist/refusal.js.map +1 -0
  465. package/dist/region-insets.d.ts +61 -0
  466. package/dist/region-insets.d.ts.map +1 -0
  467. package/dist/region-insets.js +67 -0
  468. package/dist/region-insets.js.map +1 -0
  469. package/dist/rive-core.d.ts +323 -0
  470. package/dist/rive-core.d.ts.map +1 -0
  471. package/dist/rive-core.js +677 -0
  472. package/dist/rive-core.js.map +1 -0
  473. package/dist/runner.d.ts +595 -0
  474. package/dist/runner.d.ts.map +1 -0
  475. package/dist/runner.js +4094 -0
  476. package/dist/runner.js.map +1 -0
  477. package/dist/scene/a11y.d.ts +11 -0
  478. package/dist/scene/a11y.d.ts.map +1 -0
  479. package/dist/scene/a11y.js +67 -0
  480. package/dist/scene/a11y.js.map +1 -0
  481. package/dist/scene/anim.d.ts +149 -0
  482. package/dist/scene/anim.d.ts.map +1 -0
  483. package/dist/scene/anim.js +396 -0
  484. package/dist/scene/anim.js.map +1 -0
  485. package/dist/scene/bind.d.ts +33 -0
  486. package/dist/scene/bind.d.ts.map +1 -0
  487. package/dist/scene/bind.js +66 -0
  488. package/dist/scene/bind.js.map +1 -0
  489. package/dist/scene/collide.d.ts +56 -0
  490. package/dist/scene/collide.d.ts.map +1 -0
  491. package/dist/scene/collide.js +146 -0
  492. package/dist/scene/collide.js.map +1 -0
  493. package/dist/scene/frame.d.ts +22 -0
  494. package/dist/scene/frame.d.ts.map +1 -0
  495. package/dist/scene/frame.js +57 -0
  496. package/dist/scene/frame.js.map +1 -0
  497. package/dist/scene/gltf.d.ts +79 -0
  498. package/dist/scene/gltf.d.ts.map +1 -0
  499. package/dist/scene/gltf.js +409 -0
  500. package/dist/scene/gltf.js.map +1 -0
  501. package/dist/scene/ir.d.ts +293 -0
  502. package/dist/scene/ir.d.ts.map +1 -0
  503. package/dist/scene/ir.js +692 -0
  504. package/dist/scene/ir.js.map +1 -0
  505. package/dist/scene/math.d.ts +50 -0
  506. package/dist/scene/math.d.ts.map +1 -0
  507. package/dist/scene/math.js +180 -0
  508. package/dist/scene/math.js.map +1 -0
  509. package/dist/scene/orbit.d.ts +19 -0
  510. package/dist/scene/orbit.d.ts.map +1 -0
  511. package/dist/scene/orbit.js +60 -0
  512. package/dist/scene/orbit.js.map +1 -0
  513. package/dist/scene/physics.d.ts +228 -0
  514. package/dist/scene/physics.d.ts.map +1 -0
  515. package/dist/scene/physics.js +1500 -0
  516. package/dist/scene/physics.js.map +1 -0
  517. package/dist/scene/registry.d.ts +85 -0
  518. package/dist/scene/registry.d.ts.map +1 -0
  519. package/dist/scene/registry.js +75 -0
  520. package/dist/scene/registry.js.map +1 -0
  521. package/dist/scene/skin.d.ts +82 -0
  522. package/dist/scene/skin.d.ts.map +1 -0
  523. package/dist/scene/skin.js +351 -0
  524. package/dist/scene/skin.js.map +1 -0
  525. package/dist/scene/sprite.d.ts +36 -0
  526. package/dist/scene/sprite.d.ts.map +1 -0
  527. package/dist/scene/sprite.js +107 -0
  528. package/dist/scene/sprite.js.map +1 -0
  529. package/dist/scene/viewer.d.ts +96 -0
  530. package/dist/scene/viewer.d.ts.map +1 -0
  531. package/dist/scene/viewer.js +235 -0
  532. package/dist/scene/viewer.js.map +1 -0
  533. package/dist/scoped-slots.d.ts +9 -0
  534. package/dist/scoped-slots.d.ts.map +1 -0
  535. package/dist/scoped-slots.js +42 -0
  536. package/dist/scoped-slots.js.map +1 -0
  537. package/dist/screen.d.ts +109 -0
  538. package/dist/screen.d.ts.map +1 -0
  539. package/dist/screen.js +309 -0
  540. package/dist/screen.js.map +1 -0
  541. package/dist/scroll.d.ts +525 -0
  542. package/dist/scroll.d.ts.map +1 -0
  543. package/dist/scroll.js +1226 -0
  544. package/dist/scroll.js.map +1 -0
  545. package/dist/settings-plane.d.ts +58 -0
  546. package/dist/settings-plane.d.ts.map +1 -0
  547. package/dist/settings-plane.js +86 -0
  548. package/dist/settings-plane.js.map +1 -0
  549. package/dist/share-inbox.d.ts +56 -0
  550. package/dist/share-inbox.d.ts.map +1 -0
  551. package/dist/share-inbox.js +114 -0
  552. package/dist/share-inbox.js.map +1 -0
  553. package/dist/shared-transition.d.ts +152 -0
  554. package/dist/shared-transition.d.ts.map +1 -0
  555. package/dist/shared-transition.js +257 -0
  556. package/dist/shared-transition.js.map +1 -0
  557. package/dist/sheet-content-padding.d.ts +24 -0
  558. package/dist/sheet-content-padding.d.ts.map +1 -0
  559. package/dist/sheet-content-padding.js +32 -0
  560. package/dist/sheet-content-padding.js.map +1 -0
  561. package/dist/shot-devices.d.ts +36 -0
  562. package/dist/shot-devices.d.ts.map +1 -0
  563. package/dist/shot-devices.js +90 -0
  564. package/dist/shot-devices.js.map +1 -0
  565. package/dist/shot-guards.d.ts +100 -0
  566. package/dist/shot-guards.d.ts.map +1 -0
  567. package/dist/shot-guards.js +260 -0
  568. package/dist/shot-guards.js.map +1 -0
  569. package/dist/shot-scope.d.ts +140 -0
  570. package/dist/shot-scope.d.ts.map +1 -0
  571. package/dist/shot-scope.js +302 -0
  572. package/dist/shot-scope.js.map +1 -0
  573. package/dist/slot-partition.d.ts +9 -0
  574. package/dist/slot-partition.d.ts.map +1 -0
  575. package/dist/slot-partition.js +38 -0
  576. package/dist/slot-partition.js.map +1 -0
  577. package/dist/snackbar.d.ts +165 -0
  578. package/dist/snackbar.d.ts.map +1 -0
  579. package/dist/snackbar.js +220 -0
  580. package/dist/snackbar.js.map +1 -0
  581. package/dist/socket.d.ts +96 -0
  582. package/dist/socket.d.ts.map +1 -0
  583. package/dist/socket.js +370 -0
  584. package/dist/socket.js.map +1 -0
  585. package/dist/spotlight.d.ts +77 -0
  586. package/dist/spotlight.d.ts.map +1 -0
  587. package/dist/spotlight.js +174 -0
  588. package/dist/spotlight.js.map +1 -0
  589. package/dist/state-primitive.d.ts +37 -0
  590. package/dist/state-primitive.d.ts.map +1 -0
  591. package/dist/state-primitive.js +91 -0
  592. package/dist/state-primitive.js.map +1 -0
  593. package/dist/store-query.d.ts +25 -0
  594. package/dist/store-query.d.ts.map +1 -0
  595. package/dist/store-query.js +88 -0
  596. package/dist/store-query.js.map +1 -0
  597. package/dist/store-value.d.ts +48 -0
  598. package/dist/store-value.d.ts.map +1 -0
  599. package/dist/store-value.js +264 -0
  600. package/dist/store-value.js.map +1 -0
  601. package/dist/store-versioning.d.ts +70 -0
  602. package/dist/store-versioning.d.ts.map +1 -0
  603. package/dist/store-versioning.js +188 -0
  604. package/dist/store-versioning.js.map +1 -0
  605. package/dist/store.d.ts +282 -0
  606. package/dist/store.d.ts.map +1 -0
  607. package/dist/store.js +1144 -0
  608. package/dist/store.js.map +1 -0
  609. package/dist/strings.d.ts +141 -0
  610. package/dist/strings.d.ts.map +1 -0
  611. package/dist/strings.js +581 -0
  612. package/dist/strings.js.map +1 -0
  613. package/dist/telemetry.d.ts +95 -0
  614. package/dist/telemetry.d.ts.map +1 -0
  615. package/dist/telemetry.js +255 -0
  616. package/dist/telemetry.js.map +1 -0
  617. package/dist/transform-core.d.ts +228 -0
  618. package/dist/transform-core.d.ts.map +1 -0
  619. package/dist/transform-core.js +921 -0
  620. package/dist/transform-core.js.map +1 -0
  621. package/dist/transition-core.d.ts +58 -0
  622. package/dist/transition-core.d.ts.map +1 -0
  623. package/dist/transition-core.js +352 -0
  624. package/dist/transition-core.js.map +1 -0
  625. package/dist/trim-trailing.d.ts +3 -0
  626. package/dist/trim-trailing.d.ts.map +1 -0
  627. package/dist/trim-trailing.js +14 -0
  628. package/dist/trim-trailing.js.map +1 -0
  629. package/dist/upload.d.ts +51 -0
  630. package/dist/upload.d.ts.map +1 -0
  631. package/dist/upload.js +68 -0
  632. package/dist/upload.js.map +1 -0
  633. package/dist/vendor-face.d.ts +44 -0
  634. package/dist/vendor-face.d.ts.map +1 -0
  635. package/dist/vendor-face.js +80 -0
  636. package/dist/vendor-face.js.map +1 -0
  637. package/dist/vendor-session.d.ts +166 -0
  638. package/dist/vendor-session.d.ts.map +1 -0
  639. package/dist/vendor-session.js +423 -0
  640. package/dist/vendor-session.js.map +1 -0
  641. package/dist/vendor-surface.d.ts +290 -0
  642. package/dist/vendor-surface.d.ts.map +1 -0
  643. package/dist/vendor-surface.js +439 -0
  644. package/dist/vendor-surface.js.map +1 -0
  645. package/dist/version-rules.generated.d.ts +17 -0
  646. package/dist/version-rules.generated.d.ts.map +1 -0
  647. package/dist/version-rules.generated.js +99 -0
  648. package/dist/version-rules.generated.js.map +1 -0
  649. package/dist/view-transition-core.d.ts +99 -0
  650. package/dist/view-transition-core.d.ts.map +1 -0
  651. package/dist/view-transition-core.js +127 -0
  652. package/dist/view-transition-core.js.map +1 -0
  653. package/dist/view-transition-door.d.ts +26 -0
  654. package/dist/view-transition-door.d.ts.map +1 -0
  655. package/dist/view-transition-door.js +88 -0
  656. package/dist/view-transition-door.js.map +1 -0
  657. package/dist/window-identity.d.ts +3 -0
  658. package/dist/window-identity.d.ts.map +1 -0
  659. package/dist/window-identity.js +27 -0
  660. package/dist/window-identity.js.map +1 -0
  661. package/package.json +141 -2
@@ -0,0 +1,692 @@
1
+ //
2
+ // scene/ir.ts - the DSX Scene IR (dsx-scene.md P1): a parsed <scene> subtree as typed
3
+ // nodes, platform-neutral and store-agnostic. The markup arrives ALREADY parsed by the
4
+ // host renderer's own XML parser (the compiler's XmlNode shape, structurally typed here
5
+ // so this package needs no compiler import — never a second XML parser). Attribute
6
+ // values keep their JSE holes verbatim; a resolver callback interpolates at use time
7
+ // (the element wires the live store, the corpus wires a plain map). Defaults and the
8
+ // Article-7 fallback law are pinned by OpenSource/Conformance/scene/parse.json.
9
+ //
10
+ import { mat4Identity, mat4LookAt, mat4Multiply, mat4Orthographic, mat4Perspective, mat4Trs, } from "./math.js";
11
+ const SCENE_NODE_KINDS = new Set([
12
+ "camera", "light", "group", "box", "sphere", "plane", "model", "text3d", "anchor",
13
+ "animate", "sprite",
14
+ ]);
15
+ /** the store-agnostic hole interpolator: replaces every {{ expr }} with
16
+ * String(evalHole(trimmed expr)) — what a map-backed corpus resolver uses */
17
+ export function interpolateSceneHoles(raw, evalHole) {
18
+ // indexOf, not a lazy `{{([\s\S]*?)}}`: with no closer left, that rescanned to the end from
19
+ // every remaining opener, quadratic in the text. Same leftmost, shortest pairing.
20
+ let out = "";
21
+ let from = 0;
22
+ for (;;) {
23
+ const open = raw.indexOf("{{", from);
24
+ if (open < 0)
25
+ break;
26
+ const close = raw.indexOf("}}", open + 2);
27
+ if (close < 0)
28
+ break;
29
+ const value = evalHole(raw.slice(open + 2, close).trim());
30
+ out += raw.slice(from, open) + (value === null || value === undefined ? "" : String(value));
31
+ from = close + 2;
32
+ }
33
+ return out + raw.slice(from);
34
+ }
35
+ /** parse a <scene> markup subtree into the typed IR. Unknown tags are SKIPPED with a
36
+ * diagnostic — never a phantom node, never a crash (Article 7). A `prefabs` lookup
37
+ * (G1, dsx-game.md §2) lets locally-declared COMPONENT tags instantiate as prefabs —
38
+ * the kernel never learns a component name (rule 18: the lookup is the seam). */
39
+ export function parseScene(markup, diag, prefabs) {
40
+ const modeRaw = markup.attrs["mode"] ?? "3d";
41
+ let mode = "3d";
42
+ if (modeRaw === "3d" || modeRaw === "2d" || modeRaw === "ar")
43
+ mode = modeRaw;
44
+ else
45
+ diag?.({ code: "unknown_mode", message: `<scene mode="${modeRaw}"> is not 3d, 2d or ar — using 3d` });
46
+ return {
47
+ mode, attrs: markup.attrs,
48
+ nodes: parseNodes(markup.children, diag, prefabs, 0, mode === "2d"),
49
+ };
50
+ }
51
+ function parseNodes(children, diag, prefabs, depth = 0, mode2d = false) {
52
+ const nodes = [];
53
+ for (const child of children) {
54
+ if (!SCENE_NODE_KINDS.has(child.tag)) {
55
+ const def = prefabs?.(child.tag) ?? null;
56
+ if (def !== null) {
57
+ const expanded = expandScenePrefab(child, def, diag, prefabs, depth, mode2d);
58
+ if (expanded !== null)
59
+ nodes.push(expanded);
60
+ continue;
61
+ }
62
+ diag?.({ code: "unknown_tag", message: `<${child.tag}> is not a scene node — skipped` });
63
+ continue;
64
+ }
65
+ nodes.push({
66
+ kind: child.tag,
67
+ id: child.attrs["id"] ?? null,
68
+ attrs: child.attrs,
69
+ children: parseNodes(child.children, diag, prefabs, depth, mode2d),
70
+ source: child,
71
+ ...(mode2d ? { mode2d: true } : {}),
72
+ });
73
+ }
74
+ return nodes;
75
+ }
76
+ // ── prefabs (G1, dsx-game.md §2): components instantiate inside <scene> subtrees ─────
77
+ //
78
+ // A PREFAB IS A COMPONENT whose body is scene content — no second concept. The kernel
79
+ // owns only the STRUCTURAL law (corpus prefab.json); each renderer derives the
80
+ // definition from ITS OWN component registry and hands parseScene a lookup, so no
81
+ // component name ever appears in kernel code (constitution rule 18).
82
+ /** the runaway self-reference guard — prefab expansion nests at most this deep */
83
+ export const SCENE_PREFAB_DEPTH_LIMIT = 8;
84
+ /** instance words that are the node TRANSFORM, never scope parameters */
85
+ export const SCENE_PREFAB_TRANSFORM_WORDS = ["position", "rotation", "scale"];
86
+ /** head/declaration tags that never join a prefab body (the dsx-anatomy head words) */
87
+ const SCENE_PREFAB_DECLARATION_TAGS = new Set([
88
+ "head", "attribute", "variable", "var", "let", "action", "formula", "script", "functions",
89
+ "event", "expects", "watch", "api", "style", "component", "slot",
90
+ ]);
91
+ /** instance attrs that never enter the scope (identity/presentation/reserved words) */
92
+ const SCENE_PREFAB_RESERVED_WORDS = new Set(["id", "__css", "css-owner", "slot", "bind", "key"]);
93
+ /** derive a prefab definition from a component TEMPLATE — the shape each lane's
94
+ * registry holds: a bare scene root, or a wrapper whose non-declaration children are
95
+ * the body roots (the Kotlin/Swift inline-component wrap, a .dsx file root). Declared
96
+ * `<attribute as default>` params are scanned from the head/declarations EITHER way —
97
+ * a bare scene root may carry its `<head>` as a child (registries that keep templates
98
+ * verbatim), so declarations are scanned AND stripped there too; a caller with a
99
+ * separately parsed head (the web ComponentIR) overrides `params`. */
100
+ export function scenePrefabDefFromTemplate(template) {
101
+ const params = [];
102
+ const scanParams = (children) => {
103
+ for (const child of children) {
104
+ if (child.tag === "head") {
105
+ scanParams(child.children);
106
+ continue;
107
+ }
108
+ if (child.tag !== "attribute")
109
+ continue;
110
+ const as = child.attrs["as"];
111
+ if (as === undefined || as.length === 0)
112
+ continue;
113
+ const def = child.attrs["default"];
114
+ params.push(def === undefined ? { name: as } : { name: as, default: def });
115
+ }
116
+ };
117
+ if (SCENE_NODE_KINDS.has(template.tag)) {
118
+ scanParams(template.children);
119
+ const body = template.children.filter((c) => !SCENE_PREFAB_DECLARATION_TAGS.has(c.tag));
120
+ const root = body.length === template.children.length
121
+ ? template : { tag: template.tag, attrs: template.attrs, children: body };
122
+ return { params, roots: [root] };
123
+ }
124
+ scanParams(template.children);
125
+ return { params, roots: template.children.filter((c) => !SCENE_PREFAB_DECLARATION_TAGS.has(c.tag)) };
126
+ }
127
+ /** THE SCOPE LAW: every non-reserved, non-transform, non-handler instance attribute
128
+ * enters the scope RAW; declared params missing from the instance fall to their
129
+ * declared default string. Transform words are the instance's node transform, never
130
+ * parameters. */
131
+ export function scenePrefabScope(instance, def) {
132
+ const scope = {};
133
+ for (const [name, value] of Object.entries(instance.attrs)) {
134
+ if (SCENE_PREFAB_RESERVED_WORDS.has(name) || name.startsWith("on:"))
135
+ continue;
136
+ if (SCENE_PREFAB_TRANSFORM_WORDS.includes(name))
137
+ continue;
138
+ scope[name] = value;
139
+ }
140
+ for (const p of def.params) {
141
+ if (scope[p.name] === undefined && p.default !== undefined)
142
+ scope[p.name] = p.default;
143
+ }
144
+ return scope;
145
+ }
146
+ /** THE EXPANSION-ROOT LAW: an instance ALWAYS expands to one implicit `group` carrying
147
+ * the instance's transform words + id (instance transforms COMPOSE with body-authored
148
+ * transforms — never clobber), children = the body roots. A body that is not scene
149
+ * content (any root neither a scene tag nor a prefab) skips the WHOLE instance with
150
+ * one `prefab_not_scene` diagnostic; expansion past SCENE_PREFAB_DEPTH_LIMIT skips
151
+ * with one `prefab_depth` diagnostic (Article 7 — never a crash, never a phantom). */
152
+ function expandScenePrefab(instance, def, diag, prefabs, depth, mode2d = false) {
153
+ if (depth >= SCENE_PREFAB_DEPTH_LIMIT) {
154
+ diag?.({ code: "prefab_depth", message: `<${instance.tag}> nests prefabs deeper than ${SCENE_PREFAB_DEPTH_LIMIT} — skipped` });
155
+ return null;
156
+ }
157
+ // the body resolves in its DEFINING scope when the renderer provides one (the
158
+ // defining-scope law) — a packaged prefab's nested tags mean what they meant
159
+ // where the component was declared, exactly as expansion outside scenes
160
+ const bodyLookup = def.lookup ?? prefabs;
161
+ if (def.roots.length === 0
162
+ || def.roots.some((r) => !SCENE_NODE_KINDS.has(r.tag) && (bodyLookup?.(r.tag) ?? null) === null)) {
163
+ diag?.({ code: "prefab_not_scene", message: `<${instance.tag}> is a component but its body is not scene content — skipped` });
164
+ return null;
165
+ }
166
+ // bind/key/on:* on an instance tag do nothing — say so (Article 7, never silent):
167
+ // spawning is <group bind> around the instance; handlers live inside the body
168
+ const ignored = Object.keys(instance.attrs)
169
+ .filter((n) => n === "bind" || n === "key" || n.startsWith("on:"));
170
+ if (ignored.length > 0) {
171
+ diag?.({ code: "prefab_ignored", message: `<${instance.tag}> ${ignored.join(", ")} ignored — wrap the instance in <group bind key> to spawn; attach handlers inside the component body` });
172
+ }
173
+ const attrs = {};
174
+ for (const name of SCENE_PREFAB_TRANSFORM_WORDS) {
175
+ const value = instance.attrs[name];
176
+ if (value !== undefined)
177
+ attrs[name] = value;
178
+ }
179
+ const id = instance.attrs["id"];
180
+ if (id !== undefined)
181
+ attrs["id"] = id;
182
+ return {
183
+ kind: "group",
184
+ id: id ?? null,
185
+ attrs,
186
+ children: parseNodes(def.roots, diag, bodyLookup, depth + 1, mode2d),
187
+ source: instance,
188
+ prefab: { tag: instance.tag, scope: scenePrefabScope(instance, def) },
189
+ ...(mode2d ? { mode2d: true } : {}),
190
+ };
191
+ }
192
+ /** the corpus/tooling resolver over an expanded tree: body holes under a prefab root
193
+ * resolve SCOPE-FIRST (an expr that is exactly a scope key reads the per-instance
194
+ * value, resolved at the instance site), everything else falls through to `evalHole`
195
+ * (the outer plane). Renderers implement the same law on their live item planes. */
196
+ export function scenePrefabResolver(nodes, evalHole) {
197
+ const scopes = new Map();
198
+ const walk = (list, enclosing) => {
199
+ for (const node of list) {
200
+ // the root's OWN attrs (the instance transforms) resolve at the INSTANCE SITE
201
+ if (enclosing !== null)
202
+ scopes.set(node, enclosing);
203
+ let inner = enclosing;
204
+ if (node.prefab !== undefined) {
205
+ const site = (expr) => enclosing !== null && enclosing[expr] !== undefined ? enclosing[expr] : evalHole(expr);
206
+ const resolved = {};
207
+ for (const [k, raw] of Object.entries(node.prefab.scope)) {
208
+ resolved[k] = interpolateSceneHoles(raw, site);
209
+ }
210
+ inner = resolved;
211
+ }
212
+ walk(node.children, inner);
213
+ }
214
+ };
215
+ walk(nodes, null);
216
+ return (node, _name, raw) => interpolateSceneHoles(raw, (expr) => {
217
+ const scope = node !== null ? scopes.get(node) : undefined;
218
+ return scope !== undefined && scope[expr] !== undefined ? scope[expr] : evalHole(expr);
219
+ });
220
+ }
221
+ // ── typed attribute resolution (the corpus defaults) ─────────────────────────────────
222
+ function finiteNumbers(resolved) {
223
+ const parts = resolved.trim().split(/\s+/).filter((p) => p.length > 0);
224
+ const numbers = [];
225
+ for (const part of parts) {
226
+ const value = Number(part);
227
+ if (!Number.isFinite(value))
228
+ return null;
229
+ numbers.push(value);
230
+ }
231
+ return numbers;
232
+ }
233
+ // THE TOTAL-RESOLVE LAW (P5): an UNAUTHORED attribute still consults the resolver,
234
+ // with its formatted DEFAULT as the raw value. A pure hole-interpolating resolver
235
+ // (the corpus map resolver) returns that default string unchanged — identical numbers
236
+ // to the pre-P5 early-return — while a renderer's OVERRIDE PLANE (animations, orbit)
237
+ // can now reach properties the author never wrote (`<animate target="rotation">` on a
238
+ // node with no rotation= attribute).
239
+ /** shared by resolvedProps and the physics extraction (physics.ts) — exported for the
240
+ * sibling kernel modules, not part of any renderer's surface */
241
+ export function readVec(node, name, fallback, resolve, diag, attrs) {
242
+ const raw = attrs[name] ?? fallback.join(" ");
243
+ const resolved = resolve(node, name, raw);
244
+ const numbers = finiteNumbers(resolved);
245
+ if (numbers === null || numbers.length !== fallback.length) {
246
+ diag?.({
247
+ code: "malformed_vector",
248
+ message: `${name}="${resolved}" is not ${fallback.length} numbers — using "${fallback.join(" ")}"`,
249
+ });
250
+ return [...fallback];
251
+ }
252
+ return numbers;
253
+ }
254
+ export function readScalar(node, name, fallback, resolve, diag, attrs) {
255
+ const raw = attrs[name] ?? String(fallback);
256
+ const resolved = resolve(node, name, raw);
257
+ const value = Number(resolved.trim());
258
+ if (resolved.trim().length === 0 || !Number.isFinite(value)) {
259
+ diag?.({ code: "malformed_number", message: `${name}="${resolved}" is not a number — using ${fallback}` });
260
+ return fallback;
261
+ }
262
+ return value;
263
+ }
264
+ export function readString(node, name, fallback, resolve, attrs) {
265
+ return resolve(node, name, attrs[name] ?? fallback);
266
+ }
267
+ /** THE 2D PAIR LAW (G6, sprite.json): inside `mode="2d"` a `position` of TWO numbers
268
+ * means z = 0; a triple still means what it always did, and every OTHER vector word
269
+ * (rotation, scale, velocity) stays a triple — a named absence. Outside 2D a pair is
270
+ * malformed exactly as before (readVec's shared law). */
271
+ export function readPosition(node, fallback, resolve, diag, attrs) {
272
+ if (node?.mode2d === true) {
273
+ const raw = attrs["position"] ?? fallback.join(" ");
274
+ const pair = finiteNumbers(resolve(node, "position", raw));
275
+ if (pair !== null && pair.length === 2)
276
+ return [pair[0], pair[1], 0];
277
+ }
278
+ return readVec(node, "position", fallback, resolve, diag, attrs);
279
+ }
280
+ // ── the sprite grammar (G6, corpus sprite.json) ──────────────────────────────────────
281
+ //
282
+ // These three live HERE, beside the other attribute grammars, so `resolvedProps` needs
283
+ // no import from scene/sprite.ts — the quad/UV/fps folds import THEM (one direction,
284
+ // the text3d precedent).
285
+ /** which point of the quad `position` names → the anchor point's offset from the quad
286
+ * CENTER as a fraction of (width, height): ax ∈ {−½ left, 0 center, +½ right},
287
+ * ay ∈ {+½ top, 0 center, −½ bottom} */
288
+ export const SPRITE_ANCHORS = new Map([
289
+ ["center", [0, 0]], ["top", [0, 0.5]], ["bottom", [0, -0.5]],
290
+ ["left", [-0.5, 0]], ["right", [0.5, 0]],
291
+ ["top-left", [-0.5, 0.5]], ["top-right", [0.5, 0.5]],
292
+ ["bottom-left", [-0.5, -0.5]], ["bottom-right", [0.5, -0.5]],
293
+ ]);
294
+ export const SPRITE_DEFAULT_ANCHOR = "center";
295
+ /** THE SHEET GRAMMAR: ONE number N = a SINGLE ROW (cols = N, rows = 1); TWO numbers =
296
+ * "cols rows" EXPLICITLY. The kernel never guesses a grid — `cols = ceil(√N)` is WRONG
297
+ * and is not the law. Anything else (a fraction, < 1, three numbers, a word) is null
298
+ * and the caller falls back to 1×1 with one diagnostic (Article 7). */
299
+ export function parseSpriteFrames(raw) {
300
+ const parts = raw.trim().split(/\s+/).filter((p) => p.length > 0);
301
+ if (parts.length !== 1 && parts.length !== 2)
302
+ return null;
303
+ const numbers = [];
304
+ for (const part of parts) {
305
+ const value = Number(part);
306
+ if (!Number.isFinite(value) || value < 1 || !Number.isInteger(value))
307
+ return null;
308
+ numbers.push(value);
309
+ }
310
+ return parts.length === 1 ? [numbers[0], 1] : [numbers[0], numbers[1]];
311
+ }
312
+ /** the `flip` word: "" or any arrangement of the letters x and y ("yx" IS "xy" — the
313
+ * word is a SET), normalized to "" · "x" · "y" · "xy". null = not a flip word. */
314
+ export function normalizeSpriteFlip(raw) {
315
+ if (raw.length === 0)
316
+ return "";
317
+ if (raw.length > 2)
318
+ return null;
319
+ let x = false, y = false;
320
+ for (const letter of raw) {
321
+ if (letter === "x" && !x)
322
+ x = true;
323
+ else if (letter === "y" && !y)
324
+ y = true;
325
+ else
326
+ return null;
327
+ }
328
+ return x ? (y ? "xy" : "x") : "y";
329
+ }
330
+ export const LIGHT_KINDS = new Set(["ambient", "directional", "point"]);
331
+ export const COLLIDE_KINDS = new Set(["sphere", "box"]);
332
+ /** `duration`/`blend` grammar: bare-ms, `ms`, or `s` (the P5 spelling — anim.ts
333
+ * re-exports this for tween parsing; it lives here so the model props can share it) */
334
+ export function parseSceneDuration(raw) {
335
+ const m = /^([0-9]+(?:\.[0-9]+)?|\.[0-9]+)(ms|s)?$/.exec(raw.trim());
336
+ if (m === null)
337
+ return null;
338
+ const value = Number(m[1]);
339
+ if (!Number.isFinite(value) || value < 0)
340
+ return null;
341
+ return m[2] === "s" ? value * 1000 : value;
342
+ }
343
+ export function resolvedProps(node, resolve, diag) {
344
+ const a = node.attrs;
345
+ const cameraDefault = [0, 0, 5];
346
+ const kindRaw = readString(node, "kind", "", resolve, a);
347
+ let lightKind = "ambient";
348
+ if (node.kind === "light" && kindRaw.length > 0) {
349
+ if (LIGHT_KINDS.has(kindRaw))
350
+ lightKind = kindRaw;
351
+ else
352
+ diag?.({ code: "unknown_light_kind", message: `<light kind="${kindRaw}"> is not ambient, directional or point — using ambient` });
353
+ }
354
+ const geometryNode = node.kind === "box" || node.kind === "sphere" || node.kind === "plane";
355
+ let collide = "";
356
+ if (geometryNode) {
357
+ const collideRaw = readString(node, "collide", "", resolve, a);
358
+ if (collideRaw.length > 0) {
359
+ if (COLLIDE_KINDS.has(collideRaw))
360
+ collide = collideRaw;
361
+ else
362
+ diag?.({ code: "unknown_collide", message: `collide="${collideRaw}" is not sphere or box — not a collider` });
363
+ }
364
+ }
365
+ // `size` and every camera scalar read PER KIND — the word is shared (camera scalar,
366
+ // box triple, plane pair), so an unconditional read would mis-diagnose valid markup.
367
+ const camera = node.kind === "camera";
368
+ // G3 model clip words (skin.json props cases): animation name, loop, blend
369
+ const model = node.kind === "model";
370
+ let clipLoop = true;
371
+ if (model) {
372
+ const loopRaw = readString(node, "loop", "true", resolve, a);
373
+ if (loopRaw === "false")
374
+ clipLoop = false;
375
+ else if (loopRaw !== "true") {
376
+ diag?.({ code: "malformed_animation", message: `loop="${loopRaw}" is not true or false — using true` });
377
+ }
378
+ }
379
+ let blendMs = 0;
380
+ if (model && a["blend"] !== undefined) {
381
+ const blendRaw = readString(node, "blend", "0", resolve, a);
382
+ const parsed = parseSceneDuration(blendRaw);
383
+ if (parsed === null) {
384
+ diag?.({ code: "malformed_animation", message: `blend="${blendRaw}" is not ms|s — using 0` });
385
+ }
386
+ else {
387
+ blendMs = parsed;
388
+ }
389
+ }
390
+ // G6 (sprite.json): the `<sprite>` words. Every read is gated on the kind — `size`,
391
+ // `loop` and `frame` are shared words (plane pair, model clip loop), so an
392
+ // unconditional read would mis-diagnose valid markup.
393
+ const sprite = node.kind === "sprite";
394
+ const spriteSize = sprite
395
+ ? readVec(node, "size", [1, 1], resolve, diag, a) : [1, 1];
396
+ let spriteFrames = [1, 1];
397
+ if (sprite) {
398
+ const framesRaw = readString(node, "frames", "1 1", resolve, a);
399
+ const parsed = parseSpriteFrames(framesRaw);
400
+ if (parsed === null) {
401
+ diag?.({ code: "malformed_sprite", message: `frames="${framesRaw}" is not a frame count or "cols rows" of whole numbers ≥ 1 — using the whole texture` });
402
+ }
403
+ else {
404
+ spriteFrames = parsed;
405
+ }
406
+ }
407
+ let spriteFrame = 0;
408
+ if (sprite) {
409
+ const total = spriteFrames[0] * spriteFrames[1];
410
+ const floored = Math.floor(readScalar(node, "frame", 0, resolve, diag, a));
411
+ spriteFrame = Math.min(Math.max(floored, 0), total - 1);
412
+ if (floored !== spriteFrame) {
413
+ diag?.({ code: "malformed_sprite", message: `frame="${floored}" is outside 0..${total - 1} — clamped to ${spriteFrame}` });
414
+ }
415
+ }
416
+ let spriteLoop = true;
417
+ let spriteAnchor = "center";
418
+ let spriteFlip = "";
419
+ if (sprite) {
420
+ const loopRaw = readString(node, "loop", "true", resolve, a);
421
+ if (loopRaw === "false")
422
+ spriteLoop = false;
423
+ else if (loopRaw !== "true") {
424
+ diag?.({ code: "malformed_sprite", message: `loop="${loopRaw}" is not true or false — using true` });
425
+ }
426
+ const anchorRaw = readString(node, "anchor", SPRITE_DEFAULT_ANCHOR, resolve, a);
427
+ if (SPRITE_ANCHORS.has(anchorRaw))
428
+ spriteAnchor = anchorRaw;
429
+ else
430
+ diag?.({ code: "malformed_sprite", message: `anchor="${anchorRaw}" is not a sprite anchor word — using ${SPRITE_DEFAULT_ANCHOR}` });
431
+ const flipRaw = readString(node, "flip", "", resolve, a).trim();
432
+ const flip = normalizeSpriteFlip(flipRaw);
433
+ if (flip === null) {
434
+ diag?.({ code: "malformed_sprite", message: `flip="${flipRaw}" is not "", "x", "y" or "xy" — not mirrored` });
435
+ }
436
+ else {
437
+ spriteFlip = flip;
438
+ }
439
+ }
440
+ return {
441
+ position: readPosition(node, camera ? cameraDefault : [0, 0, 0], resolve, diag, a),
442
+ rotation: readVec(node, "rotation", [0, 0, 0], resolve, diag, a),
443
+ scale: readVec(node, "scale", [1, 1, 1], resolve, diag, a),
444
+ color: readString(node, "color", "#ffffff", resolve, a),
445
+ lookAt: camera ? readVec(node, "look-at", [0, 0, 0], resolve, diag, a) : [0, 0, 0],
446
+ fov: camera ? readScalar(node, "fov", 60, resolve, diag, a) : 60,
447
+ near: camera ? readScalar(node, "near", 0.1, resolve, diag, a) : 0.1,
448
+ far: camera ? readScalar(node, "far", 1000, resolve, diag, a) : 1000,
449
+ size2d: camera ? readScalar(node, "size", 5, resolve, diag, a) : 5,
450
+ lightKind,
451
+ intensity: node.kind === "light" ? readScalar(node, "intensity", 1, resolve, diag, a) : 1,
452
+ range: node.kind === "light" && lightKind === "point"
453
+ ? readScalar(node, "range", POINT_LIGHT_DEFAULT_RANGE, resolve, diag, a) : POINT_LIGHT_DEFAULT_RANGE,
454
+ controls: camera ? readString(node, "controls", "", resolve, a) : "",
455
+ collide,
456
+ boxSize: node.kind === "box" ? readVec(node, "size", [1, 1, 1], resolve, diag, a) : [1, 1, 1],
457
+ radius: node.kind === "sphere" ? readScalar(node, "radius", 1, resolve, diag, a) : 1,
458
+ planeSize: node.kind === "plane"
459
+ ? readVec(node, "size", [1, 1], resolve, diag, a) : [1, 1],
460
+ src: readString(node, "src", "", resolve, a),
461
+ value: readString(node, "value", "", resolve, a),
462
+ anchorKind: node.kind === "anchor" ? readString(node, "kind", "", resolve, a) : "",
463
+ text3dSize: node.kind === "text3d"
464
+ ? readScalar(node, "size", TEXT3D_DEFAULT_SIZE, resolve, diag, a) : TEXT3D_DEFAULT_SIZE,
465
+ texture: node.kind === "box" || node.kind === "sphere" || node.kind === "plane"
466
+ ? readString(node, "texture", "", resolve, a) : "",
467
+ animation: model ? readString(node, "animation", "", resolve, a) : "",
468
+ clipLoop,
469
+ blendMs,
470
+ spriteSize,
471
+ spriteSizeAuthored: sprite && a["size"] !== undefined,
472
+ spriteFrames,
473
+ spriteFrame,
474
+ spriteFps: sprite ? readScalar(node, "fps", 0, resolve, diag, a) : 0,
475
+ spriteLoop,
476
+ spriteAnchor,
477
+ spriteFlip,
478
+ };
479
+ }
480
+ // ── the text3d quad law (dsx-scene.md P4, corpus text3d.json) ────────────────────────
481
+ /** the glyph height default (scene units) */
482
+ export const TEXT3D_DEFAULT_SIZE = 0.5;
483
+ /** the LAW's fixed per-character advance: width = size × 0.6 × codePointCount */
484
+ export const TEXT3D_ADVANCE = 0.6;
485
+ /** the billboard quad's layout: center = position, height = size, width = size · 0.6 ·
486
+ * codePointCount; an empty value lays out NO quad (null — the node draws nothing).
487
+ * Characters are Unicode CODE POINTS (the surrogate-pair corpus case). The BILLBOARD
488
+ * law (the quad always faces the camera) is draw-time behavior, not layout. */
489
+ export function text3dQuad(props) {
490
+ const characters = Array.from(props.value).length;
491
+ if (characters === 0)
492
+ return null;
493
+ return {
494
+ center: [...props.position],
495
+ halfWidth: props.text3dSize * TEXT3D_ADVANCE * characters / 2,
496
+ halfHeight: props.text3dSize / 2,
497
+ };
498
+ }
499
+ // ── world transforms (the transform-corpus law) ──────────────────────────────────────
500
+ /** every node's world matrix: world = parentWorld · (T · Rz · Ry · Rx · S), root down.
501
+ * Cameras and lights get world matrices too (their position rides the same plane).
502
+ * `<animate>` nodes are CONTROLLERS, not transforms — skipped entirely. */
503
+ export function worldMatrices(nodes, resolve, diag) {
504
+ const out = new Map();
505
+ const walk = (list, parent) => {
506
+ for (const node of list) {
507
+ if (node.kind === "animate")
508
+ continue;
509
+ const props = resolvedProps(node, resolve, diag);
510
+ const world = mat4Multiply(parent, mat4Trs(props.position, props.rotation, props.scale));
511
+ out.set(node, world);
512
+ walk(node.children, world);
513
+ }
514
+ };
515
+ walk(nodes, mat4Identity());
516
+ return out;
517
+ }
518
+ export function findSceneNode(nodes, id) {
519
+ for (const node of nodes) {
520
+ if (node.id === id)
521
+ return node;
522
+ const inner = findSceneNode(node.children, id);
523
+ if (inner !== null)
524
+ return inner;
525
+ }
526
+ return null;
527
+ }
528
+ /** the first authored <camera> wins; an unauthored camera uses every default. mode="2d"
529
+ * projects orthographically (`size` = vertical half-extent); 3d and ar perspective. */
530
+ export function sceneCamera(ir, resolve, aspect, diag) {
531
+ const node = ir.nodes.find((n) => n.kind === "camera") ?? null;
532
+ const props = node !== null
533
+ ? resolvedProps(node, resolve, diag)
534
+ : { position: [0, 0, 5], lookAt: [0, 0, 0], fov: 60, near: 0.1, far: 1000, size2d: 5 };
535
+ const safeAspect = Number.isFinite(aspect) && aspect > 0 ? aspect : 1;
536
+ const view = mat4LookAt(props.position, props.lookAt);
537
+ const proj = ir.mode === "2d"
538
+ ? mat4Orthographic(props.size2d, safeAspect, props.near, props.far)
539
+ : mat4Perspective(props.fov, safeAspect, props.near, props.far);
540
+ return { view, proj, eye: props.position };
541
+ }
542
+ // ── lights (P1: ambient + one directional; P5 adds point lights + fog) ───────────────
543
+ export const POINT_LIGHT_DEFAULT_RANGE = 10;
544
+ /** the point-light cap: the first 4 in document order; a 5th+ drops with one diagnostic */
545
+ export const SCENE_MAX_POINT_LIGHTS = 4;
546
+ export function sceneLighting(ir, resolve, diag) {
547
+ const out = {
548
+ ambientIntensity: 0, ambientColor: "#ffffff",
549
+ direction: null, directionalIntensity: 0, directionalColor: "#ffffff",
550
+ points: [],
551
+ };
552
+ let sawAmbient = false;
553
+ let droppedPoints = 0;
554
+ for (const node of ir.nodes) {
555
+ if (node.kind !== "light")
556
+ continue;
557
+ const props = resolvedProps(node, resolve, diag);
558
+ if (props.lightKind === "point") {
559
+ if (out.points.length >= SCENE_MAX_POINT_LIGHTS) {
560
+ droppedPoints += 1;
561
+ continue;
562
+ }
563
+ out.points.push({
564
+ position: [...props.position],
565
+ color: props.color, intensity: props.intensity, range: props.range,
566
+ });
567
+ }
568
+ else if (props.lightKind === "directional") {
569
+ if (out.direction !== null)
570
+ continue; // P1: the first directional wins
571
+ const length = Math.hypot(...props.position);
572
+ out.direction = length === 0 ? [0, 1, 0] : [
573
+ props.position[0] / length, props.position[1] / length, props.position[2] / length,
574
+ ];
575
+ out.directionalIntensity = props.intensity;
576
+ out.directionalColor = props.color;
577
+ }
578
+ else if (!sawAmbient) {
579
+ sawAmbient = true;
580
+ out.ambientIntensity = props.intensity;
581
+ out.ambientColor = props.color;
582
+ }
583
+ }
584
+ if (droppedPoints > 0) {
585
+ diag?.({ code: "light_cap", message: `${out.points.length + droppedPoints} point lights authored — the cap is ${SCENE_MAX_POINT_LIGHTS}, ${droppedPoints} dropped` });
586
+ }
587
+ // an unlit scene still shows its shapes: full ambient is the honest default
588
+ if (!sawAmbient && out.direction === null && out.points.length === 0)
589
+ out.ambientIntensity = 1;
590
+ return out;
591
+ }
592
+ // ── the P5 lighting math (corpus lighting.json) ──────────────────────────────────────
593
+ /** THE POINT FALLOFF LAW (inverse-square with a smooth range window, pinned):
594
+ * attenuation(d, range) = window² / (1 + d²) with window = max(0, 1 − (d/range)⁴).
595
+ * 1 at d = 0, exactly 0 at and past `range`. A non-positive range attenuates to 0. */
596
+ export function scenePointAttenuation(distance, range) {
597
+ if (range <= 0)
598
+ return 0;
599
+ const ratio = distance / range;
600
+ const window = Math.max(0, 1 - ratio * ratio * ratio * ratio);
601
+ return window * window / (1 + distance * distance);
602
+ }
603
+ /** THE LIT-COLOR LAW (the flat-Lambert model all renderers share, extended by P5):
604
+ * lit = base · (ambient + dirColor·max(0, n·dirL) + Σᵢ colorᵢ·intensityᵢ·att(dᵢ)·max(0, n·Lᵢ))
605
+ * with Lᵢ = normalize(positionᵢ − point), dᵢ = |positionᵢ − point|; each channel
606
+ * clamps to [0, 1] at the end (the shader's min(c, 1)). n is normalized here. */
607
+ export function sceneLitColor(base, normal, point, ambient, directional, points) {
608
+ const nLen = Math.hypot(...normal);
609
+ const n = nLen === 0 ? [0, 0, 0] : [normal[0] / nLen, normal[1] / nLen, normal[2] / nLen];
610
+ const light = [ambient[0], ambient[1], ambient[2]];
611
+ if (directional !== null) {
612
+ const lambert = Math.max(0, n[0] * directional.dir[0] + n[1] * directional.dir[1] + n[2] * directional.dir[2]);
613
+ for (let c = 0; c < 3; c += 1)
614
+ light[c] += directional.color[c] * lambert;
615
+ }
616
+ for (const p of points) {
617
+ const toLight = [p.position[0] - point[0], p.position[1] - point[1], p.position[2] - point[2]];
618
+ const distance = Math.hypot(...toLight);
619
+ if (distance === 0)
620
+ continue; // L is undefined at the light's own position — contributes 0
621
+ const l = [toLight[0] / distance, toLight[1] / distance, toLight[2] / distance];
622
+ const lambert = Math.max(0, n[0] * l[0] + n[1] * l[1] + n[2] * l[2]);
623
+ const factor = p.intensity * scenePointAttenuation(distance, p.range) * lambert;
624
+ for (let c = 0; c < 3; c += 1)
625
+ light[c] += p.color[c] * factor;
626
+ }
627
+ return [
628
+ Math.min(1, base[0] * light[0]),
629
+ Math.min(1, base[1] * light[1]),
630
+ Math.min(1, base[2] * light[2]),
631
+ ];
632
+ }
633
+ /** `fog="#color near far"` on `<scene>` — linear fog. Malformed (bad color, non-finite
634
+ * numbers, far ≤ near) rejects the WHOLE attribute with one diagnostic — never a
635
+ * half-applied fog. null = no fog authored. */
636
+ export function sceneFog(ir, resolve, diag) {
637
+ const raw = ir.attrs["fog"];
638
+ if (raw === undefined)
639
+ return null;
640
+ const resolved = resolve(null, "fog", raw);
641
+ const parts = resolved.trim().split(/\s+/).filter((p) => p.length > 0);
642
+ const color = parts.length === 3 ? parseSceneColor(parts[0]) : null;
643
+ const near = parts.length === 3 ? Number(parts[1]) : NaN;
644
+ const far = parts.length === 3 ? Number(parts[2]) : NaN;
645
+ if (color === null || !Number.isFinite(near) || !Number.isFinite(far) || far <= near) {
646
+ diag?.({ code: "malformed_fog", message: `fog="${resolved}" is not "#color near far" with far > near — no fog` });
647
+ return null;
648
+ }
649
+ return { color: parts[0], near, far };
650
+ }
651
+ /** THE LINEAR FOG LAW: f = clamp((far − d)/(far − near), 0, 1) for d = the distance
652
+ * from the EYE to the fragment; final = f·lit + (1 − f)·fogColor (f = 1 unfogged at
653
+ * and before near, 0 fully fogged at and past far). */
654
+ export function sceneFogFactor(distance, near, far) {
655
+ return Math.min(Math.max((far - distance) / (far - near), 0), 1);
656
+ }
657
+ /** #rgb/#rrggbb → [r, g, b] in 0..1, or null (the caller diags + falls back) */
658
+ export function parseSceneColor(color) {
659
+ const hex = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(color.trim());
660
+ if (hex === null)
661
+ return null;
662
+ const body = hex[1];
663
+ const wide = body.length === 6 ? body : body.split("").map((c) => c + c).join("");
664
+ return [
665
+ parseInt(wide.slice(0, 2), 16) / 255,
666
+ parseInt(wide.slice(2, 4), 16) / 255,
667
+ parseInt(wide.slice(4, 6), 16) / 255,
668
+ ];
669
+ }
670
+ /** the picking bounding radius in LOCAL units for a geometry node (null = unpickable).
671
+ * The world-space radius scales by the world matrix's largest basis length. */
672
+ export function nodeBoundingRadius(node, props) {
673
+ if (node.kind === "box")
674
+ return Math.hypot(...props.boxSize) / 2;
675
+ if (node.kind === "sphere")
676
+ return props.radius;
677
+ if (node.kind === "plane")
678
+ return Math.hypot(props.planeSize[0], props.planeSize[1]) / 2;
679
+ // G6: a sprite picks by its quad's bounding circle (the texture-aspect refinement is
680
+ // a render-time detail — the resolved `size` is what picking and physics both read)
681
+ if (node.kind === "sprite")
682
+ return Math.hypot(props.spriteSize[0], props.spriteSize[1]) / 2;
683
+ return null;
684
+ }
685
+ /** world-space bounding sphere: center = world · origin, radius scaled by the largest
686
+ * world basis column (uniform-enough for v0 picking) */
687
+ export function worldBoundingSphere(world, localRadius) {
688
+ const center = [world[12], world[13], world[14]];
689
+ const scale = Math.max(Math.hypot(world[0], world[1], world[2]), Math.hypot(world[4], world[5], world[6]), Math.hypot(world[8], world[9], world[10]));
690
+ return { center, radius: localRadius * scale };
691
+ }
692
+ //# sourceMappingURL=ir.js.map