@fuzdev/fuz_app 0.52.0 → 0.54.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 (254) hide show
  1. package/dist/actions/CLAUDE.md +29 -9
  2. package/dist/actions/action_codegen.d.ts +10 -35
  3. package/dist/actions/action_codegen.d.ts.map +1 -1
  4. package/dist/actions/action_codegen.js +13 -42
  5. package/dist/actions/action_peer.d.ts.map +1 -1
  6. package/dist/actions/action_peer.js +0 -9
  7. package/dist/actions/action_registry.d.ts +0 -4
  8. package/dist/actions/action_registry.d.ts.map +1 -1
  9. package/dist/actions/action_registry.js +4 -10
  10. package/dist/actions/action_rpc.d.ts +16 -0
  11. package/dist/actions/action_rpc.d.ts.map +1 -1
  12. package/dist/actions/action_rpc.js +41 -20
  13. package/dist/actions/action_spec.d.ts +54 -5
  14. package/dist/actions/action_spec.d.ts.map +1 -1
  15. package/dist/actions/action_spec.js +21 -5
  16. package/dist/actions/frontend_rpc_client.d.ts +1 -9
  17. package/dist/actions/frontend_rpc_client.d.ts.map +1 -1
  18. package/dist/actions/frontend_rpc_client.js +1 -9
  19. package/dist/actions/register_action_ws.d.ts +16 -0
  20. package/dist/actions/register_action_ws.d.ts.map +1 -1
  21. package/dist/actions/register_action_ws.js +41 -1
  22. package/dist/actions/request_tracker.svelte.d.ts +10 -15
  23. package/dist/actions/request_tracker.svelte.d.ts.map +1 -1
  24. package/dist/actions/request_tracker.svelte.js +10 -15
  25. package/dist/actions/rpc_client.d.ts +0 -1
  26. package/dist/actions/rpc_client.d.ts.map +1 -1
  27. package/dist/actions/rpc_client.js +3 -17
  28. package/dist/actions/socket.svelte.d.ts +0 -1
  29. package/dist/actions/socket.svelte.d.ts.map +1 -1
  30. package/dist/actions/socket.svelte.js +0 -1
  31. package/dist/actions/transports.d.ts +4 -3
  32. package/dist/actions/transports.d.ts.map +1 -1
  33. package/dist/actions/transports.js +4 -13
  34. package/dist/actions/transports_ws_auth_guard.d.ts +0 -2
  35. package/dist/actions/transports_ws_auth_guard.d.ts.map +1 -1
  36. package/dist/actions/transports_ws_auth_guard.js +0 -2
  37. package/dist/actions/transports_ws_backend.d.ts.map +1 -1
  38. package/dist/actions/transports_ws_backend.js +0 -9
  39. package/dist/auth/CLAUDE.md +43 -19
  40. package/dist/auth/account_queries.d.ts +0 -3
  41. package/dist/auth/account_queries.d.ts.map +1 -1
  42. package/dist/auth/account_queries.js +0 -3
  43. package/dist/auth/admin_action_specs.d.ts +5 -0
  44. package/dist/auth/admin_action_specs.d.ts.map +1 -1
  45. package/dist/auth/admin_action_specs.js +5 -0
  46. package/dist/auth/api_token_queries.d.ts +0 -1
  47. package/dist/auth/api_token_queries.d.ts.map +1 -1
  48. package/dist/auth/api_token_queries.js +0 -1
  49. package/dist/auth/audit_log_queries.d.ts +0 -1
  50. package/dist/auth/audit_log_queries.d.ts.map +1 -1
  51. package/dist/auth/audit_log_queries.js +0 -1
  52. package/dist/auth/audit_log_routes.d.ts +2 -2
  53. package/dist/auth/audit_log_routes.js +2 -2
  54. package/dist/auth/invite_queries.d.ts +0 -1
  55. package/dist/auth/invite_queries.d.ts.map +1 -1
  56. package/dist/auth/invite_queries.js +0 -1
  57. package/dist/auth/permit_offer_action_specs.d.ts +1 -0
  58. package/dist/auth/permit_offer_action_specs.d.ts.map +1 -1
  59. package/dist/auth/permit_offer_action_specs.js +1 -0
  60. package/dist/auth/permit_offer_actions.d.ts.map +1 -1
  61. package/dist/auth/permit_offer_actions.js +9 -6
  62. package/dist/auth/permit_offer_queries.d.ts +0 -1
  63. package/dist/auth/permit_offer_queries.d.ts.map +1 -1
  64. package/dist/auth/permit_offer_queries.js +0 -1
  65. package/dist/auth/permit_queries.d.ts +0 -1
  66. package/dist/auth/permit_queries.d.ts.map +1 -1
  67. package/dist/auth/permit_queries.js +0 -1
  68. package/dist/auth/request_context.d.ts +47 -2
  69. package/dist/auth/request_context.d.ts.map +1 -1
  70. package/dist/auth/request_context.js +57 -2
  71. package/dist/auth/self_service_role_actions.d.ts.map +1 -1
  72. package/dist/auth/self_service_role_actions.js +14 -11
  73. package/dist/auth/session_lifecycle.d.ts +0 -1
  74. package/dist/auth/session_lifecycle.d.ts.map +1 -1
  75. package/dist/auth/session_lifecycle.js +0 -1
  76. package/dist/auth/session_middleware.d.ts +0 -4
  77. package/dist/auth/session_middleware.d.ts.map +1 -1
  78. package/dist/auth/session_middleware.js +0 -4
  79. package/dist/cli/config.d.ts +0 -3
  80. package/dist/cli/config.d.ts.map +1 -1
  81. package/dist/cli/config.js +0 -3
  82. package/dist/cli/daemon.d.ts +1 -1
  83. package/dist/cli/daemon.js +1 -1
  84. package/dist/db/create_db.d.ts +0 -1
  85. package/dist/db/create_db.d.ts.map +1 -1
  86. package/dist/db/create_db.js +0 -1
  87. package/dist/db/db.d.ts +0 -4
  88. package/dist/db/db.d.ts.map +1 -1
  89. package/dist/db/db.js +0 -4
  90. package/dist/db/db_pg.d.ts +2 -2
  91. package/dist/db/db_pg.js +2 -2
  92. package/dist/db/db_pglite.d.ts +1 -2
  93. package/dist/db/db_pglite.d.ts.map +1 -1
  94. package/dist/db/db_pglite.js +1 -2
  95. package/dist/db/migrate.d.ts +0 -1
  96. package/dist/db/migrate.d.ts.map +1 -1
  97. package/dist/db/migrate.js +0 -1
  98. package/dist/dev/setup.d.ts +0 -3
  99. package/dist/dev/setup.d.ts.map +1 -1
  100. package/dist/dev/setup.js +0 -3
  101. package/dist/env/load.d.ts +0 -2
  102. package/dist/env/load.d.ts.map +1 -1
  103. package/dist/env/load.js +0 -2
  104. package/dist/hono_context.d.ts +2 -5
  105. package/dist/hono_context.d.ts.map +1 -1
  106. package/dist/hono_context.js +2 -5
  107. package/dist/http/common_routes.d.ts +0 -8
  108. package/dist/http/common_routes.d.ts.map +1 -1
  109. package/dist/http/common_routes.js +0 -8
  110. package/dist/http/db_routes.d.ts +0 -3
  111. package/dist/http/db_routes.d.ts.map +1 -1
  112. package/dist/http/db_routes.js +0 -3
  113. package/dist/http/error_schemas.d.ts +12 -11
  114. package/dist/http/error_schemas.d.ts.map +1 -1
  115. package/dist/http/error_schemas.js +11 -7
  116. package/dist/http/jsonrpc_errors.d.ts +0 -6
  117. package/dist/http/jsonrpc_errors.d.ts.map +1 -1
  118. package/dist/http/jsonrpc_errors.js +0 -6
  119. package/dist/http/origin.d.ts +6 -13
  120. package/dist/http/origin.d.ts.map +1 -1
  121. package/dist/http/origin.js +7 -14
  122. package/dist/http/proxy.d.ts +1 -7
  123. package/dist/http/proxy.d.ts.map +1 -1
  124. package/dist/http/proxy.js +1 -7
  125. package/dist/http/route_spec.d.ts +13 -35
  126. package/dist/http/route_spec.d.ts.map +1 -1
  127. package/dist/http/route_spec.js +10 -22
  128. package/dist/http/schema_helpers.d.ts +0 -4
  129. package/dist/http/schema_helpers.d.ts.map +1 -1
  130. package/dist/http/schema_helpers.js +0 -4
  131. package/dist/http/surface.d.ts +2 -12
  132. package/dist/http/surface.d.ts.map +1 -1
  133. package/dist/http/surface.js +1 -12
  134. package/dist/rate_limiter.d.ts +16 -0
  135. package/dist/rate_limiter.d.ts.map +1 -1
  136. package/dist/rate_limiter.js +26 -0
  137. package/dist/realtime/sse.d.ts +0 -1
  138. package/dist/realtime/sse.d.ts.map +1 -1
  139. package/dist/realtime/sse.js +0 -1
  140. package/dist/realtime/subscriber_registry.d.ts +0 -3
  141. package/dist/realtime/subscriber_registry.d.ts.map +1 -1
  142. package/dist/realtime/subscriber_registry.js +0 -3
  143. package/dist/runtime/fs.d.ts +1 -4
  144. package/dist/runtime/fs.d.ts.map +1 -1
  145. package/dist/runtime/fs.js +1 -4
  146. package/dist/runtime/mock.d.ts +0 -3
  147. package/dist/runtime/mock.d.ts.map +1 -1
  148. package/dist/runtime/mock.js +0 -3
  149. package/dist/server/app_server.d.ts +27 -5
  150. package/dist/server/app_server.d.ts.map +1 -1
  151. package/dist/server/app_server.js +19 -7
  152. package/dist/server/startup.d.ts +0 -2
  153. package/dist/server/startup.d.ts.map +1 -1
  154. package/dist/server/startup.js +0 -2
  155. package/dist/server/static.d.ts +0 -1
  156. package/dist/server/static.d.ts.map +1 -1
  157. package/dist/server/static.js +0 -1
  158. package/dist/server/validate_nginx.d.ts +0 -3
  159. package/dist/server/validate_nginx.d.ts.map +1 -1
  160. package/dist/server/validate_nginx.js +0 -3
  161. package/dist/testing/CLAUDE.md +1 -1
  162. package/dist/testing/admin_integration.d.ts +0 -1
  163. package/dist/testing/admin_integration.d.ts.map +1 -1
  164. package/dist/testing/admin_integration.js +3 -6
  165. package/dist/testing/adversarial_404.d.ts +0 -2
  166. package/dist/testing/adversarial_404.d.ts.map +1 -1
  167. package/dist/testing/adversarial_404.js +0 -2
  168. package/dist/testing/adversarial_headers.d.ts +0 -1
  169. package/dist/testing/adversarial_headers.d.ts.map +1 -1
  170. package/dist/testing/adversarial_headers.js +0 -1
  171. package/dist/testing/adversarial_input.d.ts +0 -2
  172. package/dist/testing/adversarial_input.d.ts.map +1 -1
  173. package/dist/testing/adversarial_input.js +0 -2
  174. package/dist/testing/app_server.d.ts +22 -0
  175. package/dist/testing/app_server.d.ts.map +1 -1
  176. package/dist/testing/app_server.js +2 -4
  177. package/dist/testing/assertions.d.ts +0 -4
  178. package/dist/testing/assertions.d.ts.map +1 -1
  179. package/dist/testing/assertions.js +0 -4
  180. package/dist/testing/attack_surface.d.ts +0 -4
  181. package/dist/testing/attack_surface.d.ts.map +1 -1
  182. package/dist/testing/attack_surface.js +0 -4
  183. package/dist/testing/audit_completeness.d.ts +0 -1
  184. package/dist/testing/audit_completeness.d.ts.map +1 -1
  185. package/dist/testing/audit_completeness.js +0 -1
  186. package/dist/testing/auth_apps.d.ts +2 -10
  187. package/dist/testing/auth_apps.d.ts.map +1 -1
  188. package/dist/testing/auth_apps.js +2 -10
  189. package/dist/testing/data_exposure.d.ts +0 -11
  190. package/dist/testing/data_exposure.d.ts.map +1 -1
  191. package/dist/testing/data_exposure.js +0 -11
  192. package/dist/testing/db.d.ts +0 -6
  193. package/dist/testing/db.d.ts.map +1 -1
  194. package/dist/testing/db.js +0 -6
  195. package/dist/testing/error_coverage.d.ts +0 -14
  196. package/dist/testing/error_coverage.d.ts.map +1 -1
  197. package/dist/testing/error_coverage.js +0 -14
  198. package/dist/testing/integration.d.ts +0 -1
  199. package/dist/testing/integration.d.ts.map +1 -1
  200. package/dist/testing/integration.js +0 -1
  201. package/dist/testing/integration_helpers.d.ts +1 -36
  202. package/dist/testing/integration_helpers.d.ts.map +1 -1
  203. package/dist/testing/integration_helpers.js +1 -43
  204. package/dist/testing/middleware.d.ts +0 -10
  205. package/dist/testing/middleware.d.ts.map +1 -1
  206. package/dist/testing/middleware.js +0 -10
  207. package/dist/testing/mock_fs.d.ts +0 -2
  208. package/dist/testing/mock_fs.d.ts.map +1 -1
  209. package/dist/testing/mock_fs.js +0 -2
  210. package/dist/testing/rate_limiting.d.ts +0 -1
  211. package/dist/testing/rate_limiting.d.ts.map +1 -1
  212. package/dist/testing/rate_limiting.js +0 -1
  213. package/dist/testing/round_trip.d.ts +0 -2
  214. package/dist/testing/round_trip.d.ts.map +1 -1
  215. package/dist/testing/round_trip.js +0 -2
  216. package/dist/testing/rpc_attack_surface.d.ts +0 -2
  217. package/dist/testing/rpc_attack_surface.d.ts.map +1 -1
  218. package/dist/testing/rpc_attack_surface.js +0 -2
  219. package/dist/testing/rpc_helpers.d.ts +0 -6
  220. package/dist/testing/rpc_helpers.d.ts.map +1 -1
  221. package/dist/testing/rpc_helpers.js +0 -6
  222. package/dist/testing/rpc_round_trip.d.ts +0 -2
  223. package/dist/testing/rpc_round_trip.d.ts.map +1 -1
  224. package/dist/testing/rpc_round_trip.js +0 -2
  225. package/dist/testing/schema_generators.d.ts +0 -3
  226. package/dist/testing/schema_generators.d.ts.map +1 -1
  227. package/dist/testing/schema_generators.js +29 -3
  228. package/dist/testing/sse_round_trip.d.ts +0 -1
  229. package/dist/testing/sse_round_trip.d.ts.map +1 -1
  230. package/dist/testing/sse_round_trip.js +0 -1
  231. package/dist/testing/standard.d.ts +0 -2
  232. package/dist/testing/standard.d.ts.map +1 -1
  233. package/dist/testing/standard.js +0 -2
  234. package/dist/testing/stubs.d.ts +3 -5
  235. package/dist/testing/stubs.d.ts.map +1 -1
  236. package/dist/testing/stubs.js +5 -5
  237. package/dist/testing/surface_invariants.d.ts +0 -3
  238. package/dist/testing/surface_invariants.d.ts.map +1 -1
  239. package/dist/testing/surface_invariants.js +0 -3
  240. package/dist/ui/CLAUDE.md +1 -1
  241. package/dist/ui/audit_log_state.svelte.js +1 -1
  242. package/dist/ui/position_helpers.d.ts +0 -3
  243. package/dist/ui/position_helpers.d.ts.map +1 -1
  244. package/dist/ui/position_helpers.js +0 -3
  245. package/dist/ui/sidebar_state.svelte.d.ts +1 -2
  246. package/dist/ui/sidebar_state.svelte.d.ts.map +1 -1
  247. package/dist/ui/sidebar_state.svelte.js +1 -2
  248. package/dist/ui/ui_fetch.d.ts +1 -7
  249. package/dist/ui/ui_fetch.d.ts.map +1 -1
  250. package/dist/ui/ui_fetch.js +1 -7
  251. package/dist/ui/ui_format.d.ts +2 -14
  252. package/dist/ui/ui_format.d.ts.map +1 -1
  253. package/dist/ui/ui_format.js +2 -14
  254. package/package.json +2 -2
