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

This commit is contained in:
Kit Langton
2026-06-24 22:43:17 +02:00
committed by GitHub
parent 858f35f1b3
commit 24b0132bc5
93 changed files with 2740 additions and 2124 deletions
+3 -9
View File
@@ -1,11 +1,12 @@
import { LayerNode } from "@opencode-ai/core/effect/layer-node"
import { Effect, Layer, Context, Schema, Stream, Scope } from "effect"
import { Effect, Layer, Context, Schema, Scope } from "effect"
import { formatPatch, structuredPatch } from "diff"
import { InstanceState } from "@/effect/instance-state"
import { Watcher } from "@opencode-ai/core/filesystem/watcher"
import { Git } from "@/git"
import { EventV2Bridge } from "@/event-v2-bridge"
import { EventV2 } from "@opencode-ai/core/event"
import { VcsEvent } from "@opencode-ai/schema/vcs-event"
const PATCH_CONTEXT_LINES = 2_147_483_647
const MAX_PATCH_BYTES = 10_000_000
@@ -234,14 +235,7 @@ const track = Effect.fnUntraced(function* (
export const Mode = Schema.Literals(["git", "branch"])
export type Mode = Schema.Schema.Type<typeof Mode>
export const Event = {
BranchUpdated: EventV2.define({
type: "vcs.branch.updated",
schema: {
branch: Schema.optional(Schema.String),
},
}),
}
export const Event = VcsEvent
export const Info = Schema.Struct({
branch: Schema.optional(Schema.String),