@witbitz/sdk 4.4.0 → 4.5.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/README.md +2 -2
- package/a2aCore.js +15 -0
- package/accountErase.js +9 -3
- package/accountIndexDoc.js +24 -7
- package/accountRecord.js +6 -2
- package/accountStores.js +21 -5
- package/acctV2App.js +111 -12
- package/acctV2Client.js +11 -1
- package/acctV2UiCore.js +27 -7
- package/awsKey.js +3 -1
- package/backupRecord.js +3 -0
- package/codeAttachments.js +1 -0
- package/codeCache.js +27 -3
- package/codeCloud.js +2 -0
- package/codeComputers.js +8 -0
- package/codeSent.js +43 -2
- package/codeTransport.js +24 -5
- package/connections.js +21 -3
- package/decrypt.html +69 -9
- package/eraseFile.js +15 -0
- package/idbSeal.js +5 -2
- package/inviteReceive.js +44 -0
- package/inviteSend.js +8 -2
- package/l1-worker-src.js +1 -1
- package/l1-worker.js +30 -14
- package/laneAssociation.js +11 -1
- package/laneLinkCore.js +9 -0
- package/ledgerView.js +30 -4
- package/manifest.json +78 -72
- package/offlineBundle.js +21 -0
- package/package.json +8 -2
- package/protectedLocal.js +34 -11
- package/reactionHolders.js +86 -0
- package/roomIntake.js +324 -0
- package/roomRoster.js +9 -2
- package/scheduleNext.js +60 -0
- package/sdkA2A.js +46 -8
- package/sdkAccount.js +71 -14
- package/sdkAccountDoc.js +3 -3
- package/sdkAccountSections.js +58 -18
- package/sdkAgui.js +33 -6
- package/sdkBackup.js +21 -6
- package/sdkBackupV2.js +15 -3
- package/sdkCloudDevice.js +12 -3
- package/sdkComputers.js +118 -17
- package/sdkDictation.js +1 -1
- package/sdkErase.js +3 -1
- package/sdkExports.js +15 -6
- package/sdkInvitations.js +4 -2
- package/sdkKeptAgent.js +19 -3
- package/sdkKeptIntake.js +100 -0
- package/sdkLaneLink.js +5 -6
- package/sdkRekey.js +72 -5
- package/sdkSchedules.js +8 -1
- package/sdkSpeech.js +14 -1
- package/sdkTemporaryRooms.js +2 -1
- package/sdkTurn.js +12 -4
- package/sharedViews.js +17 -1
- package/siri.js +29 -5
- package/spaceClient.js +96 -12
- package/spaceExport.js +50 -5
- package/spaceFork.js +15 -7
- package/spaceTemplates.js +2 -2
- package/speechOut.js +17 -3
- package/store.js +51 -13
- package/sw-notif-core.js +2 -1
- package/tapTrail.js +58 -0
- package/usageReceipts.js +12 -5
- package/vault-core.js +90 -16
- package/vault-kit.mjs +2 -2
- package/vault-screens.js +25 -11
- package/vaultAtRest.js +3 -2
- package/vaultCoreLock.js +3 -1
- package/vaultCorePush.js +58 -7
- package/vaultWorkerHost.js +9 -3
- package/witbitz-admin.d.ts +3 -0
- package/witbitz-admin.mjs +10 -10
- package/witbitz-sdk.d.ts +59 -23
- package/witbitz-sdk.js +271 -64
package/inviteSend.js
CHANGED
|
@@ -7,6 +7,9 @@ import { resolveHandle, usernameSlotApp } from './inviteEnroll.js' // ⛔ THIS a
|
|
|
7
7
|
import { validUsername } from './address.js'
|
|
8
8
|
import { sealTo } from './e2ee.js'
|
|
9
9
|
|
|
10
|
+
// ≡ agent/spaceHandlerCommon.mjs appTag: the names a directory slot can have
|
|
11
|
+
const slotName = (v) => { const t = typeof v === 'string' ? v.trim().toLowerCase() : ''; return !!t && t.length <= 64 && /^[a-z0-9][a-z0-9_.-]*$/.test(t) }
|
|
12
|
+
|
|
10
13
|
/** The invitee's directory handle for `{ email } | { username }`. Returns `{ handle }` or `{ reason }`:
|
|
11
14
|
* `no_user` = no such username (distinct from an enrolled-or-not email — a name is either claimed or it is not).
|
|
12
15
|
* Throws only if the OPRF/DLEQ round-trip fails. */
|
|
@@ -17,6 +20,9 @@ export async function resolveInvitee({ email, username, app, scope }, client) {
|
|
|
17
20
|
// the slot of THIS app: an attested kind's box, else — in a scoped app (the hosted app) — its own slot under the global
|
|
18
21
|
// handle (inviteEnroll.js enrollUsernameSlot), never the regular app's default one
|
|
19
22
|
const slot = app || (scope === undefined ? usernameSlotApp() : scope) || undefined
|
|
23
|
+
// A SLOT NAME THE SERVER CANNOT HOLD (side sweep 2026-11-28): a builder SDK's scope is 'app:<origin>', which no username slot is
|
|
24
|
+
// named after (agent/spaceHandlerCommon.mjs appTag) — every lookup answered "not enrolled" for a person who is. Said plainly.
|
|
25
|
+
if (slot && !slotName(slot)) return { reason: 'username_unsupported' }
|
|
20
26
|
const r = await client.userResolve(u, slot)
|
|
21
27
|
if (!r || r.status === 404) return { reason: 'no_user' }
|
|
22
28
|
if (r.status !== 200) return { reason: 'resolve_failed:' + (r ? r.status : 'net') }
|
|
@@ -47,7 +53,7 @@ export async function findInvitee({ email, username, app, scope }, client) {
|
|
|
47
53
|
|
|
48
54
|
// Returns { ok:true } or { ok:false, reason }. `not_enrolled` = the recipient has never opened Spaces, so there is no
|
|
49
55
|
// slot to seal to (the UI should say "ask them to open Spaces once"); `no_user` = that username does not exist.
|
|
50
|
-
export async function sendInvite({ email, username, room, mk, title, from, gate, link, client, direct, app, scope, kind, us = null, spc = '' }) { // app/kind: an ATTESTED room's invite goes to the invitee's box for that kind (attestedBox.js), never with a link
|
|
56
|
+
export async function sendInvite({ email, username, room, mk, title, from, gate, link, client, direct, app, scope, kind, enc = false, us = null, spc = '' }) { // app/kind: an ATTESTED room's invite goes to the invitee's box for that kind (attestedBox.js), never with a link
|
|
51
57
|
// A SPLIT room has NO mk to deliver — the self-contained `link` carries the userShare (#us=) instead, so accept when
|
|
52
58
|
// EITHER an mk or a link is present. (`mk` is still delivered for a plain room, and as a v1 fallback field below.)
|
|
53
59
|
// AN ATTESTED SPLIT ROOM (the hosted app's — 2026-11-24, every attested invite there failed bad_args): no mk and no link, the user
|
|
@@ -60,7 +66,7 @@ export async function sendInvite({ email, username, room, mk, title, from, gate,
|
|
|
60
66
|
// Seal the self-contained LINK (room+mk+gate+lanes in ONE grammar) as the source of truth the recipient reverse-parses,
|
|
61
67
|
// so no field is ever hand-dropped again (that was the "synced, can't open" bug — the gate marker went missing). room/mk
|
|
62
68
|
// /gate are ALSO carried for now so a not-yet-updated recipient (a v1 reader) still works during rollout.
|
|
63
|
-
const box = await sealTo(JSON.stringify({ v: 2, ...(link ? { link } : {}), room, ...(mk ? { mk } : {}), ...(us ? { us: String(us), ...(spc ? { spc: String(spc) } : {}) } : {}), ...(gate ? { gate } : {}), title: title || '', from: from || '', ...(kind ? { kind } : {}), ...(direct ? { direct: String(direct).slice(0, 254) } : {}), at: Date.now() }), g.entry.boxPub)
|
|
69
|
+
const box = await sealTo(JSON.stringify({ v: 2, ...(link ? { link } : {}), room, ...(mk ? { mk } : {}), ...(us ? { us: String(us), ...(spc ? { spc: String(spc) } : {}) } : {}), ...(gate ? { gate } : {}), title: title || '', from: from || '', ...(kind ? { kind, ...(enc === true ? { enc: true } : {}) } : {}), ...(direct ? { direct: String(direct).slice(0, 254) } : {}), at: Date.now() }), g.entry.boxPub)
|
|
64
70
|
const r = await client.drop(g.entry.inbox, box)
|
|
65
71
|
if (r && r.status === 200) return { ok: true }
|
|
66
72
|
if (r && r.status === 507) return { ok: false, reason: 'inbox_full' }
|