Skip to content

Feat/speech - #4

Merged
grokify merged 16 commits into
mainfrom
feat/speech
Nov 2, 2026
Merged

grokify merged 16 commits into
mainfrom
feat/speech

Conversation

@grokify

@grokify grokify commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features
    • Added browser-based speech tools for reading text aloud and converting speech to text, with React hooks and a standalone browser build.
    • Added voice selection, long-text handling, optional word tracking, and controls for stopping, pausing, and resuming speech.
  • Documentation
    • Added setup and usage guides covering read-aloud, voice input, browser support, permissions, and speech errors.
    • Updated package listings and changelogs with the v0.6.0 release details.

grokify and others added 11 commits November 2, 2026 07:52
speak and listen wrap the Web Speech API with the handling browsers need:
long text split into short utterances, a cancel before new speech and a
retry when Chrome accepts speech but never starts it, pausing without the
browser's pause, and continuous listening restarted until stopped. React
hooks (useSpeech, useListen, useVoices) are in @plexusone/speech/react,
and a standalone build exposes window.PlexusSpeech.

Refs: RMI-SYSTEMFORGEWEB-031
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs: RMI-SYSTEMFORGEWEB-031
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs: RMI-SYSTEMFORGEWEB-031
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
speak takes onWord, called with each word's segment and its start and
end offsets in the text passed, mapped back through chunking and
whitespace collapsing. A boundary without a length runs to the next space
or punctuation. useSpeech keeps the current word in word when trackWords
is set; it is off by default because it re-renders on every word.

Refs: RMI-SYSTEMFORGEWEB-031
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs: RMI-SYSTEMFORGEWEB-031
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs: RMI-SYSTEMFORGEWEB-031
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Chrome includes trailing punctuation in a word's length while Safari
gives no length, so the two marked different spans. Punctuation is now
trimmed from both ends of every word, a closing apostrophe is kept, and
a piece that is only punctuation is not reported.

Refs: RMI-SYSTEMFORGEWEB-031
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs: RMI-SYSTEMFORGEWEB-031
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A dash, an ellipsis or a symbol spoken on its own was reported as a
word. A word now needs a letter or digit, and dashes are trimmed from
its ends like other punctuation.

Refs: RMI-SYSTEMFORGEWEB-031
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs: RMI-SYSTEMFORGEWEB-031
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@plexusone/speech is added at 0.1.0.

Refs: RMI-SYSTEMFORGEWEB-031
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 42 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 10262e1a-0943-49bd-a118-f6dcc5c785bf
Commits

Reviewing files that changed from the base of the PR and between afbaa2b and 96373cd.

Files selected for processing: 9
  • docs/guides/read-aloud.md
  • docs/packages/speech.md
  • docs/releases/v0.6.0.md
  • packages/speech/src/__tests__/fakes.ts
  • packages/speech/src/__tests__/recognition.test.ts
  • packages/speech/src/__tests__/synthesis.test.ts
  • packages/speech/src/recognition.ts
  • packages/speech/src/synthesis.ts
  • packages/speech/tsup.config.ts
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 474b9753-1cf2-4e16-9a3b-60ae6ade1eb6
Commits

Reviewing files that changed from the base of the PR and between 16995a7 and afbaa2b.

Files ignored due to path filters: 1
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing: 25
  • CHANGELOG.json
  • CHANGELOG.md
  • README.md
  • docs/changelog.md
  • docs/guides/read-aloud.md
  • docs/packages/index.md
  • docs/packages/speech.md
  • docs/releases/v0.6.0.md
  • mkdocs.yml
  • packages/speech/README.md
  • packages/speech/package.json
  • packages/speech/src/__tests__/fakes.ts
  • packages/speech/src/__tests__/react.test.tsx
  • packages/speech/src/__tests__/recognition.test.ts
  • packages/speech/src/__tests__/synthesis.test.ts
  • packages/speech/src/__tests__/text.test.ts
  • packages/speech/src/errors.ts
  • packages/speech/src/index.ts
  • packages/speech/src/react.ts
  • packages/speech/src/recognition.ts
  • packages/speech/src/synthesis.ts
  • packages/speech/src/text.ts
  • packages/speech/tsconfig.json
  • packages/speech/tsup.config.ts
  • vitest.config.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

Adds @plexusone/speech with browser speech synthesis and recognition APIs, React hooks, text chunking, voice selection, and a standalone browser build. The change also adds tests, package documentation, a read-aloud guide, and v0.6.0 release notes.

Changes: Speech package

