@guren/server 2.14.0 → 2.16.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 (297) hide show
  1. package/dist/{DocsViewerServiceProvider-qFCaeiUv.js → DocsViewerServiceProvider-D2cuVgtN.js} +7 -12
  2. package/dist/{Hash-CzrwKeDp.js → Hash-D2DFd8xX.js} +12 -57
  3. package/dist/{HttpException-BkS3euNG.js → HttpException-BlQ2yEmT.js} +2 -79
  4. package/dist/{Job-BVT813DO.js → Job-DxQK8h3P.js} +24 -179
  5. package/dist/{McpServiceProvider-BawsYjgN.js → McpServiceProvider-nNcbCIQX.js} +11 -20
  6. package/dist/{Random-DbIJ22KQ.js → Random-S0OvCuR8.js} +9 -106
  7. package/dist/agent/AgentApprovalRequested.d.ts +31 -0
  8. package/dist/agent/approval.d.ts +184 -0
  9. package/dist/agent/audit-emitter.d.ts +36 -0
  10. package/dist/agent/audit.d.ts +67 -0
  11. package/dist/agent/derive.d.ts +32 -66
  12. package/dist/agent/dispatch.d.ts +53 -63
  13. package/dist/agent/events.d.ts +11 -19
  14. package/dist/agent/meta-tools.d.ts +34 -0
  15. package/dist/agent/public.d.ts +14 -0
  16. package/dist/agent/public.js +2 -0
  17. package/dist/agent/redact.d.ts +16 -38
  18. package/dist/agent/scopes.d.ts +23 -69
  19. package/dist/auth/AuthManager.d.ts +19 -40
  20. package/dist/auth/AuthenticatableModel.d.ts +2 -2
  21. package/dist/auth/SessionGuard.d.ts +0 -1
  22. package/dist/auth/TokenGuard.d.ts +6 -26
  23. package/dist/auth/api-token.d.ts +16 -148
  24. package/dist/auth/context.d.ts +5 -10
  25. package/dist/auth/email-verification.d.ts +29 -127
  26. package/dist/auth/index.js +1 -1
  27. package/dist/auth/oauth/index.d.ts +35 -57
  28. package/dist/auth/password/DefaultHasher.d.ts +9 -5
  29. package/dist/auth/password/PasswordHasher.d.ts +7 -0
  30. package/dist/auth/password/hash-format.d.ts +11 -0
  31. package/dist/auth/password-reset.d.ts +16 -42
  32. package/dist/auth/providers/ModelUserProvider.d.ts +3 -4
  33. package/dist/auth/providers/UserProvider.d.ts +4 -4
  34. package/dist/auth/signed-token.d.ts +18 -0
  35. package/dist/auth/types.d.ts +9 -32
  36. package/dist/auth/utils.d.ts +6 -27
  37. package/dist/{auth-BSUc14CD.js → auth-CbdPH4Cd.js} +252 -496
  38. package/dist/authorization/Gate.d.ts +9 -145
  39. package/dist/authorization/Policy.d.ts +6 -53
  40. package/dist/authorization/index.js +1 -1
  41. package/dist/authorization/middleware.d.ts +16 -62
  42. package/dist/authorization/types.d.ts +8 -64
  43. package/dist/{authorization-CdfbCj8J.js → authorization-CdEWZZw3.js} +44 -309
  44. package/dist/broadcasting/BroadcastManager.d.ts +29 -149
  45. package/dist/broadcasting/channels/Channel.d.ts +1 -19
  46. package/dist/broadcasting/channels/PresenceChannel.d.ts +1 -55
  47. package/dist/broadcasting/channels/PrivateChannel.d.ts +1 -23
  48. package/dist/broadcasting/drivers/MemoryDriver.d.ts +18 -70
  49. package/dist/broadcasting/drivers/RedisDriver.d.ts +3 -80
  50. package/dist/broadcasting/drivers/index.d.ts +1 -1
  51. package/dist/broadcasting/index.d.ts +1 -1
  52. package/dist/broadcasting/index.js +1 -1
  53. package/dist/broadcasting/types.d.ts +7 -88
  54. package/dist/{broadcasting-BxU-LIfF.js → broadcasting-B5RzB0A2.js} +87 -414
  55. package/dist/cache/CacheManager.d.ts +8 -62
  56. package/dist/cache/TaggedCache.d.ts +2 -35
  57. package/dist/cache/index.js +1 -1
  58. package/dist/cache/stores/FileStore.d.ts +2 -36
  59. package/dist/cache/stores/MemoryStore.d.ts +2 -26
  60. package/dist/cache/stores/RedisStore.d.ts +1 -29
  61. package/dist/cache/types.d.ts +21 -128
  62. package/dist/{cache-BYnZf2FR.js → cache-BOOIr324.js} +19 -198
  63. package/dist/client-C4TEr_Dd.js +9 -0
  64. package/dist/console/Command.d.ts +17 -126
  65. package/dist/console/ConsoleKernel.d.ts +2 -74
  66. package/dist/console/Input.d.ts +5 -113
  67. package/dist/console/Output.d.ts +3 -99
  68. package/dist/console/types.d.ts +3 -33
  69. package/dist/container/Container.d.ts +12 -103
  70. package/dist/container/ServiceProvider.d.ts +17 -61
  71. package/dist/container/bindings.d.ts +10 -12
  72. package/dist/container/defineModule.d.ts +16 -54
  73. package/dist/container/definePlugin.d.ts +12 -45
  74. package/dist/container/types.d.ts +2 -34
  75. package/dist/context-CXk_umpT.js +21 -0
  76. package/dist/database/Factory.d.ts +4 -57
  77. package/dist/database/Seeder.d.ts +8 -46
  78. package/dist/database/SeederRunner.d.ts +3 -33
  79. package/dist/database/types.d.ts +3 -24
  80. package/dist/discovery/AutoDiscovery.d.ts +10 -82
  81. package/dist/dispatch-BAwzftws.js +238 -0
  82. package/dist/docs-viewer/DocsViewerServiceProvider.d.ts +2 -5
  83. package/dist/docs-viewer/endpoint.d.ts +5 -11
  84. package/dist/encryption/Encrypter.d.ts +5 -71
  85. package/dist/encryption/Hash.d.ts +7 -57
  86. package/dist/encryption/Random.d.ts +6 -99
  87. package/dist/encryption/index.js +3 -3
  88. package/dist/encryption/types.d.ts +10 -72
  89. package/dist/{encryption-DJtkkhiw.js → encryption-uwP3Di4D.js} +13 -79
  90. package/dist/{endpoint-D6GIqOpe.js → endpoint-BXipU2Jj.js} +6 -12
  91. package/dist/endpoint-Dsw3Acvq.js +26 -0
  92. package/dist/errors/ExceptionHandler.d.ts +3 -90
  93. package/dist/errors/HttpException.d.ts +2 -79
  94. package/dist/errors/debug-page.d.ts +3 -17
  95. package/dist/errors/error-page.d.ts +1 -0
  96. package/dist/errors/exceptions/AuthenticationException.d.ts +2 -24
  97. package/dist/errors/exceptions/AuthorizationException.d.ts +1 -24
  98. package/dist/errors/exceptions/MethodNotAllowedException.d.ts +1 -23
  99. package/dist/errors/exceptions/NotFoundHttpException.d.ts +1 -27
  100. package/dist/errors/exceptions/ValidationException.d.ts +2 -43
  101. package/dist/errors/types.d.ts +1 -25
  102. package/dist/{errors-BgeOl_DC.js → errors-JpkcCjjn.js} +3 -41
  103. package/dist/events/Event.d.ts +1 -28
  104. package/dist/events/EventManager.d.ts +5 -107
  105. package/dist/events/Listener.d.ts +7 -55
  106. package/dist/events/builtin.d.ts +0 -24
  107. package/dist/events/index.js +1 -1
  108. package/dist/events/types.d.ts +4 -22
  109. package/dist/{events-aIH_bWRx.js → events-DOmAHDeP.js} +11 -191
  110. package/dist/facades/index.d.ts +2 -14
  111. package/dist/health/HealthCheck.d.ts +0 -24
  112. package/dist/health/HealthManager.d.ts +0 -36
  113. package/dist/health/checks/CacheCheck.d.ts +2 -17
  114. package/dist/health/checks/CustomCheck.d.ts +0 -9
  115. package/dist/health/checks/DatabaseCheck.d.ts +2 -17
  116. package/dist/health/checks/MemoryCheck.d.ts +3 -12
  117. package/dist/health/checks/RedisCheck.d.ts +1 -13
  118. package/dist/health/checks/StorageCheck.d.ts +2 -17
  119. package/dist/health/index.js +1 -1
  120. package/dist/health/types.d.ts +4 -24
  121. package/dist/{health-VWdWXRwh.js → health-DQSvUplL.js} +1 -76
  122. package/dist/hot-disposables-B5BXqaIH.js +167 -0
  123. package/dist/hot-reload/hot-disposables.d.ts +22 -74
  124. package/dist/hot-reload/testing.d.ts +4 -9
  125. package/dist/http/Application.d.ts +62 -208
  126. package/dist/http/FormRequest.d.ts +4 -55
  127. package/dist/http/dev-assets.d.ts +16 -18
  128. package/dist/http/dev-banner.d.ts +2 -5
  129. package/dist/http/inertia-assets.d.ts +3 -6
  130. package/dist/http/middleware/capabilities.d.ts +27 -50
  131. package/dist/http/middleware/cors.d.ts +4 -29
  132. package/dist/http/middleware/csp.d.ts +2 -25
  133. package/dist/http/middleware/csrf.d.ts +20 -95
  134. package/dist/http/middleware/detect-locale.d.ts +7 -27
  135. package/dist/http/middleware/force-https.d.ts +6 -24
  136. package/dist/http/middleware/host-authorization.d.ts +2 -12
  137. package/dist/http/middleware/loopback-guard.d.ts +15 -33
  138. package/dist/http/middleware/rate-limit.d.ts +29 -126
  139. package/dist/http/middleware/redirect-safety.d.ts +2 -20
  140. package/dist/http/middleware/request-id.d.ts +1 -14
  141. package/dist/http/middleware/request-logging.d.ts +2 -13
  142. package/dist/http/middleware/response-headers.d.ts +5 -13
  143. package/dist/http/middleware/security-headers.d.ts +2 -16
  144. package/dist/http/middleware/session.d.ts +15 -34
  145. package/dist/http/middleware/validation-errors-cookie.d.ts +7 -18
  146. package/dist/http/middleware/validation.d.ts +8 -63
  147. package/dist/http/public-assets.d.ts +14 -0
  148. package/dist/http/request.d.ts +49 -48
  149. package/dist/http/resources/CursorPaginator.d.ts +5 -64
  150. package/dist/http/resources/Paginator.d.ts +7 -84
  151. package/dist/http/resources/Resource.d.ts +9 -65
  152. package/dist/http/resources/ResourceCollection.d.ts +5 -39
  153. package/dist/http/resources/types.d.ts +10 -30
  154. package/dist/http/static-documents.d.ts +21 -0
  155. package/dist/http/validation/Validator.d.ts +25 -85
  156. package/dist/http/validation/rules.d.ts +48 -147
  157. package/dist/http/validation/types.d.ts +16 -61
  158. package/dist/http/vite-assets.d.ts +5 -28
  159. package/dist/http/vite-dev-server.d.ts +6 -9
  160. package/dist/http/vite-manifest.d.ts +19 -33
  161. package/dist/i18n/I18nManager.d.ts +12 -78
  162. package/dist/i18n/Translator.d.ts +3 -54
  163. package/dist/i18n/index.js +1 -1
  164. package/dist/i18n/loaders/JsonLoader.d.ts +4 -31
  165. package/dist/i18n/loaders/MemoryLoader.d.ts +1 -21
  166. package/dist/i18n/pluralization.d.ts +4 -13
  167. package/dist/i18n/types.d.ts +17 -69
  168. package/dist/{i18n-mcWi7LCd.js → i18n-Cg1aajRP.js} +31 -225
  169. package/dist/index.d.ts +13 -4
  170. package/dist/index.js +1036 -3080
  171. package/dist/internal/agent-preflight.d.ts +9 -21
  172. package/dist/internal/request.d.ts +10 -17
  173. package/dist/internal/request.js +2 -2
  174. package/dist/internal/route-path.d.ts +9 -21
  175. package/dist/internal/route-path.js +9 -21
  176. package/dist/internal/zod-compat.d.ts +55 -122
  177. package/dist/internal/zod-compat.js +39 -70
  178. package/dist/internal/zod-json-schema.d.ts +18 -54
  179. package/dist/internal/zod-json-schema.js +46 -123
  180. package/dist/jsx-runtime.d.ts +3 -8
  181. package/dist/lambda/index.d.ts +17 -79
  182. package/dist/lambda/index.js +11 -59
  183. package/dist/logging/LogManager.d.ts +1 -51
  184. package/dist/logging/Logger.d.ts +8 -47
  185. package/dist/logging/channels/ConsoleChannel.d.ts +1 -3
  186. package/dist/logging/channels/DailyFileChannel.d.ts +1 -5
  187. package/dist/logging/channels/FileChannel.d.ts +1 -3
  188. package/dist/logging/daily-file-path.d.ts +15 -0
  189. package/dist/logging/index.d.ts +1 -0
  190. package/dist/logging/index.js +2 -2
  191. package/dist/logging/types.d.ts +13 -45
  192. package/dist/{logging-CPaRMuPP.js → logging-zOY1XCtq.js} +83 -129
  193. package/dist/{loopback-guard-D0Kc7-xc.js → loopback-guard-DT9gHF0F.js} +41 -92
  194. package/dist/mail/Mail.d.ts +10 -106
  195. package/dist/mail/MailManager.d.ts +2 -60
  196. package/dist/mail/index.js +1 -1
  197. package/dist/mail/transports/LogTransport.d.ts +1 -4
  198. package/dist/mail/transports/MemoryTransport.d.ts +1 -63
  199. package/dist/mail/transports/ResendTransport.d.ts +1 -23
  200. package/dist/mail/transports/SmtpTransport.d.ts +1 -31
  201. package/dist/mail/types.d.ts +28 -150
  202. package/dist/{mail-DfEfSQEr.js → mail-76DWy9lj.js} +31 -289
  203. package/dist/mcp/McpServiceProvider.d.ts +4 -10
  204. package/dist/mcp/create-mcp-server.d.ts +25 -57
  205. package/dist/mcp/endpoint.d.ts +12 -36
  206. package/dist/mcp/index.js +1 -1
  207. package/dist/mvc/Controller.d.ts +46 -253
  208. package/dist/mvc/Router.d.ts +50 -129
  209. package/dist/mvc/inertia/InertiaEngine.d.ts +18 -48
  210. package/dist/mvc/inertia/shared.d.ts +6 -19
  211. package/dist/mvc/mount-route.d.ts +2 -6
  212. package/dist/mvc/view.d.ts +1 -2
  213. package/dist/notifications/Notification.d.ts +8 -75
  214. package/dist/notifications/NotificationManager.d.ts +15 -88
  215. package/dist/notifications/channels/DatabaseChannel.d.ts +1 -41
  216. package/dist/notifications/channels/MailChannel.d.ts +2 -31
  217. package/dist/notifications/channels/MemoryChannel.d.ts +2 -62
  218. package/dist/notifications/channels/SlackChannel.d.ts +3 -48
  219. package/dist/notifications/index.js +1 -1
  220. package/dist/notifications/notifiable-type.d.ts +3 -6
  221. package/dist/notifications/registry.d.ts +8 -27
  222. package/dist/notifications/types.d.ts +16 -53
  223. package/dist/{notifications-BGqmUNZ8.js → notifications-okWFs9ly.js} +37 -335
  224. package/dist/providers/AuthServiceProvider.d.ts +1 -3
  225. package/dist/providers/AuthorizationServiceProvider.d.ts +2 -3
  226. package/dist/providers/BroadcastServiceProvider.d.ts +1 -3
  227. package/dist/providers/CacheServiceProvider.d.ts +1 -3
  228. package/dist/providers/EncryptionServiceProvider.d.ts +1 -3
  229. package/dist/providers/ErrorServiceProvider.d.ts +1 -4
  230. package/dist/providers/EventServiceProvider.d.ts +1 -3
  231. package/dist/providers/HealthServiceProvider.d.ts +1 -3
  232. package/dist/providers/I18nServiceProvider.d.ts +6 -10
  233. package/dist/providers/InertiaServiceProvider.d.ts +1 -4
  234. package/dist/providers/LogServiceProvider.d.ts +1 -3
  235. package/dist/providers/MailServiceProvider.d.ts +1 -3
  236. package/dist/providers/NotificationServiceProvider.d.ts +1 -3
  237. package/dist/providers/OAuthServiceProvider.d.ts +1 -3
  238. package/dist/providers/QueueServiceProvider.d.ts +1 -3
  239. package/dist/providers/SchedulingServiceProvider.d.ts +1 -3
  240. package/dist/providers/StorageServiceProvider.d.ts +1 -3
  241. package/dist/queue/FailedJobReporter.d.ts +1 -24
  242. package/dist/queue/Job.d.ts +12 -99
  243. package/dist/queue/QueueManager.d.ts +6 -57
  244. package/dist/queue/Worker.d.ts +4 -65
  245. package/dist/queue/drivers/MemoryDriver.d.ts +3 -44
  246. package/dist/queue/drivers/RedisDriver.d.ts +7 -65
  247. package/dist/queue/drivers/SqsDriver.d.ts +6 -57
  248. package/dist/queue/drivers/SyncDriver.d.ts +10 -13
  249. package/dist/queue/index.js +2 -2
  250. package/dist/queue/types.d.ts +10 -92
  251. package/dist/{queue-CXrRK85G.js → queue-CcXCjuJI.js} +32 -260
  252. package/dist/redis/RedisApiTokenStore.d.ts +4 -56
  253. package/dist/redis/RedisEmailVerificationStore.d.ts +4 -37
  254. package/dist/redis/RedisOAuthStateStore.d.ts +2 -10
  255. package/dist/redis/RedisPasswordResetStore.d.ts +4 -37
  256. package/dist/redis/RedisRateLimitStore.d.ts +16 -49
  257. package/dist/redis/RedisSessionStore.d.ts +3 -44
  258. package/dist/redis/client.d.ts +2 -32
  259. package/dist/redis/index.js +47 -232
  260. package/dist/redis/redis-values.d.ts +6 -12
  261. package/dist/redis/scan-keys.d.ts +1 -4
  262. package/dist/request-CLOYytGP.js +68 -0
  263. package/dist/runtime/index.d.ts +2 -0
  264. package/dist/runtime/index.js +108 -74
  265. package/dist/scheduling/CronParser.d.ts +0 -29
  266. package/dist/scheduling/Schedule.d.ts +1 -153
  267. package/dist/scheduling/ScheduledTask.d.ts +0 -31
  268. package/dist/scheduling/Scheduler.d.ts +0 -70
  269. package/dist/scheduling/index.js +1 -1
  270. package/dist/scheduling/types.d.ts +4 -65
  271. package/dist/{scheduling-CPiEdtQd.js → scheduling-C6tcOtUl.js} +2 -287
  272. package/dist/storage/StorageManager.d.ts +0 -48
  273. package/dist/storage/drivers/LocalDriver.d.ts +1 -25
  274. package/dist/storage/drivers/MemoryDriver.d.ts +5 -35
  275. package/dist/storage/drivers/S3Driver.d.ts +6 -36
  276. package/dist/storage/drivers/s3-acl.d.ts +5 -10
  277. package/dist/storage/index.js +1 -1
  278. package/dist/storage/types.d.ts +27 -265
  279. package/dist/{storage-TLD9t0Q2.js → storage-BB59f07j.js} +17 -157
  280. package/dist/support/contained-path.d.ts +10 -20
  281. package/dist/support/error-polyfill.d.ts +4 -6
  282. package/dist/support/expiry.d.ts +17 -33
  283. package/dist/support/expiry.js +17 -33
  284. package/dist/support/import-map.d.ts +3 -7
  285. package/dist/support/inertia-defaults.d.ts +5 -10
  286. package/dist/support/redirect-target.d.ts +4 -6
  287. package/dist/support/stack-frames.d.ts +11 -50
  288. package/dist/support/trim-slashes.d.ts +4 -7
  289. package/dist/support/warn-once.d.ts +2 -6
  290. package/dist/{trim-slashes-ZJ_VsY5s.js → trim-slashes-BLY9hKAa.js} +4 -7
  291. package/dist/{vite-manifest-BGfWbPYp.js → vite-manifest-CTQp-SOo.js} +34 -58
  292. package/package.json +6 -2
  293. package/dist/client-Dd7vLcqp.js +0 -27
  294. package/dist/context-DoD0c7J_.js +0 -26
  295. package/dist/endpoint-D-20PiHY.js +0 -46
  296. package/dist/hot-disposables-WsTX2ySN.js +0 -281
  297. package/dist/request-CRVuIiQr.js +0 -78
@@ -1,28 +1,16 @@
1
1
  /**
2
- * The wire protocol of an agent preflight (RFC 0016 §5.4), in a leaf module
3
- * so the two halves can share it without depending on each other.
4
- *
5
- * `Router` mounts the seam that answers a preflight; `agent/dispatch` builds
6
- * the request that asks for one and reads the answer back. Putting the names
7
- * in either of those would make one import the other — today only
8
- * `dispatch → Router` exists, and the day `Router` needs anything from
9
- * `agent/` that becomes a cycle.
10
- *
11
- * Not exported from the package index: an external dispatcher asks for a
12
- * preflight through `BuildToolRequestOptions.preflight`, and the header
13
- * spelling is this seam's business, not published API.
2
+ * The wire protocol of an agent preflight (RFC 0016 §5.4), in a leaf module so
3
+ * `Router` (which answers one) and `agent/dispatch` (which asks) share it
4
+ * without importing each other and closing a cycle. Not exported from the
5
+ * package index: an external dispatcher goes through
6
+ * `BuildToolRequestOptions.preflight`, and the header spelling stays internal.
14
7
  */
15
8
  /** Request header asking the route for a verdict instead of an execution. */
16
9
  export declare const AGENT_PREFLIGHT_HEADER = "X-Guren-Agent-Preflight";
