effect-start 0.27.0 → 0.29.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.
- package/dist/Cookies.d.ts +46 -0
- package/dist/Cookies.d.ts.map +1 -0
- package/dist/Cookies.js +303 -0
- package/dist/Cookies.js.map +1 -0
- package/dist/Entity.d.ts +47 -0
- package/dist/Entity.d.ts.map +1 -0
- package/dist/Entity.js +238 -0
- package/dist/Entity.js.map +1 -0
- package/dist/Fetch.d.ts +69 -0
- package/dist/Fetch.d.ts.map +1 -0
- package/dist/Fetch.js +225 -0
- package/dist/Fetch.js.map +1 -0
- package/dist/FileRouter.d.ts +54 -0
- package/dist/FileRouter.d.ts.map +1 -0
- package/dist/FileRouter.js +158 -0
- package/dist/FileRouter.js.map +1 -0
- package/dist/FileRouterCodegen.d.ts +19 -0
- package/dist/FileRouterCodegen.d.ts.map +1 -0
- package/dist/FileRouterCodegen.js +216 -0
- package/dist/FileRouterCodegen.js.map +1 -0
- package/dist/FileSystem.d.ts +159 -0
- package/dist/FileSystem.d.ts.map +1 -0
- package/dist/FileSystem.js +73 -0
- package/dist/FileSystem.js.map +1 -0
- package/dist/GlobalLayer.d.ts +4 -0
- package/dist/GlobalLayer.d.ts.map +1 -0
- package/dist/GlobalLayer.js +51 -0
- package/dist/GlobalLayer.js.map +1 -0
- package/dist/PlatformRuntime.d.ts +30 -0
- package/dist/PlatformRuntime.d.ts.map +1 -0
- package/dist/PlatformRuntime.js +50 -0
- package/dist/PlatformRuntime.js.map +1 -0
- package/dist/Route.d.ts +98 -0
- package/dist/Route.d.ts.map +1 -0
- package/dist/Route.js +101 -0
- package/dist/Route.js.map +1 -0
- package/dist/RouteBody.d.ts +48 -0
- package/dist/RouteBody.d.ts.map +1 -0
- package/dist/RouteBody.js +68 -0
- package/dist/RouteBody.js.map +1 -0
- package/dist/RouteError.d.ts +99 -0
- package/dist/RouteError.d.ts.map +1 -0
- package/dist/RouteError.js +56 -0
- package/dist/RouteError.js.map +1 -0
- package/dist/RouteHook.d.ts +13 -0
- package/dist/RouteHook.d.ts.map +1 -0
- package/dist/RouteHook.js +40 -0
- package/dist/RouteHook.js.map +1 -0
- package/dist/RouteHttp.d.ts +22 -0
- package/dist/RouteHttp.d.ts.map +1 -0
- package/dist/RouteHttp.js +266 -0
- package/dist/RouteHttp.js.map +1 -0
- package/dist/RouteHttpTracer.d.ts +11 -0
- package/dist/RouteHttpTracer.d.ts.map +1 -0
- package/dist/RouteHttpTracer.js +63 -0
- package/dist/RouteHttpTracer.js.map +1 -0
- package/dist/RouteMount.d.ts +87 -0
- package/dist/RouteMount.d.ts.map +1 -0
- package/dist/RouteMount.js +64 -0
- package/dist/RouteMount.js.map +1 -0
- package/dist/RouteSchema.d.ts +87 -0
- package/dist/RouteSchema.d.ts.map +1 -0
- package/dist/RouteSchema.js +189 -0
- package/dist/RouteSchema.js.map +1 -0
- package/dist/RouteSse.d.ts +21 -0
- package/dist/RouteSse.d.ts.map +1 -0
- package/dist/RouteSse.js +76 -0
- package/dist/RouteSse.js.map +1 -0
- package/dist/RouteTree.d.ts +58 -0
- package/dist/RouteTree.d.ts.map +1 -0
- package/dist/RouteTree.js +94 -0
- package/dist/RouteTree.js.map +1 -0
- package/dist/RouteTrie.d.ts +21 -0
- package/dist/RouteTrie.d.ts.map +1 -0
- package/dist/RouteTrie.js +153 -0
- package/dist/RouteTrie.js.map +1 -0
- package/dist/Socket.d.ts +23 -0
- package/dist/Socket.d.ts.map +1 -0
- package/dist/Socket.js +29 -0
- package/dist/Socket.js.map +1 -0
- package/dist/Start.d.ts +82 -0
- package/dist/Start.d.ts.map +1 -0
- package/dist/Start.js +102 -0
- package/dist/Start.js.map +1 -0
- package/dist/System.d.ts +24 -0
- package/dist/System.d.ts.map +1 -0
- package/dist/System.js +31 -0
- package/dist/System.js.map +1 -0
- package/dist/Unique.d.ts +68 -0
- package/dist/Unique.d.ts.map +1 -0
- package/dist/Unique.js +225 -0
- package/dist/Unique.js.map +1 -0
- package/dist/_ChildProcess.d.ts +59 -0
- package/dist/_ChildProcess.d.ts.map +1 -0
- package/dist/_ChildProcess.js +30 -0
- package/dist/_ChildProcess.js.map +1 -0
- package/dist/_ContentNegotiation.d.ts +13 -0
- package/dist/_ContentNegotiation.d.ts.map +1 -0
- package/dist/_ContentNegotiation.js +360 -0
- package/dist/_ContentNegotiation.js.map +1 -0
- package/dist/_Development.d.ts +27 -0
- package/dist/_Development.d.ts.map +1 -0
- package/dist/_Development.js +57 -0
- package/dist/_Development.js.map +1 -0
- package/dist/_Docker.d.ts +51 -0
- package/dist/_Docker.d.ts.map +1 -0
- package/dist/_Docker.js +88 -0
- package/dist/_Docker.js.map +1 -0
- package/dist/_Effectify.d.ts +210 -0
- package/dist/_Effectify.d.ts.map +1 -0
- package/dist/_Effectify.js +20 -0
- package/dist/_Effectify.js.map +1 -0
- package/dist/_Http.d.ts +31 -0
- package/dist/_Http.d.ts.map +1 -0
- package/dist/_Http.js +73 -0
- package/dist/_Http.js.map +1 -0
- package/dist/_PathPattern.d.ts +146 -0
- package/dist/_PathPattern.d.ts.map +1 -0
- package/dist/_PathPattern.js +499 -0
- package/dist/_PathPattern.js.map +1 -0
- package/dist/_SchemaExtra.d.ts +4 -0
- package/dist/_SchemaExtra.d.ts.map +1 -0
- package/dist/_SchemaExtra.js +75 -0
- package/dist/_SchemaExtra.js.map +1 -0
- package/dist/_StartApp.d.ts +13 -0
- package/dist/_StartApp.d.ts.map +1 -0
- package/dist/_StartApp.js +4 -0
- package/dist/_StartApp.js.map +1 -0
- package/dist/_StreamExtra.d.ts +29 -0
- package/dist/_StreamExtra.d.ts.map +1 -0
- package/dist/_StreamExtra.js +101 -0
- package/dist/_StreamExtra.js.map +1 -0
- package/dist/_Values.d.ts +30 -0
- package/dist/_Values.d.ts.map +1 -0
- package/dist/_Values.js +46 -0
- package/dist/_Values.js.map +1 -0
- package/dist/bun/BunBundle.d.ts +12 -0
- package/dist/bun/BunBundle.d.ts.map +1 -0
- package/dist/bun/BunBundle.js +138 -0
- package/dist/bun/BunBundle.js.map +1 -0
- package/dist/bun/BunChildProcessSpawner.d.ts +4 -0
- package/dist/bun/BunChildProcessSpawner.d.ts.map +1 -0
- package/dist/bun/BunChildProcessSpawner.js +99 -0
- package/dist/bun/BunChildProcessSpawner.js.map +1 -0
- package/dist/bun/BunImportTrackerPlugin.d.ts +14 -0
- package/dist/bun/BunImportTrackerPlugin.d.ts.map +1 -0
- package/dist/bun/BunImportTrackerPlugin.js +70 -0
- package/dist/bun/BunImportTrackerPlugin.js.map +1 -0
- package/dist/bun/BunRoute.d.ts +49 -0
- package/dist/bun/BunRoute.d.ts.map +1 -0
- package/dist/bun/BunRoute.js +121 -0
- package/dist/bun/BunRoute.js.map +1 -0
- package/dist/bun/BunRuntime.d.ts +3 -0
- package/dist/bun/BunRuntime.d.ts.map +1 -0
- package/dist/bun/BunRuntime.js +30 -0
- package/dist/bun/BunRuntime.js.map +1 -0
- package/dist/bun/BunServer.d.ts +52 -0
- package/dist/bun/BunServer.d.ts.map +1 -0
- package/dist/bun/BunServer.js +262 -0
- package/dist/bun/BunServer.js.map +1 -0
- package/dist/bun/BunVirtualFilesPlugin.d.ts +5 -0
- package/dist/bun/BunVirtualFilesPlugin.d.ts.map +1 -0
- package/dist/bun/BunVirtualFilesPlugin.js +41 -0
- package/dist/bun/BunVirtualFilesPlugin.js.map +1 -0
- package/dist/bun/_BunEnhancedResolve.d.ts +46 -0
- package/dist/bun/_BunEnhancedResolve.d.ts.map +1 -0
- package/dist/bun/_BunEnhancedResolve.js +103 -0
- package/dist/bun/_BunEnhancedResolve.js.map +1 -0
- package/dist/bun/_empty.html +0 -0
- package/dist/bun/index.d.ts +6 -0
- package/dist/bun/index.d.ts.map +1 -0
- package/dist/bun/index.js +6 -0
- package/dist/bun/index.js.map +1 -0
- package/dist/bundler/Bundle.d.ts +62 -0
- package/dist/bundler/Bundle.d.ts.map +1 -0
- package/dist/bundler/Bundle.js +49 -0
- package/dist/bundler/Bundle.js.map +1 -0
- package/dist/bundler/BundleFiles.d.ts +14 -0
- package/dist/bundler/BundleFiles.d.ts.map +1 -0
- package/dist/bundler/BundleFiles.js +97 -0
- package/dist/bundler/BundleFiles.js.map +1 -0
- package/dist/bundler/BundleRoute.d.ts +28 -0
- package/dist/bundler/BundleRoute.d.ts.map +1 -0
- package/dist/bundler/BundleRoute.js +52 -0
- package/dist/bundler/BundleRoute.js.map +1 -0
- package/dist/cli/Argument.d.ts +26 -0
- package/dist/cli/Argument.d.ts.map +1 -0
- package/dist/cli/Argument.js +31 -0
- package/dist/cli/Argument.js.map +1 -0
- package/dist/cli/CliError.d.ts +15 -0
- package/dist/cli/CliError.d.ts.map +1 -0
- package/dist/cli/CliError.js +54 -0
- package/dist/cli/CliError.js.map +1 -0
- package/dist/cli/Command.d.ts +61 -0
- package/dist/cli/Command.d.ts.map +1 -0
- package/dist/cli/Command.js +453 -0
- package/dist/cli/Command.js.map +1 -0
- package/dist/cli/Flag.d.ts +32 -0
- package/dist/cli/Flag.d.ts.map +1 -0
- package/dist/cli/Flag.js +35 -0
- package/dist/cli/Flag.js.map +1 -0
- package/dist/cli/HelpDoc.d.ts +28 -0
- package/dist/cli/HelpDoc.d.ts.map +1 -0
- package/dist/cli/HelpDoc.js +40 -0
- package/dist/cli/HelpDoc.js.map +1 -0
- package/dist/cli/Param.d.ts +71 -0
- package/dist/cli/Param.d.ts.map +1 -0
- package/dist/cli/Param.js +236 -0
- package/dist/cli/Param.js.map +1 -0
- package/dist/cli/Primitive.d.ts +22 -0
- package/dist/cli/Primitive.d.ts.map +1 -0
- package/dist/cli/Primitive.js +73 -0
- package/dist/cli/Primitive.js.map +1 -0
- package/dist/cli/index.d.ts +8 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +8 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/client/Overlay.d.ts +3 -0
- package/dist/client/Overlay.d.ts.map +1 -0
- package/dist/client/Overlay.js +33 -0
- package/dist/client/Overlay.js.map +1 -0
- package/dist/client/ScrollState.d.ts +7 -0
- package/dist/client/ScrollState.d.ts.map +1 -0
- package/dist/client/ScrollState.js +95 -0
- package/dist/client/ScrollState.js.map +1 -0
- package/dist/client/index.d.ts +7 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +80 -0
- package/dist/client/index.js.map +1 -0
- package/dist/datastar/actions/fetch.d.ts +31 -0
- package/dist/datastar/actions/fetch.d.ts.map +1 -0
- package/dist/datastar/actions/fetch.js +404 -0
- package/dist/datastar/actions/fetch.js.map +1 -0
- package/dist/datastar/actions/peek.d.ts +2 -0
- package/dist/datastar/actions/peek.d.ts.map +1 -0
- package/dist/datastar/actions/peek.js +14 -0
- package/dist/datastar/actions/peek.js.map +1 -0
- package/dist/datastar/actions/setAll.d.ts +2 -0
- package/dist/datastar/actions/setAll.d.ts.map +1 -0
- package/dist/datastar/actions/setAll.js +13 -0
- package/dist/datastar/actions/setAll.js.map +1 -0
- package/dist/datastar/actions/toggleAll.d.ts +2 -0
- package/dist/datastar/actions/toggleAll.d.ts.map +1 -0
- package/dist/datastar/actions/toggleAll.js +13 -0
- package/dist/datastar/actions/toggleAll.js.map +1 -0
- package/dist/datastar/attributes/attr.d.ts +2 -0
- package/dist/datastar/attributes/attr.d.ts.map +1 -0
- package/dist/datastar/attributes/attr.js +49 -0
- package/dist/datastar/attributes/attr.js.map +1 -0
- package/dist/datastar/attributes/bind.d.ts +2 -0
- package/dist/datastar/attributes/bind.d.ts.map +1 -0
- package/dist/datastar/attributes/bind.js +176 -0
- package/dist/datastar/attributes/bind.js.map +1 -0
- package/dist/datastar/attributes/class.d.ts +2 -0
- package/dist/datastar/attributes/class.d.ts.map +1 -0
- package/dist/datastar/attributes/class.js +48 -0
- package/dist/datastar/attributes/class.js.map +1 -0
- package/dist/datastar/attributes/computed.d.ts +2 -0
- package/dist/datastar/attributes/computed.d.ts.map +1 -0
- package/dist/datastar/attributes/computed.js +27 -0
- package/dist/datastar/attributes/computed.js.map +1 -0
- package/dist/datastar/attributes/effect.d.ts +2 -0
- package/dist/datastar/attributes/effect.d.ts.map +1 -0
- package/dist/datastar/attributes/effect.js +10 -0
- package/dist/datastar/attributes/effect.js.map +1 -0
- package/dist/datastar/attributes/indicator.d.ts +2 -0
- package/dist/datastar/attributes/indicator.d.ts.map +1 -0
- package/dist/datastar/attributes/indicator.js +31 -0
- package/dist/datastar/attributes/indicator.js.map +1 -0
- package/dist/datastar/attributes/init.d.ts +2 -0
- package/dist/datastar/attributes/init.d.ts.map +1 -0
- package/dist/datastar/attributes/init.js +27 -0
- package/dist/datastar/attributes/init.js.map +1 -0
- package/dist/datastar/attributes/jsonSignals.d.ts +2 -0
- package/dist/datastar/attributes/jsonSignals.d.ts.map +1 -0
- package/dist/datastar/attributes/jsonSignals.js +31 -0
- package/dist/datastar/attributes/jsonSignals.js.map +1 -0
- package/dist/datastar/attributes/on.d.ts +2 -0
- package/dist/datastar/attributes/on.d.ts.map +1 -0
- package/dist/datastar/attributes/on.js +79 -0
- package/dist/datastar/attributes/on.js.map +1 -0
- package/dist/datastar/attributes/onIntersect.d.ts +2 -0
- package/dist/datastar/attributes/onIntersect.d.ts.map +1 -0
- package/dist/datastar/attributes/onIntersect.js +54 -0
- package/dist/datastar/attributes/onIntersect.js.map +1 -0
- package/dist/datastar/attributes/onInterval.d.ts +2 -0
- package/dist/datastar/attributes/onInterval.d.ts.map +1 -0
- package/dist/datastar/attributes/onInterval.js +31 -0
- package/dist/datastar/attributes/onInterval.js.map +1 -0
- package/dist/datastar/attributes/onSignalPatch.d.ts +2 -0
- package/dist/datastar/attributes/onSignalPatch.d.ts.map +1 -0
- package/dist/datastar/attributes/onSignalPatch.js +43 -0
- package/dist/datastar/attributes/onSignalPatch.js.map +1 -0
- package/dist/datastar/attributes/ref.d.ts +2 -0
- package/dist/datastar/attributes/ref.d.ts.map +1 -0
- package/dist/datastar/attributes/ref.js +11 -0
- package/dist/datastar/attributes/ref.js.map +1 -0
- package/dist/datastar/attributes/show.d.ts +2 -0
- package/dist/datastar/attributes/show.d.ts.map +1 -0
- package/dist/datastar/attributes/show.js +32 -0
- package/dist/datastar/attributes/show.js.map +1 -0
- package/dist/datastar/attributes/signals.d.ts +2 -0
- package/dist/datastar/attributes/signals.d.ts.map +1 -0
- package/dist/datastar/attributes/signals.js +18 -0
- package/dist/datastar/attributes/signals.js.map +1 -0
- package/dist/datastar/attributes/style.d.ts +2 -0
- package/dist/datastar/attributes/style.d.ts.map +1 -0
- package/dist/datastar/attributes/style.js +51 -0
- package/dist/datastar/attributes/style.js.map +1 -0
- package/dist/datastar/attributes/text.d.ts +2 -0
- package/dist/datastar/attributes/text.d.ts.map +1 -0
- package/dist/datastar/attributes/text.js +27 -0
- package/dist/datastar/attributes/text.js.map +1 -0
- package/dist/datastar/engine.d.ts +163 -0
- package/dist/datastar/engine.d.ts.map +1 -0
- package/dist/datastar/engine.js +1000 -0
- package/dist/datastar/engine.js.map +1 -0
- package/dist/datastar/index.d.ts +25 -0
- package/dist/datastar/index.d.ts.map +1 -0
- package/dist/datastar/index.js +25 -0
- package/dist/datastar/index.js.map +1 -0
- package/dist/datastar/utils.d.ts +52 -0
- package/dist/datastar/utils.d.ts.map +1 -0
- package/dist/datastar/utils.js +203 -0
- package/dist/datastar/utils.js.map +1 -0
- package/dist/datastar/watchers/patchElements.d.ts +2 -0
- package/dist/datastar/watchers/patchElements.d.ts.map +1 -0
- package/dist/datastar/watchers/patchElements.js +400 -0
- package/dist/datastar/watchers/patchElements.js.map +1 -0
- package/dist/datastar/watchers/patchSignals.d.ts +2 -0
- package/dist/datastar/watchers/patchSignals.d.ts.map +1 -0
- package/dist/datastar/watchers/patchSignals.js +15 -0
- package/dist/datastar/watchers/patchSignals.js.map +1 -0
- package/dist/experimental/EncryptedCookies.d.ts +49 -0
- package/dist/experimental/EncryptedCookies.d.ts.map +1 -0
- package/dist/experimental/EncryptedCookies.js +213 -0
- package/dist/experimental/EncryptedCookies.js.map +1 -0
- package/dist/experimental/index.d.ts +2 -0
- package/dist/experimental/index.d.ts.map +1 -0
- package/dist/experimental/index.js +2 -0
- package/dist/experimental/index.js.map +1 -0
- package/dist/hyper/Hyper.d.ts +26 -0
- package/dist/hyper/Hyper.d.ts.map +1 -0
- package/dist/hyper/Hyper.js +24 -0
- package/dist/hyper/Hyper.js.map +1 -0
- package/dist/hyper/HyperHtml.d.ts +24 -0
- package/dist/hyper/HyperHtml.d.ts.map +1 -0
- package/dist/hyper/HyperHtml.js +153 -0
- package/dist/hyper/HyperHtml.js.map +1 -0
- package/dist/hyper/HyperHtml.test.d.ts +2 -0
- package/dist/hyper/HyperHtml.test.d.ts.map +1 -0
- package/dist/hyper/HyperHtml.test.js +283 -0
- package/dist/hyper/HyperHtml.test.js.map +1 -0
- package/dist/hyper/HyperNode.d.ts +14 -0
- package/dist/hyper/HyperNode.d.ts.map +1 -0
- package/dist/hyper/HyperNode.js +12 -0
- package/dist/hyper/HyperNode.js.map +1 -0
- package/dist/hyper/HyperRoute.d.ts +9 -0
- package/dist/hyper/HyperRoute.d.ts.map +1 -0
- package/dist/hyper/HyperRoute.js +33 -0
- package/dist/hyper/HyperRoute.js.map +1 -0
- package/dist/hyper/HyperRoute.test.d.ts +2 -0
- package/dist/hyper/HyperRoute.test.d.ts.map +1 -0
- package/dist/hyper/HyperRoute.test.js +84 -0
- package/dist/hyper/HyperRoute.test.js.map +1 -0
- package/dist/hyper/html.d.ts +12 -0
- package/dist/hyper/html.d.ts.map +1 -0
- package/dist/hyper/html.js +31 -0
- package/dist/hyper/html.js.map +1 -0
- package/dist/hyper/index.d.ts +7 -0
- package/dist/hyper/index.d.ts.map +1 -0
- package/dist/hyper/index.js +6 -0
- package/dist/hyper/index.js.map +1 -0
- package/dist/hyper/jsx-runtime.d.ts +8 -0
- package/dist/hyper/jsx-runtime.d.ts.map +1 -0
- package/dist/hyper/jsx-runtime.js +9 -0
- package/dist/hyper/jsx-runtime.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/lint/plugin.d.ts +124 -0
- package/dist/lint/plugin.d.ts.map +1 -0
- package/dist/lint/plugin.js +533 -0
- package/dist/lint/plugin.js.map +1 -0
- package/dist/node/NodeFileSystem.d.ts +8 -0
- package/dist/node/NodeFileSystem.d.ts.map +1 -0
- package/dist/node/NodeFileSystem.js +412 -0
- package/dist/node/NodeFileSystem.js.map +1 -0
- package/dist/node/NodeUtils.d.ts +3 -0
- package/dist/node/NodeUtils.d.ts.map +1 -0
- package/dist/node/NodeUtils.js +21 -0
- package/dist/node/NodeUtils.js.map +1 -0
- package/dist/sql/SqlCache.d.ts +19 -0
- package/dist/sql/SqlCache.d.ts.map +1 -0
- package/dist/sql/SqlCache.js +35 -0
- package/dist/sql/SqlCache.js.map +1 -0
- package/dist/sql/SqlClient.d.ts +88 -0
- package/dist/sql/SqlClient.d.ts.map +1 -0
- package/dist/sql/SqlClient.js +171 -0
- package/dist/sql/SqlClient.js.map +1 -0
- package/dist/sql/SqlIntrospect.d.ts +92 -0
- package/dist/sql/SqlIntrospect.d.ts.map +1 -0
- package/dist/sql/SqlIntrospect.js +478 -0
- package/dist/sql/SqlIntrospect.js.map +1 -0
- package/dist/sql/bun/index.d.ts +6 -0
- package/dist/sql/bun/index.d.ts.map +1 -0
- package/dist/sql/bun/index.js +132 -0
- package/dist/sql/bun/index.js.map +1 -0
- package/dist/sql/index.d.ts +4 -0
- package/dist/sql/index.d.ts.map +1 -0
- package/dist/sql/index.js +4 -0
- package/dist/sql/index.js.map +1 -0
- package/dist/sql/libsql/index.d.ts +15 -0
- package/dist/sql/libsql/index.d.ts.map +1 -0
- package/dist/sql/libsql/index.js +132 -0
- package/dist/sql/libsql/index.js.map +1 -0
- package/dist/sql/mssql/index.d.ts +8 -0
- package/dist/sql/mssql/index.d.ts.map +1 -0
- package/dist/sql/mssql/index.js +145 -0
- package/dist/sql/mssql/index.js.map +1 -0
- package/dist/sql/postgres/index.d.ts +7 -0
- package/dist/sql/postgres/index.d.ts.map +1 -0
- package/dist/sql/postgres/index.js +136 -0
- package/dist/sql/postgres/index.js.map +1 -0
- package/dist/studio/Simulation.d.ts +3 -0
- package/dist/studio/Simulation.d.ts.map +1 -0
- package/dist/studio/Simulation.js +606 -0
- package/dist/studio/Simulation.js.map +1 -0
- package/dist/studio/Studio.d.ts +11 -0
- package/dist/studio/Studio.d.ts.map +1 -0
- package/dist/studio/Studio.js +30 -0
- package/dist/studio/Studio.js.map +1 -0
- package/dist/studio/StudioErrors.d.ts +4 -0
- package/dist/studio/StudioErrors.d.ts.map +1 -0
- package/dist/studio/StudioErrors.js +200 -0
- package/dist/studio/StudioErrors.js.map +1 -0
- package/dist/studio/StudioLogger.d.ts +2 -0
- package/dist/studio/StudioLogger.d.ts.map +1 -0
- package/dist/studio/StudioLogger.js +46 -0
- package/dist/studio/StudioLogger.js.map +1 -0
- package/dist/studio/StudioMetrics.d.ts +4 -0
- package/dist/studio/StudioMetrics.d.ts.map +1 -0
- package/dist/studio/StudioMetrics.js +62 -0
- package/dist/studio/StudioMetrics.js.map +1 -0
- package/dist/studio/StudioProcess.d.ts +4 -0
- package/dist/studio/StudioProcess.d.ts.map +1 -0
- package/dist/studio/StudioProcess.js +50 -0
- package/dist/studio/StudioProcess.js.map +1 -0
- package/dist/studio/StudioStore.d.ts +199 -0
- package/dist/studio/StudioStore.d.ts.map +1 -0
- package/dist/studio/StudioStore.js +307 -0
- package/dist/studio/StudioStore.js.map +1 -0
- package/dist/studio/StudioTracer.d.ts +4 -0
- package/dist/studio/StudioTracer.d.ts.map +1 -0
- package/dist/studio/StudioTracer.js +111 -0
- package/dist/studio/StudioTracer.js.map +1 -0
- package/dist/studio/index.d.ts +4 -0
- package/dist/studio/index.d.ts.map +1 -0
- package/dist/studio/index.js +4 -0
- package/dist/studio/index.js.map +1 -0
- package/dist/studio/routes/errors/route.d.ts +11 -0
- package/dist/studio/routes/errors/route.d.ts.map +1 -0
- package/dist/studio/routes/errors/route.js +43 -0
- package/dist/studio/routes/errors/route.js.map +1 -0
- package/dist/studio/routes/fiberDetail.d.ts +17 -0
- package/dist/studio/routes/fiberDetail.d.ts.map +1 -0
- package/dist/studio/routes/fiberDetail.js +35 -0
- package/dist/studio/routes/fiberDetail.js.map +1 -0
- package/dist/studio/routes/fibers/route.d.ts +11 -0
- package/dist/studio/routes/fibers/route.d.ts.map +1 -0
- package/dist/studio/routes/fibers/route.js +25 -0
- package/dist/studio/routes/fibers/route.js.map +1 -0
- package/dist/studio/routes/layout.d.ts +10 -0
- package/dist/studio/routes/layout.d.ts.map +1 -0
- package/dist/studio/routes/layout.html +340 -0
- package/dist/studio/routes/layout.js +4 -0
- package/dist/studio/routes/layout.js.map +1 -0
- package/dist/studio/routes/logs/route.d.ts +11 -0
- package/dist/studio/routes/logs/route.d.ts.map +1 -0
- package/dist/studio/routes/logs/route.js +30 -0
- package/dist/studio/routes/logs/route.js.map +1 -0
- package/dist/studio/routes/metrics/route.d.ts +11 -0
- package/dist/studio/routes/metrics/route.d.ts.map +1 -0
- package/dist/studio/routes/metrics/route.js +18 -0
- package/dist/studio/routes/metrics/route.js.map +1 -0
- package/dist/studio/routes/route.d.ts +7 -0
- package/dist/studio/routes/route.d.ts.map +1 -0
- package/dist/studio/routes/route.js +6 -0
- package/dist/studio/routes/route.js.map +1 -0
- package/dist/studio/routes/routes/route.d.ts +7 -0
- package/dist/studio/routes/routes/route.d.ts.map +1 -0
- package/dist/studio/routes/routes/route.js +21 -0
- package/dist/studio/routes/routes/route.js.map +1 -0
- package/dist/studio/routes/services/route.d.ts +7 -0
- package/dist/studio/routes/services/route.d.ts.map +1 -0
- package/dist/studio/routes/services/route.js +13 -0
- package/dist/studio/routes/services/route.js.map +1 -0
- package/dist/studio/routes/system/route.d.ts +11 -0
- package/dist/studio/routes/system/route.d.ts.map +1 -0
- package/dist/studio/routes/system/route.js +19 -0
- package/dist/studio/routes/system/route.js.map +1 -0
- package/dist/studio/routes/traceDetail.d.ts +17 -0
- package/dist/studio/routes/traceDetail.d.ts.map +1 -0
- package/dist/studio/routes/traceDetail.js +20 -0
- package/dist/studio/routes/traceDetail.js.map +1 -0
- package/dist/studio/routes/traces/route.d.ts +11 -0
- package/dist/studio/routes/traces/route.d.ts.map +1 -0
- package/dist/studio/routes/traces/route.js +30 -0
- package/dist/studio/routes/traces/route.js.map +1 -0
- package/dist/studio/routes/tree.d.ts +142 -0
- package/dist/studio/routes/tree.d.ts.map +1 -0
- package/dist/studio/routes/tree.js +28 -0
- package/dist/studio/routes/tree.js.map +1 -0
- package/dist/studio/ui/Errors.d.ts +5 -0
- package/dist/studio/ui/Errors.d.ts.map +1 -0
- package/dist/studio/ui/Errors.js +17 -0
- package/dist/studio/ui/Errors.js.map +1 -0
- package/dist/studio/ui/Fibers.d.ts +25 -0
- package/dist/studio/ui/Fibers.d.ts.map +1 -0
- package/dist/studio/ui/Fibers.js +134 -0
- package/dist/studio/ui/Fibers.js.map +1 -0
- package/dist/studio/ui/Logs.d.ts +5 -0
- package/dist/studio/ui/Logs.d.ts.map +1 -0
- package/dist/studio/ui/Logs.js +27 -0
- package/dist/studio/ui/Logs.js.map +1 -0
- package/dist/studio/ui/Metrics.d.ts +5 -0
- package/dist/studio/ui/Metrics.d.ts.map +1 -0
- package/dist/studio/ui/Metrics.js +27 -0
- package/dist/studio/ui/Metrics.js.map +1 -0
- package/dist/studio/ui/Routes.d.ts +9 -0
- package/dist/studio/ui/Routes.d.ts.map +1 -0
- package/dist/studio/ui/Routes.js +71 -0
- package/dist/studio/ui/Routes.js.map +1 -0
- package/dist/studio/ui/Services.d.ts +11 -0
- package/dist/studio/ui/Services.d.ts.map +1 -0
- package/dist/studio/ui/Services.js +247 -0
- package/dist/studio/ui/Services.js.map +1 -0
- package/dist/studio/ui/Shell.d.ts +11 -0
- package/dist/studio/ui/Shell.d.ts.map +1 -0
- package/dist/studio/ui/Shell.js +8 -0
- package/dist/studio/ui/Shell.js.map +1 -0
- package/dist/studio/ui/System.d.ts +5 -0
- package/dist/studio/ui/System.d.ts.map +1 -0
- package/dist/studio/ui/System.js +36 -0
- package/dist/studio/ui/System.js.map +1 -0
- package/dist/studio/ui/Traces.d.ts +13 -0
- package/dist/studio/ui/Traces.d.ts.map +1 -0
- package/dist/studio/ui/Traces.js +182 -0
- package/dist/studio/ui/Traces.js.map +1 -0
- package/dist/testing/TestLogger.d.ts +14 -0
- package/dist/testing/TestLogger.d.ts.map +1 -0
- package/dist/testing/TestLogger.js +33 -0
- package/dist/testing/TestLogger.js.map +1 -0
- package/dist/testing/index.d.ts +3 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +3 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/utils.d.ts +12 -0
- package/dist/testing/utils.d.ts.map +1 -0
- package/dist/testing/utils.js +79 -0
- package/dist/testing/utils.js.map +1 -0
- package/dist/x/cloudflare/CloudflareTunnel.d.ts +12 -0
- package/dist/x/cloudflare/CloudflareTunnel.d.ts.map +1 -0
- package/dist/x/cloudflare/CloudflareTunnel.js +31 -0
- package/dist/x/cloudflare/CloudflareTunnel.js.map +1 -0
- package/dist/x/cloudflare/index.d.ts +2 -0
- package/dist/x/cloudflare/index.d.ts.map +1 -0
- package/dist/x/cloudflare/index.js +2 -0
- package/dist/x/cloudflare/index.js.map +1 -0
- package/dist/x/tailscale/TailscaleTunnel.d.ts +16 -0
- package/dist/x/tailscale/TailscaleTunnel.d.ts.map +1 -0
- package/dist/x/tailscale/TailscaleTunnel.js +65 -0
- package/dist/x/tailscale/TailscaleTunnel.js.map +1 -0
- package/dist/x/tailscale/index.d.ts +2 -0
- package/dist/x/tailscale/index.d.ts.map +1 -0
- package/dist/x/tailscale/index.js +2 -0
- package/dist/x/tailscale/index.js.map +1 -0
- package/dist/x/tailwind/TailwindPlugin.d.ts +24 -0
- package/dist/x/tailwind/TailwindPlugin.d.ts.map +1 -0
- package/dist/x/tailwind/TailwindPlugin.js +220 -0
- package/dist/x/tailwind/TailwindPlugin.js.map +1 -0
- package/dist/x/tailwind/compile.d.ts +20 -0
- package/dist/x/tailwind/compile.d.ts.map +1 -0
- package/dist/x/tailwind/compile.js +155 -0
- package/dist/x/tailwind/compile.js.map +1 -0
- package/dist/x/tailwind/plugin.d.ts +3 -0
- package/dist/x/tailwind/plugin.d.ts.map +1 -0
- package/dist/x/tailwind/plugin.js +16 -0
- package/dist/x/tailwind/plugin.js.map +1 -0
- package/package.json +89 -26
- package/src/Cookies.ts +4 -8
- package/src/Entity.ts +24 -19
- package/src/Fetch.ts +128 -5
- package/src/FileRouter.ts +46 -49
- package/src/FileRouterCodegen.ts +9 -23
- package/src/FileSystem.ts +44 -67
- package/src/GlobalLayer.ts +85 -0
- package/src/PlatformRuntime.ts +8 -1
- package/src/Route.ts +2 -2
- package/src/RouteBody.ts +1 -1
- package/src/RouteHook.ts +1 -1
- package/src/RouteHttp.ts +133 -113
- package/src/RouteMount.ts +3 -3
- package/src/RouteSchema.ts +2 -2
- package/src/RouteSse.ts +28 -37
- package/src/RouteTree.ts +2 -2
- package/src/RouteTrie.ts +1 -1
- package/src/Socket.ts +17 -27
- package/src/Start.ts +67 -64
- package/src/System.ts +42 -9
- package/src/Unique.ts +59 -0
- package/src/{ChildProcess.ts → _ChildProcess.ts} +16 -28
- package/src/{Development.ts → _Development.ts} +16 -21
- package/src/_Docker.ts +190 -0
- package/src/{Effectify.ts → _Effectify.ts} +7 -10
- package/src/{Http.ts → _Http.ts} +0 -28
- package/src/{PathPattern.ts → _PathPattern.ts} +105 -0
- package/src/{SchemaExtra.ts → _SchemaExtra.ts} +3 -4
- package/src/bun/BunChildProcessSpawner.ts +10 -17
- package/src/bun/BunRoute.ts +6 -8
- package/src/bun/BunRuntime.ts +2 -8
- package/src/bun/BunServer.ts +57 -5
- package/src/bundler/BundleRoute.ts +2 -2
- package/src/cli/Argument.ts +45 -0
- package/src/cli/CliError.ts +68 -0
- package/src/cli/Command.ts +685 -0
- package/src/cli/Flag.ts +63 -0
- package/src/cli/HelpDoc.ts +67 -0
- package/src/cli/Param.ts +418 -0
- package/src/cli/Primitive.ts +94 -0
- package/src/cli/index.ts +7 -0
- package/src/datastar/watchers/patchElements.ts +3 -2
- package/src/hyper/HyperHtml.test.tsx +395 -0
- package/src/hyper/HyperNode.ts +1 -2
- package/src/hyper/HyperRoute.test.tsx +166 -0
- package/src/hyper/HyperRoute.ts +1 -1
- package/src/index.ts +1 -1
- package/src/lint/plugin.js +179 -125
- package/src/node/NodeFileSystem.ts +15 -14
- package/src/sql/SqlCache.ts +63 -0
- package/src/sql/SqlClient.ts +60 -15
- package/src/{SqlIntrospect.ts → sql/SqlIntrospect.ts} +13 -11
- package/src/sql/bun/index.ts +29 -27
- package/src/sql/index.ts +2 -0
- package/src/sql/libsql/index.ts +63 -29
- package/src/sql/mssql/index.ts +54 -58
- package/src/sql/postgres/index.ts +254 -0
- package/src/studio/Simulation.ts +776 -0
- package/src/studio/Studio.ts +47 -0
- package/src/studio/StudioErrors.ts +224 -0
- package/src/studio/StudioLogger.ts +52 -0
- package/src/studio/StudioMetrics.ts +72 -0
- package/src/studio/StudioProcess.ts +59 -0
- package/src/studio/StudioStore.ts +505 -0
- package/src/studio/StudioTracer.ts +128 -0
- package/src/studio/index.ts +3 -0
- package/src/studio/routes/errors/route.tsx +90 -0
- package/src/studio/routes/fiberDetail.tsx +51 -0
- package/src/studio/routes/fibers/route.tsx +46 -0
- package/src/studio/routes/layout.html +340 -0
- package/src/studio/routes/layout.tsx +4 -0
- package/src/studio/routes/logs/route.tsx +73 -0
- package/src/studio/routes/metrics/route.tsx +36 -0
- package/src/studio/routes/route.tsx +8 -0
- package/src/studio/routes/routes/route.tsx +30 -0
- package/src/studio/routes/services/route.tsx +21 -0
- package/src/studio/routes/system/route.tsx +43 -0
- package/src/studio/routes/traceDetail.tsx +30 -0
- package/src/studio/routes/traces/route.tsx +72 -0
- package/src/studio/routes/tree.ts +28 -0
- package/src/studio/ui/Errors.tsx +80 -0
- package/src/studio/ui/Fibers.tsx +336 -0
- package/src/studio/ui/Logs.tsx +50 -0
- package/src/studio/ui/Metrics.tsx +78 -0
- package/src/studio/ui/Routes.tsx +125 -0
- package/src/studio/ui/Services.tsx +273 -0
- package/src/studio/ui/Shell.tsx +74 -0
- package/src/studio/ui/System.tsx +141 -0
- package/src/studio/ui/Traces.tsx +419 -0
- package/src/testing/utils.ts +59 -0
- package/src/x/cloudflare/CloudflareTunnel.ts +1 -1
- package/src/x/tailscale/TailscaleTunnel.ts +6 -7
- package/src/x/tailwind/compile.ts +6 -1
- package/src/Commander.ts +0 -585
- package/src/FilePathPattern.ts +0 -115
- package/src/PlatformError.ts +0 -73
- package/src/TuplePathPattern.ts +0 -75
- package/src/sql/mssql/docker.ts +0 -117
- /package/src/{ContentNegotiation.ts → _ContentNegotiation.ts} +0 -0
- /package/src/{StartApp.ts → _StartApp.ts} +0 -0
- /package/src/{StreamExtra.ts → _StreamExtra.ts} +0 -0
- /package/src/{Values.ts → _Values.ts} +0 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect"
|
|
2
|
+
import * as Layer from "effect/Layer"
|
|
3
|
+
import * as Route from "../Route.ts"
|
|
4
|
+
import * as RouteTree from "../RouteTree.ts"
|
|
5
|
+
import * as sqlBun from "../sql/bun/index.ts"
|
|
6
|
+
import type * as SqlClient from "../sql/SqlClient.ts"
|
|
7
|
+
import * as StudioErrors from "./StudioErrors.ts"
|
|
8
|
+
import * as StudioLogger from "./StudioLogger.ts"
|
|
9
|
+
import * as StudioMetrics from "./StudioMetrics.ts"
|
|
10
|
+
import * as StudioProcess from "./StudioProcess.ts"
|
|
11
|
+
import * as StudioStore from "./StudioStore.ts"
|
|
12
|
+
import * as StudioTracer from "./StudioTracer.ts"
|
|
13
|
+
import consoleRoutes from "./routes/tree.ts"
|
|
14
|
+
|
|
15
|
+
export function layer(
|
|
16
|
+
options?: StudioStore.StudioStoreOptions & {
|
|
17
|
+
readonly sqlLayer?: Layer.Layer<SqlClient.SqlClient, SqlClient.SqlError>
|
|
18
|
+
},
|
|
19
|
+
): Layer.Layer<StudioStore.StudioStore> {
|
|
20
|
+
const sqlLayer =
|
|
21
|
+
options?.sqlLayer ?? sqlBun.layer({ adapter: "sqlite" as const, filename: ":memory:" })
|
|
22
|
+
const store = StudioStore.layer(options).pipe(Layer.provide(sqlLayer), Layer.orDie)
|
|
23
|
+
const features = Layer.mergeAll(
|
|
24
|
+
StudioTracer.layer,
|
|
25
|
+
StudioLogger.layer,
|
|
26
|
+
StudioMetrics.layer,
|
|
27
|
+
StudioErrors.layer,
|
|
28
|
+
StudioProcess.layer,
|
|
29
|
+
).pipe(Layer.provide(store))
|
|
30
|
+
return Layer.merge(store, features)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function layerRoutes(options?: { prefix?: string }) {
|
|
34
|
+
const prefix = options?.prefix ?? "/studio"
|
|
35
|
+
|
|
36
|
+
return Layer.effect(
|
|
37
|
+
Route.Routes,
|
|
38
|
+
Effect.gen(function* () {
|
|
39
|
+
const existing = yield* Route.Routes
|
|
40
|
+
StudioStore.store.prefix = prefix
|
|
41
|
+
const tree = Route.tree({
|
|
42
|
+
[prefix as "/"]: consoleRoutes,
|
|
43
|
+
})
|
|
44
|
+
return RouteTree.merge(existing, tree)
|
|
45
|
+
}),
|
|
46
|
+
)
|
|
47
|
+
}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import * as Cause from "effect/Cause"
|
|
2
|
+
import * as Chunk from "effect/Chunk"
|
|
3
|
+
import * as Effect from "effect/Effect"
|
|
4
|
+
import * as Exit from "effect/Exit"
|
|
5
|
+
import * as FiberId from "effect/FiberId"
|
|
6
|
+
import * as FiberRef from "effect/FiberRef"
|
|
7
|
+
import * as HashMap from "effect/HashMap"
|
|
8
|
+
import * as Layer from "effect/Layer"
|
|
9
|
+
import * as Option from "effect/Option"
|
|
10
|
+
import * as PubSub from "effect/PubSub"
|
|
11
|
+
import type * as Context from "effect/Context"
|
|
12
|
+
import type * as Fiber from "effect/Fiber"
|
|
13
|
+
import * as Supervisor from "effect/Supervisor"
|
|
14
|
+
import * as StudioStore from "./StudioStore.ts"
|
|
15
|
+
|
|
16
|
+
function safeSerialize(value: unknown, depth = 0): unknown {
|
|
17
|
+
if (depth > 4) return "<deep>"
|
|
18
|
+
if (value === null || value === undefined) return value
|
|
19
|
+
if (typeof value === "bigint") return `${value}n`
|
|
20
|
+
if (typeof value === "function") return undefined
|
|
21
|
+
if (typeof value === "symbol") return value.toString()
|
|
22
|
+
if (typeof value !== "object") return value
|
|
23
|
+
if (value instanceof Date) return value.toISOString()
|
|
24
|
+
if (value instanceof Error) return value.message
|
|
25
|
+
if (Array.isArray(value)) return value.slice(0, 20).map((v) => safeSerialize(v, depth + 1))
|
|
26
|
+
const proto = Object.getPrototypeOf(value)
|
|
27
|
+
if (proto !== null && proto !== Object.prototype) {
|
|
28
|
+
if (typeof (value as any)._tag === "string") {
|
|
29
|
+
return serializeTaggedObject(value as Record<string, unknown>, depth)
|
|
30
|
+
}
|
|
31
|
+
return `<${proto.constructor?.name ?? "object"}>`
|
|
32
|
+
}
|
|
33
|
+
return serializePlainObject(value as Record<string, unknown>, depth)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function serializePlainObject(
|
|
37
|
+
obj: Record<string, unknown>,
|
|
38
|
+
depth: number,
|
|
39
|
+
): Record<string, unknown> {
|
|
40
|
+
const out: Record<string, unknown> = {}
|
|
41
|
+
let count = 0
|
|
42
|
+
for (const [k, v] of Object.entries(obj)) {
|
|
43
|
+
if (count >= 20) break
|
|
44
|
+
if (typeof v === "function") continue
|
|
45
|
+
const serialized = safeSerialize(v, depth + 1)
|
|
46
|
+
if (serialized !== undefined) {
|
|
47
|
+
out[k] = serialized
|
|
48
|
+
count++
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return out
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function serializeTaggedObject(
|
|
55
|
+
obj: Record<string, unknown>,
|
|
56
|
+
depth: number,
|
|
57
|
+
): Record<string, unknown> {
|
|
58
|
+
const out: Record<string, unknown> = { _tag: obj._tag }
|
|
59
|
+
let count = 0
|
|
60
|
+
for (const [k, v] of Object.entries(obj)) {
|
|
61
|
+
if (count >= 20) break
|
|
62
|
+
if (k === "_tag") continue
|
|
63
|
+
if (typeof v === "function") continue
|
|
64
|
+
if (k === "stack" || k === "name") continue
|
|
65
|
+
const serialized = safeSerialize(v, depth + 1)
|
|
66
|
+
if (serialized !== undefined) {
|
|
67
|
+
out[k] = serialized
|
|
68
|
+
count++
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return out
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function extractTag(error: unknown): string | undefined {
|
|
75
|
+
if (
|
|
76
|
+
error !== null &&
|
|
77
|
+
typeof error === "object" &&
|
|
78
|
+
"_tag" in error &&
|
|
79
|
+
typeof (error as any)._tag === "string"
|
|
80
|
+
) {
|
|
81
|
+
return (error as any)._tag
|
|
82
|
+
}
|
|
83
|
+
return undefined
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function extractMessage(error: unknown): string {
|
|
87
|
+
if (error instanceof Error) return error.message
|
|
88
|
+
if (typeof error === "string") return error
|
|
89
|
+
const tag = extractTag(error)
|
|
90
|
+
if (tag) return tag
|
|
91
|
+
try {
|
|
92
|
+
return String(error)
|
|
93
|
+
} catch {
|
|
94
|
+
return "<unknown>"
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function extractProperties(error: unknown): Record<string, unknown> {
|
|
99
|
+
if (error === null || error === undefined || typeof error !== "object") return {}
|
|
100
|
+
const out: Record<string, unknown> = {}
|
|
101
|
+
let count = 0
|
|
102
|
+
for (const [k, v] of Object.entries(error)) {
|
|
103
|
+
if (count >= 20) break
|
|
104
|
+
if (k === "_tag" || k === "stack" || k === "name") continue
|
|
105
|
+
if (typeof v === "function") continue
|
|
106
|
+
const serialized = safeSerialize(v, 0)
|
|
107
|
+
if (serialized !== undefined) {
|
|
108
|
+
out[k] = serialized
|
|
109
|
+
count++
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return out
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const spanSymbol = Symbol.for("effect/SpanAnnotation")
|
|
116
|
+
|
|
117
|
+
function extractSpanName(error: unknown): string | undefined {
|
|
118
|
+
if (error !== null && typeof error === "object" && spanSymbol in error) {
|
|
119
|
+
const span = (error as any)[spanSymbol]
|
|
120
|
+
return typeof span?.name === "string" ? span.name : undefined
|
|
121
|
+
}
|
|
122
|
+
return undefined
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function extractDetails(cause: Cause.Cause<unknown>): Array<StudioStore.StudioErrorDetail> {
|
|
126
|
+
const details: Array<StudioStore.StudioErrorDetail> = []
|
|
127
|
+
|
|
128
|
+
const failures = Chunk.toArray(Cause.failures(cause))
|
|
129
|
+
for (const error of failures) {
|
|
130
|
+
details.push({
|
|
131
|
+
kind: "fail",
|
|
132
|
+
tag: extractTag(error),
|
|
133
|
+
message: extractMessage(error),
|
|
134
|
+
properties: extractProperties(error),
|
|
135
|
+
span: extractSpanName(error),
|
|
136
|
+
})
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const defects = Chunk.toArray(Cause.defects(cause))
|
|
140
|
+
for (const defect of defects) {
|
|
141
|
+
details.push({
|
|
142
|
+
kind: "die",
|
|
143
|
+
tag: extractTag(defect),
|
|
144
|
+
message: extractMessage(defect),
|
|
145
|
+
properties: extractProperties(defect),
|
|
146
|
+
span: extractSpanName(defect),
|
|
147
|
+
})
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return details
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function make(store: StudioStore.StudioStoreShape): Supervisor.Supervisor<void> {
|
|
154
|
+
return new (class extends Supervisor.AbstractSupervisor<void> {
|
|
155
|
+
value = Effect.void
|
|
156
|
+
|
|
157
|
+
onStart<A, E, R>(
|
|
158
|
+
_context: Context.Context<R>,
|
|
159
|
+
_effect: Effect.Effect<A, E, R>,
|
|
160
|
+
parent: Option.Option<Fiber.RuntimeFiber<any, any>>,
|
|
161
|
+
fiber: Fiber.RuntimeFiber<A, E>,
|
|
162
|
+
) {
|
|
163
|
+
const childId = FiberId.threadName(fiber.id())
|
|
164
|
+
const parentId = Option.isSome(parent) ? FiberId.threadName(parent.value.id()) : undefined
|
|
165
|
+
|
|
166
|
+
const span = fiber.currentSpan
|
|
167
|
+
const traceId = span
|
|
168
|
+
? (() => {
|
|
169
|
+
try {
|
|
170
|
+
return BigInt(span.traceId)
|
|
171
|
+
} catch {
|
|
172
|
+
return undefined
|
|
173
|
+
}
|
|
174
|
+
})()
|
|
175
|
+
: undefined
|
|
176
|
+
const annotations: Record<string, unknown> = {}
|
|
177
|
+
const spanAnnotations = fiber.getFiberRef(FiberRef.currentTracerSpanAnnotations)
|
|
178
|
+
HashMap.forEach(spanAnnotations, (value, key) => {
|
|
179
|
+
annotations[key] = value
|
|
180
|
+
})
|
|
181
|
+
const logAnnotations = fiber.getFiberRef(FiberRef.currentLogAnnotations)
|
|
182
|
+
HashMap.forEach(logAnnotations, (value, key) => {
|
|
183
|
+
annotations[key] = value
|
|
184
|
+
})
|
|
185
|
+
|
|
186
|
+
StudioStore.runWrite(
|
|
187
|
+
StudioStore.upsertFiber(
|
|
188
|
+
store.sql,
|
|
189
|
+
childId,
|
|
190
|
+
parentId !== childId ? parentId : undefined,
|
|
191
|
+
span?._tag === "Span" ? span.name : undefined,
|
|
192
|
+
traceId,
|
|
193
|
+
annotations,
|
|
194
|
+
),
|
|
195
|
+
)
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
onEnd<A, E>(exit: Exit.Exit<A, E>, fiber: Fiber.RuntimeFiber<A, E>) {
|
|
199
|
+
if (Exit.isFailure(exit) && !Cause.isInterruptedOnly(exit.cause)) {
|
|
200
|
+
const error: StudioStore.StudioError = {
|
|
201
|
+
id: StudioStore.nextErrorId(),
|
|
202
|
+
fiberId: FiberId.threadName(fiber.id()),
|
|
203
|
+
interrupted: Cause.isInterrupted(exit.cause),
|
|
204
|
+
prettyPrint: Cause.pretty(exit.cause, { renderErrorCause: true }),
|
|
205
|
+
details: extractDetails(exit.cause),
|
|
206
|
+
}
|
|
207
|
+
StudioStore.runWrite(
|
|
208
|
+
Effect.zipRight(
|
|
209
|
+
StudioStore.insertError(store.sql, error),
|
|
210
|
+
StudioStore.evict(store.sql, "Error", store.errorCapacity),
|
|
211
|
+
),
|
|
212
|
+
)
|
|
213
|
+
Effect.runSync(PubSub.publish(store.events, { _tag: "Error", error }))
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
})()
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export const layer: Layer.Layer<never, never, StudioStore.StudioStore> = Layer.unwrapEffect(
|
|
220
|
+
Effect.gen(function* () {
|
|
221
|
+
const store = yield* StudioStore.StudioStore
|
|
222
|
+
return Supervisor.addSupervisor(make(store))
|
|
223
|
+
}),
|
|
224
|
+
)
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as Cause from "effect/Cause"
|
|
2
|
+
import * as Effect from "effect/Effect"
|
|
3
|
+
import * as FiberId from "effect/FiberId"
|
|
4
|
+
import * as HashMap from "effect/HashMap"
|
|
5
|
+
import * as List from "effect/List"
|
|
6
|
+
import * as Logger from "effect/Logger"
|
|
7
|
+
import * as PubSub from "effect/PubSub"
|
|
8
|
+
import * as StudioStore from "./StudioStore.ts"
|
|
9
|
+
|
|
10
|
+
const studioLogger = Logger.make((options) => {
|
|
11
|
+
const store = StudioStore.store
|
|
12
|
+
if (!store.sql) return
|
|
13
|
+
|
|
14
|
+
try {
|
|
15
|
+
const levelMap: Record<string, StudioStore.StudioLog["level"]> = {
|
|
16
|
+
Debug: "DEBUG",
|
|
17
|
+
Info: "INFO",
|
|
18
|
+
Warning: "WARNING",
|
|
19
|
+
Error: "ERROR",
|
|
20
|
+
Fatal: "FATAL",
|
|
21
|
+
}
|
|
22
|
+
const level = levelMap[options.logLevel._tag] ?? "INFO"
|
|
23
|
+
const causeStr = !Cause.isEmpty(options.cause)
|
|
24
|
+
? Cause.pretty(options.cause, { renderErrorCause: true })
|
|
25
|
+
: undefined
|
|
26
|
+
const spanNames: Array<string> = []
|
|
27
|
+
List.forEach(options.spans, (s) => spanNames.push(s.label))
|
|
28
|
+
const ann: Record<string, unknown> = {}
|
|
29
|
+
HashMap.forEach(options.annotations, (v, k) => {
|
|
30
|
+
ann[k] = v
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
const log: StudioStore.StudioLog = {
|
|
34
|
+
id: StudioStore.nextLogId(),
|
|
35
|
+
level,
|
|
36
|
+
message: String(options.message),
|
|
37
|
+
fiberId: FiberId.threadName(options.fiberId),
|
|
38
|
+
cause: causeStr,
|
|
39
|
+
spans: spanNames,
|
|
40
|
+
annotations: ann,
|
|
41
|
+
}
|
|
42
|
+
StudioStore.runWrite(
|
|
43
|
+
Effect.zipRight(
|
|
44
|
+
StudioStore.insertLog(store.sql, log),
|
|
45
|
+
StudioStore.evict(store.sql, "Log", store.logCapacity),
|
|
46
|
+
),
|
|
47
|
+
)
|
|
48
|
+
Effect.runSync(PubSub.publish(store.events, { _tag: "Log", log }))
|
|
49
|
+
} catch (_) {}
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
export const layer = Logger.add(studioLogger)
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect"
|
|
2
|
+
import * as Layer from "effect/Layer"
|
|
3
|
+
import * as Metric from "effect/Metric"
|
|
4
|
+
import * as MetricKeyType from "effect/MetricKeyType"
|
|
5
|
+
import * as PubSub from "effect/PubSub"
|
|
6
|
+
import * as Schedule from "effect/Schedule"
|
|
7
|
+
import * as StudioStore from "./StudioStore.ts"
|
|
8
|
+
|
|
9
|
+
export const layer: Layer.Layer<never, never, StudioStore.StudioStore> = Layer.scopedDiscard(
|
|
10
|
+
Effect.gen(function* () {
|
|
11
|
+
const store = yield* StudioStore.StudioStore
|
|
12
|
+
|
|
13
|
+
yield* Effect.forkScoped(
|
|
14
|
+
Effect.schedule(
|
|
15
|
+
Effect.sync(() => {
|
|
16
|
+
const pairs = Metric.unsafeSnapshot()
|
|
17
|
+
const snapshots: Array<StudioStore.StudioMetricSnapshot> = []
|
|
18
|
+
|
|
19
|
+
for (const pair of pairs) {
|
|
20
|
+
const key = pair.metricKey
|
|
21
|
+
const state = pair.metricState as any
|
|
22
|
+
let type: StudioStore.StudioMetricSnapshot["type"] = "counter"
|
|
23
|
+
let value: unknown = 0
|
|
24
|
+
|
|
25
|
+
if (MetricKeyType.CounterKeyTypeTypeId in key.keyType) {
|
|
26
|
+
type = "counter"
|
|
27
|
+
value = state.count
|
|
28
|
+
} else if (MetricKeyType.GaugeKeyTypeTypeId in key.keyType) {
|
|
29
|
+
type = "gauge"
|
|
30
|
+
value = state.value
|
|
31
|
+
} else if (MetricKeyType.HistogramKeyTypeTypeId in key.keyType) {
|
|
32
|
+
type = "histogram"
|
|
33
|
+
value = {
|
|
34
|
+
buckets: state.buckets,
|
|
35
|
+
count: state.count,
|
|
36
|
+
sum: state.sum,
|
|
37
|
+
min: state.min,
|
|
38
|
+
max: state.max,
|
|
39
|
+
}
|
|
40
|
+
} else if (MetricKeyType.FrequencyKeyTypeTypeId in key.keyType) {
|
|
41
|
+
type = "frequency"
|
|
42
|
+
value = Object.fromEntries(state.occurrences)
|
|
43
|
+
} else if (MetricKeyType.SummaryKeyTypeTypeId in key.keyType) {
|
|
44
|
+
type = "summary"
|
|
45
|
+
value = {
|
|
46
|
+
quantiles: state.quantiles,
|
|
47
|
+
count: state.count,
|
|
48
|
+
sum: state.sum,
|
|
49
|
+
min: state.min,
|
|
50
|
+
max: state.max,
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
snapshots.push({
|
|
55
|
+
name: key.name,
|
|
56
|
+
type,
|
|
57
|
+
value,
|
|
58
|
+
tags: key.tags.map((t: any) => ({ key: t.key, value: t.value })),
|
|
59
|
+
timestamp: Date.now(),
|
|
60
|
+
})
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
store.metrics = snapshots
|
|
64
|
+
Effect.runSync(
|
|
65
|
+
PubSub.publish(store.events, { _tag: "MetricsSnapshot", metrics: snapshots }),
|
|
66
|
+
)
|
|
67
|
+
}),
|
|
68
|
+
Schedule.spaced("2 seconds"),
|
|
69
|
+
),
|
|
70
|
+
)
|
|
71
|
+
}),
|
|
72
|
+
)
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as NOS from "node:os"
|
|
2
|
+
import * as Effect from "effect/Effect"
|
|
3
|
+
import * as Layer from "effect/Layer"
|
|
4
|
+
import * as PubSub from "effect/PubSub"
|
|
5
|
+
import * as Schedule from "effect/Schedule"
|
|
6
|
+
import * as StudioStore from "./StudioStore.ts"
|
|
7
|
+
|
|
8
|
+
function snapshot(): StudioStore.ProcessStats {
|
|
9
|
+
const mem = process.memoryUsage()
|
|
10
|
+
const cpu = process.cpuUsage()
|
|
11
|
+
const res = process.resourceUsage()
|
|
12
|
+
const loadavg = NOS.loadavg() as [number, number, number]
|
|
13
|
+
return {
|
|
14
|
+
pid: process.pid,
|
|
15
|
+
uptime: process.uptime(),
|
|
16
|
+
memory: {
|
|
17
|
+
rss: mem.rss,
|
|
18
|
+
heapUsed: mem.heapUsed,
|
|
19
|
+
heapTotal: mem.heapTotal,
|
|
20
|
+
external: mem.external,
|
|
21
|
+
arrayBuffers: mem.arrayBuffers,
|
|
22
|
+
},
|
|
23
|
+
cpu: { user: cpu.user, system: cpu.system },
|
|
24
|
+
resourceUsage: {
|
|
25
|
+
maxRSS: res.maxRSS,
|
|
26
|
+
minorPageFault: res.minorPageFault,
|
|
27
|
+
majorPageFault: res.majorPageFault,
|
|
28
|
+
fsRead: res.fsRead,
|
|
29
|
+
fsWrite: res.fsWrite,
|
|
30
|
+
voluntaryContextSwitches: res.voluntaryContextSwitches,
|
|
31
|
+
involuntaryContextSwitches: res.involuntaryContextSwitches,
|
|
32
|
+
},
|
|
33
|
+
system: {
|
|
34
|
+
loadavg,
|
|
35
|
+
freemem: NOS.freemem(),
|
|
36
|
+
totalmem: NOS.totalmem(),
|
|
37
|
+
cpuCount: NOS.cpus().length,
|
|
38
|
+
platform: NOS.platform(),
|
|
39
|
+
arch: NOS.arch(),
|
|
40
|
+
},
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const layer: Layer.Layer<never, never, StudioStore.StudioStore> = Layer.scopedDiscard(
|
|
45
|
+
Effect.gen(function* () {
|
|
46
|
+
const store = yield* StudioStore.StudioStore
|
|
47
|
+
|
|
48
|
+
yield* Effect.forkScoped(
|
|
49
|
+
Effect.schedule(
|
|
50
|
+
Effect.sync(() => {
|
|
51
|
+
const stats = snapshot()
|
|
52
|
+
store.process = stats
|
|
53
|
+
Effect.runSync(PubSub.publish(store.events, { _tag: "ProcessSnapshot", stats }))
|
|
54
|
+
}),
|
|
55
|
+
Schedule.spaced("2 seconds"),
|
|
56
|
+
),
|
|
57
|
+
)
|
|
58
|
+
}),
|
|
59
|
+
)
|