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): inline expert chat and team page polish (#14400)
Abhimanyu Yadav9243edaf38d9
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/expert-threads.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/expert-threads.test.tsxindex 138a788d36..4a46314c02 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/expert-threads.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/expert-threads.test.tsx@@ -187,7 +187,11 @@ afterEach(() => {function ExpertSessionHarness() {const [expertId] = useQueryState("expertId", parseAsString);- const { createSession, sessionId } = useChatSession({ expertId });+ const [newThread] = useQueryState("new", parseAsString);+ const { createSession, sessionId } = useChatSession({+ expertId,+ adoptLatestExpertThread: !newThread,+ });return (<div><div data-testid="session-id">{sessionId ?? "none"}</div>@@ -313,6 +317,36 @@ describe("useChatSession — expert sessions", () => {expect(seenExpertFilters).toContain("expert-maria");});+ it("keeps a fresh thread addressed to the expert when the link carries new=1", async () => {+ let listedSessions = 0;+ server.use(+ http.get("*/api/chat/sessions", () => {+ listedSessions += 1;+ return HttpResponse.json({+ sessions: [+ makeSession({ id: "s-maria-latest", expert_id: "expert-maria" }),+ ],+ total: 1,+ });+ }),+ );+ const NewThreadWrapper = withNuqsTestingAdapter({+ searchParams: "?expertId=expert-maria&new=1",+ hasMemory: true,+ });++ render(+ <NewThreadWrapper>+ <ExpertSessionHarness />+ </NewThreadWrapper>,+ );++ expect(screen.getByTestId("expert-id").textContent).toBe("expert-maria");+ await new Promise((resolve) => setTimeout(resolve, 50));+ expect(screen.getByTestId("session-id").textContent).toBe("none");+ expect(listedSessions).toBe(0);+ });+it("stays on a fresh session after New Chat instead of re-adopting the expert's thread", async () => {server.use(http.get("*/api/chat/sessions", ({ request }) => {diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/useChatSession.ts b/autogpt_platform/frontend/src/app/(platform)/copilot/useChatSession.tsindex 3469711cb4..9ce9047a6e 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/useChatSession.ts+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/useChatSession.ts@@ -28,11 +28,15 @@ import { latestExpertSessionParams } from "./expertSessionQuery";interface UseChatSessionOptions {dryRun?: boolean;expertId?: string | null;+ /** Off = keep the fresh new-task state addressed to the expert instead of+ * jumping into their latest thread (``/copilot?expertId=…&new=1``). */+ adoptLatestExpertThread?: boolean;}export function useChatSession({dryRun = false,expertId = null,+ adoptLatestExpertThread = true,}: UseChatSessionOptions = {}) {const [sessionId, setSessionId] = useQueryState("sessionId", parseAsString);const queryClient = useQueryClient();@@ -113,6 +117,7 @@ export function useChatSession({// change, so a late adoption would post that message into the old thread.const sendStartedRef = useRef(false);const canAdoptExpertSession =+ adoptLatestExpertThread &&!!expertId &&!sessionId &&expertId === mountExpertIdRef.current &&diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/useCopilotPage.ts b/autogpt_platform/frontend/src/app/(platform)/copilot/useCopilotPage.tsindex c275764643..dcde272f4b 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/useCopilotPage.ts+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/useCopilotPage.ts@@ -67,6 +67,7 @@ export function useCopilotPage() {const isExpertsEnabled = useGetFlag(Flag.HIRE_EXPERTS);const isBrainDumpEnabled = useGetFlag(Flag.ONBOARDING_BRAIN_DUMP);const [expertIdParam] = useQueryState("expertId", parseAsString);+ const [newThreadParam] = useQueryState("new", parseAsString);const expertId = isExpertsEnabled ? expertIdParam : null;const [kickoffParam, setKickoffParam] = useQueryState("kickoff",@@ -141,7 +142,11 @@ export function useCopilotPage() {refetchSession,sessionDryRun,sessionChatStatus,- } = useChatSession({ dryRun: isDryRun, expertId });+ } = useChatSession({+ dryRun: isDryRun,+ expertId,+ adoptLatestExpertThread: !newThreadParam,+ });// An open session owns its identity: the URL param only describes who the// NEXT session will address, and it is absent whenever a thread is reacheddiff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/__tests__/integrations.test.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/__tests__/integrations.test.tsxindex d54c3624e4..bc3ab29baf 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/__tests__/integrations.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/__tests__/integrations.test.tsx@@ -411,6 +411,62 @@ describe("managing an expert's integrations", () => {expect(within(dialog).queryByText(/Let Maria use/)).toBeNull();});+ it("filters the connect dialog's services by connection state", async () => {+ server.use(+ getListExpertCredentialsMockHandler([]),+ http.get("*/api/integrations/providers", () =>+ HttpResponse.json([+ {+ name: "notion",+ description: "Docs and databases",+ supported_auth_types: ["api_key"],+ },+ {+ name: "slack",+ description: "Team chat",+ supported_auth_types: ["oauth2"],+ },+ ]),+ ),+ http.get("*/api/integrations/credentials", () =>+ HttpResponse.json([+ {+ id: "cred-slack",+ provider: "slack",+ type: "oauth2",+ title: "Team Slack",+ },+ ]),+ ),+ );++ render(<ExpertDetailPage />);++ await openIntegrationsTab();+ await userEvent.click(+ await screen.findByRole("button", { name: /Add integration/ }),+ );+ const dialog = await screen.findByRole("dialog");+ const list = await within(dialog).findByRole("list", { name: "Services" });+ expect(within(list).getByRole("button", { name: /Notion/ })).toBeDefined();+ expect(within(list).getByRole("button", { name: /Slack/ })).toBeDefined();++ const filters = within(dialog).getByRole("group", {+ name: "Filter services",+ });+ await userEvent.click(+ within(filters).getByRole("button", { name: "Connected" }),+ );+ expect(within(list).queryByRole("button", { name: /Notion/ })).toBeNull();+ expect(within(list).getByRole("button", { name: /Slack/ })).toBeDefined();++ await userEvent.click(+ within(filters).getByRole("button", { name: "Not connected" }),+ );+ expect(within(list).getByRole("button", { name: /Notion/ })).toBeDefined();+ expect(within(list).queryByRole("button", { name: /Slack/ })).toBeNull();+ });+it("grants only the credential the dialog created", async () => {const workLinkedin = {id: "cred-linkedin",diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/__tests__/main.test.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/__tests__/main.test.tsxindex 244bcf73f7..2c826a50cc 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/__tests__/main.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/__tests__/main.test.tsx@@ -12,6 +12,7 @@ import {getResumeExpertSchedulesMockHandler,getUpdateExpertSkillsMockHandler200,getUpdateExpertAvatarMockHandler,+ getUpdateExpertBudgetMockHandler,} from "@/app/api/__generated__/endpoints/experts/experts.msw";import {getGetV2GetLibraryAgentMockHandler200,@@ -27,7 +28,25 @@ import {} from "@/app/api/__generated__/endpoints/schedules/schedules.msw";import { Expert } from "@/app/api/__generated__/models/expert";import { GraphExecutionJobInfo } from "@/app/api/__generated__/models/graphExecutionJobInfo";+import {+ getGetV2GetSessionMockHandler200,+ getGetV2GetSessionResponseMock200,+ getGetV2ListSessionsMockHandler200,+ getPostV2CreateSessionMockHandler200,+ getPostV2CreateSessionResponseMock200,+} from "@/app/api/__generated__/endpoints/chat/chat.msw";+import { resetCopilotChatRegistry } from "@/app/(platform)/copilot/copilotChatRegistry";+import { TEST_BACKEND_BASE_URL } from "@/app/(platform)/copilot/__tests__/sse-helpers";+import {+ assistantTextChunks,+ streamSseResponse,+} from "@/tests/integrations/copilot-sse";import { getListCopilotSkillsMockHandler200 } from "@/app/api/__generated__/endpoints/skills/skills.msw";+import {+ getGetHomeDashboardMockHandler,+ getGetHomeDashboardResponseMock200,+} from "@/app/api/__generated__/endpoints/home/home.msw";+import { HomeAttentionItem } from "@/app/api/__generated__/models/homeAttentionItem";import { getGetV2ListStoreAgentsMockHandler200 } from "@/app/api/__generated__/endpoints/store/store.msw";import { server } from "@/mocks/mock-server";import {@@ -41,6 +60,26 @@ import { format, subDays } from "date-fns";import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";import ExpertDetailPage from "../page";+vi.mock("@/services/environment", async (importActual) => {+ const actual = await importActual<typeof import("@/services/environment")>();+ return {+ ...actual,+ environment: {+ ...actual.environment,+ getAGPTServerBaseUrl: () => TEST_BACKEND_BASE_URL,+ },+ };+});++vi.mock("@/app/(platform)/copilot/helpers", async (importActual) => {+ const actual =+ await importActual<typeof import("@/app/(platform)/copilot/helpers")>();+ return {+ ...actual,+ getCopilotAuthHeaders: async () => ({ "x-test-auth": "yes" }),+ };+});+vi.mock("framer-motion", async (importActual) => {const actual = await importActual<typeof import("framer-motion")>();return { ...actual, useReducedMotion: () => true };@@ -162,8 +201,9 @@ const mariaRuns: ExpertRun[] = [output_type: "table",output_key: "result",needs_review: false,- started_at: null,- ended_at: null,+ source: "scheduled",+ started_at: "2026-09-06T10:00:00Z" as unknown as Date,+ ended_at: "2026-09-06T10:01:12Z" as unknown as Date,link: "/library/agents/lib-1?activeTab=runs&activeItem=run-1",},{@@ -226,6 +266,9 @@ function libraryResponse(agents: LibraryAgent[]): LibraryAgentResponse {beforeEach(() => {server.use(+ getGetHomeDashboardMockHandler(+ getGetHomeDashboardResponseMock200({ attention: [] }),+ ),getGetExpertMockHandler(maria),getGetV1ListExecutionSchedulesForAUserMockHandler([mariaSchedule]),getListExpertRunsMockHandler([]),@@ -237,11 +280,34 @@ beforeEach(() => {});afterEach(() => {+ resetCopilotChatRegistry();window.localStorage.removeItem("team-workflows-view");setFlagStatusMock.mockReturnValue({ enabled: true, ready: true });pushMock.mockReset();});+function attentionItem(+ id: string,+ expertId: string,+ title: string,+): HomeAttentionItem {+ return {+ id,+ kind: "setup",+ priority: "normal",+ title,+ description: "Waiting on a connection.",+ why_it_matters: "Runs are blocked until this is done.",+ expert: {+ id: expertId,+ name: expertId === "expert-maria" ? "Maria" : "Other",+ role: "Marketing Strategist",+ avatar_url: null,+ },+ primary_action: { label: "Finish setup", href: `/team/${expertId}` },+ };+}+async function openTab(name: string) {await userEvent.click(await screen.findByRole("tab", { name }));}@@ -794,6 +860,7 @@ describe("ExpertDetailPage", () => {});test("filters work to runs that need review", async () => {+ const user = userEvent.setup();server.use(getListExpertRunsMockHandler(mariaRuns));render(<ExpertDetailPage />);@@ -801,7 +868,10 @@ describe("ExpertDetailPage", () => {await openTab("Work");await screen.findByRole("list", { name: "Expert work" });- fireEvent.click(screen.getByRole("button", { name: /Needs review \(1\)/ }));+ await user.click(screen.getByRole("button", { name: "Filter work" }));+ await user.click(+ await screen.findByRole("menuitemradio", { name: "Needs review" }),+ );const workList = screen.getByRole("list", { name: "Expert work" });expect(within(workList).queryByText("Weekly Report")).toBeNull();@@ -1072,4 +1142,252 @@ describe("ExpertDetailPage", () => {expect(within(row).getByText("From your library")).toBeDefined();expect(within(row).queryByText("Unknown")).toBeNull();});++ test("opens a fresh inline chat from the header Chat button", async () => {+ let listedSessions = 0;+ server.use(+ getGetV2ListSessionsMockHandler200(() => {+ listedSessions += 1;+ return { sessions: [], total: 0 };+ }),+ );+ const user = userEvent.setup();+ render(<ExpertDetailPage />);++ const chat = await screen.findByRole("button", { name: "Chat" });+ await user.click(chat);++ const panel = screen.getByRole("complementary", {+ name: "Chat with Maria",+ });+ expect(+ await within(panel).findByText("What can I do for you?"),+ ).toBeDefined();+ expect(within(panel).queryByRole("heading", { level: 2 })).toBeNull();+ expect(within(panel).getByPlaceholderText("Message Maria…")).toBeDefined();+ expect(+ within(panel)+ .getByRole("link", { name: "Open in Copilot" })+ .getAttribute("href"),+ ).toBe("/copilot?expertId=expert-maria&new=1");+ expect(listedSessions).toBe(0);++ await user.click(chat);+ await waitFor(() => {+ expect(+ screen.queryByRole("complementary", { name: "Chat with Maria" }),+ ).toBeNull();+ });+ });++ test("starts a new thread for the expert with the first message", async () => {+ const createBodies: unknown[] = [];+ const streamBodies: string[] = [];+ server.use(+ getGetV2ListSessionsMockHandler200({ sessions: [], total: 0 }),+ getPostV2CreateSessionMockHandler200(async (info) => {+ createBodies.push(await info.request.clone().json());+ return getPostV2CreateSessionResponseMock200({ id: "sess-new" });+ }),+ getGetV2GetSessionMockHandler200(+ getGetV2GetSessionResponseMock200({+ id: "sess-new",+ messages: [],+ active_stream: null,+ }),+ ),+ http.post(+ `${TEST_BACKEND_BASE_URL}/api/chat/sessions/sess-new/stream`,+ async ({ request }) => {+ streamBodies.push(await request.clone().text());+ return streamSseResponse(assistantTextChunks("On it."), {+ abortSignal: request.signal,+ });+ },+ ),+ );+ const user = userEvent.setup();+ render(<ExpertDetailPage />);++ await user.click(await screen.findByRole("button", { name: "Chat" }));+ const panel = screen.getByRole("complementary", {+ name: "Chat with Maria",+ });+ expect(+ await within(panel).findByText("What can I do for you?"),+ ).toBeDefined();+ expect(within(panel).queryByRole("heading", { level: 2 })).toBeNull();++ await user.type(+ screen.getByPlaceholderText("Message Maria…"),+ "Draft the Q4 plan{enter}",+ );++ await waitFor(() =>+ expect(createBodies).toEqual([{ expert_id: "expert-maria" }]),+ );+ await waitFor(() => expect(streamBodies.length).toBe(1));+ expect(streamBodies[0]).toContain("Draft the Q4 plan");+ expect(await screen.findByText("On it.")).toBeDefined();+ });++ test("asks about a workflow in the inline chat with the prompt sent first", async () => {+ const createBodies: unknown[] = [];+ const streamBodies: string[] = [];+ server.use(+ getPostV2CreateSessionMockHandler200(async (info) => {+ createBodies.push(await info.request.clone().json());+ return getPostV2CreateSessionResponseMock200({ id: "sess-ask" });+ }),+ getGetV2GetSessionMockHandler200(+ getGetV2GetSessionResponseMock200({+ id: "sess-ask",+ messages: [],+ active_stream: null,+ }),+ ),+ http.post(+ `${TEST_BACKEND_BASE_URL}/api/chat/sessions/sess-ask/stream`,+ async ({ request }) => {+ streamBodies.push(await request.clone().text());+ return streamSseResponse(+ assistantTextChunks("It plans a week of posts."),+ { abortSignal: request.signal },+ );+ },+ ),+ );+ const user = userEvent.setup();+ render(<ExpertDetailPage />);++ await openTab("Workflows");+ const [askFirst] = await screen.findAllByRole("button", {+ name: "Ask about this workflow",+ });+ await user.click(askFirst);++ const panel = await screen.findByRole("complementary", {+ name: "Chat with Maria",+ });+ await waitFor(() =>+ expect(createBodies).toEqual([{ expert_id: "expert-maria" }]),+ );+ await waitFor(() => expect(streamBodies.length).toBe(1));+ expect(streamBodies[0]).toContain("Tell me about the workflow");+ expect(streamBodies[0]).toContain("Content Calendar");+ expect(+ await within(panel).findByText("It plans a week of posts."),+ ).toBeDefined();+ });++ test("edits the weekly budget from the pencil next to the title", async () => {+ const bodies: unknown[] = [];+ server.use(+ getUpdateExpertBudgetMockHandler(async ({ request }) => {+ bodies.push(await request.clone().json());+ return { ...maria, weekly_budget: 2500 };+ }),+ );+ const user = userEvent.setup();+ render(<ExpertDetailPage />);++ await user.click(+ await screen.findByRole("button", { name: "Edit budget" }),+ );+ const dialog = screen.getByRole("dialog", { name: "Weekly budget" });+ const input = within(dialog).getByRole("textbox", {+ name: "Weekly budget",+ });+ await user.clear(input);+ await user.type(input, "25");+ await user.click(+ within(dialog).getByRole("button", { name: "Save budget" }),+ );++ await waitFor(() => expect(bodies).toEqual([{ weekly_budget: 2500 }]));+ await waitFor(() =>+ expect(+ screen.queryByRole("dialog", { name: "Weekly budget" }),+ ).toBeNull(),+ );+ });++ test("shows how and when a run happened on the Work tab", async () => {+ server.use(getListExpertRunsMockHandler(mariaRuns));+ render(<ExpertDetailPage />);++ await openTab("Work");+ const [scheduledMeta] = await screen.findAllByTestId("expert-run-meta");+ expect(scheduledMeta.textContent).toContain("Scheduled");+ expect(scheduledMeta.textContent).toContain("ago");+ expect(scheduledMeta.textContent).toContain("1m 12s");+ expect(screen.getAllByTestId("expert-run-meta")).toHaveLength(1);+ });++ test("opening the chat closes the Soul panel and vice versa", async () => {+ server.use(getGetV2ListSessionsMockHandler200({ sessions: [], total: 0 }));+ const user = userEvent.setup();+ render(<ExpertDetailPage />);++ await user.click(await screen.findByRole("button", { name: "Edit Soul" }));+ expect(+ screen.getByRole("complementary", { name: "Maria's Soul" }),+ ).toBeDefined();++ await user.click(screen.getByRole("button", { name: "Chat" }));+ expect(+ screen.getByRole("complementary", { name: "Chat with Maria" }),+ ).toBeDefined();+ await waitFor(() => {+ expect(+ screen.queryByRole("complementary", { name: "Maria's Soul" }),+ ).toBeNull();+ });++ await user.click(screen.getByRole("button", { name: "Edit Soul" }));+ expect(+ screen.getByRole("complementary", { name: "Maria's Soul" }),+ ).toBeDefined();+ await waitFor(() => {+ expect(+ screen.queryByRole("complementary", { name: "Chat with Maria" }),+ ).toBeNull();+ });+ });++ test("surfaces only this expert's attention items above the tabs", async () => {+ server.use(+ getGetHomeDashboardMockHandler(+ getGetHomeDashboardResponseMock200({+ attention: [+ attentionItem("att-1", "expert-maria", "Connect your calendar"),+ attentionItem("att-2", "expert-other", "Approve the budget"),+ ],+ }),+ ),+ );++ render(<ExpertDetailPage />);++ const section = await screen.findByRole("region", { name: "Needs you" });+ expect(within(section).getByText("Connect your calendar")).toBeDefined();+ expect(within(section).queryByText("Approve the budget")).toBeNull();+ expect(+ within(section).getByRole("status", {+ name: "1 item needs your attention",+ }),+ ).toBeDefined();+ expect(+ within(section)+ .getByRole("link", { name: "Finish setup" })+ .getAttribute("href"),+ ).toBe("/team/expert-maria");+ });++ test("hides the Needs you block when nothing is waiting on the user", async () => {+ render(<ExpertDetailPage />);++ expect(await screen.findByRole("heading", { name: "Maria" })).toBeDefined();+ expect(screen.queryByRole("region", { name: "Needs you" })).toBeNull();+ });});diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/AddSkillDialog.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/AddSkillDialog.tsxindex a3a1b22ea9..a818213e42 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/AddSkillDialog.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/AddSkillDialog.tsx@@ -67,6 +67,7 @@ export function AddSkillDialog({return (<Dialog+ variant="compact"controlled={{isOpen: open,set: (next) => {@@ -78,27 +79,20 @@ export function AddSkillDialog({><Dialog.Content><div className="flex flex-col gap-3">- <Text variant="small" className="text-sm !text-zinc-500">+ <Text variant="body" tone="muted">Skills are reusable instructions this expert follows for a specificjob. Pick one from your library or install one from the marketplace.</Text><TabsLine+ variant="compact"value={source}onValueChange={(next) => onSourceChange(next as Source)}>- <TabsLineList flush indicatorClassName="bg-zinc-900">- <TabsLineTrigger- value="library"- className="gap-1.5 data-[state=active]:text-zinc-900"- >- <Icon icon={BookOpen01Icon} size={14} />+ <TabsLineList>+ <TabsLineTrigger value="library" icon={BookOpen01Icon}>Library</TabsLineTrigger>- <TabsLineTrigger- value="marketplace"- className="gap-1.5 data-[state=active]:text-zinc-900"- >- <Icon icon={Store01Icon} size={14} />+ <TabsLineTrigger value="marketplace" icon={Store01Icon}>Marketplace</TabsLineTrigger></TabsLineList>@@ -113,11 +107,11 @@ export function AddSkillDialog({placeholder="Search your library"/>{isLoading ? (- <Text variant="small" className="text-zinc-500">+ <Text variant="small" tone="muted">Loading your skills…</Text>) : visible.length === 0 ? (- <Text variant="small" className="text-zinc-500">+ <Text variant="small" tone="muted">{skills.length === 0? "Every library skill is already on this expert.": "No skills match."}@@ -140,11 +134,15 @@ export function AddSkillDialog({))}</ul>)}- <NextLink- href="/library/skills"- className="text-sm text-zinc-500 underline underline-offset-2"- >- Upload a new skill in your library+ <NextLink href="/library/skills">+ <Text+ variant="body"+ as="span"+ tone="muted"+ className="underline underline-offset-2"+ >+ Upload a new skill in your library+ </Text></NextLink></>) : (@@ -156,11 +154,11 @@ export function AddSkillDialog({placeholder="Search the marketplace"/>{isMarketplaceLoading ? (- <Text variant="small" className="text-zinc-500">+ <Text variant="small" tone="muted">Searching the marketplace…</Text>) : marketplaceSkills.length === 0 ? (- <Text variant="small" className="text-zinc-500">+ <Text variant="small" tone="muted">No marketplace skills match.</Text>) : (@@ -184,7 +182,7 @@ export function AddSkillDialog({</>)}<div className="flex justify-end pt-1">- <Button variant="secondary" size="small" onClick={onClose}>+ <Button variant="secondary" size="xs" onClick={onClose}>Cancel</Button></div>@@ -210,22 +208,27 @@ function SkillOption({onAdd,}: OptionProps) {return (- <li className="flex items-center gap-3 rounded-2xl border border-zinc-200 px-4 py-3">+ <li className="flex items-center gap-3 rounded-lg border border-zinc-200 px-3 py-2.5"><Icon icon={icon} size={18} className="shrink-0 text-zinc-500" /><span className="min-w-0 flex-1">- <span className="block truncate text-sm font-medium text-zinc-900">+ <Text+ variant="body-medium"+ as="span"+ tone="primary"+ className="block truncate"+ >{name}- </span>- <span className="block truncate text-xs text-zinc-500">+ </Text>+ <Text variant="small" as="span" tone="muted" className="block truncate">{description}- </span>+ </Text></span><Buttonvariant="secondary"- size="small"+ size="xs"disabled={disabled}onClick={onAdd}- leftIcon={<Icon icon={PlusSignIcon} size={14} />}+ leadingIcon={PlusSignIcon}>Add</Button>diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/CreateScheduleDialog.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/CreateScheduleDialog.tsxindex 201ba689d1..cce5a5200c 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/CreateScheduleDialog.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/CreateScheduleDialog.tsx@@ -31,6 +31,7 @@ export function CreateScheduleDialog({return (<Dialog+ variant="compact"controlled={{isOpen: open,set: (next) => {@@ -43,7 +44,7 @@ export function CreateScheduleDialog({<Dialog.Content><div className="flex flex-col">{schedulable.length === 0 ? (- <Text variant="body" className="text-zinc-600">+ <Text variant="body" tone="secondary">Install a workflow first, then schedule it here.</Text>) : (@@ -63,7 +64,7 @@ export function CreateScheduleDialog({</ul>)}<div className="flex justify-end pt-1">- <Button variant="secondary" size="small" onClick={onClose}>+ <Button variant="secondary" size="xs" onClick={onClose}>Cancel</Button></div>@@ -96,13 +97,23 @@ function ScheduleWorkflowRow({ workflow, onScheduleCreated }: RowProps) {className="shrink-0 text-zinc-500"/><span className="min-w-0 flex-1">- <span className="block truncate text-sm font-medium text-zinc-900">+ <Text+ variant="body-medium"+ as="span"+ tone="primary"+ className="block truncate"+ >{name}- </span>+ </Text>{workflow.description ? (- <span className="block truncate text-xs text-zinc-500">+ <Text+ variant="small"+ as="span"+ tone="muted"+ className="block truncate"+ >{workflow.description}- </span>+ </Text>) : null}</span><Icondiff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/EditBudgetDialog/EditBudgetDialog.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/EditBudgetDialog/EditBudgetDialog.tsxnew file mode 100644index 0000000000..147de23acc--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/EditBudgetDialog/EditBudgetDialog.tsx@@ -0,0 +1,79 @@+"use client";++import { Expert } from "@/app/api/__generated__/models/expert";+import { Button } from "@/components/atoms/Button/Button";+import { Input } from "@/components/atoms/Input/Input";+import { Text } from "@/components/atoms/Text/Text";+import { Dialog } from "@/components/molecules/Dialog/Dialog";+import { useEditBudgetDialog } from "./useEditBudgetDialog";++interface Props {+ expert: Expert;+ open: boolean;+ onClose: () => void;+}++export function EditBudgetDialog({ expert, open, onClose }: Props) {+ const { value, setValue, isInvalid, isPending, save } = useEditBudgetDialog({+ expert,+ open,+ onClose,+ });++ return (+ <Dialog+ variant="compact"+ title="Weekly budget"+ styling={{ maxWidth: "24rem" }}+ controlled={{+ isOpen: open,+ set: (next) => {+ if (!next) onClose();+ },+ }}+ >+ <Dialog.Content>+ <form onSubmit={save} className="flex flex-col gap-4 px-1">+ <div className="flex flex-col gap-1.5">+ <Input+ id="expert-weekly-budget"+ size="small"+ label="Weekly budget"+ labelVariant="small-medium"+ placeholder="e.g. 25"+ value={value}+ error={+ isInvalid ? "Enter a dollar amount like 25 or 12.50" : undefined+ }+ onChange={(event) => setValue(event.target.value)}+ wrapperClassName="!mb-0"+ />+ <Text variant="small" tone="muted">+ What {expert.name} may spend each week, in dollars. Leave empty+ for the default, or enter 0 to remove the cap.+ </Text>+ </div>+ <div className="flex justify-end gap-2">+ <Button+ size="xs"+ type="button"+ variant="secondary"+ onClick={onClose}+ >+ Cancel+ </Button>+ <Button+ size="xs"+ type="submit"+ variant="primary"+ disabled={isInvalid}+ loading={isPending}+ >+ Save budget+ </Button>+ </div>+ </form>+ </Dialog.Content>+ </Dialog>+ );+}diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/EditBudgetDialog/useEditBudgetDialog.ts b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/EditBudgetDialog/useEditBudgetDialog.tsnew file mode 100644index 0000000000..14eb4f3530--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/EditBudgetDialog/useEditBudgetDialog.ts@@ -0,0 +1,67 @@+import {+ getGetExpertQueryKey,+ getListExpertsQueryKey,+ useUpdateExpertBudget,+} from "@/app/api/__generated__/endpoints/experts/experts";+import { Expert } from "@/app/api/__generated__/models/expert";+import { toast } from "@/components/molecules/Toast/use-toast";+import { CREDITS_PER_USD, parseUsdToCredits } from "@/lib/credits";+import { useQueryClient } from "@tanstack/react-query";+import { FormEvent, useEffect, useState } from "react";++export const WEEKLY_BUDGET_MAX_CREDITS = 1_000_000;++interface Args {+ expert: Expert;+ open: boolean;+ onClose: () => void;+}++function toUsdInput(credits: number | null | undefined) {+ if (credits == null) return "";+ const dollars = credits / CREDITS_PER_USD;+ return Number.isInteger(dollars) ? String(dollars) : dollars.toFixed(2);+}++export function useEditBudgetDialog({ expert, open, onClose }: Args) {+ const queryClient = useQueryClient();+ const [value, setValue] = useState(() => toUsdInput(expert.weekly_budget));++ useEffect(() => {+ if (open) setValue(toUsdInput(expert.weekly_budget));+ }, [open, expert.weekly_budget]);++ const trimmed = value.trim();+ const credits = trimmed+ ? parseUsdToCredits(trimmed, WEEKLY_BUDGET_MAX_CREDITS)+ : null;+ const isInvalid = trimmed.length > 0 && credits === null;++ const { mutate, isPending } = useUpdateExpertBudget({+ mutation: {+ onSuccess: () => {+ queryClient.invalidateQueries({+ queryKey: getGetExpertQueryKey(expert.id),+ });+ queryClient.invalidateQueries({ queryKey: getListExpertsQueryKey() });+ toast({ title: "Budget updated" });+ onClose();+ },+ onError: () => {+ toast({+ title: "Could not update the budget",+ description: "Please try again.",+ variant: "destructive",+ });+ },+ },+ });++ function save(event: FormEvent) {+ event.preventDefault();+ if (isInvalid || isPending) return;+ mutate({ expertId: expert.id, data: { weekly_budget: credits } });+ }++ return { value, setValue, isInvalid, isPending, save };+}diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertAboutSection.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertAboutSection.tsxindex 6f09c09354..35266f133d 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertAboutSection.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertAboutSection.tsx@@ -1,5 +1,7 @@"use client";+import { Text } from "@/components/atoms/Text/Text";+interface Props {bio: string | null;identity: string;@@ -15,11 +17,8 @@ export function ExpertAboutSection({}: Props) {return (<section className="space-y-5">- {bio ? (- <p className="whitespace-pre-line text-xs text-zinc-600">{bio}</p>- ) : null}-<dl className="space-y-4">+ <ProfileEntry label="Bio" value={bio} /><ProfileEntry label="Identity" value={identity} /><ProfileEntry label="Voice" value={voicePreferences} /><ProfileEntry label="Boundaries" value={boundaries} />@@ -36,10 +35,17 @@ interface ProfileEntryProps {function ProfileEntry({ label, value }: ProfileEntryProps) {return (<div>- <dt className="text-sm font-medium text-zinc-900">{label}</dt>- <dd className="mt-1 whitespace-pre-line text-sm text-zinc-600">+ <Text variant="body-medium" as="dt" tone="primary">+ {label}+ </Text>+ <Text+ variant="body"+ as="dd"+ tone="secondary"+ className="mt-1 whitespace-pre-line"+ >{value || "Not set yet."}- </dd>+ </Text></div>);}diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertBudgetSection.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertBudgetSection.tsxindex b7d8cd1fa5..5fc9bb2995 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertBudgetSection.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertBudgetSection.tsx@@ -1,8 +1,14 @@+"use client";+import { Expert } from "@/app/api/__generated__/models/expert";+import { Button } from "@/components/atoms/Button/Button";import { Text } from "@/components/atoms/Text/Text";import { creditsToUsdLabel } from "@/lib/credits";+import { PencilEdit02Icon } from "@hugeicons/core-free-icons";+import { useState } from "react";import { SpendMeter } from "../../components/ExpertTeamCard/components/SpendMeter";import { getWeeklySpend } from "../../helpers";+import { EditBudgetDialog } from "./EditBudgetDialog/EditBudgetDialog";interface Props {expert: Expert;@@ -10,20 +16,32 @@ interface Props {export function ExpertBudgetSection({ expert }: Props) {const weeklySpend = getWeeklySpend(expert);+ const [isEditOpen, setIsEditOpen] = useState(false);return (<sectionaria-label={`${expert.name} budget`}className="flex w-full flex-col gap-1.5 lg:w-1/2">- <div className="flex items-baseline justify-between gap-2">- <Text variant="body-medium" className="text-sm text-zinc-700">- Budget- </Text>+ <div className="flex items-center justify-between gap-2">+ <div className="flex items-center gap-1">+ <Text variant="body-medium" tone="secondary">+ Budget+ </Text>+ <Button+ type="button"+ variant="ghost"+ size="icon-xs"+ leadingIcon={PencilEdit02Icon}+ aria-label="Edit budget"+ onClick={() => setIsEditOpen(true)}+ />+ </div><Textvariant="body-medium"+ tone="secondary"unmask={false}- className="text-sm tabular-nums text-zinc-700"+ className="tabular-nums">{weeklySpend? `${creditsToUsdLabel(weeklySpend.spent)} / ${creditsToUsdLabel(weeklySpend.budget)}`@@ -36,6 +54,11 @@ export function ExpertBudgetSection({ expert }: Props) {color={expert.color}muted={!weeklySpend}/>+ <EditBudgetDialog+ expert={expert}+ open={isEditOpen}+ onClose={() => setIsEditOpen(false)}+ /></section>);}diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertDetailHeader.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertDetailHeader.tsxindex 8755db5489..a97932b465 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertDetailHeader.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertDetailHeader.tsx@@ -3,19 +3,20 @@import { Expert } from "@/app/api/__generated__/models/expert";import { Button } from "@/components/atoms/Button/Button";import { Icon } from "@/components/atoms/Icon/Icon";+import { Text } from "@/components/atoms/Text/Text";import { cn } from "@/lib/utils";-import { PencilEdit02Icon } from "@hugeicons/core-free-icons";+import { BubbleChatIcon, PencilEdit02Icon } from "@hugeicons/core-free-icons";import { getRaisedExpertAccent } from "@/app/(platform)/marketplace/components/ExpertsSection/helpers";import { ExpertCover } from "../../components/ExpertTeamCard/components/ExpertCover";import { ExpertAvatarButton } from "./ExpertAvatarButton/ExpertAvatarButton";-import { ACTION_BUTTON_CLASS } from "@/app/(platform)/team/helpers";interface Props {expert: Expert;onEditSoul: () => void;+ onChat: () => void;}-export function ExpertDetailHeader({ expert, onEditSoul }: Props) {+export function ExpertDetailHeader({ expert, onEditSoul, onChat }: Props) {const accent = getRaisedExpertAccent(expert.role, expert.color);return (@@ -31,36 +32,33 @@ export function ExpertDetailHeader({ expert, onEditSoul }: Props) {<h1 className="text-2xl font-semibold tracking-[-0.02em] text-zinc-900">{expert.name}</h1>- <span+ <Text+ variant="body-medium"+ as="span"className={cn(- "inline-flex items-center gap-1.5 rounded-md px-2.5 py-0.5 text-sm font-medium",+ "inline-flex items-center gap-1.5 rounded-md px-2.5 py-0.5",accent.pill,)}><Icon icon={accent.roleIcon} size={14} />{expert.role}- </span>+ </Text></div>- {expert.tagline ? (- <p className="mt-1 text-sm text-zinc-500">{expert.tagline}</p>- ) : null}</div><div className="flex shrink-0 items-center gap-2"><Buttonvariant="secondary"- size="small"- className={ACTION_BUTTON_CLASS}- leftIcon={<Icon icon={PencilEdit02Icon} size={14} />}+ size="xs"+ leadingIcon={PencilEdit02Icon}onClick={onEditSoul}>Edit Soul</Button><Button- as="NextLink"- href={`/copilot?expertId=${expert.id}`}variant="primary"- size="small"- className={ACTION_BUTTON_CLASS}+ size="xs"+ leadingIcon={BubbleChatIcon}+ onClick={onChat}>Chat</Button>diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertIntegrationsSection/ExpertConnectServiceDialog.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertIntegrationsSection/ExpertConnectServiceDialog.tsxindex 150b93e5c7..2ac9ab4e7c 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertIntegrationsSection/ExpertConnectServiceDialog.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertIntegrationsSection/ExpertConnectServiceDialog.tsx@@ -16,7 +16,10 @@ import { Plug01Icon } from "@hugeicons/core-free-icons";import { AnimatePresence, motion, useReducedMotion } from "framer-motion";import { useBottomScrollShadow } from "../../../components/SoulDrawer/useBottomScrollShadow";import { useFitListToDialog } from "../useFitListToDialog";-import { useExpertConnectServiceDialog } from "./useExpertConnectServiceDialog";+import {+ SERVICE_FILTERS,+ useExpertConnectServiceDialog,+} from "./useExpertConnectServiceDialog";const STEP_TRANSITION = { duration: 0.15, ease: [0, 0, 0.2, 1] as const };const HEIGHT_TRANSITION = { duration: 0.2, ease: [0, 0, 0.2, 1] as const };@@ -52,6 +55,8 @@ export function ExpertConnectServiceDialog({const {query,setQuery,+ filter,+ setFilter,providers,isLoading,isError,@@ -79,6 +84,7 @@ export function ExpertConnectServiceDialog({return (<Dialog+ variant="compact"styling={{ maxWidth: "40rem", maxHeight: "60vh" }}controlled={{isOpen: open,@@ -127,13 +133,10 @@ export function ExpertConnectServiceDialog({className="flex flex-col gap-4"><div className="flex flex-col gap-1">- <Text- variant="h3"- className="!text-[1.25rem] text-zinc-900"- >+ <Text variant="lead-medium" as="h3" tone="primary">Connect a service for {expertName}</Text>- <Text variant="small" className="!text-zinc-500">+ <Text variant="small" tone="muted">Pick a service to connect. {expertName} will be able touse it on your behalf.</Text>@@ -156,11 +159,30 @@ export function ExpertConnectServiceDialog({) : (<div className="flex flex-col gap-3"><SearchInput+ size="small"value={query}onChange={setQuery}placeholder="Search services..."aria-label="Search services"/>+ <div+ role="group"+ aria-label="Filter services"+ className="flex items-center gap-1"+ >+ {SERVICE_FILTERS.map((option) => (+ <Button+ key={option.value}+ type="button"+ variant="toggle"+ size="xs"+ aria-pressed={filter === option.value}+ onClick={() => setFilter(option.value)}+ >+ {option.label}+ </Button>+ ))}+ </div>{providers.length === 0 ? (<div className="flex flex-col items-center justify-center gap-2 rounded-2xl border border-dashed border-[#DADADC] py-8 text-center"><Icon@@ -168,10 +190,12 @@ export function ExpertConnectServiceDialog({size={24}className="text-[#83838C]"/>- <Text variant="body" className="text-[#505057]">+ <Text variant="body" tone="secondary">{query.trim()? `No services match "${query.trim()}"`- : "No services available."}+ : filter === "connected"+ ? "No services connected yet."+ : "No services available."}</Text></div>) : (@@ -185,6 +209,7 @@ export function ExpertConnectServiceDialog({<li key={provider.id}><ConnectProviderRowprovider={provider}+ className="rounded-lg"onSelect={handleSelect}isConnected={connectedProviders.has(provider.id,@@ -217,7 +242,7 @@ export function ExpertConnectServiceDialog({<><Buttonvariant="secondary"- size="small"+ size="xs"onClick={handleBackToList}>Back@@ -225,7 +250,7 @@ export function ExpertConnectServiceDialog({{showContinue ? (<Buttonvariant="primary"- size="small"+ size="xs"disabled={isContinueDisabled}loading={isConnecting}onClick={handleContinue}@@ -235,7 +260,7 @@ export function ExpertConnectServiceDialog({) : null}</>) : (- <Button variant="secondary" size="small" onClick={onClose}>+ <Button variant="secondary" size="xs" onClick={onClose}>Cancel</Button>)}diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertIntegrationsSection/ExpertIntegrationGroups.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertIntegrationsSection/ExpertIntegrationGroups.tsxindex 40fc3b1bb0..9e9ffa447c 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertIntegrationsSection/ExpertIntegrationGroups.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertIntegrationsSection/ExpertIntegrationGroups.tsx@@ -2,6 +2,7 @@import { ExpertCredentialRef } from "@/app/api/__generated__/models/expertCredentialRef";import { Icon } from "@/components/atoms/Icon/Icon";+import { Text } from "@/components/atoms/Text/Text";import {formatCredentialName,formatCredentialSource,@@ -95,7 +96,7 @@ export function ExpertIntegrationGroups({return (<motion.div- className="flex flex-col gap-3"+ className="flex flex-col gap-2.5"variants={CONTAINER_VARIANTS}initial="hidden"animate="show"@@ -109,27 +110,32 @@ export function ExpertIntegrationGroups({type="single"collapsibledefaultValue={group.id}- className="w-full overflow-hidden rounded-xl border border-[#DADADC] bg-white"+ className="w-full overflow-hidden rounded-lg border border-zinc-200 bg-white"><AccordionItem value={group.id} className="border-b-0">- <AccordionTrigger className="px-3 py-3 pr-5 hover:no-underline [&>svg]:text-[#1F1F20]">- <div className="flex items-center gap-3">+ <AccordionTrigger className="px-3 py-2.5 pr-4 hover:no-underline [&>svg]:size-4 [&>svg]:text-zinc-500">+ <div className="flex items-center gap-2.5"><IntegrationLogoprovider={group.id}alt={`${group.name} logo`}- size={24}+ size={20}className="rounded-full bg-white"/>- <span className="text-[16px] font-medium leading-[26px] tracking-[-0.08px] text-black">+ <Text variant="body-medium" as="span" tone="primary">{group.name}- </span>- <span className="inline-flex items-center justify-center rounded-md bg-[#EFF1F4] px-2 py-[2px] text-[14px] font-medium leading-[22px] text-black">+ </Text>+ <Text+ variant="small-medium"+ as="span"+ tone="secondary"+ className="inline-flex items-center justify-center rounded-md bg-zinc-100 px-1.5 py-0.5 tabular-nums"+ >{group.integrations.length}- </span>+ </Text></div></AccordionTrigger><AccordionContent className="px-0 pb-0 pt-0">- <div className="flex flex-col divide-y divide-[#DADADC] border-t border-[#DADADC]">+ <div className="flex flex-col divide-y divide-zinc-100 border-t border-zinc-200">{group.integrations.map((integration) => (<ExpertIntegrationRowkey={integration.credential_id}@@ -158,38 +164,43 @@ function ExpertIntegrationRow({ integration, isRemoving, onRemove }: RowProps) {const name = formatCredentialName(integration.title, integration.provider);return (<div- className="flex w-full items-center justify-between py-3 pl-4 pr-5"+ className="flex w-full items-center justify-between py-2.5 pl-3 pr-4"data-testid="expert-integration-row">- <div className="flex flex-col gap-1">- <div className="flex items-center gap-3">- <span className="text-[14px] font-medium leading-[22px] text-[#1F1F20]">+ <div className="flex flex-col gap-0.5">+ <div className="flex items-center gap-2">+ <Text variant="body-medium" as="span" tone="primary">{name}- </span>- <span className="inline-flex items-center justify-center rounded-md bg-[#EFF1F4] px-2 py-[2px] text-[12px] font-medium leading-[20px] text-[#505057]">+ </Text>+ <Text+ variant="small"+ as="span"+ tone="secondary"+ className="inline-flex items-center justify-center rounded-md bg-zinc-100 px-1.5 py-0.5 leading-4"+ >{TYPE_LABELS[integration.type] ?? integration.type}- </span>+ </Text></div>- <span className="text-[11px] font-medium uppercase tracking-[1.1px] text-[#505057]">+ <Text variant="body" as="span" tone="muted">{formatConnection(integration)}- </span>+ </Text></div>- <div className="flex items-center gap-4">- <span className="text-[11px] font-medium uppercase tracking-[1.1px] text-emerald-600">+ <div className="flex items-center gap-3">+ <Text variant="eyebrow" className="text-emerald-600">Ready- </span>+ </Text><buttontype="button"onClick={onRemove}disabled={isRemoving}aria-busy={isRemoving}aria-label={`Remove ${name}`}- className="inline-flex size-5 items-center justify-center text-[#1F1F20] transition-colors hover:text-red-500 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-purple-400 disabled:cursor-not-allowed disabled:opacity-50"+ className="inline-flex size-7 items-center justify-center rounded-md text-zinc-500 transition-colors hover:bg-zinc-100 hover:text-red-500 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-zinc-400 disabled:cursor-not-allowed disabled:opacity-50">{isRemoving ? (- <Icon icon={Loading03Icon} size={20} className="animate-spin" />+ <Icon icon={Loading03Icon} size={16} className="animate-spin" />) : (- <Icon icon={Delete02Icon} size={20} />+ <Icon icon={Delete02Icon} size={16} />)}</button></div>diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertIntegrationsSection/ExpertIntegrationsSection.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertIntegrationsSection/ExpertIntegrationsSection.tsxindex 6db51afbd2..1a0b0192eb 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertIntegrationsSection/ExpertIntegrationsSection.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertIntegrationsSection/ExpertIntegrationsSection.tsx@@ -3,7 +3,6 @@import { Button } from "@/components/atoms/Button/Button";import { Skeleton } from "@/components/atoms/Skeleton/Skeleton";import { ErrorCard } from "@/components/molecules/ErrorCard/ErrorCard";-import { Icon } from "@/components/atoms/Icon/Icon";import { Text } from "@/components/atoms/Text/Text";import { SearchInput } from "@/components/molecules/SearchInput/SearchInput";import { useState } from "react";@@ -17,7 +16,6 @@ import {TooltipTrigger,} from "@/components/atoms/Tooltip/BaseTooltip";import { useExpertIntegrationsSection } from "./useExpertIntegrationsSection";-import { ACTION_BUTTON_CLASS } from "@/app/(platform)/team/helpers";interface Props {expertId: string;@@ -58,16 +56,17 @@ export function ExpertIntegrationsSection({ expertId, expertName }: Props) {return (<section data-testid="expert-integrations-section"><div className="mb-2.5 flex flex-wrap items-center justify-between gap-3">- <Text variant="large-medium">{expertName}'s Integrations</Text>+ <Text variant="body-medium" tone="primary">+ {expertName}'s Integrations+ </Text><div className="flex items-center gap-2"><Tooltip><TooltipTrigger asChild><span><Buttonvariant="secondary"- size="small"- className={ACTION_BUTTON_CLASS}- leftIcon={<Icon icon={Share01Icon} size={14} />}+ size="xs"+ leadingIcon={Share01Icon}disabled={grantable.length === 0 || isError || isGrantableError}@@ -93,9 +92,8 @@ export function ExpertIntegrationsSection({ expertId, expertName }: Props) {</Tooltip><Buttonvariant="secondary"- size="small"- className={ACTION_BUTTON_CLASS}- leftIcon={<Icon icon={PlusSignIcon} size={14} />}+ size="xs"+ leadingIcon={PlusSignIcon}onClick={openConnect}>Add integration@@ -119,12 +117,14 @@ export function ExpertIntegrationsSection({ expertId, expertName }: Props) {onRetry={refetch}/>) : granted.length === 0 ? (- <p className="text-sm text-zinc-500">+ <Text variant="body" tone="muted">Nothing connected yet. Add a tool and {expertName} can use it on yourbehalf.- </p>+ </Text>) : visible.length === 0 ? (- <p className="pt-4 text-sm text-zinc-500">No integrations match.</p>+ <Text variant="body" tone="muted" className="pt-4">+ No integrations match.+ </Text>) : (<ExpertIntegrationGroupsintegrations={visible}diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertIntegrationsSection/UseExistingCredentialsDialog.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertIntegrationsSection/UseExistingCredentialsDialog.tsxindex 9bc2f9ff87..3e33ce073d 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertIntegrationsSection/UseExistingCredentialsDialog.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertIntegrationsSection/UseExistingCredentialsDialog.tsx@@ -99,6 +99,7 @@ export function UseExistingCredentialsDialog({return (<Dialog+ variant="compact"styling={{ maxWidth: "40rem", maxHeight: "60vh" }}title="Use an existing connection"controlled={{@@ -120,10 +121,7 @@ export function UseExistingCredentialsDialog({<Icon icon={ArrowLeft02Icon} size={14} />All connections</button>- <Text- variant="small"- className="text-sm leading-5 !text-zinc-500"- >+ <Text variant="body" tone="muted" className="leading-5">You have {selected.credentials.length} {selected.provider.name}{" "}connections. Choose which one {expertName} should use.</Text>@@ -145,12 +143,17 @@ export function UseExistingCredentialsDialog({provider={credential.provider}size={24}/>- <span className="min-w-0 flex-1 truncate text-sm font-medium text-zinc-800">+ <Text+ variant="body-medium"+ as="span"+ tone="primary"+ className="min-w-0 flex-1 truncate"+ >{name}- </span>+ </Text><Buttonvariant="secondary"- size="small"+ size="xs"disabled={isGranting}onClick={() => onUse(credential.id)}aria-label={`Let ${expertName} use ${name}`}@@ -164,10 +167,7 @@ export function UseExistingCredentialsDialog({</>) : (<>- <Text- variant="small"- className="text-sm leading-5 !text-zinc-500"- >+ <Text variant="body" tone="muted" className="leading-5">These connections are already set up on your account but{" "}{expertName} can't use them yet. Choose one to give{" "}{expertName} access. Nothing is re-authorised, and you can@@ -180,7 +180,7 @@ export function UseExistingCredentialsDialog({placeholder="Search connections"/>{groups.length === 0 ? (- <Text variant="small" className="text-zinc-500">+ <Text variant="small" tone="muted">{credentials.length === 0? `${expertName} can already use everything in your account.`: "No connections match."}@@ -224,7 +224,7 @@ export function UseExistingCredentialsDialog({</>)}<div className="flex justify-end pt-1">- <Button variant="secondary" size="small" onClick={onClose}>+ <Button variant="secondary" size="xs" onClick={onClose}>Cancel</Button></div>diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertIntegrationsSection/useExpertConnectServiceDialog.ts b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertIntegrationsSection/useExpertConnectServiceDialog.tsindex 51150bfcda..eb7661db4d 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertIntegrationsSection/useExpertConnectServiceDialog.ts+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertIntegrationsSection/useExpertConnectServiceDialog.ts@@ -15,6 +15,17 @@ import {import { useDebouncedValue } from "@/hooks/useDebouncedValue";import { useEffect, useState } from "react";+export type ServiceFilter = "all" | "connected" | "available";++export const SERVICE_FILTERS: readonly {+ value: ServiceFilter;+ label: string;+}[] = [+ { value: "all", label: "All" },+ { value: "connected", label: "Connected" },+ { value: "available", label: "Not connected" },+];+interface Args {open: boolean;onConnected: (credential: CredentialsMetaResponse) => void;@@ -23,6 +34,7 @@ interface Args {export function useExpertConnectServiceDialog({ open, onConnected }: Args) {const [query, setQuery] = useState("");const debouncedQuery = useDebouncedValue(query, 250);+ const [filter, setFilter] = useState<ServiceFilter>("all");const [selectedId, setSelectedId] = useState<string | null>(null);const [selectedMethod, setSelectedMethod] = useState<AuthMethod | null>(null);const [direction, setDirection] = useState<1 | -1>(1);@@ -43,6 +55,7 @@ export function useExpertConnectServiceDialog({ open, onConnected }: Args) {useEffect(() => {if (!open) {setQuery("");+ setFilter("all");setSelectedId(null);setSelectedMethod(null);}@@ -53,7 +66,14 @@ export function useExpertConnectServiceDialog({ open, onConnected }: Args) {const connectedProviders = new Set(credentials.map((credential) => credential.provider),);- const providers = filterConnectableProviders(allProviders, debouncedQuery);+ const providers = filterConnectableProviders(+ allProviders,+ debouncedQuery,+ ).filter((provider) => {+ if (filter === "all") return true;+ const isConnected = connectedProviders.has(provider.id);+ return filter === "connected" ? isConnected : !isConnected;+ });const selectedProvider: ConnectableProvider | null = selectedId? (allProviders.find((provider) => provider.id === selectedId) ?? null): null;@@ -99,6 +119,8 @@ export function useExpertConnectServiceDialog({ open, onConnected }: Args) {return {query,setQuery,+ filter,+ setFilter,providers,isLoading: providersQuery.isLoading,isError: providersQuery.isError,diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertNeedsYouSection/ExpertNeedsYouSection.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertNeedsYouSection/ExpertNeedsYouSection.tsxnew file mode 100644index 0000000000..ec32178516--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertNeedsYouSection/ExpertNeedsYouSection.tsx@@ -0,0 +1,51 @@+"use client";++import { AttentionRow } from "@/app/(platform)/home/components/NeedsYou/components/AttentionRow";+import { HomeTile } from "@/app/(platform)/home/components/HomeTile/HomeTile";+import { Text } from "@/components/atoms/Text/Text";+import { AlertCircleIcon } from "@hugeicons/core-free-icons";+import { useExpertNeedsYou } from "./useExpertNeedsYou";++interface Props {+ expertId: string;+ enabled: boolean;+}++export function ExpertNeedsYouSection({ expertId, enabled }: Props) {+ const { items, pendingIDs, decide } = useExpertNeedsYou({+ expertId,+ enabled,+ });++ if (items.length === 0) return null;++ return (+ <HomeTile+ icon={AlertCircleIcon}+ title="Needs you"+ badge={+ <Text+ variant="small-medium"+ as="span"+ tone="secondary"+ role="status"+ aria-label={`${items.length} ${items.length === 1 ? "item needs" : "items need"} your attention`}+ className="rounded-md bg-zinc-100 px-1.5 py-0.5 tabular-nums"+ >+ {items.length}+ </Text>+ }+ >+ <div className="divide-y divide-zinc-100">+ {items.map((item) => (+ <AttentionRow+ key={item.id}+ item={item}+ isProcessing={pendingIDs.has(item.id)}+ onDecision={decide}+ />+ ))}+ </div>+ </HomeTile>+ );+}diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertNeedsYouSection/useExpertNeedsYou.ts b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertNeedsYouSection/useExpertNeedsYou.tsnew file mode 100644index 0000000000..bd4cf3440f--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertNeedsYouSection/useExpertNeedsYou.ts@@ -0,0 +1,27 @@+import { useGetHomeDashboard } from "@/app/api/__generated__/endpoints/home/home";+import { okData } from "@/app/api/helpers";+import { useAttentionDecisions } from "@/app/(platform)/home/components/NeedsYou/useAttentionDecisions";++interface Args {+ expertId: string;+ enabled: boolean;+}++export function useExpertNeedsYou({ expertId, enabled }: Args) {+ const { pendingIDs, decide } = useAttentionDecisions();+ const dashboardQuery = useGetHomeDashboard({+ query: {+ enabled,+ select: (res) =>+ (okData(res)?.attention ?? []).filter(+ (item) => item.expert?.id === expertId,+ ),+ },+ });++ return {+ items: dashboardQuery.data ?? [],+ pendingIDs,+ decide,+ };+}diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertSchedulesSection.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertSchedulesSection.tsxindex 0671886ea9..7d02806621 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertSchedulesSection.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertSchedulesSection.tsx@@ -4,7 +4,6 @@ import { ExpertWorkflowRef } from "@/app/api/__generated__/models/expertWorkflowimport { GraphExecutionJobInfo } from "@/app/api/__generated__/models/graphExecutionJobInfo";import { EditScheduleModal } from "@/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/selected-views/SelectedScheduleView/components/EditScheduleModal/EditScheduleModal";import { Button } from "@/components/atoms/Button/Button";-import { Icon } from "@/components/atoms/Icon/Icon";import { Text } from "@/components/atoms/Text/Text";import { GraphScheduleListItem } from "@/components/contextual/SchedulesPanel/components/GraphScheduleListItem/GraphScheduleListItem";import { SearchInput } from "@/components/molecules/SearchInput/SearchInput";@@ -47,18 +46,21 @@ export function ExpertSchedulesSection({<section><div className="mb-2.5 flex flex-wrap items-center justify-between gap-3"><div className="flex items-baseline gap-3">- <Text variant="large-medium">{title}</Text>+ <Text variant="body-medium" tone="primary">+ {title}+ </Text>{lastRunLabel ? (- <span className="text-xs text-zinc-500">{lastRunLabel}</span>+ <Text variant="small" as="span" tone="muted">+ {lastRunLabel}+ </Text>) : null}</div><div className="flex items-center gap-2">{expertId && workflows ? (<Buttonvariant="secondary"- size="small"- className={ACTION_BUTTON_CLASS}- leftIcon={<Icon icon={PlusSignIcon} size={14} />}+ size="xs"+ leadingIcon={PlusSignIcon}onClick={() => setIsCreateOpen(true)}>Create schedule@@ -81,12 +83,14 @@ export function ExpertSchedulesSection({</div></div>{schedules.length === 0 ? (- <p className="pt-4 text-sm text-zinc-500">+ <Text variant="body" tone="muted" className="pt-4">No schedules yet. Workflows with a schedule will run {expertName}{" "}automatically and show up here.- </p>+ </Text>) : visible.length === 0 ? (- <p className="pt-4 text-sm text-zinc-500">No schedules match.</p>+ <Text variant="body" tone="muted" className="pt-4">+ No schedules match.+ </Text>) : (<ul className="flex flex-col gap-3 pt-4" aria-label="Expert schedules">{visible.map((schedule) => (diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertSettingsSection.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertSettingsSection.tsxindex 7ff73ee647..870362fee6 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertSettingsSection.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertSettingsSection.tsx@@ -3,7 +3,6 @@import { Expert } from "@/app/api/__generated__/models/expert";import { Button } from "@/components/atoms/Button/Button";import { Text } from "@/components/atoms/Text/Text";-import { ACTION_BUTTON_CLASS } from "@/app/(platform)/team/helpers";interface Props {expert: Expert;@@ -13,17 +12,17 @@ interface Props {export function ExpertSettingsSection({ expert, onFire }: Props) {return (<section className="rounded-xl border border-red-200 bg-red-50/50 p-4">- <Text variant="large-medium" className="text-red-700">+ <Text variant="body-medium" tone="danger">Danger zone</Text>- <Text variant="small" className="mt-1 text-red-600">+ <Text variant="small" tone="danger" className="mt-1">Firing {expert.name} pauses every schedule and removes them from yourteam.</Text><Buttonvariant="destructive"- size="small"- className={`${ACTION_BUTTON_CLASS} mt-4`}+ size="xs"+ className="mt-4"onClick={onFire}data-testid="expert-fire-button">diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertSkillListItem.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertSkillListItem.tsxindex 2664be9705..24526ed9c8 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertSkillListItem.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertSkillListItem.tsx@@ -6,13 +6,12 @@ import { Text } from "@/components/atoms/Text/Text";import { cn } from "@/lib/utils";import { BookOpen01Icon, Delete02Icon } from "@hugeicons/core-free-icons";import { ExpertSkillEntry } from "./useExpertSkills";-import { ACTION_BUTTON_CLASS } from "@/app/(platform)/team/helpers";interface Props {entry: ExpertSkillEntry;accentClassName?: string;- isSaving: boolean;- onRemove: (name: string) => void;+ isSaving?: boolean;+ onRemove?: (name: string) => void;}export function ExpertSkillListItem({@@ -41,19 +40,22 @@ export function ExpertSkillListItem({<Text variant="body-medium" className="break-words">{entry.name}</Text>- <Text variant="small" className="!text-zinc-500">+ <Text variant="small" tone="muted">{entry.library?.description ??"Marketplace skill. Not in your library yet."}</Text>{triggers.length > 0 ? (<div className="mt-1 flex flex-wrap gap-1">{triggers.map((trigger) => (- <span+ <Textkey={trigger}- className="rounded-md bg-zinc-100 px-2 py-0.5 text-xs text-zinc-600"+ variant="small"+ as="span"+ tone="secondary"+ className="rounded-md bg-zinc-100 px-2 py-0.5">{trigger}- </span>+ </Text>))}</div>) : null}@@ -65,23 +67,23 @@ export function ExpertSkillListItem({as="NextLink"href="/library/skills"variant="ghost"- size="small"- className={ACTION_BUTTON_CLASS}+ size="xs">Open in library</Button>) : null}- <Button- variant="secondary"- size="small"- className={ACTION_BUTTON_CLASS}- disabled={isSaving}- onClick={() => onRemove(entry.name)}- aria-label={`Remove ${entry.name}`}- >- <Icon icon={Delete02Icon} className="mr-1 h-4 w-4" />- Remove- </Button>+ {onRemove ? (+ <Button+ variant="secondary"+ size="xs"+ leadingIcon={Delete02Icon}+ disabled={isSaving}+ onClick={() => onRemove(entry.name)}+ aria-label={`Remove ${entry.name}`}+ >+ Remove+ </Button>+ ) : null}</div></div>);diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertSkillsSection.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertSkillsSection.tsxindex 4c393bcba5..d0f83cc69c 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertSkillsSection.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertSkillsSection.tsx@@ -2,14 +2,12 @@import { Expert } from "@/app/api/__generated__/models/expert";import { Button } from "@/components/atoms/Button/Button";-import { Icon } from "@/components/atoms/Icon/Icon";import { Text } from "@/components/atoms/Text/Text";import { SearchInput } from "@/components/molecules/SearchInput/SearchInput";import { PlusSignIcon } from "@hugeicons/core-free-icons";import { AddSkillDialog } from "./AddSkillDialog";import { ExpertSkillListItem } from "./ExpertSkillListItem";import { useExpertSkills } from "./useExpertSkills";-import { ACTION_BUTTON_CLASS } from "@/app/(platform)/team/helpers";interface Props {expert: Expert;@@ -42,13 +40,14 @@ export function ExpertSkillsSection({ expert, accentClassName }: Props) {return (<section><div className="mb-2.5 flex flex-wrap items-center justify-between gap-3">- <Text variant="large-medium">{expert.name}'s Skills</Text>+ <Text variant="body-medium" tone="primary">+ {expert.name}'s Skills+ </Text><div className="flex items-center gap-2"><Buttonvariant="secondary"- size="small"- className={ACTION_BUTTON_CLASS}- leftIcon={<Icon icon={PlusSignIcon} size={14} />}+ size="xs"+ leadingIcon={PlusSignIcon}onClick={openAdd}>Add skill@@ -63,12 +62,14 @@ export function ExpertSkillsSection({ expert, accentClassName }: Props) {</div></div>{!hasAny ? (- <p className="pt-4 text-sm text-zinc-500">+ <Text variant="body" tone="muted" className="pt-4">No skills yet. Add skills from your library so {expert.name} knows howyou like things done.- </p>+ </Text>) : visible.length === 0 ? (- <p className="pt-4 text-sm text-zinc-500">No skills match.</p>+ <Text variant="body" tone="muted" className="pt-4">+ No skills match.+ </Text>) : (<ul className="flex flex-col gap-3 pt-4" aria-label="Expert skills">{visible.map((entry) => (diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertSummaryCard.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertSummaryCard.tsxindex 1e4e92cc39..da6d1fcb6a 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertSummaryCard.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertSummaryCard.tsx@@ -45,7 +45,7 @@ export function ExpertSummaryCard({className="flex flex-col gap-2 rounded-xl border border-zinc-200 bg-white p-4"><div className="flex items-center justify-between gap-2">- <Text variant="large-medium" className="text-base text-zinc-700">+ <Text variant="body-medium" tone="primary">Activity</Text>{summary ? <ActivityStatus isActive={summary.isActive} /> : null}@@ -53,7 +53,7 @@ export function ExpertSummaryCard({{isActivityLoading ? (<Skeleton className="h-[5.25rem] w-full rounded-lg" />) : isActivityError ? (- <Text variant="small" className="text-zinc-500">+ <Text variant="small" tone="muted">Activity unavailable</Text>) : visibleActivityDays && summary ? (@@ -62,7 +62,7 @@ export function ExpertSummaryCard({days={visibleActivityDays}color={expert.color}/>- <Text variant="small" className="text-zinc-500">+ <Text variant="small" tone="muted">{summary.totalsLabel} · {summary.rangeLabel}</Text></>@@ -76,7 +76,7 @@ export function ExpertSummaryCard({{isActivityLoading ? (<Skeleton className="h-16 w-full rounded-lg" />) : isActivityError ? (- <Text variant="small" className="text-zinc-500">+ <Text variant="small" tone="muted">Streak unavailable</Text>) : (@@ -87,10 +87,10 @@ export function ExpertSummaryCard({className="shrink-0 text-zinc-400"/><div className="min-w-0">- <Text variant="h4" className="tabular-nums text-zinc-900">+ <Text variant="h4" tone="primary" className="tabular-nums">{streak ?? 0}</Text>- <Text variant="small" className="text-sm text-zinc-500">+ <Text variant="body" tone="muted">day streak</Text></div>@@ -115,7 +115,7 @@ function ActivityStatus({ isActive }: ActivityStatusProps) {isActive ? "bg-emerald-500" : "bg-zinc-300",)}/>- <Text variant="small" className="text-zinc-500">+ <Text variant="small" tone="muted">{isActive ? "Active this week" : "Quiet lately"}</Text></span>diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertWorkSection/ExpertWorkSection.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertWorkSection/ExpertWorkSection.tsxindex a9f3b5bc78..a34ab4974d 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertWorkSection/ExpertWorkSection.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertWorkSection/ExpertWorkSection.tsx@@ -6,50 +6,50 @@ import { okData } from "@/app/api/helpers";import { isOutputType } from "@/components/organisms/WorkOutputSheet/helpers";import { WorkOutputSheet } from "@/components/organisms/WorkOutputSheet/WorkOutputSheet";import { Button } from "@/components/atoms/Button/Button";+import { Text } from "@/components/atoms/Text/Text";import { Badge } from "@/components/atoms/Badge/Badge";import { Skeleton } from "@/components/atoms/Skeleton/Skeleton";import { ErrorCard } from "@/components/molecules/ErrorCard/ErrorCard";import { RunStatusBadge } from "@/components/molecules/RunStatusBadge/RunStatusBadge";-import { cn } from "@/lib/utils";import { useState } from "react";-import { ACTION_BUTTON_CLASS } from "@/app/(platform)/team/helpers";+import { FilterIconMenu } from "../FilterIconMenu";+import {+ filterExpertRuns,+ getWorkEmptyMessage,+ WORK_FILTERS,+ WorkFilter,+ getRunMeta,+} from "./helpers";interface Props {expertId: string;+ expertName: string;enabled: boolean;}-export function ExpertWorkSection({ expertId, enabled }: Props) {- const [needsReviewOnly, setNeedsReviewOnly] = useState(false);+export function ExpertWorkSection({ expertId, expertName, enabled }: Props) {+ const [filter, setFilter] = useState<WorkFilter>("all");const [activeRun, setActiveRun] = useState<ExpertRun | null>(null);const runsQuery = useListExpertRuns(expertId, {query: { select: (res) => okData(res) ?? null, enabled },});const runs = runsQuery.data ?? [];- const reviewCount = runs.filter((run) => run.needs_review).length;- const visibleRuns = needsReviewOnly- ? runs.filter((run) => run.needs_review)- : runs;+ const visibleRuns = filterExpertRuns(runs, filter);return (<section>- <div className="mb-2.5 flex items-center justify-end gap-2 empty:mb-0">- {reviewCount > 0 ? (- <button- type="button"- aria-pressed={needsReviewOnly}- onClick={() => setNeedsReviewOnly((value) => !value)}- className={cn(- "rounded-md px-2.5 py-1 text-xs font-medium ring-1 ring-inset transition-colors",- needsReviewOnly- ? "bg-amber-100 text-amber-700 ring-amber-200"- : "bg-white text-zinc-500 ring-zinc-200 hover:text-zinc-800",- )}- >- Needs review ({reviewCount})- </button>- ) : null}+ <div className="mb-2.5 flex flex-wrap items-center justify-between gap-3">+ <Text variant="body-medium" tone="primary">+ {expertName}'s Work+ </Text>+ <FilterIconMenu+ label="Filter work"+ value={filter}+ defaultValue="all"+ options={WORK_FILTERS}+ onChange={setFilter}+ /></div>{runsQuery.isLoading ? (@@ -64,11 +64,9 @@ export function ExpertWorkSection({ expertId, enabled }: Props) {onRetry={() => runsQuery.refetch()}/>) : visibleRuns.length === 0 ? (- <p className="text-sm text-zinc-500">- {needsReviewOnly- ? "Nothing is waiting on your review."- : "No completed work yet. Finished runs will show up here."}- </p>+ <Text variant="body" tone="muted">+ {getWorkEmptyMessage(filter)}+ </Text>) : (<ul className="flex flex-col gap-3" aria-label="Expert work">{visibleRuns.map((run) => (@@ -102,27 +100,34 @@ export function ExpertWorkSection({ expertId, enabled }: Props) {}function ExpertRunRow({ run, onOpen }: { run: ExpertRun; onOpen: () => void }) {+ const meta = getRunMeta(run);return (<div className="flex items-center justify-between gap-3 rounded-lg bg-white p-3 ring-1 ring-inset ring-zinc-200"><div className="min-w-0">- <p className="truncate text-sm font-medium text-zinc-900">+ <Text variant="body-medium" tone="primary" className="truncate">{run.agent_name}- </p>- <div className="mt-1 flex items-center gap-2">+ </Text>+ <div className="mt-1 flex flex-wrap items-center gap-2"><RunStatusBadge status={run.status} />{run.needs_review && run.status.toUpperCase() !== "REVIEW" ? (<Badge variant="warning" size="small">Needs review</Badge>) : null}+ {meta.parts.length > 0 ? (+ <Text+ variant="small"+ as="span"+ tone="muted"+ title={meta.startedAt?.toLocaleString()}+ data-testid="expert-run-meta"+ >+ {meta.parts.join(" · ")}+ </Text>+ ) : null}</div></div>- <Button- variant="secondary"- size="small"- className={ACTION_BUTTON_CLASS}- onClick={onOpen}- >+ <Button variant="secondary" size="xs" onClick={onOpen}>Open</Button></div>diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertWorkSection/helpers.ts b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertWorkSection/helpers.tsnew file mode 100644index 0000000000..9c9e306b2f--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertWorkSection/helpers.ts@@ -0,0 +1,73 @@+import { ExpertRun } from "@/app/api/__generated__/models/expertRun";+import { formatDistanceToNow } from "date-fns";++export const WORK_FILTERS = [+ { value: "all", label: "All work" },+ { value: "needs-review", label: "Needs review" },+ { value: "completed", label: "Completed" },+ { value: "failed", label: "Failed" },+ { value: "running", label: "In progress" },+] as const;++export type WorkFilter = (typeof WORK_FILTERS)[number]["value"];++export function filterExpertRuns(runs: ExpertRun[], filter: WorkFilter) {+ if (filter === "all") return runs;+ if (filter === "needs-review") return runs.filter((run) => run.needs_review);+ return runs.filter((run) => {+ const status = run.status.toLowerCase();+ if (filter === "completed") return status === "completed";+ if (filter === "failed")+ return status === "failed" || status === "terminated";+ return status === "running" || status === "queued";+ });+}++export function getWorkEmptyMessage(filter: WorkFilter) {+ if (filter === "all")+ return "No completed work yet. Finished runs will show up here.";+ if (filter === "needs-review") return "Nothing is waiting on your review.";+ return "No work matches.";+}++const SOURCE_LABELS: Record<string, string> = {+ scheduled: "Scheduled",+ trigger: "Triggered",+ manual: "Run manually",+};++function toDate(value: unknown): Date | null {+ if (!value) return null;+ const date = value instanceof Date ? value : new Date(String(value));+ return Number.isNaN(date.getTime()) ? null : date;+}++export function formatRunDuration(startedAt: unknown, endedAt: unknown) {+ const start = toDate(startedAt);+ const end = toDate(endedAt);+ if (!start || !end) return null;+ const totalSeconds = Math.max(+ 0,+ Math.round((end.getTime() - start.getTime()) / 1000),+ );+ if (totalSeconds < 60) return `${totalSeconds}s`;+ const hours = Math.floor(totalSeconds / 3600);+ const minutes = Math.floor((totalSeconds % 3600) / 60);+ const seconds = totalSeconds % 60;+ if (hours > 0) return `${hours}h ${minutes}m`;+ return seconds > 0 ? `${minutes}m ${seconds}s` : `${minutes}m`;+}++/** Older backends send no `source`; the row simply omits that part. */+export function getRunMeta(run: ExpertRun) {+ const parts: string[] = [];+ const source = run.source ? SOURCE_LABELS[run.source] : null;+ if (source) parts.push(source);+ const started = toDate(run.started_at);+ if (started) {+ parts.push(`${formatDistanceToNow(started, { addSuffix: true })}`);+ }+ const duration = formatRunDuration(run.started_at, run.ended_at);+ if (duration) parts.push(duration);+ return { parts, startedAt: started };+}diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertWorkflowActions.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertWorkflowActions.tsxindex baf569f86e..be9020cff1 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertWorkflowActions.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertWorkflowActions.tsx@@ -2,21 +2,22 @@import { ExpertWorkflowRef } from "@/app/api/__generated__/models/expertWorkflowRef";import { Button } from "@/components/atoms/Button/Button";-import { Icon } from "@/components/atoms/Icon/Icon";import { PencilEdit02Icon, SparklesIcon } from "@hugeicons/core-free-icons";import { ExpertWorkflowCardMenu } from "./ExpertWorkflowCardMenu";-const ICON_BUTTON_CLASS =- "h-7 w-7 rounded-md border-transparent bg-white/90 p-0 text-zinc-700 hover:border-transparent hover:bg-white";-interface Props {workflow: ExpertWorkflowRef;- expertId: string;+ expertId?: string;name: string;builderHref: string | null;chatHref: string;- buttonClassName?: string;- menuClassName?: string;+ chatPrompt: string;+ /** Hosts with an inline chat open it with the prompt instead of leaving+ * for the Copilot page. */+ onAsk?: (prompt: string) => void;+ /** Cards float these over the cover art; the list rows sit on white. */+ variant?: "floating" | "ghost";+ size?: "icon-xs" | "icon-sm";}export function ExpertWorkflowActions({@@ -25,8 +26,10 @@ export function ExpertWorkflowActions({name,builderHref,chatHref,- buttonClassName = ICON_BUTTON_CLASS,- menuClassName = buttonClassName,+ chatPrompt,+ onAsk,+ variant = "floating",+ size = "icon-xs",}: Props) {return (<>@@ -34,29 +37,37 @@ export function ExpertWorkflowActions({<Buttonas="NextLink"href={builderHref}- variant="icon"- size="icon"+ variant={variant}+ size={size}aria-label="Edit workflow"- className={buttonClassName}- >- <Icon icon={PencilEdit02Icon} size={14} />- </Button>+ leadingIcon={PencilEdit02Icon}+ />) : null}- <Button- as="NextLink"- href={chatHref}- variant="icon"- size="icon"- aria-label="Ask about this workflow"- className={buttonClassName}- >- <Icon icon={SparklesIcon} size={14} />- </Button>+ {onAsk ? (+ <Button+ type="button"+ variant={variant}+ size={size}+ aria-label="Ask about this workflow"+ leadingIcon={SparklesIcon}+ onClick={() => onAsk(chatPrompt)}+ />+ ) : (+ <Button+ as="NextLink"+ href={chatHref}+ variant={variant}+ size={size}+ aria-label="Ask about this workflow"+ leadingIcon={SparklesIcon}+ />+ )}<ExpertWorkflowCardMenuworkflow={workflow}expertId={expertId}name={name}- triggerClassName={menuClassName}+ variant={variant}+ size={size}/></>);diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertWorkflowCard.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertWorkflowCard.tsxindex 2675e1df5e..60f89bc382 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertWorkflowCard.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertWorkflowCard.tsx@@ -16,11 +16,17 @@ import { WorkflowCredentialStack } from "./WorkflowCredentialStack";interface Props {workflow: ExpertWorkflowRef;- expertId: string;+ expertId?: string;coverColor: string | undefined;+ onAsk?: (prompt: string) => void;}-export function ExpertWorkflowCard({ workflow, expertId, coverColor }: Props) {+export function ExpertWorkflowCard({+ workflow,+ expertId,+ coverColor,+ onAsk,+}: Props) {const {name,libraryAgent,@@ -31,6 +37,7 @@ export function ExpertWorkflowCard({ workflow, expertId, coverColor }: Props) {libraryHref,builderHref,chatHref,+ chatPrompt,openRun,openTriggers,} = useExpertWorkflowCard({ workflow, expertId });@@ -63,23 +70,30 @@ export function ExpertWorkflowCard({ workflow, expertId, coverColor }: Props) {name={name}builderHref={builderHref}chatHref={chatHref}+ chatPrompt={chatPrompt}+ onAsk={onAsk}/></div></div><div className="pointer-events-none relative flex flex-1 flex-col px-3 pb-3 pt-2.5">- <Text variant="h5" className="line-clamp-2 hyphens-auto break-words">+ <Text+ variant="large-medium"+ tone="primary"+ className="line-clamp-2 hyphens-auto break-words"+ >{name}</Text>{workflow.schedule_cron ? (- <Text variant="small" className="mt-0.5 text-zinc-400">+ <Text variant="small" tone="muted" className="mt-0.5">{safeHumanizeCronExpression(workflow.schedule_cron)}</Text>) : null}{workflow.description ? (<Text- variant="small"- className="mt-1.5 line-clamp-2 text-sm leading-5 text-zinc-500"+ variant="body"+ tone="muted"+ className="mt-1.5 line-clamp-2 leading-5">{workflow.description}</Text>@@ -87,21 +101,24 @@ export function ExpertWorkflowCard({ workflow, expertId, coverColor }: Props) {<div className="mt-2 flex flex-wrap items-center gap-2">{runCount !== undefined ? (<Text- variant="small"- className="flex items-center gap-1.5 text-sm leading-5 text-zinc-500"+ variant="body"+ tone="muted"+ className="flex items-center gap-1.5 leading-5"><Icon icon={Activity01Icon} size={14} className="shrink-0" />{runCount} {runCount === 1 ? "run" : "runs"}</Text>) : null}- <span+ <Text+ variant="small-medium"+ as="span"className={cn(- "rounded-md px-2 py-0.5 text-xs font-medium ring-1 ring-inset ring-zinc-200/80",+ "rounded-md px-2 py-0.5 ring-1 ring-inset ring-zinc-200/80",status.className,)}>{status.label}- </span>+ </Text></div>{libraryAgent ? (<div className="relative z-10 mt-auto flex items-center justify-between gap-3 pt-3">diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertWorkflowCardMenu.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertWorkflowCardMenu.tsxindex 26a51aceb0..cec30438a5 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertWorkflowCardMenu.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertWorkflowCardMenu.tsx@@ -31,16 +31,18 @@ import { workflowNeedsSetup } from "../../helpers";interface Props {workflow: ExpertWorkflowRef;- expertId: string;+ expertId?: string;name: string;- triggerClassName?: string;+ variant?: "floating" | "ghost";+ size?: "icon-xs" | "icon-sm";}export function ExpertWorkflowCardMenu({workflow,expertId,name,- triggerClassName,+ variant = "floating",+ size = "icon-xs",}: Props) {const { toast } = useToast();const queryClient = useQueryClient();@@ -51,7 +53,10 @@ export function ExpertWorkflowCardMenu({? `/library/agents/${workflow.library_agent_id}`: null;+ if (!libraryHref && !expertId) return null;+async function handleRemove() {+ if (!expertId) return;try {await removeWorkflow({ expertId, workflowId: workflow.id });await Promise.all([@@ -73,13 +78,11 @@ export function ExpertWorkflowCardMenu({<DropdownMenuTrigger asChild><Buttontype="button"- variant="icon"- size="icon"+ variant={variant}+ size={size}aria-label="More actions"- className={triggerClassName}- >- <Icon icon={MoreHorizontalIcon} size={16} />- </Button>+ leadingIcon={MoreHorizontalIcon}+ /></DropdownMenuTrigger><DropdownMenuContent align="end" className="min-w-[11rem]">{libraryHref ? (@@ -95,18 +98,22 @@ export function ExpertWorkflowCardMenu({</NextLink></DropdownMenuItem>) : null}- {libraryHref ? <DropdownMenuSeparator /> : null}- <DropdownMenuItem- className="flex items-center gap-2 text-red-600 focus:text-red-600"- onSelect={() => setIsRemoveOpen(true)}- >- <Icon icon={Delete02Icon} size={16} />- Remove from expert- </DropdownMenuItem>+ {libraryHref && expertId ? <DropdownMenuSeparator /> : null}+ {expertId ? (+ <DropdownMenuItem+ className="flex items-center gap-2 text-red-600 focus:text-red-600"+ onSelect={() => setIsRemoveOpen(true)}+ >+ <Icon icon={Delete02Icon} size={16} />+ Remove from expert+ </DropdownMenuItem>+ ) : null}</DropdownMenuContent></DropdownMenu><Dialog+ variant="compact"+ styling={{ maxWidth: "30rem" }}controlled={{isOpen: isRemoveOpen,set: (open) => {@@ -118,7 +125,7 @@ export function ExpertWorkflowCardMenu({><Dialog.Content><div className="flex flex-col gap-4">- <Text variant="body" className="text-zinc-600">+ <Text variant="body" tone="secondary">This expert will stop running it and its schedule will be removed.The workflow stays in your library.</Text>@@ -126,7 +133,7 @@ export function ExpertWorkflowCardMenu({<Buttontype="button"variant="ghost"- size="small"+ size="xs"disabled={isRemoving}onClick={() => setIsRemoveOpen(false)}>@@ -135,7 +142,7 @@ export function ExpertWorkflowCardMenu({<Buttontype="button"variant="destructive"- size="small"+ size="xs"loading={isRemoving}onClick={handleRemove}>diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertWorkflowListItem.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertWorkflowListItem.tsxindex f603396fa9..ca73744f07 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertWorkflowListItem.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertWorkflowListItem.tsx@@ -5,7 +5,10 @@ import { Icon } from "@/components/atoms/Icon/Icon";import { Text } from "@/components/atoms/Text/Text";import { safeHumanizeCronExpression } from "@/lib/cron-expression-utils";import { cn } from "@/lib/utils";-import { Activity01Icon } from "@hugeicons/core-free-icons";+import {+ Activity01Icon,+ WorkflowSquare01Icon,+} from "@hugeicons/core-free-icons";import NextLink from "next/link";import { ExpertWorkflowActions } from "./ExpertWorkflowActions";import { ExpertWorkflowRunButton } from "./ExpertWorkflowRunButton";@@ -14,14 +17,16 @@ import { WorkflowCredentialStack } from "./WorkflowCredentialStack";interface Props {workflow: ExpertWorkflowRef;- expertId: string;+ expertId?: string;accentClassName: string;+ onAsk?: (prompt: string) => void;}export function ExpertWorkflowListItem({workflow,expertId,accentClassName,+ onAsk,}: Props) {const {name,@@ -33,6 +38,7 @@ export function ExpertWorkflowListItem({libraryHref,builderHref,chatHref,+ chatPrompt,openRun,openTriggers,} = useExpertWorkflowCard({ workflow, expertId });@@ -64,33 +70,27 @@ export function ExpertWorkflowListItem({"pointer-events-none flex h-9 w-9 flex-shrink-0 items-center justify-center rounded-md border-0",)}>- <Icon- icon={status.icon}- size={18}- role="img"- aria-label={status.label}- />+ <Icon icon={WorkflowSquare01Icon} size={18} aria-hidden="true" /></div><div className="pointer-events-none min-w-0 flex-1"><div className="flex items-center gap-2">- <Text variant="body-medium" className="truncate text-zinc-900">+ <Text variant="body-medium" tone="primary" className="truncate">{name}</Text>- <span+ <Text+ variant="small-medium"+ as="span"className={cn(- "shrink-0 rounded-md px-2 py-0.5 text-xs font-medium ring-1 ring-inset ring-zinc-200/80",+ "shrink-0 rounded-md px-2 py-0.5 ring-1 ring-inset ring-zinc-200/80",status.className,)}>{status.label}- </span>+ </Text></div>{workflow.description ? (- <Text- variant="small"- className="mt-0.5 truncate text-sm text-zinc-500"- >+ <Text variant="body" tone="muted" className="mt-0.5 truncate">{workflow.description}</Text>) : null}@@ -98,8 +98,9 @@ export function ExpertWorkflowListItem({<div className="mt-1 flex flex-wrap items-center gap-2 text-sm leading-5 text-zinc-600">{meta.length > 0 ? (<Text- variant="small"- className="flex items-center gap-1.5 text-sm leading-5 text-zinc-600"+ variant="body"+ tone="secondary"+ className="flex items-center gap-1.5 leading-5"><Icon icon={Activity01Icon} size={14} className="shrink-0" />{meta.join(" · ")}@@ -120,7 +121,10 @@ export function ExpertWorkflowListItem({name={name}builderHref={builderHref}chatHref={chatHref}- buttonClassName="h-8 w-8 rounded-md border-transparent p-0 text-zinc-700 hover:border-transparent hover:bg-zinc-50"+ chatPrompt={chatPrompt}+ onAsk={onAsk}+ variant="ghost"+ size="icon-sm"/>{libraryAgent ? (<span className="ml-1">diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertWorkflowRunButton.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertWorkflowRunButton.tsxindex da1206cfe3..0cfad43013 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertWorkflowRunButton.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertWorkflowRunButton.tsx@@ -3,9 +3,7 @@ import { GraphExecutionMeta } from "@/app/api/__generated__/models/graphExecutioimport { LibraryAgent } from "@/app/api/__generated__/models/libraryAgent";import { RunAgentModal } from "@/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/modals/RunAgentModal/RunAgentModal";import { Button } from "@/components/atoms/Button/Button";-import { Icon } from "@/components/atoms/Icon/Icon";import { PlayIcon } from "@hugeicons/core-free-icons";-import { ACTION_BUTTON_CLASS } from "@/app/(platform)/team/helpers";interface Props {agent: LibraryAgent;@@ -25,15 +23,16 @@ export function ExpertWorkflowRunButton({return (<RunAgentModalagent={agent}+ title={isTriggerWorkflow ? "Set up trigger" : "Run workflow"}+ dialogVariant="compact"onRunCreated={onRunCreated}onTriggerSetup={onTriggerSetup}triggerSlot={<Buttontype="button"variant={variant}- size="small"- className={ACTION_BUTTON_CLASS}- leftIcon={<Icon icon={PlayIcon} size={14} />}+ size="xs"+ leadingIcon={PlayIcon}>{isTriggerWorkflow ? "Set up trigger" : "Run"}</Button>diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertWorkflowsSection.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertWorkflowsSection.tsxindex 7f8427a190..d84903aee4 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertWorkflowsSection.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertWorkflowsSection.tsx@@ -1,10 +1,8 @@"use client";-import { Expert } from "@/app/api/__generated__/models/expert";+import { ExpertWorkflowRef } from "@/app/api/__generated__/models/expertWorkflowRef";import { Button } from "@/components/atoms/Button/Button";-import { Icon } from "@/components/atoms/Icon/Icon";import { Text } from "@/components/atoms/Text/Text";-import { getRaisedExpertAccent } from "@/app/(platform)/marketplace/components/ExpertsSection/helpers";import { SearchInput } from "@/components/molecules/SearchInput/SearchInput";import {GridViewIcon,@@ -16,7 +14,6 @@ import {filterExpertWorkflows,WORKFLOW_FILTERS,WorkflowFilter,- ACTION_BUTTON_CLASS,} from "../../helpers";import { ExpertWorkflowCard } from "./ExpertWorkflowCard";import { ExpertWorkflowListItem } from "./ExpertWorkflowListItem";@@ -30,31 +27,48 @@ const VIEW_OPTIONS = [] as const;interface Props {- expert: Expert;- onInstallWorkflow: () => void;+ expertName: string;+ workflows: ExpertWorkflowRef[];+ accentClassName: string;+ expertId?: string;+ coverColor?: string;+ emptyMessage?: string;+ onInstallWorkflow?: () => void;+ onAskWorkflow?: (prompt: string) => void;}-export function ExpertWorkflowsSection({ expert, onInstallWorkflow }: Props) {+export function ExpertWorkflowsSection({+ expertName,+ workflows,+ accentClassName,+ expertId,+ coverColor,+ emptyMessage,+ onInstallWorkflow,+ onAskWorkflow,+}: Props) {const [query, setQuery] = useState("");const [filter, setFilter] = useState<WorkflowFilter>("all");const { view, setView } = useExpertWorkflowsView();- const accent = getRaisedExpertAccent(expert.role, expert.color);- const visible = filterExpertWorkflows(expert.workflows, query, filter);+ const visible = filterExpertWorkflows(workflows, query, filter);return (<section><div className="mb-2.5 flex flex-wrap items-center justify-between gap-3">- <Text variant="large-medium">{expert.name}'s Workflows</Text>+ <Text variant="body-medium" tone="primary">+ {expertName}'s Workflows+ </Text><div className="flex items-center gap-2">- <Button- variant="secondary"- size="small"- className={ACTION_BUTTON_CLASS}- leftIcon={<Icon icon={PlusSignIcon} size={14} />}- onClick={onInstallWorkflow}- >- Install workflow- </Button>+ {onInstallWorkflow ? (+ <Button+ variant="secondary"+ size="xs"+ leadingIcon={PlusSignIcon}+ onClick={onInstallWorkflow}+ >+ Install workflow+ </Button>+ ) : null}<SearchInputsize="xsmall"value={query}@@ -72,20 +86,24 @@ export function ExpertWorkflowsSection({ expert, onInstallWorkflow }: Props) {<ViewToggle value={view} options={VIEW_OPTIONS} onChange={setView} /></div></div>- {expert.workflows.length === 0 ? (- <p className="text-sm text-zinc-500">- No workflows yet. Install one to give {expert.name} something to run.- </p>+ {workflows.length === 0 ? (+ <Text variant="body" tone="muted">+ {emptyMessage ??+ `No workflows yet. Install one to give ${expertName} something to run.`}+ </Text>) : visible.length === 0 ? (- <p className="text-sm text-zinc-500">No workflows match.</p>+ <Text variant="body" tone="muted">+ No workflows match.+ </Text>) : view === "list" ? (<div className="flex flex-col gap-3 pt-4" data-testid="workflow-list">{visible.map((workflow) => (<ExpertWorkflowListItemkey={workflow.id}workflow={workflow}- expertId={expert.id}- accentClassName={accent.pill}+ expertId={expertId}+ accentClassName={accentClassName}+ onAsk={onAskWorkflow}/>))}</div>@@ -95,8 +113,9 @@ export function ExpertWorkflowsSection({ expert, onInstallWorkflow }: Props) {<ExpertWorkflowCardkey={workflow.id}workflow={workflow}- expertId={expert.id}- coverColor={expert.color}+ expertId={expertId}+ coverColor={coverColor}+ onAsk={onAskWorkflow}/>))}</div>diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/FilterIconMenu.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/FilterIconMenu.tsxindex 418c7fbba1..f33488296b 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/FilterIconMenu.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/FilterIconMenu.tsx@@ -1,7 +1,6 @@"use client";import { Button } from "@/components/atoms/Button/Button";-import { Icon } from "@/components/atoms/Icon/Icon";import {DropdownMenu,DropdownMenuContent,@@ -9,7 +8,6 @@ import {DropdownMenuRadioItem,DropdownMenuTrigger,} from "@/components/molecules/DropdownMenu/DropdownMenu";-import { cn } from "@/lib/utils";import { FilterHorizontalIcon } from "@hugeicons/core-free-icons";interface Props<T extends string> {@@ -34,16 +32,15 @@ export function FilterIconMenu<T extends string>({<Buttontype="button"variant="icon"- size="icon"+ size="icon-xs"aria-label={label}- className={cn(- "h-7 w-7 rounded-md border-zinc-200 p-0",- isActive &&- "border-zinc-900 bg-zinc-900 text-white hover:bg-zinc-800 hover:text-white",- )}- >- <Icon icon={FilterHorizontalIcon} size={14} />- </Button>+ leadingIcon={FilterHorizontalIcon}+ className={+ isActive+ ? "border-zinc-900 bg-zinc-900 text-white hover:border-zinc-800 hover:bg-zinc-800 hover:text-white"+ : undefined+ }+ /></DropdownMenuTrigger><DropdownMenuContent align="end" className="min-w-[11rem]"><DropdownMenuRadioGroupdiff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ViewToggle.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ViewToggle.tsxindex cbd3558d61..3f02b15b20 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ViewToggle.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ViewToggle.tsx@@ -1,7 +1,6 @@"use client";-import { Icon } from "@/components/atoms/Icon/Icon";-import { cn } from "@/lib/utils";+import { Button } from "@/components/atoms/Button/Button";import type { IconSvgElement } from "@hugeicons/react";interface Props<T extends string> {@@ -18,19 +17,17 @@ export function ViewToggle<T extends string>({return (<div className="flex h-7 items-center rounded-md border border-zinc-200 p-0.5">{options.map((option) => (- <button+ <Buttonkey={option.value}type="button"+ variant="toggle"+ size="icon-xs"+ className="size-6 rounded"+ leadingIcon={option.icon}aria-label={option.label}aria-pressed={value === option.value}onClick={() => onChange(option.value)}- className={cn(- "flex h-full w-7 items-center justify-center rounded text-zinc-500 transition-colors hover:text-zinc-800",- value === option.value && "bg-zinc-100 text-zinc-900",- )}- >- <Icon icon={option.icon} size={14} />- </button>+ />))}</div>);diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/WorkflowCredentialStack.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/WorkflowCredentialStack.tsxindex d4d9f6b4cc..fd8f585945 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/WorkflowCredentialStack.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/WorkflowCredentialStack.tsx@@ -2,6 +2,7 @@import { ExpertWorkflowChainItem } from "@/app/api/__generated__/models/expertWorkflowChainItem";import { LibraryAgent } from "@/app/api/__generated__/models/libraryAgent";+import { Text } from "@/components/atoms/Text/Text";import { cn } from "@/lib/utils";import { IntegrationLogo } from "@/components/molecules/IntegrationLogo/IntegrationLogo";import { toDisplayName } from "@/components/renderers/InputRenderer/custom/CredentialField/helpers";@@ -66,13 +67,16 @@ export function WorkflowCredentialStack({ providers }: Props) {</span>))}{hidden > 0 ? (- <span+ <Text+ variant="small-medium"+ as="span"+ tone="secondary"role="listitem"- className="-ml-2 flex size-7 items-center justify-center rounded-full border border-zinc-200 bg-zinc-100 text-[11px] font-medium text-zinc-600 ring-2 ring-white"+ className="-ml-2 flex size-7 items-center justify-center rounded-full border border-zinc-200 bg-zinc-100 ring-2 ring-white"aria-label={`${hidden} more`}>+{hidden}- </span>+ </Text>) : null}</div>);diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/useExpertWorkflowCard.ts b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/useExpertWorkflowCard.tsindex 6b84b7d13e..7d08b1b82a 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/useExpertWorkflowCard.ts+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/useExpertWorkflowCard.ts@@ -41,7 +41,7 @@ const STATUS = {interface Args {workflow: ExpertWorkflowRef;- expertId: string;+ expertId?: string;}export function useExpertWorkflowCard({ workflow, expertId }: Args) {@@ -60,9 +60,7 @@ export function useExpertWorkflowCard({ workflow, expertId }: Args) {const libraryHref = workflow.library_agent_id? `/library/agents/${workflow.library_agent_id}`: null;- const chatPrompt = encodeURIComponent(- `Tell me about the workflow "${name}" and how you use it.`,- );+ const chatPrompt = `Tell me about the workflow "${name}" and how you use it.`;function openRun(execution: GraphExecutionMeta) {router.push(`${libraryHref}?activeTab=runs&activeItem=${execution.id}`);@@ -98,7 +96,8 @@ export function useExpertWorkflowCard({ workflow, expertId }: Args) {builderHref: workflow.graph_id? `/build?flowID=${workflow.graph_id}`: null,- chatHref: `/copilot?expertId=${expertId}&autosubmit=true#prompt=${chatPrompt}`,+ chatPrompt,+ chatHref: `/copilot?${expertId ? `expertId=${expertId}&` : ""}autosubmit=true#prompt=${encodeURIComponent(chatPrompt)}`,openRun,openTriggers,};diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/page.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/page.tsxindex 3d1d9e071e..d48c0ec59f 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/page.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/page.tsx@@ -2,7 +2,6 @@import { getRaisedExpertAccent } from "@/app/(platform)/marketplace/components/ExpertsSection/helpers";import { Button } from "@/components/atoms/Button/Button";-import { Icon } from "@/components/atoms/Icon/Icon";import { Skeleton } from "@/components/atoms/Skeleton/Skeleton";import { Text } from "@/components/atoms/Text/Text";import { ErrorCard } from "@/components/molecules/ErrorCard/ErrorCard";@@ -26,6 +25,8 @@ import {} from "@hugeicons/core-free-icons";import { notFound, useParams, useRouter } from "next/navigation";import { BackToTeamLink } from "../components/BackToTeamLink";+import { ExpertChatDrawer } from "../components/ExpertChatDrawer/ExpertChatDrawer";+import { expertToChatTarget } from "../components/ExpertChatDrawer/helpers";import { FireExpertDialog } from "../components/FireExpertDialog/FireExpertDialog";import { SoulDrawer } from "../components/SoulDrawer/SoulDrawer";import { getLastRunLabel } from "../helpers";@@ -33,6 +34,7 @@ import { ExpertAboutSection } from "./components/ExpertAboutSection";import { ExpertBudgetSection } from "./components/ExpertBudgetSection";import { ExpertDetailHeader } from "./components/ExpertDetailHeader";import { ExpertIntegrationsSection } from "./components/ExpertIntegrationsSection/ExpertIntegrationsSection";+import { ExpertNeedsYouSection } from "./components/ExpertNeedsYouSection/ExpertNeedsYouSection";import { ExpertSchedulesSection } from "./components/ExpertSchedulesSection";import { ExpertSettingsSection } from "./components/ExpertSettingsSection";import { ExpertSkillsSection } from "./components/ExpertSkillsSection";@@ -40,7 +42,6 @@ import { ExpertSummaryCard } from "./components/ExpertSummaryCard";import { ExpertWorkSection } from "./components/ExpertWorkSection/ExpertWorkSection";import { ExpertWorkflowsSection } from "./components/ExpertWorkflowsSection";import { useExpertDetailPage } from "./useExpertDetailPage";-import { ACTION_BUTTON_CLASS } from "@/app/(platform)/team/helpers";const MAIN_CLASS ="container min-h-screen max-w-[1180px] space-y-5 pb-16 pt-6 sm:px-8 md:px-12";@@ -80,6 +81,12 @@ export default function ExpertDetailPage() {soulDrawerKey,toggleSoul,closeSoul,+ isChatOpen,+ chatDrawerKey,+ chatSeed,+ toggleChat,+ openChatWithPrompt,+ closeChat,} = useExpertDetailPage({expertId,enabled: Boolean(enabled) && ready,@@ -118,7 +125,11 @@ export default function ExpertDetailPage() {<div className="flex w-full"><main className={cn(MAIN_CLASS, "min-w-0 flex-1")}><BackToTeamLink />- <ExpertDetailHeader expert={expert} onEditSoul={toggleSoul} />+ <ExpertDetailHeader+ expert={expert}+ onEditSoul={toggleSoul}+ onChat={toggleChat}+ />{isPaused ? (<div className="flex items-center justify-between gap-2 rounded-lg bg-amber-50 px-4 py-2.5 ring-1 ring-inset ring-amber-200">@@ -127,8 +138,7 @@ export default function ExpertDetailPage() {</Text><Buttonvariant="secondary"- size="small"- className={ACTION_BUTTON_CLASS}+ size="xs"loading={isResuming}onClick={resumeSchedules}>@@ -139,19 +149,25 @@ export default function ExpertDetailPage() {<ExpertBudgetSection expert={expert} />- <TabsLine defaultValue="basics">- <TabsLineList- flush- className="overflow-x-auto"- indicatorClassName="bg-zinc-900"- >+ {expert.tagline ? (+ <Text variant="body" tone="muted">+ {expert.tagline}+ </Text>+ ) : null}++ <ExpertNeedsYouSection+ expertId={expert.id}+ enabled={Boolean(enabled) && ready}+ />++ <TabsLine variant="compact" defaultValue="basics">+ <TabsLineList className="overflow-x-auto">{TABS.map((tab) => (<TabsLineTriggerkey={tab.value}value={tab.value}- className="gap-1.5 px-2.5 py-2 text-sm leading-5 data-[state=active]:text-zinc-900"+ icon={tab.icon}>- <Icon icon={tab.icon} size={14} />{tab.label}</TabsLineTrigger>))}@@ -177,6 +193,7 @@ export default function ExpertDetailPage() {<TabsLineContent value="work"><ExpertWorkSectionexpertId={expert.id}+ expertName={expert.name}enabled={Boolean(enabled) && ready}/></TabsLineContent>@@ -197,8 +214,15 @@ export default function ExpertDetailPage() {<TabsLineContent value="workflows"><ExpertWorkflowsSection- expert={expert}+ expertName={expert.name}+ expertId={expert.id}+ workflows={expert.workflows}+ accentClassName={+ getRaisedExpertAccent(expert.role, expert.color).pill+ }+ coverColor={expert.color}onInstallWorkflow={openPicker}+ onAskWorkflow={openChatWithPrompt}/></TabsLineContent>@@ -244,6 +268,13 @@ export default function ExpertDetailPage() {expert={isSoulOpen ? expert : null}onClose={closeSoul}/>+ <ExpertChatDrawer+ target={isChatOpen ? expertToChatTarget(expert) : null}+ threadKey={chatDrawerKey}+ seedPrompt={chatSeed}+ onClose={closeChat}+ resumeLatest={false}+ /></div>);}diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/useExpertDetailPage.ts b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/useExpertDetailPage.tsindex dd8e76f029..ef62b1280c 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/useExpertDetailPage.ts+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/useExpertDetailPage.ts@@ -40,6 +40,9 @@ export function useExpertDetailPage({ expertId, enabled }: Args) {const [isFireOpen, setIsFireOpen] = useState(false);const [isSoulOpen, setIsSoulOpen] = useState(false);const [soulDrawerKey, setSoulDrawerKey] = useState(0);+ const [isChatOpen, setIsChatOpen] = useState(false);+ const [chatDrawerKey, setChatDrawerKey] = useState(0);+ const [chatSeed, setChatSeed] = useState<string | null>(null);const { mutate: resumeSchedules, isPending: isResuming } =useResumeExpertSchedules({@@ -80,6 +83,7 @@ export function useExpertDetailPage({ expertId, enabled }: Args) {setIsSoulOpen(false);return;}+ setIsChatOpen(false);setIsSoulOpen(true);setSoulDrawerKey((current) => current + 1);}@@ -88,6 +92,28 @@ export function useExpertDetailPage({ expertId, enabled }: Args) {setIsSoulOpen(false);}+ function toggleChat() {+ if (isChatOpen) {+ setIsChatOpen(false);+ return;+ }+ setIsSoulOpen(false);+ setIsChatOpen(true);+ setChatSeed(null);+ setChatDrawerKey((current) => current + 1);+ }++ function openChatWithPrompt(prompt: string) {+ setIsSoulOpen(false);+ setIsChatOpen(true);+ setChatSeed(prompt);+ setChatDrawerKey((current) => current + 1);+ }++ function closeChat() {+ setIsChatOpen(false);+ }+return {expert,isLoading: enabled && (expertQuery.isLoading || schedulesQuery.isLoading),@@ -112,5 +138,11 @@ export function useExpertDetailPage({ expertId, enabled }: Args) {soulDrawerKey,toggleSoul,closeSoul,+ isChatOpen,+ chatDrawerKey,+ chatSeed,+ toggleChat,+ openChatWithPrompt,+ closeChat,};}diff --git a/autogpt_platform/frontend/src/app/(platform)/team/__tests__/main.test.tsx b/autogpt_platform/frontend/src/app/(platform)/team/__tests__/main.test.tsxindex 04cc9e5e39..1452a50533 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/__tests__/main.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/__tests__/main.test.tsx@@ -22,6 +22,7 @@ import { Expert } from "@/app/api/__generated__/models/expert";import { ExpertPod } from "@/app/api/__generated__/models/expertPod";import { GraphExecutionJobInfo } from "@/app/api/__generated__/models/graphExecutionJobInfo";import { LibraryAgent } from "@/app/api/__generated__/models/libraryAgent";+import { getGetV2ListSessionsMockHandler200 } from "@/app/api/__generated__/endpoints/chat/chat.msw";import { server } from "@/mocks/mock-server";import {fireEvent,@@ -218,13 +219,16 @@ describe("TeamPage", () => {).toBeTruthy();});- test("header exposes New Expert and New Pod actions", async () => {+ test("header exposes Raise expert, Hire expert and New Pod actions", async () => {server.use(getListExpertsMockHandler([hiredMaria]));render(<TeamPage />);- const newExpert = await screen.findByRole("link", { name: "New Expert" });- expect(newExpert.getAttribute("href")).toBe("/raise");+ const raise = await screen.findByRole("link", { name: "Raise expert" });+ expect(raise.getAttribute("href")).toBe("/raise");+ expect(+ screen.getByRole("link", { name: "Hire expert" }).getAttribute("href"),+ ).toBe("/marketplace#experts");expect(screen.getByRole("button", { name: "New Pod" })).toBeDefined();});@@ -254,16 +258,43 @@ describe("TeamPage", () => {expect(link.getAttribute("href")).toBe("/team/expert-maria");});- test("links Chat to the expert's copilot thread", async () => {- server.use(getListExpertsMockHandler([hiredMaria]));+ test("opens an inline chat from the expert and Autopilot cards", async () => {+ server.use(+ getListExpertsMockHandler([hiredMaria]),+ getGetV2ListSessionsMockHandler200({ sessions: [], total: 0 }),+ );+ const user = userEvent.setup();render(<TeamPage />);await screen.findByText("Maria");- const chatLinks = screen.getAllByRole("link", { name: "Chat" });- const hrefs = chatLinks.map((link) => link.getAttribute("href"));- expect(hrefs).toContain("/copilot");- expect(hrefs).toContain(`/copilot?expertId=${hiredMaria.id}`);+ const [autopilotChat, mariaChat] = screen.getAllByRole("button", {+ name: "Chat",+ });++ await user.click(mariaChat);+ const mariaPanel = screen.getByRole("complementary", {+ name: "Chat with Maria",+ });+ expect(+ await within(mariaPanel).findByText("What can I do for you?"),+ ).toBeDefined();+ expect(+ within(mariaPanel).getByPlaceholderText("Message Maria…"),+ ).toBeDefined();++ await user.click(autopilotChat);+ const autopilotPanel = await screen.findByRole("complementary", {+ name: "Chat with Autopilot",+ });+ expect(+ within(autopilotPanel).getByPlaceholderText("Message Autopilot…"),+ ).toBeDefined();+ await waitFor(() => {+ expect(+ screen.queryByRole("complementary", { name: "Chat with Maria" }),+ ).toBeNull();+ });expect(screen.getByRole("button", { name: "Install workflow" }),@@ -862,7 +893,7 @@ describe("TeamPage", () => {expect(await screen.findByText("Something went wrong")).toBeDefined();});- test("groups experts under their pod with ungrouped members below", async () => {+ test("groups experts under their pod and leaves ungrouped members off the board", async () => {const user = userEvent.setup();const growthPod: ExpertPod = {id: "pod-growth",@@ -891,27 +922,56 @@ describe("TeamPage", () => {render(<TeamPage />);await openTab(user, "Pod board");- const podHeader = await screen.findByRole("heading", { name: "Growth" });- const maria = await screen.findByText("Maria");- const leeNode = await screen.findByText("Lee");- // Maria sits under the pod header; Lee is ungrouped below.- const noPodHeader = screen.getByRole("heading", { name: "Ungrouped" });+ const board = await screen.findByRole("region", { name: "Pods" });+ const podHeader = await within(board).findByRole("heading", {+ name: "Growth",+ });+ const maria = await within(board).findByText("Maria");expect(podHeader.compareDocumentPosition(maria) &Node.DOCUMENT_POSITION_FOLLOWING,).toBeTruthy();- expect(- maria.compareDocumentPosition(noPodHeader) &- Node.DOCUMENT_POSITION_FOLLOWING,- ).toBeTruthy();- expect(- noPodHeader.compareDocumentPosition(leeNode) &- Node.DOCUMENT_POSITION_FOLLOWING,- ).toBeTruthy();+ // Lee has no pod, so the board does not list him anywhere.+ expect(within(board).queryByText("Lee")).toBeNull();+ expect(screen.queryByRole("heading", { name: "Ungrouped" })).toBeNull();// Archived experts never render, even with a pod_id.expect(screen.queryByText("Sam")).toBeNull();});+ test("opens a pod to show its expert cards and returns to the board", async () => {+ const user = userEvent.setup();+ const growthPod: ExpertPod = {+ id: "pod-growth",+ name: "Growth",+ created_at: new Date("2026-08-14T00:00:00Z"),+ };+ const poddedMaria: Expert = { ...hiredMaria, pod_id: "pod-growth" };+ server.use(+ getListExpertsMockHandler([poddedMaria]),+ getListExpertPodsMockHandler([growthPod]),+ );++ render(<TeamPage />);+ await openTab(user, "Pod board");++ await user.click(+ await screen.findByRole("button", { name: "Open Growth pod" }),+ );+ const pod = screen.getByRole("region", { name: "Growth pod" });+ expect(+ within(pod)+ .getByRole("link", { name: "View Maria" })+ .getAttribute("href"),+ ).toBe("/team/expert-maria");+ expect(within(pod).getByRole("button", { name: "Chat" })).toBeDefined();++ await user.click(within(pod).getByRole("button", { name: "Back to pods" }));+ expect(screen.getByRole("region", { name: "Pods" })).toBeDefined();+ expect(+ screen.getByRole("button", { name: "Open Growth pod" }),+ ).toBeDefined();+ });+test("shows a pod with no members instead of hiding it", async () => {const user = userEvent.setup();const emptyPod: ExpertPod = {@@ -933,8 +993,9 @@ describe("TeamPage", () => {podHeader.compareDocumentPosition(emptyCopy) &Node.DOCUMENT_POSITION_FOLLOWING,).toBeTruthy();- // The unpodded expert still renders under its own section.- expect(await screen.findByText("Maria")).toBeDefined();+ // The unpodded expert is not listed on the board.+ const board = screen.getByRole("region", { name: "Pods" });+ expect(within(board).queryByText("Maria")).toBeNull();});test("creates a pod from the New pod dialog", async () => {diff --git a/autogpt_platform/frontend/src/app/(platform)/team/__tests__/tabs.test.tsx b/autogpt_platform/frontend/src/app/(platform)/team/__tests__/tabs.test.tsxindex 2b4739b6d9..f12ab80e5a 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/__tests__/tabs.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/__tests__/tabs.test.tsx@@ -122,18 +122,18 @@ describe("TeamPage tabs", () => {expect(await screen.findByText("No pods yet")).toBeDefined();});- test("Pod board still shows ungrouped experts when there are no pods", async () => {+ test("Pod board lists only pods, never an ungrouped bucket", async () => {const user = userEvent.setup();server.use(getListExpertsMockHandler([maria]));render(<TeamPage />);await user.click(await screen.findByRole("tab", { name: "Pod board" }));- expect(- await screen.findByRole("heading", { name: "Ungrouped" }),- ).toBeDefined();- expect(screen.getByText("Maria")).toBeDefined();- expect(screen.queryByText("No pods yet")).toBeNull();+ const board = await screen.findByRole("region", { name: "Pods" });+ expect(within(board).getByRole("heading", { name: "Pods" })).toBeDefined();+ expect(within(board).getByText("No pods yet")).toBeDefined();+ expect(screen.queryByRole("heading", { name: "Ungrouped" })).toBeNull();+ expect(within(board).queryByText("Maria")).toBeNull();});});@@ -256,10 +256,8 @@ describe("AutopilotCard", () => {expect(within(autopilot).getByText("Built in")).toBeDefined();expect(within(autopilot).queryByText("Budget")).toBeNull();expect(- within(autopilot)- .getByRole("link", { name: "Chat" })- .getAttribute("href"),- ).toBe("/copilot");+ within(autopilot).getByRole("button", { name: "Chat" }),+ ).toBeDefined();expect(within(autopilot).queryByRole("link", { name: "Edit" })).toBeNull();});diff --git a/autogpt_platform/frontend/src/app/(platform)/team/autopilot/__tests__/main.test.tsx b/autogpt_platform/frontend/src/app/(platform)/team/autopilot/__tests__/main.test.tsxindex f58bba416d..f7e4659e08 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/autopilot/__tests__/main.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/autopilot/__tests__/main.test.tsx@@ -1,5 +1,12 @@import { getListExpertsMockHandler } from "@/app/api/__generated__/endpoints/experts/experts.msw";+import {+ getGetV2GetLibraryAgentMockHandler200,+ getGetV2ListLibraryAgentsMockHandler200,+} from "@/app/api/__generated__/endpoints/library/library.msw";import { getGetV1ListExecutionSchedulesForAUserMockHandler } from "@/app/api/__generated__/endpoints/schedules/schedules.msw";+import { getListCopilotSkillsMockHandler200 } from "@/app/api/__generated__/endpoints/skills/skills.msw";+import { LibraryAgent } from "@/app/api/__generated__/models/libraryAgent";+import { LibraryAgentResponse } from "@/app/api/__generated__/models/libraryAgentResponse";import { Expert } from "@/app/api/__generated__/models/expert";import { GraphExecutionJobInfo } from "@/app/api/__generated__/models/graphExecutionJobInfo";import { server } from "@/mocks/mock-server";@@ -131,12 +138,56 @@ const straySchedule: GraphExecutionJobInfo = {expert_id: null,};-/** Reads the value of one of the summary's stat columns by its label. */-function getStatValue(container: HTMLElement, label: string) {- const column = within(container).getByText(label).closest("div");- return column?.querySelector("dd")?.textContent;+function makeLibraryAgent(over: Partial<LibraryAgent>): LibraryAgent {+ return {+ id: "lib-free",+ graph_id: "graph-free",+ graph_version: 1,+ name: "Inbox Triage",+ description: "Sorts the morning mail",+ creator_name: "You",+ image_url: null,+ marketplace_listing: null,+ execution_count: 3,+ ...over,+ } as unknown as LibraryAgent;}+/** Maria owns this one, so it is hers and not Autopilot's. */+const mariasAgent = makeLibraryAgent({+ id: "lib-1",+ graph_id: "graph-1",+ name: "Content Calendar",+});++const freeAgent = makeLibraryAgent({});++const strayAgent = makeLibraryAgent({+ id: "lib-stray",+ graph_id: "graph-stray",+ name: "Nobody's Job",+ description: "",+});++function libraryResponse(agents: LibraryAgent[]): LibraryAgentResponse {+ return {+ agents,+ pagination: {+ total_items: agents.length,+ total_pages: 1,+ current_page: 1,+ page_size: 100,+ },+ } as LibraryAgentResponse;+}++const librarySkills = [+ { name: "SEO", description: "Rank pages", triggers: [] },+ { name: "Research", description: "Dig up sources", triggers: ["find"] },+ { name: "Analytics", description: "Read the numbers", triggers: [] },+ { name: "Bookkeeping", description: "Balance the books", triggers: [] },+];+beforeEach(() => {server.use(getListExpertsMockHandler([maria, lee, firedSam]),@@ -144,6 +195,11 @@ beforeEach(() => {mariaSchedule,straySchedule,]),+ getGetV2ListLibraryAgentsMockHandler200(+ libraryResponse([mariasAgent, freeAgent, strayAgent]),+ ),+ getGetV2GetLibraryAgentMockHandler200(freeAgent),+ getListCopilotSkillsMockHandler200(librarySkills),);});@@ -176,29 +232,6 @@ describe("AutopilotPage", () => {).toBe("/team");});- test("sums the hired team in the summary and links each expert", async () => {- render(<AutopilotPage />);-- const summary = await screen.findByRole("complementary", {- name: "Team at a glance",- });- // Sam is fired, so the roster is two experts.- expect(getStatValue(summary, "Experts")).toBe("2");- // Only Maria's schedule belongs to the team; the stray one is ignored.- expect(getStatValue(summary, "Schedules")).toBe("1");- // Copywriting is shared, so three skills — and Sam's Ghostwriting is out.- expect(getStatValue(summary, "Skills")).toBe("3");- expect(getStatValue(summary, "Workflows")).toBe("2");-- expect(- within(summary).getByRole("link", { name: /Maria/ }).getAttribute("href"),- ).toBe("/team/expert-maria");- expect(- within(summary).getByRole("link", { name: /Lee/ }).getAttribute("href"),- ).toBe("/team/expert-lee");- expect(within(summary).queryByText("Sam")).toBeNull();- });-test("lists the team's schedules", async () => {render(<AutopilotPage />);await screen.findByRole("heading", { name: "Autopilot" });@@ -211,58 +244,92 @@ describe("AutopilotPage", () => {expect(within(list).queryByText("Nobody's Job")).toBeNull();});- test("groups workflows by the expert who owns them", async () => {+ test("lists the library workflows no expert owns as Autopilot's", async () => {render(<AutopilotPage />);await screen.findByRole("heading", { name: "Autopilot" });await openTab("Workflows");- const group = screen.getByRole("region", { name: "Maria workflows" });+ expect(screen.getByText("Autopilot's Workflows")).toBeDefined();+ const rows = await screen.findAllByTestId("expert-workflow-row");+ expect(+ rows.map((row) => within(row).getByText(/Job|Triage/).textContent),+ ).toEqual(["Inbox Triage", "Nobody's Job"]);+ // The stray schedule's graph gives its workflow a cadence.+ expect(within(rows[1]).getByText(/Every day at 07:40/)).toBeDefined();+ // Maria's Content Calendar is hers, not Autopilot's.+ expect(screen.queryByText("Content Calendar")).toBeNull();expect(- within(group).getByRole("link", { name: /Maria/ }).getAttribute("href"),- ).toBe("/team/expert-maria");- const rows = within(group).getAllByTestId("autopilot-workflow-row");- expect(rows).toHaveLength(2);- expect(within(rows[0]).getByText("Content Calendar")).toBeDefined();- expect(within(rows[0]).getByText(/Every day at 07:40/)).toBeDefined();- expect(within(rows[1]).getByText("SEO Audit")).toBeDefined();- expect(within(rows[1]).getByText("Needs setup")).toBeDefined();- // Lee has no workflows, so gets no group.- expect(screen.queryByRole("region", { name: "Lee workflows" })).toBeNull();+ screen.queryByRole("button", { name: "Install workflow" }),+ ).toBeNull();+ expect(+ within(rows[0])+ .getByRole("link", { name: "Ask about this workflow" })+ .getAttribute("href"),+ ).toContain("/copilot?autosubmit=true");});- test("shows the team's skills de-duplicated and sorted", async () => {+ test("keeps loading library pages so a second-page workflow still counts as Autopilot's", async () => {+ const pagesRequested: string[] = [];+ server.use(+ getGetV2ListLibraryAgentsMockHandler200(({ request }) => {+ const page = new URL(request.url).searchParams.get("page") ?? "1";+ pagesRequested.push(page);+ const agents = page === "2" ? [strayAgent] : [mariasAgent, freeAgent];+ return {+ ...libraryResponse(agents),+ pagination: {+ total_items: 3,+ total_pages: 2,+ current_page: Number(page),+ page_size: 2,+ },+ } as LibraryAgentResponse;+ }),+ );++ render(<AutopilotPage />);+ await screen.findByRole("heading", { name: "Autopilot" });+ await openTab("Workflows");++ expect(await screen.findByText("Nobody's Job")).toBeDefined();+ expect(pagesRequested).toEqual(["1", "2"]);+ });++ test("lists the library skills no expert has claimed as Autopilot's", async () => {render(<AutopilotPage />);await screen.findByRole("heading", { name: "Autopilot" });await openTab("Skills");- const panel = screen.getByRole("tabpanel");- const skills = within(panel)- .getAllByText(/^(Analytics|Copywriting|SEO|Ghostwriting)$/)- .map((node) => node.textContent);- expect(skills).toEqual(["Analytics", "Copywriting", "SEO"]);+ expect(screen.getByText("Autopilot's Skills")).toBeDefined();+ const list = screen.getByRole("list", { name: "Autopilot skills" });+ const rows = within(list).getAllByTestId("expert-skill-row");+ expect(+ rows.map(+ (row) => within(row).getByText(/^(Bookkeeping|Research)$/).textContent,+ ),+ ).toEqual(["Bookkeeping", "Research"]);+ expect(within(list).getByText("Dig up sources")).toBeDefined();+ expect(within(list).queryByRole("button", { name: /Remove/ })).toBeNull();});test("tells you when the team has nothing set up yet", async () => {server.use(getListExpertsMockHandler([]),getGetV1ListExecutionSchedulesForAUserMockHandler([]),+ getGetV2ListLibraryAgentsMockHandler200(libraryResponse([])),+ getListCopilotSkillsMockHandler200([]),);render(<AutopilotPage />);-- const summary = await screen.findByRole("complementary", {- name: "Team at a glance",- });- expect(getStatValue(summary, "Experts")).toBe("0");- expect(within(summary).getByText(/No experts hired yet/)).toBeDefined();+ await screen.findByRole("heading", { name: "Autopilot" });await openTab("Workflows");expect(screen.getByText(/No workflows yet/)).toBeDefined();await openTab("Skills");- expect(screen.getByText(/No skills listed yet/)).toBeDefined();+ expect(screen.getByText(/No skills yet/)).toBeDefined();await openTab("Schedules");expect(screen.getByText(/No schedules yet/)).toBeDefined();diff --git a/autogpt_platform/frontend/src/app/(platform)/team/autopilot/components/AutopilotAboutSection.tsx b/autogpt_platform/frontend/src/app/(platform)/team/autopilot/components/AutopilotAboutSection.tsxindex 70bcd74aea..84eca7ac87 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/autopilot/components/AutopilotAboutSection.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/autopilot/components/AutopilotAboutSection.tsx@@ -1,6 +1,8 @@+import { Text } from "@/components/atoms/Text/Text";import { AUTOPILOT_BLURB } from "../../helpers";const ENTRIES = [+ { label: "Bio", value: AUTOPILOT_BLURB },{label: "Identity",value:@@ -21,17 +23,15 @@ const ENTRIES = [export function AutopilotAboutSection() {return (<section className="space-y-5">- <p className="text-base leading-relaxed text-zinc-600">- {AUTOPILOT_BLURB}- </p>-- <dl className="space-y-5">+ <dl className="space-y-4">{ENTRIES.map((entry) => (<div key={entry.label}>- <dt className="text-sm font-medium text-zinc-900">{entry.label}</dt>- <dd className="mt-1 text-base leading-relaxed text-zinc-600">+ <Text variant="body-medium" as="dt" tone="primary">+ {entry.label}+ </Text>+ <Text variant="body" as="dd" tone="secondary" className="mt-1">{entry.value}- </dd>+ </Text></div>))}</dl>diff --git a/autogpt_platform/frontend/src/app/(platform)/team/autopilot/components/AutopilotHeader.tsx b/autogpt_platform/frontend/src/app/(platform)/team/autopilot/components/AutopilotHeader.tsxindex 908bb6bd47..4c872ce8aa 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/autopilot/components/AutopilotHeader.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/autopilot/components/AutopilotHeader.tsx@@ -1,19 +1,16 @@import { AutoGPTLogo } from "@/components/atoms/AutoGPTLogo/AutoGPTLogo";import { Button } from "@/components/atoms/Button/Button";import { Icon } from "@/components/atoms/Icon/Icon";+import { Text } from "@/components/atoms/Text/Text";import { SparklesIcon } from "@hugeicons/core-free-icons";import { ExpertCover } from "../../components/ExpertTeamCard/components/ExpertCover";-import { AUTOPILOT_ROLE, ACTION_BUTTON_CLASS } from "../../helpers";+import { cn } from "@/lib/utils";+import { AUTOPILOT_PILL_CLASS, AUTOPILOT_ROLE } from "../../helpers";export function AutopilotHeader() {return (<header>- <ExpertCover- className="h-36"- color={undefined}- src="/experts/covers/autopilot.jpg"- status="built-in"- />+ <ExpertCover className="h-36" color={undefined} status="built-in" /><div className="flex flex-col gap-4 sm:flex-row sm:items-center"><span className="relative z-10 -mt-12 ml-14 flex size-24 shrink-0 items-center justify-center rounded-full bg-white ring-4 ring-white">@@ -24,21 +21,25 @@ export function AutopilotHeader() {<h1 className="text-2xl font-semibold tracking-[-0.02em] text-zinc-900">Autopilot</h1>- <span className="inline-flex items-center gap-1.5 rounded-md border border-zinc-200 bg-zinc-50 px-2.5 py-0.5 text-sm font-medium text-zinc-700">+ <Text+ variant="body-medium"+ as="span"+ className={cn(+ "inline-flex items-center gap-1.5 rounded-md px-2.5 py-0.5",+ AUTOPILOT_PILL_CLASS,+ )}+ ><Icon icon={SparklesIcon} size={14} />{AUTOPILOT_ROLE}- </span>+ </Text></div>- <p className="mt-1 text-sm text-zinc-500">- Built in, always on your team.- </p></div><Buttonas="NextLink"href="/copilot"variant="primary"- size="small"- className={`${ACTION_BUTTON_CLASS} shrink-0`}+ size="xs"+ className="shrink-0">Chat</Button>diff --git a/autogpt_platform/frontend/src/app/(platform)/team/autopilot/components/AutopilotSkillsSection.tsx b/autogpt_platform/frontend/src/app/(platform)/team/autopilot/components/AutopilotSkillsSection.tsxnew file mode 100644index 0000000000..f016f45e01--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/team/autopilot/components/AutopilotSkillsSection.tsx@@ -0,0 +1,62 @@+"use client";++import { CopilotSkillInfo } from "@/app/api/__generated__/models/copilotSkillInfo";+import { Text } from "@/components/atoms/Text/Text";+import { SearchInput } from "@/components/molecules/SearchInput/SearchInput";+import { useState } from "react";+import { ExpertSkillListItem } from "../../[expertId]/components/ExpertSkillListItem";+import { AUTOPILOT_PILL_CLASS } from "../../helpers";++interface Props {+ skills: CopilotSkillInfo[];+}++export function AutopilotSkillsSection({ skills }: Props) {+ const [query, setQuery] = useState("");+ const needle = query.trim().toLowerCase();+ const visible = needle+ ? skills.filter(+ (skill) =>+ skill.name.toLowerCase().includes(needle) ||+ skill.description.toLowerCase().includes(needle),+ )+ : skills;++ return (+ <section>+ <div className="mb-2.5 flex flex-wrap items-center justify-between gap-3">+ <Text variant="body-medium" tone="primary">+ Autopilot's Skills+ </Text>+ <SearchInput+ size="xsmall"+ value={query}+ onChange={setQuery}+ placeholder="Search skills"+ className="w-48"+ />+ </div>+ {skills.length === 0 ? (+ <Text variant="body" tone="muted" className="pt-4">+ No skills yet. Skills in your library that no expert has claimed show+ up here.+ </Text>+ ) : visible.length === 0 ? (+ <Text variant="body" tone="muted" className="pt-4">+ No skills match.+ </Text>+ ) : (+ <ul className="flex flex-col gap-3 pt-4" aria-label="Autopilot skills">+ {visible.map((skill) => (+ <li key={skill.name}>+ <ExpertSkillListItem+ entry={{ name: skill.name, library: skill }}+ accentClassName={AUTOPILOT_PILL_CLASS}+ />+ </li>+ ))}+ </ul>+ )}+ </section>+ );+}diff --git a/autogpt_platform/frontend/src/app/(platform)/team/autopilot/components/AutopilotSummaryCard.tsx b/autogpt_platform/frontend/src/app/(platform)/team/autopilot/components/AutopilotSummaryCard.tsxdeleted file mode 100644index f815d869ca..0000000000--- a/autogpt_platform/frontend/src/app/(platform)/team/autopilot/components/AutopilotSummaryCard.tsx+++ /dev/null@@ -1,64 +0,0 @@-import { Expert } from "@/app/api/__generated__/models/expert";-import { Text } from "@/components/atoms/Text/Text";-import Link from "next/link";-import { CardStat, CardStats } from "../../components/CardStats";--interface Props {- experts: Expert[];- scheduleCount: number;- skillCount: number;- workflowCount: number;-}--export function AutopilotSummaryCard({- experts,- scheduleCount,- skillCount,- workflowCount,-}: Props) {- return (- <aside- aria-label="Team at a glance"- className="flex flex-col gap-4 self-start rounded-xl border border-zinc-200 bg-white p-4"- >- <Text variant="large-medium" className="text-base text-zinc-700">- Team at a glance- </Text>- <CardStats>- <CardStat label="Experts">{experts.length}</CardStat>- <CardStat label="Schedules">{scheduleCount}</CardStat>- <CardStat label="Skills">{skillCount}</CardStat>- <CardStat label="Workflows">{workflowCount}</CardStat>- </CardStats>-- <section- aria-label="Experts Autopilot works with"- className="flex flex-col gap-2 border-t border-zinc-100 pt-4"- >- {experts.length === 0 ? (- <Text variant="small" className="text-zinc-500">- No experts hired yet. Autopilot works alone until you hire one.- </Text>- ) : (- <ul className="flex flex-col gap-1">- {experts.map((expert) => (- <li key={expert.id}>- <Link- href={`/team/${expert.id}`}- className="flex items-baseline justify-between gap-2 rounded-md px-2 py-1.5 hover:bg-zinc-50"- >- <span className="truncate text-sm font-medium text-zinc-800">- {expert.name}- </span>- <span className="truncate text-xs text-zinc-500">- {expert.role}- </span>- </Link>- </li>- ))}- </ul>- )}- </section>- </aside>- );-}diff --git a/autogpt_platform/frontend/src/app/(platform)/team/autopilot/components/AutopilotWorkflowsSection.tsx b/autogpt_platform/frontend/src/app/(platform)/team/autopilot/components/AutopilotWorkflowsSection.tsxdeleted file mode 100644index 41712b1c90..0000000000--- a/autogpt_platform/frontend/src/app/(platform)/team/autopilot/components/AutopilotWorkflowsSection.tsx+++ /dev/null@@ -1,74 +0,0 @@-import { Expert } from "@/app/api/__generated__/models/expert";-import { Badge } from "@/components/atoms/Badge/Badge";-import { Icon } from "@/components/atoms/Icon/Icon";-import { safeHumanizeCronExpression } from "@/lib/cron-expression-utils";-import { FlashIcon } from "@hugeicons/core-free-icons";-import Link from "next/link";-import { workflowNeedsSetup } from "../../helpers";--interface Props {- experts: Expert[];-}--export function AutopilotWorkflowsSection({ experts }: Props) {- const owners = experts.filter((expert) => expert.workflows.length > 0);-- if (owners.length === 0) {- return (- <p className="text-sm text-zinc-500">- No workflows yet. Install one on an expert to give Autopilot something- to run.- </p>- );- }-- return (- <div className="space-y-5">- {owners.map((expert) => (- <section key={expert.id} aria-label={`${expert.name} workflows`}>- <Link- href={`/team/${expert.id}`}- className="mb-2 inline-flex items-baseline gap-2 text-sm hover:underline"- >- <span className="font-medium text-zinc-900">{expert.name}</span>- <span className="text-zinc-500">{expert.role}</span>- </Link>- <div className="divide-y divide-zinc-100 rounded-lg border border-zinc-200/80 bg-white">- {expert.workflows.map((workflow) => (- <div- key={workflow.id}- className="flex items-center gap-3 px-4 py-3"- data-testid="autopilot-workflow-row"- >- <Icon- icon={FlashIcon}- size={18}- className="shrink-0 text-zinc-500"- />- <div className="min-w-0 flex-1">- <div className="text-[15px] font-medium text-zinc-800">- {workflow.name ?? "Unnamed workflow"}- </div>- {workflow.description ? (- <div className="line-clamp-1 text-xs text-zinc-500">- {workflow.description}- </div>- ) : null}- </div>- {workflowNeedsSetup(workflow) ? (- <Badge variant="warning" size="small" className="shrink-0">- Needs setup- </Badge>- ) : workflow.schedule_cron ? (- <Badge variant="info" size="small" className="shrink-0">- {safeHumanizeCronExpression(workflow.schedule_cron)}- </Badge>- ) : null}- </div>- ))}- </div>- </section>- ))}- </div>- );-}diff --git a/autogpt_platform/frontend/src/app/(platform)/team/autopilot/components/TeamSkillsSection.tsx b/autogpt_platform/frontend/src/app/(platform)/team/autopilot/components/TeamSkillsSection.tsxdeleted file mode 100644index ff0a0d332a..0000000000--- a/autogpt_platform/frontend/src/app/(platform)/team/autopilot/components/TeamSkillsSection.tsx+++ /dev/null@@ -1,30 +0,0 @@-"use client";--interface Props {- expertName: string;- skills: string[];-}--export function TeamSkillsSection({ expertName, skills }: Props) {- if (skills.length === 0) {- return (- <p className="text-sm text-zinc-500">- No skills listed yet. {expertName} picks these up from the workflows you- install.- </p>- );- }-- return (- <div className="flex flex-wrap gap-2">- {skills.map((skill) => (- <span- key={skill}- className="rounded-full bg-zinc-50 px-3 py-1.5 text-sm text-zinc-600 ring-1 ring-inset ring-zinc-200/80"- >- {skill}- </span>- ))}- </div>- );-}diff --git a/autogpt_platform/frontend/src/app/(platform)/team/autopilot/page.tsx b/autogpt_platform/frontend/src/app/(platform)/team/autopilot/page.tsxindex 0cec8d170c..a524804502 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/autopilot/page.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/autopilot/page.tsx@@ -1,7 +1,7 @@"use client";-import { Icon } from "@/components/atoms/Icon/Icon";import { Skeleton } from "@/components/atoms/Skeleton/Skeleton";+import { Text } from "@/components/atoms/Text/Text";import { ErrorCard } from "@/components/molecules/ErrorCard/ErrorCard";import {TabsLine,@@ -18,12 +18,12 @@ import {} from "@hugeicons/core-free-icons";import { notFound } from "next/navigation";import { ExpertSchedulesSection } from "../[expertId]/components/ExpertSchedulesSection";-import { TeamSkillsSection } from "./components/TeamSkillsSection";+import { ExpertWorkflowsSection } from "../[expertId]/components/ExpertWorkflowsSection";import { BackToTeamLink } from "../components/BackToTeamLink";+import { AUTOPILOT_PILL_CLASS } from "../helpers";import { AutopilotAboutSection } from "./components/AutopilotAboutSection";import { AutopilotHeader } from "./components/AutopilotHeader";-import { AutopilotSummaryCard } from "./components/AutopilotSummaryCard";-import { AutopilotWorkflowsSection } from "./components/AutopilotWorkflowsSection";+import { AutopilotSkillsSection } from "./components/AutopilotSkillsSection";import { useAutopilotPage } from "./useAutopilotPage";const MAIN_CLASS =@@ -38,7 +38,7 @@ const TABS = [export default function AutopilotPage() {const { enabled, ready } = useFlagStatus(Flag.HIRE_EXPERTS);- const { experts, schedules, skills, isLoading, isError, refetch } =+ const { schedules, workflows, skills, isLoading, isError, refetch } =useAutopilotPage({ enabled: Boolean(enabled) && ready });if (!ready || isLoading) {@@ -68,44 +68,26 @@ export default function AutopilotPage() {);}- const workflowCount = experts.reduce(- (total, expert) => total + expert.workflows.length,- 0,- );-return (<main className={MAIN_CLASS}><BackToTeamLink /><AutopilotHeader />- <TabsLine defaultValue="basics">- <TabsLineList- flush- className="overflow-x-auto"- indicatorClassName="bg-zinc-900"- >+ <Text variant="body" tone="muted">+ Built in, always on your team.+ </Text>++ <TabsLine variant="compact" defaultValue="basics">+ <TabsLineList className="overflow-x-auto">{TABS.map((tab) => (- <TabsLineTrigger- key={tab.value}- value={tab.value}- className="gap-1.5 px-2.5 py-2 text-xs leading-5 data-[state=active]:text-zinc-900"- >- <Icon icon={tab.icon} size={14} />+ <TabsLineTrigger key={tab.value} value={tab.value} icon={tab.icon}>{tab.label}</TabsLineTrigger>))}</TabsLineList><TabsLineContent value="basics">- <div className="grid gap-4 lg:grid-cols-[3fr_1fr]">- <AutopilotAboutSection />- <AutopilotSummaryCard- experts={experts}- scheduleCount={schedules.length}- skillCount={skills.length}- workflowCount={workflowCount}- />- </div>+ <AutopilotAboutSection /></TabsLineContent><TabsLineContent value="schedules">@@ -118,11 +100,16 @@ export default function AutopilotPage() {</TabsLineContent><TabsLineContent value="workflows">- <AutopilotWorkflowsSection experts={experts} />+ <ExpertWorkflowsSection+ expertName="Autopilot"+ workflows={workflows}+ accentClassName={AUTOPILOT_PILL_CLASS}+ emptyMessage="No workflows yet. Workflows in your library that no expert owns show up here."+ /></TabsLineContent><TabsLineContent value="skills">- <TeamSkillsSection expertName="Autopilot" skills={skills} />+ <AutopilotSkillsSection skills={skills} /></TabsLineContent></TabsLine></main>diff --git a/autogpt_platform/frontend/src/app/(platform)/team/autopilot/useAutopilotPage.ts b/autogpt_platform/frontend/src/app/(platform)/team/autopilot/useAutopilotPage.tsindex d80a0ed869..92d14c9a54 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/autopilot/useAutopilotPage.ts+++ b/autogpt_platform/frontend/src/app/(platform)/team/autopilot/useAutopilotPage.ts@@ -1,8 +1,20 @@import { useListExperts } from "@/app/api/__generated__/endpoints/experts/experts";+import { useGetV2ListLibraryAgentsInfinite } from "@/app/api/__generated__/endpoints/library/library";import { useGetV1ListExecutionSchedulesForAUser } from "@/app/api/__generated__/endpoints/schedules/schedules";+import { useListCopilotSkills } from "@/app/api/__generated__/endpoints/skills/skills";import { Expert } from "@/app/api/__generated__/models/expert";-import { okData } from "@/app/api/helpers";-import { getHiredExperts, getTeamSchedules, getTeamSkills } from "../helpers";+import {+ getPaginationNextPageNumber,+ okData,+ unpaginate,+} from "@/app/api/helpers";+import {+ getAutopilotSkills,+ getAutopilotWorkflows,+ getHiredExperts,+ getTeamSchedules,+} from "../helpers";+import { useEffect } from "react";interface Args {enabled: boolean;@@ -15,20 +27,50 @@ export function useAutopilotPage({ enabled }: Args) {const schedulesQuery = useGetV1ListExecutionSchedulesForAUser({query: { select: (res) => okData(res) ?? [], enabled },});+ const libraryQuery = useGetV2ListLibraryAgentsInfinite(+ { page: 1, page_size: 100, is_hidden: false },+ { query: { getNextPageParam: getPaginationNextPageNumber, enabled } },+ );+ const skillsQuery = useListCopilotSkills({+ query: { select: (res) => okData(res) ?? [], enabled },+ });++ // Autopilot owns every library workflow no expert has claimed, so the+ // whole library has to be in hand before the split is derived.+ const { hasNextPage, isFetchingNextPage, fetchNextPage } = libraryQuery;+ useEffect(() => {+ if (hasNextPage && !isFetchingNextPage) void fetchNextPage();+ }, [hasNextPage, isFetchingNextPage, fetchNextPage]);const experts = getHiredExperts(expertsQuery.data ?? []);- const schedules = getTeamSchedules(experts, schedulesQuery.data ?? []);- const skills = getTeamSkills(experts);+ const allSchedules = schedulesQuery.data ?? [];+ const schedules = getTeamSchedules(experts, allSchedules);+ const libraryAgents = libraryQuery.data+ ? unpaginate(libraryQuery.data, "agents")+ : [];+ const workflows = getAutopilotWorkflows(experts, libraryAgents, allSchedules);+ const skills = getAutopilotSkills(experts, skillsQuery.data ?? []);function refetch() {- return Promise.all([expertsQuery.refetch(), schedulesQuery.refetch()]);+ return Promise.all([+ expertsQuery.refetch(),+ schedulesQuery.refetch(),+ libraryQuery.refetch(),+ skillsQuery.refetch(),+ ]);}return {experts,schedules,+ workflows,skills,- isLoading: enabled && (expertsQuery.isLoading || schedulesQuery.isLoading),+ isLoading:+ enabled &&+ (expertsQuery.isLoading ||+ schedulesQuery.isLoading ||+ libraryQuery.isLoading ||+ skillsQuery.isLoading),isError: expertsQuery.isError || schedulesQuery.isError,refetch,};diff --git a/autogpt_platform/frontend/src/app/(platform)/team/components/AutopilotCard.tsx b/autogpt_platform/frontend/src/app/(platform)/team/components/AutopilotCard.tsxindex 4011082a64..71e64fc5ff 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/components/AutopilotCard.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/components/AutopilotCard.tsx@@ -1,14 +1,9 @@import { AutoGPTLogo } from "@/components/atoms/AutoGPTLogo/AutoGPTLogo";import { Button } from "@/components/atoms/Button/Button";-import { Icon } from "@/components/atoms/Icon/Icon";import { Text } from "@/components/atoms/Text/Text";-import { PencilEdit02Icon } from "@hugeicons/core-free-icons";+import { BubbleChatIcon } from "@hugeicons/core-free-icons";import Link from "next/link";-import {- AUTOPILOT_BLURB,- AUTOPILOT_ROLE,- ACTION_BUTTON_CLASS,-} from "../helpers";+import { AUTOPILOT_BLURB, AUTOPILOT_ROLE } from "../helpers";import { CardStat, CardStats } from "./CardStats";import { ExpertCover } from "./ExpertTeamCard/components/ExpertCover";@@ -16,12 +11,14 @@ interface Props {skillCount: number;scheduleCount: number;workflowCount: number;+ onChat: () => void;}export function AutopilotCard({skillCount,scheduleCount,workflowCount,+ onChat,}: Props) {return (<section@@ -33,11 +30,7 @@ export function AutopilotCard({aria-label="View Autopilot"className="flex flex-1 flex-col items-start p-2 pb-4">- <ExpertCover- color={undefined}- src="/experts/covers/autopilot.jpg"- status="built-in"- />+ <ExpertCover color={undefined} status="built-in" /><div className="flex w-full items-start gap-3 px-2"><span className="relative z-10 -mt-11 ml-1 flex size-[5.25rem] shrink-0 items-center justify-center rounded-full bg-white ring-4 ring-white">@@ -46,13 +39,17 @@ export function AutopilotCard({</div><div className="mt-2 flex w-full flex-col items-start gap-1 px-2 pl-5 text-left">- <Text variant="h4" className="w-full truncate pb-1">+ <Text+ variant="lead-medium"+ tone="primary"+ className="w-full truncate pb-1"+ >Autopilot</Text>- <Text variant="body" className="text-zinc-500">+ <Text variant="body" tone="muted">{AUTOPILOT_ROLE}</Text>- <Text variant="body" className="mt-1 line-clamp-3 text-zinc-500">+ <Text variant="body" tone="muted" className="mt-1 line-clamp-3">{AUTOPILOT_BLURB}</Text></div>@@ -68,12 +65,11 @@ export function AutopilotCard({<div className="flex items-center gap-2 px-4 pb-4"><Button- as="NextLink"- href="/copilot"variant="secondary"- size="small"- className={`${ACTION_BUTTON_CLASS} flex-1`}- leftIcon={<Icon icon={PencilEdit02Icon} size={14} />}+ size="xs"+ className="flex-1"+ leadingIcon={BubbleChatIcon}+ onClick={onChat}>Chat</Button>diff --git a/autogpt_platform/frontend/src/app/(platform)/team/components/BackToTeamLink.tsx b/autogpt_platform/frontend/src/app/(platform)/team/components/BackToTeamLink.tsxindex 81f779d8a1..7f31db3733 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/components/BackToTeamLink.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/components/BackToTeamLink.tsx@@ -1,4 +1,5 @@import { Icon } from "@/components/atoms/Icon/Icon";+import { Text } from "@/components/atoms/Text/Text";import { ArrowLeft02Icon } from "@hugeicons/core-free-icons";import Link from "next/link";@@ -6,11 +7,18 @@ export function BackToTeamLink() {return (<Linkhref="/team"- className="inline-flex items-center gap-1 text-sm text-zinc-500 hover:text-zinc-800"+ className="group inline-flex items-center gap-1 text-zinc-500 hover:text-zinc-800"data-testid="expert-back-to-team"><Icon icon={ArrowLeft02Icon} size={14} />- Back to Team+ <Text+ variant="body"+ as="span"+ tone="muted"+ className="group-hover:text-zinc-800"+ >+ Back to Team+ </Text></Link>);}diff --git a/autogpt_platform/frontend/src/app/(platform)/team/components/CardStats.tsx b/autogpt_platform/frontend/src/app/(platform)/team/components/CardStats.tsxindex 534726c1a2..41a371fb8b 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/components/CardStats.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/components/CardStats.tsx@@ -29,20 +29,23 @@ interface StatProps {export function CardStat({ label, children }: StatProps) {return (<div className="flex min-w-0 flex-1 flex-col items-center gap-0.5 text-center">- <dt className="order-2 w-full">- <Text variant="small" className="truncate text-zinc-500">- {label}- </Text>- </dt>- <dd className="order-1">- <Text- variant="large-semibold"- unmask={false}- className="tabular-nums text-zinc-900"- >- {children}- </Text>- </dd>+ <Text+ variant="small"+ as="dt"+ tone="muted"+ className="order-2 w-full truncate"+ >+ {label}+ </Text>+ <Text+ variant="large-semibold"+ as="dd"+ tone="primary"+ unmask={false}+ className="order-1 tabular-nums"+ >+ {children}+ </Text></div>);}diff --git a/autogpt_platform/frontend/src/app/(platform)/team/components/EmptyTeamState.tsx b/autogpt_platform/frontend/src/app/(platform)/team/components/EmptyTeamState.tsxindex 3274c4963b..e82fc70eae 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/components/EmptyTeamState.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/components/EmptyTeamState.tsx@@ -2,34 +2,23 @@ import { Button } from "@/components/atoms/Button/Button";import { Text } from "@/components/atoms/Text/Text";import { UserGroupIcon } from "@hugeicons/core-free-icons";import { Icon } from "@/components/atoms/Icon/Icon";-import { ACTION_BUTTON_CLASS } from "@/app/(platform)/team/helpers";export function EmptyTeamState() {return (<div className="flex flex-col items-center gap-3 rounded-xl border border-dashed border-zinc-300 bg-white p-8 text-center"><Icon icon={UserGroupIcon} size={32} className="text-zinc-400" />- <Text variant="large-medium">No hired experts yet</Text>- <Text variant="body" className="max-w-prose text-zinc-600">+ <Text variant="large-medium" tone="primary">+ No hired experts yet+ </Text>+ <Text variant="body" tone="secondary" className="max-w-prose">Hire an expert from the marketplace and they will show up here, ready towork alongside Autopilot.</Text><div className="flex flex-wrap items-center justify-center gap-2">- <Button- as="NextLink"- href="/marketplace"- variant="primary"- size="small"- className={ACTION_BUTTON_CLASS}- >+ <Button as="NextLink" href="/marketplace" variant="primary" size="xs">Browse the marketplace</Button>- <Button- as="NextLink"- href="/raise"- variant="secondary"- size="small"- className={ACTION_BUTTON_CLASS}- >+ <Button as="NextLink" href="/raise" variant="secondary" size="xs">Raise your own</Button></div>diff --git a/autogpt_platform/frontend/src/app/(platform)/team/components/ExpertChatDrawer/ExpertChatDrawer.tsx b/autogpt_platform/frontend/src/app/(platform)/team/components/ExpertChatDrawer/ExpertChatDrawer.tsxnew file mode 100644index 0000000000..613232fbae--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/team/components/ExpertChatDrawer/ExpertChatDrawer.tsx@@ -0,0 +1,170 @@+"use client";++import { ChatInput } from "@/app/(platform)/copilot/components/ChatInput/ChatInput";+import { ChatMessagesContainer } from "@/app/(platform)/copilot/components/ChatMessagesContainer/ChatMessagesContainer";+import { CopilotChatActionsProvider } from "@/app/(platform)/copilot/components/CopilotChatActionsProvider/CopilotChatActionsProvider";+import { Button } from "@/components/atoms/Button/Button";+import { Text } from "@/components/atoms/Text/Text";+import { ArrowExpandIcon, NoteEditIcon } from "@hugeicons/core-free-icons";+import { ExpertSidePanel } from "../ExpertSidePanel/ExpertSidePanel";+import {+ IdentityAvatar,+ PanelIdentity,+} from "../ExpertSidePanel/IdentityAvatar";+import type { ChatTarget } from "./helpers";+import { useExpertChatDrawer } from "./useExpertChatDrawer";++const DEFAULT_CHAT_WIDTH = 480;++interface Props {+ target: ChatTarget | null;+ onClose: () => void;+ resumeLatest?: boolean;+ threadKey?: number;+ /** Sent as the first message of the thread started by `threadKey`. */+ seedPrompt?: string | null;+}++export function ExpertChatDrawer({+ target,+ onClose,+ resumeLatest = true,+ threadKey = 0,+ seedPrompt = null,+}: Props) {+ const chat = useExpertChatDrawer({+ target,+ isOpen: target !== null,+ resumeLatest,+ threadKey,+ seedPrompt,+ });+ const copilotHref = chat.sessionId+ ? `/copilot?sessionId=${encodeURIComponent(chat.sessionId)}`+ : target?.expertId+ ? `/copilot?expertId=${target.expertId}&new=1`+ : "/copilot";+ const identity = target+ ? {+ name: target.name,+ avatarUrl: target.avatarUrl,+ isAutopilot: target.expertId === null,+ }+ : null;++ return (+ <ExpertSidePanel+ identity={identity}+ title={target?.name ?? ""}+ ariaLabel={target ? `Chat with ${target.name}` : ""}+ panelId="chat"+ closeLabel="Close chat panel"+ showIdentity={!!chat.sessionId}+ headerActions={+ <>+ <Button+ type="button"+ variant="ghost"+ size="icon-xs"+ leadingIcon={NoteEditIcon}+ aria-label="New task"+ disabled={!chat.sessionId}+ onClick={chat.startNewThread}+ />+ <Button+ as="NextLink"+ href={copilotHref}+ variant="ghost"+ size="icon-xs"+ leadingIcon={ArrowExpandIcon}+ aria-label="Open in Copilot"+ />+ </>+ }+ defaultWidth={DEFAULT_CHAT_WIDTH}+ onClose={onClose}+ >+ {identity && target ? (+ <ChatPanelBody target={target} identity={identity} chat={chat} />+ ) : null}+ </ExpertSidePanel>+ );+}++interface BodyProps {+ target: ChatTarget;+ identity: PanelIdentity;+ chat: ReturnType<typeof useExpertChatDrawer>;+}++function ChatPanelBody({ target, identity, chat }: BodyProps) {+ const {+ sessionId,+ messages,+ status,+ error,+ stop,+ onSend,+ queuedMessages,+ isResolvingSession,+ isCreating,+ } = chat;++ const isStreaming = status === "streaming" || status === "submitted";++ return (+ <CopilotChatActionsProvider onSend={onSend}>+ <div className="flex min-h-0 flex-1 flex-col">+ {isResolvingSession ? (+ <div className="flex flex-1 items-center justify-center px-4 py-6">+ <Text variant="small" tone="muted">+ Opening chat…+ </Text>+ </div>+ ) : sessionId ? (+ <div className="flex min-h-0 flex-1 flex-col">+ <ChatMessagesContainer+ messages={messages}+ status={status}+ error={error}+ isLoading={false}+ sessionID={sessionId}+ queuedMessages={queuedMessages}+ variant="compact"+ showThreadHeader={false}+ />+ </div>+ ) : (+ <div className="flex flex-1 flex-col items-center justify-center gap-3 px-6 py-6 text-center">+ <IdentityAvatar+ identity={identity}+ className="h-24 w-24"+ imageSize={192}+ />+ <div className="space-y-0.5">+ <Text variant="body-medium" tone="primary">+ What can I do for you?+ </Text>+ <Text variant="small" tone="muted">+ {target.name} · {target.role}+ </Text>+ </div>+ </div>+ )}+ <div className="shrink-0 px-3 pb-5 pt-2">+ <ChatInput+ inputId="expert-chat-input"+ variant="compact"+ onSend={onSend}+ disabled={isResolvingSession || isCreating}+ isStreaming={isStreaming}+ onStop={stop}+ onEnqueue={onSend}+ placeholder={`Message ${target.name}…`}+ hasSession={!!sessionId}+ />+ </div>+ </div>+ </CopilotChatActionsProvider>+ );+}diff --git a/autogpt_platform/frontend/src/app/(platform)/team/components/ExpertChatDrawer/helpers.ts b/autogpt_platform/frontend/src/app/(platform)/team/components/ExpertChatDrawer/helpers.tsnew file mode 100644index 0000000000..9235d6bdcc--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/team/components/ExpertChatDrawer/helpers.ts@@ -0,0 +1,25 @@+import { Expert } from "@/app/api/__generated__/models/expert";+import { AUTOPILOT_ROLE } from "../../helpers";++export interface ChatTarget {+ expertId: string | null;+ name: string;+ role: string;+ avatarUrl: string | null;+}++export const AUTOPILOT_CHAT_TARGET: ChatTarget = {+ expertId: null,+ name: "Autopilot",+ role: AUTOPILOT_ROLE,+ avatarUrl: null,+};++export function expertToChatTarget(expert: Expert): ChatTarget {+ return {+ expertId: expert.id,+ name: expert.name,+ role: expert.role,+ avatarUrl: expert.avatar_url,+ };+}diff --git a/autogpt_platform/frontend/src/app/(platform)/team/components/ExpertChatDrawer/useExpertChatDrawer.ts b/autogpt_platform/frontend/src/app/(platform)/team/components/ExpertChatDrawer/useExpertChatDrawer.tsnew file mode 100644index 0000000000..b731ca4e61--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/team/components/ExpertChatDrawer/useExpertChatDrawer.ts@@ -0,0 +1,221 @@+import { convertChatSessionMessagesToUiMessages } from "@/app/(platform)/copilot/helpers/convertChatSessionToUiMessages";+import { queueFollowUpMessage } from "@/app/(platform)/copilot/helpers/queueFollowUpMessage";+import { latestExpertSessionParams } from "@/app/(platform)/copilot/expertSessionQuery";+import { useCopilotPendingChips } from "@/app/(platform)/copilot/useCopilotPendingChips";+import { useCopilotStream } from "@/app/(platform)/copilot/useCopilotStream";+import {+ useGetV2GetSession,+ useGetV2ListSessions,+ usePostV2CreateSession,+} from "@/app/api/__generated__/endpoints/chat/chat";+import { toast } from "@/components/molecules/Toast/use-toast";+import * as Sentry from "@sentry/nextjs";+import type { UIDataTypes, UIMessage, UITools } from "ai";+import { useEffect, useMemo, useRef, useState } from "react";+import type { ChatTarget } from "./helpers";++type UiMessages = UIMessage<unknown, UIDataTypes, UITools>[];++interface Args {+ target: ChatTarget | null;+ isOpen: boolean;+ /** Resume the expert's latest thread on open; off = always start fresh. */+ resumeLatest: boolean;+ /** Bump to drop the current thread without remounting the drawer, so an+ * already-open panel swaps content instead of replaying its animation. */+ threadKey: number;+ /** First message to send in the thread started by `threadKey`. */+ seedPrompt: string | null;+}++export function useExpertChatDrawer({+ target,+ isOpen,+ resumeLatest,+ threadKey,+ seedPrompt,+}: Args) {+ const expertId = target?.expertId ?? null;+ const [sessionId, setSessionId] = useState<string | null>(null);+ const [isCreating, setIsCreating] = useState(false);+ const [skipLatest, setSkipLatest] = useState(false);+ const pendingPromptRef = useRef<string | null>(null);+ // Every thread reset bumps the generation; a session create that resolves+ // for an older generation is ignored so its prompt never lands in the new+ // thread, and the new thread is free to create its own session.+ const generationRef = useRef(0);+ const creatingGenerationRef = useRef<number | null>(null);++ const { mutateAsync: createSession } = usePostV2CreateSession();++ // Autopilot threads carry no expert id to look up by, so they always+ // start fresh; expert threads resume the latest one.+ const wantsLatest =+ isOpen && resumeLatest && !!expertId && !sessionId && !skipLatest;+ const latestQuery = useGetV2ListSessions(+ latestExpertSessionParams(expertId),+ { query: { enabled: wantsLatest, refetchOnWindowFocus: false } },+ );++ useEffect(() => {+ if (!wantsLatest || latestQuery.data?.status !== 200) return;+ const latest = latestQuery.data.data.sessions[0];+ if (latest) setSessionId(latest.id);+ }, [latestQuery.data, wantsLatest]);++ const sessionQuery = useGetV2GetSession(sessionId ?? "", undefined, {+ query: {+ enabled: !!sessionId,+ staleTime: Infinity,+ refetchOnWindowFocus: false,+ refetchOnMount: true,+ },+ });+ const hasActiveStream =+ sessionQuery.data?.status === 200+ ? !!sessionQuery.data.data.active_stream+ : false;++ const hydratedMessages = useMemo<UiMessages | undefined>(() => {+ if (sessionQuery.data?.status !== 200 || !sessionId) return undefined;+ return convertChatSessionMessagesToUiMessages(+ sessionId,+ sessionQuery.data.data.messages ?? [],+ { isComplete: !hasActiveStream },+ ).messages as UiMessages;+ }, [sessionQuery.data, sessionId, hasActiveStream]);++ const { messages, setMessages, sendMessage, stop, status, error } =+ useCopilotStream({+ sessionId,+ hydratedMessages,+ hasActiveStream,+ refetchSession: sessionQuery.refetch,+ copilotModel: undefined,+ });++ const { queuedMessages, queueMessage } = useCopilotPendingChips({+ sessionId,+ status,+ messages,+ setMessages,+ });++ const threadKeyRef = useRef(threadKey);+ const [seedToSend, setSeedToSend] = useState<string | null>(null);+ useEffect(() => {+ if (threadKeyRef.current === threadKey) return;+ threadKeyRef.current = threadKey;+ generationRef.current += 1;+ creatingGenerationRef.current = null;+ setIsCreating(false);+ setSkipLatest(true);+ setSessionId(null);+ setMessages([]);+ pendingPromptRef.current = null;+ setSeedToSend(seedPrompt);+ }, [threadKey, seedPrompt, setMessages]);++ const startSessionRef = useRef(startSession);+ startSessionRef.current = startSession;+ useEffect(() => {+ if (!seedToSend) return;+ setSeedToSend(null);+ void startSessionRef.current(seedToSend);+ }, [seedToSend]);++ useEffect(() => {+ if (!sessionId || !pendingPromptRef.current) return;+ const prompt = pendingPromptRef.current;+ pendingPromptRef.current = null;+ sendMessage({ text: prompt });+ }, [sessionId, sendMessage]);++ function startNewThread() {+ generationRef.current += 1;+ creatingGenerationRef.current = null;+ setIsCreating(false);+ setSkipLatest(true);+ setSessionId(null);+ setMessages([]);+ pendingPromptRef.current = null;+ }++ async function startSession(firstMessage: string) {+ const generation = generationRef.current;+ if (creatingGenerationRef.current === generation || !target) return;+ creatingGenerationRef.current = generation;+ setIsCreating(true);+ try {+ const response = await createSession(+ expertId ? { data: { expert_id: expertId } } : { data: null },+ );+ if (generation !== generationRef.current) return;+ if (response.status !== 200) {+ throw new Error("Failed to create expert chat session");+ }+ pendingPromptRef.current = firstMessage;+ setSessionId(response.data.id);+ } catch (err) {+ if (generation !== generationRef.current) return;+ Sentry.captureException(err);+ toast({+ variant: "destructive",+ title: "Could not start the chat",+ description: "Please try sending your message again.",+ });+ } finally {+ if (creatingGenerationRef.current === generation) {+ creatingGenerationRef.current = null;+ setIsCreating(false);+ }+ }+ }++ async function onSend(message: string) {+ const trimmed = message.trim();+ if (!trimmed) return;+ if (!sessionId) {+ await startSession(trimmed);+ return;+ }+ const isInFlight = status === "streaming" || status === "submitted";+ if (isInFlight) {+ try {+ await queueFollowUpMessage(sessionId, trimmed);+ queueMessage(trimmed);+ } catch (err) {+ if (+ err instanceof Error &&+ err.name === "QueueFollowUpNotActiveError"+ ) {+ sendMessage({ text: trimmed });+ return;+ }+ Sentry.captureException(err);+ toast({+ variant: "destructive",+ title: "Could not queue message",+ description: "Please wait for the current response to finish.",+ });+ }+ return;+ }+ sendMessage({ text: trimmed });+ }++ const isResolvingSession = !sessionId && wantsLatest && latestQuery.isLoading;++ return {+ sessionId,+ startNewThread,+ messages,+ status,+ error,+ stop,+ onSend,+ queuedMessages,+ isResolvingSession,+ isCreating,+ };+}diff --git a/autogpt_platform/frontend/src/app/(platform)/team/components/ExpertSidePanel/ExpertSidePanel.tsx b/autogpt_platform/frontend/src/app/(platform)/team/components/ExpertSidePanel/ExpertSidePanel.tsxnew file mode 100644index 0000000000..09408eb5cc--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/team/components/ExpertSidePanel/ExpertSidePanel.tsx@@ -0,0 +1,186 @@+"use client";++import { Button } from "@/components/atoms/Button/Button";+import { FullscreenDialog } from "@/components/molecules/FullscreenDialog/FullscreenDialog";+import { Text } from "@/components/atoms/Text/Text";+import { Cancel01Icon } from "@hugeicons/core-free-icons";+import { AnimatePresence, motion, useReducedMotion } from "framer-motion";+import { ReactNode, useEffect, useState } from "react";+import { PanelResizeHandle } from "@/app/(platform)/copilot/components/PanelResizeHandle";+import { useIsMobile } from "@/app/(platform)/copilot/useIsMobile";+import { IdentityAvatar, PanelIdentity } from "./IdentityAvatar";+import { usePanelSidebarCollapse } from "./usePanelSidebarCollapse";++const DEFAULT_PANEL_WIDTH = 520;+const MIN_PANEL_WIDTH = 320;+const MAX_PANEL_VIEWPORT_RATIO = 0.4;+const PANEL_EASE: [number, number, number, number] = [0.32, 0.72, 0, 1];+const PANEL_DURATION = 0.3;++interface Props {+ identity: PanelIdentity | null;+ title: string;+ ariaLabel?: string;+ panelId: string;+ closeLabel: string;+ headerActions?: ReactNode;+ showIdentity?: boolean;+ defaultWidth?: number;+ onClose: () => void;+ children: ReactNode;+}++export function ExpertSidePanel({+ identity,+ title,+ ariaLabel = title,+ panelId,+ closeLabel,+ headerActions,+ showIdentity = true,+ defaultWidth = DEFAULT_PANEL_WIDTH,+ onClose,+ children,+}: Props) {+ const isMobile = useIsMobile();+ const shouldReduceMotion = useReducedMotion();+ const [width, setWidth] = useState(defaultWidth);+ const [isResizing, setIsResizing] = useState(false);+ const maxWidth = useMaxPanelWidth();+ const renderedWidth = Math.min(width, maxWidth);+ usePanelSidebarCollapse(identity !== null);++ if (isMobile) {+ if (!identity) return null;+ return (+ <FullscreenDialog title={ariaLabel} onClose={onClose}>+ <PanelHeader+ identity={identity}+ title={title}+ closeLabel={closeLabel}+ actions={headerActions}+ showIdentity={showIdentity}+ onClose={onClose}+ />+ {children}+ </FullscreenDialog>+ );+ }++ const transition =+ shouldReduceMotion || isResizing+ ? { duration: 0 }+ : { duration: PANEL_DURATION, ease: PANEL_EASE };+ const panelSelector = `[data-expert-panel="${panelId}"]`;++ return (+ <AnimatePresence>+ {identity ? (+ <motion.aside+ data-expert-panel={panelId}+ aria-label={ariaLabel}+ initial={{ width: 0, opacity: 0 }}+ animate={{ width: renderedWidth, opacity: 1 }}+ exit={{ width: 0, opacity: 0 }}+ transition={transition}+ className="sticky top-0 h-svh shrink-0 self-start border-l border-l-sidebar-border bg-sidebar"+ >+ <PanelResizeHandle+ panelSelector={panelSelector}+ onWidthChange={setWidth}+ onResizingChange={setIsResizing}+ minWidth={MIN_PANEL_WIDTH}+ maxWidth={maxWidth}+ />+ <div className="h-full overflow-hidden">+ <div+ style={{ width: renderedWidth }}+ className="flex h-full min-h-0 flex-col"+ >+ <PanelHeader+ identity={identity}+ title={title}+ closeLabel={closeLabel}+ actions={headerActions}+ showIdentity={showIdentity}+ onClose={onClose}+ />+ {children}+ </div>+ </div>+ </motion.aside>+ ) : null}+ </AnimatePresence>+ );+}++function useMaxPanelWidth() {+ const [maxWidth, setMaxWidth] = useState(DEFAULT_PANEL_WIDTH);++ useEffect(() => {+ function update() {+ setMaxWidth(+ Math.max(+ MIN_PANEL_WIDTH,+ Math.round(window.innerWidth * MAX_PANEL_VIEWPORT_RATIO),+ ),+ );+ }+ update();+ window.addEventListener("resize", update);+ return () => window.removeEventListener("resize", update);+ }, []);++ return maxWidth;+}++interface HeaderProps {+ identity: PanelIdentity;+ title: string;+ closeLabel: string;+ actions?: ReactNode;+ showIdentity: boolean;+ onClose: () => void;+}++function PanelHeader({+ identity,+ title,+ closeLabel,+ actions,+ showIdentity,+ onClose,+}: HeaderProps) {+ return (+ <div className="flex h-[53px] shrink-0 items-center gap-2 border-b border-b-sidebar-border px-3">+ {showIdentity ? (+ <>+ <IdentityAvatar+ identity={identity}+ className="h-7 w-7"+ imageSize={56}+ />+ <Text+ variant="body-medium"+ as="h2"+ tone="primary"+ className="min-w-0 flex-1 truncate"+ >+ {title}+ </Text>+ </>+ ) : (+ <span className="flex-1" />+ )}+ {actions}+ <Button+ type="button"+ variant="ghost"+ size="icon-xs"+ leadingIcon={Cancel01Icon}+ aria-label={closeLabel}+ onClick={onClose}+ />+ </div>+ );+}diff --git a/autogpt_platform/frontend/src/app/(platform)/team/components/ExpertSidePanel/IdentityAvatar.tsx b/autogpt_platform/frontend/src/app/(platform)/team/components/ExpertSidePanel/IdentityAvatar.tsxnew file mode 100644index 0000000000..47f62a8511--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/team/components/ExpertSidePanel/IdentityAvatar.tsx@@ -0,0 +1,47 @@+import { AutoGPTLogo } from "@/components/atoms/AutoGPTLogo/AutoGPTLogo";+import {+ Avatar,+ AvatarFallback,+ AvatarImage,+} from "@/components/atoms/Avatar/Avatar";+import { cn } from "@/lib/utils";++export interface PanelIdentity {+ name: string;+ avatarUrl: string | null;+ isAutopilot?: boolean;+}++interface Props {+ identity: PanelIdentity;+ className?: string;+ imageSize: number;+}++export function IdentityAvatar({ identity, className, imageSize }: Props) {+ if (identity.isAutopilot) {+ return (+ <span+ className={cn(+ "flex shrink-0 items-center justify-center rounded-full bg-white ring-1 ring-zinc-200",+ className,+ )}+ >+ <AutoGPTLogo hideText viewBox="47 -1 42 42" className="size-[55%]" />+ </span>+ );+ }+ return (+ <Avatar className={cn("shrink-0", className)}>+ {identity.avatarUrl ? (+ <AvatarImage+ src={identity.avatarUrl}+ alt={identity.name}+ width={imageSize}+ height={imageSize}+ />+ ) : null}+ <AvatarFallback>{identity.name}</AvatarFallback>+ </Avatar>+ );+}diff --git a/autogpt_platform/frontend/src/app/(platform)/team/components/SoulDrawer/useSoulPanelSidebarCollapse.test.ts b/autogpt_platform/frontend/src/app/(platform)/team/components/ExpertSidePanel/usePanelSidebarCollapse.test.tssimilarity index 81%rename from autogpt_platform/frontend/src/app/(platform)/team/components/SoulDrawer/useSoulPanelSidebarCollapse.test.tsrename to autogpt_platform/frontend/src/app/(platform)/team/components/ExpertSidePanel/usePanelSidebarCollapse.test.tsindex d0b06c19ba..b37db43dfd 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/components/SoulDrawer/useSoulPanelSidebarCollapse.test.ts+++ b/autogpt_platform/frontend/src/app/(platform)/team/components/ExpertSidePanel/usePanelSidebarCollapse.test.ts@@ -1,6 +1,6 @@import { renderHook } from "@testing-library/react";import { beforeEach, describe, expect, it, vi } from "vitest";-import { useSoulPanelSidebarCollapse } from "./useSoulPanelSidebarCollapse";+import { usePanelSidebarCollapse } from "./usePanelSidebarCollapse";const setOpen = vi.fn<(open: boolean) => void>();const setOpenMobile = vi.fn<(open: boolean) => void>();@@ -20,9 +20,9 @@ beforeEach(() => {setOpenMobile.mockReset();});-describe("useSoulPanelSidebarCollapse", () => {+describe("usePanelSidebarCollapse", () => {it("closes the left sidebar when the Soul panel opens", () => {- renderHook(() => useSoulPanelSidebarCollapse(true));+ renderHook(() => usePanelSidebarCollapse(true));expect(setOpen).toHaveBeenCalledWith(false);expect(setOpenMobile).toHaveBeenCalledWith(false);@@ -30,7 +30,7 @@ describe("useSoulPanelSidebarCollapse", () => {it("restores the previous sidebar state when the Soul panel closes", () => {const { rerender } = renderHook(- ({ isOpen }) => useSoulPanelSidebarCollapse(isOpen),+ ({ isOpen }) => usePanelSidebarCollapse(isOpen),{ initialProps: { isOpen: true } },);sidebarOpen = false;@@ -42,7 +42,7 @@ describe("useSoulPanelSidebarCollapse", () => {});it("restores a sidebar it closed when the panel unmounts", () => {const { rerender, unmount } = renderHook(() =>- useSoulPanelSidebarCollapse(true),+ usePanelSidebarCollapse(true),);sidebarOpen = false;rerender();@@ -53,7 +53,7 @@ describe("useSoulPanelSidebarCollapse", () => {it("does not open a sidebar that was already closed", () => {sidebarOpen = false;- const { unmount } = renderHook(() => useSoulPanelSidebarCollapse(true));+ const { unmount } = renderHook(() => usePanelSidebarCollapse(true));setOpen.mockClear();unmount();expect(setOpen).not.toHaveBeenCalled();@@ -61,7 +61,7 @@ describe("useSoulPanelSidebarCollapse", () => {it("does not overwrite a sidebar the user reopened", () => {const { rerender, unmount } = renderHook(() =>- useSoulPanelSidebarCollapse(true),+ usePanelSidebarCollapse(true),);sidebarOpen = false;rerender();diff --git a/autogpt_platform/frontend/src/app/(platform)/team/components/SoulDrawer/useSoulPanelSidebarCollapse.ts b/autogpt_platform/frontend/src/app/(platform)/team/components/ExpertSidePanel/usePanelSidebarCollapse.tssimilarity index 90%rename from autogpt_platform/frontend/src/app/(platform)/team/components/SoulDrawer/useSoulPanelSidebarCollapse.tsrename to autogpt_platform/frontend/src/app/(platform)/team/components/ExpertSidePanel/usePanelSidebarCollapse.tsindex 5aafee6204..1d94dcbd62 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/components/SoulDrawer/useSoulPanelSidebarCollapse.ts+++ b/autogpt_platform/frontend/src/app/(platform)/team/components/ExpertSidePanel/usePanelSidebarCollapse.ts@@ -1,7 +1,7 @@import { useOptionalSidebar } from "@/components/ui/sidebar";import { useEffect, useLayoutEffect, useRef } from "react";-export function useSoulPanelSidebarCollapse(isPanelOpen: boolean) {+export function usePanelSidebarCollapse(isPanelOpen: boolean) {const sidebar = useOptionalSidebar();const sidebarRef = useRef(sidebar);useLayoutEffect(() => {diff --git a/autogpt_platform/frontend/src/app/(platform)/team/components/ExpertTeamCard/ExpertTeamCard.tsx b/autogpt_platform/frontend/src/app/(platform)/team/components/ExpertTeamCard/ExpertTeamCard.tsxindex 7064cd2fda..3279344abe 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/components/ExpertTeamCard/ExpertTeamCard.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/components/ExpertTeamCard/ExpertTeamCard.tsx@@ -18,6 +18,7 @@ import {DropdownMenuTrigger,} from "@/components/molecules/DropdownMenu/DropdownMenu";import {+ BubbleChatIcon,PencilEdit02Icon,PlusSignIcon,Tick02Icon,@@ -34,21 +35,12 @@ import {getExpertRosterStatus,getNeedsSetupCount,getWeeklySpend,- ACTION_BUTTON_CLASS,} from "../../helpers";-import { ChatCircle } from "@phosphor-icons/react";import { CardStat, CardStats } from "../CardStats";import { FireExpertDialog } from "../FireExpertDialog/FireExpertDialog";import { FireExpertMenu } from "../FireExpertMenu/FireExpertMenu";import { useExpertTeamCard } from "./useExpertTeamCard";-const COVER_ACTION_CLASS =- "size-8 rounded-lg bg-white/90 p-0 text-zinc-700 backdrop-blur hover:bg-white hover:text-zinc-900";--/** The card's corners are heavily rounded, so its actions are too. */-const FOOTER_BUTTON_CLASS = `${ACTION_BUTTON_CLASS} flex-1`;-const FOOTER_OUTLINE_BUTTON_CLASS = `${FOOTER_BUTTON_CLASS} !border-zinc-200 hover:!border-zinc-300`;-interface Props {expert: Expert;schedules: GraphExecutionJobInfo[];@@ -56,6 +48,7 @@ interface Props {currentPod: ExpertPod | undefined;onInstallWorkflow: (expertId: string) => void;onEditSoul: (expertId: string) => void;+ onChat: (expertId: string) => void;onAssignPod: (expertId: string, podId: string | null) => void;}@@ -66,6 +59,7 @@ export function ExpertTeamCard({currentPod,onInstallWorkflow,onEditSoul,+ onChat,onAssignPod,}: Props) {const blurb = getExpertBlurb(expert);@@ -93,17 +87,15 @@ export function ExpertTeamCard({<DropdownMenu><DropdownMenuTrigger asChild><Button- variant="icon"- size="small"- className={COVER_ACTION_CLASS}+ variant="floating"+ size="icon-sm"+ leadingIcon={UserGroupIcon}aria-label={currentPod? `Move to pod (currently ${currentPod.name})`: "Move to pod"}- >- <Icon icon={UserGroupIcon} size={16} />- </Button>+ /></DropdownMenuTrigger><DropdownMenuContentalign="end"@@ -134,19 +126,16 @@ export function ExpertTeamCard({</DropdownMenu>) : null}<Button- variant="icon"- size="small"+ variant="floating"+ size="icon-sm"aria-label="Edit Soul"- className={COVER_ACTION_CLASS}+ leadingIcon={PencilEdit02Icon}onClick={handleEditSoulClick}- >- <Icon icon={PencilEdit02Icon} size={16} />- </Button>+ /><FireExpertMenuexpertName={expert.name}onFire={openFire}testId="expert-card-actions"- triggerClassName={COVER_ACTION_CLASS}/></div>@@ -177,13 +166,14 @@ export function ExpertTeamCard({<div className="mt-2 flex min-w-0 flex-1 flex-col gap-1"><div className="flex items-baseline justify-between gap-2">- <Text variant="small-medium" className="text-zinc-700">+ <Text variant="small-medium" tone="secondary">Budget</Text><Textvariant="small-medium"+ tone="secondary"unmask={false}- className="tabular-nums text-zinc-700"+ className="tabular-nums">{weeklySpend? `${creditsToUsdLabel(weeklySpend.spent)} / ${creditsToUsdLabel(weeklySpend.budget)}`@@ -202,13 +192,17 @@ export function ExpertTeamCard({<div className="mt-2 flex w-full flex-col items-start gap-1 px-2 pl-5 text-left">{/* `truncate` clips at the padding box, so descenders in a name like"Fiona Gray" need a little room below the line box. */}- <Text variant="h4" className="w-full truncate pb-1">+ <Text+ variant="lead-medium"+ tone="primary"+ className="w-full truncate pb-1"+ >{expert.name}</Text>- <Text variant="body" className="line-clamp-2 text-zinc-500">+ <Text variant="body" tone="muted" className="line-clamp-2">{expert.role}</Text>- <Text variant="body" className="mt-1 line-clamp-2 text-zinc-500">+ <Text variant="body" tone="muted" className="mt-1 line-clamp-2">{blurb}</Text>{needsSetupCount > 0 ? (@@ -237,8 +231,7 @@ export function ExpertTeamCard({</Text><Buttonvariant="secondary"- size="small"- className={ACTION_BUTTON_CLASS}+ size="xs"loading={isResuming}onClick={handleResume}>@@ -249,20 +242,19 @@ export function ExpertTeamCard({<div className="flex items-center gap-2 px-4 pb-4"><Button- as="NextLink"- href={`/copilot?expertId=${expert.id}`}variant="secondary"- size="small"- className={FOOTER_BUTTON_CLASS}- leftIcon={<ChatCircle size={14} />}+ size="xs"+ className="flex-1"+ leadingIcon={BubbleChatIcon}+ onClick={() => onChat(expert.id)}>Chat</Button><Buttonvariant="outline"- size="small"- className={FOOTER_OUTLINE_BUTTON_CLASS}- leftIcon={<Icon icon={PlusSignIcon} size={14} />}+ size="xs"+ className="flex-1"+ leadingIcon={PlusSignIcon}onClick={handleInstallClick}>Install workflowdiff --git a/autogpt_platform/frontend/src/app/(platform)/team/components/ExpertTeamCard/components/ExpertCover.tsx b/autogpt_platform/frontend/src/app/(platform)/team/components/ExpertTeamCard/components/ExpertCover.tsxindex 98261cf0d0..696040b966 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/components/ExpertTeamCard/components/ExpertCover.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/components/ExpertTeamCard/components/ExpertCover.tsx@@ -1,4 +1,5 @@import { Icon } from "@/components/atoms/Icon/Icon";+import { Text } from "@/components/atoms/Text/Text";import { cn } from "@/lib/utils";import {Activity01Icon,@@ -41,11 +42,10 @@ const STATUS_STYLES: Record<interface Props {className?: string;color: string | undefined;- src?: string;status?: CoverStatus;}-export function ExpertCover({ className, color, src, status }: Props) {+export function ExpertCover({ className, color, status }: Props) {const statusStyle = status ? STATUS_STYLES[status] : null;return (@@ -56,19 +56,24 @@ export function ExpertCover({ className, color, src, status }: Props) {)}><Image- src={src ?? getExpertCoverSrc(color)}+ src={getExpertCoverSrc(color)}alt=""fillsizes="(min-width: 1024px) 33vw, (min-width: 768px) 50vw, 100vw"className="object-cover"/>{statusStyle ? (- <span- className={`absolute bottom-3 right-3 flex items-center gap-1 rounded-md px-2 py-0.5 text-xs font-medium ${statusStyle.className}`}+ <Text+ variant="small-medium"+ as="span"+ className={cn(+ "absolute bottom-3 right-3 flex items-center gap-1 rounded-md px-2 py-0.5",+ statusStyle.className,+ )}><Icon icon={statusStyle.icon} size={13} />{statusStyle.label}- </span>+ </Text>) : null}</div>);diff --git a/autogpt_platform/frontend/src/app/(platform)/team/components/FireExpertDialog/FireExpertDialog.tsx b/autogpt_platform/frontend/src/app/(platform)/team/components/FireExpertDialog/FireExpertDialog.tsxindex 6f944a90f5..3100d5d28a 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/components/FireExpertDialog/FireExpertDialog.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/components/FireExpertDialog/FireExpertDialog.tsx@@ -49,6 +49,7 @@ export function FireExpertDialog({return (<Dialog+ variant="compact"controlled={{ isOpen: open, set: handleOpenChange }}styling={{ maxWidth: "30rem" }}title={`Fire ${expertName}?`}diff --git a/autogpt_platform/frontend/src/app/(platform)/team/components/FireExpertDialog/FireExpertDialogSections.tsx b/autogpt_platform/frontend/src/app/(platform)/team/components/FireExpertDialog/FireExpertDialogSections.tsxindex 1f10c24b43..14c7cb2c25 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/components/FireExpertDialog/FireExpertDialogSections.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/components/FireExpertDialog/FireExpertDialogSections.tsx@@ -52,7 +52,7 @@ export function FireExpertPreview({return (<>- <Text variant="body" className="text-zinc-600">+ <Text variant="body" tone="secondary">Here is exactly what happens when you fire {expertName}.</Text><ul className="flex flex-col gap-2.5">@@ -65,7 +65,7 @@ export function FireExpertPreview({<div className="flex justify-end"><Buttonvariant="secondary"- size="small"+ size="xs"onClick={handleRetry}data-testid="fire-preview-retry">@@ -81,14 +81,20 @@ export function FireExpertPreview({function PauseItemsPanel({ items }: PauseItemsPanelProps) {return (<div className="rounded-xl bg-zinc-50 px-3.5 py-3 ring-1 ring-inset ring-zinc-200/80">- <Text variant="small" className="text-zinc-500">+ <Text variant="small" tone="muted">Pausing now</Text><ul className="mt-1 flex flex-col gap-0.5">{items.map((item) => (- <li key={item.id} className="truncate text-sm text-zinc-700">+ <Text+ key={item.id}+ variant="body"+ as="li"+ tone="secondary"+ className="truncate"+ >{item.name}- </li>+ </Text>))}</ul></div>@@ -104,10 +110,16 @@ export function FireExpertFooter({}: FooterProps) {return (<Dialog.Footer>- <Button variant="secondary" disabled={isFiring} onClick={onClose}>+ <Button+ size="xs"+ variant="secondary"+ disabled={isFiring}+ onClick={onClose}+ >Keep {expertName}</Button><Button+ size="xs"variant="destructive"loading={isFiring}disabled={isPreviewLoading}@@ -127,7 +139,7 @@ function FireLine({ children }: FireLineProps) {aria-hiddenclassName="mt-2 h-1.5 w-1.5 shrink-0 rounded-full bg-zinc-300"/>- <Text variant="body" className="text-zinc-700">+ <Text variant="body" tone="secondary">{children}</Text></li>diff --git a/autogpt_platform/frontend/src/app/(platform)/team/components/FireExpertMenu/FireExpertMenu.tsx b/autogpt_platform/frontend/src/app/(platform)/team/components/FireExpertMenu/FireExpertMenu.tsxindex 7e41950d00..33ac4538b5 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/components/FireExpertMenu/FireExpertMenu.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/components/FireExpertMenu/FireExpertMenu.tsx@@ -1,3 +1,4 @@+import { Button } from "@/components/atoms/Button/Button";import { Icon } from "@/components/atoms/Icon/Icon";import {DropdownMenu,@@ -5,37 +6,28 @@ import {DropdownMenuItem,DropdownMenuTrigger,} from "@/components/molecules/DropdownMenu/DropdownMenu";-import { cn } from "@/lib/utils";import { Logout03Icon, MoreVerticalIcon } from "@hugeicons/core-free-icons";interface Props {expertName: string;onFire: () => void;testId: string;- triggerClassName?: string;}-export function FireExpertMenu({- expertName,- onFire,- testId,- triggerClassName,-}: Props) {+export function FireExpertMenu({ expertName, onFire, testId }: Props) {return (<DropdownMenu><DropdownMenuTrigger asChild>- <button+ <Buttontype="button"+ variant="floating"+ size="icon-sm"+ leadingIcon={MoreVerticalIcon}aria-label={`${expertName} actions`}+ withTooltip={false}data-testid={testId}onClick={(event) => event.stopPropagation()}- className={cn(- "inline-flex h-9 w-9 items-center justify-center rounded-full transition-colors",- triggerClassName,- )}- >- <Icon icon={MoreVerticalIcon} size={18} />- </button>+ /></DropdownMenuTrigger><DropdownMenuContent align="end" sideOffset={6}><DropdownMenuItemdiff --git a/autogpt_platform/frontend/src/app/(platform)/team/components/NewPodDialog/NewPodDialog.tsx b/autogpt_platform/frontend/src/app/(platform)/team/components/NewPodDialog/NewPodDialog.tsxindex 341fdae83c..0612e59f84 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/components/NewPodDialog/NewPodDialog.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/components/NewPodDialog/NewPodDialog.tsx@@ -29,6 +29,7 @@ export function NewPodDialog({ open, onClose, onCreate, isCreating }: Props) {return (<Dialog+ variant="compact"title="New pod"styling={{ maxWidth: "28rem" }}controlled={{@@ -42,7 +43,9 @@ export function NewPodDialog({ open, onClose, onCreate, isCreating }: Props) {<form onSubmit={handleSubmit} className="flex flex-col gap-4 px-1"><Inputid="pod-name"+ size="small"label="Pod name"+ labelVariant="small-medium"placeholder="e.g. Growth"value={name}maxLength={POD_NAME_MAX_LENGTH}@@ -50,10 +53,16 @@ export function NewPodDialog({ open, onClose, onCreate, isCreating }: Props) {wrapperClassName="!mb-0"/><div className="flex justify-end gap-2">- <Button type="button" variant="secondary" onClick={onClose}>+ <Button+ size="xs"+ type="button"+ variant="secondary"+ onClick={onClose}+ >Cancel</Button><Button+ size="xs"type="submit"variant="primary"disabled={!trimmed || isCreating}diff --git a/autogpt_platform/frontend/src/app/(platform)/team/components/PodBoard/PodBoard.tsx b/autogpt_platform/frontend/src/app/(platform)/team/components/PodBoard/PodBoard.tsxindex df5a60b900..c1f9f69e59 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/components/PodBoard/PodBoard.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/components/PodBoard/PodBoard.tsx@@ -4,14 +4,15 @@ import { Button } from "@/components/atoms/Button/Button";import { Icon } from "@/components/atoms/Icon/Icon";import { Skeleton } from "@/components/atoms/Skeleton/Skeleton";import { Text } from "@/components/atoms/Text/Text";-import { Folder02Icon } from "@hugeicons/core-free-icons";-import { ACTION_BUTTON_CLASS } from "@/app/(platform)/team/helpers";+import { ArrowLeft01Icon, Folder02Icon } from "@hugeicons/core-free-icons";+import { ReactNode, useState } from "react";+import { TEAM_GRID_CLASS } from "../../helpers";interface Props {isLoading: boolean;podGroups: { pod: ExpertPod; experts: Expert[] }[];- ungroupedExperts: Expert[];onNewPod: () => void;+ renderCard: (expert: Expert) => ReactNode;}const FOLDER_GRID_CLASS =@@ -20,71 +21,115 @@ const FOLDER_GRID_CLASS =export function PodBoard({isLoading,podGroups,- ungroupedExperts,onNewPod,+ renderCard,}: Props) {- if (isLoading) {- return (- <div className={FOLDER_GRID_CLASS}>- {[0, 1, 2].map((index) => (- <Skeleton key={index} className="h-28 w-full rounded-xl" />- ))}- </div>- );- }+ const [openPodId, setOpenPodId] = useState<string | null>(null);+ const openGroup = podGroups.find((group) => group.pod.id === openPodId);- if (podGroups.length === 0 && ungroupedExperts.length === 0) {+ if (openGroup) {return (- <div className="flex flex-col items-center gap-3 rounded-xl border border-dashed border-zinc-300 bg-white p-8 text-center">- <Text variant="large-medium">No pods yet</Text>- <Text variant="body" className="max-w-prose text-zinc-600">- Group experts into pods to keep related work together.- </Text>- <Button- variant="primary"- size="small"- className={ACTION_BUTTON_CLASS}- onClick={onNewPod}- >- New Pod- </Button>- </div>+ <section+ aria-label={`${openGroup.pod.name} pod`}+ className="flex flex-col gap-4"+ >+ <div className="flex items-center gap-2">+ <Button+ type="button"+ variant="ghost"+ size="icon-xs"+ leadingIcon={ArrowLeft01Icon}+ aria-label="Back to pods"+ onClick={() => setOpenPodId(null)}+ />+ <Text variant="large-medium" as="h5" tone="primary">+ {openGroup.pod.name}+ </Text>+ <Text variant="small" tone="muted">+ {openGroup.experts.length}{" "}+ {openGroup.experts.length === 1 ? "expert" : "experts"}+ </Text>+ </div>+ {openGroup.experts.length > 0 ? (+ <div className={TEAM_GRID_CLASS}>+ {openGroup.experts.map(renderCard)}+ </div>+ ) : (+ <Text variant="body" tone="muted">+ No experts in this pod yet. Move one in from its card menu.+ </Text>+ )}+ </section>);}return (- <div className={FOLDER_GRID_CLASS}>- {podGroups.map((group) => (- <PodFolder- key={group.pod.id}- name={group.pod.name}- experts={group.experts}- />- ))}- {ungroupedExperts.length > 0 ? (- <PodFolder name="Ungrouped" experts={ungroupedExperts} />- ) : null}- </div>+ <section aria-label="Pods" className="flex flex-col gap-4">+ <Text variant="large-medium" as="h5" tone="primary">+ Pods+ </Text>+ {isLoading ? (+ <div className={FOLDER_GRID_CLASS}>+ {[0, 1, 2].map((index) => (+ <Skeleton key={index} className="h-28 w-full rounded-xl" />+ ))}+ </div>+ ) : podGroups.length === 0 ? (+ <div className="flex flex-col items-center gap-3 rounded-xl border border-dashed border-zinc-300 bg-white p-8 text-center">+ <Text variant="large-medium" tone="primary">+ No pods yet+ </Text>+ <Text variant="body" tone="secondary" className="max-w-prose">+ Group experts into pods to keep related work together.+ </Text>+ <Button variant="primary" size="xs" onClick={onNewPod}>+ New Pod+ </Button>+ </div>+ ) : (+ <div className={FOLDER_GRID_CLASS}>+ {podGroups.map((group) => (+ <PodFolder+ key={group.pod.id}+ name={group.pod.name}+ experts={group.experts}+ onOpen={() => setOpenPodId(group.pod.id)}+ />+ ))}+ </div>+ )}+ </section>);}interface PodFolderProps {name: string;experts: Expert[];+ onOpen: () => void;}-function PodFolder({ name, experts }: PodFolderProps) {+function PodFolder({ name, experts, onOpen }: PodFolderProps) {return (- <section className="flex flex-col gap-3 rounded-xl border border-zinc-200 bg-white p-4">+ <button+ type="button"+ onClick={onOpen}+ aria-label={`Open ${name} pod`}+ className="flex flex-col gap-3 rounded-xl border border-zinc-200 bg-white p-4 text-left transition-colors hover:border-zinc-300 hover:bg-zinc-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400"+ ><div className="flex items-center gap-3"><span className="flex size-10 shrink-0 items-center justify-center rounded-lg bg-zinc-100 text-zinc-600"><Icon icon={Folder02Icon} size={20} /></span><div className="min-w-0">- <Text variant="h5" className="truncate">+ <Text+ variant="large-medium"+ as="h5"+ tone="primary"+ className="truncate"+ >{name}</Text>- <Text variant="small" className="text-zinc-500">+ <Text variant="small" tone="muted">{experts.length} {experts.length === 1 ? "expert" : "experts"}</Text></div>@@ -92,19 +137,22 @@ function PodFolder({ name, experts }: PodFolderProps) {{experts.length > 0 ? (<ul className="flex flex-wrap gap-1.5">{experts.map((expert) => (- <li+ <Textkey={expert.id}- className="max-w-full truncate rounded-md bg-zinc-50 px-2 py-0.5 text-xs text-zinc-600 ring-1 ring-inset ring-zinc-200"+ variant="small"+ as="li"+ tone="secondary"+ className="max-w-full truncate rounded-md bg-zinc-50 px-2 py-0.5 ring-1 ring-inset ring-zinc-200">{expert.name}- </li>+ </Text>))}</ul>) : (- <Text variant="small" className="text-zinc-500">+ <Text variant="small" tone="muted">No experts in this pod yet.</Text>)}- </section>+ </button>);}diff --git a/autogpt_platform/frontend/src/app/(platform)/team/components/SoulDrawer/SoulDrawer.tsx b/autogpt_platform/frontend/src/app/(platform)/team/components/SoulDrawer/SoulDrawer.tsxindex e4c2f37285..d111eb47f0 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/components/SoulDrawer/SoulDrawer.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/components/SoulDrawer/SoulDrawer.tsx@@ -2,31 +2,16 @@import { Expert } from "@/app/api/__generated__/models/expert";import { ExpertSoulUpdate } from "@/app/api/__generated__/models/expertSoulUpdate";-import {- Avatar,- AvatarFallback,- AvatarImage,-} from "@/components/atoms/Avatar/Avatar";import { Button } from "@/components/atoms/Button/Button";import { Icon } from "@/components/atoms/Icon/Icon";import { Input } from "@/components/atoms/Input/Input";-import { FullscreenDialog } from "@/components/molecules/FullscreenDialog/FullscreenDialog";import { Text } from "@/components/atoms/Text/Text";-import { Cancel01Icon, LockIcon } from "@hugeicons/core-free-icons";-import { AnimatePresence, motion, useReducedMotion } from "framer-motion";-import { ReactNode, useEffect, useState } from "react";-import { PanelResizeHandle } from "@/app/(platform)/copilot/components/PanelResizeHandle";-import { useIsMobile } from "@/app/(platform)/copilot/useIsMobile";+import { LockIcon } from "@hugeicons/core-free-icons";+import { ReactNode, useState } from "react";import { cn } from "@/lib/utils";+import { ExpertSidePanel } from "../ExpertSidePanel/ExpertSidePanel";import { useBottomScrollShadow } from "./useBottomScrollShadow";import { useSoulDrawer } from "./useSoulDrawer";-import { useSoulPanelSidebarCollapse } from "./useSoulPanelSidebarCollapse";--const DEFAULT_PANEL_WIDTH = 520;-const MIN_PANEL_WIDTH = 320;-const MAX_PANEL_VIEWPORT_RATIO = 0.4;-const PANEL_EASE: [number, number, number, number] = [0.32, 0.72, 0, 1];-const PANEL_DURATION = 0.3;interface Props {expert: Expert | null;@@ -34,81 +19,21 @@ interface Props {}export function SoulDrawer({ expert, onClose }: Props) {- const isMobile = useIsMobile();- const shouldReduceMotion = useReducedMotion();- const [width, setWidth] = useState(DEFAULT_PANEL_WIDTH);- const [isResizing, setIsResizing] = useState(false);- const maxWidth = useMaxPanelWidth();- const renderedWidth = Math.min(width, maxWidth);- useSoulPanelSidebarCollapse(expert !== null);-- if (isMobile) {- if (!expert) return null;- return (- <FullscreenDialog title={`${expert.name}'s Soul`} onClose={onClose}>- <SoulPanelBody expert={expert} onClose={onClose} />- </FullscreenDialog>- );- }-- const transition =- shouldReduceMotion || isResizing- ? { duration: 0 }- : { duration: PANEL_DURATION, ease: PANEL_EASE };-return (- <AnimatePresence>- {expert ? (- <motion.aside- data-soul-panel- aria-label={`${expert.name}'s Soul`}- initial={{ width: 0, opacity: 0 }}- animate={{ width: renderedWidth, opacity: 1 }}- exit={{ width: 0, opacity: 0 }}- transition={transition}- className="sticky top-0 h-svh shrink-0 self-start border-l border-l-[#80808017] bg-sidebar"- >- <PanelResizeHandle- panelSelector="[data-soul-panel]"- onWidthChange={setWidth}- onResizingChange={setIsResizing}- minWidth={MIN_PANEL_WIDTH}- maxWidth={maxWidth}- />- <div className="h-full overflow-hidden">- <div- style={{ width: renderedWidth }}- className="flex h-full min-h-0 flex-col"- >- <SoulPanelBody expert={expert} onClose={onClose} />- </div>- </div>- </motion.aside>- ) : null}- </AnimatePresence>+ <ExpertSidePanel+ identity={+ expert ? { name: expert.name, avatarUrl: expert.avatar_url } : null+ }+ title={expert ? `${expert.name}'s Soul` : ""}+ panelId="soul"+ closeLabel="Close Soul panel"+ onClose={onClose}+ >+ {expert ? <SoulPanelBody expert={expert} onClose={onClose} /> : null}+ </ExpertSidePanel>);}-function useMaxPanelWidth() {- const [maxWidth, setMaxWidth] = useState(DEFAULT_PANEL_WIDTH);-- useEffect(() => {- function update() {- setMaxWidth(- Math.max(- MIN_PANEL_WIDTH,- Math.round(window.innerWidth * MAX_PANEL_VIEWPORT_RATIO),- ),- );- }- update();- window.addEventListener("resize", update);- return () => window.removeEventListener("resize", update);- }, []);-- return maxWidth;-}-interface BodyProps {expert: Expert;onClose: () => void;@@ -125,69 +50,42 @@ function SoulPanelBody({ expert, onClose }: BodyProps) {const hasMoreBelow = useBottomScrollShadow(scrollElement);return (- <>- <div className="flex h-[53px] shrink-0 items-center gap-2 border-b border-b-[#80808017] px-3">- <Avatar className="h-7 w-7 shrink-0">- {expert.avatar_url ? (- <AvatarImage- src={expert.avatar_url}- alt={expert.name}- width={56}- height={56}- />- ) : null}- <AvatarFallback>{expert.name}</AvatarFallback>- </Avatar>- <h2 className="min-w-0 flex-1 truncate text-sm font-medium text-zinc-900">- {expert.name}'s Soul- </h2>- <button- type="button"- aria-label="Close Soul panel"- onClick={onClose}- className="rounded p-1.5 text-zinc-500 transition-colors hover:bg-zinc-100 hover:text-zinc-700"+ <form onSubmit={save} className="flex min-h-0 flex-1 flex-col">+ <div className="relative min-h-0 flex-1">+ <div+ ref={setScrollElement}+ className="h-full overflow-y-auto px-5 py-5">- <Icon icon={Cancel01Icon} size={16} />- </button>- </div>-- <form onSubmit={save} className="flex min-h-0 flex-1 flex-col">- <div className="relative min-h-0 flex-1">- <div- ref={setScrollElement}- className="h-full overflow-y-auto px-5 py-5"- >- <Text variant="small" className="mb-5 text-zinc-500">- A living document that shapes every reply.- </Text>- <SoulFields soul={soul} updateField={updateField} />- <LearnedNotes />- <ProtectedRules rules={expert.protected_soul_rules} />- </div>- <div- aria-hidden="true"- className={cn(- "pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t from-sidebar to-transparent transition-opacity duration-200",- hasMoreBelow ? "opacity-100" : "opacity-0",- )}- />+ <Text variant="small" tone="muted" className="mb-5">+ A living document that shapes every reply.+ </Text>+ <SoulFields soul={soul} updateField={updateField} />+ <LearnedNotes />+ <ProtectedRules rules={expert.protected_soul_rules} /></div>- <div className="flex shrink-0 justify-end gap-2 border-t border-t-[#80808017] px-5 py-3">- <Button type="button" variant="ghost" size="small" onClick={onClose}>- Cancel- </Button>- <Button- type="submit"- variant="primary"- size="small"- loading={isPending}- disabled={!canSave}- >- Save Soul- </Button>- </div>- </form>- </>+ <div+ aria-hidden="true"+ className={cn(+ "pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t from-sidebar to-transparent transition-opacity duration-200",+ hasMoreBelow ? "opacity-100" : "opacity-0",+ )}+ />+ </div>+ <div className="flex shrink-0 justify-end gap-2 border-t border-t-sidebar-border px-5 py-3">+ <Button type="button" variant="ghost" size="xs" onClick={onClose}>+ Cancel+ </Button>+ <Button+ type="submit"+ variant="primary"+ size="xs"+ loading={isPending}+ disabled={!canSave}+ >+ Save Soul+ </Button>+ </div>+ </form>);}@@ -255,7 +153,7 @@ function LearnedNotes() {return (<section className="mb-8"><SoulSectionTitle>What I've learned</SoulSectionTitle>- <Text variant="small" className="text-zinc-500">+ <Text variant="small" tone="muted">Nothing recorded yet. What this expert learns will appear here.</Text></section>@@ -271,16 +169,19 @@ function ProtectedRules({ rules }: { rules: string[] }) {</div><div className="space-y-2 rounded-xl bg-zinc-50 p-4">{rules.map((rule) => (- <div+ <Textkey={rule}- className="flex gap-2 text-sm leading-5 text-zinc-600"+ variant="body"+ as="div"+ tone="secondary"+ className="flex gap-2 leading-5"><Icon icon={LockIcon} size={14} className="mt-0.5 shrink-0" /><span>{rule}</span>- </div>+ </Text>))}</div>- <Text variant="small" className="mt-3 text-zinc-400">+ <Text variant="small" tone="muted" className="mt-3">These rules are part of every expert's soul and cannot be edited.</Text></section>@@ -288,5 +189,9 @@ function ProtectedRules({ rules }: { rules: string[] }) {}function SoulSectionTitle({ children }: { children: ReactNode }) {- return <h3 className="text-sm font-medium text-zinc-900">{children}</h3>;+ return (+ <Text variant="body-medium" as="h3" tone="primary">+ {children}+ </Text>+ );}diff --git a/autogpt_platform/frontend/src/app/(platform)/team/components/TeamHeaderActions.tsx b/autogpt_platform/frontend/src/app/(platform)/team/components/TeamHeaderActions.tsxindex 96b259eca6..bd74aad760 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/components/TeamHeaderActions.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/components/TeamHeaderActions.tsx@@ -1,9 +1,11 @@"use client";import { Button } from "@/components/atoms/Button/Button";-import { Icon } from "@/components/atoms/Icon/Icon";-import { SparklesIcon, UserGroupIcon } from "@hugeicons/core-free-icons";-import { ACTION_BUTTON_CLASS, OUTLINE_ACTION_BUTTON_CLASS } from "../helpers";+import {+ SparklesIcon,+ UserAdd01Icon,+ UserGroupIcon,+} from "@hugeicons/core-free-icons";interface Props {onNewPod: () => void;@@ -15,19 +17,26 @@ export function TeamHeaderActions({ onNewPod }: Props) {<Buttonas="NextLink"href="/raise"+ variant="secondary"+ size="xs"+ leadingIcon={SparklesIcon}+ >+ Raise expert+ </Button>+ <Button+ as="NextLink"+ href="/marketplace#experts"variant="primary"- size="small"- className={ACTION_BUTTON_CLASS}- leftIcon={<Icon icon={SparklesIcon} className="size-3.5" />}+ size="xs"+ leadingIcon={UserAdd01Icon}>- New Expert+ Hire expert</Button><Buttonvariant="outline"- size="small"+ size="xs"onClick={onNewPod}- className={OUTLINE_ACTION_BUTTON_CLASS}- leftIcon={<Icon icon={UserGroupIcon} className="size-3.5" />}+ leadingIcon={UserGroupIcon}>New Pod</Button>diff --git a/autogpt_platform/frontend/src/app/(platform)/team/components/TeamRoster/TeamRoster.tsx b/autogpt_platform/frontend/src/app/(platform)/team/components/TeamRoster/TeamRoster.tsxindex adaaaee284..ea5164320e 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/components/TeamRoster/TeamRoster.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/components/TeamRoster/TeamRoster.tsx@@ -4,7 +4,6 @@ import { Expert } from "@/app/api/__generated__/models/expert";import { GraphExecutionJobInfo } from "@/app/api/__generated__/models/graphExecutionJobInfo";import { Text } from "@/components/atoms/Text/Text";import { ReactNode } from "react";-import { cn } from "@/lib/utils";import {SECTION_INSET_CLASS,TEAM_GRID_CLASS,@@ -20,6 +19,7 @@ interface Props {experts: Expert[];schedulesForExpert: (expert: Expert) => GraphExecutionJobInfo[];renderCard: (expert: Expert) => ReactNode;+ onAutopilotChat: () => void;}export function TeamRoster({@@ -27,6 +27,7 @@ export function TeamRoster({experts,schedulesForExpert,renderCard,+ onAutopilotChat,}: Props) {const { query, setQuery, filter, setFilter, isNarrowed, visibleExperts } =useTeamRosterView({ experts, schedulesForExpert });@@ -38,13 +39,16 @@ export function TeamRoster({skillCount={summary.skillCount}scheduleCount={summary.scheduleCount}workflowCount={summary.workflowCount}+ onChat={onAutopilotChat}/>);return (<section aria-label="Experts" className="flex flex-col gap-4"><div className="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">- <Text variant="h5">Experts</Text>+ <Text variant="large-medium" as="h5" tone="primary">+ Experts+ </Text><TeamRosterToolbarquery={query}onQueryChange={setQuery}@@ -70,10 +74,7 @@ export function TeamRoster({)}{!isLoading && isNarrowed && visibleExperts.length === 0 ? (- <Text- variant="body"- className={cn("text-zinc-500", SECTION_INSET_CLASS)}- >+ <Text variant="body" tone="muted" className={SECTION_INSET_CLASS}>No experts match that search or filter.</Text>) : null}diff --git a/autogpt_platform/frontend/src/app/(platform)/team/helpers.ts b/autogpt_platform/frontend/src/app/(platform)/team/helpers.tsindex 27f4962707..df5b45d13e 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/helpers.ts+++ b/autogpt_platform/frontend/src/app/(platform)/team/helpers.ts@@ -2,6 +2,8 @@ import { Expert } from "@/app/api/__generated__/models/expert";import { ExpertPod } from "@/app/api/__generated__/models/expertPod";import { ExpertWorkflowRef } from "@/app/api/__generated__/models/expertWorkflowRef";import { GraphExecutionJobInfo } from "@/app/api/__generated__/models/graphExecutionJobInfo";+import { CopilotSkillInfo } from "@/app/api/__generated__/models/copilotSkillInfo";+import { LibraryAgent } from "@/app/api/__generated__/models/libraryAgent";import { findColorOption } from "@/app/(platform)/raise/components/ColorStep/helpers";import { formatDistanceToNow } from "date-fns";@@ -10,14 +12,10 @@ import { formatDistanceToNow } from "date-fns";* up with the text inside them instead of with the card edge. */export const SECTION_INSET_CLASS = "px-4";-/** The Button atom is pill-shaped and tall by default; team actions match the- * home briefing's compact row buttons. */+/** The Button atom's `xs` size for components that style a raw trigger instead+ * of taking Button props (schedule rows, the edit-schedule modal trigger). */export const ACTION_BUTTON_CLASS = "h-7 min-w-0 !rounded-md px-2.5 text-xs";-/** The `outline` variant's zinc-700 border is too heavy at this size, so team- * actions soften it while keeping the hover lift. */-export const OUTLINE_ACTION_BUTTON_CLASS = `${ACTION_BUTTON_CLASS} !border-zinc-200 hover:!border-zinc-300`;-interface PodGroup {pod: ExpertPod;experts: Expert[];@@ -28,8 +26,63 @@ export const AUTOPILOT_ROLE = "Head of AI";export const AUTOPILOT_BLURB ="Your built-in generalist. It answers questions, runs workflows, and delegates work across your hired experts.";+export const AUTOPILOT_PILL_CLASS =+ "border border-zinc-200 bg-zinc-50 text-zinc-700";++/** Autopilot owns whatever no hired expert does: every library workflow that+ * is not installed on an expert, shaped like an expert workflow so the expert+ * page's cards can render it. A schedule on the same graph gives it its cron. */+export function getAutopilotWorkflows(+ experts: Expert[],+ libraryAgents: LibraryAgent[],+ schedules: GraphExecutionJobInfo[],+): ExpertWorkflowRef[] {+ const owned = new Set(+ experts.flatMap((expert) =>+ expert.workflows.flatMap((workflow) =>+ [workflow.library_agent_id, workflow.graph_id].filter(Boolean),+ ),+ ),+ );+ return libraryAgents+ .filter((agent) => !owned.has(agent.id) && !owned.has(agent.graph_id))+ .map((agent) => {+ const schedule = schedules.find(+ (item) => item.graph_id === agent.graph_id,+ );+ return {+ id: agent.id,+ store_listing_version_id: null,+ library_agent_id: agent.id,+ graph_id: agent.graph_id,+ name: agent.name,+ description: agent.description || null,+ schedule_cron:+ schedule?.cron ?? agent.recommended_schedule_cron ?? null,+ schedule_id: schedule?.id ?? null,+ };+ });+}++/** Library skills no hired expert has claimed; Autopilot falls back to these. */+export function getAutopilotSkills(+ experts: Expert[],+ librarySkills: CopilotSkillInfo[],+) {+ const claimed = new Set(+ experts.flatMap((expert) =>+ expert.skills.map((name) => name.toLowerCase()),+ ),+ );+ return librarySkills+ .filter((skill) => !claimed.has(skill.name.toLowerCase()))+ .sort((a, b) => a.name.localeCompare(b.name));+}++/** Sized by the available width, not the viewport, so the roster reflows+ * when a side panel takes space. */export const TEAM_GRID_CLASS =- "grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3";+ "grid grid-cols-[repeat(auto-fill,minmax(300px,1fr))] gap-4";/** Mirrors `CreatePodRequest.name`'s `max_length` on the backend. */export const POD_NAME_MAX_LENGTH = 100;@@ -274,10 +327,10 @@ export function getAutopilotSummary({}/** Covers live at `public/experts/covers/<color token>.jpg`, one per raise-flow- * accent, plus `default.jpg` for experts without a colour (marketplace- * templates). */+ * accent. Experts without a colour (marketplace templates) and Autopilot+ * share `autopilot.jpg`. */export function getExpertCoverSrc(color: string | null | undefined) {- const token = findColorOption(color ?? null)?.id ?? "default";+ const token = findColorOption(color ?? null)?.id ?? "autopilot";return `/experts/covers/${token}.jpg`;}diff --git a/autogpt_platform/frontend/src/app/(platform)/team/page.tsx b/autogpt_platform/frontend/src/app/(platform)/team/page.tsxindex 4440004013..145fb73b44 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/page.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/page.tsx@@ -16,6 +16,7 @@ import { KanbanIcon, UserGroupIcon } from "@hugeicons/core-free-icons";import { Icon } from "@/components/atoms/Icon/Icon";import { notFound } from "next/navigation";import { EmptyTeamState } from "./components/EmptyTeamState";+import { ExpertChatDrawer } from "./components/ExpertChatDrawer/ExpertChatDrawer";import { ExpertTeamCard } from "./components/ExpertTeamCard/ExpertTeamCard";import { ExpertTeamCardSkeleton } from "./components/ExpertTeamCardSkeleton";import { NewPodDialog } from "./components/NewPodDialog/NewPodDialog";@@ -27,7 +28,7 @@ import { TEAM_GRID_CLASS } from "./helpers";import { useTeamPage } from "./useTeamPage";const MAIN_CLASS =- "mx-auto min-h-screen w-full max-w-[1180px] space-y-5 pb-16 pt-6 duration-500 animate-in fade-in slide-in-from-bottom-2 fill-mode-both motion-reduce:animate-none";+ "mx-auto min-h-screen w-full max-w-[1180px] space-y-5 px-4 pb-16 pt-6 duration-500 sm:px-8 md:px-12 animate-in fade-in slide-in-from-bottom-2 fill-mode-both motion-reduce:animate-none";const TABS = [{ value: "overview", label: "Team Overview", icon: UserGroupIcon },@@ -41,7 +42,6 @@ export default function TeamPage() {pods,podForExpert,podGroups,- ungroupedExperts,schedulesForExpert,isLoading,isError,@@ -53,6 +53,10 @@ export default function TeamPage() {soulDrawerKey,openSoul,closeSoul,+ chatTarget,+ chatDrawerKey,+ openChat,+ closeChat,isNewPodOpen,openNewPod,closeNewPod,@@ -87,6 +91,7 @@ export default function TeamPage() {currentPod={podForExpert(expert)}onInstallWorkflow={installWorkflow}onEditSoul={openSoul}+ onChat={openChat}onAssignPod={assignPod}/>);@@ -99,9 +104,11 @@ export default function TeamPage() {<div className="flex flex-col gap-1"><div className="flex items-center gap-2"><Icon icon={UserGroupIcon} size={18} className="text-zinc-950" />- <Text variant="h5">Team</Text>+ <Text variant="large-medium" as="h5" tone="primary">+ Team+ </Text></div>- <Text variant="body" className="max-w-prose text-zinc-600">+ <Text variant="body" tone="secondary" className="max-w-prose">Autopilot and your hired experts, ready to work.</Text></div>@@ -116,19 +123,14 @@ export default function TeamPage() {/>) : null}- <TabsLine defaultValue="overview">- <TabsLineList- flush- className="overflow-x-auto border-b-transparent"- indicatorClassName="bg-zinc-900"- >+ <TabsLine variant="compact" defaultValue="overview">+ <TabsLineList className="overflow-x-auto border-b-transparent">{TABS.map((tab) => (<TabsLineTriggerkey={tab.value}value={tab.value}- className="gap-1.5 px-2.5 py-2 text-xs leading-5 data-[state=active]:text-zinc-900"+ icon={tab.icon}>- <Icon icon={tab.icon} size={14} />{tab.label}</TabsLineTrigger>))}@@ -140,6 +142,7 @@ export default function TeamPage() {experts={hiredExperts}schedulesForExpert={schedulesForExpert}renderCard={renderCard}+ onAutopilotChat={() => openChat(null)}/>{!isLoading && !isError && hiredExperts.length === 0 ? (@@ -151,8 +154,8 @@ export default function TeamPage() {<PodBoardisLoading={isLoading}podGroups={podGroups}- ungroupedExperts={ungroupedExperts}onNewPod={openNewPod}+ renderCard={renderCard}/></TabsLineContent></TabsLine>@@ -172,6 +175,12 @@ export default function TeamPage() {</main><SoulDrawer key={soulDrawerKey} expert={soulExpert} onClose={closeSoul} />+ <ExpertChatDrawer+ target={chatTarget}+ threadKey={chatDrawerKey}+ onClose={closeChat}+ resumeLatest={false}+ /></div>);}diff --git a/autogpt_platform/frontend/src/app/(platform)/team/useTeamPage.ts b/autogpt_platform/frontend/src/app/(platform)/team/useTeamPage.tsindex 70601c0a5a..2394261fee 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/useTeamPage.ts+++ b/autogpt_platform/frontend/src/app/(platform)/team/useTeamPage.ts@@ -14,6 +14,11 @@ import { okData } from "@/app/api/helpers";import { toast } from "@/components/molecules/Toast/use-toast";import { useQueryClient } from "@tanstack/react-query";import { useState } from "react";+import {+ AUTOPILOT_CHAT_TARGET,+ ChatTarget,+ expertToChatTarget,+} from "./components/ExpertChatDrawer/helpers";import {getAssignToastTitle,getExpertSchedules,@@ -30,6 +35,8 @@ export function useTeamPage({ enabled }: Args) {const [pickerExpertId, setPickerExpertId] = useState<string | null>(null);const [soulExpertId, setSoulExpertId] = useState<string | null>(null);const [soulDrawerKey, setSoulDrawerKey] = useState(0);+ const [chatTarget, setChatTarget] = useState<ChatTarget | null>(null);+ const [chatDrawerKey, setChatDrawerKey] = useState(0);const [isNewPodOpen, setIsNewPodOpen] = useState(false);const expertsQuery = useListExperts({@@ -130,7 +137,7 @@ export function useTeamPage({ enabled }: Args) {const hiredExperts = getHiredExperts(expertsQuery.data ?? []);const schedules = schedulesQuery.data ?? [];- const { groups, ungrouped } = groupExpertsByPods(hiredExperts, pods);+ const { groups } = groupExpertsByPods(hiredExperts, pods);function schedulesForExpert(expert: Expert) {return getExpertSchedules(expert, schedules);@@ -157,10 +164,22 @@ export function useTeamPage({ enabled }: Args) {}function openSoul(expertId: string) {+ setChatTarget(null);setSoulExpertId(expertId);setSoulDrawerKey((current) => current + 1);}+ function openChat(expertId: string | null) {+ const expert = hiredExperts.find((candidate) => candidate.id === expertId);+ setSoulExpertId(null);+ setChatTarget(expert ? expertToChatTarget(expert) : AUTOPILOT_CHAT_TARGET);+ setChatDrawerKey((current) => current + 1);+ }++ function closeChat() {+ setChatTarget(null);+ }+function createPod(name: string) {createPodMutate({ data: { name } });}@@ -182,7 +201,6 @@ export function useTeamPage({ enabled }: Args) {pods,podForExpert,podGroups: groups,- ungroupedExperts: ungrouped,schedules,schedulesForExpert,isLoading:@@ -201,6 +219,10 @@ export function useTeamPage({ enabled }: Args) {soulDrawerKey,openSoul,closeSoul,+ chatTarget,+ chatDrawerKey,+ openChat,+ closeChat,isNewPodOpen,openNewPod,closeNewPod,