@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
@@ -4,49 +4,48 @@
4
4
  * Usable in tests, the adversarial auth runner, and future surface explorer UI.
5
5
  * Replaces duplicated inline `.filter()` patterns.
6
6
  *
7
- * TODO @surface-explorer Used by test utilities (test_auth_surface, adversarial_input,
8
- * surface_invariants) and SurfaceExplorer.svelte (surface_auth_summary, format_route_key).
9
- * Several query functions (filter_authenticated_routes, filter_keeper_routes,
10
- * routes_by_auth_type, filter_routes_by_prefix) are pre-built for richer surface
11
- * explorer features and consumer test suites leverage more as the surface UI matures.
7
+ * Categorical filters (`filter_authenticated_routes`, `filter_role_routes`,
8
+ * `filter_keeper_routes`) group the new flat-record `RouteAuth` shape into
9
+ * the legacy categorical buckets (`'authenticated'`, `'role'`, `'keeper'`)
10
+ * for adversarial test runners and the surface explorer. The buckets are
11
+ * derived views over the four axes (`account`, `actor`, `roles`,
12
+ * `credential_types`) — see `http/auth_shape.ts` for the canonical shape.
12
13
  *
13
14
  * @module
14
15
  */
15
16
  import type { AppSurface, AppSurfaceRoute } from './surface.js';
16
17
  /** Filter routes that require any form of authentication. */
17
18
  export declare const filter_protected_routes: (surface: AppSurface) => Array<AppSurfaceRoute>;
18
- /** Filter routes that are publicly accessible (no auth). */
19
+ /** Filter routes that are publicly accessible (no auth surface at all). */
19
20
  export declare const filter_public_routes: (surface: AppSurface) => Array<AppSurfaceRoute>;
20
- /** Filter all role-guarded routes (any role). */
21
- export declare const filter_role_routes: (surface: AppSurface) => Array<AppSurfaceRoute & {
22
- auth: {
23
- type: "role";
24
- role: string;
25
- };
26
- }>;
27
- /** Filter routes that require basic authentication (no specific role). */
28
- export declare const filter_authenticated_routes: (surface: AppSurface) => Array<AppSurfaceRoute & {
29
- auth: {
30
- type: "authenticated";
31
- };
32
- }>;
33
- /** Filter routes that require keeper credentials. */
34
- export declare const filter_keeper_routes: (surface: AppSurface) => Array<AppSurfaceRoute & {
35
- auth: {
36
- type: "keeper";
37
- };
38
- }>;
39
- /** Filter routes that require a specific named role. */
40
- export declare const filter_routes_for_role: (surface: AppSurface, role: string) => Array<AppSurfaceRoute & {
41
- auth: {
42
- type: "role";
43
- role: string;
44
- };
45
- }>;
21
+ /** Filter all role-guarded routes (any role declared on `auth.roles`). */
22
+ export declare const filter_role_routes: (surface: AppSurface) => Array<AppSurfaceRoute>;
46
23
  /**
47
- * Group routes by auth type.
24
+ * Filter routes that require basic authentication only — `account === 'required'`
25
+ * with no role / credential gate.
26
+ */
27
+ export declare const filter_authenticated_routes: (surface: AppSurface) => Array<AppSurfaceRoute>;
28
+ /** Filter routes that require keeper credentials (`daemon_token`). */
29
+ export declare const filter_keeper_routes: (surface: AppSurface) => Array<AppSurfaceRoute>;
30
+ /** Filter routes whose `auth.roles` includes the named role. */
31
+ export declare const filter_routes_for_role: (surface: AppSurface, role: string) => Array<AppSurfaceRoute>;
32
+ /**
33
+ * Categorize a `RouteAuth` into one of the legacy auth buckets.
48
34
  *
49
- * @returns a map from auth type string to route arrays, with role routes keyed as `'role:name'`
35
+ * Returns:
36
+ * - `'none'` for fully public routes (account === 'none' && actor === 'none')
37
+ * - `'keeper'` when `credential_types` includes `'daemon_token'`
38
+ * - `'role:<name>'` for each role declared on `auth.roles` (multi-role specs
39
+ * are emitted multiple times; callers that need single-bucket grouping
40
+ * should pre-collapse)
41
+ * - `'authenticated'` for `account === 'required'` without role / credential gate
42
+ * - `'optional'` when either axis is `'optional'` and no other bucket fits
43
+ * - `'other'` as a last-resort bucket for shapes that don't match above
44
+ */
45
+ export type RouteAuthCategory = 'none' | 'authenticated' | 'optional' | 'keeper' | `role:${string}` | 'other';
46
+ /**
47
+ * Group routes by auth category (see `RouteAuthCategory`). Multi-role specs
48
+ * appear under each of their role buckets.
50
49
  */
