@fuzdev/fuz_app 0.51.0 → 0.53.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 (395) hide show
  1. package/dist/actions/CLAUDE.md +43 -10
  2. package/dist/actions/action_bridge.d.ts +3 -1
  3. package/dist/actions/action_bridge.d.ts.map +1 -1
  4. package/dist/actions/action_bridge.js +3 -1
  5. package/dist/actions/action_codegen.d.ts +28 -43
  6. package/dist/actions/action_codegen.d.ts.map +1 -1
  7. package/dist/actions/action_codegen.js +31 -50
  8. package/dist/actions/action_event.d.ts +44 -1
  9. package/dist/actions/action_event.d.ts.map +1 -1
  10. package/dist/actions/action_event.js +44 -1
  11. package/dist/actions/action_event_helpers.d.ts +26 -0
  12. package/dist/actions/action_event_helpers.d.ts.map +1 -1
  13. package/dist/actions/action_event_helpers.js +26 -1
  14. package/dist/actions/action_peer.d.ts +17 -0
  15. package/dist/actions/action_peer.d.ts.map +1 -1
  16. package/dist/actions/action_peer.js +8 -9
  17. package/dist/actions/action_registry.d.ts +1 -5
  18. package/dist/actions/action_registry.d.ts.map +1 -1
  19. package/dist/actions/action_registry.js +5 -11
  20. package/dist/actions/action_rpc.d.ts +20 -0
  21. package/dist/actions/action_rpc.d.ts.map +1 -1
  22. package/dist/actions/action_rpc.js +45 -20
  23. package/dist/actions/action_spec.d.ts +75 -6
  24. package/dist/actions/action_spec.d.ts.map +1 -1
  25. package/dist/actions/action_spec.js +36 -6
  26. package/dist/actions/frontend_rpc_client.d.ts +1 -9
  27. package/dist/actions/frontend_rpc_client.d.ts.map +1 -1
  28. package/dist/actions/frontend_rpc_client.js +1 -9
  29. package/dist/actions/register_action_ws.d.ts +19 -0
  30. package/dist/actions/register_action_ws.d.ts.map +1 -1
  31. package/dist/actions/register_action_ws.js +44 -1
  32. package/dist/actions/register_ws_endpoint.d.ts +3 -0
  33. package/dist/actions/register_ws_endpoint.d.ts.map +1 -1
  34. package/dist/actions/register_ws_endpoint.js +3 -0
  35. package/dist/actions/request_tracker.svelte.d.ts +24 -16
  36. package/dist/actions/request_tracker.svelte.d.ts.map +1 -1
  37. package/dist/actions/request_tracker.svelte.js +24 -16
  38. package/dist/actions/rpc_client.d.ts +0 -1
  39. package/dist/actions/rpc_client.d.ts.map +1 -1
  40. package/dist/actions/rpc_client.js +3 -17
  41. package/dist/actions/socket.svelte.d.ts +35 -16
  42. package/dist/actions/socket.svelte.d.ts.map +1 -1
  43. package/dist/actions/socket.svelte.js +33 -14
  44. package/dist/actions/transports.d.ts +15 -5
  45. package/dist/actions/transports.d.ts.map +1 -1
  46. package/dist/actions/transports.js +15 -15
  47. package/dist/actions/transports_http.d.ts +7 -0
  48. package/dist/actions/transports_http.d.ts.map +1 -1
  49. package/dist/actions/transports_http.js +7 -0
  50. package/dist/actions/transports_ws.d.ts +13 -0
  51. package/dist/actions/transports_ws.d.ts.map +1 -1
  52. package/dist/actions/transports_ws.js +13 -0
  53. package/dist/actions/transports_ws_auth_guard.d.ts +6 -4
  54. package/dist/actions/transports_ws_auth_guard.d.ts.map +1 -1
  55. package/dist/actions/transports_ws_auth_guard.js +6 -4
  56. package/dist/actions/transports_ws_backend.d.ts +14 -1
  57. package/dist/actions/transports_ws_backend.d.ts.map +1 -1
  58. package/dist/actions/transports_ws_backend.js +14 -10
  59. package/dist/auth/CLAUDE.md +64 -18
  60. package/dist/auth/account_queries.d.ts +7 -0
  61. package/dist/auth/account_queries.d.ts.map +1 -1
  62. package/dist/auth/account_queries.js +7 -0
  63. package/dist/auth/admin_action_specs.d.ts +5 -0
  64. package/dist/auth/admin_action_specs.d.ts.map +1 -1
  65. package/dist/auth/admin_action_specs.js +5 -0
  66. package/dist/auth/admin_actions.d.ts +1 -0
  67. package/dist/auth/admin_actions.d.ts.map +1 -1
  68. package/dist/auth/admin_actions.js +1 -0
  69. package/dist/auth/api_token_queries.d.ts +6 -0
  70. package/dist/auth/api_token_queries.d.ts.map +1 -1
  71. package/dist/auth/api_token_queries.js +6 -0
  72. package/dist/auth/app_settings_queries.d.ts +4 -0
  73. package/dist/auth/app_settings_queries.d.ts.map +1 -1
  74. package/dist/auth/app_settings_queries.js +4 -0
  75. package/dist/auth/audit_log_queries.d.ts +5 -0
  76. package/dist/auth/audit_log_queries.d.ts.map +1 -1
  77. package/dist/auth/audit_log_queries.js +5 -0
  78. package/dist/auth/audit_log_routes.d.ts +2 -2
  79. package/dist/auth/audit_log_routes.js +2 -2
  80. package/dist/auth/audit_log_schema.d.ts +2 -0
  81. package/dist/auth/audit_log_schema.d.ts.map +1 -1
  82. package/dist/auth/audit_log_schema.js +134 -55
  83. package/dist/auth/bearer_auth.d.ts +2 -0
  84. package/dist/auth/bearer_auth.d.ts.map +1 -1
  85. package/dist/auth/bearer_auth.js +2 -0
  86. package/dist/auth/bootstrap_account.d.ts +3 -0
  87. package/dist/auth/bootstrap_account.d.ts.map +1 -1
  88. package/dist/auth/bootstrap_account.js +3 -0
  89. package/dist/auth/cleanup.d.ts +6 -0
  90. package/dist/auth/cleanup.d.ts.map +1 -1
  91. package/dist/auth/cleanup.js +6 -0
  92. package/dist/auth/daemon_token_middleware.d.ts +4 -0
  93. package/dist/auth/daemon_token_middleware.d.ts.map +1 -1
  94. package/dist/auth/daemon_token_middleware.js +4 -0
  95. package/dist/auth/invite_queries.d.ts +3 -0
  96. package/dist/auth/invite_queries.d.ts.map +1 -1
  97. package/dist/auth/invite_queries.js +3 -0
  98. package/dist/auth/permit_offer_action_specs.d.ts +6 -0
  99. package/dist/auth/permit_offer_action_specs.d.ts.map +1 -1
  100. package/dist/auth/permit_offer_action_specs.js +11 -0
  101. package/dist/auth/permit_offer_queries.d.ts +18 -0
  102. package/dist/auth/permit_offer_queries.d.ts.map +1 -1
  103. package/dist/auth/permit_offer_queries.js +18 -0
  104. package/dist/auth/permit_queries.d.ts +7 -0
  105. package/dist/auth/permit_queries.d.ts.map +1 -1
  106. package/dist/auth/permit_queries.js +7 -0
  107. package/dist/auth/request_context.d.ts +1 -0
  108. package/dist/auth/request_context.d.ts.map +1 -1
  109. package/dist/auth/request_context.js +1 -0
  110. package/dist/auth/role_schema.d.ts +2 -0
  111. package/dist/auth/role_schema.d.ts.map +1 -1
  112. package/dist/auth/role_schema.js +2 -0
  113. package/dist/auth/self_service_role_actions.d.ts +1 -0
  114. package/dist/auth/self_service_role_actions.d.ts.map +1 -1
  115. package/dist/auth/self_service_role_actions.js +1 -0
  116. package/dist/auth/session_lifecycle.d.ts +2 -0
  117. package/dist/auth/session_lifecycle.d.ts.map +1 -1
  118. package/dist/auth/session_lifecycle.js +2 -0
  119. package/dist/auth/session_middleware.d.ts +1 -0
  120. package/dist/auth/session_middleware.d.ts.map +1 -1
  121. package/dist/auth/session_middleware.js +1 -0
  122. package/dist/auth/session_queries.d.ts +9 -0
  123. package/dist/auth/session_queries.d.ts.map +1 -1
  124. package/dist/auth/session_queries.js +9 -0
  125. package/dist/cli/config.d.ts +1 -2
  126. package/dist/cli/config.d.ts.map +1 -1
  127. package/dist/cli/config.js +1 -2
  128. package/dist/cli/daemon.d.ts +6 -1
  129. package/dist/cli/daemon.d.ts.map +1 -1
  130. package/dist/cli/daemon.js +6 -1
  131. package/dist/db/assert_row.d.ts +2 -1
  132. package/dist/db/assert_row.d.ts.map +1 -1
  133. package/dist/db/assert_row.js +2 -1
  134. package/dist/db/create_db.d.ts +3 -1
  135. package/dist/db/create_db.d.ts.map +1 -1
  136. package/dist/db/create_db.js +3 -1
  137. package/dist/db/db.d.ts +15 -4
  138. package/dist/db/db.d.ts.map +1 -1
  139. package/dist/db/db.js +14 -3
  140. package/dist/db/db_pg.d.ts +4 -3
  141. package/dist/db/db_pg.d.ts.map +1 -1
  142. package/dist/db/db_pg.js +7 -5
  143. package/dist/db/db_pglite.d.ts +4 -4
  144. package/dist/db/db_pglite.js +4 -4
  145. package/dist/db/migrate.d.ts +7 -4
  146. package/dist/db/migrate.d.ts.map +1 -1
  147. package/dist/db/migrate.js +5 -2
  148. package/dist/db/sql_identifier.d.ts +2 -1
  149. package/dist/db/sql_identifier.d.ts.map +1 -1
  150. package/dist/db/sql_identifier.js +2 -1
  151. package/dist/db/status.d.ts +4 -1
  152. package/dist/db/status.d.ts.map +1 -1
  153. package/dist/db/status.js +5 -2
  154. package/dist/dev/setup.d.ts +15 -2
  155. package/dist/dev/setup.d.ts.map +1 -1
  156. package/dist/dev/setup.js +15 -2
  157. package/dist/env/dotenv.d.ts +2 -1
  158. package/dist/env/dotenv.d.ts.map +1 -1
  159. package/dist/env/dotenv.js +2 -1
  160. package/dist/env/load.d.ts +1 -3
  161. package/dist/env/load.d.ts.map +1 -1
  162. package/dist/env/load.js +1 -3
  163. package/dist/env/resolve.d.ts +1 -1
  164. package/dist/env/resolve.js +1 -1
  165. package/dist/env/update_env_variable.d.ts +2 -0
  166. package/dist/env/update_env_variable.d.ts.map +1 -1
  167. package/dist/env/update_env_variable.js +2 -0
  168. package/dist/hono_context.d.ts +2 -5
  169. package/dist/hono_context.d.ts.map +1 -1
  170. package/dist/hono_context.js +2 -5
  171. package/dist/http/common_routes.d.ts +0 -8
  172. package/dist/http/common_routes.d.ts.map +1 -1
  173. package/dist/http/common_routes.js +0 -8
  174. package/dist/http/db_routes.d.ts +0 -3
  175. package/dist/http/db_routes.d.ts.map +1 -1
  176. package/dist/http/db_routes.js +0 -3
  177. package/dist/http/error_schemas.d.ts +12 -11
  178. package/dist/http/error_schemas.d.ts.map +1 -1
  179. package/dist/http/error_schemas.js +11 -7
  180. package/dist/http/jsonrpc_errors.d.ts +0 -6
  181. package/dist/http/jsonrpc_errors.d.ts.map +1 -1
  182. package/dist/http/jsonrpc_errors.js +0 -6
  183. package/dist/http/origin.d.ts +6 -13
  184. package/dist/http/origin.d.ts.map +1 -1
  185. package/dist/http/origin.js +7 -14
  186. package/dist/http/pending_effects.d.ts +4 -0
  187. package/dist/http/pending_effects.d.ts.map +1 -1
  188. package/dist/http/pending_effects.js +4 -0
  189. package/dist/http/proxy.d.ts +3 -6
  190. package/dist/http/proxy.d.ts.map +1 -1
  191. package/dist/http/proxy.js +3 -6
  192. package/dist/http/route_spec.d.ts +14 -35
  193. package/dist/http/route_spec.d.ts.map +1 -1
  194. package/dist/http/route_spec.js +17 -22
  195. package/dist/http/schema_helpers.d.ts +0 -4
  196. package/dist/http/schema_helpers.d.ts.map +1 -1
  197. package/dist/http/schema_helpers.js +0 -4
  198. package/dist/http/surface.d.ts +2 -12
  199. package/dist/http/surface.d.ts.map +1 -1
  200. package/dist/http/surface.js +1 -12
  201. package/dist/rate_limiter.d.ts +30 -1
  202. package/dist/rate_limiter.d.ts.map +1 -1
  203. package/dist/rate_limiter.js +40 -1
  204. package/dist/realtime/sse.d.ts +7 -2
  205. package/dist/realtime/sse.d.ts.map +1 -1
  206. package/dist/realtime/sse.js +3 -2
  207. package/dist/realtime/sse_auth_guard.d.ts +21 -21
  208. package/dist/realtime/sse_auth_guard.d.ts.map +1 -1
  209. package/dist/realtime/sse_auth_guard.js +24 -24
  210. package/dist/realtime/subscriber_registry.d.ts +4 -5
  211. package/dist/realtime/subscriber_registry.d.ts.map +1 -1
  212. package/dist/realtime/subscriber_registry.js +4 -5
  213. package/dist/runtime/fs.d.ts +5 -3
  214. package/dist/runtime/fs.d.ts.map +1 -1
  215. package/dist/runtime/fs.js +5 -3
  216. package/dist/runtime/mock.d.ts +6 -3
  217. package/dist/runtime/mock.d.ts.map +1 -1
  218. package/dist/runtime/mock.js +6 -3
  219. package/dist/server/app_backend.d.ts +1 -0
  220. package/dist/server/app_backend.d.ts.map +1 -1
  221. package/dist/server/app_backend.js +1 -0
  222. package/dist/server/app_server.d.ts +31 -5
  223. package/dist/server/app_server.d.ts.map +1 -1
  224. package/dist/server/app_server.js +23 -7
  225. package/dist/server/startup.d.ts +0 -2
  226. package/dist/server/startup.d.ts.map +1 -1
  227. package/dist/server/startup.js +0 -2
  228. package/dist/server/static.d.ts +0 -1
  229. package/dist/server/static.d.ts.map +1 -1
  230. package/dist/server/static.js +0 -1
  231. package/dist/server/validate_nginx.d.ts +3 -3
  232. package/dist/server/validate_nginx.d.ts.map +1 -1
  233. package/dist/server/validate_nginx.js +0 -3
  234. package/dist/testing/CLAUDE.md +1 -1
  235. package/dist/testing/admin_integration.d.ts +5 -1
  236. package/dist/testing/admin_integration.d.ts.map +1 -1
  237. package/dist/testing/admin_integration.js +8 -6
  238. package/dist/testing/adversarial_404.d.ts +0 -2
  239. package/dist/testing/adversarial_404.d.ts.map +1 -1
  240. package/dist/testing/adversarial_404.js +0 -2
  241. package/dist/testing/adversarial_headers.d.ts +5 -4
  242. package/dist/testing/adversarial_headers.d.ts.map +1 -1
  243. package/dist/testing/adversarial_headers.js +5 -4
  244. package/dist/testing/adversarial_input.d.ts +4 -2
  245. package/dist/testing/adversarial_input.d.ts.map +1 -1
  246. package/dist/testing/adversarial_input.js +4 -2
  247. package/dist/testing/app_server.d.ts +25 -0
  248. package/dist/testing/app_server.d.ts.map +1 -1
  249. package/dist/testing/app_server.js +11 -2
  250. package/dist/testing/assertions.d.ts +23 -11
  251. package/dist/testing/assertions.d.ts.map +1 -1
  252. package/dist/testing/assertions.js +23 -11
  253. package/dist/testing/attack_surface.d.ts +0 -4
  254. package/dist/testing/attack_surface.d.ts.map +1 -1
  255. package/dist/testing/attack_surface.js +0 -4
  256. package/dist/testing/audit_completeness.d.ts +4 -1
  257. package/dist/testing/audit_completeness.d.ts.map +1 -1
  258. package/dist/testing/audit_completeness.js +4 -1
  259. package/dist/testing/auth_apps.d.ts +5 -10
  260. package/dist/testing/auth_apps.d.ts.map +1 -1
  261. package/dist/testing/auth_apps.js +5 -10
  262. package/dist/testing/data_exposure.d.ts +0 -11
  263. package/dist/testing/data_exposure.d.ts.map +1 -1
  264. package/dist/testing/data_exposure.js +0 -11
  265. package/dist/testing/db.d.ts +9 -7
  266. package/dist/testing/db.d.ts.map +1 -1
  267. package/dist/testing/db.js +9 -7
  268. package/dist/testing/error_coverage.d.ts +9 -14
  269. package/dist/testing/error_coverage.d.ts.map +1 -1
  270. package/dist/testing/error_coverage.js +9 -14
  271. package/dist/testing/integration.d.ts +4 -1
  272. package/dist/testing/integration.d.ts.map +1 -1
  273. package/dist/testing/integration.js +4 -1
  274. package/dist/testing/integration_helpers.d.ts +5 -34
  275. package/dist/testing/integration_helpers.d.ts.map +1 -1
  276. package/dist/testing/integration_helpers.js +5 -41
  277. package/dist/testing/middleware.d.ts +5 -10
  278. package/dist/testing/middleware.d.ts.map +1 -1
  279. package/dist/testing/middleware.js +5 -10
  280. package/dist/testing/mock_fs.d.ts +0 -2
  281. package/dist/testing/mock_fs.d.ts.map +1 -1
  282. package/dist/testing/mock_fs.js +0 -2
  283. package/dist/testing/rate_limiting.d.ts +3 -1
  284. package/dist/testing/rate_limiting.d.ts.map +1 -1
  285. package/dist/testing/rate_limiting.js +3 -1
  286. package/dist/testing/round_trip.d.ts +0 -2
  287. package/dist/testing/round_trip.d.ts.map +1 -1
  288. package/dist/testing/round_trip.js +0 -2
  289. package/dist/testing/rpc_attack_surface.d.ts +0 -2
  290. package/dist/testing/rpc_attack_surface.d.ts.map +1 -1
  291. package/dist/testing/rpc_attack_surface.js +0 -2
  292. package/dist/testing/rpc_helpers.d.ts +21 -14
  293. package/dist/testing/rpc_helpers.d.ts.map +1 -1
  294. package/dist/testing/rpc_helpers.js +21 -14
  295. package/dist/testing/rpc_round_trip.d.ts +0 -2
  296. package/dist/testing/rpc_round_trip.d.ts.map +1 -1
  297. package/dist/testing/rpc_round_trip.js +0 -2
  298. package/dist/testing/schema_generators.d.ts +5 -3
  299. package/dist/testing/schema_generators.d.ts.map +1 -1
  300. package/dist/testing/schema_generators.js +22 -3
  301. package/dist/testing/sse_round_trip.d.ts +3 -1
  302. package/dist/testing/sse_round_trip.d.ts.map +1 -1
  303. package/dist/testing/sse_round_trip.js +3 -1
  304. package/dist/testing/standard.d.ts +0 -2
  305. package/dist/testing/standard.d.ts.map +1 -1
  306. package/dist/testing/standard.js +0 -2
  307. package/dist/testing/stubs.d.ts +8 -3
  308. package/dist/testing/stubs.d.ts.map +1 -1
  309. package/dist/testing/stubs.js +10 -3
  310. package/dist/testing/surface_invariants.d.ts +14 -3
  311. package/dist/testing/surface_invariants.d.ts.map +1 -1
  312. package/dist/testing/surface_invariants.js +14 -3
  313. package/dist/testing/ws_round_trip.d.ts +13 -1
  314. package/dist/testing/ws_round_trip.d.ts.map +1 -1
  315. package/dist/ui/AccountSessions.svelte +9 -0
  316. package/dist/ui/AccountSessions.svelte.d.ts.map +1 -1
  317. package/dist/ui/AdminAccounts.svelte +10 -0
  318. package/dist/ui/AdminAccounts.svelte.d.ts.map +1 -1
  319. package/dist/ui/AdminAuditLog.svelte +10 -0
  320. package/dist/ui/AdminAuditLog.svelte.d.ts.map +1 -1
  321. package/dist/ui/AdminInvites.svelte +9 -0
  322. package/dist/ui/AdminInvites.svelte.d.ts.map +1 -1
  323. package/dist/ui/AdminOverview.svelte +10 -0
  324. package/dist/ui/AdminOverview.svelte.d.ts.map +1 -1
  325. package/dist/ui/AdminPermitHistory.svelte +9 -0
  326. package/dist/ui/AdminPermitHistory.svelte.d.ts.map +1 -1
  327. package/dist/ui/AdminSessions.svelte +10 -0
  328. package/dist/ui/AdminSessions.svelte.d.ts.map +1 -1
  329. package/dist/ui/AdminSettings.svelte +9 -0
  330. package/dist/ui/AdminSettings.svelte.d.ts.map +1 -1
  331. package/dist/ui/AdminSurface.svelte +9 -0
  332. package/dist/ui/AdminSurface.svelte.d.ts.map +1 -1
  333. package/dist/ui/AppShell.svelte +24 -0
  334. package/dist/ui/AppShell.svelte.d.ts +23 -0
  335. package/dist/ui/AppShell.svelte.d.ts.map +1 -1
  336. package/dist/ui/BootstrapForm.svelte +17 -0
  337. package/dist/ui/BootstrapForm.svelte.d.ts +4 -0
  338. package/dist/ui/BootstrapForm.svelte.d.ts.map +1 -1
  339. package/dist/ui/CLAUDE.md +1 -1
  340. package/dist/ui/ColumnLayout.svelte +11 -0
  341. package/dist/ui/ColumnLayout.svelte.d.ts +10 -0
  342. package/dist/ui/ColumnLayout.svelte.d.ts.map +1 -1
  343. package/dist/ui/Datatable.svelte +18 -0
  344. package/dist/ui/Datatable.svelte.d.ts +17 -0
  345. package/dist/ui/Datatable.svelte.d.ts.map +1 -1
  346. package/dist/ui/LoginForm.svelte +18 -0
  347. package/dist/ui/LoginForm.svelte.d.ts +9 -0
  348. package/dist/ui/LoginForm.svelte.d.ts.map +1 -1
  349. package/dist/ui/LogoutButton.svelte +9 -0
  350. package/dist/ui/LogoutButton.svelte.d.ts +8 -0
  351. package/dist/ui/LogoutButton.svelte.d.ts.map +1 -1
  352. package/dist/ui/MenuLink.svelte +10 -0
  353. package/dist/ui/MenuLink.svelte.d.ts +9 -0
  354. package/dist/ui/MenuLink.svelte.d.ts.map +1 -1
  355. package/dist/ui/OpenSignupToggle.svelte +9 -0
  356. package/dist/ui/OpenSignupToggle.svelte.d.ts.map +1 -1
  357. package/dist/ui/SignupForm.svelte +16 -0
  358. package/dist/ui/SignupForm.svelte.d.ts +4 -0
  359. package/dist/ui/SignupForm.svelte.d.ts.map +1 -1
  360. package/dist/ui/SurfaceExplorer.svelte +9 -0
  361. package/dist/ui/SurfaceExplorer.svelte.d.ts.map +1 -1
  362. package/dist/ui/audit_log_state.svelte.d.ts +6 -1
  363. package/dist/ui/audit_log_state.svelte.d.ts.map +1 -1
  364. package/dist/ui/audit_log_state.svelte.js +7 -2
  365. package/dist/ui/auth_state.svelte.d.ts +16 -4
  366. package/dist/ui/auth_state.svelte.d.ts.map +1 -1
  367. package/dist/ui/auth_state.svelte.js +16 -4
  368. package/dist/ui/form_state.svelte.d.ts +9 -0
  369. package/dist/ui/form_state.svelte.d.ts.map +1 -1
  370. package/dist/ui/form_state.svelte.js +9 -0
  371. package/dist/ui/loadable.svelte.d.ts +6 -1
  372. package/dist/ui/loadable.svelte.d.ts.map +1 -1
  373. package/dist/ui/loadable.svelte.js +6 -1
  374. package/dist/ui/permit_offers_state.svelte.d.ts +2 -0
  375. package/dist/ui/permit_offers_state.svelte.d.ts.map +1 -1
  376. package/dist/ui/permit_offers_state.svelte.js +2 -0
  377. package/dist/ui/popover.svelte.d.ts +17 -4
  378. package/dist/ui/popover.svelte.d.ts.map +1 -1
  379. package/dist/ui/popover.svelte.js +17 -4
  380. package/dist/ui/position_helpers.d.ts +1 -3
  381. package/dist/ui/position_helpers.d.ts.map +1 -1
  382. package/dist/ui/position_helpers.js +1 -3
  383. package/dist/ui/sidebar_state.svelte.d.ts +21 -9
  384. package/dist/ui/sidebar_state.svelte.d.ts.map +1 -1
  385. package/dist/ui/sidebar_state.svelte.js +16 -2
  386. package/dist/ui/table_state.svelte.d.ts +14 -0
  387. package/dist/ui/table_state.svelte.d.ts.map +1 -1
  388. package/dist/ui/table_state.svelte.js +14 -0
  389. package/dist/ui/ui_fetch.d.ts +1 -7
  390. package/dist/ui/ui_fetch.d.ts.map +1 -1
  391. package/dist/ui/ui_fetch.js +1 -7
  392. package/dist/ui/ui_format.d.ts +2 -14
  393. package/dist/ui/ui_format.d.ts.map +1 -1
  394. package/dist/ui/ui_format.js +2 -14
  395. package/package.json +2 -2
