跳到正文
DEV Community· Ibrahim Pima·· 14 小時前AI 評分40

Calmo 助你在情緒壓力影響一天前平復心情

Calmo helps you fix your emotional stress before it ruins your day.

AI 導讀

Calmo 結合 SmartSpectra SDK,以 webcam 讀取呼吸、脈搏、心率變異及面部表情,協助用戶在考試、面試或演講前平復壓力。用戶可選擇呼吸節奏,並由教練根據即時數據提供一項具體行動建議。Calmo 可作為 Mac app 或本機網頁應用程式使用,無須穿戴裝置或帳戶。

正文

This is a submission for the Presage SmartSpectra SDK Challenge

What I Built

Calmo is for the ten minutes before something that matters: an exam, a job interview, a talk. Your heart is racing, your breathing is shallow, and a generic breathing timer isn't going to tell you if anything is actually changing.

Calmo

You sit in front of your webcam and Calmo reads your breathing, pulse, heart rate variability and facial expression with the SmartSpectra SDK. It shows how you're doing on a ring around your face, paces your breathing, and a coach tells you one thing to do right now to settle down.

What you see:

  • A round live camera with a breathing ring around it. The ring grows as you breathe in and shrinks as you breathe out. You can pick one of three guides: Steady (5 in, 5 out), Long exhale (4 in, 6 out) or Box (4, 4, 4, 4).
  • A state ring that shifts from red to green as you go through Anxious, Angry, Stressed, Tense, Settling and Calm. A box tracks your face inside the circle.
  • A "You started / Right now" strip, so you can watch yourself go from Anxious to Calm.
  • A coach that reads your live numbers and gives you one concrete action, then checks in with you after the session about what changed. You can pick the coach model from a dropdown.
  • A short onboarding the first time you open the Mac app: three animated screens on what stress does to your day, how Calmo reads you, and how you breathe your way back to calm.

Calmo runs from one codebase in two ways: as a Mac app (Electron) and as a local web app (Vite, TanStack Router and Query, TypeScript).

Onboarding: It ruins a whole day
Onboarding: the state ring
Session setup with the round camera
Settings with keys and the coach model picker

Demo

TODO: add your demo video link here.

Code

https://github.com/fozagtx/Calmo

  • Mac app (Apple Silicon): download the DMG from Releases
  • Web app: npm install, add your keys to .env, then npm run dev

The README has setup steps for both.

How It Responds to Human Signals

Calmo asks SmartSpectra for three groups of metrics: breathingMetrics, cardioMetrics and faceMetrics.

Signal Ready after What Calmo does with it
Pulse rate about 12 s Shown live. 88 bpm or higher pushes your state toward Tense or Stressed. A drop of 4 bpm below your starting pulse counts toward Calm.
Breathing rate about 30 s Compared with the guide you picked. You see live whether you're on pace, faster or slower, and the summary shows how long you stayed on pace.
Chest breathing trace about 30 s Drawn as a live 20 second waveform, so you can see yourself following the ring.
HRV (RMSSD) about 60 s Shown live, and the summary compares your start and end values.
Expressions live Fear or surprise reads as Anxious. Anger, contempt or disgust reads as Angry. Happy counts toward Calm.
Blinking and talking live Blinks per minute and whether you're talking get passed to the coach as context.
Face landmarks live Turned into a rounded box that follows your face inside the circle, coloured by your state.

The state ring

Every time a metrics packet comes in, Calmo scores your expression, breathing and pulse together. A new state has to hold for 3 seconds before the ring changes colour, so it doesn't flicker. Calmo remembers your first steady state, and when you get to Calm from Anxious, Angry, Stressed or Tense, it tells you: "You went from Anxious to Calm."

Only steady readings count

Calmo checks each sample's stable flag and confidence. It shows a warm-up countdown until each metric has enough data, and it shows the SDK's validationStatus hint (like "No face found") under the camera exactly as the SDK sends it.

The coach

