@evolustr/client 0.0.0-stage → 0.1.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.
@@ -0,0 +1,242 @@
1
+ /**
2
+ * `@evolustr/client` (SPEC §8): opens the app's Evolu database for the
3
+ * signed-in Nostr user, on any device.
4
+ *
5
+ * All side effects come in through {@link ClientDeps}; every method returns a
6
+ * `Result` instead of throwing. Session state lives in one immutable record
7
+ * that each step replaces.
8
+ */
9
+ import { type Bytes, type Relays, type Result, type Signer, type VaultChoice, type SettingKey, type SharedSettings } from "@evolustr/core";
10
+ import type { SecretCache } from "./cache.ts";
11
+ import { type CapableSigner } from "./capable.ts";
12
+ import type { Passkeys } from "@evolustr/core";
13
+ import { type AppDatabase, type MigrationResult, type OpenDatabase } from "./database.ts";
14
+ export interface ClientDeps {
15
+ readonly signer: Signer;
16
+ readonly relays: Relays;
17
+ readonly openDatabase: OpenDatabase;
18
+ readonly cache: SecretCache;
19
+ /** Client passkeys on this app's domain (SPEC §4); omit to disable. */
20
+ readonly passkeys?: Passkeys | undefined;
21
+ /**
22
+ * A small non-secret store that survives logout (e.g. localStorage): the last
23
+ * mode and secret hash per (pubkey, appId). After a logout it still tells a
24
+ * strict vault swapped for a weak one (#44). It also holds the facts for the
25
+ * backup check (#53): which strong methods recover on their own, and whether
26
+ * the phrase was confirmed. Without it, those last for the session only.
27
+ */
28
+ readonly hints?: {
29
+ readonly get: (key: string) => Promise<string | null>;
30
+ readonly set: (key: string, value: string) => Promise<void>;
31
+ readonly remove?: (key: string) => Promise<void>;
32
+ };
33
+ /** An Evolustr-capable signer (SPEC §5), e.g. from `detectCapableSigner(window.nostr)`. */
34
+ readonly capableSigner?: CapableSigner | undefined;
35
+ /** Unix seconds. */
36
+ readonly now?: () => number;
37
+ readonly randomBytes?: (length: number) => Bytes;
38
+ }
39
+ export interface ClientOptions {
40
+ readonly appId: string;
41
+ readonly relayUrls: ReadonlyArray<string>;
42
+ /**
43
+ * Enough relays to trust a vault an unlock found (#60): such reads stop
44
+ * waiting once this many answered, so one slow relay doesn't hold them up.
45
+ * "No vault" and reads before a write still wait for every relay (#62).
46
+ * Default: every relay.
47
+ */
48
+ readonly relayQuorum?: number;
49
+ /** Only strict databases (SPEC §3.2 rule 1). Needs passkeys or a capable signer. */
50
+ readonly requireStrong?: boolean;
51
+ readonly timeoutMs?: number;
52
+ /** Margin for devices whose clocks are off, used in migrations (SPEC §3.4). */
53
+ readonly clockMarginMs?: number;
54
+ /** Defaults for shared settings; language and time zone usually come from the browser. */
55
+ readonly settingsDefaults?: SharedSettings;
56
+ /**
57
+ * Ask before using a compatible vault on a new device when nothing stronger can
58
+ * verify it (`needsUserAction: "confirmWeak"`). Default true; turn off only if
59
+ * the app never offers strict mode.
60
+ */
61
+ readonly confirmWeakOnNewDevice?: boolean;
62
+ /**
63
+ * Also keep the root key R (the recovery phrase) in the device cache, so a
64
+ * reload can follow rotations and add strong methods without a passkey or
65
+ * signer click. Default false: R stays in memory for the session (#27).
66
+ */
67
+ readonly cacheRootKey?: boolean;
68
+ /**
69
+ * After the database became strict elsewhere, also copy rows this device
70
+ * changed in the old database, overwriting the strict one. Default false:
71
+ * the old database could be written by any app that could decrypt its secret,
72
+ * so only rows missing in the strict database are copied (#51).
73
+ */
74
+ readonly migrateChangedRows?: boolean;
75
+ /** Called as connect and unlock move through their steps; relays can be slow. */
76
+ readonly onProgress?: (step: ProgressStep) => void;
77
+ }
78
+ export type UnlockMethod = "signer" | "passkey" | "nip44" | "recovery" | "cache" | "created";
79
+ export interface Status {
80
+ readonly pubkey: string;
81
+ readonly signer: "capable-verified" | "capable-connection" | "standard";
82
+ readonly mode: "strict" | "compatible";
83
+ readonly level: "strong" | "weak";
84
+ readonly unlockedWith: UnlockMethod;
85
+ /** R is unlocked on this device, so strict is possible (SPEC §8.1). */
86
+ readonly canMakeStrict: boolean;
87
+ /** False after a nip44-only unlock of a vault that has R (SPEC §3.1). */
88
+ readonly canAddStrongMethod: boolean;
89
+ /**
90
+ * A compatible vault whose root key this device can't open: it can still go
91
+ * strict with a new root key, `makeStrict({ replaceRoot: true })` (#49).
92
+ * Earlier passkeys, signer wraps and the old recovery phrase stop working.
93
+ */
94
+ readonly canReplaceRoot: boolean;
95
+ readonly passkeySupported: boolean;
96
+ readonly backupRecommended: boolean;
97
+ /**
98
+ * The vault is strict and this session's capable signer protects its key with
99
+ * the nsec, or did before without changing the key: anyone who has the
100
+ * user's nsec can open this data (#43, #52).
101
+ */
102
+ readonly dependsOnNsec: boolean;
103
+ /**
104
+ * The capable signer replaced its key because the old one was exposed (#52),
105
+ * and this vault still has a wrap made with the old key: whoever had it may
106
+ * know this app's root key and data secret. Offer `rotateRoot()`.
107
+ */
108
+ readonly rootExposed: boolean;
109
+ }
110
+ /** Steps of connect / unlock, for showing progress (`onProgress`). */
111
+ export type ProgressStep = "lookingUpVault" | "creatingVault" | "publishingVault" | "openingDatabase";
112
+ export interface UnlockInput {
113
+ readonly recoveryPhrase?: string;
114
+ readonly acceptDeviceLoss?: boolean;
115
+ }
116
+ export interface MakeStrictOptions {
117
+ readonly acceptDeviceLoss?: boolean;
118
+ /**
119
+ * Only when `status.canReplaceRoot`: go strict with a new root key and a new
120
+ * strong method created in the same call (the capable signer, else a new
121
+ * passkey; call from a click). Earlier passkeys, signer wraps and the old
122
+ * recovery phrase of this database stop working; tell the user first (#49).
123
+ */
124
+ readonly replaceRoot?: boolean;
125
+ }
126
+ export interface Ready {
127
+ readonly pubkey: string;
128
+ readonly db: AppDatabase;
129
+ readonly status: Status;
130
+ /**
131
+ * Set when this unlock moved local rows to a new data secret. `skippedChanged`
132
+ * counts rows edited here that weren't carried over (#51); the old database
133
+ * is then kept until `discardOldDatabase()`.
134
+ */
135
+ readonly migration?: MigrationResult;
136
+ }
137
+ /**
138
+ * "confirmWeak": first use on this device of a compatible vault that can only be
139
+ * opened through NIP-44. Someone who can sign for the user could have replaced a
140
+ * strict vault with one like it (#26), so the user confirms before data is written.
141
+ */
142
+ export type UserAction = "passkey" | "signerUnlock" | "recoveryPhrase" | "setupStrong" | "confirmWeak";
143
+ export type ConnectResult = ({
144
+ readonly state: "ready";
145
+ } & Ready) | {
146
+ readonly state: "needsUserAction";
147
+ readonly action: UserAction;
148
+ } | {
149
+ readonly state: "vaultChanged";
150
+ readonly reason: "replaced" | "ambiguous" | "missing";
151
+ readonly options: ReadonlyArray<VaultChoice>;
152
+ /**
153
+ * "useAnotherDevice": nothing on this device can restore the real vault.
154
+ * Connect a device that is still signed in: it restores the vault
155
+ * (`republishCopy`); then sign in here again (#54).
156
+ */
157
+ readonly advice?: "useAnotherDevice";
158
+ };
159
+ export interface Evolustr {
160
+ /** Never prompts for a passkey; safe on page load. */
161
+ readonly connect: () => Promise<Result<ConnectResult>>;
162
+ /**
163
+ * Completes `needsUserAction`, from a click. Pass the phrase for "recoveryPhrase";
164
+ * for "setupStrong" with a device-bound passkey, pass `acceptDeviceLoss`.
165
+ *
166
+ * Errors to handle: `wrongPhrase`; `vaultReplaced` when the unlock proved the
167
+ * vault on the relays isn't the user's (#39): call
168
+ * `resolveVaultChange("republishCopy")` to restore this device's copy.
169
+ */
170
+ readonly unlock: (input?: UnlockInput) => Promise<Result<Ready>>;
171
+ readonly resolveVaultChange: (choice: VaultChoice, input?: {
172
+ readonly recoveryPhrase?: string;
173
+ }) => Promise<Result<Ready>>;
174
+ /** Makes R available on this device while ready: phrase, or a passkey from a click (SPEC §8.1). */
175
+ readonly unlockRoot: (input?: {
176
+ readonly recoveryPhrase?: string;
177
+ }) => Promise<Result<Status>>;
178
+ /** Adds a passkey on this domain, from a click. May need `finishPasskeySetup` (SPEC §4.2). */
179
+ readonly enrollPasskey: () => Promise<Result<{
180
+ readonly done: boolean;
181
+ }>>;
182
+ /** Second click when the authenticator returned no PRF output at creation. */
183
+ readonly finishPasskeySetup: () => Promise<Result<Status>>;
184
+ /**
185
+ * User's choice: replaces S and drops the NIP-44 wrap (SPEC §3.2 rules 3–4, §3.4).
186
+ * Protects what is written afterwards; data written before stays as readable
187
+ * as it was. Tell the user before calling it (#31).
188
+ */
189
+ readonly makeStrict: (opts?: MakeStrictOptions) => Promise<Result<Status>>;
190
+ /**
191
+ * This database's Evolu mnemonic (12 words), to use the data with Evolu
192
+ * directly, without Nostr. Anyone with it can read and write all of this
193
+ * database. It is not the recovery phrase: it changes when the database is
194
+ * made strict, and the old one keeps opening the data from before that.
195
+ */
196
+ readonly exportEvoluMnemonic: () => Result<string>;
197
+ /** R as 12 words; creates R if the vault has none yet. */
198
+ readonly showRecoveryPhrase: () => Promise<Result<string>>;
199
+ /** The user typed the phrase back correctly; remembered for the backup check. */
200
+ readonly confirmRecoveryPhrase: (words: string) => Promise<Result<void>>;
201
+ readonly restoreFromPhrase: (words: string) => Promise<Result<Ready>>;
202
+ readonly downgrade: () => Promise<Result<Status>>;
203
+ /**
204
+ * Replaces the root key and the data secret, keeping the mode (#52 phase C),
205
+ * from a click: when `status.rootExposed`, or when the recovery phrase may
206
+ * have leaked. A new strong method seals the new root key (the capable
207
+ * signer, else a new passkey). Every other passkey and signer, and the old
208
+ * recovery phrase, stop working for this app; tell the user first. Data
209
+ * written before stays as readable as it was.
210
+ */
211
+ readonly rotateRoot: (opts?: {
212
+ readonly acceptDeviceLoss?: boolean;
213
+ }) => Promise<Result<Status>>;
214
+ readonly status: () => Status | null;
215
+ readonly settings: {
216
+ /** `app ?? shared ?? default` (SPEC §9.2). Reads cached values; no prompt. */
217
+ readonly get: <K extends SettingKey>(key: K) => SharedSettings[K];
218
+ /** Fetches the shared settings from relays (may show a decrypt prompt). */
219
+ readonly refresh: () => Promise<Result<void>>;
220
+ /** "Use for all apps": writes to the shared event (signature + encryption). */
221
+ readonly setShared: (key: string, value: unknown) => Promise<Result<void>>;
222
+ /** This app only, stored in the app database. */
223
+ readonly setApp: (key: string, value: unknown) => Promise<Result<void>>;
224
+ };
225
+ readonly logout: (opts?: {
226
+ readonly deleteLocalData?: boolean;
227
+ }) => Promise<void>;
228
+ /**
229
+ * Deletes the old local database kept after a migration that skipped edited
230
+ * rows (`ready.migration.skippedChanged > 0`), once the user decided (#51).
231
+ */
232
+ readonly discardOldDatabase: () => Promise<Result<void>>;
233
+ }
234
+ /** @deprecated No longer read or written: backup facts live on the device (`hints`, #53). */
235
+ export declare const META_PHRASE_CONFIRMED = "phraseConfirmed";
236
+ export declare const META_APP_SETTINGS = "appSettings";
237
+ /** Data secrets this device moved past, for rollback detection beyond the vault's history (#44). */
238
+ export declare const META_SEEN_SECRETS = "seenSecrets";
239
+ /** @deprecated No longer read or written: backup facts live on the device (`hints`, #53). */
240
+ export declare const META_STRONG_METHODS = "strongMethods";
241
+ export declare const createEvolustr: (deps: ClientDeps, options: ClientOptions) => Evolustr;
242
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,KAAK,KAAK,EAIV,KAAK,MAAM,EACX,KAAK,MAAM,EACX,KAAK,MAAM,EAGX,KAAK,WAAW,EAEhB,KAAK,UAAU,EAGf,KAAK,cAAc,EAwDpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,KAAK,aAAa,EAA6C,MAAM,cAAc,CAAC;AAC7F,OAAO,KAAK,EAAkB,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/D,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,eAAe,EACpB,KAAK,YAAY,EAIlB,MAAM,eAAe,CAAC;AAIvB,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5B,uEAAuE;IAC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