Files
wehub-resource-sync 426e9eeabd
Voice Workbench / headless workbench (mocked backends) (push) Has been cancelled
Voice Workbench / real acoustic lane (nightly, provisioned only) (push) Has been cancelled
ci / test (push) Has been cancelled
ci / lint-and-format (push) Has been cancelled
ci / build (push) Has been cancelled
ci / dev-startup (push) Has been cancelled
gitleaks / gitleaks (push) Has been cancelled
Markdown Links / Relative Markdown Links (push) Has been cancelled
Quality (Extended) / Homepage Build (PR smoke) (push) Has been cancelled
Quality (Extended) / Comment-only diff guard (push) Has been cancelled
Quality (Extended) / Format + Type Safety Ratchet (push) Has been cancelled
Quality (Extended) / Develop Gate (secret scan + UI determinism) (push) Has been cancelled
Quality (Extended) / Develop Gate (lint) (push) Has been cancelled
Chat shell gestures / Chat shell gesture + parity e2e (push) Has been cancelled
Cloud Gateway Discord / Test (push) Has been cancelled
Benchmark Bridge Tests / benchmark (bunx @biomejs/biome check packages/lifeops-bench/src, benchmark-lint) (push) Has been cancelled
Benchmark Bridge Tests / benchmark (bunx vitest run --config packages/lifeops-bench/vitest.config.ts --root packages/lifeops-bench --passWithNoTests, benchmark-tests) (push) Has been cancelled
Build Agent Image / build-and-push (push) Has been cancelled
Dev Smoke / bun run dev onboarding chat (push) Has been cancelled
Dev Smoke / Vite HMR dependency-level smoke (push) Has been cancelled
Electrobun Submodule Guard / electrobun gitlink is fetchable (push) Has been cancelled
Publish @elizaos/example-code / check_npm (push) Has been cancelled
Publish @elizaos/example-code / publish_npm (push) Has been cancelled
Publish @elizaos/plugin-elizacloud / verify_version (push) Has been cancelled
Publish @elizaos/plugin-elizacloud / publish_npm (push) Has been cancelled
Sandbox Live Smoke / Sandbox live smoke (push) Has been cancelled
Snap Build & Test / Build Snap (amd64) (push) Has been cancelled
Snap Build & Test / Build Snap (arm64) (push) Has been cancelled
Test Packaging / elizaos CLI global-install smoke (node + bun) (push) Has been cancelled
Cloud Gateway Webhook / Test (push) Has been cancelled
Cloud Tests / lint-and-types (push) Has been cancelled
Cloud Tests / unit-tests (push) Has been cancelled
Cloud Tests / integration-tests (push) Has been cancelled
Cloud Tests / e2e-tests (push) Has been cancelled
CodeQL Advanced / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Apps Worker (Product 2) / Determine environment (push) Has been cancelled
Deploy Apps Worker (Product 2) / Deploy apps worker to apps-control host (${{ needs.determine-env.outputs.environment }}) (push) Has been cancelled
Deploy Eliza Provisioning Worker / Determine environment (push) Has been cancelled
Deploy Eliza Provisioning Worker / Deploy worker to Hetzner host (${{ needs.determine-env.outputs.environment }} @ ${{ needs.determine-env.outputs.deployment_sha }}) (push) Has been cancelled
Dev Smoke / Classify changed paths (push) Has been cancelled
supply-chain / sbom (push) Has been cancelled
supply-chain / vulnerability-scan (push) Has been cancelled
Build, Push & Deploy to Phala Cloud / build-and-push (push) Has been cancelled
Test Packaging / Validate Packaging Configs (push) Has been cancelled
Test Packaging / Build & Test PyPI Package (push) Has been cancelled
Test Packaging / PyPI on Python ${{ matrix.python }} (push) Has been cancelled
Test Packaging / Pack & Test JS Tarballs (push) Has been cancelled
UI Fixture E2E / ui-fixture-e2e (push) Has been cancelled
UI Fixture E2E / fixture-e2e (push) Has been cancelled
UI Story Gate / story-gate (push) Has been cancelled
vault-ci / test (macos-latest) (push) Has been cancelled
vault-ci / test (ubuntu-latest) (push) Has been cancelled
vault-ci / test (windows-latest) (push) Has been cancelled
vault-ci / app-core wiring tests (push) Has been cancelled
verify-patches / verify patches/CHECKSUMS.sha256 (push) Has been cancelled
Voice Benchmark Smoke / voice-emotion fixture smoke (push) Has been cancelled
Voice Benchmark Smoke / voiceagentbench fixture smoke (push) Has been cancelled
Voice Benchmark Smoke / voicebench-quality unit smoke (push) Has been cancelled
Voice Benchmark Smoke / voicebench TypeScript unit (no audio) (push) Has been cancelled
Voice Benchmark Smoke / voice bench smoke summary (push) Has been cancelled
Windows CI / windows ([bun run --cwd packages/app-core test bun run --cwd packages/elizaos test bun run --cwd packages/cloud/shared test], app-and-cli) (push) Has been cancelled
Windows CI / windows ([bun run --cwd packages/scenario-runner test bun run --cwd packages/vault test bun run --cwd packages/security test bun run --cwd plugins/plugin-coding-tools test], framework-packages) (push) Has been cancelled
Windows CI / windows ([bun run --cwd plugins/plugin-elizacloud test bun run --cwd plugins/plugin-discord test bun run --cwd plugins/plugin-anthropic test bun run --cwd plugins/plugin-openai test bun run --cwd plugins/plugin-app-control test bun run --cwd plugins/pl… (push) Has been cancelled
Windows CI / windows ([node packages/scripts/run-turbo.mjs run build --filter=@elizaos/core --filter=@elizaos/shared --filter=@elizaos/agent --concurrency=4 node packages/scripts/run-bash-linux-only.mjs scripts/verify-riscv64-buildpaths.sh node packages/scripts/run… (push) Has been cancelled
Windows CI / windows ([node packages/scripts/run-turbo.mjs run typecheck --filter=@elizaos/core --filter=@elizaos/shared --filter=@elizaos/cloud-shared --concurrency=4 bun run --cwd packages/core test bun run --cwd packages/shared test], core-runtime, 75) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:43:05 +08:00
..

@elizaos/capacitor-mobile-signals

A Capacitor plugin that surfaces native mobile device state — wake/sleep, lock screen, battery, screen time, and health biometrics — to Eliza agents running in iOS and Android apps.

What it does

On iOS and Android the plugin reads native signals that are unavailable to ordinary web APIs:

  • Device state — whether the screen is active, idle, locked, or the app is backgrounded; battery charging status.
  • Health data — current sleep stage, biometrics (heart rate, HRV, respiratory rate, blood oxygen) from HealthKit (iOS) or Health Connect (Android).
  • Screen time — per-app usage summaries via Apple's DeviceActivity framework (iOS) or UsageStatsManager (Android).

In browser environments a web fallback is provided using document.visibilityState, window.focus/blur, and the Battery Status API. Health and screen-time capabilities return false on the web fallback.

Capabilities

Capability iOS Android Web
Device state (active/idle/locked) Yes Yes Partial (visibility/focus only)
Battery on/off charging Yes Yes Yes (Battery Status API)
Sleep stage / biometrics HealthKit Health Connect No
Screen time / usage DeviceActivity + FamilyControls PACKAGE_USAGE_STATS No
Background refresh Not available (foreground monitoring only) Not available No

Installation

npm install @elizaos/capacitor-mobile-signals
npx cap sync

The plugin is registered automatically by Capacitor on iOS and Android. No manual registerPlugin call is needed in application code — import MobileSignals from the package and call its methods directly.

Usage

import { MobileSignals } from "@elizaos/capacitor-mobile-signals";

// Check permissions before monitoring
const status = await MobileSignals.checkPermissions();
console.log(status.engine); // "healthkit-screen-time" | "health-connect-usage-stats" | "web-fallback"

// Request permissions (triggers native dialogs)
if (status.status === "not-determined") {
  await MobileSignals.requestPermissions({ target: "all" });
}

// Start streaming signals
await MobileSignals.startMonitoring({ emitInitial: true });

await MobileSignals.addListener("signal", (signal) => {
  if (signal.source === "mobile_device") {
    console.log("Device state:", signal.state); // "active" | "idle" | "background" | "locked" | "sleeping"
    console.log("On battery:", signal.onBattery);
  }
  if (signal.source === "mobile_health") {
    console.log("Sleeping:", signal.sleep.isSleeping);
    console.log("Heart rate:", signal.biometrics.heartRateBpm);
  }
});

// One-shot read without streaming
const { snapshot, healthSnapshot } = await MobileSignals.getSnapshot();

// Stop when done
await MobileSignals.stopMonitoring();

Permissions

iOS

Add to Info.plist:

<key>NSHealthShareUsageDescription</key>
<string>Used to read sleep and biometric data for your agent.</string>

Screen Time features additionally require:

  • The com.apple.developer.family-controls entitlement (provisioned by Apple — requires a special request).
  • DeviceActivityMonitorExtension and DeviceActivityReportExtension app-extension targets in the Xcode project.
  • The FamilyControls and DeviceActivity frameworks linked via the podspec.

Validate the iOS build wiring:

bun run --cwd plugins/plugin-native-mobile-signals validate:ios-screen-time

Android

Add to AndroidManifest.xml:

<uses-permission android:name="android.permission.PACKAGE_USAGE_STATS"
    tools:ignore="ProtectedPermissions" />

Usage Access cannot be granted via a normal permission dialog. Direct the user to the system settings page:

await MobileSignals.openSettings({ target: "usageAccess" });

Environment variables (build-time only)

Variable Description
MOBILE_SIGNALS_IOS_PROVISIONING_PROFILE Path to a .mobileprovision to inspect for Screen Time entitlements during validate:ios-screen-time.
MOBILE_SIGNALS_REQUIRE_IOS_PROVISIONING_PROFILE Set to "1" to fail validation when no provisioning profile is supplied.

Platform notes

  • Node (desktop): No native integration. The web fallback applies.
  • iOS: Full support. Requires Xcode target with correct entitlements for screen time features.
  • Android: Full support for device state and Health Connect. Usage stats require manual user grant via settings.
  • Web: Graceful fallback only. Health and screen-time capabilities are unavailable.