@@ -33,7 +33,6 @@ import { jsonrpc_error_messages } from '../http/jsonrpc_errors.js';
33
33
  * const api_result = create_rpc_client<MyActionsApi>({peer, environment});
34
34
  * ```
35
35
  *
36
- * @param options - client options (peer, environment, optional callbacks)
37
36
  * @returns a Proxy typed as `TApi` that responds to any method name found in the environment's specs
38
37
  */
39
38
  export const create_rpc_client = (options) => {
@@ -56,9 +55,6 @@ export const create_rpc_client = (options) => {
56
55
  },
57
56
  });
58
57
  };
59
- /**
60
- * Creates a method that executes an action through its complete lifecycle.
61
- */
62
58
  const create_action_method = (peer, environment, spec, on_action_event, transport_for_method) => {
63
59
  switch (spec.kind) {
64
60
  case 'local_call':
@@ -71,10 +67,7 @@ const create_action_method = (peer, environment, spec, on_action_event, transpor
71
67
  return create_remote_notification_method(peer, environment, spec, on_action_event, transport_for_method);
72
68
  }
73
69
  };
74
- /**
75
- * Creates a synchronous local call method.
76
- * Returns value directly - can throw on error (sync methods cannot return Result).
77
- */
70
+ /** Sync local-call dispatch — returns the value directly; throws on error (no Result wrapping). */
78
71
  const create_sync_local_call_method = (environment, spec, on_action_event) => {
79
72
  return (input) => {
80
73
  const event = create_action_event(environment, spec, input);
@@ -91,8 +84,7 @@ const create_sync_local_call_method = (environment, spec, on_action_event) => {
91
84
  };
92
85
  };
93
86
  /**
94
- * Creates an asynchronous local call method.
95
- * Returns Result for type-safe error handling.
87
+ * Async local-call dispatch returns Result.
96
88
  *
97
89
  * Local calls don't traverse a transport, so `transport_name` is ignored and
98
90
  * `signal` can only short-circuit before the synchronous handler runs (no
@@ -112,9 +104,6 @@ const create_async_local_call_method = (environment, spec, on_action_event) => {
112
104
  return extract_action_result(event);
113
105
  };
114
106
  };
115
- /**
116
- * Creates a request/response method that communicates over the network.
117
- */
118
107
  const create_request_response_method = (peer, environment, spec, on_action_event, transport_for_method) => {
119
108
  return async (input, options) => {
120
109
  const event = create_action_event(environment, spec, input);
@@ -143,10 +132,7 @@ const create_request_response_method = (peer, environment, spec, on_action_event
143
132
  return extract_action_result(event);
144
133
  };
145
134
  };
146
- /**
147
- * Creates a remote notification method (fire and forget).
148
- * Returns Result<{value: void}> for consistency.
149
- */
135
+ /** Fire-and-forget remote notification — returns `Result<{value: void}>` for consistency with `request_response`. */
150
136
  const create_remote_notification_method = (peer, environment, spec, on_action_event, transport_for_method) => {
151
137
  return async (input, options) => {
152
138
  const event = create_action_event(environment, spec, input);
@@ -8,13 +8,13 @@
8
8
  * server revokes auth), exposes reactive status for UI indicators, and ships
9
9
  * three correctness primitives default-on:
10
10
  *
11
- * - {@link FrontendWebsocketClient.request} — promise-based JSON-RPC with
11
+ * - `FrontendWebsocketClient.request` — promise-based JSON-RPC with
12
12
  * auto-assigned ids and a pending-id map. Intercepts responses on the
13
13
  * message path so request/response correlation is transport-level rather
14
14
  * than re-invented per consumer.
15
15
  * - **Durable queue** — `request()` calls made while disconnected buffer up
16
16
  * to `DEFAULT_QUEUE_MAX_SIZE` requests and flush on reopen. Overflow
17
- * rejects with `queue_overflow`. Raw {@link FrontendWebsocketClient.send}
17
+ * rejects with `queue_overflow`. Raw `FrontendWebsocketClient.send`
18
18
  * is drop-on-disconnect (fire-and-forget notifications want that).
19
19
  * - **Activity-aware heartbeat** — idles fire a shared `heartbeat` request;
20
20
  * receive-silence past `DEFAULT_HEARTBEAT_RECEIVE_TIMEOUT` closes
@@ -98,9 +98,9 @@ export interface FrontendWebsocketClientOptions {
98
98
  */
99
99
  heartbeat?: boolean | FrontendWebsocketHeartbeatOptions | null;
100
100
  /**
101
- * Durable queue for {@link FrontendWebsocketClient.request}. `true` or omit
101
+ * Durable queue for `FrontendWebsocketClient.request`. `true` or omit
102
102
  * for defaults; `false` disables buffering (requests while disconnected
103
- * reject immediately). Raw {@link FrontendWebsocketClient.send} is never
103
+ * reject immediately). Raw `FrontendWebsocketClient.send` is never
104
104
  * queued — use `request()` for RPC semantics.
105
105
  */
106
106
  queue?: boolean | FrontendWebsocketQueueOptions;
@@ -162,6 +162,10 @@ export declare class FrontendWebsocketClient implements WebsocketConnection, Dis
162
162
  * timer and transitions status to `closed` (since the lie of
163
163
  * `'reconnecting'` would be visible to UI indicators). Turning it back on
164
164
  * does not synthesize a reconnect — wait for the next close.
165
+ *
166
+ * @mutates this - replaces the reconnect policy fields; may also reset
167
+ * `status`, `reconnect_count`, and `current_reconnect_delay` when an
168
+ * in-flight reconnect timer is cancelled or rescheduled
165
169
  */
166
170
  set_reconnect(reconnect?: boolean | FrontendWebsocketReconnectOptions | null): void;
167
171
  /**
@@ -175,6 +179,9 @@ export declare class FrontendWebsocketClient implements WebsocketConnection, Dis
175
179
  * When connected, the live timer is restarted immediately so the new
176
180
  * `interval` / `receive_timeout` take effect without a reconnect; when
177
181
  * disconnected, just stashes the policy for the next open.
182
+ *
183
+ * @mutates this - replaces the heartbeat policy fields; restarts the
184
+ * live heartbeat timer when connected
178
185
  */
179
186
  set_heartbeat(heartbeat?: boolean | FrontendWebsocketHeartbeatOptions | null): void;
180
187
  /**
@@ -189,6 +196,9 @@ export declare class FrontendWebsocketClient implements WebsocketConnection, Dis
189
196
  * clears heartbeat) or the policy change of `set_reconnect(false)`
190
197
  * (which disables future reconnects). The queue stays intact so that
191
198
  * calling `connect` later flushes buffered work.
199
+ *
200
+ * @mutates this - clears the pending reconnect timer, sets `status` to
201
+ * `closed`, resets `reconnect_count` and `current_reconnect_delay`
192
202
  */
193
203
  cancel_reconnect(): void;
194
204
  get url(): string;
@@ -202,12 +212,21 @@ export declare class FrontendWebsocketClient implements WebsocketConnection, Dis
202
212
  * Open the WebSocket. No-op on SSR, or if the session has been revoked.
203
213
  * Cancels any pending reconnect and tears down any existing connection first;
204
214
  * an open prior socket is closed with a normal-closure code.
215
+ *
216
+ * @mutates this - replaces `ws`, sets `status` to `connecting` (or
217
+ * `closed` on construction failure), and on construction failure may
218
+ * schedule a reconnect (mutating `reconnect_count` /
219
+ * `current_reconnect_delay`)
205
220
  */
206
221
  connect(): void;
207
222
  /**
208
223
  * Close the WebSocket, cancel any pending reconnect, and reset the reconnect
209
224
  * backoff counters. Puts the client in `closed` status; call `connect()` to
210
225
  * reopen. Safe to call more than once.
226
+ *
227
+ * @mutates this - clears `ws`, heartbeat, and reconnect timers; sets
228
+ * `status` to `closed`; rejects every pending and queued request with
229
+ * `service_unavailable`
211
230
  */
212
231
  disconnect(code?: number): void;
213
232
  /** Explicit-resource-management hook — supports `using client = new FrontendWebsocketClient(url)`. */
@@ -238,17 +257,18 @@ export declare class FrontendWebsocketClient implements WebsocketConnection, Dis
238
257
  * for queued-but-never-sent (server doesn't know about it) and
239
258
  * response-beat-cancel races.
240
259
  *
241
- * Rejections throw `ThrownJsonrpcError` with a specific code so
242
- * `FrontendWebsocketTransport` can preserve the code verbatim in its
243
- * error envelope rather than collapsing every rejection to
244
- * `internal_error`:
245
- * - `unauthenticated` — session revoked (entry check or close code);
246
- * - `request_cancelled` — caller's `AbortSignal` fired;
247
- * - `queue_overflow` — durable queue full;
248
- * - `service_unavailable` — socket not connected / closed / torn down
249
- * mid-flight;
250
- * - `internal_error` — `ws.send` threw (serialization, buffer full);
251
- * - server's wire code verbatim JSON-RPC error frame from peer.
260
+ * @mutates this - inserts the new pending entry into `#pending` (or
261
+ * buffers into `#queue` when disconnected) and may bump
262
+ * `#next_request_id`, `#last_send_time`, `last_send_error`
263
+ * @throws ThrownJsonrpcError on the returned promise — never thrown
264
+ * synchronously. Rejection codes:
265
+ * - `unauthenticated` — session revoked (entry check or close code)
266
+ * - `request_cancelled` — caller's `AbortSignal` fired
267
+ * - `queue_overflow` — durable queue full
268
+ * - `service_unavailable` — socket not connected / closed / torn down
269
+ * mid-flight
270
+ * - `internal_error``ws.send` threw (serialization, buffer full)
271
+ * - server's wire code verbatim — JSON-RPC error frame from peer
252
272
  */
