📄
pasted-code-1794034236764.txt
txt
184 lines
▶
# Build: Private Transcript — Chrome Extension
## Objective
Build a polished, privacy-first Chrome extension that transcribes browser-based meetings in real time.
The extension must process all meeting audio locally on the user's device. Meeting audio and transcripts must never be uploaded to external servers.
This is a functional product, not a UI prototype.
## 1. Platform and architecture
- Google Chrome.
- Chrome Extension Manifest V3.
- Use a maintainable, modern frontend architecture.
- Use TypeScript where appropriate.
- Use Chrome's tabCapture API for browser tab audio capture.
- Use an offscreen document where necessary for audio processing.
- Use a genuinely local speech-to-text engine.
- Investigate Whisper.cpp / whisper.cpp WebAssembly and suitable quantized models.
- Use IndexedDB for persistent transcript storage.
Do not use Chrome Web Speech API as the transcription engine because it does not guarantee local processing.
Choose the most reliable architecture for Chrome MV3 and document important technical decisions.
## 2. Core functionality
### Meeting capture
- Allow users to start and stop transcription manually.
- Capture audio from the selected browser meeting tab.
- Display clear recording status.
- Show elapsed recording time.
- Handle unsupported tabs and capture errors gracefully.
- Do not automatically record meetings.
### Live transcription
- Transcribe captured audio locally.
- Display transcript text as processing progresses.
- Preserve timestamps.
- Handle audio in manageable chunks.
- Avoid losing transcript segments when processing is interrupted.
- Support configurable transcription language where the engine allows it.
### Transcript management
- Automatically save completed transcripts locally.
- Allow users to edit transcript text.
- Display meeting title, date, duration, and timestamps.
- Provide searchable meeting history.
- Allow individual transcripts to be deleted.
### Export
Support:
- TXT
- SRT
- VTT
Ensure exported timestamps and formatting are valid.
## 3. Privacy and security requirements
Privacy is a core architectural requirement.
- No cloud transcription APIs.
- No external AI services.
- No automatic audio uploads.
- No analytics or tracking.
- No unnecessary permissions.
- No mandatory user accounts.
- No remote scripts or remotely hosted application code.
- No synchronization of meeting data.
- Store recordings and transcripts locally only.
- Provide clear controls for deleting stored data.
- Do not retain raw audio after processing unless the user explicitly enables an optional local recording feature.
Model acquisition must be transparent. If a model needs downloading, obtain explicit user approval and explain its source and size. Alternatively, support importing a local model.
After model setup, transcription must work offline.
## 4. Interface and design
Create a polished, minimalist dark interface.
Design principles:
- Clean and professional.
- Compact extension popup.
- Excellent typography and spacing.
- Subtle accent color.
- Clear recording indicators.
- Responsive layout.
- No unnecessary gradients or decorative cards.
### Extension popup
Include:
- Current tab information.
- Start Transcribing button.
- Recording status.
- Elapsed time.
- Live transcript preview.
- Stop and Save controls.
- Link to transcript library.
### Transcript dashboard
Include:
- Meeting history.
- Search.
- Transcript viewer.
- Timestamps.
- Editing functionality.
- Export controls.
- Delete controls.
### Privacy settings
Include:
- Local processing status.
- Model information.
- Storage usage.
- Data deletion controls.
## 5. Scope restrictions
Do NOT implement these in V1:
- AI summaries.
- Action item extraction.
- Cloud synchronization.
- User accounts.
- Team collaboration.
- Calendar integration.
- Microphone recording.
- Automatic meeting recording.
- Speaker diarization.
Keep the architecture extensible without implementing these features prematurely.
## 6. Reliability requirements
- Handle permission errors.
- Handle unsupported browser tabs.
- Handle missing or invalid speech models.
- Handle transcription interruptions.
- Prevent duplicate transcript segments.
- Handle browser popup closure without losing active transcription.
- Handle service worker suspension correctly.
- Ensure audio processing does not freeze the UI.
- Prevent accidental data loss.
## 7. Acceptance criteria
The MVP is complete only when:
1. The extension installs successfully in Chrome.
2. A user can select a supported meeting tab.
3. The user can manually start transcription.
4. Meeting audio is captured successfully.
5. Speech is transcribed using a genuinely local engine.
6. Transcription works without an internet connection after model setup.
7. Transcript segments include timestamps.
8. Stopping transcription saves the transcript.
9. Saved transcripts survive browser restarts.
10. Users can search, edit, export, and delete transcripts.
11. No meeting audio or transcript content is sent externally.
12. The interface communicates recording and privacy status accurately.
## 8. Development instructions
Before implementation:
1. Inspect the existing repository and environment.
2. Identify technical limitations of Chrome MV3 audio capture.
3. Evaluate local speech recognition engines and model requirements.
4. Select an architecture that works on modest hardware.
5. Present a concise implementation plan.
Then implement the MVP in manageable phases.
Do not fake features, substitute cloud services, or use placeholder transcription results.
Run available builds and tests. Verify actual functionality wherever possible.
If a feature cannot be implemented reliably, explain the limitation instead of pretending it works.
Keep the code maintainable, modular, and easy to extend.
**Final goal:** A reliable, genuinely private Chrome meeting transcription extension that works locally and does one job exceptionally well.
The functional MVP is blocked: whisper.cpp isn’t supported on Kodari yet. You can ask @serbob on Discord to add support for it. The available libraries don’t provide a local speech-to-text engine, so I can’t honestly implement or verify transcription under these constraints.
The intended architecture is tabCapture → offscreen audio processing → local recognition worker → IndexedDB, with a locally imported model. Tab capture also requires restoring audio playback, and model size and processing speed depend on the chosen model and device.
I haven’t created a UI-only substitute or claimed the acceptance criteria are met.
📄
pasted-code-1794034371711.txt
txt
56 lines
▶
# Technical Feasibility Investigation — Private Transcript
The original implementation was blocked because whisper.cpp is not supported by the environment.
Do not abandon the project. Investigate alternative fully local speech-to-text engines that can run inside a Chrome Manifest V3 extension.
## Candidates to investigate
1. Transformers.js with a compatible quantized Whisper model.
2. sherpa-onnx WebAssembly with a streaming ASR model.
3. Vosk Browser / Vosk WebAssembly.
## Requirements
- 100% on-device inference.
- No cloud APIs or remote transcription services.
- Must work offline after model setup.
- Compatible with Chrome Manifest V3.
- Must work inside an extension using an offscreen document or dedicated worker.
- Must process audio from chrome.tabCapture.
- Must support continuous or near-real-time transcription.
- Must preserve timestamps.
- Must be realistic for a modest laptop with 8GB RAM.
## Investigation tasks
1. Check actual library compatibility and installation availability.
2. Identify compatible speech recognition models.
3. Estimate model download size and runtime memory requirements.
4. Investigate CPU/WASM performance and optional WebGPU acceleration.
5. Determine whether streaming recognition is supported.
6. Investigate audio preprocessing requirements, including sample rate conversion.
7. Verify that all runtime dependencies and model files can be stored and loaded locally.
8. Identify Chrome MV3 restrictions and possible workarounds.
## Deliverable
Provide a comparison table covering:
- Recognition quality.
- Streaming capability.
- Model size.
- Memory requirements.
- CPU performance.
- Browser compatibility.
- Integration complexity.
- Offline guarantees.
Then recommend the best candidate.
Do not implement the full extension yet.
If possible, create a tiny technical proof of concept that accepts an audio sample and produces an actual transcript locally.
Do not fabricate benchmark results or claim successful functionality without testing.
**Goal:** Find a technically viable replacement for whisper.cpp without compromising our privacy requirements.
Feasibility comparison
All three candidates have browser-oriented options for local inference, but none is currently available in Kodari’s supported library list. That blocks a working proof of concept here. I can’t verify current package versions, model sizes, benchmarks, or extension compatibility without inspecting and testing those dependencies; the figures below are approximate, not measured results.
Criterion | Transformers.js + Whisper | sherpa-onnx WASM | Vosk browser/WASM |
|---|---|---|---|
Recognition quality | Whisper is generally strong, including multilingual speech; smaller models trade accuracy for speed | Depends heavily on model and language; streaming models may be less accurate than larger offline models | Depends on model and language; small models can be less accurate |
Streaming | Whisper is chunk-based, not inherently streaming; overlapping windows need deduplication | Streaming models available | Streaming recognition supported by suitable models |
Model size | Quantized Whisper tiny/base models are typically tens to hundreds of MB | Model-dependent; commonly tens to hundreds of MB | Small models are commonly tens of MB; larger ones can exceed hundreds of MB |
Memory | Model-dependent; allow substantially more than file size for runtime, tensors, and audio buffers | Model-dependent; WASM heap and intermediate buffers add overhead | Model-dependent; runtime memory exceeds compressed download size |
CPU performance | Can be slow for near-real-time use on modest laptops, especially with larger models | Streaming models are promising for CPU use, but need device-specific testing | Potentially practical with small models; needs device-specific testing |
Browser compatibility | Browser runtime exists; MV3 packaging, WASM, and any WebGPU path need validation | Browser/WASM builds exist; extension packaging needs validation | Browser/WASM builds exist; extension packaging needs validation |
Integration complexity | Moderate to high: chunking, overlap, timestamp handling, local asset configuration | High: package WASM and model files, manage streaming state and timing | Moderate to high: package runtime and model, manage streaming and timing |
Offline guarantee | Possible if all runtime and model assets are local and network fetching is disabled or blocked | Possible with locally packaged runtime and model | Possible with locally packaged runtime and model |
Recommendation
Investigate sherpa-onnx first, using a small streaming model appropriate for the target language. Its streaming architecture is a better fit for continuous meeting audio than repeatedly running a chunked Whisper model. That is a feasibility recommendation—not a claim that it will meet real-time performance or accuracy targets on an 8 GB laptop. Transformers.js with a quantized Whisper model is a useful alternative if multilingual quality matters more than low-latency CPU processing.
MV3 implementation considerations
Capture begins from an explicit user action. An offscreen document can consume a tab-capture stream while the popup is closed; captured tab audio must also be routed back to an audio output if the user should continue hearing it.
A local worker should perform inference away from the UI. Audio needs conversion from the capture format to the model’s required sample rate, channel count, and sample format; many ASR models use mono 16 kHz audio, but this must be checked per model.
WASM execution may require an extension-page CSP allowing
'wasm-unsafe-eval'. Runtime JavaScript and WASM must be bundled locally; remotely hosted executable code is not acceptable under MV3.Model files must also be available locally after explicit setup. Their loading method, storage limits, and whether a particular runtime fetches assets automatically must be tested. No transcript or audio should leave the device.
Segment timestamps should derive from the audio timeline, not inference completion time. Streaming results may be revised before finalization, so only finalized segments should be persisted as stable entries.
Proof of concept: I can’t create a genuine transcription test with the libraries currently supported here, and I haven’t run a benchmark or verified any candidate in this environment. The libraries Transformers.js, sherpa-onnx, and Vosk aren’t supported on Kodari yet. You can ask @serbob on Discord to add support for them!
give me a suggestion paragraph so i can copy paste. please.
Build a privacy-first Chrome Manifest V3 extension that captures meeting-tab audio only when I explicitly start it and transcribes it entirely on my device. Prioritize a small streaming sherpa-onnx model, provided Kodari adds support for the library; otherwise, explain the blocker rather than substituting a cloud service or fake results. Use an offscreen document for capture, a worker for inference, and IndexedDB for transcripts. Support timestamps, local model import, offline operation after setup, searchable and editable history, TXT/SRT/VTT exports, and deletion controls. Keep the interface compact and dark, request only necessary permissions, and document any unverified performance or compatibility limitations.
No files in this session