chore: generate

pull/21368/head^2
opencode-agent[bot] 2026-04-07 18:33:24 +00:00
parent d83fe4b540
commit 6bfa82de65
2 changed files with 11 additions and 5 deletions

View File

@ -1,5 +1,11 @@
import { Cache, Clock, Duration, Effect, Layer, Option, Schema, SchemaGetter, ServiceMap } from "effect" import { Cache, Clock, Duration, Effect, Layer, Option, Schema, SchemaGetter, ServiceMap } from "effect"
import { FetchHttpClient, HttpClient, HttpClientError, HttpClientRequest, HttpClientResponse } from "effect/unstable/http" import {
FetchHttpClient,
HttpClient,
HttpClientError,
HttpClientRequest,
HttpClientResponse,
} from "effect/unstable/http"
import { makeRuntime } from "@/effect/run-service" import { makeRuntime } from "@/effect/run-service"
import { withTransientReadRetry } from "@/util/effect-http-client" import { withTransientReadRetry } from "@/util/effect-http-client"
@ -136,9 +142,7 @@ const isTokenFresh = (tokenExpiry: number | null, now: number) =>
const mapAccountServiceError = const mapAccountServiceError =
(message = "Account service operation failed") => (message = "Account service operation failed") =>
<A, E, R>(effect: Effect.Effect<A, E, R>): Effect.Effect<A, AccountError, R> => <A, E, R>(effect: Effect.Effect<A, E, R>): Effect.Effect<A, AccountError, R> =>
effect.pipe( effect.pipe(Effect.mapError((cause) => accountErrorFromCause(cause, message)))
Effect.mapError((cause) => accountErrorFromCause(cause, message)),
)
const accountErrorFromCause = (cause: unknown, message: string): AccountError => { const accountErrorFromCause = (cause: unknown, message: string): AccountError => {
if (cause instanceof AccountServiceError || cause instanceof AccountTransportError) { if (cause instanceof AccountServiceError || cause instanceof AccountTransportError) {

View File

@ -88,7 +88,9 @@ it.live("login normalizes trailing slashes in the provided server URL", () =>
}), }),
) )
const result = yield* Account.Service.use((s) => s.login("https://one.example.com/")).pipe(Effect.provide(live(client))) const result = yield* Account.Service.use((s) => s.login("https://one.example.com/")).pipe(
Effect.provide(live(client)),
)
expect(seen).toEqual(["POST https://one.example.com/auth/device/code"]) expect(seen).toEqual(["POST https://one.example.com/auth/device/code"])
expect(result.server).toBe("https://one.example.com") expect(result.server).toBe("https://one.example.com")