Files
deepseek-harness/packages/client/ui-conversation/src/submission-settings.ts
Yichen Jiang 53c66ecbeb refactor(client): keep settings constants and schemas off the client contract surfaces
The /client entry of a UI plugin exports no values beyond what cordis
loading needs; the theme constants block returns to type-only re-exports,
the per-namespace schemas move into the shared *-settings modules instead
of widening the host entries, and same-package specs import those internals
directly per the export discipline in packages/client/AGENTS.md.
2026-08-07 23:30:04 +08:00

30 lines
1.2 KiB
TypeScript

/** Busy-Enter preference stored in the Host user-settings document. */
import z from 'schemastery'
/** Settings namespace owned by the conversation plugin. */
export const CONVERSATION_SETTINGS_NAMESPACE = 'ui-conversation'
/** Field carrying the delivery mode for plain Enter while an agent is busy. */
export const BUSY_ENTER_FIELD = 'busyEnter'
/** Busy-Enter behaviors accepted at settings and input boundaries. */
export const BUSY_ENTER_BEHAVIORS = ['queue', 'steer'] as const
/** Configurable meaning of plain Enter while the addressed agent is busy. */
export type BusyEnterBehavior = typeof BUSY_ENTER_BEHAVIORS[number]
/** Default preserves Enter-as-Queue for running conversations. */
export const DEFAULT_BUSY_ENTER_BEHAVIOR: BusyEnterBehavior = 'queue'
/** Durable conversation section shared by the Host schema and the browser scope. */
export interface ConversationSettings {
/** Delivery mode for plain Enter while the addressed agent is busy. */
busyEnter: BusyEnterBehavior
}
/** Durable conversation schema; also the wire envelope the browser scope validates against. */
export const ConversationSettingsSchema: z<ConversationSettings> = z.object({
[BUSY_ENTER_FIELD]: z.union([...BUSY_ENTER_BEHAVIORS]).default(DEFAULT_BUSY_ENTER_BEHAVIOR),
})