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
+2 -15
View File
@@ -8,30 +8,17 @@ import { errorMessage } from "@/util/error"
import { ChildProcess } from "effect/unstable/process"
import { AppProcess } from "@opencode-ai/core/process"
import path from "path"
import { EventV2 } from "@opencode-ai/core/event"
import { makeRuntime } from "@opencode-ai/core/effect/runtime"
import semver from "semver"
import { InstallationChannel, InstallationVersion } from "@opencode-ai/core/installation/version"
import { NpmConfig } from "@opencode-ai/core/npm-config"
import { InstallationEvent } from "@opencode-ai/schema/installation-event"
export type Method = "curl" | "npm" | "yarn" | "pnpm" | "bun" | "brew" | "scoop" | "choco" | "unknown"
export type ReleaseType = "patch" | "minor" | "major"
export const Event = {
Updated: EventV2.define({
type: "installation.updated",
schema: {
version: Schema.String,
},
}),
UpdateAvailable: EventV2.define({
type: "installation.update-available",
schema: {
version: Schema.String,
},
}),
}
export const Event = InstallationEvent
export function getReleaseType(current: string, latest: string): ReleaseType {
const currMajor = semver.major(current)