@witbitz/sdk 4.3.0 → 4.4.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 +26 -5
- package/accountErase.js +6 -1
- package/accountRecord.js +2 -2
- package/agentDoorTools.js +28 -0
- package/chatLock.js +16 -0
- package/cloudDevicePins.js +2 -2
- package/codeAttachments.js +100 -0
- package/codeCache.js +149 -0
- package/codeCloud.js +0 -2
- package/codeComputers.js +1 -0
- package/codeFolders.js +116 -0
- package/codeHistory.js +76 -0
- package/codeLanguage.js +54 -0
- package/codeModes.js +2 -0
- package/codeProgress.js +54 -0
- package/codeSent.js +68 -0
- package/codeSubagents.js +107 -0
- package/codeTransport.js +22 -0
- package/connections.js +17 -18
- package/deviceAttest.js +9 -3
- package/idb.js +19 -3
- package/jobAgents.js +2 -2
- package/keptMerge.js +9 -2
- package/l1-worker-src.js +1 -1
- package/l1-worker.js +93 -30
- package/laneAssociation.js +68 -0
- package/laneConfig.js +4 -3
- package/manifest.json +80 -61
- package/memberChange.js +4 -2
- package/mirrorBatch.js +47 -0
- package/opRouting.js +10 -0
- package/package.json +21 -2
- package/pdfOptions.js +13 -0
- package/pdfText.js +107 -0
- package/pdfjs.mjs +28 -0
- package/pdfjs.worker.mjs +28 -0
- package/protectedLocal.js +18 -2
- package/removedMessage.js +1 -1
- package/roomEmbed.js +111 -0
- package/roomName.js +1 -1
- package/roomRoster.js +21 -5
- package/rosterCount.js +6 -3
- package/sdkA2A.js +160 -40
- package/sdkAccount.js +17 -4
- package/sdkAccountDoc.js +11 -3
- package/sdkAccountSections.js +117 -8
- package/sdkBackup.js +35 -8
- package/sdkCloudDevice.js +8 -2
- package/sdkComputers.js +582 -53
- package/sdkDictation.js +114 -24
- package/sdkErase.js +9 -4
- package/sdkExports.js +4 -2
- package/sdkLaneLink.js +3 -3
- package/sdkPlan.js +4 -2
- package/sdkRekey.js +50 -17
- package/sdkReport.js +1 -1
- package/sdkSafeMedia.js +1 -1
- package/sdkSpeech.js +19 -2
- package/sdkTemporaryRooms.js +123 -0
- package/sdkVault.js +66 -10
- package/sentinelRelease.js +1 -0
- package/sharedViews.js +17 -3
- package/siri.js +114 -7
- package/spaceClient.js +16 -5
- package/spaceEmailGate.js +2 -2
- package/spaceTemplates.js +99 -0
- package/speechOut.js +4 -2
- package/store.js +83 -14
- package/sw-notif-core.js +9 -7
- package/turnVerdict.js +1 -0
- package/vault-core.js +480 -112
- package/vault-kit.mjs +2 -2
- package/vault-screens.js +5 -7
- package/vaultAtRest.js +35 -4
- package/vaultKeep.js +9 -3
- package/vaultWorkerHost.js +23 -4
- package/witbitz-admin.mjs +12 -11
- package/witbitz-sdk.d.ts +115 -24
- package/witbitz-sdk.js +572 -149
package/vault-kit.mjs
CHANGED
|
@@ -20,7 +20,7 @@ import { createHash } from 'node:crypto'
|
|
|
20
20
|
import { join, dirname } from 'node:path'
|
|
21
21
|
|
|
22
22
|
export const DEFAULTS = { endpoint: 'https://api.witbitz.chat/v1/space', loginBase: 'https://witbitz-spaces.pages.dev', from: 'https://witbitz.chat/sdk/latest/', enclaveClaim: 'https://witbitz-spaces.pages.dev/enclave-claim.json', accountService: 'https://api.witbitz.chat/v1' } // enclaveClaim: the confidential tier's published measurement (and its policy text, beside it)
|
|
23
|
-
export const KIT_RELEASE = '4.
|
|
23
|
+
export const KIT_RELEASE = '4.4.0' // tools/sdk-release.mjs stamps the version here, so a downloaded copy builds from ITS release
|
|
24
24
|
export function stampSdkAuth(src) {
|
|
25
25
|
return src.replaceAll('__' + 'SPACE_AUTH_BROKER' + '__', 'https://auth.witbitz.chat').replaceAll('__' + 'SPACE_AUTH_FORCE_BROKER' + '__', '0')
|
|
26
26
|
}
|
|
@@ -65,7 +65,7 @@ export function parseArgs(argv) {
|
|
|
65
65
|
export function headersFor({ page, endpoint = DEFAULTS.endpoint, loginBase = DEFAULTS.loginBase, enclaveClaim = DEFAULTS.enclaveClaim, accountService = DEFAULTS.accountService, authBroker = 'https://auth.witbitz.chat' }) {
|
|
66
66
|
const csp = [
|
|
67
67
|
"default-src 'self'", "script-src 'self' 'unsafe-inline'", "worker-src 'self' blob:", "style-src 'self' 'unsafe-inline'", "img-src 'self' data: blob:",
|
|
68
|
-
`connect-src 'self' ${[...new Set([originOf(endpoint), originOf(loginBase), originOf(enclaveClaim), originOf(accountService), originOf(authBroker)])].join(' ')}`,
|
|
68
|
+
`connect-src 'self' ${[...new Set([originOf(endpoint), originOf(loginBase), originOf(enclaveClaim), originOf(accountService), originOf(authBroker), 'wss://code-relay.witbitz.chat'])].join(' ')}`,
|
|
69
69
|
`frame-src ${originOf(page)}`, "frame-ancestors 'none'", "base-uri 'self'", "object-src 'none'", "form-action 'none'",
|
|
70
70
|
].join('; ')
|
|
71
71
|
// Cross-Origin-Opener-Policy: a page that opens the vault in a window gets no handle on it (docs/hosted-app-design.md §7, as
|
package/vault-screens.js
CHANGED
|
@@ -95,9 +95,9 @@ export function defaultScreens({ brand = 'this app', accent = '' } = {}) {
|
|
|
95
95
|
input.focus()
|
|
96
96
|
})
|
|
97
97
|
},
|
|
98
|
-
share({ link, title = '' }) {
|
|
98
|
+
share({ link, title = '', gated = null }) {
|
|
99
99
|
return new Promise((resolve) => {
|
|
100
|
-
const { c, close } = card(title ? 'Invite to ' + title : 'Invite someone', 'Anyone with this link can join. Send it only to people you mean to.')
|
|
100
|
+
const { c, close } = card(title ? 'Invite to ' + title : 'Invite someone', gated ? 'Only people on the room’s member list can join. They open the link and sign in.' : gated == null ? 'Send this invite to the people you want to join. The Space’s admission settings apply.' : 'Anyone with this link can join. Send it only to people you mean to.')
|
|
101
101
|
const input = el('input'); input.readOnly = true; input.value = link
|
|
102
102
|
const row = el('div', 'wbv-row'), done = el('button', 'wbv-btn', 'Done'), copy = el('button', 'wbv-btn wbv-go', 'Copy link')
|
|
103
103
|
row.append(done)
|
|
@@ -202,11 +202,9 @@ export function defaultScreens({ brand = 'this app', accent = '' } = {}) {
|
|
|
202
202
|
const row = el('div', 'wbv-row'), cancel = el('button', 'wbv-btn', 'Cancel'), go = el('button', 'wbv-btn wbv-go', merging ? 'Verify and save' : protecting ? 'Protect backup' : moving ? 'Move account' : 'Restore')
|
|
203
203
|
row.append(cancel, go); c.append(input, err, row)
|
|
204
204
|
let code = '', addr = email, ticket = '', step = 'code'
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
identity.onclick = async () => { identity.disabled = true; try { addr = String(await signIn() || ''); identity.textContent = addr ? 'Signed in as ' + addr : signInLabel } catch { err.textContent = 'Sign-in did not finish. Try again.' } finally { identity.disabled = false } }
|
|
209
|
-
}
|
|
205
|
+
// CODE FIRST (the owner, 2026-11-27: "The email is after we enter the recovery key"): no sign-in step in front of the code
|
|
206
|
+
// (30c5fb580 had put one here). The email is asked below, after the code, when the backup or the account service needs it;
|
|
207
|
+
// `signIn` / `signInLabel` are still accepted, for a builder's own screen that wants them.
|
|
210
208
|
cancel.onclick = () => { close(); reject(Object.assign(new Error('cancelled'), { code: 'cancelled' })) }
|
|
211
209
|
const ask = (what, placeholder, type = 'text') => { step = what; input.value = ''; input.type = type; input.placeholder = placeholder; input.focus() }
|
|
212
210
|
go.onclick = async () => {
|
package/vaultAtRest.js
CHANGED
|
@@ -79,10 +79,12 @@ export function holdsSealed (storage, { rooms, backup } = {}) {
|
|
|
79
79
|
return !!(b && typeof b === 'object' && !Array.isArray(b) && Object.values(b).some((v) => isSealed(v)))
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
export function createAtRest ({ storage, key }) {
|
|
82
|
+
export function createAtRest ({ storage, key, currentRoom = () => true }) {
|
|
83
83
|
let chain = Promise.resolve()
|
|
84
84
|
const onDisk = (fn) => { const p = chain.then(fn); chain = p.catch(() => {}); return p }
|
|
85
|
-
const sealedOf = new Map()
|
|
85
|
+
const sealedOf = new Map()
|
|
86
|
+
const snapshots = new Map()
|
|
87
|
+
const signature = rows => new Map(rows.map(r => [r.room, JSON.stringify(r)])) // room → { secret (JSON), ks } — an unchanged key is not sealed again on every save
|
|
86
88
|
// ⛔ AN ENTRY THIS KEY CANNOT OPEN (another key's, or no key at all: IndexedDB failed at start) is carried over AS IT IS on every
|
|
87
89
|
// save — read as keyless and written as `rest`, the next save erased its sealed key for good (review, 2026-11-13).
|
|
88
90
|
const unopened = new Map() // room → { href, ks }
|
|
@@ -115,13 +117,42 @@ export function createAtRest ({ storage, key }) {
|
|
|
115
117
|
const raw = read(storage, k)
|
|
116
118
|
const list = Array.isArray(raw) ? raw : []
|
|
117
119
|
const out = (await Promise.all(list.map(entryIn))).filter(Boolean)
|
|
120
|
+
snapshots.set(k, signature(out))
|
|
118
121
|
if (key && list.some((e) => e && typeof e.link === 'string' && splitLink(e.link))) this.saveRooms(k, out)
|
|
119
122
|
return out
|
|
120
123
|
},
|
|
121
124
|
/** Write the list — the links' keys sealed. In the order called; resolves once this one is on disk. */
|
|
122
|
-
saveRooms (k, rooms) {
|
|
125
|
+
saveRooms (k, rooms, strict = false, replaceAll = false) {
|
|
123
126
|
const snap = (Array.isArray(rooms) ? rooms : []).map((r) => ({ ...r }))
|
|
124
|
-
return onDisk(async () => {
|
|
127
|
+
return onDisk(async () => {
|
|
128
|
+
const encoded = await Promise.all(snap.map(entryOut))
|
|
129
|
+
const next = signature(snap)
|
|
130
|
+
const commit = () => {
|
|
131
|
+
const previous = snapshots.get(k)
|
|
132
|
+
const disk = read(storage, k)
|
|
133
|
+
const rows = new Map((Array.isArray(disk) ? disk : []).filter(currentRoom).map(r => [r.room, r]))
|
|
134
|
+
if (replaceAll || !previous) rows.clear()
|
|
135
|
+
else for (const [room, baseline] of previous) {
|
|
136
|
+
if (!next.has(room) && rows.get(room)?.forgetMark === JSON.parse(baseline).forgetMark) rows.delete(room)
|
|
137
|
+
}
|
|
138
|
+
for (const row of encoded) {
|
|
139
|
+
if (!currentRoom(row)) continue
|
|
140
|
+
const old = rows.get(row.room)
|
|
141
|
+
const migrating = key && old?.link && row.ks
|
|
142
|
+
if (replaceAll || !previous || previous.get(row.room) !== next.get(row.room) || migrating) rows.set(row.room, row)
|
|
143
|
+
}
|
|
144
|
+
const list = [...rows.values()]
|
|
145
|
+
const raw = JSON.stringify(list)
|
|
146
|
+
try {
|
|
147
|
+
storage.setItem(k, raw)
|
|
148
|
+
if (storage.getItem(k) !== raw) throw new Error('vault room list was not saved')
|
|
149
|
+
snapshots.set(k, next)
|
|
150
|
+
} catch (error) { if (strict) throw error }
|
|
151
|
+
}
|
|
152
|
+
const locks = globalThis.navigator?.locks
|
|
153
|
+
if (locks) await locks.request('witbitz:room-registry:' + k, commit)
|
|
154
|
+
else commit()
|
|
155
|
+
})
|
|
125
156
|
},
|
|
126
157
|
/** Every account's backup state (the vault's `wbvault:backup` = { email: state }), opened. */
|
|
127
158
|
async loadBackups (k) {
|
package/vaultKeep.js
CHANGED
|
@@ -70,7 +70,7 @@ export function stampKeep (prev, cur, now = Date.now()) {
|
|
|
70
70
|
// and its Spaces never come back from a copy made before the delete.
|
|
71
71
|
const was = (p.siri && p.siri.state && p.siri.state.rooms) || {}
|
|
72
72
|
const off = Object.fromEntries(Object.keys(was).filter((r) => !(siri.rooms || {})[r]).map((r) => [r, Math.max(now, num(Number(was[r] && was[r].at)) + 1)]))
|
|
73
|
-
const gone = unionMarks(p.siri && p.siri.gone, off), rev = num(Number(p.siri && p.siri.rev)) + (blank && p.siri ? 1 : 0)
|
|
73
|
+
const gone = unionMarks(p.siri && p.siri.gone, off), rev = Math.max(num(Number(siri.rev)), num(Number(p.siri && p.siri.rev)) + (blank && p.siri ? 1 : 0))
|
|
74
74
|
out.siri = { at: now, state: siri, ...(Object.keys(gone).length ? { gone } : {}), ...(rev ? { rev } : {}) }
|
|
75
75
|
}
|
|
76
76
|
return out
|
|
@@ -109,7 +109,7 @@ function siriEntry (x, y) {
|
|
|
109
109
|
const lead = atRev[0] ? atRev[0].state : { token: '', defaultRoom: '' }
|
|
110
110
|
const keyOf = (e) => ({ token: e.state ? e.state.token : '', rev: e.rev })
|
|
111
111
|
const def = siriDefaultOf(rooms, ...atRev.map((e) => e.state.defaultRoom))
|
|
112
|
-
return { at: Math.max(num(x.at), num(y.at)), state: { ...lead, token: siriKeyOf(keyOf(base), keyOf(other)), defaultRoom: def, rooms }, ...(Object.keys(gone).length ? { gone } : {}), ...(rev ? { rev } : {}) }
|
|
112
|
+
return { at: Math.max(num(x.at), num(y.at)), state: { ...lead, ...(rev ? { rev } : {}), token: siriKeyOf(keyOf(base), keyOf(other)), defaultRoom: def, rooms }, ...(Object.keys(gone).length ? { gone } : {}), ...(rev ? { rev } : {}) }
|
|
113
113
|
}
|
|
114
114
|
/** The union of two views, the newer of each entry kept (a lane and Siri: merged by their parts). Pure — the whole agreement between devices is here. */
|
|
115
115
|
export function mergeKeep (a, b) {
|
|
@@ -150,7 +150,7 @@ export function appToKeep (doc) {
|
|
|
150
150
|
const s = obj(d.siri), { at: sAt, gone, rev, ...st } = s
|
|
151
151
|
const marks = unionMarks(gone, null), r = num(Number(rev))
|
|
152
152
|
const siri = (st.token || Object.keys(obj(st.rooms)).length || Object.keys(marks).length || r)
|
|
153
|
-
? { at: num(Number(sAt)), state: { token: typeof st.token === 'string' ? st.token : '', defaultRoom: typeof st.defaultRoom === 'string' ? st.defaultRoom : '', rooms: obj(st.rooms) }, ...(Object.keys(marks).length ? { gone: marks } : {}), ...(r ? { rev: r } : {}) }
|
|
153
|
+
? { at: num(Number(sAt)), state: { ...(r ? { rev: r } : {}), token: typeof st.token === 'string' ? st.token : '', defaultRoom: typeof st.defaultRoom === 'string' ? st.defaultRoom : '', rooms: obj(st.rooms) }, ...(Object.keys(marks).length ? { gone: marks } : {}), ...(r ? { rev: r } : {}) }
|
|
154
154
|
: null
|
|
155
155
|
return { keep: { v: 1, conns, a2a, siri }, laneGone: unionMarks(obj(d.a2a).gone, null) }
|
|
156
156
|
}
|
|
@@ -213,6 +213,11 @@ export async function syncKeep ({ loc, client, prev, cur, now = Date.now }) {
|
|
|
213
213
|
if (!(sx == null || (typeof sx === 'object' && !Object.keys(sx).length))) { try { x.doc = await openDoc(loc.app, sx) } catch { return { ok: false, why: 'unopenable', keep: local, own } } }
|
|
214
214
|
}
|
|
215
215
|
const fromApp = x ? appToKeep(x.doc) : null
|
|
216
|
+
for (const [id, at] of Object.entries(cur?.connGone || {})) {
|
|
217
|
+
if (!Number.isFinite(at) || at <= 0) continue
|
|
218
|
+
const observed = Math.max(Number(remote?.conns?.[id]?.at) || 0, Number(fromApp?.keep?.conns?.[id]?.at) || 0)
|
|
219
|
+
local.conns[id] = { at: Math.max(at, observed + 1), gone: true }
|
|
220
|
+
}
|
|
216
221
|
const merged = fromApp ? dropGoneLanes(mergeKeep(mergeKeep(local, remote), fromApp.keep), fromApp.laneGone) : mergeKeep(local, remote)
|
|
217
222
|
// DUAL WRITE: the keep's own doc for every older kit, then the app's; each only when it differs from what it holds, each over
|
|
218
223
|
// the version read. A 409 on either reads both and merges again; a failed save on either is a pass that did not save.
|
|
@@ -249,6 +254,7 @@ export function tabStores (st, keys) {
|
|
|
249
254
|
|
|
250
255
|
// What a vault holds, in one comparable shape: the connections by id (their order is not a change), Siri, the lanes.
|
|
251
256
|
const heldOf = (c) => ({
|
|
257
|
+
connGone: c?.connGone || {},
|
|
252
258
|
conns: Object.fromEntries(((c && c.conns) || []).filter((x) => x && x.id).map((x) => [String(x.id), x])),
|
|
253
259
|
siri: (c && c.siri) || null,
|
|
254
260
|
a2a: (c && c.a2a && c.a2a.lanes) || {},
|
package/vaultWorkerHost.js
CHANGED
|
@@ -27,6 +27,7 @@ import { createLiveness } from './workerLiveness.js'
|
|
|
27
27
|
export function createWorkerHost ({ make, onMessage = () => {}, onCurrent = () => {}, onRestart = () => {}, onRestarted = () => {}, graceMs = 5000, beatMs = 25000, timers = globalThis, doc = typeof document !== 'undefined' ? document : null } = {}) {
|
|
28
28
|
if (typeof make !== 'function') throw new Error('createWorkerHost: make() is required')
|
|
29
29
|
let worker = null
|
|
30
|
+
let recover = false
|
|
30
31
|
let started = Promise.resolve()
|
|
31
32
|
const steps = []
|
|
32
33
|
const set = (w) => { worker = w; try { onCurrent(w) } catch { /* the caller's mirror; never stops the host */ } }
|
|
@@ -43,6 +44,7 @@ export function createWorkerHost ({ make, onMessage = () => {}, onCurrent = () =
|
|
|
43
44
|
function make1 () {
|
|
44
45
|
const w = make()
|
|
45
46
|
set(w)
|
|
47
|
+
recover = false
|
|
46
48
|
w.onmessage = (ev) => {
|
|
47
49
|
const m = (ev && ev.data) || {}
|
|
48
50
|
if (m.t === 'pong') { live.pong(m.n); return } // the heartbeat's answer
|
|
@@ -77,15 +79,15 @@ export function createWorkerHost ({ make, onMessage = () => {}, onCurrent = () =
|
|
|
77
79
|
},
|
|
78
80
|
start () { terminate(); make1(); return started },
|
|
79
81
|
restart () {
|
|
80
|
-
if (!worker) return // dropped (signed out): nothing to bring back
|
|
82
|
+
if (!worker && !recover) return // dropped (signed out): nothing to bring back
|
|
81
83
|
try { onRestart() } catch { /* */ }
|
|
82
84
|
terminate()
|
|
83
85
|
let w
|
|
84
|
-
try { w = make1() } catch { return } // the next beat tries again
|
|
86
|
+
try { w = make1() } catch { recover = true; return } // the next beat tries again
|
|
85
87
|
try { onRestarted(w) } catch { /* */ }
|
|
86
88
|
},
|
|
87
|
-
drop () { terminate() },
|
|
88
|
-
tick () { if (worker) live.tick() },
|
|
89
|
+
drop () { recover = false; terminate() },
|
|
90
|
+
tick () { if (worker) live.tick(); else if (recover && !doc?.hidden) host.restart() },
|
|
89
91
|
pong: (n) => live.pong(n),
|
|
90
92
|
}
|
|
91
93
|
try {
|
|
@@ -96,3 +98,20 @@ export function createWorkerHost ({ make, onMessage = () => {}, onCurrent = () =
|
|
|
96
98
|
} catch { /* no timers */ }
|
|
97
99
|
return host
|
|
98
100
|
}
|
|
101
|
+
|
|
102
|
+
/** Each frame owns at most one holder per room on each worker generation. */
|
|
103
|
+
export function workerStreams() {
|
|
104
|
+
const sent = new WeakMap()
|
|
105
|
+
return (worker, room, open) => {
|
|
106
|
+
if (!worker || !room) return
|
|
107
|
+
if (!sent.has(worker)) sent.set(worker, new Set())
|
|
108
|
+
const rooms = sent.get(worker)
|
|
109
|
+
if (open && !rooms.has(room)) {
|
|
110
|
+
worker.postMessage(open)
|
|
111
|
+
rooms.add(room)
|
|
112
|
+
} else if (!open && rooms.has(room)) {
|
|
113
|
+
worker.postMessage({ t: 'streamClose', room })
|
|
114
|
+
rooms.delete(room)
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
package/witbitz-admin.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Witbitz admin client — one file for your SERVER (https://witbitz.chat/docs/sdk#builder-calls). Never ship it in a page.
|
|
2
2
|
|
|
3
|
-
// spaces/public/sdk/4.
|
|
3
|
+
// spaces/public/sdk/4.4.0/connCatalog.js
|
|
4
4
|
var GCAL_PROVIDER = "prov_XE5FdiPdAx881HKs";
|
|
5
5
|
var CATALOG = [
|
|
6
6
|
// AN AGENT YOU SEND JOBS TO, not a service you sign in to (the owner, 2026-10-15: "Doesn't grokbot have a connector like
|
|
@@ -154,7 +154,7 @@ var CATALOG = [
|
|
|
154
154
|
{ name: "Gmail", kind: "mail", host: "mail.google.com", desc: "Forward the mail you choose into a Space of your own \u2014 the assistant reads it when you ask.", cat: "Email" }
|
|
155
155
|
];
|
|
156
156
|
|
|
157
|
-
// spaces/public/sdk/4.
|
|
157
|
+
// spaces/public/sdk/4.4.0/cbor.js
|
|
158
158
|
var MAX_LEN = 1 << 22;
|
|
159
159
|
function decode(bytes) {
|
|
160
160
|
const b = toBytes(bytes);
|
|
@@ -348,7 +348,7 @@ function concat(...parts) {
|
|
|
348
348
|
return out;
|
|
349
349
|
}
|
|
350
350
|
|
|
351
|
-
// spaces/public/sdk/4.
|
|
351
|
+
// spaces/public/sdk/4.4.0/x509.js
|
|
352
352
|
var TAG = { INT: 2, BITSTRING: 3, OID: 6, SEQ: 48, UTCTIME: 23, GENTIME: 24 };
|
|
353
353
|
var SIG_OIDS = /* @__PURE__ */ new Map([
|
|
354
354
|
["1.2.840.10045.4.3.2", { hash: "SHA-256" }],
|
|
@@ -522,7 +522,7 @@ async function verifyChain(chainDer, { now = Date.now() } = {}) {
|
|
|
522
522
|
return certs[certs.length - 1];
|
|
523
523
|
}
|
|
524
524
|
|
|
525
|
-
// spaces/public/sdk/4.
|
|
525
|
+
// spaces/public/sdk/4.4.0/nitroVerify.js
|
|
526
526
|
var NITRO_ROOT_G1_B64 = "MIICETCCAZagAwIBAgIRAPkxdWgbkK/hHUbMtOTn+FYwCgYIKoZIzj0EAwMwSTELMAkGA1UEBhMCVVMxDzANBgNVBAoMBkFtYXpvbjEMMAoGA1UECwwDQVdTMRswGQYDVQQDDBJhd3Mubml0cm8tZW5jbGF2ZXMwHhcNMTkxMDI4MTMyODA1WhcNNDkxMDI4MTQyODA1WjBJMQswCQYDVQQGEwJVUzEPMA0GA1UECgwGQW1hem9uMQwwCgYDVQQLDANBV1MxGzAZBgNVBAMMEmF3cy5uaXRyby1lbmNsYXZlczB2MBAGByqGSM49AgEGBSuBBAAiA2IABPwCVOumCMHzaHDimtqQvkY4MpJzbolL//Zy2YlES1BR5TSksfbb48C8WBoyt7F2Bw7eEtaaP+ohG2bnUs990d0JX28TcPQXCEPZ3BABIeTPYwEoCWZEh8l5YoQwTcU/9KNCMEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUkCW1DdkFR+eWw5b6cp3PmanfS5YwDgYDVR0PAQH/BAQDAgGGMAoGCCqGSM49BAMDA2kAMGYCMQCjfy+Rocm9Xue4YnwWmNJVA44fA0P5W2OpYow9OYCVRaEevL8uO1XYru5xtMPWrfMCMQCi85sWBbJwKKXdS6BptQFuZbT73o/gBh1qUxl/nNr12UO8Yfwr6wPLb+6NIwLz3/Y=";
|
|
527
527
|
var COSE_ALG_ES384 = -35;
|
|
528
528
|
var MAX_DOC = 1 << 20;
|
|
@@ -646,8 +646,9 @@ async function verifyAttestation(cose, { root, now = Date.now(), maxAgeMs = 0, e
|
|
|
646
646
|
return { ok: true, ...doc, leaf };
|
|
647
647
|
}
|
|
648
648
|
|
|
649
|
-
// spaces/public/sdk/4.
|
|
649
|
+
// spaces/public/sdk/4.4.0/sentinelRelease.js
|
|
650
650
|
var BUILD_ENCLAVE_PCR0 = Object.freeze([
|
|
651
|
+
"c6a8cbd0c05d8e003e75b266f1dde2a6426b7cd61f845e4b128e59063e40968b44f30d934bbe1925582fe33bbdd0b1d7",
|
|
651
652
|
"f490096d57e4287146e8b8d7bf4c75f423984ca52199efab0ee8684fbee6cfe6ab82c72d54f05a38f24a0d4ad6e2f557",
|
|
652
653
|
"41ec7e0e54beac5759fba7efa06c48081dbd96c7299c29c92a9c619036ce057cec357ad4ad71a165d7f881df120b043b",
|
|
653
654
|
"9f0801335a952bdbac70b6793150738d7ce30bc3a0d520fec6f573de22a822aa5ef762f78648bc8608ca0b2eeccda556",
|
|
@@ -793,7 +794,7 @@ async function recordPcrBy(r, subject, builders, verify = verifyAttestation) {
|
|
|
793
794
|
return { pcr0, builder };
|
|
794
795
|
}
|
|
795
796
|
|
|
796
|
-
// spaces/public/sdk/4.
|
|
797
|
+
// spaces/public/sdk/4.4.0/sealShare.js
|
|
797
798
|
var enc2 = new TextEncoder();
|
|
798
799
|
var b64 = (u8) => btoa(String.fromCharCode(...new Uint8Array(u8)));
|
|
799
800
|
async function sealTo(enclaveKey, nonce, bundle) {
|
|
@@ -807,14 +808,14 @@ async function sealTo(enclaveKey, nonce, bundle) {
|
|
|
807
808
|
return { epk: b64(epk), iv: b64(iv), ct: b64(ct), nonce: b64(nonce) };
|
|
808
809
|
}
|
|
809
810
|
|
|
810
|
-
// spaces/public/sdk/4.
|
|
811
|
+
// spaces/public/sdk/4.4.0/connDisp.js
|
|
811
812
|
var enc3 = new TextEncoder();
|
|
812
813
|
var dec = new TextDecoder();
|
|
813
814
|
var SALT = enc3.encode("witbitz-sentinel-display-v1");
|
|
814
815
|
var INFO = enc3.encode("sentinel-display");
|
|
815
816
|
|
|
816
|
-
// spaces/public/sdk/4.
|
|
817
|
-
var STANDING_SENTINEL_PCR0 = ["1903ce28fc5a75efe2e57a451d667f1ce8b4b6e11872fb2b81d9e62d8cd994ed80fcfa99807f289af5f281aa4e4cc010"
|
|
817
|
+
// spaces/public/sdk/4.4.0/connections.js
|
|
818
|
+
var STANDING_SENTINEL_PCR0 = ["1903ce28fc5a75efe2e57a451d667f1ce8b4b6e11872fb2b81d9e62d8cd994ed80fcfa99807f289af5f281aa4e4cc010"];
|
|
818
819
|
var b642 = (u8) => btoa(String.fromCharCode(...new Uint8Array(u8)));
|
|
819
820
|
var unb642 = (s) => Uint8Array.from(atob(s), (c) => c.charCodeAt(0));
|
|
820
821
|
var ConnectionError = class extends Error {
|
|
@@ -927,7 +928,7 @@ async function attestStandingSentinel({ post, auth = {}, pins = STANDING_SENTINE
|
|
|
927
928
|
}
|
|
928
929
|
var MCP_CURATED = CATALOG.filter((c) => c.url).map((c) => ({ label: c.name, url: c.url }));
|
|
929
930
|
|
|
930
|
-
// spaces/public/sdk/4.
|
|
931
|
+
// spaces/public/sdk/4.4.0/sdkRedact.js
|
|
931
932
|
var REDACTED = "[REDACTED]";
|
|
932
933
|
var INSPECT = /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom");
|
|
933
934
|
function hide(obj, names) {
|
|
@@ -952,7 +953,7 @@ function redacted(proto, summary) {
|
|
|
952
953
|
});
|
|
953
954
|
}
|
|
954
955
|
|
|
955
|
-
// spaces/public/sdk/4.
|
|
956
|
+
// spaces/public/sdk/4.4.0/witbitz-admin.js
|
|
956
957
|
var adminError = (code, message) => Object.assign(new Error(message), { code: String(code || "refused") });
|
|
957
958
|
var DEFAULT_ENDPOINT = "https://api.witbitz.chat/v1/space";
|
|
958
959
|
var ownerRetired = () => adminError("owner_rule_retired", "witbitz: the owner rule (rooms only your app may use) is retired \u2014 a web page cannot prove which app it is (sdk-changes.md, 4.0.0)");
|