@guren/server 2.15.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 (296) hide show
  1. package/dist/{DocsViewerServiceProvider-qFCaeiUv.js → DocsViewerServiceProvider-D2cuVgtN.js} +7 -12
  2. package/dist/{Hash-C8aejmi8.js → Hash-D2DFd8xX.js} +7 -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 +11 -39
  8. package/dist/agent/approval.d.ts +76 -187
  9. package/dist/agent/audit-emitter.d.ts +16 -44
  10. package/dist/agent/audit.d.ts +20 -56
  11. package/dist/agent/derive.d.ts +32 -66
  12. package/dist/agent/dispatch.d.ts +38 -90
  13. package/dist/agent/events.d.ts +11 -19
  14. package/dist/agent/meta-tools.d.ts +18 -46
  15. package/dist/agent/public.d.ts +6 -25
  16. package/dist/agent/public.js +1 -1
  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 +5 -14
  29. package/dist/auth/password/PasswordHasher.d.ts +5 -13
  30. package/dist/auth/password/hash-format.d.ts +5 -13
  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-DkYoAPVn.js → auth-CbdPH4Cd.js} +169 -502
  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-BwodCA4q.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 +5 -26
  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-erOS9epZ.js → dispatch-BAwzftws.js} +32 -79
  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-D99Vmls3.js → encryption-uwP3Di4D.js} +9 -78
  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 +13 -31
  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 +11 -7
  148. package/dist/http/request.d.ts +32 -118
  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 +10 -20
  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 +2 -1
  170. package/dist/index.js +714 -3011
  171. package/dist/internal/agent-preflight.d.ts +9 -21
  172. package/dist/internal/request.d.ts +6 -19
  173. package/dist/internal/request.js +1 -1
  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 -3
  187. package/dist/logging/channels/FileChannel.d.ts +1 -3
  188. package/dist/logging/daily-file-path.d.ts +7 -16
  189. package/dist/logging/index.js +1 -1
  190. package/dist/logging/types.d.ts +13 -45
  191. package/dist/{logging-B-kngi3q.js → logging-zOY1XCtq.js} +52 -141
  192. package/dist/{loopback-guard-D0Kc7-xc.js → loopback-guard-DT9gHF0F.js} +41 -92
  193. package/dist/mail/Mail.d.ts +10 -106
  194. package/dist/mail/MailManager.d.ts +2 -60
  195. package/dist/mail/index.js +1 -1
  196. package/dist/mail/transports/LogTransport.d.ts +1 -4
  197. package/dist/mail/transports/MemoryTransport.d.ts +1 -63
  198. package/dist/mail/transports/ResendTransport.d.ts +1 -23
  199. package/dist/mail/transports/SmtpTransport.d.ts +1 -31
  200. package/dist/mail/types.d.ts +28 -150
  201. package/dist/{mail-DfEfSQEr.js → mail-76DWy9lj.js} +31 -289
  202. package/dist/mcp/McpServiceProvider.d.ts +4 -10
  203. package/dist/mcp/create-mcp-server.d.ts +25 -57
  204. package/dist/mcp/endpoint.d.ts +12 -36
  205. package/dist/mcp/index.js +1 -1
  206. package/dist/mvc/Controller.d.ts +46 -227
  207. package/dist/mvc/Router.d.ts +50 -129
  208. package/dist/mvc/inertia/InertiaEngine.d.ts +18 -48
  209. package/dist/mvc/inertia/shared.d.ts +6 -19
  210. package/dist/mvc/mount-route.d.ts +2 -6
  211. package/dist/mvc/view.d.ts +1 -2
  212. package/dist/notifications/Notification.d.ts +8 -75
  213. package/dist/notifications/NotificationManager.d.ts +15 -88
  214. package/dist/notifications/channels/DatabaseChannel.d.ts +1 -41
  215. package/dist/notifications/channels/MailChannel.d.ts +2 -31
  216. package/dist/notifications/channels/MemoryChannel.d.ts +2 -62
  217. package/dist/notifications/channels/SlackChannel.d.ts +3 -48
  218. package/dist/notifications/index.js +1 -1
  219. package/dist/notifications/notifiable-type.d.ts +3 -6
  220. package/dist/notifications/registry.d.ts +8 -27
  221. package/dist/notifications/types.d.ts +16 -53
  222. package/dist/{notifications-BGqmUNZ8.js → notifications-okWFs9ly.js} +37 -335
  223. package/dist/providers/AuthServiceProvider.d.ts +1 -3
  224. package/dist/providers/AuthorizationServiceProvider.d.ts +2 -3
  225. package/dist/providers/BroadcastServiceProvider.d.ts +1 -3
  226. package/dist/providers/CacheServiceProvider.d.ts +1 -3
  227. package/dist/providers/EncryptionServiceProvider.d.ts +1 -3
  228. package/dist/providers/ErrorServiceProvider.d.ts +1 -4
  229. package/dist/providers/EventServiceProvider.d.ts +1 -3
  230. package/dist/providers/HealthServiceProvider.d.ts +1 -3
  231. package/dist/providers/I18nServiceProvider.d.ts +6 -10
  232. package/dist/providers/InertiaServiceProvider.d.ts +1 -4
  233. package/dist/providers/LogServiceProvider.d.ts +1 -3
  234. package/dist/providers/MailServiceProvider.d.ts +1 -3
  235. package/dist/providers/NotificationServiceProvider.d.ts +1 -3
  236. package/dist/providers/OAuthServiceProvider.d.ts +1 -3
  237. package/dist/providers/QueueServiceProvider.d.ts +1 -3
  238. package/dist/providers/SchedulingServiceProvider.d.ts +1 -3
  239. package/dist/providers/StorageServiceProvider.d.ts +1 -3
  240. package/dist/queue/FailedJobReporter.d.ts +1 -24
  241. package/dist/queue/Job.d.ts +12 -99
  242. package/dist/queue/QueueManager.d.ts +6 -57
  243. package/dist/queue/Worker.d.ts +4 -65
  244. package/dist/queue/drivers/MemoryDriver.d.ts +3 -44
  245. package/dist/queue/drivers/RedisDriver.d.ts +7 -65
  246. package/dist/queue/drivers/SqsDriver.d.ts +6 -57
  247. package/dist/queue/drivers/SyncDriver.d.ts +10 -13
  248. package/dist/queue/index.js +2 -2
  249. package/dist/queue/types.d.ts +10 -92
  250. package/dist/{queue-CXrRK85G.js → queue-CcXCjuJI.js} +32 -260
  251. package/dist/redis/RedisApiTokenStore.d.ts +4 -56
  252. package/dist/redis/RedisEmailVerificationStore.d.ts +4 -37
  253. package/dist/redis/RedisOAuthStateStore.d.ts +2 -10
  254. package/dist/redis/RedisPasswordResetStore.d.ts +4 -37
  255. package/dist/redis/RedisRateLimitStore.d.ts +16 -49
  256. package/dist/redis/RedisSessionStore.d.ts +3 -44
  257. package/dist/redis/client.d.ts +2 -32
  258. package/dist/redis/index.js +47 -232
  259. package/dist/redis/redis-values.d.ts +6 -12
  260. package/dist/redis/scan-keys.d.ts +1 -4
  261. package/dist/request-CLOYytGP.js +68 -0
  262. package/dist/runtime/index.d.ts +2 -0
  263. package/dist/runtime/index.js +50 -92
  264. package/dist/scheduling/CronParser.d.ts +0 -29
  265. package/dist/scheduling/Schedule.d.ts +1 -153
  266. package/dist/scheduling/ScheduledTask.d.ts +0 -31
  267. package/dist/scheduling/Scheduler.d.ts +0 -70
  268. package/dist/scheduling/index.js +1 -1
  269. package/dist/scheduling/types.d.ts +4 -65
  270. package/dist/{scheduling-CPiEdtQd.js → scheduling-C6tcOtUl.js} +2 -287
  271. package/dist/storage/StorageManager.d.ts +0 -48
  272. package/dist/storage/drivers/LocalDriver.d.ts +1 -25
  273. package/dist/storage/drivers/MemoryDriver.d.ts +5 -35
  274. package/dist/storage/drivers/S3Driver.d.ts +6 -36
  275. package/dist/storage/drivers/s3-acl.d.ts +5 -10
  276. package/dist/storage/index.js +1 -1
  277. package/dist/storage/types.d.ts +27 -265
  278. package/dist/{storage-TLD9t0Q2.js → storage-BB59f07j.js} +17 -157
  279. package/dist/support/contained-path.d.ts +10 -20
  280. package/dist/support/error-polyfill.d.ts +4 -6
  281. package/dist/support/expiry.d.ts +17 -33
  282. package/dist/support/expiry.js +17 -33
  283. package/dist/support/import-map.d.ts +3 -7
  284. package/dist/support/inertia-defaults.d.ts +5 -10
  285. package/dist/support/redirect-target.d.ts +4 -6
  286. package/dist/support/stack-frames.d.ts +11 -50
  287. package/dist/support/trim-slashes.d.ts +4 -7
  288. package/dist/support/warn-once.d.ts +2 -6
  289. package/dist/{trim-slashes-ZJ_VsY5s.js → trim-slashes-BLY9hKAa.js} +4 -7
  290. package/dist/{vite-manifest-w_RSOvQW.js → vite-manifest-CTQp-SOo.js} +34 -58
  291. package/package.json +2 -2
  292. package/dist/client-Dd7vLcqp.js +0 -27
  293. package/dist/context-DoD0c7J_.js +0 -26
  294. package/dist/endpoint-D-20PiHY.js +0 -46
  295. package/dist/hot-disposables-WsTX2ySN.js +0 -281
  296. package/dist/request-CVQwpu2J.js +0 -129