17
10
  /**
18
- * Response header marking a body as a preflight verdict rather than the
19
- * route's own output.
20
- *
21
- * Load-bearing in two places that would otherwise mistake one for the other:
22
- * a route's `output` schema validation (which would reject the verdict and
23
- * turn it into a 500) and the MCP response mapping (which would advertise the
24
- * verdict as the tool's `structuredContent`, so an SDK client validates it
25
- * against the tool's output schema and throws). Both are answering the same
26
- * question — "is this the route's result?" — so both read the same marker.
11
+ * Response header marking a body as a preflight verdict rather than the route's
12
+ * own output. Read by the route's `output` schema validation (which would
13
+ * otherwise reject the verdict as a 500) and by the MCP response mapping (which
14
+ * would otherwise advertise it as the tool's `structuredContent`).
27
15
  */
28
16
  export declare const AGENT_PREFLIGHT_VERDICT_HEADER = "X-Guren-Agent-Preflight-Verdict";
@@ -1,19 +1,12 @@
1
1
  /**
2
- * The one request-body parsing rule: which content types are read, how a
3
- * repeated form field collapses, and what an unreadable body falls back to.
4
- *
5
- * `@guren/testing`'s controller mock reads it through this subpath so a
6
- * mocked controller and a real one cannot disagree about a body. The mock
7
- * holds a `Request` rather than a Hono context, so it adapts — it wraps the
8
- * request in a `HonoRequest` and calls straight into these — rather than
9
- * reimplementing the decision. A second copy is how the two came to disagree
10
- * on an uppercase media type, on a `;`-parameterized one, and on a repeated
11
- * `field[]`.
12
- *
13
- * Internal by the rules in `contributing/api-stability.md` — reachable only
14
- * through a deep import under `internal/`, never re-exported from an index.
15
- * `parseRequestPayload` beside it *is* public and stays exported from the
16
- * package root; this subpath exists for the two that are not.
2
+ * The one set of request-reading rules: which content types are read, how a
3
+ * repeated form field collapses, what an unreadable body falls back to, how a
4
+ * multipart upload is read, and how repeated query parameters flatten.
5
+ * `@guren/testing`'s controller mock wraps its `Request` in a `HonoRequest` and
6
+ * calls into these rather than restating them — a second copy is how the two
7
+ * came to disagree on an uppercase media type and on a repeated `field[]`.
8
+ * Internal per `contributing/api-stability.md`: reachable only through this
9
+ * deep import. `parseRequestPayload` beside them is public.
17
10
  */
18
- export { parseRequestBody, asRecord } from '../http/request.js';
19
- export type { RequestBodyContext } from '../http/request.js';
11
+ export { parseRequestBody, parseRequestUploads, asRecord, flattenRequestQueries, } from '../http/request.js';
12
+ export type { RequestBodyContext, RequestQueryContext, RequestUploads, RequestUploadsContext, } from '../http/request.js';
@@ -1,2 +1,2 @@
1
- import { i as parseRequestBody, t as asRecord } from "../request-CRVuIiQr.js";
2
- export { asRecord, parseRequestBody };
1
+ import { i as parseRequestBody, n as flattenRequestQueries, o as parseRequestUploads, t as asRecord } from "../request-CLOYytGP.js";
2
+ export { asRecord, flattenRequestQueries, parseRequestBody, parseRequestUploads };
@@ -1,28 +1,16 @@
1
1
  /**
2
- * The one Hono route-path lexing rule, shared by every surface that has to say
3
- * what parameters a path declares: the router's own substitution and binding
4
- * scanners, RFC 0016's agent tool input, and `@guren/openapi`'s path template
5
- * and parameter list.
6
- *
7
- * Internal by the rules in `contributing/api-stability.md` — reachable only
8
- * through a deep import under `internal/`, never re-exported from an index.
9
- * It lives in `@guren/server` and is re-exported by
10
- * `@guren/core/internal/route-path` for the same build-order reason the
11
- * JSON Schema walker beside it does: core's index is
12
- * `export * from '@guren/server'`, so a server module cannot import a core
13
- * one.
14
- *
15
- * It exists because two lexers is how two surfaces come to describe one path
16
- * differently. They did: `@guren/openapi` carried its own copy with the `*`
17
- * outside the capture group, so `/files/:name*` yielded the parameter `name`
18
- * there and `name*` — what Hono actually registers — everywhere else. What
19
- * *does* legitimately differ is rendering, not lexing, and that difference now
20
- * lives at the one call site that needs it (see `stripExplodeModifier`).
2
+ * The one Hono route-path lexing rule, shared by the router's substitution and
3
+ * binding scanners, RFC 0016's agent tool input, and `@guren/openapi`'s path
4
+ * template. Two lexers is how `/files/:name*` came to yield the parameter
5
+ * `name` in openapi and `name*` — what Hono registers — everywhere else; what
6
+ * legitimately differs is rendering, at the call site (`stripExplodeModifier`).
7
+ * Internal per `contributing/api-stability.md`; re-exported by
8
+ * `@guren/core/internal/route-path`, since core's index is
9
+ * `export * from '@guren/server'` and a server module cannot import a core one.
21
10
  */
22
11
  export declare const PATH_PARAM_PATTERN: RegExp;
23
12
  /**
24
13
  * Param labels in path order, exactly as Hono registers them: constraints
25
- * dropped, a trailing `*` kept (it is part of the name), a trailing `?`
26
- * dropped (it is not).
14
+ * dropped, a trailing `*` kept (part of the name), a trailing `?` dropped.
27
15
  */
28
16
  export declare function extractPathParamNames(path: string): string[];
@@ -1,30 +1,18 @@
1
1
  //#region src/internal/route-path.ts
