dsh-classroom-mobile: Mobile browser recording + Local transcription + Post-class organization DSH workflow plugin

Introduction

In classroom scenarios, recording is easy, but post-recording organization is hard. For a one-hour class, manually organizing it into a summary, mind map, and practice questions is costly; handing it directly to a general-purpose Agent lacks context like “what was covered in this class” or “if the wrong questions have been corrected.” dsh-classroom-mobile targets this step: mobile browser recording, local Whisper transcription, then generation of summaries, mind maps, and practice questions by the DSH Agent, closed off by a mistake correction gate for review.

First, let’s be clear about what it is: a DSH / cordis plugin maintained by chengyu-xin1, categorized as a workflow, currently 0 stars. It does not package an APK or create a native App. Its approach is to start an HTTP service on the PC side, which is accessed by the mobile browser.

What is it

One-sentence positioning: Adding a “Classroom Learning” workflow to DSH, covering the entire chain of recording, transcription, summarization, review, and focus report.

It solves three specific problems:

  • No structured output after recording;
  • Review has no constraints; you can continue recording regardless of whether wrong questions are corrected;
  • The mobile side lacks a DSH mobile app, so a usable entry point in the mobile browser is needed.

The boundaries are explicitly written in the README, worth remembering first: DSH is a desktop application and has no mobile version; the mobile side equals a mobile browser accessing the service started by this plugin on the PC. The focus function only detects, records, and reports; it will not lock the phone or force focus. The plugin has zero npm dependencies, uses only Node built-in modules, and transcription calls local ffmpeg and python.

Installation and Enablement

Install from the DSH Plugin Market, execute in the command line after approval:

dsh plugin --profile desktop add github:chengyu-xin1/dsh-classroom-mobile

Manual installation is suitable for local development or offline environments. First, put the entire directory to D:\dsh-classroom-mobile, then copy it to the DSH profile’s plugin directory:

Copy-Item -Recurse -Force "D:\dsh-classroom-mobile" `
  "$env:USERPROFILE\.dsh\profiles\desktop\node_modules\dsh-classroom-mobile"

Then add the package name to the end of the dsh.profile.bundles array in the profile’s package.json, adding "dsh-classroom-mobile". Finally, restart DSH. The plugin’s apply() will automatically start a service on 0.0.0.0:8765, incrementing the port from 8765 if occupied.

To install on another computer or for someone else, first run the environment preparation script:

powershell -ExecutionPolicy Bypass -File scripts\setup.ps1

It checks and prepares Node, Python, and ffmpeg sequentially, installs faster-whisper (Tsinghua mirror), downloads the Whisper small model (approx 460 MB), and downloads cloudflared. Failure at any step does not affect plugin usability, only corresponding capabilities are missing: without faster-whisper, text can be manually pasted; without cloudflared, only LAN is available. Use -SkipModel, -SkipCloudflared to skip downloads.

Mobile Access: Public Tunnel and LAN

When the plugin starts, it uses cloudflared to establish a temporary HTTPS tunnel; the phone can access it via mobile data or on another Wi-Fi:

https://xxxx-xxxx-xxxx.trycloudflare.com

HTTPS also solves the restriction of mobile browsers “not being able to call the microphone in a non-secure context.” cloudflared.exe is about 53 MB; it is not packaged in the repository. It is automatically downloaded to data\bin\cloudflared.exe on the first plugin startup, preferring the ghfast mirror; the page is usable normally even if the download fails, just without a public address. You can also place a copy manually:

New-Item -ItemType Directory -Force D:\dsh-classroom-mobile\data\bin | Out-Null
Invoke-WebRequest -Uri https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-windows-amd64.exe `
  -OutFile D:\dsh-classroom-mobile\data\bin\cloudflared.exe

Non-local access requires a 6-digit access code stored in data\access.json. The first time the mobile page opens, a pop-up input box appears, or you can ask directly in DSH “What is the mobile access code?”. The quick tunnel address may change every time DSH is restarted; just ask “What is the mobile access address” at any time. The tool classroom_mobile_url returns the latest address plus the access code. Close the tunnel using the environment variable DSH_CLASSROOM_MOBILE_TUNNEL=0, restart, and only use the LAN afterwards.

If the tunnel does not start, you can use the LAN address when the computer and phone are connected to the same Wi-Fi:

http://<电脑局域网 IP>:8765

Note that under LAN HTTP, some mobile browsers may refuse recording (non-secure context); in this case, prioritize the public HTTPS address. All business data is only written to D:\dsh-classroom-mobile\data and is not uploaded to the cloud.

Recording, Transcription, and Post-class Organization Process

