effect-start 0.28.0 → 0.30.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 (722) hide show
  1. package/README.md +1 -1
  2. package/dist/Cookies.d.ts +9 -41
  3. package/dist/Cookies.d.ts.map +1 -1
  4. package/dist/Cookies.js +2 -2
  5. package/dist/Cookies.js.map +1 -1
  6. package/dist/Development.d.ts +7 -21
  7. package/dist/Development.d.ts.map +1 -1
  8. package/dist/Development.js +6 -8
  9. package/dist/Development.js.map +1 -1
  10. package/dist/Entity.d.ts +5 -6
  11. package/dist/Entity.d.ts.map +1 -1
  12. package/dist/Entity.js +10 -7
  13. package/dist/Entity.js.map +1 -1
  14. package/dist/Fetch.d.ts +15 -4
  15. package/dist/Fetch.d.ts.map +1 -1
  16. package/dist/Fetch.js +74 -1
  17. package/dist/Fetch.js.map +1 -1
  18. package/dist/FileRouter.d.ts +4 -7
  19. package/dist/FileRouter.d.ts.map +1 -1
  20. package/dist/FileRouter.js +38 -29
  21. package/dist/FileRouter.js.map +1 -1
  22. package/dist/FileRouterCodegen.d.ts +2 -2
  23. package/dist/FileRouterCodegen.d.ts.map +1 -1
  24. package/dist/FileRouterCodegen.js +9 -21
  25. package/dist/FileRouterCodegen.js.map +1 -1
  26. package/dist/FileSystem.d.ts +39 -39
  27. package/dist/FileSystem.d.ts.map +1 -1
  28. package/dist/FileSystem.js +5 -3
  29. package/dist/FileSystem.js.map +1 -1
  30. package/dist/GlobalLayer.d.ts +2 -2
  31. package/dist/GlobalLayer.d.ts.map +1 -1
  32. package/dist/GlobalLayer.js +2 -2
  33. package/dist/GlobalLayer.js.map +1 -1
  34. package/dist/Html.d.ts +32 -0
  35. package/dist/Html.d.ts.map +1 -0
  36. package/dist/{hyper/HyperHtml.js → Html.js} +45 -26
  37. package/dist/Html.js.map +1 -0
  38. package/dist/PlatformRuntime.d.ts.map +1 -1
  39. package/dist/PlatformRuntime.js.map +1 -1
  40. package/dist/Route.d.ts +22 -9
  41. package/dist/Route.d.ts.map +1 -1
  42. package/dist/Route.js +25 -4
  43. package/dist/Route.js.map +1 -1
  44. package/dist/RouteBody.d.ts +14 -7
  45. package/dist/RouteBody.d.ts.map +1 -1
  46. package/dist/RouteBody.js +38 -27
  47. package/dist/RouteBody.js.map +1 -1
  48. package/dist/RouteError.js.map +1 -1
  49. package/dist/RouteHook.d.ts.map +1 -1
  50. package/dist/RouteHook.js.map +1 -1
  51. package/dist/RouteHttp.d.ts +1 -1
  52. package/dist/RouteHttp.d.ts.map +1 -1
  53. package/dist/RouteHttp.js +56 -32
  54. package/dist/RouteHttp.js.map +1 -1
  55. package/dist/RouteHttpTracer.d.ts.map +1 -1
  56. package/dist/RouteHttpTracer.js.map +1 -1
  57. package/dist/RouteMount.d.ts +2 -2
  58. package/dist/RouteMount.d.ts.map +1 -1
  59. package/dist/RouteMount.js +2 -2
  60. package/dist/RouteMount.js.map +1 -1
  61. package/dist/RouteSchema.d.ts +2 -2
  62. package/dist/RouteSchema.d.ts.map +1 -1
  63. package/dist/RouteSchema.js +2 -2
  64. package/dist/RouteSchema.js.map +1 -1
  65. package/dist/RouteSse.d.ts +9 -10
  66. package/dist/RouteSse.d.ts.map +1 -1
  67. package/dist/RouteSse.js +8 -12
  68. package/dist/RouteSse.js.map +1 -1
  69. package/dist/RouteTree.d.ts +2 -2
  70. package/dist/RouteTree.d.ts.map +1 -1
  71. package/dist/RouteTree.js +2 -2
  72. package/dist/RouteTree.js.map +1 -1
  73. package/dist/RouteTrie.js +1 -1
  74. package/dist/RouteTrie.js.map +1 -1
  75. package/dist/Socket.d.ts +13 -18
  76. package/dist/Socket.d.ts.map +1 -1
  77. package/dist/Socket.js +12 -13
  78. package/dist/Socket.js.map +1 -1
  79. package/dist/Start.d.ts +15 -23
  80. package/dist/Start.d.ts.map +1 -1
  81. package/dist/Start.js +17 -6
  82. package/dist/Start.js.map +1 -1
  83. package/dist/System.d.ts +20 -5
  84. package/dist/System.d.ts.map +1 -1
  85. package/dist/System.js +12 -42
  86. package/dist/System.js.map +1 -1
  87. package/dist/Unique.d.ts.map +1 -1
  88. package/dist/Unique.js.map +1 -1
  89. package/dist/{ChildProcess.d.ts → _ChildProcess.d.ts} +14 -15
  90. package/dist/_ChildProcess.d.ts.map +1 -0
  91. package/dist/{ChildProcess.js → _ChildProcess.js} +2 -2
  92. package/dist/_ChildProcess.js.map +1 -0
  93. package/dist/{ContentNegotiation.d.ts → _ContentNegotiation.d.ts} +1 -1
  94. package/dist/_ContentNegotiation.d.ts.map +1 -0
  95. package/dist/{ContentNegotiation.js → _ContentNegotiation.js} +1 -1
  96. package/dist/_ContentNegotiation.js.map +1 -0
  97. package/dist/{Docker.d.ts → _Docker.d.ts} +2 -2
  98. package/dist/_Docker.d.ts.map +1 -0
  99. package/dist/{Docker.js → _Docker.js} +1 -1
  100. package/dist/_Docker.js.map +1 -0
  101. package/dist/{Effectify.d.ts → _Effectify.d.ts} +1 -1
  102. package/dist/_Effectify.d.ts.map +1 -0
  103. package/dist/{Effectify.js → _Effectify.js} +1 -1
  104. package/dist/_Effectify.js.map +1 -0
  105. package/dist/{Http.d.ts → _Http.d.ts} +1 -8
  106. package/dist/_Http.d.ts.map +1 -0
  107. package/dist/{Http.js → _Http.js} +1 -17
  108. package/dist/_Http.js.map +1 -0
  109. package/dist/{PathPattern.d.ts → _PathPattern.d.ts} +12 -1
  110. package/dist/_PathPattern.d.ts.map +1 -0
  111. package/dist/{PathPattern.js → _PathPattern.js} +86 -1
  112. package/dist/_PathPattern.js.map +1 -0
  113. package/dist/_SchemaExtra.d.ts +4 -0
  114. package/dist/_SchemaExtra.d.ts.map +1 -0
  115. package/dist/{SchemaExtra.js → _SchemaExtra.js} +4 -4
  116. package/dist/_SchemaExtra.js.map +1 -0
  117. package/dist/{StartApp.d.ts → _StartApp.d.ts} +1 -1
  118. package/dist/_StartApp.d.ts.map +1 -0
  119. package/dist/{StartApp.js → _StartApp.js} +1 -1
  120. package/dist/_StartApp.js.map +1 -0
  121. package/dist/{StreamExtra.d.ts → _StreamExtra.d.ts} +5 -5
  122. package/dist/_StreamExtra.d.ts.map +1 -0
  123. package/dist/{StreamExtra.js → _StreamExtra.js} +1 -1
  124. package/dist/_StreamExtra.js.map +1 -0
  125. package/dist/{Values.d.ts → _Values.d.ts} +3 -3
  126. package/dist/_Values.d.ts.map +1 -0
  127. package/dist/{Values.js → _Values.js} +1 -1
  128. package/dist/_Values.js.map +1 -0
  129. package/dist/bun/BunBundle.d.ts +2 -2
  130. package/dist/bun/BunBundle.d.ts.map +1 -1
  131. package/dist/bun/BunBundle.js.map +1 -1
  132. package/dist/bun/BunChildProcessSpawner.d.ts +1 -1
  133. package/dist/bun/BunChildProcessSpawner.d.ts.map +1 -1
  134. package/dist/bun/BunChildProcessSpawner.js +9 -9
  135. package/dist/bun/BunChildProcessSpawner.js.map +1 -1
  136. package/dist/bun/BunImportTrackerPlugin.d.ts +2 -2
  137. package/dist/bun/BunImportTrackerPlugin.d.ts.map +1 -1
  138. package/dist/bun/BunImportTrackerPlugin.js.map +1 -1
  139. package/dist/bun/BunRoute.d.ts +2 -2
  140. package/dist/bun/BunRoute.d.ts.map +1 -1
  141. package/dist/bun/BunRoute.js +108 -40
  142. package/dist/bun/BunRoute.js.map +1 -1
  143. package/dist/bun/BunRuntime.js.map +1 -1
  144. package/dist/bun/BunServer.d.ts +5 -5
  145. package/dist/bun/BunServer.d.ts.map +1 -1
  146. package/dist/bun/BunServer.js +3 -3
  147. package/dist/bun/BunServer.js.map +1 -1
  148. package/dist/bun/BunVirtualFilesPlugin.js.map +1 -1
  149. package/dist/bun/_BunEnhancedResolve.d.ts.map +1 -1
  150. package/dist/bun/_BunEnhancedResolve.js.map +1 -1
  151. package/dist/bun/_empty.html +0 -0
  152. package/dist/bundler/Bundle.d.ts +2 -2
  153. package/dist/bundler/Bundle.d.ts.map +1 -1
  154. package/dist/bundler/Bundle.js.map +1 -1
  155. package/dist/bundler/BundleFiles.d.ts +1 -1
  156. package/dist/bundler/BundleFiles.d.ts.map +1 -1
  157. package/dist/bundler/BundleFiles.js.map +1 -1
  158. package/dist/bundler/BundleRoute.d.ts +6 -5
  159. package/dist/bundler/BundleRoute.d.ts.map +1 -1
  160. package/dist/bundler/BundleRoute.js +2 -2
  161. package/dist/bundler/BundleRoute.js.map +1 -1
  162. package/dist/cli/Argument.d.ts +26 -0
  163. package/dist/cli/Argument.d.ts.map +1 -0
  164. package/dist/cli/Argument.js +31 -0
  165. package/dist/cli/Argument.js.map +1 -0
  166. package/dist/cli/CliError.d.ts +15 -0
  167. package/dist/cli/CliError.d.ts.map +1 -0
  168. package/dist/cli/CliError.js +54 -0
  169. package/dist/cli/CliError.js.map +1 -0
  170. package/dist/cli/Command.d.ts +61 -0
  171. package/dist/cli/Command.d.ts.map +1 -0
  172. package/dist/cli/Command.js +453 -0
  173. package/dist/cli/Command.js.map +1 -0
  174. package/dist/cli/Flag.d.ts +32 -0
  175. package/dist/cli/Flag.d.ts.map +1 -0
  176. package/dist/cli/Flag.js +35 -0
  177. package/dist/cli/Flag.js.map +1 -0
  178. package/dist/cli/HelpDoc.d.ts +28 -0
  179. package/dist/cli/HelpDoc.d.ts.map +1 -0
  180. package/dist/cli/HelpDoc.js +40 -0
  181. package/dist/cli/HelpDoc.js.map +1 -0
  182. package/dist/cli/Param.d.ts +71 -0
  183. package/dist/cli/Param.d.ts.map +1 -0
  184. package/dist/cli/Param.js +236 -0
  185. package/dist/cli/Param.js.map +1 -0
  186. package/dist/cli/Primitive.d.ts +22 -0
  187. package/dist/cli/Primitive.d.ts.map +1 -0
  188. package/dist/cli/Primitive.js +73 -0
  189. package/dist/cli/Primitive.js.map +1 -0
  190. package/dist/cli/index.d.ts +8 -0
  191. package/dist/cli/index.d.ts.map +1 -0
  192. package/dist/cli/index.js +8 -0
  193. package/dist/cli/index.js.map +1 -0
  194. package/dist/client/Overlay.js.map +1 -1
  195. package/dist/client/ScrollState.js.map +1 -1
  196. package/dist/client/index.js.map +1 -1
  197. package/dist/cloudflare/CloudflareTunnel.d.ts +12 -0
  198. package/dist/cloudflare/CloudflareTunnel.d.ts.map +1 -0
  199. package/dist/{x/cloudflare → cloudflare}/CloudflareTunnel.js +1 -1
  200. package/dist/cloudflare/CloudflareTunnel.js.map +1 -0
  201. package/dist/cloudflare/index.d.ts.map +1 -0
  202. package/dist/cloudflare/index.js.map +1 -0
  203. package/dist/datastar/actions/fetch.js.map +1 -1
  204. package/dist/datastar/actions/peek.js.map +1 -1
  205. package/dist/datastar/actions/setAll.js.map +1 -1
  206. package/dist/datastar/actions/toggleAll.js.map +1 -1
  207. package/dist/datastar/attributes/attr.js.map +1 -1
  208. package/dist/datastar/attributes/bind.js.map +1 -1
  209. package/dist/datastar/attributes/class.js.map +1 -1
  210. package/dist/datastar/attributes/computed.js.map +1 -1
  211. package/dist/datastar/attributes/indicator.js.map +1 -1
  212. package/dist/datastar/attributes/init.js.map +1 -1
  213. package/dist/datastar/attributes/jsonSignals.js.map +1 -1
  214. package/dist/datastar/attributes/on.js.map +1 -1
  215. package/dist/datastar/attributes/onIntersect.js.map +1 -1
  216. package/dist/datastar/attributes/onInterval.js.map +1 -1
  217. package/dist/datastar/attributes/onSignalPatch.js.map +1 -1
  218. package/dist/datastar/attributes/ref.js.map +1 -1
  219. package/dist/datastar/attributes/show.js.map +1 -1
  220. package/dist/datastar/attributes/signals.js.map +1 -1
  221. package/dist/datastar/attributes/style.js.map +1 -1
  222. package/dist/datastar/attributes/text.js.map +1 -1
  223. package/dist/datastar/engine.d.ts +5 -5
  224. package/dist/datastar/engine.d.ts.map +1 -1
  225. package/dist/datastar/engine.js.map +1 -1
  226. package/dist/datastar/utils.d.ts +1 -1
  227. package/dist/datastar/utils.d.ts.map +1 -1
  228. package/dist/datastar/utils.js.map +1 -1
  229. package/dist/datastar/watchers/patchElements.js +3 -1
  230. package/dist/datastar/watchers/patchElements.js.map +1 -1
  231. package/dist/datastar/watchers/patchSignals.js.map +1 -1
  232. package/dist/experimental/EncryptedCookies.d.ts +4 -4
  233. package/dist/experimental/EncryptedCookies.d.ts.map +1 -1
  234. package/dist/experimental/EncryptedCookies.js.map +1 -1
  235. package/dist/index.d.ts +2 -0
  236. package/dist/index.d.ts.map +1 -1
  237. package/dist/index.js +2 -0
  238. package/dist/index.js.map +1 -1
  239. package/dist/jsx-runtime.d.ts +8 -0
  240. package/dist/jsx-runtime.d.ts.map +1 -0
  241. package/dist/{hyper/jsx-runtime.js → jsx-runtime.js} +2 -2
  242. package/dist/jsx-runtime.js.map +1 -0
  243. package/dist/lint/plugin.d.ts +18 -15
  244. package/dist/lint/plugin.d.ts.map +1 -1
  245. package/dist/lint/plugin.js +76 -80
  246. package/dist/lint/plugin.js.map +1 -1
  247. package/dist/node/NodeFileSystem.d.ts +3 -3
  248. package/dist/node/NodeFileSystem.d.ts.map +1 -1
  249. package/dist/node/NodeFileSystem.js +8 -7
  250. package/dist/node/NodeFileSystem.js.map +1 -1
  251. package/dist/node/NodeUtils.d.ts.map +1 -1
  252. package/dist/node/NodeUtils.js.map +1 -1
  253. package/dist/sql/SqlCache.d.ts +1 -0
  254. package/dist/sql/SqlCache.d.ts.map +1 -1
  255. package/dist/sql/SqlCache.js +5 -1
  256. package/dist/sql/SqlCache.js.map +1 -1
  257. package/dist/sql/SqlClient.js +1 -1
  258. package/dist/sql/SqlClient.js.map +1 -1
  259. package/dist/{SqlIntrospect.d.ts → sql/SqlIntrospect.d.ts} +3 -3
  260. package/dist/sql/SqlIntrospect.d.ts.map +1 -0
  261. package/dist/{SqlIntrospect.js → sql/SqlIntrospect.js} +1 -1
  262. package/dist/sql/SqlIntrospect.js.map +1 -0
  263. package/dist/sql/bun/index.d.ts +3 -3
  264. package/dist/sql/bun/index.d.ts.map +1 -1
  265. package/dist/sql/bun/index.js +1 -1
  266. package/dist/sql/bun/index.js.map +1 -1
  267. package/dist/sql/index.d.ts +1 -0
  268. package/dist/sql/index.d.ts.map +1 -1
  269. package/dist/sql/index.js +1 -0
  270. package/dist/sql/index.js.map +1 -1
  271. package/dist/sql/libsql/index.d.ts +1 -1
  272. package/dist/sql/libsql/index.d.ts.map +1 -1
  273. package/dist/sql/libsql/index.js +2 -2
  274. package/dist/sql/libsql/index.js.map +1 -1
  275. package/dist/sql/mssql/index.d.ts +3 -3
  276. package/dist/sql/mssql/index.d.ts.map +1 -1
  277. package/dist/sql/mssql/index.js +1 -1
  278. package/dist/sql/mssql/index.js.map +1 -1
  279. package/dist/sql/postgres/index.d.ts +1 -1
  280. package/dist/sql/postgres/index.d.ts.map +1 -1
  281. package/dist/sql/postgres/index.js.map +1 -1
  282. package/dist/studio/Simulation.d.ts.map +1 -0
  283. package/dist/studio/Simulation.js.map +1 -0
  284. package/dist/{tower/Tower.d.ts → studio/Studio.d.ts} +4 -4
  285. package/dist/studio/Studio.d.ts.map +1 -0
  286. package/dist/studio/Studio.js +30 -0
  287. package/dist/studio/Studio.js.map +1 -0
  288. package/dist/studio/StudioErrors.d.ts +4 -0
  289. package/dist/studio/StudioErrors.d.ts.map +1 -0
  290. package/dist/{tower/TowerErrors.js → studio/StudioErrors.js} +6 -6
  291. package/dist/studio/StudioErrors.js.map +1 -0
  292. package/dist/{tower/TowerLogger.d.ts → studio/StudioLogger.d.ts} +1 -1
  293. package/dist/studio/StudioLogger.d.ts.map +1 -0
  294. package/dist/{tower/TowerLogger.js → studio/StudioLogger.js} +7 -7
  295. package/dist/studio/StudioLogger.js.map +1 -0
  296. package/dist/studio/StudioMetrics.d.ts +4 -0
  297. package/dist/studio/StudioMetrics.d.ts.map +1 -0
  298. package/dist/{tower/TowerMetrics.js → studio/StudioMetrics.js} +3 -3
  299. package/dist/studio/StudioMetrics.js.map +1 -0
  300. package/dist/studio/StudioProcess.d.ts +4 -0
  301. package/dist/studio/StudioProcess.d.ts.map +1 -0
  302. package/dist/{tower/TowerProcess.js → studio/StudioProcess.js} +3 -3
  303. package/dist/studio/StudioProcess.js.map +1 -0
  304. package/dist/{tower/TowerStore.d.ts → studio/StudioStore.d.ts} +33 -33
  305. package/dist/studio/StudioStore.d.ts.map +1 -0
  306. package/dist/{tower/TowerStore.js → studio/StudioStore.js} +5 -5
  307. package/dist/studio/StudioStore.js.map +1 -0
  308. package/dist/studio/StudioTracer.d.ts +4 -0
  309. package/dist/studio/StudioTracer.d.ts.map +1 -0
  310. package/dist/{tower/TowerTracer.js → studio/StudioTracer.js} +21 -21
  311. package/dist/studio/StudioTracer.js.map +1 -0
  312. package/dist/studio/index.d.ts +4 -0
  313. package/dist/studio/index.d.ts.map +1 -0
  314. package/dist/studio/index.js +4 -0
  315. package/dist/studio/index.js.map +1 -0
  316. package/dist/{tower/routes/logs → studio/routes/errors}/route.d.ts +1 -1
  317. package/dist/{tower/routes/metrics → studio/routes/errors}/route.d.ts.map +1 -1
  318. package/dist/studio/routes/errors/route.js +42 -0
  319. package/dist/studio/routes/errors/route.js.map +1 -0
  320. package/dist/{tower → studio}/routes/fiberDetail.d.ts +1 -1
  321. package/dist/studio/routes/fiberDetail.d.ts.map +1 -0
  322. package/dist/{tower → studio}/routes/fiberDetail.js +8 -9
  323. package/dist/studio/routes/fiberDetail.js.map +1 -0
  324. package/dist/{tower/routes/traces → studio/routes/fibers}/route.d.ts +1 -1
  325. package/dist/studio/routes/fibers/route.d.ts.map +1 -0
  326. package/dist/studio/routes/fibers/route.js +24 -0
  327. package/dist/studio/routes/fibers/route.js.map +1 -0
  328. package/dist/studio/routes/layout.d.ts.map +1 -0
  329. package/{src/tower → dist/studio}/routes/layout.html +1 -1
  330. package/dist/studio/routes/layout.js.map +1 -0
  331. package/dist/{tower/routes/errors → studio/routes/logs}/route.d.ts +1 -1
  332. package/dist/studio/routes/logs/route.d.ts.map +1 -0
  333. package/dist/studio/routes/logs/route.js +29 -0
  334. package/dist/studio/routes/logs/route.js.map +1 -0
  335. package/dist/{tower → studio}/routes/metrics/route.d.ts +1 -1
  336. package/dist/studio/routes/metrics/route.d.ts.map +1 -0
  337. package/dist/studio/routes/metrics/route.js +17 -0
  338. package/dist/studio/routes/metrics/route.js.map +1 -0
  339. package/dist/{tower → studio}/routes/route.d.ts +2 -2
  340. package/dist/studio/routes/route.d.ts.map +1 -0
  341. package/dist/studio/routes/route.js +6 -0
  342. package/dist/studio/routes/route.js.map +1 -0
  343. package/dist/{tower → studio}/routes/routes/route.d.ts +1 -1
  344. package/dist/studio/routes/routes/route.d.ts.map +1 -0
  345. package/dist/{tower → studio}/routes/routes/route.js +3 -6
  346. package/dist/studio/routes/routes/route.js.map +1 -0
  347. package/dist/{tower → studio}/routes/services/route.d.ts +1 -1
  348. package/dist/studio/routes/services/route.d.ts.map +1 -0
  349. package/dist/studio/routes/services/route.js +12 -0
  350. package/dist/studio/routes/services/route.js.map +1 -0
  351. package/dist/{tower → studio}/routes/system/route.d.ts +1 -1
  352. package/dist/studio/routes/system/route.d.ts.map +1 -0
  353. package/dist/studio/routes/system/route.js +18 -0
  354. package/dist/studio/routes/system/route.js.map +1 -0
  355. package/dist/{tower → studio}/routes/traceDetail.d.ts +1 -1
  356. package/dist/studio/routes/traceDetail.d.ts.map +1 -0
  357. package/dist/studio/routes/traceDetail.js +19 -0
  358. package/dist/studio/routes/traceDetail.js.map +1 -0
  359. package/dist/{tower/routes/fibers → studio/routes/traces}/route.d.ts +1 -1
  360. package/dist/studio/routes/traces/route.d.ts.map +1 -0
  361. package/dist/studio/routes/traces/route.js +29 -0
  362. package/dist/studio/routes/traces/route.js.map +1 -0
  363. package/dist/{tower → studio}/routes/tree.d.ts +47 -47
  364. package/dist/studio/routes/tree.d.ts.map +1 -0
  365. package/dist/studio/routes/tree.js.map +1 -0
  366. package/dist/studio/ui/Errors.d.ts +5 -0
  367. package/dist/studio/ui/Errors.d.ts.map +1 -0
  368. package/dist/studio/ui/Errors.js +17 -0
  369. package/dist/studio/ui/Errors.js.map +1 -0
  370. package/dist/{tower → studio}/ui/Fibers.d.ts +7 -7
  371. package/dist/studio/ui/Fibers.d.ts.map +1 -0
  372. package/dist/studio/ui/Fibers.js +134 -0
  373. package/dist/studio/ui/Fibers.js.map +1 -0
  374. package/dist/studio/ui/Logs.d.ts +5 -0
  375. package/dist/studio/ui/Logs.d.ts.map +1 -0
  376. package/dist/{tower → studio}/ui/Logs.js +2 -3
  377. package/dist/studio/ui/Logs.js.map +1 -0
  378. package/dist/studio/ui/Metrics.d.ts +5 -0
  379. package/dist/studio/ui/Metrics.d.ts.map +1 -0
  380. package/dist/{tower → studio}/ui/Metrics.js +4 -11
  381. package/dist/studio/ui/Metrics.js.map +1 -0
  382. package/dist/{tower → studio}/ui/Routes.d.ts +1 -1
  383. package/dist/studio/ui/Routes.d.ts.map +1 -0
  384. package/dist/{tower → studio}/ui/Routes.js +4 -12
  385. package/dist/studio/ui/Routes.js.map +1 -0
  386. package/dist/{tower → studio}/ui/Services.d.ts +1 -1
  387. package/dist/studio/ui/Services.d.ts.map +1 -0
  388. package/dist/{tower → studio}/ui/Services.js +2 -9
  389. package/dist/studio/ui/Services.js.map +1 -0
  390. package/dist/{tower → studio}/ui/Shell.d.ts +2 -2
  391. package/dist/studio/ui/Shell.d.ts.map +1 -0
  392. package/dist/studio/ui/Shell.js +8 -0
  393. package/dist/studio/ui/Shell.js.map +1 -0
  394. package/dist/studio/ui/System.d.ts +5 -0
  395. package/dist/studio/ui/System.d.ts.map +1 -0
  396. package/dist/studio/ui/System.js +36 -0
  397. package/dist/studio/ui/System.js.map +1 -0
  398. package/dist/studio/ui/Traces.d.ts +13 -0
  399. package/dist/studio/ui/Traces.d.ts.map +1 -0
  400. package/dist/studio/ui/Traces.js +182 -0
  401. package/dist/studio/ui/Traces.js.map +1 -0
  402. package/dist/tailscale/TailscaleTunnel.d.ts +16 -0
  403. package/dist/tailscale/TailscaleTunnel.d.ts.map +1 -0
  404. package/dist/{x/tailscale → tailscale}/TailscaleTunnel.js +4 -5
  405. package/dist/tailscale/TailscaleTunnel.js.map +1 -0
  406. package/dist/tailscale/index.d.ts.map +1 -0
  407. package/dist/tailscale/index.js.map +1 -0
  408. package/dist/{x/tailwind → tailwind}/TailwindPlugin.d.ts +5 -5
  409. package/dist/tailwind/TailwindPlugin.d.ts.map +1 -0
  410. package/dist/tailwind/TailwindPlugin.js.map +1 -0
  411. package/dist/tailwind/compile.d.ts.map +1 -0
  412. package/dist/{x/tailwind → tailwind}/compile.js +1 -1
  413. package/dist/tailwind/compile.js.map +1 -0
  414. package/dist/tailwind/index.d.ts +3 -0
  415. package/dist/tailwind/index.d.ts.map +1 -0
  416. package/dist/tailwind/index.js +3 -0
  417. package/dist/tailwind/index.js.map +1 -0
  418. package/dist/tailwind/plugin.d.ts.map +1 -0
  419. package/dist/{x/tailwind → tailwind}/plugin.js +1 -1
  420. package/dist/{x/tailwind → tailwind}/plugin.js.map +1 -1
  421. package/dist/testing/TestLogger.js.map +1 -1
  422. package/dist/testing/utils.d.ts +3 -1
  423. package/dist/testing/utils.d.ts.map +1 -1
  424. package/dist/testing/utils.js +39 -0
  425. package/dist/testing/utils.js.map +1 -1
  426. package/package.json +53 -71
  427. package/src/Cookies.ts +4 -8
  428. package/src/Development.ts +21 -21
  429. package/src/Entity.ts +24 -19
  430. package/src/Fetch.ts +101 -5
  431. package/src/FileRouter.ts +45 -48
  432. package/src/FileRouterCodegen.ts +9 -23
  433. package/src/FileSystem.ts +43 -63
  434. package/src/GlobalLayer.ts +4 -2
  435. package/src/{hyper/HyperHtml.ts → Html.ts} +90 -30
  436. package/src/Route.ts +69 -13
  437. package/src/RouteBody.ts +88 -63
  438. package/src/RouteHttp.ts +152 -114
  439. package/src/RouteMount.ts +4 -4
  440. package/src/RouteSchema.ts +2 -2
  441. package/src/RouteSse.ts +28 -37
  442. package/src/RouteTree.ts +2 -2
  443. package/src/RouteTrie.ts +1 -1
  444. package/src/Socket.ts +17 -27
  445. package/src/Start.ts +39 -47
  446. package/src/System.ts +41 -65
  447. package/src/{ChildProcess.ts → _ChildProcess.ts} +14 -23
  448. package/src/{Docker.ts → _Docker.ts} +1 -1
  449. package/src/{Http.ts → _Http.ts} +0 -28
  450. package/src/{PathPattern.ts → _PathPattern.ts} +105 -0
  451. package/src/{SchemaExtra.ts → _SchemaExtra.ts} +3 -4
  452. package/src/bun/BunChildProcessSpawner.ts +9 -9
  453. package/src/bun/BunRoute.ts +130 -45
  454. package/src/bun/BunServer.ts +4 -3
  455. package/src/bundler/BundleRoute.ts +2 -2
  456. package/src/cli/Argument.ts +45 -0
  457. package/src/cli/CliError.ts +68 -0
  458. package/src/cli/Command.ts +685 -0
  459. package/src/cli/Flag.ts +63 -0
  460. package/src/cli/HelpDoc.ts +67 -0
  461. package/src/cli/Param.ts +418 -0
  462. package/src/cli/Primitive.ts +94 -0
  463. package/src/cli/index.ts +7 -0
  464. package/src/{x/cloudflare → cloudflare}/CloudflareTunnel.ts +1 -1
  465. package/src/datastar/watchers/patchElements.ts +4 -2
  466. package/src/index.ts +2 -0
  467. package/src/jsx-runtime.ts +15 -0
  468. package/src/{hyper/jsx.d.ts → jsx.d.ts} +3 -3
  469. package/src/lint/plugin.js +86 -97
  470. package/src/node/NodeFileSystem.ts +15 -14
  471. package/src/sql/SqlCache.ts +14 -1
  472. package/src/sql/SqlClient.ts +1 -1
  473. package/src/{SqlIntrospect.ts → sql/SqlIntrospect.ts} +1 -1
  474. package/src/sql/bun/index.ts +1 -1
  475. package/src/sql/index.ts +1 -0
  476. package/src/sql/libsql/index.ts +1 -1
  477. package/src/sql/mssql/index.ts +1 -1
  478. package/src/studio/Studio.ts +47 -0
  479. package/src/{tower/TowerErrors.ts → studio/StudioErrors.ts} +13 -13
  480. package/src/{tower/TowerLogger.ts → studio/StudioLogger.ts} +10 -10
  481. package/src/{tower/TowerMetrics.ts → studio/StudioMetrics.ts} +5 -5
  482. package/src/{tower/TowerProcess.ts → studio/StudioProcess.ts} +4 -4
  483. package/src/{tower/TowerStore.ts → studio/StudioStore.ts} +37 -37
  484. package/src/{tower/TowerTracer.ts → studio/StudioTracer.ts} +25 -25
  485. package/src/studio/index.ts +3 -0
  486. package/src/{tower → studio}/routes/errors/route.tsx +7 -8
  487. package/src/{tower → studio}/routes/fiberDetail.tsx +9 -10
  488. package/src/{tower → studio}/routes/fibers/route.tsx +13 -14
  489. package/src/studio/routes/layout.html +340 -0
  490. package/src/{tower → studio}/routes/logs/route.tsx +7 -8
  491. package/src/{tower → studio}/routes/metrics/route.tsx +8 -9
  492. package/src/studio/routes/route.tsx +8 -0
  493. package/src/{tower → studio}/routes/routes/route.tsx +3 -4
  494. package/src/{tower → studio}/routes/services/route.tsx +3 -4
  495. package/src/{tower → studio}/routes/system/route.tsx +8 -9
  496. package/src/{tower → studio}/routes/traceDetail.tsx +6 -7
  497. package/src/{tower → studio}/routes/traces/route.tsx +8 -9
  498. package/src/{tower → studio}/ui/Errors.tsx +3 -3
  499. package/src/{tower → studio}/ui/Fibers.tsx +7 -7
  500. package/src/{tower → studio}/ui/Logs.tsx +3 -3
  501. package/src/{tower → studio}/ui/Metrics.tsx +4 -4
  502. package/src/{tower → studio}/ui/Shell.tsx +1 -1
  503. package/src/{tower → studio}/ui/System.tsx +2 -2
  504. package/src/{tower → studio}/ui/Traces.tsx +16 -16
  505. package/src/{x/tailscale → tailscale}/TailscaleTunnel.ts +4 -5
  506. package/src/{x/tailwind → tailwind}/compile.ts +1 -1
  507. package/src/tailwind/index.ts +2 -0
  508. package/src/{x/tailwind → tailwind}/plugin.ts +1 -1
  509. package/src/testing/utils.ts +59 -0
  510. package/dist/ChildProcess.d.ts.map +0 -1
  511. package/dist/ChildProcess.js.map +0 -1
  512. package/dist/Commander.d.ts +0 -101
  513. package/dist/Commander.d.ts.map +0 -1
  514. package/dist/Commander.js +0 -327
  515. package/dist/Commander.js.map +0 -1
  516. package/dist/ContentNegotiation.d.ts.map +0 -1
  517. package/dist/ContentNegotiation.js.map +0 -1
  518. package/dist/Docker.d.ts.map +0 -1
  519. package/dist/Docker.js.map +0 -1
  520. package/dist/Effectify.d.ts.map +0 -1
  521. package/dist/Effectify.js.map +0 -1
  522. package/dist/FilePathPattern.d.ts +0 -30
  523. package/dist/FilePathPattern.d.ts.map +0 -1
  524. package/dist/FilePathPattern.js +0 -87
  525. package/dist/FilePathPattern.js.map +0 -1
  526. package/dist/Http.d.ts.map +0 -1
  527. package/dist/Http.js.map +0 -1
  528. package/dist/PathPattern.d.ts.map +0 -1
  529. package/dist/PathPattern.js.map +0 -1
  530. package/dist/PlatformError.d.ts +0 -39
  531. package/dist/PlatformError.d.ts.map +0 -1
  532. package/dist/PlatformError.js +0 -26
  533. package/dist/PlatformError.js.map +0 -1
  534. package/dist/SchemaExtra.d.ts +0 -8
  535. package/dist/SchemaExtra.d.ts.map +0 -1
  536. package/dist/SchemaExtra.js.map +0 -1
  537. package/dist/SqlIntrospect.d.ts.map +0 -1
  538. package/dist/SqlIntrospect.js.map +0 -1
  539. package/dist/StartApp.d.ts.map +0 -1
  540. package/dist/StartApp.js.map +0 -1
  541. package/dist/StreamExtra.d.ts.map +0 -1
  542. package/dist/StreamExtra.js.map +0 -1
  543. package/dist/TuplePathPattern.d.ts +0 -10
  544. package/dist/TuplePathPattern.d.ts.map +0 -1
  545. package/dist/TuplePathPattern.js +0 -69
  546. package/dist/TuplePathPattern.js.map +0 -1
  547. package/dist/Values.d.ts.map +0 -1
  548. package/dist/Values.js.map +0 -1
  549. package/dist/hyper/Hyper.d.ts +0 -26
  550. package/dist/hyper/Hyper.d.ts.map +0 -1
  551. package/dist/hyper/Hyper.js +0 -24
  552. package/dist/hyper/Hyper.js.map +0 -1
  553. package/dist/hyper/HyperHtml.d.ts +0 -24
  554. package/dist/hyper/HyperHtml.d.ts.map +0 -1
  555. package/dist/hyper/HyperHtml.js.map +0 -1
  556. package/dist/hyper/HyperHtml.test.d.ts +0 -2
  557. package/dist/hyper/HyperHtml.test.d.ts.map +0 -1
  558. package/dist/hyper/HyperHtml.test.js +0 -283
  559. package/dist/hyper/HyperHtml.test.js.map +0 -1
  560. package/dist/hyper/HyperNode.d.ts +0 -15
  561. package/dist/hyper/HyperNode.d.ts.map +0 -1
  562. package/dist/hyper/HyperNode.js +0 -12
  563. package/dist/hyper/HyperNode.js.map +0 -1
  564. package/dist/hyper/HyperRoute.d.ts +0 -9
  565. package/dist/hyper/HyperRoute.d.ts.map +0 -1
  566. package/dist/hyper/HyperRoute.js +0 -33
  567. package/dist/hyper/HyperRoute.js.map +0 -1
  568. package/dist/hyper/HyperRoute.test.d.ts +0 -2
  569. package/dist/hyper/HyperRoute.test.d.ts.map +0 -1
  570. package/dist/hyper/HyperRoute.test.js +0 -86
  571. package/dist/hyper/HyperRoute.test.js.map +0 -1
  572. package/dist/hyper/html.d.ts +0 -11
  573. package/dist/hyper/html.d.ts.map +0 -1
  574. package/dist/hyper/html.js +0 -31
  575. package/dist/hyper/html.js.map +0 -1
  576. package/dist/hyper/index.d.ts +0 -7
  577. package/dist/hyper/index.d.ts.map +0 -1
  578. package/dist/hyper/index.js +0 -6
  579. package/dist/hyper/index.js.map +0 -1
  580. package/dist/hyper/jsx-runtime.d.ts +0 -8
  581. package/dist/hyper/jsx-runtime.d.ts.map +0 -1
  582. package/dist/hyper/jsx-runtime.js.map +0 -1
  583. package/dist/tower/Simulation.d.ts.map +0 -1
  584. package/dist/tower/Simulation.js.map +0 -1
  585. package/dist/tower/Tower.d.ts.map +0 -1
  586. package/dist/tower/Tower.js +0 -30
  587. package/dist/tower/Tower.js.map +0 -1
  588. package/dist/tower/TowerErrors.d.ts +0 -4
  589. package/dist/tower/TowerErrors.d.ts.map +0 -1
  590. package/dist/tower/TowerErrors.js.map +0 -1
  591. package/dist/tower/TowerLogger.d.ts.map +0 -1
  592. package/dist/tower/TowerLogger.js.map +0 -1
  593. package/dist/tower/TowerMetrics.d.ts +0 -4
  594. package/dist/tower/TowerMetrics.d.ts.map +0 -1
  595. package/dist/tower/TowerMetrics.js.map +0 -1
  596. package/dist/tower/TowerProcess.d.ts +0 -4
  597. package/dist/tower/TowerProcess.d.ts.map +0 -1
  598. package/dist/tower/TowerProcess.js.map +0 -1
  599. package/dist/tower/TowerStore.d.ts.map +0 -1
  600. package/dist/tower/TowerStore.js.map +0 -1
  601. package/dist/tower/TowerTracer.d.ts +0 -4
  602. package/dist/tower/TowerTracer.d.ts.map +0 -1
  603. package/dist/tower/TowerTracer.js.map +0 -1
  604. package/dist/tower/index.d.ts +0 -4
  605. package/dist/tower/index.d.ts.map +0 -1
  606. package/dist/tower/index.js +0 -4
  607. package/dist/tower/index.js.map +0 -1
  608. package/dist/tower/routes/errors/route.d.ts.map +0 -1
  609. package/dist/tower/routes/errors/route.js +0 -47
  610. package/dist/tower/routes/errors/route.js.map +0 -1
  611. package/dist/tower/routes/fiberDetail.d.ts.map +0 -1
  612. package/dist/tower/routes/fiberDetail.js.map +0 -1
  613. package/dist/tower/routes/fibers/route.d.ts.map +0 -1
  614. package/dist/tower/routes/fibers/route.js +0 -27
  615. package/dist/tower/routes/fibers/route.js.map +0 -1
  616. package/dist/tower/routes/layout.d.ts.map +0 -1
  617. package/dist/tower/routes/layout.js.map +0 -1
  618. package/dist/tower/routes/logs/route.d.ts.map +0 -1
  619. package/dist/tower/routes/logs/route.js +0 -36
  620. package/dist/tower/routes/logs/route.js.map +0 -1
  621. package/dist/tower/routes/metrics/route.js +0 -20
  622. package/dist/tower/routes/metrics/route.js.map +0 -1
  623. package/dist/tower/routes/route.d.ts.map +0 -1
  624. package/dist/tower/routes/route.js +0 -6
  625. package/dist/tower/routes/route.js.map +0 -1
  626. package/dist/tower/routes/routes/route.d.ts.map +0 -1
  627. package/dist/tower/routes/routes/route.js.map +0 -1
  628. package/dist/tower/routes/services/route.d.ts.map +0 -1
  629. package/dist/tower/routes/services/route.js +0 -15
  630. package/dist/tower/routes/services/route.js.map +0 -1
  631. package/dist/tower/routes/system/route.d.ts.map +0 -1
  632. package/dist/tower/routes/system/route.js +0 -21
  633. package/dist/tower/routes/system/route.js.map +0 -1
  634. package/dist/tower/routes/traceDetail.d.ts.map +0 -1
  635. package/dist/tower/routes/traceDetail.js +0 -20
  636. package/dist/tower/routes/traceDetail.js.map +0 -1
  637. package/dist/tower/routes/traces/route.d.ts.map +0 -1
  638. package/dist/tower/routes/traces/route.js +0 -36
  639. package/dist/tower/routes/traces/route.js.map +0 -1
  640. package/dist/tower/routes/tree.d.ts.map +0 -1
  641. package/dist/tower/routes/tree.js.map +0 -1
  642. package/dist/tower/ui/Errors.d.ts +0 -5
  643. package/dist/tower/ui/Errors.d.ts.map +0 -1
  644. package/dist/tower/ui/Errors.js +0 -30
  645. package/dist/tower/ui/Errors.js.map +0 -1
  646. package/dist/tower/ui/Fibers.d.ts.map +0 -1
  647. package/dist/tower/ui/Fibers.js +0 -157
  648. package/dist/tower/ui/Fibers.js.map +0 -1
  649. package/dist/tower/ui/Logs.d.ts +0 -5
  650. package/dist/tower/ui/Logs.d.ts.map +0 -1
  651. package/dist/tower/ui/Logs.js.map +0 -1
  652. package/dist/tower/ui/Metrics.d.ts +0 -5
  653. package/dist/tower/ui/Metrics.d.ts.map +0 -1
  654. package/dist/tower/ui/Metrics.js.map +0 -1
  655. package/dist/tower/ui/Routes.d.ts.map +0 -1
  656. package/dist/tower/ui/Routes.js.map +0 -1
  657. package/dist/tower/ui/Services.d.ts.map +0 -1
  658. package/dist/tower/ui/Services.js.map +0 -1
  659. package/dist/tower/ui/Shell.d.ts.map +0 -1
  660. package/dist/tower/ui/Shell.js +0 -12
  661. package/dist/tower/ui/Shell.js.map +0 -1
  662. package/dist/tower/ui/System.d.ts +0 -5
  663. package/dist/tower/ui/System.d.ts.map +0 -1
  664. package/dist/tower/ui/System.js +0 -65
  665. package/dist/tower/ui/System.js.map +0 -1
  666. package/dist/tower/ui/Traces.d.ts +0 -13
  667. package/dist/tower/ui/Traces.d.ts.map +0 -1
  668. package/dist/tower/ui/Traces.js +0 -219
  669. package/dist/tower/ui/Traces.js.map +0 -1
  670. package/dist/x/cloudflare/CloudflareTunnel.d.ts +0 -11
  671. package/dist/x/cloudflare/CloudflareTunnel.d.ts.map +0 -1
  672. package/dist/x/cloudflare/CloudflareTunnel.js.map +0 -1
  673. package/dist/x/cloudflare/index.d.ts.map +0 -1
  674. package/dist/x/cloudflare/index.js.map +0 -1
  675. package/dist/x/tailscale/TailscaleTunnel.d.ts +0 -16
  676. package/dist/x/tailscale/TailscaleTunnel.d.ts.map +0 -1
  677. package/dist/x/tailscale/TailscaleTunnel.js.map +0 -1
  678. package/dist/x/tailscale/index.d.ts.map +0 -1
  679. package/dist/x/tailscale/index.js.map +0 -1
  680. package/dist/x/tailwind/TailwindPlugin.d.ts.map +0 -1
  681. package/dist/x/tailwind/TailwindPlugin.js.map +0 -1
  682. package/dist/x/tailwind/compile.d.ts.map +0 -1
  683. package/dist/x/tailwind/compile.js.map +0 -1
  684. package/dist/x/tailwind/plugin.d.ts.map +0 -1
  685. package/src/Commander.ts +0 -585
  686. package/src/FilePathPattern.ts +0 -115
  687. package/src/PlatformError.ts +0 -73
  688. package/src/TuplePathPattern.ts +0 -75
  689. package/src/hyper/Hyper.ts +0 -55
  690. package/src/hyper/HyperNode.ts +0 -34
  691. package/src/hyper/HyperRoute.ts +0 -59
  692. package/src/hyper/html.ts +0 -47
  693. package/src/hyper/index.ts +0 -6
  694. package/src/hyper/jsx-runtime.ts +0 -15
  695. package/src/tower/Tower.ts +0 -47
  696. package/src/tower/index.ts +0 -3
  697. package/src/tower/routes/route.tsx +0 -8
  698. /package/dist/{x/cloudflare → cloudflare}/index.d.ts +0 -0
  699. /package/dist/{x/cloudflare → cloudflare}/index.js +0 -0
  700. /package/dist/{tower → studio}/Simulation.d.ts +0 -0
  701. /package/dist/{tower → studio}/Simulation.js +0 -0
  702. /package/dist/{tower → studio}/routes/layout.d.ts +0 -0
  703. /package/dist/{tower → studio}/routes/layout.js +0 -0
  704. /package/dist/{tower → studio}/routes/tree.js +0 -0
  705. /package/dist/{x/tailscale → tailscale}/index.d.ts +0 -0
  706. /package/dist/{x/tailscale → tailscale}/index.js +0 -0
  707. /package/dist/{x/tailwind → tailwind}/TailwindPlugin.js +0 -0
  708. /package/dist/{x/tailwind → tailwind}/compile.d.ts +0 -0
  709. /package/dist/{x/tailwind → tailwind}/plugin.d.ts +0 -0
  710. /package/src/{ContentNegotiation.ts → _ContentNegotiation.ts} +0 -0
  711. /package/src/{Effectify.ts → _Effectify.ts} +0 -0
  712. /package/src/{StartApp.ts → _StartApp.ts} +0 -0
  713. /package/src/{StreamExtra.ts → _StreamExtra.ts} +0 -0
  714. /package/src/{Values.ts → _Values.ts} +0 -0
  715. /package/src/{x/cloudflare → cloudflare}/index.ts +0 -0
  716. /package/src/{tower → studio}/Simulation.ts +0 -0
  717. /package/src/{tower → studio}/routes/layout.tsx +0 -0
  718. /package/src/{tower → studio}/routes/tree.ts +0 -0
  719. /package/src/{tower → studio}/ui/Routes.tsx +0 -0
  720. /package/src/{tower → studio}/ui/Services.tsx +0 -0
  721. /package/src/{x/tailscale → tailscale}/index.ts +0 -0
  722. /package/src/{x/tailwind → tailwind}/TailwindPlugin.ts +0 -0
