mini: add replay settings to cli config (#38487)
This commit is contained in:
parent
b6f85c2250
commit
52c98a4eeb
5 changed files with 28 additions and 6 deletions
|
|
@ -142,6 +142,12 @@ export const Info = Schema.Struct({
|
|||
mono: Schema.optional(Schema.Boolean).annotate({
|
||||
description: "Use monochrome ASCII output",
|
||||
}),
|
||||
replay: Schema.optional(Schema.Boolean).annotate({
|
||||
description: "Restore session history on resume and terminal resize",
|
||||
}),
|
||||
replay_limit: Schema.optional(Schema.Int.check(Schema.isGreaterThan(0))).annotate({
|
||||
description: "Maximum number of newest messages restored during replay",
|
||||
}),
|
||||
}),
|
||||
).annotate({ description: "Mini transcript presentation settings" }),
|
||||
hints: Schema.optional(
|
||||
|
|
|
|||
|
|
@ -1,13 +1,25 @@
|
|||
/** @jsxImportSource @opentui/solid */
|
||||
import { testRender } from "@opentui/solid"
|
||||
import { expect, test } from "bun:test"
|
||||
import { Schema } from "effect"
|
||||
import {
|
||||
resolve,
|
||||
ConfigProvider,
|
||||
Info,
|
||||
useConfig,
|
||||
type Interface,
|
||||
} from "../src/config"
|
||||
|
||||
test("validates mini replay settings", () => {
|
||||
const decode = Schema.decodeUnknownSync(Info)
|
||||
|
||||
expect(decode({ mini: { replay: false, replay_limit: 50 } })).toEqual({
|
||||
mini: { replay: false, replay_limit: 50 },
|
||||
})
|
||||
expect(() => decode({ mini: { replay_limit: 0 } })).toThrow()
|
||||
expect(() => decode({ mini: { replay_limit: 1.5 } })).toThrow()
|
||||
})
|
||||
|
||||
test("resolves nested config and keybind defaults", () => {
|
||||
const config = resolve(
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue