@moxuli/moremote 0.1.5 → 0.1.7

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 (38) hide show
  1. package/README.md +40 -15
  2. package/dist/cli.js +2 -1
  3. package/dist/cloud-client.d.ts +10 -1
  4. package/dist/cloud-client.js +43 -3
  5. package/dist/event-publication.d.ts +6 -0
  6. package/dist/event-publication.js +48 -0
  7. package/dist/journal.d.ts +3 -0
  8. package/dist/journal.js +7 -1
  9. package/dist/limits.d.ts +1 -0
  10. package/dist/limits.js +1 -1
  11. package/dist/live-activity.d.ts +60 -0
  12. package/dist/live-activity.js +131 -0
  13. package/dist/live-directory.d.ts +16 -0
  14. package/dist/live-directory.js +78 -0
  15. package/dist/local-enrollment.d.ts +1 -1
  16. package/dist/local-enrollment.js +1 -1
  17. package/dist/notification-preview.d.ts +29 -0
  18. package/dist/notification-preview.js +75 -0
  19. package/dist/official-client.d.ts +71 -0
  20. package/dist/official-client.js +63 -12
  21. package/dist/runtime.d.ts +2 -1
  22. package/dist/runtime.js +14 -13
  23. package/docs/STATE.md +70 -503
  24. package/docs/configuration.md +21 -1
  25. package/docs/journal/2026-11-14-state-before-0.1.6-part-1.md +400 -0
  26. package/docs/journal/2026-11-14-state-before-0.1.6-part-2.md +115 -0
  27. package/docs/journal/2026-11-15-custom-origin-release.md +35 -0
  28. package/docs/journal/2026-11-15-informative-notifications-and-settings.md +41 -0
  29. package/docs/journal/2026-11-15-remote-activity-local-acceptance.md +85 -0
  30. package/docs/plans/2026-11-10-notification-delivery.md +8 -0
  31. package/docs/plans/2026-11-14-custom-api-origin.md +69 -0
  32. package/docs/plans/2026-11-15-remote-activity-and-shared-events.md +99 -0
  33. package/docs/specs/01-architecture.md +3 -2
  34. package/docs/specs/02-encrypted-delivery.md +25 -0
  35. package/docs/specs/03-api-contract.md +47 -6
  36. package/docs/specs/05-endpoint-and-lifecycle.md +9 -1
  37. package/package.json +2 -2
  38. package/vectors/remote-activity-v2.json +30 -0
