@fuzdev/fuz_app 0.150.0 → 0.152.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 (597) hide show
  1. package/README.md +1 -1
  2. package/dist/actions/CLAUDE.md +324 -299
  3. package/dist/actions/action_bridge.d.ts +5 -86
  4. package/dist/actions/action_bridge.d.ts.map +1 -1
  5. package/dist/actions/action_bridge.js +4 -84
  6. package/dist/actions/action_codegen.d.ts +8 -166
  7. package/dist/actions/action_codegen.d.ts.map +1 -1
  8. package/dist/actions/action_codegen.js +19 -95
  9. package/dist/actions/action_dispatcher.d.ts +10 -0
  10. package/dist/actions/action_dispatcher.d.ts.map +1 -1
  11. package/dist/actions/action_dispatcher.js +9 -6
  12. package/dist/actions/action_event.d.ts +1 -2
  13. package/dist/actions/action_event.d.ts.map +1 -1
  14. package/dist/actions/action_event.js +7 -13
  15. package/dist/actions/action_event_helpers.d.ts +1 -40
  16. package/dist/actions/action_event_helpers.d.ts.map +1 -1
  17. package/dist/actions/action_event_helpers.js +1 -25
  18. package/dist/actions/action_rpc.d.ts +10 -215
  19. package/dist/actions/action_rpc.d.ts.map +1 -1
  20. package/dist/actions/action_rpc.js +56 -111
  21. package/dist/actions/action_spec.d.ts +2 -2
  22. package/dist/actions/action_spec.js +2 -2
  23. package/dist/actions/action_types.d.ts +229 -8
  24. package/dist/actions/action_types.d.ts.map +1 -1
  25. package/dist/actions/action_types.js +56 -5
  26. package/dist/actions/broadcast_api.d.ts +22 -17
  27. package/dist/actions/broadcast_api.d.ts.map +1 -1
  28. package/dist/actions/broadcast_api.js +16 -27
  29. package/dist/actions/cancel.d.ts +4 -13
  30. package/dist/actions/cancel.d.ts.map +1 -1
  31. package/dist/actions/cancel.js +5 -17
  32. package/dist/actions/compile_action_registry.d.ts +1 -2
  33. package/dist/actions/compile_action_registry.d.ts.map +1 -1
  34. package/dist/actions/connection_closer.d.ts +120 -50
  35. package/dist/actions/connection_closer.d.ts.map +1 -1
  36. package/dist/actions/connection_closer.js +139 -31
  37. package/dist/actions/{transports_ws_backend.d.ts → connection_registry.d.ts} +120 -132
  38. package/dist/actions/connection_registry.d.ts.map +1 -0
  39. package/dist/actions/{transports_ws_backend.js → connection_registry.js} +149 -152
  40. package/dist/actions/frontend_rpc_client.d.ts +52 -2
  41. package/dist/actions/frontend_rpc_client.d.ts.map +1 -1
  42. package/dist/actions/frontend_rpc_client.js +42 -4
  43. package/dist/actions/peer_ping.d.ts +7 -9
  44. package/dist/actions/peer_ping.d.ts.map +1 -1
  45. package/dist/actions/peer_ping.js +6 -8
  46. package/dist/actions/peer_request.d.ts +6 -5
  47. package/dist/actions/peer_request.d.ts.map +1 -1
  48. package/dist/actions/peer_request.js +6 -5
  49. package/dist/actions/perform_action.d.ts +36 -28
  50. package/dist/actions/perform_action.d.ts.map +1 -1
  51. package/dist/actions/perform_action.js +60 -34
  52. package/dist/actions/protocol.d.ts +14 -0
  53. package/dist/actions/protocol.d.ts.map +1 -1
  54. package/dist/actions/protocol.js +18 -0
  55. package/dist/actions/register_action_ws.d.ts +137 -298
  56. package/dist/actions/register_action_ws.d.ts.map +1 -1
  57. package/dist/actions/register_action_ws.js +155 -923
  58. package/dist/actions/socket.svelte.d.ts +9 -0
  59. package/dist/actions/socket.svelte.d.ts.map +1 -1
  60. package/dist/actions/socket.svelte.js +16 -5
  61. package/dist/actions/transports.d.ts +88 -34
  62. package/dist/actions/transports.d.ts.map +1 -1
  63. package/dist/actions/transports.js +76 -76
  64. package/dist/actions/transports_http.d.ts +48 -12
  65. package/dist/actions/transports_http.d.ts.map +1 -1
  66. package/dist/actions/transports_http.js +75 -44
  67. package/dist/actions/transports_ws.d.ts +29 -0
  68. package/dist/actions/transports_ws.d.ts.map +1 -1
  69. package/dist/actions/transports_ws.js +34 -8
  70. package/dist/actions/ws_endpoint_spec.d.ts +52 -75
  71. package/dist/actions/ws_endpoint_spec.d.ts.map +1 -1
  72. package/dist/actions/ws_endpoint_spec.js +27 -10
  73. package/dist/actions/ws_outbound_writer.d.ts +3 -3
  74. package/dist/actions/ws_outbound_writer.js +3 -3
  75. package/dist/actions/ws_socket_session.d.ts +321 -0
  76. package/dist/actions/ws_socket_session.d.ts.map +1 -0
  77. package/dist/actions/ws_socket_session.js +783 -0
  78. package/dist/auth/CLAUDE.md +70 -44
  79. package/dist/auth/account_action_specs.d.ts +2 -0
  80. package/dist/auth/account_action_specs.d.ts.map +1 -1
  81. package/dist/auth/account_actions.d.ts +1 -1
  82. package/dist/auth/account_actions.d.ts.map +1 -1
  83. package/dist/auth/account_actions.js +9 -3
  84. package/dist/auth/account_queries.d.ts +10 -0
  85. package/dist/auth/account_queries.d.ts.map +1 -1
  86. package/dist/auth/account_queries.js +27 -17
  87. package/dist/auth/account_routes.d.ts +2 -1
  88. package/dist/auth/account_routes.d.ts.map +1 -1
  89. package/dist/auth/account_routes.js +14 -17
  90. package/dist/auth/account_schema.d.ts +5 -5
  91. package/dist/auth/account_schema.d.ts.map +1 -1
  92. package/dist/auth/account_schema.js +5 -2
  93. package/dist/auth/actor_lookup_actions.d.ts +1 -1
  94. package/dist/auth/actor_lookup_actions.d.ts.map +1 -1
  95. package/dist/auth/actor_lookup_actions.js +1 -1
  96. package/dist/auth/actor_search_action_specs.d.ts.map +1 -1
  97. package/dist/auth/actor_search_action_specs.js +2 -1
  98. package/dist/auth/actor_search_actions.d.ts +1 -1
  99. package/dist/auth/actor_search_actions.d.ts.map +1 -1
  100. package/dist/auth/actor_search_actions.js +1 -1
  101. package/dist/auth/actor_search_queries.d.ts +5 -5
  102. package/dist/auth/actor_search_queries.d.ts.map +1 -1
  103. package/dist/auth/actor_search_queries.js +7 -7
  104. package/dist/auth/admin_action_specs.d.ts.map +1 -1
  105. package/dist/auth/admin_action_specs.js +3 -1
  106. package/dist/auth/admin_actions.d.ts +1 -1
  107. package/dist/auth/admin_actions.d.ts.map +1 -1
  108. package/dist/auth/admin_actions.js +12 -42
  109. package/dist/auth/all_cell_actions.d.ts +6 -4
  110. package/dist/auth/all_cell_actions.d.ts.map +1 -1
  111. package/dist/auth/all_cell_actions.js +1 -1
  112. package/dist/auth/api_token_queries.d.ts +1 -0
  113. package/dist/auth/api_token_queries.d.ts.map +1 -1
  114. package/dist/auth/api_token_queries.js +1 -0
  115. package/dist/auth/audit_emitter.d.ts +3 -3
  116. package/dist/auth/audit_emitter.js +2 -2
  117. package/dist/auth/audit_log_route_schema.d.ts.map +1 -1
  118. package/dist/auth/audit_log_route_schema.js +3 -2
  119. package/dist/auth/audit_log_routes.d.ts +20 -11
  120. package/dist/auth/audit_log_routes.d.ts.map +1 -1
  121. package/dist/auth/audit_log_routes.js +49 -29
  122. package/dist/auth/audit_log_schema.d.ts +13 -21
  123. package/dist/auth/audit_log_schema.d.ts.map +1 -1
  124. package/dist/auth/audit_log_schema.js +10 -18
  125. package/dist/auth/bearer_auth.d.ts +7 -4
  126. package/dist/auth/bearer_auth.d.ts.map +1 -1
  127. package/dist/auth/bearer_auth.js +21 -15
  128. package/dist/auth/cell_action_helpers.d.ts +89 -0
  129. package/dist/auth/cell_action_helpers.d.ts.map +1 -0
  130. package/dist/auth/cell_action_helpers.js +113 -0
  131. package/dist/auth/cell_actions.d.ts +22 -13
  132. package/dist/auth/cell_actions.d.ts.map +1 -1
  133. package/dist/auth/cell_actions.js +105 -167
  134. package/dist/auth/cell_audit_actions.d.ts +1 -1
  135. package/dist/auth/cell_audit_actions.d.ts.map +1 -1
  136. package/dist/auth/cell_audit_actions.js +3 -12
  137. package/dist/auth/cell_audit_metadata.d.ts +1 -1
  138. package/dist/auth/cell_audit_metadata.js +1 -1
  139. package/dist/auth/cell_field_actions.d.ts +1 -1
  140. package/dist/auth/cell_field_actions.d.ts.map +1 -1
  141. package/dist/auth/cell_field_actions.js +16 -66
  142. package/dist/auth/cell_grant_action_specs.d.ts +2 -2
  143. package/dist/auth/cell_grant_action_specs.js +3 -3
  144. package/dist/auth/cell_grant_actions.d.ts +73 -11
  145. package/dist/auth/cell_grant_actions.d.ts.map +1 -1
  146. package/dist/auth/cell_grant_actions.js +63 -55
  147. package/dist/auth/cell_grant_audit_metadata.d.ts +6 -3
  148. package/dist/auth/cell_grant_audit_metadata.d.ts.map +1 -1
  149. package/dist/auth/cell_grant_audit_metadata.js +7 -4
  150. package/dist/auth/cell_item_actions.d.ts +1 -1
  151. package/dist/auth/cell_item_actions.d.ts.map +1 -1
  152. package/dist/auth/cell_item_actions.js +21 -82
  153. package/dist/auth/cleanup.d.ts +1 -1
  154. package/dist/auth/cleanup.d.ts.map +1 -1
  155. package/dist/auth/cleanup.js +6 -3
  156. package/dist/auth/credential_deadline.d.ts +3 -3
  157. package/dist/auth/credential_deadline.js +3 -3
  158. package/dist/auth/credential_type_schema.d.ts +5 -5
  159. package/dist/auth/credential_type_schema.js +5 -5
  160. package/dist/auth/daemon_token_middleware.d.ts +12 -6
  161. package/dist/auth/daemon_token_middleware.d.ts.map +1 -1
  162. package/dist/auth/daemon_token_middleware.js +28 -17
  163. package/dist/auth/deps.d.ts +4 -4
  164. package/dist/auth/fail_floor.d.ts +55 -0
  165. package/dist/auth/fail_floor.d.ts.map +1 -0
  166. package/dist/auth/fail_floor.js +63 -0
  167. package/dist/auth/invite_queries.d.ts +3 -15
  168. package/dist/auth/invite_queries.d.ts.map +1 -1
  169. package/dist/auth/invite_queries.js +3 -21
  170. package/dist/auth/middleware.d.ts +12 -7
  171. package/dist/auth/middleware.d.ts.map +1 -1
  172. package/dist/auth/middleware.js +42 -29
  173. package/dist/auth/migrations.d.ts +5 -33
  174. package/dist/auth/migrations.d.ts.map +1 -1
  175. package/dist/auth/migrations.js +9 -16
  176. package/dist/auth/request_context.d.ts +101 -71
  177. package/dist/auth/request_context.d.ts.map +1 -1
  178. package/dist/auth/request_context.js +137 -140
  179. package/dist/auth/resolved_auth.d.ts +122 -36
  180. package/dist/auth/resolved_auth.d.ts.map +1 -1
  181. package/dist/auth/resolved_auth.js +89 -38
  182. package/dist/auth/role_grant_offer_action_specs.d.ts +99 -14
  183. package/dist/auth/role_grant_offer_action_specs.d.ts.map +1 -1
  184. package/dist/auth/role_grant_offer_action_specs.js +26 -13
  185. package/dist/auth/role_grant_offer_actions.d.ts +13 -7
  186. package/dist/auth/role_grant_offer_actions.d.ts.map +1 -1
  187. package/dist/auth/role_grant_offer_actions.js +14 -12
  188. package/dist/auth/role_grant_offer_notifications.d.ts +3 -3
  189. package/dist/auth/role_grant_offer_notifications.js +1 -1
  190. package/dist/auth/role_grant_offer_queries.d.ts +0 -5
  191. package/dist/auth/role_grant_offer_queries.d.ts.map +1 -1
  192. package/dist/auth/role_grant_offer_queries.js +9 -41
  193. package/dist/auth/role_grant_queries.d.ts +17 -67
  194. package/dist/auth/role_grant_queries.d.ts.map +1 -1
  195. package/dist/auth/role_grant_queries.js +34 -106
  196. package/dist/auth/role_grant_sql.d.ts +42 -0
  197. package/dist/auth/role_grant_sql.d.ts.map +1 -0
  198. package/dist/auth/role_grant_sql.js +54 -0
  199. package/dist/auth/scope_kind_schema.d.ts +1 -1
  200. package/dist/auth/scope_kind_schema.js +1 -1
  201. package/dist/auth/self_service_role_actions.d.ts +1 -1
  202. package/dist/auth/self_service_role_actions.d.ts.map +1 -1
  203. package/dist/auth/self_service_role_actions.js +1 -1
  204. package/dist/auth/session_queries.d.ts +2 -1
  205. package/dist/auth/session_queries.d.ts.map +1 -1
  206. package/dist/auth/session_queries.js +2 -1
  207. package/dist/auth/signup_routes.d.ts +2 -1
  208. package/dist/auth/signup_routes.d.ts.map +1 -1
  209. package/dist/auth/signup_routes.js +14 -13
  210. package/dist/auth/standard_rpc_actions.d.ts +1 -1
  211. package/dist/auth/standard_rpc_actions.d.ts.map +1 -1
  212. package/dist/auth/token_scope.d.ts +19 -46
  213. package/dist/auth/token_scope.d.ts.map +1 -1
  214. package/dist/auth/token_scope.js +23 -41
  215. package/dist/db/CLAUDE.md +9 -4
  216. package/dist/db/cell_ddl.d.ts +5 -142
  217. package/dist/db/cell_ddl.d.ts.map +1 -1
  218. package/dist/db/cell_ddl.js +17 -16
  219. package/dist/db/cell_field_queries.d.ts +0 -13
  220. package/dist/db/cell_field_queries.d.ts.map +1 -1
  221. package/dist/db/cell_field_queries.js +0 -16
  222. package/dist/db/cell_grant_queries.d.ts +10 -5
  223. package/dist/db/cell_grant_queries.d.ts.map +1 -1
  224. package/dist/db/cell_grant_queries.js +13 -7
  225. package/dist/db/cell_item_queries.d.ts +0 -7
  226. package/dist/db/cell_item_queries.d.ts.map +1 -1
  227. package/dist/db/cell_item_queries.js +0 -10
  228. package/dist/db/cell_queries.d.ts +12 -48
  229. package/dist/db/cell_queries.d.ts.map +1 -1
  230. package/dist/db/cell_queries.js +24 -55
  231. package/dist/db/cell_view_sql.d.ts +1 -6
  232. package/dist/db/cell_view_sql.d.ts.map +1 -1
  233. package/dist/db/cell_view_sql.js +1 -2
  234. package/dist/db/fact_ddl.d.ts +5 -30
  235. package/dist/db/fact_ddl.d.ts.map +1 -1
  236. package/dist/db/fact_ddl.js +14 -13
  237. package/dist/db/fact_store.d.ts +11 -0
  238. package/dist/db/fact_store.d.ts.map +1 -1
  239. package/dist/db/fact_store.js +4 -1
  240. package/dist/db/migrate.d.ts +44 -6
  241. package/dist/db/migrate.d.ts.map +1 -1
  242. package/dist/db/migrate.js +63 -4
  243. package/dist/dev/setup.d.ts +18 -14
  244. package/dist/dev/setup.d.ts.map +1 -1
  245. package/dist/dev/setup.js +42 -39
  246. package/dist/env/dotenv.d.ts +2 -2
  247. package/dist/env/dotenv.js +2 -2
  248. package/dist/env/update_env_variable.d.ts +33 -21
  249. package/dist/env/update_env_variable.d.ts.map +1 -1
  250. package/dist/env/update_env_variable.js +54 -35
  251. package/dist/hono_context.d.ts +15 -90
  252. package/dist/hono_context.d.ts.map +1 -1
  253. package/dist/hono_context.js +9 -56
  254. package/dist/http/CLAUDE.md +35 -20
  255. package/dist/http/auth_shape.d.ts +1 -8
  256. package/dist/http/auth_shape.d.ts.map +1 -1
  257. package/dist/http/auth_shape.js +6 -12
  258. package/dist/http/common_routes.d.ts.map +1 -1
  259. package/dist/http/common_routes.js +3 -2
  260. package/dist/http/db_routes.d.ts +3 -3
  261. package/dist/http/db_routes.js +3 -3
  262. package/dist/http/error_schemas.d.ts +1 -2
  263. package/dist/http/error_schemas.d.ts.map +1 -1
  264. package/dist/http/error_schemas.js +1 -2
  265. package/dist/http/health_schema.d.ts +16 -0
  266. package/dist/http/health_schema.d.ts.map +1 -0
  267. package/dist/http/health_schema.js +12 -0
  268. package/dist/http/jsonrpc_errors.d.ts +22 -2
  269. package/dist/http/jsonrpc_errors.d.ts.map +1 -1
  270. package/dist/http/jsonrpc_errors.js +41 -3
  271. package/dist/http/jsonrpc_helpers.d.ts +60 -17
  272. package/dist/http/jsonrpc_helpers.d.ts.map +1 -1
  273. package/dist/http/jsonrpc_helpers.js +67 -25
  274. package/dist/http/origin.d.ts +30 -1
  275. package/dist/http/origin.d.ts.map +1 -1
  276. package/dist/http/origin.js +46 -9
  277. package/dist/http/origin_wildcard.d.ts +97 -0
  278. package/dist/http/origin_wildcard.d.ts.map +1 -0
  279. package/dist/http/origin_wildcard.js +142 -0
  280. package/dist/http/pending_effects.d.ts +28 -0
  281. package/dist/http/pending_effects.d.ts.map +1 -1
  282. package/dist/http/pending_effects.js +32 -1
  283. package/dist/http/route_spec.d.ts +4 -3
  284. package/dist/http/route_spec.d.ts.map +1 -1
  285. package/dist/http/route_spec.js +54 -45
  286. package/dist/http/surface.d.ts +1 -1
  287. package/dist/http/surface.d.ts.map +1 -1
  288. package/dist/http/surface_query.d.ts +9 -50
  289. package/dist/http/surface_query.d.ts.map +1 -1
  290. package/dist/http/surface_query.js +48 -94
  291. package/dist/realtime/audit_log_sse.d.ts +180 -0
  292. package/dist/realtime/audit_log_sse.d.ts.map +1 -0
  293. package/dist/realtime/audit_log_sse.js +154 -0
  294. package/dist/realtime/sse.d.ts +21 -6
  295. package/dist/realtime/sse.d.ts.map +1 -1
  296. package/dist/realtime/sse.js +33 -10
  297. package/dist/realtime/sse_constants.d.ts +29 -2
  298. package/dist/realtime/sse_constants.d.ts.map +1 -1
  299. package/dist/realtime/sse_constants.js +35 -2
  300. package/dist/realtime/{subscriber_registry.d.ts → sse_registry.d.ts} +12 -12
  301. package/dist/realtime/sse_registry.d.ts.map +1 -0
  302. package/dist/realtime/{subscriber_registry.js → sse_registry.js} +4 -4
  303. package/dist/schema_meta.d.ts +30 -10
  304. package/dist/schema_meta.d.ts.map +1 -1
  305. package/dist/schema_meta.js +85 -21
  306. package/dist/sensitivity.d.ts +9 -3
  307. package/dist/sensitivity.d.ts.map +1 -1
  308. package/dist/sensitivity.js +3 -2
  309. package/dist/server/app_backend.d.ts +8 -5
  310. package/dist/server/app_backend.d.ts.map +1 -1
  311. package/dist/server/app_backend.js +6 -12
  312. package/dist/server/app_server.d.ts +62 -51
  313. package/dist/server/app_server.d.ts.map +1 -1
  314. package/dist/server/app_server.js +84 -71
  315. package/dist/server/app_server_context.d.ts +1 -1
  316. package/dist/server/app_server_context.d.ts.map +1 -1
  317. package/dist/server/env.d.ts +24 -20
  318. package/dist/server/env.d.ts.map +1 -1
  319. package/dist/server/env.js +24 -34
  320. package/dist/server/serve_fact_route.d.ts +12 -16
  321. package/dist/server/serve_fact_route.d.ts.map +1 -1
  322. package/dist/server/serve_fact_route.js +59 -34
  323. package/dist/server/static.d.ts.map +1 -1
  324. package/dist/server/static.js +2 -2
  325. package/dist/testing/CLAUDE.md +179 -158
  326. package/dist/testing/admin_integration.d.ts.map +1 -1
  327. package/dist/testing/admin_integration.js +10 -19
  328. package/dist/testing/adversarial_headers.d.ts.map +1 -1
  329. package/dist/testing/adversarial_headers.js +8 -0
  330. package/dist/testing/app_server.d.ts +9 -77
  331. package/dist/testing/app_server.d.ts.map +1 -1
  332. package/dist/testing/app_server.js +31 -112
  333. package/dist/testing/attack_surface.d.ts.map +1 -1
  334. package/dist/testing/attack_surface.js +3 -4
  335. package/dist/testing/audit_completeness.d.ts.map +1 -1
  336. package/dist/testing/audit_completeness.js +4 -5
  337. package/dist/testing/auth_apps.d.ts +3 -3
  338. package/dist/testing/auth_apps.d.ts.map +1 -1
  339. package/dist/testing/auth_apps.js +9 -6
  340. package/dist/testing/connection_closer_helpers.d.ts +8 -16
  341. package/dist/testing/connection_closer_helpers.d.ts.map +1 -1
  342. package/dist/testing/connection_closer_helpers.js +7 -20
  343. package/dist/testing/cross_backend/action_manifest.d.ts +15 -4
  344. package/dist/testing/cross_backend/action_manifest.d.ts.map +1 -1
  345. package/dist/testing/cross_backend/action_manifest.js +13 -3
  346. package/dist/testing/cross_backend/action_manifest_parity.d.ts +15 -7
  347. package/dist/testing/cross_backend/action_manifest_parity.d.ts.map +1 -1
  348. package/dist/testing/cross_backend/action_manifest_parity.js +8 -1
  349. package/dist/testing/cross_backend/body_size.d.ts.map +1 -1
  350. package/dist/testing/cross_backend/body_size.js +25 -22
  351. package/dist/testing/cross_backend/build_test_backend_paths.d.ts +22 -3
  352. package/dist/testing/cross_backend/build_test_backend_paths.d.ts.map +1 -1
  353. package/dist/testing/cross_backend/build_test_backend_paths.js +34 -11
  354. package/dist/testing/cross_backend/capabilities.d.ts +13 -7
  355. package/dist/testing/cross_backend/capabilities.d.ts.map +1 -1
  356. package/dist/testing/cross_backend/cell_grant_role.js +2 -2
  357. package/dist/testing/cross_backend/cell_grant_steward.d.ts +4 -0
  358. package/dist/testing/cross_backend/cell_grant_steward.d.ts.map +1 -0
  359. package/dist/testing/cross_backend/cell_grant_steward.js +120 -0
  360. package/dist/testing/cross_backend/cell_relations.d.ts.map +1 -1
  361. package/dist/testing/cross_backend/cell_relations.js +21 -0
  362. package/dist/testing/cross_backend/conformance_table.d.ts +1 -1
  363. package/dist/testing/cross_backend/conformance_table.d.ts.map +1 -1
  364. package/dist/testing/cross_backend/default_backend_configs.d.ts +18 -4
  365. package/dist/testing/cross_backend/default_backend_configs.d.ts.map +1 -1
  366. package/dist/testing/cross_backend/default_backend_configs.js +29 -9
  367. package/dist/testing/cross_backend/default_spine_surface.d.ts +7 -7
  368. package/dist/testing/cross_backend/default_spine_surface.js +2 -2
  369. package/dist/testing/cross_backend/fact_serving.d.ts.map +1 -1
  370. package/dist/testing/cross_backend/fact_serving.js +48 -0
  371. package/dist/testing/cross_backend/full_spine_mount.d.ts +3 -4
  372. package/dist/testing/cross_backend/full_spine_mount.d.ts.map +1 -1
  373. package/dist/testing/cross_backend/full_spine_mount.js +9 -2
  374. package/dist/testing/cross_backend/origin_scope.d.ts.map +1 -1
  375. package/dist/testing/cross_backend/origin_scope.js +5 -13
  376. package/dist/testing/cross_backend/peer_ping_ws.d.ts.map +1 -1
  377. package/dist/testing/cross_backend/peer_ping_ws.js +29 -4
  378. package/dist/testing/cross_backend/postgres_database.d.ts +32 -0
  379. package/dist/testing/cross_backend/postgres_database.d.ts.map +1 -1
  380. package/dist/testing/cross_backend/postgres_database.js +56 -1
  381. package/dist/testing/cross_backend/query_shape.d.ts.map +1 -1
  382. package/dist/testing/cross_backend/query_shape.js +18 -1
  383. package/dist/testing/cross_backend/role_grant_offer_lifecycle.d.ts.map +1 -1
  384. package/dist/testing/cross_backend/role_grant_offer_lifecycle.js +23 -1
  385. package/dist/testing/cross_backend/rpc_success_fixtures.js +2 -2
  386. package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts +1 -1
  387. package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts.map +1 -1
  388. package/dist/testing/cross_backend/rust_spine_stub_backend_config.d.ts +17 -5
  389. package/dist/testing/cross_backend/rust_spine_stub_backend_config.d.ts.map +1 -1
  390. package/dist/testing/cross_backend/rust_spine_stub_backend_config.js +5 -4
  391. package/dist/testing/cross_backend/session_cap.d.ts +8 -0
  392. package/dist/testing/cross_backend/session_cap.d.ts.map +1 -1
  393. package/dist/testing/cross_backend/session_cap.js +66 -2
  394. package/dist/testing/cross_backend/setup.d.ts.map +1 -1
  395. package/dist/testing/cross_backend/setup.js +5 -4
  396. package/dist/testing/cross_backend/spine_suites.d.ts +4 -1
  397. package/dist/testing/cross_backend/spine_suites.d.ts.map +1 -1
  398. package/dist/testing/cross_backend/spine_suites.js +21 -0
  399. package/dist/testing/cross_backend/spine_surface_constants.d.ts +22 -7
  400. package/dist/testing/cross_backend/spine_surface_constants.d.ts.map +1 -1
  401. package/dist/testing/cross_backend/spine_surface_constants.js +22 -7
  402. package/dist/testing/cross_backend/sse_round_trip.d.ts.map +1 -1
  403. package/dist/testing/cross_backend/sse_round_trip.js +4 -3
  404. package/dist/testing/cross_backend/standard.d.ts +6 -12
  405. package/dist/testing/cross_backend/standard.d.ts.map +1 -1
  406. package/dist/testing/cross_backend/test_cell_grant_steward_revoke_authorize.d.ts +8 -0
  407. package/dist/testing/cross_backend/test_cell_grant_steward_revoke_authorize.d.ts.map +1 -0
  408. package/dist/testing/cross_backend/test_cell_grant_steward_revoke_authorize.js +22 -0
  409. package/dist/testing/cross_backend/testing_backdoor.d.ts.map +1 -1
  410. package/dist/testing/cross_backend/testing_backdoor.js +4 -6
  411. package/dist/testing/cross_backend/testing_origin_check.d.ts +1 -1
  412. package/dist/testing/cross_backend/testing_origin_check.d.ts.map +1 -1
  413. package/dist/testing/cross_backend/testing_origin_check.js +1 -1
  414. package/dist/testing/cross_backend/testing_reset_actions.d.ts +10 -5
  415. package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
  416. package/dist/testing/cross_backend/testing_reset_actions.js +7 -6
  417. package/dist/testing/cross_backend/testing_server_bun.d.ts.map +1 -1
  418. package/dist/testing/cross_backend/testing_server_bun.js +5 -4
  419. package/dist/testing/cross_backend/testing_server_core.d.ts +6 -7
  420. package/dist/testing/cross_backend/testing_server_core.d.ts.map +1 -1
  421. package/dist/testing/cross_backend/testing_server_core.js +1 -1
  422. package/dist/testing/cross_backend/testing_server_node.d.ts.map +1 -1
  423. package/dist/testing/cross_backend/testing_server_node.js +13 -2
  424. package/dist/testing/cross_backend/token_lifetime.d.ts.map +1 -1
  425. package/dist/testing/cross_backend/token_lifetime.js +68 -0
  426. package/dist/testing/cross_backend/transport_composition.d.ts +1 -1
  427. package/dist/testing/cross_backend/transport_composition.d.ts.map +1 -1
  428. package/dist/testing/cross_backend/transport_composition.js +45 -3
  429. package/dist/testing/cross_backend/ts_spine_backend_config.d.ts +16 -2
  430. package/dist/testing/cross_backend/ts_spine_backend_config.d.ts.map +1 -1
  431. package/dist/testing/cross_backend/ts_spine_backend_config.js +11 -8
  432. package/dist/testing/cross_backend/ws_action_rate_limit.d.ts.map +1 -1
  433. package/dist/testing/cross_backend/ws_action_rate_limit.js +30 -12
  434. package/dist/testing/cross_backend/ws_connection_cap.d.ts.map +1 -1
  435. package/dist/testing/cross_backend/ws_connection_cap.js +5 -7
  436. package/dist/testing/cross_backend/ws_endpoint.d.ts +2 -3
  437. package/dist/testing/cross_backend/ws_endpoint.d.ts.map +1 -1
  438. package/dist/testing/cross_backend/ws_envelope.d.ts +17 -0
  439. package/dist/testing/cross_backend/ws_envelope.d.ts.map +1 -0
  440. package/dist/testing/cross_backend/ws_envelope.js +172 -0
  441. package/dist/testing/cross_backend/ws_inbound_dispatch.d.ts +16 -0
  442. package/dist/testing/cross_backend/ws_inbound_dispatch.d.ts.map +1 -1
  443. package/dist/testing/cross_backend/ws_inbound_dispatch.js +8 -4
  444. package/dist/testing/cross_backend/ws_outbound_overflow.d.ts.map +1 -1
  445. package/dist/testing/cross_backend/ws_outbound_overflow.js +5 -8
  446. package/dist/testing/cross_backend/ws_role_gated.js +2 -2
  447. package/dist/testing/cross_backend/ws_round_trip.d.ts.map +1 -1
  448. package/dist/testing/cross_backend/ws_round_trip.js +6 -4
  449. package/dist/{cli/daemon.d.ts → testing/daemon_info.d.ts} +15 -47
  450. package/dist/testing/daemon_info.d.ts.map +1 -0
  451. package/dist/testing/daemon_info.js +108 -0
  452. package/dist/testing/daemon_token_rotation.js +1 -1
  453. package/dist/testing/data_exposure.d.ts.map +1 -1
  454. package/dist/testing/data_exposure.js +3 -4
  455. package/dist/testing/db.js +2 -2
  456. package/dist/testing/integration.d.ts.map +1 -1
  457. package/dist/testing/integration.js +35 -65
  458. package/dist/testing/integration_helpers.d.ts +0 -15
  459. package/dist/testing/integration_helpers.d.ts.map +1 -1
  460. package/dist/testing/integration_helpers.js +2 -42
  461. package/dist/testing/middleware.d.ts +20 -12
  462. package/dist/testing/middleware.d.ts.map +1 -1
  463. package/dist/testing/middleware.js +49 -40
  464. package/dist/testing/rate_limiting.d.ts.map +1 -1
  465. package/dist/testing/rate_limiting.js +13 -22
  466. package/dist/testing/resolved_auth.d.ts +30 -0
  467. package/dist/testing/resolved_auth.d.ts.map +1 -0
  468. package/dist/testing/resolved_auth.js +41 -0
  469. package/dist/testing/rpc_envelope_cases.d.ts.map +1 -1
  470. package/dist/testing/rpc_envelope_cases.js +3 -0
  471. package/dist/testing/rpc_helpers.d.ts +1 -1
  472. package/dist/testing/rpc_helpers.d.ts.map +1 -1
  473. package/dist/testing/rpc_helpers.js +2 -1
  474. package/dist/testing/sse_round_trip.d.ts +5 -4
  475. package/dist/testing/sse_round_trip.d.ts.map +1 -1
  476. package/dist/testing/sse_round_trip.js +2 -2
  477. package/dist/testing/stubs.d.ts +2 -2
  478. package/dist/testing/stubs.d.ts.map +1 -1
  479. package/dist/testing/stubs.js +24 -21
  480. package/dist/testing/test_origin.d.ts +25 -0
  481. package/dist/testing/test_origin.d.ts.map +1 -0
  482. package/dist/testing/test_origin.js +28 -0
  483. package/dist/testing/transports/raw_http.d.ts +54 -0
  484. package/dist/testing/transports/raw_http.d.ts.map +1 -1
  485. package/dist/testing/transports/raw_http.js +58 -0
  486. package/dist/testing/transports/ws_raw_client.d.ts +8 -0
  487. package/dist/testing/transports/ws_raw_client.d.ts.map +1 -1
  488. package/dist/testing/transports/ws_raw_client.js +13 -0
  489. package/dist/testing/transports/ws_transport.d.ts +15 -2
  490. package/dist/testing/transports/ws_transport.d.ts.map +1 -1
  491. package/dist/testing/transports/ws_transport.js +4 -2
  492. package/dist/testing/ws_round_trip.d.ts +27 -25
  493. package/dist/testing/ws_round_trip.d.ts.map +1 -1
  494. package/dist/testing/ws_round_trip.js +34 -26
  495. package/dist/ui/AccountSessions.svelte +48 -19
  496. package/dist/ui/AccountSessions.svelte.d.ts +2 -17
  497. package/dist/ui/AccountSessions.svelte.d.ts.map +1 -1
  498. package/dist/ui/AdminAccounts.svelte +6 -1
  499. package/dist/ui/AdminAuditLog.svelte +61 -22
  500. package/dist/ui/AdminAuditLog.svelte.d.ts.map +1 -1
  501. package/dist/ui/AdminInvites.svelte +1 -1
  502. package/dist/ui/AdminOverview.svelte +76 -37
  503. package/dist/ui/AdminOverview.svelte.d.ts.map +1 -1
  504. package/dist/ui/AdminRoleGrantHistory.svelte +6 -1
  505. package/dist/ui/AdminSessions.svelte +1 -1
  506. package/dist/ui/AppShell.svelte +3 -2
  507. package/dist/ui/AppShell.svelte.d.ts +3 -2
  508. package/dist/ui/AppShell.svelte.d.ts.map +1 -1
  509. package/dist/ui/CLAUDE.md +121 -35
  510. package/dist/ui/Datatable.svelte +33 -18
  511. package/dist/ui/Datatable.svelte.d.ts +2 -14
  512. package/dist/ui/Datatable.svelte.d.ts.map +1 -1
  513. package/dist/ui/OpenSignupToggle.svelte +10 -1
  514. package/dist/ui/OpenSignupToggle.svelte.d.ts.map +1 -1
  515. package/dist/ui/PopoverButton.svelte +13 -8
  516. package/dist/ui/PopoverButton.svelte.d.ts.map +1 -1
  517. package/dist/ui/RoleGrantOfferForm.svelte +3 -2
  518. package/dist/ui/RoleGrantOfferForm.svelte.d.ts +3 -2
  519. package/dist/ui/RoleGrantOfferForm.svelte.d.ts.map +1 -1
  520. package/dist/ui/RoleGrantOfferHistory.svelte +3 -3
  521. package/dist/ui/RoleGrantOfferInbox.svelte +19 -15
  522. package/dist/ui/RoleGrantOfferInbox.svelte.d.ts.map +1 -1
  523. package/dist/ui/SurfaceExplorer.svelte +66 -27
  524. package/dist/ui/SurfaceExplorer.svelte.d.ts.map +1 -1
  525. package/dist/ui/account_sessions_state.svelte.d.ts +7 -14
  526. package/dist/ui/account_sessions_state.svelte.d.ts.map +1 -1
  527. package/dist/ui/admin_accounts_state.svelte.d.ts +14 -9
  528. package/dist/ui/admin_accounts_state.svelte.d.ts.map +1 -1
  529. package/dist/ui/admin_accounts_state.svelte.js +6 -4
  530. package/dist/ui/admin_invites_state.svelte.d.ts +2 -2
  531. package/dist/ui/admin_invites_state.svelte.d.ts.map +1 -1
  532. package/dist/ui/admin_rpc_adapters.d.ts +9 -9
  533. package/dist/ui/admin_rpc_adapters.d.ts.map +1 -1
  534. package/dist/ui/admin_rpc_adapters.js +9 -9
  535. package/dist/ui/app_settings_state.svelte.d.ts +2 -2
  536. package/dist/ui/app_settings_state.svelte.d.ts.map +1 -1
  537. package/dist/ui/audit_log_state.svelte.d.ts +70 -13
  538. package/dist/ui/audit_log_state.svelte.d.ts.map +1 -1
  539. package/dist/ui/audit_log_state.svelte.js +239 -47
  540. package/dist/ui/backend_probe.svelte.d.ts +93 -0
  541. package/dist/ui/backend_probe.svelte.d.ts.map +1 -0
  542. package/dist/ui/backend_probe.svelte.js +140 -0
  543. package/dist/ui/format_scope.d.ts +7 -7
  544. package/dist/ui/format_scope.d.ts.map +1 -1
  545. package/dist/ui/format_scope.js +4 -4
  546. package/dist/ui/keyed_async_slot.svelte.d.ts +2 -2
  547. package/dist/ui/keyed_async_slot.svelte.js +2 -2
  548. package/dist/ui/popover.svelte.d.ts +18 -19
  549. package/dist/ui/popover.svelte.d.ts.map +1 -1
  550. package/dist/ui/popover.svelte.js +103 -16
  551. package/dist/ui/role_grant_offers_state.svelte.d.ts +41 -46
  552. package/dist/ui/role_grant_offers_state.svelte.d.ts.map +1 -1
  553. package/dist/ui/role_grant_offers_state.svelte.js +37 -19
  554. package/dist/ui/ui_format.d.ts +17 -0
  555. package/dist/ui/ui_format.d.ts.map +1 -1
  556. package/dist/ui/ui_format.js +20 -0
  557. package/package.json +9 -8
  558. package/dist/actions/register_ws_endpoint.d.ts +0 -79
  559. package/dist/actions/register_ws_endpoint.d.ts.map +0 -1
  560. package/dist/actions/register_ws_endpoint.js +0 -109
  561. package/dist/actions/transports_ws_auth_guard.d.ts +0 -96
  562. package/dist/actions/transports_ws_auth_guard.d.ts.map +0 -1
  563. package/dist/actions/transports_ws_auth_guard.js +0 -141
  564. package/dist/actions/transports_ws_backend.d.ts.map +0 -1
  565. package/dist/cli/args.d.ts +0 -55
  566. package/dist/cli/args.d.ts.map +0 -1
  567. package/dist/cli/args.js +0 -100
  568. package/dist/cli/config.d.ts +0 -47
  569. package/dist/cli/config.d.ts.map +0 -1
  570. package/dist/cli/config.js +0 -77
  571. package/dist/cli/daemon.d.ts.map +0 -1
  572. package/dist/cli/daemon.js +0 -181
  573. package/dist/cli/help.d.ts +0 -124
  574. package/dist/cli/help.d.ts.map +0 -1
  575. package/dist/cli/help.js +0 -215
  576. package/dist/cli/logger.d.ts +0 -46
  577. package/dist/cli/logger.d.ts.map +0 -1
  578. package/dist/cli/logger.js +0 -48
  579. package/dist/cli/util.d.ts +0 -36
  580. package/dist/cli/util.d.ts.map +0 -1
  581. package/dist/cli/util.js +0 -50
  582. package/dist/realtime/sse_auth_guard.d.ts +0 -197
  583. package/dist/realtime/sse_auth_guard.d.ts.map +0 -1
  584. package/dist/realtime/sse_auth_guard.js +0 -239
  585. package/dist/realtime/subscriber_registry.d.ts.map +0 -1
  586. package/dist/testing/bootstrap_success.d.ts +0 -29
  587. package/dist/testing/bootstrap_success.d.ts.map +0 -1
  588. package/dist/testing/bootstrap_success.js +0 -144
  589. package/dist/testing/mock_fs.d.ts +0 -20
  590. package/dist/testing/mock_fs.d.ts.map +0 -1
  591. package/dist/testing/mock_fs.js +0 -28
  592. package/dist/testing/standard.d.ts +0 -122
  593. package/dist/testing/standard.d.ts.map +0 -1
  594. package/dist/testing/standard.js +0 -73
  595. package/dist/testing/testing_rate_limiter.d.ts +0 -65
  596. package/dist/testing/testing_rate_limiter.d.ts.map +0 -1
  597. package/dist/testing/testing_rate_limiter.js +0 -80
