@glyphteck/veyl 0.63.7 → 0.64.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/dist/account.js +3641 -308
- package/dist/accountprofiles.js +1362 -0
- package/dist/auth.js +26 -10
- package/dist/cli.js +4704 -773
- package/dist/index.js +4693 -768
- package/docs/api.md +9 -6
- package/docs/cli.md +1 -1
- package/package.json +3 -2
package/docs/api.md
CHANGED
|
@@ -54,7 +54,7 @@ const unsubscribeAuth = auth.subscribe((user) => console.log(user));
|
|
|
54
54
|
const unsubscribeLinks = auth.links.watch(user.uid, renderLinks, showError);
|
|
55
55
|
const link = await auth.links.create();
|
|
56
56
|
await auth.links.add({ token, label });
|
|
57
|
-
await auth.
|
|
57
|
+
await auth.activateToken(sessionToken);
|
|
58
58
|
|
|
59
59
|
const inventory = await auth.passkeys.list(user.uid, {
|
|
60
60
|
currentPasskeyId,
|
|
@@ -66,7 +66,11 @@ unsubscribeAuth();
|
|
|
66
66
|
await auth.logout();
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
-
`openAuth()` owns the shared register, login, token, one-use link, passkey inventory, verified deletion, session observation, and sign-out choreography.
|
|
69
|
+
`openAuth()` owns the shared register, login, token, one-use link, passkey inventory, verified deletion, session observation, and sign-out choreography. `activateToken()` is the generic in-memory account-session activation boundary for a custom token returned by a token-only login, registration, or passkey-link flow; it is not nested under passkey links because those flows share the same isolated auth-slot operation. Never persist that token. The `cloud` input is a transport rather than a Firebase dependency. A platform supplies only the local credential ceremony: browser WebAuthn on web, `react-native-passkeys` on iOS, or a browser-assisted port in the Node runtime. Browser adapters must decode the server's binary options before the ceremony and return a JSON-safe credential afterward, as the placeholder helpers above indicate. Errors are normalized at this boundary so every client receives the same recoverable registration and login outcomes. The platform still owns when to prompt, how to present the prompt, navigation, local credential storage, and UI feedback.
|
|
70
|
+
|
|
71
|
+
## Account profiles
|
|
72
|
+
|
|
73
|
+
`@glyphteck/veyl/account-profiles` owns one environment-scoped public remembered-account registry and exactly one active runtime. Platform storage supplies atomic `read`, synchronous-reducer `update`, and payload-free `subscribe` ports; `resolveAuthenticatedProfile` is the platform authority that maps those public rows to matching live isolated auth sessions. A remembered row alone is never authenticated. A client reserves a random profile id before authentication, exchanges the memory-only custom token inside that named auth slot, and commits the authenticated Firebase user's uid through `reservation.activate(fields, activation)`. If the uid already owns a durable profile id, the client adopts that authenticated session into the canonical named slot before discarding the provisional slot; neither the token nor the Firebase user enters registry storage. The owner awaits the previous runtime's `lock()` and `close()` before opening the selected profile. Every successful selection advances `lastUsedAt`; the owner exposes that descending recency order for UI and the resolver uses it for live-auth fallback. `switchTo(profileId)` independently verifies the requested profile through the resolver before invalidating the current runtime. `signOut()` retains the public row as an exact-account login shortcut; `remove(profileId)` forgets it. Both resume the most recently selected remaining live authenticated profile when available, while `resumeAuthenticated()` handles platform auth loss explicitly. External storage signals trigger an authoritative reread, and an externally removed active row closes locally without repeating the originating platform cleanup. The client exposes Login only when the resolver finds no live authenticated profile.
|
|
70
74
|
|
|
71
75
|
## Graphical account owner
|
|
72
76
|
|
|
@@ -131,7 +135,6 @@ await account.support.report(targetUid, { note: 'context' });
|
|
|
131
135
|
await account.user.getSnapshot().updateSettings({ moneyFormat: 'btc' });
|
|
132
136
|
await account.push.add(preparedPushLease);
|
|
133
137
|
await account.push.drop({ did: preparedPushLease.did });
|
|
134
|
-
await account.verifyPassword(password);
|
|
135
138
|
|
|
136
139
|
const unsubscribePeers = account.peers.subscribe(() => {
|
|
137
140
|
console.log(account.peers.getSnapshot());
|
|
@@ -146,7 +149,7 @@ unsubscribeWallet();
|
|
|
146
149
|
unsubscribeChat();
|
|
147
150
|
account.lock();
|
|
148
151
|
unsubscribe();
|
|
149
|
-
account.close();
|
|
152
|
+
await account.close();
|
|
150
153
|
```
|
|
151
154
|
|
|
152
155
|
`openAccount()` owns authenticated user observation, username and avatar publication, vault observation and creation, vault unlock/lock, encrypted settings/network selection, presence, late wallet readiness, public Bitcoin data, support/report commands, chat and peer/profile composition, account switching, and secret-bearing session teardown. Focused-chat presence is separately owned by the chat session's encrypted ephemeral live transport. The account snapshot exposes `user`, `vault`, `vaultReady`, `vaultError`, `session`, `wallet`, `walletError`, `network`, and `lockState`; stable domain owners such as `bitcoin` and `support` live directly on the returned account owner.
|
|
@@ -159,7 +162,7 @@ account.close();
|
|
|
159
162
|
|
|
160
163
|
`account.wallet` is the stable account-scoped wallet composition used by Node, web, and iOS. It owns the one live `core/wallet/session.js` engine, its transfer store, cached pre-Spark display state, transaction aggregation, wallet-derived peer recency, late Spark attachment, and lock teardown. `getSnapshot()` preserves the shared `{ value, txValue }` contract; `transactions` exposes aggregate/search/chart data and `transfers` exposes focused list and keyed subscriptions. Graphical wallet providers only adapt those SDK subscriptions and add browser/native behavior through the `wallet` platform ports.
|
|
161
164
|
|
|
162
|
-
Encrypted settings remain commands on `account.user`, so graphical clients and the high-level Node runtime mutate the same normalized owner instead of creating another settings facade. `account.push` owns only authenticated server lease add/drop; APNs permission, token, environment, badge, presentation, and tap behavior remain iOS ports. `
|
|
165
|
+
Encrypted settings remain commands on `account.user`, so graphical clients and the high-level Node runtime mutate the same normalized owner instead of creating another settings facade. `account.push` owns only authenticated server lease add/drop; APNs permission, token, environment, badge, presentation, and tap behavior remain iOS ports. `delete({ confirm: true, password })` verifies the currently observed vault inside the same account- and session-bound operation that drains decryptable inbox/chat membership, marks every discovered chat deleted, commits server account deletion, clears the unlocked encrypted cache, clears local avatar state, and locks. A verification, discovery, chat-marking, or server failure leaves the unlocked account and cache available for retry; platform credential, remembered-account, push-token, and final auth cleanup runs only after that shared command commits.
|
|
163
166
|
|
|
164
167
|
Platform code still owns the WebAuthn/native passkey ceremony itself, Face ID and secure storage, foreground/background and browser events, navigation, toasts, and UI; the surrounding auth state machine belongs to `openAuth()`. `unlock(password, options)` accepts platform lifecycle callbacks such as `onSeedDecrypted`, `onSettingsUnlocked`, and `onSessionReady` without importing those platforms. Wallet startup remains asynchronous: chat keys, vault proof, and the encrypted cache may make the account usable before `walletReady` settles.
|
|
165
168
|
|
|
@@ -214,7 +217,7 @@ await veyl.account.delete({ confirm: true });
|
|
|
214
217
|
- `acceptTerms()` records the current agreement through the shared user owner without forcing a vault unlock.
|
|
215
218
|
- `logout` signs out and tears down only this runtime.
|
|
216
219
|
- `logoutAll` revokes every product session generation, tears down this runtime locally, and stops a persistent CLI owner after its in-flight work drains.
|
|
217
|
-
- `delete({ confirm: true })` drains decryptable inbox state, marks all discoverable chats deleted, destroys the complete account/network encrypted cache scope, proves vault possession, deletes identifiable account data, removes the local profile, and stops a persistent CLI owner after its in-flight work drains.
|
|
220
|
+
- `delete({ confirm: true, key? })` drains decryptable inbox state, marks all discoverable chats deleted, destroys the complete account/network encrypted cache scope, proves vault possession inside the same destructive operation, deletes identifiable account data, removes the local profile, and stops a persistent CLI owner after its in-flight work drains. `key` is required only when the runtime has no saved vault key.
|
|
218
221
|
|
|
219
222
|
Account summaries report identity, network, local credential/vault availability, public wallet/chat keys, auth kind, an explicit managed-bot marker when assigned by Glyphteck's owner namespace, and current signed-in/unlocked state. Account and vault keys are never included in summaries.
|
|
220
223
|
|
package/docs/cli.md
CHANGED
|
@@ -24,7 +24,7 @@ veyl account terms
|
|
|
24
24
|
veyl account accept-terms
|
|
25
25
|
veyl account logout
|
|
26
26
|
veyl account logout-all
|
|
27
|
-
veyl account delete --confirm
|
|
27
|
+
veyl account delete --confirm [--key VALUE]
|
|
28
28
|
|
|
29
29
|
veyl vault create [--key VALUE] [--no-save-key]
|
|
30
30
|
veyl vault unlock [--key VALUE] [--no-save-key]
|
package/package.json
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"exports": {
|
|
12
12
|
".": "./dist/index.js",
|
|
13
13
|
"./account": "./dist/account.js",
|
|
14
|
+
"./account-profiles": "./dist/accountprofiles.js",
|
|
14
15
|
"./auth": "./dist/auth.js"
|
|
15
16
|
},
|
|
16
17
|
"bin": {
|
|
@@ -36,10 +37,10 @@
|
|
|
36
37
|
"access": "public"
|
|
37
38
|
},
|
|
38
39
|
"scripts": {
|
|
39
|
-
"build": "bun build src/index.js src/cli.js src/runtime/kdf-worker-thread.js --target=node --outdir dist --entry-naming '[name].[ext]' && bun build src/account.js src/auth.js --target=browser --outdir dist",
|
|
40
|
+
"build": "bun build src/index.js src/cli.js src/runtime/kdf-worker-thread.js --target=node --outdir dist --entry-naming '[name].[ext]' && bun build src/account.js src/accountprofiles.js src/auth.js --target=browser --outdir dist",
|
|
40
41
|
"prepack": "bun run build",
|
|
41
42
|
"start": "node src/cli.js",
|
|
42
43
|
"lint": "eslint src --quiet"
|
|
43
44
|
},
|
|
44
|
-
"version": "0.
|
|
45
|
+
"version": "0.64.0"
|
|
45
46
|
}
|