@robono/messaging-react-native 0.17.0 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/BRIDGE-MESSENGER.md +125 -0
  2. package/CHANGELOG.md +13 -0
  3. package/README.md +21 -1
  4. package/SBOM.spdx.json +567 -279
  5. package/dist/account.js +5 -3
  6. package/dist/appearance-context.d.ts +11 -0
  7. package/dist/appearance-context.js +5 -0
  8. package/dist/attachment-menu.js +9 -6
  9. package/dist/brand.js +5 -4
  10. package/dist/calling.js +3 -2
  11. package/dist/chat-options.d.ts +12 -0
  12. package/dist/chat-options.js +25 -0
  13. package/dist/contact-directory.js +3 -3
  14. package/dist/conversation-details.d.ts +2 -0
  15. package/dist/conversation-details.js +7 -5
  16. package/dist/expo-bridge.d.ts +22 -0
  17. package/dist/expo-bridge.js +29 -0
  18. package/dist/expo-history.js +1 -1
  19. package/dist/expo-media.js +2 -2
  20. package/dist/expo-messenger.js +14 -4
  21. package/dist/expo-outbox.js +1 -1
  22. package/dist/expo-screen.js +15 -11
  23. package/dist/expo-storage-digest.d.ts +1 -0
  24. package/dist/expo-storage-digest.js +5 -0
  25. package/dist/expo.d.ts +1 -0
  26. package/dist/expo.js +1 -0
  27. package/dist/extras.d.ts +3 -1
  28. package/dist/extras.js +5 -3
  29. package/dist/forward.js +4 -3
  30. package/dist/group-editor.js +6 -3
  31. package/dist/header-calls.js +4 -3
  32. package/dist/inbox-search.js +4 -3
  33. package/dist/inbox.js +12 -9
  34. package/dist/index.d.ts +16 -2
  35. package/dist/index.js +173 -74
  36. package/dist/media-ui.js +15 -7
  37. package/dist/message-menu.d.ts +2 -1
  38. package/dist/message-menu.js +9 -4
  39. package/dist/native-outbox.d.ts +2 -1
  40. package/dist/native-outbox.js +20 -3
  41. package/dist/polls.js +10 -6
  42. package/dist/popup.d.ts +5 -2
  43. package/dist/popup.js +13 -7
  44. package/dist/public-rooms.js +4 -2
  45. package/dist/quick-send.js +2 -2
  46. package/dist/room-moderation.js +9 -4
  47. package/dist/safety.d.ts +5 -2
  48. package/dist/safety.js +16 -10
  49. package/dist/saved.js +3 -2
  50. package/dist/scheduled.js +11 -6
  51. package/dist/search.js +4 -2
  52. package/dist/sign-in.js +9 -7
  53. package/dist/social.d.ts +5 -0
  54. package/dist/social.js +4 -3
  55. package/dist/storage-digest-cache.d.ts +2 -0
  56. package/dist/storage-digest-cache.js +19 -0
  57. package/dist/translation-settings.js +5 -3
  58. package/dist/typography.d.ts +8 -3
  59. package/dist/typography.js +22 -9
  60. package/dist/use-quote-gesture.js +7 -3
  61. package/examples/existing-bridge-chat.tsx +44 -0
  62. package/package.json +11 -5
  63. package/setup.plugin.cjs +1 -0
