@tinycloud/web-sdk 3.12.0-beta.8 → 3.12.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.
Files changed (49) hide show
  1. package/README.md +30 -8
  2. package/dist/adapters/BrowserSessionStorage.d.ts +13 -3
  3. package/dist/adapters/BrowserWasmBindings.d.ts +2 -0
  4. package/dist/delegations-issued.cjs +2 -1
  5. package/dist/delegations-issued.cjs.LICENSE.txt +5 -0
  6. package/dist/delegations-issued.mjs +2 -1
  7. package/dist/delegations-issued.mjs.LICENSE.txt +5 -0
  8. package/dist/delegations-renewal-entry.d.ts +3 -0
  9. package/dist/delegations-renewal.cjs +2 -0
  10. package/dist/delegations-renewal.cjs.LICENSE.txt +21 -0
  11. package/dist/delegations-renewal.mjs +2 -0
  12. package/dist/delegations-renewal.mjs.LICENSE.txt +21 -0
  13. package/dist/encryption-keys.cjs +1 -1
  14. package/dist/encryption-keys.cjs.LICENSE.txt +4 -0
  15. package/dist/encryption-keys.mjs +1 -1
  16. package/dist/encryption-keys.mjs.LICENSE.txt +4 -0
  17. package/dist/index.cjs +1 -1
  18. package/dist/index.cjs.LICENSE.txt +2 -0
  19. package/dist/index.d.ts +2 -0
  20. package/dist/index.mjs +1 -1
  21. package/dist/index.mjs.LICENSE.txt +2 -0
  22. package/dist/modals.cjs +1 -1
  23. package/dist/modals.mjs +1 -1
  24. package/dist/modules/Storage/tinycloud/module.d.ts +1 -0
  25. package/dist/modules/Storage/tinycloud/types.schema.d.ts +10 -10
  26. package/dist/modules/requestPermissionsCore.d.ts +0 -7
  27. package/dist/modules/restoreAccount.d.ts +13 -0
  28. package/dist/modules/runtimeGrantPersistence.d.ts +4 -2
  29. package/dist/modules/tcw.d.ts +27 -6
  30. package/dist/panel.cjs +1 -1
  31. package/dist/panel.mjs +1 -1
  32. package/dist/registry-verdict-cache-entry.d.ts +2 -0
  33. package/dist/registry-verdict-cache.cjs +1 -0
  34. package/dist/registry-verdict-cache.mjs +1 -0
  35. package/dist/replica.cjs +1 -1
  36. package/dist/replica.mjs +1 -1
  37. package/dist/share-placement-core-bridge.d.ts +2 -0
  38. package/dist/share-placement-core.d.ts +13 -0
  39. package/dist/share-placement-entry.d.ts +2 -0
  40. package/dist/share-placement.cjs +2 -0
  41. package/dist/share-placement.cjs.LICENSE.txt +3 -0
  42. package/dist/share-placement.mjs +2 -0
  43. package/dist/share-placement.mjs.LICENSE.txt +3 -0
  44. package/dist/space-hosting-entry.d.ts +1 -1
  45. package/dist/space-hosting.cjs +1 -1
  46. package/dist/space-hosting.mjs +1 -1
  47. package/dist/ui/pending.d.ts +1 -1
  48. package/dist/ui/strings.d.ts +2 -0
  49. package/package.json +7 -7
package/README.md CHANGED
@@ -58,12 +58,20 @@ expiry. The permission check does not contact the node, so a session the node
58
58
  rejects (a 401 after a revocation or a reset, for example) is still restored.
59
59
  With OpenKey, `prepareSignIn()` makes the same check.
60
60
 