Layer / File(s) Summary
Text chunking and speech synthesis
packages/speech/src/text.ts, packages/speech/src/synthesis.ts, packages/speech/src/errors.ts, packages/speech/src/index.ts, packages/speech/src/__tests__/fakes.ts, packages/speech/src/__tests__/text.test.ts, packages/speech/src/__tests__/synthesis.test.ts
Adds text chunking with source-position mapping, speech playback controls, voice selection, word-boundary reporting, and speech error handling. Tests cover chunking, playback, voice loading, and speech events.
Browser speech recognition
packages/speech/src/recognition.ts, packages/speech/src/__tests__/fakes.ts, packages/speech/src/__tests__/recognition.test.ts
Adds recognition configuration, transcript updates, continuous-session restart, silence limits, and stop and abort controls. Tests cover results, session endings, errors, and unsupported recognition.
React speech hooks
packages/speech/src/react.ts, packages/speech/src/__tests__/react.test.tsx
Adds useVoices, useSpeech, and useListen. The hooks expose speech and recognition state, support status, controls, and cleanup behavior.
Package entry points and builds
packages/speech/package.json, packages/speech/tsconfig.json, packages/speech/tsup.config.ts, vitest.config.ts, packages/speech/README.md
Defines package entry points, build settings, and a test alias. The package README documents installation and entry points.
Package documentation and release
docs/packages/speech.md, docs/guides/read-aloud.md, docs/releases/v0.6.0.md, docs/packages/index.md, mkdocs.yml, CHANGELOG.json, CHANGELOG.md, docs/changelog.md, README.md
Adds speech package and read-aloud documentation, includes the package and release in documentation navigation and package listings, and records the v0.6.0 release.

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Application
  participant useSpeech
  participant speak
  participant SpeechSynthesis
  Application->>useSpeech: provide speech input and options
  useSpeech->>speak: start speech
  speak->>SpeechSynthesis: enqueue utterance
  SpeechSynthesis-->>speak: report utterance events
  speak-->>useSpeech: report state and completion
  useSpeech-->>Application: expose updated hook state
Loading
sequenceDiagram
  participant Application
  participant useListen
  participant listen
  participant SpeechRecognition
  Application->>useListen: start recognition
  useListen->>listen: provide recognition options
  listen->>SpeechRecognition: start recognition session
  SpeechRecognition-->>listen: report transcript and session events
  listen-->>useListen: report results and completion
  useListen-->>Application: expose transcript and listening state
Loading
Merge Risk: Moderate · previous review afbaa

The speech package works for the common paths, but a few issues should be handled before release. Dictation on Android Chrome may duplicate transcript text. Mixing the main and React entry points splits speech state. The standalone browser build could be deleted during a build. The docs should not imply that dictation stays on-device.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 55.88% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title identifies the speech feature, which is the main change in the pull request. It is concise but uses shorthand and does not name the @plexusone/speech package.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 55.88% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 34 functions across 13 files. (12 skipped: 12 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Fix comments: Fix CodeRabbit comments on this PR

Comment thread docs/guides/read-aloud.md Resolved
Comment thread docs/packages/speech.md Resolved
Comment thread docs/packages/speech.md Resolved
Comment thread packages/speech/src/recognition.ts Resolved
Comment thread packages/speech/src/synthesis.ts Resolved
Comment thread packages/speech/tsup.config.ts Resolved
Comment thread packages/speech/tsup.config.ts Resolved
grokify and others added 5 commits November 2, 2026 09:04
With splitting off, the main and React entry points each bundled their own copy of the speaking code, so stopSpeaking() and new speech from one could not see speech started through the other. Both now load one shared chunk. The two builds run at once, so the module build no longer cleans the standalone build's file.

Refs: RMI-SYSTEMFORGEWEB-031
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Chrome on Android marks each partial result final with confidence 0, so dictation appended every partial result and repeated the text. Those results now stay interim, and interim text left when a session ends is kept, so nothing is lost on a browser that never sends a final result.

Refs: RMI-SYSTEMFORGEWEB-031
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… length

Without a word length, as in Safari, a word ran only to the next punctuation, so "don't" was marked as "don" and "3.5" as "3". It now runs to the next space or dash, and punctuation at its ends is trimmed as before.

Refs: RMI-SYSTEMFORGEWEB-031
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n's end and word ends

Refs: RMI-SYSTEMFORGEWEB-031
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… button

Chrome sends dictation audio to Google's speech service, so the docs no longer say there is no service. The highlighting example starts speech from a button, and the guide's start-timeout message reads the error of the hook that started the speech.

Refs: RMI-SYSTEMFORGEWEB-031
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@grokify
grokify merged commit 92adc4d into main Nov 2, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant