@abraca/junis 2.80.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (383) hide show
  1. package/README.md +594 -0
  2. package/dist/module.d.mts +158 -0
  3. package/dist/module.json +12 -0
  4. package/dist/module.mjs +957 -0
  5. package/dist/runtime/assets/css/jun.css +13 -0
  6. package/dist/runtime/components/JunAnnouncement.d.vue.ts +3 -0
  7. package/dist/runtime/components/JunAnnouncement.vue +88 -0
  8. package/dist/runtime/components/JunAnnouncement.vue.d.ts +3 -0
  9. package/dist/runtime/components/JunAppreciate.d.vue.ts +6 -0
  10. package/dist/runtime/components/JunAppreciate.vue +71 -0
  11. package/dist/runtime/components/JunAppreciate.vue.d.ts +6 -0
  12. package/dist/runtime/components/JunBackgroundPhoto.d.vue.ts +3 -0
  13. package/dist/runtime/components/JunBackgroundPhoto.vue +23 -0
  14. package/dist/runtime/components/JunBackgroundPhoto.vue.d.ts +3 -0
  15. package/dist/runtime/components/JunBlobBackdrop.client.d.vue.ts +3 -0
  16. package/dist/runtime/components/JunBlobBackdrop.client.vue +120 -0
  17. package/dist/runtime/components/JunBlobBackdrop.client.vue.d.ts +3 -0
  18. package/dist/runtime/components/JunBreadcrumbs.d.vue.ts +16 -0
  19. package/dist/runtime/components/JunBreadcrumbs.vue +63 -0
  20. package/dist/runtime/components/JunBreadcrumbs.vue.d.ts +16 -0
  21. package/dist/runtime/components/JunCampfireChat.d.vue.ts +14 -0
  22. package/dist/runtime/components/JunCampfireChat.vue +136 -0
  23. package/dist/runtime/components/JunCampfireChat.vue.d.ts +14 -0
  24. package/dist/runtime/components/JunCampfirePanel.d.vue.ts +33 -0
  25. package/dist/runtime/components/JunCampfirePanel.vue +202 -0
  26. package/dist/runtime/components/JunCampfirePanel.vue.d.ts +33 -0
  27. package/dist/runtime/components/JunCampfirePresence.client.d.vue.ts +3 -0
  28. package/dist/runtime/components/JunCampfirePresence.client.vue +321 -0
  29. package/dist/runtime/components/JunCampfirePresence.client.vue.d.ts +3 -0
  30. package/dist/runtime/components/JunCampfireRoster.d.vue.ts +19 -0
  31. package/dist/runtime/components/JunCampfireRoster.vue +259 -0
  32. package/dist/runtime/components/JunCampfireRoster.vue.d.ts +19 -0
  33. package/dist/runtime/components/JunCampfireYou.d.vue.ts +10 -0
  34. package/dist/runtime/components/JunCampfireYou.vue +157 -0
  35. package/dist/runtime/components/JunCampfireYou.vue.d.ts +10 -0
  36. package/dist/runtime/components/JunDocSurface.d.vue.ts +34 -0
  37. package/dist/runtime/components/JunDocSurface.vue +117 -0
  38. package/dist/runtime/components/JunDocSurface.vue.d.ts +34 -0
  39. package/dist/runtime/components/JunFestivalPlayer.client.d.vue.ts +3 -0
  40. package/dist/runtime/components/JunFestivalPlayer.client.vue +471 -0
  41. package/dist/runtime/components/JunFestivalPlayer.client.vue.d.ts +3 -0
  42. package/dist/runtime/components/JunFooter.d.vue.ts +3 -0
  43. package/dist/runtime/components/JunFooter.vue +102 -0
  44. package/dist/runtime/components/JunFooter.vue.d.ts +3 -0
  45. package/dist/runtime/components/JunGlobeEditor.client.d.vue.ts +43 -0
  46. package/dist/runtime/components/JunGlobeEditor.client.vue +315 -0
  47. package/dist/runtime/components/JunGlobeEditor.client.vue.d.ts +43 -0
  48. package/dist/runtime/components/JunGlobeMap.client.d.vue.ts +58 -0
  49. package/dist/runtime/components/JunGlobeMap.client.vue +495 -0
  50. package/dist/runtime/components/JunGlobeMap.client.vue.d.ts +58 -0
  51. package/dist/runtime/components/JunHead.d.vue.ts +3 -0
  52. package/dist/runtime/components/JunHead.vue +79 -0
  53. package/dist/runtime/components/JunHead.vue.d.ts +3 -0
  54. package/dist/runtime/components/JunHorizontalTimeline.d.vue.ts +0 -0
  55. package/dist/runtime/components/JunHorizontalTimeline.vue +363 -0
  56. package/dist/runtime/components/JunHorizontalTimeline.vue.d.ts +0 -0
  57. package/dist/runtime/components/JunImagePopup.client.d.vue.ts +3 -0
  58. package/dist/runtime/components/JunImagePopup.client.vue +422 -0
  59. package/dist/runtime/components/JunImagePopup.client.vue.d.ts +3 -0
  60. package/dist/runtime/components/JunIntro.d.vue.ts +3 -0
  61. package/dist/runtime/components/JunIntro.vue +156 -0
  62. package/dist/runtime/components/JunIntro.vue.d.ts +3 -0
  63. package/dist/runtime/components/JunItemMenu.d.vue.ts +50 -0
  64. package/dist/runtime/components/JunItemMenu.vue +97 -0
  65. package/dist/runtime/components/JunItemMenu.vue.d.ts +50 -0
  66. package/dist/runtime/components/JunLinksRow.d.vue.ts +19 -0
  67. package/dist/runtime/components/JunLinksRow.vue +96 -0
  68. package/dist/runtime/components/JunLinksRow.vue.d.ts +19 -0
  69. package/dist/runtime/components/JunLogo.d.vue.ts +15 -0
  70. package/dist/runtime/components/JunLogo.vue +360 -0
  71. package/dist/runtime/components/JunLogo.vue.d.ts +15 -0
  72. package/dist/runtime/components/JunMedia.client.d.vue.ts +40 -0
  73. package/dist/runtime/components/JunMedia.client.vue +117 -0
  74. package/dist/runtime/components/JunMedia.client.vue.d.ts +40 -0
  75. package/dist/runtime/components/JunMosaicPane.client.d.vue.ts +24 -0
  76. package/dist/runtime/components/JunMosaicPane.client.vue +95 -0
  77. package/dist/runtime/components/JunMosaicPane.client.vue.d.ts +24 -0
  78. package/dist/runtime/components/JunNavigation.d.vue.ts +26 -0
  79. package/dist/runtime/components/JunNavigation.vue +1149 -0
  80. package/dist/runtime/components/JunNavigation.vue.d.ts +26 -0
  81. package/dist/runtime/components/JunNodePanel.client.d.vue.ts +3 -0
  82. package/dist/runtime/components/JunNodePanel.client.vue +23 -0
  83. package/dist/runtime/components/JunNodePanel.client.vue.d.ts +3 -0
  84. package/dist/runtime/components/JunNotFound.d.vue.ts +7 -0
  85. package/dist/runtime/components/JunNotFound.vue +137 -0
  86. package/dist/runtime/components/JunNotFound.vue.d.ts +7 -0
  87. package/dist/runtime/components/JunPageHero.d.vue.ts +25 -0
  88. package/dist/runtime/components/JunPageHero.vue +90 -0
  89. package/dist/runtime/components/JunPageHero.vue.d.ts +25 -0
  90. package/dist/runtime/components/JunPatternBackdrop.client.d.vue.ts +7 -0
  91. package/dist/runtime/components/JunPatternBackdrop.client.vue +95 -0
  92. package/dist/runtime/components/JunPatternBackdrop.client.vue.d.ts +7 -0
  93. package/dist/runtime/components/JunPeerCursors.client.d.vue.ts +3 -0
  94. package/dist/runtime/components/JunPeerCursors.client.vue +123 -0
  95. package/dist/runtime/components/JunPeerCursors.client.vue.d.ts +3 -0
  96. package/dist/runtime/components/JunPresenceBlobs.client.d.vue.ts +3 -0
  97. package/dist/runtime/components/JunPresenceBlobs.client.vue +172 -0
  98. package/dist/runtime/components/JunPresenceBlobs.client.vue.d.ts +3 -0
  99. package/dist/runtime/components/JunSearch.client.d.vue.ts +3 -0
  100. package/dist/runtime/components/JunSearch.client.vue +809 -0
  101. package/dist/runtime/components/JunSearch.client.vue.d.ts +3 -0
  102. package/dist/runtime/components/JunServiceCard.d.vue.ts +10 -0
  103. package/dist/runtime/components/JunServiceCard.vue +145 -0
  104. package/dist/runtime/components/JunServiceCard.vue.d.ts +10 -0
  105. package/dist/runtime/components/JunShaderBackdrop.client.d.vue.ts +3 -0
  106. package/dist/runtime/components/JunShaderBackdrop.client.vue +82 -0
  107. package/dist/runtime/components/JunShaderBackdrop.client.vue.d.ts +3 -0
  108. package/dist/runtime/components/JunShell.d.vue.ts +17 -0
  109. package/dist/runtime/components/JunShell.vue +80 -0
  110. package/dist/runtime/components/JunShell.vue.d.ts +17 -0
  111. package/dist/runtime/components/JunStudioBar.client.d.vue.ts +3 -0
  112. package/dist/runtime/components/JunStudioBar.client.vue +462 -0
  113. package/dist/runtime/components/JunStudioBar.client.vue.d.ts +3 -0
  114. package/dist/runtime/components/JunStudioLogin.client.d.vue.ts +3 -0
  115. package/dist/runtime/components/JunStudioLogin.client.vue +58 -0
  116. package/dist/runtime/components/JunStudioLogin.client.vue.d.ts +3 -0
  117. package/dist/runtime/components/JunThemeToggle.d.vue.ts +3 -0
  118. package/dist/runtime/components/JunThemeToggle.vue +32 -0
  119. package/dist/runtime/components/JunThemeToggle.vue.d.ts +3 -0
  120. package/dist/runtime/components/JunTravellersChip.d.vue.ts +9 -0
  121. package/dist/runtime/components/JunTravellersChip.vue +111 -0
  122. package/dist/runtime/components/JunTravellersChip.vue.d.ts +9 -0
  123. package/dist/runtime/components/JunVideoEmbed.client.d.vue.ts +23 -0
  124. package/dist/runtime/components/JunVideoEmbed.client.vue +124 -0
  125. package/dist/runtime/components/JunVideoEmbed.client.vue.d.ts +23 -0
  126. package/dist/runtime/components/css-modules.d.ts +7 -0
  127. package/dist/runtime/components/renderers/.gitkeep +0 -0
  128. package/dist/runtime/components/renderers/JunAppsRenderer.d.vue.ts +10 -0
  129. package/dist/runtime/components/renderers/JunAppsRenderer.vue +271 -0
  130. package/dist/runtime/components/renderers/JunAppsRenderer.vue.d.ts +10 -0
  131. package/dist/runtime/components/renderers/JunCinemaRenderer.d.vue.ts +10 -0
  132. package/dist/runtime/components/renderers/JunCinemaRenderer.vue +465 -0
  133. package/dist/runtime/components/renderers/JunCinemaRenderer.vue.d.ts +10 -0
  134. package/dist/runtime/components/renderers/JunConfigRenderer.d.vue.ts +10 -0
  135. package/dist/runtime/components/renderers/JunConfigRenderer.vue +2045 -0
  136. package/dist/runtime/components/renderers/JunConfigRenderer.vue.d.ts +10 -0
  137. package/dist/runtime/components/renderers/JunCvRenderer.d.vue.ts +10 -0
  138. package/dist/runtime/components/renderers/JunCvRenderer.vue +256 -0
  139. package/dist/runtime/components/renderers/JunCvRenderer.vue.d.ts +10 -0
  140. package/dist/runtime/components/renderers/JunEntryRenderer.d.vue.ts +10 -0
  141. package/dist/runtime/components/renderers/JunEntryRenderer.vue +429 -0
  142. package/dist/runtime/components/renderers/JunEntryRenderer.vue.d.ts +10 -0
  143. package/dist/runtime/components/renderers/JunFestivalRenderer.d.vue.ts +10 -0
  144. package/dist/runtime/components/renderers/JunFestivalRenderer.vue +557 -0
  145. package/dist/runtime/components/renderers/JunFestivalRenderer.vue.d.ts +10 -0
  146. package/dist/runtime/components/renderers/JunGlobeRenderer.d.vue.ts +10 -0
  147. package/dist/runtime/components/renderers/JunGlobeRenderer.vue +91 -0
  148. package/dist/runtime/components/renderers/JunGlobeRenderer.vue.d.ts +10 -0
  149. package/dist/runtime/components/renderers/JunGuestbookRenderer.d.vue.ts +10 -0
  150. package/dist/runtime/components/renderers/JunGuestbookRenderer.vue +326 -0
  151. package/dist/runtime/components/renderers/JunGuestbookRenderer.vue.d.ts +10 -0
  152. package/dist/runtime/components/renderers/JunHomeRenderer.d.vue.ts +10 -0
  153. package/dist/runtime/components/renderers/JunHomeRenderer.vue +585 -0
  154. package/dist/runtime/components/renderers/JunHomeRenderer.vue.d.ts +10 -0
  155. package/dist/runtime/components/renderers/JunJournalRenderer.d.vue.ts +10 -0
  156. package/dist/runtime/components/renderers/JunJournalRenderer.vue +420 -0
  157. package/dist/runtime/components/renderers/JunJournalRenderer.vue.d.ts +10 -0
  158. package/dist/runtime/components/renderers/JunLibraryRenderer.d.vue.ts +10 -0
  159. package/dist/runtime/components/renderers/JunLibraryRenderer.vue +319 -0
  160. package/dist/runtime/components/renderers/JunLibraryRenderer.vue.d.ts +10 -0
  161. package/dist/runtime/components/renderers/JunLinksRenderer.d.vue.ts +10 -0
  162. package/dist/runtime/components/renderers/JunLinksRenderer.vue +206 -0
  163. package/dist/runtime/components/renderers/JunLinksRenderer.vue.d.ts +10 -0
  164. package/dist/runtime/components/renderers/JunLiveRenderer.d.vue.ts +10 -0
  165. package/dist/runtime/components/renderers/JunLiveRenderer.vue +684 -0
  166. package/dist/runtime/components/renderers/JunLiveRenderer.vue.d.ts +10 -0
  167. package/dist/runtime/components/renderers/JunMosaicRenderer.d.vue.ts +10 -0
  168. package/dist/runtime/components/renderers/JunMosaicRenderer.vue +572 -0
  169. package/dist/runtime/components/renderers/JunMosaicRenderer.vue.d.ts +10 -0
  170. package/dist/runtime/components/renderers/JunMovieRenderer.d.vue.ts +10 -0
  171. package/dist/runtime/components/renderers/JunMovieRenderer.vue +539 -0
  172. package/dist/runtime/components/renderers/JunMovieRenderer.vue.d.ts +10 -0
  173. package/dist/runtime/components/renderers/JunNowRenderer.d.vue.ts +10 -0
  174. package/dist/runtime/components/renderers/JunNowRenderer.vue +382 -0
  175. package/dist/runtime/components/renderers/JunNowRenderer.vue.d.ts +10 -0
  176. package/dist/runtime/components/renderers/JunProjectRenderer.d.vue.ts +10 -0
  177. package/dist/runtime/components/renderers/JunProjectRenderer.vue +413 -0
  178. package/dist/runtime/components/renderers/JunProjectRenderer.vue.d.ts +10 -0
  179. package/dist/runtime/components/renderers/JunRedirectRenderer.d.vue.ts +10 -0
  180. package/dist/runtime/components/renderers/JunRedirectRenderer.vue +133 -0
  181. package/dist/runtime/components/renderers/JunRedirectRenderer.vue.d.ts +10 -0
  182. package/dist/runtime/components/renderers/JunServicesRenderer.d.vue.ts +10 -0
  183. package/dist/runtime/components/renderers/JunServicesRenderer.vue +267 -0
  184. package/dist/runtime/components/renderers/JunServicesRenderer.vue.d.ts +10 -0
  185. package/dist/runtime/components/renderers/JunStatsRenderer.d.vue.ts +10 -0
  186. package/dist/runtime/components/renderers/JunStatsRenderer.vue +230 -0
  187. package/dist/runtime/components/renderers/JunStatsRenderer.vue.d.ts +10 -0
  188. package/dist/runtime/components/renderers/JunTrackRenderer.d.vue.ts +10 -0
  189. package/dist/runtime/components/renderers/JunTrackRenderer.vue +380 -0
  190. package/dist/runtime/components/renderers/JunTrackRenderer.vue.d.ts +10 -0
  191. package/dist/runtime/components/renderers/JunUsesRenderer.d.vue.ts +10 -0
  192. package/dist/runtime/components/renderers/JunUsesRenderer.vue +254 -0
  193. package/dist/runtime/components/renderers/JunUsesRenderer.vue.d.ts +10 -0
  194. package/dist/runtime/components/renderers/JunWallRenderer.d.vue.ts +10 -0
  195. package/dist/runtime/components/renderers/JunWallRenderer.vue +276 -0
  196. package/dist/runtime/components/renderers/JunWallRenderer.vue.d.ts +10 -0
  197. package/dist/runtime/components/renderers/JunWindowRenderer.d.vue.ts +10 -0
  198. package/dist/runtime/components/renderers/JunWindowRenderer.vue +516 -0
  199. package/dist/runtime/components/renderers/JunWindowRenderer.vue.d.ts +10 -0
  200. package/dist/runtime/composables/useJunBackdrop.d.ts +9 -0
  201. package/dist/runtime/composables/useJunBackdrop.js +27 -0
  202. package/dist/runtime/composables/useJunBackground.d.ts +78 -0
  203. package/dist/runtime/composables/useJunBackground.js +65 -0
  204. package/dist/runtime/composables/useJunCampfire.d.ts +156 -0
  205. package/dist/runtime/composables/useJunCampfire.js +225 -0
  206. package/dist/runtime/composables/useJunChrome.d.ts +66 -0
  207. package/dist/runtime/composables/useJunChrome.js +233 -0
  208. package/dist/runtime/composables/useJunColorMode.d.ts +8 -0
  209. package/dist/runtime/composables/useJunColorMode.js +11 -0
  210. package/dist/runtime/composables/useJunCommands.d.ts +37 -0
  211. package/dist/runtime/composables/useJunCommands.js +225 -0
  212. package/dist/runtime/composables/useJunCreatePage.d.ts +17 -0
  213. package/dist/runtime/composables/useJunCreatePage.js +30 -0
  214. package/dist/runtime/composables/useJunCurrentDoc.d.ts +5 -0
  215. package/dist/runtime/composables/useJunCurrentDoc.js +14 -0
  216. package/dist/runtime/composables/useJunDocMenu.d.ts +71 -0
  217. package/dist/runtime/composables/useJunDocMenu.js +344 -0
  218. package/dist/runtime/composables/useJunDocPage.d.ts +99 -0
  219. package/dist/runtime/composables/useJunDocPage.js +155 -0
  220. package/dist/runtime/composables/useJunFollow.d.ts +11 -0
  221. package/dist/runtime/composables/useJunFollow.js +38 -0
  222. package/dist/runtime/composables/useJunGroupedDnD.d.ts +74 -0
  223. package/dist/runtime/composables/useJunGroupedDnD.js +186 -0
  224. package/dist/runtime/composables/useJunImagePopup.d.ts +37 -0
  225. package/dist/runtime/composables/useJunImagePopup.js +24 -0
  226. package/dist/runtime/composables/useJunIntro.d.ts +7 -0
  227. package/dist/runtime/composables/useJunIntro.js +8 -0
  228. package/dist/runtime/composables/useJunListDnD.d.ts +65 -0
  229. package/dist/runtime/composables/useJunListDnD.js +159 -0
  230. package/dist/runtime/composables/useJunMediaImport.d.ts +27 -0
  231. package/dist/runtime/composables/useJunMediaImport.js +90 -0
  232. package/dist/runtime/composables/useJunNavSettings.d.ts +57 -0
  233. package/dist/runtime/composables/useJunNavSettings.js +74 -0
  234. package/dist/runtime/composables/useJunNodePanel.d.ts +41 -0
  235. package/dist/runtime/composables/useJunNodePanel.js +36 -0
  236. package/dist/runtime/composables/useJunOpenDoc.d.ts +7 -0
  237. package/dist/runtime/composables/useJunOpenDoc.js +30 -0
  238. package/dist/runtime/composables/useJunOptions.d.ts +68 -0
  239. package/dist/runtime/composables/useJunOptions.js +68 -0
  240. package/dist/runtime/composables/useJunPalette.d.ts +16 -0
  241. package/dist/runtime/composables/useJunPalette.js +72 -0
  242. package/dist/runtime/composables/useJunPeopleAdmin.d.ts +69 -0
  243. package/dist/runtime/composables/useJunPeopleAdmin.js +73 -0
  244. package/dist/runtime/composables/useJunPlayer.d.ts +99 -0
  245. package/dist/runtime/composables/useJunPlayer.js +208 -0
  246. package/dist/runtime/composables/useJunPresence.d.ts +32 -0
  247. package/dist/runtime/composables/useJunPresence.js +53 -0
  248. package/dist/runtime/composables/useJunPressDrag.d.ts +20 -0
  249. package/dist/runtime/composables/useJunPressDrag.js +85 -0
  250. package/dist/runtime/composables/useJunRecent.d.ts +9 -0
  251. package/dist/runtime/composables/useJunRecent.js +44 -0
  252. package/dist/runtime/composables/useJunRename.d.ts +19 -0
  253. package/dist/runtime/composables/useJunRename.js +62 -0
  254. package/dist/runtime/composables/useJunRouteGeoHeal.d.ts +1 -0
  255. package/dist/runtime/composables/useJunRouteGeoHeal.js +45 -0
  256. package/dist/runtime/composables/useJunRouting.d.ts +29 -0
  257. package/dist/runtime/composables/useJunRouting.js +101 -0
  258. package/dist/runtime/composables/useJunSearch.d.ts +6 -0
  259. package/dist/runtime/composables/useJunSearch.js +16 -0
  260. package/dist/runtime/composables/useJunSelfId.d.ts +1 -0
  261. package/dist/runtime/composables/useJunSelfId.js +28 -0
  262. package/dist/runtime/composables/useJunSiteConfig.d.ts +229 -0
  263. package/dist/runtime/composables/useJunSiteConfig.js +95 -0
  264. package/dist/runtime/composables/useJunSiteConfigValues.d.ts +33 -0
  265. package/dist/runtime/composables/useJunSiteConfigValues.js +21 -0
  266. package/dist/runtime/composables/useJunStagger.d.ts +54 -0
  267. package/dist/runtime/composables/useJunStagger.js +23 -0
  268. package/dist/runtime/composables/useJunStudio.d.ts +11 -0
  269. package/dist/runtime/composables/useJunStudio.js +51 -0
  270. package/dist/runtime/composables/useJunSurface.d.ts +19 -0
  271. package/dist/runtime/composables/useJunSurface.js +8 -0
  272. package/dist/runtime/composables/useJunTheme.d.ts +21 -0
  273. package/dist/runtime/composables/useJunTheme.js +138 -0
  274. package/dist/runtime/composables/useJunThemeTransition.d.ts +5 -0
  275. package/dist/runtime/composables/useJunThemeTransition.js +32 -0
  276. package/dist/runtime/composables/useJunUpload.d.ts +12 -0
  277. package/dist/runtime/composables/useJunUpload.js +44 -0
  278. package/dist/runtime/composables/useJunViewingAccent.d.ts +6 -0
  279. package/dist/runtime/composables/useJunViewingAccent.js +28 -0
  280. package/dist/runtime/error.d.vue.ts +7 -0
  281. package/dist/runtime/error.vue +74 -0
  282. package/dist/runtime/error.vue.d.ts +7 -0
  283. package/dist/runtime/layouts/jun.d.vue.ts +13 -0
  284. package/dist/runtime/layouts/jun.vue +162 -0
  285. package/dist/runtime/layouts/jun.vue.d.ts +13 -0
  286. package/dist/runtime/pages/doc.d.vue.ts +3 -0
  287. package/dist/runtime/pages/doc.vue +142 -0
  288. package/dist/runtime/pages/doc.vue.d.ts +3 -0
  289. package/dist/runtime/pages/index.d.vue.ts +3 -0
  290. package/dist/runtime/pages/index.vue +64 -0
  291. package/dist/runtime/pages/index.vue.d.ts +3 -0
  292. package/dist/runtime/plugins/jun-drag-affordance.client.d.ts +2 -0
  293. package/dist/runtime/plugins/jun-drag-affordance.client.js +9 -0
  294. package/dist/runtime/router.options.d.ts +3 -0
  295. package/dist/runtime/router.options.js +72 -0
  296. package/dist/runtime/server/api/nav.get.d.ts +9 -0
  297. package/dist/runtime/server/api/nav.get.js +16 -0
  298. package/dist/runtime/server/api/resolve/[...slug].get.d.ts +18 -0
  299. package/dist/runtime/server/api/resolve/[...slug].get.js +20 -0
  300. package/dist/runtime/server/api/search.get.d.ts +13 -0
  301. package/dist/runtime/server/api/search.get.js +72 -0
  302. package/dist/runtime/server/api/service.get.d.ts +12 -0
  303. package/dist/runtime/server/api/service.get.js +39 -0
  304. package/dist/runtime/server/api/site-config.get.d.ts +2 -0
  305. package/dist/runtime/server/api/site-config.get.js +3 -0
  306. package/dist/runtime/server/api/stats.get.d.ts +12 -0
  307. package/dist/runtime/server/api/stats.get.js +56 -0
  308. package/dist/runtime/server/janitor/junJanitorActor.d.ts +179 -0
  309. package/dist/runtime/server/janitor/junJanitorActor.js +305 -0
  310. package/dist/runtime/server/janitor/junJanitorChores.d.ts +137 -0
  311. package/dist/runtime/server/janitor/junJanitorChores.js +189 -0
  312. package/dist/runtime/server/janitor/junJanitorDiff.d.ts +41 -0
  313. package/dist/runtime/server/janitor/junJanitorDiff.js +109 -0
  314. package/dist/runtime/server/janitor/junJanitorListen.d.ts +33 -0
  315. package/dist/runtime/server/janitor/junJanitorListen.js +43 -0
  316. package/dist/runtime/server/janitor/junJanitorMachine.d.ts +60 -0
  317. package/dist/runtime/server/janitor/junJanitorMachine.js +598 -0
  318. package/dist/runtime/server/janitor/junJanitorMotor.d.ts +211 -0
  319. package/dist/runtime/server/janitor/junJanitorMotor.js +241 -0
  320. package/dist/runtime/server/janitor/junJanitorPatrol.d.ts +68 -0
  321. package/dist/runtime/server/janitor/junJanitorPatrol.js +34 -0
  322. package/dist/runtime/server/janitor/junJanitorPerform.d.ts +70 -0
  323. package/dist/runtime/server/janitor/junJanitorPerform.js +72 -0
  324. package/dist/runtime/server/janitor/junJanitorRandom.d.ts +54 -0
  325. package/dist/runtime/server/janitor/junJanitorRandom.js +48 -0
  326. package/dist/runtime/server/janitor/junJanitorStore.d.ts +159 -0
  327. package/dist/runtime/server/janitor/junJanitorStore.js +269 -0
  328. package/dist/runtime/server/janitor/junJanitorVoice.d.ts +86 -0
  329. package/dist/runtime/server/janitor/junJanitorVoice.js +193 -0
  330. package/dist/runtime/server/janitor/junJanitorYText.d.ts +164 -0
  331. package/dist/runtime/server/janitor/junJanitorYText.js +258 -0
  332. package/dist/runtime/server/plugins/jun-bootstrap.d.ts +25 -0
  333. package/dist/runtime/server/plugins/jun-bootstrap.js +652 -0
  334. package/dist/runtime/server/plugins/jun-doc-cache.d.ts +2 -0
  335. package/dist/runtime/server/plugins/jun-doc-cache.js +142 -0
  336. package/dist/runtime/server/plugins/jun-janitor.d.ts +2 -0
  337. package/dist/runtime/server/plugins/jun-janitor.js +176 -0
  338. package/dist/runtime/server/plugins/jun-rpc.d.ts +2 -0
  339. package/dist/runtime/server/plugins/jun-rpc.js +455 -0
  340. package/dist/runtime/server/routes/feed.json.get.d.ts +21 -0
  341. package/dist/runtime/server/routes/feed.json.get.js +25 -0
  342. package/dist/runtime/server/routes/feed.xml.get.d.ts +2 -0
  343. package/dist/runtime/server/routes/feed.xml.get.js +34 -0
  344. package/dist/runtime/server/routes/sitemap.xml.get.d.ts +2 -0
  345. package/dist/runtime/server/routes/sitemap.xml.get.js +27 -0
  346. package/dist/runtime/server/utils/junCache.d.ts +41 -0
  347. package/dist/runtime/server/utils/junCache.js +32 -0
  348. package/dist/runtime/server/utils/junFeed.d.ts +20 -0
  349. package/dist/runtime/server/utils/junFeed.js +71 -0
  350. package/dist/runtime/server/utils/junServiceFetch.d.ts +46 -0
  351. package/dist/runtime/server/utils/junServiceFetch.js +320 -0
  352. package/dist/runtime/server/utils/junVisibility.d.ts +31 -0
  353. package/dist/runtime/server/utils/junVisibility.js +6 -0
  354. package/dist/runtime/types.d.ts +853 -0
  355. package/dist/runtime/types.js +1 -0
  356. package/dist/runtime/utils/junDate.d.ts +38 -0
  357. package/dist/runtime/utils/junDate.js +30 -0
  358. package/dist/runtime/utils/junDndGeometry.d.ts +62 -0
  359. package/dist/runtime/utils/junDndGeometry.js +56 -0
  360. package/dist/runtime/utils/junDocTypeIcons.d.ts +30 -0
  361. package/dist/runtime/utils/junDocTypeIcons.js +30 -0
  362. package/dist/runtime/utils/junEditorBodyText.d.ts +32 -0
  363. package/dist/runtime/utils/junEditorBodyText.js +10 -0
  364. package/dist/runtime/utils/junMapboxToken.d.ts +1 -0
  365. package/dist/runtime/utils/junMapboxToken.js +5 -0
  366. package/dist/runtime/utils/junMatch.d.ts +45 -0
  367. package/dist/runtime/utils/junMatch.js +37 -0
  368. package/dist/runtime/utils/junMetaSchemas.d.ts +23 -0
  369. package/dist/runtime/utils/junMetaSchemas.js +94 -0
  370. package/dist/runtime/utils/junMotion.d.ts +71 -0
  371. package/dist/runtime/utils/junMotion.js +3 -0
  372. package/dist/runtime/utils/junServiceRef.d.ts +21 -0
  373. package/dist/runtime/utils/junServiceRef.js +94 -0
  374. package/dist/runtime/utils/junSimplifyPath.d.ts +23 -0
  375. package/dist/runtime/utils/junSimplifyPath.js +57 -0
  376. package/dist/runtime/utils/junTransportModes.d.ts +49 -0
  377. package/dist/runtime/utils/junTransportModes.js +37 -0
  378. package/dist/runtime/utils/junVideoSource.d.ts +51 -0
  379. package/dist/runtime/utils/junVideoSource.js +110 -0
  380. package/dist/runtime/utils/junVisibility.d.ts +14 -0
  381. package/dist/runtime/utils/junVisibility.js +6 -0
  382. package/dist/types.d.mts +5 -0
  383. package/package.json +111 -0
