@pluno/product-agent-web 0.1.66 → 0.1.68
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/INTEGRATION.md +41 -3
- package/README.md +37 -1
- package/dist/index.d.ts +36 -2
- package/dist/product-agent-sdk.js +1053 -609
- package/dist/product-agent-widget.js +1226 -1138
- package/dist/transportIdentity.d.ts +26 -0
- package/dist/widget.d.ts +13 -11
- package/package.json +1 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
type TransportIdentityMessage = {
|
|
2
|
+
type: "probe" | "contender";
|
|
3
|
+
transportId: string;
|
|
4
|
+
senderId: string;
|
|
5
|
+
targetId?: string;
|
|
6
|
+
established?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export type TransportIdentityChannel = {
|
|
9
|
+
postMessage: (message: TransportIdentityMessage) => void;
|
|
10
|
+
subscribe: (listener: (message: TransportIdentityMessage) => void) => () => void;
|
|
11
|
+
close: () => void;
|
|
12
|
+
};
|
|
13
|
+
export type TransportIdentityLease = {
|
|
14
|
+
transportId: string;
|
|
15
|
+
release: () => void;
|
|
16
|
+
};
|
|
17
|
+
type AcquireTransportIdentityOptions = {
|
|
18
|
+
storage: Pick<Storage, "getItem" | "setItem">;
|
|
19
|
+
channel: TransportIdentityChannel;
|
|
20
|
+
randomUUID: () => string;
|
|
21
|
+
settle: () => Promise<void>;
|
|
22
|
+
};
|
|
23
|
+
export declare function acquireTransportIdentity(options?: AcquireTransportIdentityOptions): Promise<TransportIdentityLease>;
|
|
24
|
+
export declare function acquireBrowserTransportIdentity(): Promise<TransportIdentityLease>;
|
|
25
|
+
export declare function createLocalStorageTransportIdentityChannel(): TransportIdentityChannel;
|
|
26
|
+
export {};
|
package/dist/widget.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PlunoProductAgent, type ProductAgentInitOptions } from "./index";
|
|
2
2
|
import { type ProductAgentShareCandidate } from "./shareCard";
|
|
3
3
|
import { type ActiveUsersCounterValue } from "./activeUsersCounter";
|
|
4
|
-
type
|
|
4
|
+
export type ProductAgentWidgetOptions = {
|
|
5
5
|
token?: string;
|
|
6
6
|
tokenProvider?: () => Promise<string>;
|
|
7
7
|
tokenEndpoint?: string;
|
|
@@ -50,7 +50,7 @@ type WidgetTaskNotificationsBridge = {
|
|
|
50
50
|
enable: () => Promise<boolean>;
|
|
51
51
|
dismissForever: () => Promise<void>;
|
|
52
52
|
};
|
|
53
|
-
type ProductAgentWidgetBillingStatus = {
|
|
53
|
+
export type ProductAgentWidgetBillingStatus = {
|
|
54
54
|
creditsUsed: number | null;
|
|
55
55
|
creditLimit: number | null;
|
|
56
56
|
creditsRemaining: number | null;
|
|
@@ -59,19 +59,21 @@ type ProductAgentWidgetBillingStatus = {
|
|
|
59
59
|
pricingUrl: string;
|
|
60
60
|
earnCreditsUrl: string;
|
|
61
61
|
};
|
|
62
|
+
export type ProductAgentWidgetHandle = {
|
|
63
|
+
agent: PlunoProductAgent;
|
|
64
|
+
host: HTMLElement;
|
|
65
|
+
updateAppearance: (appearance: Pick<ProductAgentWidgetOptions, "accentColor" | "colorScheme" | "fontFamily" | "scribbleStyle">) => void;
|
|
66
|
+
updateBillingStatus: (billingStatus: ProductAgentWidgetBillingStatus | null | undefined) => void;
|
|
67
|
+
updateAuthGate: (options: Pick<ProductAgentWidgetOptions, "loginRequired" | "loginButtonLabel" | "loginUrl" | "signupRequired" | "signupButtonLabel" | "signupUrl">) => void;
|
|
68
|
+
openPanel: () => void;
|
|
69
|
+
updateDisplayState: (displayState: "shown" | "minimized") => void;
|
|
70
|
+
destroy: () => void;
|
|
71
|
+
};
|
|
62
72
|
type EmbeddedSocialPostDraft = {
|
|
63
73
|
linkedinPost: string;
|
|
64
74
|
xPost: string;
|
|
65
75
|
screenshotDataUrl?: string;
|
|
66
76
|
};
|
|
67
77
|
export declare function createProductAgentPreviewBridgeWebSocketFactory(channelId: string): ProductAgentInitOptions["webSocketFactory"];
|
|
68
|
-
export declare function mountPlunoProductAgentWidget(options?:
|
|
69
|
-
agent: PlunoProductAgent;
|
|
70
|
-
updateAppearance: (appearance: Pick<WidgetOptions, "accentColor" | "colorScheme" | "fontFamily" | "scribbleStyle">) => void;
|
|
71
|
-
updateBillingStatus: (billingStatus: ProductAgentWidgetBillingStatus | null | undefined) => void;
|
|
72
|
-
updateAuthGate: (options: Pick<WidgetOptions, "loginRequired" | "loginButtonLabel" | "loginUrl" | "signupRequired" | "signupButtonLabel" | "signupUrl">) => void;
|
|
73
|
-
openPanel: () => void;
|
|
74
|
-
updateDisplayState: (displayState: "shown" | "minimized") => void;
|
|
75
|
-
destroy: () => void;
|
|
76
|
-
}>;
|
|
78
|
+
export declare function mountPlunoProductAgentWidget(options?: ProductAgentWidgetOptions): Promise<ProductAgentWidgetHandle>;
|
|
77
79
|
export {};
|
package/package.json
CHANGED