refactor(schema): extract public event definitions (#33579)

This commit is contained in:
Kit Langton
2026-06-24 16:43:17 -04:00
committed by GitHub
parent 858f35f1b3
commit 24b0132bc5
93 changed files with 2740 additions and 2124 deletions
+3 -10
View File
@@ -3,7 +3,8 @@ export * as Watcher from "./watcher"
// @ts-ignore
import { createWrapper } from "@parcel/watcher/wrapper"
import type ParcelWatcher from "@parcel/watcher"
import { Cause, Context, Effect, Layer, Schema } from "effect"
import { Cause, Context, Effect, Layer } from "effect"
import { FileSystemWatcher } from "@opencode-ai/schema/filesystem-watcher"
import path from "path"
import { Config } from "../config"
import { EventV2 } from "../event"
@@ -19,15 +20,7 @@ declare const OPENCODE_LIBC: string | undefined
const SUBSCRIBE_TIMEOUT_MS = 10_000
export const Event = {
Updated: EventV2.define({
type: "file.watcher.updated",
schema: {
file: Schema.String,
event: Schema.Literals(["add", "change", "unlink"]),
},
}),
}
export const Event = FileSystemWatcher.Event
const watcher = lazy((): typeof import("@parcel/watcher") | undefined => {
try {