Files
CatoandClaude Opus 5.5 9dde8fbee9 feat(forms): prose fields on chatkit DictationField, with a working microphone (#330)
* wip: prose fields on chatkit DictationField (awaits chatkit 0.45)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuMRAXYWNkfowAXVfi

* feat(forms): prose fields on chatkit DictationField, with a working microphone

- Bump @bitbaum/chatkit to ^0.45.0.
- One app wrapper, components/forms/TextBox, around DictationField. Used by
  the bot builder (name, description, knowledge topic and content, system
  prompt), the custom-bot edit page (name, description, system prompt,
  greeting), the contact message, the demo intake questions, quick-create
  (name, relationship, memories) and the consultation form's
  react-hook-form message field ({...register('message')}).
- app/api/transcribe: dictation server leg on ai-kit's speechChain and
  transcribe(), rate limited, recordings and transcripts neither stored nor
  logged. Every field and every in-page chat points voice at it, so the
  microphone works where the browser has no recogniser of its own.
- Permissions-Policy allowed no microphone at all (microphone=()), which
  blocked every mic on the site; it now allows the site itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuMRAXYWNkfowAXVfi

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-19 14:23:42 +01:00

20 lines
765 B
TypeScript

'use client';
import { DictationField, type DictationFieldProps } from '@bitbaum/chatkit/react';
/** Botsmann's dictation server leg (app/api/transcribe), shared by every microphone. */
export const VOICE = { transcribeUrl: '/api/transcribe' } as const;
/**
* Every place a person types prose in botsmann (descriptions, prompts,
* messages, notes, titles) is chatkit's DictationField, through this one
* wrapper, so the microphone and the field's behaviour come from the package
* and botsmann sets its defaults once. Pass `label` and `hint` here rather
* than wrapping the field in a <label>.
*/
export function TextBox(props: DictationFieldProps) {
return <DictationField voice={VOICE} {...props} />;
}
export type TextBoxProps = DictationFieldProps;