Files
deepseek-harness/packages/client/ui-conversation/src/index.ts
T

33 lines
1.2 KiB
TypeScript

/** Browser conversation preferences. */
import type {} from '@deepseek-ai/dsh-settings'
import type { Volatile, Context } from '@deepseek-ai/cordis'
import type { BusyEnterBehavior } from './submission-settings.ts'
import z from '@deepseek-ai/schemastery'
import { BUSY_ENTER_FIELD } from './submission-settings.ts'
import { ConversationSettingsFields } from './submission-settings.ts'
export {
BUSY_ENTER_BEHAVIORS, BUSY_ENTER_FIELD, CONVERSATION_SETTINGS_NAMESPACE,
DEFAULT_BUSY_ENTER_BEHAVIOR, type BusyEnterBehavior, type ConversationSettings,
} from './submission-settings.ts'
/** Runtime preferences projected to the browser. */
export interface Config {
/** Enter key behavior while a turn is running. */
busyEnter: Volatile<BusyEnterBehavior>
}
/** Live preferences projected to the browser. */
export const Config = z.object({
[BUSY_ENTER_FIELD]: ConversationSettingsFields[BUSY_ENTER_FIELD].volatile(),
})
/** Register browser conversation preferences.
* @param ctx Plugin context used for optional settings presentation.
*/
export function apply(ctx: Context): void {
ctx.inject(['settings'], (child) => { child.effect(() => child.settings.configure({ auto: false }, ctx.fiber)) })
}