mp_core 0.1.2
mp_core: ^0.1.2 copied to clipboard
Shared types, model configuration, and runtime primitives for MP tasks.
0.1.2 - 2026-10-07 #
Features #
New capabilities from the quality pass
Owner: @ifiokjr · Review: PR #27
mp_core:TaskLifecycle.reopen()lets a task whose backend cleanup failed stay usable soclose()can be retried instead of leaking the underlying isolate and native handles.mp_genai,mp_text: streaming chunk types (LlmGenerationChunk,RagGenerationChunk,TextSummarizerChunk,TextProofreaderChunk) now implement value equality and hashing, so runtime-built instances compare by content the way every result type already does.
Fixes #
- Monostyle style pass. Blank-line breathing room around control flow and returns, group splits, and collapsed blank runs, applied by
monostyle fixand kept where the pinned formatters put them. No behavior change. Owner: @ifiokjr · Review: PR #19
Correctness and performance fixes
Owner: @ifiokjr · Review: PR #27
Lifecycle and error handling:
mp_core:NativeTaskIsolateno longer leaks its ports and subscriptions whenIsolate.spawnitself fails, kills a worker that reports an uncaught error or returns a malformed response instead of orphaning it, and shares one teardown path for every spawn failure.LlmInference.generateResponseinmp_genaican no longer surface an unhandled zone error when closing its temporary session.mp_vision: a failedclose()reopens the task so cleanup can be retried; frames rejected by a backend no longer burn their timestamp; live-stream failures now reach both the results stream and the returned future on every platform; the web module load is retried after a transient failure; and the holistic landmarker releases its wasm result object after conversion.mp_text: the web backends serialize calls, drain in-flight work on close, and validate converted JavaScript results, failing withMpExceptioninstead of null-check and cast errors. A native language prediction without a code fails explicitly instead of decoding as an empty string.mp_camera:LatestFrameScheduler.submitthrowsMpTaskClosedErrorafter close like every task, a throwing failures listener cannot terminate frame processing, and unknown device orientations fail with anArgumentErrorinstead of a null-check crash.
Validation:
mp_core: NaN and infinity coordinates are rejected byNormalizedRect, NaN score thresholds byClassifierOptions, and containers validate inputs before copying them.
Performance:
mp_core: native results copy pixel and embedding buffers once instead of twice,cosineSimilarityno longer boxes every sample, platform detection is memoized, and web image conversion dispatches per image rather than per pixel.mp_camera: NV21, YUV420, and BGRA conversion loops hoist strides, sample chroma once per pixel pair, and clamp with branches instead ofnum.clamp.mp_audio,mp_text,mp_genai: each web runtime resolves its module and wasm fileset once per runtime instance and reuses it across task creations.mp_genai,mp_text: model files are written to disk asynchronously so multi-hundred-megabyte writes stay off the UI isolate.
API hygiene:
mp_core: the generated FFIMpStatusis no longer exported fromnative.dart, removing the collision with the Dart-sideMpStatus; dead conversion helpers were removed.mp_genai: thecollectiondependency that was already used is declared, andImageGeneratorrejects negative seeds.
0.1.1 - 2026-09-28 #
Changed #
- No package-specific changes were recorded;
mp_corewas updated to 0.1.1 as part of groupmp.
0.1.0 - 2026-09-28 #
Features #
Add the initial six-package API workspace
Defines shared task and result types; vision, text, audio, camera, and GenAI APIs; web adapters; the classic native C bridge; mobile proofreading and summarization plugin bridges; tests; and API documentation. Platform support remains limited to the backends and real-model tests listed in the support matrix.
Owner: @ifiokjr · Review: PR #1
Fixes #
Fix task deadlocks, equality, and error reporting
Fixes defects that could strand a task, crash an error handler, or surface an unusable error:
- The
mp_textandmp_genaiplatform bridges set their busy flag before invoking an operation, so an operation that threw before returning a future left the task permanently busy. Rejecting a non-8-bit image on an Android LLM session was the reachable case; every later call then failed withfailedPrecondition. Both bridges now route throughFuture.sync. LlmInference.generateResponseattached session cleanup to a derived future, so a caller that handled a generation error still received an unhandled zone error, and a synchronous failure leaked the temporary session.- A build with no linked MediaPipe runtime failed inside
dart:ffiwith a bareArgumentErrornaming an internal asset id. Native task creation now reportsMpStatus.unavailableand names the user define that supplies a local runtime. - The Android GenAI plugin collapsed every platform error into
internal. Common failure shapes now map to distinct statuses the Dart bridge already understands. - The native runtime reported the full Dart VM version — which embeds OS
details — to MediaPipe's usage logging as
host_version. It now sends a stable SDK label, and the privacy guide documents exactly what the SDK reports. HolisticLandmarkerResult,PoseLandmarkerResult,ImageSegmenterResult,PromptPoint, andPromptStrokelacked==/hashCodewhile their sibling result types had them, so comparing results across task instances compared identity.MpCameraClockexposed no way to read the last issued timestamp; it now reportslastTimestampMsfor latency monitoring and tests.
Adds missing coverage: MpCameraClock monotonicity, result equality for the
types above, and generation-chunk equality. Adds a documentation site link
checker, a docs-data consistency check, mdt-synchronized READMEs, and runnable
examples — including a device demo that streams camera frames through a face
detector and reports motion and drop telemetry.
Owner: @ifiokjr · Review: PR #15
Register the native runtime artifact catalog
Fill the build hook's artifact catalog with the checksummed MediaPipe runtime
archives published for release native-v1.0.0-1: macOS ARM64, Linux x64, and
Android ARM64/x64. Published packages now bundle a native runtime at build time
instead of requiring a local .mp-sdk build, and a missing target still
resolves a local runtime with an actionable error.
Owner: @github-actions · Review: PR #17
Cover the published native runtime resolution path
Add a regression test for the build-hook path a package with no
native_library_directory user define takes: resolving the checksummed archive
named by native_artifacts.json for the host. The test skips when the catalog
publishes no build for the test host, because a missing target legitimately
bundles nothing.
0.0.0 #
- Reserve the package name before the first coordinated MP SDK release.