@@ -0,0 +1,85 @@
1
+ # Remote Live Activity delivery — local acceptance
2
+
3
+ Status: local implementation, unreleased. Existing deployed versions are unchanged.
4
+ The owner explicitly authorized sharing Cloudflare notifications with Live Activity
5
+ updates; widgets and ordinary app/extension reads remain direct Paseo clients.
6
+
7
+ ## Implemented behavior
8
+
9
+ Native rendering cannot network. The phone starts its normal aggregate activity,
10
+ observes ActivityKit token rotations, and registers that one activity across active
11
+ paired computers. Each source receives only a dedicated display key, encrypted
12
+ under its own pairing root. The local attribute seed never enters the service.
13
+ The CLI acquires a separate owned official read interest only when needed. It
14
+ publishes semantic candidates and notification attention in one bounded event
15
+ POST, retaining independent durable acknowledgements and immutable unknown retries.
16
+ Unchanged state creates no extra Worker request; display freshness renews at most
17
+ once per eight minutes. A definitively closed generation stops CLI retries.
18
+
19
+ An existing PAIRS namespace object arbitrates the phone-wide fair queue and last
20
+ opened fallback. A source-specific final sender fences APNs against current pair,
21
+ member, token and deadline authority. An unknown end cannot resume updates. Remote
22
+ APNs can update/end the existing activity while the app is suspended; a renderer
23
+ verifies ciphertext, subscription/generation, host/daemon/lifetime and route even
24
+ without a cached conversation. Foreground content has a bounded local lease.
25
+ Registration success alone never grants remote background writer ownership.
26
+
27
+ Token rotation reuses immutable interest. Cleanup compares registration AND client
28
+ revision, including compensating cleanup after a late PUT. A cold token wait is
29
+ not a disable; replacement snapshots are unknown, not empty/finished. Local
30
+ revocation writes throw before pairing-vault changes can commit. Explicit disable
31
+ also ends a restored native handle before its first directory publication.
32
+ A build with no signed push environment retains its original local activity type.
33
+
34
+ Only events and their private publish hop accept512KiB; other requests remain
35
+ 128KiB. Sources are bounded to100candidates,16members/512aggregate candidates,
36
+ 8KiB interests,2700byte individual ciphertexts and1,900,000byte aggregate storage. Native
37
+ APNs output is checked after final serialization against4KiB. A full100-target
38
+ long-Unicode fixture verifies the batch and does not widen command limits.
39
+
40
+ ## Verification
41
+
42
+ - CLI complete types/tests/build:249passed, zero failures before the final clock
43
+ tolerance correction; final affected7tests, fresh types/build also pass. An
44
+ actual RED/GREEN case aligns phone-created time with the envelope120second
45
+ tolerance, including future-clock refusal. Real pinned official
46
+ SDK legacy and owned wire flows both pass, without notification-interest widening.
47
+ - Cloud complete types/tests/Worker+Pages dry-run:202passed, zero failures. Actual
48
+ SQLite objects cover restart, two sources, shared acknowledgements, source revoke,
49
+ late registration, clock skew, token rotation, bounded body parsing, uncertain
50
+ APNs timestamps and irreversible end. Provider transport is synthetic, not Apple.
51
+ - Kit complete:554tests,5explicit environment skips, zero failures.
52
+ - Final hosted native regression:83passed, zero failures.
53
+ - Actual SpringBoard native journeys:2passed, zero failures; pending question
54
+ outranks its running turn, and isolated compact glyph pixels keep moving after
55
+ Home. Source-only DEBUG fixture reconnect ownership and Sendable capture were
56
+ corrected without changing product admission checks.
57
+ - Final unsigned Release build succeeds. The main app and all3extensions are
58
+ present; ActivityKit support and13loading fonts/30,040bytes independently verify.
59
+ - The real Node publisher's encrypted vector is decrypted by the bundled native
60
+ renderer with an empty conversation catalog; changed lifetime, topic tampering,
61
+ revoked grant and expiry fail closed.
62
+ - Read-only important-code review found and closed lifecycle/race/capacity defects;
63
+ its final source review reports no remaining definite P1/P2. No external review
64
+ service, real provider notification, device or Apple account was used.
65
+
66
+ Initial native UI attempts are retained: a push-unconfigured simulator exposed the
67
+ need to keep local creation; a real visible compact glyph exposed a test-only
68
+ minimum-width assumption (146.7pt versus177.3pt). The crop now follows actual native
69
+ container geometry and still requires isolated moving glyph pixels. Initial
70
+ unknown numeric system errors and directory-start timeouts are not erased. The
71
+ DEBUG reconnect factory now owns fresh streams for each foreground attempt.
72
+
73
+ Evidence is outside the repository at
74
+ `/Users/yangxiaoming/Documents/MoRemoteAcceptance/notification-content-20261115-eoaqf6yx`:
75
+ `remote-activity-cli-accepted-check.log`, `remote-clock-green.log`, `remote-activity-cloud-check.log`,
76
+ `remote-activity-kit-check.log`, native xcresults and the source manifest.
77
+
78
+ ## Explicit remaining release boundary
79
+
80
+ No push-to-start is implemented: a new activity after termination/expiry still
81
+ needs the foreground app. Actual device APNs delivery and OS throttling behavior
82
+ have not been accepted. Complete rollout requires the corresponding App, CLI and
83
+ Worker versions; no new deployment, package publication or TestFlight delivery
84
+ was performed. Native APNs has separate alert/activity tokens/topics, so a shared
85
+ public event POST does not mean one Apple request or a claimed billing percentage.
@@ -116,3 +116,11 @@ resource/key/permission/billing mutations requiring point-of-risk interactive
116
116
  confirmation. No deployment, Apple activation, physical delivery, public
117
117
  publication or everyday-host service installation is claimed by this update.
118
118
 
119
+
120
+ ## November15 informative-alert iteration
121
+
122
+ The owner approved useful session/content notifications. The optional encrypted
123
+ preview, native offline display and passive compatibility contract extend only
124
+ ordinary notifications, preserving original commands, expiry and authority. Local
125
+ implementation and acceptance: [[2026-11-15-informative-notifications-and-settings]]. No new
126
+ publishing/deployment/Apple or real notification operation is included.
@@ -0,0 +1,69 @@
1
+ # Custom notification API origin
2
+
3
+ Owner-authorized preparation for the registered `moxuli.com` domain. Keep DNS
4
+ with Aliyun and bind `api.moremote.moxuli.com` to the existing Pages/Worker
5
+ notification service. This CLI branch performs no DNS/service deployment,
6
+ version bump, publication, real enrollment or service registration.
7
+
8
+ ## Acceptance and authority
9
+
10
+ - New explicit setup, its published local descriptor and expert `pair` use
11
+ `https://api.moremote.moxuli.com` only when config has no API origin.
12
+ - Reuse the existing `DEFAULT_API_ORIGIN` export; remove the separate expert
13
+ pairing literal. Default selection is not an implicit configuration migration.
14
+ - Preserve every existing configured origin, including the Pages default, and
15
+ every active/revoked/pending pair's original API authority and secrets.
16
+ - Resume retained enrollment requests with original request/offer/create bytes;
17
+ do not regenerate offers, extend expiry, replay uncertain mutations or redirect
18
+ enrolled phones to another origin.
19
+ - Both domains must directly reach the same notification backend. Widgets and
20
+ Live Activities acquire no new Cloudflare dependency.
21
+
22
+ ## Implementation and verification
23
+
24
+ `src/local-enrollment.ts` owns the shared default; existing setup and discovery
25
+ already consume it. `src/cli.ts` imports it for expert pairing. No encryption,
26
+ notification dispatch, official protocol, retry or service ownership behavior
27
+ changes.
28
+
29
+ Add regressions first: assert the literal new origin in fresh setup and its
30
+ descriptor, execute the real CLI expert onboarding against an in-process relay,
31
+ and preserve a saved Pages configuration with active/revoked/pending pairings
32
+ and immutable enrollment bytes. CLI fixtures replace native service-manager
33
+ queries with a temporary Node process that reports absent registration and
34
+ rejects lifecycle operations; a real installed service must never be consulted.
35
+
36
+ Integration owner runs:
37
+
38
+ ```sh
39
+ node --import tsx --test tests/local-enrollment.test.ts tests/pair-onboarding.test.ts tests/setup-command.test.ts tests/setup-migration.test.ts
40
+ npm run check
41
+ ```
42
+
43
+ Baseline RED: fresh setup selected the old Pages domain; the retained Pages
44
+ compatibility regression passed. The initial expert fixture stopped at
45
+ `FOREIGN_SERVICE_REGISTRATION` during diagnostics because changing HOME does
46
+ not isolate a native manager's real user domain. Correct the fixture rather
47
+ than weakening production ownership checks. Passing acceptance remains for
48
+ the integration owner to record after implementation.
49
+
50
+ ## Publication gate
51
+
52
+ Do not publish a CLI containing the new default until authoritative DNS,
53
+ certificate validation and direct HTTPS service behavior succeed on the
54
+ custom domain. Also verify the former Pages domain still directly serves the
55
+ same backend and existing pairings remain usable. Aliyun DNS entry and
56
+ Cloudflare binding are owned by the integration/deployment task. Keep the
57
+ package version unchanged during preparation; record final external evidence
58
+ and make any release decision separately.
59
+
60
+ ## Local verification and release gate
61
+
62
+ The custom hostname is active. Independent DNS, certificate and direct JSON API
63
+ reads pass on both origins without redirects. Full local check:238 tests, zero
64
+ failures; the actual packaged upgrade/rollback smoke, tag validation and
65
+ deterministic0.1.6 pack pass. A subsequent test-only Windows preload URL
66
+ correction passes both actual CLI fixture suites (5 tests). Independent quality
67
+ re-review clears the source; actual Windows, Linux and macOS CI remains required
68
+ before tagging. The published package remains0.1.5 until the release receiver
69
+ independently confirms0.1.6. No real service registration was performed.
@@ -0,0 +1,99 @@
1
+ # Remote Live Activities through shared notification delivery
2
+
3
+ Status: owner-requested implementation, unreleased. This supersedes only the
4
+ previous prohibition on ActivityKit APNs; widgets stay independent of cloud.
5
+
6
+ ## User contract
7
+
8
+ Preserve one aggregate island per phone across paired computers. Pending new
9
+ questions/approvals and real completion/error occurrences receive fair sequential
10
+ presentation (eight seconds with ongoing work, fifteen seconds for final notices).
11
+ Without new notices choose the most recently opened ongoing conversation. No
12
+ confirmed ongoing work and no pending announcement means no activity; an unknown
13
+ source is never treated as proof of completion. No manual tracking, second
14
+ enablement, continued app execution requirement or extra sound is introduced. Existing
15
+ local-only behavior remains available without the optional computer CLI.
16
+
17
+ ## Confirmed platform facts
18
+
19
+ Apple does not allow a Live Activity renderer to access the network. Native
20
+ ActivityKit APNs can start/update/end it without a continually running app.
21
+ Use token-based unicast, not public broadcast channels. Observe token rotations,
22
+ use the separate liveactivity APNs topic/type, and send only bounded content-state.
23
+ This implementation remotely updates/ends an activity that the foreground app
24
+ has already started. Push-to-start is not implemented or claimed. A new activity
25
+ after expiry/termination still requires opening the app; raw stateKey is never
26
+ uploaded in push-to-start attributes.
27
+ OS delivery budgets, disconnected phones, disabled activities and force-quit
28
+ behavior are system constraints, not an always-delivered guarantee.
29
+
30
+ References:
31
+ - https://developer.apple.com/documentation/activitykit/displaying-live-data-with-live-activities
32
+ - https://developer.apple.com/documentation/activitykit/starting-and-updating-live-activities-with-activitykit-push-notifications
33
+
34
+ ## Shared transport and ownership
35
+
36
+ Use the existing paired CLI observer, HTTPS ingress, PAIRS namespace, APNs signer
37
+ and retry machinery. A phone-installation aggregate coordinator serializes all
38
+ paired host contributions; independent hosts must never race the same token.
39
+ Reuse a paired event-batch request for notification attention and ActivityKit
40
+ changes. Control polling passively returns activity subscription metadata; no
41
+ new capability polling, widget feed or phone status polling is introduced.
42
+ Only semantic state changes publish; token registration/rotation and bounded
43
+ freshness renewal are separate infrequent operations. Spinning/prose streaming
44
+ never produce Worker requests. Ordinary notifications and silent activity pushes
45
+ may require distinct APNs requests; they cannot share an Apple token/type.
46
+
47
+ ## Confidentiality and authority
48
+
49
+ No endpoint root, command/control key, provider credential, host password or
50
+ plaintext title/question/response enters the cloud. Each host contribution is
51
+ sealed with its pair's dedicated activity-state key. The renderer uses protected
52
+ local display-only keys, exact host/daemon/pair lifetimes and authenticated route
53
+ identities; a new background conversation need not already be in the local catalog.
54
+ Public minimal phase/occurrence routing metadata is documented separately from
55
+ encrypted labels and navigation. No display record can execute an operation.
56
+
57
+ Phone-scoped configuration binds the installation, coordinator capability,
58
+ ActivityKit type/environment/token generation and enabled host membership. Host
59
+ credentials only submit their own contribution; they cannot register another
60
+ phone or choose arbitrary provider topics. Local disable/delete/re-pair fences
61
+ rendering synchronously; durable cloud retirement and exact registration compare
62
+ prevent old retries from moving to a replacement token or reviving a stopped run.
63
+
64
+ ## Lifecycle and ordering
65
+
66
+ Persist occurrence/fair queue and outbound attempt identity before provider I/O.
67
+ Exact retries retain bytes and APNs identity. Coalesce routine state while keeping
68
+ new questions/approvals/completions distinct. Late state generations cannot
69
+ regress a newer observation. APNs timestamps are monotonically ordered per
70
+ aggregate; return to foreground reconciles authoritative Paseo state and existing
71
+ system activities without duplicating them. Eight-hour activity expiry and
72
+ start/update token rotation must be explicit, including failed or delayed starts.
73
+
74
+ ## Implemented bounds and ordering
75
+
76
+ The shared events ingress and private publish hop alone accept512KiB; ordinary
77
+ requests remain128KiB, each interest8KiB and each encrypted candidate2700bytes.
78
+ There are at most100candidates per source,512per aggregate,16paired sources,
79
+ and1,900,000bytes per aggregate storage row. CLI pending-publication storage is bounded to
80
+ 1MiB. Real100-target long-label regressions cover the full budget end to end.
81
+ Token-only registration reuses immutable interest; replacement contributions are
82
+ unknown until observed. Cleanup binds member registrationId AND client revision.
83
+ A server wall clock never replaces the client's registration version. App local
84
+ background writes yield only after the native activity contains a valid v2
85
+ payload, not after HTTP registration. Foreground local rendering has a45second
86
+ lease refreshed by existing publication, with no network timer.
87
+
88
+ ## Acceptance
89
+
90
+ Test real bundled decoder/routes, not a catalog-only replay. Cover two computers
91
+ and multiple conversations, pending question during running, sequential final
92
+ notices, last-opened fallback, app absent, cold new conversation, out-of-order
93
+ state, expiry, restart, token rotation, dismissal/disable/revocation races, full
94
+ four-kilobyte payload limits, immutable uncertain retries and zero polling for
95
+ unchanged state. Native simulated delivery is separate from real device APNs
96
+ acceptance. Publish actual request-count evidence for shared event ingress.
97
+
98
+ No new cloud deployment, public CLI package, Apple capability/key, persistent
99
+ service or TestFlight delivery is included in local implementation acceptance.
@@ -104,8 +104,9 @@ publication remains separately authorized.
104
104
  ## Notification-only cloud boundary — November 14
105
105
 
106
106
  The optional companion publishes only current question/approval forms and their
107
- exact occurrence bindings. It does not request provider usage or upload task
108
- titles, host/project labels or a conversation directory. Accepted source reads
107
+ exact occurrence bindings. It does not request provider usage or upload a conversation directory. A current
108
+ alert may carry its bounded title, host label and excerpt only inside the optional
109
+ endpoint-encrypted preview described in02. Accepted source reads
109
110
  retain pending requests outside the bounded recent discovery page; stale reads
110
111
  and resolved/replaced occurrences cannot restore them. Publication changes are
111
112
  deduplicated; only pending hydration renews near expiry, and one empty publication
@@ -184,6 +184,31 @@ it does not execute or renew an expired command, question or approval. The norma
184
184
  command decoder and recipient pre-dispatch expiry checks remain strict.
185
185
 
186
186
 
187
+
188
+ ### Encrypted notification presentation — unreleased November 15
189
+
190
+ An attention POST may additionally carry `preview`, a separately sealed attention
191
+ channel envelope with the exact same pair, ID, issuedAt and expiresAt as `envelope`.
192
+ Its plaintext is exactly `{type:"notificationPreview",version:1,agentId,kind,
193
+ timestamp,title,hostName,body}`. Identity/kind/time must match the authenticated
194
+ route. It uses a fresh random nonce under the existing independently derived
195
+ attention key; legacy route plaintext and action authority are unchanged.
196
+ Title/host/excerpt limits are256/128/960 UTF-8 bytes. Only current-turn assistant
197
+ prose or the exact current question/approval/error is included, never reasoning,
198
+ tool output or a full transcript. A finished event may read one canonical30-entry
199
+ tail with a five-second timeout; recovery uses at most two concurrent tails,
200
+ checks the same terminal identity and does not block control/directory polling.
201
+
202
+ Cloud never decrypts previews. The complete APNs JSON in either locale must fit
203
+ 4,096 bytes; endpoints reduce or omit only the optional preview before immutable
204
+ publication. Retry never changes already journaled bytes. Expiry/revoke removes
205
+ both ciphertexts at the original route deadline; audit digests do not renew them.
206
+ A native notification service extension authenticates/decrypts locally, with only
207
+ the derived attention display key in protected shared Keychain storage. It retains
208
+ the original category/actions/userInfo. No network lookup or extra cloud request
209
+ is required. Missing keys, unavailable extension or invalid preview retain a safe
210
+ localized fallback; an authenticated legacy route may use cached local labels.
211
+
187
212
  ## Required evidence
