@keyneom/sync-kit 0.2.0-rc.0 → 0.2.0-rc.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.
Files changed (52) hide show
  1. package/README.md +15 -11
  2. package/dist/auth/google-web/cache.d.ts +46 -0
  3. package/dist/auth/google-web/cache.d.ts.map +1 -0
  4. package/dist/auth/google-web/cache.js +111 -0
  5. package/dist/auth/google-web/cache.js.map +1 -0
  6. package/dist/sharing/change-detector.d.ts +40 -0
  7. package/dist/sharing/change-detector.d.ts.map +1 -0
  8. package/dist/sharing/change-detector.js +96 -0
  9. package/dist/sharing/change-detector.js.map +1 -0
  10. package/dist/sharing/checkpoint.d.ts +32 -0
  11. package/dist/sharing/checkpoint.d.ts.map +1 -0
  12. package/dist/sharing/checkpoint.js +2 -0
  13. package/dist/sharing/checkpoint.js.map +1 -0
  14. package/dist/sharing/controller.d.ts +44 -1
  15. package/dist/sharing/controller.d.ts.map +1 -1
  16. package/dist/sharing/controller.js +188 -1
  17. package/dist/sharing/controller.js.map +1 -1
  18. package/dist/sharing/index.d.ts +4 -1
  19. package/dist/sharing/index.d.ts.map +1 -1
  20. package/dist/sharing/index.js +2 -0
  21. package/dist/sharing/index.js.map +1 -1
  22. package/dist/sharing/join.d.ts +56 -0
  23. package/dist/sharing/join.d.ts.map +1 -0
  24. package/dist/sharing/join.js +153 -0
  25. package/dist/sharing/join.js.map +1 -0
  26. package/dist/sharing/lifecycle.d.ts +20 -0
  27. package/dist/sharing/lifecycle.d.ts.map +1 -0
  28. package/dist/sharing/lifecycle.js +55 -0
  29. package/dist/sharing/lifecycle.js.map +1 -0
  30. package/dist/sharing/registry-indexeddb.d.ts +21 -0
  31. package/dist/sharing/registry-indexeddb.d.ts.map +1 -0
  32. package/dist/sharing/registry-indexeddb.js +60 -0
  33. package/dist/sharing/registry-indexeddb.js.map +1 -0
  34. package/dist/sharing/transport.d.ts +12 -0
  35. package/dist/sharing/transport.d.ts.map +1 -1
  36. package/dist/stores/google-drive/app-folders.d.ts +19 -0
  37. package/dist/stores/google-drive/app-folders.d.ts.map +1 -0
  38. package/dist/stores/google-drive/app-folders.js +38 -0
  39. package/dist/stores/google-drive/app-folders.js.map +1 -0
  40. package/dist/stores/google-drive/folder-name.d.ts +16 -0
  41. package/dist/stores/google-drive/folder-name.d.ts.map +1 -0
  42. package/dist/stores/google-drive/folder-name.js +37 -0
  43. package/dist/stores/google-drive/folder-name.js.map +1 -0
  44. package/dist/stores/google-drive/index.d.ts +22 -0
  45. package/dist/stores/google-drive/index.d.ts.map +1 -1
  46. package/dist/stores/google-drive/index.js +66 -0
  47. package/dist/stores/google-drive/index.js.map +1 -1
  48. package/dist/stores/google-drive/sharing.d.ts +5 -1
  49. package/dist/stores/google-drive/sharing.d.ts.map +1 -1
  50. package/dist/stores/google-drive/sharing.js +113 -6
  51. package/dist/stores/google-drive/sharing.js.map +1 -1
  52. package/package.json +15 -4
package/README.md CHANGED
@@ -36,9 +36,9 @@ Version `0.1.1` was published to npm on 2026-06-30. It removes the
36
36
  application-specific runtime presets from `0.1.0` and keeps compatibility
37
37
  profiles consumer-owned.
38
38
 
39
- The current worktree is the unpublished `0.2.0-rc.0` sharing release
40
- candidate. Publication remains gated on live Google validation and one
41
- external consumer integration.
39
+ Version `0.2.0-rc.1` publishes shared encrypted backups, Tier A background
40
+ detection helpers, and the Android sharing port. Live Google validation and
41
+ one external consumer integration remain release gates for a stable `0.2.0`.
42
42
 
43
43
  The tests in this repository cover frozen compatibility vectors, mocked
