Open-source social media scheduler built for AI agents and the teams behind them. Create, schedule and publish posts to every network through MCP or the REST API, or write them yourself in a composer your team will love.
PHP ai-agentsblueskyfacebookinstagramlaravellinkedinmastodonmcpmcp-serveropen-sourcerest-apiself-hostedsocial-mediasocial-media-managementsocial-media-schedulerthreadstiktokvuejsxyoutube
Replace the Welcome MCP step with an in-app card (#460)
Paulo Castellanoad0b83ec4687
diff --git a/AGENTS.md b/AGENTS.mdindex 5c487ee2c..85a76efbe 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -249,6 +249,24 @@ Typing the exact name is the stronger guard for the identity-bound ones, on purp- **Exception — disconnecting a channel** (`DisconnectChannelDialog`, user decision October 2026): its keyword, `channels.disconnect_modal.keyword`, is translated and **lowercase** (`disconnect`, `desconectar`, …), shown as the input placeholder and in the copyable keyword line `Type [disconnect ⧉] to confirm.` (same markup as `ConfirmDeleteModal`), and still compared case-sensitively after trimming (`DISCONNECT` must not confirm). The dialog ends its description with a bold `This cannot be undone.` and offers **Refresh connection** before disconnecting. Do not carry either into the other dialogs.- **Disconnecting an MCP app** (`settings/workspace/Mcp.vue`, owner decision October 2026) asks for the same `channels.disconnect_modal.keyword`, not the app's name, so the word matches the channel dialog in every locale (compared case-sensitively after trimming). It keeps the plain `ConfirmDeleteModal` without the refresh option or the bold line.+## Browser storage (`localStorage`)++Everything the app keeps in the browser for a user lives in one key per user, `trypost:<user id>`, through `resources/js/lib/browserStorage.ts` (owner decision November 2026): `{ "version": 1, "user": { … }, "workspaces": { "<workspace id>": { … } } }`. `user` holds what applies in every workspace, `workspaces` what only makes sense in one (a channel id, a draft). Never add a `localStorage` key of your own.++- Add a new item to the typed `UserStorage` interface in `types/browser-storage.ts` (named `area.thing`, like lang keys; `BrowserStorage` there is the whole stored value) and read it with `useUserStorage(key, default)` (`composables/useBrowserStorage.ts`), which saves on set and follows the user's other tabs. A workspace item adds `WorkspaceStorage` and `useWorkspaceStorage` the first time one is needed.+- The store does the safe read and write: a missing, unreadable or other-version key reads as empty, a browser without storage works on the defaults, and every write reads the key again first so two tabs never write back a stale copy.+- The one exception is `trypost.media-source-popup`: not storage but a message the Canva / Google picker popup writes and removes at once, heard through the `storage` event on that key.+- The keys that predate the store move into it as tracked in #461 (when touched, not in a sweep).++## Inviting a user to connect an AI (MCP)++There is no MCP step in Welcome (owner decision November 2026): it was friction before the user ever saw the app, and phones could rarely finish it. Processing always opens the schedule. Instead, `components/mcp/McpPromptCard.vue` (mounted in `AppSidebarLayout`) invites the user from inside the app:++- **Shown** while the shared `mcpPrompt` prop is set (`HandleInertiaRequests::showsMcpPrompt()`, with the MCP URL the steps show: a current workspace whose account has app access, or self-hosted, and no AI of the user connected to that workspace (`HasConnectedMcpClient`, the rule the MCP settings list follows); cached five minutes per user and workspace, like the referral survey), on `sm` and up, never on the MCP settings page, and never while the "How did you find us?" survey shows (the survey goes first).+- **Closing it** (the X, labeled "Not now") is kept in the browser storage (`mcp.promptDismissed`, see "Browser storage"): no database column. Another browser shows it once more. Connecting an AI hides it everywhere, because that comes from the server.+- **The card** shows the best-known apps as overlapping avatars (ChatGPT first, on top), and two buttons in the brand colors of Claude and ChatGPT; the close button is the way out. Each opens that app's connect steps (`McpConnectDialog`) on the page the user is on. While the card or its steps are on screen, the card asks `app.mcp.prompt.show` every two seconds, so an AI connected from anywhere (the card, the MCP settings, another tab) hides it; only `connected: true` hides it with confetti (as the MCP settings do) and forgets the cache, never `mcpPrompt` turning null, which losing access or switching workspace also does.+- **Tracking:** each answer posts to `app.mcp.prompt.store`, which dispatches `mcp.prompt_clicked` (with the `client` picked: `claude`, `chatgpt` or `other`) or `mcp.prompt_dismissed` (`App\Enums\Mcp\PromptAnswer`). The connection itself is `mcp.connected` (`TrackMcpConnection`), whatever led to it.+## Writing in-app copyText inside the app (popovers, empty states, dialogs, tooltips that ask for an action, errors, toasts) talks to the end user, who is in the middle of doing something. Write it from their side, not from how the system is built. The `copywriting` skill in `.agents/skills` is for marketing pages; it does not apply here.@@ -299,9 +317,9 @@ Standing constraints:- An offer applies what its row sets: `stripe_coupon_id` (the discount), `trial_days` (clamped to Stripe's 2-day minimum), `allow_promotion_codes` and `requires_card`. Stripe rejects a coupon and promotion codes on one session but accepts a trial with either, so a coupon wins and the field is left off; a trial goes with both.- There are no fm1 coupon or promotion code envs any more (`STRIPE_*_FIRST_MONTH_COUPON_ID` and `CASHIER_ALLOW_PROMOTION_CODES` were removed in October 2026). Every offer reaches an account through its link: the 7-day trial (`ft7d`, `trial_days` 8 because Stripe Checkout counts the trial one day short and shows 8 as 7 days, `first_subscription_only`), the 7-day trial without a card (`ft7dnc`, `first_subscription_only`, so a former customer can never take free days again, `trial_days` 7: it never opens Stripe, so the generic trial lasts exactly what the row says), the `$1` first month (`fm1`, `first_subscription_only`) and Black Friday (`bf26`). There is no default offer: a signup without a link pays the full price. Do not reintroduce a checkout env.- First-subscription offers skip an account with a prior real subscription (`incomplete` / `incomplete_expired` still qualify).-- An owner without app access is always sent to the plan step (`EnsureAccountReady`, the MCP step, the old subscribe route): it sends them back to the first unanswered step, so a new owner still starts at persona while a former customer lands on the plan directly.+- An owner without app access is always sent to the plan step (`EnsureAccountReady`, the old subscribe route): it sends them back to the first unanswered step, so a new owner still starts at persona while a former customer lands on the plan directly.- Welcome checkout is the last Welcome step, the plan step (`app.welcome.plan.store`): it shows only **Socials**, monthly, and always opens Stripe Checkout on the **Socials monthly** price. Offers apply there and, coupons only, at **Subscribe now** on billing. Yearly and Workspaces stay on the billing change-plan picker for existing subscribers (no offer).-- An offer with `requires_card = false` and `trial_days` (`Offer::startsWithoutCard()`) never opens Stripe: the Welcome plan step starts Cashier's generic trial (`StartGenericTrial`: `accounts.trial_ends_at`, the Socials `plan_id`, the redemption, `trial.started`) and goes on to the MCP step (owner decision October 2026). The account has app access while it lasts (`Account::hasAppAccess()` = subscribed or `onGenericTrial()`), billing shows the trial and **Subscribe now** (`app.billing.checkout`), a Checkout on the plan's monthly price charged at once, without carrying the days left of the trial (owner decision October 2026), applies a coupon offer claimed meanwhile (never a trial) and returns to billing after paying (`app.billing.processing?from=billing`, read through `CheckoutOrigin`). Changing plan during the trial (the workspace upgrade picker; billing shows only Subscribe now) opens the same Checkout on the picked plan and interval, under the same `swapPlan` rules, which allow a generic trial. Only Socials monthly gets an offer (`StartSubscriptionCheckout::qualifiesForOffer()`). An old subscription ending during the trial leaves its plan alone, and a second submit of the no-card trial starts nothing. The Welcome no-card trial goes through Processing too (`from=welcome`, ready at once), so phones skip the MCP step like a paid checkout. Cashier's `customer.subscription.created` handler clears `trial_ends_at`. When the trial ends without a subscription, access stops and the owner is back at Welcome. Every other offer goes through Stripe Checkout and asks for a card.+- An offer with `requires_card = false` and `trial_days` (`Offer::startsWithoutCard()`) never opens Stripe: the Welcome plan step starts Cashier's generic trial (`StartGenericTrial`: `accounts.trial_ends_at`, the Socials `plan_id`, the redemption, `trial.started`) and goes on to Processing (owner decision October 2026). The account has app access while it lasts (`Account::hasAppAccess()` = subscribed or `onGenericTrial()`), billing shows the trial and **Subscribe now** (`app.billing.checkout`), a Checkout on the plan's monthly price charged at once, without carrying the days left of the trial (owner decision October 2026), applies a coupon offer claimed meanwhile (never a trial) and returns to billing after paying (`app.billing.processing?from=billing`, read through `CheckoutOrigin`). Changing plan during the trial (the workspace upgrade picker; billing shows only Subscribe now) opens the same Checkout on the picked plan and interval, under the same `swapPlan` rules, which allow a generic trial. Only Socials monthly gets an offer (`StartSubscriptionCheckout::qualifiesForOffer()`). An old subscription ending during the trial leaves its plan alone, and a second submit of the no-card trial starts nothing. The Welcome no-card trial goes through Processing too (`from=welcome`, ready at once), which opens the schedule like a paid checkout. Cashier's `customer.subscription.created` handler clears `trial_ends_at`. When the trial ends without a subscription, access stops and the owner is back at Welcome. Every other offer goes through Stripe Checkout and asks for a card.- Prefer documenting durable billing decisions here (and in `AGENTS.md`) — do **not** create a `.ai/` rules folder for this project.## Plans and the workspace limitdiff --git a/app/Actions/AccessToken/HasConnectedMcpClient.php b/app/Actions/AccessToken/HasConnectedMcpClient.phpnew file mode 100644index 000000000..3f0eae815--- /dev/null+++ b/app/Actions/AccessToken/HasConnectedMcpClient.php@@ -0,0 +1,25 @@+<?php++declare(strict_types=1);++namespace App\Actions\AccessToken;++use App\Models\AccessToken;+use App\Models\User;+use App\Models\Workspace;++class HasConnectedMcpClient+{+ /**+ * Whether the user has an AI connected to this workspace through MCP, as+ * the MCP settings list it: each connection belongs to one workspace.+ */+ public static function execute(User $user, Workspace $workspace): bool+ {+ return AccessToken::query()+ ->where('user_id', $user->id)+ ->where('workspace_id', $workspace->id)+ ->connectedMcpOAuth()+ ->exists();+ }+}diff --git a/app/Enums/Mcp/PromptAnswer.php b/app/Enums/Mcp/PromptAnswer.phpnew file mode 100644index 000000000..7414d6a30--- /dev/null+++ b/app/Enums/Mcp/PromptAnswer.php@@ -0,0 +1,24 @@+<?php++declare(strict_types=1);++namespace App\Enums\Mcp;++use App\Enums\PostHog\McpEvent;++/**+ * What the user did with the in-app card that invites them to connect an AI.+ */+enum PromptAnswer: string+{+ case Connect = 'connect';+ case Dismiss = 'dismiss';++ public function event(): McpEvent+ {+ return match ($this) {+ self::Connect => McpEvent::PromptClicked,+ self::Dismiss => McpEvent::PromptDismissed,+ };+ }+}diff --git a/app/Enums/PostHog/McpEvent.php b/app/Enums/PostHog/McpEvent.phpindex e0abbced9..184c1d9e7 100644--- a/app/Enums/PostHog/McpEvent.php+++ b/app/Enums/PostHog/McpEvent.php@@ -8,4 +8,6 @@ enum McpEvent: string{case Connected = 'mcp.connected';case ToolCalled = 'mcp.tool_called';+ case PromptClicked = 'mcp.prompt_clicked';+ case PromptDismissed = 'mcp.prompt_dismissed';}diff --git a/app/Enums/PostHog/WelcomeEvent.php b/app/Enums/PostHog/WelcomeEvent.phpindex f4e80fbdf..1b1ee0380 100644--- a/app/Enums/PostHog/WelcomeEvent.php+++ b/app/Enums/PostHog/WelcomeEvent.php@@ -10,8 +10,6 @@ enum WelcomeEvent: stringcase Goals = 'welcome.goals';case Software = 'welcome.software';case Referral = 'welcome.referral';- case McpConnectClicked = 'welcome.mcp.connect_clicked';- case McpSkipped = 'welcome.mcp.skipped';/*** Welcome capture order through Stripe Checkout.diff --git a/app/Http/Controllers/App/McpPromptController.php b/app/Http/Controllers/App/McpPromptController.phpnew file mode 100644index 000000000..4d783bfa3--- /dev/null+++ b/app/Http/Controllers/App/McpPromptController.php@@ -0,0 +1,64 @@+<?php++declare(strict_types=1);++namespace App\Http\Controllers\App;++use App\Actions\AccessToken\HasConnectedMcpClient;+use App\Enums\Mcp\PromptAnswer;+use App\Http\Middleware\App\HandleInertiaRequests;+use App\Http\Requests\App\Mcp\StoreMcpPromptRequest;+use App\Http\Resources\App\McpConnectionStatusResource;+use App\Jobs\PostHog\CaptureAccountEvent;+use App\Services\PostHogService;+use Illuminate\Http\Request;+use Illuminate\Http\Response;+use Illuminate\Support\Arr;+use Illuminate\Support\Facades\Cache;++class McpPromptController extends Controller+{+ /**+ * Whether the AI the user is connecting from the card has connected to+ * the current workspace; once it has, the card is no longer shared.+ */+ public function show(Request $request): McpConnectionStatusResource+ {+ $user = $request->user();+ $workspace = $user->currentWorkspace;+ $connected = filled($workspace) && HasConnectedMcpClient::execute($user, $workspace);++ if ($connected) {+ Cache::forget(HandleInertiaRequests::mcpPromptCacheKey($user, $workspace));+ }++ return new McpConnectionStatusResource($connected);+ }++ /**+ * Records what the user did with the card inviting them to connect an AI.+ * The card hides itself in the browser; this only tracks the answer.+ */+ public function store(StoreMcpPromptRequest $request): Response+ {+ $user = $request->user();+ $workspace = $user->currentWorkspace;+ $answer = $request->enum('answer', PromptAnswer::class);+ $properties = Arr::whereNotNull([+ 'workspace_id' => $workspace?->id,+ 'client' => $request->validated('client'),+ ]);++ rescue(function () use ($user, $workspace, $answer, $properties): void {+ CaptureAccountEvent::dispatchIf(+ PostHogService::isEnabled() && filled($workspace),+ (string) $user->id,+ (string) $workspace?->account_id,+ $answer->event(),+ $properties,+ );+ });++ return response()->noContent();+ }+}diff --git a/app/Http/Controllers/App/WelcomeController.php b/app/Http/Controllers/App/WelcomeController.phpindex 3e61d6d70..1676f4b61 100644--- a/app/Http/Controllers/App/WelcomeController.php+++ b/app/Http/Controllers/App/WelcomeController.php@@ -4,7 +4,6 @@ declare(strict_types=1);namespace App\Http\Controllers\App;-use App\Actions\AccessToken\ListConnectedMcpClients;use App\Actions\Billing\StartGenericTrial;use App\Actions\Billing\StartSubscriptionCheckout;use App\Enums\Billing\CheckoutOrigin;@@ -15,7 +14,6 @@ use App\Enums\User\Goal;use App\Enums\User\Persona;use App\Enums\User\PreviousSoftware;use App\Http\Requests\App\Welcome\StoreWelcomeGoalsRequest;-use App\Http\Requests\App\Welcome\StoreWelcomeMcpConnectClickRequest;use App\Http\Requests\App\Welcome\StoreWelcomePersonaRequest;use App\Http\Requests\App\Welcome\StoreWelcomeSoftwareRequest;use App\Http\Resources\App\OfferResource;@@ -187,60 +185,6 @@ class WelcomeController extends Controllerreturn $checkout->redirect($user->account, $priceId, route('app.welcome.plan'), $plan, $offer);}- public function mcp(Request $request): InertiaResponse|RedirectResponse- {- $user = $request->user();-- if (! $user->account?->hasAppAccess()) {- return redirect()->route('app.welcome.plan');- }-- $workspace = $user->currentWorkspace;-- if (blank($workspace)) {- return redirect()->route('app.workspaces.create');- }-- $this->authorize('view', $workspace);-- return Inertia::render('welcome/Mcp', [- 'mcpUrl' => route('mcp.trypost'),- 'connectedClients' => ListConnectedMcpClients::forUser($user, $workspace),- ]);- }-- public function storeMcpConnectClick(StoreWelcomeMcpConnectClickRequest $request, PostHogService $postHog): Response- {- $user = $request->user();-- $postHog->capture(- $user->id,- WelcomeEvent::McpConnectClicked->value,- ['client' => (string) $request->validated('client')],- $user->account,- );-- return response()->noContent();- }-- public function skipMcp(Request $request, PostHogService $postHog): RedirectResponse- {- $user = $request->user();-- if (! $user->account?->hasAppAccess()) {- return redirect()->route('app.welcome.plan');- }-- $postHog->capture(- $user->id,- WelcomeEvent::McpSkipped->value,- [],- $user->account,- );-- return redirect()->route('app.posts.index');- }-public function subscriptionRequired(Request $request): InertiaResponse|RedirectResponse{$user = $request->user();diff --git a/app/Http/Middleware/App/HandleInertiaRequests.php b/app/Http/Middleware/App/HandleInertiaRequests.phpindex 946a901a1..975891265 100644--- a/app/Http/Middleware/App/HandleInertiaRequests.php+++ b/app/Http/Middleware/App/HandleInertiaRequests.php@@ -4,6 +4,7 @@ declare(strict_types=1);namespace App\Http\Middleware\App;+use App\Actions\AccessToken\HasConnectedMcpClient;use App\Actions\Changelog\BuildChangelogProps;use App\Enums\Auth\SocialAuthProvider;use App\Enums\Media\Source as MediaSource;@@ -69,6 +70,7 @@ class HandleInertiaRequests extends Middleware'referralSources' => fn (): ?array => $this->showsReferralSources($user, $account, $isSelfHosted)? array_map(fn (ReferralSource $source): string => $source->value, ReferralSource::cases()): null,+ 'mcpPrompt' => fn (): ?array => $this->mcpPrompt($user, $isSelfHosted),'usage' => fn (): ?array => $account && ! $isSelfHosted ? $account->usage() : null,'features' => fn (): ?array => $account && ! $isSelfHosted ? $account->featureLimits() : null,...($user ? BuildChangelogProps::execute($user) : []),@@ -137,6 +139,41 @@ class HandleInertiaRequests extends Middlewarereturn "referral-sources.{$user->id}";}+ public static function mcpPromptCacheKey(User $user, Workspace $workspace): string+ {+ return "mcp-prompt.{$user->id}.{$workspace->id}";+ }++ /**+ * The card inviting the user to connect an AI, with the MCP URL its steps+ * show, while their workspace can use the app and has no AI of theirs+ * connected; null otherwise. Cached, and a connection made from the card+ * forgets the cache. Dismissing the card is kept in the browser.+ *+ * @return array{mcp_url: string}|null+ */+ private function mcpPrompt(?User $user, bool $isSelfHosted): ?array+ {+ $workspace = $user?->currentWorkspace;++ if (blank($workspace)) {+ return null;+ }++ $invites = Cache::remember(+ self::mcpPromptCacheKey($user, $workspace),+ now()->addMinutes(5),+ fn (): bool => ($isSelfHosted || $workspace->account?->hasAppAccess() === true)+ && ! HasConnectedMcpClient::execute($user, $workspace),+ );++ if (! $invites) {+ return null;+ }++ return ['mcp_url' => route('mcp.trypost')];+ }+private function showsReferralSources(?User $user, ?Account $account, bool $isSelfHosted): bool{if (blank($user)) {diff --git a/app/Http/Requests/App/Mcp/StoreMcpPromptRequest.php b/app/Http/Requests/App/Mcp/StoreMcpPromptRequest.phpnew file mode 100644index 000000000..1d551a310--- /dev/null+++ b/app/Http/Requests/App/Mcp/StoreMcpPromptRequest.php@@ -0,0 +1,33 @@+<?php++declare(strict_types=1);++namespace App\Http\Requests\App\Mcp;++use App\Enums\AccessToken\McpClient;+use App\Enums\Mcp\PromptAnswer;+use Illuminate\Foundation\Http\FormRequest;+use Illuminate\Validation\Rule;++class StoreMcpPromptRequest extends FormRequest+{+ public function authorize(): bool+ {+ return true;+ }++ /**+ * @return array<string, mixed>+ */+ public function rules(): array+ {+ return [+ 'answer' => ['required', Rule::enum(PromptAnswer::class)],+ 'client' => [+ Rule::excludeIf(fn (): bool => $this->input('answer') !== PromptAnswer::Connect->value),+ 'required',+ Rule::enum(McpClient::class),+ ],+ ];+ }+}diff --git a/app/Http/Requests/App/Welcome/StoreWelcomeMcpConnectClickRequest.php b/app/Http/Requests/App/Welcome/StoreWelcomeMcpConnectClickRequest.phpdeleted file mode 100644index 06ee625bd..000000000--- a/app/Http/Requests/App/Welcome/StoreWelcomeMcpConnectClickRequest.php+++ /dev/null@@ -1,27 +0,0 @@-<?php--declare(strict_types=1);--namespace App\Http\Requests\App\Welcome;--use App\Enums\AccessToken\McpClient;-use Illuminate\Foundation\Http\FormRequest;-use Illuminate\Validation\Rule;--class StoreWelcomeMcpConnectClickRequest extends FormRequest-{- public function authorize(): bool- {- return true;- }-- /**- * @return array<string, mixed>- */- public function rules(): array- {- return [- 'client' => ['required', Rule::enum(McpClient::class)],- ];- }-}diff --git a/app/Http/Resources/App/McpConnectionStatusResource.php b/app/Http/Resources/App/McpConnectionStatusResource.phpnew file mode 100644index 000000000..ead7e88e3--- /dev/null+++ b/app/Http/Resources/App/McpConnectionStatusResource.php@@ -0,0 +1,25 @@+<?php++declare(strict_types=1);++namespace App\Http\Resources\App;++use Illuminate\Http\Request;+use Illuminate\Http\Resources\Json\JsonResource;++/**+ * Whether the user's AI is connected to the current workspace yet, asked while+ * the MCP card's connect steps are open.+ */+class McpConnectionStatusResource extends JsonResource+{+ /**+ * @return array{connected: bool}+ */+ public function toArray(Request $request): array+ {+ return [+ 'connected' => (bool) $this->resource,+ ];+ }+}diff --git a/lang/ar/mcp.php b/lang/ar/mcp.phpindex 338ff3bd7..a0fe2988f 100644--- a/lang/ar/mcp.php+++ b/lang/ar/mcp.php@@ -76,5 +76,10 @@ return [],'waiting' => 'بانتظار اتصال الذكاء الاصطناعي…',],+ 'prompt' => [+ 'title' => 'لم يتم ربط أي ذكاء اصطناعي بعد',+ 'body' => 'اربط Claude أو ChatGPT لإنشاء منشوراتك وجدولتها وتحليلها بمجرد طلب ذلك.',+ 'not_now' => 'ليس الآن',+ ],];diff --git a/lang/ar/welcome.php b/lang/ar/welcome.phpindex 018e26e18..e070b6740 100644--- a/lang/ar/welcome.php+++ b/lang/ar/welcome.php@@ -50,40 +50,4 @@ return ['plan_terms' => 'ثم :price/شهر. ألغِ في أي وقت','plan_checkout_button' => 'فعّل حسابي','plan_cancel_anytime' => 'ألغِ في أي وقت',- 'mcp' => [- 'title' => 'أدِر حساباتك الاجتماعية من الدردشة',- 'description' => 'أنشئ منشوراتك في TryPost وجدولها وحللها باستخدام ذكائك الاصطناعي المفضل.',- 'connect_with' => 'الربط مع :client',- 'connect_ai' => 'اربط ذكاءك الاصطناعي',- 'pick_ai' => 'أين تريد استخدام TryPost؟',- 'connect_other' => 'ربط تطبيق آخر',- 'connected' => 'تم ربط :client',- 'benefits' => [- 'schedule' => [- 'title' => 'أنشئ وجدول من المحادثة',- 'hint' => 'دوّارات وسلاسل ومقاطع فيديو',- 'ask' => 'خذ الفكرة التالية من لوحتي وحوّلها إلى كاروسيل وجدوله يوم الثلاثاء الساعة :time على Instagram وLinkedIn.',- 'reply' => 'تم. جُدول الكاروسيل على Instagram وLinkedIn.',- ],- 'analytics' => [- 'title' => 'تابع نموّك',- 'hint' => 'كل حساباتك في تقرير واحد',- 'ask' => 'كيف كان شهري؟ هل كسبت متابعين؟',- 'reply' => 'اكتسبتَ 1,200 متابع هذا الشهر. كان LinkedIn الأسرع نموًا.',- ],- 'queue' => [- 'title' => 'املأ قائمة الانتظار',- 'hint' => 'في أفضل أوقات النشر',- 'ask' => 'خذ مسوداتي الجاهزة وأضفها إلى قائمة الانتظار في أوقاتي الفارغة القادمة.',- 'reply' => 'تم. مسوداتك الثلاث في قائمة الانتظار، في أوقات الغد الفارغة.',- ],- 'ideas' => [- 'title' => 'نظّم أفكارك',- 'hint' => 'من العصف الذهني إلى خطة المحتوى',- 'ask' => 'أعطني 8 أفكار منشورات للأسبوع القادم واحفظها في لوحتي.',- 'reply' => 'حفظت 8 أفكار في لوحتك، جاهزة لتتحول إلى منشورات.',- ],- ],- 'skip' => 'تخطَّ الآن',- ],];diff --git a/lang/de/mcp.php b/lang/de/mcp.phpindex f410c2bf6..cec49e662 100644--- a/lang/de/mcp.php+++ b/lang/de/mcp.php@@ -76,5 +76,10 @@ return [],'waiting' => 'Warte auf die Verbindung deiner KI…',],+ 'prompt' => [+ 'title' => 'Du hast noch keine KI verbunden',+ 'body' => 'Verbinde Claude oder ChatGPT, um Posts einfach per Nachricht zu erstellen, zu planen und zu analysieren.',+ 'not_now' => 'Nicht jetzt',+ ],];diff --git a/lang/de/welcome.php b/lang/de/welcome.phpindex ae9b14a9a..825a87cc6 100644--- a/lang/de/welcome.php+++ b/lang/de/welcome.php@@ -50,40 +50,4 @@ return ['plan_terms' => 'Danach :price/Monat. Jederzeit kündbar','plan_checkout_button' => 'Mein Konto aktivieren','plan_cancel_anytime' => 'Jederzeit kündbar',- 'mcp' => [- 'title' => 'Social Media per Chat steuern',- 'description' => 'Erstelle, plane und analysiere Posts in TryPost mit deiner Lieblings-KI.',- 'connect_with' => 'Mit :client verbinden',- 'connect_ai' => 'Deine KI verbinden',- 'pick_ai' => 'Wo willst du TryPost nutzen?',- 'connect_other' => 'Andere App verbinden',- 'connected' => ':client ist verbunden',- 'benefits' => [- 'schedule' => [- 'title' => 'Erstellen und planen im Chat',- 'hint' => 'Karussells, Threads und Videos',- 'ask' => 'Nimm die nächste Idee vom Board, mach ein Karussell daraus und plane es für Dienstag, :time, auf Instagram und LinkedIn.',- 'reply' => 'Erledigt. Dein Karussell ist auf Instagram und LinkedIn geplant.',- ],- 'analytics' => [- 'title' => 'Verfolge dein Wachstum',- 'hint' => 'Alle Konten in einem Bericht',- 'ask' => 'Wie war mein Monat? Habe ich Follower gewonnen?',- 'reply' => 'Du hast diesen Monat 1,2 Tsd. Follower gewonnen. LinkedIn ist am stärksten gewachsen.',- ],- 'queue' => [- 'title' => 'Fülle deine Warteschlange',- 'hint' => 'Zu deinen besten Zeiten',- 'ask' => 'Nimm meine fertigen Entwürfe und pack sie in meine nächsten freien Slots.',- 'reply' => 'Erledigt. Deine 3 Entwürfe stehen in der Warteschlange, in den freien Slots von morgen.',- ],- 'ideas' => [- 'title' => 'Ordne deine Ideen',- 'hint' => 'Vom Brainstorming zum Redaktionsplan',- 'ask' => 'Gib mir 8 Post-Ideen für nächste Woche und speichere sie auf meinem Board.',- 'reply' => 'Ich habe 8 Ideen auf deinem Board gespeichert, bereit für neue Posts.',- ],- ],- 'skip' => 'Jetzt überspringen',- ],];diff --git a/lang/el/mcp.php b/lang/el/mcp.phpindex 80efbe14e..aa18b01d9 100644--- a/lang/el/mcp.php+++ b/lang/el/mcp.php@@ -76,5 +76,10 @@ return [],'waiting' => 'Αναμονή για σύνδεση του AI σας…',],+ 'prompt' => [+ 'title' => 'Δεν έχετε συνδέσει ακόμα AI',+ 'body' => 'Συνδέστε το Claude ή το ChatGPT για να φτιάχνετε, να προγραμματίζετε και να αναλύετε posts απλώς ζητώντας το.',+ 'not_now' => 'Όχι τώρα',+ ],];diff --git a/lang/el/welcome.php b/lang/el/welcome.phpindex 1f9ada8d9..37c52ad60 100644--- a/lang/el/welcome.php+++ b/lang/el/welcome.php@@ -50,40 +50,4 @@ return ['plan_terms' => 'Μετά :price/μήνα. Ακύρωση οποτεδήποτε','plan_checkout_button' => 'Ενεργοποίηση λογαριασμού','plan_cancel_anytime' => 'Ακύρωση οποτεδήποτε',- 'mcp' => [- 'title' => 'Διαχειριστείτε τα social μέσω chat',- 'description' => 'Φτιάξτε, προγραμματίστε και αναλύστε posts στο TryPost με την AI σας.',- 'connect_with' => 'Σύνδεση με :client',- 'connect_ai' => 'Συνδέστε την AI σας',- 'pick_ai' => 'Πού θα χρησιμοποιήσετε το TryPost;',- 'connect_other' => 'Σύνδεση άλλης εφαρμογής',- 'connected' => 'Το :client συνδέθηκε',- 'benefits' => [- 'schedule' => [- 'title' => 'Φτιάξτε και προγραμματίστε στο chat',- 'hint' => 'Carousel, threads και βίντεο',- 'ask' => 'Πάρε την επόμενη ιδέα από τον πίνακά μου, κάν’ την carousel και προγραμμάτισέ το για Τρίτη στις :time σε Instagram και LinkedIn.',- 'reply' => 'Έγινε. Το carousel σου είναι προγραμματισμένο σε Instagram και LinkedIn.',- ],- 'analytics' => [- 'title' => 'Παρακολουθήστε την ανάπτυξή σας',- 'hint' => 'Όλοι οι λογαριασμοί σε μία αναφορά',- 'ask' => 'Πώς πήγε ο μήνας μου; Κέρδισα ακόλουθους;',- 'reply' => 'Κερδίσατε 1,2 χιλ. ακόλουθους αυτόν τον μήνα. Το LinkedIn αναπτύχθηκε πιο γρήγορα.',- ],- 'queue' => [- 'title' => 'Γεμίστε την ουρά',- 'hint' => 'Στις καλύτερες ώρες σας',- 'ask' => 'Πάρε τα έτοιμα πρόχειρά μου και βάλ’ τα στην ουρά, στις επόμενες ελεύθερες ώρες μου.',- 'reply' => 'Έγινε. Τα 3 πρόχειρά σου είναι στην ουρά, στις ελεύθερες ώρες της αύριο.',- ],- 'ideas' => [- 'title' => 'Οργανώστε τις ιδέες σας',- 'hint' => 'Από τις ιδέες στο πλάνο περιεχομένου',- 'ask' => 'Δώσε μου 8 ιδέες για posts για την επόμενη εβδομάδα και αποθήκευσέ τες στον πίνακά μου.',- 'reply' => 'Αποθήκευσα 8 ιδέες στον πίνακά σου, έτοιμες να γίνουν posts.',- ],- ],- 'skip' => 'Παράλειψη',- ],];diff --git a/lang/en/mcp.php b/lang/en/mcp.phpindex ea0e9af3c..19d34eb29 100644--- a/lang/en/mcp.php+++ b/lang/en/mcp.php@@ -76,5 +76,10 @@ return [],'waiting' => 'Waiting for your AI to connect…',],+ 'prompt' => [+ 'title' => 'You haven\'t connected an AI yet',+ 'body' => 'Connect Claude or ChatGPT to create, schedule and analyze your posts just by asking.',+ 'not_now' => 'Not now',+ ],];diff --git a/lang/en/welcome.php b/lang/en/welcome.phpindex b7ead8d74..40a4edffe 100644--- a/lang/en/welcome.php+++ b/lang/en/welcome.php@@ -50,40 +50,4 @@ return ['plan_terms' => 'Then :price/month. Cancel anytime','plan_checkout_button' => 'Activate my account','plan_cancel_anytime' => 'Cancel anytime',- 'mcp' => [- 'title' => 'Run your social media from a chat',- 'description' => 'Create, schedule and analyze your TryPost posts with your favorite AI.',- 'connect_with' => 'Connect with :client',- 'connect_ai' => 'Connect your AI',- 'pick_ai' => 'Where do you want to use TryPost?',- 'connect_other' => 'Connect another app',- 'connected' => ':client is connected',- 'benefits' => [- 'schedule' => [- 'title' => 'Create and schedule from chat',- 'hint' => 'Carousels, threads and videos',- 'ask' => 'Take the next idea on my board, turn it into a carousel and schedule it for Tuesday at :time on Instagram and LinkedIn.',- 'reply' => 'Done. Your carousel is scheduled on Instagram and LinkedIn.',- ],- 'analytics' => [- 'title' => 'Track your growth',- 'hint' => 'Every account in one report',- 'ask' => 'How was my month? Did I gain followers?',- 'reply' => 'You gained 1.2k followers this month. LinkedIn grew the fastest.',- ],- 'queue' => [- 'title' => 'Fill your queue',- 'hint' => 'At your best posting times',- 'ask' => 'Take my finished drafts and add them to my queue, in my next free slots.',- 'reply' => 'Done. Your 3 drafts are in your queue, in tomorrow\'s next free slots.',- ],- 'ideas' => [- 'title' => 'Organize your ideas',- 'hint' => 'From brainstorm to content plan',- 'ask' => 'Give me 8 post ideas for next week and save them to my board.',- 'reply' => 'I saved 8 ideas to your board, ready to become posts.',- ],- ],- 'skip' => 'Skip for now',- ],];diff --git a/lang/es/mcp.php b/lang/es/mcp.phpindex e3123cf29..64ef3d115 100644--- a/lang/es/mcp.php+++ b/lang/es/mcp.php@@ -76,5 +76,10 @@ return [],'waiting' => 'Esperando a que tu IA se conecte…',],+ 'prompt' => [+ 'title' => 'Aún no has conectado ninguna IA',+ 'body' => 'Conecta Claude o ChatGPT para crear, programar y analizar tus posts con solo pedirlo.',+ 'not_now' => 'Ahora no',+ ],];diff --git a/lang/es/welcome.php b/lang/es/welcome.phpindex ad4b5ca6c..7de8400af 100644--- a/lang/es/welcome.php+++ b/lang/es/welcome.php@@ -50,40 +50,4 @@ return ['plan_terms' => 'Luego, :price/mes. Cancela cuando quieras','plan_checkout_button' => 'Activar mi cuenta','plan_cancel_anytime' => 'Cancela cuando quieras',- 'mcp' => [- 'title' => 'Gestiona tus redes desde el chat',- 'description' => 'Crea, programa y analiza posts en TryPost con tu IA favorita.',- 'connect_with' => 'Conectar con :client',- 'connect_ai' => 'Conectar tu IA',- 'pick_ai' => '¿Dónde quieres usar TryPost?',- 'connect_other' => 'Conectar otra app',- 'connected' => ':client está conectado',- 'benefits' => [- 'schedule' => [- 'title' => 'Crea y programa desde el chat',- 'hint' => 'Carruseles, hilos y videos',- 'ask' => 'Toma la siguiente idea de mi tablero, conviértela en un carrusel y prográmalo para el martes a las :time en Instagram y LinkedIn.',- 'reply' => 'Listo. Tu carrusel está programado en Instagram y LinkedIn.',- ],- 'analytics' => [- 'title' => 'Sigue tu crecimiento',- 'hint' => 'Todas tus cuentas en un informe',- 'ask' => '¿Cómo fue mi mes? ¿Gané seguidores?',- 'reply' => 'Ganaste 1,2 mil seguidores este mes. LinkedIn fue la que más creció.',- ],- 'queue' => [- 'title' => 'Llena tu cola',- 'hint' => 'En tus mejores horarios',- 'ask' => 'Toma mis borradores listos y ponlos en mi cola, en mis próximos horarios libres.',- 'reply' => 'Listo. Tus 3 borradores están en la cola, en los próximos horarios libres de mañana.',- ],- 'ideas' => [- 'title' => 'Organiza tus ideas',- 'hint' => 'De la lluvia de ideas al plan',- 'ask' => 'Dame 8 ideas de posts para la próxima semana y guárdalas en mi tablero.',- 'reply' => 'Guardé 8 ideas en tu tablero, listas para convertirse en posts.',- ],- ],- 'skip' => 'Omitir por ahora',- ],];diff --git a/lang/fr/mcp.php b/lang/fr/mcp.phpindex 415577c8f..83e227778 100644--- a/lang/fr/mcp.php+++ b/lang/fr/mcp.php@@ -76,5 +76,10 @@ return [],'waiting' => 'En attente de la connexion de votre IA…',],+ 'prompt' => [+ 'title' => 'Vous n\'avez pas encore connecté d\'IA',+ 'body' => 'Connectez Claude ou ChatGPT pour créer, planifier et analyser vos posts simplement en le demandant.',+ 'not_now' => 'Plus tard',+ ],];diff --git a/lang/fr/welcome.php b/lang/fr/welcome.phpindex 619b6db30..ce0fe29d3 100644--- a/lang/fr/welcome.php+++ b/lang/fr/welcome.php@@ -50,40 +50,4 @@ return ['plan_terms' => 'Puis :price/mois. Annulez à tout moment','plan_checkout_button' => 'Activer mon compte','plan_cancel_anytime' => 'Annulez à tout moment',- 'mcp' => [- 'title' => 'Gérez vos réseaux par chat',- 'description' => 'Créez, planifiez et analysez vos posts TryPost avec votre IA préférée.',- 'connect_with' => 'Connecter :client',- 'connect_ai' => 'Connecter votre IA',- 'pick_ai' => 'Où voulez-vous utiliser TryPost ?',- 'connect_other' => 'Connecter une autre app',- 'connected' => ':client est connecté',- 'benefits' => [- 'schedule' => [- 'title' => 'Créez et planifiez depuis le chat',- 'hint' => 'Carrousels, threads et vidéos',- 'ask' => 'Prends la prochaine idée de mon tableau, fais-en un carrousel et planifie-le mardi à :time sur Instagram et LinkedIn.',- 'reply' => 'C’est fait. Ton carrousel est planifié sur Instagram et LinkedIn.',- ],- 'analytics' => [- 'title' => 'Suivez votre croissance',- 'hint' => 'Tous vos comptes dans un rapport',- 'ask' => 'Comment s’est passé mon mois ? J’ai gagné des abonnés ?',- 'reply' => 'Vous avez gagné 1,2 k abonnés ce mois-ci. LinkedIn a le plus progressé.',- ],- 'queue' => [- 'title' => 'Remplissez votre file',- 'hint' => 'Aux meilleurs horaires',- 'ask' => 'Prends mes brouillons prêts et ajoute-les à ma file, sur mes prochains créneaux libres.',- 'reply' => 'C’est fait. Tes 3 brouillons sont dans ta file, sur les prochains créneaux libres de demain.',- ],- 'ideas' => [- 'title' => 'Organisez vos idées',- 'hint' => 'Du brainstorming au planning',- 'ask' => 'Donne-moi 8 idées de posts pour la semaine prochaine et enregistre-les dans mon tableau.',- 'reply' => 'J’ai enregistré 8 idées dans ton tableau, prêtes à devenir des posts.',- ],- ],- 'skip' => 'Passer pour l’instant',- ],];diff --git a/lang/it/mcp.php b/lang/it/mcp.phpindex 4bf068a85..c7d090a4b 100644--- a/lang/it/mcp.php+++ b/lang/it/mcp.php@@ -76,5 +76,10 @@ return [],'waiting' => 'In attesa che la tua IA si colleghi…',],+ 'prompt' => [+ 'title' => 'Non hai ancora collegato un\'IA',+ 'body' => 'Collega Claude o ChatGPT per creare, programmare e analizzare i post semplicemente chiedendolo.',+ 'not_now' => 'Non ora',+ ],];diff --git a/lang/it/welcome.php b/lang/it/welcome.phpindex d5463f220..9800de54a 100644--- a/lang/it/welcome.php+++ b/lang/it/welcome.php@@ -50,40 +50,4 @@ return ['plan_terms' => 'Poi :price/mese. Disdici quando vuoi','plan_checkout_button' => 'Attiva il mio account','plan_cancel_anytime' => 'Disdici quando vuoi',- 'mcp' => [- 'title' => 'Gestisci i social dalla chat',- 'description' => 'Crea, programma e analizza i post su TryPost con la tua IA preferita.',- 'connect_with' => 'Collega :client',- 'connect_ai' => 'Collega la tua IA',- 'pick_ai' => 'Dove vuoi usare TryPost?',- 'connect_other' => 'Collega un\'altra app',- 'connected' => ':client è collegato',- 'benefits' => [- 'schedule' => [- 'title' => 'Crea e programma dalla chat',- 'hint' => 'Caroselli, thread e video',- 'ask' => 'Prendi la prossima idea dalla mia bacheca, trasformala in un carosello e programmalo per martedì alle :time su Instagram e LinkedIn.',- 'reply' => 'Fatto. Il tuo carosello è programmato su Instagram e LinkedIn.',- ],- 'analytics' => [- 'title' => 'Segui la tua crescita',- 'hint' => 'Tutti gli account in un report',- 'ask' => 'Com’è andato il mio mese? Ho guadagnato follower?',- 'reply' => 'Hai guadagnato 1,2k follower questo mese. LinkedIn è cresciuto di più.',- ],- 'queue' => [- 'title' => 'Riempi la coda',- 'hint' => 'Nei tuoi orari migliori',- 'ask' => 'Prendi le mie bozze pronte e mettile in coda, nei miei prossimi orari liberi.',- 'reply' => 'Fatto. Le tue 3 bozze sono in coda, nei prossimi orari liberi di domani.',- ],- 'ideas' => [- 'title' => 'Organizza le tue idee',- 'hint' => 'Dal brainstorming al piano editoriale',- 'ask' => 'Dammi 8 idee di post per la prossima settimana e salvale nella mia bacheca.',- 'reply' => 'Ho salvato 8 idee nella tua bacheca, pronte a diventare post.',- ],- ],- 'skip' => 'Salta per ora',- ],];diff --git a/lang/ja/mcp.php b/lang/ja/mcp.phpindex ece21a9d1..e9a19da69 100644--- a/lang/ja/mcp.php+++ b/lang/ja/mcp.php@@ -76,5 +76,10 @@ return [],'waiting' => 'AIの接続を待っています…',],+ 'prompt' => [+ 'title' => 'まだAIを接続していません',+ 'body' => 'ClaudeやChatGPTを接続すると、頼むだけで投稿の作成・予約・分析ができます。',+ 'not_now' => '今はしない',+ ],];diff --git a/lang/ja/welcome.php b/lang/ja/welcome.phpindex 1e50dbaed..8bbd80aa4 100644--- a/lang/ja/welcome.php+++ b/lang/ja/welcome.php@@ -50,40 +50,4 @@ return ['plan_terms' => 'その後は:price/月。いつでも解約できます','plan_checkout_button' => 'アカウントを有効にする','plan_cancel_anytime' => 'いつでも解約できます',- 'mcp' => [- 'title' => 'AIとの会話でSNSを運用',- 'description' => 'お気に入りのAIで、TryPostの投稿を作成・予約・分析。',- 'connect_with' => ':clientと接続',- 'connect_ai' => 'AIを接続',- 'pick_ai' => 'どこでTryPostを使いますか?',- 'connect_other' => '他のアプリを接続',- 'connected' => ':clientに接続しました',- 'benefits' => [- 'schedule' => [- 'title' => 'チャットで作成・予約',- 'hint' => 'カルーセル、スレッド、動画',- 'ask' => 'ボードの次のアイデアをカルーセルにして、火曜日の:timeにInstagramとLinkedInで予約して。',- 'reply' => '完了。カルーセルをInstagramとLinkedInで予約しました。',- ],- 'analytics' => [- 'title' => '成長を追いかける',- 'hint' => 'すべてのアカウントを1つのレポートに',- 'ask' => '今月はどうだった?フォロワーは増えた?',- 'reply' => '今月はフォロワーが1,200人増えました。最も伸びたのはLinkedInです。',- ],- 'queue' => [- 'title' => 'キューを埋める',- 'hint' => '最適な投稿時間に',- 'ask' => '完成した下書きを、次の空き枠にキューで入れて。',- 'reply' => '完了。3件の下書きを、明日の空き枠にキューで入れました。',- ],- 'ideas' => [- 'title' => 'アイデアを整理',- 'hint' => 'ブレストからコンテンツ計画へ',- 'ask' => '来週の投稿アイデアを8つ出して、ボードに保存して。',- 'reply' => '8つのアイデアをボードに保存しました。すぐ投稿にできます。',- ],- ],- 'skip' => '今はスキップ',- ],];diff --git a/lang/ko/mcp.php b/lang/ko/mcp.phpindex d1e71a9f4..91435d1ae 100644--- a/lang/ko/mcp.php+++ b/lang/ko/mcp.php@@ -76,5 +76,10 @@ return [],'waiting' => 'AI 연결을 기다리는 중…',],+ 'prompt' => [+ 'title' => '아직 연결한 AI가 없습니다',+ 'body' => 'Claude나 ChatGPT를 연결하면 요청만으로 게시물을 만들고, 예약하고, 분석할 수 있습니다.',+ 'not_now' => '나중에',+ ],];diff --git a/lang/ko/welcome.php b/lang/ko/welcome.phpindex e0498e838..42951bd73 100644--- a/lang/ko/welcome.php+++ b/lang/ko/welcome.php@@ -50,40 +50,4 @@ return ['plan_terms' => '이후 :price/월. 언제든지 해지 가능','plan_checkout_button' => '내 계정 활성화','plan_cancel_anytime' => '언제든지 해지 가능',- 'mcp' => [- 'title' => 'AI와 대화하며 SNS를 관리하세요',- 'description' => '좋아하는 AI로 TryPost 게시물을 만들고, 예약하고, 분석하세요.',- 'connect_with' => ':client 연결',- 'connect_ai' => 'AI 연결하기',- 'pick_ai' => '어디에서 TryPost를 사용할까요?',- 'connect_other' => '다른 앱 연결',- 'connected' => ':client 연결됨',- 'benefits' => [- 'schedule' => [- 'title' => '채팅으로 만들고 예약',- 'hint' => '캐러셀, 스레드, 동영상',- 'ask' => '내 보드의 다음 아이디어로 캐러셀을 만들어 화요일 :time에 Instagram과 LinkedIn에 예약해 줘.',- 'reply' => '완료했어요. 캐러셀을 Instagram과 LinkedIn에 예약했어요.',- ],- 'analytics' => [- 'title' => '성장 추적',- 'hint' => '모든 계정을 하나의 리포트로',- 'ask' => '이번 달 어땠어? 팔로워가 늘었어?',- 'reply' => '이번 달 팔로워가 1,200명 늘었어요. LinkedIn이 가장 빠르게 성장했어요.',- ],- 'queue' => [- 'title' => '대기열 채우기',- 'hint' => '가장 좋은 게시 시간에',- 'ask' => '완성된 초안을 다음 빈 시간대 대기열에 넣어 줘.',- 'reply' => '완료했어요. 초안 3개를 내일의 빈 시간대 대기열에 넣었어요.',- ],- 'ideas' => [- 'title' => '아이디어 정리',- 'hint' => '브레인스토밍에서 콘텐츠 계획으로',- 'ask' => '다음 주 게시물 아이디어 8개를 주고 내 보드에 저장해 줘.',- 'reply' => '아이디어 8개를 보드에 저장했어요. 바로 게시물로 만들 수 있어요.',- ],- ],- 'skip' => '지금은 건너뛰기',- ],];diff --git a/lang/nl/mcp.php b/lang/nl/mcp.phpindex 1cfdb64e3..b12fba505 100644--- a/lang/nl/mcp.php+++ b/lang/nl/mcp.php@@ -76,5 +76,10 @@ return [],'waiting' => 'Wachten tot je AI verbindt…',],+ 'prompt' => [+ 'title' => 'Je hebt nog geen AI gekoppeld',+ 'body' => 'Koppel Claude of ChatGPT om posts te maken, te plannen en te analyseren door het gewoon te vragen.',+ 'not_now' => 'Niet nu',+ ],];diff --git a/lang/nl/welcome.php b/lang/nl/welcome.phpindex fe7be179b..c431dc553 100644--- a/lang/nl/welcome.php+++ b/lang/nl/welcome.php@@ -50,40 +50,4 @@ return ['plan_terms' => 'Daarna :price/maand. Altijd opzegbaar','plan_checkout_button' => 'Mijn account activeren','plan_cancel_anytime' => 'Altijd opzegbaar',- 'mcp' => [- 'title' => 'Beheer je socials via chat',- 'description' => 'Maak, plan en analyseer posts in TryPost met je favoriete AI.',- 'connect_with' => 'Koppelen met :client',- 'connect_ai' => 'Koppel je AI',- 'pick_ai' => 'Waar wil je TryPost gebruiken?',- 'connect_other' => 'Andere app koppelen',- 'connected' => ':client is gekoppeld',- 'benefits' => [- 'schedule' => [- 'title' => 'Maak en plan vanuit de chat',- 'hint' => 'Carrousels, threads en video’s',- 'ask' => 'Pak het volgende idee van mijn bord, maak er een carrousel van en plan hem voor dinsdag om :time op Instagram en LinkedIn.',- 'reply' => 'Klaar. Je carrousel staat gepland op Instagram en LinkedIn.',- ],- 'analytics' => [- 'title' => 'Volg je groei',- 'hint' => 'Al je accounts in één rapport',- 'ask' => 'Hoe was mijn maand? Heb ik volgers gewonnen?',- 'reply' => 'Je hebt deze maand 1,2k volgers gewonnen. LinkedIn groeide het snelst.',- ],- 'queue' => [- 'title' => 'Vul je wachtrij',- 'hint' => 'Op je beste tijden',- 'ask' => 'Pak mijn klare concepten en zet ze in mijn wachtrij, op mijn volgende vrije tijden.',- 'reply' => 'Klaar. Je 3 concepten staan in je wachtrij, op de vrije tijden van morgen.',- ],- 'ideas' => [- 'title' => 'Organiseer je ideeën',- 'hint' => 'Van brainstorm naar contentplan',- 'ask' => 'Geef me 8 postideeën voor volgende week en zet ze op mijn bord.',- 'reply' => 'Ik heb 8 ideeën op je bord gezet, klaar om posts te worden.',- ],- ],- 'skip' => 'Nu overslaan',- ],];diff --git a/lang/pl/mcp.php b/lang/pl/mcp.phpindex f9b6bcdb6..84152e9c7 100644--- a/lang/pl/mcp.php+++ b/lang/pl/mcp.php@@ -76,5 +76,10 @@ return [],'waiting' => 'Czekamy na połączenie Twojej AI…',],+ 'prompt' => [+ 'title' => 'Nie masz jeszcze połączonej AI',+ 'body' => 'Połącz Claude lub ChatGPT, aby tworzyć, planować i analizować posty, po prostu o to prosząc.',+ 'not_now' => 'Nie teraz',+ ],];diff --git a/lang/pl/welcome.php b/lang/pl/welcome.phpindex a52da0c29..ab0e2d9f1 100644--- a/lang/pl/welcome.php+++ b/lang/pl/welcome.php@@ -50,40 +50,4 @@ return ['plan_terms' => 'Potem :price/mies. Anuluj w dowolnym momencie','plan_checkout_button' => 'Aktywuj moje konto','plan_cancel_anytime' => 'Anuluj w dowolnym momencie',- 'mcp' => [- 'title' => 'Zarządzaj social mediami w czacie',- 'description' => 'Twórz, planuj i analizuj posty w TryPost z ulubioną AI.',- 'connect_with' => 'Połącz z :client',- 'connect_ai' => 'Połącz swoją AI',- 'pick_ai' => 'Gdzie chcesz używać TryPost?',- 'connect_other' => 'Połącz inną aplikację',- 'connected' => ':client jest połączony',- 'benefits' => [- 'schedule' => [- 'title' => 'Twórz i planuj z czatu',- 'hint' => 'Karuzele, wątki i filmy',- 'ask' => 'Weź następny pomysł z mojej tablicy, zrób z niego karuzelę i zaplanuj na wtorek na :time na Instagramie i LinkedIn.',- 'reply' => 'Gotowe. Twoja karuzela jest zaplanowana na Instagramie i LinkedIn.',- ],- 'analytics' => [- 'title' => 'Śledź swój wzrost',- 'hint' => 'Wszystkie konta w jednym raporcie',- 'ask' => 'Jak minął mój miesiąc? Zyskałem obserwujących?',- 'reply' => 'W tym miesiącu zyskałeś 1,2 tys. obserwujących. Najszybciej rósł LinkedIn.',- ],- 'queue' => [- 'title' => 'Wypełnij kolejkę',- 'hint' => 'W Twoich najlepszych godzinach',- 'ask' => 'Weź moje gotowe szkice i dodaj je do kolejki, na najbliższe wolne terminy.',- 'reply' => 'Gotowe. Twoje 3 szkice są w kolejce, w najbliższych wolnych terminach jutro.',- ],- 'ideas' => [- 'title' => 'Uporządkuj pomysły',- 'hint' => 'Od burzy mózgów do planu treści',- 'ask' => 'Daj mi 8 pomysłów na posty na przyszły tydzień i zapisz je na mojej tablicy.',- 'reply' => 'Zapisałem 8 pomysłów na twojej tablicy, gotowych do zamiany w posty.',- ],- ],- 'skip' => 'Pomiń na razie',- ],];diff --git a/lang/pt-BR/mcp.php b/lang/pt-BR/mcp.phpindex 2f295da0a..a333033ef 100644--- a/lang/pt-BR/mcp.php+++ b/lang/pt-BR/mcp.php@@ -76,5 +76,10 @@ return [],'waiting' => 'Aguardando sua IA conectar…',],+ 'prompt' => [+ 'title' => 'Você ainda não conectou uma IA',+ 'body' => 'Conecte o Claude ou o ChatGPT para criar, agendar e analisar seus posts só pedindo.',+ 'not_now' => 'Agora não',+ ],];diff --git a/lang/pt-BR/welcome.php b/lang/pt-BR/welcome.phpindex 4e21e5b49..4527bdc4c 100644--- a/lang/pt-BR/welcome.php+++ b/lang/pt-BR/welcome.php@@ -50,40 +50,4 @@ return ['plan_terms' => 'Depois, :price/mês. Cancele quando quiser','plan_checkout_button' => 'Ativar minha conta','plan_cancel_anytime' => 'Cancele quando quiser',- 'mcp' => [- 'title' => 'Gerencie suas redes pelo chat',- 'description' => 'Crie, agende e analise posts no TryPost usando a sua IA favorita.',- 'connect_with' => 'Conectar com :client',- 'connect_ai' => 'Conectar sua IA',- 'pick_ai' => 'Onde você quer usar o TryPost?',- 'connect_other' => 'Conectar outro app',- 'connected' => ':client está conectado',- 'benefits' => [- 'schedule' => [- 'title' => 'Crie e agende pelo chat',- 'hint' => 'Carrosséis, threads e vídeos',- 'ask' => 'Pegue a próxima ideia do meu quadro, transforme num carrossel e agende para terça às :time no Instagram e no LinkedIn.',- 'reply' => 'Pronto. O carrossel está agendado no Instagram e no LinkedIn.',- ],- 'analytics' => [- 'title' => 'Acompanhe seu crescimento',- 'hint' => 'Todas as contas em um relatório',- 'ask' => 'Como foi meu mês? Ganhei seguidores?',- 'reply' => 'Você ganhou 1,2 mil seguidores no mês. O LinkedIn foi o que mais cresceu.',- ],- 'queue' => [- 'title' => 'Encha a fila',- 'hint' => 'Nos seus melhores horários',- 'ask' => 'Pegue meus rascunhos prontos e coloque na fila, nos meus próximos horários livres.',- 'reply' => 'Feito. Coloquei seus 3 rascunhos na fila, nos próximos horários livres de amanhã.',- ],- 'ideas' => [- 'title' => 'Organize suas ideias',- 'hint' => 'Do brainstorm para a pauta',- 'ask' => 'Me dê 8 ideias de posts para a próxima semana e salve no meu quadro.',- 'reply' => 'Salvei 8 ideias no seu quadro, prontas para virar post.',- ],- ],- 'skip' => 'Pular por agora',- ],];diff --git a/lang/ru/mcp.php b/lang/ru/mcp.phpindex fbc1dc3c8..326189929 100644--- a/lang/ru/mcp.php+++ b/lang/ru/mcp.php@@ -76,5 +76,10 @@ return [],'waiting' => 'Ждём подключения вашего ИИ…',],+ 'prompt' => [+ 'title' => 'ИИ ещё не подключён',+ 'body' => 'Подключите Claude или ChatGPT, чтобы создавать, планировать и анализировать посты простой просьбой.',+ 'not_now' => 'Не сейчас',+ ],];diff --git a/lang/ru/welcome.php b/lang/ru/welcome.phpindex 2f21a674e..b82608399 100644--- a/lang/ru/welcome.php+++ b/lang/ru/welcome.php@@ -50,40 +50,4 @@ return ['plan_terms' => 'Затем :price/мес. Отмена в любой момент','plan_checkout_button' => 'Активировать мой аккаунт','plan_cancel_anytime' => 'Отмена в любой момент',- 'mcp' => [- 'title' => 'Ведите соцсети прямо в чате',- 'description' => 'Создавайте, планируйте и анализируйте посты в TryPost с любимым ИИ.',- 'connect_with' => 'Подключить :client',- 'connect_ai' => 'Подключить ИИ',- 'pick_ai' => 'Где вы хотите использовать TryPost?',- 'connect_other' => 'Подключить другое приложение',- 'connected' => ':client подключён',- 'benefits' => [- 'schedule' => [- 'title' => 'Создавайте и планируйте в чате',- 'hint' => 'Карусели, треды и видео',- 'ask' => 'Возьми следующую идею с доски, сделай карусель и запланируй на вторник на :time в Instagram и LinkedIn.',- 'reply' => 'Готово. Карусель запланирована в Instagram и LinkedIn.',- ],- 'analytics' => [- 'title' => 'Следите за ростом',- 'hint' => 'Все аккаунты в одном отчёте',- 'ask' => 'Как прошёл мой месяц? Я набрал подписчиков?',- 'reply' => 'За месяц вы получили 1,2 тыс. подписчиков. Быстрее всего рос LinkedIn.',- ],- 'queue' => [- 'title' => 'Заполните очередь',- 'hint' => 'В ваше лучшее время',- 'ask' => 'Возьми мои готовые черновики и поставь их в очередь на ближайшие свободные слоты.',- 'reply' => 'Готово. Твои 3 черновика в очереди, на ближайших свободных слотах завтра.',- ],- 'ideas' => [- 'title' => 'Упорядочьте идеи',- 'hint' => 'От мозгового штурма к контент-плану',- 'ask' => 'Предложи 8 идей постов на следующую неделю и сохрани их на мою доску.',- 'reply' => 'Я сохранил 8 идей на твоей доске — они готовы стать постами.',- ],- ],- 'skip' => 'Пропустить',- ],];diff --git a/lang/tr/mcp.php b/lang/tr/mcp.phpindex 45da1d392..2952d5310 100644--- a/lang/tr/mcp.php+++ b/lang/tr/mcp.php@@ -76,5 +76,10 @@ return [],'waiting' => 'Yapay zekânın bağlanması bekleniyor…',],+ 'prompt' => [+ 'title' => 'Henüz bir yapay zekâ bağlamadın',+ 'body' => 'Gönderilerini sadece isteyerek oluşturmak, planlamak ve analiz etmek için Claude veya ChatGPT\'yi bağla.',+ 'not_now' => 'Şimdi değil',+ ],];diff --git a/lang/tr/welcome.php b/lang/tr/welcome.phpindex b240fd6aa..6a61d0bba 100644--- a/lang/tr/welcome.php+++ b/lang/tr/welcome.php@@ -50,40 +50,4 @@ return ['plan_terms' => 'Sonra :price/ay. İstediğin zaman iptal et','plan_checkout_button' => 'Hesabımı etkinleştir','plan_cancel_anytime' => 'İstediğin zaman iptal et',- 'mcp' => [- 'title' => 'Sosyal medyanı sohbetle yönet',- 'description' => 'TryPost’ta gönderilerini favori yapay zekânla oluştur, planla ve analiz et.',- 'connect_with' => ':client ile bağlan',- 'connect_ai' => 'Yapay zekânı bağla',- 'pick_ai' => 'TryPost’u nerede kullanmak istersin?',- 'connect_other' => 'Başka uygulama bağla',- 'connected' => ':client bağlandı',- 'benefits' => [- 'schedule' => [- 'title' => 'Sohbetten oluştur ve planla',- 'hint' => 'Karuseller, gönderi dizileri ve videolar',- 'ask' => 'Panomdaki sıradaki fikri al, karusele dönüştür ve salı :time için Instagram ile LinkedIn’de planla.',- 'reply' => 'Tamam. Karuselin Instagram ve LinkedIn’de planlandı.',- ],- 'analytics' => [- 'title' => 'Büyümeni takip et',- 'hint' => 'Tüm hesapların tek raporda',- 'ask' => 'Ayım nasıl geçti? Takipçi kazandım mı?',- 'reply' => 'Bu ay 1,2 bin takipçi kazandın. En hızlı LinkedIn büyüdü.',- ],- 'queue' => [- 'title' => 'Sıranı doldur',- 'hint' => 'En iyi paylaşım saatlerinde',- 'ask' => 'Hazır taslaklarımı al ve bir sonraki boş saatlerime sıraya ekle.',- 'reply' => 'Tamam. 3 taslağın sırada, yarının bir sonraki boş saatlerinde.',- ],- 'ideas' => [- 'title' => 'Fikirlerini düzenle',- 'hint' => 'Beyin fırtınasından içerik planına',- 'ask' => 'Gelecek hafta için 8 gönderi fikri ver ve panoma kaydet.',- 'reply' => '8 fikri panona kaydettim, gönderiye dönüşmeye hazır.',- ],- ],- 'skip' => 'Şimdilik atla',- ],];diff --git a/lang/uk/mcp.php b/lang/uk/mcp.phpindex 4d8770af6..587273cbd 100644--- a/lang/uk/mcp.php+++ b/lang/uk/mcp.php@@ -76,5 +76,10 @@ return [],'waiting' => 'Чекаємо на підключення вашого ШІ…',],+ 'prompt' => [+ 'title' => 'ШІ ще не підключено',+ 'body' => 'Підключіть Claude або ChatGPT, щоб створювати, планувати й аналізувати дописи, просто попросивши.',+ 'not_now' => 'Не зараз',+ ],];diff --git a/lang/uk/welcome.php b/lang/uk/welcome.phpindex 571bf0f57..b57abfbbc 100644--- a/lang/uk/welcome.php+++ b/lang/uk/welcome.php@@ -50,40 +50,4 @@ return ['plan_terms' => 'Потім :price/міс. Скасування будь-коли','plan_checkout_button' => 'Активувати мій акаунт','plan_cancel_anytime' => 'Скасування будь-коли',- 'mcp' => [- 'title' => 'Ведіть соцмережі просто в чаті',- 'description' => 'Створюйте, плануйте й аналізуйте дописи в TryPost з улюбленим ШІ.',- 'connect_with' => 'Підключити :client',- 'connect_ai' => 'Підключити ШІ',- 'pick_ai' => 'Де ви хочете використовувати TryPost?',- 'connect_other' => 'Підключити інший застосунок',- 'connected' => ':client підключено',- 'benefits' => [- 'schedule' => [- 'title' => 'Створюйте й плануйте в чаті',- 'hint' => 'Каруселі, треди й відео',- 'ask' => 'Візьми наступну ідею з дошки, зроби карусель і заплануй на вівторок на :time в Instagram і LinkedIn.',- 'reply' => 'Готово. Карусель заплановано в Instagram і LinkedIn.',- ],- 'analytics' => [- 'title' => 'Стежте за зростанням',- 'hint' => 'Усі акаунти в одному звіті',- 'ask' => 'Як минув мій місяць? Я набрав підписників?',- 'reply' => 'За місяць ви отримали 1,2 тис. підписників. Найшвидше зростав LinkedIn.',- ],- 'queue' => [- 'title' => 'Заповніть чергу',- 'hint' => 'У ваш найкращий час',- 'ask' => 'Візьми мої готові чернетки й додай їх у чергу на найближчі вільні слоти.',- 'reply' => 'Готово. Твої 3 чернетки в черзі, на найближчих вільних слотах завтра.',- ],- 'ideas' => [- 'title' => 'Упорядкуйте ідеї',- 'hint' => 'Від мозкового штурму до контент-плану',- 'ask' => 'Запропонуй 8 ідей дописів на наступний тиждень і збережи їх на мою дошку.',- 'reply' => 'Я зберіг 8 ідей на твоїй дошці — вони готові стати дописами.',- ],- ],- 'skip' => 'Пропустити',- ],];diff --git a/lang/zh/mcp.php b/lang/zh/mcp.phpindex 368658e71..1fb67f652 100644--- a/lang/zh/mcp.php+++ b/lang/zh/mcp.php@@ -76,5 +76,10 @@ return [],'waiting' => '正在等待你的 AI 连接…',],+ 'prompt' => [+ 'title' => '你还没有连接 AI',+ 'body' => '连接 Claude 或 ChatGPT,只需开口就能创建、排期和分析帖子。',+ 'not_now' => '以后再说',+ ],];diff --git a/lang/zh/welcome.php b/lang/zh/welcome.phpindex 781e36058..4375e7bff 100644--- a/lang/zh/welcome.php+++ b/lang/zh/welcome.php@@ -50,40 +50,4 @@ return ['plan_terms' => '之后 :price/月,随时取消','plan_checkout_button' => '激活我的账户','plan_cancel_anytime' => '随时取消',- 'mcp' => [- 'title' => '和 AI 聊天,轻松管理社交媒体',- 'description' => '用你最喜欢的 AI,在 TryPost 中创建、排期和分析帖子。',- 'connect_with' => '连接 :client',- 'connect_ai' => '连接你的 AI',- 'pick_ai' => '你想在哪里使用 TryPost?',- 'connect_other' => '连接其他应用',- 'connected' => ':client 已连接',- 'benefits' => [- 'schedule' => [- 'title' => '在聊天中创建并排期',- 'hint' => '轮播图、串文和视频',- 'ask' => '从我的看板取下一个点子,做成轮播图,并排期到周二 :time 发布在 Instagram 和 LinkedIn。',- 'reply' => '完成。轮播图已排期到 Instagram 和 LinkedIn。',- ],- 'analytics' => [- 'title' => '追踪你的增长',- 'hint' => '所有账号汇总在一份报告里',- 'ask' => '我这个月怎么样?涨粉了吗?',- 'reply' => '本月你新增了 1,200 位粉丝,LinkedIn 增长最快。',- ],- 'queue' => [- 'title' => '填满发布队列',- 'hint' => '安排在你的最佳时间',- 'ask' => '把我写好的草稿加入队列,排到接下来的空闲时段。',- 'reply' => '完成。你的 3 篇草稿已加入队列,排在明天的空闲时段。',- ],- 'ideas' => [- 'title' => '整理你的想法',- 'hint' => '从头脑风暴到内容计划',- 'ask' => '给我下周的 8 个帖子点子,并保存到我的看板。',- 'reply' => '我已把 8 个点子存到你的看板,随时可以变成帖子。',- ],- ],- 'skip' => '暂时跳过',- ],];diff --git a/resources/js/components/mcp/McpPromptCard.vue b/resources/js/components/mcp/McpPromptCard.vuenew file mode 100644index 000000000..b6cf21856--- /dev/null+++ b/resources/js/components/mcp/McpPromptCard.vue@@ -0,0 +1,208 @@+<script setup lang="ts">+import { useHttp, usePage } from '@inertiajs/vue3';+import { IconX } from '@tabler/icons-vue';+import { useIntervalFn } from '@vueuse/core';+import { computed, onBeforeUnmount, ref, watch } from 'vue';++import McpConnectDialog from '@/components/mcp/McpConnectDialog.vue';+import { Button } from '@/components/ui/button';+import { useBelowBreakpoint } from '@/composables/useBreakpoint';+import { useUserStorage } from '@/composables/useBrowserStorage';+import {+ mcpAppLogos,+ mcpClients,+ type McpAppLogo,+ type McpClient,+ type McpClientId,+} from '@/lib/mcpClients';+import {+ show as showConnectionStatus,+ store as storePromptAnswer,+} from '@/routes/app/mcp/prompt';+import type { SharedData } from '@/types';+import { fireCelebration } from '@/utils/confetti';++interface McpConnectionStatus {+ connected: boolean;+}++/**+ * The apps people connect most, best known first, as a row of overlapping+ * avatars on top of the card: each one sits over the next.+ */+const AVATAR_APPS = ['chatgpt', 'claude', 'grok', 'gemini', 'cursor', 'n8n'];++const avatars: McpAppLogo[] = AVATAR_APPS.flatMap((id) =>+ mcpAppLogos.filter((app) => app.id === id),+);++const page = usePage<SharedData>();+const isPhone = useBelowBreakpoint('sm');++const dismissed = useUserStorage('mcp.promptDismissed', false);+const connected = ref(false);+const prompt = computed(() => page.props.mcpPrompt ?? null);++/**+ * Invites the user to connect an AI until they connect one or say not now.+ * Connecting is a desktop task, and the "How did you find us?" survey goes first.+ */+const visible = computed(+ (): boolean =>+ prompt.value !== null &&+ !dismissed.value &&+ !connected.value &&+ !isPhone.value &&+ (page.props.referralSources ?? []).length === 0 &&+ page.component !== 'settings/workspace/Mcp',+);++const connectHttp = useHttp<{ answer: 'connect'; client: McpClientId }>({+ answer: 'connect',+ client: 'claude',+});+const dismissHttp = useHttp<{ answer: 'dismiss' }>({ answer: 'dismiss' });+const statusHttp = useHttp<Record<string, never>, McpConnectionStatus>({});++const dismiss = (): void => {+ dismissed.value = true;+ dismissHttp.post(storePromptAnswer.url()).catch(() => {});+};++const dialogOpen = ref(false);+const activeClient = ref<McpClient>(mcpClients[0]);+const mcpUrl = ref('');++const connect = (client: McpClient): void => {+ connectHttp.client = client.id;+ connectHttp.post(storePromptAnswer.url()).catch(() => {});+ activeClient.value = client;+ mcpUrl.value = prompt.value?.mcp_url ?? '';+ dialogOpen.value = true;+};++let stopConfetti = (): void => {};++/** An AI connected: hide the card, close the steps and celebrate, as the MCP settings do. */+const celebrateConnection = (): void => {+ connected.value = true;+ dialogOpen.value = false;+ stopConfetti();+ stopConfetti = fireCelebration();+};++const checkConnection = async (): Promise<void> => {+ if (statusHttp.processing) {+ return;+ }++ const status = await statusHttp+ .get(showConnectionStatus.url())+ .catch(() => null);++ if (status?.connected === true) {+ celebrateConnection();+ }+};++/**+ * While the card or its steps are on screen, ask whether an AI connected to+ * this workspace, from the card or from anywhere else.+ */+const poll = useIntervalFn(checkConnection, 2000, { immediate: false });++const followCard = (onScreen: boolean): void => {+ if (onScreen) {+ poll.resume();++ return;+ }++ poll.pause();+};++watch(() => visible.value || dialogOpen.value, followCard, { immediate: true });++onBeforeUnmount(() => {+ poll.pause();+ stopConfetti();+});+</script>++<template>+ <div class="contents">+ <Transition+ enter-active-class="motion-safe:animate-in motion-safe:fade-in motion-safe:slide-in-from-bottom-2 motion-safe:duration-300"+ >+ <aside+ v-if="visible"+ class="fixed end-4 bottom-4 z-40 w-[calc(100vw-2rem)] max-w-sm rounded-xl bg-popover p-4 text-popover-foreground shadow-lg dark:border dark:border-border"+ aria-labelledby="mcp-prompt-title"+ aria-describedby="mcp-prompt-body"+ data-testid="mcp-prompt"+ >+ <div class="flex items-start justify-between gap-3">+ <div class="flex -space-x-2" aria-hidden="true">+ <span+ v-for="(app, position) in avatars"+ :key="app.id"+ class="relative inline-flex size-9 items-center justify-center rounded-lg bg-muted ring-2 ring-popover"+ :style="{ zIndex: avatars.length - position }"+ :data-testid="`mcp-prompt-avatar-${app.id}`"+ >+ <component+ :is="app.logo"+ :class="['size-5 text-foreground', app.logoClass]"+ />+ </span>+ </div>+ <Button+ type="button"+ variant="ghost"+ size="icon"+ class="-me-1.5 -mt-1.5 size-7 text-muted-foreground"+ :aria-label="$t('mcp.prompt.not_now')"+ data-testid="mcp-prompt-close"+ @click="dismiss"+ >+ <IconX class="size-4" />+ </Button>+ </div>++ <h2+ id="mcp-prompt-title"+ class="mt-3 text-sm font-medium text-foreground"+ >+ {{ $t('mcp.prompt.title') }}+ </h2>+ <p+ id="mcp-prompt-body"+ class="mt-1 text-sm text-muted-foreground"+ >+ {{ $t('mcp.prompt.body') }}+ </p>++ <div class="mt-4 grid grid-cols-2 gap-2">+ <Button+ v-for="client in mcpClients"+ :key="client.id"+ type="button"+ :class="client.brandButtonClass"+ :data-testid="`mcp-prompt-connect-${client.id}`"+ @click="connect(client)"+ >+ <component :is="client.logo" class="size-4 fill-current" />+ {{ client.label }}+ </Button>+ </div>+ </aside>+ </Transition>++ <McpConnectDialog+ v-if="mcpUrl"+ v-model:open="dialogOpen"+ :client="activeClient"+ :mcp-url="mcpUrl"+ />+ </div>+</template>diff --git a/resources/js/components/welcome/mcp/McpChatExample.vue b/resources/js/components/welcome/mcp/McpChatExample.vuedeleted file mode 100644index 2c00d57d7..000000000--- a/resources/js/components/welcome/mcp/McpChatExample.vue+++ /dev/null@@ -1,48 +0,0 @@-<script setup lang="ts">-import { IconCheck } from '@tabler/icons-vue';-import { computed, type Component } from 'vue';--import AppLogo from '@/components/AppLogo.vue';-import McpFollowersMockup from '@/components/welcome/mcp/McpFollowersMockup.vue';-import McpIdeasMockup from '@/components/welcome/mcp/McpIdeasMockup.vue';-import McpQueueMockup from '@/components/welcome/mcp/McpQueueMockup.vue';-import McpScheduleMockup from '@/components/welcome/mcp/McpScheduleMockup.vue';-import date from '@/date';--defineProps<{- benefit: string;-}>();--const mockups: Record<string, Component> = {- schedule: McpScheduleMockup,- analytics: McpFollowersMockup,- queue: McpQueueMockup,- ideas: McpIdeasMockup,-};--/** The schedule example's time, in the user's clock format like its card. */-const scheduledTime = computed((): string => date.formatClockTime('10:00'));-</script>--<template>- <div class="flex flex-col gap-4">- <p- class="ms-12 self-end rounded-2xl rounded-ee-sm bg-muted px-3.5 py-2.5 text-sm text-foreground"- >- {{ $t(`welcome.mcp.benefits.${benefit}.ask`, { time: scheduledTime }) }}- </p>- <div class="flex flex-col gap-2">- <span- class="inline-flex items-center gap-1.5 self-start rounded-md border border-border bg-card px-2 py-1 text-xs font-medium text-foreground"- >- <AppLogo variant="mark" class="text-[12px]" />- TryPost- <IconCheck class="size-3.5 text-green-500" />- </span>- <p class="text-sm text-foreground">- {{ $t(`welcome.mcp.benefits.${benefit}.reply`, { time: scheduledTime }) }}- </p>- <component :is="mockups[benefit]" class="mt-1" aria-hidden="true" />- </div>- </div>-</template>diff --git a/resources/js/components/welcome/mcp/McpFollowersMockup.vue b/resources/js/components/welcome/mcp/McpFollowersMockup.vuedeleted file mode 100644index 12e541a65..000000000--- a/resources/js/components/welcome/mcp/McpFollowersMockup.vue+++ /dev/null@@ -1,250 +0,0 @@-<script setup lang="ts">-import { usePage } from '@inertiajs/vue3';-import { ref } from 'vue';--import PlatformLogo from '@/components/PlatformLogo.vue';-import type { ChartConfig } from '@/components/ui/chart';-import ChartTooltipContent from '@/components/ui/chart/ChartTooltipContent.vue';-import { getPlatformLabel } from '@/composables/usePlatformLogo';-import date from '@/date';-import dayjs from '@/dayjs';-import { accountColor } from '@/lib/analyticsColors';-import type { SharedData } from '@/types';--const WIDTH = 300;-const HEIGHT = 100;--/**- * Illustrative follower history over the last six months, one curve per- * network, so the example reads like the Insights followers chart. The last- * month adds up to the 12.4k total and each network gains what the legend says.- */-const accounts = [- {- platform: 'linkedin',- start: 5200,- growth: 640,- values: [6, 24, 16, 48, 70, 100],- },- {- platform: 'instagram',- start: 4800,- growth: 420,- values: [22, 30, 52, 36, 58, 76],- },- {- platform: 'x',- start: 1200,- growth: 140,- values: [4, 12, 8, 18, 14, 30],- },-].map((account, index) => ({ ...account, color: accountColor(index) }));--const months = Array.from({ length: 6 }, (_, index) =>- date.userNow().subtract(5 - index, 'month'),-);--const hovered = ref<number | null>(null);--const owner = usePage<SharedData>().props.auth.user;--const tooltipConfig: ChartConfig = Object.fromEntries(- accounts.map((account) => [- account.platform,- {- label: getPlatformLabel(account.platform),- color: account.color,- avatar: {- platform: account.platform,- name: owner.name,- src: owner.has_photo ? owner.photo_url : null,- },- },- ]),-);--const pointY = (value: number): number => HEIGHT - 5 - value * 0.9;--const pointX = (index: number): number => (index * WIDTH) / (months.length - 1);--const followersAt = (- account: (typeof accounts)[number],- index: number,-): number => {- const first = account.values[0];- const last = account.values[account.values.length - 1];-- return Math.round(- account.start +- ((account.values[index] - first) / (last - first)) * account.growth,- );-};--/** A smooth Catmull-Rom curve through the points, as cubic Béziers. */-const toCurve = (values: number[]): string => {- const points = values.map(- (value, index): [number, number] => [pointX(index), pointY(value)],- );-- return points.reduce((path, [x, y], index) => {- if (index === 0) {- return `M${x},${y}`;- }-- const [x0, y0] = points[Math.max(index - 2, 0)];- const [x1, y1] = points[index - 1];- const [x3, y3] = points[Math.min(index + 1, points.length - 1)];-- return `${path} C${x1 + (x - x0) / 6},${y1 + (y - y0) / 6} ${x - (x3 - x1) / 6},${y - (y3 - y1) / 6} ${x},${y}`;- }, '');-};--const toArea = (values: number[]): string =>- `${toCurve(values)} L${WIDTH},${HEIGHT} L0,${HEIGHT} Z`;--/** Beside the guide line, on the side with room, so it never hides the points. */-const tooltipPosition = (index: number): Record<string, string> => ({- left: `${(index / (months.length - 1)) * 100}%`,- transform:- index < months.length / 2- ? 'translateX(12px)'- : 'translateX(calc(-100% - 12px))',-});--const tooltipPayload = (index: number): Record<string, number> =>- Object.fromEntries(- accounts.map((account) => [- account.platform,- followersAt(account, index),- ]),- );--const formatMonth = (value: number | Date): string => {- const month = dayjs(value);-- return date.formatMonthYear(month.month() + 1, month.year());-};--const showMonth = (index: number): void => {- hovered.value = index;-};--const hideMonth = (): void => {- hovered.value = null;-};-</script>--<template>- <article- class="flex flex-col gap-3 rounded-lg border border-border bg-card p-4"- >- <div class="flex flex-col gap-0.5">- <span- class="font-heading text-xl leading-tight font-medium tabular-nums"- >- 12.4k- </span>- <span class="text-xs text-muted-foreground">- {{ $t('analytics.dashboard.total_followers') }}- </span>- </div>- <div class="flex flex-col gap-1.5 border-t border-border pt-3">- <div class="relative" dir="ltr" @mouseleave="hideMonth">- <svg- :viewBox="`0 0 ${WIDTH} ${HEIGHT}`"- preserveAspectRatio="none"- class="h-28 w-full overflow-visible"- >- <path- :d="toArea(accounts[0].values)"- :style="{ fill: accounts[0].color }"- fill-opacity="0.08"- />- <line- v-if="hovered !== null"- :x1="pointX(hovered)"- :x2="pointX(hovered)"- y1="0"- :y2="HEIGHT"- class="stroke-border-strong"- vector-effect="non-scaling-stroke"- />- <path- v-for="account in accounts"- :key="account.platform"- :d="toCurve(account.values)"- fill="none"- :style="{ stroke: account.color }"- stroke-width="1.25"- stroke-linecap="round"- vector-effect="non-scaling-stroke"- />- </svg>-- <template v-if="hovered !== null">- <span- v-for="account in accounts"- :key="account.platform"- class="pointer-events-none absolute size-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-card"- :style="{- left: `${(hovered / (months.length - 1)) * 100}%`,- top: `${(pointY(account.values[hovered]) / HEIGHT) * 100}%`,- backgroundColor: account.color,- }"- />- <div- class="pointer-events-none absolute -top-2 z-10"- :style="tooltipPosition(hovered)"- data-testid="welcome-mcp-followers-tooltip"- >- <ChartTooltipContent- :config="tooltipConfig"- :payload="tooltipPayload(hovered)"- :x="months[hovered].toDate()"- :label-formatter="formatMonth"- />- </div>- </template>-- <div class="absolute inset-0 flex">- <span- v-for="(month, index) in months"- :key="month.format('YYYY-MM')"- class="h-full flex-1 cursor-crosshair"- :data-testid="`welcome-mcp-followers-month-${index}`"- @mouseenter="showMonth(index)"- />- </div>- </div>- <div- class="flex justify-between text-[11px] text-muted-foreground"- dir="ltr"- >- <span- v-for="month in months"- :key="month.format('YYYY-MM')"- >- {{ date.formatShortMonth(month.month() + 1) }}- </span>- </div>- </div>- <ul- class="flex flex-wrap gap-x-5 gap-y-2 border-t border-border pt-3"- >- <li- v-for="account in accounts"- :key="account.platform"- class="flex items-center gap-1.5 text-xs"- >- <span- class="size-2.5 shrink-0 rounded-[3px]"- :style="{ backgroundColor: account.color }"- />- <PlatformLogo :platform="account.platform" :size="16" />- <span class="text-muted-foreground tabular-nums">- +{{ account.growth }}- </span>- </li>- </ul>- </article>-</template>diff --git a/resources/js/components/welcome/mcp/McpIdeasMockup.vue b/resources/js/components/welcome/mcp/McpIdeasMockup.vuedeleted file mode 100644index 4761a3e0c..000000000--- a/resources/js/components/welcome/mcp/McpIdeasMockup.vue+++ /dev/null@@ -1,55 +0,0 @@-<script setup lang="ts">-import { IconPlus } from '@tabler/icons-vue';--/** The board's default stages: the 8 new ideas land in To do. */-const columns = [- { stage: 'todo', count: 8, cards: ['#6D43CC', '#159B92'] },- { stage: 'in_progress', count: 2, cards: ['#E9833D', '#347AB7'] },-];-</script>--<template>- <div class="grid grid-cols-2 gap-3">- <section- v-for="column in columns"- :key="column.stage"- :data-testid="`welcome-mcp-ideas-stage-${column.stage}`"- class="flex flex-col gap-2 rounded-lg bg-secondary p-2"- >- <header class="flex h-7 items-center gap-1.5 px-1">- <span class="truncate text-xs font-medium text-foreground">- {{ $t(`create.ideas.default_stages.${column.stage}`) }}- </span>- <span- class="inline-flex h-4.5 min-w-4.5 items-center justify-center rounded-full bg-card px-1 text-xs font-medium text-muted-foreground"- >- {{ column.count }}- </span>- </header>- <article- v-for="color in column.cards"- :key="color"- class="flex flex-col gap-2 rounded-lg border border-border bg-card p-3"- >- <span class="h-2 w-3/4 rounded-full bg-border-strong" />- <span class="h-2 w-full rounded-full bg-muted" />- <span class="h-2 w-2/3 rounded-full bg-muted" />- <span- class="inline-flex items-center gap-1.5 self-start rounded-full border border-border bg-card px-2 py-0.5 shadow-2xs"- >- <span- class="size-2 rounded-full"- :style="{ backgroundColor: color }"- />- <span class="h-1.5 w-8 rounded-full bg-muted" />- </span>- </article>- <span- class="flex h-7 items-center justify-center gap-1 text-xs font-medium text-muted-foreground"- >- <IconPlus class="size-3.5" />- {{ $t('create.ideas.new') }}- </span>- </section>- </div>-</template>diff --git a/resources/js/components/welcome/mcp/McpQueueMockup.vue b/resources/js/components/welcome/mcp/McpQueueMockup.vuedeleted file mode 100644index 2f7e511ed..000000000--- a/resources/js/components/welcome/mcp/McpQueueMockup.vue+++ /dev/null@@ -1,62 +0,0 @@-<script setup lang="ts">-import { usePage } from '@inertiajs/vue3';-import { IconPlus } from '@tabler/icons-vue';--import ChannelAvatar from '@/components/ChannelAvatar.vue';-import PlatformBrandIcon from '@/components/PlatformBrandIcon.vue';-import date from '@/date';-import type { SharedData } from '@/types';--const posts = [- { time: '09:00', platform: 'linkedin' },- { time: '12:30', platform: 'instagram' },- { time: '15:00', platform: 'facebook' },-];--const owner = usePage<SharedData>().props.auth.user;-const ownerPhoto = owner.has_photo ? owner.photo_url : null;-</script>--<template>- <section class="flex flex-col gap-2.5">- <h3 class="text-sm font-emphasis text-foreground">- {{ $t('posts.publish.tomorrow') }}- </h3>- <div- v-for="post in posts"- :key="post.time"- class="grid grid-cols-[4.5rem_minmax(0,1fr)] items-center gap-x-4"- >- <time class="text-sm font-medium text-foreground">- {{ date.formatClockTime(post.time) }}- </time>- <article- class="flex items-center gap-3 rounded-xl border border-border-strong bg-card p-3"- >- <ChannelAvatar- :platform="post.platform"- :name="owner.name"- :src="ownerPhoto"- :size="28"- ring="card"- />- <div class="flex min-w-0 flex-1 flex-col gap-1.5">- <span class="h-2 w-4/5 rounded-full bg-muted" />- <span class="h-2 w-1/2 rounded-full bg-muted" />- </div>- </article>- </div>- <div class="grid grid-cols-[4.5rem_minmax(0,1fr)] items-center gap-x-4">- <time class="text-sm font-medium text-foreground">- {{ date.formatClockTime('18:00') }}- </time>- <span- class="flex h-12 items-center gap-1 rounded-xl border border-border-strong bg-card px-2 text-sm font-medium text-foreground"- >- <PlatformBrandIcon platform="x" colored />- <IconPlus class="size-4" />- {{ $t('posts.publish.new_in_slot') }}- </span>- </div>- </section>-</template>diff --git a/resources/js/components/welcome/mcp/McpScheduleMockup.vue b/resources/js/components/welcome/mcp/McpScheduleMockup.vuedeleted file mode 100644index c433c4e36..000000000--- a/resources/js/components/welcome/mcp/McpScheduleMockup.vue+++ /dev/null@@ -1,69 +0,0 @@-<script setup lang="ts">-import { usePage } from '@inertiajs/vue3';-import { IconClock, IconPhoto } from '@tabler/icons-vue';--import ChannelAvatar from '@/components/ChannelAvatar.vue';-import { Badge } from '@/components/ui/badge';-import date from '@/date';-import type { SharedData } from '@/types';--const slideCount = 4;--/** The reply schedules the carousel on both networks: one post each. */-const platforms = ['instagram', 'linkedin'] as const;--const owner = usePage<SharedData>().props.auth.user;-const ownerPhoto = owner.has_photo ? owner.photo_url : null;-</script>--<template>- <div- class="grid gap-y-2 sm:grid-cols-[4.5rem_minmax(0,1fr)] sm:gap-x-4"- >- <time class="text-sm font-medium text-foreground sm:pt-4">- {{ date.formatClockTime('10:00') }}- </time>- <div class="flex flex-col gap-1.5">- <article- v-for="platform in platforms"- :key="platform"- class="rounded-xl border border-border-strong bg-card"- :data-testid="`welcome-mcp-schedule-post-${platform}`"- >- <div class="flex flex-col gap-4 p-4 sm:flex-row">- <div class="flex min-w-0 flex-1 flex-col gap-2.5">- <div class="flex items-center gap-3">- <ChannelAvatar- :platform="platform"- :name="owner.name"- :src="ownerPhoto"- :size="32"- ring="card"- />- <span class="truncate text-sm font-emphasis">{{- owner.name- }}</span>- </div>- <div class="flex flex-col gap-2">- <span class="h-2 w-full rounded-full bg-muted" />- <span class="h-2 w-5/6 rounded-full bg-muted" />- </div>- <Badge class="h-6 gap-1 self-start px-2 [&>svg]:size-4">- <IconClock />- {{ $t('posts.status.scheduled') }}- </Badge>- </div>- <div class="grid shrink-0 grid-cols-4 content-start gap-1.5 sm:w-24 sm:grid-cols-2">- <span- v-for="slide in slideCount"- :key="slide"- class="flex aspect-square items-center justify-center rounded-md border border-border-strong bg-secondary"- >- <IconPhoto class="size-4 text-muted-foreground" />- </span>- </div>- </div>- </article>- </div>- </div>-</template>diff --git a/resources/js/composables/useBrowserStorage.ts b/resources/js/composables/useBrowserStorage.tsnew file mode 100644index 000000000..66f306887--- /dev/null+++ b/resources/js/composables/useBrowserStorage.ts@@ -0,0 +1,43 @@+import { usePage } from '@inertiajs/vue3';+import { useEventListener } from '@vueuse/core';+import { computed, shallowRef, type WritableComputedRef } from 'vue';++import {+ browserStorageKey,+ readBrowserStorage,+ updateBrowserStorage,+} from '@/lib/browserStorage';+import type { SharedData } from '@/types';+import type { UserStorage } from '@/types/browser-storage';++/**+ * An item the signed-in user keeps in this browser, in every workspace.+ * Setting it saves it, and a change made in another tab shows here at once.+ */+export const useUserStorage = <Key extends keyof UserStorage>(+ key: Key,+ fallback: UserStorage[Key],+): WritableComputedRef<UserStorage[Key]> => {+ const userId = usePage<SharedData>().props.auth.user.id;+ const read = (): UserStorage[Key] => readBrowserStorage(userId).user[key] ?? fallback;+ const stored = shallowRef<UserStorage[Key]>(read());++ const followOtherTabs = (event: StorageEvent): void => {+ if (event.key === browserStorageKey(userId)) {+ stored.value = read();+ }+ };++ useEventListener(window, 'storage', followOtherTabs);++ return computed({+ get: () => stored.value,+ set: (value) => {+ stored.value = value;+ updateBrowserStorage(userId, (storage) => ({+ ...storage,+ user: { ...storage.user, [key]: value },+ }));+ },+ });+};diff --git a/resources/js/layouts/app/AppSidebarLayout.vue b/resources/js/layouts/app/AppSidebarLayout.vueindex 9665edb22..702946cc0 100644--- a/resources/js/layouts/app/AppSidebarLayout.vue+++ b/resources/js/layouts/app/AppSidebarLayout.vue@@ -12,6 +12,7 @@ import AppSidebar from '@/components/AppSidebar.vue';import ChangelogDialog from '@/components/changelog/ChangelogDialog.vue';import ConnectChannelDialog from '@/components/channels/ConnectChannelDialog.vue';import CommandPalette from '@/components/command-palette/CommandPalette.vue';+import McpPromptCard from '@/components/mcp/McpPromptCard.vue';import GlobalPostComposer from '@/components/posts/composer/GlobalPostComposer.vue';import ReferralSourceSurvey from '@/components/ReferralSourceSurvey.vue';import Toast from '@/components/Toast.vue';@@ -122,5 +123,6 @@ watch(isCompactViewport, (isCompact) => {<ChangelogDialog /><CommandPalette /><ReferralSourceSurvey />+ <McpPromptCard /><Toast /></template>diff --git a/resources/js/lib/browserStorage.ts b/resources/js/lib/browserStorage.tsnew file mode 100644index 000000000..0cada29a0--- /dev/null+++ b/resources/js/lib/browserStorage.ts@@ -0,0 +1,37 @@+import type { BrowserStorage } from '@/types/browser-storage';++export const browserStorageKey = (userId: string): string => `trypost:${userId}`;++const empty = (): BrowserStorage => ({ version: 1, user: {}, workspaces: {} });++/** The user's stored value; a missing, unreadable or other-version one reads as empty. */+export const readBrowserStorage = (userId: string): BrowserStorage => {+ try {+ const stored = JSON.parse(+ window.localStorage.getItem(browserStorageKey(userId)) ?? 'null',+ ) as BrowserStorage | null;++ if (stored?.version === 1) {+ return stored;+ }+ } catch {+ return empty();+ }++ return empty();+};++/** Reads the value again before writing, so two tabs never write back each other's stale copy. */+export const updateBrowserStorage = (+ userId: string,+ update: (storage: BrowserStorage) => BrowserStorage,+): void => {+ try {+ window.localStorage.setItem(+ browserStorageKey(userId),+ JSON.stringify(update(readBrowserStorage(userId))),+ );+ } catch {+ return;+ }+};diff --git a/resources/js/lib/mcpClients.ts b/resources/js/lib/mcpClients.tsindex 4f568246b..f19a024fd 100644--- a/resources/js/lib/mcpClients.ts+++ b/resources/js/lib/mcpClients.ts@@ -30,6 +30,8 @@ export interface McpClient {settingsUrl?: string;/** Listed in the client's app store: the user connects from its page, nothing to paste. */listed?: boolean;+ /** A button filled in the brand's color, with the mark in the button's text color. */+ brandButtonClass?: string;}/** TryPost's page in the ChatGPT app store. */@@ -41,8 +43,9 @@ const CLAUDE_ADD_CONNECTOR_URL ='https://claude.ai/new?modal=add-custom-connector#customize/connectors/yours';/**- * First-class MCP clients surfaced on workspace MCP settings and the Welcome- * MCP step. `settingsUrl` is where the user adds a connector in that client.+ * First-class MCP clients surfaced on workspace MCP settings and the in-app+ * card that invites the user to connect an AI (`McpPromptCard`).+ * `settingsUrl` is where the user adds a connector in that client.*/export const mcpClients: McpClient[] = [{@@ -50,6 +53,8 @@ export const mcpClients: McpClient[] = [label: 'Claude',logo: Claude,settingsUrl: CLAUDE_ADD_CONNECTOR_URL,+ brandButtonClass:+ 'bg-[#d97757] text-white hover:bg-[#c4643f] dark:bg-[#d97757] dark:text-white dark:hover:bg-[#c4643f]',},{id: 'chatgpt',@@ -57,6 +62,8 @@ export const mcpClients: McpClient[] = [logo: OpenaiChatgpt,settingsUrl: CHATGPT_APP_URL,listed: true,+ brandButtonClass:+ 'bg-black text-white hover:bg-black/80 dark:bg-white dark:text-black dark:hover:bg-white/85',},];diff --git a/resources/js/pages/billing/Processing.vue b/resources/js/pages/billing/Processing.vueindex 7d879c2b1..de8952373 100644--- a/resources/js/pages/billing/Processing.vue+++ b/resources/js/pages/billing/Processing.vue@@ -3,11 +3,9 @@ import { Head, router, usePage, usePoll } from '@inertiajs/vue3';import { IconLoader2 } from '@tabler/icons-vue';import { computed, onMounted, ref, watch } from 'vue';-import { useBelowBreakpoint } from '@/composables/useBreakpoint';import AuthSplitLayout from '@/layouts/auth/AuthSplitLayout.vue';import { index as billingIndex } from '@/routes/app/billing';import { index as postsIndex } from '@/routes/app/posts';-import { mcp } from '@/routes/app/welcome';import type { SharedData } from '@/types';const props = defineProps<{@@ -28,9 +26,6 @@ const purchaseReady = computed((): boolean => props.ready && page.props.auth.plan !== null,);-const isPhone = useBelowBreakpoint('sm');--/** Connecting an AI is a desktop task, so phones go straight to the schedule. */const goNext = (): void => {if (props.returnsToBilling) {router.visit(billingIndex.url(), { replace: true });@@ -38,9 +33,7 @@ const goNext = (): void => {return;}- router.visit(isPhone.value ? postsIndex.url() : mcp.url(), {- replace: true,- });+ router.visit(postsIndex.url(), { replace: true });};// Card-required trials are already `subscribed()` (`trialing`) on first paint.diff --git a/resources/js/pages/welcome/Mcp.vue b/resources/js/pages/welcome/Mcp.vuedeleted file mode 100644index ad7cceab3..000000000--- a/resources/js/pages/welcome/Mcp.vue+++ /dev/null@@ -1,451 +0,0 @@-<script setup lang="ts">-import { Head, Link, router, useHttp, usePoll } from '@inertiajs/vue3';-import {- IconArrowRight,- IconBulb,- IconCalendarPlus,- IconChevronRight,- IconCircleCheckFilled,- IconListDetails,- IconSparkles,- IconTrendingUp,-} from '@tabler/icons-vue';-import {- computed,- nextTick,- onBeforeUnmount,- ref,- useTemplateRef,- watch,- type Component,-} from 'vue';--import BottomSheet from '@/components/BottomSheet.vue';-import McpConnectDialog from '@/components/mcp/McpConnectDialog.vue';-import { Button } from '@/components/ui/button';-import McpChatExample from '@/components/welcome/mcp/McpChatExample.vue';-import WelcomeContinueButton from '@/components/welcome/WelcomeContinueButton.vue';-import { useAutoRotate } from '@/composables/useAutoRotate';-import WelcomeLayout from '@/layouts/WelcomeLayout.vue';-import {- mcpClients,- otherMcpClient,- type McpClient,- type McpClientId,-} from '@/lib/mcpClients';-import { index as postsIndex } from '@/routes/app/posts';-import {- connectClick,- skip as skipMcp,-} from '@/routes/app/welcome/mcp';-import { fireCelebration } from '@/utils/confetti';--interface ConnectedClient {- client_id: string;- name: string;-}--const props = defineProps<{- mcpUrl: string;- connectedClients: ConnectedClient[];-}>();--const { stop: stopPolling } = usePoll(- 2000,- { only: ['connectedClients'] },- { autoStart: props.connectedClients.length === 0 },-);--const benefits: { key: string; icon: Component }[] = [- { key: 'ideas', icon: IconBulb },- { key: 'schedule', icon: IconCalendarPlus },- { key: 'queue', icon: IconListDetails },- { key: 'analytics', icon: IconTrendingUp },-];--const {- active: activeBenefit,- select: selectBenefit,- pause: pauseBenefits,- resume: resumeBenefits,- stop: stopBenefits,-} = useAutoRotate(benefits.length, 3000);--/** Picking a tab means the user wants to read it: the rotation stops for good. */-const chooseBenefit = (index: number): void => {- selectBenefit(index);- stopBenefits();-};--const activeKey = computed((): string => benefits[activeBenefit.value].key);--const pills = useTemplateRef<HTMLElement>('pills');--const revealActivePill = async (): Promise<void> => {- await nextTick();-- const row = pills.value;- const pill = row?.children[activeBenefit.value];-- if (!row || !pill || row.clientWidth === 0) {- return;- }-- const rowBox = row.getBoundingClientRect();- const pillBox = pill.getBoundingClientRect();-- row.scrollBy({- left:- pillBox.left + pillBox.width / 2 - (rowBox.left + rowBox.width / 2),- behavior: 'smooth',- });-};--watch(activeBenefit, revealActivePill);--const connectedClient = computed(- (): ConnectedClient | null => props.connectedClients[0] ?? null,-);--const connectableClients: McpClient[] = [...mcpClients, otherMcpClient];--const activeClient = ref<McpClient>(mcpClients[0]);-const dialogOpen = ref(false);-const connectClickHttp = useHttp<{ client: McpClientId }>({ client: 'claude' });--const trackConnectClick = (client: McpClient): void => {- connectClickHttp.client = client.id;- connectClickHttp.post(connectClick.url()).catch(() => {});-};--const connectWith = (client: McpClient): void => {- activeClient.value = client;- dialogOpen.value = true;- trackConnectClick(client);-};--const aiPickerOpen = ref(false);--const openAiPicker = (): void => {- aiPickerOpen.value = true;-};--/** Phones pick the app in a sheet first; the steps open once it has closed. */-const pickAi = async (client: McpClient): Promise<void> => {- aiPickerOpen.value = false;- await nextTick();- connectWith(client);-};--const connectedStatus = useTemplateRef<HTMLElement>('connectedStatus');-let stopConfetti = (): void => {};--/**- * The poll notices the connection while the user is still in the other tab:- * close the steps and celebrate on the page's own connected state.- */-const celebrateConnection = async (- client: ConnectedClient | null,- previous: ConnectedClient | null,-): Promise<void> => {- if (!client || previous) {- return;- }-- stopPolling();- dialogOpen.value = false;- await nextTick();-- stopConfetti = fireCelebration(connectedStatus.value ?? undefined);-};--watch(connectedClient, celebrateConnection);--onBeforeUnmount(() => {- stopConfetti();-});--const goToSchedule = (): void => {- router.visit(postsIndex.url());-};-</script>--<template>- <Head :title="$t('welcome.mcp.title')" />-- <WelcomeLayout- :title="$t('welcome.mcp.title')"- :description="$t('welcome.mcp.description')"- size="4xl"- actions-size="4xl"- >- <article class="text-start">- <p- class="sr-only"- aria-live="polite"- data-testid="welcome-mcp-announcement"- >- {{- connectedClient- ? $t('welcome.mcp.connected', {- client: connectedClient.name,- })- : ''- }}- </p>- <div- class="flex flex-col overflow-hidden rounded-xl border border-border-strong bg-card"- data-testid="welcome-mcp-window"- @mouseenter="pauseBenefits"- @mouseleave="resumeBenefits"- @focusin="pauseBenefits"- @focusout="resumeBenefits"- >- <div- class="flex h-9 shrink-0 items-center gap-1.5 border-b border-border bg-muted px-3.5"- aria-hidden="true"- >- <span class="size-3 rounded-full bg-[#ff5f57]" />- <span class="size-3 rounded-full bg-[#febc2e]" />- <span class="size-3 rounded-full bg-[#28c840]" />- </div>-- <div- class="grid flex-1 lg:grid-cols-[auto_minmax(0,1fr)]"- >- <div- class="flex flex-col gap-1 border-border bg-muted/40 p-2 max-md:hidden max-lg:border-b lg:border-e"- role="group"- :aria-label="$t('welcome.mcp.title')"- >- <button- v-for="(benefit, index) in benefits"- :key="benefit.key"- type="button"- :aria-pressed="index === activeBenefit"- :class="[- 'flex w-full cursor-pointer items-start gap-3 rounded-lg p-2.5 text-start sm:p-3 transition-control focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring',- index === activeBenefit- ? 'bg-primary-subtle dark:bg-primary-selected'- : 'hover:bg-muted',- ]"- :data-testid="`welcome-mcp-benefit-${benefit.key}`"- @click="chooseBenefit(index)"- >- <span- :class="[- 'inline-flex size-8 shrink-0 items-center justify-center rounded-lg border transition-control',- index === activeBenefit- ? 'border-transparent bg-primary-strong text-primary-strong-foreground dark:bg-primary dark:text-primary-foreground'- : 'border-border bg-card text-primary-text',- ]"- aria-hidden="true"- :data-testid="`welcome-mcp-benefit-icon-${benefit.key}`"- >- <component :is="benefit.icon" class="size-4" />- </span>- <span class="flex min-w-0 flex-col gap-0.5">- <span class="text-sm font-medium whitespace-nowrap text-foreground">- {{- $t(`welcome.mcp.benefits.${benefit.key}.title`)- }}- </span>- <span- class="text-xs whitespace-nowrap text-muted-foreground"- >- {{- $t(`welcome.mcp.benefits.${benefit.key}.hint`)- }}- </span>- </span>- </button>- </div>-- <div- ref="pills"- class="flex gap-2 overflow-x-auto border-b border-border bg-muted/40 p-3 [mask-image:linear-gradient(to_right,black_85%,transparent)] md:hidden rtl:[mask-image:linear-gradient(to_left,black_85%,transparent)]"- role="group"- :aria-label="$t('welcome.mcp.title')"- >- <button- v-for="(benefit, index) in benefits"- :key="benefit.key"- type="button"- :aria-pressed="index === activeBenefit"- :class="[- 'inline-flex h-8 shrink-0 cursor-pointer items-center gap-1.5 rounded-full border px-3 text-sm font-medium whitespace-nowrap transition-control focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring',- index === activeBenefit- ? 'border-primary-strong bg-primary-subtle text-primary-text dark:bg-primary-selected'- : 'border-border bg-card text-muted-foreground',- ]"- :data-testid="`welcome-mcp-pill-${benefit.key}`"- @click="chooseBenefit(index)"- >- <component :is="benefit.icon" class="size-4" />- {{ $t(`welcome.mcp.benefits.${benefit.key}.title`) }}- </button>- </div>-- <div class="flex flex-col">- <div class="grid flex-1 p-4">- <McpChatExample- v-for="benefit in benefits"- :key="benefit.key"- :benefit="benefit.key"- class="invisible [grid-area:1/1]"- aria-hidden="true"- />- <Transition- mode="out-in"- enter-active-class="transition-opacity duration-300"- leave-active-class="transition-opacity duration-300"- enter-from-class="opacity-0"- leave-to-class="opacity-0"- >- <McpChatExample- :key="activeKey"- :benefit="activeKey"- class="[grid-area:1/1]"- :data-testid="`welcome-mcp-chat-${activeKey}`"- />- </Transition>- </div>- </div>- </div>- </div>- </article>-- <template #actions>- <template v-if="connectedClient">- <WelcomeContinueButton- :disabled="false"- testid="welcome-mcp-continue"- @continue="goToSchedule"- />- <p- ref="connectedStatus"- class="flex items-center gap-1.5 text-sm font-medium text-foreground"- data-testid="welcome-mcp-status"- aria-hidden="true"- >- <IconCircleCheckFilled class="size-4 shrink-0 text-green-500" />- {{- $t('welcome.mcp.connected', {- client: connectedClient.name,- })- }}- </p>- </template>- <template v-else>- <div class="flex gap-2 max-sm:hidden">- <Button- v-for="client in connectableClients"- :key="client.id"- type="button"- size="lg"- :data-testid="`welcome-mcp-connect-${client.id}`"- @click="connectWith(client)"- >- <component- :is="client.logo"- aria-hidden="true"- class="size-4 fill-current"- />- {{- client.labelKey- ? $t('welcome.mcp.connect_other')- : $t('welcome.mcp.connect_with', {- client: client.label,- })- }}- </Button>- </div>- <div class="grid w-full grid-cols-2 gap-2 sm:hidden">- <Button- type="button"- size="lg"- data-testid="welcome-mcp-connect-ai"- @click="openAiPicker"- >- <IconSparkles class="size-4" />- {{ $t('welcome.mcp.connect_ai') }}- </Button>- <Button- as-child- variant="secondary"- size="lg"- >- <Link- :href="skipMcp.url()"- data-testid="welcome-mcp-skip-link"- >- {{ $t('welcome.mcp.skip') }}- <IconArrowRight class="size-4 rtl:rotate-180" />- </Link>- </Button>- </div>- <Button- as-child- variant="secondary"- size="lg"- class="max-sm:hidden sm:fixed sm:end-8 sm:bottom-8 lg:end-12"- >- <Link- :href="skipMcp.url()"- data-testid="welcome-mcp-skip"- >- {{ $t('welcome.mcp.skip') }}- <IconArrowRight class="size-4 rtl:rotate-180" />- </Link>- </Button>- </template>- </template>-- <BottomSheet- v-model:open="aiPickerOpen"- :title="$t('welcome.mcp.pick_ai')"- test-id="welcome-mcp-ai-picker"- >- <ul class="flex flex-col gap-2 px-4 pb-4">- <li v-for="client in connectableClients" :key="client.id">- <button- type="button"- class="flex w-full cursor-pointer items-center gap-3 rounded-xl border border-border bg-card p-3 text-start transition-control hover:bg-muted"- :data-testid="`welcome-mcp-pick-${client.id}`"- @click="pickAi(client)"- >- <span- class="inline-flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted"- >- <component- :is="client.logo"- aria-hidden="true"- class="size-5 text-foreground"- />- </span>- <span class="flex min-w-0 flex-1 flex-col gap-0.5">- <span class="text-sm font-medium text-foreground">- {{ client.labelKey ? $t(client.label) : client.label }}- </span>- <span- v-if="client.labelKey"- class="text-sm text-muted-foreground"- >- {{ $t('mcp.other_hint') }}- </span>- </span>- <IconChevronRight- class="size-4 shrink-0 text-muted-foreground rtl:rotate-180"- />- </button>- </li>- </ul>- </BottomSheet>-- <McpConnectDialog- v-model:open="dialogOpen"- :client="activeClient"- :mcp-url="mcpUrl"- />- </WelcomeLayout>-</template>diff --git a/resources/js/types/browser-storage.ts b/resources/js/types/browser-storage.tsnew file mode 100644index 000000000..365dfcb53--- /dev/null+++ b/resources/js/types/browser-storage.ts@@ -0,0 +1,17 @@+/**+ * What the app keeps in this browser for a user, in every workspace, by name+ * (`area.thing`, like lang keys). An item never set is absent.+ */+export interface UserStorage {+ 'mcp.promptDismissed': boolean;+}++/**+ * The value of a user's one localStorage key, `trypost:<user id>`: `user`+ * applies in every workspace, `workspaces` holds what only makes sense in one.+ */+export interface BrowserStorage {+ version: 1;+ user: Partial<UserStorage>;+ workspaces: Record<string, Record<string, unknown>>;+}diff --git a/resources/js/types/index.d.ts b/resources/js/types/index.d.tsindex 70495ccb1..7fb52550a 100644--- a/resources/js/types/index.d.ts+++ b/resources/js/types/index.d.ts@@ -113,6 +113,7 @@ export interface SharedData {plans?: PlanOption[];mediaSources?: { menu: MediaSourceOption[] } | null;referralSources?: string[] | null;+ mcpPrompt?: { mcp_url: string } | null;changelog?: SharedChangelog | null;changelogEntries?: ScrollChangelogEntries;mediaUploadLimits?: MediaUploadLimits | null;diff --git a/routes/app.php b/routes/app.phpindex 9e7c47a13..9956b257f 100644--- a/routes/app.php+++ b/routes/app.php@@ -24,6 +24,7 @@ use App\Http\Controllers\App\InstagramAudioController;use App\Http\Controllers\App\LibraryTemplateController;use App\Http\Controllers\App\LinkPreviewController;use App\Http\Controllers\App\LinkPreviewMediaController;+use App\Http\Controllers\App\McpPromptController;use App\Http\Controllers\App\McpSettingsController;use App\Http\Controllers\App\MediaAltTextController;use App\Http\Controllers\App\MediaFileController;@@ -99,11 +100,6 @@ Route::middleware(['auth'])->group(function () {Route::post('welcome/plan', [WelcomeController::class, 'storePlan'])->middleware('throttle:6,1')->name('app.welcome.plan.store');- Route::get('welcome/mcp', [WelcomeController::class, 'mcp'])->name('app.welcome.mcp');- Route::post('welcome/mcp/connect-click', [WelcomeController::class, 'storeMcpConnectClick'])- ->middleware('throttle:30,1')- ->name('app.welcome.mcp.connect-click');- Route::get('welcome/mcp/skip', [WelcomeController::class, 'skipMcp'])->name('app.welcome.mcp.skip');Route::post('referral-source', [ReferralSourceController::class, 'store'])->middleware('throttle:6,1')->name('app.referral-source.store');@@ -390,6 +386,12 @@ Route::middleware(['auth', EnsureAccountReady::class, EnsureHasWorkspace::class]Route::get('settings/workspace/mcp', [McpSettingsController::class, 'index'])->name('app.mcp.index');Route::delete('settings/workspace/mcp/{client}', [McpSettingsController::class, 'disconnect'])->name('app.mcp.disconnect');+ Route::get('settings/workspace/mcp/prompt', [McpPromptController::class, 'show'])+ ->middleware('throttle:60,1')+ ->name('app.mcp.prompt.show');+ Route::post('settings/workspace/mcp/prompt', [McpPromptController::class, 'store'])+ ->middleware('throttle:30,1')+ ->name('app.mcp.prompt.store');Route::get('repurposes', [RepurposeController::class, 'index'])->name('app.repurposes.index');Route::post('repurposes', [RepurposeController::class, 'store'])->name('app.repurposes.store');diff --git a/tests/Browser/BillingProcessingTest.php b/tests/Browser/BillingProcessingTest.phpindex 4af2567ba..ea27a7848 100644--- a/tests/Browser/BillingProcessingTest.php+++ b/tests/Browser/BillingProcessingTest.php@@ -21,17 +21,17 @@ function billingProcessingSubscriber(): Userreturn $user;}-test('once the subscription and plan are ready the processing page sends the user to the MCP step', function () {+test('once the subscription and plan are ready the processing page opens the schedule', function () {config(['trypost.self_hosted' => false]);$this->actingAs(billingProcessingSubscriber());- $mcpPath = parse_url(route('app.welcome.mcp'), PHP_URL_PATH);+ $schedulePath = route('app.posts.index', absolute: false);$page = visit(route('app.billing.processing'));- waitForPath($page, $mcpPath);+ waitForPath($page, $schedulePath);- $page->assertPathIs($mcpPath)+ $page->assertPathIs($schedulePath)->assertNoJavaScriptErrors();});@@ -42,7 +42,7 @@ test('a subscription started from billing returns to billing, not the onboardingPlan::query()->whereKey($user->account->plan_id)->update(['stripe_monthly_price_id' => 'price_123']);$this->actingAs($user->fresh());- $billingPath = parse_url(route('app.billing.index'), PHP_URL_PATH);+ $billingPath = route('app.billing.index', absolute: false);$page = visit(route('app.billing.processing', ['from' => 'billing']));waitForPath($page, $billingPath);@@ -51,12 +51,12 @@ test('a subscription started from billing returns to billing, not the onboarding->assertNoJavaScriptErrors();});-test('on a phone the processing page skips the MCP step and opens the schedule', function () {+test('on a phone the processing page opens the schedule too', function () {config(['trypost.self_hosted' => false]);$this->actingAs(billingProcessingSubscriber());- $schedulePath = parse_url(route('app.posts.index'), PHP_URL_PATH);+ $schedulePath = route('app.posts.index', absolute: false);$page = visit(route('app.billing.processing'))->on()->mobile();waitForPath($page, $schedulePath);diff --git a/tests/Browser/McpPromptCardTest.php b/tests/Browser/McpPromptCardTest.phpnew file mode 100644index 000000000..3749aa7f2--- /dev/null+++ b/tests/Browser/McpPromptCardTest.php@@ -0,0 +1,216 @@+<?php++declare(strict_types=1);++use App\Models\User;+use App\Models\Workspace;++function mcpPromptUser(array $attributes = []): User+{+ config(['trypost.self_hosted' => false]);++ $user = User::factory()->create($attributes);+ $workspace = Workspace::factory()->create([+ 'account_id' => $user->account_id,+ 'user_id' => $user->id,+ ]);+ $workspace->members()->attach($user->id, membershipPivot('admin'));+ $user->update(['current_workspace_id' => $workspace->id]);+ subscribeAccount($user->account);++ return $user->fresh();+}++/**+ * @return list<string>+ */+function mcpPromptAvatars(mixed $page): array+{+ return $page->script("[...document.querySelectorAll('[data-testid^=\"mcp-prompt-avatar-\"]')].map((avatar) => avatar.dataset.testid.replace('mcp-prompt-avatar-', ''))");+}++test('a new user is invited to connect an AI, and closing it hides it for good in that browser', function () {+ $this->actingAs(mcpPromptUser());++ $page = visit(route('app.calendar'))->resize(1280, 900);+ waitFor($page, '@mcp-prompt');++ expect(mcpPromptAvatars($page))->toBe(['chatgpt', 'claude', 'grok', 'gemini', 'cursor', 'n8n'])+ ->and($page->script("(() => { const layers = [...document.querySelectorAll('[data-testid^=\"mcp-prompt-avatar-\"]')].map((avatar) => Number(getComputedStyle(avatar).zIndex)); return layers.every((layer, index) => index === 0 || layer < layers[index - 1]); })()"))->toBeTrue();++ $page->assertSeeIn('@mcp-prompt', __('mcp.prompt.title'))+ ->click('@mcp-prompt-close');+ waitForGone($page, '@mcp-prompt');++ $page->navigate(route('app.posts.index'));+ waitForPath($page, route('app.posts.index', absolute: false));+ waitFor($page, '@app-header');++ $page->assertMissing('@mcp-prompt')+ ->assertNoJavaScriptErrors();+});++test('closing the card keeps it in the user\'s one browser storage key, leaving the workspaces block as it was', function () {+ $user = mcpPromptUser();+ $this->actingAs($user);+ $key = "trypost:{$user->id}";++ $page = visit(route('app.calendar'))->resize(1280, 900);+ waitFor($page, '@mcp-prompt');+ $page->script(sprintf("localStorage.setItem('%s', JSON.stringify({ version: 1, user: {}, workspaces: { kept: { note: true } } }))", $key));+ $page->click('@mcp-prompt-close');+ waitForGone($page, '@mcp-prompt');++ expect($page->script("Object.keys(localStorage).filter((key) => key.startsWith('trypost:') || key.startsWith('mcp.'))"))->toBe([$key])+ ->and($page->script("JSON.parse(localStorage.getItem('{$key}'))"))->toBe([+ 'version' => 1,+ 'user' => ['mcp.promptDismissed' => true],+ 'workspaces' => ['kept' => ['note' => true]],+ ]);+ $page->assertNoJavaScriptErrors();+});++test('closing the card in another tab hides it here at once', function () {+ $user = mcpPromptUser();+ $this->actingAs($user);+ $key = "trypost:{$user->id}";++ $page = visit(route('app.calendar'))->resize(1280, 900);+ waitFor($page, '@mcp-prompt');+ $page->script(sprintf(<<<'JS'+ (() => {+ const value = JSON.stringify({ version: 1, user: { 'mcp.promptDismissed': true }, workspaces: {} });+ localStorage.setItem('%1$s', value);+ window.dispatchEvent(new StorageEvent('storage', { key: '%1$s', newValue: value }));+ })()+ JS, $key));+ waitForGone($page, '@mcp-prompt');++ $page->assertMissing('@mcp-prompt')+ ->assertNoJavaScriptErrors();+});++test('an unreadable or older browser storage value reads as empty and is replaced on the next save', function (string $stored) {+ $user = mcpPromptUser();+ $this->actingAs($user);+ $key = "trypost:{$user->id}";++ $page = visit(route('app.calendar'))->resize(1280, 900);+ waitFor($page, '@app-header');+ $page->script(sprintf("localStorage.setItem('%s', %s)", $key, json_encode($stored)));+ $page->navigate(route('app.posts.index'));+ waitForPath($page, route('app.posts.index', absolute: false));+ waitFor($page, '@mcp-prompt');++ $page->click('@mcp-prompt-close');+ waitForGone($page, '@mcp-prompt');++ expect($page->script("JSON.parse(localStorage.getItem('{$key}'))"))->toBe([+ 'version' => 1,+ 'user' => ['mcp.promptDismissed' => true],+ 'workspaces' => [],+ ]);+ $page->assertNoJavaScriptErrors();+})->with([+ 'not JSON' => ['not json'],+ 'an older version' => ['{"version":0,"user":{"mcp.promptDismissed":true},"workspaces":{}}'],+]);++test('a browser that refuses storage still shows the card and closes it, on the defaults', function () {+ $this->actingAs(mcpPromptUser());++ $page = visit(route('app.calendar'))->resize(1280, 900);+ waitFor($page, '@app-header');+ $page->script(<<<'JS'+ (() => {+ const refuse = () => { throw new DOMException('denied', 'SecurityError'); };+ Storage.prototype.getItem = refuse;+ Storage.prototype.setItem = refuse;+ })()+ JS);+ $page->click('@sidebar-logo');+ waitForPath($page, route('app.posts.index', absolute: false));+ waitFor($page, '@mcp-prompt');++ expect($page->script("(() => { try { localStorage.getItem('x'); return 'allowed'; } catch { return 'refused'; } })()"))->toBe('refused');++ $page->click('@mcp-prompt-close');+ waitForGone($page, '@mcp-prompt');++ $page->assertMissing('@mcp-prompt')+ ->assertNoJavaScriptErrors();+});++test('the Claude button opens its steps on the page, which close once the AI connects', function () {+ $user = mcpPromptUser();+ $this->actingAs($user);+ $calendarPath = route('app.calendar', absolute: false);++ $page = visit(route('app.calendar'))->resize(1280, 900);+ waitFor($page, '@mcp-prompt-connect-claude');+ $page->click('@mcp-prompt-connect-claude');+ waitFor($page, '@mcp-dialog');++ $page->assertSeeIn('@mcp-dialog', __('mcp.dialog.title', ['client' => 'Claude']))+ ->assertSeeIn('@mcp-dialog', route('mcp.trypost'))+ ->assertPathIs($calendarPath);++ mcpAccessToken($user, mcpOauthClient('Claude'), $user->currentWorkspace);+ waitForGone($page, '@mcp-dialog');++ $page->assertMissing('@mcp-dialog')+ ->assertMissing('@mcp-prompt')+ ->assertPathIs($calendarPath)+ ->assertNoJavaScriptErrors();+});++test('an AI connected from anywhere else hides the card on its own, without a click', function () {+ $user = mcpPromptUser();+ $this->actingAs($user);++ $page = visit(route('app.calendar'))->resize(1280, 900);+ waitFor($page, '@mcp-prompt');++ mcpAccessToken($user, mcpOauthClient('Cursor'), $user->currentWorkspace);+ waitForGone($page, '@mcp-prompt');++ $page->assertMissing('@mcp-prompt')+ ->assertMissing('@mcp-dialog')+ ->assertNoJavaScriptErrors();+});++test('the steps stay open while nothing connected, even when the account loses access meanwhile', function () {+ $user = mcpPromptUser();+ $this->actingAs($user);++ $page = visit(route('app.calendar'))->resize(1280, 900);+ waitFor($page, '@mcp-prompt-connect-chatgpt');+ $page->click('@mcp-prompt-connect-chatgpt');+ waitFor($page, '@mcp-dialog');++ $user->account->subscriptions()->delete();+ $page->script('new Promise((resolve) => setTimeout(resolve, 4500))');++ $page->assertVisible('@mcp-dialog')+ ->assertNoJavaScriptErrors();+});++test('the invitation waits while the user is asked where they found us', function () {+ $this->actingAs(mcpPromptUser(['referral_source' => null, 'created_at' => now()->subDays(2)]));++ $page = visit(route('app.calendar'))->resize(1280, 900);+ waitFor($page, '@referral-source-survey');++ $page->assertMissing('@mcp-prompt')+ ->assertNoJavaScriptErrors();+});++test('a phone never shows the invitation', function () {+ $this->actingAs(mcpPromptUser());++ $page = visit(route('app.calendar'))->on()->mobile();+ waitFor($page, '@app-header');++ $page->assertMissing('@mcp-prompt')+ ->assertNoJavaScriptErrors();+});diff --git a/tests/Browser/WelcomeMcpTest.php b/tests/Browser/WelcomeMcpTest.phpdeleted file mode 100644index a58402b4c..000000000--- a/tests/Browser/WelcomeMcpTest.php+++ /dev/null@@ -1,598 +0,0 @@-<?php--declare(strict_types=1);--use App\Models\Media;-use App\Models\User;-use App\Models\Workspace;-use Illuminate\Support\Facades\Storage;-use Illuminate\Support\Str;--function waitForWelcomeMcpTestId(mixed $page, string $testId): void-{- $page->script(<<<JS- (async () => {- const sel = '[data-testid="{$testId}"]';- for (let i = 0; i < 100; i++) {- const el = document.querySelector(sel);- if (el && el.getBoundingClientRect().height > 0) return;- await new Promise((resolve) => setTimeout(resolve, 50));- }- })();- JS);-}--function waitForWelcomeMcpChat(mixed $page, string $benefit): void-{- $page->script(<<<JS- (async () => {- for (let i = 0; i < 100; i++) {- const chat = document.querySelector('[data-testid="welcome-mcp-chat-{$benefit}"]');- if (chat && getComputedStyle(chat).opacity === '1' && !chat.className.includes('-active')) return;- await new Promise((resolve) => setTimeout(resolve, 50));- }- })();- JS);-}--function welcomeMcpSubscriber(): User-{- $user = User::factory()->create();- $workspace = Workspace::factory()->create([- 'account_id' => $user->account_id,- 'user_id' => $user->id,- ]);- $workspace->members()->attach($user->id, membershipPivot('admin'));- $user->update(['current_workspace_id' => $workspace->id]);- subscribeAccount($user->account);-- return $user->fresh();-}--function stubWelcomeMcpConnectTab(mixed $page): void-{- $page->script(<<<'JS'- window.__copied = [];- navigator.clipboard.writeText = async (text) => { window.__copied.push(text); };- document.addEventListener('click', (event) => {- if (event.target.closest('a[target="_blank"]')) event.preventDefault();- }, true);- true;- JS);-}--function waitForWelcomeMcpTestIdGone(mixed $page, string $testId): void-{- $page->script(<<<JS- (async () => {- for (let i = 0; i < 50; i++) {- if (!document.querySelector('[data-testid="{$testId}"]')) return;- await new Promise((resolve) => setTimeout(resolve, 50));- }- })()- JS);-}--function waitForWelcomeMcpPath(mixed $page, string $path): void-{- $page->script(<<<JS- (async () => {- for (let attempt = 0; attempt < 100; attempt++) {- if (window.location.pathname === '{$path}') return;- await new Promise((resolve) => setTimeout(resolve, 50));- }- })()- JS);-}--function waitForWelcomeMcpCopied(mixed $page, int $count): void-{- $page->script(<<<JS- (async () => {- for (let i = 0; i < 50; i++) {- if (window.__copied.length >= {$count}) return;- await new Promise((resolve) => setTimeout(resolve, 50));- }- })()- JS);-}--function waitForWelcomeMcpRequest(mixed $page, string $path, int $status): bool-{- return $page->script(<<<JS- (async () => {- for (let i = 0; i < 60; i++) {- if (performance.getEntriesByType('resource').some((entry) => new URL(entry.name).pathname === '{$path}' && entry.responseStatus === {$status})) return true;- await new Promise((resolve) => setTimeout(resolve, 50));- }- return false;- })()- JS);-}--function waitForWelcomeMcpCelebration(mixed $page): mixed-{- return $page->script(<<<'JS'- (async () => {- let confetti = false;- for (let i = 0; i < 120; i++) {- confetti ||= document.querySelector('[data-testid="confetti-canvas"]') !== null;- if (confetti && document.querySelector('[data-testid="welcome-mcp-status"]') && !document.querySelector('[data-testid="mcp-dialog"]')) {- return 'celebrated';- }- await new Promise((resolve) => setTimeout(resolve, 50));- }- return { confetti };- })()- JS);-}--function waitForWelcomeMcpBenefitChange(mixed $page, string $from): ?string-{- return $page->script(<<<JS- (async () => {- const selected = () => document.querySelector('[data-testid^="welcome-mcp-benefit-"][aria-pressed="true"]')?.dataset.testid;- for (let i = 0; i < 240; i++) {- if (selected() !== '{$from}') return selected();- await new Promise((resolve) => setTimeout(resolve, 50));- }- })()- JS);-}--function welcomeMcpPause(mixed $page, int $milliseconds): void-{- $page->script(<<<JS- (async () => {- await new Promise((resolve) => setTimeout(resolve, {$milliseconds}));- })()- JS);-}--function welcomeMcpSelectedBenefit(mixed $page): ?string-{- return $page->script('document.querySelector(\'[data-testid^="welcome-mcp-benefit-"][aria-pressed="true"]\')?.dataset.testid');-}--function welcomeMcpFocus(mixed $page, string $testId): void-{- $page->script("document.querySelector('[data-testid=\"{$testId}\"]').focus(); true;");-}--/**- * @return list<string>- */-function welcomeMcpTestIds(mixed $page, string $selector): array-{- $encodedSelector = json_encode($selector);-- return $page->script("[...document.querySelectorAll({$encodedSelector})].map((element) => element.dataset.testid)");-}--/**- * @return list<string>- */-function welcomeMcpLines(mixed $page, string $testId): array-{- return $page->script("document.querySelector('[data-testid=\"{$testId}\"]').innerText.split('\\n')");-}--function welcomeMcpStyle(mixed $page, string $testId, string $property): string-{- return $page->script("getComputedStyle(document.querySelector('[data-testid=\"{$testId}\"]')).{$property}");-}--/**- * @return array{top: float|int, bottom: float|int, left: float|int, right: float|int, width: float|int, height: float|int}- */-function welcomeMcpRect(mixed $page, string $testId): array-{- return $page->script(<<<JS- (() => {- const rect = document.querySelector('[data-testid="{$testId}"]').getBoundingClientRect();- return { top: rect.top, bottom: rect.bottom, left: rect.left, right: rect.right, width: rect.width, height: rect.height };- })()- JS);-}--/**- * @return list<float|int>- */-function welcomeMcpTops(mixed $page, string $selector): array-{- $encodedSelector = json_encode($selector);-- return $page->script("[...document.querySelectorAll({$encodedSelector})].map((element) => element.getBoundingClientRect().top)");-}--/**- * @return array{width: int, height: int, viewportWidth: int, viewportHeight: int}- */-function welcomeMcpScrollSize(mixed $page): array-{- return $page->script('({ width: document.documentElement.scrollWidth, height: document.documentElement.scrollHeight, viewportWidth: window.innerWidth, viewportHeight: window.innerHeight })');-}--function welcomeMcpScrollToBottom(mixed $page): void-{- $page->script('window.scrollTo(0, document.documentElement.scrollHeight); true;');-}--function welcomeMcpActiveTestId(mixed $page): ?string-{- return $page->script('document.activeElement.dataset.testid');-}--function welcomeMcpActiveStyle(mixed $page, string $property): string-{- return $page->script("getComputedStyle(document.activeElement).{$property}");-}--/**- * @return list<string>- */-function welcomeMcpCopied(mixed $page): array-{- return $page->script('window.__copied');-}--function welcomeMcpChatAvatar(mixed $page, string $benefit): string-{- return $page->script(<<<JS- (async () => {- const chat = document.querySelector('[data-testid="welcome-mcp-chat-{$benefit}"]');- for (let i = 0; i < 50; i++) {- const image = chat.querySelector('img[src*="avatars/"]');- if (image && image.complete) return 'photo';- await new Promise((resolve) => setTimeout(resolve, 50));- }- return chat.innerText.includes('AL') ? 'initials' : 'none';- })()- JS);-}--test('the MCP step opens a dialog with the steps and the app link, and can be skipped', function () {- config(['trypost.self_hosted' => false]);-- $this->actingAs(welcomeMcpSubscriber());-- $page = visit(route('app.welcome.mcp'))->resize(1440, 900);- waitForWelcomeMcpTestId($page, 'welcome-mcp-connect-claude');-- $scrollSize = welcomeMcpScrollSize($page);-- expect($scrollSize['height'])->toBeLessThanOrEqual($scrollSize['viewportHeight']);-- expect(welcomeMcpTestIds($page, '[data-testid^=welcome-mcp-benefit-]:not([data-testid*=-icon-])'))->toBe(['welcome-mcp-benefit-ideas', 'welcome-mcp-benefit-schedule', 'welcome-mcp-benefit-queue', 'welcome-mcp-benefit-analytics']);-- $page->assertSee('Run your social media from a chat')- ->assertMissing('@welcome-mcp-composer')- ->assertVisible('@welcome-mcp-benefit-schedule')- ->assertVisible('@welcome-mcp-benefit-ideas')- ->click('@welcome-mcp-benefit-schedule');- waitForWelcomeMcpChat($page, 'schedule');-- $page->assertSeeIn('@welcome-mcp-chat-schedule', 'Take the next idea on my board')- ->assertSeeIn('@welcome-mcp-chat-schedule', 'schedule it for Tuesday at 10:00 AM');-- expect(welcomeMcpLines($page, 'welcome-mcp-chat-schedule'))->toContain('Scheduled')- ->and(welcomeMcpTestIds($page, '[data-testid=welcome-mcp-chat-schedule] [data-testid^=welcome-mcp-schedule-post-]'))->toBe(['welcome-mcp-schedule-post-instagram', 'welcome-mcp-schedule-post-linkedin']);-- $page->click('@welcome-mcp-benefit-analytics');- waitForWelcomeMcpChat($page, 'analytics');-- expect(welcomeMcpStyle($page, 'welcome-mcp-benefit-icon-analytics', 'backgroundColor'))->not->toBe(welcomeMcpStyle($page, 'welcome-mcp-benefit-icon-queue', 'backgroundColor'));-- $page->assertSeeIn('@welcome-mcp-chat-analytics', 'How was my month')- ->assertSeeIn('@welcome-mcp-chat-analytics', 'Total Followers')- ->click('@welcome-mcp-benefit-queue');- waitForWelcomeMcpChat($page, 'queue');-- expect(welcomeMcpLines($page, 'welcome-mcp-chat-queue'))->toContain('Tomorrow');-- $page->assertSeeIn('@welcome-mcp-chat-queue', 'New')- ->click('@welcome-mcp-benefit-ideas');- waitForWelcomeMcpChat($page, 'ideas');-- expect(array_count_values(welcomeMcpLines($page, 'welcome-mcp-chat-ideas'))['New idea'] ?? 0)->toBe(2);-- $page->assertSeeIn('@welcome-mcp-chat-ideas', 'To Do')- ->assertSeeIn('@welcome-mcp-chat-ideas', 'In Progress')- ->assertAttributeMissing('@welcome-mcp-connect-claude', 'href');-- expect(collect(welcomeMcpTops($page, '[data-testid^=welcome-mcp-connect-]:not([data-testid=welcome-mcp-connect-ai])'))->map(fn (float|int $top): float => round($top))->unique()->count())->toBe(1);-- expect($page->script(<<<'JS'- [...document.querySelectorAll('[data-testid^="welcome-mcp-connect-"]:not([data-testid="welcome-mcp-connect-ai"]) svg')].every((mark) => getComputedStyle(mark).fill === getComputedStyle(mark).color)- JS))->toBeTrue();-- $page->assertSeeIn('@welcome-mcp-connect-claude', 'Connect with Claude')- ->assertMissing('@welcome-mcp-copy')- ->assertMissing('@mcp-dialog')- ->assertMissing('@welcome-mcp-continue');-- stubWelcomeMcpConnectTab($page);- $page->click('@welcome-mcp-connect-claude');- waitForWelcomeMcpTestId($page, 'mcp-dialog-step-paste');-- $connectClickPath = parse_url(route('app.welcome.mcp.connect-click'), PHP_URL_PATH);-- expect(waitForWelcomeMcpRequest($page, $connectClickPath, 204))->toBeTrue()- ->and(welcomeMcpCopied($page))->toBe([])- ->and(welcomeMcpActiveTestId($page))->toBe('mcp-dialog')- ->and(welcomeMcpActiveStyle($page, 'outlineStyle'))->toBe('none');-- $page->assertSeeIn('@mcp-dialog-name-copy', 'Copy')- ->assertSeeIn('@mcp-dialog-url-copy', 'Copy')- ->click('@mcp-dialog-name-copy');- waitForWelcomeMcpCopied($page, 1);-- $page->assertSeeIn('@mcp-dialog-name-copy', 'Copied')- ->assertDontSeeIn('@mcp-dialog-url-copy', 'Copied');-- $page->click('@mcp-dialog-url-copy');- waitForWelcomeMcpCopied($page, 2);-- $page->assertSeeIn('@mcp-dialog', 'Connect TryPost to Claude')- ->assertSeeIn('@mcp-dialog-url', route('mcp.trypost'))- ->assertSeeIn('@mcp-dialog-step-paste', "Paste the URL into the connector's URL field")- ->assertVisible('@mcp-dialog-step-add')- ->assertVisible('@mcp-dialog-step-login')- ->assertSeeIn('@mcp-dialog-waiting', 'Waiting for your AI to connect')- ->assertCount('[data-sonner-toast]', 0)- ->assertAttribute('@mcp-dialog-open', 'target', '_blank');-- expect(welcomeMcpCopied($page))->toBe(['TryPost', route('mcp.trypost')])- ->and($page->attribute('@mcp-dialog-open', 'href'))->toStartWith('https://claude.ai/');-- $page->assertSeeIn('@mcp-dialog-open', 'Open Claude')- ->click('@mcp-dialog-open')- ->assertPresent('@mcp-dialog');-- $page->keys('@mcp-dialog', 'Escape');- waitForWelcomeMcpTestIdGone($page, 'mcp-dialog');-- $page->click('@welcome-mcp-connect-chatgpt');- waitForWelcomeMcpTestId($page, 'mcp-dialog-step-open');-- $page->assertSeeIn('@mcp-dialog', 'Connect TryPost to ChatGPT')- ->assertSeeIn('@mcp-dialog-step-open', 'Open TryPost in ChatGPT')- ->assertVisible('@mcp-dialog-step-login')- ->assertMissing('@mcp-dialog-step-paste')- ->assertMissing('@mcp-dialog-name')- ->assertMissing('@mcp-dialog-url')- ->assertAttribute('@mcp-dialog-open', 'href', 'https://chatgpt.com/plugins/plugin_asdk_app_6ad0fbec07f4819191139b8a00f5f129');-- $page->keys('@mcp-dialog', 'Escape');- waitForWelcomeMcpTestIdGone($page, 'mcp-dialog');-- $page->assertSeeIn('@welcome-mcp-connect-other', 'Connect another app')- ->click('@welcome-mcp-connect-other');- waitForWelcomeMcpTestId($page, 'mcp-dialog-config');-- $page->assertSeeIn('@mcp-dialog', 'Connect TryPost to another app')- ->assertVisible('@mcp-dialog-step-add')- ->assertSeeIn('@mcp-dialog-config', route('mcp.trypost'))- ->assertMissing('@mcp-dialog-open')- ->keys('@mcp-dialog', 'Escape');- waitForWelcomeMcpTestIdGone($page, 'mcp-dialog');-- $page->click('@welcome-mcp-skip');-- $schedulePath = parse_url(route('app.posts.index'), PHP_URL_PATH);- waitForWelcomeMcpPath($page, $schedulePath);-- $page->assertPathIs($schedulePath)- ->assertNoJavaScriptErrors();-});--test('on a phone the MCP step keeps the example and connects through an AI picker sheet', function () {- config(['trypost.self_hosted' => false]);-- $this->actingAs(welcomeMcpSubscriber());-- $page = visit(route('app.welcome.mcp'))->resize(390, 844);- waitForWelcomeMcpTestId($page, 'welcome-mcp-pill-schedule');-- $page->assertVisible('@welcome-mcp-pill-schedule')- ->assertMissing('@welcome-mcp-benefit-schedule')- ->click('@welcome-mcp-pill-ideas');- waitForWelcomeMcpChat($page, 'ideas');-- $page->assertVisible('@welcome-mcp-chat-ideas')- ->assertAttribute('@welcome-mcp-pill-ideas', 'aria-pressed', 'true');-- $scrollSize = welcomeMcpScrollSize($page);-- expect($scrollSize['width'])->toBeLessThanOrEqual($scrollSize['viewportWidth']);-- welcomeMcpScrollToBottom($page);- welcomeMcpPause($page, 300);-- $skip = welcomeMcpRect($page, 'welcome-mcp-skip-link');- $connect = welcomeMcpRect($page, 'welcome-mcp-connect-ai');- $actions = welcomeMcpRect($page, 'welcome-actions');-- expect([- 'compact' => $actions['height'] < 120,- 'windowAboveFooter' => welcomeMcpRect($page, 'welcome-mcp-window')['bottom'] <= $actions['top'],- 'connectBeforeSkip' => round($skip['top']) === round($connect['top']) && $connect['left'] < $skip['left'],- ])->toBe(['compact' => true, 'windowAboveFooter' => true, 'connectBeforeSkip' => true]);-- $page->assertMissing('@welcome-mcp-composer')- ->assertSeeIn('@welcome-mcp-connect-ai', 'Connect your AI')- ->assertVisible('@welcome-mcp-skip-link')- ->assertMissing('@welcome-mcp-connect-claude')- ->assertMissing('@welcome-mcp-connect-other')- ->assertMissing('@welcome-mcp-skip');-- stubWelcomeMcpConnectTab($page);- $page->click('@welcome-mcp-connect-ai');- waitForWelcomeMcpTestId($page, 'welcome-mcp-pick-other');-- $page->assertSeeIn('@welcome-mcp-ai-picker', 'Where do you want to use TryPost?')- ->assertVisible('@welcome-mcp-pick-claude')- ->assertVisible('@welcome-mcp-pick-chatgpt')- ->click('@welcome-mcp-pick-other');- waitForWelcomeMcpTestId($page, 'mcp-dialog-config');-- $page->assertSeeIn('@mcp-dialog', 'Connect TryPost to another app')- ->assertMissing('@welcome-mcp-ai-picker')- ->keys('@mcp-dialog', 'Escape');- waitForWelcomeMcpTestIdGone($page, 'mcp-dialog');-- $page->click('@welcome-mcp-connect-ai');- waitForWelcomeMcpTestId($page, 'welcome-mcp-pick-claude');-- $page->click('@welcome-mcp-pick-claude');- waitForWelcomeMcpTestId($page, 'mcp-dialog-step-paste');- welcomeMcpPause($page, 600);-- $dialog = welcomeMcpRect($page, 'mcp-dialog');-- expect(['bottom' => (int) round($dialog['bottom']), 'width' => (int) round($dialog['width'])])->toBe(['bottom' => 844, 'width' => 390]);-- $page->assertVisible('@mcp-dialog-open')- ->assertNoJavaScriptErrors();-});--test('the schedule and queue examples show the owner photo, or their initials without one', function (bool $withPhoto) {- config(['trypost.self_hosted' => false]);-- $owner = welcomeMcpSubscriber();- $owner->update(['name' => 'Ada Lovelace']);-- if ($withPhoto) {- $path = 'avatars/'.Str::uuid().'.png';- Storage::put($path, base64_decode('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=='));- Media::factory()->avatar()->create([- 'mediable_type' => $owner->getMorphClass(),- 'mediable_id' => $owner->id,- 'path' => $path,- 'mime_type' => 'image/png',- ]);- }-- $this->actingAs($owner->fresh());-- $page = visit(route('app.welcome.mcp'))->resize(1440, 900);- waitForWelcomeMcpTestId($page, 'welcome-mcp-connect-claude');-- foreach (['schedule', 'queue'] as $benefit) {- $page->click("@welcome-mcp-benefit-{$benefit}");- waitForWelcomeMcpChat($page, $benefit);-- expect(welcomeMcpChatAvatar($page, $benefit))->toBe($withPhoto ? 'photo' : 'initials');- }-- expect(welcomeMcpLines($page, 'welcome-mcp-chat-queue'))->toContain('Tomorrow');-- $page->assertNoJavaScriptErrors();-})->with([- 'with a photo' => [true],- 'without a photo' => [false],-]);--test('hovering a month of the follower example shows each network that month', function () {- config(['trypost.self_hosted' => false]);-- $this->actingAs(welcomeMcpSubscriber());-- $page = visit(route('app.welcome.mcp'))->resize(1440, 900);- waitForWelcomeMcpTestId($page, 'welcome-mcp-connect-claude');-- $page->click('@welcome-mcp-benefit-analytics');- waitForWelcomeMcpChat($page, 'analytics');-- $page->assertMissing('@welcome-mcp-followers-tooltip')- ->hover('[data-testid="welcome-mcp-chat-analytics"] [data-testid="welcome-mcp-followers-month-5"]');- waitForWelcomeMcpTestId($page, 'welcome-mcp-followers-tooltip');-- $page->assertSeeIn('@welcome-mcp-followers-tooltip', now()->format('M Y'))- ->assertSeeIn('@welcome-mcp-followers-tooltip', '5,840')- ->assertSeeIn('@welcome-mcp-followers-tooltip', '5,220')- ->assertSeeIn('@welcome-mcp-followers-tooltip', '1,340')- ->assertNoJavaScriptErrors();-});--test('once the AI connects the dialog closes, confetti flies and the page offers to continue', function () {- config(['trypost.self_hosted' => false]);-- $owner = welcomeMcpSubscriber();- $this->actingAs($owner);-- $page = visit(route('app.welcome.mcp'))->resize(1440, 900);- waitForWelcomeMcpTestId($page, 'welcome-mcp-connect-claude');-- $page->click('@welcome-mcp-connect-claude');- waitForWelcomeMcpTestId($page, 'mcp-dialog-waiting');-- mcpAccessToken($owner, mcpOauthClient('Claude'), $owner->currentWorkspace);-- expect(waitForWelcomeMcpCelebration($page))->toBe('celebrated');-- expect(trim($page->text('@welcome-mcp-announcement')))->toBe('Claude is connected');-- $page->assertSeeIn('@welcome-mcp-status', 'Claude is connected')- ->assertVisible('@welcome-mcp-continue')- ->assertMissing('@welcome-mcp-connect-claude')- ->assertMissing('@welcome-mcp-skip');-- expect(welcomeMcpRect($page, 'welcome-mcp-continue')['top'])->toBeLessThan(welcomeMcpRect($page, 'welcome-mcp-status')['top']);-- $page->assertNoJavaScriptErrors();-});--test('the MCP examples rotate on their own until the user picks a tab', function () {- config(['trypost.self_hosted' => false]);-- $this->actingAs(welcomeMcpSubscriber());-- $page = visit(route('app.welcome.mcp'))->resize(1440, 900);- waitForWelcomeMcpTestId($page, 'welcome-mcp-benefit-ideas');-- expect(waitForWelcomeMcpBenefitChange($page, 'welcome-mcp-benefit-ideas'))->toBe('welcome-mcp-benefit-schedule');-- $page->click('@welcome-mcp-benefit-queue')- ->hover('@welcome-title');- welcomeMcpPause($page, 4000);-- expect(welcomeMcpSelectedBenefit($page))->toBe('welcome-mcp-benefit-queue');-- $page->assertNoJavaScriptErrors();-});--test('an owner who already connected an AI sees the connected state without confetti', function () {- config(['trypost.self_hosted' => false]);-- $owner = welcomeMcpSubscriber();- mcpAccessToken($owner, mcpOauthClient('Claude'), $owner->currentWorkspace);- $this->actingAs($owner);-- $page = visit(route('app.welcome.mcp'))->resize(1440, 900);- waitForWelcomeMcpTestId($page, 'welcome-mcp-status');- welcomeMcpPause($page, 1500);-- $page->assertNotPresent('@confetti-canvas')- ->assertSeeIn('@welcome-mcp-status', 'Claude is connected')- ->assertVisible('@welcome-mcp-continue')- ->assertMissing('@mcp-dialog')- ->assertMissing('@welcome-mcp-connect-claude')- ->assertNoJavaScriptErrors();-});--test('keyboard focus on the examples pauses the rotation', function () {- config(['trypost.self_hosted' => false]);-- $this->actingAs(welcomeMcpSubscriber());-- $page = visit(route('app.welcome.mcp'))->resize(1440, 900);- waitForWelcomeMcpTestId($page, 'welcome-mcp-benefit-ideas');-- welcomeMcpFocus($page, 'welcome-mcp-benefit-ideas');- welcomeMcpPause($page, 4000);-- expect(welcomeMcpSelectedBenefit($page))->toBe('welcome-mcp-benefit-ideas');-- $page->assertNoJavaScriptErrors();-});diff --git a/tests/Feature/McpPromptTest.php b/tests/Feature/McpPromptTest.phpnew file mode 100644index 000000000..3866cd7b7--- /dev/null+++ b/tests/Feature/McpPromptTest.php@@ -0,0 +1,161 @@+<?php++declare(strict_types=1);++use App\Enums\PostHog\McpEvent;+use App\Jobs\PostHog\CaptureAccountEvent;+use App\Models\User;+use App\Models\Workspace;+use Illuminate\Support\Facades\Queue;++beforeEach(function () {+ config(['trypost.self_hosted' => false]);++ $this->user = User::factory()->create();+ $this->workspace = Workspace::factory()->create([+ 'account_id' => $this->user->account_id,+ 'user_id' => $this->user->id,+ ]);+ $this->workspace->members()->attach($this->user->id, membershipPivot('admin'));+ $this->user->update(['current_workspace_id' => $this->workspace->id]);+ subscribeAccount($this->user->account);+});++test('a user inside the app without an AI connected is invited to connect one, right after signing up', function () {+ $this->actingAs($this->user->fresh())+ ->get(route('app.calendar'))+ ->assertOk()+ ->assertInertia(fn ($page) => $page->where('mcpPrompt.mcp_url', route('mcp.trypost')));+});++test('the invitation is not shared once an AI is connected or before the workspace can use the app', function (Closure $setup) {+ $setup($this->user, $this->workspace);++ $this->actingAs($this->user->fresh())+ ->followingRedirects()+ ->get(route('app.calendar'))+ ->assertInertia(fn ($page) => $page->where('mcpPrompt', null));+})->with([+ 'connected' => [fn (User $user, Workspace $workspace) => mcpAccessToken($user, mcpOauthClient('Claude'), $workspace)],+ 'no app access' => [fn (User $user) => $user->account->subscriptions()->delete()],+]);++test('a revoked connection invites the user again', function () {+ $token = mcpAccessToken($this->user, mcpOauthClient('Claude'), $this->workspace);+ $token->forceFill(['revoked' => true])->save();++ $this->actingAs($this->user->fresh())+ ->get(route('app.calendar'))+ ->assertInertia(fn ($page) => $page->where('mcpPrompt.mcp_url', route('mcp.trypost')));+});++test('an AI connected to another workspace still invites the user in this one', function () {+ $other = Workspace::factory()->create([+ 'account_id' => $this->user->account_id,+ 'user_id' => $this->user->id,+ ]);+ $other->members()->attach($this->user->id, membershipPivot('admin'));+ mcpAccessToken($this->user, mcpOauthClient('Claude'), $other);++ $this->actingAs($this->user->fresh())+ ->get(route('app.calendar'))+ ->assertInertia(fn ($page) => $page->where('mcpPrompt.mcp_url', route('mcp.trypost')));+});++test('whether to invite is cached for five minutes', function () {+ $this->actingAs($this->user->fresh())+ ->get(route('app.calendar'))+ ->assertInertia(fn ($page) => $page->where('mcpPrompt.mcp_url', route('mcp.trypost')));++ mcpAccessToken($this->user, mcpOauthClient('Claude'), $this->workspace);+ $this->travel(4)->minutes();++ $this->actingAs($this->user->fresh())+ ->get(route('app.calendar'))+ ->assertInertia(fn ($page) => $page->where('mcpPrompt.mcp_url', route('mcp.trypost')));++ $this->travel(2)->minutes();++ $this->actingAs($this->user->fresh())+ ->get(route('app.calendar'))+ ->assertInertia(fn ($page) => $page->where('mcpPrompt', null));+});++test('the connection status says whether the AI connected to this workspace, and a connection stops the invitation at once', function () {+ $this->actingAs($this->user->fresh())+ ->get(route('app.calendar'))+ ->assertInertia(fn ($page) => $page->where('mcpPrompt.mcp_url', route('mcp.trypost')));++ $this->actingAs($this->user->fresh())+ ->getJson(route('app.mcp.prompt.show'))+ ->assertOk()+ ->assertExactJson(['connected' => false]);++ mcpAccessToken($this->user, mcpOauthClient('Claude'), $this->workspace);++ $this->actingAs($this->user->fresh())+ ->getJson(route('app.mcp.prompt.show'))+ ->assertOk()+ ->assertExactJson(['connected' => true]);++ $this->actingAs($this->user->fresh())+ ->get(route('app.calendar'))+ ->assertInertia(fn ($page) => $page->where('mcpPrompt', null));+});++test('a member of the account is invited too, and self-hosted needs no subscription', function (Closure $actor) {+ $user = $actor($this->workspace);++ $this->actingAs($user->fresh())+ ->get(route('app.calendar'))+ ->assertInertia(fn ($page) => $page->where('mcpPrompt.mcp_url', route('mcp.trypost')));+})->with([+ 'member of a subscribed workspace' => [function (Workspace $workspace): User {+ $member = User::factory()->create(['account_id' => $workspace->account_id]);+ $workspace->members()->attach($member->id, membershipPivot('member'));+ $member->update(['current_workspace_id' => $workspace->id]);++ return $member;+ }],+ 'self-hosted without a subscription' => [function (Workspace $workspace): User {+ config(['trypost.self_hosted' => true]);+ $workspace->account->subscriptions()->delete();++ return $workspace->owner;+ }],+]);++test('each answer to the invitation is tracked for the workspace account, with the app picked', function (array $payload, McpEvent $event, array $properties) {+ enablePostHog();+ Queue::fake([CaptureAccountEvent::class]);++ $this->actingAs($this->user)+ ->post(route('app.mcp.prompt.store'), $payload)+ ->assertNoContent();++ Queue::assertPushedOn('posthog', CaptureAccountEvent::class, fn (CaptureAccountEvent $job): bool => $job->event === $event+ && $job->distinctId === (string) $this->user->id+ && $job->accountId === (string) $this->workspace->account_id+ && $job->properties === ['workspace_id' => $this->workspace->id, ...$properties]);+})->with([+ 'Claude' => [['answer' => 'connect', 'client' => 'claude'], McpEvent::PromptClicked, ['client' => 'claude']],+ 'ChatGPT' => [['answer' => 'connect', 'client' => 'chatgpt'], McpEvent::PromptClicked, ['client' => 'chatgpt']],+ 'another app' => [['answer' => 'connect', 'client' => 'other'], McpEvent::PromptClicked, ['client' => 'other']],+ 'not now' => [['answer' => 'dismiss', 'client' => 'claude'], McpEvent::PromptDismissed, []],+]);++test('an unknown answer, or connecting without a known app, is refused and tracks nothing', function (array $payload, string $field) {+ enablePostHog();+ Queue::fake([CaptureAccountEvent::class]);++ $this->actingAs($this->user)+ ->postJson(route('app.mcp.prompt.store'), $payload)+ ->assertUnprocessable()+ ->assertJsonValidationErrors($field);++ Queue::assertNotPushed(CaptureAccountEvent::class);+})->with([+ 'unknown answer' => [['answer' => 'later'], 'answer'],+ 'connect without an app' => [['answer' => 'connect'], 'client'],+ 'connect with an unknown app' => [['answer' => 'connect', 'client' => 'gemini'], 'client'],+]);diff --git a/tests/Feature/Welcome/WelcomeControllerTest.php b/tests/Feature/Welcome/WelcomeControllerTest.phpindex 566904562..f56ffda37 100644--- a/tests/Feature/Welcome/WelcomeControllerTest.php+++ b/tests/Feature/Welcome/WelcomeControllerTest.php@@ -258,131 +258,6 @@ test('plan store sends the owner to Stripe checkout on the Socials monthly price->assertRedirect('https://checkout.stripe.test/session');});-test('picking an AI app on the MCP step records which one', function (string $client) {- config(['services.posthog.enabled' => true, 'services.posthog.api_key' => 'phc_test']);- Bus::fake();- attachCurrentWorkspace($this->user);- subscribeAccount($this->user->account);-- $this->actingAs($this->user->fresh())- ->postJson(route('app.welcome.mcp.connect-click'), ['client' => $client])- ->assertNoContent();-- Bus::assertDispatched(SendEvent::class, fn (SendEvent $event): bool => $event->method === 'capture'- && data_get($event->payload, 'event') === WelcomeEvent::McpConnectClicked->value- && data_get($event->payload, 'properties.client') === $client- && data_get($event->payload, 'properties.account_id') === $this->user->account_id);-})->with(['claude', 'chatgpt', 'other']);--test('picking an AI app requires a known app', function (array $payload) {- Bus::fake();-- $this->actingAs($this->user)- ->postJson(route('app.welcome.mcp.connect-click'), $payload)- ->assertUnprocessable()- ->assertJsonValidationErrors('client');-- Bus::assertNotDispatched(SendEvent::class);-})->with([- 'missing' => [[]],- 'unknown' => [['client' => 'gemini']],-]);--test('skipping the MCP step records it and goes to the schedule', function () {- config(['services.posthog.enabled' => true, 'services.posthog.api_key' => 'phc_test']);- Bus::fake();- attachCurrentWorkspace($this->user);- subscribeAccount($this->user->account);-- $this->actingAs($this->user->fresh())- ->get(route('app.welcome.mcp.skip'))- ->assertRedirect(route('app.posts.index'));-- Bus::assertDispatched(SendEvent::class, fn (SendEvent $event): bool => $event->method === 'capture'- && data_get($event->payload, 'event') === WelcomeEvent::McpSkipped->value);-});--test('skipping the MCP step without app access goes back to Welcome and records nothing', function () {- config(['services.posthog.enabled' => true, 'services.posthog.api_key' => 'phc_test']);- Bus::fake();-- $this->actingAs($this->user)- ->get(route('app.welcome.mcp.skip'))- ->assertRedirect(route('app.welcome.plan'));-- Bus::assertNotDispatched(SendEvent::class);-});--test('the MCP step gives the TryPost MCP URL and the owner connections', function () {- attachCurrentWorkspace($this->user);- subscribeAccount($this->user->account);-- $this->actingAs($this->user->fresh())- ->get(route('app.welcome.mcp'))- ->assertOk()- ->assertInertia(fn ($page) => $page- ->component('welcome/Mcp', false)- ->where('mcpUrl', route('mcp.trypost'))- ->where('connectedClients', [])- ->missing('prompt')- );-});--test('the MCP step lists the MCP apps the owner already connected', function () {- $workspace = attachCurrentWorkspace($this->user);- subscribeAccount($this->user->account);- $clientId = mcpOauthClient('Claude');- mcpAccessToken($this->user, $clientId, $workspace);-- $this->actingAs($this->user->fresh())- ->get(route('app.welcome.mcp'))- ->assertOk()- ->assertInertia(fn ($page) => $page- ->has('connectedClients', 1)- ->where('connectedClients.0.client_id', $clientId)- ->where('connectedClients.0.name', 'Claude')- );-});--test('the MCP step sends a user without a current workspace to create one', function () {- subscribeAccount($this->user->account);-- $this->actingAs($this->user->fresh())- ->get(route('app.welcome.mcp'))- ->assertRedirect(route('app.workspaces.create'));-});--test('the MCP step works for a member and on self-hosted', function (Closure $actor) {- $this->actingAs($actor($this->user))- ->get(route('app.welcome.mcp'))- ->assertOk()- ->assertInertia(fn ($page) => $page->component('welcome/Mcp', false));-})->with([- 'member' => [function (User $owner): User {- $workspace = attachCurrentWorkspace($owner);- subscribeAccount($owner->account);- $member = User::factory()->create(['account_id' => $owner->account_id]);- $workspace->members()->attach($member->id, membershipPivot('member'));- $member->update(['current_workspace_id' => $workspace->id]);-- return $member->fresh();- }],- 'self-hosted' => [function (User $owner): User {- config(['trypost.self_hosted' => true]);- attachCurrentWorkspace($owner);-- return $owner->fresh();- }],-]);--test('the MCP step sends an account without app access back to Welcome', function () {- attachCurrentWorkspace($this->user);-- $this->actingAs($this->user->fresh())- ->get(route('app.welcome.mcp'))- ->assertRedirect(route('app.welcome.plan'));-});-test('plan store fails loudly when the Socials price is not configured', function () {completeWelcomeThroughSoftware($this->user);Plan::where('slug', Slug::Socials)->update(['stripe_monthly_price_id' => null]);@@ -543,6 +418,9 @@ test('old onboarding routes are not registered', function (string $routeName) {'welcome connect' => 'app.welcome.connect','welcome connect store' => 'app.welcome.connect.store','welcome referral source' => 'app.welcome.referral-source',+ 'welcome mcp' => 'app.welcome.mcp',+ 'welcome mcp connect click' => 'app.welcome.mcp.connect-click',+ 'welcome mcp skip' => 'app.welcome.mcp.skip','checkout' => 'app.onboarding.checkout',]);diff --git a/tests/fixtures/single-line-copy.php b/tests/fixtures/single-line-copy.phpindex eea719fc4..f801a3bd0 100644--- a/tests/fixtures/single-line-copy.php+++ b/tests/fixtures/single-line-copy.php@@ -205,19 +205,7 @@ return ['mcp.connect_other' => 10,'mcp.tabs.connected' => 23,'mcp.tabs.connect' => 21,- 'welcome.mcp.benefits.analytics.hint' => 34,- 'welcome.mcp.benefits.analytics.title' => 31,- 'welcome.mcp.benefits.ideas.hint' => 37,- 'welcome.mcp.benefits.ideas.title' => 23,- 'welcome.mcp.benefits.queue.hint' => 30,- 'welcome.mcp.benefits.queue.title' => 25,- 'welcome.mcp.benefits.schedule.hint' => 40,- 'welcome.mcp.benefits.schedule.title' => 35,- 'welcome.mcp.pick_ai' => 41,- 'welcome.mcp.skip' => 21,- 'welcome.mcp.connect_ai' => 20,- 'welcome.mcp.connect_other' => 28,- 'welcome.mcp.connect_with' => 16,+ 'mcp.prompt.not_now' => 11,'mcp.connect' => 13,'mcp.copy' => 10,'mcp.copied' => 11,