@@ -1,56 +1,17 @@
1
1
  /**
2
- * Which `(` opens the parenthesized location group at the end of a stack frame.
2
+ * Which `(` opens the location group at the end of a stack frame — the one
3
+ * question the package's two frame readers share (the debug page's
4
+ * `parseStackTrace` and the hot-reload registry's `parseFrameLocation`), so
5
+ * every parenthesis fix belongs here and they cannot drift.
3
6
  *
4
- * That one question is all the package's two frame readers agree on — the debug
5
- * error page's `parseStackTrace` and the hot-reload registry's
6
- * `parseFrameLocation`. Everything after it differs on purpose: peeling
7
- * `:line[:column]` off the right (the page requires a column and keeps the
8
- * function name; the registry accepts a bare `:line`), and deciding which
9
- * locations are worth keeping at all (the registry rejects `eval` groups and
10
- * synthetic paths, because keying an owner on text that is not a path is worse
11
- * than not keying it; the page is happy to display whatever it was handed).
12
- * Keep every parenthesis fix here so those two cannot drift.
13
- *
14
- * A third reader, `packages/orm/src/active-connections.ts`, carries a copy of
15
- * the function below whose *body* is identical character for character; only
16
- * the prose around it differs, to speak about connections rather than frames.
17
- * That package must not import this one, so the two are kept in step by hand —
18
- * fix both, or neither.
7
+ * `packages/orm/src/active-connections.ts` carries a character-identical copy
8
+ * of the function below and must not import this one: fix both, or neither.
19
9
  */