44
44
  browser providers, package orchestration, and installation/imports from the
@@ -115,11 +115,12 @@ Available exports:
115
115
  - `/snapshot` — serialized snapshot synchronization
116
116
  - `/snapshot/lifecycle` — opt-in browser lifecycle binding
117
117
  - `/sharing` — browser-independent shared-backup protocol types, validation,
118
- roles, invitations, and signed multi-recipient envelopes
118
+ roles, invitations, signed multi-recipient envelopes, and join-link helpers
119
119
  - `/sharing/web-crypto` — P-256 identities, ECDH key grants, signed revisions,
120
120
  invitation/key-response proofs, and decryption
121
121
  - `/sharing/controller` — headless multi-dataset orchestration, owner pinning,
122
- serialized writes, exchange processing, roles, and revocation
122
+ serialized writes, exchange processing, roles, revocation, Drive permission
123
+ reconciliation, and optional IndexedDB registry persistence
123
124
  - `/sharing/web-passkey` — passkey-encrypted sharing identities with
124
125
  non-extractable runtime keys and optional IndexedDB ciphertext storage
125
126
  - `/sharing/account-binding` — backendless Google ID-token and WebAuthn
@@ -131,7 +132,8 @@ Available exports:
131
132
  - `/auth/google-web/identity` — uncached nonce-bound Google ID tokens for
132
133
  account-binding exchanges
133
134
  - `/stores/google-drive` — low-level `appDataFolder` objects, a typed snapshot
134
- wrapper, and normal-Drive folder/per-file stores
135
+ wrapper, normal-Drive folder/per-file stores, folder-name helpers, and
136
+ accessible app-folder discovery
135
137
  - `/stores/google-drive/sharing` — managed app/exchange folders, conditional
136
138
  dataset writes, provenance checks, and per-dataset permissions
137
139
  - `/stores/google-drive/picker` — explicit folder Picker and Drive Open-with
@@ -182,7 +184,8 @@ not.
182
184
  - **Android:** `com.keyneom:sync-kit-android` (module `android/synckit`) provides
183
185
  private v1 snapshot crypto, `SnapshotSyncController`, Drive `appDataFolder`
184
186
  storage, and Credential Manager passkey PRF — the same contracts as the npm