package/src/RouteHttp.ts CHANGED
@@ -7,15 +7,16 @@ import * as Option from "effect/Option"
7
7
  import type * as ParseResult from "effect/ParseResult"
8
8
  import * as Runtime from "effect/Runtime"
9
9
  import * as Stream from "effect/Stream"
10
- import * as ContentNegotiation from "./ContentNegotiation.ts"
10
+ import * as ContentNegotiation from "./_ContentNegotiation.ts"
11
+ import * as Development from "./Development.ts"
11
12
  import * as Entity from "./Entity.ts"
12
- import type * as Http from "./Http.ts"
13
+ import type * as Http from "./_Http.ts"
13
14
  import * as Route from "./Route.ts"
14
15
  import type * as RouteBody from "./RouteBody.ts"
15
16
  import * as RouteHttpTracer from "./RouteHttpTracer.ts"
16
17
  import type * as RouteMount from "./RouteMount.ts"
17
18
  import * as RouteTree from "./RouteTree.ts"
18
- import * as StreamExtra from "./StreamExtra.ts"
19
+ import * as StreamExtra from "./_StreamExtra.ts"
19
20
 
20
21
  type UnboundedRouteWithMethod = Route.Route.With<{
21
22
  method: RouteMount.RouteMount.Method
@@ -63,10 +64,13 @@ const getStatusFromCause = (cause: Cause.Cause<unknown>): number => {
63
64
  return 500
64
65
  }
65
66
 
66
- const respondError = (options: { status: number; message: string }): Response =>
67
+ const respondError = (
68
+ options: { status: number; message: string },
69
+ headers?: Record<string, string>,
70
+ ): Response =>
67
71
  new Response(JSON.stringify(options, null, 2), {
68
72
  status: options.status,
69
- headers: { "content-type": "application/json" },
73
+ headers: { "content-type": "application/json", ...headers },
70
74
  })
71
75
 
72
76
  function streamResponse(
@@ -188,140 +192,158 @@ export const toWebHandlerRuntime = <R>(runtime: Runtime.Runtime<R>) => {
188
192
  }
189
193
  }
190
194
 
191
- return (request) => {
192
- const method = request.method.toUpperCase()
193
- const accept = request.headers.get("accept")
194
- const methodRoutes = methodGroups[method] ?? []
195
+ const allowedMethods = Object.keys(methodGroups)
196
+ .filter((m) => methodGroups[m] !== undefined && methodGroups[m]!.length > 0)
197
+ .join(", ")
198
+
199
+ return (request) =>
200
+ new Promise((resolve) => {
201
+ const method = request.method.toUpperCase()
202
+ const accept = request.headers.get("accept")
203
+ const methodRoutes = methodGroups[method] ?? []
204
+
205
+ if (method === "OPTIONS" && methodRoutes.length === 0 && wildcards.length === 0) {
206
+ return resolve(
207
+ new Response(null, {
208
+ status: 204,
209
+ headers: { allow: allowedMethods },
210
+ }),
211
+ )
212
+ }
195
213
 
196
- if (methodRoutes.length === 0 && wildcards.length === 0) {
197
- return Promise.resolve(respondError({ status: 405, message: "method not allowed" }))
198
- }
214
+ if (methodRoutes.length === 0 && wildcards.length === 0) {
215
+ return resolve(
216
+ respondError({ status: 405, message: "method not allowed" }, { allow: allowedMethods }),
217
+ )
218
+ }
199
219
 
200
- const allRoutes = [...wildcards, ...methodRoutes]
201
- const selectedFormat = determineSelectedFormat(accept, allRoutes)
220
+ const allRoutes = [...wildcards, ...methodRoutes]
221
+ const selectedFormat = determineSelectedFormat(accept, allRoutes)
202
222
 
203
- const specificFormats = new Set<string>()
204
- let hasWildcardFormatRoutes = false
205
- for (const r of allRoutes) {
206
- const format = Route.descriptor(r).format
207
- if (format === "*") hasWildcardFormatRoutes = true
208
- else if (format) specificFormats.add(format)
209
- }
210
- const hasSpecificFormatRoutes = specificFormats.size > 0
211
- const varyAccept = specificFormats.size > 1
223
+ const specificFormats = new Set<string>()
224
+ let hasWildcardFormatRoutes = false
225
+ for (const r of allRoutes) {
226
+ const format = Route.descriptor(r).format
227
+ if (format === "*") hasWildcardFormatRoutes = true
228
+ else if (format) specificFormats.add(format)
229
+ }
230
+ const hasSpecificFormatRoutes = specificFormats.size > 0
231
+ const varyAccept = specificFormats.size > 1
212
232
 
213
- if (selectedFormat === undefined && hasSpecificFormatRoutes && !hasWildcardFormatRoutes) {
214
- return Promise.resolve(respondError({ status: 406, message: "not acceptable" }))
215
- }
233
+ if (selectedFormat === undefined && hasSpecificFormatRoutes && !hasWildcardFormatRoutes) {
234
+ return resolve(respondError({ status: 406, message: "not acceptable" }))
235
+ }
216
236
 
217
- const createChain = (initialContext: any): Effect.Effect<Entity.Entity<any>, any, any> => {
218
- let index = 0
219
- let currentContext = initialContext
220
- let routePathSet = false
237
+ const createChain = (initialContext: any): Effect.Effect<Entity.Entity<any>, any, any> => {
238
+ let index = 0
239
+ let currentContext = initialContext
240
+ let routePathSet = false
221
241
 
222
- const runNext = (passedContext?: any): Effect.Effect<Entity.Entity<any>, any, any> => {
223
- if (passedContext !== undefined) {
224
- currentContext = passedContext
225
- }
242
+ const runNext = (passedContext?: any): Effect.Effect<Entity.Entity<any>, any, any> => {
243
+ if (passedContext !== undefined) {
244
+ currentContext = passedContext
245
+ }
226
246
 
227
- if (index >= allRoutes.length) {
228
- return Effect.succeed(
229
- Entity.make({ status: 404, message: "route not found" }, { status: 404 }),
230
- )
231
- }
247
+ if (index >= allRoutes.length) {
248
+ return Effect.succeed(
249
+ Entity.make({ status: 404, message: "route not found" }, { status: 404 }),
250
+ )
251
+ }
232
252
 
233
- const route = allRoutes[index++]
234
- const descriptor = Route.descriptor(route)
235
- const format = descriptor.format
236
- const handler = route.handler as unknown as Handler
253
+ const route = allRoutes[index++]
254
+ const descriptor = Route.descriptor(route)
255
+ const format = descriptor.format
256
+ const handler = route.handler as unknown as Handler
237
257
 
238
- if (format && format !== "*" && format !== selectedFormat) {
239
- return runNext()
240
- }
258
+ if (format && format !== "*" && format !== selectedFormat) {
259
+ return runNext()
260
+ }
241
261
 
242
- currentContext = { ...currentContext, ...descriptor }
262
+ currentContext = { ...currentContext, ...descriptor }
243
263
 
244
- const nextArg = (ctx?: any) => Entity.effect(Effect.suspend(() => runNext(ctx)))
264
+ const nextArg = (ctx?: any) => Entity.effect(Effect.suspend(() => runNext(ctx)))
245
265
 
246
- const routePath = descriptor["path"]
247
- if (!routePathSet && routePath !== undefined) {
248
- routePathSet = true
249
- return Effect.flatMap(Effect.currentSpan.pipe(Effect.option), (spanOption) => {
250
- if (Option.isSome(spanOption)) {
251
- spanOption.value.attribute("http.route", routePath)
252
- }
253
- return handler(currentContext, nextArg)
254
- })
266
+ const routePath = descriptor["path"]
267
+ if (!routePathSet && routePath !== undefined) {
268
+ routePathSet = true
269
+ return Effect.flatMap(Effect.currentSpan.pipe(Effect.option), (spanOption) => {
270
+ if (Option.isSome(spanOption)) {
271
+ spanOption.value.attribute("http.route", routePath)
272
+ }
273
+ return handler(currentContext, nextArg)
274
+ })
275
+ }
276
+
277
+ return handler(currentContext, nextArg)
255
278
  }
256
279
 
257
- return handler(currentContext, nextArg)
280
+ return runNext()
258
281
  }
259
282
 
260
- return runNext()
261
- }
283
+ const effect = Effect.withFiberRuntime<Response, unknown, R>((fiber) => {
284
+ const tracerDisabled =
285
+ !fiber.getFiberRef(FiberRef.currentTracerEnabled) ||
286
+ fiber.getFiberRef(RouteHttpTracer.currentTracerDisabledWhen)(request)
262
287
 
263
- const effect = Effect.withFiberRuntime<Response, unknown, R>((fiber) => {
264
- const tracerDisabled =
265
- !fiber.getFiberRef(FiberRef.currentTracerEnabled) ||
266
- fiber.getFiberRef(RouteHttpTracer.currentTracerDisabledWhen)(request)
288
+ const url = new URL(request.url)
267
289
 
268
- const url = new URL(request.url)
290
+ const innerEffect = Effect.gen(function* () {
291
+ const result = yield* createChain({ request, selectedFormat })
269
292
 
270
- const innerEffect = Effect.gen(function* () {
271
- const result = yield* createChain({ request, selectedFormat })
293
+ const entity = Entity.isEntity(result) ? result : Entity.make(result, { status: 200 })
272
294
 
273
- const entity = Entity.isEntity(result) ? result : Entity.make(result, { status: 200 })
295
+ if (entity.status === 404 && entity.body === undefined) {
296
+ return respondError({ status: 406, message: "not acceptable" })
297
+ }
274
298
 
275
- if (entity.status === 404 && entity.body === undefined) {
276
- return respondError({ status: 406, message: "not acceptable" })
277
- }
299
+ const response = yield* toResponse(entity, selectedFormat, runtime)
300
+ if (varyAccept) {
301
+ response.headers.set("vary", "Accept")
302
+ }
303
+ return response
304
+ })
278
305
 
279
- const response = yield* toResponse(entity, selectedFormat, runtime)
280
- if (varyAccept) {
281
- response.headers.set("vary", "Accept")
306
+ if (tracerDisabled) {
307
+ return innerEffect
282
308
  }
283
- return response
284
- })
285
309
 
286
- if (tracerDisabled) {
287
- return innerEffect
288
- }
289
-
290
- const spanNameGenerator = fiber.getFiberRef(RouteHttpTracer.currentSpanNameGenerator)
291
-
292
- return Effect.useSpan(
293
- spanNameGenerator(request),
294
- {
295
- parent: Option.getOrUndefined(RouteHttpTracer.parentSpanFromHeaders(request.headers)),
296
- kind: "server",
297
- captureStackTrace: false,
298
- },
299
- (span) => {
300
- span.attribute("http.request.method", request.method)
301
- span.attribute("url.full", url.toString())
302
- span.attribute("url.path", url.pathname)
303
- const query = url.search.slice(1)
304
- if (query !== "") {
305
- span.attribute("url.query", query)
306
- }
307
- span.attribute("url.scheme", url.protocol.slice(0, -1))
308
-
309
- const userAgent = request.headers.get("user-agent")
310
- if (userAgent !== null) {
311
- span.attribute("user_agent.original", userAgent)
312
- }
310
+ const spanNameGenerator = fiber.getFiberRef(RouteHttpTracer.currentSpanNameGenerator)
311
+
312
+ return Effect.useSpan(
313
+ spanNameGenerator(request),
314
+ {
315
+ parent: Option.getOrUndefined(RouteHttpTracer.parentSpanFromHeaders(request.headers)),
316
+ kind: "server",
317
+ captureStackTrace: false,
318
+ },
319
+ (span) => {
320
+ span.attribute("http.request.method", request.method)
321
+ span.attribute("url.full", url.toString())
322
+ span.attribute("url.path", url.pathname)
323
+ const query = url.search.slice(1)
324
+ if (query !== "") {
325
+ span.attribute("url.query", query)
326
+ }
327
+ span.attribute("url.scheme", url.protocol.slice(0, -1))
313
328
 
314
- return Effect.flatMap(Effect.exit(Effect.withParentSpan(innerEffect, span)), (exit) => {
315
- if (exit._tag === "Success") {
316
- span.attribute("http.response.status_code", exit.value.status)
329
+ const userAgent = request.headers.get("user-agent")
330
+ if (userAgent !== null) {
331
+ span.attribute("user_agent.original", userAgent)
317
332
  }
318
- return exit
319
- })
320
- },
321
- )
322
- })
323
333
 
324
- return new Promise((resolve) => {
334
+ return Effect.flatMap(
335
+ Effect.exit(Effect.withParentSpan(innerEffect, span)),
336
+ (exit) => {
337
+ if (exit._tag === "Success") {
338
+ span.attribute("http.response.status_code", exit.value.status)
339
+ }
340
+ return exit
341
+ },
342
+ )
343
+ },
344
+ )
345
+ })
346
+
325
347
  const fiber = runFork(
326
348
  effect.pipe(
327
349
  Effect.scoped,
@@ -356,7 +378,6 @@ export const toWebHandlerRuntime = <R>(runtime: Runtime.Runtime<R>) => {
356
378
  }
357
379
  })
358
380
  })
359
- }
360
381
  }
361
382
  }
362
383
 
@@ -368,9 +389,26 @@ export function* walkHandles(
368
389
  runtime: Runtime.Runtime<never> = Runtime.defaultRuntime,
369
390
  ): Generator<[path: string, handler: Http.WebHandler]> {
370
391
  const pathGroups = new Map<string, Array<RouteMount.MountedRoute>>()
392
+ const runSync = Runtime.runSync(runtime)
393
+ const inDevelopment = Option.isSome(runSync(Development.option))
394
+ const developmentPaths = new Set<string>()
395
+
396
+ for (const route of RouteTree.walk(tree)) {
397
+ const descriptor = Route.descriptor<{ path: string; dev?: boolean }>(route)
398
+ if (descriptor.dev === true) {
399
+ developmentPaths.add(descriptor.path)
400
+ }
401
+ }
371
402
 
372
403
  for (const route of RouteTree.walk(tree)) {
373
- const path = Route.descriptor(route).path
404
+ const descriptor = Route.descriptor<{ path: string; dev?: boolean }>(route)
405
+ if (descriptor.dev === true) {
406
+ continue
407
+ }
408
+ const path = descriptor.path
409
+ if (!inDevelopment && developmentPaths.has(path)) {
410
+ continue
411
+ }
374
412
  const group = pathGroups.get(path) ?? []
375
413
  group.push(route)
376
414
  pathGroups.set(path, group)
package/src/RouteMount.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import * as Function from "effect/Function"
2
2
  import type * as Types from "effect/Types"
3
- import type * as Http from "./Http.ts"
4
- import type * as PathPattern from "./PathPattern.ts"
3
+ import type * as Http from "./_Http.ts"
4
+ import type * as PathPattern from "./_PathPattern.ts"
5
5
  import * as Route from "./Route.ts"
6
6
  import type * as RouteBody from "./RouteBody.ts"
7
7
 
8
- const RouteSetTypeId: unique symbol = Symbol.for("effect-start/RouteSet")
8
+ const RouteSetTypeId = "~effect-start/RouteSet" as const
9
9
 
10
10
  // oxlint-disable-next-line import/first, typescript/consistent-type-imports -- typeof import() is not an import statement
11
11
  type Module = typeof import("./RouteMount.ts")
@@ -83,7 +83,7 @@ function makeMethodDescriber<M extends RouteMount.Method>(method: M): RouteMount
83
83
  const result = f(methodSet)
84
84
  const resultItems = Route.items(result)
85
85
 
86
- // Items are already flat (only Routes), just merge method into each descriptor
86
+ // Items are already flat (only Routes), merge method into each descriptor
87
87
  const flattenedItems = resultItems.map((item) => {
88
88
  const itemDescriptor = Route.descriptor(item)
89
89
  const newDescriptor = { method, ...itemDescriptor }
@@ -3,8 +3,8 @@ import type * as ParseResult from "effect/ParseResult"
3
3
  import * as Schema from "effect/Schema"
4
4
  import type * as Scope from "effect/Scope"
5
5
  import * as Entity from "./Entity.ts"
6
- import * as Http from "./Http.ts"
7
- import * as PathPattern from "./PathPattern.ts"
6
+ import * as Http from "./_Http.ts"
7
+ import * as PathPattern from "./_PathPattern.ts"
8
8
  import * as Route from "./Route.ts"
9
9
  import * as RouteHook from "./RouteHook.ts"
10
10
 
package/src/RouteSse.ts CHANGED
@@ -5,46 +5,37 @@ import * as Stream from "effect/Stream"
5
5
  import type * as Utils from "effect/Utils"
6
6
  import * as Entity from "./Entity.ts"
7
7
  import * as Route from "./Route.ts"
8
- import * as StreamExtra from "./StreamExtra.ts"
9
- import type * as Values from "./Values.ts"
8
+ import * as StreamExtra from "./_StreamExtra.ts"
9
+ import type * as Values from "./_Values.ts"
10
10
 
11
11
  const HEARTBEAT_INTERVAL = Duration.seconds(5)
12
12
  const HEARTBEAT = ": <3\n\n"
13
13
 
14
- export interface SseEvent {
15
- data?: string | undefined
16
- type?: string
17
- retry?: number
14
+ interface SseEvent {
15
+ readonly [key: string]: unknown
16
+ readonly _tag?: string
17
+ readonly data?: string | undefined
18
+ readonly type?: string
19
+ readonly retry?: number
18
20
  }
19
21
 
20
- export type SseTaggedEvent = {
21
- readonly _tag: string
22
- }
23
-
24
- export type SseEventInput = SseEvent | SseTaggedEvent
25
-
26
- function isTaggedEvent(event: SseEventInput): event is SseTaggedEvent {
27
- return Object.hasOwn(event, "_tag") && typeof event["_tag"] === "string"
28
- }
29
-
30
- function formatSseEvent(event: SseEventInput): string {
31
- if (isTaggedEvent(event)) {
22
+ function formatSseEvent(event: SseEvent): string {
23
+ if (event._tag) {
32
24
  const json = JSON.stringify(event)
33
25
  return `event: ${event._tag}\ndata: ${json}\n\n`
34
26
  }
35
27
 
36
- const e = event as SseEvent
37
28
  let result = ""
38
- if (e.type) {
39
- result += `event: ${e.type}\n`
29
+ if (event.type) {
30
+ result += `event: ${event.type}\n`
40
31
  }
41
- if (typeof e.data === "string") {
42
- for (const line of e.data.split("\n")) {
32
+ if (typeof event.data === "string") {
33
+ for (const line of event.data.split("\n")) {
43
34
  result += `data: ${line}\n`
44
35
  }
45
36
  }
46
- if (e.retry !== undefined) {
47
- result += `retry: ${e.retry}\n`
37
+ if (event.retry !== undefined) {
38
+ result += `retry: ${event.retry}\n`
48
39
  }
49
40
  if (result === "") {
50
41
  return ""
@@ -52,18 +43,18 @@ function formatSseEvent(event: SseEventInput): string {
52
43
  return result + "\n"
53
44
  }
54
45
 
55
- export type SseHandlerInput<B, E, R> =
56
- | Stream.Stream<SseEventInput, E, R>
57
- | Effect.Effect<Stream.Stream<SseEventInput, E, R>, E, R>
46
+ type SseHandlerInput<B, E, R> =
47
+ | Stream.Stream<SseEvent, E, R>
48
+ | Effect.Effect<Stream.Stream<SseEvent, E, R>, E, R>
58
49
  | ((
59
50
  context: Values.Simplify<B>,
60
51
  next: (context?: Partial<B> & Record<string, unknown>) => Entity.Entity<string>,
61
52
  ) =>
62
- | Stream.Stream<SseEventInput, E, R>
63
- | Effect.Effect<Stream.Stream<SseEventInput, E, R>, E, R>
53
+ | Stream.Stream<SseEvent, E, R>
54
+ | Effect.Effect<Stream.Stream<SseEvent, E, R>, E, R>
64
55
  | Generator<
65
56
  Utils.YieldWrap<Effect.Effect<unknown, E, R>>,
66
- Stream.Stream<SseEventInput, E, R>,
57
+ Stream.Stream<SseEvent, E, R>,
67
58
  unknown
68
59
  >)
69
60
 
@@ -81,24 +72,24 @@ export function sse<
81
72
  E,
82
73
  R
83
74
  > = (ctx, _next) => {
84
- const getStream = (): Effect.Effect<Stream.Stream<SseEventInput, E, R>, E, R> => {
75
+ const getStream = (): Effect.Effect<Stream.Stream<SseEvent, E, R>, E, R> => {
85
76
  if (typeof handler === "function") {
86
77
  const result = (handler as Function)(ctx, _next)
87
78
  if (StreamExtra.isStream(result)) {
88
- return Effect.succeed(result as Stream.Stream<SseEventInput, E, R>)
79
+ return Effect.succeed(result as Stream.Stream<SseEvent, E, R>)
89
80
  }
90
81
  if (Effect.isEffect(result)) {
91
- return result as Effect.Effect<Stream.Stream<SseEventInput, E, R>, E, R>
82
+ return result as Effect.Effect<Stream.Stream<SseEvent, E, R>, E, R>
92
83
  }
93
84
  return Effect.gen(function* () {
94
85
  return yield* result
95
- }) as Effect.Effect<Stream.Stream<SseEventInput, E, R>, E, R>
86
+ }) as Effect.Effect<Stream.Stream<SseEvent, E, R>, E, R>
96
87
  }
97
88
  if (StreamExtra.isStream(handler)) {
98
- return Effect.succeed(handler as Stream.Stream<SseEventInput, E, R>)
89
+ return Effect.succeed(handler as Stream.Stream<SseEvent, E, R>)
99
90
  }
100
91
  if (Effect.isEffect(handler)) {
101
- return handler as Effect.Effect<Stream.Stream<SseEventInput, E, R>, E, R>
92
+ return handler as Effect.Effect<Stream.Stream<SseEvent, E, R>, E, R>
102
93
  }
103
94
  return Effect.succeed(Stream.empty)
104
95
  }
package/src/RouteTree.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import * as Predicate from "effect/Predicate"
2
- import * as PathPattern from "./PathPattern.ts"
2
+ import * as PathPattern from "./_PathPattern.ts"
3
3
  import * as Route from "./Route.ts"
4
4
  import type * as RouteMount from "./RouteMount.ts"
5
5
 
6
- const TypeId: unique symbol = Symbol.for("effect-start/RouteTree")
6
+ const TypeId = "~effect-start/RouteTree" as const
7
7
  const RouteTreeRoutes: unique symbol = Symbol()
8
8
 
9
9
  type MethodRoute = Route.Route.With<{ method: string }>
package/src/RouteTrie.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as PathPattern from "./PathPattern.ts"
1
+ import * as PathPattern from "./_PathPattern.ts"
2
2
  import * as Route from "./Route.ts"
3
3
 
4
4
  export interface Node {
package/src/Socket.ts CHANGED
@@ -1,50 +1,40 @@
1
1
  /*
2
2
  * Adapted from @effect/platform
3
3
  */
4
+ import * as Data from "effect/Data"
4
5
  import * as Predicate from "effect/Predicate"
5
- import * as PlatformError from "./PlatformError.ts"
6
6
 
7
- export const SocketErrorTypeId: unique symbol = Symbol.for("@effect/platform/Socket/SocketError")
8
-
9
- export type SocketErrorTypeId = typeof SocketErrorTypeId
7
+ const SocketErrorTypeId: unique symbol = Symbol.for("@effect/platform/Socket/SocketError")
10
8
 
11
9
  export const isSocketError = (u: unknown): u is SocketError =>
12
10
  Predicate.hasProperty(u, SocketErrorTypeId)
13
11
 
14
- export type SocketError = SocketGenericError | SocketCloseError
15
-
16
- export class SocketGenericError extends PlatformError.TypeIdError(
17
- SocketErrorTypeId,
18
- "SocketError",
19
- )<{
20
- readonly reason: "Write" | "Read" | "Open" | "OpenTimeout"
21
- readonly cause: unknown
22
- }> {
23
- get message() {
24
- return `An error occurred during ${this.reason}`
25
- }
26
- }
27
-
28
- export class SocketCloseError extends PlatformError.TypeIdError(SocketErrorTypeId, "SocketError")<{
29
- readonly reason: "Close"
30
- readonly code: number
12
+ export class SocketError extends Data.TaggedError("SocketError")<{
13
+ readonly reason: "Write" | "Read" | "Open" | "OpenTimeout" | "Close"
14
+ readonly cause?: unknown
15
+ readonly code?: number | undefined
31
16
  readonly closeReason?: string | undefined
32
17
  }> {
33
- static is(u: unknown): u is SocketCloseError {
18
+ readonly [SocketErrorTypeId]: typeof SocketErrorTypeId = SocketErrorTypeId
19
+
20
+ static isClose(u: unknown): u is SocketError & { reason: "Close" } {
34
21
  return isSocketError(u) && u.reason === "Close"
35
22
  }
36
23
 
37
24
  static isClean(isClean: (code: number) => boolean) {
38
- return function (u: unknown): u is SocketCloseError {
39
- return SocketCloseError.is(u) && isClean(u.code)
25
+ return function (u: unknown): u is SocketError & { reason: "Close" } {
26
+ return SocketError.isClose(u) && u.code !== undefined && isClean(u.code)
40
27
  }
41
28
  }
42
29
 
43
30
  get message() {
44
- if (this.closeReason) {
45
- return `${this.reason}: ${this.code}: ${this.closeReason}`
31
+ if (this.reason === "Close") {
32
+ if (this.closeReason) {
33
+ return `${this.reason}: ${this.code}: ${this.closeReason}`
34
+ }
35
+ return `${this.reason}: ${this.code}`
46
36
  }
47
- return `${this.reason}: ${this.code}`
37
+ return `An error occurred during ${this.reason}`
48
38
  }
49
39
  }
50
40