188
213
 
189
214
  Cross-runtime vectors cover exact encryption/decryption and authenticated metadata;
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## Common rules
6
6
 
7
- Base path is `/v1`. JSON is UTF-8 with bounded body parsing (128 KiB). Responses
7
+ Base path is `/v1`. JSON is UTF-8 with bounded body parsing (128 KiB; shared v2 events512KiB). Responses
8
8
  use `{ok:true,...}` or `{ok:false,error:{code,message}}`; errors contain concise
9
9
  codes, never raw private payloads. TLS is required except explicit loopback dev.
10
10
  UUID identifiers are lowercase canonical strings. Timestamps are integer epoch
@@ -145,14 +145,14 @@ No official heartbeat/read acknowledgement is sent by the companion.
145
145
 
146
146
  ### POST /pairs/{pairId}/attention; GET /pairs/{pairId}/attention/{eventId}
147
147
 
148
- Host writes, phone reads exact event. Body `{id,kind,topic,envelope}`; kind is
148
+ Host writes, phone reads exact event. Body `{id,kind,topic,envelope,preview?}`; kind is
149
149
  `finished|question|permission|error`, envelope channel `attention` and ID `id`.
150
150
  Encrypted content contains `{agentId,requestId?,requestBinding?,kind,timestamp}`;