20
10
  /**
21
- * The index of the `(` that matches the `)` at `closeIndex`, or `undefined`
22
- * when the frame carries no usable `(` at all.
23
- *
24
- * `closeIndex` is a parameter rather than derived here because each caller
25
- * already knows where its frame ends and gets there differently — two trim a
26
- * copy of the frame, the ORM's twin keeps an `end` offset to avoid allocating
27
- * one. It must point at the frame's final `)`; anything else is rejected.
28
- *
29
- * Neither the leftmost nor the rightmost `(` is right in general. A path may
30
- * contain one — `at fn (/app (old)/x.ts:1:2)` needs the outer, *leftmost* pair
31
- * — and so may the function name in front of it — `at weird (name)
32
- * (/app/x.ts:1:2)` needs the outer, *rightmost* pair. Depth is what actually
33
- * tells the two apart; a fixed "first" or "last" gets one of them wrong, and a
34
- * frame carrying both — `at weird (name) (/app (old)/x.ts:1:2)`, which is one
35
- * developer's checkout directory away from ordinary — is misread by either.
36
- *
37
- * A scan is also the only form that stays linear. Lazily matching from the
38
- * leftmost `(` retries the whole suffix at every parenthesis, which is
39
- * quadratic on a frame carrying many unmatched ones. Characters are compared by
40
- * code rather than tested against a pattern for the same reason the patterns
41
- * went: this loop runs over every character of every frame, and the one input
42
- * whose length nothing bounds is a frame — an error message can embed
43
- * request-derived text, and a continuation line of one that starts `at ` and
44
- * ends `)` is scanned in full.
45
- *
46
- * Depth alone would reject a frame whose location holds an *unmatched* `)`, as
47
- * `/app/name).ts` or a URL ending `?label=)` does — the scan runs off the front
48
- * still owing a paren, and the frame is dropped rather than displayed. So the
49
- * leftmost `(` the scan passed is kept as a fallback for exactly that case.
50
- * Only frames the depth rule rejects outright can reach it, so it is never
51
- * worse than depth alone, and it is the reading that keeps such a path whole.
52
- *
53
- * The scan stops at a line terminator: a path could never span one, so neither
54
- * a balanced `(` nor the fallback may come from the far side of a break.
11
+ * Depth, not a fixed "first" or "last": `at fn (/app (old)/x.ts:1:2)` needs the
12
+ * leftmost pair, `at weird (name) (/app/x.ts:1:2)` the rightmost. The leftmost
13
+ * `(` the scan passed is the fallback that saves a location carrying an
14
+ * unmatched `)` (`/app/name).ts`). Scanning by char code stays linear where
15
+ * lazy matching is quadratic, and nothing bounds a frame's length.
55
16
  */
