@fuzdev/fuz_app 0.55.0 → 0.57.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 (333) hide show
  1. package/dist/actions/CLAUDE.md +211 -155
  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 +19 -0
  6. package/dist/actions/action_codegen.d.ts.map +1 -1
  7. package/dist/actions/action_codegen.js +20 -14
  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 +110 -44
  11. package/dist/actions/action_rpc.d.ts.map +1 -1
  12. package/dist/actions/action_rpc.js +92 -287
  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 +44 -38
  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 +2 -10
  34. package/dist/actions/register_ws_endpoint.d.ts.map +1 -1
  35. package/dist/actions/register_ws_endpoint.js +32 -10
  36. package/dist/actions/transports_ws_auth_guard.d.ts +1 -1
  37. package/dist/actions/transports_ws_auth_guard.js +1 -1
  38. package/dist/actions/transports_ws_backend.d.ts +1 -1
  39. package/dist/actions/transports_ws_backend.js +1 -1
  40. package/dist/auth/CLAUDE.md +673 -442
  41. package/dist/auth/account_action_specs.d.ts +28 -7
  42. package/dist/auth/account_action_specs.d.ts.map +1 -1
  43. package/dist/auth/account_action_specs.js +7 -7
  44. package/dist/auth/account_actions.d.ts +8 -14
  45. package/dist/auth/account_actions.d.ts.map +1 -1
  46. package/dist/auth/account_actions.js +26 -32
  47. package/dist/auth/account_queries.d.ts +46 -13
  48. package/dist/auth/account_queries.d.ts.map +1 -1
  49. package/dist/auth/account_queries.js +73 -33
  50. package/dist/auth/account_routes.d.ts +4 -3
  51. package/dist/auth/account_routes.d.ts.map +1 -1
  52. package/dist/auth/account_routes.js +58 -33
  53. package/dist/auth/account_schema.d.ts +46 -54
  54. package/dist/auth/account_schema.d.ts.map +1 -1
  55. package/dist/auth/account_schema.js +21 -48
  56. package/dist/auth/admin_action_specs.d.ts +55 -21
  57. package/dist/auth/admin_action_specs.d.ts.map +1 -1
  58. package/dist/auth/admin_action_specs.js +42 -26
  59. package/dist/auth/admin_actions.d.ts +14 -21
  60. package/dist/auth/admin_actions.d.ts.map +1 -1
  61. package/dist/auth/admin_actions.js +47 -44
  62. package/dist/auth/audit_emitter.d.ts +160 -0
  63. package/dist/auth/audit_emitter.d.ts.map +1 -0
  64. package/dist/auth/audit_emitter.js +83 -0
  65. package/dist/auth/audit_log_queries.d.ts +17 -87
  66. package/dist/auth/audit_log_queries.d.ts.map +1 -1
  67. package/dist/auth/audit_log_queries.js +17 -96
  68. package/dist/auth/audit_log_routes.d.ts +1 -1
  69. package/dist/auth/audit_log_routes.d.ts.map +1 -1
  70. package/dist/auth/audit_log_routes.js +7 -3
  71. package/dist/auth/audit_log_schema.d.ts +48 -42
  72. package/dist/auth/audit_log_schema.d.ts.map +1 -1
  73. package/dist/auth/audit_log_schema.js +56 -43
  74. package/dist/auth/auth_guard_resolver.d.ts +44 -0
  75. package/dist/auth/auth_guard_resolver.d.ts.map +1 -0
  76. package/dist/auth/auth_guard_resolver.js +56 -0
  77. package/dist/auth/bootstrap_account.d.ts +7 -7
  78. package/dist/auth/bootstrap_account.d.ts.map +1 -1
  79. package/dist/auth/bootstrap_account.js +7 -7
  80. package/dist/auth/bootstrap_routes.d.ts.map +1 -1
  81. package/dist/auth/bootstrap_routes.js +11 -10
  82. package/dist/auth/cleanup.d.ts +20 -26
  83. package/dist/auth/cleanup.d.ts.map +1 -1
  84. package/dist/auth/cleanup.js +33 -47
  85. package/dist/auth/credential_type_schema.d.ts +115 -0
  86. package/dist/auth/credential_type_schema.d.ts.map +1 -0
  87. package/dist/auth/credential_type_schema.js +127 -0
  88. package/dist/auth/daemon_token_middleware.d.ts +1 -1
  89. package/dist/auth/daemon_token_middleware.js +3 -3
  90. package/dist/auth/ddl.d.ts +2 -2
  91. package/dist/auth/ddl.d.ts.map +1 -1
  92. package/dist/auth/ddl.js +6 -6
  93. package/dist/auth/deps.d.ts +7 -32
  94. package/dist/auth/deps.d.ts.map +1 -1
  95. package/dist/auth/grant_path_schema.d.ts +117 -0
  96. package/dist/auth/grant_path_schema.d.ts.map +1 -0
  97. package/dist/auth/grant_path_schema.js +137 -0
  98. package/dist/auth/invite_queries.d.ts +12 -1
  99. package/dist/auth/invite_queries.d.ts.map +1 -1
  100. package/dist/auth/invite_queries.js +12 -1
  101. package/dist/auth/invite_schema.d.ts +1 -1
  102. package/dist/auth/invite_schema.d.ts.map +1 -1
  103. package/dist/auth/invite_schema.js +1 -1
  104. package/dist/auth/middleware.d.ts.map +1 -1
  105. package/dist/auth/middleware.js +5 -2
  106. package/dist/auth/migrations.d.ts +22 -7
  107. package/dist/auth/migrations.d.ts.map +1 -1
  108. package/dist/auth/migrations.js +64 -25
  109. package/dist/auth/request_context.d.ts +157 -170
  110. package/dist/auth/request_context.d.ts.map +1 -1
  111. package/dist/auth/request_context.js +224 -268
  112. package/dist/auth/{permit_offer_action_specs.d.ts → role_grant_offer_action_specs.d.ts} +130 -100
  113. package/dist/auth/role_grant_offer_action_specs.d.ts.map +1 -0
  114. package/dist/auth/role_grant_offer_action_specs.js +262 -0
  115. package/dist/auth/role_grant_offer_actions.d.ts +104 -0
  116. package/dist/auth/role_grant_offer_actions.d.ts.map +1 -0
  117. package/dist/auth/{permit_offer_actions.js → role_grant_offer_actions.js} +153 -140
  118. package/dist/auth/{permit_offer_notifications.d.ts → role_grant_offer_notifications.d.ts} +80 -70
  119. package/dist/auth/role_grant_offer_notifications.d.ts.map +1 -0
  120. package/dist/auth/role_grant_offer_notifications.js +182 -0
  121. package/dist/auth/{permit_offer_queries.d.ts → role_grant_offer_queries.d.ts} +64 -64
  122. package/dist/auth/role_grant_offer_queries.d.ts.map +1 -0
  123. package/dist/auth/{permit_offer_queries.js → role_grant_offer_queries.js} +136 -123
  124. package/dist/auth/role_grant_offer_schema.d.ts +150 -0
  125. package/dist/auth/role_grant_offer_schema.d.ts.map +1 -0
  126. package/dist/auth/{permit_offer_schema.js → role_grant_offer_schema.js} +55 -36
  127. package/dist/auth/role_grant_queries.d.ts +231 -0
  128. package/dist/auth/role_grant_queries.d.ts.map +1 -0
  129. package/dist/auth/role_grant_queries.js +320 -0
  130. package/dist/auth/role_schema.d.ts +150 -40
  131. package/dist/auth/role_schema.d.ts.map +1 -1
  132. package/dist/auth/role_schema.js +144 -45
  133. package/dist/auth/scope_kind_schema.d.ts +96 -0
  134. package/dist/auth/scope_kind_schema.d.ts.map +1 -0
  135. package/dist/auth/scope_kind_schema.js +94 -0
  136. package/dist/auth/self_service_role_action_specs.d.ts +4 -1
  137. package/dist/auth/self_service_role_action_specs.d.ts.map +1 -1
  138. package/dist/auth/self_service_role_action_specs.js +2 -2
  139. package/dist/auth/self_service_role_actions.d.ts +35 -29
  140. package/dist/auth/self_service_role_actions.d.ts.map +1 -1
  141. package/dist/auth/self_service_role_actions.js +58 -48
  142. package/dist/auth/session_cookie.d.ts +43 -6
  143. package/dist/auth/session_cookie.d.ts.map +1 -1
  144. package/dist/auth/session_cookie.js +31 -5
  145. package/dist/auth/session_middleware.d.ts +37 -3
  146. package/dist/auth/session_middleware.d.ts.map +1 -1
  147. package/dist/auth/session_middleware.js +33 -7
  148. package/dist/auth/signup_routes.d.ts.map +1 -1
  149. package/dist/auth/signup_routes.js +48 -19
  150. package/dist/auth/standard_action_specs.d.ts +2 -2
  151. package/dist/auth/standard_action_specs.js +4 -4
  152. package/dist/auth/standard_rpc_actions.d.ts +23 -19
  153. package/dist/auth/standard_rpc_actions.d.ts.map +1 -1
  154. package/dist/auth/standard_rpc_actions.js +12 -12
  155. package/dist/db/migrate.d.ts +1 -1
  156. package/dist/db/migrate.js +1 -1
  157. package/dist/dev/setup.d.ts +2 -2
  158. package/dist/dev/setup.d.ts.map +1 -1
  159. package/dist/dev/setup.js +4 -4
  160. package/dist/env/load.d.ts +1 -1
  161. package/dist/env/load.js +1 -1
  162. package/dist/hono_context.d.ts +27 -45
  163. package/dist/hono_context.d.ts.map +1 -1
  164. package/dist/hono_context.js +14 -28
  165. package/dist/http/CLAUDE.md +235 -121
  166. package/dist/http/auth_shape.d.ts +191 -0
  167. package/dist/http/auth_shape.d.ts.map +1 -0
  168. package/dist/http/auth_shape.js +237 -0
  169. package/dist/http/common_routes.js +3 -3
  170. package/dist/http/db_routes.d.ts +4 -0
  171. package/dist/http/db_routes.d.ts.map +1 -1
  172. package/dist/http/db_routes.js +44 -7
  173. package/dist/http/error_schemas.d.ts +72 -39
  174. package/dist/http/error_schemas.d.ts.map +1 -1
  175. package/dist/http/error_schemas.js +81 -33
  176. package/dist/http/pending_effects.d.ts +71 -18
  177. package/dist/http/pending_effects.d.ts.map +1 -1
  178. package/dist/http/pending_effects.js +87 -18
  179. package/dist/http/proxy.d.ts +52 -5
  180. package/dist/http/proxy.d.ts.map +1 -1
  181. package/dist/http/proxy.js +92 -14
  182. package/dist/http/route_spec.d.ts +89 -75
  183. package/dist/http/route_spec.d.ts.map +1 -1
  184. package/dist/http/route_spec.js +54 -72
  185. package/dist/http/schema_helpers.d.ts +3 -14
  186. package/dist/http/schema_helpers.d.ts.map +1 -1
  187. package/dist/http/schema_helpers.js +2 -14
  188. package/dist/http/surface.d.ts +2 -10
  189. package/dist/http/surface.d.ts.map +1 -1
  190. package/dist/http/surface.js +3 -4
  191. package/dist/http/surface_query.d.ts +39 -35
  192. package/dist/http/surface_query.d.ts.map +1 -1
  193. package/dist/http/surface_query.js +79 -36
  194. package/dist/primitive_schemas.d.ts +39 -0
  195. package/dist/primitive_schemas.d.ts.map +1 -0
  196. package/dist/primitive_schemas.js +40 -0
  197. package/dist/realtime/sse_auth_guard.d.ts +5 -5
  198. package/dist/realtime/sse_auth_guard.js +9 -9
  199. package/dist/runtime/mock.d.ts +1 -1
  200. package/dist/runtime/mock.js +1 -1
  201. package/dist/server/app_backend.d.ts +14 -11
  202. package/dist/server/app_backend.d.ts.map +1 -1
  203. package/dist/server/app_backend.js +12 -8
  204. package/dist/server/app_server.d.ts +7 -7
  205. package/dist/server/app_server.d.ts.map +1 -1
  206. package/dist/server/app_server.js +35 -40
  207. package/dist/server/validate_nginx.d.ts +1 -1
  208. package/dist/server/validate_nginx.js +1 -1
  209. package/dist/testing/CLAUDE.md +50 -38
  210. package/dist/testing/admin_integration.d.ts +5 -6
  211. package/dist/testing/admin_integration.d.ts.map +1 -1
  212. package/dist/testing/admin_integration.js +87 -85
  213. package/dist/testing/app_server.d.ts +11 -14
  214. package/dist/testing/app_server.d.ts.map +1 -1
  215. package/dist/testing/app_server.js +16 -15
  216. package/dist/testing/assertions.d.ts.map +1 -1
  217. package/dist/testing/assertions.js +2 -1
  218. package/dist/testing/attack_surface.d.ts.map +1 -1
  219. package/dist/testing/attack_surface.js +15 -9
  220. package/dist/testing/audit_completeness.d.ts +2 -2
  221. package/dist/testing/audit_completeness.d.ts.map +1 -1
  222. package/dist/testing/audit_completeness.js +36 -36
  223. package/dist/testing/auth_apps.d.ts +5 -4
  224. package/dist/testing/auth_apps.d.ts.map +1 -1
  225. package/dist/testing/auth_apps.js +22 -19
  226. package/dist/testing/data_exposure.d.ts.map +1 -1
  227. package/dist/testing/data_exposure.js +5 -5
  228. package/dist/testing/db.d.ts +1 -1
  229. package/dist/testing/db.d.ts.map +1 -1
  230. package/dist/testing/db.js +4 -4
  231. package/dist/testing/db_entities.d.ts +22 -0
  232. package/dist/testing/db_entities.d.ts.map +1 -0
  233. package/dist/testing/db_entities.js +28 -0
  234. package/dist/testing/entities.d.ts +8 -7
  235. package/dist/testing/entities.d.ts.map +1 -1
  236. package/dist/testing/entities.js +21 -18
  237. package/dist/testing/integration.d.ts.map +1 -1
  238. package/dist/testing/integration.js +13 -14
  239. package/dist/testing/integration_helpers.d.ts +4 -4
  240. package/dist/testing/integration_helpers.d.ts.map +1 -1
  241. package/dist/testing/integration_helpers.js +20 -18
  242. package/dist/testing/middleware.d.ts +4 -4
  243. package/dist/testing/middleware.d.ts.map +1 -1
  244. package/dist/testing/middleware.js +12 -11
  245. package/dist/testing/rpc_attack_surface.d.ts.map +1 -1
  246. package/dist/testing/rpc_attack_surface.js +40 -24
  247. package/dist/testing/rpc_round_trip.d.ts +1 -1
  248. package/dist/testing/rpc_round_trip.d.ts.map +1 -1
  249. package/dist/testing/rpc_round_trip.js +14 -13
  250. package/dist/testing/sse_round_trip.d.ts +3 -4
  251. package/dist/testing/sse_round_trip.d.ts.map +1 -1
  252. package/dist/testing/sse_round_trip.js +7 -11
  253. package/dist/testing/standard.d.ts +1 -1
  254. package/dist/testing/stubs.d.ts +25 -0
  255. package/dist/testing/stubs.d.ts.map +1 -1
  256. package/dist/testing/stubs.js +43 -2
  257. package/dist/testing/surface_invariants.d.ts +14 -6
  258. package/dist/testing/surface_invariants.d.ts.map +1 -1
  259. package/dist/testing/surface_invariants.js +119 -43
  260. package/dist/testing/ws_round_trip.d.ts +12 -13
  261. package/dist/testing/ws_round_trip.d.ts.map +1 -1
  262. package/dist/testing/ws_round_trip.js +19 -11
  263. package/dist/ui/AdminAccounts.svelte +23 -20
  264. package/dist/ui/AdminOverview.svelte +15 -13
  265. package/dist/ui/AdminOverview.svelte.d.ts.map +1 -1
  266. package/dist/ui/{AdminPermitHistory.svelte → AdminRoleGrantHistory.svelte} +12 -12
  267. package/dist/ui/AdminRoleGrantHistory.svelte.d.ts +4 -0
  268. package/dist/ui/AdminRoleGrantHistory.svelte.d.ts.map +1 -0
  269. package/dist/ui/BootstrapForm.svelte +1 -1
  270. package/dist/ui/CLAUDE.md +60 -60
  271. package/dist/ui/{PermitOfferForm.svelte → RoleGrantOfferForm.svelte} +27 -26
  272. package/dist/ui/{PermitOfferForm.svelte.d.ts → RoleGrantOfferForm.svelte.d.ts} +7 -7
  273. package/dist/ui/RoleGrantOfferForm.svelte.d.ts.map +1 -0
  274. package/dist/ui/{PermitOfferHistory.svelte → RoleGrantOfferHistory.svelte} +12 -12
  275. package/dist/ui/{PermitOfferHistory.svelte.d.ts → RoleGrantOfferHistory.svelte.d.ts} +4 -4
  276. package/dist/ui/RoleGrantOfferHistory.svelte.d.ts.map +1 -0
  277. package/dist/ui/{PermitOfferInbox.svelte → RoleGrantOfferInbox.svelte} +14 -14
  278. package/dist/ui/{PermitOfferInbox.svelte.d.ts → RoleGrantOfferInbox.svelte.d.ts} +4 -4
  279. package/dist/ui/RoleGrantOfferInbox.svelte.d.ts.map +1 -0
  280. package/dist/ui/SignupForm.svelte +1 -1
  281. package/dist/ui/SurfaceExplorer.svelte +35 -15
  282. package/dist/ui/SurfaceExplorer.svelte.d.ts.map +1 -1
  283. package/dist/ui/account_sessions_state.svelte.d.ts +2 -3
  284. package/dist/ui/account_sessions_state.svelte.d.ts.map +1 -1
  285. package/dist/ui/account_sessions_state.svelte.js +2 -3
  286. package/dist/ui/admin_accounts_state.svelte.d.ts +18 -18
  287. package/dist/ui/admin_accounts_state.svelte.d.ts.map +1 -1
  288. package/dist/ui/admin_accounts_state.svelte.js +16 -16
  289. package/dist/ui/admin_rpc_adapters.d.ts +20 -20
  290. package/dist/ui/admin_rpc_adapters.d.ts.map +1 -1
  291. package/dist/ui/admin_rpc_adapters.js +17 -17
  292. package/dist/ui/admin_sessions_state.svelte.d.ts +2 -2
  293. package/dist/ui/admin_sessions_state.svelte.js +2 -2
  294. package/dist/ui/audit_log_state.svelte.d.ts +7 -7
  295. package/dist/ui/audit_log_state.svelte.d.ts.map +1 -1
  296. package/dist/ui/audit_log_state.svelte.js +6 -6
  297. package/dist/ui/auth_state.svelte.d.ts +3 -3
  298. package/dist/ui/auth_state.svelte.d.ts.map +1 -1
  299. package/dist/ui/auth_state.svelte.js +6 -6
  300. package/dist/ui/format_scope.d.ts +2 -2
  301. package/dist/ui/format_scope.js +2 -2
  302. package/dist/ui/{permit_offers_state.svelte.d.ts → role_grant_offers_state.svelte.d.ts} +30 -30
  303. package/dist/ui/role_grant_offers_state.svelte.d.ts.map +1 -0
  304. package/dist/ui/{permit_offers_state.svelte.js → role_grant_offers_state.svelte.js} +18 -18
  305. package/dist/ui/ui_format.js +2 -2
  306. package/package.json +3 -3
  307. package/dist/auth/permit_offer_action_specs.d.ts.map +0 -1
  308. package/dist/auth/permit_offer_action_specs.js +0 -258
  309. package/dist/auth/permit_offer_actions.d.ts +0 -110
  310. package/dist/auth/permit_offer_actions.d.ts.map +0 -1
  311. package/dist/auth/permit_offer_notifications.d.ts.map +0 -1
  312. package/dist/auth/permit_offer_notifications.js +0 -182
  313. package/dist/auth/permit_offer_queries.d.ts.map +0 -1
  314. package/dist/auth/permit_offer_schema.d.ts +0 -125
  315. package/dist/auth/permit_offer_schema.d.ts.map +0 -1
  316. package/dist/auth/permit_queries.d.ts +0 -222
  317. package/dist/auth/permit_queries.d.ts.map +0 -1
  318. package/dist/auth/permit_queries.js +0 -305
  319. package/dist/auth/require_keeper.d.ts +0 -20
  320. package/dist/auth/require_keeper.d.ts.map +0 -1
  321. package/dist/auth/require_keeper.js +0 -35
  322. package/dist/auth/route_guards.d.ts +0 -27
  323. package/dist/auth/route_guards.d.ts.map +0 -1
  324. package/dist/auth/route_guards.js +0 -38
  325. package/dist/auth/session_lifecycle.d.ts +0 -37
  326. package/dist/auth/session_lifecycle.d.ts.map +0 -1
  327. package/dist/auth/session_lifecycle.js +0 -29
  328. package/dist/ui/AdminPermitHistory.svelte.d.ts +0 -4
  329. package/dist/ui/AdminPermitHistory.svelte.d.ts.map +0 -1
  330. package/dist/ui/PermitOfferForm.svelte.d.ts.map +0 -1
  331. package/dist/ui/PermitOfferHistory.svelte.d.ts.map +0 -1
  332. package/dist/ui/PermitOfferInbox.svelte.d.ts.map +0 -1
  333. package/dist/ui/permit_offers_state.svelte.d.ts.map +0 -1
