mirror of
https://github.com/anomalyco/opencode.git
synced 2026-09-29 17:09:40 +08:00
refactor(config): remove preferences API
This commit is contained in:
@@ -7,22 +7,6 @@ import { Api } from "../api"
|
||||
export const ConfigHandler = HttpApiBuilder.group(Api, "server.config", (handlers) =>
|
||||
handlers
|
||||
.handle("config.get", () => Config.Service.use((config) => config.entries()))
|
||||
.handle(
|
||||
"config.preferences",
|
||||
Effect.fn(function* () {
|
||||
const config = yield* Config.Service
|
||||
if (!config.preferences) return yield* Effect.die(new Error("Config preferences are unavailable"))
|
||||
return yield* config.preferences().pipe(Effect.orDie)
|
||||
}),
|
||||
)
|
||||
.handle(
|
||||
"config.updatePreferences",
|
||||
Effect.fn(function* (ctx) {
|
||||
const config = yield* Config.Service
|
||||
if (!config.updatePreferences) return yield* Effect.die(new Error("Config preference updates are unavailable"))
|
||||
return yield* config.updatePreferences(ctx.payload).pipe(Effect.orDie)
|
||||
}),
|
||||
)
|
||||
.handle(
|
||||
"config.shells",
|
||||
Effect.fn(function* () {
|
||||
|
||||
Reference in New Issue
Block a user