@webless/agent 0.6.11 → 0.7.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.
- package/dist/{chunk-YNF2UPGJ.js → chunk-CYI3OSWG.js} +1494 -516
- package/dist/chunk-CYI3OSWG.js.map +1 -0
- package/dist/embed.cjs +1565 -565
- package/dist/embed.cjs.map +1 -1
- package/dist/embed.css +352 -3
- package/dist/embed.css.map +1 -1
- package/dist/embed.d.cts +2 -2
- package/dist/embed.d.ts +2 -2
- package/dist/embed.js +27 -2
- package/dist/embed.js.map +1 -1
- package/dist/index.cjs +53 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +53 -0
- package/dist/index.js.map +1 -1
- package/dist/{manifest-Ulpp3ffe.d.cts → manifest-BNJQfEow.d.cts} +12 -1
- package/dist/{manifest-Ulpp3ffe.d.ts → manifest-BNJQfEow.d.ts} +12 -1
- package/dist/react.cjs +1545 -560
- package/dist/react.cjs.map +1 -1
- package/dist/react.css +352 -3
- package/dist/react.css.map +1 -1
- package/dist/react.d.cts +62 -5
- package/dist/react.d.ts +62 -5
- package/dist/react.js +11 -1
- package/package.json +1 -1
- package/dist/chunk-YNF2UPGJ.js.map +0 -1
package/dist/react.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export { A as AGENT_STRUCTURED_TOOL_INPUT_HEADER, a as AGENT_STRUCTURED_TOOL_INPUT_SCHEMA_VERSION,
|
|
2
|
+
import { e as AgentIndexVersion, k as AgentPlacementConfig, d as AgentColorScheme, c as AgentBrandingConfig, b as AgentAnalyticsConfig, S as VisitorToolResultRegistry, i as AgentMessageFeedback, T as ToolStep, m as AgentRailState, n as AgentRailTheme, F as ConversationMessage, h as AgentInputResponse, z as AgentToolUiSurface, t as AgentToolResultJsonValue, H as FollowUpSuggestion, l as AgentRailPhase, V as VisitorBooking } from './manifest-BNJQfEow.js';
|
|
3
|
+
export { A as AGENT_STRUCTURED_TOOL_INPUT_HEADER, a as AGENT_STRUCTURED_TOOL_INPUT_SCHEMA_VERSION, f as AgentInputOption, g as AgentInputRequest, o as AgentStructuredToolInput, s as AgentToolResult, u as AgentToolUiAction, v as AgentToolUiField, w as AgentToolUiFieldKind, x as AgentToolUiOption, y as AgentToolUiStep, B as AssistEdgeTab, C as AssistTabSide, D as AssistTabVariant, E as Citation, G as DEFAULT_AGENT_PLACEMENT, J as JourneyContext, R as ResolvedVisitorToolResultPresentation, I as ToolStepState, K as VisitorBookingResultPresentation, L as VisitorToolInputResultPresentation, M as VisitorToolResultLink, O as VisitorToolResultPresentation, P as VisitorToolResultPresenter, Q as VisitorToolResultPresenterOutput, U as builtInVisitorToolResultRegistry, W as defaultAgentRailTheme, X as defaultDarkAgentRailTheme, Y as formatAgentStructuredToolInput, Z as normalizeAgentPlacement, $ as presentVisitorToolResult } from './manifest-BNJQfEow.js';
|
|
4
4
|
|
|
5
5
|
type AgentWidgetProps = {
|
|
6
6
|
indexId: string;
|
|
@@ -15,9 +15,23 @@ type AgentWidgetProps = {
|
|
|
15
15
|
registerPanelController?: boolean;
|
|
16
16
|
colorScheme?: AgentColorScheme;
|
|
17
17
|
branding?: AgentBrandingConfig;
|
|
18
|
+
analytics?: AgentAnalyticsConfig;
|
|
18
19
|
toolResultRegistry?: VisitorToolResultRegistry;
|
|
19
20
|
};
|
|
20
|
-
declare function AgentWidget({ indexId, customerId, getUnpublishedPreviewGrant, previewBuildId, version, runtimeOrigin, placement: placementInput, defaultCollapsed, pageShift, registerPanelController, colorScheme, branding, toolResultRegistry, }: AgentWidgetProps): react.JSX.Element;
|
|
21
|
+
declare function AgentWidget({ indexId, customerId, getUnpublishedPreviewGrant, previewBuildId, version, runtimeOrigin, placement: placementInput, defaultCollapsed, pageShift, registerPanelController, colorScheme, branding, analytics, toolResultRegistry, }: AgentWidgetProps): react.JSX.Element;
|
|
22
|
+
|
|
23
|
+
declare function MessageActions({ answeredAt, copyText, disabled, onOpenReceipt, onRegenerate, onFeedback, readAloud, receiptSteps, speechText, }: {
|
|
24
|
+
answeredAt?: number;
|
|
25
|
+
copyText: string;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
onOpenReceipt?: () => void;
|
|
28
|
+
onRegenerate?: () => void;
|
|
29
|
+
onFeedback?: (rating: AgentMessageFeedback) => void;
|
|
30
|
+
readAloud?: boolean;
|
|
31
|
+
receiptBrandLabel?: string;
|
|
32
|
+
receiptSteps?: ToolStep[];
|
|
33
|
+
speechText?: string;
|
|
34
|
+
}): react.JSX.Element;
|
|
21
35
|
|
|
22
36
|
type AgentRailProps = {
|
|
23
37
|
state: AgentRailState;
|
|
@@ -26,6 +40,9 @@ type AgentRailProps = {
|
|
|
26
40
|
brandLabel?: string;
|
|
27
41
|
brandLogoUrl?: string;
|
|
28
42
|
poweredByLabel?: string;
|
|
43
|
+
disclaimerLabel?: string | null | undefined;
|
|
44
|
+
answerReceipt?: boolean;
|
|
45
|
+
readAloud?: boolean;
|
|
29
46
|
composerPlaceholder?: string;
|
|
30
47
|
mobileFullscreen?: boolean;
|
|
31
48
|
expanded?: boolean;
|
|
@@ -34,6 +51,8 @@ type AgentRailProps = {
|
|
|
34
51
|
onExpandToggle?: () => void;
|
|
35
52
|
onReset?: () => void;
|
|
36
53
|
onRetry?: () => void;
|
|
54
|
+
onRegenerate?: () => void;
|
|
55
|
+
onFeedback?: (rating: AgentMessageFeedback, message: ConversationMessage) => void;
|
|
37
56
|
onSubmit?: (message: string) => void;
|
|
38
57
|
onFollowUpSelect?: (label: string) => void;
|
|
39
58
|
onBook?: (input: {
|
|
@@ -43,7 +62,7 @@ type AgentRailProps = {
|
|
|
43
62
|
onInputResponse?: (response: AgentInputResponse) => void;
|
|
44
63
|
onToolInput?: (surface: AgentToolUiSurface, values: Record<string, AgentToolResultJsonValue>) => void;
|
|
45
64
|
};
|
|
46
|
-
declare function AgentRail({ state, theme, colorScheme, brandLabel, brandLogoUrl, poweredByLabel, composerPlaceholder, mobileFullscreen, expanded, onCollapse, onClose, onExpandToggle, onReset, onRetry, onSubmit, onFollowUpSelect, onBook, onInputResponse, onToolInput, }: AgentRailProps): react.JSX.Element;
|
|
65
|
+
declare function AgentRail({ state, theme, colorScheme, brandLabel, brandLogoUrl, poweredByLabel, disclaimerLabel, answerReceipt, readAloud, composerPlaceholder, mobileFullscreen, expanded, onCollapse, onClose, onExpandToggle, onReset, onRetry, onRegenerate, onFeedback, onSubmit, onFollowUpSelect, onBook, onInputResponse, onToolInput, }: AgentRailProps): react.JSX.Element;
|
|
47
66
|
|
|
48
67
|
type UseAgentChatOptions = {
|
|
49
68
|
customerId?: string;
|
|
@@ -65,6 +84,7 @@ declare function useAgentChat({ customerId, getUnpublishedPreviewGrant, indexId,
|
|
|
65
84
|
state: AgentRailState;
|
|
66
85
|
reset: () => void;
|
|
67
86
|
retry: () => Promise<void>;
|
|
87
|
+
regenerate: () => Promise<string | null>;
|
|
68
88
|
respondToInput: (response: AgentInputResponse) => Promise<void>;
|
|
69
89
|
respondToToolInput: (surface: AgentToolUiSurface, values: Record<string, AgentToolResultJsonValue>) => Promise<void>;
|
|
70
90
|
submit: (visitorText: string, options?: AgentChatSubmitOptions) => Promise<string | null>;
|
|
@@ -77,4 +97,41 @@ declare function hasVisitorMessages(messages: ConversationMessage[]): boolean;
|
|
|
77
97
|
declare function createIdleSuggestions(): FollowUpSuggestion[];
|
|
78
98
|
declare function isAgentBusy(phase: AgentRailPhase): phase is "thinking" | "running-tools" | "streaming";
|
|
79
99
|
|
|
80
|
-
|
|
100
|
+
declare const AGENT_ANSWER_FEEDBACK_EVENT_TYPE = "agent_answer_feedback";
|
|
101
|
+
/** The visitor question that produced the rated agent answer. */
|
|
102
|
+
declare function findPrecedingVisitorText(messages: readonly ConversationMessage[], agentMessageId: string): string | undefined;
|
|
103
|
+
declare function buildAgentAnswerFeedbackEvent(input: {
|
|
104
|
+
agentSessionId?: string | undefined;
|
|
105
|
+
analytics: AgentAnalyticsConfig;
|
|
106
|
+
answer?: string | undefined;
|
|
107
|
+
indexId: string;
|
|
108
|
+
messageId: string;
|
|
109
|
+
page: string;
|
|
110
|
+
query?: string | undefined;
|
|
111
|
+
rating: AgentMessageFeedback;
|
|
112
|
+
version: AgentIndexVersion;
|
|
113
|
+
visitorSessionId: string;
|
|
114
|
+
}): {
|
|
115
|
+
readonly answer?: string | undefined;
|
|
116
|
+
readonly query?: string | undefined;
|
|
117
|
+
readonly agent_session_id?: string | undefined;
|
|
118
|
+
readonly event_type: "agent_answer_feedback";
|
|
119
|
+
readonly company: string;
|
|
120
|
+
readonly session_id: string;
|
|
121
|
+
readonly page: string;
|
|
122
|
+
readonly timestamp: number;
|
|
123
|
+
readonly tracking_consent: boolean;
|
|
124
|
+
readonly feedback_value: 1 | -1;
|
|
125
|
+
readonly feedback_rating: "helpful" | "not_helpful";
|
|
126
|
+
readonly surface: "agent_panel";
|
|
127
|
+
readonly index_id: string;
|
|
128
|
+
readonly index_version: AgentIndexVersion;
|
|
129
|
+
readonly message_id: string;
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* Fire-and-forget analytics POST. Analytics must never break the widget, so
|
|
133
|
+
* every failure is swallowed.
|
|
134
|
+
*/
|
|
135
|
+
declare function sendAgentAnswerFeedback(eventUrl: string, event: Record<string, unknown>): void;
|
|
136
|
+
|
|
137
|
+
export { AGENT_ANSWER_FEEDBACK_EVENT_TYPE, AgentColorScheme, AgentInputResponse, AgentMessageFeedback, AgentPlacementConfig, AgentRail, AgentRailPhase, type AgentRailProps, AgentRailState, AgentRailTheme, AgentToolUiSurface, AgentWidget, type AgentWidgetProps, ConversationMessage, FollowUpSuggestion, MessageActions, ToolStep, type UseAgentChatOptions, VisitorToolResultRegistry, buildAgentAnswerFeedbackEvent, createIdleSuggestions, findPrecedingVisitorText, hasVisitorMessages, isAgentBusy, sendAgentAnswerFeedback, useAgentChat };
|
package/dist/react.js
CHANGED
|
@@ -1,38 +1,48 @@
|
|
|
1
1
|
import "./react.css";
|
|
2
2
|
import {
|
|
3
|
+
AGENT_ANSWER_FEEDBACK_EVENT_TYPE,
|
|
3
4
|
AGENT_STRUCTURED_TOOL_INPUT_HEADER,
|
|
4
5
|
AGENT_STRUCTURED_TOOL_INPUT_SCHEMA_VERSION,
|
|
5
6
|
AgentRail,
|
|
6
7
|
AgentWidget,
|
|
7
8
|
AssistEdgeTab,
|
|
8
9
|
DEFAULT_AGENT_PLACEMENT,
|
|
10
|
+
MessageActions,
|
|
11
|
+
buildAgentAnswerFeedbackEvent,
|
|
9
12
|
builtInVisitorToolResultRegistry,
|
|
10
13
|
createIdleSuggestions,
|
|
11
14
|
defaultAgentRailTheme,
|
|
12
15
|
defaultDarkAgentRailTheme,
|
|
16
|
+
findPrecedingVisitorText,
|
|
13
17
|
formatAgentStructuredToolInput,
|
|
14
18
|
hasVisitorMessages,
|
|
15
19
|
isAgentBusy,
|
|
16
20
|
normalizeAgentPlacement,
|
|
17
21
|
presentVisitorToolResult,
|
|
22
|
+
sendAgentAnswerFeedback,
|
|
18
23
|
useAgentChat
|
|
19
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-CYI3OSWG.js";
|
|
20
25
|
export {
|
|
26
|
+
AGENT_ANSWER_FEEDBACK_EVENT_TYPE,
|
|
21
27
|
AGENT_STRUCTURED_TOOL_INPUT_HEADER,
|
|
22
28
|
AGENT_STRUCTURED_TOOL_INPUT_SCHEMA_VERSION,
|
|
23
29
|
AgentRail,
|
|
24
30
|
AgentWidget,
|
|
25
31
|
AssistEdgeTab,
|
|
26
32
|
DEFAULT_AGENT_PLACEMENT,
|
|
33
|
+
MessageActions,
|
|
34
|
+
buildAgentAnswerFeedbackEvent,
|
|
27
35
|
builtInVisitorToolResultRegistry,
|
|
28
36
|
createIdleSuggestions,
|
|
29
37
|
defaultAgentRailTheme,
|
|
30
38
|
defaultDarkAgentRailTheme,
|
|
39
|
+
findPrecedingVisitorText,
|
|
31
40
|
formatAgentStructuredToolInput,
|
|
32
41
|
hasVisitorMessages,
|
|
33
42
|
isAgentBusy,
|
|
34
43
|
normalizeAgentPlacement,
|
|
35
44
|
presentVisitorToolResult,
|
|
45
|
+
sendAgentAnswerFeedback,
|
|
36
46
|
useAgentChat
|
|
37
47
|
};
|
|
38
48
|
//# sourceMappingURL=react.js.map
|