@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
@@ -46,15 +46,11 @@ export type AuthGuardResolver = (auth: RouteAuth) => Array<MiddlewareHandler>;
46
46
  export type RouteMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
47
47
  /**
48
48
  * Per-request deps provided by the framework to route handlers.
49
- *
50
- * `db` is transaction-scoped for mutation routes and pool-level for reads.
51
- * `background_db` is always pool-level — use it for fire-and-forget effects
52
- * that must outlive the transaction.
53
49
  */
54
50
  export interface RouteContext {
55
51
  /** Transaction-scoped for mutations, pool-level for reads. */
56
52
  db: Db;
57
- /** Always pool-level — for fire-and-forget effects that outlive the transaction. */
53
+ /** Always pool-level — for fire-and-forget effects that must outlive the transaction. */
58
54
  background_db: Db;
59
55
  /** Fire-and-forget side effects — push here for post-response flushing. */
60
56
  pending_effects: Array<Promise<void>>;
@@ -76,20 +72,14 @@ export type RouteHandler = (c: Context, route: RouteContext) => Response | Promi
76
72
  export interface RouteSpec {
77
73
  method: RouteMethod;
78
74
  path: string;
79
- /**
80
- * Auth requirement for this route.
81
- *
82
- * `{type: 'none'}` means the route is open to all clients including non-browser
83
- * callers (CLI, scripts) — no auth guards are applied.
84
- */
85
75
  auth: RouteAuth;
86
76
  handler: RouteHandler;
87
77
  description: string;
88
78
  /**
89
79
  * URL path parameter schema. Use `z.strictObject()` with string fields matching `:param` segments.
90
80
  *
91
- * TODO @action-system-review `params` is HTTP-specific SAES encodes everything in
92
- * `input`. When saes-rpc lands, this may move to `ActionRouteOptions` only.
81
+ * REST-only actions dispatch through a single JSON-RPC endpoint and encode
82
+ * everything in `input`, so `params` doesn't appear on `ActionSpec`.
93
83
  */
94
84
  params?: z.ZodObject;
95
85
  /** URL query parameter schema. Use `z.strictObject()` with string fields. */
@@ -131,38 +121,30 @@ export interface RouteSpec {
131
121
  /**
132
122
  * Get validated input from the Hono context.
133
123
  *
134
- * Call this in route handlers after the input validation middleware has run.
135
- * The type parameter should match the route's `input` schema.
136
- *
137
- * @returns the validated request body
124
+ * Call after the input validation middleware has run. The type parameter
125
+ * should match the route's `input` schema.
138
126
  */
139
127
  export declare const get_route_input: <T>(c: Context) => T;
140
128
  /**
141
129
  * Get validated URL path params from the Hono context.
142
130
  *
143
- * Call this in route handlers after the params validation middleware has run.
144
- * The type parameter should match the route's `params` schema.
145
- *
146
- * TODO @action-system-review Make typesafe — derive `T` from the `params` schema on the
147
- * route spec so the type parameter isn't manually specified.
131
+ * Call after the params validation middleware has run. The type parameter
132
+ * should match the route's `params` schema.
148
133
  *
149
- * @returns the validated path parameters
134
+ * TODO derive `T` from the route spec so the type parameter isn't manually
135
+ * specified — same applies to `get_route_input` / `get_route_query`.
150
136
  */
151
137
  export declare const get_route_params: <T>(c: Context) => T;
152
138
  /**
153
139
  * Get validated URL query params from the Hono context.
154
140
  *
155
- * Call this in route handlers after the query validation middleware has run.
156
- * The type parameter should match the route's `query` schema.
157
- *
158
- * @returns the validated query parameters
141
+ * Call after the query validation middleware has run. The type parameter
142
+ * should match the route's `query` schema.
159
143
  */
160
144
  export declare const get_route_query: <T>(c: Context) => T;
161
145
  /**
162
146
  * Apply named middleware specs to a Hono app.
163
147
  *
164
- * @param app - the Hono app
165
- * @param specs - middleware specs to apply
166
148
  * @mutates `app`
167
149
  */
168
150
  export declare const apply_middleware_specs: (app: Hono, specs: Array<MiddlewareSpec>) => void;
@@ -179,20 +161,17 @@ export declare const apply_middleware_specs: (app: Hono, specs: Array<Middleware
179
161
  * - `background_db`: always pool-level
180
162
  * - `pending_effects`: fire-and-forget effect queue
181
163
  *
182
- * @param app - the Hono app
183
- * @param specs - route specs to apply
184
164
  * @param resolve_auth_guards - maps `RouteAuth` to middleware — use `fuz_auth_guard_resolver` from `auth/route_guards.ts`
185
- * @param log - the logger instance
186
- * @param db - database instance for transaction wrapping and `RouteContext`
165
+ * @param db - used for transaction wrapping and `RouteContext`
187
166
  * @mutates `app`
167
+ * @throws Error if two specs share the same `method` + `path` (each combination must be unique)
188
168
  */
189
169
  export declare const apply_route_specs: (app: Hono, specs: Array<RouteSpec>, resolve_auth_guards: AuthGuardResolver, log: Logger, db: Db) => void;
190
170
  /**
191
171
  * Prepend a prefix to all route spec paths.
192
172
  *
193
173
  * @param prefix - the path prefix (e.g. `/api/account`)
194
- * @param specs - route specs to prefix
195
- * @returns new array of specs with prefixed paths
174
+ * @returns a new array — the input specs are not mutated
196
175
  */
197
176
  export declare const prefix_route_specs: (prefix: string, specs: Array<RouteSpec>) => Array<RouteSpec>;
198
177
  //# sourceMappingURL=route_spec.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"route_spec.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/route_spec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAC,OAAO,EAAW,IAAI,EAAE,iBAAiB,EAAC,MAAM,MAAM,CAAC;AACpE,OAAO,KAAK,EAAC,CAAC,EAAC,MAAM,KAAK,CA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IAsCF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAI,QAAQ,MAAM,EAAE,OAAO,KAAK,CAAC,SAAS,CAAC,KAAG,KAAK,CAAC,SAAS,CAK3F,CAAC"}
@@ -19,10 +19,8 @@ import { is_null_schema, merge_error_schemas } from './schema_helpers.js';
19
19
  /**
20
20
  * Get validated input from the Hono context.
21
21
  *
22
- * Call this in route handlers after the input validation middleware has run.
23
- * The type parameter should match the route's `input` schema.
24
- *
25
- * @returns the validated request body
22
+ * Call after the input validation middleware has run. The type parameter
23
+ * should match the route's `input` schema.
26
24
  */
27
25
  export const get_route_input = (c) => {
28
26
  return c.get('validated_input');
@@ -30,13 +28,11 @@ export const get_route_input = (c) => {
30
28
  /**
31
29
  * Get validated URL path params from the Hono context.
32
30
  *
33
- * Call this in route handlers after the params validation middleware has run.
34
- * The type parameter should match the route's `params` schema.
35
- *
36
- * TODO @action-system-review Make typesafe — derive `T` from the `params` schema on the
37
- * route spec so the type parameter isn't manually specified.
31
+ * Call after the params validation middleware has run. The type parameter
32
+ * should match the route's `params` schema.
38
33
  *
39
- * @returns the validated path parameters
34
+ * TODO derive `T` from the route spec so the type parameter isn't manually
35
+ * specified — same applies to `get_route_input` / `get_route_query`.
40
36
  */
41
37
  export const get_route_params = (c) => {
42
38
  return c.get('validated_params');
@@ -44,10 +40,8 @@ export const get_route_params = (c) => {
44
40
  /**
45
41
  * Get validated URL query params from the Hono context.
46
42
  *
47
- * Call this in route handlers after the query validation middleware has run.
48
- * The type parameter should match the route's `query` schema.
49
- *
50
- * @returns the validated query parameters
43
+ * Call after the query validation middleware has run. The type parameter
44
+ * should match the route's `query` schema.
51
45
  */
52
46
  export const get_route_query = (c) => {
53
47
  return c.get('validated_query');
@@ -60,6 +54,8 @@ export const get_route_query = (c) => {
60
54
  * and for null-input routes (no body expected). For other routes with input
61
55
  * schemas, returns a middleware that parses and validates the JSON body,
62
56
  * storing the result on the context as `validated_input`.
57
+ *
58
+ * @mutates `c.var.validated_input` - set to the parsed and validated body on success
63
59
  */
64
60
  const create_input_validation = (input_schema, method) => {
65
61
  if (method === 'GET')
@@ -92,6 +88,8 @@ const create_input_validation = (input_schema, method) => {
92
88
  * Returns an empty array when no params schema is defined.
93
89
  * For routes with params schemas, returns a middleware that validates
94
90
  * `c.req.param()` against the schema, storing the result on the context as `validated_params`.
91
+ *
92
+ * @mutates `c.var.validated_params` - set to the parsed and validated path params on success
95
93
  */
96
94
  const create_params_validation = (params_schema) => {
97
95
  if (!params_schema)
@@ -113,6 +111,8 @@ const create_params_validation = (params_schema) => {
113
111
  * Returns an empty array when no query schema is defined.
114
112
  * For routes with query schemas, returns a middleware that validates
115
113
  * `c.req.query()` against the schema, storing the result on the context as `validated_query`.
114
+ *
115
+ * @mutates `c.var.validated_query` - set to the parsed and validated query params on success
116
116
  */
117
117
  const create_query_validation = (query_schema) => {
118
118
  if (!query_schema)
@@ -182,8 +182,6 @@ const wrap_output_validation = (handler, output_schema, error_schemas, log) => {
182
182
  /**
183
183
  * Apply named middleware specs to a Hono app.
184
184
  *
185
- * @param app - the Hono app
186
- * @param specs - middleware specs to apply
187
185
  * @mutates `app`
188
186
  */
189
187
  export const apply_middleware_specs = (app, specs) => {
@@ -232,12 +230,10 @@ const wrap_error_catch = (handler, log) => {
232
230
  * - `background_db`: always pool-level
233
231
  * - `pending_effects`: fire-and-forget effect queue
234
232
  *
235
- * @param app - the Hono app
236
- * @param specs - route specs to apply
237
233
  * @param resolve_auth_guards - maps `RouteAuth` to middleware — use `fuz_auth_guard_resolver` from `auth/route_guards.ts`
238
- * @param log - the logger instance
239
- * @param db - database instance for transaction wrapping and `RouteContext`
234
+ * @param db - used for transaction wrapping and `RouteContext`
240
235
  * @mutates `app`
236
+ * @throws Error if two specs share the same `method` + `path` (each combination must be unique)
241
237
  */
242
238
  export const apply_route_specs = (app, specs, resolve_auth_guards, log, db) => {
243
239
  const registered = new Set();
@@ -269,8 +265,7 @@ export const apply_route_specs = (app, specs, resolve_auth_guards, log, db) => {
269
265
  * Prepend a prefix to all route spec paths.
270
266
  *
271
267
  * @param prefix - the path prefix (e.g. `/api/account`)
272
- * @param specs - route specs to prefix
273
- * @returns new array of specs with prefixed paths
268
+ * @returns a new array — the input specs are not mutated
274
269
  */
275
270
  export const prefix_route_specs = (prefix, specs) => {
276
271
  return specs.map((spec) => ({
@@ -47,9 +47,6 @@ export declare const schema_to_surface: (schema: z.ZodType) => unknown;
47
47
  * - `/api/*` matches `/api/anything`
48
48
  * - `/api/tx/*` matches `/api/tx/runs` but not `/api/account/login`
49
49
  * - Exact match: `/health` matches `/health`
50
- *
51
- * @param mw_path - the middleware path pattern
52
- * @param route_path - the route path
53
50
  */
54
51
  export declare const middleware_applies: (mw_path: string, route_path: string) => boolean;
55
52
  /**
@@ -59,7 +56,6 @@ export declare const middleware_applies: (mw_path: string, route_path: string) =
59
56
  * Later layers override earlier ones for the same status code.
60
57
  *
61
58
  * @param spec - the route spec (needs `auth`, `input`, `params`, `rate_limit`, `errors`)
62
- * @param middleware_errors - optional middleware error schemas
63
59
  * @returns merged error schemas, or `null` if empty
64
60
  */
65
61
  export declare const merge_error_schemas: (spec: {
@@ -1 +1 @@
1
- {"version":3,"file":"schema_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/schema_helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAuB,KAAK,YAAY,EAAE,KAAK,iBAAiB,EAAC,MAAM,oBAAoB,CAAC;AAEnG;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,GAAI,QAAQ,CAAC,CAAC,OAAO,KAAG,OAAsC,CAAC;AAE1F;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,GAAI,QAAQ,CAAC,CAAC,OAAO,KAAG,OAAsC,CAAC;AAE1F;;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AC;AAE5E;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,QAAQ,CAAC,CAAC,OAAO,KAAG,OAQrD,CAAC;AAoBF;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,GAAI,SAAS,MAAM,EAAE,YAAY,MAAM,KAAG,OAQxE,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,GAC/B,MAAM;IACL,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC;IACpB,UAAU,CAAC,EAAE,YAAY,CAAC;IAC1B,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC3B,EACD,oBAAoB,iBAAiB,GAAG,IAAI,KAC1C,iBAAiB,GAAG,IAUtB,CAAC"}
@@ -76,9 +76,6 @@ const strip_json_schema_noise = (value) => {
76
76
  * - `/api/*` matches `/api/anything`
77
77
  * - `/api/tx/*` matches `/api/tx/runs` but not `/api/account/login`
78
78
  * - Exact match: `/health` matches `/health`
79
- *
80
- * @param mw_path - the middleware path pattern
81
- * @param route_path - the route path
82
79
  */
83
80
  export const middleware_applies = (mw_path, route_path) => {
84
81
  if (mw_path === '*')
@@ -98,7 +95,6 @@ export const middleware_applies = (mw_path, route_path) => {
98
95
  * Later layers override earlier ones for the same status code.
99
96
  *
100
97
  * @param spec - the route spec (needs `auth`, `input`, `params`, `rate_limit`, `errors`)
101
- * @param middleware_errors - optional middleware error schemas
102
98
  * @returns merged error schemas, or `null` if empty
103
99
  */
104
100
  export const merge_error_schemas = (spec, middleware_errors) => {
@@ -70,6 +70,8 @@ export interface AppSurfaceRpcMethod {
70
70
  output_schema: unknown;
71
71
  side_effects: boolean;
72
72
  description: string;
73
+ /** Rate limit key declared on the action spec. `null` when not rate-limited. */
74
+ rate_limit_key: RateLimitKey | null;
73
75
  }
74
76
  /** An RPC endpoint in the generated attack surface (JSON-serializable). */
75
77
  export interface AppSurfaceRpcEndpoint {
@@ -120,8 +122,6 @@ export interface GenerateAppSurfaceOptions {
120
122
  /**
121
123
  * Collect error schemas from all middleware that applies to a route path.
122
124
  *
123
- * @param middleware - the middleware specs
124
- * @param route_path - the route path to match against
125
125
  * @returns merged middleware error schemas, or `null` if none
126
126
  */
127
127
  export declare const collect_middleware_errors: (middleware: Array<MiddlewareSpec>, route_path: string) => RouteErrorSchemas | null;
@@ -129,29 +129,19 @@ export declare const collect_middleware_errors: (middleware: Array<MiddlewareSpe
129
129
  * Convert env schema to surface entries using `.meta()` metadata.
130
130
  *
131
131
  * @param schema - Zod object schema with `.meta()` on fields
132
- * @returns array of env surface entries
133
132
  */
134
133
  export declare const env_schema_to_surface: (schema: z.ZodObject) => Array<AppSurfaceEnv>;
135
134
  /**
136
135
  * Convert SSE event specs to surface entries.
137
- *
138
- * @param event_specs - event specs to convert
139
- * @returns array of event surface entries
140
136
  */
141
137
  export declare const events_to_surface: (event_specs: Array<EventSpec>) => Array<AppSurfaceEvent>;
142
138
  /**
143
139
  * Generate a JSON-serializable attack surface from middleware, route specs,
144
140
  * and optional env/event metadata.
145
- *
146
- * @param options - the surface generation options
147
- * @returns the attack surface
148
141
  */
149
142
  export declare const generate_app_surface: (options: GenerateAppSurfaceOptions) => AppSurface;
150
143
  /**
151
144
  * Create an `AppSurfaceSpec` — the surface bundled with its source specs.
152
- *
153
- * @param options - the surface generation options
154
- * @returns the surface spec with surface and raw specs
155
145
  */
156
146
  export declare const create_app_surface_spec: (options: GenerateAppSurfaceOptions) => AppSurfaceSpec;
157
147
  //# sourceMappingURL=surface.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"surface.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/surface.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,KAAK,E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AoB,GAAI,SAAS,yBAAyB,KAAG,UAyFzE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB,GAAI,SAAS,yBAAyB,KAAG,cAQ5E,CAAC"}
@@ -13,8 +13,6 @@ import { schema_to_surface, middleware_applies, merge_error_schemas, is_null_sch
13
13
  /**
14
14
  * Collect error schemas from all middleware that applies to a route path.
15
15
  *
16
- * @param middleware - the middleware specs
17
- * @param route_path - the route path to match against
18
16
  * @returns merged middleware error schemas, or `null` if none
19
17
  */
20
18
  export const collect_middleware_errors = (middleware, route_path) => {
@@ -30,7 +28,6 @@ export const collect_middleware_errors = (middleware, route_path) => {
30
28
  * Convert env schema to surface entries using `.meta()` metadata.
31
29
  *
32
30
  * @param schema - Zod object schema with `.meta()` on fields
33
- * @returns array of env surface entries
34
31
  */
35
32
  export const env_schema_to_surface = (schema) => {
36
33
  const entries = [];
@@ -50,9 +47,6 @@ export const env_schema_to_surface = (schema) => {
50
47
  };
51
48
  /**
52
49
  * Convert SSE event specs to surface entries.
53
- *
54
- * @param event_specs - event specs to convert
55
- * @returns array of event surface entries
56
50
  */
57
51
  export const events_to_surface = (event_specs) => {
58
52
  return event_specs.map((spec) => ({
@@ -65,9 +59,6 @@ export const events_to_surface = (event_specs) => {
65
59
  /**
66
60
  * Generate a JSON-serializable attack surface from middleware, route specs,
67
61
  * and optional env/event metadata.
68
- *
69
- * @param options - the surface generation options
70
- * @returns the attack surface
71
62
  */
72
63
  export const generate_app_surface = (options) => {
73
64
  const { route_specs, middleware_specs, env_schema, event_specs, rpc_endpoints } = options;
@@ -147,6 +138,7 @@ export const generate_app_surface = (options) => {
147
138
  output_schema: schema_to_surface(a.spec.output),
148
139
  side_effects: a.spec.side_effects,
149
140
  description: a.spec.description,
141
+ rate_limit_key: a.spec.rate_limit ?? null,
150
142
  })),
151
143
  }))
152
144
  : [],
@@ -156,9 +148,6 @@ export const generate_app_surface = (options) => {
156
148
  };
157
149
  /**
158
150
  * Create an `AppSurfaceSpec` — the surface bundled with its source specs.
159
- *
160
- * @param options - the surface generation options
161
- * @returns the surface spec with surface and raw specs
162
151
  */
163
152
  export const create_app_surface_spec = (options) => {
164
153
  const surface = generate_app_surface(options);
@@ -46,6 +46,22 @@ export interface RateLimiterOptions {
46
46
  export declare const DEFAULT_LOGIN_IP_RATE_LIMIT: RateLimiterOptions;
47
47
  /** Default options for per-account login rate limiting: 10 attempts per 30 minutes. */
48
48
  export declare const DEFAULT_LOGIN_ACCOUNT_RATE_LIMIT: RateLimiterOptions;
49
+ /**
50
+ * Default options for per-IP action-dispatcher rate limiting: 600 attempts
51
+ * per 15 minutes. Shared by the HTTP RPC and WebSocket action dispatchers
52
+ * (one budget per action, not per transport). Permissive — catches runaway
53
+ * scripts and egregious oracle probes, but well above human or normal
54
+ * automation pace. Tighten downstream for stricter deployments.
55
+ */
56
+ export declare const DEFAULT_ACTION_IP_RATE_LIMIT: RateLimiterOptions;
57
+ /**
58
+ * Default options for per-actor action-dispatcher rate limiting: 1200
59
+ * attempts per 15 minutes. Shared by the HTTP RPC and WebSocket action
60
+ * dispatchers. Permissive — sustained ~80/min is well above any human
61
+ * admin workflow; an oracle probing 10k addresses still finishes in
62
+ * ~2 hours, slow enough to surface in audit. Tighten downstream.
63
+ */
64
+ export declare const DEFAULT_ACTION_ACCOUNT_RATE_LIMIT: RateLimiterOptions;
49
65
  /**
50
66
  * Result of a rate limit check or record operation.
51
67
  */
@@ -83,8 +99,13 @@ export declare class RateLimiter {
83
99
  /**
84
100
  * Check whether `key` is allowed without recording an attempt.
85
101
  *
102
+ * Prunes timestamps that fell outside the window as a side effect (and
103
+ * removes the key entirely when none remain), so the backing map stays
104
+ * bounded even under read-only traffic.
105
+ *
86
106
  * @param key - rate limit key (e.g. IP address)
87
107
  * @param now - current timestamp in ms (defaults to `Date.now()`)
108
+ * @mutates internal map - prunes expired timestamps for `key`
88
109
  */
89
110
  check(key: string, now?: number): RateLimitResult;
90
111
  /**
@@ -92,19 +113,27 @@ export declare class RateLimiter {
92
113
  *
93
114
  * @param key - rate limit key (e.g. IP address)
94
115
  * @param now - current timestamp in ms (defaults to `Date.now()`)
116
+ * @mutates internal map - appends `now` to the timestamp list for `key` (after pruning expired entries)
95
117
  */
96
118
  record(key: string, now?: number): RateLimitResult;
97
119
  /**
98
120
  * Clear all attempts for `key` (e.g. after successful login).
121
+ *
122
+ * @mutates internal map - removes the entry for `key`
99
123
  */
100
124
  reset(key: string): void;
101
125
  /**
102
126
  * Remove entries whose timestamps are all outside the window.
103
127
  *
104
128
  * @param now - current timestamp in ms (defaults to `Date.now()`)
129
+ * @mutates internal map - prunes expired timestamps and deletes empty keys
105
130
  */
106
131
  cleanup(now?: number): void;
107
- /** Stop the cleanup timer. Safe to call multiple times. */
132
+ /**
133
+ * Stop the cleanup timer. Safe to call multiple times.
134
+ *
135
+ * @mutates timer - clears the cleanup `setInterval` and nulls the handle
136
+ */
108
137
  dispose(): void;
109
138
  }
110
139
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"rate_limiter.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/rate_limiter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,MAAM,CAAC;AAKlC;;;;;;GAMG;AACH,eAAO,MAAM,6BAA6B,SAAU,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC,kDAAkD;IAClD,YAAY,EAAE,MAAM,CAAC;IACrB,+CAA+C;IAC/C,SAAS,EAAE,MAAM,CAAC;IAClB,iEAAiE;IACjE,mBAAmB,EAAE,MAAM,CAAC;IAC5B;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,iFAAiF;AACjF,eAAO,MAAM,2BAA2B,EAAE,kBAKzC,CAAC;AAEF,uFAAuF;AACvF,eAAO,MAAM,gCAAgC,EAAE,kBAK9C,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,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B,GAAI,GAAG,OAAO,EAAE,aAAa,MAAM,KAAG,QAI7E,CAAC"}
@@ -30,6 +30,32 @@ export const DEFAULT_LOGIN_ACCOUNT_RATE_LIMIT = {
30
30
  cleanup_interval_ms: 5 * 60_000,
31
31
  max_keys: DEFAULT_RATE_LIMITER_MAX_KEYS,
32
32
  };
33
+ /**
34
+ * Default options for per-IP action-dispatcher rate limiting: 600 attempts
35
+ * per 15 minutes. Shared by the HTTP RPC and WebSocket action dispatchers
36
+ * (one budget per action, not per transport). Permissive — catches runaway
37
+ * scripts and egregious oracle probes, but well above human or normal
38
+ * automation pace. Tighten downstream for stricter deployments.
39
+ */
40
+ export const DEFAULT_ACTION_IP_RATE_LIMIT = {
41
+ max_attempts: 600,
42
+ window_ms: 15 * 60_000,
43
+ cleanup_interval_ms: 5 * 60_000,
44
+ max_keys: DEFAULT_RATE_LIMITER_MAX_KEYS,
45
+ };
46
+ /**
47
+ * Default options for per-actor action-dispatcher rate limiting: 1200
48
+ * attempts per 15 minutes. Shared by the HTTP RPC and WebSocket action
49
+ * dispatchers. Permissive — sustained ~80/min is well above any human
50
+ * admin workflow; an oracle probing 10k addresses still finishes in
51
+ * ~2 hours, slow enough to surface in audit. Tighten downstream.
52
+ */
53
+ export const DEFAULT_ACTION_ACCOUNT_RATE_LIMIT = {
54
+ max_attempts: 1200,
55
+ window_ms: 15 * 60_000,
56
+ cleanup_interval_ms: 5 * 60_000,
57
+ max_keys: DEFAULT_RATE_LIMITER_MAX_KEYS,
58
+ };
33
59
  /**
34
60
  * In-memory sliding window rate limiter.
35
61
  *
@@ -71,8 +97,13 @@ export class RateLimiter {
71
97
  /**
72
98
  * Check whether `key` is allowed without recording an attempt.
73
99
  *
100
+ * Prunes timestamps that fell outside the window as a side effect (and
101
+ * removes the key entirely when none remain), so the backing map stays
102
+ * bounded even under read-only traffic.
103
+ *
74
104
  * @param key - rate limit key (e.g. IP address)
75
105
  * @param now - current timestamp in ms (defaults to `Date.now()`)
106
+ * @mutates internal map - prunes expired timestamps for `key`
76
107
  */
77
108
  check(key, now = Date.now()) {
78
109
  const { max_attempts, window_ms } = this.options;
@@ -102,6 +133,7 @@ export class RateLimiter {
102
133
  *
103
134
  * @param key - rate limit key (e.g. IP address)
104
135
  * @param now - current timestamp in ms (defaults to `Date.now()`)
136
+ * @mutates internal map - appends `now` to the timestamp list for `key` (after pruning expired entries)
105
137
  */
106
138
  record(key, now = Date.now()) {
107
139
  const { max_attempts, window_ms } = this.options;
@@ -128,6 +160,8 @@ export class RateLimiter {
128
160
  }
129
161
  /**
130
162
  * Clear all attempts for `key` (e.g. after successful login).
163
+ *
164
+ * @mutates internal map - removes the entry for `key`
131
165
  */
132
166
  reset(key) {
133
167
  this.#attempts.delete(key);
@@ -136,6 +170,7 @@ export class RateLimiter {
136
170
  * Remove entries whose timestamps are all outside the window.
137
171
  *
138
172
  * @param now - current timestamp in ms (defaults to `Date.now()`)
173
+ * @mutates internal map - prunes expired timestamps and deletes empty keys
139
174
  */
140
175
  cleanup(now = Date.now()) {
141
176
  const cutoff = now - this.options.window_ms;
@@ -153,7 +188,11 @@ export class RateLimiter {
153
188
  }
154
189
  }
155
190
  }
156
- /** Stop the cleanup timer. Safe to call multiple times. */
191
+ /**
192
+ * Stop the cleanup timer. Safe to call multiple times.
193
+ *
194
+ * @mutates timer - clears the cleanup `setInterval` and nulls the handle
195
+ */
157
196
  dispose() {
158
197
  if (this.#cleanup_timer !== null) {
159
198
  clearInterval(this.#cleanup_timer);
@@ -46,8 +46,8 @@ export interface SseNotification {
46
46
  * Uses `hono_stream.write()` directly (not `writeSSE`) to avoid
47
47
  * Hono's HTML callback resolution — keeps the same `data: JSON\n\n` format.
48
48
  *
49
- * @param c - Hono context
50
- * @returns object with response and stream controller
49
+ * @param log - logger for serialization and `on_close` listener errors
50
+ * @returns object with the streaming `Response` and an `SseStream` controller
51
51
  */
52
52
  export declare const create_sse_response: <T = unknown>(c: Context, log: Logger) => {
53
53
  response: Response;
@@ -57,9 +57,13 @@ export declare const create_sse_response: <T = unknown>(c: Context, log: Logger)
57
57
  export declare const SSE_CONNECTED_COMMENT = ": connected\n\n";
58
58
  /** Spec for a push event — declares params schema, description, and channel. */
59
59
  export interface EventSpec {
60
+ /** Event method name, used as the JSON-RPC notification `method`. */
60
61
  method: string;
62
+ /** Zod schema for the notification `params` payload. */
61
63
  params: z.ZodType;
64
+ /** Human-readable description for surface output and docs. */
62
65
  description: string;
66
+ /** Channel this event broadcasts on. Omit for cross-channel events. */
63
67
  channel?: string;
64
68
  }
65
69
  /**
@@ -70,6 +74,7 @@ export interface EventSpec {
70
74
  *
71
75
  * @param broadcaster - duck-typed broadcaster (e.g. `SubscriberRegistry`)
72
76
  * @param event_specs - event specs to validate against
77
+ * @param log - logger used to emit DEV warnings on unknown methods or param mismatches
73
78
  * @returns validated broadcaster wrapper (passthrough in production)
74
79
  */
75
80
  export declare const create_validated_broadcaster: <T extends SseNotification>(broadcaster: {
@@ -1 +1 @@
1
- {"version":3,"file":"sse.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/realtime/sse.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,MAAM,CAAC;AAElC,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAEpD;;;;GAIG;AACH,MAAM,WAAW,SAAS,CAAC,CAAC,GAAG,OAAO;IACrC,mDAAmD;IACnD,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;IACxB,6CAA6C;IAC7C,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,wBAAwB;IACxB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,+FAA+F;IAC/F,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;CACnC;AAED;;;;GAIG;AAC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IAAI,CAAA;CAmBhD,CAAC"}
@@ -20,8 +20,8 @@ import { DEV } from 'esm-env';
20
20
  * Uses `hono_stream.write()` directly (not `writeSSE`) to avoid
21
21
  * Hono's HTML callback resolution — keeps the same `data: JSON\n\n` format.
22
22
  *
23
- * @param c - Hono context
24
- * @returns object with response and stream controller
23
+ * @param log - logger for serialization and `on_close` listener errors
24
+ * @returns object with the streaming `Response` and an `SseStream` controller
25
25
  */
26
26
  export const create_sse_response = (c, log) => {
27
27
  const { promise, resolve } = Promise.withResolvers();
@@ -84,6 +84,7 @@ export const SSE_CONNECTED_COMMENT = `: connected\n\n`;
84
84
  *
85
85
  * @param broadcaster - duck-typed broadcaster (e.g. `SubscriberRegistry`)
86
86
  * @param event_specs - event specs to validate against
87
+ * @param log - logger used to emit DEV warnings on unknown methods or param mismatches
87
88
  * @returns validated broadcaster wrapper (passthrough in production)
88
89
  */
89
90
  export const create_validated_broadcaster = (broadcaster, event_specs, log) => {