obi-sdk 0.19.38-beta.1 → 0.19.38-beta.2

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/src/sdk.d.ts CHANGED
@@ -13,12 +13,6 @@ export type ObiSDKEvents = {
13
13
  text: string;
14
14
  autoCloseMs?: number;
15
15
  }) => void;
16
- engagementSessionStarted: (payload: {
17
- sessionCount: number;
18
- lastSessionStartAt: number;
19
- lastActivityAt: number;
20
- scopeKey: string;
21
- }) => void;
22
16
  };
23
17
  export type InitialiseArgs = {
24
18
  queuedCommands?: Command[];
@@ -36,28 +30,17 @@ export declare class ObiSDK extends EventEmitter<ObiSDKEvents> {
36
30
  private commandQueue;
37
31
  /** HACK: Need to prevent initialisation from being called if resumed. */
38
32
  private _resumed;
39
- private _engagementScopeKey;
40
- private _engagementInitialised;
41
- /** Guard to avoid multiple prompts within the same session edge */
42
- private _engagementPromptedAtSessionCount;
43
33
  /**
44
34
  * Creates a client that should persist for the lifetime of the SDK.
45
35
  * Resumes an ongoing session if one exists.
46
36
  */
47
37
  constructor(appToken?: string);
48
38
  createClient(appToken: string): Promise<void>;
49
- private _maybeInitEngagement;
50
- private _attachEngagementLifecycle;
51
- /**
52
- * Compute which engagement level applies for the given cumulative session count.
53
- * Returns the style ("modal" | "popover") or null if no level applies.
54
- */
55
- private _engagementStyleForSession;
56
39
  /**
57
- * Potentially show an engagement prompt for the given sessionCount per configured levels.
58
- * Obeys stop conditions and ensures idempotence within the same session.
40
+ * Act on server-provided engagement.style when available, respecting stop conditions
41
+ * and URL blacklist gating.
59
42
  */
60
- private _maybePromptEngagement;
43
+ private _maybeActOnServerEngagement;
61
44
  initialise(args?: InitialiseArgs): Promise<void>;
62
45
  /**
63
46
  * Update the SDK configuration. This is typically called before a plan starts,
@@ -122,11 +105,4 @@ export declare class ObiSDK extends EventEmitter<ObiSDKEvents> {
122
105
  captureScreen(): Promise<string>;
123
106
  save(): void;
124
107
  load(): string | null;
125
- /** Read-only helper for engagement storage info for current scope */
126
- getEngagementInfo(): {
127
- sessionCount: number;
128
- lastActivityAt: number | null;
129
- lastSessionStartAt: number | null;
130
- scopeKey: string | null;
131
- };
132
108
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "obi-sdk",
3
- "version": "0.19.38-beta.1",
3
+ "version": "0.19.38-beta.2",
4
4
  "description": "JavaScript SDK for Obi",
5
5
  "type": "module",
6
6
  "main": "dist/obi-sdk.umd.js",
@@ -1 +0,0 @@
1
- export {};
@@ -1,16 +0,0 @@
1
- import type { Identity } from "@obi/obi-client";
2
- export type EngagementState = {
3
- lastActivityAt: number;
4
- lastSessionStartAt?: number;
5
- sessionCount: number;
6
- };
7
- /**
8
- * Compute a stable per-onboardee-per-product scope key.
9
- * Prefer onboardee UUID if available, else email, else a hash of identity.
10
- * Always include product UUID (or other stable product identifier) to isolate across products.
11
- */
12
- export declare function computeScopeKey(productUuid: string | undefined | null, identity?: Identity | null): string | null;
13
- export declare function readState(scopeKey: string): EngagementState | null;
14
- export declare function writeState(scopeKey: string, state: EngagementState): void;
15
- export declare function isNewSession(now: number, lastActivityAt: number | undefined | null, thresholdMs?: number): boolean;
16
- export declare function markActivity(now: number, state: EngagementState): EngagementState;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};