2
2
  /**
3
- * The one Hono route-path lexing rule, shared by every surface that has to say
4
- * what parameters a path declares: the router's own substitution and binding
5
- * scanners, RFC 0016's agent tool input, and `@guren/openapi`'s path template
6
- * and parameter list.
7
- *
8
- * Internal by the rules in `contributing/api-stability.md` — reachable only
9
- * through a deep import under `internal/`, never re-exported from an index.
10
- * It lives in `@guren/server` and is re-exported by
11
- * `@guren/core/internal/route-path` for the same build-order reason the
12
- * JSON Schema walker beside it does: core's index is
13
- * `export * from '@guren/server'`, so a server module cannot import a core
14
- * one.
15
- *
16
- * It exists because two lexers is how two surfaces come to describe one path
17
- * differently. They did: `@guren/openapi` carried its own copy with the `*`
18
- * outside the capture group, so `/files/:name*` yielded the parameter `name`
19
- * there and `name*` — what Hono actually registers — everywhere else. What
20
- * *does* legitimately differ is rendering, not lexing, and that difference now
21
- * lives at the one call site that needs it (see `stripExplodeModifier`).
3
+ * The one Hono route-path lexing rule, shared by the router's substitution and
4
+ * binding scanners, RFC 0016's agent tool input, and `@guren/openapi`'s path
5
+ * template. Two lexers is how `/files/:name*` came to yield the parameter
6
+ * `name` in openapi and `name*` — what Hono registers — everywhere else; what
7
+ * legitimately differs is rendering, at the call site (`stripExplodeModifier`).
8
+ * Internal per `contributing/api-stability.md`; re-exported by
9
+ * `@guren/core/internal/route-path`, since core's index is
10
+ * `export * from '@guren/server'` and a server module cannot import a core one.
22
11
  */
23
12
  const PATH_PARAM_PATTERN = /(^|\/):([A-Za-z0-9_-]+\*?)(?:\{[^{}]*\{[^{}]*\}[^{}]*\}|\{[^{}]*\})?\??/gu;
24
13
  /**
25
14
  * Param labels in path order, exactly as Hono registers them: constraints
26
- * dropped, a trailing `*` kept (it is part of the name), a trailing `?`
27
- * dropped (it is not).
15
+ * dropped, a trailing `*` kept (part of the name), a trailing `?` dropped.
28
16
  */
