@webless/agent 0.10.4 → 0.12.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/README.md +11 -0
- package/dist/{chunk-74CSWSC5.js → chunk-EVWZF34F.js} +1361 -568
- package/dist/chunk-EVWZF34F.js.map +1 -0
- package/dist/embed.cjs +1394 -601
- package/dist/embed.cjs.map +1 -1
- package/dist/embed.css +151 -0
- package/dist/embed.css.map +1 -1
- package/dist/embed.d.cts +3 -2
- package/dist/embed.d.ts +3 -2
- package/dist/embed.js +1 -1
- package/dist/index.cjs +303 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +297 -15
- package/dist/index.js.map +1 -1
- package/dist/{panel-controller-rxR75tRa.d.cts → panel-controller-CYoivbYB.d.cts} +173 -1
- package/dist/{panel-controller-rxR75tRa.d.ts → panel-controller-CYoivbYB.d.ts} +173 -1
- package/dist/presentation.cjs +3 -0
- package/dist/presentation.cjs.map +1 -1
- package/dist/presentation.d.cts +2 -1
- package/dist/presentation.d.ts +2 -1
- package/dist/presentation.js +3 -0
- package/dist/presentation.js.map +1 -1
- package/dist/react.cjs +1409 -616
- package/dist/react.cjs.map +1 -1
- package/dist/react.css +151 -0
- package/dist/react.css.map +1 -1
- package/dist/react.d.cts +126 -4
- package/dist/react.d.ts +126 -4
- package/dist/react.js +1 -1
- package/dist/{types-sLEIYDqm.d.cts → types-4lTJW5mp.d.cts} +135 -1
- package/dist/{types-sLEIYDqm.d.ts → types-4lTJW5mp.d.ts} +135 -1
- package/package.json +3 -2
- package/scripts/sync-handoff-contract.mjs +18 -0
- package/dist/chunk-74CSWSC5.js.map +0 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
1
2
|
import * as react from 'react';
|
|
2
3
|
|
|
3
4
|
declare const AGENT_TOOL_UI_SCHEMA_VERSION: "webless.tool-ui.v1";
|
|
@@ -66,7 +67,134 @@ type AgentToolResultEnvelope = {
|
|
|
66
67
|
ui?: AgentToolUiSurface;
|
|
67
68
|
};
|
|
68
69
|
|
|
70
|
+
declare const agentRuntimeHandoffEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
71
|
+
type: z.ZodLiteral<"status">;
|
|
72
|
+
status: z.ZodEnum<{
|
|
73
|
+
ai: "ai";
|
|
74
|
+
requesting: "requesting";
|
|
75
|
+
queued: "queued";
|
|
76
|
+
human: "human";
|
|
77
|
+
resolved: "resolved";
|
|
78
|
+
failed: "failed";
|
|
79
|
+
}>;
|
|
80
|
+
actor: z.ZodNullable<z.ZodObject<{
|
|
81
|
+
id: z.ZodString;
|
|
82
|
+
name: z.ZodString;
|
|
83
|
+
}, z.core.$strict>>;
|
|
84
|
+
id: z.ZodString;
|
|
85
|
+
sequence: z.ZodNumber;
|
|
86
|
+
handoffId: z.ZodString;
|
|
87
|
+
epoch: z.ZodNumber;
|
|
88
|
+
createdAt: z.ZodISODateTime;
|
|
89
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
90
|
+
type: z.ZodLiteral<"visitor.message">;
|
|
91
|
+
message: z.ZodString;
|
|
92
|
+
operationId: z.ZodString;
|
|
93
|
+
id: z.ZodString;
|
|
94
|
+
sequence: z.ZodNumber;
|
|
95
|
+
handoffId: z.ZodString;
|
|
96
|
+
epoch: z.ZodNumber;
|
|
97
|
+
createdAt: z.ZodISODateTime;
|
|
98
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
99
|
+
type: z.ZodLiteral<"human.message">;
|
|
100
|
+
message: z.ZodString;
|
|
101
|
+
actor: z.ZodObject<{
|
|
102
|
+
id: z.ZodString;
|
|
103
|
+
name: z.ZodString;
|
|
104
|
+
}, z.core.$strict>;
|
|
105
|
+
id: z.ZodString;
|
|
106
|
+
sequence: z.ZodNumber;
|
|
107
|
+
handoffId: z.ZodString;
|
|
108
|
+
epoch: z.ZodNumber;
|
|
109
|
+
createdAt: z.ZodISODateTime;
|
|
110
|
+
}, z.core.$strict>], "type">;
|
|
111
|
+
declare const agentRuntimeHandoffPageSchema: z.ZodObject<{
|
|
112
|
+
apiVersion: z.ZodLiteral<"webless.ai/agent-runtime-handoff/v1">;
|
|
113
|
+
sessionId: z.ZodString;
|
|
114
|
+
enabled: z.ZodBoolean;
|
|
115
|
+
status: z.ZodEnum<{
|
|
116
|
+
ai: "ai";
|
|
117
|
+
requesting: "requesting";
|
|
118
|
+
queued: "queued";
|
|
119
|
+
human: "human";
|
|
120
|
+
resolved: "resolved";
|
|
121
|
+
failed: "failed";
|
|
122
|
+
}>;
|
|
123
|
+
handoffId: z.ZodNullable<z.ZodString>;
|
|
124
|
+
epoch: z.ZodNumber;
|
|
125
|
+
after: z.ZodNumber;
|
|
126
|
+
cursor: z.ZodNumber;
|
|
127
|
+
hasMore: z.ZodBoolean;
|
|
128
|
+
events: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
129
|
+
type: z.ZodLiteral<"status">;
|
|
130
|
+
status: z.ZodEnum<{
|
|
131
|
+
ai: "ai";
|
|
132
|
+
requesting: "requesting";
|
|
133
|
+
queued: "queued";
|
|
134
|
+
human: "human";
|
|
135
|
+
resolved: "resolved";
|
|
136
|
+
failed: "failed";
|
|
137
|
+
}>;
|
|
138
|
+
actor: z.ZodNullable<z.ZodObject<{
|
|
139
|
+
id: z.ZodString;
|
|
140
|
+
name: z.ZodString;
|
|
141
|
+
}, z.core.$strict>>;
|
|
142
|
+
id: z.ZodString;
|
|
143
|
+
sequence: z.ZodNumber;
|
|
144
|
+
handoffId: z.ZodString;
|
|
145
|
+
epoch: z.ZodNumber;
|
|
146
|
+
createdAt: z.ZodISODateTime;
|
|
147
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
148
|
+
type: z.ZodLiteral<"visitor.message">;
|
|
149
|
+
message: z.ZodString;
|
|
150
|
+
operationId: z.ZodString;
|
|
151
|
+
id: z.ZodString;
|
|
152
|
+
sequence: z.ZodNumber;
|
|
153
|
+
handoffId: z.ZodString;
|
|
154
|
+
epoch: z.ZodNumber;
|
|
155
|
+
createdAt: z.ZodISODateTime;
|
|
156
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
157
|
+
type: z.ZodLiteral<"human.message">;
|
|
158
|
+
message: z.ZodString;
|
|
159
|
+
actor: z.ZodObject<{
|
|
160
|
+
id: z.ZodString;
|
|
161
|
+
name: z.ZodString;
|
|
162
|
+
}, z.core.$strict>;
|
|
163
|
+
id: z.ZodString;
|
|
164
|
+
sequence: z.ZodNumber;
|
|
165
|
+
handoffId: z.ZodString;
|
|
166
|
+
epoch: z.ZodNumber;
|
|
167
|
+
createdAt: z.ZodISODateTime;
|
|
168
|
+
}, z.core.$strict>], "type">>;
|
|
169
|
+
}, z.core.$strict>;
|
|
170
|
+
type AgentRuntimeHandoffEvent = z.infer<typeof agentRuntimeHandoffEventSchema>;
|
|
171
|
+
type AgentRuntimeHandoffPage = z.infer<typeof agentRuntimeHandoffPageSchema>;
|
|
172
|
+
|
|
173
|
+
type AgentHandoffCommand = {
|
|
174
|
+
operationId: string;
|
|
175
|
+
handoffId: string;
|
|
176
|
+
epoch: number;
|
|
177
|
+
};
|
|
178
|
+
type AgentHandoffClient = {
|
|
179
|
+
read(options?: {
|
|
180
|
+
after?: number;
|
|
181
|
+
signal?: AbortSignal;
|
|
182
|
+
}): Promise<AgentRuntimeHandoffPage>;
|
|
183
|
+
start(operationId: string, signal?: AbortSignal): Promise<void>;
|
|
184
|
+
send(command: AgentHandoffCommand & {
|
|
185
|
+
message: string;
|
|
186
|
+
}, signal?: AbortSignal): Promise<void>;
|
|
187
|
+
returnToAI(command: AgentHandoffCommand, signal?: AbortSignal): Promise<void>;
|
|
188
|
+
};
|
|
189
|
+
|
|
69
190
|
type AgentIndexVersion = "published" | "unpublished";
|
|
191
|
+
type AgentWorkItem = {
|
|
192
|
+
id: string;
|
|
193
|
+
kind: "planning" | "search" | "specialist" | "tool";
|
|
194
|
+
label: string;
|
|
195
|
+
state: "completed" | "active" | "pending" | "error";
|
|
196
|
+
detail?: string;
|
|
197
|
+
};
|
|
70
198
|
type AgentInputOption = {
|
|
71
199
|
id: string;
|
|
72
200
|
label: string;
|
|
@@ -103,6 +231,41 @@ type AgentToolResult = {
|
|
|
103
231
|
message: string;
|
|
104
232
|
};
|
|
105
233
|
};
|
|
234
|
+
type AgentStreamHandlers = {
|
|
235
|
+
onWork?: (item: AgentWorkItem) => void;
|
|
236
|
+
/** @deprecated Use onWork for semantic progress events. */
|
|
237
|
+
onStep?: (label: string, detail?: string) => void;
|
|
238
|
+
onDelta: (delta: string) => void;
|
|
239
|
+
onComplete?: () => void;
|
|
240
|
+
onActionResult?: (output: unknown) => void;
|
|
241
|
+
onToolResult?: (result: AgentToolResult) => void;
|
|
242
|
+
onInputRequest?: (requests: readonly AgentInputRequest[]) => void;
|
|
243
|
+
};
|
|
244
|
+
type AgentSendTurnOptions = {
|
|
245
|
+
signal?: AbortSignal;
|
|
246
|
+
handlers: AgentStreamHandlers;
|
|
247
|
+
};
|
|
248
|
+
type AgentResumeTurnOptions = AgentSendTurnOptions & {
|
|
249
|
+
initialText?: string;
|
|
250
|
+
message: string;
|
|
251
|
+
};
|
|
252
|
+
type AgentRespondTurnOptions = AgentSendTurnOptions & {
|
|
253
|
+
responses: readonly AgentInputResponse[];
|
|
254
|
+
};
|
|
255
|
+
type AgentClient = {
|
|
256
|
+
readonly handoff: AgentHandoffClient;
|
|
257
|
+
readonly indexId: string;
|
|
258
|
+
readonly version: AgentIndexVersion;
|
|
259
|
+
readonly runtimeOrigin: string;
|
|
260
|
+
readonly visitorSessionId: string;
|
|
261
|
+
sendTurn: (message: string, options: AgentSendTurnOptions) => Promise<string>;
|
|
262
|
+
regenerateTurn: (message: string, options: AgentSendTurnOptions) => Promise<string>;
|
|
263
|
+
resumeTurn: (options: AgentResumeTurnOptions) => Promise<string | null>;
|
|
264
|
+
respondTurn: (options: AgentRespondTurnOptions) => Promise<string>;
|
|
265
|
+
reset: () => void;
|
|
266
|
+
cancelActive: () => void;
|
|
267
|
+
getActiveSessionId: () => string | undefined;
|
|
268
|
+
};
|
|
106
269
|
|
|
107
270
|
type ComposerFormFieldKind = "text" | "email" | "tel" | "textarea";
|
|
108
271
|
type ComposerFormField = {
|
|
@@ -285,6 +448,15 @@ type JourneyContext = {
|
|
|
285
448
|
stepLabel?: string;
|
|
286
449
|
};
|
|
287
450
|
type ConversationMessage = {
|
|
451
|
+
id: string;
|
|
452
|
+
role: "human";
|
|
453
|
+
text: string;
|
|
454
|
+
createdAt: number;
|
|
455
|
+
representative: {
|
|
456
|
+
id: string;
|
|
457
|
+
name: string;
|
|
458
|
+
};
|
|
459
|
+
} | {
|
|
288
460
|
id: string;
|
|
289
461
|
role: "visitor";
|
|
290
462
|
text: string;
|
|
@@ -443,4 +615,4 @@ type AgentPanelSubmitOptions = {
|
|
|
443
615
|
declare function resetAgentPanel(customerId: string): void;
|
|
444
616
|
declare function submitAgentPanel(customerId: string, message: string, options?: AgentPanelSubmitOptions): Promise<string | null>;
|
|
445
617
|
|
|
446
|
-
export {
|
|
618
|
+
export { builtInVisitorToolResultRegistry as $, AGENT_STRUCTURED_TOOL_INPUT_HEADER as A, type AgentToolUiField as B, type AgentToolUiFieldKind as C, type AgentToolUiOption as D, type AgentToolUiStep as E, type AgentToolUiSurface as F, AssistEdgeTab as G, type AssistTabSide as H, type AssistTabVariant as I, type Citation as J, type ConversationMessage as K, DEFAULT_AGENT_PLACEMENT as L, type FollowUpSuggestion as M, type JourneyContext as N, type NormalizedAgentTagManifest as O, type ToolStepState as P, type VisitorBookingResultPresentation as Q, type ResolvedVisitorToolResultPresentation as R, type VisitorSearchResultPresentation as S, type ToolStep as T, type VisitorToolInputResultPresentation as U, type VisitorBooking as V, type VisitorToolResultLink as W, type VisitorToolResultPresentation as X, type VisitorToolResultPresenter as Y, type VisitorToolResultPresenterOutput as Z, type VisitorToolResultRegistry as _, AGENT_STRUCTURED_TOOL_INPUT_SCHEMA_VERSION as a, defaultAgentRailTheme as a0, defaultDarkAgentRailTheme as a1, formatAgentStructuredToolInput as a2, normalizeAgentPlacement as a3, normalizeAgentTagManifest as a4, presentVisitorToolResult as a5, resetAgentPanel as a6, submitAgentPanel as a7, type AgentAnalyticsConfig as b, type AgentBrandingConfig as c, type AgentClient as d, type AgentColorScheme as e, type AgentIndexVersion as f, type AgentInputOption as g, type AgentInputRequest as h, type AgentInputResponse as i, type AgentMessageFeedback as j, type AgentMountStrategy as k, type AgentPanelSubmitOptions as l, type AgentPlacementConfig as m, type AgentRailPhase as n, type AgentRailState as o, type AgentRailTheme as p, type AgentRuntimeHandoffEvent as q, type AgentSearchReferences as r, type AgentSearchSource as s, type AgentStructuredToolInput as t, type AgentTabSide as u, type AgentTabVariant as v, type AgentTagManifest as w, type AgentToolResult as x, type AgentToolResultJsonValue as y, type AgentToolUiAction as z };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
1
2
|
import * as react from 'react';
|
|
2
3
|
|
|
3
4
|
declare const AGENT_TOOL_UI_SCHEMA_VERSION: "webless.tool-ui.v1";
|
|
@@ -66,7 +67,134 @@ type AgentToolResultEnvelope = {
|
|
|
66
67
|
ui?: AgentToolUiSurface;
|
|
67
68
|
};
|
|
68
69
|
|
|
70
|
+
declare const agentRuntimeHandoffEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
71
|
+
type: z.ZodLiteral<"status">;
|
|
72
|
+
status: z.ZodEnum<{
|
|
73
|
+
ai: "ai";
|
|
74
|
+
requesting: "requesting";
|
|
75
|
+
queued: "queued";
|
|
76
|
+
human: "human";
|
|
77
|
+
resolved: "resolved";
|
|
78
|
+
failed: "failed";
|
|
79
|
+
}>;
|
|
80
|
+
actor: z.ZodNullable<z.ZodObject<{
|
|
81
|
+
id: z.ZodString;
|
|
82
|
+
name: z.ZodString;
|
|
83
|
+
}, z.core.$strict>>;
|
|
84
|
+
id: z.ZodString;
|
|
85
|
+
sequence: z.ZodNumber;
|
|
86
|
+
handoffId: z.ZodString;
|
|
87
|
+
epoch: z.ZodNumber;
|
|
88
|
+
createdAt: z.ZodISODateTime;
|
|
89
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
90
|
+
type: z.ZodLiteral<"visitor.message">;
|
|
91
|
+
message: z.ZodString;
|
|
92
|
+
operationId: z.ZodString;
|
|
93
|
+
id: z.ZodString;
|
|
94
|
+
sequence: z.ZodNumber;
|
|
95
|
+
handoffId: z.ZodString;
|
|
96
|
+
epoch: z.ZodNumber;
|
|
97
|
+
createdAt: z.ZodISODateTime;
|
|
98
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
99
|
+
type: z.ZodLiteral<"human.message">;
|
|
100
|
+
message: z.ZodString;
|
|
101
|
+
actor: z.ZodObject<{
|
|
102
|
+
id: z.ZodString;
|
|
103
|
+
name: z.ZodString;
|
|
104
|
+
}, z.core.$strict>;
|
|
105
|
+
id: z.ZodString;
|
|
106
|
+
sequence: z.ZodNumber;
|
|
107
|
+
handoffId: z.ZodString;
|
|
108
|
+
epoch: z.ZodNumber;
|
|
109
|
+
createdAt: z.ZodISODateTime;
|
|
110
|
+
}, z.core.$strict>], "type">;
|
|
111
|
+
declare const agentRuntimeHandoffPageSchema: z.ZodObject<{
|
|
112
|
+
apiVersion: z.ZodLiteral<"webless.ai/agent-runtime-handoff/v1">;
|
|
113
|
+
sessionId: z.ZodString;
|
|
114
|
+
enabled: z.ZodBoolean;
|
|
115
|
+
status: z.ZodEnum<{
|
|
116
|
+
ai: "ai";
|
|
117
|
+
requesting: "requesting";
|
|
118
|
+
queued: "queued";
|
|
119
|
+
human: "human";
|
|
120
|
+
resolved: "resolved";
|
|
121
|
+
failed: "failed";
|
|
122
|
+
}>;
|
|
123
|
+
handoffId: z.ZodNullable<z.ZodString>;
|
|
124
|
+
epoch: z.ZodNumber;
|
|
125
|
+
after: z.ZodNumber;
|
|
126
|
+
cursor: z.ZodNumber;
|
|
127
|
+
hasMore: z.ZodBoolean;
|
|
128
|
+
events: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
129
|
+
type: z.ZodLiteral<"status">;
|
|
130
|
+
status: z.ZodEnum<{
|
|
131
|
+
ai: "ai";
|
|
132
|
+
requesting: "requesting";
|
|
133
|
+
queued: "queued";
|
|
134
|
+
human: "human";
|
|
135
|
+
resolved: "resolved";
|
|
136
|
+
failed: "failed";
|
|
137
|
+
}>;
|
|
138
|
+
actor: z.ZodNullable<z.ZodObject<{
|
|
139
|
+
id: z.ZodString;
|
|
140
|
+
name: z.ZodString;
|
|
141
|
+
}, z.core.$strict>>;
|
|
142
|
+
id: z.ZodString;
|
|
143
|
+
sequence: z.ZodNumber;
|
|
144
|
+
handoffId: z.ZodString;
|
|
145
|
+
epoch: z.ZodNumber;
|
|
146
|
+
createdAt: z.ZodISODateTime;
|
|
147
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
148
|
+
type: z.ZodLiteral<"visitor.message">;
|
|
149
|
+
message: z.ZodString;
|
|
150
|
+
operationId: z.ZodString;
|
|
151
|
+
id: z.ZodString;
|
|
152
|
+
sequence: z.ZodNumber;
|
|
153
|
+
handoffId: z.ZodString;
|
|
154
|
+
epoch: z.ZodNumber;
|
|
155
|
+
createdAt: z.ZodISODateTime;
|
|
156
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
157
|
+
type: z.ZodLiteral<"human.message">;
|
|
158
|
+
message: z.ZodString;
|
|
159
|
+
actor: z.ZodObject<{
|
|
160
|
+
id: z.ZodString;
|
|
161
|
+
name: z.ZodString;
|
|
162
|
+
}, z.core.$strict>;
|
|
163
|
+
id: z.ZodString;
|
|
164
|
+
sequence: z.ZodNumber;
|
|
165
|
+
handoffId: z.ZodString;
|
|
166
|
+
epoch: z.ZodNumber;
|
|
167
|
+
createdAt: z.ZodISODateTime;
|
|
168
|
+
}, z.core.$strict>], "type">>;
|
|
169
|
+
}, z.core.$strict>;
|
|
170
|
+
type AgentRuntimeHandoffEvent = z.infer<typeof agentRuntimeHandoffEventSchema>;
|
|
171
|
+
type AgentRuntimeHandoffPage = z.infer<typeof agentRuntimeHandoffPageSchema>;
|
|
172
|
+
|
|
173
|
+
type AgentHandoffCommand = {
|
|
174
|
+
operationId: string;
|
|
175
|
+
handoffId: string;
|
|
176
|
+
epoch: number;
|
|
177
|
+
};
|
|
178
|
+
type AgentHandoffClient = {
|
|
179
|
+
read(options?: {
|
|
180
|
+
after?: number;
|
|
181
|
+
signal?: AbortSignal;
|
|
182
|
+
}): Promise<AgentRuntimeHandoffPage>;
|
|
183
|
+
start(operationId: string, signal?: AbortSignal): Promise<void>;
|
|
184
|
+
send(command: AgentHandoffCommand & {
|
|
185
|
+
message: string;
|
|
186
|
+
}, signal?: AbortSignal): Promise<void>;
|
|
187
|
+
returnToAI(command: AgentHandoffCommand, signal?: AbortSignal): Promise<void>;
|
|
188
|
+
};
|
|
189
|
+
|
|
69
190
|
type AgentIndexVersion = "published" | "unpublished";
|
|
191
|
+
type AgentWorkItem = {
|
|
192
|
+
id: string;
|
|
193
|
+
kind: "planning" | "search" | "specialist" | "tool";
|
|
194
|
+
label: string;
|
|
195
|
+
state: "completed" | "active" | "pending" | "error";
|
|
196
|
+
detail?: string;
|
|
197
|
+
};
|
|
70
198
|
type AgentInputOption = {
|
|
71
199
|
id: string;
|
|
72
200
|
label: string;
|
|
@@ -103,6 +231,41 @@ type AgentToolResult = {
|
|
|
103
231
|
message: string;
|
|
104
232
|
};
|
|
105
233
|
};
|
|
234
|
+
type AgentStreamHandlers = {
|
|
235
|
+
onWork?: (item: AgentWorkItem) => void;
|
|
236
|
+
/** @deprecated Use onWork for semantic progress events. */
|
|
237
|
+
onStep?: (label: string, detail?: string) => void;
|
|
238
|
+
onDelta: (delta: string) => void;
|
|
239
|
+
onComplete?: () => void;
|
|
240
|
+
onActionResult?: (output: unknown) => void;
|
|
241
|
+
onToolResult?: (result: AgentToolResult) => void;
|
|
242
|
+
onInputRequest?: (requests: readonly AgentInputRequest[]) => void;
|
|
243
|
+
};
|
|
244
|
+
type AgentSendTurnOptions = {
|
|
245
|
+
signal?: AbortSignal;
|
|
246
|
+
handlers: AgentStreamHandlers;
|
|
247
|
+
};
|
|
248
|
+
type AgentResumeTurnOptions = AgentSendTurnOptions & {
|
|
249
|
+
initialText?: string;
|
|
250
|
+
message: string;
|
|
251
|
+
};
|
|
252
|
+
type AgentRespondTurnOptions = AgentSendTurnOptions & {
|
|
253
|
+
responses: readonly AgentInputResponse[];
|
|
254
|
+
};
|
|
255
|
+
type AgentClient = {
|
|
256
|
+
readonly handoff: AgentHandoffClient;
|
|
257
|
+
readonly indexId: string;
|
|
258
|
+
readonly version: AgentIndexVersion;
|
|
259
|
+
readonly runtimeOrigin: string;
|
|
260
|
+
readonly visitorSessionId: string;
|
|
261
|
+
sendTurn: (message: string, options: AgentSendTurnOptions) => Promise<string>;
|
|
262
|
+
regenerateTurn: (message: string, options: AgentSendTurnOptions) => Promise<string>;
|
|
263
|
+
resumeTurn: (options: AgentResumeTurnOptions) => Promise<string | null>;
|
|
264
|
+
respondTurn: (options: AgentRespondTurnOptions) => Promise<string>;
|
|
265
|
+
reset: () => void;
|
|
266
|
+
cancelActive: () => void;
|
|
267
|
+
getActiveSessionId: () => string | undefined;
|
|
268
|
+
};
|
|
106
269
|
|
|
107
270
|
type ComposerFormFieldKind = "text" | "email" | "tel" | "textarea";
|
|
108
271
|
type ComposerFormField = {
|
|
@@ -285,6 +448,15 @@ type JourneyContext = {
|
|
|
285
448
|
stepLabel?: string;
|
|
286
449
|
};
|
|
287
450
|
type ConversationMessage = {
|
|
451
|
+
id: string;
|
|
452
|
+
role: "human";
|
|
453
|
+
text: string;
|
|
454
|
+
createdAt: number;
|
|
455
|
+
representative: {
|
|
456
|
+
id: string;
|
|
457
|
+
name: string;
|
|
458
|
+
};
|
|
459
|
+
} | {
|
|
288
460
|
id: string;
|
|
289
461
|
role: "visitor";
|
|
290
462
|
text: string;
|
|
@@ -443,4 +615,4 @@ type AgentPanelSubmitOptions = {
|
|
|
443
615
|
declare function resetAgentPanel(customerId: string): void;
|
|
444
616
|
declare function submitAgentPanel(customerId: string, message: string, options?: AgentPanelSubmitOptions): Promise<string | null>;
|
|
445
617
|
|
|
446
|
-
export {
|
|
618
|
+
export { builtInVisitorToolResultRegistry as $, AGENT_STRUCTURED_TOOL_INPUT_HEADER as A, type AgentToolUiField as B, type AgentToolUiFieldKind as C, type AgentToolUiOption as D, type AgentToolUiStep as E, type AgentToolUiSurface as F, AssistEdgeTab as G, type AssistTabSide as H, type AssistTabVariant as I, type Citation as J, type ConversationMessage as K, DEFAULT_AGENT_PLACEMENT as L, type FollowUpSuggestion as M, type JourneyContext as N, type NormalizedAgentTagManifest as O, type ToolStepState as P, type VisitorBookingResultPresentation as Q, type ResolvedVisitorToolResultPresentation as R, type VisitorSearchResultPresentation as S, type ToolStep as T, type VisitorToolInputResultPresentation as U, type VisitorBooking as V, type VisitorToolResultLink as W, type VisitorToolResultPresentation as X, type VisitorToolResultPresenter as Y, type VisitorToolResultPresenterOutput as Z, type VisitorToolResultRegistry as _, AGENT_STRUCTURED_TOOL_INPUT_SCHEMA_VERSION as a, defaultAgentRailTheme as a0, defaultDarkAgentRailTheme as a1, formatAgentStructuredToolInput as a2, normalizeAgentPlacement as a3, normalizeAgentTagManifest as a4, presentVisitorToolResult as a5, resetAgentPanel as a6, submitAgentPanel as a7, type AgentAnalyticsConfig as b, type AgentBrandingConfig as c, type AgentClient as d, type AgentColorScheme as e, type AgentIndexVersion as f, type AgentInputOption as g, type AgentInputRequest as h, type AgentInputResponse as i, type AgentMessageFeedback as j, type AgentMountStrategy as k, type AgentPanelSubmitOptions as l, type AgentPlacementConfig as m, type AgentRailPhase as n, type AgentRailState as o, type AgentRailTheme as p, type AgentRuntimeHandoffEvent as q, type AgentSearchReferences as r, type AgentSearchSource as s, type AgentStructuredToolInput as t, type AgentTabSide as u, type AgentTabVariant as v, type AgentTagManifest as w, type AgentToolResult as x, type AgentToolResultJsonValue as y, type AgentToolUiAction as z };
|
package/dist/presentation.cjs
CHANGED
|
@@ -736,6 +736,9 @@ function finalizeSummaryPresentation(result, proposed) {
|
|
|
736
736
|
};
|
|
737
737
|
}
|
|
738
738
|
function presentVisitorToolResult(result, registry = []) {
|
|
739
|
+
if (result.toolName === "request_location") {
|
|
740
|
+
return { id: result.callId, toolName: result.toolName, status: result.status, kind: "hidden" };
|
|
741
|
+
}
|
|
739
742
|
if (result.status === "completed" && toolResultFailed(result)) {
|
|
740
743
|
result = { ...result, status: "failed" };
|
|
741
744
|
}
|