feat: add durable device mailbox with unified delivery fallback - #118
Merged
Conversation
Add a pull-only encrypted operation authority and durable device journal so offline work survives process restarts. Model dispatch as completed, not_dispatched, or unknown so fallback only queues work when the gateway can prove the realtime call never reached the device.
Let callers select realtime, mailbox, or certainty-gated fallback on the normal command call. Project the same contract through the SDK, CLI, Dashboard, and MCP so agents can request deferred execution in one operation instead of retrying through a separate enqueue endpoint.
Document the deployment trust root, pull lifecycle, journal guarantees, and single-installation boundary. Keep every public surface aligned on the single-call delivery policy and record why fallback depends on dispatch certainty rather than error codes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
~delivery: realtime | mailbox | fallback; fallback queues only when the host proves the realtime call wasnot_dispatchedtb call, Dashboard, and MCP while keeping existing realtime Device SDK integrations unchangedSafety and compatibility
completedincludes device business errors and never falls back to mailboxunknownmeans the call may have reached the device; it is returned as non-retryable and is never automatically queueddelivery: mailbox | bothand consume work throughcreateDeviceMailboxProcessorplus a durable journalTB_SECRET_ENCRYPTION_KEY; this is at-rest encryption with a separately derived mailbox subkey, not end-to-end encryptiondeviceIdremains the MVP idempotency prerequisitePublic package versions
@tool-bridge/app0.19.0@tool-bridge/cli0.29.0@tool-bridge/dashboard0.26.0@tool-bridge/gateway0.24.0@tool-bridge/sdk0.20.0@tool-bridge/server0.20.0Tags must be created one at a time from
mainafter merge.Validation
pnpm verifypnpm turbo run buildnpx -y @tokenroll/llmdoc validategit diff --checkCloses #117