@@ -80,7 +80,6 @@ export class PermitOfferSelfTargetError extends Error {
80
80
  *
81
81
  * @mutates `permit_offer` table - inserts a new offer or upserts the matching pending row
82
82
  * @throws PermitOfferSelfTargetError if the offering actor belongs to `to_account_id`
83
- * @throws Error if the INSERT/UPSERT does not return a row (failed `assert_row` invariant)
84
83
  */
85
84
  export const query_permit_offer_create = async (deps, input) => {
86
85
  const actor = await query_actor_by_account(deps, input.to_account_id);
@@ -25,7 +25,6 @@ import { type SupersededOffer } from './permit_offer_schema.js';
25
25
  * @param input - the permit fields
26
26
  * @returns the created or existing active permit
27
27
  * @mutates `permit` table - inserts a row when no active permit matches `(actor_id, role, scope_id)`
28
- * @throws Error if the idempotent fallback `SELECT` does not return a row (failed `assert_row` invariant)
29
28
  */
30
29
  export declare const query_grant_permit: (deps: QueryDeps, input: GrantPermitInput) => Promise<Permit>;
31
30
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"permit_queries.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/permit_queries.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,wBAAwB,CAAC;AAEjD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAC,MAAM,EAAE,gBAAgB,EAAC,MAAM,qBAAqB,CAAC;AAElE,OAAO,EAAmC,KAAK,eAAe,EAAC,MAAM,0BAA0B,CAAC;AAEhG;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,kBAAkB,GAC9B,MAAM,SAAS,EACf,OAAO,gBAAgB,KACrB,OAAO,CAAC,MAAM,CA4BhB,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,uCAAuC,GACnD,MAAM,SAAS,EACf,WAAW,MAAM,EACjB,UAAU,MAAM,KACd,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,GAAG,IAAI,CAO/B,CAAC;AAEF,6GAA6G;AAC7G,MAAM,WAAW,kBAAkB;IAClC,EAAE,EAAE,IAAI,CAAC;IACT,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,IAAI,GAAG,IAAI,CAAC;IACtB;;;;;;;;OAQG;IACH,iBAAiB,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC;CAC1C;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,mBAAmB,GAC/B,MAAM,SAAS,EACf,WAAW,IAAI,EACf,UAAU,IAAI,EACd,YAAY,IAAI,GAAG,IAAI,EACvB,SAAS,MAAM,GAAG,IAAI,KACpB,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAsCnC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kCA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CA2C9B,CAAC;AAEF,yHAAyH;AACzH,MAAM,WAAW,gBAAgB;IAChC;;;;OAIG;IACH,OAAO,EAAE,KAAK,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAC,CAAC,CAAC;IAC/F;;;;;OAKG;IACH,iBAAiB,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC;CAC1C;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,wBAAwB,GACpC,MAAM,SAAS,EACf,UAAU,MAAM,EAChB,MAAM,MAAM,EACZ,YAAY,MAAM,GAAG,IAAI,EACzB,SAAS,MAAM,GAAG,IAAI,KACpB,OAAO,CAAC,gBAAgB,CA2C1B,CAAC"}
@@ -23,7 +23,6 @@ import { PERMIT_OFFER_SCOPE_SENTINEL_UUID } from './permit_offer_schema.js';
23
23
  * @param input - the permit fields
24
24
  * @returns the created or existing active permit
25
25
  * @mutates `permit` table - inserts a row when no active permit matches `(actor_id, role, scope_id)`
26
- * @throws Error if the idempotent fallback `SELECT` does not return a row (failed `assert_row` invariant)
27
26
  */
28
27
  export const query_grant_permit = async (deps, input) => {
29
28
  const inserted = await deps.db.query_one(`INSERT INTO permit (actor_id, role, scope_id, expires_at, granted_by, source_offer_id)
@@ -56,13 +56,58 @@ export declare const require_request_context: (c: Context) => RequestContext;
56
56
  * Check if a request context has an active permit for a given role.
57
57
  *
58
58
  * Checks the permits already loaded in the context (no DB query).
59
+ * Null-tolerant — `null` ctx (unauthenticated) returns `false`. Symmetric
60
+ * with `has_scoped_role` / `has_any_scoped_role` so the three helpers
61
+ * compose freely in the same predicate (e.g.
62
+ * `has_role(auth, ADMIN) || has_scoped_role(auth, role, scope)`).
59
63
  *
60
- * @param ctx - the request context
64
+ * @param ctx - the request context, or `null` for unauthenticated callers
61
65
  * @param role - the role to check
62
66
  * @param now - current time (defaults to `new Date()`, pass for testability and hot-path efficiency)
63
67
  * @returns `true` if the actor has an active permit for the role
64
68
  */
65
- export declare const has_role: (ctx: RequestContext, role: string, now?: Date) => boolean;
69
+ export declare const has_role: (ctx: RequestContext | null, role: string, now?: Date) => boolean;
70
+ /**
71
+ * Whether the request context holds an active permit for `role` at `scope_id`.
72
+ *
73
+ * Walks the in-memory `ctx.permits` snapshot loaded once per request by
74
+ * `create_request_context_middleware`; zero DB roundtrip per check. The
75
+ * "freshness" framing of a SQL re-query is illusory because the race window
76
+ * is between predicate and the actual mutation, not predicate and middleware
77
+ * load. Closing that race needs a transactional re-check inside the
78
+ * UPDATE/INSERT, which neither style provides.
79
+ *
80
+ * Null-tolerant — `null` ctx (unauthenticated) returns `false`. Same
81
+ * convention as `has_role`; lets the helper drop into `auth: 'public'`
82
+ * handlers without a manual narrow. See `cell_authorize` for the
83
+ * resource-side analog.
84
+ *
85
+ * `scope_id` semantics: in-memory `permit.scope_id` is `string | null`, so
86
+ * JS `===` matches the SQL `IS NOT DISTINCT FROM` semantics exactly:
87
+ *
88
+ * - `scope_id === null` matches global permits (`scope_id IS NULL`).
89
+ * - `scope_id === '<uuid>'` matches permits bound to that exact scope.
90
+ *
91
+ * @param ctx - the request context, or `null` for unauthenticated callers
92
+ * @param role - the role to check
93
+ * @param scope_id - the scope to check (`null` for global)
94
+ * @param now - current time (defaults to `new Date()`, pass for testability and hot-path efficiency)
95
+ * @returns `true` iff the actor holds an active permit for the role at the requested scope
96
+ */
97
+ export declare const has_scoped_role: (ctx: RequestContext | null, role: string, scope_id: string | null, now?: Date) => boolean;
98
+ /**
99
+ * Whether the request context holds an active permit for any role in `roles`
100
+ * at `scope_id`. Empty `roles` short-circuits to `false` — documents intent
101
+ * at the call site ("zero roles trivially admit no-one"). Same scope and
102
+ * null-tolerance semantics as `has_scoped_role`.
103
+ *
104
+ * @param ctx - the request context, or `null` for unauthenticated callers
105
+ * @param roles - the roles that would admit the caller (any-of)
106
+ * @param scope_id - the scope to check (`null` for global)
107
+ * @param now - current time (defaults to `new Date()`, pass for testability)
108
+ * @returns `true` iff the actor holds an active permit for any role in `roles` at the requested scope
109
+ */
110
+ export declare const has_any_scoped_role: (ctx: RequestContext | null, roles: ReadonlyArray<string>, scope_id: string | null, now?: Date) => boolean;
66
111
  /**
67
112
  * Create middleware that builds the request context from a session cookie.
68
113
  *
@@ -1 +1 @@
1
- {"version":3,"file":"request_context.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/request_context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAC,OAAO,EAAE,iBAAiB,EAAC,MAAM,MAAM,CAAC;AACrD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EAAC,KAAK,OAAO,EAAE,KAAK,KAAK,EAAoB,KAAK,MAAM,EAAC,MAAM,qBAAqB,CAAC;AAQ5F,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAOnD,kEAAkE;AAClE,MAAM,WAAW,cAAc;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACvB;AAED,0DAA0D;AAC1D,eAAO,MAAM,mBAAmB,oBAAoB,CAAC;AAErD;;;;;;;;GAQG;AACH,eAAO,MAAM,2BAA2B,4BAA4B,CAAC;AAErE;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAAI,GAAG,OAAO,KAAG,cAAc,GAAG,IAEjE,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,uBAAuB,GAAI,GAAG,OAAO,KAAG,cAMpD,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,QAAQ,GAAI,KAAK,cAAc,EAAE,MAAM,MAAM,EAAE,MAAK,IAAiB,KAAG,OAChB,CAAC;AAEtE;;;;;;;;;;;;;;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AAG,IAEjE,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,uBAAuB,GAAI,GAAG,OAAO,KAAG,cAMpD,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,QAAQ,GACpB,KAAK,cAAc,GAAG,IAAI,EAC1B,MAAM,MAAM,EACZ,MAAK,IAAiB,KACpB,OAAyF,CAAC;AAE7F;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,eAAe,GAC3B,KAAK,cAAc,GAAG,IAAI,EAC1B,MAAM,MAAM,EACZ,UAAU,MAAM,GAAG,IAAI,EACvB,MAAK,IAAiB,KACpB,OAKF,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,GAC/B,KAAK,cAAc,GAAG,IAAI,EAC1B,OAAO,aAAa,CAAC,MAAM,CAAC,EAC5B,UAAU,MAAM,GAAG,IAAI,EACvB,MAAK,IAAiB,KACpB,OAMF,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,iCAAiC,GAC7C,MAAM,SAAS,EACf,KAAK,MAAM,EACX,4BAAuC,KACrC,iBA6CF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,iBAM1B,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,KAAG,iBAW3C,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,eAAe,GAC3B,KAAK,cAAc,EACnB,MAAM,SAAS,KACb,OAAO,CAAC,cAAc,CAGxB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,qBAAqB,GACjC,MAAM,SAAS,EACf,YAAY,MAAM,KAChB,OAAO,CAAC,cAAc,GAAG,IAAI,CAS/B,CAAC"}
@@ -60,13 +60,68 @@ export const require_request_context = (c) => {
60
60
  * Check if a request context has an active permit for a given role.
61
61
  *
62
62
  * Checks the permits already loaded in the context (no DB query).
63
+ * Null-tolerant — `null` ctx (unauthenticated) returns `false`. Symmetric
64
+ * with `has_scoped_role` / `has_any_scoped_role` so the three helpers
65
+ * compose freely in the same predicate (e.g.
66
+ * `has_role(auth, ADMIN) || has_scoped_role(auth, role, scope)`).
63
67
  *
64
- * @param ctx - the request context
68
+ * @param ctx - the request context, or `null` for unauthenticated callers
65
69
  * @param role - the role to check
66
70
  * @param now - current time (defaults to `new Date()`, pass for testability and hot-path efficiency)
67
71
  * @returns `true` if the actor has an active permit for the role
68
72
  */
69
- export const has_role = (ctx, role, now = new Date()) => ctx.permits.some((p) => p.role === role && is_permit_active(p, now));
73
+ export const has_role = (ctx, role, now = new Date()) => ctx?.permits.some((p) => p.role === role && is_permit_active(p, now)) ?? false;
74
+ /**
75
+ * Whether the request context holds an active permit for `role` at `scope_id`.
76
+ *
77
+ * Walks the in-memory `ctx.permits` snapshot loaded once per request by
78
+ * `create_request_context_middleware`; zero DB roundtrip per check. The
79
+ * "freshness" framing of a SQL re-query is illusory because the race window
80
+ * is between predicate and the actual mutation, not predicate and middleware
81
+ * load. Closing that race needs a transactional re-check inside the
82
+ * UPDATE/INSERT, which neither style provides.
83
+ *
84
+ * Null-tolerant — `null` ctx (unauthenticated) returns `false`. Same
85
+ * convention as `has_role`; lets the helper drop into `auth: 'public'`
86
+ * handlers without a manual narrow. See `cell_authorize` for the
87
+ * resource-side analog.
88
+ *
89
+ * `scope_id` semantics: in-memory `permit.scope_id` is `string | null`, so
90
+ * JS `===` matches the SQL `IS NOT DISTINCT FROM` semantics exactly:
91
+ *
92
+ * - `scope_id === null` matches global permits (`scope_id IS NULL`).
93
+ * - `scope_id === '<uuid>'` matches permits bound to that exact scope.
94
+ *
95
+ * @param ctx - the request context, or `null` for unauthenticated callers
96
+ * @param role - the role to check
97
+ * @param scope_id - the scope to check (`null` for global)
98
+ * @param now - current time (defaults to `new Date()`, pass for testability and hot-path efficiency)
99
+ * @returns `true` iff the actor holds an active permit for the role at the requested scope
100
+ */
101
+ export const has_scoped_role = (ctx, role, scope_id, now = new Date()) => {
102
+ if (!ctx)
103
+ return false;
104
+ return ctx.permits.some((p) => p.role === role && p.scope_id === scope_id && is_permit_active(p, now));
105
+ };
106
+ /**
107
+ * Whether the request context holds an active permit for any role in `roles`
108
+ * at `scope_id`. Empty `roles` short-circuits to `false` — documents intent
109
+ * at the call site ("zero roles trivially admit no-one"). Same scope and
110
+ * null-tolerance semantics as `has_scoped_role`.
111
+ *
112
+ * @param ctx - the request context, or `null` for unauthenticated callers
113
+ * @param roles - the roles that would admit the caller (any-of)
114
+ * @param scope_id - the scope to check (`null` for global)
115
+ * @param now - current time (defaults to `new Date()`, pass for testability)
116
+ * @returns `true` iff the actor holds an active permit for any role in `roles` at the requested scope
117
+ */
118
+ export const has_any_scoped_role = (ctx, roles, scope_id, now = new Date()) => {
119
+ if (!ctx)
120
+ return false;
121
+ if (roles.length === 0)
122
+ return false;
123
+ return ctx.permits.some((p) => roles.includes(p.role) && p.scope_id === scope_id && is_permit_active(p, now));
124
+ };
70
125
  /**
71
126
  * Create middleware that builds the request context from a session cookie.
72
127
  *
@@ -1 +1 @@
1
- {"version":3,"file":"self_service_role_actions.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/self_service_role_actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAiC,KAAK,SAAS,EAAC,MAAM,0BAA0B,CAAC;AAExF,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,WAAW,CAAC;AAgBhD,sDAAsD;AACtD,MAAM,WAAW,6BAA6B;IAC7C;;;;OAIG;IACH,cAAc,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACtC;;;;OAIG;IACH,KAAK,CAAC,EAAE,gBAAgB,CAAC;CACzB;AAED;;;;;GAKG;AACH,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAC3C,gBAAgB,EAChB,KAAK,GAAG,gBAAgB,GAAG,kBAAkB,CAC7C,CAAC;AAOF;;;;;;;GAOG;AACH,eAAO,MAAM,gCAAgC,GAC5C,MAAM,yBAAyB,EAC/B,SAAS,6BAA6B,KACpC,KAAK,CAAC,SAAS,CA4GjB,CAAC"}
1
+ {"version":3,"file":"self_service_role_actions.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/self_service_role_actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAiC,KAAK,SAAS,EAAC,MAAM,0BAA0B,CAAC;AAExF,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,WAAW,CAAC;AAYhD,sDAAsD;AACtD,MAAM,WAAW,6BAA6B;IAC7C;;;;OAIG;IACH,cAAc,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACtC;;;;OAIG;IACH,KAAK,CAAC,EAAE,gBAAgB,CAAC;CACzB;AAED;;;;;GAKG;AACH,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAC3C,gBAAgB,EAChB,KAAK,GAAG,gBAAgB,GAAG,kBAAkB,CAC7C,CAAC;AAOF;;;;;;;GAOG;AACH,eAAO,MAAM,gCAAgC,GAC5C,MAAM,yBAAyB,EAC/B,SAAS,6BAA6B,KACpC,KAAK,CAAC,SAAS,CA+GjB,CAAC"}
@@ -33,8 +33,10 @@
33
33
  */
34
34
  import { rpc_action } from '../actions/action_rpc.js';
35
35
  import { jsonrpc_errors } from '../http/jsonrpc_errors.js';
36
- import { query_grant_permit, query_permit_find_active_for_actor, query_permit_has_role, query_revoke_permit, } from './permit_queries.js';
36
+ import { query_grant_permit, query_revoke_permit } from './permit_queries.js';
37
37
  import { audit_log_fire_and_forget } from './audit_log_queries.js';
38
+ import { is_permit_active } from './account_schema.js';
39
+ import { has_scoped_role } from './request_context.js';
38
40
  import { ERROR_ROLE_NOT_SELF_SERVICE_ELIGIBLE, self_service_role_set_action_spec, } from './self_service_role_action_specs.js';
39
41
  const require_request_auth = (auth) => {
40
42
  if (!auth)
@@ -73,13 +75,13 @@ export const create_self_service_role_actions = (deps, options) => {
73
75
  // Pre-check for idempotent re-grant. `query_grant_permit` is itself
74
76
  // idempotent (returns the existing permit instead of inserting), but
75
77
  // it doesn't signal "already existed" vs "newly inserted" — so we
76
- // peek first. The TOCTOU window is benign for self-service: two
77
- // concurrent grants both observe "no permit", both call
78
+ // peek first. Reads from the in-memory `auth.permits` snapshot
79
+ // (no DB roundtrip). The TOCTOU window is benign for self-service:
80
+ // two concurrent grants both observe "no permit", both call
78
81
  // `query_grant_permit`, and one collapses onto the other inside the
79
82
  // query's `ON CONFLICT DO NOTHING`. Worst case both responses report
80
83
  // `changed: true`; the DB still ends up with exactly one permit.
81
- const already = await query_permit_has_role(ctx, auth.actor.id, input.role);
82
- if (already) {
84
+ if (has_scoped_role(auth, input.role, null)) {
83
85
  return { ok: true, enabled: true, changed: false };
84
86
  }
85
87
  const permit = await query_grant_permit(ctx, {
@@ -103,12 +105,13 @@ export const create_self_service_role_actions = (deps, options) => {
103
105
  }, deps);
104
106
  return { ok: true, enabled: true, changed: true };
105
107
  }
106
- // Find an active global permit for this (actor, role). No dedicated
107
- // query exists, but `query_permit_find_active_for_actor` returns the
108
- // short list of every active permit and we filter in JS — fewer
109
- // round-trips than a new helper for a one-call-per-revoke path.
110
- const active = await query_permit_find_active_for_actor(ctx, auth.actor.id);
111
- const target = active.find((p) => p.role === input.role && p.scope_id === null);
108
+ // Find an active global permit for this (actor, role) in the in-memory
109
+ // `auth.permits` snapshot. No DB roundtrip — same correctness-equivalent
110
+ // pattern as `has_scoped_role` above (race window is between predicate
111
+ // and `query_revoke_permit`'s actual UPDATE, not between predicate and
112
+ // middleware load).
113
+ const now = new Date();
114
+ const target = auth.permits.find((p) => p.role === input.role && p.scope_id === null && is_permit_active(p, now));
112
115
  if (!target) {
113
116
  return { ok: true, enabled: false, changed: false };
114
117
  }
@@ -32,7 +32,6 @@ export interface CreateSessionAndSetCookieOptions {
32
32
  * sets the signed cookie.
33
33
  *
34
34
  * @mutates `auth_session` table - inserts the new session row (and evicts older rows when `max_sessions` is set)
35
- * @mutates `options.c` - writes the signed session cookie via `Set-Cookie`
36
35
  */
37
36
  export declare const create_session_and_set_cookie: (options: CreateSessionAndSetCookieOptions) => Promise<void>;
38
37
  //# sourceMappingURL=session_lifecycle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"session_lifecycle.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/session_lifecycle.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,MAAM,CAAC;AAElC,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AAC1C,OAAO,EAA8B,KAAK,cAAc,EAAC,MAAM,qBAAqB,CAAC;AASrF,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAChD,kCAAkC;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,kDAAkD;IAClD,IAAI,EAAE,SAAS,CAAC;IAChB,2CAA2C;IAC3C,CAAC,EAAE,OAAO,CAAC;IACX,2CAA2C;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,eAAe,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IACxC,4DAA4D;IAC5D,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,6BAA6B,GACzC,SAAS,gCAAgC,KACvC,OAAO,CAAC,IAAI,CAad,CAAC"}
1
+ {"version":3,"file":"session_lifecycle.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/session_lifecycle.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,MAAM,CAAC;AAElC,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AAC1C,OAAO,EAA8B,KAAK,cAAc,EAAC,MAAM,qBAAqB,CAAC;AASrF,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAChD,kCAAkC;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,kDAAkD;IAClD,IAAI,EAAE,SAAS,CAAC;IAChB,2CAA2C;IAC3C,CAAC,EAAE,OAAO,CAAC;IACX,2CAA2C;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,eAAe,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IACxC,4DAA4D;IAC5D,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,6BAA6B,GACzC,SAAS,gCAAgC,KACvC,OAAO,CAAC,IAAI,CAad,CAAC"}
@@ -14,7 +14,6 @@ import { generate_session_token, hash_session_token, AUTH_SESSION_LIFETIME_MS, q
14
14
  * sets the signed cookie.
15
15
  *
16
16
  * @mutates `auth_session` table - inserts the new session row (and evicts older rows when `max_sessions` is set)
17
- * @mutates `options.c` - writes the signed session cookie via `Set-Cookie`
18
17
  */
19
18
  export const create_session_and_set_cookie = async (options) => {
20
19
  const { keyring, deps, c, account_id, session_options, max_sessions } = options;
@@ -14,14 +14,10 @@ import { type SessionOptions } from './session_cookie.js';
14
14
  export declare const get_session_cookie: <T>(c: Context, options: SessionOptions<T>) => string | undefined;
15
15
  /**
16
16
  * Set the session cookie on a response.
17
- *
18
- * @mutates `c` - writes the `Set-Cookie` header
19
17
  */
20
18
  export declare const set_session_cookie: <T>(c: Context, value: string, options: SessionOptions<T>) => void;
21
19
  /**
22
20
  * Clear the session cookie on a response.
23
- *
24
- * @mutates `c` - writes a cookie-clearing `Set-Cookie` header
25
21
  */
26
22
  export declare const clear_session_cookie: <T>(c: Context, options: SessionOptions<T>) => void;
27
23
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"session_middleware.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/session_middleware.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAC,OAAO,EAAE,iBAAiB,EAAC,MAAM,MAAM,CAAC;AAGrD,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AAC1C,OAAO,EACN,KAAK,cAAc,EAInB,MAAM,qBAAqB,CAAC;AAE7B;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,CAAC,EACnC,GAAG,OAAO,EACV,SAAS,cAAc,CAAC,CAAC,CAAC,KACxB,MAAM,GAAG,SAEX,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,CAAC,EACnC,GAAG,OAAO,EACV,OAAO,MAAM,EACb,SAAS,cAAc,CAAC,CAAC,CAAC,KACxB,IASF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAAI,CAAC,EAAE,GAAG,OAAO,EAAE,SAAS,cAAc,CAAC,CAAC,CAAC,KAAG,IAMhF,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,yBAAyB,GAAI,SAAS,EAClD,SAAS,OAAO,EAChB,SAAS,cAAc,CAAC,SAAS,CAAC,KAChC,iBAgBF,CAAC"}
1
+ {"version":3,"file":"session_middleware.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/session_middleware.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAC,OAAO,EAAE,iBAAiB,EAAC,MAAM,MAAM,CAAC;AAGrD,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AAC1C,OAAO,EACN,KAAK,cAAc,EAInB,MAAM,qBAAqB,CAAC;AAE7B;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,CAAC,EACnC,GAAG,OAAO,EACV,SAAS,cAAc,CAAC,CAAC,CAAC,KACxB,MAAM,GAAG,SAEX,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,CAAC,EACnC,GAAG,OAAO,EACV,OAAO,MAAM,EACb,SAAS,cAAc,CAAC,CAAC,CAAC,KACxB,IASF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAAI,CAAC,EAAE,GAAG,OAAO,EAAE,SAAS,cAAc,CAAC,CAAC,CAAC,KAAG,IAMhF,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,yBAAyB,GAAI,SAAS,EAClD,SAAS,OAAO,EAChB,SAAS,cAAc,CAAC,SAAS,CAAC,KAChC,iBAgBF,CAAC"}
@@ -15,8 +15,6 @@ export const get_session_cookie = (c, options) => {
15
15
  };
16
16
  /**
17
17
  * Set the session cookie on a response.
18
- *
19
- * @mutates `c` - writes the `Set-Cookie` header
20
18
  */
21
19
  export const set_session_cookie = (c, value, options) => {
22
20
  const cookie_options = {
@@ -30,8 +28,6 @@ export const set_session_cookie = (c, value, options) => {
30
28
  };
31
29
  /**
32
30
  * Clear the session cookie on a response.
33
- *
34
- * @mutates `c` - writes a cookie-clearing `Set-Cookie` header
35
31
  */
36
32
  export const clear_session_cookie = (c, options) => {
37
33
  const cookie_options = {
@@ -37,14 +37,11 @@ export declare const load_config: <T>(runtime: Pick<FsReadDeps, "stat" | "read_t
37
37
  /**
38
38
  * Save CLI configuration to a JSON file.
39
39
  *
40
- * Creates parent directories if they don't exist.
41
- *
42
40
  * @param runtime - runtime with file write capability
43
41
  * @param path - path to the config JSON file
44
42
  * @param dir - directory containing the config file (created if missing)
45
43
  * @param config - configuration to save
46
44
  * @mutates filesystem - creates `dir` (recursive) and writes JSON to `path`
47
- * @throws Error if `mkdir` or `write_text_file` fails
48
45
  */
49
46
  export declare const save_config: <T>(runtime: Pick<FsWriteDeps, "mkdir" | "write_text_file">, path: string, dir: string, config: T) => Promise<void>;
50
47
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/cli/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAE3B,OAAO,KAAK,EAAC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAC,MAAM,oBAAoB,CAAC;AAElF;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,GAAI,SAAS,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,MAAM,MAAM,KAAG,MAAM,GAAG,IAGtF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,GAAI,SAAS,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,MAAM,MAAM,KAAG,MAAM,GAAG,IAG1F,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,GAAU,CAAC,EAClC,SAAS,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,gBAAgB,CAAC,GAAG,OAAO,EAC9D,MAAM,MAAM,EACZ,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAClB,OAAO,CAAC,CAAC,GAAG,IAAI,CAoBlB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,WAAW,GAAU,CAAC,EAClC,SAAS,IAAI,CAAC,WAAW,EAAE,OAAO,GAAG,iBAAiB,CAAC,EACvD,MAAM,MAAM,EACZ,KAAK,MAAM,EACX,QAAQ,CAAC,KACP,OAAO,CAAC,IAAI,CAOd,CAAC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/cli/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAE3B,OAAO,KAAK,EAAC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAC,MAAM,oBAAoB,CAAC;AAElF;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,GAAI,SAAS,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,MAAM,MAAM,KAAG,MAAM,GAAG,IAGtF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,GAAI,SAAS,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,MAAM,MAAM,KAAG,MAAM,GAAG,IAG1F,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,GAAU,CAAC,EAClC,SAAS,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,gBAAgB,CAAC,GAAG,OAAO,EAC9D,MAAM,MAAM,EACZ,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAClB,OAAO,CAAC,CAAC,GAAG,IAAI,CAoBlB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,GAAU,CAAC,EAClC,SAAS,IAAI,CAAC,WAAW,EAAE,OAAO,GAAG,iBAAiB,CAAC,EACvD,MAAM,MAAM,EACZ,KAAK,MAAM,EACX,QAAQ,CAAC,KACP,OAAO,CAAC,IAAI,CAOd,CAAC"}
@@ -61,14 +61,11 @@ export const load_config = async (runtime, path, schema) => {
61
61
  /**
62
62
  * Save CLI configuration to a JSON file.
63
63
  *
64
- * Creates parent directories if they don't exist.
65
- *
66
64
  * @param runtime - runtime with file write capability
67
65
  * @param path - path to the config JSON file
68
66
  * @param dir - directory containing the config file (created if missing)
69
67
  * @param config - configuration to save
70
68
  * @mutates filesystem - creates `dir` (recursive) and writes JSON to `path`
71
- * @throws Error if `mkdir` or `write_text_file` fails
72
69
  */
73
70
  export const save_config = async (runtime, path, dir, config) => {
74
71
  // ensure directory exists
@@ -40,7 +40,7 @@ export declare const get_daemon_info_path: (runtime: Pick<EnvDeps, "env_get">, n
40
40
  * @param name - application name
41
41
  * @param info - daemon info to write
42
42
  * @mutates filesystem - creates `~/.{name}/run/` and atomically writes `daemon.json`
43
- * @throws Error if `$HOME` is not set, or if directory creation / atomic write fails
43
+ * @throws Error if `$HOME` is not set
44
44
  */
45
45
  export declare const write_daemon_info: (runtime: Pick<EnvDeps, "env_get"> & Pick<FsWriteDeps, "mkdir" | "write_text_file" | "rename">, name: string, info: DaemonInfo) => Promise<void>;
46
46
  /**
@@ -44,7 +44,7 @@ export const get_daemon_info_path = (runtime, name) => {
44
44
  * @param name - application name
45
45
  * @param info - daemon info to write
46
46
  * @mutates filesystem - creates `~/.{name}/run/` and atomically writes `daemon.json`
47
- * @throws Error if `$HOME` is not set, or if directory creation / atomic write fails
47
+ * @throws Error if `$HOME` is not set
48
48
  */
49
49
  export const write_daemon_info = async (runtime, name, info) => {
50
50
  const app_dir = get_app_dir(runtime, name);
@@ -24,7 +24,6 @@ export interface CreateDbResult {
24
24
  /**
25
25
  * Create a database connection based on a URL.
26
26
  *
27
- * Returns the `Db` instance, a typed `close` callback, driver type, and display name.
28
27
  * The `close` callback is bound to the actual driver — callers never need to
29
28
  * know which driver is in use.
30
29
  *
@@ -1 +1 @@
1
- {"version":3,"file":"create_db.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/db/create_db.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAC,EAAE,EAAE,MAAM,EAAC,MAAM,SAAS,CAAC;AAIxC,yCAAyC;AACzC,MAAM,WAAW,cAAc;IAC9B,EAAE,EAAE,EAAE,CAAC;IACP,iFAAiF;IACjF,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,SAAS,GAAU,cAAc,MAAM,KAAG,OAAO,CAAC,cAAc,CAgC5E,CAAC"}
1
+ {"version":3,"file":"create_db.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/db/create_db.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAC,EAAE,EAAE,MAAM,EAAC,MAAM,SAAS,CAAC;AAIxC,yCAAyC;AACzC,MAAM,WAAW,cAAc;IAC9B,EAAE,EAAE,EAAE,CAAC;IACP,iFAAiF;IACjF,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,SAAS,GAAU,cAAc,MAAM,KAAG,OAAO,CAAC,cAAc,CAgC5E,CAAC"}
@@ -17,7 +17,6 @@ import { create_pglite_db } from './db_pglite.js';
17
17
  /**
18
18
  * Create a database connection based on a URL.
19
19
  *
20
- * Returns the `Db` instance, a typed `close` callback, driver type, and display name.
21
20
  * The `close` callback is bound to the actual driver — callers never need to
22
21
  * know which driver is in use.
23
22
  *
package/dist/db/db.d.ts CHANGED
@@ -81,8 +81,6 @@ export declare class Db {
81
81
  * @param text - SQL text with `$1`, `$2`, ... parameter placeholders
82
82
  * @param values - parameter values bound to the placeholders in `text`
83
83
  * @returns the result rows, typed as `T`
84
- * @throws Error propagated from the underlying driver on syntax errors,
85
- * constraint violations, or connection failures
86
84
  */
87
85
  query<T>(text: string, values?: Array<unknown>): Promise<Array<T>>;
88
86
  /**
@@ -91,8 +89,6 @@ export declare class Db {
91
89
  * @param text - SQL text with `$1`, `$2`, ... parameter placeholders
92
90
  * @param values - parameter values bound to the placeholders in `text`
93
91
  * @returns the first row, or `undefined` when the result set is empty
94
- * @throws Error propagated from the underlying driver on syntax errors,
95
- * constraint violations, or connection failures
96
92
  */
97
93
  query_one<T>(text: string, values?: Array<unknown>): Promise<T | undefined>;
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BAId,OAAO,EAAE,MAAM;IAK3B;;;;;;OAMG;IACG,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAKxE;;;;;;OAMG;IACG,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAKjF;;;;;;;;;;;OAWG;IACG,WAAW,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,EAAE,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;CAG/D"}
package/dist/db/db.js CHANGED
@@ -53,8 +53,6 @@ export class Db {
53
53
  * @param text - SQL text with `$1`, `$2`, ... parameter placeholders
54
54
  * @param values - parameter values bound to the placeholders in `text`
55
55
  * @returns the result rows, typed as `T`
56
- * @throws Error propagated from the underlying driver on syntax errors,
57
- * constraint violations, or connection failures
58
56
  */
59
57
  async query(text, values) {
60
58
  const result = await this.client.query(text, values);
@@ -66,8 +64,6 @@ export class Db {
66
64
  * @param text - SQL text with `$1`, `$2`, ... parameter placeholders
67
65
  * @param values - parameter values bound to the placeholders in `text`
68
66
  * @returns the first row, or `undefined` when the result set is empty
69
- * @throws Error propagated from the underlying driver on syntax errors,
70
- * constraint violations, or connection failures
71
67
  */
72
68
  async query_one(text, values) {
73
69
  const rows = await this.query(text, values);
@@ -12,8 +12,8 @@ import { type DbDriverResult } from './db.js';
12
12
  /**
13
13
  * Create a `Db` backed by a `pg.Pool`.
14
14
  *
15
- * Owns the transaction implementation (acquires a dedicated pool client
16
- * per transaction) and returns a `close` callback bound to `pool.end()`.
15
+ * Owns the transaction implementation, acquiring a dedicated pool client
16
+ * per transaction.
17
17
  *
18
18
  * @param pool - an already-constructed `pg.Pool`
19
19
  * @returns the `Db` instance and a `close` callback bound to `pool.end()`
package/dist/db/db_pg.js CHANGED
@@ -35,8 +35,8 @@ const create_pg_transaction = (pool) => async (fn) => {
35
35
  /**
36
36
  * Create a `Db` backed by a `pg.Pool`.
37
37
  *
38
- * Owns the transaction implementation (acquires a dedicated pool client
39
- * per transaction) and returns a `close` callback bound to `pool.end()`.
38
+ * Owns the transaction implementation, acquiring a dedicated pool client
39
+ * per transaction.
40
40
  *
41
41
  * @param pool - an already-constructed `pg.Pool`
42
42
  * @returns the `Db` instance and a `close` callback bound to `pool.end()`
@@ -12,8 +12,7 @@ import { type DbDriverResult } from './db.js';
12
12
  /**
13
13
  * Create a `Db` backed by a `PGlite` instance.
14
14
  *
15
- * Delegates transactions to PGlite's native `transaction()` method
16
- * and returns a `close` callback bound to `pglite.close()`.
15
+ * Delegates transactions to PGlite's native `transaction()` method.
17
16
  *
18
17
  * @param pglite - an already-constructed `PGlite` instance
19
18
  * @returns the `Db` instance and a `close` callback bound to `pglite.close()`
@@ -1 +1 @@
1
- {"version":3,"file":"db_pglite.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/db/db_pglite.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAA4B,KAAK,cAAc,EAAC,MAAM,SAAS,CAAC;AAYvE;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,GAAI,QAAQ,MAAM,KAAG,cAGhD,CAAC"}
1
+ {"version":3,"file":"db_pglite.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/db/db_pglite.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAA4B,KAAK,cAAc,EAAC,MAAM,SAAS,CAAC;AAYvE;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,GAAI,QAAQ,MAAM,KAAG,cAGhD,CAAC"}
@@ -17,8 +17,7 @@ const create_pglite_transaction = (pglite) => async (fn) => pglite.transaction(a
17
17
  /**
18
18
  * Create a `Db` backed by a `PGlite` instance.
19
19
  *
20
- * Delegates transactions to PGlite's native `transaction()` method
21
- * and returns a `close` callback bound to `pglite.close()`.
20
+ * Delegates transactions to PGlite's native `transaction()` method.
22
21
  *
23
22
  * @param pglite - an already-constructed `PGlite` instance
24
23
  * @returns the `Db` instance and a `close` callback bound to `pglite.close()`
@@ -121,7 +121,6 @@ export declare class MigrationError extends Error {
121
121
  * @returns one result per namespace where work happened (already-up-to-date
122
122
  * namespaces are omitted)
123
123
  * @mutates schema_version - inserts one row per applied migration
124
- * @mutates db - applies pending migrations' DDL/DML to the schema
125
124
  * @throws MigrationError with `kind` of `binary-older-than-db`,
126
125
  * `name-divergence-at-N`, `old-tracker-shape`, or `migration-failed`
127
126
  */
@@ -1 +1 @@
1
- {"version":3,"file":"migrate.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/db/migrate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,KAAK,EAAC,EAAE,EAAC,MAAM,SAAS,CAAC;AAEhC;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B;AAED;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;CAC7B;AAED,2DAA2D;AAC3D,MAAM,WAAW,eAAe;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,+EAA+E;IAC/E,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAC7B;AAED;;;;;GAKG;AACH,MAAM,MAAM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eAAO,MAAM,cAAc,GAC1B,IAAI,EAAE,EACN,YAAY,KAAK,CAAC,kBAAkB,CAAC,KACnC,OAAO,CAAC,KAAK,CAAC,eAAe,CAAC,CAuFhC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,eAAO,MAAM,QAAQ,GACpB,IAAI,EAAE,EACN,IAAI,kBAAkB,EACtB,OAAO,aAAa,CAAC,MAAM,CAAC,KAC1B,OAAO,CAAC,IAAI,CA+Dd,CAAC"}
@@ -155,7 +155,6 @@ const with_namespace_lock = async (db, namespace, fn) => {
155
155
  * @returns one result per namespace where work happened (already-up-to-date
156
156
  * namespaces are omitted)
157
157
  * @mutates schema_version - inserts one row per applied migration
158
- * @mutates db - applies pending migrations' DDL/DML to the schema
159
158
  * @throws MigrationError with `kind` of `binary-older-than-db`,
160
159
  * `name-divergence-at-N`, `old-tracker-shape`, or `migration-failed`
161
160
  */
@@ -114,7 +114,6 @@ export declare const read_env_var: (deps: Pick<FsReadDeps, "stat" | "read_text_f
114
114
  * @param options - extra replacements, permissions, logger
115
115
  * @returns result indicating whether the file was created or updated
116
116
  * @mutates filesystem - writes `env_path` (creating from `example_path` if missing) and optionally chmods to `0o600`
117
- * @throws Error if `example_path` cannot be read when `env_path` is missing, or if a generator / write fails
118
117
  */
119
118
  export declare const setup_env_file: (deps: FsReadDeps & FsWriteDeps & CommandDeps, env_path: string, example_path: string, options?: SetupEnvOptions) => Promise<SetupEnvResult>;
120
119
  /**
@@ -128,7 +127,6 @@ export declare const setup_env_file: (deps: FsReadDeps & FsWriteDeps & CommandDe
128
127
  * @param options - state_dir override, permissions, logger
129
128
  * @returns result indicating whether a token was created
130
129
  * @mutates filesystem - creates state directory and writes the token file (optionally chmods to `0o700` / `0o600`)
131
- * @throws Error if `mkdir`, key generation, or `write_text_file` fails
132
130
  */
133
131
  export declare const setup_bootstrap_token: (deps: FsReadDeps & FsWriteDeps & CommandDeps & EnvDeps, app_name: string, options?: SetupBootstrapTokenOptions) => Promise<SetupTokenResult>;
134
132
  /**
@@ -139,7 +137,6 @@ export declare const setup_bootstrap_token: (deps: FsReadDeps & FsWriteDeps & Co
139
137
  * @param options - state_dir override, permissions, logger
140
138
  * @returns result from creating the new token
141
139
  * @mutates filesystem - removes the existing token file (if any) then writes a fresh one
142
- * @throws Error if `remove` or the underlying `setup_bootstrap_token` call fails
143
140
  */
144
141
  export declare const reset_bootstrap_token: (deps: FsReadDeps & FsWriteDeps & FsRemoveDeps & CommandDeps & EnvDeps, app_name: string, options?: SetupBootstrapTokenOptions) => Promise<SetupTokenResult>;
145
142
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"setup.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/dev/setup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EACX,WAAW,EACX,aAAa,EACb,OAAO,EACP,UAAU,EACV,YAAY,EACZ,WAAW,EACX,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAQnD;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC3B,EAAE,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1B,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7B;AAED,2CAA2C;AAC3C,eAAO,MAAM,oBAAoB,EAAE,WAIlC,CAAC;AAEF,kCAAkC;AAClC,MAAM,WAAW,cAAc;IAC9B,6DAA6D;IAC7D,OAAO,EAAE,OAAO,CAAC;IACjB,kDAAkD;IAClD,OAAO,EAAE,OAAO,CAAC;IACjB,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAC;CACb;AAED,yCAAyC;AACzC,MAAM,WAAW,gBAAgB;IAChC,kEAAkE;IAClE,OAAO,EAAE,OAAO,CAAC;IACjB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+E;IAC/E,QAAQ,EAAE,MAAM,CAAC;IACjB,+EAA+E;IAC/E,QAAQ,EAAE,MAAM,CAAC;IACjB,8CAA8C;IAC9C,KAAK,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CAC9B;AAED,oCAAoC;AACpC,MAAM,WAAW,oBAAoB;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,uEAAuE;IACvE,OAAO,EAAE,OAAO,CAAC;CACjB;AAED,2CAA2C;AAC3C,MAAM,WAAW,kBAAmB,SAAQ,SAAS;IACpD,oEAAoE;IACpE,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CACrD;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB,GAC5B,MAAM,kBAAkB,EACxB,OAAO,mBAAmB,EAC1B,UAAU;IAAC,GAAG,CAAC,EAAE,WAAW,CAAA;CAAC,KAC3B,OAAO,CAAC,oBAAoB,CAsC9B,CAAC"}
package/dist/dev/setup.js CHANGED
@@ -80,7 +80,6 @@ export const read_env_var = async (deps, env_path, name) => {
80
80
  * @param options - extra replacements, permissions, logger
81
81
  * @returns result indicating whether the file was created or updated
82
82
  * @mutates filesystem - writes `env_path` (creating from `example_path` if missing) and optionally chmods to `0o600`
83
- * @throws Error if `example_path` cannot be read when `env_path` is missing, or if a generator / write fails
84
83
  */
85
84
  export const setup_env_file = async (deps, env_path, example_path, options) => {
86
85
  const log = options?.log ?? default_setup_logger;
@@ -140,7 +139,6 @@ export const setup_env_file = async (deps, env_path, example_path, options) => {
140
139
  * @param options - state_dir override, permissions, logger
141
140
  * @returns result indicating whether a token was created
142
141
  * @mutates filesystem - creates state directory and writes the token file (optionally chmods to `0o700` / `0o600`)
143
- * @throws Error if `mkdir`, key generation, or `write_text_file` fails
144
142
  */
145
143
  export const setup_bootstrap_token = async (deps, app_name, options) => {
146
144
  const log = options?.log ?? default_setup_logger;
@@ -175,7 +173,6 @@ export const setup_bootstrap_token = async (deps, app_name, options) => {
175
173
  * @param options - state_dir override, permissions, logger
176
174
  * @returns result from creating the new token
177
175
  * @mutates filesystem - removes the existing token file (if any) then writes a fresh one
178
- * @throws Error if `remove` or the underlying `setup_bootstrap_token` call fails
179
176
  */
180
177
  export const reset_bootstrap_token = async (deps, app_name, options) => {
181
178
  const log = options?.log ?? default_setup_logger;
@@ -41,8 +41,6 @@ export declare const log_env_validation_error: (error: EnvValidationError, label
41
41
  /**
42
42
  * Load and validate env vars against a Zod schema.
43
43
  *
44
- * Reads each key from the schema using `get_env`, then validates.
45
- *
46
44
  * @param schema - Zod object schema defining expected env vars
47
45
  * @param get_env - function to read an env var by key
48
46
  * @returns validated env object
@@ -1 +1 @@
1
- {"version":3,"file":"load.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/env/load.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB;;;;GAIG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;IAC5C,yCAAyC;IACzC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACjD,gCAAgC;IAChC,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC;IACrC,4DAA4D;IAC5D,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;gBAEpB,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS;IAOhF;;;;OAIG;IACH,aAAa,IAAI,KAAK,CAAC,MAAM,CAAC;CAG9B;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB,GAAI,OAAO,kBAAkB,EAAE,QAAQ,MAAM,KAAG,IAUpF,CAAC;AAEF;;;;;;;;;GASG;AACH,e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