185
- `/crypto`, `/snapshot`, and appData store paths. See
187
+ `/crypto`, `/snapshot`, and appData store paths. Published to
188
+ [GitHub Packages](https://github.com/keyneom/sync-kit/packages). See
186
189
  [android-library.md](docs/android-library.md).
187
190
  - Shared backups (`/sharing`) are TypeScript-only for now.
188
191
  - React Native and other JavaScript-native runtimes can inject a
@@ -229,10 +232,11 @@ metadata, and ciphertext to app participants while cryptographic grants control
229
232
  decryption. Applications needing metadata isolation can instead use direct file
230
233
  sharing or limited-access subfolders.
231
234
 
232
- See the [protocol and threat model](docs/shared-backups.md) and
233
- [authoritative implementation handoff](docs/sharing-implementation-handoff.md).
234
- The phased gates remain in the
235
- [sharing execution plan](docs/sharing-execution-plan.md). The crypto and
235
+ See the [protocol and threat model](docs/shared-backups.md),
236
+ [authoritative implementation handoff](docs/sharing-implementation-handoff.md),
237
+ [consumer responsibilities](docs/consumer-responsibilities.md), and
238
+ [background notifications](docs/background-notifications.md). The phased gates
239
+ remain in the [sharing execution plan](docs/sharing-execution-plan.md). The crypto and
236
240
  per-file transport, Picker, protected identity, account binding, signed
237
241
  ancestry/fork policy, key rotation, and controller primitives are implemented.
238
242
  The same sharing fixture is consumed by Java, and the packed package completes
@@ -0,0 +1,46 @@
1
+ import type { Authorization, AuthorizationProvider } from "../../core/types.js";
2
+ export type CachedAuthorizationRecord = {
3
+ profileId: string;
4
+ accessToken: string;
5
+ expiresAt: number;
6
+ accountHint?: string;
7
+ };
8
+ /**
9
+ * Opt-in persistence for short-lived Google access tokens used by Tier A
10
+ * background polling. Not enabled by default; memory-only auth remains the
11
+ * default policy.
12
+ */
13
+ export declare class IndexedDbAuthorizationCache {
14
+ private readonly options;
15
+ constructor(options?: {
16
+ databaseName?: string;
17
+ storeName?: string;
18
+ indexedDB?: IDBFactory;
19
+ });
20
+ load(profileId: string): Promise<CachedAuthorizationRecord | null>;
21
+ save(record: CachedAuthorizationRecord): Promise<void>;
22
+ delete(profileId: string): Promise<void>;
23
+ private transaction;
24
+ private open;
25
+ private storeName;
26
+ }
27
+ export type CachingAuthorizationProviderOptions = {
28
+ profileId: string;
29
+ inner: AuthorizationProvider<Authorization>;
30
+ cache: IndexedDbAuthorizationCache;
31
+ accountHint?: string;
32
+ expirySkewMs?: number;
33
+ now?: () => number;
34
+ };
35
+ /**
36
+ * Wraps an authorization provider and mirrors valid access tokens into the
37
+ * opt-in IndexedDB cache for service-worker polling.
38
+ */
39
+ export declare class CachingAuthorizationProvider implements AuthorizationProvider<Authorization> {
40
+ private readonly options;
41
+ constructor(options: CachingAuthorizationProviderOptions);
42
+ authorize(): Promise<Authorization>;
43
+ authorizeFromCache(): Promise<Authorization | null>;
44
+ clear(): void;
45
+ }
46
+ //# sourceMappingURL=cache.d.ts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E,mCAAmC;IAEnE,SAAS,IAAI,OAAO,CAAC,aAAa,CAAC;IAmBnC,kBAAkB,IAAI,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAezD,KAAK,IAAI,IAAI;CAId"}
@@ -0,0 +1,111 @@
1
+ import { SyncKitError } from "../../core/errors.js";
2
+ /**
3
+ * Opt-in persistence for short-lived Google access tokens used by Tier A
4
+ * background polling. Not enabled by default; memory-only auth remains the
5
+ * default policy.
6
+ */
7
+ export class IndexedDbAuthorizationCache {
8
+ options;
9
+ constructor(options = {}) {
10
+ this.options = options;
11
+ }
12
+ async load(profileId) {
13
+ const stored = await this.transaction("readonly", (store) => store.get(profileId));
14
+ if (!stored || typeof stored !== "object")
15
+ return null;
16
+ const record = stored;
17
+ if (typeof record.accessToken !== "string" ||
18
+ typeof record.expiresAt !== "number") {
19
+ return null;
20
+ }
21
+ return structuredClone(record);
22
+ }
23
+ async save(record) {
24
+ await this.transaction("readwrite", (store) => store.put(structuredClone(record)));
25
+ }
26
+ async delete(profileId) {
27
+ await this.transaction("readwrite", (store) => store.delete(profileId));
28
+ }
29
+ async transaction(mode, operation) {
30
+ const database = await this.open();
31
+ return new Promise((resolve, reject) => {
32
+ const transaction = database.transaction(this.storeName(), mode);
33
+ const request = operation(transaction.objectStore(this.storeName()));
34
+ request.onsuccess = () => resolve(request.result);
35
+ request.onerror = () => reject(new SyncKitError("state", "IndexedDB authorization cache failed.", {
36
+ cause: request.error,
37
+ }));
38
+ transaction.oncomplete = () => database.close();
39
+ transaction.onabort = () => database.close();
40
+ });
41
+ }
42
+ open() {
43
+ const indexedDBImplementation = this.options.indexedDB ??
44
+ (typeof indexedDB === "undefined" ? undefined : indexedDB);
45
+ if (!indexedDBImplementation) {
46
+ return Promise.reject(new SyncKitError("configuration", "IndexedDB is required for authorization cache storage."));
47
+ }
48
+ return new Promise((resolve, reject) => {
49
+ const request = indexedDBImplementation.open(this.options.databaseName ?? "sync-kit-auth-cache", 1);
50
+ request.onupgradeneeded = () => {
51
+ if (!request.result.objectStoreNames.contains(this.storeName())) {
52
+ request.result.createObjectStore(this.storeName(), {
53
+ keyPath: "profileId",
54
+ });
55
+ }
56
+ };
57
+ request.onsuccess = () => resolve(request.result);
58
+ request.onerror = () => reject(new SyncKitError("state", "IndexedDB authorization cache could not be opened.", { cause: request.error }));
59
+ });
60
+ }
61
+ storeName() {
62
+ return this.options.storeName ?? "google-authorization";
63
+ }
64
+ }
65
+ /**
66
+ * Wraps an authorization provider and mirrors valid access tokens into the
67
+ * opt-in IndexedDB cache for service-worker polling.
68
+ */
69
+ export class CachingAuthorizationProvider {
70
+ options;
71
+ constructor(options) {
72
+ this.options = options;
73
+ }
74
+ async authorize() {
75
+ const authorization = await this.options.inner.authorize();
76
+ const now = this.options.now?.() ?? Date.now();
77
+ const skew = this.options.expirySkewMs ?? 60_000;
78
+ const expiresAt = authorization.expiresAt ?? now + 3_600_000;
79
+ if (expiresAt > now + skew) {
80
+ await this.options.cache.save({
81
+ profileId: this.options.profileId,
82
+ accessToken: authorization.accessToken,
83
+ expiresAt,
84
+ ...(this.options.accountHint
85
+ ? { accountHint: this.options.accountHint }
86
+ : {}),
87
+ });
88
+ }
89
+ return authorization;
90
+ }
91
+ async authorizeFromCache() {
92
+ const record = await this.options.cache.load(this.options.profileId);
93
+ if (!record)
94
+ return null;
95
+ const now = this.options.now?.() ?? Date.now();
96
+ const skew = this.options.expirySkewMs ?? 60_000;
97
+ if (record.expiresAt <= now + skew) {
98
+ await this.options.cache.delete(this.options.profileId);
99
+ return null;
100
+ }
101
+ return {
102
+ accessToken: record.accessToken,
103
+ expiresAt: record.expiresAt,
104
+ };
105
+ }
106
+ clear() {
107
+ this.options.inner.clear();
108
+ void this.options.cache.delete(this.options.profileId);
109
+ }
110
+ }
111
+ //# sourceMappingURL=cache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache.js","sourceRoot":"","sources":["../../../src/auth/google-web/cache.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,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ACT,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW;oBAC1B,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE;oBAC3C,CAAC,CAAC,EAAE,CAAC;aACR,CAAC,CAAC;QACL,CAAC;QACD,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,kBAAkB;QACtB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACrE,IAAI,CAAC,MAAM;YAAE,OAAO,IAAI,CAAC;QACzB,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;QAC/C,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,IAAI,MAAM,CAAC;QACjD,IAAI,MAAM,CAAC,SAAS,IAAI,GAAG,GAAG,IAAI,EAAE,CAAC;YACnC,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;YACxD,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO;YACL,WAAW,EAAE,MAAM,CAAC,WAAW;YAC/B,SAAS,EAAE,MAAM,CAAC,SAAS;SAC5B,CAAC;IACJ,CAAC;IAED,KAAK;QACH,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QAC3B,KAAK,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACzD,CAAC;CACF"}
@@ -0,0 +1,40 @@
1
+ import type { SharingChangeDetectionResult, SharingSyncCheckpoint, SharedDatasetHead } from "./checkpoint.js";
2
+ export type { SharedDatasetHead, SharingChangeDetectionResult, SharingNotificationEvent, SharingSyncCheckpoint, } from "./checkpoint.js";
3
+ export type SharingChangeDetectorOptions = {
4
+ now?: () => Date;
5
+ tokenExpiresAt?: number;
6
+ tokenExpiringSoonMs?: number;
7
+ };
8
+ /**
9
+ * Metadata-only poll for Tier A notifications. Does not decrypt, sign, or
10
+ * mutate Drive state.
11
+ */
12
+ export declare function detectSharingChanges(listKeyResponses: () => Promise<readonly {
13
+ fileId: string;
14
+ exchangeId: string;
15
+ }[]>, listDatasetHeads: () => Promise<readonly SharedDatasetHead[]>, checkpoint: SharingSyncCheckpoint, options?: SharingChangeDetectorOptions): Promise<SharingChangeDetectionResult>;
16
+ export declare class SharingChangeDetector {
17
+ private readonly options;
18
+ constructor(options: {
19
+ listKeyResponses: () => Promise<readonly {
20
+ fileId: string;
21
+ exchangeId: string;
22
+ }[]>;
23
+ listDatasetHeads: () => Promise<readonly SharedDatasetHead[]>;
24
+ tokenExpiresAt?: () => number | undefined;
25
+ now?: () => Date;
26
+ tokenExpiringSoonMs?: number;
27
+ });
28
+ detect(checkpoint: SharingSyncCheckpoint): Promise<SharingChangeDetectionResult>;
29
+ }
30
+ export declare function createSharingChangeDetectorFromTransport(transport: {
31
+ listExchanges(options?: {
32
+ kind?: "invitation" | "key-response";
33
+ }): Promise<readonly {
34
+ fileId: string;
35
+ exchangeId: string;
36
+ kind: string;
37
+ }[]>;
38
+ listDatasetHeads(): Promise<readonly SharedDatasetHead[]>;
39
+ }, options?: Omit<ConstructorParameters<typeof SharingChangeDetector>[0], "listKeyResponses" | "listDatasetHeads">): SharingChangeDetector;
40
+ //# sourceMappingURL=change-detector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"change-detector.d.ts","sourceRoot":"","sources":["../../src/sharing/change-detector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,4BAA4B,EAE5B,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,iBAAiB,EACjB,4BAA4B,EAC5B,wBAAwB,EACxB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AC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAChE,CAAC;IACF,gBAAgB,IAAI,OAAO,CAAC,SAAS,iBAAiB,EAAE,CAAC,CAAC;CAC3D,EACD,OAAO,GAAE,IAAI,CACX,qBAAqB,CAAC,OAAO,qBAAqB,CAAC,CAAC,CAAC,CAAC,EACtD,kBAAkB,GAAG,kBAAkB,CACnC,GACL,qBAAqB,CAYvB"}
@@ -0,0 +1,96 @@
1
+ function datasetHeadSignature(head) {
2
+ return [
3
+ head.etag ?? "",
4
+ head.version ?? "",
5
+ head.headRevisionId ?? "",
6
+ head.modifiedTime ?? "",
7
+ ].join("|");
8
+ }
9
+ /**
10
+ * Metadata-only poll for Tier A notifications. Does not decrypt, sign, or
11
+ * mutate Drive state.
12
+ */
13
+ export async function detectSharingChanges(listKeyResponses, listDatasetHeads, checkpoint, options = {}) {
14
+ const now = options.now ?? (() => new Date());
15
+ const events = [];
16
+ const tokenExpiringSoonMs = options.tokenExpiringSoonMs ?? 5 * 60_000;
17
+ if (options.tokenExpiresAt !== undefined) {
18
+ if (options.tokenExpiresAt <= now().getTime()) {
19
+ events.push({ kind: "token-expired" });
20
+ return {
21
+ checkpoint: { ...checkpoint, lastPollAt: now().toISOString() },
22
+ events,
23
+ };
24
+ }
25
+ if (options.tokenExpiresAt - now().getTime() <= tokenExpiringSoonMs) {
26
+ events.push({
27
+ kind: "token-expiring-soon",
28
+ expiresAt: new Date(options.tokenExpiresAt).toISOString(),
29
+ });
30
+ }
31
+ }
32
+ const seenResponses = new Set(checkpoint.lastSeenKeyResponseFileIds ?? []);
33
+ const responses = await listKeyResponses();
34
+ for (const response of responses) {
35
+ if (!seenResponses.has(response.fileId)) {
36
+ events.push({
37
+ kind: "pending-key-response",
38
+ exchangeId: response.exchangeId,
39
+ fileId: response.fileId,
40
+ });
41
+ }
42
+ }
43
+ const previousHeads = checkpoint.datasetHeads ?? {};
44
+ const nextHeads = {};
45
+ const heads = await listDatasetHeads();
46
+ for (const head of heads) {
47
+ nextHeads[head.datasetId] = head;
48
+ const previous = previousHeads[head.datasetId];
49
+ if (previous &&
50
+ datasetHeadSignature(previous) !== datasetHeadSignature(head)) {
51
+ events.push({
52
+ kind: "shared-dataset-changed",
53
+ datasetId: head.datasetId,
54
+ fileId: head.fileId,
55
+ });
56
+ }
57
+ }
58
+ return {
59
+ checkpoint: {
60
+ lastPollAt: now().toISOString(),
61
+ lastSeenKeyResponseFileIds: responses.map((response) => response.fileId),
62
+ datasetHeads: nextHeads,
63
+ },
64
+ events,
65
+ };
66
+ }
67
+ export class SharingChangeDetector {
68
+ options;
69
+ constructor(options) {
70
+ this.options = options;
71
+ }
72
+ detect(checkpoint) {
73
+ const tokenExpiresAt = this.options.tokenExpiresAt?.();
74
+ return detectSharingChanges(this.options.listKeyResponses, this.options.listDatasetHeads, checkpoint, {
75
+ ...(this.options.now ? { now: this.options.now } : {}),
76
+ ...(tokenExpiresAt !== undefined ? { tokenExpiresAt } : {}),
77
+ ...(this.options.tokenExpiringSoonMs !== undefined
78
+ ? { tokenExpiringSoonMs: this.options.tokenExpiringSoonMs }
79
+ : {}),
80
+ });
81
+ }
82
+ }
83
+ export function createSharingChangeDetectorFromTransport(transport, options = {}) {
84
+ return new SharingChangeDetector({
85
+ listKeyResponses: async () => {
86
+ const exchanges = await transport.listExchanges({ kind: "key-response" });
87
+ return exchanges.map((exchange) => ({
88
+ fileId: exchange.fileId,
89
+ exchangeId: exchange.exchangeId,
90
+ }));
91
+ },
92
+ listDatasetHeads: () => transport.listDatasetHeads(),
93
+ ...options,
94
+ });
95
+ }
96
+ //# sourceMappingURL=change-detector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"change-detector.js","sourceRoot":"","sources":["../../src/sharing/change-detector.ts"],"names":[],"mappings":"AAaA,SAAS,oBAAoB,CAAC,IAAuB;IACnD,OAAO;QACL,IAAI,CAAC,IAAI,IAAI,EAAE;QACf,IAAI,CAAC,OAAO,IAAI,EAAE;QAClB,IAAI,CAAC,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ime?: string;
5
+ version?: string;
6
+ headRevisionId?: string;
7
+ etag?: string;
8
+ };
9
+ export type SharingSyncCheckpoint = {
10
+ lastPollAt?: string;
11
+ lastSeenKeyResponseFileIds?: string[];
12
+ datasetHeads?: Record<string, SharedDatasetHead>;
13
+ };
14
+ export type SharingNotificationEvent = {
15
+ kind: "pending-key-response";
16
+ exchangeId: string;
17
+ fileId: string;
18
+ } | {
19
+ kind: "shared-dataset-changed";
20
+ datasetId: string;
21
+ fileId: string;
22
+ } | {
23
+ kind: "token-expiring-soon";
24
+ expiresAt: string;
25
+ } | {
26
+ kind: "token-expired";
27
+ };
28
+ export type SharingChangeDetectionResult = {
29
+ checkpoint: SharingSyncCheckpoint;
30
+ events: SharingNotificationEvent[];
31
+ };
32
+ //# sourceMappingURL=checkpoint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkpoint.d.ts","sourceRoot":"","sources":["../../src/sharing/checkpoint.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0BAA0B,CAAC,EAAE,MAAM,EAAE,CAAC;IACtC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;CAClD,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAChC;IACE,IAAI,EAAE,sBAAsB,CAAC;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB,GACD;IACE,IAAI,EAAE,wBAAwB,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB,GACD;IACE,IAAI,EAAE,qBAAqB,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;CACnB,GACD;IACE,IAAI,EAAE,eAAe,CAAC;CACvB,CAAC;AAEN,MAAM,MAAM,4BAA4B,GAAG;IACzC,UAAU,EAAE,qBAAqB,CAAC;IAClC,MAAM,EAAE,wBAAwB,EAAE,CAAC;CACpC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=checkpoint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkpoint.js","sourceRoot":"","sources":["../../src/sharing/checkpoint.ts"],"names":[],"mappings":""}
@@ -1,6 +1,7 @@
1
1
  import { type SharedBackupCodec, type SharingAccountBindingV1, type SharingDatasetGrantV1, type SharingInvitationV1, type SharingRole } from "./index.js";
