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(platform): expert profiles show what the expert sets up on day one (#14512)
Reinier van der Leerc6af21665df7
diff --git a/autogpt_platform/backend/backend/api/features/experts/experts_db.py b/autogpt_platform/backend/backend/api/features/experts/experts_db.pyindex f48c44f696..5c1d2ddd0e 100644--- a/autogpt_platform/backend/backend/api/features/experts/experts_db.py+++ b/autogpt_platform/backend/backend/api/features/experts/experts_db.py@@ -48,6 +48,7 @@ from backend.api.features.experts.models import (HireResult,RaiseAttachment,RaiseResult,+ decode_day_one,decode_voice_preferences,)from backend.api.features.experts.workflow_chain import (@@ -230,6 +231,7 @@ def _to_model(identity=row.identity,voice_preferences=voice_preferences,voice_samples=voice_samples,+ day_one=decode_day_one(row.dayOne),boundaries=row.boundaries,protected_soul_rules=list(PROTECTED_SOUL_RULES),is_template=row.isTemplate,@@ -774,6 +776,7 @@ async def hire_expert(user_id: str, template_id: str, name: str | None) -> HireR"tagline": template.tagline,"bio": template.bio,"skills": template.skills or [],+ # No dayOne: it is the template's pre-hire promise, not the hire's."identity": template.identity,"voicePreferences": template_voice,"boundaries": template.boundaries,diff --git a/autogpt_platform/backend/backend/api/features/experts/experts_db_test.py b/autogpt_platform/backend/backend/api/features/experts/experts_db_test.pyindex bff09a4986..5ef0f1d4c4 100644--- a/autogpt_platform/backend/backend/api/features/experts/experts_db_test.py+++ b/autogpt_platform/backend/backend/api/features/experts/experts_db_test.py@@ -18,6 +18,7 @@ import pytestimport backend.api.features.store.model as store_modelfrom backend.api.features.experts import experts_db, scheduling, seedfrom backend.api.features.experts.models import (+ ExpertDayOneItem,ExpertSoulFieldsPatch,ExpertSoulUpdate,HireResult,@@ -2745,6 +2746,33 @@ def test_roster_assigns_two_to_four_workflows_with_one_scheduled_cadence():assert scheduled == [EXPECTED_ROSTER_SCHEDULE]+def test_roster_day_one_is_marias_three_rows_and_hidden_for_the_rest():+ day_one = {entry["name"]: entry["day_one"] for entry in seed.ROSTER}++ assert [(item.title, item.timing) for item in day_one["Maria"]] == [+ ("Social listening on your brand", "first scan · 1 hr"),+ ("Morning briefing, in your Slack", "tomorrow · 9 AM"),+ ("Two-week content calendar", "day 1"),+ ]+ # Max's and Frankie's rows are the roster owner's to write.+ assert day_one["Max"] == []+ assert day_one["Frankie"] == []++[email protected](loop_scope="session")+async def test_upsert_template_refuses_a_fourth_day_one_row_before_writing():+ maria = next(entry for entry in seed.ROSTER if entry["name"] == "Maria")+ too_many = maria.copy()+ too_many["day_one"] = [*maria["day_one"], maria["day_one"][0]]++ with (+ patch.object(prisma.models.Expert, "prisma") as expert_client,+ pytest.raises(pydantic.ValidationError),+ ):+ await seed._upsert_template(too_many)+ expert_client.assert_not_called()++@pytest.mark.asyncio(loop_scope="session")async def test_roster_preloads_resolve_and_hire_installs_cleanly(server: SpinTestServer,@@ -2767,6 +2795,7 @@ async def test_roster_preloads_resolve_and_hire_installs_cleanly(for entry in seed.ROSTER:expected_versions = {expected[p["slug"]] for p in entry["preloads"]}assert len(expected_versions) == len(entry["preloads"])+ assert templates[entry["name"]].day_one == entry["day_one"]assert {w.store_listing_version_id for w in templates[entry["name"]].workflows} == expected_versions@@ -2782,6 +2811,7 @@ async def test_roster_preloads_resolve_and_hire_installs_cleanly(assert frankie_crons == ["40 7 * * *"]for name in ("Maria", "Max"):assert all(w.schedule_cron is None for w in results[name].expert.workflows)+ assert all(result.expert.day_one == [] for result in results.values())@pytest.mark.asyncio(loop_scope="session")@@ -3292,9 +3322,13 @@ async def test_seed_backfills_presentation_fields_onto_hired_copies("identity": template.identity,"voice_preferences": "Clear and confident.","boundaries": "Never invent customer evidence.",+ "day_one": [ExpertDayOneItem(title="Social listening on your brand")],"preloads": [],}refreshed_template = await seed._upsert_template(entry)+ assert refreshed_template.dayOne == [+ {"title": "Social listening on your brand", "description": "", "timing": ""}+ ]assert await seed._backfill_hired_copies(refreshed_template) == 1refreshed = await experts_db.get_expert(test_user.id, hired.expert.id)@@ -3306,6 +3340,8 @@ async def test_seed_backfills_presentation_fields_onto_hired_copies(# skills neither replace the owner's nor get merged back into them.assert refreshed.skills == ["Customer interviews"]assert refreshed.name == "My Maria"+ # Day one stays on the template; the backfill must not copy it onto hires.+ assert refreshed.day_one == []# ─── Pods ──────────────────────────────────────────────────────────────diff --git a/autogpt_platform/backend/backend/api/features/experts/models.py b/autogpt_platform/backend/backend/api/features/experts/models.pyindex 1f48f9a054..48a959c08a 100644--- a/autogpt_platform/backend/backend/api/features/experts/models.py+++ b/autogpt_platform/backend/backend/api/features/experts/models.py@@ -1,9 +1,9 @@import jsonfrom datetime import date, datetime-from typing import Literal+from typing import Annotated, Literalfrom urllib.parse import urlparse-from pydantic import BaseModel, Field, ValidationError, field_validator+from pydantic import BaseModel, Field, TypeAdapter, ValidationError, field_validatorfrom backend.data.expert_run_output import OutputType@@ -164,6 +164,33 @@ class ExpertCredentialRef(BaseModel):type: str+EXPERT_DAY_ONE_MAX_ITEMS = 3+++class ExpertDayOneItem(BaseModel):+ """One row of a template profile's "What {name} sets up on day one",+ written by the template's creator rather than derived from its workflows."""++ title: str = Field(min_length=1, max_length=80)+ description: str = Field(default="", max_length=240)+ timing: str = Field(default="", max_length=40)++ @field_validator("title", mode="before")+ @classmethod+ def strip_title(cls, value: object) -> object:+ return _strip_required_soul_field(value)++ @field_validator("description", "timing", mode="before")+ @classmethod+ def strip_optional_fields(cls, value: object) -> object:+ return _strip_optional_soul_field(value)+++_DAY_ONE_ITEMS: TypeAdapter[list[ExpertDayOneItem]] = TypeAdapter(+ Annotated[list[ExpertDayOneItem], Field(max_length=EXPERT_DAY_ONE_MAX_ITEMS)]+)++class Expert(BaseModel):id: strname: str@@ -180,6 +207,10 @@ class Expert(BaseModel):# pick; always empty on hired copies, which persist the user's plain-text# choice in voice_preferences instead.voice_samples: list[VoiceSample] = []+ # Roster templates only; a hire does not copy it.+ day_one: list[ExpertDayOneItem] = Field(+ default=[], max_length=EXPERT_DAY_ONE_MAX_ITEMS+ )boundaries: strprotected_soul_rules: list[str]is_template: bool@@ -462,3 +493,17 @@ def decode_voice_preferences(raw: str) -> tuple[str, list[VoiceSample]]:except ValidationError:continuereturn description, samples+++def encode_day_one(items: list[ExpertDayOneItem]) -> list[dict[str, str]]:+ """Validate a template's day-one rows, cap included, into ``dayOne`` JSON."""+ return _DAY_ONE_ITEMS.dump_python(_DAY_ONE_ITEMS.validate_python(items))+++def decode_day_one(raw: object) -> list[ExpertDayOneItem]:+ """Inverse of ``encode_day_one``. A malformed column hides the section+ instead of failing every templates read."""+ try:+ return _DAY_ONE_ITEMS.validate_python(raw or [])+ except ValidationError:+ return []diff --git a/autogpt_platform/backend/backend/api/features/experts/models_test.py b/autogpt_platform/backend/backend/api/features/experts/models_test.pyindex b5dffdc12b..9b1489ef59 100644--- a/autogpt_platform/backend/backend/api/features/experts/models_test.py+++ b/autogpt_platform/backend/backend/api/features/experts/models_test.py@@ -4,12 +4,17 @@ import pytestfrom pydantic import ValidationErrorfrom backend.api.features.experts.models import (+ EXPERT_DAY_ONE_MAX_ITEMS,EXPERT_IDENTITY_MAX_LENGTH,+ Expert,+ ExpertDayOneItem,ExpertSoulFieldsPatch,ExpertSoulUpdate,RaiseAttachment,VoiceSample,+ decode_day_one,decode_voice_preferences,+ encode_day_one,encode_voice_preferences,validate_avatar_url,)@@ -117,6 +122,49 @@ def test_decode_mixed_sample_list_keeps_only_valid_samples():assert samples == [VoiceSample(label="Punchy", text="Ship it.")]+def test_day_one_round_trips_stripped():+ items = [+ ExpertDayOneItem(+ title=" Social listening ",+ description=" Tracks mentions. ",+ timing=" first scan · 1 hr ",+ )+ ]++ encoded = encode_day_one(items)++ assert encoded == [+ {+ "title": "Social listening",+ "description": "Tracks mentions.",+ "timing": "first scan · 1 hr",+ }+ ]+ assert decode_day_one(encoded) == items+++def test_day_one_caps_at_three_rows():+ row = ExpertDayOneItem(title="Row")++ assert len(encode_day_one([row] * EXPERT_DAY_ONE_MAX_ITEMS)) == 3+ with pytest.raises(ValidationError):+ encode_day_one([row] * (EXPERT_DAY_ONE_MAX_ITEMS + 1))+ assert Expert.model_json_schema()["properties"]["day_one"]["maxItems"] == 3+++def test_day_one_item_rejects_a_blank_title():+ with pytest.raises(ValidationError):+ ExpertDayOneItem(title=" ")+++ "raw",+ [None, "not a list", [{"title": ""}], [{"title": "Row"}] * 4],+)+def test_decode_day_one_hides_malformed_values(raw: object):+ assert decode_day_one(raw) == []++def test_raise_attachment_strips_id():attachment = RaiseAttachment(kind="workflow", source="library", id=" agent-1 ")assert attachment.id == "agent-1"diff --git a/autogpt_platform/backend/backend/api/features/experts/routes_test.py b/autogpt_platform/backend/backend/api/features/experts/routes_test.pyindex fe85e9c3e5..5f3868f03f 100644--- a/autogpt_platform/backend/backend/api/features/experts/routes_test.py+++ b/autogpt_platform/backend/backend/api/features/experts/routes_test.py@@ -25,6 +25,7 @@ from backend.api.features.experts.models import (Expert,ExpertActivity,ExpertActivityDay,+ ExpertDayOneItem,ExpertIdentity,ExpertPod,ExpertRun,@@ -122,6 +123,13 @@ def test_list_expert_templates(id="template-1",is_template=True,source_template_id=None,+ day_one=[+ ExpertDayOneItem(+ title="Social listening on your brand",+ description="Tracks mentions across X, LinkedIn, Reddit, and news.",+ timing="first scan · 1 hr",+ )+ ],workflows=[_make_workflow_ref(library_agent_id=None, graph_id=None),],diff --git a/autogpt_platform/backend/backend/api/features/experts/seed.py b/autogpt_platform/backend/backend/api/features/experts/seed.pyindex 55eecf85c9..e7f0dbceae 100644--- a/autogpt_platform/backend/backend/api/features/experts/seed.py+++ b/autogpt_platform/backend/backend/api/features/experts/seed.py@@ -17,9 +17,15 @@ from typing import TypedDictimport prisma.models-from backend.api.features.experts.models import VoiceSample, encode_voice_preferences+from backend.api.features.experts.models import (+ ExpertDayOneItem,+ VoiceSample,+ encode_day_one,+ encode_voice_preferences,+)from backend.data import db as databasefrom backend.util.clients import get_scheduler_client+from backend.util.json import SafeJsonlogger = logging.getLogger(__name__)@@ -53,6 +59,8 @@ class RosterEntry(TypedDict):# the "how should {name} write?" pick right after hire.voice_samples: list[VoiceSample]boundaries: str+ # Up to three rows for the profile's "sets up on day one"; empty hides it.+ day_one: list[ExpertDayOneItem]preloads: list[PreloadSeed]@@ -87,6 +95,23 @@ You are direct about trade-offs. If a campaign idea is clever but off-brand, you),],"boundaries": "Never invent customer claims or statistics. Ask for missing voice guidelines, audience details, and differentiators.",+ "day_one": [+ ExpertDayOneItem(+ title="Social listening on your brand",+ description="Tracks mentions of your brand, product, and founders across X, LinkedIn, Reddit, and news.",+ timing="first scan · 1 hr",+ ),+ ExpertDayOneItem(+ title="Morning briefing, in your Slack",+ description="“Your brand was mentioned 6 times overnight — 2 need replies.” Delivered 9:00 AM, in her voice, with drafts attached.",+ timing="tomorrow · 9 AM",+ ),+ ExpertDayOneItem(+ title="Two-week content calendar",+ description="A skeleton calendar built from your site, your niche, and what competitors are shipping. You approve before anything posts.",+ timing="day 1",+ ),+ ],"preloads": [{"slug": "linkedin-post-generator", "cron": None},{"slug": "automated-blog-writer", "cron": None},@@ -123,6 +148,7 @@ You are rigorous about data quality. You flag when contact information looks sta),],"boundaries": "Never fabricate prospect details. Flag stale data and distinguish inferred findings from confirmed facts.",+ "day_one": [],"preloads": [{"slug": "lead-finder-local-businesses", "cron": None},{"slug": "business-ownerceo-finder", "cron": None},@@ -159,6 +185,7 @@ You are conservative about commitments. You never promise a delivery date, refun),],"boundaries": "Never promise dates, refunds, or policy exceptions. Draft sensitive commitments and flag them for human approval.",+ "day_one": [],"preloads": [{"slug": "smart-meeting-brief", "cron": None},{"slug": "automated-support-ai", "cron": None},@@ -291,6 +318,7 @@ async def _upsert_template(entry: RosterEntry) -> prisma.models.Expert:"boundaries": entry["boundaries"],"bio": entry["bio"],"skills": entry["skills"],+ "dayOne": SafeJson(encode_day_one(entry["day_one"])),"isArchived": False,}template = await prisma.models.Expert.prisma().find_first(diff --git a/autogpt_platform/backend/migrations/20260911000000_add_expert_day_one/migration.sql b/autogpt_platform/backend/migrations/20260911000000_add_expert_day_one/migration.sqlnew file mode 100644index 0000000000..3034738712--- /dev/null+++ b/autogpt_platform/backend/migrations/20260911000000_add_expert_day_one/migration.sql@@ -0,0 +1 @@+ALTER TABLE "Expert" ADD COLUMN "dayOne" JSONB;diff --git a/autogpt_platform/backend/schema.prisma b/autogpt_platform/backend/schema.prismaindex 79b476bd91..016bc6b0d8 100644--- a/autogpt_platform/backend/schema.prisma+++ b/autogpt_platform/backend/schema.prisma@@ -1059,6 +1059,9 @@ model Expert {toolProfile Json?+ // Template-only: up to three creator-written "sets up on day one" rows.+ dayOne Json?+isTemplate Boolean @default(false)sourceTemplateId String?SourceTemplate Expert? @relation("ExpertFromTemplate", fields: [sourceTemplateId], references: [id])diff --git a/autogpt_platform/backend/snapshots/expert_pod_assign b/autogpt_platform/backend/snapshots/expert_pod_assignindex 0bcc127cb5..47ebc64ceb 100644--- a/autogpt_platform/backend/snapshots/expert_pod_assign+++ b/autogpt_platform/backend/snapshots/expert_pod_assign@@ -5,6 +5,7 @@"color": "","credential_count": 0,"credential_providers": [],+ "day_one": [],"id": "expert-1","identity": "You are Maria, a pragmatic marketing specialist.","is_archived": false,diff --git a/autogpt_platform/backend/snapshots/expert_raise_attachment_installation_failure b/autogpt_platform/backend/snapshots/expert_raise_attachment_installation_failureindex 1e9dfbda79..82ef1dd20d 100644--- a/autogpt_platform/backend/snapshots/expert_raise_attachment_installation_failure+++ b/autogpt_platform/backend/snapshots/expert_raise_attachment_installation_failure@@ -6,6 +6,7 @@"color": "","credential_count": 0,"credential_providers": [],+ "day_one": [],"id": "raised-3","identity": "I'm Nova, raised by you. I learn how you work and grow with you.","is_archived": false,diff --git a/autogpt_platform/backend/snapshots/expert_raise_attachments b/autogpt_platform/backend/snapshots/expert_raise_attachmentsindex b673376893..44a4e06aed 100644--- a/autogpt_platform/backend/snapshots/expert_raise_attachments+++ b/autogpt_platform/backend/snapshots/expert_raise_attachments@@ -6,6 +6,7 @@"color": "","credential_count": 0,"credential_providers": [],+ "day_one": [],"id": "raised-2","identity": "I'm Nova, raised by you. I learn how you work and grow with you.","is_archived": false,diff --git a/autogpt_platform/backend/snapshots/expert_raise_default b/autogpt_platform/backend/snapshots/expert_raise_defaultindex 6261b20ba5..47f5f18084 100644--- a/autogpt_platform/backend/snapshots/expert_raise_default+++ b/autogpt_platform/backend/snapshots/expert_raise_default@@ -6,6 +6,7 @@"color": "","credential_count": 0,"credential_providers": [],+ "day_one": [],"id": "raised-1","identity": "I'm Otto, raised by you. I learn how you work and grow with you.","is_archived": false,diff --git a/autogpt_platform/backend/snapshots/expert_soul_update b/autogpt_platform/backend/snapshots/expert_soul_updateindex 90757582f4..39796d079a 100644--- a/autogpt_platform/backend/snapshots/expert_soul_update+++ b/autogpt_platform/backend/snapshots/expert_soul_update@@ -5,6 +5,7 @@"color": "","credential_count": 0,"credential_providers": [],+ "day_one": [],"id": "expert-1","identity": "You are Mara, a thoughtful strategist.","is_archived": false,diff --git a/autogpt_platform/backend/snapshots/expert_templates_list b/autogpt_platform/backend/snapshots/expert_templates_listindex dc90c2e878..239260528a 100644--- a/autogpt_platform/backend/snapshots/expert_templates_list+++ b/autogpt_platform/backend/snapshots/expert_templates_list@@ -6,6 +6,13 @@"color": "","credential_count": 0,"credential_providers": [],+ "day_one": [+ {+ "description": "Tracks mentions across X, LinkedIn, Reddit, and news.",+ "timing": "first scan \u00b7 1 hr",+ "title": "Social listening on your brand"+ }+ ],"id": "template-1","identity": "You are Maria, a pragmatic marketing specialist.","is_archived": false,diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/[expertId]/components/ExpertDayOne.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/[expertId]/components/ExpertDayOne.tsxnew file mode 100644index 0000000000..fe14d68619--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/[expertId]/components/ExpertDayOne.tsx@@ -0,0 +1,54 @@+import { ExpertDayOneItem } from "@/app/api/__generated__/models/expertDayOneItem";+import { cn } from "@/lib/utils";+import type { ExpertAccent } from "../../../components/ExpertsSection/helpers";+import { ExpertSection } from "./ExpertSection";++interface Props {+ name: string;+ items: ExpertDayOneItem[];+ accent: ExpertAccent;+}++export function ExpertDayOne({ name, items, accent }: Props) {+ if (items.length === 0) return null;++ return (+ <ExpertSection title={`What ${name} sets up on day one`}>+ <ol className="flex flex-col divide-y divide-zinc-100 rounded-xl border border-zinc-200 bg-white">+ {items.map((item, index) => (+ <li+ key={`${index}-${item.title}`}+ className="flex items-start gap-3 px-4 py-3.5"+ >+ <span+ aria-hidden="true"+ className={cn(+ "flex size-6 shrink-0 items-center justify-center rounded-full text-xs font-semibold tabular-nums",+ accent.pill,+ )}+ >+ {index + 1}+ </span>+ <div className="flex min-w-0 flex-1 flex-col gap-1.5 sm:flex-row sm:items-start sm:gap-3">+ <div className="min-w-0 flex-1">+ <div className="break-words text-sm font-semibold leading-6 text-zinc-900">+ {item.title}+ </div>+ {item.description ? (+ <p className="break-words text-[13px] leading-5 text-zinc-500">+ {item.description}+ </p>+ ) : null}+ </div>+ {item.timing ? (+ <span className="shrink-0 self-start whitespace-nowrap rounded-full bg-zinc-100 px-2.5 py-0.5 text-xs font-medium leading-5 text-zinc-600">+ {item.timing}+ </span>+ ) : null}+ </div>+ </li>+ ))}+ </ol>+ </ExpertSection>+ );+}diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/[expertId]/components/ExpertPage.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/[expertId]/components/ExpertPage.tsxindex 924b5faa03..170f647a80 100644--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/[expertId]/components/ExpertPage.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/[expertId]/components/ExpertPage.tsx@@ -17,6 +17,7 @@ import { ReactNode } from "react";import { ExpertAbout } from "./ExpertAbout";import { ExpertAccess } from "./ExpertAccess";import { ExpertComingSoonLabel } from "./ExpertComingSoonLabel";+import { ExpertDayOne } from "./ExpertDayOne";import { ExpertHireActions } from "./ExpertHireActions";import { ExpertPageHeader } from "./ExpertPageHeader";import { ExpertPlanNote } from "./ExpertPlanNote";@@ -127,6 +128,11 @@ export function ExpertPage() {<BackToMarketplaceLink /><ExpertPageHeader expert={expert} accent={accent} actions={actions} /><div className="mt-8 flex flex-col gap-10 border-t border-zinc-200 pt-8">+ <ExpertDayOne+ name={firstName}+ items={expert.day_one ?? []}+ accent={accent}+ /><ExpertAbout key={expert.id} text={expert.bio || expert.identity} /><ExpertSkills skills={expert.skills ?? []} accent={accent} /><ExpertWorkflowListdiff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/__tests__/expert-page.test.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/__tests__/expert-page.test.tsxindex 0911adcbe3..f549b7c378 100644--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/__tests__/expert-page.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/__tests__/expert-page.test.tsx@@ -5,6 +5,7 @@ import {getUpdateExpertSoulMockHandler,} from "@/app/api/__generated__/endpoints/experts/experts.msw";import { Expert } from "@/app/api/__generated__/models/expert";+import { ExpertDayOneItem } from "@/app/api/__generated__/models/expertDayOneItem";import { Toaster } from "@/components/molecules/Toast/toaster";import { getGetV1ListSystemProvidersMockHandler } from "@/app/api/__generated__/endpoints/integrations/integrations.msw";import { server } from "@/mocks/mock-server";@@ -120,6 +121,27 @@ const mariaWithSamples: Expert = {],};+const mariaDayOne = [+ {+ title: "Social listening on your brand",+ description:+ "Tracks mentions of your brand, product, and founders across X, LinkedIn, Reddit, and news.",+ timing: "first scan · 1 hr",+ },+ {+ title: "Morning briefing, in your Slack",+ description:+ "“Your brand was mentioned 6 times overnight — 2 need replies.” Delivered 9:00 AM, in her voice, with drafts attached.",+ timing: "tomorrow · 9 AM",+ },+ {+ title: "Two-week content calendar",+ description:+ "A skeleton calendar built from your site, your niche, and what competitors are shipping. You approve before anything posts.",+ timing: "day 1",+ },+] satisfies ExpertDayOneItem[];+function renderPage() {return render(<>@@ -230,6 +252,52 @@ describe("Marketplace expert page", () => {).toBeDefined();});+ test("lists the creator's day-one rows above the skills", async () => {+ server.use(+ getListExpertTemplatesMockHandler([+ { ...mariaTemplate, day_one: mariaDayOne },+ ]),+ getListExpertsMockHandler([]),+ );++ renderPage();++ const dayOne = await screen.findByRole("region", {+ name: "What Maria sets up on day one",+ });+ const rows = within(dayOne).getAllByRole("listitem");+ expect(rows).toHaveLength(3);+ mariaDayOne.forEach((item, index) => {+ const row = within(rows[index]);+ expect(row.getByText(String(index + 1))).toBeDefined();+ expect(row.getByText(item.title)).toBeDefined();+ expect(row.getByText(item.description)).toBeDefined();+ expect(row.getByText(item.timing)).toBeDefined();+ });+ // Nothing in the section is derived from the bundled workflows.+ expect(within(dayOne).queryByText("LinkedIn Post Generator")).toBeNull();+ const skills = screen.getByRole("region", { name: "Skills" });+ expect(+ dayOne.compareDocumentPosition(skills) & Node.DOCUMENT_POSITION_FOLLOWING,+ ).toBeTruthy();+ });++ test("hides the day-one section when the creator wrote none", async () => {+ server.use(+ getListExpertTemplatesMockHandler([{ ...mariaTemplate, day_one: [] }]),+ getListExpertsMockHandler([]),+ );++ renderPage();++ expect(+ await screen.findByRole("heading", { level: 1, name: "Maria" }),+ ).toBeDefined();+ expect(+ screen.queryByRole("region", { name: /sets up on day one/ }),+ ).toBeNull();+ });+test("waits for the roster before offering to hire an expert already hired", async () => {let releaseRoster = () => {};const rosterHeld = new Promise<void>((resolve) => {diff --git a/autogpt_platform/frontend/src/app/api/openapi.json b/autogpt_platform/frontend/src/app/api/openapi.jsonindex c0202f97ca..4aa64ce467 100644--- a/autogpt_platform/frontend/src/app/api/openapi.json+++ b/autogpt_platform/frontend/src/app/api/openapi.json@@ -20588,6 +20588,13 @@"title": "Voice Samples","default": []},+ "day_one": {+ "items": { "$ref": "#/components/schemas/ExpertDayOneItem" },+ "type": "array",+ "maxItems": 3,+ "title": "Day One",+ "default": []+ },"boundaries": { "type": "string", "title": "Boundaries" },"protected_soul_rules": {"items": { "type": "string" },@@ -20733,6 +20740,32 @@"title": "ExpertCredentialRef","description": "One integration credential an expert is allowed to use.\n\n``title``/``type`` are read from the owner's live credential rather than\nstored on the grant, so a renamed credential renames everywhere at once."},+ "ExpertDayOneItem": {+ "properties": {+ "title": {+ "type": "string",+ "maxLength": 80,+ "minLength": 1,+ "title": "Title"+ },+ "description": {+ "type": "string",+ "maxLength": 240,+ "title": "Description",+ "default": ""+ },+ "timing": {+ "type": "string",+ "maxLength": 40,+ "title": "Timing",+ "default": ""+ }+ },+ "type": "object",+ "required": ["title"],+ "title": "ExpertDayOneItem",+ "description": "One row of a template profile's \"What {name} sets up on day one\",\nwritten by the template's creator rather than derived from its workflows."+ },"ExpertDetachPreview": {"properties": {"schedule_names": {