56
17
  export declare function matchingOpenParen(frame: string, closeIndex: number): number | undefined;
@@ -1,12 +1,9 @@
1
1
  /**
2
- * Slash-trimming without regex: patterns like `/\/+$/` backtrack
3
- * quadratically on adversarial input (long slash runs mid-string), and
4
- * several call sites here feed request-derived paths.
2
+ * No regex: patterns like `/\/+$/` backtrack quadratically on long slash runs
3
+ * mid-string, and several call sites feed request-derived paths.
5
4
  *
6
- * Twins live in `@guren/cli` (`src/utils.ts`, `trimSlashes`) and
7
- * `@guren/plugin-cloudflare` (`src/storage/R2Driver.ts`, both functions);
8
- * neither package can import this module, so the lines are duplicated by
9
- * convention.
5
+ * Twins that cannot import this module: `@guren/cli` (`src/utils.ts`) and
6
+ * `@guren/plugin-cloudflare` (`src/storage/R2Driver.ts`) — keep them in step.
10
7
  */
11
8
  export declare function trimTrailingSlashes(value: string): string;
12
9
  export declare function trimSlashes(value: string): string;
@@ -1,10 +1,6 @@
1
1
  /**
2
- * Emit a warning the first time a given key is seen in this process.
3
- *
4
- * Deprecation warnings have to be loud enough to be read once and quiet
5
- * enough not to drown a request log, which is the same shape the OAuth
6
- * warnings settled on (`auth/oauth/index.ts`) — this is that pattern with a
7
- * key, so several call sites can share it.
2
+ * Warn the first time a key is seen in this process: loud enough to be read
3
+ * once, quiet enough not to drown a request log.
8
4
  */
9
5
  export declare function warnOnce(key: string, message: string): void;
10
6
  /** Test seam: forget what has already been warned about. */
@@ -1,13 +1,10 @@
1
1
  //#region src/support/trim-slashes.ts