@@ -1,4 +1,4 @@
1
- import { type PermitOfferJson } from '../auth/permit_offer_schema.js';
1
+ import { type RoleGrantOfferJson } from '../auth/role_grant_offer_schema.js';
2
2
  type $$ComponentProps = {
3
3
  to_account_id: string;
4
4
  /**
@@ -7,14 +7,14 @@ type $$ComponentProps = {
7
7
  * actor on the recipient account may accept.
8
8
  */
9
9
  to_actor_id?: string | null;
10
- /** Roles the caller may offer — caller filters by `web_grantable` upstream. */
10
+ /** Roles the caller may offer — caller filters upstream (default: admin-grant-path). */
11
11
  roles: Array<string>;
12
12
  /** Resource scope for the offer; `null` (default) yields a global offer. */
13
13
  scope_id?: string | null;
14
- on_created?: (offer: PermitOfferJson) => void;
14
+ on_created?: (offer: RoleGrantOfferJson) => void;
15
15
  format_role?: (role: string) => string;
16
16
  };
17
- declare const PermitOfferForm: import("svelte").Component<$$ComponentProps, {}, "">;
18
- type PermitOfferForm = ReturnType<typeof PermitOfferForm>;
19
- export default PermitOfferForm;
20
- //# sourceMappingURL=PermitOfferForm.svelte.d.ts.map
17
+ declare const RoleGrantOfferForm: import("svelte").Component<$$ComponentProps, {}, "">;
18
+ type RoleGrantOfferForm = ReturnType<typeof RoleGrantOfferForm>;
19
+ export default RoleGrantOfferForm;
20
+ //# sourceMappingURL=RoleGrantOfferForm.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RoleGrantOfferForm.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/RoleGrantOfferForm.svelte"],"names":[],"mappings":"AAkBA,OAAO,EAEL,KAAK,kBAAkB,EACvB,MAAM,oCAAoC,CAAC;AAS5C,KAAK,gBAAgB,GAAI;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,wFAAwF;IACxF,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACrB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACjD,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CACvC,CAAC;AA4GH,QAAA,MAAM,kBAAkB,sDAAwC,CAAC;AACjE,KAAK,kBAAkB,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAChE,eAAe,kBAAkB,CAAC"}
@@ -1,21 +1,21 @@
1
1
  <script lang="ts">
