| author | |
| committer | |
| log | 9a1c4875a37ea7eeb77db189e2e45db9404d7a47 |
| tree | 67e6a7188471f04bd2fb8223f1a694a2dc6aaebd |
| parent | 7eda6ba5fce8290b3a13d1ab730827fc36a34e53 |
| signature | Signed by PGP key B5690EEEBB952194 |
Co-authored-by: codex <codex@users.noreply.github.com>14 files changed, 69 insertions(+), 123 deletions(-)
apps/desktop/src/app/DesktopObservability.ts+1-5| ... | @@ -50,11 +50,7 @@ export function makeComponentLogger(component: string): DesktopComponentLogger { | ... | @@ -50,11 +50,7 @@ export function makeComponentLogger(component: string): DesktopComponentLogger { |
| 50 | }; | 50 | }; |
| 51 | } | 51 | } |
| 52 | 52 | ||
| 53 | const readPersistedOtlpTracesUrl: Effect.Effect< | 53 | const readPersistedOtlpTracesUrl = Effect.gen(function* () { |
| 54 | Option.Option<string>, | ||
| 55 | never, | ||
| 56 | FileSystem.FileSystem | DesktopEnvironment.DesktopEnvironment | ||
| 57 | > = Effect.gen(function* () { | ||
| 58 | const fileSystem = yield* FileSystem.FileSystem; | 54 | const fileSystem = yield* FileSystem.FileSystem; |
| 59 | const environment = yield* DesktopEnvironment.DesktopEnvironment; | 55 | const environment = yield* DesktopEnvironment.DesktopEnvironment; |
| 60 | const raw = yield* fileSystem.readFileString(environment.serverSettingsPath).pipe(Effect.option); | 56 | const raw = yield* fileSystem.readFileString(environment.serverSettingsPath).pipe(Effect.option); |
apps/desktop/src/backend/DesktopBackendConfiguration.ts+1-5| ... | @@ -54,11 +54,7 @@ const { logWarning: logBackendConfigurationWarning } = DesktopObservability.make | ... | @@ -54,11 +54,7 @@ const { logWarning: logBackendConfigurationWarning } = DesktopObservability.make |
| 54 | "desktop-backend-configuration", | 54 | "desktop-backend-configuration", |
| 55 | ); | 55 | ); |
| 56 | 56 | ||
| 57 | const readPersistedBackendObservabilitySettings: Effect.Effect< | 57 | const readPersistedBackendObservabilitySettings = Effect.gen(function* () { |
| 58 | BackendObservabilitySettings, | ||
| 59 | never, | ||
| 60 | FileSystem.FileSystem | DesktopEnvironment.DesktopEnvironment | ||
| 61 | > = Effect.gen(function* () { | ||
| 62 | const fileSystem = yield* FileSystem.FileSystem; | 58 | const fileSystem = yield* FileSystem.FileSystem; |
| 63 | const environment = yield* DesktopEnvironment.DesktopEnvironment; | 59 | const environment = yield* DesktopEnvironment.DesktopEnvironment; |
| 64 | const exists = yield* fileSystem | 60 | const exists = yield* fileSystem |
apps/desktop/src/shell/DesktopShellEnvironment.ts+1-5| ... | @@ -211,11 +211,7 @@ const readLoginShellEnvironment = ( | ... | @@ -211,11 +211,7 @@ const readLoginShellEnvironment = ( |
| 211 | timeout: LOGIN_SHELL_TIMEOUT, | 211 | timeout: LOGIN_SHELL_TIMEOUT, |
| 212 | }).pipe(Effect.map((output) => extractEnvironment(output, names))); | 212 | }).pipe(Effect.map((output) => extractEnvironment(output, names))); |
| 213 | 213 | ||
| 214 | const readLaunchctlPath: Effect.Effect< | 214 | const readLaunchctlPath = runCommandOutput({ |
| 215 | Option.Option<string>, | ||
| 216 | never, | ||
| 217 | ChildProcessSpawner.ChildProcessSpawner | ||
| 218 | > = runCommandOutput({ | ||
| 219 | command: "/bin/launchctl", | 215 | command: "/bin/launchctl", |
| 220 | args: ["getenv", "PATH"], | 216 | args: ["getenv", "PATH"], |
| 221 | timeout: LAUNCHCTL_TIMEOUT, | 217 | timeout: LAUNCHCTL_TIMEOUT, |
apps/desktop/src/window/DesktopApplicationMenu.ts+2-10| ... | @@ -37,11 +37,7 @@ const dispatchMenuAction = Effect.fn("desktop.menu.dispatchMenuAction")(function | ... | @@ -37,11 +37,7 @@ const dispatchMenuAction = Effect.fn("desktop.menu.dispatchMenuAction")(function |
| 37 | yield* desktopWindow.dispatchMenuAction(action); | 37 | yield* desktopWindow.dispatchMenuAction(action); |
| 38 | }); | 38 | }); |
| 39 | 39 | ||
| 40 | const checkForUpdatesFromMenu: Effect.Effect< | 40 | const checkForUpdatesFromMenu = Effect.gen(function* () { |
| 41 | void, | ||
| 42 | never, | ||
| 43 | DesktopUpdates.DesktopUpdates | ElectronDialog.ElectronDialog | ||
| 44 | > = Effect.gen(function* () { | ||
| 45 | const updates = yield* DesktopUpdates.DesktopUpdates; | 41 | const updates = yield* DesktopUpdates.DesktopUpdates; |
| 46 | const electronDialog = yield* ElectronDialog.ElectronDialog; | 42 | const electronDialog = yield* ElectronDialog.ElectronDialog; |
| 47 | const result = yield* updates.check("menu"); | 43 | const result = yield* updates.check("menu"); |
| ... | @@ -65,11 +61,7 @@ const checkForUpdatesFromMenu: Effect.Effect< | ... | @@ -65,11 +61,7 @@ const checkForUpdatesFromMenu: Effect.Effect< |
| 65 | } | 61 | } |
| 66 | }).pipe(Effect.withSpan("desktop.menu.checkForUpdates")); | 62 | }).pipe(Effect.withSpan("desktop.menu.checkForUpdates")); |
| 67 | 63 | ||
| 68 | const handleCheckForUpdatesMenuClick: Effect.Effect< | 64 | const handleCheckForUpdatesMenuClick = Effect.gen(function* () { |
| 69 | void, | ||
| 70 | DesktopWindow.DesktopWindowError, | ||
| 71 | DesktopUpdates.DesktopUpdates | ElectronDialog.ElectronDialog | DesktopWindow.DesktopWindow | ||
| 72 | > = Effect.gen(function* () { | ||
| 73 | const updates = yield* DesktopUpdates.DesktopUpdates; | 65 | const updates = yield* DesktopUpdates.DesktopUpdates; |
| 74 | const electronDialog = yield* ElectronDialog.ElectronDialog; | 66 | const electronDialog = yield* ElectronDialog.ElectronDialog; |
| 75 | const disabledReason = yield* updates.disabledReason; | 67 | const disabledReason = yield* updates.disabledReason; |
apps/mobile/src/connection/runtime.ts+7-11| ... | @@ -5,24 +5,20 @@ import { Atom } from "effect/unstable/reactivity"; | ... | @@ -5,24 +5,20 @@ import { Atom } from "effect/unstable/reactivity"; |
| 5 | import { runtimeContextLayer } from "../lib/runtime"; | 5 | import { runtimeContextLayer } from "../lib/runtime"; |
| 6 | import { connectionPlatformLayer } from "./platform"; | 6 | import { connectionPlatformLayer } from "./platform"; |
| 7 | 7 | ||
| 8 | const providedConnectionPlatformLayer: Layer.Layer< | 8 | const providedConnectionPlatformLayer = connectionPlatformLayer.pipe( |
| 9 | Layer.Success<typeof connectionPlatformLayer>, | 9 | Layer.provide(runtimeContextLayer), |
| 10 | Layer.Error<typeof connectionPlatformLayer> | 10 | ); |
| 11 | > = connectionPlatformLayer.pipe(Layer.provide(runtimeContextLayer)); | ||
| 12 | 11 | ||
| 13 | type ConnectionLayerSource = | 12 | type ConnectionLayerSource = |
| 14 | | typeof Connection.layer | 13 | | typeof Connection.layer |
| 15 | | typeof runtimeContextLayer | 14 | | typeof runtimeContextLayer |
| 16 | | typeof providedConnectionPlatformLayer; | 15 | | typeof connectionPlatformLayer; |
| 17 | 16 | ||
| 18 | export const connectionLayer: Layer.Layer< | 17 | const connectionLayer = Connection.layer.pipe( |
| 19 | Layer.Success<ConnectionLayerSource>, | ||
| 20 | Layer.Error<ConnectionLayerSource> | ||
| 21 | > = Connection.layer.pipe( | ||
| 22 | Layer.provideMerge(Layer.mergeAll(runtimeContextLayer, providedConnectionPlatformLayer)), | 18 | Layer.provideMerge(Layer.mergeAll(runtimeContextLayer, providedConnectionPlatformLayer)), |
| 23 | ); | 19 | ); |
| 24 | 20 | ||
| 25 | export const connectionAtomRuntime: Atom.AtomRuntime< | 21 | export const connectionAtomRuntime: Atom.AtomRuntime< |
| 26 | Layer.Success<typeof connectionLayer>, | 22 | Layer.Success<ConnectionLayerSource>, |
| 27 | Layer.Error<typeof connectionLayer> | 23 | Layer.Error<ConnectionLayerSource> |
| 28 | > = Atom.runtime(connectionLayer); | 24 | > = Atom.runtime(connectionLayer); |
apps/mobile/src/lib/runtime.ts+5-8| ... | @@ -22,10 +22,7 @@ type RuntimeLayerSource = | ... | @@ -22,10 +22,7 @@ type RuntimeLayerSource = |
| 22 | | typeof httpClientLayer | 22 | | typeof httpClientLayer |
| 23 | | typeof tracingLayer; | 23 | | typeof tracingLayer; |
| 24 | 24 | ||
| 25 | export const runtimeLayer: Layer.Layer< | 25 | const runtimeLayer = Layer.merge( |
| 26 | Layer.Success<RuntimeLayerSource>, | ||
| 27 | Layer.Error<RuntimeLayerSource> | ||
| 28 | > = Layer.merge( | ||
| 29 | managedRelayClientLayer(configuredRelayUrl()), | 26 | managedRelayClientLayer(configuredRelayUrl()), |
| 30 | Socket.layerWebSocketConstructorGlobal, | 27 | Socket.layerWebSocketConstructorGlobal, |
| 31 | ).pipe( | 28 | ).pipe( |
| ... | @@ -35,11 +32,11 @@ export const runtimeLayer: Layer.Layer< | ... | @@ -35,11 +32,11 @@ export const runtimeLayer: Layer.Layer< |
| 35 | ); | 32 | ); |
| 36 | 33 | ||
| 37 | export const runtime: ManagedRuntime.ManagedRuntime< | 34 | export const runtime: ManagedRuntime.ManagedRuntime< |
| 38 | Layer.Success<typeof runtimeLayer>, | 35 | Layer.Success<RuntimeLayerSource>, |
| 39 | Layer.Error<typeof runtimeLayer> | 36 | Layer.Error<RuntimeLayerSource> |
| 40 | > = ManagedRuntime.make(runtimeLayer); | 37 | > = ManagedRuntime.make(runtimeLayer); |
| 41 | 38 | ||
| 42 | export const runtimeContextLayer: Layer.Layer< | 39 | export const runtimeContextLayer: Layer.Layer< |
| 43 | Layer.Success<typeof runtimeLayer>, | 40 | Layer.Success<RuntimeLayerSource>, |
| 44 | Layer.Error<typeof runtimeLayer> | 41 | Layer.Error<RuntimeLayerSource> |
| 45 | > = Layer.effectContext(runtime.contextEffect); | 42 | > = Layer.effectContext(runtime.contextEffect); |
apps/mobile/src/state/relay.ts+1-1| ... | @@ -2,5 +2,5 @@ import { createRelayEnvironmentDiscoveryAtoms } from "@t3tools/client-runtime/st | ... | @@ -2,5 +2,5 @@ import { createRelayEnvironmentDiscoveryAtoms } from "@t3tools/client-runtime/st |
| 2 | 2 | ||
| 3 | import { connectionAtomRuntime } from "../connection/runtime"; | 3 | import { connectionAtomRuntime } from "../connection/runtime"; |
| 4 | 4 | ||
| 5 | export const relayEnvironmentDiscovery: ReturnType<typeof createRelayEnvironmentDiscoveryAtoms> = | 5 | export const relayEnvironmentDiscovery = |
| 6 | createRelayEnvironmentDiscoveryAtoms(connectionAtomRuntime); | 6 | createRelayEnvironmentDiscoveryAtoms(connectionAtomRuntime); |
apps/server/src/mcp/McpSessionRegistry.ts+1-5| ... | @@ -191,11 +191,7 @@ const make = Effect.acquireRelease( | ... | @@ -191,11 +191,7 @@ const make = Effect.acquireRelease( |
| 191 | }), | 191 | }), |
| 192 | ); | 192 | ); |
| 193 | 193 | ||
| 194 | export const layer: Layer.Layer< | 194 | export const layer = Layer.effect(McpSessionRegistry, make); |
| 195 | McpSessionRegistry, | ||
| 196 | never, | ||
| 197 | Crypto.Crypto | ServerEnvironment.ServerEnvironment | HttpServer.HttpServer | ||
| 198 | > = Layer.effect(McpSessionRegistry, make); | ||
| 199 | 195 | ||
| 200 | export const issueActiveMcpCredential = ( | 196 | export const issueActiveMcpCredential = ( |
| 201 | request: McpCredentialRequest, | 197 | request: McpCredentialRequest, |
apps/server/src/provider/Layers/ProviderInstanceRegistryHydration.ts+1-5| ... | @@ -114,11 +114,7 @@ export const deriveProviderInstanceConfigMap = ( | ... | @@ -114,11 +114,7 @@ export const deriveProviderInstanceConfigMap = ( |
| 114 | * configs, so the only way the watcher could fail is a settings stream | 114 | * configs, so the only way the watcher could fail is a settings stream |
| 115 | * tear-down, which logs and exits cleanly. | 115 | * tear-down, which logs and exits cleanly. |
| 116 | */ | 116 | */ |
| 117 | const SettingsWatcherLive: Layer.Layer< | 117 | const SettingsWatcherLive = Layer.effectDiscard( |
| 118 | never, | ||
| 119 | never, | ||
| 120 | ProviderInstanceRegistryMutator | ServerSettingsService | ||
| 121 | > = Layer.effectDiscard( | ||
| 122 | Effect.gen(function* () { | 118 | Effect.gen(function* () { |
| 123 | const mutator = yield* ProviderInstanceRegistryMutator; | 119 | const mutator = yield* ProviderInstanceRegistryMutator; |
| 124 | const serverSettings = yield* ServerSettingsService; | 120 | const serverSettings = yield* ServerSettingsService; |
apps/web/src/cloud/dpop.ts+34-37| ... | @@ -107,43 +107,40 @@ export function writeStoredBrowserDpopKey( | ... | @@ -107,43 +107,40 @@ export function writeStoredBrowserDpopKey( |
| 107 | ); | 107 | ); |
| 108 | } | 108 | } |
| 109 | 109 | ||
| 110 | export const generateBrowserDpopKey: Effect.Effect<BrowserDpopKey, BrowserDpopError> = Effect.gen( | 110 | export const generateBrowserDpopKey = Effect.gen(function* () { |
| 111 | function* () { | 111 | const generated = yield* Effect.tryPromise({ |
| 112 | const generated = yield* Effect.tryPromise({ | 112 | try: () => |
| 113 | try: () => | 113 | crypto.subtle.generateKey({ name: "ECDSA", namedCurve: "P-256" }, true, [ |
| 114 | crypto.subtle.generateKey({ name: "ECDSA", namedCurve: "P-256" }, true, [ | 114 | "sign", |
| 115 | "sign", | 115 | "verify", |
| 116 | "verify", | 116 | ]) as Promise<CryptoKeyPair>, |
| 117 | ]) as Promise<CryptoKeyPair>, | 117 | catch: (cause) => dpopError("Could not generate DPoP proof key.", cause), |
| 118 | catch: (cause) => dpopError("Could not generate DPoP proof key.", cause), | 118 | }); |
| 119 | }); | 119 | const privateJwk = yield* Effect.tryPromise({ |
| 120 | const privateJwk = yield* Effect.tryPromise({ | 120 | try: () => crypto.subtle.exportKey("jwk", generated.privateKey), |
| 121 | try: () => crypto.subtle.exportKey("jwk", generated.privateKey), | 121 | catch: (cause) => dpopError("Could not export DPoP private key.", cause), |
| 122 | catch: (cause) => dpopError("Could not export DPoP private key.", cause), | 122 | }); |
| 123 | }); | 123 | const publicJwk = yield* Effect.tryPromise({ |
| 124 | const publicJwk = yield* Effect.tryPromise({ | 124 | try: () => crypto.subtle.exportKey("jwk", generated.publicKey), |
| 125 | try: () => crypto.subtle.exportKey("jwk", generated.publicKey), | 125 | catch: (cause) => dpopError("Could not export DPoP public key.", cause), |
| 126 | catch: (cause) => dpopError("Could not export DPoP public key.", cause), | 126 | }).pipe( |
| 127 | }).pipe( | 127 | Effect.flatMap((jwk) => decodeDpopPublicJwk(jwk)), |
| 128 | Effect.flatMap((jwk) => decodeDpopPublicJwk(jwk)), | 128 | Effect.mapError((cause) => |
| 129 | Effect.mapError((cause) => | 129 | cause instanceof BrowserDpopError |
| 130 | cause instanceof BrowserDpopError | 130 | ? cause |
| 131 | ? cause | 131 | : dpopError("Generated DPoP public key is invalid.", cause), |
| 132 | : dpopError("Generated DPoP public key is invalid.", cause), | 132 | ), |
| 133 | ), | 133 | ); |
| 134 | ); | 134 | const privateKey = yield* Effect.tryPromise({ |
| 135 | const privateKey = yield* Effect.tryPromise({ | 135 | try: () => importJWK(privateJwk as JWK, "ES256", { extractable: false }) as Promise<CryptoKey>, |
| 136 | try: () => | 136 | catch: (cause) => dpopError("Could not import DPoP private key.", cause), |
| 137 | importJWK(privateJwk as JWK, "ES256", { extractable: false }) as Promise<CryptoKey>, | 137 | }); |
| 138 | catch: (cause) => dpopError("Could not import DPoP private key.", cause), | 138 | return { |
| 139 | }); | 139 | privateKey, |
| 140 | return { | 140 | publicJwk, |
| 141 | privateKey, | 141 | thumbprint: computeDpopJwkThumbprint(publicJwk), |
| 142 | publicJwk, | 142 | }; |
| 143 | thumbprint: computeDpopJwkThumbprint(publicJwk), | 143 | }); |
| 144 | }; | ||
| 145 | }, | ||
| 146 | ); | ||
| 147 | 144 | ||
| 148 | export function createBrowserDpopProof(input: { | 145 | export function createBrowserDpopProof(input: { |
| 149 | readonly method: string; | 146 | readonly method: string; |
apps/web/src/connection/runtime.ts+7-11| ... | @@ -5,24 +5,20 @@ import { Atom } from "effect/unstable/reactivity"; | ... | @@ -5,24 +5,20 @@ import { Atom } from "effect/unstable/reactivity"; |
| 5 | import { runtimeContextLayer } from "../lib/runtime"; | 5 | import { runtimeContextLayer } from "../lib/runtime"; |
| 6 | import { connectionPlatformLayer } from "./platform"; | 6 | import { connectionPlatformLayer } from "./platform"; |
| 7 | 7 | ||
| 8 | const providedConnectionPlatformLayer: Layer.Layer< | 8 | const providedConnectionPlatformLayer = connectionPlatformLayer.pipe( |
| 9 | Layer.Success<typeof connectionPlatformLayer>, | 9 | Layer.provide(runtimeContextLayer), |
| 10 | Layer.Error<typeof connectionPlatformLayer> | 10 | ); |
| 11 | > = connectionPlatformLayer.pipe(Layer.provide(runtimeContextLayer)); | ||
| 12 | 11 | ||
| 13 | type ConnectionLayerSource = | 12 | type ConnectionLayerSource = |
| 14 | | typeof Connection.layer | 13 | | typeof Connection.layer |
| 15 | | typeof runtimeContextLayer | 14 | | typeof runtimeContextLayer |
| 16 | | typeof providedConnectionPlatformLayer; | 15 | | typeof connectionPlatformLayer; |
| 17 | 16 | ||
| 18 | export const connectionLayer: Layer.Layer< | 17 | const connectionLayer = Connection.layer.pipe( |
| 19 | Layer.Success<ConnectionLayerSource>, | ||
| 20 | Layer.Error<ConnectionLayerSource> | ||
| 21 | > = Connection.layer.pipe( | ||
| 22 | Layer.provideMerge(Layer.mergeAll(runtimeContextLayer, providedConnectionPlatformLayer)), | 18 | Layer.provideMerge(Layer.mergeAll(runtimeContextLayer, providedConnectionPlatformLayer)), |
| 23 | ); | 19 | ); |
| 24 | 20 | ||
| 25 | export const connectionAtomRuntime: Atom.AtomRuntime< | 21 | export const connectionAtomRuntime: Atom.AtomRuntime< |
| 26 | Layer.Success<typeof connectionLayer>, | 22 | Layer.Success<ConnectionLayerSource>, |
| 27 | Layer.Error<typeof connectionLayer> | 23 | Layer.Error<ConnectionLayerSource> |
| 28 | > = Atom.runtime(connectionLayer); | 24 | > = Atom.runtime(connectionLayer); |
apps/web/src/lib/runtime.ts+5-8| ... | @@ -54,10 +54,7 @@ export function __setPrimaryHttpRunnerForTests(runner?: PrimaryHttpEffectRunner) | ... | @@ -54,10 +54,7 @@ export function __setPrimaryHttpRunnerForTests(runner?: PrimaryHttpEffectRunner) |
| 54 | primaryHttpRunner = runner ?? livePrimaryHttpRunner; | 54 | primaryHttpRunner = runner ?? livePrimaryHttpRunner; |
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | export const runtimeLayer: Layer.Layer< | 57 | const runtimeLayer = Layer.mergeAll( |
| 58 | Layer.Success<RuntimeLayerSource>, | ||
| 59 | Layer.Error<RuntimeLayerSource> | ||
| 60 | > = Layer.mergeAll( | ||
| 61 | httpClientLayer, | 58 | httpClientLayer, |
| 62 | browserCryptoLayer, | 59 | browserCryptoLayer, |
| 63 | Socket.layerWebSocketConstructorGlobal, | 60 | Socket.layerWebSocketConstructorGlobal, |
| ... | @@ -68,11 +65,11 @@ export const runtimeLayer: Layer.Layer< | ... | @@ -68,11 +65,11 @@ export const runtimeLayer: Layer.Layer< |
| 68 | ); | 65 | ); |
| 69 | 66 | ||
| 70 | export const runtime: ManagedRuntime.ManagedRuntime< | 67 | export const runtime: ManagedRuntime.ManagedRuntime< |
| 71 | Layer.Success<typeof runtimeLayer>, | 68 | Layer.Success<RuntimeLayerSource>, |
| 72 | Layer.Error<typeof runtimeLayer> | 69 | Layer.Error<RuntimeLayerSource> |
| 73 | > = ManagedRuntime.make(runtimeLayer); | 70 | > = ManagedRuntime.make(runtimeLayer); |
| 74 | 71 | ||
| 75 | export const runtimeContextLayer: Layer.Layer< | 72 | export const runtimeContextLayer: Layer.Layer< |
| 76 | Layer.Success<typeof runtimeLayer>, | 73 | Layer.Success<RuntimeLayerSource>, |
| 77 | Layer.Error<typeof runtimeLayer> | 74 | Layer.Error<RuntimeLayerSource> |
| 78 | > = Layer.effectContext(runtime.contextEffect); | 75 | > = Layer.effectContext(runtime.contextEffect); |
packages/client-runtime/src/rpc/client.ts+2-7| ... | @@ -1,4 +1,4 @@ | ... | @@ -1,4 +1,4 @@ |
| 1 | import { ORCHESTRATION_WS_METHODS, type ServerConfig, WS_METHODS } from "@t3tools/contracts"; | 1 | import { ORCHESTRATION_WS_METHODS, WS_METHODS } from "@t3tools/contracts"; |
| 2 | import * as Cause from "effect/Cause"; | 2 | import * as Cause from "effect/Cause"; |
| 3 | import * as Context from "effect/Context"; | 3 | import * as Context from "effect/Context"; |
| 4 | import type * as Duration from "effect/Duration"; | 4 | import type * as Duration from "effect/Duration"; |
| ... | @@ -9,7 +9,6 @@ import * as Stream from "effect/Stream"; | ... | @@ -9,7 +9,6 @@ import * as Stream from "effect/Stream"; |
| 9 | import * as SubscriptionRef from "effect/SubscriptionRef"; | 9 | import * as SubscriptionRef from "effect/SubscriptionRef"; |
| 10 | import { RpcClientError } from "effect/unstable/rpc"; | 10 | import { RpcClientError } from "effect/unstable/rpc"; |
| 11 | 11 | ||
| 12 | import type { ConnectionAttemptError } from "../connection/model.ts"; | ||
| 13 | import { EnvironmentSupervisor } from "../connection/supervisor.ts"; | 12 | import { EnvironmentSupervisor } from "../connection/supervisor.ts"; |
| 14 | import type { WsRpcProtocolClient } from "../rpc/protocol.ts"; | 13 | import type { WsRpcProtocolClient } from "../rpc/protocol.ts"; |
| 15 | 14 | ||
| ... | @@ -237,11 +236,7 @@ export function subscribe<TTag extends EnvironmentSubscriptionRpcTag>( | ... | @@ -237,11 +236,7 @@ export function subscribe<TTag extends EnvironmentSubscriptionRpcTag>( |
| 237 | ); | 236 | ); |
| 238 | } | 237 | } |
| 239 | 238 | ||
| 240 | export const config: Effect.Effect< | 239 | export const config = Effect.gen(function* () { |
| 241 | ServerConfig, | ||
| 242 | EnvironmentRpcUnavailableError | ConnectionAttemptError, | ||
| 243 | EnvironmentSupervisor | ||
| 244 | > = Effect.gen(function* () { | ||
| 245 | const session = yield* currentSession(); | 240 | const session = yield* currentSession(); |
| 246 | return yield* session.initialConfig; | 241 | return yield* session.initialConfig; |
| 247 | }).pipe(Effect.withSpan("EnvironmentRpc.config")); | 242 | }).pipe(Effect.withSpan("EnvironmentRpc.config")); |
packages/tailscale/src/tailscale.ts+1-5| ... | @@ -135,11 +135,7 @@ export const parseTailscaleStatus = ( | ... | @@ -135,11 +135,7 @@ export const parseTailscaleStatus = ( |
| 135 | }), | 135 | }), |
| 136 | ); | 136 | ); |
| 137 | 137 | ||
| 138 | export const readTailscaleStatus: Effect.Effect< | 138 | export const readTailscaleStatus = Effect.gen(function* () { |
| 139 | TailscaleStatus, | ||
| 140 | TailscaleCommandError | TailscaleStatusParseError, | ||
| 141 | ChildProcessSpawner.ChildProcessSpawner | ||
| 142 | > = Effect.gen(function* () { | ||
| 143 | const args = ["status", "--json"]; | 139 | const args = ["status", "--json"]; |
| 144 | const spawner = yield* ChildProcessSpawner.ChildProcessSpawner; | 140 | const spawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 145 | const hostPlatform = yield* HostProcessPlatform; | 141 | const hostPlatform = yield* HostProcessPlatform; |