2
2
  /**
3
- * Slash-trimming without regex: patterns like `/\/+$/` backtrack
4
- * quadratically on adversarial input (long slash runs mid-string), and
5
- * several call sites here feed request-derived paths.
3
+ * No regex: patterns like `/\/+$/` backtrack quadratically on long slash runs
4
+ * mid-string, and several call sites feed request-derived paths.
6
5
  *
7
- * Twins live in `@guren/cli` (`src/utils.ts`, `trimSlashes`) and
8
- * `@guren/plugin-cloudflare` (`src/storage/R2Driver.ts`, both functions);
9
- * neither package can import this module, so the lines are duplicated by
10
- * convention.
6
+ * Twins that cannot import this module: `@guren/cli` (`src/utils.ts`) and
7
+ * `@guren/plugin-cloudflare` (`src/storage/R2Driver.ts`) — keep them in step.
11
8
  */
12
9
  function trimTrailingSlashes(value) {
13
10
  let end = value.length;
@@ -1,4 +1,4 @@
1
- import { n as trimTrailingSlashes } from "./trim-slashes-ZJ_VsY5s.js";
1
+ import { n as trimTrailingSlashes } from "./trim-slashes-BLY9hKAa.js";
2
2
  import { resolve } from "node:path";
3
3
  import chalk from "chalk";
4
4
  import figlet from "figlet";
@@ -6,9 +6,8 @@ import standard from "figlet/importable-fonts/Standard.js";
6
6
  import { readFileSync } from "node:fs";
7
7
  //#region src/support/import-map.ts
8
8
  /**
9
- * Parses an import map JSON string into a record of module specifiers.
10
- * Empty, null, and undefined entries are ignored so callers can safely
11
- * merge optional overrides without additional filtering.
9
+ * Empty, null and undefined entries are dropped, so callers can merge optional
10
+ * overrides without filtering first.
12
11
  */
13
12
  function parseImportMap(value, options = {}) {
14
13
  if (!value) return {};
@@ -26,21 +25,16 @@ function parseImportMap(value, options = {}) {
26
25
  //#endregion
27
26
  //#region src/support/inertia-defaults.ts
28
27
  /**
29
- * The stylesheet *source* path the dev asset configuration falls back to.
30
- *
31
- * Lives in a leaf module because two sides read it and must agree: the dev
32
- * configuration in `http/inertia-assets.ts` publishes it into
33
- * `GUREN_INERTIA_STYLES`, and the document renderer in
34
- * `mvc/inertia/InertiaEngine.ts` drops exactly this path again when a dev
35
- * server owns the script entry (the compiled CSS then arrives through the
36
- * module graph). Importing either of those modules from the other would drag
37
- * runtime-specific dependencies across the Workers/Lambda boundary or create
38
- * an import cycle.
28
+ * The stylesheet *source* path the dev asset configuration falls back to. A
29
+ * leaf module because two sides must agree on it: `http/inertia-assets.ts`
30
+ * publishes it into `GUREN_INERTIA_STYLES` and `mvc/inertia/InertiaEngine.ts`
31
+ * drops exactly this path when a dev server owns the script entry. Importing
32
+ * either from the other would cross the Workers/Lambda boundary or cycle.
39
33
  */
40
34
  const DEFAULT_DEV_STYLES_ENTRY = "/resources/css/app.css";
41
35
  //#endregion
42
36
  //#region package.json
43
- var version = "2.15.0";
37
+ var version = "2.16.0";
44
38
  //#endregion
45
39
  //#region src/http/dev-banner.ts
46
40
  figlet.parseFont("Standard", standard);
@@ -60,11 +54,8 @@ const GUREN_ASCII_ART = chalk.redBright.bold(generateAsciiArt("GUREN"));
60
54
  const GUREN_VERSION = version;
61
55
  /**
62
56
  * A wildcard bind answers on every interface but is not itself dialable on
63
- * every platform.
64
- *
65
- * Lives here rather than beside its other caller because the banner and
66
- * `Application.listen()`'s returned address are two renderings of one fact,
67
- * and a platform caveat added to only one of them is the drift this replaces.
57
+ * every platform. Shared with `Application.listen()`'s returned address, which
58
+ * is the same fact rendered twice.
68
59
  */
69
60
  function isWildcardHost(hostname) {
70
61
  return hostname === "0.0.0.0" || hostname === "::";
@@ -97,11 +88,9 @@ function logDevServerBanner({ hostname, port, assetsUrl = "http://localhost:5173
97
88
  //#endregion
98
89
  //#region src/http/vite-dev-server.ts
99
90
  /**
100
- * Build the inline config the managed dev server starts with.
101
- *
102
- * `server.host` is only set when the caller asked for one. Left undefined it
103
- * is dropped during Vite's config merge, so the project's own `vite.config.ts`
104
- * decides, falling back to Vite's localhost-only default.
91
+ * Build the inline config the managed dev server starts with. `server.host` is
92
+ * left undefined unless asked for, so Vite's config merge drops it and the
93
+ * project's own `vite.config.ts` decides.
105
94
  */
106
95
  function resolveViteDevServerConfig(options = {}) {
107
96
  const { root = process.cwd(), config = {}, host, port } = options;
@@ -112,7 +101,7 @@ function resolveViteDevServerConfig(options = {}) {
112
101
  server: {
113
102
  host,
114
103
  port,
115
- ...config.server ?? {}
104
+ ...config.server
116
105
  }
117
106
  };
118
107
  }
@@ -133,13 +122,11 @@ async function startViteDevServer(options = {}) {
133
122
  //#endregion
134
123
  //#region src/http/vite-manifest.ts
135
124
  /**
136
- * The one rule for how Vite build output is found and addressed, shared
137
- * between the Inertia asset wiring (`inertia-assets.ts`) and the content-page
138
- * `viteAsset()` helper (`vite-assets.ts`, RFC 0014): what counts as a
139
- * manifest, where one may live (a filesystem path, or the build-time
140
- * `GUREN_VITE_MANIFEST` injection for runtimes without one), which URL prefix
141
- * serves the hashed files, and what "the dev server is on" means. Factored
142
- * out so the two consumers cannot drift on any of it.
125
+ * The one rule for how Vite build output is found and addressed, shared by the
126
+ * Inertia asset wiring (`inertia-assets.ts`) and `viteAsset()` (`vite-assets.ts`,
127
+ * RFC 0014) so the two cannot drift: what counts as a manifest, where one may
128
+ * live, which URL prefix serves the hashed files, and what "the dev server is
129
+ * on" means.
143
130
  */
144
131
  /** Where `configureInertiaAssets` serves hashed build output from. */
145
132
  const PUBLIC_ASSETS_URL_PREFIX = "/public/assets/";
@@ -161,33 +148,26 @@ function normalizeDevServerUrl(value) {
161
148
  return stripped.length > 0 ? stripped : "/";
162
149
  }
163
150
  /**
164
- * Candidate client-manifest locations under a project root, in preference
165
- * order: `.vite/manifest.json` first, because Vite >= 5 writes it there — a
166
- * flat `manifest.json` beside it is most likely a stale leftover from an
167
- * older Vite config. The deploy plugins locate the same pair through
168
- * `@guren/core`'s deploy-build helpers, and the two orders must agree, or an
169
- * app with both layouts resolves different asset versions locally than after
170
- * a serverless deploy; `tests/http/vite-manifest.test.ts` pins the agreement.
171
- *
172
- * `baseDir` defaults to the working directory (`viteAsset()`'s anchor); the
173
- * Inertia wiring passes the root it derives from the app entry module.
151
+ * Candidate client-manifest locations, `.vite/manifest.json` first: Vite >= 5
152
+ * writes it there, so a flat `manifest.json` is likely a stale leftover. The
153
+ * deploy plugins order the same pair through `@guren/core`'s deploy-build
154
+ * helpers and must agree, or an app with both layouts resolves different asset
155
+ * versions after a serverless deploy; `tests/http/vite-manifest.test.ts` pins it.
174
156
  */
175
157
  function clientManifestCandidates(baseDir) {
176
158
  const root = baseDir ?? process.cwd();
177
159
  return [resolve(root, "public/assets/.vite/manifest.json"), resolve(root, "public/assets/manifest.json")];
178
160
  }
179
161
  /**
180
- * `__path__` label for a manifest injected through {@link injectedClientManifest},
181
- * so "entry not in the manifest" errors name the real source instead of a
182
- * filesystem path that was never read.
162
+ * `__path__` label for an injected manifest, so "entry not in the manifest"
163
+ * errors name the real source rather than a path that was never read.
183
164
  */
184
165
  const INJECTED_CLIENT_MANIFEST_SOURCE = "GUREN_VITE_MANIFEST (injected by the deploy build)";
185
166
  const INJECTED_MANIFEST_HINT = "It must hold the Vite client manifest text (deploy plugins inject it at build time), not a path.";
186
167
  /**
187
- * Attach one of the manifest's non-enumerable bookkeeping fields.
188
- * `enumerable: false` is the invariant both stamping sites must agree on — a
189
- * stamped field must never leak into `Object.keys` or a re-serialization of
190
- * the manifest.
168
+ * Attach one of the manifest's bookkeeping fields. `enumerable: false` is the
169
+ * invariant: a stamped field must never leak into `Object.keys` or a
170
+ * re-serialization of the manifest.
191
171
  */
192
172
  function defineHidden(manifest, key, value) {
193
173
  Object.defineProperty(manifest, key, {
@@ -197,14 +177,10 @@ function defineHidden(manifest, key, value) {
197
177
  }
198
178
  /**
199
179
  * The client manifest a deploy build injected for runtimes that do not ship
200
- * `public/assets/manifest.json`: `GUREN_VITE_MANIFEST` holds the manifest
201
- * *JSON text* (not a path). The deploy plugins populate it during their build
202
- * step — Workers and Lambda as an assignment in their generated entry module,
203
- * Vercel by substituting the read at bundle time.
204
- *
205
- * Fails loudly on a value that is set but not a manifest: falling through to
206
- * the filesystem would end in "run `bunx vite build`", a diagnosis pointing
207
- * away from the variable that is actually broken.
180
+ * `public/assets/manifest.json`: `GUREN_VITE_MANIFEST` holds the manifest *JSON
181
+ * text*, not a path. Fails loudly on a value that is set but not a manifest,
182
+ * because falling through to the filesystem would end in "run `bunx vite build`"
183
+ * — a diagnosis pointing away from the variable that is actually broken.
208
184
  */
209
185
  function injectedClientManifest() {
210
186
  const raw = process.env.GUREN_VITE_MANIFEST;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guren/server",
3
- "version": "2.15.0",
3
+ "version": "2.16.0",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "license": "MIT",
@@ -142,7 +142,7 @@
142
142
  "test": "bun test"
143
143
  },
144
144
  "dependencies": {
145
- "@guren/orm": "^2.6.2",
145
+ "@guren/orm": "^2.6.3",
146
146
  "@modelcontextprotocol/sdk": "^1.30.0",
147
147
  "chalk": "^5.3.0",
148
148
  "consola": "^3.4.2",
@@ -1,27 +0,0 @@
1
- import Redis from "ioredis";
2
- //#region src/redis/client.ts
3
- /**
4
- * Create a Redis client with the given options.
5
- *
6
- * @example
7
- * ```ts
8
- * // Using URL
9
- * const redis = createRedisClient({ url: 'redis://localhost:6379' })
10
- *
11
- * // Using host/port
12
- * const redis = createRedisClient({ host: 'localhost', port: 6379 })
13
- *
14
- * // With key prefix
15
- * const redis = createRedisClient({
16
- * url: process.env.REDIS_URL,
17
- * keyPrefix: 'myapp:',
18
- * })
19
- * ```
20
- */
21
- function createRedisClient(options = {}) {
22
- const { url, ...redisOptions } = options;
23
- if (url) return new Redis(url, redisOptions);
24
- return new Redis(redisOptions);
25
- }
26
- //#endregion
27
- export { createRedisClient as n, Redis as t };
@@ -1,26 +0,0 @@
1
- //#region src/auth/context.ts
2
- /**
3
- * Context key the framework auth context is stored under.
4
- *
5
- * Lives here rather than in `http/middleware/auth` so that `auth/` modules can
6
- * import it without reaching back into the middleware layer. The middleware
7
- * re-exports it, and it stays a public root export.
8
- */
9
- const AUTH_CONTEXT_KEY = "guren:auth";
10
- /**
11
- * Read the framework auth context off a request context.
12
- *
13
- * The lookup and its cast, in one place — nothing more. `ctx.get` returns
14
- * arbitrary values for unknown keys (test doubles and exotic contexts
15
- * included), so the cast is a claim, not a check. A caller whose behavior
16
- * turns on the value really being an auth context probes the member it is
17
- * about to call; `Gate.resolveUser` does exactly that, because a stray value
18
- * there decides whether the legacy `ctx.get('user')` fallback runs. Probing
19
- * here instead would reject contexts that `requireAuthenticated` and
20
- * `requireGuest` can use — they only ever read `check()` / `guest()`.
21
- */
22
- function getAuthContext(ctx) {
23
- return ctx.get(AUTH_CONTEXT_KEY);
24
- }
25
- //#endregion
26
- export { getAuthContext as n, AUTH_CONTEXT_KEY as t };
@@ -1,46 +0,0 @@
1
- import { t as createLoopbackGuard } from "./loopback-guard-D0Kc7-xc.js";
2
- //#region src/mcp/endpoint.ts
3
- const MCP_ENDPOINT_PATH = "/_guren/mcp";
4
- /**
5
- * Whether the MCP endpoint is mounted for this process.
6
- *
7
- * Opt-in via `GUREN_MCP=1` and never active in production: the endpoint
8
- * exposes project introspection and code generation, so it must not be
9
- * reachable unless the developer asked for it.
10
- *
11
- * The environment reads below are deliberately written as plain member
12
- * access. Do not "harden" them with optional chaining: the deploy plugins
13
- * bundle server code with `--define 'process.env.NODE_ENV="production"'`,
14
- * and a define matches one exact expression. Inserting `?.` produces a
15
- * different expression that no define touches, leaving this gate a runtime
16
- * read — and on hosts where the platform's environment is not in
17
- * `process.env` by the time the module graph evaluates (workerd is the
18
- * documented case; see the comment on the Cloudflare plugin's `define`),
19
- * that runtime read answers "not production" and the gate silently reopens.
20
- * A test in `tests/mcp/endpoint.test.ts` reads this file and fails on any
21
- * optional chain after `process.env`, because nothing observable at runtime
22
- * distinguishes the two forms.
23
- *
24
- * The `typeof process` check covers the only runtimes without `process`;
25
- * every runtime the framework supports that has `process` has `process.env`.
26
- */
27
- function isMcpEndpointEnabled() {
28
- if (typeof process === "undefined") return false;
29
- if (process.env.NODE_ENV === "production") return false;
30
- return process.env.GUREN_MCP === "1";
31
- }
32
- /**
33
- * Restricts the MCP endpoint to the developer's own machine.
34
- *
35
- * The endpoint is exempt from CSRF — agent clients carry no token — so
36
- * the loopback guard takes over that job: web pages are rejected unless
37
- * their `Origin` is loopback (the check the MCP specification asks local
38
- * servers for), and every caller is rejected unless its socket peer is
39
- * loopback. The guard fails closed when the runtime reports no peer at
40
- * all; see `http/middleware/loopback-guard.ts` for the opt-out.
41
- */
42
- function createMcpAccessGuard() {
43
- return createLoopbackGuard("the MCP endpoint");
44
- }
45
- //#endregion
46
- export { createMcpAccessGuard as n, isMcpEndpointEnabled as r, MCP_ENDPOINT_PATH as t };