Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

feat(frontend): rework /tour/chat demo per product feedback (#13468)

Ubbe22a262a96cbb
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/store.test.ts b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/store.test.ts
index 0c4905a793..3249fc5244 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/store.test.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/store.test.ts
@@ -113,6 +113,35 @@ describe("artifactPanel store actions", () => {
expect(s.history).toEqual([]);
});
+ it("openArtifact/closeArtifactPanel persist the open state by default", () => {
+ window.localStorage.removeItem("copilot-context-panel-open");
+ useCopilotUIStore.getState().openArtifact(makeArtifact("a"));
+ expect(window.localStorage.getItem("copilot-context-panel-open")).toBe(
+ "true",
+ );
+ useCopilotUIStore.getState().closeArtifactPanel();
+ expect(window.localStorage.getItem("copilot-context-panel-open")).toBe(
+ "false",
+ );
+ });
+
+ it("openArtifact/closeArtifactPanel skip localStorage with persist: false", () => {
+ window.localStorage.removeItem("copilot-context-panel-open");
+ useCopilotUIStore
+ .getState()
+ .openArtifact(makeArtifact("a"), { persist: false });
+ expect(
+ window.localStorage.getItem("copilot-context-panel-open"),
+ ).toBeNull();
+ expect(useCopilotUIStore.getState().artifactPanel.isOpen).toBe(true);
+
+ useCopilotUIStore.getState().closeArtifactPanel({ persist: false });
+ expect(
+ window.localStorage.getItem("copilot-context-panel-open"),
+ ).toBeNull();
+ expect(useCopilotUIStore.getState().artifactPanel.isOpen).toBe(false);
+ });
+
it("openArtifact does not resurrect a previously closed artifact into history", () => {
const a = makeArtifact("a");
const b = makeArtifact("b");
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ContextPanel/ContextPanel.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ContextPanel/ContextPanel.tsx
index 7b690d3033..315c771099 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ContextPanel/ContextPanel.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ContextPanel/ContextPanel.tsx
@@ -58,7 +58,7 @@ export function ContextPanel({ sessionId, mobile }: Props) {
{!mobile && (
<button
type="button"
- onClick={closeArtifactPanel}
+ onClick={() => closeArtifactPanel()}
title="Close"
aria-label="Close workspace panel"
className="rounded p-1.5 text-zinc-500 transition-colors hover:bg-zinc-100 hover:text-zinc-700"
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/store.ts b/autogpt_platform/frontend/src/app/(platform)/copilot/store.ts
index 0d7f5a53fe..87352b0ac9 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/store.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/store.ts
@@ -152,8 +152,11 @@ interface CopilotUIState {
// Artifact panel
artifactPanel: ArtifactPanelState;
- openArtifact: (ref: ArtifactRef) => void;
- closeArtifactPanel: () => void;
+ // `persist: false` skips the localStorage write — used by the public
+ // /tour demo so a scripted open/close never leaks into the panel state
+ // the real copilot restores on load.
+ openArtifact: (ref: ArtifactRef, opts?: { persist?: boolean }) => void;
+ closeArtifactPanel: (opts?: { persist?: boolean }) => void;
clearArtifactPreview: () => void;
resetArtifactPanel: () => void;
goBackArtifact: () => void;
@@ -269,7 +272,7 @@ export const useCopilotUIStore = create<CopilotUIState>((set, get) => ({
history: [],
activeTab: getPersistedTab(),
},
- openArtifact: (ref) =>
+ openArtifact: (ref, opts) =>
set((state) => {
const { activeArtifact, history: prevHistory } = state.artifactPanel;
const topOfHistory = prevHistory[prevHistory.length - 1];
@@ -282,7 +285,8 @@ export const useCopilotUIStore = create<CopilotUIState>((set, get) => ({
: shouldPushHistory
? [...prevHistory, activeArtifact!].slice(-MAX_HISTORY)
: prevHistory;
- if (isClient) storage.set(Key.COPILOT_CONTEXT_PANEL_OPEN, "true");
+ if (isClient && opts?.persist !== false)
+ storage.set(Key.COPILOT_CONTEXT_PANEL_OPEN, "true");
return {
artifactPanel: {
...state.artifactPanel,
@@ -292,9 +296,10 @@ export const useCopilotUIStore = create<CopilotUIState>((set, get) => ({
},
};
}),
- closeArtifactPanel: () =>
+ closeArtifactPanel: (opts) =>
set((state) => {
- if (isClient) storage.set(Key.COPILOT_CONTEXT_PANEL_OPEN, "false");
+ if (isClient && opts?.persist !== false)
+ storage.set(Key.COPILOT_CONTEXT_PANEL_OPEN, "false");
// NOTE: deliberately does NOT set _autoOpenUserClosed. Unlike
// toggleContextPanel (a user action), closeArtifactPanel is also the
// programmatic collapse path — useCollapseContextPanelOnSession calls it
diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/TourChatHost.tsx b/autogpt_platform/frontend/src/app/(public)/tour/chat/TourChatHost.tsx
index f64ee8f87f..3d698a580e 100644
--- a/autogpt_platform/frontend/src/app/(public)/tour/chat/TourChatHost.tsx
+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/TourChatHost.tsx
@@ -7,13 +7,21 @@ import { useTourCopilot } from "./useTourCopilot";
interface Props {
sessionId: string;
script: TourScript;
+ onComplete?: () => void;
+ onReset?: () => void;
}
-export function TourChatHost({ sessionId, script }: Props) {
+export function TourChatHost({
+ sessionId,
+ script,
+ onComplete,
+ onReset,
+}: Props) {
const chat = useTourCopilot({
sessionId,
script,
- onComplete: () => {},
+ onComplete: onComplete ?? (() => {}),
+ onReset,
});
return <TourChatContainer chat={chat} />;
diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/TourCopilot.tsx b/autogpt_platform/frontend/src/app/(public)/tour/chat/TourCopilot.tsx
index b25eb86e4d..e426bc1406 100644
--- a/autogpt_platform/frontend/src/app/(public)/tour/chat/TourCopilot.tsx
+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/TourCopilot.tsx
@@ -1,58 +1,117 @@
"use client";
-import { FileDropZone } from "@/app/(platform)/copilot/components/FileDropZone/FileDropZone";
-import { MobileHeader } from "@/app/(platform)/copilot/components/MobileHeader/MobileHeader";
+import { useCopilotUIStore } from "@/app/(platform)/copilot/store";
import { useIsMobile } from "@/app/(platform)/copilot/useIsMobile";
import { DotDistortionShader } from "@/components/ui/dot-distortion-shader";
-import { SidebarProvider } from "@/components/ui/sidebar";
+import { SidebarInset, SidebarProvider } from "@/components/ui/sidebar";
+import { useMountEffect } from "@/hooks/useMountEffect";
+import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";
+import dynamic from "next/dynamic";
+import { CSSProperties } from "react";
import { TourChatHost } from "./TourChatHost";
-import { TourChatSidebar } from "./components/TourChatSidebar/TourChatSidebar";
-import { getTourChat } from "./script/tourChats";
-import type { TourScript } from "./script/types";
+import { TourScenarioChips } from "./components/TourScenarioChips/TourScenarioChips";
+import { TourSidebar } from "./components/TourSidebar/TourSidebar";
+import { buildTourArtifactRef } from "./helpers";
+import { getTourScenario } from "./script/tourScenarios";
import { useTourStore } from "./tourStore";
-export function TourCopilot() {
- const isMobile = useIsMobile();
- const activeSessionId = useTourStore((s) => s.activeSessionId);
- const chat = getTourChat(activeSessionId);
+const ArtifactPanel = dynamic(
+ () =>
+ import(
+ "@/app/(platform)/copilot/components/ArtifactPanel/ArtifactPanel"
+ ).then((m) => m.ArtifactPanel),
+ { ssr: false },
+);
+function TourBackdrop() {
return (
- <SidebarProvider
- defaultOpen={true}
- style={{ height: "100dvh" }}
- className="min-h-0"
- >
- {!isMobile && <TourChatSidebar />}
- <MainArea isMobile={isMobile} sessionId={chat.id} script={chat.script} />
- </SidebarProvider>
+ <DotDistortionShader
+ dotGap={14}
+ dotSize={1}
+ opacity={0.2}
+ isStatic
+ className="pointer-events-none absolute inset-0 !bg-transparent [&_canvas]:opacity-70"
+ />
);
}
-interface MainAreaProps {
- isMobile: boolean;
- sessionId: string;
- script: TourScript;
-}
+export function TourCopilot() {
+ const activeScenarioId = useTourStore((s) => s.activeScenarioId);
+ const scenario = getTourScenario(activeScenarioId);
+ const appShellEnabled = useGetFlag(Flag.TOUR_APP_SHELL);
+ const isMobile = useIsMobile();
+ const openArtifact = useCopilotUIStore((s) => s.openArtifact);
+ const clearArtifactPreview = useCopilotUIStore((s) => s.clearArtifactPreview);
+ const closeArtifactPanel = useCopilotUIStore((s) => s.closeArtifactPanel);
-function MainArea({ isMobile, sessionId, script }: MainAreaProps) {
- return (
- <div className="flex h-full w-full flex-row overflow-hidden">
- <div className="relative flex min-w-0 flex-1 overflow-hidden bg-[#fafafa]">
- <DotDistortionShader
- dotGap={14}
- dotSize={1}
- opacity={0.2}
- isStatic
- className="pointer-events-none absolute inset-0 !bg-transparent [&_canvas]:opacity-70"
+ // The tour shares the copilot UI store but must never leak panel state
+ // into the real /copilot: opens skip the localStorage write
+ // (persist: false) and unmount closes the panel in memory the same way.
+ useMountEffect(() => {
+ return () => closeArtifactPanel({ persist: false });
+ });
+
+ // The completion artifact is not gated behind the app-shell flag — the demo
+ // always ends by opening the scenario's mock file in the artifact panel.
+ const chatColumn = (
+ <div className="relative flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden">
+ <TourBackdrop />
+ <div className="relative z-10 flex min-h-0 flex-1 flex-col">
+ {appShellEnabled ? (
+ <div className="h-4 shrink-0" />
+ ) : (
+ <div className="px-3 pb-2 pt-5">
+ <TourScenarioChips />
+ </div>
+ )}
+ <TourChatHost
+ key={scenario.id}
+ sessionId={scenario.id}
+ script={scenario.script}
+ onComplete={() =>
+ openArtifact(buildTourArtifactRef(scenario), { persist: false })
+ }
+ onReset={clearArtifactPreview}
/>
- <FileDropZone
- className="relative flex min-w-0 flex-1 flex-col overflow-hidden px-0"
- onFilesDropped={() => {}}
- >
- {isMobile && <MobileHeader />}
- <TourChatHost key={sessionId} sessionId={sessionId} script={script} />
- </FileDropZone>
</div>
</div>
);
+
+ // The copilot panel sizes itself from the persisted store width — on the
+ // tour we pin it to 500px instead (the !important arbitrary variant wins
+ // over the panel's inline style) without touching the visitor's storage.
+ const artifactPanels = (
+ <>
+ {!isMobile && (
+ <div className="contents [&_[data-artifact-panel]]:!w-[500px]">
+ <ArtifactPanel />
+ </div>
+ )}
+ {isMobile && <ArtifactPanel mobile />}
+ </>
+ );
+
+ if (!appShellEnabled) {
+ return (
+ <div className="relative flex h-dvh w-full overflow-hidden bg-[#fafafa]">
+ {chatColumn}
+ {artifactPanels}
+ </div>
+ );
+ }
+
+ return (
+ <SidebarProvider
+ style={{ "--sidebar-width": "19rem" } as CSSProperties}
+ className="h-dvh min-h-0"
+ >
+ <TourSidebar />
+ <SidebarInset className="min-h-0 overflow-hidden bg-[#fafafa]">
+ <div className="relative flex h-full min-h-0 w-full">
+ {chatColumn}
+ {artifactPanels}
+ </div>
+ </SidebarInset>
+ </SidebarProvider>
+ );
}
diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/__tests__/app-shell.test.tsx b/autogpt_platform/frontend/src/app/(public)/tour/chat/__tests__/app-shell.test.tsx
new file mode 100644
index 0000000000..5a4bc37cb8
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/__tests__/app-shell.test.tsx
@@ -0,0 +1,165 @@
+import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
+
+import {
+ act,
+ fireEvent,
+ render,
+ screen,
+} from "@/tests/integrations/test-utils";
+
+// DotDistortionShader paints a canvas/WebGL frame that happy-dom cannot run and
+// that is purely decorative — stub it so the real chat tree can render.
+vi.mock("@/components/ui/dot-distortion-shader", () => ({
+ DotDistortionShader: () => null,
+}));
+
+vi.mock("@/app/(platform)/copilot/useIsMobile", () => ({
+ useIsMobile: () => false,
+}));
+
+const flagState = vi.hoisted(() => ({ tourAppShell: true }));
+
+vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
+ const actual =
+ await importOriginal<
+ typeof import("@/services/feature-flags/use-get-flag")
+ >();
+ return {
+ ...actual,
+ useGetFlag: (flag: string) =>
+ flag === actual.Flag.TOUR_APP_SHELL ? flagState.tourAppShell : false,
+ };
+});
+
+import { useCopilotUIStore } from "@/app/(platform)/copilot/store";
+import { buildTourArtifactRef } from "../helpers";
+import TourChatPage from "../page";
+import { DEFAULT_SCENARIO_ID, getTourScenario } from "../script/tourScenarios";
+import { useTourStore } from "../tourStore";
+
+function getSendBar() {
+ return screen.getByRole("button", { name: /^Send:/i });
+}
+
+const ADVANCE_STEP_MS = 200;
+// Longest turn is ~7.7s of parts — including the 5s fake run — plus the 3s
+// hold before the demo completes.
+const ADVANCE_TOTAL_MS = 13000;
+
+// The prompt bar is prefilled and locked — the visitor only presses Enter to
+// send. Timers advance in small chunks so effects that register new timers
+// mid-stream get picked up (see main.test.tsx for the full rationale).
+async function pressEnterToSend() {
+ fireEvent.keyDown(getSendBar(), { key: "Enter" });
+ for (
+ let elapsed = 0;
+ elapsed < ADVANCE_TOTAL_MS;
+ elapsed += ADVANCE_STEP_MS
+ ) {
+ await act(async () => {
+ await vi.advanceTimersByTimeAsync(ADVANCE_STEP_MS);
+ });
+ }
+}
+
+describe("Tour chat app shell (tour-app-shell flag)", () => {
+ beforeEach(() => {
+ vi.useFakeTimers();
+ flagState.tourAppShell = true;
+ // Both stores are module-level state — reset between tests.
+ useTourStore.setState({ activeScenarioId: DEFAULT_SCENARIO_ID });
+ useCopilotUIStore.getState().clearArtifactPreview();
+ });
+
+ afterEach(() => {
+ vi.runOnlyPendingTimers();
+ vi.useRealTimers();
+ });
+
+ test("renders the sidebar with scenarios as chat sessions and only Marketplace enabled", () => {
+ render(<TourChatPage />);
+
+ // Scenario pills are replaced by sidebar chat sessions.
+ expect(document.querySelector("[aria-pressed]")).toBeNull();
+ expect(screen.getByText("Recent chats")).toBeDefined();
+ for (const label of [
+ "Daily brief",
+ "Call prep",
+ "Competitor watch",
+ "Support queue",
+ ]) {
+ expect(screen.getByRole("button", { name: label })).toBeDefined();
+ }
+
+ // Marketplace is the only live navigation target.
+ const marketplace = screen.getByRole("link", { name: "Marketplace" });
+ expect(marketplace.getAttribute("href")).toBe("/marketplace");
+ for (const label of ["New Task", "Search", "Agents", "Build", "Files"]) {
+ const item = screen.getByRole("button", { name: label });
+ expect(item.getAttribute("aria-disabled")).toBe("true");
+ }
+ });
+
+ test("clicking a sidebar session switches the demo scenario", async () => {
+ render(<TourChatPage />);
+
+ fireEvent.click(screen.getByRole("button", { name: "Daily brief" }));
+ await act(async () => {
+ await vi.advanceTimersByTimeAsync(0);
+ });
+
+ expect(
+ screen.getByText(/pull my unread emails and calendar/i),
+ ).toBeDefined();
+ });
+
+ test("finishing the demo opens the artifact panel with the mock markdown file", async () => {
+ // The next/dynamic ArtifactPanel chunk can't finish loading once timers
+ // are faked. Pre-open an artifact on real timers and wait for the panel
+ // to actually mount (this is what forces the lazy chunk to resolve),
+ // then reset and run the scripted demo under fake timers.
+ vi.useRealTimers();
+ act(() => {
+ useCopilotUIStore
+ .getState()
+ .openArtifact(
+ buildTourArtifactRef(getTourScenario(DEFAULT_SCENARIO_ID)),
+ );
+ });
+ render(<TourChatPage />);
+ expect(
+ await screen.findByText(
+ "competitor-pricing-report.md",
+ {},
+ { timeout: 10_000 },
+ ),
+ ).toBeDefined();
+ act(() => {
+ useCopilotUIStore.getState().clearArtifactPreview();
+ });
+ vi.useFakeTimers();
+
+ await pressEnterToSend();
+ await pressEnterToSend();
+
+ expect(useCopilotUIStore.getState().artifactPanel.activeArtifact?.id).toBe(
+ "tour-competitor-watch",
+ );
+ // No findBy/waitFor — RTL polling hangs under fake timers. The lazy
+ // chunk is already loaded, so the panel renders synchronously once the
+ // store holds the artifact.
+ expect(screen.getByText("competitor-pricing-report.md")).toBeDefined();
+ }, 30_000);
+
+ test("flag off keeps the scenario pills layout", () => {
+ flagState.tourAppShell = false;
+ render(<TourChatPage />);
+
+ expect(
+ screen
+ .getByRole("button", { name: "Competitor watch" })
+ .getAttribute("aria-pressed"),
+ ).toBe("true");
+ expect(screen.queryByText("Recent chats")).toBeNull();
+ });
+});
diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/__tests__/main.test.tsx b/autogpt_platform/frontend/src/app/(public)/tour/chat/__tests__/main.test.tsx
index e7b24c756f..2e12199969 100644
--- a/autogpt_platform/frontend/src/app/(public)/tour/chat/__tests__/main.test.tsx
+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/__tests__/main.test.tsx
@@ -14,24 +14,43 @@ vi.mock("@/components/ui/dot-distortion-shader", () => ({
}));
import TourChatPage from "../page";
+import { DEFAULT_SCENARIO_ID } from "../script/tourScenarios";
+import { useTourStore } from "../tourStore";
function getSendBar() {
return screen.getByRole("button", { name: /^Send:/i });
}
+const ADVANCE_STEP_MS = 200;
+// Longest turn is ~7.7s of parts — including the 5s fake run — plus the 3s
+// hold before the final turn flips to the upsell.
+const ADVANCE_TOTAL_MS = 13000;
+
// The prompt bar is prefilled and locked — the visitor only presses Enter to send.
async function pressEnterToSend() {
fireEvent.keyDown(getSendBar(), { key: "Enter" });
- // The scripted reveal streams in over real setTimeout delays; advance fake
- // timers past the whole turn (longest turn ~2.9s) so every part is committed.
- await act(async () => {
- await vi.advanceTimersByTimeAsync(4000);
- });
+ // TourStreamingText mounts mid-stream (from a setTimeout callback) and
+ // registers its own setInterval — a timer created by an effect that fires
+ // *during* an in-flight advanceTimersByTimeAsync call is never picked up
+ // by that same call. Advancing in small chunks, each in its own act(),
+ // gives React a chance to flush the mount effect and register the new
+ // interval before the next chunk advances past it.
+ for (
+ let elapsed = 0;
+ elapsed < ADVANCE_TOTAL_MS;
+ elapsed += ADVANCE_STEP_MS
+ ) {
+ await act(async () => {
+ await vi.advanceTimersByTimeAsync(ADVANCE_STEP_MS);
+ });
+ }
}
describe("Tour chat scripted demo", () => {
beforeEach(() => {
vi.useFakeTimers();
+ // The scenario store is module-level state — reset between tests.
+ useTourStore.setState({ activeScenarioId: DEFAULT_SCENARIO_ID });
});
afterEach(() => {
@@ -39,16 +58,16 @@ describe("Tour chat scripted demo", () => {
vi.useRealTimers();
});
- test("prefills the prompt, plays both turns, and opens the upsell", async () => {
+ test("plays the competitor watch demo through to the payoff and upsell", async () => {
render(<TourChatPage />);
- // 1. The prompt bar is prefilled with the first scripted prompt.
+ // 1. The prompt bar is prefilled with the flagship scenario's prompt.
expect(getSendBar()).toBeDefined();
expect(
screen.getByText(/Watch a competitor's pricing page/i),
).toBeDefined();
- // 2. Pressing Enter streams in the scripted assistant turn.
+ // 2. Pressing Enter streams in the scripted plan turn.
await pressEnterToSend();
expect(screen.getByText(/break that down/i)).toBeDefined();
@@ -59,33 +78,49 @@ describe("Tour chat scripted demo", () => {
// The prompt bar now prefills the second turn's prompt.
expect(screen.getByText(/build and run it for me/i)).toBeDefined();
- // 3. Pressing Enter again finishes the script and shows the inline upsell card.
+ // 3. Pressing Enter again builds the agent and shows the payoff artifact.
await pressEnterToSend();
+ // Agent card: block chain chips + schedule row, no raw JSON.
expect(
screen.getAllByText(/Competitor Pricing Watcher/i).length,
).toBeGreaterThan(0);
- expect(screen.getByText(/4 blocks/i)).toBeDefined();
- expect(screen.getByText(/Execution completed/i)).toBeDefined();
+ expect(screen.getAllByText("Text Compare").length).toBeGreaterThan(0);
+ expect(screen.getByText(/Daily · 8:00 AM/i)).toBeDefined();
+ expect(screen.queryByText(/"nodes"/)).toBeNull();
+
+ // Payoff artifact: the email that "landed" with the price diff.
+ expect(screen.getByText(/what lands in your inbox/i)).toBeDefined();
+ expect(screen.getByText(/Price change detected/i)).toBeDefined();
+ expect(screen.getByText("$59/mo")).toBeDefined();
+ expect(screen.getByText("+20.4%")).toBeDefined();
+
+ // Upsell: Pro-first CTA with self-host secondary.
expect(screen.getByText(/Ready to build your own/i)).toBeDefined();
+ expect(screen.getByText(/Start with Pro — \$42\.50\/mo/i)).toBeDefined();
+ expect(screen.getByText(/Self-host free/i)).toBeDefined();
});
- test("sidebar navigation switches to the second chat's prompt", async () => {
+ test("scenario chips switch the demo path", async () => {
render(<TourChatPage />);
- expect(
- screen.getByText(/Watch a competitor's pricing page/i),
- ).toBeDefined();
+ for (const label of [
+ "Daily brief",
+ "Call prep",
+ "Competitor watch",
+ "Support queue",
+ ]) {
+ expect(screen.getByRole("button", { name: label })).toBeDefined();
+ }
- // Click the second chat in the sidebar.
- fireEvent.click(screen.getByText(/Summarize my weekly emails/i));
+ fireEvent.click(screen.getByRole("button", { name: "Daily brief" }));
await act(async () => {
await vi.advanceTimersByTimeAsync(0);
});
- // The prompt bar now prefills the second chat's opening prompt.
+ // The prompt bar now prefills the selected scenario's opening prompt.
expect(
- screen.getByText(/Summarize my unread emails every morning/i),
+ screen.getByText(/pull my unread emails and calendar/i),
).toBeDefined();
});
});
diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourAgentCard/TourAgentCard.tsx b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourAgentCard/TourAgentCard.tsx
new file mode 100644
index 0000000000..dad4d62469
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourAgentCard/TourAgentCard.tsx
@@ -0,0 +1,60 @@
+import { Text } from "@/components/atoms/Text/Text";
+import {
+ ArrowRightIcon,
+ CheckCircleIcon,
+ ClockIcon,
+} from "@phosphor-icons/react";
+import { Fragment } from "react";
+import type { TourAgent } from "../../script/types";
+
+interface Props {
+ agent: TourAgent;
+ /** Flips the badge from an animated "Running" to "Run completed". */
+ runCompleted: boolean;
+}
+
+export function TourAgentCard({ agent, runCompleted }: Props) {
+ return (
+ <div className="flex flex-col gap-3 rounded-xl border border-zinc-200/70 bg-white p-4 shadow-sm">
+ <div className="flex items-center justify-between gap-3">
+ <Text variant="large-medium" className="text-zinc-900">
+ {agent.name}
+ </Text>
+ <span className="flex shrink-0 items-center gap-2 rounded-full bg-emerald-100 px-3 py-1.5 text-sm font-semibold text-emerald-700">
+ {runCompleted ? (
+ <>
+ <CheckCircleIcon className="size-4 shrink-0" weight="fill" />
+ Run completed
+ </>
+ ) : (
+ <>
+ <span className="relative flex size-2 shrink-0">
+ <span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-emerald-500 opacity-75" />
+ <span className="relative inline-flex size-2 rounded-full bg-emerald-500" />
+ </span>
+ Running
+ </>
+ )}
+ </span>
+ </div>
+
+ <div className="flex items-center gap-1.5 text-sm text-zinc-600">
+ <ClockIcon className="size-4 shrink-0" />
+ <span>{agent.schedule} · created from your sentence</span>
+ </div>
+
+ <div className="flex flex-wrap items-center gap-2">
+ {agent.blocks.map((block, index) => (
+ <Fragment key={`${block}-${index}`}>
+ {index > 0 && (
+ <ArrowRightIcon className="size-3.5 shrink-0 text-zinc-400" />
+ )}
+ <span className="rounded-md bg-zinc-100 px-2.5 py-1 font-mono text-xs text-zinc-700">
+ {block}
+ </span>
+ </Fragment>
+ ))}
+ </div>
+ </div>
+ );
+}
diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourArtifactCard/TourArtifactCard.tsx b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourArtifactCard/TourArtifactCard.tsx
new file mode 100644
index 0000000000..60951ca99a
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourArtifactCard/TourArtifactCard.tsx
@@ -0,0 +1,49 @@
+import { Text } from "@/components/atoms/Text/Text";
+import { ArrowRightIcon, EnvelopeSimpleIcon } from "@phosphor-icons/react";
+import type { TourArtifact } from "../../script/types";
+
+interface Props {
+ artifact: TourArtifact;
+}
+
+export function TourArtifactCard({ artifact }: Props) {
+ return (
+ <div className="flex flex-col gap-2.5 rounded-xl border border-zinc-200/70 bg-white p-4 shadow-sm">
+ <div className="flex items-center gap-1.5 text-sm text-zinc-500">
+ <EnvelopeSimpleIcon className="size-4 shrink-0" />
+ <span>Artifact · {artifact.caption}</span>
+ </div>
+
+ <Text variant="large-medium" className="text-zinc-900">
+ {artifact.title}
+ </Text>
+
+ {artifact.subtitle && (
+ <Text variant="body" className="text-zinc-600">
+ {artifact.subtitle}
+ </Text>
+ )}
+
+ {artifact.bullets && artifact.bullets.length > 0 && (
+ <ul className="flex list-disc flex-col gap-1.5 pl-5 text-sm text-zinc-700">
+ {artifact.bullets.map((bullet) => (
+ <li key={bullet}>{bullet}</li>
+ ))}
+ </ul>
+ )}
+
+ {artifact.diff && (
+ <div className="flex items-center justify-between gap-3 rounded-lg bg-zinc-50 px-4 py-3">
+ <div className="flex items-center gap-3 text-base font-medium">
+ <span className="text-red-700 line-through decoration-red-700/70">
+ {artifact.diff.from}
+ </span>
+ <ArrowRightIcon className="size-4 shrink-0 text-zinc-500" />
+ <span className="text-emerald-700">{artifact.diff.to}</span>
+ </div>
+ <span className="text-sm text-zinc-500">{artifact.diff.delta}</span>
+ </div>
+ )}
+ </div>
+ );
+}
diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourChatContainer/TourChatContainer.tsx b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourChatContainer/TourChatContainer.tsx
index c9b52b3f4b..e89dd91a35 100644
--- a/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourChatContainer/TourChatContainer.tsx
+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourChatContainer/TourChatContainer.tsx
@@ -1,8 +1,9 @@
"use client";
-import { ChatMessagesContainer } from "@/app/(platform)/copilot/components/ChatMessagesContainer/ChatMessagesContainer";
-import { CopilotChatActionsProvider } from "@/app/(platform)/copilot/components/CopilotChatActionsProvider/CopilotChatActionsProvider";
+import { cn } from "@/lib/utils";
+import { LightningIcon } from "@phosphor-icons/react";
import type { useTourCopilot } from "../../useTourCopilot";
+import { TourMessageList } from "../TourMessageList/TourMessageList";
import { TourPromptBar } from "../TourPromptBar/TourPromptBar";
interface Props {
@@ -11,36 +12,41 @@ interface Props {
export function TourChatContainer({ chat }: Props) {
return (
- <CopilotChatActionsProvider onSend={chat.onSend} chatSurface="builder">
- <div className="flex h-full min-h-0 w-full flex-col px-2 lg:px-0">
- {/* Tour-only card styling. These descendant selectors target the shared
- copilot tool-call markup (.bg-card / .bg-stone-50 / .py-2) by class
- name — if those classes change in ChatMessagesContainer, update them
- here too. Scoped this way to avoid modifying the shared component. */}
- <div className="mx-auto flex h-full min-h-0 w-full max-w-3xl flex-col bg-[#fafafa] pb-12 [&_.bg-card]:mb-6 [&_.bg-stone-50]:rounded-xl [&_.bg-stone-50]:border [&_.bg-stone-50]:border-zinc-200/70 [&_.bg-stone-50]:bg-white [&_.bg-stone-50]:!py-2 [&_.bg-stone-50]:shadow-sm [&_.py-2]:py-0">
- <ChatMessagesContainer
- messages={chat.messages}
- status={chat.status}
- error={chat.error}
- isLoading={false}
- sessionID={chat.sessionId}
- turnStats={chat.turnStats}
- queuedMessages={chat.queuedMessages}
+ <div className="flex h-full min-h-0 w-full flex-col px-2 lg:px-0">
+ {/* Tour-only card styling. These descendant selectors target the shared
+ ToolAccordion markup (.bg-stone-50 / .py-2) by class name — if those
+ classes change in ToolAccordion, update them here too. Scoped this
+ way to avoid modifying the shared component. */}
+ <div className="mx-auto flex h-full min-h-0 w-full max-w-3xl flex-col bg-[#fafafa] pb-8 [&_.bg-stone-50]:rounded-xl [&_.bg-stone-50]:border [&_.bg-stone-50]:border-zinc-200/70 [&_.bg-stone-50]:bg-white [&_.bg-stone-50]:!py-2 [&_.bg-stone-50]:shadow-sm [&_.py-2]:py-0">
+ <TourMessageList
+ messages={chat.messages}
+ isStreaming={chat.isStreaming}
+ />
+ <div
+ className={cn(
+ "relative px-3 pb-2 pt-2",
+ // The upsell renders as a fixed bottom banner once the demo is
+ // exhausted — pad so the hint line isn't hidden underneath it.
+ chat.isExhausted && "pb-24",
+ )}
+ >
+ <TourPromptBar
+ key={chat.turnIndex}
+ prompt={chat.currentUserPrompt}
+ isStreaming={chat.isStreaming}
+ isExhausted={chat.isExhausted}
+ onSend={() =>
+ chat.currentUserPrompt && chat.onSend(chat.currentUserPrompt)
+ }
+ onReplay={chat.reset}
/>
- <div className="relative px-3 pb-2 pt-2">
- <TourPromptBar
- key={chat.turnIndex}
- prompt={chat.currentUserPrompt}
- isStreaming={chat.isStreaming}
- isExhausted={chat.isExhausted}
- onSend={() =>
- chat.currentUserPrompt && chat.onSend(chat.currentUserPrompt)
- }
- onReplay={chat.reset}
- />
- </div>
+ <p className="mt-2 flex items-center justify-center gap-1 text-sm text-zinc-400">
+ <LightningIcon className="size-3.5 shrink-0" weight="fill" />
+ Simulated demo — pick a scenario above to watch Autopilot build a
+ different agent
+ </p>
</div>
</div>
- </CopilotChatActionsProvider>
+ </div>
);
}
diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourChatSidebar/TourChatSidebar.tsx b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourChatSidebar/TourChatSidebar.tsx
deleted file mode 100644
index ecae15c09f..0000000000
--- a/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourChatSidebar/TourChatSidebar.tsx
+++ /dev/null
@@ -1,107 +0,0 @@
-"use client";
-
-import { ChatSessionBlock } from "@/app/(platform)/copilot/components/ChatSessionBlock/ChatSessionBlock";
-import { AutoGPTLogo } from "@/components/atoms/AutoGPTLogo/AutoGPTLogo";
-import { Button } from "@/components/atoms/Button/Button";
-import { Text } from "@/components/atoms/Text/Text";
-import { Button as ShadcnButton } from "@/components/ui/button";
-import {
- Sidebar,
- SidebarContent,
- SidebarHeader,
- SidebarTrigger,
-} from "@/components/ui/sidebar";
-import { cn } from "@/lib/utils";
-import {
- FilesIcon,
- MagnifyingGlassIcon,
- PlusIcon,
-} from "@phosphor-icons/react";
-import { tourChats } from "../../script/tourChats";
-import { useTourStore } from "../../tourStore";
-
-export function TourChatSidebar() {
- const activeSessionId = useTourStore((s) => s.activeSessionId);
- const setActiveSession = useTourStore((s) => s.setActiveSession);
-
- return (
- <Sidebar
- variant="inset"
- collapsible="icon"
- className="!top-0 !h-[100dvh] px-0 [&_[data-sidebar=sidebar]]:border-r [&_[data-sidebar=sidebar]]:border-r-[#80808017]"
- >
- <SidebarHeader className="shrink-0 px-4 pb-3 pt-3">
- <div className="flex flex-col gap-3 px-3">
- <AutoGPTLogo className="mx-auto mb-[10px] h-auto w-24" />
- <div className="flex items-center justify-between">
- <Text variant="h3" size="body-medium">
- Your chats
- </Text>
- <div className="flex items-center">
- <ShadcnButton
- type="button"
- variant="ghost"
- size="icon-sm"
- aria-label="Search chats"
- disabled
- aria-disabled="true"
- className="rounded-full text-zinc-600 hover:bg-zinc-100"
- >
- <MagnifyingGlassIcon className="!size-5" />
- </ShadcnButton>
- <ShadcnButton
- type="button"
- variant="ghost"
- size="icon-sm"
- aria-label="Files"
- disabled
- aria-disabled="true"
- className="rounded-full text-zinc-600 hover:bg-zinc-100"
- >
- <FilesIcon className="!size-5" />
- </ShadcnButton>
- <SidebarTrigger />
- </div>
- </div>
- <Button
- variant="primary"
- size="small"
- className="w-full"
- disabled
- aria-disabled="true"
- leftIcon={<PlusIcon className="h-4 w-4" weight="bold" />}
- >
- New Chat
- </Button>
- </div>
- </SidebarHeader>
-
- <SidebarContent className="gap-4 overflow-y-auto px-4 py-4 [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden">
- <div className="flex flex-col gap-1">
- {tourChats.map((chat) => {
- const isActive = chat.id === activeSessionId;
- return (
- <button
- key={chat.id}
- type="button"
- onClick={() => setActiveSession(chat.id)}
- className={cn(
- "w-full px-3 py-2.5 text-left transition-colors",
- isActive
- ? "rounded-lg bg-zinc-100"
- : "rounded-lg border-b border-b-[#8080800f] last:border-b-0 hover:bg-zinc-50",
- )}
- >
- <ChatSessionBlock
- title={chat.title}
- updatedAt={chat.updatedAt}
- isActive={isActive}
- />
- </button>
- );
- })}
- </div>
- </SidebarContent>
- </Sidebar>
- );
-}
diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourMessageList/TourMessageList.tsx b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourMessageList/TourMessageList.tsx
new file mode 100644
index 0000000000..b06d29d8a0
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourMessageList/TourMessageList.tsx
@@ -0,0 +1,111 @@
+"use client";
+
+import { ThinkingIndicator } from "@/app/(platform)/copilot/components/ChatMessagesContainer/components/ThinkingIndicator";
+import {
+ Conversation,
+ ConversationContent,
+ ConversationScrollButton,
+} from "@/components/ai-elements/conversation";
+import { Message, MessageContent } from "@/components/ai-elements/message";
+import type { TourMessage, TourPart } from "../../script/types";
+import { TourAgentCard } from "../TourAgentCard/TourAgentCard";
+import { TourArtifactCard } from "../TourArtifactCard/TourArtifactCard";
+import { TourPlanCard } from "../TourPlanCard/TourPlanCard";
+import { TourStreamingText } from "./TourStreamingText";
+
+// Mirrors the real copilot's MessageContent overrides (purple user bubble,
+// 1rem text) so the tour chat reads exactly like the product.
+const MESSAGE_CONTENT_CLASSES =
+ "text-base leading-relaxed " +
+ "group-[.is-user]:rounded-xl group-[.is-user]:bg-purple-100 group-[.is-user]:px-3 group-[.is-user]:py-2.5 group-[.is-user]:text-slate-900 group-[.is-user]:[border-bottom-right-radius:0] " +
+ "group-[.is-assistant]:bg-transparent group-[.is-assistant]:text-slate-900";
+
+const CARD_ANIMATION_CLASSES =
+ "animate-in fade-in slide-in-from-bottom-2 fill-mode-both duration-500";
+
+interface Props {
+ messages: TourMessage[];
+ isStreaming: boolean;
+}
+
+export function TourMessageList({ messages, isStreaming }: Props) {
+ const last = messages[messages.length - 1];
+ const showThinking =
+ isStreaming && last?.role === "assistant" && last.parts.length === 0;
+
+ return (
+ <Conversation className="min-h-0 flex-1">
+ <ConversationContent className="gap-6 px-3 pb-6 pt-4">
+ {messages.map((message) => (
+ <Message
+ key={message.id}
+ from={message.role}
+ className="duration-300 animate-in fade-in slide-in-from-bottom-2"
+ >
+ <MessageContent className={MESSAGE_CONTENT_CLASSES}>
+ {message.parts.map((part, index) => (
+ <TourPartRenderer
+ key={`${message.id}-${index}`}
+ part={part}
+ role={message.role}
+ hasFollowingPart={index < message.parts.length - 1}
+ followsCard={
+ index > 0 && message.parts[index - 1].type !== "text"
+ }
+ />
+ ))}
+ </MessageContent>
+ </Message>
+ ))}
+ {showThinking && <ThinkingIndicator active elapsedSeconds={0} />}
+ </ConversationContent>
+ <ConversationScrollButton />
+ </Conversation>
+ );
+}
+
+function TourPartRenderer({
+ part,
+ role,
+ hasFollowingPart,
+ followsCard,
+}: {
+ part: TourPart;
+ role: TourMessage["role"];
+ hasFollowingPart: boolean;
+ followsCard: boolean;
+}) {
+ const textSpacing = followsCard ? "mt-3" : undefined;
+
+ switch (part.type) {
+ case "text":
+ if (role === "user") return <p className={textSpacing}>{part.text}</p>;
+ return (
+ <div className={textSpacing}>
+ <TourStreamingText text={part.text} />
+ </div>
+ );
+ case "plan":
+ return (
+ <div className={CARD_ANIMATION_CLASSES}>
+ <TourPlanCard plan={part.plan} />
+ </div>
+ );
+ case "agent":
+ return (
+ <div className={CARD_ANIMATION_CLASSES}>
+ <TourAgentCard agent={part.agent} runCompleted={hasFollowingPart} />
+ </div>
+ );
+ case "artifact":
+ return (
+ <div className={CARD_ANIMATION_CLASSES}>
+ <TourArtifactCard artifact={part.artifact} />
+ </div>
+ );
+ default: {
+ const exhaustiveCheck: never = part;
+ return exhaustiveCheck;
+ }
+ }
+}
diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourMessageList/TourStreamingText.tsx b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourMessageList/TourStreamingText.tsx
new file mode 100644
index 0000000000..ccde1ac33e
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourMessageList/TourStreamingText.tsx
@@ -0,0 +1,39 @@
+"use client";
+
+import { useMountEffect } from "@/hooks/useMountEffect";
+import { useRef, useState } from "react";
+
+const CHARS_PER_TICK = 2;
+const TICK_MS = 16;
+
+/** Reveals the scripted text character by character, like a live LLM stream.
+ * The revealed text stays a single text node so test matchers and copy/paste
+ * see the full sentence once the reveal completes. */
+export function TourStreamingText({ text }: { text: string }) {
+ // Code points, not UTF-16 units — slicing mid-surrogate would briefly
+ // render a broken glyph for emoji like 🎉.
+ const chars = useRef(Array.from(text));
+ const [visibleCount, setVisibleCount] = useState(0);
+
+ useMountEffect(() => {
+ const id = setInterval(() => {
+ setVisibleCount((count) => {
+ const next = Math.min(count + CHARS_PER_TICK, chars.current.length);
+ if (next >= chars.current.length) clearInterval(id);
+ return next;
+ });
+ }, TICK_MS);
+ return () => clearInterval(id);
+ });
+
+ const isDone = visibleCount >= chars.current.length;
+
+ return (
+ <p>
+ {chars.current.slice(0, visibleCount).join("")}
+ {!isDone && (
+ <span className="ml-0.5 inline-block h-4 w-2 animate-pulse rounded-sm bg-zinc-300 align-middle" />
+ )}
+ </p>
+ );
+}
diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourPlanCard/TourPlanCard.tsx b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourPlanCard/TourPlanCard.tsx
new file mode 100644
index 0000000000..0d9aae4567
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourPlanCard/TourPlanCard.tsx
@@ -0,0 +1,85 @@
+"use client";
+
+import {
+ ContentGrid,
+ ContentMessage,
+} from "@/app/(platform)/copilot/components/ToolAccordion/AccordionContent";
+import { ToolAccordion } from "@/app/(platform)/copilot/components/ToolAccordion/ToolAccordion";
+import { Text } from "@/components/atoms/Text/Text";
+import {
+ CheckCircleIcon,
+ CubeIcon,
+ PlusCircleIcon,
+} from "@phosphor-icons/react";
+import type { TourPlan, TourPlanStep } from "../../script/types";
+
+const STEP_STAGGER_MS = 200;
+
+/** Tour-local twin of the copilot's DecomposeGoal card — same ToolAccordion
+ * shell, but the steps stream in with a staggered fade/slide and the check
+ * icons pop in after each row. */
+export function TourPlanCard({ plan }: { plan: TourPlan }) {
+ return (
+ <ToolAccordion
+ icon={<PlusCircleIcon size={32} weight="light" />}
+ title={`Build Plan — ${plan.steps.length} steps`}
+ description={plan.goal}
+ defaultExpanded
+ >
+ <ContentGrid>
+ <ContentMessage>
+ {`Here's the plan (${plan.steps.length} steps):`}
+ </ContentMessage>
+
+ <div className="mb-6 rounded-lg bg-card p-3">
+ <div className="space-y-0.5">
+ {plan.steps.map((step, index) => (
+ <TourPlanStepItem
+ key={`${step.blockName}-${index}`}
+ step={step}
+ index={index}
+ />
+ ))}
+ </div>
+ </div>
+ </ContentGrid>
+ </ToolAccordion>
+ );
+}
+
+function TourPlanStepItem({
+ step,
+ index,
+}: {
+ step: TourPlanStep;
+ index: number;
+}) {
+ return (
+ <div
+ className="flex items-start gap-3 py-1.5 duration-500 animate-in fade-in slide-in-from-bottom-2 fill-mode-both"
+ style={{ animationDelay: `${index * STEP_STAGGER_MS}ms` }}
+ >
+ <CheckCircleIcon
+ size={18}
+ weight="fill"
+ aria-label="completed"
+ className="mt-0.5 shrink-0 text-emerald-500 duration-300 animate-in fade-in zoom-in-50 fill-mode-both"
+ style={{ animationDelay: `${index * STEP_STAGGER_MS + 200}ms` }}
+ />
+ <div className="min-w-0 flex-1">
+ <Text variant="body-medium" className="text-base text-foreground">
+ {index + 1}. {step.description}
+ </Text>
+ <div className="mt-0.5 flex items-center gap-1">
+ <CubeIcon size={12} className="text-muted-foreground" />
+ <Text
+ variant="small"
+ className="font-mono text-xs text-muted-foreground"
+ >
+ {step.blockName}
+ </Text>
+ </div>
+ </div>
+ </div>
+ );
+}
diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourPromptBar/TourPromptBar.tsx b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourPromptBar/TourPromptBar.tsx
index 7b96a95059..1f39db12a7 100644
--- a/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourPromptBar/TourPromptBar.tsx
+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourPromptBar/TourPromptBar.tsx
@@ -4,7 +4,7 @@ import { useMountEffect } from "@/hooks/useMountEffect";
import { cn } from "@/lib/utils";
import { ArrowUpIcon } from "@phosphor-icons/react";
import { useRef } from "react";
-import { TourUpsellCard } from "../TourUpsellCard/TourUpsellCard";
+import { TourUpsellBanner } from "../TourUpsellBanner/TourUpsellBanner";
interface Props {
prompt: string | null;
@@ -30,7 +30,7 @@ export function TourPromptBar({
});
if (isExhausted) {
- return <TourUpsellCard onReplay={onReplay} />;
+ return <TourUpsellBanner onReplay={onReplay} />;
}
function send() {
diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourScenarioChips/TourScenarioChips.tsx b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourScenarioChips/TourScenarioChips.tsx
new file mode 100644
index 0000000000..15523626a6
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourScenarioChips/TourScenarioChips.tsx
@@ -0,0 +1,43 @@
+"use client";
+
+import { useCopilotUIStore } from "@/app/(platform)/copilot/store";
+import { cn } from "@/lib/utils";
+import { tourScenarios } from "../../script/tourScenarios";
+import { useTourStore } from "../../tourStore";
+
+export function TourScenarioChips() {
+ const activeScenarioId = useTourStore((s) => s.activeScenarioId);
+ const setActiveScenario = useTourStore((s) => s.setActiveScenario);
+ const clearArtifactPreview = useCopilotUIStore((s) => s.clearArtifactPreview);
+
+ function selectScenario(id: string) {
+ clearArtifactPreview();
+ setActiveScenario(id);
+ }
+
+ return (
+ <div className="flex flex-wrap items-center justify-center gap-2">
+ {tourScenarios.map((scenario) => {
+ const ChipIcon = scenario.icon;
+ const isActive = scenario.id === activeScenarioId;
+ return (
+ <button
+ key={scenario.id}
+ type="button"
+ onClick={() => selectScenario(scenario.id)}
+ aria-pressed={isActive}
+ className={cn(
+ "flex items-center gap-2 rounded-full border bg-white px-4 py-2 text-sm font-medium transition-colors",
+ isActive
+ ? "border-violet-400 bg-violet-50 text-violet-700"
+ : "border-zinc-200 text-zinc-600 hover:border-zinc-300 hover:text-zinc-900",
+ )}
+ >
+ <ChipIcon className="size-4 shrink-0" />
+ {scenario.label}
+ </button>
+ );
+ })}
+ </div>
+ );
+}
diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourSidebar/TourSidebar.tsx b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourSidebar/TourSidebar.tsx
new file mode 100644
index 0000000000..802f113637
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourSidebar/TourSidebar.tsx
@@ -0,0 +1,198 @@
+"use client";
+
+import { useCopilotUIStore } from "@/app/(platform)/copilot/store";
+import {
+ getSidebarItemVariants,
+ sidebarContainerVariants,
+} from "@/components/layout/AppSidebar/animations";
+import {
+ Collapsible,
+ CollapsibleContent,
+ CollapsibleTrigger,
+} from "@/components/ui/collapsible";
+import {
+ Sidebar,
+ SidebarContent,
+ SidebarGroup,
+ SidebarGroupContent,
+ SidebarGroupLabel,
+ SidebarMenu,
+ SidebarMenuButton,
+ SidebarMenuItem,
+ SidebarRail,
+} from "@/components/ui/sidebar";
+import {
+ CaretDownIcon,
+ FlowArrowIcon,
+ FolderIcon,
+ type Icon,
+ MagnifyingGlassIcon,
+ SparkleIcon,
+ SquaresFourIcon,
+ StorefrontIcon,
+} from "@phosphor-icons/react";
+import { motion, useReducedMotion } from "framer-motion";
+import Link from "next/link";
+import { tourScenarios } from "../../script/tourScenarios";
+import { useTourStore } from "../../tourStore";
+import { TourSidebarHeader } from "./components/TourSidebarHeader";
+
+// Visual clone of the logged-in AppSidebar for the public tour demo. Only
+// Marketplace navigates; every other destination needs an account, so those
+// items render disabled. The "Recent chats" group lists the demo scenarios
+// as if they were chat sessions.
+
+function DisabledMenuItem({
+ icon: ItemIcon,
+ label,
+}: {
+ icon: Icon;
+ label: string;
+}) {
+ return (
+ <SidebarMenuItem>
+ <SidebarMenuButton
+ aria-disabled="true"
+ tooltip={label}
+ className="cursor-not-allowed font-normal opacity-50 group-data-[collapsible=icon]:!p-1.5 hover:!bg-transparent [&>svg]:size-5"
+ >
+ <ItemIcon className="size-5" />
+ <span className="truncate">{label}</span>
+ </SidebarMenuButton>
+ </SidebarMenuItem>
+ );
+}
+
+function TourSessionsMenu() {
+ const activeScenarioId = useTourStore((s) => s.activeScenarioId);
+ const setActiveScenario = useTourStore((s) => s.setActiveScenario);
+ const clearArtifactPreview = useCopilotUIStore((s) => s.clearArtifactPreview);
+
+ function selectScenario(id: string) {
+ clearArtifactPreview();
+ setActiveScenario(id);
+ }
+
+ return (
+ <SidebarMenu>
+ {tourScenarios.map((scenario) => (
+ <SidebarMenuItem key={scenario.id}>
+ <SidebarMenuButton
+ isActive={scenario.id === activeScenarioId}
+ tooltip={scenario.label}
+ onClick={() => selectScenario(scenario.id)}
+ className="font-normal data-[active=true]:!bg-zinc-200 data-[active=true]:font-normal hover:!bg-zinc-200"
+ >
+ <scenario.icon className="size-4 shrink-0" />
+ <span className="truncate">{scenario.label}</span>
+ </SidebarMenuButton>
+ </SidebarMenuItem>
+ ))}
+ </SidebarMenu>
+ );
+}
+
+export function TourSidebar() {
+ const reduceMotion = useReducedMotion();
+ const itemVariants = getSidebarItemVariants(!!reduceMotion);
+
+ return (
+ <Sidebar
+ collapsible="icon"
+ className="[&_[data-sidebar=sidebar]]:bg-[#F3F3F4]"
+ >
+ <TourSidebarHeader />
+
+ <SidebarContent className="gap-2 overflow-hidden">
+ <motion.div
+ variants={sidebarContainerVariants}
+ initial="hidden"
+ animate="show"
+ className="flex min-h-0 flex-1 flex-col gap-2"
+ >
+ <motion.div variants={itemVariants}>
+ <SidebarGroup className="mt-2 py-1 group-data-[collapsible=icon]:mt-0">
+ <SidebarGroupContent>
+ <SidebarMenu>
+ <SidebarMenuItem>
+ <SidebarMenuButton
+ aria-disabled="true"
+ tooltip="New Task"
+ className="cursor-not-allowed justify-center rounded-lg bg-zinc-800 font-medium text-white opacity-50 group-data-[collapsible=icon]:justify-start hover:!bg-zinc-800 hover:!text-white"
+ >
+ <SparkleIcon className="size-4" />
+ <span className="truncate">New Task</span>
+ </SidebarMenuButton>
+ </SidebarMenuItem>
+ </SidebarMenu>
+ </SidebarGroupContent>
+ </SidebarGroup>
+ </motion.div>
+
+ <motion.div variants={itemVariants}>
+ <SidebarGroup className="mt-2 py-1 group-data-[collapsible=icon]:mt-0">
+ <SidebarGroupContent>
+ <SidebarMenu className="group-data-[collapsible=icon]:gap-1">
+ <DisabledMenuItem icon={MagnifyingGlassIcon} label="Search" />
+ <DisabledMenuItem icon={SquaresFourIcon} label="Agents" />
+ <SidebarMenuItem>
+ <SidebarMenuButton
+ asChild
+ tooltip="Marketplace"
+ className="font-normal group-data-[collapsible=icon]:!p-1.5 hover:!bg-zinc-200 [&>svg]:size-5"
+ >
+ <Link href="/marketplace">
+ <StorefrontIcon className="size-5" />
+ <span className="truncate">Marketplace</span>
+ </Link>
+ </SidebarMenuButton>
+ </SidebarMenuItem>
+ <DisabledMenuItem icon={FlowArrowIcon} label="Build" />
+ </SidebarMenu>
+ </SidebarGroupContent>
+ </SidebarGroup>
+ </motion.div>
+
+ <motion.div variants={itemVariants}>
+ <Collapsible defaultOpen className="group/collapsible">
+ <SidebarGroup className="py-1">
+ <SidebarGroupLabel asChild className="text-[13px] font-medium">
+ <CollapsibleTrigger>
+ Workspace
+ <CaretDownIcon
+ weight="bold"
+ className="ease-[cubic-bezier(0.33,1,0.68,1)] ml-auto size-4 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-180 motion-reduce:transition-none"
+ />
+ </CollapsibleTrigger>
+ </SidebarGroupLabel>
+ <CollapsibleContent className="overflow-hidden data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down motion-reduce:animate-none">
+ <SidebarGroupContent>
+ <SidebarMenu className="group-data-[collapsible=icon]:gap-1">
+ <DisabledMenuItem icon={FolderIcon} label="Files" />
+ </SidebarMenu>
+ </SidebarGroupContent>
+ </CollapsibleContent>
+ </SidebarGroup>
+ </Collapsible>
+ </motion.div>
+
+ <motion.div
+ variants={itemVariants}
+ className="group-data-[collapsible=icon]:hidden"
+ >
+ <SidebarGroup className="py-1">
+ <SidebarGroupLabel className="text-[13px] font-medium">
+ Recent chats
+ </SidebarGroupLabel>
+ <SidebarGroupContent>
+ <TourSessionsMenu />
+ </SidebarGroupContent>
+ </SidebarGroup>
+ </motion.div>
+ </motion.div>
+ </SidebarContent>
+
+ <SidebarRail />
+ </Sidebar>
+ );
+}
diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourSidebar/components/TourSidebarHeader.tsx b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourSidebar/components/TourSidebarHeader.tsx
new file mode 100644
index 0000000000..956743435f
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourSidebar/components/TourSidebarHeader.tsx
@@ -0,0 +1,47 @@
+"use client";
+
+import { AutoGPTLogo } from "@/components/atoms/AutoGPTLogo/AutoGPTLogo";
+import { SidebarHeader, useSidebar } from "@/components/ui/sidebar";
+import { cn } from "@/lib/utils";
+import { SidebarSimpleIcon } from "@phosphor-icons/react";
+import Link from "next/link";
+
+// Mirror of AppSidebarHeader, with the logo pointing back at the tour
+// instead of the (auth-gated) copilot home.
+export function TourSidebarHeader() {
+ const { state, toggleSidebar } = useSidebar();
+ const isCollapsed = state === "collapsed";
+
+ return (
+ <SidebarHeader className="flex animate-fade-in flex-row items-center justify-between gap-2 p-2 group-data-[collapsible=icon]:flex-col">
+ <Link
+ href="/tour"
+ aria-label="AutoGPT"
+ className={cn(
+ "flex items-center",
+ isCollapsed && "group-focus-within:hidden group-hover:hidden",
+ )}
+ >
+ {isCollapsed ? (
+ <AutoGPTLogo hideText viewBox="47 -1 42 42" className="size-8" />
+ ) : (
+ <AutoGPTLogo className="h-9 w-auto" />
+ )}
+ </Link>
+
+ <button
+ type="button"
+ aria-label={isCollapsed ? "Expand sidebar" : "Collapse sidebar"}
+ onClick={toggleSidebar}
+ className={cn(
+ "size-8 shrink-0 items-center justify-center rounded-md transition-colors hover:bg-zinc-200",
+ isCollapsed
+ ? "hidden group-focus-within:flex group-hover:flex"
+ : "flex",
+ )}
+ >
+ <SidebarSimpleIcon className="size-5 text-sidebar-foreground" />
+ </button>
+ </SidebarHeader>
+ );
+}
diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourUpsellBanner/TourUpsellBanner.tsx b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourUpsellBanner/TourUpsellBanner.tsx
new file mode 100644
index 0000000000..0d3b5fee98
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourUpsellBanner/TourUpsellBanner.tsx
@@ -0,0 +1,71 @@
+"use client";
+
+import { Button } from "@/components/atoms/Button/Button";
+import { Text } from "@/components/atoms/Text/Text";
+import {
+ ArrowCounterClockwiseIcon,
+ GithubLogoIcon,
+ SparkleIcon,
+} from "@phosphor-icons/react";
+
+interface Props {
+ onReplay: () => void;
+}
+
+export function TourUpsellBanner({ onReplay }: Props) {
+ return (
+ <div className="fixed inset-x-0 bottom-0 z-50 border-t border-zinc-200 bg-white shadow-[0_-2px_8px_rgba(0,0,0,0.04),0_0_32px_-4px_rgba(99,102,241,0.4)] duration-500 animate-in fade-in slide-in-from-bottom-2">
+ <div className="flex flex-col gap-3 px-4 py-3 sm:flex-row sm:items-center sm:gap-4 sm:px-6">
+ <div className="flex items-start gap-3">
+ <SparkleIcon
+ size={22}
+ weight="fill"
+ className="mt-0.5 shrink-0 text-violet-600"
+ />
+ <div className="flex flex-col">
+ <Text variant="large-medium" className="text-zinc-900">
+ Ready to build your own?
+ </Text>
+ <Text variant="body" className="text-zinc-600">
+ Spin up agents like this in minutes — hosted for you, or on your
+ own infrastructure.
+ </Text>
+ </div>
+ </div>
+
+ <div className="flex flex-col gap-2 sm:ml-auto sm:flex-row sm:items-center sm:gap-3">
+ <Button
+ variant="ghost"
+ size="small"
+ leftIcon={<ArrowCounterClockwiseIcon className="h-4 w-4" />}
+ onClick={onReplay}
+ >
+ Replay demo
+ </Button>
+ <Button
+ as="NextLink"
+ href="https://github.com/Significant-Gravitas/AutoGPT"
+ target="_blank"
+ rel="noopener noreferrer"
+ variant="secondary"
+ size="small"
+ leftIcon={<GithubLogoIcon className="h-4 w-4" />}
+ >
+ Self-host free
+ </Button>
+ <Button
+ as="NextLink"
+ href="https://agpt.co/pricing"
+ target="_blank"
+ rel="noopener noreferrer"
+ variant="primary"
+ size="small"
+ className="shadow-[0_0_24px_-4px_rgba(124,58,237,0.7)] transition-shadow hover:shadow-[0_0_32px_-2px_rgba(124,58,237,0.85)]"
+ >
+ Start with Pro — $42.50/mo
+ </Button>
+ </div>
+ </div>
+ </div>
+ );
+}
diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourUpsellCard/TourUpsellCard.tsx b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourUpsellCard/TourUpsellCard.tsx
deleted file mode 100644
index b2b958c528..0000000000
--- a/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourUpsellCard/TourUpsellCard.tsx
+++ /dev/null
@@ -1,56 +0,0 @@
-"use client";
-
-import { Button } from "@/components/atoms/Button/Button";
-import { Text } from "@/components/atoms/Text/Text";
-import { ArrowCounterClockwiseIcon, SparkleIcon } from "@phosphor-icons/react";
-
-interface Props {
- onReplay: () => void;
-}
-
-export function TourUpsellCard({ onReplay }: Props) {
- return (
- <div className="flex flex-col gap-4 rounded-xl border border-zinc-200 bg-white p-5 shadow-[0_2px_8px_rgba(0,0,0,0.04),0_0_32px_-4px_rgba(99,102,241,0.4)]">
- <div className="flex items-start gap-3">
- <SparkleIcon
- size={22}
- weight="fill"
- className="mt-0.5 shrink-0 text-violet-600"
- />
- <div className="flex flex-col gap-1">
- <Text variant="large-medium" className="text-zinc-900">
- Ready to build your own?
- </Text>
- <Text variant="body" className="text-zinc-600">
- Spin up your own AI agents in minutes. Sign up free to start
- building, no credit card required.
- </Text>
- </div>
- </div>
-
- <div className="flex flex-col gap-2 sm:flex-row sm:justify-end">
- <Button
- variant="ghost"
- size="small"
- leftIcon={<ArrowCounterClockwiseIcon className="h-4 w-4" />}
- onClick={onReplay}
- >
- Replay demo
- </Button>
- <Button
- as="NextLink"
- href="https://agpt.co/pricing"
- target="_blank"
- rel="noopener noreferrer"
- variant="secondary"
- size="small"
- >
- See pricing
- </Button>
- <Button as="NextLink" href="/signup" variant="primary" size="small">
- Sign up free
- </Button>
- </div>
- </div>
- );
-}
diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/helpers.ts b/autogpt_platform/frontend/src/app/(public)/tour/chat/helpers.ts
index 7de9baf738..56d5296df6 100644
--- a/autogpt_platform/frontend/src/app/(public)/tour/chat/helpers.ts
+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/helpers.ts
@@ -1,10 +1,25 @@
-import type { UIMessage } from "ai";
-import type { ScriptedPart } from "./script/types";
+import type { ArtifactRef } from "@/app/(platform)/copilot/store";
+import type { TourMessage, TourPart, TourScenario } from "./script/types";
+
+/** Build an ArtifactRef the real copilot ArtifactPanel can preview, copy and
+ * download without a backend — the data: URI stands in for the workspace
+ * download proxy the panel normally fetches from. */
+export function buildTourArtifactRef(scenario: TourScenario): ArtifactRef {
+ const { filename, markdown } = scenario.completionArtifact;
+ return {
+ id: `tour-${scenario.id}`,
+ title: filename,
+ mimeType: "text/markdown",
+ sourceUrl: `data:text/markdown;charset=utf-8,${encodeURIComponent(markdown)}`,
+ origin: "agent",
+ sizeBytes: markdown.length,
+ };
+}
export function appendPartToLastMessage(
- messages: UIMessage[],
- part: ScriptedPart["part"],
-): UIMessage[] {
+ messages: TourMessage[],
+ part: TourPart,
+): TourMessage[] {
const next = messages.slice();
const last = next[next.length - 1];
next[next.length - 1] = { ...last, parts: [...last.parts, part] };
diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/page.tsx b/autogpt_platform/frontend/src/app/(public)/tour/chat/page.tsx
index 397e3cb72a..324098ff89 100644
--- a/autogpt_platform/frontend/src/app/(public)/tour/chat/page.tsx
+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/page.tsx
@@ -1,9 +1,7 @@
"use client";
import { TourCopilot } from "./TourCopilot";
-import { useTourBootstrap } from "./useTourBootstrap";
export default function TourChatPage() {
- useTourBootstrap();
return <TourCopilot />;
}
diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/script/callPrepScript.ts b/autogpt_platform/frontend/src/app/(public)/tour/chat/script/callPrepScript.ts
new file mode 100644
index 0000000000..6a4d1993e2
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/script/callPrepScript.ts
@@ -0,0 +1,101 @@
+import { RUN_DELAY_MS } from "./constants";
+import type { TourScript } from "./types";
+
+export const callPrepScript: TourScript = [
+ {
+ assistantMessageId: "callprep-asst-1",
+ userPrompt: "Brief me on the company and person before every sales call",
+ steps: [
+ {
+ delayMs: 400,
+ part: {
+ type: "text",
+ text: "Great use case. Here's how I'll set that up.",
+ },
+ },
+ {
+ delayMs: 700,
+ part: {
+ type: "plan",
+ plan: {
+ goal: "Prep me before each external call on my calendar",
+ steps: [
+ {
+ description: "Spot upcoming external calls on my calendar",
+ blockName: "Google Calendar",
+ },
+ {
+ description: "Research the company and attendees",
+ blockName: "Web Search",
+ },
+ {
+ description: "Send a one-page brief 30 minutes before",
+ blockName: "Send Email",
+ },
+ ],
+ },
+ },
+ },
+ {
+ delayMs: 500,
+ part: {
+ type: "text",
+ text: "Want me to build and run it right now?",
+ },
+ },
+ ],
+ },
+ {
+ assistantMessageId: "callprep-asst-2",
+ userPrompt: "Sounds great, set it up",
+ steps: [
+ {
+ delayMs: 500,
+ part: {
+ type: "text",
+ text: "Building your agent — picking blocks, wiring them up, setting the trigger.",
+ },
+ },
+ {
+ delayMs: 900,
+ part: {
+ type: "agent",
+ agent: {
+ name: "Call Prep Briefer",
+ schedule: "30 min before each call",
+ blocks: ["Google Calendar", "Web Search", "Send Email"],
+ },
+ },
+ },
+ {
+ delayMs: RUN_DELAY_MS,
+ part: {
+ type: "text",
+ text: "Done — first run just finished. Here's what it produced:",
+ },
+ },
+ {
+ delayMs: 700,
+ part: {
+ type: "artifact",
+ artifact: {
+ caption: "what lands in your inbox",
+ title: "Call prep — Acme Corp · 2:00 PM",
+ bullets: [
+ "Series B, ~140 people — raised $30M in March",
+ "You're meeting Dana Patel, VP Ops — second call",
+ "Open thread: pricing objection on the per-seat model",
+ ],
+ },
+ },
+ },
+ {
+ delayMs: 600,
+ part: {
+ type: "text",
+ text: "Done — you'll get a brief like this before every call on your calendar. 🎉",
+ },
+ },
+ ],
+ },
+];
diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/script/competitorWatchScript.ts b/autogpt_platform/frontend/src/app/(public)/tour/chat/script/competitorWatchScript.ts
new file mode 100644
index 0000000000..dfa819f001
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/script/competitorWatchScript.ts
@@ -0,0 +1,99 @@
+import { RUN_DELAY_MS } from "./constants";
+import type { TourScript } from "./types";
+
+export const competitorWatchScript: TourScript = [
+ {
+ assistantMessageId: "competitor-asst-1",
+ userPrompt:
+ "Watch a competitor's pricing page and email me when the price changes",
+ steps: [
+ {
+ delayMs: 400,
+ part: {
+ type: "text",
+ text: "Great goal! Let me break that down into steps.",
+ },
+ },
+ {
+ delayMs: 700,
+ part: {
+ type: "plan",
+ plan: {
+ goal: "Watch a competitor's pricing page and email me on change",
+ steps: [
+ {
+ description: "Fetch the competitor pricing page on a schedule",
+ blockName: "Send Web Request",
+ },
+ {
+ description: "Detect changes vs. the last snapshot",
+ blockName: "Text Compare",
+ },
+ {
+ description: "Email me a summary when it changes",
+ blockName: "Send Email",
+ },
+ ],
+ },
+ },
+ },
+ {
+ delayMs: 500,
+ part: {
+ type: "text",
+ text: "Want me to build and run it right now?",
+ },
+ },
+ ],
+ },
+ {
+ assistantMessageId: "competitor-asst-2",
+ userPrompt: "Yes, build and run it for me",
+ steps: [
+ {
+ delayMs: 500,
+ part: {
+ type: "text",
+ text: "Building your agent — picking blocks, wiring them up, setting the schedule.",
+ },
+ },
+ {
+ delayMs: 900,
+ part: {
+ type: "agent",
+ agent: {
+ name: "Competitor Pricing Watcher",
+ schedule: "Daily · 8:00 AM",
+ blocks: ["Send Web Request", "Text Compare", "Send Email"],
+ },
+ },
+ },
+ {
+ delayMs: RUN_DELAY_MS,
+ part: {
+ type: "text",
+ text: "Done — first run just finished. Here's what it produced:",
+ },
+ },
+ {
+ delayMs: 700,
+ part: {
+ type: "artifact",
+ artifact: {
+ caption: "what lands in your inbox",
+ title: "Price change detected — Competitor Pro plan",
+ subtitle: "Pro tier changed on competitor.com/pricing at 8:02 AM:",
+ diff: { from: "$49/mo", to: "$59/mo", delta: "+20.4%" },
+ },
+ },
+ },
+ {
+ delayMs: 600,
+ part: {
+ type: "text",
+ text: "Your agent is live — it'll email you the moment that price moves again. 🎉",
+ },
+ },
+ ],
+ },
+];
diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/script/completionArtifacts.ts b/autogpt_platform/frontend/src/app/(public)/tour/chat/script/completionArtifacts.ts
new file mode 100644
index 0000000000..d619f2ffde
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/script/completionArtifacts.ts
@@ -0,0 +1,150 @@
+import type { TourCompletionArtifact } from "./types";
+
+/** Mock markdown files opened in the artifact panel when each scenario's
+ * demo finishes. Content mirrors the payoff artifact card of its script. */
+
+export const dailyBriefArtifact: TourCompletionArtifact = {
+ filename: "daily-brief-jul-2.md",
+ markdown: `# Your brief — Thu, Jul 2
+
+Good morning! Here's what needs your attention today.
+
+## 📅 Calendar
+
+| Time | Meeting | Status |
+| --- | --- | --- |
+| 9:30 AM | Roadmap review | ⚠️ Deck still unshared |
+| 1:00 PM | 1:1 with Jordan | Agenda ready |
+| 4:30 PM | Hiring sync | 2 candidates to review |
+
+## 📬 Inbox highlights
+
+- **Acme Corp** — 3 unread, contract redlines attached. Legal flagged §4.2.
+- **Jordan** — still waiting on your reply about the Q3 pricing proposal.
+- **Newsletter digest** — 12 low-priority threads archived automatically.
+
+## ✅ Suggested first moves
+
+1. Share the roadmap deck before the 9:30 review.
+2. Reply to Jordan — a draft is waiting in your outbox.
+3. Skim the Acme redlines before legal's EOD deadline.
+
+---
+
+_Generated by **Morning Brief** · runs weekdays at 7:00 AM_
+`,
+};
+
+export const callPrepArtifact: TourCompletionArtifact = {
+ filename: "call-prep-acme-corp.md",
+ markdown: `# Call prep — Acme Corp · 2:00 PM
+
+## 🏢 Company snapshot
+
+- Series B, ~140 people — raised **$30M in March** (led by Northline Ventures)
+- HQ in Austin, TX · B2B logistics software
+- Hiring spike in ops and data engineering over the last quarter
+
+## 👤 Who you're meeting
+
+**Dana Patel — VP Operations** (second call)
+
+- Joined Acme 14 months ago from Flexport
+- Owns the vendor-consolidation initiative your deal falls under
+- Prefers numbers up front, decks later
+
+## 🧵 Open threads
+
+- **Pricing objection** on the per-seat model — Dana asked for a usage-based
+ option after the last call.
+- Security questionnaire returned, two items pending from your side.
+
+## 💡 Suggested talking points
+
+1. Lead with the usage-based pricing pilot you can now offer.
+2. Confirm the security items ship this week.
+3. Ask about the Q3 vendor-consolidation timeline — budget closes soon.
+
+---
+
+_Generated by **Call Prep Assistant** · runs 30 min before external calls_
+`,
+};
+
+export const competitorWatchArtifact: TourCompletionArtifact = {
+ filename: "competitor-pricing-report.md",
+ markdown: `# Price change detected — Competitor Pro plan
+
+**competitor.com/pricing** · checked today at 8:02 AM
+
+## 📈 What changed
+
+| Plan | Before | After | Change |
+| --- | --- | --- | --- |
+| Starter | $19/mo | $19/mo | — |
+| **Pro** | **$49/mo** | **$59/mo** | **+20.4%** |
+| Enterprise | Custom | Custom | — |
+
+## 🔍 Details
+
+- The Pro tier copy now bundles "priority support", previously an add-on.
+- Annual billing discount dropped from 20% to 15%.
+- No change detected on the Starter or Enterprise tiers.
+
+## 🗒️ Snapshot diff
+
+\`\`\`diff
+- Pro — $49/mo, billed annually (save 20%)
++ Pro — $59/mo, billed annually (save 15%), priority support included
+\`\`\`
+
+## ✅ Suggested follow-ups
+
+1. Review your own Pro-tier positioning against the new price gap.
+2. Sales may want talking points for prospects comparing plans this week.
+
+---
+
+_Generated by **Competitor Pricing Watcher** · runs daily at 8:00 AM_
+`,
+};
+
+export const supportQueueArtifact: TourCompletionArtifact = {
+ filename: "support-queue-triage.md",
+ markdown: `# Queue triaged — 14 new tickets
+
+Overnight batch · processed in 40 seconds
+
+## ✍️ Drafted replies (9) — ready for review
+
+- #4821 "Can't export CSV" — known issue, workaround linked
+- #4822 "How do I add a teammate?" — steps + invite link drafted
+- #4824, #4826–#4831 — password resets and plan questions, standard replies
+
+## 💳 Routed to Sam (3)
+
+- #4823 — refund request, annual plan
+- #4825 — invoice shows wrong VAT number
+- #4832 — upgrade proration question
+
+## 🚨 Escalated to #support (2)
+
+> **EU outage reports** — two customers in Frankfurt region reporting 502s
+> since 5:40 AM. Status page updated, on-call paged.
+
+- #4833 — API timeouts (Frankfurt)
+- #4834 — dashboard unreachable (Frankfurt)
+
+## 📊 Queue health
+
+| Metric | Today | 7-day avg |
+| --- | --- | --- |
+| New tickets | 14 | 17 |
+| Auto-drafted | 64% | 58% |
+| First-response time | 4 min | 26 min |
+
+---
+
+_Generated by **Support Queue Triage** · runs every morning at 6:00 AM_
+`,
+};
diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/script/constants.ts b/autogpt_platform/frontend/src/app/(public)/tour/chat/script/constants.ts
new file mode 100644
index 0000000000..a034af66e0
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/script/constants.ts
@@ -0,0 +1,3 @@
+/** How long the agent card shows "Running" before the payoff artifact lands —
+ * long enough to feel like real work without dragging out the demo. */
+export const RUN_DELAY_MS = 5000;
diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/script/dailyBriefScript.ts b/autogpt_platform/frontend/src/app/(public)/tour/chat/script/dailyBriefScript.ts
new file mode 100644
index 0000000000..e2f3113755
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/script/dailyBriefScript.ts
@@ -0,0 +1,102 @@
+import { RUN_DELAY_MS } from "./constants";
+import type { TourScript } from "./types";
+
+export const dailyBriefScript: TourScript = [
+ {
+ assistantMessageId: "brief-asst-1",
+ userPrompt:
+ "Every morning, pull my unread emails and calendar into one brief",
+ steps: [
+ {
+ delayMs: 400,
+ part: {
+ type: "text",
+ text: "Love it. Here's how I'll set that up.",
+ },
+ },
+ {
+ delayMs: 700,
+ part: {
+ type: "plan",
+ plan: {
+ goal: "Send me one morning brief with my email and calendar",
+ steps: [
+ {
+ description: "Read unread emails and today's calendar",
+ blockName: "Gmail Read",
+ },
+ {
+ description: "Summarize everything into a short brief",
+ blockName: "AI Text Generator",
+ },
+ {
+ description: "Deliver it every morning at 7:30",
+ blockName: "Send Email",
+ },
+ ],
+ },
+ },
+ },
+ {
+ delayMs: 500,
+ part: {
+ type: "text",
+ text: "Want me to build and run it right now?",
+ },
+ },
+ ],
+ },
+ {
+ assistantMessageId: "brief-asst-2",
+ userPrompt: "Perfect, set it up",
+ steps: [
+ {
+ delayMs: 500,
+ part: {
+ type: "text",
+ text: "Building your agent — picking blocks, wiring them up, setting the schedule.",
+ },
+ },
+ {
+ delayMs: 900,
+ part: {
+ type: "agent",
+ agent: {
+ name: "Morning Brief",
+ schedule: "Daily · 7:30 AM",
+ blocks: ["Gmail Read", "AI Text Generator", "Send Email"],
+ },
+ },
+ },
+ {
+ delayMs: RUN_DELAY_MS,
+ part: {
+ type: "text",
+ text: "Done — first run just finished. Here's what it produced:",
+ },
+ },
+ {
+ delayMs: 700,
+ part: {
+ type: "artifact",
+ artifact: {
+ caption: "what lands in your inbox",
+ title: "Your brief — Thu, Jul 2",
+ bullets: [
+ "9:30 AM roadmap review — deck still unshared",
+ "3 unread from Acme Corp, contract redlines attached",
+ "Reply owed: Jordan on the Q3 pricing proposal",
+ ],
+ },
+ },
+ },
+ {
+ delayMs: 600,
+ part: {
+ type: "text",
+ text: "All set — a brief like this will be waiting in your inbox at 7:30 every morning. 🎉",
+ },
+ },
+ ],
+ },
+];
diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/script/emailSummaryScript.ts b/autogpt_platform/frontend/src/app/(public)/tour/chat/script/emailSummaryScript.ts
deleted file mode 100644
index b0949661df..0000000000
--- a/autogpt_platform/frontend/src/app/(public)/tour/chat/script/emailSummaryScript.ts
+++ /dev/null
@@ -1,145 +0,0 @@
-import type { TourScript } from "./types";
-
-export const emailSummaryScript: TourScript = [
- {
- assistantMessageId: "email-asst-1",
- userPrompt: "Summarize my unread emails every morning and send me a digest",
- steps: [
- {
- delayMs: 400,
- part: {
- type: "text",
- text: "Love it. Here's how I'll set that up.",
- state: "done",
- },
- },
- {
- delayMs: 700,
- part: {
- type: "tool-decompose_goal",
- toolCallId: "email-call-decompose",
- state: "output-available",
- input: {
- goal: "Summarize my unread emails every morning and send a digest",
- },
- output: {
- type: "task_decomposition",
- message: "Here's the plan (3 steps):",
- goal: "Summarize my unread emails every morning and send a digest",
- step_count: 3,
- steps: [
- {
- step_id: "step_1",
- description: "Read unread emails from the last 24 hours",
- action: "add_block",
- block_name: "Gmail Read",
- status: "completed",
- },
- {
- step_id: "step_2",
- description: "Summarize each thread into a short digest",
- action: "add_block",
- block_name: "AI Text Generator",
- status: "completed",
- },
- {
- step_id: "step_3",
- description: "Email me the digest every morning at 8am",
- action: "add_block",
- block_name: "Send Email",
- status: "completed",
- },
- ],
- },
- },
- },
- {
- delayMs: 500,
- part: {
- type: "text",
- text: "Want me to build the agent right now?",
- state: "done",
- },
- },
- ],
- },
- {
- assistantMessageId: "email-asst-2",
- userPrompt: "Perfect, set it up",
- steps: [
- {
- delayMs: 500,
- part: {
- type: "text",
- text: "Building your digest agent now.",
- state: "done",
- },
- },
- {
- delayMs: 900,
- part: {
- type: "tool-create_agent",
- toolCallId: "email-call-create",
- state: "output-available",
- input: { name: "Morning Email Digest" },
- output: {
- type: "agent_builder_preview",
- message: "Here's the agent I built for you:",
- agent_name: "Morning Email Digest",
- description:
- "Reads your unread emails, summarizes them, and emails you a digest every morning.",
- node_count: 4,
- link_count: 3,
- agent_json: { nodes: [], links: [] },
- },
- },
- },
- {
- delayMs: 700,
- part: {
- type: "tool-run_agent",
- toolCallId: "email-call-run",
- state: "output-available",
- input: { agent_id: "email-agent-1" },
- output: {
- type: "agent_output",
- message: "Your agent ran successfully.",
- agent_name: "Morning Email Digest",
- agent_id: "email-agent-1",
- execution: {
- execution_id: "email-exec-1",
- status: "COMPLETED",
- outputs: {
- summary:
- "Digest scheduled. You'll get your first summary tomorrow at 8am.",
- },
- },
- },
- },
- },
- {
- delayMs: 500,
- part: {
- type: "text",
- text: "All set! Your morning digest is scheduled and ready to go. 🎉",
- state: "done",
- },
- },
- {
- delayMs: 500,
- part: {
- type: "tool-create_agent",
- toolCallId: "email-call-saved",
- state: "output-available",
- input: { name: "Morning Email Digest" },
- output: {
- type: "agent_builder_saved",
- agent_name: "Morning Email Digest",
- library_agent_link: "/signup",
- agent_page_link: "/signup",
- },
- },
- },
- ],
- },
-];
diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/script/monitorPricingScript.ts b/autogpt_platform/frontend/src/app/(public)/tour/chat/script/monitorPricingScript.ts
deleted file mode 100644
index 479ad76f0d..0000000000
--- a/autogpt_platform/frontend/src/app/(public)/tour/chat/script/monitorPricingScript.ts
+++ /dev/null
@@ -1,146 +0,0 @@
-import type { TourScript } from "./types";
-
-export const monitorPricingScript: TourScript = [
- {
- assistantMessageId: "tour-asst-1",
- userPrompt:
- "Watch a competitor's pricing page and email me when the price changes",
- steps: [
- {
- delayMs: 400,
- part: {
- type: "text",
- text: "Great goal! Let me break that down into steps.",
- state: "done",
- },
- },
- {
- delayMs: 700,
- part: {
- type: "tool-decompose_goal",
- toolCallId: "tour-call-decompose",
- state: "output-available",
- input: {
- goal: "Watch a competitor's pricing page and email me on change",
- },
- output: {
- type: "task_decomposition",
- message: "Here's the plan (3 steps):",
- goal: "Watch a competitor's pricing page and email me on change",
- step_count: 3,
- steps: [
- {
- step_id: "step_1",
- description: "Fetch the competitor pricing page on a schedule",
- action: "add_block",
- block_name: "Send Web Request",
- status: "completed",
- },
- {
- step_id: "step_2",
- description: "Detect changes vs. the last snapshot",
- action: "add_block",
- block_name: "Text Compare",
- status: "completed",
- },
- {
- step_id: "step_3",
- description: "Email me a summary when it changes",
- action: "add_block",
- block_name: "Send Email",
- status: "completed",
- },
- ],
- },
- },
- },
- {
- delayMs: 500,
- part: {
- type: "text",
- text: "Want me to build the agent right now?",
- state: "done",
- },
- },
- ],
- },
- {
- assistantMessageId: "tour-asst-2",
- userPrompt: "Yes, build and run it for me",
- steps: [
- {
- delayMs: 500,
- part: {
- type: "text",
- text: "I'll build that agent for you now.",
- state: "done",
- },
- },
- {
- delayMs: 900,
- part: {
- type: "tool-create_agent",
- toolCallId: "tour-call-create",
- state: "output-available",
- input: { name: "Competitor Pricing Watcher" },
- output: {
- type: "agent_builder_preview",
- message: "Here's the agent I built for you:",
- agent_name: "Competitor Pricing Watcher",
- description:
- "Checks a competitor's pricing page on a schedule and emails you when it changes.",
- node_count: 4,
- link_count: 3,
- agent_json: { nodes: [], links: [] },
- },
- },
- },
- {
- delayMs: 700,
- part: {
- type: "tool-run_agent",
- toolCallId: "tour-call-run",
- state: "output-available",
- input: { agent_id: "tour-agent-1" },
- output: {
- type: "agent_output",
- message: "Your agent ran successfully.",
- agent_name: "Competitor Pricing Watcher",
- agent_id: "tour-agent-1",
- execution: {
- execution_id: "tour-exec-1",
- status: "COMPLETED",
- outputs: {
- summary:
- "No price change detected yet. You're all set, and I'll email you the moment it changes.",
- },
- },
- },
- },
- },
- {
- delayMs: 500,
- part: {
- type: "text",
- text: "Done! Your agent is live and will email you on any change. 🎉",
- state: "done",
- },
- },
- {
- delayMs: 500,
- part: {
- type: "tool-create_agent",
- toolCallId: "tour-call-saved",
- state: "output-available",
- input: { name: "Competitor Pricing Watcher" },
- output: {
- type: "agent_builder_saved",
- agent_name: "Competitor Pricing Watcher",
- library_agent_link: "/signup",
- agent_page_link: "/signup",
- },
- },
- },
- ],
- },
-];
diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/script/supportQueueScript.ts b/autogpt_platform/frontend/src/app/(public)/tour/chat/script/supportQueueScript.ts
new file mode 100644
index 0000000000..914e4bf3d7
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/script/supportQueueScript.ts
@@ -0,0 +1,102 @@
+import { RUN_DELAY_MS } from "./constants";
+import type { TourScript } from "./types";
+
+export const supportQueueScript: TourScript = [
+ {
+ assistantMessageId: "support-asst-1",
+ userPrompt:
+ "Triage new support tickets and draft replies for the common ones",
+ steps: [
+ {
+ delayMs: 400,
+ part: {
+ type: "text",
+ text: "On it. Here's how I'll keep your queue under control.",
+ },
+ },
+ {
+ delayMs: 700,
+ part: {
+ type: "plan",
+ plan: {
+ goal: "Triage the support queue and draft the easy replies",
+ steps: [
+ {
+ description: "Pull new tickets from the support inbox",
+ blockName: "Gmail Read",
+ },
+ {
+ description: "Classify urgency and draft a reply",
+ blockName: "AI Text Generator",
+ },
+ {
+ description: "Escalate urgent tickets to the team",
+ blockName: "Send Slack Message",
+ },
+ ],
+ },
+ },
+ },
+ {
+ delayMs: 500,
+ part: {
+ type: "text",
+ text: "Want me to build and run it right now?",
+ },
+ },
+ ],
+ },
+ {
+ assistantMessageId: "support-asst-2",
+ userPrompt: "Go ahead, set it up",
+ steps: [
+ {
+ delayMs: 500,
+ part: {
+ type: "text",
+ text: "Building your agent — picking blocks, wiring them up, setting the schedule.",
+ },
+ },
+ {
+ delayMs: 900,
+ part: {
+ type: "agent",
+ agent: {
+ name: "Support Queue Triage",
+ schedule: "Every 15 minutes",
+ blocks: ["Gmail Read", "AI Text Generator", "Send Slack Message"],
+ },
+ },
+ },
+ {
+ delayMs: RUN_DELAY_MS,
+ part: {
+ type: "text",
+ text: "Done — first run just finished. Here's what it produced:",
+ },
+ },
+ {
+ delayMs: 700,
+ part: {
+ type: "artifact",
+ artifact: {
+ caption: "what your team sees",
+ title: "Queue triaged — 14 new tickets",
+ bullets: [
+ "9 replies drafted and ready for your review",
+ "3 billing questions routed to Sam",
+ "2 urgent EU outage reports escalated to #support",
+ ],
+ },
+ },
+ },
+ {
+ delayMs: 600,
+ part: {
+ type: "text",
+ text: "Running every 15 minutes — your queue stays triaged while you work. 🎉",
+ },
+ },
+ ],
+ },
+];
diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/script/tourChats.ts b/autogpt_platform/frontend/src/app/(public)/tour/chat/script/tourChats.ts
deleted file mode 100644
index 339861ed3d..0000000000
--- a/autogpt_platform/frontend/src/app/(public)/tour/chat/script/tourChats.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import { emailSummaryScript } from "./emailSummaryScript";
-import { monitorPricingScript } from "./monitorPricingScript";
-import type { TourChat } from "./types";
-
-export const TOUR_SESSION_ID = "tour-demo-session";
-export const EMAIL_SESSION_ID = "tour-demo-2";
-
-export const tourChats: TourChat[] = [
- {
- id: TOUR_SESSION_ID,
- title: "Watch competitor pricing",
- updatedAt: "2026-06-30T10:05:00Z",
- script: monitorPricingScript,
- },
- {
- id: EMAIL_SESSION_ID,
- title: "Summarize my weekly emails",
- updatedAt: "2026-06-29T09:10:00Z",
- script: emailSummaryScript,
- },
-];
-
-export function getTourChat(id: string): TourChat {
- return tourChats.find((chat) => chat.id === id) ?? tourChats[0];
-}
-
-export const tourSessionIds = tourChats.map((chat) => chat.id);
diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/script/tourScenarios.ts b/autogpt_platform/frontend/src/app/(public)/tour/chat/script/tourScenarios.ts
new file mode 100644
index 0000000000..3c94bfc2fd
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/script/tourScenarios.ts
@@ -0,0 +1,58 @@
+import {
+ HeadsetIcon,
+ MagnifyingGlassIcon,
+ PhoneCallIcon,
+ SunIcon,
+} from "@phosphor-icons/react";
+import { callPrepScript } from "./callPrepScript";
+import {
+ callPrepArtifact,
+ competitorWatchArtifact,
+ dailyBriefArtifact,
+ supportQueueArtifact,
+} from "./completionArtifacts";
+import { competitorWatchScript } from "./competitorWatchScript";
+import { dailyBriefScript } from "./dailyBriefScript";
+import { supportQueueScript } from "./supportQueueScript";
+import type { TourScenario } from "./types";
+
+export const tourScenarios: TourScenario[] = [
+ {
+ id: "daily-brief",
+ label: "Daily brief",
+ icon: SunIcon,
+ script: dailyBriefScript,
+ completionArtifact: dailyBriefArtifact,
+ },
+ {
+ id: "call-prep",
+ label: "Call prep",
+ icon: PhoneCallIcon,
+ script: callPrepScript,
+ completionArtifact: callPrepArtifact,
+ },
+ {
+ id: "competitor-watch",
+ label: "Competitor watch",
+ icon: MagnifyingGlassIcon,
+ script: competitorWatchScript,
+ completionArtifact: competitorWatchArtifact,
+ },
+ {
+ id: "support-queue",
+ label: "Support queue",
+ icon: HeadsetIcon,
+ script: supportQueueScript,
+ completionArtifact: supportQueueArtifact,
+ },
+];
+
+export const DEFAULT_SCENARIO_ID = "competitor-watch";
+
+export function getTourScenario(id: string): TourScenario {
+ return (
+ tourScenarios.find((scenario) => scenario.id === id) ??
+ tourScenarios.find((scenario) => scenario.id === DEFAULT_SCENARIO_ID) ??
+ tourScenarios[0]
+ );
+}
diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/script/types.ts b/autogpt_platform/frontend/src/app/(public)/tour/chat/script/types.ts
index ea71ec0b2a..f5fd950797 100644
--- a/autogpt_platform/frontend/src/app/(public)/tour/chat/script/types.ts
+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/script/types.ts
@@ -1,7 +1,44 @@
-import type { UIMessage } from "ai";
+import type { Icon } from "@phosphor-icons/react";
+
+export interface TourPlanStep {
+ description: string;
+ blockName: string;
+}
+
+export interface TourPlan {
+ goal: string;
+ steps: TourPlanStep[];
+}
+
+export interface TourAgent {
+ name: string;
+ schedule: string;
+ blocks: string[];
+}
+
+export interface TourArtifact {
+ /** Completes the "Artifact · …" caption, e.g. "what lands in your inbox". */
+ caption: string;
+ title: string;
+ subtitle?: string;
+ bullets?: string[];
+ diff?: { from: string; to: string; delta: string };
+}
+
+export type TourPart =
+ | { type: "text"; text: string }
+ | { type: "plan"; plan: TourPlan }
+ | { type: "agent"; agent: TourAgent }
+ | { type: "artifact"; artifact: TourArtifact };
+
+export interface TourMessage {
+ id: string;
+ role: "user" | "assistant";
+ parts: TourPart[];
+}
export interface ScriptedPart {
- part: NonNullable<UIMessage["parts"]>[number];
+ part: TourPart;
delayMs: number;
}
@@ -15,9 +52,18 @@ export interface ScriptedTurn {
export type TourScript = ScriptedTurn[];
-export interface TourChat {
+/** Mock workspace file opened in the artifact panel when a scenario's
+ * script finishes — stands in for the real agent's output file. */
+export interface TourCompletionArtifact {
+ filename: string;
+ markdown: string;
+}
+
+export interface TourScenario {
id: string;
- title: string;
- updatedAt: string;
+ /** Chip label — kept in sync with the product page's scenario chips. */
+ label: string;
+ icon: Icon;
script: TourScript;
+ completionArtifact: TourCompletionArtifact;
}
diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/tourStore.ts b/autogpt_platform/frontend/src/app/(public)/tour/chat/tourStore.ts
index 1dddf0833e..1ba1f7278c 100644
--- a/autogpt_platform/frontend/src/app/(public)/tour/chat/tourStore.ts
+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/tourStore.ts
@@ -1,12 +1,12 @@
import { create } from "zustand";
-import { TOUR_SESSION_ID } from "./script/tourChats";
+import { DEFAULT_SCENARIO_ID } from "./script/tourScenarios";
interface TourState {
- activeSessionId: string;
- setActiveSession: (id: string) => void;
+ activeScenarioId: string;
+ setActiveScenario: (id: string) => void;
}
export const useTourStore = create<TourState>((set) => ({
- activeSessionId: TOUR_SESSION_ID,
- setActiveSession: (id) => set({ activeSessionId: id }),
+ activeScenarioId: DEFAULT_SCENARIO_ID,
+ setActiveScenario: (id) => set({ activeScenarioId: id }),
}));
diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/useTourBootstrap.ts b/autogpt_platform/frontend/src/app/(public)/tour/chat/useTourBootstrap.ts
deleted file mode 100644
index 3d6da63d27..0000000000
--- a/autogpt_platform/frontend/src/app/(public)/tour/chat/useTourBootstrap.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-"use client";
-
-import {
- getListWorkspaceFilesQueryKey,
- type listWorkspaceFilesResponse,
-} from "@/app/api/__generated__/endpoints/workspace/workspace";
-import type { ListFilesResponse } from "@/app/api/__generated__/models/listFilesResponse";
-import { useMountEffect } from "@/hooks/useMountEffect";
-import { useQueryClient } from "@tanstack/react-query";
-import { tourSessionIds } from "./script/tourChats";
-
-const emptyFiles: ListFilesResponse = { files: [], offset: 0, has_more: false };
-
-const emptyWorkspaceFilesResponse: listWorkspaceFilesResponse = {
- status: 200,
- data: emptyFiles,
- headers: new Headers(),
-};
-
-export function useTourBootstrap() {
- const queryClient = useQueryClient();
-
- useMountEffect(() => {
- for (const sessionId of tourSessionIds) {
- const key = getListWorkspaceFilesQueryKey({ session_id: sessionId });
- queryClient.setQueryData(key, emptyWorkspaceFilesResponse);
- queryClient.setQueryDefaults(key, {
- staleTime: Infinity,
- gcTime: Infinity,
- retry: false,
- refetchOnMount: false,
- refetchOnWindowFocus: false,
- refetchOnReconnect: false,
- });
- }
- });
-}
diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/useTourCopilot.ts b/autogpt_platform/frontend/src/app/(public)/tour/chat/useTourCopilot.ts
index 73545b7b0a..61c4196b01 100644
--- a/autogpt_platform/frontend/src/app/(public)/tour/chat/useTourCopilot.ts
+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/useTourCopilot.ts
@@ -1,31 +1,39 @@
"use client";
-import { useCopilotStreamStore } from "@/app/(platform)/copilot/copilotStreamStore";
import { useMountEffect } from "@/hooks/useMountEffect";
-import type { UIMessage } from "ai";
import { useRef, useState } from "react";
import { appendPartToLastMessage } from "./helpers";
-import type { TourScript } from "./script/types";
+import type { TourMessage, TourScript } from "./script/types";
-type TourStatus = "ready" | "submitted" | "streaming";
+type TourStatus = "ready" | "streaming";
+
+const TURN_SETTLE_MS = 300;
+/** Hold after the final part streams in before the demo flips to the upsell
+ * card — gives the visitor time to take in the payoff artifact. */
+const FINAL_TURN_SETTLE_MS = 3000;
interface Args {
sessionId: string;
script: TourScript;
onComplete: () => void;
+ onReset?: () => void;
}
-export function useTourCopilot({ sessionId, script, onComplete }: Args) {
- const [messages, setMessages] = useState<UIMessage[]>([]);
+export function useTourCopilot({
+ sessionId,
+ script,
+ onComplete,
+ onReset,
+}: Args) {
+ const [messages, setMessages] = useState<TourMessage[]>([]);
const [status, setStatus] = useState<TourStatus>("ready");
const stepIndex = useRef(0);
const timers = useRef<ReturnType<typeof setTimeout>[]>([]);
- const messagesRef = useRef<UIMessage[]>([]);
+ const messagesRef = useRef<TourMessage[]>([]);
- function commit(next: UIMessage[]) {
+ function commit(next: TourMessage[]) {
messagesRef.current = next;
setMessages(next);
- useCopilotStreamStore.getState().setMessageSnapshot(sessionId, next);
}
function clearTimers() {
@@ -42,7 +50,7 @@ export function useTourCopilot({ sessionId, script, onComplete }: Args) {
{
id: `${sessionId}-user-${stepIndex.current}`,
role: "user",
- parts: [{ type: "text", text, state: "done" }],
+ parts: [{ type: "text", text }],
},
{ id: turn.assistantMessageId, role: "assistant", parts: [] },
]);
@@ -58,12 +66,16 @@ export function useTourCopilot({ sessionId, script, onComplete }: Args) {
);
});
+ const isFinalTurn = stepIndex.current === script.length - 1;
timers.current.push(
- setTimeout(() => {
- setStatus("ready");
- stepIndex.current += 1;
- if (stepIndex.current >= script.length) onComplete();
- }, elapsed + 300),
+ setTimeout(
+ () => {
+ setStatus("ready");
+ stepIndex.current += 1;
+ if (stepIndex.current >= script.length) onComplete();
+ },
+ elapsed + (isFinalTurn ? FINAL_TURN_SETTLE_MS : TURN_SETTLE_MS),
+ ),
);
}
@@ -72,30 +84,20 @@ export function useTourCopilot({ sessionId, script, onComplete }: Args) {
stepIndex.current = 0;
commit([]);
setStatus("ready");
+ onReset?.();
}
- // Fresh slate when this chat mounts. TourChatHost is keyed by sessionId, so a
- // sidebar switch remounts this hook — clear any prior snapshot so the messages
- // reflect the newly-selected chat.
- useMountEffect(() => {
- useCopilotStreamStore.getState().setMessageSnapshot(sessionId, []);
- return clearTimers;
- });
+ useMountEffect(() => clearTimers);
const currentTurn = script[stepIndex.current];
return {
- sessionId,
messages,
- status,
- error: undefined as Error | undefined,
- turnStats: new Map(),
- queuedMessages: [] as string[],
onSend,
reset,
turnIndex: stepIndex.current,
currentUserPrompt: currentTurn?.userPrompt ?? null,
- isStreaming: status === "streaming" || status === "submitted",
+ isStreaming: status === "streaming",
isExhausted: stepIndex.current >= script.length,
};
}
diff --git a/autogpt_platform/frontend/src/services/feature-flags/use-get-flag.ts b/autogpt_platform/frontend/src/services/feature-flags/use-get-flag.ts
index a354fdc45e..f5a70bbf14 100644
--- a/autogpt_platform/frontend/src/services/feature-flags/use-get-flag.ts
+++ b/autogpt_platform/frontend/src/services/feature-flags/use-get-flag.ts
@@ -20,6 +20,7 @@ export enum Flag {
AUTOGPT_NEW_LAYOUT = "autogpt-new-layout",
CHAT_WORKSPACE_FILES = "chat-workspace-files",
CHAT_PINNING = "chat-pinning",
+ TOUR_APP_SHELL = "tour-app-shell",
TASK_PROGRESS_BAR = "task-progress-bar",
// Graphiti memory + dream-system gates. Mirror of the backend
// ``Flag`` enum in ``backend/util/feature_flag.py``. Frontend reads
@@ -53,6 +54,7 @@ const defaultFlags = {
[Flag.AUTOGPT_NEW_LAYOUT]: false,
[Flag.CHAT_WORKSPACE_FILES]: false,
[Flag.CHAT_PINNING]: false,
+ [Flag.TOUR_APP_SHELL]: false,
[Flag.TASK_PROGRESS_BAR]: false,
[Flag.GRAPHITI_MEMORY]: false,
[Flag.GRAPHITI_COMMUNITIES_ENABLED]: false,
@@ -110,6 +112,8 @@ function readEnvOverride(flag: Flag): string | undefined {
return process.env.NEXT_PUBLIC_FORCE_FLAG_CHAT_WORKSPACE_FILES;
case Flag.CHAT_PINNING:
return process.env.NEXT_PUBLIC_FORCE_FLAG_CHAT_PINNING;
+ case Flag.TOUR_APP_SHELL:
+ return process.env.NEXT_PUBLIC_FORCE_FLAG_TOUR_APP_SHELL;
case Flag.TASK_PROGRESS_BAR:
return process.env.NEXT_PUBLIC_FORCE_FLAG_TASK_PROGRESS_BAR;
case Flag.GRAPHITI_MEMORY: