@witbitz/sdk 4.8.0 → 4.9.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.
package/l1-worker.js CHANGED
@@ -14,11 +14,12 @@
14
14
  // locally rather than round-trip.
15
15
  import { routingIndex } from './opRouting.js'
16
16
  import { prefetchUsable, positionOf, prefetchAnswer, prefetchHashKey } from './prefetchPoll.js'
17
- import { configureOhttp, requireOhttp, ohttpRequired, workerEnvelopeTransport, makeSpaceClient, setAttestProvider, setPushSelf, setPushAcct, pushAcctSecretOf, viewingTag } from './spaceClient.js'
17
+ import { markOhttpPending, resolveOhttpPending, configureOhttp, requireOhttp, ohttpRequired, workerEnvelopeTransport, makeSpaceClient, setAttestProvider, setPushSelf, setPushAcct, pushAcctSecretOf, viewingTag } from './spaceClient.js'
18
18
  import { idb } from './idb.js'
19
19
  import { armIdbNaming, setIdbNaming } from './idbSeal.js' // §NAMES (docs/desktop-protection.md phase 2): this realm's store keeps opaque names on a protected device
20
20
  import { _hasGzip, _jsonBytes, gunzipB64, gzipB64 } from './compress.js' // Atlas index docs: gzip/absorb/inject worker-side
21
- import { combineShares, commit as commitMk } from './e2ee.js' // §9 split-key: reconstruct mk = userShare ⊕ appShare inside the worker (confinement mode)
21
+ import { isSealedAppRoom } from './sealedRoomWire.js'
22
+ import { newKey, combineShares, commit as commitMk } from './e2ee.js' // §9 split-key: reconstruct mk = userShare ⊕ appShare inside the worker (confinement mode)
22
23
  import { deriveNotifKey } from './notifKey.js'
23
24
  import { importRaw as importSealKey, sealIf, open as openSealed, isSealed } from './deviceSeal.js' // DEVICE STORAGE PROTECTION (docs/device-storage-protection.md): with the switch on, every key this worker persists is ciphertext under a key held only HERE, in memory
24
25
  import { sealDoc, openDoc, isSealedDoc, rawSealKey } from './accountSeal.js' // acctSeal / acctOpen: room messages sealed under the account key (roomMail.js); rawSealKey: the temp index's own seal key
@@ -28,7 +29,7 @@ import { openRoomStream } from './roomStreamClient.js' // ROOM STREAMS: the sock
28
29
  import { roomRegion, DEFAULT_REGION } from './regions.js' // a room's region is in its id — its enclave's key seals it
29
30
  import { opensEnvelopes, sealsIdentity } from './reqEnvelope.js' // does a live enclave open the sealed request envelope
30
31
  import { gatedKey } from './enclaveAccept.js' // the user's accepted builds: the SAME seal gate as enclave.js, run here because mk is sealed HERE // §Phase-4: mirror NK=HKDF(mk,'notif') to idb HERE (the confined kernel) so vault-sw.js gets a preview key for SPLIT rooms — whose mk only ever materializes in this worker, never the main-thread loader (that's why split rooms showed the generic nudge)
31
- import { signInOf, SIGNIN_RENEW_AUTH } from './roomPass.js' // the room pass: which sign-in a request carries (the page answers for it)
32
+ import { makeAccountRoomAccess, ACCOUNT_ROOM_ASK, signInOf, SIGNIN_RENEW_AUTH } from './roomPass.js' // the room pass: which sign-in a request carries (the page answers for it)
32
33
  // One room's stream socket here (the key never leaves): events go up to the page; `tag` names this device as viewing it.
33
34
  // A CARRIED ENTRY (roomStreamClient `tail`): kept here, beside the key, for the poll the event asks for — the page gets the event
34
35
  // without the box. room → { count, box, at }; used once, for a poll from count-1, within FRAME_TAIL_MS.
@@ -98,6 +99,7 @@ let pushAcctRoom = ''
98
99
  const derivePendingAcct = async () => { const mk = pushAcctRoom && mks.get(pushAcctRoom); if (!mk) return; pushAcctRoom = ''; try { setPushAcct(await pushAcctSecretOf(mk)) } catch { /* */ } }
99
100
  let storageEpoch = 0, storageWiped = false
100
101
  let nkClear = false // §PREVIEWS (opt-in under protection): the push-preview keys (nk:) are written CLEAR so a locked device's tickle still shows sender + first line; everything else stays sealed
102
+ let memoryOnlyVisit = false // a 'memoryOnly' visit (a room link on an unsecured computer, a guest's demo link): nothing reaches the disk
101
103
  let protectedAtRest = false // sealed entries were seen at boot (or `seal` ran): the store is protected — NEVER write a clear key over it
102
104
  const parked = new Map() // idb key ('mk:'/'us:'/'nk:' + room) → sealed blob awaiting the device key
103
105
  // A key that reaches a protected-but-locked worker (the page re-sends a room key it still holds at open) stays in memory
@@ -113,7 +115,7 @@ const roomOfKey = (k) => String(k).slice(String(k).indexOf(':') + 1)
113
115
  const memOnlyRoom = (room) => volatile.has(room) || String(room).startsWith('tmp-')
114
116
  const persist = (k, v) => {
115
117
  const epoch = storageEpoch
116
- return storageWiped || memOnlyRoom(roomOfKey(k)) ? Promise.resolve() : keysReady.then(() => ((!sealKey && protectedAtRest) ? undefined : sealIf(sealKey, v).then((stored) => epoch === storageEpoch && !storageWiped ? idb.set(k, stored) : undefined))).catch(() => {})
118
+ return storageWiped || (memOnlyRoom(roomOfKey(k)) && !(k.startsWith('us:') && isSealedAppRoom(roomOfKey(k)))) ? Promise.resolve() : keysReady.then(() => ((!sealKey && protectedAtRest) ? undefined : sealIf(sealKey, v).then((stored) => epoch === storageEpoch && !storageWiped ? idb.set(k, stored) : undefined))).catch(() => {})
117
119
  } // a wipe also cancels keys whose asynchronous sealing was still running
118
120
  // AN ATTESTED ROOM'S PREVIEW KEY (the owner, 2026-11-24: "the notification preview for attested rooms doesn't work"): its room key stays
119
121
  // in this worker's memory, so the vault — whose service worker and native shell show the notification — never learned its preview key.
