@heroui/agent 1.0.0-beta.3 → 1.0.0-beta.5
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/CHANGELOG.md +19 -0
- package/README.md +119 -68
- package/dist/chunk-6O4WPQKO.js +1 -0
- package/dist/chunk-7OTMWVOC.js +1 -0
- package/dist/chunk-KGJ6UDTY.js +1 -0
- package/dist/chunk-PKCBDTYR.js +1 -0
- package/dist/chunk-PX3X4VP2.js +1 -0
- package/dist/chunk-SWO2ABN5.js +1 -0
- package/dist/client-tools-manifest-62CRLCZY.js +1 -0
- package/dist/css/index.css +1 -2
- package/dist/index.d.ts +9 -712
- package/dist/index.js +1 -1
- package/dist/internal/host.d.ts +108 -0
- package/dist/internal/host.js +1 -0
- package/dist/internal/shared.d.ts +63 -0
- package/dist/internal/shared.js +1 -0
- package/dist/next.d.ts +3 -4
- package/dist/next.js +1 -1
- package/dist/persistence-YI6JSYCT.js +1 -0
- package/dist/server.d.ts +21 -2
- package/dist/server.js +1 -1
- package/dist/types-BdAn3HPv.d.ts +667 -0
- package/dist/version-CIfRqjWe.d.ts +5 -0
- package/package.json +18 -34
- package/dist/chart-content-YGW25P3Z.js +0 -1
- package/dist/chunk-4JEZZR5J.js +0 -1
- package/dist/chunk-6RWQT7JH.js +0 -2
- package/dist/chunk-6ZJJN322.js +0 -1
- package/dist/chunk-7CUSOLDM.js +0 -5
- package/dist/chunk-7KCGPNEN.js +0 -1
- package/dist/chunk-CLHBM3HQ.js +0 -1
- package/dist/chunk-CR3H7AVI.js +0 -1
- package/dist/chunk-E43KPTLS.js +0 -2
- package/dist/chunk-HCLXS4HQ.js +0 -1
- package/dist/chunk-JTZX5KVY.js +0 -1
- package/dist/chunk-KQTLIOZ3.js +0 -1
- package/dist/chunk-M22IGTLZ.js +0 -1
- package/dist/chunk-MXXCR5SR.js +0 -1
- package/dist/chunk-PZJ4NC3J.js +0 -1
- package/dist/chunk-RNNGE7KM.js +0 -1
- package/dist/chunk-T4VDCNDW.js +0 -1
- package/dist/chunk-UHHKMESI.js +0 -1
- package/dist/component-renderer-KWBZJPBV.js +0 -1
- package/dist/composer-draft-NSKK65F3.js +0 -1
- package/dist/composer-image-draft-KAGTNQR7.js +0 -1
- package/dist/contracts.d.ts +0 -1683
- package/dist/contracts.js +0 -2
- package/dist/embed-runtime-YK64GOPA.js +0 -5
- package/dist/identity-CAJPsGqJ.d.ts +0 -101
- package/dist/interactive-map-surface-WC2LPCR7.js +0 -1
- package/dist/internal/client-tools.js +0 -1
- package/dist/internal/models.js +0 -1
- package/dist/internal/runtime.js +0 -1
- package/dist/internal/theme.js +0 -1
- package/dist/model-picker-QTI5TDBG.js +0 -1
- package/dist/shell-permission-picker-KIC3VEYJ.js +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,717 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
1
|
+
import { a3 as HeroUIAgentProps, l as AgentController } from './types-BdAn3HPv.js';
|
|
2
|
+
export { A as AGENT_DESIGN_THEMES, a as AGENT_MODEL_IDS, b as AGENT_MODEL_OPTIONS, c as AgentApiOverrides, d as AgentAppearance, e as AgentAttachmentContentType, f as AgentAuthToken, g as AgentCapabilities, h as AgentColorScheme, i as AgentComponentExportFormat, j as AgentComposerOptions, k as AgentContext, m as AgentDataSource, n as AgentDataSourceFormat, o as AgentDesignTheme, p as AgentFeedbackReason, q as AgentLauncherOptions, r as AgentLauncherPosition, s as AgentMarkdownAnimation, t as AgentMarkdownAnimationOptions, u as AgentMarkdownCaret, v as AgentMarkdownOptions, w as AgentMessageAction, x as AgentModelId, y as AgentModelOption, z as AgentModelTier, B as AgentPanelOptions, C as AgentPermissionMode, D as AgentPermissionOptions, E as AgentRadius, F as AgentResponseFeedback, G as AgentSharedContext, H as AgentShouldCloseOnInteractOutside, I as AgentStartScreenOptions, J as AgentSurfaceVariant, K as AgentThemeColor, L as AgentThemeColors, M as AgentThemeOptions, N as AgentTypography, O as AgentViewMode, P as ClientTool, Q as ClientToolExecutionContext, R as ClientToolIcon, S as ClientToolStatus, T as DEFAULT_AGENT_PICKER_MODEL_ID, U as DEFAULT_MARKDOWN_ANIMATION, V as GetAuthToken, W as GetAuthTokenContext, X as HEROUI_AGENT_ATTACHMENT_ACCEPT, Y as HEROUI_AGENT_ATTACHMENT_CONTENT_TYPES, Z as HEROUI_AGENT_ATTACHMENT_CONTENT_TYPE_BY_EXTENSION, _ as HEROUI_AGENT_ATTACHMENT_EXTENSION_BY_CONTENT_TYPE, $ as HEROUI_AGENT_ATTACHMENT_MAX_BYTES, a0 as HEROUI_AGENT_MAX_ATTACHMENTS, a1 as HEROUI_AGENT_TEXT_ATTACHMENT_CONTENT_TYPES, a2 as HeroUIAgentAttachmentContentType, a4 as LEGACY_AGENT_MODEL_IDS, a5 as UploadAgentDataSourceInput, a6 as createToolHelper, a7 as getAgentModelTier, a8 as isAgentModelId, a9 as isHeroUIAgentAttachmentContentType, ab as resolveAgentModelId, ad as resolveHeroUIAgentAttachmentContentType } from './types-BdAn3HPv.js';
|
|
3
|
+
export { H as HEROUI_AGENT_API_BASE_URL, a as HEROUI_AGENT_SDK_VERSION } from './version-CIfRqjWe.js';
|
|
4
|
+
import 'react';
|
|
5
5
|
|
|
6
|
-
/**
|
|
7
|
-
* Deliberately Zod-free: `createToolHelper` and these types are re-exported from
|
|
8
|
-
* the package root, which the panel shell is served from. The manifest
|
|
9
|
-
* serializer that does need Zod lives in `./client-tools-manifest`.
|
|
10
|
-
*/
|
|
11
|
-
type ClientToolStatus = "input-streaming" | "approval-requested" | "executing" | "completed" | "rejected" | "error";
|
|
12
|
-
type ClientToolIconProps = {
|
|
13
|
-
color?: string;
|
|
14
|
-
size?: number | string;
|
|
15
|
-
stroke?: number | string;
|
|
16
|
-
};
|
|
17
|
-
type ClientToolRenderProps<TArgs = unknown> = {
|
|
18
|
-
/** Arguments the agent passed to the tool (typed when using Zod). */
|
|
19
|
-
args: TArgs;
|
|
20
|
-
/** Error message, present when `status === "error"`. */
|
|
21
|
-
error?: string;
|
|
22
|
-
/** Approve the call. Present when `status === "approval-requested"`. */
|
|
23
|
-
onApprove?: () => void;
|
|
24
|
-
/** Reject the call. Present when `status === "approval-requested"`. */
|
|
25
|
-
onReject?: () => void;
|
|
26
|
-
/** Return value of `execute`, present when `status === "completed"`. */
|
|
27
|
-
result?: unknown;
|
|
28
|
-
status: ClientToolStatus;
|
|
29
|
-
};
|
|
30
|
-
type ClientToolSchema<TArgs> = {
|
|
31
|
-
parse: (input: unknown) => TArgs;
|
|
32
|
-
safeParse: (input: unknown) => unknown;
|
|
33
|
-
};
|
|
34
|
-
type AgentDataSourceFormat = "csv" | "json" | "tsv";
|
|
35
|
-
/** A private, conversation-scoped dataset uploaded by a browser client tool. */
|
|
36
|
-
type AgentDataSource = Readonly<{
|
|
37
|
-
filename: string;
|
|
38
|
-
format: AgentDataSourceFormat;
|
|
39
|
-
id: string;
|
|
40
|
-
kind: "heroui-agent-data-source";
|
|
41
|
-
mediaType: "application/json" | "text/csv" | "text/tab-separated-values";
|
|
42
|
-
size: number;
|
|
43
|
-
url: string;
|
|
44
|
-
}>;
|
|
45
|
-
type UploadAgentDataSourceInput = Readonly<{
|
|
46
|
-
/** JSON value, delimited text, Blob, ArrayBuffer, or byte array. */
|
|
47
|
-
data: unknown;
|
|
48
|
-
filename?: string;
|
|
49
|
-
format?: AgentDataSourceFormat;
|
|
50
|
-
}>;
|
|
51
|
-
/**
|
|
52
|
-
* Stable identity for one agent-initiated browser tool effect. Pass
|
|
53
|
-
* `idempotencyKey` through to mutation APIs so an ambiguous network retry can
|
|
54
|
-
* return the original result instead of applying the side effect twice.
|
|
55
|
-
*/
|
|
56
|
-
type ClientToolExecutionContext = Readonly<{
|
|
57
|
-
conversationId: string;
|
|
58
|
-
idempotencyKey: string;
|
|
59
|
-
toolCallId: string;
|
|
60
|
-
/** Upload a large result without placing its bytes in the 64 KiB tool receipt. */
|
|
61
|
-
uploadDataSource: (input: UploadAgentDataSourceInput) => Promise<AgentDataSource>;
|
|
62
|
-
}>;
|
|
63
|
-
/**
|
|
64
|
-
* A tool the agent can call in the user's browser. Execution and rendering
|
|
65
|
-
* never leave the page — only the name, description, schema, and approval
|
|
66
|
-
* flag are shared with the hosted agent.
|
|
67
|
-
*/
|
|
68
|
-
type ClientTool<TArgs = any, TContext = any> = {
|
|
69
|
-
description: string;
|
|
70
|
-
/** Human-readable name shown in the default tool card. Defaults to `name`. */
|
|
71
|
-
displayName?: string;
|
|
72
|
-
execute: (args: TArgs, context: TContext, execution: ClientToolExecutionContext) => Promise<unknown> | unknown;
|
|
73
|
-
/** Icon component for the default tool card ({size, color, stroke} props). */
|
|
74
|
-
icon?: ComponentType<ClientToolIconProps>;
|
|
75
|
-
iconColor?: string;
|
|
76
|
-
name: string;
|
|
77
|
-
/** When true, the user must approve the call before `execute` runs. */
|
|
78
|
-
needsApproval?: boolean;
|
|
79
|
-
/** Zod schema (typed) or raw JSON Schema object for the tool parameters. */
|
|
80
|
-
parameters: ClientToolSchema<TArgs> | Record<string, unknown>;
|
|
81
|
-
/**
|
|
82
|
-
* Replace the default tool card. Return `null` for any status to fall back
|
|
83
|
-
* to the default card for that state.
|
|
84
|
-
*/
|
|
85
|
-
render?: (props: ClientToolRenderProps<TArgs>) => ReactNode;
|
|
86
|
-
};
|
|
87
|
-
/**
|
|
88
|
-
* Returns a type-safe tool factory bound to your shared context type:
|
|
89
|
-
*
|
|
90
|
-
* ```ts
|
|
91
|
-
* type AppContext = {apiClient: ApiClient};
|
|
92
|
-
* const tool = createToolHelper<AppContext>();
|
|
93
|
-
* const tools = [tool({name: "search_users", parameters: z.object({...}), execute: (args, ctx) => ...})];
|
|
94
|
-
* ```
|
|
95
|
-
*/
|
|
96
|
-
declare function createToolHelper<TContext>(): <TArgs>(definition: ClientTool<TArgs, TContext>) => ClientTool<TArgs, TContext>;
|
|
97
|
-
|
|
98
|
-
type MessageActionKind = "copy" | "feedback" | "retry";
|
|
99
|
-
type MessageFeedbackReason = "did_not_follow_instructions" | "incomplete" | "incorrect" | "not_relevant" | "other" | "unclear";
|
|
100
|
-
|
|
101
|
-
/** How browser client-tool calls are approved before they execute. */
|
|
102
|
-
type AgentPermissionMode$1 = "ask" | "auto" | "full";
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* File types that the hosted model pipeline can process consistently.
|
|
106
|
-
*
|
|
107
|
-
* SVG is intentionally excluded because it can carry active content. Hosted
|
|
108
|
-
* document parsing handles the remaining office and publishing formats.
|
|
109
|
-
*/
|
|
110
|
-
declare const HEROUI_AGENT_ATTACHMENT_EXTENSION_BY_CONTENT_TYPE: {
|
|
111
|
-
readonly "application/epub+zip": "epub";
|
|
112
|
-
readonly "application/json": "json";
|
|
113
|
-
readonly "application/msword": "doc";
|
|
114
|
-
readonly "application/pdf": "pdf";
|
|
115
|
-
readonly "application/rtf": "rtf";
|
|
116
|
-
readonly "application/vnd.ms-excel": "xls";
|
|
117
|
-
readonly "application/vnd.ms-excel.sheet.binary.macroenabled.12": "xlsb";
|
|
118
|
-
readonly "application/vnd.ms-excel.sheet.macroenabled.12": "xlsm";
|
|
119
|
-
readonly "application/vnd.ms-powerpoint": "ppt";
|
|
120
|
-
readonly "application/vnd.ms-powerpoint.presentation.macroenabled.12": "pptm";
|
|
121
|
-
readonly "application/vnd.ms-word.document.macroenabled.12": "docm";
|
|
122
|
-
readonly "application/vnd.oasis.opendocument.presentation": "odp";
|
|
123
|
-
readonly "application/vnd.oasis.opendocument.spreadsheet": "ods";
|
|
124
|
-
readonly "application/vnd.oasis.opendocument.text": "odt";
|
|
125
|
-
readonly "application/vnd.openxmlformats-officedocument.presentationml.presentation": "pptx";
|
|
126
|
-
readonly "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "xlsx";
|
|
127
|
-
readonly "application/vnd.openxmlformats-officedocument.wordprocessingml.document": "docx";
|
|
128
|
-
readonly "image/gif": "gif";
|
|
129
|
-
readonly "image/jpeg": "jpg";
|
|
130
|
-
readonly "image/png": "png";
|
|
131
|
-
readonly "image/webp": "webp";
|
|
132
|
-
readonly "text/csv": "csv";
|
|
133
|
-
readonly "text/html": "html";
|
|
134
|
-
readonly "text/markdown": "md";
|
|
135
|
-
readonly "text/plain": "txt";
|
|
136
|
-
readonly "text/rtf": "rtf";
|
|
137
|
-
readonly "text/tab-separated-values": "tsv";
|
|
138
|
-
};
|
|
139
|
-
type HeroUIAgentAttachmentContentType = keyof typeof HEROUI_AGENT_ATTACHMENT_EXTENSION_BY_CONTENT_TYPE;
|
|
140
|
-
|
|
141
|
-
declare const agentThemeSchema: z.ZodEnum<{
|
|
142
|
-
dark: "dark";
|
|
143
|
-
light: "light";
|
|
144
|
-
system: "system";
|
|
145
|
-
}>;
|
|
146
|
-
type AgentTheme = z.infer<typeof agentThemeSchema>;
|
|
147
|
-
|
|
148
|
-
/** Browser event emitted when protocol-v6 runtime latency checkpoints arrive. */
|
|
149
|
-
declare const HEROUI_AGENT_RUNTIME_TIMING_EVENT: "heroui-agent:runtime-timing";
|
|
150
|
-
type AgentActivityPhase = "accepted" | "preparing" | "generating" | "waiting-client-tool" | "running-server-tool" | "recovering";
|
|
151
|
-
type AgentRuntimeTiming = {
|
|
152
|
-
completedAt?: number;
|
|
153
|
-
firstSemanticTextAt?: number;
|
|
154
|
-
providerFirstEventAt?: number;
|
|
155
|
-
providerRequestedAt?: number;
|
|
156
|
-
runtimeAdmittedAt?: number;
|
|
157
|
-
turnId?: string;
|
|
158
|
-
};
|
|
159
|
-
type AgentRuntimeTimingEventDetail = AgentRuntimeTiming & {
|
|
160
|
-
agentId: string;
|
|
161
|
-
conversationId: string;
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* Deliberately Zod-free: the model catalogue is re-exported from the package
|
|
166
|
-
* root, so importing Zod here would pull the whole validation library into the
|
|
167
|
-
* panel shell's first-paint graph. The matching schema lives in
|
|
168
|
-
* `./models.schema`, which only server and contract consumers need.
|
|
169
|
-
*/
|
|
170
|
-
/** Model ids the hosted agent accepts from the browser picker. */
|
|
171
|
-
declare const AGENT_MODEL_IDS: readonly ["moonshotai/Kimi-K3", "openai/gpt-5.6-luna", "openai/gpt-5.6-terra", "openai/gpt-5.6-sol", "google/gemini-3.7-flash", "anthropic/claude-sonnet-5", "anthropic/claude-opus-4.8"];
|
|
172
|
-
type AgentModelId = (typeof AGENT_MODEL_IDS)[number];
|
|
173
|
-
/**
|
|
174
|
-
* Retired ids mapped to their replacement. Model ids are a public part of the
|
|
175
|
-
* embed API — a customer pins one in their own code and projects store one as
|
|
176
|
-
* their default — so a retired id keeps resolving instead of failing the
|
|
177
|
-
* session with an "Invalid agent model" error.
|
|
178
|
-
*/
|
|
179
|
-
declare const LEGACY_AGENT_MODEL_IDS: Record<string, AgentModelId>;
|
|
180
|
-
/** Resolves a possibly-retired model id to the id the runtime should use. */
|
|
181
|
-
declare function resolveAgentModelId(value: string): string;
|
|
182
|
-
type AgentModelTier = "codegen" | "complex" | "light";
|
|
183
|
-
type AgentModelOption = {
|
|
184
|
-
description: string;
|
|
185
|
-
id: AgentModelId;
|
|
186
|
-
label: string;
|
|
187
|
-
provider: "Anthropic" | "Google" | "Moonshot AI" | "OpenAI";
|
|
188
|
-
tier: AgentModelTier;
|
|
189
|
-
};
|
|
190
|
-
/**
|
|
191
|
-
* Recommended default selected when the optional picker first opens. Gemini 3.7 Flash
|
|
192
|
-
* matches the hosted runtime's baked-in default (`DEFAULT_CHAT_MODEL_IDS.herouiAgent`),
|
|
193
|
-
* so what users see in the picker is what actually runs by default.
|
|
194
|
-
*/
|
|
195
|
-
declare const DEFAULT_AGENT_PICKER_MODEL_ID = "google/gemini-3.7-flash";
|
|
196
|
-
/**
|
|
197
|
-
* Small, tool-capable model catalog for HeroUI Agent. These ids are the
|
|
198
|
-
* server-side allowlist as well as the browser picker source of truth.
|
|
199
|
-
*/
|
|
200
|
-
declare const AGENT_MODEL_OPTIONS: readonly [{
|
|
201
|
-
readonly description: "Flagship model for coding, reasoning, and knowledge work";
|
|
202
|
-
readonly id: "moonshotai/Kimi-K3";
|
|
203
|
-
readonly label: "Kimi K3";
|
|
204
|
-
readonly provider: "Moonshot AI";
|
|
205
|
-
readonly tier: "light";
|
|
206
|
-
}, {
|
|
207
|
-
readonly description: "Fast answers and lightweight agent workflows";
|
|
208
|
-
readonly id: "openai/gpt-5.6-luna";
|
|
209
|
-
readonly label: "GPT-5.6 Luna";
|
|
210
|
-
readonly provider: "OpenAI";
|
|
211
|
-
readonly tier: "light";
|
|
212
|
-
}, {
|
|
213
|
-
readonly description: "Balanced reasoning for everyday agent tasks";
|
|
214
|
-
readonly id: "openai/gpt-5.6-terra";
|
|
215
|
-
readonly label: "GPT-5.6 Terra";
|
|
216
|
-
readonly provider: "OpenAI";
|
|
217
|
-
readonly tier: "codegen";
|
|
218
|
-
}, {
|
|
219
|
-
readonly description: "Deep reasoning for complex, multi-step analysis";
|
|
220
|
-
readonly id: "openai/gpt-5.6-sol";
|
|
221
|
-
readonly label: "GPT-5.6 Sol";
|
|
222
|
-
readonly provider: "OpenAI";
|
|
223
|
-
readonly tier: "complex";
|
|
224
|
-
}, {
|
|
225
|
-
readonly description: "Fast multimodal analysis with a large context window";
|
|
226
|
-
readonly id: "google/gemini-3.7-flash";
|
|
227
|
-
readonly label: "Gemini 3.7 Flash";
|
|
228
|
-
readonly provider: "Google";
|
|
229
|
-
readonly tier: "light";
|
|
230
|
-
}, {
|
|
231
|
-
readonly description: "Strong agentic reasoning and polished UI decisions";
|
|
232
|
-
readonly id: "anthropic/claude-sonnet-5";
|
|
233
|
-
readonly label: "Claude Sonnet 5";
|
|
234
|
-
readonly provider: "Anthropic";
|
|
235
|
-
readonly tier: "codegen";
|
|
236
|
-
}, {
|
|
237
|
-
readonly description: "Highest-capability Claude for difficult research and analysis";
|
|
238
|
-
readonly id: "anthropic/claude-opus-4.8";
|
|
239
|
-
readonly label: "Claude Opus 4.8";
|
|
240
|
-
readonly provider: "Anthropic";
|
|
241
|
-
readonly tier: "complex";
|
|
242
|
-
}];
|
|
243
|
-
declare function isAgentModelId(value: unknown): value is AgentModelId;
|
|
244
|
-
/** Unknown/env-overridden models keep the hosted agent's historical light tier. */
|
|
245
|
-
declare function getAgentModelTier(modelId?: string): AgentModelTier;
|
|
246
|
-
|
|
247
|
-
/**
|
|
248
|
-
* Light/dark color scheme selection for the embed. `"system"` follows the
|
|
249
|
-
* OS preference and updates live when it changes.
|
|
250
|
-
*/
|
|
251
|
-
type AgentColorScheme = AgentTheme;
|
|
252
|
-
/**
|
|
253
|
-
* A theme color value: one CSS color applied to both schemes, or separate
|
|
254
|
-
* values per scheme. Tokens left unset fall back to the built-in defaults of
|
|
255
|
-
* each scheme, so overriding a light color never degrades dark mode.
|
|
256
|
-
*/
|
|
257
|
-
type AgentThemeColor = string | {
|
|
258
|
-
dark?: string;
|
|
259
|
-
light?: string;
|
|
260
|
-
};
|
|
261
|
-
/** Corner rounding preset applied across the embed surface and fields. */
|
|
262
|
-
type AgentRadius = "pill" | "round" | "sharp" | "soft";
|
|
263
|
-
/**
|
|
264
|
-
* The seven high-impact color tokens. Everything else in the embed
|
|
265
|
-
* (borders, shadows, chart palettes) derives from these and from the
|
|
266
|
-
* built-in scheme defaults.
|
|
267
|
-
*/
|
|
268
|
-
type AgentThemeColors = {
|
|
269
|
-
/** Primary action and highlight color. Chart palettes derive from it. */
|
|
270
|
-
accent?: AgentThemeColor;
|
|
271
|
-
/** Chat panel background. */
|
|
272
|
-
background?: AgentThemeColor;
|
|
273
|
-
/** Primary text color. */
|
|
274
|
-
foreground?: AgentThemeColor;
|
|
275
|
-
/** Dropdown and popover surface color. */
|
|
276
|
-
overlay?: AgentThemeColor;
|
|
277
|
-
/** Card surface color. */
|
|
278
|
-
surface?: AgentThemeColor;
|
|
279
|
-
/** Secondary surface color (chips, muted fills). */
|
|
280
|
-
surfaceSecondary?: AgentThemeColor;
|
|
281
|
-
/** Tooltip surface color. Text contrast is derived automatically. */
|
|
282
|
-
tooltip?: AgentThemeColor;
|
|
283
|
-
};
|
|
284
|
-
type AgentTypography = {
|
|
285
|
-
/**
|
|
286
|
-
* Base font size in pixels (clamped to 12–18).
|
|
287
|
-
* @default 14
|
|
288
|
-
*/
|
|
289
|
-
baseSize?: number;
|
|
290
|
-
/** CSS font family stack, e.g. `"Geist, sans-serif"`. */
|
|
291
|
-
fontFamily?: string;
|
|
292
|
-
};
|
|
293
|
-
/**
|
|
294
|
-
* HeroUI Pro theme variant applied to the agent surface.
|
|
295
|
-
*
|
|
296
|
-
* Anything other than `"base"` also needs its stylesheet loaded once, from the
|
|
297
|
-
* licensed Pro package: `import "@heroui-pro/react/agent-themes/glass"`.
|
|
298
|
-
*/
|
|
299
|
-
type AgentDesignTheme = "base" | "brutalism" | "glass" | "mouve";
|
|
300
|
-
declare const AGENT_DESIGN_THEMES: readonly AgentDesignTheme[];
|
|
301
|
-
/**
|
|
302
|
-
* Intentionally small theme surface: one color scheme, one Pro variant, four
|
|
303
|
-
* radius presets, seven color tokens, and basic typography. No named themes,
|
|
304
|
-
* extend chains, or per-component tokens.
|
|
305
|
-
*/
|
|
306
|
-
type AgentThemeOptions = {
|
|
307
|
-
/** @default "system" */
|
|
308
|
-
colorScheme?: AgentColorScheme;
|
|
309
|
-
colors?: AgentThemeColors;
|
|
310
|
-
/**
|
|
311
|
-
* HeroUI Pro theme variant. Requires the matching stylesheet import.
|
|
312
|
-
* @default "base"
|
|
313
|
-
*/
|
|
314
|
-
designTheme?: AgentDesignTheme;
|
|
315
|
-
/** @default "round" */
|
|
316
|
-
radius?: AgentRadius;
|
|
317
|
-
typography?: AgentTypography;
|
|
318
|
-
};
|
|
319
|
-
|
|
320
|
-
type AgentComponentExportFormat = "csv" | "png" | "svg";
|
|
321
|
-
type AgentPermissionMode = AgentPermissionMode$1;
|
|
322
|
-
/** MIME type accepted by the hosted HeroUI Agent attachment pipeline. */
|
|
323
|
-
type AgentAttachmentContentType = HeroUIAgentAttachmentContentType;
|
|
324
|
-
type AgentMessageAction = MessageActionKind;
|
|
325
|
-
type AgentFeedbackReason = MessageFeedbackReason;
|
|
326
|
-
type AgentResponseFeedback = {
|
|
327
|
-
/** Optional free-form context supplied by the end user. */
|
|
328
|
-
comment?: string;
|
|
329
|
-
conversationId: string;
|
|
330
|
-
messageId: string;
|
|
331
|
-
rating: "negative" | "positive";
|
|
332
|
-
/** Structured reasons selected for negative feedback. Empty for positive feedback. */
|
|
333
|
-
reasons: AgentFeedbackReason[];
|
|
334
|
-
};
|
|
335
|
-
type AgentContext = Record<string, unknown>;
|
|
336
|
-
/**
|
|
337
|
-
* The single shared context object. It is passed as the second argument to
|
|
338
|
-
* every client tool's `execute` — API clients, user info, state setters.
|
|
339
|
-
* Anything goes; it never leaves the browser.
|
|
340
|
-
*
|
|
341
|
-
* One key is reserved: `page`. When present, the SDK calls it on every turn
|
|
342
|
-
* and sends its JSON-serializable return value (route, filters, selection —
|
|
343
|
-
* max 16KB) to the agent as page context. Nothing else in the context object
|
|
344
|
-
* ever crosses the wire.
|
|
345
|
-
*/
|
|
346
|
-
type AgentSharedContext = {
|
|
347
|
-
page?: () => AgentContext | Promise<AgentContext>;
|
|
348
|
-
} & Record<string, unknown>;
|
|
349
|
-
type AgentViewMode = "floating" | "sidebar";
|
|
350
|
-
type AgentSurfaceVariant = "outline" | "plain" | "surface" | "surface-secondary";
|
|
351
|
-
/**
|
|
352
|
-
* Controls whether an outside interaction closes the floating panel. Matches React
|
|
353
|
-
* Aria Popover: `true` or omitted always closes; `false` never closes; a
|
|
354
|
-
* predicate receives the outside element and returns whether to close.
|
|
355
|
-
*/
|
|
356
|
-
type AgentShouldCloseOnInteractOutside = boolean | ((element: Element) => boolean);
|
|
357
|
-
type AgentMarkdownAnimation = boolean | AnimateOptions;
|
|
358
|
-
type AgentMarkdownCaret = "block" | "circle";
|
|
359
|
-
type AgentMarkdownRenderer = CustomRenderer;
|
|
360
|
-
type AgentMarkdownRendererProps = CustomRendererProps;
|
|
361
|
-
type AgentMarkdownPlugins = {
|
|
362
|
-
/** Custom renderers selected by fenced-code language. */
|
|
363
|
-
renderers?: AgentMarkdownRenderer[];
|
|
364
|
-
};
|
|
365
|
-
/** Streaming Markdown presentation and custom fenced-code renderers. */
|
|
366
|
-
type AgentMarkdownOptions = {
|
|
367
|
-
/**
|
|
368
|
-
* Animate newly streamed content. Pass `false` to disable text animation.
|
|
369
|
-
* @default {animation: "fadeIn", duration: 160, easing: "ease-out", sep: "word", stagger: 18}
|
|
370
|
-
*/
|
|
371
|
-
animated?: AgentMarkdownAnimation;
|
|
372
|
-
/** Streaming caret style. Pass `false` to hide it. @default "block" */
|
|
373
|
-
caret?: AgentMarkdownCaret | false;
|
|
374
|
-
/** Custom fenced-code renderers. */
|
|
375
|
-
plugins?: AgentMarkdownPlugins;
|
|
376
|
-
};
|
|
377
|
-
/** Corner that anchors the launcher button and the floating panel. */
|
|
378
|
-
type AgentLauncherPosition = "bottom-left" | "bottom-right";
|
|
379
|
-
/** Placement of the floating launcher button (visibility is `showLauncher`). */
|
|
380
|
-
type AgentLauncherOptions = {
|
|
381
|
-
/**
|
|
382
|
-
* Fill of the launcher button. Defaults to the accent color; set it when a
|
|
383
|
-
* custom {@link icon} needs a different backdrop. The mark inside gets a
|
|
384
|
-
* contrasting foreground automatically.
|
|
385
|
-
*/
|
|
386
|
-
background?: AgentThemeColor;
|
|
387
|
-
/**
|
|
388
|
-
* Image rendered inside the launcher button instead of the built-in spark
|
|
389
|
-
* mark. Use a square asset (70x70 or larger); it is scaled to fit.
|
|
390
|
-
*/
|
|
391
|
-
icon?: string;
|
|
392
|
-
/**
|
|
393
|
-
* Pixel offsets from the anchored corner: `x` from the side edge, `y` from
|
|
394
|
-
* the bottom. Defaults to 24 (16 on small screens).
|
|
395
|
-
*/
|
|
396
|
-
offset?: {
|
|
397
|
-
x?: number;
|
|
398
|
-
y?: number;
|
|
399
|
-
};
|
|
400
|
-
/** @default "bottom-right" */
|
|
401
|
-
position?: AgentLauncherPosition;
|
|
402
|
-
/**
|
|
403
|
-
* Escape hatch for launcher styling the options above do not cover, applied
|
|
404
|
-
* as inline styles on the button (so it wins over the stylesheet). Prefer the
|
|
405
|
-
* dedicated options where they exist; this is not covered by the embed's
|
|
406
|
-
* visual defaults and can break the button's layout.
|
|
407
|
-
*/
|
|
408
|
-
style?: CSSProperties;
|
|
409
|
-
};
|
|
410
|
-
/** Optional hosted-agent capabilities, all off by default. */
|
|
411
|
-
type AgentCapabilities = {
|
|
412
|
-
/**
|
|
413
|
-
* Allow the hosted agent to search for images via web search. Only applies
|
|
414
|
-
* when {@link webSearch} is enabled; defaults to true in that case.
|
|
415
|
-
* @default true
|
|
416
|
-
*/
|
|
417
|
-
imageSearch?: boolean;
|
|
418
|
-
/**
|
|
419
|
-
* Allow the hosted agent to include recent news results in web searches.
|
|
420
|
-
* Only applies when {@link webSearch} is enabled and is off by default.
|
|
421
|
-
* @default false
|
|
422
|
-
*/
|
|
423
|
-
newsSearch?: boolean;
|
|
424
|
-
/**
|
|
425
|
-
* Allow the hosted agent to search the public web for current information
|
|
426
|
-
* and images. Results are untrusted external content; keep this off when the
|
|
427
|
-
* assistant should only ever answer from your declared client tools.
|
|
428
|
-
* @default false
|
|
429
|
-
*/
|
|
430
|
-
webSearch?: boolean;
|
|
431
|
-
};
|
|
432
|
-
/** Browser client-tool approval policy. */
|
|
433
|
-
type AgentPermissionOptions = {
|
|
434
|
-
/**
|
|
435
|
-
* Permission mode used before an end user chooses another mode.
|
|
436
|
-
* `"ask"` gates every client tool, `"auto"` gates only tools marked
|
|
437
|
-
* `needsApproval`, and `"full"` runs client tools without prompting.
|
|
438
|
-
* @default "auto"
|
|
439
|
-
*/
|
|
440
|
-
defaultMode?: AgentPermissionMode;
|
|
441
|
-
/**
|
|
442
|
-
* Show the permission picker in the composer, letting the end user switch
|
|
443
|
-
* modes for themselves.
|
|
444
|
-
*
|
|
445
|
-
* This is a privilege boundary, not just a control: it permits the end user
|
|
446
|
-
* to select `"full"` and run every client tool without approval, overriding
|
|
447
|
-
* {@link defaultMode}. Their choice persists for the conversation.
|
|
448
|
-
*
|
|
449
|
-
* The picker only renders when {@link HeroUIAgentProps.tools} is non-empty,
|
|
450
|
-
* since there is nothing to approve otherwise.
|
|
451
|
-
* @default false
|
|
452
|
-
*/
|
|
453
|
-
showPicker?: boolean;
|
|
454
|
-
};
|
|
455
|
-
/**
|
|
456
|
-
* Size and expansion of the chat panel. In `floating` mode expansion grows the
|
|
457
|
-
* card; in `sidebar` mode it temporarily fills the viewport. Initial dimensions
|
|
458
|
-
* are ignored in `sidebar` mode and below the mobile breakpoint.
|
|
459
|
-
*/
|
|
460
|
-
type AgentPanelOptions = {
|
|
461
|
-
/**
|
|
462
|
-
* Open the panel expanded. End users can still collapse it unless
|
|
463
|
-
* {@link expandable} is off.
|
|
464
|
-
* @default false
|
|
465
|
-
*/
|
|
466
|
-
expanded?: boolean;
|
|
467
|
-
/**
|
|
468
|
-
* Offer the expand control in the panel header. In sidebar mode the expanded
|
|
469
|
-
* panel fills the viewport. Turn it off to pin the panel to one size.
|
|
470
|
-
* @default true
|
|
471
|
-
*/
|
|
472
|
-
expandable?: boolean;
|
|
473
|
-
/**
|
|
474
|
-
* Panel height before expanding — a number in pixels or any CSS length.
|
|
475
|
-
* Capped to the viewport.
|
|
476
|
-
* @default "max(420px, 56dvh)"
|
|
477
|
-
*/
|
|
478
|
-
initialHeight?: number | string;
|
|
479
|
-
/**
|
|
480
|
-
* Panel width before expanding — a number in pixels or any CSS length.
|
|
481
|
-
* Expanding widens the panel from here. Capped to the viewport.
|
|
482
|
-
* @default 440
|
|
483
|
-
*/
|
|
484
|
-
initialWidth?: number | string;
|
|
485
|
-
};
|
|
486
|
-
/** Visual presentation: view mode, theme, panel size, and launcher placement. */
|
|
487
|
-
type AgentAppearance = {
|
|
488
|
-
/** Surface treatment for approval, calendar, commerce, and other response cards. @default "surface" */
|
|
489
|
-
componentSurfaceVariant?: AgentSurfaceVariant;
|
|
490
|
-
/** Where the launcher button (and the floating panel) is anchored. */
|
|
491
|
-
launcher?: AgentLauncherOptions;
|
|
492
|
-
/** Size and expansion of the floating panel. */
|
|
493
|
-
panel?: AgentPanelOptions;
|
|
494
|
-
/**
|
|
495
|
-
* When the visitor interacts outside the floating panel, whether to close it.
|
|
496
|
-
* Only applies in `viewMode: "floating"`. `true` or omitted always closes;
|
|
497
|
-
* `false` never closes on outside interact; a predicate receives the outside
|
|
498
|
-
* element. Escape and the header close button are unchanged.
|
|
499
|
-
*/
|
|
500
|
-
shouldCloseOnInteractOutside?: AgentShouldCloseOnInteractOutside;
|
|
501
|
-
/** Surface treatment for charts, tables, maps, and other primary data surfaces. */
|
|
502
|
-
surfaceVariant?: AgentSurfaceVariant;
|
|
503
|
-
theme?: AgentThemeOptions;
|
|
504
|
-
/**
|
|
505
|
-
* How the chat opens: `"floating"` (default) is a floating rounded panel in
|
|
506
|
-
* the corner; `"sidebar"` docks full-height to the right edge of the page.
|
|
507
|
-
*/
|
|
508
|
-
viewMode?: AgentViewMode;
|
|
509
|
-
/**
|
|
510
|
-
* Stacking level of the Agent host. Set this when the Agent must sit below
|
|
511
|
-
* application-owned dialogs or above unusually high application chrome.
|
|
512
|
-
* This sets the public `--ha-z-index` CSS custom property.
|
|
513
|
-
* @default 40
|
|
514
|
-
*/
|
|
515
|
-
zIndex?: number;
|
|
516
|
-
};
|
|
517
|
-
/** Message composer settings. */
|
|
518
|
-
type AgentComposerOptions = {
|
|
519
|
-
/**
|
|
520
|
-
* File types end users can attach. Omit to allow every supported type, pass
|
|
521
|
-
* a subset to narrow the picker, or pass `false` to remove attachments.
|
|
522
|
-
* @default all supported attachment types
|
|
523
|
-
*/
|
|
524
|
-
attachments?: AgentAttachmentContentType[] | false;
|
|
525
|
-
/**
|
|
526
|
-
* Model used for new turns before an end user chooses another model.
|
|
527
|
-
* When the picker is disabled, this pins every turn to the configured model.
|
|
528
|
-
*/
|
|
529
|
-
defaultModel?: AgentModelId;
|
|
530
|
-
/** Show microphone recording and voice transcription controls. @default true */
|
|
531
|
-
dictation?: boolean;
|
|
532
|
-
/**
|
|
533
|
-
* Small verification notice shown below the composer and above the HeroUI
|
|
534
|
-
* attribution. Supports `[label](example.com)` and HTTPS links; bare domains
|
|
535
|
-
* are normalized to HTTPS. Limited to 240 characters. Pass `false` or omit it
|
|
536
|
-
* to hide the notice.
|
|
537
|
-
* @default false
|
|
538
|
-
* @example "Agent may make mistakes. [View terms](https://example.com/terms)"
|
|
539
|
-
*/
|
|
540
|
-
disclaimer?: string | false;
|
|
541
|
-
/** Let the end user choose from the hosted agent's allowlisted models. @default false */
|
|
542
|
-
modelPicker?: boolean;
|
|
543
|
-
/** Placeholder shown in the message composer. @default "Ask anything…" */
|
|
544
|
-
placeholder?: string;
|
|
545
|
-
};
|
|
546
|
-
/** The empty-conversation view shown before the first message. */
|
|
547
|
-
type AgentStartScreenOptions = {
|
|
548
|
-
/** Heading shown above the composer. @default "Ask about your data" */
|
|
549
|
-
greeting?: string;
|
|
550
|
-
/** Show and enable `Ctrl+1`…`Ctrl+5` shortcuts for the visible prompts. @default false */
|
|
551
|
-
promptShortcuts?: boolean;
|
|
552
|
-
/** Up to five suggested prompts (each max 160 characters). */
|
|
553
|
-
prompts?: string[];
|
|
554
|
-
/** Supporting text shown below the greeting. Limited to 240 characters. */
|
|
555
|
-
subtitle?: string;
|
|
556
|
-
};
|
|
557
|
-
/** Internal — for HeroUI platform development only. */
|
|
558
|
-
type AgentApiOverrides = {
|
|
559
|
-
baseUrl?: string;
|
|
560
|
-
};
|
|
561
|
-
/**
|
|
562
|
-
* Short-lived browser credential returned by the customer's server.
|
|
563
|
-
*
|
|
564
|
-
* Declared here rather than re-exported from `@heroui/agent-client`: that
|
|
565
|
-
* package is bundled into this one, so a re-export would leave a dangling
|
|
566
|
-
* reference in the published typings. The two declarations are structurally
|
|
567
|
-
* identical, which is what lets the session manager accept this callback.
|
|
568
|
-
*/
|
|
569
|
-
type AgentAuthToken = {
|
|
570
|
-
expiresAt: number;
|
|
571
|
-
token: string;
|
|
572
|
-
};
|
|
573
|
-
/** Context supplied whenever the SDK needs a fresh browser credential. */
|
|
574
|
-
type GetAuthTokenContext = {
|
|
575
|
-
anonymousId: string;
|
|
576
|
-
agentId: string;
|
|
577
|
-
};
|
|
578
|
-
type GetAuthToken = (context: GetAuthTokenContext) => Promise<AgentAuthToken>;
|
|
579
|
-
type HeroUIAgentProps = {
|
|
580
|
-
/** Internal — for HeroUI platform development only. */
|
|
581
|
-
_api?: AgentApiOverrides;
|
|
582
|
-
appearance?: AgentAppearance;
|
|
583
|
-
capabilities?: AgentCapabilities;
|
|
584
|
-
/** Component export formats to show. Pass `false` to hide export and copy controls. */
|
|
585
|
-
componentExports?: AgentComponentExportFormat[] | false;
|
|
586
|
-
composer?: AgentComposerOptions;
|
|
587
|
-
/**
|
|
588
|
-
* Shared context for client tools; its reserved `page` key supplies the
|
|
589
|
-
* page context sent to the agent. See {@link AgentSharedContext}.
|
|
590
|
-
*/
|
|
591
|
-
context?: AgentSharedContext;
|
|
592
|
-
/**
|
|
593
|
-
* Fetches a short-lived browser credential from the host application's
|
|
594
|
-
* server. Never expose a HeroUI Agent API key in browser code.
|
|
595
|
-
*/
|
|
596
|
-
getAuthToken: GetAuthToken;
|
|
597
|
-
/** Streaming Markdown animation, caret, and custom fenced-code renderers. */
|
|
598
|
-
markdown?: AgentMarkdownOptions;
|
|
599
|
-
/**
|
|
600
|
-
* Receives end-user ratings for assistant responses. Negative ratings can
|
|
601
|
-
* include structured reasons and an optional comment from the feedback popover.
|
|
602
|
-
*/
|
|
603
|
-
onFeedback?: (feedback: AgentResponseFeedback) => Promise<void> | void;
|
|
604
|
-
/**
|
|
605
|
-
* Fires whenever project configuration and the complete composer are ready
|
|
606
|
-
* for the current conversation. Use `useAgent().ready` when a custom launcher
|
|
607
|
-
* also needs the status reactively.
|
|
608
|
-
*/
|
|
609
|
-
onReady?: () => void;
|
|
610
|
-
/** Client-tool approval defaults and optional end-user picker. */
|
|
611
|
-
permissions?: AgentPermissionOptions;
|
|
612
|
-
/**
|
|
613
|
-
* Warm the agent before the visitor touches it: fetch the chat engine,
|
|
614
|
-
* configuration, and credentials, then bootstrap and preconnect the runtime
|
|
615
|
-
* while the panel is still closed. Work starts immediately and in parallel
|
|
616
|
-
* so readiness follows the launcher as quickly as possible. Opening before
|
|
617
|
-
* then shows the Agent shell with a loading state.
|
|
618
|
-
*
|
|
619
|
-
* Set to `false` to request nothing until the panel is opened. Worth doing
|
|
620
|
-
* when most visitors never open the agent, or on pages where you want to
|
|
621
|
-
* choose the moment yourself — `useAgent().preload()` runs the same warm-up
|
|
622
|
-
* on your signal.
|
|
623
|
-
* @default true
|
|
624
|
-
*/
|
|
625
|
-
preload?: boolean;
|
|
626
|
-
agentId: string;
|
|
627
|
-
/**
|
|
628
|
-
* Reopen the panel after a page refresh when it was open before the refresh.
|
|
629
|
-
* The restored panel always starts a new chat instead of resuming the
|
|
630
|
-
* previously active conversation.
|
|
631
|
-
* @default false
|
|
632
|
-
*/
|
|
633
|
-
reopenOnRefresh?: boolean;
|
|
634
|
-
/**
|
|
635
|
-
* Open the panel on the start screen instead of restoring the most recently
|
|
636
|
-
* active conversation. Conversation history remains available in the picker.
|
|
637
|
-
* @default false
|
|
638
|
-
*/
|
|
639
|
-
startNewConversationOnOpen?: boolean;
|
|
640
|
-
/**
|
|
641
|
-
* Apply the appearance saved for this project in the HeroUI dashboard —
|
|
642
|
-
* launcher icon, colors, typography, greeting, subtitle, and suggested prompts —
|
|
643
|
-
* without redeploying.
|
|
644
|
-
*
|
|
645
|
-
* Anything passed in code wins, field by field, so this only fills in what
|
|
646
|
-
* you left unset. Pass `false` to ignore the dashboard entirely and
|
|
647
|
-
* configure the embed exclusively from props.
|
|
648
|
-
* @default true
|
|
649
|
-
*/
|
|
650
|
-
remoteConfig?: boolean;
|
|
651
|
-
/**
|
|
652
|
-
* Per-message actions shown under assistant responses: `"copy"` copies the
|
|
653
|
-
* response text, `"feedback"` shows thumbs up/down, `"retry"` regenerates
|
|
654
|
-
* the last response. Pass `false` to hide all actions.
|
|
655
|
-
* @default ["copy", "feedback", "retry"]
|
|
656
|
-
*/
|
|
657
|
-
responseActions?: AgentMessageAction[] | false;
|
|
658
|
-
/**
|
|
659
|
-
* Show the floating launcher button when the panel is closed. Set to
|
|
660
|
-
* `false` when opening the agent exclusively through `useAgent()`.
|
|
661
|
-
* @default true
|
|
662
|
-
*/
|
|
663
|
-
showLauncher?: boolean;
|
|
664
|
-
/**
|
|
665
|
-
* Show a compact Beta chip in the open panel header, next to the assistant
|
|
666
|
-
* title. Useful while the agent is still stabilizing for end users.
|
|
667
|
-
* @default false
|
|
668
|
-
*/
|
|
669
|
-
showBetaBadge?: boolean;
|
|
670
|
-
startScreen?: AgentStartScreenOptions;
|
|
671
|
-
/**
|
|
672
|
-
* Client tools the agent can call in the user's browser. Define with
|
|
673
|
-
* `createToolHelper<Context>()` for typed args and context.
|
|
674
|
-
*/
|
|
675
|
-
tools?: ClientTool[];
|
|
676
|
-
};
|
|
677
|
-
type AgentController = {
|
|
678
|
-
hide: () => void;
|
|
679
|
-
/** Start a fresh conversation, optionally submitting its first prompt immediately. */
|
|
680
|
-
newConversation: (prompt?: string) => void;
|
|
681
|
-
/**
|
|
682
|
-
* Warm the agent now, without opening it — the same work the `preload` prop
|
|
683
|
-
* does on its own. Pair it with `preload={false}` to pick the moment from
|
|
684
|
-
* your own signal: a pricing page, a scroll depth, a form the visitor is
|
|
685
|
-
* struggling with. Cheap to call repeatedly; the work happens once.
|
|
686
|
-
*/
|
|
687
|
-
preload: () => void;
|
|
688
|
-
/** Whether project configuration and the complete composer are ready to open. */
|
|
689
|
-
ready: boolean;
|
|
690
|
-
refreshAuth: () => void;
|
|
691
|
-
show: () => void;
|
|
692
|
-
shutdown: () => void;
|
|
693
|
-
toggle: () => void;
|
|
694
|
-
};
|
|
695
|
-
|
|
696
|
-
/**
|
|
697
|
-
* Imperative controls for the agent embed. Safe to call before
|
|
698
|
-
* `<HeroUIAgent />` mounts (calls are ignored with a console warning). Pass a
|
|
699
|
-
* `agentId` when rendering more than one agent on the same page.
|
|
700
|
-
*/
|
|
6
|
+
/** Imperative controls for the hosted iframe Agent. */
|
|
701
7
|
declare function useAgent(agentId?: string): AgentController;
|
|
702
8
|
/**
|
|
703
|
-
*
|
|
704
|
-
*
|
|
705
|
-
* ```tsx
|
|
706
|
-
* <body>
|
|
707
|
-
* {children}
|
|
708
|
-
* <HeroUIAgent getAuthToken={getAuthToken} agentId={process.env.NEXT_PUBLIC_HEROUI_AGENT_ID!} />
|
|
709
|
-
* </body>
|
|
710
|
-
* ```
|
|
711
|
-
*
|
|
712
|
-
* Renders nothing in the tree; the launcher and chat panel mount into an
|
|
713
|
-
* independent React root on `document.body`.
|
|
9
|
+
* Mounts the lightweight customer-page bridge. All visible Agent UI is owned
|
|
10
|
+
* by the cross-origin hosted iframe.
|
|
714
11
|
*/
|
|
715
|
-
declare function HeroUIAgent(props: HeroUIAgentProps):
|
|
12
|
+
declare function HeroUIAgent(props: HeroUIAgentProps): null;
|
|
716
13
|
|
|
717
|
-
export {
|
|
14
|
+
export { AgentController, HeroUIAgent, HeroUIAgentProps, useAgent };
|