@runtypelabs/persona 4.10.0 → 4.11.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/animations/glyph-cycle.d.cts +1 -1
- package/dist/animations/glyph-cycle.d.ts +1 -1
- package/dist/animations/{types-4ROVJ1gA.d.cts → types-DveIaNx6.d.cts} +11 -316
- package/dist/animations/{types-4ROVJ1gA.d.ts → types-DveIaNx6.d.ts} +11 -316
- package/dist/animations/wipe.d.cts +1 -1
- package/dist/animations/wipe.d.ts +1 -1
- package/dist/chunk-MMUPR2JW.js +1 -0
- package/dist/codegen.cjs +1 -1
- package/dist/codegen.js +1 -1
- package/dist/{context-mentions-7S5KVUTG.js → context-mentions-ONG7A7M6.js} +1 -1
- package/dist/context-mentions.d.cts +35 -316
- package/dist/context-mentions.d.ts +35 -316
- package/dist/index.cjs +67 -67
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +40 -317
- package/dist/index.d.ts +40 -317
- package/dist/index.global.js +55 -55
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +78 -78
- package/dist/index.js.map +1 -1
- package/dist/smart-dom-reader.d.cts +35 -316
- package/dist/smart-dom-reader.d.ts +35 -316
- package/dist/theme-editor-preview.cjs +66 -66
- package/dist/theme-editor-preview.d.cts +35 -316
- package/dist/theme-editor-preview.d.ts +35 -316
- package/dist/theme-editor-preview.js +55 -55
- package/dist/theme-editor.cjs +5 -5
- package/dist/theme-editor.d.cts +35 -316
- package/dist/theme-editor.d.ts +35 -316
- package/dist/theme-editor.js +9 -9
- package/dist/widget.css +1 -1
- package/package.json +1 -1
- package/src/components/approval-bubble.ts +0 -1
- package/src/components/composer-parts.ts +19 -19
- package/src/components/context-mention-button.test.ts +5 -1
- package/src/components/context-mention-button.ts +6 -4
- package/src/components/header-builder.test.ts +3 -3
- package/src/components/header-parts.ts +14 -108
- package/src/components/message-bubble.test.ts +49 -0
- package/src/components/message-bubble.ts +8 -7
- package/src/components/reasoning-bubble.ts +0 -2
- package/src/components/tool-bubble.ts +0 -2
- package/src/generated/runtype-openapi-contract.ts +11 -317
- package/src/index-core.ts +7 -1
- package/src/runtime/host-layout.test.ts +94 -0
- package/src/runtime/host-layout.ts +9 -1
- package/src/runtime/init.test.ts +33 -0
- package/src/runtime/init.ts +4 -0
- package/src/styles/widget.css +118 -58
- package/src/theme-editor/sections.test.ts +33 -0
- package/src/theme-editor/sections.ts +10 -1
- package/src/types.ts +25 -0
- package/src/ui.attachments-drop.test.ts +2 -1
- package/src/ui.message-width.test.ts +407 -0
- package/src/ui.mount-fill-min-width.test.ts +81 -0
- package/src/ui.ts +158 -238
- package/src/utils/table-scroll-fade.test.ts +123 -0
- package/src/utils/table-scroll-fade.ts +75 -0
- package/src/utils/tooltip.test.ts +226 -0
- package/src/utils/tooltip.ts +245 -0
- package/dist/chunk-IPVK3KOM.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { createElement,
|
|
1
|
+
import { createElement, createNode, cx } from "../utils/dom";
|
|
2
2
|
import { renderLucideIcon } from "../utils/icons";
|
|
3
3
|
import { AgentWidgetConfig } from "../types";
|
|
4
|
-
import {
|
|
4
|
+
import { attachTooltip } from "../utils/tooltip";
|
|
5
5
|
import { HEADER_THEME_CSS } from "./header-builder";
|
|
6
6
|
|
|
7
7
|
export interface CloseButtonParts {
|
|
@@ -136,59 +136,12 @@ export const createCloseButton = (
|
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
wrapper.appendChild(button);
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
const tooltipDocument = button.ownerDocument;
|
|
147
|
-
const tooltipContainer = tooltipDocument.body;
|
|
148
|
-
if (!tooltipContainer) return;
|
|
149
|
-
|
|
150
|
-
portaledTooltip = createElementInDocument(
|
|
151
|
-
tooltipDocument,
|
|
152
|
-
"div",
|
|
153
|
-
"persona-clear-chat-tooltip"
|
|
154
|
-
);
|
|
155
|
-
portaledTooltip.textContent = closeButtonTooltipText;
|
|
156
|
-
|
|
157
|
-
const arrow = createElementInDocument(tooltipDocument, "div");
|
|
158
|
-
arrow.className = "persona-clear-chat-tooltip-arrow";
|
|
159
|
-
portaledTooltip.appendChild(arrow);
|
|
160
|
-
|
|
161
|
-
const buttonRect = button.getBoundingClientRect();
|
|
162
|
-
|
|
163
|
-
portaledTooltip.style.position = "fixed";
|
|
164
|
-
portaledTooltip.style.zIndex = String(PORTALED_OVERLAY_Z_INDEX);
|
|
165
|
-
portaledTooltip.style.left = `${buttonRect.left + buttonRect.width / 2}px`;
|
|
166
|
-
portaledTooltip.style.top = `${buttonRect.top - 8}px`;
|
|
167
|
-
portaledTooltip.style.transform = "translate(-50%, -100%)";
|
|
168
|
-
|
|
169
|
-
tooltipContainer.appendChild(portaledTooltip);
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
const hideTooltip = () => {
|
|
173
|
-
if (portaledTooltip && portaledTooltip.parentNode) {
|
|
174
|
-
portaledTooltip.parentNode.removeChild(portaledTooltip);
|
|
175
|
-
portaledTooltip = null;
|
|
176
|
-
}
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
wrapper.addEventListener("mouseenter", showTooltip);
|
|
180
|
-
wrapper.addEventListener("mouseleave", hideTooltip);
|
|
181
|
-
button.addEventListener("focus", showTooltip);
|
|
182
|
-
button.addEventListener("blur", hideTooltip);
|
|
183
|
-
|
|
184
|
-
(wrapper as any)._cleanupTooltip = () => {
|
|
185
|
-
hideTooltip();
|
|
186
|
-
wrapper.removeEventListener("mouseenter", showTooltip);
|
|
187
|
-
wrapper.removeEventListener("mouseleave", hideTooltip);
|
|
188
|
-
button.removeEventListener("focus", showTooltip);
|
|
189
|
-
button.removeEventListener("blur", hideTooltip);
|
|
190
|
-
};
|
|
191
|
-
}
|
|
139
|
+
attachTooltip({
|
|
140
|
+
anchor: button,
|
|
141
|
+
trigger: wrapper,
|
|
142
|
+
text: () => button.getAttribute("aria-label") ?? closeButtonTooltipText,
|
|
143
|
+
enabled: closeButtonShowTooltip,
|
|
144
|
+
});
|
|
192
145
|
|
|
193
146
|
return { button, wrapper };
|
|
194
147
|
};
|
|
@@ -271,59 +224,12 @@ export const createClearChatButton = (
|
|
|
271
224
|
}
|
|
272
225
|
|
|
273
226
|
wrapper.appendChild(button);
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
const tooltipDocument = button.ownerDocument;
|
|
282
|
-
const tooltipContainer = tooltipDocument.body;
|
|
283
|
-
if (!tooltipContainer) return;
|
|
284
|
-
|
|
285
|
-
portaledTooltip = createElementInDocument(
|
|
286
|
-
tooltipDocument,
|
|
287
|
-
"div",
|
|
288
|
-
"persona-clear-chat-tooltip"
|
|
289
|
-
);
|
|
290
|
-
portaledTooltip.textContent = clearChatTooltipText;
|
|
291
|
-
|
|
292
|
-
const arrow = createElementInDocument(tooltipDocument, "div");
|
|
293
|
-
arrow.className = "persona-clear-chat-tooltip-arrow";
|
|
294
|
-
portaledTooltip.appendChild(arrow);
|
|
295
|
-
|
|
296
|
-
const buttonRect = button.getBoundingClientRect();
|
|
297
|
-
|
|
298
|
-
portaledTooltip.style.position = "fixed";
|
|
299
|
-
portaledTooltip.style.zIndex = String(PORTALED_OVERLAY_Z_INDEX);
|
|
300
|
-
portaledTooltip.style.left = `${buttonRect.left + buttonRect.width / 2}px`;
|
|
301
|
-
portaledTooltip.style.top = `${buttonRect.top - 8}px`;
|
|
302
|
-
portaledTooltip.style.transform = "translate(-50%, -100%)";
|
|
303
|
-
|
|
304
|
-
tooltipContainer.appendChild(portaledTooltip);
|
|
305
|
-
};
|
|
306
|
-
|
|
307
|
-
const hideTooltip = () => {
|
|
308
|
-
if (portaledTooltip && portaledTooltip.parentNode) {
|
|
309
|
-
portaledTooltip.parentNode.removeChild(portaledTooltip);
|
|
310
|
-
portaledTooltip = null;
|
|
311
|
-
}
|
|
312
|
-
};
|
|
313
|
-
|
|
314
|
-
wrapper.addEventListener("mouseenter", showTooltip);
|
|
315
|
-
wrapper.addEventListener("mouseleave", hideTooltip);
|
|
316
|
-
button.addEventListener("focus", showTooltip);
|
|
317
|
-
button.addEventListener("blur", hideTooltip);
|
|
318
|
-
|
|
319
|
-
(wrapper as any)._cleanupTooltip = () => {
|
|
320
|
-
hideTooltip();
|
|
321
|
-
wrapper.removeEventListener("mouseenter", showTooltip);
|
|
322
|
-
wrapper.removeEventListener("mouseleave", hideTooltip);
|
|
323
|
-
button.removeEventListener("focus", showTooltip);
|
|
324
|
-
button.removeEventListener("blur", hideTooltip);
|
|
325
|
-
};
|
|
326
|
-
}
|
|
227
|
+
attachTooltip({
|
|
228
|
+
anchor: button,
|
|
229
|
+
trigger: wrapper,
|
|
230
|
+
text: () => button.getAttribute("aria-label") ?? clearChatTooltipText,
|
|
231
|
+
enabled: clearChatShowTooltip,
|
|
232
|
+
});
|
|
327
233
|
|
|
328
234
|
return { button, wrapper };
|
|
329
235
|
};
|
|
@@ -257,6 +257,55 @@ describe("isSafeImageSrc", () => {
|
|
|
257
257
|
});
|
|
258
258
|
|
|
259
259
|
describe("createStandardBubble", () => {
|
|
260
|
+
it("uses a compact user bubble and borderless assistant response in minimal style", () => {
|
|
261
|
+
const userBubble = createStandardBubble(
|
|
262
|
+
makeMessage({ id: "minimal-user", role: "user", content: "Question" }),
|
|
263
|
+
({ text }) => text,
|
|
264
|
+
{ layout: "minimal" }
|
|
265
|
+
);
|
|
266
|
+
const assistantBubble = createStandardBubble(
|
|
267
|
+
makeMessage({
|
|
268
|
+
id: "minimal-assistant",
|
|
269
|
+
role: "assistant",
|
|
270
|
+
content: "Answer",
|
|
271
|
+
}),
|
|
272
|
+
({ text }) => text,
|
|
273
|
+
{ layout: "minimal" }
|
|
274
|
+
);
|
|
275
|
+
|
|
276
|
+
expect(userBubble.classList.contains("persona-bg-persona-accent")).toBe(true);
|
|
277
|
+
expect(userBubble.classList.contains("persona-rounded-lg")).toBe(true);
|
|
278
|
+
expect(userBubble.classList.contains("persona-px-3")).toBe(true);
|
|
279
|
+
expect(assistantBubble.classList.contains("persona-bg-persona-surface")).toBe(
|
|
280
|
+
true
|
|
281
|
+
);
|
|
282
|
+
expect(assistantBubble.classList.contains("persona-rounded-lg")).toBe(true);
|
|
283
|
+
expect(assistantBubble.classList.contains("persona-border")).toBe(false);
|
|
284
|
+
expect(assistantBubble.classList.contains("persona-shadow-sm")).toBe(false);
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
it("removes role background chrome from flat messages", () => {
|
|
288
|
+
const userMessage = createStandardBubble(
|
|
289
|
+
makeMessage({ id: "flat-user", role: "user", content: "Question" }),
|
|
290
|
+
({ text }) => text,
|
|
291
|
+
{ layout: "flat" }
|
|
292
|
+
);
|
|
293
|
+
const assistantMessage = createStandardBubble(
|
|
294
|
+
makeMessage({
|
|
295
|
+
id: "flat-assistant",
|
|
296
|
+
role: "assistant",
|
|
297
|
+
content: "Answer",
|
|
298
|
+
}),
|
|
299
|
+
({ text }) => text,
|
|
300
|
+
{ layout: "flat" }
|
|
301
|
+
);
|
|
302
|
+
|
|
303
|
+
expect(userMessage.style.backgroundColor).toBe("transparent");
|
|
304
|
+
expect(assistantMessage.style.backgroundColor).toBe("transparent");
|
|
305
|
+
expect(userMessage.classList.contains("persona-px-3")).toBe(false);
|
|
306
|
+
expect(assistantMessage.classList.contains("persona-px-3")).toBe(false);
|
|
307
|
+
});
|
|
308
|
+
|
|
260
309
|
it("skips rendering blocked image previews while keeping safe ones", () => {
|
|
261
310
|
const bubble = createStandardBubble(
|
|
262
311
|
makeMessage({
|
|
@@ -653,7 +653,7 @@ const getBubbleClasses = (
|
|
|
653
653
|
role: "user" | "assistant" | "system",
|
|
654
654
|
layout: AgentWidgetMessageLayoutConfig["layout"] = "bubble"
|
|
655
655
|
): string[] => {
|
|
656
|
-
const baseClasses = ["persona-message-bubble"
|
|
656
|
+
const baseClasses = ["persona-message-bubble"];
|
|
657
657
|
|
|
658
658
|
switch (layout) {
|
|
659
659
|
case "flat":
|
|
@@ -877,7 +877,10 @@ export const createStandardBubble = (
|
|
|
877
877
|
bubble.setAttribute("data-persona-theme-zone", message.role === "user" ? "user-message" : "assistant-message");
|
|
878
878
|
|
|
879
879
|
// Apply component-level color overrides via CSS variables
|
|
880
|
-
if (
|
|
880
|
+
if (layout === "flat") {
|
|
881
|
+
bubble.style.backgroundColor = "transparent";
|
|
882
|
+
bubble.style.color = "var(--persona-primary, var(--persona-text))";
|
|
883
|
+
} else if (message.role === "user") {
|
|
881
884
|
bubble.style.backgroundColor = 'var(--persona-message-user-bg, var(--persona-accent))';
|
|
882
885
|
bubble.style.color = 'var(--persona-message-user-text, white)';
|
|
883
886
|
} else if (message.role === "assistant") {
|
|
@@ -1171,7 +1174,9 @@ export const createStandardBubble = (
|
|
|
1171
1174
|
// Create wrapper with avatar
|
|
1172
1175
|
const wrapper = createElement(
|
|
1173
1176
|
"div",
|
|
1174
|
-
`persona-flex persona-gap-2 ${
|
|
1177
|
+
`persona-message-with-avatar persona-flex persona-gap-2 ${
|
|
1178
|
+
message.role === "user" ? "persona-flex-row-reverse" : ""
|
|
1179
|
+
}`
|
|
1175
1180
|
);
|
|
1176
1181
|
|
|
1177
1182
|
const avatar = createAvatar(avatarConfig!, message.role);
|
|
@@ -1182,10 +1187,6 @@ export const createStandardBubble = (
|
|
|
1182
1187
|
wrapper.append(avatar, bubble);
|
|
1183
1188
|
}
|
|
1184
1189
|
|
|
1185
|
-
// Adjust bubble max-width when avatar is present
|
|
1186
|
-
bubble.classList.remove("persona-max-w-[85%]");
|
|
1187
|
-
bubble.classList.add("persona-max-w-[calc(85%-2.5rem)]");
|
|
1188
|
-
|
|
1189
1190
|
return wrapper;
|
|
1190
1191
|
};
|
|
1191
1192
|
|
|
@@ -72,7 +72,6 @@ export const createReasoningBubble = (message: AgentWidgetMessage, config?: Agen
|
|
|
72
72
|
"persona-message-bubble",
|
|
73
73
|
"persona-reasoning-bubble",
|
|
74
74
|
"persona-w-full",
|
|
75
|
-
"persona-max-w-[85%]",
|
|
76
75
|
"persona-rounded-2xl",
|
|
77
76
|
"persona-bg-persona-surface",
|
|
78
77
|
"persona-border",
|
|
@@ -352,4 +351,3 @@ export const createReasoningBubble = (message: AgentWidgetMessage, config?: Agen
|
|
|
352
351
|
};
|
|
353
352
|
|
|
354
353
|
|
|
355
|
-
|
|
@@ -146,7 +146,6 @@ export const createToolBubble = (message: AgentWidgetMessage, config?: AgentWidg
|
|
|
146
146
|
"persona-message-bubble",
|
|
147
147
|
"persona-tool-bubble",
|
|
148
148
|
"persona-w-full",
|
|
149
|
-
"persona-max-w-[85%]",
|
|
150
149
|
"persona-rounded-2xl",
|
|
151
150
|
"persona-bg-persona-surface",
|
|
152
151
|
"persona-border",
|
|
@@ -544,4 +543,3 @@ export const createToolBubble = (message: AgentWidgetMessage, config?: AgentWidg
|
|
|
544
543
|
};
|
|
545
544
|
|
|
546
545
|
|
|
547
|
-
|
|
@@ -26,6 +26,10 @@ export type RuntypeExecutionStreamEvent = ({
|
|
|
26
26
|
completedAt?: string;
|
|
27
27
|
durationMs?: number;
|
|
28
28
|
executionId: string;
|
|
29
|
+
externalAgent?: {
|
|
30
|
+
contextId?: string;
|
|
31
|
+
taskId?: string;
|
|
32
|
+
};
|
|
29
33
|
failedSteps?: number;
|
|
30
34
|
finalOutput?: string;
|
|
31
35
|
iterations?: number;
|
|
@@ -40,6 +44,7 @@ export type RuntypeExecutionStreamEvent = ({
|
|
|
40
44
|
input: number;
|
|
41
45
|
output: number;
|
|
42
46
|
};
|
|
47
|
+
totalTokensUsed?: number;
|
|
43
48
|
type: "execution_complete";
|
|
44
49
|
}) | ({
|
|
45
50
|
blockReason?: string;
|
|
@@ -299,12 +304,17 @@ export type RuntypeExecutionStreamEvent = ({
|
|
|
299
304
|
stepId?: string;
|
|
300
305
|
success: boolean;
|
|
301
306
|
toolCallId: string;
|
|
307
|
+
toolCost?: number;
|
|
302
308
|
toolName?: string;
|
|
303
309
|
type: "tool_complete";
|
|
304
310
|
} | {
|
|
305
311
|
approvalId: string;
|
|
306
312
|
description?: string;
|
|
307
313
|
executionId: string;
|
|
314
|
+
externalAgent?: {
|
|
315
|
+
contextId?: string;
|
|
316
|
+
taskId?: string;
|
|
317
|
+
};
|
|
308
318
|
iteration?: number;
|
|
309
319
|
parameters?: Record<string, unknown>;
|
|
310
320
|
reason?: string;
|
|
@@ -373,322 +383,6 @@ export type RuntypeExecutionStreamEvent = ({
|
|
|
373
383
|
value?: unknown;
|
|
374
384
|
};
|
|
375
385
|
|
|
376
|
-
export type RuntypeFlowSSEEvent = {
|
|
377
|
-
executionContext?: Record<string, unknown>;
|
|
378
|
-
executionId?: string;
|
|
379
|
-
flowId: string;
|
|
380
|
-
flowName?: string;
|
|
381
|
-
input?: unknown;
|
|
382
|
-
seq?: number;
|
|
383
|
-
source?: string;
|
|
384
|
-
startedAt: string;
|
|
385
|
-
toolContext?: {
|
|
386
|
-
executionId: string;
|
|
387
|
-
stepId: string;
|
|
388
|
-
toolId: string;
|
|
389
|
-
};
|
|
390
|
-
totalSteps?: number;
|
|
391
|
-
type: "flow_start";
|
|
392
|
-
} | {
|
|
393
|
-
claudeManagedAgentId?: string;
|
|
394
|
-
completedAt?: string;
|
|
395
|
-
completedSteps?: number;
|
|
396
|
-
duration?: number;
|
|
397
|
-
executionContext?: Record<string, unknown>;
|
|
398
|
-
executionId?: string;
|
|
399
|
-
executionTime?: number;
|
|
400
|
-
failedSteps?: number;
|
|
401
|
-
finalOutput?: string;
|
|
402
|
-
flowId?: string;
|
|
403
|
-
flowName?: string;
|
|
404
|
-
output?: unknown;
|
|
405
|
-
seq?: number;
|
|
406
|
-
source?: string;
|
|
407
|
-
success?: boolean;
|
|
408
|
-
successfulSteps?: number;
|
|
409
|
-
toolContext?: {
|
|
410
|
-
executionId: string;
|
|
411
|
-
stepId: string;
|
|
412
|
-
toolId: string;
|
|
413
|
-
};
|
|
414
|
-
totalSteps?: number;
|
|
415
|
-
totalTokensUsed?: number;
|
|
416
|
-
type: "flow_complete";
|
|
417
|
-
} | ({
|
|
418
|
-
blockReason?: string;
|
|
419
|
-
code?: string;
|
|
420
|
-
error: string | {
|
|
421
|
-
code: string;
|
|
422
|
-
message: string;
|
|
423
|
-
stepId?: string;
|
|
424
|
-
stepType?: string;
|
|
425
|
-
};
|
|
426
|
-
executionId?: string;
|
|
427
|
-
executionTime?: number;
|
|
428
|
-
flowId?: string;
|
|
429
|
-
seq?: number;
|
|
430
|
-
timestamp?: string;
|
|
431
|
-
toolContext?: {
|
|
432
|
-
executionId: string;
|
|
433
|
-
stepId: string;
|
|
434
|
-
toolId: string;
|
|
435
|
-
};
|
|
436
|
-
type: "flow_error";
|
|
437
|
-
upgradeUrl?: string;
|
|
438
|
-
}) | ({
|
|
439
|
-
approvalId?: string;
|
|
440
|
-
awaitReason?: string;
|
|
441
|
-
awaitedAt: string;
|
|
442
|
-
crawlId?: string;
|
|
443
|
-
elicitation?: {
|
|
444
|
-
message: string;
|
|
445
|
-
mode: "form" | "url";
|
|
446
|
-
pauseCount?: number;
|
|
447
|
-
requestedSchema?: Record<string, unknown>;
|
|
448
|
-
serverName?: string;
|
|
449
|
-
url?: string;
|
|
450
|
-
};
|
|
451
|
-
executionId?: string;
|
|
452
|
-
flowId: string;
|
|
453
|
-
origin?: "webmcp" | "sdk";
|
|
454
|
-
pageOrigin?: string;
|
|
455
|
-
parameters?: Record<string, unknown>;
|
|
456
|
-
seq?: number;
|
|
457
|
-
stepId?: string;
|
|
458
|
-
timeout?: number;
|
|
459
|
-
toolCallId?: string;
|
|
460
|
-
toolId?: string;
|
|
461
|
-
toolName?: string;
|
|
462
|
-
type: "flow_await";
|
|
463
|
-
}) | {
|
|
464
|
-
estimatedTokens?: number;
|
|
465
|
-
executionId?: string;
|
|
466
|
-
id?: string;
|
|
467
|
-
index?: number;
|
|
468
|
-
name?: string;
|
|
469
|
-
outputVariable?: string;
|
|
470
|
-
seq?: number;
|
|
471
|
-
startedAt: string;
|
|
472
|
-
stepId?: string;
|
|
473
|
-
stepName?: string;
|
|
474
|
-
stepType?: string;
|
|
475
|
-
toolContext?: {
|
|
476
|
-
executionId: string;
|
|
477
|
-
stepId: string;
|
|
478
|
-
toolId: string;
|
|
479
|
-
};
|
|
480
|
-
totalSteps?: number;
|
|
481
|
-
type: "step_start";
|
|
482
|
-
} | {
|
|
483
|
-
delta?: string;
|
|
484
|
-
executionId?: string;
|
|
485
|
-
id?: string;
|
|
486
|
-
messageId?: string;
|
|
487
|
-
partId?: string;
|
|
488
|
-
seq?: number;
|
|
489
|
-
text?: string;
|
|
490
|
-
toolContext?: {
|
|
491
|
-
executionId: string;
|
|
492
|
-
stepId: string;
|
|
493
|
-
toolId: string;
|
|
494
|
-
};
|
|
495
|
-
toolId?: string;
|
|
496
|
-
type: "step_delta";
|
|
497
|
-
} | ({
|
|
498
|
-
completedAt?: string;
|
|
499
|
-
duration?: number;
|
|
500
|
-
durationMs?: number;
|
|
501
|
-
error?: string | null;
|
|
502
|
-
executionId?: string;
|
|
503
|
-
executionTime?: number;
|
|
504
|
-
id?: string;
|
|
505
|
-
index?: number;
|
|
506
|
-
name?: string;
|
|
507
|
-
output?: unknown;
|
|
508
|
-
result?: unknown;
|
|
509
|
-
seq?: number;
|
|
510
|
-
stepId?: string;
|
|
511
|
-
stepName?: string;
|
|
512
|
-
stepType?: string;
|
|
513
|
-
stopReason?: "end_turn" | "max_tool_calls" | "length" | "content_filter" | "error" | "unknown";
|
|
514
|
-
success?: boolean;
|
|
515
|
-
tokensUsed?: number;
|
|
516
|
-
toolContext?: {
|
|
517
|
-
executionId: string;
|
|
518
|
-
stepId: string;
|
|
519
|
-
toolId: string;
|
|
520
|
-
};
|
|
521
|
-
type: "step_complete";
|
|
522
|
-
unresolvedVariables?: Array<string>;
|
|
523
|
-
}) | {
|
|
524
|
-
error: string;
|
|
525
|
-
executionId?: string;
|
|
526
|
-
executionTime?: number;
|
|
527
|
-
id?: string;
|
|
528
|
-
index?: number;
|
|
529
|
-
name?: string;
|
|
530
|
-
seq?: number;
|
|
531
|
-
stepType?: string;
|
|
532
|
-
type: "step_error";
|
|
533
|
-
} | {
|
|
534
|
-
error?: string;
|
|
535
|
-
executionId?: string;
|
|
536
|
-
id: string;
|
|
537
|
-
index?: number;
|
|
538
|
-
name?: string;
|
|
539
|
-
seq?: number;
|
|
540
|
-
skippedAt: string;
|
|
541
|
-
stepType: string;
|
|
542
|
-
totalSteps: number;
|
|
543
|
-
type: "step_skip";
|
|
544
|
-
when: string;
|
|
545
|
-
} | ({
|
|
546
|
-
elicitation?: {
|
|
547
|
-
message: string;
|
|
548
|
-
mode: "form" | "url";
|
|
549
|
-
pauseCount?: number;
|
|
550
|
-
requestedSchema?: Record<string, unknown>;
|
|
551
|
-
serverName?: string;
|
|
552
|
-
url?: string;
|
|
553
|
-
};
|
|
554
|
-
executionId?: string;
|
|
555
|
-
reason?: string;
|
|
556
|
-
seq?: number;
|
|
557
|
-
type: "step_await";
|
|
558
|
-
[key: string]: unknown;
|
|
559
|
-
}) | ({
|
|
560
|
-
agentContext?: {
|
|
561
|
-
executionId: string;
|
|
562
|
-
iteration: number;
|
|
563
|
-
seq: number;
|
|
564
|
-
};
|
|
565
|
-
executionId?: string;
|
|
566
|
-
hiddenParameterNames?: Array<string>;
|
|
567
|
-
name?: string;
|
|
568
|
-
parameters?: Record<string, unknown>;
|
|
569
|
-
providerOptions?: Record<string, unknown>;
|
|
570
|
-
seq?: number;
|
|
571
|
-
startedAt?: string;
|
|
572
|
-
stepId?: string;
|
|
573
|
-
toolCallId?: string;
|
|
574
|
-
toolId?: string;
|
|
575
|
-
toolName?: string;
|
|
576
|
-
toolType: "flow" | "mcp" | "builtin" | "custom" | "external" | "advisor" | "subagent" | "local";
|
|
577
|
-
type: "tool_start";
|
|
578
|
-
[key: string]: unknown;
|
|
579
|
-
}) | {
|
|
580
|
-
delta?: string;
|
|
581
|
-
executionId?: string;
|
|
582
|
-
seq?: number;
|
|
583
|
-
toolId?: string;
|
|
584
|
-
type: "tool_delta";
|
|
585
|
-
[key: string]: unknown;
|
|
586
|
-
} | {
|
|
587
|
-
delta: string;
|
|
588
|
-
executionId?: string;
|
|
589
|
-
seq?: number;
|
|
590
|
-
stepId?: string;
|
|
591
|
-
toolCallId?: string;
|
|
592
|
-
toolId?: string;
|
|
593
|
-
type: "tool_input_delta";
|
|
594
|
-
} | {
|
|
595
|
-
executionId?: string;
|
|
596
|
-
hiddenParameterNames?: Array<string>;
|
|
597
|
-
parameters: Record<string, unknown>;
|
|
598
|
-
providerOptions?: Record<string, unknown>;
|
|
599
|
-
seq?: number;
|
|
600
|
-
stepId?: string;
|
|
601
|
-
toolCallId?: string;
|
|
602
|
-
toolId?: string;
|
|
603
|
-
toolName?: string;
|
|
604
|
-
type: "tool_input_complete";
|
|
605
|
-
} | {
|
|
606
|
-
agentContext?: {
|
|
607
|
-
executionId: string;
|
|
608
|
-
iteration: number;
|
|
609
|
-
seq: number;
|
|
610
|
-
};
|
|
611
|
-
completedAt?: string;
|
|
612
|
-
error?: string;
|
|
613
|
-
executionId?: string;
|
|
614
|
-
executionTime?: number;
|
|
615
|
-
name?: string;
|
|
616
|
-
result?: unknown;
|
|
617
|
-
seq?: number;
|
|
618
|
-
stepId?: string;
|
|
619
|
-
success: boolean;
|
|
620
|
-
toolCallId?: string;
|
|
621
|
-
toolCost?: number;
|
|
622
|
-
toolId?: string;
|
|
623
|
-
toolName?: string;
|
|
624
|
-
type: "tool_complete";
|
|
625
|
-
} | {
|
|
626
|
-
agentContext?: {
|
|
627
|
-
executionId: string;
|
|
628
|
-
iteration: number;
|
|
629
|
-
seq: number;
|
|
630
|
-
};
|
|
631
|
-
error: string;
|
|
632
|
-
executionId?: string;
|
|
633
|
-
executionTime?: number;
|
|
634
|
-
failedAt?: string;
|
|
635
|
-
name: string;
|
|
636
|
-
seq?: number;
|
|
637
|
-
toolId: string;
|
|
638
|
-
type: "tool_error";
|
|
639
|
-
} | {
|
|
640
|
-
executionId?: string;
|
|
641
|
-
id: string;
|
|
642
|
-
seq?: number;
|
|
643
|
-
text: string;
|
|
644
|
-
type: "chunk";
|
|
645
|
-
} | {
|
|
646
|
-
executionId?: string;
|
|
647
|
-
seq?: number;
|
|
648
|
-
type: "text_start";
|
|
649
|
-
[key: string]: unknown;
|
|
650
|
-
} | {
|
|
651
|
-
executionId?: string;
|
|
652
|
-
seq?: number;
|
|
653
|
-
type: "text_end";
|
|
654
|
-
[key: string]: unknown;
|
|
655
|
-
} | {
|
|
656
|
-
executionId?: string;
|
|
657
|
-
seq?: number;
|
|
658
|
-
type: "reason_start";
|
|
659
|
-
[key: string]: unknown;
|
|
660
|
-
} | {
|
|
661
|
-
executionId?: string;
|
|
662
|
-
seq?: number;
|
|
663
|
-
type: "reason_delta";
|
|
664
|
-
[key: string]: unknown;
|
|
665
|
-
} | {
|
|
666
|
-
executionId?: string;
|
|
667
|
-
seq?: number;
|
|
668
|
-
type: "reason_complete";
|
|
669
|
-
[key: string]: unknown;
|
|
670
|
-
} | {
|
|
671
|
-
executionId?: string;
|
|
672
|
-
seq?: number;
|
|
673
|
-
type: "source";
|
|
674
|
-
[key: string]: unknown;
|
|
675
|
-
} | {
|
|
676
|
-
executionId?: string;
|
|
677
|
-
seq?: number;
|
|
678
|
-
type: "fallback_start";
|
|
679
|
-
[key: string]: unknown;
|
|
680
|
-
} | {
|
|
681
|
-
executionId?: string;
|
|
682
|
-
seq?: number;
|
|
683
|
-
type: "fallback_complete";
|
|
684
|
-
[key: string]: unknown;
|
|
685
|
-
} | {
|
|
686
|
-
executionId?: string;
|
|
687
|
-
seq?: number;
|
|
688
|
-
type: "fallback_exhausted";
|
|
689
|
-
[key: string]: unknown;
|
|
690
|
-
};
|
|
691
|
-
|
|
692
386
|
export type RuntypeStreamEventOf<U, T extends string> = Extract<U, { type: T }>;
|
|
693
387
|
|
|
694
388
|
export type RuntypeTurnCompleteEvent = RuntypeStreamEventOf<
|
|
@@ -697,7 +391,7 @@ export type RuntypeTurnCompleteEvent = RuntypeStreamEventOf<
|
|
|
697
391
|
>;
|
|
698
392
|
|
|
699
393
|
export type RuntypeStepCompleteEvent = RuntypeStreamEventOf<
|
|
700
|
-
|
|
394
|
+
RuntypeExecutionStreamEvent,
|
|
701
395
|
"step_complete"
|
|
702
396
|
>;
|
|
703
397
|
|
package/src/index-core.ts
CHANGED
|
@@ -65,6 +65,7 @@ export type {
|
|
|
65
65
|
AgentWidgetLayoutConfig,
|
|
66
66
|
AgentWidgetHeaderLayoutConfig,
|
|
67
67
|
AgentWidgetMessageLayoutConfig,
|
|
68
|
+
AgentWidgetMessageRoleLayout,
|
|
68
69
|
AgentWidgetAvatarConfig,
|
|
69
70
|
AgentWidgetTimestampConfig,
|
|
70
71
|
WidgetLayoutSlot,
|
|
@@ -135,7 +136,6 @@ export type {
|
|
|
135
136
|
|
|
136
137
|
export type {
|
|
137
138
|
RuntypeExecutionStreamEvent,
|
|
138
|
-
RuntypeFlowSSEEvent,
|
|
139
139
|
RuntypeStreamEventOf,
|
|
140
140
|
RuntypeTurnCompleteEvent,
|
|
141
141
|
RuntypeStepCompleteEvent,
|
|
@@ -151,6 +151,12 @@ export type {
|
|
|
151
151
|
RuntypeClientFeedbackType,
|
|
152
152
|
} from "./generated/runtype-openapi-contract";
|
|
153
153
|
|
|
154
|
+
import type { RuntypeExecutionStreamEvent } from "./generated/runtype-openapi-contract";
|
|
155
|
+
|
|
156
|
+
/** @deprecated FlowSSEEvent was folded into the unified ExecutionStreamEvent
|
|
157
|
+
* (Runtype PR #5722). Use RuntypeExecutionStreamEvent instead. */
|
|
158
|
+
export type RuntypeFlowSSEEvent = RuntypeExecutionStreamEvent;
|
|
159
|
+
|
|
154
160
|
export {
|
|
155
161
|
ASK_USER_QUESTION_TOOL_NAME,
|
|
156
162
|
createAskUserQuestionBubble,
|