@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
@@ -12,6 +12,12 @@
12
12
 
13
13
  import type {AppSurface, AppSurfaceRoute, AppSurfaceDiagnostic} from '../http/surface.js';
14
14
  import {surface_auth_summary, format_route_key} from '../http/surface_query.js';
15
+ import {
16
+ is_keeper_auth,
17
+ is_plain_authenticated_auth,
18
+ is_public_auth,
19
+ is_role_auth,
20
+ } from '../http/auth_shape.js';
15
21
 
16
22
  const {surface}: {surface: AppSurface} = $props();
17
23
 
@@ -22,10 +28,26 @@
22
28
 
23
29
  const summary = $derived(surface_auth_summary(surface));
24
30
 
31
+ const auth_matches_filter = (
32
+ auth: AppSurfaceRoute['auth'],
33
+ filter: (typeof auth_types)[number],
34
+ ): boolean => {
35
+ switch (filter) {
36
+ case 'all':
37
+ return true;
38
+ case 'none':
39
+ return is_public_auth(auth);
40
+ case 'authenticated':
41
+ return is_plain_authenticated_auth(auth);
42
+ case 'role':
43
+ return is_role_auth(auth);
44
+ case 'keeper':
45
+ return is_keeper_auth(auth);
46
+ }
47
+ };
48
+
25
49
  const filtered_routes: Array<AppSurfaceRoute> = $derived(
26
- auth_filter === 'all'
27
- ? surface.routes
28
- : surface.routes.filter((r) => r.auth.type === auth_filter),
50
+ surface.routes.filter((r) => auth_matches_filter(r.auth, auth_filter)),
29
51
  );
30
52
 
31
53
  let expanded_event: string | null = $state.raw(null);
@@ -39,21 +61,19 @@
39
61
  };
40
62
 
41
63
  const format_auth = (auth: AppSurfaceRoute['auth']): string => {
42
- if (auth.type === 'role') return `role:${auth.role}`;
43
- return auth.type;
64
+ if (is_public_auth(auth)) return 'none';
65
+ if (is_keeper_auth(auth)) return 'keeper';
66
+ if (is_role_auth(auth)) return `role:${auth.roles!.join('|')}`;
67
+ if (is_plain_authenticated_auth(auth)) return 'authenticated';
68
+ return 'other';
44
69
  };
45
70
 
46
71
  const auth_chip_class = (auth: AppSurfaceRoute['auth']): string => {
47
- switch (auth.type) {
48
- case 'none':
49
- return 'chip color_b';
50
- case 'authenticated':
51
- return 'chip color_a';
52
- case 'role':
53
- return 'chip color_d';
54
- case 'keeper':
55
- return 'chip color_c';
56
- }
72
+ if (is_public_auth(auth)) return 'chip color_b';
73
+ if (is_keeper_auth(auth)) return 'chip color_c';
74
+ if (is_role_auth(auth)) return 'chip color_d';
75
+ if (is_plain_authenticated_auth(auth)) return 'chip color_a';
76
+ return 'chip';
57
77
  };
58
78
 
59
79
  const role_count = $derived(Array.from(summary.role.values()).reduce((sum, n) => sum + n, 0));
