@ours.network/messenger-server 1.0.31-nightly.9 → 2.0.1

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.
package/README.md CHANGED
@@ -122,6 +122,23 @@ selectively consumes only those wire IDs. The general consuming `getMessages`
122
122
  operation is intentionally absent from the REST surface. Duplicate calls are
123
123
  harmless because only unread-to-read transitions produce receipt wire IDs.
124
124
 
125
+ Passive `GET /api/conversations/:contact/page` callers that do not display a chat-list
126
+ preview may pass `preview=none`. The response keeps `preview: ''` and all rows, counts,
127
+ receipts and cursors; older pages avoid the extra newest-message lookup. Omit the option
128
+ for the existing latest-message preview. Contact name/CID resolution is unchanged.
129
+ This opt-in applies to unbound REST pages; resource-bound reads keep their descriptor shape.
130
+
131
+ Contacts snapshots advertise `capabilities.canonicalPeerReads: 1`. Clients with an
132
+ authoritative CID can opt into `GET /api/peers/:cid/page`, `GET /api/peers/:cid/files`
133
+ and `POST /api/peers/:cid/read`. These paths validate an exact 64-character hexadecimal
134
+ CID and bypass name/contact enumeration, even after contact removal. Passive replies
135
+ include `peer: {kind: "cid", cid}`; page previews are omitted. The read command retains
136
+ the existing mutation-intent checks and consumes only unread wire IDs from that exact CID.
137
+ Messages/files resource descriptors opt in with `addressing: "cid"`; their bound reads
138
+ must use the matching peer path, with no change to legacy descriptor/query matching.
139
+ An older server's missing route must not trigger a legacy read fallback. Existing
140
+ name-based/default routes and send/file/command semantics remain unchanged.
141
+
125
142
  `GET /api/events` is a bounded SSE invalidation stream:
126
143
 
127
144
  - every connection begins with `sync_required(reason=connected)`;
@@ -404,3 +421,38 @@ Use the companion Fleet gateway and its local password/session authentication.
404
421
  See [Fleet setup and verification](docs/FLEET-PREVIEW.md) for connection requirements,
405
422
  current coverage and limitations. `npm run test:fleet` runs the current isolated fixture gates.
406
423
  The older mock walkthrough and its browser tests describe an earlier design stage.
424
+
425
+
426
+ ### Dedicated notification service
427
+
428
+ Set `OURS_NOTIFICATIONS_ORIGIN` and a Messenger-scoped `OURS_NOTIFICATIONS_PRODUCER_TOKEN` to forward incoming messages/files to [ours-notifications](https://github.com/adapt-toolkit/ours-notifications). Both settings must be provided together. The canonical watcher durably queues notifications even without a local push binding, freezes projected content before its first HTTP attempt, and retries the same payload after outages/restarts. Keep the Messenger state directory across restarts. When configured, new events use the dedicated service; legacy pending push jobs may finish. Existing standalone push endpoints remain for compatibility.
429
+
430
+ Workspace enrollment supports optional `preserveProfile: true` on its protected POST endpoint. This skips human profile creation/replacement (including an absent profile); root checks and the signed binding command remain mandatory. The protected enrollment-identity response advertises `preserveProfile: true` so clients can fail closed against older servers. Omitted/false keeps fresh-host account profile setup.
431
+
432
+ Messenger may run as the Human root or as a permanent identity under it. For the latter, the enrollment-identity response also carries `rootCid`, the root the daemon describes for the bound identity; `POST /api/identity/profile` accepts both. Only a Messenger bound to the root itself signs the workspace binding on `POST /api/workspace/enroll`; for an identity under the root the caller obtains that signature from the root outside Messenger.
433
+
434
+ After successful contact removal, the notification producer durably retires that
435
+ conversation through the notification service's scoped `/api/v1/delete-target`
436
+ route. Pending sends for that contact are removed; cleanup follows any already
437
+ inflight send and retries after service outages or restart. Watch replay confirms
438
+ absence against a complete contacts/pending inventory before dropping an event.
439
+ Inventory errors preserve the queue. The gateway and notification service must
440
+ support this producer lifecycle route before source cleanup can be delivered.
441
+
442
+ Profile-preserving workspace enrollment reuses an already authenticated contact
443
+ with the exact pinned enrollment server CID. This permits a fresh signed account
444
+ challenge after the one-time invitation was used for registration retirement;
445
+ account-side invitation provenance or an exact signed replacement handoff still
446
+ controls proof acceptance.
447
+
448
+ `POST /api/workspace/unregister` carries the first-party retirement command when
449
+ Messenger already holds the Human root lease. It requires local API/CSRF
450
+ authentication, a permanent root matching `rootCid`, the exact ready enrollment
451
+ server contact, and well-formed workspace/host/nonce identifiers. An optional
452
+ three-field replacement challenge is forwarded unchanged. The account service
453
+ owns retirement authorization and cleanup; this route only sends the signed
454
+ command and acknowledges submission.
455
+
456
+ Conversation notifications use `/fleet/chats/contacts/:contactId`, escaping the ID once and preserving the matching message anchor. Contact retirement matches canonical contact identity independent of filters and anchors. Deploy the app, notification service, and producers together: old query-based conversation links are intentionally unsupported. Previously frozen delivery URLs replay unchanged for idempotency, and unsupported persisted cleanup URLs remain pending without being sent or blocking canonical cleanup. Contact lifecycle authorization and inventory checks still apply.
457
+
458
+ Full resource SSE delivery and registered initial reads are documented in [docs/resource-delivery.md](docs/resource-delivery.md).
@@ -38,7 +38,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
38
38
  var define_MESSENGER_BUILD_INFO_default;
39
39
  var init_define_MESSENGER_BUILD_INFO = __esm({
40
40
  "<define:__MESSENGER_BUILD_INFO__>"() {
41
- define_MESSENGER_BUILD_INFO_default = { name: "@ours.network/messenger-server", version: "1.0.31-nightly.9", sha: "6a01873ba636d187e4410aef45723a5a77d7d691", dirty: true };
41
+ define_MESSENGER_BUILD_INFO_default = { name: "@ours.network/messenger-server", version: "2.0.1", sha: "30f29bbec997901e54fb70a1ddf72fd6eb91c509", dirty: false };
42
42
  }
43
43
  });
44
44