@webless/agent 0.4.1 → 0.6.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-SVWXFDV3.js → chunk-Y7Z3ZIAQ.js} +1090 -281
- package/dist/chunk-Y7Z3ZIAQ.js.map +1 -0
- package/dist/embed.cjs +1100 -296
- package/dist/embed.cjs.map +1 -1
- package/dist/embed.css +416 -205
- 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 +5 -2
- package/dist/embed.js.map +1 -1
- package/dist/index.cjs +39 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +39 -2
- package/dist/index.js.map +1 -1
- package/dist/manifest-D9V3kLCd.d.cts +183 -0
- package/dist/manifest-D9V3kLCd.d.ts +183 -0
- package/dist/react.cjs +1094 -284
- package/dist/react.cjs.map +1 -1
- package/dist/react.css +416 -205
- package/dist/react.css.map +1 -1
- package/dist/react.d.cts +14 -73
- package/dist/react.d.ts +14 -73
- package/dist/react.js +3 -1
- package/package.json +1 -1
- package/dist/chunk-SVWXFDV3.js.map +0 -1
- package/dist/manifest-C8l7WUf6.d.cts +0 -84
- package/dist/manifest-C8l7WUf6.d.ts +0 -84
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
|
|
3
|
+
type AgentIndexVersion = "published" | "unpublished";
|
|
4
|
+
|
|
5
|
+
type VisitorBooking = {
|
|
6
|
+
eventUri: string;
|
|
7
|
+
inviteeUri?: string;
|
|
8
|
+
inviteeEmail?: string;
|
|
9
|
+
startTime?: string;
|
|
10
|
+
};
|
|
11
|
+
type BookingOfferEventType = {
|
|
12
|
+
name: string;
|
|
13
|
+
uri: string;
|
|
14
|
+
duration?: number;
|
|
15
|
+
locationKind?: string;
|
|
16
|
+
location?: string;
|
|
17
|
+
};
|
|
18
|
+
type BookingOfferSlot = {
|
|
19
|
+
startTime: string;
|
|
20
|
+
eventTypeUri?: string;
|
|
21
|
+
};
|
|
22
|
+
type BookingOffer = {
|
|
23
|
+
type: "booking_offer";
|
|
24
|
+
eventTypes: BookingOfferEventType[];
|
|
25
|
+
slots: BookingOfferSlot[];
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
type ToolStepState = "completed" | "active" | "pending" | "error";
|
|
29
|
+
type ToolStep = {
|
|
30
|
+
id: string;
|
|
31
|
+
kind: "planning" | "search" | "specialist";
|
|
32
|
+
label: string;
|
|
33
|
+
state: ToolStepState;
|
|
34
|
+
detail?: string;
|
|
35
|
+
};
|
|
36
|
+
type Citation = {
|
|
37
|
+
id: string;
|
|
38
|
+
label: string;
|
|
39
|
+
url: string;
|
|
40
|
+
};
|
|
41
|
+
type FollowUpSuggestion = {
|
|
42
|
+
id: string;
|
|
43
|
+
label: string;
|
|
44
|
+
};
|
|
45
|
+
type JourneyContext = {
|
|
46
|
+
id: string;
|
|
47
|
+
name: string;
|
|
48
|
+
currentStep?: number;
|
|
49
|
+
totalSteps?: number;
|
|
50
|
+
stepLabel?: string;
|
|
51
|
+
};
|
|
52
|
+
type ConversationMessage = {
|
|
53
|
+
id: string;
|
|
54
|
+
role: "visitor";
|
|
55
|
+
text: string;
|
|
56
|
+
createdAt: number;
|
|
57
|
+
runtimeText?: string;
|
|
58
|
+
} | {
|
|
59
|
+
id: string;
|
|
60
|
+
role: "agent";
|
|
61
|
+
text: string;
|
|
62
|
+
createdAt: number;
|
|
63
|
+
citations?: Citation[];
|
|
64
|
+
toolReceipts?: string[];
|
|
65
|
+
streaming?: boolean;
|
|
66
|
+
};
|
|
67
|
+
type AgentRailPhase = "idle" | "thinking" | "running-tools" | "streaming" | "error" | "complete";
|
|
68
|
+
type AgentRailState = {
|
|
69
|
+
phase: AgentRailPhase;
|
|
70
|
+
messages: ConversationMessage[];
|
|
71
|
+
toolSteps: ToolStep[];
|
|
72
|
+
journey: JourneyContext | null;
|
|
73
|
+
followUps: FollowUpSuggestion[];
|
|
74
|
+
streamingText: string;
|
|
75
|
+
pendingOffer: BookingOffer | null;
|
|
76
|
+
error: string | null;
|
|
77
|
+
};
|
|
78
|
+
type AgentRailTheme = {
|
|
79
|
+
railMaxWidth: string;
|
|
80
|
+
brand: string;
|
|
81
|
+
brandSoft: string;
|
|
82
|
+
brandDeep: string;
|
|
83
|
+
surface: string;
|
|
84
|
+
surfaceMuted: string;
|
|
85
|
+
text: string;
|
|
86
|
+
textMuted: string;
|
|
87
|
+
textSubtle: string;
|
|
88
|
+
border: string;
|
|
89
|
+
visitorBubble: string;
|
|
90
|
+
visitorText: string;
|
|
91
|
+
success: string;
|
|
92
|
+
danger: string;
|
|
93
|
+
fontBody: string;
|
|
94
|
+
fontDisplay: string;
|
|
95
|
+
};
|
|
96
|
+
type AgentColorScheme = "auto" | "light" | "dark";
|
|
97
|
+
declare const defaultAgentRailTheme: AgentRailTheme;
|
|
98
|
+
declare const defaultDarkAgentRailTheme: AgentRailTheme;
|
|
99
|
+
|
|
100
|
+
type AssistTabVariant = "outline" | "ask" | "fill";
|
|
101
|
+
type AssistTabSide = "right" | "left" | "top" | "bottom";
|
|
102
|
+
declare function AssistEdgeTab({ variant, side, along, inset, visible, label, customIconUrl, logoUrl, brandColor, brandForeground, borderColor, fontFamily, mobile, surfaceColor, textColor, colorScheme, onOpen, }: {
|
|
103
|
+
variant: AssistTabVariant;
|
|
104
|
+
side: AssistTabSide;
|
|
105
|
+
along: number;
|
|
106
|
+
inset: number;
|
|
107
|
+
visible: boolean;
|
|
108
|
+
label?: string;
|
|
109
|
+
customIconUrl?: string;
|
|
110
|
+
logoUrl?: string;
|
|
111
|
+
brandColor?: string;
|
|
112
|
+
brandForeground?: string;
|
|
113
|
+
borderColor?: string;
|
|
114
|
+
fontFamily?: string;
|
|
115
|
+
mobile?: boolean;
|
|
116
|
+
surfaceColor?: string;
|
|
117
|
+
textColor?: string;
|
|
118
|
+
colorScheme?: AgentColorScheme;
|
|
119
|
+
onOpen: () => void;
|
|
120
|
+
}): react.JSX.Element;
|
|
121
|
+
|
|
122
|
+
type AgentPlacementConfig = {
|
|
123
|
+
side: AssistTabSide;
|
|
124
|
+
along: number;
|
|
125
|
+
inset: number;
|
|
126
|
+
variant: AssistTabVariant;
|
|
127
|
+
};
|
|
128
|
+
declare const DEFAULT_AGENT_PLACEMENT: AgentPlacementConfig;
|
|
129
|
+
declare function normalizeAgentPlacement(placement?: Partial<AgentPlacementConfig>): AgentPlacementConfig;
|
|
130
|
+
|
|
131
|
+
type AgentMountStrategy = "body" | "selector" | "script-parent";
|
|
132
|
+
type AgentTabVariant = AgentPlacementConfig["variant"];
|
|
133
|
+
type AgentTabSide = AgentPlacementConfig["side"];
|
|
134
|
+
type AgentBrandingConfig = {
|
|
135
|
+
agentName?: string;
|
|
136
|
+
tabLabel?: string;
|
|
137
|
+
tabIconUrl?: string;
|
|
138
|
+
logoUrl?: string;
|
|
139
|
+
greeting?: string;
|
|
140
|
+
composerPlaceholder?: string;
|
|
141
|
+
poweredByLabel?: string;
|
|
142
|
+
fontFamily?: string;
|
|
143
|
+
colors?: {
|
|
144
|
+
primary?: string;
|
|
145
|
+
primarySoft?: string;
|
|
146
|
+
primaryForeground?: string;
|
|
147
|
+
surface?: string;
|
|
148
|
+
surfaceMuted?: string;
|
|
149
|
+
text?: string;
|
|
150
|
+
textMuted?: string;
|
|
151
|
+
border?: string;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
type AgentTagManifest = {
|
|
155
|
+
customerId: string;
|
|
156
|
+
indexId: string;
|
|
157
|
+
runtimeOrigin?: string;
|
|
158
|
+
version?: AgentIndexVersion;
|
|
159
|
+
mount?: {
|
|
160
|
+
selector?: string;
|
|
161
|
+
strategy?: AgentMountStrategy;
|
|
162
|
+
};
|
|
163
|
+
placement?: Partial<AgentPlacementConfig>;
|
|
164
|
+
pageShift?: boolean;
|
|
165
|
+
branding?: AgentBrandingConfig;
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
declare function normalizeAgentTagManifest(manifest: AgentTagManifest): {
|
|
169
|
+
branding?: AgentBrandingConfig | undefined;
|
|
170
|
+
customerId: string;
|
|
171
|
+
indexId: string;
|
|
172
|
+
runtimeOrigin: string;
|
|
173
|
+
version: AgentIndexVersion;
|
|
174
|
+
mount: {
|
|
175
|
+
selector: string | undefined;
|
|
176
|
+
strategy: AgentMountStrategy;
|
|
177
|
+
};
|
|
178
|
+
placement: AgentPlacementConfig;
|
|
179
|
+
pageShift: boolean;
|
|
180
|
+
};
|
|
181
|
+
type NormalizedAgentTagManifest = ReturnType<typeof normalizeAgentTagManifest>;
|
|
182
|
+
|
|
183
|
+
export { type AgentBrandingConfig as A, type Citation as C, DEFAULT_AGENT_PLACEMENT as D, type FollowUpSuggestion as F, type JourneyContext as J, type NormalizedAgentTagManifest as N, type ToolStep as T, type VisitorBooking as V, type AgentColorScheme as a, type AgentIndexVersion as b, type AgentMountStrategy as c, type AgentPlacementConfig as d, type AgentRailPhase as e, type AgentRailState as f, type AgentRailTheme as g, type AgentTabSide as h, type AgentTabVariant as i, type AgentTagManifest as j, AssistEdgeTab as k, type AssistTabSide as l, type AssistTabVariant as m, type ConversationMessage as n, type ToolStepState as o, defaultAgentRailTheme as p, defaultDarkAgentRailTheme as q, normalizeAgentPlacement as r, normalizeAgentTagManifest as s };
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
|
|
3
|
+
type AgentIndexVersion = "published" | "unpublished";
|
|
4
|
+
|
|
5
|
+
type VisitorBooking = {
|
|
6
|
+
eventUri: string;
|
|
7
|
+
inviteeUri?: string;
|
|
8
|
+
inviteeEmail?: string;
|
|
9
|
+
startTime?: string;
|
|
10
|
+
};
|
|
11
|
+
type BookingOfferEventType = {
|
|
12
|
+
name: string;
|
|
13
|
+
uri: string;
|
|
14
|
+
duration?: number;
|
|
15
|
+
locationKind?: string;
|
|
16
|
+
location?: string;
|
|
17
|
+
};
|
|
18
|
+
type BookingOfferSlot = {
|
|
19
|
+
startTime: string;
|
|
20
|
+
eventTypeUri?: string;
|
|
21
|
+
};
|
|
22
|
+
type BookingOffer = {
|
|
23
|
+
type: "booking_offer";
|
|
24
|
+
eventTypes: BookingOfferEventType[];
|
|
25
|
+
slots: BookingOfferSlot[];
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
type ToolStepState = "completed" | "active" | "pending" | "error";
|
|
29
|
+
type ToolStep = {
|
|
30
|
+
id: string;
|
|
31
|
+
kind: "planning" | "search" | "specialist";
|
|
32
|
+
label: string;
|
|
33
|
+
state: ToolStepState;
|
|
34
|
+
detail?: string;
|
|
35
|
+
};
|
|
36
|
+
type Citation = {
|
|
37
|
+
id: string;
|
|
38
|
+
label: string;
|
|
39
|
+
url: string;
|
|
40
|
+
};
|
|
41
|
+
type FollowUpSuggestion = {
|
|
42
|
+
id: string;
|
|
43
|
+
label: string;
|
|
44
|
+
};
|
|
45
|
+
type JourneyContext = {
|
|
46
|
+
id: string;
|
|
47
|
+
name: string;
|
|
48
|
+
currentStep?: number;
|
|
49
|
+
totalSteps?: number;
|
|
50
|
+
stepLabel?: string;
|
|
51
|
+
};
|
|
52
|
+
type ConversationMessage = {
|
|
53
|
+
id: string;
|
|
54
|
+
role: "visitor";
|
|
55
|
+
text: string;
|
|
56
|
+
createdAt: number;
|
|
57
|
+
runtimeText?: string;
|
|
58
|
+
} | {
|
|
59
|
+
id: string;
|
|
60
|
+
role: "agent";
|
|
61
|
+
text: string;
|
|
62
|
+
createdAt: number;
|
|
63
|
+
citations?: Citation[];
|
|
64
|
+
toolReceipts?: string[];
|
|
65
|
+
streaming?: boolean;
|
|
66
|
+
};
|
|
67
|
+
type AgentRailPhase = "idle" | "thinking" | "running-tools" | "streaming" | "error" | "complete";
|
|
68
|
+
type AgentRailState = {
|
|
69
|
+
phase: AgentRailPhase;
|
|
70
|
+
messages: ConversationMessage[];
|
|
71
|
+
toolSteps: ToolStep[];
|
|
72
|
+
journey: JourneyContext | null;
|
|
73
|
+
followUps: FollowUpSuggestion[];
|
|
74
|
+
streamingText: string;
|
|
75
|
+
pendingOffer: BookingOffer | null;
|
|
76
|
+
error: string | null;
|
|
77
|
+
};
|
|
78
|
+
type AgentRailTheme = {
|
|
79
|
+
railMaxWidth: string;
|
|
80
|
+
brand: string;
|
|
81
|
+
brandSoft: string;
|
|
82
|
+
brandDeep: string;
|
|
83
|
+
surface: string;
|
|
84
|
+
surfaceMuted: string;
|
|
85
|
+
text: string;
|
|
86
|
+
textMuted: string;
|
|
87
|
+
textSubtle: string;
|
|
88
|
+
border: string;
|
|
89
|
+
visitorBubble: string;
|
|
90
|
+
visitorText: string;
|
|
91
|
+
success: string;
|
|
92
|
+
danger: string;
|
|
93
|
+
fontBody: string;
|
|
94
|
+
fontDisplay: string;
|
|
95
|
+
};
|
|
96
|
+
type AgentColorScheme = "auto" | "light" | "dark";
|
|
97
|
+
declare const defaultAgentRailTheme: AgentRailTheme;
|
|
98
|
+
declare const defaultDarkAgentRailTheme: AgentRailTheme;
|
|
99
|
+
|
|
100
|
+
type AssistTabVariant = "outline" | "ask" | "fill";
|
|
101
|
+
type AssistTabSide = "right" | "left" | "top" | "bottom";
|
|
102
|
+
declare function AssistEdgeTab({ variant, side, along, inset, visible, label, customIconUrl, logoUrl, brandColor, brandForeground, borderColor, fontFamily, mobile, surfaceColor, textColor, colorScheme, onOpen, }: {
|
|
103
|
+
variant: AssistTabVariant;
|
|
104
|
+
side: AssistTabSide;
|
|
105
|
+
along: number;
|
|
106
|
+
inset: number;
|
|
107
|
+
visible: boolean;
|
|
108
|
+
label?: string;
|
|
109
|
+
customIconUrl?: string;
|
|
110
|
+
logoUrl?: string;
|
|
111
|
+
brandColor?: string;
|
|
112
|
+
brandForeground?: string;
|
|
113
|
+
borderColor?: string;
|
|
114
|
+
fontFamily?: string;
|
|
115
|
+
mobile?: boolean;
|
|
116
|
+
surfaceColor?: string;
|
|
117
|
+
textColor?: string;
|
|
118
|
+
colorScheme?: AgentColorScheme;
|
|
119
|
+
onOpen: () => void;
|
|
120
|
+
}): react.JSX.Element;
|
|
121
|
+
|
|
122
|
+
type AgentPlacementConfig = {
|
|
123
|
+
side: AssistTabSide;
|
|
124
|
+
along: number;
|
|
125
|
+
inset: number;
|
|
126
|
+
variant: AssistTabVariant;
|
|
127
|
+
};
|
|
128
|
+
declare const DEFAULT_AGENT_PLACEMENT: AgentPlacementConfig;
|
|
129
|
+
declare function normalizeAgentPlacement(placement?: Partial<AgentPlacementConfig>): AgentPlacementConfig;
|
|
130
|
+
|
|
131
|
+
type AgentMountStrategy = "body" | "selector" | "script-parent";
|
|
132
|
+
type AgentTabVariant = AgentPlacementConfig["variant"];
|
|
133
|
+
type AgentTabSide = AgentPlacementConfig["side"];
|
|
134
|
+
type AgentBrandingConfig = {
|
|
135
|
+
agentName?: string;
|
|
136
|
+
tabLabel?: string;
|
|
137
|
+
tabIconUrl?: string;
|
|
138
|
+
logoUrl?: string;
|
|
139
|
+
greeting?: string;
|
|
140
|
+
composerPlaceholder?: string;
|
|
141
|
+
poweredByLabel?: string;
|
|
142
|
+
fontFamily?: string;
|
|
143
|
+
colors?: {
|
|
144
|
+
primary?: string;
|
|
145
|
+
primarySoft?: string;
|
|
146
|
+
primaryForeground?: string;
|
|
147
|
+
surface?: string;
|
|
148
|
+
surfaceMuted?: string;
|
|
149
|
+
text?: string;
|
|
150
|
+
textMuted?: string;
|
|
151
|
+
border?: string;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
type AgentTagManifest = {
|
|
155
|
+
customerId: string;
|
|
156
|
+
indexId: string;
|
|
157
|
+
runtimeOrigin?: string;
|
|
158
|
+
version?: AgentIndexVersion;
|
|
159
|
+
mount?: {
|
|
160
|
+
selector?: string;
|
|
161
|
+
strategy?: AgentMountStrategy;
|
|
162
|
+
};
|
|
163
|
+
placement?: Partial<AgentPlacementConfig>;
|
|
164
|
+
pageShift?: boolean;
|
|
165
|
+
branding?: AgentBrandingConfig;
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
declare function normalizeAgentTagManifest(manifest: AgentTagManifest): {
|
|
169
|
+
branding?: AgentBrandingConfig | undefined;
|
|
170
|
+
customerId: string;
|
|
171
|
+
indexId: string;
|
|
172
|
+
runtimeOrigin: string;
|
|
173
|
+
version: AgentIndexVersion;
|
|
174
|
+
mount: {
|
|
175
|
+
selector: string | undefined;
|
|
176
|
+
strategy: AgentMountStrategy;
|
|
177
|
+
};
|
|
178
|
+
placement: AgentPlacementConfig;
|
|
179
|
+
pageShift: boolean;
|
|
180
|
+
};
|
|
181
|
+
type NormalizedAgentTagManifest = ReturnType<typeof normalizeAgentTagManifest>;
|
|
182
|
+
|
|
183
|
+
export { type AgentBrandingConfig as A, type Citation as C, DEFAULT_AGENT_PLACEMENT as D, type FollowUpSuggestion as F, type JourneyContext as J, type NormalizedAgentTagManifest as N, type ToolStep as T, type VisitorBooking as V, type AgentColorScheme as a, type AgentIndexVersion as b, type AgentMountStrategy as c, type AgentPlacementConfig as d, type AgentRailPhase as e, type AgentRailState as f, type AgentRailTheme as g, type AgentTabSide as h, type AgentTabVariant as i, type AgentTagManifest as j, AssistEdgeTab as k, type AssistTabSide as l, type AssistTabVariant as m, type ConversationMessage as n, type ToolStepState as o, defaultAgentRailTheme as p, defaultDarkAgentRailTheme as q, normalizeAgentPlacement as r, normalizeAgentTagManifest as s };
|