Skip to content

feat(core): mock roAudioGuide, roTextToSpeech, roMicrophone, roDSA and roRSA#956

Merged
lvcabral merged 2 commits into
masterfrom
feat/mock-tts-signing-components
Jun 21, 2026
Merged

feat(core): mock roAudioGuide, roTextToSpeech, roMicrophone, roDSA and roRSA#956
lvcabral merged 2 commits into
masterfrom
feat/mock-tts-signing-components

Conversation

@lvcabral

Copy link
Copy Markdown
Owner

Summary

Adds mock implementations for five previously-unimplemented BrightScript components so apps that reference them no longer crash (CreateObject was returning invalid, and any subsequent method call raised a runtime error). This follows the same compatibility approach already used for roStreamSocket, roDataGramSocket, Channel Store, etc.

Each component registers its documented interface methods (per the external/dev-doc spec) and returns safe, static values, but performs no real work — no actual speech, recording, or cryptographic signing:

Component Interface(s) Mock behavior
roAudioGuide ifAudioGuide Say returns incrementing IDs, Flush no-op, Silence echoes the duration
roTextToSpeech ifTextToSpeech + message port getters return stored state (volume=1000, rate=0, pitch=0, language="en-US"), IsEnabled false, empty voice/language lists
roMicrophone ifMicrophone + message port capture methods report failure ("no microphone")
roDSA ifDsa invalid keys, Sign→invalid, Verify→0
roRSA ifRSA invalid keys, Sign→invalid, Verify→0

The two message-port components hold a port? field with dispose() cleanup but never post events (the mock never speaks/records), so no event classes were added.

Changes

  • New components under src/core/brsTypes/components/
  • Registered in BrsObjects.ts and re-exported from brsTypes/index.ts
  • One test suite per component under test/brsTypes/components/ (29 tests)
  • docs/limitations.md: moved these out of "not implemented yet" into the Mocked Components section

Testing

  • npm run lint + prettier clean
  • npm run build:cli / build:sg compile
  • Full suite green: 127 suites, 1866 tests passed (2 todo, 0 failures)

🤖 Generated with Claude Code

lvcabral and others added 2 commits June 21, 2026 08:51
…d roRSA

Add mock implementations for these previously-unimplemented components so
apps that use them no longer crash when CreateObject returns invalid. Each
exposes its documented interface methods returning safe static values, but
performs no real speech, recording or cryptographic signing:

- roAudioGuide (ifAudioGuide)
- roTextToSpeech (ifTextToSpeech + message port)
- roMicrophone (ifMicrophone + message port)
- roDSA (ifDsa)
- roRSA (ifRSA)

Wire them into the BrsObjects registry and brsTypes re-exports, add a test
suite per component, and update docs/limitations.md to move them into the
Mocked Components section.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Address SonarQube S2933: the `port` field in RoTextToSpeech and RoMicrophone
is never reassigned from within the class (the assignment is performed by the
IfSetMessagePort helper through an any-typed reference), so it can be declared
readonly without affecting the setMessagePort behavior.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@lvcabral lvcabral merged commit a8ecade into master Jun 21, 2026
3 checks passed
@lvcabral lvcabral deleted the feat/mock-tts-signing-components branch June 21, 2026 15:57
@sonarqubecloud

Copy link
Copy Markdown

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