فهرست منبع

Move schema utilities into core (#26565)

Dax 4 ماه پیش
والد
کامیت
dcdbdb218f
73فایلهای تغییر یافته به همراه125 افزوده شده و 125 حذف شده
  1. 0 0
      packages/core/src/effect-zod.ts
  2. 0 0
      packages/core/src/schema.ts
  3. 2 2
      packages/opencode/specs/effect/migration.md
  4. 3 3
      packages/opencode/specs/effect/schema.md
  5. 2 2
      packages/opencode/src/agent/agent.ts
  6. 2 2
      packages/opencode/src/auth/index.ts
  7. 1 1
      packages/opencode/src/cli/cmd/tui/event.ts
  8. 2 2
      packages/opencode/src/command/index.ts
  9. 2 2
      packages/opencode/src/config/agent.ts
  10. 2 2
      packages/opencode/src/config/command.ts
  11. 3 3
      packages/opencode/src/config/config.ts
  12. 2 2
      packages/opencode/src/config/console-state.ts
  13. 2 2
      packages/opencode/src/config/formatter.ts
  14. 2 2
      packages/opencode/src/config/layout.ts
  15. 2 2
      packages/opencode/src/config/lsp.ts
  16. 2 2
      packages/opencode/src/config/mcp.ts
  17. 2 2
      packages/opencode/src/config/model-id.ts
  18. 1 1
      packages/opencode/src/config/parse.ts
  19. 2 2
      packages/opencode/src/config/permission.ts
  20. 2 2
      packages/opencode/src/config/plugin.ts
  21. 2 2
      packages/opencode/src/config/provider.ts
  22. 2 2
      packages/opencode/src/config/reference.ts
  23. 2 2
      packages/opencode/src/config/server.ts
  24. 2 2
      packages/opencode/src/config/skills.ts
  25. 2 2
      packages/opencode/src/control-plane/schema.ts
  26. 1 1
      packages/opencode/src/control-plane/types.ts
  27. 2 2
      packages/opencode/src/file/index.ts
  28. 2 2
      packages/opencode/src/file/ripgrep.ts
  29. 2 2
      packages/opencode/src/format/index.ts
  30. 2 2
      packages/opencode/src/lsp/lsp.ts
  31. 2 2
      packages/opencode/src/mcp/index.ts
  32. 2 2
      packages/opencode/src/permission/index.ts
  33. 2 2
      packages/opencode/src/permission/schema.ts
  34. 2 2
      packages/opencode/src/project/project.ts
  35. 2 2
      packages/opencode/src/project/schema.ts
  36. 2 2
      packages/opencode/src/project/vcs.ts
  37. 2 2
      packages/opencode/src/provider/auth.ts
  38. 2 2
      packages/opencode/src/provider/provider.ts
  39. 2 2
      packages/opencode/src/provider/schema.ts
  40. 2 2
      packages/opencode/src/pty/index.ts
  41. 2 2
      packages/opencode/src/pty/schema.ts
  42. 1 1
      packages/opencode/src/pty/ticket.ts
  43. 2 2
      packages/opencode/src/question/index.ts
  44. 2 2
      packages/opencode/src/question/schema.ts
  45. 1 1
      packages/opencode/src/server/routes/instance/httpapi/groups/experimental.ts
  46. 1 1
      packages/opencode/src/server/routes/instance/httpapi/groups/sync.ts
  47. 1 1
      packages/opencode/src/server/routes/instance/httpapi/handlers/experimental.ts
  48. 2 2
      packages/opencode/src/session/message-v2.ts
  49. 2 2
      packages/opencode/src/session/message.ts
  50. 3 3
      packages/opencode/src/session/prompt.ts
  51. 2 2
      packages/opencode/src/session/revert.ts
  52. 2 2
      packages/opencode/src/session/schema.ts
  53. 2 2
      packages/opencode/src/session/session.ts
  54. 2 2
      packages/opencode/src/session/status.ts
  55. 2 2
      packages/opencode/src/session/summary.ts
  56. 2 2
      packages/opencode/src/session/todo.ts
  57. 2 2
      packages/opencode/src/skill/index.ts
  58. 2 2
      packages/opencode/src/snapshot/index.ts
  59. 1 1
      packages/opencode/src/storage/storage.ts
  60. 1 1
      packages/opencode/src/sync/index.ts
  61. 2 2
      packages/opencode/src/sync/schema.ts
  62. 1 1
      packages/opencode/src/tool/read.ts
  63. 1 1
      packages/opencode/src/tool/registry.ts
  64. 2 2
      packages/opencode/src/tool/schema.ts
  65. 1 1
      packages/opencode/src/tool/shell/prompt.ts
  66. 1 1
      packages/opencode/src/util/named-schema-error.ts
  67. 1 1
      packages/opencode/src/v2/auth.ts
  68. 1 1
      packages/opencode/src/v2/event.ts
  69. 1 1
      packages/opencode/src/v2/model.ts
  70. 1 1
      packages/opencode/src/v2/session-event.ts
  71. 1 1
      packages/opencode/src/v2/session.ts
  72. 1 1
      packages/opencode/test/tool/parameters.test.ts
  73. 1 1
      packages/opencode/test/util/effect-zod.test.ts

+ 0 - 0
packages/opencode/src/util/effect-zod.ts → packages/core/src/effect-zod.ts


+ 0 - 0
packages/opencode/src/util/schema.ts → packages/core/src/schema.ts


+ 2 - 2
packages/opencode/specs/effect/migration.md

@@ -59,10 +59,10 @@ Rules:
 
 
 ## Schema → Zod interop
 ## Schema → Zod interop
 
 
-When a service uses Effect Schema internally but needs Zod schemas for the HTTP layer, derive Zod from Schema using the `zod()` helper from `@/util/effect-zod`:
+When a service uses Effect Schema internally but needs Zod schemas for the HTTP layer, derive Zod from Schema using the `zod()` helper from `@opencode-ai/core/effect-zod`:
 
 
 ```ts
 ```ts
-import { zod } from "@/util/effect-zod"
+import { zod } from "@opencode-ai/core/effect-zod"
 
 
 export const ZodInfo = zod(Info) // derives z.ZodType from Schema.Union
 export const ZodInfo = zod(Info) // derives z.ZodType from Schema.Union
 ```
 ```

+ 3 - 3
packages/opencode/specs/effect/schema.md

@@ -8,7 +8,7 @@ Zod-first definitions to Effect Schema with Zod compatibility shims.
 Use Effect Schema as the source of truth for domain models, IDs, inputs,
 Use Effect Schema as the source of truth for domain models, IDs, inputs,
 outputs, and typed errors. Keep Zod available at existing HTTP, tool, and
 outputs, and typed errors. Keep Zod available at existing HTTP, tool, and
 compatibility boundaries by exposing a `.zod` static derived from the Effect
 compatibility boundaries by exposing a `.zod` static derived from the Effect
-schema via `@/util/effect-zod`.
+schema via `@opencode-ai/core/effect-zod`.
 
 
 The long-term driver is `specs/effect/http-api.md` — once the HTTP server
 The long-term driver is `specs/effect/http-api.md` — once the HTTP server
 moves to `@effect/platform`, every Schema-first DTO can flow through
 moves to `@effect/platform`, every Schema-first DTO can flow through
@@ -97,7 +97,7 @@ creating a parallel schema source of truth.
 
 
 ## Escape hatches
 ## Escape hatches
 
 
-The walker in `@/util/effect-zod` exposes two explicit escape hatches for
+The walker in `@opencode-ai/core/effect-zod` exposes two explicit escape hatches for
 cases the pure-Schema path cannot express. Each one stays in the codebase
 cases the pure-Schema path cannot express. Each one stays in the codebase
 only as long as its upstream or local dependency requires it — inline
 only as long as its upstream or local dependency requires it — inline
 comments document when each can be deleted.
 comments document when each can be deleted.
@@ -389,7 +389,7 @@ piecewise.
 
 
 ## Notes
 ## Notes
 
 
-- Use `@/util/effect-zod` for all Schema → Zod conversion.
+- Use `@opencode-ai/core/effect-zod` for all Schema → Zod conversion.
 - Prefer one canonical schema definition. Avoid maintaining parallel Zod and
 - Prefer one canonical schema definition. Avoid maintaining parallel Zod and
   Effect definitions for the same domain type.
   Effect definitions for the same domain type.
 - Keep the migration incremental. Converting the domain model first is more
 - Keep the migration incremental. Converting the domain model first is more

+ 2 - 2
packages/opencode/src/agent/agent.ts

@@ -24,8 +24,8 @@ 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 "@/util/effect-zod"
-import { withStatics, type DeepMutable } from "@/util/schema"
+import { zod } from "@opencode-ai/core/effect-zod"
+import { withStatics, type DeepMutable } from "@opencode-ai/core/schema"
 
 
 type ReferenceEntry = NonNullable<Config.Info["reference"]>[string]
 type ReferenceEntry = NonNullable<Config.Info["reference"]>[string]
 type ResolvedReference = { kind: "git"; repository: string; branch?: string } | { kind: "local"; path: string }
 type ResolvedReference = { kind: "git"; repository: string; branch?: string } | { kind: "local"; path: string }

+ 2 - 2
packages/opencode/src/auth/index.ts

@@ -1,7 +1,7 @@
 import path from "path"
 import path from "path"
 import { Effect, Layer, Record, Result, Schema, Context } from "effect"
 import { Effect, Layer, Record, Result, Schema, Context } from "effect"
-import { zod } from "@/util/effect-zod"
-import { NonNegativeInt } from "@/util/schema"
+import { zod } from "@opencode-ai/core/effect-zod"
+import { NonNegativeInt } from "@opencode-ai/core/schema"
 import { Global } from "@opencode-ai/core/global"
 import { Global } from "@opencode-ai/core/global"
 import { AppFileSystem } from "@opencode-ai/core/filesystem"
 import { AppFileSystem } from "@opencode-ai/core/filesystem"
 
 

+ 1 - 1
packages/opencode/src/cli/cmd/tui/event.ts

@@ -1,6 +1,6 @@
 import { BusEvent } from "@/bus/bus-event"
 import { BusEvent } from "@/bus/bus-event"
 import { SessionID } from "@/session/schema"
 import { SessionID } from "@/session/schema"
-import { PositiveInt } from "@/util/schema"
+import { PositiveInt } from "@opencode-ai/core/schema"
 import { Effect, Schema } from "effect"
 import { Effect, Schema } from "effect"
 
 
 const DEFAULT_TOAST_DURATION = 5000
 const DEFAULT_TOAST_DURATION = 5000

+ 2 - 2
packages/opencode/src/command/index.ts

@@ -5,8 +5,8 @@ import type { InstanceContext } from "@/project/instance"
 import { SessionID, MessageID } from "@/session/schema"
 import { SessionID, MessageID } from "@/session/schema"
 import { Effect, Layer, Context, Schema } from "effect"
 import { Effect, Layer, Context, Schema } from "effect"
 import z from "zod"
 import z from "zod"
-import { zod, ZodOverride } from "@/util/effect-zod"
-import { withStatics } from "@/util/schema"
+import { zod, ZodOverride } from "@opencode-ai/core/effect-zod"
+import { withStatics } from "@opencode-ai/core/schema"
 import { Config } from "@/config/config"
 import { Config } from "@/config/config"
 import { MCP } from "../mcp"
 import { MCP } from "../mcp"
 import { Skill } from "../skill"
 import { Skill } from "../skill"

+ 2 - 2
packages/opencode/src/config/agent.ts

@@ -2,8 +2,8 @@ export * as ConfigAgent from "./agent"
 
 
 import { Exit, Schema, SchemaGetter } from "effect"
 import { Exit, Schema, SchemaGetter } from "effect"
 import { Bus } from "@/bus"
 import { Bus } from "@/bus"
-import { zod } from "@/util/effect-zod"
-import { PositiveInt, withStatics } from "@/util/schema"
+import { zod } from "@opencode-ai/core/effect-zod"
+import { PositiveInt, withStatics } from "@opencode-ai/core/schema"
 import * as Log from "@opencode-ai/core/util/log"
 import * as Log from "@opencode-ai/core/util/log"
 import { NamedError } from "@opencode-ai/core/util/error"
 import { NamedError } from "@opencode-ai/core/util/error"
 import { Glob } from "@opencode-ai/core/util/glob"
 import { Glob } from "@opencode-ai/core/util/glob"

+ 2 - 2
packages/opencode/src/config/command.ts

@@ -5,8 +5,8 @@ import { Schema } from "effect"
 import { NamedError } from "@opencode-ai/core/util/error"
 import { NamedError } from "@opencode-ai/core/util/error"
 import { Glob } from "@opencode-ai/core/util/glob"
 import { Glob } from "@opencode-ai/core/util/glob"
 import { Bus } from "@/bus"
 import { Bus } from "@/bus"
-import { zod } from "@/util/effect-zod"
-import { withStatics } from "@/util/schema"
+import { zod } from "@opencode-ai/core/effect-zod"
+import { withStatics } from "@opencode-ai/core/schema"
 import { configEntryNameFromPath } from "./entry-name"
 import { configEntryNameFromPath } from "./entry-name"
 import { InvalidError } from "./error"
 import { InvalidError } from "./error"
 import * as ConfigMarkdown from "./markdown"
 import * as ConfigMarkdown from "./markdown"

+ 3 - 3
packages/opencode/src/config/config.ts

@@ -22,8 +22,8 @@ import { InstanceState } from "@/effect/instance-state"
 import { Context, Duration, Effect, Exit, Fiber, Layer, Option, Schema } from "effect"
 import { Context, Duration, Effect, Exit, Fiber, Layer, Option, Schema } from "effect"
 import { EffectFlock } from "@opencode-ai/core/util/effect-flock"
 import { EffectFlock } from "@opencode-ai/core/util/effect-flock"
 import { containsPath } from "../project/instance-context"
 import { containsPath } from "../project/instance-context"
-import { zod } from "@/util/effect-zod"
-import { NonNegativeInt, PositiveInt, withStatics, type DeepMutable } from "@/util/schema"
+import { zod } from "@opencode-ai/core/effect-zod"
+import { NonNegativeInt, PositiveInt, withStatics, type DeepMutable } from "@opencode-ai/core/schema"
 import { ConfigAgent } from "./agent"
 import { ConfigAgent } from "./agent"
 import { ConfigCommand } from "./command"
 import { ConfigCommand } from "./command"
 import { ConfigFormatter } from "./formatter"
 import { ConfigFormatter } from "./formatter"
@@ -307,7 +307,7 @@ export const Info = Schema.Struct({
     })),
     })),
   )
   )
 
 
-// Uses the shared `DeepMutable` from `@/util/schema`. See the definition
+// Uses the shared `DeepMutable` from `@opencode-ai/core/schema`. See the definition
 // there for why the local variant is needed over `Types.DeepMutable` from
 // there for why the local variant is needed over `Types.DeepMutable` from
 // effect-smol (the upstream version collapses `unknown` to `{}`).
 // effect-smol (the upstream version collapses `unknown` to `{}`).
 export type Info = DeepMutable<Schema.Schema.Type<typeof Info>> & {
 export type Info = DeepMutable<Schema.Schema.Type<typeof Info>> & {

+ 2 - 2
packages/opencode/src/config/console-state.ts

@@ -1,6 +1,6 @@
 import { Schema } from "effect"
 import { Schema } from "effect"
-import { zod } from "@/util/effect-zod"
-import { NonNegativeInt } from "@/util/schema"
+import { zod } from "@opencode-ai/core/effect-zod"
+import { NonNegativeInt } from "@opencode-ai/core/schema"
 
 
 export class ConsoleState extends Schema.Class<ConsoleState>("ConsoleState")({
 export class ConsoleState extends Schema.Class<ConsoleState>("ConsoleState")({
   consoleManagedProviders: Schema.mutable(Schema.Array(Schema.String)),
   consoleManagedProviders: Schema.mutable(Schema.Array(Schema.String)),

+ 2 - 2
packages/opencode/src/config/formatter.ts

@@ -1,8 +1,8 @@
 export * as ConfigFormatter from "./formatter"
 export * as ConfigFormatter from "./formatter"
 
 
 import { Schema } from "effect"
 import { Schema } from "effect"
-import { zod } from "@/util/effect-zod"
-import { withStatics } from "@/util/schema"
+import { zod } from "@opencode-ai/core/effect-zod"
+import { withStatics } from "@opencode-ai/core/schema"
 
 
 export const Entry = Schema.Struct({
 export const Entry = Schema.Struct({
   disabled: Schema.optional(Schema.Boolean),
   disabled: Schema.optional(Schema.Boolean),

+ 2 - 2
packages/opencode/src/config/layout.ts

@@ -1,6 +1,6 @@
 import { Schema } from "effect"
 import { Schema } from "effect"
-import { zod } from "@/util/effect-zod"
-import { withStatics } from "@/util/schema"
+import { zod } from "@opencode-ai/core/effect-zod"
+import { withStatics } from "@opencode-ai/core/schema"
 
 
 export const Layout = Schema.Literals(["auto", "stretch"])
 export const Layout = Schema.Literals(["auto", "stretch"])
   .annotate({ identifier: "LayoutConfig" })
   .annotate({ identifier: "LayoutConfig" })

+ 2 - 2
packages/opencode/src/config/lsp.ts

@@ -1,8 +1,8 @@
 export * as ConfigLSP from "./lsp"
 export * as ConfigLSP from "./lsp"
 
 
 import { Schema } from "effect"
 import { Schema } from "effect"
-import { zod } from "@/util/effect-zod"
-import { withStatics } from "@/util/schema"
+import { zod } from "@opencode-ai/core/effect-zod"
+import { withStatics } from "@opencode-ai/core/schema"
 import * as LSPServer from "../lsp/server"
 import * as LSPServer from "../lsp/server"
 
 
 export const Disabled = Schema.Struct({
 export const Disabled = Schema.Struct({

+ 2 - 2
packages/opencode/src/config/mcp.ts

@@ -1,6 +1,6 @@
 import { Schema } from "effect"
 import { Schema } from "effect"
-import { zod } from "@/util/effect-zod"
-import { PositiveInt, withStatics } from "@/util/schema"
+import { zod } from "@opencode-ai/core/effect-zod"
+import { PositiveInt, withStatics } from "@opencode-ai/core/schema"
 
 
 export const Local = Schema.Struct({
 export const Local = Schema.Struct({
   type: Schema.Literal("local").annotate({ description: "Type of MCP server connection" }),
   type: Schema.Literal("local").annotate({ description: "Type of MCP server connection" }),

+ 2 - 2
packages/opencode/src/config/model-id.ts

@@ -1,7 +1,7 @@
 import { Schema } from "effect"
 import { Schema } from "effect"
 import z from "zod"
 import z from "zod"
-import { zod, ZodOverride } from "@/util/effect-zod"
-import { withStatics } from "@/util/schema"
+import { zod, ZodOverride } from "@opencode-ai/core/effect-zod"
+import { withStatics } from "@opencode-ai/core/schema"
 
 
 // The original Zod schema carried an external $ref pointing at the models.dev
 // The original Zod schema carried an external $ref pointing at the models.dev
 // JSON schema. That external reference is not a named SDK component — it is a
 // JSON schema. That external reference is not a named SDK component — it is a

+ 1 - 1
packages/opencode/src/config/parse.ts

@@ -3,7 +3,7 @@ export * as ConfigParse from "./parse"
 import { type ParseError as JsoncParseError, parse as parseJsoncImpl, printParseErrorCode } from "jsonc-parser"
 import { type ParseError as JsoncParseError, parse as parseJsoncImpl, printParseErrorCode } from "jsonc-parser"
 import { Cause, Exit, Schema as EffectSchema, SchemaIssue } from "effect"
 import { Cause, Exit, Schema as EffectSchema, SchemaIssue } from "effect"
 import z from "zod"
 import z from "zod"
-import type { DeepMutable } from "@/util/schema"
+import type { DeepMutable } from "@opencode-ai/core/schema"
 import { InvalidError, JsonError } from "./error"
 import { InvalidError, JsonError } from "./error"
 
 
 type ZodSchema<T> = z.ZodType<T>
 type ZodSchema<T> = z.ZodType<T>

+ 2 - 2
packages/opencode/src/config/permission.ts

@@ -1,7 +1,7 @@
 export * as ConfigPermission from "./permission"
 export * as ConfigPermission from "./permission"
 import { Schema, SchemaGetter } from "effect"
 import { Schema, SchemaGetter } from "effect"
-import { zod } from "@/util/effect-zod"
-import { withStatics } from "@/util/schema"
+import { zod } from "@opencode-ai/core/effect-zod"
+import { withStatics } from "@opencode-ai/core/schema"
 
 
 export const Action = Schema.Literals(["ask", "allow", "deny"])
 export const Action = Schema.Literals(["ask", "allow", "deny"])
   .annotate({ identifier: "PermissionActionConfig" })
   .annotate({ identifier: "PermissionActionConfig" })

+ 2 - 2
packages/opencode/src/config/plugin.ts

@@ -2,8 +2,8 @@ import { Glob } from "@opencode-ai/core/util/glob"
 import { Schema } from "effect"
 import { Schema } from "effect"
 import { pathToFileURL } from "url"
 import { pathToFileURL } from "url"
 import { isPathPluginSpec, parsePluginSpecifier, resolvePathPluginTarget } from "@/plugin/shared"
 import { isPathPluginSpec, parsePluginSpecifier, resolvePathPluginTarget } from "@/plugin/shared"
-import { zod } from "@/util/effect-zod"
-import { withStatics } from "@/util/schema"
+import { zod } from "@opencode-ai/core/effect-zod"
+import { withStatics } from "@opencode-ai/core/schema"
 import path from "path"
 import path from "path"
 
 
 export const Options = Schema.Record(Schema.String, Schema.Unknown).pipe(withStatics((s) => ({ zod: zod(s) })))
 export const Options = Schema.Record(Schema.String, Schema.Unknown).pipe(withStatics((s) => ({ zod: zod(s) })))

+ 2 - 2
packages/opencode/src/config/provider.ts

@@ -1,6 +1,6 @@
 import { Schema } from "effect"
 import { Schema } from "effect"
-import { zod } from "@/util/effect-zod"
-import { PositiveInt, withStatics } from "@/util/schema"
+import { zod } from "@opencode-ai/core/effect-zod"
+import { PositiveInt, withStatics } from "@opencode-ai/core/schema"
 
 
 export const Model = Schema.Struct({
 export const Model = Schema.Struct({
   id: Schema.optional(Schema.String),
   id: Schema.optional(Schema.String),

+ 2 - 2
packages/opencode/src/config/reference.ts

@@ -1,8 +1,8 @@
 export * as ConfigReference from "./reference"
 export * as ConfigReference from "./reference"
 
 
 import { Schema } from "effect"
 import { Schema } from "effect"
-import { zod } from "@/util/effect-zod"
-import { withStatics } from "@/util/schema"
+import { zod } from "@opencode-ai/core/effect-zod"
+import { withStatics } from "@opencode-ai/core/schema"
 
 
 const Git = Schema.Struct({
 const Git = Schema.Struct({
   repository: Schema.String.annotate({
   repository: Schema.String.annotate({

+ 2 - 2
packages/opencode/src/config/server.ts

@@ -1,6 +1,6 @@
 import { Schema } from "effect"
 import { Schema } from "effect"
-import { zod } from "@/util/effect-zod"
-import { PositiveInt, withStatics } from "@/util/schema"
+import { zod } from "@opencode-ai/core/effect-zod"
+import { PositiveInt, withStatics } from "@opencode-ai/core/schema"
 
 
 export const Server = Schema.Struct({
 export const Server = Schema.Struct({
   port: Schema.optional(PositiveInt).annotate({
   port: Schema.optional(PositiveInt).annotate({

+ 2 - 2
packages/opencode/src/config/skills.ts

@@ -1,6 +1,6 @@
 import { Schema } from "effect"
 import { Schema } from "effect"
-import { zod } from "@/util/effect-zod"
-import { withStatics } from "@/util/schema"
+import { zod } from "@opencode-ai/core/effect-zod"
+import { withStatics } from "@opencode-ai/core/schema"
 
 
 export const Info = Schema.Struct({
 export const Info = Schema.Struct({
   paths: Schema.optional(Schema.Array(Schema.String)).annotate({
   paths: Schema.optional(Schema.Array(Schema.String)).annotate({

+ 2 - 2
packages/opencode/src/control-plane/schema.ts

@@ -1,8 +1,8 @@
 import { Schema } from "effect"
 import { Schema } from "effect"
 
 
 import { Identifier } from "@/id/id"
 import { Identifier } from "@/id/id"
-import { zod, ZodOverride } from "@/util/effect-zod"
-import { withStatics } from "@/util/schema"
+import { zod, ZodOverride } from "@opencode-ai/core/effect-zod"
+import { withStatics } from "@opencode-ai/core/schema"
 
 
 const workspaceIdSchema = Schema.String.annotate({ [ZodOverride]: Identifier.schema("workspace") }).pipe(
 const workspaceIdSchema = Schema.String.annotate({ [ZodOverride]: Identifier.schema("workspace") }).pipe(
   Schema.brand("WorkspaceID"),
   Schema.brand("WorkspaceID"),

+ 1 - 1
packages/opencode/src/control-plane/types.ts

@@ -1,7 +1,7 @@
 import { Schema, Struct } from "effect"
 import { Schema, Struct } from "effect"
 import { ProjectID } from "@/project/schema"
 import { ProjectID } from "@/project/schema"
 import { WorkspaceID } from "./schema"
 import { WorkspaceID } from "./schema"
-import type { DeepMutable } from "@/util/schema"
+import type { DeepMutable } from "@opencode-ai/core/schema"
 
 
 export const WorkspaceInfo = Schema.Struct({
 export const WorkspaceInfo = Schema.Struct({
   id: WorkspaceID,
   id: WorkspaceID,

+ 2 - 2
packages/opencode/src/file/index.ts

@@ -14,8 +14,8 @@ 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 "@/util/effect-zod"
-import { NonNegativeInt, type DeepMutable, withStatics } from "@/util/schema"
+import { zod } from "@opencode-ai/core/effect-zod"
+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,

+ 2 - 2
packages/opencode/src/file/ripgrep.ts

@@ -11,8 +11,8 @@ 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 "@/util/effect-zod"
-import { NonNegativeInt, withStatics } from "@/util/schema"
+import { zod } from "@opencode-ai/core/effect-zod"
+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"

+ 2 - 2
packages/opencode/src/format/index.ts

@@ -7,8 +7,8 @@ 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 "@/util/effect-zod"
-import { withStatics } from "@/util/schema"
+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" })
 
 

+ 2 - 2
packages/opencode/src/lsp/lsp.ts

@@ -13,8 +13,8 @@ import { spawn as lspspawn } from "./launch"
 import { Effect, Layer, Context, Schema } from "effect"
 import { Effect, Layer, Context, Schema } from "effect"
 import { InstanceState } from "@/effect/instance-state"
 import { InstanceState } from "@/effect/instance-state"
 import { containsPath } from "@/project/instance-context"
 import { containsPath } from "@/project/instance-context"
-import { NonNegativeInt, withStatics } from "@/util/schema"
-import { zod, ZodOverride } from "@/util/effect-zod"
+import { NonNegativeInt, withStatics } from "@opencode-ai/core/schema"
+import { zod, ZodOverride } from "@opencode-ai/core/effect-zod"
 
 
 const log = Log.create({ service: "lsp" })
 const log = Log.create({ service: "lsp" })
 
 

+ 2 - 2
packages/opencode/src/mcp/index.ts

@@ -30,8 +30,8 @@ import { EffectBridge } from "@/effect/bridge"
 import { InstanceState } from "@/effect/instance-state"
 import { InstanceState } from "@/effect/instance-state"
 import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"
 import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"
 import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner"
 import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner"
-import { zod as effectZod } from "@/util/effect-zod"
-import { withStatics } from "@/util/schema"
+import { zod as effectZod } from "@opencode-ai/core/effect-zod"
+import { withStatics } from "@opencode-ai/core/schema"
 
 
 const log = Log.create({ service: "mcp" })
 const log = Log.create({ service: "mcp" })
 const DEFAULT_TIMEOUT = 30_000
 const DEFAULT_TIMEOUT = 30_000

+ 2 - 2
packages/opencode/src/permission/index.ts

@@ -7,9 +7,9 @@ import { MessageID, SessionID } from "@/session/schema"
 import { PermissionTable } from "@/session/session.sql"
 import { PermissionTable } from "@/session/session.sql"
 import { Database } from "@/storage/db"
 import { Database } from "@/storage/db"
 import { eq } from "drizzle-orm"
 import { eq } from "drizzle-orm"
-import { zod } from "@/util/effect-zod"
+import { zod } from "@opencode-ai/core/effect-zod"
 import * as Log from "@opencode-ai/core/util/log"
 import * as Log from "@opencode-ai/core/util/log"
-import { withStatics } from "@/util/schema"
+import { withStatics } from "@opencode-ai/core/schema"
 import { Wildcard } from "@/util/wildcard"
 import { Wildcard } from "@/util/wildcard"
 import { Deferred, Effect, Layer, Schema, Context } from "effect"
 import { Deferred, Effect, Layer, Schema, Context } from "effect"
 import os from "os"
 import os from "os"

+ 2 - 2
packages/opencode/src/permission/schema.ts

@@ -1,8 +1,8 @@
 import { Schema } from "effect"
 import { Schema } from "effect"
 
 
 import { Identifier } from "@/id/id"
 import { Identifier } from "@/id/id"
-import { zod, ZodOverride } from "@/util/effect-zod"
-import { Newtype } from "@/util/schema"
+import { zod, ZodOverride } from "@opencode-ai/core/effect-zod"
+import { Newtype } from "@opencode-ai/core/schema"
 
 
 export class PermissionID extends Newtype<PermissionID>()(
 export class PermissionID extends Newtype<PermissionID>()(
   "PermissionID",
   "PermissionID",

+ 2 - 2
packages/opencode/src/project/project.ts

@@ -18,8 +18,8 @@ import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"
 import { NodePath } from "@effect/platform-node"
 import { NodePath } from "@effect/platform-node"
 import { AppFileSystem } from "@opencode-ai/core/filesystem"
 import { AppFileSystem } from "@opencode-ai/core/filesystem"
 import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner"
 import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner"
-import { zod } from "@/util/effect-zod"
-import { NonNegativeInt, optionalOmitUndefined, withStatics } from "@/util/schema"
+import { zod } from "@opencode-ai/core/effect-zod"
+import { NonNegativeInt, optionalOmitUndefined, withStatics } from "@opencode-ai/core/schema"
 import { serviceUse } from "@/effect/service-use"
 import { serviceUse } from "@/effect/service-use"
 
 
 const log = Log.create({ service: "project" })
 const log = Log.create({ service: "project" })

+ 2 - 2
packages/opencode/src/project/schema.ts

@@ -1,7 +1,7 @@
 import { Schema } from "effect"
 import { Schema } from "effect"
 
 
-import { zod } from "@/util/effect-zod"
-import { withStatics } from "@/util/schema"
+import { zod } from "@opencode-ai/core/effect-zod"
+import { withStatics } from "@opencode-ai/core/schema"
 
 
 const projectIdSchema = Schema.String.pipe(Schema.brand("ProjectID"))
 const projectIdSchema = Schema.String.pipe(Schema.brand("ProjectID"))
 
 

+ 2 - 2
packages/opencode/src/project/vcs.ts

@@ -6,8 +6,8 @@ import { InstanceState } from "@/effect/instance-state"
 import { FileWatcher } from "@/file/watcher"
 import { FileWatcher } from "@/file/watcher"
 import { Git } from "@/git"
 import { Git } from "@/git"
 import * as Log from "@opencode-ai/core/util/log"
 import * as Log from "@opencode-ai/core/util/log"
-import { zod, zodObject } from "@/util/effect-zod"
-import { NonNegativeInt, withStatics } from "@/util/schema"
+import { zod, zodObject } from "@opencode-ai/core/effect-zod"
+import { NonNegativeInt, withStatics } from "@opencode-ai/core/schema"
 
 
 const log = Log.create({ service: "vcs" })
 const log = Log.create({ service: "vcs" })
 const PATCH_CONTEXT_LINES = 2_147_483_647
 const PATCH_CONTEXT_LINES = 2_147_483_647

+ 2 - 2
packages/opencode/src/provider/auth.ts

@@ -1,9 +1,9 @@
 import type { AuthOAuthResult, Hooks } from "@opencode-ai/plugin"
 import type { AuthOAuthResult, Hooks } from "@opencode-ai/plugin"
 import { Auth } from "@/auth"
 import { Auth } from "@/auth"
 import { InstanceState } from "@/effect/instance-state"
 import { InstanceState } from "@/effect/instance-state"
-import { zod } from "@/util/effect-zod"
+import { zod } from "@opencode-ai/core/effect-zod"
 import { namedSchemaError } from "@/util/named-schema-error"
 import { namedSchemaError } from "@/util/named-schema-error"
-import { optionalOmitUndefined, withStatics } from "@/util/schema"
+import { optionalOmitUndefined, withStatics } from "@opencode-ai/core/schema"
 import { Plugin } from "../plugin"
 import { Plugin } from "../plugin"
 import { ProviderID } from "./schema"
 import { ProviderID } from "./schema"
 import { Array as Arr, Effect, Layer, Record, Result, Context, Schema } from "effect"
 import { Array as Arr, Effect, Layer, Record, Result, Context, Schema } from "effect"

+ 2 - 2
packages/opencode/src/provider/provider.ts

@@ -13,7 +13,7 @@ import { Auth } from "../auth"
 import { Env } from "../env"
 import { Env } from "../env"
 import { InstallationVersion } from "@opencode-ai/core/installation/version"
 import { InstallationVersion } from "@opencode-ai/core/installation/version"
 import { Flag } from "@opencode-ai/core/flag/flag"
 import { Flag } from "@opencode-ai/core/flag/flag"
-import { zod } from "@/util/effect-zod"
+import { zod } from "@opencode-ai/core/effect-zod"
 import { namedSchemaError } from "@/util/named-schema-error"
 import { namedSchemaError } from "@/util/named-schema-error"
 import { iife } from "@/util/iife"
 import { iife } from "@/util/iife"
 import { Global } from "@opencode-ai/core/global"
 import { Global } from "@opencode-ai/core/global"
@@ -24,7 +24,7 @@ import { EffectBridge } from "@/effect/bridge"
 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"
 import { isRecord } from "@/util/record"
 import { isRecord } from "@/util/record"
-import { optionalOmitUndefined, withStatics } from "@/util/schema"
+import { optionalOmitUndefined, withStatics } from "@opencode-ai/core/schema"
 
 
 import * as ProviderTransform from "./transform"
 import * as ProviderTransform from "./transform"
 import { ModelID, ProviderID } from "./schema"
 import { ModelID, ProviderID } from "./schema"

+ 2 - 2
packages/opencode/src/provider/schema.ts

@@ -1,7 +1,7 @@
 import { Schema } from "effect"
 import { Schema } from "effect"
 
 
-import { zod } from "@/util/effect-zod"
-import { withStatics } from "@/util/schema"
+import { zod } from "@opencode-ai/core/effect-zod"
+import { withStatics } from "@opencode-ai/core/schema"
 
 
 const providerIdSchema = Schema.String.pipe(Schema.brand("ProviderID"))
 const providerIdSchema = Schema.String.pipe(Schema.brand("ProviderID"))
 
 

+ 2 - 2
packages/opencode/src/pty/index.ts

@@ -10,8 +10,8 @@ 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 "@/util/effect-zod"
-import { NonNegativeInt, PositiveInt, withStatics } from "@/util/schema"
+import { zod } from "@opencode-ai/core/effect-zod"
+import { NonNegativeInt, PositiveInt, withStatics } from "@opencode-ai/core/schema"
 
 
 const log = Log.create({ service: "pty" })
 const log = Log.create({ service: "pty" })
 
 

+ 2 - 2
packages/opencode/src/pty/schema.ts

@@ -1,8 +1,8 @@
 import { Schema } from "effect"
 import { Schema } from "effect"
 
 
 import { Identifier } from "@/id/id"
 import { Identifier } from "@/id/id"
-import { zod, ZodOverride } from "@/util/effect-zod"
-import { withStatics } from "@/util/schema"
+import { zod, ZodOverride } from "@opencode-ai/core/effect-zod"
+import { withStatics } from "@opencode-ai/core/schema"
 
 
 const ptyIdSchema = Schema.String.annotate({ [ZodOverride]: Identifier.schema("pty") }).pipe(Schema.brand("PtyID"))
 const ptyIdSchema = Schema.String.annotate({ [ZodOverride]: Identifier.schema("pty") }).pipe(Schema.brand("PtyID"))
 
 

+ 1 - 1
packages/opencode/src/pty/ticket.ts

@@ -3,7 +3,7 @@ export * as PtyTicket from "./ticket"
 import { WorkspaceID } from "@/control-plane/schema"
 import { WorkspaceID } from "@/control-plane/schema"
 import { InstanceRef, WorkspaceRef } from "@/effect/instance-ref"
 import { InstanceRef, WorkspaceRef } from "@/effect/instance-ref"
 import { PtyID } from "@/pty/schema"
 import { PtyID } from "@/pty/schema"
-import { PositiveInt } from "@/util/schema"
+import { PositiveInt } from "@opencode-ai/core/schema"
 import { Cache, Context, Duration, Effect, Layer, Schema } from "effect"
 import { Cache, Context, Duration, Effect, Layer, Schema } from "effect"
 
 
 const DEFAULT_TTL = Duration.seconds(60)
 const DEFAULT_TTL = Duration.seconds(60)

+ 2 - 2
packages/opencode/src/question/index.ts

@@ -3,9 +3,9 @@ import { Bus } from "@/bus"
 import { BusEvent } from "@/bus/bus-event"
 import { BusEvent } from "@/bus/bus-event"
 import { InstanceState } from "@/effect/instance-state"
 import { InstanceState } from "@/effect/instance-state"
 import { SessionID, MessageID } from "@/session/schema"
 import { SessionID, MessageID } from "@/session/schema"
-import { zod } from "@/util/effect-zod"
+import { zod } from "@opencode-ai/core/effect-zod"
 import * as Log from "@opencode-ai/core/util/log"
 import * as Log from "@opencode-ai/core/util/log"
-import { withStatics } from "@/util/schema"
+import { withStatics } from "@opencode-ai/core/schema"
 import { QuestionID } from "./schema"
 import { QuestionID } from "./schema"
 
 
 const log = Log.create({ service: "question" })
 const log = Log.create({ service: "question" })

+ 2 - 2
packages/opencode/src/question/schema.ts

@@ -1,8 +1,8 @@
 import { Schema } from "effect"
 import { Schema } from "effect"
 
 
 import { Identifier } from "@/id/id"
 import { Identifier } from "@/id/id"
-import { zod, ZodOverride } from "@/util/effect-zod"
-import { Newtype } from "@/util/schema"
+import { zod, ZodOverride } from "@opencode-ai/core/effect-zod"
+import { Newtype } from "@opencode-ai/core/schema"
 
 
 export class QuestionID extends Newtype<QuestionID>()(
 export class QuestionID extends Newtype<QuestionID>()(
   "QuestionID",
   "QuestionID",

+ 1 - 1
packages/opencode/src/server/routes/instance/httpapi/groups/experimental.ts

@@ -3,7 +3,7 @@ import { MCP } from "@/mcp"
 import { ProviderID, ModelID } from "@/provider/schema"
 import { ProviderID, ModelID } from "@/provider/schema"
 import { Session } from "@/session/session"
 import { Session } from "@/session/session"
 import { Worktree } from "@/worktree"
 import { Worktree } from "@/worktree"
-import { NonNegativeInt } from "@/util/schema"
+import { NonNegativeInt } from "@opencode-ai/core/schema"
 import { Schema, SchemaGetter } from "effect"
 import { Schema, SchemaGetter } from "effect"
 import { HttpApi, HttpApiEndpoint, HttpApiError, HttpApiGroup, OpenApi } from "effect/unstable/httpapi"
 import { HttpApi, HttpApiEndpoint, HttpApiError, HttpApiGroup, OpenApi } from "effect/unstable/httpapi"
 import { Authorization } from "../middleware/authorization"
 import { Authorization } from "../middleware/authorization"

+ 1 - 1
packages/opencode/src/server/routes/instance/httpapi/groups/sync.ts

@@ -1,4 +1,4 @@
-import { NonNegativeInt } from "@/util/schema"
+import { NonNegativeInt } from "@opencode-ai/core/schema"
 import { SessionID } from "@/session/schema"
 import { SessionID } from "@/session/schema"
 import { Schema } from "effect"
 import { Schema } from "effect"
 import { HttpApi, HttpApiEndpoint, HttpApiError, HttpApiGroup, OpenApi } from "effect/unstable/httpapi"
 import { HttpApi, HttpApiEndpoint, HttpApiError, HttpApiGroup, OpenApi } from "effect/unstable/httpapi"

+ 1 - 1
packages/opencode/src/server/routes/instance/httpapi/handlers/experimental.ts

@@ -6,7 +6,7 @@ import { MCP } from "@/mcp"
 import { Project } from "@/project/project"
 import { Project } from "@/project/project"
 import { Session } from "@/session/session"
 import { Session } from "@/session/session"
 import { ToolRegistry } from "@/tool/registry"
 import { ToolRegistry } from "@/tool/registry"
-import * as EffectZod from "@/util/effect-zod"
+import * as EffectZod from "@opencode-ai/core/effect-zod"
 import { Worktree } from "@/worktree"
 import { Worktree } from "@/worktree"
 import { Effect, Option } from "effect"
 import { Effect, Option } from "effect"
 import * as HttpServerResponse from "effect/unstable/http/HttpServerResponse"
 import * as HttpServerResponse from "effect/unstable/http/HttpServerResponse"

+ 2 - 2
packages/opencode/src/session/message-v2.ts

@@ -23,8 +23,8 @@ import type { SystemError } from "bun"
 import type { Provider } from "@/provider/provider"
 import type { Provider } from "@/provider/provider"
 import { ModelID, ProviderID } from "@/provider/schema"
 import { ModelID, ProviderID } from "@/provider/schema"
 import { Effect, Schema, Types } from "effect"
 import { Effect, Schema, Types } from "effect"
-import { zod, ZodOverride } from "@/util/effect-zod"
-import { NonNegativeInt, withStatics } from "@/util/schema"
+import { zod, ZodOverride } from "@opencode-ai/core/effect-zod"
+import { NonNegativeInt, withStatics } from "@opencode-ai/core/schema"
 import { namedSchemaError } from "@/util/named-schema-error"
 import { namedSchemaError } from "@/util/named-schema-error"
 import * as EffectLogger from "@opencode-ai/core/effect/logger"
 import * as EffectLogger from "@opencode-ai/core/effect/logger"
 
 

+ 2 - 2
packages/opencode/src/session/message.ts

@@ -1,8 +1,8 @@
 import { Schema } from "effect"
 import { Schema } from "effect"
 import { SessionID } from "./schema"
 import { SessionID } from "./schema"
 import { ModelID, ProviderID } from "../provider/schema"
 import { ModelID, ProviderID } from "../provider/schema"
-import { zod } from "@/util/effect-zod"
-import { NonNegativeInt, withStatics } from "@/util/schema"
+import { zod } from "@opencode-ai/core/effect-zod"
+import { NonNegativeInt, withStatics } from "@opencode-ai/core/schema"
 import { namedSchemaError } from "@/util/named-schema-error"
 import { namedSchemaError } from "@/util/named-schema-error"
 
 
 export const OutputLengthError = namedSchemaError("MessageOutputLengthError", {})
 export const OutputLengthError = namedSchemaError("MessageOutputLengthError", {})

+ 3 - 3
packages/opencode/src/session/prompt.ts

@@ -1,6 +1,6 @@
 import path from "path"
 import path from "path"
 import os from "os"
 import os from "os"
-import * as EffectZod from "@/util/effect-zod"
+import * as EffectZod from "@opencode-ai/core/effect-zod"
 import { SessionID, MessageID, PartID } from "./schema"
 import { SessionID, MessageID, PartID } from "./schema"
 import { MessageV2 } from "./message-v2"
 import { MessageV2 } from "./message-v2"
 import * as Log from "@opencode-ai/core/util/log"
 import * as Log from "@opencode-ai/core/util/log"
@@ -46,8 +46,8 @@ import { Truncate } from "@/tool/truncate"
 import { decodeDataUrl } from "@/util/data-url"
 import { decodeDataUrl } from "@/util/data-url"
 import { Process } from "@/util/process"
 import { Process } from "@/util/process"
 import { Cause, Effect, Exit, Latch, Layer, Option, Scope, Context, Schema, Types } from "effect"
 import { Cause, Effect, Exit, Latch, Layer, Option, Scope, Context, Schema, Types } from "effect"
-import { zod } from "@/util/effect-zod"
-import { withStatics } from "@/util/schema"
+import { zod } from "@opencode-ai/core/effect-zod"
+import { withStatics } from "@opencode-ai/core/schema"
 import * as EffectLogger from "@opencode-ai/core/effect/logger"
 import * as EffectLogger from "@opencode-ai/core/effect/logger"
 import { InstanceState } from "@/effect/instance-state"
 import { InstanceState } from "@/effect/instance-state"
 import { TaskTool, type TaskPromptOps } from "@/tool/task"
 import { TaskTool, type TaskPromptOps } from "@/tool/task"

+ 2 - 2
packages/opencode/src/session/revert.ts

@@ -4,8 +4,8 @@ import { Snapshot } from "../snapshot"
 import { Storage } from "@/storage/storage"
 import { Storage } from "@/storage/storage"
 import { SyncEvent } from "../sync"
 import { SyncEvent } from "../sync"
 import * as Log from "@opencode-ai/core/util/log"
 import * as Log from "@opencode-ai/core/util/log"
-import { zod } from "@/util/effect-zod"
-import { withStatics } from "@/util/schema"
+import { zod } from "@opencode-ai/core/effect-zod"
+import { withStatics } from "@opencode-ai/core/schema"
 import * as Session from "./session"
 import * as Session from "./session"
 import { MessageV2 } from "./message-v2"
 import { MessageV2 } from "./message-v2"
 import { SessionID, MessageID, PartID } from "./schema"
 import { SessionID, MessageID, PartID } from "./schema"

+ 2 - 2
packages/opencode/src/session/schema.ts

@@ -1,8 +1,8 @@
 import { Schema } from "effect"
 import { Schema } from "effect"
 
 
 import { Identifier } from "@/id/id"
 import { Identifier } from "@/id/id"
-import { zod, ZodOverride } from "@/util/effect-zod"
-import { withStatics } from "@/util/schema"
+import { zod, ZodOverride } from "@opencode-ai/core/effect-zod"
+import { withStatics } from "@opencode-ai/core/schema"
 
 
 export const SessionID = Schema.String.annotate({ [ZodOverride]: Identifier.schema("session") }).pipe(
 export const SessionID = Schema.String.annotate({ [ZodOverride]: Identifier.schema("session") }).pipe(
   Schema.brand("SessionID"),
   Schema.brand("SessionID"),

+ 2 - 2
packages/opencode/src/session/session.ts

@@ -37,8 +37,8 @@ import type { Provider } from "@/provider/provider"
 import { Permission } from "@/permission"
 import { Permission } from "@/permission"
 import { Global } from "@opencode-ai/core/global"
 import { Global } from "@opencode-ai/core/global"
 import { Effect, Layer, Option, Context, Schema, Types } from "effect"
 import { Effect, Layer, Option, Context, Schema, Types } from "effect"
-import { zod } from "@/util/effect-zod"
-import { NonNegativeInt, optionalOmitUndefined, withStatics } from "@/util/schema"
+import { zod } from "@opencode-ai/core/effect-zod"
+import { NonNegativeInt, optionalOmitUndefined, withStatics } from "@opencode-ai/core/schema"
 
 
 const log = Log.create({ service: "session" })
 const log = Log.create({ service: "session" })
 
 

+ 2 - 2
packages/opencode/src/session/status.ts

@@ -2,8 +2,8 @@ import { BusEvent } from "@/bus/bus-event"
 import { Bus } from "@/bus"
 import { Bus } from "@/bus"
 import { InstanceState } from "@/effect/instance-state"
 import { InstanceState } from "@/effect/instance-state"
 import { SessionID } from "./schema"
 import { SessionID } from "./schema"
-import { zod } from "@/util/effect-zod"
-import { NonNegativeInt, withStatics } from "@/util/schema"
+import { zod } from "@opencode-ai/core/effect-zod"
+import { NonNegativeInt, withStatics } from "@opencode-ai/core/schema"
 import { Effect, Layer, Context, Schema } from "effect"
 import { Effect, Layer, Context, Schema } from "effect"
 import z from "zod"
 import z from "zod"
 
 

+ 2 - 2
packages/opencode/src/session/summary.ts

@@ -2,8 +2,8 @@ import { Effect, Layer, Context, Schema } from "effect"
 import { Bus } from "@/bus"
 import { Bus } from "@/bus"
 import { Snapshot } from "@/snapshot"
 import { Snapshot } from "@/snapshot"
 import { Storage } from "@/storage/storage"
 import { Storage } from "@/storage/storage"
-import { zod } from "@/util/effect-zod"
-import { withStatics } from "@/util/schema"
+import { zod } from "@opencode-ai/core/effect-zod"
+import { withStatics } from "@opencode-ai/core/schema"
 import * as Session from "./session"
 import * as Session from "./session"
 import { MessageV2 } from "./message-v2"
 import { MessageV2 } from "./message-v2"
 import { SessionID, MessageID } from "./schema"
 import { SessionID, MessageID } from "./schema"

+ 2 - 2
packages/opencode/src/session/todo.ts

@@ -1,8 +1,8 @@
 import { BusEvent } from "@/bus/bus-event"
 import { BusEvent } from "@/bus/bus-event"
 import { Bus } from "@/bus"
 import { Bus } from "@/bus"
 import { SessionID } from "./schema"
 import { SessionID } from "./schema"
-import { zod } from "@/util/effect-zod"
-import { withStatics } from "@/util/schema"
+import { zod } from "@opencode-ai/core/effect-zod"
+import { withStatics } from "@opencode-ai/core/schema"
 import { Effect, Layer, Context, Schema } from "effect"
 import { Effect, Layer, Context, Schema } from "effect"
 import z from "zod"
 import z from "zod"
 import { Database } from "@/storage/db"
 import { Database } from "@/storage/db"

+ 2 - 2
packages/opencode/src/skill/index.ts

@@ -2,8 +2,8 @@ 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 "@/util/effect-zod"
-import { withStatics } from "@/util/schema"
+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"

+ 2 - 2
packages/opencode/src/snapshot/index.ts

@@ -10,8 +10,8 @@ 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 "@/util/schema"
-import { zod } from "@/util/effect-zod"
+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,

+ 1 - 1
packages/opencode/src/storage/storage.ts

@@ -5,7 +5,7 @@ import { NamedError } from "@opencode-ai/core/util/error"
 import z from "zod"
 import z from "zod"
 import { AppFileSystem } from "@opencode-ai/core/filesystem"
 import { AppFileSystem } from "@opencode-ai/core/filesystem"
 import { Effect, Exit, Layer, Option, RcMap, Schema, Context, TxReentrantLock } from "effect"
 import { Effect, Exit, Layer, Option, RcMap, Schema, Context, TxReentrantLock } from "effect"
-import { NonNegativeInt } from "@/util/schema"
+import { NonNegativeInt } from "@opencode-ai/core/schema"
 import { Git } from "@/git"
 import { Git } from "@/git"
 
 
 const log = Log.create({ service: "storage" })
 const log = Log.create({ service: "storage" })

+ 1 - 1
packages/opencode/src/sync/index.ts

@@ -9,7 +9,7 @@ import type { WorkspaceID } from "@/control-plane/schema"
 import { EventID } from "./schema"
 import { EventID } from "./schema"
 import { Flag } from "@opencode-ai/core/flag/flag"
 import { Flag } from "@opencode-ai/core/flag/flag"
 import { Context, Effect, Layer, Schema as EffectSchema } from "effect"
 import { Context, Effect, Layer, Schema as EffectSchema } from "effect"
-import type { DeepMutable } from "@/util/schema"
+import type { DeepMutable } from "@opencode-ai/core/schema"
 import { makeRuntime } from "@/effect/run-service"
 import { makeRuntime } from "@/effect/run-service"
 import { serviceUse } from "@/effect/service-use"
 import { serviceUse } from "@/effect/service-use"
 import { InstanceState } from "@/effect/instance-state"
 import { InstanceState } from "@/effect/instance-state"

+ 2 - 2
packages/opencode/src/sync/schema.ts

@@ -1,8 +1,8 @@
 import { Schema } from "effect"
 import { Schema } from "effect"
 
 
 import { Identifier } from "@/id/id"
 import { Identifier } from "@/id/id"
-import { zod, ZodOverride } from "@/util/effect-zod"
-import { withStatics } from "@/util/schema"
+import { zod, ZodOverride } from "@opencode-ai/core/effect-zod"
+import { withStatics } from "@opencode-ai/core/schema"
 
 
 export const EventID = Schema.String.annotate({ [ZodOverride]: Identifier.schema("event") }).pipe(
 export const EventID = Schema.String.annotate({ [ZodOverride]: Identifier.schema("event") }).pipe(
   Schema.brand("EventID"),
   Schema.brand("EventID"),

+ 1 - 1
packages/opencode/src/tool/read.ts

@@ -1,5 +1,5 @@
 import { Effect, Option, Schema, Scope } from "effect"
 import { Effect, Option, Schema, Scope } from "effect"
-import { NonNegativeInt } from "@/util/schema"
+import { NonNegativeInt } from "@opencode-ai/core/schema"
 import { createReadStream } from "fs"
 import { createReadStream } from "fs"
 import * as path from "path"
 import * as path from "path"
 import { createInterface } from "readline"
 import { createInterface } from "readline"

+ 1 - 1
packages/opencode/src/tool/registry.ts

@@ -17,7 +17,7 @@ import { Config } from "@/config/config"
 import { type ToolContext as PluginToolContext, type ToolDefinition } from "@opencode-ai/plugin"
 import { type ToolContext as PluginToolContext, type ToolDefinition } from "@opencode-ai/plugin"
 import { Schema } from "effect"
 import { Schema } from "effect"
 import z from "zod"
 import z from "zod"
-import { ZodOverride } from "@/util/effect-zod"
+import { ZodOverride } from "@opencode-ai/core/effect-zod"
 import { Plugin } from "../plugin"
 import { Plugin } from "../plugin"
 import { Provider } from "@/provider/provider"
 import { Provider } from "@/provider/provider"
 import { ProviderID, type ModelID } from "../provider/schema"
 import { ProviderID, type ModelID } from "../provider/schema"

+ 2 - 2
packages/opencode/src/tool/schema.ts

@@ -1,8 +1,8 @@
 import { Schema } from "effect"
 import { Schema } from "effect"
 
 
 import { Identifier } from "@/id/id"
 import { Identifier } from "@/id/id"
-import { zod, ZodOverride } from "@/util/effect-zod"
-import { withStatics } from "@/util/schema"
+import { zod, ZodOverride } from "@opencode-ai/core/effect-zod"
+import { withStatics } from "@opencode-ai/core/schema"
 
 
 const toolIdSchema = Schema.String.annotate({ [ZodOverride]: Identifier.schema("tool") }).pipe(Schema.brand("ToolID"))
 const toolIdSchema = Schema.String.annotate({ [ZodOverride]: Identifier.schema("tool") }).pipe(Schema.brand("ToolID"))
 
 

+ 1 - 1
packages/opencode/src/tool/shell/prompt.ts

@@ -1,6 +1,6 @@
 import { Schema } from "effect"
 import { Schema } from "effect"
 import DESCRIPTION from "./shell.txt"
 import DESCRIPTION from "./shell.txt"
-import { PositiveInt } from "@/util/schema"
+import { PositiveInt } from "@opencode-ai/core/schema"
 import { Global } from "@opencode-ai/core/global"
 import { Global } from "@opencode-ai/core/global"
 import { ShellID } from "./id"
 import { ShellID } from "./id"
 
 

+ 1 - 1
packages/opencode/src/util/named-schema-error.ts

@@ -1,6 +1,6 @@
 import { Schema } from "effect"
 import { Schema } from "effect"
 import z from "zod"
 import z from "zod"
-import { zod } from "@/util/effect-zod"
+import { zod } from "@opencode-ai/core/effect-zod"
 
 
 /**
 /**
  * Create a Schema-backed NamedError-shaped class.
  * Create a Schema-backed NamedError-shaped class.

+ 1 - 1
packages/opencode/src/v2/auth.ts

@@ -1,7 +1,7 @@
 import path from "path"
 import path from "path"
 import { Effect, Layer, Option, Schema, Context, SynchronizedRef } from "effect"
 import { Effect, Layer, Option, Schema, Context, SynchronizedRef } from "effect"
 import { Identifier } from "@opencode-ai/core/util/identifier"
 import { Identifier } from "@opencode-ai/core/util/identifier"
-import { NonNegativeInt, withStatics } from "@/util/schema"
+import { NonNegativeInt, withStatics } from "@opencode-ai/core/schema"
 import { Global } from "@opencode-ai/core/global"
 import { Global } from "@opencode-ai/core/global"
 import { AppFileSystem } from "@opencode-ai/core/filesystem"
 import { AppFileSystem } from "@opencode-ai/core/filesystem"
 
 

+ 1 - 1
packages/opencode/src/v2/event.ts

@@ -1,6 +1,6 @@
 import { Identifier } from "@/id/id"
 import { Identifier } from "@/id/id"
 import { SyncEvent } from "@/sync"
 import { SyncEvent } from "@/sync"
-import { withStatics } from "@/util/schema"
+import { withStatics } from "@opencode-ai/core/schema"
 import { Flag } from "@opencode-ai/core/flag/flag"
 import { Flag } from "@opencode-ai/core/flag/flag"
 import * as Schema from "effect/Schema"
 import * as Schema from "effect/Schema"
 
 

+ 1 - 1
packages/opencode/src/v2/model.ts

@@ -1,4 +1,4 @@
-import { withStatics } from "@/util/schema"
+import { withStatics } from "@opencode-ai/core/schema"
 import { Array, Context, Effect, HashMap, Layer, Option, Order, pipe, Schema } from "effect"
 import { Array, Context, Effect, HashMap, Layer, Option, Order, pipe, Schema } from "effect"
 import { DateTimeUtcFromMillis } from "effect/Schema"
 import { DateTimeUtcFromMillis } from "effect/Schema"
 
 

+ 1 - 1
packages/opencode/src/v2/session-event.ts

@@ -1,5 +1,5 @@
 import { SessionID } from "@/session/schema"
 import { SessionID } from "@/session/schema"
-import { NonNegativeInt } from "@/util/schema"
+import { NonNegativeInt } from "@opencode-ai/core/schema"
 import { EventV2 } from "./event"
 import { EventV2 } from "./event"
 import { FileAttachment, Prompt } from "./session-prompt"
 import { FileAttachment, Prompt } from "./session-prompt"
 import { Schema } from "effect"
 import { Schema } from "effect"

+ 1 - 1
packages/opencode/src/v2/session.ts

@@ -10,7 +10,7 @@ import { EventV2 } from "./event"
 import { ProjectID } from "@/project/schema"
 import { ProjectID } from "@/project/schema"
 import { SessionEvent } from "./session-event"
 import { SessionEvent } from "./session-event"
 import { V2Schema } from "./schema"
 import { V2Schema } from "./schema"
-import { optionalOmitUndefined } from "@/util/schema"
+import { optionalOmitUndefined } from "@opencode-ai/core/schema"
 import { Modelv2 } from "./model"
 import { Modelv2 } from "./model"
 
 
 export const Delivery = Schema.Literals(["immediate", "deferred"]).annotate({
 export const Delivery = Schema.Literals(["immediate", "deferred"]).annotate({

+ 1 - 1
packages/opencode/test/tool/parameters.test.ts

@@ -1,6 +1,6 @@
 import { describe, expect, test } from "bun:test"
 import { describe, expect, test } from "bun:test"
 import { Result, Schema } from "effect"
 import { Result, Schema } from "effect"
-import { toJsonSchema } from "../../src/util/effect-zod"
+import { toJsonSchema } from "@opencode-ai/core/effect-zod"
 
 
 // Each tool exports its parameters schema at module scope so this test can
 // Each tool exports its parameters schema at module scope so this test can
 // import them without running the tool's Effect-based init. The JSON Schema
 // import them without running the tool's Effect-based init. The JSON Schema

+ 1 - 1
packages/opencode/test/util/effect-zod.test.ts

@@ -2,7 +2,7 @@ import { describe, expect, test } from "bun:test"
 import { Effect, Schema, SchemaGetter } from "effect"
 import { Effect, Schema, SchemaGetter } from "effect"
 import z from "zod"
 import z from "zod"
 
 
-import { zod, ZodOverride } from "../../src/util/effect-zod"
+import { zod, ZodOverride } from "@opencode-ai/core/effect-zod"
 
 
 function json(schema: z.ZodTypeAny) {
 function json(schema: z.ZodTypeAny) {
   const { $schema: _, ...rest } = z.toJSONSchema(schema)
   const { $schema: _, ...rest } = z.toJSONSchema(schema)