@muhkoo/connect 0.13.2-alpha.0 → 0.14.0-alpha.1
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/browser/index.js +65 -7
- package/dist/browser/index.js.map +1 -1
- package/dist/connect.d.ts +41 -1
- package/dist/server/index.js +65 -7
- package/dist/server/index.js.map +1 -1
- package/package.json +4 -3
package/dist/connect.d.ts
CHANGED
|
@@ -2702,6 +2702,7 @@ declare class HostedAuth {
|
|
|
2702
2702
|
appId: string;
|
|
2703
2703
|
redirectUri: string;
|
|
2704
2704
|
redirect?: boolean;
|
|
2705
|
+
prompt?: "login";
|
|
2705
2706
|
}): Promise<string>;
|
|
2706
2707
|
/**
|
|
2707
2708
|
* (App side) Send the user to centralized account & security management on
|
|
@@ -2946,6 +2947,22 @@ declare function formatUserCode(canonical: string): string;
|
|
|
2946
2947
|
declare class VaultUnavailableError extends Error {
|
|
2947
2948
|
constructor(cause?: unknown);
|
|
2948
2949
|
}
|
|
2950
|
+
/**
|
|
2951
|
+
* A stored device pairing that the account has since revoked.
|
|
2952
|
+
*
|
|
2953
|
+
* Typed rather than a bare Error because the right response is specific and the
|
|
2954
|
+
* wrong one is harmful: the caller must DISCARD its stored key and fall back to
|
|
2955
|
+
* a password. Retrying is futile (the factor is gone from the vault), and
|
|
2956
|
+
* silently re-pairing would undo the revocation that a user performed
|
|
2957
|
+
* deliberately — the whole point of a revocable pairing is that withdrawing it
|
|
2958
|
+
* stays withdrawn.
|
|
2959
|
+
*
|
|
2960
|
+
* Distinct from a wrong key, which fails to decrypt rather than failing to
|
|
2961
|
+
* resolve. A machine whose access was withdrawn should be able to say so.
|
|
2962
|
+
*/
|
|
2963
|
+
declare class DeviceRevokedError extends Error {
|
|
2964
|
+
constructor();
|
|
2965
|
+
}
|
|
2949
2966
|
/** What the auth methods resolve to — the stable, non-secret user facts. */
|
|
2950
2967
|
interface AuthUser {
|
|
2951
2968
|
username: string;
|
|
@@ -3214,6 +3231,29 @@ declare class ZkAuth {
|
|
|
3214
3231
|
* withdrawn should be able to tell you that, not just "decryption failed".
|
|
3215
3232
|
*/
|
|
3216
3233
|
unlockWithDevice(username: string, factorId: string, deviceKey: string): Promise<void>;
|
|
3234
|
+
/**
|
|
3235
|
+
* Sign in using a key stored by {@link enrollDevice} — session AND seed.
|
|
3236
|
+
*
|
|
3237
|
+
* {@link unlockWithDevice} recovers only the encryption identity, which suits
|
|
3238
|
+
* a CLI that already holds a session token on disk. A browser generally does
|
|
3239
|
+
* not: its session expires while the device pairing is still perfectly valid,
|
|
3240
|
+
* and at that point it holds the means to decrypt everything but no way to
|
|
3241
|
+
* make an authenticated call. So this derives the ZK identity from the
|
|
3242
|
+
* recovered seed and proves it, exactly as {@link recoverWithPhrase} does —
|
|
3243
|
+
* the seed has always been sufficient to authenticate, and withholding that
|
|
3244
|
+
* here just meant re-typing a password to prove something already known.
|
|
3245
|
+
*
|
|
3246
|
+
* This is what makes single sign-on possible without any credential at rest:
|
|
3247
|
+
* the seed is never stored, only a key that opens a server-held blob, and
|
|
3248
|
+
* revoking the factor ({@link revokeDevice}) severs it immediately.
|
|
3249
|
+
*
|
|
3250
|
+
* Throws distinguishably on a revoked pairing, so a caller can clear its
|
|
3251
|
+
* stored key and fall back to a password rather than retrying forever.
|
|
3252
|
+
*/
|
|
3253
|
+
loginWithDevice(username: string, factorId: string, deviceKey: string, opts?: LoginOptions): Promise<AuthUser>;
|
|
3254
|
+
/** Fetch and open a `device` factor. Shared by the unlock and login paths so
|
|
3255
|
+
* the two can never disagree about what a revoked pairing looks like. */
|
|
3256
|
+
private openDeviceFactor;
|
|
3217
3257
|
/** Paired machines, newest first. Metadata only — never the ciphertext. */
|
|
3218
3258
|
listDevices(): Promise<Array<{
|
|
3219
3259
|
id: string;
|
|
@@ -7474,5 +7514,5 @@ declare class KeyringClient implements KeyringTransport {
|
|
|
7474
7514
|
fetchMetadata(): Promise<SpaceMetadata | null>;
|
|
7475
7515
|
}
|
|
7476
7516
|
|
|
7477
|
-
export { ACCESS_TOKEN_SCOPES, AES_GCM_IV_BYTES, AES_GCM_KEY_BYTES, AES_GCM_TAG_BYTES, AccessTokensNamespace, AgentsNamespace, AuthClient, AuthNamespace, AuthPublicInput, Authenticator, BlockEngine, BroadcastChannel, BroadcastChannelEvents, ChannelExistsError, ChannelNotFoundError, ChunkCipher, Client, ConnectivityManager, DEFAULT_AUTH_BASE_URL, DEFAULT_BASE_URL, DEFAULT_BRANCH, DEFAULT_FN_HOST_SUFFIX, DEVICE_IDENTITY_STORAGE_KEY, DEVICE_KEY_DB_NAME, DbCache, DevicePairingError, DeviceStoreUnavailableError, DoubleRatchet, DoubleRatchetCipher, DoubleRatchetManager, EncryptedSession, EventCore, EventCoreEvents, Field, Field as FieldElement, FileStorage, FunctionsNamespace, HLC, HashKnowledge, HostedAuth, HttpClient, HttpError, IndexedDbStore, KEEPER_MEMBER_ID, KeyStore, KeyringClient, KvCache, KvNamespace, LocalEngineHost, LocalStorageSessionStore, MemorySessionStore, Message, Message as MessageDefault, MessageNamespace, MuhkooAgent, MuhkooDB, MuhkooFunction, MuhkooSpace, NoopStore, OfflineLockedError, OfflineManager, OutboundQueue, P2P_SUBJECT, PAIRING_CODE_ALPHABET, PAIRING_CODE_LENGTH, PBKDF2_DEFAULT_ITERATIONS, PREIMAGE_POK_VERIFICATION_KEY, Packet, PasskeyOriginError, PeerExchange, PeerNetwork, PersonalSpaceClient, Poseidon, PreimagePoK, ROOT_ID, ReauthRequiredError, ReedSolomonCodec, Repo, Space as Room, SerializeMessage, SessionState, ShardCache, ShardClient, SharedSpaceClient, SnapshotNamespace, Space, SpaceCache, SpaceKeyring, SpaceNamespace, SpacePacketCipher, SpaceSignaler, StorageNamespace, SyncEngine, VFS_ROOT_INFO, VaultUnavailableError, VcsError, VcsNamespace, VfsConflictError, VfsLockedError, VfsNamespace, VfsNotFoundError, WSTransport, WebRtcTransport, WorkerEngineHost, ZERO_HLC, ZkAuth, buildCommitment, canonicalUserCode, clearDeviceIdentity, compareHlc, compilePrograms, configureDeviceStore, createPasskeyWithPrf, decodeFromHex, decorators, decryptAesGcm, defaultCircuitUrls, defaultRpId, defaultSessionStore, deleteBeatsWrite, deleteRegister, deriveAesKeyFromPassphrase, deriveBitsHkdf, deriveIdentity, deriveIdentityFromSeed, deriveMasterSeedFromPassword, deviceFingerprint, deviceIdentityIsEphemeral, deviceIdentityKey, dirKey, ejectAgentPrompt, ejectAgentTools, emptyMap, emptyRegister, encodeToHex, encryptAesGcm, evaluatePasskeyPrf, exportPublicKeyBase64, exportPublicKeyHex, formatUserCode, generateAuthProof, generateDevicePairingKeypair, generatePkce, getMuhkooAppDescriptor, getSubtle, hasDeviceIdentity, headKey, historyKey, initBn128Wasm, initRsWasm, initializeCircuits, isNewer, isOfflineCapable, isP2pCapable, isProvisional, loadDeviceIdentity, manifestToStat, materializeRow, merge3, merge3Text, mergeKey, mergeMap, mergeMessage, mergeRegister, messageKey, objectKey, pack, padHandle, pairingVerificationCode, passkeyPrfCapable, passkeySupported, passkeyUsableFromOrigin, persistDeviceIdentity, poseidonHash, protocol, provisionalHandle, quickVerify, randomBytes, randomState, refKey, refsIndexKey, rpIdUsableForOrigin, sealSeed, sealSeedToDevice, shardHash, signMessage, stableStringify, toField, tombstoneRow, unpack, unsealSeed, unsealSeedFromDevice, unwrapWithPassphrase, verify, verifyGroth16, verifyHashKnowledge, verifyPreimagePoK, wrapWithPassphrase, writeBeatsTombstone, writeColumns, writeRegister };
|
|
7517
|
+
export { ACCESS_TOKEN_SCOPES, AES_GCM_IV_BYTES, AES_GCM_KEY_BYTES, AES_GCM_TAG_BYTES, AccessTokensNamespace, AgentsNamespace, AuthClient, AuthNamespace, AuthPublicInput, Authenticator, BlockEngine, BroadcastChannel, BroadcastChannelEvents, ChannelExistsError, ChannelNotFoundError, ChunkCipher, Client, ConnectivityManager, DEFAULT_AUTH_BASE_URL, DEFAULT_BASE_URL, DEFAULT_BRANCH, DEFAULT_FN_HOST_SUFFIX, DEVICE_IDENTITY_STORAGE_KEY, DEVICE_KEY_DB_NAME, DbCache, DevicePairingError, DeviceRevokedError, DeviceStoreUnavailableError, DoubleRatchet, DoubleRatchetCipher, DoubleRatchetManager, EncryptedSession, EventCore, EventCoreEvents, Field, Field as FieldElement, FileStorage, FunctionsNamespace, HLC, HashKnowledge, HostedAuth, HttpClient, HttpError, IndexedDbStore, KEEPER_MEMBER_ID, KeyStore, KeyringClient, KvCache, KvNamespace, LocalEngineHost, LocalStorageSessionStore, MemorySessionStore, Message, Message as MessageDefault, MessageNamespace, MuhkooAgent, MuhkooDB, MuhkooFunction, MuhkooSpace, NoopStore, OfflineLockedError, OfflineManager, OutboundQueue, P2P_SUBJECT, PAIRING_CODE_ALPHABET, PAIRING_CODE_LENGTH, PBKDF2_DEFAULT_ITERATIONS, PREIMAGE_POK_VERIFICATION_KEY, Packet, PasskeyOriginError, PeerExchange, PeerNetwork, PersonalSpaceClient, Poseidon, PreimagePoK, ROOT_ID, ReauthRequiredError, ReedSolomonCodec, Repo, Space as Room, SerializeMessage, SessionState, ShardCache, ShardClient, SharedSpaceClient, SnapshotNamespace, Space, SpaceCache, SpaceKeyring, SpaceNamespace, SpacePacketCipher, SpaceSignaler, StorageNamespace, SyncEngine, VFS_ROOT_INFO, VaultUnavailableError, VcsError, VcsNamespace, VfsConflictError, VfsLockedError, VfsNamespace, VfsNotFoundError, WSTransport, WebRtcTransport, WorkerEngineHost, ZERO_HLC, ZkAuth, buildCommitment, canonicalUserCode, clearDeviceIdentity, compareHlc, compilePrograms, configureDeviceStore, createPasskeyWithPrf, decodeFromHex, decorators, decryptAesGcm, defaultCircuitUrls, defaultRpId, defaultSessionStore, deleteBeatsWrite, deleteRegister, deriveAesKeyFromPassphrase, deriveBitsHkdf, deriveIdentity, deriveIdentityFromSeed, deriveMasterSeedFromPassword, deviceFingerprint, deviceIdentityIsEphemeral, deviceIdentityKey, dirKey, ejectAgentPrompt, ejectAgentTools, emptyMap, emptyRegister, encodeToHex, encryptAesGcm, evaluatePasskeyPrf, exportPublicKeyBase64, exportPublicKeyHex, formatUserCode, generateAuthProof, generateDevicePairingKeypair, generatePkce, getMuhkooAppDescriptor, getSubtle, hasDeviceIdentity, headKey, historyKey, initBn128Wasm, initRsWasm, initializeCircuits, isNewer, isOfflineCapable, isP2pCapable, isProvisional, loadDeviceIdentity, manifestToStat, materializeRow, merge3, merge3Text, mergeKey, mergeMap, mergeMessage, mergeRegister, messageKey, objectKey, pack, padHandle, pairingVerificationCode, passkeyPrfCapable, passkeySupported, passkeyUsableFromOrigin, persistDeviceIdentity, poseidonHash, protocol, provisionalHandle, quickVerify, randomBytes, randomState, refKey, refsIndexKey, rpIdUsableForOrigin, sealSeed, sealSeedToDevice, shardHash, signMessage, stableStringify, toField, tombstoneRow, unpack, unsealSeed, unsealSeedFromDevice, unwrapWithPassphrase, verify, verifyGroth16, verifyHashKnowledge, verifyPreimagePoK, wrapWithPassphrase, writeBeatsTombstone, writeColumns, writeRegister };
|
|
7478
7518
|
export type { ACL, ACLEntry, AccessTokenInfo, AccessTokensNamespaceDeps, AgentConfig, AgentCreateInput, AgentDbToolMode, AgentProvisioned, AgentScopeOpts, AgentSkill, AgentToolsConfig, AgentTrigger, AgentTriggerType, AgentUpdateInput, AgentsNamespaceDeps, AttachedPeerNetwork, AuthClientOptions, AuthKeyPair, AuthSuccess, AuthToken, AuthType, AuthUser, BlockStore, Bn128WasmInstance, BroadcastChannelEvent, BroadcastChannelOptions, CachedSpaceMessage, Change, ChannelLike, ChunkKeyMaterial, ChunkManifest, CipherFrame, CipherMessage, CipherMessageHeader, CircuitBufferConfig, CircuitUrls, ClientOptions, Commit, Conflict, ConnectivityOptions, ConnectivityState, CreateAccessTokenInput, CreatedAccessToken, DbQueryPage, DehydratedKeypair, DehydratedKeys, DeviceBlobStore, DeviceKeyVault, DevicePairingErrorReason, DevicePairingKeypair, DevicePairingPoll, DevicePairingRequest, DevicePairingSession, DirEntry, DirNode, DoubleRatchetCipherDeps, ECDHCurve, EncodeResult, EngineHandle, EngineHost, Entry, EphemeralEvent, EpochKeyProvider, FileEntry, FileManifest, FileNamespaceDeps, FileStat, FileStorageOptions, FunctionCaps, FunctionConfig, FunctionDeployInput, FunctionInvokeOptions, FunctionScopeOpts, FunctionTrigger, FunctionTriggerType, FunctionTriggers, FunctionUpdateInput, FunctionsNamespaceDeps, Groth16Proof, Hasher, Head, HistoryRecord, HlcParts, HlcState, HostedAuthDeps, HttpClientOptions, IncomingFrame, KeyExchangeFrame, KeyPair, Keypair, KeyringClientDeps, KeyringTransport, KvEntry, KvNamespaceDeps, LogEntry, LoginOptions, LwwMap, LwwRegister, Merge3Result, MergeRegionConflict, MergeResult, MessageBody, MessageDeletedEvent, MessageEntry, MessageEvent, MessageHeaders, MessageNamespaceDeps, MessageOp, MessageOptions, MessageSubscription, MuhkooAgentMeta, MuhkooAgentToolsConfig, MuhkooAppDescriptor, MuhkooDBAccess, MuhkooDBMeta, MuhkooFunctionMeta, MuhkooKeystoreBridge, MuhkooMessageEvent, MuhkooSpaceMeta, OAuthProvider, OfflineEntry, OfflineManagerDeps, OfflineStore, OutSink, PacketCipher, PacketHeaders, PacketOptions, PairedDevice, Participant, PasskeyEnrollment, PeerBlockSource, PeerExchangeOptions, PeerId, PeerNetworkOptions, PeerTransport, Permission, PermissionCheckRequest, PermissionCheckResult, PersistedDeviceIdentity, PersonalSpaceClientOptions, Pkce, PublicKeyJWK, QueueEntry, RatchetState, ReceiveResult, RegisterParams, Replayer, Role, SpaceDeps as RoomDeps, SpaceFileMetadata as RoomFileMetadata, Scope, SealedHandoff, SealedHeaders, SealedRecord, Session, SessionOptions, SessionStore, SetOptions, ShardByteCache, ShardClientOptions, SharedSpaceClientOptions, SignalEnvelope, SignalKind, SignalingSpace, SnapshotNamespaceDeps, SnarkProof, SpaceChannelLike, SpaceCursor, SpaceDeps, SpaceFileMetadata, SpaceKeyCache, SpaceKeyringDeps, SpaceMessageEvent, SpaceNamespaceDeps, SpaceOfflineAdapter, StartDevicePairingOptions, StorageChangeEvent, StoreName, StoredSession, Subscription, Tree, TreeDir, TreeEntry, TreeFile, UserIdentity, VaultFactor, VcsNamespaceDeps, VcsNamespaceOptions, VerificationKey, VfsContentStore, VfsNamespaceDeps, VfsStat, VfsStore, WSMessage, WSMessageType, WSTransportOptions, WaitForDevicePairingOptions, WebRtcTransportOptions, WrappedPayload, WriteFileInput, WriteFileOptions, WriteToShardsInput, ZkAuthDeps, ZkAuthenticateRequest, ZkChallengeResponse, ZkCompiled, ZkIdentity, ZkRegisterRequest, ZkRegisterResponse };
|
package/dist/server/index.js
CHANGED
|
@@ -3235,7 +3235,7 @@ function base64UrlDecode(s) {
|
|
|
3235
3235
|
* expect (and isn't serving a stale cached bundle). Keep this in sync with
|
|
3236
3236
|
* `package.json` `version`.
|
|
3237
3237
|
*/
|
|
3238
|
-
const VERSION = "0.
|
|
3238
|
+
const VERSION = "0.14.0-alpha.1";
|
|
3239
3239
|
|
|
3240
3240
|
/**
|
|
3241
3241
|
* `HttpClient` — the one place the unified {@link Client} talks to the
|
|
@@ -4364,13 +4364,21 @@ class HostedAuth {
|
|
|
4364
4364
|
const { codeVerifier, codeChallenge } = await generatePkce();
|
|
4365
4365
|
const state = randomState();
|
|
4366
4366
|
this.store({ codeVerifier, state, appId: opts.appId, redirectUri: opts.redirectUri });
|
|
4367
|
-
const
|
|
4367
|
+
const params = {
|
|
4368
4368
|
app_id: opts.appId,
|
|
4369
4369
|
redirect_uri: opts.redirectUri,
|
|
4370
4370
|
state,
|
|
4371
4371
|
code_challenge: codeChallenge,
|
|
4372
4372
|
code_challenge_method: "S256",
|
|
4373
|
-
}
|
|
4373
|
+
};
|
|
4374
|
+
// `prompt=login` forces the credential screen even when the browser is
|
|
4375
|
+
// remembered. Without it, an app's own "sign out" would be undone on the
|
|
4376
|
+
// very next sign-in click: single sign-on means the hosted page still
|
|
4377
|
+
// knows you, so the app must be able to say "ask anyway". Named after the
|
|
4378
|
+
// OIDC parameter that solves the same problem.
|
|
4379
|
+
if (opts.prompt)
|
|
4380
|
+
params.prompt = opts.prompt;
|
|
4381
|
+
const url = `${this.deps.authBaseUrl}/authorize?` + new URLSearchParams(params).toString();
|
|
4374
4382
|
if (opts.redirect !== false)
|
|
4375
4383
|
this.location().assign(url);
|
|
4376
4384
|
return url;
|
|
@@ -5168,6 +5176,25 @@ class VaultUnavailableError extends Error {
|
|
|
5168
5176
|
this.cause = cause;
|
|
5169
5177
|
}
|
|
5170
5178
|
}
|
|
5179
|
+
/**
|
|
5180
|
+
* A stored device pairing that the account has since revoked.
|
|
5181
|
+
*
|
|
5182
|
+
* Typed rather than a bare Error because the right response is specific and the
|
|
5183
|
+
* wrong one is harmful: the caller must DISCARD its stored key and fall back to
|
|
5184
|
+
* a password. Retrying is futile (the factor is gone from the vault), and
|
|
5185
|
+
* silently re-pairing would undo the revocation that a user performed
|
|
5186
|
+
* deliberately — the whole point of a revocable pairing is that withdrawing it
|
|
5187
|
+
* stays withdrawn.
|
|
5188
|
+
*
|
|
5189
|
+
* Distinct from a wrong key, which fails to decrypt rather than failing to
|
|
5190
|
+
* resolve. A machine whose access was withdrawn should be able to say so.
|
|
5191
|
+
*/
|
|
5192
|
+
class DeviceRevokedError extends Error {
|
|
5193
|
+
constructor() {
|
|
5194
|
+
super("This device is no longer paired — its access was revoked. Sign in again to re-pair.");
|
|
5195
|
+
this.name = "DeviceRevokedError";
|
|
5196
|
+
}
|
|
5197
|
+
}
|
|
5171
5198
|
/**
|
|
5172
5199
|
* ZK identity auth. One instance per {@link Client}; reads/writes the shared
|
|
5173
5200
|
* {@link SessionState}.
|
|
@@ -5778,15 +5805,46 @@ class ZkAuth {
|
|
|
5778
5805
|
* withdrawn should be able to tell you that, not just "decryption failed".
|
|
5779
5806
|
*/
|
|
5780
5807
|
async unlockWithDevice(username, factorId, deviceKey) {
|
|
5808
|
+
const seed = await this.openDeviceFactor(username, factorId, deviceKey);
|
|
5809
|
+
this.deps.session.setSeed(seed);
|
|
5810
|
+
}
|
|
5811
|
+
/**
|
|
5812
|
+
* Sign in using a key stored by {@link enrollDevice} — session AND seed.
|
|
5813
|
+
*
|
|
5814
|
+
* {@link unlockWithDevice} recovers only the encryption identity, which suits
|
|
5815
|
+
* a CLI that already holds a session token on disk. A browser generally does
|
|
5816
|
+
* not: its session expires while the device pairing is still perfectly valid,
|
|
5817
|
+
* and at that point it holds the means to decrypt everything but no way to
|
|
5818
|
+
* make an authenticated call. So this derives the ZK identity from the
|
|
5819
|
+
* recovered seed and proves it, exactly as {@link recoverWithPhrase} does —
|
|
5820
|
+
* the seed has always been sufficient to authenticate, and withholding that
|
|
5821
|
+
* here just meant re-typing a password to prove something already known.
|
|
5822
|
+
*
|
|
5823
|
+
* This is what makes single sign-on possible without any credential at rest:
|
|
5824
|
+
* the seed is never stored, only a key that opens a server-held blob, and
|
|
5825
|
+
* revoking the factor ({@link revokeDevice}) severs it immediately.
|
|
5826
|
+
*
|
|
5827
|
+
* Throws distinguishably on a revoked pairing, so a caller can clear its
|
|
5828
|
+
* stored key and fall back to a password rather than retrying forever.
|
|
5829
|
+
*/
|
|
5830
|
+
async loginWithDevice(username, factorId, deviceKey, opts = {}) {
|
|
5831
|
+
const seed = await this.openDeviceFactor(username, factorId, deviceKey);
|
|
5832
|
+
const identity = await deriveIdentityFromSeed(seed);
|
|
5833
|
+
const user = await this.proveAndStore(username, identity, opts);
|
|
5834
|
+
this.deps.session.setSeed(seed);
|
|
5835
|
+
return user;
|
|
5836
|
+
}
|
|
5837
|
+
/** Fetch and open a `device` factor. Shared by the unlock and login paths so
|
|
5838
|
+
* the two can never disagree about what a revoked pairing looks like. */
|
|
5839
|
+
async openDeviceFactor(username, factorId, deviceKey) {
|
|
5781
5840
|
const { factor } = await this.deps.auth.vaultRead(username, "device", undefined, undefined, factorId);
|
|
5782
5841
|
if (!factor) {
|
|
5783
|
-
throw new
|
|
5842
|
+
throw new DeviceRevokedError();
|
|
5784
5843
|
}
|
|
5785
5844
|
if (!factor.wrap || !factor.iv)
|
|
5786
5845
|
throw new Error("The stored device factor is incomplete; re-pair this device.");
|
|
5787
5846
|
const key = await wrapKeyFromBytes(fromBase64$1(deviceKey), DEVICE_WRAP_INFO);
|
|
5788
|
-
|
|
5789
|
-
this.deps.session.setSeed(seed);
|
|
5847
|
+
return unwrapSeed({ iv: factor.iv, ct: factor.wrap }, key);
|
|
5790
5848
|
}
|
|
5791
5849
|
/** Paired machines, newest first. Metadata only — never the ciphertext. */
|
|
5792
5850
|
async listDevices() {
|
|
@@ -15855,5 +15913,5 @@ var bundledLoader = /*#__PURE__*/Object.freeze({
|
|
|
15855
15913
|
default: loadRsWasm
|
|
15856
15914
|
});
|
|
15857
15915
|
|
|
15858
|
-
export { ACCESS_TOKEN_SCOPES, AES_GCM_IV_BYTES$1 as AES_GCM_IV_BYTES, AES_GCM_KEY_BYTES, AES_GCM_TAG_BYTES, AccessTokensNamespace, AgentsNamespace, AuthClient, AuthNamespace, AuthPublicInput, Authenticator, BlockEngine, BroadcastChannel, BroadcastChannelEvents, ChannelExistsError, ChannelNotFoundError, ChunkCipher, Client, ConnectivityManager, DEFAULT_BASE_URL, DEFAULT_BRANCH, DEFAULT_FN_HOST_SUFFIX, DEVICE_IDENTITY_STORAGE_KEY, DEVICE_KEY_DB_NAME, DbCache, DbNamespace, DbTable, DevicePairingError, DeviceStoreUnavailableError, DoubleRatchet, DoubleRatchetCipher, DoubleRatchetManager, EncryptedSession, EventCore, EventCoreEvents, Field, Field as FieldElement, FileStorage, FunctionsNamespace, HLC, HashKnowledge, HostedAuth, HttpClient, HttpError, IndexedDbStore, KEEPER_MEMBER_ID, KeyStore, KeyringClient, KvCache, KvNamespace, LocalEngineHost, LocalStorageSessionStore, Logger, MemorySessionStore, Message, Message as MessageDefault, MessageNamespace, MuhkooAgent, MuhkooDB, MuhkooFunction, MuhkooSpace, NoopStore, OfflineLockedError, OfflineManager, OutboundQueue, P2P_SUBJECT, PAIRING_CODE_ALPHABET, PAIRING_CODE_LENGTH, PBKDF2_DEFAULT_ITERATIONS, PREIMAGE_POK_VERIFICATION_KEY, Packet, PasskeyOriginError, PeerExchange, PeerNetwork, PersonalSpaceClient, Poseidon, PreimagePoK, Ready, ReauthRequiredError, ReedSolomonCodec, Repo, Retry, Space as Room, SerializeMessage, SessionState, ShardCache, ShardClient, SharedSpaceClient, SnapshotNamespace, Space, SpaceCache, SpaceKeyring, SpaceNamespace, SpacePacketCipher, SpaceSignaler, StorageNamespace, SyncEngine, VERSION, VaultUnavailableError, VcsError, VcsNamespace, VfsLockedError, VfsNamespace, WSTransport, WebRtcTransport, WorkerEngineHost, ZERO_HLC, ZkAuth, _accountId, _formatBytes, _messageId, _objectId, _packetId, _socketId, _userId, appLogger$1 as appLogger, assertType, base58Decode, base58Encode, buildCommitment, canonicalUserCode, clearDeviceIdentity, compareHlc, compilePrograms, concatBytes, configureDeviceStore, decodeFromHex, decorators, decryptAesGcm, defaultCircuitUrls, defaultSessionStore, deleteBeatsWrite, deleteRegister, deriveAesKeyFromPassphrase, deriveBitsHkdf, deriveIdentity, deriveIdentityFromSeed, deriveMasterSeedFromPassword, deserialize, deviceFingerprint, deviceIdentityIsEphemeral, deviceIdentityKey, ejectAgentPrompt, ejectAgentTools, emptyMap, emptyRegister, encodeToHex, encryptAesGcm, exportPublicKeyBase64, exportPublicKeyHex, formatUserCode, fromBase64$2 as fromBase64, fromBase64Url, fromHex, generateAuthProof, generateChecksum, generateDevicePairingKeypair, generateId, generatePkce, getIPAddress, getId, getMuhkooAppDescriptor, getSubtle, hasDeviceIdentity, initBn128Wasm, initRsWasm, initializeCircuits, isNewer, isNumber, isOfflineCapable, isP2pCapable, isProvisional, loadDeviceIdentity, log, manifestToStat, materializeRow, merge3, merge3Text, mergeMap, mergeMessage, mergeRegister, messageKey, pack, padHandle, pairingVerificationCode, passkeyUsableFromOrigin, persistDeviceIdentity, poseidonHash, protocol, provisionalHandle, quickVerify, randomBytes, randomState, rpIdUsableForOrigin, sealSeed, sealSeedToDevice, serialize, shardHash, signMessage, stableStringify, toBase64$2 as toBase64, toBase64Url, toField, toHex, tombstoneRow, unpack, unsealSeed, unsealSeedFromDevice, unwrapWithPassphrase, utf8Decode, utf8Encode, verify, verifyChecksum, verifyGroth16, verifyHashKnowledge, verifyPreimagePoK, wrapWithPassphrase, writeBeatsTombstone, writeColumns, writeRegister };
|
|
15916
|
+
export { ACCESS_TOKEN_SCOPES, AES_GCM_IV_BYTES$1 as AES_GCM_IV_BYTES, AES_GCM_KEY_BYTES, AES_GCM_TAG_BYTES, AccessTokensNamespace, AgentsNamespace, AuthClient, AuthNamespace, AuthPublicInput, Authenticator, BlockEngine, BroadcastChannel, BroadcastChannelEvents, ChannelExistsError, ChannelNotFoundError, ChunkCipher, Client, ConnectivityManager, DEFAULT_BASE_URL, DEFAULT_BRANCH, DEFAULT_FN_HOST_SUFFIX, DEVICE_IDENTITY_STORAGE_KEY, DEVICE_KEY_DB_NAME, DbCache, DbNamespace, DbTable, DevicePairingError, DeviceRevokedError, DeviceStoreUnavailableError, DoubleRatchet, DoubleRatchetCipher, DoubleRatchetManager, EncryptedSession, EventCore, EventCoreEvents, Field, Field as FieldElement, FileStorage, FunctionsNamespace, HLC, HashKnowledge, HostedAuth, HttpClient, HttpError, IndexedDbStore, KEEPER_MEMBER_ID, KeyStore, KeyringClient, KvCache, KvNamespace, LocalEngineHost, LocalStorageSessionStore, Logger, MemorySessionStore, Message, Message as MessageDefault, MessageNamespace, MuhkooAgent, MuhkooDB, MuhkooFunction, MuhkooSpace, NoopStore, OfflineLockedError, OfflineManager, OutboundQueue, P2P_SUBJECT, PAIRING_CODE_ALPHABET, PAIRING_CODE_LENGTH, PBKDF2_DEFAULT_ITERATIONS, PREIMAGE_POK_VERIFICATION_KEY, Packet, PasskeyOriginError, PeerExchange, PeerNetwork, PersonalSpaceClient, Poseidon, PreimagePoK, Ready, ReauthRequiredError, ReedSolomonCodec, Repo, Retry, Space as Room, SerializeMessage, SessionState, ShardCache, ShardClient, SharedSpaceClient, SnapshotNamespace, Space, SpaceCache, SpaceKeyring, SpaceNamespace, SpacePacketCipher, SpaceSignaler, StorageNamespace, SyncEngine, VERSION, VaultUnavailableError, VcsError, VcsNamespace, VfsLockedError, VfsNamespace, WSTransport, WebRtcTransport, WorkerEngineHost, ZERO_HLC, ZkAuth, _accountId, _formatBytes, _messageId, _objectId, _packetId, _socketId, _userId, appLogger$1 as appLogger, assertType, base58Decode, base58Encode, buildCommitment, canonicalUserCode, clearDeviceIdentity, compareHlc, compilePrograms, concatBytes, configureDeviceStore, decodeFromHex, decorators, decryptAesGcm, defaultCircuitUrls, defaultSessionStore, deleteBeatsWrite, deleteRegister, deriveAesKeyFromPassphrase, deriveBitsHkdf, deriveIdentity, deriveIdentityFromSeed, deriveMasterSeedFromPassword, deserialize, deviceFingerprint, deviceIdentityIsEphemeral, deviceIdentityKey, ejectAgentPrompt, ejectAgentTools, emptyMap, emptyRegister, encodeToHex, encryptAesGcm, exportPublicKeyBase64, exportPublicKeyHex, formatUserCode, fromBase64$2 as fromBase64, fromBase64Url, fromHex, generateAuthProof, generateChecksum, generateDevicePairingKeypair, generateId, generatePkce, getIPAddress, getId, getMuhkooAppDescriptor, getSubtle, hasDeviceIdentity, initBn128Wasm, initRsWasm, initializeCircuits, isNewer, isNumber, isOfflineCapable, isP2pCapable, isProvisional, loadDeviceIdentity, log, manifestToStat, materializeRow, merge3, merge3Text, mergeMap, mergeMessage, mergeRegister, messageKey, pack, padHandle, pairingVerificationCode, passkeyUsableFromOrigin, persistDeviceIdentity, poseidonHash, protocol, provisionalHandle, quickVerify, randomBytes, randomState, rpIdUsableForOrigin, sealSeed, sealSeedToDevice, serialize, shardHash, signMessage, stableStringify, toBase64$2 as toBase64, toBase64Url, toField, toHex, tombstoneRow, unpack, unsealSeed, unsealSeedFromDevice, unwrapWithPassphrase, utf8Decode, utf8Encode, verify, verifyChecksum, verifyGroth16, verifyHashKnowledge, verifyPreimagePoK, wrapWithPassphrase, writeBeatsTombstone, writeColumns, writeRegister };
|
|
15859
15917
|
//# sourceMappingURL=index.js.map
|