2
2
  /**
3
- * Both-directions permit offer history table.
3
+ * Both-directions role_grant offer history table.
4
4
  *
5
5
  * Shows every offer involving the current account — recipient or grantor
6
6
  * — including terminal rows (accepted, declined, retracted, superseded,
7
- * expired). Backed by `permit_offer_history` (new RPC action); seeded
8
- * via `PermitOffersState.fetch_history()`.
7
+ * expired). Backed by `role_grant_offer_history` (new RPC action); seeded
8
+ * via `RoleGrantOffersState.fetch_history()`.
9
9
  *
10
10
  * Consumers plug in optional `format_actor` / `format_scope` callbacks
11
11
  * for display names.
12
12
  */
13
13
 
14
- import {permit_offers_state_context} from './permit_offers_state.svelte.js';
14
+ import {role_grant_offers_state_context} from './role_grant_offers_state.svelte.js';
15
15
  import Datatable from './Datatable.svelte';
16
16
  import type {DatatableColumn} from './datatable.js';
17
17
  import {format_relative_time, format_datetime_local, truncate_uuid} from './ui_format.js';
18
- import type {PermitOfferJson} from '../auth/permit_offer_schema.js';
18
+ import type {RoleGrantOfferJson} from '../auth/role_grant_offer_schema.js';
19
19
  import {format_scope_context, resolve_scope_label, type FormatScope} from './format_scope.js';
