Przeglądaj źródła

chore: generate

opencode-agent[bot] 1 tydzień temu
rodzic
commit
6bfa82de65

+ 8 - 4
packages/opencode/src/account/index.ts

@@ -1,5 +1,11 @@
 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 { withTransientReadRetry } from "@/util/effect-http-client"
@@ -136,9 +142,7 @@ const isTokenFresh = (tokenExpiry: number | null, now: number) =>
 const mapAccountServiceError =
   (message = "Account service operation failed") =>
   <A, E, R>(effect: Effect.Effect<A, E, R>): Effect.Effect<A, AccountError, R> =>
-    effect.pipe(
-      Effect.mapError((cause) => accountErrorFromCause(cause, message)),
-    )
+    effect.pipe(Effect.mapError((cause) => accountErrorFromCause(cause, message)))
 
 const accountErrorFromCause = (cause: unknown, message: string): AccountError => {
   if (cause instanceof AccountServiceError || cause instanceof AccountTransportError) {

+ 3 - 1
packages/opencode/test/account/service.test.ts

@@ -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(result.server).toBe("https://one.example.com")