When you ask for help, Calmo sends the coach model (OpenServ SERV Reasoning, gpt-5.4-mini) only numbers and labels: breathing rate, pulse, HRV, expression, blink rate, your current and starting state, your breathing guide and your message. It answers in two to four sentences with one thing to do, like stretching your exhale to match the ring, dropping your shoulders, or saying a grounding line. When the session ends, it gets your start and end averages and checks in with you.

How I integrated the SmartSpectra SDK

  • Mac app. The renderer uses @smartspectra/node-sdk/renderer, the main process calls bindSmartSpectraIpc(window), and Calmo's preload bundles @smartspectra/node-sdk/preload alongside its own small bridge. The SDK grabs the camera, emits streamAvailable for the round preview, and processes frames in the main process. The packaged app ships the native runtime as an extra resource and points SMARTSPECTRA_CAPI_PATH to it.
  • Web app. The browser captures the camera, draws frames to a canvas and streams RGBA frames with monotonic microsecond timestamps over a local WebSocket. The Node SDK runs with useCustomInput() and sendFrame(). Metrics come back as raw protobuf and get decoded in the browser with decodeMetrics from @smartspectra/node-sdk/messages.
  • Both. The two paths expose the same events (processingStatus, validationStatus, metrics, error), so the UI doesn't care which one is running. If there's a retryable error, like a short network drop, Calmo calls reset() and start() again, up to 3 times, without losing your readings.

Prize Categories

Best Thoughtful Real-World Use.

Exam, interview and stage nerves are really common, and they hit at a predictable moment: a few minutes before, usually when you're alone with a laptop. Most breathing apps give everyone the same timer and never check if it's working. Calmo does check. It measures whether your breathing matches the guide, whether your pulse is coming down and whether your face has relaxed, and it tells you in plain words.

It's built for that moment:

  • No wearable and no account. A normal webcam is enough.
  • One screen with one thing to look at. Your face sits inside the breathing ring.
  • Plain words. States are things people actually say, like Anxious, Tense and Calm, not scores.
  • Honest warm-up. Readings stay grey with a countdown until they're steady, instead of showing shaky early numbers.
  • Quick. Three to five minutes before you walk in.

Consent and Data Handling

Camera consent

  • Nothing starts until you press Start session.
  • Mac app: macOS shows its own camera permission prompt with Calmo's reason ("Calmo uses your camera to read breathing, pulse and expression on this Mac. Video never leaves your computer."). Inside the app, only Calmo's own bundled page can use the camera, video only and never the microphone. Navigating to outside pages is blocked.
  • Web app: you get the browser's normal camera prompt. The page asks for video only, no audio.
  • End session turns the camera off right away.

What happens to the video

  • Video is processed on your computer. It's never recorded, saved or uploaded.
  • In the web app, frames go from the browser to the Node process on the same machine over localhost and are thrown away after processing.

What gets stored

  • Calmo saves no video, no vitals and no session history. Readings, chat and the summary only live in memory and are gone when you start a new session or close the window.
  • API keys: on the Mac they're encrypted with macOS safeStorage (backed by your login keychain) in Calmo's app data folder. In the web app they live in a local .env file that git ignores.

SDK network use and telemetry

  • The SmartSpectra SDK only contacts Presage to validate the API key and subscription. Metrics are computed on your device.
  • Calmo turns SDK telemetry off (enableTelemetry: false), so no session summaries or readiness reports get sent.

Optional AI coach

  • The coach is optional. It only runs if you've added an OpenServ key and send a message, or when a session ends.
  • It gets numbers and labels (breathing rate, pulse, HRV, expression, blink rate, estimated state, breathing guide) plus whatever you type. It never gets video, images or face data.
  • Those requests are handled by OpenServ under its own terms.

Not medical

Calmo gives general wellness feedback only. It doesn't diagnose or treat anything or make medical decisions. The coach is told not to give medical advice, and the state ring is an estimate, not an assessment. There's no hidden monitoring either: the camera only runs while you can see yourself in the circle.

Agent Session

Post not found or has been removed.

來源:DEV Community · dev.to