61
- Restoring a session makes one node read, capped at 5 seconds, to learn whether
62
- the session's primary space is hosted. It never prompts and never fails the
63
- restore. Read the answer from `tc.spaceHosting` (`"hosted"`, `"not-hosted"` or
64
- `"unknown"`). At sign-in the answer comes from the node's activation of the new
65
- session. `signIn()` on a restored session whose space is `"not-hosted"` returns
66
- the restored session.
61
+ `restoreSession()` resolves from stored state. It automatically starts a
62
+ background hosting probe, capped at 5 seconds, and reactivates stored panel
63
+ grants. Read `tc.spaceHosting` (`"hosted"`, `"not-hosted"` or `"unknown"`) for
64
+ the current display hint. A stored hint applies only to the same account,
65
+ space and host. It can be one session stale until the probe corrects it at
66
+ runtime, and updates in storage when the signed session is next persisted.
67
+ Older records start at `"unknown"`. The hint never grants authority or skips
68
+ permission checks. The probe never prompts or fails the restore.
69
+ Panel permission requests wait up to 4 seconds for stored grants to reactivate
70
+ before showing a permission prompt.
71
+ `signIn()` waits for the probe when it restores a session. At fresh sign-in
72
+ the hosting answer comes from the node's activation of the new session.
73
+ `signIn()` on a restored session whose space is `"not-hosted"` returns the
74
+ restored session.
67
75
 
68
76
  To force a fresh consent, sign out first. `signOut()` clears the stored session
69
77
  and blocks restoring until the next sign-in succeeds, so `signIn()` prompts:
@@ -76,6 +84,10 @@ await tc.signIn();
76
84
  There is no separate "fresh sign-in" option. Calling `restoreSession()` yourself
77
85
  restores a stored session without the manifest check.
78
86
 
87
+ Sign-out reports session-storage failures. Replica cleanup has its own recovery markers; sign-out completion alone does not certify local-copy erase. Custom/native session adapters keep their existing storage contract, including the provider's durability and boot-handling responsibilities.
88
+ With an asynchronous custom runtime-grant store, sign-out waits for in-flight
89
+ load/save calls to settle.
90
+
79
91
  ### Runtime permission grants with OpenKey
80
92
 
