@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,644 @@
1
+ //
2
+ // auth-proof.ts — THE AUTHENTICATION PROOF PURE CORE (A1,
3
+ // the launch design notes). Two folds, and a
4
+ // login is the one flow where a fail-open default is a compromise:
5
+ //
6
+ // 1. THE TRIGGER FOLD — `matchesConfiguredTrigger` / `isAllowedAuthorizationUrl`.
7
+ // LoginHelper decides on every main-frame navigation whether the URL about to load is a
8
+ // configured identity provider; a match cancels the app's own navigation and hands the
9
+ // URL to a web view that carries a provider-accepted user agent and SHARES the app's
10
+ // cookie jar. A raw string prefix therefore gives anyone who controls
11
+ // `idp.example.attacker.invalid` a login surface wearing the IdP's clothes. A configured
12
+ // prefix that parses as an absolute URL is pinned to its exact scheme, host and port and
13
+ // refuses userinfo; one that does not parse keeps raw-prefix behaviour, because
14
+ // deployments configure bare host fragments and silently dropping them disables their
15
+ // logins.
16
+ //
17
+ // 2. THE PROOF FOLD — PKCE (RFC 7636), `state` (RFC 6749 §10.12, RFC 9700 §2.1) and OIDC
18
+ // `nonce`. Which proofs a module owns for a given authorize URL (adopt what the caller
19
+ // wrote, mint what is missing), the exact URL it builds, and the verdict a returning
20
+ // callback earns. `unproven` is the compatibility floor — a flow this module never armed
21
+ // keeps the behaviour it has today, because refusing there breaks working logins to fix
22
+ // nothing. Everything else refuses, and a refusal never resolves and never echoes the
23
+ // received value back: that value is attacker-controlled and a message is a log line.
24
+ //
25
+ // The law is the corpus, OpenSource/Conformance/auth/{trigger,pkce}.json; the Kotlin twin is
26
+ // :core AuthProof.kt and the Swift twin is Engine/Swift/AuthProof.swift.
27
+ //
28
+ // NOTHING here hashes and nothing here draws entropy. RFC 7636's S256 is
29
+ // BASE64URL-ENCODE(SHA256(ASCII(verifier))): the SHA-256 half is the platform's job
30
+ // (CryptoKit / MessageDigest / WebCrypto), exactly as crypto-core.ts says, and the CSPRNG
31
+ // behind a minted value is the platform's too. What lives here is the half that has no
32
+ // platform answer and would therefore drift — an ABNF, an alphabet, a dropped padding
33
+ // character, a URL parse, and a verdict — which is also what makes a login proof testable
34
+ // without an identity provider.
35
+ //
36
+ // PURE by construction: no DOM, no URL, no RegExp on any security decision, no imports. The
37
+ // URL splitter is hand-rolled precisely BECAUSE three platform URL parsers disagree about
38
+ // userinfo, backslashes and percent-escaped hosts, and a security fold cannot be the union of
39
+ // three parsers' bugs.
40
+ //
41
+ function isDigit(ch) { return ch >= "0" && ch <= "9"; }
42
+ function isAlpha(ch) { return (ch >= "a" && ch <= "z") || (ch >= "A" && ch <= "Z"); }
43
+ /** Characters that must never appear inside an authority. A backslash is the whole reason this
44
+ * list exists: some parsers normalize `\` to `/`, some do not, and `https://idp.example\@evil`
45
+ * therefore means two different hosts on two renderers. Anything ambiguous is refused, never
46
+ * guessed — the cost of a false refusal here is a login that is not intercepted, which is the
47
+ * behaviour the navigation already had. */
48
+ function authorityIsClean(authority) {
49
+ for (const ch of authority) {
50
+ const c = ch.charCodeAt(0);
51
+ if (c <= 0x20 || c === 0x7f)
52
+ return false;
53
+ if (ch === "\\" || ch === "<" || ch === ">" || ch === '"' || ch === "^" ||
54
+ ch === "{" || ch === "}" || ch === "|" || ch === "`")
55
+ return false;
56
+ }
57
+ return true;
58
+ }
59
+ /** Split an absolute `scheme://authority…` URL into its origin, or null when it is not one or
60
+ * is not unambiguous. A percent escape in the host is refused rather than decoded: `%2e` is a
61
+ * dot to some parsers and a literal to others, and either answer is a lookalike host. */
62
+ export function splitOrigin(raw) {
63
+ const text = String(raw ?? "");
64
+ if (text.length === 0)
65
+ return null;
66
+ let i = 0;
67
+ if (!isAlpha(text[0]))
68
+ return null;
69
+ while (i < text.length) {
70
+ const ch = text[i];
71
+ if (ch === ":")
72
+ break;
73
+ if (!isAlpha(ch) && !isDigit(ch) && ch !== "+" && ch !== "-" && ch !== ".")
74
+ return null;
75
+ i += 1;
76
+ }
77
+ if (i >= text.length || text[i] !== ":")
78
+ return null;
79
+ const scheme = text.slice(0, i).toLowerCase();
80
+ if (!text.startsWith("://", i))
81
+ return null;
82
+ let end = i + 3;
83
+ while (end < text.length) {
84
+ const ch = text[end];
85
+ if (ch === "/" || ch === "?" || ch === "#")
86
+ break;
87
+ end += 1;
88
+ }
89
+ const authority = text.slice(i + 3, end);
90
+ if (!authorityIsClean(authority))
91
+ return null;
92
+ const at = authority.lastIndexOf("@");
93
+ const hasUserInfo = at >= 0;
94
+ const hostPort = hasUserInfo ? authority.slice(at + 1) : authority;
95
+ let host = hostPort;
96
+ let port = -1;
97
+ if (hostPort.startsWith("[")) {
98
+ const close = hostPort.indexOf("]");
99
+ if (close < 0)
100
+ return null;
101
+ host = hostPort.slice(0, close + 1);
102
+ const rest = hostPort.slice(close + 1);
103
+ if (rest.length > 0) {
104
+ if (rest[0] !== ":")
105
+ return null;
106
+ const digits = rest.slice(1);
107
+ if (digits.length === 0)
108
+ return null;
109
+ for (const ch of digits)
110
+ if (!isDigit(ch))
111
+ return null;
112
+ port = Number(digits);
113
+ }
114
+ }
115
+ else {
116
+ const colon = hostPort.indexOf(":");
117
+ if (colon >= 0) {
118
+ host = hostPort.slice(0, colon);
119
+ const digits = hostPort.slice(colon + 1);
120
+ if (digits.length === 0)
121
+ return null;
122
+ for (const ch of digits)
123
+ if (!isDigit(ch))
124
+ return null;
125
+ port = Number(digits);
126
+ }
127
+ }
128
+ if (host.length === 0)
129
+ return null;
130
+ for (const ch of host)
131
+ if (ch === "%" || ch === ":" || ch === "@")
132
+ return null;
133
+ return { scheme, host: host.toLowerCase(), port, hasUserInfo };
134
+ }
135
+ /** Does this text CLAIM a URI scheme, whether or not it parses into an origin? The distinction
136
+ * matters exactly once, and it is a security decision: `https://` and `javascript:alert` both
137
+ * claim a scheme and neither yields an origin, so treating either as a legacy raw prefix would
138
+ * make the first match every https URL there is and the second hand a script URL to a login
139
+ * surface. A claim that does not parse is refused; only text that never claimed is legacy. */
140
+ export function claimsUriScheme(raw) {
141
+ const text = String(raw ?? "");
142
+ if (text.length === 0 || !isAlpha(text[0]))
143
+ return false;
144
+ let i = 0;
145
+ while (i < text.length) {
146
+ const ch = text[i];
147
+ if (ch === ":")
148
+ return true;
149
+ if (!isAlpha(ch) && !isDigit(ch) && ch !== "+" && ch !== "-" && ch !== ".")
150
+ return false;
151
+ i += 1;
152
+ }
153
+ return false;
154
+ }
155
+ /** The port an origin comparison uses: the written one, else the scheme's default, else -1 so
156
+ * two custom-scheme origins still compare equal to each other. */
157
+ export function normalizedPort(origin) {
158
+ if (origin.port >= 0)
159
+ return origin.port;
160
+ if (origin.scheme === "https")
161
+ return 443;
162
+ if (origin.scheme === "http")
163
+ return 80;
164
+ return -1;
165
+ }
166
+ // ─────────────────────────────────────────────────────────────────────────────
167
+ // 1 · THE TRIGGER FOLD — a configured login trigger is an origin, not a prefix
168
+ // ─────────────────────────────────────────────────────────────────────────────
169
+ /** Does `candidate` belong to the identity provider configured as `configuredPrefix`?
170
+ *
171
+ * The raw prefix is NECESSARY, never sufficient: it runs first so nothing that already failed
172
+ * the legacy test starts matching, and an absolute prefix then additionally pins scheme, host
173
+ * and port and refuses userinfo. Case is deliberately not folded on the prefix test — an
174
+ * uppercase host that fails the byte prefix simply is not intercepted, which is the direction
175
+ * that costs nothing. */
176
+ export function matchesConfiguredTrigger(candidate, configuredPrefix) {
177
+ const prefix = String(configuredPrefix ?? "");
178
+ const target = String(candidate ?? "");
179
+ if (prefix.length === 0 || !target.startsWith(prefix))
180
+ return false;
181
+ const trigger = splitOrigin(prefix);
182
+ if (trigger === null)
183
+ return !claimsUriScheme(prefix); // legacy non-URL prefix configuration
184
+ const actual = splitOrigin(target);
185
+ if (actual === null)
186
+ return false;
187
+ return actual.scheme === trigger.scheme &&
188
+ actual.host === trigger.host &&
189
+ normalizedPort(actual) === normalizedPort(trigger) &&
190
+ !actual.hasUserInfo;
191
+ }
192
+ /** May this URL be handed to a browser as an authorization START? Confidential transport, a
193
+ * real host, and no URL credentials: a `javascript:` / `intent:` / `file:` authorization start
194
+ * is not an authorization start, and userinfo in an authorization URL is a phishing primitive
195
+ * some browsers still render. */
196
+ export function isAllowedAuthorizationUrl(raw) {
197
+ const origin = splitOrigin(raw);
198
+ if (origin === null)
199
+ return false;
200
+ return origin.scheme === "https" && origin.host.length > 0 && !origin.hasUserInfo;
201
+ }
202
+ // ─────────────────────────────────────────────────────────────────────────────
203
+ // 2 · THE PROOF FOLD — base64url, the verifier ABNF, the S256 challenge
204
+ // ─────────────────────────────────────────────────────────────────────────────
205
+ /** RFC 7636 §4.1: code-verifier = 43*128unreserved. */
206
+ export const PKCE_VERIFIER_MIN_LENGTH = 43;
207
+ export const PKCE_VERIFIER_MAX_LENGTH = 128;
208
+ /** RFC 7636 §7.1: "a minimum of 256 bits of entropy… a 32-octet sequence". 32 octets
209
+ * base64url-encode to exactly 43 characters, which is also the ABNF floor — the two
210
+ * constraints meet, which is why 32 is the number and not a taste. */
211
+ export const PKCE_VERIFIER_ENTROPY_BYTES = 32;
212
+ /** `state` and `nonce` are unguessability tokens, not key material; 128 bits is the floor. */
213
+ export const AUTH_PROOF_ENTROPY_BYTES = 16;
214
+ /** The only challenge method this core will build. RFC 7636 §4.2 makes S256 mandatory to
215
+ * implement on the server, and `plain` exists only for clients that cannot hash — which
216
+ * describes no platform this runs on. */
217
+ export const PKCE_CHALLENGE_METHOD = "S256";
218
+ const B64URL = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
219
+ /** RFC 4648 §5 with "all trailing '=' characters omitted" (RFC 7636 §A). One encoder serves the
220
+ * verifier, the challenge, `state` and `nonce`, so a padding character can never appear in any
221
+ * of them. Octets are read unsigned so no runtime has to agree about signed bytes first. */
222
+ export function base64UrlNoPad(bytes) {
223
+ let out = "";
224
+ let i = 0;
225
+ const n = bytes.length;
226
+ while (i + 2 < n) {
227
+ const a = bytes[i] & 0xff, b = bytes[i + 1] & 0xff, c = bytes[i + 2] & 0xff;
228
+ out += B64URL[a >> 2] + B64URL[((a & 0x03) << 4) | (b >> 4)] +
229
+ B64URL[((b & 0x0f) << 2) | (c >> 6)] + B64URL[c & 0x3f];
230
+ i += 3;
231
+ }
232
+ const left = n - i;
233
+ if (left === 1) {
234
+ const a = bytes[i] & 0xff;
235
+ out += B64URL[a >> 2] + B64URL[(a & 0x03) << 4];
236
+ }
237
+ else if (left === 2) {
238
+ const a = bytes[i] & 0xff, b = bytes[i + 1] & 0xff;
239
+ out += B64URL[a >> 2] + B64URL[((a & 0x03) << 4) | (b >> 4)] + B64URL[(b & 0x0f) << 2];
240
+ }
241
+ return out;
242
+ }
243
+ /** RFC 4648 §5 the other way, to UTF-8 text. Refuses padding, refuses an alphabet outside
244
+ * base64url, refuses the impossible residue of one, and refuses bytes that are not UTF-8 —
245
+ * every one of those is a malformed token rather than something to salvage. */
246
+ export function base64UrlDecodeUtf8(segment) {
247
+ const text = String(segment ?? "");
248
+ if (text.length === 0 || text.length % 4 === 1)
249
+ return null;
250
+ const bytes = [];
251
+ let acc = 0;
252
+ let bits = 0;
253
+ for (const ch of text) {
254
+ const v = B64URL.indexOf(ch);
255
+ if (v < 0)
256
+ return null;
257
+ acc = (acc << 6) | v;
258
+ bits += 6;
259
+ if (bits >= 8) {
260
+ bits -= 8;
261
+ bytes.push((acc >> bits) & 0xff);
262
+ }
263
+ }
264
+ return utf8Decode(bytes);
265
+ }
266
+ /** A hand-rolled UTF-8 decode: `TextDecoder` substitutes U+FFFD for malformed input on the web
267
+ * and the JVM does something else again, so a shared fold cannot delegate. Overlong forms,
268
+ * surrogates and out-of-range scalars are refusals, not replacements. */
269
+ function utf8Decode(bytes) {
270
+ let out = "";
271
+ let i = 0;
272
+ while (i < bytes.length) {
273
+ const b0 = bytes[i];
274
+ let cp = 0;
275
+ let extra = 0;
276
+ let min = 0;
277
+ if (b0 < 0x80) {
278
+ cp = b0;
279
+ extra = 0;
280
+ min = 0;
281
+ }
282
+ else if (b0 >= 0xc2 && b0 <= 0xdf) {
283
+ cp = b0 & 0x1f;
284
+ extra = 1;
285
+ min = 0x80;
286
+ }
287
+ else if (b0 >= 0xe0 && b0 <= 0xef) {
288
+ cp = b0 & 0x0f;
289
+ extra = 2;
290
+ min = 0x800;
291
+ }
292
+ else if (b0 >= 0xf0 && b0 <= 0xf4) {
293
+ cp = b0 & 0x07;
294
+ extra = 3;
295
+ min = 0x10000;
296
+ }
297
+ else
298
+ return null;
299
+ if (i + extra >= bytes.length)
300
+ return null;
301
+ for (let k = 1; k <= extra; k += 1) {
302
+ const b = bytes[i + k];
303
+ if (b < 0x80 || b > 0xbf)
304
+ return null;
305
+ cp = (cp << 6) | (b & 0x3f);
306
+ }
307
+ if (cp < min)
308
+ return null;
309
+ if (cp > 0x10ffff)
310
+ return null;
311
+ if (cp >= 0xd800 && cp <= 0xdfff)
312
+ return null;
313
+ out += String.fromCodePoint(cp);
314
+ i += extra + 1;
315
+ }
316
+ return out;
317
+ }
318
+ /** RFC 7636 §4.1 verbatim: 43*128 of ALPHA / DIGIT / "-" / "." / "_" / "~". No trimming, no
319
+ * case folding — a verifier is compared byte for byte at the token endpoint, so a fold that
320
+ * accepts what the server will not is a login that dies there with a useless message. */
321
+ export function isCodeVerifier(value) {
322
+ const text = String(value ?? "");
323
+ if (text.length < PKCE_VERIFIER_MIN_LENGTH || text.length > PKCE_VERIFIER_MAX_LENGTH)
324
+ return false;
325
+ for (const ch of text) {
326
+ if ((ch >= "A" && ch <= "Z") || (ch >= "a" && ch <= "z") || (ch >= "0" && ch <= "9"))
327
+ continue;
328
+ if (ch === "-" || ch === "." || ch === "_" || ch === "~")
329
+ continue;
330
+ return false;
331
+ }
332
+ return true;
333
+ }
334
+ /** A verifier from platform entropy, or null when there is not enough of it. Expressed as a
335
+ * refusal rather than a short value on purpose: a silently-padded verifier is a weak one that
336
+ * still works, which is the failure nobody finds. */
337
+ export function codeVerifierFromEntropy(bytes) {
338
+ if (bytes.length < PKCE_VERIFIER_ENTROPY_BYTES)
339
+ return null;
340
+ return base64UrlNoPad(bytes);
341
+ }
342
+ /** A `state` or `nonce` from platform entropy, or null when there is not enough of it. */
343
+ export function opaqueProof(bytes) {
344
+ if (bytes.length < AUTH_PROOF_ENTROPY_BYTES)
345
+ return null;
346
+ return base64UrlNoPad(bytes);
347
+ }
348
+ /** RFC 7636 §4.2: code_challenge = BASE64URL-ENCODE(SHA256(ASCII(code_verifier))). The digest
349
+ * arrives already computed, because hashing is the platform's. A digest of any other length is
350
+ * refused rather than encoded: a short one produces a challenge the server accepts and no
351
+ * verifier can ever satisfy, which strands every login on that build. */
352
+ export function codeChallengeS256(digest) {
353
+ if (digest.length !== 32)
354
+ return null;
355
+ return base64UrlNoPad(digest);
356
+ }
357
+ /** Every proof comparison runs through here. No early return on the first differing byte and
358
+ * none on a length difference: both lengths and every position fold into one accumulator, so a
359
+ * wrong `state` costs the same time as a right one. */
360
+ export function constantTimeEquals(a, b) {
361
+ const left = String(a ?? "");
362
+ const right = String(b ?? "");
363
+ let diff = left.length ^ right.length;
364
+ const span = left.length > right.length ? left.length : right.length;
365
+ for (let i = 0; i < span; i += 1) {
366
+ const l = i < left.length ? left.charCodeAt(i) : 0;
367
+ const r = i < right.length ? right.charCodeAt(i) : 0;
368
+ diff |= l ^ r;
369
+ }
370
+ return diff === 0;
371
+ }
372
+ /** Percent-decode a query value the way a form-encoded query is read: `+` is a space, `%XX` is
373
+ * a byte, an incomplete escape is left literal rather than dropped. The authorization server
374
+ * echoes `state` back through this same encoding, so adopting it decoded is what makes the
375
+ * later comparison compare the same two things. */
376
+ function decodeQueryValue(raw) {
377
+ const bytes = [];
378
+ let i = 0;
379
+ while (i < raw.length) {
380
+ const ch = raw[i];
381
+ if (ch === "+") {
382
+ bytes.push(0x20);
383
+ i += 1;
384
+ continue;
385
+ }
386
+ if (ch === "%" && i + 2 < raw.length) {
387
+ const hi = hexValue(raw[i + 1]);
388
+ const lo = hexValue(raw[i + 2]);
389
+ if (hi >= 0 && lo >= 0) {
390
+ bytes.push((hi << 4) | lo);
391
+ i += 3;
392
+ continue;
393
+ }
394
+ }
395
+ for (const b of utf8Encode(ch))
396
+ bytes.push(b);
397
+ i += 1;
398
+ }
399
+ return utf8Decode(bytes) ?? "";
400
+ }
401
+ function hexValue(ch) {
402
+ if (ch >= "0" && ch <= "9")
403
+ return ch.charCodeAt(0) - 48;
404
+ if (ch >= "a" && ch <= "f")
405
+ return ch.charCodeAt(0) - 87;
406
+ if (ch >= "A" && ch <= "F")
407
+ return ch.charCodeAt(0) - 55;
408
+ return -1;
409
+ }
410
+ function utf8Encode(text) {
411
+ const out = [];
412
+ for (const ch of text) {
413
+ const cp = ch.codePointAt(0);
414
+ if (cp < 0x80)
415
+ out.push(cp);
416
+ else if (cp < 0x800)
417
+ out.push(0xc0 | (cp >> 6), 0x80 | (cp & 0x3f));
418
+ else if (cp < 0x10000)
419
+ out.push(0xe0 | (cp >> 12), 0x80 | ((cp >> 6) & 0x3f), 0x80 | (cp & 0x3f));
420
+ else
421
+ out.push(0xf0 | (cp >> 18), 0x80 | ((cp >> 12) & 0x3f), 0x80 | ((cp >> 6) & 0x3f), 0x80 | (cp & 0x3f));
422
+ }
423
+ return out;
424
+ }
425
+ /** The query string of a URL: everything between the first `?` and the first `#` after it. */
426
+ function queryOf(url) {
427
+ const hash = url.indexOf("#");
428
+ const stop = hash < 0 ? url.length : hash;
429
+ const q = url.indexOf("?");
430
+ if (q < 0 || q > stop)
431
+ return "";
432
+ return url.slice(q + 1, stop);
433
+ }
434
+ /** The first value of `name` in a form-encoded query, decoded, or null. An empty value is null:
435
+ * `state=` is not a state, it is a caller who built the parameter and forgot the value. */
436
+ function queryValue(query, name) {
437
+ let i = 0;
438
+ while (i <= query.length) {
439
+ let end = query.indexOf("&", i);
440
+ if (end < 0)
441
+ end = query.length;
442
+ const pair = query.slice(i, end);
443
+ i = end + 1;
444
+ if (pair.length === 0)
445
+ continue;
446
+ const eq = pair.indexOf("=");
447
+ const key = decodeQueryValue(eq < 0 ? pair : pair.slice(0, eq));
448
+ if (key !== name)
449
+ continue;
450
+ if (eq < 0)
451
+ return null;
452
+ const value = decodeQueryValue(pair.slice(eq + 1));
453
+ return value.length === 0 ? null : value;
454
+ }
455
+ return null;
456
+ }
457
+ /** Does a space-separated `response_type` carry `token` (bare) as a token? */
458
+ function responseTypeHas(responseType, token) {
459
+ if (responseType === null)
460
+ return false;
461
+ for (const part of responseType.split(" ")) {
462
+ if (part.toLowerCase() === token)
463
+ return true;
464
+ }
465
+ return false;
466
+ }
467
+ /** Which proofs this module owns for `authorizeUrl`.
468
+ *
469
+ * A parameter already in the URL is ADOPTED — the caller built it, the module verifies what
470
+ * comes back — and one that is absent is MINTED. That is what makes this non-breaking: every
471
+ * integration shipped against the old contract keeps the exact authorize URL it built, plus a
472
+ * `state` it did not have to write.
473
+ *
474
+ * `nonce` is owned only for an OIDC request (`scope` contains `openid`, or `response_type`
475
+ * contains `id_token`): minting one onto a plain OAuth request is noise, and RFC 9700 §2.1
476
+ * says PKCE carries the same protection.
477
+ *
478
+ * PKCE is ON BY DEFAULT in Core/Auth/OAuth (RFC 9700 §2.1.1, RFC 8252 §8.1): the package passes
479
+ * `wantsPkce` true for a code flow without a `code_challenge` of its own. This fold only applies
480
+ * that answer: a challenge the caller (or its backend) already wrote is kept, and a `wantsPkce`
481
+ * request that cannot take one is refused. A module-minted verifier is one the module must
482
+ * redeem, so a code the caller's server exchanges carries the server's own challenge. */
483
+ export function planAuthorizeProofs(authorizeUrl, wantsPkce) {
484
+ const query = queryOf(String(authorizeUrl ?? ""));
485
+ const state = queryValue(query, "state");
486
+ const nonce = queryValue(query, "nonce");
487
+ const challenge = queryValue(query, "code_challenge");
488
+ const responseType = queryValue(query, "response_type");
489
+ const scope = queryValue(query, "scope");
490
+ const isCodeFlow = responseTypeHas(responseType, "code");
491
+ if (wantsPkce && (challenge !== null || !isCodeFlow)) {
492
+ return {
493
+ refusal: "pkce_unsupported",
494
+ mintState: false, adoptedState: null, mintNonce: false, adoptedNonce: null, mintPkce: false,
495
+ };
496
+ }
497
+ const oidc = responseTypeHas(responseType, "id_token") ||
498
+ (scope !== null && scope.split(" ").some((s) => s.toLowerCase() === "openid"));
499
+ return {
500
+ refusal: null,
501
+ mintState: state === null,
502
+ adoptedState: state,
503
+ mintNonce: oidc && nonce === null,
504
+ adoptedNonce: nonce,
505
+ mintPkce: wantsPkce,
506
+ };
507
+ }
508
+ /** Percent-escape everything outside RFC 3986's unreserved set. Minted values are base64url and
509
+ * pass through untouched; the escaping exists so a value that came from somewhere else can
510
+ * never break out of its parameter. */
511
+ function encodeQueryValue(value) {
512
+ let out = "";
513
+ for (const b of utf8Encode(value)) {
514
+ const ch = String.fromCharCode(b);
515
+ if ((ch >= "A" && ch <= "Z") || (ch >= "a" && ch <= "z") || (ch >= "0" && ch <= "9") ||
516
+ ch === "-" || ch === "." || ch === "_" || ch === "~") {
517
+ out += ch;
518
+ }
519
+ else {
520
+ out += "%" + b.toString(16).toUpperCase().padStart(2, "0");
521
+ }
522
+ }
523
+ return out;
524
+ }
525
+ /** The authorize URL with the minted parameters appended, in a fixed order so three runtimes
526
+ * build the same string. Appending, never rewriting: the caller's URL is reproduced byte for
527
+ * byte. A fragment stays last, because a query appended after a fragment is not a query. */
528
+ export function applyAuthorizeProofs(authorizeUrl, minted) {
529
+ const url = String(authorizeUrl ?? "");
530
+ const pairs = [];
531
+ if (minted.state !== undefined && minted.state !== null && minted.state.length > 0) {
532
+ pairs.push("state=" + encodeQueryValue(minted.state));
533
+ }
534
+ if (minted.nonce !== undefined && minted.nonce !== null && minted.nonce.length > 0) {
535
+ pairs.push("nonce=" + encodeQueryValue(minted.nonce));
536
+ }
537
+ if (minted.challenge !== undefined && minted.challenge !== null && minted.challenge.length > 0) {
538
+ pairs.push("code_challenge=" + encodeQueryValue(minted.challenge));
539
+ pairs.push("code_challenge_method=" + PKCE_CHALLENGE_METHOD);
540
+ }
541
+ if (pairs.length === 0)
542
+ return url;
543
+ const hash = url.indexOf("#");
544
+ const head = hash < 0 ? url : url.slice(0, hash);
545
+ const tail = hash < 0 ? "" : url.slice(hash);
546
+ const q = head.indexOf("?");
547
+ const joiner = q < 0 ? "?" : (head.endsWith("?") || head.endsWith("&") ? "" : "&");
548
+ return head + joiner + pairs.join("&") + tail;
549
+ }
550
+ /** The verdict a returning callback earns.
551
+ *
552
+ * `unproven` is the compatibility floor and is deliberately permissive: a cold start after the
553
+ * process died behind the browser, or a deep link that is not a callback at all, has no armed
554
+ * expectation, and refusing there would break working logins to fix nothing.
555
+ *
556
+ * `replayed` exists because clearing the expectation on success is not enough. A one-shot
557
+ * authorization code replayed a second later would otherwise land in the `unproven` arm and be
558
+ * delivered, which is the exact attack `state` is there to stop. */
559
+ export function verifyCallbackProofs(expectedState, consumedStates, receivedState, expectedNonce, idTokenNonce) {
560
+ const expected = expectedState === undefined || expectedState === null || expectedState.length === 0
561
+ ? null : expectedState;
562
+ const received = receivedState === undefined || receivedState === null || receivedState.length === 0
563
+ ? null : receivedState;
564
+ if (expected === null) {
565
+ if (received !== null) {
566
+ for (const seen of consumedStates) {
567
+ if (constantTimeEquals(seen, received))
568
+ return "replayed";
569
+ }
570
+ }
571
+ return "unproven";
572
+ }
573
+ if (received === null)
574
+ return "missing_state";
575
+ if (!constantTimeEquals(expected, received))
576
+ return "state_mismatch";
577
+ const wantNonce = expectedNonce === undefined || expectedNonce === null || expectedNonce.length === 0
578
+ ? null : expectedNonce;
579
+ if (wantNonce === null)
580
+ return "ok";
581
+ // No id_token in this callback means the nonce rides the token exchange instead; an id_token
582
+ // that carries no nonce claim at all, against an armed nonce, is the injection this refuses.
583
+ if (idTokenNonce === undefined || idTokenNonce === null)
584
+ return "ok";
585
+ return constantTimeEquals(wantNonce, idTokenNonce) ? "ok" : "nonce_mismatch";
586
+ }
587
+ /** RFC 9207 §2.4: may this authorization response be processed, judged by its `iss`?
588
+ *
589
+ * `expectedIssuer` is the issuer the caller armed for this request (absent: nothing to judge,
590
+ * so true). A present `iss` must equal it by simple string comparison (RFC 3986 §6.2.1, which
591
+ * RFC 9207 §2.4 names), never normalized. An absent `iss` is accepted unless the caller said the
592
+ * server advertises `authorization_response_iss_parameter_supported`, in which case RFC 9207
593
+ * §2.4 makes it a MUST to reject. Error responses carry `iss` too (RFC 9207 §2), so the lanes
594
+ * run this before reading `error`. https://www.rfc-editor.org/rfc/rfc9207.html#section-2.4 */
595
+ export function issuerMatches(expectedIssuer, issuerRequired, receivedIssuer) {
596
+ const expected = expectedIssuer === undefined || expectedIssuer === null || expectedIssuer.length === 0
597
+ ? null : expectedIssuer;
598
+ if (expected === null)
599
+ return true;
600
+ const received = receivedIssuer === undefined || receivedIssuer === null ? null : receivedIssuer;
601
+ if (received === null)
602
+ return !issuerRequired;
603
+ return constantTimeEquals(expected, received);
604
+ }
605
+ /** A JWT's middle segment, base64url-decoded to UTF-8, and nothing else. The signature is NOT
606
+ * checked and the result has exactly one use: REFUSING a callback whose nonce does not match.
607
+ * It never makes a token valid, and reading the claim out of the returned JSON is each
608
+ * renderer's own parser — which is why this stops at the decoded string. */
609
+ export function idTokenPayload(jwt) {
610
+ const text = String(jwt ?? "");
611
+ const first = text.indexOf(".");
612
+ if (first < 0)
613
+ return null;
614
+ const second = text.indexOf(".", first + 1);
615
+ if (second < 0)
616
+ return null;
617
+ if (text.indexOf(".", second + 1) >= 0)
618
+ return null;
619
+ return base64UrlDecodeUtf8(text.slice(first + 1, second));
620
+ }
621
+ // ─────────────────────────────────────────────────────────────────────────────
622
+ // 5 · THE VERIFIER RELEASE BOUNDARY
623
+ // ─────────────────────────────────────────────────────────────────────────────
624
+ /** May a module-minted verifier be sent to this token endpoint?
625
+ *
626
+ * The verifier is the one secret this core's consumer holds, and the token exchange is the
627
+ * only path that sends it anywhere. The destination is therefore not the caller's to choose
628
+ * freely: it must be an https origin the APP declared in config. An empty declaration allows
629
+ * nothing, so a build that never opted in cannot leak a verifier at all — the fail-closed
630
+ * direction, and the reason this is an allowlist rather than a shape check. */
631
+ export function tokenEndpointAllowed(tokenUrl, declaredOrigins) {
632
+ const target = splitOrigin(tokenUrl);
633
+ if (target === null || target.scheme !== "https" || target.hasUserInfo)
634
+ return false;
635
+ for (const declared of declaredOrigins) {
636
+ const origin = splitOrigin(declared);
637
+ if (origin === null || origin.scheme !== "https")
638
+ continue;
639
+ if (origin.host === target.host && normalizedPort(origin) === normalizedPort(target))
640
+ return true;
641
+ }
642
+ return false;
643
+ }
644
+ //# sourceMappingURL=auth-proof.js.map