253
273
  request<R = unknown>(method: string, params?: unknown, options?: {
254
274
  signal?: AbortSignal;
@@ -266,7 +286,6 @@ export declare class FrontendWebsocketClient implements WebsocketConnection, Dis
266
286
  * a terminal session-revocation read as `failure` while a clean client-
267
287
  * initiated close reads as `initial` (the "not connected, not trying" state).
268
288
  *
269
- * @param status - the socket's current `SocketStatus`
270
289
  * @param revoked - whether the session has been permanently revoked
271
290
  * (typically `FrontendWebsocketClient.revoked`)
272
291
  */
@@ -1 +1 @@
1
- {"version":3,"file":"socket.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/socket.svelte.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAGH,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,2BAA2B,CAAC;AAE3D,OAAO,EAAyC,KAAK,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AAKjG,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,oBAAoB,CAAC;AAE5D,qDAAqD;AACrD,eAAO,MAAM,kBAAkB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,CAAC,EAAE,OAAO,CAAC;QAAC,EAAE,CAAC,EAAE,gBAAgB,CAAA;KAAM,GAC1E,OAAO,CAAC,CAAC,CAAC;IA2Eb,mBAAmB,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,IAAI;IAK9D,iBAAiB,CAAC,OAAO,EAAE,kBAAkB,GAAG,MAAM,IAAI;CAyU1D;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,6BAA6B,GACzC,QAAQ,YAAY,EACpB,SAAS,OAAO,KACd,WAaF,CAAC"}
@@ -8,13 +8,13 @@
8
8
  * server revokes auth), exposes reactive status for UI indicators, and ships
9
9
  * three correctness primitives default-on:
10
10
  *
11
- * - {@link FrontendWebsocketClient.request} — promise-based JSON-RPC with
11
+ * - `FrontendWebsocketClient.request` — promise-based JSON-RPC with
12
12
  * auto-assigned ids and a pending-id map. Intercepts responses on the
13
13
  * message path so request/response correlation is transport-level rather
14
14
  * than re-invented per consumer.
15
15
  * - **Durable queue** — `request()` calls made while disconnected buffer up
16
16
  * to `DEFAULT_QUEUE_MAX_SIZE` requests and flush on reopen. Overflow
17
- * rejects with `queue_overflow`. Raw {@link FrontendWebsocketClient.send}
17
+ * rejects with `queue_overflow`. Raw `FrontendWebsocketClient.send`
18
18
  * is drop-on-disconnect (fire-and-forget notifications want that).
19
19
  * - **Activity-aware heartbeat** — idles fire a shared `heartbeat` request;
20
20
  * receive-silence past `DEFAULT_HEARTBEAT_RECEIVE_TIMEOUT` closes
@@ -140,6 +140,10 @@ export class FrontendWebsocketClient {
140
140
  * timer and transitions status to `closed` (since the lie of
141
141
  * `'reconnecting'` would be visible to UI indicators). Turning it back on
142
142
  * does not synthesize a reconnect — wait for the next close.
143
+ *
144
+ * @mutates this - replaces the reconnect policy fields; may also reset
145
+ * `status`, `reconnect_count`, and `current_reconnect_delay` when an
146
+ * in-flight reconnect timer is cancelled or rescheduled
143
147
  */
144
148
  set_reconnect(reconnect = null) {
145
149
  const next_auto = reconnect !== false;
@@ -187,6 +191,9 @@ export class FrontendWebsocketClient {
187
191
  * When connected, the live timer is restarted immediately so the new
188
192
  * `interval` / `receive_timeout` take effect without a reconnect; when
189
193
  * disconnected, just stashes the policy for the next open.
194
+ *
195
+ * @mutates this - replaces the heartbeat policy fields; restarts the
196
+ * live heartbeat timer when connected
190
197
  */
191
198
  set_heartbeat(heartbeat = null) {
192
199
  this.#heartbeat_enabled = heartbeat !== false;
@@ -212,6 +219,9 @@ export class FrontendWebsocketClient {
212
219
  * clears heartbeat) or the policy change of `set_reconnect(false)`
213
220
  * (which disables future reconnects). The queue stays intact so that
214
221
  * calling `connect` later flushes buffered work.
222
+ *
223
+ * @mutates this - clears the pending reconnect timer, sets `status` to
224
+ * `closed`, resets `reconnect_count` and `current_reconnect_delay`
215
225
  */
216
226
  cancel_reconnect() {
217
227
  if (this.#reconnect_timeout === null)
@@ -235,6 +245,11 @@ export class FrontendWebsocketClient {
235
245
  * Open the WebSocket. No-op on SSR, or if the session has been revoked.
236
246
  * Cancels any pending reconnect and tears down any existing connection first;
237
247
  * an open prior socket is closed with a normal-closure code.
248
+ *
249
+ * @mutates this - replaces `ws`, sets `status` to `connecting` (or
250
+ * `closed` on construction failure), and on construction failure may
251
+ * schedule a reconnect (mutating `reconnect_count` /
252
+ * `current_reconnect_delay`)
238
253
  */
239
254
  connect() {
240
255
  if (!BROWSER)
@@ -267,6 +282,10 @@ export class FrontendWebsocketClient {
267
282
  * Close the WebSocket, cancel any pending reconnect, and reset the reconnect
268
283
  * backoff counters. Puts the client in `closed` status; call `connect()` to
269
284
  * reopen. Safe to call more than once.
285
+ *
286
+ * @mutates this - clears `ws`, heartbeat, and reconnect timers; sets
287
+ * `status` to `closed`; rejects every pending and queued request with
288
+ * `service_unavailable`
270
289
  */
271
290
  disconnect(code = DEFAULT_CLOSE_CODE) {
272
291
  this.#cancel_reconnect();
@@ -320,17 +339,18 @@ export class FrontendWebsocketClient {
320
339
  * for queued-but-never-sent (server doesn't know about it) and
321
340
  * response-beat-cancel races.
322
341
  *
323
- * Rejections throw `ThrownJsonrpcError` with a specific code so
324
- * `FrontendWebsocketTransport` can preserve the code verbatim in its
325
- * error envelope rather than collapsing every rejection to
326
- * `internal_error`:
327
- * - `unauthenticated` — session revoked (entry check or close code);
328
- * - `request_cancelled` — caller's `AbortSignal` fired;
329
- * - `queue_overflow` — durable queue full;
330
- * - `service_unavailable` — socket not connected / closed / torn down
331
- * mid-flight;
332
- * - `internal_error` — `ws.send` threw (serialization, buffer full);
333
- * - server's wire code verbatim JSON-RPC error frame from peer.
342
+ * @mutates this - inserts the new pending entry into `#pending` (or
343
+ * buffers into `#queue` when disconnected) and may bump
344
+ * `#next_request_id`, `#last_send_time`, `last_send_error`
345
+ * @throws ThrownJsonrpcError on the returned promise — never thrown
346
+ * synchronously. Rejection codes:
347
+ * - `unauthenticated` — session revoked (entry check or close code)
348
+ * - `request_cancelled` — caller's `AbortSignal` fired
349
+ * - `queue_overflow` — durable queue full
350
+ * - `service_unavailable` — socket not connected / closed / torn down
351
+ * mid-flight
352
+ * - `internal_error``ws.send` threw (serialization, buffer full)
353
+ * - server's wire code verbatim — JSON-RPC error frame from peer
334
354
  */
335
355
  request(method, params = {}, options = {}) {
336
356
  return new Promise((resolve, reject) => {
@@ -704,7 +724,6 @@ export class FrontendWebsocketClient {
704
724
  * a terminal session-revocation read as `failure` while a clean client-
705
725
  * initiated close reads as `initial` (the "not connected, not trying" state).
706
726
  *
707
- * @param status - the socket's current `SocketStatus`
708
727
  * @param revoked - whether the session has been permanently revoked
709
728
  * (typically `FrontendWebsocketClient.revoked`)
710
729
  */
@@ -60,15 +60,25 @@ export declare class Transports {
60
60
  */
61
61
  allow_fallback: boolean;
62
62
  /**
63
- * Registers a transport.
63
+ * Registers a transport. The first transport registered also becomes the current.
64
+ *
65
+ * @mutates this - inserts into `#transport_by_name`; sets `#current_transport`
66
+ * if no current is set
64
67
  */
65
68
  register_transport(transport: Transport): void;
69
+ /**
70
+ * Switch the current transport selection by name.
71
+ *
72
+ * @mutates this - sets `#current_transport`
73
+ * @throws Error if no transport with `transport_name` has been registered
74
+ */
66
75
  set_current_transport(transport_name: TransportName): void;
67
76
  /**
68
- * Gets either the current transport or the first ready transport
69
- * depending on `allow_fallback`, or throws an error.
70
- * @param transport_name - optional transport to use instead of the current
71
- * @throws when no transport available or ready
77
+ * Resolve a transport. With `allow_fallback`, walks specified current
78
+ * any-ready; without, returns the named transport (or current) only when
79
+ * it's ready.
80
+ *
81
+ * @returns the resolved transport, or `null` when none is ready
72
82
  */
73
83
  get_transport(transport_name?: TransportName): Transport | null;
74
84
  is_ready(): boolean | null;
@@ -1 +1 @@
1
- {"version":3,"file":"transports.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/transports.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,KAAK,EACX,gCAAgC,EAChC,gCAAgC,EAChC,mBAAmB,EACnB,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACpB,MAAM,oBAAoB,CAAC;AAE5B,mDAAmD;AACnD,eAAO,MAAM,wBAAwB,OAAO,CAAC;AAC7C,sEAAsE;AACtE,eAAO,MAAM,iCAAiC,OAAO,CAAC;AACtD,yEAAyE;AACzE,eAAO,MAAM,iCAAiC,OAAO,CAAC;AAKtD,eAAO,MAAM,aAAa,aAAa,CAAC;AACxC,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAE1D;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACpC;;;;;OAKG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,SAAS;IACzB,cAAc,EAAE,aAAa,CAAC;IAE9B,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,oBAA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AAE,aAAa,GAAG,SAAS,GAAG,IAAI;CA2CtE"}
@@ -25,7 +25,10 @@ export class Transports {
25
25
  */
26
26
  allow_fallback = true; // TODO allow registering transports with a priority level so this can be customized
27
27
  /**
28
- * Registers a transport.
28
+ * Registers a transport. The first transport registered also becomes the current.
29
+ *
30
+ * @mutates this - inserts into `#transport_by_name`; sets `#current_transport`
31
+ * if no current is set
29
32
  */
30
33
  register_transport(transport) {
31
34
  this.#transport_by_name.set(transport.transport_name, transport); // TODO maybe ensure unregistering of any previous transport?
@@ -34,6 +37,12 @@ export class Transports {
34
37
  this.#current_transport = transport;
35
38
  }
36
39
  }
40
+ /**
41
+ * Switch the current transport selection by name.
42
+ *
43
+ * @mutates this - sets `#current_transport`
44
+ * @throws Error if no transport with `transport_name` has been registered
45
+ */
37
46
  set_current_transport(transport_name) {
38
47
  const transport = this.#transport_by_name.get(transport_name);
39
48
  if (!transport)
@@ -41,10 +50,11 @@ export class Transports {
41
50
  this.#current_transport = transport;
42
51
  }
43
52
  /**
44
- * Gets either the current transport or the first ready transport
45
- * depending on `allow_fallback`, or throws an error.
46
- * @param transport_name - optional transport to use instead of the current
47
- * @throws when no transport available or ready
53
+ * Resolve a transport. With `allow_fallback`, walks specified current
54
+ * any-ready; without, returns the named transport (or current) only when
55
+ * it's ready.
56
+ *
57
+ * @returns the resolved transport, or `null` when none is ready
48
58
  */
49
59
  get_transport(transport_name) {
50
60
  return this.allow_fallback
@@ -67,11 +77,6 @@ export class Transports {
67
77
  get_transport_by_name(transport_name) {
68
78
  return this.#transport_by_name.get(transport_name) ?? null;
69
79
  }
70
- /**
71
- * Gets the specified transport, defaulting to the current, or throws an error.
72
- * @param transport_name - optional transport type to use instead of the current
73
- * @throws when no transport available or ready
74
- */
75
80
  #get_exact(transport_name) {
76
81
  const transport = transport_name
77
82
  ? this.#transport_by_name.get(transport_name)
@@ -81,11 +86,6 @@ export class Transports {
81
86
  }
82
87
  return null;
83
88
  }
84
- /**
85
- * Gets the appropriate transport or throws an error.
86
- * @param transport_name - optional transport type or array of types to use instead of the current
87
- * @throws when no transport available or ready
88
- */
89
89
  #get_first_ready(transport_name) {
90
90
  // First try the specified transport(s) if provided
91
91
  if (transport_name) {
@@ -5,6 +5,13 @@
5
5
  */
6
6
  import type { JsonrpcNotification, JsonrpcRequest, JsonrpcResponseOrError, JsonrpcErrorResponse } from '../http/jsonrpc.js';
7
7
  import type { Transport, TransportSendOptions } from './transports.js';
8
+ /**
9
+ * Thin `fetch` adapter for the JSON-RPC endpoint. POST by default; GET when
10
+ * the optional `has_side_effects(method)` callback returns `false` for the
11
+ * method (matches `create_rpc_endpoint`'s GET convention). On non-OK HTTP
12
+ * responses, synthesizes a JSON-RPC error envelope via
13
+ * `http_status_to_jsonrpc_error_code`. Always reports ready.
14
+ */
8
15
  export declare class FrontendHttpTransport implements Transport {
9
16
  #private;
10
17
  readonly transport_name: "frontend_http_rpc";
@@ -1 +1 @@
1
- {"version":3,"file":"transports_http.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/transports_http.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAeH,OAAO,KAAK,EAGX,mBAAmB,EACnB,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAC,SAAS,EAAE,oBAAoB,EAAC,MAAM,iBAAiB,CAAC;AAErE,qBAAa,qBAAsB,YAAW,SAAS;;IACtD,QAAQ,CAAC,cAAc,EAAG,mBAAmB,CAAU;gBAOtD,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAChC,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO;IAOzC,IAAI,CACT,OAAO,EAAE,cAAc,EACvB,OAAO,CAAC,EAAE,oBAAoB,GAC5B,OAAO,CAAC,sBAAsB,CAAC;IAC5B,IAAI,CACT,OAAO,EAAE,mBAAmB,EAC5B,OAAO,CAAC,EAAE,oBAAoB,GAC5B,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAyEvC,QAAQ,IAAI,OAAO;CAGnB"}
1
+ {"version":3,"file":"transports_http.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/transports_http.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAeH,OAAO,KAAK,EAGX,mBAAmB,EACnB,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAC,SAAS,EAAE,oBAAoB,EAAC,MAAM,iBAAiB,CAAC;AAErE;;;;;;GAMG;AACH,qBAAa,qBAAsB,YAAW,SAAS;;IACtD,QAAQ,CAAC,cAAc,EAAG,mBAAmB,CAAU;gBAOtD,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAChC,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO;IAOzC,IAAI,CACT,OAAO,EAAE,cAAc,EACvB,OAAO,CAAC,EAAE,oBAAoB,GAC5B,OAAO,CAAC,sBAAsB,CAAC;IAC5B,IAAI,CACT,OAAO,EAAE,mBAAmB,EAC5B,OAAO,CAAC,EAAE,oBAAoB,GAC5B,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAyEvC,QAAQ,IAAI,OAAO;CAGnB"}
@@ -6,6 +6,13 @@
6
6
  import { DEV } from 'esm-env';
7
7
  import { ThrownJsonrpcError, jsonrpc_error_messages, http_status_to_jsonrpc_error_code, UNKNOWN_ERROR_MESSAGE, } from '../http/jsonrpc_errors.js';
8
8
  import { create_jsonrpc_error_response, to_jsonrpc_message_id, is_jsonrpc_error_response, } from '../http/jsonrpc_helpers.js';
9
+ /**
10
+ * Thin `fetch` adapter for the JSON-RPC endpoint. POST by default; GET when
11
+ * the optional `has_side_effects(method)` callback returns `false` for the
12
+ * method (matches `create_rpc_endpoint`'s GET convention). On non-OK HTTP
13
+ * responses, synthesizes a JSON-RPC error envelope via
14
+ * `http_status_to_jsonrpc_error_code`. Always reports ready.
15
+ */
9
16
  export class FrontendHttpTransport {
10
17
  transport_name = 'frontend_http_rpc';
11
18
  #url;
@@ -41,6 +41,12 @@ export interface WebsocketRpcConnection extends WebsocketConnection {
41
41
  id?: JsonrpcRequestId;
42
42
  }) => Promise<unknown>;
43
43
  }
44
+ /**
45
+ * Thin adapter over `WebsocketRpcConnection` (canonical implementation:
46
+ * `FrontendWebsocketClient`). Routes inbound server-pushed requests and
47
+ * notifications into the supplied `receive` callback; responses are owned
48
+ * by the connection's own `request()` pending map and are ignored here.
49
+ */
44
50
  export declare class FrontendWebsocketTransport implements Transport {
45
51
  #private;
46
52
  readonly transport_name: "frontend_websocket_rpc";
@@ -48,6 +54,13 @@ export declare class FrontendWebsocketTransport implements Transport {
48
54
  send(message: JsonrpcRequest, options?: TransportSendOptions): Promise<JsonrpcResponseOrError>;
49
55
  send(message: JsonrpcNotification, options?: TransportSendOptions): Promise<JsonrpcErrorResponse | null>;
50
56
  is_ready(): boolean;
57
+ /**
58
+ * Detach the inbound message and error handlers registered on the
59
+ * connection. Idempotent — subsequent calls no-op. Does not close the
60
+ * underlying connection (that lifecycle is owned by the caller).
61
+ *
62
+ * @mutates this - clears the two stored unsubscribe references after invoking them
63
+ */
51
64
  dispose(): void;
52
65
  }
53
66
  //# sourceMappingURL=transports_ws.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"transports_ws.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/transports_ws.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAWH,OAAO,KAAK,EAGX,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,oBAAoB,EACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAC,SAAS,EAAE,oBAAoB,EAAC,MAAM,iBAAiB,CAAC;AAIrE;;GAEG;AACH,M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G,IAAI,CAAC;IA4DvC,QAAQ,IAAI,OAAO;IAInB;;;;;;OAMG;IACH,OAAO,IAAI,IAAI;CAUf"}
@@ -13,6 +13,12 @@
13
13
  */
14
14
  import { ThrownJsonrpcError, jsonrpc_error_messages } from '../http/jsonrpc_errors.js';
15
15
  import { is_jsonrpc_notification, is_jsonrpc_request, to_jsonrpc_message_id, to_jsonrpc_result, create_jsonrpc_response, create_jsonrpc_error_response, } from '../http/jsonrpc_helpers.js';
16
+ /**
17
+ * Thin adapter over `WebsocketRpcConnection` (canonical implementation:
18
+ * `FrontendWebsocketClient`). Routes inbound server-pushed requests and
19
+ * notifications into the supplied `receive` callback; responses are owned
20
+ * by the connection's own `request()` pending map and are ignored here.
21
+ */
16
22
  export class FrontendWebsocketTransport {
17
23
  transport_name = 'frontend_websocket_rpc';
18
24
  #connection;
@@ -86,6 +92,13 @@ export class FrontendWebsocketTransport {
86
92
  is_ready() {
87
93
  return this.#connection.connected;
88
94
  }
95
+ /**
96
+ * Detach the inbound message and error handlers registered on the
97
+ * connection. Idempotent — subsequent calls no-op. Does not close the
98
+ * underlying connection (that lifecycle is owned by the caller).
99
+ *
100
+ * @mutates this - clears the two stored unsubscribe references after invoking them
101
+ */
89
102
  dispose() {
90
103
  if (this.#remove_message_handler) {
91
104
  this.#remove_message_handler();
@@ -45,9 +45,10 @@ export declare const WS_DISCONNECT_EVENT_TYPES: ReadonlySet<string>;
45
45
  * the submitted session_id), so reacting to them would let any authenticated
46
46
  * user close another user's socket by guessing a session hash or token id.
47
47
  *
48
- * @param transport - the backend WebSocket transport to guard
49
48
  * @param log - logger for disconnect events (info level on non-zero closures)
50
- * @returns an `on_audit_event` callback suitable for `CreateAppBackendOptions`
49
+ * @returns an `on_audit_event` callback suitable for `CreateAppBackendOptions`.
50
+ * The returned callback mutates `transport` (closing matching sockets via
51
+ * `close_sockets_for_session` / `_token` / `_account`) on every relevant event.
51
52
  */
52
53
  export declare const create_ws_auth_guard: (transport: BackendWebsocketTransport, log: Logger) => AuditEventHandler;
53
54
  /**
@@ -76,9 +77,10 @@ export declare const create_ws_auth_guard: (transport: BackendWebsocketTransport
76
77
  * to them would let an unauthenticated probe close the targeted account's
77
78
  * sockets by submitting a logout for an arbitrary `account_id`.
78
79
  *
79
- * @param transport - the backend WebSocket transport to guard
80
80
  * @param log - logger for disconnect events (info level on non-zero closures)
81
- * @returns an `on_audit_event` callback wireable alongside `create_ws_auth_guard`
81
+ * @returns an `on_audit_event` callback wireable alongside `create_ws_auth_guard`.
82
+ * The returned callback mutates `transport` via `close_sockets_for_account`
83
+ * on every successful `logout` event with a non-empty `account_id`.
82
84
  */
83
85
  export declare const create_ws_logout_closer: (transport: BackendWebsocketTransport, log: Logger) => AuditEventHandler;
84
86
  //# sourceMappingURL=transports_ws_auth_guard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"transports_ws_auth_guard.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/transports_ws_auth_guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAEpD,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,EAAC,yBAAyB,EAAC,MAAM,4BAA4B,CAAC;AAE1E;;;;;;;;GAQG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;AAE/D;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,yBAAyB,EAAE,WAAW,CAAC,MAAM,CAMxD,CAAC;AAEH;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,oBAAoB,GAChC,WAAW,yBAAyB,EACpC,KAAK,MAAM,KACT,iBA6CF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,uBAAuB,GACnC,WAAW,yBAAyB,EACpC,KAAK,MAAM,KACT,iBAaF,CAAC"}
1
+ {"version":3,"file":"transports_ws_auth_guard.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/transports_ws_auth_guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAEpD,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,EAAC,yBAAyB,EAAC,MAAM,4BAA4B,CAAC;AAE1E;;;;;;;;GAQG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;AAE/D;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,yBAAyB,EAAE,WAAW,CAAC,MAAM,CAMxD,CAAC;AAEH;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,oBAAoB,GAChC,WAAW,yBAAyB,EACpC,KAAK,MAAM,KACT,iBA6CF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,uBAAuB,GACnC,WAAW,yBAAyB,EACpC,KAAK,MAAM,KACT,iBAaF,CAAC"}
@@ -38,9 +38,10 @@ export const WS_DISCONNECT_EVENT_TYPES = new Set([
38
38
  * the submitted session_id), so reacting to them would let any authenticated
39
39
  * user close another user's socket by guessing a session hash or token id.
40
40
  *
41
- * @param transport - the backend WebSocket transport to guard
42
41
  * @param log - logger for disconnect events (info level on non-zero closures)
43
- * @returns an `on_audit_event` callback suitable for `CreateAppBackendOptions`
42
+ * @returns an `on_audit_event` callback suitable for `CreateAppBackendOptions`.
43
+ * The returned callback mutates `transport` (closing matching sockets via
44
+ * `close_sockets_for_session` / `_token` / `_account`) on every relevant event.
44
45
  */
45
46
  export const create_ws_auth_guard = (transport, log) => {
46
47
  return (event) => {
@@ -110,9 +111,10 @@ export const create_ws_auth_guard = (transport, log) => {
110
111
  * to them would let an unauthenticated probe close the targeted account's
111
112
  * sockets by submitting a logout for an arbitrary `account_id`.
112
113
  *
113
- * @param transport - the backend WebSocket transport to guard
114
114
  * @param log - logger for disconnect events (info level on non-zero closures)
115
- * @returns an `on_audit_event` callback wireable alongside `create_ws_auth_guard`
115
+ * @returns an `on_audit_event` callback wireable alongside `create_ws_auth_guard`.
116
+ * The returned callback mutates `transport` via `close_sockets_for_account`
117
+ * on every successful `logout` event with a non-empty `account_id`.
116
118
  */
117
119
  export const create_ws_logout_closer = (transport, log) => {
118
120
  return (event) => {
@@ -44,28 +44,39 @@ export declare class BackendWebsocketTransport implements FilterableBroadcastTra
44
44
  /**
45
45
  * Add a new WebSocket connection with auth info.
46
46
  * Session connections pass a token hash for targeted revocation.
47
- * Bearer token connections (api_token) pass the `api_token.id` so the
47
+ * Bearer token connections (`api_token`) pass the `api_token.id` so the
48
48
  * socket can be closed when that specific token is revoked without
49
49
  * tearing down the account's other sockets. Daemon-token connections
50
50
  * pass `null` for both — they're only reachable via
51
51
  * `close_sockets_for_account`.
52
+ *
53
+ * @returns the freshly assigned `connection_id` (branded `Uuid`)
54
+ * @mutates this - inserts into `#connections`, `#connection_ids`, and
55
+ * `#connection_identities`
52
56
  */
53
57
  add_connection(ws: WSContext, token_hash: string | null, account_id: Uuid, api_token_id?: string | null): Uuid;
54
58
  /**
55
59
  * Remove a WebSocket connection and its auth tracking data.
56
60
  * Idempotent — safe to call after revocation has already cleaned up.
61
+ *
62
+ * @mutates this - deletes the connection's entries from `#connections`,
63
+ * `#connection_ids`, and `#connection_identities`
57
64
  */
58
65
  remove_connection(ws: WSContext): void;
59
66
  /**
60
67
  * Close all sockets associated with a specific session token hash.
61
68
  *
62
69
  * @returns the number of sockets closed
70
+ * @mutates this - removes matching connections from internal maps and
71
+ * closes their underlying `WSContext` with `WS_CLOSE_SESSION_REVOKED`
63
72
  */
64
73
  close_sockets_for_session(token_hash: string): number;
65
74
  /**
66
75
  * Close all sockets associated with a specific account.
67
76
  *
68
77
  * @returns the number of sockets closed
78
+ * @mutates this - removes matching connections from internal maps and
79
+ * closes their underlying `WSContext` with `WS_CLOSE_SESSION_REVOKED`
69
80
  */
70
81
  close_sockets_for_account(account_id: Uuid): number;
71
82
  /**
@@ -76,6 +87,8 @@ export declare class BackendWebsocketTransport implements FilterableBroadcastTra
76
87
  * tokens' sockets.
77
88
  *
78
89
  * @returns the number of sockets closed
90
+ * @mutates this - removes matching connections from internal maps and
91
+ * closes their underlying `WSContext` with `WS_CLOSE_SESSION_REVOKED`
79
92
  */
80
93
  close_sockets_for_token(api_token_id: string): number;
81
94
  send(message: JsonrpcRequest, options?: TransportSendOptions): Promise<JsonrpcResponseOrError>;
@@ -1 +1 @@
1
- {"version":3,"file":"transports_ws_backend.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/transports_ws_backend.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,SAAS,CAAC;AACvC,OAAO,EAAc,KAAK,IAAI,EAAC,MAAM,wBAAwB,CAAC;AAE9D,OAAO,KAAK,EAEX,gCAAgC,EAChC,mBAAmB,EACnB,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACpB,MAAM,oBAAoB,CAAC;AAO5B,OAAO,EAA2B,KAAK,SAAS,EAAE,KAAK,oBAAoB,EAAC,MAAM,iBAAiB,CAAC;AAIpG;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB;IAClC,sEAAsE;IACtE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,4CAA4C;IAC5C,UAAU,EAAE,IAAI,CAAC;IACjB,sEAAsE;IACtE,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,4BAA6B,SAAQ,SAAS;IAC9D,kBAAkB,EAAE,CACnB,OAAO,EAAE,gCAAgC,EACzC,SAAS,EAAE,CAAC,QAAQ,EAAE,kBAAkB,KAAK,OAAO,KAChD,MAAM,CAAC;CACZ;A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