chore: upgrade Effect to beta.98 (#37498)
This commit is contained in:
@@ -23,7 +23,7 @@ import { Skill } from "../skill"
|
||||
import { Effect, Context, Layer, Schema } from "effect"
|
||||
import { InstanceState } from "@/effect/instance-state"
|
||||
import * as Option from "effect/Option"
|
||||
import * as OtelTracer from "@effect/opentelemetry/Tracer"
|
||||
import * as OtelTracer from "@effect/opentelemetry/OtelTracer"
|
||||
import { AbsolutePath, type DeepMutable } from "@opencode-ai/core/schema"
|
||||
import { ProviderV2 } from "@opencode-ai/core/provider"
|
||||
import { ModelV2 } from "@opencode-ai/core/model"
|
||||
|
||||
@@ -315,7 +315,7 @@ const layer = Layer.effect(
|
||||
if (input.icon?.url) return
|
||||
|
||||
const matches = yield* fs
|
||||
.glob("**/favicon.{ico,png,svg,jpg,jpeg,webp}", {
|
||||
.scan("**/favicon.{ico,png,svg,jpg,jpeg,webp}", {
|
||||
cwd: input.worktree,
|
||||
absolute: true,
|
||||
include: "file",
|
||||
|
||||
@@ -186,7 +186,7 @@ export const ExperimentalApi = HttpApi.make("experimental")
|
||||
),
|
||||
HttpApiEndpoint.post("worktreeCreate", ExperimentalPaths.worktree, {
|
||||
disableCodecs: true,
|
||||
query: WorkspaceRoutingQuery,
|
||||
query: WorkspaceRoutingQueryFields,
|
||||
payload: [HttpApiSchema.NoContent, Worktree.CreateInput],
|
||||
success: described(Worktree.Info, "Worktree created"),
|
||||
error: WorktreeApiError,
|
||||
|
||||
@@ -138,7 +138,7 @@ const layer: Layer.Layer<
|
||||
const instruction = raw.startsWith("~/") ? path.join(global.home, raw.slice(2)) : raw
|
||||
const matches = yield* (
|
||||
path.isAbsolute(instruction)
|
||||
? fs.glob(path.basename(instruction), {
|
||||
? fs.scan(path.basename(instruction), {
|
||||
cwd: path.dirname(instruction),
|
||||
absolute: true,
|
||||
include: "file",
|
||||
|
||||
@@ -25,7 +25,7 @@ import { Auth } from "@/auth"
|
||||
import { EffectBridge } from "@/effect/bridge"
|
||||
import { RuntimeFlags } from "@/effect/runtime-flags"
|
||||
import * as Option from "effect/Option"
|
||||
import * as OtelTracer from "@effect/opentelemetry/Tracer"
|
||||
import * as OtelTracer from "@effect/opentelemetry/OtelTracer"
|
||||
import { LLMAISDK } from "./llm/ai-sdk"
|
||||
import { LLMNativeRuntime } from "./llm/native-runtime"
|
||||
import { LLMRequestPrep } from "./llm/request"
|
||||
|
||||
@@ -82,7 +82,7 @@ const MIGRATIONS: Migration[] = [
|
||||
Effect.fn("Storage.migration.1")(function* (dir: string, fs: FSUtil.Interface, git: Git.Interface) {
|
||||
const project = path.resolve(dir, "../project")
|
||||
if (!(yield* fs.isDir(project))) return
|
||||
const projectDirs = yield* fs.glob("*", {
|
||||
const projectDirs = yield* fs.scan("*", {
|
||||
cwd: project,
|
||||
include: "all",
|
||||
})
|
||||
@@ -94,7 +94,7 @@ const MIGRATIONS: Migration[] = [
|
||||
let worktree = "/"
|
||||
|
||||
if (projectID !== "global") {
|
||||
for (const msgFile of yield* fs.glob("storage/session/message/*/*.json", {
|
||||
for (const msgFile of yield* fs.scan("storage/session/message/*/*.json", {
|
||||
cwd: full,
|
||||
absolute: true,
|
||||
})) {
|
||||
@@ -136,7 +136,7 @@ const MIGRATIONS: Migration[] = [
|
||||
)
|
||||
|
||||
yield* Effect.logInfo(`migrating sessions for project ${projectID}`)
|
||||
for (const sessionFile of yield* fs.glob("storage/session/info/*.json", {
|
||||
for (const sessionFile of yield* fs.scan("storage/session/info/*.json", {
|
||||
cwd: full,
|
||||
absolute: true,
|
||||
})) {
|
||||
@@ -147,7 +147,7 @@ const MIGRATIONS: Migration[] = [
|
||||
yield* fs.writeWithDirs(dest, JSON.stringify(session, null, 2))
|
||||
if (Option.isNone(info)) continue
|
||||
yield* Effect.logInfo(`migrating messages for session ${info.value.id}`)
|
||||
for (const msgFile of yield* fs.glob(`storage/session/message/${info.value.id}/*.json`, {
|
||||
for (const msgFile of yield* fs.scan(`storage/session/message/${info.value.id}/*.json`, {
|
||||
cwd: full,
|
||||
absolute: true,
|
||||
})) {
|
||||
@@ -162,7 +162,7 @@ const MIGRATIONS: Migration[] = [
|
||||
if (Option.isNone(item)) continue
|
||||
|
||||
yield* Effect.logInfo(`migrating parts for message ${item.value.id}`)
|
||||
for (const partFile of yield* fs.glob(`storage/session/part/${info.value.id}/${item.value.id}/*.json`, {
|
||||
for (const partFile of yield* fs.scan(`storage/session/part/${info.value.id}/${item.value.id}/*.json`, {
|
||||
cwd: full,
|
||||
absolute: true,
|
||||
})) {
|
||||
@@ -180,7 +180,7 @@ const MIGRATIONS: Migration[] = [
|
||||
}
|
||||
}),
|
||||
Effect.fn("Storage.migration.2")(function* (dir: string, fs: FSUtil.Interface) {
|
||||
for (const item of yield* fs.glob("session/*/*.json", {
|
||||
for (const item of yield* fs.scan("session/*/*.json", {
|
||||
cwd: dir,
|
||||
absolute: true,
|
||||
})) {
|
||||
@@ -302,7 +302,7 @@ const layer = Layer.effect(
|
||||
const dir = (yield* state).dir
|
||||
const cwd = path.join(dir, ...prefix)
|
||||
const result = yield* fs
|
||||
.glob("**/*", {
|
||||
.scan("**/*", {
|
||||
cwd,
|
||||
include: "file",
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user