@fuzdev/fuz_app 0.54.0 → 0.56.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 (348) hide show
  1. package/dist/actions/CLAUDE.md +214 -103
  2. package/dist/actions/action_bridge.d.ts +8 -5
  3. package/dist/actions/action_bridge.d.ts.map +1 -1
  4. package/dist/actions/action_bridge.js +1 -11
  5. package/dist/actions/action_codegen.d.ts +32 -0
  6. package/dist/actions/action_codegen.d.ts.map +1 -1
  7. package/dist/actions/action_codegen.js +35 -15
  8. package/dist/actions/action_registry.d.ts.map +1 -1
  9. package/dist/actions/action_registry.js +5 -2
  10. package/dist/actions/action_rpc.d.ts +141 -22
  11. package/dist/actions/action_rpc.d.ts.map +1 -1
  12. package/dist/actions/action_rpc.js +106 -187
  13. package/dist/actions/action_spec.d.ts +55 -16
  14. package/dist/actions/action_spec.d.ts.map +1 -1
  15. package/dist/actions/action_spec.js +16 -11
  16. package/dist/actions/action_types.d.ts +28 -60
  17. package/dist/actions/action_types.d.ts.map +1 -1
  18. package/dist/actions/action_types.js +13 -5
  19. package/dist/actions/broadcast_api.d.ts +2 -2
  20. package/dist/actions/broadcast_api.js +2 -2
  21. package/dist/actions/compile_action_registry.d.ts +50 -0
  22. package/dist/actions/compile_action_registry.d.ts.map +1 -0
  23. package/dist/actions/compile_action_registry.js +69 -0
  24. package/dist/actions/heartbeat.d.ts +8 -4
  25. package/dist/actions/heartbeat.d.ts.map +1 -1
  26. package/dist/actions/heartbeat.js +5 -4
  27. package/dist/actions/perform_action.d.ts +145 -0
  28. package/dist/actions/perform_action.d.ts.map +1 -0
  29. package/dist/actions/perform_action.js +258 -0
  30. package/dist/actions/register_action_ws.d.ts +46 -40
  31. package/dist/actions/register_action_ws.d.ts.map +1 -1
  32. package/dist/actions/register_action_ws.js +101 -159
  33. package/dist/actions/register_ws_endpoint.d.ts +15 -10
  34. package/dist/actions/register_ws_endpoint.d.ts.map +1 -1
  35. package/dist/actions/register_ws_endpoint.js +54 -7
  36. package/dist/actions/transports.d.ts.map +1 -1
  37. package/dist/actions/transports.js +0 -4
  38. package/dist/actions/transports_ws_auth_guard.d.ts +1 -1
  39. package/dist/actions/transports_ws_auth_guard.js +1 -1
  40. package/dist/actions/transports_ws_backend.d.ts +1 -1
  41. package/dist/actions/transports_ws_backend.js +1 -1
  42. package/dist/auth/CLAUDE.md +794 -410
  43. package/dist/auth/account_action_specs.d.ts +28 -7
  44. package/dist/auth/account_action_specs.d.ts.map +1 -1
  45. package/dist/auth/account_action_specs.js +7 -7
  46. package/dist/auth/account_actions.d.ts +7 -13
  47. package/dist/auth/account_actions.d.ts.map +1 -1
  48. package/dist/auth/account_actions.js +26 -35
  49. package/dist/auth/account_queries.d.ts +52 -16
  50. package/dist/auth/account_queries.d.ts.map +1 -1
  51. package/dist/auth/account_queries.js +87 -38
  52. package/dist/auth/account_routes.d.ts +9 -11
  53. package/dist/auth/account_routes.d.ts.map +1 -1
  54. package/dist/auth/account_routes.js +118 -46
  55. package/dist/auth/account_schema.d.ts +46 -35
  56. package/dist/auth/account_schema.d.ts.map +1 -1
  57. package/dist/auth/account_schema.js +21 -28
  58. package/dist/auth/admin_action_specs.d.ts +100 -32
  59. package/dist/auth/admin_action_specs.d.ts.map +1 -1
  60. package/dist/auth/admin_action_specs.js +64 -33
  61. package/dist/auth/admin_actions.d.ts +13 -19
  62. package/dist/auth/admin_actions.d.ts.map +1 -1
  63. package/dist/auth/admin_actions.js +37 -41
  64. package/dist/auth/audit_emitter.d.ts +160 -0
  65. package/dist/auth/audit_emitter.d.ts.map +1 -0
  66. package/dist/auth/audit_emitter.js +83 -0
  67. package/dist/auth/audit_log_queries.d.ts +17 -48
  68. package/dist/auth/audit_log_queries.d.ts.map +1 -1
  69. package/dist/auth/audit_log_queries.js +20 -56
  70. package/dist/auth/audit_log_routes.d.ts +1 -1
  71. package/dist/auth/audit_log_routes.d.ts.map +1 -1
  72. package/dist/auth/audit_log_routes.js +7 -3
  73. package/dist/auth/audit_log_schema.d.ts +92 -32
  74. package/dist/auth/audit_log_schema.d.ts.map +1 -1
  75. package/dist/auth/audit_log_schema.js +75 -46
  76. package/dist/auth/auth_guard_resolver.d.ts +44 -0
  77. package/dist/auth/auth_guard_resolver.d.ts.map +1 -0
  78. package/dist/auth/auth_guard_resolver.js +56 -0
  79. package/dist/auth/bearer_auth.d.ts +9 -7
  80. package/dist/auth/bearer_auth.d.ts.map +1 -1
  81. package/dist/auth/bearer_auth.js +13 -21
  82. package/dist/auth/bootstrap_account.d.ts +7 -7
  83. package/dist/auth/bootstrap_account.d.ts.map +1 -1
  84. package/dist/auth/bootstrap_account.js +7 -7
  85. package/dist/auth/bootstrap_routes.d.ts.map +1 -1
  86. package/dist/auth/bootstrap_routes.js +11 -10
  87. package/dist/auth/cleanup.d.ts +20 -26
  88. package/dist/auth/cleanup.d.ts.map +1 -1
  89. package/dist/auth/cleanup.js +33 -42
  90. package/dist/auth/credential_type_schema.d.ts +115 -0
  91. package/dist/auth/credential_type_schema.d.ts.map +1 -0
  92. package/dist/auth/credential_type_schema.js +127 -0
  93. package/dist/auth/daemon_token_middleware.d.ts +23 -11
  94. package/dist/auth/daemon_token_middleware.d.ts.map +1 -1
  95. package/dist/auth/daemon_token_middleware.js +28 -22
  96. package/dist/auth/ddl.d.ts +2 -2
  97. package/dist/auth/ddl.d.ts.map +1 -1
  98. package/dist/auth/ddl.js +6 -6
  99. package/dist/auth/deps.d.ts +7 -18
  100. package/dist/auth/deps.d.ts.map +1 -1
  101. package/dist/auth/grant_path_schema.d.ts +117 -0
  102. package/dist/auth/grant_path_schema.d.ts.map +1 -0
  103. package/dist/auth/grant_path_schema.js +137 -0
  104. package/dist/auth/invite_queries.d.ts +12 -1
  105. package/dist/auth/invite_queries.d.ts.map +1 -1
  106. package/dist/auth/invite_queries.js +12 -1
  107. package/dist/auth/invite_schema.d.ts +1 -1
  108. package/dist/auth/invite_schema.d.ts.map +1 -1
  109. package/dist/auth/invite_schema.js +1 -1
  110. package/dist/auth/middleware.d.ts.map +1 -1
  111. package/dist/auth/middleware.js +9 -4
  112. package/dist/auth/migrations.d.ts +37 -14
  113. package/dist/auth/migrations.d.ts.map +1 -1
  114. package/dist/auth/migrations.js +79 -32
  115. package/dist/auth/request_context.d.ts +331 -61
  116. package/dist/auth/request_context.d.ts.map +1 -1
  117. package/dist/auth/request_context.js +378 -95
  118. package/dist/auth/{permit_offer_action_specs.d.ts → role_grant_offer_action_specs.d.ts} +163 -94
  119. package/dist/auth/role_grant_offer_action_specs.d.ts.map +1 -0
  120. package/dist/auth/role_grant_offer_action_specs.js +262 -0
  121. package/dist/auth/role_grant_offer_actions.d.ts +104 -0
  122. package/dist/auth/role_grant_offer_actions.d.ts.map +1 -0
  123. package/dist/auth/role_grant_offer_actions.js +473 -0
  124. package/dist/auth/{permit_offer_notifications.d.ts → role_grant_offer_notifications.d.ts} +90 -70
  125. package/dist/auth/role_grant_offer_notifications.d.ts.map +1 -0
  126. package/dist/auth/role_grant_offer_notifications.js +182 -0
  127. package/dist/auth/role_grant_offer_queries.d.ts +242 -0
  128. package/dist/auth/role_grant_offer_queries.d.ts.map +1 -0
  129. package/dist/auth/role_grant_offer_queries.js +533 -0
  130. package/dist/auth/role_grant_offer_schema.d.ts +150 -0
  131. package/dist/auth/role_grant_offer_schema.d.ts.map +1 -0
  132. package/dist/auth/{permit_offer_schema.js → role_grant_offer_schema.js} +60 -36
  133. package/dist/auth/role_grant_queries.d.ts +231 -0
  134. package/dist/auth/role_grant_queries.d.ts.map +1 -0
  135. package/dist/auth/role_grant_queries.js +320 -0
  136. package/dist/auth/role_schema.d.ts +150 -40
  137. package/dist/auth/role_schema.d.ts.map +1 -1
  138. package/dist/auth/role_schema.js +144 -45
  139. package/dist/auth/scope_kind_schema.d.ts +96 -0
  140. package/dist/auth/scope_kind_schema.d.ts.map +1 -0
  141. package/dist/auth/scope_kind_schema.js +94 -0
  142. package/dist/auth/self_service_role_action_specs.d.ts +6 -1
  143. package/dist/auth/self_service_role_action_specs.d.ts.map +1 -1
  144. package/dist/auth/self_service_role_action_specs.js +3 -1
  145. package/dist/auth/self_service_role_actions.d.ts +34 -27
  146. package/dist/auth/self_service_role_actions.d.ts.map +1 -1
  147. package/dist/auth/self_service_role_actions.js +68 -48
  148. package/dist/auth/session_cookie.d.ts +43 -6
  149. package/dist/auth/session_cookie.d.ts.map +1 -1
  150. package/dist/auth/session_cookie.js +31 -5
  151. package/dist/auth/session_middleware.d.ts +37 -3
  152. package/dist/auth/session_middleware.d.ts.map +1 -1
  153. package/dist/auth/session_middleware.js +33 -7
  154. package/dist/auth/signup_routes.d.ts.map +1 -1
  155. package/dist/auth/signup_routes.js +48 -19
  156. package/dist/auth/standard_action_specs.d.ts +2 -2
  157. package/dist/auth/standard_action_specs.js +4 -4
  158. package/dist/auth/standard_rpc_actions.d.ts +23 -19
  159. package/dist/auth/standard_rpc_actions.d.ts.map +1 -1
  160. package/dist/auth/standard_rpc_actions.js +12 -12
  161. package/dist/db/migrate.d.ts +12 -8
  162. package/dist/db/migrate.d.ts.map +1 -1
  163. package/dist/db/migrate.js +10 -7
  164. package/dist/dev/setup.d.ts +2 -2
  165. package/dist/dev/setup.d.ts.map +1 -1
  166. package/dist/dev/setup.js +9 -7
  167. package/dist/env/load.d.ts +1 -1
  168. package/dist/env/load.js +1 -1
  169. package/dist/hono_context.d.ts +64 -5
  170. package/dist/hono_context.d.ts.map +1 -1
  171. package/dist/hono_context.js +38 -2
  172. package/dist/http/CLAUDE.md +264 -87
  173. package/dist/http/auth_shape.d.ts +191 -0
  174. package/dist/http/auth_shape.d.ts.map +1 -0
  175. package/dist/http/auth_shape.js +237 -0
  176. package/dist/http/common_routes.js +3 -3
  177. package/dist/http/db_routes.d.ts +4 -0
  178. package/dist/http/db_routes.d.ts.map +1 -1
  179. package/dist/http/db_routes.js +44 -7
  180. package/dist/http/error_schemas.d.ts +132 -19
  181. package/dist/http/error_schemas.d.ts.map +1 -1
  182. package/dist/http/error_schemas.js +132 -40
  183. package/dist/http/jsonrpc_errors.d.ts +27 -2
  184. package/dist/http/jsonrpc_errors.d.ts.map +1 -1
  185. package/dist/http/jsonrpc_errors.js +26 -2
  186. package/dist/http/pending_effects.d.ts +71 -18
  187. package/dist/http/pending_effects.d.ts.map +1 -1
  188. package/dist/http/pending_effects.js +87 -18
  189. package/dist/http/proxy.d.ts +52 -5
  190. package/dist/http/proxy.d.ts.map +1 -1
  191. package/dist/http/proxy.js +92 -14
  192. package/dist/http/route_spec.d.ts +113 -41
  193. package/dist/http/route_spec.d.ts.map +1 -1
  194. package/dist/http/route_spec.js +130 -52
  195. package/dist/http/schema_helpers.d.ts +3 -2
  196. package/dist/http/schema_helpers.d.ts.map +1 -1
  197. package/dist/http/schema_helpers.js +9 -2
  198. package/dist/http/surface.d.ts +2 -1
  199. package/dist/http/surface.d.ts.map +1 -1
  200. package/dist/http/surface.js +1 -2
  201. package/dist/http/surface_query.d.ts +39 -35
  202. package/dist/http/surface_query.d.ts.map +1 -1
  203. package/dist/http/surface_query.js +79 -36
  204. package/dist/primitive_schemas.d.ts +39 -0
  205. package/dist/primitive_schemas.d.ts.map +1 -0
  206. package/dist/primitive_schemas.js +40 -0
  207. package/dist/realtime/sse_auth_guard.d.ts +5 -5
  208. package/dist/realtime/sse_auth_guard.js +9 -9
  209. package/dist/runtime/mock.d.ts +1 -1
  210. package/dist/runtime/mock.js +1 -1
  211. package/dist/server/app_backend.d.ts +14 -11
  212. package/dist/server/app_backend.d.ts.map +1 -1
  213. package/dist/server/app_backend.js +12 -8
  214. package/dist/server/app_server.d.ts +7 -7
  215. package/dist/server/app_server.d.ts.map +1 -1
  216. package/dist/server/app_server.js +36 -31
  217. package/dist/server/validate_nginx.d.ts +1 -1
  218. package/dist/server/validate_nginx.js +1 -1
  219. package/dist/testing/CLAUDE.md +73 -55
  220. package/dist/testing/admin_integration.d.ts +5 -6
  221. package/dist/testing/admin_integration.d.ts.map +1 -1
  222. package/dist/testing/admin_integration.js +100 -96
  223. package/dist/testing/adversarial_headers.js +1 -1
  224. package/dist/testing/app_server.d.ts +11 -14
  225. package/dist/testing/app_server.d.ts.map +1 -1
  226. package/dist/testing/app_server.js +18 -17
  227. package/dist/testing/assertions.d.ts.map +1 -1
  228. package/dist/testing/assertions.js +2 -1
  229. package/dist/testing/attack_surface.d.ts.map +1 -1
  230. package/dist/testing/attack_surface.js +15 -9
  231. package/dist/testing/audit_completeness.d.ts +2 -2
  232. package/dist/testing/audit_completeness.d.ts.map +1 -1
  233. package/dist/testing/audit_completeness.js +53 -39
  234. package/dist/testing/auth_apps.d.ts +5 -4
  235. package/dist/testing/auth_apps.d.ts.map +1 -1
  236. package/dist/testing/auth_apps.js +28 -22
  237. package/dist/testing/data_exposure.d.ts.map +1 -1
  238. package/dist/testing/data_exposure.js +5 -5
  239. package/dist/testing/db.d.ts +1 -1
  240. package/dist/testing/db.d.ts.map +1 -1
  241. package/dist/testing/db.js +4 -4
  242. package/dist/testing/db_entities.d.ts +22 -0
  243. package/dist/testing/db_entities.d.ts.map +1 -0
  244. package/dist/testing/db_entities.js +28 -0
  245. package/dist/testing/entities.d.ts +10 -8
  246. package/dist/testing/entities.d.ts.map +1 -1
  247. package/dist/testing/entities.js +22 -18
  248. package/dist/testing/integration.d.ts.map +1 -1
  249. package/dist/testing/integration.js +13 -14
  250. package/dist/testing/integration_helpers.d.ts +8 -6
  251. package/dist/testing/integration_helpers.d.ts.map +1 -1
  252. package/dist/testing/integration_helpers.js +29 -23
  253. package/dist/testing/middleware.d.ts +15 -11
  254. package/dist/testing/middleware.d.ts.map +1 -1
  255. package/dist/testing/middleware.js +75 -32
  256. package/dist/testing/rpc_attack_surface.d.ts.map +1 -1
  257. package/dist/testing/rpc_attack_surface.js +40 -24
  258. package/dist/testing/rpc_helpers.d.ts.map +1 -1
  259. package/dist/testing/rpc_helpers.js +3 -1
  260. package/dist/testing/rpc_round_trip.d.ts +1 -1
  261. package/dist/testing/rpc_round_trip.d.ts.map +1 -1
  262. package/dist/testing/rpc_round_trip.js +14 -13
  263. package/dist/testing/sse_round_trip.d.ts +3 -4
  264. package/dist/testing/sse_round_trip.d.ts.map +1 -1
  265. package/dist/testing/sse_round_trip.js +7 -11
  266. package/dist/testing/standard.d.ts +1 -1
  267. package/dist/testing/stubs.d.ts +25 -0
  268. package/dist/testing/stubs.d.ts.map +1 -1
  269. package/dist/testing/stubs.js +43 -2
  270. package/dist/testing/surface_invariants.d.ts +2 -2
  271. package/dist/testing/ws_round_trip.d.ts +12 -13
  272. package/dist/testing/ws_round_trip.d.ts.map +1 -1
  273. package/dist/testing/ws_round_trip.js +24 -12
  274. package/dist/ui/AdminAccounts.svelte +23 -20
  275. package/dist/ui/AdminOverview.svelte +15 -13
  276. package/dist/ui/AdminOverview.svelte.d.ts.map +1 -1
  277. package/dist/ui/{AdminPermitHistory.svelte → AdminRoleGrantHistory.svelte} +12 -12
  278. package/dist/ui/AdminRoleGrantHistory.svelte.d.ts +4 -0
  279. package/dist/ui/AdminRoleGrantHistory.svelte.d.ts.map +1 -0
  280. package/dist/ui/BootstrapForm.svelte +1 -1
  281. package/dist/ui/CLAUDE.md +65 -59
  282. package/dist/ui/{PermitOfferForm.svelte → RoleGrantOfferForm.svelte} +37 -22
  283. package/dist/ui/RoleGrantOfferForm.svelte.d.ts +20 -0
  284. package/dist/ui/RoleGrantOfferForm.svelte.d.ts.map +1 -0
  285. package/dist/ui/{PermitOfferHistory.svelte → RoleGrantOfferHistory.svelte} +12 -12
  286. package/dist/ui/{PermitOfferHistory.svelte.d.ts → RoleGrantOfferHistory.svelte.d.ts} +4 -4
  287. package/dist/ui/RoleGrantOfferHistory.svelte.d.ts.map +1 -0
  288. package/dist/ui/{PermitOfferInbox.svelte → RoleGrantOfferInbox.svelte} +14 -14
  289. package/dist/ui/{PermitOfferInbox.svelte.d.ts → RoleGrantOfferInbox.svelte.d.ts} +4 -4
  290. package/dist/ui/RoleGrantOfferInbox.svelte.d.ts.map +1 -0
  291. package/dist/ui/SignupForm.svelte +1 -1
  292. package/dist/ui/SurfaceExplorer.svelte +35 -15
  293. package/dist/ui/SurfaceExplorer.svelte.d.ts.map +1 -1
  294. package/dist/ui/account_sessions_state.svelte.d.ts +2 -3
  295. package/dist/ui/account_sessions_state.svelte.d.ts.map +1 -1
  296. package/dist/ui/account_sessions_state.svelte.js +2 -3
  297. package/dist/ui/admin_accounts_state.svelte.d.ts +25 -18
  298. package/dist/ui/admin_accounts_state.svelte.d.ts.map +1 -1
  299. package/dist/ui/admin_accounts_state.svelte.js +28 -17
  300. package/dist/ui/admin_rpc_adapters.d.ts +20 -20
  301. package/dist/ui/admin_rpc_adapters.d.ts.map +1 -1
  302. package/dist/ui/admin_rpc_adapters.js +17 -17
  303. package/dist/ui/admin_sessions_state.svelte.d.ts +2 -2
  304. package/dist/ui/admin_sessions_state.svelte.js +2 -2
  305. package/dist/ui/audit_log_state.svelte.d.ts +7 -7
  306. package/dist/ui/audit_log_state.svelte.d.ts.map +1 -1
  307. package/dist/ui/audit_log_state.svelte.js +6 -6
  308. package/dist/ui/auth_state.svelte.d.ts +3 -3
  309. package/dist/ui/auth_state.svelte.d.ts.map +1 -1
  310. package/dist/ui/auth_state.svelte.js +6 -6
  311. package/dist/ui/format_scope.d.ts +2 -2
  312. package/dist/ui/format_scope.js +2 -2
  313. package/dist/ui/{permit_offers_state.svelte.d.ts → role_grant_offers_state.svelte.d.ts} +39 -31
  314. package/dist/ui/role_grant_offers_state.svelte.d.ts.map +1 -0
  315. package/dist/ui/{permit_offers_state.svelte.js → role_grant_offers_state.svelte.js} +25 -19
  316. package/dist/ui/ui_format.js +2 -2
  317. package/package.json +3 -3
  318. package/dist/auth/permit_offer_action_specs.d.ts.map +0 -1
  319. package/dist/auth/permit_offer_action_specs.js +0 -227
  320. package/dist/auth/permit_offer_actions.d.ts +0 -110
  321. package/dist/auth/permit_offer_actions.d.ts.map +0 -1
  322. package/dist/auth/permit_offer_actions.js +0 -452
  323. package/dist/auth/permit_offer_notifications.d.ts.map +0 -1
  324. package/dist/auth/permit_offer_notifications.js +0 -182
  325. package/dist/auth/permit_offer_queries.d.ts +0 -183
  326. package/dist/auth/permit_offer_queries.d.ts.map +0 -1
  327. package/dist/auth/permit_offer_queries.js +0 -408
  328. package/dist/auth/permit_offer_schema.d.ts +0 -103
  329. package/dist/auth/permit_offer_schema.d.ts.map +0 -1
  330. package/dist/auth/permit_queries.d.ts +0 -210
  331. package/dist/auth/permit_queries.d.ts.map +0 -1
  332. package/dist/auth/permit_queries.js +0 -294
  333. package/dist/auth/require_keeper.d.ts +0 -20
  334. package/dist/auth/require_keeper.d.ts.map +0 -1
  335. package/dist/auth/require_keeper.js +0 -35
  336. package/dist/auth/route_guards.d.ts +0 -21
  337. package/dist/auth/route_guards.d.ts.map +0 -1
  338. package/dist/auth/route_guards.js +0 -32
  339. package/dist/auth/session_lifecycle.d.ts +0 -37
  340. package/dist/auth/session_lifecycle.d.ts.map +0 -1
  341. package/dist/auth/session_lifecycle.js +0 -29
  342. package/dist/ui/AdminPermitHistory.svelte.d.ts +0 -4
  343. package/dist/ui/AdminPermitHistory.svelte.d.ts.map +0 -1
  344. package/dist/ui/PermitOfferForm.svelte.d.ts +0 -14
  345. package/dist/ui/PermitOfferForm.svelte.d.ts.map +0 -1
  346. package/dist/ui/PermitOfferHistory.svelte.d.ts.map +0 -1
  347. package/dist/ui/PermitOfferInbox.svelte.d.ts.map +0 -1
  348. package/dist/ui/permit_offers_state.svelte.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"action_codegen.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/action_codegen.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,eAAe,EAAE,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAGxE;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,kCAAmC,CAAC;AAExE,8FAA8F;AAC9F,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,M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D,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACnC,KACC,MAwCF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,oCAAoC,GAChD,SAAS,aAAa,EACtB,UAAU;IACT,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;CACxB,KACC,MAqBF,CAAC;AAMF;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC;CACtC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,eAAO,MAAM,0BAA0B,GACtC,SAAS,aAAa,CAAC,UAAU,CAAC,EAClC,SAAS,aAAa,KACpB;IACF,YAAY,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,MAAM,CAAC;IAChD,SAAS,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC;CA6B1C,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,gBAAgB,GAAI,OAAO;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,aAAa,CAAC;IACvB,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CAC9B,KAAG,MAYH,CAAC"}