@@ -133,7 +135,7 @@ const backwards = (room, held, incoming, ep) => held !== incoming && (Number(ep)
133
135
  // never hands the frame or the next worker the old one. Only a key with an epoch, only when it changed. The vault page is
134
136
  // this worker's owner and already holds every key; the regular app's page ignores the message.
135
137
  const tellEpoch = (room, ep, key) => { if (volatile.has(room) || String(room).startsWith('tmp-')) return; try { self.postMessage({ t: 'keyEpoch', room, ep, ...key }) } catch { /* */ } } // never a memory-only (attested) or temporary room's key: the vault would keep it in its account cache
136
- const keep = (room, mk, ep) => { if (backwards(room, mks.get(room), mk, ep)) return false; if ((Number(ep) || 0) > 0 && (mks.get(room) !== mk || Number(ep) > (eps.get(room) || 0))) tellEpoch(room, Number(ep), { mk }); if (ep) noteEp(room, ep); mks.set(room, mk); rekeyStream(room, mk); persist('mk:' + room, mk); deriveNotifKey(mk).then((nk) => persistNk(room, nk)).catch(() => {}) } // + NK mirror: every mk the kernel holds (normal OR reconstructed-split) yields a push-preview key, so a background notification for THIS room shows sender+text (vault-sw.js notifPreview), not the generic nudge
138
+ const keep = (room, mk, ep) => { if (isSealedAppRoom(room)) return false; if (backwards(room, mks.get(room), mk, ep)) return false; if ((Number(ep) || 0) > 0 && (mks.get(room) !== mk || Number(ep) > (eps.get(room) || 0))) tellEpoch(room, Number(ep), { mk }); if (ep) noteEp(room, ep); mks.set(room, mk); rekeyStream(room, mk); persist('mk:' + room, mk); deriveNotifKey(mk).then((nk) => persistNk(room, nk)).catch(() => {}) } // + NK mirror: every mk the kernel holds (normal OR reconstructed-split) yields a push-preview key, so a background notification for THIS room shows sender+text (vault-sw.js notifPreview), not the generic nudge
137
139
  // WHY a room has no key, per room — the worker's own verdict rides the no_key answer (the owner's trail said only "no key on
138
140
  // this device" while the index held a share for every room, 2026-10-03).
139
141
  const APPSHARE_URL = (() => { try { const o = self.location && self.location.origin; return (o && o !== 'null') ? o + '/api/appshare' : '/api/appshare' } catch (e) { return '/api/appshare' } })()
@@ -161,7 +163,7 @@ async function heldMatchesShare (room, have) {
161
163
  dropOldKey(room); return false
162
164
  }
163
165
  const dropOldKey = (room) => { if (!mks.has(room)) return; const h = streams.get(room); if (h) { h.s?.stop(); h.mk = null; h.grants = null }; grantsByRoom.delete(room); mks.delete(room); keysReady.then(() => idb.del('mk:' + room)).catch(() => {}) }
164
- const keepSplit = (room, sp, ep) => { if (backwards(room, splits.get(room) && splits.get(room).userShare, sp.userShare, ep)) return false; if ((Number(ep) || 0) > 0 && ((splits.get(room) || {}).userShare !== sp.userShare || Number(ep) > (eps.get(room) || 0))) { tellEpoch(room, Number(ep), { split: { userShare: sp.userShare, commit: sp.commit || '' } }); if (Number(ep) > (eps.get(room) || 0) || (splits.get(room) || {}).userShare !== sp.userShare) dropOldKey(room) } if (ep) noteEp(room, ep); const held = splits.get(room); if (held && held.userShare !== sp.userShare) { const alts = splitAlts.get(room) || []; if (!alts.some((a) => a.userShare === held.userShare)) splitAlts.set(room, [held, ...alts].slice(0, 4)) } splits.set(room, sp); persist('us:' + room, sp) }
166
+ const keepSplit = (room, sp, ep) => { if (isSealedAppRoom(room)) return false; if (backwards(room, splits.get(room) && splits.get(room).userShare, sp.userShare, ep)) return false; if ((Number(ep) || 0) > 0 && ((splits.get(room) || {}).userShare !== sp.userShare || Number(ep) > (eps.get(room) || 0))) { tellEpoch(room, Number(ep), { split: { userShare: sp.userShare, commit: sp.commit || '' } }); if (Number(ep) > (eps.get(room) || 0) || (splits.get(room) || {}).userShare !== sp.userShare) dropOldKey(room) } if (ep) noteEp(room, ep); const held = splits.get(room); if (held && held.userShare !== sp.userShare) { const alts = splitAlts.get(room) || []; if (!alts.some((a) => a.userShare === held.userShare)) splitAlts.set(room, [held, ...alts].slice(0, 4)) } splits.set(room, sp); persist('us:' + room, sp) }
165
167
  // The mirror of keep/keepSplit, and the thing that makes "delete this Space" mean anything: without it the app cleared
166
168
  // localStorage while the WORKER kept the key — in memory AND in idb, from which a freshly-created worker reloads it at
167
169
  // boot (the idb.entries('mk:') restore below). So a deleted room's key came BACK on the next page load. Clears every
@@ -173,6 +175,18 @@ const forget = (room) => {
173
175
  lastPos.delete(room); heldOk.delete(room); splitAlts.delete(room)
174
176
  return Promise.all(['mk:', 'nk:', 'us:', 'ep:', 'cnt:'].map(prefix => idb.delStrict(prefix + room)))
175
177
  }
178
+ function phoneRoom(room, packet) {
179
+ const channel = new MessageChannel()
180
+ return new Promise((resolve, reject) => {
181
+ const timeout = setTimeout(() => { channel.port1.close(); reject(Error('Private room verification timed out')) }, 90000)
182
+ channel.port1.onmessage = ({ data }) => {
183
+ clearTimeout(timeout); channel.port1.close()
184
+ if (data?.result) resolve(data.result)
185
+ else reject(Error('Private room verification failed'))
186
+ }
187
+ self.postMessage({ sealedPhoneRoom: room, packet }, [channel.port2])
188
+ })
189
+ }
176
190
  async function resolveMk(room) {
177
191
  // ⚑ WAIT for the idb key map. EVERY page load starts a FRESH worker (plus browsers evict them), and the map loads
178
192
  // asynchronously — so a room opened before that load finishes resolves against an EMPTY map and reports "no key". The
@@ -180,8 +194,21 @@ async function resolveMk(room) {
180
194
  // hasn't published yet). Platform-independent — desktop and Android hit it as readily as iOS. keysReady settles once,
181
195
  // so this costs nothing after boot. THE cold-start race behind the recurring missing-key report.
182
196
  try { await keysReady } catch { /* load failed → fall through to the stores as they stand */ }
183
- const have = mks.get(room); if (have && await heldMatchesShare(room, have)) return have
197
+ const have = !isSealedAppRoom(room) && mks.get(room); if (have && await heldMatchesShare(room, have)) return have
184
198
  const sp = splits.get(room); if (!sp) { noKeyWhy.set(room, 'no split share held'); return undefined }
199
+ // A sealed hosted room needs the authenticated share relay. Its ordinary
200
+ // same-origin app-share endpoint accepts the room identifier in clear.
201
+ if (isSealedAppRoom(room)) {
202
+ try {
203
+ const r = await phoneRoom(room, null)
204
+ for (const c of [sp, ...(splitAlts.get(room) || [])]) {
205
+ const mk = combineShares(c.userShare, r.appShare)
206
+ if (c.commit && c.commit === r.commit && await commitMk(mk) === c.commit && splits.get(room) === sp) return mk
207
+ }
208
+ noKeyWhy.set(room, 'Private room key commitment mismatch')
209
+ } catch { noKeyWhy.set(room, 'Private room verification failed') }
210
+ return undefined
211
+ }
185
212
  let r = null
186
213
  try {
187
214
  // ABSOLUTE, on this worker's own origin. The vault spawns this worker from a blob: URL, and a relative URL cannot be
@@ -286,6 +313,13 @@ const prefetchFlag = new Set() // rooms the service worker announced a fresh
286
313
  let prefetchLookUntil = 0 // after a 'wakeup' (the page came to the foreground) every poll looks, for a few seconds: the first poll of a resumed page is already on its way before any tap message, and the push's announcement is lost while iOS holds the page suspended
287
314
  try { const pfc = new BroadcastChannel('wb-prefetch'); pfc.onmessage = (e) => { const r = e && e.data && e.data.room; if (typeof r === 'string') prefetchFlag.add(r) } } catch { /* no BroadcastChannel: the first-poll check still runs */ }
288
315
 
316
+ // A replacement worker can receive a stale room open or a vault-initiated read before
317
+ // either page has reconnected. Hold its network traffic until its own preference is known.
318
+ let privacyChange = 0
319
+ markOhttpPending()
320
+ const privacyReady = idb.getRawStrict('pushDirectAllowed').catch(() => false).then(direct => {
321
+ if (direct === false && !privacyChange) setWorkerRelay(true)
322
+ }).finally(resolveOhttpPending)
289
323
  function setWorkerRelay(on) {
290
324
  if (on === ohttpRequired()) return
291
325
  requireOhttp(on)
@@ -381,7 +415,7 @@ self.onmessage = async (e) => {
381
415
  return
382
416
  }
383
417
  case 'memoryOnly': { // {id} → a room link on an unsecured computer: keys stay in memory, persist() writes nothing
384
- protectedAtRest = true; sealKey = null; setIdbNaming({ on: true }) // names on, no key: every write is dropped
418
+ protectedAtRest = true; sealKey = null; memoryOnlyVisit = true; setIdbNaming({ on: true }) // names on, no key: every write is dropped
385
419
  if (m.id != null) self.postMessage({ id: m.id, result: true })
386
420
  return
387
421
  }
@@ -424,7 +458,7 @@ self.onmessage = async (e) => {
424
458
  return
425
459
  }
426
460
  case 'volatile': { // {rooms} → these rooms' keys are memory-only from now on: drop what is stored, write nothing
427
- for (const r of (Array.isArray(m.rooms) ? m.rooms : [])) if (typeof r === 'string' && r && !volatile.has(r)) { volatile.add(r); keysReady.then(() => Promise.all([idb.del('mk:' + r), idb.del('us:' + r)])).catch(() => {}) } // its preview key stays (attNk): the room key never did
461
+ for (const r of (Array.isArray(m.rooms) ? m.rooms : [])) if (typeof r === 'string' && r && !volatile.has(r)) { volatile.add(r); keysReady.then(() => Promise.all([idb.del('mk:' + r), ...(isSealedAppRoom(r) ? [] : [idb.del('us:' + r)])])).catch(() => {}) } // its preview key stays (attNk): the room key never did
428
462
  if (m.id != null) self.postMessage({ id: m.id, result: true })
429
463
  return
430
464
  }
@@ -440,10 +474,11 @@ self.onmessage = async (e) => {
440
474
  try {
441
475
  if (!client) throw new Error('l1-worker: create before open')
442
476
  // a SPLIT room is made through the builder's app-half function on this worker's own origin (the same one resolveMk asks)
477
+ if (isSealedAppRoom(m.cfg?.room)) throw Error('Open the private room link to create it')
443
478
  const via = m.split ? async (body) => { const x = await fetch(APPSHARE_URL, { method: 'POST', credentials: 'same-origin', headers: { 'content-type': 'application/json' }, body: JSON.stringify(body) }); const j = await x.json().catch(() => ({})); return { ...(j && typeof j === 'object' ? j : {}), status: x.status } } : null
444
479
  if (m.delAsk) delAsking++
445
480
  let r
446
- try { r = await client.create(m.cfg || {}, { base: m.base || undefined, ...(m.enclave ? { enclave: true } : {}), ...(via ? { split: true, via } : {}) }) } finally { if (m.delAsk) delAsking-- }
481
+ try { r = await client.create(m.cfg || {}, { base: m.base || undefined, ...(m.enclave ? { enclave: true } : {}), ...(m.split ? { split: true, via } : {}) }) } finally { if (m.delAsk) delAsking-- }
447
482
  if (!r || !r.room || !r.mk) throw new Error('create: ' + String((r && (r.error || r.status)) || 'no room'))
448
483
  if (m.split) { if (!r.userShare) throw new Error('create: the app-half function gave no share'); keepSplit(r.room, { userShare: r.userShare, commit: r.commit || '' }) }
449
484
  keep(r.room, r.mk); publishPresence()
@@ -503,6 +538,7 @@ self.onmessage = async (e) => {
503
538
  // realm's worker (a same-origin docked lane panel) can adopt it WITHOUT the key ever crossing either main thread.
504
539
  // Fire-and-forget: no RPC reply — the port carries the answer ({mk:null} if we don't hold it → the caller falls back).
505
540
  const sp = e.ports && e.ports[0]
541
+ if (sp && isSealedAppRoom(m.room)) { sp.postMessage({ room: m.room, mk: null }); return }
506
542
  if (sp && m.room) { try { const mk = mks.get(m.room) || await resolveMk(m.room); sp.postMessage({ room: m.room, mk: mk || null }) } catch { try { sp.postMessage({ room: m.room, mk: null }) } catch { /* */ } } }
507
543
  return
508
544
  }
@@ -528,6 +564,76 @@ self.onmessage = async (e) => {
528
564
  if (m.id != null) self.postMessage({ id: m.id, result: true })
529
565
  return
530
566
  }
567
+ case 'openPrivatePhoneRoom': {
568
+ // The vault starts this operation after the native owner explicitly opens the private link.
569
+ try {
570
+ const room = m.room
571
+ if (!isSealedAppRoom(room) || !client) throw Error('Private room unavailable')
572
+ await keysReady
573
+ if (!navigator.locks) throw Error('Durable room storage is unavailable')
574
+ await navigator.locks.request('witbitz-private-room-creation', async () => {
575
+ const epoch = storageEpoch, key = sealKey
576
+ const check = () => {
577
+ if (storageWiped || storageEpoch !== epoch || sealKey !== key || (protectedAtRest && !key))
578
+ throw Error('Unlock this device to open the private room')
579
+ }
580
+ check()
581
+ await idb.requireLocalDisk()
582
+ const name = 'us:' + room
583
+ const read = async () => {
584
+ const stored = await idb.getStrict(name)
585
+ check()
586
+ return isSealed(stored) ? openSealed(key, stored) : stored
587
+ }
588
+ const save = async share => {
589
+ const stored = await sealIf(key, share)
590
+ check()
591
+ await idb.set(name, stored)
592
+ const confirmed = await read()
593
+ if (confirmed?.userShare !== share.userShare || confirmed.commit !== share.commit)
594
+ throw Error('The private room share could not be saved')
595
+ check()
596
+ splits.set(room, confirmed)
597
+ return confirmed
598
+ }
599
+ let share = await read()
600
+ if (!share && m.create !== true) throw Error('This device needs its room share')
601
+ const fresh = !share
602
+ if (fresh) share = await save({ userShare: newKey(), commit: null })
603
+ if (!/^[A-Za-z0-9_-]{42}[AEIMQUYcgkosw048]$/.test(share.userShare)) throw Error('Invalid private room share')
604
+ // A previous create may have committed before the phone received its reply.
605
+ // Every retry uses the same durable user half. Only the authenticated tenant can supply its partner.
606
+ const recover = async () => {
607
+ const released = await phoneRoom(room, null)
608
+ check()
609
+ const mk = combineShares(share.userShare, released.appShare)
610
+ if (!mk || await commitMk(mk) !== released.commit || (share.commit && released.commit !== share.commit))
611
+ throw Error('Private room key commitment mismatch')
612
+ if (!share.commit) share = await save({ userShare: share.userShare, commit: released.commit })
613
+ return mk
614
+ }
615
+ let mk
616
+ if (!fresh) {
617
+ try { mk = await recover() }
618
+ catch (e) { if (share.commit || !m.create) throw e }
619
+ }
620
+ if (!mk) {
621
+ check()
622
+ if (!m.create || typeof m.email !== 'string') throw Error('Private room unavailable')
623
+ await client.create({ room, keyModel: { k: 1, n: 1 }, requireApp: 'app', admission: 'email',
624
+ owners: { emails: [m.email] }, allow: { emails: [m.email] } },
625
+ { split: true, enclave: true, reservedUserShare: share.userShare })
626
+ mk = await recover()
627
+ }
628
+ if (!await client.reopenSealedInvite({ room, mk, gate: 'email' })) throw Error('Private room could not be reopened')
629
+ check()
630
+ splits.set(room, share)
631
+ })
632
+ publishPresence()
633
+ self.postMessage({ id: m.id, result: { opened: true } })
634
+ } catch (e) { self.postMessage({ id: m.id, error: String(e.message || e) }) }
635
+ return
636
+ }
531
637
  case 'ensureMk': { // {id, room} → reconstruct the room's mk HERE (fetch appShare ⊕ combine, commit-checked) + cache it; return only a BOOLEAN availability. mk never crosses back to the main thread — this is the split-room OPEN check without de-confining the key.
532
638
  const { id, room } = m
533
639
  try { const mk = await resolveMk(room); self.postMessage({ id, result: { ok: !!mk } }) }
@@ -545,12 +651,17 @@ self.onmessage = async (e) => {
545
651
  } catch (err) { self.postMessage({ id, error: 'inviteLink: ' + String((err && err.message) || err) }) }
546
652
  return
547
653
  }
654
+ case 'initPushDirect': {
655
+ if (!memoryOnlyVisit) await idb.initPushDirect().catch(() => {}) // absent permission already makes push fail closed; a memory-only visit writes nothing
656
+ return
657
+ }
548
658
  case 'privacyPref': {
549
659
  try {
660
+ const choice = ++privacyChange
550
661
  if (m.on) setWorkerRelay(true)
551
- await idb.setRawStrict('pushDirectAllowed', !m.on)
552
- if (!m.on) setWorkerRelay(false)
553
- self.postMessage({ id: m.id, result: 'sealed-room-relay-v1' })
662
+ if (!memoryOnlyVisit) await idb.setRawStrict('pushDirectAllowed', !m.on) // a memory-only visit keeps the choice in this worker's relay setting alone
663
+ if (!m.on && choice === privacyChange) setWorkerRelay(false)
664
+ self.postMessage({ id: m.id, result: m.transition ? 'sealed-room-relay-v2' : 'sealed-room-relay-v1' })
554
665
  } catch { self.postMessage({ id: m.id, error: 'Could not save the push privacy setting' }) }
555
666
  return
556
667
  }
@@ -566,6 +677,8 @@ self.onmessage = async (e) => {
566
677
  if (client && clientRealm === realm) { publishPresence(); self.postMessage({ id: m.id, result: true }); return }
567
678
  clientRealm = '' // set again only once the new client is made
568
679
  client = makeSpaceClient({
680
+ sealedAccount: true,
681
+ sealedAppRequest: packet => phoneRoom(packet.room, packet),
569
682
  endpoint: m.endpoint || '/space',
570
683
  app: m.app,
571
684
  ...(m.tenant ? { tenant: m.tenant } : {}), // a builder's vault (vault-core.js): the Spaces it creates are its tenant's
@@ -582,6 +695,7 @@ self.onmessage = async (e) => {
582
695
  delCommit: (r) => (delAsking > 0 ? askDel(r) : Promise.resolve(null)), // a promise either way: spaceClient .catch()es it
583
696
  // THE ROOM PASS (docs/device-gate-design.md): the page holds it (roomPassWiring.js) — asked under the reserved name
584
697
  // '#room-pass' with this request's op, room and sign-in (its email and key, never the token); {} = none (off)
698
+ accountRoomAccess: makeAccountRoomAccess({ issueRoom: (room, pub, kind) => auth(ACCOUNT_ROOM_ASK + JSON.stringify({ room, pub, kind })) }),
585
699
  roomPass: {
586
700
  fieldsFor: async (body, o) => { const si = signInOf(body); if (!si) return {}; const v = await auth('#room-pass:' + JSON.stringify({ op: body.op, room: body.room, email: si.email, spk: si.spk, ...(o && Number.isFinite(o.ts) ? { ts: o.ts } : {}) })); return v && v.pass && v.psig ? { pass: v.pass, psig: v.psig } : {} }, // ts: this realm's sealNow — the server's clock as learned here
587
701
  renew: async (body) => { const si = signInOf(body); if (si) return auth('#room-pass:' + JSON.stringify({ renew: true, email: si.email })) },
@@ -820,7 +934,7 @@ self.onmessage = async (e) => {
820
934
  held = { holders: 1, mk: null, s: null, tag: '', grants: Array.isArray(grants) ? grants : null }
821
935
  streams.set(room, held)
822
936
  try {
823
- await keysReady
937
+ await Promise.all([keysReady, privacyReady])
824
938
  const mk = (typeof m.mk === 'string' && m.mk) || mks.get(room) || await resolveMk(room)
825
939
  if (streams.get(room) !== held) return
826
940
  if (!mk) { streams.delete(room); return }
package/manifest.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
- "version": "4.8.0",
3
- "commit": "b47312c7930f4196ede9d28eb94ce9e6f56e30b3",
4
- "released": "2026-12-01",
2
+ "version": "4.9.0",
3
+ "commit": "cc0d7d7f0a2ebb3550ea65a0179128b5d33a5645",
4
+ "released": "2026-12-04",
5
5
  "files": {
6
6
  "a2aCore.js": "sha384-rnS5krIO4jMP44Rk55sMqVXUqQ+AOrYvMeLJ+lcaCr9uIEia1X6Yl39mmHOKt1/6",
7
7
  "a2aShared.js": "sha384-8ZySzE/00iuVY9rHn+OF4ffcmGL/7z2eyFbRNIGejqnnnbf/AdHncYqLPU7RPq8L",
@@ -9,40 +9,42 @@
9
9
  "accountIndexDoc.js": "sha384-zEK6m1LRZp7YLxRa724StGmxaH01TEzOJRpQicSTc2HEHNrdeNSj5gsHqf3010rT",
10
10
  "accountOwner.js": "sha384-PzilRYmvxbcRAKPW/EKyc/+WpJXW1scvM57/4YoeGvd1vSxDFgyCdvsC4A9cIjqs",
11
11
  "accountRecord.js": "sha384-txefXHZOZJOriiGRKari/1kmA87TJ8+O7kGt4yr+v36AHR881CtMkqZl4ulE2wZ+",
12
+ "accountRoomPointers.js": "sha384-bicuNWSLv1gnxl0ugJjGUQ1qni1OcyV3GjIsGzLcKNI547uYsOuXwUW5/q8mvvnc",
13
+ "accountRooms.js": "sha384-lAecQ5EiERVOqxnCW68sLZu7ibtceKW7UaUeaoYkdZleZ3yc+NssfZP88XYnlu7B",
12
14
  "accountScope.js": "sha384-XqPCppK4c98qCP+Ch+725Ezw6nO8d2+KtSBLqaLwImb2W44lWl7M13R/Nuo0RInk",
13
15
  "accountSeal.js": "sha384-vBVE3c0CP99ag2qGgdisTWjTKLTXBv5Xk20vkuPBvStTOWrGGFW07ekLnV0vewXz",
14
- "accountStores.js": "sha384-0tmlMZ7cdtBOX+YG6z5ryNPoBkhmeTPqenBVYjum/n3FVaEUKD9Fn0hMl1u6HvXY",
15
- "acctV2App.js": "sha384-suf3k46vq4ulVwHXPMzu3zgqBJ6nWWWatqxdBKReofx9VbmjoI213+6tDRU1/G+R",
16
+ "accountStores.js": "sha384-Itp/Hl6siTHzCb0GvbPdf3XC2esnaFVseBEsGUQtcY7cUObOTk+OEwK1jz9yOS4j",
17
+ "acctV2App.js": "sha384-Zx5CK7+hoJbMcXAExKzK0mkadd1Sy1TdQM8bC0kTey+yq4DF7aozGaC5ISZkAZwr",
16
18
  "acctV2Check.js": "sha384-1tl+lRbBFz1cz6dLmVsCCVs8WLd6SIdo53wHN1PNBeKaSFaGLPcCJ1UsNfQZvYLL",
17
- "acctV2Client.js": "sha384-3VM3VGAL9huxo4SEOdgKbxvstGpiAqLzc2XcZrRM5zoyen98neR2zjtXVQoD4apx",
19
+ "acctV2Client.js": "sha384-Mi6+ptYLQ+7gmJGb7doTak6AnMizQisZ5i1LnKJLW650zRI6XPspS7Jimy70aeuY",
18
20
  "acctV2Keys.js": "sha384-xlfDiwkXSQWjiKBcceDCfsoCVcuLRxxC/p8jss/K9M2gMn4x62ZE5UlFkm9eTpIV",
19
21
  "acctV2Legacy.js": "sha384-QlBzwihqxBMe+eejAzEVYV4vnbJxj/3PNrtkovy+g1CMrIqQmDxeWkyLlcwPS2lG",
20
- "acctV2Switch.js": "sha384-kFTFjxcIn9nKkpUUMEOdl7ZoQupXWBt5w7tZrcuZVx4xUsfryE3aPzEg4+KJm29W",
21
- "acctV2UiCore.js": "sha384-jEeZZ1V3Et7b4Mc02H/VNHgaF6iEoXXm3OuEBq4djwklOReLiwg7yBzB8suHte5R",
22
+ "acctV2Switch.js": "sha384-s6xEJHXqN8jrrKZ/UBiazFy9GW7OwfroTcHzEudcHroGepJufkhzpeDSKsd25Ahf",
23
+ "acctV2UiCore.js": "sha384-jgBA202eWElFDlt7+7SKbaUDjPIQ7Z3cL89CzZG1l41A+wV0ZOl/zriUuWvusevs",
22
24
  "acctV2WebAuthn.js": "sha384-0FZNO6vz1gtGYUkgXleXjao2Jg1X4mtWhvTV/m9j4DkMwPgH1/q8yM7+H1Y284H5",
23
- "acctV2Wire.js": "sha384-umBkf5pazE80LpOByLC7mdcrLiWUHzB4+OpdvUybpJ2KgpOsQ5ftgr0IInNmqKKT",
25
+ "acctV2Wire.js": "sha384-4U2gZthPQXYnyowtp8Ke2ktPnufpLE1Sy+9aJ9TSeaMdoERHJz2DG/If0AtJPrPH",
24
26
  "addPreferred.js": "sha384-npT8Hea1UtImEiC7CMvZ3t9CQRVHqbjxEEQeoCWFJaDt2lTrdjL+4ipvek2NX8NQ",
25
27
  "address.js": "sha384-GlXfyjK8I9tPdW9WDfcll/dzPtQe7G/EsJDw4yozjKi2dahI2Ogn9ira13iVbeK7",
26
28
  "agentDoorTools.js": "sha384-u4D5/n3QWb16kqYWgWqmU1oP+DuPs7oMcPuTxTePYqeGLphYTVQ9oP0nbaxHioRU",
27
29
  "attestedBox.js": "sha384-ym0iKYAKeSLc+WyAICW9gN+ebNsnylxeJbEtK7EksVuzUM9qfgjXIkvWR7YpkEP1",
28
30
  "attestedRooms.js": "sha384-cHIc7FfaUxXVIsjCJFa1iug8TSd2NrtM3oQ7Ud9l9FgzmWvXXpv8Oh+qguGz3GTT",
29
31
  "awsKey.js": "sha384-jKyc0oGAL3CfsNORW8kmGjL5rdsvaxNAl+5tonzSV1gSoDXg04icKCQNOoH/g84D",
30
- "backupRecord.js": "sha384-ymfv8RjWLAQTdG+o3MfUlVDYOUYpdAjxUZnVWNgy7pnReE4uYE7hupxXbDefxC9l",
32
+ "backupRecord.js": "sha384-kqZ4RrAIki/zgGrZ1IyYTefCI+UPJOurUXJYomuyCCfwMq1WOmqv8hEhyMZI2HUY",
31
33
  "backupVault.js": "sha384-2YGahV+Lr/lL2dEYnsiBuXEvDeRYzWgqsE9Ct+zQVm4cKwfpXRbcWelt/vTfk4cU",
32
34
  "blocks.js": "sha384-xluKDvLj9HqHz9AvPi9s4vWJ7ZJkQltUb2GHqZu+1GK7sc8p8CVE/zD79nBF+ZRp",
33
35
  "blocksPush.js": "sha384-mW8KMahz2HM8Mtcapy4aHHV2nlJIy0K4HO5eF6I/AUqKt/rc45vjfxA3hsYxvzt6",
34
36
  "browseSeal.js": "sha384-OYhYeAmL306zp1YcHLIMRoOes5Rf8kxtgLTNa/DN+JRqX/7tn8gkIcPpqb197cd9",
35
37
  "cbor.js": "sha384-gVK+owzmb39ZxVLYEYqNEB2HpvgXfw4O+FgE2XAIg5V8GulZJahl4TTvc1CTggxd",
36
- "changePush.js": "sha384-WyvHW1BAM4yfxSKpVrUUba1S9zTIZwf6h3bDEBzfoPmxlcsncQS4qi1ZQdcdmrd/",
38
+ "changePush.js": "sha384-1s4KR71IPH/SGEV5FHZ8z9H6WpIjtiU+TzZU15GxT/cRl/IXQaGsqxxLzBSyHpWr",
37
39
  "chatLock.js": "sha384-esaR4aW2erKA7BP9PNkIbKiyPzWVh58Mohl8rRiHyZg7eJ5I6htSZLexwjVucTtT",
38
40
  "chatLockSw.js": "sha384-5/z9q4rpuiVjOXOD/XjjqH5nJwSRm/L4cRyNIpzArSplOwVMpfX4KZjIW4rbGWTP",
39
41
  "cloudDeviceBuilds.js": "sha384-FAyylkqCHVe0vvbvZnUH4/JuR15pexmiO/gLys+YRjNZEBkvOUFp8Kg3m/yNAp0G",
40
- "cloudDevicePins.js": "sha384-PzhTc/N+uLjCcNc+b4BnDVagpSy90cvurEmFOx3mGBoFxJr9sGyyurSYuFYfvJOy",
42
+ "cloudDevicePins.js": "sha384-q5YXJ37K9EBlbIprzxmK5GaL3OlWjIcWS8ey8439ymPJYRfMPVMjERXJQXEAV35S",
41
43
  "cloudDeviceSeal.js": "sha384-1pc+0oFx924IQVeSAAH5LzOp/l7p79fH6MhROKnS0Q9wnU2Y0oJYs2carCVxLdqe",
42
44
  "codeAttachments.js": "sha384-ufp2O+y/clLkfUq9cOKGKA0tFATGI8BByGkHwzcabxAfY2f+ON+Po6Bl0+VdGL8H",
43
45
  "codeBrowse.js": "sha384-4zwyAaZvPTdvt5fqmfoVJlOVlWw66NHp6W52FcxUJrXnOabNmMG2BNkgUNeIDd68",
44
46
  "codeCache.js": "sha384-GNSH8XCYO6UFCNlmFQmlYqf2gCBzivPNF7iZf2/Kf++AUdP2Kz6dTXrA3oydDRN1",
45
- "codeCloud.js": "sha384-yW3qX8IId2B5QyQiUGSRfeBey5kuSAwOoKiyTFeMkECn29DIj8RuO9dBsqRY0rl4",
47
+ "codeCloud.js": "sha384-6VvHsCnR7WxPmn0Ejn+qGZ43uXyj9FOw5xKNPqBnpnr7DNcuRhZ0duxf+1+cWOpS",
46
48
  "codeCloudKeys.js": "sha384-SGf8gNR3NQaDKlwIMB0MWinfAatj202hjJrRtHR6rC82qpI000J7q4BGpBkC9cbb",
47
49
  "codeCommands.js": "sha384-vDl7wobjRwSKgcmhhOVu2pM1ZMYzoiZKwgBjeLFE1ZC0+Oinm8L2dautSvM4yDY/",
48
50
  "codeComputers.js": "sha384-RkOIVwwOwyZRzDWJoqoLAUVxXhsC9xTC0tHHWRuaruZG+dGo1hLXXmZJPt1kkfe4",
@@ -70,7 +72,7 @@
70
72
  "connPending.js": "sha384-dLLfaofnAA3C7UVB/n/3Q0UEJ21bBc7DM6avTA7m3TAU3rkYrigq2g/9uVBj96ZF",
71
73
  "connWrap.js": "sha384-sm4dfCD3aQa5fznh1JERZ+2lvq2iarPry6ityLlqPPGlwsZBGzM093gGt6WPM7eA",
72
74
  "connectionEntry.js": "sha384-aS2dtKOxjkOiU4prWDhVx7SBDnxuom84NNi6+xxQgTaGhCPesdqMp9hhxnTbxWpr",
73
- "connections.js": "sha384-uS//9x4l2n+ae3F6gknHN7mrS8OIEffEoVHrsNoLijZWairNUlukiqGfu4HrDT6c",
75
+ "connections.js": "sha384-5YZAq/D8XhB1ITDGonLAbAwqKrd4edS3/iJp9MYqSRB9AvHmUWSmDw9OqKINhVGk",
74
76
  "credits.js": "sha384-P5JOB3TkJPiTGu5H7Zp/J7H34zLPok9Xhmo6aoQzP0BVBmaoywNeUrYB8R6Qe/m4",
75
77
  "csAttest.js": "sha384-hAFpb3ky1/DB/qgh/UuAKB3HC7nFl11mrR/0+Uh/jQfW/fCW9cx0WOZXMFHHq/WZ",
76
78
  "deviceAttest.js": "sha384-wQWq/l5hgjwPxqrGG8XYSIouFxEIMe048qALDDyXHNaHCH/rsufvv31bmDTsczV/",
@@ -91,18 +93,18 @@
91
93
  "entrySig.js": "sha384-0VMTFsu+wepZHc+35lV4KN6guseAQERVMysjZNsYwKjQSSvbm7Pbx31Ly1a8HXAc",
92
94
  "env.js": "sha384-Rli1uln0BCvEebuaZe+aNF0pvrNPIe6cZNrBPhvOyMq6JxcCRDCX3agvqH6NwaV4",
93
95
  "eraseFile.js": "sha384-XbqGtyFGuTTbIOTyhiCJ0fYdCWETvnuYOMMGulEyneEMxkn8YupQEnwYUMERh4AB",
94
- "followImage.js": "sha384-fXM5pscmbxWeYsP+HsvovFO8IhdMS1KTkJA9zxoQlkJelv0RQVcf1K+/7/IZJdRk",
96
+ "followImage.js": "sha384-56QyuGHExxCaDXFGG0mILbvftEl7O16SUxRsb4SLu4nE85YmgION47OunDV3KQqx",
95
97
  "healNames.js": "sha384-BrYl5itN8sTYkwgY/vMj9AiT/54AK6V/bzAw14FvzjtbipV16SY353ruKP7ZAB5+",
96
- "idb.js": "sha384-oEXgNQxEAOc3+phEn1ILhjJ6YAQ2cRQAVHHigXlMtGR/pyu1vw4eFot9JKj+R4cX",
97
- "idbSeal.js": "sha384-qDE6vLBy3FLV7lEuaf4bzp6UmtY/tJipOZdKvPhVttAWOvGgDcL+EiG+U6H0CniG",
98
+ "idb.js": "sha384-ek0wLAXE867svSOefXKNR/CAFPK5eFYKsdpSJSV0n5u0Hq9zGq7RZb20SHrf4Vv2",
99
+ "idbSeal.js": "sha384-35AHO2+b2APsNO9hG0juENhk7l27288fU0///WFlamQwBkcjYQn3NEVI4yTEPI94",
98
100
  "indexGone.js": "sha384-UWHAd79orf/n84uvDPQk6/czC+Yorwwygh8Dkm0By8bqStosXh0k3soewx40xjYw",
99
101
  "invite.js": "sha384-ZzEaSWz3fzoLKW6A5vlfp9Sxp75YHGQOZmSTQ0Ru3g6w8d7iZz6q7bTfRjur3MD7",
100
102
  "inviteEnroll.js": "sha384-R/jY60uYSnwt73xNbqsZooEgDt0bCBIkFGq42HhVWBLM1vMyJ7nig7BNsFjMQy8J",
101
- "inviteReceive.js": "sha384-Zaf5jNZBJZMbTj6l3WxMC9jQVmFB2NhRldJMAA4d3TE7/lU509Tz+LAtVlIPYyTN",
102
- "inviteSend.js": "sha384-1mW+Y0Prmkg2zteLBnnVIM0qMiMQi7vvBz2YiSYir0kxR7fY2c3TmaSGXi8goifi",
103
+ "inviteReceive.js": "sha384-lFsCPFGUny09Ho8yb72InzYYeTHAbElJclKsRQpnSt7JkpSMfkuv9hoRCEwG6h1f",
104
+ "inviteSend.js": "sha384-DpyKPS7OYgKiZQVO9vQ8wVdMkBOppxiSug4K5PwwYLnhLm6+pelZwSKUXSA4s2kC",
103
105
  "jobAgents.js": "sha384-X6MXdAULj2JevxPtbvCA/N1L+PL0Zv2Aeh9xfmzKT9Ust3Pr2Nvmm1JdN2D6wiAo",
104
106
  "keptMerge.js": "sha384-+IKgfams0D8AgT3/ne+Z45rqSMc9KqcqGQRD9oxkCkdj6C/vFSDFRx+TSd/UK/Oh",
105
- "l1-worker.js": "sha384-ENnIVNjRJZb9XXR65dc4bGIi/wcGPwXSqr2GYs3QImDF2ckV5TNtAOdC/yajSay/",
107
+ "l1-worker.js": "sha384-MdAXlj7a2qNPhsca0fINn9qbBG1YOmbQNfNN5yi+TNb5f5qG7pLHZeDphLIRS9Do",
106
108
  "laneAssociation.js": "sha384-IixAlVFfq/Hv6EciVn+zpRoYDQMZIN1SVPiLTJs+ZMXWP8GrAV+Cyg973YnO/4kV",
107
109
  "laneConfig.js": "sha384-23nxPBKRdr5W7k4wp0IdiYm9E4pMHSyowDAX5ZRw4N6M1lTfFRC3wxyejlsaDbe6",
108
110
  "laneLinkCore.js": "sha384-bdUhU+o0amycFRuRZCAeo+E2zWtHQiYgW9ffY0CqotDCmldBD8RG9CGL3Z6IwXga",
@@ -139,16 +141,16 @@
139
141
  "replyQuote.js": "sha384-6LiPSqgKweWBwXaUsIrUC9qfJIGEqdEYzmqTH3/euXE9HxvAmFcLPZRSlQMtegAY",
140
142
  "reqEnvelope.js": "sha384-cXS19voNxQ4tEOJJ1Mr3EPe3rjJ1VTBLobTDHZ5e5LOF53t2X00F6+8xrSLSlaMk",
141
143
  "roomDefaultPrefs.js": "sha384-zo36DN4jT3Y39h6rltKs/nZQlaIGpHb/l8U6FZ3hleFrOW7PZmlwwGP2/rjESzEV",
142
- "roomDelete.js": "sha384-R1UtF9zgtNVIXJo769yy5IeQ9mGPifoXZmgaCYVBYQFHgoG64I7E1MbS/7xFs0ET",
144
+ "roomDelete.js": "sha384-j/zMMoCi3+YyUjDP1tE3WII4BBX620PDvNq1dOYUqkFnLCx+tZt0TTco600XvwX0",
143
145
  "roomEmbed.js": "sha384-Ok8+r772E6KCv2Sgm/wN4sKpotZOqkK0I16HRgCDB7AVNV52uYlg66mI6SehrgVT",
144
146
  "roomIntake.js": "sha384-PC4d2NNUMbaCaxgC5H+NDfX18yca+Zo06EAOwBd5s9BJJOW8SXnp8NGxO50AG6Kl",
145
- "roomName.js": "sha384-W9wy3n5fPuOIFXT+pphIDXJUz5wi7UfNxFn6SDnBJg1IZzmXioniZ++/pFwLQ9zt",
146
- "roomPass.js": "sha384-l47V/HhjQWFxJOxWm9SLP+ECDDmwc0KoiIBS+2c98AIqGEw5iOU8xE6Oaw31RSaQ",
147
+ "roomName.js": "sha384-EeRX3bE6DLxfsjQIcPLKEx5gmDn+BUkSGBDvpz8imgQGcZa1KYvfLlMNAQeGciha",
148
+ "roomPass.js": "sha384-RJHF2nQPA0bf8qlFC3wcUGraWBmN9IWbN6gMfEO7SKPGJTSpQR5aoEZpFdshbv8k",
147
149
  "roomRoles.js": "sha384-qgsVNrcUsiVDqVfDzJtEk2N2ykkPCFWAJKagLpeHxT2BglBBLbwh3UOSqhaGnhjL",
148
150
  "roomRoster.js": "sha384-RUkuezzheIEvZQKrlT/eAgMhqOrVWh2R7epfDOQOSkfADw9iIg/57Mi53b6ne/Po",
149
151
  "roomSettings.js": "sha384-OV2g5ae1e2JmyQl2FOEBZk/0qKCT/BNRULRLT0RapvEvshfFY2HOiyaoT0U/DzFB",
150
152
  "roomState.js": "sha384-SFWOMqdRoZeowpZ+uUltsnRPnkVQKZmEsA1k1GvACo6KSiVeqe+5GX6fDL+63g8Y",
151
- "roomStreamClient.js": "sha384-OZ2Xt4EqRTnhRNnDD3OWPLi0zmXpPTgU7dYtpGx/2M2S4p0cd91r76Ue3H1R89af",
153
+ "roomStreamClient.js": "sha384-bkqcKrMxfHTTMqYcbXGiDRaEwS9bO3snSAm0NmO2hQ0pTkxkfgHr/jVTyRfAxcvs",
152
154
  "rosterCount.js": "sha384-ZWdzsWy4sVk5LY59yNrmpRuivw7GLjsPHv44yex2WOTmWR60mO5JnBg9/N3CfJK9",
153
155
  "rosterHash.js": "sha384-jynsP9CGMtFia/PU8n1FsAfN/wUQ1a7yAdxl3DlO/E8jbtZFnwnE0nqo21P1zKLo",
154
156
  "rowSchema.js": "sha384-0SA5jrjoi1ELWovTHbAK1OgEFI4t6UIlb9xTWyk6BAyrhQDBmMW+5ImxBqrIDFWl",
@@ -157,13 +159,13 @@
157
159
  "scheduleNext.js": "sha384-7Xu8xaDNV473aZLJub6/fdX52zUgGhUDke0CGMOCD7l6+HpsdkI3S/UK8DVuppdx",
158
160
  "schedulesDoc.js": "sha384-goD3ZkheAxrSYDxMz+oylHXUUhdfvJya+oF+whxrZ3YTtVmuDO1IGR4PrhajA0n5",
159
161
  "sdkA2A.js": "sha384-WPgDGsvaJBStXw4Zhcs1G4FlM+aElih5qP2JHtspAnMT8Tr+8BSrOj2dNfFBTDP1",
160
- "sdkAccount.js": "sha384-D5UG9+BE3rsimO9y8q7BUjXuqXS5MRHPSxWZnNqatAWkwHTB41tOIuUniQlSb2rc",
162
+ "sdkAccount.js": "sha384-XkAAJrw1C4Q26/wOgNXU5fWH9aaRYbQDqR+am11qWt7pm7TzIia7etKml+ewD98k",
161
163
  "sdkAccountDoc.js": "sha384-uM2b2+6neFTLnX70SVKXHvXcvKjecGRxU5wXoxafiysCHnZjAtR9d1xQQEXErE4x",
162
164
  "sdkAccountSections.js": "sha384-5CmYkh5fIZOOc/SdmR+Ix32TAJdQc7tqzIusuAZnNzu6lahUDjPaAxToBKZvO3fL",
163
165
  "sdkAgui.js": "sha384-oVwPKHW53+SHofOzZicxnHC5QP6qMbJCJLLF7MHYUuD+nC7vewH2hqOKV3vc0aJs",
164
166
  "sdkAttest.js": "sha384-s4vq547Vhg2dGVm53XaHgzuC9xSyXvU9WlG8t63s/fiyiAtiGM0uSOxfpzO7HQlW",
165
- "sdkBackup.js": "sha384-bgokIMBjFsb4/Syd1dRyHofABe/ELw/1ROvb8zmBZ8NbXCAw+wBDT1Ad7m0lMjQ6",
166
- "sdkBackupV2.js": "sha384-mtxzGG1s2nWWB1he7tKRLE0cYEOkLLXL+bIfjqoWzb20/Wqhr25Zbdf0KhUgTWUH",
167
+ "sdkBackup.js": "sha384-ZtikTQfnIiN/oTVEGRuvP1aoVKhNQpJZy8FRUr4CCfzMCAkpft6dmIgNIhWDwWTM",
168
+ "sdkBackupV2.js": "sha384-9A0G59nWi25X9y6Cdz1Vpvniq9pnA/ahdS0/wVthzJeT/9QVnRV99LMmc1v8L2My",
167
169
  "sdkBrowserPrivate.js": "sha384-LmbHgfSSFbTz6P1uBm0kHfIV8an1nnyepvnpX6/ELMrDDHlWlzuspLOstOCvMW4f",
168
170
  "sdkBuilds.js": "sha384-98mac3jp5DARBMNVJSwqiI4kXCs4LlSnNmDOtbxsEF4IdrHetse2p+njQZoXqVEG",
169
171
  "sdkCloudDevice.js": "sha384-l8DZ/azYjMtTKf91lWtYKbacOh3TwF0EYMSFPY5xPqnTrUBh/R+gr1YkFDE+HFmR",
@@ -175,7 +177,7 @@
175
177
  "sdkKeptAgent.js": "sha384-OS+VP2GPpjSXfSoel3C0Pw4MWxZH7HZm+jO/ZJwyPiQcvnhZja7TGmJhoxx7Va0P",
176
178
  "sdkKeptIntake.js": "sha384-K02pjf9CW6cC7yifCpFWwVIBnDTCQ2c/eGfyAbPDMprArJorbddtnzNi4FyMws5Z",
177
179
  "sdkLaneLink.js": "sha384-h0Ym2oR3G4LVBG2OQZ5NnbI7Rkvt7U16sXl6ZG1XwLbJwkzNFrnASLOunjoeyA4+",
178
- "sdkPlan.js": "sha384-iKNkxeDFsic27KX4bOi8oO+11GJ9h8aL/qeN70D5NTohC8zbyUDKsuL66OpQDHkz",
180
+ "sdkPlan.js": "sha384-YGidzy1n25ZbX4s4w7EosSTcvDi++bzaMARIdxXngaMEYbBpS6giD6yOsu3i3Bmb",
179
181
  "sdkProtect.js": "sha384-iAeAAC1Xvjcv1odagezcsgMQPZEpy6PExEMc91LrajM6yTxftWiWRFHGbXWMjF+i",
180
182
  "sdkRedact.js": "sha384-wrk7y+RYN33bDy9WjgjKWO56qOYwJdzTeAJU1cf/+QAPTz6cBW9wY4uqGlMarMva",
181
183
  "sdkRekey.js": "sha384-SlJqz5vhpxwsw5TuD9Mmp9PH0ZW+y22LJm0SALvqEqRhyskzqJVuh0XcNH0LaCmR",
@@ -189,13 +191,14 @@
189
191
  "sealShare.js": "sha384-AqXw807TlSiXMfXMAkvtOknirlMHchil9Z7WYlpkoCmm0t1o4LY37FU2goFqhckK",
190
192
  "sealedNames.js": "sha384-N7KdhXd0LDdlTk6/tqo+SY8Ty3dheW444C7jNepHgMVHkw+tcRPqTHlyufgAeabv",
191
193
  "sealedReceipt.js": "sha384-cxEVvIOaa0f//odHxmenbeMJh8Aal4ADwkiwn3sRVv+hIprDk3YgzHZym1ZXpPCK",
194
+ "sealedRoomWire.js": "sha384-ypR5bnUnAOSP4wp9ZsdoBmJar+EJQSA4TlxntgNGxwJu/JmB5QUEudyGNUZljiP2",
192
195
  "sentinelRelease.js": "sha384-qpFwmscU1IodefIezF1a37ARJCWGM46//wOWDjQPwbcHvJkYb911ewuKVfdXpuZx",
193
196
  "shamir.js": "sha384-pPKyKj3LXePkZkFgHLRZc1XWfl6b8eq0g450R6uSeC7P2eHVyGlNAPXCBXUbYUj0",
194
197
  "sharedViews.js": "sha384-+tw2Oj/1X1XXM+5PW4rVSyZOHXJ9yocOqbPc2NZ6245otJxaI5yKVZYnepHndBwL",
195
198
  "sheetChrome.js": "sha384-2nTqz57klkEZhvjhwM03b/ISOaFy9Qh6L2uDlk/QwdD+Ua86ao7ostLaI1eTaRoq",
196
199
  "siri.js": "sha384-WYAr+BM+JaTQlWfQ7eHylDgmhyK427uaJ8IvocIrX73B4qgQp1L2zrOGmFvMQEpK",
197
- "spaceClient.js": "sha384-EkIK/sAqU+3oqxd2O7JAD7SSw5Lktr6e1Bo3w6vgbxs9+PQ7tARRskB4IHvMfuAA",
198
- "spaceConfig.js": "sha384-Pb3W47eQ8xQSGkL9yD521UFnn+tp4vV3+F5Y3Qf92d5jLPmEeZqo3Zbj1idGb4Wd",
200
+ "spaceClient.js": "sha384-ksH9puXQkOLLgGvK4QDWIKkDqFuJ/WkhA1aSLt7OrCr1vgsMmNhZyf6lAgiYDZle",
201
+ "spaceConfig.js": "sha384-n3SaLY/m4XWVX42fJWRBguioctpvC17wmYDNbsDfHi3SKfZikqOFKujRavhkDApA",
199
202
  "spaceEmailGate.js": "sha384-iynfCnft76GXEDC9p7K+mWkYpH+k1zHSSuuKi1JoSHCrHjcojoLB39WviO359U4K",
200
203
  "spaceExport.js": "sha384-j9nsGBzycJ7w9YFYaMkufu4zOIs87GYW4LfHvW9fCZ4Ms57ptn7yw4BY6rI80nQG",
201
204
  "spaceFork.js": "sha384-a4geO94uih9VPqETOyuVrC7+WqULZG+kIbIL4cBX/jDBsc1ROb93nidHZqyJQcN3",
@@ -203,12 +206,12 @@
203
206
  "spacePasskey.js": "sha384-0IzyBfuRzycjmbWEEPZlxDNEHsd+kyUI1pwMlFoDnoCHX3NADSKSoyx1WkFMqklm",
204
207
  "spaceTemplates.js": "sha384-JHSm5FH5fTtaLE3VbNSRh3Vzl2PgxvKK3fdpUmxWB/GKyfMyHOdqWm4MGsXIMwoY",
205
208
  "speechOut.js": "sha384-a94a7pPaNiky1vHW1bof6z/BRX5/NkCPo8FPEo+lpIIyDqfspwzZOKHrtsNEJ3f7",
206
- "splitKeyClient.js": "sha384-BMvUSLMFC5oqxveShV2bQgl+xw6cmSkRd89vA6HNwP/kndzs9JE9MxaavAEVzwrf",
209
+ "splitKeyClient.js": "sha384-QP/YmUi/QRJWltikrJ3Xq83MHnhuM1SHgaeiOJLQW56+I5OO5Vug7dfkLB45Pv+n",
207
210
  "store.js": "sha384-8dTFgDJ/w3bH5WAUlRtF+ln0q1CJlrqIcIc9ocr2Ryn/EiJ7ibYM5HQNqhTSuxL3",
208
211
  "streamHint.js": "sha384-oCgy5+jFo0rLa1ClIQaL7TpkXtKKWKaBUCxzQBQ67U1DGWo8VTPW4z0xmB1IhKaq",
209
212
  "sttCloud.js": "sha384-okBhUPRe6BuneeTwctRD+IbAYyQqs30wFBvcfx+qv9xeMqGcTBcoODSraFHOfczi",
210
213
  "sttWorklet.js": "sha384-IIMaavXUhyBqTuaeZjlxy9dpzBZbHZa+McrpWhuBrwlWansekQ9XXJ9lS3KEXeo4",
211
- "sw-notif-core.js": "sha384-6AjtDcguJR/MJhjnU4km7XWNOlnMAe5qWLLxiNGHlEExnY0ExQ9qXnd03PlE5ELR",
214
+ "sw-notif-core.js": "sha384-pBkDnSfofb4hU/BOQsWnJnFDPskFRvGP5z2I+tW9TXga15yjvNC/JPiYSmOyFcJY",
212
215
  "tapTrail.js": "sha384-Na3QIhXdlCtSzDXAO9z1R2OZ36PuWQh/GzsN8luh4plArJJSDoYBjWrAU3NsqAku",
213
216
  "tempList.js": "sha384-fH1HemG//WUOeW4u2Mi/2OJas7FV+dfnzlMNYofEK4KGDKCoTB33+U4nuRv9pq8h",
214
217
  "tinfoilVerifier.js": "sha384-VGUL+148m10QYUYNezSWpMyl/rtwAJvQ3APcd4JscCnxudBSFODpSAvsr5aIZ55W",
@@ -220,12 +223,12 @@
220
223
  "usageReceipts.js": "sha384-2jq24tFKYlEdmmG2wB1IGeS65eY1vmJTx+HbZgcE8WauyQMA5RyCZwC1nqnd7GBO",
221
224
  "usageSummary.js": "sha384-Ox1QVGMJ9QwuddinJ0lCCqzzTH2gQlVh8d8Ozd0v6Vp6esApiWkdfbM5vgW0VT6C",
222
225
  "util.js": "sha384-FY4tFxhs/cNXbCkQSVyZc/0iyP0V7bMZf5NdiQbx4okDxd09otsZB+VTTiXxjcDA",
223
- "vault-core.js": "sha384-NsOrXk7Bqq+h4T3ZDwLPo4WyRQt0n98l/XyOFblo2VJXjF54ZqbWoA4n7RZOkCoh",
224
- "vault-kit.mjs": "sha384-g7GOtq2USJQPJX51NTRxuobkmCdb51Ekj4+aHuQm9VHs1TyGmpkrgO3fxzE/FIcY",
226
+ "vault-core.js": "sha384-svQcHPsQiBPoDI2W5a7G2dzUFF1Zpj1Nx1sFxAQELnEk0IoQEDT2uU7Krz4XampP",
227
+ "vault-kit.mjs": "sha384-iFv1CBQ1Y73qEVAQdXzooS3mH2MATkUejbwrTB2tFNnAbTCQIfjcvuO4acZp0Gsz",
225
228
  "vault-screens.js": "sha384-URf4/cjWLnzLt/dryA3odAUeJCe6lKmWxbDAl67nVpWIJerK/6tHf1DrS2SJj+KS",
226
229
  "vaultAtRest.js": "sha384-F00LSSeXxDFhTSMPruPFxbo0dAQImlg7CbTSTH+NJqu+Y3p6AmKYdMCr23kZ66VL",
227
230
  "vaultCoreLock.js": "sha384-2RdHJjbgp/Qr1JzXX21I71vbiVmWl1Uv7JpBKnU/+InBaa0vC1B19EAMhYZ1LZ0/",
228
- "vaultCorePush.js": "sha384-O0EKR7YJeoNcm8azSGUv+/vngeTwdV/6Moz8oEjrmgtz8Q/iedgR1879JfC4mXwc",
231
+ "vaultCorePush.js": "sha384-jdkSWnI8/0lEBVs2Eoxj3AEep/svM0O65Pmg4WmSSdGqLrXaN46AucSciNBRzjgr",
229
232
  "vaultDeviceKey.js": "sha384-dxi/JbQlMPP7KkKYWyCSoD1cygLrzlppZ087rJLSlSLMK3PIBMuK/9GmNY/Hqovc",
230
233
  "vaultEnclaveHandoff.js": "sha384-PBfF5D8mW4HjhHRZAwfvg8BRIiKmNWm0EK/JG4ug8JWqqRGtxH6omGVZ1Ix0y1MG",
231
234
  "vaultKeep.js": "sha384-i4o3WwlUIq2jBHLLdWK4cxqPb1m3bSUQNZLbSl2DZZ3c60EIn/x3N8Y0luNZ+eDN",
@@ -235,14 +238,14 @@
235
238
  "voiceAttest.js": "sha384-H+Uxa7jFO7kaLjxhZnSwgZ/GrgQLjCFV3o6hhQE4l0yw1mI1Nx6HKZVKSkhVJ9sW",
236
239
  "voiceCert.js": "sha384-lYIUZhCjHZUqJOqIaV0JrMVJXl4u5O32+kofC6kSVAmwOUbpme9mMh0ZhNcrYYEj",
237
240
  "witbitz-admin.js": "sha384-/e0V5Q5jYfuJVnomnQaXiI2hszGueuX5W2PbYApdFAowZXHW24m+mpxW+KHfSywE",
238
- "witbitz-sdk.js": "sha384-vY7EF7US8n7kTF/KJkUvl1pT8NnUUVfIIEWu4xUhY4ImW53qVKJFfchAww5kBiqM",
241
+ "witbitz-sdk.js": "sha384-HV3qgweTGVPBddMny0SyPatA/IAuZk445P079TNe7C73EGkqRAHofEiJj/JfsE23",
239
242
  "workerClient.js": "sha384-f/z7EfUCWakRS00R8UfWGnVIZDtWBA3WPXl2B5orVAkeyvaTUXVqC+hDqb4hkAB6",
240
243
  "workerLiveness.js": "sha384-BSL4mziJ9HE+b2ILIHccsIxSloOr0NKm6pGrRrPN77cRLcwzaJHEEtrjrQcIgVZH",
241
244
  "x509.js": "sha384-YAuy3/aSUomw0Ne+aDTto3HTb9yzdgA+1h44DimiEMjkMYOq/O6MhuRZKsbXmSSp",
242
- "witbitz-sdk.d.ts": "sha384-bO138VoQVdsIwAdn2I60//aDOic8cBGkpZb4cPOFw7b2zwczd18QE2UQX0twzcJu",
245
+ "witbitz-sdk.d.ts": "sha384-YYZAcDxbhvYW5uFelnr1R9EGYCETAYMrFEXmeD/EMPzL/bV3pzewmVhYfG8AuFtd",
243
246
  "witbitz-admin.d.ts": "sha384-ikmN7qyKXg/WdVWmRORgw9LNt/n+M0zJaKcKbLlY0W+nEIH9b4uCCUbket/jWbwX",
244
247
  "decrypt.html": "sha384-3xRvQ++CfE5Fdxf+zHU51M4wxGNthg4NZqrgfaO0vaHiKTKNplmgWBotsf1o8vTS",
245
- "witbitz-admin.mjs": "sha384-Qwd8eNgBGUgEr5/rz6JIVA2HBdPPpAqepx8mNInM5808p/+TSUJXhLUVMGVA1yUq",
246
- "l1-worker-src.js": "sha384-y/RHh6WP+PpXCWRcFC2LlTzdeMZnxjjAdEhpcFGVTjeWqQmjeQCZ+rSVtDSRLJ+2"
248
+ "witbitz-admin.mjs": "sha384-nmOgt82jO8e5UkR4s5h8Y8NFDWgjQ2PtRiJ2d+q0oQ7D/Lw4thFiPm8wEFNSzh7+",
249
+ "l1-worker-src.js": "sha384-b+P82j3hTTB/b6U62T5xuq4T0dPTkonxbHwz1DRdzHVwp5kQGEVQTRITPKnI8jAc"
247
250
  }
248
251
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@witbitz/sdk",
3
- "version": "4.8.0",
4
- "description": "The Witbitz SDK: Spaces — end-to-end encrypted rooms with an AI assistant — in your own app. The same bytes as https://witbitz.chat/sdk/4.8.0/",
3
+ "version": "4.9.0",
4
+ "description": "The Witbitz SDK: Spaces — end-to-end encrypted rooms with an AI assistant — in your own app. The same bytes as https://witbitz.chat/sdk/4.9.0/",
5
5
  "type": "module",
6
6
  "main": "./witbitz-sdk.js",
7
7
  "types": "./witbitz-sdk.d.ts",
@@ -27,6 +27,8 @@
27
27
  "accountIndexDoc.js",
28
28
  "accountOwner.js",
29
29
  "accountRecord.js",
30
+ "accountRoomPointers.js",
31
+ "accountRooms.js",
30
32
  "accountScope.js",
31
33
  "accountSeal.js",
32
34
  "accountStores.js",
@@ -210,6 +212,7 @@
210
212
  "sealShare.js",
211
213
  "sealedNames.js",
212
214
  "sealedReceipt.js",
215
+ "sealedRoomWire.js",
213
216
  "sentinelRelease.js",
214
217
  "shamir.js",
215
218
  "sharedViews.js",
package/roomDelete.js CHANGED
@@ -19,6 +19,10 @@ export async function delSecretFor (key, room) {
19
19
  const k = await crypto.subtle.importKey('raw', ub64u(key.secret), { name: 'HMAC', hash: 'SHA-256' }, false, ['sign'])
20
20
  return b64u(new Uint8Array(await crypto.subtle.sign('HMAC', k, enc.encode('witbitz-room-delete:' + room))))
21
21
  }
22
+ export async function accountRoomCreatorProofs(room) {
23
+ const keys = [loadUsageKey(), ...loadOldUsageKeys()].filter(Boolean).slice(0, 16)
24
+ return Promise.all(keys.map(key => delSecretFor(key, room)))
25
+ }
22
26
  export async function delCommitOf (secret) { return b64u(new Uint8Array(await crypto.subtle.digest('SHA-256', enc.encode(secret)))) }
23
27
 
24
28
  /** The commitment a create carries — minting the account key on the spot if this device has none yet (a brand-new
package/roomName.js CHANGED
@@ -68,8 +68,11 @@ export async function sendRename(ops, name, by) {
68
68
  /** May `email` rename a room whose sealed config is `cfg`? Where it has owners or admins, only they; otherwise anyone —
69
69
  * the server's rule (op:'title' set), the same one a move follows (emailFork.js mayMove). */
70
70
  export function mayRename(cfg, email, tags = []) {
71
- return !isDirect(cfg) && (!hasRoles(cfg) || !!roleFor(cfg, { email, tags }))
71
+ return !settingsPending(cfg) && !isDirect(cfg) && (!hasRoles(cfg) || !!roleFor(cfg, { email, tags }))
72
72
  }
73
+ /** A verified room's answer before its sign-in (spaceClient getConfig: `{ admission: 'email', gated: true }`, no list): its roles
74
+ * have not arrived, so it is not "a room without admins" (sync sweep 2026-12-04 O39: Rename showed there, then the server refused). */
75
+ export const settingsPending = (cfg) => !!(cfg && cfg.gated === true && !cfg.allow)
73
76
 
74
77
  // ── WHICH NAMES A ROOM GETS (the owner, 2026-10-08) ──────────────────────────────────────────────────────────────────────
75
78
  // ALONE (you and the assistant, a private lane): the name follows the conversation — generated, revisited as the subject