151
151
  question/permission attention includes the exact companion-issued requestBinding.
152
152
  Event identity is stable across reconnect/retry. Exact retry does not send another
153
153
  push; conflicting bytes are rejected. Only currently valid events get attempts.
154
154
  Suppress this app's push if a genuine unexpired matching presence lease exists.
155
- No inference from the official shouldNotify flag. APNs copy is generic/localized.
155
+ No inference from the official shouldNotify flag. APNs fallback copy is generic/localized.
156
156
 
157
157
  Persist notification attempt state before I/O. A lost APNs response is uncertain,
158
158
  not proof of failure; retries reuse the same apns-id/collapse identity with bounded
@@ -304,8 +304,8 @@ Delivery states are `queued|inflight|retry|uncertain|accepted|rejected|unavailab
304
304
  suppressed|expired|revoked|resolved`; they never assert display or acknowledgement.
305
305
  Missing configuration is `unavailable`, not provider acceptance.
306
306
 
307
- APNs custom data is exactly `pairId,eventId,kind,route`, beside generic localized
308
- `aps`. `route` is the original attention envelope, never a plaintext conversation
307
+ APNs custom data is `pairId,eventId,kind,route` plus optional encrypted `preview`,
308
+ beside localized fallback `aps` with `mutable-content:1`. `route` is the original attention envelope, never a plaintext conversation
309
309
  identifier. Attention ingestion rejects any event whose complete alert payload
310
310
  would exceed4,096 UTF-8 bytes in either supported locale (`413`,
311
311
  `apns_payload_too_large`), even before a device registers. No route is silently
@@ -399,7 +399,7 @@ most32 entries;32 near-maximum envelopes can approach4MiB. Exact command reads
399
399
  may contain both original128KiB-bounded payload and a separate8KiB receipt; a
400
400
  host pairing response may contain two bounded proofs. A128KiB response reader
401
401
  would permanently reject valid work and is nonconforming. This larger response
402
- budget never raises the128KiB request or64KiB decrypted command-content limits.
402
+ budget never raises the128KiB ordinary-request or64KiB decrypted command-content limits.
403
403
 
404
404
  ### Retired system-surface routes
405
405
 
@@ -410,3 +410,44 @@ these features remain. Durable Object initialization purges legacy surface rows;
410
410
  notification device, attention, operation and control records remain intact.
411
411
  Widgets and local ActivityKit read/update through the official Paseo path and
412
412
  shared device state, independently of this notification service.