@@ -1 +1 @@
1
- {"version":3,"file":"SurfaceExplorer.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/SurfaceExplorer.svelte"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAC,UAAU,EAAwC,MAAM,oBAAoB,CAAC;AAGzF,KAAK,gBAAgB,GAAI;IAAC,OAAO,EAAE,UAAU,CAAA;CAAC,CAAC;AAwRhD,QAAA,MAAM,eAAe,sDAAwC,CAAC;AAC9D,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAC1D,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"SurfaceExplorer.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/SurfaceExplorer.svelte"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAC,UAAU,EAAwC,MAAM,oBAAoB,CAAC;AASzF,KAAK,gBAAgB,GAAI;IAAC,OAAO,EAAE,UAAU,CAAA;CAAC,CAAC;AAuShD,QAAA,MAAM,eAAe,sDAAwC,CAAC;AAC9D,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAC1D,eAAe,eAAe,CAAC"}
@@ -1,8 +1,7 @@
1
1
  /**
2
2
  * Reactive state for managing the authenticated account's auth sessions on a
3
- * settings page. Reads and mutations flow through a narrow RPC adapter; the
4
- * REST routes that backed this class moved to `auth/account_actions.ts` in the
5
- * 2026-04-23 RPC migration.
3
+ * settings page. Reads and mutations flow through a narrow RPC adapter
4
+ * backed by `auth/account_actions.ts`.
6
5
  *
7
6
  * @module
8
7
  */
@@ -1 +1 @@
1
- {"version":3,"file":"account_sessions_state.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/account_sessions_state.svelte.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAC9C,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,2BAA2B,CAAC;AAE/D;;;;;;;;;;;GAWG;AACH,MAAM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,MAAM,2BAA2B,CAAC;AAE/D;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,kBAAkB;IAClC,IAAI,EAAE,MAAM,OAAO,CAAC;QAAC,QAAQ,EAAE,KAAK,CAAC,eAAe,CAAC,CAAA;KAAC,CAAC,CAAC;IACxD,MAAM,EAAE,CAAC,MAAM,EAAE;QAAC,UAAU,EAAE,MAAM,CAAA;KAAC,KAAK,OAAO,CAAC;QAAC,EAAE,EAAE,IAAI,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAC,CAAC,CAAC;IAChF,UAAU,EAAE,MAAM,OAAO,CAAC;QAAC,EAAE,EAAE,IAAI,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAAC,CAAC;CACrD;AAED;;;;GAIG;AACH,eAAO,MAAM,4BAA4B;qBAAwB,kBAAkB,GAAG,IAAI;yBAAzB,kBAAkB,GAAG,IAAI,wBAAzB,kBAAkB,GAAG,IAAI;CAEzF,CAAC;AAEF,MAAM,WAAW,2BAA2B;IAC3C;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,kBAAkB,GAAG,IAAI,CAAC;CAC1C;AAED,qBAAa,oBAAqB,SAAQ,QAAQ;;IAGjD,QAAQ,EAAE,KAAK,CAAC,eAAe,CAAC,CAAkB;IAElD,QAAQ,CAAC,YAAY,SAAkC;gBAE3C,OAAO,CAAC,EAAE,2BAA2B;IAKjD,6FAA6F;IAC7F,IAAI,OAAO,IAAI,OAAO,CAErB;IAEK,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAYtB,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAcjC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAejC"}
@@ -1,8 +1,7 @@
1
1
  /**
2
2
  * Reactive state for managing the authenticated account's auth sessions on a
3
- * settings page. Reads and mutations flow through a narrow RPC adapter; the
4
- * REST routes that backed this class moved to `auth/account_actions.ts` in the
5
- * 2026-04-23 RPC migration.
3
+ * settings page. Reads and mutations flow through a narrow RPC adapter
4
+ * backed by `auth/account_actions.ts`.
6
5
  *
7
6
  * @module
8
7
  */
@@ -8,18 +8,18 @@ import type { Uuid } from '@fuzdev/fuz_util/id.js';
8
8
  import { Loadable } from './loadable.svelte.js';
9
9
  import type { AdminAccountEntryJson } from '../auth/account_schema.js';
10
10
  import type { RoleName } from '../auth/role_schema.js';
11
- import type { PermitOfferJson } from '../auth/permit_offer_schema.js';
11
+ import type { RoleGrantOfferJson } from '../auth/role_grant_offer_schema.js';
12
12
  import type { AdminAccountListOutput, AdminSessionListOutput, AdminSessionRevokeAllInput, AdminSessionRevokeAllOutput, AdminTokenRevokeAllInput, AdminTokenRevokeAllOutput } from '../auth/admin_action_specs.js';
13
- import type { PermitOfferCreateInput, PermitOfferCreateOutput, PermitOfferOkOutput, PermitRevokeInput, PermitRevokeOutput } from '../auth/permit_offer_action_specs.js';
13
+ import type { RoleGrantOfferCreateInput, RoleGrantOfferCreateOutput, RoleGrantOfferOkOutput, RoleGrantRevokeInput, RoleGrantRevokeOutput } from '../auth/role_grant_offer_action_specs.js';
14
14
  /**
15
15
  * Narrow RPC surface consumed by `AdminAccountsState`. Consumers adapt their
16
16
  * typed RPC client (e.g. a `create_rpc_client` Proxy) to this shape — the
17
17
  * state class stays decoupled from the client's `Result` return type so
18
- * tests can inject plain-function stubs. Mirrors the `PermitOffersRpc`
18
+ * tests can inject plain-function stubs. Mirrors the `RoleGrantOffersRpc`
19
19
  * pattern.
20
20
  *
21
21
  * Every operation flows through RPC: the listing reuses `admin_account_list`,
22
- * grant reuses `permit_offer_create`, revoke and retract have dedicated
22
+ * grant reuses `role_grant_offer_create`, revoke and retract have dedicated
23
23
  * actions, and the session / token revoke-all mutations reuse
24
24
  * `admin_session_revoke_all` and `admin_token_revoke_all`. Without the
25
25
  * adapter the state class cannot fetch, grant, revoke, retract, or
@@ -33,9 +33,9 @@ import type { PermitOfferCreateInput, PermitOfferCreateOutput, PermitOfferOkOutp
33
33
  export interface AdminAccountsRpc {
34
34
  list_accounts: () => Promise<AdminAccountListOutput>;
35
35
  list_sessions: () => Promise<AdminSessionListOutput>;
36
- grant_permit: (params: PermitOfferCreateInput) => Promise<PermitOfferCreateOutput>;
37
- revoke_permit: (params: PermitRevokeInput) => Promise<PermitRevokeOutput>;
38
- retract_offer: (offer_id: Uuid) => Promise<PermitOfferOkOutput>;
36
+ create_role_grant: (params: RoleGrantOfferCreateInput) => Promise<RoleGrantOfferCreateOutput>;
37
+ revoke_role_grant: (params: RoleGrantRevokeInput) => Promise<RoleGrantRevokeOutput>;
38
+ retract_offer: (offer_id: Uuid) => Promise<RoleGrantOfferOkOutput>;
39
39
  session_revoke_all: (params: AdminSessionRevokeAllInput) => Promise<AdminSessionRevokeAllOutput>;
40
40
  token_revoke_all: (params: AdminTokenRevokeAllInput) => Promise<AdminTokenRevokeAllOutput>;
41
41
  }
@@ -56,7 +56,7 @@ export declare const admin_accounts_rpc_context: {
56
56
  export interface AdminAccountsStateOptions {
57
57
  /**
58
58
  * Reactive accessor for the RPC adapter; returns `null` when unwired.
59
- * Matches `PermitOffersStateOptions.account_id` / `actor_id` pattern —
59
+ * Matches `RoleGrantOffersStateOptions.account_id` / `actor_id` pattern —
60
60
  * lets the component pass a `$props()`-sourced rpc without tripping
61
61
  * Svelte's `state_referenced_locally` warning.
62
62
  */
@@ -78,33 +78,40 @@ export declare class AdminAccountsState extends Loadable {
78
78
  get has_rpc(): boolean;
79
79
  fetch(): Promise<void>;
80
80
  /**
81
- * Offer the role to the recipient via the `permit_offer_create` RPC.
81
+ * Offer the role to the recipient via the `role_grant_offer_create` RPC.
82
82
  * Server returns the pending offer; the recipient must accept before
83
- * the permit materializes. Returns the offer payload on success so
84
- * callers can drive follow-up UX (e.g. seed `PermitOffersState.outgoing`).
83
+ * the role_grant materializes. Returns the offer payload on success so
84
+ * callers can drive follow-up UX (e.g. seed `RoleGrantOffersState.outgoing`).
85
85
  *
86
86
  * A re-offer from the same admin to the same `(account, role)`
87
87
  * refreshes the existing pending row — the returned offer id is stable
88
88
  * across those calls.
89
89
  *
90
+ * `to_actor_id` (optional) narrows the offer to a specific actor on
91
+ * `account_id`; the in-flight `granting_keys` entry stays at
92
+ * `account_id:role` for the account-grain default (so existing
93
+ * consumers reading the 2-segment key keep working) and becomes
94
+ * `account_id:role:to_actor_id` when actor-targeted, so the two
95
+ * variants can be in flight without colliding on the per-row spinner.
96
+ *
90
97
  * No-op when the rpc adapter is absent; `error` is set to a descriptive
91
98
  * message so the UI surfaces the misconfiguration.
92
99
  */
93
- grant_permit(account_id: Uuid, role: RoleName): Promise<PermitOfferJson | undefined>;
100
+ create_role_grant(account_id: Uuid, role: RoleName, to_actor_id?: Uuid | null): Promise<RoleGrantOfferJson | undefined>;
94
101
  /**
95
- * Revoke an active permit via the `permit_revoke` RPC.
102
+ * Revoke an active role_grant via the `role_grant_revoke` RPC.
96
103
  *
97
- * `actor_id` is the natural key — permits are actor-scoped, and the
104
+ * `actor_id` is the natural key — role_grants are actor-scoped, and the
98
105
  * admin UI reads `row.actor.id` straight from the listing, so the state
99
106
  * class takes it directly rather than deriving it from `account_id`.
100
- * The optional `reason` is stamped on `permit.revoked_reason` and
107
+ * The optional `reason` is stamped on `role_grant.revoked_reason` and
101
108
  * surfaced on the revokee's WS notification.
102
109
  */
103
- revoke_permit(actor_id: Uuid, permit_id: Uuid, reason?: string | null): Promise<void>;
110
+ revoke_role_grant(actor_id: Uuid, role_grant_id: Uuid, reason?: string | null): Promise<void>;
104
111
  /**
105
- * Retract a pending offer the admin issued via the `permit_offer_retract`
112
+ * Retract a pending offer the admin issued via the `role_grant_offer_retract`
106
113
  * RPC. The action handles auth, audit, and the
107
- * `permit_offer_retracted` WS notification.
114
+ * `role_grant_offer_retracted` WS notification.
108
115
  *
109
116
  * After success, refetches the listing so `pending_offers` drops the
110
117
  * row and the "+ {role}" button un-hides.
@@ -1 +1 @@
1
- {"version":3,"file":"admin_accounts_state.svelte.d.ts","sour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  });
50
50
  }
51
51
  /**
52
- * Offer the role to the recipient via the `permit_offer_create` RPC.
52
+ * Offer the role to the recipient via the `role_grant_offer_create` RPC.
53
53
  * Server returns the pending offer; the recipient must accept before
54
- * the permit materializes. Returns the offer payload on success so
55
- * callers can drive follow-up UX (e.g. seed `PermitOffersState.outgoing`).
54
+ * the role_grant materializes. Returns the offer payload on success so
55
+ * callers can drive follow-up UX (e.g. seed `RoleGrantOffersState.outgoing`).
56
56
  *
57
57
  * A re-offer from the same admin to the same `(account, role)`
58
58
  * refreshes the existing pending row — the returned offer id is stable
59
59
  * across those calls.
60
60
  *
61
+ * `to_actor_id` (optional) narrows the offer to a specific actor on
62
+ * `account_id`; the in-flight `granting_keys` entry stays at
63
+ * `account_id:role` for the account-grain default (so existing
64
+ * consumers reading the 2-segment key keep working) and becomes
65
+ * `account_id:role:to_actor_id` when actor-targeted, so the two
66
+ * variants can be in flight without colliding on the per-row spinner.
67
+ *
61
68
  * No-op when the rpc adapter is absent; `error` is set to a descriptive
62
69
  * message so the UI surfaces the misconfiguration.
63
70
  */
64
- async grant_permit(account_id, role) {
71
+ async create_role_grant(account_id, role, to_actor_id) {
65
72
  const rpc = this.#get_rpc();
66
73
  if (!rpc) {
67
74
  this.error = 'rpc adapter not wired';
68
75
  return undefined;
69
76
  }
70
- const key = `${account_id}:${role}`;
77
+ const key = to_actor_id ? `${account_id}:${role}:${to_actor_id}` : `${account_id}:${role}`;
71
78
  this.granting_keys.add(key);
72
79
  try {
73
- const { offer } = await rpc.grant_permit({ to_account_id: account_id, role });
80
+ const { offer } = await rpc.create_role_grant({
81
+ to_account_id: account_id,
82
+ role,
83
+ ...(to_actor_id ? { to_actor_id } : {}),
84
+ });
74
85
  this.error = null;
75
86
  await this.fetch();
76
87
  return offer;
77
88
  }
78
89
  catch (e) {
79
- this.error = e instanceof Error ? e.message : 'Failed to grant permit';
90
+ this.error = e instanceof Error ? e.message : 'Failed to grant role_grant';
80
91
  return undefined;
81
92
  }
82
93
  finally {
@@ -84,37 +95,37 @@ export class AdminAccountsState extends Loadable {
84
95
  }
85
96
  }
86
97
  /**
87
- * Revoke an active permit via the `permit_revoke` RPC.
98
+ * Revoke an active role_grant via the `role_grant_revoke` RPC.
88
99
  *
89
- * `actor_id` is the natural key — permits are actor-scoped, and the
100
+ * `actor_id` is the natural key — role_grants are actor-scoped, and the
90
101
  * admin UI reads `row.actor.id` straight from the listing, so the state
91
102
  * class takes it directly rather than deriving it from `account_id`.
92
- * The optional `reason` is stamped on `permit.revoked_reason` and
103
+ * The optional `reason` is stamped on `role_grant.revoked_reason` and
93
104
  * surfaced on the revokee's WS notification.
94
105
  */
95
- async revoke_permit(actor_id, permit_id, reason) {
106
+ async revoke_role_grant(actor_id, role_grant_id, reason) {
96
107
  const rpc = this.#get_rpc();
97
108
  if (!rpc) {
98
109
  this.error = 'rpc adapter not wired';
99
110
  return;
100
111
  }
101
- this.revoking_ids.add(permit_id);
112
+ this.revoking_ids.add(role_grant_id);
102
113
  try {
103
- await rpc.revoke_permit({ actor_id, permit_id, reason: reason ?? null });
114
+ await rpc.revoke_role_grant({ actor_id, role_grant_id, reason: reason ?? null });
104
115
  this.error = null;
105
116
  await this.fetch();
106
117
  }
107
118
  catch (e) {
108
- this.error = e instanceof Error ? e.message : 'Failed to revoke permit';
119
+ this.error = e instanceof Error ? e.message : 'Failed to revoke role_grant';
109
120
  }
110
121
  finally {
111
- this.revoking_ids.delete(permit_id);
122
+ this.revoking_ids.delete(role_grant_id);
112
123
  }
113
124
  }
114
125
  /**
115
- * Retract a pending offer the admin issued via the `permit_offer_retract`
126
+ * Retract a pending offer the admin issued via the `role_grant_offer_retract`
116
127
  * RPC. The action handles auth, audit, and the
117
- * `permit_offer_retracted` WS notification.
128
+ * `role_grant_offer_retracted` WS notification.
118
129
  *
119
130
  * After success, refetches the listing so `pending_offers` drops the
120
131
  * row and the "+ {role}" button un-hides.
@@ -7,11 +7,11 @@
7
7
  * admin shell layout wire everything.
8
8
  *
9
9
  * Intentionally admin-only despite the backend-side
10
- * `create_standard_rpc_actions` rename (admin + permit-offer + account).
10
+ * `create_standard_rpc_actions` rename (admin + role-grant-offer + account).
11
11
  * Account-surface methods flow through `account_sessions_rpc_context`
12
- * (wired at the self-service layout), and permit-offer methods that
13
- * surface in the admin UI (`permit_offer_create`, `permit_revoke`,
14
- * `permit_offer_retract`) live inside the `AdminAccountsRpc` interface —
12
+ * (wired at the self-service layout), and role-grant-offer methods that
13
+ * surface in the admin UI (`role_grant_offer_create`, `role_grant_revoke`,
14
+ * `role_grant_offer_retract`) live inside the `AdminAccountsRpc` interface —
15
15
  * they belong to the admin UX, not a separate wire pairing. The UI side
16
16
  * and backend factory names diverge by design.
17
17
  *
@@ -21,8 +21,8 @@
21
21
  * ```
22
22
  *
23
23
  * The throwing Proxy spreads the JSON-RPC `{code, message, data?}` onto
24
- * the thrown `Error` so form components (e.g. `ui/PermitOfferForm.svelte`)
25
- * can match on `error.data?.reason` via `ERROR_OFFER_*` constants —
24
+ * the thrown `Error` so form components (e.g. `ui/RoleGrantOfferForm.svelte`)
25
+ * can match on `error.data?.reason` via `ERROR_ROLE_GRANT_OFFER_*` constants —
26
26
  * optional chaining is required because JSON-RPC `data` is spec-level
27
27
  * optional. Consumers that need a custom unwrap strategy can construct
28
28
  * their own object satisfying `AdminRpcApi` and pass it directly.
@@ -32,8 +32,8 @@
32
32
  *
33
33
  * @module
34
34
  */
35
- import type { AdminAccountListOutput, AdminSessionListOutput, AdminSessionRevokeAllInput, AdminSessionRevokeAllOutput, AdminTokenRevokeAllInput, AdminTokenRevokeAllOutput, AuditLogListInput, AuditLogListOutput, AuditLogPermitHistoryInput, AuditLogPermitHistoryOutput, InviteCreateInput, InviteCreateOutput, InviteDeleteInput, InviteDeleteOutput, InviteListOutput, AppSettingsGetOutput, AppSettingsUpdateInput, AppSettingsUpdateOutput } from '../auth/admin_action_specs.js';
36
- import type { PermitOfferCreateInput, PermitOfferCreateOutput, PermitOfferRetractInput, PermitOfferOkOutput, PermitRevokeInput, PermitRevokeOutput } from '../auth/permit_offer_action_specs.js';
35
+ import type { AdminAccountListOutput, AdminSessionListOutput, AdminSessionRevokeAllInput, AdminSessionRevokeAllOutput, AdminTokenRevokeAllInput, AdminTokenRevokeAllOutput, AuditLogListInput, AuditLogListOutput, AuditLogRoleGrantHistoryInput, AuditLogRoleGrantHistoryOutput, InviteCreateInput, InviteCreateOutput, InviteDeleteInput, InviteDeleteOutput, InviteListOutput, AppSettingsGetOutput, AppSettingsUpdateInput, AppSettingsUpdateOutput } from '../auth/admin_action_specs.js';
36
+ import type { RoleGrantOfferCreateInput, RoleGrantOfferCreateOutput, RoleGrantOfferRetractInput, RoleGrantOfferOkOutput, RoleGrantRevokeInput, RoleGrantRevokeOutput } from '../auth/role_grant_offer_action_specs.js';
37
37
  import { type AdminAccountsRpc } from './admin_accounts_state.svelte.js';
38
38
  import { type AdminInvitesRpc } from './admin_invites_state.svelte.js';
39
39
  import { type AuditLogRpc } from './audit_log_state.svelte.js';
@@ -56,15 +56,15 @@ export interface AdminRpcApi {
56
56
  admin_session_revoke_all: (input: AdminSessionRevokeAllInput) => Promise<AdminSessionRevokeAllOutput>;
57
57
  admin_token_revoke_all: (input: AdminTokenRevokeAllInput) => Promise<AdminTokenRevokeAllOutput>;
58
58
  audit_log_list: (input: AuditLogListInput) => Promise<AuditLogListOutput>;
59
- audit_log_permit_history: (input: AuditLogPermitHistoryInput) => Promise<AuditLogPermitHistoryOutput>;
59
+ audit_log_role_grant_history: (input: AuditLogRoleGrantHistoryInput) => Promise<AuditLogRoleGrantHistoryOutput>;
60
60
  invite_list: () => Promise<InviteListOutput>;
61
61
  invite_create: (input: InviteCreateInput) => Promise<InviteCreateOutput>;
62
62
  invite_delete: (input: InviteDeleteInput) => Promise<InviteDeleteOutput>;
63
63
  app_settings_get: () => Promise<AppSettingsGetOutput>;
64
64
  app_settings_update: (input: AppSettingsUpdateInput) => Promise<AppSettingsUpdateOutput>;
65
- permit_offer_create: (input: PermitOfferCreateInput) => Promise<PermitOfferCreateOutput>;
66
- permit_offer_retract: (input: PermitOfferRetractInput) => Promise<PermitOfferOkOutput>;
67
- permit_revoke: (input: PermitRevokeInput) => Promise<PermitRevokeOutput>;
65
+ role_grant_offer_create: (input: RoleGrantOfferCreateInput) => Promise<RoleGrantOfferCreateOutput>;
66
+ role_grant_offer_retract: (input: RoleGrantOfferRetractInput) => Promise<RoleGrantOfferOkOutput>;
67
+ role_grant_revoke: (input: RoleGrantRevokeInput) => Promise<RoleGrantRevokeOutput>;
68
68
  }
69
69
  /** The four admin RPC adapters assembled from a shared `api`. */
70
70
  export interface AdminRpcAdapters {
@@ -82,16 +82,16 @@ export interface AdminRpcAdapters {
82
82
  * | ----------------------------------- | ---------------------------- |
83
83
  * | `admin_accounts.list_accounts` | `admin_account_list` |
84
84
  * | `admin_accounts.list_sessions` | `admin_session_list` |
85
- * | `admin_accounts.grant_permit` | `permit_offer_create` |
86
- * | `admin_accounts.revoke_permit` | `permit_revoke` |
87
- * | `admin_accounts.retract_offer` | `permit_offer_retract` |
85
+ * | `admin_accounts.create_role_grant` | `role_grant_offer_create` |
86
+ * | `admin_accounts.revoke_role_grant` | `role_grant_revoke` |
87
+ * | `admin_accounts.retract_offer` | `role_grant_offer_retract` |
88
88
  * | `admin_accounts.session_revoke_all` | `admin_session_revoke_all` |
89
89
  * | `admin_accounts.token_revoke_all` | `admin_token_revoke_all` |
90
90
  * | `admin_invites.list` | `invite_list` |
91
91
  * | `admin_invites.create` | `invite_create` |
92
92
  * | `admin_invites.delete` | `invite_delete` |
93
93
  * | `audit_log.list` | `audit_log_list` |
94
- * | `audit_log.permit_history` | `audit_log_permit_history` |
94
+ * | `audit_log.role_grant_history` | `audit_log_role_grant_history` |
95
95
  * | `app_settings.get` | `app_settings_get` |
96
96
  * | `app_settings.update` | `app_settings_update` |
97
97
  *
@@ -103,7 +103,7 @@ export declare const create_admin_rpc_adapters: (api: AdminRpcApi) => AdminRpcAd
103
103
  /** Optional knobs alongside the adapters when wiring admin contexts. */
104
104
  export interface ProvideAdminRpcContextsOptions {
105
105
  /**
106
- * Render `{scope_id, role}` as a human label across permit-display
106
+ * Render `{scope_id, role}` as a human label across role-grant-display
107
107
  * components. Omit (or return `null`) to fall back to the raw uuid.
108
108
  */
109
109
  format_scope?: FormatScope;
@@ -120,9 +120,9 @@ export interface ProvideAdminRpcContextsOptions {
120
120
  * whole adapter set requires calling `provide_admin_rpc_contexts` again
121
121
  * during init — in practice this is one-shot at layout mount.
122
122
  *
123
- * Pass `options.format_scope` to render permit/offer `scope_id` values as
124
- * human labels across `AdminAccounts`, `AdminPermitHistory`,
125
- * `PermitOfferInbox`, `PermitOfferForm`, and `PermitOfferHistory`.
123
+ * Pass `options.format_scope` to render role_grant/offer `scope_id` values as
124
+ * human labels across `AdminAccounts`, `AdminRoleGrantHistory`,
125
+ * `RoleGrantOfferInbox`, `RoleGrantOfferForm`, and `RoleGrantOfferHistory`.
126
126
  * Components that accept a `format_scope` prop honor the prop first; the
127
127
  * context is the fallback.
128
128
  */
@@ -1 +1 @@
1
- {"version":3,"file":"admin_rpc_adapters.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/admin_rpc_adapters.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,KAAK,EACX,sBAAsB,EACtB,sBAAsB,EACtB,0BAA0B,EAC1B,2BAA2B,EAC3B,wBAAwB,EACxB,yBAAyB,EACzB,iBAAiB,EACjB,kBAAkB,EAClB,0BAA0B,EAC1B,2BAA2B,EAC3B,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EACX,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,M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,sBAAsB,KAAK,OAAO,CAAC,uBAAuB,CAAC,CAAC;IACzF,oBAAoB,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACvF,aAAa,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC;CACzE;AAED,iEAAiE;AACjE,MAAM,WAAW,gBAAgB;IAChC,cAAc,EAAE,gBAAgB,CAAC;IACjC,aAAa,EAAE,eAAe,CAAC;IAC/B,SAAS,EAAE,WAAW,CAAC;IACvB,YAAY,EAAE,cAAc,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,yBAAyB,GAAI,KAAK,WAAW,KAAG,gBAuB3D,CAAC;AAEH,wEAAwE;AACxE,MAAM,WAAW,8BAA8B;IAC9C;;;OAGG;IACH,YAAY,CAAC,EAAE,WAAW,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,0BAA0B,GACtC,UAAU,gBAAgB,EAC1B,UAAU,8BAA8B,KACtC,IASF,CAAC"}
1
+ {"version":3,"file":"admin_rpc_adapters.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/admin_rpc_adapters.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,KAAK,EACX,sBAAsB,EACtB,sBAAsB,EACtB,0BAA0B,EAC1B,2BAA2B,EAC3B,wBAAwB,EACxB,yBAAyB,EACzB,iBAAiB,EACjB,kBAAkB,EAClB,6BAA6B,EAC7B,8BAA8B,EAC9B,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EACX,yBAAyB,EACzB,0BAA0B,EAC1B,0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uBAAuB,CAAC,CAAC;IACzF,uBAAuB,EAAE,CACxB,KAAK,EAAE,yBAAyB,KAC5B,OAAO,CAAC,0BAA0B,CAAC,CAAC;IACzC,wBAAwB,EAAE,CAAC,KAAK,EAAE,0BAA0B,KAAK,OAAO,CAAC,sBAAsB,CAAC,CAAC;IACjG,iBAAiB,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAC;CACnF;AAED,iEAAiE;AACjE,MAAM,WAAW,gBAAgB;IAChC,cAAc,EAAE,gBAAgB,CAAC;IACjC,aAAa,EAAE,eAAe,CAAC;IAC/B,SAAS,EAAE,WAAW,CAAC;IACvB,YAAY,EAAE,cAAc,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,yBAAyB,GAAI,KAAK,WAAW,KAAG,gBAuB3D,CAAC;AAEH,wEAAwE;AACxE,MAAM,WAAW,8BAA8B;IAC9C;;;OAGG;IACH,YAAY,CAAC,EAAE,WAAW,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,0BAA0B,GACtC,UAAU,gBAAgB,EAC1B,UAAU,8BAA8B,KACtC,IASF,CAAC"}
@@ -7,11 +7,11 @@
7
7
  * admin shell layout wire everything.
8
8
  *
9
9
  * Intentionally admin-only despite the backend-side
10
- * `create_standard_rpc_actions` rename (admin + permit-offer + account).
10
+ * `create_standard_rpc_actions` rename (admin + role-grant-offer + account).
11
11
  * Account-surface methods flow through `account_sessions_rpc_context`
12
- * (wired at the self-service layout), and permit-offer methods that
13
- * surface in the admin UI (`permit_offer_create`, `permit_revoke`,
14
- * `permit_offer_retract`) live inside the `AdminAccountsRpc` interface —
12
+ * (wired at the self-service layout), and role-grant-offer methods that
13
+ * surface in the admin UI (`role_grant_offer_create`, `role_grant_revoke`,
14
+ * `role_grant_offer_retract`) live inside the `AdminAccountsRpc` interface —
15
15
  * they belong to the admin UX, not a separate wire pairing. The UI side
16
16
  * and backend factory names diverge by design.
17
17
  *
@@ -21,8 +21,8 @@
21
21
  * ```
22
22
  *
23
23
  * The throwing Proxy spreads the JSON-RPC `{code, message, data?}` onto
24
- * the thrown `Error` so form components (e.g. `ui/PermitOfferForm.svelte`)
25
- * can match on `error.data?.reason` via `ERROR_OFFER_*` constants —
24
+ * the thrown `Error` so form components (e.g. `ui/RoleGrantOfferForm.svelte`)
25
+ * can match on `error.data?.reason` via `ERROR_ROLE_GRANT_OFFER_*` constants —
26
26
  * optional chaining is required because JSON-RPC `data` is spec-level
27
27
  * optional. Consumers that need a custom unwrap strategy can construct
28
28
  * their own object satisfying `AdminRpcApi` and pass it directly.
@@ -46,16 +46,16 @@ import { format_scope_context } from './format_scope.js';
46
46
  * | ----------------------------------- | ---------------------------- |
47
47
  * | `admin_accounts.list_accounts` | `admin_account_list` |
48
48
  * | `admin_accounts.list_sessions` | `admin_session_list` |
49
- * | `admin_accounts.grant_permit` | `permit_offer_create` |
50
- * | `admin_accounts.revoke_permit` | `permit_revoke` |
51
- * | `admin_accounts.retract_offer` | `permit_offer_retract` |
49
+ * | `admin_accounts.create_role_grant` | `role_grant_offer_create` |
50
+ * | `admin_accounts.revoke_role_grant` | `role_grant_revoke` |
51
+ * | `admin_accounts.retract_offer` | `role_grant_offer_retract` |
52
52
  * | `admin_accounts.session_revoke_all` | `admin_session_revoke_all` |
53
53
  * | `admin_accounts.token_revoke_all` | `admin_token_revoke_all` |
54
54
  * | `admin_invites.list` | `invite_list` |
55
55
  * | `admin_invites.create` | `invite_create` |
56
56
  * | `admin_invites.delete` | `invite_delete` |
57
57
  * | `audit_log.list` | `audit_log_list` |
58
- * | `audit_log.permit_history` | `audit_log_permit_history` |
58
+ * | `audit_log.role_grant_history` | `audit_log_role_grant_history` |
59
59
  * | `app_settings.get` | `app_settings_get` |
60
60
  * | `app_settings.update` | `app_settings_update` |
61
61
  *
@@ -67,9 +67,9 @@ export const create_admin_rpc_adapters = (api) => ({
67
67
  admin_accounts: {
68
68
  list_accounts: () => api.admin_account_list(),
69
69
  list_sessions: () => api.admin_session_list(),
70
- grant_permit: (params) => api.permit_offer_create(params),
71
- revoke_permit: (params) => api.permit_revoke(params),
72
- retract_offer: (offer_id) => api.permit_offer_retract({ offer_id }),
70
+ create_role_grant: (params) => api.role_grant_offer_create(params),
71
+ revoke_role_grant: (params) => api.role_grant_revoke(params),
72
+ retract_offer: (offer_id) => api.role_grant_offer_retract({ offer_id }),
73
73
  session_revoke_all: (params) => api.admin_session_revoke_all(params),
74
74
  token_revoke_all: (params) => api.admin_token_revoke_all(params),
75
75
  },
@@ -80,7 +80,7 @@ export const create_admin_rpc_adapters = (api) => ({
80
80
  },
81
81
  audit_log: {
82
82
  list: (options) => api.audit_log_list(options ?? {}),
83
- permit_history: (params) => api.audit_log_permit_history(params ?? {}),
83
+ role_grant_history: (params) => api.audit_log_role_grant_history(params ?? {}),
84
84
  },
85
85
  app_settings: {
86
86
  get: () => api.app_settings_get(),
@@ -99,9 +99,9 @@ export const create_admin_rpc_adapters = (api) => ({
99
99
  * whole adapter set requires calling `provide_admin_rpc_contexts` again
100
100
  * during init — in practice this is one-shot at layout mount.
101
101
  *
102
- * Pass `options.format_scope` to render permit/offer `scope_id` values as
103
- * human labels across `AdminAccounts`, `AdminPermitHistory`,
104
- * `PermitOfferInbox`, `PermitOfferForm`, and `PermitOfferHistory`.
102
+ * Pass `options.format_scope` to render role_grant/offer `scope_id` values as
103
+ * human labels across `AdminAccounts`, `AdminRoleGrantHistory`,
104
+ * `RoleGrantOfferInbox`, `RoleGrantOfferForm`, and `RoleGrantOfferHistory`.
105
105
  * Components that accept a `format_scope` prop honor the prop first; the
106
106
  * context is the fallback.
107
107
  */
@@ -3,8 +3,8 @@
3
3
  *
4
4
  * Both the listing and the two revoke-all mutations flow through the shared
5
5
  * `AdminAccountsRpc` adapter (`list_sessions`, `session_revoke_all`,
6
- * `token_revoke_all`). The former REST `GET /api/admin/sessions` route moved
7
- * to the `admin_session_list` RPC method in the 2026-04-23 migration.
6
+ * `token_revoke_all`); the listing wraps the `admin_session_list` RPC
7
+ * method.
8
8
  *
9
9
  * @module
10
10
  */
@@ -3,8 +3,8 @@
3
3
  *
4
4
  * Both the listing and the two revoke-all mutations flow through the shared
5
5
  * `AdminAccountsRpc` adapter (`list_sessions`, `session_revoke_all`,
6
- * `token_revoke_all`). The former REST `GET /api/admin/sessions` route moved
7
- * to the `admin_session_list` RPC method in the 2026-04-23 migration.
6
+ * `token_revoke_all`); the listing wraps the `admin_session_list` RPC
7
+ * method.
8
8
  *
9
9
  * @module
10
10
  */
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Reactive state for the audit log viewer.
3
3
  *
4
- * Two fetch primitives (`fetch` for events, `fetch_permit_history` for the
4
+ * Two fetch primitives (`fetch` for events, `fetch_role_grant_history` for the
5
5
  * grant/revoke shortcut) flow through an injected RPC adapter; the SSE
6
6
  * stream continues to use `EventSource` directly — streams aren't an RPC
7
7
  * concern.
@@ -9,8 +9,8 @@
9
9
  * @module
10
10
  */
11
11
  import { Loadable } from './loadable.svelte.js';
12
- import type { AuditLogEventWithUsernamesJson, PermitHistoryEventJson } from '../auth/audit_log_schema.js';
13
- import type { AuditLogListInput, AuditLogListOutput, AuditLogPermitHistoryInput, AuditLogPermitHistoryOutput } from '../auth/admin_action_specs.js';
12
+ import type { AuditLogEventWithUsernamesJson, RoleGrantHistoryEventJson } from '../auth/audit_log_schema.js';
13
+ import type { AuditLogListInput, AuditLogListOutput, AuditLogRoleGrantHistoryInput, AuditLogRoleGrantHistoryOutput } from '../auth/admin_action_specs.js';
14
14
  /**
15
15
  * Narrow RPC surface consumed by `AuditLogState`. Consumers adapt their typed
16
16
  * RPC client to this shape. Mirrors `AdminAccountsRpc` / `AdminInvitesRpc`.
@@ -19,7 +19,7 @@ import type { AuditLogListInput, AuditLogListOutput, AuditLogPermitHistoryInput,
19
19
  */
20
20
  export interface AuditLogRpc {
21
21
  list: (input?: AuditLogListInput) => Promise<AuditLogListOutput>;
22
- permit_history: (input?: AuditLogPermitHistoryInput) => Promise<AuditLogPermitHistoryOutput>;
22
+ role_grant_history: (input?: AuditLogRoleGrantHistoryInput) => Promise<AuditLogRoleGrantHistoryOutput>;
23
23
  }
24
24
  /**
25
25
  * Svelte context carrying the reactive `AuditLogRpc` accessor. Mirrors
@@ -41,15 +41,15 @@ export interface AuditLogStateOptions {
41
41
  export declare class AuditLogState extends Loadable {
42
42
  #private;
43
43
  events: Array<AuditLogEventWithUsernamesJson>;
44
- permit_history_events: Array<PermitHistoryEventJson>;
44
+ role_grant_history_events: Array<RoleGrantHistoryEventJson>;
45
45
  readonly count: number;
46
46
  /** Whether the SSE stream is currently connected. */
47
47
  connected: boolean;
48
48
  constructor(options?: AuditLogStateOptions);
49
- /** True when an RPC adapter is wired. `fetch`/`fetch_permit_history` no-op without it. */
49
+ /** True when an RPC adapter is wired. `fetch`/`fetch_role_grant_history` no-op without it. */
50
50
  get has_rpc(): boolean;
51
51
  fetch(options?: AuditLogListInput): Promise<void>;
52
- fetch_permit_history(limit?: number, offset?: number): Promise<void>;
52
+ fetch_role_grant_history(limit?: number, offset?: number): Promise<void>;
53
53
  /**
54
54
  * Connect to the SSE stream for realtime audit events.
55
55
  *
@@ -1 +1 @@
1
- {"version":3,"file":"audit_log_state.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/audit_log_state.svelte.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAC9C,OAAO,KAAK,EAEX,8BAA8B,EAC9B,sBAAsB,EACtB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EACX,iBAAiB,EACjB,kBAAkB,EAClB,0BAA0B,EAC1B,2BAA2B,EAC3B,MAAM,+BAA+B,CAAC;AAGvC;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC3B,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,iB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