Repository navigation
Conversation
Add `ai-form-fill/voice`: `createDictation` wraps the Web Speech API and reports the full transcript on every result, auto-stops after a silence window and calls `onEnd` exactly once per session. `isDictationSupported` is a function, so the module is safe to import under SSR. Build one file set per public import path (`dist/ai-form-fill.*` and `dist/voice.*`, ESM + CJS + rolled-up `.d.ts`). `main` now points at `dist/ai-form-fill.cjs`; the UMD bundle is dropped. The `declare global` re-append moved into the vite-plugin-dts `afterBuild` hook, replacing `scripts/append-event-types.js`. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Reviewer's GuideThis PR introduces a separately bundled, SSR-safe Web Speech dictation module with automatic silence stopping and exactly-once session completion, updates the example and package documentation to use it, and restructures the build/package exports into independently tested core and voice ESM/CJS/type entry points while removing UMD output. Sequence diagram for voice dictation and form fillingsequenceDiagram
actor User
participant UI as Voice UI
participant Dictation as createDictation
participant SpeechAPI as Web Speech API
participant FormFill as FormFillController
User->>UI: Click microphone
UI->>Dictation: start()
Dictation->>SpeechAPI: start()
loop Recognition results
SpeechAPI-->>Dictation: onresult(event)
Dictation-->>UI: onText(transcript, isFinal)
end
Note over Dictation: Silence window expires
Dictation->>SpeechAPI: stop()
SpeechAPI-->>Dictation: onend
Dictation-->>UI: onEnd(finalText)
UI->>FormFill: fill(finalText)
State diagram for dictation session lifecyclestateDiagram-v2
[*] --> Idle
Idle --> Listening: start()
Listening --> Listening: onresult / onText
Listening --> Stopping: silence window
Listening --> Stopping: stop()
Stopping --> Idle: onend / onEnd once
Idle --> Idle: start() while listening is false
Listening --> Listening: start() is no-op
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
ai-form-fill/voiceand splits the build into one entry per import path.createDictation()wraps the Web Speech API: live transcript, auto-stop aftera silence window (
silenceMs, 1500 ms default),onEndexactly once. One clickcovers speak-and-fill.
isDictationSupported()is a function, so it is SSR-safe.dist/ai-form-fill.*anddist/voice.*(ESM, CJS, rolled-up.d.ts).mainis nowdist/ai-form-fill.cjs; the UMD bundle is removed. Thedeclare globalre-append moved into the dtsafterBuildhook, so the separatescripts/append-event-types.jsstep is gone.createDictation; new tests cover the dictationstate machine and the built entry files.
🤖 Generated with Claude Code
Summary by Sourcery
Add a standalone voice dictation API and restructure the package into isolated core and voice builds.
New Features:
ai-form-fill/voiceentry point with Web Speech dictation, live transcripts, configurable silence auto-stop, error reporting, and SSR-safe support detection.Enhancements:
Build:
Documentation:
Tests:
Chores: