Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(desktop): resync products/desktop to PostHog/code fc991d3 (#76339)

Charles Vien55c640daf98f
diff --git a/products/desktop/.claude/skills/merging-prs/SKILL.md b/products/desktop/.claude/skills/merging-prs/SKILL.md
index 8959f52b7b53..cc8685b02de6 100644
--- a/products/desktop/.claude/skills/merging-prs/SKILL.md
+++ b/products/desktop/.claude/skills/merging-prs/SKILL.md
@@ -12,7 +12,7 @@ To merge, you enqueue the PR with a comment, then watch it until Trunk lands it.
When a developer says "merge this PR", "merge it when it's ready", "land it",
"ship it", or "babysit this PR", do the full loop below — enqueue **and** watch
-to completion, reporting the outcome. See also [docs/merge-queue.md](../../../docs/merge-queue.md).
+to completion, reporting the outcome.
`<n>` below is the PR number. Resolve the repo slug once if you need it:
`REPO=$(gh repo view --json nameWithOwner -q .nameWithOwner)`.
@@ -29,8 +29,21 @@ gh pr view <n> --json state,isDraft,mergeable,reviewDecision,statusCheckRollup
- **Failing required checks** (`statusCheckRollup`) → the queue will just reject
it. Report which checks are red and stop; fix them first. **Pending** checks
are fine — the queue waits for them.
+- **Not yet approved** (`reviewDecision` empty or `REVIEW_REQUIRED`) → fine,
+ enqueue anyway. See below.
- **Merge conflicts** (`mergeable == "CONFLICTING"`) → report and stop; rebase first.
+Enqueueing before approval is safe, and is the closest thing this repo has to
+auto-merge. A submitted PR sits in Trunk's `Queued` state until GitHub's branch
+protection on `main` is satisfied — one approving review, code-owner review, and
+the required checks (`build`, `quality`, `unit-test`, `integration-test`,
+`typecheck`) — and Trunk merges it once they land. Trunk is not a bypass actor on
+those rules, so it cannot merge an unapproved or red PR.
+
+The catch: **pushing new commits drops the PR from the queue.** If review
+feedback is likely, either wait for approval before enqueueing, or re-enqueue
+with `/trunk merge` after each push.
+
## 2. Enqueue
```bash
@@ -68,7 +81,10 @@ sleep 60
- Watch the **check run + PR state**, not `gh pr checks --watch`: the queue runs
CI on Trunk's own draft/`trunk-merge/**` branch, so this PR's own checks don't
reflect the queue's testing.
-- Stop at the timeout with a status summary rather than looping forever.
+- If it's parked in `Queued` waiting on a human review, say so once and slow the
+ cadence to ~5 minutes. Keep watching — the merge still has to be reported.
+- Stop at the timeout with a status summary rather than looping forever. If it
+ was still waiting on review, say that's why and offer to keep watching.
## 4. Handle failure
diff --git a/products/desktop/MIGRATION.md b/products/desktop/MIGRATION.md
index d60ca614cb56..6cbe1f5c144a 100644
--- a/products/desktop/MIGRATION.md
+++ b/products/desktop/MIGRATION.md
@@ -6,8 +6,8 @@ monorepo; anything else that differs from the source at the pinned SHA is drift
be treated as a bug in the sync.
- Source: https://github.com/PostHog/code
-- Pinned SHA: `5ac5892a2f566b18125b2be89e8e11f17a7218e8` (main)
-- Imported: 2026-07-20; resynced: 2026-07-30
+- Pinned SHA: `fc991d3eea2d1ac649e2502c0197b0fda9b19f58` (main)
+- Imported: 2026-07-20; resynced: 2026-08-01
## Resync protocol (for a human or an agent)
@@ -45,14 +45,20 @@ The tree is a verbatim copy of the source at the pinned SHA except:
`packages/ui/src/features/inbox/CLAUDE.md` renamed to `AGENTS.md` plus a symlink, and
symlinks added in `packages/ui/src/features/{browser-tabs,canvas}/`. Upstream these to
PostHog/code so resyncs do not reintroduce the violations.
+- `docs/testing.md`: the "Storybook Visual Regression" CI paragraphs are replaced with a
+ note that the storybook CI was removed post-merge (see `POST-MIGRATION.md` step 6). The
+ source still documents its own storybook workflow; reapply on resync.
- Local security patches (reapply on resync until the pin includes the upstream fix):
`apps/code/src/main/utils/encryption.ts` passes `{ authTagLength: 16 }` to
`createDecipheriv` (semgrep `gcm-no-tag-length`, ERROR). For the simple-git 3.36 RCE fix,
- `packages/git/src/client.ts` opts into `unsafe.{allowUnsafeFsMonitor,allowUnsafeEditor,
- allowUnsafePager}` (3.36's block-unsafe plugin otherwise rejects the hardcoded
- core.fsmonitor perf flag and inherited GIT_EDITOR/PAGER), and `packages/git/src/queries.ts`
- runs `git worktree list` through raw `execFile` instead of simple-git. All upstreamed to
- PostHog/code (#4030).
+ `packages/git/package.json` bumps `simple-git` to `^3.36.0` (the source is on `^3.30.0`,
+ so the nested lockfile diverges there too), `packages/git/src/client.ts` opts into
+ `unsafe.{allowUnsafeFsMonitor,allowUnsafeEditor,allowUnsafePager}` (3.36's block-unsafe
+ plugin otherwise rejects the hardcoded core.fsmonitor perf flag and inherited
+ GIT_EDITOR/PAGER), and `packages/git/src/queries.ts` runs `git worktree list` through raw
+ `execFile` instead of simple-git. The upstream attempt (PostHog/code#4030) was closed
+ unmerged, so these stay local patches; restoring the four files from the previous
+ monorepo commit and refreshing the nested lockfile is the reapply.
The nested workspace is intentional: `products/desktop/` keeps its own `pnpm-workspace.yaml`,
lockfile, Biome config and Node 22, and is NOT in the root `pnpm-workspace.yaml` globs.
diff --git a/products/desktop/apps/code/src/main/window.ts b/products/desktop/apps/code/src/main/window.ts
index 62edd9f0ea57..48367c7c93b9 100644
--- a/products/desktop/apps/code/src/main/window.ts
+++ b/products/desktop/apps/code/src/main/window.ts
@@ -208,11 +208,14 @@ export function createWindow(): void {
const platformWindowConfig =
process.platform === "darwin"
? {
- titleBarStyle: "hiddenInset" as const,
+ // "hidden", not "hiddenInset": hiddenInset keeps macOS's own inset and
+ // ignores trafficLightPosition's y, which parked the dots near the
+ // bottom of the bar. "hidden" honours the position we ask for.
+ titleBarStyle: "hidden" as const,
// Centre the traffic lights vertically with the title bar's back/forward
// buttons (40px bar, 24px buttons → centre at y=20; 12px dots → top at 14).
// x mirrors y so the inset from the top and the left match.
- trafficLightPosition: { x: 14, y: 14 },
+ trafficLightPosition: { x: 14, y: 12 },
// Exposes the titlebar-area-* CSS env vars so the renderer can
// clear the traffic lights exactly; their size varies by macOS
// version (bigger on Tahoe), so it must not hardcode a width.
diff --git a/products/desktop/apps/mobile/src/app/inbox/[...id].tsx b/products/desktop/apps/mobile/src/app/inbox/[...id].tsx
index e13b504b6d20..b688222e8223 100644
--- a/products/desktop/apps/mobile/src/app/inbox/[...id].tsx
+++ b/products/desktop/apps/mobile/src/app/inbox/[...id].tsx
@@ -464,7 +464,7 @@ export default function ReportDetailScreen() {
{/* Title */}
<Text className="mb-2 font-semibold text-[18px] text-gray-12">
- {report.title ?? "Untitled signal"}
+ {report.title ?? "Untitled report"}
</Text>
{/* Meta row */}
@@ -642,7 +642,7 @@ export default function ReportDetailScreen() {
<DismissReportSheet
visible={dismissOpen}
reportId={report.id}
- reportTitle={report.title?.trim() ? report.title : "Untitled signal"}
+ reportTitle={report.title?.trim() ? report.title : "Untitled report"}
onClose={() => setDismissOpen(false)}
onDismissed={handleDismissed}
/>
diff --git a/products/desktop/apps/mobile/src/features/inbox/components/ArchivedReportList.tsx b/products/desktop/apps/mobile/src/features/inbox/components/ArchivedReportList.tsx
index 72de97273729..03524e145dbc 100644
--- a/products/desktop/apps/mobile/src/features/inbox/components/ArchivedReportList.tsx
+++ b/products/desktop/apps/mobile/src/features/inbox/components/ArchivedReportList.tsx
@@ -55,7 +55,7 @@ const ArchivedRow = memo(function ArchivedRow({
numberOfLines={2}
ellipsizeMode="tail"
>
- {report.title ?? "Untitled signal"}
+ {report.title ?? "Untitled report"}
</Text>
<View className="mt-1 flex-row flex-wrap items-center gap-2">
diff --git a/products/desktop/apps/mobile/src/features/inbox/components/ReportListRow.tsx b/products/desktop/apps/mobile/src/features/inbox/components/ReportListRow.tsx
index 3b0508bb8354..e12cff57bfdd 100644
--- a/products/desktop/apps/mobile/src/features/inbox/components/ReportListRow.tsx
+++ b/products/desktop/apps/mobile/src/features/inbox/components/ReportListRow.tsx
@@ -70,7 +70,7 @@ function ReportListRowComponent({ report, onPress }: ReportListRowProps) {
numberOfLines={2}
ellipsizeMode="tail"
>
- {report.title ?? "Untitled signal"}
+ {report.title ?? "Untitled report"}
</Text>
<View className="mt-1 flex-row items-center gap-2">
diff --git a/products/desktop/apps/web/package.json b/products/desktop/apps/web/package.json
index bf1eff1d7174..dfd6a082f23b 100644
--- a/products/desktop/apps/web/package.json
+++ b/products/desktop/apps/web/package.json
@@ -19,6 +19,7 @@
"@posthog/core": "workspace:*",
"@posthog/di": "workspace:*",
"@posthog/host-router": "workspace:*",
+ "@posthog/harness": "workspace:*",
"@posthog/host-trpc": "workspace:*",
"@posthog/platform": "workspace:*",
"@posthog/shared": "workspace:*",
diff --git a/products/desktop/apps/web/src/web-host-router.ts b/products/desktop/apps/web/src/web-host-router.ts
index 07f148b42d10..fb2ac0a73a71 100644
--- a/products/desktop/apps/web/src/web-host-router.ts
+++ b/products/desktop/apps/web/src/web-host-router.ts
@@ -1,10 +1,10 @@
-import { fetchPosthogPiModelCatalog } from "@posthog/agent/pi/model-catalog";
import { getLlmGatewayUrl } from "@posthog/agent/posthog-api";
import type { AuthService } from "@posthog/core/auth/auth";
import { AUTH_SERVICE } from "@posthog/core/auth/auth.module";
import { TEAM_SKILLS_SERVICE } from "@posthog/core/skills/identifiers";
import type { TeamSkillsService } from "@posthog/core/skills/teamSkillsService";
import { resolveService } from "@posthog/di/container";
+import { fetchPosthogPiModelCatalog } from "@posthog/harness/extensions/posthog-provider/model-catalog";
import { analyticsRouter } from "@posthog/host-router/routers/analytics.router";
import { authRouter } from "@posthog/host-router/routers/auth.router";
import { canvasDataRouter } from "@posthog/host-router/routers/canvas-data.router";
diff --git a/products/desktop/docs/LOCAL-DEVELOPMENT.md b/products/desktop/docs/LOCAL-DEVELOPMENT.md
index 41c375f2d061..0991eeaf6661 100644
--- a/products/desktop/docs/LOCAL-DEVELOPMENT.md
+++ b/products/desktop/docs/LOCAL-DEVELOPMENT.md
@@ -127,10 +127,59 @@ region you pick at login.
## Troubleshooting
+### Feature flags never enabled (flag-gated UI missing)
+
+If flag-gated surfaces (e.g. the MCP gateway behind `mcp-gateway`) never show up
+even though the flag is enabled in your PostHog project, check
+`VITE_POSTHOG_API_HOST` in `.env`: it must include the scheme
+(`http://localhost:8010`, not `localhost:8010`). posthog-js concatenates the
+host into request URLs verbatim, so a scheme-less value produces URLs like
+`localhost:8010/flags/…` that the browser rejects as an invalid protocol —
+every flag fetch fails silently and `isFeatureEnabled` returns `undefined` for
+everything (flags never loaded). Prefer `node scripts/use-local-posthog.mjs`
+over hand-editing; it writes the correct form.
+
+To confirm what the running app sees, run in the renderer console (or via CDP):
+
+```js
+posthog.config.api_host; // must start with http:// or https://
+posthog.isFeatureEnabled("mcp-gateway"); // undefined ⇒ flags never loaded
+```
+
+`.env` changes need a dev-server restart (`pnpm dev`) to take effect.
+
### "Invalid client_id" error during OAuth
The OAuth application in your local PostHog must have the client ID `DC5uRLVbGI02YQ82grxgnK6Qn12SXWpCqdPb60oZ`. Verify at http://localhost:8010/admin/posthog/oauthapplication/.
+### "OAuth error: invalid_scope"
+
+PostHog Code requests the wildcard scope `*` (see `OAUTH_SCOPES` in
+`packages/shared/src/oauth.ts`). PostHog's OAuth server only grants `*` at
+`/authorize` when the OAuth application's **scope ceiling is empty** — this is
+the grandfathering path for the PostHog Code client. If the application has any
+explicit `scopes` or `optional_scopes` configured, the wildcard is rejected with
+`invalid_scope`.
+
+Fix: clear the scope ceiling on your local OAuth application so it matches the
+production app. Either edit it at
+http://localhost:8010/admin/posthog/oauthapplication/ (empty the **Scopes** and
+**Optional scopes** fields), or run in your PostHog repo:
+
+```bash
+python manage.py shell -c "
+from posthog.models.oauth import OAuthApplication
+app = OAuthApplication.objects.get(client_id='DC5uRLVbGI02YQ82grxgnK6Qn12SXWpCqdPb60oZ')
+app.scopes = []
+app.optional_scopes = []
+app.save()
+print('cleared scope ceiling for', app.client_id)
+"
+```
+
+Then retry login. (Do not add `*` to the ceiling — an explicit ceiling never
+grants the wildcard, even if `*` is listed.)
+
### "Redirect URI mismatch"
Make sure the OAuth application's redirect URIs include `http://localhost:8237/callback` and `http://localhost:8239/callback`. Check for trailing slashes.
diff --git a/products/desktop/packages/agent/package.json b/products/desktop/packages/agent/package.json
index 0f7d72b8df9c..e159b71d0e2d 100644
--- a/products/desktop/packages/agent/package.json
+++ b/products/desktop/packages/agent/package.json
@@ -52,10 +52,6 @@
"types": "./dist/pi/types.d.ts",
"import": "./dist/pi/types.js"
},
- "./pi/model-catalog": {
- "types": "./dist/pi/model-catalog.d.ts",
- "import": "./dist/pi/model-catalog.js"
- },
"./pr-url-detector": {
"types": "./dist/pr-url-detector.d.ts",
"import": "./dist/pr-url-detector.js"
diff --git a/products/desktop/packages/agent/src/adapters/claude/session/options.test.ts b/products/desktop/packages/agent/src/adapters/claude/session/options.test.ts
index f2a0b66c99d1..418b2c8d9e7b 100644
--- a/products/desktop/packages/agent/src/adapters/claude/session/options.test.ts
+++ b/products/desktop/packages/agent/src/adapters/claude/session/options.test.ts
@@ -376,7 +376,10 @@ describe("buildSessionOptions", () => {
name: "omits the team_id header when POSTHOG_PROJECT_ID is unset",
projectId: undefined,
existingHeaders: undefined,
- expected: "x-posthog-use-bedrock-fallback: true",
+ expected: [
+ "x-posthog-property-$ai_session_id: test-session",
+ "x-posthog-use-bedrock-fallback: true",
+ ].join("\n"),
},
{
name: "forwards POSTHOG_PROJECT_ID as the team_id attribution header",
@@ -384,6 +387,7 @@ describe("buildSessionOptions", () => {
existingHeaders: undefined,
expected: [
"x-posthog-property-team_id: 42",
+ "x-posthog-property-$ai_session_id: test-session",
"x-posthog-use-bedrock-fallback: true",
].join("\n"),
},
@@ -394,6 +398,7 @@ describe("buildSessionOptions", () => {
expected: [
"x-posthog-property-task_id: task-abc",
"x-posthog-property-team_id: 42",
+ "x-posthog-property-$ai_session_id: test-session",
"x-posthog-use-bedrock-fallback: true",
].join("\n"),
},
@@ -411,6 +416,101 @@ describe("buildSessionOptions", () => {
expect(headers).toBe(expected);
});
});
+
+ describe("gateway turn tracing env", () => {
+ const KEYS = [
+ "CLAUDE_CODE_ENABLE_TELEMETRY",
+ "CLAUDE_CODE_ENHANCED_TELEMETRY_BETA",
+ "CLAUDE_CODE_PROPAGATE_TRACEPARENT",
+ "OTEL_TRACES_EXPORTER",
+ "OTEL_EXPORTER_OTLP_PROTOCOL",
+ "OTEL_EXPORTER_OTLP_ENDPOINT",
+ "TRACEPARENT",
+ "TRACESTATE",
+ ] as const;
+ const original: Partial<Record<string, string | undefined>> = {};
+
+ beforeEach(() => {
+ for (const key of KEYS) {
+ original[key] = process.env[key];
+ delete process.env[key];
+ }
+ });
+
+ afterEach(() => {
+ for (const key of KEYS) {
+ const value = original[key];
+ if (value === undefined) {
+ delete process.env[key];
+ } else {
+ process.env[key] = value;
+ }
+ }
+ });
+
+ const gatewayEnv = {
+ anthropicBaseUrl: "https://gateway.example",
+ anthropicAuthToken: "tok",
+ openaiBaseUrl: "https://gateway.example/v1",
+ openaiApiKey: "tok",
+ };
+
+ it("enables per-turn traceparent when routed through the gateway", () => {
+ const env = buildSessionOptions({ ...makeParams(), gatewayEnv }).env;
+
+ expect(env?.CLAUDE_CODE_ENABLE_TELEMETRY).toBe("1");
+ expect(env?.CLAUDE_CODE_ENHANCED_TELEMETRY_BETA).toBe("1");
+ expect(env?.CLAUDE_CODE_PROPAGATE_TRACEPARENT).toBe("1");
+ expect(env?.OTEL_TRACES_EXPORTER).toBe("otlp");
+ expect(env?.OTEL_EXPORTER_OTLP_PROTOCOL).toBe("http/json");
+ expect(env?.OTEL_EXPORTER_OTLP_ENDPOINT).toBe("http://127.0.0.1:9");
+ });
+
+ it("honors a caller-supplied OTLP endpoint", () => {
+ process.env.OTEL_EXPORTER_OTLP_ENDPOINT =
+ "http://collector.internal:4318";
+
+ const env = buildSessionOptions({ ...makeParams(), gatewayEnv }).env;
+
+ expect(env?.OTEL_EXPORTER_OTLP_ENDPOINT).toBe(
+ "http://collector.internal:4318",
+ );
+ });
+
+ it("pins exporter and protocol so an inherited none can't disable tracing", () => {
+ process.env.OTEL_TRACES_EXPORTER = "none";
+ process.env.OTEL_EXPORTER_OTLP_PROTOCOL = "grpc";
+
+ const env = buildSessionOptions({ ...makeParams(), gatewayEnv }).env;
+
+ expect(env?.OTEL_TRACES_EXPORTER).toBe("otlp");
+ expect(env?.OTEL_EXPORTER_OTLP_PROTOCOL).toBe("http/json");
+ });
+
+ it("strips inherited TRACEPARENT so turns keep distinct trace ids", () => {
+ process.env.TRACEPARENT =
+ "00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01";
+ process.env.TRACESTATE = "vendor=x";
+
+ const env = buildSessionOptions({ ...makeParams(), gatewayEnv }).env;
+
+ expect(env?.TRACEPARENT).toBeUndefined();
+ expect(env?.TRACESTATE).toBeUndefined();
+ });
+
+ it("leaves BYOK sessions untouched", () => {
+ process.env.TRACEPARENT =
+ "00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01";
+
+ const env = buildSessionOptions(makeParams()).env;
+
+ expect(env?.CLAUDE_CODE_ENABLE_TELEMETRY).toBeUndefined();
+ expect(env?.CLAUDE_CODE_PROPAGATE_TRACEPARENT).toBeUndefined();
+ expect(env?.TRACEPARENT).toBe(
+ "00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01",
+ );
+ });
+ });
});
describe("buildSystemPrompt", () => {
diff --git a/products/desktop/packages/agent/src/adapters/claude/session/options.ts b/products/desktop/packages/agent/src/adapters/claude/session/options.ts
index a5e08ccc79f5..25c6743d2fe9 100644
--- a/products/desktop/packages/agent/src/adapters/claude/session/options.ts
+++ b/products/desktop/packages/agent/src/adapters/claude/session/options.ts
@@ -151,7 +151,10 @@ function buildMcpServers(
};
}
-function buildEnvironment(gateway?: GatewayEnv): Record<string, string> {
+function buildEnvironment(
+ gateway?: GatewayEnv,
+ sessionId?: string,
+): Record<string, string> {
// Custom HTTP headers reach the model only through the Claude CLI subprocess,
// which reads them from this env var (newline-delimited `name: value` lines)
// — the SDK has no direct header option. We finalize them here, the single
@@ -174,6 +177,11 @@ function buildEnvironment(gateway?: GatewayEnv): Record<string, string> {
if (projectId) {
headerLines.push(buildGatewayPropertyHeaders({ team_id: projectId }));
}
+ if (sessionId) {
+ headerLines.push(
+ buildGatewayPropertyHeaders({ $ai_session_id: sessionId }),
+ );
+ }
// Route to AWS Bedrock as a fallback when Anthropic returns 5xx
headerLines.push("x-posthog-use-bedrock-fallback: true");
const customHeaders = headerLines.join("\n");
@@ -185,8 +193,31 @@ function buildEnvironment(gateway?: GatewayEnv): Record<string, string> {
// sessions that genuinely need MCP tools available on turn 1.
const mcpNonblocking = process.env.MCP_CONNECTION_NONBLOCKING;
- return {
+ // Every var is load-bearing (ablation-tested): the CLI stamps the per-turn
+ // traceparent only once its OTel tracer initializes, and the dead endpoint
+ // keeps the throwaway spans off any local collector. Exporter and protocol
+ // are pinned rather than inherited — an ambient OTEL_TRACES_EXPORTER=none or
+ // unknown protocol registers no tracer and silently drops the traceparent;
+ // the endpoint stays overridable for a real collector.
+ // Residual risk: a repo's .claude/settings.json `env` is applied over these
+ // inside the CLI and can redirect the endpoint or turn on content capture
+ // (OTEL_LOG_TOOL_CONTENT, …) — pre-existing settingSources exposure, not
+ // closable from here; hardening tracked separately.
+ const gatewayTracing: Record<string, string> = gateway?.anthropicBaseUrl
+ ? {
+ CLAUDE_CODE_ENABLE_TELEMETRY: "1",
+ CLAUDE_CODE_ENHANCED_TELEMETRY_BETA: "1",
+ CLAUDE_CODE_PROPAGATE_TRACEPARENT: "1",
+ OTEL_TRACES_EXPORTER: "otlp",
+ OTEL_EXPORTER_OTLP_PROTOCOL: "http/json",
+ OTEL_EXPORTER_OTLP_ENDPOINT:
+ process.env.OTEL_EXPORTER_OTLP_ENDPOINT ?? "http://127.0.0.1:9",
+ }
+ : {};
+
+ const env: Record<string, string> = {
...process.env,
+ ...gatewayTracing,
// Explicit gateway values win over whatever happens to be in process.env.
// This prevents concurrent Agent instances from clobbering each other's
// gateway config when process.env was mutated globally.
@@ -212,6 +243,13 @@ function buildEnvironment(gateway?: GatewayEnv): Record<string, string> {
}),
ANTHROPIC_CUSTOM_HEADERS: customHeaders,
};
+ if (gateway?.anthropicBaseUrl) {
+ // The CLI parents every turn under an inherited ambient TRACEPARENT,
+ // collapsing the per-turn trace ids this block exists to produce.
+ delete env.TRACEPARENT;
+ delete env.TRACESTATE;
+ }
+ return env;
}
function buildHooks(
@@ -473,7 +511,7 @@ export function buildSessionOptions(params: BuildOptionsParams): Options {
params.mcpServers,
loadUserClaudeJsonMcpServers(params.cwd, params.logger),
),
- env: buildEnvironment(params.gatewayEnv),
+ env: buildEnvironment(params.gatewayEnv, params.sessionId),
hooks: buildHooks(
params.userProvidedOptions?.hooks,
params.onModeChange,
diff --git a/products/desktop/packages/agent/src/adapters/codex-app-server/spawn.test.ts b/products/desktop/packages/agent/src/adapters/codex-app-server/spawn.test.ts
index 6794bef2dd60..a5784252d4f7 100644
--- a/products/desktop/packages/agent/src/adapters/codex-app-server/spawn.test.ts
+++ b/products/desktop/packages/agent/src/adapters/codex-app-server/spawn.test.ts
@@ -57,6 +57,18 @@ describe("buildAppServerArgs", () => {
);
});
+ it("quotes $-prefixed posthog property header keys in the TOML table", () => {
+ const args = buildAppServerArgs({
+ binaryPath: "/bundle/codex",
+ apiBaseUrl: "https://gateway.example/v1",
+ httpHeaders: { "x-posthog-property-$ai_session_id": "task-123" },
+ });
+
+ expect(args).toContain(
+ 'model_providers.posthog.http_headers={ "x-posthog-property-$ai_session_id" = "task-123" }',
+ );
+ });
+
it("omits http_headers when none are provided or the provider is unset", () => {
const withoutHeaders = buildAppServerArgs({
binaryPath: "/bundle/codex",
diff --git a/products/desktop/packages/agent/src/adapters/local-tools/tools/signed-commit.test.ts b/products/desktop/packages/agent/src/adapters/local-tools/tools/signed-commit.test.ts
index 33378c3f1fa7..5502dacd3be7 100644
--- a/products/desktop/packages/agent/src/adapters/local-tools/tools/signed-commit.test.ts
+++ b/products/desktop/packages/agent/src/adapters/local-tools/tools/signed-commit.test.ts
@@ -117,6 +117,41 @@ describe("signed-commit tool handler", () => {
});
});
+ it("persists the branch when cwd uses an equivalent path representation", async () => {
+ await signedCommitTool.handler(
+ {
+ cwd: "/tmp/workspace/repos/posthog/code/.",
+ token: "ghs_x",
+ taskId: "task-1",
+ taskRunId: "run-1",
+ },
+ { message: "chore: bump", cwd: "." },
+ );
+
+ expect(reportTaskRunBranch).toHaveBeenCalledWith({
+ taskId: "task-1",
+ taskRunId: "run-1",
+ branch: "posthog-code/feature",
+ });
+ });
+
+ it("does not persist a branch created in a sibling repository", async () => {
+ await signedCommitTool.handler(
+ {
+ cwd: "/tmp/workspace/repos/posthog/code",
+ token: "ghs_x",
+ taskId: "task-1",
+ taskRunId: "run-1",
+ },
+ {
+ message: "chore: bump",
+ cwd: "/tmp/workspace/repos/posthog/grafana-dashboards",
+ },
+ );
+
+ expect(reportTaskRunBranch).not.toHaveBeenCalled();
+ });
+
it("returns the no-token error without invoking createSignedCommit", async () => {
const savedGh = process.env.GH_TOKEN;
const savedGithub = process.env.GITHUB_TOKEN;
diff --git a/products/desktop/packages/agent/src/adapters/local-tools/tools/signed-git-tool.ts b/products/desktop/packages/agent/src/adapters/local-tools/tools/signed-git-tool.ts
index 0b72c25875fc..cdeae219d0ec 100644
--- a/products/desktop/packages/agent/src/adapters/local-tools/tools/signed-git-tool.ts
+++ b/products/desktop/packages/agent/src/adapters/local-tools/tools/signed-git-tool.ts
@@ -43,10 +43,14 @@ export function defineSignedGitTool<S extends z.ZodRawShape, R>(opts: {
string,
unknown
>;
- const cwd = argCwd ? path.resolve(ctx.cwd, argCwd) : ctx.cwd;
+ const taskRepositoryCwd = path.resolve(ctx.cwd);
+ const cwd = argCwd
+ ? path.resolve(taskRepositoryCwd, argCwd)
+ : taskRepositoryCwd;
return opts.run(
{
cwd,
+ taskRepositoryCwd,
token,
taskId: ctx.taskId,
taskRunId: ctx.taskRunId,
diff --git a/products/desktop/packages/agent/src/adapters/signed-commit-shared.ts b/products/desktop/packages/agent/src/adapters/signed-commit-shared.ts
index aa7e8523b4de..2cdd83eb7d24 100644
--- a/products/desktop/packages/agent/src/adapters/signed-commit-shared.ts
+++ b/products/desktop/packages/agent/src/adapters/signed-commit-shared.ts
@@ -135,7 +135,11 @@ export interface SignedCommitToolResult {
[key: string]: unknown;
}
-export type SignedCommitToolCtx = SignedCommitCtx & { taskRunId?: string };
+export type SignedCommitToolCtx = SignedCommitCtx & {
+ taskRunId?: string;
+ /** The task repository cwd, before a tool-call `cwd` override is applied. */
+ taskRepositoryCwd: string;
+};
async function runSignedTool<A>(
toolName: string,
@@ -176,11 +180,17 @@ export function runSignedCommitTool(
SIGNED_COMMIT_TOOL_NAME,
async (c, a: SignedCommitInput) => {
const result = await createSignedCommit(c, a);
- await reportTaskRunBranch({
- taskId: ctx.taskId,
- taskRunId: ctx.taskRunId,
- branch: result.branch,
- });
+ // TaskRun.branch is the branch that provisioning checks out in the task's
+ // repository on resume. A task can also commit to sibling repositories by
+ // passing `cwd`; persisting one of those branches here makes the next run
+ // try to clone the task repository at a branch that only exists elsewhere.
+ if (ctx.cwd === ctx.taskRepositoryCwd) {
+ await reportTaskRunBranch({
+ taskId: ctx.taskId,
+ taskRunId: ctx.taskRunId,
+ branch: result.branch,
+ });
+ }
// The "commit hook": every pushed commit becomes a `commit` artefact on the signal
// reports this task is associated with. Best-effort and awaited inside the tool's
// try/catch-free success path — reportCommitArtefacts never throws, so a failed
diff --git a/products/desktop/packages/agent/src/agent.ts b/products/desktop/packages/agent/src/agent.ts
index 63b383084975..b7ea903d8d2c 100644
--- a/products/desktop/packages/agent/src/agent.ts
+++ b/products/desktop/packages/agent/src/agent.ts
@@ -14,6 +14,7 @@ import {
import { PostHogAPIClient, type TaskRunUpdate } from "./posthog-api";
import { SessionLogWriter } from "./session-log-writer";
import type { AgentConfig, TaskExecutionOptions } from "./types";
+import { buildGatewayPropertyHeaderRecord } from "./utils/gateway";
import { Logger } from "./utils/logger";
export class Agent {
@@ -148,6 +149,9 @@ export class Agent {
model: sanitizedModel,
reasoningEffort: options.reasoningEffort,
developerInstructions: options.developerInstructions,
+ httpHeaders: taskId
+ ? buildGatewayPropertyHeaderRecord({ $ai_session_id: taskId })
+ : undefined,
additionalDirectories: options.additionalDirectories,
}
: undefined,
diff --git a/products/desktop/packages/agent/src/pi/conversation/translatePiConversation.test.ts b/products/desktop/packages/agent/src/pi/conversation/translatePiConversation.test.ts
index 4db19cb58ecc..f0f3e4d6b55f 100644
--- a/products/desktop/packages/agent/src/pi/conversation/translatePiConversation.test.ts
+++ b/products/desktop/packages/agent/src/pi/conversation/translatePiConversation.test.ts
@@ -162,11 +162,17 @@ describe("createPiConversationTranslator", () => {
delayMs: 1000,
},
]);
+ const retriedMessage = assistant([{ type: "text", text: "Done" }]);
expect(
translator.translateEvent({
- type: "auto_retry_end",
- success: true,
- attempt: 1,
+ type: "message_update",
+ message: retriedMessage,
+ assistantMessageEvent: {
+ type: "text_delta",
+ contentIndex: 0,
+ delta: "Done",
+ partial: retriedMessage,
+ },
}),
).toEqual([
{
@@ -175,7 +181,19 @@ describe("createPiConversationTranslator", () => {
status: "retrying",
isComplete: true,
},
+ {
+ type: "assistant_message_chunk",
+ timestamp: 10,
+ content: { type: "text", text: "Done" },
+ },
]);
+ expect(
+ translator.translateEvent({
+ type: "auto_retry_end",
+ success: true,
+ attempt: 1,
+ }),
+ ).toEqual([]);
});
it("renders terminal Pi runtime errors inline", () => {
diff --git a/products/desktop/packages/agent/src/pi/conversation/translatePiConversation.ts b/products/desktop/packages/agent/src/pi/conversation/translatePiConversation.ts
index 745145623de3..ad025153a0bd 100644
--- a/products/desktop/packages/agent/src/pi/conversation/translatePiConversation.ts
+++ b/products/desktop/packages/agent/src/pi/conversation/translatePiConversation.ts
@@ -115,7 +115,25 @@ export function createPiConversationTranslator(): PiConversationTranslator {
let latestRuntimeTimestamp = 0;
let latestConversationTimestamp = 0;
let pendingRuntimeError: AgentConversationEvent | undefined;
+ let retrying = false;
let directBashSequence = 0;
+
+ function completeRetry(timestamp: number): AgentConversationEvent[] {
+ if (!retrying) {
+ return [];
+ }
+
+ retrying = false;
+ return [
+ {
+ type: "runtime_status",
+ timestamp,
+ status: "retrying",
+ isComplete: true,
+ },
+ ];
+ }
+
let activeDirectBash:
| {
nextOutputBytes: number;
@@ -257,6 +275,7 @@ export function createPiConversationTranslator(): PiConversationTranslator {
if (update.type === "text_delta" && update.delta) {
streamedAssistantTimestamps.add(event.message.timestamp);
return [
+ ...completeRetry(event.message.timestamp),
{
type: "assistant_message_chunk",
timestamp: event.message.timestamp,
@@ -268,6 +287,7 @@ export function createPiConversationTranslator(): PiConversationTranslator {
if (update.type === "thinking_delta" && update.delta) {
streamedAssistantTimestamps.add(event.message.timestamp);
return [
+ ...completeRetry(event.message.timestamp),
{
type: "assistant_thought_chunk",
timestamp: event.message.timestamp,
@@ -407,7 +427,11 @@ export function createPiConversationTranslator(): PiConversationTranslator {
}
if (event.type === "auto_retry_start") {
+ const completedEvents = completeRetry(latestConversationTimestamp);
+ retrying = true;
+
return [
+ ...completedEvents,
{
type: "runtime_status",
timestamp: latestConversationTimestamp,
@@ -421,14 +445,9 @@ export function createPiConversationTranslator(): PiConversationTranslator {
}
if (event.type === "auto_retry_end") {
- const events: AgentConversationEvent[] = [
- {
- type: "runtime_status",
- timestamp: latestConversationTimestamp,
- status: "retrying",
- isComplete: true,
- },
- ];
+ const events: AgentConversationEvent[] = completeRetry(
+ latestConversationTimestamp,
+ );
if (!event.success && event.finalError) {
events.push({
diff --git a/products/desktop/packages/agent/src/server/agent-server.configure-environment.test.ts b/products/desktop/packages/agent/src/server/agent-server.configure-environment.test.ts
index 0ae96970f67f..6b18e64f2236 100644
--- a/products/desktop/packages/agent/src/server/agent-server.configure-environment.test.ts
+++ b/products/desktop/packages/agent/src/server/agent-server.configure-environment.test.ts
@@ -223,6 +223,7 @@ describe("AgentServer.configureEnvironment", () => {
"x-posthog-property-task_user_id": "42",
"x-posthog-property-task_title": "Fix the bug",
"x-posthog-property-team_id": "1",
+ "x-posthog-property-$ai_session_id": "task-abc",
});
});
@@ -340,6 +341,25 @@ describe("AgentServer.configureEnvironment", () => {
);
});
+ it("folds the task id into the codex session header only", () => {
+ const env = buildServer("interactive").configureEnvironment({
+ taskId: "task-123",
+ });
+
+ expect(env.openaiCustomHeaders?.["x-posthog-property-$ai_session_id"]).toBe(
+ "task-123",
+ );
+ expect(env.anthropicCustomHeaders ?? "").not.toContain("$ai_session_id");
+ });
+
+ it("omits the codex session header without a task id", () => {
+ const env = buildServer("interactive").configureEnvironment({});
+
+ expect(
+ env.openaiCustomHeaders?.["x-posthog-property-$ai_session_id"],
+ ).toBeUndefined();
+ });
+
it("appends the resolved product to a LLM_GATEWAY_URL override base", () => {
// The override is treated as a base URL. The product slug is always
// appended so the gateway routes to the correct product config — a bare
diff --git a/products/desktop/packages/agent/src/server/agent-server.ts b/products/desktop/packages/agent/src/server/agent-server.ts
index f53594a274fd..e1f075ebcf37 100644
--- a/products/desktop/packages/agent/src/server/agent-server.ts
+++ b/products/desktop/packages/agent/src/server/agent-server.ts
@@ -3625,6 +3625,10 @@ Optimize for the fewest shell round trips.
- Read multiple files at once.
- Never rerun a command solely to reproduce output you already have.`;
+ const artifactInstructions = `
+## Delivering non-code files (artifacts)
+When you create a non-code file the user should be able to download (such as a report, chart, image, archive, or data file), call the \`upload_artifact\` tool with its path before your final reply. In your final reply, link to the download URL returned by the tool—never link to the file's local workspace path. Files left in the workspace don't reach the user. Don't upload source code or repository changes—those belong in a commit or PR.`;
+
const whyContextInstruction = ` - Add a brief **Why** to the body — one or two sentences capturing the reason the user asked for this change (the motivation, not a restatement of the diff). Keep it short.`;
const publicRepoSafetyInstruction = ` - **Public-repo safety.** Treat the target repository as public-readable unless you have verified otherwise. The PR title, description, and commit messages must not contain private operational scale (exact event counts, internal row volumes, customer-usage percentages), customer names / emails / companies, references to internal tickets or incidents, the contents of Slack threads (do not quote or paraphrase what was said), or unreleased roadmap details. Linking to the originating Slack thread is fine and encouraged — Slack links are auth-gated and useful as context — as are channel references like "raised in #team-foo". Describe findings qualitatively ("present on nearly all X events, absent from Y") rather than with quantitative figures pulled from analytics queries — the reasoning that uses those numbers can stay in the thread; the PR copy cannot.`;
const prMentionSafetyInstruction = ` - **Never guess a GitHub identity.** Do NOT \`@\`-mention, tag, assign, request review from, or attribute the PR to a person (in the title, description, commit message, or reviewers) using a name or handle taken from Slack or this thread. A Slack display name or handle is NOT a GitHub username. Finding a similar-looking handle in the repo's git history, CODEOWNERS, or existing PRs/issues does NOT confirm it belongs to this person: repository presence proves the handle exists, not that it is the person you mean, so treating it as a match still \`@\`-tags an unrelated account (e.g. Slack "Ross" is not necessarily GitHub \`@ross\`, even if some \`@ross\` has committed to the repo). Only \`@\`-mention a GitHub \`@handle\` the user gave you explicitly in this thread. Otherwise refer to people by plain-text name, or omit the mention entirely.`;
@@ -3652,7 +3656,7 @@ Do the requested work, but stop with local changes ready for review.
Important:
- Do NOT create new commits, push to the branch, or update the pull request unless the user explicitly asks.
- Do NOT create a new branch or a new pull request unless the user explicitly asks.
-${signedCommitInstructions}${prLinkInstructions}${shellEfficiencyInstructions}
+${signedCommitInstructions}${prLinkInstructions}${shellEfficiencyInstructions}${artifactInstructions}
`;
}
@@ -3673,7 +3677,7 @@ After completing the requested changes:
Important:
- Do NOT create a new branch or a new pull request unless the user explicitly asks.
- Do NOT push fixes for review comments without replying to and resolving each related thread.
-${signedCommitInstructions}${prLinkInstructions}${shellEfficiencyInstructions}
+${signedCommitInstructions}${prLinkInstructions}${shellEfficiencyInstructions}${artifactInstructions}
`;
}
@@ -3725,7 +3729,7 @@ ${publishInstructions}
Important:
- Prefer using MCP tools to answer questions with real data over giving generic advice.
-${signedCommitInstructions}${prLinkInstructions}${shellEfficiencyInstructions}
+${signedCommitInstructions}${prLinkInstructions}${shellEfficiencyInstructions}${artifactInstructions}
`;
}
@@ -3743,7 +3747,7 @@ ${publicRepoSafetyInstruction.trimStart()}
${prMentionSafetyInstruction.trimStart()}
- End the PR description with a horizontal rule followed by this footer line: ${prFooter}
- Always create the PR as a draft.
-${signedCommitInstructions}${prLinkInstructions}${shellEfficiencyInstructions}
+${signedCommitInstructions}${prLinkInstructions}${shellEfficiencyInstructions}${artifactInstructions}
`;
}
@@ -3771,7 +3775,7 @@ ${prFooter}
Important:
- Always create the PR as a draft. Do not ask for confirmation.
-${signedCommitInstructions}${prLinkInstructions}${shellEfficiencyInstructions}
+${signedCommitInstructions}${prLinkInstructions}${shellEfficiencyInstructions}${artifactInstructions}
`;
}
@@ -3971,9 +3975,12 @@ ${signedCommitInstructions}${prLinkInstructions}${shellEfficiencyInstructions}
openaiCustomHeaders = buildGatewayPropertiesHeaderRecord(properties);
} else {
customHeaders = buildGatewayPropertyHeaders(gatewayProperties);
+ // No $ai_session_id on the Go-gateway path above: it strips $-prefixed
+ // blob keys, so the session id would be silently dropped there.
openaiCustomHeaders = buildGatewayPropertyHeaderRecord({
...gatewayProperties,
team_id: projectId,
+ $ai_session_id: taskId,
});
}
diff --git a/products/desktop/packages/agent/src/session-log-writer.test.ts b/products/desktop/packages/agent/src/session-log-writer.test.ts
index 2a492b58ac99..f6931400257c 100644
--- a/products/desktop/packages/agent/src/session-log-writer.test.ts
+++ b/products/desktop/packages/agent/src/session-log-writer.test.ts
@@ -47,6 +47,45 @@ describe("SessionLogWriter", () => {
expect(entries).toHaveLength(2);
});
+ it("redacts MCP authorization headers before persistence", async () => {
+ const sessionId = "s1";
+ logWriter.register(sessionId, { taskId: "t1", runId: sessionId });
+
+ logWriter.appendRawLine(
+ sessionId,
+ JSON.stringify({
+ jsonrpc: "2.0",
+ method: "session/new",
+ params: {
+ mcpServers: [
+ {
+ name: "posthog",
+ headers: [
+ { name: "Authorization", value: "Bearer protocol-secret" },
+ { name: "x-posthog-project-id", value: "123" },
+ ],
+ },
+ ],
+ },
+ }),
+ );
+ await logWriter.flush(sessionId);
+
+ const entries: StoredNotification[] = mockAppendLog.mock.calls[0][2];
+ expect(JSON.stringify(entries)).not.toContain("protocol-secret");
+ expect(entries[0].notification.params).toEqual({
+ mcpServers: [
+ {
+ name: "posthog",
+ headers: [
+ { name: "Authorization", value: "[REDACTED]" },
+ { name: "x-posthog-project-id", value: "123" },
+ ],
+ },
+ ],
+ });
+ });
+
it("ignores unregistered sessions", async () => {
logWriter.appendRawLine("unknown", JSON.stringify({ method: "test" }));
await logWriter.flush("unknown");
diff --git a/products/desktop/packages/agent/src/session-log-writer.ts b/products/desktop/packages/agent/src/session-log-writer.ts
index a11566902cb0..56bf58440180 100644
--- a/products/desktop/packages/agent/src/session-log-writer.ts
+++ b/products/desktop/packages/agent/src/session-log-writer.ts
@@ -73,6 +73,31 @@ interface SessionState {
pendingRawInputSnapshots: Map<string, StoredNotification>;
}
+function redactAuthorizationHeaders(value: unknown): unknown {
+ if (Array.isArray(value)) {
+ return value.map(redactAuthorizationHeaders);
+ }
+ if (value === null || typeof value !== "object") {
+ return value;
+ }
+
+ const record = value as Record<string, unknown>;
+ if (
+ typeof record.name === "string" &&
+ record.name.toLowerCase() === "authorization" &&
+ "value" in record
+ ) {
+ return { ...record, value: "[REDACTED]" };
+ }
+
+ return Object.fromEntries(
+ Object.entries(record).map(([key, nestedValue]) => [
+ key,
+ redactAuthorizationHeaders(nestedValue),
+ ]),
+ );
+}
+
export class SessionLogWriter {
/**
* When consecutive in-progress tool updates for one call span more than this
@@ -212,7 +237,9 @@ export class SessionLogWriter {
const entry: StoredNotification = {
type: "notification",
timestamp,
- notification: message,
+ notification: redactAuthorizationHeaders(
+ message,
+ ) as StoredNotification["notification"],
};
this.emitToSinks(sessionId, entry);
diff --git a/products/desktop/packages/agent/tsup.config.ts b/products/desktop/packages/agent/tsup.config.ts
index 55bfd03fea85..b8167cd2392e 100644
--- a/products/desktop/packages/agent/tsup.config.ts
+++ b/products/desktop/packages/agent/tsup.config.ts
@@ -132,7 +132,6 @@ export default defineConfig([
"src/pi/rpc-client.ts",
"src/pi/runtime.ts",
"src/pi/types.ts",
- "src/pi/model-catalog.ts",
"src/pi/conversation/translatePiConversation.ts",
"src/resume.ts",
"src/types.ts",
diff --git a/products/desktop/packages/api-client/src/mcp-gateway.ts b/products/desktop/packages/api-client/src/mcp-gateway.ts
new file mode 100644
index 000000000000..fa6037b27ddb
--- /dev/null
+++ b/products/desktop/packages/api-client/src/mcp-gateway.ts
@@ -0,0 +1,208 @@
+// Types for the team MCP gateway API (`/api/projects/{id}/mcp_gateway/*`).
+// Hand-written mirrors of the Django serializers in
+// products/mcp_store/backend/presentation/gateway_views.py — these endpoints
+// ship behind the `mcp-gateway` flag and are not in the generated OpenAPI
+// client yet.
+import type { Schemas } from "./generated";
+import type { McpApprovalState, McpAuthType, McpCategory } from "./types";
+
+export type McpGatewayUser = Schemas.UserBasic;
+
+export type McpGatewayScopeType = "team" | "member" | "agent";
+export type McpServiceAccountStatus = "active" | "paused";
+export type McpAuditDecision = "auto" | "approved" | "pending" | "blocked";
+export type McpAuditQuickFilter = "all" | "agents" | "approvals" | "blocked";
+export type McpPolicyDecidedBy =
+ | "rule"
+ | "scope"
+ | "team"
+ | "preset"
+ | "legacy"
+ | "default";
+
+/** One member's connection to a gateway server. */
+export interface McpGatewayConnection {
+ installation_id: string;
+ user: McpGatewayUser;
+ last_used_at: string | null;
+ pending_oauth: boolean;
+ needs_reauth: boolean;
+}
+
+/** The requesting user's own connection to a gateway server. */
+export interface McpGatewayYourConnection {
+ installation_id: string;
+ /** Per-connection switch — false when self-disabled. */
+ is_enabled: boolean;
+ pending_oauth: boolean;
+ needs_reauth: boolean;
+ last_used_at: string | null;
+}
+
+/** One agent's access to a gateway server. */
+export interface McpGatewayAgentAccess {
+ service_account_id: string;
+ name: string;
+ /** Agent identity handle, e.g. posthog-support. */
+ handle: string;
+ status: McpServiceAccountStatus;
+ last_active_at: string | null;
+ granted_by: McpGatewayUser | null;
+}
+
+/** A server registered in the team's gateway, with connection summary. */
+export interface McpGatewayServer {
+ id: string;
+ name: string;
+ url: string;
+ description: string;
+ category: McpCategory;
+ is_team_enabled: boolean;
+ icon_key: string;
+ docs_url: string;
+ template_id: string | null;
+ /**
+ * Fixed authentication type for catalog templates. Null for custom
+ * servers, where each member chooses when connecting.
+ */
+ template_auth_type: McpAuthType | null;
+ tool_count: number;
+ /** Members with a connection to this server. Admin-only; empty for members. */
+ connections: McpGatewayConnection[];
+ your_connection: McpGatewayYourConnection | null;
+ agents: McpGatewayAgentAccess[];
+ /** Ids of members whose access an admin has turned off. */
+ revoked_user_ids: number[];
+ is_revoked_for_you: boolean;
+ created_by: McpGatewayUser | null;
+ created_at: string;
+ updated_at: string;
+}
+
+export interface McpGatewayServerUpdate {
+ name?: string;
+ description?: string;
+ category?: McpCategory;
+ /** Master switch — off means members and agents can neither see nor call the server. */
+ is_team_enabled?: boolean;
+}
+
+/** Which policy scope a tools query or policy upsert targets. */
+export interface McpGatewayPolicyScope {
+ scope_type?: McpGatewayScopeType;
+ /** Member scope target. Defaults to the requesting user. */
+ scope_user_id?: number;
+ /** Agent scope target. Required when scope_type is "agent". */
+ scope_service_account_id?: string;
+}
+
+export interface McpToolPolicyEntry {
+ tool_name: string;
+ policy_state: McpApprovalState;
+}
+
+/** One tool with its effective policy for the requested scope. */
+export interface McpResolvedToolPolicy {
+ tool_name: string;
+ description: string;
+ input_schema: unknown;
+ policy_state: McpApprovalState;
+ /** What the team-level chain yields, ignoring the scope. Null when the team imposes nothing. */
+ team_state: McpApprovalState | null;
+ /** True when a rule or Blocked team ceiling leaves no editable state. */
+ locked: boolean;
+ decided_by: McpPolicyDecidedBy;
+ /** Matching org rule name, when decided_by is "rule". */
+ rule_name: string;
+ rule_description: string;
+}
+
+export interface McpServiceAccount {
+ id: string;
+ name: string;
+ description: string;
+ /** Stable identity handle the agent authenticates as, e.g. posthog-support. */
+ handle: string;
+ status: McpServiceAccountStatus;
+ /** Masked bearer token; the full token is only shown once. */
+ token_mask: string;
+ server_ids: string[];
+ last_active_at: string | null;
+ created_at: string;
+ updated_at: string;
+}
+
+export interface McpServiceAccountWithToken extends McpServiceAccount {
+ /** The full bearer token. Returned exactly once — on creation. */
+ token: string;
+}
+
+export interface McpAuditActorServiceAccount {
+ id: string;
+ name: string;
+ handle: string;
+}
+
+export interface McpAuditEvent {
+ id: string;
+ created_at: string;
+ server_name: string;
+ tool_name: string;
+ decision: McpAuditDecision;
+ actor_user: McpGatewayUser | null;
+ actor_service_account: McpAuditActorServiceAccount | null;
+ /** Denormalized actor label (email or handle) that survives deletion. */
+ actor_label: string;
+}
+
+export interface McpAuditCounts {
+ all: number;
+ agents: number;
+ approvals: number;
+ blocked: number;
+}
+
+export interface McpAuditPage {
+ count: number;
+ results: McpAuditEvent[];
+}
+
+export interface TeamMcpGatewayConfig {
+ allow_custom_servers: boolean;
+ /** Whether members may share MCP connections with agents and manage agent tool policies. */
+ allow_member_agent_access: boolean;
+ /**
+ * Whether catalog servers the team never touched (no gateway row) are
+ * enabled. Covers templates published after the admin last curated.
+ */
+ default_servers_enabled: boolean;
+ /** Whether the requesting user can administer the gateway. */
+ is_admin: boolean;
+}
+
+export interface TeamMcpGatewayConfigUpdate {
+ allow_custom_servers?: boolean;
+ allow_member_agent_access?: boolean;
+ default_servers_enabled?: boolean;
+}
+
+/** One team member's gateway posture (admin overview). */
+export interface McpGatewayMemberSummary {
+ user: McpGatewayUser;
+ is_org_admin: boolean;
+ /** Gateway servers the member has a personal connection to. */
+ connected_server_ids: string[];
+ /** Gateway servers an admin turned off for this member. */
+ revoked_server_ids: string[];
+}
+
+/**
+ * Gateway options accepted by install_custom / install_template. Credentials
+ * are always personal to the installer; agents reach them through grants.
+ */
+export interface McpGatewayInstallSharingOptions {
+ /** Whether the server starts enabled for the whole team. */
+ team_enabled?: boolean;
+ /** Service accounts to grant the server to at install time, when team settings allow it. */
+ agent_ids?: string[];
+}
diff --git a/products/desktop/packages/api-client/src/posthog-client.ts b/products/desktop/packages/api-client/src/posthog-client.ts
index 05fb47285aae..5007ffc495a3 100644
--- a/products/desktop/packages/api-client/src/posthog-client.ts
+++ b/products/desktop/packages/api-client/src/posthog-client.ts
@@ -120,11 +120,31 @@ import {
requestErrorStatus,
} from "./fetcher";
import { createApiClient, type Schemas } from "./generated";
+import type {
+ McpAuditCounts,
+ McpAuditEvent,
+ McpAuditPage,
+ McpAuditQuickFilter,
+ McpGatewayInstallSharingOptions,
+ McpGatewayMemberSummary,
+ McpGatewayPolicyScope,
+ McpGatewayServer,
+ McpGatewayServerUpdate,
+ McpResolvedToolPolicy,
+ McpServiceAccount,
+ McpServiceAccountStatus,
+ McpServiceAccountWithToken,
+ McpToolPolicyEntry,
+ TeamMcpGatewayConfig,
+ TeamMcpGatewayConfigUpdate,
+} from "./mcp-gateway";
import type { SpendAnalysisResponse } from "./spend-analysis";
import {
normalizeTaskResponse,
normalizeTaskRunResponse,
} from "./task-normalization";
+
+export type * from "./mcp-gateway";
export interface ApiClientLogger {
warn(...args: unknown[]): void;
}
@@ -4604,17 +4624,19 @@ export class PostHogAPIClient {
return data.results ?? [];
}
- async installCustomMcpServer(options: {
- name: string;
- url: string;
- auth_type: McpAuthType;
- api_key?: string;
- description?: string;
- client_id?: string;
- client_secret?: string;
- install_source?: "posthog" | "posthog-code";
- posthog_code_callback_url?: string;
- }): Promise<McpServerInstallation | Schemas.OAuthRedirectResponse> {
+ async installCustomMcpServer(
+ options: {
+ name: string;
+ url: string;
+ auth_type: McpAuthType;
+ api_key?: string;
+ description?: string;
+ client_id?: string;
+ client_secret?: string;
+ install_source?: "posthog" | "posthog-code";
+ posthog_code_callback_url?: string;
+ } & McpGatewayInstallSharingOptions,
+ ): Promise<McpServerInstallation | Schemas.OAuthRedirectResponse> {
const teamId = await this.getTeamId();
const apiUrl = new URL(
`${this.api.baseUrl}/api/environments/${teamId}/mcp_server_installations/install_custom/`,
@@ -4689,12 +4711,14 @@ export class PostHogAPIClient {
}
}
- async installMcpTemplate(options: {
- template_id: string;
- api_key?: string;
- install_source?: "posthog" | "posthog-code";
- posthog_code_callback_url?: string;
- }): Promise<McpServerInstallation | Schemas.OAuthRedirectResponse> {
+ async installMcpTemplate(
+ options: {
+ template_id: string;
+ api_key?: string;
+ install_source?: "posthog" | "posthog-code";
+ posthog_code_callback_url?: string;
+ } & McpGatewayInstallSharingOptions,
+ ): Promise<McpServerInstallation | Schemas.OAuthRedirectResponse> {
const teamId = await this.getTeamId();
const path = `/api/environments/${teamId}/mcp_server_installations/install_template/`;
const response = await this.api.fetcher.fetch({
@@ -4830,6 +4854,303 @@ export class PostHogAPIClient {
return data.results ?? [];
}
+ // ---- MCP gateway (team control plane, behind the `mcp-gateway` flag) ----
+
+ /**
+ * JSON request against the team-scoped MCP gateway API. `path` is relative
+ * to `/api/projects/{teamId}/` and must keep its trailing slash.
+ */
+ private async mcpGatewayFetch<T>(args: {
+ method: "get" | "post" | "patch" | "delete";
+ path: string;
+ search?: Record<string, string | number | undefined>;
+ body?: unknown;
+ errorLabel: string;
+ }): Promise<T> {
+ const teamId = await this.getTeamId();
+ const path = `/api/projects/${teamId}/${args.path}`;
+ const url = new URL(`${this.api.baseUrl}${path}`);
+ for (const [key, value] of Object.entries(args.search ?? {})) {
+ if (value !== undefined) url.searchParams.set(key, String(value));
+ }
+ const response = await this.api.fetcher.fetch({
+ method: args.method,
+ url,
+ path,
+ ...(args.body !== undefined
+ ? { overrides: { body: JSON.stringify(args.body) } }
+ : {}),
+ });
+ if (!response.ok && response.status !== 204) {
+ const errorData = await response.json().catch(() => ({}));
+ throw new Error(
+ (errorData as { detail?: string }).detail ??
+ `${args.errorLabel}: ${response.statusText}`,
+ );
+ }
+ if (response.status === 204) return undefined as T;
+ return (await response.json().catch(() => undefined)) as T;
+ }
+
+ async getMcpGatewayConfig(): Promise<TeamMcpGatewayConfig> {
+ return this.mcpGatewayFetch({
+ method: "get",
+ path: "mcp_gateway/config/",
+ errorLabel: "Failed to fetch gateway settings",
+ });
+ }
+
+ async updateMcpGatewaySettings(
+ update: TeamMcpGatewayConfigUpdate,
+ ): Promise<TeamMcpGatewayConfig> {
+ return this.mcpGatewayFetch({
+ method: "post",
+ path: "mcp_gateway/config/update_settings/",
+ body: update,
+ errorLabel: "Failed to update gateway settings",
+ });
+ }
+
+ /**
+ * Admin: set the team posture for untouched catalog servers and bulk-apply
+ * the same state to every existing gateway row.
+ */
+ async setAllMcpGatewayServersEnabled(
+ enabled: boolean,
+ ): Promise<TeamMcpGatewayConfig> {
+ return this.mcpGatewayFetch({
+ method: "post",
+ path: "mcp_gateway/config/set_all_servers_enabled/",
+ body: { enabled },
+ errorLabel: "Failed to update servers",
+ });
+ }
+
+ async getMcpGatewayServers(): Promise<McpGatewayServer[]> {
+ const data = await this.mcpGatewayFetch<{ results?: McpGatewayServer[] }>({
+ method: "get",
+ path: "mcp_gateway/servers/",
+ search: { limit: 500 },
+ errorLabel: "Failed to fetch gateway servers",
+ });
+ return data.results ?? [];
+ }
+
+ async getMcpGatewayServer(serverId: string): Promise<McpGatewayServer> {
+ return this.mcpGatewayFetch({
+ method: "get",
+ path: `mcp_gateway/servers/${serverId}/`,
+ errorLabel: "Failed to fetch gateway server",
+ });
+ }
+
+ async updateMcpGatewayServer(
+ serverId: string,
+ updates: McpGatewayServerUpdate,
+ ): Promise<McpGatewayServer> {
+ return this.mcpGatewayFetch({
+ method: "patch",
+ path: `mcp_gateway/servers/${serverId}/`,
+ body: updates,
+ errorLabel: "Failed to update gateway server",
+ });
+ }
+
+ /**
+ * Admin: enable or disable a catalog template the team never touched,
+ * materializing a gateway row for it (or updating the existing one).
+ */
+ async setMcpGatewayTemplateEnabled(options: {
+ templateId: string;
+ enabled: boolean;
+ }): Promise<McpGatewayServer> {
+ return this.mcpGatewayFetch({
+ method: "post",
+ path: "mcp_gateway/servers/set_template_enabled/",
+ body: { template_id: options.templateId, enabled: options.enabled },
+ errorLabel: "Failed to update catalog server",
+ });
+ }
+
+ /**
+ * Disconnect every member and delete the row. The registry is sparse, so a
+ * deleted catalog server simply follows the team default again.
+ */
+ async deleteMcpGatewayServer(serverId: string): Promise<void> {
+ await this.mcpGatewayFetch<void>({
+ method: "delete",
+ path: `mcp_gateway/servers/${serverId}/`,
+ errorLabel: "Failed to remove gateway server",
+ });
+ }
+
+ /** Tool catalog with the effective policy resolved for one scope. */
+ async getMcpGatewayToolPolicies(
+ serverId: string,
+ scope: McpGatewayPolicyScope = {},
+ ): Promise<McpResolvedToolPolicy[]> {
+ const data = await this.mcpGatewayFetch<{
+ results?: McpResolvedToolPolicy[];
+ }>({
+ method: "get",
+ path: `mcp_gateway/servers/${serverId}/tools/`,
+ search: {
+ scope_type: scope.scope_type,
+ scope_user_id: scope.scope_user_id,
+ scope_service_account_id: scope.scope_service_account_id,
+ },
+ errorLabel: "Failed to fetch tool policies",
+ });
+ return data.results ?? [];
+ }
+
+ /** Upsert per-tool states for a scope; returns the re-resolved catalog. */
+ async upsertMcpGatewayToolPolicies(
+ serverId: string,
+ options: McpGatewayPolicyScope & { policies: McpToolPolicyEntry[] },
+ ): Promise<McpResolvedToolPolicy[]> {
+ const data = await this.mcpGatewayFetch<{
+ results?: McpResolvedToolPolicy[];
+ }>({
+ method: "post",
+ path: `mcp_gateway/servers/${serverId}/policies/`,
+ body: options,
+ errorLabel: "Failed to update tool policies",
+ });
+ return data.results ?? [];
+ }
+
+ async getMcpServiceAccounts(): Promise<McpServiceAccount[]> {
+ const data = await this.mcpGatewayFetch<{ results?: McpServiceAccount[] }>({
+ method: "get",
+ path: "mcp_gateway/service_accounts/",
+ search: { limit: 500 },
+ errorLabel: "Failed to fetch service accounts",
+ });
+ return data.results ?? [];
+ }
+
+ async getMcpServiceAccount(accountId: string): Promise<McpServiceAccount> {
+ return this.mcpGatewayFetch({
+ method: "get",
+ path: `mcp_gateway/service_accounts/${accountId}/`,
+ errorLabel: "Failed to fetch service account",
+ });
+ }
+
+ /** Returns the full bearer token exactly once. */
+ async createMcpServiceAccount(options: {
+ name: string;
+ description?: string;
+ }): Promise<McpServiceAccountWithToken> {
+ return this.mcpGatewayFetch({
+ method: "post",
+ path: "mcp_gateway/service_accounts/",
+ body: options,
+ errorLabel: "Failed to create service account",
+ });
+ }
+
+ async updateMcpServiceAccount(
+ accountId: string,
+ updates: {
+ name?: string;
+ description?: string;
+ status?: McpServiceAccountStatus;
+ },
+ ): Promise<McpServiceAccount> {
+ return this.mcpGatewayFetch({
+ method: "patch",
+ path: `mcp_gateway/service_accounts/${accountId}/`,
+ body: updates,
+ errorLabel: "Failed to update service account",
+ });
+ }
+
+ async deleteMcpServiceAccount(accountId: string): Promise<void> {
+ await this.mcpGatewayFetch<void>({
+ method: "delete",
+ path: `mcp_gateway/service_accounts/${accountId}/`,
+ errorLabel: "Failed to delete service account",
+ });
+ }
+
+ /** Grant or revoke one agent's access to one gateway server. */
+ async setMcpServiceAccountAccess(
+ accountId: string,
+ options: {
+ gateway_server_id: string;
+ enabled: boolean;
+ /** Agent-scope tool policies to set alongside the grant. */
+ policies?: McpToolPolicyEntry[];
+ },
+ ): Promise<McpServiceAccount> {
+ return this.mcpGatewayFetch({
+ method: "post",
+ path: `mcp_gateway/service_accounts/${accountId}/access/`,
+ body: options,
+ errorLabel: "Failed to update agent access",
+ });
+ }
+
+ async getMcpGatewayMembers(): Promise<McpGatewayMemberSummary[]> {
+ const data = await this.mcpGatewayFetch<{
+ results?: McpGatewayMemberSummary[];
+ }>({
+ method: "get",
+ path: "mcp_gateway/members/",
+ search: { limit: 500 },
+ errorLabel: "Failed to fetch gateway members",
+ });
+ return data.results ?? [];
+ }
+
+ /** Turn one gateway server off (or back on) for one member. */
+ async setMcpGatewayMemberAccess(
+ userId: number,
+ options: { gateway_server_id: string; enabled: boolean },
+ ): Promise<void> {
+ await this.mcpGatewayFetch<void>({
+ method: "post",
+ path: `mcp_gateway/members/${userId}/set_access/`,
+ body: options,
+ errorLabel: "Failed to update member access",
+ });
+ }
+
+ async getMcpGatewayAuditEvents(
+ options: {
+ quickFilter?: McpAuditQuickFilter;
+ actorServiceAccountId?: string;
+ limit?: number;
+ offset?: number;
+ } = {},
+ ): Promise<McpAuditPage> {
+ const data = await this.mcpGatewayFetch<{
+ count?: number;
+ results?: McpAuditEvent[];
+ }>({
+ method: "get",
+ path: "mcp_gateway/audit/",
+ search: {
+ quick_filter: options.quickFilter,
+ actor_service_account_id: options.actorServiceAccountId,
+ limit: options.limit,
+ offset: options.offset,
+ },
+ errorLabel: "Failed to fetch audit log",
+ });
+ return { count: data.count ?? 0, results: data.results ?? [] };
+ }
+
+ async getMcpGatewayAuditCounts(): Promise<McpAuditCounts> {
+ return this.mcpGatewayFetch({
+ method: "get",
+ path: "mcp_gateway/audit/counts/",
+ errorLabel: "Failed to fetch audit counts",
+ });
+ }
+
private parseFetcherError(error: unknown): {
status: number;
body: Record<string, unknown>;
diff --git a/products/desktop/packages/api-client/src/types.ts b/products/desktop/packages/api-client/src/types.ts
index 0c6146081cb4..e63cfd4a1adc 100644
--- a/products/desktop/packages/api-client/src/types.ts
+++ b/products/desktop/packages/api-client/src/types.ts
@@ -6,8 +6,15 @@ export type McpApprovalState =
Schemas.MCPServerInstallationToolApprovalStateEnum;
export type McpAuthType = Schemas.MCPAuthTypeEnum;
export type McpRecommendedServer = Schemas.MCPServerTemplate;
-export type McpServerInstallation = Schemas.MCPServerInstallation;
-export type McpInstallationTool = Schemas.MCPServerInstallationTool;
+export type McpServerInstallation = Schemas.MCPServerInstallation & {
+ scope?: "personal" | "shared";
+};
+export type McpInstallationTool = Schemas.MCPServerInstallationTool & {
+ /** Team-admin ceiling returned by gateway-aware backends. */
+ team_state?: McpApprovalState | null;
+ locked?: boolean;
+ decided_by?: "rule" | "scope" | "team" | "preset" | "legacy" | "default";
+};
export type McpOAuthRedirectResponse = Schemas.OAuthRedirectResponse;
export type McpInstallSource = "posthog" | "posthog-code" | "posthog-mobile";
export type McpInstallResponse =
diff --git a/products/desktop/packages/core/src/canvas/channelItems.test.ts b/products/desktop/packages/core/src/canvas/channelItems.test.ts
index 59e986179069..63cec64f724d 100644
--- a/products/desktop/packages/core/src/canvas/channelItems.test.ts
+++ b/products/desktop/packages/core/src/canvas/channelItems.test.ts
@@ -157,6 +157,7 @@ function model(over: Partial<ChannelItemModel> = {}): ChannelItemModel {
authorName: null,
authorUuid: ME.uuid,
templateId: null,
+ task: null,
...over,
};
}
diff --git a/products/desktop/packages/core/src/canvas/channelItems.ts b/products/desktop/packages/core/src/canvas/channelItems.ts
index 4834e6603ac4..9bd9214fce83 100644
--- a/products/desktop/packages/core/src/canvas/channelItems.ts
+++ b/products/desktop/packages/core/src/canvas/channelItems.ts
@@ -17,6 +17,15 @@ export interface ChannelItemModel {
authorName: string | null;
authorUuid: string | null;
templateId: string | null;
+ /**
+ * The source task record for `kind: "task"` rows, `null` for canvases. Rows
+ * need the whole task, not a projection of it: the status dot is derived from
+ * session/workspace/viewed state that only the renderer holds, and the hooks
+ * that supply it (`useChannelTaskData`, `useTaskPrStatus`) take a `Task`.
+ * Carrying the reference here keeps that a lookup the list already did rather
+ * than a second pass over every row.
+ */
+ task: Task | null;
}
export interface ChannelItemOwner {
@@ -60,6 +69,7 @@ export function buildChannelItems({
authorName: d.createdBy ?? null,
authorUuid: d.createdByUuid ?? null,
templateId: d.templateId,
+ task: null,
}));
const taskItems: ChannelItemModel[] = feedTasks.flatMap((task) =>
@@ -78,6 +88,7 @@ export function buildChannelItems({
authorName: null,
authorUuid: task.created_by?.uuid ?? null,
templateId: null,
+ task,
},
],
);
diff --git a/products/desktop/packages/core/src/cloud-task/cloud-task-engine.ts b/products/desktop/packages/core/src/cloud-task/cloud-task-engine.ts
index 05e297f77912..abb90c5789a4 100644
--- a/products/desktop/packages/core/src/cloud-task/cloud-task-engine.ts
+++ b/products/desktop/packages/core/src/cloud-task/cloud-task-engine.ts
@@ -31,6 +31,12 @@ const SSE_RECONNECT_BASE_DELAY_MS = 500;
const SSE_RECONNECT_FLAT_ATTEMPTS = 3;
const SSE_RECONNECT_MAX_DELAY_MS = 30_000;
const SSE_HEALTHY_CONNECTION_MS = 60_000;
+// The backend emits a keepalive at least every ~25-30s (see SSE_KEEPALIVE_INTERVAL_MS in
+// packages/agent). A half-open socket (laptop sleep, unplugged NIC, NAT rebind) neither errors
+// nor EOFs, so `reader.read()` awaits forever with nothing to trigger reconnect. This timeout
+// treats "no bytes at all for a few keepalive intervals" as a disconnect so it flows into the
+// existing reconnect/backoff machinery instead of hanging the watcher indefinitely.
+const SSE_IDLE_TIMEOUT_MS = 90_000;
const EVENT_BATCH_FLUSH_MS = 16;
const EVENT_BATCH_MAX_SIZE = 50;
const SESSION_LOG_PAGE_LIMIT = 5_000;
@@ -1256,12 +1262,75 @@ export class CloudTaskEngine extends TypedEventEmitter<CloudTaskEvents> {
const controller = new AbortController();
watcher.sseAbortController = controller;
+ let connectedAt = 0;
+ let streamWasEstablished = false;
+ let bytesReceived = 0;
+ let eventsReceived = 0;
+ let idleTimedOut = false;
+ let idleTimeoutHandle: ReturnType<typeof setTimeout> | null = null;
+ let idlePhase: "target_resolution" | "connection" | "stream" =
+ "target_resolution";
+
+ const clearIdleTimeout = () => {
+ if (idleTimeoutHandle) {
+ clearTimeout(idleTimeoutHandle);
+ idleTimeoutHandle = null;
+ }
+ };
+ const armIdleTimeout = () => {
+ clearIdleTimeout();
+ idleTimeoutHandle = setTimeout(() => {
+ idleTimedOut = true;
+ controller.abort();
+ }, SSE_IDLE_TIMEOUT_MS);
+ };
+ const recordIdleTimeout = (details: Record<string, unknown> = {}) => {
+ const idleWatcher = this.watchers.get(key);
+ this.log.warn("Cloud task stream idle timeout, no bytes received", {
+ key,
+ phase: idlePhase,
+ idleTimeoutMs: SSE_IDLE_TIMEOUT_MS,
+ bytesReceived,
+ eventsReceived,
+ connectionDurationMs: streamWasEstablished
+ ? Date.now() - connectedAt
+ : 0,
+ ...details,
+ });
+ if (idleWatcher) {
+ this.analytics.track(ANALYTICS_EVENTS.CLOUD_STREAM_IDLE_TIMEOUT, {
+ task_id: idleWatcher.taskId,
+ run_id: idleWatcher.runId,
+ team_id: idleWatcher.teamId,
+ idle_timeout_ms: SSE_IDLE_TIMEOUT_MS,
+ bytes_received: bytesReceived,
+ events_received: eventsReceived,
+ });
+ }
+ };
+
watcher.connStartedAt = 0;
watcher.connDataEventsReceived = 0;
// Resolve the read target once (proxy URL + token, or Django), reused across reconnects.
if (!watcher.streamTargetResolved) {
- await this.resolveStreamTarget(watcher);
+ armIdleTimeout();
+ try {
+ await this.resolveStreamTarget(watcher, controller.signal);
+ } catch (error) {
+ if (!idleTimedOut) {
+ return;
+ }
+ recordIdleTimeout();
+ await this.handleStreamCompletion(key, {
+ reconnectOnDisconnect: true,
+ reconnectError: error,
+ countReconnectAttempt: true,
+ });
+ return;
+ } finally {
+ clearIdleTimeout();
+ }
const resolvedWatcher = this.watchers.get(key);
if (
!resolvedWatcher ||
@@ -1340,12 +1409,11 @@ export class CloudTaskEngine extends TypedEventEmitter<CloudTaskEvents> {
// Track how long the body stayed open so healthy long-lived connections cut by churn
// aren't penalized as failed reconnects (see SSE_HEALTHY_CONNECTION_MS).
- let connectedAt = 0;
- let streamWasEstablished = false;
- let bytesReceived = 0;
- let eventsReceived = 0;
-
+ // Re-armed on every read that returns a value (data or keepalive bytes), so it only fires
+ // when the transport has gone completely silent, not merely between infrequent events.
try {
+ idlePhase = "connection";
+ armIdleTimeout();
// The proxy authenticates with the run-scoped Bearer token; the Django leg uses the session.
const response = usingProxy
? await this.streamFetch(url.toString(), {
@@ -1401,6 +1469,8 @@ export class CloudTaskEngine extends TypedEventEmitter<CloudTaskEvents> {
});
const reader = response.body.getReader();
+ idlePhase = "stream";
+ armIdleTimeout();
while (true) {
const { done, value } = await reader.read();
@@ -1408,6 +1478,8 @@ export class CloudTaskEngine extends TypedEventEmitter<CloudTaskEvents> {
break;
}
+ armIdleTimeout();
+
if (!value) {
continue;
}
@@ -1463,10 +1535,20 @@ export class CloudTaskEngine extends TypedEventEmitter<CloudTaskEvents> {
} catch (error) {
this.flushLogBatch(key);
- if (controller.signal.aborted) {
+ // An idle-timeout abort must fall through to the reconnect machinery below rather than
+ // return here like a deliberate cancel (disconnectSse/stopWatching), since nothing else
+ // will ever notice this connection went silent.
+ if (controller.signal.aborted && !idleTimedOut) {
return;
}
+ if (idleTimedOut) {
+ recordIdleTimeout({
+ leg,
+ streamUrl: url.toString(),
+ });
+ }
+
// Proxy-leg 401: the read token expired or its signing key rotated. Re-resolve to mint a
// fresh token (or route back to Django) instead of failing. Django-leg 401 stays fatal below.
const unauthorizedWatcher = this.watchers.get(key);
@@ -1506,6 +1588,7 @@ export class CloudTaskEngine extends TypedEventEmitter<CloudTaskEvents> {
const isBackendError = error instanceof BackendStreamError;
const wasHealthyStream =
!isBackendError &&
+ !idleTimedOut &&
streamWasEstablished &&
Date.now() - connectedAt >= SSE_HEALTHY_CONNECTION_MS;
@@ -1548,6 +1631,7 @@ export class CloudTaskEngine extends TypedEventEmitter<CloudTaskEvents> {
countReconnectAttempt: !isBackendError && !wasHealthyStream,
});
} finally {
+ clearIdleTimeout();
const currentWatcher = this.watchers.get(key);
if (currentWatcher?.sseAbortController === controller) {
currentWatcher.sseAbortController = null;
@@ -2198,11 +2282,15 @@ export class CloudTaskEngine extends TypedEventEmitter<CloudTaskEvents> {
}
}
- private async resolveStreamTarget(watcher: WatcherState): Promise<void> {
+ private async resolveStreamTarget(
+ watcher: WatcherState,
+ signal: AbortSignal,
+ ): Promise<void> {
const url = `${watcher.apiHost}/api/projects/${watcher.teamId}/tasks/${watcher.taskId}/runs/${watcher.runId}/stream_token/`;
try {
const response = await this.auth.authenticatedFetch(url, {
method: "GET",
+ signal,
});
if (!response.ok) {
watcher.streamBaseUrl = null;
@@ -2245,6 +2333,9 @@ export class CloudTaskEngine extends TypedEventEmitter<CloudTaskEvents> {
durableStream: watcher.durableStreamEnabled,
});
} catch (error) {
+ if (signal.aborted) {
+ throw error;
+ }
// Transient failure: leave unresolved so the next reconnect retries and falls back to Django.
watcher.streamBaseUrl = null;
watcher.streamReadToken = null;
diff --git a/products/desktop/packages/core/src/cloud-task/cloud-task.test.ts b/products/desktop/packages/core/src/cloud-task/cloud-task.test.ts
index 689abbda3709..edd17ec0fa9e 100644
--- a/products/desktop/packages/core/src/cloud-task/cloud-task.test.ts
+++ b/products/desktop/packages/core/src/cloud-task/cloud-task.test.ts
@@ -94,6 +94,7 @@ async function waitFor(
describe("CloudTaskEngine", () => {
let service: CloudTaskEngine;
+ let analyticsMock: { track: ReturnType<typeof vi.fn> };
beforeEach(() => {
const scopedLog = {
@@ -103,7 +104,7 @@ describe("CloudTaskEngine", () => {
error: vi.fn(),
};
const loggerMock = { ...scopedLog, scope: vi.fn(() => scopedLog) };
- const analyticsMock = { track: vi.fn() };
+ analyticsMock = { track: vi.fn() };
service = createCloudTaskEngine({
auth: mockAuthService as never,
analytics: analyticsMock as never,
@@ -2404,6 +2405,220 @@ describe("CloudTaskEngine", () => {
).toBe(false);
});
+ it("aborts and reconnects a stream that goes silent with no bytes or keepalives", async () => {
+ vi.useFakeTimers();
+
+ const updates: unknown[] = [];
+ service.on(CloudTaskEvent.Update, (payload) => updates.push(payload));
+
+ const makeInProgressRun = () =>
+ createJsonResponse({
+ id: "run-1",
+ status: "in_progress",
+ stage: null,
+ output: null,
+ error_message: null,
+ branch: "main",
+ updated_at: "2026-01-01T00:00:00Z",
+ });
+
+ mockNetFetch
+ .mockResolvedValueOnce(makeInProgressRun())
+ .mockResolvedValueOnce(
+ createJsonResponse([], 200, { "X-Has-More": "false" }),
+ )
+ .mockImplementation(() => Promise.resolve(makeInProgressRun()));
+
+ // First connection hangs forever: no bytes, no error, no EOF, simulating a half-open
+ // socket (laptop sleep, NAT rebind). The second connection stays open so recovery is
+ // observable once the idle watchdog aborts the first.
+ let streamCall = 0;
+ const abortedFirstConnection = { value: false };
+ mockStreamFetch.mockImplementation(
+ (_input: unknown, init?: RequestInit) => {
+ streamCall += 1;
+ if (streamCall === 1) {
+ const stream = new ReadableStream<Uint8Array>({
+ start(controller) {
+ // Never enqueue or close on our own; the read() promise awaits forever until the
+ // idle watchdog aborts it below, mirroring how a real fetch's reader rejects once
+ // its AbortSignal fires.
+ init?.signal?.addEventListener("abort", () => {
+ abortedFirstConnection.value = true;
+ controller.error(new DOMException("Aborted", "AbortError"));
+ });
+ },
+ });
+ return Promise.resolve(
+ new Response(stream, {
+ status: 200,
+ headers: { "Content-Type": "text/event-stream" },
+ }),
+ );
+ }
+ const stream = new ReadableStream<Uint8Array>({
+ start() {},
+ });
+ return Promise.resolve(
+ new Response(stream, {
+ status: 200,
+ headers: { "Content-Type": "text/event-stream" },
+ }),
+ );
+ },
+ );
+
+ service.watch({
+ taskId: "task-1",
+ runId: "run-1",
+ apiHost: "https://app.example.com",
+ teamId: 2,
+ });
+
+ await waitFor(() => mockStreamFetch.mock.calls.length === 1);
+
+ // Nothing throws or EOFs; without the idle watchdog this would hang forever.
+ await vi.advanceTimersByTimeAsync(60_000);
+ expect(abortedFirstConnection.value).toBe(false);
+
+ await vi.advanceTimersByTimeAsync(40_000);
+ await waitFor(() => abortedFirstConnection.value, 20_000);
+ await waitFor(() => mockStreamFetch.mock.calls.length >= 2, 20_000);
+
+ expect(
+ analyticsMock.track.mock.calls.some(
+ ([eventName]) => eventName === "Cloud stream idle timeout",
+ ),
+ ).toBe(true);
+
+ const watcher = (
+ service as unknown as {
+ watchers: Map<string, { failed: boolean; reconnectAttempts: number }>;
+ }
+ ).watchers.get("task-1:run-1");
+ expect(watcher?.failed).toBe(false);
+ // Silence is a broken transport, not a healthy long-lived connection. It must consume the
+ // reconnect budget so a persistently silent endpoint eventually reaches the circuit breaker.
+ expect(watcher?.reconnectAttempts).toBe(1);
+ expect(
+ updates.some(
+ (u) =>
+ typeof u === "object" &&
+ u !== null &&
+ (u as { kind?: string }).kind === "error",
+ ),
+ ).toBe(false);
+ });
+
+ it("times out while resolving the stream target and reconnects", async () => {
+ vi.useFakeTimers();
+
+ mockNetFetch
+ .mockResolvedValueOnce(
+ createJsonResponse({ id: "run-1", status: "in_progress" }),
+ )
+ .mockResolvedValueOnce(
+ createJsonResponse([], 200, { "X-Has-More": "false" }),
+ )
+ .mockResolvedValue(
+ createJsonResponse({ id: "run-1", status: "in_progress" }),
+ );
+
+ let tokenCall = 0;
+ const abortedResolution = { value: false };
+ mockStreamTokenFetch.mockImplementation(
+ (_input: unknown, init?: RequestInit) => {
+ tokenCall += 1;
+ if (tokenCall === 1) {
+ return new Promise<Response>((_resolve, reject) => {
+ init?.signal?.addEventListener("abort", () => {
+ abortedResolution.value = true;
+ reject(new DOMException("Aborted", "AbortError"));
+ });
+ });
+ }
+ return Promise.resolve(
+ createJsonResponse({ token: "test-token", stream_base_url: null }),
+ );
+ },
+ );
+ mockStreamFetch.mockImplementation(
+ () =>
+ new Promise<Response>(() => {
+ // The connection-phase watchdog owns this second pending request.
+ }),
+ );
+
+ service.watch({
+ taskId: "task-1",
+ runId: "run-1",
+ apiHost: "https://app.example.com",
+ teamId: 2,
+ });
+
+ await waitFor(() => mockStreamTokenFetch.mock.calls.length === 1);
+ await vi.advanceTimersByTimeAsync(100_000);
+ await waitFor(() => abortedResolution.value, 20_000);
+ await waitFor(() => mockStreamTokenFetch.mock.calls.length >= 2, 20_000);
+
+ expect(mockStreamTokenFetch.mock.calls[0]?.[1]?.signal).toBeDefined();
+ expect(
+ analyticsMock.track.mock.calls.some(
+ ([eventName]) => eventName === "Cloud stream idle timeout",
+ ),
+ ).toBe(true);
+ });
+
+ it("times out while waiting for stream response headers and reconnects", async () => {
+ vi.useFakeTimers();
+
+ mockNetFetch
+ .mockResolvedValueOnce(
+ createJsonResponse({ id: "run-1", status: "in_progress" }),
+ )
+ .mockResolvedValueOnce(
+ createJsonResponse([], 200, { "X-Has-More": "false" }),
+ )
+ .mockResolvedValue(
+ createJsonResponse({ id: "run-1", status: "in_progress" }),
+ );
+
+ let streamCall = 0;
+ const abortedConnection = { value: false };
+ mockStreamFetch.mockImplementation(
+ (_input: unknown, init?: RequestInit) => {
+ streamCall += 1;
+ if (streamCall === 1) {
+ return new Promise<Response>((_resolve, reject) => {
+ init?.signal?.addEventListener("abort", () => {
+ abortedConnection.value = true;
+ reject(new DOMException("Aborted", "AbortError"));
+ });
+ });
+ }
+ return Promise.resolve(createOpenSseResponse(""));
+ },
+ );
+
+ service.watch({
+ taskId: "task-1",
+ runId: "run-1",
+ apiHost: "https://app.example.com",
+ teamId: 2,
+ });
+
+ await waitFor(() => mockStreamFetch.mock.calls.length === 1);
+ await vi.advanceTimersByTimeAsync(100_000);
+ await waitFor(() => abortedConnection.value, 20_000);
+ await waitFor(() => mockStreamFetch.mock.calls.length >= 2, 20_000);
+
+ expect(
+ analyticsMock.track.mock.calls.some(
+ ([eventName]) => eventName === "Cloud stream idle timeout",
+ ),
+ ).toBe(true);
+ });
+
it("stops a cloud run through the run cancel endpoint", async () => {
mockNetFetch.mockResolvedValueOnce(
createJsonResponse({ id: "run-1", status: "in_progress" }, 202),
diff --git a/products/desktop/packages/core/src/mcp-gateway/gatewayAddServer.test.ts b/products/desktop/packages/core/src/mcp-gateway/gatewayAddServer.test.ts
new file mode 100644
index 000000000000..b59815ff0bc9
--- /dev/null
+++ b/products/desktop/packages/core/src/mcp-gateway/gatewayAddServer.test.ts
@@ -0,0 +1,85 @@
+import { describe, expect, it } from "vitest";
+import {
+ buildGatewayInstallRequest,
+ canSubmitGatewayServer,
+ GATEWAY_ADD_SERVER_DEFAULTS,
+ type GatewayAddServerValues,
+} from "./gatewayAddServer";
+
+function values(
+ overrides: Partial<GatewayAddServerValues> = {},
+): GatewayAddServerValues {
+ return {
+ ...GATEWAY_ADD_SERVER_DEFAULTS,
+ name: "Internal Wiki",
+ url: "https://mcp.example.com/sse",
+ ...overrides,
+ };
+}
+
+describe("canSubmitGatewayServer", () => {
+ it.each([
+ ["valid name and url", values(), true],
+ ["missing name", values({ name: " " }), false],
+ ["invalid url", values({ url: "not-a-url" }), false],
+ ])("%s", (_label, input, expected) => {
+ expect(canSubmitGatewayServer(input)).toBe(expected);
+ });
+});
+
+describe("buildGatewayInstallRequest", () => {
+ it("builds an oauth install with admin team options", () => {
+ const request = buildGatewayInstallRequest(
+ values({ description: " Wiki tools ", agentIds: ["svc-1"] }),
+ { isAdmin: true, canManageAgentAccess: true },
+ );
+ expect(request).toEqual({
+ name: "Internal Wiki",
+ url: "https://mcp.example.com/sse",
+ description: "Wiki tools",
+ auth_type: "oauth",
+ team_enabled: true,
+ agent_ids: ["svc-1"],
+ });
+ });
+
+ it("includes the key on api-key installs", () => {
+ const request = buildGatewayInstallRequest(
+ values({ authType: "api_key", apiKey: "sk-123" }),
+ { isAdmin: true, canManageAgentAccess: true },
+ );
+ expect(request.auth_type).toBe("api_key");
+ expect(request.api_key).toBe("sk-123");
+ });
+
+ it("includes oauth client credentials only when provided", () => {
+ const bare = buildGatewayInstallRequest(values(), {
+ isAdmin: true,
+ canManageAgentAccess: true,
+ });
+ expect(bare.client_id).toBeUndefined();
+ const withCreds = buildGatewayInstallRequest(
+ values({ clientId: " id ", clientSecret: "secret" }),
+ { isAdmin: true, canManageAgentAccess: true },
+ );
+ expect(withCreds.client_id).toBe("id");
+ expect(withCreds.client_secret).toBe("secret");
+ });
+
+ it("lets permitted members share with agents without team enablement", () => {
+ const request = buildGatewayInstallRequest(
+ values({ agentIds: ["svc-1"] }),
+ { isAdmin: false, canManageAgentAccess: true },
+ );
+ expect(request.team_enabled).toBeUndefined();
+ expect(request.agent_ids).toEqual(["svc-1"]);
+ });
+
+ it("omits agent grants when team settings make them admin-only", () => {
+ const request = buildGatewayInstallRequest(
+ values({ agentIds: ["svc-1"] }),
+ { isAdmin: false, canManageAgentAccess: false },
+ );
+ expect(request.agent_ids).toBeUndefined();
+ });
+});
diff --git a/products/desktop/packages/core/src/mcp-gateway/gatewayAddServer.ts b/products/desktop/packages/core/src/mcp-gateway/gatewayAddServer.ts
new file mode 100644
index 000000000000..23870376d7f9
--- /dev/null
+++ b/products/desktop/packages/core/src/mcp-gateway/gatewayAddServer.ts
@@ -0,0 +1,77 @@
+import type {
+ McpAuthType,
+ McpGatewayInstallSharingOptions,
+} from "@posthog/api-client/posthog-client";
+import { isValidMcpUrl } from "../mcp-servers/customServerForm";
+
+export interface GatewayAddServerValues {
+ name: string;
+ url: string;
+ description: string;
+ authType: McpAuthType;
+ apiKey: string;
+ clientId: string;
+ clientSecret: string;
+ /** Team sharing options are admin-only; agentIds follows the team setting. */
+ teamEnabled: boolean;
+ agentIds: string[];
+}
+
+export const GATEWAY_ADD_SERVER_DEFAULTS: GatewayAddServerValues = {
+ name: "",
+ url: "",
+ description: "",
+ authType: "oauth",
+ apiKey: "",
+ clientId: "",
+ clientSecret: "",
+ teamEnabled: true,
+ agentIds: [],
+};
+
+export function canSubmitGatewayServer(
+ values: Pick<GatewayAddServerValues, "name" | "url">,
+): boolean {
+ return values.name.trim() !== "" && isValidMcpUrl(values.url);
+}
+
+export interface GatewayInstallRequest extends McpGatewayInstallSharingOptions {
+ name: string;
+ url: string;
+ description: string;
+ auth_type: McpAuthType;
+ api_key?: string;
+ client_id?: string;
+ client_secret?: string;
+}
+
+/**
+ * install_custom payload for registering a server with the gateway. The
+ * credential is always personal to the installer. Team-wide options are
+ * attached only for admins; agent grants are attached whenever the team
+ * allows this member to manage agent access.
+ */
+export function buildGatewayInstallRequest(
+ values: GatewayAddServerValues,
+ options: { isAdmin: boolean; canManageAgentAccess: boolean },
+): GatewayInstallRequest {
+ return {
+ name: values.name.trim(),
+ url: values.url.trim(),
+ description: values.description.trim(),
+ auth_type: values.authType,
+ ...(values.authType === "api_key" && values.apiKey
+ ? { api_key: values.apiKey }
+ : {}),
+ ...(values.authType === "oauth" && values.clientId.trim()
+ ? { client_id: values.clientId.trim() }
+ : {}),
+ ...(values.authType === "oauth" && values.clientSecret.trim()
+ ? { client_secret: values.clientSecret.trim() }
+ : {}),
+ ...(options.isAdmin ? { team_enabled: values.teamEnabled } : {}),
+ ...(options.canManageAgentAccess && values.agentIds.length
+ ? { agent_ids: values.agentIds }
+ : {}),
+ };
+}
diff --git a/products/desktop/packages/core/src/mcp-gateway/gatewayConnect.test.ts b/products/desktop/packages/core/src/mcp-gateway/gatewayConnect.test.ts
new file mode 100644
index 000000000000..67a27f7e1f13
--- /dev/null
+++ b/products/desktop/packages/core/src/mcp-gateway/gatewayConnect.test.ts
@@ -0,0 +1,215 @@
+import { describe, expect, it, vi } from "vitest";
+import type {
+ InstallFlowClient,
+ IOAuthCallback,
+} from "../mcp-servers/installFlow";
+import {
+ canSubmitGatewayConnect,
+ connectGatewayServer,
+ GATEWAY_CONNECT_DEFAULTS,
+ type GatewayConnectCredentials,
+ gatewayConnectAuthType,
+ gatewayConnectNeedsCredentials,
+ templateConnectNeedsCredentials,
+} from "./gatewayConnect";
+
+function credentials(
+ overrides: Partial<GatewayConnectCredentials> = {},
+): GatewayConnectCredentials {
+ return { ...GATEWAY_CONNECT_DEFAULTS, ...overrides };
+}
+
+function fakes() {
+ const client: InstallFlowClient = {
+ installMcpTemplate: vi.fn().mockResolvedValue({ id: "inst-1" }),
+ installCustomMcpServer: vi.fn().mockResolvedValue({ id: "inst-2" }),
+ authorizeMcpInstallation: vi
+ .fn()
+ .mockResolvedValue({ redirect_url: "https://auth" }),
+ };
+ const oauth: IOAuthCallback = {
+ getCallbackUrl: vi
+ .fn()
+ .mockResolvedValue({ callbackUrl: "posthog://callback" }),
+ openAndWaitForCallback: vi.fn().mockResolvedValue({ success: true }),
+ };
+ return { client, oauth };
+}
+
+describe("gatewayConnectAuthType", () => {
+ it.each([
+ [
+ "oauth template",
+ { template_id: "t1", template_auth_type: "oauth" },
+ "oauth",
+ ],
+ [
+ "api-key template",
+ { template_id: "t1", template_auth_type: "api_key" },
+ "api_key",
+ ],
+ [
+ "template with no reported type",
+ { template_id: "t1", template_auth_type: null },
+ "oauth",
+ ],
+ [
+ "custom server — member chooses",
+ { template_id: null, template_auth_type: null },
+ null,
+ ],
+ ] as const)("%s", (_label, server, expected) => {
+ expect(gatewayConnectAuthType(server)).toBe(expected);
+ });
+});
+
+describe("gatewayConnectNeedsCredentials", () => {
+ it.each([
+ [
+ "oauth template connects directly",
+ { template_id: "t1", template_auth_type: "oauth" },
+ false,
+ ],
+ [
+ "api-key template asks for the key",
+ { template_id: "t1", template_auth_type: "api_key" },
+ true,
+ ],
+ [
+ "custom server asks the member to choose",
+ { template_id: null, template_auth_type: null },
+ true,
+ ],
+ ] as const)("%s", (_label, server, expected) => {
+ expect(gatewayConnectNeedsCredentials(server)).toBe(expected);
+ });
+});
+
+describe("templateConnectNeedsCredentials", () => {
+ it.each([
+ ["oauth template", { auth_type: "oauth" }, false],
+ ["api-key template", { auth_type: "api_key" }, true],
+ ["auth type unreported", {}, false],
+ ] as const)("%s", (_label, template, expected) => {
+ expect(
+ templateConnectNeedsCredentials(
+ template as { auth_type?: "oauth" | "api_key" },
+ ),
+ ).toBe(expected);
+ });
+});
+
+describe("canSubmitGatewayConnect", () => {
+ it.each([
+ ["oauth needs no key", credentials(), true],
+ [
+ "api_key with a key",
+ credentials({ authType: "api_key", apiKey: "sk-1" }),
+ true,
+ ],
+ [
+ "api_key with a blank key",
+ credentials({ authType: "api_key", apiKey: " " }),
+ false,
+ ],
+ ])("%s", (_label, input, expected) => {
+ expect(canSubmitGatewayConnect(input)).toBe(expected);
+ });
+});
+
+describe("connectGatewayServer", () => {
+ const template = {
+ template_id: "t1",
+ name: "Linear",
+ url: "https://mcp.linear.app",
+ description: "",
+ };
+ const custom = {
+ template_id: null,
+ name: "Internal Wiki",
+ url: "https://mcp.example.com/sse",
+ description: "Wiki tools",
+ };
+
+ it("installs a template with the member's API key", async () => {
+ const { client, oauth } = fakes();
+ await connectGatewayServer(
+ client,
+ oauth,
+ template,
+ credentials({ authType: "api_key", apiKey: "sk-1" }),
+ );
+ expect(client.installMcpTemplate).toHaveBeenCalledWith({
+ template_id: "t1",
+ api_key: "sk-1",
+ install_source: "posthog-code",
+ posthog_code_callback_url: "posthog://callback",
+ });
+ expect(client.installCustomMcpServer).not.toHaveBeenCalled();
+ });
+
+ it("installs an oauth template without a key by default", async () => {
+ const { client, oauth } = fakes();
+ await connectGatewayServer(client, oauth, template);
+ expect(client.installMcpTemplate).toHaveBeenCalledWith({
+ template_id: "t1",
+ api_key: undefined,
+ install_source: "posthog-code",
+ posthog_code_callback_url: "posthog://callback",
+ });
+ });
+
+ it("connects a custom server with the chosen api_key mechanism", async () => {
+ const { client, oauth } = fakes();
+ const result = await connectGatewayServer(
+ client,
+ oauth,
+ custom,
+ credentials({
+ authType: "api_key",
+ apiKey: "sk-2",
+ // A stale value from flipping the auth select must not leak through.
+ clientId: "leftover",
+ clientSecret: "leftover",
+ }),
+ );
+ expect(client.installCustomMcpServer).toHaveBeenCalledWith({
+ name: "Internal Wiki",
+ url: "https://mcp.example.com/sse",
+ description: "Wiki tools",
+ auth_type: "api_key",
+ api_key: "sk-2",
+ client_id: undefined,
+ client_secret: undefined,
+ install_source: "posthog-code",
+ posthog_code_callback_url: "posthog://callback",
+ });
+ // API-key installs return no redirect, so no browser round-trip.
+ expect(oauth.openAndWaitForCallback).not.toHaveBeenCalled();
+ expect(result).toEqual({ success: true });
+ });
+
+ it("connects a custom server over oauth with optional client credentials", async () => {
+ const { client, oauth } = fakes();
+ vi.mocked(client.installCustomMcpServer).mockResolvedValue({
+ redirect_url: "https://auth.example.com",
+ });
+ await connectGatewayServer(
+ client,
+ oauth,
+ custom,
+ credentials({ clientId: " id ", clientSecret: "secret" }),
+ );
+ expect(client.installCustomMcpServer).toHaveBeenCalledWith(
+ expect.objectContaining({
+ auth_type: "oauth",
+ api_key: undefined,
+ client_id: "id",
+ client_secret: "secret",
+ }),
+ );
+ expect(oauth.openAndWaitForCallback).toHaveBeenCalledWith({
+ redirectUrl: "https://auth.example.com",
+ });
+ });
+});
diff --git a/products/desktop/packages/core/src/mcp-gateway/gatewayConnect.ts b/products/desktop/packages/core/src/mcp-gateway/gatewayConnect.ts
new file mode 100644
index 000000000000..798b4d87fae7
--- /dev/null
+++ b/products/desktop/packages/core/src/mcp-gateway/gatewayConnect.ts
@@ -0,0 +1,113 @@
+import type {
+ McpAuthType,
+ McpGatewayServer,
+} from "@posthog/api-client/posthog-client";
+import {
+ type InstallFlowClient,
+ type IOAuthCallback,
+ installCustomWithOAuth,
+ installTemplateWithOAuth,
+ type OAuthCallbackResult,
+} from "../mcp-servers/installFlow";
+
+/** Personal credentials a member supplies when connecting to a gateway server. */
+export interface GatewayConnectCredentials {
+ authType: McpAuthType;
+ apiKey: string;
+ /** Optional OAuth client for providers without dynamic client registration. */
+ clientId: string;
+ clientSecret: string;
+}
+
+export const GATEWAY_CONNECT_DEFAULTS: GatewayConnectCredentials = {
+ authType: "oauth",
+ apiKey: "",
+ clientId: "",
+ clientSecret: "",
+};
+
+type GatewayConnectServer = Pick<
+ McpGatewayServer,
+ "template_id" | "template_auth_type"
+>;
+
+/**
+ * The auth mechanism a connection must use: catalog templates fix it, custom
+ * servers leave it null — every credential is personal, so each member picks
+ * their own mechanism when they connect.
+ */
+export function gatewayConnectAuthType(
+ server: GatewayConnectServer,
+): McpAuthType | null {
+ return server.template_id ? (server.template_auth_type ?? "oauth") : null;
+}
+
+/**
+ * OAuth connects need no input up front — the browser round-trip collects the
+ * grant. Everything else (API-key templates, custom servers where the member
+ * chooses) must collect credentials before installing.
+ */
+export function gatewayConnectNeedsCredentials(
+ server: GatewayConnectServer,
+): boolean {
+ return gatewayConnectAuthType(server) !== "oauth";
+}
+
+/** Same decision for a catalog template with no gateway row yet. */
+export function templateConnectNeedsCredentials(template: {
+ auth_type?: McpAuthType;
+}): boolean {
+ return (template.auth_type ?? "oauth") !== "oauth";
+}
+
+export function canSubmitGatewayConnect(
+ credentials: Pick<GatewayConnectCredentials, "authType" | "apiKey">,
+): boolean {
+ return credentials.authType !== "api_key" || credentials.apiKey.trim() !== "";
+}
+
+export interface GatewayConnectTarget {
+ template_id: string | null;
+ name: string;
+ url: string;
+ description: string;
+}
+
+/**
+ * Connect the caller's own credential to a gateway server, or to a catalog
+ * template with no row yet — the backend materializes the row. Honors the
+ * chosen auth mechanism instead of assuming OAuth: API-key connects complete
+ * inline, OAuth connects round-trip the host browser callback.
+ */
+export async function connectGatewayServer(
+ client: InstallFlowClient,
+ oauth: IOAuthCallback,
+ target: GatewayConnectTarget,
+ credentials: GatewayConnectCredentials = GATEWAY_CONNECT_DEFAULTS,
+): Promise<OAuthCallbackResult> {
+ const apiKey =
+ credentials.authType === "api_key" && credentials.apiKey
+ ? credentials.apiKey
+ : undefined;
+ if (target.template_id) {
+ return installTemplateWithOAuth(client, oauth, {
+ template_id: target.template_id,
+ api_key: apiKey,
+ });
+ }
+ return installCustomWithOAuth(client, oauth, {
+ name: target.name,
+ url: target.url,
+ description: target.description,
+ auth_type: credentials.authType,
+ api_key: apiKey,
+ client_id:
+ credentials.authType === "oauth" && credentials.clientId.trim()
+ ? credentials.clientId.trim()
+ : undefined,
+ client_secret:
+ credentials.authType === "oauth" && credentials.clientSecret.trim()
+ ? credentials.clientSecret.trim()
+ : undefined,
+ });
+}
diff --git a/products/desktop/packages/core/src/mcp-gateway/gatewayInstallFlow.ts b/products/desktop/packages/core/src/mcp-gateway/gatewayInstallFlow.ts
new file mode 100644
index 000000000000..5c1a22d89b33
--- /dev/null
+++ b/products/desktop/packages/core/src/mcp-gateway/gatewayInstallFlow.ts
@@ -0,0 +1,40 @@
+import type { McpServerInstallation } from "@posthog/api-client/types";
+import type {
+ IOAuthCallback,
+ OAuthCallbackResult,
+} from "../mcp-servers/installFlow";
+import type { GatewayInstallRequest } from "./gatewayAddServer";
+
+interface OAuthRedirect {
+ redirect_url: string;
+}
+
+interface GatewayInstallClient {
+ installCustomMcpServer(
+ options: GatewayInstallRequest & {
+ install_source?: "posthog" | "posthog-code";
+ posthog_code_callback_url?: string;
+ },
+ ): Promise<McpServerInstallation | OAuthRedirect>;
+}
+
+/**
+ * Register a custom server with the gateway. OAuth servers round-trip through
+ * the host browser callback; API-key servers complete immediately.
+ */
+export async function registerGatewayServerWithOAuth(
+ client: GatewayInstallClient,
+ oauth: IOAuthCallback,
+ request: GatewayInstallRequest,
+): Promise<OAuthCallbackResult> {
+ const { callbackUrl } = await oauth.getCallbackUrl();
+ const data = await client.installCustomMcpServer({
+ ...request,
+ install_source: "posthog-code",
+ posthog_code_callback_url: callbackUrl,
+ });
+ if ("redirect_url" in data && data.redirect_url) {
+ return oauth.openAndWaitForCallback({ redirectUrl: data.redirect_url });
+ }
+ return { success: true };
+}
diff --git a/products/desktop/packages/core/src/mcp-gateway/gatewayServers.test.ts b/products/desktop/packages/core/src/mcp-gateway/gatewayServers.test.ts
new file mode 100644
index 000000000000..e4be219d718e
--- /dev/null
+++ b/products/desktop/packages/core/src/mcp-gateway/gatewayServers.test.ts
@@ -0,0 +1,491 @@
+import type {
+ McpGatewayServer,
+ McpGatewayYourConnection,
+ McpResolvedToolPolicy,
+} from "@posthog/api-client/posthog-client";
+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
+import {
+ countGatewayServersByCategory,
+ countPoliciesByState,
+ defaultAgentGrantPolicy,
+ filterCatalogTemplates,
+ filterGatewayServers,
+ formatAgo,
+ formatAuditTime,
+ getGatewayConnectionStatus,
+ getGatewayRailStatus,
+ getGatewayServerRemovalAction,
+ isAgentPolicyState,
+ isConnectedForYou,
+ isPolicyStateAllowedByCeiling,
+ normalizeGatewayServerUrl,
+ railConnectedServers,
+ recommendedCatalogTemplates,
+ resolvePolicyStateForScope,
+} from "./gatewayServers";
+
+describe("agent tool policies", () => {
+ it.each([
+ ["approved", true],
+ ["needs_approval", false],
+ ["do_not_use", true],
+ ] as const)("allows %s for agents: %s", (state, expected) => {
+ expect(isAgentPolicyState(state)).toBe(expected);
+ });
+
+ it("treats approval-gated tools as blocked for agents only", () => {
+ expect(resolvePolicyStateForScope("needs_approval", "agent")).toBe(
+ "do_not_use",
+ );
+ expect(resolvePolicyStateForScope("needs_approval", "member")).toBe(
+ "needs_approval",
+ );
+ expect(resolvePolicyStateForScope("needs_approval", "team")).toBe(
+ "needs_approval",
+ );
+ });
+});
+
+describe("isPolicyStateAllowedByCeiling", () => {
+ it.each([
+ ["approved", "needs_approval", false],
+ ["needs_approval", "needs_approval", true],
+ ["do_not_use", "needs_approval", true],
+ ["approved", "do_not_use", false],
+ ["needs_approval", "do_not_use", false],
+ ["do_not_use", "do_not_use", true],
+ ["approved", "approved", true],
+ ["approved", null, true],
+ ] as const)("%s under a %s ceiling is %s", (state, ceiling, expected) => {
+ expect(isPolicyStateAllowedByCeiling(state, ceiling)).toBe(expected);
+ });
+});
+
+function connection(
+ overrides: Partial<McpGatewayYourConnection> = {},
+): McpGatewayYourConnection {
+ return {
+ installation_id: "inst-1",
+ is_enabled: true,
+ pending_oauth: false,
+ needs_reauth: false,
+ last_used_at: null,
+ ...overrides,
+ };
+}
+
+function server(overrides: Partial<McpGatewayServer>): McpGatewayServer {
+ return {
+ id: "srv-1",
+ name: "Test",
+ url: "https://mcp.example.com",
+ description: "",
+ category: "dev",
+ is_team_enabled: true,
+ icon_key: "",
+ docs_url: "",
+ template_id: null,
+ template_auth_type: null,
+ tool_count: 0,
+ connections: [],
+ your_connection: null,
+ agents: [],
+ revoked_user_ids: [],
+ is_revoked_for_you: false,
+ created_by: null,
+ created_at: "2026-01-01T00:00:00Z",
+ updated_at: "2026-01-01T00:00:00Z",
+ ...overrides,
+ };
+}
+
+describe("railConnectedServers", () => {
+ const servers = [
+ server({ id: "a", name: "Alpha", your_connection: connection() }),
+ server({ id: "b", name: "Beta" }),
+ server({ id: "c", name: "Gamma", your_connection: connection() }),
+ ];
+
+ it("lists only the servers the caller has connected", () => {
+ expect(railConnectedServers(servers, "").map((s) => s.id)).toEqual([
+ "a",
+ "c",
+ ]);
+ });
+
+ it("filters by name", () => {
+ expect(railConnectedServers(servers, "gam").map((s) => s.id)).toEqual([
+ "c",
+ ]);
+ });
+});
+
+describe("filterGatewayServers", () => {
+ const servers = [
+ server({ id: "a", name: "Linear", description: "Ticket tracker" }),
+ server({
+ id: "b",
+ name: "GitHub",
+ description: "Code hosting",
+ category: "data",
+ }),
+ server({ id: "c", name: "Notion", url: "https://mcp.notion.so" }),
+ ];
+
+ it("matches name, description and url case-insensitively", () => {
+ expect(filterGatewayServers(servers, "TICKET", null)[0]?.id).toBe("a");
+ expect(filterGatewayServers(servers, "notion.so", null)[0]?.id).toBe("c");
+ });
+
+ it("applies the category chip", () => {
+ expect(filterGatewayServers(servers, "", "data").map((s) => s.id)).toEqual([
+ "b",
+ ]);
+ });
+
+ it("combines search and category", () => {
+ expect(filterGatewayServers(servers, "linear", "data")).toEqual([]);
+ });
+});
+
+describe("filterCatalogTemplates", () => {
+ const templates = [
+ { id: "t1", name: "Linear", description: "Tickets", url: "https://a" },
+ { id: "t2", name: "GitHub", url: "https://b", category: "data" },
+ ];
+
+ it("matches name/description/url and tolerates missing fields", () => {
+ expect(filterCatalogTemplates(templates, "tickets", null)).toEqual([
+ templates[0],
+ ]);
+ expect(filterCatalogTemplates(templates, "https://b", null)).toEqual([
+ templates[1],
+ ]);
+ });
+
+ it("applies the category chip", () => {
+ expect(filterCatalogTemplates(templates, "", "data")).toEqual([
+ templates[1],
+ ]);
+ });
+});
+
+describe("normalizeGatewayServerUrl", () => {
+ it.each([
+ ["https://mcp.linear.app/sse/", "https://mcp.linear.app/sse"],
+ ["https://mcp.linear.app/sse", "https://mcp.linear.app/sse"],
+ [" https://mcp.linear.app// ", "https://mcp.linear.app"],
+ ])("normalizes %s", (input, expected) => {
+ expect(normalizeGatewayServerUrl(input)).toBe(expected);
+ });
+});
+
+describe("recommendedCatalogTemplates", () => {
+ const templates = [
+ { id: "t1", url: "https://mcp.linear.app/sse" },
+ { id: "t2", url: "https://mcp.notion.so/mcp" },
+ { id: "t3", url: "https://mcp.stripe.com" },
+ ];
+
+ it("excludes templates already materialized by template id", () => {
+ const servers = [server({ template_id: "t1", url: "https://elsewhere" })];
+ expect(recommendedCatalogTemplates(servers, templates)).toEqual([
+ templates[1],
+ templates[2],
+ ]);
+ });
+
+ it("excludes templates matched by trailing-slash-insensitive url", () => {
+ const servers = [
+ server({ template_id: null, url: "https://mcp.notion.so/mcp/" }),
+ ];
+ expect(recommendedCatalogTemplates(servers, templates)).toEqual([
+ templates[0],
+ templates[2],
+ ]);
+ });
+
+ it("returns every template when the registry is empty", () => {
+ expect(recommendedCatalogTemplates([], templates)).toEqual(templates);
+ });
+});
+
+describe("countGatewayServersByCategory", () => {
+ it("tallies per category", () => {
+ const counts = countGatewayServersByCategory([
+ server({ id: "a", category: "dev" }),
+ server({ id: "b", category: "dev" }),
+ server({ id: "c", category: "data" }),
+ ]);
+ expect(counts).toEqual({ dev: 2, data: 1 });
+ });
+});
+
+describe("isConnectedForYou", () => {
+ it.each([
+ ["own connection", server({ your_connection: connection() }), true],
+ [
+ "pending oauth does not count",
+ server({ your_connection: connection({ pending_oauth: true }) }),
+ false,
+ ],
+ [
+ "connection needing reauth does not count",
+ server({ your_connection: connection({ needs_reauth: true }) }),
+ false,
+ ],
+ ["not connected", server({}), false],
+ ] as const)("%s", (_label, srv, expected) => {
+ expect(isConnectedForYou(srv)).toBe(expected);
+ });
+});
+
+describe("getGatewayConnectionStatus", () => {
+ it.each([
+ ["connected", connection(), "connected"],
+ ["pending OAuth", connection({ pending_oauth: true }), "pending_oauth"],
+ [
+ "needs reauthorization",
+ connection({ needs_reauth: true }),
+ "needs_reauth",
+ ],
+ [
+ "reauthorization takes precedence when both flags are set",
+ connection({ pending_oauth: true, needs_reauth: true }),
+ "needs_reauth",
+ ],
+ ] as const)("returns the status for %s", (_label, value, expected) => {
+ expect(getGatewayConnectionStatus(value)).toBe(expected);
+ });
+});
+
+describe("getGatewayRailStatus", () => {
+ it.each([
+ ["no connection", server({}), null],
+ [
+ "a usable connection",
+ server({ your_connection: connection() }),
+ "connected",
+ ],
+ [
+ "a connection pending OAuth",
+ server({ your_connection: connection({ pending_oauth: true }) }),
+ "pending_oauth",
+ ],
+ [
+ "a connection needing reauthorization",
+ server({ your_connection: connection({ needs_reauth: true }) }),
+ "needs_reauth",
+ ],
+ [
+ "a self-disabled connection",
+ server({ your_connection: connection({ is_enabled: false }) }),
+ "self_disabled",
+ ],
+ [
+ "revoked access",
+ server({ is_revoked_for_you: true, your_connection: connection() }),
+ "revoked",
+ ],
+ [
+ "a team-disabled server",
+ server({ is_team_enabled: false, your_connection: connection() }),
+ "team_off",
+ ],
+ [
+ "self-disabled outranking the auth states",
+ server({
+ your_connection: connection({ is_enabled: false, needs_reauth: true }),
+ }),
+ "self_disabled",
+ ],
+ [
+ "revocation outranking self-disable",
+ server({
+ is_revoked_for_you: true,
+ your_connection: connection({ is_enabled: false }),
+ }),
+ "revoked",
+ ],
+ [
+ "the team master switch outranking everything",
+ server({
+ is_team_enabled: false,
+ is_revoked_for_you: true,
+ your_connection: connection({ is_enabled: false, needs_reauth: true }),
+ }),
+ "team_off",
+ ],
+ ] as const)("returns the status for %s", (_label, srv, expected) => {
+ expect(getGatewayRailStatus(srv)).toBe(expected);
+ });
+});
+
+describe("getGatewayServerRemovalAction", () => {
+ const gatewayUser = (id: number) => ({
+ id,
+ uuid: `user-${id}`,
+ email: `user-${id}@example.com`,
+ hedgehog_config: null,
+ });
+
+ // Members never receive `connections` (it is admin-only), so every
+ // non-admin case keeps the default empty roster — the real API shape.
+ it.each([
+ [
+ "deletes a personally added custom server",
+ server({
+ created_by: gatewayUser(1),
+ your_connection: connection(),
+ }),
+ false,
+ 1,
+ "delete_for_you",
+ ],
+ [
+ "disconnects from a custom server added by someone else",
+ server({
+ created_by: gatewayUser(2),
+ your_connection: connection(),
+ }),
+ false,
+ 1,
+ "disconnect",
+ ],
+ [
+ "disconnects from a custom server with no recorded creator",
+ server({
+ created_by: null,
+ your_connection: connection(),
+ }),
+ false,
+ 1,
+ "disconnect",
+ ],
+ [
+ "disconnects when the current user is unknown",
+ server({
+ created_by: gatewayUser(1),
+ your_connection: connection(),
+ }),
+ false,
+ null,
+ "disconnect",
+ ],
+ [
+ "disconnects from a catalog server",
+ server({
+ template_id: "template-1",
+ created_by: gatewayUser(1),
+ your_connection: connection(),
+ }),
+ false,
+ 1,
+ "disconnect",
+ ],
+ [
+ "deletes a custom server for everyone when requested by an admin",
+ server({}),
+ true,
+ 1,
+ "delete_for_everyone",
+ ],
+ [
+ "does not delete a catalog server for an admin without a connection",
+ server({ template_id: "template-1" }),
+ true,
+ 1,
+ null,
+ ],
+ [
+ "returns no action without a personal connection",
+ server({}),
+ false,
+ 1,
+ null,
+ ],
+ ] as const)("%s", (_label, srv, isAdmin, currentUserId, expected) => {
+ expect(getGatewayServerRemovalAction(srv, isAdmin, currentUserId)).toBe(
+ expected,
+ );
+ });
+});
+
+describe("countPoliciesByState", () => {
+ it("counts each state, defaulting to zero", () => {
+ const policy = (state: McpResolvedToolPolicy["policy_state"]) =>
+ ({
+ tool_name: "t",
+ description: "",
+ input_schema: {},
+ policy_state: state,
+ team_state: null,
+ locked: false,
+ decided_by: "default",
+ rule_name: "",
+ rule_description: "",
+ }) satisfies McpResolvedToolPolicy;
+ expect(
+ countPoliciesByState([
+ policy("approved"),
+ policy("approved"),
+ policy("do_not_use"),
+ ]),
+ ).toEqual({ approved: 2, needs_approval: 0, do_not_use: 1 });
+ });
+
+ it("counts approval-gated agent tools as blocked", () => {
+ expect(
+ countPoliciesByState(
+ [
+ {
+ tool_name: "send_message",
+ description: "",
+ input_schema: {},
+ policy_state: "needs_approval",
+ team_state: null,
+ locked: false,
+ decided_by: "scope",
+ rule_name: "",
+ rule_description: "",
+ },
+ ],
+ "agent",
+ ),
+ ).toEqual({ approved: 0, needs_approval: 0, do_not_use: 1 });
+ });
+});
+
+describe("time formatting", () => {
+ beforeEach(() => {
+ vi.useFakeTimers();
+ vi.setSystemTime(new Date("2026-07-21T12:00:00"));
+ });
+ afterEach(() => {
+ vi.useRealTimers();
+ });
+
+ it("formatAgo renders short relative times", () => {
+ expect(formatAgo("2026-07-21T10:00:00")).toBe("2h ago");
+ expect(formatAgo("2026-07-21T11:59:50")).toBe("just now");
+ expect(formatAgo(null)).toBeNull();
+ });
+
+ it("formatAuditTime buckets by local day", () => {
+ expect(formatAuditTime("2026-07-21T09:58:00")).toBe("Today 09:58");
+ expect(formatAuditTime("2026-07-20T17:22:00")).toBe("Yesterday 17:22");
+ expect(formatAuditTime("2026-07-15T09:12:00")).toMatch(/^Jul 15 09:12$/);
+ });
+});
+
+describe("defaultAgentGrantPolicy", () => {
+ it.each([
+ ["delete-row", "do_not_use"],
+ ["run-migration", "do_not_use"],
+ ["send", "do_not_use"],
+ ["list-tables", "approved"],
+ ["search", "approved"],
+ ] as const)("%s → %s", (tool, expected) => {
+ expect(defaultAgentGrantPolicy(tool)).toBe(expected);
+ });
+});
diff --git a/products/desktop/packages/core/src/mcp-gateway/gatewayServers.ts b/products/desktop/packages/core/src/mcp-gateway/gatewayServers.ts
new file mode 100644
index 000000000000..cb70f8594904
--- /dev/null
+++ b/products/desktop/packages/core/src/mcp-gateway/gatewayServers.ts
@@ -0,0 +1,292 @@
+import type {
+ McpApprovalState,
+ McpAuditDecision,
+ McpGatewayScopeType,
+ McpGatewayServer,
+ McpGatewayYourConnection,
+ McpResolvedToolPolicy,
+} from "@posthog/api-client/posthog-client";
+import { formatRelativeTimeShort, getLocalDayDiff } from "@posthog/shared";
+
+/** The rail lists the servers the caller has connected, under the rail search. */
+export function railConnectedServers(
+ servers: McpGatewayServer[],
+ search: string,
+): McpGatewayServer[] {
+ const query = search.trim().toLowerCase();
+ return servers.filter(
+ (server) =>
+ server.your_connection !== null &&
+ (!query || server.name.toLowerCase().includes(query)),
+ );
+}
+
+interface GatewayServerLike {
+ name: string;
+ description?: string;
+ url: string;
+ category?: string;
+}
+
+function matchesSearchAndCategory(
+ entry: GatewayServerLike,
+ query: string,
+ category: string | null,
+): boolean {
+ if (category && entry.category !== category) return false;
+ if (!query) return true;
+ return (
+ entry.name.toLowerCase().includes(query) ||
+ (entry.description ?? "").toLowerCase().includes(query) ||
+ entry.url.toLowerCase().includes(query)
+ );
+}
+
+/** Home-screen filter: search over name/description/url plus category chip. */
+export function filterGatewayServers(
+ servers: McpGatewayServer[],
+ search: string,
+ category: string | null,
+): McpGatewayServer[] {
+ const query = search.trim().toLowerCase();
+ return servers.filter((server) =>
+ matchesSearchAndCategory(server, query, category),
+ );
+}
+
+/** Same search/category filter, for catalog templates on the home screen. */
+export function filterCatalogTemplates<T extends GatewayServerLike>(
+ templates: T[],
+ search: string,
+ category: string | null,
+): T[] {
+ const query = search.trim().toLowerCase();
+ return templates.filter((template) =>
+ matchesSearchAndCategory(template, query, category),
+ );
+}
+
+/** Trailing-slash-insensitive URL identity for row/template matching. */
+export function normalizeGatewayServerUrl(url: string): string {
+ return url.trim().replace(/\/+$/, "");
+}
+
+/**
+ * The registry is sparse: a catalog template has a gateway row only once
+ * someone connected to it or an admin toggled it. "Recommended" templates are
+ * the active catalog entries with no row — matched neither by template id nor
+ * by URL (trailing-slash-insensitive) — shown as connect-only cards.
+ */
+export function recommendedCatalogTemplates<
+ T extends { id: string; url: string },
+>(
+ servers: Pick<McpGatewayServer, "template_id" | "url">[],
+ templates: T[],
+): T[] {
+ const rowTemplateIds = new Set<string>();
+ const rowUrls = new Set<string>();
+ for (const server of servers) {
+ if (server.template_id) rowTemplateIds.add(server.template_id);
+ rowUrls.add(normalizeGatewayServerUrl(server.url));
+ }
+ return templates.filter(
+ (template) =>
+ !rowTemplateIds.has(template.id) &&
+ !rowUrls.has(normalizeGatewayServerUrl(template.url)),
+ );
+}
+
+export function countGatewayServersByCategory(
+ servers: McpGatewayServer[],
+): Record<string, number> {
+ const counts: Record<string, number> = {};
+ for (const server of servers) {
+ counts[server.category] = (counts[server.category] ?? 0) + 1;
+ }
+ return counts;
+}
+
+/**
+ * Whether the current user can call this server without connecting first —
+ * every credential is the caller's own, so this is their connection's state.
+ */
+export function isConnectedForYou(server: McpGatewayServer): boolean {
+ return (
+ !!server.your_connection &&
+ getGatewayConnectionStatus(server.your_connection) === "connected"
+ );
+}
+
+export type GatewayConnectionStatus =
+ | "connected"
+ | "pending_oauth"
+ | "needs_reauth";
+
+/** A persisted installation row is not necessarily a usable connection. */
+export function getGatewayConnectionStatus(
+ connection: Pick<McpGatewayYourConnection, "pending_oauth" | "needs_reauth">,
+): GatewayConnectionStatus {
+ if (connection.needs_reauth) return "needs_reauth";
+ if (connection.pending_oauth) return "pending_oauth";
+ return "connected";
+}
+
+export type GatewayRailStatus =
+ | GatewayConnectionStatus
+ | "team_off"
+ | "revoked"
+ | "self_disabled";
+
+/**
+ * Rail-row status: folds the switches the raw connection status can't see —
+ * the admin master switch, per-user revocation, and the caller's own enable
+ * toggle — so a connection that can't be used never reads as connected. The
+ * auth states only matter once all three switches are on. Null when the
+ * caller has no connection.
+ */
+export function getGatewayRailStatus(
+ server: Pick<
+ McpGatewayServer,
+ "is_team_enabled" | "is_revoked_for_you" | "your_connection"
+ >,
+): GatewayRailStatus | null {
+ const connection = server.your_connection;
+ if (!connection) return null;
+ if (!server.is_team_enabled) return "team_off";
+ if (server.is_revoked_for_you) return "revoked";
+ if (!connection.is_enabled) return "self_disabled";
+ return getGatewayConnectionStatus(connection);
+}
+
+export type GatewayServerRemovalAction =
+ | "delete_for_everyone"
+ | "delete_for_you"
+ | "disconnect";
+
+/**
+ * Admins remove custom servers from the team gateway. For members, a custom
+ * server they registered themselves is theirs to delete; catalog servers and
+ * custom servers registered by somebody else remain team entries, so removing
+ * the caller's installation is presented as disconnecting instead.
+ *
+ * The caller's identity must come in from the session user —
+ * `server.connections` is admin-only (empty for members), so it cannot
+ * identify a member caller.
+ */
+export function getGatewayServerRemovalAction(
+ server: McpGatewayServer,
+ isAdmin: boolean,
+ currentUserId: number | null,
+): GatewayServerRemovalAction | null {
+ if (isAdmin && server.template_id === null) return "delete_for_everyone";
+
+ if (!server.your_connection) return null;
+
+ const personallyAddedCustomServer =
+ server.template_id === null &&
+ server.created_by !== null &&
+ server.created_by.id === currentUserId;
+
+ return personallyAddedCustomServer ? "delete_for_you" : "disconnect";
+}
+
+export type GatewayPolicyCounts = Record<McpApprovalState, number>;
+
+export const AGENT_POLICY_STATES = [
+ "approved",
+ "do_not_use",
+] as const satisfies readonly McpApprovalState[];
+
+export type AgentPolicyState = (typeof AGENT_POLICY_STATES)[number];
+
+export function isAgentPolicyState(
+ state: McpApprovalState,
+): state is AgentPolicyState {
+ return state !== "needs_approval";
+}
+
+/**
+ * Agents have no approval responder. A policy that would wait for approval is
+ * therefore unavailable to the agent, just like an explicit block.
+ */
+export function resolvePolicyStateForScope(
+ state: McpApprovalState,
+ scopeType: McpGatewayScopeType,
+): McpApprovalState {
+ return scopeType === "agent" && state === "needs_approval"
+ ? "do_not_use"
+ : state;
+}
+
+const POLICY_STRICTNESS: Record<McpApprovalState, number> = {
+ approved: 0,
+ needs_approval: 1,
+ do_not_use: 2,
+};
+
+/** A scope may match the team ceiling or choose a more restrictive state. */
+export function isPolicyStateAllowedByCeiling(
+ state: McpApprovalState,
+ ceiling: McpApprovalState | null | undefined,
+): boolean {
+ return ceiling === null || ceiling === undefined
+ ? true
+ : POLICY_STRICTNESS[state] >= POLICY_STRICTNESS[ceiling];
+}
+
+export function countPoliciesByState(
+ policies: McpResolvedToolPolicy[],
+ scopeType: McpGatewayScopeType = "member",
+): GatewayPolicyCounts {
+ const counts: GatewayPolicyCounts = {
+ approved: 0,
+ needs_approval: 0,
+ do_not_use: 0,
+ };
+ for (const policy of policies) {
+ counts[resolvePolicyStateForScope(policy.policy_state, scopeType)] += 1;
+ }
+ return counts;
+}
+
+/** "2h ago" / "just now" for last-used and last-active timestamps. */
+export function formatAgo(timestamp: string | null): string | null {
+ if (!timestamp) return null;
+ const short = formatRelativeTimeShort(timestamp);
+ return short === "now" ? "just now" : `${short} ago`;
+}
+
+/** Audit-table timestamp: "Today 09:58", "Yesterday 17:22", "Jul 15 09:12". */
+export function formatAuditTime(timestamp: string, now?: Date): string {
+ const date = new Date(timestamp);
+ const dayDiff = getLocalDayDiff(date, now);
+ const time = date.toLocaleTimeString(undefined, {
+ hour: "2-digit",
+ minute: "2-digit",
+ hour12: false,
+ });
+ if (dayDiff <= 0) return `Today ${time}`;
+ if (dayDiff === 1) return `Yesterday ${time}`;
+ const day = date.toLocaleDateString(undefined, {
+ month: "short",
+ day: "numeric",
+ });
+ return `${day} ${time}`;
+}
+
+export const AUDIT_DECISION_LABELS: Record<McpAuditDecision, string> = {
+ auto: "Auto-approved",
+ approved: "Approved",
+ pending: "Awaiting approval",
+ blocked: "Blocked",
+};
+
+// Mirrors the backend's destructive-tool heuristic; only used to seed the
+// per-tool defaults when sharing a server with an agent.
+const DESTRUCTIVE_TOOL_RE =
+ /delete|update|post|write|create|run-migration|close|drop|send/;
+
+/** Default policy offered when granting an agent access to a tool. */
+export function defaultAgentGrantPolicy(toolName: string): AgentPolicyState {
+ return DESTRUCTIVE_TOOL_RE.test(toolName) ? "do_not_use" : "approved";
+}
diff --git a/products/desktop/packages/core/src/mcp-gateway/gatewayToolDiscovery.test.ts b/products/desktop/packages/core/src/mcp-gateway/gatewayToolDiscovery.test.ts
new file mode 100644
index 000000000000..d90e8004c266
--- /dev/null
+++ b/products/desktop/packages/core/src/mcp-gateway/gatewayToolDiscovery.test.ts
@@ -0,0 +1,179 @@
+import type {
+ McpGatewayServer,
+ McpGatewayYourConnection,
+} from "@posthog/api-client/posthog-client";
+import { describe, expect, it, vi } from "vitest";
+import {
+ discoverGatewayTools,
+ findGatewayServer,
+ shouldDiscoverGatewayTools,
+ usableInstallationId,
+} from "./gatewayToolDiscovery";
+
+function connection(
+ overrides: Partial<McpGatewayYourConnection> = {},
+): McpGatewayYourConnection {
+ return {
+ installation_id: "inst-1",
+ is_enabled: true,
+ pending_oauth: false,
+ needs_reauth: false,
+ last_used_at: null,
+ ...overrides,
+ };
+}
+
+function server(overrides: Partial<McpGatewayServer> = {}): McpGatewayServer {
+ return {
+ id: "srv-1",
+ name: "Linear",
+ url: "https://mcp.linear.app/sse",
+ description: "",
+ category: "dev",
+ is_team_enabled: true,
+ icon_key: "",
+ docs_url: "",
+ template_id: null,
+ template_auth_type: null,
+ tool_count: 0,
+ connections: [],
+ your_connection: null,
+ agents: [],
+ revoked_user_ids: [],
+ is_revoked_for_you: false,
+ created_by: null,
+ created_at: "2026-01-01T00:00:00Z",
+ updated_at: "2026-01-01T00:00:00Z",
+ ...overrides,
+ };
+}
+
+function client(servers: McpGatewayServer[]) {
+ return {
+ getMcpGatewayServers: vi.fn().mockResolvedValue(servers),
+ refreshMcpInstallationTools: vi.fn().mockResolvedValue([]),
+ };
+}
+
+describe("findGatewayServer", () => {
+ const servers = [
+ server({ id: "srv-1", template_id: "linear", url: "https://a.example" }),
+ server({
+ id: "srv-2",
+ template_id: null,
+ url: "https://b.example/",
+ your_connection: connection({ installation_id: "inst-2" }),
+ }),
+ ];
+
+ it.each([
+ ["by id", { serverId: "srv-2" }, "srv-2"],
+ ["by installation", { installationId: "inst-2" }, "srv-2"],
+ ["by template", { templateId: "linear" }, "srv-1"],
+ ["by url", { url: "https://b.example" }, "srv-2"],
+ [
+ "by url ignoring a trailing slash",
+ { url: "https://a.example/" },
+ "srv-1",
+ ],
+ [
+ "falls back to url when the template misses",
+ { templateId: "unknown", url: "https://b.example" },
+ "srv-2",
+ ],
+ ])("matches %s", (_label, match, expected) => {
+ expect(findGatewayServer(servers, match)?.id).toBe(expected);
+ });
+
+ it.each([
+ ["nothing matches", { serverId: "missing" }],
+ ["no match criteria", {}],
+ ])("returns null when %s", (_label, match) => {
+ expect(findGatewayServer(servers, match)).toBeNull();
+ });
+});
+
+describe("usableInstallationId", () => {
+ it.each([
+ ["a connected credential", connection(), "inst-1"],
+ ["a self-disabled connection", connection({ is_enabled: false }), "inst-1"],
+ ["a pending oauth connection", connection({ pending_oauth: true }), null],
+ ["a stale connection", connection({ needs_reauth: true }), null],
+ ["no connection", null, null],
+ ])("resolves %s", (_label, your_connection, expected) => {
+ expect(usableInstallationId(server({ your_connection }))).toBe(expected);
+ });
+
+ it("returns null without a server", () => {
+ expect(usableInstallationId(null)).toBeNull();
+ });
+});
+
+describe("shouldDiscoverGatewayTools", () => {
+ it.each([
+ ["an empty catalog and a live connection", 0, connection(), true],
+ ["an already-populated catalog", 12, connection(), false],
+ ["no usable connection", 0, connection({ needs_reauth: true }), false],
+ ])("is %s -> %s", (_label, tool_count, your_connection, expected) => {
+ expect(
+ shouldDiscoverGatewayTools(server({ tool_count, your_connection })),
+ ).toBe(expected);
+ });
+});
+
+describe("discoverGatewayTools", () => {
+ it("lists tools through the caller's fresh connection", async () => {
+ const api = client([server({ your_connection: connection() })]);
+
+ const result = await discoverGatewayTools(api, { serverId: "srv-1" });
+
+ expect(api.refreshMcpInstallationTools).toHaveBeenCalledWith("inst-1");
+ expect(result).toEqual({
+ serverId: "srv-1",
+ installationId: "inst-1",
+ discovered: true,
+ });
+ });
+
+ it("re-reads the registry so a just-created row is visible", async () => {
+ const api = client([
+ server({ template_id: "linear", your_connection: connection() }),
+ ]);
+
+ await discoverGatewayTools(api, { templateId: "linear" });
+
+ expect(api.getMcpGatewayServers).toHaveBeenCalledTimes(1);
+ });
+
+ it("uses a caller-supplied registry snapshot instead of re-reading", async () => {
+ const api = client([]);
+ const servers = [server({ your_connection: connection() })];
+
+ const result = await discoverGatewayTools(
+ api,
+ { serverId: "srv-1" },
+ { servers },
+ );
+
+ expect(api.getMcpGatewayServers).not.toHaveBeenCalled();
+ expect(result.discovered).toBe(true);
+ });
+
+ it.each([
+ ["no-server", [], { serverId: "missing" }],
+ ["no-connection", [server()], { serverId: "srv-1" }],
+ [
+ "already-populated",
+ [server({ tool_count: 9, your_connection: connection() })],
+ { serverId: "srv-1" },
+ ],
+ ])("skips with %s", async (skipped, servers, match) => {
+ const api = client(servers);
+
+ const result = await discoverGatewayTools(api, match);
+
+ expect(result.discovered).toBe(false);
+ expect(result.skipped).toBe(skipped);
+ expect(api.refreshMcpInstallationTools).not.toHaveBeenCalled();
+ });
+});
diff --git a/products/desktop/packages/core/src/mcp-gateway/gatewayToolDiscovery.ts b/products/desktop/packages/core/src/mcp-gateway/gatewayToolDiscovery.ts
new file mode 100644
index 000000000000..9f591dce670b
--- /dev/null
+++ b/products/desktop/packages/core/src/mcp-gateway/gatewayToolDiscovery.ts
@@ -0,0 +1,138 @@
+import type { McpGatewayServer } from "@posthog/api-client/posthog-client";
+import { normalizeGatewayServerUrl } from "./gatewayServers";
+
+/**
+ * A gateway server's tool catalog only exists once something lists it from the
+ * upstream server through a caller's credential. Connecting stores the
+ * credential but discovers nothing, so without this the registry keeps a row
+ * with zero tools until an admin hits the manual refresh button.
+ */
+export interface GatewayToolDiscoveryClient {
+ getMcpGatewayServers(): Promise<McpGatewayServer[]>;
+ refreshMcpInstallationTools(installationId: string): Promise<unknown>;
+}
+
+/** How to find the just-connected server in the re-read registry. */
+export interface GatewayServerMatch {
+ serverId?: string | null;
+ /** The caller's own installation, for flows that only know the credential. */
+ installationId?: string | null;
+ templateId?: string | null;
+ url?: string | null;
+}
+
+export type GatewayToolDiscoverySkip =
+ | "no-server"
+ | "no-connection"
+ | "already-populated";
+
+export interface GatewayToolDiscoveryResult {
+ serverId: string | null;
+ installationId: string | null;
+ discovered: boolean;
+ skipped?: GatewayToolDiscoverySkip;
+}
+
+/**
+ * Match a registry row by id, then installation, then template, then URL. The
+ * add-server flow only knows the URL it submitted; connect-from-catalog only
+ * knows the template id; reconnect only knows the installation.
+ */
+export function findGatewayServer(
+ servers: McpGatewayServer[],
+ match: GatewayServerMatch,
+): McpGatewayServer | null {
+ if (match.serverId) {
+ return servers.find((server) => server.id === match.serverId) ?? null;
+ }
+ if (match.installationId) {
+ const byInstallation = servers.find(
+ (server) =>
+ server.your_connection?.installation_id === match.installationId,
+ );
+ if (byInstallation) return byInstallation;
+ }
+ if (match.templateId) {
+ const byTemplate = servers.find(
+ (server) => server.template_id === match.templateId,
+ );
+ if (byTemplate) return byTemplate;
+ }
+ if (match.url) {
+ const target = normalizeGatewayServerUrl(match.url);
+ return (
+ servers.find(
+ (server) => normalizeGatewayServerUrl(server.url) === target,
+ ) ?? null
+ );
+ }
+ return null;
+}
+
+/**
+ * The caller's own installation, when it can actually reach the server.
+ * A self-disabled connection still holds a usable credential; one that is
+ * mid-OAuth or needs reauth does not.
+ */
+export function usableInstallationId(
+ server: McpGatewayServer | null,
+): string | null {
+ const connection = server?.your_connection;
+ if (!connection) return null;
+ if (connection.pending_oauth || connection.needs_reauth) return null;
+ return connection.installation_id;
+}
+
+/**
+ * Discover only when the team has no catalog yet. A populated `tool_count`
+ * means someone already listed the tools, and re-listing on every connect
+ * would hit the upstream server for nothing.
+ */
+export function shouldDiscoverGatewayTools(
+ server: McpGatewayServer | null,
+): boolean {
+ if (!server) return false;
+ if (server.tool_count > 0) return false;
+ return usableInstallationId(server) !== null;
+}
+
+/**
+ * Re-read the registry after a connect and, if the server still has no tools,
+ * list them through the caller's fresh credential. Callers invalidate the
+ * returned `serverId`'s tool queries when `discovered` is true.
+ */
+export async function discoverGatewayTools(
+ client: GatewayToolDiscoveryClient,
+ match: GatewayServerMatch,
+ options: { servers?: McpGatewayServer[] } = {},
+): Promise<GatewayToolDiscoveryResult> {
+ const servers = options.servers ?? (await client.getMcpGatewayServers());
+ const server = findGatewayServer(servers, match);
+ if (!server) {
+ return {
+ serverId: null,
+ installationId: null,
+ discovered: false,
+ skipped: "no-server",
+ };
+ }
+ const installationId = usableInstallationId(server);
+ if (!installationId) {
+ return {
+ serverId: server.id,
+ installationId: null,
+ discovered: false,
+ skipped: "no-connection",
+ };
+ }
+ if (server.tool_count > 0) {
+ return {
+ serverId: server.id,
+ installationId,
+ discovered: false,
+ skipped: "already-populated",
+ };
+ }
+ await client.refreshMcpInstallationTools(installationId);
+ return { serverId: server.id, installationId, discovered: true };
+}
diff --git a/products/desktop/packages/core/src/pi-runtime/piSessionController.test.ts b/products/desktop/packages/core/src/pi-runtime/piSessionController.test.ts
index 897e1799eef3..37df1cae8eb3 100644
--- a/products/desktop/packages/core/src/pi-runtime/piSessionController.test.ts
+++ b/products/desktop/packages/core/src/pi-runtime/piSessionController.test.ts
@@ -819,6 +819,43 @@ describe("PiSessionController", () => {
expect(resumedSession.client.prompt).toHaveBeenCalledWith("continue");
});
+ it("applies deferred Pi config before the first resumed prompt", async () => {
+ const terminalSession = {
+ ...createSession(),
+ resumeRequired: true,
+ taskRunId: "run-1",
+ };
+ const resumedSession = createSession();
+ const provider = {
+ get: vi
+ .fn()
+ .mockResolvedValueOnce(terminalSession)
+ .mockResolvedValue(resumedSession),
+ } as PiSessionProvider;
+ const resumeCloudPiRun = vi.fn(async () => ({ id: "run-1" }));
+ const controller = new PiSessionController(provider, {
+ resumeCloudPiRun,
+ } as unknown as TaskService);
+
+ await controller.connect("task-1");
+ await controller.submit("task-1", "continue", false, "steer", {
+ model: { provider: "posthog", id: "gpt-5.6-terra" },
+ thinkingLevel: "high",
+ });
+
+ expect(resumedSession.client.setModel).toHaveBeenCalledWith(
+ "posthog",
+ "gpt-5.6-terra",
+ );
+ expect(resumedSession.client.setThinkingLevel).toHaveBeenCalledWith("high");
+ expect(resumedSession.client.prompt).toHaveBeenCalledWith("continue");
+ expect(
+ vi.mocked(resumedSession.client.setModel).mock.invocationCallOrder[0],
+ ).toBeLessThan(
+ vi.mocked(resumedSession.client.prompt).mock.invocationCallOrder[0],
+ );
+ });
+
it("resumes and retries a message when the prior sandbox is gone", async () => {
const staleSession = {
...createSession(),
diff --git a/products/desktop/packages/core/src/pi-runtime/piSessionController.ts b/products/desktop/packages/core/src/pi-runtime/piSessionController.ts
index f2b202350d9d..f86aedb30244 100644
--- a/products/desktop/packages/core/src/pi-runtime/piSessionController.ts
+++ b/products/desktop/packages/core/src/pi-runtime/piSessionController.ts
@@ -35,6 +35,11 @@ export type {
export type PiModelSelection = Pick<PiNativeModelInfo, "provider" | "id">;
+export interface PiDeferredConfig {
+ model?: PiModelSelection;
+ thinkingLevel?: PiThinkingLevel;
+}
+
export const PI_SESSION_PROVIDER = Symbol.for("posthog.pi.sessionProvider");
export const LOCAL_PI_SESSION_FACTORY = Symbol.for(
"posthog.pi.localSessionFactory",
@@ -301,6 +306,7 @@ export class PiSessionController {
text: string,
isStreaming: boolean,
messagingMode: PiMessagingMode,
+ deferredConfig?: PiDeferredConfig,
): Promise<PiSubmitResult> {
const message = text.trim();
const action = this.getSubmitAction(message, isStreaming, messagingMode);
@@ -382,6 +388,7 @@ export class PiSessionController {
try {
const session = await this.getWritablePiSession(taskId);
+ await this.applyDeferredConfig(session, deferredConfig);
this.markTurnPending(taskId);
if (session.sendUserMessage && messageId) {
const taskRunId = this.taskRunIds.get(taskId);
@@ -1088,6 +1095,22 @@ export class PiSessionController {
});
}
+ private async applyDeferredConfig(
+ session: PiSession,
+ config: PiDeferredConfig | undefined,
+ ): Promise<void> {
+ if (!config) {
+ return;
+ }
+
+ if (config.model) {
+ await session.client.setModel(config.model.provider, config.model.id);
+ }
+ if (config.thinkingLevel) {
+ await session.client.setThinkingLevel(config.thinkingLevel);
+ }
+ }
+
private async refreshStatus(taskId: string): Promise<void> {
const session = await this.getPiSession(taskId);
const status = await session.client.getState();
diff --git a/products/desktop/packages/core/src/task-detail/taskCreationSaga.test.ts b/products/desktop/packages/core/src/task-detail/taskCreationSaga.test.ts
index 3fa05dc72a3b..1d3849110da0 100644
--- a/products/desktop/packages/core/src/task-detail/taskCreationSaga.test.ts
+++ b/products/desktop/packages/core/src/task-detail/taskCreationSaga.test.ts
@@ -453,8 +453,8 @@ describe("TaskCreationSaga", () => {
branch: "main",
adapter: undefined,
piRuntime: true,
- model: undefined,
- reasoningLevel: undefined,
+ model: "gpt-5.4",
+ reasoningLevel: "high",
initialPermissionMode: undefined,
}),
);
diff --git a/products/desktop/packages/core/src/task-detail/taskCreationSaga.ts b/products/desktop/packages/core/src/task-detail/taskCreationSaga.ts
index 461c39fca44e..da3f55a9caec 100644
--- a/products/desktop/packages/core/src/task-detail/taskCreationSaga.ts
+++ b/products/desktop/packages/core/src/task-detail/taskCreationSaga.ts
@@ -408,8 +408,8 @@ export class TaskCreationSaga extends Saga<
branch,
adapter: cloudAdapter,
...(isPiRuntime ? { piRuntime: true } : {}),
- model: isPiRuntime ? undefined : input.model,
- reasoningLevel: isPiRuntime ? undefined : input.reasoningLevel,
+ model: input.model,
+ reasoningLevel: input.reasoningLevel,
contextWindow: isPiRuntime ? undefined : input.contextWindow,
fastMode: isPiRuntime ? undefined : input.fastMode,
sandboxEnvironmentId: input.sandboxEnvironmentId,
diff --git a/products/desktop/packages/harness/package.json b/products/desktop/packages/harness/package.json
index b0f39fd3c7a8..a158c46ba3e6 100644
--- a/products/desktop/packages/harness/package.json
+++ b/products/desktop/packages/harness/package.json
@@ -97,6 +97,7 @@
"@posthog/shared": "workspace:*",
"lru-cache": "^11.1.0",
"turndown": "^7.2.4",
+ "typebox": "1.3.7",
"zod": "^4.2.0"
},
"devDependencies": {
diff --git a/products/desktop/packages/harness/src/extensions/mcp/schema.test.ts b/products/desktop/packages/harness/src/extensions/mcp/schema.test.ts
index c96850e6ad05..bd0fbe574081 100644
--- a/products/desktop/packages/harness/src/extensions/mcp/schema.test.ts
+++ b/products/desktop/packages/harness/src/extensions/mcp/schema.test.ts
@@ -1,3 +1,4 @@
+import { Compile } from "typebox/compile";
import { describe, expect, it } from "vitest";
import { convertJsonSchemaToTypebox } from "./schema";
@@ -107,6 +108,18 @@ describe("convertJsonSchemaToTypebox", () => {
expect(result.anyOf?.[1]).toMatchObject({ type: "null" });
});
+ it("validates nullable arrays", () => {
+ const schema = convertJsonSchemaToTypebox({
+ type: ["array", "null"],
+ items: { type: "string" },
+ });
+ const check = Compile(schema);
+
+ expect(check.Check(null)).toBe(true);
+ expect(check.Check(["value"])).toBe(true);
+ expect(check.Check([1])).toBe(false);
+ });
+
it.each([["oneOf"], ["anyOf"]])("converts %s to a union", (key) => {
const result = convert({
[key]: [{ type: "string" }, { type: "number" }],
diff --git a/products/desktop/packages/agent/src/pi/model-catalog.test.ts b/products/desktop/packages/harness/src/extensions/posthog-provider/model-catalog.test.ts
similarity index 100%
rename from products/desktop/packages/agent/src/pi/model-catalog.test.ts
rename to products/desktop/packages/harness/src/extensions/posthog-provider/model-catalog.test.ts
diff --git a/products/desktop/packages/agent/src/pi/model-catalog.ts b/products/desktop/packages/harness/src/extensions/posthog-provider/model-catalog.ts
similarity index 85%
rename from products/desktop/packages/agent/src/pi/model-catalog.ts
rename to products/desktop/packages/harness/src/extensions/posthog-provider/model-catalog.ts
index 96b6bb45d592..9642b0924921 100644
--- a/products/desktop/packages/agent/src/pi/model-catalog.ts
+++ b/products/desktop/packages/harness/src/extensions/posthog-provider/model-catalog.ts
@@ -2,20 +2,22 @@ import {
getSupportedThinkingLevels,
type ModelThinkingLevel,
} from "@earendil-works/pi-ai";
+import type { ModelInfo } from "@earendil-works/pi-coding-agent";
+import type { CloudRegion } from "@posthog/shared";
import {
fetchPosthogGatewayModels,
type GatewayModel,
resolveModelConfigsFromGatewayModels,
-} from "@posthog/harness/extensions/posthog-provider/models";
-import type { CloudRegion } from "@posthog/shared";
+} from "./models";
-export interface PiModelCatalogEntry {
+export type PiModelCatalogEntry = Omit<
+ Pick<ModelInfo, "provider" | "id" | "contextWindow">,
+ "provider"
+> & {
provider: "posthog";
- id: string;
name: string;
- contextWindow: number;
thinkingLevels: ModelThinkingLevel[];
-}
+};
export function resolvePosthogPiModelCatalog(
gatewayModels: GatewayModel[],
diff --git a/products/desktop/packages/harness/src/runtime.test.ts b/products/desktop/packages/harness/src/runtime.test.ts
index 6314e26b35ee..d127d073ecc0 100644
--- a/products/desktop/packages/harness/src/runtime.test.ts
+++ b/products/desktop/packages/harness/src/runtime.test.ts
@@ -111,7 +111,7 @@ describe("createHarnessRuntime", () => {
posthogOAuthCredentials: {
access: "access-token",
refresh: "refresh-token",
- expires: Date.now() + 60_000,
+ expires: Date.now() + 10 * 60_000,
region: "us",
},
sessionManager: pi.SessionManager.inMemory(cwd),
@@ -150,7 +150,7 @@ describe("createHarnessRuntime", () => {
posthogOAuthCredentials: {
access: "access-token",
refresh: "refresh-token",
- expires: Date.now() + 60_000,
+ expires: Date.now() + 10 * 60_000,
region: "us",
},
sessionManager: pi.SessionManager.inMemory(cwd),
diff --git a/products/desktop/packages/harness/tsup.config.ts b/products/desktop/packages/harness/tsup.config.ts
index fe4556659834..0ebc718d44f9 100644
--- a/products/desktop/packages/harness/tsup.config.ts
+++ b/products/desktop/packages/harness/tsup.config.ts
@@ -13,6 +13,7 @@ export default defineConfig({
"src/extensions/posthog-provider/index.ts",
"src/extensions/posthog-provider/provider.ts",
"src/extensions/posthog-provider/models.ts",
+ "src/extensions/posthog-provider/model-catalog.ts",
"src/extensions/posthog-provider/oauth.ts",
"src/extensions/posthog-provider/gateway.ts",
"src/extensions/posthog-provider/gateway-auth.ts",
diff --git a/products/desktop/packages/shared/src/analytics-events.ts b/products/desktop/packages/shared/src/analytics-events.ts
index eea1430b6fbb..82bdd241b73a 100644
--- a/products/desktop/packages/shared/src/analytics-events.ts
+++ b/products/desktop/packages/shared/src/analytics-events.ts
@@ -327,6 +327,15 @@ export interface CloudStreamDisconnectedProperties {
was_bootstrapping: boolean;
}
+export interface CloudStreamIdleTimeoutProperties {
+ task_id: string;
+ run_id: string;
+ team_id: number;
+ idle_timeout_ms: number;
+ bytes_received: number;
+ events_received: number;
+}
+
// Permission events
export interface PermissionRespondedProperties {
task_id: string;
@@ -1378,6 +1387,7 @@ export const ANALYTICS_EVENTS = {
TASK_CREATION_FAILED: "Task creation failed",
AGENT_SESSION_ERROR: "Agent session error",
CLOUD_STREAM_DISCONNECTED: "Cloud stream disconnected",
+ CLOUD_STREAM_IDLE_TIMEOUT: "Cloud stream idle timeout",
// Inbox events
INBOX_VIEWED: "Inbox viewed",
@@ -1556,6 +1566,7 @@ export type EventPropertyMap = {
[ANALYTICS_EVENTS.TASK_CREATION_FAILED]: TaskCreationFailedProperties;
[ANALYTICS_EVENTS.AGENT_SESSION_ERROR]: AgentSessionErrorProperties;
[ANALYTICS_EVENTS.CLOUD_STREAM_DISCONNECTED]: CloudStreamDisconnectedProperties;
+ [ANALYTICS_EVENTS.CLOUD_STREAM_IDLE_TIMEOUT]: CloudStreamIdleTimeoutProperties;
// Inbox events
[ANALYTICS_EVENTS.INBOX_VIEWED]: InboxViewedProperties;
diff --git a/products/desktop/packages/shared/src/flags.ts b/products/desktop/packages/shared/src/flags.ts
index 3a4ee8118b4e..fe5834a13d10 100644
--- a/products/desktop/packages/shared/src/flags.ts
+++ b/products/desktop/packages/shared/src/flags.ts
@@ -31,5 +31,11 @@ export const FAST_MODE_FLAG = "posthog-desktop-fast-mode";
export const SPOKEN_NARRATION_FLAG = "posthog-code-spoken-narration";
// Gates importing and relaying local MCP servers into cloud task runs.
export const LOCAL_MCP_IMPORT_FLAG = "posthog-code-local-mcp-import";
+/**
+ * Team MCP gateway (shared credentials, per-scope tool policies, agent
+ * service accounts, audit log) replacing the per-user MCP marketplace.
+ * Owned by the backend rollout in posthog/posthog — same flag key there.
+ */
+export const MCP_GATEWAY_FLAG = "mcp-gateway";
/** Per-task estimated cost readout in the context usage indicator. */
export const TASK_COST_FLAG = "posthog-code-task-cost";
diff --git a/products/desktop/packages/shared/src/index.ts b/products/desktop/packages/shared/src/index.ts
index 1648fb76d0f9..56ce3353c34c 100644
--- a/products/desktop/packages/shared/src/index.ts
+++ b/products/desktop/packages/shared/src/index.ts
@@ -359,9 +359,11 @@ export type {
} from "./task-creation-domain";
export {
formatClockTime,
+ formatDaySeparatorLabel,
formatRelativeTimeLong,
formatRelativeTimeShort,
getLocalDayDiff,
+ getLocalDayKey,
getRelativeDateGroup,
} from "./time";
export {
diff --git a/products/desktop/packages/shared/src/time.test.ts b/products/desktop/packages/shared/src/time.test.ts
index d0a69f92ece2..f76961a0a85d 100644
--- a/products/desktop/packages/shared/src/time.test.ts
+++ b/products/desktop/packages/shared/src/time.test.ts
@@ -1,9 +1,11 @@
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import {
formatClockTime,
+ formatDaySeparatorLabel,
formatRelativeTimeLong,
formatRelativeTimeShort,
getLocalDayDiff,
+ getLocalDayKey,
getRelativeDateGroup,
} from "./time";
@@ -124,3 +126,37 @@ describe("getRelativeDateGroup", () => {
expect(getRelativeDateGroup(NOW - 40 * DAY)).toBe("Earlier");
});
});
+
+describe("getLocalDayKey", () => {
+ it("gives two times on the same local day one key", () => {
+ expect(getLocalDayKey(new Date(2026, 5, 15, 0, 1))).toBe(
+ getLocalDayKey(new Date(2026, 5, 15, 23, 59)),
+ );
+ });
+
+ it("separates adjacent days", () => {
+ expect(getLocalDayKey(new Date(2026, 5, 15))).not.toBe(
+ getLocalDayKey(new Date(2026, 5, 16)),
+ );
+ });
+});
+
+describe("formatDaySeparatorLabel", () => {
+ const now = new Date(2026, 5, 15, 12);
+
+ it.each([
+ ["today", new Date(2026, 5, 15, 9), "Today"],
+ ["yesterday", new Date(2026, 5, 14, 9), "Yesterday"],
+ // Within the week the weekday alone is unambiguous.
+ ["earlier this week", new Date(2026, 5, 11), "Thursday 11th"],
+ // Past a week it needs the month, and past a year the year too.
+ ["last month", new Date(2026, 4, 20), "Wednesday, May 20th"],
+ ["last year", new Date(2025, 11, 3), "Wednesday, December 3rd, 2025"],
+ ])("labels %s", (_case, date: Date, expected) => {
+ expect(formatDaySeparatorLabel(date, now)).toBe(expected);
+ });
+
+ it("labels a future timestamp as today rather than counting backwards", () => {
+ expect(formatDaySeparatorLabel(new Date(2026, 5, 16), now)).toBe("Today");
+ });
+});
diff --git a/products/desktop/packages/shared/src/time.ts b/products/desktop/packages/shared/src/time.ts
index 3cfd21ba6508..08c3e822aee3 100644
--- a/products/desktop/packages/shared/src/time.ts
+++ b/products/desktop/packages/shared/src/time.ts
@@ -75,6 +75,48 @@ export function getLocalDayDiff(
return Math.round((startOfDay(now) - startOfDay(date)) / 86_400_000);
}
+/**
+ * Local calendar-day identity, for deciding where a day separator goes. Two
+ * timestamps on the same day share a key regardless of time, and the key is
+ * built from local getters (not the UTC ISO) so the split lands on the viewer's
+ * midnight.
+ */
+export function getLocalDayKey(timestamp: number | string | Date): string {
+ const date = new Date(timestamp);
+ return `${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`;
+}
+
+function ordinal(n: number): string {
+ const suffix = ["th", "st", "nd", "rd"];
+ const rem = n % 100;
+ return `${n}${suffix[(rem - 20) % 10] ?? suffix[rem] ?? suffix[0]}`;
+}
+
+/**
+ * A day separator's label: "Today" / "Yesterday" for the recent days, then a
+ * weekday + ordinal ("Monday 5th") within the week, adding the month (and the
+ * year when it differs) further back so older separators stay unambiguous.
+ *
+ * Shared by the space feed and the space sidebar's recents, so the same day is
+ * never named two different ways in one window.
+ */
+export function formatDaySeparatorLabel(
+ timestamp: number | string | Date,
+ now: Date = new Date(),
+): string {
+ const date = new Date(timestamp);
+ const days = getLocalDayDiff(date, now);
+ if (days <= 0) return "Today";
+ if (days === 1) return "Yesterday";
+ const weekday = date.toLocaleDateString(undefined, { weekday: "long" });
+ const day = ordinal(date.getDate());
+ if (days < 7) return `${weekday} ${day}`;
+ const month = date.toLocaleDateString(undefined, { month: "long" });
+ const year =
+ date.getFullYear() === now.getFullYear() ? "" : `, ${date.getFullYear()}`;
+ return `${weekday}, ${month} ${day}${year}`;
+}
+
export function getRelativeDateGroup(
timestamp: number | string,
): string | null {
diff --git a/products/desktop/packages/ui/src/features/browser-tabs/BrowserTabStrip.tsx b/products/desktop/packages/ui/src/features/browser-tabs/BrowserTabStrip.tsx
index c8a72cc02058..ebf71c7ceb3e 100644
--- a/products/desktop/packages/ui/src/features/browser-tabs/BrowserTabStrip.tsx
+++ b/products/desktop/packages/ui/src/features/browser-tabs/BrowserTabStrip.tsx
@@ -166,8 +166,11 @@ export function BrowserTabStrip() {
// decides where a task/blank tab navigates.
const inChannels = pathname.startsWith("/website");
// Top-level app pages (Inbox, Agents, Skills, MCP servers, Command Center)
- // are tab targets too. useAppView normalizes both the /code routes and
- // their /website mirrors to the same view.type, so a tab survives either space.
+ // are tab targets too. useAppView normalizes both the /code routes and their
+ // /website mirrors to the same view.type, so a tab survives either space. A
+ // top-level route that ISN'T here falls through to `task-input`, and the
+ // strip then reconciles the location against the wrong tab and navigates
+ // straight back off the page.
const view = useAppView();
const routeAppView: AppView | null = isAppView(view.type) ? view.type : null;
diff --git a/products/desktop/packages/ui/src/features/canvas/components/ActivityTimeline.test.tsx b/products/desktop/packages/ui/src/features/canvas/components/ActivityTimeline.test.tsx
index b6ea0cb52dfa..8d0e777678b2 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/ActivityTimeline.test.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/ActivityTimeline.test.tsx
@@ -128,4 +128,37 @@ describe("ActivityTimeline", () => {
expect(screen.getByText("Saved workspace context")).toBeVisible();
expect(useThreadNavigationStore.getState().scrollRequests).toEqual({});
});
+
+ it("hides injected custom instructions from conversation previews", () => {
+ renderTimeline(true, [
+ {
+ type: "user_message",
+ id: "custom-instructions-message",
+ content:
+ "Review this PR\n\n<user_custom_instructions>\nThe user has saved custom instructions that apply to all of their tasks. Follow them.\n\nNever update an existing PR description.\n</user_custom_instructions>",
+ timestamp: Date.parse("2026-07-17T09:05:00Z"),
+ },
+ ]);
+
+ expect(screen.getByText("Review this PR")).toBeInTheDocument();
+ expect(screen.queryByText(/user_custom_instructions/)).toBeNull();
+ expect(
+ screen.queryByText("Never update an existing PR description."),
+ ).toBeNull();
+ });
+
+ it("shows user-authored custom-instruction tag examples", () => {
+ renderTimeline(true, [
+ {
+ type: "user_message",
+ id: "literal-custom-instructions-message",
+ content:
+ "Render this example: <user_custom_instructions>be terse</user_custom_instructions>",
+ timestamp: Date.parse("2026-07-17T09:05:00Z"),
+ },
+ ]);
+
+ expect(screen.getByText(/user_custom_instructions/)).toBeInTheDocument();
+ expect(screen.getByText(/be terse/)).toBeInTheDocument();
+ });
});
diff --git a/products/desktop/packages/ui/src/features/canvas/components/ActivityTimeline.tsx b/products/desktop/packages/ui/src/features/canvas/components/ActivityTimeline.tsx
index 94915cc36b5b..c899b0bbd259 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/ActivityTimeline.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/ActivityTimeline.tsx
@@ -34,6 +34,7 @@ import { ThreadTimestamp } from "@posthog/ui/features/canvas/components/ThreadTi
import { userDisplayName } from "@posthog/ui/features/canvas/utils/userDisplay";
import type { buildConversationItems } from "@posthog/ui/features/sessions/components/buildConversationItems";
import { extractChannelContext } from "@posthog/ui/features/sessions/components/session-update/channelContext";
+import { extractCustomInstructions } from "@posthog/ui/features/sessions/components/session-update/customInstructions";
import { useThreadNavigationStore } from "@posthog/ui/features/sessions/threadNavigationStore";
import { Fragment, type KeyboardEvent, type ReactNode, useMemo } from "react";
@@ -83,7 +84,12 @@ function UserMessageRow({
() => extractChannelContext(content),
[content],
);
- const displayContent = channelContext?.stripped ?? content;
+ const afterChannelContext = channelContext?.stripped ?? content;
+ const customInstructions = useMemo(
+ () => extractCustomInstructions(afterChannelContext),
+ [afterChannelContext],
+ );
+ const displayContent = customInstructions?.stripped ?? afterChannelContext;
// The row itself is the hit target. `ThreadItem` renders an <article>, which a
// <button> may not wrap and which can't become one (quill's primitive takes no
// `render`), so it carries the button role and its own key handling.
diff --git a/products/desktop/packages/ui/src/features/canvas/components/ActivityView.tsx b/products/desktop/packages/ui/src/features/canvas/components/ActivityView.tsx
index cb3e01eba211..c227552ae150 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/ActivityView.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/ActivityView.tsx
@@ -181,7 +181,7 @@ export function ActivityRow({
)}
{item.isUnread && (
<span
- className="-top-0.5 -right-0.5 absolute h-2 w-2 rounded-full bg-(--red-9)"
+ className="-top-0.5 -right-0.5 absolute h-2 w-2 rounded-full bg-primary"
title="New activity"
/>
)}
diff --git a/products/desktop/packages/ui/src/features/canvas/components/ChannelBackRow.tsx b/products/desktop/packages/ui/src/features/canvas/components/ChannelBackRow.tsx
index 575441d56b00..0e91183d064a 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/ChannelBackRow.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/ChannelBackRow.tsx
@@ -1,5 +1,6 @@
import { CaretLeftIcon, StarIcon } from "@phosphor-icons/react";
import {
+ Button,
Skeleton,
Tooltip,
TooltipContent,
@@ -22,8 +23,9 @@ import { track } from "@posthog/ui/shell/analytics";
function RowStar({ channel }: { channel: Channel }) {
const { isStarred, toggleStar } = useChannelStarToggle(channel);
return (
- <button
- type="button"
+ <Button
+ variant="default"
+ size="icon-sm"
aria-label={isStarred ? "Unstar space" : "Star space"}
onClick={() => {
track(ANALYTICS_EVENTS.CHANNEL_ACTION, {
@@ -35,10 +37,10 @@ function RowStar({ channel }: { channel: Channel }) {
}}
// Parks in the row's reserved well: 8px padding + 6px gap = 14px from the
// right edge.
- className="-translate-y-1/2 absolute top-1/2 right-[6px] flex size-6 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-fill-hover hover:text-foreground"
+ className="-translate-y-1/2 absolute top-1/2 right-[6px] text-muted-foreground"
>
<StarIcon size={14} weight={isStarred ? "fill" : "regular"} />
- </button>
+ </Button>
);
}
@@ -54,14 +56,20 @@ export function ChannelBackRow({ channelId }: { channelId: string }) {
const { channels, isLoading } = useChannels();
const current = channels.find((c) => c.id === channelId);
const showStar = current != null && current.name !== PERSONAL_CHANNEL_NAME;
+ const glyph = channelGlyph(current?.name, {
+ size: 14,
+ space: spacesLayout,
+ className: "text-muted-foreground",
+ });
return (
<div className="relative mx-2 mt-1">
<Tooltip>
<TooltipTrigger
render={
- <button
- type="button"
+ <Button
+ variant="default"
+ left
aria-label="Back to spaces"
onClick={() => {
track(ANALYTICS_EVENTS.CHANNEL_ACTION, {
@@ -71,25 +79,26 @@ export function ChannelBackRow({ channelId }: { channelId: string }) {
});
showChannelList();
}}
- // Fixed height with an unconditional star well: sized off its
- // contents, a starrable channel ran 4px taller than #me and
- // everything below shifted on switch. No border — it's a row in
- // the sidebar like the ones under it, not a control sitting on
- // top.
- className="flex h-8 w-full items-center gap-1.5 rounded-md px-2 text-left transition-colors hover:bg-fill-hover"
+ // Quill's own height and radius, so this reads as one of the rows
+ // under it rather than a control sitting on top. The star well is
+ // unconditional (see the reserved span below): sized off its
+ // contents, a starrable channel ran taller than #me and everything
+ // below shifted on switch.
+ className="w-full gap-1.5 text-left"
>
<CaretLeftIcon
size={12}
className="shrink-0 text-muted-foreground"
- weight="bold"
/>
- <span className="flex w-4 shrink-0 items-center justify-center">
- {channelGlyph(current?.name, {
- size: 14,
- space: spacesLayout,
- className: "text-muted-foreground",
- })}
- </span>
+ {/* Only #me still has a glyph under the layout, and its well is
+ drawn only when there's something in it — an empty 16px column
+ in front of every other space's name is worse than the name
+ starting where the caret leaves off. */}
+ {glyph && (
+ <span className="flex w-4 shrink-0 items-center justify-center text-foreground">
+ {glyph}
+ </span>
+ )}
<span className="min-w-0 flex-1 truncate font-semibold text-[13px] text-foreground">
{current ? (
current.name
@@ -102,7 +111,7 @@ export function ChannelBackRow({ channelId }: { channelId: string }) {
)}
</span>
<span aria-hidden className="size-6 shrink-0" />
- </button>
+ </Button>
}
/>
<TooltipContent side="bottom">Back to spaces</TooltipContent>
diff --git a/products/desktop/packages/ui/src/features/canvas/components/ChannelFeedView.tsx b/products/desktop/packages/ui/src/features/canvas/components/ChannelFeedView.tsx
index ef985d5e6ecc..c0cc5547e1a3 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/ChannelFeedView.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/ChannelFeedView.tsx
@@ -18,8 +18,6 @@ import {
Badge,
Card,
CardContent,
- ChatMarker,
- ChatMarkerContent,
ChatMessageScroller,
ChatMessageScrollerButton,
ChatMessageScrollerContent,
@@ -42,7 +40,7 @@ import {
ThreadItemTimestamp,
useChatMessageScroller,
} from "@posthog/quill";
-import { formatRelativeTimeShort, getLocalDayDiff } from "@posthog/shared";
+import { formatRelativeTimeShort } from "@posthog/shared";
import type {
Task,
TaskRunStatus,
@@ -65,7 +63,6 @@ import { useInView } from "@posthog/ui/primitives/hooks/useInView";
import { Text } from "@radix-ui/themes";
import { Link } from "@tanstack/react-router";
import {
- Fragment,
memo,
type ReactNode,
useCallback,
@@ -103,37 +100,6 @@ function statusBadge(status: TaskRunStatus) {
);
}
-// Local calendar-day identity, so tasks created on the same day share a heading
-// regardless of time. Uses local getters (not the UTC ISO) so the split lands
-// on the viewer's midnight.
-function dayKey(iso: string): string {
- const d = new Date(iso);
- return `${d.getFullYear()}-${d.getMonth()}-${d.getDate()}`;
-}
-
-function ordinal(n: number): string {
- const suffix = ["th", "st", "nd", "rd"];
- const rem = n % 100;
- return `${n}${suffix[(rem - 20) % 10] ?? suffix[rem] ?? suffix[0]}`;
-}
-
-// The day-separator label: "Today" / "Yesterday" for the recent days, then a
-// weekday + ordinal ("Monday 5th") within the week, adding the month (and the
-// year when it differs) further back so older separators stay unambiguous.
-function dayLabel(iso: string, now: Date): string {
- const date = new Date(iso);
- const days = getLocalDayDiff(date, now);
- if (days <= 0) return "Today";
- if (days === 1) return "Yesterday";
- const weekday = date.toLocaleDateString(undefined, { weekday: "long" });
- const day = ordinal(date.getDate());
- if (days < 7) return `${weekday} ${day}`;
- const month = date.toLocaleDateString(undefined, { month: "long" });
- const year =
- date.getFullYear() === now.getFullYear() ? "" : `, ${date.getFullYear()}`;
- return `${weekday}, ${month} ${day}${year}`;
-}
-
interface TaskStatusDisplay {
// The run/environment badge ("Local", "Completed", "In progress", …).
base: ReactNode;
@@ -861,33 +827,19 @@ export function ChannelFeedView({
selector, which hangs over the end of the feed. */}
<ChatMessageScrollerContent className="mx-auto w-full gap-0 pt-4 pb-10">
{intro}
- {entries.map((entry, index) => {
- const previous = entries[index - 1];
- const showDayMarker =
- !previous ||
- dayKey(previous.createdAt) !== dayKey(entry.createdAt);
- return (
- <Fragment key={entry.id}>
- {showDayMarker && (
- <ChatMarker variant="separator">
- <ChatMarkerContent>
- {dayLabel(entry.createdAt, now)}
- </ChatMarkerContent>
- </ChatMarker>
- )}
- {entry.kind === "task" ? (
- <FeedRow
- task={entry.task}
- channelId={channelId}
- onOpenTask={onOpenTask}
- onOpenThread={onOpenThread}
- />
- ) : (
- <SystemFeedRow message={entry.message} />
- )}
- </Fragment>
- );
- })}
+ {entries.map((entry) =>
+ entry.kind === "task" ? (
+ <FeedRow
+ key={entry.id}
+ task={entry.task}
+ channelId={channelId}
+ onOpenTask={onOpenTask}
+ onOpenThread={onOpenThread}
+ />
+ ) : (
+ <SystemFeedRow key={entry.id} message={entry.message} />
+ ),
+ )}
{pending.map((p) => (
<PendingFeedRow
key={p.id}
diff --git a/products/desktop/packages/ui/src/features/canvas/components/ChannelItemRow.test.tsx b/products/desktop/packages/ui/src/features/canvas/components/ChannelItemRow.test.tsx
index 2981229c1f18..9f73215f0502 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/ChannelItemRow.test.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/ChannelItemRow.test.tsx
@@ -1,14 +1,37 @@
import type { ChannelItemModel } from "@posthog/core/canvas/channelItems";
-import type { TaskRunStatus } from "@posthog/shared/domain-types";
+import { formatRelativeTimeShort } from "@posthog/shared";
+import type { TaskStatusInput } from "@posthog/ui/features/sidebar/components/items/taskStatusVocabulary";
import { Theme } from "@radix-ui/themes";
import { fireEvent, render, screen } from "@testing-library/react";
-import { describe, expect, it, vi } from "vitest";
+import userEvent from "@testing-library/user-event";
+import { beforeEach, describe, expect, it, vi } from "vitest";
+
+// The row's status comes from live session/workspace state and a per-task tRPC
+// query, none of which a unit test has. Stubbed at the module boundary, as
+// ChannelSidebar.test.tsx does for the same reason.
+const mocks = vi.hoisted(() => ({ status: null as TaskStatusInput | null }));
+vi.mock("@posthog/ui/features/canvas/hooks/useChannelTaskStatus", () => ({
+ useChannelTaskStatus: () => mocks.status,
+}));
+// The row menu's spaces list and filing mutation are tRPC-backed.
+vi.mock("@posthog/ui/features/canvas/hooks/useChannels", () => ({
+ useChannels: () => ({ channels: [{ id: "channel-1", name: "code" }] }),
+}));
+vi.mock("@posthog/ui/features/canvas/hooks/useFileTaskToChannel", () => ({
+ useFileTaskToChannel: () => vi.fn(),
+}));
+vi.mock("@posthog/ui/features/feature-flags/useFeatureFlag", () => ({
+ useFeatureFlag: () => true,
+}));
+
+import { usePendingCanvasDeleteStore } from "@posthog/ui/features/canvas/stores/pendingCanvasDeleteStore";
import { ChannelItemRow } from "./ChannelItemRow";
const actions = {
open: () => {},
togglePin: () => {},
archive: () => {},
+ remove: () => {},
};
function item(overrides: Partial<ChannelItemModel> = {}): ChannelItemModel {
@@ -24,6 +47,7 @@ function item(overrides: Partial<ChannelItemModel> = {}): ChannelItemModel {
authorName: null,
authorUuid: "user-uuid",
templateId: null,
+ task: null,
...overrides,
};
}
@@ -36,21 +60,102 @@ function renderRow(model: ChannelItemModel) {
);
}
+beforeEach(() => {
+ mocks.status = null;
+ usePendingCanvasDeleteStore.setState({ pending: {} });
+});
+
describe("ChannelItemRow", () => {
+ // The dot vocabulary in one table: what the row's leading mark says for each
+ // state a task can be in. Only the states a reader can act on get a voice —
+ // run mechanics (queued, failed) resolve to "working" or "something to read".
it.each([
- ["queued" as const, true],
- ["in_progress" as const, true],
- ["not_started" as const, false],
- ["completed" as const, false],
- ["failed" as const, false],
- ["cancelled" as const, false],
- ])("marks %s as running: %s", (rawStatus: TaskRunStatus, running) => {
- renderRow(item({ rawStatus }));
-
- expect(!!screen.queryByRole("img", { name: "Running" })).toBe(running);
+ [
+ "a permission prompt",
+ { needsPermission: true },
+ "Needs permission — blocked on you",
+ ],
+ ["a streaming agent", { isGenerating: true }, "Working"],
+ [
+ // The run says in_progress, but nothing is streaming: a local run never
+ // gets a terminal status written, and the cloud one holds in_progress past
+ // the agent. Live, but not moving — the still dot, not the spinner.
+ "a run claiming progress with nothing in flight",
+ { taskRunStatus: "in_progress" as const },
+ "Pending — no work in flight",
+ ],
+ [
+ "a queued cloud run",
+ { taskRunStatus: "queued" as const },
+ "Pending — no work in flight",
+ ],
+ [
+ "a broken run with unseen output",
+ { taskRunStatus: "failed" as const, isUnread: true },
+ "Unread — something to read",
+ ],
+ ["a suspended task", { isSuspended: true }, "Suspended — parked"],
+ [
+ // The cloud workflow holds a run at in_progress while it babysits CI after
+ // opening the PR; under a merge queue that wait can outlast the agent by
+ // hours, so the PR's existence has to win over the run's claim.
+ "a run still babysitting CI behind an open PR",
+ { taskRunStatus: "in_progress" as const, prState: "open" as const },
+ "All caught up",
+ ],
+ [
+ "a run whose PR url is known but state isn't",
+ {
+ taskRunStatus: "in_progress" as const,
+ prUrl: "https://github.com/PostHog/code/pull/1",
+ },
+ "All caught up",
+ ],
+ [
+ // A live local session is the agent typing right now, which no PR overrides.
+ "a streaming agent that already has a PR",
+ { isGenerating: true, prState: "open" as const },
+ "Working",
+ ],
+ [
+ "a merged PR",
+ { prState: "merged" as const },
+ // PR state lives on the badge, so the dot stays quiet.
+ "All caught up",
+ ],
+ ["an idle task", {}, "All caught up"],
+ ])("labels %s", (_case, status: TaskStatusInput, label) => {
+ mocks.status = status;
+
+ renderRow(item());
+
+ expect(screen.getByRole("img", { name: label })).not.toBeNull();
});
- it("leaves a canvas, which has no run to wait on, static", () => {
+ it("badges a PR it can see the url of but not the state of", () => {
+ mocks.status = {
+ workspaceMode: "cloud",
+ prUrl: "https://github.com/PostHog/code/pull/1",
+ };
+
+ renderRow(item());
+
+ // Uncoloured, because colour is a verdict — but present, because a task that
+ // opened a PR must not look like it did nothing.
+ expect(screen.getByRole("img", { name: "Pull request" })).not.toBeNull();
+ });
+
+ it("shows a task's badges instead of its timestamp", () => {
+ mocks.status = { workspaceMode: "cloud", prState: "merged" };
+
+ renderRow(item());
+
+ expect(screen.getByRole("img", { name: "Cloud" })).not.toBeNull();
+ expect(screen.getByRole("img", { name: "Merged" })).not.toBeNull();
+ expect(screen.queryByText(formatRelativeTimeShort(item().ts))).toBeNull();
+ });
+
+ it("renders a canvas like a quiet task with its glyph in the badge stack", () => {
renderRow(
item({
key: "canvas:canvas-1",
@@ -61,36 +166,171 @@ describe("ChannelItemRow", () => {
}),
);
- expect(screen.queryByRole("img", { name: "Running" })).toBeNull();
+ expect(screen.getByRole("img", { name: "All caught up" })).not.toBeNull();
+ expect(screen.getByRole("img", { name: "Canvas" })).not.toBeNull();
+ expect(screen.queryByText(formatRelativeTimeShort(item().ts))).toBeNull();
+ });
+
+ it("marks a pinned row with the pin badge, alongside its status badges", () => {
+ mocks.status = { workspaceMode: "cloud" };
+
+ renderRow(item({ pinned: true }));
+
+ expect(screen.getByRole("img", { name: "Pinned" })).not.toBeNull();
+ expect(screen.getByRole("img", { name: "Cloud" })).not.toBeNull();
});
- // The point of the shimmer over a spinner: a running task still looks like a
- // task, so the list stays scannable by kind while work is in flight.
- it("keeps the item's own glyph while running", () => {
- renderRow(item({ rawStatus: "in_progress" }));
+ it("leaves an unpinned row without one", () => {
+ renderRow(item());
- const running = screen.getByRole("img", { name: "Running" });
- expect(running).toHaveClass("ph-shimmer");
- // The glyph is wrapped, not replaced — no spinner swapped in its place.
- expect(running.querySelector("svg")).not.toBeNull();
+ expect(screen.queryByRole("img", { name: "Pinned" })).toBeNull();
});
- it("opens the task context menu from the row", () => {
- const onContextMenu = vi.fn();
+ // The hover card and right-click render the same item list from one
+ // definition, so both are asserted against the same expectations.
+ const MENU_ITEMS = [
+ "Pin",
+ "Rename",
+ "Add to Command Center",
+ "File to…",
+ "Archive",
+ ];
- render(
+ function renderWithMenu(overrides: {
+ onRename?: () => void;
+ onAddToCommandCenter?: () => void;
+ }) {
+ return render(
<Theme>
<ChannelItemRow
actions={actions}
isActive={false}
item={item()}
- onContextMenu={onContextMenu}
+ onRename={overrides.onRename ?? (() => {})}
+ onAddToCommandCenter={overrides.onAddToCommandCenter}
/>
</Theme>,
);
+ }
+
+ /** Hovers the row and waits for its preview card, which opens on a delay. */
+ async function openCard() {
+ await userEvent.hover(screen.getByText("Investigate signup drop-off"));
+ return screen.findByRole("button", { name: "Pin" }, { timeout: 2000 });
+ }
+
+ it("puts the row's actions in the hover card", async () => {
+ renderWithMenu({});
+
+ await openCard();
+
+ for (const label of MENU_ITEMS) {
+ expect(screen.getByRole("button", { name: label })).not.toBeNull();
+ }
+ });
+
+ it("opens the same menu on right-click", () => {
+ renderWithMenu({});
fireEvent.contextMenu(screen.getByText("Investigate signup drop-off"));
- expect(onContextMenu).toHaveBeenCalledOnce();
+ for (const label of MENU_ITEMS) {
+ expect(screen.getByRole("menuitem", { name: label })).not.toBeNull();
+ }
+ });
+
+ it("disables Add to Command Center when there is nowhere to put the task", async () => {
+ renderWithMenu({ onAddToCommandCenter: undefined });
+
+ await openCard();
+
+ // Quill keeps a disabled button focusable, so the state is aria-disabled
+ // rather than the native attribute.
+ expect(
+ screen.getByRole("button", { name: "Add to Command Center" }),
+ ).toHaveAttribute("aria-disabled", "true");
+ });
+
+ it("renames from the hover card", async () => {
+ const onRename = vi.fn();
+ renderWithMenu({ onRename });
+
+ await openCard();
+ await userEvent.click(screen.getByRole("button", { name: "Rename" }));
+
+ expect(onRename).toHaveBeenCalledOnce();
+ });
+
+ it("flashes a red dot while a canvas waits out its delete-undo window", () => {
+ const canvas = item({
+ key: "canvas:c1",
+ kind: "canvas",
+ id: "c1",
+ title: "Web analytics overview",
+ });
+ usePendingCanvasDeleteStore.getState().markPending("c1");
+
+ renderRow(canvas);
+
+ expect(screen.getByRole("img", { name: "Deleting…" })).not.toBeNull();
+ expect(screen.queryByRole("img", { name: "All caught up" })).toBeNull();
+ });
+
+ it("gives a canvas the actions it has: pin and delete, not archive or filing", async () => {
+ const canvas = item({
+ key: "canvas:c1",
+ kind: "canvas",
+ id: "c1",
+ title: "Web analytics overview",
+ });
+ render(
+ <Theme>
+ <ChannelItemRow actions={actions} isActive={false} item={canvas} />
+ </Theme>,
+ );
+
+ await userEvent.hover(screen.getByText("Web analytics overview"));
+
+ expect(
+ await screen.findByRole("button", { name: "Pin" }, { timeout: 2000 }),
+ ).not.toBeNull();
+ expect(screen.getByRole("button", { name: "Delete…" })).not.toBeNull();
+ // A canvas can't be archived, filed to a space, or given a command-centre
+ // cell, so those items aren't drawn at all rather than drawn dead.
+ for (const absent of ["Archive", "File to…", "Add to Command Center"]) {
+ expect(screen.queryByRole("button", { name: absent })).toBeNull();
+ }
+ });
+
+ it("confirms before deleting a canvas — it goes for the whole space", async () => {
+ const remove = vi.fn();
+ const canvas = item({
+ key: "canvas:c1",
+ kind: "canvas",
+ id: "c1",
+ title: "Web analytics overview",
+ });
+ render(
+ <Theme>
+ <ChannelItemRow
+ actions={{ ...actions, remove }}
+ isActive={false}
+ item={canvas}
+ />
+ </Theme>,
+ );
+
+ await userEvent.hover(screen.getByText("Web analytics overview"));
+ await userEvent.click(
+ await screen.findByRole("button", { name: "Delete…" }, { timeout: 2000 }),
+ );
+
+ // The menu item only opens the confirm; nothing is deleted until it is.
+ expect(remove).not.toHaveBeenCalled();
+ await userEvent.click(
+ await screen.findByRole("button", { name: /^Delete$/ }),
+ );
+
+ expect(remove).toHaveBeenCalledWith(canvas);
});
});
diff --git a/products/desktop/packages/ui/src/features/canvas/components/ChannelItemRow.tsx b/products/desktop/packages/ui/src/features/canvas/components/ChannelItemRow.tsx
index ae5bc43ebb3e..195e40f385b2 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/ChannelItemRow.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/ChannelItemRow.tsx
@@ -1,21 +1,59 @@
import { PreviewCard } from "@base-ui/react/preview-card";
-import { Archive, FileTextIcon, PushPin } from "@phosphor-icons/react";
+import { ChatCircleIcon } from "@phosphor-icons/react";
import type { ChannelItemModel } from "@posthog/core/canvas/channelItems";
import {
- isRunStatusActive,
runStatusLabel,
runStatusVariant,
} from "@posthog/core/canvas/runStatus";
-import { Avatar, AvatarFallback, Badge } from "@posthog/quill";
+import {
+ AlertDialog,
+ AlertDialogClose,
+ AlertDialogContent,
+ AlertDialogDescription,
+ AlertDialogFooter,
+ AlertDialogHeader,
+ AlertDialogTitle,
+ Avatar,
+ AvatarFallback,
+ AvatarGroup,
+ Badge,
+ Button,
+ Card,
+ Item,
+ ItemContent,
+ ItemDescription,
+ ItemGroup,
+ ItemMedia,
+ ItemSeparator,
+ ItemTitle,
+ Tooltip,
+ TooltipContent,
+ TooltipTrigger,
+} from "@posthog/quill";
import { formatRelativeTimeShort } from "@posthog/shared";
import { UserAvatar } from "@posthog/ui/features/auth/UserAvatar";
import { iconForTemplate } from "@posthog/ui/features/canvas/components/canvasTemplateIcon";
+import {
+ TaskRowContextMenu,
+ TaskRowMenuList,
+ type TaskRowMenuProps,
+} from "@posthog/ui/features/canvas/components/TaskRowMenu";
+import { useChannelTaskStatus } from "@posthog/ui/features/canvas/hooks/useChannelTaskStatus";
+import { useIsCanvasPendingDelete } from "@posthog/ui/features/canvas/stores/pendingCanvasDeleteStore";
import { userDisplayName } from "@posthog/ui/features/canvas/utils/userDisplay";
import { InlineEditInput } from "@posthog/ui/features/sidebar/components/items/TaskItem";
+import {
+ PinnedBadge,
+ TaskBadgeStack,
+ TaskStatusDot,
+ TaskStatusTooltips,
+} from "@posthog/ui/features/sidebar/components/items/TaskStatusDot";
+import {
+ type TaskDot,
+ taskDot,
+} from "@posthog/ui/features/sidebar/components/items/taskStatusVocabulary";
import { SidebarItem } from "@posthog/ui/features/sidebar/components/SidebarItem";
-import { NestedButton } from "@posthog/ui/primitives/NestedButton";
-import { Tooltip } from "@posthog/ui/primitives/Tooltip";
-import type { ReactNode } from "react";
+import { type ReactNode, useCallback, useState } from "react";
/**
* What a row can do. One object per channel rather than closures per item, so
@@ -25,75 +63,181 @@ export interface ChannelItemActions {
open: (item: ChannelItemModel) => void;
togglePin: (item: ChannelItemModel) => void;
archive: (item: ChannelItemModel) => void;
+ /** Canvases only — a task is archived, not deleted. */
+ remove: (item: ChannelItemModel) => void;
}
// The channel sidebar's own chrome. Deliberately not shared with the Code
// sidebar's TaskItem: that one is still on the absolute gray scale, while these
// rows use the theme's fill/foreground tokens.
-const HOVER_ACTION_CLASS =
- "flex h-5 w-5 cursor-pointer items-center justify-center rounded text-muted-foreground transition-colors hover:bg-fill-hover hover:text-foreground";
-const HOVER_TOOLBAR_CLASS =
- "hidden shrink-0 items-center gap-0.5 group-hover:flex";
-const TIMESTAMP_CLASS =
- "shrink-0 text-[11px] text-muted-foreground group-hover:hidden";
+const TIMESTAMP_CLASS = "shrink-0 text-[11px] text-muted-foreground";
+// The badges own the trailing slot outright now that the actions have moved to
+// the hover card — a row's identity is what you scan a task list for. The gap is
+// between stacks (a pin, then the status badges), not within one.
+const TRAILING_CLASS = "flex shrink-0 items-center gap-1";
-function itemIcon(item: ChannelItemModel): ReactNode {
- return item.kind === "canvas" ? (
- // Matches the schema's own default for boards saved before templating.
- iconForTemplate(item.templateId ?? "freeform", {
- size: 15,
- className: "text-violet-9",
- })
- ) : (
- <FileTextIcon size={15} className="text-blue-9" />
- );
+/**
+ * What the card leads with. A canvas gets its template glyph in canvas violet; a
+ * task gets the chat glyph the sidebar uses for a task with nothing going on —
+ * before this, a task was shown wearing a canvas's icon.
+ */
+function previewGlyph(item: ChannelItemModel): ReactNode {
+ if (item.kind !== "canvas") {
+ return <ChatCircleIcon size={15} className="text-gray-10" />;
+ }
+ // Matches the schema's own default for boards saved before templating.
+ return iconForTemplate(item.templateId ?? "freeform", {
+ size: 15,
+ className: "text-violet-9",
+ });
}
/**
- * Marks a row whose run is still going. The glyph is kept and shimmered rather
- * than swapped for a spinner, so the list stays scannable by kind while it
- * moves — you can still tell a running task from a running canvas.
+ * A canvas waiting out its delete-undo window. Red and flashing because it is
+ * the one row state that is about to stop existing — everything else in this
+ * vocabulary is something you can come back to.
*/
-function RunningIcon({ children }: { children: ReactNode }) {
- return (
- <span aria-label="Running" className="ph-shimmer" role="img">
- {children}
- </span>
- );
-}
+const DELETING_DOT: TaskDot = {
+ tone: "red",
+ style: "solid",
+ pulse: true,
+ label: "Deleting…",
+};
function authorLabel(item: ChannelItemModel): string | null {
if (item.authorUser) return userDisplayName(item.authorUser);
return item.authorName;
}
+/**
+ * One badge in a row's trailing stack, named on hover like the ones
+ * `TaskBadgeStack` draws — the row's tooltip provider is already up, so this
+ * shares its open delay.
+ */
+function RowBadge({ label, children }: { label: string; children: ReactNode }) {
+ return (
+ <Tooltip disableHoverablePopup>
+ {/* `cursor-default`: a badge names a fact about the row, it isn't a
+ control — see the same note in TaskBadgeStack. */}
+ <TooltipTrigger
+ render={
+ <Avatar
+ size="xs"
+ aria-label={label}
+ role="img"
+ className="cursor-default"
+ >
+ <AvatarFallback className="bg-transparent">
+ {children}
+ </AvatarFallback>
+ </Avatar>
+ }
+ />
+ <TooltipContent side="top" className="pointer-events-none select-none">
+ {label}
+ </TooltipContent>
+ </Tooltip>
+ );
+}
+
+/**
+ * A canvas's trailing stack: the pin, then its template glyph. Same stack as a
+ * task's badges — a pinned canvas reads the way a pinned task does.
+ */
+function CanvasBadgeStack({
+ item,
+ pinned,
+}: {
+ item: ChannelItemModel;
+ pinned?: boolean;
+}) {
+ return (
+ <AvatarGroup stacked reverse size="xs" className="shrink-0">
+ {pinned ? <PinnedBadge /> : null}
+ <RowBadge label="Canvas">
+ {/* Violet is the canvas colour everywhere else it appears — the
+ artifacts list, the thread panel, the pinned menu — so the badge says
+ "canvas" the same way they do. */}
+ {iconForTemplate(item.templateId ?? "freeform", {
+ size: 9,
+ className: "text-violet-9",
+ })}
+ </RowBadge>
+ </AvatarGroup>
+ );
+}
+
export function ChannelItemRow({
item,
+ channelId,
isActive,
actions,
isEditing = false,
- onContextMenu,
+ onRename,
+ onAddToCommandCenter,
onEditSubmit,
onEditCancel,
}: {
item: ChannelItemModel;
+ /** The space this row is listed under, ticked in the menu's "File to…". */
+ channelId?: string;
isActive: boolean;
actions: ChannelItemActions;
isEditing?: boolean;
- onContextMenu?: (event: React.MouseEvent) => void;
+ /** Puts the row into inline-rename mode. Absent for canvases. */
+ onRename?: () => void;
+ /** Absent when the command centre has no free cell, which disables the item. */
+ onAddToCommandCenter?: () => void;
onEditSubmit?: (newTitle: string) => void;
onEditCancel?: () => void;
}) {
- const icon = itemIcon(item);
+ const status = useChannelTaskStatus(item);
+ const [cardOpen, setCardOpen] = useState(false);
+ const [submenuOpen, setSubmenuOpen] = useState(false);
+ const [confirmDeleteOpen, setConfirmDeleteOpen] = useState(false);
+ // A canvas inside its undo window stays in the list rather than vanishing and
+ // reappearing on Undo, so the row has to say what's happening to it.
+ const pendingDelete = useIsCanvasPendingDelete(item.id);
+ const deleting = item.kind === "canvas" && pendingDelete;
+ // Stable: `TaskRowMenuList` builds its item components from these, so a new
+ // identity each render would remount every button in the card.
+ const closeCard = useCallback(() => setCardOpen(false), []);
const statusLabel = runStatusLabel(item.rawStatus);
const author = authorLabel(item);
- // Only the row shimmers. The preview card spells the status out in a badge,
- // so animating its copy of the icon would say the same thing twice.
- const rowIcon = isRunStatusActive(item.rawStatus) ? (
- <RunningIcon>{icon}</RunningIcon>
- ) : (
- icon
+ // The row's leading mark is always the task-list state vocabulary. Canvases
+ // have no live run, so they use the quiet dot and move their glyph to the
+ // right-side identity stack — except while one is being deleted, which is the
+ // one thing a canvas row has to shout.
+ const rowIcon = (
+ <TaskStatusDot dot={deleting ? DELETING_DOT : taskDot(status ?? {})} />
);
+ const previewIcon = previewGlyph(item);
+ // A canvas gets the same menu with the items it actually has: pin, and delete
+ // instead of archive. Filing and command-centre cells are task-shaped, and the
+ // menu drops them rather than showing them dead.
+ const menu: TaskRowMenuProps =
+ item.kind === "canvas"
+ ? {
+ kind: "canvas",
+ id: item.id,
+ title: item.title,
+ isPinned: item.pinned,
+ onTogglePin: () => actions.togglePin(item),
+ // Confirm first, like the canvas menus in the artifacts grid and the
+ // canvas header: the canvas and its history go for everyone.
+ onDelete: () => setConfirmDeleteOpen(true),
+ }
+ : {
+ kind: "task",
+ id: item.id,
+ title: item.title,
+ isPinned: item.pinned,
+ channelId,
+ onAddToCommandCenter,
+ onRename,
+ onTogglePin: () => actions.togglePin(item),
+ onArchive: () => actions.archive(item),
+ };
if (isEditing) {
return (
@@ -108,8 +252,13 @@ export function ChannelItemRow({
);
}
- return (
- <PreviewCard.Root>
+ // One tooltip provider per task row, shared by its dot and badges so moving
+ // between them doesn't re-wait the open delay. Canvas rows have neither.
+ const row = (
+ // Controlled so the card survives its own submenu: "File to…" opens in a
+ // portal outside the card, and the pointer moving there reads as leaving the
+ // card, which would take the menu down with it.
+ <PreviewCard.Root open={cardOpen || submenuOpen} onOpenChange={setCardOpen}>
<PreviewCard.Trigger
delay={400}
closeDelay={100}
@@ -122,39 +271,35 @@ export function ChannelItemRow({
label={<span>{item.title}</span>}
isActive={isActive}
onClick={() => actions.open(item)}
- onContextMenu={onContextMenu}
endContent={
- <>
- <span className={TIMESTAMP_CLASS}>
- {formatRelativeTimeShort(item.ts)}
- </span>
- <span className={HOVER_TOOLBAR_CLASS}>
- <Tooltip content={item.pinned ? "Unpin" : "Pin"} side="top">
- <NestedButton
- aria-label={item.pinned ? "Unpin" : "Pin"}
- className={HOVER_ACTION_CLASS}
- onActivate={() => actions.togglePin(item)}
- >
- <PushPin
- size={12}
- weight={item.pinned ? "fill" : "regular"}
- />
- </NestedButton>
- </Tooltip>
- {/* Canvases can't be archived. */}
- {item.kind === "task" && (
- <Tooltip content="Archive task" side="top">
- <NestedButton
- aria-label="Archive task"
- className={HOVER_ACTION_CLASS}
- onActivate={() => actions.archive(item)}
+ <span className={TRAILING_CLASS}>
+ {/* Badges take the timestamp's slot on a task row: the row's
+ identity (pin, source, cloud, PR) is what you scan a task
+ list for, and the relative age is still in the preview
+ card. The pin joins whichever stack the row has, rather
+ than standing beside it as a badge of its own. */}
+ {status ? (
+ <TaskBadgeStack status={status} pinned={item.pinned} />
+ ) : item.kind === "canvas" ? (
+ <CanvasBadgeStack item={item} pinned={item.pinned} />
+ ) : (
+ <>
+ {item.pinned && (
+ <AvatarGroup
+ stacked
+ reverse
+ size="xs"
+ className="shrink-0"
>
- <Archive size={12} />
- </NestedButton>
- </Tooltip>
- )}
- </span>
- </>
+ <PinnedBadge />
+ </AvatarGroup>
+ )}
+ <span className={TIMESTAMP_CLASS}>
+ {formatRelativeTimeShort(item.ts)}
+ </span>
+ </>
+ )}
+ </span>
}
/>
</div>
@@ -167,52 +312,123 @@ export function ChannelItemRow({
sideOffset={10}
className="z-50"
>
- <PreviewCard.Popup className="w-64 rounded-lg border border-border bg-background p-3 shadow-lg outline-none">
- <div className="flex items-start gap-2.5">
- <span className="flex size-8 shrink-0 items-center justify-center rounded-md bg-muted">
- {icon}
- </span>
- <div className="min-w-0 flex-1">
- <p className="break-words font-medium text-[13px] text-foreground leading-snug">
- {item.title}
- </p>
- <p className="mt-0.5 text-[11px] text-muted-foreground">
- {item.kind === "canvas" ? "Canvas" : "Task"} · updated{" "}
- {formatRelativeTimeShort(item.ts)}
- </p>
- </div>
- </div>
- {statusLabel && (
- <div className="mt-2">
- <Badge variant={runStatusVariant(item.rawStatus)}>
- {statusLabel}
- </Badge>
- </div>
- )}
- {author && (
- <div className="mt-2.5 flex items-center gap-2 border-border border-t pt-2.5">
- {item.authorUser ? (
- <UserAvatar user={item.authorUser} />
- ) : (
- <Avatar>
- <AvatarFallback>
- {author.charAt(0).toUpperCase()}
- </AvatarFallback>
- </Avatar>
- )}
- <div className="min-w-0">
- <p className="truncate text-[12px] text-foreground">
- {author}
- </p>
- <p className="text-[10px] text-muted-foreground">
- Created by
- </p>
+ {/* The card is quill's `Card` and `Item` parts throughout — the popup
+ itself carries no surface styling, so this window's hover card
+ matches every other card in the app rather than a hand-tuned
+ shadow of its own. The card's own padding is off (`gap-0 py-0`):
+ each section pays for its own inset, which is what lets the rules
+ run edge to edge and the action rows highlight full width. */}
+ <PreviewCard.Popup
+ render={
+ <Card
+ size="sm"
+ className="w-64 gap-0 border border-border py-0 shadow-md"
+ />
+ }
+ >
+ <ItemGroup className="gap-0!">
+ <Item size="xs" className="p-2">
+ <ItemMedia variant="icon" className="size-5">
+ {previewIcon}
+ </ItemMedia>
+ <ItemContent>
+ <ItemTitle>{item.title}</ItemTitle>
+ <ItemDescription>
+ {item.kind === "canvas" ? "Canvas" : "Task"} · updated{" "}
+ {formatRelativeTimeShort(item.ts)}
+ </ItemDescription>
+ </ItemContent>
+ </Item>
+ {statusLabel && (
+ <div className="px-2 pb-2">
+ <Badge variant={runStatusVariant(item.rawStatus)}>
+ {statusLabel}
+ </Badge>
</div>
+ )}
+ {author && (
+ <>
+ {/* Every section of the card gets the rule above it, canvases
+ included — the author is a different fact from the thing's
+ identity whether or not there are actions under it. */}
+ <ItemSeparator className="my-0" />
+ <Item size="xs" className="p-2">
+ <ItemMedia variant="icon">
+ {item.authorUser ? (
+ <UserAvatar size="xs" user={item.authorUser} />
+ ) : (
+ <Avatar size="xs">
+ <AvatarFallback>
+ {author.charAt(0).toUpperCase()}
+ </AvatarFallback>
+ </Avatar>
+ )}
+ </ItemMedia>
+ <ItemContent className="gap-0">
+ <ItemTitle>{author}</ItemTitle>
+ <ItemDescription>Created by</ItemDescription>
+ </ItemContent>
+ </Item>
+ </>
+ )}
+ {/* The row's actions live here now: a row at rest shows its
+ status, and the card is already the surface you're pointing at
+ when you want to do something to it. */}
+ <ItemSeparator className="my-0" />
+ <div className="p-1">
+ <TaskRowMenuList
+ menu={menu}
+ onAction={closeCard}
+ onSubmenuOpenChange={setSubmenuOpen}
+ />
</div>
- )}
+ </ItemGroup>
</PreviewCard.Popup>
</PreviewCard.Positioner>
</PreviewCard.Portal>
</PreviewCard.Root>
);
+
+ const tipped = <TaskStatusTooltips>{row}</TaskStatusTooltips>;
+ // Right-click opens the same actions the hover card lists, from the same
+ // definition, so the two can't drift.
+ return (
+ <>
+ <TaskRowContextMenu menu={menu}>{tipped}</TaskRowContextMenu>
+ {/* The same confirm the artifacts grid and the canvas header show: a
+ canvas goes for everyone in the space, so it isn't a one-click action
+ however small the row is. The undo window still follows. */}
+ <AlertDialog open={confirmDeleteOpen} onOpenChange={setConfirmDeleteOpen}>
+ <AlertDialogContent className="max-w-md">
+ <AlertDialogHeader>
+ <AlertDialogTitle>Delete canvas</AlertDialogTitle>
+ <AlertDialogDescription>
+ Delete <span className="font-medium">{item.title}</span>? Its code
+ and version history go for everyone in the space. You get a few
+ seconds to undo, then it's permanent.
+ </AlertDialogDescription>
+ </AlertDialogHeader>
+ <AlertDialogFooter>
+ <AlertDialogClose
+ render={
+ <Button variant="outline" size="sm">
+ Cancel
+ </Button>
+ }
+ />
+ <Button
+ variant="destructive"
+ size="sm"
+ onClick={() => {
+ setConfirmDeleteOpen(false);
+ actions.remove(item);
+ }}
+ >
+ Delete
+ </Button>
+ </AlertDialogFooter>
+ </AlertDialogContent>
+ </AlertDialog>
+ </>
+ );
}
diff --git a/products/desktop/packages/ui/src/features/canvas/components/ChannelNav.test.tsx b/products/desktop/packages/ui/src/features/canvas/components/ChannelNav.test.tsx
index fe2da703cb26..c0a07f916289 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/ChannelNav.test.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/ChannelNav.test.tsx
@@ -74,9 +74,48 @@ describe("ChannelNav", () => {
const activity = screen.getByLabelText("Activity");
expect(activity).toBeEnabled();
+ expect(activity).not.toHaveAttribute("aria-haspopup");
await user.hover(activity);
await new Promise((resolve) => setTimeout(resolve, 400));
expect(screen.queryByText("Recent activity card")).not.toBeInTheDocument();
});
+
+ it("leaves no popover state on the bell after it navigates to Activity", async () => {
+ const user = userEvent.setup();
+ const { rerender } = render(<ChannelNav />);
+ const bell = () => screen.getByLabelText("Activity");
+
+ await user.hover(bell());
+ await screen.findByText("Recent activity card", {}, { timeout: 1_000 });
+ await user.click(bell());
+ mocks.view = { type: "activity" };
+ rerender(<ChannelNav />);
+
+ expect(screen.queryByText("Recent activity card")).not.toBeInTheDocument();
+ expect(bell()).not.toHaveAttribute("data-popup-open");
+ expect(bell()).not.toHaveAttribute("data-pressed");
+ });
+
+ it("neither resurfaces nor wedges the hover card once the bell has navigated", async () => {
+ const user = userEvent.setup();
+ const { rerender } = render(<ChannelNav />);
+ const bell = () => screen.getByLabelText("Activity");
+
+ await user.hover(bell());
+ await user.click(bell());
+ mocks.view = { type: "activity" };
+ rerender(<ChannelNav />);
+ await user.unhover(bell());
+
+ mocks.view = { type: "task-detail" };
+ rerender(<ChannelNav />);
+ await new Promise((resolve) => setTimeout(resolve, 400));
+ expect(screen.queryByText("Recent activity card")).not.toBeInTheDocument();
+
+ await user.hover(bell());
+ expect(
+ await screen.findByText("Recent activity card", {}, { timeout: 1_000 }),
+ ).toBeInTheDocument();
+ });
});
diff --git a/products/desktop/packages/ui/src/features/canvas/components/ChannelNav.tsx b/products/desktop/packages/ui/src/features/canvas/components/ChannelNav.tsx
index fe76afeb198e..2c2f6377066e 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/ChannelNav.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/ChannelNav.tsx
@@ -39,7 +39,12 @@ import {
} from "@posthog/ui/router/navigationBridge";
import { useAppView } from "@posthog/ui/router/useAppView";
import { track } from "@posthog/ui/shell/analytics";
-import { type ComponentPropsWithRef, type ReactNode, useState } from "react";
+import {
+ type ComponentPropsWithRef,
+ type ReactElement,
+ type ReactNode,
+ useState,
+} from "react";
import { ActivityHoverCard } from "./ActivityHoverCard";
const INBOX_REFETCH_INTERVAL_MS = 60_000;
@@ -133,10 +138,51 @@ function NavButton({
);
}
+function ActivityHoverPopover({ trigger }: { trigger: ReactElement }) {
+ const [open, setOpen] = useState(false);
+
+ return (
+ <Popover open={open} onOpenChange={setOpen}>
+ <PopoverTrigger
+ openOnHover
+ delay={300}
+ closeDelay={100}
+ onClick={(event) => event.preventBaseUIHandler()}
+ render={trigger}
+ />
+ {open && (
+ <ActivityHoverCard side="bottom" onClose={() => setOpen(false)} />
+ )}
+ </Popover>
+ );
+}
+
+function ActivityNavItem({
+ isActive,
+ unreadCount,
+ onNavigate,
+}: {
+ isActive: boolean;
+ unreadCount: number;
+ onNavigate: () => void;
+}) {
+ const bell = (
+ <NavButton
+ icon={<BellIcon size={16} weight={isActive ? "fill" : "regular"} />}
+ label="Activity"
+ isActive={isActive}
+ onClick={onNavigate}
+ badge={<CountBadge count={unreadCount} className={ICON_BADGE_CLASS} />}
+ />
+ );
+
+ if (isActive) return bell;
+ return <ActivityHoverPopover trigger={bell} />;
+}
+
export function ChannelNav() {
const view = useAppView();
const loopsEnabled = useFeatureFlag(LOOPS_FLAG, import.meta.env.DEV);
- const [activityOpen, setActivityOpen] = useState(false);
const { counts } = useInboxAllReports({
ignoreFilters: true,
@@ -165,7 +211,7 @@ export function ChannelNav() {
// cannot do that — the skip window is provider state, and isolated
// providers never share it.
<TooltipProvider delay={400}>
- <div className="flex shrink-0 gap-2 px-2 pt-2 pb-1">
+ <div className="flex shrink-0 gap-2 p-2">
<NavIcon
icon={
<EnvelopeSimple size={16} weight={isInbox ? "fill" : "regular"} />
@@ -178,44 +224,11 @@ export function ChannelNav() {
<CountBadge count={counts.pulls} className={ICON_BADGE_CLASS} />
}
/>
- <Popover
- open={!isActivity && activityOpen}
- onOpenChange={(open) => setActivityOpen(!isActivity && open)}
- >
- <PopoverTrigger
- openOnHover
- delay={300}
- closeDelay={100}
- render={
- <NavButton
- icon={
- <BellIcon
- size={16}
- weight={isActivity ? "fill" : "regular"}
- />
- }
- label="Activity"
- isActive={isActivity}
- onClick={() => {
- setActivityOpen(false);
- withTrack("activity", navigateToActivity)();
- }}
- badge={
- <CountBadge
- count={unseenActivity}
- className={ICON_BADGE_CLASS}
- />
- }
- />
- }
- />
- {!isActivity && activityOpen && (
- <ActivityHoverCard
- side="bottom"
- onClose={() => setActivityOpen(false)}
- />
- )}
- </Popover>
+ <ActivityNavItem
+ isActive={isActivity}
+ unreadCount={unseenActivity}
+ onNavigate={withTrack("activity", navigateToActivity)}
+ />
<NavIcon
icon={
<Lightning
diff --git a/products/desktop/packages/ui/src/features/canvas/components/ChannelSidebar.test.tsx b/products/desktop/packages/ui/src/features/canvas/components/ChannelSidebar.test.tsx
index 53fb6a5c3d6a..bcd735dcc70c 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/ChannelSidebar.test.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/ChannelSidebar.test.tsx
@@ -2,7 +2,7 @@ import type { ChannelItemModel } from "@posthog/core/canvas/channelItems";
import { Theme } from "@radix-ui/themes";
import { render, screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
-import { beforeEach, describe, expect, it, vi } from "vitest";
+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
const mocks = vi.hoisted(() => ({
items: [] as ChannelItemModel[],
@@ -36,15 +36,11 @@ vi.mock("@posthog/ui/features/canvas/components/ChannelsFab", () => ({
ChannelsFab: () => null,
}));
-// The row context menu's hooks reach for a QueryClient and the DI container,
-// neither of which a unit test has. Stubbed at the module boundary, as
-// WebsiteLayout.test.tsx does for the same reason.
-vi.mock("@posthog/ui/features/tasks/useTaskContextMenu", () => ({
- useTaskContextMenu: () => ({
- showContextMenu: vi.fn(),
- editingTaskId: null,
- setEditingTaskId: vi.fn(),
- }),
+// The row menu's spaces list reaches for a QueryClient the unit test has no
+// stack for. Stubbed at the module boundary, as WebsiteLayout.test.tsx does for
+// the same reason.
+vi.mock("@posthog/ui/features/canvas/hooks/useChannels", () => ({
+ useChannels: () => ({ channels: [] }),
}));
vi.mock("@posthog/ui/features/tasks/useTaskMutations", () => ({
useRenameTask: () => ({ renameTask: vi.fn() }),
@@ -52,6 +48,10 @@ vi.mock("@posthog/ui/features/tasks/useTaskMutations", () => ({
vi.mock("@posthog/ui/features/tasks/useTasks", () => ({
useTasks: () => ({ data: [] }),
}));
+// A row's status dot reaches for live session state and a per-task PR query.
+vi.mock("@posthog/ui/features/canvas/hooks/useChannelTaskStatus", () => ({
+ useChannelTaskStatus: () => null,
+}));
import { ChannelSidebar } from "./ChannelSidebar";
@@ -69,6 +69,7 @@ function item(overrides: Partial<ChannelItemModel> = {}): ChannelItemModel {
// Not the viewer, so filtering to "Me" leaves nothing.
authorUuid: "someone-else-uuid",
templateId: null,
+ task: null,
...overrides,
};
}
@@ -98,18 +99,18 @@ describe("ChannelSidebar", () => {
what: "nothing has arrived yet",
state: { items: [], isLoading: true },
shown: [] as string[],
- hidden: ["Recent", "No matches", "Nothing here yet"],
+ hidden: ["Sessions", "No matches", "Nothing here yet"],
},
{
what: "the space is settled and genuinely empty",
state: { items: [], isLoading: false },
shown: ["Nothing here yet"],
- hidden: ["Recent", "No matches"],
+ hidden: ["Sessions", "No matches"],
},
{
what: "the space is settled with items",
state: { items: [item()], isLoading: false },
- shown: ["Recent", "Investigate signup drop-off"],
+ shown: ["Sessions", "Investigate signup drop-off"],
hidden: ["No matches", "Nothing here yet"],
},
])("shows one state when $what", ({ state, shown, hidden }) => {
@@ -162,3 +163,100 @@ describe("ChannelSidebar", () => {
expect(screen.queryByText("Nothing here yet")).not.toBeInTheDocument();
});
});
+
+describe("ChannelSidebar recents list", () => {
+ const NOW = new Date(2026, 6, 29, 12);
+
+ beforeEach(() => {
+ mocks.isLoading = false;
+ mocks.channelMissing = false;
+ vi.useFakeTimers({ shouldAdvanceTime: true });
+ vi.setSystemTime(NOW);
+ });
+
+ afterEach(() => {
+ vi.useRealTimers();
+ });
+
+ it("lists recents newest first without day separators", () => {
+ mocks.items = [
+ item({
+ key: "task:a",
+ id: "a",
+ title: "Today's work",
+ ts: new Date(2026, 6, 29, 9).getTime(),
+ }),
+ item({
+ key: "task:b",
+ id: "b",
+ title: "Also today",
+ ts: new Date(2026, 6, 29, 8).getTime(),
+ }),
+ item({
+ key: "task:c",
+ id: "c",
+ title: "Yesterday's work",
+ ts: new Date(2026, 6, 28, 17).getTime(),
+ }),
+ item({
+ key: "task:d",
+ id: "d",
+ title: "Older work",
+ ts: new Date(2026, 6, 20, 17).getTime(),
+ }),
+ ];
+
+ renderSidebar();
+
+ expect(screen.getByText("Today's work")).not.toBeNull();
+ expect(screen.getByText("Also today")).not.toBeNull();
+ expect(screen.getByText("Yesterday's work")).not.toBeNull();
+ expect(screen.getByText("Older work")).not.toBeNull();
+ expect(screen.queryByText("Today")).toBeNull();
+ expect(screen.queryByText("Yesterday")).toBeNull();
+ expect(screen.queryByText("Monday, July 20th")).toBeNull();
+ });
+
+ it("keeps items from the same day as plain rows", () => {
+ mocks.items = [
+ item({ key: "task:a", id: "a", ts: new Date(2026, 6, 29, 9).getTime() }),
+ item({ key: "task:b", id: "b", ts: new Date(2026, 6, 29, 8).getTime() }),
+ item({ key: "task:c", id: "c", ts: new Date(2026, 6, 29, 1).getTime() }),
+ ];
+
+ renderSidebar();
+
+ expect(screen.getAllByText("Investigate signup drop-off")).toHaveLength(3);
+ expect(screen.queryByText("Today")).toBeNull();
+ });
+
+ it("lists pins in the one session list, ahead of newer items", () => {
+ mocks.items = [
+ item({
+ key: "task:newer",
+ id: "newer",
+ title: "Filed this morning",
+ ts: new Date(2026, 6, 30, 9).getTime(),
+ }),
+ item({
+ key: "task:pinned",
+ id: "pinned",
+ title: "Kept at hand",
+ pinned: true,
+ ts: new Date(2026, 6, 20, 9).getTime(),
+ }),
+ ];
+
+ renderSidebar();
+
+ // No section of its own — a pin is a mark on a session, and the row's badge
+ // is what says so.
+ expect(screen.queryByText("Pinned")).toBeNull();
+ const titles = screen
+ .getAllByText(/Kept at hand|Filed this morning/)
+ .map((el) => el.textContent);
+ // Older, but pinned: it sorts above the newer row rather than risking the
+ // recents cap.
+ expect(titles).toEqual(["Kept at hand", "Filed this morning"]);
+ });
+});
diff --git a/products/desktop/packages/ui/src/features/canvas/components/ChannelSidebar.tsx b/products/desktop/packages/ui/src/features/canvas/components/ChannelSidebar.tsx
index c069e1ac7da0..a2e8bb520bac 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/ChannelSidebar.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/ChannelSidebar.tsx
@@ -8,6 +8,7 @@ import type { CreatedByFilter } from "@posthog/core/canvas/channelItems";
import { filterChannelItems } from "@posthog/core/canvas/channelItems";
import { RUN_STATUS_FILTER_OPTIONS } from "@posthog/core/canvas/runStatus";
import {
+ Button,
cn,
DropdownMenu,
DropdownMenuContent,
@@ -32,14 +33,14 @@ import { ChannelItemRow } from "@posthog/ui/features/canvas/components/ChannelIt
import { ChannelsFab } from "@posthog/ui/features/canvas/components/ChannelsFab";
import {
type ChannelPageKey,
- channelPageIcon,
channelPageLabel,
} from "@posthog/ui/features/canvas/components/channelPages";
import { useChannelItems } from "@posthog/ui/features/canvas/hooks/useChannelItems";
+import { useChannels } from "@posthog/ui/features/canvas/hooks/useChannels";
+import { PERSONAL_CHANNEL_NAME } from "@posthog/ui/features/canvas/hooks/useTaskChannels";
import { useCommandCenterStore } from "@posthog/ui/features/command-center/commandCenterStore";
import { useFeatureFlag } from "@posthog/ui/features/feature-flags/useFeatureFlag";
import { SidebarItem } from "@posthog/ui/features/sidebar/components/SidebarItem";
-import { useTaskContextMenu } from "@posthog/ui/features/tasks/useTaskContextMenu";
import { useRenameTask } from "@posthog/ui/features/tasks/useTaskMutations";
import { useTasks } from "@posthog/ui/features/tasks/useTasks";
import { navigateToCommandCenter } from "@posthog/ui/router/navigationBridge";
@@ -54,11 +55,11 @@ const CREATED_BY_OPTIONS: readonly { value: CreatedByFilter; label: string }[] =
{ value: "others", label: "Other people" },
] as const;
-const HEADER_ICON_BUTTON_CLASS =
- "flex size-5 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-fill-hover hover:text-foreground";
-
+// The header's icon buttons are quill's ghost button at the 20px scale; only the
+// sticky state is ours, because quill styles the transient open state (hover,
+// popup) but has no notion of "search is showing" or "a filter is applied".
const cnHeaderButton = (active: boolean) =>
- cn(HEADER_ICON_BUTTON_CLASS, active && "bg-fill-selected text-foreground");
+ cn("text-muted-foreground", active && "bg-fill-selected text-foreground");
const RECENTS_CAP = 30;
const log = logger.scope("channel-sidebar");
@@ -70,6 +71,7 @@ function RecentSectionHeader({
onQueryChange,
createdByFilter,
onCreatedByChange,
+ showCreatedBy,
statusFilter,
onStatusChange,
filtersActive,
@@ -80,35 +82,39 @@ function RecentSectionHeader({
onQueryChange: (value: string) => void;
createdByFilter: CreatedByFilter;
onCreatedByChange: (value: CreatedByFilter) => void;
+ /** False in #me, where every session is yours and the filter says nothing. */
+ showCreatedBy: boolean;
statusFilter: TaskRunStatus | null;
onStatusChange: (value: TaskRunStatus | null) => void;
filtersActive: boolean;
}) {
return (
<>
- <div className="flex items-center gap-0.5 pr-1">
+ <div className="flex items-center gap-0.5">
<div className="min-w-0 flex-1">
- <MenuLabel>Recent</MenuLabel>
+ <MenuLabel>Sessions</MenuLabel>
</div>
- <button
- type="button"
+ <Button
+ variant="default"
+ size="icon-xs"
aria-label="Search"
aria-pressed={searchOpen}
onClick={onToggleSearch}
className={cnHeaderButton(searchOpen)}
>
<MagnifyingGlass size={12} />
- </button>
+ </Button>
<DropdownMenu>
<DropdownMenuTrigger
render={
- <button
- type="button"
+ <Button
+ variant="default"
+ size="icon-xs"
aria-label="Filter"
className={cnHeaderButton(filtersActive)}
>
<FunnelSimpleIcon size={12} />
- </button>
+ </Button>
}
/>
<DropdownMenuContent
@@ -117,20 +123,30 @@ function RecentSectionHeader({
sideOffset={6}
className="min-w-fit"
>
- <MenuLabel>Created by</MenuLabel>
- <DropdownMenuRadioGroup
- value={createdByFilter}
- onValueChange={(value) =>
- onCreatedByChange(value as CreatedByFilter)
- }
- >
- {CREATED_BY_OPTIONS.map((option) => (
- <DropdownMenuRadioItem key={option.value} value={option.value}>
- {option.label}
- </DropdownMenuRadioItem>
- ))}
- </DropdownMenuRadioGroup>
- <DropdownMenuSeparator />
+ {/* #me holds only your own sessions, so "created by" can only ever
+ answer "you" — the whole group is dropped rather than shown with
+ two options that empty the list. */}
+ {showCreatedBy && (
+ <>
+ <MenuLabel>Created by</MenuLabel>
+ <DropdownMenuRadioGroup
+ value={createdByFilter}
+ onValueChange={(value) =>
+ onCreatedByChange(value as CreatedByFilter)
+ }
+ >
+ {CREATED_BY_OPTIONS.map((option) => (
+ <DropdownMenuRadioItem
+ key={option.value}
+ value={option.value}
+ >
+ {option.label}
+ </DropdownMenuRadioItem>
+ ))}
+ </DropdownMenuRadioGroup>
+ <DropdownMenuSeparator />
+ </>
+ )}
<MenuLabel>Status</MenuLabel>
<DropdownMenuRadioGroup
value={statusFilter ?? "any"}
@@ -159,7 +175,7 @@ function RecentSectionHeader({
value={query}
onChange={(event) => onQueryChange(event.target.value)}
placeholder="Search…"
- aria-label="Search recent items"
+ aria-label="Search sessions"
className="h-6 text-[12px]"
/>
</div>
@@ -175,7 +191,7 @@ const SKELETON_ROW_WIDTHS = [60, 80, 40, 75, 50, 66] as const;
function ChannelItemsSkeleton() {
return (
<div aria-hidden className="flex flex-col gap-px">
- {/* Stands in for the "Recent" MenuLabel, so it carries that label's scale. */}
+ {/* Stands in for the "Sessions" MenuLabel, so it carries that label's scale. */}
<SkeletonText
lines={1}
maxWidth={100}
@@ -237,8 +253,10 @@ export function ChannelSidebar({ channelId }: { channelId: string }) {
const { items, actions, me, isLoading, channelMissing } =
useChannelItems(channelId);
- const { showContextMenu, editingTaskId, setEditingTaskId } =
- useTaskContextMenu();
+ // Inline rename is the only thing left of the old native-menu hook here: the
+ // row's menu is a quill one now, so this surface no longer reaches into the
+ // main process to draw it.
+ const [editingTaskId, setEditingTaskId] = useState<string | null>(null);
const { renameTask } = useRenameTask();
const commandCenterCells = useCommandCenterStore((state) => state.cells);
const assignTaskToCommandCenter = useCommandCenterStore(
@@ -255,7 +273,17 @@ export function ChannelSidebar({ channelId }: { channelId: string }) {
const [createdByFilter, setCreatedByFilter] =
useState<CreatedByFilter>("anyone");
const [statusFilter, setStatusFilter] = useState<TaskRunStatus | null>(null);
- const filtersActive = createdByFilter !== "anyone" || statusFilter !== null;
+ // Every session in #me is yours, so the author filter has nothing to sort by.
+ // The state survives a space switch, so the value is neutralised here as well
+ // as hidden — otherwise "Other people" carried in from a shared space would
+ // empty this list with no visible control to undo it.
+ const { channels } = useChannels();
+ const isPersonalChannel =
+ channels.find((c) => c.id === channelId)?.name === PERSONAL_CHANNEL_NAME;
+ const createdBy: CreatedByFilter = isPersonalChannel
+ ? "anyone"
+ : createdByFilter;
+ const filtersActive = createdBy !== "anyone" || statusFilter !== null;
const base = `/website/${channelId}`;
// Activeness is a key comparison rather than a flag baked into each item, so
@@ -267,15 +295,22 @@ export function ChannelSidebar({ channelId }: { channelId: string }) {
return task ? `task:${task[1]}` : null;
}, [pathname]);
- const pinnedItems = useMemo(() => items.filter((i) => i.pinned), [items]);
- const recentItems = useMemo(
- () =>
- filterChannelItems(
- items.filter((i) => !i.pinned),
- { query, createdBy: createdByFilter, status: statusFilter, me },
- ).slice(0, RECENTS_CAP),
- [items, query, createdByFilter, statusFilter, me],
- );
+ // One list, pins included — a pin is a mark on a session, not a different kind
+ // of thing, and the row's own badge says so. They sort to the top because a pin
+ // is a request not to lose the thing: below the recency order it would fall off
+ // the end of the cap.
+ const recentItems = useMemo(() => {
+ const matching = filterChannelItems(items, {
+ query,
+ createdBy,
+ status: statusFilter,
+ me,
+ });
+ return [
+ ...matching.filter((i) => i.pinned),
+ ...matching.filter((i) => !i.pinned),
+ ].slice(0, RECENTS_CAP);
+ }, [items, query, createdBy, statusFilter, me]);
const narrowed = filtersActive || searchOpen;
const listState = listStateOf({
@@ -284,41 +319,40 @@ export function ChannelSidebar({ channelId }: { channelId: string }) {
itemCount: items.length,
narrowed,
});
- // The list's two sections, which only exist once there are items. With
- // everything pinned there's nothing left to list — but keep the header while
- // it's narrowed, so you can undo whatever emptied it.
- const showPinned = listState === "ready" && pinnedItems.length > 0;
- const showRecent =
- listState === "ready" && (items.some((i) => !i.pinned) || narrowed);
+ // The one section, which only exists once there are items — but its header
+ // stays while the list is narrowed, so you can undo whatever emptied it.
+ const showRecent = listState === "ready";
+
+ // The first free command-centre cell, or nothing if every cell is taken by a
+ // task that still exists.
+ const commandCenterAssigner = (taskId: string) => {
+ const cellIndex = commandCenterCells.findIndex(
+ (cellTaskId) => cellTaskId == null || !allTaskIds.has(cellTaskId),
+ );
+ if (cellIndex === -1) return undefined;
+ return () => {
+ assignTaskToCommandCenter(cellIndex, taskId);
+ navigateToCommandCenter();
+ };
+ };
const taskRow = (item: (typeof items)[number]) => (
<ChannelItemRow
key={item.key}
item={item}
+ channelId={channelId}
isActive={item.key === activeKey}
actions={actions}
isEditing={item.kind === "task" && editingTaskId === item.id}
- onContextMenu={
- item.kind === "task"
- ? (event) =>
- void showContextMenu(item, event, {
- isPinned: item.pinned,
- isInCommandCenter: commandCenterCells.includes(item.id),
- hasEmptyCommandCenterCell: commandCenterCells.some(
- (taskId) => taskId == null || !allTaskIds.has(taskId),
- ),
- showArchivePrior: false,
- onTogglePin: () => actions.togglePin(item),
- onArchive: () => actions.archive(item),
- onAddToCommandCenter: () => {
- const cellIndex = commandCenterCells.findIndex(
- (taskId) => taskId == null || !allTaskIds.has(taskId),
- );
- if (cellIndex === -1) return;
- assignTaskToCommandCenter(cellIndex, item.id);
- navigateToCommandCenter();
- },
- })
+ onRename={
+ item.kind === "task" ? () => setEditingTaskId(item.id) : undefined
+ }
+ // Undefined disables the menu item: a full command centre has nowhere to
+ // put the task, and an action that silently does nothing is worse than a
+ // greyed-out one.
+ onAddToCommandCenter={
+ item.kind === "task" && !commandCenterCells.includes(item.id)
+ ? commandCenterAssigner(item.id)
: undefined
}
onEditSubmit={
@@ -341,8 +375,10 @@ export function ChannelSidebar({ channelId }: { channelId: string }) {
/>
);
- // Label and icon come from the shared space-page table, so a sidebar row and
- // the header breadcrumb for the same page can never disagree.
+ // Label comes from the shared space-page table, so a sidebar row and the
+ // header breadcrumb for the same page can never disagree. No icon: this is a
+ // four-row list of words, and glyphs here only compete with the status dots
+ // in the sessions list below for the eye's attention.
const sectionRow = (
page: ChannelPageKey,
to: string,
@@ -350,7 +386,6 @@ export function ChannelSidebar({ channelId }: { channelId: string }) {
) => (
<SidebarItem
depth={0}
- icon={channelPageIcon(page, { size: 16 })}
label={channelPageLabel(page)}
isActive={pathname === to}
onClick={onClick}
@@ -358,10 +393,23 @@ export function ChannelSidebar({ channelId }: { channelId: string }) {
);
return (
- <div className="flex h-full min-h-0 flex-col">
+ <div className="flex h-full min-h-0 flex-col border-border border-t pt-1">
<ChannelBackRow channelId={channelId} />
<div className="flex flex-col gap-px px-2 pt-2">
+ {/* Starting a session is what you came here to do, so it leads the
+ pane's list of places rather than hiding behind one of them. */}
+ <SidebarItem
+ depth={0}
+ label="New session"
+ isActive={pathname === `${base}/new`}
+ onClick={() =>
+ void navigate({
+ to: "/website/$channelId/new",
+ params: { channelId },
+ })
+ }
+ />
{sectionRow(
"home",
base,
@@ -420,15 +468,6 @@ export function ChannelSidebar({ channelId }: { channelId: string }) {
</Empty>
)}
- {showPinned && (
- <>
- <MenuLabel>Pinned</MenuLabel>
- <div className="flex flex-col gap-px">
- {pinnedItems.map(taskRow)}
- </div>
- </>
- )}
-
{showRecent && (
<>
<RecentSectionHeader
@@ -439,8 +478,9 @@ export function ChannelSidebar({ channelId }: { channelId: string }) {
}}
query={query}
onQueryChange={setQuery}
- createdByFilter={createdByFilter}
+ createdByFilter={createdBy}
onCreatedByChange={setCreatedByFilter}
+ showCreatedBy={!isPersonalChannel}
statusFilter={statusFilter}
onStatusChange={setStatusFilter}
filtersActive={filtersActive}
diff --git a/products/desktop/packages/ui/src/features/canvas/components/ChannelsList.test.tsx b/products/desktop/packages/ui/src/features/canvas/components/ChannelsList.test.tsx
index dfb85c1f232d..66582e1dad48 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/ChannelsList.test.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/ChannelsList.test.tsx
@@ -52,6 +52,7 @@ import {
showChannelList,
showChannelPane,
} from "@posthog/ui/features/canvas/stores/channelPaneStore";
+import { useCurrentChannelStore } from "@posthog/ui/features/canvas/stores/currentChannelStore";
import { useSidebarStore } from "@posthog/ui/features/sidebar/sidebarStore";
import { ChannelsList } from "./ChannelsList";
@@ -81,6 +82,16 @@ describe("ChannelsList", () => {
useSidebarStore.setState({ collapsedSections: new Set() });
});
+ it("opens a space in the sidebar without navigating the main window", async () => {
+ const user = userEvent.setup();
+ renderList();
+
+ await user.click(screen.getByText("engineering"));
+
+ expect(useCurrentChannelStore.getState().currentChannelId).toBe(ENG.id);
+ expect(mocks.navigate).not.toHaveBeenCalled();
+ });
+
it("pins #me above the channels, with its ⌘1 shortcut", () => {
renderList();
const me = screen.getByText("me");
@@ -182,10 +193,8 @@ describe("ChannelsList", () => {
await user.type(screen.getByLabelText("Search spaces"), "eng");
await user.keyboard("{Enter}");
- expect(mocks.navigate).toHaveBeenCalledWith({
- to: "/website/$channelId",
- params: { channelId: ENG.id },
- });
+ expect(useCurrentChannelStore.getState().currentChannelId).toBe(ENG.id);
+ expect(mocks.navigate).not.toHaveBeenCalled();
});
it("moves the highlight with the arrow keys", async () => {
@@ -197,10 +206,8 @@ describe("ChannelsList", () => {
await user.type(screen.getByLabelText("Search spaces"), "e");
await user.keyboard("{ArrowDown}{Enter}");
- expect(mocks.navigate).toHaveBeenCalledWith({
- to: "/website/$channelId",
- params: { channelId: ENG.id },
- });
+ expect(useCurrentChannelStore.getState().currentChannelId).toBe(ENG.id);
+ expect(mocks.navigate).not.toHaveBeenCalled();
});
// Base UI's clear button is a tabIndex=-1 decoration by default, which left
@@ -247,10 +254,8 @@ describe("ChannelsList", () => {
await user.click(screen.getByLabelText("Search spaces"));
await user.keyboard("{ArrowDown}{Enter}");
- expect(mocks.navigate).toHaveBeenCalledWith({
- to: "/website/$channelId",
- params: { channelId: ENG.id },
- });
+ expect(useCurrentChannelStore.getState().currentChannelId).toBe(ENG.id);
+ expect(mocks.navigate).not.toHaveBeenCalled();
});
// Base UI resets the highlight when the pointer leaves a row, and
@@ -266,10 +271,8 @@ describe("ChannelsList", () => {
await user.unhover(row);
await user.keyboard("{Enter}");
- expect(mocks.navigate).toHaveBeenCalledWith({
- to: "/website/$channelId",
- params: { channelId: ENG.id },
- });
+ expect(useCurrentChannelStore.getState().currentChannelId).toBe(ENG.id);
+ expect(mocks.navigate).not.toHaveBeenCalled();
});
// A kept-mounted collapsed row would still be an option, so ↓ would walk
@@ -323,10 +326,8 @@ describe("ChannelsList", () => {
// it would have been the row after it.
await user.keyboard("{ArrowDown}{Enter}");
- expect(mocks.navigate).toHaveBeenCalledWith({
- to: "/website/$channelId",
- params: { channelId: ENG.id },
- });
+ expect(useCurrentChannelStore.getState().currentChannelId).toBe(ENG.id);
+ expect(mocks.navigate).not.toHaveBeenCalled();
});
it("selects a stale query so the next keystroke replaces it", async () => {
diff --git a/products/desktop/packages/ui/src/features/canvas/components/ChannelsList.tsx b/products/desktop/packages/ui/src/features/canvas/components/ChannelsList.tsx
index 57a7191976a5..9be83a64a60c 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/ChannelsList.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/ChannelsList.tsx
@@ -143,7 +143,7 @@ function SpaceRowSurface({
<AutocompleteItem
value={optionValue}
className={cn(
- "w-full min-w-0 data-selected:bg-fill-selected data-selected:text-foreground",
+ "w-full min-w-0 pr-1 data-selected:bg-fill-selected data-selected:text-foreground",
// quill wraps an option's children in its own flex row; widening it is
// what keeps the shortcut hint at the row's right edge and lets the
// name truncate, exactly as they do in the button above.
@@ -393,7 +393,7 @@ function ChannelMenu({
);
}
-// One channel in the list: a "# name" row that navigates to the channel home.
+// One channel in the list: a "# name" row that opens its sidebar.
// No expansion — the channel's surfaces live in the in-channel top nav.
function ChannelSection({
channel,
@@ -434,8 +434,8 @@ function ChannelSection({
return (
<Box className="group/chan relative" {...hoverProps}>
- {/* A single, non-expandable row: the "# name" navigates straight to the
- channel home. Right-clicking opens the same actions as the "..." menu. */}
+ {/* A single, non-expandable row: the "# name" opens the channel sidebar.
+ Right-clicking opens the same actions as the "..." menu. */}
<ContextMenu>
<ContextMenuTrigger
render={
@@ -475,8 +475,13 @@ function ChannelSection({
>
{channel.name}
</OverflowTickerText>
+ {/* `!mr-0` undoes quill's `.quill-button kbd { margin-right: -4px }`,
+ which is meant to let a shortcut hang into a button's own
+ padding. Here the row's inner span is `truncate` (overflow
+ hidden) and `ml-auto` eats every pixel of slack, so the hang
+ had nowhere to go and the last 4px of the hint was cut off. */}
{hotkeySlot != null && (
- <Kbd className="ml-auto shrink-0 opacity-50 group-hover/chan:opacity-0">
+ <Kbd className="!mr-0 ml-auto shrink-0 opacity-50 group-hover/chan:opacity-0">
{formatHotkey(`mod+${hotkeySlot}`)}
</Kbd>
)}
@@ -630,6 +635,7 @@ function useOpenPersonalChannel(): {
openPersonalChannel: () => Promise<void>;
isCreating: boolean;
} {
+ const spacesLayout = useChannelsLayout();
const navigate = useNavigate();
const setCurrentChannel = useCurrentChannelStore((s) => s.setCurrentChannel);
const { channels } = useChannels();
@@ -651,18 +657,20 @@ function useOpenPersonalChannel(): {
if (!channelId) return;
showChannelPane();
setCurrentChannel(channelId);
- void navigate({ to: "/website/$channelId", params: { channelId } });
+ if (!spacesLayout) {
+ void navigate({ to: "/website/$channelId", params: { channelId } });
+ }
};
return { ensureFolderId, openPersonalChannel, isCreating };
}
/**
- * Navigating into a channel, shared by the tree rows and the search results.
- * Slides before navigating: the route effect would get there too, but not until
- * the navigation resolves.
+ * Opening a channel, shared by the tree rows and the search results. In the
+ * Spaces layout this scopes the sidebar without moving the main window.
*/
function useOpenChannel(): (channel: Channel) => void {
+ const spacesLayout = useChannelsLayout();
const navigate = useNavigate();
const setCurrentChannel = useCurrentChannelStore((s) => s.setCurrentChannel);
@@ -674,10 +682,12 @@ function useOpenChannel(): (channel: Channel) => void {
});
showChannelPane();
setCurrentChannel(channel.id);
- void navigate({
- to: "/website/$channelId",
- params: { channelId: channel.id },
- });
+ if (!spacesLayout) {
+ void navigate({
+ to: "/website/$channelId",
+ params: { channelId: channel.id },
+ });
+ }
};
}
@@ -757,7 +767,7 @@ function PersonalChannelRow({ hotkeySlot }: { hotkeySlot?: number }) {
{PERSONAL_CHANNEL_NAME}
</span>
{hotkeySlot != null && (
- <Kbd className="ml-auto shrink-0 opacity-50 group-hover/chan:opacity-0">
+ <Kbd className="!mr-0 ml-auto shrink-0 opacity-50 group-hover/chan:opacity-0">
{formatHotkey(`mod+${hotkeySlot}`)}
</Kbd>
)}
diff --git a/products/desktop/packages/ui/src/features/canvas/components/ChannelsSidebar.tsx b/products/desktop/packages/ui/src/features/canvas/components/ChannelsSidebar.tsx
index d9f75f09479c..05f0d80851e0 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/ChannelsSidebar.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/ChannelsSidebar.tsx
@@ -234,6 +234,13 @@ export function ChannelsSidebar() {
{channelsLayout ? (
<>
+ {/* Which project you're in is the outermost thing about this window,
+ so under the layout it sits above the nav row rather than in the
+ footer. Its menu opens downward, which is the right direction
+ from the top of a sidebar. */}
+ <Box className="shrink-0 px-2 pb-1">
+ <ProjectSwitcher />
+ </Box>
<ChannelNav />
<ChannelPanes channelId={currentChannelId} showList={showList} />
</>
@@ -270,9 +277,13 @@ export function ChannelsSidebar() {
<LoopsPromoCard />
- <Box className="shrink-0 px-2 pb-2">
- <ProjectSwitcher />
- </Box>
+ {/* The code layout keeps it in the footer: that sidebar's top is the nav
+ section and task header, and there's no nav row to sit above. */}
+ {!channelsLayout && (
+ <Box className="shrink-0 px-2 pb-2">
+ <ProjectSwitcher />
+ </Box>
+ )}
</Flex>
</ResizableSidebar>
);
diff --git a/products/desktop/packages/ui/src/features/canvas/components/TaskRowMenu.tsx b/products/desktop/packages/ui/src/features/canvas/components/TaskRowMenu.tsx
new file mode 100644
index 000000000000..f3e3e4310e41
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/canvas/components/TaskRowMenu.tsx
@@ -0,0 +1,226 @@
+import { CaretRightIcon } from "@phosphor-icons/react";
+import {
+ Button,
+ ContextMenu,
+ ContextMenuContent,
+ ContextMenuItem,
+ ContextMenuSub,
+ ContextMenuSubTrigger,
+ ContextMenuTrigger,
+ DropdownMenu,
+ DropdownMenuTrigger,
+} from "@posthog/quill";
+import { PROJECT_BLUEBIRD_FLAG } from "@posthog/shared";
+import { useChannels } from "@posthog/ui/features/canvas/hooks/useChannels";
+import { useFileTaskToChannel } from "@posthog/ui/features/canvas/hooks/useFileTaskToChannel";
+import { useFeatureFlag } from "@posthog/ui/features/feature-flags/useFeatureFlag";
+import {
+ type MenuFlyoutItem,
+ MenuSubFlyout,
+ SearchableMenuFlyout,
+} from "@posthog/ui/primitives/SearchableMenuFlyout";
+import { type ComponentType, type ReactNode, useMemo } from "react";
+
+/**
+ * What a row's menu can do. The row owns the handlers because they're the same
+ * ones its list already has (pin, archive, delete, rename inline); only filing —
+ * which needs the channel list and a mutation — belongs to the menu.
+ *
+ * Canvases share this menu but not all of it: they can be pinned and deleted,
+ * and they can't be filed to a space or given a command-centre cell, both of
+ * which are task-shaped. `kind` is what decides, so a canvas gets a menu of the
+ * actions it has rather than a full one with half its items dead.
+ */
+export interface TaskRowMenuProps {
+ kind: "task" | "canvas";
+ id: string;
+ title: string;
+ isPinned: boolean;
+ /** The channel this task is already filed to, ticked in "File to…". */
+ channelId?: string;
+ /** Absent when the command centre is full, which disables the item. */
+ onAddToCommandCenter?: () => void;
+ /** Absent where there's no inline rename to open — canvases, for now. */
+ onRename?: () => void;
+ onTogglePin: () => void;
+ /** Tasks are archived; canvases are deleted (with an undo window). */
+ onArchive?: () => void;
+ onDelete?: () => void;
+}
+
+// The two menus differ only in which primitives draw them, so the item list is
+// written once against this shape. Base UI builds context menus on the same Menu
+// parts as dropdowns, so the props line up; typing them structurally keeps the
+// shared content from having to know which surface it's on.
+interface MenuParts {
+ Item: ComponentType<{
+ children: ReactNode;
+ disabled?: boolean;
+ variant?: "default" | "destructive";
+ onClick?: () => void;
+ }>;
+ Sub: ComponentType<{ children: ReactNode }>;
+ SubTrigger: ComponentType<{ children: ReactNode }>;
+}
+
+const CONTEXT_PARTS: MenuParts = {
+ Item: ContextMenuItem,
+ Sub: ContextMenuSub,
+ SubTrigger: ContextMenuSubTrigger,
+};
+
+/**
+ * The row's actions, in the order the native menu used: the edits, then the
+ * places a task can be sent, then the destructive one last.
+ */
+function TaskRowMenuItems({
+ parts,
+ menu,
+}: {
+ parts: MenuParts;
+ menu: TaskRowMenuProps;
+}) {
+ const { Item, Sub, SubTrigger } = parts;
+ // "File to…" is a Project Bluebird feature; gate the channel fetch behind the
+ // flag so neither the submenu nor its request reaches ungated users.
+ const bluebirdEnabled = useFeatureFlag(
+ PROJECT_BLUEBIRD_FLAG,
+ import.meta.env.DEV,
+ );
+ const isTask = menu.kind === "task";
+ const { channels } = useChannels({ enabled: bluebirdEnabled && isTask });
+ const fileToChannel = useFileTaskToChannel();
+
+ const channelItems: MenuFlyoutItem[] = channels.map((channel) => ({
+ id: channel.id,
+ label: channel.name,
+ current: channel.id === menu.channelId,
+ }));
+
+ return (
+ <>
+ <Item onClick={menu.onTogglePin}>{menu.isPinned ? "Unpin" : "Pin"}</Item>
+ {menu.onRename && <Item onClick={menu.onRename}>Rename</Item>}
+ {isTask && (
+ <Item
+ disabled={!menu.onAddToCommandCenter}
+ onClick={menu.onAddToCommandCenter}
+ >
+ Add to Command Center
+ </Item>
+ )}
+ {isTask && channelItems.length > 0 && (
+ <Sub>
+ <SubTrigger>File to…</SubTrigger>
+ <MenuSubFlyout className="w-64 p-0">
+ <SearchableMenuFlyout
+ items={channelItems}
+ placeholder="Search spaces…"
+ emptyLabel="No spaces"
+ onSelect={(channelId) =>
+ fileToChannel(channelId, menu.id, menu.title)
+ }
+ />
+ </MenuSubFlyout>
+ </Sub>
+ )}
+ {menu.onArchive && <Item onClick={menu.onArchive}>Archive</Item>}
+ {/* The ellipsis is the promise that a confirm follows — deleting a canvas
+ takes it away from everyone in the space. */}
+ {menu.onDelete && (
+ <Item variant="destructive" onClick={menu.onDelete}>
+ Delete…
+ </Item>
+ )}
+ </>
+ );
+}
+
+/**
+ * The same actions as a plain list, for a surface that is already open — the
+ * row's hover card. Rows are quill buttons rather than menu items because
+ * nothing here is a popup: there's no menu root to give `DropdownMenuItem` its
+ * keyboard handling, and a button is what quill offers for a click target in a
+ * card.
+ *
+ * `onAction` closes the surface once something has been chosen, and
+ * `onSubmenuOpenChange` reports the one thing that *is* a popup ("File to…"), so
+ * a hover surface can stay open while the pointer is inside it.
+ */
+export function TaskRowMenuList({
+ menu,
+ onAction,
+ onSubmenuOpenChange,
+}: {
+ menu: TaskRowMenuProps;
+ onAction: () => void;
+ onSubmenuOpenChange: (open: boolean) => void;
+}) {
+ const parts: MenuParts = useMemo(
+ () => ({
+ Item: ({ children, disabled, variant, onClick }) => (
+ <Button
+ variant={variant === "destructive" ? "destructive" : "default"}
+ size="sm"
+ left
+ disabled={disabled}
+ className="w-full"
+ onClick={() => {
+ onClick?.();
+ onAction();
+ }}
+ >
+ {children}
+ </Button>
+ ),
+ Sub: ({ children }) => (
+ <DropdownMenu onOpenChange={onSubmenuOpenChange}>
+ {children}
+ </DropdownMenu>
+ ),
+ // `openOnHover`, so the spaces flyout arrives the way a submenu does in
+ // the right-click menu — pointing at the row is the whole gesture, and
+ // this card is a hover surface to begin with.
+ SubTrigger: ({ children }) => (
+ <DropdownMenuTrigger
+ openOnHover
+ delay={150}
+ closeDelay={100}
+ render={
+ <Button variant="default" size="sm" left className="w-full">
+ <span className="flex-1 text-left">{children}</span>
+ <CaretRightIcon size={12} />
+ </Button>
+ }
+ />
+ ),
+ }),
+ [onAction, onSubmenuOpenChange],
+ );
+
+ return (
+ <div className="flex flex-col">
+ <TaskRowMenuItems parts={parts} menu={menu} />
+ </div>
+ );
+}
+
+/** The same menu on right-click, wrapping the row. */
+export function TaskRowContextMenu({
+ menu,
+ children,
+}: {
+ menu: TaskRowMenuProps;
+ children: ReactNode;
+}) {
+ return (
+ <ContextMenu>
+ <ContextMenuTrigger render={<div className="min-w-0" />}>
+ {children}
+ </ContextMenuTrigger>
+ <ContextMenuContent className="w-56">
+ <TaskRowMenuItems parts={CONTEXT_PARTS} menu={menu} />
+ </ContextMenuContent>
+ </ContextMenu>
+ );
+}
diff --git a/products/desktop/packages/ui/src/features/canvas/components/WebsiteChannelHome.test.tsx b/products/desktop/packages/ui/src/features/canvas/components/WebsiteChannelHome.test.tsx
new file mode 100644
index 000000000000..a8ccd8d356ad
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/canvas/components/WebsiteChannelHome.test.tsx
@@ -0,0 +1,116 @@
+import { Theme } from "@radix-ui/themes";
+import { act, render, screen } from "@testing-library/react";
+import { beforeEach, describe, expect, it, vi } from "vitest";
+
+if (typeof globalThis.ResizeObserver === "undefined") {
+ globalThis.ResizeObserver = class {
+ observe() {}
+ unobserve() {}
+ disconnect() {}
+ } as unknown as typeof ResizeObserver;
+}
+
+vi.mock("@posthog/ui/shell/rendererStorage", () => ({
+ electronStorage: {
+ getItem: () => null,
+ setItem: () => {},
+ removeItem: () => {},
+ },
+}));
+vi.mock("@posthog/ui/features/canvas/hooks/useChannels", () => ({
+ useChannels: () => ({
+ channels: [{ id: "chan-1", name: "eng" }],
+ isLoading: false,
+ }),
+}));
+vi.mock("@posthog/ui/features/canvas/hooks/useChannelsLayout", () => ({
+ useChannelsLayout: () => true,
+}));
+vi.mock("@posthog/ui/features/canvas/hooks/useTaskChannels", () => ({
+ PERSONAL_CHANNEL_NAME: "me",
+ useBackendChannel: () => ({
+ channel: { id: "backend-1", name: "eng" },
+ isLoading: false,
+ }),
+}));
+vi.mock("@posthog/ui/features/canvas/hooks/useChannelFeed", () => ({
+ useChannelFeed: () => ({ tasks: [], isLoading: false }),
+ channelFeedQueryKey: () => ["feed"],
+}));
+vi.mock("@posthog/ui/features/canvas/hooks/useChannelFeedMessages", () => ({
+ useChannelFeedMessages: () => ({ messages: [], isLoading: false }),
+ channelCreationMessage: () => null,
+}));
+vi.mock("@posthog/ui/features/canvas/hooks/useFolderInstructions", () => ({
+ useFolderInstructions: () => ({ data: undefined, isLoading: false }),
+}));
+vi.mock("@posthog/ui/features/canvas/hooks/useChannelTasks", () => ({
+ useChannelTaskMutations: () => ({ fileTask: () => Promise.resolve() }),
+}));
+vi.mock("@posthog/ui/hooks/useSetHeaderContent", () => ({
+ useSetHeaderContent: () => {},
+}));
+vi.mock("@posthog/ui/shell/analytics", () => ({ track: vi.fn() }));
+vi.mock("@tanstack/react-query", () => ({
+ useQueryClient: () => ({ setQueryData: vi.fn(), invalidateQueries: vi.fn() }),
+}));
+vi.mock("@tanstack/react-router", () => ({ useNavigate: () => vi.fn() }));
+
+// ThreadSidebar is the task dock under test; the rest of the channel chrome
+// (feed rows, composer, intro) plays no part in the feed/sidebar exclusion.
+vi.mock("@posthog/ui/features/canvas/components/ChannelFeedView", () => ({
+ ChannelFeedView: () => <div data-testid="feed" />,
+}));
+vi.mock("@posthog/ui/features/canvas/components/ChannelHomeComposer", () => ({
+ ChannelHomeComposer: () => null,
+}));
+vi.mock("@posthog/ui/features/canvas/components/ChannelIntro", () => ({
+ ChannelIntro: () => null,
+}));
+vi.mock("@posthog/ui/features/canvas/components/CreateChannelModal", () => ({
+ CreateChannelModal: () => null,
+}));
+vi.mock("@posthog/ui/features/canvas/components/ThreadSidebar", () => ({
+ ThreadSidebar: () => <div data-testid="task-sidebar" />,
+}));
+
+import { useThreadPanelStore } from "@posthog/ui/features/canvas/stores/threadPanelStore";
+import { WebsiteChannelHome } from "./WebsiteChannelHome";
+
+describe("WebsiteChannelHome", () => {
+ beforeEach(() => {
+ useThreadPanelStore.setState({
+ openByChannel: {},
+ collapsed: false,
+ width: 360,
+ });
+ });
+
+ it("drops a stale open thread so the feed can't show a task sidebar", () => {
+ useThreadPanelStore.getState().openThread("chan-1", "task-1");
+ render(
+ <Theme>
+ <WebsiteChannelHome channelId="chan-1" />
+ </Theme>,
+ );
+
+ expect(screen.getByTestId("feed")).toBeTruthy();
+ expect(screen.queryByTestId("task-sidebar")).toBeNull();
+ expect(useThreadPanelStore.getState().openByChannel["chan-1"]).toBeNull();
+ });
+
+ it("shows the task sidebar for a thread opened from this feed", () => {
+ render(
+ <Theme>
+ <WebsiteChannelHome channelId="chan-1" />
+ </Theme>,
+ );
+
+ act(() => {
+ useThreadPanelStore.getState().openThread("chan-1", "task-1");
+ });
+
+ expect(screen.getByTestId("task-sidebar")).toBeTruthy();
+ expect(screen.queryByTestId("feed")).toBeTruthy();
+ });
+});
diff --git a/products/desktop/packages/ui/src/features/canvas/components/WebsiteChannelHome.tsx b/products/desktop/packages/ui/src/features/canvas/components/WebsiteChannelHome.tsx
index 3195ba4877d2..e34e11a7d255 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/WebsiteChannelHome.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/WebsiteChannelHome.tsx
@@ -44,7 +44,7 @@ import { track } from "@posthog/ui/shell/analytics";
import { Heading, Text } from "@radix-ui/themes";
import { useQueryClient } from "@tanstack/react-query";
import { useNavigate } from "@tanstack/react-router";
-import { useCallback, useMemo, useRef, useState } from "react";
+import { useCallback, useEffect, useMemo, useRef, useState } from "react";
// A channel: a Slack-style multiplayer feed. Each member message kicks off a
// task rendered as a card everyone in the channel sees; the composer stays
@@ -135,6 +135,19 @@ export function WebsiteChannelHome({ channelId }: { channelId: string }) {
const openThread = useThreadPanelStore((s) => s.openThread);
const closeThread = useThreadPanelStore((s) => s.closeThread);
+ // The open thread outlives the thread view, so the feed showing itself is
+ // the only signal an inherited thread is gone. Suppress it in render (an
+ // effect alone would paint the sidebar for a frame first) and clear the
+ // store; threads opened from this feed instance paint normally.
+ const [inheritedThreadTaskId] = useState(
+ () => useThreadPanelStore.getState().openByChannel[channelId] ?? null,
+ );
+ useEffect(() => {
+ if (inheritedThreadTaskId) {
+ useThreadPanelStore.getState().closeThread(channelId);
+ }
+ }, [channelId, inheritedThreadTaskId]);
+
const handleSuggestionSelect = useCallback(
(prompt: string, mode?: string) => {
composerRef.current?.applySuggestion(prompt, mode);
@@ -317,7 +330,7 @@ export function WebsiteChannelHome({ channelId }: { channelId: string }) {
</div>
</div>
- {threadTaskId && (
+ {threadTaskId && threadTaskId !== inheritedThreadTaskId && (
<ThreadSidebar
taskId={threadTaskId}
channelId={channelId}
diff --git a/products/desktop/packages/ui/src/features/canvas/components/WebsiteChannelLoops.test.tsx b/products/desktop/packages/ui/src/features/canvas/components/WebsiteChannelLoops.test.tsx
new file mode 100644
index 000000000000..1a816e51cb1b
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/canvas/components/WebsiteChannelLoops.test.tsx
@@ -0,0 +1,97 @@
+import { render, screen } from "@testing-library/react";
+import type { ReactNode } from "react";
+import { beforeEach, describe, expect, it, vi } from "vitest";
+
+const mocks = vi.hoisted(() => ({
+ channels: [{ id: "personal-space", name: "me", path: "/me" }],
+ channelsLoading: false,
+ useLoops: vi.fn(() => ({ data: [], isLoading: false, isError: false })),
+}));
+
+vi.mock("@posthog/ui/features/canvas/hooks/useChannels", () => ({
+ useChannels: () => ({
+ channels: mocks.channels,
+ isLoading: mocks.channelsLoading,
+ }),
+}));
+vi.mock("@posthog/ui/features/canvas/hooks/useChannelsLayout", () => ({
+ useChannelsLayout: () => true,
+}));
+vi.mock("@posthog/ui/features/canvas/components/ChannelHeader", () => ({
+ ChannelHeader: () => <div>Personal space header</div>,
+}));
+vi.mock("@posthog/ui/hooks/useSetHeaderContent", () => ({
+ useSetHeaderContent: () => {},
+}));
+vi.mock("@posthog/ui/router/navigationBridge", () => ({
+ navigateToNewLoop: vi.fn(),
+}));
+vi.mock("@posthog/ui/features/canvas/hooks/useOrgMembers", () => ({
+ useOrgMembers: () => ({
+ members: [],
+ isLoading: false,
+ isError: false,
+ isComplete: true,
+ }),
+}));
+vi.mock("@posthog/ui/features/loops/hooks/useLoops", () => ({
+ useLoops: mocks.useLoops,
+ useLoopLimits: () => null,
+}));
+vi.mock("@posthog/ui/features/loops/components/LoopBuilderComposer", () => ({
+ LoopBuilderComposer: () => null,
+}));
+vi.mock("@posthog/ui/features/loops/components/LoopFallbacks", () => ({
+ LoopsEmptyNotice: () => null,
+ LoopsSkeleton: () => <div>Loading loops</div>,
+}));
+vi.mock("@posthog/ui/features/loops/components/LoopRow", () => ({
+ LoopRow: () => null,
+}));
+vi.mock("@posthog/ui/features/loops/components/LoopsEmptyState", () => ({
+ LoopsEmptyState: () => null,
+}));
+vi.mock("@posthog/ui/features/loops/components/LoopTemplatesSection", () => ({
+ LoopTemplatesSection: () => null,
+}));
+vi.mock("@posthog/ui/features/canvas/hooks/useTaskChannels", () => ({
+ PERSONAL_CHANNEL_NAME: "me",
+}));
+vi.mock("@posthog/ui/features/loops/components/LoopsListView", () => ({
+ LoopsListView: ({ headerContent }: { headerContent?: ReactNode }) => (
+ <div>
+ {headerContent}
+ Project loops registry
+ </div>
+ ),
+}));
+
+import { WebsiteChannelLoops } from "./WebsiteChannelLoops";
+
+describe("WebsiteChannelLoops", () => {
+ beforeEach(() => {
+ mocks.channels = [{ id: "personal-space", name: "me", path: "/me" }];
+ mocks.channelsLoading = false;
+ mocks.useLoops.mockClear();
+ });
+
+ it("shows the project loops registry in the Personal space", () => {
+ render(<WebsiteChannelLoops channelId="personal-space" />);
+
+ expect(screen.getByText("Project loops registry")).toBeInTheDocument();
+ expect(screen.getByText("Personal space header")).toBeInTheDocument();
+ });
+
+ it("waits for the Personal space to resolve before choosing a list", () => {
+ mocks.channels = [];
+ mocks.channelsLoading = true;
+
+ render(<WebsiteChannelLoops channelId="personal-space" />);
+
+ expect(screen.getByText("Loading loops")).toBeInTheDocument();
+ expect(
+ screen.queryByText("Project loops registry"),
+ ).not.toBeInTheDocument();
+ expect(mocks.useLoops).not.toHaveBeenCalled();
+ });
+});
diff --git a/products/desktop/packages/ui/src/features/canvas/components/WebsiteChannelLoops.tsx b/products/desktop/packages/ui/src/features/canvas/components/WebsiteChannelLoops.tsx
index 44efad88aa91..c9e789ea0641 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/WebsiteChannelLoops.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/WebsiteChannelLoops.tsx
@@ -14,7 +14,7 @@ import {
} from "@posthog/ui/primitives/PageHeader";
import { navigateToNewLoop } from "@posthog/ui/router/navigationBridge";
import { Flex, Heading, Text } from "@radix-ui/themes";
-import { useMemo } from "react";
+import { type ReactNode, useMemo } from "react";
import { LoopBuilderComposer } from "../../loops/components/LoopBuilderComposer";
import {
LoopsEmptyNotice,
@@ -22,6 +22,7 @@ import {
} from "../../loops/components/LoopFallbacks";
import { LoopRow } from "../../loops/components/LoopRow";
import { LoopsEmptyState } from "../../loops/components/LoopsEmptyState";
+import { LoopsListView } from "../../loops/components/LoopsListView";
import { LoopTemplatesSection } from "../../loops/components/LoopTemplatesSection";
import { useLoopLimits, useLoops } from "../../loops/hooks/useLoops";
import { useLoopDraftStore } from "../../loops/loopDraftStore";
@@ -56,6 +57,52 @@ function contextQuickStarts(name: string): { label: string; prompt: string }[] {
* composer pinned at the bottom), but the build surface is tuned to automations that feed
* this context. `channelId` is the desktop folder id, matching `context_target.folder_id`. */
export function WebsiteChannelLoops({ channelId }: { channelId: string }) {
+ const { channels, isLoading } = useChannels();
+ const channel = channels.find((candidate) => candidate.id === channelId);
+ const headerContent = useMemo(
+ () => <ChannelHeader channelId={channelId} page="loops" />,
+ [channelId],
+ );
+
+ // Don't mount the scoped scene while the route's space is unresolved. In
+ // particular, that would flash a raw-id empty state for Personal before the
+ // channel query identifies it as the project-level loops registry.
+ if (isLoading && !channel) {
+ return <ChannelLoopsLoading headerContent={headerContent} />;
+ }
+
+ // The Personal space is the project-level home for loops in the spaces
+ // layout. API-created and other unattached loops have no context_target, so
+ // rendering the space-scoped list here incorrectly produces the global
+ // "Create your first loop" empty state while those loops already exist.
+ if (channel?.name === PERSONAL_CHANNEL_NAME) {
+ return <LoopsListView headerContent={headerContent} />;
+ }
+
+ return (
+ <SpaceAttachedLoops
+ channelId={channelId}
+ contextName={channel?.name ?? channelId}
+ />
+ );
+}
+
+function ChannelLoopsLoading({ headerContent }: { headerContent: ReactNode }) {
+ useSetHeaderContent(headerContent);
+ return (
+ <div className="mx-auto w-full max-w-5xl px-8 py-8">
+ <LoopsSkeleton />
+ </div>
+ );
+}
+
+function SpaceAttachedLoops({
+ channelId,
+ contextName,
+}: {
+ channelId: string;
+ contextName: string;
+}) {
const { data: loops, isLoading, isError } = useLoops();
const spacesLayout = useChannelsLayout();
const limits = useLoopLimits();
@@ -63,10 +110,6 @@ export function WebsiteChannelLoops({ channelId }: { channelId: string }) {
limits?.atLimit === true
? `You've reached the limit of ${limits.max} loops for this project. Delete one to add another.`
: null;
- const { channels } = useChannels();
- const channel = channels.find((c) => c.id === channelId);
- const contextName = channel?.name ?? channelId;
- const isPersonal = contextName === PERSONAL_CHANNEL_NAME;
useSetHeaderContent(
useMemo(
@@ -113,7 +156,7 @@ export function WebsiteChannelLoops({ channelId }: { channelId: string }) {
navigateToNewLoop();
};
- const title = isPersonal ? "Loops" : `Automate #${contextName}`;
+ const title = `Automate #${contextName}`;
const description =
"Put your work on autopilot. Loops run on a schedule, on an API call, or when something happens on GitHub. You can finally close the laptop!";
const createButton = (
@@ -214,9 +257,7 @@ export function WebsiteChannelLoops({ channelId }: { channelId: string }) {
</Flex>
</Flex>
) : (
- <LoopsEmptyState
- contextName={isPersonal ? undefined : contextName}
- />
+ <LoopsEmptyState contextName={contextName} />
)}
<LoopTemplatesSection onSelect={startFromTemplate} />
diff --git a/products/desktop/packages/ui/src/features/canvas/components/channelGlyph.test.tsx b/products/desktop/packages/ui/src/features/canvas/components/channelGlyph.test.tsx
index 27401260b11b..2d01ef485c79 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/channelGlyph.test.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/channelGlyph.test.tsx
@@ -1,4 +1,4 @@
-import { CubeIcon, HashIcon, LockSimpleIcon } from "@phosphor-icons/react";
+import { HashIcon, LockSimpleIcon } from "@phosphor-icons/react";
import type { ReactElement } from "react";
import { describe, expect, it } from "vitest";
import { channelGlyph, isPrivateChannel } from "./channelGlyph";
@@ -23,7 +23,6 @@ describe("isPrivateChannel", () => {
describe("channelGlyph", () => {
it.each([
["channel", false, HashIcon],
- ["space", true, CubeIcon],
["private space", true, LockSimpleIcon],
])("renders the %s glyph", (_, space, expectedIcon) => {
const name = expectedIcon === LockSimpleIcon ? "me" : "engineering";
@@ -31,4 +30,10 @@ describe("channelGlyph", () => {
expect(glyph.type).toBe(expectedIcon);
});
+
+ // A shared space carries no mark at all: the cube said nothing the name
+ // didn't, and only the private one is worth calling out.
+ it("gives a shared space no glyph", () => {
+ expect(channelGlyph("engineering", { space: true })).toBeNull();
+ });
});
diff --git a/products/desktop/packages/ui/src/features/canvas/components/channelGlyph.tsx b/products/desktop/packages/ui/src/features/canvas/components/channelGlyph.tsx
index 8e790e3548e7..f571d6606508 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/channelGlyph.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/channelGlyph.tsx
@@ -1,5 +1,4 @@
import {
- CubeIcon,
HashIcon,
type IconWeight,
LockSimpleIcon,
@@ -24,8 +23,13 @@ export function isPrivateChannel(channelName: string | undefined): boolean {
}
/**
- * A channel's leading glyph: a lock when it's private, otherwise a cube for the
- * Spaces layout or a hash for legacy Channels.
+ * A channel's leading glyph: a lock when it's private, a hash under the legacy
+ * Channels layout, and nothing at all for a space.
+ *
+ * Spaces dropped their cube because it said nothing the name didn't — a column
+ * of identical marks is noise, and the only thing worth calling out in that list
+ * is the one space that isn't shared. The hash stays where it still separates a
+ * channel from the other things in that tree.
*/
export function channelGlyph(
channelName: string | undefined,
@@ -36,11 +40,8 @@ export function channelGlyph(
space?: boolean;
},
): ReactNode {
- const Icon = isPrivateChannel(channelName)
- ? LockSimpleIcon
- : opts?.space
- ? CubeIcon
- : HashIcon;
+ if (!isPrivateChannel(channelName) && opts?.space) return null;
+ const Icon = isPrivateChannel(channelName) ? LockSimpleIcon : HashIcon;
return (
<Icon
size={opts?.size ?? 16}
diff --git a/products/desktop/packages/ui/src/features/canvas/ensurePersonalChannel.test.ts b/products/desktop/packages/ui/src/features/canvas/ensurePersonalChannel.test.ts
index 655faf65cce1..6cc4f69e0684 100644
--- a/products/desktop/packages/ui/src/features/canvas/ensurePersonalChannel.test.ts
+++ b/products/desktop/packages/ui/src/features/canvas/ensurePersonalChannel.test.ts
@@ -1,9 +1,11 @@
-import type { Channel } from "@posthog/ui/features/canvas/hooks/useChannels";
import { beforeEach, expect, it, vi } from "vitest";
-import { ensurePersonalChannel } from "./ensurePersonalChannel";
+import {
+ ensurePersonalChannel,
+ type PersonalChannel,
+} from "./ensurePersonalChannel";
-function channel(id: string, name = "me"): Channel {
- return { id, name, path: `/${name}`, type: "folder" } as Channel;
+function channel(id: string, name = "me"): PersonalChannel {
+ return { id, name };
}
// The module memoises the created folder, so each test needs a fresh copy.
@@ -25,7 +27,8 @@ it("shares one create between callers racing before it settles", async () => {
"./ensurePersonalChannel"
);
const create = vi.fn(
- () => new Promise<Channel>((r) => setTimeout(() => r(channel("1")), 5)),
+ () =>
+ new Promise<PersonalChannel>((r) => setTimeout(() => r(channel("1")), 5)),
);
const [a, b] = await Promise.all([ensure([], create), ensure([], create)]);
@@ -69,7 +72,7 @@ it("lets a later caller retry after a failed create", async () => {
"./ensurePersonalChannel"
);
const create = vi
- .fn<() => Promise<Channel>>()
+ .fn<() => Promise<PersonalChannel>>()
.mockRejectedValueOnce(new Error("offline"))
.mockResolvedValueOnce(channel("1"));
@@ -77,3 +80,15 @@ it("lets a later caller retry after a failed create", async () => {
await expect(ensure([], create)).resolves.toEqual(channel("1"));
expect(create).toHaveBeenCalledTimes(2);
});
+
+it("does not share a created folder between scopes", async () => {
+ const { ensurePersonalChannel: ensure } = await import(
+ "./ensurePersonalChannel"
+ );
+ const createFirst = vi.fn(async () => channel("1"));
+ const createSecond = vi.fn(async () => channel("2"));
+
+ await expect(ensure([], createFirst, {})).resolves.toEqual(channel("1"));
+ await expect(ensure([], createSecond, {})).resolves.toEqual(channel("2"));
+ expect(createSecond).toHaveBeenCalledOnce();
+});
diff --git a/products/desktop/packages/ui/src/features/canvas/ensurePersonalChannel.ts b/products/desktop/packages/ui/src/features/canvas/ensurePersonalChannel.ts
index 8d1fe49dc919..9dcb8cac56ae 100644
--- a/products/desktop/packages/ui/src/features/canvas/ensurePersonalChannel.ts
+++ b/products/desktop/packages/ui/src/features/canvas/ensurePersonalChannel.ts
@@ -1,19 +1,34 @@
-import type { Channel } from "@posthog/ui/features/canvas/hooks/useChannels";
+import type { PostHogAPIClient } from "@posthog/api-client/posthog-client";
import { PERSONAL_CHANNEL_NAME } from "@posthog/ui/features/canvas/hooks/useTaskChannels";
+export interface PersonalChannel {
+ id: string;
+ name: string;
+}
+
+export type PersonalChannelClient = Pick<
+ PostHogAPIClient,
+ "createDesktopFileSystemChannel" | "getDesktopFileSystemChannels"
+>;
+
// The "me" folder is provisioned on first use, and folder creation is not
// server-side idempotent by path — so two callers racing before the first
// create lands in the channels cache would each make their own "me". The entry
// points are trivially concurrent (Cmd+T's new tab, the sidebar row, its "+"
// menu), so they share one in-flight create rather than guarding separately:
// per-caller guards would still race each other.
-let inFlight: Promise<Channel> | null = null;
+interface PersonalChannelState {
+ inFlight: Promise<PersonalChannel> | null;
+ created: PersonalChannel | null;
+}
+
+const sharedScope = {};
+const stateByScope = new WeakMap<object, PersonalChannelState>();
// The in-flight promise alone isn't enough: it settles the moment the POST
// returns, but callers pass the `channels` from their last render, which hasn't
// re-rendered with the seeded cache yet. A click landing in that gap sees
// neither an existing "me" nor an in-flight create, and makes a second one.
// Remember what was created until the list catches up.
-let created: Channel | null = null;
/**
* The user's "me" folder, creating it once if it doesn't exist yet. Concurrent
@@ -21,26 +36,47 @@ let created: Channel | null = null;
* messaging.
*/
export async function ensurePersonalChannel(
- channels: readonly Channel[],
- createChannel: (name: string) => Promise<Channel>,
-): Promise<Channel> {
+ channels: readonly PersonalChannel[],
+ createChannel: (name: string) => Promise<PersonalChannel>,
+ scope: object = sharedScope,
+): Promise<PersonalChannel> {
+ const state = stateByScope.get(scope) ?? { inFlight: null, created: null };
+ stateByScope.set(scope, state);
const existing = channels.find((c) => c.name === PERSONAL_CHANNEL_NAME);
if (existing) {
// The list is authoritative once it carries the folder: drop the memo, so a
// deleted-then-recreated "me" resolves fresh rather than to a dead id.
- created = null;
+ state.created = null;
return existing;
}
- if (created) return created;
- if (!inFlight) {
- inFlight = createChannel(PERSONAL_CHANNEL_NAME)
+ if (state.created) return state.created;
+ if (!state.inFlight) {
+ state.inFlight = createChannel(PERSONAL_CHANNEL_NAME)
.then((channel) => {
- created = channel;
+ state.created = channel;
return channel;
})
.finally(() => {
- inFlight = null;
+ state.inFlight = null;
});
}
- return inFlight;
+ return state.inFlight;
+}
+
+export async function ensurePersonalChannelFromClient(
+ client: PersonalChannelClient,
+): Promise<PersonalChannel> {
+ const toPersonalChannel = ({ id, path }: { id: string; path: string }) => ({
+ id,
+ name: path.replace(/^\/+/, ""),
+ });
+ const channels = (await client.getDesktopFileSystemChannels())
+ .filter((channel) => channel.type === "folder")
+ .map(toPersonalChannel);
+ return await ensurePersonalChannel(
+ channels,
+ async (name) =>
+ toPersonalChannel(await client.createDesktopFileSystemChannel(name)),
+ client,
+ );
}
diff --git a/products/desktop/packages/ui/src/features/canvas/hooks/useChannelItems.tsx b/products/desktop/packages/ui/src/features/canvas/hooks/useChannelItems.tsx
index eb2c022a1ede..721a2f116580 100644
--- a/products/desktop/packages/ui/src/features/canvas/hooks/useChannelItems.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/hooks/useChannelItems.tsx
@@ -8,6 +8,7 @@ import { useArchiveTask } from "@posthog/ui/features/archive/useArchiveTask";
import { useOptionalAuthenticatedClient } from "@posthog/ui/features/auth/authClient";
import { useCurrentUser } from "@posthog/ui/features/auth/useCurrentUser";
import type { ChannelItemActions } from "@posthog/ui/features/canvas/components/ChannelItemRow";
+import { deleteCanvasWithUndo } from "@posthog/ui/features/canvas/deleteCanvasWithUndo";
import { useChannelFeed } from "@posthog/ui/features/canvas/hooks/useChannelFeed";
import { useChannels } from "@posthog/ui/features/canvas/hooks/useChannels";
import { useChannelTasks } from "@posthog/ui/features/canvas/hooks/useChannelTasks";
@@ -68,7 +69,8 @@ export function useChannelItems(channelId: string): {
const archivedTaskIds = useArchivedTaskIds();
const { pinnedTaskIds, togglePin } = usePinnedTasks();
const { archiveTask } = useArchiveTask({ navigateSpace: "website" });
- const { setPinned: setCanvasPinned } = useDashboardMutations();
+ const { setPinned: setCanvasPinned, invalidateDashboards } =
+ useDashboardMutations();
const client = useOptionalAuthenticatedClient();
const { data: currentUser, isLoading: viewerLoading } = useCurrentUser({
client,
@@ -143,8 +145,28 @@ export function useChannelItems(channelId: string): {
archive: (item) => {
void archiveTask({ taskId: item.id });
},
+ // Canvases only, and through the shared undo window: the row disappears at
+ // once and the host isn't told until the toast expires, so an accidental
+ // delete costs nothing.
+ remove: (item) => {
+ if (item.kind !== "canvas") return;
+ deleteCanvasWithUndo({
+ dashboardId: item.id,
+ channelId,
+ name: item.title,
+ surface: "sidebar",
+ invalidate: invalidateDashboards,
+ });
+ },
}),
- [channelId, navigate, setCanvasPinned, togglePin, archiveTask],
+ [
+ channelId,
+ navigate,
+ setCanvasPinned,
+ togglePin,
+ archiveTask,
+ invalidateDashboards,
+ ],
);
// A channel that isn't in the list will never resolve, so stop reporting
diff --git a/products/desktop/packages/ui/src/features/canvas/hooks/useChannelTaskStatus.ts b/products/desktop/packages/ui/src/features/canvas/hooks/useChannelTaskStatus.ts
new file mode 100644
index 000000000000..f92790e58244
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/canvas/hooks/useChannelTaskStatus.ts
@@ -0,0 +1,49 @@
+import type { ChannelItemModel } from "@posthog/core/canvas/channelItems";
+import { useChannelTaskData } from "@posthog/ui/features/canvas/hooks/useChannelTaskData";
+import type { TaskStatusInput } from "@posthog/ui/features/sidebar/components/items/taskStatusVocabulary";
+import { useTaskPrStatus } from "@posthog/ui/features/sidebar/useTaskPrStatus";
+import { useWorkspace } from "@posthog/ui/features/workspace/useWorkspace";
+
+/**
+ * The state behind a channel row's status dot and badges, or `null` for a canvas
+ * (which has no run to report).
+ *
+ * Assembled per row, the same way the Code sidebar's `TaskRow` does it, because
+ * that's the only place the inputs exist together: the derived flags come from
+ * renderer state (live session, workspace, viewed timestamps) and the PR state
+ * from a per-task query, so none of it can be baked into the item list in core.
+ * Keeping the composition in a hook rather than in the row leaves the row a
+ * component that renders, and gives tests one module to stub.
+ */
+export function useChannelTaskStatus(
+ item: ChannelItemModel,
+): TaskStatusInput | null {
+ const task = item.task ?? undefined;
+ const taskData = useChannelTaskData(task);
+ const workspace = useWorkspace(task?.id);
+ const { prState, hasDiff } = useTaskPrStatus({
+ id: task?.id ?? "",
+ cloudPrUrl: taskData?.cloudPrUrl ?? null,
+ taskRunEnvironment: taskData?.taskRunEnvironment ?? null,
+ });
+
+ if (!taskData) return null;
+ return {
+ workspaceMode:
+ workspace?.mode ??
+ (taskData.taskRunEnvironment === "cloud" ? "cloud" : undefined),
+ isGenerating: taskData.isGenerating,
+ isUnread: taskData.isUnread,
+ isPinned: taskData.isPinned,
+ isSuspended: taskData.isSuspended,
+ needsPermission: taskData.needsPermission,
+ taskRunStatus: taskData.taskRunStatus,
+ originProduct: taskData.originProduct,
+ slackThreadUrl: taskData.slackThreadUrl,
+ prState,
+ hasDiff,
+ // The url is the early signal: a cloud run writes it the moment it opens the
+ // PR, long before (or without ever) resolving the PR's state.
+ prUrl: taskData.cloudPrUrl,
+ };
+}
diff --git a/products/desktop/packages/ui/src/features/canvas/hooks/useFileTaskToChannel.ts b/products/desktop/packages/ui/src/features/canvas/hooks/useFileTaskToChannel.ts
new file mode 100644
index 000000000000..ed6f88d4b8ce
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/canvas/hooks/useFileTaskToChannel.ts
@@ -0,0 +1,36 @@
+import { useChannels } from "@posthog/ui/features/canvas/hooks/useChannels";
+import { useChannelTaskMutations } from "@posthog/ui/features/canvas/hooks/useChannelTasks";
+import { toast } from "@posthog/ui/primitives/toast";
+import { useCallback } from "react";
+
+/**
+ * Files a task to a space and reports the outcome, naming the space in the
+ * success toast. Extracted so the row menu and the native context menu file
+ * tasks the same way — filing is a mutation plus the two toasts that make it
+ * legible, and duplicating that is how the two paths drift.
+ */
+export function useFileTaskToChannel(): (
+ channelId: string,
+ taskId: string,
+ taskTitle: string,
+) => Promise<void> {
+ const { fileTask } = useChannelTaskMutations();
+ const { channels } = useChannels();
+
+ return useCallback(
+ async (channelId: string, taskId: string, taskTitle: string) => {
+ try {
+ await fileTask(channelId, taskId, taskTitle);
+ const channelName = channels.find(
+ (channel) => channel.id === channelId,
+ )?.name;
+ toast.success(channelName ? `Filed to ${channelName}` : "Task filed");
+ } catch (error) {
+ toast.error("Couldn't file task", {
+ description: error instanceof Error ? error.message : String(error),
+ });
+ }
+ },
+ [channels, fileTask],
+ );
+}
diff --git a/products/desktop/packages/ui/src/features/inbox/components/AgentRunDetail.tsx b/products/desktop/packages/ui/src/features/inbox/components/AgentRunDetail.tsx
index c8751d0306fc..4f32aea5e9e1 100644
--- a/products/desktop/packages/ui/src/features/inbox/components/AgentRunDetail.tsx
+++ b/products/desktop/packages/ui/src/features/inbox/components/AgentRunDetail.tsx
@@ -110,7 +110,7 @@ function RunOutputWidget({ report }: { report: SignalReport }) {
</Text>
<Text className="text-[12px] text-gray-11 leading-snug">
Research couldn't complete – check the task log below for the error.
- The Responder may retry automatically.
+ The agent may retry automatically.
</Text>
</Flex>
</Flex>
@@ -123,7 +123,7 @@ function RunOutputWidget({ report }: { report: SignalReport }) {
content={report.summary}
fallback={
report.status === "in_progress"
- ? "The Responder is investigating – partial findings will appear here as they land."
+ ? "The agent is investigating – partial signals will appear here as they land."
: "Queued for research."
}
variant="detail"
@@ -325,7 +325,7 @@ function AgentRunDetailContent({ report }: { report: SignalReport }) {
<>
<InboxMetaSeparator />
<InboxMetaText className="tabular-nums">
- {signals.length} finding{signals.length === 1 ? "" : "s"}
+ {signals.length} signal{signals.length === 1 ? "" : "s"}
</InboxMetaText>
</>
)}
@@ -412,7 +412,7 @@ function AgentRunDetailContent({ report }: { report: SignalReport }) {
title="Evidence so far"
rightSlot={
<Text className="cursor-default select-none text-[11px] text-gray-10 tabular-nums">
- {signals.length || report.signal_count} finding
+ {signals.length || report.signal_count} signal
{(signals.length || report.signal_count) === 1 ? "" : "s"}
</Text>
}
diff --git a/products/desktop/packages/ui/src/features/inbox/components/ConfigureAgentsSection.tsx b/products/desktop/packages/ui/src/features/inbox/components/ConfigureAgentsSection.tsx
index 5dc82aab4d0e..32af3af5d91b 100644
--- a/products/desktop/packages/ui/src/features/inbox/components/ConfigureAgentsSection.tsx
+++ b/products/desktop/packages/ui/src/features/inbox/components/ConfigureAgentsSection.tsx
@@ -124,7 +124,7 @@ export function ConfigureAgentsSection() {
<Subsection
title="Connections"
- description="Foundational integrations responders read from and write to."
+ description="Foundational integrations agents read from and write to."
>
<GitHubIntegrationSection
hasGithubIntegration={hasGithubIntegration}
@@ -138,7 +138,7 @@ export function ConfigureAgentsSection() {
description={
<>
Scheduled agents that sweep this project on a cadence and emit
- findings to your inbox.{" "}
+ signals to your inbox.{" "}
{/* Placeholder docs link until a dedicated scouts page exists. */}
<a
href="https://posthog.com/blog/self-driving-product"
@@ -155,8 +155,8 @@ export function ConfigureAgentsSection() {
</Subsection>
<Subsection
- title="Responders"
- description="Each source: 1. watches for signals, 2. spins up a Responder when something matters, 3. hands you solutions."
+ title="Signal sources"
+ description="Each source watches for signals and spins up work when something matters."
>
{isLoading ? (
<ResponderAgentRosterSkeleton />
@@ -207,7 +207,7 @@ export function ConfigureAgentsSection() {
<Subsection
title="MCP servers"
- description="External tools responders can read from. PostHog data is always available; this is everything else."
+ description="External tools agents can read from. PostHog data is always available; this is everything else."
>
<Link
to="/settings/$category"
diff --git a/products/desktop/packages/ui/src/features/inbox/components/DataSourceSetup.tsx b/products/desktop/packages/ui/src/features/inbox/components/DataSourceSetup.tsx
index 0107db0b38c1..f559a9db6f56 100644
--- a/products/desktop/packages/ui/src/features/inbox/components/DataSourceSetup.tsx
+++ b/products/desktop/packages/ui/src/features/inbox/components/DataSourceSetup.tsx
@@ -183,7 +183,7 @@ function GitHubSetup({ onComplete, onCancel }: SetupFormProps) {
? "We didn't hear back from GitHub. If the browser tab was closed, click Try again."
: connecting
? "Waiting for GitHub… finish authorizing in your browser, then return here."
- : "Connect your GitHub account to import issues as Self-driving findings.";
+ : "Connect your GitHub account to import issues as Self-driving signals.";
return (
<SetupFormContainer title="Connect GitHub">
<Flex direction="column" gap="3">
diff --git a/products/desktop/packages/ui/src/features/inbox/components/InboxDetailFrame.tsx b/products/desktop/packages/ui/src/features/inbox/components/InboxDetailFrame.tsx
index bcaacd6c003d..e122dcd0ae8c 100644
--- a/products/desktop/packages/ui/src/features/inbox/components/InboxDetailFrame.tsx
+++ b/products/desktop/packages/ui/src/features/inbox/components/InboxDetailFrame.tsx
@@ -137,7 +137,7 @@ export function InboxDetailFrame({
{evidenceCount > 0 && (
<>
<InboxMetaText className="tabular-nums">
- {evidenceCount} finding{evidenceCount === 1 ? "" : "s"}
+ {evidenceCount} signal{evidenceCount === 1 ? "" : "s"}
</InboxMetaText>
<InboxMetaSeparator />
</>
@@ -151,7 +151,7 @@ export function InboxDetailFrame({
<InboxMetaSeparator />
<InboxMetaSourceStack
sourceProducts={report.source_products}
- labelPrefix="Responder · "
+ labelPrefix="Agent · "
/>
</>
)}
@@ -181,7 +181,7 @@ export function InboxDetailFrame({
<DetailSection Icon={SummaryIcon} title={summarySection.title}>
<SignalReportSummaryMarkdown
content={report.summary}
- fallback="No summary yet – the Responder is still investigating."
+ fallback="No summary yet – the agent is still investigating."
variant="detail"
pending={report.status === "in_progress"}
/>
@@ -196,7 +196,7 @@ export function InboxDetailFrame({
title={evidenceSection.title}
rightSlot={
<Text className="cursor-default select-none text-[11px] text-gray-10 tabular-nums">
- {evidenceCount} finding
+ {evidenceCount} signal
{evidenceCount === 1 ? "" : "s"}
</Text>
}
diff --git a/products/desktop/packages/ui/src/features/inbox/components/PullRequestsTab.tsx b/products/desktop/packages/ui/src/features/inbox/components/PullRequestsTab.tsx
index e29d53bdc934..1d33402ca507 100644
--- a/products/desktop/packages/ui/src/features/inbox/components/PullRequestsTab.tsx
+++ b/products/desktop/packages/ui/src/features/inbox/components/PullRequestsTab.tsx
@@ -24,7 +24,7 @@ export function PullRequestsTab() {
entireProjectTitle: "No pull requests in the project right now",
teammateTitle: "No pull requests for this reviewer right now",
description:
- "When a Responder ships a code change, the PR draft lands here for you to review and publish.",
+ "When an agent ships a code change, the PR draft lands here for you to review and publish.",
}}
/>
);
diff --git a/products/desktop/packages/ui/src/features/inbox/components/ReportCard.tsx b/products/desktop/packages/ui/src/features/inbox/components/ReportCard.tsx
index a58955c4afea..3cdfbbe2d93b 100644
--- a/products/desktop/packages/ui/src/features/inbox/components/ReportCard.tsx
+++ b/products/desktop/packages/ui/src/features/inbox/components/ReportCard.tsx
@@ -323,7 +323,7 @@ export function ReportCard(props: ReportCardProps) {
>
<LightningIcon size={11} />
<span className="tabular-nums">
- {report.signal_count} finding
+ {report.signal_count} signal
{report.signal_count !== 1 ? "s" : ""}
</span>
</Flex>
diff --git a/products/desktop/packages/ui/src/features/inbox/components/ReportsTab.tsx b/products/desktop/packages/ui/src/features/inbox/components/ReportsTab.tsx
index 1b531a0172e1..c33746e8a32f 100644
--- a/products/desktop/packages/ui/src/features/inbox/components/ReportsTab.tsx
+++ b/products/desktop/packages/ui/src/features/inbox/components/ReportsTab.tsx
@@ -15,7 +15,7 @@ export function ReportsTab() {
entireProjectTitle: "No reports in the project yet",
teammateTitle: "No reports for this reviewer yet",
description:
- "Reports are what Responders surface when there's something worth your judgment but no clean code change to draft.",
+ "Reports are what agents surface when there's something worth your judgment but no clean code change to draft.",
}}
/>
);
diff --git a/products/desktop/packages/ui/src/features/inbox/components/RunsTab.tsx b/products/desktop/packages/ui/src/features/inbox/components/RunsTab.tsx
index af45dab0d940..8e4b41279f2e 100644
--- a/products/desktop/packages/ui/src/features/inbox/components/RunsTab.tsx
+++ b/products/desktop/packages/ui/src/features/inbox/components/RunsTab.tsx
@@ -95,10 +95,10 @@ export function RunsTab() {
</EmptyMedia>
<EmptyTitle>
{scope === INBOX_SCOPE_FOR_YOU
- ? "No Responders are working on something for you right now"
+ ? "No agents are working on something for you right now"
: scope === INBOX_SCOPE_ENTIRE_PROJECT
- ? "No Responders are working on anything in the project right now"
- : "No Responders are working on something for this reviewer right now"}
+ ? "No agents are working on anything in the project right now"
+ : "No agents are working on something for this reviewer right now"}
</EmptyTitle>
<EmptyDescription>
When Self-driving kicks one off, you'll see the live run land here
diff --git a/products/desktop/packages/ui/src/features/inbox/components/utils/ExplainedDismissOptionLabels.tsx b/products/desktop/packages/ui/src/features/inbox/components/utils/ExplainedDismissOptionLabels.tsx
index 5da50a8adfbb..203a3a53822b 100644
--- a/products/desktop/packages/ui/src/features/inbox/components/utils/ExplainedDismissOptionLabels.tsx
+++ b/products/desktop/packages/ui/src/features/inbox/components/utils/ExplainedDismissOptionLabels.tsx
@@ -4,10 +4,10 @@ import { RadioGroup, Tooltip } from "@radix-ui/themes";
import type { ReactNode } from "react";
const PAUSE_OPTION_TOOLTIP =
- "Snoozes this report: it briefly leaves your inbox while more context is gathered, and it can come back if new findings match.";
+ "Snoozes this report: it briefly leaves your inbox while more context is gathered, and it can come back if new signals match.";
const SUPPRESS_OPTION_TOOLTIP =
- "Archives permanently: the report leaves your inbox and matching findings will not surface it again. Your reason is saved with the report.";
+ "Archives permanently: the report leaves your inbox and matching signals will not surface it again. Your reason is saved with the report.";
function dismissReasonOptionDomId(value: DismissalReasonOptionValue): string {
return `dismiss-report-dialog-reason-${value}`;
diff --git a/products/desktop/packages/ui/src/features/inbox/components/utils/SignalReportStatusBadge.tsx b/products/desktop/packages/ui/src/features/inbox/components/utils/SignalReportStatusBadge.tsx
index 0acdd3e73bdf..9f72d0680e74 100644
--- a/products/desktop/packages/ui/src/features/inbox/components/utils/SignalReportStatusBadge.tsx
+++ b/products/desktop/packages/ui/src/features/inbox/components/utils/SignalReportStatusBadge.tsx
@@ -8,10 +8,10 @@ const STATUS_TOOLTIPS: Record<string, string> = {
resolved: "This report is resolved — its implementation pull request merged.",
pending_input:
"This report needs human input in PostHog before it can proceed.",
- in_progress: "An AI agent is actively researching this report's findings.",
+ in_progress: "An AI agent is actively researching this report's signals.",
candidate: "Queued for research. An agent will pick this up shortly.",
potential:
- "Gathering findings. The report will be queued once enough evidence accumulates.",
+ "Gathering signals. The report will be queued once enough evidence accumulates.",
failed: "Research failed. The report may be retried automatically.",
suppressed: "This report has been suppressed and is out of your inbox.",
deleted: "This report has been deleted.",
diff --git a/products/desktop/packages/ui/src/features/loops/components/LoopsListView.tsx b/products/desktop/packages/ui/src/features/loops/components/LoopsListView.tsx
index a265fb6d51eb..e9f4be9a66e8 100644
--- a/products/desktop/packages/ui/src/features/loops/components/LoopsListView.tsx
+++ b/products/desktop/packages/ui/src/features/loops/components/LoopsListView.tsx
@@ -26,7 +26,7 @@ import {
} from "@posthog/ui/router/navigationBridge";
import { track } from "@posthog/ui/shell/analytics";
import { Flex, Text } from "@radix-ui/themes";
-import { useEffect, useRef, useState } from "react";
+import { type ReactNode, useEffect, useRef, useState } from "react";
import { useLoopBuilderSessions } from "../hooks/useLoopBuilderSessions";
import { useLoopLimits, useLoops } from "../hooks/useLoops";
import {
@@ -72,7 +72,11 @@ function startLoopFromTemplate(template: LoopTemplate): void {
navigateToNewLoop();
}
-export function LoopsListView() {
+export function LoopsListView({
+ headerContent = null,
+}: {
+ headerContent?: ReactNode;
+}) {
const { data: loops, isLoading, isError, error } = useLoops();
const authenticatedClient = useOptionalAuthenticatedClient();
const {
@@ -91,9 +95,10 @@ export function LoopsListView() {
listError = currentUserQueryError;
}
- // The page names itself (in-page header / title block), so it pushes no
- // breadcrumb row — only a space-attached loop scene has a parent to show.
- useSetHeaderContent(null);
+ // The standalone page names itself in-page and has no breadcrumb. When the
+ // registry is hosted inside a space, its caller supplies that navigation
+ // context instead.
+ useSetHeaderContent(headerContent);
const { sessions: builderSessions, isSettled: builderSessionsSettled } =
useLoopBuilderSessions();
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/components/McpGatewayView.tsx b/products/desktop/packages/ui/src/features/mcp-gateway/components/McpGatewayView.tsx
new file mode 100644
index 000000000000..5403d1b4ca5d
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/components/McpGatewayView.tsx
@@ -0,0 +1,139 @@
+import { GatewayAddServer } from "@posthog/ui/features/mcp-gateway/components/parts/GatewayAddServer";
+import { GatewayAgentDetail } from "@posthog/ui/features/mcp-gateway/components/parts/GatewayAgentDetail";
+import { GatewayAuditLog } from "@posthog/ui/features/mcp-gateway/components/parts/GatewayAuditLog";
+import { GatewayMemberDetail } from "@posthog/ui/features/mcp-gateway/components/parts/GatewayMemberDetail";
+import { GatewayRail } from "@posthog/ui/features/mcp-gateway/components/parts/GatewayRail";
+import { GatewayServerDetail } from "@posthog/ui/features/mcp-gateway/components/parts/GatewayServerDetail";
+import { GatewayServersHome } from "@posthog/ui/features/mcp-gateway/components/parts/GatewayServersHome";
+import { GatewayTeamSettings } from "@posthog/ui/features/mcp-gateway/components/parts/GatewayTeamSettings";
+import { GatewayTeamView } from "@posthog/ui/features/mcp-gateway/components/parts/GatewayTeamView";
+import {
+ type GatewayRoute,
+ isRouteAllowed,
+} from "@posthog/ui/features/mcp-gateway/gatewayRoute";
+import { useGatewayConfig } from "@posthog/ui/features/mcp-gateway/hooks/useGatewayConfig";
+import { useGatewayServers } from "@posthog/ui/features/mcp-gateway/hooks/useGatewayServers";
+import { useServiceAccounts } from "@posthog/ui/features/mcp-gateway/hooks/useServiceAccounts";
+import { DotPatternBackground } from "@posthog/ui/primitives/DotPatternBackground";
+import { Box, Flex, ScrollArea } from "@radix-ui/themes";
+import { useQueryClient } from "@tanstack/react-query";
+import { useEffect, useState } from "react";
+
+/**
+ * Team MCP gateway: one control plane for the servers a team runs, who can
+ * reach them (members and agent service accounts), per-tool policies per
+ * scope, and the audit log. Renders behind the `mcp-gateway` flag in place of
+ * the per-user marketplace.
+ */
+export function McpGatewayView() {
+ const queryClient = useQueryClient();
+ const [requestedRoute, setRoute] = useState<GatewayRoute>({
+ view: "servers",
+ });
+
+ const { isAdmin, allowCustomServers, canManageAgentAccess, configLoading } =
+ useGatewayConfig();
+ const canAddServers = isAdmin || allowCustomServers;
+ const gateway = useGatewayServers();
+ const serviceAccounts = useServiceAccounts();
+
+ // Refresh gateway state when the window regains focus — connections and
+ // policies can change from the web app or another teammate meanwhile.
+ useEffect(() => {
+ const refresh = () => {
+ queryClient.invalidateQueries({ queryKey: ["mcp"] });
+ };
+ const onVisibility = () => {
+ if (document.visibilityState === "visible") refresh();
+ };
+ window.addEventListener("focus", refresh);
+ document.addEventListener("visibilitychange", onVisibility);
+ return () => {
+ window.removeEventListener("focus", refresh);
+ document.removeEventListener("visibilitychange", onVisibility);
+ };
+ }, [queryClient]);
+
+ // Role guard, applied at render: if the config resolves to a narrower role
+ // than the stored route needs, show the servers home instead.
+ const route: GatewayRoute =
+ configLoading || isRouteAllowed(requestedRoute, { isAdmin, canAddServers })
+ ? requestedRoute
+ : { view: "servers" };
+
+ const mainContent = (() => {
+ switch (route.view) {
+ case "add":
+ return (
+ <GatewayAddServer
+ isAdmin={isAdmin}
+ canManageAgentAccess={canManageAgentAccess}
+ accounts={serviceAccounts.accounts}
+ onNavigate={setRoute}
+ />
+ );
+ case "server":
+ return (
+ <GatewayServerDetail
+ key={route.serverId}
+ serverId={route.serverId}
+ initialScope={route.scope}
+ isAdmin={isAdmin}
+ canManageAgentAccess={canManageAgentAccess}
+ onNavigate={setRoute}
+ />
+ );
+ case "team":
+ return <GatewayTeamView onNavigate={setRoute} />;
+ case "agent":
+ return (
+ <GatewayAgentDetail
+ key={route.accountId}
+ accountId={route.accountId}
+ onNavigate={setRoute}
+ />
+ );
+ case "member":
+ return (
+ <GatewayMemberDetail
+ key={route.userId}
+ userId={route.userId}
+ onNavigate={setRoute}
+ />
+ );
+ case "settings":
+ return <GatewayTeamSettings onNavigate={setRoute} />;
+ case "audit":
+ return <GatewayAuditLog />;
+ default:
+ return (
+ <GatewayServersHome
+ isAdmin={isAdmin}
+ canAddServers={canAddServers}
+ onNavigate={setRoute}
+ />
+ );
+ }
+ })();
+
+ return (
+ <Flex height="100%" className="min-h-0 overflow-hidden">
+ <GatewayRail
+ servers={gateway.servers}
+ templatesById={gateway.templatesById}
+ isAdmin={isAdmin}
+ canAddServers={canAddServers}
+ route={route}
+ onNavigate={setRoute}
+ />
+ <Box className="relative min-h-0 min-w-0 flex-1">
+ <DotPatternBackground />
+ <ScrollArea className="h-full w-full">
+ <Box p="6" mx="auto" className="relative z-[1] max-w-[960px]">
+ {mainContent}
+ </Box>
+ </ScrollArea>
+ </Box>
+ </Flex>
+ );
+}
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayAddServer.test.tsx b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayAddServer.test.tsx
new file mode 100644
index 000000000000..4249382e9de8
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayAddServer.test.tsx
@@ -0,0 +1,52 @@
+import type { McpServiceAccount } from "@posthog/api-client/posthog-client";
+import { Theme } from "@radix-ui/themes";
+import { render, screen } from "@testing-library/react";
+import { describe, expect, it, vi } from "vitest";
+
+vi.mock(
+ "@posthog/ui/features/mcp-gateway/hooks/useRegisterGatewayServer",
+ () => ({
+ useRegisterGatewayServer: () => ({
+ register: vi.fn(),
+ registerPending: false,
+ }),
+ }),
+);
+
+import { GatewayAddServer } from "./GatewayAddServer";
+
+const account = {
+ id: "agent-1",
+ name: "Support agent",
+ description: "",
+ handle: "support-agent",
+ status: "active",
+ token_mask: "",
+ server_ids: [],
+ last_active_at: null,
+ created_at: "2026-07-23T12:00:00Z",
+ updated_at: "2026-07-23T12:00:00Z",
+} as McpServiceAccount;
+
+describe("GatewayAddServer", () => {
+ it("keeps team and agent sharing without offering shared credentials", () => {
+ render(
+ <Theme>
+ <GatewayAddServer
+ isAdmin
+ canManageAgentAccess
+ accounts={[account]}
+ onNavigate={vi.fn()}
+ />
+ </Theme>,
+ );
+
+ expect(screen.getByText("Enable for the whole team")).toBeInTheDocument();
+ expect(screen.getByText("Share with agents")).toBeInTheDocument();
+ expect(screen.getByText(account.name)).toBeInTheDocument();
+ expect(screen.queryByText("One shared credential")).not.toBeInTheDocument();
+ expect(
+ screen.queryByText("Allow personal connections"),
+ ).not.toBeInTheDocument();
+ });
+});
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayAddServer.tsx b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayAddServer.tsx
new file mode 100644
index 000000000000..fd3303195afc
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayAddServer.tsx
@@ -0,0 +1,395 @@
+import { ArrowLeft, CaretRight, Check } from "@phosphor-icons/react";
+import type { McpServiceAccount } from "@posthog/api-client/posthog-client";
+import {
+ buildGatewayInstallRequest,
+ canSubmitGatewayServer,
+ GATEWAY_ADD_SERVER_DEFAULTS,
+ type GatewayAddServerValues,
+} from "@posthog/core/mcp-gateway/gatewayAddServer";
+import { isValidMcpUrl } from "@posthog/core/mcp-servers/customServerForm";
+import { RobotAvatar } from "@posthog/ui/features/mcp-gateway/components/parts/avatars";
+import type { GatewayRoute } from "@posthog/ui/features/mcp-gateway/gatewayRoute";
+import { useRegisterGatewayServer } from "@posthog/ui/features/mcp-gateway/hooks/useRegisterGatewayServer";
+import {
+ Button,
+ Flex,
+ Heading,
+ Select,
+ Spinner,
+ Switch,
+ Text,
+ TextArea,
+ TextField,
+} from "@radix-ui/themes";
+import { type FormEvent, useState } from "react";
+
+interface GatewayAddServerProps {
+ isAdmin: boolean;
+ canManageAgentAccess: boolean;
+ accounts: McpServiceAccount[];
+ onNavigate: (route: GatewayRoute) => void;
+}
+
+/** Register a custom MCP server with the gateway. */
+export function GatewayAddServer({
+ isAdmin,
+ canManageAgentAccess,
+ accounts,
+ onNavigate,
+}: GatewayAddServerProps) {
+ const [values, setValues] = useState<GatewayAddServerValues>(
+ GATEWAY_ADD_SERVER_DEFAULTS,
+ );
+ const [showKey, setShowKey] = useState(false);
+ const [optionalOpen, setOptionalOpen] = useState(false);
+
+ const { register, registerPending } = useRegisterGatewayServer();
+
+ const set = <K extends keyof GatewayAddServerValues>(
+ key: K,
+ value: GatewayAddServerValues[K],
+ ) => setValues((previous) => ({ ...previous, [key]: value }));
+
+ const urlInvalid = values.url.trim() !== "" && !isValidMcpUrl(values.url);
+ const canSave = canSubmitGatewayServer(values);
+
+ const submit = (event: FormEvent<HTMLFormElement>) => {
+ event.preventDefault();
+ if (!canSave || registerPending) return;
+ const request = buildGatewayInstallRequest(values, {
+ isAdmin,
+ canManageAgentAccess,
+ });
+ register(
+ { request },
+ {
+ onSuccess: (result) => {
+ if (result.created) {
+ onNavigate({ view: "server", serverId: result.created.id });
+ }
+ },
+ },
+ );
+ };
+
+ return (
+ <form onSubmit={submit} className="min-w-0 max-w-[640px]">
+ <Flex direction="column" gap="4">
+ <Flex align="center" gap="2">
+ <Button
+ type="button"
+ variant="ghost"
+ color="gray"
+ size="1"
+ onClick={() => onNavigate({ view: "servers" })}
+ >
+ <ArrowLeft size={12} />
+ Back to servers
+ </Button>
+ </Flex>
+
+ <Flex direction="column" gap="1">
+ <Heading className="font-bold text-xl">Add a custom server</Heading>
+ <Text color="gray" className="text-sm">
+ Register an MCP server with the gateway. Every call routes through
+ the gateway, so tool policies, approvals and the audit log apply
+ from the first request.
+ </Text>
+ </Flex>
+
+ <SectionHeader label="Server" />
+ <Flex direction="column" gap="3">
+ <Field label="Name">
+ <TextField.Root
+ value={values.name}
+ onChange={(e) => set("name", e.target.value)}
+ placeholder="e.g. Internal Wiki"
+ autoFocus
+ />
+ </Field>
+ <Field label="Server URL">
+ <TextField.Root
+ value={values.url}
+ onChange={(e) => set("url", e.target.value)}
+ placeholder="https://mcp.example.com/sse"
+ spellCheck={false}
+ className="font-mono"
+ />
+ {urlInvalid && (
+ <Text color="red" className="text-xs">
+ Enter a full URL, like https://mcp.example.com
+ </Text>
+ )}
+ </Field>
+ <Field
+ label="Description"
+ hint="Shown on the server card so members and agents know what it's for."
+ >
+ <TextArea
+ value={values.description}
+ onChange={(e) => set("description", e.target.value)}
+ placeholder="What this server does and when teammates should reach for it"
+ />
+ </Field>
+ </Flex>
+
+ <SectionHeader label="Authentication" />
+ <Flex direction="column" gap="3">
+ <Field
+ label="Type"
+ hint={
+ values.authType === "oauth"
+ ? "Each caller signs in with the provider. The gateway stores and refreshes their tokens."
+ : "Connect with an API key. The key is encrypted at rest and never exposed."
+ }
+ >
+ <Select.Root
+ value={values.authType}
+ onValueChange={(value) =>
+ set("authType", value as GatewayAddServerValues["authType"])
+ }
+ >
+ <Select.Trigger />
+ <Select.Content>
+ <Select.Item value="oauth">
+ OAuth — each caller signs in
+ </Select.Item>
+ <Select.Item value="api_key">API key</Select.Item>
+ </Select.Content>
+ </Select.Root>
+ </Field>
+
+ {values.authType === "api_key" && (
+ <Field
+ label="API key"
+ hint="Encrypted at rest and never logged or exposed."
+ >
+ <TextField.Root
+ value={values.apiKey}
+ onChange={(e) => set("apiKey", e.target.value)}
+ type={showKey ? "text" : "password"}
+ placeholder="sk-…"
+ spellCheck={false}
+ className="font-mono"
+ >
+ <TextField.Slot side="right">
+ <Button
+ type="button"
+ variant="ghost"
+ color="gray"
+ size="1"
+ onClick={() => setShowKey((value) => !value)}
+ >
+ {showKey ? "Hide" : "Show"}
+ </Button>
+ </TextField.Slot>
+ </TextField.Root>
+ </Field>
+ )}
+
+ {values.authType === "oauth" && (
+ <div className="rounded-md border border-gray-5 bg-gray-2">
+ <button
+ type="button"
+ onClick={() => setOptionalOpen((value) => !value)}
+ className="flex w-full items-center gap-2 px-3 py-2 text-left"
+ >
+ <CaretRight
+ size={10}
+ weight="bold"
+ className={`shrink-0 text-gray-10 transition-transform ${optionalOpen ? "rotate-90" : ""}`}
+ />
+ <Text className="font-medium text-sm">Optional</Text>
+ <Text color="gray" className="text-xs">
+ Client ID &amp; secret — only if the provider doesn't support
+ dynamic client registration
+ </Text>
+ </button>
+ {optionalOpen && (
+ <Flex gap="3" className="px-3 pb-3">
+ <Field label="Client ID" className="flex-1">
+ <TextField.Root
+ value={values.clientId}
+ onChange={(e) => set("clientId", e.target.value)}
+ placeholder="mcp-gateway-client"
+ spellCheck={false}
+ className="font-mono"
+ />
+ </Field>
+ <Field label="Client secret" className="flex-1">
+ <TextField.Root
+ value={values.clientSecret}
+ onChange={(e) => set("clientSecret", e.target.value)}
+ type="password"
+ placeholder="••••••••••••"
+ className="font-mono"
+ />
+ </Field>
+ </Flex>
+ )}
+ </div>
+ )}
+ </Flex>
+
+ {(isAdmin || canManageAgentAccess) && (
+ <>
+ <SectionHeader label="Sharing" />
+ <Text color="gray" className="text-[13px]">
+ Once the server authenticates, you'll be able to configure tool
+ approvals for each agent.
+ </Text>
+ <Flex direction="column" gap="3">
+ {isAdmin && (
+ <ToggleRow
+ title="Enable for the whole team"
+ sub={
+ values.teamEnabled
+ ? "Every member will see this server once it's added."
+ : "Only admins will see it until you enable it in Team settings."
+ }
+ checked={values.teamEnabled}
+ onChange={(checked) => set("teamEnabled", checked)}
+ />
+ )}
+
+ {canManageAgentAccess && (
+ <Flex direction="column" gap="2">
+ <Text className="font-medium text-base">
+ Share with agents
+ </Text>
+ <div className="overflow-hidden rounded border border-gray-5 bg-gray-2">
+ {accounts.map((account) => {
+ const on = values.agentIds.includes(account.id);
+ return (
+ <Flex
+ key={account.id}
+ align="center"
+ gap="3"
+ className="border-gray-5 border-b px-3 py-2 last:border-b-0"
+ >
+ <RobotAvatar />
+ <Flex direction="column" className="min-w-0 flex-1">
+ <Text truncate className="font-medium text-sm">
+ {account.name}
+ </Text>
+ <Text
+ color="gray"
+ truncate
+ className="font-mono text-xs"
+ >
+ {account.handle}
+ </Text>
+ </Flex>
+ <Switch
+ size="1"
+ checked={on}
+ onCheckedChange={(checked) =>
+ set(
+ "agentIds",
+ checked
+ ? [...values.agentIds, account.id]
+ : values.agentIds.filter(
+ (id) => id !== account.id,
+ ),
+ )
+ }
+ />
+ </Flex>
+ );
+ })}
+ {accounts.length === 0 && (
+ <Text
+ color="gray"
+ className="block px-3 py-3 text-[13px] italic"
+ >
+ No agents yet — create one under Team &amp; agents.
+ </Text>
+ )}
+ </div>
+ </Flex>
+ )}
+ </Flex>
+ </>
+ )}
+
+ <Flex justify="end" gap="3" className="border-gray-5 border-t pt-4">
+ <Button
+ type="button"
+ variant="soft"
+ color="gray"
+ onClick={() => onNavigate({ view: "servers" })}
+ >
+ Cancel
+ </Button>
+ <Button type="submit" disabled={!canSave || registerPending}>
+ {registerPending ? (
+ <Spinner size="1" />
+ ) : (
+ <Check size={12} weight="bold" />
+ )}{" "}
+ Add server
+ </Button>
+ </Flex>
+ </Flex>
+ </form>
+ );
+}
+
+function SectionHeader({ label }: { label: string }) {
+ return <Text className="mt-2 font-medium text-base">{label}</Text>;
+}
+
+function Field({
+ label,
+ hint,
+ className,
+ children,
+}: {
+ label: string;
+ hint?: string;
+ className?: string;
+ children: React.ReactNode;
+}) {
+ return (
+ <Flex direction="column" gap="1" className={className}>
+ <Text className="font-medium text-sm">{label}</Text>
+ {hint && (
+ <Text color="gray" className="text-[13px]">
+ {hint}
+ </Text>
+ )}
+ {children}
+ </Flex>
+ );
+}
+
+function ToggleRow({
+ title,
+ sub,
+ checked,
+ onChange,
+}: {
+ title: string;
+ sub: string;
+ checked: boolean;
+ onChange: (checked: boolean) => void;
+}) {
+ return (
+ <Flex
+ align="center"
+ justify="between"
+ gap="3"
+ className="rounded-md border border-gray-5 bg-gray-2 p-3"
+ >
+ <div>
+ <Text as="div" className="font-medium text-sm">
+ {title}
+ </Text>
+ <Text as="div" color="gray" className="text-[13px]">
+ {sub}
+ </Text>
+ </div>
+ <Switch checked={checked} onCheckedChange={onChange} />
+ </Flex>
+ );
+}
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayAgentDetail.tsx b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayAgentDetail.tsx
new file mode 100644
index 000000000000..d108d3a1b600
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayAgentDetail.tsx
@@ -0,0 +1,382 @@
+import { ArrowLeft, Clock, Sliders } from "@phosphor-icons/react";
+import type {
+ McpAuditEvent,
+ McpGatewayServer,
+} from "@posthog/api-client/posthog-client";
+import {
+ AUDIT_DECISION_LABELS,
+ formatAgo,
+ formatAuditTime,
+} from "@posthog/core/mcp-gateway/gatewayServers";
+import { RobotAvatar } from "@posthog/ui/features/mcp-gateway/components/parts/avatars";
+import type { GatewayRoute } from "@posthog/ui/features/mcp-gateway/gatewayRoute";
+import { useAgentRecentCalls } from "@posthog/ui/features/mcp-gateway/hooks/useGatewayAudit";
+import { useGatewayServers } from "@posthog/ui/features/mcp-gateway/hooks/useGatewayServers";
+import { useServiceAccounts } from "@posthog/ui/features/mcp-gateway/hooks/useServiceAccounts";
+import { ServerIcon } from "@posthog/ui/features/mcp-servers/components/parts/icons";
+import {
+ Badge,
+ Button,
+ Flex,
+ Separator,
+ Spinner,
+ Switch,
+ Text,
+} from "@radix-ui/themes";
+import { useState } from "react";
+
+const DECISION_COLORS: Record<
+ McpAuditEvent["decision"],
+ "green" | "indigo" | "amber" | "red"
+> = {
+ auto: "green",
+ approved: "indigo",
+ pending: "amber",
+ blocked: "red",
+};
+
+/** Admin view of one agent service account: identity, servers, call history. */
+export function GatewayAgentDetail({
+ accountId,
+ onNavigate,
+}: {
+ accountId: string;
+ onNavigate: (route: GatewayRoute) => void;
+}) {
+ const serviceAccounts = useServiceAccounts();
+ const { servers, templatesById } = useGatewayServers();
+ const { events, eventsLoading } = useAgentRecentCalls(accountId);
+ const [shownCalls, setShownCalls] = useState(5);
+
+ const account = serviceAccounts.accounts.find(
+ (entry) => entry.id === accountId,
+ );
+
+ if (!account) {
+ return (
+ <Flex direction="column" gap="4">
+ <BackButton onNavigate={onNavigate} />
+ <Flex align="center" justify="center" py="6">
+ {serviceAccounts.accountsLoading ? (
+ <Spinner size="2" />
+ ) : (
+ <Text color="gray" className="text-sm">
+ Agent not found.
+ </Text>
+ )}
+ </Flex>
+ </Flex>
+ );
+ }
+
+ const active = account.status === "active";
+ const lastCall = formatAgo(account.last_active_at);
+ const created = new Date(account.created_at).toLocaleDateString(undefined, {
+ month: "long",
+ year: "numeric",
+ });
+ // Shared servers float to the top so the agent's actual reach reads first.
+ const sharedServers = servers.filter((server) =>
+ account.server_ids.includes(server.id),
+ );
+ const otherServers = servers.filter(
+ (server) => !account.server_ids.includes(server.id),
+ );
+
+ return (
+ <Flex direction="column" gap="4" className="min-w-0">
+ <BackButton onNavigate={onNavigate} />
+
+ <Flex align="start" gap="3">
+ <RobotAvatar size="lg" />
+ <Flex direction="column" gap="1" className="min-w-0 flex-1">
+ <Flex align="center" gap="2">
+ <Text truncate className="font-bold text-xl">
+ {account.name}
+ </Text>
+ {active ? (
+ <Badge color="green" variant="soft" size="1">
+ Active
+ </Badge>
+ ) : (
+ <Badge color="amber" variant="soft" size="1">
+ Paused
+ </Badge>
+ )}
+ </Flex>
+ {account.description && (
+ <Text color="gray" className="text-sm">
+ {account.description}
+ </Text>
+ )}
+ <Text color="gray" className="flex items-center gap-1 text-xs">
+ <Clock size={12} />
+ {lastCall ? `last call ${lastCall}` : "no calls yet"}
+ </Text>
+ </Flex>
+ <Button
+ variant="ghost"
+ color="gray"
+ size="2"
+ onClick={() =>
+ serviceAccounts.setStatus({
+ accountId: account.id,
+ name: account.name,
+ status: active ? "paused" : "active",
+ })
+ }
+ >
+ {active ? "Pause agent" : "Resume agent"}
+ </Button>
+ </Flex>
+ <Separator size="4" />
+
+ <Text className="font-medium text-base">Identity</Text>
+ <div className="overflow-hidden rounded border border-gray-5">
+ <KvRow label="Authenticates as">
+ <Text className="font-mono text-[13px]">{account.handle}</Text>
+ </KvRow>
+ <KvRow label="Created">
+ <Text className="text-[13px]">{created}</Text>
+ </KvRow>
+ </div>
+
+ <Flex align="center" gap="2">
+ <Text className="font-medium text-base">Shared servers</Text>
+ <Badge color="gray" variant="soft" size="1">
+ {account.server_ids.length} of {servers.length}
+ </Badge>
+ </Flex>
+ <div className="overflow-hidden rounded border border-gray-5">
+ {sharedServers.map((server) => (
+ <ServerAccessRow
+ key={server.id}
+ server={server}
+ account={account}
+ shared
+ iconDomain={
+ server.template_id
+ ? templatesById.get(server.template_id)?.icon_domain
+ : undefined
+ }
+ onNavigate={onNavigate}
+ onSetAccess={serviceAccounts.setAccess}
+ />
+ ))}
+ {sharedServers.length > 0 && otherServers.length > 0 && (
+ <div className="border-gray-5 border-b bg-gray-3 px-3 py-1.5">
+ <Text
+ color="gray"
+ className="font-medium text-[10px] uppercase tracking-[0.06em]"
+ >
+ Not shared
+ </Text>
+ </div>
+ )}
+ {otherServers.map((server) => (
+ <ServerAccessRow
+ key={server.id}
+ server={server}
+ account={account}
+ shared={false}
+ iconDomain={
+ server.template_id
+ ? templatesById.get(server.template_id)?.icon_domain
+ : undefined
+ }
+ onNavigate={onNavigate}
+ onSetAccess={serviceAccounts.setAccess}
+ />
+ ))}
+ {servers.length === 0 && (
+ <Text color="gray" className="block px-3 py-3 text-[13px] italic">
+ No servers registered with the gateway yet.
+ </Text>
+ )}
+ </div>
+
+ <Text className="font-medium text-base">Recent tool calls</Text>
+ <div className="overflow-hidden rounded border border-gray-5">
+ <div className="grid grid-cols-[130px_1fr_auto] gap-3 border-gray-5 border-b bg-gray-2 px-3 py-2">
+ <Text
+ color="gray"
+ className="font-medium text-[10px] uppercase tracking-[0.06em]"
+ >
+ Time
+ </Text>
+ <Text
+ color="gray"
+ className="font-medium text-[10px] uppercase tracking-[0.06em]"
+ >
+ MCP server · tool called
+ </Text>
+ <Text
+ color="gray"
+ className="text-right font-medium text-[10px] uppercase tracking-[0.06em]"
+ >
+ Decision
+ </Text>
+ </div>
+ {eventsLoading && events.length === 0 ? (
+ <Flex align="center" justify="center" py="4">
+ <Spinner size="1" />
+ </Flex>
+ ) : events.length === 0 ? (
+ <Text color="gray" className="block px-3 py-3 text-[13px] italic">
+ No tool calls from this agent yet.
+ </Text>
+ ) : (
+ events.slice(0, shownCalls).map((event) => (
+ <div
+ key={event.id}
+ className="grid grid-cols-[130px_1fr_auto] items-center gap-3 border-gray-5 border-b px-3 py-2 last:border-b-0"
+ >
+ <Text color="gray" className="text-xs tabular-nums">
+ {formatAuditTime(event.created_at)}
+ </Text>
+ <Flex align="baseline" gap="2" className="min-w-0">
+ <Text truncate className="font-medium text-xs">
+ {event.server_name}
+ </Text>
+ <Text color="gray" truncate className="text-xs">
+ {event.tool_name}()
+ </Text>
+ </Flex>
+ <Badge
+ color={DECISION_COLORS[event.decision]}
+ variant="soft"
+ size="1"
+ >
+ {AUDIT_DECISION_LABELS[event.decision]}
+ </Badge>
+ </div>
+ ))
+ )}
+ {events.length > shownCalls && (
+ <Flex justify="center" py="2">
+ <Button
+ variant="ghost"
+ color="gray"
+ size="1"
+ onClick={() => setShownCalls((count) => count + 10)}
+ >
+ Show more
+ </Button>
+ </Flex>
+ )}
+ </div>
+ </Flex>
+ );
+}
+
+/** One gateway server with this agent's access toggle. */
+function ServerAccessRow({
+ server,
+ account,
+ shared,
+ iconDomain,
+ onNavigate,
+ onSetAccess,
+}: {
+ server: McpGatewayServer;
+ account: { id: string; name: string };
+ shared: boolean;
+ iconDomain: string | undefined;
+ onNavigate: (route: GatewayRoute) => void;
+ onSetAccess: (vars: {
+ accountId: string;
+ serverId: string;
+ enabled: boolean;
+ successMessage?: string;
+ }) => void;
+}) {
+ return (
+ <Flex
+ align="center"
+ gap="3"
+ className={`border-gray-5 border-b px-3 py-2 last:border-b-0 ${shared ? "" : "bg-gray-2 opacity-60"}`}
+ >
+ <ServerIcon iconDomain={iconDomain} serverUrl={server.url} size={26} />
+ <Flex direction="column" className="min-w-0 flex-1">
+ <Text truncate className="font-medium text-sm">
+ {server.name}
+ </Text>
+ <Text color="gray" className="text-xs">
+ {server.tool_count} tools
+ {shared ? " available to this agent" : ""}
+ </Text>
+ </Flex>
+ {shared && (
+ <Button
+ variant="ghost"
+ color="gray"
+ size="1"
+ onClick={() =>
+ onNavigate({
+ view: "server",
+ serverId: server.id,
+ scope: {
+ scopeType: "agent",
+ scopeServiceAccountId: account.id,
+ label: account.name,
+ },
+ })
+ }
+ >
+ <Sliders size={11} /> Tool policies
+ </Button>
+ )}
+ <Switch
+ size="1"
+ checked={shared}
+ onCheckedChange={(enabled) =>
+ onSetAccess({
+ accountId: account.id,
+ serverId: server.id,
+ enabled,
+ successMessage: enabled
+ ? `${account.name} can now use ${server.name}`
+ : `${account.name} no longer has access to ${server.name}`,
+ })
+ }
+ />
+ </Flex>
+ );
+}
+
+function BackButton({
+ onNavigate,
+}: {
+ onNavigate: (route: GatewayRoute) => void;
+}) {
+ return (
+ <Flex align="center" gap="2">
+ <Button
+ variant="ghost"
+ color="gray"
+ size="1"
+ onClick={() => onNavigate({ view: "team" })}
+ >
+ <ArrowLeft size={12} />
+ Back to team & agents
+ </Button>
+ </Flex>
+ );
+}
+
+function KvRow({
+ label,
+ children,
+}: {
+ label: string;
+ children: React.ReactNode;
+}) {
+ return (
+ <div className="grid grid-cols-[160px_1fr] items-center gap-3 border-gray-5 border-b px-3 py-2 last:border-b-0">
+ <Text color="gray" className="text-xs">
+ {label}
+ </Text>
+ {children}
+ </div>
+ );
+}
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayAuditLog.tsx b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayAuditLog.tsx
new file mode 100644
index 000000000000..38db67275346
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayAuditLog.tsx
@@ -0,0 +1,292 @@
+import type {
+ McpAuditEvent,
+ McpAuditQuickFilter,
+} from "@posthog/api-client/posthog-client";
+import {
+ AUDIT_DECISION_LABELS,
+ formatAuditTime,
+} from "@posthog/core/mcp-gateway/gatewayServers";
+import {
+ gatewayUserName,
+ RobotAvatar,
+ UserAvatar,
+} from "@posthog/ui/features/mcp-gateway/components/parts/avatars";
+import {
+ AUDIT_PAGE_SIZE,
+ useGatewayAudit,
+} from "@posthog/ui/features/mcp-gateway/hooks/useGatewayAudit";
+import { useServiceAccounts } from "@posthog/ui/features/mcp-gateway/hooks/useServiceAccounts";
+import {
+ Badge,
+ Button,
+ Flex,
+ Heading,
+ Select,
+ Spinner,
+ Text,
+} from "@radix-ui/themes";
+import { useState } from "react";
+
+const FILTERS: { id: McpAuditQuickFilter; label: string }[] = [
+ { id: "all", label: "All activity" },
+ { id: "agents", label: "Agents only" },
+ { id: "approvals", label: "Approvals" },
+ { id: "blocked", label: "Blocked" },
+];
+
+const DECISION_COLORS: Record<
+ McpAuditEvent["decision"],
+ "green" | "indigo" | "amber" | "red"
+> = {
+ auto: "green",
+ approved: "indigo",
+ pending: "amber",
+ blocked: "red",
+};
+
+/** Every tool call routed through the gateway, with how it was decided. */
+export function GatewayAuditLog() {
+ const [quickFilter, setQuickFilter] = useState<McpAuditQuickFilter>("all");
+ const [agentFilter, setAgentFilter] = useState<string>("all");
+ const [page, setPage] = useState(0);
+
+ const { accounts } = useServiceAccounts();
+ const { events, totalCount, auditLoading, counts } = useGatewayAudit({
+ quickFilter,
+ actorServiceAccountId: agentFilter === "all" ? undefined : agentFilter,
+ page,
+ });
+
+ const pages = Math.max(1, Math.ceil(totalCount / AUDIT_PAGE_SIZE));
+ const currentPage = Math.min(page, pages - 1);
+ const filtered = quickFilter !== "all" || agentFilter !== "all";
+
+ const setFilter = (filter: McpAuditQuickFilter) => {
+ setQuickFilter(filter);
+ setPage(0);
+ };
+
+ return (
+ <Flex direction="column" gap="4" className="min-w-0">
+ <Flex direction="column" gap="1">
+ <Heading className="font-bold text-2xl">Audit log</Heading>
+ <Text color="gray" className="max-w-[620px] text-sm">
+ Every tool call routed through the gateway — each row is one call to a
+ tool on one of your team's MCP servers, and how the gateway decided
+ it.
+ </Text>
+ </Flex>
+
+ <Flex align="center" justify="between" gap="2" wrap="wrap">
+ <Flex gap="2" wrap="wrap">
+ {FILTERS.map((filter) => (
+ <button
+ key={filter.id}
+ type="button"
+ aria-pressed={quickFilter === filter.id}
+ className={`rounded-full border px-3 py-1 text-xs transition-colors ${
+ quickFilter === filter.id
+ ? "border-accent-8 bg-accent-4 text-accent-11"
+ : "border-gray-5 bg-gray-2 text-gray-11 hover:border-gray-7 hover:bg-gray-3"
+ }`}
+ onClick={() => setFilter(filter.id)}
+ >
+ {filter.label}
+ {counts && (
+ <span className="ml-1 text-gray-11">({counts[filter.id]})</span>
+ )}
+ </button>
+ ))}
+ </Flex>
+ <Select.Root
+ value={agentFilter}
+ onValueChange={(value) => {
+ setAgentFilter(value);
+ setPage(0);
+ }}
+ >
+ <Select.Trigger variant="surface">
+ <Text color="gray" className="text-xs">
+ Caller:
+ </Text>{" "}
+ {agentFilter === "all"
+ ? "Everyone"
+ : (accounts.find((account) => account.id === agentFilter)?.name ??
+ "Agent")}
+ </Select.Trigger>
+ <Select.Content>
+ <Select.Item value="all">Everyone</Select.Item>
+ <Select.Group>
+ <Select.Label>Agents</Select.Label>
+ {accounts.map((account) => (
+ <Select.Item key={account.id} value={account.id}>
+ {account.name}
+ </Select.Item>
+ ))}
+ </Select.Group>
+ </Select.Content>
+ </Select.Root>
+ </Flex>
+
+ <Flex align="center" gap="2">
+ <Text color="gray" className="text-[13px]">
+ {totalCount} tool call{totalCount === 1 ? "" : "s"}
+ {filtered ? " match your filters" : ""}
+ </Text>
+ {filtered && (
+ <Button
+ variant="ghost"
+ size="1"
+ onClick={() => {
+ setQuickFilter("all");
+ setAgentFilter("all");
+ setPage(0);
+ }}
+ >
+ Clear filters
+ </Button>
+ )}
+ </Flex>
+
+ <div className="overflow-hidden rounded border border-gray-5">
+ <div className="grid grid-cols-[120px_180px_1fr_auto] gap-3 border-gray-5 border-b bg-gray-2 px-3 py-2">
+ <Text
+ color="gray"
+ className="font-medium text-[10px] uppercase tracking-[0.06em]"
+ >
+ Time
+ </Text>
+ <Text
+ color="gray"
+ className="font-medium text-[10px] uppercase tracking-[0.06em]"
+ >
+ Caller
+ </Text>
+ <Text
+ color="gray"
+ className="font-medium text-[10px] uppercase tracking-[0.06em]"
+ >
+ MCP server · tool called
+ </Text>
+ <Text
+ color="gray"
+ className="text-right font-medium text-[10px] uppercase tracking-[0.06em]"
+ >
+ Decision
+ </Text>
+ </div>
+ {auditLoading && events.length === 0 ? (
+ <Flex align="center" justify="center" py="6">
+ <Spinner size="2" />
+ </Flex>
+ ) : events.length === 0 ? (
+ <Text
+ color="gray"
+ className="block px-3 py-4 text-center text-[13px] italic"
+ >
+ No tool calls match these filters.
+ </Text>
+ ) : (
+ events.map((event) => <AuditRow key={event.id} event={event} />)
+ )}
+ </div>
+
+ <Flex align="center" justify="between" gap="2" wrap="wrap">
+ <Text color="gray" className="text-xs tabular-nums">
+ Showing {totalCount === 0 ? 0 : currentPage * AUDIT_PAGE_SIZE + 1}–
+ {Math.min(totalCount, (currentPage + 1) * AUDIT_PAGE_SIZE)} of{" "}
+ {totalCount}
+ </Text>
+ <Flex align="center" gap="1">
+ <Button
+ variant="surface"
+ color="gray"
+ size="1"
+ disabled={currentPage === 0}
+ onClick={() => setPage(currentPage - 1)}
+ >
+ Prev
+ </Button>
+ {pageWindow(currentPage, pages).map((pageNumber) => (
+ <Button
+ key={pageNumber}
+ variant={pageNumber === currentPage ? "solid" : "surface"}
+ color={pageNumber === currentPage ? undefined : "gray"}
+ size="1"
+ onClick={() => setPage(pageNumber)}
+ >
+ {pageNumber + 1}
+ </Button>
+ ))}
+ <Button
+ variant="surface"
+ color="gray"
+ size="1"
+ disabled={currentPage >= pages - 1}
+ onClick={() => setPage(currentPage + 1)}
+ >
+ Next
+ </Button>
+ </Flex>
+ </Flex>
+ </Flex>
+ );
+}
+
+// A sliding window of page numbers so long histories don't render dozens of
+// buttons; always keeps the current page centered where possible.
+function pageWindow(current: number, total: number, size = 7): number[] {
+ const start = Math.max(
+ 0,
+ Math.min(current - Math.floor(size / 2), total - size),
+ );
+ const end = Math.min(total, start + size);
+ return Array.from({ length: end - start }, (_, index) => start + index);
+}
+
+function AuditRow({ event }: { event: McpAuditEvent }) {
+ const agent = event.actor_service_account;
+ const user = event.actor_user;
+ return (
+ <div className="grid grid-cols-[120px_180px_1fr_auto] items-center gap-3 border-gray-5 border-b px-3 py-2 last:border-b-0">
+ <Text color="gray" className="text-xs tabular-nums">
+ {formatAuditTime(event.created_at)}
+ </Text>
+ <Flex align="center" gap="2" className="min-w-0">
+ {agent ? (
+ <RobotAvatar size="sm" />
+ ) : user ? (
+ <UserAvatar user={user} size="sm" />
+ ) : null}
+ <Text truncate className="text-xs">
+ {agent
+ ? agent.name
+ : user
+ ? gatewayUserName(user)
+ : event.actor_label}
+ </Text>
+ <Badge
+ color={agent ? "indigo" : "gray"}
+ variant="soft"
+ size="1"
+ className="uppercase"
+ >
+ {agent ? "agent" : user ? "human" : "deleted"}
+ </Badge>
+ </Flex>
+ <Flex align="baseline" gap="2" className="min-w-0">
+ <Text truncate className="font-medium text-xs">
+ {event.server_name}
+ </Text>
+ <Text color="gray" truncate className="text-xs">
+ {event.tool_name}()
+ </Text>
+ </Flex>
+ <Flex justify="end">
+ <Badge color={DECISION_COLORS[event.decision]} variant="soft" size="1">
+ {AUDIT_DECISION_LABELS[event.decision]}
+ </Badge>
+ </Flex>
+ </div>
+ );
+}
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayConnectDialog.test.tsx b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayConnectDialog.test.tsx
new file mode 100644
index 000000000000..21bf5c507fe6
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayConnectDialog.test.tsx
@@ -0,0 +1,64 @@
+import { Theme } from "@radix-ui/themes";
+import { render, screen } from "@testing-library/react";
+import userEvent from "@testing-library/user-event";
+import { describe, expect, it, vi } from "vitest";
+import { GatewayConnectDialog } from "./GatewayConnectDialog";
+
+describe("GatewayConnectDialog", () => {
+ it("lets the member pick the mechanism for a custom server, defaulting to OAuth", async () => {
+ const user = userEvent.setup();
+ const onSubmit = vi.fn();
+ render(
+ <Theme>
+ <GatewayConnectDialog
+ open
+ serverName="Internal Wiki"
+ fixedAuthType={null}
+ onSubmit={onSubmit}
+ onClose={vi.fn()}
+ />
+ </Theme>,
+ );
+
+ expect(screen.getByText("Authentication")).toBeInTheDocument();
+ await user.click(screen.getByRole("button", { name: "Connect" }));
+
+ expect(onSubmit).toHaveBeenCalledWith({
+ authType: "oauth",
+ apiKey: "",
+ clientId: "",
+ clientSecret: "",
+ });
+ });
+
+ it("requires the key for an api-key server and submits it", async () => {
+ const user = userEvent.setup();
+ const onSubmit = vi.fn();
+ render(
+ <Theme>
+ <GatewayConnectDialog
+ open
+ serverName="Linear"
+ fixedAuthType="api_key"
+ onSubmit={onSubmit}
+ onClose={vi.fn()}
+ />
+ </Theme>,
+ );
+
+ // The template fixes the mechanism, so there is nothing to choose.
+ expect(screen.queryByText("Authentication")).not.toBeInTheDocument();
+ const connect = screen.getByRole("button", { name: "Connect" });
+ expect(connect).toBeDisabled();
+
+ await user.type(screen.getByPlaceholderText("sk-…"), "sk-secret");
+ await user.click(connect);
+
+ expect(onSubmit).toHaveBeenCalledWith({
+ authType: "api_key",
+ apiKey: "sk-secret",
+ clientId: "",
+ clientSecret: "",
+ });
+ });
+});
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayConnectDialog.tsx b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayConnectDialog.tsx
new file mode 100644
index 000000000000..354496bd5df8
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayConnectDialog.tsx
@@ -0,0 +1,208 @@
+import { CaretRight, Key } from "@phosphor-icons/react";
+import type { McpAuthType } from "@posthog/api-client/posthog-client";
+import {
+ canSubmitGatewayConnect,
+ GATEWAY_CONNECT_DEFAULTS,
+ type GatewayConnectCredentials,
+} from "@posthog/core/mcp-gateway/gatewayConnect";
+import {
+ Button,
+ Dialog,
+ Flex,
+ Select,
+ Text,
+ TextField,
+} from "@radix-ui/themes";
+import { type FormEvent, useState } from "react";
+
+interface GatewayConnectDialogProps {
+ open: boolean;
+ serverName: string;
+ /**
+ * Auth mechanism fixed by the catalog template, or null for custom servers
+ * where the member chooses their own.
+ */
+ fixedAuthType: McpAuthType | null;
+ onSubmit: (credentials: GatewayConnectCredentials) => void;
+ onClose: () => void;
+}
+
+/**
+ * Collects the caller's personal credentials before connecting: the API key
+ * for api-key servers, and — for custom servers, which have no fixed auth
+ * mechanism — the choice between OAuth and API key. Plain OAuth templates
+ * never open this; they go straight to the browser round-trip.
+ */
+export function GatewayConnectDialog({
+ open,
+ serverName,
+ fixedAuthType,
+ onSubmit,
+ onClose,
+}: GatewayConnectDialogProps) {
+ const [values, setValues] = useState<GatewayConnectCredentials>({
+ ...GATEWAY_CONNECT_DEFAULTS,
+ authType: fixedAuthType ?? "oauth",
+ });
+ const [showKey, setShowKey] = useState(false);
+ const [optionalOpen, setOptionalOpen] = useState(false);
+
+ const set = <K extends keyof GatewayConnectCredentials>(
+ key: K,
+ value: GatewayConnectCredentials[K],
+ ) => setValues((previous) => ({ ...previous, [key]: value }));
+
+ const memberChooses = fixedAuthType === null;
+ const canSubmit = canSubmitGatewayConnect(values);
+
+ const submit = (event: FormEvent<HTMLFormElement>) => {
+ event.preventDefault();
+ if (!canSubmit) return;
+ onSubmit(values);
+ };
+
+ return (
+ <Dialog.Root open={open} onOpenChange={(next) => !next && onClose()}>
+ <Dialog.Content maxWidth="480px">
+ <Dialog.Title>Connect {serverName}</Dialog.Title>
+ <Dialog.Description color="gray" className="text-sm">
+ {memberChooses
+ ? "Choose how this server authenticates, then enter your personal credentials."
+ : "Enter the credentials for your personal connection."}
+ </Dialog.Description>
+ <form onSubmit={submit}>
+ <Flex direction="column" gap="3" mt="4">
+ {memberChooses && (
+ <Field label="Authentication">
+ <Select.Root
+ value={values.authType}
+ onValueChange={(value) =>
+ set("authType", value as McpAuthType)
+ }
+ >
+ <Select.Trigger />
+ <Select.Content>
+ <Select.Item value="oauth">
+ OAuth — sign in with the provider
+ </Select.Item>
+ <Select.Item value="api_key">API key</Select.Item>
+ </Select.Content>
+ </Select.Root>
+ </Field>
+ )}
+
+ {values.authType === "api_key" ? (
+ <Field
+ label="API key"
+ hint="Encrypted at rest and never logged or exposed."
+ >
+ <TextField.Root
+ value={values.apiKey}
+ onChange={(e) => set("apiKey", e.target.value)}
+ type={showKey ? "text" : "password"}
+ placeholder="sk-…"
+ spellCheck={false}
+ autoFocus
+ className="font-mono"
+ >
+ <TextField.Slot side="right">
+ <Button
+ type="button"
+ variant="ghost"
+ color="gray"
+ size="1"
+ onClick={() => setShowKey((value) => !value)}
+ >
+ {showKey ? "Hide" : "Show"}
+ </Button>
+ </TextField.Slot>
+ </TextField.Root>
+ </Field>
+ ) : (
+ memberChooses && (
+ <div className="rounded-md border border-gray-5 bg-gray-2">
+ <button
+ type="button"
+ onClick={() => setOptionalOpen((value) => !value)}
+ className="flex w-full items-center gap-2 px-3 py-2 text-left"
+ >
+ <CaretRight
+ size={10}
+ weight="bold"
+ className={`shrink-0 text-gray-10 transition-transform ${optionalOpen ? "rotate-90" : ""}`}
+ />
+ <Text className="font-medium text-sm">Optional</Text>
+ <Text color="gray" className="text-xs">
+ Client ID &amp; secret — only if the provider doesn't
+ support dynamic client registration
+ </Text>
+ </button>
+ {optionalOpen && (
+ <Flex gap="3" className="px-3 pb-3">
+ <Field label="Client ID" className="flex-1">
+ <TextField.Root
+ value={values.clientId}
+ onChange={(e) => set("clientId", e.target.value)}
+ placeholder="mcp-gateway-client"
+ spellCheck={false}
+ className="font-mono"
+ />
+ </Field>
+ <Field label="Client secret" className="flex-1">
+ <TextField.Root
+ value={values.clientSecret}
+ onChange={(e) => set("clientSecret", e.target.value)}
+ type="password"
+ placeholder="••••••••••••"
+ className="font-mono"
+ />
+ </Field>
+ </Flex>
+ )}
+ </div>
+ )
+ )}
+
+ <Flex justify="end" gap="3" mt="2">
+ <Button
+ type="button"
+ variant="soft"
+ color="gray"
+ onClick={onClose}
+ >
+ Cancel
+ </Button>
+ <Button type="submit" disabled={!canSubmit}>
+ <Key size={12} /> Connect
+ </Button>
+ </Flex>
+ </Flex>
+ </form>
+ </Dialog.Content>
+ </Dialog.Root>
+ );
+}
+
+function Field({
+ label,
+ hint,
+ className,
+ children,
+}: {
+ label: string;
+ hint?: string;
+ className?: string;
+ children: React.ReactNode;
+}) {
+ return (
+ <Flex direction="column" gap="1" className={className}>
+ <Text className="font-medium text-sm">{label}</Text>
+ {hint && (
+ <Text color="gray" className="text-[13px]">
+ {hint}
+ </Text>
+ )}
+ {children}
+ </Flex>
+ );
+}
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayDeleteServerDialog.tsx b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayDeleteServerDialog.tsx
new file mode 100644
index 000000000000..bc2de7a8b8db
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayDeleteServerDialog.tsx
@@ -0,0 +1,60 @@
+import { AlertDialog, Button, Flex, Spinner, Text } from "@radix-ui/themes";
+
+interface GatewayDeleteServerDialogProps {
+ open: boolean;
+ serverName: string;
+ deletesForEveryone: boolean;
+ pending: boolean;
+ onOpenChange: (open: boolean) => void;
+ onConfirm: () => void;
+}
+
+export function GatewayDeleteServerDialog({
+ open,
+ serverName,
+ deletesForEveryone,
+ pending,
+ onOpenChange,
+ onConfirm,
+}: GatewayDeleteServerDialogProps) {
+ return (
+ <AlertDialog.Root open={open} onOpenChange={onOpenChange}>
+ <AlertDialog.Content maxWidth="450px">
+ <AlertDialog.Title>Delete MCP server</AlertDialog.Title>
+ <AlertDialog.Description className="text-sm">
+ {deletesForEveryone ? (
+ <>
+ Delete <Text className="font-bold">{serverName}</Text> for
+ everyone? This disconnects every teammate and removes the custom
+ server from the team gateway.
+ </>
+ ) : (
+ <>
+ Delete <Text className="font-bold">{serverName}</Text> for you?
+ This removes its tools from your agent without removing a team
+ server for anyone else.
+ </>
+ )}
+ </AlertDialog.Description>
+ <Flex gap="3" mt="4" justify="end">
+ <AlertDialog.Cancel>
+ <Button variant="soft" color="gray" disabled={pending}>
+ Cancel
+ </Button>
+ </AlertDialog.Cancel>
+ <AlertDialog.Action>
+ <Button
+ variant="solid"
+ color="red"
+ disabled={pending}
+ onClick={onConfirm}
+ >
+ {pending ? <Spinner size="1" /> : null}
+ Delete
+ </Button>
+ </AlertDialog.Action>
+ </Flex>
+ </AlertDialog.Content>
+ </AlertDialog.Root>
+ );
+}
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayMemberDetail.tsx b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayMemberDetail.tsx
new file mode 100644
index 000000000000..8a83d0f258fa
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayMemberDetail.tsx
@@ -0,0 +1,194 @@
+import { ArrowLeft, Plugs, Sliders } from "@phosphor-icons/react";
+import { formatAgo } from "@posthog/core/mcp-gateway/gatewayServers";
+import {
+ gatewayUserName,
+ UserAvatar,
+} from "@posthog/ui/features/mcp-gateway/components/parts/avatars";
+import type { GatewayRoute } from "@posthog/ui/features/mcp-gateway/gatewayRoute";
+import { useGatewayMembers } from "@posthog/ui/features/mcp-gateway/hooks/useGatewayMembers";
+import { useGatewayServers } from "@posthog/ui/features/mcp-gateway/hooks/useGatewayServers";
+import { ServerIcon } from "@posthog/ui/features/mcp-servers/components/parts/icons";
+import {
+ Badge,
+ Button,
+ Flex,
+ Separator,
+ Spinner,
+ Switch,
+ Text,
+} from "@radix-ui/themes";
+
+/** Admin view of one member: which servers they can reach, per-server revoke. */
+export function GatewayMemberDetail({
+ userId,
+ onNavigate,
+}: {
+ userId: number;
+ onNavigate: (route: GatewayRoute) => void;
+}) {
+ const { members, membersLoading, setMemberAccess } = useGatewayMembers({
+ enabled: true,
+ });
+ const { servers, templatesById } = useGatewayServers();
+
+ const member = members.find((entry) => entry.user.id === userId);
+
+ if (!member) {
+ return (
+ <Flex direction="column" gap="4">
+ <BackButton onNavigate={onNavigate} />
+ <Flex align="center" justify="center" py="6">
+ {membersLoading ? (
+ <Spinner size="2" />
+ ) : (
+ <Text color="gray" className="text-sm">
+ Member not found.
+ </Text>
+ )}
+ </Flex>
+ </Flex>
+ );
+ }
+
+ const name = gatewayUserName(member.user);
+ const firstName = name.split(" ")[0];
+ const revoked = new Set(member.revoked_server_ids);
+ const connected = new Set(member.connected_server_ids);
+ const allowedCount = servers.length - revoked.size;
+
+ return (
+ <Flex direction="column" gap="4" className="min-w-0">
+ <BackButton onNavigate={onNavigate} />
+
+ <Flex align="start" gap="3">
+ <UserAvatar user={member.user} size="lg" />
+ <Flex direction="column" gap="1" className="min-w-0 flex-1">
+ <Flex align="center" gap="2">
+ <Text truncate className="font-bold text-xl">
+ {name}
+ </Text>
+ <Badge
+ color={member.is_org_admin ? "indigo" : "gray"}
+ variant="soft"
+ size="1"
+ >
+ {member.is_org_admin ? "admin" : "member"}
+ </Badge>
+ </Flex>
+ <Text color="gray" className="text-sm">
+ {member.user.email}
+ </Text>
+ <Text color="gray" className="flex items-center gap-1 text-xs">
+ <Plugs size={12} /> {allowedCount} of {servers.length} servers
+ </Text>
+ </Flex>
+ </Flex>
+ <Separator size="4" />
+
+ <Flex align="center" gap="2">
+ <Text className="font-medium text-base">Server access</Text>
+ <Badge color="gray" variant="soft" size="1">
+ {allowedCount} of {servers.length}
+ </Badge>
+ </Flex>
+ <div className="overflow-hidden rounded border border-gray-5">
+ {servers.map((server) => {
+ const on = !revoked.has(server.id);
+ const template = server.template_id
+ ? templatesById.get(server.template_id)
+ : undefined;
+ const memberConnection = server.connections.find(
+ (connection) => connection.user.id === member.user.id,
+ );
+ const usedAgo = formatAgo(memberConnection?.last_used_at ?? null);
+ const sub = !on
+ ? `Access turned off for ${firstName}`
+ : connected.has(server.id) || memberConnection
+ ? `Connected${usedAgo ? ` · used ${usedAgo}` : ""}`
+ : "Not connected yet";
+ return (
+ <Flex
+ key={server.id}
+ align="center"
+ gap="3"
+ className={`border-gray-5 border-b px-3 py-2 last:border-b-0 ${on ? "" : "bg-gray-2 opacity-60"}`}
+ >
+ <ServerIcon
+ iconDomain={template?.icon_domain}
+ serverUrl={server.url}
+ size={26}
+ />
+ <Flex direction="column" className="min-w-0 flex-1">
+ <Text truncate className="font-medium text-sm">
+ {server.name}
+ </Text>
+ <Text color="gray" truncate className="text-xs">
+ {sub}
+ </Text>
+ </Flex>
+ {on && (
+ <Button
+ variant="ghost"
+ color="gray"
+ size="1"
+ onClick={() =>
+ onNavigate({
+ view: "server",
+ serverId: server.id,
+ scope: {
+ scopeType: "member",
+ scopeUserId: member.user.id,
+ label: firstName,
+ },
+ })
+ }
+ >
+ <Sliders size={11} /> Tool policies
+ </Button>
+ )}
+ <Switch
+ size="1"
+ checked={on}
+ onCheckedChange={(enabled) =>
+ setMemberAccess({
+ userId: member.user.id,
+ serverId: server.id,
+ enabled,
+ successMessage: enabled
+ ? `${firstName} can now use ${server.name}`
+ : `${firstName} can no longer use ${server.name}`,
+ })
+ }
+ />
+ </Flex>
+ );
+ })}
+ {servers.length === 0 && (
+ <Text color="gray" className="block px-3 py-3 text-[13px] italic">
+ No servers registered with the gateway yet.
+ </Text>
+ )}
+ </div>
+ </Flex>
+ );
+}
+
+function BackButton({
+ onNavigate,
+}: {
+ onNavigate: (route: GatewayRoute) => void;
+}) {
+ return (
+ <Flex align="center" gap="2">
+ <Button
+ variant="ghost"
+ color="gray"
+ size="1"
+ onClick={() => onNavigate({ view: "team" })}
+ >
+ <ArrowLeft size={12} />
+ Back to team & agents
+ </Button>
+ </Flex>
+ );
+}
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayRail.test.tsx b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayRail.test.tsx
new file mode 100644
index 000000000000..ae8719551da9
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayRail.test.tsx
@@ -0,0 +1,127 @@
+import type { McpGatewayServer } from "@posthog/api-client/posthog-client";
+import { Theme } from "@radix-ui/themes";
+import { render, screen } from "@testing-library/react";
+import { describe, expect, it, vi } from "vitest";
+import { GatewayRail } from "./GatewayRail";
+
+vi.mock("@posthog/ui/features/mcp-servers/components/parts/icons", () => ({
+ ServerIcon: () => <div aria-hidden="true" />,
+}));
+
+function server(overrides: Partial<McpGatewayServer> = {}): McpGatewayServer {
+ return {
+ id: "srv-1",
+ name: "Notion",
+ url: "https://mcp.example.com",
+ description: "",
+ category: "dev",
+ is_team_enabled: true,
+ icon_key: "",
+ docs_url: "",
+ template_id: null,
+ template_auth_type: null,
+ tool_count: 0,
+ connections: [],
+ your_connection: null,
+ agents: [],
+ revoked_user_ids: [],
+ is_revoked_for_you: false,
+ created_by: null,
+ created_at: "2026-01-01T00:00:00Z",
+ updated_at: "2026-01-01T00:00:00Z",
+ ...overrides,
+ };
+}
+
+function renderRail(servers: McpGatewayServer[]) {
+ return render(
+ <Theme>
+ <GatewayRail
+ servers={servers}
+ templatesById={new Map()}
+ isAdmin={false}
+ canAddServers={false}
+ route={{ view: "servers" }}
+ onNavigate={vi.fn()}
+ />
+ </Theme>,
+ );
+}
+
+describe("GatewayRail", () => {
+ it("lists a server the caller has connected", () => {
+ renderRail([
+ server({
+ your_connection: {
+ installation_id: "inst-1",
+ is_enabled: true,
+ pending_oauth: false,
+ needs_reauth: false,
+ last_used_at: null,
+ },
+ }),
+ ]);
+
+ expect(screen.getByText("Notion")).toBeInTheDocument();
+ expect(screen.queryByText("No connections yet.")).not.toBeInTheDocument();
+ });
+
+ it("shows the empty state for a server the caller has not connected", () => {
+ renderRail([server()]);
+
+ expect(screen.queryByText("Notion")).not.toBeInTheDocument();
+ expect(screen.getByText("No connections yet.")).toBeInTheDocument();
+ });
+
+ it.each([
+ [
+ "self-disabled",
+ server({
+ your_connection: {
+ installation_id: "inst-1",
+ is_enabled: false,
+ pending_oauth: false,
+ needs_reauth: false,
+ last_used_at: "2026-01-01T00:00:00Z",
+ },
+ }),
+ "Disabled for you",
+ ],
+ [
+ "team-disabled",
+ server({
+ is_team_enabled: false,
+ your_connection: {
+ installation_id: "inst-1",
+ is_enabled: true,
+ pending_oauth: false,
+ needs_reauth: false,
+ last_used_at: "2026-01-01T00:00:00Z",
+ },
+ }),
+ "Off for the team",
+ ],
+ [
+ "revoked",
+ server({
+ is_revoked_for_you: true,
+ your_connection: {
+ installation_id: "inst-1",
+ is_enabled: true,
+ pending_oauth: false,
+ needs_reauth: false,
+ last_used_at: "2026-01-01T00:00:00Z",
+ },
+ }),
+ "Access revoked",
+ ],
+ ] as const)(
+ "labels a %s server instead of showing it as connected",
+ (_label, srv, expected) => {
+ renderRail([srv]);
+
+ expect(screen.getByText(expected)).toBeInTheDocument();
+ expect(screen.queryByText(/used .* ago/)).not.toBeInTheDocument();
+ },
+ );
+});
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayRail.tsx b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayRail.tsx
new file mode 100644
index 000000000000..6172779335b4
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayRail.tsx
@@ -0,0 +1,311 @@
+import {
+ Gear,
+ MagnifyingGlass,
+ Plugs,
+ Plus,
+ Rows,
+ Users,
+ X,
+} from "@phosphor-icons/react";
+import type {
+ McpGatewayServer,
+ McpRecommendedServer,
+} from "@posthog/api-client/posthog-client";
+import {
+ formatAgo,
+ type GatewayRailStatus,
+ getGatewayRailStatus,
+ railConnectedServers,
+} from "@posthog/core/mcp-gateway/gatewayServers";
+import type { GatewayRoute } from "@posthog/ui/features/mcp-gateway/gatewayRoute";
+import { ServerIcon } from "@posthog/ui/features/mcp-servers/components/parts/icons";
+import {
+ Flex,
+ IconButton,
+ ScrollArea,
+ Text,
+ TextField,
+} from "@radix-ui/themes";
+import type { ComponentType } from "react";
+import { useMemo, useState } from "react";
+
+interface GatewayRailProps {
+ servers: McpGatewayServer[];
+ templatesById: Map<string, McpRecommendedServer>;
+ isAdmin: boolean;
+ canAddServers: boolean;
+ route: GatewayRoute;
+ onNavigate: (route: GatewayRoute) => void;
+}
+
+export function GatewayRail({
+ servers,
+ templatesById,
+ isAdmin,
+ canAddServers,
+ route,
+ onNavigate,
+}: GatewayRailProps) {
+ const [search, setSearch] = useState("");
+
+ const yourConnections = useMemo(
+ () => railConnectedServers(servers, search),
+ [servers, search],
+ );
+
+ const activeServerId = route.view === "server" ? route.serverId : null;
+
+ return (
+ <aside className="flex h-full min-h-0 w-[256px] shrink-0 flex-col border-gray-6 border-r bg-gray-2">
+ <Flex
+ align="center"
+ justify="between"
+ px="3"
+ pt="3"
+ pb="2"
+ className="border-b border-b-(--gray-5)"
+ >
+ <Text className="font-bold text-sm">MCP servers</Text>
+ {canAddServers && (
+ <IconButton
+ variant="ghost"
+ color="gray"
+ size="1"
+ onClick={() => onNavigate({ view: "add" })}
+ title="Add server"
+ >
+ <Plus size={14} />
+ </IconButton>
+ )}
+ </Flex>
+
+ <Flex direction="column" gap="2" px="3" pt="3">
+ <TextField.Root
+ value={search}
+ onChange={(e) => setSearch(e.target.value)}
+ placeholder="Search servers…"
+ size="1"
+ >
+ <TextField.Slot>
+ <MagnifyingGlass size={12} />
+ </TextField.Slot>
+ {search && (
+ <TextField.Slot>
+ <IconButton
+ variant="ghost"
+ size="1"
+ onClick={() => setSearch("")}
+ >
+ <X size={10} />
+ </IconButton>
+ </TextField.Slot>
+ )}
+ </TextField.Root>
+ </Flex>
+
+ <ScrollArea className="min-h-0 flex-1">
+ <Flex direction="column" gap="1" px="2" pb="3">
+ <RailSectionLabel
+ label="Your connections"
+ count={yourConnections.length}
+ />
+ {yourConnections.length === 0 ? (
+ <Text
+ color="gray"
+ className="px-[10px] py-[8px] text-[13px] italic"
+ >
+ No connections yet.
+ </Text>
+ ) : (
+ yourConnections.map((server) => {
+ const connection = server.your_connection;
+ const status = getGatewayRailStatus(server);
+ if (!connection || !status) return null;
+ const usedAgo = formatAgo(connection.last_used_at);
+ const sub =
+ status === "connected"
+ ? usedAgo
+ ? `used ${usedAgo}`
+ : "Connected"
+ : RAIL_STATUS_SUB[status];
+ return (
+ <RailServerRow
+ key={server.id}
+ server={server}
+ templatesById={templatesById}
+ active={activeServerId === server.id}
+ sub={sub}
+ connectionStatus={status}
+ onClick={() =>
+ onNavigate({ view: "server", serverId: server.id })
+ }
+ />
+ );
+ })
+ )}
+
+ <div className="mx-2 my-3 border-gray-5 border-t" />
+ <RailSectionLabel label="Manage" />
+ <RailLink
+ icon={Plugs}
+ label="All servers"
+ active={route.view === "servers" || route.view === "server"}
+ onClick={() => onNavigate({ view: "servers" })}
+ />
+ {isAdmin && (
+ <RailLink
+ icon={Users}
+ label="Team & agents"
+ active={["team", "agent", "member"].includes(route.view)}
+ onClick={() => onNavigate({ view: "team" })}
+ />
+ )}
+ {isAdmin && (
+ <RailLink
+ icon={Gear}
+ label="Team settings"
+ active={route.view === "settings"}
+ onClick={() => onNavigate({ view: "settings" })}
+ />
+ )}
+ {isAdmin && (
+ <RailLink
+ icon={Rows}
+ label="Audit log"
+ active={route.view === "audit"}
+ onClick={() => onNavigate({ view: "audit" })}
+ />
+ )}
+ </Flex>
+ </ScrollArea>
+ </aside>
+ );
+}
+
+function RailSectionLabel({ label, count }: { label: string; count?: number }) {
+ return (
+ <Flex
+ align="center"
+ justify="between"
+ px="2"
+ pt="4"
+ pb="1"
+ className="tracking-[0.06em]"
+ >
+ <Text
+ color="gray"
+ className="font-medium text-[10px] uppercase leading-none"
+ >
+ {label}
+ </Text>
+ {count !== undefined && (
+ <Text
+ color="gray"
+ className="rounded-[10px] bg-(--gray-4) px-[6px] py-[1px] text-[10px] leading-none"
+ >
+ {count}
+ </Text>
+ )}
+ </Flex>
+ );
+}
+
+function RailServerRow({
+ server,
+ templatesById,
+ active,
+ sub,
+ connectionStatus,
+ onClick,
+}: {
+ server: McpGatewayServer;
+ templatesById: Map<string, McpRecommendedServer>;
+ active: boolean;
+ sub: string;
+ connectionStatus?: GatewayRailStatus;
+ onClick: () => void;
+}) {
+ const template = server.template_id
+ ? templatesById.get(server.template_id)
+ : undefined;
+ return (
+ <button
+ type="button"
+ onClick={onClick}
+ className={`grid grid-cols-[28px_1fr_auto] items-center gap-2 rounded px-2 py-1.5 text-left transition-colors ${
+ active
+ ? "bg-gray-1 text-gray-12 shadow-sm"
+ : "text-gray-11 hover:bg-gray-3"
+ }`}
+ >
+ <ServerIcon
+ iconDomain={template?.icon_domain}
+ serverUrl={server.url}
+ size={28}
+ />
+ <Flex direction="column" className="min-w-0 leading-[1.2]">
+ <Text truncate className="font-medium text-[13px]">
+ {server.name}
+ </Text>
+ <Text color="gray" truncate className="text-[10px] leading-none">
+ {sub}
+ </Text>
+ </Flex>
+ {connectionStatus ? (
+ <span
+ aria-hidden="true"
+ className="h-[6px] w-[6px] rounded-full"
+ style={{
+ background: CONNECTION_STATUS_COLOR[connectionStatus],
+ boxShadow: `0 0 0 3px color-mix(in oklch, ${CONNECTION_STATUS_COLOR[connectionStatus]} 20%, transparent)`,
+ }}
+ />
+ ) : null}
+ </button>
+ );
+}
+
+const RAIL_STATUS_SUB: Record<
+ Exclude<GatewayRailStatus, "connected">,
+ string
+> = {
+ team_off: "Off for the team",
+ revoked: "Access revoked",
+ self_disabled: "Disabled for you",
+ needs_reauth: "Reconnect required",
+ pending_oauth: "Finish connecting",
+};
+
+const CONNECTION_STATUS_COLOR: Record<GatewayRailStatus, string> = {
+ connected: "var(--green-9)",
+ pending_oauth: "var(--amber-9)",
+ needs_reauth: "var(--red-9)",
+ team_off: "var(--gray-8)",
+ revoked: "var(--gray-8)",
+ self_disabled: "var(--gray-8)",
+};
+
+function RailLink({
+ icon: Icon,
+ label,
+ active,
+ onClick,
+}: {
+ icon: ComponentType<{ size?: number; className?: string }>;
+ label: string;
+ active: boolean;
+ onClick: () => void;
+}) {
+ return (
+ <button
+ type="button"
+ onClick={onClick}
+ className={`flex items-center gap-2 rounded px-2 py-1.5 text-left text-[13px] transition-colors ${
+ active ? "bg-gray-1 text-gray-12" : "text-gray-11 hover:bg-gray-3"
+ }`}
+ >
+ <Icon size={14} className={active ? "text-accent-11" : undefined} />
+ <span>{label}</span>
+ </button>
+ );
+}
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayServerDetail.test.tsx b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayServerDetail.test.tsx
new file mode 100644
index 000000000000..9b88818bc809
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayServerDetail.test.tsx
@@ -0,0 +1,296 @@
+import type { McpGatewayServer } from "@posthog/api-client/posthog-client";
+import { Theme } from "@radix-ui/themes";
+import { render, screen } from "@testing-library/react";
+import userEvent from "@testing-library/user-event";
+import { beforeEach, describe, expect, it, vi } from "vitest";
+
+const mocks = vi.hoisted(() => ({
+ gateway: {} as Record<string, unknown>,
+ setMemberAccess: vi.fn(),
+ currentUser: null as { id: number } | null,
+ refresh: vi.fn(),
+}));
+
+vi.mock("@posthog/ui/features/auth/authClient", () => ({
+ useOptionalAuthenticatedClient: () => null,
+}));
+
+vi.mock("@posthog/ui/features/auth/useCurrentUser", () => ({
+ useCurrentUser: () => ({ data: mocks.currentUser }),
+}));
+
+vi.mock(
+ "@posthog/ui/features/mcp-gateway/hooks/useGatewayToolPolicies",
+ () => ({
+ useGatewayToolPolicies: () => ({
+ policies: [],
+ policiesLoading: false,
+ setPolicy: vi.fn(),
+ setAll: vi.fn(),
+ setAllPending: false,
+ refresh: mocks.refresh,
+ refreshPending: false,
+ }),
+ }),
+);
+
+vi.mock("@posthog/ui/features/mcp-gateway/hooks/useGatewayServers", () => ({
+ useGatewayServers: () => mocks.gateway,
+}));
+
+vi.mock("@posthog/ui/features/mcp-gateway/hooks/useGatewayMembers", () => ({
+ useGatewayMembers: () => ({
+ members: [],
+ membersLoading: false,
+ setMemberAccess: mocks.setMemberAccess,
+ }),
+}));
+
+vi.mock("@posthog/ui/features/mcp-gateway/hooks/useServiceAccounts", () => ({
+ useServiceAccounts: () => ({
+ accounts: [],
+ accountsLoading: false,
+ setAccess: vi.fn(),
+ setAccessPending: false,
+ }),
+}));
+
+vi.mock("@posthog/ui/features/mcp-servers/components/parts/icons", () => ({
+ ServerIcon: () => <div aria-hidden="true" />,
+}));
+
+import { GatewayServerDetail } from "./GatewayServerDetail";
+
+const server = {
+ id: "server-1",
+ name: "Linear",
+ url: "https://mcp.linear.app",
+ description: "",
+ category: "productivity",
+ is_team_enabled: true,
+ icon_key: "",
+ docs_url: "",
+ template_id: null,
+ template_auth_type: null,
+ tool_count: 0,
+ connections: [
+ {
+ installation_id: "installation-1",
+ user: {
+ id: 7,
+ uuid: "user-7",
+ first_name: "Ada",
+ last_name: "Lovelace",
+ email: "[email protected]",
+ hedgehog_config: null,
+ },
+ last_used_at: null,
+ pending_oauth: false,
+ needs_reauth: false,
+ },
+ ],
+ your_connection: null,
+ agents: [],
+ revoked_user_ids: [7],
+ is_revoked_for_you: false,
+ created_by: null,
+ created_at: "2026-07-23T12:00:00Z",
+ updated_at: "2026-07-23T12:00:00Z",
+} as McpGatewayServer;
+
+describe("GatewayServerDetail", () => {
+ beforeEach(() => {
+ vi.clearAllMocks();
+ mocks.currentUser = null;
+ mocks.gateway = {
+ servers: [server],
+ serversLoading: false,
+ templatesById: new Map(),
+ connectingServerId: null,
+ reconnectPending: false,
+ disconnectPending: false,
+ removeServerPending: false,
+ connect: vi.fn(),
+ reconnect: vi.fn(),
+ disconnect: vi.fn(),
+ toggleYourConnection: vi.fn(),
+ updateServer: vi.fn(),
+ removeServer: vi.fn(),
+ };
+ });
+
+ it("shows revoked member access and lets an admin restore it", async () => {
+ const user = userEvent.setup();
+ render(
+ <Theme>
+ <GatewayServerDetail
+ serverId={server.id}
+ isAdmin
+ canManageAgentAccess
+ onNavigate={vi.fn()}
+ />
+ </Theme>,
+ );
+
+ expect(screen.getByText("Access revoked")).toBeInTheDocument();
+ expect(
+ screen.queryByRole("button", { name: "Revoke" }),
+ ).not.toBeInTheDocument();
+
+ await user.click(screen.getByRole("button", { name: "Restore" }));
+
+ expect(mocks.setMemberAccess).toHaveBeenCalledWith({
+ userId: 7,
+ serverId: server.id,
+ enabled: true,
+ successMessage: "Ada can now use Linear",
+ });
+ });
+
+ // Members receive `connections: []` (the roster is admin-only), so the
+ // delete affordance must derive from the session user, not the roster.
+ it("offers a member delete on their own custom server", () => {
+ mocks.currentUser = { id: 7 };
+ const yourServer = {
+ ...server,
+ connections: [],
+ revoked_user_ids: [],
+ created_by: {
+ id: 7,
+ uuid: "user-7",
+ email: "[email protected]",
+ hedgehog_config: null,
+ },
+ your_connection: {
+ installation_id: "installation-1",
+ is_enabled: true,
+ pending_oauth: false,
+ needs_reauth: false,
+ last_used_at: null,
+ },
+ } as McpGatewayServer;
+ mocks.gateway = { ...mocks.gateway, servers: [yourServer] };
+
+ render(
+ <Theme>
+ <GatewayServerDetail
+ serverId={yourServer.id}
+ isAdmin={false}
+ canManageAgentAccess={false}
+ onNavigate={vi.fn()}
+ />
+ </Theme>,
+ );
+
+ expect(
+ screen.getByRole("button", { name: "Delete server" }),
+ ).toBeInTheDocument();
+ expect(
+ screen.queryByRole("button", { name: /Disconnect/ }),
+ ).not.toBeInTheDocument();
+ });
+
+ it("shows a single scope-aware bulk trio when a member views an agent scope", () => {
+ const serverWithAgent = {
+ ...server,
+ agents: [
+ {
+ service_account_id: "sa-1",
+ name: "Deploy bot",
+ handle: "deploy-bot",
+ status: "active",
+ last_active_at: null,
+ granted_by: null,
+ },
+ ],
+ } as McpGatewayServer;
+ mocks.gateway.servers = [serverWithAgent];
+
+ render(
+ <Theme>
+ <GatewayServerDetail
+ serverId={server.id}
+ initialScope={{
+ scopeType: "agent",
+ scopeServiceAccountId: "sa-1",
+ label: "Deploy bot",
+ }}
+ isAdmin={false}
+ canManageAgentAccess
+ onNavigate={vi.fn()}
+ />
+ </Theme>,
+ );
+
+ // The scope switcher carries the only bulk trio; the top-level one
+ // (label "Set all") must not render alongside it.
+ expect(screen.getByText("Set all for Deploy bot")).toBeInTheDocument();
+ expect(screen.queryByText("Set all")).not.toBeInTheDocument();
+ });
+
+ it("collects credentials before connecting a custom server", async () => {
+ const user = userEvent.setup();
+ render(
+ <Theme>
+ <GatewayServerDetail
+ serverId={server.id}
+ isAdmin
+ canManageAgentAccess
+ onNavigate={vi.fn()}
+ />
+ </Theme>,
+ );
+
+ // Custom servers have no fixed auth mechanism, so connecting must ask
+ // instead of assuming OAuth.
+ await user.click(
+ screen.getByRole("button", { name: "Connect your account" }),
+ );
+ expect(mocks.gateway.connect).not.toHaveBeenCalled();
+ expect(screen.getByText("Authentication")).toBeInTheDocument();
+
+ await user.click(screen.getByRole("button", { name: "Connect" }));
+
+ expect(mocks.gateway.connect).toHaveBeenCalledWith({
+ server,
+ credentials: {
+ authType: "oauth",
+ apiKey: "",
+ clientId: "",
+ clientSecret: "",
+ },
+ });
+ });
+
+ it("lets a connected plain member refresh tools", async () => {
+ const connectedServer = {
+ ...server,
+ your_connection: {
+ installation_id: "installation-2",
+ is_enabled: true,
+ pending_oauth: false,
+ needs_reauth: false,
+ last_used_at: null,
+ },
+ } as McpGatewayServer;
+ mocks.gateway.servers = [connectedServer];
+
+ const user = userEvent.setup();
+ render(
+ <Theme>
+ <GatewayServerDetail
+ serverId={connectedServer.id}
+ isAdmin={false}
+ canManageAgentAccess={false}
+ onNavigate={vi.fn()}
+ />
+ </Theme>,
+ );
+
+ await user.click(
+ screen.getByRole("button", { name: "Refresh tools from server" }),
+ );
+
+ expect(mocks.refresh).toHaveBeenCalledWith("installation-2");
+ });
+});
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayServerDetail.tsx b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayServerDetail.tsx
new file mode 100644
index 000000000000..9c37909860c4
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayServerDetail.tsx
@@ -0,0 +1,1036 @@
+import {
+ ArrowClockwise,
+ ArrowLeft,
+ ArrowUpRight,
+ Check,
+ Key,
+ MagnifyingGlass,
+ Plus,
+ Prohibit,
+ Robot,
+ Shield,
+ Trash,
+ User,
+ Users,
+ X,
+} from "@phosphor-icons/react";
+import type {
+ McpApprovalState,
+ McpGatewayServer,
+} from "@posthog/api-client/posthog-client";
+import {
+ type GatewayConnectCredentials,
+ gatewayConnectAuthType,
+ gatewayConnectNeedsCredentials,
+} from "@posthog/core/mcp-gateway/gatewayConnect";
+import {
+ countPoliciesByState,
+ formatAgo,
+ getGatewayServerRemovalAction,
+} from "@posthog/core/mcp-gateway/gatewayServers";
+import { usableInstallationId } from "@posthog/core/mcp-gateway/gatewayToolDiscovery";
+import { useOptionalAuthenticatedClient } from "@posthog/ui/features/auth/authClient";
+import { useCurrentUser } from "@posthog/ui/features/auth/useCurrentUser";
+import {
+ gatewayUserName,
+ RobotAvatar,
+ UserAvatar,
+} from "@posthog/ui/features/mcp-gateway/components/parts/avatars";
+import { GatewayConnectDialog } from "@posthog/ui/features/mcp-gateway/components/parts/GatewayConnectDialog";
+import { GatewayDeleteServerDialog } from "@posthog/ui/features/mcp-gateway/components/parts/GatewayDeleteServerDialog";
+import { GatewayToolRow } from "@posthog/ui/features/mcp-gateway/components/parts/GatewayToolRow";
+import { GiveAccessDialog } from "@posthog/ui/features/mcp-gateway/components/parts/GiveAccessDialog";
+import type { GatewayRoute } from "@posthog/ui/features/mcp-gateway/gatewayRoute";
+import {
+ type GatewayPolicyScope,
+ TEAM_SCOPE,
+ YOU_SCOPE,
+} from "@posthog/ui/features/mcp-gateway/hooks/gatewayKeys";
+import { useGatewayMembers } from "@posthog/ui/features/mcp-gateway/hooks/useGatewayMembers";
+import { useGatewayServers } from "@posthog/ui/features/mcp-gateway/hooks/useGatewayServers";
+import { useGatewayToolPolicies } from "@posthog/ui/features/mcp-gateway/hooks/useGatewayToolPolicies";
+import { useServiceAccounts } from "@posthog/ui/features/mcp-gateway/hooks/useServiceAccounts";
+import { ServerIcon } from "@posthog/ui/features/mcp-servers/components/parts/icons";
+import { toast } from "@posthog/ui/primitives/toast";
+import {
+ Badge,
+ Button,
+ Flex,
+ IconButton,
+ Separator,
+ Spinner,
+ Switch,
+ Text,
+ TextField,
+ Tooltip,
+} from "@radix-ui/themes";
+import { useMemo, useState } from "react";
+
+const TOOL_PREVIEW_LIMIT = 10;
+
+interface GatewayServerDetailProps {
+ serverId: string;
+ initialScope?: GatewayPolicyScope;
+ isAdmin: boolean;
+ canManageAgentAccess: boolean;
+ onNavigate: (route: GatewayRoute) => void;
+}
+
+function sameScope(a: GatewayPolicyScope, b: GatewayPolicyScope): boolean {
+ return (
+ a.scopeType === b.scopeType &&
+ a.scopeUserId === b.scopeUserId &&
+ a.scopeServiceAccountId === b.scopeServiceAccountId
+ );
+}
+
+export function GatewayServerDetail({
+ serverId,
+ initialScope,
+ isAdmin,
+ canManageAgentAccess,
+ onNavigate,
+}: GatewayServerDetailProps) {
+ const gateway = useGatewayServers();
+ const server = gateway.servers.find((entry) => entry.id === serverId);
+ const [scope, setScope] = useState<GatewayPolicyScope>(
+ initialScope ?? YOU_SCOPE,
+ );
+ const [giveAccessOpen, setGiveAccessOpen] = useState(false);
+ const [connectOpen, setConnectOpen] = useState(false);
+ const [deleteServerOpen, setDeleteServerOpen] = useState(false);
+ const [toolSearch, setToolSearch] = useState("");
+ const [toolsExpanded, setToolsExpanded] = useState(false);
+
+ // Listing tools from the upstream server needs a live credential of the
+ // caller's own — it is what the gateway authenticates the list call with.
+ const liveInstallationId = usableInstallationId(server ?? null);
+
+ const tools = useGatewayToolPolicies(serverId, scope, {
+ enabled: !!server,
+ autoDiscoverWith: liveInstallationId,
+ });
+ const filteredPolicies = useMemo(() => {
+ const search = toolSearch.trim().toLowerCase();
+ if (!search) return tools.policies;
+ return tools.policies.filter((policy) =>
+ policy.tool_name.toLowerCase().includes(search),
+ );
+ }, [toolSearch, tools.policies]);
+ const displayedPolicies = toolsExpanded
+ ? filteredPolicies
+ : filteredPolicies.slice(0, TOOL_PREVIEW_LIMIT);
+ // Team-scope rows seed the give-access dialog's per-tool defaults.
+ const teamTools = useGatewayToolPolicies(serverId, TEAM_SCOPE, {
+ enabled: !!server && canManageAgentAccess,
+ });
+ const members = useGatewayMembers({ enabled: isAdmin });
+ const serviceAccounts = useServiceAccounts();
+ // `server.connections` is admin-only (empty for members), so identifying
+ // the caller as a custom server's creator needs the session user instead.
+ const apiClient = useOptionalAuthenticatedClient();
+ const { data: currentUser } = useCurrentUser({ client: apiClient });
+
+ const scopes = useMemo<GatewayPolicyScope[]>(() => {
+ if (!server) return [];
+ const list: GatewayPolicyScope[] = isAdmin
+ ? [TEAM_SCOPE, YOU_SCOPE]
+ : [YOU_SCOPE];
+ if (
+ initialScope?.scopeType === "member" &&
+ initialScope.scopeUserId !== undefined
+ ) {
+ list.push(initialScope);
+ }
+ if (canManageAgentAccess) {
+ for (const agent of server.agents) {
+ list.push({
+ scopeType: "agent",
+ scopeServiceAccountId: agent.service_account_id,
+ label: agent.name,
+ });
+ }
+ }
+ return list;
+ }, [server, isAdmin, canManageAgentAccess, initialScope]);
+
+ if (!server) {
+ return (
+ <Flex direction="column" gap="4">
+ <BackButton onNavigate={onNavigate} />
+ <Flex align="center" justify="center" py="6">
+ {gateway.serversLoading ? (
+ <Spinner size="2" />
+ ) : (
+ <Text color="gray" className="text-sm">
+ Server not found.
+ </Text>
+ )}
+ </Flex>
+ </Flex>
+ );
+ }
+
+ const yourConnection = server.your_connection;
+ const selfEnabled = yourConnection ? yourConnection.is_enabled : true;
+ const needsReconnect =
+ !!yourConnection &&
+ (yourConnection.needs_reauth || yourConnection.pending_oauth);
+ const connecting = gateway.connectingServerId === server.id;
+ const template = server.template_id
+ ? gateway.templatesById.get(server.template_id)
+ : undefined;
+ const serverRemovalAction = getGatewayServerRemovalAction(
+ server,
+ isAdmin,
+ currentUser?.id ?? null,
+ );
+ const deletesForEveryone = serverRemovalAction === "delete_for_everyone";
+ const deleteInstallationId =
+ serverRemovalAction === "delete_for_you"
+ ? (yourConnection?.installation_id ?? null)
+ : null;
+
+ const agentScope = scope.scopeType === "agent";
+ const counts = countPoliciesByState(tools.policies, scope.scopeType);
+ const editableCount = tools.policies.filter(
+ (policy) => !policy.locked,
+ ).length;
+ const filteredEditablePolicies = filteredPolicies.filter(
+ (policy) => !policy.locked,
+ );
+ const hasToolSearch = toolSearch.trim().length > 0;
+ const bulkEditableCount = hasToolSearch
+ ? filteredEditablePolicies.length
+ : editableCount;
+ const scopeEditable =
+ isAdmin ||
+ scope.scopeType === "member" ||
+ (scope.scopeType === "agent" && canManageAgentAccess);
+ // Any connected member can re-list — it runs against their own credential,
+ // and it is the manual retry when auto-discovery failed.
+ const refreshInstallationId = liveInstallationId;
+ const showScopeBar = (isAdmin || canManageAgentAccess) && scopes.length > 1;
+
+ const setBulkPolicy = (state: McpApprovalState) => {
+ tools.setAll(
+ state,
+ hasToolSearch
+ ? filteredEditablePolicies.map((policy) => policy.tool_name)
+ : undefined,
+ );
+ };
+
+ const connectButton = connecting ? (
+ <Button variant="solid" size="2" disabled>
+ <Spinner size="1" /> Authorizing…
+ </Button>
+ ) : needsReconnect ? (
+ <Button
+ variant="solid"
+ size="2"
+ onClick={() =>
+ gateway.reconnect({
+ installationId: yourConnection.installation_id,
+ serverName: server.name,
+ })
+ }
+ disabled={gateway.reconnectPending}
+ >
+ <Key size={12} /> Reconnect your account
+ </Button>
+ ) : (
+ <Button
+ variant="solid"
+ size="2"
+ onClick={() =>
+ // Custom servers and api-key templates collect credentials first;
+ // plain OAuth templates go straight to the browser round-trip.
+ gatewayConnectNeedsCredentials(server)
+ ? setConnectOpen(true)
+ : gateway.connect({ server })
+ }
+ >
+ <Key size={12} /> Connect your account
+ </Button>
+ );
+
+ const handleConnectSubmit = (credentials: GatewayConnectCredentials) => {
+ gateway.connect({ server, credentials });
+ setConnectOpen(false);
+ };
+
+ return (
+ <Flex direction="column" gap="4" className="min-w-0">
+ <BackButton onNavigate={onNavigate} />
+
+ {/* Hero */}
+ <Flex align="start" gap="3">
+ <ServerIcon
+ iconDomain={template?.icon_domain}
+ serverUrl={server.url}
+ size={56}
+ />
+ <Flex direction="column" gap="1" className="min-w-0 flex-1">
+ <Flex align="center" gap="2">
+ <Text truncate className="font-bold text-xl">
+ {server.name}
+ </Text>
+ {isAdmin && !server.is_team_enabled && (
+ <Badge color="gray" variant="soft" size="1">
+ Off
+ </Badge>
+ )}
+ </Flex>
+ {server.description && (
+ <Text color="gray" className="text-sm">
+ {server.description}
+ </Text>
+ )}
+ <Flex gap="3" align="center" mt="1">
+ {server.created_by && (
+ <Text color="gray" className="flex items-center gap-1 text-xs">
+ <User size={12} /> {gatewayUserName(server.created_by)}
+ </Text>
+ )}
+ {server.docs_url && (
+ <a
+ href={server.docs_url}
+ target="_blank"
+ rel="noreferrer noopener"
+ className="flex items-center gap-1 text-accent-11 text-xs hover:underline"
+ >
+ <ArrowUpRight size={11} /> Docs
+ </a>
+ )}
+ </Flex>
+ </Flex>
+ <Flex direction="column" align="end" gap="2" className="shrink-0">
+ {(deletesForEveryone || deleteInstallationId) && (
+ <Tooltip content="Delete server">
+ <IconButton
+ variant="ghost"
+ color="red"
+ size="2"
+ aria-label="Delete server"
+ onClick={() => setDeleteServerOpen(true)}
+ >
+ <Trash size={14} />
+ </IconButton>
+ </Tooltip>
+ )}
+ {yourConnection && (
+ <Tooltip
+ content={
+ selfEnabled
+ ? "Disable this server for you"
+ : "Enable this server for you"
+ }
+ >
+ {/* Tooltip stamps its own data-state on its child, which would
+ overwrite the Switch's checked/unchecked state and leave the
+ track stuck on the accent color. Give it a span to stamp. */}
+ <span className="inline-flex">
+ <Switch
+ size="1"
+ checked={selfEnabled}
+ onCheckedChange={(enabled) =>
+ gateway.toggleYourConnection({
+ installationId: yourConnection.installation_id,
+ enabled,
+ })
+ }
+ />
+ </span>
+ </Tooltip>
+ )}
+ {yourConnection ? (
+ <Flex direction="column" align="end" gap="2">
+ {!deletesForEveryone && !deleteInstallationId && (
+ <Button
+ variant="ghost"
+ color="gray"
+ size="2"
+ disabled={gateway.disconnectPending}
+ onClick={() =>
+ gateway.disconnect({
+ installationId: yourConnection.installation_id,
+ serverName: server.name,
+ })
+ }
+ >
+ <X size={12} /> Disconnect
+ </Button>
+ )}
+ {needsReconnect && connectButton}
+ </Flex>
+ ) : (
+ connectButton
+ )}
+ </Flex>
+ </Flex>
+
+ <Separator size="4" />
+
+ {/* Your connection exists but you switched it off for yourself. */}
+ {yourConnection && !selfEnabled && (
+ <Flex
+ align="start"
+ gap="3"
+ className="rounded-md border border-(--accent-6) bg-(--accent-2) p-3"
+ >
+ <Flex
+ align="center"
+ justify="center"
+ className="h-[32px] w-[32px] shrink-0 rounded-full bg-(--accent-4) text-accent-11"
+ >
+ <Key size={15} />
+ </Flex>
+ <Flex direction="column" gap="1">
+ <Text className="font-medium text-sm">Disabled for you</Text>
+ <Text color="gray" className="text-[13px]">
+ {server.name} tools won't be offered to you until you turn it back
+ on.
+ </Text>
+ </Flex>
+ </Flex>
+ )}
+
+ {(isAdmin || canManageAgentAccess) && (
+ <AccessSection
+ server={server}
+ gateway={gateway}
+ isAdmin={isAdmin}
+ onShareWithAgent={() => setGiveAccessOpen(true)}
+ onSetMemberAccess={(userId, name, enabled) =>
+ members.setMemberAccess({
+ userId,
+ serverId: server.id,
+ enabled,
+ successMessage: enabled
+ ? `${name} can now use ${server.name}`
+ : `${name} can no longer use ${server.name}`,
+ })
+ }
+ onRevokeAgent={(accountId, name) =>
+ serviceAccounts.setAccess({
+ accountId,
+ serverId: server.id,
+ enabled: false,
+ successMessage: `${name} no longer has access to ${server.name}`,
+ })
+ }
+ />
+ )}
+
+ {/* Tools */}
+ <Flex align="center" justify="between" wrap="wrap" gap="2" mt="2">
+ <Flex align="center" gap="2">
+ <Text className="font-medium text-base">Tools</Text>
+ <Badge color="gray" variant="soft" size="1">
+ {tools.policies.length}
+ </Badge>
+ <Flex gap="2">
+ {counts.approved > 0 && (
+ <Badge color="green" variant="soft" size="1">
+ {counts.approved} Always Allow
+ </Badge>
+ )}
+ {counts.needs_approval > 0 && (
+ <Badge color="amber" variant="soft" size="1">
+ {counts.needs_approval} Needs Approval
+ </Badge>
+ )}
+ {counts.do_not_use > 0 && (
+ <Badge color="red" variant="soft" size="1">
+ {counts.do_not_use} blocked
+ </Badge>
+ )}
+ </Flex>
+ </Flex>
+ <Flex align="center" gap="2">
+ {!isAdmin && scopeEditable && scopes.length <= 1 && (
+ <BulkTrio
+ label="Set all"
+ filtered={hasToolSearch}
+ disabled={tools.setAllPending || bulkEditableCount === 0}
+ allowNeedsApproval={!agentScope}
+ onSet={setBulkPolicy}
+ />
+ )}
+ {!showScopeBar && refreshInstallationId && (
+ <RefreshToolsButton
+ pending={tools.refreshPending}
+ onRefresh={() => tools.refresh(refreshInstallationId)}
+ />
+ )}
+ </Flex>
+ </Flex>
+
+ {showScopeBar && (
+ <Flex
+ align="center"
+ gap="2"
+ wrap="wrap"
+ className="rounded-md border border-gray-5 bg-gray-2 px-3 py-2"
+ >
+ <Text color="gray" className="text-xs">
+ Policy for
+ </Text>
+ {scopes.map((entry) => {
+ const active = sameScope(entry, scope);
+ return (
+ <Button
+ key={`${entry.scopeType}:${entry.scopeUserId ?? ""}:${entry.scopeServiceAccountId ?? ""}`}
+ variant={active ? "solid" : "surface"}
+ color={active ? undefined : "gray"}
+ size="1"
+ radius="full"
+ onClick={() => {
+ setScope(entry);
+ setToolsExpanded(false);
+ }}
+ >
+ {entry.scopeType === "agent" ? (
+ <Robot size={11} />
+ ) : entry.scopeType === "team" ? (
+ <Users size={11} />
+ ) : (
+ <User size={11} />
+ )}
+ {entry.label}
+ </Button>
+ );
+ })}
+ <div className="ml-auto flex items-center gap-1">
+ <BulkTrio
+ label={`Set all for ${scope.label}`}
+ filtered={hasToolSearch}
+ disabled={tools.setAllPending || bulkEditableCount === 0}
+ allowNeedsApproval={!agentScope}
+ onSet={setBulkPolicy}
+ />
+ {refreshInstallationId && (
+ <RefreshToolsButton
+ pending={tools.refreshPending}
+ onRefresh={() => tools.refresh(refreshInstallationId)}
+ />
+ )}
+ </div>
+ </Flex>
+ )}
+
+ {tools.policies.length > 5 && (
+ <TextField.Root
+ value={toolSearch}
+ onChange={(event) => {
+ setToolSearch(event.target.value);
+ setToolsExpanded(false);
+ }}
+ placeholder="Search tools..."
+ size="2"
+ >
+ <TextField.Slot>
+ <MagnifyingGlass size={14} />
+ </TextField.Slot>
+ {toolSearch && (
+ <TextField.Slot>
+ <IconButton
+ variant="ghost"
+ size="1"
+ aria-label="Clear tool search"
+ onClick={() => {
+ setToolSearch("");
+ setToolsExpanded(false);
+ }}
+ >
+ <X size={12} />
+ </IconButton>
+ </TextField.Slot>
+ )}
+ </TextField.Root>
+ )}
+
+ {tools.policiesLoading && tools.policies.length === 0 ? (
+ <Flex align="center" justify="center" py="6">
+ <Spinner size="2" />
+ </Flex>
+ ) : tools.policies.length === 0 ? (
+ <Flex
+ direction="column"
+ align="center"
+ gap="1"
+ py="6"
+ className="rounded border border-gray-6 border-dashed"
+ >
+ <Text className="font-medium text-sm">No tools discovered yet.</Text>
+ <Text color="gray" className="text-[13px]">
+ {refreshInstallationId
+ ? "This server listed no tools. Refresh to try again."
+ : "Connect your account to list this server's tools."}
+ </Text>
+ </Flex>
+ ) : filteredPolicies.length === 0 ? (
+ <Flex align="center" justify="center" py="4">
+ <Text color="gray" className="text-sm">
+ No tools match &ldquo;{toolSearch}&rdquo;
+ </Text>
+ </Flex>
+ ) : (
+ <Flex direction="column" gap="2">
+ {displayedPolicies.map((policy) => (
+ <GatewayToolRow
+ key={policy.tool_name}
+ policy={policy}
+ editable={scopeEditable && !policy.locked}
+ teamScope={scope.scopeType === "team"}
+ agentScope={agentScope}
+ onChange={(state) =>
+ tools.setPolicy({ toolName: policy.tool_name, state })
+ }
+ />
+ ))}
+ {filteredPolicies.length > TOOL_PREVIEW_LIMIT && (
+ <button
+ type="button"
+ className="w-full px-3 py-2 text-center font-medium text-gray-11 text-xs transition-colors hover:bg-gray-2 hover:text-gray-12"
+ onClick={() => setToolsExpanded((expanded) => !expanded)}
+ >
+ {toolsExpanded ? "View less" : "View more"}
+ </button>
+ )}
+ </Flex>
+ )}
+
+ {connectOpen && (
+ <GatewayConnectDialog
+ open
+ serverName={server.name}
+ fixedAuthType={gatewayConnectAuthType(server)}
+ onSubmit={handleConnectSubmit}
+ onClose={() => setConnectOpen(false)}
+ />
+ )}
+ <GiveAccessDialog
+ open={giveAccessOpen}
+ server={server}
+ accounts={serviceAccounts.accounts}
+ toolPolicies={teamTools.policies}
+ pending={serviceAccounts.setAccessPending}
+ onClose={() => setGiveAccessOpen(false)}
+ onGrant={(accountId, policies) => {
+ const account = serviceAccounts.accounts.find(
+ (entry) => entry.id === accountId,
+ );
+ serviceAccounts.setAccess(
+ {
+ accountId,
+ serverId: server.id,
+ enabled: true,
+ policies,
+ successMessage: `${account?.name ?? "Agent"} can now use ${server.name}`,
+ },
+ { onSuccess: () => setGiveAccessOpen(false) },
+ );
+ }}
+ />
+ <GatewayDeleteServerDialog
+ open={deleteServerOpen}
+ serverName={server.name}
+ deletesForEveryone={deletesForEveryone}
+ pending={
+ deletesForEveryone
+ ? gateway.removeServerPending
+ : gateway.disconnectPending
+ }
+ onOpenChange={setDeleteServerOpen}
+ onConfirm={() => {
+ if (deletesForEveryone) {
+ gateway.removeServer(
+ { serverId: server.id, serverName: server.name },
+ { onSuccess: () => onNavigate({ view: "servers" }) },
+ );
+ return;
+ }
+ if (!deleteInstallationId) return;
+ gateway.disconnect(
+ {
+ installationId: deleteInstallationId,
+ serverName: server.name,
+ action: "delete",
+ },
+ {
+ onSuccess: () => onNavigate({ view: "servers" }),
+ },
+ );
+ }}
+ />
+ </Flex>
+ );
+}
+
+function BackButton({
+ onNavigate,
+}: {
+ onNavigate: (route: GatewayRoute) => void;
+}) {
+ return (
+ <Flex align="center" gap="2">
+ <Button
+ variant="ghost"
+ color="gray"
+ size="1"
+ onClick={() => onNavigate({ view: "servers" })}
+ >
+ <ArrowLeft size={12} />
+ Back to servers
+ </Button>
+ </Flex>
+ );
+}
+
+function RefreshToolsButton({
+ pending,
+ onRefresh,
+}: {
+ pending: boolean;
+ onRefresh: () => void;
+}) {
+ return (
+ <Tooltip content="Refresh tools from server">
+ <IconButton
+ variant="soft"
+ color="gray"
+ size="1"
+ aria-label="Refresh tools from server"
+ disabled={pending}
+ onClick={onRefresh}
+ >
+ {pending ? (
+ <Spinner size="1" />
+ ) : (
+ <ArrowClockwise size={11} weight="bold" />
+ )}
+ </IconButton>
+ </Tooltip>
+ );
+}
+
+function BulkTrio({
+ label,
+ filtered,
+ disabled,
+ allowNeedsApproval,
+ onSet,
+}: {
+ label: string;
+ filtered?: boolean;
+ disabled: boolean;
+ allowNeedsApproval: boolean;
+ onSet: (state: McpApprovalState) => void;
+}) {
+ return (
+ <Flex align="center" gap="1">
+ <Text color="gray" className="text-xs">
+ {label}
+ </Text>
+ <Tooltip
+ content={filtered ? "Always Allow filtered" : "Always Allow all"}
+ >
+ <IconButton
+ variant="soft"
+ color="green"
+ size="1"
+ disabled={disabled}
+ onClick={() => onSet("approved")}
+ >
+ <Check size={11} weight="bold" />
+ </IconButton>
+ </Tooltip>
+ {allowNeedsApproval && (
+ <Tooltip
+ content={
+ filtered
+ ? "Set filtered to Needs Approval"
+ : "Set all to Needs Approval"
+ }
+ >
+ <IconButton
+ variant="soft"
+ color="amber"
+ size="1"
+ disabled={disabled}
+ onClick={() => onSet("needs_approval")}
+ >
+ <Shield size={11} weight="bold" />
+ </IconButton>
+ </Tooltip>
+ )}
+ <Tooltip content={filtered ? "Block filtered" : "Block all"}>
+ <IconButton
+ variant="soft"
+ color="red"
+ size="1"
+ disabled={disabled}
+ onClick={() => onSet("do_not_use")}
+ >
+ <Prohibit size={11} weight="bold" />
+ </IconButton>
+ </Tooltip>
+ </Flex>
+ );
+}
+
+interface AccessSectionProps {
+ server: McpGatewayServer;
+ gateway: ReturnType<typeof useGatewayServers>;
+ isAdmin: boolean;
+ onShareWithAgent: () => void;
+ onSetMemberAccess: (
+ userId: number,
+ firstName: string,
+ enabled: boolean,
+ ) => void;
+ onRevokeAgent: (accountId: string, name: string) => void;
+}
+
+function AccessSection({
+ server,
+ gateway,
+ isAdmin,
+ onShareWithAgent,
+ onSetMemberAccess,
+ onRevokeAgent,
+}: AccessSectionProps) {
+ const yourInstallationId = server.your_connection?.installation_id;
+
+ return (
+ <Flex direction="column" gap="2">
+ <Text className="font-medium text-base">Access</Text>
+
+ {isAdmin && (
+ <>
+ <Flex
+ align="center"
+ justify="between"
+ gap="3"
+ className="rounded-md border border-gray-5 bg-gray-2 p-3"
+ >
+ <div>
+ <Text as="div" className="font-medium text-sm">
+ Available to team members
+ </Text>
+ <Text as="div" color="gray" className="text-[13px]">
+ {server.is_team_enabled
+ ? `Members can connect their own ${server.name} account.`
+ : `Turned off — members can't see or call ${server.name}.`}
+ </Text>
+ </div>
+ <Switch
+ checked={server.is_team_enabled}
+ onCheckedChange={(enabled) => {
+ gateway.updateServer(
+ {
+ serverId: server.id,
+ updates: { is_team_enabled: enabled },
+ },
+ {
+ onSuccess: () => {
+ if (enabled)
+ toast.success(`${server.name} enabled for the team`);
+ else toast.info(`${server.name} disabled`);
+ },
+ },
+ );
+ }}
+ />
+ </Flex>
+
+ <Flex align="center" gap="2" mt="1" className="tracking-[0.06em]">
+ <Text
+ color="gray"
+ className="font-medium text-xs uppercase leading-none"
+ >
+ People connected
+ </Text>
+ <Badge color="gray" variant="soft" size="1">
+ {server.connections.length}
+ </Badge>
+ </Flex>
+ {server.connections.length === 0 ? (
+ <Text color="gray" className="px-1 text-[13px] italic">
+ No one has connected yet.
+ </Text>
+ ) : (
+ <div className="overflow-hidden rounded-md border border-gray-5 bg-gray-2">
+ {server.connections.map((connection) => {
+ const isYou = connection.installation_id === yourInstallationId;
+ const accessRevoked = server.revoked_user_ids.includes(
+ connection.user.id,
+ );
+ const usedAgo = formatAgo(connection.last_used_at);
+ return (
+ <Flex
+ key={connection.installation_id}
+ align="center"
+ gap="3"
+ className={`group border-gray-5 border-b px-3 py-2 last:border-b-0 ${
+ accessRevoked ? "bg-gray-2 opacity-60" : ""
+ }`}
+ >
+ <UserAvatar user={connection.user} />
+ <Flex direction="column" className="min-w-0 flex-1">
+ <Flex align="center" gap="2">
+ <Text truncate className="font-medium text-sm">
+ {gatewayUserName(connection.user)}
+ </Text>
+ {isYou && (
+ <Badge
+ color="indigo"
+ variant="soft"
+ size="1"
+ className="px-1 py-0 text-[10px] leading-4"
+ >
+ You
+ </Badge>
+ )}
+ </Flex>
+ <Text color="gray" truncate className="text-xs">
+ {connection.user.email}
+ </Text>
+ </Flex>
+ {!isYou && (
+ <Button
+ variant="ghost"
+ color={accessRevoked ? "gray" : "red"}
+ size="1"
+ className="opacity-0 transition-opacity focus-visible:opacity-100 group-hover:opacity-100"
+ onClick={() =>
+ onSetMemberAccess(
+ connection.user.id,
+ gatewayUserName(connection.user).split(" ")[0],
+ accessRevoked,
+ )
+ }
+ >
+ {accessRevoked ? (
+ <>
+ <Check size={11} /> Restore
+ </>
+ ) : (
+ <>
+ <X size={11} /> Revoke
+ </>
+ )}
+ </Button>
+ )}
+ <Flex align="center" gap="2" className="shrink-0">
+ <span
+ className={`h-[6px] w-[6px] rounded-full ${
+ accessRevoked
+ ? "bg-gray-8"
+ : connection.needs_reauth
+ ? "bg-(--red-9)"
+ : connection.pending_oauth
+ ? "bg-(--amber-9)"
+ : "bg-(--green-9)"
+ }`}
+ />
+ <Text color="gray" className="text-xs">
+ {accessRevoked
+ ? "Access revoked"
+ : connection.needs_reauth
+ ? "Needs reauth"
+ : connection.pending_oauth
+ ? "Finishing setup"
+ : `Connected${usedAgo ? ` · used ${usedAgo}` : ""}`}
+ </Text>
+ </Flex>
+ </Flex>
+ );
+ })}
+ </div>
+ )}
+ </>
+ )}
+
+ <Flex align="center" gap="2" mt="4" className="tracking-[0.06em]">
+ <Text
+ color="gray"
+ className="font-medium text-xs uppercase leading-none"
+ >
+ Agents
+ </Text>
+ <Badge color="gray" variant="soft" size="1">
+ {server.agents.length}
+ </Badge>
+ <Button
+ variant="ghost"
+ color="gray"
+ size="1"
+ className="ml-auto"
+ onClick={onShareWithAgent}
+ >
+ <Plus size={12} /> Share access with an agent
+ </Button>
+ </Flex>
+ {server.agents.length === 0 ? (
+ <Text color="gray" className="px-1 text-[13px] italic">
+ No agents have access. Share a connection available to you and choose
+ which {server.name} tools the agent may call.
+ </Text>
+ ) : (
+ <div className="rounded-md border border-gray-5 bg-gray-2">
+ {server.agents.map((agent) => (
+ <Flex
+ key={agent.service_account_id}
+ align="center"
+ gap="3"
+ className="group border-gray-5 border-b px-3 py-2 last:border-b-0"
+ >
+ <RobotAvatar />
+ <Flex direction="column" className="min-w-0 flex-1">
+ <Text truncate className="font-medium text-sm">
+ {agent.name}
+ </Text>
+ <Text color="gray" truncate className="text-xs">
+ <span className="font-mono">{agent.handle}</span>
+ {agent.granted_by
+ ? ` · shared by ${gatewayUserName(agent.granted_by)}`
+ : " · shared with this agent"}
+ </Text>
+ </Flex>
+ <Button
+ variant="ghost"
+ color="red"
+ size="1"
+ className="opacity-0 transition-opacity focus-visible:opacity-100 group-hover:opacity-100"
+ onClick={() =>
+ onRevokeAgent(agent.service_account_id, agent.name)
+ }
+ >
+ <X size={11} /> Revoke
+ </Button>
+ <Flex align="center" gap="2" className="shrink-0">
+ <span
+ className={`h-[6px] w-[6px] rounded-full ${
+ agent.status === "active" ? "bg-(--green-9)" : "bg-gray-8"
+ }`}
+ />
+ <Text color="gray" className="text-xs">
+ {agent.status === "active"
+ ? `Active${
+ formatAgo(agent.last_active_at)
+ ? ` ${formatAgo(agent.last_active_at)}`
+ : ""
+ }`
+ : "Paused"}
+ </Text>
+ </Flex>
+ </Flex>
+ ))}
+ </div>
+ )}
+ </Flex>
+ );
+}
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayServersHome.tsx b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayServersHome.tsx
new file mode 100644
index 000000000000..193d1b8d8f6e
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayServersHome.tsx
@@ -0,0 +1,480 @@
+import {
+ CaretRight,
+ Check,
+ MagnifyingGlass,
+ Plus,
+ X,
+} from "@phosphor-icons/react";
+import type {
+ McpGatewayServer,
+ McpRecommendedServer,
+} from "@posthog/api-client/posthog-client";
+import { MCP_CATEGORIES } from "@posthog/api-client/posthog-client";
+import {
+ type GatewayConnectCredentials,
+ gatewayConnectAuthType,
+ gatewayConnectNeedsCredentials,
+ templateConnectNeedsCredentials,
+} from "@posthog/core/mcp-gateway/gatewayConnect";
+import {
+ filterCatalogTemplates,
+ filterGatewayServers,
+ getGatewayConnectionStatus,
+} from "@posthog/core/mcp-gateway/gatewayServers";
+import {
+ Empty,
+ EmptyDescription,
+ EmptyHeader,
+ EmptyMedia,
+ EmptyTitle,
+} from "@posthog/quill";
+import {
+ AvatarStack,
+ gatewayUserName,
+} from "@posthog/ui/features/mcp-gateway/components/parts/avatars";
+import { GatewayConnectDialog } from "@posthog/ui/features/mcp-gateway/components/parts/GatewayConnectDialog";
+import type { GatewayRoute } from "@posthog/ui/features/mcp-gateway/gatewayRoute";
+import { useGatewayConfig } from "@posthog/ui/features/mcp-gateway/hooks/useGatewayConfig";
+import { useGatewayServers } from "@posthog/ui/features/mcp-gateway/hooks/useGatewayServers";
+import { ServerIcon } from "@posthog/ui/features/mcp-servers/components/parts/icons";
+import {
+ Badge,
+ Button,
+ Flex,
+ Heading,
+ IconButton,
+ Spinner,
+ Text,
+ TextField,
+ Tooltip,
+} from "@radix-ui/themes";
+import { useMemo, useState } from "react";
+
+interface GatewayServersHomeProps {
+ isAdmin: boolean;
+ canAddServers: boolean;
+ onNavigate: (route: GatewayRoute) => void;
+}
+
+/** A connect that needs credentials first — the dialog's pending target. */
+type ConnectTarget =
+ | { kind: "server"; server: McpGatewayServer }
+ | { kind: "template"; template: McpRecommendedServer };
+
+export function GatewayServersHome({
+ isAdmin,
+ canAddServers,
+ onNavigate,
+}: GatewayServersHomeProps) {
+ const [query, setQuery] = useState("");
+ const [category, setCategory] = useState<string | null>(null);
+ const [connectTarget, setConnectTarget] = useState<ConnectTarget | null>(
+ null,
+ );
+ const {
+ servers,
+ serversLoading,
+ templatesById,
+ recommendedTemplates,
+ connect,
+ connectingServerId,
+ connectTemplate,
+ connectingTemplateId,
+ } = useGatewayServers();
+ const { defaultServersEnabled } = useGatewayConfig();
+
+ // OAuth connects go straight to the browser round-trip; api-key servers and
+ // custom servers (where each member picks a mechanism) ask for credentials.
+ const handleConnectServer = (server: McpGatewayServer) => {
+ if (gatewayConnectNeedsCredentials(server)) {
+ setConnectTarget({ kind: "server", server });
+ } else {
+ connect({ server });
+ }
+ };
+ const handleConnectTemplate = (template: McpRecommendedServer) => {
+ if (templateConnectNeedsCredentials(template)) {
+ setConnectTarget({ kind: "template", template });
+ } else {
+ connectTemplate({ template });
+ }
+ };
+ const handleConnectSubmit = (credentials: GatewayConnectCredentials) => {
+ if (!connectTarget) return;
+ if (connectTarget.kind === "server") {
+ connect({ server: connectTarget.server, credentials });
+ } else {
+ connectTemplate({ template: connectTarget.template, credentials });
+ }
+ setConnectTarget(null);
+ };
+
+ const filtered = useMemo(
+ () => filterGatewayServers(servers, query, category),
+ [servers, query, category],
+ );
+ // Untouched catalog templates render as connect-only cards after the real
+ // rows. When the team default is off, members don't see them at all and
+ // admins see them disabled.
+ const filteredTemplates = useMemo(() => {
+ if (!defaultServersEnabled && !isAdmin) return [];
+ return filterCatalogTemplates(recommendedTemplates, query, category);
+ }, [recommendedTemplates, query, category, defaultServersEnabled, isAdmin]);
+ const totalCount = filtered.length + filteredTemplates.length;
+ const hasFilters = query !== "" || category !== null;
+
+ return (
+ <Flex direction="column" gap="4" className="min-w-0">
+ <Flex align="start" justify="between" gap="3">
+ <Flex direction="column" gap="1" className="min-w-0">
+ <Heading className="font-bold text-2xl">Servers</Heading>
+ <Text color="gray" className="max-w-[560px] text-sm">
+ Browse and connect MCP servers that extend your agent with tools,
+ data and integrations.
+ </Text>
+ </Flex>
+ {canAddServers && (
+ <Button
+ variant="solid"
+ size="2"
+ className="shrink-0"
+ onClick={() => onNavigate({ view: "add" })}
+ >
+ <Plus size={13} weight="bold" /> Add server
+ </Button>
+ )}
+ </Flex>
+
+ <TextField.Root
+ value={query}
+ onChange={(e) => setQuery(e.target.value)}
+ placeholder="Search team servers…"
+ size="2"
+ >
+ <TextField.Slot>
+ <MagnifyingGlass size={14} />
+ </TextField.Slot>
+ {query && (
+ <TextField.Slot>
+ <IconButton
+ variant="ghost"
+ size="1"
+ aria-label="Clear server search"
+ onClick={() => setQuery("")}
+ >
+ <X size={12} />
+ </IconButton>
+ </TextField.Slot>
+ )}
+ </TextField.Root>
+
+ <Flex gap="2" wrap="wrap">
+ {MCP_CATEGORIES.map((entry) => {
+ const id = entry.id === "all" ? null : entry.id;
+ const active = category === id;
+ return (
+ <button
+ key={entry.id}
+ type="button"
+ onClick={() => setCategory(id)}
+ className={`rounded-full border px-3 py-1 text-xs transition-colors ${
+ active
+ ? "border-accent-8 bg-accent-4 text-accent-11"
+ : "border-gray-5 bg-gray-2 text-gray-11 hover:border-gray-7 hover:bg-gray-3"
+ }`}
+ >
+ {entry.label}
+ {active && entry.id !== "all" && (
+ <span className="ml-1 text-gray-11">({totalCount})</span>
+ )}
+ </button>
+ );
+ })}
+ </Flex>
+
+ <Flex align="center" justify="between">
+ <Text color="gray" className="text-[13px]">
+ {totalCount} {totalCount === 1 ? "server" : "servers"}
+ </Text>
+ {hasFilters && (
+ <Button
+ variant="ghost"
+ size="1"
+ color="gray"
+ onClick={() => {
+ setQuery("");
+ setCategory(null);
+ }}
+ >
+ Clear filters
+ </Button>
+ )}
+ </Flex>
+
+ {serversLoading && servers.length === 0 ? (
+ <Flex align="center" justify="center" py="6">
+ <Spinner size="2" />
+ </Flex>
+ ) : totalCount === 0 ? (
+ <Empty className="rounded border border-gray-6 border-dashed py-8">
+ <EmptyHeader>
+ <EmptyMedia variant="icon">
+ <MagnifyingGlass size={28} />
+ </EmptyMedia>
+ <EmptyTitle>No servers match.</EmptyTitle>
+ <EmptyDescription>
+ Try a different search, or ask an admin to add a server.
+ </EmptyDescription>
+ </EmptyHeader>
+ </Empty>
+ ) : (
+ <Flex direction="column" gap="3">
+ {filtered.map((server) => (
+ <GatewayServerCard
+ key={server.id}
+ server={server}
+ template={
+ server.template_id
+ ? templatesById.get(server.template_id)
+ : undefined
+ }
+ isAdmin={isAdmin}
+ connecting={connectingServerId === server.id}
+ onOpen={() => onNavigate({ view: "server", serverId: server.id })}
+ onConnect={() => handleConnectServer(server)}
+ />
+ ))}
+ {filteredTemplates.map((template) => (
+ <RecommendedTemplateCard
+ key={template.id}
+ template={template}
+ disabled={!defaultServersEnabled}
+ connecting={connectingTemplateId === template.id}
+ onConnect={() => handleConnectTemplate(template)}
+ />
+ ))}
+ </Flex>
+ )}
+
+ {connectTarget && (
+ <GatewayConnectDialog
+ key={
+ connectTarget.kind === "server"
+ ? connectTarget.server.id
+ : connectTarget.template.id
+ }
+ open
+ serverName={
+ connectTarget.kind === "server"
+ ? connectTarget.server.name
+ : connectTarget.template.name
+ }
+ fixedAuthType={
+ connectTarget.kind === "server"
+ ? gatewayConnectAuthType(connectTarget.server)
+ : (connectTarget.template.auth_type ?? "oauth")
+ }
+ onSubmit={handleConnectSubmit}
+ onClose={() => setConnectTarget(null)}
+ />
+ )}
+ </Flex>
+ );
+}
+
+function GatewayServerCard({
+ server,
+ template,
+ isAdmin,
+ connecting,
+ onOpen,
+ onConnect,
+}: {
+ server: McpGatewayServer;
+ template: McpRecommendedServer | undefined;
+ isAdmin: boolean;
+ connecting: boolean;
+ onOpen: () => void;
+ onConnect: () => void;
+}) {
+ const off = !server.is_team_enabled;
+ const connectedForYou =
+ !!server.your_connection &&
+ getGatewayConnectionStatus(server.your_connection) === "connected";
+ const needsAuth = !connectedForYou && !off;
+
+ return (
+ <div
+ className={`relative rounded-md border border-gray-5 bg-gray-2 transition-colors hover:border-gray-7 hover:bg-gray-3 ${off ? "opacity-60" : ""}`}
+ >
+ <button
+ type="button"
+ onClick={onOpen}
+ className="grid w-full grid-cols-[36px_1fr] items-center gap-3 rounded-md p-4 pr-[132px] text-left"
+ >
+ <ServerIcon
+ iconDomain={template?.icon_domain}
+ serverUrl={server.url}
+ size={36}
+ />
+ <Flex direction="column" gap="1" className="min-w-0">
+ <Flex align="center" gap="2">
+ <Text truncate className="font-medium text-base">
+ {server.name}
+ </Text>
+ {off ? (
+ <Badge color="gray" variant="soft" size="1">
+ Off
+ </Badge>
+ ) : connectedForYou ? (
+ <Tooltip content="Connected">
+ <span className="flex h-[14px] w-[14px] items-center justify-center rounded-full bg-(--green-9) text-white">
+ <Check size={9} weight="bold" />
+ </span>
+ </Tooltip>
+ ) : null}
+ </Flex>
+ <Text
+ color="gray"
+ style={{
+ display: "-webkit-box",
+ WebkitLineClamp: 2,
+ WebkitBoxOrient: "vertical",
+ }}
+ className="overflow-hidden text-[13px]"
+ >
+ {server.description || server.url}
+ </Text>
+ {isAdmin && <CardPeopleRow server={server} off={off} />}
+ </Flex>
+ </button>
+ <div className="absolute top-4 right-4">
+ {off ? null : needsAuth ? (
+ connecting ? (
+ <Button variant="solid" size="1" disabled>
+ <Spinner size="1" /> Authorizing…
+ </Button>
+ ) : (
+ <Button variant="solid" size="1" onClick={onConnect}>
+ Connect
+ </Button>
+ )
+ ) : (
+ <Button
+ variant="soft"
+ color="gray"
+ size="1"
+ title="Configure"
+ onClick={onOpen}
+ >
+ Configure
+ <CaretRight size={12} />
+ </Button>
+ )}
+ </div>
+ </div>
+ );
+}
+
+/**
+ * A catalog template no one has touched — the registry is sparse, so there is
+ * no gateway row to open or toggle. Connect-only: the install materializes
+ * the row. When the team default is off, it renders disabled (admins only).
+ */
+function RecommendedTemplateCard({
+ template,
+ disabled,
+ connecting,
+ onConnect,
+}: {
+ template: McpRecommendedServer;
+ disabled: boolean;
+ connecting: boolean;
+ onConnect: () => void;
+}) {
+ return (
+ <div
+ className={`relative rounded-md border border-gray-5 bg-gray-2 ${disabled ? "opacity-60" : ""}`}
+ >
+ <div className="grid w-full grid-cols-[36px_1fr] items-center gap-3 rounded-md p-4 pr-[132px]">
+ <ServerIcon
+ iconDomain={template.icon_domain}
+ serverUrl={template.url}
+ size={36}
+ />
+ <Flex direction="column" gap="1" className="min-w-0">
+ <Flex align="center" gap="2">
+ <Text truncate className="font-medium text-base">
+ {template.name}
+ </Text>
+ {disabled && (
+ <Badge color="gray" variant="soft" size="1">
+ Off
+ </Badge>
+ )}
+ </Flex>
+ <Text
+ color="gray"
+ style={{
+ display: "-webkit-box",
+ WebkitLineClamp: 2,
+ WebkitBoxOrient: "vertical",
+ }}
+ className="overflow-hidden text-[13px]"
+ >
+ {template.description || template.url}
+ </Text>
+ {disabled && (
+ <Text color="gray" className="text-xs">
+ Disabled — enable it in Team settings
+ </Text>
+ )}
+ </Flex>
+ </div>
+ <div className="absolute top-4 right-4">
+ {disabled ? null : connecting ? (
+ <Button variant="solid" size="1" disabled>
+ <Spinner size="1" /> Authorizing…
+ </Button>
+ ) : (
+ <Button variant="solid" size="1" onClick={onConnect}>
+ Connect
+ </Button>
+ )}
+ </div>
+ </div>
+ );
+}
+
+function CardPeopleRow({
+ server,
+ off,
+}: {
+ server: McpGatewayServer;
+ off: boolean;
+}) {
+ if (off) {
+ return (
+ <Text color="gray" className="text-xs">
+ Disabled — enable it in Team settings
+ </Text>
+ );
+ }
+ const connections = server.connections;
+ if (connections.length === 0) return null;
+ const agentCount = server.agents.length;
+ const label =
+ connections.length === 1
+ ? `${gatewayUserName(connections[0].user).split(" ")[0]} is connected`
+ : `${connections.length} teammates connected${
+ agentCount ? ` · ${agentCount} agent${agentCount > 1 ? "s" : ""}` : ""
+ }`;
+ return (
+ <Flex align="center" gap="2">
+ <AvatarStack users={connections.map((connection) => connection.user)} />
+ <Text color="gray" className="text-xs">
+ {label}
+ </Text>
+ </Flex>
+ );
+}
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayTeamSettings.test.tsx b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayTeamSettings.test.tsx
new file mode 100644
index 000000000000..00c7170fcf98
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayTeamSettings.test.tsx
@@ -0,0 +1,159 @@
+import type {
+ McpGatewayServer,
+ McpRecommendedServer,
+} from "@posthog/api-client/posthog-client";
+import { Theme } from "@radix-ui/themes";
+import { render, screen } from "@testing-library/react";
+import userEvent from "@testing-library/user-event";
+import { beforeEach, describe, expect, it, vi } from "vitest";
+
+const mocks = vi.hoisted(() => ({
+ servers: [] as McpGatewayServer[],
+ recommendedTemplates: [] as McpRecommendedServer[],
+ defaultServersEnabled: true,
+ updateServer: vi.fn(),
+ setTemplateEnabled: vi.fn(),
+ setAllEnabled: vi.fn(),
+}));
+
+vi.mock("@posthog/ui/features/mcp-gateway/hooks/useGatewayConfig", () => ({
+ useGatewayConfig: () => ({
+ allowCustomServers: true,
+ allowMemberAgentAccess: true,
+ defaultServersEnabled: mocks.defaultServersEnabled,
+ updateSettings: vi.fn(),
+ }),
+}));
+
+vi.mock("@posthog/ui/features/mcp-gateway/hooks/useGatewayServers", () => ({
+ useGatewayServers: () => ({
+ servers: mocks.servers,
+ recommendedTemplates: mocks.recommendedTemplates,
+ updateServer: mocks.updateServer,
+ setTemplateEnabled: mocks.setTemplateEnabled,
+ setAllEnabled: mocks.setAllEnabled,
+ setAllEnabledPending: false,
+ }),
+}));
+
+vi.mock("@posthog/ui/features/mcp-servers/components/parts/icons", () => ({
+ ServerIcon: () => <div aria-hidden="true" />,
+}));
+
+import { GatewayTeamSettings } from "./GatewayTeamSettings";
+
+const server = {
+ id: "server-1",
+ name: "Linear",
+ url: "https://mcp.linear.app",
+ description: "",
+ category: "productivity",
+ is_team_enabled: true,
+ icon_key: "",
+ docs_url: "",
+ template_id: null,
+ template_auth_type: null,
+ tool_count: 0,
+ connections: [],
+ your_connection: null,
+ agents: [],
+ revoked_user_ids: [],
+ is_revoked_for_you: false,
+ created_by: null,
+ created_at: "2026-07-23T12:00:00Z",
+ updated_at: "2026-07-23T12:00:00Z",
+} as McpGatewayServer;
+
+const template = {
+ id: "template-1",
+ name: "Stripe",
+ url: "https://mcp.stripe.com",
+ icon_key: "",
+ icon_domain: "stripe.com",
+} as McpRecommendedServer;
+
+describe("GatewayTeamSettings", () => {
+ beforeEach(() => {
+ vi.clearAllMocks();
+ mocks.servers = [server];
+ mocks.recommendedTemplates = [template];
+ mocks.defaultServersEnabled = true;
+ });
+
+ it("opens a server detail page from the server access list", async () => {
+ const user = userEvent.setup();
+ const onNavigate = vi.fn();
+
+ render(
+ <Theme>
+ <GatewayTeamSettings onNavigate={onNavigate} />
+ </Theme>,
+ );
+
+ await user.click(screen.getByRole("button", { name: /Linear/ }));
+
+ expect(onNavigate).toHaveBeenCalledWith({
+ view: "server",
+ serverId: server.id,
+ });
+ });
+
+ it("counts untouched catalog templates in the merged access list", () => {
+ render(
+ <Theme>
+ <GatewayTeamSettings onNavigate={vi.fn()} />
+ </Theme>,
+ );
+
+ expect(screen.getByText("2 of 2 servers enabled")).toBeInTheDocument();
+ expect(screen.getByText("Stripe")).toBeInTheDocument();
+ });
+
+ it("toggles an untouched template via set_template_enabled, not PATCH", async () => {
+ const user = userEvent.setup();
+
+ render(
+ <Theme>
+ <GatewayTeamSettings onNavigate={vi.fn()} />
+ </Theme>,
+ );
+
+ const switches = screen.getAllByRole("switch");
+ // Rows sort by name: Linear (server) before Stripe (template); the first
+ // two switches are the top-level settings toggles.
+ await user.click(switches[switches.length - 1]);
+
+ expect(mocks.setTemplateEnabled).toHaveBeenCalledWith(
+ { templateId: template.id, enabled: false },
+ expect.anything(),
+ );
+ expect(mocks.updateServer).not.toHaveBeenCalled();
+ });
+
+ it("counts templates as disabled when the team default is off", () => {
+ mocks.defaultServersEnabled = false;
+
+ render(
+ <Theme>
+ <GatewayTeamSettings onNavigate={vi.fn()} />
+ </Theme>,
+ );
+
+ expect(screen.getByText("1 of 2 servers enabled")).toBeInTheDocument();
+ });
+
+ it("uses the bulk endpoint for disable all", async () => {
+ const user = userEvent.setup();
+
+ render(
+ <Theme>
+ <GatewayTeamSettings onNavigate={vi.fn()} />
+ </Theme>,
+ );
+
+ await user.click(screen.getByRole("button", { name: /Disable all/ }));
+
+ expect(mocks.setAllEnabled).toHaveBeenCalledWith(false);
+ expect(mocks.updateServer).not.toHaveBeenCalled();
+ });
+});
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayTeamSettings.tsx b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayTeamSettings.tsx
new file mode 100644
index 000000000000..9d82d416a09a
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayTeamSettings.tsx
@@ -0,0 +1,342 @@
+import { Check, MagnifyingGlass, X } from "@phosphor-icons/react";
+import type {
+ McpGatewayServer,
+ McpRecommendedServer,
+} from "@posthog/api-client/posthog-client";
+import type { GatewayRoute } from "@posthog/ui/features/mcp-gateway/gatewayRoute";
+import { useGatewayConfig } from "@posthog/ui/features/mcp-gateway/hooks/useGatewayConfig";
+import { useGatewayServers } from "@posthog/ui/features/mcp-gateway/hooks/useGatewayServers";
+import { ServerIcon } from "@posthog/ui/features/mcp-servers/components/parts/icons";
+import { toast } from "@posthog/ui/primitives/toast";
+import {
+ Button,
+ Flex,
+ Heading,
+ IconButton,
+ Separator,
+ Switch,
+ Text,
+ TextField,
+} from "@radix-ui/themes";
+import { useMemo, useState } from "react";
+
+const SERVER_PREVIEW_LIMIT = 10;
+
+/**
+ * One row in the server-access list. The registry is sparse: untouched
+ * catalog templates have no gateway row and follow the team default until an
+ * admin toggles them (which materializes a row).
+ */
+type ServerAccessEntry =
+ | { kind: "server"; server: McpGatewayServer }
+ | { kind: "template"; template: McpRecommendedServer };
+
+interface GatewayTeamSettingsProps {
+ onNavigate: (route: GatewayRoute) => void;
+}
+
+/** Admin settings: custom-server gate and server access. */
+export function GatewayTeamSettings({ onNavigate }: GatewayTeamSettingsProps) {
+ const {
+ allowCustomServers,
+ allowMemberAgentAccess,
+ defaultServersEnabled,
+ updateSettings,
+ } = useGatewayConfig();
+ const {
+ servers,
+ recommendedTemplates,
+ templatesById,
+ updateServer,
+ setTemplateEnabled,
+ setAllEnabled,
+ setAllEnabledPending,
+ } = useGatewayServers();
+ const [serverSearch, setServerSearch] = useState("");
+ const [serversExpanded, setServersExpanded] = useState(false);
+
+ const totalCount = servers.length + recommendedTemplates.length;
+ const enabledCount =
+ servers.filter((server) => server.is_team_enabled).length +
+ (defaultServersEnabled ? recommendedTemplates.length : 0);
+ const filteredEntries = useMemo(() => {
+ const search = serverSearch.trim().toLowerCase();
+ const entries: ServerAccessEntry[] = [
+ ...servers.map((server) => ({ kind: "server" as const, server })),
+ ...recommendedTemplates.map((template) => ({
+ kind: "template" as const,
+ template,
+ })),
+ ];
+ const entryName = (entry: ServerAccessEntry) =>
+ entry.kind === "server" ? entry.server.name : entry.template.name;
+ return entries
+ .filter(
+ (entry) => !search || entryName(entry).toLowerCase().includes(search),
+ )
+ .sort((first, second) =>
+ entryName(first).localeCompare(entryName(second), undefined, {
+ sensitivity: "base",
+ }),
+ );
+ }, [serverSearch, servers, recommendedTemplates]);
+ const displayedEntries = serversExpanded
+ ? filteredEntries
+ : filteredEntries.slice(0, SERVER_PREVIEW_LIMIT);
+
+ return (
+ <Flex direction="column" gap="4" className="min-w-0">
+ <Heading className="font-bold text-2xl">Team settings</Heading>
+
+ <Text className="font-medium text-base">Custom servers</Text>
+ <Flex
+ align="center"
+ justify="between"
+ gap="3"
+ className="rounded-md border border-gray-5 bg-gray-2 p-3"
+ >
+ <div>
+ <Text as="div" className="font-medium text-sm">
+ Allow custom servers
+ </Text>
+ <Text as="div" color="gray" className="text-[13px]">
+ Members can add their own MCP servers, the same way admins do.
+ </Text>
+ </div>
+ <Switch
+ checked={allowCustomServers}
+ onCheckedChange={(allowed) =>
+ updateSettings(
+ { allow_custom_servers: allowed },
+ {
+ onSuccess: () => {
+ if (allowed)
+ toast.success("Members can now add custom servers");
+ else toast.info("Custom servers are admin-only again");
+ },
+ },
+ )
+ }
+ />
+ </Flex>
+
+ <Text className="font-medium text-base">Agent access</Text>
+ <Flex
+ align="center"
+ justify="between"
+ gap="3"
+ className="rounded-md border border-gray-5 bg-gray-2 p-3"
+ >
+ <div>
+ <Text as="div" className="font-medium text-sm">
+ Allow members to manage agent access
+ </Text>
+ <Text as="div" color="gray" className="text-[13px]">
+ Members can share connections with agents and choose which tools
+ those agents may call. Turn this off to make those controls
+ admin-only.
+ </Text>
+ </div>
+ <Switch
+ checked={allowMemberAgentAccess}
+ onCheckedChange={(allowed) =>
+ updateSettings(
+ { allow_member_agent_access: allowed },
+ {
+ onSuccess: () => {
+ if (allowed)
+ toast.success("Members can now manage agent access");
+ else toast.info("Agent access is admin-only again");
+ },
+ },
+ )
+ }
+ />
+ </Flex>
+
+ <Separator size="4" />
+
+ <Text className="font-medium text-base">Server access</Text>
+ <Text color="gray" className="text-[13px]">
+ Everything is shared with the team by default. Disable everything to
+ curate up from zero — servers added to the catalog later stay off too —
+ or switch off individual servers.
+ </Text>
+ <Flex align="center" justify="between" gap="2" wrap="wrap">
+ <Text color="gray" className="text-[13px]">
+ {enabledCount} of {totalCount} servers enabled
+ </Text>
+ <Flex align="center" gap="2">
+ <TextField.Root
+ value={serverSearch}
+ onChange={(event) => {
+ setServerSearch(event.target.value);
+ setServersExpanded(false);
+ }}
+ placeholder="Search servers…"
+ size="1"
+ >
+ <TextField.Slot>
+ <MagnifyingGlass size={12} />
+ </TextField.Slot>
+ {serverSearch && (
+ <TextField.Slot>
+ <IconButton
+ variant="ghost"
+ size="1"
+ onClick={() => {
+ setServerSearch("");
+ setServersExpanded(false);
+ }}
+ >
+ <X size={10} />
+ </IconButton>
+ </TextField.Slot>
+ )}
+ </TextField.Root>
+ <Button
+ variant="ghost"
+ color="gray"
+ size="1"
+ disabled={
+ setAllEnabledPending ||
+ (defaultServersEnabled && enabledCount === totalCount)
+ }
+ onClick={() => setAllEnabled(true)}
+ >
+ <Check size={12} /> Enable all
+ </Button>
+ <Button
+ variant="ghost"
+ color="gray"
+ size="1"
+ disabled={
+ setAllEnabledPending ||
+ (!defaultServersEnabled && enabledCount === 0)
+ }
+ onClick={() => setAllEnabled(false)}
+ >
+ <X size={12} /> Disable all
+ </Button>
+ </Flex>
+ </Flex>
+ <div className="overflow-hidden rounded border border-gray-5 bg-gray-2">
+ {displayedEntries.map((entry) =>
+ entry.kind === "server" ? (
+ <Flex
+ key={entry.server.id}
+ align="center"
+ gap="3"
+ className={`border-gray-5 border-b px-3 py-2 last:border-b-0 ${entry.server.is_team_enabled ? "" : "opacity-60"}`}
+ >
+ <button
+ type="button"
+ className="flex min-w-0 flex-1 items-center gap-3 rounded-sm text-left outline-none hover:text-gray-12 focus-visible:ring-(--focus-8) focus-visible:ring-2"
+ onClick={() =>
+ onNavigate({ view: "server", serverId: entry.server.id })
+ }
+ >
+ <ServerIcon
+ iconDomain={
+ entry.server.template_id
+ ? templatesById.get(entry.server.template_id)?.icon_domain
+ : undefined
+ }
+ serverUrl={entry.server.url}
+ size={26}
+ />
+ <Flex direction="column" className="min-w-0 flex-1">
+ <Text truncate className="font-medium text-sm">
+ {entry.server.name}
+ </Text>
+ <Text color="gray" className="text-xs">
+ {entry.server.tool_count}{" "}
+ {entry.server.tool_count === 1 ? "tool" : "tools"}
+ </Text>
+ </Flex>
+ </button>
+ <Switch
+ size="1"
+ checked={entry.server.is_team_enabled}
+ onCheckedChange={(enabled) =>
+ updateServer(
+ {
+ serverId: entry.server.id,
+ updates: { is_team_enabled: enabled },
+ },
+ {
+ onSuccess: () => {
+ if (enabled)
+ toast.success(
+ `${entry.server.name} enabled for the team`,
+ );
+ else toast.info(`${entry.server.name} disabled`);
+ },
+ },
+ )
+ }
+ />
+ </Flex>
+ ) : (
+ // Untouched catalog template: no gateway row, so no detail page.
+ // Toggling it materializes a row via set_template_enabled.
+ <Flex
+ key={entry.template.id}
+ align="center"
+ gap="3"
+ className={`border-gray-5 border-b px-3 py-2 last:border-b-0 ${defaultServersEnabled ? "" : "opacity-60"}`}
+ >
+ <Flex align="center" gap="3" className="min-w-0 flex-1">
+ <ServerIcon
+ iconDomain={entry.template.icon_domain}
+ serverUrl={entry.template.url}
+ size={26}
+ />
+ <Flex direction="column" className="min-w-0 flex-1">
+ <Text truncate className="font-medium text-sm">
+ {entry.template.name}
+ </Text>
+ <Text color="gray" className="text-xs">
+ Catalog server — follows the team default
+ </Text>
+ </Flex>
+ </Flex>
+ <Switch
+ size="1"
+ checked={defaultServersEnabled}
+ onCheckedChange={(enabled) =>
+ setTemplateEnabled(
+ { templateId: entry.template.id, enabled },
+ {
+ onSuccess: () => {
+ if (enabled)
+ toast.success(
+ `${entry.template.name} enabled for the team`,
+ );
+ else toast.info(`${entry.template.name} disabled`);
+ },
+ },
+ )
+ }
+ />
+ </Flex>
+ ),
+ )}
+ {filteredEntries.length === 0 && (
+ <Text color="gray" className="block px-3 py-3 text-[13px] italic">
+ No servers match &ldquo;{serverSearch}&rdquo;.
+ </Text>
+ )}
+ {filteredEntries.length > SERVER_PREVIEW_LIMIT && (
+ <button
+ type="button"
+ className="w-full px-3 py-2 text-center font-medium text-gray-11 text-xs transition-colors hover:bg-gray-3 hover:text-gray-12"
+ onClick={() => setServersExpanded((expanded) => !expanded)}
+ >
+ {serversExpanded ? "View less" : "View more"}
+ </button>
+ )}
+ </div>
+ </Flex>
+ );
+}
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayTeamView.tsx b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayTeamView.tsx
new file mode 100644
index 000000000000..51783bcfa56e
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayTeamView.tsx
@@ -0,0 +1,247 @@
+import { CaretRight, MagnifyingGlass, X } from "@phosphor-icons/react";
+import type {
+ McpGatewayMemberSummary,
+ McpGatewayServer,
+ McpServiceAccount,
+} from "@posthog/api-client/posthog-client";
+import {
+ gatewayUserName,
+ RobotAvatar,
+ UserAvatar,
+} from "@posthog/ui/features/mcp-gateway/components/parts/avatars";
+import type { GatewayRoute } from "@posthog/ui/features/mcp-gateway/gatewayRoute";
+import { useGatewayMembers } from "@posthog/ui/features/mcp-gateway/hooks/useGatewayMembers";
+import { useGatewayServers } from "@posthog/ui/features/mcp-gateway/hooks/useGatewayServers";
+import { useServiceAccounts } from "@posthog/ui/features/mcp-gateway/hooks/useServiceAccounts";
+import {
+ Badge,
+ Flex,
+ Heading,
+ IconButton,
+ Switch,
+ Text,
+ TextField,
+} from "@radix-ui/themes";
+import { useState } from "react";
+
+const MEMBER_PREVIEW_LIMIT = 10;
+
+/** Admin roster: agent service accounts first, then members. */
+export function GatewayTeamView({
+ onNavigate,
+}: {
+ onNavigate: (route: GatewayRoute) => void;
+}) {
+ const { servers } = useGatewayServers();
+ const serviceAccounts = useServiceAccounts();
+ const { members } = useGatewayMembers({ enabled: true });
+ const [memberSearch, setMemberSearch] = useState("");
+ const [membersExpanded, setMembersExpanded] = useState(false);
+ const normalizedMemberSearch = memberSearch.trim().toLowerCase();
+ const filteredMembers = normalizedMemberSearch
+ ? members.filter((member) => {
+ const name = gatewayUserName(member.user).toLowerCase();
+ const email = member.user.email?.toLowerCase() ?? "";
+ return (
+ name.includes(normalizedMemberSearch) ||
+ email.includes(normalizedMemberSearch)
+ );
+ })
+ : members;
+ const displayedMembers = membersExpanded
+ ? filteredMembers
+ : filteredMembers.slice(0, MEMBER_PREVIEW_LIMIT);
+
+ return (
+ <Flex direction="column" gap="4" className="min-w-0">
+ <Flex direction="column" gap="1">
+ <Heading className="font-bold text-2xl">Team & agents</Heading>
+ <Text color="gray" className="max-w-[560px] text-sm">
+ Control access for your team members and PostHog agents.
+ </Text>
+ </Flex>
+
+ <Flex align="center" gap="2">
+ <Text className="font-medium text-base">Agents</Text>
+ <Badge color="gray" variant="soft" size="1">
+ {serviceAccounts.accounts.length}
+ </Badge>
+ </Flex>
+ <Flex direction="column" gap="2">
+ {serviceAccounts.accounts.map((account) => (
+ <AgentCard
+ key={account.id}
+ account={account}
+ servers={servers}
+ onOpen={() => onNavigate({ view: "agent", accountId: account.id })}
+ onToggleStatus={(paused) =>
+ serviceAccounts.setStatus({
+ accountId: account.id,
+ name: account.name,
+ status: paused ? "paused" : "active",
+ })
+ }
+ />
+ ))}
+ {serviceAccounts.accounts.length === 0 && (
+ <Text color="gray" className="px-1 text-[13px]">
+ No agents yet.
+ </Text>
+ )}
+ </Flex>
+
+ <Flex align="center" gap="2" mt="2">
+ <Text className="font-medium text-base">Members</Text>
+ <Badge color="gray" variant="soft" size="1">
+ {members.length}
+ </Badge>
+ </Flex>
+ <TextField.Root
+ value={memberSearch}
+ onChange={(event) => {
+ setMemberSearch(event.target.value);
+ setMembersExpanded(false);
+ }}
+ placeholder="Search members..."
+ size="2"
+ >
+ <TextField.Slot>
+ <MagnifyingGlass size={14} />
+ </TextField.Slot>
+ {memberSearch && (
+ <TextField.Slot>
+ <IconButton
+ variant="ghost"
+ size="1"
+ aria-label="Clear member search"
+ onClick={() => {
+ setMemberSearch("");
+ setMembersExpanded(false);
+ }}
+ >
+ <X size={12} />
+ </IconButton>
+ </TextField.Slot>
+ )}
+ </TextField.Root>
+ <div className="overflow-hidden rounded border border-gray-5 bg-gray-2">
+ {displayedMembers.map((member) => (
+ <MemberRow
+ key={member.user.id}
+ member={member}
+ serverCount={servers.length}
+ onOpen={() =>
+ onNavigate({ view: "member", userId: member.user.id })
+ }
+ />
+ ))}
+ {members.length === 0 && (
+ <Text color="gray" className="block px-3 py-3 text-[13px] italic">
+ No members found.
+ </Text>
+ )}
+ {members.length > 0 && filteredMembers.length === 0 && (
+ <Text color="gray" className="block px-3 py-3 text-[13px]">
+ No members match &ldquo;{memberSearch}&rdquo;
+ </Text>
+ )}
+ {filteredMembers.length > MEMBER_PREVIEW_LIMIT && (
+ <button
+ type="button"
+ className="w-full px-3 py-2 text-center font-medium text-gray-11 text-xs transition-colors hover:bg-gray-3 hover:text-gray-12"
+ onClick={() => setMembersExpanded((expanded) => !expanded)}
+ >
+ {membersExpanded ? "View less" : "View more"}
+ </button>
+ )}
+ </div>
+ </Flex>
+ );
+}
+function AgentCard({
+ account,
+ servers,
+ onOpen,
+ onToggleStatus,
+}: {
+ account: McpServiceAccount;
+ servers: McpGatewayServer[];
+ onOpen: () => void;
+ onToggleStatus: (paused: boolean) => void;
+}) {
+ const active = account.status === "active";
+ const toolCount = servers
+ .filter((server) => account.server_ids.includes(server.id))
+ .reduce((total, server) => total + server.tool_count, 0);
+
+ return (
+ <div className="relative rounded-md border border-gray-5 bg-gray-2 transition-colors hover:border-gray-7 hover:bg-gray-3">
+ <button
+ type="button"
+ onClick={onOpen}
+ className="grid w-full grid-cols-[40px_1fr] items-center rounded-md p-4 pr-[180px] text-left"
+ >
+ <RobotAvatar size="md" />
+ <Flex direction="column" className="min-w-0">
+ <Text truncate className="font-medium text-sm">
+ {account.name}
+ </Text>
+ <Text color="gray" className="text-xs">
+ {account.server_ids.length} server
+ {account.server_ids.length === 1 ? "" : "s"} · {toolCount} tools
+ </Text>
+ </Flex>
+ </button>
+ <div className="-translate-y-1/2 absolute top-1/2 right-3 flex flex-col items-end gap-1">
+ <Switch
+ size="1"
+ checked={active}
+ onCheckedChange={(checked) => onToggleStatus(!checked)}
+ />
+ {!active && (
+ <Text color="gray" className="text-[11px]">
+ Paused — all access off
+ </Text>
+ )}
+ </div>
+ </div>
+ );
+}
+
+function MemberRow({
+ member,
+ serverCount,
+ onOpen,
+}: {
+ member: McpGatewayMemberSummary;
+ serverCount: number;
+ onOpen: () => void;
+}) {
+ const allowed = serverCount - member.revoked_server_ids.length;
+ const connected = member.connected_server_ids.length;
+ return (
+ <button
+ type="button"
+ onClick={onOpen}
+ className="grid w-full grid-cols-[26px_1fr_auto_auto_auto] items-center gap-3 border-gray-5 border-b px-3 py-2 text-left transition-colors last:border-b-0 hover:bg-gray-3"
+ >
+ <UserAvatar user={member.user} />
+ <Flex direction="column" className="min-w-0">
+ <Text truncate className="font-medium text-sm">
+ {gatewayUserName(member.user)}
+ </Text>
+ <Text color="gray" truncate className="text-xs">
+ {member.user.email}
+ </Text>
+ </Flex>
+ <Text color="gray" className="text-xs">
+ {member.is_org_admin ? "admin" : "member"}
+ </Text>
+ <Text color="gray" className="text-xs">
+ {allowed} of {serverCount} servers
+ {connected ? ` · ${connected} connected` : ""}
+ </Text>
+ <CaretRight size={12} className="text-gray-10" />
+ </button>
+ );
+}
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayToolRow.test.tsx b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayToolRow.test.tsx
new file mode 100644
index 000000000000..300dcb73f192
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayToolRow.test.tsx
@@ -0,0 +1,131 @@
+import type { McpResolvedToolPolicy } from "@posthog/api-client/posthog-client";
+import { Theme } from "@radix-ui/themes";
+import { render, screen } from "@testing-library/react";
+import userEvent from "@testing-library/user-event";
+import { describe, expect, it, vi } from "vitest";
+import { GatewayToolRow } from "./GatewayToolRow";
+
+const policy: McpResolvedToolPolicy = {
+ tool_name: "search_items",
+ description:
+ "Search the catalog for matching items.\n\n- Match by title\n- Match by description",
+ input_schema: {
+ type: "object",
+ properties: {
+ query: { type: "string" },
+ },
+ required: ["query"],
+ },
+ policy_state: "needs_approval",
+ team_state: null,
+ locked: false,
+ decided_by: "default",
+ rule_name: "",
+ rule_description: "",
+};
+
+describe("GatewayToolRow", () => {
+ it("shows separate description and input schema sections when expanded", async () => {
+ const user = userEvent.setup();
+ const { container } = render(
+ <Theme>
+ <GatewayToolRow policy={policy} editable onChange={vi.fn()} />
+ </Theme>,
+ );
+
+ await user.click(screen.getByRole("button", { name: /search_items/i }));
+
+ expect(screen.getByText("Description")).toBeInTheDocument();
+ expect(screen.getByText("Input schema")).toBeInTheDocument();
+ expect(container.querySelector(".whitespace-pre-wrap")).toHaveTextContent(
+ "Search the catalog for matching items. - Match by title - Match by description",
+ );
+ expect(container.querySelector("pre")?.textContent).toBe(
+ JSON.stringify(policy.input_schema, null, 2),
+ );
+ });
+
+ it("shows the team-admin badge and only disables states above the ceiling", async () => {
+ const user = userEvent.setup();
+ const onChange = vi.fn();
+ render(
+ <Theme>
+ <GatewayToolRow
+ policy={{
+ ...policy,
+ policy_state: "needs_approval",
+ team_state: "needs_approval",
+ decided_by: "team",
+ }}
+ editable
+ onChange={onChange}
+ />
+ </Theme>,
+ );
+
+ expect(screen.getByText("Set by team admin")).toBeInTheDocument();
+ expect(screen.getByRole("radio", { name: "Always Allow" })).toBeDisabled();
+ expect(screen.getByRole("radio", { name: "Needs Approval" })).toBeEnabled();
+ expect(screen.getByRole("radio", { name: "Blocked" })).toBeEnabled();
+
+ await user.click(screen.getByRole("radio", { name: "Blocked" }));
+ expect(onChange).toHaveBeenCalledWith("do_not_use");
+ });
+
+ it("uses the exact approval names", () => {
+ render(
+ <Theme>
+ <GatewayToolRow policy={policy} editable onChange={vi.fn()} />
+ </Theme>,
+ );
+
+ expect(
+ screen.getByRole("radio", { name: "Always Allow" }),
+ ).toBeInTheDocument();
+ expect(
+ screen.getByRole("radio", { name: "Needs Approval" }),
+ ).toBeInTheDocument();
+ expect(screen.getByRole("radio", { name: "Blocked" })).toBeInTheDocument();
+ });
+
+ it("removes approval from agent settings and treats legacy approval as blocked", () => {
+ render(
+ <Theme>
+ <GatewayToolRow
+ policy={policy}
+ editable
+ agentScope
+ onChange={vi.fn()}
+ />
+ </Theme>,
+ );
+
+ expect(
+ screen.getByRole("radio", { name: "Always Allow" }),
+ ).toBeInTheDocument();
+ expect(
+ screen.queryByRole("radio", { name: "Needs Approval" }),
+ ).not.toBeInTheDocument();
+ expect(screen.getByRole("radio", { name: "Blocked" })).toBeChecked();
+ });
+
+ it("lets an admin raise the team ceiling while editing the team scope", () => {
+ render(
+ <Theme>
+ <GatewayToolRow
+ policy={{
+ ...policy,
+ team_state: "needs_approval",
+ decided_by: "team",
+ }}
+ editable
+ teamScope
+ onChange={vi.fn()}
+ />
+ </Theme>,
+ );
+
+ expect(screen.queryByText("Set by team admin")).not.toBeInTheDocument();
+ expect(screen.getByRole("radio", { name: "Always Allow" })).toBeEnabled();
+ });
+});
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayToolRow.tsx b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayToolRow.tsx
new file mode 100644
index 000000000000..15ef87c7bac6
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayToolRow.tsx
@@ -0,0 +1,174 @@
+import { CaretDown, CaretRight, Lock } from "@phosphor-icons/react";
+import type {
+ McpApprovalState,
+ McpResolvedToolPolicy,
+} from "@posthog/api-client/posthog-client";
+import {
+ AGENT_POLICY_STATES,
+ isPolicyStateAllowedByCeiling,
+ resolvePolicyStateForScope,
+} from "@posthog/core/mcp-gateway/gatewayServers";
+import { ToolPolicyToggle } from "@posthog/ui/features/mcp-servers/components/parts/ToolPolicyToggle";
+import { Badge, Flex, Text, Tooltip } from "@radix-ui/themes";
+import { useState } from "react";
+
+interface GatewayToolRowProps {
+ policy: McpResolvedToolPolicy;
+ editable: boolean;
+ teamScope?: boolean;
+ agentScope?: boolean;
+ onChange: (state: McpApprovalState) => void;
+}
+
+/**
+ * One expandable tool row: name, description, and the policy control —
+ * replaced by a locked pill when an org rule decided the state, or a lock
+ * badge + read-only toggle when the admin baseline did.
+ */
+export function GatewayToolRow({
+ policy,
+ editable,
+ teamScope = false,
+ agentScope = false,
+ onChange,
+}: GatewayToolRowProps) {
+ const [open, setOpen] = useState(false);
+ const hasDescription = !!policy.description?.trim();
+ const ruleLocked = policy.locked && policy.decided_by === "rule";
+ const setByTeamAdmin =
+ !teamScope &&
+ (policy.decided_by === "team" || policy.decided_by === "preset");
+ const displayState = resolvePolicyStateForScope(
+ policy.policy_state,
+ agentScope ? "agent" : teamScope ? "team" : "member",
+ );
+ const blocked = displayState === "do_not_use";
+ const disabledStates: Partial<Record<McpApprovalState, string>> = {};
+ for (const state of ["approved", "needs_approval", "do_not_use"] as const) {
+ if (
+ !teamScope &&
+ !isPolicyStateAllowedByCeiling(state, policy.team_state)
+ ) {
+ disabledStates[state] = "Unavailable because of the team admin ceiling";
+ }
+ }
+
+ return (
+ <div className="rounded border border-border bg-gray-2 transition-colors">
+ <div className="flex w-full min-w-0 items-center gap-3 px-3 py-2">
+ <button
+ type="button"
+ onClick={() => setOpen((value) => !value)}
+ className="flex min-w-0 flex-1 items-center gap-3 text-left"
+ aria-expanded={open}
+ >
+ {open ? (
+ <CaretDown
+ size={12}
+ weight="bold"
+ className="shrink-0 text-gray-10"
+ />
+ ) : (
+ <CaretRight
+ size={12}
+ weight="bold"
+ className="shrink-0 text-gray-10"
+ />
+ )}
+ <div className="flex min-w-0 flex-1 flex-col">
+ <Text
+ truncate
+ className="select-text font-medium text-sm"
+ onMouseDown={(event) => event.stopPropagation()}
+ onClick={(event) => event.stopPropagation()}
+ >
+ {policy.tool_name}
+ </Text>
+ <Text
+ color="gray"
+ truncate
+ style={{ fontStyle: hasDescription ? undefined : "italic" }}
+ className="text-[13px]"
+ >
+ {hasDescription ? policy.description : "No description provided"}
+ </Text>
+ </div>
+ </button>
+ <div className="shrink-0">
+ {ruleLocked ? (
+ <Tooltip
+ content={`${policy.rule_name} — team rule, overrides every scope.`}
+ >
+ <Badge color="gray" variant="soft" size="1">
+ <Lock size={11} />
+ {blocked
+ ? "Blocked by team policy"
+ : "Needs Approval by team policy"}
+ </Badge>
+ </Tooltip>
+ ) : (
+ <Flex align="center" gap="2">
+ {setByTeamAdmin && (
+ <Tooltip content="This effective state is capped by the team admin ceiling.">
+ <Badge color="gray" variant="soft" size="1">
+ <Lock size={11} /> Set by team admin
+ </Badge>
+ </Tooltip>
+ )}
+ <ToolPolicyToggle
+ value={displayState}
+ onChange={onChange}
+ disabled={!editable}
+ disabledStates={disabledStates}
+ allowedStates={agentScope ? AGENT_POLICY_STATES : undefined}
+ />
+ </Flex>
+ )}
+ </div>
+ </div>
+ {open && (
+ <div className="border-gray-5 border-t bg-gray-2 px-3 py-3">
+ <Flex direction="column" gap="3">
+ <Flex direction="column" gap="1">
+ <Text color="gray" className="font-medium text-[13px]">
+ Description
+ </Text>
+ <Text
+ className={
+ hasDescription
+ ? "whitespace-pre-wrap text-sm"
+ : "whitespace-pre-wrap text-gray-10 text-sm italic"
+ }
+ >
+ {hasDescription
+ ? policy.description
+ : "No description provided."}
+ </Text>
+ </Flex>
+ <Flex direction="column" gap="1">
+ <Text color="gray" className="font-medium text-[13px]">
+ Input schema
+ </Text>
+ <pre className="overflow-x-auto rounded bg-gray-3 p-2 text-xs">
+ {JSON.stringify(policy.input_schema ?? {}, null, 2)}
+ </pre>
+ </Flex>
+ {ruleLocked && (
+ <Flex direction="column" gap="1">
+ <Text color="gray" className="font-medium text-[13px]">
+ Applied rule
+ </Text>
+ <Text className="text-sm">
+ <span className="font-semibold">{policy.rule_name}</span>
+ {policy.rule_description
+ ? ` — ${policy.rule_description}`
+ : ""}
+ </Text>
+ </Flex>
+ )}
+ </Flex>
+ </div>
+ )}
+ </div>
+ );
+}
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GiveAccessDialog.test.tsx b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GiveAccessDialog.test.tsx
new file mode 100644
index 000000000000..117de6095ced
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GiveAccessDialog.test.tsx
@@ -0,0 +1,201 @@
+import type {
+ McpGatewayServer,
+ McpResolvedToolPolicy,
+ McpServiceAccount,
+} from "@posthog/api-client/posthog-client";
+import { Theme } from "@radix-ui/themes";
+import { fireEvent, render, screen } from "@testing-library/react";
+import userEvent from "@testing-library/user-event";
+import { describe, expect, it, vi } from "vitest";
+import { GiveAccessDialog } from "./GiveAccessDialog";
+
+Element.prototype.scrollIntoView = vi.fn();
+
+const server: McpGatewayServer = {
+ id: "server-1",
+ name: "Notion",
+ url: "https://mcp.notion.com",
+ description: "Notion MCP",
+ category: "productivity",
+ is_team_enabled: true,
+ icon_key: "notion",
+ docs_url: "",
+ template_id: "template-1",
+ template_auth_type: null,
+ tool_count: 0,
+ connections: [],
+ your_connection: null,
+ agents: [],
+ revoked_user_ids: [],
+ is_revoked_for_you: false,
+ created_by: null,
+ created_at: "2026-07-23T12:00:00Z",
+ updated_at: "2026-07-23T12:00:00Z",
+};
+
+const account: McpServiceAccount = {
+ id: "agent-1",
+ name: "Support agent",
+ description: "",
+ handle: "posthog-support",
+ status: "active",
+ token_mask: "",
+ server_ids: [],
+ last_active_at: null,
+ created_at: "2026-07-23T12:00:00Z",
+ updated_at: "2026-07-23T12:00:00Z",
+};
+
+const toolPolicy: McpResolvedToolPolicy = {
+ tool_name: "search_pages",
+ description: "",
+ input_schema: {},
+ policy_state: "needs_approval",
+ team_state: null,
+ locked: false,
+ decided_by: "default",
+ rule_name: "",
+ rule_description: "",
+};
+
+const secondAccount: McpServiceAccount = {
+ ...account,
+ id: "agent-2",
+ name: "Docs agent",
+ handle: "posthog-docs",
+};
+
+describe("GiveAccessDialog", () => {
+ it("only offers allow or block when configuring an agent", async () => {
+ const user = userEvent.setup();
+ render(
+ <Theme>
+ <GiveAccessDialog
+ open
+ server={server}
+ accounts={[account]}
+ toolPolicies={[toolPolicy]}
+ pending={false}
+ onClose={vi.fn()}
+ onGrant={vi.fn()}
+ />
+ </Theme>,
+ );
+
+ screen.getByRole("combobox").focus();
+ await user.keyboard("{ArrowDown}{Enter}");
+
+ expect(
+ screen.getByRole("radio", { name: "Always Allow" }),
+ ).toBeInTheDocument();
+ expect(
+ screen.queryByRole("radio", { name: "Needs Approval" }),
+ ).not.toBeInTheDocument();
+ expect(screen.getByRole("radio", { name: "Blocked" })).toBeInTheDocument();
+ });
+
+ it("resets the agent and policy overrides when the dialog closes", async () => {
+ const user = userEvent.setup();
+ const view = render(
+ <Theme>
+ <GiveAccessDialog
+ open
+ server={server}
+ accounts={[account]}
+ toolPolicies={[toolPolicy]}
+ pending={false}
+ onClose={vi.fn()}
+ onGrant={vi.fn()}
+ />
+ </Theme>,
+ );
+
+ screen.getByRole("combobox").focus();
+ await user.keyboard("{ArrowDown}{Enter}");
+ await user.click(screen.getByRole("radio", { name: "Blocked" }));
+ expect(screen.getByRole("radio", { name: "Blocked" })).toBeChecked();
+
+ const rerenderDialog = (open: boolean) =>
+ view.rerender(
+ <Theme>
+ <GiveAccessDialog
+ open={open}
+ server={server}
+ accounts={[account]}
+ toolPolicies={[toolPolicy]}
+ pending={false}
+ onClose={vi.fn()}
+ onGrant={vi.fn()}
+ />
+ </Theme>,
+ );
+ rerenderDialog(false);
+ rerenderDialog(true);
+
+ expect(screen.getByRole("combobox")).toHaveTextContent("Choose an agent…");
+ expect(screen.queryAllByRole("radio")).toHaveLength(0);
+
+ screen.getByRole("combobox").focus();
+ await user.keyboard("{ArrowDown}{Enter}");
+ expect(screen.getByRole("radio", { name: "Blocked" })).not.toBeChecked();
+ expect(screen.getByRole("radio", { name: "Always Allow" })).toBeChecked();
+ });
+
+ it("does not carry one agent's policy overrides over to another agent", async () => {
+ const user = userEvent.setup();
+ const onGrant = vi.fn();
+ render(
+ <Theme>
+ <GiveAccessDialog
+ open
+ server={server}
+ accounts={[account, secondAccount]}
+ toolPolicies={[toolPolicy]}
+ pending={false}
+ onClose={vi.fn()}
+ onGrant={onGrant}
+ />
+ </Theme>,
+ );
+
+ screen.getByRole("combobox").focus();
+ await user.keyboard("{ArrowDown}{Enter}");
+ await user.click(screen.getByRole("radio", { name: "Blocked" }));
+ expect(screen.getByRole("radio", { name: "Blocked" })).toBeChecked();
+
+ screen.getByRole("combobox").focus();
+ await user.keyboard("{ArrowDown}{ArrowDown}{Enter}");
+
+ expect(screen.getByRole("radio", { name: "Blocked" })).not.toBeChecked();
+ await user.click(screen.getByRole("button", { name: "Share access" }));
+ expect(onGrant).toHaveBeenCalledWith("agent-2", [
+ { tool_name: "search_pages", policy_state: "approved" },
+ ]);
+ });
+
+ it("shows a spinner and prevents closing while access is being shared", () => {
+ const onClose = vi.fn();
+ render(
+ <Theme>
+ <GiveAccessDialog
+ open
+ server={server}
+ accounts={[account]}
+ toolPolicies={[]}
+ pending
+ onClose={onClose}
+ onGrant={vi.fn()}
+ />
+ </Theme>,
+ );
+
+ const shareButton = screen.getByRole("button", { name: "Share access" });
+ expect(shareButton).toBeDisabled();
+ expect(shareButton.querySelector(".rt-Spinner")).toBeInTheDocument();
+ expect(screen.getByRole("button", { name: "Cancel" })).toBeDisabled();
+
+ fireEvent.keyDown(document, { key: "Escape" });
+ expect(onClose).not.toHaveBeenCalled();
+ expect(screen.getByRole("dialog")).toBeInTheDocument();
+ });
+});
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GiveAccessDialog.tsx b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GiveAccessDialog.tsx
new file mode 100644
index 000000000000..0b57ddf96775
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GiveAccessDialog.tsx
@@ -0,0 +1,240 @@
+import { Check, Prohibit } from "@phosphor-icons/react";
+import type {
+ McpGatewayServer,
+ McpResolvedToolPolicy,
+ McpServiceAccount,
+ McpToolPolicyEntry,
+} from "@posthog/api-client/posthog-client";
+import {
+ AGENT_POLICY_STATES,
+ type AgentPolicyState,
+ defaultAgentGrantPolicy,
+ isAgentPolicyState,
+} from "@posthog/core/mcp-gateway/gatewayServers";
+import { RobotAvatar } from "@posthog/ui/features/mcp-gateway/components/parts/avatars";
+import { ToolPolicyToggle } from "@posthog/ui/features/mcp-servers/components/parts/ToolPolicyToggle";
+import {
+ Badge,
+ Button,
+ Dialog,
+ Flex,
+ IconButton,
+ Select,
+ Text,
+ Tooltip,
+} from "@radix-ui/themes";
+import { useMemo, useState } from "react";
+
+interface GiveAccessDialogProps {
+ open: boolean;
+ server: McpGatewayServer;
+ /** Every service account; ones that already have access are filtered out. */
+ accounts: McpServiceAccount[];
+ /** Team-scope rows, used for tool names and rule locks. */
+ toolPolicies: McpResolvedToolPolicy[];
+ pending: boolean;
+ onClose: () => void;
+ onGrant: (accountId: string, policies: McpToolPolicyEntry[]) => void;
+}
+
+/** "Share <server> with an agent" — agent picker plus per-tool starting policies. */
+export function GiveAccessDialog(props: GiveAccessDialogProps) {
+ return (
+ <GiveAccessDialogDraft key={props.open ? "open" : "closed"} {...props} />
+ );
+}
+
+function GiveAccessDialogDraft({
+ open,
+ server,
+ accounts,
+ toolPolicies,
+ pending,
+ onClose,
+ onGrant,
+}: GiveAccessDialogProps) {
+ const [selectedId, setSelectedId] = useState<string | null>(null);
+ const [policyMap, setPolicyMap] = useState<Record<string, AgentPolicyState>>(
+ {},
+ );
+
+ const selectAgent = (accountId: string) => {
+ setSelectedId(accountId);
+ setPolicyMap({});
+ };
+
+ const available = useMemo(() => {
+ const withAccess = new Set(
+ server.agents.map((agent) => agent.service_account_id),
+ );
+ return accounts.filter((account) => !withAccess.has(account.id));
+ }, [accounts, server.agents]);
+
+ const selected = available.find((account) => account.id === selectedId);
+
+ const policyFor = (toolName: string): AgentPolicyState =>
+ policyMap[toolName] ?? defaultAgentGrantPolicy(toolName);
+
+ const setToolPolicy = (toolName: string, state: AgentPolicyState) =>
+ setPolicyMap((map) => ({ ...map, [toolName]: state }));
+
+ const bulkSet = (state: AgentPolicyState) =>
+ setPolicyMap((map) => {
+ const next = { ...map };
+ for (const policy of toolPolicies) {
+ if (policy.decided_by !== "rule") next[policy.tool_name] = state;
+ }
+ return next;
+ });
+
+ const grant = () => {
+ if (!selected) return;
+ const policies = toolPolicies
+ .filter((policy) => policy.decided_by !== "rule")
+ .map((policy) => ({
+ tool_name: policy.tool_name,
+ policy_state: policyFor(policy.tool_name),
+ }));
+ onGrant(selected.id, policies);
+ };
+
+ return (
+ <Dialog.Root
+ open={open}
+ onOpenChange={(next) => {
+ if (!next && !pending) onClose();
+ }}
+ >
+ <Dialog.Content maxWidth="440px">
+ <Dialog.Title>Share {server.name} with an agent</Dialog.Title>
+ <Dialog.Description color="gray" className="text-sm">
+ The agent uses a connection available to you and calls {server.name}{" "}
+ under the tool policies you set below.
+ </Dialog.Description>
+
+ <Flex direction="column" gap="3" mt="4">
+ <Select.Root
+ value={selectedId ?? undefined}
+ onValueChange={selectAgent}
+ disabled={pending}
+ >
+ <Select.Trigger placeholder="Choose an agent…" />
+ <Select.Content>
+ {available.map((account) => (
+ <Select.Item key={account.id} value={account.id}>
+ {account.name}{" "}
+ <span className="font-mono text-xs">{account.handle}</span>
+ {account.status === "paused" ? " (paused)" : ""}
+ </Select.Item>
+ ))}
+ {available.length === 0 && (
+ <Text color="gray" className="block px-3 py-2 text-sm italic">
+ Every agent already has access to {server.name}.
+ </Text>
+ )}
+ </Select.Content>
+ </Select.Root>
+
+ {selected && (
+ <Flex direction="column" gap="2">
+ <Flex align="center" justify="between">
+ <Flex align="center" gap="2">
+ <RobotAvatar size="sm" />
+ <Text
+ color="gray"
+ className="font-medium text-[10px] uppercase tracking-[0.06em]"
+ >
+ Tool policy for {selected.name}
+ </Text>
+ </Flex>
+ <Flex align="center" gap="1">
+ <Text color="gray" className="text-xs">
+ Set all
+ </Text>
+ <Tooltip content="Always Allow all">
+ <IconButton
+ variant="soft"
+ color="green"
+ size="1"
+ disabled={pending}
+ onClick={() => bulkSet("approved")}
+ >
+ <Check size={11} weight="bold" />
+ </IconButton>
+ </Tooltip>
+ <Tooltip content="Block all">
+ <IconButton
+ variant="soft"
+ color="red"
+ size="1"
+ disabled={pending}
+ onClick={() => bulkSet("do_not_use")}
+ >
+ <Prohibit size={11} weight="bold" />
+ </IconButton>
+ </Tooltip>
+ </Flex>
+ </Flex>
+ <div className="max-h-[280px] overflow-y-auto rounded border border-gray-5">
+ {toolPolicies.map((policy) => (
+ <Flex
+ key={policy.tool_name}
+ align="center"
+ justify="between"
+ gap="3"
+ className="border-gray-5 border-b px-3 py-1.5 last:border-b-0"
+ >
+ <Text truncate className="text-[12.5px]">
+ {policy.tool_name}
+ </Text>
+ {policy.decided_by === "rule" ? (
+ <Badge color="gray" variant="soft" size="1">
+ Blocked by team policy
+ </Badge>
+ ) : (
+ <ToolPolicyToggle
+ value={policyFor(policy.tool_name)}
+ disabled={pending}
+ allowedStates={AGENT_POLICY_STATES}
+ onChange={(state) => {
+ if (isAgentPolicyState(state)) {
+ setToolPolicy(policy.tool_name, state);
+ }
+ }}
+ />
+ )}
+ </Flex>
+ ))}
+ {toolPolicies.length === 0 && (
+ <Text color="gray" className="block px-3 py-2 text-sm italic">
+ No tools discovered yet — the agent gets access as soon as
+ tools appear.
+ </Text>
+ )}
+ </div>
+ </Flex>
+ )}
+ </Flex>
+
+ <Flex gap="3" mt="4" justify="end">
+ <Button
+ variant="soft"
+ color="gray"
+ disabled={pending}
+ onClick={onClose}
+ >
+ Cancel
+ </Button>
+ <Button
+ variant="solid"
+ disabled={!selected || pending}
+ loading={pending}
+ onClick={grant}
+ >
+ <Check size={12} weight="bold" /> Share access
+ </Button>
+ </Flex>
+ </Dialog.Content>
+ </Dialog.Root>
+ );
+}
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/NewTokenDialog.tsx b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/NewTokenDialog.tsx
new file mode 100644
index 000000000000..434a784eb96e
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/NewTokenDialog.tsx
@@ -0,0 +1,75 @@
+import { Check, Copy } from "@phosphor-icons/react";
+import type { McpServiceAccountWithToken } from "@posthog/api-client/posthog-client";
+import {
+ Button,
+ Callout,
+ Dialog,
+ Flex,
+ IconButton,
+ Text,
+} from "@radix-ui/themes";
+import { useState } from "react";
+
+/** Shows a freshly-issued gateway token exactly once (creation or rotation). */
+export function NewTokenDialog({
+ account,
+ onClose,
+}: {
+ account: McpServiceAccountWithToken | null;
+ onClose: () => void;
+}) {
+ const [copied, setCopied] = useState(false);
+
+ const copy = async () => {
+ if (!account) return;
+ await navigator.clipboard.writeText(account.token);
+ setCopied(true);
+ setTimeout(() => setCopied(false), 1500);
+ };
+
+ return (
+ <Dialog.Root
+ open={!!account}
+ onOpenChange={(next) => {
+ if (!next) onClose();
+ }}
+ >
+ <Dialog.Content maxWidth="440px">
+ <Dialog.Title>
+ Gateway token for {account?.name ?? "agent"}
+ </Dialog.Title>
+ <Flex direction="column" gap="3">
+ <Callout.Root color="amber" size="1">
+ <Callout.Text>
+ Copy this token now — it's shown only once. The agent
+ authenticates with it as a bearer token.
+ </Callout.Text>
+ </Callout.Root>
+ <Flex
+ align="center"
+ gap="2"
+ className="rounded border border-gray-5 bg-gray-2 px-3 py-2"
+ >
+ <Text className="min-w-0 flex-1 break-all font-mono text-[12.5px]">
+ {account?.token}
+ </Text>
+ <IconButton
+ variant="ghost"
+ color="gray"
+ size="1"
+ title="Copy token"
+ onClick={copy}
+ >
+ {copied ? <Check size={13} /> : <Copy size={13} />}
+ </IconButton>
+ </Flex>
+ </Flex>
+ <Flex justify="end" mt="4">
+ <Button variant="solid" onClick={onClose}>
+ Done
+ </Button>
+ </Flex>
+ </Dialog.Content>
+ </Dialog.Root>
+ );
+}
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/avatars.tsx b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/avatars.tsx
new file mode 100644
index 000000000000..017e5f0da752
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/avatars.tsx
@@ -0,0 +1,137 @@
+import { Robot } from "@phosphor-icons/react";
+import type { McpGatewayUser } from "@posthog/api-client/posthog-client";
+import { Avatar, Flex } from "@radix-ui/themes";
+
+export function gatewayUserName(user: McpGatewayUser): string {
+ const name = [user.first_name, user.last_name]
+ .filter(Boolean)
+ .join(" ")
+ .trim();
+ return name || user.email;
+}
+
+function initialsOf(user: McpGatewayUser): string {
+ const parts = [user.first_name, user.last_name].filter(
+ (part): part is string => !!part,
+ );
+ if (parts.length) {
+ return parts
+ .map((part) => part[0])
+ .join("")
+ .slice(0, 2)
+ .toUpperCase();
+ }
+ return user.email.slice(0, 2).toUpperCase();
+}
+
+const USER_AVATAR_COLORS = [
+ "amber",
+ "blue",
+ "cyan",
+ "green",
+ "indigo",
+ "orange",
+ "pink",
+ "purple",
+ "teal",
+] as const;
+
+// Keep a stable color for each member while staying inside the Radix theme
+// palette rather than synthesizing colors outside the design system.
+function avatarColorOf(
+ user: McpGatewayUser,
+): (typeof USER_AVATAR_COLORS)[number] {
+ const seed = user.uuid || user.email;
+ let hash = 0;
+ for (let i = 0; i < seed.length; i++) {
+ hash = (hash * 31 + seed.charCodeAt(i)) | 0;
+ }
+ return (
+ USER_AVATAR_COLORS[(hash >>> 0) % USER_AVATAR_COLORS.length] ?? "amber"
+ );
+}
+
+const AVATAR_SIZES = {
+ sm: { radix: "1", pixels: 20 },
+ md: { radix: "2", pixels: 26 },
+ lg: { radix: "3", pixels: 40 },
+} as const;
+
+export function UserAvatar({
+ user,
+ size = "md",
+ className,
+}: {
+ user: McpGatewayUser;
+ size?: keyof typeof AVATAR_SIZES;
+ className?: string;
+}) {
+ const avatarSize = AVATAR_SIZES[size];
+ return (
+ <Avatar
+ fallback={initialsOf(user)}
+ color={avatarColorOf(user)}
+ radius="full"
+ size={avatarSize.radix}
+ title={gatewayUserName(user)}
+ className={`shrink-0 font-semibold ${className ?? ""}`}
+ style={{
+ width: avatarSize.pixels,
+ height: avatarSize.pixels,
+ fontSize: Math.round(avatarSize.pixels * 0.38),
+ }}
+ />
+ );
+}
+
+export function RobotAvatar({
+ size = "md",
+ className,
+}: {
+ size?: keyof typeof AVATAR_SIZES;
+ className?: string;
+}) {
+ const avatarSize = AVATAR_SIZES[size];
+ return (
+ <Avatar
+ fallback={<Robot size={Math.round(avatarSize.pixels * 0.62)} />}
+ color="gray"
+ radius="medium"
+ size={avatarSize.radix}
+ className={`shrink-0 ${className ?? ""}`}
+ style={{ width: avatarSize.pixels, height: avatarSize.pixels }}
+ />
+ );
+}
+
+export function AvatarStack({
+ users,
+ max = 4,
+}: {
+ users: McpGatewayUser[];
+ max?: number;
+}) {
+ const shown = users.slice(0, max);
+ const extra = users.length - shown.length;
+ return (
+ <Flex align="center" className="-space-x-1">
+ {shown.map((user) => (
+ <UserAvatar
+ key={user.uuid || user.email}
+ user={user}
+ size="sm"
+ className="ring-(--gray-1) ring-1"
+ />
+ ))}
+ {extra > 0 && (
+ <Flex
+ align="center"
+ justify="center"
+ className="h-[20px] w-[20px] shrink-0 rounded-full bg-gray-4 font-medium text-[9px] text-gray-11 ring-(--gray-1) ring-1"
+ >
+ +{extra}
+ </Flex>
+ )}
+ </Flex>
+ );
+}
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/gatewayRoute.ts b/products/desktop/packages/ui/src/features/mcp-gateway/gatewayRoute.ts
new file mode 100644
index 000000000000..d630bd36cd1e
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/gatewayRoute.ts
@@ -0,0 +1,30 @@
+import type { GatewayPolicyScope } from "@posthog/ui/features/mcp-gateway/hooks/gatewayKeys";
+
+/** In-page navigation state for the gateway scene (single flat route). */
+export type GatewayRoute =
+ | { view: "servers" }
+ | { view: "server"; serverId: string; scope?: GatewayPolicyScope }
+ | { view: "add" }
+ | { view: "team" }
+ | { view: "agent"; accountId: string }
+ | { view: "member"; userId: number }
+ | { view: "settings" }
+ | { view: "audit" };
+
+const ADMIN_ONLY_VIEWS: GatewayRoute["view"][] = [
+ "team",
+ "agent",
+ "member",
+ "settings",
+ "audit",
+];
+
+/** Keep the route inside what the caller's role may see. */
+export function isRouteAllowed(
+ route: GatewayRoute,
+ options: { isAdmin: boolean; canAddServers: boolean },
+): boolean {
+ if (ADMIN_ONLY_VIEWS.includes(route.view)) return options.isAdmin;
+ if (route.view === "add") return options.canAddServers;
+ return true;
+}
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/hooks/gatewayKeys.ts b/products/desktop/packages/ui/src/features/mcp-gateway/hooks/gatewayKeys.ts
new file mode 100644
index 000000000000..f12a1f726c70
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/hooks/gatewayKeys.ts
@@ -0,0 +1,57 @@
+import type { McpAuditQuickFilter } from "@posthog/api-client/posthog-client";
+
+/** Scope a tool-policy query resolves against. */
+export interface GatewayPolicyScope {
+ scopeType: "team" | "member" | "agent";
+ /** Member scope target; omitted means the requesting user. */
+ scopeUserId?: number;
+ scopeServiceAccountId?: string;
+ /** Display label for the scope pill ("Team default", "You", agent name…). */
+ label: string;
+}
+
+export const TEAM_SCOPE: GatewayPolicyScope = {
+ scopeType: "team",
+ label: "Team default",
+};
+
+export const YOU_SCOPE: GatewayPolicyScope = {
+ scopeType: "member",
+ label: "You",
+};
+
+function scopeKey(scope: GatewayPolicyScope): string {
+ return [
+ scope.scopeType,
+ scope.scopeUserId ?? "",
+ scope.scopeServiceAccountId ?? "",
+ ].join(":");
+}
+
+// Keyed under the legacy ["mcp", ...] root so the shell's focus-refresh
+// invalidation covers gateway data too.
+export const gatewayKeys = {
+ all: ["mcp", "gateway"] as const,
+ config: ["mcp", "gateway", "config"] as const,
+ servers: ["mcp", "gateway", "servers"] as const,
+ serverTools: (serverId: string) =>
+ ["mcp", "gateway", "servers", serverId, "tools"] as const,
+ tools: (serverId: string, scope: GatewayPolicyScope) =>
+ ["mcp", "gateway", "servers", serverId, "tools", scopeKey(scope)] as const,
+ accounts: ["mcp", "gateway", "accounts"] as const,
+ members: ["mcp", "gateway", "members"] as const,
+ audit: (options: {
+ quickFilter: McpAuditQuickFilter;
+ actorServiceAccountId?: string;
+ page?: number;
+ }) =>
+ [
+ "mcp",
+ "gateway",
+ "audit",
+ options.quickFilter,
+ options.actorServiceAccountId ?? "",
+ options.page ?? 0,
+ ] as const,
+ auditCounts: ["mcp", "gateway", "audit", "counts"] as const,
+};
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/hooks/useGatewayAudit.ts b/products/desktop/packages/ui/src/features/mcp-gateway/hooks/useGatewayAudit.ts
new file mode 100644
index 000000000000..e31b0fc8eef1
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/hooks/useGatewayAudit.ts
@@ -0,0 +1,55 @@
+import type { McpAuditQuickFilter } from "@posthog/api-client/posthog-client";
+import { gatewayKeys } from "@posthog/ui/features/mcp-gateway/hooks/gatewayKeys";
+import { useAuthenticatedQuery } from "@posthog/ui/hooks/useAuthenticatedQuery";
+import { keepPreviousData } from "@tanstack/react-query";
+
+export const AUDIT_PAGE_SIZE = 10;
+
+/** One page of the gateway audit log plus the quick-filter counts. */
+export function useGatewayAudit(options: {
+ quickFilter: McpAuditQuickFilter;
+ actorServiceAccountId?: string;
+ page: number;
+ enabled?: boolean;
+}) {
+ const { data: pageData, isLoading } = useAuthenticatedQuery(
+ gatewayKeys.audit(options),
+ (client) =>
+ client.getMcpGatewayAuditEvents({
+ quickFilter: options.quickFilter,
+ actorServiceAccountId: options.actorServiceAccountId,
+ limit: AUDIT_PAGE_SIZE,
+ offset: options.page * AUDIT_PAGE_SIZE,
+ }),
+ { enabled: options.enabled ?? true, placeholderData: keepPreviousData },
+ );
+
+ const { data: counts } = useAuthenticatedQuery(
+ gatewayKeys.auditCounts,
+ (client) => client.getMcpGatewayAuditCounts(),
+ { enabled: options.enabled ?? true },
+ );
+
+ return {
+ events: pageData?.results ?? [],
+ totalCount: pageData?.count ?? 0,
+ auditLoading: isLoading,
+ counts: counts ?? null,
+ };
+}
+
+/** Recent calls for one agent (service-account detail's history table). */
+export function useAgentRecentCalls(accountId: string) {
+ const { data, isLoading } = useAuthenticatedQuery(
+ gatewayKeys.audit({
+ quickFilter: "all",
+ actorServiceAccountId: accountId,
+ }),
+ (client) =>
+ client.getMcpGatewayAuditEvents({
+ actorServiceAccountId: accountId,
+ limit: 50,
+ }),
+ );
+ return { events: data?.results ?? [], eventsLoading: isLoading };
+}
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/hooks/useGatewayConfig.ts b/products/desktop/packages/ui/src/features/mcp-gateway/hooks/useGatewayConfig.ts
new file mode 100644
index 000000000000..9e7afdc80160
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/hooks/useGatewayConfig.ts
@@ -0,0 +1,45 @@
+import type { TeamMcpGatewayConfigUpdate } from "@posthog/api-client/posthog-client";
+import { gatewayKeys } from "@posthog/ui/features/mcp-gateway/hooks/gatewayKeys";
+import { useAuthenticatedMutation } from "@posthog/ui/hooks/useAuthenticatedMutation";
+import { useAuthenticatedQuery } from "@posthog/ui/hooks/useAuthenticatedQuery";
+import { toast } from "@posthog/ui/primitives/toast";
+import { useQueryClient } from "@tanstack/react-query";
+import { useCallback } from "react";
+
+/** Team gateway settings plus the caller's role, with the admin mutations. */
+export function useGatewayConfig() {
+ const queryClient = useQueryClient();
+
+ const { data: config, isLoading } = useAuthenticatedQuery(
+ gatewayKeys.config,
+ (client) => client.getMcpGatewayConfig(),
+ );
+
+ const invalidate = useCallback(() => {
+ queryClient.invalidateQueries({ queryKey: gatewayKeys.config });
+ }, [queryClient]);
+
+ const updateSettingsMutation = useAuthenticatedMutation(
+ (client, update: TeamMcpGatewayConfigUpdate) =>
+ client.updateMcpGatewaySettings(update),
+ {
+ onSuccess: invalidate,
+ onError: (error: Error) =>
+ toast.error(error.message || "Failed to update gateway settings"),
+ },
+ );
+
+ return {
+ config,
+ configLoading: isLoading,
+ isAdmin: config?.is_admin ?? false,
+ allowCustomServers: config?.allow_custom_servers ?? true,
+ allowMemberAgentAccess: config?.allow_member_agent_access ?? true,
+ /** Whether untouched (row-less) catalog servers are enabled for the team. */
+ defaultServersEnabled: config?.default_servers_enabled ?? true,
+ canManageAgentAccess:
+ (config?.is_admin ?? false) ||
+ (config?.allow_member_agent_access ?? true),
+ updateSettings: updateSettingsMutation.mutate,
+ };
+}
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/hooks/useGatewayMembers.test.tsx b/products/desktop/packages/ui/src/features/mcp-gateway/hooks/useGatewayMembers.test.tsx
new file mode 100644
index 000000000000..e0291f08ed28
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/hooks/useGatewayMembers.test.tsx
@@ -0,0 +1,124 @@
+import type {
+ McpGatewayMemberSummary,
+ McpGatewayServer,
+} from "@posthog/api-client/posthog-client";
+import { gatewayKeys } from "@posthog/ui/features/mcp-gateway/hooks/gatewayKeys";
+import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
+import { act, renderHook, waitFor } from "@testing-library/react";
+import type { ReactNode } from "react";
+import { beforeEach, describe, expect, it, vi } from "vitest";
+
+const mocks = vi.hoisted(() => ({
+ getMembers: vi.fn(),
+ setMemberAccess: vi.fn(),
+ successToast: vi.fn(),
+ infoToast: vi.fn(),
+}));
+
+vi.mock("@posthog/ui/features/auth/authClient", () => ({
+ useOptionalAuthenticatedClient: () => ({
+ getMcpGatewayMembers: mocks.getMembers,
+ setMcpGatewayMemberAccess: mocks.setMemberAccess,
+ }),
+}));
+
+vi.mock("@posthog/ui/primitives/toast", () => ({
+ toast: {
+ error: vi.fn(),
+ success: mocks.successToast,
+ info: mocks.infoToast,
+ },
+}));
+
+import { useGatewayMembers } from "./useGatewayMembers";
+
+const member = {
+ user: {
+ id: 7,
+ uuid: "user-7",
+ first_name: "Ada",
+ last_name: "Lovelace",
+ email: "[email protected]",
+ hedgehog_config: null,
+ },
+ is_org_admin: false,
+ connected_server_ids: ["server-1"],
+ revoked_server_ids: [],
+} as McpGatewayMemberSummary;
+
+const server = {
+ id: "server-1",
+ revoked_user_ids: [],
+} as unknown as McpGatewayServer;
+
+let queryClient: QueryClient;
+
+function wrapper({ children }: { children: ReactNode }) {
+ return (
+ <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
+ );
+}
+
+describe("useGatewayMembers", () => {
+ beforeEach(() => {
+ vi.clearAllMocks();
+ queryClient = new QueryClient({
+ defaultOptions: { queries: { retry: false } },
+ });
+ mocks.getMembers.mockResolvedValue([member]);
+ mocks.setMemberAccess.mockResolvedValue(undefined);
+ });
+
+ it("updates member and server access caches without a stale refetch", async () => {
+ queryClient.setQueryData(gatewayKeys.servers, [server]);
+ const { result } = renderHook(() => useGatewayMembers({ enabled: true }), {
+ wrapper,
+ });
+
+ await waitFor(() => expect(result.current.members).toEqual([member]));
+
+ act(() => {
+ result.current.setMemberAccess({
+ userId: member.user.id,
+ serverId: server.id,
+ enabled: false,
+ successMessage: "Ada can no longer use Linear",
+ });
+ });
+
+ await waitFor(() =>
+ expect(result.current.members[0]?.revoked_server_ids).toEqual([
+ server.id,
+ ]),
+ );
+
+ expect(
+ queryClient.getQueryData<McpGatewayServer[]>(gatewayKeys.servers)?.[0]
+ ?.revoked_user_ids,
+ ).toEqual([member.user.id]);
+ expect(mocks.getMembers).toHaveBeenCalledTimes(1);
+ expect(mocks.infoToast).toHaveBeenCalledWith(
+ "Ada can no longer use Linear",
+ );
+
+ act(() => {
+ result.current.setMemberAccess({
+ userId: member.user.id,
+ serverId: server.id,
+ enabled: true,
+ successMessage: "Ada can now use Linear",
+ });
+ });
+
+ await waitFor(() =>
+ expect(result.current.members[0]?.revoked_server_ids).toEqual([]),
+ );
+
+ expect(
+ queryClient.getQueryData<McpGatewayServer[]>(gatewayKeys.servers)?.[0]
+ ?.revoked_user_ids,
+ ).toEqual([]);
+ expect(mocks.getMembers).toHaveBeenCalledTimes(1);
+ expect(mocks.successToast).toHaveBeenCalledWith("Ada can now use Linear");
+ });
+});
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/hooks/useGatewayMembers.ts b/products/desktop/packages/ui/src/features/mcp-gateway/hooks/useGatewayMembers.ts
new file mode 100644
index 000000000000..1676d19c14b3
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/hooks/useGatewayMembers.ts
@@ -0,0 +1,97 @@
+import type {
+ McpGatewayMemberSummary,
+ McpGatewayServer,
+} from "@posthog/api-client/posthog-client";
+import { gatewayKeys } from "@posthog/ui/features/mcp-gateway/hooks/gatewayKeys";
+import { useAuthenticatedMutation } from "@posthog/ui/hooks/useAuthenticatedMutation";
+import { useAuthenticatedQuery } from "@posthog/ui/hooks/useAuthenticatedQuery";
+import { toast } from "@posthog/ui/primitives/toast";
+import { useQueryClient } from "@tanstack/react-query";
+
+function setIdEnabled<T extends string | number>(
+ ids: readonly T[],
+ id: T,
+ enabled: boolean,
+): T[] {
+ if (enabled) return ids.filter((entry) => entry !== id);
+ return ids.includes(id) ? [...ids] : [...ids, id];
+}
+
+/** Admin overview of members plus the per-member server kill switch. */
+export function useGatewayMembers(options: { enabled: boolean }) {
+ const queryClient = useQueryClient();
+
+ const { data: members, isLoading } = useAuthenticatedQuery(
+ gatewayKeys.members,
+ (client) => client.getMcpGatewayMembers(),
+ { enabled: options.enabled },
+ );
+
+ const setAccessMutation = useAuthenticatedMutation(
+ (
+ client,
+ vars: {
+ userId: number;
+ serverId: string;
+ enabled: boolean;
+ /** Toast copy, e.g. "Jonah can now use Forge". */
+ successMessage?: string;
+ },
+ ) =>
+ client.setMcpGatewayMemberAccess(vars.userId, {
+ gateway_server_id: vars.serverId,
+ enabled: vars.enabled,
+ }),
+ {
+ onSuccess: (_data, vars) => {
+ // The endpoint has no response body, so apply the known change to
+ // both access views. An immediate refetch can briefly return the old
+ // access snapshot and make a successful revoke appear to do nothing.
+ queryClient.setQueryData<McpGatewayMemberSummary[]>(
+ gatewayKeys.members,
+ (current) =>
+ current?.map((member) =>
+ member.user.id === vars.userId
+ ? {
+ ...member,
+ revoked_server_ids: setIdEnabled(
+ member.revoked_server_ids,
+ vars.serverId,
+ vars.enabled,
+ ),
+ }
+ : member,
+ ),
+ );
+ queryClient.setQueryData<McpGatewayServer[]>(
+ gatewayKeys.servers,
+ (current) =>
+ current?.map((server) =>
+ server.id === vars.serverId
+ ? {
+ ...server,
+ revoked_user_ids: setIdEnabled(
+ server.revoked_user_ids,
+ vars.userId,
+ vars.enabled,
+ ),
+ }
+ : server,
+ ),
+ );
+ if (vars.successMessage) {
+ if (vars.enabled) toast.success(vars.successMessage);
+ else toast.info(vars.successMessage);
+ }
+ },
+ onError: (error: Error) =>
+ toast.error(error.message || "Failed to update member access"),
+ },
+ );
+
+ return {
+ members: members ?? [],
+ membersLoading: isLoading,
+ setMemberAccess: setAccessMutation.mutate,
+ };
+}
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/hooks/useGatewayServers.ts b/products/desktop/packages/ui/src/features/mcp-gateway/hooks/useGatewayServers.ts
new file mode 100644
index 000000000000..d738ae7cdfc6
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/hooks/useGatewayServers.ts
@@ -0,0 +1,310 @@
+import type {
+ McpGatewayServer,
+ McpGatewayServerUpdate,
+ McpRecommendedServer,
+} from "@posthog/api-client/posthog-client";
+import {
+ connectGatewayServer,
+ type GatewayConnectCredentials,
+} from "@posthog/core/mcp-gateway/gatewayConnect";
+import { recommendedCatalogTemplates } from "@posthog/core/mcp-gateway/gatewayServers";
+import {
+ discoverGatewayTools,
+ type GatewayServerMatch,
+} from "@posthog/core/mcp-gateway/gatewayToolDiscovery";
+import { reauthorizeWithOAuth } from "@posthog/core/mcp-servers/installFlow";
+import { useHostTRPC, useHostTRPCClient } from "@posthog/host-router/react";
+import { gatewayKeys } from "@posthog/ui/features/mcp-gateway/hooks/gatewayKeys";
+import {
+ createOAuthCallback,
+ mcpKeys,
+} from "@posthog/ui/features/mcp-server-manager/useMcpConnect";
+import { useAuthenticatedMutation } from "@posthog/ui/hooks/useAuthenticatedMutation";
+import { useAuthenticatedQuery } from "@posthog/ui/hooks/useAuthenticatedQuery";
+import { toast } from "@posthog/ui/primitives/toast";
+import { useQueryClient } from "@tanstack/react-query";
+import { useSubscription } from "@trpc/tanstack-react-query";
+import { useCallback, useMemo } from "react";
+
+/**
+ * The team's gateway server registry plus every server-level mutation:
+ * connect/disconnect the caller's own credential, the member self-switch, and
+ * the admin controls (team enable, personal connections, remove).
+ */
+export function useGatewayServers() {
+ const trpc = useHostTRPC();
+ const trpcClient = useHostTRPCClient();
+ const oauth = useMemo(() => createOAuthCallback(trpcClient), [trpcClient]);
+ const queryClient = useQueryClient();
+
+ const { data: servers, isLoading: serversLoading } = useAuthenticatedQuery(
+ gatewayKeys.servers,
+ (client) => client.getMcpGatewayServers(),
+ );
+
+ // Catalog templates: brand icon domains for gateway rows, plus the
+ // connect-only "recommended" cards for templates with no gateway row.
+ const { data: templates } = useAuthenticatedQuery(mcpKeys.servers, (client) =>
+ client.getMcpServers(),
+ );
+ const templatesById = useMemo(() => {
+ const map = new Map<string, McpRecommendedServer>();
+ for (const template of templates ?? []) map.set(template.id, template);
+ return map;
+ }, [templates]);
+
+ // The registry is sparse — untouched catalog templates have no row.
+ const recommendedTemplates = useMemo(
+ () => recommendedCatalogTemplates(servers ?? [], templates ?? []),
+ [servers, templates],
+ );
+
+ const invalidateServers = useCallback(() => {
+ queryClient.invalidateQueries({ queryKey: gatewayKeys.servers });
+ // Connections are installation rows, so the legacy surfaces change too.
+ queryClient.invalidateQueries({ queryKey: mcpKeys.installations });
+ }, [queryClient]);
+
+ // Connecting stores a credential but discovers nothing, so a server's first
+ // connection has to list the upstream tools itself — otherwise the registry
+ // row sits at zero tools until an admin hits the manual refresh.
+ const discoverToolsMutation = useAuthenticatedMutation(
+ (client, match: GatewayServerMatch) => discoverGatewayTools(client, match),
+ {
+ onSuccess: (result) => {
+ if (!result.discovered || !result.serverId) return;
+ queryClient.invalidateQueries({
+ queryKey: gatewayKeys.serverTools(result.serverId),
+ });
+ queryClient.invalidateQueries({ queryKey: gatewayKeys.servers });
+ },
+ // A failed listing must not read as a failed connect. The detail page
+ // still shows its empty state and retries on mount.
+ onError: () => {},
+ },
+ );
+ const discoverTools = discoverToolsMutation.mutate;
+
+ // Credentials come from the connect dialog: custom servers have no fixed
+ // auth mechanism (each member chooses), api-key templates need the key.
+ // Plain OAuth connects pass none and default to the browser round-trip.
+ const connectMutation = useAuthenticatedMutation(
+ (
+ client,
+ vars: {
+ server: McpGatewayServer;
+ credentials?: GatewayConnectCredentials;
+ },
+ ) => connectGatewayServer(client, oauth, vars.server, vars.credentials),
+ {
+ onSuccess: (data, vars) => {
+ if (data && "success" in data && data.success) {
+ toast.success(`Authenticated with ${vars.server.name} as you`);
+ discoverTools({ serverId: vars.server.id });
+ } else if (data && "error" in data && data.error) {
+ toast.error(data.error);
+ }
+ invalidateServers();
+ },
+ onError: (error: Error, vars) => {
+ toast.error(
+ error.message || `Could not connect to ${vars.server.name}`,
+ );
+ invalidateServers();
+ },
+ },
+ );
+
+ const reconnectMutation = useAuthenticatedMutation(
+ (client, vars: { installationId: string; serverName: string }) =>
+ reauthorizeWithOAuth(client, oauth, vars.installationId),
+ {
+ onSuccess: (data, vars) => {
+ if (data && "success" in data && data.success) {
+ toast.success(`Authenticated with ${vars.serverName} as you`);
+ discoverTools({ installationId: vars.installationId });
+ } else if (data && "error" in data && data.error) {
+ toast.error(data.error);
+ }
+ invalidateServers();
+ },
+ onError: (error: Error) =>
+ toast.error(error.message || "Failed to reconnect"),
+ },
+ );
+
+ const disconnectMutation = useAuthenticatedMutation(
+ (
+ client,
+ vars: {
+ installationId: string;
+ serverName: string;
+ action?: "delete" | "disconnect";
+ },
+ ) => client.uninstallMcpServer(vars.installationId),
+ {
+ onSuccess: (_data, vars) => {
+ toast.info(
+ vars.action === "delete"
+ ? `${vars.serverName} deleted for you`
+ : `Disconnected from ${vars.serverName}`,
+ );
+ invalidateServers();
+ },
+ onError: (error: Error, vars) =>
+ toast.error(
+ error.message ||
+ (vars.action === "delete"
+ ? "Failed to delete server"
+ : "Failed to disconnect"),
+ ),
+ },
+ );
+
+ // Member self-switch on their own connection ("Disabled for you").
+ const toggleYourConnectionMutation = useAuthenticatedMutation(
+ (client, vars: { installationId: string; enabled: boolean }) =>
+ client.updateMcpServerInstallation(vars.installationId, {
+ is_enabled: vars.enabled,
+ }),
+ {
+ onSuccess: invalidateServers,
+ onError: (error: Error) =>
+ toast.error(error.message || "Failed to update server"),
+ },
+ );
+
+ // Connect to a catalog template that has no gateway row yet; the backend
+ // materializes the row as part of the install. API-key templates carry the
+ // member's key from the connect dialog.
+ const connectTemplateMutation = useAuthenticatedMutation(
+ (
+ client,
+ vars: {
+ template: McpRecommendedServer;
+ credentials?: GatewayConnectCredentials;
+ },
+ ) =>
+ connectGatewayServer(
+ client,
+ oauth,
+ {
+ template_id: vars.template.id,
+ name: vars.template.name,
+ url: vars.template.url,
+ description: vars.template.description ?? "",
+ },
+ vars.credentials,
+ ),
+ {
+ onSuccess: (data, vars) => {
+ if (data && "success" in data && data.success) {
+ toast.success(`Authenticated with ${vars.template.name} as you`);
+ discoverTools({
+ templateId: vars.template.id,
+ url: vars.template.url,
+ });
+ } else if (data && "error" in data && data.error) {
+ toast.error(data.error);
+ }
+ invalidateServers();
+ },
+ onError: (error: Error, vars) => {
+ toast.error(
+ error.message || `Could not connect to ${vars.template.name}`,
+ );
+ invalidateServers();
+ },
+ },
+ );
+
+ const updateServerMutation = useAuthenticatedMutation(
+ (client, vars: { serverId: string; updates: McpGatewayServerUpdate }) =>
+ client.updateMcpGatewayServer(vars.serverId, vars.updates),
+ {
+ onSuccess: invalidateServers,
+ onError: (error: Error) =>
+ toast.error(error.message || "Failed to update server"),
+ },
+ );
+
+ // Admin: enable/disable an untouched catalog template, materializing (or
+ // updating) its gateway row.
+ const setTemplateEnabledMutation = useAuthenticatedMutation(
+ (client, vars: { templateId: string; enabled: boolean }) =>
+ client.setMcpGatewayTemplateEnabled(vars),
+ {
+ onSuccess: invalidateServers,
+ onError: (error: Error) =>
+ toast.error(error.message || "Failed to update server"),
+ },
+ );
+
+ // One call sets the posture for untouched (and future) catalog servers and
+ // bulk-applies the same state to every existing row.
+ const setAllEnabledMutation = useAuthenticatedMutation(
+ (client, enabled: boolean) =>
+ client.setAllMcpGatewayServersEnabled(enabled),
+ {
+ onSuccess: (_config, enabled) => {
+ invalidateServers();
+ queryClient.invalidateQueries({ queryKey: gatewayKeys.config });
+ if (enabled) {
+ toast.success("Every server is enabled for the team");
+ } else {
+ toast.info("All servers disabled — new catalog servers stay off too");
+ }
+ },
+ onError: (error: Error) =>
+ toast.error(error.message || "Failed to update servers"),
+ },
+ );
+
+ const removeServerMutation = useAuthenticatedMutation(
+ (client, vars: { serverId: string; serverName: string }) =>
+ client.deleteMcpGatewayServer(vars.serverId),
+ {
+ onSuccess: (_data, vars) => {
+ toast.info(`${vars.serverName} deleted for everyone`);
+ invalidateServers();
+ },
+ onError: (error: Error) =>
+ toast.error(error.message || "Failed to remove server"),
+ },
+ );
+
+ useSubscription(
+ trpc.mcpCallback.onOAuthComplete.subscriptionOptions(undefined, {
+ onData: (data) => {
+ if (data.status === "success") invalidateServers();
+ },
+ }),
+ );
+
+ return {
+ servers: servers ?? [],
+ serversLoading,
+ templatesById,
+ recommendedTemplates,
+ invalidateServers,
+ connect: connectMutation.mutate,
+ connectingServerId: connectMutation.isPending
+ ? (connectMutation.variables?.server.id ?? null)
+ : null,
+ connectTemplate: connectTemplateMutation.mutate,
+ connectingTemplateId: connectTemplateMutation.isPending
+ ? (connectTemplateMutation.variables?.template.id ?? null)
+ : null,
+ reconnect: reconnectMutation.mutate,
+ reconnectPending: reconnectMutation.isPending,
+ disconnect: disconnectMutation.mutate,
+ disconnectPending: disconnectMutation.isPending,
+ toggleYourConnection: toggleYourConnectionMutation.mutate,
+ updateServer: updateServerMutation.mutate,
+ setTemplateEnabled: setTemplateEnabledMutation.mutate,
+ setAllEnabled: setAllEnabledMutation.mutate,
+ setAllEnabledPending: setAllEnabledMutation.isPending,
+ removeServer: removeServerMutation.mutate,
+ removeServerPending: removeServerMutation.isPending,
+ };
+}
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/hooks/useGatewayToolPolicies.test.tsx b/products/desktop/packages/ui/src/features/mcp-gateway/hooks/useGatewayToolPolicies.test.tsx
new file mode 100644
index 000000000000..4df5ad8aa03a
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/hooks/useGatewayToolPolicies.test.tsx
@@ -0,0 +1,181 @@
+import type { McpResolvedToolPolicy } from "@posthog/api-client/posthog-client";
+import {
+ gatewayKeys,
+ TEAM_SCOPE,
+ YOU_SCOPE,
+} from "@posthog/ui/features/mcp-gateway/hooks/gatewayKeys";
+import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
+import { act, renderHook, waitFor } from "@testing-library/react";
+import type { ReactNode } from "react";
+import { beforeEach, describe, expect, it, vi } from "vitest";
+
+const mocks = vi.hoisted(() => ({
+ getPolicies: vi.fn(),
+ upsertPolicies: vi.fn(),
+ refreshTools: vi.fn(),
+}));
+
+vi.mock("@posthog/ui/features/auth/authClient", () => ({
+ useOptionalAuthenticatedClient: () => ({
+ getMcpGatewayToolPolicies: mocks.getPolicies,
+ upsertMcpGatewayToolPolicies: mocks.upsertPolicies,
+ refreshMcpInstallationTools: mocks.refreshTools,
+ }),
+}));
+
+vi.mock("@posthog/ui/primitives/toast", () => ({
+ toast: { error: vi.fn() },
+}));
+
+import { toast } from "@posthog/ui/primitives/toast";
+
+import {
+ resetGatewayToolAutoDiscovery,
+ useGatewayToolPolicies,
+} from "./useGatewayToolPolicies";
+
+const serverId = "server-1";
+
+function policy(policyState: "needs_approval" | "approved") {
+ return {
+ tool_name: "search",
+ description: "Search for things",
+ input_schema: {},
+ policy_state: policyState,
+ team_state: policyState,
+ locked: false,
+ decided_by: "team",
+ rule_name: "",
+ rule_description: "",
+ } satisfies McpResolvedToolPolicy;
+}
+
+let queryClient: QueryClient;
+
+function wrapper({ children }: { children: ReactNode }) {
+ return (
+ <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
+ );
+}
+
+describe("useGatewayToolPolicies", () => {
+ beforeEach(() => {
+ vi.clearAllMocks();
+ resetGatewayToolAutoDiscovery();
+ queryClient = new QueryClient({
+ defaultOptions: { queries: { retry: false } },
+ });
+ });
+
+ it("keeps the mutation result visible while invalidating inherited scopes", async () => {
+ const stalePolicies = [policy("needs_approval")];
+ const updatedPolicies = [policy("approved")];
+ mocks.getPolicies.mockResolvedValue(stalePolicies);
+ mocks.upsertPolicies.mockResolvedValue(updatedPolicies);
+
+ const { result } = renderHook(
+ () => useGatewayToolPolicies(serverId, TEAM_SCOPE),
+ { wrapper },
+ );
+
+ await waitFor(() => expect(result.current.policies).toEqual(stalePolicies));
+
+ const memberKey = gatewayKeys.tools(serverId, YOU_SCOPE);
+ queryClient.setQueryData(memberKey, stalePolicies);
+
+ act(() => {
+ result.current.setPolicy({ toolName: "search", state: "approved" });
+ });
+
+ await waitFor(() =>
+ expect(result.current.policies).toEqual(updatedPolicies),
+ );
+ await act(async () => {
+ await Promise.resolve();
+ });
+
+ expect(mocks.getPolicies).toHaveBeenCalledTimes(1);
+ expect(
+ queryClient.getQueryData(gatewayKeys.tools(serverId, TEAM_SCOPE)),
+ ).toEqual(updatedPolicies);
+ expect(queryClient.getQueryState(memberKey)?.isInvalidated).toBe(true);
+ expect(
+ queryClient.getQueryState(gatewayKeys.tools(serverId, TEAM_SCOPE))
+ ?.isInvalidated,
+ ).toBe(false);
+ });
+
+ describe("auto-discovery", () => {
+ it("lists tools once when the catalog resolves empty", async () => {
+ mocks.getPolicies.mockResolvedValue([]);
+ mocks.refreshTools.mockResolvedValue([]);
+
+ const { result, rerender } = renderHook(
+ () =>
+ useGatewayToolPolicies(serverId, YOU_SCOPE, {
+ autoDiscoverWith: "inst-1",
+ }),
+ { wrapper },
+ );
+
+ await waitFor(() =>
+ expect(mocks.refreshTools).toHaveBeenCalledWith("inst-1"),
+ );
+ await waitFor(() => expect(result.current.refreshPending).toBe(false));
+
+ rerender();
+ expect(mocks.refreshTools).toHaveBeenCalledTimes(1);
+ });
+
+ it.each([
+ ["the catalog already has tools", [policy("approved")], "inst-1"],
+ ["there is no live connection", [], null],
+ ])("stays put when %s", async (_label, policies, installationId) => {
+ mocks.getPolicies.mockResolvedValue(policies);
+
+ const { result } = renderHook(
+ () =>
+ useGatewayToolPolicies(serverId, YOU_SCOPE, {
+ autoDiscoverWith: installationId,
+ }),
+ { wrapper },
+ );
+
+ await waitFor(() => expect(result.current.policiesLoading).toBe(false));
+ await act(async () => {
+ await Promise.resolve();
+ });
+
+ expect(mocks.refreshTools).not.toHaveBeenCalled();
+ });
+
+ it("retries on a later mount when the listing fails", async () => {
+ mocks.getPolicies.mockResolvedValue([]);
+ mocks.refreshTools.mockRejectedValue(new Error("upstream down"));
+
+ const first = renderHook(
+ () =>
+ useGatewayToolPolicies(serverId, YOU_SCOPE, {
+ autoDiscoverWith: "inst-1",
+ }),
+ { wrapper },
+ );
+ await waitFor(() => expect(mocks.refreshTools).toHaveBeenCalledTimes(1));
+ await waitFor(() =>
+ expect(first.result.current.refreshPending).toBe(false),
+ );
+ first.unmount();
+
+ renderHook(
+ () =>
+ useGatewayToolPolicies(serverId, YOU_SCOPE, {
+ autoDiscoverWith: "inst-1",
+ }),
+ { wrapper },
+ );
+
+ await waitFor(() => expect(mocks.refreshTools).toHaveBeenCalledTimes(2));
+ expect(toast.error).not.toHaveBeenCalled();
+ });
+ });
+});
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/hooks/useGatewayToolPolicies.ts b/products/desktop/packages/ui/src/features/mcp-gateway/hooks/useGatewayToolPolicies.ts
new file mode 100644
index 000000000000..220206e52c3f
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/hooks/useGatewayToolPolicies.ts
@@ -0,0 +1,195 @@
+import type {
+ McpApprovalState,
+ McpResolvedToolPolicy,
+} from "@posthog/api-client/posthog-client";
+import {
+ isAgentPolicyState,
+ isPolicyStateAllowedByCeiling,
+} from "@posthog/core/mcp-gateway/gatewayServers";
+import { shouldAutoRefreshTools } from "@posthog/core/mcp-servers/toolRefresh";
+import {
+ type GatewayPolicyScope,
+ gatewayKeys,
+} from "@posthog/ui/features/mcp-gateway/hooks/gatewayKeys";
+import { useAuthenticatedMutation } from "@posthog/ui/hooks/useAuthenticatedMutation";
+import { useAuthenticatedQuery } from "@posthog/ui/hooks/useAuthenticatedQuery";
+import { toast } from "@posthog/ui/primitives/toast";
+import { useQueryClient } from "@tanstack/react-query";
+import { useCallback, useEffect, useRef } from "react";
+
+// Module-scoped on purpose: this must survive remounts so revisiting a server
+// whose catalog is genuinely empty doesn't re-list on every visit. Entries are
+// dropped on failure so a transient error isn't a permanent dead end. Tests
+// that exercise auto-discovery clear it in beforeEach.
+const autoDiscovered = new Set<string>();
+
+export function resetGatewayToolAutoDiscovery(): void {
+ autoDiscovered.clear();
+}
+
+function scopeParams(scope: GatewayPolicyScope) {
+ return {
+ scope_type: scope.scopeType,
+ scope_user_id: scope.scopeUserId,
+ scope_service_account_id: scope.scopeServiceAccountId,
+ };
+}
+
+/** Tool catalog of one gateway server, resolved for one policy scope. */
+export function useGatewayToolPolicies(
+ serverId: string,
+ scope: GatewayPolicyScope,
+ options: {
+ enabled?: boolean;
+ /**
+ * The caller's own installation. When set, an empty catalog lists tools
+ * from the upstream server once — the backstop for connections made
+ * before this existed, or whose connect-time listing failed.
+ */
+ autoDiscoverWith?: string | null;
+ } = {},
+) {
+ const queryClient = useQueryClient();
+ const queryKey = gatewayKeys.tools(serverId, scope);
+
+ const { data: policies, isLoading } = useAuthenticatedQuery(
+ queryKey,
+ (client) => client.getMcpGatewayToolPolicies(serverId, scopeParams(scope)),
+ { enabled: options.enabled ?? true },
+ );
+
+ // The upsert responds with the re-resolved catalog, so write it straight
+ // into the current scope's cache. Other scopes can inherit from this one,
+ // so mark them stale without immediately refetching the just-updated scope
+ // and racing the mutation response with an eventually consistent read.
+ const applyResult = useCallback(
+ (result: McpResolvedToolPolicy[]) => {
+ queryClient.invalidateQueries({
+ queryKey: gatewayKeys.serverTools(serverId),
+ refetchType: "none",
+ });
+ queryClient.setQueryData(queryKey, result);
+ },
+ [queryClient, queryKey, serverId],
+ );
+
+ const setPolicyMutation = useAuthenticatedMutation(
+ (client, vars: { toolName: string; state: McpApprovalState }) => {
+ if (scope.scopeType === "agent" && !isAgentPolicyState(vars.state)) {
+ return Promise.reject(
+ new Error("Agents cannot use approval-gated tool policies"),
+ );
+ }
+ return client.upsertMcpGatewayToolPolicies(serverId, {
+ ...scopeParams(scope),
+ policies: [{ tool_name: vars.toolName, policy_state: vars.state }],
+ });
+ },
+ {
+ onSuccess: applyResult,
+ onError: (error: Error) =>
+ toast.error(error.message || "Failed to update tool policy"),
+ },
+ );
+
+ const setAllMutation = useAuthenticatedMutation(
+ (
+ client,
+ vars: { state: McpApprovalState; toolNames?: readonly string[] },
+ ) => {
+ if (scope.scopeType === "agent" && !isAgentPolicyState(vars.state)) {
+ return Promise.reject(
+ new Error("Agents cannot use approval-gated tool policies"),
+ );
+ }
+ const targetNames = vars.toolNames ? new Set(vars.toolNames) : null;
+ const editable = (policies ?? []).filter(
+ (policy) =>
+ !policy.locked &&
+ (scope.scopeType === "team" ||
+ isPolicyStateAllowedByCeiling(vars.state, policy.team_state)) &&
+ (!targetNames || targetNames.has(policy.tool_name)),
+ );
+ return client.upsertMcpGatewayToolPolicies(serverId, {
+ ...scopeParams(scope),
+ policies: editable.map((policy) => ({
+ tool_name: policy.tool_name,
+ policy_state: vars.state,
+ })),
+ });
+ },
+ {
+ onSuccess: applyResult,
+ onError: (error: Error) =>
+ toast.error(error.message || "Failed to update tool policies"),
+ },
+ );
+
+ // Re-lists tools from the upstream server via the caller's installation.
+ const silentRefreshRef = useRef(false);
+ const refreshMutation = useAuthenticatedMutation(
+ (client, installationId: string) =>
+ client.refreshMcpInstallationTools(installationId),
+ {
+ onSuccess: () => {
+ silentRefreshRef.current = false;
+ queryClient.invalidateQueries({
+ queryKey: gatewayKeys.serverTools(serverId),
+ });
+ queryClient.invalidateQueries({ queryKey: gatewayKeys.servers });
+ },
+ onError: (error: Error, installationId) => {
+ // Auto-discovery is background work: no toast, but drop the marker so
+ // the next mount tries again instead of leaving the page empty forever.
+ if (silentRefreshRef.current) {
+ silentRefreshRef.current = false;
+ autoDiscovered.delete(installationId);
+ return;
+ }
+ toast.error(error.message || "Failed to refresh tools");
+ },
+ },
+ );
+
+ const autoDiscoverWith = options.autoDiscoverWith ?? null;
+ const policyCount = (policies ?? []).length;
+ // Undefined means the catalog query hasn't resolved (or is disabled) — an
+ // empty array is what proves there is nothing to show.
+ const catalogResolved = policies !== undefined;
+ const refreshIsPending = refreshMutation.isPending;
+ const refreshMutate = refreshMutation.mutate;
+
+ useEffect(() => {
+ if (!autoDiscoverWith || !catalogResolved) return;
+ const fire = shouldAutoRefreshTools({
+ autoRefreshIfEmpty: true,
+ installationId: autoDiscoverWith,
+ isLoading,
+ toolsLength: policyCount,
+ alreadyRefreshed: autoDiscovered.has(autoDiscoverWith),
+ refreshPending: refreshIsPending,
+ });
+ if (!fire) return;
+ autoDiscovered.add(autoDiscoverWith);
+ silentRefreshRef.current = true;
+ refreshMutate(autoDiscoverWith);
+ }, [
+ autoDiscoverWith,
+ catalogResolved,
+ isLoading,
+ policyCount,
+ refreshIsPending,
+ refreshMutate,
+ ]);
+
+ return {
+ policies: policies ?? [],
+ policiesLoading: isLoading,
+ setPolicy: setPolicyMutation.mutate,
+ setAll: (state: McpApprovalState, toolNames?: readonly string[]) =>
+ setAllMutation.mutate({ state, toolNames }),
+ setAllPending: setAllMutation.isPending,
+ refresh: refreshMutation.mutate,
+ refreshPending: refreshMutation.isPending,
+ };
+}
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/hooks/useRegisterGatewayServer.test.tsx b/products/desktop/packages/ui/src/features/mcp-gateway/hooks/useRegisterGatewayServer.test.tsx
new file mode 100644
index 000000000000..eadda047bbf5
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/hooks/useRegisterGatewayServer.test.tsx
@@ -0,0 +1,163 @@
+import type { GatewayInstallRequest } from "@posthog/core/mcp-gateway/gatewayAddServer";
+import {
+ gatewayKeys,
+ YOU_SCOPE,
+} from "@posthog/ui/features/mcp-gateway/hooks/gatewayKeys";
+import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
+import { act, renderHook, waitFor } from "@testing-library/react";
+import type { ReactNode } from "react";
+import { beforeEach, describe, expect, it, vi } from "vitest";
+
+const mocks = vi.hoisted(() => ({
+ installCustom: vi.fn(),
+ getServers: vi.fn(),
+ refreshTools: vi.fn(),
+ getCallbackUrl: vi.fn(),
+ openAndWait: vi.fn(),
+}));
+
+vi.mock("@posthog/ui/features/auth/authClient", () => ({
+ useOptionalAuthenticatedClient: () => ({
+ installCustomMcpServer: mocks.installCustom,
+ getMcpGatewayServers: mocks.getServers,
+ refreshMcpInstallationTools: mocks.refreshTools,
+ }),
+}));
+
+vi.mock("@posthog/host-router/react", () => ({
+ useHostTRPCClient: () => ({
+ mcpCallback: {
+ getCallbackUrl: { query: mocks.getCallbackUrl },
+ openAndWaitForCallback: { mutate: mocks.openAndWait },
+ },
+ }),
+}));
+
+vi.mock("@posthog/ui/primitives/toast", () => ({
+ toast: { error: vi.fn(), success: vi.fn() },
+}));
+
+import { useRegisterGatewayServer } from "./useRegisterGatewayServer";
+
+const request: GatewayInstallRequest = {
+ name: "Linear",
+ url: "https://mcp.linear.app/sse",
+ description: "",
+ auth_type: "oauth",
+};
+
+function gatewayServer(overrides: Record<string, unknown> = {}) {
+ return {
+ id: "srv-1",
+ name: "Linear",
+ url: "https://mcp.linear.app/sse",
+ description: "",
+ category: "dev",
+ is_team_enabled: true,
+ icon_key: "",
+ docs_url: "",
+ template_id: null,
+ template_auth_type: null,
+ tool_count: 0,
+ connections: [],
+ your_connection: {
+ installation_id: "inst-1",
+ is_enabled: true,
+ pending_oauth: false,
+ needs_reauth: false,
+ last_used_at: null,
+ },
+ agents: [],
+ revoked_user_ids: [],
+ is_revoked_for_you: false,
+ created_by: null,
+ created_at: "2026-07-30T00:00:00Z",
+ updated_at: "2026-07-30T00:00:00Z",
+ ...overrides,
+ };
+}
+
+let queryClient: QueryClient;
+
+function wrapper({ children }: { children: ReactNode }) {
+ return (
+ <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
+ );
+}
+
+describe("useRegisterGatewayServer", () => {
+ beforeEach(() => {
+ vi.clearAllMocks();
+ queryClient = new QueryClient({
+ defaultOptions: { queries: { retry: false } },
+ });
+ mocks.getCallbackUrl.mockResolvedValue({ callbackUrl: "posthog://cb" });
+ mocks.openAndWait.mockResolvedValue({ success: true });
+ mocks.installCustom.mockResolvedValue({ redirect_url: "https://oauth" });
+ mocks.refreshTools.mockResolvedValue([]);
+ });
+
+ async function register() {
+ const { result } = renderHook(() => useRegisterGatewayServer(), {
+ wrapper,
+ });
+ let outcome: { created: unknown; discoveredTools: boolean } | null = null;
+ act(() => {
+ result.current.register(
+ { request },
+ {
+ onSuccess: (data) => {
+ outcome = data;
+ },
+ },
+ );
+ });
+ await waitFor(() => expect(outcome).not.toBeNull());
+ return outcome as unknown as {
+ created: { id: string } | null;
+ discoveredTools: boolean;
+ };
+ }
+
+ it("lists the new server's tools so the detail page isn't empty", async () => {
+ mocks.getServers.mockResolvedValue([gatewayServer()]);
+ const toolsKey = gatewayKeys.tools("srv-1", YOU_SCOPE);
+ queryClient.setQueryData(toolsKey, []);
+
+ const outcome = await register();
+
+ expect(mocks.refreshTools).toHaveBeenCalledWith("inst-1");
+ expect(outcome.discoveredTools).toBe(true);
+ // The detail page's catalog query must re-read what the listing stored.
+ expect(queryClient.getQueryState(toolsKey)?.isInvalidated).toBe(true);
+ });
+
+ it("still registers the server when the tool listing fails", async () => {
+ mocks.getServers.mockResolvedValue([gatewayServer()]);
+ mocks.refreshTools.mockRejectedValue(new Error("upstream down"));
+
+ const outcome = await register();
+
+ expect(outcome.created?.id).toBe("srv-1");
+ expect(outcome.discoveredTools).toBe(false);
+ });
+
+ it("skips the listing when the credential is still mid-OAuth", async () => {
+ mocks.getServers.mockResolvedValue([
+ gatewayServer({
+ your_connection: {
+ installation_id: "inst-1",
+ is_enabled: true,
+ pending_oauth: true,
+ needs_reauth: false,
+ last_used_at: null,
+ },
+ }),
+ ]);
+
+ const outcome = await register();
+
+ expect(mocks.refreshTools).not.toHaveBeenCalled();
+ expect(outcome.created?.id).toBe("srv-1");
+ });
+});
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/hooks/useRegisterGatewayServer.ts b/products/desktop/packages/ui/src/features/mcp-gateway/hooks/useRegisterGatewayServer.ts
new file mode 100644
index 000000000000..ab91d3bc242f
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/hooks/useRegisterGatewayServer.ts
@@ -0,0 +1,92 @@
+import type { McpGatewayServer } from "@posthog/api-client/posthog-client";
+import type { GatewayInstallRequest } from "@posthog/core/mcp-gateway/gatewayAddServer";
+import { registerGatewayServerWithOAuth } from "@posthog/core/mcp-gateway/gatewayInstallFlow";
+import { discoverGatewayTools } from "@posthog/core/mcp-gateway/gatewayToolDiscovery";
+import { useHostTRPCClient } from "@posthog/host-router/react";
+import { gatewayKeys } from "@posthog/ui/features/mcp-gateway/hooks/gatewayKeys";
+import {
+ createOAuthCallback,
+ mcpKeys,
+} from "@posthog/ui/features/mcp-server-manager/useMcpConnect";
+import { useAuthenticatedMutation } from "@posthog/ui/hooks/useAuthenticatedMutation";
+import { toast } from "@posthog/ui/primitives/toast";
+import { useQueryClient } from "@tanstack/react-query";
+import { useMemo } from "react";
+
+function normalizeUrl(url: string): string {
+ return url.trim().replace(/\/+$/, "");
+}
+
+interface RegisterGatewayServerResult {
+ /** The gateway registration for the just-added server, when resolvable. */
+ created: McpGatewayServer | null;
+ /** Whether the install also listed the server's tools. */
+ discoveredTools: boolean;
+ error: string | null;
+}
+
+/**
+ * Registers a custom server with the gateway (Add-server form submit) and
+ * resolves the resulting registry entry so the caller can navigate to it.
+ */
+export function useRegisterGatewayServer() {
+ const trpcClient = useHostTRPCClient();
+ const oauth = useMemo(() => createOAuthCallback(trpcClient), [trpcClient]);
+ const queryClient = useQueryClient();
+
+ const mutation = useAuthenticatedMutation(
+ async (
+ client,
+ vars: { request: GatewayInstallRequest },
+ ): Promise<RegisterGatewayServerResult> => {
+ const result = await registerGatewayServerWithOAuth(
+ client,
+ oauth,
+ vars.request,
+ );
+ if (result?.error) {
+ return { created: null, discoveredTools: false, error: result.error };
+ }
+ // Re-read the registry to find the registration for the new server —
+ // the gateway keys servers by (team, url).
+ const servers = await client.getMcpGatewayServers();
+ queryClient.setQueryData(gatewayKeys.servers, servers);
+ const target = normalizeUrl(vars.request.url);
+ const created =
+ servers.find((server) => normalizeUrl(server.url) === target) ?? null;
+ // Registering stores the credential but discovers no tools, and this
+ // flow lands the user straight on the server's detail page — list them
+ // now so that page isn't empty. A failure here is not a failed install;
+ // the detail page retries on mount.
+ const discovery = await discoverGatewayTools(
+ client,
+ { serverId: created?.id, url: vars.request.url },
+ { servers },
+ ).catch(() => null);
+ return { created, discoveredTools: !!discovery?.discovered, error: null };
+ },
+ {
+ onSuccess: (data, vars) => {
+ if (data.error) {
+ toast.error(data.error);
+ } else {
+ toast.success(`${vars.request.name} added to the gateway`);
+ }
+ if (data.discoveredTools && data.created) {
+ queryClient.invalidateQueries({
+ queryKey: gatewayKeys.serverTools(data.created.id),
+ });
+ queryClient.invalidateQueries({ queryKey: gatewayKeys.servers });
+ }
+ queryClient.invalidateQueries({ queryKey: mcpKeys.installations });
+ },
+ onError: (error: Error) =>
+ toast.error(error.message || "Failed to add server"),
+ },
+ );
+
+ return {
+ register: mutation.mutate,
+ registerPending: mutation.isPending,
+ };
+}
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/hooks/useServiceAccounts.test.tsx b/products/desktop/packages/ui/src/features/mcp-gateway/hooks/useServiceAccounts.test.tsx
new file mode 100644
index 000000000000..5678d4742f5e
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/hooks/useServiceAccounts.test.tsx
@@ -0,0 +1,163 @@
+import type {
+ McpGatewayServer,
+ McpServiceAccount,
+} from "@posthog/api-client/posthog-client";
+import { gatewayKeys } from "@posthog/ui/features/mcp-gateway/hooks/gatewayKeys";
+import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
+import { act, renderHook, waitFor } from "@testing-library/react";
+import type { ReactNode } from "react";
+import { beforeEach, describe, expect, it, vi } from "vitest";
+
+const mocks = vi.hoisted(() => ({
+ getAccounts: vi.fn(),
+ setAccess: vi.fn(),
+ infoToast: vi.fn(),
+ currentUser: {
+ id: 7,
+ uuid: "user-uuid-7",
+ distinct_id: "distinct-7",
+ first_name: "Ada",
+ last_name: "Lovelace",
+ email: "[email protected]",
+ is_email_verified: true,
+ hedgehog_config: null,
+ },
+}));
+
+vi.mock("@posthog/ui/features/auth/authClient", () => ({
+ useOptionalAuthenticatedClient: () => ({
+ getMcpServiceAccounts: mocks.getAccounts,
+ setMcpServiceAccountAccess: mocks.setAccess,
+ }),
+}));
+
+vi.mock("@posthog/ui/features/auth/useCurrentUser", async (importOriginal) => ({
+ ...(await importOriginal<Record<string, unknown>>()),
+ useCurrentUser: () => ({ data: mocks.currentUser }),
+}));
+
+vi.mock("@posthog/ui/primitives/toast", () => ({
+ toast: {
+ error: vi.fn(),
+ success: vi.fn(),
+ info: mocks.infoToast,
+ },
+}));
+
+import { useServiceAccounts } from "./useServiceAccounts";
+
+const account = {
+ id: "agent-1",
+ name: "Support agent",
+ description: "",
+ handle: "posthog-support",
+ status: "active",
+ token_mask: "",
+ server_ids: ["server-1"],
+ last_active_at: null,
+ created_at: "2026-07-23T12:00:00Z",
+ updated_at: "2026-07-23T12:00:00Z",
+} satisfies McpServiceAccount;
+
+const server = {
+ id: "server-1",
+ agents: [
+ {
+ service_account_id: account.id,
+ name: account.name,
+ handle: account.handle,
+ status: account.status,
+ last_active_at: account.last_active_at,
+ granted_by: null,
+ },
+ ],
+} as McpGatewayServer;
+
+let queryClient: QueryClient;
+
+function wrapper({ children }: { children: ReactNode }) {
+ return (
+ <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
+ );
+}
+
+describe("useServiceAccounts", () => {
+ beforeEach(() => {
+ vi.clearAllMocks();
+ queryClient = new QueryClient({
+ defaultOptions: { queries: { retry: false } },
+ });
+ mocks.getAccounts.mockResolvedValue([account]);
+ mocks.setAccess.mockResolvedValue({ ...account, server_ids: [] });
+ });
+
+ it("removes revoked agent access from both caches without a stale refetch", async () => {
+ queryClient.setQueryData(gatewayKeys.servers, [server]);
+ const { result } = renderHook(() => useServiceAccounts(), { wrapper });
+
+ await waitFor(() => expect(result.current.accounts).toEqual([account]));
+
+ act(() => {
+ result.current.setAccess({
+ accountId: account.id,
+ serverId: server.id,
+ enabled: false,
+ successMessage: "Support agent no longer has access to Linear",
+ });
+ });
+
+ await waitFor(() =>
+ expect(result.current.accounts[0]?.server_ids).toEqual([]),
+ );
+
+ expect(
+ queryClient.getQueryData<McpGatewayServer[]>(gatewayKeys.servers)?.[0]
+ ?.agents,
+ ).toEqual([]);
+ expect(mocks.getAccounts).toHaveBeenCalledTimes(1);
+ expect(mocks.infoToast).toHaveBeenCalledWith(
+ "Support agent no longer has access to Linear",
+ );
+ });
+
+ it("stamps the current user as grantor on a fresh grant without a refetch", async () => {
+ queryClient.setQueryData(gatewayKeys.servers, [
+ { ...server, agents: [] } as McpGatewayServer,
+ ]);
+ mocks.setAccess.mockResolvedValue({ ...account, server_ids: [server.id] });
+ const { result } = renderHook(() => useServiceAccounts(), { wrapper });
+
+ await waitFor(() => expect(result.current.accounts).toEqual([account]));
+
+ act(() => {
+ result.current.setAccess({
+ accountId: account.id,
+ serverId: server.id,
+ enabled: true,
+ });
+ });
+
+ await waitFor(() =>
+ expect(
+ queryClient.getQueryData<McpGatewayServer[]>(gatewayKeys.servers)?.[0]
+ ?.agents,
+ ).toHaveLength(1),
+ );
+
+ expect(
+ queryClient.getQueryData<McpGatewayServer[]>(gatewayKeys.servers)?.[0]
+ ?.agents[0],
+ ).toMatchObject({
+ service_account_id: account.id,
+ granted_by: {
+ id: mocks.currentUser.id,
+ uuid: mocks.currentUser.uuid,
+ first_name: "Ada",
+ last_name: "Lovelace",
+ email: "[email protected]",
+ hedgehog_config: null,
+ },
+ });
+ expect(mocks.getAccounts).toHaveBeenCalledTimes(1);
+ });
+});
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/hooks/useServiceAccounts.ts b/products/desktop/packages/ui/src/features/mcp-gateway/hooks/useServiceAccounts.ts
new file mode 100644
index 000000000000..822b2f4d9589
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/hooks/useServiceAccounts.ts
@@ -0,0 +1,199 @@
+import type {
+ McpGatewayServer,
+ McpGatewayUser,
+ McpServiceAccount,
+ McpServiceAccountStatus,
+ McpServiceAccountWithToken,
+ McpToolPolicyEntry,
+} from "@posthog/api-client/posthog-client";
+import { useOptionalAuthenticatedClient } from "@posthog/ui/features/auth/authClient";
+import { useCurrentUser } from "@posthog/ui/features/auth/useCurrentUser";
+import { gatewayKeys } from "@posthog/ui/features/mcp-gateway/hooks/gatewayKeys";
+import { useAuthenticatedMutation } from "@posthog/ui/hooks/useAuthenticatedMutation";
+import { useAuthenticatedQuery } from "@posthog/ui/hooks/useAuthenticatedQuery";
+import { toast } from "@posthog/ui/primitives/toast";
+import { useQueryClient } from "@tanstack/react-query";
+import { useCallback, useState } from "react";
+
+/** Project the current-user shape onto the UserBasic fields the gateway serves. */
+function toGatewayUser(user: {
+ id: number;
+ uuid: string;
+ distinct_id: string | null;
+ first_name?: string;
+ last_name?: string;
+ email: string;
+ is_email_verified: boolean | null;
+ hedgehog_config?: McpGatewayUser["hedgehog_config"];
+ role_at_organization?: McpGatewayUser["role_at_organization"];
+}): McpGatewayUser {
+ return {
+ id: user.id,
+ uuid: user.uuid,
+ distinct_id: user.distinct_id,
+ first_name: user.first_name,
+ last_name: user.last_name,
+ email: user.email,
+ is_email_verified: user.is_email_verified,
+ hedgehog_config: user.hedgehog_config ?? null,
+ role_at_organization: user.role_at_organization,
+ };
+}
+
+/**
+ * Agent service accounts and their mutations. A freshly-issued token surfaces
+ * once via `newToken` on creation and is discarded on dismiss.
+ */
+export function useServiceAccounts() {
+ const queryClient = useQueryClient();
+ const client = useOptionalAuthenticatedClient();
+ const { data: currentUser } = useCurrentUser({ client });
+ const [newToken, setNewToken] = useState<McpServiceAccountWithToken | null>(
+ null,
+ );
+
+ const { data: accounts, isLoading } = useAuthenticatedQuery(
+ gatewayKeys.accounts,
+ (client) => client.getMcpServiceAccounts(),
+ );
+
+ const invalidate = useCallback(() => {
+ queryClient.invalidateQueries({ queryKey: gatewayKeys.accounts });
+ queryClient.invalidateQueries({ queryKey: gatewayKeys.servers });
+ }, [queryClient]);
+
+ const createMutation = useAuthenticatedMutation(
+ (client, vars: { name: string; description?: string }) =>
+ client.createMcpServiceAccount(vars),
+ {
+ onSuccess: (account) => {
+ invalidate();
+ setNewToken(account);
+ toast.success(`${account.name} created — share servers with it`);
+ },
+ onError: (error: Error) =>
+ toast.error(error.message || "Failed to create agent"),
+ },
+ );
+
+ const setStatusMutation = useAuthenticatedMutation(
+ (
+ client,
+ vars: {
+ accountId: string;
+ name: string;
+ status: McpServiceAccountStatus;
+ },
+ ) =>
+ client.updateMcpServiceAccount(vars.accountId, { status: vars.status }),
+ {
+ onSuccess: (_account, vars) => {
+ invalidate();
+ if (vars.status === "paused") {
+ toast.info(`${vars.name} paused — all access is off`);
+ } else {
+ toast.success(`${vars.name} is active again`);
+ }
+ },
+ onError: (error: Error) =>
+ toast.error(error.message || "Failed to update agent"),
+ },
+ );
+
+ const deleteMutation = useAuthenticatedMutation(
+ (client, vars: { accountId: string; name: string }) =>
+ client.deleteMcpServiceAccount(vars.accountId),
+ {
+ onSuccess: (_data, vars) => {
+ invalidate();
+ toast.info(`${vars.name} deleted — its token no longer works`);
+ },
+ onError: (error: Error) =>
+ toast.error(error.message || "Failed to delete agent"),
+ },
+ );
+
+ const setAccessMutation = useAuthenticatedMutation(
+ (
+ client,
+ vars: {
+ accountId: string;
+ serverId: string;
+ enabled: boolean;
+ policies?: McpToolPolicyEntry[];
+ /** Toast copy, e.g. "Support can now use Linear". */
+ successMessage?: string;
+ },
+ ) =>
+ client.setMcpServiceAccountAccess(vars.accountId, {
+ gateway_server_id: vars.serverId,
+ enabled: vars.enabled,
+ ...(vars.policies ? { policies: vars.policies } : {}),
+ }),
+ {
+ onSuccess: (account, vars) => {
+ // The response is the updated account, so keep both access views in
+ // sync without racing it against a potentially stale list refetch.
+ // The backend stamps `granted_by` with the requesting user on every
+ // enable, so mirror that with the current user here.
+ queryClient.setQueryData<McpServiceAccount[]>(
+ gatewayKeys.accounts,
+ (current) =>
+ current?.map((entry) =>
+ entry.id === account.id ? account : entry,
+ ),
+ );
+ queryClient.setQueryData<McpGatewayServer[]>(
+ gatewayKeys.servers,
+ (current) =>
+ current?.map((server) => {
+ if (server.id !== vars.serverId) return server;
+ const currentAccess = server.agents.find(
+ (agent) => agent.service_account_id === account.id,
+ );
+ const withoutAccount = server.agents.filter(
+ (agent) => agent.service_account_id !== account.id,
+ );
+ return {
+ ...server,
+ agents: vars.enabled
+ ? [
+ ...withoutAccount,
+ {
+ service_account_id: account.id,
+ name: account.name,
+ handle: account.handle,
+ status: account.status,
+ last_active_at: account.last_active_at,
+ granted_by: currentUser
+ ? toGatewayUser(currentUser)
+ : (currentAccess?.granted_by ?? null),
+ },
+ ]
+ : withoutAccount,
+ };
+ }),
+ );
+ if (vars.successMessage) {
+ if (vars.enabled) toast.success(vars.successMessage);
+ else toast.info(vars.successMessage);
+ }
+ },
+ onError: (error: Error) =>
+ toast.error(error.message || "Failed to update agent access"),
+ },
+ );
+
+ return {
+ accounts: accounts ?? [],
+ accountsLoading: isLoading,
+ createAccount: createMutation.mutate,
+ createPending: createMutation.isPending,
+ setStatus: setStatusMutation.mutate,
+ deleteAccount: deleteMutation.mutate,
+ setAccess: setAccessMutation.mutate,
+ setAccessPending: setAccessMutation.isPending,
+ newToken,
+ dismissNewToken: () => setNewToken(null),
+ };
+}
diff --git a/products/desktop/packages/ui/src/features/mcp-servers/components/McpServersView.tsx b/products/desktop/packages/ui/src/features/mcp-servers/components/McpServersView.tsx
index 791d4d702e85..784e2b966f9f 100644
--- a/products/desktop/packages/ui/src/features/mcp-servers/components/McpServersView.tsx
+++ b/products/desktop/packages/ui/src/features/mcp-servers/components/McpServersView.tsx
@@ -2,7 +2,10 @@ import type {
McpRecommendedServer,
McpServerInstallation,
} from "@posthog/api-client/posthog-client";
+import { MCP_GATEWAY_FLAG } from "@posthog/shared";
+import { useFeatureFlag } from "@posthog/ui/features/feature-flags/useFeatureFlag";
import { useLocalMcpCloudServers } from "@posthog/ui/features/local-mcp/useLocalMcpCloudServers";
+import { McpGatewayView } from "@posthog/ui/features/mcp-gateway/components/McpGatewayView";
import { AddCustomServerForm } from "@posthog/ui/features/mcp-server-manager/AddCustomServerForm";
import { MarketplaceView } from "@posthog/ui/features/mcp-servers/components/parts/MarketplaceView";
import { McpInstalledRail } from "@posthog/ui/features/mcp-servers/components/parts/McpInstalledRail";
@@ -27,6 +30,14 @@ type SceneView =
| { kind: "add-custom" };
export function McpServersView() {
+ // The team gateway replaces the per-user marketplace wherever the backend
+ // rollout has reached; the legacy surface stays as the fallback.
+ const gatewayEnabled = useFeatureFlag(MCP_GATEWAY_FLAG);
+ if (gatewayEnabled) return <McpGatewayView />;
+ return <McpMarketplaceView />;
+}
+
+function McpMarketplaceView() {
const queryClient = useQueryClient();
const [view, setView] = useState<SceneView>({ kind: "marketplace" });
const [query, setQuery] = useState("");
diff --git a/products/desktop/packages/ui/src/features/mcp-servers/components/parts/ServerDetailView.tsx b/products/desktop/packages/ui/src/features/mcp-servers/components/parts/ServerDetailView.tsx
index 44da1171aa49..7ccbf544bb80 100644
--- a/products/desktop/packages/ui/src/features/mcp-servers/components/parts/ServerDetailView.tsx
+++ b/products/desktop/packages/ui/src/features/mcp-servers/components/parts/ServerDetailView.tsx
@@ -86,6 +86,7 @@ export function ServerDetailView({
} = useMcpInstallationTools(installation?.id ?? null, {
includeRemoved: showRemoved,
autoRefreshIfEmpty: true,
+ teamScope: installation?.scope === "shared",
});
const status = installation ? getInstallationStatus(installation) : null;
@@ -215,12 +216,12 @@ export function ServerDetailView({
<Flex gap="2">
{counts.approved ? (
<Badge color="green" variant="soft" size="1">
- {counts.approved} approved
+ {counts.approved} Always Allow
</Badge>
) : null}
{counts.needs_approval ? (
<Badge color="amber" variant="soft" size="1">
- {counts.needs_approval} need approval
+ {counts.needs_approval} Needs Approval
</Badge>
) : null}
{counts.do_not_use ? (
@@ -235,7 +236,9 @@ export function ServerDetailView({
Set all:
</Text>
<Tooltip
- content={toolSearch ? "Approve filtered" : "Approve all"}
+ content={
+ toolSearch ? "Always Allow filtered" : "Always Allow all"
+ }
>
<IconButton
variant="soft"
@@ -255,8 +258,8 @@ export function ServerDetailView({
<Tooltip
content={
toolSearch
- ? "Require approval for filtered"
- : "Require approval for all"
+ ? "Set filtered to Needs Approval"
+ : "Set all to Needs Approval"
}
>
<IconButton
@@ -371,6 +374,7 @@ export function ServerDetailView({
<ToolRow
key={tool.tool_name}
tool={tool}
+ teamScope={installation.scope === "shared"}
onChange={(approval_state) =>
setToolApproval({
toolName: tool.tool_name,
diff --git a/products/desktop/packages/ui/src/features/mcp-servers/components/parts/ToolPermissionList.tsx b/products/desktop/packages/ui/src/features/mcp-servers/components/parts/ToolPermissionList.tsx
index f35752c30dbe..c1546b9a9e73 100644
--- a/products/desktop/packages/ui/src/features/mcp-servers/components/parts/ToolPermissionList.tsx
+++ b/products/desktop/packages/ui/src/features/mcp-servers/components/parts/ToolPermissionList.tsx
@@ -135,12 +135,12 @@ export function ToolPermissionList({
<Flex gap="2">
{counts.approved ? (
<Badge color="green" variant="soft" size="1">
- {counts.approved} approved
+ {counts.approved} Always Allow
</Badge>
) : null}
{counts.needs_approval ? (
<Badge color="amber" variant="soft" size="1">
- {counts.needs_approval} need approval
+ {counts.needs_approval} Needs Approval
</Badge>
) : null}
{counts.do_not_use ? (
@@ -169,7 +169,9 @@ export function ToolPermissionList({
Set all:
</Text>
<Tooltip
- content={toolSearch ? "Approve filtered" : "Approve all"}
+ content={
+ toolSearch ? "Always Allow filtered" : "Always Allow all"
+ }
>
<IconButton
variant="soft"
@@ -184,8 +186,8 @@ export function ToolPermissionList({
<Tooltip
content={
toolSearch
- ? "Require approval for filtered"
- : "Require approval for all"
+ ? "Set filtered to Needs Approval"
+ : "Set all to Needs Approval"
}
>
<IconButton
diff --git a/products/desktop/packages/ui/src/features/mcp-servers/components/parts/ToolPolicyToggle.tsx b/products/desktop/packages/ui/src/features/mcp-servers/components/parts/ToolPolicyToggle.tsx
index 1a453c6d46f0..4ea67a46f4f6 100644
--- a/products/desktop/packages/ui/src/features/mcp-servers/components/parts/ToolPolicyToggle.tsx
+++ b/products/desktop/packages/ui/src/features/mcp-servers/components/parts/ToolPolicyToggle.tsx
@@ -6,6 +6,8 @@ interface ToolPolicyToggleProps {
value: McpApprovalState;
onChange: (value: McpApprovalState) => void;
disabled?: boolean;
+ disabledStates?: Partial<Record<McpApprovalState, string>>;
+ allowedStates?: readonly McpApprovalState[];
}
const OPTIONS: {
@@ -16,13 +18,13 @@ const OPTIONS: {
}[] = [
{
id: "approved",
- label: "Approved",
- hint: "Always allow",
+ label: "Always Allow",
+ hint: "Run without asking",
Icon: Check,
},
{
id: "needs_approval",
- label: "Requires approval",
+ label: "Needs Approval",
hint: "Ask every time",
Icon: Shield,
},
@@ -38,15 +40,22 @@ export function ToolPolicyToggle({
value,
onChange,
disabled,
+ disabledStates,
+ allowedStates,
}: ToolPolicyToggleProps) {
+ const visibleOptions = allowedStates
+ ? OPTIONS.filter((option) => allowedStates.includes(option.id))
+ : OPTIONS;
+
return (
<div
role="radiogroup"
aria-label="Tool permission"
className="inline-flex items-stretch overflow-hidden rounded-md border border-gray-5 bg-gray-2"
>
- {OPTIONS.map((option, index) => {
+ {visibleOptions.map((option, index) => {
const active = value === option.id;
+ const disabledReason = disabledStates?.[option.id];
const activeClass =
option.id === "approved"
? "bg-green-9 text-white"
@@ -54,13 +63,17 @@ export function ToolPolicyToggle({
? "bg-amber-9 text-white"
: "bg-red-9 text-white";
return (
- <Tooltip key={option.id} content={`${option.label} — ${option.hint}`}>
+ <Tooltip
+ key={option.id}
+ content={disabledReason ?? `${option.label} — ${option.hint}`}
+ >
{/* biome-ignore lint/a11y/useSemanticElements: segmented radio group needs custom button styling */}
<button
type="button"
role="radio"
aria-checked={active}
- disabled={disabled}
+ aria-label={option.label}
+ disabled={disabled || !!disabledReason}
onClick={() => onChange(option.id)}
className={`flex items-center justify-center px-2.5 py-1.5 text-xs transition-colors disabled:opacity-50 ${
index > 0 ? "border-gray-5 border-l" : ""
diff --git a/products/desktop/packages/ui/src/features/mcp-servers/components/parts/ToolRow.tsx b/products/desktop/packages/ui/src/features/mcp-servers/components/parts/ToolRow.tsx
index 7ef5cefbd15a..8eaac9de6491 100644
--- a/products/desktop/packages/ui/src/features/mcp-servers/components/parts/ToolRow.tsx
+++ b/products/desktop/packages/ui/src/features/mcp-servers/components/parts/ToolRow.tsx
@@ -1,21 +1,31 @@
-import { CaretDown, CaretRight } from "@phosphor-icons/react";
+import { CaretDown, CaretRight, Lock } from "@phosphor-icons/react";
import type {
McpApprovalState,
McpInstallationTool,
} from "@posthog/api-client/posthog-client";
+import { isPolicyStateAllowedByCeiling } from "@posthog/core/mcp-gateway/gatewayServers";
import { Badge, Flex, Text } from "@radix-ui/themes";
import { useState } from "react";
import { ToolPolicyToggle } from "./ToolPolicyToggle";
interface ToolRowProps {
tool: McpInstallationTool;
+ teamScope?: boolean;
onChange: (approval_state: McpApprovalState) => void;
}
-export function ToolRow({ tool, onChange }: ToolRowProps) {
+export function ToolRow({ tool, teamScope = false, onChange }: ToolRowProps) {
const [open, setOpen] = useState(false);
const hasDescription = !!tool.description?.trim();
const removed = !!tool.removed_at;
+ const setByTeamAdmin =
+ !teamScope && (tool.decided_by === "team" || tool.decided_by === "preset");
+ const disabledStates: Partial<Record<McpApprovalState, string>> = {};
+ for (const state of ["approved", "needs_approval", "do_not_use"] as const) {
+ if (!teamScope && !isPolicyStateAllowedByCeiling(state, tool.team_state)) {
+ disabledStates[state] = "Unavailable because of the team admin ceiling";
+ }
+ }
return (
<div className={`rounded border border-border bg-gray-1 transition-colors`}>
@@ -65,13 +75,19 @@ export function ToolRow({ tool, onChange }: ToolRowProps) {
</Text>
</div>
</button>
- <div className="shrink-0">
+ <Flex align="center" gap="2" className="shrink-0">
+ {setByTeamAdmin && (
+ <Badge color="gray" variant="soft" size="1">
+ <Lock size={11} /> Set by team admin
+ </Badge>
+ )}
<ToolPolicyToggle
value={tool.approval_state ?? "needs_approval"}
onChange={onChange}
- disabled={removed}
+ disabled={removed || tool.locked}
+ disabledStates={disabledStates}
/>
- </div>
+ </Flex>
</div>
{open && (
<div className="border-gray-5 border-t bg-gray-2 px-3 py-3">
diff --git a/products/desktop/packages/ui/src/features/mcp-servers/hooks/useMcpInstallationTools.test.tsx b/products/desktop/packages/ui/src/features/mcp-servers/hooks/useMcpInstallationTools.test.tsx
new file mode 100644
index 000000000000..dcdcf07eb40a
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/mcp-servers/hooks/useMcpInstallationTools.test.tsx
@@ -0,0 +1,146 @@
+import type { McpInstallationTool } from "@posthog/api-client/posthog-client";
+import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
+import { act, renderHook, waitFor } from "@testing-library/react";
+import type { ReactNode } from "react";
+import { beforeEach, describe, expect, it, vi } from "vitest";
+
+const mockClient = vi.hoisted(() => ({
+ getMcpInstallationTools: vi.fn(),
+ updateMcpToolApproval: vi.fn(),
+ refreshMcpInstallationTools: vi.fn(),
+}));
+
+const mockTrpc = vi.hoisted(() => ({
+ mcpCallback: {
+ onOAuthComplete: {
+ subscriptionOptions: vi.fn(() => ({})),
+ },
+ },
+}));
+
+vi.mock("@posthog/ui/features/auth/authClient", () => ({
+ useOptionalAuthenticatedClient: () => mockClient,
+}));
+
+vi.mock("@posthog/host-router/react", () => ({
+ useHostTRPC: () => mockTrpc,
+}));
+
+vi.mock("@trpc/tanstack-react-query", () => ({
+ useSubscription: vi.fn(),
+}));
+
+vi.mock("@posthog/ui/primitives/toast", () => ({
+ toast: {
+ error: vi.fn(),
+ success: vi.fn(),
+ },
+}));
+
+import { useMcpInstallationTools } from "./useMcpInstallationTools";
+
+function wrapper({ children }: { children: ReactNode }) {
+ const queryClient = new QueryClient({
+ defaultOptions: {
+ queries: { retry: false },
+ mutations: { retry: false },
+ },
+ });
+ return (
+ <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
+ );
+}
+
+function makeTool(
+ overrides: Partial<McpInstallationTool> & { tool_name: string },
+): McpInstallationTool {
+ return {
+ id: overrides.tool_name,
+ display_name: overrides.tool_name,
+ description: "",
+ input_schema: {},
+ approval_state: "approved",
+ last_seen_at: "2026-01-01T00:00:00Z",
+ removed_at: null,
+ created_at: "2026-01-01T00:00:00Z",
+ updated_at: null,
+ ...overrides,
+ };
+}
+
+describe("useMcpInstallationTools setBulkApproval", () => {
+ beforeEach(() => {
+ vi.clearAllMocks();
+ mockClient.updateMcpToolApproval.mockResolvedValue({});
+ });
+
+ it("excludes rule-locked tools from bulk writes even in team scope", async () => {
+ mockClient.getMcpInstallationTools.mockResolvedValue([
+ makeTool({ tool_name: "unlocked" }),
+ makeTool({ tool_name: "rule-locked", locked: true }),
+ ]);
+
+ const { result } = renderHook(
+ () => useMcpInstallationTools("inst-1", { teamScope: true }),
+ { wrapper },
+ );
+ await waitFor(() => expect(result.current.tools).toHaveLength(2));
+
+ act(() => result.current.setBulkApproval("do_not_use"));
+
+ await waitFor(() =>
+ expect(mockClient.updateMcpToolApproval).toHaveBeenCalledTimes(1),
+ );
+ expect(mockClient.updateMcpToolApproval).toHaveBeenCalledWith(
+ "inst-1",
+ "unlocked",
+ "do_not_use",
+ );
+ });
+
+ it("skips the team ceiling in team scope, since team scope sets it", async () => {
+ mockClient.getMcpInstallationTools.mockResolvedValue([
+ makeTool({ tool_name: "restricted", team_state: "do_not_use" }),
+ ]);
+
+ const { result } = renderHook(
+ () => useMcpInstallationTools("inst-1", { teamScope: true }),
+ { wrapper },
+ );
+ await waitFor(() => expect(result.current.tools).toHaveLength(1));
+
+ act(() => result.current.setBulkApproval("approved"));
+
+ await waitFor(() =>
+ expect(mockClient.updateMcpToolApproval).toHaveBeenCalledWith(
+ "inst-1",
+ "restricted",
+ "approved",
+ ),
+ );
+ });
+
+ it("excludes locked tools and tools above the team ceiling in member scope", async () => {
+ mockClient.getMcpInstallationTools.mockResolvedValue([
+ makeTool({ tool_name: "unlocked" }),
+ makeTool({ tool_name: "rule-locked", locked: true }),
+ makeTool({ tool_name: "restricted", team_state: "do_not_use" }),
+ ]);
+
+ const { result } = renderHook(() => useMcpInstallationTools("inst-1"), {
+ wrapper,
+ });
+ await waitFor(() => expect(result.current.tools).toHaveLength(3));
+
+ act(() => result.current.setBulkApproval("approved"));
+
+ await waitFor(() =>
+ expect(mockClient.updateMcpToolApproval).toHaveBeenCalledTimes(1),
+ );
+ expect(mockClient.updateMcpToolApproval).toHaveBeenCalledWith(
+ "inst-1",
+ "unlocked",
+ "approved",
+ );
+ });
+});
diff --git a/products/desktop/packages/ui/src/features/mcp-servers/hooks/useMcpInstallationTools.ts b/products/desktop/packages/ui/src/features/mcp-servers/hooks/useMcpInstallationTools.ts
index 5039e17d48fa..6f6824950e74 100644
--- a/products/desktop/packages/ui/src/features/mcp-servers/hooks/useMcpInstallationTools.ts
+++ b/products/desktop/packages/ui/src/features/mcp-servers/hooks/useMcpInstallationTools.ts
@@ -2,6 +2,7 @@ import type {
McpApprovalState,
McpInstallationTool,
} from "@posthog/api-client/posthog-client";
+import { isPolicyStateAllowedByCeiling } from "@posthog/core/mcp-gateway/gatewayServers";
import { dispatchBulkApproval } from "@posthog/core/mcp-servers/toolBulk";
import { shouldAutoRefreshTools } from "@posthog/core/mcp-servers/toolRefresh";
import { useHostTRPC } from "@posthog/host-router/react";
@@ -16,6 +17,7 @@ import { mcpKeys } from "./useMcpServers";
interface UseMcpInstallationToolsOptions {
includeRemoved?: boolean;
autoRefreshIfEmpty?: boolean;
+ teamScope?: boolean;
}
// Module-scoped on purpose: state must survive remounts of this hook so a
@@ -52,9 +54,11 @@ export function useMcpInstallationTools(
const invalidate = useCallback(() => {
if (!installationId) return;
queryClient.invalidateQueries({
- queryKey: mcpKeys.tools(installationId),
+ queryKey: options.teamScope
+ ? mcpKeys.installations
+ : mcpKeys.tools(installationId),
});
- }, [installationId, queryClient]);
+ }, [installationId, options.teamScope, queryClient]);
const setToolApprovalMutation = useAuthenticatedMutation(
(client, vars: { toolName: string; approval_state: McpApprovalState }) => {
@@ -88,10 +92,19 @@ export function useMcpInstallationTools(
if (!installationId) {
return Promise.reject(new Error("No installation selected"));
}
+ const eligibleTools = (vars.targetTools ?? tools ?? []).filter(
+ (tool) =>
+ !tool.locked &&
+ (options.teamScope ||
+ isPolicyStateAllowedByCeiling(
+ vars.approval_state,
+ tool.team_state,
+ )),
+ );
return dispatchBulkApproval(
client,
installationId,
- vars.targetTools ?? tools ?? [],
+ eligibleTools,
vars.approval_state,
);
},
@@ -125,7 +138,13 @@ export function useMcpInstallationTools(
onError: (error: Error) => {
const silent = silentRefreshRef.current;
silentRefreshRef.current = false;
- if (!silent) toast.error(error.message || "Failed to refresh tools");
+ if (!silent) {
+ toast.error(error.message || "Failed to refresh tools");
+ return;
+ }
+ // A silent refresh reports nothing, so leaving the id marked would
+ // strand the page empty for the session. Let the next mount retry.
+ if (installationId) autoRefreshedInstallations.delete(installationId);
},
},
);
diff --git a/products/desktop/packages/ui/src/features/pi-sessions/PiSessionModelControls.tsx b/products/desktop/packages/ui/src/features/pi-sessions/PiSessionModelControls.tsx
new file mode 100644
index 000000000000..bcd244984223
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/pi-sessions/PiSessionModelControls.tsx
@@ -0,0 +1,148 @@
+import type {
+ PiModelSelection,
+ PiSessionController,
+ PiThinkingLevel,
+} from "@posthog/core/pi-runtime/piSessionController";
+import type { PiControllerSessionState } from "@posthog/core/pi-runtime/piSessionStore";
+import { Skeleton } from "@posthog/quill";
+import { isTerminalStatus } from "@posthog/shared/domain-types";
+import { useCallback } from "react";
+import { PiModelSelector, PiThinkingLevelSelector } from "./PiSessionControls";
+import {
+ getPiPendingConfig,
+ usePiPendingConfigStore,
+} from "./piPendingConfigStore";
+import { usePiModelCatalog } from "./usePiModelCatalog";
+
+interface PiSessionModelControlsProps {
+ taskId: string;
+ taskRunId?: string;
+ session: PiControllerSessionState;
+ controller: PiSessionController;
+ isOnline: boolean;
+ onError: (error: unknown, fallback: string) => void;
+}
+
+export function PiSessionModelControls({
+ taskId,
+ taskRunId,
+ session,
+ controller,
+ isOnline,
+ onError,
+}: PiSessionModelControlsProps) {
+ const isCloudSession = session.cloudStatus !== undefined;
+ const isTerminalCloudRun =
+ isCloudSession && isTerminalStatus(session.cloudStatus);
+ const pendingConfig = usePiPendingConfigStore((state) =>
+ getPiPendingConfig(state, taskId, taskRunId),
+ );
+ const setPendingConfig = usePiPendingConfigStore((state) => state.setConfig);
+ const { data: catalog = [], isPending: catalogLoading } =
+ usePiModelCatalog(isCloudSession);
+ const controlsDisabled =
+ session.status?.isStreaming ||
+ session.status?.isCompacting ||
+ session.isBashRunning ||
+ session.connectionState !== "connected";
+ const currentModel = pendingConfig?.model ?? session.status?.model;
+ const models = isCloudSession ? catalog : session.models;
+ const modelsLoaded = isCloudSession ? !catalogLoading : session.modelsLoaded;
+ const catalogModel = catalog.find(
+ (model) =>
+ model.provider === currentModel?.provider && model.id === currentModel.id,
+ );
+ const thinkingLevels = isCloudSession
+ ? (catalogModel?.thinkingLevels ?? [])
+ : session.thinkingLevels;
+ const requestedThinkingLevel =
+ pendingConfig?.thinkingLevel ?? session.status?.thinkingLevel;
+ const currentThinkingLevel =
+ requestedThinkingLevel && thinkingLevels.includes(requestedThinkingLevel)
+ ? requestedThinkingLevel
+ : thinkingLevels[0];
+ const thinkingLevelsLoaded = isCloudSession
+ ? !catalogLoading
+ : session.thinkingLevelsLoaded;
+ const disabled = isTerminalCloudRun ? !isOnline : controlsDisabled;
+ const setModel = useCallback(
+ (model: PiModelSelection) => {
+ if (taskRunId && isTerminalCloudRun) {
+ const nextThinkingLevels =
+ catalog.find(
+ (candidate) =>
+ candidate.provider === model.provider &&
+ candidate.id === model.id,
+ )?.thinkingLevels ?? [];
+ const requestedThinkingLevel =
+ pendingConfig?.thinkingLevel ?? session.status?.thinkingLevel;
+ const thinkingLevel =
+ requestedThinkingLevel &&
+ nextThinkingLevels.includes(requestedThinkingLevel)
+ ? requestedThinkingLevel
+ : nextThinkingLevels[0];
+ setPendingConfig(taskId, taskRunId, { model, thinkingLevel });
+ return;
+ }
+
+ void controller
+ .setModel(taskId, model)
+ .catch((error) => onError(error, "Failed to change Pi model"));
+ },
+ [
+ catalog,
+ controller,
+ isTerminalCloudRun,
+ onError,
+ pendingConfig?.thinkingLevel,
+ session.status?.thinkingLevel,
+ setPendingConfig,
+ taskId,
+ taskRunId,
+ ],
+ );
+ const setThinkingLevel = useCallback(
+ (level: PiThinkingLevel) => {
+ if (taskRunId && isTerminalCloudRun) {
+ setPendingConfig(taskId, taskRunId, { thinkingLevel: level });
+ return;
+ }
+
+ void controller
+ .setThinkingLevel(taskId, level)
+ .catch((error) => onError(error, "Failed to change Pi thinking level"));
+ },
+ [
+ controller,
+ isTerminalCloudRun,
+ onError,
+ setPendingConfig,
+ taskId,
+ taskRunId,
+ ],
+ );
+
+ if (!modelsLoaded) {
+ return <Skeleton className="h-7 w-32 bg-foreground/15" />;
+ }
+
+ const supportsThinking = thinkingLevels.some((level) => level !== "off");
+ return (
+ <span className="flex gap-1">
+ <PiModelSelector
+ models={models}
+ currentModel={currentModel}
+ disabled={disabled}
+ onChange={setModel}
+ />
+ {currentThinkingLevel && thinkingLevelsLoaded && supportsThinking && (
+ <PiThinkingLevelSelector
+ level={currentThinkingLevel}
+ levels={thinkingLevels}
+ disabled={disabled}
+ onChange={setThinkingLevel}
+ />
+ )}
+ </span>
+ );
+}
diff --git a/products/desktop/packages/ui/src/features/pi-sessions/PiSessionView.tsx b/products/desktop/packages/ui/src/features/pi-sessions/PiSessionView.tsx
index d3e2c4317e19..64a87562f51c 100644
--- a/products/desktop/packages/ui/src/features/pi-sessions/PiSessionView.tsx
+++ b/products/desktop/packages/ui/src/features/pi-sessions/PiSessionView.tsx
@@ -5,10 +5,8 @@ import {
} from "@posthog/core/message-editor/content";
import { PI_SESSION_CONTROLLER } from "@posthog/core/pi-runtime/identifiers";
import {
- type PiModelSelection,
PiOperationError,
type PiSessionController,
- type PiThinkingLevel,
} from "@posthog/core/pi-runtime/piSessionController";
import { toPiContextUsage } from "@posthog/core/pi-runtime/piSessionUsage";
import { useService } from "@posthog/di/react";
@@ -22,17 +20,17 @@ import {
Skeleton,
} from "@posthog/quill";
import type { AgentConversationEvent } from "@posthog/shared";
-import { isTerminalStatus } from "@posthog/shared/domain-types";
import { useUsageLimitStore } from "@posthog/ui/features/billing/usageLimitStore";
import { PromptInput } from "@posthog/ui/features/message-editor/components/PromptInput";
import { useDraftStore } from "@posthog/ui/features/message-editor/draftStore";
-import { CloudInitializingView } from "@posthog/ui/features/sessions/components/CloudInitializingView";
import {
CloudConnectionBanner,
CloudStreamDisconnectedBanner,
} from "@posthog/ui/features/sessions/components/CloudSessionLifecycle";
import { ChatThread } from "@posthog/ui/features/sessions/components/chat-thread/ChatThread";
import type { PromptRecallHandler } from "@posthog/ui/features/sessions/components/chat-thread/composerPromptRecall";
+import { focusComposerOnPaneClick } from "@posthog/ui/features/sessions/components/focusComposerOnPaneClick";
+import { SessionInitializingView } from "@posthog/ui/features/sessions/components/SessionInitializingView";
import { CHAT_CONTENT_MAX_WIDTH } from "@posthog/ui/features/sessions/constants";
import { useMessagingModeStore } from "@posthog/ui/features/sessions/messagingModeStore";
import { useWorkspace } from "@posthog/ui/features/workspace/useWorkspace";
@@ -44,20 +42,26 @@ import { Box, Flex } from "@radix-ui/themes";
import { type ReactElement, useCallback, useEffect, useRef } from "react";
import { useStore } from "zustand";
import { PiQueuedMessagesDock } from "./PiQueuedMessagesDock";
+import { PiMessagingModeSelector } from "./PiSessionControls";
+import { PiSessionModelControls } from "./PiSessionModelControls";
import {
- PiMessagingModeSelector,
- PiModelSelector,
- PiThinkingLevelSelector,
-} from "./PiSessionControls";
+ getPiPendingConfig,
+ usePiPendingConfigStore,
+} from "./piPendingConfigStore";
const log = logger.scope("pi-session-view");
interface PiSessionViewProps {
taskId: string;
taskRunId?: string;
+ isCloud: boolean;
}
-export function PiSessionView({ taskId, taskRunId }: PiSessionViewProps) {
+export function PiSessionView({
+ taskId,
+ taskRunId,
+ isCloud,
+}: PiSessionViewProps) {
const piSessionController = useService<PiSessionController>(
PI_SESSION_CONTROLLER,
);
@@ -66,6 +70,12 @@ export function PiSessionView({ taskId, taskRunId }: PiSessionViewProps) {
(state) => state.sessions[taskId],
);
const draftActions = useDraftStore((state) => state.actions);
+ const pendingConfig = usePiPendingConfigStore((state) =>
+ getPiPendingConfig(state, taskId, taskRunId),
+ );
+ const clearPendingConfig = usePiPendingConfigStore(
+ (state) => state.clearConfig,
+ );
const workspace = useWorkspace(taskId);
const repoPath = workspace?.worktreePath ?? workspace?.folderPath;
const messagingMode = useMessagingModeStore(
@@ -152,8 +162,11 @@ export function PiSessionView({ taskId, taskRunId }: PiSessionViewProps) {
messagingMode,
);
void piSessionController
- .submit(taskId, message, isStreaming, messagingMode)
+ .submit(taskId, message, isStreaming, messagingMode, pendingConfig)
.then(() => {
+ if (action === "prompt" && pendingConfig && taskRunId) {
+ clearPendingConfig(taskId, taskRunId);
+ }
if (action === "compact") {
toast.success("Pi context compacted");
}
@@ -168,35 +181,16 @@ export function PiSessionView({ taskId, taskRunId }: PiSessionViewProps) {
},
[
handleControllerError,
+ clearPendingConfig,
isStreaming,
messagingMode,
+ pendingConfig,
piSessionController,
taskId,
+ taskRunId,
],
);
- const setModel = useCallback(
- (model: PiModelSelection) => {
- void piSessionController
- .setModel(taskId, model)
- .catch((error) =>
- handleControllerError(error, "Failed to change Pi model"),
- );
- },
- [handleControllerError, piSessionController, taskId],
- );
-
- const setThinkingLevel = useCallback(
- (level: PiThinkingLevel) => {
- void piSessionController
- .setThinkingLevel(taskId, level)
- .catch((error) =>
- handleControllerError(error, "Failed to change Pi thinking level"),
- );
- },
- [handleControllerError, piSessionController, taskId],
- );
-
const toggleMessagingMode = useCallback(() => {
const nextMode = messagingMode === "steer" ? "queue" : "steer";
setMessagingMode(taskId, nextMode);
@@ -231,6 +225,13 @@ export function PiSessionView({ taskId, taskRunId }: PiSessionViewProps) {
);
}, [handleControllerError, piSessionController, taskId]);
+ const handleThreadClick = useCallback(
+ (event: React.MouseEvent) => {
+ focusComposerOnPaneClick(event, () => draftActions.requestFocus(taskId));
+ },
+ [draftActions, taskId],
+ );
+
const restart = useCallback(() => {
void piSessionController
.restart(taskId)
@@ -316,11 +317,13 @@ export function PiSessionView({ taskId, taskRunId }: PiSessionViewProps) {
);
const sessionAvailable =
session.connectionState === "connected" || hasTranscript;
+ const executionTarget = isCloud ? "cloud" : "local";
if (isConnecting && !hasTranscript) {
return (
<Box className="relative h-full">
- <CloudInitializingView
- cloudStatus={session.cloudStatus ?? null}
+ <SessionInitializingView
+ executionTarget={executionTarget}
+ cloudStatus={session.cloudStatus}
heading={latestProgress?.label}
subtitle={latestProgress?.detail}
/>
@@ -354,49 +357,12 @@ export function PiSessionView({ taskId, taskRunId }: PiSessionViewProps) {
}
const controlsPending = status ? isStreaming || isBashRunning : false;
- const controlsDisabled =
- controlsPending ||
- isCompacting ||
- session.connectionState !== "connected" ||
- (session.cloudStatus !== undefined &&
- isTerminalStatus(session.cloudStatus));
const hasQueuedMessage =
session.queue.steering.length + session.queue.followUp.length > 0;
- let modelSelector: ReactElement = (
- <Skeleton className="h-7 w-32 bg-foreground/15" />
- );
- let reasoningSelector: ReactElement | null = (
- <Skeleton className="h-7 w-20 bg-foreground/15" />
- );
let messagingModeToggle: ReactElement = (
<Skeleton className="h-7 w-24 bg-foreground/15" />
);
- if (status && session.modelsLoaded) {
- modelSelector = (
- <PiModelSelector
- models={session.models}
- currentModel={status.model}
- disabled={controlsDisabled}
- onChange={setModel}
- />
- );
- }
-
- if (status && session.thinkingLevelsLoaded) {
- const supportsThinking = session.thinkingLevels.some(
- (level) => level !== "off",
- );
- reasoningSelector = supportsThinking ? (
- <PiThinkingLevelSelector
- level={status.thinkingLevel}
- levels={session.thinkingLevels}
- disabled={controlsDisabled}
- onChange={setThinkingLevel}
- />
- ) : null;
- }
-
if (status) {
messagingModeToggle = (
<PiMessagingModeSelector
@@ -421,7 +387,7 @@ export function PiSessionView({ taskId, taskRunId }: PiSessionViewProps) {
onRestart={restart}
/>
)}
- <Box className="min-h-0 flex-1">
+ <Box className="min-h-0 flex-1" onClick={handleThreadClick}>
<ChatThread
events={session.events}
isPromptPending={isStreaming}
@@ -465,8 +431,17 @@ export function PiSessionView({ taskId, taskRunId }: PiSessionViewProps) {
}
enableBashMode
enableCommands
- modelSelector={modelSelector}
- reasoningSelector={reasoningSelector}
+ modelSelector={
+ <PiSessionModelControls
+ taskId={taskId}
+ taskRunId={taskRunId}
+ session={session}
+ controller={piSessionController}
+ isOnline={isOnline}
+ onError={handleControllerError}
+ />
+ }
+ reasoningSelector={null}
messagingModeToggle={messagingModeToggle}
onToggleMessagingMode={toggleMessagingMode}
onPromptRecall={handlePromptRecall}
diff --git a/products/desktop/packages/ui/src/features/pi-sessions/piPendingConfigStore.ts b/products/desktop/packages/ui/src/features/pi-sessions/piPendingConfigStore.ts
new file mode 100644
index 000000000000..8dd822afb6c7
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/pi-sessions/piPendingConfigStore.ts
@@ -0,0 +1,60 @@
+import type {
+ PiModelSelection,
+ PiThinkingLevel,
+} from "@posthog/core/pi-runtime/piSessionController";
+import { electronStorage } from "@posthog/ui/shell/rendererStorage";
+import { create } from "zustand";
+import { persist } from "zustand/middleware";
+
+/** Deferred Pi settings selected while a cloud sandbox is inactive. They are applied after its next startup and before the triggering prompt. */
+export interface PiPendingConfig {
+ model?: PiModelSelection;
+ thinkingLevel?: PiThinkingLevel;
+}
+
+interface PiPendingConfigState {
+ configsByRunKey: Record<string, PiPendingConfig>;
+ setConfig: (taskId: string, runId: string, config: PiPendingConfig) => void;
+ clearConfig: (taskId: string, runId: string) => void;
+}
+
+function runKey(taskId: string, runId: string): string {
+ return `${taskId}:${runId}`;
+}
+
+export const usePiPendingConfigStore = create<PiPendingConfigState>()(
+ persist(
+ (set) => ({
+ configsByRunKey: {},
+ setConfig: (taskId, runId, config) =>
+ set((state) => {
+ const key = runKey(taskId, runId);
+ return {
+ configsByRunKey: {
+ ...state.configsByRunKey,
+ [key]: { ...state.configsByRunKey[key], ...config },
+ },
+ };
+ }),
+ clearConfig: (taskId, runId) =>
+ set((state) => {
+ const { [runKey(taskId, runId)]: _, ...configsByRunKey } =
+ state.configsByRunKey;
+ return { configsByRunKey };
+ }),
+ }),
+ {
+ name: "pi-pending-config-storage",
+ storage: electronStorage,
+ partialize: (state) => ({ configsByRunKey: state.configsByRunKey }),
+ },
+ ),
+);
+
+export function getPiPendingConfig(
+ state: PiPendingConfigState,
+ taskId: string,
+ runId: string | undefined,
+): PiPendingConfig | undefined {
+ return runId ? state.configsByRunKey[runKey(taskId, runId)] : undefined;
+}
diff --git a/products/desktop/packages/ui/src/features/pi-sessions/usePiModelCatalog.ts b/products/desktop/packages/ui/src/features/pi-sessions/usePiModelCatalog.ts
new file mode 100644
index 000000000000..7dab0bcd9ffd
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/pi-sessions/usePiModelCatalog.ts
@@ -0,0 +1,22 @@
+import { useHostTRPC } from "@posthog/host-router/react";
+import { getCloudUrlFromRegion } from "@posthog/shared";
+import { useAuthStateValue } from "@posthog/ui/features/auth/store";
+import { useQuery } from "@tanstack/react-query";
+import { useMemo } from "react";
+
+export function usePiModelCatalog(enabled: boolean) {
+ const trpc = useHostTRPC();
+ const cloudRegion = useAuthStateValue((state) => state.cloudRegion);
+ const apiHost = useMemo(
+ () => (cloudRegion ? getCloudUrlFromRegion(cloudRegion) : null),
+ [cloudRegion],
+ );
+
+ return useQuery({
+ ...trpc.agent.getPiModelCatalog.queryOptions({
+ apiHost: apiHost ?? "",
+ region: cloudRegion ?? "us",
+ }),
+ enabled: enabled && apiHost !== null,
+ });
+}
diff --git a/products/desktop/packages/ui/src/features/scouts/components/FleetFindingsCallout.tsx b/products/desktop/packages/ui/src/features/scouts/components/FleetFindingsCallout.tsx
index 45e6ac04401c..ba2ee222c293 100644
--- a/products/desktop/packages/ui/src/features/scouts/components/FleetFindingsCallout.tsx
+++ b/products/desktop/packages/ui/src/features/scouts/components/FleetFindingsCallout.tsx
@@ -45,10 +45,10 @@ export function FleetFindingsCallout() {
<SparkleIcon size={20} className="shrink-0 text-(--iris-9)" />
<Flex direction="column" gap="0" className="min-w-0">
<Text className="font-medium text-[13px] text-gray-12">
- Scout findings
+ Scout signals
</Text>
<Text className="truncate text-[12px] text-gray-11 leading-snug">
- {summary.totalCount} finding{summary.totalCount === 1 ? "" : "s"}{" "}
+ {summary.totalCount} signal{summary.totalCount === 1 ? "" : "s"}{" "}
across {summary.scoutCount} scout
{summary.scoutCount === 1 ? "" : "s"}
{summary.latestEmittedAt ? (
diff --git a/products/desktop/packages/ui/src/features/scouts/components/ScoutBadges.tsx b/products/desktop/packages/ui/src/features/scouts/components/ScoutBadges.tsx
index 4245298dfa1e..952e5cbf39b5 100644
--- a/products/desktop/packages/ui/src/features/scouts/components/ScoutBadges.tsx
+++ b/products/desktop/packages/ui/src/features/scouts/components/ScoutBadges.tsx
@@ -27,7 +27,7 @@ export function ScoutOriginBadge({ config }: { config: ScoutConfig }) {
export function DryRunBadge({ config }: { config: ScoutConfig }) {
if (config.emit) return null;
return (
- <Tooltip content="Runs on schedule but findings are not emitted to the Signals inbox">
+ <Tooltip content="Runs on schedule but signals are not emitted to the Signals inbox">
<Badge
variant="soft"
color="amber"
diff --git a/products/desktop/packages/ui/src/features/scouts/components/ScoutConfigControls.tsx b/products/desktop/packages/ui/src/features/scouts/components/ScoutConfigControls.tsx
index 49c1009af5f1..5947a7da1a4d 100644
--- a/products/desktop/packages/ui/src/features/scouts/components/ScoutConfigControls.tsx
+++ b/products/desktop/packages/ui/src/features/scouts/components/ScoutConfigControls.tsx
@@ -44,12 +44,19 @@ export function ScoutEnabledSwitch({
}: ScoutConfigControlsProps) {
return (
<Tooltip content={config.enabled ? "Disable scout" : "Enable scout"}>
- <Switch
- size="1"
- checked={config.enabled}
- onCheckedChange={(checked) => onUpdate(config.id, { enabled: checked })}
- aria-label={`${config.skill_name} enabled`}
- />
+ {/* Tooltip stamps its own data-state on its child, which would overwrite
+ the Switch's checked/unchecked state and leave the track stuck on the
+ accent color. Give it a span to stamp. */}
+ <span className="inline-flex">
+ <Switch
+ size="1"
+ checked={config.enabled}
+ onCheckedChange={(checked) =>
+ onUpdate(config.id, { enabled: checked })
+ }
+ aria-label={`${config.skill_name} enabled`}
+ />
+ </span>
</Tooltip>
);
}
@@ -70,7 +77,7 @@ export function ScoutConfigForm({
<Flex direction="column" className="min-w-0">
<Text className="text-[12px] text-gray-12">Mode</Text>
<Text className="text-[11.5px] text-gray-10">
- Dry run executes the scout but holds back its findings
+ Dry run executes the scout but holds back its signals
</Text>
</Flex>
<SettingsOptionSelect
diff --git a/products/desktop/packages/ui/src/features/scouts/components/ScoutEmissionCard.tsx b/products/desktop/packages/ui/src/features/scouts/components/ScoutEmissionCard.tsx
index 14b502ee9bf3..cf1e3fbb85f2 100644
--- a/products/desktop/packages/ui/src/features/scouts/components/ScoutEmissionCard.tsx
+++ b/products/desktop/packages/ui/src/features/scouts/components/ScoutEmissionCard.tsx
@@ -83,7 +83,7 @@ export function ScoutEmissionCard({
className={`shrink-0 text-gray-9 transition-transform duration-150 ${expanded ? "rotate-90" : ""}`}
/>
<CompassIcon size={14} className="shrink-0 text-(--iris-9)" />
- <Text className="font-medium text-[13px] text-gray-10">Finding</Text>
+ <Text className="font-medium text-[13px] text-gray-10">Signal</Text>
<SeverityBadge severity={emission.severity} />
<Text className="text-[11px] text-gray-10">
confidence {Math.round(emission.confidence * 100)}%
diff --git a/products/desktop/packages/ui/src/features/scouts/components/ScoutFindingDiscussButton.tsx b/products/desktop/packages/ui/src/features/scouts/components/ScoutFindingDiscussButton.tsx
index b539ad6650c7..fb83bf8c96ba 100644
--- a/products/desktop/packages/ui/src/features/scouts/components/ScoutFindingDiscussButton.tsx
+++ b/products/desktop/packages/ui/src/features/scouts/components/ScoutFindingDiscussButton.tsx
@@ -56,7 +56,7 @@ export function ScoutFindingDiscussButton({
const { runTask, isRunning } = useScoutChatTask({
prompt,
- taskLabel: "finding discussion",
+ taskLabel: "signal discussion",
loggerScope: "scout-finding-discuss",
chatType: "finding_discuss",
surface: "scout_detail",
@@ -85,7 +85,7 @@ export function ScoutFindingDiscussButton({
<button
type="button"
disabled={isRunning}
- title="Discuss this finding with your agent"
+ title="Discuss this signal with your agent"
className="inline-flex shrink-0 items-center gap-1 text-[11px] text-accent-11 no-underline transition-colors hover:text-accent-12 disabled:cursor-default disabled:opacity-60"
>
{isRunning ? <Spinner size="1" /> : <ChatCircleIcon size={11} />}
@@ -106,9 +106,9 @@ export function ScoutFindingDiscussButton({
}}
>
<TextArea
- aria-label="Question to discuss about this finding"
+ aria-label="Question to discuss about this signal"
autoFocus
- placeholder="Ask about this finding… (optional)"
+ placeholder="Ask about this signal… (optional)"
resize="vertical"
rows={5}
size="2"
diff --git a/products/desktop/packages/ui/src/features/scouts/components/ScoutFindingShareButton.tsx b/products/desktop/packages/ui/src/features/scouts/components/ScoutFindingShareButton.tsx
index c382c4f5689f..3559ef61f576 100644
--- a/products/desktop/packages/ui/src/features/scouts/components/ScoutFindingShareButton.tsx
+++ b/products/desktop/packages/ui/src/features/scouts/components/ScoutFindingShareButton.tsx
@@ -25,7 +25,7 @@ export function ScoutFindingShareButton({
navigator.clipboard
.writeText(url)
.then(() => {
- toast.success("Finding link copied");
+ toast.success("Signal link copied");
track(ANALYTICS_EVENTS.SCOUT_ACTION, {
action_type: "copy_finding_link",
surface: "scout_detail",
@@ -40,7 +40,7 @@ export function ScoutFindingShareButton({
<button
type="button"
onClick={handleCopyLink}
- title="Copy a link to this finding"
+ title="Copy a link to this signal"
className="inline-flex shrink-0 items-center gap-1 text-[11px] text-accent-11 no-underline transition-colors hover:text-accent-12"
>
<LinkIcon size={11} />
diff --git a/products/desktop/packages/ui/src/features/scouts/components/ScoutFindingsView.tsx b/products/desktop/packages/ui/src/features/scouts/components/ScoutFindingsView.tsx
index 92e36f4924a2..c3a87630a24c 100644
--- a/products/desktop/packages/ui/src/features/scouts/components/ScoutFindingsView.tsx
+++ b/products/desktop/packages/ui/src/features/scouts/components/ScoutFindingsView.tsx
@@ -65,9 +65,9 @@ export function ScoutFindingsView() {
<SparkleIcon size={12} className="shrink-0 text-gray-10" />
<Text
className="truncate whitespace-nowrap font-medium text-[13px]"
- title="Scout findings"
+ title="Scout signals"
>
- Scout findings
+ Scout signals
</Text>
</Flex>
),
@@ -115,7 +115,7 @@ export function ScoutFindingsView() {
<Flex align="center" gap="2">
<SparkleIcon size={20} className="shrink-0 text-(--iris-9)" />
<Text className="font-bold text-[22px] text-gray-12 leading-tight tracking-tight">
- Scout findings
+ Scout signals
</Text>
</Flex>
<Text className="max-w-2xl text-pretty text-[12.5px] text-gray-11 leading-relaxed">
@@ -132,7 +132,7 @@ export function ScoutFindingsView() {
{summary.totalCount > 0 ? (
<>
<Text className="text-[12px] text-gray-10">
- {summary.totalCount} finding
+ {summary.totalCount} signal
{summary.totalCount === 1 ? "" : "s"} · {summary.scoutCount}{" "}
scout{summary.scoutCount === 1 ? "" : "s"}
</Text>
@@ -149,8 +149,8 @@ export function ScoutFindingsView() {
) : null}
</Flex>
<Text className="text-[12px] text-gray-9">
- Covers findings from the most recent {SCOUT_RUNS_WINDOW_SPAN} of troop
- runs. Older findings live on in the inbox reports they produced.
+ Covers signals from the most recent {SCOUT_RUNS_WINDOW_SPAN} of troop
+ runs. Older signals live on in the inbox reports they produced.
</Text>
</Flex>
@@ -160,7 +160,7 @@ export function ScoutFindingsView() {
<Flex align="center" gap="2" wrap="wrap">
<TextField.Root
type="search"
- placeholder="Search findings…"
+ placeholder="Search signals…"
value={searchText}
onChange={(event) => setSearchText(event.target.value)}
size="2"
@@ -237,7 +237,7 @@ export function ScoutFindingsView() {
});
}}
>
- <Select.Trigger aria-label="Sort findings" />
+ <Select.Trigger aria-label="Sort signals" />
<Select.Content>
{SORT_OPTIONS.map((option) => (
<Select.Item key={option.value} value={option.value}>
@@ -260,7 +260,7 @@ export function ScoutFindingsView() {
className="rounded-(--radius-2) border border-(--amber-6) bg-(--amber-2) px-4 py-3 text-[12.5px]"
>
<Text className="flex-1 text-(--amber-11)">
- Some findings couldn&apos;t be loaded, so this list may be
+ Some signals couldn&apos;t be loaded, so this list may be
incomplete.
</Text>
<button
@@ -325,7 +325,7 @@ function FindingsBody({
className="rounded-(--radius-2) border border-(--gray-6) border-dashed bg-gray-1 px-4 py-8 text-center text-[12.5px] text-gray-11"
>
<Text className="text-[12.5px] text-gray-11">
- Couldn&apos;t load findings. The scout API may be unavailable or this
+ Couldn&apos;t load signals. The scout API may be unavailable or this
project may not be enrolled yet.
</Text>
<button
@@ -343,8 +343,8 @@ function FindingsBody({
return (
<Box className="rounded-(--radius-2) border border-(--gray-6) border-dashed bg-gray-1 px-4 py-8 text-center text-[12.5px] text-gray-11">
{isFiltering
- ? "No findings match your search and filters."
- : "Your scouts haven't emitted any findings yet. As they scan your project, what they surface shows up here."}
+ ? "No signals match your search and filters."
+ : "Your scouts haven't emitted any signals yet. As they scan your project, what they surface shows up here."}
</Box>
);
}
diff --git a/products/desktop/packages/ui/src/features/sessions/components/ReasoningLevelSelector.test.tsx b/products/desktop/packages/ui/src/features/sessions/components/ReasoningLevelSelector.test.tsx
index cbf39c94e100..e041a29d2668 100644
--- a/products/desktop/packages/ui/src/features/sessions/components/ReasoningLevelSelector.test.tsx
+++ b/products/desktop/packages/ui/src/features/sessions/components/ReasoningLevelSelector.test.tsx
@@ -65,6 +65,21 @@ function claudeModelOption(
} as unknown as SessionConfigOption;
}
+function effortlessModelOption(): SessionConfigOption {
+ return {
+ type: "select",
+ id: "model",
+ name: "Model",
+ category: "model",
+ currentValue: "moonshotai/kimi-k3",
+ options: [
+ { name: "Claude Sonnet 5", value: "claude-sonnet-5" },
+ { name: "Claude Opus 5", value: "claude-opus-5" },
+ { name: "Kimi K3", value: "moonshotai/kimi-k3" },
+ ],
+ } as unknown as SessionConfigOption;
+}
+
function contextOption(currentValue = "1m"): SessionConfigOption {
return {
type: "select",
@@ -423,4 +438,87 @@ describe("ReasoningLevelSelector", () => {
);
expect(screen.queryByRole("button")).not.toBeInTheDocument();
});
+
+ it("keeps the model picker when the model has no reasoning levels", async () => {
+ const onModelChange = vi.fn();
+ const user = userEvent.setup({ pointerEventsCheck: 0 });
+ render(
+ <Theme>
+ <ReasoningLevelSelector
+ modelOption={effortlessModelOption()}
+ adapter="claude"
+ onModelChange={onModelChange}
+ />
+ </Theme>,
+ );
+
+ await user.click(screen.getByRole("button", { name: "Model: Kimi K3" }));
+ await openSub(user, /^Model/);
+ fireEvent.click(
+ await screen.findByRole("menuitemradio", { name: "Claude Opus 5" }),
+ );
+
+ await pollUntil(() => onModelChange.mock.calls.length > 0);
+ expect(onModelChange).toHaveBeenCalledWith("claude-opus-5");
+ });
+
+ it("hides the reasoning submenu and slider for an effort-less model", async () => {
+ const user = userEvent.setup({ pointerEventsCheck: 0 });
+ render(
+ <Theme>
+ <ReasoningLevelSelector
+ modelOption={effortlessModelOption()}
+ adapter="claude"
+ />
+ </Theme>,
+ );
+
+ await user.click(screen.getByRole("button", { name: "Model: Kimi K3" }));
+ expect(
+ await screen.findByRole("menuitem", { name: /^Model/ }),
+ ).toBeInTheDocument();
+ expect(
+ screen.queryByRole("menuitem", { name: /^Reasoning/ }),
+ ).not.toBeInTheDocument();
+ expect(screen.queryByRole("slider")).not.toBeInTheDocument();
+ });
+
+ it("drops the stale effort label when switching to an effort-less model", () => {
+ const { rerender } = render(
+ <Theme>
+ <ReasoningLevelSelector
+ thoughtOption={thoughtOption()}
+ modelOption={claudeModelOption()}
+ adapter="claude"
+ />
+ </Theme>,
+ );
+
+ rerender(
+ <Theme>
+ <ReasoningLevelSelector
+ modelOption={effortlessModelOption()}
+ adapter="claude"
+ />
+ </Theme>,
+ );
+
+ expect(
+ screen.getByRole("button", { name: "Model: Kimi K3" }),
+ ).toBeInTheDocument();
+ expect(screen.queryByText("High")).not.toBeInTheDocument();
+ });
+
+ it("shows a loading placeholder while the first config loads", () => {
+ render(
+ <Theme>
+ <ReasoningLevelSelector isLoading />
+ </Theme>,
+ );
+
+ expect(screen.getByRole("button", { name: /Loading/ })).toHaveAttribute(
+ "aria-disabled",
+ "true",
+ );
+ });
});
diff --git a/products/desktop/packages/ui/src/features/sessions/components/ReasoningLevelSelector.tsx b/products/desktop/packages/ui/src/features/sessions/components/ReasoningLevelSelector.tsx
index 48f47a2d7e65..03179f28ce2f 100644
--- a/products/desktop/packages/ui/src/features/sessions/components/ReasoningLevelSelector.tsx
+++ b/products/desktop/packages/ui/src/features/sessions/components/ReasoningLevelSelector.tsx
@@ -144,26 +144,39 @@ export function ReasoningLevelSelector({
const displayModel = useRetainedConfigOption(modelOption);
const fastModeFlagEnabled = useFeatureFlag(FAST_MODE_FLAG);
- // Genuinely no reasoning levels for this harness/model: hide. While the
- // preview config reloads (a harness switch) keep showing the last value,
- // disabled, so the toolbar doesn't collapse mid-switch.
- if (!thoughtOption && !isLoading) return null;
- if (!displayThought || displayThought.type !== "select") {
+ // An effort-less model has no thought option once the config settles; the
+ // pill is the only model picker, so it must stay rendered to switch away.
+ const effortless = !thoughtOption && !isLoading;
+ const thoughtSelect =
+ !effortless && displayThought?.type === "select"
+ ? displayThought
+ : undefined;
+ const effortOptions = thoughtSelect ? toDropdownOptions(thoughtSelect) : [];
+ const hasEffort = effortOptions.length > 0;
+
+ const modelSelect =
+ displayModel?.type === "select" ? displayModel : undefined;
+
+ if (!hasEffort && !modelSelect) {
+ if (isLoading) {
+ return (
+ <Button type="button" variant="default" size="sm" disabled>
+ <Spinner size={12} className="animate-spin" />
+ Loading...
+ </Button>
+ );
+ }
return null;
}
- const isReloading = !thoughtOption;
+ const isReloading = !effortless && !thoughtOption;
const isDisabled = disabled || isReloading;
- const effortOptions = toDropdownOptions(displayThought);
- if (effortOptions.length === 0) return null;
- const currentEffort = displayThought.currentValue;
- const effortLabel =
- effortOptions.find((option) => option.value === currentEffort)?.label ??
- currentEffort;
-
- const modelSelect =
- displayModel?.type === "select" ? displayModel : undefined;
+ const currentEffort = thoughtSelect?.currentValue;
+ const effortLabel = currentEffort
+ ? (effortOptions.find((option) => option.value === currentEffort)?.label ??
+ currentEffort)
+ : undefined;
const modelEntries = modelSelect
? flattenSelectOptions(modelSelect.options)
: [];
@@ -218,13 +231,14 @@ export function ReasoningLevelSelector({
}));
const currentStopKey = useLadder
? `${currentModel}${STOP_SEPARATOR}${currentEffort}`
- : currentEffort;
+ : (currentEffort ?? "");
// A custom Advanced combination (off the preset ladder) hides the slider:
// the menu opens straight on the Advanced view until Reset to default puts
// the session back on a notch.
- const onNotch =
- !useLadder || ladderStops.some((stop) => stop.key === currentStopKey);
+ const onNotch = useLadder
+ ? ladderStops.some((stop) => stop.key === currentStopKey)
+ : hasEffort;
const handleStopSelect = (key: string) => {
if (key.includes(STOP_SEPARATOR)) {
@@ -305,18 +319,12 @@ export function ReasoningLevelSelector({
});
};
- if (isLoading && !open && !displayThought) {
- return (
- <Button type="button" variant="default" size="sm" disabled>
- <Spinner size={12} className="animate-spin" />
- Loading...
- </Button>
- );
- }
-
- const triggerAriaLabel = modelLabel
- ? `Model and reasoning: ${modelLabel} ${effortLabel}`
- : `Reasoning: ${effortLabel}`;
+ const triggerAriaLabel =
+ modelLabel && effortLabel
+ ? `Model and reasoning: ${modelLabel} ${effortLabel}`
+ : modelLabel
+ ? `Model: ${modelLabel}`
+ : `Reasoning: ${effortLabel}`;
return (
<DropdownMenu
@@ -363,13 +371,17 @@ export function ReasoningLevelSelector({
{modelLabel && (
<span className="font-medium text-foreground">{modelLabel}</span>
)}
- <span
- className={
- modelLabel ? "font-normal text-muted-foreground/80" : undefined
- }
- >
- {effortLabel}
- </span>
+ {effortLabel && (
+ <span
+ className={
+ modelLabel
+ ? "font-normal text-muted-foreground/80"
+ : undefined
+ }
+ >
+ {effortLabel}
+ </span>
+ )}
<CaretDown
size={10}
weight="bold"
@@ -475,26 +487,28 @@ export function ReasoningLevelSelector({
</DropdownMenuSubContent>
</DropdownMenuSub>
)}
- <DropdownMenuSub>
- <DropdownMenuSubTrigger>
- <span>Reasoning</span>
- <span className="flex-1 text-right text-muted-foreground">
- {effortLabel}
- </span>
- </DropdownMenuSubTrigger>
- <DropdownMenuSubContent>
- <DropdownMenuRadioGroup
- value={currentEffort}
- onValueChange={(value) =>
- selectAndClose(() => onChange?.(value))
- }
- >
- {effortOptions.map((option) => (
- <LevelItem key={option.value} option={option} />
- ))}
- </DropdownMenuRadioGroup>
- </DropdownMenuSubContent>
- </DropdownMenuSub>
+ {hasEffort && (
+ <DropdownMenuSub>
+ <DropdownMenuSubTrigger>
+ <span>Reasoning</span>
+ <span className="flex-1 text-right text-muted-foreground">
+ {effortLabel}
+ </span>
+ </DropdownMenuSubTrigger>
+ <DropdownMenuSubContent>
+ <DropdownMenuRadioGroup
+ value={currentEffort ?? ""}
+ onValueChange={(value) =>
+ selectAndClose(() => onChange?.(value))
+ }
+ >
+ {effortOptions.map((option) => (
+ <LevelItem key={option.value} option={option} />
+ ))}
+ </DropdownMenuRadioGroup>
+ </DropdownMenuSubContent>
+ </DropdownMenuSub>
+ )}
{toggleRows.map((row) => (
<DropdownMenuSub key={row.id}>
<DropdownMenuSubTrigger>
diff --git a/products/desktop/packages/ui/src/features/sessions/components/SessionInitializingView.test.tsx b/products/desktop/packages/ui/src/features/sessions/components/SessionInitializingView.test.tsx
new file mode 100644
index 000000000000..211a7b542584
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/sessions/components/SessionInitializingView.test.tsx
@@ -0,0 +1,50 @@
+import { Theme } from "@radix-ui/themes";
+import { act, render, screen } from "@testing-library/react";
+import { afterEach, describe, expect, it, vi } from "vitest";
+import { SessionInitializingView } from "./SessionInitializingView";
+
+afterEach(() => {
+ vi.useRealTimers();
+});
+
+describe("SessionInitializingView", () => {
+ it.each([
+ {
+ executionTarget: "local" as const,
+ heading: "Starting Pi…",
+ subtitle: "Connecting to Pi on this device.",
+ },
+ {
+ executionTarget: "cloud" as const,
+ heading: "Getting things ready…",
+ subtitle: "Connecting to your cloud runner.",
+ },
+ {
+ executionTarget: "cloud" as const,
+ cloudStatus: "in_progress" as const,
+ heading: "Starting the sandbox…",
+ subtitle: "Connecting to your cloud runner.",
+ },
+ ])(
+ "shows $executionTarget connection copy",
+ ({ executionTarget, cloudStatus, heading, subtitle }) => {
+ vi.useFakeTimers();
+
+ render(
+ <Theme>
+ <SessionInitializingView
+ executionTarget={executionTarget}
+ cloudStatus={cloudStatus}
+ />
+ </Theme>,
+ );
+
+ act(() => {
+ vi.advanceTimersByTime(2000);
+ });
+
+ expect(screen.getByText(heading)).toBeInTheDocument();
+ expect(screen.getByText(subtitle)).toBeInTheDocument();
+ },
+ );
+});
diff --git a/products/desktop/packages/ui/src/features/sessions/components/CloudInitializingView.tsx b/products/desktop/packages/ui/src/features/sessions/components/SessionInitializingView.tsx
similarity index 78%
rename from products/desktop/packages/ui/src/features/sessions/components/CloudInitializingView.tsx
rename to products/desktop/packages/ui/src/features/sessions/components/SessionInitializingView.tsx
index 8e77036a093c..7ee16c32773d 100644
--- a/products/desktop/packages/ui/src/features/sessions/components/CloudInitializingView.tsx
+++ b/products/desktop/packages/ui/src/features/sessions/components/SessionInitializingView.tsx
@@ -4,18 +4,26 @@ import { Flex, Text } from "@radix-ui/themes";
import { useEffect, useState } from "react";
import zenHedgehog from "../../../assets/images/zen.png";
-interface CloudInitializingViewProps {
- cloudStatus: TaskRunStatus | null;
+interface SessionInitializingViewProps {
+ executionTarget: "cloud" | "local";
+ cloudStatus?: TaskRunStatus | null;
heading?: string;
subtitle?: string;
}
const REVEAL_DELAY_MS = 2000;
-function copyFor(cloudStatus: TaskRunStatus | null): {
- heading: string;
- subtitle: string;
-} {
+function copyFor(
+ executionTarget: "cloud" | "local",
+ cloudStatus: TaskRunStatus | null | undefined,
+): { heading: string; subtitle: string } {
+ if (executionTarget === "local") {
+ return {
+ heading: "Starting Pi…",
+ subtitle: "Connecting to Pi on this device.",
+ };
+ }
+
switch (cloudStatus) {
case "queued":
return {
@@ -35,12 +43,13 @@ function copyFor(cloudStatus: TaskRunStatus | null): {
}
}
-export function CloudInitializingView({
+export function SessionInitializingView({
+ executionTarget,
cloudStatus,
heading,
subtitle,
-}: CloudInitializingViewProps) {
- const copy = copyFor(cloudStatus);
+}: SessionInitializingViewProps) {
+ const copy = copyFor(executionTarget, cloudStatus);
const visibleHeading = heading ?? copy.heading;
const visibleSubtitle = subtitle ?? copy.subtitle;
diff --git a/products/desktop/packages/ui/src/features/sessions/components/SessionView.tsx b/products/desktop/packages/ui/src/features/sessions/components/SessionView.tsx
index cbaa79033efa..6ff998403f57 100644
--- a/products/desktop/packages/ui/src/features/sessions/components/SessionView.tsx
+++ b/products/desktop/packages/ui/src/features/sessions/components/SessionView.tsx
@@ -23,7 +23,6 @@ import { useDraftStore } from "@posthog/ui/features/message-editor/draftStore";
import { useAutoFocusOnTyping } from "@posthog/ui/features/message-editor/useAutoFocusOnTyping";
import { resolveAndAttachDroppedFiles } from "@posthog/ui/features/message-editor/utils/persistFile";
import { PermissionSelector } from "@posthog/ui/features/permissions/PermissionSelector";
-import { CloudInitializingView } from "@posthog/ui/features/sessions/components/CloudInitializingView";
import {
CloudStreamDisconnectedBanner,
ConnectingToAgent,
@@ -34,11 +33,13 @@ import {
getGithubRefUrlFromEventTarget,
} from "@posthog/ui/features/sessions/components/copyContextTarget";
import { DropZoneOverlay } from "@posthog/ui/features/sessions/components/DropZoneOverlay";
+import { focusComposerOnPaneClick } from "@posthog/ui/features/sessions/components/focusComposerOnPaneClick";
import { PendingChatView } from "@posthog/ui/features/sessions/components/PendingChatView";
import { PlanStatusBar } from "@posthog/ui/features/sessions/components/PlanStatusBar";
import { QueuedMessagesDock } from "@posthog/ui/features/sessions/components/QueuedMessagesDock";
import { ReasoningLevelSelector } from "@posthog/ui/features/sessions/components/ReasoningLevelSelector";
import { RawLogsView } from "@posthog/ui/features/sessions/components/raw-logs/RawLogsView";
+import { SessionInitializingView } from "@posthog/ui/features/sessions/components/SessionInitializingView";
import { SessionResourcesBar } from "@posthog/ui/features/sessions/components/SessionResourcesBar";
import { SteerQueueToggle } from "@posthog/ui/features/sessions/components/SteerQueueToggle";
import {
@@ -122,7 +123,7 @@ function ComposerWidth({
}) {
return (
<Box
- className={compact ? "p-1" : "mx-auto pb-3"}
+ className={compact ? "p-1" : "mx-auto pb-2"}
style={compact ? undefined : { maxWidth: CHAT_CONTENT_MAX_WIDTH }}
>
{children}
@@ -502,21 +503,8 @@ export function SessionView({
.catch(() => toast.error("Failed to attach files"));
}, []);
- const handlePaneClick = useCallback((e: React.MouseEvent) => {
- const target = e.target as HTMLElement;
-
- const interactiveSelector =
- 'button, a, input, textarea, select, [role="button"], [role="link"], [contenteditable="true"], [data-interactive]';
- if (target.closest(interactiveSelector)) {
- return;
- }
-
- const selection = window.getSelection();
- if (selection && selection.toString().length > 0) {
- return;
- }
-
- editorRef.current?.focus();
+ const handlePaneClick = useCallback((event: React.MouseEvent) => {
+ focusComposerOnPaneClick(event, () => editorRef.current?.focus());
}, []);
useAutoFocusOnTyping(editorRef, !isActiveSession);
@@ -620,7 +608,10 @@ export function SessionView({
</>
) : isInitializing ? (
isCloud ? (
- <CloudInitializingView cloudStatus={cloudStatus} />
+ <SessionInitializingView
+ executionTarget="cloud"
+ cloudStatus={cloudStatus}
+ />
) : pendingTaskPrompt?.promptText ? (
<PendingChatView
promptText={pendingTaskPrompt.promptText}
@@ -767,7 +758,7 @@ export function SessionView({
enableBashMode={!isCloudRun}
modelSelector={null}
reasoningSelector={
- thoughtOption ? (
+ thoughtOption || sessionModelOption ? (
<ReasoningLevelSelector
thoughtOption={thoughtOption}
modelOption={sessionModelOption}
diff --git a/products/desktop/packages/ui/src/features/sessions/components/chat-thread/ChatThread.tsx b/products/desktop/packages/ui/src/features/sessions/components/chat-thread/ChatThread.tsx
index 46ae7513f0f6..e96ed83084aa 100644
--- a/products/desktop/packages/ui/src/features/sessions/components/chat-thread/ChatThread.tsx
+++ b/products/desktop/packages/ui/src/features/sessions/components/chat-thread/ChatThread.tsx
@@ -91,6 +91,7 @@ import {
MentionChip,
parseFileMentions,
} from "@posthog/ui/features/sessions/components/session-update/parseFileMentions";
+import { collapsePiSkillInvocation } from "@posthog/ui/features/sessions/components/session-update/piSkillInvocation";
import { SessionUpdateView } from "@posthog/ui/features/sessions/components/session-update/SessionUpdateView";
import { UserShellExecuteView } from "@posthog/ui/features/sessions/components/session-update/UserShellExecuteView";
import { UserMessageAttachments } from "@posthog/ui/features/sessions/components/UserMessageAttachments";
@@ -361,9 +362,9 @@ function UserBubble({
() => extractCustomInstructions(afterCanvasInstructions),
[afterCanvasInstructions],
);
- const displayContent = customInstructions
- ? customInstructions.stripped
- : afterCanvasInstructions;
+ const displayContent = collapsePiSkillInvocation(
+ customInstructions ? customInstructions.stripped : afterCanvasInstructions,
+ );
const showChannelContextTag = !!channelContext && bluebirdEnabled;
const showCanvasInstructionsTag = !!canvasInstructions && bluebirdEnabled;
const showHeaderChips = showChannelContextTag || showCanvasInstructionsTag;
diff --git a/products/desktop/packages/ui/src/features/sessions/components/chat-thread/composerPromptRecall.test.ts b/products/desktop/packages/ui/src/features/sessions/components/chat-thread/composerPromptRecall.test.ts
index 2781320de4b3..9829761128f3 100644
--- a/products/desktop/packages/ui/src/features/sessions/components/chat-thread/composerPromptRecall.test.ts
+++ b/products/desktop/packages/ui/src/features/sessions/components/chat-thread/composerPromptRecall.test.ts
@@ -186,7 +186,7 @@ describe("resolvePromptRecall", () => {
{
name: "a custom instructions block",
content:
- "fix the bug\n\n<user_custom_instructions>be terse</user_custom_instructions>",
+ "fix the bug\n\n<user_custom_instructions>\nThe user has saved custom instructions that apply to all of their tasks. Follow them.\n\nbe terse\n</user_custom_instructions>",
},
{
name: "a trailing attachment summary",
@@ -195,7 +195,7 @@ describe("resolvePromptRecall", () => {
{
name: "several injected blocks at once",
content:
- '<channel_context channel="growth">CONTEXT.md body</channel_context>\n\nfix the bug\n\n<user_custom_instructions>be terse</user_custom_instructions>',
+ '<channel_context channel="growth">CONTEXT.md body</channel_context>\n\nfix the bug\n\n<user_custom_instructions>\nThe user has saved custom instructions that apply to all of their tasks. Follow them.\n\nbe terse\n</user_custom_instructions>',
},
])("strips $name from the recalled text", ({ content }) => {
expect(resolvePromptRecall([{ id: "m1", content }], null, -1)).toEqual({
diff --git a/products/desktop/packages/ui/src/features/sessions/components/focusComposerOnPaneClick.test.ts b/products/desktop/packages/ui/src/features/sessions/components/focusComposerOnPaneClick.test.ts
new file mode 100644
index 000000000000..bde422324c7f
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/sessions/components/focusComposerOnPaneClick.test.ts
@@ -0,0 +1,53 @@
+import type { MouseEvent as ReactMouseEvent } from "react";
+import { afterEach, describe, expect, it, vi } from "vitest";
+import { focusComposerOnPaneClick } from "./focusComposerOnPaneClick";
+
+function clickTarget(target: EventTarget): Pick<ReactMouseEvent, "target"> {
+ return { target };
+}
+
+afterEach(() => {
+ window.getSelection()?.removeAllRanges();
+ document.body.replaceChildren();
+});
+
+describe("focusComposerOnPaneClick", () => {
+ it.each([
+ {
+ name: "chat content",
+ markup: '<p id="target">Chat content</p>',
+ expectsFocus: true,
+ },
+ {
+ name: "an interactive element",
+ markup: '<button id="target">Open</button>',
+ expectsFocus: false,
+ },
+ {
+ name: "content marked as interactive",
+ markup: '<span id="target" data-interactive>Open</span>',
+ expectsFocus: false,
+ },
+ ])("focuses for $name only when appropriate", ({ markup, expectsFocus }) => {
+ document.body.innerHTML = markup;
+ const focusComposer = vi.fn();
+ const target = document.getElementById("target") as HTMLElement;
+
+ focusComposerOnPaneClick(clickTarget(target), focusComposer);
+
+ expect(focusComposer).toHaveBeenCalledTimes(expectsFocus ? 1 : 0);
+ });
+
+ it("does not focus while selecting chat content", () => {
+ document.body.innerHTML = '<p id="target">Chat content</p>';
+ const target = document.getElementById("target") as HTMLElement;
+ const range = document.createRange();
+ range.selectNodeContents(target);
+ window.getSelection()?.addRange(range);
+ const focusComposer = vi.fn();
+
+ focusComposerOnPaneClick(clickTarget(target), focusComposer);
+
+ expect(focusComposer).not.toHaveBeenCalled();
+ });
+});
diff --git a/products/desktop/packages/ui/src/features/sessions/components/focusComposerOnPaneClick.ts b/products/desktop/packages/ui/src/features/sessions/components/focusComposerOnPaneClick.ts
new file mode 100644
index 000000000000..a23d29698c67
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/sessions/components/focusComposerOnPaneClick.ts
@@ -0,0 +1,21 @@
+import type { MouseEvent } from "react";
+
+const INTERACTIVE_SELECTOR =
+ 'button, a, input, textarea, select, [role="button"], [role="link"], [contenteditable="true"], [data-interactive]';
+
+export function focusComposerOnPaneClick(
+ event: Pick<MouseEvent, "target">,
+ focusComposer: () => void,
+): void {
+ const target = event.target;
+ if (!(target instanceof Element) || target.closest(INTERACTIVE_SELECTOR)) {
+ return;
+ }
+
+ const selection = window.getSelection();
+ if (selection && selection.toString().length > 0) {
+ return;
+ }
+
+ focusComposer();
+}
diff --git a/products/desktop/packages/ui/src/features/sessions/components/session-update/StatusNotificationView.test.ts b/products/desktop/packages/ui/src/features/sessions/components/session-update/StatusNotificationView.test.ts
index d3be297220fa..9ed69e072acc 100644
--- a/products/desktop/packages/ui/src/features/sessions/components/session-update/StatusNotificationView.test.ts
+++ b/products/desktop/packages/ui/src/features/sessions/components/session-update/StatusNotificationView.test.ts
@@ -1,5 +1,8 @@
import { describe, expect, it } from "vitest";
-import { formatCompactionFailure } from "./StatusNotificationView";
+import {
+ formatCompactionFailure,
+ formatRetryStatus,
+} from "./StatusNotificationView";
describe("formatCompactionFailure", () => {
it.each([
@@ -16,3 +19,37 @@ describe("formatCompactionFailure", () => {
expect(formatCompactionFailure(error)).toBe(expected);
});
});
+
+describe("formatRetryStatus", () => {
+ it.each([
+ {
+ input: {
+ attempt: 1,
+ maxAttempts: 3,
+ message: "Rate limit reached for gpt-5.6-terra on token ...",
+ remainingMs: 0,
+ },
+ expected: "Rate limit reached. Retrying now (attempt 1 of 3)",
+ },
+ {
+ input: {
+ attempt: 2,
+ maxAttempts: 3,
+ message: "Rate limited",
+ remainingMs: 2_000,
+ },
+ expected: "Rate limit reached. Retrying in 2s (attempt 2 of 3)",
+ },
+ {
+ input: {
+ attempt: 2,
+ maxAttempts: 3,
+ message: "Server overloaded",
+ remainingMs: 2_000,
+ },
+ expected: "Retrying in 2s (attempt 2 of 3)",
+ },
+ ])("renders a concise retry message", ({ input, expected }) => {
+ expect(formatRetryStatus(input)).toBe(expected);
+ });
+});
diff --git a/products/desktop/packages/ui/src/features/sessions/components/session-update/StatusNotificationView.tsx b/products/desktop/packages/ui/src/features/sessions/components/session-update/StatusNotificationView.tsx
index bb468e5794e0..e1e3b15b76f1 100644
--- a/products/desktop/packages/ui/src/features/sessions/components/session-update/StatusNotificationView.tsx
+++ b/products/desktop/packages/ui/src/features/sessions/components/session-update/StatusNotificationView.tsx
@@ -35,6 +35,29 @@ export function formatCompactionFailure(error?: string): string {
return detail ? `Compacting failed: ${detail}` : "Compacting failed";
}
+export function formatRetryStatus({
+ attempt,
+ maxAttempts,
+ message,
+ remainingMs,
+}: {
+ attempt?: number;
+ maxAttempts?: number;
+ message?: string;
+ remainingMs: number;
+}): string {
+ const rateLimited = /\b429\b|rate[ _]limit(?:ed)?|too many requests/i.test(
+ message ?? "",
+ );
+ const retryAt =
+ remainingMs > 0 ? `in ${formatDuration(remainingMs, 0)}` : "now";
+ const attemptLabel =
+ attempt && maxAttempts ? ` (attempt ${attempt} of ${maxAttempts})` : "";
+ const prefix = rateLimited ? "Rate limit reached. " : "";
+
+ return `${prefix}Retrying ${retryAt}${attemptLabel}`;
+}
+
export function StatusNotificationView({
status,
isComplete,
@@ -179,14 +202,12 @@ function RetryingStatusView({
return () => clearInterval(interval);
}, [delayMs, startedAt]);
- const attemptLabel =
- attempt && maxAttempts
- ? `Attempt ${attempt} of ${maxAttempts}`
- : "Retrying";
- const retryLabel =
- remainingMs > 0
- ? `${attemptLabel} in ${formatDuration(remainingMs, 1)}`
- : `${attemptLabel} now`;
+ const retryLabel = formatRetryStatus({
+ attempt,
+ maxAttempts,
+ message,
+ remainingMs,
+ });
return (
<ChatMarker variant="separator">
@@ -194,9 +215,6 @@ function RetryingStatusView({
<Flex align="center" gap="2">
<ArrowsClockwise size={13} className="animate-spin text-amber-9" />
<Text className="text-[13px] text-gray-11">{retryLabel}</Text>
- {message && (
- <Text className="truncate text-[13px] text-gray-10">{message}</Text>
- )}
</Flex>
</ChatMarkerContent>
</ChatMarker>
diff --git a/products/desktop/packages/ui/src/features/sessions/components/session-update/UserMessage.test.tsx b/products/desktop/packages/ui/src/features/sessions/components/session-update/UserMessage.test.tsx
index f78b4b091c39..6d5f0bf51acd 100644
--- a/products/desktop/packages/ui/src/features/sessions/components/session-update/UserMessage.test.tsx
+++ b/products/desktop/packages/ui/src/features/sessions/components/session-update/UserMessage.test.tsx
@@ -30,6 +30,9 @@ const PROMPT_WITH_CONTEXT =
const PROMPT_WITH_CANVAS_INSTRUCTIONS =
"add a retention chart\n\n<canvas_generation_instructions>\nauthoring contract\n</canvas_generation_instructions>";
+const PROMPT_WITH_PI_SKILL =
+ '<skill name="code-review" location="/skills/code-review/SKILL.md">\nReferences are relative to /skills/code-review.\n\n# Review\n\nInspect the diff.\n</skill>\n\nReview this pull request.';
+
describe("UserMessage", () => {
// useFeatureFlag falls back to import.meta.env.DEV, which is true under
// vitest. Pin DEV off in the flag-gating cases so they exercise the flag
@@ -79,6 +82,14 @@ describe("UserMessage", () => {
expect(screen.queryByText(/channel_context/)).not.toBeInTheDocument();
});
+ it("renders Pi skill invocations as a command chip", () => {
+ renderWithFlags(<UserMessage content={PROMPT_WITH_PI_SKILL} />, true);
+
+ expect(screen.getByText("/code-review")).toBeInTheDocument();
+ expect(screen.getByText("Review this pull request.")).toBeInTheDocument();
+ expect(screen.queryByText("Inspect the diff.")).not.toBeInTheDocument();
+ });
+
it("shows the canvas-instructions tag when project-bluebird is enabled", () => {
vi.stubEnv("DEV", false);
renderWithFlags(
diff --git a/products/desktop/packages/ui/src/features/sessions/components/session-update/UserMessage.tsx b/products/desktop/packages/ui/src/features/sessions/components/session-update/UserMessage.tsx
index 00cf6ff9662e..74d7a5dc05cf 100644
--- a/products/desktop/packages/ui/src/features/sessions/components/session-update/UserMessage.tsx
+++ b/products/desktop/packages/ui/src/features/sessions/components/session-update/UserMessage.tsx
@@ -24,6 +24,7 @@ import {
MentionChip,
parseFileMentions,
} from "./parseFileMentions";
+import { collapsePiSkillInvocation } from "./piSkillInvocation";
interface UserMessageProps {
content: string;
@@ -92,9 +93,9 @@ export const UserMessage = memo(function UserMessage({
() => extractCustomInstructions(afterCanvasInstructions),
[afterCanvasInstructions],
);
- const displayContent = customInstructions
- ? customInstructions.stripped
- : afterCanvasInstructions;
+ const displayContent = collapsePiSkillInvocation(
+ customInstructions ? customInstructions.stripped : afterCanvasInstructions,
+ );
const showChannelContextTag = !!channelContext && bluebirdEnabled;
const showCanvasInstructionsTag = !!canvasInstructions && bluebirdEnabled;
const openChannelContextInSplit = usePanelLayoutStore(
diff --git a/products/desktop/packages/ui/src/features/sessions/components/session-update/customInstructions.test.ts b/products/desktop/packages/ui/src/features/sessions/components/session-update/customInstructions.test.ts
index c4680da96280..f4671e48edaa 100644
--- a/products/desktop/packages/ui/src/features/sessions/components/session-update/customInstructions.test.ts
+++ b/products/desktop/packages/ui/src/features/sessions/components/session-update/customInstructions.test.ts
@@ -22,9 +22,17 @@ describe("extractCustomInstructions", () => {
it("strips the element even when it is the only content", () => {
const result = extractCustomInstructions(
- "<user_custom_instructions>\nbody\n</user_custom_instructions>",
+ "<user_custom_instructions>\nThe user has saved custom instructions that apply to all of their tasks. Follow them.\n\nbody\n</user_custom_instructions>",
);
- expect(result?.body).toBe("body");
+ expect(result?.body).toContain("body");
expect(result?.stripped).toBe("");
});
+
+ it("preserves user-authored custom-instruction tags", () => {
+ const content =
+ "Render this example: <user_custom_instructions>be terse</user_custom_instructions>";
+
+ expect(extractCustomInstructions(content)).toBeNull();
+ expect(hasCustomInstructions(content)).toBe(false);
+ });
});
diff --git a/products/desktop/packages/ui/src/features/sessions/components/session-update/customInstructions.ts b/products/desktop/packages/ui/src/features/sessions/components/session-update/customInstructions.ts
index 82f1d112cef9..37db70bb8c8a 100644
--- a/products/desktop/packages/ui/src/features/sessions/components/session-update/customInstructions.ts
+++ b/products/desktop/packages/ui/src/features/sessions/components/session-update/customInstructions.ts
@@ -7,8 +7,12 @@
//
// The body shown is exactly what was sent in the prompt — parsed from the stored
// event, never re-read from the (possibly newer) live setting.
+// The tag alone is not enough to identify injected metadata: users may include
+// the same XML in examples they want displayed verbatim. Match the fixed
+// preamble emitted by buildCustomInstructionsText so only system-generated
+// blocks are hidden.
const CUSTOM_INSTRUCTIONS_REGEX =
- /<user_custom_instructions\b[^>]*>([\s\S]*?)<\/user_custom_instructions>/;
+ /<user_custom_instructions\b[^>]*>(\r?\nThe user has saved custom instructions that apply to all of their tasks\. Follow them\.\r?\n\r?\n[\s\S]*?)<\/user_custom_instructions>/;
export function hasCustomInstructions(content: string): boolean {
return CUSTOM_INSTRUCTIONS_REGEX.test(content);
diff --git a/products/desktop/packages/ui/src/features/sessions/components/session-update/parseFileMentions.test.ts b/products/desktop/packages/ui/src/features/sessions/components/session-update/parseFileMentions.test.ts
new file mode 100644
index 000000000000..bd4fda670eb0
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/sessions/components/session-update/parseFileMentions.test.ts
@@ -0,0 +1,18 @@
+import { describe, expect, it } from "vitest";
+import { collapsePiSkillInvocation } from "./piSkillInvocation";
+
+describe("collapsePiSkillInvocation", () => {
+ it("replaces Pi skill instructions with the command and user request", () => {
+ expect(
+ collapsePiSkillInvocation(
+ '<skill name="code-review" location="/skills/code-review/SKILL.md">\nReferences are relative to /skills/code-review.\n\n# Review\n\nInspect the diff.\n</skill>\n\nReview this pull request.',
+ ),
+ ).toBe("/code-review\n\nReview this pull request.");
+ });
+
+ it("keeps non-skill messages unchanged", () => {
+ expect(collapsePiSkillInvocation("Review this pull request.")).toBe(
+ "Review this pull request.",
+ );
+ });
+});
diff --git a/products/desktop/packages/ui/src/features/sessions/components/session-update/piSkillInvocation.ts b/products/desktop/packages/ui/src/features/sessions/components/session-update/piSkillInvocation.ts
new file mode 100644
index 000000000000..efbfd1dd0ebf
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/sessions/components/session-update/piSkillInvocation.ts
@@ -0,0 +1,15 @@
+import { unescapeXmlAttr } from "@posthog/shared";
+
+const PI_SKILL_INVOCATION =
+ /^<skill name="([^"]+)" location="[^"]+">\n[\s\S]*?\n<\/skill>(?:\n\n([\s\S]+))?$/;
+
+export function collapsePiSkillInvocation(content: string): string {
+ const match = content.match(PI_SKILL_INVOCATION);
+ if (!match) {
+ return content;
+ }
+
+ const name = unescapeXmlAttr(match[1]);
+ const userMessage = match[2]?.trim();
+ return userMessage ? `/${name}\n\n${userMessage}` : `/${name}`;
+}
diff --git a/products/desktop/packages/ui/src/features/settings/sections/SignalSlackNotificationsSettings.tsx b/products/desktop/packages/ui/src/features/settings/sections/SignalSlackNotificationsSettings.tsx
index 36d1af2bfea6..5d158703e52b 100644
--- a/products/desktop/packages/ui/src/features/settings/sections/SignalSlackNotificationsSettings.tsx
+++ b/products/desktop/packages/ui/src/features/settings/sections/SignalSlackNotificationsSettings.tsx
@@ -81,7 +81,7 @@ export function SignalSlackNotificationsSettings({
</Text>
<Text className="text-(--gray-11) text-[13px]">
Get pinged in your own channel when you're a suggested reviewer on a
- new inbox item.
+ new report.
</Text>
</Flex>
<Button
diff --git a/products/desktop/packages/ui/src/features/settings/settingsStore.test.ts b/products/desktop/packages/ui/src/features/settings/settingsStore.test.ts
index 048eb186471e..917bf24fa740 100644
--- a/products/desktop/packages/ui/src/features/settings/settingsStore.test.ts
+++ b/products/desktop/packages/ui/src/features/settings/settingsStore.test.ts
@@ -575,3 +575,27 @@ describe("feature settingsStore terminal font", () => {
);
});
});
+
+describe("feature settingsStore hydration", () => {
+ beforeEach(async () => {
+ await resetPersistenceMocks();
+ });
+
+ it("marks the store hydrated after a successful rehydration", async () => {
+ getItem.mockResolvedValue(JSON.stringify({ state: {}, version: 1 }));
+ useSettingsStore.setState({ _hasHydrated: false });
+
+ await useSettingsStore.persist.rehydrate();
+
+ expect(useSettingsStore.getState()._hasHydrated).toBe(true);
+ });
+
+ it("marks the store hydrated when rehydration fails", async () => {
+ getItem.mockRejectedValue(new Error("storage unavailable"));
+ useSettingsStore.setState({ _hasHydrated: false });
+
+ await useSettingsStore.persist.rehydrate();
+
+ expect(useSettingsStore.getState()._hasHydrated).toBe(true);
+ });
+});
diff --git a/products/desktop/packages/ui/src/features/settings/settingsStore.ts b/products/desktop/packages/ui/src/features/settings/settingsStore.ts
index caf59645ed4e..806000165e13 100644
--- a/products/desktop/packages/ui/src/features/settings/settingsStore.ts
+++ b/products/desktop/packages/ui/src/features/settings/settingsStore.ts
@@ -633,8 +633,12 @@ export const useSettingsStore = create<SettingsStore>()(
// Onboarding hints
hints: state.hints,
}),
- onRehydrateStorage: () => (state) => {
- state?.setHasHydrated(true);
+ onRehydrateStorage: () => (state, error) => {
+ if (error) {
+ useSettingsStore.getState().setHasHydrated(true);
+ } else {
+ state?.setHasHydrated(true);
+ }
},
merge: (persisted, current) => {
const merged = {
diff --git a/products/desktop/packages/ui/src/features/sidebar/components/ProjectSwitcher.tsx b/products/desktop/packages/ui/src/features/sidebar/components/ProjectSwitcher.tsx
index 59290aab08eb..6b5d8880f3eb 100644
--- a/products/desktop/packages/ui/src/features/sidebar/components/ProjectSwitcher.tsx
+++ b/products/desktop/packages/ui/src/features/sidebar/components/ProjectSwitcher.tsx
@@ -1,9 +1,7 @@
-import { Menu as BaseMenu } from "@base-ui/react/menu";
import {
Archive,
ArrowSquareOut,
Buildings,
- Check,
DiscordLogo,
FolderSimple,
Gear,
@@ -15,13 +13,6 @@ import {
SignOut,
} from "@phosphor-icons/react";
import {
- Autocomplete,
- AutocompleteCollection,
- AutocompleteGroup,
- AutocompleteInput,
- AutocompleteItem,
- AutocompleteList,
- AutocompleteStatus,
DropdownMenu,
DropdownMenuContent,
DropdownMenuGroup,
@@ -34,7 +25,6 @@ import {
DropdownMenuSubTrigger,
DropdownMenuTrigger,
Item,
- ItemActions,
ItemContent,
ItemDescription,
ItemTitle,
@@ -54,13 +44,17 @@ import { useProjects } from "@posthog/ui/features/projects/useProjects";
import { openSettings } from "@posthog/ui/features/settings/hooks/useOpenSettings";
import { useHoldSidebarPeek } from "@posthog/ui/features/sidebar/useHoldSidebarPeek";
import { useWhatsNewStore } from "@posthog/ui/features/updates/whatsNewStore";
+import {
+ type MenuFlyoutItem,
+ MenuSubFlyout,
+ SearchableMenuFlyout,
+} from "@posthog/ui/primitives/SearchableMenuFlyout";
import { navigateToArchived } from "@posthog/ui/router/navigationBridge";
import { openExternalUrl } from "@posthog/ui/shell/openExternal";
import { isMac } from "@posthog/ui/utils/platform";
import { getPostHogUrl } from "@posthog/ui/utils/urls";
import { Avatar, Box } from "@radix-ui/themes";
-import { ChevronRightIcon } from "lucide-react";
-import { type ReactNode, useMemo, useState } from "react";
+import { useMemo, useState } from "react";
/** The account / project / org menu at the bottom of the sidebar. */
export function ProjectSwitcher() {
@@ -101,7 +95,7 @@ export function ProjectSwitcher() {
minute: "2-digit",
})
: null;
- const projectItems = useMemo<FlyoutItem[]>(
+ const projectItems = useMemo<MenuFlyoutItem[]>(
() =>
(currentOrgGroup?.projects ?? []).map((project) => ({
id: String(project.id),
@@ -112,7 +106,7 @@ export function ProjectSwitcher() {
);
// Logos aren't in orgProjectsMap, so cross-reference the user's org list.
- const orgItems = useMemo<FlyoutItem[]>(
+ const orgItems = useMemo<MenuFlyoutItem[]>(
() =>
groupedProjects.map((group) => {
const logoMediaId = currentUser?.organizations?.find(
@@ -204,21 +198,17 @@ export function ProjectSwitcher() {
render={
<Item
size="xs"
- className="border-border hover:bg-fill-hover aria-expanded:bg-fill-active"
+ className="border-transparent bg-fill-hover py-1.5 hover:bg-fill-selected aria-expanded:bg-fill-active"
>
<ItemContent className="select-none gap-0">
<ItemTitle>
{currentProject?.name ?? "No project selected"}
</ItemTitle>
<ItemDescription className="text-[11px]">
- {impersonationExpiry
- ? `Impersonating until ${impersonationExpiry}`
- : (currentUser?.email ?? "No email")}
+ {impersonationExpiry &&
+ `Impersonating until ${impersonationExpiry}`}
</ItemDescription>
</ItemContent>
- <ItemActions>
- <ChevronRightIcon className="size-4 rotate-270 group-aria-expanded/item:rotate-90" />
- </ItemActions>
</Item>
}
/>
@@ -269,14 +259,14 @@ export function ProjectSwitcher() {
<FolderSimple size={14} className="text-gray-11" />
{currentProject?.name ?? "No project selected"}
</DropdownMenuSubTrigger>
- <PinnedSubContent className="w-64 p-0">
- <SearchableFlyout
+ <MenuSubFlyout className="w-64 p-0">
+ <SearchableMenuFlyout
items={projectItems}
placeholder="Search projects…"
emptyLabel="No projects"
onSelect={(id) => handleProjectSelect(Number(id))}
/>
- </PinnedSubContent>
+ </MenuSubFlyout>
</DropdownMenuSub>
<DropdownMenuItem onClick={handleCreateProject}>
@@ -294,14 +284,14 @@ export function ProjectSwitcher() {
<Buildings size={14} className="text-gray-11" />
{currentOrgName}
</DropdownMenuSubTrigger>
- <PinnedSubContent className="w-64 p-0">
- <SearchableFlyout
+ <MenuSubFlyout className="w-64 p-0">
+ <SearchableMenuFlyout
items={orgItems}
placeholder="Search organizations…"
emptyLabel="No organizations"
onSelect={(id) => handleOrgSelect(id)}
/>
- </PinnedSubContent>
+ </MenuSubFlyout>
</DropdownMenuSub>
<DropdownMenuItem onClick={handleCreateOrg}>
@@ -382,14 +372,6 @@ export function ProjectSwitcher() {
);
}
-type FlyoutItem = {
- id: string;
- label: string;
- current: boolean;
- icon?: ReactNode;
-};
-type FlyoutSection = { items: FlyoutItem[] };
-
// Deterministic palette so an org keeps the same fallback color across renders.
const ORG_AVATAR_COLORS = [
"tomato",
@@ -452,144 +434,3 @@ function OrgAvatar({ orgId, name, logoSrc }: OrgAvatarProps) {
// compiled internals, not public API — a quill upgrade that renames them would
// silently strip this flyout's styling. Drop this component in favor of
// DropdownMenuSubContent once quill exposes a collisionAvoidance prop.
-function PinnedSubContent({
- className,
- children,
-}: {
- className?: string;
- children: ReactNode;
-}) {
- return (
- <BaseMenu.Portal>
- <BaseMenu.Positioner
- data-quill
- data-quill-portal="popover"
- className="isolate outline-none"
- align="start"
- alignOffset={-3}
- side="inline-end"
- sideOffset={4}
- collisionAvoidance={{ align: "none" }}
- >
- <BaseMenu.Popup
- data-slot="dropdown-menu-sub-content"
- className={`quill-menu__content quill-menu__sub-content w-auto ${className ?? ""}`}
- >
- <div className="quill-menu__scroller scroll-mask-y-4 scroll-py-4">
- {children}
- </div>
- </BaseMenu.Popup>
- </BaseMenu.Positioner>
- </BaseMenu.Portal>
- );
-}
-
-interface SearchableFlyoutProps {
- items: FlyoutItem[];
- placeholder: string;
- emptyLabel: string;
- onSelect: (id: string) => void;
-}
-
-function SearchableFlyout({
- items,
- placeholder,
- emptyLabel,
- onSelect,
-}: SearchableFlyoutProps) {
- const [query, setQuery] = useState("");
- // Active item first as the anchor when switching; the rest sorted the same
- // way the web app orders them (locale-aware, which floats emoji-prefixed
- // names above plain ones).
- const sections = useMemo<FlyoutSection[]>(
- () => [
- {
- items: [
- ...items.filter((item) => item.current),
- ...items
- .filter((item) => !item.current)
- .sort((a, b) => a.label.localeCompare(b.label)),
- ],
- },
- ],
- [items],
- );
-
- return (
- // Keep keystrokes away from the surrounding menu: its typeahead handler
- // sits on the submenu popup and would swallow typing meant for the search
- // input. Escape still bubbles so the menu can close.
- // biome-ignore lint/a11y/noStaticElementInteractions: keyboard fencing only
- <div
- onKeyDown={(event) => {
- if (event.key !== "Escape") event.stopPropagation();
- }}
- >
- <Autocomplete<FlyoutItem>
- inline
- defaultOpen
- items={sections}
- value={query}
- autoHighlight="always"
- onValueChange={(val, eventDetails) => {
- if (eventDetails.reason !== "input-change") return;
- if (typeof val === "string") setQuery(val);
- }}
- filter={(item, q) => {
- if (!q) return true;
- return item.label.toLowerCase().includes(q.toLowerCase());
- }}
- >
- <AutocompleteInput placeholder={placeholder} autoFocus showClear />
- {/* Suppress the default "{count} results" line; only show empty states. */}
- <AutocompleteStatus>
- {(count: number) =>
- count === 0 ? (
- query ? (
- <span>
- No matches for <strong>"{query}"</strong>
- </span>
- ) : (
- <span>{emptyLabel}</span>
- )
- ) : null
- }
- </AutocompleteStatus>
- {/* Long lists get a FIXED height so the popup doesn't resize (and
- jump) while filtering. Kept short enough that the whole flyout
- fits below either trigger row, so the popup itself never grows
- a second scrollbar. */}
- <AutocompleteList
- className={`${items.length > 5 ? "h-40" : "max-h-40"} p-0 pb-0`}
- >
- {(section: FlyoutSection) => (
- <AutocompleteGroup items={section.items} className="p-0">
- <AutocompleteCollection>
- {(item: FlyoutItem) => (
- <AutocompleteItem
- key={item.id}
- value={item.id}
- onClick={() => onSelect(item.id)}
- className="flex items-center gap-2 ring-offset-0 data-highlighted:border-transparent data-highlighted:bg-fill-hover data-highlighted:ring-0"
- >
- <span className="flex w-4 shrink-0 items-center justify-center">
- {item.current && (
- <Check size={14} className="text-accent-11" />
- )}
- </span>
- {item.icon && (
- <span className="flex shrink-0 items-center">
- {item.icon}
- </span>
- )}
- <span className="truncate text-[13px]">{item.label}</span>
- </AutocompleteItem>
- )}
- </AutocompleteCollection>
- </AutocompleteGroup>
- )}
- </AutocompleteList>
- </Autocomplete>
- </div>
- );
-}
diff --git a/products/desktop/packages/ui/src/features/sidebar/components/SidebarItem.tsx b/products/desktop/packages/ui/src/features/sidebar/components/SidebarItem.tsx
index cb74d897a804..e1be24a5fa9c 100644
--- a/products/desktop/packages/ui/src/features/sidebar/components/SidebarItem.tsx
+++ b/products/desktop/packages/ui/src/features/sidebar/components/SidebarItem.tsx
@@ -64,7 +64,6 @@ export function SidebarItem({
type="button"
className={cn(
"group flex w-full cursor-default text-left text-[13px] leading-snug transition-colors",
- "focus-visible:-outline-offset-2 focus-visible:outline-2 focus-visible:outline-accent-8",
"disabled:opacity-100 data-active:bg-fill-selected data-selected:bg-(--gray-3)",
isDimmed && "opacity-50",
)}
@@ -74,7 +73,7 @@ export function SidebarItem({
onDragStart={onDragStart}
style={{
paddingLeft: getSidebarItemPaddingLeft(depth),
- paddingRight: "8px",
+ paddingRight: "4px",
}}
onClick={onClick}
onDoubleClick={onDoubleClick}
diff --git a/products/desktop/packages/ui/src/features/sidebar/components/items/SidebarCountBadge.tsx b/products/desktop/packages/ui/src/features/sidebar/components/items/SidebarCountBadge.tsx
index 39c720f00516..b64e0257df6c 100644
--- a/products/desktop/packages/ui/src/features/sidebar/components/items/SidebarCountBadge.tsx
+++ b/products/desktop/packages/ui/src/features/sidebar/components/items/SidebarCountBadge.tsx
@@ -7,7 +7,9 @@ export function SidebarCountBadge({ count, title }: SidebarCountBadgeProps) {
if (count <= 0) return null;
return (
<span
- className="ml-2 inline-flex h-2 w-2 shrink-0 rounded-full bg-(--red-9)"
+ // The brand's primary, like every other unread mark: red is for something
+ // that failed.
+ className="ml-2 inline-flex h-2 w-2 shrink-0 rounded-full bg-primary"
title={title}
/>
);
diff --git a/products/desktop/packages/ui/src/features/sidebar/components/items/TaskStatusDot.tsx b/products/desktop/packages/ui/src/features/sidebar/components/items/TaskStatusDot.tsx
new file mode 100644
index 000000000000..5bba6e83cde0
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/sidebar/components/items/TaskStatusDot.tsx
@@ -0,0 +1,186 @@
+import { PushPin } from "@phosphor-icons/react";
+import {
+ Avatar,
+ AvatarFallback,
+ AvatarGroup,
+ cn,
+ Tooltip,
+ TooltipContent,
+ TooltipProvider,
+ TooltipTrigger,
+} from "@posthog/quill";
+import {
+ DOT_TONE_VAR,
+ type TaskDot,
+ type TaskStatusInput,
+ TONE_ICON_VAR,
+ taskBadges,
+} from "@posthog/ui/features/sidebar/components/items/taskStatusVocabulary";
+import { DotRingSpinner } from "@posthog/ui/primitives/DotRingSpinner";
+import type { ReactElement, ReactNode } from "react";
+
+const DOT_SIZE = 8;
+// Exactly the plain dot's box. Anything larger and a working row's label starts
+// further right than its neighbours' — the icon column has to hold one width or
+// the list stops looking like a list.
+const SPINNER_SIZE = DOT_SIZE;
+// Enough to still find the dot if you look for it, not enough to count as one of
+// the list's live rows.
+const FAINT_OPACITY = 0.4;
+// One provider per row, so a row's dot and badges share a hover delay and handing
+// off between them doesn't re-wait.
+const TOOLTIP_DELAY_MS = 200;
+
+/**
+ * A label-only tooltip. Two things keep it out of the way, because one isn't
+ * enough: `disableHoverablePopup` stops Base UI holding the popup open when the
+ * pointer moves onto it, and `pointer-events-none` is the guarantee — a popup
+ * that can't receive the pointer can't be hovered, can't swallow a click meant
+ * for the row underneath, and can't have its text dragged into a selection.
+ */
+function RowTooltip({
+ label,
+ side,
+ children,
+}: {
+ label: string;
+ side: "top" | "right";
+ children: ReactElement;
+}) {
+ return (
+ <Tooltip disableHoverablePopup>
+ <TooltipTrigger render={children} />
+ <TooltipContent side={side} className="pointer-events-none select-none">
+ {label}
+ </TooltipContent>
+ </Tooltip>
+ );
+}
+
+/**
+ * A task's state as a single dot: blue wants a decision, the brand yellow is
+ * working or unread, grey is quiet. The trigger renders as a span because rows are
+ * `<button>`s — a nested button would be invalid HTML.
+ */
+export function TaskStatusDot({ dot }: { dot: TaskDot }) {
+ const color = DOT_TONE_VAR[dot.tone];
+ if (dot.spinner) {
+ return (
+ <RowTooltip label={dot.label} side="right">
+ <span
+ aria-label={dot.label}
+ role="img"
+ className="flex shrink-0 items-center justify-center"
+ // The spinner draws its dots in `currentColor`, so the tone is set
+ // here rather than passed down.
+ style={{ color: TONE_ICON_VAR[dot.tone], width: SPINNER_SIZE }}
+ >
+ <DotRingSpinner size={SPINNER_SIZE} />
+ </span>
+ </RowTooltip>
+ );
+ }
+ return (
+ <RowTooltip label={dot.label} side="right">
+ <span
+ aria-label={dot.label}
+ role="img"
+ className={cn(
+ "block shrink-0 rounded-full",
+ // ph-pulse is the app's existing flash, but it has no reduced-motion
+ // rule of its own — hold a static dot rather than blinking at someone
+ // who asked us not to.
+ dot.pulse && "ph-pulse motion-reduce:animate-none",
+ )}
+ style={{
+ width: DOT_SIZE,
+ height: DOT_SIZE,
+ backgroundColor: dot.style === "solid" ? color : "transparent",
+ boxShadow:
+ dot.style === "hollow" ? `inset 0 0 0 1.5px ${color}` : undefined,
+ opacity: dot.faint ? FAINT_OPACITY : undefined,
+ }}
+ />
+ </RowTooltip>
+ );
+}
+
+/**
+ * The pin: this row was put here on purpose. Lives with the badges because it
+ * belongs in their stack — pinned rows sit in the one list with everything else,
+ * so the badge is what says a row is pinned.
+ *
+ * Amber rather than the vocabulary's `--primary` yellow: primary means "there is
+ * something here for you", and a pin is a shelf, not a claim on your attention.
+ */
+export function PinnedBadge() {
+ return (
+ <RowTooltip label="Pinned" side="top">
+ <Avatar
+ size="xs"
+ aria-label="Pinned"
+ role="img"
+ className="cursor-default"
+ >
+ <AvatarFallback className="bg-transparent">
+ <PushPin size={9} className="text-primary" />
+ </AvatarFallback>
+ </Avatar>
+ </RowTooltip>
+ );
+}
+
+/**
+ * A task's identity as stacked avatars: the pin, then source, cloud, and
+ * PR/branch. The pin goes first, which in a reversed stack puts it leftmost and
+ * underneath — it says how the row got here, not what came out of it.
+ */
+export function TaskBadgeStack({
+ status,
+ pinned,
+}: {
+ status: TaskStatusInput;
+ pinned?: boolean;
+}) {
+ return (
+ <AvatarGroup stacked reverse size="xs" className="shrink-0">
+ {pinned ? <PinnedBadge /> : null}
+ {taskBadges(status).map(({ key, Icon, label, tone }) => (
+ <RowTooltip key={key} label={label} side="top">
+ {/* The tooltip names the badge on hover; `aria-label` is what names it
+ for everyone else — without it the stack is a row of blank avatars
+ to a screen reader. */}
+ {/* `cursor-default`: these name a fact about the row, they aren't
+ controls — quill gives an avatar rendered as a button the pointer
+ cursor, which promises a click that does nothing. */}
+ <Avatar
+ size="xs"
+ aria-label={label}
+ role="img"
+ className="cursor-default"
+ >
+ <AvatarFallback className="bg-transparent text-muted-foreground">
+ {/* An explicit `color` (an SVG fill) rather than a text-* class,
+ so a hovered or selected row can't reset it — the same reason
+ TaskIcon does this. */}
+ <Icon
+ size={9}
+ weight={tone ? "fill" : "regular"}
+ color={tone ? TONE_ICON_VAR[tone] : undefined}
+ className={tone ? undefined : "text-muted-foreground/50"}
+ />
+ </AvatarFallback>
+ </Avatar>
+ </RowTooltip>
+ ))}
+ </AvatarGroup>
+ );
+}
+
+/**
+ * Wraps a row's dot and badges in one tooltip provider, so hovering from the dot
+ * to a badge doesn't re-wait the open delay.
+ */
+export function TaskStatusTooltips({ children }: { children: ReactNode }) {
+ return <TooltipProvider delay={TOOLTIP_DELAY_MS}>{children}</TooltipProvider>;
+}
diff --git a/products/desktop/packages/ui/src/features/sidebar/components/items/taskStatusVocabulary.ts b/products/desktop/packages/ui/src/features/sidebar/components/items/taskStatusVocabulary.ts
new file mode 100644
index 000000000000..3b3196762c4b
--- /dev/null
+++ b/products/desktop/packages/ui/src/features/sidebar/components/items/taskStatusVocabulary.ts
@@ -0,0 +1,276 @@
+import {
+ ArrowSquareIn,
+ Cloud,
+ GitBranch,
+ GitMerge,
+ GitPullRequest,
+ type Icon,
+ Laptop,
+} from "@phosphor-icons/react";
+import {
+ getOriginProductMeta,
+ type TaskIconProps,
+} from "@posthog/ui/features/sidebar/components/items/TaskIcon";
+
+/**
+ * The task state a status dot / badge stack is drawn from: what the shipped
+ * `TaskIcon` takes, plus the PR's url.
+ *
+ * The url matters separately from `prState` because it arrives much earlier. A
+ * cloud run writes `latest_run.output.pr_url` the moment it opens the PR, while
+ * `prState` needs a GitHub lookup that a cloud-only task may never get. So the
+ * url answers "is there a PR" and the state answers "what happened to it" — and
+ * a row can say the first without waiting on the second.
+ */
+export type TaskStatusInput = TaskIconProps & {
+ prUrl?: string | null;
+};
+
+/**
+ * The status vocabulary for a task row. It splits what `TaskIcon` crams into one
+ * glyph, and each half only speaks when it has something to say:
+ *
+ * - the **dot** on the left is attention and activity ONLY — is this blocked
+ * on me, working, or waiting to be read? Everything settled shares one
+ * quiet hollow dot;
+ * - the **badges** on the right are identity — where it came from, whether
+ * it's cloud, and what came out of it. The PR badge carries its own colour,
+ * so PR state never needs to spend the dot.
+ *
+ * That split is the whole point: a merged PR from Slack reads as "nothing owed"
+ * (hollow dot) with a purple merge badge and a source badge, instead of
+ * `TaskIcon`'s single glyph where the winning state hides the other two.
+ */
+
+export type DotTone = "green" | "purple" | "yellow" | "red" | "blue" | "gray";
+
+/**
+ * Radix step 9 — the "solid" step, the only one meant to be a filled fill.
+ * Yellow is the exception: it's the brand's `--primary` (yellow in dark, orange
+ * in light), the same token the unread badges use, so "something is owed to you"
+ * is one colour across the window rather than two shades of amber.
+ */
+export const DOT_TONE_VAR: Record<DotTone, string> = {
+ green: "var(--green-9)",
+ purple: "var(--purple-9)",
+ yellow: "var(--primary)",
+ red: "var(--red-9)",
+ blue: "var(--blue-9)",
+ gray: "var(--gray-8)",
+};
+
+/**
+ * Step 11 — the readable step, for a glyph rather than a filled shape. Grey is
+ * the exception at step 10: it's there to read as *mid* grey, present but
+ * plainly not asking for anything, which step 11 is too emphatic for. Yellow is
+ * `--primary` here too — it has no scale of its own, and the token is already
+ * chosen to read against either theme's chrome.
+ */
+export const TONE_ICON_VAR: Record<DotTone, string> = {
+ green: "var(--green-11)",
+ purple: "var(--purple-11)",
+ yellow: "var(--primary)",
+ red: "var(--red-11)",
+ blue: "var(--blue-11)",
+ gray: "var(--gray-10)",
+};
+
+export interface TaskDot {
+ tone: DotTone;
+ /** Filled = live signal; hollow = settled, nothing owed to you. */
+ style: "solid" | "hollow";
+ /** Flashing = happening now, or wanting you now. */
+ pulse: boolean;
+ /**
+ * Draw as the braille dots spinner instead of one dot — still dot-shaped, so
+ * it stays in the dot column's vocabulary, but the motion is a *cycle* rather
+ * than a blink, which is the honest shape for "output is arriving".
+ */
+ spinner?: boolean;
+ /**
+ * Draw the dot barely there. For states that are deliberately inert — the task
+ * isn't idle waiting for you, it's been *put down* — so the row should read as
+ * present but skippable rather than joining the quiet-but-live majority.
+ */
+ faint?: boolean;
+ label: string;
+}
+
+/**
+ * State → dot. Three things only: blue wants a decision from you, the brand
+ * yellow is working or unread, grey is quiet.
+ *
+ * Run mechanics are deliberately absent. A cloud run is magic from the outside —
+ * queued, claiming a sandbox, retrying, and erroring out are our problems, not
+ * the reader's, and a list that reports them turns every infrastructure hiccup
+ * into a red mark on the reader's work. So a failed run is not a state here: what
+ * the reader actually gets is output they haven't seen, which is `isUnread`, and
+ * the run's real story lives in the task detail where there's room to tell it.
+ *
+ * Queued is folded into pending for the same reason. "Waiting on a sandbox" and
+ * "a run that hasn't been closed out" are one fact to the reader — it's live but
+ * nothing is moving — so they share the still yellow dot. Only a prompt in
+ * flight spins.
+ *
+ * And a run that has already opened a PR is not working, whatever its status
+ * says. The cloud workflow keeps the run `in_progress` while it babysits CI
+ * after opening the PR, and under a merge queue that wait ends only when someone
+ * enqueues the merge — so the run can claim to be working for hours after the
+ * agent stopped. The PR is the deliverable; once it exists the badge carries the
+ * story and the dot goes quiet.
+ */
+export function taskDot(props: TaskStatusInput): TaskDot {
+ if (props.needsPermission) {
+ return {
+ tone: "blue",
+ style: "solid",
+ pulse: true,
+ label: "Needs permission — blocked on you",
+ };
+ }
+ // The spinner is reserved for a prompt actually in flight — the agent typing
+ // right now. A run status can't earn it: nothing writes a terminal status when
+ // a local agent goes idle, and the cloud workflow holds `in_progress` while it
+ // babysits CI, so both keep claiming work for as long as the row exists. A
+ // spinner that never stops is a lie about the machine, so the claim gets the
+ // still dot below instead.
+ if (props.isGenerating) {
+ return {
+ tone: "yellow",
+ style: "solid",
+ pulse: false,
+ spinner: true,
+ label: "Working",
+ };
+ }
+ const runClaimsWork =
+ props.taskRunStatus === "in_progress" || props.taskRunStatus === "queued";
+ if (runClaimsWork && !hasPullRequest(props)) {
+ return {
+ tone: "yellow",
+ style: "solid",
+ pulse: false,
+ label: "Pending — no work in flight",
+ };
+ }
+ if (props.isUnread) {
+ // Solid, not flashing: fresh output is worth a look but isn't blocking the
+ // run the way a permission prompt is, and two moving states in one list
+ // cancel each other out.
+ return {
+ tone: "yellow",
+ style: "solid",
+ pulse: false,
+ label: "Unread — something to read",
+ };
+ }
+ if (props.isSuspended) {
+ return {
+ tone: "gray",
+ style: "hollow",
+ pulse: false,
+ faint: true,
+ label: "Suspended — parked",
+ };
+ }
+ return {
+ tone: "gray",
+ style: "hollow",
+ pulse: false,
+ label: "All caught up",
+ };
+}
+
+/**
+ * Whether a PR exists at all, by either route: the state from a GitHub lookup,
+ * or just the url the run wrote when it opened one.
+ */
+function hasPullRequest(props: TaskStatusInput): boolean {
+ return props.prState != null || !!props.prUrl;
+}
+
+export interface TaskBadge {
+ key: string;
+ Icon: Icon;
+ label: string;
+ /** Set only where colour earns its keep — currently PR state. */
+ tone?: DotTone;
+}
+
+/**
+ * Identity → badges, widest context first so the stack reads left-to-right as
+ * "who asked, where it runs, what came out of it". Always returns at least one
+ * badge: an empty slot where every other row has an avatar reads as a bug.
+ *
+ * Origins deliberately share ONE glyph. Eight product marks at avatar size is a
+ * vocabulary nobody learns — and the badge's job in a nav row is "this didn't
+ * come from you", which is the same fact whether Slack or error tracking filed
+ * it. The tooltip names the actual product for anyone who needs it.
+ *
+ * The PR badge is the exception that gets colour: merged / ready / closed is the
+ * outcome people actually scan a task list for, and it's a three-value
+ * vocabulary on a glyph that already means "pull request".
+ */
+export function taskBadges(props: TaskStatusInput): TaskBadge[] {
+ const badges: TaskBadge[] = [];
+ const origin = getOriginProductMeta(props.originProduct);
+ if (origin) {
+ badges.push({
+ key: "origin",
+ Icon: ArrowSquareIn,
+ label: `Source: ${origin.label}`,
+ });
+ }
+ if (props.workspaceMode === "cloud") {
+ badges.push({ key: "cloud", Icon: Cloud, label: "Cloud" });
+ }
+ if (props.prState === "merged") {
+ badges.push({
+ key: "pr",
+ Icon: GitMerge,
+ label: "Merged",
+ tone: "purple",
+ });
+ } else if (props.prState === "open") {
+ badges.push({
+ key: "pr",
+ Icon: GitPullRequest,
+ label: "PR ready for review",
+ tone: "green",
+ });
+ } else if (props.prState === "closed") {
+ badges.push({
+ key: "pr",
+ Icon: GitPullRequest,
+ label: "PR closed unmerged",
+ tone: "red",
+ });
+ } else if (props.prState === "draft") {
+ // Mid grey: a draft is a real PR, so it earns a solid glyph, but it isn't
+ // asking for anything yet — grey is the "exists, no verdict" slot.
+ badges.push({
+ key: "pr",
+ Icon: GitPullRequest,
+ label: "Draft PR",
+ tone: "gray",
+ });
+ } else if (props.prUrl) {
+ // A PR we know exists but haven't resolved the state of. Uncoloured on
+ // purpose: colour here is a verdict, and inventing one would be worse than
+ // saying "there's a PR, go look". Showing the badge is not optional — a
+ // task that opened a PR and shows no sign of it reads as having done
+ // nothing.
+ badges.push({ key: "pr", Icon: GitPullRequest, label: "Pull request" });
+ } else if (props.hasDiff) {
+ badges.push({
+ key: "branch",
+ Icon: GitBranch,
+ label: "Has changes",
+ tone: "yellow",
+ });
+ }
+ if (badges.length === 0) {
+ badges.push({ key: "local", Icon: Laptop, label: "Local" });
+ }
+ return badges;
+}
diff --git a/products/desktop/packages/ui/src/features/sidebar/useTaskPrStatus.ts b/products/desktop/packages/ui/src/features/sidebar/useTaskPrStatus.ts
index 537f8bbfc099..d0db43aa62fe 100644
--- a/products/desktop/packages/ui/src/features/sidebar/useTaskPrStatus.ts
+++ b/products/desktop/packages/ui/src/features/sidebar/useTaskPrStatus.ts
@@ -18,7 +18,11 @@ export function useTaskPrStatus(task: {
}): TaskPrStatus {
const trpc = useHostTRPC();
- const skipQuery = task.taskRunEnvironment === "cloud" && !task.cloudPrUrl;
+ // No id means no task — canvas rows share this hook — and a cloud run with no
+ // PR url yet has nothing to look up either. Both would spend a round trip to
+ // be told nothing.
+ const skipQuery =
+ !task.id || (task.taskRunEnvironment === "cloud" && !task.cloudPrUrl);
const { data } = useQuery(
trpc.workspace.getTaskPrStatus.queryOptions(
diff --git a/products/desktop/packages/ui/src/features/task-detail/components/TaskDetail.tsx b/products/desktop/packages/ui/src/features/task-detail/components/TaskDetail.tsx
index 661a39f6d4c8..3e0a21e34917 100644
--- a/products/desktop/packages/ui/src/features/task-detail/components/TaskDetail.tsx
+++ b/products/desktop/packages/ui/src/features/task-detail/components/TaskDetail.tsx
@@ -244,7 +244,11 @@ export function TaskDetail({
<Flex height="100%">
<Box className={`min-w-0 flex-1 ${isExpanded ? "hidden" : ""}`}>
{runtime === "pi" && (
- <PiSessionView taskId={taskId} taskRunId={selectedTaskRunId} />
+ <PiSessionView
+ taskId={taskId}
+ taskRunId={selectedTaskRunId}
+ isCloud={isCloud}
+ />
)}
{runtime === "acp" && <PanelLayout taskId={taskId} task={task} />}
</Box>
diff --git a/products/desktop/packages/ui/src/features/task-detail/components/TaskInput.tsx b/products/desktop/packages/ui/src/features/task-detail/components/TaskInput.tsx
index ae2adb4e7801..2c0a9a8dc8c1 100644
--- a/products/desktop/packages/ui/src/features/task-detail/components/TaskInput.tsx
+++ b/products/desktop/packages/ui/src/features/task-detail/components/TaskInput.tsx
@@ -13,11 +13,7 @@ import { isValidConfigValue } from "@posthog/core/task-detail/configOptions";
import { useServiceOptional } from "@posthog/di/react";
import { useHostTRPC, useHostTRPCClient } from "@posthog/host-router/react";
import { ButtonGroup } from "@posthog/quill";
-import {
- type AgentRuntime,
- ANALYTICS_EVENTS,
- getCloudUrlFromRegion,
-} from "@posthog/shared";
+import { type AgentRuntime, ANALYTICS_EVENTS } from "@posthog/shared";
import type { Task } from "@posthog/shared/domain-types";
import { openSettings } from "@posthog/ui/features/settings/hooks/useOpenSettings";
import type { TaskInputReportAssociation } from "@posthog/ui/features/task-detail/stores/taskInputPrefillStore";
@@ -81,6 +77,7 @@ import {
PiModelSelector,
PiThinkingLevelSelector,
} from "../../pi-sessions/PiSessionControls";
+import { usePiModelCatalog } from "../../pi-sessions/usePiModelCatalog";
import { DropZoneOverlay } from "../../sessions/components/DropZoneOverlay";
import { ReasoningLevelSelector } from "../../sessions/components/ReasoningLevelSelector";
import { getCurrentModeFromConfigOptions } from "../../sessions/sessionStore";
@@ -261,17 +258,8 @@ export function TaskInput({
);
const [selectedPiThinkingLevel, setSelectedPiThinkingLevel] =
useState<PiThinkingLevel | null>(null);
- const piApiHost = useMemo(
- () => (cloudRegion ? getCloudUrlFromRegion(cloudRegion) : null),
- [cloudRegion],
- );
- const { data: piModelCatalog = [], isPending: isPiConfigLoading } = useQuery({
- ...trpc.agent.getPiModelCatalog.queryOptions({
- apiHost: piApiHost ?? "",
- region: cloudRegion ?? "us",
- }),
- enabled: runtime === "pi" && piApiHost !== null,
- });
+ const { data: piModelCatalog = [], isPending: isPiConfigLoading } =
+ usePiModelCatalog(runtime === "pi");
const [cloudRepoSearchQuery, setCloudRepoSearchQuery] = useState("");
const [isCloudRepoPickerOpen, setIsCloudRepoPickerOpen] = useState(false);
const [cloudBranchSearchQuery, setCloudBranchSearchQuery] = useState("");
@@ -779,6 +767,7 @@ export function TaskInput({
)
? (selectedPiThinkingLevel ?? "high")
: piThinkingLevels[0];
+ const supportsPiThinking = piThinkingLevels.some((level) => level !== "off");
const currentContextWindow =
contextWindowOption?.type === "select" &&
(contextWindowOption.currentValue === "200k" ||
@@ -809,7 +798,11 @@ export function TaskInput({
: currentReasoningLevel;
const taskModel = runtime === "pi" ? currentPiModel?.id : effectiveModel;
const taskReasoningLevel =
- runtime === "pi" ? currentPiThinkingLevel : effectiveReasoningLevel;
+ runtime === "pi"
+ ? supportsPiThinking
+ ? currentPiThinkingLevel
+ : undefined
+ : effectiveReasoningLevel;
useWarmTask({
workspaceMode,
@@ -1427,7 +1420,7 @@ export function TaskInput({
}
reasoningSelector={
autoresearchDraft ? null : runtime === "pi" ? (
- currentPiThinkingLevel ? (
+ currentPiThinkingLevel && supportsPiThinking ? (
<PiThinkingLevelSelector
level={currentPiThinkingLevel}
levels={piThinkingLevels}
diff --git a/products/desktop/packages/ui/src/primitives/CountBadge.tsx b/products/desktop/packages/ui/src/primitives/CountBadge.tsx
index ffa24d0bdd22..e68df27089f8 100644
--- a/products/desktop/packages/ui/src/primitives/CountBadge.tsx
+++ b/products/desktop/packages/ui/src/primitives/CountBadge.tsx
@@ -1,6 +1,10 @@
import { cn } from "@posthog/quill";
-/** Unread counts read red; ambient "how much is parked here" counts stay grey. */
+/**
+ * Unread counts read in the brand's primary — yellow in dark, orange in light —
+ * so a badge is the app's own colour rather than a warning. Red is reserved for
+ * failure. Ambient "how much is parked here" counts stay grey.
+ */
export type CountBadgeTone = "notification" | "neutral";
interface CountBadgeProps {
@@ -22,7 +26,7 @@ function countBadgeSizeClass(label: string): string {
}
const TONE_CLASS: Record<CountBadgeTone, string> = {
- notification: "bg-(--red-9) text-(--gray-contrast)",
+ notification: "bg-primary text-primary-foreground",
// Theme tokens, not the absolute gray scale: these sit on chrome whose
// lightness relationship to gray-N inverts between light and dark.
neutral: "bg-muted text-muted-foreground",
diff --git a/products/desktop/packages/ui/src/primitives/DotRingSpinner.tsx b/products/desktop/packages/ui/src/primitives/DotRingSpinner.tsx
new file mode 100644
index 000000000000..c5ff6e8435dd
--- /dev/null
+++ b/products/desktop/packages/ui/src/primitives/DotRingSpinner.tsx
@@ -0,0 +1,71 @@
+import { cn } from "@posthog/quill";
+
+// Must match the `ph-dot-ring` animation duration in styles/globals.css: the
+// keyframe lives in CSS (so the spinner costs no JS timers) while the per-dot
+// stagger is computed here, and the two only read as one ring if they agree.
+const RING_DURATION_MS = 900;
+
+// The eight perimeter cells of a 3x3 grid, clockwise from the top, as
+// [row, column]. The centre stays empty — that hole is what makes the ring read
+// as a circle rather than a block of dots.
+const RING_CELLS = [
+ [1, 2],
+ [1, 3],
+ [2, 3],
+ [3, 3],
+ [3, 2],
+ [3, 1],
+ [2, 1],
+ [1, 1],
+] as const;
+
+/**
+ * A circular dots spinner: eight dots on a 3x3 ring with a highlight travelling
+ * around it. Drawn from real elements rather than braille glyphs
+ * (`DotsCircleSpinner`), which buys three things at nav-row size: the ring is
+ * actually round instead of a 2x4 cell, it scales cleanly because the dots are
+ * sized in px rather than by font metrics, and it can't be reshaped by whatever
+ * font a host happens to resolve for U+28xx.
+ *
+ * Colour comes from `currentColor`, so the caller sets the tone.
+ */
+export function DotRingSpinner({
+ size = 12,
+ className,
+}: {
+ size?: number;
+ className?: string;
+}) {
+ // A fifth of the box leaves roughly a dot's worth of gap between neighbours.
+ // Deliberately NOT rounded to whole pixels: the ring has to fit the same box
+ // as a plain status dot, and at that size rounding is the difference between
+ // eight dots and a smudge. Fractional sizes are fine — they land on device
+ // pixels on any 2x display, and border-radius keeps them round below that.
+ const dot = size / 5;
+ return (
+ <span
+ aria-hidden="true"
+ className={cn("grid shrink-0", className)}
+ style={{
+ width: size,
+ height: size,
+ gridTemplateColumns: "repeat(3, 1fr)",
+ gridTemplateRows: "repeat(3, 1fr)",
+ }}
+ >
+ {RING_CELLS.map(([row, column], index) => (
+ <span
+ key={`${row}-${column}`}
+ className="ph-dot-ring place-self-center rounded-full bg-current"
+ style={{
+ width: dot,
+ height: dot,
+ gridRow: row,
+ gridColumn: column,
+ animationDelay: `${(index * RING_DURATION_MS) / RING_CELLS.length}ms`,
+ }}
+ />
+ ))}
+ </span>
+ );
+}
diff --git a/products/desktop/packages/ui/src/primitives/SearchableMenuFlyout.tsx b/products/desktop/packages/ui/src/primitives/SearchableMenuFlyout.tsx
new file mode 100644
index 000000000000..c801d00e01b5
--- /dev/null
+++ b/products/desktop/packages/ui/src/primitives/SearchableMenuFlyout.tsx
@@ -0,0 +1,181 @@
+import { Menu as BaseMenu } from "@base-ui/react/menu";
+import { Check } from "@phosphor-icons/react";
+import {
+ Autocomplete,
+ AutocompleteCollection,
+ AutocompleteGroup,
+ AutocompleteInput,
+ AutocompleteItem,
+ AutocompleteList,
+ AutocompleteStatus,
+} from "@posthog/quill";
+import { type ReactNode, useMemo, useState } from "react";
+
+export type MenuFlyoutItem = {
+ id: string;
+ label: string;
+ /** Marks the item with a tick — the one already in effect. */
+ current: boolean;
+ icon?: ReactNode;
+};
+
+type MenuFlyoutSection = { items: MenuFlyoutItem[] };
+
+/**
+ * Submenu content pinned to its trigger row rather than allowed to drift.
+ *
+ * The default sub-content positioner re-aligns to avoid collisions, which for a
+ * searchable flyout means the popup hops as the list filters and shrinks.
+ * `collisionAvoidance: { align: "none" }` holds it against the trigger, and the
+ * negative `alignOffset` lines the first item up with the row you opened it
+ * from. Reaches for the Base UI parts directly because quill's
+ * `*SubContent` doesn't expose collision avoidance.
+ */
+export function MenuSubFlyout({
+ className,
+ children,
+}: {
+ className?: string;
+ children: ReactNode;
+}) {
+ return (
+ <BaseMenu.Portal>
+ <BaseMenu.Positioner
+ data-quill
+ data-quill-portal="popover"
+ className="isolate outline-none"
+ align="start"
+ alignOffset={-3}
+ side="inline-end"
+ sideOffset={4}
+ collisionAvoidance={{ align: "none" }}
+ >
+ <BaseMenu.Popup
+ data-slot="dropdown-menu-sub-content"
+ className={`quill-menu__content quill-menu__sub-content w-auto ${className ?? ""}`}
+ >
+ <div className="quill-menu__scroller scroll-mask-y-4 scroll-py-4">
+ {children}
+ </div>
+ </BaseMenu.Popup>
+ </BaseMenu.Positioner>
+ </BaseMenu.Portal>
+ );
+}
+
+export interface SearchableMenuFlyoutProps {
+ items: MenuFlyoutItem[];
+ placeholder: string;
+ /** Shown when there are no items at all, as opposed to no matches. */
+ emptyLabel: string;
+ onSelect: (id: string) => void;
+}
+
+/**
+ * A filterable list for inside a `MenuSubFlyout`: search input, tick on the
+ * current item, keyboard-driven. Used by the project/organization switchers and
+ * the task row's "File to…", so a long list of things to pick from behaves the
+ * same wherever it appears.
+ */
+export function SearchableMenuFlyout({
+ items,
+ placeholder,
+ emptyLabel,
+ onSelect,
+}: SearchableMenuFlyoutProps) {
+ const [query, setQuery] = useState("");
+ // Active item first as the anchor when switching; the rest sorted the same way
+ // the web app orders them (locale-aware, which floats emoji-prefixed names
+ // above plain ones).
+ const sections = useMemo<MenuFlyoutSection[]>(
+ () => [
+ {
+ items: [
+ ...items.filter((item) => item.current),
+ ...items
+ .filter((item) => !item.current)
+ .sort((a, b) => a.label.localeCompare(b.label)),
+ ],
+ },
+ ],
+ [items],
+ );
+
+ return (
+ // Keep keystrokes away from the surrounding menu: its typeahead handler sits
+ // on the submenu popup and would swallow typing meant for the search input.
+ // Escape still bubbles so the menu can close.
+ // biome-ignore lint/a11y/noStaticElementInteractions: keyboard fencing only
+ <div
+ onKeyDown={(event) => {
+ if (event.key !== "Escape") event.stopPropagation();
+ }}
+ >
+ <Autocomplete<MenuFlyoutItem>
+ inline
+ defaultOpen
+ items={sections}
+ value={query}
+ autoHighlight="always"
+ onValueChange={(val, eventDetails) => {
+ if (eventDetails.reason !== "input-change") return;
+ if (typeof val === "string") setQuery(val);
+ }}
+ filter={(item, q) => {
+ if (!q) return true;
+ return item.label.toLowerCase().includes(q.toLowerCase());
+ }}
+ >
+ <AutocompleteInput placeholder={placeholder} autoFocus showClear />
+ {/* Suppress the default "{count} results" line; only show empty states. */}
+ <AutocompleteStatus>
+ {(count: number) =>
+ count === 0 ? (
+ query ? (
+ <span>
+ No matches for <strong>"{query}"</strong>
+ </span>
+ ) : (
+ <span>{emptyLabel}</span>
+ )
+ ) : null
+ }
+ </AutocompleteStatus>
+ {/* Long lists get a FIXED height so the popup doesn't resize (and jump)
+ while filtering. Kept short enough that the whole flyout fits below
+ either trigger row, so the popup itself never grows a second
+ scrollbar. */}
+ <AutocompleteList
+ className={`${items.length > 5 ? "h-40" : "max-h-40"} p-0 pb-0`}
+ >
+ {(section: MenuFlyoutSection) => (
+ <AutocompleteGroup items={section.items} className="p-0">
+ <AutocompleteCollection>
+ {(item: MenuFlyoutItem) => (
+ <AutocompleteItem
+ key={item.id}
+ value={item.id}
+ onClick={() => onSelect(item.id)}
+ className="flex items-center gap-2 ring-offset-0 data-highlighted:border-transparent data-highlighted:bg-fill-hover data-highlighted:ring-0"
+ >
+ <span className="flex w-4 shrink-0 items-center justify-center">
+ {item.current && (
+ <Check size={14} className="text-accent-11" />
+ )}
+ </span>
+ {item.icon && (
+ <span className="flex shrink-0 items-center">
+ {item.icon}
+ </span>
+ )}
+ <span className="truncate text-[13px]">{item.label}</span>
+ </AutocompleteItem>
+ )}
+ </AutocompleteCollection>
+ </AutocompleteGroup>
+ )}
+ </AutocompleteList>
+ </Autocomplete>
+ </div>
+ );
+}
diff --git a/products/desktop/packages/ui/src/router/routes/__root.tsx b/products/desktop/packages/ui/src/router/routes/__root.tsx
index ff418538cc7b..fe2122fdadfd 100644
--- a/products/desktop/packages/ui/src/router/routes/__root.tsx
+++ b/products/desktop/packages/ui/src/router/routes/__root.tsx
@@ -379,7 +379,6 @@ function RootLayout() {
<LogosLandscape code={false} />
</Box>
<Button
- variant="outline"
size="icon-sm"
aria-label="Toggle sidebar"
onClick={handleToggleSidebar}
@@ -388,9 +387,9 @@ function RootLayout() {
}}
>
{sidebarOpen ? (
- <SidebarClose size={10} />
+ <SidebarClose size={10} className="text-muted-foreground" />
) : (
- <SidebarOpen size={10} />
+ <SidebarOpen size={10} className="text-muted-foreground" />
)}
</Button>
</Flex>
diff --git a/products/desktop/packages/ui/src/shell/App.tsx b/products/desktop/packages/ui/src/shell/App.tsx
index 4963ab39700e..d74f0a03d961 100644
--- a/products/desktop/packages/ui/src/shell/App.tsx
+++ b/products/desktop/packages/ui/src/shell/App.tsx
@@ -1,3 +1,4 @@
+import { getAuthIdentity } from "@posthog/core/auth/authIdentity";
import { ToastProvider } from "@posthog/quill";
import { EXTERNAL_LINKS, isNotAuthenticatedError } from "@posthog/shared";
import { ANALYTICS_EVENTS } from "@posthog/shared/analytics-events";
@@ -24,7 +25,12 @@ import { router } from "@posthog/ui/router/router";
import { AppLoadingScreen } from "@posthog/ui/shell/AppLoadingScreen";
import { track } from "@posthog/ui/shell/analytics";
import { ErrorBoundary } from "@posthog/ui/shell/ErrorBoundary";
+import { logger } from "@posthog/ui/shell/logger";
import { openExternalUrl } from "@posthog/ui/shell/openExternal";
+import {
+ rememberStartupLocation,
+ resolveStartupLocation,
+} from "@posthog/ui/shell/startupLocation";
import { useAppVisibilityWatchdog } from "@posthog/ui/shell/useAppVisibilityWatchdog";
import { RouterProvider } from "@tanstack/react-router";
import { AnimatePresence, motion } from "framer-motion";
@@ -35,6 +41,8 @@ interface AppProps {
devToolbar?: ReactNode;
}
+const log = logger.scope("app");
+
function App({ devToolbar }: AppProps) {
const { isBootstrapped } = useAuthSession();
const authState = useAuthStateValue((state) => state);
@@ -88,12 +96,10 @@ function App({ devToolbar }: AppProps) {
!isCheckingAccess &&
!needsInviteCode &&
!needsAiApproval;
+ const startupIdentity = getAuthIdentity(authState);
- // Run the initial route's loaders before the router ever mounts, so the boot
- // loading screen holds until the route is ready. The router turns loader
- // errors into route error UI itself; the catch is only unhandled-rejection
- // hygiene. Resets when the user leaves the main app (logout, gates) so
- // re-entry loads fresh.
+ // Resolve and load the initial route before mounting the router. Reset when
+ // the user leaves the main app so a later re-entry starts fresh.
const [initialRouteLoaded, setInitialRouteLoaded] = useState(false);
useEffect(() => {
if (!readyForMainApp) {
@@ -101,17 +107,42 @@ function App({ devToolbar }: AppProps) {
return;
}
if (initialRouteLoaded) return;
+ if (!startupIdentity || !authenticatedClient) return;
+
let cancelled = false;
- void router
- .load()
- .catch(() => undefined)
- .finally(() => {
+ const loadInitialRoute = async (): Promise<void> => {
+ try {
+ const href = await resolveStartupLocation(
+ startupIdentity,
+ authenticatedClient,
+ );
+ router.history.replace(href);
+ rememberStartupLocation(startupIdentity, href);
+ await router.load();
+ } catch (error) {
+ log.error("Failed to load initial route", { error });
+ } finally {
if (!cancelled) setInitialRouteLoaded(true);
- });
+ }
+ };
+ void loadInitialRoute();
+
return () => {
cancelled = true;
};
- }, [readyForMainApp, initialRouteLoaded]);
+ }, [
+ readyForMainApp,
+ initialRouteLoaded,
+ startupIdentity,
+ authenticatedClient,
+ ]);
+
+ useEffect(() => {
+ if (!initialRouteLoaded || !startupIdentity) return;
+ return router.history.subscribe(({ location }) => {
+ rememberStartupLocation(startupIdentity, location.href);
+ });
+ }, [initialRouteLoaded, startupIdentity]);
const mainRef = useRef<HTMLDivElement>(null);
// Mirrors the "main" branch of renderContent() below; keep the two in sync.
diff --git a/products/desktop/packages/ui/src/shell/rendererStorage.ts b/products/desktop/packages/ui/src/shell/rendererStorage.ts
index 7bc95cf11d82..dcb70ac35379 100644
--- a/products/desktop/packages/ui/src/shell/rendererStorage.ts
+++ b/products/desktop/packages/ui/src/shell/rendererStorage.ts
@@ -118,7 +118,7 @@ export function registerRendererStateStorage(
hostStorageReady.resolve(storage);
}
-const deferredHostStorage: StateStorage = {
+export const stateStorage: StateStorage = {
getItem: async (key) => {
// A coalesced write that has not flushed yet is newer than the backend
// copy; land it first so the read never observes older state. A queued
@@ -170,4 +170,4 @@ const deferredHostStorage: StateStorage = {
},
};
-export const electronStorage = createJSONStorage(() => deferredHostStorage);
+export const electronStorage = createJSONStorage(() => stateStorage);
diff --git a/products/desktop/packages/ui/src/shell/startupLocation.test.ts b/products/desktop/packages/ui/src/shell/startupLocation.test.ts
new file mode 100644
index 000000000000..91934cbcf01c
--- /dev/null
+++ b/products/desktop/packages/ui/src/shell/startupLocation.test.ts
@@ -0,0 +1,35 @@
+import { stateStorage } from "@posthog/ui/shell/rendererStorage";
+import { afterEach, describe, expect, it, vi } from "vitest";
+import { resolveStartupLocation } from "./startupLocation";
+
+describe("startup location", () => {
+ afterEach(() => vi.restoreAllMocks());
+
+ it("restores the exact last location", async () => {
+ vi.spyOn(stateStorage, "getItem").mockResolvedValue("/code");
+ const client = {
+ getDesktopFileSystemChannels: vi.fn(),
+ createDesktopFileSystemChannel: vi.fn(),
+ };
+
+ await expect(resolveStartupLocation("project", client)).resolves.toBe(
+ "/code",
+ );
+ expect(client.getDesktopFileSystemChannels).not.toHaveBeenCalled();
+ });
+
+ it("opens a new task in me when there is no saved location", async () => {
+ vi.spyOn(stateStorage, "getItem").mockResolvedValue(null);
+ const client = {
+ getDesktopFileSystemChannels: vi
+ .fn()
+ .mockResolvedValue([{ id: "me-id", path: "me", type: "folder" }]),
+ createDesktopFileSystemChannel: vi.fn(),
+ };
+
+ await expect(resolveStartupLocation("project", client)).resolves.toBe(
+ "/website/me-id/new",
+ );
+ expect(client.createDesktopFileSystemChannel).not.toHaveBeenCalled();
+ });
+});
diff --git a/products/desktop/packages/ui/src/shell/startupLocation.ts b/products/desktop/packages/ui/src/shell/startupLocation.ts
new file mode 100644
index 000000000000..bafa4a491b6f
--- /dev/null
+++ b/products/desktop/packages/ui/src/shell/startupLocation.ts
@@ -0,0 +1,21 @@
+import {
+ ensurePersonalChannelFromClient,
+ type PersonalChannelClient,
+} from "@posthog/ui/features/canvas/ensurePersonalChannel";
+import { stateStorage } from "@posthog/ui/shell/rendererStorage";
+
+const storageKey = (identity: string): string => `startup-location:${identity}`;
+
+export async function resolveStartupLocation(
+ identity: string,
+ client: PersonalChannelClient,
+): Promise<string> {
+ const saved = await stateStorage.getItem(storageKey(identity));
+ if (saved) return saved;
+ const personal = await ensurePersonalChannelFromClient(client);
+ return `/website/${personal.id}/new`;
+}
+
+export function rememberStartupLocation(identity: string, href: string): void {
+ void stateStorage.setItem(storageKey(identity), href);
+}
diff --git a/products/desktop/packages/ui/src/styles/globals.css b/products/desktop/packages/ui/src/styles/globals.css
index 316dea96b184..7404121ac8f9 100644
--- a/products/desktop/packages/ui/src/styles/globals.css
+++ b/products/desktop/packages/ui/src/styles/globals.css
@@ -418,6 +418,37 @@ body:has(.rt-DialogOverlay[data-state="open"]) [data-quill-portal] {
animation: ph-dots-frame 800ms step-end infinite;
}
+/* Dot-ring spinner: eight dots on a 3x3 grid, one keyframe per dot with a
+ staggered delay so a highlight travels the ring. Only `opacity` animates, so
+ this composites without repainting — and unlike the braille spinner it isn't
+ a font glyph, so it stays circular at any size and in any typeface.
+ `ph-dot-ring 900ms` must stay in step with RING_DURATION_MS in
+ primitives/DotRingSpinner.tsx, which spaces the delays. */
+@keyframes ph-dot-ring {
+ 0%,
+ 100% {
+ opacity: 0.2;
+ }
+ 12% {
+ opacity: 1;
+ }
+ 50% {
+ opacity: 0.2;
+ }
+}
+
+.ph-dot-ring {
+ animation: ph-dot-ring 900ms linear infinite;
+}
+
+/* Hold a legible, evenly dimmed ring rather than dropping the signal. */
+@media (prefers-reduced-motion: reduce) {
+ .ph-dot-ring {
+ animation: none;
+ opacity: 0.55;
+ }
+}
+
/* Pulse animation for generating indicator */
@keyframes ph-pulse {
0%,
diff --git a/products/desktop/packages/workspace-server/package.json b/products/desktop/packages/workspace-server/package.json
index 5f89350d09fa..4dc0d14cc322 100644
--- a/products/desktop/packages/workspace-server/package.json
+++ b/products/desktop/packages/workspace-server/package.json
@@ -29,6 +29,7 @@
"@posthog/di": "workspace:*",
"@posthog/enricher": "workspace:*",
"@posthog/git": "workspace:*",
+ "@posthog/harness": "workspace:*",
"@posthog/platform": "workspace:*",
"@posthog/shared": "workspace:*",
"@trpc/server": "catalog:",
diff --git a/products/desktop/packages/workspace-server/src/services/agent/agent.ts b/products/desktop/packages/workspace-server/src/services/agent/agent.ts
index 953dbda83322..d7ae5cfa942b 100644
--- a/products/desktop/packages/workspace-server/src/services/agent/agent.ts
+++ b/products/desktop/packages/workspace-server/src/services/agent/agent.ts
@@ -31,7 +31,6 @@ import {
getAvailableModes,
} from "@posthog/agent/execution-mode";
import { fetchGatewayModels } from "@posthog/agent/gateway-models";
-import { fetchPosthogPiModelCatalog } from "@posthog/agent/pi/model-catalog";
import { getLlmGatewayUrl } from "@posthog/agent/posthog-api";
import {
findPrUrls,
@@ -45,6 +44,7 @@ import {
import type * as AgentTypes from "@posthog/agent/types";
import { execGh } from "@posthog/git/gh";
import { getCurrentBranch } from "@posthog/git/queries";
+import { fetchPosthogPiModelCatalog } from "@posthog/harness/extensions/posthog-provider/model-catalog";
import { APP_META_SERVICE, type IAppMeta } from "@posthog/platform/app-meta";
import {
BUNDLED_RESOURCES_SERVICE,
diff --git a/products/desktop/pnpm-lock.yaml b/products/desktop/pnpm-lock.yaml
index 62c6c8293499..4e5d676bd062 100644
--- a/products/desktop/pnpm-lock.yaml
+++ b/products/desktop/pnpm-lock.yaml
@@ -7,17 +7,17 @@ settings:
catalogs:
default:
'@earendil-works/pi-agent-core':
- specifier: 0.82.1
- version: 0.82.1
+ specifier: 0.83.0
+ version: 0.83.0
'@earendil-works/pi-ai':
- specifier: 0.82.1
- version: 0.82.1
+ specifier: 0.83.0
+ version: 0.83.0
'@earendil-works/pi-coding-agent':
- specifier: 0.82.1
- version: 0.82.1
+ specifier: 0.83.0
+ version: 0.83.0
'@earendil-works/pi-tui':
- specifier: 0.82.1
- version: 0.82.1
+ specifier: 0.83.0
+ version: 0.83.0
'@hono/trpc-server':
specifier: ^0.3.4
version: 0.3.4
@@ -236,13 +236,13 @@ importers:
'@tailwindcss/vite':
specifier: ^4.3.0
'@tanstack/react-query':
specifier: ^5.100.14
version: 5.101.0([email protected])
'@tanstack/router-plugin':
specifier: ^1.168.13
'@trpc/client':
specifier: ^11.17.0
@@ -323,7 +323,7 @@ importers:
version: 4.6.2(patch_hash=a8cd00b963d4ae6787cc267a2345cc1b32bcba5fa1131328b8017ee0d316ab0e)([email protected]([email protected]))([email protected])
react-scan:
specifier: ^0.5.6
reflect-metadata:
specifier: ^0.2.2
version: 0.2.2
@@ -357,22 +357,22 @@ importers:
version: 1.60.0
'@posthog/rollup-plugin':
specifier: ^1.4.4
- version: 1.4.5([email protected])
+ version: 1.4.5([email protected])
'@storybook/addon-a11y':
specifier: 10.4.1
'@storybook/addon-docs':
specifier: 10.4.1
'@storybook/react-vite':
specifier: 10.4.1
'@storybook/test-runner':
specifier: ^0.24.4
'@tanstack/devtools-vite':
specifier: ^0.8.1
'@testing-library/jest-dom':
specifier: ^6.9.1
version: 6.9.1
@@ -405,7 +405,7 @@ importers:
version: 7.7.1
'@vitejs/plugin-react':
specifier: ^5.2.0
'@vitest/ui':
specifier: ^4.1.8
version: 4.1.8([email protected])
@@ -420,7 +420,7 @@ importers:
version: 26.15.3([email protected])
electron-vite:
specifier: ^4.0.1
http-server:
specifier: ^14.1.1
version: 14.1.1
@@ -429,7 +429,7 @@ importers:
version: 9.1.7
jest-image-snapshot:
specifier: ^6.5.2
jimp:
specifier: ^1.6.1
version: 1.6.1
@@ -468,13 +468,13 @@ importers:
version: 5.9.3
vite:
specifier: npm:[email protected]
vite-tsconfig-paths:
specifier: ^6.0.0
vitest:
specifier: ^4.1.8
wait-on:
specifier: ^7.2.0
version: 7.2.0
@@ -579,7 +579,7 @@ importers:
expo-router:
specifier: ~57.0.8
- version: 57.0.8(64405165466fe33cacd7d08cae7227d6)
+ version: 57.0.8(649cbe633c4ca8372dc41cefd86e5cb2)
expo-secure-store:
specifier: ^57.0.1
version: 57.0.1([email protected])
@@ -652,7 +652,7 @@ importers:
devDependencies:
'@testing-library/react-native':
specifier: ^13.3.3
'@types/react':
specifier: ^19.2.15
version: 19.2.17
@@ -661,7 +661,7 @@ importers:
version: 19.1.0
'@vitejs/plugin-react':
specifier: ^4.7.0
react-native-svg-transformer:
specifier: ^1.5.3
@@ -676,10 +676,10 @@ importers:
version: 5.9.3
vite:
specifier: npm:[email protected]
vitest:
specifier: ^4.1.6
apps/web:
dependencies:
@@ -701,6 +701,9 @@ importers:
'@posthog/di':
specifier: workspace:*
version: link:../../packages/di
+ '@posthog/harness':
+ specifier: workspace:*
+ version: link:../../packages/harness
'@posthog/host-router':
specifier: workspace:*
version: link:../../packages/host-router
@@ -755,10 +758,10 @@ importers:
version: 1.60.0
'@tailwindcss/vite':
specifier: ^4.2.2
'@tanstack/router-plugin':
specifier: 'catalog:'
'@types/react':
specifier: ^19.2.15
version: 19.2.17
@@ -767,7 +770,7 @@ importers:
version: 19.2.3(@types/[email protected])
'@vitejs/plugin-react':
specifier: ^4.2.1
tailwindcss:
specifier: ^4.2.2
version: 4.2.2
@@ -776,7 +779,7 @@ importers:
version: 5.9.3
vite:
specifier: npm:[email protected]
packages/agent:
dependencies:
@@ -791,13 +794,13 @@ importers:
version: 0.109.0([email protected])
'@earendil-works/pi-agent-core':
specifier: 'catalog:'
'@earendil-works/pi-ai':
specifier: 'catalog:'
'@earendil-works/pi-coding-agent':
specifier: 'catalog:'
'@hono/node-server':
specifier: 1.19.13
version: 1.19.13([email protected])
@@ -851,7 +854,7 @@ importers:
version: 10.1.2
tar:
specifier: ^7.5.19
- version: 7.5.21
+ version: 7.5.22
uuid:
specifier: 13.0.0
version: 13.0.0
@@ -885,7 +888,7 @@ importers:
version: 2.12.8(@types/[email protected])([email protected])
tsup:
specifier: ^8.5.1
tsx:
specifier: ^4.20.6
version: 4.21.0
@@ -1020,10 +1023,10 @@ importers:
version: 5.9.3
vite:
specifier: npm:[email protected]
vitest:
specifier: ^4.1.8
zod:
specifier: 4.4.3
version: 4.4.3
@@ -1042,7 +1045,7 @@ importers:
version: 0.26.8
tsup:
specifier: ^8.5.1
typescript:
specifier: ^5.5.0
version: 5.9.3
@@ -1076,13 +1079,13 @@ importers:
dependencies:
'@earendil-works/pi-ai':
specifier: 'catalog:'
'@earendil-works/pi-coding-agent':
specifier: 'catalog:'
'@earendil-works/pi-tui':
specifier: 'catalog:'
- version: 0.82.1
+ version: 0.83.0
'@modelcontextprotocol/sdk':
specifier: ^1.29.0
version: 1.29.0([email protected])
@@ -1095,6 +1098,9 @@ importers:
turndown:
specifier: ^7.2.4
version: 7.2.4
+ typebox:
+ specifier: 1.3.7
+ version: 1.3.7
zod:
specifier: 4.4.3
version: 4.4.3
@@ -1107,7 +1113,7 @@ importers:
version: 5.0.6
tsup:
specifier: ^8.5.1
typescript:
specifier: ^5.5.0
version: 5.9.3
@@ -1196,7 +1202,7 @@ importers:
devDependencies:
tsup:
specifier: ^8.5.1
typescript:
specifier: ^5.5.0
version: 5.9.3
@@ -1212,7 +1218,7 @@ importers:
version: 0.19.0([email protected])
tsup:
specifier: ^8.5.1
typescript:
specifier: ^5.5.0
version: 5.9.3
@@ -1629,6 +1635,9 @@ importers:
'@posthog/git':
specifier: workspace:*
version: link:../git
+ '@posthog/harness':
+ specifier: workspace:*
+ version: link:../harness
'@posthog/platform':
specifier: workspace:*
version: link:../platform
@@ -1698,7 +1707,7 @@ importers:
dependencies:
tsup:
specifier: 'catalog:'
tooling/typescript: {}
@@ -1868,16 +1877,16 @@ packages:
peerDependencies:
openapi-types: '>=7'
- '@apm-js-collab/[email protected]':
- resolution: {integrity: sha512-YxLBY5nGlurL7QeJLq6e5g0ouBpAp0pwgyA/5rHXEXwhiPLn9ZHbT+Y2LlP90GT872cSocfjWRYu/fnpuBudNQ==}
+ '@apm-js-collab/[email protected]':
+ resolution: {integrity: sha512-Yidf5GOl60db80UxUtNdKK3pnY7obU/gs0xOfA0SCdnvVLMCvfYIer/egC3TqpPiT0Jg22eg3RlzcO+zKfPMcA==}
engines: {node: '>=18.0.0'}
- '@apm-js-collab/[email protected]':
- resolution: {integrity: sha512-XmXYVs8CzJ1Aj79noVbn2weUO/XWtRyURpGqx7aU7DOXlUQhR0WKOQNF0okh7PCeY37vxf7kU3v57OAkEPm3ww==}
+ '@apm-js-collab/[email protected]':
+ resolution: {integrity: sha512-u1Hb6bHjWtkSpiprwVP6YaHC1DTN4RAU3zYkUDUe7WMnJwdyU1pwTL9dFKiSJB9IiLue/EQovmyx6xhU7FFtAQ==}
hasBin: true
- '@apm-js-collab/[email protected]':
- resolution: {integrity: sha512-2/Z3NTewJTruUkmsSnBC5bJlLNUd9keuD1OLlTEpim4FyLhm6m2Rnfv+wrFdUvFfhmH8CRdiDZBqBrn+wyaGuA==}
+ '@apm-js-collab/[email protected]':
+ resolution: {integrity: sha512-mTvWz9rnQwx1U3h0XPTHaX7bgfkpipLLTQyjlC2cdhQpQEuoLT0AGzoydeoq2NxfEVv6fWOOETcSbb2nptleyw==}
resolution: {integrity: sha512-ECg3hox/6Z/nLajxXqNhgPtNdHWC9zNsDyskwO28WinoFEnWow4IsERNz9AnXRhTZJnYIlAJ4uGn3nlLk65vZA==}
@@ -1993,10 +2002,18 @@ packages:
resolution: {integrity: sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw==}
engines: {node: '>=6.9.0'}
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==}
+ engines: {node: '>=6.9.0'}
+
resolution: {integrity: sha512-T1NCJqT/j9+cn8fvkt7jtwbLBfLC/1y1c7NtCeXFRgzGTsafi68MRv8yzkYSapBnFA6L3U2VSc02ciDzoAJhJg==}
engines: {node: '>=6.9.0'}
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==}
+ engines: {node: '>=6.9.0'}
+
resolution: {integrity: sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==}
engines: {node: '>=6.9.0'}
@@ -2005,14 +2022,26 @@ packages:
resolution: {integrity: sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw==}
engines: {node: '>=6.9.0'}
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-DkXD5OJQaAQIdZ1bt3UZdEnHAn9Imd3IVBdX03UFe+ony9Ojw5pzr9YVKGDY1jt+Gcn/FnGkNf8r+Vj5NOJWtQ==}
+ engines: {node: '>=6.9.0'}
+
resolution: {integrity: sha512-fXSwMQqitTGeHLBC08Eq5yXz2m37E4pJX1qAU1+2cNedz/ifv/bVXft90VeSav5nFO61EcNgwr0aJxbyPaWBPg==}
engines: {node: '>=6.9.0'}
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-OoK6239jHPuSQOoS0kfTVKn0b/rVTk0seKq4Gd2UMLtmOVLjDC0ki3e+c90Trqv2gMfvJFqkiljrr568+qddiw==}
+ engines: {node: '>=6.9.0'}
+
resolution: {integrity: sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA==}
engines: {node: '>=6.9.0'}
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==}
+ engines: {node: '>=6.9.0'}
+
resolution: {integrity: sha512-dTOdvsjnG3xNT9Y0AUg1wAl38y+4Rl4sf9caSQZOXdNqVn+H+HbbJ4IyyHaIqNR6SW9oJpA/RuRjsjCw2IdIow==}
engines: {node: '>=6.9.0'}
@@ -2025,59 +2054,118 @@ packages:
peerDependencies:
'@babel/core': ^7.0.0
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-IY3ZD9Tmooqr3TUhc3DUWxiuo8xx1DWLhd5M7hQ+ZWJamqM2BbalrBJb2MisSLoYorOj75U03qULCxQTY9r3hg==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0
+
resolution: {integrity: sha512-N1EhvLtHzOvj7QQOUCCS3NrPJP8c5W6ZXCHDn7Yialuy1iu4r5EmIYkXlKNqT99Ciw+W0mDqWoR6HWMZlFP3hw==}
engines: {node: '>=6.9.0'}
peerDependencies:
'@babel/core': ^7.0.0
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-907Uymvqgg1dwUA+7IGwFAOSYzQOuzPXKNJ1yxzwPffzkYFg2q2eHi1fIOs6sXkG9NbIUMunnUlkYsfRFNvomg==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0
+
resolution: {integrity: sha512-mOAsxeeKkUKayvZR3HeTYD/fICpCPLJrU5ZjelT/PA6WHtNDBOE436YiaEUvHN454bRM3CebhDsIpieCc4texA==}
peerDependencies:
'@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-47UwBLPpQi1NoWzLuHNjRoHlYXMwIJoBf7MFou6viC/sIHWYygpvr0B6IAyh5sBdA2nr2LPIRww8lfaUVQINBA==}
+ peerDependencies:
+ '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0
+
resolution: {integrity: sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==}
engines: {node: '>=6.9.0'}
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==}
+ engines: {node: '>=6.9.0'}
+
resolution: {integrity: sha512-cwM7SBRZcPCLgl8a7cY0soT1SptSzAlMH39vwiRpOQkJlh53r5hdHwLSCZpQdVLT39sZt+CRpNwYG4Y2v77atg==}
engines: {node: '>=6.9.0'}
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-j+7JYmk1JYDtACIGj0QJqqWZjoUpMoEikQGADMaHgCMCSDqd2+P32rfcibUNrGOMWrlzK1WJBdxrB3JJQZwWtg==}
+ engines: {node: '>=6.9.0'}
+
resolution: {integrity: sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw==}
engines: {node: '>=6.9.0'}
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==}
+ engines: {node: '>=6.9.0'}
+
resolution: {integrity: sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA==}
engines: {node: '>=6.9.0'}
peerDependencies:
'@babel/core': ^7.0.0
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0
+
resolution: {integrity: sha512-URMGH08NzYFhubNSGJrpUEphGKQwMQYBySzat5cAByY1/YgIRkULnIy3tAMeszlL/so2HbeilYloUmSpd7GdVw==}
engines: {node: '>=6.9.0'}
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-+kmGVjcT9RGYzoDwdwEqEvGgKe3BYq+O1iGzjFubaNgZHwYHP6lsF2Yghf4kEuv9BV7tYDZ913aBW9am6YKong==}
+ engines: {node: '>=6.9.0'}
+
resolution: {integrity: sha512-S9gzZ/bz83GRysI7gAD4wPT/AI3uCnY+9xn+Mx/KPs2JwHJIz1W8PZkg2cqyt3RNOBM8ejcXhV6y8Og7ly/Dug==}
engines: {node: '>=6.9.0'}
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw==}
+ engines: {node: '>=6.9.0'}
+
resolution: {integrity: sha512-7fiA521aVw8lSPeI4ZOD3vRFkoqkJcS+z4hFo82bFSH/2tNd6eJ5qCVMS5OzDmZh/kaHQeBaeyxK6wljcPtveA==}
engines: {node: '>=6.9.0'}
peerDependencies:
'@babel/core': ^7.0.0
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-16AMiW26DbXWBbr3B8wNozKM0ydMLB892vaOaJW/fPJdnT8vJk5sdkQcU/isqUxyCE0cEoa8wZOcbgDuC4b6Og==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0
+
resolution: {integrity: sha512-mq8e+laIk94/yFec3DxSjCRD2Z0TAjhVbEJY3UQrlwVo15Lmt7C2wAUbK4bjnTs4APkwsYLTahXRraQXhb1WCg==}
engines: {node: '>=6.9.0'}
peerDependencies:
'@babel/core': ^7.0.0
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-atfGXWSeCiF4DnKZIfmJfQRkSw9b9gNNXR1kqKjbhG4pGYCOnkp8OcTB8E3NXjBu8NpheSnOeNKz8KT7UNFTmQ==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0
+
resolution: {integrity: sha512-Tub4ZKEXqbPjXgWLl2+3JpQAYBJ8+ikpQ2Ocj/q/r0LwE3UhENh7EUabyHjz2kCEsrRY83ew2DQdHluuiDQFzg==}
engines: {node: '>=6.9.0'}
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-brcMGQaVzIeUb+6/bs1Av0f8YuNNjKY2JyvfRCsFuFsdKccEQ5Ges2y74D74NZ1Rz8lKJ9ksJkfqwQFJ/iNEyQ==}
+ engines: {node: '>=6.9.0'}
+
resolution: {integrity: sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==}
engines: {node: '>=6.9.0'}
@@ -2098,10 +2186,18 @@ packages:
resolution: {integrity: sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==}
engines: {node: '>=6.9.0'}
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==}
+ engines: {node: '>=6.9.0'}
+
resolution: {integrity: sha512-z+PwLziMNBeSQJonizz2AGnndLsP2DeGHIxDAn+wdHOGuo4Fo1x1HBPPXeE9TAOPHNNWQKCSlA2VZyYyyibDnQ==}
engines: {node: '>=6.9.0'}
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-iES0Skag9ERIF68aXadpO6dbXa03mNWK3sEqJaMnLNs/eC3l0lkImdfoy6Y09/SfkpawdAB4RjQ7PVA7TcVGdw==}
+ engines: {node: '>=6.9.0'}
+
resolution: {integrity: sha512-xOBvwq86HHdB7WUDTfKfT/Vuxh7gElQ+Sfti2Cy6yIWNW05P8iUslOVcZ4/sKbE+/jQaukQAdz/gf3724kYdqw==}
engines: {node: '>=6.9.0'}
@@ -2128,6 +2224,12 @@ packages:
peerDependencies:
'@babel/core': ^7.0.0-0
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-p+G5BNXDcy3bOXplhY4HybQ1GxH3i2Tppmdm/3epyRu2VgJJZuUlZ61MqRTg582Q7ZLBdP7fePYvsumSEkMxcQ==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+
resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==}
peerDependencies:
@@ -2166,12 +2268,24 @@ packages:
peerDependencies:
'@babel/core': ^7.0.0-0
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-foag0BB37ROhdeIX9O8G0jX7hw0UekJc04cHMrYLOnrErsnBKqJGHJ8eDRpoCFZBvEPPygmmtw4qyU97qa4oOw==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+
resolution: {integrity: sha512-D+OrJumc9McXNEBI/JmFnc/0uCM2/Y3PEBG3gfV3QIYkKv5pvnpzFrl1kYCrcHJP8nOeFB/SHi1IHz29pNGuew==}
engines: {node: '>=6.9.0'}
peerDependencies:
'@babel/core': ^7.0.0-0
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-ajMX6QPcyomotqwpzhkYGxcK2i/us0rs1Qo9QvUpa+Fca0FTmqrzKrctoIYLMxcOhGZldGT/BAVkRGTWBiR8gQ==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+
resolution: {integrity: sha512-jiLC0ma9XkQT3TKJ9uYvlakm66Pamywo+qwL+oL8HJOvc6TWdZXVfhqJr8CCzbSGUAbDOzlGHJC1U+vRfLQDvw==}
engines: {node: '>=6.9.0'}
@@ -2194,6 +2308,12 @@ packages:
peerDependencies:
'@babel/core': ^7.0.0-0
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-TSu8+mHCoEaaCDEZ0I3+6mvTBYR4PCxQwf2z9/r5Tbztv6NaLR3B9thGTTxX2WGuGHJqRiAbKPeGTJ5XWXVg6A==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+
resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==}
peerDependencies:
@@ -2242,6 +2362,12 @@ packages:
peerDependencies:
'@babel/core': ^7.0.0-0
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-ngr+82Sh0xMz25TPCZi+nC2iTzjfCdWS2ONXTp/PtSCHCgaCNBpdMqgvJ2ccdLlClVZ7sisIgB914j/JFe+RZA==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+
resolution: {integrity: sha512-8Z4TGic6xW70FKThA5HYEKKyBpOOsucTOD1DjU3fZxDg+K3zBJcXMFnt/4yQiZnf5+MiOMSXQ9PaEK/Ilh1DeA==}
engines: {node: '>=6.9.0'}
@@ -2254,24 +2380,48 @@ packages:
peerDependencies:
'@babel/core': ^7.0.0-0
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-d98gXZkgswvkyohMBABkhm3GeXhYj8psWfwQ2C7gtfrKGTykQa/iOIi+JJhwMjPlZ6Vm2XN+DCf3Es1EoG4ZLA==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+
resolution: {integrity: sha512-ilTRcmbuXjsMmcZ3HASTe4caH5Tpo93PkTxF9oG2VZsSWsahydmcEHhix9Ik122RcTnZnUzPbmux4wh1swfv7g==}
engines: {node: '>=6.9.0'}
peerDependencies:
'@babel/core': ^7.0.0-0
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-pcUb2SS+RMo9TWVBwKGI5ShtoG7R+zBsFmCKDa6fe8c+hPr3XJlZgoE5j6i8W7gDjhyvy+85vmYexanvXh3d1w==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+
resolution: {integrity: sha512-tt/7wOtBmwHPNMPu7ax4pdPz6shjFrmHDghvNC+FG9Qvj7D6mJcoRQIF5dy4njmxR941l6rgtvfSB2zX3VlUIw==}
engines: {node: '>=6.9.0'}
peerDependencies:
'@babel/core': ^7.0.0-0
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-ONyr4+AZhKh8yKWInVxU9AXA9EbsyeLcL6V0dJy6M2/62vuvpGm29zzuymbTpdc451GEpDIdAyPLP3r+P61yKQ==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+
resolution: {integrity: sha512-dY2wS3I2G7D697VHndN91TJr8/AAfXQNt5ynCTI/MpxMsSzHp+52uNivYT5wCPax3whc47DR8Ba7cmlQMg24bw==}
engines: {node: '>=6.9.0'}
peerDependencies:
'@babel/core': ^7.0.0-0
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-GtcpjFvanPfzNQi3eTitsCqtRRmmqzpy/A+yhTR1HaZo1Ly3EA8ZXxlPyHdR8/IuRMYc3E4wdGBewB2QKQjAaA==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+
resolution: {integrity: sha512-rfQ++ghVwTWTqQ7w8qyDxL1XGihjBss4CmTgGRCTAC9RIbhVpyp4fOeZtta0Lbf+dTNIVJer6ych2ibHwkZqsQ==}
engines: {node: '>=6.9.0'}
@@ -2284,12 +2434,24 @@ packages:
peerDependencies:
'@babel/core': ^7.0.0-0
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-qV0OGGBVacduzQHE649JyCneOFI/maT+YKsO+K4Yi3xv2wTPNjM/W2o2gdzMwEAZz7fXNTHAe0NcSg30bIN69g==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+
resolution: {integrity: sha512-Kl9Bc6D0zTUcFUvkNuQh4eGXPKKNDOJQXVyyM4ZAQPMveniJdxi8XMJwLo+xSoW3MIq81bD33lcUe9kZpl0MCw==}
engines: {node: '>=6.9.0'}
peerDependencies:
'@babel/core': ^7.0.0-0
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-iPX8aD6H9zV5s7ZsqTdNocPN/MGQ5sSMnElKrktxjJRMnB2jN/1p2+R7GkfD6CAYoVFqy5A4XnSIUeGgJzIWpg==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+
resolution: {integrity: sha512-tQvHWSZ3/jH2xuq/vZDy0jNn+ZdXJeM8gHvX4lnJmsc3+50yPlWdZXIc5ay+umX+2/tJIqHqiEqcJvxlmIvRvQ==}
engines: {node: '>=6.9.0'}
@@ -2302,12 +2464,24 @@ packages:
peerDependencies:
'@babel/core': ^7.0.0-0
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-wRHeUjUjCZnMHmiO5bRgjFLcoEh7JyTdByOW11ahhwNa4V0bmeGEaIvt51yq0zQp2yWIpqfxXXPyUP6GFJZHOQ==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+
resolution: {integrity: sha512-BfbWFFEJFQzLCQ5N8VocnCtA8J1CLkNTe2Ms2wocj75dd6VpiqS5Z5quTYcUoo4Yq+DN0rtikODccuv7RU81sw==}
engines: {node: '>=6.9.0'}
peerDependencies:
'@babel/core': ^7.0.0-0
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-zeSIHh0+E1Um1WJRXCFlHQYu2ieJNdivLLjlBEp+dIBu3S51n+SZZmIXjxnItw6pz56Cn+KvK68BIBVsxq2JiQ==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+
resolution: {integrity: sha512-+anKKair6gpi8VsM/95kmomGNMD0eLz1NQ8+Pfw5sAwWH9fGYXT50E55ZpV0pHUHWf6IUTWPM+f/7AAff+wr9A==}
engines: {node: '>=6.9.0'}
@@ -2320,18 +2494,36 @@ packages:
peerDependencies:
'@babel/core': ^7.0.0-0
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-j0vCldybPC5b5dwCQOJ21uKtHzt7hxLygJTg9eF1ScfaikEDNfzn94XoW5Fi+seBR0nCyL23xaBFFkq7dTM8XQ==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+
resolution: {integrity: sha512-1CZQA5KNAD6ZYQLPw7oi5ewtDNxH/2vuCh+6SmvgDfhumForvs8a1o9n0UrEoBD8HU4djO2yWngTQlXl1NDVEQ==}
engines: {node: '>=6.9.0'}
peerDependencies:
'@babel/core': ^7.0.0
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-vuFoLwr4qnv2xbZ16SQd6uPcH5FNrLHhk/Jzo++0XJFcaDsr4gjJVg6j398oMHiC+83k/GiBzviwF5KBJkPUtQ==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0
+
resolution: {integrity: sha512-3wKbRgmzYbw24mDJXT7N+ADXw8BC/imU9yo9c9X9NKaLF1fW+e5H1U5QjMUBe4Qo4Ox/o++IyUkl1sVCLgevKg==}
engines: {node: '>=6.9.0'}
peerDependencies:
'@babel/core': ^7.0.0-0
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-idmp1dFaekP9GbcMvG24Kvw2BfhFZjHnNJCkV4WuIY4PskJzwI3f1N5OdgYke38T7rftO6ERulFRn2cFeZwRkg==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+
resolution: {integrity: sha512-5rh+JR4JBC4pGkXLAcYdLHZjXudVxWMXbB6u6+E9lRL5TrGVbHt1TjxGbZ8CkmYw9zjkB7jutzOROArsqtncEA==}
engines: {node: '>=6.9.0'}
@@ -2344,12 +2536,24 @@ packages:
peerDependencies:
'@babel/core': ^7.0.0-0
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-sLsyndxK2VwX6yNUOakMb7Sh553ZTe/vVM1XJ+9Z5aW1ytsc8xOIwmyk05NNjN60vkc5/KqoTH6hB4V41LJhng==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+
resolution: {integrity: sha512-A4zobikRGJTsX9uqVFdafzGkqD30t26ck2LmOzAuLL8b2x6k3TIqRiT2xVvA9fNmFeTX484VpsdgmKNA0bS23w==}
engines: {node: '>=6.9.0'}
peerDependencies:
'@babel/core': ^7.0.0-0
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-6GM1dhvK3gNODkXcEcMCOLEDCLSoZ/sBbro2Ax8HURyasQ4NshagQixkRFdh5niI6E4gmA/jYI/4aT7rRos3ZQ==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+
resolution: {integrity: sha512-qBkYTYCb76RRxUM6CcZA5KRu8K4SM8ajzVeUgVdMVO9NN9uI/GaVmBg/WKJJGnNokV9SY8FxNOVWGXzqzUidBg==}
engines: {node: '>=6.9.0'}
@@ -2362,18 +2566,36 @@ packages:
peerDependencies:
'@babel/core': ^7.0.0-0
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-/6Rz4DK1ETDEM/bWHsPHcaEe7ZaT1EqSXjtSP/L0DijOYuaUhiRiOKcwpZ8P7zR4xXEHc2ITdiCgBm9Tpyv9ug==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+
resolution: {integrity: sha512-b97jvNSOb5+ehyQmBpmhOCiUC5oVK4PMnpRvO7+ymFBoqYjeDHIU9jnrNUuwHOiL9RpGDoKBpSViarV+BU+eVA==}
engines: {node: '>=6.9.0'}
peerDependencies:
'@babel/core': ^7.0.0-0
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-+BNo06dnrzdNNqCm1X6YUaVv0DKk8Q+JYcoZfOkLhYWNCXzlwTSRq8zGWayT1csjcpNXV9CQTBRRbmTLZac5cA==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+
resolution: {integrity: sha512-D6Eujc2zMxKjfa4Zxl4GHMsmhKKZ9VpcqIchJLvwTxad9zWIYulwYItBovpDOoNLISpcZSXoDJ5gaGbQUDqViA==}
engines: {node: '>=6.9.0'}
peerDependencies:
'@babel/core': ^7.0.0-0
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-+1wdDMGNb4UPeY3Q4L5yLiYe6TXPXubs4NjrgRFw13hPRLJfEMw2Q5OXkee6/IfdqePIeW4Jjwe3aBh7SdKz4Q==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+
resolution: {integrity: sha512-ykDdF5yI4f1WrAolLqeF3hmYU12j9ntLQl/AOG1HAS21jxyg1Q0/J/tpREuYLfatGdGmXp/3yS0ZA76kOlVq9Q==}
engines: {node: '>=6.9.0'}
@@ -2386,26 +2608,44 @@ packages:
peerDependencies:
'@babel/core': ^7.0.0-0
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-TL0hMc9xzy86VD31nUiwzd5otRAcyEPcsegCxolO0PvcXuH1v0kECe/UIznYFihpkvU5wg/jk4v0TTEFfm53fw==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+
resolution: {integrity: sha512-zbwoTsBruTeKB9hSq73ha66iFeJHuaFkUbwvqElnygoNbj/jHRsSeokowZFN3CZ64IvEqcmmkVe89OPXc7ldAw==}
engines: {node: '>=6.9.0'}
peerDependencies:
'@babel/core': ^7.0.0-0
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-06IyK09H3wi4cGbhDBwp5gUGo0IKtnYa8tyTiephirPCK6fbobVGiXMMI5zLQ4aKEYP3wZ3ArU44o+8KMrSG/Q==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+
resolution: {integrity: sha512-61bxqhiRfAACulXSLd/GxqmAedUSrRZIu/cbaT18T1CetkTmtDN15it7i80ru4DVqRK1WMxQhXs+Lf9kajm5Ow==}
engines: {node: '>=6.9.0'}
peerDependencies:
'@babel/core': ^7.0.0-0
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-WsZulLVBUHXVj2cUcPVx6UE21TpalB6bHbSFErKT0Ib++ax24jjXe73FqlWvdylFOjiuPHYi6VCcgRad1ItN+A==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+
resolution: {integrity: sha512-JfuinvDOsD9FVMTHpzA/pBLisxpv1aSf+OIV8lgH3MuWrks19R27e6a6DipIg4aX1Zm9Wpb04p8wljfKrVSnPA==}
engines: {node: '>=6.9.0'}
peerDependencies:
'@babel/core': ^7.0.0-0
- '@babel/[email protected]':
- resolution: {integrity: sha512-FijqlqMA7DmRdg/aINBSs04y8XNTYw/lr1gJ2WsmBnnaNw1iS43EPkJW+zK7z65auG3AWRFXWj+NcTQwYptUog==}
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-rNNFV0DBAJp988xW2DOntfDoYn1eR8GGF5AT5vYc+rjyfaQkM242c9tZUHHPe7KYaiJizXPWhQTzzdbXySyhBw==}
engines: {node: '>=6.9.0'}
peerDependencies:
'@babel/core': ^7.0.0-0
@@ -2416,6 +2656,12 @@ packages:
peerDependencies:
'@babel/core': ^7.0.0-0
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-xmAscdE/AsqRW7vutbPNoUmu/nF5SrLKPs7aoJgEjo35lLKA/Bc0i2rMv/hr1+Y0o1bQCiVtith3u2vdgRL39Q==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+
resolution: {integrity: sha512-N/wH1vcn4oYawbJ13Y/FxcQrWk63jhfNa7jef0ih7PHSIHX2LB7GWE1rkPrOnka9kwMxb6hMl19p7lidA+EHmQ==}
engines: {node: '>=6.9.0'}
@@ -2434,12 +2680,24 @@ packages:
peerDependencies:
'@babel/core': ^7.0.0-0
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-jK52h8LaLc7JarhQV2ofeFMts4H7vnOXnqZNA6fYglBTZewRBE51KWt3BUltW1P+KoPsYkHoJeXePuz4zo2LMw==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+
resolution: {integrity: sha512-xvINq24TRojDuyt6JGtHmkVkrfVV3FPT16uytxImLeBZqW3/H52yN+kM1MGuyPkIQxrzKwPHs5U/MP3qKyzkGw==}
engines: {node: '>=6.9.0'}
peerDependencies:
'@babel/core': ^7.0.0-0
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-7D/x/23/d/3VqZ0QA+LGbZMlGwZjztBygSWWWsfTPoQ1oQ6Q1P6Mr3d0kk42XabyUVw+fha3LqdRsFqeKqvCyA==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+
resolution: {integrity: sha512-+bQy5WOI2V6LJZpPVxY+yp66XdZ2yifu0Mc1aP5CQKgjn4QM5IN2i5fAZ4xKop47pr8rpVhiAeu+nDQa12C8+g==}
engines: {node: '>=6.9.0'}
@@ -2454,14 +2712,26 @@ packages:
resolution: {integrity: sha512-JiDShH45zKHWyGe4ZNVRrCjBz8Nh9TMmZG1kh4QTK8hCBTWBi8Da+i7s1fJw7/lYpM4ccepSNfqzZ/QvABBi5g==}
engines: {node: '>=6.9.0'}
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw==}
+ engines: {node: '>=6.9.0'}
+
resolution: {integrity: sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ==}
engines: {node: '>=6.9.0'}
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==}
+ engines: {node: '>=6.9.0'}
+
resolution: {integrity: sha512-4HPiQr0X7+waHfyXPZpWPfWL/J7dcN1mx9gL6WdQVMbPnF3+ZhSMs8tCxN7oHddJE9fhNE7+lxdnlyemKfJRuA==}
engines: {node: '>=6.9.0'}
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-EhlfNQtZ+NK22w5BM61ciuiq1m58ed33Wr1Xan//ZRTy6hgjnwyCffRYwzsGXdASJSUJ1guZILsErh1eQcl+zw==}
+ engines: {node: '>=6.9.0'}
+
resolution: {integrity: sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==}
engines: {node: '>=6.9.0'}
@@ -2692,22 +2962,22 @@ packages:
'@drizzle-team/[email protected]':
resolution: {integrity: sha512-z33Il7l5dKjUgGULTqBsQBQwckHh5AbIuxhdsIxDDiZAzBOrZO6q9ogcWC65kU382AfynTfgNumVcNIjuIua6w==}
- '@earendil-works/[email protected]':
- resolution: {integrity: sha512-Z3kloziJIE2dmrisRckZX8zDca/gIv9/YdFAzeoqpHiLV2wsni6bL4hInNSjVKLbqT+4kqLIkph2JQLKvSepjg==}
+ '@earendil-works/[email protected]':
+ resolution: {integrity: sha512-RorGp9OH5l3ElpuC5a5ZQ2eWcchZGXflXRzVGkV99y3y6tT+LLNyxoYIdVKvTKWEObwhExeQbTH0fI2tE4iX4g==}
engines: {node: '>=22.19.0'}
- '@earendil-works/[email protected]':
- resolution: {integrity: sha512-3WFYRhEp3lQB3444EhPMBcM7zSaEUE3eJgHOR7s4081NLqbw/FsWilIKWXSua0Gv3sRr7m9xMidR3pPDE7jI/A==}
+ '@earendil-works/[email protected]':
+ resolution: {integrity: sha512-m3IZD4g3er0V8TC9+Vpgw/sjTKqcJlkcIBy/JvsgRubuuik3tAVzyugUg4rVrShIkkOT69mEd34NEqKUIsl6JQ==}
engines: {node: '>=22.19.0'}
hasBin: true
- '@earendil-works/[email protected]':
- resolution: {integrity: sha512-zbkAhoIuDPMF3pKuja0ajZabrMWU29FUMV9A/XMXT/XC1yXs5xt6t6t13GogQFsDrDqbFP4DkZQO1w8rWRAzYA==}
+ '@earendil-works/[email protected]':
+ resolution: {integrity: sha512-uYhF+FsZxogoSX/AxBcUdiY+ZklubwaXyAoEGA2eQwsHcyEAhUYIKh/WLXe/a8+k8eTCmxb+ZN2Zo9mzQtzbWw==}
engines: {node: '>=22.19.0'}
hasBin: true
- '@earendil-works/[email protected]':
- resolution: {integrity: sha512-9yN8hALfKaxZq7n54EMxqhFCWnMi6LHkraMJ/1YjHiATq75XrI6XDMVppn9EDtiK7Fks8hUe1SDXUTrIvwRWfQ==}
+ '@earendil-works/[email protected]':
+ resolution: {integrity: sha512-IoYrb0rORjELmEpNtoCA/U8je3KopMkRAVJRdSzvXRvgb+Huo1gNh8Q5CSZvNOiYtDxJdj2tYZZHZ4B3+IN3hA==}
engines: {node: '>=22.19.0'}
@@ -2813,6 +3083,12 @@ packages:
cpu: [ppc64]
os: [aix]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-EKX3Qwmhz1eMdEJokhALr0YiD0lhQNwDqkPYyPhiSwKrh7/4KRjQc04sZ8db+5DVVnZ1LmbNDI1uAMPEUBnQPg==}
+ engines: {node: '>=18'}
+ cpu: [ppc64]
+ os: [aix]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==}
engines: {node: '>=18'}
@@ -2837,6 +3113,12 @@ packages:
cpu: [arm64]
os: [android]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-62dPZHpIXzvChfvfLJow3q5dDtiNMkwiRzPylSCfriLvZeq0a1bWChrGx/BbUbPwOrsWKMn8idSllklzBy+dgQ==}
+ engines: {node: '>=18'}
+ cpu: [arm64]
+ os: [android]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==}
engines: {node: '>=18'}
@@ -2861,6 +3143,12 @@ packages:
cpu: [arm]
os: [android]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-jbPXvB4Yj2yBV7HUfE2KHe4GJX51QplCN1pGbYjvsyCZbQmies29EoJbkEc+vYuU5o45AfQn37vZlyXy4YJ8RQ==}
+ engines: {node: '>=18'}
+ cpu: [arm]
+ os: [android]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==}
engines: {node: '>=18'}
@@ -2885,6 +3173,12 @@ packages:
cpu: [x64]
os: [android]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-x5VpMODneVDb70PYV2VQOmIUUiBtY3D3mPBG8NxVk5CogneYhkR7MmM3yR/uMdITLrC1ml/NV1rj4bMJuy9MCg==}
+ engines: {node: '>=18'}
+ cpu: [x64]
+ os: [android]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==}
engines: {node: '>=18'}
@@ -2909,6 +3203,12 @@ packages:
cpu: [arm64]
os: [darwin]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-5lckdqeuBPlKUwvoCXIgI2D9/ABmPq3Rdp7IfL70393YgaASt7tbju3Ac+ePVi3KDH6N2RqePfHnXkaDtY9fkw==}
+ engines: {node: '>=18'}
+ cpu: [arm64]
+ os: [darwin]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==}
engines: {node: '>=18'}
@@ -2933,6 +3233,12 @@ packages:
cpu: [x64]
os: [darwin]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-rYnXrKcXuT7Z+WL5K980jVFdvVKhCHhUwid+dDYQpH+qu+TefcomiMAJpIiC2EM3Rjtq0sO3StMV/+3w3MyyqQ==}
+ engines: {node: '>=18'}
+ cpu: [x64]
+ os: [darwin]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==}
engines: {node: '>=18'}
@@ -2957,6 +3263,12 @@ packages:
cpu: [arm64]
os: [freebsd]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-B48PqeCsEgOtzME2GbNM2roU29AMTuOIN91dsMO30t+Ydis3z/3Ngoj5hhnsOSSwNzS+6JppqWsuhTp6E82l2w==}
+ engines: {node: '>=18'}
+ cpu: [arm64]
+ os: [freebsd]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==}
engines: {node: '>=18'}
@@ -2981,6 +3293,12 @@ packages:
cpu: [x64]
os: [freebsd]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-jOBDK5XEjA4m5IJK3bpAQF9/Lelu/Z9ZcdhTRLf4cajlB+8VEhFFRjWgfy3M1O4rO2GQ/b2dLwCUGpiF/eATNQ==}
+ engines: {node: '>=18'}
+ cpu: [x64]
+ os: [freebsd]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==}
engines: {node: '>=18'}
@@ -3005,6 +3323,12 @@ packages:
cpu: [arm64]
os: [linux]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-RZPHBoxXuNnPQO9rvjh5jdkRmVizktkT7TCDkDmQ0W2SwHInKCAV95GRuvdSvA7w4VMwfCjUiPwDi0ZO6Nfe9A==}
+ engines: {node: '>=18'}
+ cpu: [arm64]
+ os: [linux]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==}
engines: {node: '>=18'}
@@ -3029,6 +3353,12 @@ packages:
cpu: [arm]
os: [linux]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-RkT/YXYBTSULo3+af8Ib0ykH8u2MBh57o7q/DAs3lTJlyVQkgQvlrPTnjIzzRPQyavxtPtfg0EopvDyIt0j1rA==}
+ engines: {node: '>=18'}
+ cpu: [arm]
+ os: [linux]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==}
engines: {node: '>=18'}
@@ -3053,6 +3383,12 @@ packages:
cpu: [ia32]
os: [linux]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-GA48aKNkyQDbd3KtkplYWT102C5sn/EZTY4XROkxONgruHPU72l+gW+FfF8tf2cFjeHaRbWpOYa/uRBz/Xq1Pg==}
+ engines: {node: '>=18'}
+ cpu: [ia32]
+ os: [linux]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==}
engines: {node: '>=18'}
@@ -3077,6 +3413,12 @@ packages:
cpu: [loong64]
os: [linux]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-a4POruNM2oWsD4WKvBSEKGIiWQF8fZOAsycHOt6JBpZ+JN2n2JH9WAv56SOyu9X5IqAjqSIPTaJkqN8F7XOQ5Q==}
+ engines: {node: '>=18'}
+ cpu: [loong64]
+ os: [linux]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==}
engines: {node: '>=18'}
@@ -3101,6 +3443,12 @@ packages:
cpu: [mips64el]
os: [linux]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-KabT5I6StirGfIz0FMgl1I+R1H73Gp0ofL9A3nG3i/cYFJzKHhouBV5VWK1CSgKvVaG4q1RNpCTR2LuTVB3fIw==}
+ engines: {node: '>=18'}
+ cpu: [mips64el]
+ os: [linux]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==}
engines: {node: '>=18'}
@@ -3125,6 +3473,12 @@ packages:
cpu: [ppc64]
os: [linux]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-gRsL4x6wsGHGRqhtI+ifpN/vpOFTQtnbsupUF5R5YTAg+y/lKelYR1hXbnBdzDjGbMYjVJLJTd2OFmMewAgwlQ==}
+ engines: {node: '>=18'}
+ cpu: [ppc64]
+ os: [linux]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==}
engines: {node: '>=18'}
@@ -3149,6 +3503,12 @@ packages:
cpu: [riscv64]
os: [linux]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-hL25LbxO1QOngGzu2U5xeXtxXcW+/GvMN3ejANqXkxZ/opySAZMrc+9LY/WyjAan41unrR3YrmtTsUpwT66InQ==}
+ engines: {node: '>=18'}
+ cpu: [riscv64]
+ os: [linux]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==}
engines: {node: '>=18'}
@@ -3173,6 +3533,12 @@ packages:
cpu: [s390x]
os: [linux]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-2k8go8Ycu1Kb46vEelhu1vqEP+UeRVj2zY1pSuPdgvbd5ykAw82Lrro28vXUrRmzEsUV0NzCf54yARIK8r0fdw==}
+ engines: {node: '>=18'}
+ cpu: [s390x]
+ os: [linux]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==}
engines: {node: '>=18'}
@@ -3197,6 +3563,12 @@ packages:
cpu: [x64]
os: [linux]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-hzznmADPt+OmsYzw1EE33ccA+HPdIqiCRq7cQeL1Jlq2gb1+OyWBkMCrYGBJ+sxVzve2ZJEVeePbLM2iEIZSxA==}
+ engines: {node: '>=18'}
+ cpu: [x64]
+ os: [linux]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==}
engines: {node: '>=18'}
@@ -3215,6 +3587,12 @@ packages:
cpu: [arm64]
os: [netbsd]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-b6pqtrQdigZBwZxAn1UpazEisvwaIDvdbMbmrly7cDTMFnw/+3lVxxCTGOrkPVnsYIosJJXAsILG9XcQS+Yu6w==}
+ engines: {node: '>=18'}
+ cpu: [arm64]
+ os: [netbsd]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==}
engines: {node: '>=18'}
@@ -3239,6 +3617,12 @@ packages:
cpu: [x64]
os: [netbsd]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-OfatkLojr6U+WN5EDYuoQhtM+1xco+/6FSzJJnuWiUw5eVcicbyK3dq5EeV/QHT1uy6GoDhGbFpprUiHUYggrw==}
+ engines: {node: '>=18'}
+ cpu: [x64]
+ os: [netbsd]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==}
engines: {node: '>=18'}
@@ -3257,6 +3641,12 @@ packages:
cpu: [arm64]
os: [openbsd]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-AFuojMQTxAz75Fo8idVcqoQWEHIXFRbOc1TrVcFSgCZtQfSdc1RXgB3tjOn/krRHENUB4j00bfGjyl2mJrU37A==}
+ engines: {node: '>=18'}
+ cpu: [arm64]
+ os: [openbsd]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==}
engines: {node: '>=18'}
@@ -3281,6 +3671,12 @@ packages:
cpu: [x64]
os: [openbsd]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-+A1NJmfM8WNDv5CLVQYJ5PshuRm/4cI6WMZRg1by1GwPIQPCTs1GLEUHwiiQGT5zDdyLiRM/l1G0Pv54gvtKIg==}
+ engines: {node: '>=18'}
+ cpu: [x64]
+ os: [openbsd]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==}
engines: {node: '>=18'}
@@ -3299,6 +3695,12 @@ packages:
cpu: [arm64]
os: [openharmony]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-+KrvYb/C8zA9CU/g0sR6w2RBw7IGc5J2BPnc3dYc5VJxHCSF1yNMxTV5LQ7GuKteQXZtspjFbiuW5/dOj7H4Yw==}
+ engines: {node: '>=18'}
+ cpu: [arm64]
+ os: [openharmony]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==}
engines: {node: '>=18'}
@@ -3323,6 +3725,12 @@ packages:
cpu: [x64]
os: [sunos]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-ikktIhFBzQNt/QDyOL580ti9+5mL/YZeUPKU2ivGtGjdTYoqz6jObj6nOMfhASpS4GU4Q/Clh1QtxWAvcYKamA==}
+ engines: {node: '>=18'}
+ cpu: [x64]
+ os: [sunos]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==}
engines: {node: '>=18'}
@@ -3347,6 +3755,12 @@ packages:
cpu: [arm64]
os: [win32]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-7yRhbHvPqSpRUV7Q20VuDwbjW5kIMwTHpptuUzV+AA46kiPze5Z7qgt6CLCK3pWFrHeNfDd1VKgyP4O+ng17CA==}
+ engines: {node: '>=18'}
+ cpu: [arm64]
+ os: [win32]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==}
engines: {node: '>=18'}
@@ -3371,6 +3785,12 @@ packages:
cpu: [ia32]
os: [win32]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-SmwKXe6VHIyZYbBLJrhOoCJRB/Z1tckzmgTLfFYOfpMAx63BJEaL9ExI8x7v0oAO3Zh6D/Oi1gVxEYr5oUCFhw==}
+ engines: {node: '>=18'}
+ cpu: [ia32]
+ os: [win32]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==}
engines: {node: '>=18'}
@@ -3395,14 +3815,20 @@ packages:
cpu: [x64]
os: [win32]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-56hiAJPhwQ1R4i+21FVF7V8kSD5zZTdHcVuRFMW0hn753vVfQN8xlx4uOPT4xoGH0Z/oVATuR82AiqSTDIpaHg==}
+ engines: {node: '>=18'}
+ cpu: [x64]
+ os: [win32]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==}
engines: {node: '>=18'}
cpu: [x64]
os: [win32]
- '@eslint-community/[email protected]':
- resolution: {integrity: sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==}
+ '@eslint-community/[email protected]':
+ resolution: {integrity: sha512-cuadcxVFE8sDK6iWJbs8Sn0av2Nrh2QSGQhVlBW9AaAHqHwjWsZHT8LJ4hFGPh7ASBV2deFdM7H/DPjulmh8rg==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
eslint: ^6.0.0 || ^7.0.0 || >=8.0.0
@@ -4439,8 +4865,8 @@ packages:
resolution: {integrity: sha512-CjruKY9V6NMssL/T1kAFgzosF1v9o6oeN+aX5JB/C/xPNtmgIJqcXHG7fA82Ou1zCpWGl4lROQUKwUNE1pMCyg==}
engines: {node: '>=8.0.0'}
- '@opentelemetry/[email protected]':
- resolution: {integrity: sha512-40lSJeqYO8Uz2Yj7u94/SJWE/wONa7rmMKjI1ZcIjgf3MHNHv1OZUCrCETGuaRF62d5pQD1wKIW+L4lmSMTzZA==}
+ '@opentelemetry/[email protected]':
+ resolution: {integrity: sha512-CmVa4ImJ+ynfrPMNaAXHET6Bhb44SwzmfyVJFq9ni2jgXJR/l7C6gfVFddNmHP+ZOkP9cf4f9DBe68qVLTHc9w==}
engines: {node: '>=8.0.0'}
'@opentelemetry/[email protected]':
@@ -4451,6 +4877,12 @@ packages:
resolution: {integrity: sha512-gLyJlPHPZYdAk1JENA9LeHejZe1Ti77/pTeFm/nMXmQH/HFZlcS/O2XJB+L8fkbrNSqhdtlvjBVjxwUYanNH5Q==}
engines: {node: '>=8.0.0'}
+ '@opentelemetry/[email protected]':
+ resolution: {integrity: sha512-/wNZ8twnEQQA4HoHu22+vcsdru6pWPWxW+7w+FlxT6Id7PE/WIbZmVKkte+PF72e0F2dnImFeHD2syyE1Mw6MQ==}
+ engines: {node: ^18.19.0 || >=20.6.0}
+ peerDependencies:
+ '@opentelemetry/api': '>=1.0.0 <1.10.0'
+
'@opentelemetry/[email protected]':
resolution: {integrity: sha512-FuabnnUm8LflnieVxs6eP7Z383hgQU4W1e3KJS6aOG3RxWxcHyBxH8fDMHNgu/gFx/M2jvTOW/4/PHhLz6bjWw==}
engines: {node: ^18.19.0 || >=20.6.0}
@@ -4481,8 +4913,8 @@ packages:
peerDependencies:
'@opentelemetry/api': ^1.3.0
- '@opentelemetry/[email protected]':
- resolution: {integrity: sha512-MHqEX5Dk59cqVah5LiARMACku7jXSVk9iVDWOea4x3cr7VfdByeDCURK6o1lntT1JS/Tsovw01UJrBhN3/uC5w==}
+ '@opentelemetry/[email protected]':
+ resolution: {integrity: sha512-xQx3E2WxP1mDvKzxLxX+CTCtNLa560YJZ3087qYHerl2YmiKpv7AH+dAy7vmx+eVrZ5BwhfWUAVoKOoxCNHcpw==}
engines: {node: ^18.19.0 || >=20.6.0}
peerDependencies:
'@opentelemetry/api': ^1.3.0
@@ -4499,6 +4931,12 @@ packages:
peerDependencies:
'@opentelemetry/api': ^1.3.0
+ '@opentelemetry/[email protected]':
+ resolution: {integrity: sha512-q6MMm2zhggzsHVNbabYwut+a6nbuQQe3URUoxaojM/8K1IBfwwPzvxIjNi2/lI1TFe+fMHMW9MWhrtDLEXEnkA==}
+ engines: {node: ^18.19.0 || >=20.6.0}
+ peerDependencies:
+ '@opentelemetry/api': '>=1.3.0 <1.10.0'
+
'@opentelemetry/[email protected]':
resolution: {integrity: sha512-1pNQf/JazQTMA0BiO5NINUzH0cbLbbl7mntLa4aJNmCCXSj0q03T5ZXXL0zw4G55TjdL9Tz32cznGClf+8zr5A==}
engines: {node: ^18.19.0 || >=20.6.0}
@@ -4529,6 +4967,12 @@ packages:
peerDependencies:
'@opentelemetry/api': '>=1.9.0 <1.10.0'
+ '@opentelemetry/[email protected]':
+ resolution: {integrity: sha512-GuYQQT7QD2EeO8lcZLRQzcbOyhqAzL+6WWTKTU9mSUBYBazkEDl+VrQcXQhbB08OWM9anD1aHleVadzulpOaUQ==}
+ engines: {node: ^18.19.0 || >=20.6.0}
+ peerDependencies:
+ '@opentelemetry/api': '>=1.3.0 <1.10.0'
+
'@opentelemetry/[email protected]':
resolution: {integrity: sha512-xWQgL0Bmctsalg6PaXExmzdedSp3gyKV8mQBwK/j9VGdCDu2fmXIb2gAehBKbkXCpJ4HPkgv3QfoJWRT4dHWbw==}
engines: {node: ^18.19.0 || >=20.6.0}
@@ -4541,6 +4985,12 @@ packages:
peerDependencies:
'@opentelemetry/api': '>=1.3.0 <1.10.0'
+ '@opentelemetry/[email protected]':
+ resolution: {integrity: sha512-MfQGq3GRmTh5fM/y+OjaO0vj6+luCB1XO2gfXCalKCfgKw0eHL++sm75DNweC6ohlp+aFvACqeE0fYayqdRaoQ==}
+ engines: {node: ^18.19.0 || >=20.6.0}
+ peerDependencies:
+ '@opentelemetry/api': '>=1.3.0 <1.10.0'
+
'@opentelemetry/[email protected]':
resolution: {integrity: sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==}
engines: {node: '>=14'}
@@ -6591,8 +7041,8 @@ packages:
'@types/react':
optional: true
- '@react-navigation/[email protected]':
- resolution: {integrity: sha512-tMpzskBzVp0E7CRNdNtJIdXjk54Kwe/TF9ViXAef+YFM1kSfGv4e/B2ozfXE+YyYgmh4WavTv8fkdJz1CNyu+g==}
+ '@react-navigation/[email protected]':
+ resolution: {integrity: sha512-bCW1PsLA/eOXDOukcJFEzlcL3Zpy8DJuDCfkDDwAQlAgoSZ/J9+ZeDRUMmCUi6xbnFgvFEEIMertaLeErOFP0Q==}
peerDependencies:
react: 19.2.6
@@ -6602,8 +7052,8 @@ packages:
react: 19.2.6
react-native: '*'
- '@react-navigation/[email protected]':
- resolution: {integrity: sha512-1tJHg4KKRJuQ1/EvJxatrMef3NZXEPzwUIUZ3n1yJ2t7Q97siwRtbynRpQG9/69ebbtiZ8W3ScOZF/OmhvM4Rg==}
+ '@react-navigation/[email protected]':
+ resolution: {integrity: sha512-GI7eJm8/KsZUQaYcXvEExikKurRZRgEsSzyZ7faENfi65yqJBCXjDMwyN1pF6pNW1MoLH1ErDwDivFxY6BzD3w==}
'@remirror/[email protected]':
resolution: {integrity: sha512-42aWfPrimMfDKDi4YegyS7x+/0tlzaqwPQCULLanv3DMIlu96KTJR0fM5isWX2UViOqlGnX6YFgqWepcX+XMNg==}
@@ -6712,152 +7162,290 @@ packages:
cpu: [arm]
os: [android]
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-6o7ZLZK+BeenkZCFNDXqpbjw9bD6nuWonvS/lwQJp7NoVVxm6p3qE7qQ5jGuBjiFsgvqjD8mZAU5oWxTmbOeOg==}
+ cpu: [arm]
+ os: [android]
+
'@rollup/[email protected]':
resolution: {integrity: sha512-hZ+Zxj3SySm4A/DylsDKZAeVg0mvi++0PYVceVyX7hemkw7OreKdCvW2oQ3T1FMZvCaQXqOTHb8qmBShoqk69Q==}
cpu: [arm64]
os: [android]
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-BaH7BllCACHoH1LguOU56UItGfUWjujlO65kS9LAodViaN4bwIKd7oeW/ZHJ/4ljr/7MIiENnNy3HJ0zXv8Zkw==}
+ cpu: [arm64]
+ os: [android]
+
'@rollup/[email protected]':
resolution: {integrity: sha512-W2Psnbh1J8ZJw0xKAd8zdNgF9HRLkdWwwdWqubSVk0pUuQkoHnv7rx4GiF9rT4t5DIZGAsConRE3AxCdJ4m8rg==}
cpu: [arm64]
os: [darwin]
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-v39RCCvj4He82I9sFmk+M1VZ0PLM9sfsLVikjfx2hYBNALhrrOR2D3JjQA6AhlaSOgcR+RzrKY7e1+bT6SUO/A==}
+ cpu: [arm64]
+ os: [darwin]
+
'@rollup/[email protected]':
resolution: {integrity: sha512-ZW2KkwlS4lwTv7ZVsYDiARfFCnSGhzYPdiOU4IM2fDbL+QGlyAbjgSFuqNRbSthybLbIJ915UtZBtmuLrQAT/w==}
cpu: [x64]
os: [darwin]
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-yl0y2vq3S3lHeuXhEdss6TWfKW8vkujImO12tn4ZkG/4oghr09LvdYm2RElVjokTQiUvDUGXLGsYeLqUMCKpGA==}
+ cpu: [x64]
+ os: [darwin]
+
'@rollup/[email protected]':
resolution: {integrity: sha512-EsKaJ5ytAu9jI3lonzn3BgG8iRBjV4LxZexygcQbpiU0wU0ATxhNVEpXKfUa0pS05gTcSDMKpn3Sx+QB9RlTTA==}
cpu: [arm64]
os: [freebsd]
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-tT4pvt4qXD+vEoezupCWi+a1F0vvDiksiHc+PxRlYTOH1I6/X4id9jPxTP+Fg+545euaFT1jJVs4CEdHZAU1vw==}
+ cpu: [arm64]
+ os: [freebsd]
+
'@rollup/[email protected]':
resolution: {integrity: sha512-d3DuZi2KzTMjImrxoHIAODUZYoUUMsuUiY4SRRcJy6NJoZ6iIqWnJu9IScV9jXysyGMVuW+KNzZvBLOcpdl3Vg==}
cpu: [x64]
os: [freebsd]
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-6nU5F2wCW+qvCBhTn1pdIU3bzsIoF7EUwsCDRxilWGprQR6yd508YnH9+OKFCwpfS8pjZqDUmnCAr7exax0XCg==}
+ cpu: [x64]
+ os: [freebsd]
+
'@rollup/[email protected]':
resolution: {integrity: sha512-t4ONHboXi/3E0rT6OZl1pKbl2Vgxf9vJfWgmUoCEVQVxhW6Cw/c8I6hbbu7DAvgp82RKiH7TpLwxnJeKv2pbsw==}
cpu: [arm]
os: [linux]
libc: [glibc]
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-n1GJHPOvpIfhi3TmrCeh6S6URt9BFCt0KQE3qvexyGCTAKpR4Lg+eWvNZEqu7epxwus/8ElT3hacYEucm49SZg==}
+ cpu: [arm]
+ os: [linux]
+ libc: [glibc]
+
'@rollup/[email protected]':
resolution: {integrity: sha512-CikFT7aYPA2ufMD086cVORBYGHffBo4K8MQ4uPS/ZnY54GKj36i196u8U+aDVT2LX4eSMbyHtyOh7D7Zvk2VvA==}
cpu: [arm]
os: [linux]
libc: [musl]
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-JqgflS8wEB+UXV/vS1RpRbifGBeN4D5lz8D8oOFbFZw4vedvdOgCFAjfBmIMdW3yL10XpQQ0Ambepw6MXrhOnA==}
+ cpu: [arm]
+ os: [linux]
+ libc: [musl]
+
'@rollup/[email protected]':
resolution: {integrity: sha512-jYgUGk5aLd1nUb1CtQ8E+t5JhLc9x5WdBKew9ZgAXg7DBk0ZHErLHdXM24rfX+bKrFe+Xp5YuJo54I5HFjGDAA==}
cpu: [arm64]
os: [linux]
libc: [glibc]
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-wnFJkogWvN4jm/hQRF2UBaeUmk20j5+DmHvoyWii2b8HJDyvz1MF2OU/6ynXt2KR63rbZLWkFpoytpdc/yBuSA==}
+ cpu: [arm64]
+ os: [linux]
+ libc: [glibc]
+
'@rollup/[email protected]':
resolution: {integrity: sha512-peZRVEdnFWZ5Bh2KeumKG9ty7aCXzzEsHShOZEFiCQlDEepP1dpUl/SrUNXNg13UmZl+gzVDPsiCwnV1uI0RUA==}
cpu: [arm64]
os: [linux]
libc: [musl]
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-HVu2bp0zhvJ8xHEV9+UUs7S90VadmBSY3LcIMvozbPo4AuMGDWlz3ymHLHZPX4hR67TKTt8Qp5PJ5RBg/i+RMQ==}
+ cpu: [arm64]
+ os: [linux]
+ libc: [musl]
+
'@rollup/[email protected]':
resolution: {integrity: sha512-gbUSW/97f7+r4gHy3Jlup8zDG190AuodsWnNiXErp9mT90iCy9NKKU0Xwx5k8VlRAIV2uU9CsMnEFg/xXaOfXg==}
cpu: [loong64]
os: [linux]
libc: [glibc]
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-mQqqAV8QaoSgr9I2fKDLY2BAVvmKjWoGiu/cSYQonsLvtqwEn1E4QYfnCOcp5zoEqNhsDYin1s6jx/VJmrxlZg==}
+ cpu: [loong64]
+ os: [linux]
+ libc: [glibc]
+
'@rollup/[email protected]':
resolution: {integrity: sha512-yTRONe79E+o0FWFijasoTjtzG9EBedFXJMl888NBEDCDV9I2wGbFFfJQQe63OijbFCUZqxpHz1GzpbtSFikJ4Q==}
cpu: [loong64]
os: [linux]
libc: [musl]
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-IxKLoxCQ2IWi6bT2akyDUBGsOImDKB+sPp4EsTmwFQ/fMwpCKm8uLSSgP/Kx/QYUgKis6SEZ5/Nlhup0DIA0PQ==}
+ cpu: [loong64]
+ os: [linux]
+ libc: [musl]
+
'@rollup/[email protected]':
resolution: {integrity: sha512-sw1o3tfyk12k3OEpRddF68a1unZ5VCN7zoTNtSn2KndUE+ea3m3ROOKRCZxEpmT9nsGnogpFP9x6mnLTCaoLkA==}
cpu: [ppc64]
os: [linux]
libc: [glibc]
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-Mk5ha2RQSgyFfmYYLkBpPnUk8D8FriBxesO1u9O75X0mHgXL1UQcH5Itl2lurWL2tj0RxV9b9tJgipac0hRY9A==}
+ cpu: [ppc64]
+ os: [linux]
+ libc: [glibc]
+
'@rollup/[email protected]':
resolution: {integrity: sha512-+2kLtQ4xT3AiIxkzFVFXfsmlZiG5FXYW7ZyIIvGA7Bdeuh9Z0aN4hVyXS/G1E9bTP/vqszNIN/pUKCk/BTHsKA==}
cpu: [ppc64]
os: [linux]
libc: [musl]
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-CjvEnqJL/0/TQ3TXX3OPIJ/kmBellrWd4heXUmHeJlTnmwjKpSJzoehLaL6Xk0ZnMHBu9dZuFADNOrtjF4v+2w==}
+ cpu: [ppc64]
+ os: [linux]
+ libc: [musl]
+
'@rollup/[email protected]':
resolution: {integrity: sha512-NDYMpsXYJJaj+I7UdwIuHHNxXZ/b/N2hR15NyH3m2qAtb/hHPA4g4SuuvrdxetTdndfj9b1WOmy73kcPRoERUg==}
cpu: [riscv64]
os: [linux]
libc: [glibc]
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-1SiZbzwdkaDURsew/tSOrooKiYy7EQGT6m8ufavAi9NEyQb/6VuIxFXAL1fqa4iZe3g4NbNk4P7J32z2tw5Mgg==}
+ cpu: [riscv64]
+ os: [linux]
+ libc: [glibc]
+
'@rollup/[email protected]':
resolution: {integrity: sha512-nLckB8WOqHIf1bhymk+oHxvM9D3tyPndZH8i8+35p/1YiVoVswPid2yLzgX7ZJP0KQvnkhM4H6QZ5m0LzbyIAg==}
cpu: [riscv64]
os: [linux]
libc: [musl]
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-nQts12zJ3NQRoE6uYljOH89v7szzLDvG2JD/vsX+vGXU8w/At1GowTZ5/7qeFQ8m7L55rpR8Okugnuo5bgjy2Q==}
+ cpu: [riscv64]
+ os: [linux]
+ libc: [musl]
+
'@rollup/[email protected]':
resolution: {integrity: sha512-oF87Ie3uAIvORFBpwnCvUzdeYUqi2wY6jRFWJAy1qus/udHFYIkplYRW+wo+GRUP4sKzYdmE1Y3+rY5Gc4ZO+w==}
cpu: [s390x]
os: [linux]
libc: [glibc]
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-E9/ll019jhPIJgpzfZoIkBGhcz+kKNgVWYRY0zr9srBdPPFVpvOKW8VaJKUbeK+eZXyQF9ltME+Kk6affeaPgg==}
+ cpu: [s390x]
+ os: [linux]
+ libc: [glibc]
+
'@rollup/[email protected]':
resolution: {integrity: sha512-3AHmtQq/ppNuUspKAlvA8HtLybkDflkMuLK4DPo77DfthRb71V84/c4MlWJXixZz4uruIH4uaa07IqoAkG64fg==}
cpu: [x64]
os: [linux]
libc: [glibc]
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-5BqxR/pshjey51iliyzTD5Xi3EN0aLmQ2lZ3lvefVV9c82BvrLo2/6OT55iifpWBufs6kdwWbuOKS841DrmK9A==}
+ cpu: [x64]
+ os: [linux]
+ libc: [glibc]
+
'@rollup/[email protected]':
resolution: {integrity: sha512-2UdiwS/9cTAx7qIUZB/fWtToJwvt0Vbo0zmnYt7ED35KPg13Q0ym1g442THLC7VyI6JfYTP4PiSOWyoMdV2/xg==}
cpu: [x64]
os: [linux]
libc: [musl]
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-uNN83XxQrRAh/w0/pmAfibcwyb6YWt4gP+dpnQKPVJshAloQ785ii8CT8ZCIxkGg9opVsvAlGhFitSm6D1Jjpg==}
+ cpu: [x64]
+ os: [linux]
+ libc: [musl]
+
'@rollup/[email protected]':
resolution: {integrity: sha512-M3bLRAVk6GOwFlPTIxVBSYKUaqfLrn8l0psKinkCFxl4lQvOSz8ZrKDz2gxcBwHFpci0B6rttydI4IpS4IS/jQ==}
cpu: [x64]
os: [openbsd]
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-srjEIxSH3LRnJN6THczDHWQplqEMFiAJrTab0msUryh9kwNpkICf3Ea6q6MN/2cZwRFUNx5w+h6Hpi4QuHS6Zg==}
+ cpu: [x64]
+ os: [openbsd]
+
'@rollup/[email protected]':
resolution: {integrity: sha512-tt9KBJqaqp5i5HUZzoafHZX8b5Q2Fe7UjYERADll83O4fGqJ49O1FsL6LpdzVFQcpwvnyd0i+K/VSwu/o/nWlA==}
cpu: [arm64]
os: [openharmony]
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-8hOJnxgbyObnCm5AlRA3A931xX19xq80RjVTKgJOvEKWqJruP/Uf12IbAOaDjjEXYRewwHLfmF0YRIdK3OwKWA==}
+ cpu: [arm64]
+ os: [openharmony]
+
'@rollup/[email protected]':
resolution: {integrity: sha512-V5B6mG7OrGTwnxaNUzZTDTjDS7F75PO1ae6MJYdiMu60sq0CqN5CVeVsbhPxalupvTX8gXVSU9gq+Rx1/hvu6A==}
cpu: [arm64]
os: [win32]
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-mmF4AY1i0hG/bLWUctUq59gtmgaSIRa3cu/A3JFRp/sCNEme2bgDEiDS22P9FbnJB8NJNF4jPJiSP5RHQpUTDg==}
+ cpu: [arm64]
+ os: [win32]
+
'@rollup/[email protected]':
resolution: {integrity: sha512-UKFMHPuM9R0iBegwzKF4y0C4J9u8C6MEJgFuXTBerMk7EJ92GFVFYBfOZaSGLu6COf7FxpQNqhNS4c4icUPqxA==}
cpu: [ia32]
os: [win32]
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-DZgkknc6jhHrk46V25vbAM0zZkyP0nSDkJB8/dRkLTxv470dOmWDqGoEJl/9A0dFfS7yE3REOwNDxpHwSLSt0Q==}
+ cpu: [ia32]
+ os: [win32]
+
'@rollup/[email protected]':
resolution: {integrity: sha512-laBkYlSS1n2L8fSo1thDNGrCTQMmxjYY5G0WFWjFFYZkKPjsMBsgJfGf4TLxXrF6RyhI60L8TMOjBMvXiTcxeA==}
cpu: [x64]
os: [win32]
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-T6xr6ucWSFto+VGajA8YH26LdpHRuP4YLHEKAtCWvJDOlnmWcDZVCI2Jmjr+IFHDlt2zRaTAKE4tfjTaWLgJBg==}
+ cpu: [x64]
+ os: [win32]
+
'@rollup/[email protected]':
resolution: {integrity: sha512-2HRCml6OztYXyJXAvdDXPKcawukWY2GpR5/nxKp4iBgiO3wcoEGkAaqctIbZcNB6KlUQBIqt8VYkNSj2397EfA==}
cpu: [x64]
os: [win32]
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-BfzEnDJOt9T8M989/lA37EcJgat01wLRnoi5dQf3QzOH7jzpqTAzdDbVfRljVr5r+jzKqpbHeyOfAaXxAd0PAA==}
+ cpu: [x64]
+ os: [win32]
+
'@sec-ant/[email protected]':
resolution: {integrity: sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==}
- '@sentry/[email protected]':
- resolution: {integrity: sha512-z1JQrl/1SLY+8wpzvork6vl+fpsg/oCCxM7HWWhUnI/R+OGNyoIzieQuggX3uUMY7NBtp8UWCQx6FeFazzOF9g==}
+ '@sentry/[email protected]':
+ resolution: {integrity: sha512-fO9PLmHdVURcSPUpWCItWAtgKiMwGdJHbovoSEyLplX5sxs2ugvI4CBPTrkkgqhObnZOD0CnWBKDzSVQYBKEyQ==}
engines: {node: '>=14'}
- '@sentry/[email protected]':
- resolution: {integrity: sha512-Edg8t2w45qEKiFnjeA6zRmU47R6la5FEMG+maZEOB2oTyJ+ujmh8LGaZ3G8aC0VdkKn8CXhHtDesze6oDc1oTA==}
+ '@sentry/[email protected]':
+ resolution: {integrity: sha512-5Amhx8ltVz7vb1bRGyf3c4J69/iHW8R/H+SJxTRILHlsSOBrnVVc/IQEYDC6PTRdRdZ3x2u7RVjxZi2Mhe525g==}
engines: {node: '>=18'}
- '@sentry/[email protected]':
- resolution: {integrity: sha512-aVSnYqaq5FXv9hX6lVGbg4gB+mVrb6QDoNE/IBq8OBR90TR9I/KU6KlWAcfB9H7I6CHnedldOpljkMAJ5eZ3qA==}
+ '@sentry/[email protected]':
+ resolution: {integrity: sha512-VreORXnruy8A2SyprZKENAq3ArGwn35KPewLQSQ5dgDXSFtUj2scLuzZoVsZ/Uyt83td0WPvD6Lv0X7MvSYAMQ==}
engines: {node: '>=18'}
peerDependencies:
'@opentelemetry/api': ^1.9.0
@@ -6877,20 +7465,20 @@ packages:
'@opentelemetry/sdk-trace-base':
optional: true
- '@sentry/[email protected]':
- resolution: {integrity: sha512-nct3VqOIuPBnsvqHHWkPG6Ta7QwJftxWXQzHt0+soNcWBoh5WU8hEzIPVEXzxTThJ9AOkF/df3ApWUX4i6ylqQ==}
+ '@sentry/[email protected]':
+ resolution: {integrity: sha512-bnvRzEehquG/894DD3BWNCBUbDWsLQfYPU+SNCMd6G4Ext75RthVkRs8R0sRaE6b8Tw9HSEgySHL834Tf8lVsA==}
engines: {node: '>=18'}
- '@sentry/[email protected]':
- resolution: {integrity: sha512-wg8bY1sWPyFOVh59ThiFDeuyheD7DdQliqWmrCCa5q+PSRLij+zpmsGqjlzGU74lzj1Kvpkicw5LsO6U49b2xA==}
+ '@sentry/[email protected]':
+ resolution: {integrity: sha512-JDNH9dacX0MSi7FRvabPCJUAXRMTe16bE/Gajc/7Gfcw7Rwvo4DZ0nd162PCSAW9QoEjUT12upDehEHJuFmsXg==}
engines: {node: '>=18'}
peerDependencies:
'@opentelemetry/api': ^1.9.0
'@opentelemetry/core': ^1.30.1 || ^2.1.0
'@opentelemetry/sdk-trace-base': ^1.30.1 || ^2.1.0
- '@sentry/[email protected]':
- resolution: {integrity: sha512-IrOyMzlOyBkWtnVYb54sALf2f8WVqyyp7woRfHw8c3IMwUr5AskGOi7k2rjmUXO3Q0UkfHNVarexiEfo8ZqTsg==}
+ '@sentry/[email protected]':
+ resolution: {integrity: sha512-lp1ZSs1auw7HrCESSYt/n4dOUaKPVUIAKyVYRk6xVr4bMIN3RPub/H5Wm7QPj9CpXVC5bQFvB6+dHZXz809oMg==}
engines: {node: '>=18'}
'@shikijs/[email protected]':
@@ -7940,6 +8528,9 @@ packages:
resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==}
+
resolution: {integrity: sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==}
@@ -8006,6 +8597,9 @@ packages:
resolution: {integrity: sha512-GYDxsZi3ChgmckRT9HPU0WEhKLP08ev/Yfcq2AstjrDASOYCSXeyjDsHg4v5t4jOj7cyDX3vmprafKlWIG9MXQ==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-Dh8vAsV36ig5wa9OX4pXvMc9D3Veibfw2wix0CUwYODLD8nkj9UsLjASr49nPg+2eKzxhBV+v7L8pXvT4e639Q==}
+
resolution: {integrity: sha512-DZ8VwRFUNzuqJ5khrvwMXHmvPe+zGayJhr2CDNiKB1WBE1ST8Djl00D0IC4vvNmHMdj6DlbYRIaFE7WHjlDl5w==}
@@ -8075,8 +8669,8 @@ packages:
resolution: {integrity: sha512-qUHkeCyQFxMXg79wQfTtfndEC+N9ZZg76HJftDJp+qH2tV7Gj4OJi7l+PiWwJ+pWtW8GwSmqsDj/oymhrTWXjg==}
- '@typescript-eslint/[email protected]':
- resolution: {integrity: sha512-KvAclkktORPvM54TgLgA4z9HIV1M8zOgw9ZVNXl9f/8dLYfXYX1wkMXP7qmabpijQRV5bHJLOmoyGQbLMaUYeg==}
+ '@typescript-eslint/[email protected]':
+ resolution: {integrity: sha512-JSSwWNy+H0E/01jJEM+hrX6N0OFDzFzeIhHFSAS01tlVaevpG8cFyYRPhS5yjGOvBUx3sqQHVMjCL1CAZZMxBg==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@typescript/[email protected]':
@@ -8452,11 +9046,6 @@ packages:
resolution: {integrity: sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==}
engines: {node: '>= 0.6'}
- resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==}
- peerDependencies:
- acorn: ^8
-
resolution: {integrity: sha512-wKmbr/DDiIXzEOiWrTTUcDm24kQ2vGfZQvM2fwg2vXqR5uW6aapr7ObPtj1th32b9u90/Pf4AItvdTh42fBmVQ==}
engines: {node: '>=10.13.0'}
@@ -8721,6 +9310,11 @@ packages:
peerDependencies:
'@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0
+ resolution: {integrity: sha512-aTyf30K/rqAsNwN76zYrdtx8obu0E4KoUME29B1xj+B3WxgvWkp943vYQ+z8Mv3lw9xHXMHpvSPOBxzAkIa94w==}
+ peerDependencies:
+ '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0
+
resolution: {integrity: sha512-U+GNwMdSFgzVmfhNm8GJUX88AadB3uo9KpJqS3FaqNIPKgySuvMb+bHPsOmmuWyIcuqZj/pzt1RUIUZns4y2+A==}
peerDependencies:
@@ -8731,6 +9325,11 @@ packages:
peerDependencies:
'@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0
+ resolution: {integrity: sha512-M762rNHfSF1EV3SLtnCJXFoQbbIIz0OyRwnCmV0KPC7qosSfCO0QLTSuJX3ayAebubhE6oYBAYPrBA5ljowaZg==}
+ peerDependencies:
+ '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0
+
resolution: {integrity: sha512-Ixm8tFfoKKIPYdCCKYTsqv+Fd4IJ0DQqMyEimo+pxUOMUR9cVPlwTrFt9Avu+3cb6Zp3mAzl+t1MrG2fxxKsxw==}
@@ -8791,6 +9390,11 @@ packages:
resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==}
+ resolution: {integrity: sha512-HYXq73DDpCtNzOmrFsm9eSwCvWCql0RzqjpDzXN9EadiLJ4DNat0nsZ/Bzmy+Ud12mb4/zKDY0cQ805ZzN+i0A==}
+ engines: {node: '>=6.0.0'}
+ hasBin: true
+
resolution: {integrity: sha512-ipDqC8FrAl/76p2SSWKSI+H9tFwm7vYqXQrItCuiVPt26Km0jS+NzSsBWAaBusvSbQcfJG+JitdMm+wZAgTYqg==}
hasBin: true
@@ -8884,6 +9488,11 @@ packages:
engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
hasBin: true
+ resolution: {integrity: sha512-JxV13hNrFxqjOc8alRbq9dK1MM79NEXYpma2B2J4wAtpWS5zIEIKqWPGCl7N4o7Uc7B7itylh7SuDujATRyyTw==}
+ engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
+ hasBin: true
+
resolution: {integrity: sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==}
@@ -8975,6 +9584,9 @@ packages:
resolution: {integrity: sha512-34+zUAMhSH+r+9eKmYG+k2Rpt8XttfE4yXAjoZvkAPs15xcYQhyBYdalJ65BzivAvGRMViEjy6oKr/S91loekQ==}
+ resolution: {integrity: sha512-72Cuvd95zbSYPKq6Fhg8eDJRlzgWDf7/mtoZv6Qe/DYNCEBdNxoA3+rZAU2ZhGCpZlns3EssFavaZomckT5Uuw==}
+
resolution: {integrity: sha512-yxQbJkAVrFXWNbTUjPqjF7G+g6pDotOUHGbkZq2NELZUMDpiJ85rIEazVb8GTaAptNW2miJAXbs1BtioA251Pw==}
@@ -9819,6 +10431,9 @@ packages:
resolution: {integrity: sha512-9tfDXhJ4RKFNerfjdCcZfufu49vg620741MNs26a9+bhLThdB+plgMeou98CAaHu/WATj2iHOOHTp1hWtABj2A==}
+ resolution: {integrity: sha512-yHiw2Y3C3H9U6TMbOfoWK/BPreiOPXRfTWPBwQBoZG6/8TB6eOPnsy5oaRYuatR7Fw2SJ4kKforgufeo7fq0EQ==}
+
resolution: {integrity: sha512-ZhVxM9iGONUpZGI1FxdMRgJjUFXi7AYGVa5PwKlO1tV1/4zDxQmfKpXOHVztKrd6L9rLcFjERvi1Mf2vxyTkig==}
@@ -9881,6 +10496,10 @@ packages:
resolution: {integrity: sha512-aNnGCvbJ/RIyWo1IuhNdVjnNF+EjH9wpzpNHt+ci/m9He9LJvUN8wrCcXjp9cWsGNAuvSpVFTx/vraAFQ8qGjQ==}
engines: {node: '>=10.13.0'}
+ resolution: {integrity: sha512-PwKooW9JUzh5chmYfHM3IQl5OkK2u2Nm011MgeZrss3JmFraUx/fqrf78kk8GUMYoibx/14MdwTl/1WKkG7TpQ==}
+ engines: {node: '>=10.13.0'}
+
resolution: {integrity: sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==}
@@ -9927,8 +10546,8 @@ packages:
resolution: {integrity: sha512-5POEcUuZybH7IdmGsD8wlf0AI55wMecM9rVBTI/qEAy2c1kTOm3DjFYjrBdI2K3BaJjJYfYFeRtM0t9ssnRuxw==}
- resolution: {integrity: sha512-n27zTYMjYu1aj4MjCWzSP7G9r75utsaoc8m61weK+W8JMBGGQybd43GstCXZ3WNmSFtGT9wi59qQTW6mhTR5LQ==}
+ resolution: {integrity: sha512-shc1dbU90Yl/xq1QrC7QRtfcwURZuVRfPhZbDoldJ1cn1gzDvBaBWlv0eFolj5+0znnPJz5TXLxsN77X/12KTA==}
resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==}
@@ -9938,8 +10557,8 @@ packages:
resolution: {integrity: sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==}
engines: {node: '>= 0.4'}
- resolution: {integrity: sha512-G5iZ6Pc/FNRY/soKZHC+TxGDD83rHUDXxzaWhGCX44vAv/tMs56WMusnm/KMNK+luUPsgA9U28cGr4RDlSzL2g==}
+ resolution: {integrity: sha512-OyZKhUVvEep9ITEiwHn8GKnMRQIVqoSIX7WnRbkWgJkllCujilqP2rD0u979tkl8wqyc8ICwlc1UBVv/Sl1G6w==}
resolution: {integrity: sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==}
@@ -9964,6 +10583,11 @@ packages:
engines: {node: '>=18'}
hasBin: true
+ resolution: {integrity: sha512-IxpibTjyVnmrIQo5aqNpCgoACA/dTKLTlhMHihVHhdkxKyPO1uBBthumT0rdHmcsk9uMonIWS0m4FljWzILh3w==}
+ engines: {node: '>=18'}
+ hasBin: true
+
resolution: {integrity: sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==}
engines: {node: '>=18'}
@@ -10580,6 +11204,9 @@ packages:
resolution: {integrity: sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==}
+ resolution: {integrity: sha512-/zipXxyO6rGvuNGDiULY9MvEGSkb2gaG4GGH4ygMi0ZZzyMHdUZBmntJmx5x1G2VuPytCwGN4xsJP6cw+sK+vQ==}
+
resolution: {integrity: sha512-3PYnM29RFXwvAN6Pc/scUfkI7RwhQ/xqyLUyPNlXUp9S40zI8nup9tUSrTLSVnWGBN38FNiGWbwZOB6uR4OGdw==}
@@ -10669,6 +11296,10 @@ packages:
resolution: {integrity: sha512-VWSRii4t0AFm6ixFFmLLx1t7wS1gh+ckoa84aOeapGum0h+EZd1EhEumSB+ZdDLnEPuucsVB9oB7cxJHap6Afg==}
engines: {node: '>=14.14'}
+ resolution: {integrity: sha512-EQsFzMUJkCKGr1ePqlYADkIUmHW1s3ZXr5Yqy6wbGrfUCphpl2maM/kyOIRA2HpP3AaFQTZXD4ldjek+nccddA==}
+ engines: {node: '>=14.14'}
+
resolution: {integrity: sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==}
engines: {node: '>=6 <7 || >=8'}
@@ -10899,6 +11530,10 @@ packages:
resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==}
engines: {node: '>= 0.4'}
+ resolution: {integrity: sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==}
+ engines: {node: '>= 0.4'}
+
resolution: {integrity: sha512-3kxEVkEKt0zvcZ3hCRYI8rqrgwtlIOFMWkbclACvjlDw8Li9S2hk/d51OI0nr/gIpdMHNepwgOKqZ/sy0Clpyg==}
@@ -11100,8 +11735,8 @@ packages:
resolution: {integrity: sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==}
engines: {node: '>=6'}
- resolution: {integrity: sha512-vR2B6HKIhaBjcZr2bLpFiJ1VbzOlRQ7aby4/gw5WPIzToLjqpfWw3VJ4sk1uDchoOODEirvO2jyrSPtUSL5CrQ==}
+ resolution: {integrity: sha512-jTd2FfOgOWOdgjkHuk/1Ms8VKFXkPs15ymYBETw1sAOrO/dY3XeGVRWir9qBbw7pXr0T2eTFwfCZ+N02HmiNGA==}
engines: {node: '>=18'}
@@ -11195,6 +11830,10 @@ packages:
resolution: {integrity: sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==}
engines: {node: '>= 0.4'}
+ resolution: {integrity: sha512-evOr8xfXKxE6qSR0hSXL2r3sd7ALj8+7jQEUvPYcm5sgZFdJ+AYzT6yNmJenvIYQBgIGwfwz08sL8zoL7yq2BA==}
+ engines: {node: '>= 0.4'}
+
resolution: {integrity: sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A==}
@@ -11683,6 +12322,9 @@ packages:
resolution: {integrity: sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==}
+ resolution: {integrity: sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q==}
+
resolution: {integrity: sha512-MT/xP0CrubFRNLNKvxJ2BYfy53Zkm++5bX9dtuPbqAeQpTVe0MQTFhao8+Cp//EmJp244xt6Drw/GVEGCUj40g==}
engines: {node: '>=12', npm: '>=6'}
@@ -11901,8 +12543,8 @@ packages:
resolution: {integrity: sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
- resolution: {integrity: sha512-IWqP2SCPhyVFTBtRcgMHdzlf9ul25NwaFx4wCEH/KjAXuuHY4yNjvPXsBokp8jCB936PyWRaPKUNh8NvylLp2Q==}
+ resolution: {integrity: sha512-DFEqQ3ihfS9blba08cLfYf1NRAIEm+dDjic073DRDc3/JspI/8wYmtDsHwd3+4hwvdxSK7PGaElfTmm0awWJ4w==}
engines: {node: '>=6.11.5'}
@@ -12465,6 +13107,11 @@ packages:
engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
hasBin: true
+ resolution: {integrity: sha512-bzlKTyNJ7+LdGIIwy8ijFpIqEQIvafahV7eYykJ8Cvh42EdJeODoJ6gUJXpQJvej1BddH8OqTXZNE/KfbWAu8Q==}
+ engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
+ hasBin: true
+
resolution: {integrity: sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA==}
@@ -12557,6 +13204,10 @@ packages:
resolution: {integrity: sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==}
+ resolution: {integrity: sha512-wRNIrw4DmVLKQlbgOMdkMx27Wrpzes2hh5Jtbi2bjPd+4wJstWIqP5A+lscnqbm0xxmT5Bpg8Lec5ItEBwx6BQ==}
+ engines: {node: '>=18'}
+
resolution: {integrity: sha512-Zhq3a+yFKrYwSBluL4H9XP3m3y5uvQkB/09CwDruCiRmR/UJYnn9W4R48ry0uGC70aeTPKLynBtscP9efFFcPw==}
engines: {node: ^20.17.0 || >=22.9.0}
@@ -12813,8 +13464,8 @@ packages:
resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==}
- resolution: {integrity: sha512-61A5ThoTiDG/C8s8UMZwSorAGwMJ0ERVGj2OjoW5pAalsNOg15+iQiPzrLJ4jhZ1HJzmC2PIHT2oEiH3R5fzNA==}
+ resolution: {integrity: sha512-yQA4H19AmPEoMUeavPMDIe1higySl/gH/yaQrkT/s07Qp+7pp2hYz30N3z2l5BkjVkF9Ow6o0wjJamm2y7Sn0A==}
resolution: {integrity: sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==}
@@ -13079,6 +13730,10 @@ packages:
resolution: {integrity: sha512-FfR8sjd4em2T6fb3I2MwAJU7HWVMr9zba+enmQeeWFfCbm+UOC/0X4DS8XtpUTMwWMGbjKYP7xjfNekzyGmB3A==}
engines: {node: ^10 || ^12 || >=14}
+ resolution: {integrity: sha512-g50586zr4bZmwFiTlflMu8E0bDTb5I5gertgwAKmsdUlTQIhZtunzUlD1WSzwcVWPoAVpsrA6vlfCD7oXvRwgg==}
+ engines: {node: ^10 || ^12 || >=14}
+
resolution: {integrity: sha512-L4cJD1sleUULE7K4mZQI5wpS24NHGtNmFw1rPHruc579unVzHuooHiVDEHp/qyNnhNxtNE6alBTiVORbYnRTSw==}
@@ -13430,6 +14085,9 @@ packages:
resolution: {integrity: sha512-XjBR15BhXuylgWGuslhDKqlSayuqvqBX91BP8pauG8kd1zY8kotkNWbXksTCNRarse4kuGbe2kIY05ARtwNIvw==}
+ resolution: {integrity: sha512-s5un28nYxKJw5gvUHyW5PCC28CvBqLu9r3cWgzHT4Vo/5fqqkFcdRYsGcKf50WMPpjjFZS5d76fn3YCo2njKwQ==}
+
resolution: {integrity: sha512-qKxVopLT/TyA6BX3Ue5NwabOsAzm0Q7kAPwq6L+wWDwisYs7R8vZ0nRXqq6rkueboxpkjvLGU9fWifiX/ZZFxQ==}
peerDependencies:
@@ -13788,6 +14446,11 @@ packages:
engines: {node: '>= 0.4'}
hasBin: true
+ resolution: {integrity: sha512-TyeJ1zif53BPfHootBGwPRYT1RUt6oGWsaQr8UyZW/eAm9bKoijtvruSDEmZHm92CwS9nj7/fWttqPCgzep8CA==}
+ engines: {node: '>= 0.4'}
+ hasBin: true
+
resolution: {integrity: sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==}
@@ -13886,6 +14549,11 @@ packages:
engines: {node: '>=18.0.0', npm: '>=8.0.0'}
hasBin: true
+ resolution: {integrity: sha512-RFnrW4lhXA3s3eqHDZvN654g8OTjzRfqpIRJYczCGB6HzphckVAi/Qh4tbPUbRuDi7s1Llv8g/NspLkttY3gTA==}
+ engines: {node: '>=18.0.0', npm: '>=8.0.0'}
+ hasBin: true
+
resolution: {integrity: sha512-UT5EDe2cu2E/6O4igUr5PSFs23nvvukicWHx6GnOPlHAiiYbzNuCRQCuiUdHJQcqKalLKlrYJnjY0ySGsXNQXQ==}
@@ -13984,20 +14652,26 @@ packages:
resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==}
engines: {node: '>=10'}
- resolution: {integrity: sha512-F4LcB0UqUl1zErq+1nYEEzSHJnIwb3AF2XWB94b+afhrekOUijwooAYqFyRbjYkm2PAKBabx6oYv/xDxNi8IBw==}
- engines: {node: '>=20.0.0'}
-
resolution: {integrity: sha512-S0xQPhUTefAhNvNWFg0c1J8qJArHt5KdtJ/cFAofo06KD1MVSeFWyl4iiu+ApDIuw0WhjpOfCdgConOfAnLgkw==}
engines: {node: '>=10'}
peerDependencies:
seroval: ^1.0
+ resolution: {integrity: sha512-HXuLAX2pu/UByPpaeo/TaMfvMIi+1QqIoPJYCcAtU8QkVNwgR6MPlGuCQTErV1JwraaMbYaWVIBX7mppzGLATQ==}
+ engines: {node: '>=10'}
+ peerDependencies:
+ seroval: ^1.0
+
resolution: {integrity: sha512-46uFvgrXTVxZcUorgSSRZ4y+ieqLLQRMlG4bnCZKW3qI6BZm7Rg4ntMW4p1mILEEBZWrFlcpp0AyIIlM6jD9iw==}
engines: {node: '>=10'}
+ resolution: {integrity: sha512-rVQVWjjSvlINzaQPZH5JFqsqEsIWdTxY3iJZCnTL/5gQbXIRooVZKI60tVCkOVfzcRPejboxO2t0P89dg5mQaA==}
+ engines: {node: '>=10'}
+
resolution: {integrity: sha512-x0RTqQel6g5SY7Lg6ZreMmsOzncHFU7nhnRWkKgWuMTu5NN0DR5oruckMqRvacAN9d5w6ARnRBXl9xhDCgfMeA==}
engines: {node: '>= 0.8.0'}
@@ -14275,8 +14949,8 @@ packages:
resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==}
engines: {node: '>=18'}
- resolution: {integrity: sha512-IIaP0g3iy9Cyy18w3M9YcaDudujEAVHKt3a3QJg1+sr/oX96TbaGUubG0hJyCjCBThFH+tFpcIyoUHUn1ogaLA==}
+ resolution: {integrity: sha512-GaPUh5gfdrYzqeVNZvUfT23vYYxXzKYidUcnMtJg/3rxRV63EFZy3k6xfKlmfeJD0176lnUV/Usr3XcwSvFzpg==}
engines: {node: '>=20'}
@@ -14304,6 +14978,10 @@ packages:
resolution: {integrity: sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==}
engines: {node: '>=12'}
+ resolution: {integrity: sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==}
+ engines: {node: '>=12'}
+
resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==}
engines: {node: '>=4'}
@@ -14461,8 +15139,8 @@ packages:
resolution: {integrity: sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==}
engines: {node: '>=6'}
- resolution: {integrity: sha512-XdhtCvlMywwxpCW8YEq3lOXBJpUPTR2OHHcwLPO3HwsJqOHa2Ok/oJ7ruGzp+JrKoRPVCzJwAdEjqLW/vNRPHA==}
+ resolution: {integrity: sha512-MFO/QzvtAOmJbkhOaCTvbGcFN9L9b+JunIsDwaKljSOdcLMea3NJ1k9Usz/rjdfSXTq4dfzfeS7W4p4YOAAHeA==}
engines: {node: '>=18'}
@@ -14480,19 +15158,46 @@ packages:
resolution: {integrity: sha512-avMLDQpUI9I5XFrklECw1ZEUPJhqzcwSWsyyI8blhRLT+8N1jLJWLWWYQpB2q2xthq8xDvjZPISVh53T/+CLYQ==}
engines: {node: '>=18'}
- resolution: {integrity: sha512-h9oBFCWrq78NyWWVcSwZarJkZ01c2AyGrzs1crmHZO3QUg9D61Wu4NPjBy69n7JqylFF5y+CsUZYmYEIZ3mR+Q==}
+ resolution: {integrity: sha512-201R5j+sJpK8nFWwKVyNfZot8FaJbLZDq5evriVzbV1wDtSXDjRUDRfJzHpAaxFDMEhsZL1QkeqM61wgsS3KaQ==}
engines: {node: '>= 10.13.0'}
peerDependencies:
+ '@minify-html/node': '*'
'@swc/core': '*'
+ '@swc/css': '*'
+ '@swc/html': '*'
+ clean-css: '*'
+ cssnano: '*'
+ csso: '*'
esbuild: '*'
+ html-minifier-terser: '*'
+ lightningcss: '*'
+ postcss: '*'
uglify-js: '*'
webpack: ^5.1.0
peerDependenciesMeta:
+ '@minify-html/node':
+ optional: true
'@swc/core':
optional: true
+ '@swc/css':
+ optional: true
+ '@swc/html':
+ optional: true
+ clean-css:
+ optional: true
+ cssnano:
+ optional: true
+ csso:
+ optional: true
esbuild:
optional: true
+ html-minifier-terser:
+ optional: true
+ lightningcss:
+ optional: true
+ postcss:
+ optional: true
uglify-js:
optional: true
@@ -14555,6 +15260,10 @@ packages:
resolution: {integrity: sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==}
engines: {node: '>=12.0.0'}
+ resolution: {integrity: sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==}
+ engines: {node: '>=12.0.0'}
+
resolution: {integrity: sha512-Pugqs6M0m7Lv1I7FtxN4aoyToKg1C4tu+/381vH35y8oENM/Ai7f7C4StcoK4/+BSw9ebcS8jRiVrORFKCALLw==}
engines: {node: ^20.0.0 || >=22.0.0}
@@ -14772,12 +15481,16 @@ packages:
resolution: {integrity: sha512-8ZiHFm91orbSAe2PSAiSVBVko18pbhbiB3U9GglSzF/zCGkR+rxpHx6sEMCUm4kxY4LjDIUGgCfUMtwfZfjfUA==}
engines: {node: '>=20'}
+ resolution: {integrity: sha512-YGYEVz3Fm5iy/AybuA0oyNFq7H4CgQNfRp/qfe8nurE1kuCeNm3/vfm9X4Mtl+qLyaKJUh5xrFZwogr41SMjYA==}
+ engines: {node: '>=20'}
+
resolution: {integrity: sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==}
engines: {node: '>= 0.6'}
- resolution: {integrity: sha512-pZ0aQPmMmXoUvSbeuWf/Hzsc+avNw/Zd6VeE8CFgkVGWyuHPJvqeJJDeJqLve+K70LvjYIoleGcoJHPT17cWoA==}
+ resolution: {integrity: sha512-meKuifc33Pccx0O6PdIzYMq3Og8zvP4TIi/a+Bw3AEMZMxOD0+RHGQvpglEe6Zdy3wZ8nqn/j95h8LUZLk/6Hg==}
resolution: {integrity: sha512-iTDy0V9Wc8kuRBeGxJKNhZk3Gye3kqux4gUrMD0grf9h9TQcJ/EI7EGpyXd7PdbuGrsQcTX2t5q0S+vwlzubsA==}
@@ -14820,6 +15533,9 @@ packages:
resolution: {integrity: sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==}
+ resolution: {integrity: sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==}
+
resolution: {integrity: sha512-cRZYrTDwWznlnRiPjggAGxZXanty6M8RV1ff8Wm4LWXBp7/IG8v5DnOm74DtUBp9OONpK75YlPnIjQqX0dBDtA==}
engines: {node: '>=20.18.1'}
@@ -15203,8 +15919,8 @@ packages:
resolution: {integrity: sha512-VkQZJbO8zVImzYFteBXvBOZEl1qL175WH8VmZcxF2fZAoudNhNDvHi+doCaAEdU2l2vtcIwa2zn0QK5+I1HQ3Q==}
- resolution: {integrity: sha512-Zn5uXdcFNIA1+1Ei5McRd+iRzfhENPCe7LeABkJtNulSxjma+l7ltNx55BWZkRlwRnpOgHqxnjyaDgJnNXnqzg==}
+ resolution: {integrity: sha512-6i/00NBjP4yGPs+caKSyRfpTF/8Torsu0MOW3mMzIbhgISFder8i7xbqgHlLMwJrdiN8ndBV3UA1/AfzPSr+jg==}
engines: {node: '>=10.13.0'}
@@ -15233,8 +15949,8 @@ packages:
resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==}
engines: {node: '>=12'}
- resolution: {integrity: sha512-yd1RBzSGanHkitROoPFd6qsrxt+oFhg/129YzheDGqeustzX0vTZJZsSsQjVQC4yzBQ56K55XU8gaNCtIzOnTg==}
+ resolution: {integrity: sha512-jyuiGJdtvY434z5bUZrjz67v76/ePNvFZTp9Mdz29IlH4+GPsgyGjiv0fKI+M7BdkU6ADjulUcKAd3tUK3WlEw==}
engines: {node: '>=10.13.0'}
@@ -15648,25 +16364,25 @@ snapshots:
call-me-maybe: 1.0.2
openapi-types: 12.1.3
- '@apm-js-collab/[email protected]':
+ '@apm-js-collab/[email protected]':
dependencies:
- '@apm-js-collab/code-transformer': 0.15.0
- es-module-lexer: 2.1.0
+ '@apm-js-collab/code-transformer': 0.18.1
+ es-module-lexer: 2.3.1
magic-string: 0.30.21
module-details-from-path: 1.0.4
- '@apm-js-collab/[email protected]':
+ '@apm-js-collab/[email protected]':
dependencies:
- '@types/estree': 1.0.8
+ '@types/estree': 1.0.9
astring: 1.9.0
esquery: 1.7.0
meriyah: 6.1.4
semifies: 1.0.0
source-map: 0.6.1
- '@apm-js-collab/[email protected]':
+ '@apm-js-collab/[email protected]':
dependencies:
- '@apm-js-collab/code-transformer': 0.15.0
+ '@apm-js-collab/code-transformer': 0.18.1
debug: 4.4.3
module-details-from-path: 1.0.4
transitivePeerDependencies:
@@ -15914,8 +16630,16 @@ snapshots:
js-tokens: 4.0.0
picocolors: 1.1.1
+ '@babel/[email protected]':
+ dependencies:
+ '@babel/helper-validator-identifier': 7.29.7
+ js-tokens: 4.0.0
+ picocolors: 1.1.1
+
'@babel/[email protected]': {}
+ '@babel/[email protected]': {}
+
dependencies:
'@babel/code-frame': 7.29.0
@@ -15944,10 +16668,22 @@ snapshots:
'@jridgewell/trace-mapping': 0.3.31
jsesc: 3.1.0
+ '@babel/[email protected]':
+ dependencies:
+ '@babel/parser': 7.29.7
+ '@babel/types': 7.29.7
+ '@jridgewell/gen-mapping': 0.3.13
+ '@jridgewell/trace-mapping': 0.3.31
+ jsesc: 3.1.0
+
dependencies:
'@babel/types': 7.29.7
+ '@babel/[email protected]':
+ dependencies:
+ '@babel/types': 7.29.7
+
dependencies:
'@babel/compat-data': 7.29.0
@@ -15956,6 +16692,14 @@ snapshots:
lru-cache: 5.1.1
semver: 6.3.1
+ '@babel/[email protected]':
+ dependencies:
+ '@babel/compat-data': 7.29.7
+ '@babel/helper-validator-option': 7.29.7
+ browserslist: 4.28.7
+ lru-cache: 5.1.1
+ semver: 6.3.1
+
dependencies:
'@babel/core': 7.29.0
@@ -15982,6 +16726,19 @@ snapshots:
transitivePeerDependencies:
- supports-color
+ dependencies:
+ '@babel/core': 7.29.0
+ '@babel/helper-annotate-as-pure': 7.29.7
+ '@babel/helper-member-expression-to-functions': 7.29.7
+ '@babel/helper-optimise-call-expression': 7.29.7
+ '@babel/helper-replace-supers': 7.29.7(@babel/[email protected])
+ '@babel/helper-skip-transparent-expression-wrappers': 7.29.7
+ '@babel/traverse': 7.29.7
+ semver: 6.3.1
+ transitivePeerDependencies:
+ - supports-color
+
dependencies:
'@babel/core': 7.29.0
@@ -15989,6 +16746,13 @@ snapshots:
regexpu-core: 6.4.0
semver: 6.3.1
+ dependencies:
+ '@babel/core': 7.29.0
+ '@babel/helper-annotate-as-pure': 7.29.7
+ regexpu-core: 6.4.0
+ semver: 6.3.1
+
dependencies:
'@babel/core': 7.29.0
@@ -16000,8 +16764,21 @@ snapshots:
transitivePeerDependencies:
- supports-color
+ dependencies:
+ '@babel/core': 7.29.0
+ '@babel/helper-compilation-targets': 7.29.7
+ '@babel/helper-plugin-utils': 7.29.7
+ debug: 4.4.3
+ lodash.debounce: 4.0.8
+ resolve: 1.22.12
+ transitivePeerDependencies:
+ - supports-color
+
'@babel/[email protected]': {}
+ '@babel/[email protected]': {}
+
dependencies:
'@babel/traverse': 7.29.0
@@ -16009,6 +16786,13 @@ snapshots:
transitivePeerDependencies:
- supports-color
+ '@babel/[email protected]':
+ dependencies:
+ '@babel/traverse': 7.29.7
+ '@babel/types': 7.29.7
+ transitivePeerDependencies:
+ - supports-color
+
dependencies:
'@babel/traverse': 7.29.0
@@ -16016,6 +16800,13 @@ snapshots:
transitivePeerDependencies:
- supports-color
+ '@babel/[email protected]':
+ dependencies:
+ '@babel/traverse': 7.29.7
+ '@babel/types': 7.29.7
+ transitivePeerDependencies:
+ - supports-color
+
dependencies:
'@babel/core': 7.29.0
@@ -16025,12 +16816,27 @@ snapshots:
transitivePeerDependencies:
- supports-color
+ dependencies:
+ '@babel/core': 7.29.0
+ '@babel/helper-module-imports': 7.29.7
+ '@babel/helper-validator-identifier': 7.29.7
+ '@babel/traverse': 7.29.7
+ transitivePeerDependencies:
+ - supports-color
+
dependencies:
'@babel/types': 7.29.7
+ '@babel/[email protected]':
+ dependencies:
+ '@babel/types': 7.29.7
+
'@babel/[email protected]': {}
+ '@babel/[email protected]': {}
+
dependencies:
'@babel/core': 7.29.0
@@ -16040,6 +16846,15 @@ snapshots:
transitivePeerDependencies:
- supports-color
+ dependencies:
+ '@babel/core': 7.29.0
+ '@babel/helper-annotate-as-pure': 7.29.7
+ '@babel/helper-wrap-function': 7.29.7
+ '@babel/traverse': 7.29.7
+ transitivePeerDependencies:
+ - supports-color
+
dependencies:
'@babel/core': 7.29.0
@@ -16049,6 +16864,15 @@ snapshots:
transitivePeerDependencies:
- supports-color
+ dependencies:
+ '@babel/core': 7.29.0
+ '@babel/helper-member-expression-to-functions': 7.29.7
+ '@babel/helper-optimise-call-expression': 7.29.7
+ '@babel/traverse': 7.29.7
+ transitivePeerDependencies:
+ - supports-color
+
dependencies:
'@babel/traverse': 7.29.0
@@ -16056,6 +16880,13 @@ snapshots:
transitivePeerDependencies:
- supports-color
+ '@babel/[email protected]':
+ dependencies:
+ '@babel/traverse': 7.29.7
+ '@babel/types': 7.29.7
+ transitivePeerDependencies:
+ - supports-color
+
'@babel/[email protected]': {}
'@babel/[email protected]': {}
@@ -16066,6 +16897,8 @@ snapshots:
'@babel/[email protected]': {}
+ '@babel/[email protected]': {}
+
dependencies:
'@babel/template': 7.28.6
@@ -16074,6 +16907,14 @@ snapshots:
transitivePeerDependencies:
- supports-color
+ '@babel/[email protected]':
+ dependencies:
+ '@babel/template': 7.29.7
+ '@babel/traverse': 7.29.7
+ '@babel/types': 7.29.7
+ transitivePeerDependencies:
+ - supports-color
+
dependencies:
'@babel/template': 7.28.6
@@ -16101,6 +16942,11 @@ snapshots:
'@babel/core': 7.29.0
'@babel/helper-plugin-utils': 7.28.6
+ dependencies:
+ '@babel/core': 7.29.0
+ '@babel/helper-plugin-utils': 7.29.7
+
dependencies:
'@babel/core': 7.29.0
@@ -16136,11 +16982,21 @@ snapshots:
'@babel/core': 7.29.0
'@babel/helper-plugin-utils': 7.28.6
+ dependencies:
+ '@babel/core': 7.29.0
+ '@babel/helper-plugin-utils': 7.29.7
+
dependencies:
'@babel/core': 7.29.0
'@babel/helper-plugin-utils': 7.28.6
+ dependencies:
+ '@babel/core': 7.29.0
+ '@babel/helper-plugin-utils': 7.29.7
+
dependencies:
'@babel/core': 7.29.0
@@ -16161,6 +17017,11 @@ snapshots:
'@babel/core': 7.29.0
'@babel/helper-plugin-utils': 7.28.6
+ dependencies:
+ '@babel/core': 7.29.0
+ '@babel/helper-plugin-utils': 7.29.7
+
dependencies:
'@babel/core': 7.29.0
@@ -16206,6 +17067,11 @@ snapshots:
'@babel/core': 7.29.0
'@babel/helper-plugin-utils': 7.28.6
+ dependencies:
+ '@babel/core': 7.29.0
+ '@babel/helper-plugin-utils': 7.29.7
+
dependencies:
'@babel/core': 7.29.0
@@ -16220,6 +17086,15 @@ snapshots:
transitivePeerDependencies:
- supports-color
+ dependencies:
+ '@babel/core': 7.29.0
+ '@babel/helper-plugin-utils': 7.29.7
+ '@babel/helper-remap-async-to-generator': 7.29.7(@babel/[email protected])
+ '@babel/traverse': 7.29.7
+ transitivePeerDependencies:
+ - supports-color
+
dependencies:
'@babel/core': 7.29.0
@@ -16229,11 +17104,25 @@ snapshots:
transitivePeerDependencies:
- supports-color
+ dependencies:
+ '@babel/core': 7.29.0
+ '@babel/helper-module-imports': 7.29.7
+ '@babel/helper-plugin-utils': 7.29.7
+ '@babel/helper-remap-async-to-generator': 7.29.7(@babel/[email protected])
+ transitivePeerDependencies:
+ - supports-color
+
dependencies:
'@babel/core': 7.29.0
'@babel/helper-plugin-utils': 7.28.6
+ dependencies:
+ '@babel/core': 7.29.0
+ '@babel/helper-plugin-utils': 7.29.7
+
dependencies:
'@babel/core': 7.29.0
@@ -16242,6 +17131,14 @@ snapshots:
transitivePeerDependencies:
- supports-color
+ dependencies:
+ '@babel/core': 7.29.0
+ '@babel/helper-create-class-features-plugin': 7.29.7(@babel/[email protected])
+ '@babel/helper-plugin-utils': 7.29.7
+ transitivePeerDependencies:
+ - supports-color
+
dependencies:
'@babel/core': 7.29.0
@@ -16262,6 +17159,18 @@ snapshots:
transitivePeerDependencies:
- supports-color
+ dependencies:
+ '@babel/core': 7.29.0
+ '@babel/helper-annotate-as-pure': 7.29.7
+ '@babel/helper-compilation-targets': 7.29.7
+ '@babel/helper-globals': 7.29.7
+ '@babel/helper-plugin-utils': 7.29.7
+ '@babel/helper-replace-supers': 7.29.7(@babel/[email protected])
+ '@babel/traverse': 7.29.7
+ transitivePeerDependencies:
+ - supports-color
+
dependencies:
'@babel/core': 7.29.0
@@ -16270,6 +17179,14 @@ snapshots:
transitivePeerDependencies:
- supports-color
+ dependencies:
+ '@babel/core': 7.29.0
+ '@babel/helper-plugin-utils': 7.29.7
+ '@babel/traverse': 7.29.7
+ transitivePeerDependencies:
+ - supports-color
+
dependencies:
'@babel/core': 7.29.0
@@ -16281,6 +17198,12 @@ snapshots:
'@babel/helper-plugin-utils': 7.28.6
'@babel/plugin-syntax-flow': 7.28.6(@babel/[email protected])
+ dependencies:
+ '@babel/core': 7.29.0
+ '@babel/helper-plugin-utils': 7.29.7
+ '@babel/plugin-syntax-flow': 7.29.7(@babel/[email protected])
+
dependencies:
'@babel/core': 7.29.0
@@ -16289,6 +17212,14 @@ snapshots:
transitivePeerDependencies:
- supports-color
+ dependencies:
+ '@babel/core': 7.29.0
+ '@babel/helper-plugin-utils': 7.29.7
+ '@babel/helper-skip-transparent-expression-wrappers': 7.29.7
+ transitivePeerDependencies:
+ - supports-color
+
dependencies:
'@babel/core': 7.29.0
@@ -16302,17 +17233,36 @@ snapshots:
transitivePeerDependencies:
- supports-color
+ dependencies:
+ '@babel/core': 7.29.0
+ '@babel/helper-module-transforms': 7.29.7(@babel/[email protected])
+ '@babel/helper-plugin-utils': 7.29.7
+ transitivePeerDependencies:
+ - supports-color
+
dependencies:
'@babel/core': 7.29.0
'@babel/helper-create-regexp-features-plugin': 7.28.5(@babel/[email protected])
'@babel/helper-plugin-utils': 7.28.6
+ dependencies:
+ '@babel/core': 7.29.0
+ '@babel/helper-create-regexp-features-plugin': 7.29.7(@babel/[email protected])
+ '@babel/helper-plugin-utils': 7.29.7
+
dependencies:
'@babel/core': 7.29.0
'@babel/helper-plugin-utils': 7.28.6
+ dependencies:
+ '@babel/core': 7.29.0
+ '@babel/helper-plugin-utils': 7.29.7
+
dependencies:
'@babel/core': 7.29.0
@@ -16329,6 +17279,11 @@ snapshots:
'@babel/core': 7.29.0
'@babel/helper-plugin-utils': 7.28.6
+ dependencies:
+ '@babel/core': 7.29.0
+ '@babel/helper-plugin-utils': 7.29.7
+
dependencies:
'@babel/core': 7.29.0
@@ -16337,6 +17292,14 @@ snapshots:
transitivePeerDependencies:
- supports-color
+ dependencies:
+ '@babel/core': 7.29.0
+ '@babel/helper-plugin-utils': 7.29.7
+ '@babel/helper-skip-transparent-expression-wrappers': 7.29.7
+ transitivePeerDependencies:
+ - supports-color
+
dependencies:
'@babel/core': 7.29.0
@@ -16350,6 +17313,14 @@ snapshots:
transitivePeerDependencies:
- supports-color
+ dependencies:
+ '@babel/core': 7.29.0
+ '@babel/helper-create-class-features-plugin': 7.29.7(@babel/[email protected])
+ '@babel/helper-plugin-utils': 7.29.7
+ transitivePeerDependencies:
+ - supports-color
+
dependencies:
'@babel/core': 7.29.0
@@ -16359,11 +17330,25 @@ snapshots:
transitivePeerDependencies:
- supports-color
+ dependencies:
+ '@babel/core': 7.29.0
+ '@babel/helper-annotate-as-pure': 7.29.7
+ '@babel/helper-create-class-features-plugin': 7.29.7(@babel/[email protected])
+ '@babel/helper-plugin-utils': 7.29.7
+ transitivePeerDependencies:
+ - supports-color
+
dependencies:
'@babel/core': 7.29.0
'@babel/helper-plugin-utils': 7.28.6
+ dependencies:
+ '@babel/core': 7.29.0
+ '@babel/helper-plugin-utils': 7.29.7
+
dependencies:
'@babel/core': 7.29.0
@@ -16376,11 +17361,21 @@ snapshots:
'@babel/core': 7.29.0
'@babel/helper-plugin-utils': 7.28.6
+ dependencies:
+ '@babel/core': 7.29.0
+ '@babel/helper-plugin-utils': 7.29.7
+
dependencies:
'@babel/core': 7.29.0
'@babel/helper-plugin-utils': 7.28.6
+ dependencies:
+ '@babel/core': 7.29.0
+ '@babel/helper-plugin-utils': 7.29.7
+
dependencies:
'@babel/core': 7.29.0
@@ -16392,16 +17387,27 @@ snapshots:
transitivePeerDependencies:
- supports-color
+ dependencies:
+ '@babel/core': 7.29.0
+ '@babel/helper-annotate-as-pure': 7.29.7
+ '@babel/helper-module-imports': 7.29.7
+ '@babel/helper-plugin-utils': 7.29.7
+ '@babel/plugin-syntax-jsx': 7.29.7(@babel/[email protected])
+ '@babel/types': 7.29.7
+ transitivePeerDependencies:
+ - supports-color
+
dependencies:
'@babel/core': 7.29.0
'@babel/helper-annotate-as-pure': 7.27.3
'@babel/helper-plugin-utils': 7.28.6
dependencies:
'@babel/core': 7.29.0
- '@babel/helper-plugin-utils': 7.28.6
+ '@babel/helper-plugin-utils': 7.29.7
dependencies:
@@ -16415,6 +17421,18 @@ snapshots:
transitivePeerDependencies:
- supports-color
+ dependencies:
+ '@babel/core': 7.29.0
+ '@babel/helper-module-imports': 7.29.7
+ '@babel/helper-plugin-utils': 7.29.7
+ babel-plugin-polyfill-corejs2: 0.4.17(@babel/[email protected])
+ babel-plugin-polyfill-corejs3: 0.13.0(@babel/[email protected])
+ babel-plugin-polyfill-regenerator: 0.6.8(@babel/[email protected])
+ semver: 6.3.1
+ transitivePeerDependencies:
+ - supports-color
+
dependencies:
'@babel/core': 7.29.0
@@ -16436,12 +17454,29 @@ snapshots:
transitivePeerDependencies:
- supports-color
+ dependencies:
+ '@babel/core': 7.29.0
+ '@babel/helper-annotate-as-pure': 7.29.7
+ '@babel/helper-create-class-features-plugin': 7.29.7(@babel/[email protected])
+ '@babel/helper-plugin-utils': 7.29.7
+ '@babel/helper-skip-transparent-expression-wrappers': 7.29.7
+ '@babel/plugin-syntax-typescript': 7.29.7(@babel/[email protected])
+ transitivePeerDependencies:
+ - supports-color
+
dependencies:
'@babel/core': 7.29.0
'@babel/helper-create-regexp-features-plugin': 7.28.5(@babel/[email protected])
'@babel/helper-plugin-utils': 7.28.6
+ dependencies:
+ '@babel/core': 7.29.0
+ '@babel/helper-create-regexp-features-plugin': 7.29.7(@babel/[email protected])
+ '@babel/helper-plugin-utils': 7.29.7
+
dependencies:
'@babel/core': 7.29.0
@@ -16457,12 +17492,20 @@ snapshots:
'@babel/[email protected]': {}
+ '@babel/[email protected]': {}
+
dependencies:
'@babel/code-frame': 7.29.0
'@babel/parser': 7.29.7
'@babel/types': 7.29.7
+ '@babel/[email protected]':
+ dependencies:
+ '@babel/code-frame': 7.29.7
+ '@babel/parser': 7.29.7
+ '@babel/types': 7.29.7
+
dependencies:
'@babel/code-frame': 7.29.0
@@ -16475,6 +17518,18 @@ snapshots:
transitivePeerDependencies:
- supports-color
+ '@babel/[email protected]':
+ dependencies:
+ '@babel/code-frame': 7.29.7
+ '@babel/generator': 7.29.7
+ '@babel/helper-globals': 7.29.7
+ '@babel/parser': 7.29.7
+ '@babel/template': 7.29.7
+ '@babel/types': 7.29.7
+ debug: 4.4.3
+ transitivePeerDependencies:
+ - supports-color
+
dependencies:
'@babel/helper-string-parser': 7.27.1
@@ -16827,12 +17882,12 @@ snapshots:
'@drizzle-team/[email protected]': {}
dependencies:
- '@earendil-works/pi-ai': 0.82.1(@modelcontextprotocol/[email protected]([email protected]))([email protected])([email protected])
+ '@earendil-works/pi-ai': 0.83.0(@modelcontextprotocol/[email protected]([email protected]))([email protected])([email protected])
diff: 8.0.4
ignore: 7.0.5
- typebox: 1.1.38
+ typebox: 1.3.7
yaml: 2.9.0
transitivePeerDependencies:
- '@modelcontextprotocol/sdk'
@@ -16842,7 +17897,7 @@ snapshots:
- ws
- zod
dependencies:
'@anthropic-ai/sdk': 0.91.1([email protected])
'@aws-sdk/client-bedrock-runtime': 3.1048.0
@@ -16854,7 +17909,7 @@ snapshots:
https-proxy-agent: 7.0.6
partial-json: 0.1.7
- typebox: 1.1.38
+ typebox: 1.3.7
transitivePeerDependencies:
- '@modelcontextprotocol/sdk'
- bufferutil
@@ -16863,11 +17918,11 @@ snapshots:
- ws
- zod
dependencies:
- '@earendil-works/pi-agent-core': 0.82.1(@modelcontextprotocol/[email protected]([email protected]))([email protected])([email protected])
- '@earendil-works/pi-ai': 0.82.1(@modelcontextprotocol/[email protected]([email protected]))([email protected])([email protected])
- '@earendil-works/pi-tui': 0.82.1
+ '@earendil-works/pi-agent-core': 0.83.0(@modelcontextprotocol/[email protected]([email protected]))([email protected])([email protected])
+ '@earendil-works/pi-ai': 0.83.0(@modelcontextprotocol/[email protected]([email protected]))([email protected])([email protected])
+ '@earendil-works/pi-tui': 0.83.0
'@silvia-odwyer/photon-node': 0.3.4
chalk: 5.6.2
cross-spawn: 7.0.6
@@ -16880,7 +17935,7 @@ snapshots:
minimatch: 10.2.5
proper-lockfile: 4.1.2
semver: 7.8.0
- typebox: 1.1.38
+ typebox: 1.3.7
undici: 8.5.0
yaml: 2.9.0
optionalDependencies:
@@ -16893,7 +17948,7 @@ snapshots:
- ws
- zod
- '@earendil-works/[email protected]':
+ '@earendil-works/[email protected]':
dependencies:
get-east-asian-width: 1.6.0
marked: 18.0.5
@@ -16989,7 +18044,7 @@ snapshots:
dependencies:
cross-dirname: 0.1.0
debug: 4.4.3
- fs-extra: 11.3.3
+ fs-extra: 11.4.0
minimist: 1.2.8
postject: 1.0.0-alpha.6
transitivePeerDependencies:
@@ -17071,6 +18126,9 @@ snapshots:
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
@@ -17083,6 +18141,9 @@ snapshots:
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
@@ -17095,6 +18156,9 @@ snapshots:
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
@@ -17107,6 +18171,9 @@ snapshots:
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
@@ -17119,6 +18186,9 @@ snapshots:
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
@@ -17131,6 +18201,9 @@ snapshots:
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
@@ -17143,6 +18216,9 @@ snapshots:
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
@@ -17155,6 +18231,9 @@ snapshots:
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
@@ -17167,6 +18246,9 @@ snapshots:
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
@@ -17179,6 +18261,9 @@ snapshots:
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
@@ -17191,6 +18276,9 @@ snapshots:
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
@@ -17203,6 +18291,9 @@ snapshots:
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
@@ -17215,6 +18306,9 @@ snapshots:
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
@@ -17227,6 +18321,9 @@ snapshots:
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
@@ -17239,6 +18336,9 @@ snapshots:
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
@@ -17251,6 +18351,9 @@ snapshots:
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
@@ -17263,6 +18366,9 @@ snapshots:
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
@@ -17272,6 +18378,9 @@ snapshots:
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
@@ -17284,6 +18393,9 @@ snapshots:
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
@@ -17293,6 +18405,9 @@ snapshots:
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
@@ -17305,6 +18420,9 @@ snapshots:
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
@@ -17314,6 +18432,9 @@ snapshots:
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
@@ -17326,6 +18447,9 @@ snapshots:
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
@@ -17338,6 +18462,9 @@ snapshots:
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
@@ -17350,6 +18477,9 @@ snapshots:
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
@@ -17359,13 +18489,16 @@ snapshots:
'@esbuild/[email protected]':
optional: true
- '@esbuild/[email protected]':
+ '@esbuild/[email protected]':
+ optional: true
+
+ '@esbuild/[email protected]':
optional: true
'@esbuild/[email protected]':
optional: true
dependencies:
eslint: 10.5.0([email protected])
eslint-visitor-keys: 3.4.3
@@ -17459,7 +18592,7 @@ snapshots:
ws: 8.21.0
zod: 3.25.76
optionalDependencies:
- expo-router: 57.0.8(64405165466fe33cacd7d08cae7227d6)
+ expo-router: 57.0.8(649cbe633c4ca8372dc41cefd86e5cb2)
react-native: 0.86.0(@babel/[email protected])(@react-native/[email protected](@babel/[email protected]))(@types/[email protected])([email protected])
transitivePeerDependencies:
- '@expo/dom-webview'
@@ -17583,7 +18716,7 @@ snapshots:
dependencies:
- '@babel/code-frame': 7.29.0
+ '@babel/code-frame': 7.29.7
json5: 2.2.3
@@ -17718,7 +18851,7 @@ snapshots:
dependencies:
- '@babel/code-frame': 7.29.0
+ '@babel/code-frame': 7.29.7
'@babel/core': 7.29.0
'@babel/plugin-transform-modules-commonjs': 7.28.6(@babel/[email protected])
optionalDependencies:
@@ -17736,7 +18869,7 @@ snapshots:
react: 19.2.6
optionalDependencies:
- expo-router: 57.0.8(64405165466fe33cacd7d08cae7227d6)
+ expo-router: 57.0.8(649cbe633c4ca8372dc41cefd86e5cb2)
react-dom: 19.2.6([email protected])
transitivePeerDependencies:
- supports-color
@@ -17772,7 +18905,7 @@ snapshots:
dependencies:
- '@babel/code-frame': 7.29.0
+ '@babel/code-frame': 7.29.7
chalk: 4.1.2
js-yaml: 4.1.1
@@ -18008,7 +19141,7 @@ snapshots:
dependencies:
string-width: 5.1.2
string-width-cjs: [email protected]
- strip-ansi: 7.1.2
+ strip-ansi: 7.2.0
strip-ansi-cjs: [email protected]
wrap-ansi: 8.1.0
wrap-ansi-cjs: [email protected]
@@ -18038,7 +19171,7 @@ snapshots:
jest-util: 30.4.1
slash: 3.0.0
dependencies:
'@jest/console': 30.4.1
'@jest/pattern': 30.4.0
@@ -18054,7 +19187,7 @@ snapshots:
fast-json-stable-stringify: 2.1.0
graceful-fs: 4.2.11
jest-changed-files: 30.4.1
jest-haste-map: 30.4.1
jest-message-util: 30.4.1
jest-regex-util: 30.4.0
@@ -18210,7 +19343,7 @@ snapshots:
'@jest/schemas': 29.6.3
'@types/istanbul-lib-coverage': 2.0.6
'@types/istanbul-reports': 3.0.4
- '@types/node': 24.12.0
+ '@types/node': 24.13.3
'@types/yargs': 17.0.35
chalk: 4.1.2
@@ -18449,11 +19582,11 @@ snapshots:
'@joplin/[email protected]': {}
dependencies:
glob: 13.0.6
react-docgen-typescript: 2.4.0([email protected])
optionalDependencies:
typescript: 5.9.3
@@ -18959,7 +20092,7 @@ snapshots:
dependencies:
'@opentelemetry/api': 1.9.0
- '@opentelemetry/[email protected]':
+ '@opentelemetry/[email protected]':
dependencies:
'@opentelemetry/api': 1.9.1
@@ -18967,6 +20100,11 @@ snapshots:
'@opentelemetry/[email protected]': {}
+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':
+ dependencies:
+ '@opentelemetry/api': 1.9.1
+ '@opentelemetry/semantic-conventions': 1.41.1
+
'@opentelemetry/[email protected](@opentelemetry/[email protected])':
dependencies:
'@opentelemetry/api': 1.9.1
@@ -19000,11 +20138,11 @@ snapshots:
'@opentelemetry/resources': 2.2.0(@opentelemetry/[email protected])
'@opentelemetry/sdk-trace-base': 2.2.0(@opentelemetry/[email protected])
- '@opentelemetry/[email protected](@opentelemetry/[email protected])':
+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':
dependencies:
'@opentelemetry/api': 1.9.1
- '@opentelemetry/api-logs': 0.214.0
- import-in-the-middle: 3.2.0
+ '@opentelemetry/api-logs': 0.220.0
+ import-in-the-middle: 3.3.2
require-in-the-middle: 8.0.1
transitivePeerDependencies:
- supports-color
@@ -19026,6 +20164,12 @@ snapshots:
'@opentelemetry/sdk-trace-base': 2.2.0(@opentelemetry/[email protected])
protobufjs: 7.6.5
+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':
+ dependencies:
+ '@opentelemetry/api': 1.9.1
+ '@opentelemetry/core': 2.10.0(@opentelemetry/[email protected])
+ '@opentelemetry/semantic-conventions': 1.41.1
+
'@opentelemetry/[email protected](@opentelemetry/[email protected])':
dependencies:
'@opentelemetry/api': 1.9.1
@@ -19057,6 +20201,14 @@ snapshots:
'@opentelemetry/core': 2.2.0(@opentelemetry/[email protected])
'@opentelemetry/resources': 2.2.0(@opentelemetry/[email protected])
+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':
+ dependencies:
+ '@opentelemetry/api': 1.9.1
+ '@opentelemetry/core': 2.10.0(@opentelemetry/[email protected])
+ '@opentelemetry/resources': 2.10.0(@opentelemetry/[email protected])
+ '@opentelemetry/sdk-trace': 2.10.0(@opentelemetry/[email protected])
+ '@opentelemetry/semantic-conventions': 1.41.1
+
'@opentelemetry/[email protected](@opentelemetry/[email protected])':
dependencies:
'@opentelemetry/api': 1.9.1
@@ -19071,6 +20223,13 @@ snapshots:
'@opentelemetry/resources': 2.8.0(@opentelemetry/[email protected])
'@opentelemetry/semantic-conventions': 1.41.1
+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':
+ dependencies:
+ '@opentelemetry/api': 1.9.1
+ '@opentelemetry/core': 2.10.0(@opentelemetry/[email protected])
+ '@opentelemetry/resources': 2.10.0(@opentelemetry/[email protected])
+ '@opentelemetry/semantic-conventions': 1.41.1
+
'@opentelemetry/[email protected]': {}
'@opentelemetry/[email protected]': {}
@@ -19775,11 +20934,11 @@ snapshots:
tailwind-merge: 2.6.1
tailwindcss: 4.3.1
dependencies:
'@posthog/cli': 0.7.22
'@posthog/plugin-utils': 1.1.1
- rollup: 4.59.0
+ rollup: 4.62.2
'@posthog/[email protected]': {}
@@ -20601,7 +21760,7 @@ snapshots:
commander: 14.0.3
ignore: 7.0.5
ora: 9.4.1
- package-manager-detector: 1.6.0
+ package-manager-detector: 1.8.0
picocolors: 1.1.1
prompts: 2.4.2
tinyexec: 1.2.4
@@ -20634,34 +21793,34 @@ snapshots:
'@react-native/[email protected](@babel/[email protected])':
dependencies:
'@babel/core': 7.29.0
- '@babel/plugin-proposal-export-default-from': 7.27.1(@babel/[email protected])
+ '@babel/plugin-proposal-export-default-from': 7.29.7(@babel/[email protected])
'@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/[email protected])
- '@babel/plugin-syntax-export-default-from': 7.28.6(@babel/[email protected])
+ '@babel/plugin-syntax-export-default-from': 7.29.7(@babel/[email protected])
'@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/[email protected])
'@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/[email protected])
- '@babel/plugin-transform-async-generator-functions': 7.29.0(@babel/[email protected])
- '@babel/plugin-transform-async-to-generator': 7.28.6(@babel/[email protected])
- '@babel/plugin-transform-block-scoping': 7.28.6(@babel/[email protected])
- '@babel/plugin-transform-class-properties': 7.28.6(@babel/[email protected])
- '@babel/plugin-transform-classes': 7.28.6(@babel/[email protected])
- '@babel/plugin-transform-destructuring': 7.28.5(@babel/[email protected])
- '@babel/plugin-transform-flow-strip-types': 7.27.1(@babel/[email protected])
- '@babel/plugin-transform-for-of': 7.27.1(@babel/[email protected])
- '@babel/plugin-transform-modules-commonjs': 7.28.6(@babel/[email protected])
- '@babel/plugin-transform-named-capturing-groups-regex': 7.29.0(@babel/[email protected])
- '@babel/plugin-transform-nullish-coalescing-operator': 7.28.6(@babel/[email protected])
- '@babel/plugin-transform-optional-catch-binding': 7.28.6(@babel/[email protected])
- '@babel/plugin-transform-optional-chaining': 7.28.6(@babel/[email protected])
- '@babel/plugin-transform-private-methods': 7.28.6(@babel/[email protected])
- '@babel/plugin-transform-private-property-in-object': 7.28.6(@babel/[email protected])
- '@babel/plugin-transform-react-display-name': 7.28.0(@babel/[email protected])
- '@babel/plugin-transform-react-jsx': 7.28.6(@babel/[email protected])
- '@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/[email protected])
- '@babel/plugin-transform-react-jsx-source': 7.27.1(@babel/[email protected])
- '@babel/plugin-transform-regenerator': 7.29.0(@babel/[email protected])
- '@babel/plugin-transform-runtime': 7.29.0(@babel/[email protected])
- '@babel/plugin-transform-typescript': 7.28.6(@babel/[email protected])
- '@babel/plugin-transform-unicode-regex': 7.27.1(@babel/[email protected])
+ '@babel/plugin-transform-async-generator-functions': 7.29.7(@babel/[email protected])
+ '@babel/plugin-transform-async-to-generator': 7.29.7(@babel/[email protected])
+ '@babel/plugin-transform-block-scoping': 7.29.7(@babel/[email protected])
+ '@babel/plugin-transform-class-properties': 7.29.7(@babel/[email protected])
+ '@babel/plugin-transform-classes': 7.29.7(@babel/[email protected])
+ '@babel/plugin-transform-destructuring': 7.29.7(@babel/[email protected])
+ '@babel/plugin-transform-flow-strip-types': 7.29.7(@babel/[email protected])
+ '@babel/plugin-transform-for-of': 7.29.7(@babel/[email protected])
+ '@babel/plugin-transform-modules-commonjs': 7.29.7(@babel/[email protected])
+ '@babel/plugin-transform-named-capturing-groups-regex': 7.29.7(@babel/[email protected])
+ '@babel/plugin-transform-nullish-coalescing-operator': 7.29.7(@babel/[email protected])
+ '@babel/plugin-transform-optional-catch-binding': 7.29.7(@babel/[email protected])
+ '@babel/plugin-transform-optional-chaining': 7.29.7(@babel/[email protected])
+ '@babel/plugin-transform-private-methods': 7.29.7(@babel/[email protected])
+ '@babel/plugin-transform-private-property-in-object': 7.29.7(@babel/[email protected])
+ '@babel/plugin-transform-react-display-name': 7.29.7(@babel/[email protected])
+ '@babel/plugin-transform-react-jsx': 7.29.7(@babel/[email protected])
+ '@babel/plugin-transform-react-jsx-self': 7.29.7(@babel/[email protected])
+ '@babel/plugin-transform-react-jsx-source': 7.29.7(@babel/[email protected])
+ '@babel/plugin-transform-regenerator': 7.29.7(@babel/[email protected])
+ '@babel/plugin-transform-runtime': 7.29.7(@babel/[email protected])
+ '@babel/plugin-transform-typescript': 7.29.7(@babel/[email protected])
+ '@babel/plugin-transform-unicode-regex': 7.29.7(@babel/[email protected])
'@react-native/babel-plugin-codegen': 0.86.0(@babel/[email protected])
babel-plugin-syntax-hermes-parser: 0.36.0
babel-plugin-transform-flow-enums: 0.0.2(@babel/[email protected])
@@ -20760,33 +21919,33 @@ snapshots:
optionalDependencies:
'@types/react': 19.2.17
- '@react-navigation/[email protected]([email protected])':
+ '@react-navigation/[email protected]([email protected])':
dependencies:
- '@react-navigation/routers': 7.5.3
+ '@react-navigation/routers': 7.6.4
escape-string-regexp: 4.0.0
fast-deep-equal: 3.1.3
- nanoid: 3.3.12
+ nanoid: 3.3.16
query-string: 7.1.3
react: 19.2.6
- react-is: 19.2.6
+ react-is: 19.2.8
use-latest-callback: 0.2.6([email protected])
use-sync-external-store: 1.6.0([email protected])
optional: true
dependencies:
- '@react-navigation/core': 7.14.0([email protected])
+ '@react-navigation/core': 7.21.11([email protected])
escape-string-regexp: 4.0.0
fast-deep-equal: 3.1.3
- nanoid: 3.3.12
+ nanoid: 3.3.16
react: 19.2.6
react-native: 0.86.0(@babel/[email protected])(@react-native/[email protected](@babel/[email protected]))(@types/[email protected])([email protected])
use-latest-callback: 0.2.6([email protected])
optional: true
- '@react-navigation/[email protected]':
+ '@react-navigation/[email protected]':
dependencies:
- nanoid: 3.3.12
+ nanoid: 3.3.16
optional: true
'@remirror/[email protected]': {}
@@ -20841,140 +22000,216 @@ snapshots:
'@rolldown/[email protected]': {}
dependencies:
'@types/estree': 1.0.8
estree-walker: 2.0.2
picomatch: 4.0.3
optionalDependencies:
- rollup: 4.59.0
+ rollup: 4.62.2
'@rollup/[email protected]':
optional: true
+ '@rollup/[email protected]':
+ optional: true
+
'@rollup/[email protected]':
optional: true
+ '@rollup/[email protected]':
+ optional: true
+
'@rollup/[email protected]':
optional: true
+ '@rollup/[email protected]':
+ optional: true
+
'@rollup/[email protected]':
optional: true
+ '@rollup/[email protected]':
+ optional: true
+
'@rollup/[email protected]':
optional: true
+ '@rollup/[email protected]':
+ optional: true
+
'@rollup/[email protected]':
optional: true
+ '@rollup/[email protected]':
+ optional: true
+
'@rollup/[email protected]':
optional: true
+ '@rollup/[email protected]':
+ optional: true
+
'@rollup/[email protected]':
optional: true
+ '@rollup/[email protected]':
+ optional: true
+
'@rollup/[email protected]':
optional: true
+ '@rollup/[email protected]':
+ optional: true
+
'@rollup/[email protected]':
optional: true
+ '@rollup/[email protected]':
+ optional: true
+
'@rollup/[email protected]':
optional: true
+ '@rollup/[email protected]':
+ optional: true
+
'@rollup/[email protected]':
optional: true
+ '@rollup/[email protected]':
+ optional: true
+
'@rollup/[email protected]':
optional: true
+ '@rollup/[email protected]':
+ optional: true
+
'@rollup/[email protected]':
optional: true
+ '@rollup/[email protected]':
+ optional: true
+
'@rollup/[email protected]':
optional: true
+ '@rollup/[email protected]':
+ optional: true
+
'@rollup/[email protected]':
optional: true
+ '@rollup/[email protected]':
+ optional: true
+
'@rollup/[email protected]':
optional: true
+ '@rollup/[email protected]':
+ optional: true
+
'@rollup/[email protected]':
optional: true
+ '@rollup/[email protected]':
+ optional: true
+
'@rollup/[email protected]':
optional: true
+ '@rollup/[email protected]':
+ optional: true
+
'@rollup/[email protected]':
optional: true
+ '@rollup/[email protected]':
+ optional: true
+
'@rollup/[email protected]':
optional: true
+ '@rollup/[email protected]':
+ optional: true
+
'@rollup/[email protected]':
optional: true
+ '@rollup/[email protected]':
+ optional: true
+
'@rollup/[email protected]':
optional: true
+ '@rollup/[email protected]':
+ optional: true
+
'@rollup/[email protected]':
optional: true
+ '@rollup/[email protected]':
+ optional: true
+
'@rollup/[email protected]':
optional: true
+ '@rollup/[email protected]':
+ optional: true
+
'@sec-ant/[email protected]': {}
- '@sentry/[email protected]': {}
+ '@sentry/[email protected]': {}
- '@sentry/[email protected]': {}
+ '@sentry/[email protected]':
+ dependencies:
+ '@sentry/conventions': 0.16.0
- '@sentry/[email protected](@opentelemetry/[email protected])(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))':
+ '@sentry/[email protected](@opentelemetry/[email protected])(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))':
dependencies:
- '@sentry/conventions': 0.12.0
- '@sentry/core': 10.61.0
- '@sentry/opentelemetry': 10.61.0(@opentelemetry/[email protected])(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))
- import-in-the-middle: 3.2.0
+ '@sentry/conventions': 0.16.0
+ '@sentry/core': 10.68.0
+ '@sentry/opentelemetry': 10.68.0(@opentelemetry/[email protected])(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))
+ import-in-the-middle: 3.3.2
optionalDependencies:
'@opentelemetry/api': 1.9.1
- '@opentelemetry/core': 2.8.0(@opentelemetry/[email protected])
+ '@opentelemetry/core': 2.10.0(@opentelemetry/[email protected])
'@opentelemetry/exporter-trace-otlp-http': 0.208.0(@opentelemetry/[email protected])
- '@opentelemetry/instrumentation': 0.214.0(@opentelemetry/[email protected])
- '@opentelemetry/sdk-trace-base': 2.8.0(@opentelemetry/[email protected])
+ '@opentelemetry/instrumentation': 0.220.0(@opentelemetry/[email protected])
+ '@opentelemetry/sdk-trace-base': 2.10.0(@opentelemetry/[email protected])
- '@sentry/[email protected](@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))':
+ '@sentry/[email protected](@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))':
dependencies:
'@opentelemetry/api': 1.9.1
- '@opentelemetry/instrumentation': 0.214.0(@opentelemetry/[email protected])
- '@opentelemetry/sdk-trace-base': 2.8.0(@opentelemetry/[email protected])
- '@opentelemetry/semantic-conventions': 1.41.1
- '@sentry/core': 10.61.0
- '@sentry/node-core': 10.61.0(@opentelemetry/[email protected])(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))
- '@sentry/opentelemetry': 10.61.0(@opentelemetry/[email protected])(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))
- '@sentry/server-utils': 10.61.0
- import-in-the-middle: 3.2.0
+ '@opentelemetry/instrumentation': 0.220.0(@opentelemetry/[email protected])
+ '@opentelemetry/sdk-trace-base': 2.10.0(@opentelemetry/[email protected])
+ '@sentry/conventions': 0.16.0
+ '@sentry/core': 10.68.0
+ '@sentry/node-core': 10.68.0(@opentelemetry/[email protected])(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))
+ '@sentry/opentelemetry': 10.68.0(@opentelemetry/[email protected])(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))
+ '@sentry/server-utils': 10.68.0
+ import-in-the-middle: 3.3.2
transitivePeerDependencies:
- '@opentelemetry/core'
- '@opentelemetry/exporter-trace-otlp-http'
- supports-color
- '@sentry/[email protected](@opentelemetry/[email protected])(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))':
+ '@sentry/[email protected](@opentelemetry/[email protected])(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))':
dependencies:
'@opentelemetry/api': 1.9.1
- '@opentelemetry/core': 2.8.0(@opentelemetry/[email protected])
- '@opentelemetry/sdk-trace-base': 2.8.0(@opentelemetry/[email protected])
- '@sentry/conventions': 0.12.0
- '@sentry/core': 10.61.0
+ '@opentelemetry/core': 2.10.0(@opentelemetry/[email protected])
+ '@opentelemetry/sdk-trace-base': 2.10.0(@opentelemetry/[email protected])
+ '@sentry/conventions': 0.16.0
+ '@sentry/core': 10.68.0
- '@sentry/[email protected]':
+ '@sentry/[email protected]':
dependencies:
- '@apm-js-collab/code-transformer': 0.15.0
- '@apm-js-collab/code-transformer-bundler-plugins': 0.5.0
- '@apm-js-collab/tracing-hooks': 0.10.0
- '@sentry/conventions': 0.12.0
- '@sentry/core': 10.61.0
- magic-string: 0.30.21
+ '@apm-js-collab/code-transformer-bundler-plugins': 0.7.1
+ '@apm-js-collab/tracing-hooks': 0.13.0
+ '@sentry/conventions': 0.16.0
+ '@sentry/core': 10.68.0
+ meriyah: 6.1.4
transitivePeerDependencies:
- supports-color
@@ -21120,10 +22355,10 @@ snapshots:
axe-core: 4.11.1
dependencies:
'@mdx-js/react': 3.1.1(@types/[email protected])([email protected])
react: 19.2.6
@@ -21139,26 +22374,26 @@ snapshots:
- vite
- webpack
dependencies:
ts-dedent: 2.2.0
transitivePeerDependencies:
- esbuild
- rollup
- webpack
dependencies:
unplugin: 2.3.11
optionalDependencies:
- esbuild: 0.27.2
- rollup: 4.59.0
- webpack: 5.105.0(@swc/[email protected])([email protected])
+ esbuild: 0.27.7
+ rollup: 4.62.2
'@storybook/[email protected]': {}
@@ -21176,11 +22411,11 @@ snapshots:
'@types/react': 19.2.17
'@types/react-dom': 19.2.3(@types/[email protected])
dependencies:
- '@rollup/pluginutils': 5.3.0([email protected])
+ '@rollup/pluginutils': 5.3.0([email protected])
empathic: 2.0.0
magic-string: 0.30.21
@@ -21190,7 +22425,7 @@ snapshots:
resolve: 1.22.11
tsconfig-paths: 4.2.0
transitivePeerDependencies:
- '@types/react'
- '@types/react-dom'
@@ -21216,7 +22451,7 @@ snapshots:
transitivePeerDependencies:
- supports-color
dependencies:
'@babel/core': 7.29.0
'@babel/generator': 7.29.1
@@ -21226,14 +22461,14 @@ snapshots:
'@swc/core': 1.15.43
'@swc/jest': 0.2.39(@swc/[email protected])
expect-playwright: 0.8.0
jest-circus: 30.4.2
jest-environment-node: 30.4.1
jest-junit: 16.0.0
jest-process-manager: 0.4.0
jest-runner: 30.4.2
jest-serializer-html: 7.1.0
nyc: 15.1.0
playwright: 1.60.0
playwright-core: 1.60.0
@@ -21522,19 +22757,19 @@ snapshots:
'@tailwindcss/oxide-win32-arm64-msvc': 4.3.1
'@tailwindcss/oxide-win32-x64-msvc': 4.3.1
dependencies:
'@tailwindcss/node': 4.2.2
'@tailwindcss/oxide': 4.2.2
tailwindcss: 4.2.2
dependencies:
'@tailwindcss/node': 4.3.1
'@tailwindcss/oxide': 4.3.1
tailwindcss: 4.3.1
'@tanstack/[email protected]':
dependencies:
@@ -21549,7 +22784,7 @@ snapshots:
'@tanstack/[email protected]': {}
dependencies:
'@tanstack/devtools-client': 0.0.8
'@tanstack/devtools-event-bus': 0.4.2
@@ -21558,7 +22793,7 @@ snapshots:
magic-string: 0.30.21
oxc-parser: 0.120.0(@emnapi/[email protected])(@emnapi/[email protected])
picomatch: 4.0.3
transitivePeerDependencies:
- '@emnapi/core'
- '@emnapi/runtime'
@@ -21642,7 +22877,7 @@ snapshots:
transitivePeerDependencies:
- supports-color
dependencies:
'@babel/core': 7.29.0
'@babel/template': 7.28.6
@@ -21655,12 +22890,12 @@ snapshots:
zod: 4.4.3
optionalDependencies:
'@tanstack/react-router': 1.170.15([email protected]([email protected]))([email protected])
- webpack: 5.105.0(@swc/[email protected])([email protected])
transitivePeerDependencies:
- supports-color
dependencies:
'@babel/core': 7.29.0
'@babel/template': 7.28.6
@@ -21673,8 +22908,8 @@ snapshots:
zod: 4.4.3
optionalDependencies:
'@tanstack/react-router': 1.170.15([email protected]([email protected]))([email protected])
- webpack: 5.105.0([email protected])
+ webpack: 5.105.0([email protected])
transitivePeerDependencies:
- supports-color
@@ -21699,8 +22934,8 @@ snapshots:
'@testing-library/[email protected]':
dependencies:
- '@babel/code-frame': 7.29.0
- '@babel/runtime': 7.29.2
+ '@babel/code-frame': 7.29.7
+ '@babel/runtime': 7.29.7
'@types/aria-query': 5.0.4
aria-query: 5.3.0
dom-accessibility-api: 0.5.16
@@ -21717,7 +22952,7 @@ snapshots:
picocolors: 1.1.1
redent: 3.0.0
dependencies:
jest-matcher-utils: 30.4.1
picocolors: 1.1.1
@@ -21727,7 +22962,7 @@ snapshots:
react-test-renderer: 19.2.6([email protected])
redent: 3.0.0
optionalDependencies:
dependencies:
@@ -22044,7 +23279,7 @@ snapshots:
dependencies:
'@types/http-cache-semantics': 4.2.0
'@types/keyv': 3.1.4
- '@types/node': 24.12.0
+ '@types/node': 24.13.3
'@types/responselike': 1.0.3
'@types/[email protected]': {}
@@ -22069,12 +23304,12 @@ snapshots:
dependencies:
'@types/eslint': 9.6.1
- '@types/estree': 1.0.8
+ '@types/estree': 1.0.9
optional: true
dependencies:
- '@types/estree': 1.0.8
+ '@types/estree': 1.0.9
'@types/json-schema': 7.0.15
optional: true
@@ -22082,10 +23317,12 @@ snapshots:
dependencies:
- '@types/estree': 1.0.8
+ '@types/estree': 1.0.9
'@types/[email protected]': {}
+ '@types/[email protected]': {}
+
dependencies:
'@types/node': 24.12.0
@@ -22128,7 +23365,7 @@ snapshots:
dependencies:
- '@types/node': 24.12.0
+ '@types/node': 24.13.3
'@types/[email protected]': {}
@@ -22161,6 +23398,10 @@ snapshots:
dependencies:
undici-types: 7.16.0
+ '@types/[email protected]':
+ dependencies:
+ undici-types: 7.18.2
+
dependencies:
undici-types: 7.16.0
@@ -22189,7 +23430,7 @@ snapshots:
dependencies:
- '@types/node': 24.12.0
+ '@types/node': 24.13.3
'@types/[email protected]': {}
@@ -22227,7 +23468,7 @@ snapshots:
dependencies:
'@types/yargs-parser': 21.0.3
- '@typescript-eslint/[email protected]': {}
+ '@typescript-eslint/[email protected]': {}
'@typescript/[email protected]':
optional: true
@@ -22332,7 +23573,7 @@ snapshots:
optional: true
dependencies:
'@babel/core': 7.29.0
'@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/[email protected])
@@ -22340,11 +23581,11 @@ snapshots:
'@rolldown/pluginutils': 1.0.0-beta.27
'@types/babel__core': 7.20.5
react-refresh: 0.17.0
transitivePeerDependencies:
- supports-color
dependencies:
'@babel/core': 7.29.0
'@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/[email protected])
@@ -22352,7 +23593,7 @@ snapshots:
'@rolldown/pluginutils': 1.0.0-beta.27
'@types/babel__core': 7.20.5
react-refresh: 0.17.0
transitivePeerDependencies:
- supports-color
@@ -22368,7 +23609,7 @@ snapshots:
transitivePeerDependencies:
- supports-color
dependencies:
'@babel/core': 7.29.0
'@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/[email protected])
@@ -22376,7 +23617,7 @@ snapshots:
'@rolldown/pluginutils': 1.0.0-rc.3
'@types/babel__core': 7.20.5
react-refresh: 0.18.0
transitivePeerDependencies:
- supports-color
@@ -22392,7 +23633,7 @@ snapshots:
obug: 2.1.1
std-env: 4.1.0
tinyrainbow: 3.1.0
'@vitest/[email protected]':
dependencies:
@@ -22420,14 +23661,14 @@ snapshots:
chai: 6.2.2
tinyrainbow: 3.1.0
dependencies:
'@vitest/spy': 4.1.6
estree-walker: 3.0.3
magic-string: 0.30.21
optionalDependencies:
dependencies:
@@ -22447,14 +23688,14 @@ snapshots:
dependencies:
'@vitest/spy': 4.1.8
estree-walker: 3.0.3
magic-string: 0.30.21
optionalDependencies:
dependencies:
@@ -22531,7 +23772,7 @@ snapshots:
sirv: 3.0.2
tinyglobby: 0.2.15
tinyrainbow: 3.1.0
'@vitest/[email protected]':
dependencies:
@@ -22694,10 +23935,6 @@ snapshots:
mime-types: 3.0.2
negotiator: 1.0.0
- dependencies:
- acorn: 8.17.0
-
dependencies:
acorn: 8.17.0
@@ -22862,7 +24099,7 @@ snapshots:
proper-lockfile: 4.1.2
resedit: 1.7.2
semver: 7.7.3
- tar: 7.5.21
+ tar: 7.5.22
temp-file: 3.4.0
tiny-async-pool: 1.3.0
unzipper: 0.12.3
@@ -23004,6 +24241,15 @@ snapshots:
transitivePeerDependencies:
- supports-color
+ dependencies:
+ '@babel/compat-data': 7.29.7
+ '@babel/core': 7.29.0
+ '@babel/helper-define-polyfill-provider': 0.6.8(@babel/[email protected])
+ semver: 6.3.1
+ transitivePeerDependencies:
+ - supports-color
+
dependencies:
'@babel/core': 7.29.0
@@ -23019,6 +24265,13 @@ snapshots:
transitivePeerDependencies:
- supports-color
+ dependencies:
+ '@babel/core': 7.29.0
+ '@babel/helper-define-polyfill-provider': 0.6.8(@babel/[email protected])
+ transitivePeerDependencies:
+ - supports-color
+
dependencies:
'@babel/types': 7.29.7
@@ -23132,6 +24385,8 @@ snapshots:
+
@@ -23234,6 +24489,14 @@ snapshots:
node-releases: 2.0.27
update-browserslist-db: 1.2.3([email protected])
+ dependencies:
+ baseline-browser-mapping: 2.11.1
+ caniuse-lite: 1.0.30001806
+ electron-to-chromium: 1.5.396
+ node-releases: 2.0.51
+ update-browserslist-db: 1.2.3([email protected])
+
dependencies:
node-int64: 0.4.0
@@ -23335,6 +24598,8 @@ snapshots:
+
@@ -23400,7 +24665,7 @@ snapshots:
dependencies:
- '@types/node': 24.12.0
+ '@types/node': 24.13.3
escape-string-regexp: 4.0.0
is-wsl: 2.2.0
lighthouse-logger: 1.4.2
@@ -23412,7 +24677,7 @@ snapshots:
dependencies:
- '@types/node': 24.12.0
+ '@types/node': 24.13.3
escape-string-regexp: 4.0.0
is-wsl: 2.2.0
lighthouse-logger: 1.4.2
@@ -23466,7 +24731,7 @@ snapshots:
dependencies:
slice-ansi: 9.0.0
- string-width: 8.2.1
+ string-width: 8.2.2
@@ -24085,6 +25350,8 @@ snapshots:
+
dependencies:
builder-util-runtime: 9.7.0
@@ -24098,7 +25365,7 @@ snapshots:
transitivePeerDependencies:
- supports-color
dependencies:
'@babel/core': 7.29.0
'@babel/plugin-transform-arrow-functions': 7.27.1(@babel/[email protected])
@@ -24106,7 +25373,7 @@ snapshots:
esbuild: 0.25.12
magic-string: 0.30.21
picocolors: 1.1.1
optionalDependencies:
'@swc/core': 1.15.43
transitivePeerDependencies:
@@ -24165,6 +25432,12 @@ snapshots:
graceful-fs: 4.2.11
tapable: 2.3.3
+ dependencies:
+ graceful-fs: 4.2.11
+ tapable: 2.3.3
+ optional: true
+
@@ -24195,7 +25468,7 @@ snapshots:
dependencies:
@@ -24206,9 +25479,9 @@ snapshots:
es-errors: 1.3.0
get-intrinsic: 1.3.0
has-tostringtag: 1.0.2
- hasown: 2.0.2
+ hasown: 2.0.4
@@ -24219,10 +25492,10 @@ snapshots:
transitivePeerDependencies:
- supports-color
dependencies:
debug: 4.4.3
- esbuild: 0.27.2
+ esbuild: 0.27.7
transitivePeerDependencies:
- supports-color
optional: true
@@ -24310,6 +25583,35 @@ snapshots:
'@esbuild/win32-ia32': 0.27.2
'@esbuild/win32-x64': 0.27.2
+ optionalDependencies:
+ '@esbuild/aix-ppc64': 0.27.7
+ '@esbuild/android-arm': 0.27.7
+ '@esbuild/android-arm64': 0.27.7
+ '@esbuild/android-x64': 0.27.7
+ '@esbuild/darwin-arm64': 0.27.7
+ '@esbuild/darwin-x64': 0.27.7
+ '@esbuild/freebsd-arm64': 0.27.7
+ '@esbuild/freebsd-x64': 0.27.7
+ '@esbuild/linux-arm': 0.27.7
+ '@esbuild/linux-arm64': 0.27.7
+ '@esbuild/linux-ia32': 0.27.7
+ '@esbuild/linux-loong64': 0.27.7
+ '@esbuild/linux-mips64el': 0.27.7
+ '@esbuild/linux-ppc64': 0.27.7
+ '@esbuild/linux-riscv64': 0.27.7
+ '@esbuild/linux-s390x': 0.27.7
+ '@esbuild/linux-x64': 0.27.7
+ '@esbuild/netbsd-arm64': 0.27.7
+ '@esbuild/netbsd-x64': 0.27.7
+ '@esbuild/openbsd-arm64': 0.27.7
+ '@esbuild/openbsd-x64': 0.27.7
+ '@esbuild/openharmony-arm64': 0.27.7
+ '@esbuild/sunos-x64': 0.27.7
+ '@esbuild/win32-arm64': 0.27.7
+ '@esbuild/win32-ia32': 0.27.7
+ '@esbuild/win32-x64': 0.27.7
+
optionalDependencies:
'@esbuild/aix-ppc64': 0.28.1
@@ -24371,7 +25673,7 @@ snapshots:
dependencies:
'@types/esrecurse': 4.3.1
- '@types/estree': 1.0.8
+ '@types/estree': 1.0.9
esrecurse: 4.3.0
estraverse: 5.3.0
@@ -24381,7 +25683,7 @@ snapshots:
dependencies:
- '@eslint-community/eslint-utils': 4.9.1([email protected]([email protected]))
+ '@eslint-community/eslint-utils': 4.10.1([email protected]([email protected]))
'@eslint-community/regexpp': 4.12.2
'@eslint/config-array': 0.23.5
'@eslint/config-helpers': 0.6.0
@@ -24390,7 +25692,7 @@ snapshots:
'@humanfs/node': 0.16.8
'@humanwhocodes/module-importer': 1.0.1
'@humanwhocodes/retry': 0.4.3
- '@types/estree': 1.0.8
+ '@types/estree': 1.0.9
ajv: 6.15.0
cross-spawn: 7.0.6
debug: 4.4.3
@@ -24734,7 +26036,7 @@ snapshots:
- supports-color
- typescript
- [email protected](64405165466fe33cacd7d08cae7227d6):
+ [email protected](649cbe633c4ca8372dc41cefd86e5cb2):
dependencies:
@@ -24772,7 +26074,7 @@ snapshots:
standard-navigation: 0.0.5
optionalDependencies:
react-dom: 19.2.6([email protected])
react-native-gesture-handler: 3.1.0([email protected](@babel/[email protected])(@react-native/[email protected](@babel/[email protected]))(@types/[email protected])([email protected]))([email protected])
@@ -25092,11 +26394,13 @@ snapshots:
dependencies:
- flatted: 3.4.2
+ flatted: 3.4.3
keyv: 4.5.4
+
@@ -25120,7 +26424,7 @@ snapshots:
asynckit: 0.4.0
combined-stream: 1.0.8
es-set-tostringtag: 2.1.0
- hasown: 2.0.2
+ hasown: 2.0.4
mime-types: 2.1.35
@@ -25164,6 +26468,13 @@ snapshots:
jsonfile: 6.2.0
universalify: 2.0.1
+ dependencies:
+ graceful-fs: 4.2.11
+ jsonfile: 6.2.1
+ universalify: 2.0.1
+ optional: true
+
dependencies:
graceful-fs: 4.2.11
@@ -25231,7 +26542,7 @@ snapshots:
get-proto: 1.0.1
gopd: 1.2.0
has-symbols: 1.1.0
- hasown: 2.0.2
+ hasown: 2.0.4
math-intrinsics: 1.1.0
@@ -25420,6 +26731,10 @@ snapshots:
dependencies:
function-bind: 1.1.2
+ dependencies:
+ function-bind: 1.1.2
+
dependencies:
'@types/hast': 3.0.4
@@ -25695,11 +27010,10 @@ snapshots:
parent-module: 1.0.1
resolve-from: 4.0.0
dependencies:
- acorn: 8.17.0
- acorn-import-attributes: 1.9.5([email protected])
cjs-module-lexer: 2.2.0
+ es-module-lexer: 2.3.1
module-details-from-path: 1.0.4
@@ -25739,7 +27053,7 @@ snapshots:
cli-cursor: 4.0.0
cli-truncate: 6.1.1
code-excerpt: 4.0.0
- es-toolkit: 1.49.0
+ es-toolkit: 1.50.0
indent-string: 5.0.0
is-in-ci: 2.0.0
patch-console: 2.0.0
@@ -25749,9 +27063,9 @@ snapshots:
signal-exit: 3.0.7
slice-ansi: 9.0.0
stack-utils: 2.0.6
- string-width: 8.2.1
+ string-width: 8.2.2
terminal-size: 4.0.1
- type-fest: 5.6.0
+ type-fest: 5.8.0
widest-line: 6.0.0
wrap-ansi: 10.0.0
ws: 8.21.0
@@ -25806,6 +27120,10 @@ snapshots:
dependencies:
hasown: 2.0.2
+ dependencies:
+ hasown: 2.0.4
+
@@ -26007,15 +27325,15 @@ snapshots:
- babel-plugin-macros
- supports-color
dependencies:
- '@jest/core': 30.4.2([email protected]([email protected]))
+ '@jest/core': 30.4.2([email protected]([email protected]))
'@jest/test-result': 30.4.1
'@jest/types': 30.4.1
chalk: 4.1.2
exit-x: 0.2.2
import-local: 3.2.0
jest-util: 30.4.1
jest-validate: 30.4.1
yargs: 17.7.2
@@ -26026,15 +27344,15 @@ snapshots:
- supports-color
- ts-node
dependencies:
- '@jest/core': 30.4.2([email protected]([email protected]))
+ '@jest/core': 30.4.2([email protected]([email protected]))
'@jest/test-result': 30.4.1
'@jest/types': 30.4.1
chalk: 4.1.2
exit-x: 0.2.2
import-local: 3.2.0
jest-util: 30.4.1
jest-validate: 30.4.1
yargs: 17.7.2
@@ -26046,7 +27364,7 @@ snapshots:
- ts-node
optional: true
dependencies:
'@babel/core': 7.29.0
'@jest/get-type': 30.1.0
@@ -26073,12 +27391,12 @@ snapshots:
strip-json-comments: 3.1.1
optionalDependencies:
'@types/node': 24.12.0
- esbuild-register: 3.6.0([email protected])
+ esbuild-register: 3.6.0([email protected])
transitivePeerDependencies:
- babel-plugin-macros
- supports-color
dependencies:
'@babel/core': 7.29.0
'@jest/get-type': 30.1.0
@@ -26105,7 +27423,7 @@ snapshots:
strip-json-comments: 3.1.1
optionalDependencies:
'@types/node': 25.2.0
- esbuild-register: 3.6.0([email protected])
+ esbuild-register: 3.6.0([email protected])
transitivePeerDependencies:
- babel-plugin-macros
- supports-color
@@ -26157,7 +27475,7 @@ snapshots:
optionalDependencies:
fsevents: 2.3.3
dependencies:
chalk: 4.1.2
get-stdin: 5.0.1
@@ -26167,7 +27485,7 @@ snapshots:
pngjs: 3.4.0
ssim.js: 3.5.0
optionalDependencies:
dependencies:
@@ -26334,7 +27652,7 @@ snapshots:
dependencies:
'@jest/types': 29.6.3
- '@types/node': 24.12.0
+ '@types/node': 24.13.3
chalk: 4.1.2
ci-info: 3.9.0
graceful-fs: 4.2.11
@@ -26367,11 +27685,11 @@ snapshots:
leven: 3.1.0
pretty-format: 30.4.1
dependencies:
ansi-escapes: 7.2.0
chalk: 5.6.2
jest-regex-util: 30.4.0
jest-watcher: 30.4.1
slash: 5.1.0
@@ -26391,14 +27709,14 @@ snapshots:
dependencies:
- '@types/node': 24.12.0
+ '@types/node': 24.13.3
merge-stream: 2.0.0
supports-color: 8.1.1
optional: true
dependencies:
- '@types/node': 24.12.0
+ '@types/node': 24.13.3
jest-util: 29.7.0
merge-stream: 2.0.0
supports-color: 8.1.1
@@ -26411,12 +27729,12 @@ snapshots:
merge-stream: 2.0.0
supports-color: 8.1.1
dependencies:
- '@jest/core': 30.4.2([email protected]([email protected]))
+ '@jest/core': 30.4.2([email protected]([email protected]))
'@jest/types': 30.4.1
import-local: 3.2.0
transitivePeerDependencies:
- '@types/node'
- babel-plugin-macros
@@ -26424,12 +27742,12 @@ snapshots:
- supports-color
- ts-node
dependencies:
- '@jest/core': 30.4.2([email protected]([email protected]))
+ '@jest/core': 30.4.2([email protected]([email protected]))
'@jest/types': 30.4.1
import-local: 3.2.0
transitivePeerDependencies:
- '@types/node'
- babel-plugin-macros
@@ -26576,6 +27894,13 @@ snapshots:
optionalDependencies:
graceful-fs: 4.2.11
+ dependencies:
+ universalify: 2.0.1
+ optionalDependencies:
+ graceful-fs: 4.2.11
+ optional: true
+
dependencies:
jws: 4.0.1
@@ -26778,7 +28103,7 @@ snapshots:
optional: true
@@ -27251,7 +28576,7 @@ snapshots:
dependencies:
- '@babel/code-frame': 7.29.0
+ '@babel/code-frame': 7.29.7
'@babel/core': 7.29.0
'@babel/generator': 7.29.1
'@babel/parser': 7.29.7
@@ -27700,6 +29025,8 @@ snapshots:
+
@@ -27770,7 +29097,7 @@ snapshots:
nopt: 9.0.0
proc-log: 6.1.0
semver: 7.8.4
- tar: 7.5.21
+ tar: 7.5.22
tinyglobby: 0.2.15
undici: 8.5.0
which: 6.0.1
@@ -27789,6 +29116,8 @@ snapshots:
+
dependencies:
abbrev: 4.0.0
@@ -27987,7 +29316,7 @@ snapshots:
is-unicode-supported: 2.1.0
log-symbols: 7.0.1
stdin-discarder: 0.3.2
- string-width: 8.2.1
+ string-width: 8.2.2
@@ -28166,7 +29495,7 @@ snapshots:
dependencies:
- '@typescript-eslint/types': 8.62.0
+ '@typescript-eslint/types': 8.65.0
eslint-scope: 9.1.2
eslint-visitor-keys: 5.0.1
oxc-parser: 0.141.0
@@ -28233,7 +29562,7 @@ snapshots:
@@ -28448,21 +29777,21 @@ snapshots:
tsx: 4.22.4
yaml: 2.9.0
dependencies:
lilconfig: 3.1.3
optionalDependencies:
jiti: 2.7.0
- postcss: 8.5.15
+ postcss: 8.5.23
tsx: 4.21.0
yaml: 2.9.0
dependencies:
lilconfig: 3.1.3
optionalDependencies:
jiti: 2.7.0
- postcss: 8.5.15
+ postcss: 8.5.23
tsx: 4.22.4
yaml: 2.9.0
@@ -28489,6 +29818,12 @@ snapshots:
picocolors: 1.1.1
source-map-js: 1.2.1
+ dependencies:
+ nanoid: 3.3.16
+ picocolors: 1.1.1
+ source-map-js: 1.2.1
+
dependencies:
'@posthog/core': 1.32.5
@@ -28574,7 +29909,7 @@ snapshots:
'@jest/schemas': 30.4.1
ansi-styles: 5.2.0
react-is-18: [email protected]
- react-is-19: [email protected]
+ react-is-19: [email protected]
dependencies:
@@ -28738,7 +30073,7 @@ snapshots:
'@protobufjs/path': 1.1.2
'@protobufjs/pool': 1.1.0
'@protobufjs/utf8': 1.1.2
- '@types/node': 24.12.0
+ '@types/node': 24.13.3
long: 5.3.2
@@ -28897,10 +30232,10 @@ snapshots:
transitivePeerDependencies:
- supports-color
dependencies:
- '@babel/code-frame': 7.29.0
- '@sentry/node': 10.61.0(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))
+ '@babel/code-frame': 7.29.7
+ '@sentry/node': 10.68.0(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))
agent-install: 0.0.5
conf: 15.1.0
confbox: 0.2.4
@@ -28963,6 +30298,8 @@ snapshots:
+
dependencies:
'@types/hast': 3.0.4
@@ -29200,23 +30537,23 @@ snapshots:
react: 19.2.6
react-dom: 19.2.6([email protected])
dependencies:
'@babel/core': 7.29.0
'@babel/types': 7.29.7
'@preact/signals': 2.9.2([email protected])
- '@rollup/pluginutils': 5.3.0([email protected])
+ '@rollup/pluginutils': 5.3.0([email protected])
bippy: 0.5.42([email protected])
commander: 14.0.3
picocolors: 1.1.1
preact: 10.29.2
prompts: 2.4.2
react: 19.2.6
- react-doctor: 0.9.1(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])
+ react-doctor: 0.9.1(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])
react-dom: 19.2.6([email protected])
react-grab: 0.1.50([email protected])
optionalDependencies:
- esbuild: 0.27.2
+ esbuild: 0.27.7
unplugin: 3.0.0
transitivePeerDependencies:
- '@opentelemetry/core'
@@ -29436,6 +30773,13 @@ snapshots:
path-parse: 1.0.7
supports-preserve-symlinks-flag: 1.0.0
+ dependencies:
+ es-errors: 1.3.0
+ is-core-module: 2.16.2
+ path-parse: 1.0.7
+ supports-preserve-symlinks-flag: 1.0.0
+
dependencies:
lowercase-keys: 2.0.0
@@ -29483,7 +30827,7 @@ snapshots:
sprintf-js: 1.1.3
optional: true
dependencies:
'@oxc-project/runtime': 0.101.0
fdir: 6.5.0([email protected])
@@ -29494,7 +30838,7 @@ snapshots:
tinyglobby: 0.2.15
optionalDependencies:
'@types/node': 24.12.0
- esbuild: 0.27.2
+ esbuild: 0.27.7
fsevents: 2.3.3
jiti: 2.7.0
terser: 5.46.0
@@ -29504,7 +30848,7 @@ snapshots:
- '@emnapi/core'
- '@emnapi/runtime'
dependencies:
'@oxc-project/runtime': 0.101.0
fdir: 6.5.0([email protected])
@@ -29515,7 +30859,7 @@ snapshots:
tinyglobby: 0.2.15
optionalDependencies:
'@types/node': 25.2.0
- esbuild: 0.27.2
+ esbuild: 0.27.7
fsevents: 2.3.3
jiti: 1.21.7
terser: 5.46.0
@@ -29525,7 +30869,7 @@ snapshots:
- '@emnapi/core'
- '@emnapi/runtime'
dependencies:
'@oxc-project/runtime': 0.101.0
fdir: 6.5.0([email protected])
@@ -29536,7 +30880,7 @@ snapshots:
tinyglobby: 0.2.15
optionalDependencies:
'@types/node': 25.2.0
- esbuild: 0.27.2
+ esbuild: 0.27.7
fsevents: 2.3.3
jiti: 2.7.0
terser: 5.46.0
@@ -29599,6 +30943,37 @@ snapshots:
'@rollup/rollup-win32-x64-msvc': 4.59.0
fsevents: 2.3.3
+ dependencies:
+ '@types/estree': 1.0.9
+ optionalDependencies:
+ '@rollup/rollup-android-arm-eabi': 4.62.2
+ '@rollup/rollup-android-arm64': 4.62.2
+ '@rollup/rollup-darwin-arm64': 4.62.2
+ '@rollup/rollup-darwin-x64': 4.62.2
+ '@rollup/rollup-freebsd-arm64': 4.62.2
+ '@rollup/rollup-freebsd-x64': 4.62.2
+ '@rollup/rollup-linux-arm-gnueabihf': 4.62.2
+ '@rollup/rollup-linux-arm-musleabihf': 4.62.2
+ '@rollup/rollup-linux-arm64-gnu': 4.62.2
+ '@rollup/rollup-linux-arm64-musl': 4.62.2
+ '@rollup/rollup-linux-loong64-gnu': 4.62.2
+ '@rollup/rollup-linux-loong64-musl': 4.62.2
+ '@rollup/rollup-linux-ppc64-gnu': 4.62.2
+ '@rollup/rollup-linux-ppc64-musl': 4.62.2
+ '@rollup/rollup-linux-riscv64-gnu': 4.62.2
+ '@rollup/rollup-linux-riscv64-musl': 4.62.2
+ '@rollup/rollup-linux-s390x-gnu': 4.62.2
+ '@rollup/rollup-linux-x64-gnu': 4.62.2
+ '@rollup/rollup-linux-x64-musl': 4.62.2
+ '@rollup/rollup-openbsd-x64': 4.62.2
+ '@rollup/rollup-openharmony-arm64': 4.62.2
+ '@rollup/rollup-win32-arm64-msvc': 4.62.2
+ '@rollup/rollup-win32-ia32-msvc': 4.62.2
+ '@rollup/rollup-win32-x64-gnu': 4.62.2
+ '@rollup/rollup-win32-x64-msvc': 4.62.2
+ fsevents: 2.3.3
+
@@ -29709,15 +31084,20 @@ snapshots:
type-fest: 0.13.1
optional: true
- optional: true
-
dependencies:
seroval: 1.5.4
+ dependencies:
+ seroval: 1.5.6
+ optional: true
+
+ optional: true
+
dependencies:
encodeurl: 2.0.0
@@ -29919,8 +31299,8 @@ snapshots:
dependencies:
csstype: 3.2.3
- seroval: 1.5.4
- seroval-plugins: 1.5.4([email protected])
+ seroval: 1.5.6
+ seroval-plugins: 1.5.6([email protected])
optional: true
@@ -30055,7 +31435,7 @@ snapshots:
dependencies:
eastasianwidth: 0.2.0
emoji-regex: 9.2.2
- strip-ansi: 7.1.2
+ strip-ansi: 7.2.0
dependencies:
@@ -30063,10 +31443,10 @@ snapshots:
get-east-asian-width: 1.6.0
strip-ansi: 7.1.2
dependencies:
get-east-asian-width: 1.6.0
- strip-ansi: 7.1.2
+ strip-ansi: 7.2.0
dependencies:
@@ -30099,6 +31479,10 @@ snapshots:
dependencies:
ansi-regex: 6.2.2
+ dependencies:
+ ansi-regex: 6.2.2
+
@@ -30269,7 +31653,7 @@ snapshots:
inherits: 2.0.4
readable-stream: 3.6.2
dependencies:
'@isaacs/fs-minipass': 4.0.1
chownr: 3.0.0
@@ -30294,29 +31678,28 @@ snapshots:
dependencies:
'@jridgewell/trace-mapping': 0.3.31
jest-worker: 27.5.1
schema-utils: 4.3.3
- serialize-javascript: 7.0.5
terser: 5.46.0
- webpack: 5.105.0(@swc/[email protected])([email protected])
optionalDependencies:
'@swc/core': 1.15.43
- esbuild: 0.27.2
+ esbuild: 0.27.7
+ postcss: 8.5.15
optional: true
dependencies:
'@jridgewell/trace-mapping': 0.3.31
jest-worker: 27.5.1
schema-utils: 4.3.3
- serialize-javascript: 7.0.5
terser: 5.46.0
- webpack: 5.105.0([email protected])
+ webpack: 5.105.0([email protected])
optionalDependencies:
- esbuild: 0.27.2
+ esbuild: 0.27.7
optional: true
@@ -30371,6 +31754,11 @@ snapshots:
fdir: 6.5.0([email protected])
picomatch: 4.0.3
+ dependencies:
+ fdir: 6.5.0([email protected])
+ picomatch: 4.0.5
+
@@ -30476,7 +31864,7 @@ snapshots:
dependencies:
bundle-require: 5.1.0([email protected])
cac: 6.7.14
@@ -30487,7 +31875,7 @@ snapshots:
fix-dts-default-cjs-exports: 1.0.1
joycon: 3.1.1
picocolors: 1.1.1
resolve-from: 5.0.0
rollup: 4.59.0
source-map: 0.7.6
@@ -30497,7 +31885,7 @@ snapshots:
tree-kill: 1.2.2
optionalDependencies:
'@swc/core': 1.15.43
- postcss: 8.5.15
+ postcss: 8.5.23
typescript: 5.9.3
transitivePeerDependencies:
- jiti
@@ -30505,7 +31893,7 @@ snapshots:
- tsx
- yaml
dependencies:
bundle-require: 5.1.0([email protected])
cac: 6.7.14
@@ -30516,7 +31904,7 @@ snapshots:
fix-dts-default-cjs-exports: 1.0.1
joycon: 3.1.1
picocolors: 1.1.1
resolve-from: 5.0.0
rollup: 4.59.0
source-map: 0.7.6
@@ -30526,7 +31914,7 @@ snapshots:
tree-kill: 1.2.2
optionalDependencies:
'@swc/core': 1.15.43
- postcss: 8.5.15
+ postcss: 8.5.23
typescript: 5.9.3
transitivePeerDependencies:
- jiti
@@ -30534,7 +31922,7 @@ snapshots:
- tsx
- yaml
dependencies:
bundle-require: 5.1.0([email protected])
cac: 6.7.14
@@ -30545,7 +31933,7 @@ snapshots:
fix-dts-default-cjs-exports: 1.0.1
joycon: 3.1.1
picocolors: 1.1.1
resolve-from: 5.0.0
rollup: 4.59.0
source-map: 0.7.6
@@ -30555,7 +31943,7 @@ snapshots:
tree-kill: 1.2.2
optionalDependencies:
'@swc/core': 1.15.43
- postcss: 8.5.15
+ postcss: 8.5.23
typescript: 6.0.3
transitivePeerDependencies:
- jiti
@@ -30620,13 +32008,17 @@ snapshots:
dependencies:
tagged-tag: 1.0.0
+ dependencies:
+ tagged-tag: 1.0.0
+
dependencies:
content-type: 1.0.5
media-typer: 1.1.0
mime-types: 3.0.2
dependencies:
@@ -30667,6 +32059,8 @@ snapshots:
+
optional: true
@@ -30784,6 +32178,12 @@ snapshots:
escalade: 3.2.0
picocolors: 1.1.1
+ dependencies:
+ browserslist: 4.28.7
+ escalade: 3.2.0
+ picocolors: 1.1.1
+
dependencies:
punycode: 2.3.1
@@ -30873,24 +32273,24 @@ snapshots:
react-dom: 19.2.6([email protected])
solid-js: 1.9.13
dependencies:
debug: 4.4.3
globrex: 0.1.2
tsconfck: 3.1.6([email protected])
transitivePeerDependencies:
- supports-color
- typescript
dependencies:
- esbuild: 0.27.2
+ esbuild: 0.27.7
fdir: 6.5.0([email protected])
picomatch: 4.0.5
- postcss: 8.5.15
+ postcss: 8.5.23
rollup: 4.59.0
- tinyglobby: 0.2.15
+ tinyglobby: 0.2.17
optionalDependencies:
'@types/node': 20.19.41
fsevents: 2.3.3
@@ -30902,12 +32302,12 @@ snapshots:
dependencies:
- esbuild: 0.27.2
+ esbuild: 0.27.7
fdir: 6.5.0([email protected])
picomatch: 4.0.5
- postcss: 8.5.15
+ postcss: 8.5.23
rollup: 4.59.0
- tinyglobby: 0.2.15
+ tinyglobby: 0.2.17
optionalDependencies:
'@types/node': 22.20.0
fsevents: 2.3.3
@@ -30919,12 +32319,12 @@ snapshots:
dependencies:
- esbuild: 0.27.2
+ esbuild: 0.27.7
fdir: 6.5.0([email protected])
picomatch: 4.0.5
- postcss: 8.5.15
+ postcss: 8.5.23
rollup: 4.59.0
- tinyglobby: 0.2.15
+ tinyglobby: 0.2.17
optionalDependencies:
'@types/node': 25.2.0
fsevents: 2.3.3
@@ -30936,12 +32336,12 @@ snapshots:
dependencies:
- esbuild: 0.27.2
+ esbuild: 0.27.7
fdir: 6.5.0([email protected])
picomatch: 4.0.5
- postcss: 8.5.15
+ postcss: 8.5.23
rollup: 4.59.0
- tinyglobby: 0.2.15
+ tinyglobby: 0.2.17
optionalDependencies:
'@types/node': 25.2.0
fsevents: 2.3.3
@@ -30951,10 +32351,10 @@ snapshots:
tsx: 4.22.4
yaml: 2.9.0
dependencies:
'@vitest/expect': 4.1.6
'@vitest/pretty-format': 4.1.6
'@vitest/runner': 4.1.6
'@vitest/snapshot': 4.1.6
@@ -30971,7 +32371,7 @@ snapshots:
tinyexec: 1.0.2
tinyglobby: 0.2.15
tinyrainbow: 3.1.0
why-is-node-running: 2.3.0
optionalDependencies:
'@opentelemetry/api': 1.9.1
@@ -31040,10 +32440,10 @@ snapshots:
transitivePeerDependencies:
- msw
dependencies:
'@vitest/expect': 4.1.8
'@vitest/pretty-format': 4.1.8
'@vitest/runner': 4.1.8
'@vitest/snapshot': 4.1.8
@@ -31060,7 +32460,7 @@ snapshots:
tinyexec: 1.0.2
tinyglobby: 0.2.15
tinyrainbow: 3.1.0
why-is-node-running: 2.3.0
optionalDependencies:
'@opentelemetry/api': 1.9.1
@@ -31071,10 +32471,10 @@ snapshots:
transitivePeerDependencies:
- msw
dependencies:
'@vitest/expect': 4.1.8
'@vitest/pretty-format': 4.1.8
'@vitest/runner': 4.1.8
'@vitest/snapshot': 4.1.8
@@ -31091,7 +32491,7 @@ snapshots:
tinyexec: 1.0.2
tinyglobby: 0.2.15
tinyrainbow: 3.1.0
why-is-node-running: 2.3.0
optionalDependencies:
'@opentelemetry/api': 1.9.1
@@ -31217,9 +32617,8 @@ snapshots:
dependencies:
- glob-to-regexp: 0.4.1
graceful-fs: 4.2.11
optional: true
@@ -31247,74 +32646,92 @@ snapshots:
optional: true
dependencies:
'@types/eslint-scope': 3.7.7
- '@types/estree': 1.0.8
+ '@types/estree': 1.0.9
'@types/json-schema': 7.0.15
'@webassemblyjs/ast': 1.14.1
'@webassemblyjs/wasm-edit': 1.14.1
'@webassemblyjs/wasm-parser': 1.14.1
acorn: 8.17.0
acorn-import-phases: 1.0.4([email protected])
- browserslist: 4.28.1
+ browserslist: 4.28.7
chrome-trace-event: 1.0.4
- enhanced-resolve: 5.21.6
- es-module-lexer: 2.1.0
+ enhanced-resolve: 5.24.3
+ es-module-lexer: 2.3.1
eslint-scope: 5.1.1
events: 3.3.0
glob-to-regexp: 0.4.1
graceful-fs: 4.2.11
json-parse-even-better-errors: 2.3.1
- loader-runner: 4.3.1
+ loader-runner: 4.3.2
mime-types: 2.1.35
neo-async: 2.6.2
schema-utils: 4.3.3
tapable: 2.3.3
- watchpack: 2.5.1
- webpack-sources: 3.3.3
+ watchpack: 2.5.2
+ webpack-sources: 3.5.1
transitivePeerDependencies:
+ - '@minify-html/node'
- '@swc/core'
+ - '@swc/css'
+ - '@swc/html'
+ - clean-css
+ - cssnano
+ - csso
- esbuild
+ - html-minifier-terser
+ - lightningcss
+ - postcss
- uglify-js
optional: true
dependencies:
'@types/eslint-scope': 3.7.7
- '@types/estree': 1.0.8
+ '@types/estree': 1.0.9
'@types/json-schema': 7.0.15
'@webassemblyjs/ast': 1.14.1
'@webassemblyjs/wasm-edit': 1.14.1
'@webassemblyjs/wasm-parser': 1.14.1
acorn: 8.17.0
acorn-import-phases: 1.0.4([email protected])
- browserslist: 4.28.1
+ browserslist: 4.28.7
chrome-trace-event: 1.0.4
- enhanced-resolve: 5.21.6
- es-module-lexer: 2.1.0
+ enhanced-resolve: 5.24.3
+ es-module-lexer: 2.3.1
eslint-scope: 5.1.1
events: 3.3.0
glob-to-regexp: 0.4.1
graceful-fs: 4.2.11
json-parse-even-better-errors: 2.3.1
- loader-runner: 4.3.1
+ loader-runner: 4.3.2
mime-types: 2.1.35
neo-async: 2.6.2
schema-utils: 4.3.3
tapable: 2.3.3
- terser-webpack-plugin: 5.3.16([email protected])([email protected]([email protected]))
- watchpack: 2.5.1
- webpack-sources: 3.3.3
+ terser-webpack-plugin: 5.6.1([email protected])([email protected]([email protected]))
+ watchpack: 2.5.2
+ webpack-sources: 3.5.1
transitivePeerDependencies:
+ - '@minify-html/node'
- '@swc/core'
+ - '@swc/css'
+ - '@swc/html'
+ - clean-css
+ - cssnano
+ - csso
- esbuild
+ - html-minifier-terser
+ - lightningcss
+ - postcss
- uglify-js
optional: true
@@ -31373,15 +32790,15 @@ snapshots:
dependencies:
- string-width: 8.2.1
+ string-width: 8.2.2
dependencies:
ansi-styles: 6.2.3
- string-width: 8.2.1
- strip-ansi: 7.1.2
+ string-width: 8.2.2
+ strip-ansi: 7.2.0
dependencies:
@@ -31399,7 +32816,7 @@ snapshots:
dependencies:
ansi-styles: 6.2.3
string-width: 5.1.2
- strip-ansi: 7.1.2
+ strip-ansi: 7.2.0
dependencies:
diff --git a/products/desktop/pnpm-workspace.yaml b/products/desktop/pnpm-workspace.yaml
index 02bd4a549a1b..a072f47a1036 100644
--- a/products/desktop/pnpm-workspace.yaml
+++ b/products/desktop/pnpm-workspace.yaml
@@ -6,10 +6,10 @@ packages:
catalog:
'@hono/node-server': ^1.13.7
'@hono/trpc-server': ^0.3.4
- '@earendil-works/pi-agent-core': 0.82.1
- '@earendil-works/pi-ai': 0.82.1
- '@earendil-works/pi-coding-agent': 0.82.1
- '@earendil-works/pi-tui': 0.82.1
+ '@earendil-works/pi-agent-core': 0.83.0
+ '@earendil-works/pi-ai': 0.83.0
+ '@earendil-works/pi-coding-agent': 0.83.0
+ '@earendil-works/pi-tui': 0.83.0
'@parcel/watcher': ^2.5.6
'@phosphor-icons/react': ^2.1.10
'@posthog/quill': 0.3.0-beta.24