@@ -1,274 +1,86 @@
1
1
  /**
2
- * WebSocket JSON-RPC dispatch — the low-level WS transport binding.
2
+ * WebSocket JSON-RPC endpoint — the WS transport binding.
3
3
  *
4
4
  * Consumers declare WS endpoints on `create_app_server`'s `ws_endpoints`,
5
- * which mounts each through `register_ws_endpoint`
6
- * (`actions/register_ws_endpoint.ts`) — this function wrapped in the
7
- * standard upgrade stack (origin check + auth + token scope + actor
8
- * resolution + optional role). This module stays exported as the
9
- * lower-level entry point for tests that drive the dispatcher directly via
10
- * `create_ws_test_harness`.
5
+ * which mounts each through `register_action_ws`; call it directly only to
6
+ * mount an endpoint outside that assembly. Tests drive the dispatcher
7
+ * directly via `create_ws_test_harness`.
11
8
  *
12
- * Symmetric to `create_rpc_endpoint` (from `actions/action_rpc.ts`):
13
- * both transports parse their wire envelope, then call the shared
14
- * `perform_action` core (`actions/perform_action.ts`) for the post-parse
15
- * pipeline. WS-specific concerns — connection lifecycle, heartbeat,
16
- * cancel-notification interception, socket-scoped notify — stay in this
17
- * module; everything else (auth gates, input validation, authorization
18
- * phase, rate limiting, transactional dispatch, DEV output validation,
19
- * thrown-error normalization) is shared.
20
- *
21
- * ## Auth expectations
22
- *
23
- * The consumer is responsible for rejecting unauthenticated upgrades
24
- * *before* routing to this handler (fuz_app's `require_auth` middleware,
25
- * or `register_ws_endpoint` which wires it for you). Per-action auth
26
- * runs inside `perform_action` on every message via the same gates HTTP
27
- * RPC uses.
28
- *
29
- * ## Admission: the revocation race
9
+ * ## The upgrade route
30
10
  *
31
- * The auth middleware resolves the credential before the handshake, and the
32
- * socket exists only once `onOpen` fires. Every revocation (session revoke,
33
- * logout, password change, token revoke, account delete) closes the sockets
34
- * *registered* under what it revoked, so one landing in that gap would close
35
- * nothing, and the socket would then be admitted on the dead credential and
36
- * keep it: per-message dispatch re-authorizes the *actor*, never the session
37
- * or token — and its admission could evict a live socket of the same account
38
- * past the cap.
11
+ * One `GET path` route, its guards in coarse-to-fine order — the route-spec
12
+ * pipeline's, from `fuz_auth_guard_resolver`:
39
13
  *
40
- * `onOpen` closes the gap in three steps: register the connection **pending**
41
- * (`BackendWebsocketTransport.register_pending` — closeable by every
42
- * revocation, inert otherwise), re-read the credential
43
- * (`revalidate_resolved_auth`), then `BackendWebsocketTransport.admit`. A
44
- * revocation whose close ran after the registration found the pending entry,
45
- * so `admit` refuses; one that committed before the re-read is seen by it. The
46
- * cap is enforced only by `admit`, so a refused upgrade evicts nothing, and
47
- * pending registrations never count toward it.
14
+ * 1. `verify_request_source(allowed_origins)` — a disallowed origin is
15
+ * refused before the upgrade handshake runs (403).
16
+ * 2. `require_auth` — an unauthenticated upgrade is refused (401).
17
+ * 3. `require_token_scope('surface:ws_upgrade')` — rule 3: a narrowed token
18
+ * cannot hold a socket (403 `token_scope_required`). Server-initiated
19
+ * pushes (broadcasts, role-grant-offer notifications, peer requests)
20
+ * reach whatever the account's connection reaches, with no per-recipient
21
+ * filter to narrow them by, so a scoped token that could upgrade would
22
+ * observe far more than it was granted.
23
+ * 4. **Authorization phase** (`run_authorization_phase`) — the acting actor
24
+ * from the `?acting=<uuid>` query string (`parse_acting`; malformed reads
25
+ * as omitted), against the authenticated account, building the
26
+ * `RequestContext` per-message dispatch reads (400s on actor selection).
27
+ * Multi-actor accounts must supply `?acting`; single-actor accounts work
28
+ * without it.
29
+ * 5. `require_role(required_roles)`, for a gated endpoint (403).
48
30
  *
49
- * That argument needs every revocation to close only after its commit —
50
- * otherwise a close could miss the registration while the re-read still sees
51
- * the credential alive. Every one does: the revocation handlers queue their
52
- * close behind the commit (`queue_connection_close`), and the audit emitter
53
- * announces a success row to the listeners behind it too. So no interleaving
54
- * admits a revoked credential; `docs/security.md` §Connection Admission says
55
- * what that rests on.
31
+ * Only `GET` is mounted (Hono serves `HEAD` through it), so any other method
32
+ * on the path is a 404. The guards run as middleware ahead of
33
+ * `upgradeWebSocket`, whose callback must return `WSEvents` and so cannot
34
+ * produce a refusal.
56
35
  *
57
- * The acting actor the upgrade resolved is re-read beside the credential on
58
- * every endpoint, gated or not: an actor soft-deleted under its live account
59
- * keeps the account's sessions and tokens and its own grant rows, so neither
60
- * the credential nor the role re-read would refuse it. A tombstoned acting
61
- * actor is refused like a dead credential.
62
- *
63
- * An endpoint gated on `required_roles` re-reads them beside the credential:
64
- * its upgrade passed the role gate before the socket registered, so a role
65
- * revocation landing in between would close nothing (`close_sockets_for_role`
66
- * matches registrations), and the socket would be admitted without the role
67
- * for its lifetime. The re-read reads the acting actor's grants afresh and
68
- * admits on a global grant of any listed role, as the gate did.
69
- *
70
- * A refused upgrade is closed with `WS_CLOSE_SESSION_REVOKED` (4001, the
71
- * reason a revoked socket gets) for a dead credential or a deleted acting actor,
72
- * `WS_CLOSE_PERMISSION_REVOKED` (4006) for a lost role, or
73
- * `WS_CLOSE_INTERNAL_ERROR` (1011) when a re-read itself failed — fail
74
- * closed, never admitted unchecked. The handshake has already answered `101`,
75
- * so a refusal can only be a close frame.
76
- *
77
- * Once the server is shutting down (`AppServer.close` ran the transport's
78
- * `close_all_sockets`) a refusal is `WS_CLOSE_GOING_AWAY` instead, so the
79
- * client reconnects rather than treating its credential as revoked: an upgrade
80
- * pending at the close-all is closed by it — and its abort makes the refusal
81
- * that follows the re-read send nothing more, even when the database closed
82
- * under that re-read — and one that registers after it is born closed and
83
- * skips the re-read (`BackendWebsocketTransport` module doc, "Shutdown").
84
- *
85
- * Frames that arrive before admission are queued, not dispatched: nothing runs
86
- * on a credential that has not been re-read. They dispatch in arrival order
87
- * once the socket is admitted and `on_socket_open` has completed, and are
88
- * dropped unread on a refusal. The queue holds at most
89
- * `MAX_PRE_ADMISSION_FRAMES` frames and
90
- * `PRE_ADMISSION_QUEUE_BYTES_FACTOR` × `max_message_bytes` bytes; past either
91
- * the socket is closed.
36
+ * Symmetric to `create_rpc_endpoint` (from `actions/action_rpc.ts`):
37
+ * both transports parse their wire envelope, then call the shared
38
+ * `perform_action` core (`actions/perform_action.ts`) for the post-parse
39
+ * pipeline. WS-specific concerns — connection lifecycle, heartbeat,
40
+ * cancel-notification interception, socket-scoped notify — live in
41
+ * `actions/ws_socket_session.ts`; everything else (auth gates, input
42
+ * validation, authorization phase, rate limiting, transactional dispatch, DEV
43
+ * output validation, thrown-error normalization) is shared.
92
44
  *
93
- * ## Credential deadline
45
+ * ## Per-message auth
94
46
  *
95
- * Expiry writes nothing a revocation listener could hear, so the socket
96
- * watches its own credential's expiry (`ResolvedAuth.credential_deadline`,
97
- * the earlier of a session's cookie and row, an API token's row, none for a
98
- * daemon token or an eternal token). From admission, a timer closes it at the
99
- * deadline with `WS_CLOSE_SESSION_REVOKED` (4001) and
100
- * `WS_CLOSE_CREDENTIAL_EXPIRED_REASON`. The wait is a chain of timers of at
101
- * most an hour (`schedule_credential_deadline`), so a session's 30 days — past
102
- * `setTimeout`'s ceiling — does not fire at once, and each wake-up checks the
103
- * wall clock too, so a host suspend does not extend the deadline.
47
+ * Per-action auth runs inside `perform_action` on every message via the same
48
+ * gates HTTP RPC uses.
104
49
  *
105
- * ## A server-closed socket dispatches nothing
50
+ * ## Per-socket lifecycle
106
51
  *
107
- * A runtime adapter can keep delivering inbound frames after the server calls
108
- * `ws.close(…)`, until the close handshake completes (`@hono/node-ws` does —
109
- * up to the `ws` close timeout when the client withholds its close frame).
110
- * So every server-side close — revocation, cap eviction, heartbeat timeout,
111
- * an oversized message, a refused admission — removes the connection from the
112
- * transport and aborts the socket's signal *at close time*, and `onMessage`
113
- * drops any frame on a socket that has ended. A connection the transport no
114
- * longer holds though nothing closed its socket (a bare `remove_connection`)
115
- * is ended on its next frame (`BackendWebsocketTransport.is_registered`), with
116
- * `WS_CLOSE_INTERNAL_ERROR` — it must not linger as a socket that reads
117
- * everything and answers nothing.
52
+ * Admission (the revocation race), the credential deadline, and the rule that a
53
+ * server-closed socket dispatches nothing are the per-socket half, in
54
+ * `actions/ws_socket_session.ts`.
118
55
  *
119
56
  * @module
120
57
  */