@@ -0,0 +1,125 @@
1
+ # Existing Bridge friends in the standard Messenger
2
+
3
+ Bridge language integration — November 9, 2026. This guide covers the package versions below.
4
+
5
+ Required versions: `@robono/messaging` **0.14.0**, `@robono/server` **0.33.0**, and `@robono/messaging-react-native` **0.19.0** (Expo) or `@robono/messaging-web` **0.18.0** (web). Use `@robono/location` **0.4.1** for the screen package's shared appearance helpers; this does not enable Maps or location access.
6
+
7
+ Server: `npm install @robono/server@0.33.0`
8
+
9
+ Expo: `npm install @robono/messaging@0.14.0 @robono/messaging-react-native@0.19.0 @robono/location@0.4.1`
10
+
11
+ Web: `npm install @robono/messaging@0.14.0 @robono/messaging-web@0.18.0 @robono/location@0.4.1`
12
+
13
+ The Expo integration uses the existing supported Expo 55/56 native dependencies. This connector adds no new native dependency. Keep the host's existing supported peers and native configuration. The service endpoint is `https://api.robono.com/v1/bridge/messenger`; a 404 there means the service route is not deployed yet, not that a replacement friend must be created.
14
+
15
+ ## What the connector connects
16
+
17
+ An already accepted external-app user ↔ actual Robono-app user relationship, identified by its existing `child_app_connections.id`. It reads the original Bridge messages and receipts. Message UUIDs, external send IDs, timestamps, attachment batches and retained history are preserved. No shadow person, replacement friend, history import, copied chat or new permission writer is required.
18
+
19
+ This connector is for a direct phone Bridge connection. App-to-app Bridge connections have a separate identity model and are not silently treated as phone Bridge connections.
20
+
21
+ ## Customer setup
22
+
23
+ 1. Keep the existing accepted connection ID from the Bridge friend list.
24
+ 2. Add one authenticated backend route with `createBridgeMessengerBackendAdapter` from `@robono/server`. Give it the server API key, the existing sign-in verifier and the existing per-friend authorization function. Return the exact external user ID already registered on the Bridge. The key stays on the server.
25
+ 3. In Expo, call `createExpoBridgeMessenger` from `@robono/messaging-react-native/expo`. Pass the route URL, signed-in external user ID, connection ID and session-token getter. Call its `open()` once when the screen mounts; give its `client`, `storage` and `audioSession` to the standard `ExpoMessagingScreen`. The client already holds the existing connection ID.
26
+ 4. Keep existing Bridge notifications. Pass the hint's `{connection_id}` to `handlePush`; the SDK reloads authorized content. On a notification tap, open the existing friend's connection. Do not create another conversation.
27
+
28
+ Examples:
29
+
30
+ - `packages/server/examples/existing-bridge-route.ts`
31
+ - `packages/messaging-react-native/examples/existing-bridge-chat.tsx`
32
+ - `packages/messaging-web/examples/existing-bridge-chat.tsx`
33
+
34
+ The included examples import the public package exports and are checked against the exact release archives.
35
+
36
+ ## Permissions
37
+
38
+ The customer's `authenticate` and `authorize` functions run on every operation, and run again after provider work before returning content. `authorize` must check the current user, accepted friend, pauses, schedules, account access and operation. A wait is still a read and must be authorized. The service separately checks the API-key owner, external user, accepted connection and recipient availability. A phone-supplied actor ID is replaced with the authenticated identity.
39
+
40
+ Keep the customer's existing versioned Bridge capability writer. Outbound capabilities determine the composer. Inbound capabilities determine incoming content. Denied or expired content is redacted, and new attachment URLs require fresh authorization. This adapter never changes either party's rules. Website appearance is used as a default; it cannot grant a denied feature.
41
+
42
+ On a host-side permission change, immediately refresh the open client; if account access ends, call `signOut()` and close the screen. While a stricter capability update is pending in the host's existing permission outbox, `authorize` must reject affected operations until the Bridge acknowledges the revision. The callback receives the operation and optional kind/message/upload/asset identifiers for the host to resolve against its own records; these identifiers are lookup hints, not proof of permission. Signing out clears that connection's persisted data. Disposing a screen preserves its draft for reopening. A previously issued private media URL can remain valid for at most 60 seconds; already downloaded bytes cannot be recalled.
43
+
44
+ The standard screen accepts the same `components` and `header` options as within-app chats. A host can hide or replace the header while retaining Robono's message list, composer and viewer. No friend-switching dropdown or close button is required by this connector.
45
+
46
+ ## Attachments and recovery
47
+
48
+ The supplied storage adapter prepares, uploads and screens a private staging object, then sends it through the existing Bridge delivery service. The original Bridge owns the delivered attachment. Thumbnails, the standard viewer, waveform display choices and attachment batches are retained. Stored waveforms are not deleted when hidden; the connector withholds them when the Bridge connection disallows receiving them, and the screen also respects the saved display choice.
49
+
50
+ `onDownloadAttachment` receives an authorized temporary file. Copy it into the host's private Files destination before resolving; the SDK then removes its temporary copy. Honor its cancellation signal. `mediaViewer` controls Share, Forward, Download and Open; `linkHandling` controls URL/address taps and disabled links. These are the same shared options as ordinary Messenger, not a separate Bridge viewer.
51
+
52
+ A failed send retries its original `clientMessageId`. The service checks the durable Bridge send receipt before using an attachment URL. If delivery already happened, it returns the original message—or an acknowledgement if retention already removed it. If not, it obtains a fresh source URL for the same staged object. It never resends under a new ID automatically. Staging objects expire after 24 hours; if an undelivered object has expired, the user must choose the file again. Finished deliveries do not depend on staging lifetime.
53
+
54
+ ## Live updates and retained history
55
+
56
+ One cancellable wait is active while the standard screen is open. A healthy idle screen makes about three wait requests per minute, plus initial/history reads and actual user actions. There is no parallel three-second polling loop. Database changes wake the wait; a persisted revision recovers changes missed while disconnected. A wait ends within 20 seconds even if a hint is lost. Failed transport uses the client's bounded retry/backoff. Do not run a second reconciliation loop alongside the supplied client.
57
+
58
+ The durable wake covers message creation/change/deletion, receipt changes and connection permission updates. Older loaded messages are rechecked after a change. Revocation clears the open history when observed. Push notification contents are hints only; message text, URLs and permissions always come from a new authorized read.
59
+
60
+ `conversationMode="walkie-talkie"` changes presentation, not retention. It does not repost recordings. Bridge history rules remain authoritative; previously expired or retired messages cannot be restored by switching back to full chat.
61
+
62
+ This release does not invent unsupported Bridge reactions, threaded replies, polls, groups, scheduled sends or presence. Their controls remain unavailable in these direct Bridge chats. Delivery/read/heard receipts retain their existing meanings; a heard receipt is not a new claim of complete playback. The separate online-status, phrase-detection and detailed playback-event requests require their own contracts and are not enabled by this connector.
63
+
64
+ ## Translation and transcripts
65
+
66
+ The same standard Expo and web screens offer:
67
+
68
+ | Original message | Available result |
69
+ | --- | --- |
70
+ | Text | Translated text |
71
+ | Voice message | Written transcript; translated text |
72
+ | Video with speech | Written transcript; translated text |
73
+
74
+ This Bridge connector produces readable text. It does not dub a video, burn subtitles into it, or offer generated voice output. The original recording/video remains available through **Show original**. Recordings and videos must be at most 20 MB and one hour; a silent video has no speech to transcribe.
75
+
76
+ Enable **Transcription** and/or **Translation** in the existing website feature choices. Friend permissions still apply: `speech.stt.allowed` permits speech processing, `speech.stt.deliver_transcript` permits showing its transcript, and `speech.translation.allowed` plus `deliver_translated_text` permit translated text. Translating voice/video also requires speech processing. The website cannot override a friend restriction. Supply the friend's known language through `contact.language` or let the person choose it in Translation settings. The destination language is saved per friend.
77
+
78
+ The factories now connect these operations automatically. Keep using `createExpoBridgeMessenger` / `createWebBridgeMessenger` and the supplied screen; no custom translation UI or transport is needed. The underlying public operation is `client.transform(messageId, 'transcript' | 'translation', targetLanguage, 'text', {signal, sourceLanguage})`.
79
+
80
+ ### Approve costs on the customer's server
81
+
82
+ Add `authorizeCost` to the existing backend adapter. It receives the authenticated actor, connection, operation and a trusted `quote`. Return `true` only when the customer's policy approves the maximum cost. An absent callback blocks new processing; returning `false` declines it. The callback also runs for a zero-cost quote so a test or complimentary plan never bypasses the customer's policy.
83
+
84
+ ```ts
85
+ const route = createBridgeMessengerBackendAdapter({
86
+ apiKey: process.env.ROBONO_SERVER_KEY!,
87
+ authenticate: verifyExistingSession,
88
+ authorize: checkCurrentFriendPermission,
89
+ authorizeCost: async ({actorId, connectionId, quote, request}) => {
90
+ return approveLanguageBudget({
91
+ actorId, connectionId,
92
+ stage: quote.stage,
93
+ maximumUsdMicros: quote.maximumChargeMicros,
94
+ signal: request.signal,
95
+ });
96
+ },
97
+ });
98
+ ```
99
+
100
+ `approveLanguageBudget` is the customer's own policy function, not a Robono export. Do not copy a callback that always returns `true` unless unrestricted spending is the intended policy. Resolve per-user spending rules on the server; device-supplied prices and approval tokens are ignored.
101
+
102
+ A voice/video translation has two approvals:
103
+
104
+ 1. Robono reads the real recording duration without transcribing it. The callback approves **transcription** for that duration.
105
+ 2. After the transcript is saved, Robono quotes **translation** for the exact input character count. The callback approves that amount before translation begins.
106
+
107
+ This avoids guessing the text length. If the second step is declined or cancelled, the completed transcript remains saved and its completed processing can still be charged. A retry reuses that transcript. Saved results require fresh permissions but no new processing approval or processing charge. Changes to the original message or source-language choice produce a new result rather than reusing the wrong one.
108
+
109
+ Use `quote.maximumChargeMicros` to approve the maximum for that stage; divide by 1,000,000 for dollars. It is a ceiling before applicable included usage/discounts, not a promise that the full amount will be charged. `metric`, `quantity`, `unitAmountMicros` and `unitQuantity` describe the rate. `billingModel` distinguishes `measured_usage`, legacy `fixed_unit`, `complimentary` and `sandbox`. Do not assume every plan has a fixed per-message price.
110
+
111
+ ### Identify the actual current plan
112
+
113
+ From the customer server, call `await robono.usage()` with an API key allowed to read billing. Its new `contract` field contains `available`, `planKey`, `catalogVersion`, `billingModel` and `languageRates`. This is the account's current agreement, including a retained legacy fixed-price agreement; the public pricing catalog is not proof of that account's plan. If `contract.available` is false, show that billing setup needs attention and decline processing. Never fall back to an assumed old price.
114
+
115
+ The quote returned for each request is authoritative. Robono rechecks the plan, rate, permissions and spending limit before starting work. A price change requires a new approval. Repeating a completed request does not charge twice, including when its response was lost.
116
+
117
+ ### Cancellation and retained results
118
+
119
+ The standard bubble shows **Cancel** while processing. Custom hosts may pass an `AbortSignal` to `client.transform`. Cancellation stops subsequent stages and prevents a late result from appearing. It cannot undo a stage that already completed. Results stay attached to the original retained Bridge message; they do not create another conversation or another message. Deleting, expiring or denying access to the original also prevents reading its saved result.
120
+
121
+ ## Release requirements
122
+
123
+ Release together: migrations `20261108040000_standard_bridge_messenger.sql` and `20261108060000_bridge_language_authorization.sql`, functions `external-app-bridge-messenger` and `external-app-usage`, and the speech worker duration endpoint, API router `/v1/bridge/messenger`, and core/server/Expo/web packages. Verify deployment before publishing supported install versions. Website/API uploads remain owner-operated.
124
+
125
+ Local verification uses synthetic accepted Bridge connections in an isolated service, through the public adapter and standard screens. iPhone and Android checks cover photo, video, document and voice upload/send/download, thumbnails, native voice playback, changing permissions and revoked access. Browser checks cover opening retained history and sending through the standard composer. Service checks cover original IDs, pagination, private access, duplicate prevention after a lost response and recovery after a missed notification. This is not a claim that a new push notification was delivered through Apple's or Google's service in this check.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ ## 0.18.0
2
+
3
+ Adds the standard Expo Bridge connector, original-message read receipts, retained history and shared attachment handling.
4
+
5
+ ## Unreleased
6
+
7
+ - Coalesce queued draft updates into one durable write while preserving reads, sends, clears and storage-error handling.
8
+
9
+ - Retain unchanged message rows and media-tool callbacks while updating permissions, reactions, translations, appearance and host controls normally.
10
+ - Keep calling-tool and group/notes contact references stable so typing does not redraw existing bubbles; group names and host contact changes still update normally.
11
+
12
+ - Complete Expo photo/video saving setup: declare the photo-library dependency and configure the required Apple and Android permissions through the shared setup plugin.
13
+
1
14
  ## 0.15.0
2
15
 
3
16
  ## 0.16.0
package/README.md CHANGED
@@ -165,7 +165,7 @@ The optional `@robono/messaging-react-native/expo` entry supplies recording, rev
165
165
  Install native dependencies with your Expo project's installer so their versions match your SDK:
166
166
 
167
167
  ```sh
168
- npx expo install expo-audio expo-image-picker expo-document-picker expo-file-system expo-sharing expo-video expo-crypto react-native-safe-area-context react-native-svg
168
+ npx expo install expo-audio expo-image-picker expo-document-picker expo-file-system expo-media-library expo-sharing expo-video expo-crypto react-native-safe-area-context react-native-svg
169
169
  ```
170
170
 
171
171
  This entry targets Expo SDK 55–56; the core components do not require Expo.
@@ -565,3 +565,23 @@ are display choices, never permission grants: entries still require the feature
565
565
  user authorization. Account access and permitted Block/Report actions stay available.
566
566
  A host-provided `appearance` overrides server appearance; omit it to follow saved
567
567
  website settings. A host-provided `companyName` overrides the configured app name.
568
+
569
+ ## Profile, media and chat options
570
+
571
+ The conversation menu provides Profile (Group details for groups), Shared media,
572
+ and Chat options. Chat options contains notification muting, Privacy Lens when
573
+ allowed, and confirmed deletion of the current user's chat history. Deleting a
574
+ chat leaves the other person's copy intact; a new incoming message can return
575
+ the chat to the inbox. The complete Messenger connects these actions to the
576
+ authenticated inbox automatically.
577
+
578
+ When composing only a conversation screen with your own inbox, supply
579
+ `conversationActions={{ muted, setMuted, deleteConversation }}`. Both callbacks
580
+ return a promise and must enforce the signed-in user's permissions on your
581
+ server. Unavailable actions are hidden. Website customization controls the
582
+ menu entries through `appearance.menus.chat.items.media` and `.options`; it
583
+ does not grant access that the user's permissions deny.
584
+
585
+ ## Existing Bridge friends
586
+
587
+ Open an already accepted external-app user ↔ Robono-user connection in the standard Messenger using the original connection ID and retained history. See [the Bridge Messenger guide](./BRIDGE-MESSENGER.md) and the included `examples/existing-bridge-chat.tsx`. This connector requires the matching core 0.13.0, server 0.32.0 and Expo 0.18.0 or web 0.17.0 release.