b72976e06c
Second half of the browser-native bus SDK (issue 0001, Phase 1), making uniweb a peer of the bus in its own right (like unibus_android) without the Go gateway: - busauth.ts: NATS user nkey from the Ed25519 key (base32 + crc16, no nkeys dep) and control-plane request signing (CanonicalRequest + X-Unibus-* headers). - room.ts: Policy / Room types (ModeNATS, ModeMatrix). - client.ts: the pure room ENVELOPE (sealRoomMessage/openRoomMessage — AEAD with the subject as AAD, Ed25519 sign, drop on verify/decrypt failure), a transport- agnostic BusClient, and a signed ControlPlane HTTP client (fetch room/key/members, open the sealed room key locally). - wstransport.ts: concrete nats.ws WebSocket transport (validated E2E in Phase 3). - index.ts: public SDK surface. Parity pinned by vectors from unibus cmd/busvectors (extended with nkey + signed control-request vectors): 19/19 green. The user's private key signs everything in the browser and is never sent to any server. Bumps uniweb to 0.2.0. Remaining for Phase 1 completion: the live nats.ws connection + control-plane, which need a running unibus with the WebSocket listener — exercised in Phase 3.
37 lines
883 B
JSON
37 lines
883 B
JSON
{
|
|
"name": "unibus-web",
|
|
"private": true,
|
|
"version": "0.1.0",
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "vite",
|
|
"build": "tsc -b && vite build",
|
|
"preview": "vite preview",
|
|
"test": "vitest run"
|
|
},
|
|
"dependencies": {
|
|
"@mantine/core": "^9.3.0",
|
|
"@mantine/hooks": "^9.3.0",
|
|
"@noble/ciphers": "^2.2.0",
|
|
"@noble/curves": "^2.2.0",
|
|
"@noble/hashes": "^2.2.0",
|
|
"@scure/bip39": "^2.2.0",
|
|
"@tabler/icons-react": "^3.36.0",
|
|
"nats.ws": "^1.30.3",
|
|
"react": "^19.2.0",
|
|
"react-dom": "^19.2.0",
|
|
"tweetnacl": "^1.0.3"
|
|
},
|
|
"devDependencies": {
|
|
"@types/react": "^19.2.0",
|
|
"@types/react-dom": "^19.2.0",
|
|
"@vitejs/plugin-react": "^4.3.4",
|
|
"postcss": "^8.4.49",
|
|
"postcss-preset-mantine": "^1.17.0",
|
|
"postcss-simple-vars": "^7.0.1",
|
|
"typescript": "~5.6.3",
|
|
"vite": "^6.0.3",
|
|
"vitest": "^4.1.8"
|
|
}
|
|
}
|