1+ import * as NodeCrypto from "@effect/platform-node/NodeCrypto" ;
12import * as NodeServices from "@effect/platform-node/NodeServices" ;
23import { assert , describe , it } from "@effect/vitest" ;
34import { currentDesktopBootstrapToken } from "@t3tools/shared/desktopBootstrapToken" ;
@@ -76,6 +77,7 @@ function layerEnvironment(
7677 Layer . provide (
7778 Layer . mergeAll (
7879 NodeServices . layer ,
80+ NodeCrypto . layer ,
7981 DesktopConfig . layerTest ( {
8082 T3CODE_HOME : baseDir ,
8183 T3CODE_PORT : "9999" ,
@@ -127,7 +129,7 @@ const withHarness = <A, E, R>(
127129 ) ,
128130 ) ,
129131 ) ;
130- } ) . pipe ( Effect . scoped , Effect . provide ( NodeServices . layer ) ) ;
132+ } ) . pipe ( Effect . scoped , Effect . provide ( Layer . mergeAll ( NodeServices . layer , NodeCrypto . layer ) ) ) ;
131133
132134interface PackagedWslHarnessContext {
133135 readonly baseDir : string ;
@@ -219,7 +221,7 @@ const withPackagedWslHarness = <A, E, R>(
219221 ) ,
220222 ) ,
221223 ) ;
222- } ) . pipe ( Effect . scoped , Effect . provide ( NodeServices . layer ) ) ;
224+ } ) . pipe ( Effect . scoped , Effect . provide ( Layer . mergeAll ( NodeServices . layer , NodeCrypto . layer ) ) ) ;
223225
224226describe ( "DesktopBackendConfiguration" , ( ) => {
225227 it . effect ( "resolvePrimary produces a stable scoped bootstrap token" , ( ) =>
@@ -316,7 +318,7 @@ describe("DesktopBackendConfiguration", () => {
316318 path . join ( resourcesPath , "server.asar/apps/server/dist/bin.mjs" ) ,
317319 ) ;
318320 assert . equal ( config . env . ELECTRON_RUN_AS_NODE , "1" ) ;
319- } ) . pipe ( Effect . scoped , Effect . provide ( NodeServices . layer ) ) ,
321+ } ) . pipe ( Effect . scoped , Effect . provide ( Layer . mergeAll ( NodeServices . layer , NodeCrypto . layer ) ) ) ,
320322 ) ;
321323
322324 it . effect ( "resolveWsl pins a default-tracking run to the concrete default distro" , ( ) =>
@@ -376,7 +378,7 @@ describe("DesktopBackendConfiguration", () => {
376378 assert . deepEqual ( config . args . slice ( 0 , 2 ) , [ "-d" , "Ubuntu" ] ) ;
377379 assert . deepEqual ( observedDistros , [ "Ubuntu" , "Ubuntu" , "Ubuntu" ] ) ;
378380 assert . isTrue ( Option . isNone ( config . preflightFailure ) ) ;
379- } ) . pipe ( Effect . scoped , Effect . provide ( NodeServices . layer ) ) ,
381+ } ) . pipe ( Effect . scoped , Effect . provide ( Layer . mergeAll ( NodeServices . layer , NodeCrypto . layer ) ) ) ,
380382 ) ;
381383
382384 it . effect ( "resolveWsl launches a packaged backend from the WSL-local runtime cache" , ( ) => {
@@ -665,7 +667,7 @@ describe("DesktopBackendConfiguration", () => {
665667 assert . notInclude ( config . args , "/bin/sh" ) ;
666668 assert . notInclude ( config . args , "-c" ) ;
667669 assert . isTrue ( Option . isNone ( config . preflightFailure ) ) ;
668- } ) . pipe ( Effect . scoped , Effect . provide ( NodeServices . layer ) ) ,
670+ } ) . pipe ( Effect . scoped , Effect . provide ( Layer . mergeAll ( NodeServices . layer , NodeCrypto . layer ) ) ) ,
669671 ) ;
670672
671673 it . effect ( "resolvePrimary and resolveWsl share one token under concurrent resolution" , ( ) =>
@@ -733,7 +735,7 @@ describe("DesktopBackendConfiguration", () => {
733735 restoreEnv ( "T3CODE_TELEMETRY_ENABLED" , previousTelemetry ) ;
734736 restoreEnv ( "OTEL_RESOURCE_ATTRIBUTES" , previousResourceAttributes ) ;
735737 }
736- } ) . pipe ( Effect . scoped , Effect . provide ( NodeServices . layer ) ) ,
738+ } ) . pipe ( Effect . scoped , Effect . provide ( Layer . mergeAll ( NodeServices . layer , NodeCrypto . layer ) ) ) ,
737739 ) ;
738740
739741 it . effect ( "resolveWsl preserves existing WSLENV entries when forwarding backend secrets" , ( ) =>
@@ -800,7 +802,7 @@ describe("DesktopBackendConfiguration", () => {
800802 restoreEnv ( "T3CODE_OTLP_PROTOCOL" , previousOtlpProtocol ) ;
801803 for ( const [ name , value ] of ambientOtel ) restoreEnv ( name , value ) ;
802804 }
803- } ) . pipe ( Effect . scoped , Effect . provide ( NodeServices . layer ) ) ,
805+ } ) . pipe ( Effect . scoped , Effect . provide ( Layer . mergeAll ( NodeServices . layer , NodeCrypto . layer ) ) ) ,
804806 ) ;
805807
806808 it . effect (
@@ -837,7 +839,7 @@ describe("DesktopBackendConfiguration", () => {
837839 ) ,
838840 ) ,
839841 ) ;
840- } ) . pipe ( Effect . scoped , Effect . provide ( NodeServices . layer ) ) ,
842+ } ) . pipe ( Effect . scoped , Effect . provide ( Layer . mergeAll ( NodeServices . layer , NodeCrypto . layer ) ) ) ,
841843 ) ;
842844
843845 it . effect (
@@ -880,7 +882,7 @@ describe("DesktopBackendConfiguration", () => {
880882 ) ,
881883 ) ,
882884 ) ;
883- } ) . pipe ( Effect . scoped , Effect . provide ( NodeServices . layer ) ) ,
885+ } ) . pipe ( Effect . scoped , Effect . provide ( Layer . mergeAll ( NodeServices . layer , NodeCrypto . layer ) ) ) ,
884886 ) ;
885887
886888 it . effect ( "resolveWsl marks a missing packaged server entry as fatal" , ( ) =>
@@ -913,7 +915,7 @@ describe("DesktopBackendConfiguration", () => {
913915 ) ,
914916 ) ,
915917 ) ;
916- } ) . pipe ( Effect . scoped , Effect . provide ( NodeServices . layer ) ) ,
918+ } ) . pipe ( Effect . scoped , Effect . provide ( Layer . mergeAll ( NodeServices . layer , NodeCrypto . layer ) ) ) ,
917919 ) ;
918920
919921 it . effect ( "prefers the external packaged resource monitor over the copy inside the asar" , ( ) =>
@@ -962,7 +964,7 @@ describe("DesktopBackendConfiguration", () => {
962964 ) ,
963965 ) ,
964966 ) ;
965- } ) . pipe ( Effect . scoped , Effect . provide ( NodeServices . layer ) ) ,
967+ } ) . pipe ( Effect . scoped , Effect . provide ( Layer . mergeAll ( NodeServices . layer , NodeCrypto . layer ) ) ) ,
966968 ) ;
967969
968970 it ( "resolvePrimaryLabel is runSync-safe against the real WSL availability probe" , async ( ) => {
@@ -983,7 +985,7 @@ describe("DesktopBackendConfiguration", () => {
983985 ) ,
984986 ) ,
985987 Layer . provideMerge ( layerEnvironment ( "/tmp/t3-wsl-isavailable" , { platform : "win32" } ) ) ,
986- Layer . provide ( NodeServices . layer ) ,
988+ Layer . provide ( Layer . mergeAll ( NodeServices . layer , NodeCrypto . layer ) ) ,
987989 ) ,
988990 ) ;
989991 try {
0 commit comments