2
2
  import type { SharedBackupStorage, SharedBackupTransport, SharedDatasetFile, SharedExchangeFile } from "./transport.js";
3
3
  import { type WebCryptoSharingIdentity } from "./web-crypto.js";
4
+ export { IndexedDbSharedBackupRegistry } from "./registry-indexeddb.js";
4
5
  export type SharedBackupControllerCodec<T> = SharedBackupCodec<T> & {
5
6
  merge(local: T, remote: T): T;
6
7
  fingerprint(value: T): string;
@@ -29,7 +30,7 @@ export type SharedDatasetResult<T> = {
29
30
  fileId: string;
30
31
  revisionId: string;
31
32
  value: T;
32
- outcome: "created" | "loaded" | "updated" | "unchanged";
33
+ outcome: "created" | "adopted" | "loaded" | "updated" | "unchanged";
33
34
  };
34
35
  export type SharingInvitationResult = {
35
36
  invitation: SharingInvitationV1;
@@ -50,6 +51,26 @@ export type RotatedDatasetResult = {
50
51
  revisionId?: string;
51
52
  error?: unknown;
52
53
  };
54
+ export type DrivePermissionReconciliationAction = {
55
+ kind: "granted" | "updated";
56
+ keyId: string;
57
+ permissionId: string;
58
+ role: "reader" | "writer";
59
+ } | {
60
+ kind: "removed";
61
+ permissionId: string;
62
+ } | {
63
+ kind: "unchanged";
64
+ keyId: string;
65
+ } | {
66
+ kind: "skipped";
67
+ keyId: string;
68
+ reason: string;
69
+ };
70
+ export type DrivePermissionReconciliationResult = {
71
+ datasetId: string;
72
+ actions: DrivePermissionReconciliationAction[];
73
+ };
53
74
  export type SharedBackupControllerOptions<T> = {
54
75
  appId: string;
55
76
  codec: SharedBackupControllerCodec<T>;
@@ -92,6 +113,19 @@ export declare class SharedBackupController<T> {
92
113
  ensureStorage(): Promise<SharedBackupStorage>;
93
114
  listDatasets(): Promise<SharedDatasetFile[]>;
94
115
  createDataset(datasetId: string, value: T): Promise<SharedDatasetResult<T>>;
116
+ /**
117
+ * Reconnect to an existing dataset this identity can already decrypt —
118
+ * e.g. after a reinstall, or when an interrupted setup left the remote
119
+ * file without a local registry record. The owner key is pinned from the
120
+ * envelope itself (trust-on-first-use), so callers recovering their own
121
+ * dataset should pass `requireOwned` to insist this identity is the
122
+ * dataset's owner.
123
+ */
124
+ adoptDataset(datasetId: string, options?: {
125
+ requireOwned?: boolean;
126
+ }): Promise<SharedDatasetResult<T>>;
127
+ /** Delete a dataset file from the transport and forget its local record. */
128
+ deleteDataset(datasetId: string): Promise<void>;
95
129
  loadDataset(datasetId: string): Promise<SharedDatasetResult<T>>;
96
130
  syncDataset(datasetId: string, localValue: T): Promise<SharedDatasetResult<T>>;
97
131
  inviteParticipant(input: {
@@ -100,6 +134,11 @@ export declare class SharedBackupController<T> {
100
134
  expiresAt?: string;
101
135
  sendNotificationEmail?: boolean;
102
136
  emailMessage?: string;
137
+ /** Consumer landing URL; folder ID is appended before the Drive notification. */
138
+ joinLandingUrl?: string;
139
+ /** Fully built join URL; must already include the app folder ID when used. */
140
+ joinUrl?: string;
141
+ appDisplayName?: string;
103
142
  }): Promise<SharingInvitationResult>;
104
143
  listExchanges(options?: {
105
144
  exchangeId?: string;
@@ -125,6 +164,10 @@ export declare class SharedBackupController<T> {
125
164
  keyId: string;
126
165
  }): Promise<SharedDatasetResult<T>>;
127
166
  rotateLocalKey(replacementIdentity: WebCryptoSharingIdentity, datasetIds: string[]): Promise<RotatedDatasetResult[]>;
167
+ reconcileDrivePermissions(input: {
168
+ datasetId: string;
169
+ participantEmails: Record<string, string>;
170
+ }): Promise<DrivePermissionReconciliationResult>;
128
171
  private changeParticipants;
129
172
  private readDatasetById;
130
173
  private requiredRegistry;
@@ -1 +1 @@
1
- {"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../src/sharing/controller.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,KAAK,iBAAiB,EAEtB,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,WAAW,EACjB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EACV,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAEnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EASL,KAAK,wBAAwB,EAE9B,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,2BAA2B,CAAC,CAAC,IAAI,iBAAiB,CAAC,CAAC,CAAC,GAAG;IAClE,KAAK,CAAC,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC;IAC9B,WAAW,CAAC,KAAK,EAAE,CAAC,GAAG,MAAM,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,wBAAwB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnD,CAAC;AAEF,MAAM,WAAW,oBAAoB;IACnC,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,2BAA2B,GAAG,IAAI,CAAC,CAAC;IAC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