Drop unused domain Zod statics (#26927)

This commit is contained in:
Kit Langton
2026-05-11 16:10:58 -04:00
committed by GitHub
parent 0bced8ec96
commit 45adfedd64
7 changed files with 16 additions and 41 deletions
+2 -5
View File
@@ -24,8 +24,7 @@ import { Effect, Context, Layer, Schema } from "effect"
import { InstanceState } from "@/effect/instance-state" import { InstanceState } from "@/effect/instance-state"
import * as Option from "effect/Option" import * as Option from "effect/Option"
import * as OtelTracer from "@effect/opentelemetry/Tracer" import * as OtelTracer from "@effect/opentelemetry/Tracer"
import { zod } from "@opencode-ai/core/effect-zod" import { type DeepMutable } from "@opencode-ai/core/schema"
import { withStatics, type DeepMutable } from "@opencode-ai/core/schema"
export const Info = Schema.Struct({ export const Info = Schema.Struct({
name: Schema.String, name: Schema.String,
@@ -47,9 +46,7 @@ export const Info = Schema.Struct({
prompt: Schema.optional(Schema.String), prompt: Schema.optional(Schema.String),
options: Schema.Record(Schema.String, Schema.Unknown), options: Schema.Record(Schema.String, Schema.Unknown),
steps: Schema.optional(Schema.Finite), steps: Schema.optional(Schema.Finite),
}) }).annotate({ identifier: "Agent" })
.annotate({ identifier: "Agent" })
.pipe(withStatics((s) => ({ zod: zod(s) })))
export type Info = DeepMutable<Schema.Schema.Type<typeof Info>> export type Info = DeepMutable<Schema.Schema.Type<typeof Info>>
export interface Interface { export interface Interface {
+4 -11
View File
@@ -14,17 +14,14 @@ import { containsPath } from "../project/instance-context"
import * as Log from "@opencode-ai/core/util/log" import * as Log from "@opencode-ai/core/util/log"
import { Protected } from "./protected" import { Protected } from "./protected"
import { Ripgrep } from "./ripgrep" import { Ripgrep } from "./ripgrep"
import { zod } from "@opencode-ai/core/effect-zod" import { NonNegativeInt, type DeepMutable } from "@opencode-ai/core/schema"
import { NonNegativeInt, type DeepMutable, withStatics } from "@opencode-ai/core/schema"
export const Info = Schema.Struct({ export const Info = Schema.Struct({
path: Schema.String, path: Schema.String,
added: NonNegativeInt, added: NonNegativeInt,
removed: NonNegativeInt, removed: NonNegativeInt,
status: Schema.Literals(["added", "deleted", "modified"]), status: Schema.Literals(["added", "deleted", "modified"]),
}) }).annotate({ identifier: "File" })
.annotate({ identifier: "File" })
.pipe(withStatics((s) => ({ zod: zod(s) })))
export type Info = DeepMutable<Schema.Schema.Type<typeof Info>> export type Info = DeepMutable<Schema.Schema.Type<typeof Info>>
export const Node = Schema.Struct({ export const Node = Schema.Struct({
@@ -33,9 +30,7 @@ export const Node = Schema.Struct({
absolute: Schema.String, absolute: Schema.String,
type: Schema.Literals(["file", "directory"]), type: Schema.Literals(["file", "directory"]),
ignored: Schema.Boolean, ignored: Schema.Boolean,
}) }).annotate({ identifier: "FileNode" })
.annotate({ identifier: "FileNode" })
.pipe(withStatics((s) => ({ zod: zod(s) })))
export type Node = DeepMutable<Schema.Schema.Type<typeof Node>> export type Node = DeepMutable<Schema.Schema.Type<typeof Node>>
const Hunk = Schema.Struct({ const Hunk = Schema.Struct({
@@ -62,9 +57,7 @@ export const Content = Schema.Struct({
patch: Schema.optional(Patch), patch: Schema.optional(Patch),
encoding: Schema.optional(Schema.Literal("base64")), encoding: Schema.optional(Schema.Literal("base64")),
mimeType: Schema.optional(Schema.String), mimeType: Schema.optional(Schema.String),
}) }).annotate({ identifier: "FileContent" })
.annotate({ identifier: "FileContent" })
.pipe(withStatics((s) => ({ zod: zod(s) })))
export type Content = DeepMutable<Schema.Schema.Type<typeof Content>> export type Content = DeepMutable<Schema.Schema.Type<typeof Content>>
export const Event = { export const Event = {
+2 -3
View File
@@ -11,8 +11,7 @@ import { Global } from "@opencode-ai/core/global"
import * as Log from "@opencode-ai/core/util/log" import * as Log from "@opencode-ai/core/util/log"
import { sanitizedProcessEnv } from "@opencode-ai/core/util/opencode-process" import { sanitizedProcessEnv } from "@opencode-ai/core/util/opencode-process"
import { which } from "@/util/which" import { which } from "@/util/which"
import { zod } from "@opencode-ai/core/effect-zod" import { NonNegativeInt } from "@opencode-ai/core/schema"
import { NonNegativeInt, withStatics } from "@opencode-ai/core/schema"
const log = Log.create({ service: "ripgrep" }) const log = Log.create({ service: "ripgrep" })
const VERSION = "15.1.0" const VERSION = "15.1.0"
@@ -69,7 +68,7 @@ export const SearchMatch = Schema.Struct({
end: NonNegativeInt, end: NonNegativeInt,
}), }),
), ),
}).pipe(withStatics((s) => ({ zod: zod(s) }))) })
export const Match = Schema.Struct({ export const Match = Schema.Struct({
type: Schema.Literal("match"), type: Schema.Literal("match"),
+1 -5
View File
@@ -7,8 +7,6 @@ import { mergeDeep } from "remeda"
import { Config } from "@/config/config" import { Config } from "@/config/config"
import * as Log from "@opencode-ai/core/util/log" import * as Log from "@opencode-ai/core/util/log"
import * as Formatter from "./formatter" import * as Formatter from "./formatter"
import { zod } from "@opencode-ai/core/effect-zod"
import { withStatics } from "@opencode-ai/core/schema"
const log = Log.create({ service: "format" }) const log = Log.create({ service: "format" })
@@ -16,9 +14,7 @@ export const Status = Schema.Struct({
name: Schema.String, name: Schema.String,
extensions: Schema.Array(Schema.String), extensions: Schema.Array(Schema.String),
enabled: Schema.Boolean, enabled: Schema.Boolean,
}) }).annotate({ identifier: "FormatterStatus" })
.annotate({ identifier: "FormatterStatus" })
.pipe(withStatics((s) => ({ zod: zod(s) })))
export type Status = Schema.Schema.Type<typeof Status> export type Status = Schema.Schema.Type<typeof Status>
export interface Interface { export interface Interface {
+4 -7
View File
@@ -10,8 +10,7 @@ import type { Proc } from "#pty"
import * as Log from "@opencode-ai/core/util/log" import * as Log from "@opencode-ai/core/util/log"
import { PtyID } from "./schema" import { PtyID } from "./schema"
import { Effect, Layer, Context, Schema, Types } from "effect" import { Effect, Layer, Context, Schema, Types } from "effect"
import { zod } from "@opencode-ai/core/effect-zod" import { NonNegativeInt, PositiveInt } from "@opencode-ai/core/schema"
import { NonNegativeInt, PositiveInt, withStatics } from "@opencode-ai/core/schema"
const log = Log.create({ service: "pty" }) const log = Log.create({ service: "pty" })
@@ -62,9 +61,7 @@ export const Info = Schema.Struct({
cwd: Schema.String, cwd: Schema.String,
status: Schema.Literals(["running", "exited"]), status: Schema.Literals(["running", "exited"]),
pid: PositiveInt, pid: PositiveInt,
}) }).annotate({ identifier: "Pty" })
.annotate({ identifier: "Pty" })
.pipe(withStatics((s) => ({ zod: zod(s) })))
export type Info = Types.DeepMutable<Schema.Schema.Type<typeof Info>> export type Info = Types.DeepMutable<Schema.Schema.Type<typeof Info>>
@@ -74,7 +71,7 @@ export const CreateInput = Schema.Struct({
cwd: Schema.optional(Schema.String), cwd: Schema.optional(Schema.String),
title: Schema.optional(Schema.String), title: Schema.optional(Schema.String),
env: Schema.optional(Schema.Record(Schema.String, Schema.String)), env: Schema.optional(Schema.Record(Schema.String, Schema.String)),
}).pipe(withStatics((s) => ({ zod: zod(s) }))) })
export type CreateInput = Types.DeepMutable<Schema.Schema.Type<typeof CreateInput>> export type CreateInput = Types.DeepMutable<Schema.Schema.Type<typeof CreateInput>>
@@ -86,7 +83,7 @@ export const UpdateInput = Schema.Struct({
cols: PositiveInt, cols: PositiveInt,
}), }),
), ),
}).pipe(withStatics((s) => ({ zod: zod(s) }))) })
export type UpdateInput = Types.DeepMutable<Schema.Schema.Type<typeof UpdateInput>> export type UpdateInput = Types.DeepMutable<Schema.Schema.Type<typeof UpdateInput>>
+1 -3
View File
@@ -2,8 +2,6 @@ import path from "path"
import { pathToFileURL } from "url" import { pathToFileURL } from "url"
import z from "zod" import z from "zod"
import { Effect, Layer, Context, Schema } from "effect" import { Effect, Layer, Context, Schema } from "effect"
import { zod } from "@opencode-ai/core/effect-zod"
import { withStatics } from "@opencode-ai/core/schema"
import { NamedError } from "@opencode-ai/core/util/error" import { NamedError } from "@opencode-ai/core/util/error"
import type { Agent } from "@/agent/agent" import type { Agent } from "@/agent/agent"
import { Bus } from "@/bus" import { Bus } from "@/bus"
@@ -40,7 +38,7 @@ export const Info = Schema.Struct({
description: Schema.optional(Schema.String), description: Schema.optional(Schema.String),
location: Schema.String, location: Schema.String,
content: Schema.String, content: Schema.String,
}).pipe(withStatics((s) => ({ zod: zod(s) }))) })
export type Info = Schema.Schema.Type<typeof Info> export type Info = Schema.Schema.Type<typeof Info>
export const InvalidError = NamedError.create( export const InvalidError = NamedError.create(
+2 -7
View File
@@ -2,7 +2,6 @@ import { Cause, Duration, Effect, Layer, Schedule, Schema, Semaphore, Context, S
import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process" import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"
import { formatPatch, structuredPatch } from "diff" import { formatPatch, structuredPatch } from "diff"
import path from "path" import path from "path"
import z from "zod"
import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner"
import { InstanceState } from "@/effect/instance-state" import { InstanceState } from "@/effect/instance-state"
import { AppFileSystem } from "@opencode-ai/core/filesystem" import { AppFileSystem } from "@opencode-ai/core/filesystem"
@@ -10,13 +9,11 @@ import { Hash } from "@opencode-ai/core/util/hash"
import { Config } from "@/config/config" import { Config } from "@/config/config"
import { Global } from "@opencode-ai/core/global" import { Global } from "@opencode-ai/core/global"
import * as Log from "@opencode-ai/core/util/log" import * as Log from "@opencode-ai/core/util/log"
import { NonNegativeInt, withStatics } from "@opencode-ai/core/schema"
import { zod } from "@opencode-ai/core/effect-zod"
export const Patch = Schema.Struct({ export const Patch = Schema.Struct({
hash: Schema.String, hash: Schema.String,
files: Schema.mutable(Schema.Array(Schema.String)), files: Schema.mutable(Schema.Array(Schema.String)),
}).pipe(withStatics((s) => ({ zod: zod(s) }))) })
export type Patch = typeof Patch.Type export type Patch = typeof Patch.Type
export const FileDiff = Schema.Struct({ export const FileDiff = Schema.Struct({
@@ -28,9 +25,7 @@ export const FileDiff = Schema.Struct({
additions: Schema.Finite, additions: Schema.Finite,
deletions: Schema.Finite, deletions: Schema.Finite,
status: Schema.optional(Schema.Literals(["added", "deleted", "modified"])), status: Schema.optional(Schema.Literals(["added", "deleted", "modified"])),
}) }).annotate({ identifier: "SnapshotFileDiff" })
.annotate({ identifier: "SnapshotFileDiff" })
.pipe(withStatics((s) => ({ zod: zod(s) })))
export type FileDiff = typeof FileDiff.Type export type FileDiff = typeof FileDiff.Type
const log = Log.create({ service: "snapshot" }) const log = Log.create({ service: "snapshot" })