synheart_core library

Synheart Core SDK — Flutter

The Synheart Core SDK is the unified integration point for collecting HSI-compatible data, computing human state on-device via the Synheart Runtime, and uploading derived state snapshots (HSI 1.3) with explicit user consent.

Modules:

  • Device Auth — hardware-backed ECDSA device identity
  • Capabilities — server-signed feature gating
  • Consent — user permission management
  • Wear — biosignal collection
  • Phone — device motion / context
  • Behavior — user interaction patterns
  • HSI Runtime — signal fusion and state computation
  • Cloud Connector — device-signed HSI snapshot uploads

Classes

Accel
§2 — three-axis acceleration, in g.
ActivityAxis
Activity Axis - Physical activity and motion
AcuteWorkloadContext
Acute / chronic workload context. Hosts can either pre-compute acuteChronicRatio or pass the raw loads.
AffectAxis
HSV State Axes - Core state representation indices
AggregateAxis
AggregatedNight
AggregatedTotals
Aggregate per-night totals for vendors that don't expose a timeline.
ApiEndpoints
Central registry of all Synheart API endpoints and default base URLs.
AppleHealthDailyAggregator
Per-day rollup of Apple Health samples → daily aggregates that the runtime SRM understands.
AppleHealthRuntimeSink
High-level AppleXmlIngestSink that bridges an Apple Health export.zip import to the runtime SRM.
AppleXmlBackfillSink
Bridges AppleXmlIngestSink calls into the runtime FFI.
AppMetric
ArtifactAccepted
Artifact accepted (verified + not a duplicate).
ArtifactDeadLettered
Artifact dead-lettered after EdgeIngest.poisonPillThreshold hash mismatches for the same id: surfaced as a hard error via EdgeIngestListener.onPoisonPill AND ack-to-discarded so it stops blocking the outbox.
ArtifactDuplicate
Artifact ignored: its artifact_id was already seen (§5).
ArtifactEvent
§3.3 — an artifact was accepted (verified + non-duplicate).
ArtifactHashMismatch
Artifact rejected: payload_hash_sha256 != sha256(payload_json) (§5). First/normal mismatch — NOT surfaced, NOT acked, NOT recorded as seen.
ArtifactHeader
AuthProvider
Interface for pluggable request authentication.
AxisStats
Mean / std / confidence triplet for one axis or metric.
BackfillBatchResult
Result of a sink batch insert. Mirrors the same-named types in synheart_wear's apple_health_xml_import.dart.
BackfillImportResult
Result of a complete import session.
BaselineCoverage
Coverage metadata — how much input fed this snapshot, and how many dimensions / axes / metrics it covers. Used by cross-device merge (per-kind, prefer higher observations / dimensions / recency) and by readers gating on freshness.
BaselineEngineRef
Engine reference embedded in every baseline envelope.
BaselineEnvelope
One baseline snapshot, ready to upload to the cloud or restore locally.
BaselinePayload
Marker for any typed baseline payload. Bounds the generic payload extractor surface on the snapshot facade.
BaselineRefs
Stage-3 personal baselines pulled from the longitudinal SRM. Pass null (on RecoveryScoreInput.baselines) if the user doesn't have stable references yet — the engine will dispatch to Stage 1 or 2.
Baselines
Host-facing facade over the sleep-score baseline surface.
BaselineSnapshots
Host-facing facade for typed baseline-snapshot access.
BaselinesNightlyHrvSource
SDK-provided source: pulls per-night RMSSD aggregates from Baselines._recentOvernight + sleep windows from _recentNights. Covers the Whoop / Garmin / Apple Health vendor-sleep flow that the Baselines facade already ingests.
BaselinesSleepWindowSource
SDK-provided source: pulls sleep windows from the Baselines nightly ledger. Same semantics as BaselinesNightlyHrvSource.
BaselinesSnapshot
A typed aggregate of the host-visible baseline state at a point in time.
BaseSynheartModule
Base implementation of SynheartModule with common functionality
BehaviorConfig
Behavior module configuration
BehaviorConsent
Behavior consent configuration
BehaviorEvent
Behavior event captured from user interactions
BehaviorEventInput
One rich behavioral event, ready for pushBehaviorEvent.
BehaviorModule
Behavior Module
BehaviorProvider
Abstraction over any behavioral signal source (mock, synheart-behavior SDK). Pull-based — MockSessionEngine queries currentSnapshot at each frame tick.
BehaviorSessionResults
Results from a behavior session
BehaviorSnapshot
A point-in-time snapshot of behavioral signals. Mirrors BehaviorStats from synheart_behavior field-for-field but lives in synheart_session to avoid an import dependency.
BehaviorState
Behavioral metrics from Phone SDK + HSI processing
BehaviorWindowFeatures
Behavioral interaction features
BioEvent
§3.2 — a biosignal sample was parsed.
BioSample
§3.2 — a full raw biosignal sample (HR + RR + optional accel).
BioSampleOutcome
BiosignalFrame
BiosignalProvider
Abstraction over any biosignal source (mock, BLE HRM, Apple Watch, etc.). Stream-based — consumers call startStreaming and listen for samples.
BiosignalSample
BiosignalsConsent
Biosignals consent configuration
BleHrmDevice
A discovered BLE heart rate monitor device.
BleHrmProvider
Platform bridge for BLE Heart Rate Monitor operations.
BreathingComplianceResult
Top-level breathing compliance verdict.
BreathingCompliant
BreathingGuidanceCopy
BreathingInsufficient
BreathingMetrics
Numeric metrics computed by the 4-pillar detector.
BreathingModule
BreathingNotCompliant
CanonicalEventStoreHrvSource
SDK-provided HRV source that queries the canonical event store directly for a specific vendor's recovery records, bypassing the Baselines lockstep ring entirely.
CanonicalWearableEvent
CapabilityModule
Capabilities Module
CapabilityProvider
Provider interface for capability checking
CapabilityToken
Capability token received from authentication service
CloudConfig
Cloud connector configuration
ComponentWeights
ComputeProfile
ConsentChannels
Consent channels configuration
ConsentConfig
Consent service configuration
ConsentEffectiveState
Typed view of the runtime's effective consent state.
ConsentForm
Editable consent form returned by the native runtime.
ConsentModule
Consent Module
ConsentProfile
Consent profile from consent service
ConsentProvider
Provider interface for consent management
ConsentSnapshot
Snapshot of user consent at a point in time
ConsentToken
JWT consent token issued by consent service
ConsentUIManager
Manager for consent UI hooks
ContextAxis
Context Axis - Environmental and device state
ContextEventInput
One privacy-preserving context event, ready for Synheart.pushContextEvent.
ContextState
Context information from adapters
ConversationContext
CoreRuntimeBridge
Bridge to the core runtime via FFI.
CoreRuntimeSyniServiceTransport
Native transport backed by the registered Synheart Core runtime handle.
CoverageInfo
DataDeletionEvent
Real-time status update for a deletion request, pushed from the cloud over the RAMEN stream. Narrower than DataDeletionRequest — only the fields the cloud emits on each lifecycle transition plus the envelope fields RAMEN routes by.
DataDeletionList
Page of deletion requests returned by GET /v1/customer/data-deletions.
DataDeletionRequest
A single GDPR Article 17 deletion request returned by the platform.
DeletionRequestResult
Result of an account deletion request.
DeviceAuthConfig
Device authentication configuration.
DeviceAuthProvider
AuthProvider backed by core-runtime proof generation.
DeviceStateContext
Dropped
Body dropped: missing/invalid type, missing required fields, or otherwise malformed. Never crashes.
EdgeEvent
Sealed family of typed edge events emitted on EdgeIngest.events.
EdgeIngest
Transport-independent, pure-Dart consumer of the Synheart edge wire contract (watch → phone). This is the phone-side counterpart to the watch producer; it exists so every Flutter app stops re-implementing watch→phone ingest — the canonical parse/validate/dedupe/ack logic lives here once.
EdgeIngestListener
Optional typed callbacks for parsed, validated edge messages. Parity with the Swift EdgeIngest.Delegate and Kotlin EdgeIngest.Listener.
EdgeOutcome
The outcome of consuming one body (parity with Swift's Outcome). Returned in addition to firing the listener/stream so an adapter and tests can branch without state.
EdgeSessionEvent
A session event whose type is none of the three sample/artifact discriminators (e.g. session_started, session_frame, session_summary; contract §3.4). The raw body is passed through unparsed so the host can route by type without this core depending on every event shape.
EngagementAxis
Engagement Axis - Digital interaction patterns
ExcessiveArtifacts
FatigueContext
Short-window fatigue indicators.
ForegroundAppSource
Where the foreground application identifier comes from.
GarminProvider
Garmin Cloud Provider for Synheart Wear SDK
HealthConnectBackfillResult
Outcome of a Health Connect historical pull.
HealthConnectRuntimeSink
High-level "bring your Health Connect history" call. Mirrors the shape of AppleHealthRuntimeSink (Apple zip import) so the two platforms have parallel public APIs even though the underlying data sources are different.
HeartRateSample
A single heart rate sample from a BLE HRM device.
HistoryContext
Training-history context.
HostDeclarations
The four declarations, plus the "auto" escape hatch for each.
HrEvent
§3.1 — an HR sample was parsed.
HrSample
§3.1 — a scalar HR sample.
HrSampleOutcome
HrvSample
One HRV sample at a point in time. Mirrors the runtime's HrvSample struct.
HrvSampleSource
A pull-based source of HRV samples within a time range.
HSI11Axes
HSI11Domain
HSI11Embedding
HSI11Privacy
HSI11Producer
HSI11Reading
HSI11Window
HsiArtifact
§3.3 — an accepted (hash-verified, non-duplicate) HSI artifact envelope.
HSIAxes
The canonical HSI axes surfaced to hosts.
HsiAxesBaseline
HSI axes aggregator output for one session. axes is a string-keyed map (not a fixed 4-field struct) so future HSI versions can publish additional axes without a payload schema bump.
HSIAxisValue
A single HSI axis reading with value and confidence.
HSIPayload
HSI Canonical Payload — version-tolerant parser for HSI 1.0 / 1.1 / 1.2.
HSIState
Typed HSI state emitted by Synheart.onStateUpdate.
IngestionSubmissionResponse
InsightMetrics
InsufficientReason
Why the detector cannot produce a verdict yet.
InterpretationConsent
Interpretation consent configuration
IrregularPattern
LabIngestResponse
LiveSessionEngine
Dart-side session engine that consumes real HR data from a BiosignalProvider and behavioral signals from a BehaviorProvider.
LongitudinalWearBaseline
Payload wrapper for the longitudinal.wear kind.
MetricEvent
An app-level metric event recorded during a session.
MockBehaviorProvider
Mock behavior provider that returns stable mid-range values for testing. Parallels MockBiosignalProvider for behavioral signals.
MockBiosignalProvider
Mock biosignal provider that produces sinusoidal BPM at 1 Hz. Wraps MockHrGenerator behind the BiosignalProvider interface.
Modalities
Modality availability derived from meta.provenance.sources[*].signals per the Synheart Runtime signal-modality mapping spec.
ModuleManager
Manages the lifecycle of all Synheart modules
NightInput
The three vendor-input shapes. The runtime's NightInput is a tagged enum (kind: segmented | aggregated | vendor_score).
NightRaw
One night's raw input + optional session-window HR.
NightSummary
Aggregate sleep totals for one night. Stage durations are nullable (self-report / basic Health Connect can't break stages out).
NoBreathingSignature
NonComplianceReason
Why the user is not following instructions (when verdict is NotCompliant).
NotEnoughBeats
OvernightPhysiology
Per-night overnight physiology (HR + HRV). At least one of the two must be present for the engine to emit a score.
PhoneConfig
Phone module configuration
PhoneContextConsent
Phone context consent configuration
PhoneModule
Phone Module
PhoneWindowFeatures
Phone context features
PrivacyConfig
Privacy sub-configuration.
QueueFlushResult
QueueStatusSnapshot
ReadinessComponents
Per-component breakdown.
ReadinessScoreInput
Top-level input bundle. Recovery score is required; everything else is optional and improves confidence when present.
ReadinessScoreResult
Canonical output of the Readiness Score scorer.
RecoveryComponents
Per-component breakdown — populated per-stage. Components missing for the active stage are null.
RecoveryScoreInput
Top-level input bundle for the Recovery Score scorer.
RecoveryScoreResult
Canonical output of the Recovery Score scorer.
RegistrationResult
Result of SynheartAuth.registerDevice.
ResilienceConfig
Tunable parameters. Defaults match the runtime's defaults.
ResilienceData
Compose multiple HRV / sleep sources into one ResilienceInput.
ResilienceInput
Materialized inputs to a single resilience compute.
ResilienceResult
Result returned by compute(). Mirrors the runtime's ResilienceScoreResult.
RotationResult
Result of SynheartAuth.rotateKey.
RuntimeCompat
Runtime-version compatibility for the hand-written C ABI bindings.
RuntimeCompatResult
SchemaRef
SDKCapabilities
SDK capabilities parsed from token
SegmentedNight
SelfForegroundAppSource
Reports the host's own application id.
SensingProfile
An explicit sensing declaration.
SensingStreams
The closed, versioned stream roster.
SessionAggregates
Per-axis aggregates, keyed by axis name.
SessionChannel
SessionConfig
SessionError
SessionEvent
SessionEventOutcome
Body recognised as a non-sample/-artifact session event (§3.4).
SessionEventWrap
§3.4 — a non-sample/-artifact session event.
SessionFrame
SessionHandle
A handle to an active or completed session.
SessionInfo
SessionRange
Optional filter for listing sessions.
SessionRecord
Session record returned from session queries.
SessionSrmMetricsBaseline
SrmEngine's per-session output.
SessionStarted
SessionStatus
SessionSummary
SessionSummaryArtifact
Compact session summary for UI display and fast queries.
ShallowBreathing
SignedHeaders
Headers to attach to every authenticated HTTP request.
SleepQuestionnaireAnswers
One night of self-reported sleep. All fields are optional except bedtime and wakeTime — without them we can't bound TIB.
SleepScoreAdjust
SleepScoreBreakdown
Per-component breakdown; fields populated per-path.
SleepScoreInput
Full input to the scorer.
SleepScoreResult
The canonical output of the batch scorer.
SleepWindow
Half-open [startMs, endMs) interval representing a sleep window. The runtime filters HRV samples to those inside any supplied window before computing CV.
SleepWindowSource
A pull-based source of sleep windows.
SourceResolution
Outcome of a single priority resolution.
SrmMetricBaseline
Per-metric session SRM baseline.
StageSegment
A contiguous stage interval. Half-open: [startMs, endMs).
StateEmbedding
State Embedding - Dense vector representation of fused multimodal state
StorageConfig
Storage sub-configuration.
StorageUsage
Result of a storage usage query.
StrainContext
Strain context for Stage 3's strain-adjustment component. Any signal may be null; the engine uses whichever is present in priority order (previous_day_strain → activity composite → sleep_debt_hours).
SyncConfig
Sync sub-configuration.
SyncNativeError
A structured failure returned by a native sync operation.
SyncReadiness
Operation-specific Synsync readiness composed from SDK authorization and the native runtime readiness snapshot.
SyncResult
Sync result from a push/pull cycle.
SyncStatus
Current sync status.
Synheart
Synheart Core SDK - Main Entry Point
SynheartAuth
Public facade for the Synheart device authentication SDK.
SynheartConfig
Configuration for Synheart Core SDK
SynheartCoreFFI
Resolved FFI bindings for synheart_core_runtime.
SynheartIngestion
SynheartInstance
A single, self-contained Synheart runtime instance (one native handle).
SynheartLogger
Lightweight internal logger (replaces print, keeps flutter_lints happy).
SynheartModule
Base interface for all Synheart modules
SynheartPriority
Process-wide priority API.
SynheartResilience
High-level Flutter binding. Construct once per app — the class is stateless under the hood, so reuse is trivially safe.
SynheartSession
SyniChatDelta
An incremental token chunk emitted during generation.
SyniChatEvent
One event in a streaming chat response. Discriminated union over incremental deltas and the final structured response.
SyniChatFinal
The final parsed response. Always emitted exactly once at the end of a successful stream.
SyniChatResponse
A completed Syni response.
SyniCloudConfig
SyniCloudModel
A server-side model — runs in the Syni cloud. serviceModelId is the id the service routes to internally; the client never needs the provider/model details.
SyniInstalled
Successfully installed. The runtime engine has loaded the model and is ready to receive chat calls.
SyniInstallFailed
Install failed. reason is human-readable; cause is the underlying exception when available.
SyniInstalling
Install in progress. progress is in [0.0, 1.0]; stage explains which sub-step is running.
SyniInstallState
SyniLocalModel
An on-device model — runs via the candle runtime. spec is what SyniAgent.install needs to download + load it.
SyniModelCatalog
Fetches + caches the Syni model catalog from the Syni cloud GET /v1/models.
SyniModelOption
One entry in the Syni model catalog — a local (on-device GGUF) or cloud (server-side) model. The two are peers: the client's router picks among them using optimizedFor tags, requires constraints, and the active execution mode.
SyniModels
V1 model catalog. Replace with a server-signed manifest fetched from the remote model catalog once that exists. Pinned SHA-256 values come from the HuggingFace LFS x-linked-etag header, which is the underlying file's SHA-256 for LFS-stored objects.
SyniModelSpec
SyniModule
Public Syni client, exposed to consumer apps as Synheart.syni.
SyniNotInstalled
No model downloaded, no persona bound. Default state.
SyniPersona
SyniServiceChatRequest
One non-streaming request to Synheart's device-signed Syni service.
SyniServiceChatResponse
Completed non-streaming Syni service chat turn.
SyniServiceClient
Device-signed, non-streaming client for Synheart's Syni service.
SyniServiceMessage
One message in a Syni service session.
SyniServiceMessagesPage
SyniServiceModelInfo
Model selection metadata returned by the Syni service.
SyniServiceSession
One server-side Syni conversation session.
SyniServiceTransport
Testable transport boundary for the native Syni service calls.
SyniSpecPersona
Loads a SyniPersona from a bundled syni-spec JSON asset.
Tiers
Per-modality fidelity bundle. Pre-canonical: in HSI 1.3 this becomes per-axis tiers. Lower-numbered tier = higher fidelity.
TimeRange
TypingSessionData
A 10-second typing micro-window summary.
UploadErrorDetail
UploadErrorResponse
UploadMetadata
UploadRequest
UploadResponse
UserPatternsContext
VendorOnlyTier
VendorScoreNight
WatchBiosignalProvider
Biosignal provider that bridges HR data from the iOS/Android watch relay (via SessionChannel) into the standard BiosignalProvider interface.
WatchSessionModule
Thin adapter around SynheartSession for watch-based session management.
WatchStatus
Immutable snapshot of watch connectivity status (Apple Watch / Wear OS).
WearableReferenceView
WearableReference view over the Longitudinal SRM engine output.
WearConfig
Wear module configuration
WearModule
Wear Module
WearModuleStatus
WearSample
Raw wear sample from a data source
WearWindowFeatures
Biosignal features from wearables
WhoopProvider
Provider for Whoop cloud API integration
WindowRange
Optional filter for querying HSI windows.
WindowTooShort
WorkoutAdapter
A provider-specific source of WorkoutEvents. Implemented by each adapter (HealthKitWorkoutAdapter, HealthConnectWorkoutAdapter, WhoopWorkoutAdapter, GarminWorkoutAdapter, ...).
WorkoutEvent
Normalized workout event produced by a WorkoutAdapter and consumed by the Synheart core engine. All vendor scalars are normalized to [0, 1] by the adapter, never by the host app.
WrongFrequency

Enums

AccelPlacement
Where the accelerometer physically sits, for set_accel_placement.
BaselineKind
Discriminator for what kind of baseline a snapshot carries.
BaselineSource
Stable identity for every baseline data lane. Keep these wire strings in sync with Baselines.lastSource and the engine's per-provider switch — host apps store the enum, the engine sees the string.
BehaviorEventType
Types of behavior events.
BleHrmErrorCode
Error codes for BLE HRM operations.
BreathingPopulation
Population threshold profiles. Match the native runtime's enum ordering.
CapabilityLevel
Capability levels for module features
CloudSyncStatus
User-facing cloud-sync state. Combines queue depth, last-success timestamp, and cloud-upload consent into a single bucket the host can render as a pill.
ConsentStatus
Consent status enumeration
ConsentTier
Processing tier for consent.
ConsentType
Types of consent. Interpretation flags (focus/emotion estimation) are expressed at the channel level via ConsentChannels rather than as top-level consent types.
DataDeletionStatus
Lifecycle of a deletion request as reported by the cloud.
DeviceAuthState
Device authentication state machine.
DeviceClass
SRM baseline partition. Folds into the SRM config_hash — see the table on HostDeclarations.
ExtraHead
Opt-in kinematic heads.
FeatureFlag
Feature flags for fine-grained control
FocusKind
HrvSampleKind
What HrvSample.rmssdMs actually represents — see the runtime's synheart_resilience::HrvSampleKind enum for full math implications.
InterruptionAction
How the person responded to an interruption (notification or call).
KeyboardEventType
Keyboard event classification.
LabReenqueueResult
Result of a CoreRuntimeBridge.labReenqueueSession call. Mirrors the return codes from the underlying synheart_core_reenqueue_lab_session FFI.
MaskProfile
Which interpretation-mask table the engine reads.
Module
Module identifiers
ModuleStatus
Module lifecycle status
MouseEventType
Pointer event classification.
PriorityMetric
Metric types that can have per-metric priority overrides.
ReadinessBand
Discrete action label derived from the score.
ReadinessFactor
Discrete reasons surfaced for "why is your readiness X?" panels.
RecoveryFactor
Discrete reasons surfaced for "why is your recovery score X?" panels.
RecoveryScoreMode
User-facing label for the score's confidence regime.
RecoveryStage
Which staged-history mode the engine used to compute the score.
RegistrationStatus
Status of a device registration attempt.
ResilienceReason
Why a resilience score might not be available.
RotationStatus
Status of a key rotation attempt.
RuntimeBehaviorEvent
Typed behavior-event kinds that cross the FFI seam.
RuntimeCompatStatus
ScrollDirection
Scroll / swipe direction. Anything outside this set is read as absent.
ScrollMagnitude
Coarse scroll magnitude bucket. Weighted Small = 1, Medium = 2, Large = 3 when the window accumulates total scroll distance.
SensingMode
Whether the host senses continuously or in episodes. There is no default: continuous-vs-episodic is the whole claim, and guessing it is what ruling B-0 forbids.
SessionErrorCode
SessionMode
ShortcutType
Recognised editing shortcut. On a touch host these arrive as long-press menu actions or toolbar taps rather than key chords.
SleepFactor
Discrete, structured drivers of the sleep score, as emitted by the runtime.
SleepFeltRested
Subjective sleep quality, 1–5 stars.
SleepPath
Which pipeline path produced a score.
SleepScoreMode
Mode derived from history length (0→cold, 1–6→short, ≥7→stable in Kotlin-parity v2.0.0).
SleepScoreReason
Reason a score was absent or degraded.
SleepStage
Canonical sleep stage.
SrmMetricStatus
Maturity status of a session-level SRM metric. Distinct from the longitudinal wearable status — session SRM doesn't decay within a session, so there's no STALE variant here.
SyncOperation
A Synsync operation with its own native prerequisites.
SyncReadinessCode
Stable reason why a Synsync operation can or cannot run.
SynheartFeature
Feature identifiers for the four-authority activation model.
SynheartMode
Operational modes for Synheart Core.
SyniExecutionMode
Where a chat call should run.
SyniInstallStage
SyniResponseKind
Which EngineResponse variant the runtime returned.
SyniServiceErrorCode
TaskType
WearModuleStatusType
Status events emitted by WearModule to surface initialization, permission, and streaming outcomes that would otherwise be silent.
WindowType
Window types for time-based aggregation
WorkoutKind
Sub-classification of a WorkoutEvent. Each kind drives a different per-HsvType confidence modulation table in the engine's personalization runtime — strength training, for example, dampens Strain confidence because HR doesn't track neuromuscular load well.

Extensions

ConsentEffectiveStateMap on ConsentEffectiveState
Snapshot every channel of a ConsentEffectiveState into a Map — the canonical iteration shape across SDK consumers.
ConsentFormMap on ConsentForm
Snapshot a ConsentForm into a channel map.
ConsentTypeMeta on ConsentType
Canonical metadata for ConsentType. Use this to iterate the SDK's complete set of consent channels instead of hardcoding strings or per-field switches — adding a new channel then only requires extending the ConsentType enum and the four methods below (plus the underlying state/form fields), not every consumer of consent state.

Constants

kKnownHsiVersions → const Set<String>
kPriorityUnranked → const int
Sentinel rank for unknown providers — matches the runtime's `ProviderRank::UNRANKED` (32-bit max int).
synheartCoreVersion → const String
Version of the synheart_core Flutter SDK package.

Properties

synheartRuntimeLogForwarder ↔ void Function(String line)?
Forwarder installed before synheart_core_init_logging (top-level for FFI).
getter/setter pair

Functions

parseConsentTier(String? raw) → ConsentTier
unwrapSyncEnvelope(Map<String, dynamic>? raw) → Map<String, dynamic>?
Unwrap the native sync response envelope.
warnUnknownHsiVersionOnce(String version) → void
Log once per process per unrecognised hsi_version string. Called from HSIPayload.fromJson when the payload version isn't in kKnownHsiVersions. The warning is the canary for schema drift — if you see it in production logs, the engine has shipped a new HSI version that this parser doesn't know about. Pin updated fixtures from the canonical HSI repo and bump kKnownHsiVersions.

Typedefs

BaselineLocalHydrator = Future<Map<String, dynamic>?> Function()
Hook signature for "read every latest baseline envelope per kind for the configured subject from local storage". No network — pure SQLite + decryption. Wired by Synheart at SDK init from the runtime bridge.
BreathingGuidanceLocalizer = String Function(NonComplianceReason reason)
Returns a single-line coaching string for reason. Pure function; no engine call. Apps that want their own copy should write the same switch — passing BreathingGuidanceCopy.localize is the suggested fallback when no override is set.
ConsentUIProvider = Future<ConsentProfile?> Function(List<ConsentProfile> availableProfiles)
Callback type for presenting consent UI
DeviceRequestSigner = Future<Map<String, String>> Function({required List<int> bodyBytes, required String method, required String path})
Function type for device-signed HTTP requests.
HSI11Payload = HSIPayload
PushDailyCallback = void Function({double confidence, required int dayIndex, required String dimension, int fidelity, required double value})
Callback signature for pushing a daily wearable value. Mirrors Synheart.srmPushWearableDaily's named parameters so a plain function reference can be used directly. Injectable so tests can substitute a recorder without booting the whole runtime.
TriggerRecomputeCallback = void Function()
Callback signature for triggering a longitudinal recompute. Mirrors Synheart.srmTriggerWearableRecompute's shape (no required args).

Exceptions / Errors

AlreadyRegistered
AttestationUnavailable
BackfillBatchFailed
BackfillFinalizeFailed
BackfillOpenFailed
BackfillRuntimeUnavailable
BackfillSinkError
Errors thrown by the runtime-backed sink.
BaselineKindMismatch
Thrown by a typed payload extractor when the envelope's kind doesn't match the caller's expected kind.
BleHrmError
Exception thrown by BLE HRM operations.
CapabilityException
Exception thrown when capability token validation fails.
ChallengeExpired
ClockSkew
CloudConnectorException
ConsentRequiredError
CryptoError
InvalidSignatureError
InvalidStateTransition
KeyInvalidated
ModuleException
Exception thrown by modules
NetworkError
NotConfigured
NotRegistered
RateLimitExceededError
RegistrationInProgress
ResilienceComputeFailed
ResilienceError
Errors thrown by the wrapper.
ResilienceUnavailable
SchemaValidationError
ServerError
SessionInvalidStateError
SessionPermissionDeniedError
SessionSensorUnavailableError
StorageError
SyncNativeException
Thrown by the sync bridge methods when the native layer reports a failure envelope. Carries the structured error so the host can render cause-specific copy (and decide whether to offer a retry) instead of a generic "sync engine not ready" message.
SynheartAuthError
Error types raised by the Synheart auth plugin.
SynheartError
Deterministic error codes for Synheart Core.
SynheartSessionError
SyniCloudException
SyniInstallException
SyniServiceException
Typed failure returned by the runtime's { "error": ... } envelope.
SyniSpecPersonaException
TokenExpiredError