20
20
 
21
21
  const {
@@ -36,13 +36,13 @@
36
36
  format_role?: (role: string) => string;
37
37
  } = $props();
38
38
 
39
- const permit_offers = permit_offers_state_context.get();
39
+ const role_grant_offers = role_grant_offers_state_context.get();
40
40
  const get_format_scope = format_scope_context.get();
41
41
  const format_scope_from_context = $derived(get_format_scope());
42
42
 
43
43
  const now = $state.raw(Date.now());
44
44
 
45
- const status_of = (offer: PermitOfferJson): string => {
45
+ const status_of = (offer: RoleGrantOfferJson): string => {
46
46
  if (offer.accepted_at) return 'accepted';
47
47
  if (offer.declined_at) return 'declined';
48
48
  if (offer.retracted_at) return 'retracted';
@@ -70,7 +70,7 @@
70
70
  const scope_label = (scope_id: string | null, role: string): string =>
71
71
  resolve_scope_label(scope_id, role, format_scope ?? format_scope_from_context, 'global');
72
72
 
73
- const columns: Array<DatatableColumn<PermitOfferJson>> = [
73
+ const columns: Array<DatatableColumn<RoleGrantOfferJson>> = [
74
74
  {key: 'from_actor_id', label: 'direction', width: 110},
75
75
  {key: 'role', label: 'role', width: 140},
76
76
  {key: 'scope_id', label: 'scope', width: 160},
@@ -82,12 +82,12 @@
82
82
  <section>
83
83
  <h2>offer history</h2>
84
84
 
85
- {#if permit_offers.loading}
85
+ {#if role_grant_offers.loading}
86
86
  <p class="text_50">loading history...</p>
87
- {:else if permit_offers.error}
88
- <p class="color_c_50">{permit_offers.error}</p>
87
+ {:else if role_grant_offers.error}
88
+ <p class="color_c_50">{role_grant_offers.error}</p>
89
89
  {:else}
90
- <Datatable {columns} rows={permit_offers.history} height="400px" row_key="id">
90
+ <Datatable {columns} rows={role_grant_offers.history} height="400px" row_key="id">
91
91
  {#snippet cell(column, row)}
92
92
  {#if column.key === 'from_actor_id'}
93
93
  {#if current_actor_id && row.from_actor_id === current_actor_id}
@@ -11,7 +11,7 @@ type $$ComponentProps = {
11
11
  format_scope?: FormatScope;
12
12
  format_role?: (role: string) => string;
13
13
  };
14
- declare const PermitOfferHistory: import("svelte").Component<$$ComponentProps, {}, "">;
15
- type PermitOfferHistory = ReturnType<typeof PermitOfferHistory>;
16
- export default PermitOfferHistory;
17
- //# sourceMappingURL=PermitOfferHistory.svelte.d.ts.map
14
+ declare const RoleGrantOfferHistory: import("svelte").Component<$$ComponentProps, {}, "">;
15
+ type RoleGrantOfferHistory = ReturnType<typeof RoleGrantOfferHistory>;
16
+ export default RoleGrantOfferHistory;
17
+ //# sourceMappingURL=RoleGrantOfferHistory.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RoleGrantOfferHistory.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/RoleGrantOfferHistory.svelte"],"names":[],"mappings":"AAmBA,OAAO,EAA4C,KAAK,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAE7F,KAAK,gBAAgB,GAAI;IACxB,oFAAoF;IACpF,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,YAAY,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,MAAM,CAAC;IACjD;;;;OAIG;IACH,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CACvC,CAAC;AAkGH,QAAA,MAAM,qBAAqB,sDAAwC,CAAC;AACpE,KAAK,qBAAqB,GAAG,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACtE,eAAe,qBAAqB,CAAC"}
@@ -2,7 +2,7 @@
2
2
  /**
3
3
  * Recipient-side pending offer inbox.
4
4
  *
5
- * Renders `PermitOffersState.incoming` (pending, soonest-expiry first)
5
+ * Renders `RoleGrantOffersState.incoming` (pending, soonest-expiry first)
6
6
  * with accept + decline-with-reason controls. Grantor and scope rendering
7
7
  * are delegated via optional callback props — consumers plug in display
8
8
  * names once they know what a `from_actor_id` / `scope_id` represents
@@ -12,10 +12,10 @@
12
12
  import PendingButton from '@fuzdev/fuz_ui/PendingButton.svelte';
13
13
  import {SvelteMap} from 'svelte/reactivity';
14
14
 
15
- import {permit_offers_state_context} from './permit_offers_state.svelte.js';
15
+ import {role_grant_offers_state_context} from './role_grant_offers_state.svelte.js';
16
16
  import ConfirmButton from './ConfirmButton.svelte';
17
17
  import {format_relative_time, format_datetime_local, truncate_uuid} from './ui_format.js';
18
- import {PERMIT_OFFER_MESSAGE_LENGTH_MAX} from '../auth/permit_offer_schema.js';
18
+ import {ROLE_GRANT_OFFER_MESSAGE_LENGTH_MAX} from '../auth/role_grant_offer_schema.js';
19
19
  import {format_scope_context, resolve_scope_label, type FormatScope} from './format_scope.js';
20
20
 
21
21
  const {
@@ -35,7 +35,7 @@
35
35
  format_role?: (role: string) => string;
36
36
  } = $props();
37
37
 
38
- const permit_offers = permit_offers_state_context.get();
38
+ const role_grant_offers = role_grant_offers_state_context.get();
39
39
  const get_format_scope = format_scope_context.get();
40
40
  const format_scope_from_context = $derived(get_format_scope());
41
41
 
@@ -45,18 +45,18 @@
45
45
  const decline_reasons: SvelteMap<string, string> = new SvelteMap();
46
46
  </script>
47
47
 
48
- <section class="permit-offer-inbox">
48
+ <section class="role-grant-offer-inbox">
49
49
  <h2>pending offers</h2>
50
50
 
51
- {#if permit_offers.error}
52
- <p class="color_c_50">{permit_offers.error}</p>
51
+ {#if role_grant_offers.error}
52
+ <p class="color_c_50">{role_grant_offers.error}</p>
53
53
  {/if}
54
54
 
55
- {#if permit_offers.incoming.length === 0}
55
+ {#if role_grant_offers.incoming.length === 0}
56
56
  <p class="text_50">No pending offers.</p>
57
57
  {:else}
58
58
  <ul class="column gap_md">
59
- {#each permit_offers.incoming as offer (offer.id)}
59
+ {#each role_grant_offers.incoming as offer (offer.id)}
60
60
  <li class="box p_md column gap_sm">
61
61
  <div class="row gap_sm align_center">
62
62
  <span class="chip color_a">{format_role(offer.role)}</span>
@@ -76,9 +76,9 @@
76
76
 
77
77
  <div class="row gap_sm">
78
78
  <PendingButton
79
- pending={permit_offers.loading}
80
- disabled={permit_offers.loading}
81
- onclick={() => permit_offers.accept(offer.id)}
79
+ pending={role_grant_offers.loading}
80
+ disabled={role_grant_offers.loading}
81
+ onclick={() => role_grant_offers.accept(offer.id)}
82
82
  class="color_b"
83
83
  >
84
84
  accept
@@ -89,7 +89,7 @@
89
89
  position="bottom"
90
90
  onconfirm={() => {
91
91
  const reason = decline_reasons.get(offer.id) ?? '';
92
- void permit_offers.decline(offer.id, reason || null);
92
+ void role_grant_offers.decline(offer.id, reason || null);
93
93
  decline_reasons.delete(offer.id);
94
94
  }}
95
95
  >
@@ -102,7 +102,7 @@
102
102
  <div class="title">reason (optional)</div>
103
103
  <textarea
104
104
  name="decline-reason"
105
- maxlength={PERMIT_OFFER_MESSAGE_LENGTH_MAX}
105
+ maxlength={ROLE_GRANT_OFFER_MESSAGE_LENGTH_MAX}
106
106
  placeholder="optional reason"
107
107
  value={decline_reasons.get(offer.id) ?? ''}
108
108
  oninput={(e) =>
@@ -11,7 +11,7 @@ type $$ComponentProps = {
11
11
  /** Display label for a role constant. Defaults to identity. */
12
12
  format_role?: (role: string) => string;
13
13
  };
14
- declare const PermitOfferInbox: import("svelte").Component<$$ComponentProps, {}, "">;
15
- type PermitOfferInbox = ReturnType<typeof PermitOfferInbox>;
16
- export default PermitOfferInbox;
17
- //# sourceMappingURL=PermitOfferInbox.svelte.d.ts.map
14
+ declare const RoleGrantOfferInbox: import("svelte").Component<$$ComponentProps, {}, "">;
15
+ type RoleGrantOfferInbox = ReturnType<typeof RoleGrantOfferInbox>;
16
+ export default RoleGrantOfferInbox;
17
+ //# sourceMappingURL=RoleGrantOfferInbox.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RoleGrantOfferInbox.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/RoleGrantOfferInbox.svelte"],"names":[],"mappings":"AAmBA,OAAO,EAA4C,KAAK,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAE7F,KAAK,gBAAgB,GAAI;IACxB,uEAAuE;IACvE,YAAY,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,MAAM,CAAC;IACjD;;;;OAIG;IACH,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,+DAA+D;IAC/D,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CACvC,CAAC;AA2FH,QAAA,MAAM,mBAAmB,sDAAwC,CAAC;AAClE,KAAK,mBAAmB,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAClE,eAAe,mBAAmB,CAAC"}
@@ -16,7 +16,7 @@
16
16
  import PendingButton from '@fuzdev/fuz_ui/PendingButton.svelte';
17
17
  import {autofocus} from '@fuzdev/fuz_ui/autofocus.svelte.js';
18
18
 
19
- import {Username} from '../auth/account_schema.js';
19
+ import {Username} from '../primitive_schemas.js';
20
20
  import {PASSWORD_LENGTH_MIN} from '../auth/password.js';
21
21
  import {auth_state_context} from './auth_state.svelte.js';
22
22
  import {FormState} from './form_state.svelte.js';
@@ -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,WAAW,kBAAkB;IAClC,IAAI,EAAE,MAAM,OAAO,CAAC;QAA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M,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,10 +78,10 @@ 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
@@ -97,21 +97,21 @@ export declare class AdminAccountsState extends Loadable {
97
97
  * No-op when the rpc adapter is absent; `error` is set to a descriptive
98
98
  * message so the UI surfaces the misconfiguration.
99
99
  */
100
- grant_permit(account_id: Uuid, role: RoleName, to_actor_id?: Uuid | null): Promise<PermitOfferJson | undefined>;
100
+ create_role_grant(account_id: Uuid, role: RoleName, to_actor_id?: Uuid | null): Promise<RoleGrantOfferJson | undefined>;
101
101
  /**
102
- * Revoke an active permit via the `permit_revoke` RPC.
102
+ * Revoke an active role_grant via the `role_grant_revoke` RPC.
103
103
  *
104
- * `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
105
105
  * admin UI reads `row.actor.id` straight from the listing, so the state
106
106
  * class takes it directly rather than deriving it from `account_id`.
107
- * The optional `reason` is stamped on `permit.revoked_reason` and
107
+ * The optional `reason` is stamped on `role_grant.revoked_reason` and
108
108
  * surfaced on the revokee's WS notification.
109
109
  */
110
- 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>;
111
111
  /**
112
- * 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`
113
113
  * RPC. The action handles auth, audit, and the
114
- * `permit_offer_retracted` WS notification.
114
+ * `role_grant_offer_retracted` WS notification.
115
115
  *
116
116
  * After success, refetches the listing so `pending_offers` drops the
117
117
  * row and the "+ {role}" button un-hides.
@@ -1 +1 @@
1
- {"version":3,"file":"admin_accounts_state.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/admin_accounts_state.svelte.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,SAAS,EAAC,MAAM,mBAAmB,CAAC;AAE5C,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAC,QAAQ,EAAC,MA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B;IACzC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,gBAAgB,GAAG,IAAI,CAAC;CACxC;AAED,qBAAa,kBAAmB,SAAQ,QAAQ;;IAG/C,QAAQ,EAAE,KAAK,CAAC,qBAAqB,CAAC,CAAkB;IACxD,eAAe,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAkB;IAClD,QAAQ,CAAC,aAAa,EAAE,SAAS,CAAC,MAAM,CAAC,CAAmB;IAC5D,QAAQ,CAAC,YAAY,EAAE,SAAS,CAAC,MAAM,CAAC,CAAmB;IAC3D,QAAQ,CAAC,cAAc,EAAE,SAAS,CAAC,MAAM,CAAC,CAAmB;IAE7D,QAAQ,CAAC,aAAa,SAAkC;gBAE5C,OAAO,CAAC,EAAE,yBAAyB;IAK/C;;;OAGG;IACH,IAAI,OAAO,IAAI,OAAO,CAErB;IAEK,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAa5B;;;;;;;;;;;;;;;;;;;OAmBG;IACG,iBAAiB,CACtB,UAAU,EAAE,IAAI,EAChB,IAAI,EAAE,QAAQ,EACd,WAAW,CAAC,EAAE,IAAI,GAAG,IAAI,GACvB,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC;IAyB1C;;;;;;;;OAQG;IACG,iBAAiB,CACtB,QAAQ,EAAE,IAAI,EACd,aAAa,EAAE,IAAI,EACnB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GACpB,OAAO,CAAC,IAAI,CAAC;IAkBhB;;;;;;;OAOG;IACG,aAAa,CAAC,QAAQ,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;CAiBlD"}
@@ -49,10 +49,10 @@ export class AdminAccountsState extends Loadable {
49
49
  });
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
@@ -68,7 +68,7 @@ export class AdminAccountsState extends Loadable {
68
68
  * No-op when the rpc adapter is absent; `error` is set to a descriptive
69
69
  * message so the UI surfaces the misconfiguration.
70
70
  */
71
- async grant_permit(account_id, role, to_actor_id) {
71
+ async create_role_grant(account_id, role, to_actor_id) {
72
72
  const rpc = this.#get_rpc();
73
73
  if (!rpc) {
74
74
  this.error = 'rpc adapter not wired';
@@ -77,7 +77,7 @@ export class AdminAccountsState extends Loadable {
77
77
  const key = to_actor_id ? `${account_id}:${role}:${to_actor_id}` : `${account_id}:${role}`;
78
78
  this.granting_keys.add(key);
79
79
  try {
80
- const { offer } = await rpc.grant_permit({
80
+ const { offer } = await rpc.create_role_grant({
81
81
  to_account_id: account_id,
82
82
  role,
83
83
  ...(to_actor_id ? { to_actor_id } : {}),
@@ -87,7 +87,7 @@ export class AdminAccountsState extends Loadable {
87
87
  return offer;
88
88
  }
89
89
  catch (e) {
90
- this.error = e instanceof Error ? e.message : 'Failed to grant permit';
90
+ this.error = e instanceof Error ? e.message : 'Failed to grant role_grant';
91
91
  return undefined;
92
92
  }
93
93
  finally {
@@ -95,37 +95,37 @@ export class AdminAccountsState extends Loadable {
95
95
  }
96
96
  }
97
97
  /**
98
- * Revoke an active permit via the `permit_revoke` RPC.
98
+ * Revoke an active role_grant via the `role_grant_revoke` RPC.
99
99
  *
100
- * `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
101
101
  * admin UI reads `row.actor.id` straight from the listing, so the state
102
102
  * class takes it directly rather than deriving it from `account_id`.
103
- * The optional `reason` is stamped on `permit.revoked_reason` and
103
+ * The optional `reason` is stamped on `role_grant.revoked_reason` and
104
104
  * surfaced on the revokee's WS notification.
105
105
  */
106
- async revoke_permit(actor_id, permit_id, reason) {
106
+ async revoke_role_grant(actor_id, role_grant_id, reason) {
107
107
  const rpc = this.#get_rpc();
108
108
  if (!rpc) {
109
109
  this.error = 'rpc adapter not wired';
110
110
  return;
111
111
  }
112
- this.revoking_ids.add(permit_id);
112
+ this.revoking_ids.add(role_grant_id);
113
113
  try {
114
- 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 });
115
115
  this.error = null;
116
116
  await this.fetch();
117
117
  }
118
118
  catch (e) {
119
- this.error = e instanceof Error ? e.message : 'Failed to revoke permit';
119
+ this.error = e instanceof Error ? e.message : 'Failed to revoke role_grant';
120
120
  }
121
121
  finally {
122
- this.revoking_ids.delete(permit_id);
122
+ this.revoking_ids.delete(role_grant_id);
123
123
  }
124
124
  }
125
125
  /**
126
- * 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`
127
127
  * RPC. The action handles auth, audit, and the
128
- * `permit_offer_retracted` WS notification.
128
+ * `role_grant_offer_retracted` WS notification.
129
129
  *
130
130
  * After success, refetches the listing so `pending_offers` drops the
131
131
  * row and the "+ {role}" button un-hides.