51
50
  export declare const routes_by_auth_type: (surface: AppSurface) => Map<string, Array<AppSurfaceRoute>>;
52
51
  /** Filter routes whose path starts with `prefix`. */
@@ -66,12 +65,17 @@ export declare const format_route_key: (route: AppSurfaceRoute) => string;
66
65
  /**
67
66
  * Summarize route auth distribution across the surface.
68
67
  *
69
- * @returns counts by auth type, with role counts broken out by role name
68
+ * Categorical view over the four-axis flat record. Multi-role specs
69
+ * contribute one count per role they admit.
70
+ *
71
+ * @returns counts by auth category, with role counts broken out by role name
70
72
  */
71
73
  export declare const surface_auth_summary: (surface: AppSurface) => {
72
74
  none: number;
73
75
  authenticated: number;
76
+ optional: number;
74
77
  role: Map<string, number>;
75
78
  keeper: number;
79
+ other: number;
76
80
  };
77
81
  //# sourceMappingURL=surface_query.d.ts.map
@@ -1 +1 @@
1
- {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AC,eAAe,CACtC,CAAC;AAE7C,gDAAgD;AAChD,eAAO,MAAM,0BAA0B,GAAI,SAAS,UAAU,KAAG,KAAK,CAAC,eAAe,CAC9B,CAAC;AAEzD,iEAAiE;AACjE,eAAO,MAAM,gBAAgB,GAAI,OAAO,eAAe,KAAG,MAAyC,CAAC;AAEpG;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,GAChC,SAAS,UAAU,KACjB;IACF,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CAqCd,CAAC"}
@@ -4,41 +4,69 @@
4
4
  * Usable in tests, the adversarial auth runner, and future surface explorer UI.
5
5
  * Replaces duplicated inline `.filter()` patterns.
6
6
  *
7
- * TODO @surface-explorer Used by test utilities (test_auth_surface, adversarial_input,
8
- * surface_invariants) and SurfaceExplorer.svelte (surface_auth_summary, format_route_key).
9
- * Several query functions (filter_authenticated_routes, filter_keeper_routes,
10
- * routes_by_auth_type, filter_routes_by_prefix) are pre-built for richer surface
11
- * explorer features and consumer test suites leverage more as the surface UI matures.
7
+ * Categorical filters (`filter_authenticated_routes`, `filter_role_routes`,
8
+ * `filter_keeper_routes`) group the new flat-record `RouteAuth` shape into
9
+ * the legacy categorical buckets (`'authenticated'`, `'role'`, `'keeper'`)
10
+ * for adversarial test runners and the surface explorer. The buckets are
11
+ * derived views over the four axes (`account`, `actor`, `roles`,
12
+ * `credential_types`) — see `http/auth_shape.ts` for the canonical shape.
12
13
  *
13
14
  * @module
14
15
  */
16
+ import { is_keeper_auth, is_plain_authenticated_auth, is_public_auth, is_role_auth, } from './auth_shape.js';
15
17
  /** Filter routes that require any form of authentication. */
16
- export const filter_protected_routes = (surface) => surface.routes.filter((r) => r.auth.type !== 'none');
17
- /** Filter routes that are publicly accessible (no auth). */
18
- export const filter_public_routes = (surface) => surface.routes.filter((r) => r.auth.type === 'none');
19
- /** Filter all role-guarded routes (any role). */
20
- export const filter_role_routes = (surface) => surface.routes.filter((r) => r.auth.type === 'role');
21
- /** Filter routes that require basic authentication (no specific role). */
22
- export const filter_authenticated_routes = (surface) => surface.routes.filter((r) => r.auth.type === 'authenticated');
23
- /** Filter routes that require keeper credentials. */
24
- export const filter_keeper_routes = (surface) => surface.routes.filter((r) => r.auth.type === 'keeper');
25
- /** Filter routes that require a specific named role. */
26
- export const filter_routes_for_role = (surface, role) => surface.routes.filter((r) => r.auth.type === 'role' && r.auth.role === role);
18
+ export const filter_protected_routes = (surface) => surface.routes.filter((r) => !is_public_auth(r.auth));
19
+ /** Filter routes that are publicly accessible (no auth surface at all). */
20
+ export const filter_public_routes = (surface) => surface.routes.filter((r) => is_public_auth(r.auth));
21
+ /** Filter all role-guarded routes (any role declared on `auth.roles`). */
22
+ export const filter_role_routes = (surface) => surface.routes.filter((r) => is_role_auth(r.auth));
27
23
  /**
28
- * Group routes by auth type.
29
- *
30
- * @returns a map from auth type string to route arrays, with role routes keyed as `'role:name'`
24
+ * Filter routes that require basic authentication only — `account === 'required'`
25
+ * with no role / credential gate.
26
+ */
27
+ export const filter_authenticated_routes = (surface) => surface.routes.filter((r) => is_plain_authenticated_auth(r.auth));
28
+ /** Filter routes that require keeper credentials (`daemon_token`). */
29
+ export const filter_keeper_routes = (surface) => surface.routes.filter((r) => is_keeper_auth(r.auth));
30
+ /** Filter routes whose `auth.roles` includes the named role. */
31
+ export const filter_routes_for_role = (surface, role) => surface.routes.filter((r) => r.auth.roles?.includes(role) ?? false);
32
+ /**
33
+ * Group routes by auth category (see `RouteAuthCategory`). Multi-role specs
34
+ * appear under each of their role buckets.
31
35
  */
32
36
  export const routes_by_auth_type = (surface) => {
33
37
  const groups = new Map();
34
- for (const r of surface.routes) {
35
- const key = r.auth.type === 'role' ? `role:${r.auth.role}` : r.auth.type;
38
+ const push = (key, r) => {
36
39
  let group = groups.get(key);
37
40
  if (!group) {
38
41
  group = [];
39
42
  groups.set(key, group);
40
43
  }
41
44
  group.push(r);
45
+ };
46
+ for (const r of surface.routes) {
47
+ const auth = r.auth;
48
+ if (is_public_auth(auth)) {
49
+ push('none', r);
50
+ continue;
51
+ }
52
+ if (is_keeper_auth(auth)) {
53
+ push('keeper', r);
54
+ continue;
55
+ }
56
+ if (is_role_auth(auth)) {
57
+ for (const role of auth.roles)
58
+ push(`role:${role}`, r);
59
+ continue;
60
+ }
61
+ if (is_plain_authenticated_auth(auth)) {
62
+ push('authenticated', r);
63
+ continue;
64
+ }
65
+ if (auth.account === 'optional' || auth.actor === 'optional') {
66
+ push('optional', r);
67
+ continue;
68
+ }
69
+ push('other', r);
42
70
  }
43
71
  return groups;
44
72
  };
@@ -59,28 +87,43 @@ export const format_route_key = (route) => `${route.method} ${route.path}`;
59
87
  /**
60
88
  * Summarize route auth distribution across the surface.
61
89
  *
62
- * @returns counts by auth type, with role counts broken out by role name
90
+ * Categorical view over the four-axis flat record. Multi-role specs
91
+ * contribute one count per role they admit.
92
+ *
93
+ * @returns counts by auth category, with role counts broken out by role name
63
94
  */
64
95
  export const surface_auth_summary = (surface) => {
65
96
  let none = 0;
66
97
  let authenticated = 0;
98
+ let optional = 0;
67
99
  const role = new Map();
68
100
  let keeper = 0;
101
+ let other = 0;
69
102
  for (const r of surface.routes) {
70
- switch (r.auth.type) {
71
- case 'none':
72
- none++;
73
- break;
74
- case 'authenticated':
75
- authenticated++;
76
- break;
77
- case 'role':
78
- role.set(r.auth.role, (role.get(r.auth.role) ?? 0) + 1);
79
- break;
80
- case 'keeper':
81
- keeper++;
82
- break;
103
+ const auth = r.auth;
104
+ if (is_public_auth(auth)) {
105
+ none++;
106
+ continue;
107
+ }
108
+ if (is_keeper_auth(auth)) {
109
+ keeper++;
110
+ continue;
111
+ }
112
+ if (is_role_auth(auth)) {
113
+ for (const r_name of auth.roles) {
114
+ role.set(r_name, (role.get(r_name) ?? 0) + 1);
115
+ }
116
+ continue;
117
+ }
118
+ if (is_plain_authenticated_auth(auth)) {
119
+ authenticated++;
120
+ continue;
121
+ }
122
+ if (auth.account === 'optional' || auth.actor === 'optional') {
123
+ optional++;
124
+ continue;
83
125
  }
126
+ other++;
84
127
  }
85
- return { none, authenticated, role, keeper };
128
+ return { none, authenticated, optional, role, keeper, other };
86
129
  };
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Reusable validator-schema primitives — `Username`, `UsernameProvided`,
3
+ * `Email`. Lives at the top level (not inside `auth/` or `http/`) because
4
+ * these shapes don't depend on or imply any domain — accounts hold a
5
+ * username and email, but invites, password resets, future cell-sharing,
6
+ * and other surfaces all reach for the same primitives without going
7
+ * through auth.
8
+ *
9
+ * Split out from `auth/account_schema.ts` so the auth module shrinks to
10
+ * entity types + client-safe JSON shapes (its real responsibility) and
11
+ * non-auth consumers can import these primitives without dragging the
12
+ * auth domain along. Future cross-domain primitives (phone, url, slug)
13
+ * land here too.
14
+ *
15
+ * @module
16
+ */
17
+ import { z } from 'zod';
18
+ /** Minimum username length (must have start + middle + end characters). */
19
+ export declare const USERNAME_LENGTH_MIN = 3;
20
+ /** Maximum username length (matches GitHub's limit). */
21
+ export declare const USERNAME_LENGTH_MAX = 39;
22
+ /** Maximum length for username input on login/lookup — more permissive than `USERNAME_LENGTH_MAX` for forward-compatibility if the creation limit is raised. */
23
+ export declare const USERNAME_PROVIDED_LENGTH_MAX = 255;
24
+ /** Username for account creation — starts with letter, alphanumeric/dash/underscore middle, ends with alphanumeric. No @ or . allowed. */
25
+ export declare const Username: z.ZodString;
26
+ export type Username = z.infer<typeof Username>;
27
+ /** Username submitted for login or lookup — minimal validation for forward-compatibility if format rules change. */
28
+ export declare const UsernameProvided: z.ZodString;
29
+ export type UsernameProvided = z.infer<typeof UsernameProvided>;
30
+ /**
31
+ * Email validation. Lives here rather than `@fuzdev/fuz_util` because every
32
+ * current consumer pairs it with `Username` (signup, invites, audit log) —
33
+ * keeping the two together avoids a cross-package import for the
34
+ * identity-primitive bundle. Promote to fuz_util if a non-identity consumer
35
+ * surfaces.
36
+ */
37
+ export declare const Email: z.ZodEmail;
38
+ export type Email = z.infer<typeof Email>;
39
+ //# sourceMappingURL=primitive_schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"primitive_schemas.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/primitive_schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAItB,2EAA2E;AAC3E,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAErC,wDAAwD;AACxD,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAEtC,gKAAgK;AAChK,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAEhD,0IAA0I;AAC1I,eAAO,MAAM,QAAQ,aAIyB,CAAC;AAC/C,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AAEhD,oHAAoH;AACpH,eAAO,MAAM,gBAAgB,aAAsD,CAAC;AACpF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEhE;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,YAAY,CAAC;AAC/B,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,KAAK,CAAC,CAAC"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Reusable validator-schema primitives — `Username`, `UsernameProvided`,
3
+ * `Email`. Lives at the top level (not inside `auth/` or `http/`) because
4
+ * these shapes don't depend on or imply any domain — accounts hold a
5
+ * username and email, but invites, password resets, future cell-sharing,
6
+ * and other surfaces all reach for the same primitives without going
7
+ * through auth.
8
+ *
9
+ * Split out from `auth/account_schema.ts` so the auth module shrinks to
10
+ * entity types + client-safe JSON shapes (its real responsibility) and
11
+ * non-auth consumers can import these primitives without dragging the
12
+ * auth domain along. Future cross-domain primitives (phone, url, slug)
13
+ * land here too.
14
+ *
15
+ * @module
16
+ */
17
+ import { z } from 'zod';
18
+ // TODO consider `.brand()` on Username and Email for compile-time safety
19
+ /** Minimum username length (must have start + middle + end characters). */
20
+ export const USERNAME_LENGTH_MIN = 3;
21
+ /** Maximum username length (matches GitHub's limit). */
22
+ export const USERNAME_LENGTH_MAX = 39;
23
+ /** Maximum length for username input on login/lookup — more permissive than `USERNAME_LENGTH_MAX` for forward-compatibility if the creation limit is raised. */
24
+ export const USERNAME_PROVIDED_LENGTH_MAX = 255;
25
+ /** Username for account creation — starts with letter, alphanumeric/dash/underscore middle, ends with alphanumeric. No @ or . allowed. */
26
+ export const Username = z
27
+ .string()
28
+ .min(USERNAME_LENGTH_MIN)
29
+ .max(USERNAME_LENGTH_MAX)
30
+ .regex(/^[a-zA-Z][0-9a-zA-Z_-]*[0-9a-zA-Z]$/);
31
+ /** Username submitted for login or lookup — minimal validation for forward-compatibility if format rules change. */
32
+ export const UsernameProvided = z.string().min(1).max(USERNAME_PROVIDED_LENGTH_MAX);
33
+ /**
34
+ * Email validation. Lives here rather than `@fuzdev/fuz_util` because every
35
+ * current consumer pairs it with `Username` (signup, invites, audit log) —
36
+ * keeping the two together avoids a cross-package import for the
37
+ * identity-primitive bundle. Promote to fuz_util if a non-identity consumer
38
+ * surfaces.
39
+ */
40
+ export const Email = z.email();
@@ -19,9 +19,9 @@ export declare const AUDIT_LOG_CHANNEL = "audit_log";
19
19
  /**
20
20
  * Audit event types that trigger SSE stream disconnection.
21
21
  *
22
- * `permit_revoke` requires the revoked role to match the guard's `required_role`
22
+ * `role_grant_revoke` requires the revoked role to match the guard's `required_role`
23
23
  * (or is skipped entirely when `required_role` is `null` — useful for streams
24
- * not gated by any specific permit).
24
+ * not gated by any specific role_grant).
25
25
  * `session_revoke_all` and `password_change` close every stream for the target account.
26
26
  * `session_revoke` closes only the stream tied to the specific revoked session
27
27
  * (matched by the blake3 session hash in `event.metadata.session_id`) — closing
@@ -32,7 +32,7 @@ export declare const DISCONNECT_EVENT_TYPES: ReadonlySet<string>;
32
32
  * Create an audit event handler that closes SSE streams on auth changes.
33
33
  *
34
34
  * Closes streams when:
35
- * - `permit_revoke` fires for the `required_role` targeting a connected subscriber
35
+ * - `role_grant_revoke` fires for the `required_role` targeting a connected subscriber
36
36
  * - `session_revoke_all` targets a connected subscriber (consistent invalidation)
37
37
  * - `password_change` targets a connected subscriber (sessions revoked implicitly)
38
38
  *
@@ -41,8 +41,8 @@ export declare const DISCONNECT_EVENT_TYPES: ReadonlySet<string>;
41
41
  *
42
42
  * @param registry - the subscriber registry to guard
43
43
  * @param required_role - the role that grants access to the SSE endpoint,
44
- * or `null` to skip `permit_revoke` handling entirely (for streams not gated
45
- * by a specific permit)
44
+ * or `null` to skip `role_grant_revoke` handling entirely (for streams not gated
45
+ * by a specific role_grant)
46
46
  * @param log - logger for disconnect events
47
47
  * @returns an `on_audit_event` callback
48
48
  */
@@ -17,16 +17,16 @@ export const AUDIT_LOG_CHANNEL = 'audit_log';
17
17
  /**
18
18
  * Audit event types that trigger SSE stream disconnection.
19
19
  *
20
- * `permit_revoke` requires the revoked role to match the guard's `required_role`
20
+ * `role_grant_revoke` requires the revoked role to match the guard's `required_role`
21
21
  * (or is skipped entirely when `required_role` is `null` — useful for streams
22
- * not gated by any specific permit).
22
+ * not gated by any specific role_grant).
23
23
  * `session_revoke_all` and `password_change` close every stream for the target account.
24
24
  * `session_revoke` closes only the stream tied to the specific revoked session
25
25
  * (matched by the blake3 session hash in `event.metadata.session_id`) — closing
26
26
  * all of a user's streams for a single-session revoke would be over-aggressive.
27
27
  */
28
28
  export const DISCONNECT_EVENT_TYPES = new Set([
29
- 'permit_revoke', // role revoked — user lost access
29
+ 'role_grant_revoke', // role revoked — user lost access
30
30
  'session_revoke', // single session revoked — close only that stream
31
31
  'session_revoke_all', // all sessions invalidated — user should be kicked
32
32
  'password_change', // password changed — all sessions revoked implicitly
@@ -35,7 +35,7 @@ export const DISCONNECT_EVENT_TYPES = new Set([
35
35
  * Create an audit event handler that closes SSE streams on auth changes.
36
36
  *
37
37
  * Closes streams when:
38
- * - `permit_revoke` fires for the `required_role` targeting a connected subscriber
38
+ * - `role_grant_revoke` fires for the `required_role` targeting a connected subscriber
39
39
  * - `session_revoke_all` targets a connected subscriber (consistent invalidation)
40
40
  * - `password_change` targets a connected subscriber (sessions revoked implicitly)
41
41
  *
@@ -44,8 +44,8 @@ export const DISCONNECT_EVENT_TYPES = new Set([
44
44
  *
45
45
  * @param registry - the subscriber registry to guard
46
46
  * @param required_role - the role that grants access to the SSE endpoint,
47
- * or `null` to skip `permit_revoke` handling entirely (for streams not gated
48
- * by a specific permit)
47
+ * or `null` to skip `role_grant_revoke` handling entirely (for streams not gated
48
+ * by a specific role_grant)
49
49
  * @param log - logger for disconnect events
50
50
  * @returns an `on_audit_event` callback
51
51
  */
@@ -73,9 +73,9 @@ export const create_sse_auth_guard = (registry, required_role, log) => {
73
73
  }
74
74
  return;
75
75
  }
76
- // permit_revoke requires matching the specific role. `null` means the
77
- // stream isn't gated by a specific permit, so permit_revoke is a no-op.
78
- if (event.event_type === 'permit_revoke') {
76
+ // role_grant_revoke requires matching the specific role. `null` means the
77
+ // stream isn't gated by a specific role_grant, so role_grant_revoke is a no-op.
78
+ if (event.event_type === 'role_grant_revoke') {
79
79
  if (required_role === null)
80
80
  return;
81
81
  if (event.metadata?.role !== required_role)
@@ -58,7 +58,7 @@ export interface MockRuntime extends RuntimeDeps {
58
58
  *
59
59
  * @example
60
60
  * ```ts
61
- * const runtime = create_mock_runtime(['apply', 'tx.ts']);
61
+ * const runtime = create_mock_runtime(['apply', 'zap.ts']);
62
62
  * runtime.mock_env.set('HOME', '/home/test');
63
63
  * runtime.mock_fs.set('/home/test/.app/config.json', '{}');
64
64
  *
@@ -18,7 +18,7 @@
18
18
  *
19
19
  * @example
20
20
  * ```ts
21
- * const runtime = create_mock_runtime(['apply', 'tx.ts']);
21
+ * const runtime = create_mock_runtime(['apply', 'zap.ts']);
22
22
  * runtime.mock_env.set('HOME', '/home/test');
23
23
  * runtime.mock_fs.set('/home/test/.app/config.json', '{}');
24
24
  *
@@ -55,17 +55,19 @@ export interface CreateAppBackendOptions {
55
55
  /** Structured logger instance. Omit for default (`new Logger('server')`). */
56
56
  log?: Logger;
57
57
  /**
58
- * Called after each audit log INSERT succeeds.
59
- * Use to broadcast audit events via SSE. Flows through `AppDeps`
60
- * to all route factories automatically. Defaults to a noop.
58
+ * Initial subscriber appended to `AppDeps.audit.on_event_chain`.
59
+ * Use to broadcast audit events via SSE / WS. Additional subscribers
60
+ * (e.g. the factory-managed audit-log SSE) are appended at server
61
+ * assembly via `audit.on_event_chain.push(listener)` — no shallow-copy
62
+ * of `AppDeps` required.
61
63
  */
62
64
  on_audit_event?: (event: AuditLogEvent) => void;
63
65
  /**
64
66
  * Audit-log config for consumer event-type extensions. Built once at
65
- * startup via `create_audit_log_config({extra_events})` and threaded
66
- * through `AppDeps.audit_log_config` to every fuz_app emit site so
67
- * consumer handlers cannot silently fall back to the builtin config.
68
- * Omit to use `BUILTIN_AUDIT_LOG_CONFIG` (no extra events).
67
+ * startup via `create_audit_log_config({extra_events})` and captured
68
+ * inside `AppDeps.audit` so consumer handlers cannot silently fall
69
+ * back to the builtin config. Omit to use `BUILTIN_AUDIT_LOG_CONFIG`
70
+ * (no extra events).
69
71
  */
70
72
  audit_log_config?: AuditLogConfig;
71
73
  /**
@@ -74,9 +76,10 @@ export interface CreateAppBackendOptions {
74
76
  * (`namespace`, `name`, `sequence`); order is append-only so forward-only
75
77
  * guarantees hold per-namespace.
76
78
  *
77
- * The reserved `'fuz_auth'` namespace is rejected at startup. Omit for no
78
- * extra namespaces. This is the only place to splice consumer migrations
79
- * — DB init belongs to the backend lifecycle, not server assembly.
79
+ * Names in `RESERVED_MIGRATION_NAMESPACES` (currently `['fuz_auth']`) are
80
+ * rejected at startup. Omit for no extra namespaces. This is the only
81
+ * place to splice consumer migrations — DB init belongs to the backend
82
+ * lifecycle, not server assembly.
80
83
  */
81
84
  migration_namespaces?: ReadonlyArray<MigrationNamespace>;
82
85
  }
@@ -89,7 +92,7 @@ export interface CreateAppBackendOptions {
89
92
  *
90
93
  * @param options - keyring, password deps, optional database URL, and optional `migration_namespaces`
91
94
  * @returns app backend with deps, database metadata, and combined migration results
92
- * @throws Error if `migration_namespaces` contains the reserved `'fuz_auth'` namespace
95
+ * @throws Error if `migration_namespaces` contains a namespace in `RESERVED_MIGRATION_NAMESPACES`
93
96
  */
94
97
  export declare const create_app_backend: (options: CreateAppBackendOptions) => Promise<AppBackend>;
95
98
  //# sourceMappingURL=app_backend.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"app_backend.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/server/app_backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAE/C,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAC,cAAc,EAAE,aAAa,EAAC,MAAM,6BAA6B,CAAC;AAC/E,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAiB,KAAK,kBAAkB,EAAE,KAAK,eAAe,EAAC,MAAM,kBAAkB,CAAC;AAI/F;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IAC1B,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,oIAAoI;IACpI,QAAQ,CAAC,iBAAiB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;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,cAAc,CAAC;IAClC;;;;;;;;;;OAUG;IACH,oBAAoB,CAAC,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;CACzD;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,GAAU,SAAS,uBAAuB,KAAG,OAAO,CAAC,UAAU,CAuC7F,CAAC"}
@@ -11,8 +11,9 @@
11
11
  * @module
12
12
  */
13
13
  import { Logger } from '@fuzdev/fuz_util/log.js';
14
+ import { create_audit_emitter } from '../auth/audit_emitter.js';
14
15
  import { run_migrations } from '../db/migrate.js';
15
- import { AUTH_MIGRATION_NS, AUTH_MIGRATION_NAMESPACE } from '../auth/migrations.js';
16
+ import { AUTH_MIGRATION_NS, RESERVED_MIGRATION_NAMESPACES } from '../auth/migrations.js';
16
17
  import { create_db } from '../db/create_db.js';
17
18
  /**
18
19
  * Initialize the backend: database + auth migrations + deps.
@@ -23,18 +24,16 @@ import { create_db } from '../db/create_db.js';
23
24
  *
24
25
  * @param options - keyring, password deps, optional database URL, and optional `migration_namespaces`
25
26
  * @returns app backend with deps, database metadata, and combined migration results
26
- * @throws Error if `migration_namespaces` contains the reserved `'fuz_auth'` namespace
27
+ * @throws Error if `migration_namespaces` contains a namespace in `RESERVED_MIGRATION_NAMESPACES`
27
28
  */
28
29
  export const create_app_backend = async (options) => {
29
30
  const { database_url, keyring, password, stat, read_text_file, delete_file } = options;
30
31
  const log = options.log ?? new Logger('server');
31
- const on_audit_event = options.on_audit_event ?? (() => { }); // eslint-disable-line @typescript-eslint/no-empty-function
32
- const { audit_log_config } = options;
33
32
  const { db, close, db_type, db_name } = await create_db(database_url);
34
33
  if (options.migration_namespaces?.length) {
35
34
  for (const ns of options.migration_namespaces) {
36
- if (ns.namespace === AUTH_MIGRATION_NAMESPACE) {
37
- throw new Error(`Migration namespace "${AUTH_MIGRATION_NAMESPACE}" is reserved by fuz_app — choose a different namespace`);
35
+ if (RESERVED_MIGRATION_NAMESPACES.includes(ns.namespace)) {
36
+ throw new Error(`Migration namespace "${ns.namespace}" is reserved by fuz_app — choose a different namespace`);
38
37
  }
39
38
  }
40
39
  }
@@ -42,6 +41,12 @@ export const create_app_backend = async (options) => {
42
41
  AUTH_MIGRATION_NS,
43
42
  ...(options.migration_namespaces ?? []),
44
43
  ]);
44
+ const audit = create_audit_emitter({
45
+ db,
46
+ log,
47
+ on_audit_event: options.on_audit_event,
48
+ audit_log_config: options.audit_log_config,
49
+ });
45
50
  return {
46
51
  db_type,
47
52
  db_name,
@@ -55,8 +60,7 @@ export const create_app_backend = async (options) => {
55
60
  read_text_file,
56
61
  delete_file,
57
62
  log,
58
- on_audit_event,
59
- audit_log_config,
63
+ audit,
60
64
  },
61
65
  };
62
66
  };
@@ -133,10 +133,11 @@ export interface AppServerOptions {
133
133
  /**
134
134
  * Enable factory-managed audit log SSE.
135
135
  *
136
- * When truthy, creates an `AuditLogSse` instance internally, wires `on_audit_event`
137
- * on the backend deps (composing with any existing callback), and auto-includes
138
- * `AUDIT_LOG_EVENT_SPECS` in the surface. The result is exposed on `AppServerContext`
139
- * (for route factories) and `AppServer` (for the caller).
136
+ * When truthy, creates an `AuditLogSse` instance internally, appends the SSE
137
+ * listener to `backend.deps.audit.on_event_chain` (composing with the
138
+ * consumer's `on_audit_event` callback rather than rebuilding `AppDeps`), and
139
+ * auto-includes `AUDIT_LOG_EVENT_SPECS` in the surface. The result is exposed
140
+ * on `AppServerContext` (for route factories) and `AppServer` (for the caller).
140
141
  *
141
142
  * Pass `true` for defaults (admin role), or `{role: 'custom'}` for a custom role.
142
143
  * Omit to wire audit SSE manually.
@@ -229,9 +230,8 @@ export declare const DEFAULT_MAX_BODY_SIZE: number;
229
230
  * static serving. Database migrations belong to the backend lifecycle —
230
231
  * pass `migration_namespaces` to `create_app_backend`.
231
232
  *
232
- * When `audit_log_sse` is set, shallow-copies `backend.deps` with a composed
233
- * `on_audit_event` that fans out to the SSE registry and the original
234
- * callback — `backend.deps` itself is not mutated.
233
+ * When `audit_log_sse` is set, the SSE registry's listener is appended to
234
+ * `backend.deps.audit.on_event_chain` no shallow-copy of `AppDeps`.
235
235
  *
236
236
  * @returns assembled Hono app, backend, surface build, and bootstrap status
237
237
  */
@@ -1 +1 @@
1
- {"version":3,"file":"app_server.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/server/app_server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAC,IAAI,EAAE,KAAK,OAAO,EAAC,MAAM,MAAM,CAAC;AAGxC,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,EAEN,KAAK,cAAc,EAEnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,8BAA8B,CAAC;AAC1E,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAGN,KAAK,WAAW,EAChB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gCAAgC,CAAC;AAEhE,OAAO,EAKN,KAAK,WAAW,EAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAGjD,OAAO,oBAAoB,CAAC;AAE5B,OAAO,EAA2B,KAAK,kBAAkB,EAAC,MAAM,aAAa,CAAC;AAE9E,OAAO,EAEN,KAAK,cAAc,EAEnB,KAAK,eAAe,EACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAIN,KAAK,SAAS,EACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,4BAA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