submission-settings.ts 1.3 KB

1234567891011121314151617181920212223242526272829
  1. /** Busy-Enter preference stored in the Host user-settings document. */
  2. import z from '@deepseek-ai/schemastery'
  3. /** Settings namespace owned by the conversation plugin. */
  4. export const CONVERSATION_SETTINGS_NAMESPACE = 'ui-conversation'
  5. /** Field carrying the delivery mode for plain Enter while an agent is busy. */
  6. export const BUSY_ENTER_FIELD = 'busyEnter'
  7. /** Busy-Enter behaviors accepted at settings and input boundaries. */
  8. export const BUSY_ENTER_BEHAVIORS = ['queue', 'steer'] as const
  9. /** Configurable meaning of plain Enter while the addressed agent is busy. */
  10. export type BusyEnterBehavior = typeof BUSY_ENTER_BEHAVIORS[number]
  11. /** Default preserves Enter-as-Queue for running conversations. */
  12. export const DEFAULT_BUSY_ENTER_BEHAVIOR: BusyEnterBehavior = 'queue'
  13. /** Durable conversation section shared by the Host schema and the browser scope. */
  14. export interface ConversationSettings {
  15. /** Delivery mode for plain Enter while the addressed agent is busy. */
  16. busyEnter: BusyEnterBehavior
  17. }
  18. /** Durable conversation schema; also the wire envelope the browser scope validates against. */
  19. export const ConversationSettingsSchema: z<ConversationSettings> = z.object({
  20. [BUSY_ENTER_FIELD]: z.union([...BUSY_ENTER_BEHAVIORS]).default(DEFAULT_BUSY_ENTER_BEHAVIOR),
  21. })