413
+
414
+
415
+ ## Optional preview interoperability — unreleased November 15
416
+
417
+ Successful authenticated pair responses advertise
418
+ `x-moremote-notification-preview:1`; existing successful response bodies remain
419
+ unchanged. A new companion observes this passively on existing control reads
420
+ before adding `preview` to a newly journaled attention event. An older relay gets
421
+ the immutable legacy shape, without an extra capability request. Existing
422
+ journaled events are never resealed or stripped after attempted publication.
423
+ A new relay accepts both exact legacy and exact optional-preview shapes. Preview
424
+ metadata must match the route interval, pairing, attention channel and event ID;
425
+ unknown fields remain invalid. The same event's digest covers both ciphertexts.
426
+ Both are actively erased on original expiry/revoke. Existing attention GET
427
+ response names, attempt/registration fences, uncertain outcomes, categories and
428
+ reply/current-request validation are unchanged. New apps can label legacy alerts
429
+ from authenticated local cache; old apps retain the safe localized alert fallback.
430
+
431
+ ## Remote activity v2 (unreleased)
432
+
433
+ Only the authenticated phone may PUT `/pairs/:id/live-activity` with
434
+ subscriptionId, generation, monotonic client revision, activity token/environment,
435
+ startedAt, deadline, encrypted interest and a32byte aggregate membership capability.
436
+ DELETE takes `{revision}` and cannot retire a newer registration. Interest is
437
+ bounded to8KiB and8hours; the separate local rendering seed never enters cloud.
438
+ The existing host controls response passively includes registrationId/interest
439
+ and `x-moremote-live-activity:2`; no capability probe is added.
440
+
441
+ Host POST `/pairs/:id/events` takes `{attention:[...],activity?:contribution}`.
442
+ This route and its private publish hop alone allow512KiB; other requests remain
443
+ 128KiB. Attention has at most8 original immutable events, independent per-ID ACKs;
444
+ activity has a separate accepted result, registrationId and increasing sequence.
445
+ Each source may publish100 candidates (aggregate512 across16pairs), with encrypted
446
+ payloads at most2700bytes each. Opaque topic/cycle/event identities plus minimal
447
+ phase/ordering metadata support fair arbitration; titles/routes remain encrypted.
448
+ Provider content-state is `{payload:string}` containing the bounded v2 wrapper.
449
+ APNs uses liveactivity type, `<bundle>.push-type.liveactivity` topic, priority5
450
+ for routine updates/10for attention or end, ordered epoch-second timestamps,
451
+ stale-date and immediate end dismissal. Apple4KiB limits are checked after final
452
+ serialization. Registration, exact retries, revocation and end never authorize
453
+ commands. Legacy activity/widget routes remain410. No push-to-start is implemented.
@@ -123,13 +123,21 @@ The companion persists its root/host/enrollment capabilities before POST pairs,
123
123
 
124
124
  Unreleased source onboarding: invoking `pair` is explicit cloud consent. If
125
125
  `apiOrigin` is absent, select the built-in
126
- `https://moremote-cloud-ingress.pages.dev`; otherwise preserve and validate the
126
+ `https://api.moremote.moxuli.com`; otherwise preserve and validate the
127
127
  configured origin. Existing target, local official discovery and daemon pin
128
128
  remain authoritative. Persist cloud-enabled configuration and the new offer
129
129
  only after the official connection succeeds, before relay creation. Retained
130
130
  pair keys, origins and revocation are never changed by a new enrollment.
131
131
  Passive config loads/check/status do not opt in, and pairing installs no service.
132
132
 
133
+ Explicit setup, the discovery descriptor and expert `pair` share this one
134
+ default. A saved `apiOrigin`, including the former default
135
+ `https://moremote-cloud-ingress.pages.dev`, is never replaced on upgrade/setup.
136
+ Retained per-pair origins, pending request/offer bytes and cloud-create bytes are
137
+ unchanged. Both domains directly serve the same notification backend; the
138
+ default change authorizes no redirect, old-pair migration or protocol change.
139
+ Custom-domain DNS/TLS verification is a release prerequisite.
140
+
133
141
  ## Official compatibility and observation
134
142
 
135
143
  Pin client/protocol0.15.3. createHostClient from client/node and exported internal/daemon-client types are the inspected API. Use clientType cli and a distinct companion clientId. Missing explicitEventSubscriptions fails closed. Subscribe only agent_attention_required, agent_permission_request, agent_permission_resolved, status.server_info with official remote notifications disabled. Never call client_heartbeat, clear_agent_attention, workspace read acknowledgement or register_push_token. Inspected SDK automatic liveness uses bare protocol ping (10s), not visible-user presence. Actual synthetic WebSocket consumers exercise the real adapter/SDK, await that liveness interval, verify wire traffic, then lose send/permission acknowledgements and reconnect without a second mutation.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moxuli/moremote",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "Optional encrypted notification and scoped-action companion for Paseo",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -57,6 +57,6 @@
