@gram-ai/elements 1.27.3 → 1.27.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/README.md +72 -60
- package/README.typedoc.md +6 -6
- package/bin/cli.js +74 -74
- package/dist/compat-shims-CO9JXXV4.cjs.map +1 -1
- package/dist/{compat-shims-BPJ7Q68c.js → compat-shims-DxtUrORi.js} +4 -2
- package/dist/compat-shims-DxtUrORi.js.map +1 -0
- package/dist/components/ShareButton/index.d.ts +2 -2
- package/dist/components/assistant-ui/message-feedback.d.ts +1 -1
- package/dist/components/assistant-ui/tooltip-icon-button.d.ts +2 -2
- package/dist/components/ui/avatar.d.ts +2 -2
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/calendar.d.ts +1 -1
- package/dist/components/ui/collapsible.d.ts +1 -1
- package/dist/components/ui/dialog.d.ts +4 -4
- package/dist/components/ui/popover.d.ts +2 -2
- package/dist/components/ui/skeleton.d.ts +1 -1
- package/dist/components/ui/time-range-picker.d.ts +4 -2
- package/dist/components/ui/tool-ui.d.ts +7 -7
- package/dist/components/ui/tooltip.d.ts +2 -2
- package/dist/contexts/ConnectionStatusContext.d.ts +1 -1
- package/dist/elements.cjs +1 -1
- package/dist/elements.css +1 -1
- package/dist/elements.js +2 -2
- package/dist/hooks/useDensity.d.ts +73 -73
- package/dist/hooks/useMCPTools.d.ts +1 -1
- package/dist/hooks/useRadius.d.ts +1 -1
- package/dist/{index-BpJstUh1.cjs → index-C4bFBGfl.cjs} +4 -4
- package/dist/{index-BpJstUh1.cjs.map → index-C4bFBGfl.cjs.map} +1 -1
- package/dist/{index-CUitXazZ.js → index-D93pV0_o.js} +55 -55
- package/dist/{index-CUitXazZ.js.map → index-D93pV0_o.js.map} +1 -1
- package/dist/{index-DBrhzauj.js → index-DuCQRbcQ.js} +6386 -6337
- package/dist/index-DuCQRbcQ.js.map +1 -0
- package/dist/{index-DxfW52oA.cjs → index-y_PNN5vK.cjs} +64 -46
- package/dist/index-y_PNN5vK.cjs.map +1 -0
- package/dist/lib/cassette.d.ts +4 -4
- package/dist/lib/errorTracking.d.ts +1 -1
- package/dist/lib/messageConverter.d.ts +1 -1
- package/dist/lib/models.d.ts +1 -1
- package/dist/plugins/chart/ui/bar-chart.d.ts +1 -1
- package/dist/plugins/generative-ui/ui/accordion-wrapper.d.ts +2 -2
- package/dist/plugins/generative-ui/ui/accordion.d.ts +1 -1
- package/dist/plugins/generative-ui/ui/action-button.d.ts +2 -2
- package/dist/plugins/generative-ui/ui/alert-wrapper.d.ts +1 -1
- package/dist/plugins/generative-ui/ui/alert.d.ts +4 -4
- package/dist/plugins/generative-ui/ui/avatar.d.ts +5 -5
- package/dist/plugins/generative-ui/ui/badge.d.ts +2 -2
- package/dist/plugins/generative-ui/ui/button-wrapper.d.ts +2 -2
- package/dist/plugins/generative-ui/ui/button.d.ts +2 -2
- package/dist/plugins/generative-ui/ui/card-wrapper.d.ts +2 -2
- package/dist/plugins/generative-ui/ui/card.d.ts +8 -8
- package/dist/plugins/generative-ui/ui/checkbox.d.ts +1 -1
- package/dist/plugins/generative-ui/ui/data-table.d.ts +2 -2
- package/dist/plugins/generative-ui/ui/dialog.d.ts +3 -3
- package/dist/plugins/generative-ui/ui/dropdown-menu.d.ts +3 -3
- package/dist/plugins/generative-ui/ui/grid.d.ts +3 -3
- package/dist/plugins/generative-ui/ui/input-wrapper.d.ts +1 -1
- package/dist/plugins/generative-ui/ui/input.d.ts +2 -2
- package/dist/plugins/generative-ui/ui/label.d.ts +1 -1
- package/dist/plugins/generative-ui/ui/metric.d.ts +3 -3
- package/dist/plugins/generative-ui/ui/pagination.d.ts +6 -6
- package/dist/plugins/generative-ui/ui/popover.d.ts +4 -4
- package/dist/plugins/generative-ui/ui/progress.d.ts +2 -2
- package/dist/plugins/generative-ui/ui/radio-group.d.ts +1 -1
- package/dist/plugins/generative-ui/ui/select.d.ts +2 -2
- package/dist/plugins/generative-ui/ui/separator.d.ts +1 -1
- package/dist/plugins/generative-ui/ui/skeleton.d.ts +1 -1
- package/dist/plugins/generative-ui/ui/stack.d.ts +6 -6
- package/dist/plugins/generative-ui/ui/switch.d.ts +2 -2
- package/dist/plugins/generative-ui/ui/table.d.ts +9 -9
- package/dist/plugins/generative-ui/ui/tabs-wrapper.d.ts +1 -1
- package/dist/plugins/generative-ui/ui/tabs.d.ts +1 -1
- package/dist/plugins/generative-ui/ui/text.d.ts +3 -3
- package/dist/plugins/generative-ui/ui/textarea.d.ts +2 -2
- package/dist/plugins/generative-ui/ui/tooltip.d.ts +1 -1
- package/dist/plugins.cjs +1 -1
- package/dist/plugins.js +1 -1
- package/dist/{profiler-D6ndqfsd.js → profiler-FpBY9eRv.js} +2 -2
- package/dist/{profiler-D6ndqfsd.js.map → profiler-FpBY9eRv.js.map} +1 -1
- package/dist/{profiler-DhnzZ34c.cjs → profiler-_mthyjvo.cjs} +2 -2
- package/dist/{profiler-DhnzZ34c.cjs.map → profiler-_mthyjvo.cjs.map} +1 -1
- package/dist/react-shim.js +1 -1
- package/dist/server/express.cjs.map +1 -1
- package/dist/server/express.js.map +1 -1
- package/dist/{startRecording-BwXmdmy1.cjs → startRecording-NJcpiHw-.cjs} +2 -2
- package/dist/{startRecording-BwXmdmy1.cjs.map → startRecording-NJcpiHw-.cjs.map} +1 -1
- package/dist/{startRecording-B_9CRZ_P.js → startRecording-r5MXQ2Dm.js} +2 -2
- package/dist/{startRecording-B_9CRZ_P.js.map → startRecording-r5MXQ2Dm.js.map} +1 -1
- package/dist/types/index.d.ts +2 -2
- package/package.json +1 -5
- package/src/compat-plugin.ts +14 -14
- package/src/compat-shims.ts +33 -31
- package/src/compat.test.ts +48 -48
- package/src/compat.ts +6 -6
- package/src/components/Chat/index.tsx +17 -17
- package/src/components/Chat/stories/Charts.stories.tsx +98 -98
- package/src/components/Chat/stories/Composer.stories.tsx +15 -15
- package/src/components/Chat/stories/ConnectionConfiguration.stories.tsx +44 -44
- package/src/components/Chat/stories/CustomComponents.stories.tsx +17 -17
- package/src/components/Chat/stories/Density.stories.tsx +20 -20
- package/src/components/Chat/stories/ErrorBoundary.stories.tsx +47 -47
- package/src/components/Chat/stories/FrontendTools.stories.tsx +39 -39
- package/src/components/Chat/stories/GenerativeUI.stories.tsx +48 -48
- package/src/components/Chat/stories/MessageFeedback.stories.tsx +52 -52
- package/src/components/Chat/stories/Modal.stories.tsx +28 -28
- package/src/components/Chat/stories/Model.stories.tsx +11 -11
- package/src/components/Chat/stories/Radius.stories.tsx +20 -20
- package/src/components/Chat/stories/Sidecar.stories.tsx +13 -13
- package/src/components/Chat/stories/StyleIsolation.stories.tsx +11 -11
- package/src/components/Chat/stories/Theme.stories.tsx +25 -25
- package/src/components/Chat/stories/Thread.stories.tsx +25 -25
- package/src/components/Chat/stories/ToolApproval.stories.tsx +55 -55
- package/src/components/Chat/stories/ToolMentions.stories.tsx +17 -17
- package/src/components/Chat/stories/Tools.stories.tsx +88 -88
- package/src/components/Chat/stories/Variants.stories.tsx +32 -32
- package/src/components/Chat/stories/Welcome.stories.tsx +14 -14
- package/src/components/ChatHistory.tsx +7 -7
- package/src/components/FrontendTools/index.tsx +5 -5
- package/src/components/Replay.stories.tsx +157 -157
- package/src/components/Replay.tsx +76 -73
- package/src/components/ShadowRoot.tsx +40 -40
- package/src/components/ShareButton/index.tsx +32 -32
- package/src/components/assistant-ui/assistant-modal.tsx +92 -87
- package/src/components/assistant-ui/assistant-sidecar.tsx +35 -35
- package/src/components/assistant-ui/attachment.tsx +80 -80
- package/src/components/assistant-ui/connection-status-indicator.tsx +33 -33
- package/src/components/assistant-ui/error-boundary.tsx +34 -34
- package/src/components/assistant-ui/follow-on-suggestions.tsx +26 -26
- package/src/components/assistant-ui/markdown-text.tsx +69 -69
- package/src/components/assistant-ui/mentioned-tools-badges.tsx +38 -38
- package/src/components/assistant-ui/message-feedback.tsx +74 -61
- package/src/components/assistant-ui/reasoning.tsx +83 -83
- package/src/components/assistant-ui/thread-list.tsx +45 -45
- package/src/components/assistant-ui/thread.tsx +278 -278
- package/src/components/assistant-ui/tool-fallback.tsx +37 -37
- package/src/components/assistant-ui/tool-group.tsx +26 -26
- package/src/components/assistant-ui/tool-mention-autocomplete.tsx +122 -122
- package/src/components/assistant-ui/tooltip-icon-button.tsx +18 -18
- package/src/components/ui/avatar.tsx +12 -12
- package/src/components/ui/button.tsx +12 -12
- package/src/components/ui/buttonVariants.ts +17 -17
- package/src/components/ui/calendar.tsx +106 -106
- package/src/components/ui/charts.stories.tsx +56 -56
- package/src/components/ui/collapsible.tsx +5 -5
- package/src/components/ui/dialog.tsx +30 -30
- package/src/components/ui/generative-ui.stories.tsx +200 -200
- package/src/components/ui/generative-ui.tsx +26 -26
- package/src/components/ui/popover.tsx +14 -14
- package/src/components/ui/skeleton.tsx +5 -5
- package/src/components/ui/time-range-picker.stories.tsx +80 -80
- package/src/components/ui/time-range-picker.tsx +272 -235
- package/src/components/ui/tool-ui.stories.tsx +37 -37
- package/src/components/ui/tool-ui.tsx +221 -215
- package/src/components/ui/tooltip.tsx +15 -15
- package/src/constants/tailwind.ts +1 -1
- package/src/contexts/ChatIdContext.tsx +7 -7
- package/src/contexts/ConnectionStatusContext.tsx +64 -64
- package/src/contexts/ElementsProvider.tsx +222 -211
- package/src/contexts/ReplayContext.ts +3 -3
- package/src/contexts/ToolApprovalContext.tsx +54 -54
- package/src/contexts/ToolExecutionContext.tsx +34 -34
- package/src/contexts/contexts.ts +7 -7
- package/src/contexts/portal-container-context.ts +2 -2
- package/src/contexts/portal-container.tsx +7 -7
- package/src/embedded.ts +1 -1
- package/src/global.css +25 -25
- package/src/hooks/useAuth.ts +72 -72
- package/src/hooks/useDensity.ts +79 -79
- package/src/hooks/useElements.ts +6 -6
- package/src/hooks/useExpanded.ts +12 -12
- package/src/hooks/useFollowOnSuggestions.ts +87 -82
- package/src/hooks/useGramThreadListAdapter.tsx +99 -99
- package/src/hooks/useMCPTools.ts +47 -47
- package/src/hooks/useModel.ts +14 -14
- package/src/hooks/usePluginComponents.ts +11 -11
- package/src/hooks/usePortalContainer.ts +5 -5
- package/src/hooks/useRadius.ts +23 -23
- package/src/hooks/useRecordCassette.ts +34 -34
- package/src/hooks/useSession.ts +11 -11
- package/src/hooks/useThemeProps.ts +13 -13
- package/src/hooks/useThreadId.ts +4 -4
- package/src/hooks/useToolApproval.ts +7 -7
- package/src/hooks/useToolMentions.ts +40 -40
- package/src/index.ts +26 -26
- package/src/lib/api.test.ts +61 -61
- package/src/lib/api.ts +4 -3
- package/src/lib/auth.ts +13 -13
- package/src/lib/cassette.ts +84 -84
- package/src/lib/easing.ts +1 -1
- package/src/lib/errorTracking.config.ts +5 -5
- package/src/lib/errorTracking.ts +29 -29
- package/src/lib/generative-ui.ts +7 -7
- package/src/lib/humanize.ts +3 -3
- package/src/lib/messageConverter.test.ts +130 -127
- package/src/lib/messageConverter.ts +196 -196
- package/src/lib/models.ts +21 -20
- package/src/lib/token.test.ts +56 -56
- package/src/lib/token.ts +14 -14
- package/src/lib/tool-mentions.ts +45 -45
- package/src/lib/tools.ts +66 -62
- package/src/lib/utils.ts +5 -5
- package/src/lib.d.ts +1 -1
- package/src/plugins/README.md +5 -5
- package/src/plugins/chart/catalog.ts +18 -18
- package/src/plugins/chart/chart.test.ts +31 -31
- package/src/plugins/chart/component.tsx +34 -34
- package/src/plugins/chart/index.ts +4 -4
- package/src/plugins/chart/ui/area-chart.tsx +42 -42
- package/src/plugins/chart/ui/bar-chart.tsx +46 -46
- package/src/plugins/chart/ui/donut-chart.tsx +48 -48
- package/src/plugins/chart/ui/index.ts +7 -7
- package/src/plugins/chart/ui/line-chart.tsx +43 -43
- package/src/plugins/chart/ui/pie-chart.tsx +44 -44
- package/src/plugins/chart/ui/radar-chart.tsx +33 -33
- package/src/plugins/chart/ui/scatter-chart.tsx +43 -43
- package/src/plugins/components/MacOSWindowFrame.tsx +15 -15
- package/src/plugins/components/PluginLoadingState.tsx +10 -10
- package/src/plugins/components/index.ts +1 -1
- package/src/plugins/generative-ui/catalog.ts +54 -54
- package/src/plugins/generative-ui/component.tsx +85 -85
- package/src/plugins/generative-ui/index.ts +4 -4
- package/src/plugins/generative-ui/ui/accordion-wrapper.tsx +16 -16
- package/src/plugins/generative-ui/ui/accordion.tsx +16 -16
- package/src/plugins/generative-ui/ui/action-button.tsx +28 -28
- package/src/plugins/generative-ui/ui/alert-wrapper.tsx +8 -8
- package/src/plugins/generative-ui/ui/alert.tsx +20 -20
- package/src/plugins/generative-ui/ui/avatar-wrapper.tsx +7 -7
- package/src/plugins/generative-ui/ui/avatar.tsx +30 -30
- package/src/plugins/generative-ui/ui/badge.tsx +22 -22
- package/src/plugins/generative-ui/ui/button-wrapper.tsx +12 -12
- package/src/plugins/generative-ui/ui/button.tsx +28 -28
- package/src/plugins/generative-ui/ui/card-wrapper.tsx +8 -8
- package/src/plugins/generative-ui/ui/card.tsx +27 -27
- package/src/plugins/generative-ui/ui/checkbox-wrapper.tsx +9 -9
- package/src/plugins/generative-ui/ui/checkbox.tsx +9 -9
- package/src/plugins/generative-ui/ui/data-table.tsx +8 -8
- package/src/plugins/generative-ui/ui/dialog.tsx +31 -31
- package/src/plugins/generative-ui/ui/dropdown-menu.tsx +44 -44
- package/src/plugins/generative-ui/ui/grid.tsx +12 -12
- package/src/plugins/generative-ui/ui/index.ts +40 -40
- package/src/plugins/generative-ui/ui/input-wrapper.tsx +11 -11
- package/src/plugins/generative-ui/ui/input.tsx +9 -9
- package/src/plugins/generative-ui/ui/label.tsx +8 -8
- package/src/plugins/generative-ui/ui/list.tsx +11 -11
- package/src/plugins/generative-ui/ui/metric.tsx +23 -23
- package/src/plugins/generative-ui/ui/pagination.tsx +28 -28
- package/src/plugins/generative-ui/ui/popover.tsx +21 -21
- package/src/plugins/generative-ui/ui/progress.tsx +13 -13
- package/src/plugins/generative-ui/ui/radio-group.tsx +12 -12
- package/src/plugins/generative-ui/ui/select-wrapper.tsx +7 -7
- package/src/plugins/generative-ui/ui/select.tsx +37 -37
- package/src/plugins/generative-ui/ui/separator.tsx +9 -9
- package/src/plugins/generative-ui/ui/skeleton-wrapper.tsx +10 -10
- package/src/plugins/generative-ui/ui/skeleton.tsx +5 -5
- package/src/plugins/generative-ui/ui/stack.tsx +28 -28
- package/src/plugins/generative-ui/ui/switch.tsx +11 -11
- package/src/plugins/generative-ui/ui/table.tsx +32 -32
- package/src/plugins/generative-ui/ui/tabs-wrapper.tsx +11 -11
- package/src/plugins/generative-ui/ui/tabs.tsx +26 -26
- package/src/plugins/generative-ui/ui/text.tsx +12 -12
- package/src/plugins/generative-ui/ui/textarea.tsx +7 -7
- package/src/plugins/generative-ui/ui/tooltip.tsx +12 -12
- package/src/plugins/index.ts +7 -7
- package/src/react-shim.ts +6 -6
- package/src/server/bun.ts +12 -12
- package/src/server/core.ts +25 -25
- package/src/server/express.ts +17 -15
- package/src/server/fastify.ts +14 -14
- package/src/server/hono.ts +9 -9
- package/src/server/nextjs.ts +12 -12
- package/src/server/tanstack-start.ts +12 -12
- package/src/server.ts +27 -27
- package/src/storybook.d.ts +4 -4
- package/src/types/index.ts +122 -122
- package/src/types/plugins.ts +7 -7
- package/src/vite-env.d.ts +12 -12
- package/dist/compat-shims-BPJ7Q68c.js.map +0 -1
- package/dist/index-DBrhzauj.js.map +0 -1
- package/dist/index-DxfW52oA.cjs.map +0 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import type { StoryFn } from
|
|
2
|
-
import { Chat } from
|
|
3
|
-
import { Replay } from
|
|
4
|
-
import type { Cassette } from
|
|
1
|
+
import type { StoryFn } from "@storybook/react-vite";
|
|
2
|
+
import { Chat } from "@/components/Chat";
|
|
3
|
+
import { Replay } from "@/components/Replay";
|
|
4
|
+
import type { Cassette } from "@/lib/cassette";
|
|
5
5
|
|
|
6
6
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7
7
|
const meta: any = {
|
|
8
|
-
title:
|
|
8
|
+
title: "Misc/Replay",
|
|
9
9
|
component: Replay,
|
|
10
10
|
parameters: {
|
|
11
|
-
layout:
|
|
11
|
+
layout: "fullscreen",
|
|
12
12
|
// Skip the global ElementsProvider — Replay is its own provider
|
|
13
13
|
elements: { skipProvider: true },
|
|
14
14
|
},
|
|
15
|
-
}
|
|
15
|
+
};
|
|
16
16
|
|
|
17
|
-
export default meta
|
|
17
|
+
export default meta;
|
|
18
18
|
|
|
19
|
-
type Story = StoryFn<typeof Replay
|
|
19
|
+
type Story = StoryFn<typeof Replay>;
|
|
20
20
|
|
|
21
21
|
// ---------------------------------------------------------------------------
|
|
22
22
|
// Sample cassettes
|
|
@@ -25,121 +25,121 @@ type Story = StoryFn<typeof Replay>
|
|
|
25
25
|
const textOnlyCassette: Cassette = {
|
|
26
26
|
messages: [
|
|
27
27
|
{
|
|
28
|
-
role:
|
|
29
|
-
content: [{ type:
|
|
28
|
+
role: "user",
|
|
29
|
+
content: [{ type: "text", text: "What can you help me with?" }],
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
|
-
role:
|
|
32
|
+
role: "assistant",
|
|
33
33
|
content: [
|
|
34
34
|
{
|
|
35
|
-
type:
|
|
35
|
+
type: "text",
|
|
36
36
|
text: "I can help you with a wide range of tasks! Here are a few things I'm great at:\n\n- **Answering questions** about virtually any topic\n- **Writing and editing** emails, documents, and code\n- **Brainstorming ideas** for projects, names, or strategies\n- **Explaining concepts** in simple terms\n- **Analyzing data** and summarizing information\n\nWhat would you like to explore?",
|
|
37
37
|
},
|
|
38
38
|
],
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
|
-
role:
|
|
42
|
-
content: [{ type:
|
|
41
|
+
role: "user",
|
|
42
|
+
content: [{ type: "text", text: "Tell me about the Speakeasy SDK." }],
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
|
-
role:
|
|
45
|
+
role: "assistant",
|
|
46
46
|
content: [
|
|
47
47
|
{
|
|
48
|
-
type:
|
|
49
|
-
text:
|
|
48
|
+
type: "text",
|
|
49
|
+
text: "Speakeasy generates **type-safe, idiomatic SDKs** from your OpenAPI spec. You get production-ready client libraries in TypeScript, Python, Go, and more — complete with authentication, pagination, and retries built in.\n\nThe generated SDKs stay in sync with your API automatically through CI/CD integration, so your users always have an up-to-date client library. No more hand-writing API wrappers!",
|
|
50
50
|
},
|
|
51
51
|
],
|
|
52
52
|
},
|
|
53
53
|
],
|
|
54
|
-
}
|
|
54
|
+
};
|
|
55
55
|
|
|
56
56
|
const toolCallCassette: Cassette = {
|
|
57
57
|
messages: [
|
|
58
58
|
{
|
|
59
|
-
role:
|
|
59
|
+
role: "user",
|
|
60
60
|
content: [
|
|
61
|
-
{ type:
|
|
61
|
+
{ type: "text", text: "What's the weather like in San Francisco?" },
|
|
62
62
|
],
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
|
-
role:
|
|
65
|
+
role: "assistant",
|
|
66
66
|
content: [
|
|
67
67
|
{
|
|
68
|
-
type:
|
|
69
|
-
text:
|
|
68
|
+
type: "text",
|
|
69
|
+
text: "Let me check the current weather in San Francisco for you.",
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
|
-
type:
|
|
73
|
-
toolCallId:
|
|
74
|
-
toolName:
|
|
75
|
-
args: { city:
|
|
72
|
+
type: "tool-call",
|
|
73
|
+
toolCallId: "tc_weather_1",
|
|
74
|
+
toolName: "getWeather",
|
|
75
|
+
args: { city: "San Francisco", units: "fahrenheit" },
|
|
76
76
|
result: {
|
|
77
77
|
temperature: 68,
|
|
78
|
-
conditions:
|
|
78
|
+
conditions: "Partly cloudy",
|
|
79
79
|
humidity: 72,
|
|
80
|
-
wind:
|
|
80
|
+
wind: "12 mph NW",
|
|
81
81
|
},
|
|
82
82
|
},
|
|
83
83
|
{
|
|
84
|
-
type:
|
|
84
|
+
type: "text",
|
|
85
85
|
text: "It's currently **68°F** in San Francisco with partly cloudy skies. The humidity is at 72% with northwest winds at 12 mph. A beautiful day to be outside!",
|
|
86
86
|
},
|
|
87
87
|
],
|
|
88
88
|
},
|
|
89
89
|
{
|
|
90
|
-
role:
|
|
91
|
-
content: [{ type:
|
|
90
|
+
role: "user",
|
|
91
|
+
content: [{ type: "text", text: "How about New York?" }],
|
|
92
92
|
},
|
|
93
93
|
{
|
|
94
|
-
role:
|
|
94
|
+
role: "assistant",
|
|
95
95
|
content: [
|
|
96
96
|
{
|
|
97
|
-
type:
|
|
98
|
-
toolCallId:
|
|
99
|
-
toolName:
|
|
100
|
-
args: { city:
|
|
97
|
+
type: "tool-call",
|
|
98
|
+
toolCallId: "tc_weather_2",
|
|
99
|
+
toolName: "getWeather",
|
|
100
|
+
args: { city: "New York", units: "fahrenheit" },
|
|
101
101
|
result: {
|
|
102
102
|
temperature: 45,
|
|
103
|
-
conditions:
|
|
103
|
+
conditions: "Rainy",
|
|
104
104
|
humidity: 89,
|
|
105
|
-
wind:
|
|
105
|
+
wind: "8 mph E",
|
|
106
106
|
},
|
|
107
107
|
},
|
|
108
108
|
{
|
|
109
|
-
type:
|
|
109
|
+
type: "text",
|
|
110
110
|
text: "New York is quite different — it's **45°F** and rainy with high humidity at 89%. You'd want an umbrella and a warm coat today!",
|
|
111
111
|
},
|
|
112
112
|
],
|
|
113
113
|
},
|
|
114
114
|
],
|
|
115
|
-
}
|
|
115
|
+
};
|
|
116
116
|
|
|
117
117
|
const reasoningCassette: Cassette = {
|
|
118
118
|
messages: [
|
|
119
119
|
{
|
|
120
|
-
role:
|
|
120
|
+
role: "user",
|
|
121
121
|
content: [
|
|
122
122
|
{
|
|
123
|
-
type:
|
|
124
|
-
text:
|
|
123
|
+
type: "text",
|
|
124
|
+
text: "If I have 3 boxes, each containing 2 red balls and 1 blue ball, what is the probability of drawing a red ball from each box?",
|
|
125
125
|
},
|
|
126
126
|
],
|
|
127
127
|
},
|
|
128
128
|
{
|
|
129
|
-
role:
|
|
129
|
+
role: "assistant",
|
|
130
130
|
content: [
|
|
131
131
|
{
|
|
132
|
-
type:
|
|
133
|
-
text:
|
|
132
|
+
type: "reasoning",
|
|
133
|
+
text: "The user wants to find the probability of drawing a red ball from each of the 3 boxes.\n\nEach box has 3 balls total: 2 red and 1 blue.\nProbability of red from one box = 2/3.\nSince the draws are independent, I multiply the probabilities:\nP(all red) = (2/3) × (2/3) × (2/3) = 8/27 ≈ 0.296",
|
|
134
134
|
},
|
|
135
135
|
{
|
|
136
|
-
type:
|
|
136
|
+
type: "text",
|
|
137
137
|
text: "Each box contains 3 balls (2 red, 1 blue), so the probability of drawing red from a single box is **2/3**.\n\nSince you're drawing independently from each box, you multiply the probabilities:\n\n$$P(\\text{all red}) = \\frac{2}{3} \\times \\frac{2}{3} \\times \\frac{2}{3} = \\frac{8}{27} \\approx 29.6\\%$$\n\nSo there's roughly a **29.6% chance** of drawing a red ball from every box.",
|
|
138
138
|
},
|
|
139
139
|
],
|
|
140
140
|
},
|
|
141
141
|
],
|
|
142
|
-
}
|
|
142
|
+
};
|
|
143
143
|
|
|
144
144
|
/**
|
|
145
145
|
* Simulates what the converter produced BEFORE the dedup fix (AGE-1295).
|
|
@@ -156,210 +156,210 @@ const reasoningCassette: Cassette = {
|
|
|
156
156
|
const beforeFixCassette: Cassette = {
|
|
157
157
|
messages: [
|
|
158
158
|
{
|
|
159
|
-
role:
|
|
159
|
+
role: "user",
|
|
160
160
|
content: [
|
|
161
|
-
{ type:
|
|
161
|
+
{ type: "text", text: "Search for 3 deals in HubSpot for me." },
|
|
162
162
|
],
|
|
163
163
|
},
|
|
164
164
|
{
|
|
165
|
-
role:
|
|
165
|
+
role: "assistant",
|
|
166
166
|
content: [
|
|
167
167
|
// --- chunk 1: first attempt ---
|
|
168
168
|
{
|
|
169
|
-
type:
|
|
169
|
+
type: "text",
|
|
170
170
|
text: "I'll search for 3 deals in HubSpot for you.",
|
|
171
171
|
},
|
|
172
172
|
{
|
|
173
|
-
type:
|
|
174
|
-
toolCallId:
|
|
175
|
-
toolName:
|
|
176
|
-
args: { query:
|
|
177
|
-
result: { error:
|
|
173
|
+
type: "tool-call",
|
|
174
|
+
toolCallId: "tc_deals_1",
|
|
175
|
+
toolName: "hubspot_search_deals",
|
|
176
|
+
args: { query: "deals", limit: 3 },
|
|
177
|
+
result: { error: "Invalid filter groups structure" },
|
|
178
178
|
},
|
|
179
179
|
// --- chunk 2: second attempt (accumulates tc_1 + tc_2) ---
|
|
180
180
|
{
|
|
181
|
-
type:
|
|
182
|
-
text:
|
|
181
|
+
type: "text",
|
|
182
|
+
text: "Let me try a different approach to retrieve deals:",
|
|
183
183
|
},
|
|
184
184
|
{
|
|
185
|
-
type:
|
|
186
|
-
toolCallId:
|
|
187
|
-
toolName:
|
|
188
|
-
args: { query:
|
|
189
|
-
result: { error:
|
|
185
|
+
type: "tool-call",
|
|
186
|
+
toolCallId: "tc_deals_1_dup",
|
|
187
|
+
toolName: "hubspot_search_deals",
|
|
188
|
+
args: { query: "deals", limit: 3 },
|
|
189
|
+
result: { error: "Invalid filter groups structure" },
|
|
190
190
|
},
|
|
191
191
|
{
|
|
192
|
-
type:
|
|
193
|
-
toolCallId:
|
|
194
|
-
toolName:
|
|
195
|
-
args: { query:
|
|
196
|
-
result: { error:
|
|
192
|
+
type: "tool-call",
|
|
193
|
+
toolCallId: "tc_deals_2",
|
|
194
|
+
toolName: "hubspot_search_deals",
|
|
195
|
+
args: { query: "deals", limit: 3, filterGroups: [] },
|
|
196
|
+
result: { error: "Filter groups must not be empty" },
|
|
197
197
|
},
|
|
198
198
|
// --- chunk 3: third attempt (accumulates tc_1 + tc_2 + tc_3) ---
|
|
199
199
|
{
|
|
200
|
-
type:
|
|
201
|
-
text:
|
|
200
|
+
type: "text",
|
|
201
|
+
text: "Let me try with proper filter groups structure:",
|
|
202
202
|
},
|
|
203
203
|
{
|
|
204
|
-
type:
|
|
205
|
-
toolCallId:
|
|
206
|
-
toolName:
|
|
207
|
-
args: { query:
|
|
208
|
-
result: { error:
|
|
204
|
+
type: "tool-call",
|
|
205
|
+
toolCallId: "tc_deals_1_dup2",
|
|
206
|
+
toolName: "hubspot_search_deals",
|
|
207
|
+
args: { query: "deals", limit: 3 },
|
|
208
|
+
result: { error: "Invalid filter groups structure" },
|
|
209
209
|
},
|
|
210
210
|
{
|
|
211
|
-
type:
|
|
212
|
-
toolCallId:
|
|
213
|
-
toolName:
|
|
214
|
-
args: { query:
|
|
215
|
-
result: { error:
|
|
211
|
+
type: "tool-call",
|
|
212
|
+
toolCallId: "tc_deals_2_dup",
|
|
213
|
+
toolName: "hubspot_search_deals",
|
|
214
|
+
args: { query: "deals", limit: 3, filterGroups: [] },
|
|
215
|
+
result: { error: "Filter groups must not be empty" },
|
|
216
216
|
},
|
|
217
217
|
{
|
|
218
|
-
type:
|
|
219
|
-
toolCallId:
|
|
220
|
-
toolName:
|
|
218
|
+
type: "tool-call",
|
|
219
|
+
toolCallId: "tc_deals_3",
|
|
220
|
+
toolName: "hubspot_search_deals",
|
|
221
221
|
args: {
|
|
222
222
|
limit: 3,
|
|
223
223
|
filterGroups: [
|
|
224
224
|
{
|
|
225
225
|
filters: [
|
|
226
|
-
{ propertyName:
|
|
226
|
+
{ propertyName: "dealname", operator: "HAS_PROPERTY" },
|
|
227
227
|
],
|
|
228
228
|
},
|
|
229
229
|
],
|
|
230
230
|
},
|
|
231
231
|
result: {
|
|
232
232
|
deals: [
|
|
233
|
-
{ id:
|
|
234
|
-
{ id:
|
|
235
|
-
{ id:
|
|
233
|
+
{ id: "1", name: "Acme Corp", amount: 50000 },
|
|
234
|
+
{ id: "2", name: "Globex Inc", amount: 75000 },
|
|
235
|
+
{ id: "3", name: "Initech LLC", amount: 30000 },
|
|
236
236
|
],
|
|
237
237
|
},
|
|
238
238
|
},
|
|
239
239
|
{
|
|
240
|
-
type:
|
|
241
|
-
text:
|
|
240
|
+
type: "text",
|
|
241
|
+
text: "Here are the 3 deals I found:\n\n1. **Acme Corp** — $50,000\n2. **Globex Inc** — $75,000\n3. **Initech LLC** — $30,000",
|
|
242
242
|
},
|
|
243
243
|
],
|
|
244
244
|
},
|
|
245
245
|
],
|
|
246
|
-
}
|
|
246
|
+
};
|
|
247
247
|
|
|
248
248
|
const interleavedToolCallsCassette: Cassette = {
|
|
249
249
|
messages: [
|
|
250
250
|
{
|
|
251
|
-
role:
|
|
251
|
+
role: "user",
|
|
252
252
|
content: [
|
|
253
|
-
{ type:
|
|
253
|
+
{ type: "text", text: "Search for 3 deals in HubSpot for me." },
|
|
254
254
|
],
|
|
255
255
|
},
|
|
256
256
|
{
|
|
257
|
-
role:
|
|
257
|
+
role: "assistant",
|
|
258
258
|
content: [
|
|
259
259
|
{
|
|
260
|
-
type:
|
|
260
|
+
type: "text",
|
|
261
261
|
text: "I'll search for 3 deals in HubSpot for you.",
|
|
262
262
|
},
|
|
263
263
|
{
|
|
264
|
-
type:
|
|
265
|
-
toolCallId:
|
|
266
|
-
toolName:
|
|
267
|
-
args: { query:
|
|
268
|
-
result: { error:
|
|
264
|
+
type: "tool-call",
|
|
265
|
+
toolCallId: "tc_deals_1",
|
|
266
|
+
toolName: "hubspot_search_deals",
|
|
267
|
+
args: { query: "deals", limit: 3 },
|
|
268
|
+
result: { error: "Invalid filter groups structure" },
|
|
269
269
|
},
|
|
270
270
|
{
|
|
271
|
-
type:
|
|
272
|
-
text:
|
|
271
|
+
type: "text",
|
|
272
|
+
text: "Let me try a different approach to retrieve deals:",
|
|
273
273
|
},
|
|
274
274
|
{
|
|
275
|
-
type:
|
|
276
|
-
toolCallId:
|
|
277
|
-
toolName:
|
|
278
|
-
args: { query:
|
|
279
|
-
result: { error:
|
|
275
|
+
type: "tool-call",
|
|
276
|
+
toolCallId: "tc_deals_2",
|
|
277
|
+
toolName: "hubspot_search_deals",
|
|
278
|
+
args: { query: "deals", limit: 3, filterGroups: [] },
|
|
279
|
+
result: { error: "Filter groups must not be empty" },
|
|
280
280
|
},
|
|
281
281
|
{
|
|
282
|
-
type:
|
|
283
|
-
text:
|
|
282
|
+
type: "text",
|
|
283
|
+
text: "Let me try with proper filter groups structure:",
|
|
284
284
|
},
|
|
285
285
|
{
|
|
286
|
-
type:
|
|
287
|
-
toolCallId:
|
|
288
|
-
toolName:
|
|
286
|
+
type: "tool-call",
|
|
287
|
+
toolCallId: "tc_deals_3",
|
|
288
|
+
toolName: "hubspot_search_deals",
|
|
289
289
|
args: {
|
|
290
290
|
limit: 3,
|
|
291
291
|
filterGroups: [
|
|
292
292
|
{
|
|
293
293
|
filters: [
|
|
294
|
-
{ propertyName:
|
|
294
|
+
{ propertyName: "dealname", operator: "HAS_PROPERTY" },
|
|
295
295
|
],
|
|
296
296
|
},
|
|
297
297
|
],
|
|
298
298
|
},
|
|
299
299
|
result: {
|
|
300
300
|
deals: [
|
|
301
|
-
{ id:
|
|
302
|
-
{ id:
|
|
303
|
-
{ id:
|
|
301
|
+
{ id: "1", name: "Acme Corp", amount: 50000 },
|
|
302
|
+
{ id: "2", name: "Globex Inc", amount: 75000 },
|
|
303
|
+
{ id: "3", name: "Initech LLC", amount: 30000 },
|
|
304
304
|
],
|
|
305
305
|
},
|
|
306
306
|
},
|
|
307
307
|
{
|
|
308
|
-
type:
|
|
309
|
-
text:
|
|
308
|
+
type: "text",
|
|
309
|
+
text: "Here are the 3 deals I found:\n\n1. **Acme Corp** — $50,000\n2. **Globex Inc** — $75,000\n3. **Initech LLC** — $30,000",
|
|
310
310
|
},
|
|
311
311
|
],
|
|
312
312
|
},
|
|
313
313
|
],
|
|
314
|
-
}
|
|
314
|
+
};
|
|
315
315
|
|
|
316
316
|
const multiTurnCassette: Cassette = {
|
|
317
317
|
messages: [
|
|
318
318
|
{
|
|
319
|
-
role:
|
|
319
|
+
role: "user",
|
|
320
320
|
content: [
|
|
321
|
-
{ type:
|
|
321
|
+
{ type: "text", text: "Help me plan a REST API for a todo app." },
|
|
322
322
|
],
|
|
323
323
|
},
|
|
324
324
|
{
|
|
325
|
-
role:
|
|
325
|
+
role: "assistant",
|
|
326
326
|
content: [
|
|
327
327
|
{
|
|
328
|
-
type:
|
|
328
|
+
type: "text",
|
|
329
329
|
text: "Here's a clean REST API design for a todo app:\n\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| `GET` | `/todos` | List all todos |\n| `POST` | `/todos` | Create a new todo |\n| `GET` | `/todos/:id` | Get a single todo |\n| `PATCH` | `/todos/:id` | Update a todo |\n| `DELETE` | `/todos/:id` | Delete a todo |\n\nWant me to define the request/response schemas?",
|
|
330
330
|
},
|
|
331
331
|
],
|
|
332
332
|
},
|
|
333
333
|
{
|
|
334
|
-
role:
|
|
334
|
+
role: "user",
|
|
335
335
|
content: [
|
|
336
|
-
{ type:
|
|
336
|
+
{ type: "text", text: "Yes, show me the schema for creating a todo." },
|
|
337
337
|
],
|
|
338
338
|
},
|
|
339
339
|
{
|
|
340
|
-
role:
|
|
340
|
+
role: "assistant",
|
|
341
341
|
content: [
|
|
342
342
|
{
|
|
343
|
-
type:
|
|
343
|
+
type: "text",
|
|
344
344
|
text: '**POST `/todos`**\n\n**Request body:**\n```json\n{\n "title": "Buy groceries",\n "description": "Milk, eggs, bread",\n "dueDate": "2025-03-15T10:00:00Z",\n "priority": "medium"\n}\n```\n\n**Response (`201 Created`):**\n```json\n{\n "id": "td_abc123",\n "title": "Buy groceries",\n "description": "Milk, eggs, bread",\n "completed": false,\n "dueDate": "2025-03-15T10:00:00Z",\n "priority": "medium",\n "createdAt": "2025-03-10T14:30:00Z",\n "updatedAt": "2025-03-10T14:30:00Z"\n}\n```\n\nThe `title` field is required — everything else is optional. The server generates `id`, `completed` (defaults to `false`), and timestamps.',
|
|
345
345
|
},
|
|
346
346
|
],
|
|
347
347
|
},
|
|
348
348
|
{
|
|
349
|
-
role:
|
|
350
|
-
content: [{ type:
|
|
349
|
+
role: "user",
|
|
350
|
+
content: [{ type: "text", text: "What about validation errors?" }],
|
|
351
351
|
},
|
|
352
352
|
{
|
|
353
|
-
role:
|
|
353
|
+
role: "assistant",
|
|
354
354
|
content: [
|
|
355
355
|
{
|
|
356
|
-
type:
|
|
356
|
+
type: "text",
|
|
357
357
|
text: 'For validation errors, return `422 Unprocessable Entity` with a structured error body:\n\n```json\n{\n "error": "validation_error",\n "message": "Request validation failed",\n "details": [\n {\n "field": "title",\n "message": "Title is required and must be between 1-200 characters"\n },\n {\n "field": "priority",\n "message": "Must be one of: low, medium, high"\n }\n ]\n}\n```\n\nThis gives clients enough information to display field-level errors in the UI. Keep the `details` array consistent across all endpoints.',
|
|
358
358
|
},
|
|
359
359
|
],
|
|
360
360
|
},
|
|
361
361
|
],
|
|
362
|
-
}
|
|
362
|
+
};
|
|
363
363
|
|
|
364
364
|
// ---------------------------------------------------------------------------
|
|
365
365
|
// Stories
|
|
@@ -372,20 +372,20 @@ const multiTurnCassette: Cassette = {
|
|
|
372
372
|
export const TextConversation: Story = () => (
|
|
373
373
|
<Replay
|
|
374
374
|
cassette={textOnlyCassette}
|
|
375
|
-
config={{ variant:
|
|
375
|
+
config={{ variant: "standalone" }}
|
|
376
376
|
typingSpeed={10}
|
|
377
377
|
userMessageDelay={600}
|
|
378
378
|
>
|
|
379
379
|
<Chat />
|
|
380
380
|
</Replay>
|
|
381
|
-
)
|
|
381
|
+
);
|
|
382
382
|
TextConversation.decorators = [
|
|
383
383
|
(Story) => (
|
|
384
384
|
<div className="m-auto flex h-screen w-full max-w-3xl flex-col px-4">
|
|
385
385
|
<Story />
|
|
386
386
|
</div>
|
|
387
387
|
),
|
|
388
|
-
]
|
|
388
|
+
];
|
|
389
389
|
|
|
390
390
|
/**
|
|
391
391
|
* Replay with tool calls. The assistant invokes tools with visible
|
|
@@ -395,7 +395,7 @@ export const ToolCalls: Story = () => (
|
|
|
395
395
|
<Replay
|
|
396
396
|
cassette={toolCallCassette}
|
|
397
397
|
config={{
|
|
398
|
-
variant:
|
|
398
|
+
variant: "standalone",
|
|
399
399
|
tools: { expandToolGroupsByDefault: true },
|
|
400
400
|
}}
|
|
401
401
|
typingSpeed={10}
|
|
@@ -403,14 +403,14 @@ export const ToolCalls: Story = () => (
|
|
|
403
403
|
>
|
|
404
404
|
<Chat />
|
|
405
405
|
</Replay>
|
|
406
|
-
)
|
|
406
|
+
);
|
|
407
407
|
ToolCalls.decorators = [
|
|
408
408
|
(Story) => (
|
|
409
409
|
<div className="m-auto flex h-screen w-full max-w-3xl flex-col px-4">
|
|
410
410
|
<Story />
|
|
411
411
|
</div>
|
|
412
412
|
),
|
|
413
|
-
]
|
|
413
|
+
];
|
|
414
414
|
|
|
415
415
|
/**
|
|
416
416
|
* BEFORE the fix (AGE-1295): simulates the duplicated tool calls that the
|
|
@@ -424,7 +424,7 @@ export const BeforeFix_DuplicatedToolCalls: Story = () => (
|
|
|
424
424
|
<Replay
|
|
425
425
|
cassette={beforeFixCassette}
|
|
426
426
|
config={{
|
|
427
|
-
variant:
|
|
427
|
+
variant: "standalone",
|
|
428
428
|
tools: { expandToolGroupsByDefault: false },
|
|
429
429
|
}}
|
|
430
430
|
typingSpeed={0}
|
|
@@ -433,14 +433,14 @@ export const BeforeFix_DuplicatedToolCalls: Story = () => (
|
|
|
433
433
|
>
|
|
434
434
|
<Chat />
|
|
435
435
|
</Replay>
|
|
436
|
-
)
|
|
436
|
+
);
|
|
437
437
|
BeforeFix_DuplicatedToolCalls.decorators = [
|
|
438
438
|
(Story) => (
|
|
439
439
|
<div className="m-auto flex h-screen w-full max-w-3xl flex-col px-4">
|
|
440
440
|
<Story />
|
|
441
441
|
</div>
|
|
442
442
|
),
|
|
443
|
-
]
|
|
443
|
+
];
|
|
444
444
|
|
|
445
445
|
/**
|
|
446
446
|
* AFTER the fix (AGE-1295): the converter now deduplicates tool calls, so
|
|
@@ -452,7 +452,7 @@ export const AfterFix_DeduplicatedToolCalls: Story = () => (
|
|
|
452
452
|
<Replay
|
|
453
453
|
cassette={interleavedToolCallsCassette}
|
|
454
454
|
config={{
|
|
455
|
-
variant:
|
|
455
|
+
variant: "standalone",
|
|
456
456
|
tools: { expandToolGroupsByDefault: false },
|
|
457
457
|
}}
|
|
458
458
|
typingSpeed={0}
|
|
@@ -461,14 +461,14 @@ export const AfterFix_DeduplicatedToolCalls: Story = () => (
|
|
|
461
461
|
>
|
|
462
462
|
<Chat />
|
|
463
463
|
</Replay>
|
|
464
|
-
)
|
|
464
|
+
);
|
|
465
465
|
AfterFix_DeduplicatedToolCalls.decorators = [
|
|
466
466
|
(Story) => (
|
|
467
467
|
<div className="m-auto flex h-screen w-full max-w-3xl flex-col px-4">
|
|
468
468
|
<Story />
|
|
469
469
|
</div>
|
|
470
470
|
),
|
|
471
|
-
]
|
|
471
|
+
];
|
|
472
472
|
|
|
473
473
|
/**
|
|
474
474
|
* Replay with reasoning (chain-of-thought) content. The assistant's
|
|
@@ -477,20 +477,20 @@ AfterFix_DeduplicatedToolCalls.decorators = [
|
|
|
477
477
|
export const Reasoning: Story = () => (
|
|
478
478
|
<Replay
|
|
479
479
|
cassette={reasoningCassette}
|
|
480
|
-
config={{ variant:
|
|
480
|
+
config={{ variant: "standalone" }}
|
|
481
481
|
typingSpeed={10}
|
|
482
482
|
userMessageDelay={600}
|
|
483
483
|
>
|
|
484
484
|
<Chat />
|
|
485
485
|
</Replay>
|
|
486
|
-
)
|
|
486
|
+
);
|
|
487
487
|
Reasoning.decorators = [
|
|
488
488
|
(Story) => (
|
|
489
489
|
<div className="m-auto flex h-screen w-full max-w-3xl flex-col px-4">
|
|
490
490
|
<Story />
|
|
491
491
|
</div>
|
|
492
492
|
),
|
|
493
|
-
]
|
|
493
|
+
];
|
|
494
494
|
|
|
495
495
|
/**
|
|
496
496
|
* Multi-turn conversation with multiple user/assistant exchanges,
|
|
@@ -499,21 +499,21 @@ Reasoning.decorators = [
|
|
|
499
499
|
export const MultiTurn: Story = () => (
|
|
500
500
|
<Replay
|
|
501
501
|
cassette={multiTurnCassette}
|
|
502
|
-
config={{ variant:
|
|
502
|
+
config={{ variant: "standalone" }}
|
|
503
503
|
typingSpeed={8}
|
|
504
504
|
userMessageDelay={500}
|
|
505
505
|
assistantStartDelay={300}
|
|
506
506
|
>
|
|
507
507
|
<Chat />
|
|
508
508
|
</Replay>
|
|
509
|
-
)
|
|
509
|
+
);
|
|
510
510
|
MultiTurn.decorators = [
|
|
511
511
|
(Story) => (
|
|
512
512
|
<div className="m-auto flex h-screen w-full max-w-3xl flex-col px-4">
|
|
513
513
|
<Story />
|
|
514
514
|
</div>
|
|
515
515
|
),
|
|
516
|
-
]
|
|
516
|
+
];
|
|
517
517
|
|
|
518
518
|
/**
|
|
519
519
|
* Replay rendered in the widget (modal) variant, showing how replays
|
|
@@ -523,7 +523,7 @@ export const WidgetVariant: Story = () => (
|
|
|
523
523
|
<Replay
|
|
524
524
|
cassette={textOnlyCassette}
|
|
525
525
|
config={{
|
|
526
|
-
variant:
|
|
526
|
+
variant: "widget",
|
|
527
527
|
modal: { defaultOpen: true },
|
|
528
528
|
}}
|
|
529
529
|
typingSpeed={10}
|
|
@@ -531,7 +531,7 @@ export const WidgetVariant: Story = () => (
|
|
|
531
531
|
>
|
|
532
532
|
<Chat />
|
|
533
533
|
</Replay>
|
|
534
|
-
)
|
|
534
|
+
);
|
|
535
535
|
|
|
536
536
|
/**
|
|
537
537
|
* Fast replay with minimal delays — useful for quick demos or testing.
|
|
@@ -539,18 +539,18 @@ export const WidgetVariant: Story = () => (
|
|
|
539
539
|
export const FastReplay: Story = () => (
|
|
540
540
|
<Replay
|
|
541
541
|
cassette={multiTurnCassette}
|
|
542
|
-
config={{ variant:
|
|
542
|
+
config={{ variant: "standalone" }}
|
|
543
543
|
typingSpeed={2}
|
|
544
544
|
userMessageDelay={200}
|
|
545
545
|
assistantStartDelay={100}
|
|
546
546
|
>
|
|
547
547
|
<Chat />
|
|
548
548
|
</Replay>
|
|
549
|
-
)
|
|
549
|
+
);
|
|
550
550
|
FastReplay.decorators = [
|
|
551
551
|
(Story) => (
|
|
552
552
|
<div className="m-auto flex h-screen w-full max-w-3xl flex-col px-4">
|
|
553
553
|
<Story />
|
|
554
554
|
</div>
|
|
555
555
|
),
|
|
556
|
-
]
|
|
556
|
+
];
|