@fork-api/chat-sdk 0.1.172 → 0.1.174

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/index.d.cts CHANGED
@@ -15,6 +15,11 @@ interface Fork {
15
15
  summary?: string;
16
16
  /** Rough estimate in minutes for how long the agent will take. Set after the Haiku title call resolves. */
17
17
  estimateMinutes?: number;
18
+ /** True when this user authored the fork and hasn't seen its one-shot
19
+ * reveal animation yet (server-tracked via forks.reveal_seen_at, once
20
+ * ever across tabs/devices). Set client-side on live SSE completion;
21
+ * DirectForkSlot plays the reveal and records it via POST /forks/reveals. */
22
+ revealPending?: boolean;
18
23
  createdAt: string;
19
24
  completedAt?: string;
20
25
  error?: string;
@@ -58,24 +63,32 @@ interface ForkProviderBase {
58
63
  shared?: ForkSharedRegistry;
59
64
  }
60
65
  /**
61
- * User identity — provide EITHER userId OR authUrl:
66
+ * User identity — provide EITHER userId (optionally with userHash) OR authUrl:
62
67
  *
63
- * - `userId`: Client-asserted, no server verification (dev/testing only).
68
+ * - `userId` alone: Client-asserted, no server verification (dev/testing only).
69
+ * - `userId` + `userHash`: Host-brokered verified identity. Your backend
70
+ * computes userHash = HMAC-SHA256(sk_fork_key, userId) and your app passes
71
+ * both as props. Fork never touches cookies or Web Storage for identity, so
72
+ * this is the required mode for embedded/iframe contexts where third-party
73
+ * cookies are blocked (e.g. app-store review environments).
64
74
  * - `authUrl`: URL on your backend that returns `{ userId, userHash }`.
65
75
  * The SDK calls this on mount (same-origin, cookies sent automatically).
66
- * Your backend computes: userHash = HMAC-SHA256(sk_fork_key, userId).
67
- * This provides verified per-user fork isolation.
68
- * If the verified user is also a Fork tenant operator (their email matches
69
- * a fork_users row with a user_roles entry on this tenant), the SDK
70
- * transparently enters admin mode and acts as their mapped end-user set
71
- * the mapping in Fork's Team Settings End user.
76
+ * Relies on the host's cookie session, so it does not work where the host
77
+ * page's cookies are third-party prefer the userHash prop mode there.
78
+ *
79
+ * In either verified mode, if the user is also a Fork tenant operator (their
80
+ * email matches a fork_users row with a user_roles entry on this tenant), the
81
+ * SDK transparently enters admin mode and acts as their mapped end-user — set
82
+ * the mapping in Fork's Team Settings → End user.
72
83
  */
73
84
  type ForkProviderProps = ForkProviderBase & ({
74
85
  userId: string;
86
+ userHash?: string;
75
87
  authUrl?: never;
76
88
  } | {
77
89
  authUrl: string;
78
90
  userId?: never;
91
+ userHash?: never;
79
92
  });
80
93
  interface ForkBoundaryRegistration {
81
94
  id: string;
@@ -730,6 +743,8 @@ interface ManifestEntry {
730
743
  legacyBundleUrl: string | null;
731
744
  buildId: string | null;
732
745
  updatedAt: string;
746
+ /** Author-only, once-ever reveal-animation flag (server-tracked). */
747
+ revealPending?: boolean;
733
748
  }
734
749
  interface ManifestModuleEntry {
735
750
  forkId: string;
package/dist/index.d.ts CHANGED
@@ -15,6 +15,11 @@ interface Fork {
15
15
  summary?: string;
16
16
  /** Rough estimate in minutes for how long the agent will take. Set after the Haiku title call resolves. */
17
17
  estimateMinutes?: number;
18
+ /** True when this user authored the fork and hasn't seen its one-shot
19
+ * reveal animation yet (server-tracked via forks.reveal_seen_at, once
20
+ * ever across tabs/devices). Set client-side on live SSE completion;
21
+ * DirectForkSlot plays the reveal and records it via POST /forks/reveals. */
22
+ revealPending?: boolean;
18
23
  createdAt: string;
19
24
  completedAt?: string;
20
25
  error?: string;
@@ -58,24 +63,32 @@ interface ForkProviderBase {
58
63
  shared?: ForkSharedRegistry;
59
64
  }
60
65
  /**
61
- * User identity — provide EITHER userId OR authUrl:
66
+ * User identity — provide EITHER userId (optionally with userHash) OR authUrl:
62
67
  *
63
- * - `userId`: Client-asserted, no server verification (dev/testing only).
68
+ * - `userId` alone: Client-asserted, no server verification (dev/testing only).
69
+ * - `userId` + `userHash`: Host-brokered verified identity. Your backend
70
+ * computes userHash = HMAC-SHA256(sk_fork_key, userId) and your app passes
71
+ * both as props. Fork never touches cookies or Web Storage for identity, so
72
+ * this is the required mode for embedded/iframe contexts where third-party
73
+ * cookies are blocked (e.g. app-store review environments).
64
74
  * - `authUrl`: URL on your backend that returns `{ userId, userHash }`.
65
75
  * The SDK calls this on mount (same-origin, cookies sent automatically).
66
- * Your backend computes: userHash = HMAC-SHA256(sk_fork_key, userId).
67
- * This provides verified per-user fork isolation.
68
- * If the verified user is also a Fork tenant operator (their email matches
69
- * a fork_users row with a user_roles entry on this tenant), the SDK
70
- * transparently enters admin mode and acts as their mapped end-user set
71
- * the mapping in Fork's Team Settings End user.
76
+ * Relies on the host's cookie session, so it does not work where the host
77
+ * page's cookies are third-party prefer the userHash prop mode there.
78
+ *
79
+ * In either verified mode, if the user is also a Fork tenant operator (their
80
+ * email matches a fork_users row with a user_roles entry on this tenant), the
81
+ * SDK transparently enters admin mode and acts as their mapped end-user — set
82
+ * the mapping in Fork's Team Settings → End user.
72
83
  */
73
84
  type ForkProviderProps = ForkProviderBase & ({
74
85
  userId: string;
86
+ userHash?: string;
75
87
  authUrl?: never;
76
88
  } | {
77
89
  authUrl: string;
78
90
  userId?: never;
91
+ userHash?: never;
79
92
  });
80
93
  interface ForkBoundaryRegistration {
81
94
  id: string;
@@ -730,6 +743,8 @@ interface ManifestEntry {
730
743
  legacyBundleUrl: string | null;
731
744
  buildId: string | null;
732
745
  updatedAt: string;
746
+ /** Author-only, once-ever reveal-animation flag (server-tracked). */
747
+ revealPending?: boolean;
733
748
  }
734
749
  interface ManifestModuleEntry {
735
750
  forkId: string;