121
58
  import type { Hono } from 'hono';
122
- import type { UpgradeWebSocket, WSContext } from 'hono/ws';
59
+ import type { UpgradeWebSocket } from 'hono/ws';
123
60
  import { type Logger as LoggerType } from '@fuzdev/fuz_util/log.ts';
124
- import type { Uuid } from '../primitive_schemas.js';
125
61
  import type { RoleName } from '../auth/role_schema.js';
62
+ import type { EffectErrorContext } from '../http/pending_effects.js';
126
63
  import type { RateLimiter } from '../rate_limiter.js';
127
64
  import type { Db } from '../db/db.js';
128
65
  import { type Action } from './action_types.js';
129
66
  import type { RealtimeCloser } from './connection_closer.js';
130
- import { BackendWebsocketTransport, type ConnectionIdentity } from './transports_ws_backend.js';
131
- /** Default inactivity window before the server closes a silent socket. */
132
- export declare const DEFAULT_SERVER_HEARTBEAT_TIMEOUT = 60000;
133
- /**
134
- * Max inbound frames one socket may have queued while it is still opening —
135
- * between the handshake and the end of the credential re-check plus
136
- * `on_socket_open`. One more closes the socket with
137
- * `WS_CLOSE_POLICY_VIOLATION`.
138
- *
139
- * Frames sent before the socket is open wait rather than dispatch (nothing
140
- * runs on a credential that has not been re-read), and a runtime adapter hands
141
- * them over with no backpressure, so the wait needs a bound. This is the count
142
- * half; `PRE_ADMISSION_QUEUE_BYTES_FACTOR` is the byte half.
143
- *
144
- * Sized so a client flushing its durable queue on reopen never meets it at the
145
- * default `DEFAULT_QUEUE_MAX_SIZE` (`actions/socket.svelte.ts`). A consumer
146
- * that raises the client's queue above this cap makes a full flush overflow
147
- * it: the socket closes with `WS_CLOSE_POLICY_VIOLATION`, the flushed requests
148
- * fail, and the client reconnects.
149
- */
150
- export declare const MAX_PRE_ADMISSION_FRAMES = 256;
151
- /**
152
- * The byte budget of one socket's pre-admission queue, as a multiple of the
153
- * endpoint's `max_message_bytes`: the frames queued while the socket is still
154
- * opening may total at most this many maximum-size messages. The frame that
155
- * would pass it closes the socket with `WS_CLOSE_POLICY_VIOLATION`.
156
- *
157
- * The count cap alone (`MAX_PRE_ADMISSION_FRAMES`) would let each pending
158
- * socket hold that many full-size messages, and pending sockets are not
159
- * capped per account — a registration that is never admitted must not be able
160
- * to pin that much memory. Small requests, which is what a client flushes on
161
- * reopen, meet the count cap long before this one.
162
- *
163
- * A client whose queued requests total more than this budget and flushes
164
- * them all on reopen overflows it: the socket closes, the flushed requests
165
- * fail, and the client reconnects.
166
- */
167
- export declare const PRE_ADMISSION_QUEUE_BYTES_FACTOR = 4;
168
- /**
169
- * The close reason sent with `WS_CLOSE_POLICY_VIOLATION` when a socket
170
- * overflows its pre-admission queue, by count or by bytes.
171
- */
172
- export declare const WS_CLOSE_PRE_ADMISSION_OVERFLOW_REASON = "too much sent before the socket opened";
173
- /**
174
- * Max requests one socket may have dispatching at once. A request that
175
- * arrives past it is answered `queue_overflow` with its id
176
- * (`WS_INBOUND_DISPATCH_OVERFLOW_MESSAGE`) and not dispatched; the socket
177
- * stays open, and the requests already running keep answering.
178
- *
179
- * A runtime adapter can hand frames over without awaiting the previous one's
180
- * dispatch (`@hono/node-ws` does not await `onMessage`), so without a ceiling
181
- * one socket could hold any number of handlers — and their pooled database
182
- * work — at once. Shedding rather than queueing keeps the socket reading, so a
183
- * reply to a server-initiated request still reaches the handler awaiting it.
184
- * Generous, so ordinary pipelining never meets it. Same value as the Rust
185
- * spine's `MAX_INBOUND_DISPATCHES_PER_CONN`.
186
- *
187
- * Counted are the requests that passed envelope validation and are not yet
188
- * answered — the entries of the socket's cancellation map. Notifications,
189
- * replies to server-initiated requests, and refused frames never count.
190
- */
191
- export declare const MAX_INBOUND_DISPATCHES_PER_CONNECTION = 128;
67
+ import { ConnectionRegistry } from './connection_registry.js';
68
+ import { type SocketCloseContext, type SocketOpenContext } from './ws_socket_session.js';
192
69
  /**
193
- * The `queue_overflow` message a request gets past
194
- * `MAX_INBOUND_DISPATCHES_PER_CONNECTION`. Same text as the Rust spine's.
70
+ * Default receive silence (ms) past which the server closes a socket with
71
+ * `WS_CLOSE_SERVER_HEARTBEAT_TIMEOUT` — the `receive_timeout` of
72
+ * `register_action_ws`. Twin of the Rust spine's `DEFAULT_WS_RECEIVE_TIMEOUT`.
195
73
  */