@@ -0,0 +1,211 @@
1
+ /**
2
+ * The motor model — the part that decides whether any of this is believable.
3
+ *
4
+ * `@abraca/orchestrator`'s typewriter (`actions/type.ts`) waits
5
+ * `speed ± variance` between characters, uniformly. That is right for a scripted
6
+ * screen recording, where the viewer knows it is a demo, and wrong here: a
7
+ * uniform interval has no tail, and a stream of intervals with no tail is the
8
+ * single clearest tell that nobody is at the keyboard. Watch one for ten
9
+ * seconds and you stop believing it, without being able to say why.
10
+ *
11
+ * So this module produces a PLAN — a flat list of steps with their delays,
12
+ * typos and repairs already baked in — and the executor stays dumb. Three
13
+ * things follow from that:
14
+ *
15
+ * - Believability becomes DATA. A plan can be asserted on in a test, dumped
16
+ * to a fixture, or eyeballed as a list of numbers, instead of only ever
17
+ * being observable by sitting and watching a website.
18
+ * - It is deterministic. Every plan is seeded (see `junJanitorRandom`), so
19
+ * "that one looked wrong" is a seed, not a ghost.
20
+ * - Round 6's tuning pass has ONE object to tune — `JunMotorProfile` — rather
21
+ * than constants scattered through an executor.
22
+ *
23
+ * Everything here is pure. No yjs, no timers, no I/O.
24
+ */
25
+ import { type JunRng } from './junJanitorRandom.js';
26
+ /**
27
+ * One step of a performance.
28
+ *
29
+ * `delayMs` is the wait BEFORE the step, which is the way a keystroke actually
30
+ * works: the pause is the thinking, the keypress is instant.
31
+ *
32
+ * - `type` — insert one character at the caret.
33
+ * - `backspace` — remove the character to the LEFT of the caret.
34
+ * - `cut` — remove a whole selected range at once; a person hitting delete.
35
+ * - `pause` — nothing happens. Reading, hesitating, being distracted.
36
+ */
37
+ export type JunMotorStep = {
38
+ kind: 'type';
39
+ char: string;
40
+ delayMs: number;
41
+ } | {
42
+ kind: 'backspace';
43
+ delayMs: number;
44
+ } | {
45
+ kind: 'cut';
46
+ length: number;
47
+ delayMs: number;
48
+ } | {
49
+ kind: 'pause';
50
+ delayMs: number;
51
+ };
52
+ /** Total wall-clock duration of a plan. For budgeting, logging, and tests. */
53
+ export declare function motorDuration(steps: readonly JunMotorStep[]): number;
54
+ export interface JunMotorProfile {
55
+ /** Median inter-keystroke interval, ms. ~105 is an unhurried competent typist. */
56
+ typeMedianMs: number;
57
+ /** Spread of the underlying normal. 0 is a metronome; ~0.45 is a person. */
58
+ typeSigma: number;
59
+ /** Multiplier on the first keystrokes of a run, decaying to 1 — motor start-up. */
60
+ typeRampStart: number;
61
+ /** How many keystrokes the ramp takes to decay. */
62
+ typeRampChars: number;
63
+ /** Multiplier applied after a space / comma / sentence end / newline. */
64
+ pauseAfterSpace: number;
65
+ pauseAfterComma: number;
66
+ pauseAfterSentence: number;
67
+ pauseAfterNewline: number;
68
+ /** Roughly one hesitation per this many characters. */
69
+ hesitationEveryChars: number;
70
+ hesitationMinMs: number;
71
+ hesitationMaxMs: number;
72
+ /** Probability per character of fumbling it. */
73
+ typoChance: number;
74
+ /** How many characters go by before the typo is noticed. */
75
+ typoNoticeMin: number;
76
+ typoNoticeMax: number;
77
+ /** The pause on noticing. Longer than any ordinary gap — that is the tell. */
78
+ typoRealiseMinMs: number;
79
+ typoRealiseMaxMs: number;
80
+ /** First backspaces of a run — deliberate, before the key is held. */
81
+ deleteFirstMs: number;
82
+ /** Where a held backspace settles. */
83
+ deleteFastMs: number;
84
+ /** How many backspaces it takes to get there. */
85
+ deleteRampChars: number;
86
+ deleteSigma: number;
87
+ /** Probability a deletion run takes too much and has to put it back. */
88
+ overshootChance: number;
89
+ overshootMinChars: number;
90
+ overshootMaxChars: number;
91
+ overshootRealiseMinMs: number;
92
+ overshootRealiseMaxMs: number;
93
+ /** Reading speed, characters per minute, for think-time before acting. */
94
+ readCpm: number;
95
+ /** Nobody acts instantly, however short the thing is. */
96
+ readMinMs: number;
97
+ readMaxMs: number;
98
+ /** Per-plan speed multiplier: some days are slower. Median 1. */
99
+ moodSigma: number;
100
+ }
101
+ /**
102
+ * The starting point. Every number here is a guess to be replaced by round 6's
103
+ * tuning pass — but they are guesses with reasons, not placeholders.
104
+ */
105
+ export declare const JUN_MOTOR_DEFAULT: JunMotorProfile;
106
+ export interface JunTypeOptions {
107
+ profile?: JunMotorProfile;
108
+ /**
109
+ * Suppress typos. Used when the janitor is putting back something it took by
110
+ * mistake — it is being careful precisely then, and a typo inside a repair
111
+ * reads as a bug rather than as a character beat.
112
+ */
113
+ careful?: boolean;
114
+ /** Multiplier on every delay. > 1 is tired, < 1 is annoyed and rushing. */
115
+ speed?: number;
116
+ }
117
+ /**
118
+ * Plan typing `text` one character at a time.
119
+ *
120
+ * The delay for each character comes from four multiplied factors: the
121
+ * log-normal base, the motor ramp at the start of the run, what the PREVIOUS
122
+ * character was (you pause after a full stop, not after the 'h' in 'the'), and
123
+ * this plan's mood. Typos are injected as real wrong characters followed,
124
+ * some characters later, by the backspaces that repair them — so the executor
125
+ * never needs to know a typo happened.
126
+ */
127
+ export declare function planTyping(text: string, rng: JunRng, options?: JunTypeOptions): JunMotorStep[];
128
+ export interface JunDeleteOptions {
129
+ profile?: JunMotorProfile;
130
+ speed?: number;
131
+ /**
132
+ * The characters immediately to the LEFT of the run. Overshoot eats into
133
+ * these, so without them the janitor can only overshoot into nothing — and
134
+ * the repair, which is the most convincing beat available, never happens.
135
+ */
136
+ before?: string;
137
+ /** Skip the overshoot beat entirely (repairs, budget-constrained runs). */
138
+ precise?: boolean;
139
+ }
140
+ /**
141
+ * Plan a held-backspace run over `count` characters, right to left.
142
+ *
143
+ * The shape of this curve is what separates it from typing, and getting them
144
+ * DIFFERENT matters more than getting either one exactly right: a person
145
+ * presses backspace deliberately two or three times, then holds it, and the
146
+ * repeat rate takes over — fast, even, and much more regular than typing ever
147
+ * is. Then they let go slightly too late.
148
+ */
149
+ export declare function planDeletion(count: number, rng: JunRng, options?: JunDeleteOptions): JunMotorStep[];
150
+ /**
151
+ * Plan a select-and-delete: one keystroke over a whole range.
152
+ *
153
+ * This is what a person does with a big mess, and refusing to model it would
154
+ * be its own kind of tell — nobody backspaces through a pasted paragraph.
155
+ * The reading pause before it is where the character lives; the removal itself
156
+ * is instant and slightly contemptuous.
157
+ */
158
+ export declare function planCut(length: number, rng: JunRng, options?: {
159
+ profile?: JunMotorProfile;
160
+ speed?: number;
161
+ }): JunMotorStep[];
162
+ /**
163
+ * How long to stare at `chars` characters before touching them.
164
+ *
165
+ * Reading time is the cheapest realism in the whole model and the easiest to
166
+ * leave out. Something that deletes text the instant it appears is a trigger;
167
+ * something that arrives, waits four seconds, and then deletes it has read it.
168
+ */
169
+ export declare function planReading(chars: number, rng: JunRng, options?: {
170
+ profile?: JunMotorProfile;
171
+ speed?: number;
172
+ }): number;
173
+ export interface JunPointerStep {
174
+ /** Viewport-normalised, matching the `peer:site:pointer` wire contract. */
175
+ x: number;
176
+ y: number;
177
+ delayMs: number;
178
+ }
179
+ /**
180
+ * Plan a pointer path from one normalised point to another.
181
+ *
182
+ * Human pointing is ballistic: one fast movement that covers most of the
183
+ * distance, then a short corrective settle, usually with a small overshoot.
184
+ * Linear interpolation — orchestrator's `pointerMove` — looks like a machine
185
+ * dragging a sprite, which is fine for a demo reel and not for this.
186
+ *
187
+ * The path also never arrives exactly: it settles a few pixels off and keeps
188
+ * drifting, because a real pointer is attached to a hand resting on a desk.
189
+ */
190
+ export declare function planPointerPath(from: {
191
+ x: number;
192
+ y: number;
193
+ }, to: {
194
+ x: number;
195
+ y: number;
196
+ }, rng: JunRng, options?: {
197
+ durationMs?: number;
198
+ frameMs?: number;
199
+ jitter?: number;
200
+ }): JunPointerStep[];
201
+ /**
202
+ * Idle drift — the pointer of someone who is reading, not moving it on purpose.
203
+ * A perfectly still cursor is the giveaway that nobody is holding it.
204
+ */
205
+ export declare function planPointerIdle(at: {
206
+ x: number;
207
+ y: number;
208
+ }, durationMs: number, rng: JunRng, options?: {
209
+ frameMs?: number;
210
+ amplitude?: number;
211
+ }): JunPointerStep[];
@@ -0,0 +1,241 @@
1
+ import { clampMs } from "./junJanitorRandom.js";
2
+ export function motorDuration(steps) {
3
+ return steps.reduce((sum, s) => sum + s.delayMs, 0);
4
+ }
5
+ export const JUN_MOTOR_DEFAULT = {
6
+ typeMedianMs: 105,
7
+ typeSigma: 0.45,
8
+ typeRampStart: 1.9,
9
+ typeRampChars: 4,
10
+ pauseAfterSpace: 1.2,
11
+ pauseAfterComma: 1.6,
12
+ pauseAfterSentence: 2.4,
13
+ pauseAfterNewline: 3.2,
14
+ hesitationEveryChars: 90,
15
+ hesitationMinMs: 300,
16
+ hesitationMaxMs: 900,
17
+ // Measured, not guessed: at 0.015 a 60-character line fumbled in 60% of
18
+ // runs, because the per-character rate compounds — 1-(1-p)^n, which is the
19
+ // thing that is easy to forget when you pick a number that "sounds rare".
20
+ // 0.004 puts it at roughly one fumble per 250 characters, which is a
21
+ // competent typist and, more to the point, a beat you notice rather than a
22
+ // tic you stop seeing.
23
+ typoChance: 4e-3,
24
+ typoNoticeMin: 1,
25
+ typoNoticeMax: 6,
26
+ typoRealiseMinMs: 220,
27
+ typoRealiseMaxMs: 700,
28
+ deleteFirstMs: 150,
29
+ deleteFastMs: 38,
30
+ deleteRampChars: 6,
31
+ deleteSigma: 0.22,
32
+ // Higher than a real hand overshoots, on purpose. It is the single most
33
+ // convincing thing the janitor does — "took two characters too many, paused,
34
+ // put them back" is the beat that makes people ask whether it is a person —
35
+ // and unlike a typo it is self-correcting and costs nothing when it fires.
36
+ overshootChance: 0.12,
37
+ overshootMinChars: 1,
38
+ overshootMaxChars: 3,
39
+ overshootRealiseMinMs: 250,
40
+ overshootRealiseMaxMs: 700,
41
+ // Scanning a page for what changed, not reading it for pleasure — but the
42
+ // floor matters more than the rate. Deleting something 700ms after arriving
43
+ // is a trigger; taking a second and a half over it is a person.
44
+ readCpm: 1100,
45
+ readMinMs: 1200,
46
+ readMaxMs: 9e3,
47
+ moodSigma: 0.18
48
+ };
49
+ const NEIGHBOURS = {
50
+ a: "qwsz",
51
+ b: "vghn",
52
+ c: "xdfv",
53
+ d: "serfcx",
54
+ e: "wsdr",
55
+ f: "drtgvc",
56
+ g: "ftyhbv",
57
+ h: "gyujnb",
58
+ i: "ujko",
59
+ j: "huikmn",
60
+ k: "jiolm",
61
+ l: "kop",
62
+ m: "njk",
63
+ n: "bhjm",
64
+ o: "iklp",
65
+ p: "ol",
66
+ q: "wa",
67
+ r: "edft",
68
+ s: "awedxz",
69
+ t: "rfgy",
70
+ u: "yhji",
71
+ v: "cfgb",
72
+ w: "qase",
73
+ x: "zsdc",
74
+ y: "tghu",
75
+ z: "asx"
76
+ };
77
+ function fumble(char, rng) {
78
+ const lower = char.toLowerCase();
79
+ const near = NEIGHBOURS[lower];
80
+ if (!near) return null;
81
+ const hit = near[rng.int(0, near.length - 1)];
82
+ if (!hit) return null;
83
+ return char === lower ? hit : hit.toUpperCase();
84
+ }
85
+ export function planTyping(text, rng, options = {}) {
86
+ const p = options.profile ?? JUN_MOTOR_DEFAULT;
87
+ const steps = [];
88
+ if (!text) return steps;
89
+ const mood = (options.speed ?? 1) * rng.logNormal(1, p.moodSigma);
90
+ const chars = [...text];
91
+ const hesitations = /* @__PURE__ */ new Set();
92
+ const hesitationCount = Math.floor(chars.length / p.hesitationEveryChars);
93
+ for (let i = 0; i < hesitationCount; i++) {
94
+ hesitations.add(rng.int(1, Math.max(1, chars.length - 1)));
95
+ }
96
+ let sinceRunStart = 0;
97
+ let pendingTypo = null;
98
+ const delayFor = (index, prev) => {
99
+ const base = rng.logNormal(p.typeMedianMs, p.typeSigma);
100
+ const rampT = Math.min(1, sinceRunStart / p.typeRampChars);
101
+ const ramp = p.typeRampStart + (1 - p.typeRampStart) * rampT;
102
+ let boundary = 1;
103
+ if (prev === "\n") boundary = p.pauseAfterNewline;
104
+ else if (prev === "." || prev === "!" || prev === "?") boundary = p.pauseAfterSentence;
105
+ else if (prev === "," || prev === ";" || prev === ":") boundary = p.pauseAfterComma;
106
+ else if (prev === " ") boundary = p.pauseAfterSpace;
107
+ const tail = index >= chars.length - 2 ? 1.15 : 1;
108
+ return clampMs(base * ramp * boundary * tail * mood, 12, 4e3);
109
+ };
110
+ for (let i = 0; i < chars.length; i++) {
111
+ const char = chars[i];
112
+ const prev = chars[i - 1];
113
+ if (hesitations.has(i)) {
114
+ steps.push({
115
+ kind: "pause",
116
+ delayMs: clampMs(rng.range(p.hesitationMinMs, p.hesitationMaxMs) * mood, 100, 4e3)
117
+ });
118
+ sinceRunStart = 0;
119
+ }
120
+ const typo = !options.careful && pendingTypo === null && rng.chance(p.typoChance) ? fumble(char, rng) : null;
121
+ steps.push({ kind: "type", char: typo ?? char, delayMs: delayFor(i, prev) });
122
+ sinceRunStart++;
123
+ if (typo) {
124
+ pendingTypo = {
125
+ at: i,
126
+ // Never overrun the end of the text: a typo noticed after the run has
127
+ // finished would repair characters that were never typed.
128
+ noticeAfter: Math.min(rng.int(p.typoNoticeMin, p.typoNoticeMax), chars.length - i - 1),
129
+ wrong: typo
130
+ };
131
+ continue;
132
+ }
133
+ if (pendingTypo && i - pendingTypo.at >= pendingTypo.noticeAfter) {
134
+ repair(pendingTypo.at, i);
135
+ pendingTypo = null;
136
+ }
137
+ }
138
+ if (pendingTypo) repair(pendingTypo.at, chars.length - 1);
139
+ return steps;
140
+ function repair(from, to) {
141
+ const typed = to - from + 1;
142
+ if (typed <= 0) return;
143
+ steps.push({
144
+ kind: "pause",
145
+ delayMs: clampMs(rng.range(p.typoRealiseMinMs, p.typoRealiseMaxMs) * mood, 120, 2e3)
146
+ });
147
+ for (let b = 0; b < typed; b++) {
148
+ steps.push({ kind: "backspace", delayMs: clampMs(rng.logNormal(70, 0.3) * mood, 20, 500) });
149
+ }
150
+ const redo = chars.slice(from, to + 1).join("");
151
+ for (const [j, ch] of [...redo].entries()) {
152
+ steps.push({
153
+ kind: "type",
154
+ char: ch,
155
+ delayMs: clampMs(rng.logNormal(p.typeMedianMs * 0.9, p.typeSigma * 0.7) * mood, 15, 1500)
156
+ });
157
+ if (j === 0) sinceRunStart = p.typeRampChars;
158
+ }
159
+ }
160
+ }
161
+ export function planDeletion(count, rng, options = {}) {
162
+ const p = options.profile ?? JUN_MOTOR_DEFAULT;
163
+ const steps = [];
164
+ if (count <= 0) return steps;
165
+ const mood = (options.speed ?? 1) * rng.logNormal(1, p.moodSigma * 0.6);
166
+ for (let i = 0; i < count; i++) {
167
+ const t = Math.min(1, i / p.deleteRampChars);
168
+ const target = p.deleteFirstMs + (p.deleteFastMs - p.deleteFirstMs) * t;
169
+ const sigma = p.deleteSigma * (1 - 0.6 * t);
170
+ steps.push({ kind: "backspace", delayMs: clampMs(rng.logNormal(target, sigma) * mood, 12, 1200) });
171
+ }
172
+ const before = options.before ?? "";
173
+ if (!options.precise && before.length && rng.chance(p.overshootChance)) {
174
+ const extra = Math.min(rng.int(p.overshootMinChars, p.overshootMaxChars), before.length);
175
+ for (let i = 0; i < extra; i++) {
176
+ steps.push({ kind: "backspace", delayMs: clampMs(rng.logNormal(p.deleteFastMs, 0.15) * mood, 12, 300) });
177
+ }
178
+ steps.push({
179
+ kind: "pause",
180
+ delayMs: clampMs(rng.range(p.overshootRealiseMinMs, p.overshootRealiseMaxMs) * mood, 150, 2e3)
181
+ });
182
+ steps.push(...planTyping(before.slice(before.length - extra), rng, {
183
+ profile: p,
184
+ careful: true,
185
+ speed: options.speed
186
+ }));
187
+ }
188
+ return steps;
189
+ }
190
+ export function planCut(length, rng, options = {}) {
191
+ const p = options.profile ?? JUN_MOTOR_DEFAULT;
192
+ if (length <= 0) return [];
193
+ const mood = (options.speed ?? 1) * rng.logNormal(1, p.moodSigma);
194
+ return [{ kind: "cut", length, delayMs: clampMs(rng.logNormal(320, 0.35) * mood, 80, 2e3) }];
195
+ }
196
+ export function planReading(chars, rng, options = {}) {
197
+ const p = options.profile ?? JUN_MOTOR_DEFAULT;
198
+ const mood = (options.speed ?? 1) * rng.logNormal(1, p.moodSigma);
199
+ const ms = Math.max(0, chars) / p.readCpm * 6e4;
200
+ return clampMs(ms * mood + rng.range(0, p.readMinMs), p.readMinMs, p.readMaxMs);
201
+ }
202
+ export function planPointerPath(from, to, rng, options = {}) {
203
+ const distance = Math.hypot(to.x - from.x, to.y - from.y);
204
+ const duration = options.durationMs ?? clampMs(320 + distance * 900 * rng.logNormal(1, 0.2), 220, 2400);
205
+ const frame = options.frameMs ?? 40;
206
+ const steps = Math.max(2, Math.round(duration / frame));
207
+ const jitter = options.jitter ?? 4e-3;
208
+ const overshoot = rng.range(0.02, 0.08);
209
+ const peak = {
210
+ x: to.x + (to.x - from.x) * overshoot,
211
+ y: to.y + (to.y - from.y) * overshoot
212
+ };
213
+ const out = [];
214
+ for (let i = 1; i <= steps; i++) {
215
+ const t = i / steps;
216
+ const ballistic = 1 - Math.pow(1 - Math.min(1, t / 0.75), 5);
217
+ const settle = t <= 0.75 ? 0 : (t - 0.75) / 0.25;
218
+ const bx = from.x + (peak.x - from.x) * ballistic;
219
+ const by = from.y + (peak.y - from.y) * ballistic;
220
+ out.push({
221
+ x: bx + (to.x - bx) * settle + rng.gaussian() * jitter,
222
+ y: by + (to.y - by) * settle + rng.gaussian() * jitter,
223
+ delayMs: frame
224
+ });
225
+ }
226
+ return out;
227
+ }
228
+ export function planPointerIdle(at, durationMs, rng, options = {}) {
229
+ const frame = options.frameMs ?? 120;
230
+ const amp = options.amplitude ?? 3e-3;
231
+ const steps = Math.max(1, Math.round(durationMs / frame));
232
+ const out = [];
233
+ let x = at.x;
234
+ let y = at.y;
235
+ for (let i = 0; i < steps; i++) {
236
+ x += rng.gaussian() * amp - (x - at.x) * 0.08;
237
+ y += rng.gaussian() * amp - (y - at.y) * 0.08;
238
+ out.push({ x, y, delayMs: frame });
239
+ }
240
+ return out;
241
+ }
@@ -0,0 +1,68 @@
1
+ /**
2
+ * The patrol — which page to look at next.
3
+ *
4
+ * The janitor has one set of keys. Tree state is free (the runner's root
5
+ * document is always synced), but a document's PROSE costs a visit: one
6
+ * standalone provider, one socket, one page at a time. That constraint is not a
7
+ * limitation to work around, it is the character — of course they haven't
8
+ * noticed your typo yet, they were three pages away.
9
+ *
10
+ * So this module answers one question, from signals only: where next. Pure,
11
+ * clock-injected, no I/O.
12
+ */
13
+ export interface JunPatrolCandidate {
14
+ docId: string;
15
+ /** Epoch ms the janitor last stood on this page. 0 for never. */
16
+ lastVisitedAt: number;
17
+ /** Epoch ms the tree entry last changed. 0 if it never has. */
18
+ entryChangedAt: number;
19
+ /** Epoch ms a visitor was last seen on this document. */
20
+ presenceAt: number;
21
+ /**
22
+ * A visitor is on it RIGHT NOW. A reason to prioritise it, not to avoid it —
23
+ * see the note in `scorePatrol`.
24
+ */
25
+ occupied: boolean;
26
+ /** Times this page has needed cleaning. Drives suspicion, and the grudge. */
27
+ grudge: number;
28
+ /** Chores already known to be waiting here, from the tree diff. */
29
+ pendingChores: number;
30
+ }
31
+ export interface JunPatrolPolicy {
32
+ /** Don't revisit a clean page inside this window. */
33
+ minRevisitMs: number;
34
+ /**
35
+ * Leave a page alone for this long after its last change.
36
+ *
37
+ * Two jobs at once. It is manners — nobody tidies around someone who is
38
+ * still working — and it is the thing that keeps the janitor out of a
39
+ * tug-of-war with a live editor, which in a CRDT is a fight nobody wins and
40
+ * everybody watches.
41
+ */
42
+ settleMs: number;
43
+ /** Weights. Relative only; the absolute scale means nothing. */
44
+ weightPending: number;
45
+ weightEntryChanged: number;
46
+ weightPresence: number;
47
+ weightStale: number;
48
+ weightGrudge: number;
49
+ /** How fast the recency signals decay, ms. */
50
+ recencyHalfLifeMs: number;
51
+ /** A page nobody has visited in this long gets swept anyway. */
52
+ sweepAfterMs: number;
53
+ }
54
+ export declare const JUN_PATROL_POLICY_DEFAULT: JunPatrolPolicy;
55
+ export interface JunPatrolScore {
56
+ candidate: JunPatrolCandidate;
57
+ score: number;
58
+ /** Why it was skipped, when it was. Logged, and occasionally said out loud. */
59
+ skipped: 'settling' | 'recently-visited' | null;
60
+ }
61
+ export declare function scorePatrol(candidates: readonly JunPatrolCandidate[], now: number, policy?: JunPatrolPolicy): JunPatrolScore[];
62
+ /**
63
+ * The next page to walk to, or `null` for "nothing worth getting up for".
64
+ *
65
+ * Returning null often is correct and is most of what makes the pacing work:
66
+ * an idle janitor that keeps finding a reason to move is a screensaver.
67
+ */
68
+ export declare function nextPatrolTarget(candidates: readonly JunPatrolCandidate[], now: number, policy?: JunPatrolPolicy): JunPatrolCandidate | null;
@@ -0,0 +1,34 @@
1
+ export const JUN_PATROL_POLICY_DEFAULT = {
2
+ minRevisitMs: 4 * 6e4,
3
+ settleMs: 45e3,
4
+ weightPending: 60,
5
+ weightEntryChanged: 25,
6
+ // Deliberately high. Mess follows people, and theatre wants an audience:
7
+ // cleaning a page nobody is looking at is correct and invisible.
8
+ weightPresence: 30,
9
+ weightStale: 8,
10
+ weightGrudge: 6,
11
+ recencyHalfLifeMs: 10 * 6e4,
12
+ sweepAfterMs: 45 * 6e4
13
+ };
14
+ function recency(at, now, halfLife) {
15
+ if (!at || at > now) return at > now ? 1 : 0;
16
+ return Math.pow(0.5, (now - at) / halfLife);
17
+ }
18
+ export function scorePatrol(candidates, now, policy = JUN_PATROL_POLICY_DEFAULT) {
19
+ const scored = candidates.map((candidate) => {
20
+ let skipped = null;
21
+ const somethingHappenedSince = candidate.presenceAt > candidate.lastVisitedAt || candidate.entryChangedAt > candidate.lastVisitedAt;
22
+ if (candidate.entryChangedAt && now - candidate.entryChangedAt < policy.settleMs) skipped = "settling";
23
+ else if (!candidate.pendingChores && !somethingHappenedSince && candidate.lastVisitedAt && now - candidate.lastVisitedAt < policy.minRevisitMs) skipped = "recently-visited";
24
+ const stale = candidate.lastVisitedAt === 0 ? 1 : Math.min(1, (now - candidate.lastVisitedAt) / policy.sweepAfterMs);
25
+ const score = skipped ? -1 : (candidate.occupied ? policy.weightPresence : 0) + candidate.pendingChores * policy.weightPending + recency(candidate.entryChangedAt, now, policy.recencyHalfLifeMs) * policy.weightEntryChanged + recency(candidate.presenceAt, now, policy.recencyHalfLifeMs) * policy.weightPresence + stale * policy.weightStale + Math.min(4, candidate.grudge) * policy.weightGrudge;
26
+ return { candidate, score, skipped };
27
+ });
28
+ return scored.sort((a, b) => b.score - a.score);
29
+ }
30
+ export function nextPatrolTarget(candidates, now, policy = JUN_PATROL_POLICY_DEFAULT) {
31
+ const best = scorePatrol(candidates, now, policy)[0];
32
+ if (!best || best.skipped || best.score <= 0) return null;
33
+ return best.candidate;
34
+ }
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Performing a plan — the only place a motor step becomes a CRDT write.
3
+ *
4
+ * `junJanitorMotor` decides what a person would do and when; this decides
5
+ * nothing at all. That split is deliberate: the interesting half stays pure and
6
+ * testable, and the half that can corrupt a document stays boring.
7
+ *
8
+ * Three rules hold here, each of which is a bug that would otherwise be
9
+ * invisible until someone watched it happen on a live site:
10
+ *
11
+ * **Re-derive every position.** A caret index is stale the instant anyone else
12
+ * types, and the janitor works on pages people are reading. Every step resolves
13
+ * its own position from the CURRENT document rather than trusting one computed
14
+ * a keystroke ago — the same rule `@abraca/orchestrator`'s typewriter follows.
15
+ *
16
+ * **One transaction per step.** Not one per plan. A plan wrapped in a single
17
+ * transaction lands as ONE update on the wire, and every visitor sees a
18
+ * paragraph vanish instantly — which is precisely the effect all of this
19
+ * exists to avoid. Character-by-character is a wire property, not a timing
20
+ * one.
21
+ *
22
+ * **Abort rather than fight.** If the text under the caret is not what the plan
23
+ * expected, someone else is typing there. The janitor stops, and says so.
24
+ *
25
+ * What was removed comes back in the OUTCOME, in document order, for the caller
26
+ * to put in the lost-and-found. It is deliberately not a per-step callback: a
27
+ * backspace run walks right to left, so a callback hands the caller its own
28
+ * text reversed.
29
+ */
30
+ import type * as Y from 'yjs';
31
+ import type { JunMotorStep } from './junJanitorMotor.js';
32
+ import type { JunBodyPos } from './junJanitorYText.js';
33
+ export interface JunPerformHandle {
34
+ /** The document being worked on. */
35
+ doc: Y.Doc;
36
+ fragment: Y.XmlFragment;
37
+ /** Wait, so a plan plays at human speed. Injected so tests can run instantly. */
38
+ sleep: (ms: number) => Promise<void>;
39
+ /** Broadcast the caret at this BODY offset, or a selection between two. */
40
+ cursor?: (anchorBody: number, headBody: number) => void;
41
+ /** Stop now — kill switch, shift end, or the doc changed under us. */
42
+ aborted?: () => boolean;
43
+ }
44
+ export type JunPerformOutcome = {
45
+ status: 'done';
46
+ removed: string;
47
+ typed: string;
48
+ } | {
49
+ status: 'aborted';
50
+ reason: 'cancelled' | 'conflict' | 'gone';
51
+ removed: string;
52
+ typed: string;
53
+ };
54
+ /**
55
+ * Play `steps` with the caret starting at BODY offset `at`.
56
+ *
57
+ * `backspace` removes to the LEFT of the caret and `type` inserts at it, which
58
+ * is what makes a plan's overshoot-and-repair land as the same gesture a person
59
+ * would make. `cut` removes a whole range at once.
60
+ */
61
+ export declare function junPerform(handle: JunPerformHandle, at: number | JunBodyPos, steps: readonly JunMotorStep[]): Promise<JunPerformOutcome>;
62
+ /**
63
+ * Is the text at `at` still the text the plan was built for?
64
+ *
65
+ * Called immediately before a performance starts. The gap between noticing a
66
+ * mess and standing in front of it is seconds of reading time, and in that gap
67
+ * the person who made it may well have fixed it themselves — in which case the
68
+ * janitor must not delete whatever is now in its place.
69
+ */
70
+ export declare function junRangeMatches(fragment: Y.XmlFragment, displayAt: number, expected: string): boolean;