29
17
  function extractPathParamNames(path) {
30
18
  return Array.from(path.matchAll(PATH_PARAM_PATTERN), (match) => match[2]);
@@ -1,50 +1,18 @@
1
1
  /**
2
- * Zod 4 schema-reading primitives shared by everything that has to read an
3
- * application's schemas without parsing anything: the JSON Schema walker next
4
- * door (`zod-json-schema.ts`, behind `@guren/openapi`, RFC 0016's agent tools,
5
- * and `deriveAgentTools`), `@guren/cli`'s TypeScript-type renderer
6
- * (`src/schema-type-extractor.ts`), and its route contract check
7
- * (`src/route-contract-check.ts`).
8
- *
9
- * Internal by the rules in `contributing/api-stability.md`: reachable only
10
- * through a deep import under `internal/`, never re-exported from
11
- * `@guren/server`'s or `@guren/core`'s index. It sits in this package rather
12
- * than `@guren/core` because `zod-json-schema.ts` beside it has to, for the
13
- * build-order reason that module's header explains;
14
- * `@guren/core/internal/zod-compat` re-exports it so consumers outside this
15
- * package keep writing the core specifier.
16
- *
17
- * Zod 4 only. The zod 3 API (whether from the old `zod@3` package or the
18
- * `zod/v3` subpath that zod 4 ships for migration) tags every node with
19
- * `_def.typeName` and overloads `_def.type` to hold a nested schema — the
20
- * ambiguity behind a bug this module's predecessors fixed twice. Rather than
21
- * carrying both dialects forever, a v3 node is detected up front
22
- * (`isZod3Schema`) and refused with `ZOD3_UNSUPPORTED_MESSAGE`; everything
23
- * below it assumes the v4 layout, where `_def.type` is always the type name.
24
- *
25
- * What does NOT belong here: the two type switches that turn a node into an
26
- * output (a TypeScript type string vs. a JSON Schema object). Their leaf
27
- * vocabularies have legitimately diverged — the CLI renders `void`/`any`/
28
- * `never`, which JSON Schema has no way to express — and that is a rendering
29
- * decision, not schema-reading knowledge.
30
- *
31
- * No caller's `isOptional` belongs here either, but for a weaker reason than
32
- * "they are all right": the CLI's type renderer reads only the side of a
33
- * `.pipe()` it renders, while the JSON Schema walker and the CLI's route
34
- * contract check require both sides to permit omission, and *every* one of them
35
- * is an approximation that a sufficiently odd pipeline can fool. Fixing them
36
- * properly means simulating a parse, which is well beyond reading a `_def`.
37
- * They stay with their callers until someone does that. Applying the wrapper
38
- * vocabulary is not policy, though, which is why `unwrapSingleChild` does live
39
- * here: reaching a wrapper's child is schema-reading, while what a caller
40
- * *concludes* from that wrapper is the caller's to decide.
2
+ * Zod 4 schema-reading primitives shared by everything that reads an
3
+ * application's schemas without parsing: the JSON Schema walker next door and
4
+ * `@guren/cli`'s type renderer and route contract check. Internal per
5
+ * `contributing/api-stability.md`; it lives here rather than in `@guren/core` for
6
+ * the build-order reason `zod-json-schema.ts`'s header gives, re-exported by
7
+ * `@guren/core/internal/zod-compat`. Zod 4 only: a v3 node (tags `_def.typeName`,
8
+ * overloads `_def.type` with a nested schema) is refused up front, so `_def.type`
9
+ * is always the type name here. Rendering decisions (node → output, `isOptional`) stay with callers.
41
10
  */
42
11
  export interface ZodSchemaLike {
43
12
  _def?: Record<string, unknown>;
44
13
  /**
45
- * zod 4's internal container; `values` is its own computed set of accepted
46
- * literals, `def` the definition of whatever the node is (for a check entry,
47
- * the check itself — see `schemaChecks`).
14
+ * zod 4's internal container: `values` is its computed set of accepted
15
+ * literals, `def` the definition of whatever the node is.
48
16
  */
49
17
  _zod?: {
50
18
  values?: Set<unknown>;
@@ -54,33 +22,28 @@ export interface ZodSchemaLike {
54
22
  shape?: Record<string, ZodSchemaLike>;
55
23
  }
56
24
  /**
57
- * One entry of `_def.checks`, as zod stores it: a `check` discriminator plus
58
- * whatever that kind carries (`minimum`, `value`, `inclusive`, `pattern`, …).
59
- * Left open rather than modelled as a union — the kinds are zod's to add, and
60
- * a reader that does not recognise one must simply ignore it.
25
+ * One entry of `_def.checks`: a `check` discriminator plus whatever that kind
26
+ * carries. Left open rather than a union — the kinds are zod's to add, and an
27
+ * unrecognised one must simply be ignored.
61
28
  */
62
29
  export interface ZodCheckDef extends Record<string, unknown> {
63
30
  check: string;
64
31
  }
65
32
  /**
66
- * Which side of a schema is being read.
67
- *
68
- * - `output` — the parsed value, i.e. what a controller receives after
69
- * validation, or what a response body looks like.
70
- * - `input` — the value a client has to send over the wire. Coercing and
71
- * piped schemas can differ here from their output side.
33
+ * Which side of a schema is being read: `output` is the parsed value a
34
+ * controller receives, `input` what a client sends. Coercing and piped schemas
35
+ * differ between the two.
72
36
  */
73
37
  export type SchemaIo = 'input' | 'output';
74
38
  /**
75
- * Whether this node was authored with the zod 3 API. Only v3 sets
76
- * `_def.typeName` (`"ZodString"`), so its presence is the discriminator —
39
+ * Only zod 3 sets `_def.typeName`, so its presence is the discriminator —
77
40
  * checked before any other read, because on a v3 node `_def.type` holds a
78
41
  * nested *schema* and every v4-shaped read below would misfire on it.
79
42
  */
80
43
  export declare function isZod3Schema(schema: ZodSchemaLike): boolean;
81
44
  /**
82
- * The one refusal message, stated once so the CLI's console warning and the
83
- * OpenAPI document's warnings array cannot drift apart.
45
+ * The one refusal message, so the CLI's console warning and the OpenAPI
46
+ * document's warnings array cannot drift apart.
84
47
  */
85
48
  export declare const ZOD3_UNSUPPORTED_MESSAGE = "this schema was authored with the zod v3 API (zod@3 or the zod/v3 subpath), which Guren does not support. Rewrite it with the zod 4 API (`import { z } from 'zod'`).";
86
49
  /** The node's type name: `_def.type` (`"string"`, `"object"`, …) or the schema's own `.type`. */
@@ -88,11 +51,9 @@ export declare function getTypeName(schema: ZodSchemaLike): string | undefined;
88
51
  /** `getTypeName` with `'unknown'` for a node that has no readable name. */
89
52
  export declare function typeOf(schema: ZodSchemaLike): string;
90
53
  /**
91
- * The schema at `def[key]`, if it actually holds one. The object check is
92
- * load-bearing: `_def` is untyped data from someone else's package, and a key
93
- * holding a string or function must read as absent, not as a schema. (The
94
- * v3-era version of this helper took a key *list* and returned the first
95
- * match; with one dialect there is no precedence left to encode.)
54
+ * The schema at `def[key]`, if it actually holds one. `_def` is untyped data
55
+ * from someone else's package, so a key holding a string or function must read
56
+ * as absent rather than as a schema.
96
57
  */
97
58
  export declare function schemaAt(def: Record<string, unknown>, key: string): ZodSchemaLike | undefined;
98
59
  /** The schema wrapped by a single-child wrapper (`.optional()`, `.readonly()`, `.catch()`, …) — always `_def.innerType` in zod 4. */
@@ -102,17 +63,15 @@ export declare function arrayElement(def: Record<string, unknown>): ZodSchemaLik
102
63
  /** A record's value schema — `_def.valueType`. */
103
64
  export declare function recordValueType(def: Record<string, unknown>): ZodSchemaLike | undefined;
104
65
  /**
105
- * Whether this node is a `.transform()`'s output half — a wrapped function
106
- * with no type to read, as opposed to a schema that genuinely parses to
107
- * `unknown`.
66
+ * Whether this node is a `.transform()`'s output half — a wrapped function with
67
+ * no type to read, as opposed to a schema that parses to `unknown`.
108
68
  */
109
69
  export declare function isTransform(schema: ZodSchemaLike): boolean;
110
70
  /**
111
- * Both halves of a `.pipe()`. Zod 4 uses one `pipe` node for both `.pipe()`
112
- * and `.transform()`: `_def.in` is what a caller sends, `_def.out` what a
113
- * controller receives — except for a transform, whose out side is the
114
- * transform function itself and so has no type to read. `to` is therefore
115
- * absent for a transform, leaving `from` as the only readable answer.
71
+ * Both halves of a `.pipe()`. Zod 4 uses one `pipe` node for `.pipe()` and
72
+ * `.transform()` alike: `_def.in` is what a caller sends, `_def.out` what a
73
+ * controller receives — except for a transform, whose out side is the function
74
+ * itself, so `to` is absent and `from` is the only readable answer.
116
75
  */
117
76
  export declare function pipeSides(def: Record<string, unknown>): {
118
77
  from: ZodSchemaLike | undefined;
@@ -123,79 +82,53 @@ export declare function pipeSide(def: Record<string, unknown>, io: SchemaIo): Zo
123
82
  /** An object's property map — `_def.shape`, or the schema's own `.shape`. */
124
83
  export declare function objectShape(schema: ZodSchemaLike): Record<string, ZodSchemaLike> | undefined;
125
84
  /**
126
- * An enum's accepted values, read from zod's own computed set at
127
- * `_zod.values` rather than re-derived from `_def.entries`. The distinction
128
- * matters because `z.nativeEnum` produces the same node and a real TypeScript
129
- * numeric enum's runtime object carries reverse mappings (`{ A: 0, '0': 'A' }`)
130
- * — and any hand-rolled filter for those has a false positive: in
131
- * `{ A: 'B', B: 1 }`, the key `A` *looks* like a reverse entry (`entries['B']`
132
- * is a number) but zod accepts `'B'`. Reading zod's set makes what we document
133
- * what zod parses, by construction. The `entries` fallback (values unfiltered)
134
- * only runs if a future zod 4.x stops exposing the set.
85
+ * An enum's accepted values, from zod's computed `_zod.values` rather than
86
+ * re-derived from `_def.entries`: `z.nativeEnum` produces the same node, and a
87
+ * numeric enum's reverse mappings cannot be filtered without false positives
88
+ * (in `{ A: 'B', B: 1 }` the key `A` looks like one, yet zod accepts `'B'`).
89
+ * The `entries` fallback only runs if a future zod 4.x stops exposing the set.
135
90
  */
136
91
  export declare function enumValues(schema: ZodSchemaLike): Array<string | number>;
137
92
  /**
138
- * The refinements attached to a node (`.min()`, `.regex()`, `.multipleOf()`, …),
139
- * normalized to the definition objects zod keeps at each entry's `_zod.def`.
140
- *
141
- * Reading through `_zod.def` rather than the entry itself is what makes the
142
- * list uniform: `_def.checks` is heterogeneous by construction. A plain
143
- * refinement (`z.string().min(2)`) is stored as a bare check object, while a
144
- * format method (`z.string().url()`) stores the *format schema* — a full node
145
- * with `parse`, `safeParse` and the rest — in the same array. Both carry the
146
- * check definition at `_zod.def`, and nothing else about them is shared.
147
- *
148
- * Entries without a string `check` are dropped rather than passed through: a
149
- * caller switches on that discriminator, so an entry that has none can only be
150
- * misread.
93
+ * The refinements attached to a node, normalized to the definitions zod keeps
94
+ * at each entry's `_zod.def`. That indirection is what makes the list uniform:
95
+ * `_def.checks` mixes bare check objects (`z.string().min(2)`) with whole
96
+ * format schemas (`z.string().url()`), sharing only `_zod.def`. Entries without
97
+ * a string `check` are dropped — a caller switches on that discriminator.
151
98
  */
152
99
  export declare function schemaChecks(schema: ZodSchemaLike): ZodCheckDef[];
153
100
  /**
154
- * The node's declared format, if it has one — `'email'` for `z.email()`,
155
- * `'safeint'` for `z.int()`.
156
- *
157
- * This is only *half* of how zod 4 records a format, and the half a caller is
158
- * likeliest to forget. The top-level constructors (`z.email()`, `z.iso.datetime()`)
159
- * set `_def.format` and attach no check; the equivalent string methods
160
- * (`z.string().email()`, `z.string().datetime()`) attach a `string_format`
161
- * check and leave `_def.format` undefined. A reader that wants "the format of
162
- * this schema" has to consult both this and `schemaChecks`.
101
+ * The node's declared format (`'email'` for `z.email()`), which is only half of
102
+ * how zod 4 records one: top-level constructors set `_def.format` and attach no
103
+ * check, while the string methods (`z.string().email()`) attach a
104
+ * `string_format` check and leave `_def.format` undefined. A reader wanting
105
+ * "the format of this schema" must consult this *and* `schemaChecks`.
163
106
  */
164
107
  export declare function schemaFormat(schema: ZodSchemaLike): string | undefined;
165
108
  /** A literal's values — always the `_def.values` array in zod 4, which may hold more than one. */
166
109
  export declare function literalValues(def: Record<string, unknown>): unknown[];
167
110
  /**
168
- * Wrappers that neither add to a rendered type nor decide whether a field may
169
- * be omitted — whatever they wrap answers both questions. (`lazy` is here for
170
- * membership only: its child hides behind `_def.getter`, which no walker
171
- * calls, so looking through it reads as "contents unavailable" rather than
172
- * "unsupported type".)
111
+ * Wrappers that neither add to a rendered type nor decide omissibility.
112
+ * (`lazy` is here for membership only: its child hides behind `_def.getter`,
113
+ * which no walker calls, so it reads as "contents unavailable".)
173
114
  */
174
115
  export declare const TRANSPARENT_WRAPPERS: ReadonlySet<string>;
175
116
  /**
176
- * Wrappers that pass their type through but *do* decide presence: each makes a
177
- * field omissible, or (in `nonoptional`'s case) re-requires one.
117
+ * Wrappers passing their type through but deciding presence: each makes a field
118
+ * omissible, or (`nonoptional`) re-requires one.
178
119
  */
179
120
  export declare const PRESENCE_WRAPPERS: ReadonlySet<string>;
180
121
  /**
181
- * Every type name that carries exactly one nested schema and no shape of its
182
- * own — the union of the two sets above plus the two that render specially
183
- * (`nullable` becomes a union with null; a pipe holds one schema per side).
184
- *
185
- * This is the vocabulary, not a policy: callers partition it however their
186
- * rendering needs (the CLI splits transparent from presence-deciding because
187
- * it walks types and presence separately; the JSON Schema walker looks through all
188
- * of them uniformly). What none of them may do is disagree about *membership*
189
- * — a name known to one walker and not the other silently changes an output,
190
- * which is why the list lives here rather than once per package.
122
+ * Every type name carrying exactly one nested schema and no shape of its own —
123
+ * the two sets above plus the two that render specially (`nullable` becomes a
124
+ * union with null; a pipe holds one schema per side). Vocabulary, not policy:
125
+ * callers partition it as their rendering needs, but a name known to one walker
126
+ * and not another silently changes an output, so membership lives here.
191
127
  */
192
128
  export declare const SINGLE_CHILD_WRAPPERS: ReadonlySet<string>;
193
129
  /**
194
130
  * The schema a single-child wrapper wraps, in the direction being read; absent
195
- * for a node that is not a wrapper, or one whose child cannot be reached
196
- * (`z.lazy()` hides its schema behind a getter no walker calls).
197
- *
198
- * Membership comes from the set above, for the reason stated there; a pipe
199
- * resolves per direction, for the reason stated on `pipeSides`.
131
+ * for a non-wrapper, or one whose child cannot be reached (`z.lazy()` hides its
132
+ * schema behind a getter no walker calls).
200
133
  */
201
134
  export declare function unwrapSingleChild(schema: ZodSchemaLike, io: SchemaIo): ZodSchemaLike | undefined;
@@ -1,7 +1,6 @@
1
1
  //#region src/internal/zod-compat.ts
2
2
  /**
3
- * Whether this node was authored with the zod 3 API. Only v3 sets
4
- * `_def.typeName` (`"ZodString"`), so its presence is the discriminator —
3
+ * Only zod 3 sets `_def.typeName`, so its presence is the discriminator —
5
4
  * checked before any other read, because on a v3 node `_def.type` holds a
6
5
  * nested *schema* and every v4-shaped read below would misfire on it.
7
6
  */
@@ -9,8 +8,8 @@ function isZod3Schema(schema) {
9
8
  return typeof schema._def?.typeName === "string";
10
9
  }
11
10
  /**
12
- * The one refusal message, stated once so the CLI's console warning and the
13
- * OpenAPI document's warnings array cannot drift apart.
11
+ * The one refusal message, so the CLI's console warning and the OpenAPI
12
+ * document's warnings array cannot drift apart.
14
13
  */
15
14
  const ZOD3_UNSUPPORTED_MESSAGE = "this schema was authored with the zod v3 API (zod@3 or the zod/v3 subpath), which Guren does not support. Rewrite it with the zod 4 API (`import { z } from 'zod'`).";
16
15
  /** The node's type name: `_def.type` (`"string"`, `"object"`, …) or the schema's own `.type`. */
@@ -23,11 +22,9 @@ function typeOf(schema) {
23
22
  return getTypeName(schema) ?? "unknown";
24
23
  }
25
24
  /**
26
- * The schema at `def[key]`, if it actually holds one. The object check is
27
- * load-bearing: `_def` is untyped data from someone else's package, and a key
28
- * holding a string or function must read as absent, not as a schema. (The
29
- * v3-era version of this helper took a key *list* and returned the first
30
- * match; with one dialect there is no precedence left to encode.)
25
+ * The schema at `def[key]`, if it actually holds one. `_def` is untyped data
26
+ * from someone else's package, so a key holding a string or function must read
27
+ * as absent rather than as a schema.
31
28
  */
32
29
  function schemaAt(def, key) {
33
30
  const candidate = def[key];
@@ -46,19 +43,17 @@ function recordValueType(def) {
46
43
  return schemaAt(def, "valueType");
47
44
  }
48
45
  /**
49
- * Whether this node is a `.transform()`'s output half — a wrapped function
50
- * with no type to read, as opposed to a schema that genuinely parses to
51
- * `unknown`.
46
+ * Whether this node is a `.transform()`'s output half — a wrapped function with
47
+ * no type to read, as opposed to a schema that parses to `unknown`.
52
48
  */
53
49
  function isTransform(schema) {
54
50
  return typeOf(schema) === "transform";
55
51
  }
56
52
  /**
57
- * Both halves of a `.pipe()`. Zod 4 uses one `pipe` node for both `.pipe()`
58
- * and `.transform()`: `_def.in` is what a caller sends, `_def.out` what a
59
- * controller receives — except for a transform, whose out side is the
60
- * transform function itself and so has no type to read. `to` is therefore
61
- * absent for a transform, leaving `from` as the only readable answer.
53
+ * Both halves of a `.pipe()`. Zod 4 uses one `pipe` node for `.pipe()` and
54
+ * `.transform()` alike: `_def.in` is what a caller sends, `_def.out` what a
55
+ * controller receives — except for a transform, whose out side is the function
56
+ * itself, so `to` is absent and `from` is the only readable answer.
62
57
  */
63
58
  function pipeSides(def) {
64
59
  const to = schemaAt(def, "out");
@@ -77,15 +72,11 @@ function objectShape(schema) {
77
72
  return (schema._def ?? {}).shape ?? schema.shape;
78
73
  }
79
74
  /**
80
- * An enum's accepted values, read from zod's own computed set at
81
- * `_zod.values` rather than re-derived from `_def.entries`. The distinction
82
- * matters because `z.nativeEnum` produces the same node and a real TypeScript
83
- * numeric enum's runtime object carries reverse mappings (`{ A: 0, '0': 'A' }`)
84
- * — and any hand-rolled filter for those has a false positive: in
85
- * `{ A: 'B', B: 1 }`, the key `A` *looks* like a reverse entry (`entries['B']`
86
- * is a number) but zod accepts `'B'`. Reading zod's set makes what we document
87
- * what zod parses, by construction. The `entries` fallback (values unfiltered)
88
- * only runs if a future zod 4.x stops exposing the set.
75
+ * An enum's accepted values, from zod's computed `_zod.values` rather than
76
+ * re-derived from `_def.entries`: `z.nativeEnum` produces the same node, and a
77
+ * numeric enum's reverse mappings cannot be filtered without false positives
78
+ * (in `{ A: 'B', B: 1 }` the key `A` looks like one, yet zod accepts `'B'`).
79
+ * The `entries` fallback only runs if a future zod 4.x stops exposing the set.
89
80
  */
90
81
  function enumValues(schema) {
91
82
  const values = schema._zod?.values;
@@ -94,19 +85,11 @@ function enumValues(schema) {
94
85
  return entries ? Object.values(entries) : [];
95
86
  }
96
87
  /**
97
- * The refinements attached to a node (`.min()`, `.regex()`, `.multipleOf()`, …),
98
- * normalized to the definition objects zod keeps at each entry's `_zod.def`.
99
- *
100
- * Reading through `_zod.def` rather than the entry itself is what makes the
101
- * list uniform: `_def.checks` is heterogeneous by construction. A plain
102
- * refinement (`z.string().min(2)`) is stored as a bare check object, while a
103
- * format method (`z.string().url()`) stores the *format schema* — a full node
104
- * with `parse`, `safeParse` and the rest — in the same array. Both carry the
105
- * check definition at `_zod.def`, and nothing else about them is shared.
106
- *
107
- * Entries without a string `check` are dropped rather than passed through: a
108
- * caller switches on that discriminator, so an entry that has none can only be
109
- * misread.
88
+ * The refinements attached to a node, normalized to the definitions zod keeps
89
+ * at each entry's `_zod.def`. That indirection is what makes the list uniform:
90
+ * `_def.checks` mixes bare check objects (`z.string().min(2)`) with whole
91
+ * format schemas (`z.string().url()`), sharing only `_zod.def`. Entries without
92
+ * a string `check` are dropped — a caller switches on that discriminator.
110
93
  */
111
94
  function schemaChecks(schema) {
112
95
  const checks = schema._def?.checks;
@@ -117,15 +100,11 @@ function schemaChecks(schema) {
117
100
  });
118
101
  }
119
102
  /**
120
- * The node's declared format, if it has one — `'email'` for `z.email()`,
121
- * `'safeint'` for `z.int()`.
122
- *
123
- * This is only *half* of how zod 4 records a format, and the half a caller is
124
- * likeliest to forget. The top-level constructors (`z.email()`, `z.iso.datetime()`)
125
- * set `_def.format` and attach no check; the equivalent string methods
126
- * (`z.string().email()`, `z.string().datetime()`) attach a `string_format`
127
- * check and leave `_def.format` undefined. A reader that wants "the format of
128
- * this schema" has to consult both this and `schemaChecks`.
103
+ * The node's declared format (`'email'` for `z.email()`), which is only half of
104
+ * how zod 4 records one: top-level constructors set `_def.format` and attach no
105
+ * check, while the string methods (`z.string().email()`) attach a
106
+ * `string_format` check and leave `_def.format` undefined. A reader wanting
107
+ * "the format of this schema" must consult this *and* `schemaChecks`.
129
108
  */
130
109
  function schemaFormat(schema) {
131
110
  const format = schema._def?.format;
@@ -136,11 +115,9 @@ function literalValues(def) {
136
115
  return Array.isArray(def.values) ? def.values : [];
137
116
  }
138
117
  /**
139
- * Wrappers that neither add to a rendered type nor decide whether a field may
140
- * be omitted — whatever they wrap answers both questions. (`lazy` is here for
141
- * membership only: its child hides behind `_def.getter`, which no walker
142
- * calls, so looking through it reads as "contents unavailable" rather than
143
- * "unsupported type".)
118
+ * Wrappers that neither add to a rendered type nor decide omissibility.
119
+ * (`lazy` is here for membership only: its child hides behind `_def.getter`,
120
+ * which no walker calls, so it reads as "contents unavailable".)
144
121
  */
145
122
  const TRANSPARENT_WRAPPERS = /* @__PURE__ */ new Set([
146
123
  "catch",
@@ -148,8 +125,8 @@ const TRANSPARENT_WRAPPERS = /* @__PURE__ */ new Set([
148
125
  "lazy"
149
126
  ]);
150
127
  /**
151
- * Wrappers that pass their type through but *do* decide presence: each makes a
152
- * field omissible, or (in `nonoptional`'s case) re-requires one.
128
+ * Wrappers passing their type through but deciding presence: each makes a field
129
+ * omissible, or (`nonoptional`) re-requires one.
153
130
  */
154
131
  const PRESENCE_WRAPPERS = /* @__PURE__ */ new Set([
155
132
  "optional",
@@ -158,16 +135,11 @@ const PRESENCE_WRAPPERS = /* @__PURE__ */ new Set([
158
135
  "nonoptional"
159
136
  ]);
160
137
  /**
161
- * Every type name that carries exactly one nested schema and no shape of its
162
- * own — the union of the two sets above plus the two that render specially
163
- * (`nullable` becomes a union with null; a pipe holds one schema per side).
164
- *
165
- * This is the vocabulary, not a policy: callers partition it however their
166
- * rendering needs (the CLI splits transparent from presence-deciding because
167
- * it walks types and presence separately; the JSON Schema walker looks through all
168
- * of them uniformly). What none of them may do is disagree about *membership*
169
- * — a name known to one walker and not the other silently changes an output,
170
- * which is why the list lives here rather than once per package.
138
+ * Every type name carrying exactly one nested schema and no shape of its own —
139
+ * the two sets above plus the two that render specially (`nullable` becomes a
140
+ * union with null; a pipe holds one schema per side). Vocabulary, not policy:
141
+ * callers partition it as their rendering needs, but a name known to one walker
142
+ * and not another silently changes an output, so membership lives here.
171
143
  */
172
144
  const SINGLE_CHILD_WRAPPERS = /* @__PURE__ */ new Set([
173
145
  ...TRANSPARENT_WRAPPERS,
@@ -177,11 +149,8 @@ const SINGLE_CHILD_WRAPPERS = /* @__PURE__ */ new Set([
177
149
  ]);
178
150
  /**
179
151
  * The schema a single-child wrapper wraps, in the direction being read; absent
180
- * for a node that is not a wrapper, or one whose child cannot be reached
181
- * (`z.lazy()` hides its schema behind a getter no walker calls).
182
- *
183
- * Membership comes from the set above, for the reason stated there; a pipe
184
- * resolves per direction, for the reason stated on `pipeSides`.
152
+ * for a non-wrapper, or one whose child cannot be reached (`z.lazy()` hides its
153
+ * schema behind a getter no walker calls).
185
154
  */
186
155
  function unwrapSingleChild(schema, io) {
187
156
  const def = schema._def ?? {};