57
57
  "@types/ws": "8.18.1",
58
58
  "tsx": "4.20.6",
59
59
  "typescript": "5.9.3",
60
- "ws": "8.20.0"
60
+ "ws": "8.21.0"
61
61
  }
62
62
  }
@@ -0,0 +1,30 @@
1
+ {
2
+ "seed": "CQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQk=",
3
+ "displayKey": "1QT5c2Hk0zwEHMQZgTEPt7Q4gp3f/9WogCuwKO3Uza8=",
4
+ "pairID": "11111111-1111-4111-8111-111111111111",
5
+ "subscriptionId": "22222222-2222-4222-8222-222222222222",
6
+ "generation": "33333333-3333-4333-8333-333333333333",
7
+ "hostLifetime": "55555555-5555-4555-8555-555555555555",
8
+ "createdAt": 1800000000000,
9
+ "deadline": 1800028800000,
10
+ "measuredAt": 1800000001000,
11
+ "payload": {
12
+ "version": 2,
13
+ "subscriptionId": "22222222-2222-4222-8222-222222222222",
14
+ "generation": "33333333-3333-4333-8333-333333333333",
15
+ "pairId": "11111111-1111-4111-8111-111111111111",
16
+ "topic": "ZTaB48TokA_u56qDAnDiSJEWBkMTsKwn2JSDoFymVFE",
17
+ "envelope": {
18
+ "version": 1,
19
+ "pairId": "11111111-1111-4111-8111-111111111111",
20
+ "id": "7f46cb05-e593-4826-b9f2-9272df7824b9",
21
+ "channel": "activityState",
22
+ "issuedAt": 1800000001000,
23
+ "expiresAt": 1800000601000,
24
+ "nonce": "W3vHmDd5qoqXmEcu",
25
+ "ciphertext": "EnWYfp_S1WYPPsJ0Z6beTGEJ1AMl-uvpK2kxvHms9170jWHl_Z-9qI2MbTLi5yK3QxSHFFn5YrbJWvIsXlN9rmyx6caqcWJllw9xZ31aGmuxgLl3E1oPtnhc-uuWNHOJk75M21m0g7bhY5I-Y6LqPWcfoz3StX6tC_FDt9ZSGrA6r1D4S8hjfzc4WEUuAfbTcFAnTJGZcB3To2J5WDyp6L7J9BSIR4IrHXvDDUj35dWmcoEF7-CbSxBlD6mUfl0UofXl1NaVjIDvF9K05a2mwzC_mAGklGEjWPrtpYi1BI1x1gobN9gKFuRK95UlK-hJFwGW35ztd4yznxQhDIDTsGehcT_WjdQdj_Yo3FbpWsaWYhQ5lu9ySWFdpk1mdgrWDMRGmD45Z7Ko0QLHSLBptYZaYAfVxW1B3fvLOc1xVhI4rm18_AuSvEmBhI6LmLxA_jP20T8E3btcMrqbxSdfzlKoPdXyId0sm_xIk5m9X98XosqIyjlkLCexKsKQStlT-Ibbeu1jT_E84ZZiuuyH7KQIXm30U6ihRECOnWy42EyWia_gLo3sTd_CBF5d_wadK95kledaKQsGUHiNieKew8d5LFAhiQNj7qPdLdYFFzolovQ3sjPDlcsO74WjFUBBdHwVf2fsxOhwsVwGU2snam-HWI7FUqmfvgyUio6kZlTDhFa0DMh5SUUgks3yZ5heoKsvsHxcez8BLw_LEj9_l7qqjlEtLSxWneiJ6eRX4bKyIJYk3bZhN7LJYQpVoy6ZQTAWR4Qyr97gsuEVmrGgIvQ"
26
+ },
27
+ "ongoingCount": 2,
28
+ "waitingCount": 1
29
+ }
30
+ }