@interncom/diplomatic 0.12.3 → 0.12.6
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/cli/index.mjs +2 -2
- package/dist/cli/shared/crypto/enclave.d.ts +5 -1
- package/dist/cli/shared/worker/spawn.d.ts +2 -0
- package/dist/web/index.mjs +1 -1
- package/dist/web/passkey/prf-store.d.ts +4 -1
- package/dist/web/shared/crypto/enclave.d.ts +5 -1
- package/dist/web/shared/worker/spawn.d.ts +2 -0
- package/dist/web/stores/idb/seed.d.ts +2 -0
- package/dist/web/types.d.ts +1 -0
- package/dist/web/worker/client.d.ts +4 -4
- package/dist/web/worker/protocol.d.ts +5 -7
- package/dist/web/worker.mjs +1 -1
- package/package.json +1 -1
|
@@ -9,7 +9,10 @@ export type PrfSeedMeta = {
|
|
|
9
9
|
sealedMaster: SealedMasterKey;
|
|
10
10
|
/** PRF salt used at wrap time. */
|
|
11
11
|
salt: Uint8Array;
|
|
12
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Last PRF passkey id (allowCredentials). The sealed-meta row itself is
|
|
14
|
+
* the breadcrumb that this device enrolled PRF unlock.
|
|
15
|
+
*/
|
|
13
16
|
credId?: Uint8Array;
|
|
14
17
|
};
|
|
15
18
|
/**
|
|
@@ -71,10 +71,14 @@ export declare class Enclave {
|
|
|
71
71
|
/**
|
|
72
72
|
* UV + PRF ceremony, then unseal durable master into a new Enclave.
|
|
73
73
|
* Callers never supply PRF bytes — only sealed meta + RP/salt/credId.
|
|
74
|
+
* Returns the credential id used so stores can persist it (skip picker next time).
|
|
74
75
|
*/
|
|
75
76
|
static unsealWithPasskey(crypto: ICrypto, sealedMaster: SealedMasterKey, opts: PasskeyPrfOpts & {
|
|
76
77
|
salt: Uint8Array;
|
|
77
|
-
}): Promise<ValStat<
|
|
78
|
+
}): Promise<ValStat<{
|
|
79
|
+
enclave: Enclave;
|
|
80
|
+
credId: Uint8Array;
|
|
81
|
+
}>>;
|
|
78
82
|
/**
|
|
79
83
|
* UV + write IdentityBundle (seed + hosts) to largeBlob.
|
|
80
84
|
* Encode and WebAuthn write complete inside this method; nothing seed-bearing
|
|
@@ -3,3 +3,5 @@
|
|
|
3
3
|
* Does not inject seed — use {@link Enclave.spawnSyncWorker} for that.
|
|
4
4
|
*/
|
|
5
5
|
export declare function spawnDiplomaticSyncWorker(): Worker;
|
|
6
|
+
/** postMessage via the load-time snapshot (not the live prototype). */
|
|
7
|
+
export declare function postToDiplomaticWorker(worker: Worker, data: unknown, transfer?: Transferable[]): void;
|
|
@@ -29,6 +29,8 @@ export declare class IDBSeedStore implements ISeedStore {
|
|
|
29
29
|
loadPrfMeta(): Promise<PrfSeedMeta | undefined>;
|
|
30
30
|
persistPrfMeta(meta: PrfSeedMeta | undefined): Promise<void>;
|
|
31
31
|
hasPrfMeta(): Promise<boolean>;
|
|
32
|
+
/** Last PRF passkey id, if this device has a sealed PRF identity. */
|
|
33
|
+
lastPrfCredId(): Promise<Uint8Array | undefined>;
|
|
32
34
|
openPrfStore(opts: Omit<PrfSeedStoreOpts, "crypto" | "persistMeta" | "meta"> & {
|
|
33
35
|
crypto?: ICrypto;
|
|
34
36
|
}): Promise<PrfSeedStore>;
|
package/dist/web/types.d.ts
CHANGED
|
@@ -60,10 +60,10 @@ export declare class WorkerClient implements IClient<URL> {
|
|
|
60
60
|
* `connected` stays false until the worker reports otherwise.
|
|
61
61
|
*/
|
|
62
62
|
private hydrateStateFromStore;
|
|
63
|
-
/**
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
private
|
|
63
|
+
/** Seed + host from the local store. Worker never owns these. */
|
|
64
|
+
private loadSession;
|
|
65
|
+
/** Queue depths + progress from the worker (after setSeed). */
|
|
66
|
+
private pullRemoteXfer;
|
|
67
67
|
private requireWorker;
|
|
68
68
|
/** Lightweight RPC check after setSeed. */
|
|
69
69
|
ping(): Promise<void>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Status } from "../shared/consts";
|
|
2
2
|
import type { SyncProgressEvent } from "../progress";
|
|
3
|
-
import type {
|
|
3
|
+
import type { IDiplomaticClientXferState } from "../types";
|
|
4
4
|
/** Host identity as plain data (URL → string for structured clone). */
|
|
5
5
|
export interface SerializedHost {
|
|
6
6
|
handle: string;
|
|
@@ -66,9 +66,6 @@ export type WorkerCmd = {
|
|
|
66
66
|
} | {
|
|
67
67
|
id: number;
|
|
68
68
|
op: "export";
|
|
69
|
-
} | {
|
|
70
|
-
id: number;
|
|
71
|
-
op: "getClientState";
|
|
72
69
|
} | {
|
|
73
70
|
id: number;
|
|
74
71
|
op: "getXferState";
|
|
@@ -91,9 +88,11 @@ export type WorkerEvent = {
|
|
|
91
88
|
| {
|
|
92
89
|
kind: "initError";
|
|
93
90
|
message: string;
|
|
94
|
-
}
|
|
91
|
+
}
|
|
92
|
+
/** Socket state only. Seed/host stay on the main-thread store. */
|
|
93
|
+
| {
|
|
95
94
|
kind: "clientState";
|
|
96
|
-
|
|
95
|
+
connected: boolean;
|
|
97
96
|
}
|
|
98
97
|
/** Queues + sync phase progress (see IDiplomaticClientXferState.progress). */
|
|
99
98
|
| {
|
|
@@ -114,6 +113,5 @@ export declare function isWorkerEvent(data: unknown): data is WorkerEvent;
|
|
|
114
113
|
export declare function isWorkerCmd(data: unknown): data is WorkerCmd;
|
|
115
114
|
/** Narrow helpers for typed replies (avoid casts at call sites). */
|
|
116
115
|
export declare function statusFromUnknown(v: unknown): Status | undefined;
|
|
117
|
-
export declare function clientStateFromUnknown(v: unknown): IDiplomaticClientState | undefined;
|
|
118
116
|
export declare function progressFromUnknown(v: unknown): SyncProgressEvent | undefined;
|
|
119
117
|
export declare function xferStateFromUnknown(v: unknown): IDiplomaticClientXferState | undefined;
|