196
- export declare const WS_INBOUND_DISPATCH_OVERFLOW_MESSAGE = "too many concurrent requests on this connection";
74
+ export declare const DEFAULT_WS_RECEIVE_TIMEOUT = 60000;
197
75
  /**
198
- * The `data.reason` of the `invalid_request` a WebSocket request gets when its
199
- * id names a request still running on the same socket. The duplicate is not
200
- * dispatched; the running request keeps its id, so its reply, and a `cancel`
201
- * naming that id, stay its own. An id is free again once its request has been
202
- * answered.
76
+ * The longest `receive_timeout` `register_action_ws` accepts — 2³¹ − 1 ms,
77
+ * about 24.8 days, the longest delay a timer honors (the same bound as the
78
+ * SSE keep-alive). It keeps the receive check's half-timeout tick well inside
79
+ * that delay; `Infinity`, or a timeout of about 2³² ms and up, would make the
80
+ * tick fire every millisecond on every socket. TS-only: the Rust spine's
81
+ * `Duration` takes any length.
203
82
  */
204
- export declare const ERROR_DUPLICATE_REQUEST_ID = "duplicate_request_id";
205
- /**
206
- * Context passed to the `on_socket_open` hook.
207
- *
208
- * Fires once the connection is **admitted** — registered in the transport and
209
- * its credential re-checked (so `connection_id` is valid, and broadcasts reach
210
- * it) — and before any client message dispatches. A socket refused at
211
- * admission never reaches it. Consumers use this to bootstrap per-socket
212
- * domain state — e.g. spawning a per-account unit and pushing an initial state
213
- * snapshot.
214
- */
215
- export interface SocketOpenContext {
216
- /**
217
- * The raw WebSocket context — exposed for edge cases; prefer `notify` for
218
- * sends. A frame sent on it directly bypasses the connection's outbound
219
- * budget and its ordering with queued frames.
220
- */
221
- ws: WSContext;
222
- /** Connection id assigned by `BackendWebsocketTransport.register_pending`. */
223
- connection_id: Uuid;
224
- /** Auth identity registered for this connection. */
225
- identity: ConnectionIdentity;
226
- /**
227
- * Send a JSON-RPC notification to just this socket. Mirrors `ctx.notify`
228
- * on per-message handler contexts — same socket-scoped semantics.
229
- */
230
- notify: (method: string, params: unknown) => void;
231
- /**
232
- * Fires when this socket ends — the client closed it, or the server did
233
- * (revocation, cap eviction, heartbeat timeout), at the moment the server
234
- * closes rather than when the close handshake lands. Threaded through to
235
- * every handler's `ctx.signal`.
236
- */
237
- signal: AbortSignal;
238
- }
239
- /**
240
- * Context passed to the `on_socket_close` hook.
241
- *
242
- * Fires after the transport has removed the connection — `connection_id` and
243
- * `identity` are the values captured at open, so consumer cleanup reads them
244
- * from here, not from the transport. Fires for both client-initiated closes
245
- * (Hono onClose) and server-initiated closes — a revocation, the per-account
246
- * connection cap's eviction, and a heartbeat timeout all call `ws.close()`,
247
- * which triggers Hono's onClose. Fires only for a socket that was admitted: one
248
- * refused at admission never ran `on_socket_open`, so it has no close hook
249
- * either.
250
- */
251
- export interface SocketCloseContext {
252
- /**
253
- * The WebSocket context the close event carried. Not necessarily the object
254
- * `on_socket_open` received — an adapter may build one per event — so key
255
- * per-socket state on `connection_id`.
256
- */
257
- ws: WSContext;
258
- /** Connection id captured at open time. */
259
- connection_id: Uuid;
260
- /** Auth identity captured at open time — the transport no longer holds it. */
261
- identity: ConnectionIdentity;
262
- }
263
- export interface ServerHeartbeatOptions {
264
- /**
265
- * Receive-silence (ms) past which the server closes the socket with
266
- * `WS_CLOSE_SERVER_HEARTBEAT_TIMEOUT`. Any incoming message resets
267
- * the counter — chatty clients never trip it. First `timeout`
268
- * window after socket open is exempt (cold-start grace).
269
- */
270
- timeout?: number;
271
- }
83
+ export declare const WS_RECEIVE_TIMEOUT_MAX = 2147483647;
272
84
  /** Options for `register_action_ws`. */