@@ -197,10 +197,11 @@ export const get_executor_phases = (spec, executor) => {
197
197
  }
198
198
  if (can_receive) {
199
199
  phases.push('receive_request', 'send_response');
200
- // TODO consolidate `send_error` is added redundantly when
201
- // initiator:'both' (already pushed above); the trailing Set dedup
202
- // handles it.
203
- phases.push('send_error');
200
+ // Backend's receive branch needs `send_error` for the failure
201
+ // path on incoming requests; only push when the send branch
202
+ // hasn't already added it (`initiator: 'both'`).
203
+ if (!can_send)
204
+ phases.push('send_error');
204
205
  }
205
206
  break;
206
207
  default:
@@ -226,8 +227,7 @@ export const get_executor_phases = (spec, executor) => {
226
227
  default:
227
228
  throw new UnreachableError(kind);
228
229
  }
229
- // Deduplicate phases (e.g., send_error added twice for initiator:'both' backend actions)
230
- return Array.from(new Set(phases));
230
+ return phases;
231
231
  };
232
232
  /** Default `collections_path` — every consumer's gen producers point at the sibling `action_collections.js`. */
233
233
  export const DEFAULT_COLLECTIONS_PATH = './action_collections.js';
@@ -330,6 +330,19 @@ export const to_action_spec_output_identifier = (method) => `${to_action_spec_id
330
330
  * follows so wrappers no longer pre-register imports a per-spec emit might
331
331
  * not actually use.
332
332
  *
333
+ * **Optional-input detection.** The emitted parameter is `input?:` (caller
334
+ * may omit the argument) when either (a) the schema accepts `undefined` —
335
+ * `z.optional(z.strictObject(...))` and similar wrappers — or (b) the
336
+ * schema accepts the empty object `{}` — `z.strictObject({acting:
337
+ ActingActor})` and other all-optional-fields strict objects. The second
338
+ * probe mirrors the dispatcher's HTTP convention (`raw_params ?? {}` for
339
+ * non-`z.void()` schemas in `actions/action_rpc.ts` / `http/route_spec.ts`):
340
+ * if a request with no params reaches the handler, this is the value the
341
+ * schema is asked to validate. A schema with required fields fails both
342
+ * probes and stays `input:` (required at the typed surface). Refinements
343
+ * and transforms run as part of `safeParse`, so their accept/reject
344
+ * decisions feed into the optional/required choice naturally.
345
+ *
333
346
  * @param options.sync_returns_value - When true (default), sync `local_call`
334
347
  * methods return the output value directly; when false they're wrapped in
335
348
  * `Result<{value, error}>` like async methods. Set to `false` if your
@@ -343,8 +356,9 @@ export const generate_actions_api_method_signature = (spec, imports, options) =>
343
356
  const collections_path = options?.collections_path ?? DEFAULT_COLLECTIONS_PATH;
344
357
  const innermost_type_name = zod_get_base_type(spec.input);
345
358
  const has_input = innermost_type_name !== 'null' && innermost_type_name !== 'void';
359
+ const input_optional = has_input && (spec.input.safeParse(undefined).success || spec.input.safeParse({}).success);
346
360
  const input_param = has_input
347
- ? `input${spec.input.safeParse(undefined).success ? '?' : ''}: ActionInputs['${spec.method}']`
361
+ ? `input${input_optional ? '?' : ''}: ActionInputs['${spec.method}']`
348
362
  : 'input?: void';
349
363
  if (has_input)
350
364
  imports.add_type(collections_path, 'ActionInputs');
@@ -380,7 +394,7 @@ export const generate_actions_api_method_signature = (spec, imports, options) =>
380
394
  // `qualify_spec?: (spec) => string` to emit a per-spec qualified identifier
381
395
  // (e.g. `admin_specs.account_list_action_spec`) for consumers stitching local
382
396
  // specs together with multiple upstream sources (`all_admin_action_specs` /
383
- // `all_permit_offer_action_specs` / `all_account_action_specs` /
397
+ // `all_role_grant_offer_action_specs` / `all_account_action_specs` /
384
398
  // `all_self_service_role_action_specs` from fuz_app). When `qualify_spec` is
385
399
  // set, the helper does NOT add a `* as specs` import — the consumer manages
386
400
  // the multiple `* as ns` imports itself — and `specs_module` is ignored.
@@ -423,15 +437,21 @@ export const ACTION_METHOD_ENUM_KINDS_ALL = new Set([
423
437
  */
424
438
  const filter_protocol_actions = (specs, include_protocol_actions) => include_protocol_actions ? specs : specs.filter((s) => !is_protocol_action_method(s.method));
425
439
  /**
426
- * Resolve the per-spec identifier qualifier used by the multi-source helpers
440
+ * Resolve a per-spec identifier qualifier with the standard default-vs-callback
441
+ * dance. When `qualify_spec` is set, returns the caller's callback verbatim
442
+ * and registers no imports — the caller owns its namespace setup (the
443
+ * multi-source case where specs come from several modules). Otherwise,
444
+ * registers `* as specs from specs_module` (defaulting to
445
+ * `'./action_specs.js'`) on `imports` and returns
446
+ * `(spec) => 'specs.' + to_action_spec_identifier(spec.method)`.
447
+ *
448
+ * Used internally by every multi-source-aware helper in this module
427
449
  * (`generate_action_specs_record`, `generate_action_inputs_outputs`,
428
- * `generate_backend_actions_api`). When `qualify_spec` is set, returns the
429
- * caller's callback verbatim the consumer is managing its own namespace
430
- * imports. Otherwise, registers the default `* as specs from specs_module`
431
- * import (defaulting to `'./action_specs.js'`) and returns the matching
432
- * `specs.${method}_action_spec` qualifier.
450
+ * `generate_backend_actions_api`); exported so consumers writing their own
451
+ * codegen helpers can reuse the same defaulting + import-registration
452
+ * behavior instead of reimplementing it.
433
453
  */
434
- const resolve_spec_qualifier = (imports, options) => {
454
+ export const resolve_spec_qualifier = (imports, options) => {
435
455
  if (options?.qualify_spec)
436
456
  return options.qualify_spec;
437
457
  const specs_module = options?.specs_module ?? DEFAULT_SPECS_MODULE;
@@ -1 +1 @@
1
- {"version":3,"file":"action_registry.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/action_registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EACX,eAAe,EACf,yBAAyB,EACzB,4BAA4B,EAC5B,mBAAmB,EACnB,MAAM,kBAAkB,CAAC;AAO1B,qBAAa,cAAc;;IAC1B,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC;gBAE3B,KAAK,EAAE,KAAK,CAAC,eAAe,CAAC;IAKzC,IAAI,cAAc,IAAI,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,CAEjD;IAED,IAAI,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,CAE3B;IAID,IAAI,sBAAsB,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAE7D;IAED,IAAI,yBAAyB,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAEnE;IAED,IAAI,gBAAgB,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAEjD;IAED,IAAI,wBAAwB,IAAI,KAAK,CAAC,MAAM,CAAC,CAE5C;IAED,IAAI,2BAA2B,IAAI,KAAK,CAAC,MAAM,CAAC,CAE/C;IAED,IAAI,kBAAkB,IAAI,KAAK,CAAC,MAAM,CAAC,CAEtC;IAOD,IAAI,0BAA0B,IAAI,KAAK,CAAC,eAAe,CAAC,CAEvD;IAED,IAAI,yBAAyB,IAAI,KAAK,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BAAuB,IAAI,KAAK,CAAC,eAAe,CAAC,CAKpD;IAED,IAAI,yBAAyB,IAAI,KAAK,CAAC,MAAM,CAAC,CAE7C;IAID,IAAI,yBAAyB,IAAI,KAAK,CAAC,eAAe,CAAC,CAEtD;IAED,IAAI,yBAAyB,IAAI,KAAK,CAAC,eAAe,CAAC,CAEtD;IAED,IAAI,2BAA2B,IAAI,KAAK,CAAC,MAAM,CAAC,CAE/C;IAED,IAAI,2BAA2B,IAAI,KAAK,CAAC,MAAM,CAAC,CAE/C;IAID,IAAI,YAAY,IAAI,KAAK,CAAC,eAAe,CAAC,CAEzC;IAED,IAAI,mBAAmB,IAAI,KAAK,CAAC,eAAe,CAAC,CAOhD;IAED,IAAI,cAAc,IAAI,KAAK,CAAC,MAAM,CAAC,CAElC;IAED,IAAI,qBAAqB,IAAI,KAAK,CAAC,MAAM,CAAC,CAEzC;CAaD"}
@@ -26,6 +26,7 @@
26
26
  *
27
27
  * @module
28
28
  */
29
+ import { is_public_auth } from '../http/auth_shape.js';
29
30
  // The auth (`public_*`, `authenticated_*`) and initiator-direction
30
31
  // (`backend_to_frontend_*`, `frontend_to_backend_*`) getters are pre-built
31
32
  // API surface unused by codegen today; kept low-cost for future filtering
@@ -128,10 +129,12 @@ export class ActionRegistry {
128
129
  }
129
130
  // --- Auth (pre-built, unused by codegen today) ---
130
131
  get public_specs() {
131
- return this.specs.filter((spec) => spec.auth === 'public');
132
+ return this.specs.filter((spec) => spec.auth !== null && is_public_auth(spec.auth));
132
133
  }
133
134
  get authenticated_specs() {
134
- return this.specs.filter((spec) => spec.auth === 'authenticated');
135
+ return this.specs.filter((spec) => spec.auth?.account === 'required' &&
136
+ !spec.auth.roles?.length &&
137
+ !spec.auth.credential_types?.length);
135
138
  }
136
139
  get public_methods() {
137
140
  return this.public_specs.map((spec) => spec.method);
@@ -13,37 +13,63 @@
13
13
  */
14
14
  import { z } from 'zod';
15
15
  import type { Logger } from '@fuzdev/fuz_util/log.js';
16
+ import type { Uuid } from '@fuzdev/fuz_util/id.js';
16
17
  import type { RequestResponseActionSpec } from './action_spec.js';
17
18
  import { type RouteSpec } from '../http/route_spec.js';
18
- import { type RequestContext } from '../auth/request_context.js';
19
+ import { type RequestActorContext, type RequestContext } from '../auth/request_context.js';
19
20
  import type { Db } from '../db/db.js';
20
21
  import { type JsonrpcRequestId } from '../http/jsonrpc.js';
21
22
  import type { RateLimiter } from '../rate_limiter.js';
22
23
  /**
23
- * Per-request context provided to RPC action handlers.
24
+ * Per-request context provided to action handlers across every transport
25
+ * (HTTP RPC, WebSocket, REST bridge). Built once per dispatched action by
26
+ * `perform_action` and threaded into the handler.
24
27
  *
25
- * Extends `RouteContext` with auth identity and logger.
26
- * `auth` is `RequestContext | null` handlers for authenticated
27
- * actions can narrow via the auth middleware guarantee.
28
+ * `auth` is `RequestContext | null` handlers for authenticated actions
29
+ * can narrow via the dispatcher's authorization-phase guarantee.
30
+ *
31
+ * Single handler context shape across every transport. Consumers inject
32
+ * domain deps via factory closures the same way HTTP RPC factories do.
28
33
  */
29
34
  export interface ActionContext {
30
35
  /** The authenticated identity, or `null` for public routes. */
31
36
  auth: RequestContext | null;
32
37
  /** The JSON-RPC request ID from the envelope. */
33
38
  request_id: JsonrpcRequestId;
34
- /** Transaction-scoped for mutations, pool-level for reads. */
39
+ /**
40
+ * Stable per-socket connection id on WebSocket transport; `undefined`
41
+ * on HTTP RPC. Consumers key per-connection domain state on this
42
+ * directly; HTTP handlers ignore it.
43
+ */
44
+ connection_id?: Uuid;
45
+ /**
46
+ * Transaction-scoped when `spec.side_effects` is true (the dispatcher
47
+ * wraps in `db.transaction`); pool-level otherwise. Handlers that
48
+ * need rollback-resilient writes call `deps.audit.emit(ctx, input)`,
49
+ * which captures the pool inside its closure.
50
+ */
35
51
  db: Db;
36
- /** Always pool-level — for fire-and-forget effects that outlive the transaction. */
37
- background_db: Db;
38
- /** Fire-and-forget side effects push here for post-response flushing. */
52
+ /**
53
+ * Eager fire-and-forget queue — push the in-flight `Promise<void>` for
54
+ * pool writes already running (audit emits, session touch, api-token
55
+ * usage tracking). Drained via `flush_pending_effects` after the
56
+ * handler returns.
57
+ */
39
58
  pending_effects: Array<Promise<void>>;
59
+ /**
60
+ * Deferred post-commit thunks — do not push directly; reach for
61
+ * `emit_after_commit(ctx, fn)` from `pending_effects.ts`. The flush
62
+ * site invokes each thunk after the handler (and any wrapping
63
+ * `db.transaction`) returns.
64
+ */
65
+ post_commit_effects: Array<() => void | Promise<void>>;
40
66
  /**
41
67
  * Resolved client IP from the trusted-proxy middleware — `'unknown'` if the
42
68
  * middleware wasn't in the stack (e.g. WS dispatch) or couldn't resolve.
43
- * Thread into `audit_log_fire_and_forget` as `ip: ctx.client_ip` for every
69
+ * Thread into `deps.audit.emit` as `ip: ctx.client_ip` for every
44
70
  * user-initiated action so RPC audit rows match the REST convention. Pass
45
71
  * `null` only for rows written outside a request (e.g. the
46
- * `permit_offer_expire` cleanup sweep in `auth/cleanup.ts`).
72
+ * `role_grant_offer_expire` cleanup sweep in `auth/cleanup.ts`).
47
73
  */
48
74
  client_ip: string;
49
75
  /** Logger instance. */
@@ -60,8 +86,9 @@ export interface ActionContext {
60
86
  notify: (method: string, params: unknown) => void;
61
87
  /**
62
88
  * AbortSignal that fires when the originating request is cancelled
63
- * (client disconnect on HTTP, socket close on WebSocket). Streaming
64
- * handlers should check this for early termination.
89
+ * (client disconnect on HTTP, socket close or per-request cancel
90
+ * notification on WebSocket). Streaming handlers should check this
91
+ * for early termination.
65
92
  */
66
93
  signal: AbortSignal;
67
94
  }
@@ -72,6 +99,43 @@ export interface ActionContext {
72
99
  * Returns the output value (serialized to JSON by the wrapper).
73
100
  */
74
101
  export type ActionHandler<TInput = any, TOutput = any> = (input: TInput, ctx: ActionContext) => TOutput | Promise<TOutput>;
102
+ /**
103
+ * `ActionContext` narrowed to a non-null `RequestContext`.
104
+ *
105
+ * Used by handlers whose spec declares `auth.account === 'required'`
106
+ * (with `auth.actor === 'none'`) — the dispatcher's pre-validation 401
107
+ * gate guarantees `request_context` is populated before the handler
108
+ * runs, but the actor slot stays null because no `acting` resolution
109
+ * happened. Selected automatically by `rpc_action`'s conditional return
110
+ * type for the account-grain tier.
111
+ */
112
+ export interface ActionAuthContext extends Omit<ActionContext, 'auth'> {
113
+ auth: RequestContext;
114
+ }
115
+ /**
116
+ * Handler signature for an account-grain RPC action — `auth.account === 'required'`
117
+ * and `auth.actor === 'none'`. Mirrors `ActionHandler` but tightens the
118
+ * `ctx.auth` slot to the non-null `RequestContext` (with `actor: null`).
119
+ */
120
+ export type AuthActionHandler<TInput = any, TOutput = any> = (input: TInput, ctx: ActionAuthContext) => TOutput | Promise<TOutput>;
121
+ /**
122
+ * `ActionContext` narrowed to a resolved acting actor.
123
+ *
124
+ * Used by handlers whose spec declares `auth.actor === 'required'` —
125
+ * the dispatcher's authorization phase resolves an actor (per
126
+ * registry-time invariant 2 the input declares `acting?: ActingActor`),
127
+ * so `ctx.auth.actor` is non-null. Selected automatically by
128
+ * `rpc_action`'s conditional return type for the actor-implying tier.
129
+ */
130
+ export interface ActionActorContext extends Omit<ActionContext, 'auth'> {
131
+ auth: RequestActorContext;
132
+ }
133
+ /**
134
+ * Handler signature for an actor-implying RPC action — `auth.actor === 'required'`.
135
+ * Mirrors `ActionHandler` but tightens the `ctx.auth` slot to the
136
+ * non-null `RequestActorContext` (with non-null `actor`).
137
+ */
138
+ export type ActorActionHandler<TInput = any, TOutput = any> = (input: TInput, ctx: ActionActorContext) => TOutput | Promise<TOutput>;
75
139
  /**
76
140
  * An RPC action — combines an action spec with its handler.
77
141
  *
@@ -83,7 +147,24 @@ export interface RpcAction {
83
147
  handler: ActionHandler;
84
148
  }
85
149
  /**
86
- * Pair a spec with a handler while preserving per-method input/output types.
150
+ * Conditional handler shape for `rpc_action` picks the narrowest
151
+ * `ctx.auth` type the dispatcher's runtime guarantee allows:
152
+ *
153
+ * - `auth.actor === 'required'` → `ActorActionHandler` (`ctx.auth: RequestActorContext`).
154
+ * - `auth.account === 'required' && auth.actor === 'none'` → `AuthActionHandler` (`ctx.auth: RequestContext`).
155
+ * - else (public, optional axes) → `ActionHandler` (`ctx.auth: RequestContext | null`).
156
+ *
157
+ * The bracketed form `[T] extends ['required']` defeats distributive
158
+ * conditionals so a degraded `AuthAxisState` union (when the spec was
159
+ * typed without preserving its literal) falls through to the loosest
160
+ * tier instead of collapsing to the narrowest.
161
+ */
162
+ export type HandlerForSpec<TSpec extends RequestResponseActionSpec> = [
163
+ TSpec['auth']['actor']
164
+ ] extends ['required'] ? ActorActionHandler<z.infer<TSpec['input']>, z.infer<TSpec['output']>> : [TSpec['auth']['account']] extends ['required'] ? AuthActionHandler<z.infer<TSpec['input']>, z.infer<TSpec['output']>> : ActionHandler<z.infer<TSpec['input']>, z.infer<TSpec['output']>>;
165
+ /**
166
+ * Pair a spec with a handler while preserving per-method input/output types
167
+ * and selecting the narrowest `ctx.auth` shape the spec literal admits.
87
168
  *
88
169
  * Constructing `{spec, handler}` literals widens `handler` to
89
170
  * `ActionHandler<any, any>`, so spec/handler drift (renamed Zod schema,
@@ -92,15 +173,42 @@ export interface RpcAction {
92
173
  * `(input: z.infer<spec.input>, ctx) => z.infer<spec.output>` via the
93
174
  * generic spec parameter — drift surfaces at the call site.
94
175
  *
176
+ * The `ctx.auth` narrowing follows the spec's `auth.account` /
177
+ * `auth.actor` literals (see `HandlerForSpec`): an actor-implying spec
178
+ * gets `ctx.auth: RequestActorContext`; an account-grain spec gets
179
+ * `ctx.auth: RequestContext`; everything else stays `ctx.auth:
180
+ * RequestContext | null`. Handlers can rely on the dispatcher's
181
+ * runtime guarantee without a manual narrowing call.
182
+ *
95
183
  * Fits fuz_app's factory-closure pattern (handlers close over
96
184
  * `grantable_roles`, `app_settings` ref, `notification_sender`, etc.).
97
185
  * zzz uses a different shape — a codegen-keyed `Record<Method, Handler>`
98
186
  * map typed via generated `ActionInputs`/`ActionOutputs` — which works when
99
187
  * handlers are pure (no closure state) and specs are codegen-enumerated.
100
- * fuz_app's admin + permit-offer actions have neither, so per-pair typing
188
+ * fuz_app's admin + role-grant-offer actions have neither, so per-pair typing
101
189
  * at the registration site is the right fit.
190
+ *
191
+ * Spec-literal preservation is load-bearing: declare specs with
192
+ * `satisfies RequestResponseActionSpec` (canonical) so `auth.actor`
193
+ * keeps its `'required'` / `'none'` literal type. A spec typed
194
+ * directly as `RequestResponseActionSpec` widens the axes to
195
+ * `AuthAxisState` and the handler defaults to the loosest tier — sound,
196
+ * but loses the ergonomic narrowing.
197
+ *
198
+ * @example
199
+ * ```ts
200
+ * // actor-implying spec → ctx.auth: RequestActorContext
201
+ * rpc_action(role_grant_revoke_action_spec, async (input, ctx) => {
202
+ * const revoker_id = ctx.auth.actor.id; // no narrowing needed
203
+ * });
204
+ *
205
+ * // account-grain spec → ctx.auth: RequestContext (actor: null)
206
+ * rpc_action(account_verify_action_spec, (_input, ctx) => {
207
+ * return to_session_account(ctx.auth.account); // no narrowing needed
208
+ * });
209
+ * ```
102
210
  */
103
- export declare const rpc_action: <TSpec extends RequestResponseActionSpec>(spec: TSpec, handler: ActionHandler<z.infer<TSpec["input"]>, z.infer<TSpec["output"]>>) => RpcAction;
211
+ export declare const rpc_action: <TSpec extends RequestResponseActionSpec>(spec: TSpec, handler: HandlerForSpec<TSpec>) => RpcAction;
104
212
  /** Options for `create_rpc_endpoint`. */
105
213
  export interface CreateRpcEndpointOptions {
106
214
  /** Mount path for the endpoint (e.g., `/api/rpc`). */
@@ -118,10 +226,12 @@ export interface CreateRpcEndpointOptions {
118
226
  */
119
227
  action_ip_rate_limiter?: RateLimiter | null;
120
228
  /**
121
- * Per-actor rate limiter consulted for actions whose spec declares
229
+ * Per-account rate limiter consulted for actions whose spec declares
122
230
  * `rate_limit: 'account'` or `'both'`. Keyed on
123
- * `request_context.actor.id`. `null` disables the account check.
124
- * Same limiter is shared with the WebSocket action dispatcher.
231
+ * `request_context.account.id` (account-grain billed to the
232
+ * authenticated account regardless of which actor was resolved).
233
+ * `null` disables the account check. Same limiter is shared with the
234
+ * WebSocket action dispatcher.
125
235
  */
126
236
  action_account_rate_limiter?: RateLimiter | null;
127
237
  }
@@ -134,9 +244,18 @@ export interface CreateRpcEndpointOptions {
134
244
  * 1. **Parse envelope** — POST: JSON body as `JsonrpcRequest`. GET: `method`
135
245
  * and `params` from query string.
136
246
  * 2. **Lookup method** — find the `RpcAction` by method name.
137
- * 3. **Auth check** — verify identity against the action's `auth` requirement.
138
- * 4. **Validate params** parse input against the action's `input` schema.
139
- * 5. **Dispatch** — acquire DB handle (transaction for mutations, pool for reads),
247
+ * 3. **Pre-validation auth** — short-circuit `unauthenticated` when no
248
+ * account is on the request, before input validation runs.
249
+ * 4. **Authorization phase** — resolve the acting actor (when the action's
250
+ * auth requires role_grants or its input declares `acting?: ActingActor`)
251
+ * and build the request context. Runs before input validation so
252
+ * role-grant-grain auth checks return 403 before 400 invalid_params;
253
+ * `acting` is read from raw params via a string typeguard.
254
+ * 5. **Post-authorization auth** — enforce role / keeper requirements
255
+ * against the request context.
256
+ * 6. **Validate params** — parse input against the action's `input` schema.
257
+ * 7. **Rate limit** — per-action IP / account throttling.
258
+ * 8. **Dispatch** — acquire DB handle (transaction for mutations, pool for reads),
140
259
  * construct `ActionContext`, call handler, return JSON-RPC response.
141
260
  *
142
261
  * GET is restricted to `side_effects: false` actions (cacheable reads).
@@ -1 +1 @@
1
- {"version":3,"file":"action_rpc.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/action_rpc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAEpD,OAAO,KAAK,EAAC,yBAAyB,EAAC,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAoB,KAAK,SAAS,EAAC,MAAM,uBAAuB,CAAC;AAExE,OAAO,EAAgC,KAAK,cAAc,EAAC,MAAM,4B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