@pluno/product-agent-web 0.1.20 → 0.1.22
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.ts +2 -0
- package/dist/product-agent-sdk.js +49 -43
- package/dist/product-agent-widget.js +1238 -613
- package/dist/shareCard.d.ts +29 -0
- package/dist/widget.d.ts +11 -0
- package/package.json +1 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type ProductAgentShareMessage = {
|
|
2
|
+
id: string;
|
|
3
|
+
role: "user" | "assistant" | "tool" | "system";
|
|
4
|
+
content: string;
|
|
5
|
+
toolName?: string;
|
|
6
|
+
callId?: string;
|
|
7
|
+
};
|
|
8
|
+
export type ProductAgentShareSessionItem = {
|
|
9
|
+
id: string;
|
|
10
|
+
data: unknown;
|
|
11
|
+
};
|
|
12
|
+
export type ProductAgentShareCandidate = {
|
|
13
|
+
id: string;
|
|
14
|
+
userPrompt: string;
|
|
15
|
+
assistantAnswer: string;
|
|
16
|
+
};
|
|
17
|
+
export type ProductAgentSocialPostDraft = {
|
|
18
|
+
screenshotDataUrl: string;
|
|
19
|
+
linkedinPost: string;
|
|
20
|
+
xPost: string;
|
|
21
|
+
};
|
|
22
|
+
export declare const SUGGEST_SHARE_ON_SOCIALS_TOOL_NAME = "suggest_share_on_socials";
|
|
23
|
+
export declare function findShareCandidateForAssistantMessage(messages: ProductAgentShareMessage[], assistantMessageId: string): ProductAgentShareCandidate | null;
|
|
24
|
+
export declare function findSuggestedShareCandidate(items: ProductAgentShareSessionItem[]): ProductAgentShareCandidate | null;
|
|
25
|
+
export declare function findSuggestedShareCandidateForMessages(messages: ProductAgentShareMessage[]): ProductAgentShareCandidate | null;
|
|
26
|
+
export declare function copyScreenshotImage(dataUrl: string): Promise<void>;
|
|
27
|
+
export declare function downloadScreenshotImage(dataUrl: string): Promise<void>;
|
|
28
|
+
export declare function redactPublicShareText(text: string): string;
|
|
29
|
+
export declare function stripMarkdownToPlainText(text: string): string;
|
package/dist/widget.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PlunoProductAgent, type ProductAgentInitOptions } from "./index";
|
|
2
|
+
import { type ProductAgentShareCandidate } from "./shareCard";
|
|
2
3
|
type WidgetOptions = {
|
|
3
4
|
token?: string;
|
|
4
5
|
tokenProvider?: () => Promise<string>;
|
|
@@ -17,11 +18,21 @@ type WidgetOptions = {
|
|
|
17
18
|
loginRequired?: boolean;
|
|
18
19
|
loginButtonLabel?: string;
|
|
19
20
|
onLoginClick?: () => void;
|
|
21
|
+
socialPostDraftHandler?: (candidate: ProductAgentShareCandidate) => Promise<EmbeddedSocialPostDraft>;
|
|
22
|
+
socialPostRewardsUrl?: string;
|
|
23
|
+
loadSharePromptsDisabled?: () => boolean | Promise<boolean>;
|
|
24
|
+
persistSharePromptsDisabled?: (disabled: boolean) => void | Promise<void>;
|
|
25
|
+
};
|
|
26
|
+
type EmbeddedSocialPostDraft = {
|
|
27
|
+
linkedinPost: string;
|
|
28
|
+
xPost: string;
|
|
29
|
+
screenshotDataUrl?: string;
|
|
20
30
|
};
|
|
21
31
|
export declare function createProductAgentPreviewBridgeWebSocketFactory(channelId: string): ProductAgentInitOptions["webSocketFactory"];
|
|
22
32
|
export declare function mountPlunoProductAgentWidget(options?: WidgetOptions): Promise<{
|
|
23
33
|
agent: PlunoProductAgent;
|
|
24
34
|
updateAppearance: (appearance: Pick<WidgetOptions, "accentColor" | "colorScheme" | "fontFamily" | "scribbleStyle">) => void;
|
|
35
|
+
openPanel: () => void;
|
|
25
36
|
destroy: () => void;
|
|
26
37
|
}>;
|
|
27
38
|
export {};
|
package/package.json
CHANGED