Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
fix(onboarding): unify native and Pipedream connectors (#8042)
Jacob Beckerman27a2617d65b5
diff --git a/.github/workspace-dep-closures.json b/.github/workspace-dep-closures.jsonindex 6e5ec4093f..9291248a6b 100644--- a/.github/workspace-dep-closures.json+++ b/.github/workspace-dep-closures.json@@ -383,6 +383,7 @@"crates/macro_uuid","crates/maybe_send","crates/mcp_client",+ "crates/mcp_select","crates/mcp_toolset","crates/mention_utils","crates/messages",diff --git a/Cargo.lock b/Cargo.lockindex 07414e62ec..e45197cedd 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -370,6 +370,7 @@ dependencies = ["macro_user_id","macro_uuid","mcp_client",+ "mcp_select","messages","mockall","model",@@ -12083,9 +12084,12 @@ version = "0.1.0"dependencies = ["ai_toolset","anyhow",+ "axum",+ "futures","macro_user_id","mcp_client","pipedream_mcp",+ "rmcp","serde_json","tokio","tracing",diff --git a/apps/web/src/features/onboarding/browser-test/README.md b/apps/web/src/features/onboarding/browser-test/README.mdindex 5690e58c75..917f26749e 100644--- a/apps/web/src/features/onboarding/browser-test/README.md+++ b/apps/web/src/features/onboarding/browser-test/README.md@@ -6,7 +6,8 @@ mocked, and nothing touches the network: the only difference from production isthe context the provider receives.The fake world is persisted in sessionStorage, so the full-page round-trips are-real page loads. Google sign-up and the inbox OAuth reload into the flow, and+real page loads. Google sign-up, inbox OAuth, and native GitHub account linking+reload into the flow, andcheckout returns on Stripe's success or cancel leg. Leaving onboarding rendersa `landed` marker showing where the app would have navigated.@@ -30,3 +31,11 @@ bunx vite --config src/features/onboarding/browser-test/vite.config.tsTests seed the world through `openFixture` in `fixture-page.ts`. They read theworld and the recorded analytics through `window.onboardingFixture`.++Connector logos under `public/connector-icons` are snapshots from Pipedream's+public app directory. `../tests/connector-icons.json` records each original page+and image URL.+The fixture uses these real logos locally, so browser tests need no image network+access. Production uses verified featured metadata and each live directory+response's `icon_url`. The fake flow is not proof of a working third-party OAuth+grant or tool call; Slack release verification requires both against a real account.diff --git a/apps/web/src/features/onboarding/browser-test/fixture-page.ts b/apps/web/src/features/onboarding/browser-test/fixture-page.tsindex a3c55f5bfe..bc0bf49a95 100644--- a/apps/web/src/features/onboarding/browser-test/fixture-page.ts+++ b/apps/web/src/features/onboarding/browser-test/fixture-page.ts@@ -23,6 +23,9 @@ export async function openFixture([FIXTURE_KEYS, world, checkoutOutcome] as const);await page.goto(path);+ // Vite may reload once while optimizing a cold dependency graph. Wait for+ // the fixture before tests seed the step or inspect its fake backend.+ await page.waitForFunction(() => Boolean(window.onboardingFixture));}export const fakeWorld = (page: Page) =>diff --git a/apps/web/src/features/onboarding/browser-test/onboarding.browser.e2e.ts b/apps/web/src/features/onboarding/browser-test/onboarding.browser.e2e.tsindex c9bdf65663..02b24e60a3 100644--- a/apps/web/src/features/onboarding/browser-test/onboarding.browser.e2e.ts+++ b/apps/web/src/features/onboarding/browser-test/onboarding.browser.e2e.ts@@ -1,4 +1,5 @@import { expect, test } from '@playwright/test';+import { fixtureConnectorIcon } from '../tests/connector-icons';import {accentSwatch,expectLanded,@@ -420,3 +421,263 @@ test('system theme changes keep the current onboarding step and selected accent''rgb(0, 0, 0)');});++test('tools keep Drive and Sheets, hide excluded Google apps and preserve native connections', async ({+ page,+}, testInfo) => {+ await openFixture(page, '/?view=flow&theme=cream', {+ catalog: [+ ['gmail', 'Gmail'],+ ['google_sheets', 'Google Sheets'],+ ['google_drive', 'Google Drive'],+ ['google_calendar', 'Google Calendar'],+ ['linear', 'Linear'],+ ['notion', 'Notion'],+ ['mysql', 'MySQL'],+ ['supabase', 'Supabase'],+ ['quickbooks', 'QuickBooks'],+ ['stripe', 'Stripe'],+ ['posthog', 'PostHog'],+ ['github', 'GitHub'],+ ['figma', 'Figma'],+ ['intercom', 'Intercom'],+ ['hubspot', 'HubSpot'],+ ['airtable_oauth', 'Airtable'],+ ['xero_accounting_api', 'Xero'],+ ['shopify', 'Shopify'],+ ['mailchimp', 'Mailchimp'],+ ['zendesk', 'Zendesk'],+ ['calendly_v2', 'Calendly'],+ ['asana', 'Asana'],+ ['trello', 'Trello'],+ ['slack', 'Slack'],+ ['slack_v2', 'Slack'],+ ['linear', 'Linear'],+ ].map(([slug, name]) => ({+ slug,+ name,+ iconUrl: fixtureConnectorIcon(slug),+ })),+ nativeTools: [+ {+ url: 'https://mcp.linear.app/mcp/',+ server_name: 'My issues',+ authenticated: true,+ enabled: true,+ },+ ],+ });+ await page.evaluate(() =>+ sessionStorage.setItem(+ 'onboarding-flow-step',+ JSON.stringify({ user: 'macro|[email protected]', step: 'tools' })+ )+ );+ await page.reload();+ await expect(heading(page, 'Connect your tools.')).toBeVisible();+ for (const name of ['Gmail', 'Google Calendar']) {+ await expect(+ page.getByRole('button', { name: `Connect ${name}`, exact: true })+ ).toHaveCount(0);+ }+ await expect(+ page.getByRole('button', { name: 'Connected to Linear' })+ ).toBeDisabled();+ await expect(+ page.getByRole('button', { name: 'Connect Notion' })+ ).toBeEnabled();+ const cards = page+ .getByRole('region', { name: 'Available integrations' })+ .getByRole('button');+ await expect(cards).toHaveCount(22);+ expect(+ await cards.evaluateAll((buttons) =>+ buttons.map((button) => button.getAttribute('aria-label'))+ )+ ).toEqual([+ 'Connected to Linear',+ 'Connect Notion',+ 'Connect Slack',+ 'Connect PostHog',+ 'Connect Stripe',+ 'Connect GitHub',+ 'Connect Figma',+ 'Connect Intercom',+ 'Connect HubSpot',+ 'Connect Airtable',+ 'Connect QuickBooks',+ 'Connect Xero',+ 'Connect Shopify',+ 'Connect Mailchimp',+ 'Connect Zendesk',+ 'Connect Calendly',+ 'Connect Asana',+ 'Connect Trello',+ 'Connect Google Sheets',+ 'Connect Google Drive',+ 'Connect MySQL',+ 'Connect Supabase',+ ]);+ // Exercise directory logos, including apps without a bundled native icon.+ await expect(cards.locator('img')).toHaveCount(21);+ await expect(+ page+ .getByRole('button', { name: 'Connect Notion', exact: true })+ .locator('img')+ ).toHaveCSS('filter', /invert\(0\)/);+ const stripeIcon = page+ .getByRole('button', { name: 'Connect Stripe', exact: true })+ .locator('img');+ await expect+ .poll(() =>+ stripeIcon.evaluate((image: HTMLImageElement) => image.naturalWidth)+ )+ .toBeGreaterThan(0);+ await page.evaluate(async () => {+ await document.fonts.ready;+ await Promise.all(+ Array.from(document.images)+ .filter(+ (image) => image.getBoundingClientRect().top < window.innerHeight+ )+ .map((image) => image.decode())+ );+ });+ await page.screenshot({+ animations: 'disabled',+ path: testInfo.outputPath('onboarding-connectors-fixed.png'),+ });+ await page.getByRole('searchbox').fill('MySQL');+ await expect(+ page.getByRole('button', { name: 'Connect MySQL', exact: true })+ ).toBeVisible();+ await expect(+ page.getByRole('button', { name: 'Connect Slack', exact: true })+ ).toHaveCount(0);+ await page.getByRole('searchbox').fill('Google');+ await expect(+ page.getByRole('button', { name: /Connect Google/ })+ ).toHaveCount(2);+ await expect(+ page.getByRole('button', { name: 'Connect Google Drive', exact: true })+ ).toBeVisible();+ await expect(+ page.getByRole('button', { name: 'Connect Google Sheets', exact: true })+ ).toBeVisible();+ await page.screenshot({+ animations: 'disabled',+ path: testInfo.outputPath('onboarding-google-search.png'),+ });+ await page.getByRole('searchbox').fill('Notion');+ await page.getByRole('button', { name: 'Connect Notion' }).click();+ await expect(+ page.getByRole('button', { name: 'Connected to Notion' })+ ).toBeDisabled();+ await page.reload();+ await expect(+ page.getByRole('button', { name: 'Connected to Linear' })+ ).toBeDisabled();+ await expect(+ page.getByRole('button', { name: 'Connected to Notion' })+ ).toBeDisabled();+});++for (const githubLinkStatus of [+ 'unlinked',+ 'reauthentication_required',+] as const) {+ test(`GitHub uses native account linking from ${githubLinkStatus} and returns to tools`, async ({+ page,+ }) => {+ await openFixture(page, '/?view=flow', {+ githubLinkStatus,+ connectedTools: ['github'],+ nativeTools: [+ {+ url: 'https://api.githubcopilot.com/mcp',+ authenticated: true,+ enabled: true,+ server_name: 'GitHub MCP',+ },+ ],+ });+ await page.evaluate(() =>+ sessionStorage.setItem(+ 'onboarding-flow-step',+ JSON.stringify({ user: 'macro|[email protected]', step: 'tools' })+ )+ );+ await page.reload();+ await expect(heading(page, 'Connect your tools.')).toBeVisible();+ await page+ .getByRole('button', { name: 'Connect GitHub', exact: true })+ .click();+ await expect(+ page.getByRole('button', {+ name: 'Account linked to GitHub',+ exact: true,+ })+ ).toBeDisabled();+ await expect(heading(page, 'Connect your tools.')).toBeVisible();+ expect((await fakeWorld(page)).githubLinkStatus).toBe('linked');+ await page.reload();+ await expect(+ page.getByRole('button', {+ name: 'Account linked to GitHub',+ exact: true,+ })+ ).toBeDisabled();+ });+}++test('connection status failure leaves native GitHub available', async ({+ page,+}) => {+ await openFixture(page, '/?view=flow', { connectionFailures: ['pipedream'] });+ await page.evaluate(() =>+ sessionStorage.setItem(+ 'onboarding-flow-step',+ JSON.stringify({ user: 'macro|[email protected]', step: 'tools' })+ )+ );+ await page.reload();+ await expect(+ page.getByRole('button', { name: 'Connect GitHub', exact: true })+ ).toBeEnabled();+ await expect(+ page.getByRole('button', { name: 'Connect Notion', exact: true })+ ).toBeDisabled();+ await expect(+ page.getByRole('button', { name: 'Retry connection status' })+ ).toBeVisible();+});++test('enables an existing native tool without reconnecting', async ({+ page,+}) => {+ await openFixture(page, '/?view=flow', {+ nativeTools: [+ {+ url: 'https://mcp.linear.app/mcp',+ server_name: 'Linear',+ authenticated: true,+ enabled: false,+ },+ ],+ });+ await page.evaluate(() =>+ sessionStorage.setItem(+ 'onboarding-flow-step',+ JSON.stringify({ user: 'macro|[email protected]', step: 'tools' })+ )+ );+ await page.reload();+ await page+ .getByRole('button', { name: 'Enable Linear', exact: true })+ .click();+ await expect(+ page.getByRole('button', { name: 'Connected to Linear', exact: true })+ ).toBeDisabled();+ expect((await fakeWorld(page)).connectedTools).toEqual([]);+ expect((await fakeWorld(page)).nativeTools[0].enabled).toBe(true);+});diff --git a/apps/web/src/features/onboarding/browser-test/public/connector-icons/airtable_oauth.png b/apps/web/src/features/onboarding/browser-test/public/connector-icons/airtable_oauth.pngnew file mode 100644index 0000000000..ab38d85aacBinary files /dev/null and b/apps/web/src/features/onboarding/browser-test/public/connector-icons/airtable_oauth.png differdiff --git a/apps/web/src/features/onboarding/browser-test/public/connector-icons/asana.png b/apps/web/src/features/onboarding/browser-test/public/connector-icons/asana.pngnew file mode 100644index 0000000000..01c8f1eb95Binary files /dev/null and b/apps/web/src/features/onboarding/browser-test/public/connector-icons/asana.png differdiff --git a/apps/web/src/features/onboarding/browser-test/public/connector-icons/calendly_v2.png b/apps/web/src/features/onboarding/browser-test/public/connector-icons/calendly_v2.pngnew file mode 100644index 0000000000..565e25f619Binary files /dev/null and b/apps/web/src/features/onboarding/browser-test/public/connector-icons/calendly_v2.png differdiff --git a/apps/web/src/features/onboarding/browser-test/public/connector-icons/figma.png b/apps/web/src/features/onboarding/browser-test/public/connector-icons/figma.pngnew file mode 100644index 0000000000..2ca43f4ecfBinary files /dev/null and b/apps/web/src/features/onboarding/browser-test/public/connector-icons/figma.png differdiff --git a/apps/web/src/features/onboarding/browser-test/public/connector-icons/github.png b/apps/web/src/features/onboarding/browser-test/public/connector-icons/github.pngnew file mode 100644index 0000000000..24c4b629bdBinary files /dev/null and b/apps/web/src/features/onboarding/browser-test/public/connector-icons/github.png differdiff --git a/apps/web/src/features/onboarding/browser-test/public/connector-icons/google_drive.png b/apps/web/src/features/onboarding/browser-test/public/connector-icons/google_drive.pngnew file mode 100644index 0000000000..02e281c7abBinary files /dev/null and b/apps/web/src/features/onboarding/browser-test/public/connector-icons/google_drive.png differdiff --git a/apps/web/src/features/onboarding/browser-test/public/connector-icons/google_sheets.png b/apps/web/src/features/onboarding/browser-test/public/connector-icons/google_sheets.pngnew file mode 100644index 0000000000..f0f8ed8d71Binary files /dev/null and b/apps/web/src/features/onboarding/browser-test/public/connector-icons/google_sheets.png differdiff --git a/apps/web/src/features/onboarding/browser-test/public/connector-icons/hubspot.svg b/apps/web/src/features/onboarding/browser-test/public/connector-icons/hubspot.svgnew file mode 100644index 0000000000..b79fe597c8--- /dev/null+++ b/apps/web/src/features/onboarding/browser-test/public/connector-icons/hubspot.svg@@ -0,0 +1 @@+<svg height="2500" viewBox="6.20856283 .64498824 244.26943717 251.24701176" width="2500" xmlns="http://www.w3.org/2000/svg"><path d="m191.385 85.694v-29.506a22.722 22.722 0 0 0 13.101-20.48v-.677c0-12.549-10.173-22.722-22.721-22.722h-.678c-12.549 0-22.722 10.173-22.722 22.722v.677a22.722 22.722 0 0 0 13.101 20.48v29.506a64.342 64.342 0 0 0 -30.594 13.47l-80.922-63.03c.577-2.083.878-4.225.912-6.375a25.6 25.6 0 1 0 -25.633 25.55 25.323 25.323 0 0 0 12.607-3.43l79.685 62.007c-14.65 22.131-14.258 50.974.987 72.7l-24.236 24.243c-1.96-.626-4-.959-6.057-.987-11.607.01-21.01 9.423-21.007 21.03.003 11.606 9.412 21.014 21.018 21.017 11.607.003 21.02-9.4 21.03-21.007a20.747 20.747 0 0 0 -.988-6.056l23.976-23.985c21.423 16.492 50.846 17.913 73.759 3.562 22.912-14.352 34.475-41.446 28.985-67.918-5.49-26.473-26.873-46.734-53.603-50.792m-9.938 97.044a33.17 33.17 0 1 1 0-66.316c17.85.625 32 15.272 32.01 33.134.008 17.86-14.127 32.522-31.977 33.165" fill="#ff7a59"/></svg>\ No newline at end of filediff --git a/apps/web/src/features/onboarding/browser-test/public/connector-icons/intercom.svg b/apps/web/src/features/onboarding/browser-test/public/connector-icons/intercom.svgnew file mode 100644index 0000000000..ebdeacc057--- /dev/null+++ b/apps/web/src/features/onboarding/browser-test/public/connector-icons/intercom.svg@@ -0,0 +1 @@+<svg width="2500" height="2500" viewBox="0 0 256 256" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid"><path d="M221.867 140.748a8.534 8.534 0 0 1-17.067 0V64a8.534 8.534 0 0 1 17.067 0v76.748zm-2.978 53.413c-1.319 1.129-32.93 27.655-90.889 27.655-57.958 0-89.568-26.527-90.887-27.656a8.535 8.535 0 0 1-.925-12.033 8.53 8.53 0 0 1 12.013-.942c.501.42 28.729 23.563 79.8 23.563 51.712 0 79.503-23.31 79.778-23.545 3.571-3.067 8.968-2.655 12.033.925a8.534 8.534 0 0 1-.923 12.033zM34.133 64A8.534 8.534 0 0 1 51.2 64v76.748a8.534 8.534 0 0 1-17.067 0V64zm42.668-17.067a8.534 8.534 0 0 1 17.066 0v114.001a8.534 8.534 0 0 1-17.066 0v-114zm42.666-4.318A8.532 8.532 0 0 1 128 34.082a8.532 8.532 0 0 1 8.534 8.533v123.733a8.534 8.534 0 0 1-17.067 0V42.615zm42.667 4.318a8.534 8.534 0 0 1 17.066 0v114.001a8.534 8.534 0 0 1-17.066 0v-114zM224 0H32C14.327 0 0 14.327 0 32v192c0 17.672 14.327 32 32 32h192c17.673 0 32-14.328 32-32V32c0-17.673-14.327-32-32-32z" fill="#1F8DED"/></svg>\ No newline at end of filediff --git a/apps/web/src/features/onboarding/browser-test/public/connector-icons/linear.svg b/apps/web/src/features/onboarding/browser-test/public/connector-icons/linear.svgnew file mode 100644index 0000000000..53d625598d--- /dev/null+++ b/apps/web/src/features/onboarding/browser-test/public/connector-icons/linear.svg@@ -0,0 +1 @@+<svg xmlns="http://www.w3.org/2000/svg" width="256" height="256" fill="none" viewBox="0 0 512 512"><path fill="url(#a)" d="M0 0h512v512H0z"/><g filter="url(#b)" opacity=".8"><path fill="#fff" d="M346.112 342.268c1.674 1.674 4.369 1.77 6.112.168 58.502-53.763 61.2-148.753 4.505-205.448-56.694-56.695-151.684-53.996-205.447 4.505-1.602 1.743-1.506 4.439.168 6.113l194.662 194.662Z" shape-rendering="crispEdges" style="mix-blend-mode:multiply"/></g><g filter="url(#c)" opacity=".3"><path fill="url(#d)" d="M346.112 342.268c1.674 1.674 4.369 1.77 6.112.168 58.502-53.763 61.2-148.753 4.505-205.448-56.694-56.695-151.684-53.996-205.447 4.505-1.602 1.743-1.506 4.439.168 6.113l194.662 194.662Z"/></g><g filter="url(#e)" opacity=".3"><path fill="url(#f)" d="M261.607 324.792c2.441-1.434 2.844-4.786.912-6.855L126.121 171.95c-2.018-2.16-5.535-1.831-7.017.727a148.996 148.996 0 0 0-6.49 12.537c-.774 1.688-.389 3.673.926 4.984l137.088 136.598a4.513 4.513 0 0 0 4.985.944c2.702-1.176 4.021-1.79 5.994-2.948Z"/></g><path fill="url(#g)" d="M357.358 374.306c1.758 1.758 4.581 1.866 6.416.189a163.595 163.595 0 0 0 5.316-5.081c62.547-62.547 62.547-163.956 0-226.504-62.548-62.547-163.957-62.547-226.504 0a163.595 163.595 0 0 0-5.081 5.316c-1.677 1.835-1.569 4.658.189 6.416l219.664 219.664Z"/><path fill="url(#h)" d="M357.358 374.306c1.758 1.758 4.581 1.866 6.416.189a163.595 163.595 0 0 0 5.316-5.081c62.547-62.547 62.547-163.956 0-226.504-62.548-62.547-163.957-62.547-226.504 0a163.595 163.595 0 0 0-5.081 5.316c-1.677 1.835-1.569 4.658.189 6.416l219.664 219.664Z"/><path fill="url(#i)" d="M336.333 394.672c2.627-1.528 3.024-5.118.875-7.267L124.595 174.792c-2.149-2.149-5.739-1.752-7.267.875a158.87 158.87 0 0 0-7.119 13.725c-.811 1.771-.41 3.852.968 5.229l206.201 206.202c1.378 1.378 3.459 1.779 5.23.968a158.87 158.87 0 0 0 13.725-7.119Z"/><path fill="url(#j)" d="M336.333 394.672c2.627-1.528 3.024-5.118.875-7.267L124.595 174.792c-2.149-2.149-5.739-1.752-7.267.875a158.87 158.87 0 0 0-7.119 13.725c-.811 1.771-.41 3.852.968 5.229l206.201 206.202c1.378 1.378 3.459 1.779 5.23.968a158.87 158.87 0 0 0 13.725-7.119Z"/><path fill="url(#k)" d="M286.659 413.348c3.619-.707 4.86-5.136 2.253-7.743L106.395 223.088c-2.607-2.607-7.036-1.366-7.743 2.253a160.813 160.813 0 0 0-2.502 18.462 4.666 4.666 0 0 0 1.366 3.654l167.027 167.027a4.667 4.667 0 0 0 3.654 1.366 160.834 160.834 0 0 0 18.462-2.502Z"/><path fill="url(#l)" d="M286.659 413.348c3.619-.707 4.86-5.136 2.253-7.743L106.395 223.088c-2.607-2.607-7.036-1.366-7.743 2.253a160.813 160.813 0 0 0-2.502 18.462 4.666 4.666 0 0 0 1.366 3.654l167.027 167.027a4.667 4.667 0 0 0 3.654 1.366 160.834 160.834 0 0 0 18.462-2.502Z"/><path fill="url(#m)" d="M217.031 411.577c4.45 1.107 7.201-4.155 3.959-7.398L107.821 291.01c-3.243-3.242-8.504-.491-7.398 3.959 6.784 27.279 20.838 53.121 42.163 74.445 21.324 21.324 47.166 35.379 74.445 42.163Z"/><path fill="url(#n)" d="M217.031 411.577c4.45 1.107 7.201-4.155 3.959-7.398L107.821 291.01c-3.243-3.242-8.504-.491-7.398 3.959 6.784 27.279 20.838 53.121 42.163 74.445 21.324 21.324 47.166 35.379 74.445 42.163Z"/><path stroke="#fff" stroke-opacity=".5" stroke-width="5" d="M362.088 372.649c-.816.746-2.119.733-2.963-.111L139.462 152.875c-.844-.844-.857-2.147-.111-2.963a160.661 160.661 0 0 1 5.003-5.234c61.571-61.57 161.397-61.57 222.968 0 61.571 61.571 61.571 161.397 0 222.968a160.661 160.661 0 0 1-5.234 5.003Zm-26.648 16.523c1.038 1.038.786 2.67-.364 3.34a156.562 156.562 0 0 1-13.51 7.006c-.794.364-1.761.197-2.42-.462L112.944 192.854c-.659-.659-.826-1.626-.462-2.42a156.562 156.562 0 0 1 7.006-13.51c.67-1.15 2.302-1.402 3.34-.364L335.44 389.172Zm-48.296 18.201c1.276 1.276.574 3.221-.964 3.521a158.269 158.269 0 0 1-18.175 2.463 2.167 2.167 0 0 1-1.694-.64L99.283 245.689a2.167 2.167 0 0 1-.64-1.694 158.313 158.313 0 0 1 2.463-18.175c.3-1.538 2.245-2.24 3.521-.964l182.517 182.517Zm-67.922-1.426c.81.81.812 1.735.464 2.391-.333.63-1.007 1.072-2.052.813-26.85-6.678-52.286-20.51-73.28-41.505-20.995-20.994-34.827-46.43-41.505-73.28-.259-1.045.183-1.719.813-2.052.656-.348 1.581-.346 2.391.464l113.169 113.169Z" style="mix-blend-mode:soft-light"/><defs><linearGradient id="a" x1="256" x2="256" y1="0" y2="512" gradientUnits="userSpaceOnUse"><stop stop-color="#2D2E31"/><stop offset="1" stop-color="#0F1012"/></linearGradient><linearGradient id="d" x1="256.306" x2="256.306" y1="95.332" y2="379.492" gradientUnits="userSpaceOnUse"><stop stop-color="#fff"/><stop offset="1" stop-color="#C5C5C5"/></linearGradient><linearGradient id="f" x1="178.365" x2="178.365" y1="167.248" y2="351.126" gradientUnits="userSpaceOnUse"><stop stop-color="#fff"/><stop offset="1" stop-color="#C5C5C5"/></linearGradient><linearGradient id="g" x1="256" x2="256" y1="96" y2="416" gradientUnits="userSpaceOnUse"><stop stop-color="#fff"/><stop offset="1" stop-color="#CCC"/></linearGradient><linearGradient id="i" x1="256" x2="256" y1="96" y2="416" gradientUnits="userSpaceOnUse"><stop stop-color="#fff"/><stop offset="1" stop-color="#CCC"/></linearGradient><linearGradient id="k" x1="256" x2="256" y1="96" y2="416" gradientUnits="userSpaceOnUse"><stop stop-color="#fff"/><stop offset="1" stop-color="#CCC"/></linearGradient><linearGradient id="m" x1="256" x2="256" y1="96" y2="416" gradientUnits="userSpaceOnUse"><stop stop-color="#fff"/><stop offset="1" stop-color="#CCC"/></linearGradient><radialGradient id="h" cx="0" cy="0" r="1" gradientTransform="matrix(0 320 -320 0 256 96)" gradientUnits="userSpaceOnUse"><stop stop-color="#fff"/><stop offset=".598" stop-color="#fff" stop-opacity="0"/></radialGradient><radialGradient id="j" cx="0" cy="0" r="1" gradientTransform="matrix(0 320 -320 0 256 96)" gradientUnits="userSpaceOnUse"><stop stop-color="#fff"/><stop offset=".598" stop-color="#fff" stop-opacity="0"/></radialGradient><radialGradient id="l" cx="0" cy="0" r="1" gradientTransform="matrix(0 320 -320 0 256 96)" gradientUnits="userSpaceOnUse"><stop stop-color="#fff"/><stop offset=".598" stop-color="#fff" stop-opacity="0"/></radialGradient><radialGradient id="n" cx="0" cy="0" r="1" gradientTransform="matrix(0 320 -320 0 256 96)" gradientUnits="userSpaceOnUse"><stop stop-color="#fff"/><stop offset=".598" stop-color="#fff" stop-opacity="0"/></radialGradient><filter id="b" width="295.583" height="295.582" x="126.135" y="66.88" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" result="hardAlpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/><feOffset dy="-5.12"/><feGaussianBlur stdDeviation="12"/><feComposite in2="hardAlpha" operator="out"/><feColorMatrix values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.4 0"/><feBlend in2="BackgroundImageFix" mode="plus-lighter" result="effect1_dropShadow_14134_4654"/><feBlend in="SourceGraphic" in2="effect1_dropShadow_14134_4654" result="shape"/></filter><filter id="c" width="267.583" height="267.582" x="140.135" y="86" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_14134_4654" stdDeviation="5"/></filter><filter id="e" width="171.522" height="177.592" x="102.218" y="160.522" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_14134_4654" stdDeviation="5"/></filter></defs></svg>diff --git a/apps/web/src/features/onboarding/browser-test/public/connector-icons/mailchimp.png b/apps/web/src/features/onboarding/browser-test/public/connector-icons/mailchimp.pngnew file mode 100644index 0000000000..45ba37b9e5Binary files /dev/null and b/apps/web/src/features/onboarding/browser-test/public/connector-icons/mailchimp.png differdiff --git a/apps/web/src/features/onboarding/browser-test/public/connector-icons/mysql.png b/apps/web/src/features/onboarding/browser-test/public/connector-icons/mysql.pngnew file mode 100644index 0000000000..7ee8a3a145Binary files /dev/null and b/apps/web/src/features/onboarding/browser-test/public/connector-icons/mysql.png differdiff --git a/apps/web/src/features/onboarding/browser-test/public/connector-icons/notion.svg b/apps/web/src/features/onboarding/browser-test/public/connector-icons/notion.svgnew file mode 100644index 0000000000..6910bff95f--- /dev/null+++ b/apps/web/src/features/onboarding/browser-test/public/connector-icons/notion.svg@@ -0,0 +1 @@+<svg height="2500" viewBox="13.38 3.2 485.44 505.7" width="2349" xmlns="http://www.w3.org/2000/svg"><path d="m186.84 13.95c-79.06 5.85-146.27 11.23-149.43 11.86-8.86 1.58-16.92 7.59-20.71 15.5l-3.32 6.96.32 165.88.47 165.88 5.06 10.28c2.85 5.69 22.14 32.26 43.17 59.61 41.59 53.92 44.59 56.93 60.4 58.51 4.59.47 39.06-1.11 76.38-3.32 37.48-2.37 97.56-6.01 133.62-8.06 154.01-9.35 146.1-8.56 154.95-16.15 11.07-9.17 10.28 5.85 10.75-195.76.32-170.94.16-182.16-2.37-187.38-3-5.85-8.38-9.96-78.59-59.3-46.96-32.89-50.28-34.63-71.32-34.95-8.69-.31-80.48 4.43-159.38 10.44zm177.73 21.66c6.64 3 55.19 36.84 62.3 43.33 1.9 1.9 2.53 3.48 1.58 4.43-2.21 1.9-302.66 19.77-311.35 18.5-3.95-.63-9.8-3-13.12-5.22-13.76-9.33-47.91-37.32-47.91-39.37 0-5.38-1.11-5.38 132.83-15.02 25.62-1.74 67.68-4.9 93.3-6.96 55.49-4.43 72.1-4.27 82.37.31zm95.51 86.5c2.21 2.21 4.11 6.48 4.74 10.59.47 3.8.79 74.64.47 157.18-.47 141.68-.63 150.54-3.32 154.65-1.58 2.53-4.74 5.22-7.12 6.01-6.63 2.69-321.46 20.56-327.94 18.66-3-.79-7.12-3.32-9.33-5.53l-3.8-4.11-.47-152.75c-.32-107.21 0-154.65 1.27-158.92.95-3.16 3.32-6.96 5.38-8.22 2.85-1.9 21.51-3.48 85.71-7.27 45.07-2.53 114.8-6.8 154.81-9.17 95.17-5.86 94.86-5.86 99.6-1.12z"/><path d="m375.48 174.45c-17.08 1.11-32.26 2.69-34 3.64-5.22 2.69-8.38 7.12-9.01 12.18-.47 5.22 1.11 5.85 18.18 7.91l7.43.95v67.52c0 40.16-.63 66.73-1.42 65.94-.79-.95-23.24-35.1-49.97-75.9-26.72-40.95-48.86-74.64-49.18-74.95-.32-.32-17.71.63-38.58 2.06-25.62 1.74-39.69 3.32-42.54 4.9-4.59 2.37-9.65 10.75-9.65 16.29 0 3.32 6.01 5.06 18.66 5.06h6.64v194.18l-10.75 3.32c-8.38 2.53-11.23 4.11-12.65 7.27-2.53 5.38-2.37 10.28.16 10.28.95 0 18.82-1.11 39.37-2.37 40.64-2.37 45.22-3.48 49.49-11.86 1.27-2.53 2.37-5.22 2.37-6.01 0-.63-5.53-2.53-12.18-4.11-6.8-1.58-13.6-3.16-15.02-3.48-2.69-.79-2.85-5.69-2.85-73.69v-72.9l48.07 75.43c50.44 79.06 56.77 88.08 64.52 92.03 9.65 5.06 34.16 1.58 46.49-6.48l3.8-2.37.32-107.84.47-108 8.38-1.58c9.96-1.9 14.55-6.48 14.55-14.39 0-5.06-.32-5.38-5.06-5.22-2.83.13-19.12 1.08-36.04 2.19z"/></svg>\ No newline at end of filediff --git a/apps/web/src/features/onboarding/browser-test/public/connector-icons/posthog.png b/apps/web/src/features/onboarding/browser-test/public/connector-icons/posthog.pngnew file mode 100644index 0000000000..da15227c33Binary files /dev/null and b/apps/web/src/features/onboarding/browser-test/public/connector-icons/posthog.png differdiff --git a/apps/web/src/features/onboarding/browser-test/public/connector-icons/quickbooks.png b/apps/web/src/features/onboarding/browser-test/public/connector-icons/quickbooks.pngnew file mode 100644index 0000000000..5a73b13df2Binary files /dev/null and b/apps/web/src/features/onboarding/browser-test/public/connector-icons/quickbooks.png differdiff --git a/apps/web/src/features/onboarding/browser-test/public/connector-icons/shopify.svg b/apps/web/src/features/onboarding/browser-test/public/connector-icons/shopify.svgnew file mode 100644index 0000000000..de6ba753cd--- /dev/null+++ b/apps/web/src/features/onboarding/browser-test/public/connector-icons/shopify.svg@@ -0,0 +1,26 @@+<?xml version="1.0" encoding="utf-8"?>+<!-- Generator: Adobe Illustrator 23.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"+ viewBox="0 0 109.5 124.5" style="enable-background:new 0 0 109.5 124.5;" xml:space="preserve">+<style type="text/css">+ .st0{fill:#95BF47;}+ .st1{fill:#5E8E3E;}+ .st2{fill:#FFFFFF;}+</style>+<g>+ <path class="st0" d="M95.9,23.9c-0.1-0.6-0.6-1-1.1-1c-0.5,0-9.3-0.2-9.3-0.2s-7.4-7.2-8.1-7.9c-0.7-0.7-2.2-0.5-2.7-0.3+ c0,0-1.4,0.4-3.7,1.1c-0.4-1.3-1-2.8-1.8-4.4c-2.6-5-6.5-7.7-11.1-7.7c0,0,0,0,0,0c-0.3,0-0.6,0-1,0.1c-0.1-0.2-0.3-0.3-0.4-0.5+ c-2-2.2-4.6-3.2-7.7-3.1c-6,0.2-12,4.5-16.8,12.2c-3.4,5.4-6,12.2-6.8,17.5c-6.9,2.1-11.7,3.6-11.8,3.7c-3.5,1.1-3.6,1.2-4,4.5+ c-0.3,2.5-9.5,73-9.5,73l76.4,13.2l33.1-8.2C109.5,115.8,96,24.5,95.9,23.9z M67.2,16.8c-1.8,0.5-3.8,1.2-5.9,1.8+ c0-3-0.4-7.3-1.8-10.9C64,8.6,66.2,13.7,67.2,16.8z M57.2,19.9c-4,1.2-8.4,2.6-12.8,3.9c1.2-4.7,3.6-9.4,6.4-12.5+ c1.1-1.1,2.6-2.4,4.3-3.2C56.9,11.6,57.3,16.5,57.2,19.9z M49.1,4c1.4,0,2.6,0.3,3.6,0.9C51.1,5.8,49.5,7,48,8.6+ c-3.8,4.1-6.7,10.5-7.9,16.6c-3.6,1.1-7.2,2.2-10.5,3.2C31.7,18.8,39.8,4.3,49.1,4z"/>+ <g>+ <path class="st1" d="M94.8,22.9c-0.5,0-9.3-0.2-9.3-0.2s-7.4-7.2-8.1-7.9c-0.3-0.3-0.6-0.4-1-0.5l0,109.7l33.1-8.2+ c0,0-13.5-91.3-13.6-92C95.8,23.3,95.3,22.9,94.8,22.9z"/>+ <path class="st2" d="M58,39.9l-3.8,14.4c0,0-4.3-2-9.4-1.6c-7.5,0.5-7.5,5.2-7.5,6.4c0.4,6.4,17.3,7.8,18.3,22.9+ c0.7,11.9-6.3,20-16.4,20.6c-12.2,0.8-18.9-6.4-18.9-6.4l2.6-11c0,0,6.7,5.1,12.1,4.7c3.5-0.2,4.8-3.1,4.7-5.1+ c-0.5-8.4-14.3-7.9-15.2-21.7c-0.7-11.6,6.9-23.4,23.7-24.4C54.7,38.2,58,39.9,58,39.9z"/>+ </g>+</g>+</svg>diff --git a/apps/web/src/features/onboarding/browser-test/public/connector-icons/slack.png b/apps/web/src/features/onboarding/browser-test/public/connector-icons/slack.pngnew file mode 100644index 0000000000..627897f956Binary files /dev/null and b/apps/web/src/features/onboarding/browser-test/public/connector-icons/slack.png differdiff --git a/apps/web/src/features/onboarding/browser-test/public/connector-icons/stripe.png b/apps/web/src/features/onboarding/browser-test/public/connector-icons/stripe.pngnew file mode 100644index 0000000000..fb2cd85dcbBinary files /dev/null and b/apps/web/src/features/onboarding/browser-test/public/connector-icons/stripe.png differdiff --git a/apps/web/src/features/onboarding/browser-test/public/connector-icons/supabase.svg b/apps/web/src/features/onboarding/browser-test/public/connector-icons/supabase.svgnew file mode 100644index 0000000000..cb6632ff5d--- /dev/null+++ b/apps/web/src/features/onboarding/browser-test/public/connector-icons/supabase.svg@@ -0,0 +1,13 @@+<svg width="375" height="375" viewBox="0 0 375 375" fill="none" xmlns="http://www.w3.org/2000/svg">+<path d="M218.909 28.4831C218.909 21.5889 213.322 16 206.431 16C203.004 16 199.9 17.382 197.645 19.6192L195.912 21.548L99.675 151.658H195.18L218.429 32.0055L218.853 29.6682C218.89 29.2781 218.909 28.8828 218.909 28.4831Z" fill="#3ECF8E"/>+<path d="M65 205.336C65 216.366 73.9385 225.308 84.9647 225.308L85.053 225.308H180.87L195.18 151.658H99.675L70.736 190.783L68.8725 193.512C66.4382 196.822 65 200.911 65 205.336Z" fill="#3ECF8E"/>+<path d="M310 171.631C310 160.6 301.061 151.658 290.035 151.658H289.245H195.18L180.87 225.308H275.202L305.604 184.205L306.817 182.455C308.831 179.337 310 175.62 310 171.631Z" fill="#3ECF8E"/>+<path d="M157.533 346.517C157.533 353.411 163.119 359 170.011 359C173.706 359 177.027 357.393 179.311 354.839L179.803 354.285L275.202 225.308H180.87L157.985 343.089L157.924 343.405C157.668 344.4 157.533 345.443 157.533 346.517Z" fill="#3ECF8E"/>+<path d="M157.533 346.517C157.533 353.411 163.119 359 170.011 359C173.706 359 177.027 357.393 179.311 354.839L179.803 354.285L275.202 225.308H180.87L157.985 343.089L157.924 343.405C157.668 344.4 157.533 345.443 157.533 346.517Z" fill="url(#paint0_linear)"/>+<defs>+<linearGradient id="paint0_linear" x1="236" y1="237" x2="167" y2="359" gradientUnits="userSpaceOnUse">+<stop stop-color="#23915F"/>+<stop offset="1" stop-color="#3ECF8E" stop-opacity="0"/>+</linearGradient>+</defs>+</svg>diff --git a/apps/web/src/features/onboarding/browser-test/public/connector-icons/trello.png b/apps/web/src/features/onboarding/browser-test/public/connector-icons/trello.pngnew file mode 100644index 0000000000..c6cbd47043Binary files /dev/null and b/apps/web/src/features/onboarding/browser-test/public/connector-icons/trello.png differdiff --git a/apps/web/src/features/onboarding/browser-test/public/connector-icons/xero_accounting_api.png b/apps/web/src/features/onboarding/browser-test/public/connector-icons/xero_accounting_api.pngnew file mode 100644index 0000000000..95e5fe6970Binary files /dev/null and b/apps/web/src/features/onboarding/browser-test/public/connector-icons/xero_accounting_api.png differdiff --git a/apps/web/src/features/onboarding/browser-test/public/connector-icons/zendesk.png b/apps/web/src/features/onboarding/browser-test/public/connector-icons/zendesk.pngnew file mode 100644index 0000000000..315ea06dbfBinary files /dev/null and b/apps/web/src/features/onboarding/browser-test/public/connector-icons/zendesk.png differdiff --git a/apps/web/src/features/onboarding/browser-test/screenshots/connector-grid.png b/apps/web/src/features/onboarding/browser-test/screenshots/connector-grid.pngnew file mode 100644index 0000000000..7bc7592c30Binary files /dev/null and b/apps/web/src/features/onboarding/browser-test/screenshots/connector-grid.png differdiff --git a/apps/web/src/features/onboarding/browser-test/screenshots/google-search.png b/apps/web/src/features/onboarding/browser-test/screenshots/google-search.pngnew file mode 100644index 0000000000..949463c6a9Binary files /dev/null and b/apps/web/src/features/onboarding/browser-test/screenshots/google-search.png differdiff --git a/apps/web/src/features/onboarding/components/tool-tile.tsx b/apps/web/src/features/onboarding/components/tool-tile.tsxindex 57604a6c9a..e9f5ed0c4f 100644--- a/apps/web/src/features/onboarding/components/tool-tile.tsx+++ b/apps/web/src/features/onboarding/components/tool-tile.tsx@@ -3,29 +3,43 @@ import CheckIcon from '@phosphor/check.svg';import PlusIcon from '@phosphor/plus.svg';import SpinnerIcon from '@phosphor/spinner-gap.svg';import { Show } from 'solid-js';-import type { Tool } from '../context/onboarding-context';+import type { Tool, ToolConnectionState } from '../context/onboarding-context';export function ToolTile(props: {tool: Tool;- connected: boolean;+ state: ToolConnectionState;busy: boolean;disabled: boolean;onConnect: () => void;}) {+ const connected = () =>+ props.state === 'connected' || props.state === 'account-linked';+ const label = () =>+ props.state === 'account-linked'+ ? 'Account linked'+ : props.state === 'connected'+ ? 'Connected'+ : props.state === 'disabled'+ ? 'Enable'+ : props.state === 'loading'+ ? 'Checking connection…'+ : props.state === 'error'+ ? 'Status unavailable'+ : 'Integration';return (<buttontype="button"- aria-label={`${props.connected ? 'Connected to' : props.busy ? 'Connecting' : 'Connect'} ${props.tool.name}`}+ aria-label={`${props.state === 'account-linked' ? 'Account linked to' : connected() ? 'Connected to' : props.busy ? 'Connecting' : props.state === 'disabled' ? 'Enable' : 'Connect'} ${props.tool.name}`}aria-busy={props.busy}- disabled={props.disabled || props.busy || props.connected}+ disabled={props.disabled || props.busy || connected()}onClick={() => props.onConnect()}class="group flex min-w-0 flex-col items-center gap-3 rounded-2xl p-2 text-center outline-none focus-visible:ring-2 focus-visible:ring-ink/50"><spanclass="onboarding-tool-icon relative flex size-20 items-center justify-center rounded-[22px] bg-ink/5 transition-colors group-hover:bg-ink/10"classList={{- glass: !props.connected,- 'border-2 border-success': props.connected,+ glass: !connected(),+ 'border-2 border-success': connected(),}}><PipedreamConnectorIcon@@ -37,18 +51,15 @@ export function ToolTile(props: {class="absolute -right-1 -bottom-1 flex size-7 items-center justify-center rounded-full border shadow-sm"classList={{'border-success bg-success text-ink ring-2 ring-surface':- props.connected,- 'border-edge bg-surface text-ink-muted': !props.connected,+ connected(),+ 'border-edge bg-surface text-ink-muted': !connected(),}}><Showwhen={!props.busy}fallback={<SpinnerIcon class="size-3.5 animate-spin" />}>- <Show- when={props.connected}- fallback={<PlusIcon class="size-3.5" />}- >+ <Show when={connected()} fallback={<PlusIcon class="size-3.5" />}><CheckIcon class="size-3.5" /></Show></Show>@@ -59,7 +70,7 @@ export function ToolTile(props: {{props.tool.name}</span><span class="text-[11px] font-normal text-ink-extra-muted">- {props.connected ? 'Connected' : 'Integration'}+ {label()}</span></span></button>diff --git a/apps/web/src/features/onboarding/context/onboarding-context.tsx b/apps/web/src/features/onboarding/context/onboarding-context.tsxindex 6c60a7f867..f160fba8e4 100644--- a/apps/web/src/features/onboarding/context/onboarding-context.tsx+++ b/apps/web/src/features/onboarding/context/onboarding-context.tsx@@ -54,6 +54,19 @@ type ToolCatalogSource = {retry(): void;};+export type ToolConnectionState =+ | 'loading'+ | 'error'+ | 'available'+ | 'disabled'+ | 'connected'+ | 'account-linked';+export type ConnectedToolsSource = {+ connected: Accessor<ReadonlySet<string>>;+ state(slug: string): ToolConnectionState;+ retry(): void;+};+export type Team = { name: string };export type TeamInvite = { id: string; invitedBy: string };@@ -93,14 +106,13 @@ export type OnboardingContext = {connectInbox(): Promise<void>;createToolCatalog(): ToolCatalogSource;/**- * Slugs of connected tools; undefined until known. `poll` keeps re-checking- * while the user may be connecting one.+ * Independent provider states. `poll` re-checks while connections change.*/- createConnectedTools(options: {- poll: boolean;- }): Accessor<ReadonlySet<string> | undefined>;- /** Resolves when the hosted connect flow closes; reports its own failures. */+ createConnectedTools(options: { poll: boolean }): ConnectedToolsSource;+ /** GitHub uses native account OAuth; other tools use hosted connect. Reports its own failures. */connectTool(tool: Tool): Promise<void>;+ /** Opens the native GitHub App repository selection, after account linking. */+ configureGithubRepositories(): void;createTeamDirectory(): TeamDirectorySource;/** Rejects on failure; the capability reports its own errors. */createTeam(input: { name: string; invites: string[] }): Promise<void>;diff --git a/apps/web/src/features/onboarding/core/tools.ts b/apps/web/src/features/onboarding/core/tools.tsnew file mode 100644index 0000000000..6a40cd14f0--- /dev/null+++ b/apps/web/src/features/onboarding/core/tools.ts@@ -0,0 +1,65 @@+/** These apps are handled outside the onboarding tools catalog. */+export const ONBOARDING_HIDDEN_TOOLS: ReadonlySet<string> = new Set([+ 'gmail',+ 'google_calendar',+]);++/** Exact directory slugs and display names, in our preferred browse order. */+export const ONBOARDING_PRIORITY_TOOLS = [+ ['linear', 'Linear'],+ ['notion', 'Notion'],+ ['slack', 'Slack'],+ // Common startup workflows.+ ['posthog', 'PostHog'],+ ['stripe', 'Stripe'],+ ['github', 'GitHub'],+ ['figma', 'Figma'],+ ['intercom', 'Intercom'],+ ['hubspot', 'HubSpot'],+ ['airtable_oauth', 'Airtable'],+ // Small-business operations.+ ['quickbooks', 'QuickBooks'],+ ['xero_accounting_api', 'Xero'],+ ['shopify', 'Shopify'],+ ['mailchimp', 'Mailchimp'],+ ['zendesk', 'Zendesk'],+ ['calendly_v2', 'Calendly'],+ ['asana', 'Asana'],+ ['trello', 'Trello'],+] as const;++/** Macro owns GitHub account linking; this entry does not depend on Pipedream. */+export const NATIVE_GITHUB_TOOL = {+ slug: 'github',+ name: 'GitHub',+ iconUrl: null,+};++/** Pipedream directory metadata verified against the production catalog 2026-10-12.+ * Refresh when changing featured apps; normal browse/search metadata remains live. */+const FEATURED_ICONS: Readonly<Record<string, string>> = {+ posthog: 'https://assets.pipedream.net/s.v0/app_mo7h7A/logo/orig',+ notion: 'https://assets.pipedream.net/s.v0/app_X7Lhxr/logo/orig',+ linear: 'https://assets.pipedream.net/s.v0/app_X7Lh0L/logo/orig',+ stripe: 'https://assets.pipedream.net/s.v0/app_OD5hrX/logo/orig',+ slack: 'https://assets.pipedream.net/s.v0/app_M0hv7G/logo/orig',+ intercom: 'https://assets.pipedream.net/s.v0/app_1pbh0B/logo/orig',+ figma: 'https://assets.pipedream.net/s.v0/app_OkrhRR/logo/orig',+ hubspot: 'https://assets.pipedream.net/s.v0/app_OkrhlP/logo/orig',+ mailchimp: 'https://assets.pipedream.net/s.v0/app_mE7h2q/logo/orig',+ shopify: 'https://assets.pipedream.net/s.v0/app_X7Lhpm/logo/orig',+ airtable_oauth: 'https://assets.pipedream.net/s.v0/app_XBxhAl/logo/orig',+ xero_accounting_api: 'https://assets.pipedream.net/s.v0/app_1dBh9j/logo/orig',+ zendesk: 'https://assets.pipedream.net/s.v0/app_1pbhGX/logo/orig',+ asana: 'https://assets.pipedream.net/s.v0/app_OVWhPX/logo/orig',+ calendly_v2: 'https://assets.pipedream.net/s.v0/app_Oz6h0D/logo/orig',+ quickbooks: 'https://assets.pipedream.net/s.v0/app_m02hWG/logo/orig',+ trello: 'https://assets.pipedream.net/s.v0/app_168hnX/logo/orig',+};+export const ONBOARDING_FEATURED_TOOLS = ONBOARDING_PRIORITY_TOOLS.map(+ ([slug, name]) => ({+ slug,+ name,+ iconUrl: FEATURED_ICONS[slug] ?? null,+ })+);diff --git a/apps/web/src/features/onboarding/create-app-onboarding-context.ts b/apps/web/src/features/onboarding/create-app-onboarding-context.tsindex 03bb73f555..3b3a8cafca 100644--- a/apps/web/src/features/onboarding/create-app-onboarding-context.ts+++ b/apps/web/src/features/onboarding/create-app-onboarding-context.ts@@ -1,16 +1,14 @@import { ROUTER_BASE_CONCAT } from '@app/constants/routerBase';import { useAnalytics } from '@app/lib/analytics/analytics-context';import { toast } from '@core/component/Toast/Toast';+import { SERVER_HOSTS } from '@core/constant/servers';import { deriveIsAuthenticated } from '@core/context/user';import { useAddInboxFlow } from '@core/email-link';-import {- createPipedreamCatalogConnect,- createPipedreamCatalogSearch,-} from '@core/pipedream/catalog';import { idToDisplayName, idToEmail } from '@core/user/util';import {useAiBillingPlansQuery,useCreateCheckoutSessionMutation,+ useGithubLinkStatusQuery,} from '@queries/auth';import { useCompleteTutorialMutation } from '@queries/auth/tutorial';import { type UserInfoData, useUserInfoQuery } from '@queries/auth/user-info';@@ -19,11 +17,12 @@ import { invalidateEmailLinks, useEmailLinksQuery } from '@queries/email/link';import { queryReadyGate } from '@queries/gate';import { useGithubStarsQuery } from '@queries/github-stars';import { useGtmInviteOfferQuery } from '@queries/gtm-invite/links';+import { useMcpServersQuery } from '@queries/mcp-servers';import {useCompleteOnboardingMutation,useOnboardingQuery,} from '@queries/onboarding';-import { usePipedreamConnectedSlugs } from '@queries/pipedream-connectors';+import { usePipedreamConnectionsQuery } from '@queries/pipedream-connectors';import {useJoinTeamMutation,useUserInvitesQuery,@@ -38,7 +37,13 @@ import type {ViewerState,} from './context/onboarding-context';import { onboardingCheckoutRequest } from './core/checkout';+import {+ onboardingConnectedTools,+ onboardingToolState,+} from './queries/connected-tools';import { loadableQuery } from './queries/loadable-query';+import { createOnboardingToolCatalog } from './queries/tool-catalog';+import { createOnboardingToolConnect } from './queries/tool-connect';/** How often connected tools re-check while the user is on the tools step. */const CONNECTED_TOOLS_POLL_MS = 5_000;@@ -85,6 +90,7 @@ export function createAppOnboardingContext(): OnboardingContext {const checkout = useCreateCheckoutSessionMutation();const completeOnboarding = useCompleteOnboardingMutation();const completeTutorial = useCompleteTutorialMutation();+ const connectTool = createOnboardingToolConnect();const viewer = () => toViewerState(userInfo);const needsOnboarding = () => {@@ -126,34 +132,61 @@ export function createAppOnboardingContext(): OnboardingContext {},connectInbox: () => startAddInbox(),- createToolCatalog: () => {- const catalog = createPipedreamCatalogSearch(() => new Set<string>());- return {- search: catalog.searchInput,- setSearch: catalog.onSearchInput,- entries: () =>- catalog.entries().map((entry) => ({- slug: entry.app_slug,- name: entry.display_name,- iconUrl: entry.icon_url ?? null,- })),- fetching: () => catalog.query.isFetching,- failed: () => catalog.query.isError,- hasMore: () => catalog.query.hasNextPage,- loadMore: () => void catalog.query.fetchNextPage(),- retry: () => void catalog.query.refetch(),- };- },+ createToolCatalog: createOnboardingToolCatalog,createConnectedTools: ({ poll }) => {- const connected = usePipedreamConnectedSlugs({+ const connected = usePipedreamConnectionsQuery({+ neverSuspend: true,+ refetchInterval: poll ? CONNECTED_TOOLS_POLL_MS : undefined,+ });+ const native = useMcpServersQuery({+ neverSuspend: true,+ refetchInterval: poll ? CONNECTED_TOOLS_POLL_MS : undefined,+ });+ const github = useGithubLinkStatusQuery({refetchInterval: poll ? CONNECTED_TOOLS_POLL_MS : undefined,+ refetchOnMount: 'always',});- return () => (connected.ready() ? connected.slugs() : undefined);+ const pdState = () =>+ connected.isPlaceholderData+ ? { t: 'loading' as const }+ : loadableQuery(connected, (data) => data);+ const nativeState = () =>+ native.isPlaceholderData+ ? { t: 'loading' as const }+ : loadableQuery(native, (data) => data);+ return {+ connected: () =>+ onboardingConnectedTools(+ new Set(+ queryReadyGate(connected)+ ? connected.data.filter((c) => c.enabled).map((c) => c.app_slug)+ : []+ ),+ queryReadyGate(native) ? native.data : [],+ queryReadyGate(github) && github.data.status === 'linked'+ ),+ state: (slug) =>+ onboardingToolState(+ slug,+ pdState(),+ nativeState(),+ loadableQuery(github, (data) => data.status)+ ),+ retry: () => {+ if (connected.isError) void connected.refetch();+ if (native.isError) void native.refetch();+ if (github.isError) void github.refetch();+ },+ };+ },+ connectTool,+ configureGithubRepositories: () => {+ window.open(+ `${SERVER_HOSTS['document-storage-service']}/github/install-sync`,+ '_blank',+ 'noopener,noreferrer'+ );},- connectTool: (tool) =>- createPipedreamCatalogConnect({- entry: () => ({ app_slug: tool.slug, display_name: tool.name }),- }).connect(),createTeamDirectory: () => {const teams = useUserTeamsQuery();diff --git a/apps/web/src/features/onboarding/primitives/tools.test.ts b/apps/web/src/features/onboarding/primitives/tools.test.tsnew file mode 100644index 0000000000..5795b2b480--- /dev/null+++ b/apps/web/src/features/onboarding/primitives/tools.test.ts@@ -0,0 +1,66 @@+import { describe, expect, it } from 'vitest';+import { orderOnboardingTools } from './tools';++const tools = (slugs: string[]) => slugs.map((slug) => ({ slug }));++describe('onboarding tool ordering', () => {+ it('puts the three pinned apps, startup apps, and business apps before infrastructure', () => {+ expect(+ orderOnboardingTools(+ tools([+ 'supabase',+ 'mysql',+ 'quickbooks',+ 'stripe',+ 'notion',+ 'slack_v2',+ 'posthog',+ 'linear',+ 'github',+ 'shopify',+ 'unknown_app',+ ])+ ).map((tool) => tool.slug)+ ).toEqual([+ 'linear',+ 'notion',+ 'slack_v2',+ 'posthog',+ 'stripe',+ 'github',+ 'quickbooks',+ 'shopify',+ 'supabase',+ 'mysql',+ 'unknown_app',+ ]);+ });++ it('deduplicates promoted apps, later pages and Slack aliases, and hides only excluded Google apps', () => {+ expect(+ orderOnboardingTools(+ tools([+ 'slack',+ 'linear',+ 'stripe',+ 'gmail',+ 'google_sheets',+ 'google_drive',+ 'google_calendar',+ 'slack_v2',+ 'linear',+ 'stripe',+ 'mysql',+ 'mysql',+ ])+ ).map((tool) => tool.slug)+ ).toEqual([+ 'linear',+ 'slack',+ 'stripe',+ 'google_sheets',+ 'google_drive',+ 'mysql',+ ]);+ });+});diff --git a/apps/web/src/features/onboarding/primitives/tools.ts b/apps/web/src/features/onboarding/primitives/tools.tsnew file mode 100644index 0000000000..3f61d0fe82--- /dev/null+++ b/apps/web/src/features/onboarding/primitives/tools.ts@@ -0,0 +1,30 @@+import { canonicalPipedreamSlug } from '@core/pipedream/slugs';+import {+ ONBOARDING_HIDDEN_TOOLS,+ ONBOARDING_PRIORITY_TOOLS,+} from '../core/tools';++const priority = new Map<string, number>(+ ONBOARDING_PRIORITY_TOOLS.map(([slug], index) => [slug, index])+);++/** Keep the rest in directory order, with one card per provider on every page. */+export function orderOnboardingTools<T extends { slug: string }>(+ tools: readonly T[]+): T[] {+ const seen = new Set<string>();+ return tools+ .filter((tool) => {+ const slug = canonicalPipedreamSlug(tool.slug);+ if (ONBOARDING_HIDDEN_TOOLS.has(slug) || seen.has(slug)) return false;+ seen.add(slug);+ return true;+ })+ .sort(+ (a, b) =>+ (priority.get(canonicalPipedreamSlug(a.slug)) ??+ Number.MAX_SAFE_INTEGER) -+ (priority.get(canonicalPipedreamSlug(b.slug)) ??+ Number.MAX_SAFE_INTEGER)+ );+}diff --git a/apps/web/src/features/onboarding/queries/connected-tools.test.ts b/apps/web/src/features/onboarding/queries/connected-tools.test.tsnew file mode 100644index 0000000000..a0e2de0d2b--- /dev/null+++ b/apps/web/src/features/onboarding/queries/connected-tools.test.ts@@ -0,0 +1,134 @@+import { describe, expect, it } from 'vitest';+import {+ onboardingConnectedTools,+ onboardingToolState,+} from './connected-tools';++describe('native onboarding connections', () => {+ it('merges native presets with Pipedream without relying on display names', () => {+ const native = [+ 'https://api.githubcopilot.com/mcp',+ 'https://mcp.linear.app/mcp/',+ 'https://mcp.notion.com/mcp',+ 'https://mcp.slack.com/mcp',+ 'https://mcp.posthog.com/mcp',+ 'https://mcp.datadoghq.com/mcp',+ 'https://mcp.grafana.com/mcp',+ ].map((url) => ({+ url,+ enabled: true,+ authenticated: true,+ server_name: 'Renamed',+ }));+ expect(+ onboardingConnectedTools(new Set(['linear', 'hubspot']), native)+ ).toEqual(+ new Set([+ 'linear',+ 'notion',+ 'slack',+ 'posthog',+ 'datadog',+ 'grafana',+ 'hubspot',+ ])+ );+ });++ it('does not mistake unauthenticated or unrelated servers for connected tools', () => {+ expect(+ onboardingConnectedTools(new Set(), [+ {+ url: 'https://mcp.linear.app/mcp',+ enabled: true,+ authenticated: false,+ },+ { url: 'https://example.com/mcp', enabled: true, authenticated: true },+ {+ url: 'https://mcp.notion.com.evil.example/mcp',+ enabled: true,+ authenticated: true,+ },+ ])+ ).toEqual(new Set());+ });++ it('normalizes Pipedream aliases', () => {+ expect(onboardingConnectedTools(new Set(['slack_v2']), [])).toEqual(+ new Set(['slack'])+ );+ });+ it('uses native account status for GitHub, never Pipedream or MCP status', () => {+ const mcp = [+ {+ url: 'https://api.githubcopilot.com/mcp',+ enabled: true,+ authenticated: true,+ },+ ];+ expect(+ onboardingConnectedTools(new Set(['github']), mcp, false).has('github')+ ).toBe(false);+ expect(onboardingConnectedTools(new Set(), [], true).has('github')).toBe(+ true+ );+ });+});++const loading = { t: 'loading' } as const;+const error = { t: 'error' } as const;+const empty = { t: 'ready', value: [] } as const;+it('isolates GitHub and hosted providers from unrelated status failures', () => {+ expect(+ onboardingToolState('github', error, error, { t: 'ready', value: 'linked' })+ ).toBe('account-linked');+ expect(onboardingToolState('stripe', empty, error, error)).toBe('available');+ expect(onboardingToolState('linear', empty, error, error)).toBe('error');+ expect(onboardingToolState('linear', loading, loading, error)).toBe(+ 'loading'+ );+});+it('keeps known connections usable when the other source fails', () => {+ const native = {+ t: 'ready',+ value: [+ { url: 'https://mcp.linear.app/mcp', authenticated: true, enabled: true },+ ],+ } as const;+ expect(onboardingToolState('linear', error, native, error)).toBe('connected');+ expect(+ onboardingToolState(+ 'slack',+ { t: 'ready', value: [{ app_slug: 'slack_v2', enabled: true }] },+ error,+ error+ )+ ).toBe('connected');+});+it('offers enable instead of OAuth for disabled existing connections', () => {+ expect(+ onboardingToolState(+ 'linear',+ empty,+ {+ t: 'ready',+ value: [+ {+ url: 'https://mcp.linear.app/mcp',+ authenticated: true,+ enabled: false,+ },+ ],+ },+ error+ )+ ).toBe('disabled');+ expect(+ onboardingToolState(+ 'stripe',+ { t: 'ready', value: [{ app_slug: 'stripe', enabled: false }] },+ empty,+ error+ )+ ).toBe('disabled');+});diff --git a/apps/web/src/features/onboarding/queries/connected-tools.ts b/apps/web/src/features/onboarding/queries/connected-tools.tsnew file mode 100644index 0000000000..1666b6b73b--- /dev/null+++ b/apps/web/src/features/onboarding/queries/connected-tools.ts@@ -0,0 +1,84 @@+import { QUICK_CONNECT_SERVERS } from '@core/component/AI/constant/mcpServers';+import { canonicalPipedreamSlug } from '@core/pipedream/slugs';+import type {+ Loadable,+ ToolConnectionState,+} from '../context/onboarding-context';++type NativeConnection = {+ url: string;+ authenticated: boolean;+ enabled: boolean;+};++/** Identify native providers by endpoint, not their editable display name. */+export function onboardingConnectedTools(+ pipedream: ReadonlySet<string>,+ native: readonly NativeConnection[],+ githubLinked = false+): ReadonlySet<string> {+ const connected = new Set([...pipedream].map(canonicalPipedreamSlug));+ for (const server of native) {+ if (!server.authenticated || !server.enabled) continue;+ const preset = QUICK_CONNECT_SERVERS.find(+ (preset) => preset.url === server.url.replace(/\/+$/, '')+ );+ if (preset) connected.add(canonicalPipedreamSlug(preset.app_slug));+ }+ // The GitHub card links Macro's native account, not an MCP connector.+ connected.delete('github');+ if (githubLinked) connected.add('github');+ return connected;+}++export function nativeToolSlug(server: NativeConnection): string | undefined {+ return QUICK_CONNECT_SERVERS.find(+ (preset) => preset.url === server.url.replace(/\/+$/, '')+ )?.app_slug;+}++/** A known successful connection remains usable when an unrelated source fails. */+export function onboardingToolState(+ slug: string,+ pipedream: Loadable<readonly { app_slug: string; enabled: boolean }[]>,+ native: Loadable<readonly NativeConnection[]>,+ github: Loadable<string>+): ToolConnectionState {+ slug = canonicalPipedreamSlug(slug);+ if (slug === 'github') {+ return github.t === 'ready'+ ? github.value === 'linked'+ ? 'account-linked'+ : 'available'+ : github.t;+ }+ const nativeMatches =+ native.t === 'ready'+ ? native.value.filter(+ (server) => nativeToolSlug(server) === slug && server.authenticated+ )+ : [];+ const pdMatches =+ pipedream.t === 'ready'+ ? pipedream.value.filter(+ (server) => canonicalPipedreamSlug(server.app_slug) === slug+ )+ : [];+ if (+ nativeMatches.some((server) => server.enabled) ||+ pdMatches.some((server) => server.enabled)+ )+ return 'connected';+ if (nativeMatches.length || pdMatches.length) return 'disabled';+ const hasNativeProvider = QUICK_CONNECT_SERVERS.some(+ (server) => server.app_slug === slug+ );+ if (pipedream.t === 'error' || (hasNativeProvider && native.t === 'error'))+ return 'error';+ if (+ pipedream.t === 'loading' ||+ (hasNativeProvider && native.t === 'loading')+ )+ return 'loading';+ return 'available';+}diff --git a/apps/web/src/features/onboarding/queries/tool-catalog.test.ts b/apps/web/src/features/onboarding/queries/tool-catalog.test.tsnew file mode 100644index 0000000000..e0dc5842d5--- /dev/null+++ b/apps/web/src/features/onboarding/queries/tool-catalog.test.ts@@ -0,0 +1,84 @@+import { createRoot, createSignal } from 'solid-js';+import { afterEach, describe, expect, it, vi } from 'vitest';+import { ONBOARDING_PRIORITY_TOOLS } from '../core/tools';+import { orderOnboardingTools } from '../primitives/tools';+import { createOnboardingToolCatalog } from './tool-catalog';++const mocks = vi.hoisted(() => ({ catalog: vi.fn(), query: vi.fn() }));+vi.mock('@core/pipedream/catalog', () => ({+ createPipedreamCatalogSearch: mocks.catalog,+}));+vi.mock('@queries/pipedream-connectors', () => ({+ usePipedreamCatalogQuery: mocks.query,+}));++const entry = (slug: string, name = slug) => ({+ app_slug: slug,+ display_name: name,+ icon_url: `https://example.com/${slug}.png`,+});++afterEach(() => vi.clearAllMocks());++describe('onboarding directory adapter', () => {+ it('shows stable featured apps without extra requests and keeps live search and pagination', () => {+ createRoot((dispose) => {+ const [search, setSearch] = createSignal('');+ const [page, setPage] = createSignal([entry('mysql'), entry('stripe')]);+ const fetchNextPage = vi.fn();+ mocks.catalog.mockReturnValue({+ search,+ searchInput: search,+ onSearchInput: setSearch,+ entries: page,+ query: {+ isFetching: false,+ isError: false,+ hasNextPage: true,+ fetchNextPage,+ },+ });+ const catalog = createOnboardingToolCatalog();+ expect(+ orderOnboardingTools(catalog.entries()).map((tool) => tool.slug)+ ).toEqual([...ONBOARDING_PRIORITY_TOOLS.map(([slug]) => slug), 'mysql']);+ expect(+ catalog.entries().find((tool) => tool.slug === 'posthog')?.iconUrl+ ).toBe('https://assets.pipedream.net/s.v0/app_mo7h7A/logo/orig');+ catalog.loadMore();+ expect(fetchNextPage).toHaveBeenCalledOnce();+ expect(catalog.hasMore()).toBe(true);+ setPage([+ ...page(),+ entry('posthog'),+ entry('slack'),+ entry('google_drive'),+ entry('google_sheets'),+ ]);+ expect(+ orderOnboardingTools(catalog.entries()).map((tool) => tool.slug)+ ).toEqual([+ ...ONBOARDING_PRIORITY_TOOLS.map(([slug]) => slug),+ 'mysql',+ 'google_drive',+ 'google_sheets',+ ]);+ catalog.setSearch('obscure');+ setPage([entry('obscure_app')]);+ expect(catalog.entries().map((tool) => tool.slug)).toEqual([+ 'obscure_app',+ ]);+ expect(mocks.query).not.toHaveBeenCalled();+ expect(mocks.catalog).toHaveBeenCalledOnce();+ catalog.setSearch('github');+ setPage([entry('github', 'Pipedream GitHub')]);+ expect(catalog.entries()).toEqual([+ { slug: 'github', name: 'GitHub', iconUrl: null },+ ]);+ expect(+ mocks.query.mock.calls.some((call) => call[0]() === 'GitHub')+ ).toBe(false);+ dispose();+ });+ });+});diff --git a/apps/web/src/features/onboarding/queries/tool-catalog.ts b/apps/web/src/features/onboarding/queries/tool-catalog.tsnew file mode 100644index 0000000000..191699741c--- /dev/null+++ b/apps/web/src/features/onboarding/queries/tool-catalog.ts@@ -0,0 +1,37 @@+import { createPipedreamCatalogSearch } from '@core/pipedream/catalog';+import { NATIVE_GITHUB_TOOL, ONBOARDING_FEATURED_TOOLS } from '../core/tools';++/** Stable featured metadata plus one paginated, searchable live directory. */+export function createOnboardingToolCatalog() {+ const catalog = createPipedreamCatalogSearch(+ () => new Set<string>(['github'])+ );+ return {+ search: catalog.searchInput,+ setSearch: catalog.onSearchInput,+ entries: () => {+ const search = catalog.search().trim().toLowerCase();+ const featured = search+ ? ONBOARDING_FEATURED_TOOLS.filter((tool) =>+ tool.name.toLowerCase().includes(search)+ )+ : ONBOARDING_FEATURED_TOOLS;+ return [+ ...featured,+ ...catalog+ .entries()+ .filter((entry) => entry.app_slug !== NATIVE_GITHUB_TOOL.slug)+ .map((entry) => ({+ slug: entry.app_slug,+ name: entry.display_name,+ iconUrl: entry.icon_url ?? null,+ })),+ ];+ },+ fetching: () => catalog.query.isFetching,+ failed: () => catalog.query.isError,+ hasMore: () => catalog.query.hasNextPage,+ loadMore: () => void catalog.query.fetchNextPage(),+ retry: () => void catalog.query.refetch(),+ };+}diff --git a/apps/web/src/features/onboarding/queries/tool-connect.test.ts b/apps/web/src/features/onboarding/queries/tool-connect.test.tsnew file mode 100644index 0000000000..37dc7cce2d--- /dev/null+++ b/apps/web/src/features/onboarding/queries/tool-connect.test.ts@@ -0,0 +1,135 @@+import { beforeEach, describe, expect, it, vi } from 'vitest';+import { createOnboardingToolConnect } from './tool-connect';++const mocks = vi.hoisted(() => ({+ authorize: vi.fn(),+ init: vi.fn(),+ reauthenticate: vi.fn(),+ fetch: vi.fn(),+ pipedream: vi.fn(),+ failure: vi.fn(),+ updateNative: vi.fn(),+ updatePipedream: vi.fn(),+}));+vi.mock('@core/auth/authorize-github', () => ({+ authorizeGithub: mocks.authorize,+}));+vi.mock('@core/component/Toast/Toast', () => ({+ toast: { failure: mocks.failure },+}));+vi.mock('@queries/auth', () => ({+ useInitGithubLinkMutation: () => ({ mutateAsync: mocks.init }),+ useReauthenticateGithubMutation: () => ({+ mutateAsync: mocks.reauthenticate,+ }),+}));+vi.mock('@queries/auth/github-link', () => ({+ githubLinkStatusQueryOptions: () => ({ queryKey: ['github'] }),+}));+vi.mock('@queries/client', () => ({+ queryClient: { fetchQuery: mocks.fetch },+}));+vi.mock('@core/pipedream/catalog', () => ({+ createPipedreamCatalogConnect: () => ({ connect: mocks.pipedream }),+}));+vi.mock('@queries/mcp-servers', () => ({+ mcpServersQueryOptions: () => ({ queryKey: ['native'] }),+ useUpdateMcpServerMutation: () => ({ mutateAsync: mocks.updateNative }),+}));+vi.mock('@queries/pipedream-connectors', () => ({+ pipedreamConnectionsQueryOptions: () => ({ queryKey: ['pipedream'] }),+ useUpdatePipedreamConnectionMutation: () => ({+ mutateAsync: mocks.updatePipedream,+ }),+}));+const github = { slug: 'github', name: 'GitHub', iconUrl: null };+beforeEach(() => {+ vi.resetAllMocks();+ mocks.fetch.mockResolvedValue([]);+ mocks.authorize.mockImplementation(async (getUrl) => {+ await getUrl('https://macro.com/app/onboarding');+ return true;+ });+});++describe('native GitHub onboarding', () => {+ it.each(['unlinked', 'reauthentication_required'])(+ 'uses native OAuth for %s accounts',+ async (status) => {+ mocks.fetch.mockResolvedValue({ status });+ await createOnboardingToolConnect()(github);+ expect(+ status === 'unlinked' ? mocks.init : mocks.reauthenticate+ ).toHaveBeenCalledWith('https://macro.com/app/onboarding');+ expect(mocks.pipedream).not.toHaveBeenCalled();+ }+ );+ it('does not reconnect an already linked native account', async () => {+ mocks.fetch.mockResolvedValue({ status: 'linked' });+ await createOnboardingToolConnect()(github);+ expect(mocks.authorize).not.toHaveBeenCalled();+ expect(mocks.pipedream).not.toHaveBeenCalled();+ });+ it('never falls back to Pipedream when native authorization fails', async () => {+ mocks.fetch.mockResolvedValue({ status: 'unlinked' });+ mocks.init.mockRejectedValue(new Error('Unavailable'));+ await createOnboardingToolConnect()(github);+ expect(mocks.failure).toHaveBeenCalled();+ expect(mocks.pipedream).not.toHaveBeenCalled();+ });+ it('keeps other tools on the existing Pipedream flow', async () => {+ await createOnboardingToolConnect()({+ ...github,+ slug: 'notion',+ name: 'Notion',+ });+ expect(mocks.pipedream).toHaveBeenCalledOnce();+ expect(mocks.authorize).not.toHaveBeenCalled();+ });+});++it('enables an existing native connection without starting another OAuth flow', async () => {+ mocks.fetch.mockImplementation(async ({ queryKey }) =>+ queryKey[0] === 'native'+ ? [+ {+ url: 'https://mcp.linear.app/mcp',+ authenticated: true,+ enabled: false,+ },+ ]+ : []+ );+ await createOnboardingToolConnect()({+ slug: 'linear',+ name: 'Linear',+ iconUrl: null,+ });+ expect(mocks.updateNative).toHaveBeenCalledWith({+ url: 'https://mcp.linear.app/mcp',+ enabled: true,+ });+ expect(mocks.pipedream).not.toHaveBeenCalled();+});+it('recognizes existing Slack aliases and avoids reconnecting', async () => {+ mocks.fetch.mockImplementation(async ({ queryKey }) =>+ queryKey[0] === 'pipedream' ? [{ app_slug: 'slack_v2', enabled: true }] : []+ );+ await createOnboardingToolConnect()({+ slug: 'slack',+ name: 'Slack',+ iconUrl: null,+ });+ expect(mocks.pipedream).not.toHaveBeenCalled();+ expect(mocks.updatePipedream).not.toHaveBeenCalled();+});+it('does not initiate OAuth when connection status cannot be established', async () => {+ mocks.fetch.mockRejectedValue(new Error('Network failure'));+ await createOnboardingToolConnect()({+ slug: 'linear',+ name: 'Linear',+ iconUrl: null,+ });+ expect(mocks.pipedream).not.toHaveBeenCalled();+ expect(mocks.failure).toHaveBeenCalled();+});diff --git a/apps/web/src/features/onboarding/queries/tool-connect.ts b/apps/web/src/features/onboarding/queries/tool-connect.tsnew file mode 100644index 0000000000..589d78e55f--- /dev/null+++ b/apps/web/src/features/onboarding/queries/tool-connect.ts@@ -0,0 +1,99 @@+import { authorizeGithub } from '@core/auth/authorize-github';+import { QUICK_CONNECT_SERVERS } from '@core/component/AI/constant/mcpServers';+import { toast } from '@core/component/Toast/Toast';+import { createPipedreamCatalogConnect } from '@core/pipedream/catalog';+import {+ canonicalPipedreamSlug,+ connectSlugForPipedreamApp,+} from '@core/pipedream/slugs';+import {+ useInitGithubLinkMutation,+ useReauthenticateGithubMutation,+} from '@queries/auth';+import { githubLinkStatusQueryOptions } from '@queries/auth/github-link';+import { queryClient } from '@queries/client';+import {+ mcpServersQueryOptions,+ useUpdateMcpServerMutation,+} from '@queries/mcp-servers';+import {+ pipedreamConnectionsQueryOptions,+ useUpdatePipedreamConnectionMutation,+} from '@queries/pipedream-connectors';+import type { Tool } from '../context/onboarding-context';+import { nativeToolSlug } from './connected-tools';++/** GitHub uses Macro's account integration; it must never fall through to MCP. */+export function createOnboardingToolConnect() {+ const updateNative = useUpdateMcpServerMutation();+ const updatePipedream = useUpdatePipedreamConnectionMutation();+ const init = useInitGithubLinkMutation();+ const reauthenticate = useReauthenticateGithubMutation();++ return async (tool: Tool): Promise<void> => {+ try {+ if (tool.slug !== 'github') {+ // Re-check on click so another tab cannot cause a duplicate connection.+ const native = QUICK_CONNECT_SERVERS.some(+ (server) => server.app_slug === canonicalPipedreamSlug(tool.slug)+ )+ ? await queryClient.fetchQuery({+ ...mcpServersQueryOptions(),+ staleTime: 0,+ })+ : [];+ const slug = canonicalPipedreamSlug(tool.slug);+ const nativeMatches = native.filter(+ (server) => server.authenticated && nativeToolSlug(server) === slug+ );+ const existingNative =+ nativeMatches.find((server) => server.enabled) ?? nativeMatches[0];+ if (existingNative) {+ if (!existingNative.enabled)+ await updateNative.mutateAsync({+ url: existingNative.url,+ enabled: true,+ });+ return;+ }+ const pipedream = await queryClient.fetchQuery({+ ...pipedreamConnectionsQueryOptions(),+ staleTime: 0,+ });+ const matches = pipedream.filter(+ (server) => canonicalPipedreamSlug(server.app_slug) === slug+ );+ const existing = matches.find((server) => server.enabled) ?? matches[0];+ if (existing) {+ if (!existing.enabled)+ await updatePipedream.mutateAsync({+ app_slug: existing.app_slug,+ enabled: true,+ });+ return;+ }+ await createPipedreamCatalogConnect({+ entry: () => ({+ app_slug: connectSlugForPipedreamApp(tool.slug),+ display_name: tool.name,+ }),+ }).connect();+ return;+ }++ const github = await queryClient.fetchQuery({+ ...githubLinkStatusQueryOptions(),+ staleTime: 0,+ });+ if (github.status === 'linked') return;+ const mutation =+ github.status === 'reauthentication_required' ? reauthenticate : init;+ await authorizeGithub(+ (callbackUrl) => mutation.mutateAsync(callbackUrl),+ 'Failed to connect GitHub'+ );+ } catch {+ toast.failure(`Failed to connect ${tool.name}`);+ }+ };+}diff --git a/apps/web/src/features/onboarding/tests/connector-icons.json b/apps/web/src/features/onboarding/tests/connector-icons.jsonnew file mode 100644index 0000000000..882e4c347a--- /dev/null+++ b/apps/web/src/features/onboarding/tests/connector-icons.json@@ -0,0 +1,112 @@+{+ "posthog": {+ "page": "https://pipedream.com/apps/posthog",+ "source": "https://pipedream.com/s.v0/app_mo7h7A/logo/96",+ "file": "posthog.png"+ },+ "notion": {+ "page": "https://pipedream.com/apps/notion",+ "source": "https://pipedream.com/s.v0/app_X7Lhxr/logo/96",+ "file": "notion.svg"+ },+ "linear": {+ "page": "https://pipedream.com/apps/linear",+ "source": "https://pipedream.com/s.v0/app_X7Lh0L/logo/96",+ "file": "linear.svg"+ },+ "stripe": {+ "page": "https://pipedream.com/apps/stripe",+ "source": "https://pipedream.com/s.v0/app_OD5hrX/logo/96",+ "file": "stripe.png"+ },+ "slack": {+ "page": "https://pipedream.com/apps/slack-v2",+ "source": "https://pipedream.com/s.v0/app_M0hv7G/logo/96",+ "file": "slack.png"+ },+ "intercom": {+ "page": "https://pipedream.com/apps/intercom",+ "source": "https://pipedream.com/s.v0/app_1pbh0B/logo/96",+ "file": "intercom.svg"+ },+ "figma": {+ "page": "https://pipedream.com/apps/figma",+ "source": "https://pipedream.com/s.v0/app_OkrhRR/logo/96",+ "file": "figma.png"+ },+ "hubspot": {+ "page": "https://pipedream.com/apps/hubspot",+ "source": "https://pipedream.com/s.v0/app_OkrhlP/logo/96",+ "file": "hubspot.svg"+ },+ "github": {+ "page": "https://pipedream.com/apps/github",+ "source": "https://pipedream.com/s.v0/app_OrZhaO/logo/96",+ "file": "github.png"+ },+ "mailchimp": {+ "page": "https://pipedream.com/apps/mailchimp",+ "source": "https://pipedream.com/s.v0/app_mE7h2q/logo/96",+ "file": "mailchimp.png"+ },+ "shopify": {+ "page": "https://pipedream.com/apps/shopify",+ "source": "https://pipedream.com/s.v0/app_X7Lhpm/logo/96",+ "file": "shopify.svg"+ },+ "airtable_oauth": {+ "page": "https://pipedream.com/apps/airtable-oauth",+ "source": "https://pipedream.com/s.v0/app_XBxhAl/logo/96",+ "file": "airtable_oauth.png"+ },+ "xero_accounting_api": {+ "page": "https://pipedream.com/apps/xero-accounting-api",+ "source": "https://pipedream.com/s.v0/app_1dBh9j/logo/96",+ "file": "xero_accounting_api.png"+ },+ "zendesk": {+ "page": "https://pipedream.com/apps/zendesk",+ "source": "https://pipedream.com/s.v0/app_1pbhGX/logo/96",+ "file": "zendesk.png"+ },+ "asana": {+ "page": "https://pipedream.com/apps/asana",+ "source": "https://pipedream.com/s.v0/app_OVWhPX/logo/96",+ "file": "asana.png"+ },+ "calendly_v2": {+ "page": "https://pipedream.com/apps/calendly-v2",+ "source": "https://pipedream.com/s.v0/app_Oz6h0D/logo/96",+ "file": "calendly_v2.png"+ },+ "quickbooks": {+ "page": "https://pipedream.com/apps/quickbooks",+ "source": "https://pipedream.com/s.v0/app_m02hWG/logo/96",+ "file": "quickbooks.png"+ },+ "supabase": {+ "page": "https://pipedream.com/apps/supabase",+ "source": "https://pipedream.com/s.v0/app_1dBhP3/logo/96",+ "file": "supabase.svg"+ },+ "trello": {+ "page": "https://pipedream.com/apps/trello",+ "source": "https://pipedream.com/s.v0/app_168hnX/logo/96",+ "file": "trello.png"+ },+ "mysql": {+ "page": "https://pipedream.com/apps/mysql",+ "source": "https://pipedream.com/s.v0/app_1YMhwo/logo/96",+ "file": "mysql.png"+ },+ "google_sheets": {+ "page": "https://pipedream.com/apps/google-sheets",+ "source": "https://pipedream.com/s.v0/app_168hvn/logo/96",+ "file": "google_sheets.png"+ },+ "google_drive": {+ "page": "https://pipedream.com/apps/google-drive",+ "source": "https://pipedream.com/s.v0/app_1lxhk1/logo/96",+ "file": "google_drive.png"+ }+}diff --git a/apps/web/src/features/onboarding/tests/connector-icons.ts b/apps/web/src/features/onboarding/tests/connector-icons.tsnew file mode 100644index 0000000000..015ec6f065--- /dev/null+++ b/apps/web/src/features/onboarding/tests/connector-icons.ts@@ -0,0 +1,11 @@+import { canonicalPipedreamSlug } from '@core/pipedream/slugs';+import sources from './connector-icons.json' with { type: 'json' };++const icons = new Map(Object.entries(sources));++/** Local snapshots of actual Pipedream icons keep browser tests offline. */+export function fixtureConnectorIcon(slug: string): string | null {+ if (slug === 'github') return null;+ const icon = icons.get(canonicalPipedreamSlug(slug));+ return icon ? `/connector-icons/${icon.file}` : null;+}diff --git a/apps/web/src/features/onboarding/tests/fake-onboarding-context.ts b/apps/web/src/features/onboarding/tests/fake-onboarding-context.tsindex ba4f2d435f..79a793bed3 100644--- a/apps/web/src/features/onboarding/tests/fake-onboarding-context.ts+++ b/apps/web/src/features/onboarding/tests/fake-onboarding-context.ts@@ -1,5 +1,6 @@import type { PaidPlanTier } from '@app/features/paywall/plans';import type { AiPlanCatalog } from '@service-auth/ai-billing-types';+import type { ServerResponse } from '@service-cognition/generated/schemas';import { createSignal } from 'solid-js';import { createStore, produce, unwrap } from 'solid-js/store';import type {@@ -13,6 +14,12 @@ import type {ViewerState,} from '../context/onboarding-context';import type { EmailAccount } from '../core/email-accounts';+import {+ nativeToolSlug,+ onboardingConnectedTools,+ onboardingToolState,+} from '../queries/connected-tools';+import { fixtureConnectorIcon } from './connector-icons';/** Everything the fake backend knows. Plain JSON, so a harness can persist it. */export type FakeOnboardingWorld = {@@ -31,6 +38,9 @@ export type FakeOnboardingWorld = {contacts: string[];catalog: Tool[];connectedTools: string[];+ githubLinkStatus: 'linked' | 'unlinked' | 'reauthentication_required';+ nativeTools: ServerResponse[];+ connectionFailures: ('pipedream' | 'native' | 'github')[];githubStars: number | undefined;inviteOffer: InviteOffer | null;planCatalog: AiPlanCatalog;@@ -74,9 +84,16 @@ export function defaultFakeWorld(): FakeOnboardingWorld {invites: [],catalog: ['Linear', 'Notion', 'GitHub', 'Slack', 'Figma', 'HubSpot'].map(- (name) => ({ slug: name.toLowerCase(), name, iconUrl: null })+ (name) => ({+ slug: name.toLowerCase(),+ name,+ iconUrl: fixtureConnectorIcon(name.toLowerCase()),+ })),connectedTools: [],+ githubLinkStatus: 'unlinked',+ nativeTools: [],+ connectionFailures: [],githubStars: 12_345,inviteOffer: null,planCatalog: {@@ -222,9 +239,56 @@ export function createFakeOnboarding(retry: () => call('retryCatalog'),};},- createConnectedTools: () => () => new Set(world.connectedTools),- // Pipedream's hosted connect runs in an iframe, so no page round-trip.+ createConnectedTools: () => ({+ connected: () =>+ onboardingConnectedTools(+ new Set(world.connectedTools),+ world.nativeTools,+ world.githubLinkStatus === 'linked'+ ),+ state: (slug) =>+ onboardingToolState(+ slug,+ world.connectionFailures.includes('pipedream')+ ? { t: 'error' }+ : {+ t: 'ready',+ value: world.connectedTools.map((app_slug) => ({+ app_slug,+ enabled: true,+ })),+ },+ world.connectionFailures.includes('native')+ ? { t: 'error' }+ : { t: 'ready', value: world.nativeTools },+ world.connectionFailures.includes('github')+ ? { t: 'error' }+ : { t: 'ready', value: world.githubLinkStatus }+ ),+ retry: () => call('retryConnections'),+ }),+ configureGithubRepositories: () => call('configureGithubRepositories'),+ // Native GitHub OAuth returns to the current step; Pipedream stays in an iframe.connectTool: async (tool) => {+ if (tool.slug === 'github') {+ if (world.githubLinkStatus === 'linked') return;+ call('connectNativeGithub');+ return roundTrip(() =>+ update((draft) => {+ draft.githubLinkStatus = 'linked';+ })+ );+ }+ const native = world.nativeTools.find(+ (server) => server.authenticated && nativeToolSlug(server) === tool.slug+ );+ if (native) {+ update((draft) => {+ const server = draft.nativeTools.find((s) => s.url === native.url);+ if (server) server.enabled = true;+ });+ return;+ }call(`connectTool:${tool.slug}`);update((draft) => {draft.connectedTools.push(tool.slug);diff --git a/apps/web/src/features/onboarding/views/onboarding-flow-view.tsx b/apps/web/src/features/onboarding/views/onboarding-flow-view.tsxindex 0d9565810f..4b3ec2a3df 100644--- a/apps/web/src/features/onboarding/views/onboarding-flow-view.tsx+++ b/apps/web/src/features/onboarding/views/onboarding-flow-view.tsx@@ -51,7 +51,7 @@ export function OnboardingFlowView(props: {const accounts = emailAccounts.accounts();return {emails_connected: accounts.t === 'ready' ? accounts.value.length : 0,- connectors_connected: [...(connectedTools() ?? [])],+ connectors_connected: [...connectedTools.connected()],};},});diff --git a/apps/web/src/features/onboarding/views/tools-step.test.tsx b/apps/web/src/features/onboarding/views/tools-step.test.tsxnew file mode 100644index 0000000000..1fa083847a--- /dev/null+++ b/apps/web/src/features/onboarding/views/tools-step.test.tsx@@ -0,0 +1,114 @@+import { cleanup, fireEvent, screen, waitFor } from '@solidjs/testing-library';+import { afterEach, describe, expect, it, vi } from 'vitest';+import { renderWithFakeOnboarding } from '../tests/render';+import { ToolsStep } from './tools-step';++afterEach(cleanup);++describe('onboarding tools', () => {+ it('keeps Drive and Sheets available, hides excluded Google apps, and reuses native connections', async () => {+ const { fake } = renderWithFakeOnboarding(+ () => <ToolsStep onContinue={vi.fn()} />,+ {+ catalog: [+ ['gmail', 'Gmail'],+ ['google_sheets', 'Google Sheets'],+ ['google_drive', 'Google Drive'],+ ['google_calendar', 'Google Calendar'],+ ['linear', 'Linear'],+ ['notion', 'Notion'],+ ].map(([slug, name]) => ({ slug, name, iconUrl: null })),+ nativeTools: [+ {+ url: 'https://mcp.linear.app/mcp/',+ authenticated: true,+ enabled: false,+ server_name: 'My issues',+ },+ ],+ }+ );+ for (const name of ['Gmail', 'Google Calendar']) {+ expect(+ screen.queryByRole('button', { name: `Connect ${name}` })+ ).toBeNull();+ }+ const linear = screen.getByRole('button', {+ name: 'Enable Linear',+ }) as HTMLButtonElement;+ expect(linear.disabled).toBe(false);+ fireEvent.click(linear);+ expect(fake.calls()).not.toContain('connectTool:linear');+ expect(+ screen.getByRole('button', { name: 'Connected to Linear' })+ ).toBeTruthy();+ await waitFor(() =>+ expect(+ (+ screen.getByRole('button', {+ name: 'Connect Notion',+ }) as HTMLButtonElement+ ).disabled+ ).toBe(false)+ );+ fireEvent.input(screen.getByRole('searchbox'), {+ target: { value: 'Google' },+ });+ expect(+ screen.getAllByRole('button', { name: /Connect Google/ })+ ).toHaveLength(2);+ for (const name of ['Google Drive', 'Google Sheets']) {+ expect(+ (+ screen.getByRole('button', {+ name: `Connect ${name}`,+ }) as HTMLButtonElement+ ).disabled+ ).toBe(false);+ }+ });+});++it('keeps native GitHub available during hosted connection failures and offers retry', () => {+ const { fake } = renderWithFakeOnboarding(+ () => <ToolsStep onContinue={vi.fn()} />,+ {+ connectionFailures: ['pipedream'],+ catalog: [+ { slug: 'github', name: 'GitHub', iconUrl: null },+ { slug: 'stripe', name: 'Stripe', iconUrl: null },+ ],+ }+ );+ expect(+ (+ screen.getByRole('button', {+ name: 'Connect GitHub',+ }) as HTMLButtonElement+ ).disabled+ ).toBe(false);+ expect(+ (+ screen.getByRole('button', {+ name: 'Connect Stripe',+ }) as HTMLButtonElement+ ).disabled+ ).toBe(true);+ fireEvent.click(+ screen.getByRole('button', { name: 'Retry connection status' })+ );+ expect(fake.calls()).toContain('retryConnections');+});+it('distinguishes a linked GitHub account from repository setup', () => {+ const { fake } = renderWithFakeOnboarding(+ () => <ToolsStep onContinue={vi.fn()} />,+ { githubLinkStatus: 'linked' }+ );+ expect(+ screen.getByRole('button', { name: 'Account linked to GitHub' })+ ).toBeTruthy();+ fireEvent.click(+ screen.getByRole('button', { name: 'Configure GitHub repositories' })+ );+ expect(fake.calls()).toContain('configureGithubRepositories');+});diff --git a/apps/web/src/features/onboarding/views/tools-step.tsx b/apps/web/src/features/onboarding/views/tools-step.tsxindex 4b5430d506..25491d8fe8 100644--- a/apps/web/src/features/onboarding/views/tools-step.tsx+++ b/apps/web/src/features/onboarding/views/tools-step.tsx@@ -3,16 +3,22 @@ import { createSignal, For, Show } from 'solid-js';import { ContinueButton } from '../components/controls';import { ToolTile } from '../components/tool-tile';import { type Tool, useOnboardingContext } from '../context/onboarding-context';+import { orderOnboardingTools } from '../primitives/tools';/** Uses the same searchable, paginated catalog and hosted connection flow as Settings. */export function ToolsStep(props: { onContinue: () => void }) {const context = useOnboardingContext();const catalog = context.createToolCatalog();const connected = context.createConnectedTools({ poll: true });+ const entries = () => orderOnboardingTools(catalog.entries());const [busy, setBusy] = createSignal<string>();const connect = async (tool: Tool) => {- if (busy()) return;+ if (+ busy() ||+ !['available', 'disabled'].includes(connected.state(tool.slug))+ )+ return;setBusy(tool.slug);try {await context.connectTool(tool);@@ -42,18 +48,50 @@ export function ToolsStep(props: { onContinue: () => void }) {style={{ 'scrollbar-gutter': 'stable' }}><div class="grid grid-cols-3 gap-x-2 gap-y-5 sm:grid-cols-4">- <For each={catalog.entries()}>+ <For each={entries()}>{(tool) => (<ToolTiletool={tool}busy={busy() === tool.slug}- disabled={busy() !== undefined || connected() === undefined}- connected={connected()?.has(tool.slug) ?? false}+ disabled={+ busy() !== undefined ||+ ['loading', 'error'].includes(connected.state(tool.slug))+ }+ state={connected.state(tool.slug)}onConnect={() => void connect(tool)}/>)}</For></div>+ <Show+ when={entries().some(+ (tool) => connected.state(tool.slug) === 'error'+ )}+ >+ <p role="alert" class="py-4 text-center text-sm text-ink-muted">+ Couldn't check some connections.{' '}+ <button type="button" class="underline" onClick={connected.retry}>+ Retry connection status+ </button>+ </p>+ </Show>+ <Show+ when={+ entries().some((tool) => tool.slug === 'github') &&+ connected.state('github') === 'account-linked'+ }+ >+ <p class="py-4 text-center text-sm text-ink-muted">+ GitHub account linked. Choose repositories to sync with Macro.{' '}+ <button+ type="button"+ class="underline"+ onClick={context.configureGithubRepositories}+ >+ Configure GitHub repositories+ </button>+ </p>+ </Show><Show when={catalog.failed()}><p role="alert" class="py-6 text-center text-sm text-ink-muted">Couldn't load integrations.{' '}@@ -71,7 +109,8 @@ export function ToolsStep(props: { onContinue: () => void }) {when={!catalog.fetching() &&!catalog.failed() &&- catalog.entries().length === 0+ entries().length === 0 &&+ !catalog.hasMore()}><p class="py-6 text-center text-sm text-ink-muted">diff --git a/apps/web/src/features/tours/ViewTour.test.tsx b/apps/web/src/features/tours/ViewTour.test.tsxindex 726f8b5b7b..5f2ba97e36 100644--- a/apps/web/src/features/tours/ViewTour.test.tsx+++ b/apps/web/src/features/tours/ViewTour.test.tsx@@ -9,8 +9,12 @@ const wiring = vi.hoisted(() => ({userId: 'tour-user',settings: vi.fn(),links: [] as unknown[],- native: [] as { server_name: string; authenticated: boolean }[],- pipedream: [] as { server_name: string }[],+ native: [] as {+ server_name: string;+ authenticated: boolean;+ enabled: boolean;+ }[],+ pipedream: [] as { server_name: string; enabled: boolean }[],queries: vi.fn(),}));@@ -165,14 +169,17 @@ describe('ViewTour', () => {expect(wiring.settings).toHaveBeenCalledWith('Connected');view.unmount();- // Pipedream connections win over native rows, as the backend serves them.- wiring.native = [{ server_name: 'Linear', authenticated: true }];- wiring.pipedream = [{ server_name: 'notion' }];+ // A native connection remains usable alongside unrelated Pipedream apps.+ wiring.native = [+ { server_name: 'Linear', authenticated: true, enabled: true },+ ];+ wiring.pipedream = [{ server_name: 'notion', enabled: true }];const second = render(() => <ViewTour tour={linear} />);- expect(screen.getByRole('button', { name: 'Connect Linear' })).toBeTruthy();+ expect(screen.queryByRole('button', { name: 'Connect Linear' })).toBeNull();second.unmount();- wiring.pipedream = [{ server_name: 'linear' }];+ wiring.native = [];+ wiring.pipedream = [{ server_name: 'linear', enabled: true }];render(() => <ViewTour tour={linear} />);expect(screen.queryByRole('button', { name: 'Connect Linear' })).toBeNull();});diff --git a/apps/web/src/features/tours/core/connected-tools.ts b/apps/web/src/features/tours/core/connected-tools.tsindex aded45e804..4afc10d939 100644--- a/apps/web/src/features/tours/core/connected-tools.ts+++ b/apps/web/src/features/tours/core/connected-tools.ts@@ -1,11 +1,11 @@-type PipedreamConnection = { server_name: string };-type NativeServer = { server_name: string; authenticated: boolean };+type PipedreamConnection = { server_name: string; enabled: boolean };+type NativeServer = {+ server_name: string;+ authenticated: boolean;+ enabled: boolean;+};-/**- * Whether the named MCP tool is connected. Mirrors the backend's- * stack-selection rule (`mcp_select`): a user with any Pipedream connectors is- * served those, so native rows stop counting.- */+/** Whether either stack has an enabled connection for the named provider. */export function isMcpToolConnected(name: string,sources: {@@ -14,12 +14,16 @@ export function isMcpToolConnected(}) {const wanted = name.toLowerCase();- if (sources.pipedream.length > 0)- return sources.pipedream.some(- (connection) => connection.server_name.toLowerCase() === wanted- );- return sources.native.some(- (server) =>- server.authenticated && server.server_name.toLowerCase() === wanted+ return (+ sources.pipedream.some(+ (connection) =>+ connection.enabled && connection.server_name.toLowerCase() === wanted+ ) ||+ sources.native.some(+ (server) =>+ server.enabled &&+ server.authenticated &&+ server.server_name.toLowerCase() === wanted+ ));}diff --git a/apps/web/src/lib/core/component/AI/constant/mcpServers.ts b/apps/web/src/lib/core/component/AI/constant/mcpServers.tsindex 610e3aa039..fb15e11688 100644--- a/apps/web/src/lib/core/component/AI/constant/mcpServers.ts+++ b/apps/web/src/lib/core/component/AI/constant/mcpServers.ts@@ -1,8 +1,4 @@-import { DEV_MODE_ENV } from '@core/constant/featureFlags';-import {- SLACK_CONNECT_SLUG,- SLACK_PIPEDREAM_SLUGS,-} from '@core/pipedream/slugs';+import { SLACK_PIPEDREAM_SLUGS } from '@core/pipedream/slugs';import IconDatadog from '@icon/mcp-datadog.svg';import IconGithub from '@icon/mcp-github.svg';import IconGrafana from '@icon/mcp-grafana.svg';@@ -27,17 +23,12 @@ export const QUICK_CONNECT_SERVERS = [url: 'https://mcp.linear.app/mcp',icon: IconLinear as SvgIcon,},- // Slack is dev-only until the integration is ready for production.- ...(DEV_MODE_ENV- ? ([- {- server_name: 'Slack',- app_slug: SLACK_CONNECT_SLUG,- url: 'https://mcp.slack.com/mcp',- icon: IconSlack as SvgIcon,- },- ] as const)- : []),+ {+ server_name: 'Slack',+ app_slug: 'slack',+ url: 'https://mcp.slack.com/mcp',+ icon: IconSlack as SvgIcon,+ },{server_name: 'Notion',app_slug: 'notion',@@ -70,8 +61,7 @@ export type QuickConnectServer = (typeof QUICK_CONNECT_SERVERS)[number];* Preset servers surfaced directly on the Connections page (with a one-line* pitch) to encourage connecting — the only catalog now that the "Add server"* dialog is custom-URL only. Ordered by how much we want to promote each;- * presets absent from {@link QUICK_CONNECT_SERVERS} (e.g. dev-only Slack in- * production) are dropped automatically.+ * presets absent from {@link QUICK_CONNECT_SERVERS} are dropped automatically.*/const FEATURED_SERVER_TAGLINES: [name: string, tagline: string][] = [['Linear', 'Create and update issues without leaving Macro.'],@@ -87,6 +77,9 @@ export type FeaturedMcpServer = QuickConnectServer & { tagline: string };export const FEATURED_MCP_SERVERS: FeaturedMcpServer[] =FEATURED_SERVER_TAGLINES.flatMap(([name, tagline]) => {+ // Production Slack onboarding uses Pipedream. Keep direct Slack MCP+ // discovery gated until that separate OAuth integration is verified.+ if (name === 'Slack' && import.meta.env.MODE !== 'development') return [];const server = QUICK_CONNECT_SERVERS.find((s) => s.server_name === name);return server ? [{ ...server, tagline }] : [];});diff --git a/apps/web/src/lib/core/pipedream/ConnectorIcon.test.tsx b/apps/web/src/lib/core/pipedream/ConnectorIcon.test.tsxnew file mode 100644index 0000000000..a34f1bdeba--- /dev/null+++ b/apps/web/src/lib/core/pipedream/ConnectorIcon.test.tsx@@ -0,0 +1,26 @@+import { cleanup, fireEvent, render } from '@solidjs/testing-library';+import { createSignal } from 'solid-js';+import { afterEach, describe, expect, it } from 'vitest';+import { PipedreamConnectorIcon } from './ConnectorIcon';++afterEach(cleanup);++describe('Pipedream app logos', () => {+ it('prefers the proxied directory image, falls back on failure, and retries a new URL', () => {+ const url = 'https://pipedream.com/s.v0/app_example/logo/orig';+ const [iconUrl, setIconUrl] = createSignal(url);+ const { container } = render(() => (+ <PipedreamConnectorIcon appSlug="linear" iconUrl={iconUrl()} />+ ));+ const image = container.querySelector('img');+ expect(image?.getAttribute('src')).toContain(encodeURIComponent(url));+ expect(container.querySelector('svg')).toBeNull();+ fireEvent.error(image!);+ expect(container.querySelector('img')).toBeNull();+ expect(container.querySelector('svg')).not.toBeNull();+ setIconUrl(`${url}?updated=1`);+ expect(container.querySelector('img')?.getAttribute('src')).toContain(+ encodeURIComponent(`${url}?updated=1`)+ );+ });+});diff --git a/apps/web/src/lib/core/pipedream/ConnectorIcon.tsx b/apps/web/src/lib/core/pipedream/ConnectorIcon.tsxindex 2b14128b00..47968e2699 100644--- a/apps/web/src/lib/core/pipedream/ConnectorIcon.tsx+++ b/apps/web/src/lib/core/pipedream/ConnectorIcon.tsx@@ -1,13 +1,11 @@import { PIPEDREAM_ICON_MAP } from '@core/component/AI/constant/mcpServers';import { proxyImageUrl } from '@core/util/imageProxy';import PlugIcon from '@phosphor-icons/core/regular/plug.svg?component-solid';-import { Show } from 'solid-js';+import { createSignal, Show } from 'solid-js';/**- * Connector icon: our bundled SVG for the apps we ship icons for, the- * directory-provided icon otherwise, and a generic plug as the fallback.- * Directory icons load through the image proxy — the app's COEP blocks- * cross-origin images from hosts that don't send CORP headers.+ * Prefer the directory's current app logo, then a bundled icon, then a plug.+ * Directory images use the image proxy to satisfy the app's COEP policy.*/export function PipedreamConnectorIcon(props: {appSlug: string;@@ -15,28 +13,37 @@ export function PipedreamConnectorIcon(props: {/** Sizing for both the bundled SVG and the directory image. */class?: string;}) {+ const [failedUrl, setFailedUrl] = createSignal<string>();+ const iconUrl = () =>+ props.iconUrl !== failedUrl() ? props.iconUrl : undefined;const BundledIcon = () => PIPEDREAM_ICON_MAP.get(props.appSlug);const sizeClass = () => props.class ?? 'size-5';return (<Show- when={BundledIcon()}+ keyed+ when={iconUrl()}fallback={- <Show when={props.iconUrl} fallback={<PlugIcon class={sizeClass()} />}>- {(iconUrl) => (- <img- src={proxyImageUrl(iconUrl())}- alt=""- loading="lazy"- class={`${sizeClass()} rounded object-contain`}- />- )}+ <Show when={BundledIcon()} fallback={<PlugIcon class={sizeClass()} />}>+ {(Icon) => {+ const C = Icon();+ return <C class={sizeClass()} />;+ }}</Show>}>- {(Icon) => {- const C = Icon();- return <C class={sizeClass()} />;- }}+ {(url) => (+ <img+ src={proxyImageUrl(url)}+ alt=""+ loading="lazy"+ onError={() => setFailedUrl(url)}+ class={`${sizeClass()} rounded object-contain`}+ // Pipedream's Notion logo is black on transparent.+ classList={{+ 'invert light-mode:invert-0': props.appSlug === 'notion',+ }}+ />+ )}</Show>);}diff --git a/apps/web/src/lib/queries/auth/github-link.test.ts b/apps/web/src/lib/queries/auth/github-link.test.tsnew file mode 100644index 0000000000..7ee78e11d2--- /dev/null+++ b/apps/web/src/lib/queries/auth/github-link.test.ts@@ -0,0 +1,32 @@+import { err, ok } from 'neverthrow';+import { beforeEach, expect, it, vi } from 'vitest';+import { fetchGithubLinkStatus } from './github-link';++const mocks = vi.hoisted(() => ({ check: vi.fn() }));+vi.mock('@service-auth/client', () => ({+ authServiceClient: { checkGithubLinkStatus: mocks.check },+}));+vi.mock('@queries/client', () => ({ queryClient: {} }));+vi.mock('@queries/soup/normalized-cache', () => ({+ invalidateAllSoup: vi.fn(),+}));+beforeEach(() => vi.resetAllMocks());+it('only treats a confirmed missing account as unlinked', async () => {+ mocks.check.mockResolvedValue(err([{ code: 'NOT_FOUND' }]));+ expect(await fetchGithubLinkStatus()).toEqual({ status: 'unlinked' });+});+it.each(['SERVER_ERROR', 'UNAUTHORIZED', 'NETWORK_ERROR'])(+ 'preserves %s as a failure instead of asking for OAuth',+ async (code) => {+ mocks.check.mockResolvedValue(err([{ code }]));+ await expect(fetchGithubLinkStatus()).rejects.toBeDefined();+ }+);+it('preserves explicit reauthorization and linked states', async () => {+ mocks.check.mockResolvedValue(err([{ code: 'REAUTHENTICATION_REQUIRED' }]));+ expect(await fetchGithubLinkStatus()).toEqual({+ status: 'reauthentication_required',+ });+ mocks.check.mockResolvedValue(ok({ reauthentication_required: false }));+ expect((await fetchGithubLinkStatus()).status).toBe('linked');+});diff --git a/apps/web/src/lib/queries/auth/github-link.ts b/apps/web/src/lib/queries/auth/github-link.tsindex 7397dcc1be..8d7d3e341a 100644--- a/apps/web/src/lib/queries/auth/github-link.ts+++ b/apps/web/src/lib/queries/auth/github-link.ts@@ -1,4 +1,4 @@-import { throwOnErr } from '@core/util/result';+import { ThrownResultError, throwOnErr } from '@core/util/result';import { queryClient } from '@queries/client';import { invalidateAllSoup } from '@queries/soup/normalized-cache';import { authServiceClient } from '@service-auth/client';@@ -21,6 +21,8 @@ export type GithubLink = {type UseGithubLinkStatusQueryOptions = {enabled?: boolean | (() => boolean);+ refetchInterval?: number;+ refetchOnMount?: 'always';};function hasReauthenticationError(@@ -48,11 +50,11 @@ export async function fetchGithubLinkStatus(): Promise<GithubLink> {};}- return {- status: hasReauthenticationError(response.error)- ? 'reauthentication_required'- : 'unlinked',- };+ if (hasReauthenticationError(response.error))+ return { status: 'reauthentication_required' };+ if (response.error.some((error) => error.code === 'NOT_FOUND'))+ return { status: 'unlinked' };+ throw new ThrownResultError(response.error);}export function githubLinkStatusQueryOptions() {@@ -76,6 +78,8 @@ export function useGithubLinkStatusQuery(return {...githubLinkStatusQueryOptions(),enabled,+ refetchInterval: options?.refetchInterval,+ refetchOnMount: options?.refetchOnMount,};});}diff --git a/apps/web/src/lib/queries/mcp-servers.ts b/apps/web/src/lib/queries/mcp-servers.tsindex 3544b2a49b..a5926002b1 100644--- a/apps/web/src/lib/queries/mcp-servers.ts+++ b/apps/web/src/lib/queries/mcp-servers.ts@@ -23,6 +23,10 @@ function fetchMcpServers() {);}+export function mcpServersQueryOptions() {+ return { queryKey: KEYS.list, queryFn: fetchMcpServers };+}+export function useMcpServersQuery(options?: {/*** Poll for connection changes. OAuth finishes in another tab, and if this@@ -41,8 +45,7 @@ export function useMcpServersQuery(options?: {neverSuspend?: boolean;}) {return useQuery(() => ({- queryKey: KEYS.list,- queryFn: fetchMcpServers,+ ...mcpServersQueryOptions(),refetchOnMount: 'always' as const,refetchOnWindowFocus: 'always' as const,refetchInterval: options?.refetchInterval,diff --git a/apps/web/src/lib/queries/pipedream-connectors.ts b/apps/web/src/lib/queries/pipedream-connectors.tsindex 5826ad9913..afbbd6dde0 100644--- a/apps/web/src/lib/queries/pipedream-connectors.ts+++ b/apps/web/src/lib/queries/pipedream-connectors.ts@@ -1,4 +1,5 @@import { openPipedreamConnectUI } from '@core/pipedream/connect-ui';+import { pipedreamSlugsMatch } from '@core/pipedream/slugs';import { ThrownResultError, throwOnErr } from '@core/util/result';import { queryClient } from '@queries/client';import { queryReadyGate } from '@queries/gate';@@ -34,6 +35,10 @@ function fetchPipedreamConnections() {);}+export function pipedreamConnectionsQueryOptions() {+ return { queryKey: KEYS.list, queryFn: fetchPipedreamConnections };+}+export function usePipedreamConnectionsQuery(options?: {/*** Poll for connection changes. Connecting finishes in the Connect UI@@ -45,8 +50,7 @@ export function usePipedreamConnectionsQuery(options?: {neverSuspend?: boolean;}) {return useQuery(() => ({- queryKey: KEYS.list,- queryFn: fetchPipedreamConnections,+ ...pipedreamConnectionsQueryOptions(),refetchOnMount: 'always' as const,refetchOnWindowFocus: 'always' as const,refetchInterval: options?.refetchInterval,@@ -236,7 +240,10 @@ export async function connectPipedreamApp(args: {server_name: args.serverName,}));- if (connection.app_slug !== args.appSlug || !connection.enabled) {+ if (+ !pipedreamSlugsMatch(connection.app_slug, args.appSlug) ||+ !connection.enabled+ ) {throw new Error('The requested connector was not enabled');}upsertConnection(connection);diff --git a/crates/agent_harness/Cargo.toml b/crates/agent_harness/Cargo.tomlindex c1bd6388f9..e42c5974ce 100644--- a/crates/agent_harness/Cargo.toml+++ b/crates/agent_harness/Cargo.toml@@ -52,6 +52,7 @@ kafka_util = { path = "../kafka_util" }macro_env_var = { path = "../macro_env_var" }# The owner's custom MCP server rows, listed so a sandbox can be told they exist.mcp_client = { path = "../mcp_client" }+mcp_select = { path = "../mcp_select" }pipedream_mcp = { path = "../pipedream_mcp" }macro_event_broker = { path = "../macro_event_broker", features = ["outbound"] }macro_authorization = { path = "../macro_authorization", features = ["axum"] }diff --git a/crates/agent_harness/src/outbound/egress.rs b/crates/agent_harness/src/outbound/egress.rsindex 0bde1ac1b5..e52b380a63 100644--- a/crates/agent_harness/src/outbound/egress.rs+++ b/crates/agent_harness/src/outbound/egress.rs@@ -60,116 +60,48 @@ whereself}- /// The slugs to advertise for one session, verbatim.- ///- /// `app_slug`, exactly as the proxy resolves it - the same value at both- /// ends by equality is what makes a server entry dialable, and there is- /// no derivation for the two to disagree over. Macro's own server is not- /// in the list: every session has it, on its own route.- ///- /// Under [`AgentMcpServers::OwnerConnections`] an app the owner turned- /// off is left out here as well as refused by the proxy: an agent that- /// can see a server in its list will try it, and a call the proxy answers- /// with a bare "no such server" is worse than a tool that is absent.- ///- /// Under [`AgentMcpServers::Selected`] the agent's list is advertised- /// whole, including apps the owner has not connected. That is deliberate,- /// and the reason the proxy answers those differently: a call to a- /// selected-but-unconnected app comes back as a tool result that says so- /// and names the fix, which the model can act on, and the moment the- /// owner connects the app the same advertised server starts working with- /// nothing re-attached.- async fn advertised(+ // Both runtime hosts use mcp_select's provider policy. This adapter only+ // loads owner-scoped rows and converts the result to proxy addresses.+ async fn advertised_all(&self,owner: &MacroUserIdStr<'static>,selection: &AgentMcpServers,- ) -> Result<Vec<McpServerSlug>> {- let raw: Vec<String> = match selection {- AgentMcpServers::OwnerConnections => self- .connections- .list(owner)- .await- .map_err(|error| {- HarnessError::Egress(rootcause::report!(- "could not list Pipedream connections: {error:?}"- ))- })?+ ) -> Result<(Vec<McpServerSlug>, Vec<CustomMcpServerListing>)> {+ // Selected-agent permissions are unchanged: advertise the author's+ // explicit list and never add the owner's private servers to it.+ if let AgentMcpServers::Selected { servers } = selection {+ return Ok((+ servers+ .iter()+ .filter_map(|server| McpServerSlug::parse(&server.app_slug))+ .collect(),+ Vec::new(),+ ));+ }+ let native = self.custom_servers.list(owner).await.map_err(|error| {+ HarnessError::Egress(rootcause::report!(+ "could not list custom MCP servers: {error:?}"+ ))+ })?;+ let pipedream = self.connections.list(owner).await.map_err(|error| {+ HarnessError::Egress(rootcause::report!(+ "could not list Pipedream connections: {error:?}"+ ))+ })?;+ let (native, pipedream) = mcp_select::select_connections(native, pipedream);+ Ok((+ pipedream.into_iter()- .filter(|record| record.enabled)- .map(|record| record.app_slug)+ .filter_map(|r| McpServerSlug::parse(&r.app_slug)).collect(),- AgentMcpServers::Selected { servers } => servers- .iter()- .map(|server| server.app_slug.clone())+ native+ .into_iter()+ .map(|r| CustomMcpServerListing {+ key: CustomMcpServerKey::for_url(&r.url),+ name: r.server_name,+ }).collect(),- };-- let slugs: Vec<McpServerSlug> = raw- .into_iter()- .filter_map(|app_slug| {- let slug = McpServerSlug::parse(&app_slug);- if slug.is_none() {- // An app slug the strict parse refuses could never be- // dialed - the proxy would refuse the same path segment -- // so leaving it out is the only honest rendering.- tracing::warn!(- %owner,- %app_slug,- "an MCP server's app slug is not a valid path segment; skipped"- );- }- slug- })- .collect();- tracing::debug!(- mcp_servers = slugs.len(),- scope = selection.scope_str(),- "advertising MCP servers"- );- Ok(slugs)- }-- /// The owner's custom MCP servers to advertise for one session.- ///- /// Only under [`AgentMcpServers::OwnerConnections`]: a session that runs- /// with the owner's connections gets the owner's own servers too, by the- /// same reasoning. A [`AgentMcpServers::Selected`] list is an agent- /// author's deliberate choice of apps, and the owner's private servers- /// are not something an author can select, so none are added behind it.- ///- /// A server the owner turned off is left out, as with apps. One that is- /// on but whose connection has lapsed is still listed: the proxy answers- /// its calls with a tool result naming the fix, which the model can act- /// on, where an absent tool could only be silently missing.- async fn advertised_custom(- &self,- owner: &MacroUserIdStr<'static>,- selection: &AgentMcpServers,- ) -> Result<Vec<CustomMcpServerListing>> {- let AgentMcpServers::OwnerConnections = selection else {- return Ok(Vec::new());- };- let listings: Vec<CustomMcpServerListing> = self- .custom_servers- .list(owner)- .await- .map_err(|error| {- HarnessError::Egress(rootcause::report!(- "could not list custom MCP servers: {error:?}"- ))- })?- .into_iter()- .filter(|record| record.enabled)- .map(|record| CustomMcpServerListing {- key: CustomMcpServerKey::for_url(&record.url),- name: record.server_name,- })- .collect();- tracing::debug!(- custom_servers = listings.len(),- "advertising custom MCP servers"- );- Ok(listings)+ ))}}@@ -200,14 +132,15 @@ whereselection: &AgentMcpServers,) -> Result<ProvisionedEgress> {let token = SessionToken::mint();+ let (mcp_servers, custom_servers) = self.advertised_all(owner, selection).await?;Ok(ProvisionedEgress {session_token_hash: token.hash(),sandbox: SandboxEgress {base_url: self.base_url.clone(),session_token: token.as_str().to_owned(),- mcp_servers: self.advertised(owner, selection).await?,- custom_servers: self.advertised_custom(owner, selection).await?,+ mcp_servers,+ custom_servers,},})}@@ -219,11 +152,12 @@ wheresession_token: String,selection: &AgentMcpServers,) -> Result<SandboxEgress> {+ let (mcp_servers, custom_servers) = self.advertised_all(owner, selection).await?;Ok(SandboxEgress {base_url: self.base_url.clone(),session_token,- mcp_servers: self.advertised(owner, selection).await?,- custom_servers: self.advertised_custom(owner, selection).await?,+ mcp_servers,+ custom_servers,})}}diff --git a/crates/agent_harness/src/outbound/egress/test.rs b/crates/agent_harness/src/outbound/egress/test.rsindex ae50282237..e433bd8e54 100644--- a/crates/agent_harness/src/outbound/egress/test.rs+++ b/crates/agent_harness/src/outbound/egress/test.rs@@ -508,3 +508,41 @@ fn external_runtime_uses_host_reachable_urls_with_the_existing_session_credentia}assert_eq!(sandbox.base_url, "https://egress.macro.com");}++#[tokio::test]+async fn native_provider_wins_without_hiding_other_hosted_apps() {+ let mut native = custom_server("https://mcp.linear.app/mcp", "Linear", true);+ native.credentials = Some(+ serde_json::from_value(serde_json::json!({"client_id":"test","token_response":null}))+ .unwrap(),+ );+ let provisioner = EgressProvisioner::new(+ Arc::new(FixedConnections(vec![+ connection("linear", true),+ connection("stripe", true),+ connection("slack", true),+ connection("slack_v2", true),+ ])),+ Arc::new(FixedServers(vec![native])),+ "https://egress.macro.com",+ );+ let provisioned = provisioner+ .provision(+ AgentSessionId::new(),+ &MacroUserIdStr::try_from_email("[email protected]").unwrap(),+ &AgentMcpServers::OwnerConnections,+ )+ .await+ .unwrap();+ assert_eq!(+ provisioned+ .sandbox+ .mcp_servers+ .iter()+ .map(ToString::to_string)+ .collect::<Vec<_>>(),+ ["stripe", "slack"]+ );+ assert_eq!(provisioned.sandbox.custom_servers.len(), 1);+ assert_eq!(provisioned.sandbox.custom_servers[0].name, "Linear");+}diff --git a/crates/mcp_client/src/domain/service/toolset.rs b/crates/mcp_client/src/domain/service/toolset.rsindex 81d9d310f9..ff0d2fa5db 100644--- a/crates/mcp_client/src/domain/service/toolset.rs+++ b/crates/mcp_client/src/domain/service/toolset.rs@@ -270,6 +270,11 @@ impl McpToolSet {}}+ /// Whether this toolset owns a mangled name, without cloning its catalog.+ pub fn contains_tool(&self, name: &str) -> bool {+ self.tools.contains_key(&MangledName(name.to_owned()))+ }+/// Returns `true` when no tools were discovered.pub fn is_empty(&self) -> bool {self.tools.is_empty()diff --git a/crates/mcp_select/Cargo.toml b/crates/mcp_select/Cargo.tomlindex c823fb6bf5..fe699607bd 100644--- a/crates/mcp_select/Cargo.toml+++ b/crates/mcp_select/Cargo.toml@@ -5,6 +5,7 @@ edition = "2024"publish = false[dependencies]+futures.workspace = trueai_toolset = { path = "../ai_toolset" }anyhow.workspace = truemacro_user_id = { path = "../macro_user_id" }@@ -16,3 +17,5 @@ workspace-hack = { version = "0.1", path = "../workspace-hack" }[dev-dependencies]tokio.workspace = true+axum.workspace = true+rmcp = { workspace = true, features = ["client", "transport-streamable-http-client-reqwest"] }diff --git a/crates/mcp_select/src/lib.rs b/crates/mcp_select/src/lib.rsindex c11230e044..3384d57c6f 100644--- a/crates/mcp_select/src/lib.rs+++ b/crates/mcp_select/src/lib.rs@@ -1,15 +1,8 @@#![deny(missing_docs)]-//! Selection between the two MCP connector stacks.+//! Per-provider selection and composition of native and Pipedream MCP tools.//!-//! The native stack (`mcp_client`: in-house OAuth, servers connected-//! by URL) and the Pipedream stack (`pipedream_mcp`: apps connected through-//! Pipedream Connect) are deliberately separate — separate endpoints,-//! tables, and toolsets. The one place they must meet is deciding which-//! tools a user's agent actually gets. This crate owns that rule:-//!-//! 1. Load the configured stacks' connectors.-//! 2. If Pipedream is configured and the user has any of its connectors, use only those.-//! 3. Otherwise, use the native connectors.+//! Enabled native connections take precedence for known providers. Other+//! enabled Pipedream apps remain available, with one connection per provider.use ai_toolset::{AsyncToolCollection, RequestContext, RequestSchema, SearchableTool, ToolInfo, ToolResult,@@ -20,7 +13,12 @@ use mcp_client::domain::ports::McpServerStore;use mcp_client::domain::service::McpToolSet;use pipedream_mcp::domain::ports::{ConnectionStore, McpConnection};use pipedream_mcp::domain::service::PipedreamToolSet;+use std::collections::HashSet;use std::pin::Pin;++mod selection;+use selection::native_matches;+pub use selection::select_connections;use std::sync::Arc;#[cfg(test)]@@ -47,13 +45,19 @@ impl ConnectorRef<'_> {}}-/// The MCP tools loaded for a user — from exactly one stack, per the-/// selection rule above.+/// The MCP tools loaded for a user, composed across both connection stacks.pub enum UserMcpTools {/// Tools served by Pipedream's remote MCP server.Pipedream(PipedreamToolSet),/// Tools served by directly-connected (native) MCP servers.Native(McpToolSet),+ /// Disjoint providers served by the two stacks; native wins name collisions.+ Mixed {+ /// Directly connected providers.+ native: McpToolSet,+ /// Remaining hosted providers.+ pipedream: PipedreamToolSet,+ },}impl UserMcpTools {@@ -62,6 +66,7 @@ impl UserMcpTools {match self {UserMcpTools::Pipedream(tools) => tools.is_empty(),UserMcpTools::Native(tools) => tools.is_empty(),+ UserMcpTools::Mixed { native, pipedream } => native.is_empty() && pipedream.is_empty(),}}@@ -70,6 +75,17 @@ impl UserMcpTools {match self {UserMcpTools::Pipedream(tools) => tools.searchable_catalog(),UserMcpTools::Native(tools) => tools.searchable_catalog(),+ UserMcpTools::Mixed { native, pipedream } => {+ let mut catalog = native.searchable_catalog();+ let names: HashSet<_> = catalog.iter().map(|tool| tool.name.clone()).collect();+ catalog.extend(+ pipedream+ .searchable_catalog()+ .into_iter()+ .filter(|tool| !names.contains(&tool.name)),+ );+ catalog+ }}}}@@ -91,6 +107,13 @@ impl<Context: Send + Sync + 'static> ToolSet<Context> for UserMcpTools {UserMcpTools::Native(tools) => {tools.dispatch_tool_call(context, request_context, tool_name, json)}+ UserMcpTools::Mixed { native, pipedream } => {+ if native.contains_tool(tool_name) {+ native.dispatch_tool_call(context, request_context, tool_name, json)+ } else {+ pipedream.dispatch_tool_call(context, request_context, tool_name, json)+ }+ }}}@@ -98,6 +121,18 @@ impl<Context: Send + Sync + 'static> ToolSet<Context> for UserMcpTools {match self {UserMcpTools::Pipedream(tools) => ToolSet::<Context>::request_schemas(tools),UserMcpTools::Native(tools) => ToolSet::<Context>::request_schemas(tools),+ UserMcpTools::Mixed { .. } => {+ let schemas: Vec<_> = self+ .catalog()+ .into_iter()+ .map(|tool| RequestSchema {+ name: tool.name,+ description: tool.description,+ schema: tool.schema,+ })+ .collect();+ (!schemas.is_empty()).then_some(schemas)+ }}}@@ -109,6 +144,13 @@ impl<Context: Send + Sync + 'static> ToolSet<Context> for UserMcpTools {match self {UserMcpTools::Pipedream(tools) => ToolSet::<Context>::searchable_toolset_names(tools),UserMcpTools::Native(tools) => ToolSet::<Context>::searchable_toolset_names(tools),+ UserMcpTools::Mixed { native, pipedream } => {+ let mut names = ToolSet::<Context>::searchable_toolset_names(native);+ names.extend(ToolSet::<Context>::searchable_toolset_names(pipedream));+ names.sort();+ names.dedup();+ names+ }}}@@ -120,6 +162,13 @@ impl<Context: Send + Sync + 'static> ToolSet<Context> for UserMcpTools {UserMcpTools::Native(tools) => {ToolSet::<Context>::routing_description(tools, tool_name)}+ UserMcpTools::Mixed { native, pipedream } => {+ if native.contains_tool(tool_name) {+ ToolSet::<Context>::routing_description(native, tool_name)+ } else {+ ToolSet::<Context>::routing_description(pipedream, tool_name)+ }+ }}}}@@ -127,7 +176,7 @@ impl<Context: Send + Sync + 'static> ToolSet<Context> for UserMcpTools {/// Port for consumers (imports, onboarding) that need per-connector tools/// or connection state without knowing which stack serves them.pub trait ConnectorSelect: Send + Sync + 'static {- /// Load the user's full MCP toolset (all connectors, one stack).+ /// Load the user's full MCP toolset (all enabled providers, across both stacks).fn user_toolset(&self,user: &MacroUserIdStr<'static>,@@ -213,19 +262,26 @@ where#[tracing::instrument(skip_all)]async fn user_toolset(&self, user: &MacroUserIdStr<'static>) -> UserMcpTools {let pipedream = self.pipedream_connections(user).await;- if !pipedream.is_empty() {- return UserMcpTools::Pipedream(- PipedreamToolSet::new(&pipedream, self.pipedream_connection.clone()).await,- );- }-let native = self.native_store.list(user).await.inspect_err(|e| tracing::warn!(error = ?e, "failed to list native MCP servers")).unwrap_or_default();- UserMcpTools::Native(McpToolSet::new(&native, self.native_store.clone()).await)+ let (native, pipedream) = select_connections(native, pipedream);+ if native.is_empty() {+ return UserMcpTools::Pipedream(+ PipedreamToolSet::new(&pipedream, self.pipedream_connection.clone()).await,+ );+ }+ if pipedream.is_empty() {+ return UserMcpTools::Native(McpToolSet::new(&native, self.native_store.clone()).await);+ }+ let (native, pipedream) = futures::join!(+ McpToolSet::new(&native, self.native_store.clone()),+ PipedreamToolSet::new(&pipedream, self.pipedream_connection.clone()),+ );+ UserMcpTools::Mixed { native, pipedream }}#[tracing::instrument(skip(self, user), err)]@@ -234,47 +290,36 @@ whereuser: &MacroUserIdStr<'static>,connector: ConnectorRef<'_>,) -> anyhow::Result<Option<UserMcpTools>> {+ let native = self+ .native_store+ .list(user)+ .await+ .map_err(|e| anyhow::anyhow!("mcp store: {e:?}"))?;+ if let Some(record) = native.into_iter().find(|r| native_matches(r, connector)) {+ return Ok(Some(UserMcpTools::Native(+ McpToolSet::new(&[record], self.native_store.clone()).await,+ )));+ }let pipedream = self.pipedream_connections(user).await;- if !pipedream.is_empty() {- // The user is on the Pipedream stack: native connectors are- // ignored even if this particular app isn't connected there.- // Prefer one alias by slug order: two Slack sessions would- // duplicate tool names when both `slack` and `slack_v2` are connected.- let matching = pipedream- .iter()- .filter(|c| connector.matches_pipedream_slug(&c.app_slug))- .min_by_key(|c| {- connector- .pipedream_app_slugs- .iter()- .position(|slug| *slug == c.app_slug)- });- let Some(matching) = matching else {- return Ok(None);- };- return Ok(Some(UserMcpTools::Pipedream(+ let matching = pipedream+ .iter()+ .filter(|r| r.enabled && connector.matches_pipedream_slug(&r.app_slug))+ .min_by_key(|r| {+ connector+ .pipedream_app_slugs+ .iter()+ .position(|slug| *slug == r.app_slug)+ });+ match matching {+ Some(record) => Ok(Some(UserMcpTools::Pipedream(PipedreamToolSet::new(- std::slice::from_ref(matching),+ std::slice::from_ref(record),self.pipedream_connection.clone(),).await,- )));- }-- let matching: Vec<_> = self- .native_store- .list(user)- .await- .map_err(|e| anyhow::anyhow!("mcp store: {e:?}"))?- .into_iter()- .filter(|r| r.url == connector.native_server_url)- .collect();- if matching.is_empty() {- return Ok(None);+ ))),+ None => Ok(None),}- Ok(Some(UserMcpTools::Native(- McpToolSet::new(&matching, self.native_store.clone()).await,- )))}#[tracing::instrument(skip(self, user), err)]@@ -283,21 +328,19 @@ whereuser: &MacroUserIdStr<'static>,connector: ConnectorRef<'_>,) -> anyhow::Result<bool> {- let pipedream = self.pipedream_connections(user).await;- if !pipedream.is_empty() {- return Ok(pipedream- .iter()- .any(|c| connector.matches_pipedream_slug(&c.app_slug)));- }-let native = self.native_store.list(user).await.map_err(|e| anyhow::anyhow!("mcp store: {e:?}"))?;- Ok(native+ if native.iter().any(|r| native_matches(r, connector)) {+ return Ok(true);+ }+ Ok(self+ .pipedream_connections(user)+ .await.iter()- .any(|r| r.credentials.is_some() && r.url == connector.native_server_url))+ .any(|r| r.enabled && connector.matches_pipedream_slug(&r.app_slug)))}}diff --git a/crates/mcp_select/src/selection.rs b/crates/mcp_select/src/selection.rsnew file mode 100644index 0000000000..7051348b78--- /dev/null+++ b/crates/mcp_select/src/selection.rs@@ -0,0 +1,95 @@+//! Provider identity and selection policy. Display names are editable and never identities.+use super::ConnectorRef;+use mcp_client::domain::models::McpServerRecord;+use pipedream_mcp::domain::models::PipedreamConnection;+use std::collections::HashSet;++// Keep provider endpoints aligned with the web native connection presets.+const PROVIDERS: &[ConnectorRef<'static>] = &[+ ConnectorRef {+ pipedream_app_slugs: &["github"],+ native_server_url: "https://api.githubcopilot.com/mcp",+ },+ ConnectorRef {+ pipedream_app_slugs: &["linear"],+ native_server_url: "https://mcp.linear.app/mcp",+ },+ ConnectorRef {+ pipedream_app_slugs: &["notion"],+ native_server_url: "https://mcp.notion.com/mcp",+ },+ ConnectorRef {+ pipedream_app_slugs: &["slack", "slack_v2"],+ native_server_url: "https://mcp.slack.com/mcp",+ },+ ConnectorRef {+ pipedream_app_slugs: &["posthog"],+ native_server_url: "https://mcp.posthog.com/mcp",+ },+ ConnectorRef {+ pipedream_app_slugs: &["datadog"],+ native_server_url: "https://mcp.datadoghq.com/mcp",+ },+ ConnectorRef {+ pipedream_app_slugs: &["grafana"],+ native_server_url: "https://mcp.grafana.com/mcp",+ },+];++fn same_endpoint(a: &str, b: &str) -> bool {+ a.trim_end_matches('/') == b.trim_end_matches('/')+}++pub(super) fn native_matches(record: &McpServerRecord, connector: ConnectorRef<'_>) -> bool {+ record.enabled+ && record.credentials.is_some()+ && same_endpoint(&record.url, connector.native_server_url)+}++/// Choose enabled connections once per provider, preferring native credentials.+/// Custom native endpoints with no known hosted equivalent remain available.+pub fn select_connections(+ native: Vec<McpServerRecord>,+ mut pipedream: Vec<PipedreamConnection>,+) -> (Vec<McpServerRecord>, Vec<PipedreamConnection>) {+ let mut endpoints = HashSet::new();+ let native: Vec<_> = native+ .into_iter()+ .filter(|r| {+ r.enabled+ && (!PROVIDERS+ .iter()+ .any(|p| same_endpoint(&r.url, p.native_server_url))+ || r.credentials.is_some())+ && endpoints.insert(r.url.trim_end_matches('/').to_owned())+ })+ .collect();+ // Prefer canonical aliases independently of database row order.+ pipedream.sort_by_key(|r| {+ PROVIDERS+ .iter()+ .find_map(|p| p.pipedream_app_slugs.iter().position(|s| *s == r.app_slug))+ .unwrap_or(0)+ });+ let mut providers = HashSet::new();+ pipedream.retain(|r| {+ if !r.enabled {+ return false;+ }+ let provider = PROVIDERS+ .iter()+ .find(|p| p.matches_pipedream_slug(&r.app_slug));+ if provider.is_some_and(|p| native.iter().any(|n| native_matches(n, *p))) {+ return false;+ }+ providers.insert(+ provider+ .map_or(r.app_slug.as_str(), |p| p.pipedream_app_slugs[0])+ .to_owned(),+ )+ });+ (native, pipedream)+}++#[cfg(test)]+mod test;diff --git a/crates/mcp_select/src/selection/test.rs b/crates/mcp_select/src/selection/test.rsnew file mode 100644index 0000000000..fe4987beff--- /dev/null+++ b/crates/mcp_select/src/selection/test.rs@@ -0,0 +1,75 @@+use super::*;+use macro_user_id::user_id::MacroUserIdStr;++fn native(url: &str, enabled: bool, authenticated: bool) -> McpServerRecord {+ McpServerRecord {+ user_id: MacroUserIdStr::parse_from_str("macro|[email protected]").unwrap(),+ url: url.to_owned(),+ server_name: "Renamed by user".into(),+ enabled,+ credentials: authenticated.then(|| {+ serde_json::from_value(serde_json::json!({"client_id":"test", "token_response":null}))+ .unwrap()+ }),+ }+}+fn pd(slug: &str, enabled: bool) -> PipedreamConnection {+ PipedreamConnection {+ user_id: MacroUserIdStr::parse_from_str("macro|[email protected]").unwrap(),+ app_slug: slug.into(),+ server_name: slug.into(),+ account_id: "account".into(),+ enabled,+ }+}++#[test]+fn native_and_pipedream_providers_coexist_without_duplicates() {+ let (native, pd) = select_connections(+ vec![+ native("https://mcp.linear.app/mcp/", true, true),+ native("https://mcp.linear.app/mcp", true, true),+ ],+ vec![+ pd("linear", true),+ pd("stripe", true),+ pd("slack_v2", true),+ pd("slack", true),+ ],+ );+ assert_eq!(native.len(), 1);+ assert_eq!(+ pd.iter().map(|r| r.app_slug.as_str()).collect::<Vec<_>>(),+ ["stripe", "slack"]+ );+}++#[test]+fn disabled_or_unauthenticated_native_does_not_hide_enabled_pipedream() {+ for (enabled, authenticated) in [(false, true), (true, false)] {+ let (native, pd) = select_connections(+ vec![native("https://mcp.linear.app/mcp", enabled, authenticated)],+ vec![pd("linear", true), pd("stripe", false)],+ );+ assert!(native.is_empty());+ assert_eq!(pd.len(), 1);+ assert_eq!(pd[0].app_slug, "linear");+ }+}++#[test]+fn disabled_alias_does_not_shadow_enabled_alias() {+ let (_, pd) = select_connections(vec![], vec![pd("slack", false), pd("slack_v2", true)]);+ assert_eq!(pd.len(), 1);+ assert_eq!(pd[0].app_slug, "slack_v2");+}++#[test]+fn unrelated_custom_servers_are_preserved_and_do_not_match_by_display_name() {+ let (native, pd) = select_connections(+ vec![native("https://example.com/mcp", true, false)],+ vec![pd("linear", true)],+ );+ assert_eq!(native.len(), 1);+ assert_eq!(pd.len(), 1);+}diff --git a/crates/mcp_select/src/test.rs b/crates/mcp_select/src/test.rsindex 5ff0a41237..6699c310a3 100644--- a/crates/mcp_select/src/test.rs+++ b/crates/mcp_select/src/test.rs@@ -66,10 +66,6 @@ impl McpServerStore for FakeStore {}async fn list(&self, _: &MacroUserIdStr<'static>) -> Result<Vec<McpServerRecord>, Self::Err> {- assert!(- self.connections.is_empty() || !self.native_records.is_empty(),- "Pipedream connections exclude the native stack"- );Ok(self.native_records.clone())}}@@ -145,7 +141,7 @@ async fn unconfigured_pipedream_preserves_native_connector_selection() {assert!(matches!(selector.user_toolset(&user()).await,- UserMcpTools::Native(_)+ UserMcpTools::Pipedream(_)));for connector in connectors {assert!(matches!(@@ -153,7 +149,7 @@ async fn unconfigured_pipedream_preserves_native_connector_selection() {.connector_toolset(&user(), connector).await.unwrap(),- Some(UserMcpTools::Native(_))+ None));assert!(!selector@@ -166,7 +162,7 @@ async fn unconfigured_pipedream_preserves_native_connector_selection() {}#[tokio::test]-async fn configured_optional_pipedream_keeps_precedence_over_native() {+async fn configured_optional_pipedream_remains_available() {let configured = selector(&["slack"]);let selector = McpToolSelector::new(configured.native_store,@@ -291,3 +287,142 @@ async fn empty_alias_list_does_not_match() {.is_empty());}++#[tokio::test]+async fn native_status_survives_unrelated_pipedream_connection() {+ let mut selector = selector(&["stripe"]);+ selector.native_store = Arc::new(FakeStore {+ connections: vec![],+ native_records: vec![McpServerRecord {+ user_id: user(),+ url: SLACK.native_server_url.into(),+ server_name: "Renamed".into(),+ enabled: true,+ credentials: Some(+ serde_json::from_value(+ serde_json::json!({"client_id":"test", "token_response":null}),+ )+ .unwrap(),+ ),+ }],+ });+ assert!(selector.connector_connected(&user(), SLACK).await.unwrap());+}++#[tokio::test]+async fn disabled_pipedream_is_not_connected_or_dispatched() {+ let mut selector = selector(&["slack"]);+ let mut records = selector.pipedream_store.connections.clone();+ records[0].enabled = false;+ selector.pipedream_store = Arc::new(FakeStore {+ connections: records,+ native_records: vec![],+ });+ assert!(!selector.connector_connected(&user(), SLACK).await.unwrap());+ assert!(+ selector+ .connector_toolset(&user(), SLACK)+ .await+ .unwrap()+ .is_none()+ );+}++// Real MCP clients against a local JSON-RPC server exercise discovery and+// dispatch on both stacks without requiring third-party credentials.+async fn mock_mcp(axum::Json(request): axum::Json<serde_json::Value>) -> axum::response::Response {+ use axum::response::IntoResponse;+ let Some(id) = request.get("id") else {+ return axum::http::StatusCode::ACCEPTED.into_response();+ };+ let result = match request["method"].as_str().unwrap_or_default() {+ "initialize" => serde_json::json!({+ "protocolVersion": "2025-03-26", "capabilities": {"tools": {}},+ "serverInfo": {"name": "test", "version": "1"}+ }),+ "tools/list" => serde_json::json!({"tools":[{+ "name":"ping", "description":"Test tool", "inputSchema":{"type":"object","properties":{}}+ }]}),+ "tools/call" => {+ serde_json::json!({"content":[{"type":"text","text":"pong"}], "isError":false})+ }+ _ => serde_json::json!({}),+ };+ axum::Json(serde_json::json!({"jsonrpc":"2.0", "id":id, "result":result})).into_response()+}++struct HttpConnection(String);+impl McpConnection for HttpConnection {+ fn is_configured(&self) -> bool {+ true+ }++ async fn connect(&self, _: &PipedreamConnection) -> anyhow::Result<McpServer> {+ use rmcp::ServiceExt;+ Ok(mcp_client::domain::models::client_info()+ .serve(rmcp::transport::StreamableHttpClientTransport::from_uri(+ self.0.clone(),+ ))+ .await?)+ }+}++#[tokio::test]+async fn mixed_stack_discovers_and_dispatches_both_and_deduplicates_names() {+ tokio::time::timeout(std::time::Duration::from_secs(15), async {+ let listener = tokio::net::TcpListener::bind("127.0.0.1:0").await.unwrap();+ let url = format!("http://{}/mcp", listener.local_addr().unwrap());+ let server = tokio::spawn(async move {+ axum::serve(+ listener,+ axum::Router::new().route("/mcp", axum::routing::post(mock_mcp)),+ )+ .await+ .unwrap();+ });+ for hosted_name in ["Hosted", "Native"] {+ let store = Arc::new(FakeStore {+ connections: vec![PipedreamConnection {+ user_id: user(),+ app_slug: "stripe".into(),+ server_name: hosted_name.into(),+ account_id: "test".into(),+ enabled: true,+ }],+ native_records: vec![McpServerRecord {+ user_id: user(),+ url: url.clone(),+ server_name: "Native".into(),+ credentials: None,+ enabled: true,+ }],+ });+ let selector =+ McpToolSelector::new(store.clone(), store, Arc::new(HttpConnection(url.clone())));+ let tools = selector.user_toolset(&user()).await;+ assert!(matches!(tools, UserMcpTools::Mixed { .. }));+ let catalog = tools.catalog();+ assert_eq!(catalog.len(), if hosted_name == "Hosted" { 2 } else { 1 });+ assert_eq!(+ ToolSet::<()>::request_schemas(&tools).unwrap().len(),+ catalog.len()+ );+ for tool in catalog {+ let result = tools+ .dispatch_tool_call(+ (),+ RequestContext::new(user()),+ &tool.name,+ &serde_json::json!({}),+ )+ .await+ .unwrap()+ .unwrap();+ assert!(result.to_string().contains("pong"));+ }+ }+ server.abort();+ })+ .await+ .expect("local MCP discovery must not hang");+}diff --git a/crates/onboarding/src/domain/service.rs b/crates/onboarding/src/domain/service.rsindex 30a2b92b32..c688a81ba0 100644--- a/crates/onboarding/src/domain/service.rs+++ b/crates/onboarding/src/domain/service.rs@@ -114,7 +114,7 @@ where) {for source in ImportSource::all() {// Which stack backs the connector is the selector's call- // (Pipedream connectors win over native ones, see `mcp_select`).+ // (enabled native connectors take precedence, see `mcp_select`).let connected = self.mcp_select.connector_connected(user, source.connector_ref())diff --git a/docs/agent-guide/login.md b/docs/agent-guide/login.mdindex 41459661f2..094539bd9d 100644--- a/docs/agent-guide/login.md+++ b/docs/agent-guide/login.md@@ -141,8 +141,33 @@ preferences only. Security and Google steps have a Read more section below the fWork and personal account buttons use the existing Gmail linking flow. Skippingwork email skips the secondary-account prompt. Verify that a Google returnrestores the correct step, shows the connected address, and allows continuation.-Tools use the same Pipedream catalog and connection UI as Settings. Search, load-more, cancel/retry connection, and confirm connected checks persist on return.++Tools show a stable featured list: Linear, Notion, Slack, then startup tools+such as PostHog and Stripe, followed by small-business tools such as QuickBooks.+The featured Pipedream metadata is checked in; the remaining catalog uses one+live paginated query. Search still covers the full directory. Verify load more,+search, cancel/retry connection, and state persistence on return. Paging and+Slack aliases must not duplicate cards. New Slack connections use `slack_v2`;+existing `slack` accounts remain recognized. Production release requires a real+Slack authorization and a successful read-only tool call, not just fixture tests.+Cards use the Pipedream logo, with bundled icons and a generic plug as fallbacks.++GitHub uses Macro's native OAuth/re-authorization flow and returns to the tools+step. It shows **Account linked**, distinct from agent-tool readiness. A+**Configure GitHub repositories** action opens native GitHub App installation;+repository access must not be inferred from the account link. No Pipedream+GitHub card is offered. The same setup remains available in Settings.++Gmail and Google Calendar are hidden, including search and later pages. Google+Drive and Google Sheets remain available in browse and search, with separate+Pipedream connection state. Native Gmail and Calendar consent does not request+Drive or Sheets scopes. Enabled native MCP and Pipedream connections show+Connected. Disabled existing connections show Enable and reuse their stored+authorization. Native and hosted tools coexist in both chat and sandbox agents,+with native preference for known overlapping providers and Slack alias deduplication.+Connection status failures have an explicit retry; they must not prevent+independent providers such as native GitHub from connecting. Verify unknown+status never launches a duplicate OAuth flow and continuation remains possible.Team setup retains existing membership, invite acceptance, domain suggestions,and editable invite recipients; submitting the form sends real invitations.On the create-team form, type a workspace name and edit a teammate address,diff --git a/docs/runbooks/slack-live-channel-import.md b/docs/runbooks/slack-live-channel-import.mdindex 02baa9346c..0f912192a3 100644--- a/docs/runbooks/slack-live-channel-import.md+++ b/docs/runbooks/slack-live-channel-import.md@@ -24,6 +24,11 @@ Pipedream compatibility. Live verification remains a release prerequisite.New-connection slug: `slack_v2`, the OAuth app slug published in[Pipedream's Slack connector metadata](https://pipedream.com/apps/slack-v2).Existing connections retain the selection order `slack`, then `slack_v2`.+On 2026-10-12 the authenticated production+`/cognition/pipedream/mcp/catalog?search=Slack` endpoint returned `slack_v2`+(display name Slack), and the production Connect token opened its hosted flow.+This verifies catalog/Connect availability, not authorization or successful+Slack tool execution; those still require the live checks below.| Evidence | `slack` | `slack_v2` || --- | --- | --- |