The usage process in order is:

  1. Phone opens the page, fills in the course title in the “Recording” page, and clicks “Start Class”. Browser requests microphone permission; during recording, chunks are automatically uploaded every 30 seconds, and the server transcribes them piece by piece.
  2. The subtitle area in the recording page refreshes the latest 5 segments of transcription every 3 seconds. When the transcription engine is not ready, the page prompts “Transcription engine not ready, manual text paste available” and provides a fallback paste box; audio is still saved normally.
  3. Click “End and Organize” to stop recording and end the focus timer.
  4. In the DSH dialog box, say “Generate summary and mind map for this class”. The Agent calls classroom_mobile_digest, generates 5 timestamped key points, a mermaid mind map, 3 knowledge extensions, and 5 questions of increasing difficulty, writing them to the question file.
  5. Phone switches to the “Summary / Mind Map / Review” page and refreshes to see them.
  6. After answering on the review page, let the Agent grade in DSH (classroom_mobile_grade). When the number of unanswered wrong questions is greater than 0, starting a new recording is not allowed on the mobile side, and the server also returns 409.
  7. After class, in DSH, say “End focus / Look at focus report”. classroom_mobile_focus outputs total duration, number of switches and accumulated leave time, longest continuous focus, and number of Pomodoros.

The transcription engine degrades sequentially. First install dependencies:

python -m pip install faster-whisper

For campus networks, it is recommended to add the Tsinghua mirror. The first transcription will download the small model (int8, approx 460 MB) to data\models, and the script defaults to HF_ENDPOINT=https://hf-mirror.com. If pip installation fails, model download fails, or python/ffmpeg is unavailable, the audio is still saved, transcript.md writes “[Text to be transcribed]”, and /api/state returns asrAvailable=false. Under no circumstances will fake transcription text be generated.

HTTP Interfaces and Data Directory

The plugin comes with a set of HTTP interfaces; the mobile page is its client:

Method Path Description
GET / Single-file mobile page (embedded CSS/JS, Chinese, four tabs)
GET /api/state Current session, recording duration, number of pending wrong questions, ASR status, port
POST /api/session/start {title} new session; returns 409 if there are uncorrected wrong questions
POST /api/audio Binary audio chunks, saved to disk and transcribed asynchronously
GET /api/live Latest 5 segments of transcription (page polls every 3 seconds)
GET /api/summary Content of summary.md / mindmap.md
POST /api/quiz/answer {index, answer} answer on mobile side
GET /api/quiz/pending Uncorrected wrong questions (latest occurrence for the same question, correct=true dequeues)
GET /api/quiz/questions List of questions and answering status
POST /api/focus/event {type: start\|leave\|return\|stop} focus events
POST /api/transcript/manual {text} manual paste when ASR is unavailable

The data directory structure is fixed:

D:\dsh-classroom-mobile\data\
  current.json                     # Current session pointer
  models\                          # faster-whisper model cache
  sessions\<yyyy-mm-dd>-<标题>\
    meta.json                      # Recording start/end times, chunk status
    audio\chunk-000.webm ...       # Original recording chunks
    transcript.md                  # Incremental transcription, "[mm:ss] text" per segment
    summary.md                     # Summary generated by Agent
    mindmap.md                     # Mermaid mind map generated by Agent
    quiz.jsonl                     # Question generation / answering / grading records
    focus.jsonl                    # Focus events (start/leave/return/stop)

To verify the service even if you forget DSH, use the built-in scripts:

node --check src\index.js
node scripts\dev-server.js    # Start service directly without DSH
node test\e2e.mjs              # End-to-end: upload -> transcribe -> summarize -> mistake gate -> focus report

test\e2e.mjs writes an “automated acceptance test” session to the real data directory and cleans up after running.

Use Cases and Notes

Suitable for developers or researchers who want to use DSH in the classroom and are willing to set up the recording and transcription chain themselves: record a class, and automatically get a summary, mind map, practice questions, and focus report after class; the review loop is enforced by the mistake correction gate.

Points to note:

  • The plugin runs with the permissions of the current DSH process. Before installation, you should check the source code and license (MIT); do not install directly into a production environment without reviewing it.
  • The service is only used within the LAN, has no login authentication, and should not expose the port to the public; the tunnel address has an access code fallback, but do not publish it publicly.
  • The Fullscreen API is often rejected on mobile phones; failures are silently ignored and do not affect recording.
  • Switching the browser to the background may cause the system to pause recording. The project only records visibilitychange and does not guarantee continuous recording in the background.
  • The recording encoding and background behavior of real devices (iOS Safari / Android Chrome / WeChat built-in) are not covered by automated testing and require real device verification.
  • The focus report only reflects changes in page visibility and cannot prove “no distraction,” nor is it an anti-addiction tool.

Conclusion

The value of this plugin lies not in the recording itself, but in bridging the gap between “recording finished” and “review finished”: local transcription does not go through third parties; summaries and mind maps are handed to the DSH Agent; starting a new class recording is not allowed until mistakes are corrected. For those working in classroom scenarios, this is a workflow that can be directly assembled into DSH. The directory page is at https://www.skillhub.cn/plugins/chengyu-xin1/dsh-classroom-mobile , and the source code is at https://github.com/chengyu-xin1/dsh-classroom-mobile .

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye