refactor(client): rename service start to ensure

This commit is contained in:
Dax Raad 2026-07-15 13:34:32 -04:00
commit ec8ee60e0b
17 changed files with 79 additions and 64 deletions

View file

@ -21,15 +21,15 @@ export type DiscoverOptions = {
readonly version?: string
}
/** Reason a new service process must be started. */
export type StartReason = "missing" | "version-mismatch"
/** Reason ensuring the service requires a new process. */
export type EnsureReason = "missing" | "version-mismatch"
/** Options used to ensure the local OpenCode service is running. */
export type StartOptions = DiscoverOptions & {
export type EnsureOptions = DiscoverOptions & {
/** Service command and arguments. Defaults to `opencode serve --service`. */
readonly command?: ReadonlyArray<string>
/** Called once before spawning a new service process. */
readonly onStart?: (reason: StartReason, previousVersion?: string) => void
readonly onStart?: (reason: EnsureReason, previousVersion?: string) => void
}
/** Options used to stop the local OpenCode service. */