81
93
  `requestPermissions()` (and the panel's "allow" buttons) sign each runtime grant's SIWE as a byte-exact message through
@@ -502,7 +514,7 @@ const tcw = new TinyCloudWeb({ retryPolicy: { maxAttempts: 1 } });
502
514
  TinyCloud is built on these fundamental principles:
503
515
 
504
516
  - **Sovereignty** - Built so that each user controls their data outright. Requests to access or compute on that data must be explicitly permissioned.
505
- - **Privacy** - Data is stored, streamed, and computed upon in ways that minimize leakage with encryption strategies that ensure users do not need to trust an external party.
517
+ - **Privacy** - Access is scoped by the capabilities you approve. Ordinary data is not end-to-end encrypted: the node that hosts a space can read it in order to serve it. Use the data vault to encrypt values before they are stored. See [Security and trust](https://docs.tinycloud.xyz/concepts/security-and-trust).
506
518
  - **Interoperability** - Embracing artifact-based formats like Markdown, JSON Canvas, CSV, and SQLite so that data remains portable and future-proof.
507
519
  - **Open Innovation** - We view AI's rapid growth as an opportunity to endow individuals with new capabilities—before these capabilities are seized exclusively by large institutions.
508
520
 
@@ -546,4 +558,14 @@ If you encounter any issues or have questions, please file an issue on our [GitH
546
558
  Join the TinyCloud community:
547
559
 
548
560
  - [Twitter](https://twitter.com/TinyCloudLabs)
549
- - [Telegram](https://t.me/+pplkv1XbbU01MDVh)
561
+ - [Telegram](https://t.me/+pplkv1XbbU01MDVh)
562
+
563
+ ### Account setup and sign-in options
564
+
565
+ The web SDK includes implicit account bootstrap permissions only at the approved first-party page origins. Other origins, including generic localhost and server-rendered contexts, request the application's manifest rows without implicit account or capabilities-read rows. Explicit manifest permissions are preserved.
566
+
567
+ `autoBootstrapAccount: false` disables account bootstrap and its implicit sign-in permissions, including in the node SDK. `includeAccountRegistryPermissions: false` omits the implicit account registry bundle. Setting either option to `true` does not enable first-party bootstrap at another origin. The policy uses the actual page origin, independently of a configured SIWE domain.
568
+
569
+ A third-party sign-in with no registered account route returns `ACCOUNT_SETUP_REQUIRED` with `setupUrl: "https://home.tinycloud.xyz/"` before signing. Complete setup there and retry. Registry availability errors retain their existing behavior. Setup status for accounts that already have a registry record is unchanged.
570
+
571
+ Details: TC-2931
@@ -1,11 +1,11 @@
1
1
  import { ISessionStorage, PersistedSessionData } from "@tinycloud/sdk-core";
2
2
  import type { PortableDelegation } from "@tinycloud/node-sdk/core";
3
- export type BrowserSessionLoadStatus = "loaded" | "missing" | "expired" | "corrupt" | "storage-unavailable";
3
+ export type BrowserSessionLoadStatus = "loaded" | "renewal-candidate" | "missing" | "expired" | "corrupt" | "storage-unavailable";
4
4
  export type BrowserSessionLoadResult = {
5
- status: "loaded";
5
+ status: "loaded" | "renewal-candidate";
6
6
  data: PersistedSessionData;
7
7
  } | {
8
- status: Exclude<BrowserSessionLoadStatus, "loaded">;
8
+ status: Exclude<BrowserSessionLoadStatus, "loaded" | "renewal-candidate">;
9
9
  data: null;
10
10
  };
11
11
  export interface BrowserSessionStorageOptions {
@@ -22,6 +22,9 @@ export declare class BrowserSessionStorage implements ISessionStorage {
22
22
  private key;
23
23
  private activeAddressKey;
24
24
  private fenceKey;
25
+ private retirementKey;
26
+ private isRetired;
27
+ private invalidateSession;
25
28
  /**
26
29
  * Fences the session with `signature` stored for `address`, for when removing its record fails: a restore
27
30
  * checks {@link isSignedOut} and refuses it. A successful `clear` lifts the fence, and so does saving a
@@ -34,9 +37,16 @@ export declare class BrowserSessionStorage implements ISessionStorage {
34
37
  save(address: string, data: PersistedSessionData): Promise<void>;
35
38
  /** Most recently saved, still-valid session address for provider-free reloads. */
36
39
  activeAddress(): string | undefined;
40
+ /**
41
+ * Returns the saved address for a renewal restore without discarding an expired candidate.
42
+ * The session and renewal authority still require full verification before restore.
43
+ */
44
+ activeAddressForRenewal(): string | undefined;
37
45
  load(address: string): Promise<PersistedSessionData | null>;
38
46
  private validateForNetworkRestore;
39
47
  loadWithStatus(address: string): Promise<BrowserSessionLoadResult>;
48
+ loadRenewalCandidate(address: string): Promise<BrowserSessionLoadResult>;
49
+ private loadForRestore;
40
50
  clear(address: string): Promise<void>;
41
51
  private grantsKey;
42
52
  /**
@@ -4,9 +4,11 @@ export declare class BrowserWasmBindings implements IWasmBindings {
4
4
  ensureInitialized(): Promise<void>;
5
5
  get invoke(): import("sdk-services/dist").InvokeFunction;
6
6
  get invokeAny(): typeof tinycloud.invokeAny;
7
+ get invokeDelegationStatus(): typeof tinycloud.invokeDelegationStatus;
7
8
  get prepareSession(): typeof tinycloud.prepareSession;
8
9
  get completeSessionSetup(): typeof tinycloud.completeSessionSetup;
9
10
  validatePersistedSession(proof: PersistedSessionProof): any;
11
+ validatePersistedSessionForRenewal(proof: PersistedSessionProof): any;
10
12
  computeCid(data: Uint8Array, codec: bigint): string;
11
13
  ensureEip55(address: string): string;
12
14
  makeSpaceId(address: string, chainId: number, prefix: string): string;