refactor(tui): simplify config context
This commit is contained in:
parent
3c60470269
commit
f8f8cc9546
27 changed files with 135 additions and 142 deletions
|
|
@ -35,15 +35,17 @@ export default Runtime.handler(Commands, (input) =>
|
|||
),
|
||||
)
|
||||
preflight.loading()
|
||||
const configService = yield* Config.Service
|
||||
const config = yield* Config.Service
|
||||
let disposeSlots: (() => void) | undefined
|
||||
const runFork = Effect.runForkWith(yield* Effect.context())
|
||||
const context = yield* Effect.context()
|
||||
const runFork = Effect.runForkWith(context)
|
||||
const runPromise = Effect.runPromiseWith(context)
|
||||
yield* run({
|
||||
server,
|
||||
args: { continue: input.continue, sessionID: Option.getOrUndefined(input.session) },
|
||||
config: {
|
||||
get: () => Effect.runPromise(configService.get()),
|
||||
update: (update) => Effect.runPromise(configService.update(update)),
|
||||
get: () => runPromise(config.get()),
|
||||
update: (update) => runPromise(config.update(update)),
|
||||
},
|
||||
terminalHandoff: () => preflight.finish(),
|
||||
log: (level, message, tags) => {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { TuiConfig } from "@opencode-ai/tui/config"
|
||||
import { Config } from "@opencode-ai/tui/config"
|
||||
import { Schema } from "effect"
|
||||
|
||||
export const Info = Schema.Struct({ ...TuiConfig.Info.fields })
|
||||
export const Info = Schema.Struct({ ...Config.Info.fields })
|
||||
export type Info = Schema.Schema.Type<typeof Info>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue