Skip to content

Commit 1aae67e

Browse files
authored
chore: upgrade Effect to rc.118 (#50231)
1 parent c50e39b commit 1aae67e

411 files changed

Lines changed: 5727 additions & 2132 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎bun.lock‎

Lines changed: 24 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@
4343
"packages/stats/*"
4444
],
4545
"catalog": {
46-
"@effect/opentelemetry": "4.0.0-rc.112",
47-
"@effect/platform-node": "4.0.0-rc.112",
48-
"@effect/platform-node-shared": "4.0.0-rc.112",
49-
"@effect/sql-sqlite-bun": "4.0.0-rc.112",
46+
"@effect/opentelemetry": "4.0.0-rc.118",
47+
"@effect/platform-node": "4.0.0-rc.118",
48+
"@effect/platform-node-shared": "4.0.0-rc.118",
49+
"@effect/sql-sqlite-bun": "4.0.0-rc.118",
5050
"@npmcli/arborist": "9.4.0",
5151
"@types/bun": "1.4.0",
5252
"@types/cross-spawn": "6.0.6",
@@ -80,7 +80,8 @@
8080
"dompurify": "3.4.14",
8181
"drizzle-kit": "1.0.0-rc.5-ab785fc",
8282
"drizzle-orm": "1.0.0-rc.5-169397b",
83-
"effect": "4.0.0-rc.112",
83+
"effect": "4.0.0-rc.118",
84+
"fast-check": "4.9.0",
8485
"ai": "6.0.168",
8586
"cross-spawn": "7.0.6",
8687
"hono": "4.10.7",

‎packages/ai/example/tutorial.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { OpenAI } from "@opencode/ai/providers"
1515
* hover imports and local values to see how the public API is typed.
1616
*/
1717

18-
const apiKey = Config.redacted("OPENAI_API_KEY")
18+
const apiKey = Config.Redacted("OPENAI_API_KEY")
1919

2020
// 1. Configure a provider. The configured facade records provider identity,
2121
// deployment options, authentication, and defaults. Per-modality selectors pick

‎packages/ai/script/setup-recording-env.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import * as path from "node:path"
55
import * as prompts from "@clack/prompts"
66
import { AwsV4Signer } from "aws4fetch"
77
import { Config, ConfigProvider, Effect, FileSystem, PlatformError, Redacted } from "effect"
8-
import { FetchHttpClient, HttpClient, HttpClientRequest, type HttpClientResponse } from "effect/unstable/http"
8+
import { FetchHttpClient, HttpClient, HttpClientRequest, type HttpClientResponse } from "effect/http"
99
import * as ProviderShared from "../src/protocols/shared"
1010
import { CloudflareAIGateway } from "../src/providers/cloudflare-ai-gateway.js"
1111
import { CloudflareWorkersAI } from "../src/providers/cloudflare-workers-ai.js"
@@ -383,7 +383,7 @@ const readEnvFile = Effect.fn("RecordingEnv.readFile")(function* () {
383383
})
384384

385385
const readConfigString = (provider: ConfigProvider.ConfigProvider, name: string) =>
386-
Config.string(name)
386+
Config.String(name)
387387
.parse(provider)
388388
.pipe(
389389
Effect.match({

‎packages/ai/src/experimental/system-one.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Effect, Schema } from "effect"
2-
import { Headers, HttpClientRequest } from "effect/unstable/http"
2+
import { Headers, HttpClientRequest } from "effect/http"
33
import {
44
ChoiceQuestion,
55
EvaluationInput,

‎packages/ai/src/media.ts‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
export * as Media from "./media.js"
22

3-
import { Effect, Encoding, FileSystem, Schema, SchemaGetter } from "effect"
4-
import { HttpClientRequest } from "effect/unstable/http"
3+
import { Effect, FileSystem, Schema, SchemaGetter } from "effect"
4+
import { Base64 } from "effect/encoding"
5+
import { HttpClientRequest } from "effect/http"
56
import { ProviderID } from "./schema/ids.js"
67
import { AIError, HttpContext, InvalidProviderOutputError, InvalidRequestError } from "./schema/errors.js"
78
import { ProviderMetadata } from "./schema/options.js"
@@ -140,7 +141,7 @@ export class Asset {
140141
inline(): Inline | undefined {
141142
const source = this.source
142143
if (source.type !== "bytes" && source.type !== "base64") return undefined
143-
const base64 = source.type === "base64" ? source.data : (this.#base64 ??= Encoding.encodeBase64(source.data))
144+
const base64 = source.type === "base64" ? source.data : (this.#base64 ??= Base64.encode(source.data))
144145
const mime = this.mediaType.toLowerCase()
145146
return { mime, base64, dataUrl: `data:${mime};base64,${base64}` }
146147
}
@@ -155,7 +156,7 @@ export class Asset {
155156
return Effect.fail(invalid(`Cannot materialize provider ref ${source.provider}:${source.id}`))
156157
const decoded =
157158
source.type === "base64"
158-
? Effect.fromResult(Encoding.decodeBase64(source.data)).pipe(
159+
? Effect.fromResult(Base64.decode(source.data)).pipe(
159160
Effect.mapError((cause) => invalid(`Media asset contains invalid base64 data`, cause)),
160161
)
161162
: download(source, this.headers)
@@ -168,7 +169,7 @@ export class Asset {
168169
const source = this.source
169170
if (source.type === "base64") return Effect.succeed(source.data)
170171
if (this.#base64 !== undefined) return Effect.succeed(this.#base64)
171-
return this.bytes().pipe(Effect.map((data) => (this.#base64 = Encoding.encodeBase64(data))))
172+
return this.bytes().pipe(Effect.map((data) => (this.#base64 = Base64.encode(data))))
172173
})
173174
}
174175

@@ -183,7 +184,7 @@ export class Asset {
183184
toJSON() {
184185
const source = this.source
185186
return {
186-
source: source.type === "bytes" ? { ...source, data: Encoding.encodeBase64(source.data) } : source,
187+
source: source.type === "bytes" ? { ...source, data: Base64.encode(source.data) } : source,
187188
info: this.info,
188189
providerMetadata: this.providerMetadata,
189190
}

‎packages/ai/src/protocols/anthropic-messages.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Auth } from "../route/auth.js"
66
import { Endpoint } from "../route/endpoint.js"
77
import { Framing } from "../route/framing.js"
88
import { Protocol } from "../route/protocol.js"
9-
import { Headers } from "effect/unstable/http"
9+
import { Headers } from "effect/http"
1010
import { HttpTransport } from "../route/transport/index.js"
1111
import {
1212
AIError,

‎packages/ai/src/protocols/assemblyai-transcription.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Effect, Schema } from "effect"
2-
import type { HttpClientResponse } from "effect/unstable/http"
2+
import type { HttpClientResponse } from "effect/http"
33
import type { Status } from "../generation.js"
44
import { Media } from "../media.js"
55
import { MediaProtocol } from "../route/media-protocol.js"

‎packages/ai/src/protocols/bedrock-converse.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { Effect, Encoding, Schema } from "effect"
1+
import { Effect, Schema } from "effect"
2+
import { Base64 } from "effect/encoding"
23
import { Route } from "../route/client.js"
34
import { Endpoint } from "../route/endpoint.js"
45
import { Protocol } from "../route/protocol.js"
@@ -612,7 +613,7 @@ interface ParserState {
612613
readonly reasoningRedactedContent: Readonly<Record<number, Uint8Array[]>>
613614
}
614615

615-
const encodeRedactedContent = (chunks: ReadonlyArray<Uint8Array>) => Encoding.encodeBase64(concatBytes(chunks))
616+
const encodeRedactedContent = (chunks: ReadonlyArray<Uint8Array>) => Base64.encode(concatBytes(chunks))
616617

617618
const step = (state: ParserState, event: BedrockEvent) =>
618619
Effect.gen(function* () {
@@ -661,7 +662,7 @@ const step = (state: ParserState, event: BedrockEvent) =>
661662
const events: LLMEvent[] = []
662663
const redactedChunk = yield* (() => {
663664
if (reasoning.redactedContent === undefined) return Effect.succeed(undefined)
664-
return Effect.fromResult(Encoding.decodeBase64(reasoning.redactedContent)).pipe(
665+
return Effect.fromResult(Base64.decode(reasoning.redactedContent)).pipe(
665666
Effect.mapError((cause) =>
666667
ProviderShared.eventError(
667668
ADAPTER,

‎packages/ai/src/protocols/bedrock-event-stream.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { EventStreamCodec } from "@smithy/eventstream-codec"
22
import { fromUtf8, toUtf8 } from "@smithy/util-utf8"
3-
import { Effect, Encoding, Stream } from "effect"
3+
import { Effect, Stream } from "effect"
4+
import { Base64 } from "effect/encoding"
45
import { AIError, AIErrorReason, InvalidProviderOutputError } from "../schema/index.js"
56
import { Framing } from "../route/framing.js"
67
import { ProviderShared } from "./shared.js"
@@ -47,7 +48,7 @@ const consumeFrames = (route: string) => (state: FrameBufferState, input: FrameI
4748
route,
4849
classification: "incomplete-stream",
4950
message: `Incomplete Bedrock Converse event-stream frame: ${remaining.length} buffered bytes remain at end of stream`,
50-
body: Encoding.encodeBase64(remaining),
51+
body: Base64.encode(remaining),
5152
}),
5253
})
5354
return [state, []] as const
@@ -68,7 +69,7 @@ const consumeFrames = (route: string) => (state: FrameBufferState, input: FrameI
6869
`Failed to decode Bedrock Converse event-stream frame: ${
6970
error instanceof Error ? error.message : String(error)
7071
}`,
71-
Encoding.encodeBase64(view.subarray(0, totalLength)),
72+
Base64.encode(view.subarray(0, totalLength)),
7273
error,
7374
),
7475
})

0 commit comments

Comments
 (0)