273
85
  export interface RegisterActionWsOptions {
274
86
  /** Mount path (e.g., `/api/ws`). */
@@ -277,6 +89,13 @@ export interface RegisterActionWsOptions {
277
89
  app: Hono;
278
90
  /** Hono's `upgradeWebSocket` helper from the runtime adapter. */
279
91
  upgradeWebSocket: UpgradeWebSocket;
92
+ /**
93
+ * Origin allowlist regexes for the upgrade — passed straight to
94
+ * `verify_request_source`, the route's first guard. `create_app_server`
95
+ * passes the server's `allowed_origins` unless the `WsEndpointSpec` narrows
96
+ * them.
97
+ */
98
+ allowed_origins: ReadonlyArray<RegExp>;
280
99
  /**
281
100
  * The actions registered on this endpoint — each carries a spec (drives
282
101
  * method lookup, per-action auth, input/output validation) and an
@@ -298,46 +117,48 @@ export interface RegisterActionWsOptions {
298
117
  */
299
118
  db: Db;
300
119
  /**
301
- * The roles the endpoint's upgrade gate requires (any-of) — what
302
- * `register_ws_endpoint` mounts as `require_role(required_roles)` ahead of
303
- * this handler. Recorded on every registration
120
+ * Roles permitted to upgrade — any-of disjunction, global grants only,
121
+ * mounted as the route's `require_role` gate (403). Omit (or pass `[]`)
122
+ * for any authenticated account. The per-action `auth` in each spec still
123
+ * applies at dispatch time — this is a coarse upgrade-time gate on who may
124
+ * hold a socket, and so on who receives the endpoint's server pushes.
125
+ *
126
+ * It holds for the socket's life: recorded on every registration
304
127
  * (`ConnectionIdentity.required_roles`), so a revoked global grant of a
305
- * listed role closes the socket (`close_sockets_for_role`), and re-read at
306
- * admission against the acting actor's grants, so a revocation that landed
307
- * between the gate and the registration refuses the upgrade with
308
- * `WS_CLOSE_PERMISSION_REVOKED`. This handler does not gate on it before
309
- * the upgrade; mount the 403 gate in front (`register_ws_endpoint` does).
310
- * Omit, or pass `[]`, for an ungated endpoint.
128
+ * listed role closes the socket (a `role` close target, any listed role
129
+ * — see its over-close), and re-read at admission against the acting
130
+ * actor's grants, so a revocation that landed between the gate and the
131
+ * registration refuses the upgrade with `WS_CLOSE_PERMISSION_REVOKED`.
311
132
  */
312
133
  required_roles?: ReadonlyArray<RoleName>;
313
134
  /**
314
- * Existing transport to register connections with. When omitted, a fresh
135
+ * Existing registry to register connections with. When omitted, a fresh
315
136
  * one is created and returned in the result. Pass your own to keep a
316
- * handle for `create_ws_auth_guard` and `send_to`/`broadcast`.
137
+ * handle for `send_to` / `broadcast` before the mount.
317
138
  */
318
- transport?: BackendWebsocketTransport;
139
+ registry?: ConnectionRegistry;
319
140
  /**
320
141
  * The backend's closer — `deps.connection_closer`. This endpoint's
321
- * transport is added to it, so every revocation handler's close reaches
142
+ * registry is added to it, so every revocation handler's close reaches
322
143
  * the sockets opened here. Required so it can't be forgotten: left out of
323
- * the closer, a transport's sockets close only through the audit listener,
324
- * which a failed audit write or a session / token cap eviction never
325
- * reaches. Pass `null` only when no revocation has to reach this transport
326
- * (a harness driving the dispatcher directly), or when the transport was
144
+ * the closer, no revocation closes a registry's sockets — neither the
145
+ * handlers' closes nor the revocation guard, which closes through the same
146
+ * closer. Pass `null` only when no revocation has to reach this registry
147
+ * (a harness driving the dispatcher directly), or when the registry was
327
148
  * added by hand.
328
149
  *
329
- * The transport is added once the mount succeeds, so a mount that throws
150
+ * The registry is added once the mount succeeds, so a mount that throws
330
151
  * adds nothing. The addition is permanent — its remover is not returned.
331
152
  * A caller that must release the membership (as `create_app_server` does
332
- * on close) passes `null` and adds the transport itself, holding the
153
+ * on close) passes `null` and adds the registry itself, holding the
333
154
  * remover `RealtimeCloser.add` returns.
334
155
  */
335
156
  connection_closer: RealtimeCloser | null;
336
157
  /**
337
- * Per-account connection cap for the transport this call creates — see
338
- * `BackendWebsocketTransportOptions.max_connections_per_account`
158
+ * Per-account connection cap for the registry this call creates — see
159
+ * `ConnectionRegistryOptions.max_connections_per_account`
339
160
  * (evict-oldest, closing with `WS_CLOSE_CONNECTION_LIMIT`; `null`
340
- * disables). Rejected alongside `transport`: a supplied transport carries
161
+ * disables). Rejected alongside `registry`: a supplied registry carries
341
162
  * its own cap, set where it was constructed.
342
163
  *
343
164
  * @default DEFAULT_MAX_CONNECTIONS_PER_ACCOUNT
@@ -345,32 +166,41 @@ export interface RegisterActionWsOptions {
345
166
  max_connections_per_account?: number | null;
346
167
  /**
347
168
  * Byte budget of the frames waiting to be written to one connection, for
348
- * the transport this call creates — see
349
- * `BackendWebsocketTransportOptions.outbound_queue_bytes` (a frame that does
169
+ * the registry this call creates — see
170
+ * `ConnectionRegistryOptions.outbound_queue_bytes` (a frame that does
350
171
  * not fit closes the socket with `WS_CLOSE_OUTBOUND_OVERFLOW`). Not derived
351
- * from `max_message_bytes`. Rejected alongside `transport`: a supplied
352
- * transport carries its own budget, set where it was constructed.
172
+ * from `max_message_bytes`. Rejected alongside `registry`: a supplied
173
+ * registry carries its own budget, set where it was constructed.
353
174
  *
354
175
  * @default DEFAULT_WS_OUTBOUND_QUEUE_BYTES
355
176
  */
356
177
  outbound_queue_bytes?: number;
357
178
  /**
358
- * Server-side heartbeat policy. Default-on (receive-silence detection,
359
- * 60s timeout). `false` disables the timer entirely — only do this if
360
- * the upstream stack (TCP keepalive, Cloudflare idle timeout, etc.)
361
- * already owns disconnect detection. Pass an object to tune the timeout.
179
+ * Receive silence (ms) past which the server closes a socket with
180
+ * `WS_CLOSE_SERVER_HEARTBEAT_TIMEOUT`. Any incoming message resets the
181
+ * count — chatty clients never trip it — and the first window after
182
+ * admission is exempt (cold-start grace). `null` keeps silent sockets open:
183
+ * only do this if the upstream stack (TCP keepalive, a proxy's idle
184
+ * timeout) already owns disconnect detection. Must be positive and at most
185
+ * `WS_RECEIVE_TIMEOUT_MAX` — registration throws otherwise. Twin of the
186
+ * Rust spine's `ActionWsOptions.receive_timeout`.
187
+ *
188
+ * @default DEFAULT_WS_RECEIVE_TIMEOUT
362
189
  */
363
- heartbeat?: boolean | ServerHeartbeatOptions;
364
- /** Optional per-message delay for testing loading states. Ignored when `0`. */
365
- artificial_delay?: number;
190
+ receive_timeout?: number | null;
366
191
  /**
367
192
  * Cap on one inbound message, in bytes (UTF-8 for text frames). A larger
368
193
  * message closes the socket with `WS_CLOSE_MESSAGE_TOO_BIG` before it's
369
194
  * parsed — there's no per-message error reply, matching the Rust spine.
370
195
  * The cap is checked after the runtime adapter has buffered the message,
371
196
  * so it bounds dispatch work, not memory; bound the adapter's own frame
372
- * limit too (e.g. `ws`'s `maxPayload`) where memory matters. A consumer
373
- * that raises it passes the same value to the client's
197
+ * limit too (e.g. `ws`'s `maxPayload`) where memory matters, set above this
198
+ * cap — twice it, as the cross-backend test adapters do. A message past the
199
+ * frame limit is refused by the adapter without
200
+ * `WS_CLOSE_MESSAGE_TOO_BIG_REASON` (`ws` closes with the code and an empty
201
+ * reason, Bun drops the socket), so a frame limit equal to this cap loses
202
+ * the reason a message just over it gets. A consumer that raises it passes
203
+ * the same value to the client's
374
204
  * `FrontendWebsocketTransportOptions.max_message_bytes`.
375
205
  *
376
206
  * @default DEFAULT_WS_MAX_MESSAGE_BYTES
@@ -379,11 +209,12 @@ export interface RegisterActionWsOptions {
379
209
  /** Optional logger; defaults to `[ws]` namespace. */
380
210
  log?: LoggerType;
381
211
  /**
382
- * Called once per socket, after the connection is admitted (module doc,
383
- * "Admission"). Awaited before any inbound frame is dispatched — every
212
+ * Called once per socket, after the connection is admitted
213
+ * (`actions/ws_socket_session.ts`, "Admission: the revocation race").
214
+ * Awaited before any inbound frame is dispatched — every
384
215
  * frame the client sends meanwhile waits in arrival order, replies to
385
216
  * server-initiated requests included: a hook that awaits
386
- * `transport.request_connection` on its own connection gets no reply until
217
+ * `registry.request_connection` on its own connection gets no reply until
387
218
  * it returns, so start such a request without awaiting it. Throwing logs an
388
219
  * error and closes the socket with an `internal_error` frame and
389
220
  * `WS_CLOSE_INTERNAL_ERROR` — a failing bootstrap should not leave a
@@ -391,7 +222,7 @@ export interface RegisterActionWsOptions {
391
222
  */
392
223
  on_socket_open?: (ctx: SocketOpenContext) => void | Promise<void>;
393
224
  /**
394
- * Called once per admitted socket on close, *after* the transport has
225
+ * Called once per admitted socket on close, *after* the registry has
395
226
  * removed the connection — a slow hook never holds a dead entry that
396
227
  * broadcasts still target and the per-account cap still counts. Receives
397
228
  * `connection_id` and `identity` captured at open time, the same whether the
@@ -417,15 +248,23 @@ export interface RegisterActionWsOptions {
417
248
  * dispatcher.
418
249
  */
419
250
  action_account_rate_limiter: RateLimiter | null;
251
+ /**
252
+ * Called when an eager pending effect of a frame's action rejects, after
253
+ * the rejection is logged — the WS half of `create_app_server`'s
254
+ * `on_effect_error`, which threads it here for the endpoints it mounts.
255
+ * The context carries `transport: 'ws'`, the action method, and `path`.
256
+ */
257
+ on_effect_error?: (error: unknown, context: EffectErrorContext) => void;
420
258
  }
421
259
  /** Result of `register_action_ws`. */
422
260
  export interface RegisterActionWsResult {
423
- /** The transport bound to the endpoint — supplied or freshly created. */
424
- transport: BackendWebsocketTransport;
261
+ /** The registry bound to the endpoint — supplied or freshly created. */
262
+ registry: ConnectionRegistry;
425
263
  }
426
264
  /**
427
- * Mount a JSON-RPC WebSocket endpoint that dispatches via the shared
428
- * `perform_action` core.
265
+ * Mount a JSON-RPC WebSocket endpoint — the upgrade route with its origin,
266
+ * auth, token-scope, acting-actor, and role guards (module doc, "The upgrade
267
+ * route") — that dispatches via the shared `perform_action` core.
429
268
  *
430
269
  * Wire behavior:
431
270
  * - Batch JSON-RPC is rejected (single-message only).
@@ -445,8 +284,8 @@ export interface RegisterActionWsResult {
445
284
  * - Authorization phase runs **per message** — role_grant changes during a
446
285
  * connection lifetime are picked up on the next message without any
447
286
  * in-place refresh. Authentication invalidation closes the socket: the
448
- * revocation handlers through `connection_closer`, and `create_ws_auth_guard`
449
- * on the audit row.
287
+ * revocation handlers through `connection_closer`, and the revocation guard
288
+ * (`create_revocation_guard`) on the audit row.
450
289
  * - Admission re-reads the credential once, after the handshake: a socket
451
290
  * whose session or token was revoked while it was upgrading closes with
452
291
  * `WS_CLOSE_SESSION_REVOKED`, one that lost a role `required_roles` lists
@@ -454,23 +293,23 @@ export interface RegisterActionWsResult {
454
293
  * `WS_CLOSE_INTERNAL_ERROR`. Frames sent before admission wait for it.
455
294
  * - A revoked global grant of a role `required_roles` lists closes the
456
295
  * account's sockets on this endpoint with `WS_CLOSE_PERMISSION_REVOKED`,
457
- * through `create_ws_auth_guard`; nothing more is sent on them.
296
+ * through the revocation guard; nothing more is sent on them.
458
297
  * - A socket the server has closed dispatches nothing more, whether or not
459
298
  * its client answers the close.
460
299
  * - Every frame sent — responses, error frames, notifications — goes through
461
- * the transport's outbound queue. A connection with more waiting than its
300
+ * the registry's outbound queue. A connection with more waiting than its
462
301
  * `outbound_queue_bytes` budget closes with `WS_CLOSE_OUTBOUND_OVERFLOW`, and
463
302
  * the response of the request whose handler overflowed it is not sent.
464
303
  *
465
- * @returns the transport (supplied or freshly created) — retain it to wire
466
- * `create_ws_auth_guard` or broadcast on audit events.
467
- * @mutates options.app - registers a `GET path` route via `upgradeWebSocket`
468
- * @mutates options.transport - per socket, registers, admits, and removes a
304
+ * @returns the registry (supplied or freshly created) — retain it to broadcast
305
+ * @mutates options.app - registers the `GET path` upgrade route, its guards
306
+ * ahead of `upgradeWebSocket`
307
+ * @mutates options.registry - per socket, registers, admits, and removes a
469
308
  * connection via `register_pending` / `admit` / `remove_connection`
470
- * @mutates options.connection_closer - adds the endpoint's transport, once the
309
+ * @mutates options.connection_closer - adds the endpoint's registry, once the
471
310
  * mount has succeeded
472
311
  * @throws Error when `max_connections_per_account` or `outbound_queue_bytes`
473
- * is passed alongside `transport`, when the cap is neither `null` nor a
312
+ * is passed alongside `registry`, when the cap is neither `null` nor a
474
313
  * positive integer, when the budget is not a positive integer, or when
475
314
  * `actions` fails to compile (`compile_action_registry`)
476
315
  */
@@ -1 +1 @@
1
- {"version":3,"file":"register_action_ws.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/register_action_ws.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuHG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAE3D,OAAO,EAAU,KAAK,MAAM,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAUpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAMvD,OAAO,KAAK,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