diff --git a/doc/cloud-browser-analytics.md b/doc/cloud-browser-analytics.md index b52a6dc4805..e9cd8427eca 100644 --- a/doc/cloud-browser-analytics.md +++ b/doc/cloud-browser-analytics.md @@ -93,27 +93,40 @@ This value is used only for location, never for limits. ## Privacy -Masking is deny by default. A surface that nobody marked stays masked. +Session replay shows text by default, the way PostHog normally works. Text is +masked only inside marked customer content. Input values and attribute values +are always masked. -- Session replay masks every input value and every text node. - `maskReplayText` in `ui/src/lib/analytics/privacy.ts` shows text only inside - elements with `ANALYTICS_UNMASK_PROPS`: sidebar items whose label is a fixed - string, and a shared `Button`, `Label`, `TabsTrigger` or `EmptyState` only - when its caller passes `analyticsChrome`. None of them opts in by default, - because they also render customer text such as agent names and titles. +- Session replay masks every input value (`maskAllInputs`). +- Replay masks text only inside these markers (`ANALYTICS_MASK_TEXT_SELECTOR` + in `ui/src/lib/analytics/privacy.ts`, passed as rrweb `maskTextSelector`): + - `ANALYTICS_MASK_CLASS` (`ph-mask ph-sensitive`): customer content. + - `ANALYTICS_NO_CAPTURE_CLASS` (`ph-no-capture`): secrets. Replay blocks + these elements entirely. + - `contenteditable` editors (not `contenteditable="false"`). + + rrweb masks a text node only when its parent matches the selector or has an + ancestor that matches it. All other text, for example navigation, headings, + buttons, task titles, agent names, project names and company names, is + recorded as it is. - Replay also masks attribute values (`maskReplayAttribute`): only layout attributes (`class`, `style`, `role`, `data-state`, SVG geometry and similar), rrweb metadata and stylesheet links keep their values. `title`, `aria-label`, `alt`, `placeholder`, `src`, `href`, `data-*` values and - element references (`id`, `for`, `aria-labelledby`) are always masked, even on unmasked chrome, so images record as empty boxes and - link targets (for example download links with file paths) never leave. -- `ANALYTICS_MASK_CLASS` keeps customer content masked even inside unmasked - chrome: rendered markdown (task bodies, comments, chat messages, documents), - task and issue chat threads, the comment timeline, the rich editor and the - file viewer. Text in a `contenteditable` editor is always masked. + element references (`id`, `for`, `aria-labelledby`) are always masked, so + images record as empty boxes and link targets (for example download links + with file paths) never leave. +- The masking options in `posthog.init` take precedence over the PostHog + project's "Privacy and masking" settings (posthog-js 1.450). posthog-js + ignores the project setting and logs a warning when the two differ. Keep the + project masking settings empty, and change masking only in `privacy.ts`. The + `ph-mask` class is also the posthog-js default `maskTextClass`. - `ANALYTICS_NO_CAPTURE_CLASS` replaces secrets with a blank box in replays: - every password-type `Input`, environment variable values and new secret - values. + every password-type `Input`, environment variable values, new secret + values, and secrets shown as text: one-time sign-in and device codes, + pairing and setup prompts, identity confirmation links, newly issued API + keys and gateway tokens, gateway client snippets, webhook URLs and secrets, + invite claim secrets, raw provider frames and SSH fallback commands. - Every event and replay meta event goes through `scrubCapturedEvent` (`before_send`). Every URL keeps only its origin and path: query and hash values never leave, because they can hold credentials, file paths or search @@ -125,11 +138,72 @@ Masking is deny by default. A surface that nobody marked stays masked. - Autocapture never records element text or attribute values (`mask_all_text`, `mask_all_element_attributes`). It keeps the click, the element tree and the page. -- Connected-account content (Gmail bodies, Calendar events, Slack messages - in tasks, chat, tool results and previews) is Google user data or Slack - data. No human may read it in a replay (Google API Limited Use). It is never - inside the unmask allowlist, and autocapture records no element text at all. - `ui/src/lib/analytics/unmask-allowlist.test.ts` pins the allowlist: a new - unmask needs a reviewed entry there. +- Connected-account content is Google user data or Slack data. No human may + read it in a replay (privacy policy and Google API Limited Use). The + surfaces below, and other free-form text that agents or customers write, + carry `ANALYTICS_MASK_CLASS` on their content element (not on the chrome + around it): + - Rendered markdown (task bodies, comments, chat messages, documents), the + rich editor, task and issue chat threads (messages, tool calls, tool + results, interaction cards), the comment timeline and the file viewer. + - Link preview cards, task quicklook descriptions, external object pills and + rows, and related-work titles. + - Email message cards and email send intents. + - Connection names, connected account names, aliases and email addresses + (Browse rows and the remove dialog, Connections, app detail headers, the + app sidebar, connection choice lists and instructions, aggregator and + Composio account dialogs, Tailscale networks, agent tool and audit + tables, AI connection names, pickers, selects, account details and + controls, pool run details, subscription and quota panels, adapter + sign-in status, connection access and repair cards), GitHub logins + (identity rows, bot people, chat setup, run identity history) and + repositories, Slack workspace names (list and selected value), Slack + account pickers, chat channels, linked user labels, the external task + banner and chat identity pages. + - Connection and account management surfaces are masked by section, not + label by label: the Browse connector list, the App detail body below its + header, the Connections table, Tailscale networks, the chat connection + detail body and its account subtitle, GitHub chat setup, the AI + connection pool editor and the chat identity confirmation. Every dialog, + alert dialog, select (trigger and list), popover, dropdown, sheet and + tooltip under `pages/apps`, `features/connections` and + `components/ai-connections` carries its own mask, because portals escape + the page's masked container; `replay-masking.test.tsx` fails when one + does not. + - App action test results (parsed preview and raw response). + - Inbox and decision rows (subject and detail line), obligation evidence, + Needs You notes and receipts, decision cards and compact decisions, + decision records, and interaction cards (questions, options, answers, + tool action requests, suggested tasks) wherever they render. + - Approval payloads, action card input and reason, recovery card headline, + evidence and options, run ledger retry details and interrupt handoff + previews. + - Run transcripts, run failure details, run events, run stdout and stderr + excerpts (agent page and execution workspace operations), the run + invocation command, notes, prompt, context and environment, Runner + inspector frames, and every preformatted block that shows run output, + tool or webhook payloads, request or response bodies, instructions, + skills or package files. + - Saved connection instructions for agents. + - Document and case revision diffs. + - Search result snippets, toasts (title and body), voice and call + transcripts, case summaries, files and fields, attachment previews and + artifact previews (text, tables, patches and documents). + + Component tests render these surfaces with distinctive fixture text and + assert, through `ui/src/lib/analytics/replay-recording.test-utils.ts`, that + the text is rendered but not recorded (or is blocked, for secrets), + including alternate branches, dialog portals and selected values in + closed pickers. `ui/src/lib/analytics/replay-masking.test.tsx` also pins + the remaining surfaces at source level. A new surface that shows + connected-account content needs the class and a test. +- Residual risk: text that the owner accepted as visible can still hold + customer words. Task titles, agent names, project names, company names, + routine names, artifact and document titles, and activity rows (which name + the task or entity) are recorded as they are. Paperclip member names and + email addresses on member, access and profile pages are recorded too. An + agent can copy email or Slack text into a task title. Masking is opt-in per + surface, so a new surface that renders connected-account content without + the class is recorded until somebody marks it. - The UI never captures an event that the server already sends (`PAPERCLIP_EVENTS`); `product-analytics-events.test.ts` enforces this. diff --git a/ui/src/components/AccountQuotaPanels.test.tsx b/ui/src/components/AccountQuotaPanels.test.tsx new file mode 100644 index 00000000000..b3b77d33fb1 --- /dev/null +++ b/ui/src/components/AccountQuotaPanels.test.tsx @@ -0,0 +1,16 @@ +// @vitest-environment jsdom +import { renderToStaticMarkup } from "react-dom/server"; +import { afterEach, expect, it } from "vitest"; +import { AccountQuotaPanels } from "./AccountQuotaPanels"; +import { replayLeaks } from "@/lib/analytics/replay-recording.test-utils"; + +afterEach(() => { document.body.innerHTML = ""; }); + +it("masks the subscription account label in session replay", () => { + document.body.innerHTML = renderToStaticMarkup(); + expect(replayLeaks("fenwick.oriel@example.test")).toEqual({ rendered: true, recorded: false }); + expect(replayLeaks("Weekly limit")).toEqual({ rendered: true, recorded: true }); +}); diff --git a/ui/src/components/AccountQuotaPanels.tsx b/ui/src/components/AccountQuotaPanels.tsx index 6bea5dcd88e..b36d1a59a5d 100644 --- a/ui/src/components/AccountQuotaPanels.tsx +++ b/ui/src/components/AccountQuotaPanels.tsx @@ -2,6 +2,8 @@ import type { ProviderQuotaResult } from "@paperclipai/shared"; import { formatDateTime } from "../lib/utils"; import { QuotaBar } from "./QuotaBar"; import { quotaUnavailableMessage } from "../lib/quota-refresh"; +import { ANALYTICS_MASK_CLASS } from "@/lib/analytics/privacy"; +import { cn } from "@/lib/utils"; export function AccountQuotaPanels({ accounts, @@ -17,7 +19,7 @@ export function AccountQuotaPanels({ className="space-y-2" key={account.accountKey ?? account.provider} > -

+

{account.accountLabel ?? "Subscription account"}

{(failed || !account.ok) && ( diff --git a/ui/src/components/AdapterLoginChrome.test.tsx b/ui/src/components/AdapterLoginChrome.test.tsx index 8a2008e7f1f..4bde12d3ac1 100644 --- a/ui/src/components/AdapterLoginChrome.test.tsx +++ b/ui/src/components/AdapterLoginChrome.test.tsx @@ -6,11 +6,13 @@ import { afterEach, describe, expect, it, vi } from "vitest"; import type React from "react"; import { + LocalProviderLoginInstructions, OnboardingLoginCard, OnboardingCardField, OnboardingLoginCodeRow, onboardingCardInputClass, } from "./AdapterLoginChrome"; +import { isBlockedFromReplay, replayLeaks } from "@/lib/analytics/replay-recording.test-utils"; /** * The connect step's canvas holds one of two cards, and the credential switch @@ -253,3 +255,27 @@ describe("the displayed code's auto-copy", () => { } }); }); + +describe("session replay", () => { + const login = { preparing: false, error: null, retry: vi.fn() }; + + it("blocks the one-time login code", async () => { + await render(); + expect(isBlockedFromReplay("QZRT-77XKV", document.body)).toBe(true); + }); + + it("blocks the displayed device code in the provider sign-in card", async () => { + await render(); + expect(isBlockedFromReplay("MNPL-48WQD", document.body)).toBe(true); + }); + + it("blocks the terminal sign-in command", async () => { + await render(); + expect(isBlockedFromReplay("grok login --token-hint vexmoor-9182", document.body)).toBe(true); + }); + + it("masks the signed-in account label", async () => { + await render(); + expect(replayLeaks("hollis.brennan@example.test", document.body)).toEqual({ rendered: true, recorded: false }); + }); +}); diff --git a/ui/src/components/AdapterLoginChrome.tsx b/ui/src/components/AdapterLoginChrome.tsx index a1d9031a126..5d0d7e55d9f 100644 --- a/ui/src/components/AdapterLoginChrome.tsx +++ b/ui/src/components/AdapterLoginChrome.tsx @@ -12,6 +12,8 @@ import { COPIED_REVEAL_DELAY_MS, COPIED_REVEAL_TRAVEL, } from "./onboarding/onboarding-motion"; +import { ANALYTICS_MASK_CLASS, ANALYTICS_NO_CAPTURE_CLASS } from "@/lib/analytics/privacy"; +import { cn } from "@/lib/utils"; /** * Which shell a login panel draws itself in. @@ -293,7 +295,7 @@ export function OnboardingLoginCodeRow({ return (
- + {code} @@ -515,7 +517,7 @@ export function LocalProviderLoginInstructions({ adapterType, login }: { const ready = login?.status === "ready"; return
{ready ? <> -

{login?.accountLabel ?? provider} is signed in. Click Connect to use this account.

+

{login?.accountLabel ?? provider} is signed in. Click Connect to use this account.

{!showCommand && } : !browserLogin &&

{isolated ? `Sign in to ${provider} for this connection on the machine running Paperclip. Your existing terminal login stays separate.` : `Connect uses your local ${provider} account on the machine running Paperclip.`}

} {browserLogin && !ready && !login?.authorizationUrl && !login?.error &&

Preparing browser sign-in…

} @@ -537,7 +539,7 @@ export function LocalProviderLoginInstructions({ adapterType, login }: { {!browserLogin && (!ready || showCommand) && !login?.error && <>

Run this in a terminal on that machine and finish signing in in your browser. We’ll check automatically when you return.

{command &&
-
{command}
+
{command}
} } diff --git a/ui/src/components/AgentConfigForm.render.test.tsx b/ui/src/components/AgentConfigForm.render.test.tsx index c6954b204b9..7a617f27211 100644 --- a/ui/src/components/AgentConfigForm.render.test.tsx +++ b/ui/src/components/AgentConfigForm.render.test.tsx @@ -13,6 +13,7 @@ import { ToastProvider } from "../context/ToastContext"; import { AgentConfigForm, AdapterLoginPanel, ModelDropdown, subtractPersistedOverlay, type AdapterLoginDescriptor } from "./AgentConfigForm"; import { AgentLifecycleStatus, useAgentLifecycleStatus } from "./AgentLifecycleStatus"; import { queryKeys } from "../lib/queryKeys"; +import { isBlockedFromReplay } from "@/lib/analytics/replay-recording.test-utils"; import { defaultCreateValues } from "./agent-config-defaults"; import { buildNewAgentHirePayload } from "../lib/new-agent-hire-payload"; import { ApiError } from "../api/client"; @@ -2439,6 +2440,17 @@ describe("AgentConfigForm environment selector", () => { expect(urlIndex).toBeGreaterThan(codeIndex); }); + it("blocks the displayed login code from session replay", async () => { + mockAgentsApi.testEnvironment.mockResolvedValue(AUTH_MISSING_RESULT); + const result = await renderCodexSandbox(); + roots.push(result.root); + + await runTest(result.container); + await startLogin(result.container); + + expect(isBlockedFromReplay("WXYZ-1234", document.body)).toBe(true); + }); + it("keeps the code and URL visible after a later poll returns no prompt", async () => { mockAgentsApi.testEnvironment.mockResolvedValue(AUTH_MISSING_RESULT); // The server delivers the one-time prompt on the first owner read only. The diff --git a/ui/src/components/AgentConfigForm.tsx b/ui/src/components/AgentConfigForm.tsx index 776423e864d..867bbaf209e 100644 --- a/ui/src/components/AgentConfigForm.tsx +++ b/ui/src/components/AgentConfigForm.tsx @@ -113,6 +113,7 @@ import { type CreateConfigValues, } from "@paperclipai/adapter-utils"; import { Badge } from "@/components/ui/badge"; +import { ANALYTICS_NO_CAPTURE_CLASS } from "@/lib/analytics/privacy"; /* ---- Props ---- */ @@ -3053,7 +3054,7 @@ function DisplayedCodeLoginPanel({
1. Code
- {prompt.code} + {prompt.code}
diff --git a/ui/src/components/AgentSetupPrompt.test.tsx b/ui/src/components/AgentSetupPrompt.test.tsx new file mode 100644 index 00000000000..66327160a0a --- /dev/null +++ b/ui/src/components/AgentSetupPrompt.test.tsx @@ -0,0 +1,32 @@ +// @vitest-environment jsdom +import { act } from "react"; +import { createRoot, type Root } from "react-dom/client"; +import { afterEach, beforeEach, expect, it, vi } from "vitest"; +import { AgentSetupPrompt } from "./AgentSetupPrompt"; +import { isBlockedFromReplay } from "@/lib/analytics/replay-recording.test-utils"; + +(globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = true; + +let root: Root; +let container: HTMLDivElement; +beforeEach(() => { + vi.stubGlobal("matchMedia", (query: string) => ({ matches: query.includes("reduce"), media: query, addEventListener: vi.fn(), removeEventListener: vi.fn(), addListener: vi.fn(), removeListener: vi.fn() })); + Object.defineProperty(navigator, "clipboard", { configurable: true, value: { writeText: vi.fn(async () => {}) } }); + container = document.createElement("div"); + document.body.append(container); + root = createRoot(container); +}); +afterEach(async () => { + await act(async () => root.unmount()); + container.remove(); + vi.unstubAllGlobals(); + Reflect.deleteProperty(navigator, "clipboard"); +}); + +it("blocks the setup prompt preview, which carries pairing tokens, from session replay", async () => { + const prompt = "Run: paperclipai pair --token pcp_pair_8f3kQz2LmWv"; + await act(async () => root.render()); + await act(async () => container.querySelector("button")!.click()); + expect(document.querySelector("pre[aria-label='Setup prompt']")).not.toBeNull(); + expect(isBlockedFromReplay("pcp_pair_8f3kQz2LmWv", document.body)).toBe(true); +}); diff --git a/ui/src/components/AgentSetupPrompt.tsx b/ui/src/components/AgentSetupPrompt.tsx index 2119b53ae26..71b15077cb9 100644 --- a/ui/src/components/AgentSetupPrompt.tsx +++ b/ui/src/components/AgentSetupPrompt.tsx @@ -8,6 +8,7 @@ import { usePrefersReducedMotion } from "@/hooks/usePrefersReducedMotion"; import { copyTextToClipboard } from "@/lib/clipboard"; import { motionMilliseconds, motionNumber } from "@/lib/onboarding-motion-tokens"; import { cn } from "@/lib/utils"; +import { ANALYTICS_NO_CAPTURE_CLASS } from "@/lib/analytics/privacy"; export interface AgentSetupPromptProps { /** The complete text to preview and copy; never truncated on the clipboard. */ @@ -244,7 +245,7 @@ export function AgentSetupPrompt({ className="agent-setup-preview resize-none rounded-lg bg-muted/50 p-3 pt-5 font-mono text-xs leading-relaxed" /> ) : ( -
{prompt}
+
{prompt}
)} diff --git a/ui/src/components/AppConnectionSidebar.tsx b/ui/src/components/AppConnectionSidebar.tsx index 7b47c716622..e146ebb930b 100644 --- a/ui/src/components/AppConnectionSidebar.tsx +++ b/ui/src/components/AppConnectionSidebar.tsx @@ -24,6 +24,8 @@ import { type AppGalleryDisplayEntry, } from "@/pages/apps/app-definition-display"; import { SidebarNavItem } from "./SidebarNavItem"; +import { ANALYTICS_MASK_CLASS } from "@/lib/analytics/privacy"; +import { cn } from "@/lib/utils"; type AppDetailSidebarProps = | { kind: "connection"; connectionId: string } @@ -103,7 +105,7 @@ export function AppDetailSidebar(props: AppDetailSidebarProps) { darkLogoUrl={appDefinitionDarkLogoUrl(logoEntry)} size={28} /> - {appName} + {appName} diff --git a/ui/src/components/ApprovalPayload.tsx b/ui/src/components/ApprovalPayload.tsx index 6f8f9752d84..846c628607c 100644 --- a/ui/src/components/ApprovalPayload.tsx +++ b/ui/src/components/ApprovalPayload.tsx @@ -1,6 +1,8 @@ import { UserPlus, Lightbulb, ShieldAlert, ShieldCheck } from "lucide-react"; import { MarkdownBody } from "./MarkdownBody"; import { formatCents } from "../lib/utils"; +import { ANALYTICS_MASK_CLASS } from "@/lib/analytics/privacy"; +import { cn } from "@/lib/utils"; export const typeLabel: Record = { hire_agent: "Hire Agent", @@ -51,7 +53,7 @@ function PayloadField({ label, value }: { label: string; value: unknown }) { return (
{label} - {String(value)} + {String(value)}
); } @@ -116,12 +118,12 @@ export function CeoStrategyPayload({ payload }: { payload: Record {!!plan && ( -
+
{String(plan)}
)} {!plan && ( -
+        
           {JSON.stringify(payload, null, 2)}
         
)} @@ -143,7 +145,7 @@ export function BudgetOverridePayload({ payload }: { payload: Record ) : null} {!!payload.guidance && ( -

{String(payload.guidance)}

+

{String(payload.guidance)}

)}
); @@ -229,7 +231,7 @@ function BoardApprovalPayloadContent({ payload }: { payload: Record Proposed comment

-
+          
             {proposedComment}
           
diff --git a/ui/src/components/AppsSidebar.production.tsx b/ui/src/components/AppsSidebar.production.tsx index cc5153b7f85..bf50e5d4b2c 100644 --- a/ui/src/components/AppsSidebar.production.tsx +++ b/ui/src/components/AppsSidebar.production.tsx @@ -66,8 +66,8 @@ export function AppsSidebar() { Connectors
- - +
- + {developerTabs.map((tab) => (
- - + { const { title, detail } = attentionEvidenceText(entry); return ( -
  • +
  • {attentionEvidenceLabel(item, entry)}: {entry.subject.href ? ( diff --git a/ui/src/components/AttentionQueueRow.tsx b/ui/src/components/AttentionQueueRow.tsx index 49502a5ccf5..fd92a447bae 100644 --- a/ui/src/components/AttentionQueueRow.tsx +++ b/ui/src/components/AttentionQueueRow.tsx @@ -51,6 +51,7 @@ import { DecisionResolver } from "./DecisionResolver"; import { StalledReviewActions } from "./StalledReviewActions"; import { readIssueReviewPolicyMetadata } from "../lib/review-policy"; import { attentionOtherAudienceUserId } from "../lib/attention-close"; +import { ANALYTICS_MASK_CLASS } from "@/lib/analytics/privacy"; // Decision-action buttons: a comfortable tap target when the row is narrow // (h-9 / text-sm), shrinking back to the dense pill (h-6 / text-xs) once the @@ -334,10 +335,10 @@ export const AttentionQueueRow = memo(function AttentionQueueRow({ } : {})} > - + {item.subject.title ?? meta.label} -

    {detailLine}

    +

    {detailLine}

  • {/* Why this card is here (PAP-749 plan §1, Rule 4): "Why me?", "For diff --git a/ui/src/components/CaseFieldsPanel.tsx b/ui/src/components/CaseFieldsPanel.tsx index e7f2ace84f5..77745886087 100644 --- a/ui/src/components/CaseFieldsPanel.tsx +++ b/ui/src/components/CaseFieldsPanel.tsx @@ -6,6 +6,7 @@ import { IssueReferencePill } from "@/components/IssueReferencePill"; import { Link, useCaseHref } from "@/lib/router"; import { copyTextToClipboard } from "@/lib/clipboard"; import { cn } from "@/lib/utils"; +import { ANALYTICS_MASK_CLASS } from "@/lib/analytics/privacy"; // ----------------------------------------------------------------------------- // CaseFieldsPanel (PAP-12968 §3) — the generic key-value renderer for a case's @@ -223,7 +224,7 @@ export function CaseFieldValue({ ); } return ( -
    +      
             {JSON.stringify(value, null, 2)}
           
    ); @@ -330,7 +331,7 @@ export function CaseFieldsTable({ fields }: { fields: Record }) return

    No fields set

    ; } return ( - +
    {rows.map(({ id, path, value }) => ( diff --git a/ui/src/components/CaseRevisionRail.test.tsx b/ui/src/components/CaseRevisionRail.test.tsx index b8cd879771a..20cd3735556 100644 --- a/ui/src/components/CaseRevisionRail.test.tsx +++ b/ui/src/components/CaseRevisionRail.test.tsx @@ -6,6 +6,7 @@ import type { AnchorHTMLAttributes } from "react"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import type { CaseDocumentRevisions } from "@/api/cases"; +import { replayLeaks } from "@/lib/analytics/replay-recording.test-utils"; import { CaseRevisionRail } from "./CaseRevisionRail"; function act(callback: () => void) { @@ -122,4 +123,18 @@ describe("CaseRevisionRail", () => { expect(container.querySelector('[data-testid="md"]')?.textContent).toBe("# First version"); act(() => root.unmount()); }); + + it("keeps revision diff lines out of session replay", async () => { + mockCasesApi.listRevisions.mockResolvedValue(revisions); + const root = await render(); + const compare = Array.from(container.querySelectorAll("button")).find((b) => /compare|diff/i.test(b.textContent ?? "") || /compare|diff/i.test(b.getAttribute("aria-label") ?? "")); + expect(compare).toBeTruthy(); + act(() => compare!.dispatchEvent(new MouseEvent("click", { bubbles: true }))); + await flush(); + const dialog = document.querySelector('[role="dialog"]'); + expect(dialog).not.toBeNull(); + expect(replayLeaks("Second version", dialog!)).toEqual({ rendered: true, recorded: false }); + expect(replayLeaks("First version", dialog!)).toEqual({ rendered: true, recorded: false }); + act(() => root.unmount()); + }); }); diff --git a/ui/src/components/CaseRevisionRail.tsx b/ui/src/components/CaseRevisionRail.tsx index 7d7de2c546f..1af77b76565 100644 --- a/ui/src/components/CaseRevisionRail.tsx +++ b/ui/src/components/CaseRevisionRail.tsx @@ -14,6 +14,7 @@ import { MarkdownBody } from "@/components/MarkdownBody"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; import { cn, relativeTime } from "@/lib/utils"; import { Diff } from "lucide-react"; +import { ANALYTICS_MASK_CLASS } from "@/lib/analytics/privacy"; /** Author + via-issue attribution line for a revision. */ function RevisionByline({ revision }: { revision: CaseDocumentRevision }) { @@ -150,7 +151,7 @@ function CaseDocumentDiffModal({ {markerByKind[row.kind]} -
    +                  
                         {row.text.length > 0 ? row.text : " "}
                       
    diff --git a/ui/src/components/CompanySettingsSidebar.production.tsx b/ui/src/components/CompanySettingsSidebar.production.tsx index 24adf77aec0..2dd61e2837d 100644 --- a/ui/src/components/CompanySettingsSidebar.production.tsx +++ b/ui/src/components/CompanySettingsSidebar.production.tsx @@ -100,9 +100,9 @@ export function CompanySettingsSidebar() {
    +
    {columns.map((column, i) => ( diff --git a/ui/src/components/chat/AgentChannelsPanel.tsx b/ui/src/components/chat/AgentChannelsPanel.tsx index fc4193f4937..cebc00b8398 100644 --- a/ui/src/components/chat/AgentChannelsPanel.tsx +++ b/ui/src/components/chat/AgentChannelsPanel.tsx @@ -6,6 +6,8 @@ import { Badge } from "@/components/ui/badge"; import { queryKeys } from "@/lib/queryKeys"; import { Link } from "@/lib/router"; import { useChatConnectorsEnabled, chatProviderVisible } from "@/hooks/useChatConnectorsEnabled"; +import { cn } from "@/lib/utils"; +import { ANALYTICS_MASK_CLASS } from "@/lib/analytics/privacy"; const providerNames: Record = { speko: "Speko", @@ -74,7 +76,7 @@ export function AgentChannelsPanel({

    {providerNames[endpoint.provider]}

    -

    +

    {endpoint.botLabel ?? endpoint.providerAccountLabel ?? "Provider identity"} diff --git a/ui/src/components/chat/ExternallyConnectedTaskBanner.test.tsx b/ui/src/components/chat/ExternallyConnectedTaskBanner.test.tsx index e08a0b0aeee..d2001724f97 100644 --- a/ui/src/components/chat/ExternallyConnectedTaskBanner.test.tsx +++ b/ui/src/components/chat/ExternallyConnectedTaskBanner.test.tsx @@ -10,6 +10,7 @@ import { ExternallyConnectedTaskBanner } from "./ExternallyConnectedTaskBanner"; import { boardSendDraftKey, readBoardSendDraft } from "./board-send-draft"; import { ApiError } from "@/api/client"; import { queryKeys } from "@/lib/queryKeys"; +import { replayLeaks } from "@/lib/analytics/replay-recording.test-utils"; const mockSession = vi.hoisted(() => ({ userId: "user-1" })); vi.mock("@/api/auth", () => ({ authApi: { getSession: vi.fn(async () => ({ user: { id: mockSession.userId } })) }, @@ -177,6 +178,12 @@ describe("ExternallyConnectedTaskBanner publication truth", () => { autoResendOverride.stalled = false; }); + it("keeps the connected channel label out of session replay", async () => { + const client = await renderBanner(); + expect(replayLeaks("#paperclip", container)).toEqual({ rendered: true, recorded: false }); + client.clear(); + }); + it("cancels an automatic resend and hides its draft after an account change", async () => { mockChatEndpointsApi.publishBoardMessage.mockRejectedValue(new ApiError("Bad gateway", 502, {})); const client = await renderBanner(); diff --git a/ui/src/components/chat/ExternallyConnectedTaskBanner.tsx b/ui/src/components/chat/ExternallyConnectedTaskBanner.tsx index 33e6fd7f512..9cba73f3f9e 100644 --- a/ui/src/components/chat/ExternallyConnectedTaskBanner.tsx +++ b/ui/src/components/chat/ExternallyConnectedTaskBanner.tsx @@ -41,6 +41,7 @@ import { } from "./board-send-draft"; import { LegacyBoardSendNotice } from "./LegacyBoardSendNotice"; +import { ANALYTICS_MASK_CLASS } from "@/lib/analytics/privacy"; const providerNames: Record = { speko: "Speko", @@ -558,7 +559,7 @@ function ConnectedTaskComposer({

    Connected to {providerNames[binding.provider]}

    -

    +

    {binding.externalLabel} · {binding.provider === "slack" ? "Messages you send here and agent replies are also posted to Slack." : "Agent assignment is fixed for this external task."} diff --git a/ui/src/components/coordinator/CoordinatorDecisionReceipt.tsx b/ui/src/components/coordinator/CoordinatorDecisionReceipt.tsx index 1fe18384503..c86d0e14a28 100644 --- a/ui/src/components/coordinator/CoordinatorDecisionReceipt.tsx +++ b/ui/src/components/coordinator/CoordinatorDecisionReceipt.tsx @@ -1,6 +1,8 @@ import { ArrowUpRight, Check } from "lucide-react"; import type { DecisionHistoryItem } from "@paperclipai/shared"; import { decisionHistoryContext, decisionHistoryHeadline } from "@/lib/coordinator-attention"; +import { ANALYTICS_MASK_CLASS } from "@/lib/analytics/privacy"; +import { cn } from "@/lib/utils"; /** A recorded decision links to its context; it is not a second approval form. */ export function CoordinatorDecisionReceipt({ item, onOpen, userLabelMap }: { @@ -12,7 +14,7 @@ export function CoordinatorDecisionReceipt({ item, onOpen, userLabelMap }: { const handledFor = item.handledForUserId ? userLabelMap?.get(item.handledForUserId) ?? "someone else" : null; return

    - {fastResponse && } + {fastResponse && } diff --git a/ui/src/components/interrupt-handoff/InterruptHandoffViews.tsx b/ui/src/components/interrupt-handoff/InterruptHandoffViews.tsx index 1c9049dc768..b0f4630b71d 100644 --- a/ui/src/components/interrupt-handoff/InterruptHandoffViews.tsx +++ b/ui/src/components/interrupt-handoff/InterruptHandoffViews.tsx @@ -10,6 +10,7 @@ import { type ReassignInterruptCopy, type TimelineAssigneeLike, } from "../../lib/interrupt-handoff"; +import { ANALYTICS_MASK_CLASS } from "@/lib/analytics/privacy"; /** * Presentational views for the interrupt-handoff UX clarity surfaces (PAP-10669). @@ -174,7 +175,7 @@ export function ComposerHandoffPreviewRow({ role="status" aria-live="polite" > - {preview.text} + {preview.text} {preview.chip ? : null} {preview.suffix ? {preview.suffix} : null} @@ -337,7 +338,7 @@ export function PauseAffectsSummaryView({ > {bucket.label}: {bucket.count} - — {bucket.detail} + — {bucket.detail} ))} diff --git a/ui/src/components/issue-properties/external-object-rows.tsx b/ui/src/components/issue-properties/external-object-rows.tsx index 87e7fc01041..dc55317b316 100644 --- a/ui/src/components/issue-properties/external-object-rows.tsx +++ b/ui/src/components/issue-properties/external-object-rows.tsx @@ -16,6 +16,7 @@ import { cn } from "../../lib/utils"; import { ExternalObjectStatusIcon } from "../ExternalObjectStatusIcon"; import { PropertyRow } from "./primitives"; import { ExpandRelationListButton } from "./relation-controls"; +import { ANALYTICS_MASK_CLASS } from "@/lib/analytics/privacy"; const EXTERNAL_OBJECT_PROPERTY_PREVIEW_COUNT = 5; @@ -45,7 +46,7 @@ function externalObjectRowLabel(group: IssueExternalObjectGroup): ReactNode { return ( {Icon ? ); } @@ -115,7 +116,7 @@ function ExternalObjectPropertyValue({ group }: { group: IssueExternalObjectGrou sizeClassName="h-3.5 w-3.5" label={`${providerLabel}: ${statusLabel}`} /> - {value} + {value} ); const className = cn( diff --git a/ui/src/components/routine-triggers/WebhookFields.test.tsx b/ui/src/components/routine-triggers/WebhookFields.test.tsx new file mode 100644 index 00000000000..81aadd629ec --- /dev/null +++ b/ui/src/components/routine-triggers/WebhookFields.test.tsx @@ -0,0 +1,16 @@ +// @vitest-environment jsdom +import { renderToStaticMarkup } from "react-dom/server"; +import { afterEach, expect, it } from "vitest"; +import { CopyField } from "./WebhookFields"; +import { isBlockedFromReplay } from "@/lib/analytics/replay-recording.test-utils"; + +afterEach(() => { document.body.innerHTML = ""; }); + +it("blocks the webhook URL and secret from session replay", () => { + document.body.innerHTML = renderToStaticMarkup(<> + + + ); + expect(isBlockedFromReplay("hook_k4Zr9Qe1", document.body)).toBe(true); + expect(isBlockedFromReplay("whsec_Tq8vLm2Rz7Np", document.body)).toBe(true); +}); diff --git a/ui/src/components/routine-triggers/WebhookFields.tsx b/ui/src/components/routine-triggers/WebhookFields.tsx index e55e10ebf61..aa2be35dbd1 100644 --- a/ui/src/components/routine-triggers/WebhookFields.tsx +++ b/ui/src/components/routine-triggers/WebhookFields.tsx @@ -4,6 +4,7 @@ import { Button } from "@/components/ui/button"; import { Label } from "@/components/ui/label"; import { copyTextToClipboard } from "@/lib/clipboard"; import { AgentSetupPrompt } from "@/components/AgentSetupPrompt"; +import { ANALYTICS_NO_CAPTURE_CLASS } from "@/lib/analytics/privacy"; export function CopyField({ label, @@ -20,7 +21,7 @@ export function CopyField({
    - + {value} )} -
    +
    {events.map((evt) => { const color = evt.color ?? (evt.level ? levelColors[evt.level] : null) diff --git a/ui/src/components/run-log/RunDetails.tsx b/ui/src/components/run-log/RunDetails.tsx index 7eef5a734a0..672aa2734b5 100644 --- a/ui/src/components/run-log/RunDetails.tsx +++ b/ui/src/components/run-log/RunDetails.tsx @@ -9,6 +9,7 @@ import { Collapsible, CollapsibleTrigger, CollapsibleContent } from "@/component import { type HeartbeatRun, type WorkspaceOperation } from "@paperclipai/shared"; import { redactHomePathUserSegments, redactHomePathUserSegmentsInValue } from "@paperclipai/adapter-utils"; import { Badge } from "@/components/ui/badge"; +import { ANALYTICS_MASK_CLASS } from "@/lib/analytics/privacy"; export const RUN_LOG_PAGE_BYTES = 256_000; @@ -208,7 +209,7 @@ export function RunInvocationCard({ {commandLine && (
    Command: - {commandLine} + {commandLine}
    )} {Array.isArray(payload.commandNotes) && payload.commandNotes.length > 0 && ( @@ -218,7 +219,7 @@ export function RunInvocationCard({ {payload.commandNotes .filter((value): value is string => typeof value === "string" && value.trim().length > 0) .map((note, idx) => ( -
  • +
  • {note}
  • ))} @@ -228,7 +229,7 @@ export function RunInvocationCard({ {payload.prompt !== undefined && (
    Prompt
    -
    +                
                       {typeof payload.prompt === "string"
                         ? redactPathText(payload.prompt, censorUsernameInLogs)
                         : JSON.stringify(redactPathValue(payload.prompt, censorUsernameInLogs), null, 2)}
    @@ -238,7 +239,7 @@ export function RunInvocationCard({
                 {payload.context !== undefined && (
                   
    Context
    -
    +                
                       {JSON.stringify(redactPathValue(payload.context, censorUsernameInLogs), null, 2)}
                     
    @@ -246,7 +247,7 @@ export function RunInvocationCard({ {payload.env !== undefined && (
    Environment
    -
    +                
                       {formatEnvForDisplay(payload.env, censorUsernameInLogs)}
                     
    @@ -462,7 +463,7 @@ export function WorkspaceOperationsSection({ {operation.stderrExcerpt && operation.stderrExcerpt.trim() && (
    stderr excerpt
    -
    +                  
                         {redactPathText(operation.stderrExcerpt, censorUsernameInLogs)}
                       
    @@ -470,7 +471,7 @@ export function WorkspaceOperationsSection({ {operation.stdoutExcerpt && operation.stdoutExcerpt.trim() && (
    stdout excerpt
    -
    +                  
                         {redactPathText(operation.stdoutExcerpt, censorUsernameInLogs)}
                       
    diff --git a/ui/src/components/search/SearchResultRow.tsx b/ui/src/components/search/SearchResultRow.tsx index 5f8a4db7a56..7cb322c63b0 100644 --- a/ui/src/components/search/SearchResultRow.tsx +++ b/ui/src/components/search/SearchResultRow.tsx @@ -9,6 +9,7 @@ import { StatusIcon } from "../StatusIcon"; import { Identity } from "../Identity"; import { HighlightedText, type HighlightedTextProps } from "./HighlightedText"; import { taskStatusIconProps } from "@/lib/task-status-presentation"; +import { ANALYTICS_MASK_CLASS } from "@/lib/analytics/privacy"; type SnippetStyle = { Icon: ComponentType>; @@ -265,7 +266,7 @@ function SnippetLine({ text, highlights, field, fallbackLabel, multiline = false
    ); diff --git a/ui/src/components/skill-studio/SkillSourceConnectionRepair.tsx b/ui/src/components/skill-studio/SkillSourceConnectionRepair.tsx index 33ee7b94a1a..eb41dd3b3c1 100644 --- a/ui/src/components/skill-studio/SkillSourceConnectionRepair.tsx +++ b/ui/src/components/skill-studio/SkillSourceConnectionRepair.tsx @@ -10,6 +10,7 @@ import { Button } from '@/components/ui/button'; import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '@/components/ui/dialog'; import { RadioCardGroup } from '@/components/ui/radio-card'; import { SkillSourceBranchRepair } from './SkillSourceBranchRepair'; +import { ANALYTICS_MASK_CLASS } from "@/lib/analytics/privacy"; export function SkillSourceConnectionRepair({ companyId, source, onClose, onSaved, onReturnFocus }: { companyId: string; source: SkillSource; onClose: () => void; onSaved: () => Promise; @@ -41,7 +42,7 @@ export function SkillSourceConnectionRepair({ companyId, source, onClose, onSave
    {query.isPending &&

    Loading connections…

    } {query.error &&

    {describeError(query.error).body}

    } - ({ value: connection.id, title: connection.name }))} /> {query.isSuccess && connections.length === 0 &&

    Connect GitHub to continue.

    } diff --git a/ui/src/components/skills/ConnectedAppSkills.tsx b/ui/src/components/skills/ConnectedAppSkills.tsx index b1f5aeeb20e..2dfcc0ad373 100644 --- a/ui/src/components/skills/ConnectedAppSkills.tsx +++ b/ui/src/components/skills/ConnectedAppSkills.tsx @@ -9,6 +9,8 @@ import { useToastActions } from "../../context/ToastContext"; import { formatBytes } from "../../lib/issue-output"; import { queryKeys } from "../../lib/queryKeys"; import { describeError } from "@/api/errors"; +import { ANALYTICS_MASK_CLASS } from "@/lib/analytics/privacy"; +import { cn } from "@/lib/utils"; const STATUS_LABEL: Record = { pending_review: "Needs review", @@ -129,7 +131,7 @@ export function ConnectedAppSkillsList({ skills, pendingSkillId, preview, onPrev preview?.error ?

    {preview.error}

    : preview?.loading || !previewCurrent ?

    Loading instructions…

    // Shown as text: the content comes from the app and is never rendered as a page. - :
    {preview?.markdown}
    + :
    {preview?.markdown}
    ) : null} ); diff --git a/ui/src/components/task-chat/TaskChatCompactInteractionCard.tsx b/ui/src/components/task-chat/TaskChatCompactInteractionCard.tsx index e5c4831cd16..7064f866cec 100644 --- a/ui/src/components/task-chat/TaskChatCompactInteractionCard.tsx +++ b/ui/src/components/task-chat/TaskChatCompactInteractionCard.tsx @@ -76,6 +76,7 @@ import { } from "./TaskChatComposerTakeoverContext"; import { TaskChatPlanPreviewCard } from "./TaskChatPlanPreviewCard"; import { TaskChatRichInput } from "./TaskChatRichInput"; +import { ANALYTICS_MASK_CLASS } from "@/lib/analytics/privacy"; const TAKEOVER_TEXTAREA_CLASS = "min-h-16 resize-y border-0 bg-muted/35 text-sm shadow-none focus-visible:ring-0 focus-visible:ring-offset-0"; @@ -578,7 +579,7 @@ function ReceiptDisclosure({ {interaction.payload.toolAction.previewMarkdown}
    -
    +            
                   {interaction.payload.toolAction.argumentsSummaryJson}
                 
    @@ -954,7 +955,7 @@ function ConfirmationCard({ Arguments -
    +            
                   {interaction.payload.toolAction.argumentsSummaryJson}
                 
    diff --git a/ui/src/components/task-chat/TaskChatProtocolActivityRow.tsx b/ui/src/components/task-chat/TaskChatProtocolActivityRow.tsx index fca5eba7ec6..4aaa7da9c36 100644 --- a/ui/src/components/task-chat/TaskChatProtocolActivityRow.tsx +++ b/ui/src/components/task-chat/TaskChatProtocolActivityRow.tsx @@ -28,6 +28,7 @@ import { protocolActivityPresentation, providerNoticeSeverity, } from "./task-chat-activity-presentation"; +import { ANALYTICS_MASK_CLASS } from "@/lib/analytics/privacy"; const COMPACT_RESEARCH_RESULT_LIMIT = 5; const COMPACT_WORKSPACE_FILE_LIMIT = 8; @@ -176,7 +177,7 @@ function ProviderDetails({ item, neutral = false }: { item: TaskChatProviderActi ) : null} {item.output ? ( -
    {item.output}
    +
    {item.output}
    ) : null} {item.outputTruncated ?

    Output truncated to 8 KiB.

    : null}
    @@ -224,7 +225,7 @@ function WorkspaceFileDetails({ item }: { item: TaskChatWorkspaceFileItem }) { item.presentation === "document" ? (
    {item.preview}
    ) : ( -
    {item.preview}
    +
    {item.preview}
    ) ) :

    Preview unavailable.

    } {item.previewTruncated ?

    Preview truncated by the runner.

    : null} diff --git a/ui/src/components/task-chat/TaskChatProtocolCard.tsx b/ui/src/components/task-chat/TaskChatProtocolCard.tsx index b56664bdc6e..cfea850bc9e 100644 --- a/ui/src/components/task-chat/TaskChatProtocolCard.tsx +++ b/ui/src/components/task-chat/TaskChatProtocolCard.tsx @@ -57,6 +57,7 @@ import { TaskChatDiffCounts, TaskChatDiffView } from "./TaskChatDiffView"; import { parseUnifiedDiffLines } from "./diff-lines"; import { useArtifactsV1Enabled } from "@/hooks/useArtifactsV1Enabled"; import { ArtifactFileRow, ArtifactRow, fileRowSourceFromAttachment, fileRowSourceFromWorkProduct, subjectFromAttachment, subjectFromDocumentSummary, subjectFromWorkProduct, workProductStateBadge } from "@/components/artifacts/v1"; +import { ANALYTICS_MASK_CLASS } from "@/lib/analytics/privacy"; export interface TaskChatProtocolCardProps { item: TaskChatProtocolItem; @@ -400,7 +401,7 @@ function ProviderActivityCard({ ) : null} {item.output ? ( -
    +            
                   {item.output}
                 
    ) : null} @@ -623,7 +624,7 @@ function WorkspaceFileCard({ item }: { item: TaskChatWorkspaceFileItem }) { src={item.preview} /> ) : ( -
    +            
                   {item.preview}
                 
    )} diff --git a/ui/src/components/task-chat/TaskChatRunnerActivityGroup.tsx b/ui/src/components/task-chat/TaskChatRunnerActivityGroup.tsx index c5d1da43cf7..852fcea5671 100644 --- a/ui/src/components/task-chat/TaskChatRunnerActivityGroup.tsx +++ b/ui/src/components/task-chat/TaskChatRunnerActivityGroup.tsx @@ -35,6 +35,7 @@ import { toolActivityPresentation, type ToolIcon } from "./tool-taxonomy"; import { useTaskChatShimmer } from "./TaskChatShimmer"; import { TaskChatDiffCounts, TaskChatDiffView } from "./TaskChatDiffView"; import { useTaskReferenceLabel, withTaskReference } from "./task-reference"; +import { ANALYTICS_MASK_CLASS } from "@/lib/analytics/privacy"; type Activity = TaskChatActivityPhaseItem["items"][number]; type ToolActivity = Extract; @@ -430,7 +431,7 @@ function ActivityDetailsBody({ item }: { item: Activity }) { ) : null} {item.blockedReason ?

    Blocked: {item.blockedReason}

    : null} {item.detail ? ( -
    +        
               {item.detail}
             
    ) : null} diff --git a/ui/src/components/task-chat/TaskChatToolCard.tsx b/ui/src/components/task-chat/TaskChatToolCard.tsx index 7e79f3b4cd5..9a9d8da86ee 100644 --- a/ui/src/components/task-chat/TaskChatToolCard.tsx +++ b/ui/src/components/task-chat/TaskChatToolCard.tsx @@ -16,6 +16,7 @@ import { useTaskReferenceLabel, withTaskReference } from "./task-reference"; import { ProviderToolIcon, useProviderToolIcons } from "@/components/ProviderToolIcon"; import type { ToolCallProgressSnapshot } from "@paperclipai/shared"; import { TaskChatToolProgress, useToolCallProgress } from "./tool-call-progress"; +import { ANALYTICS_MASK_CLASS } from "@/lib/analytics/privacy"; const STATUS_ICON = { pending: { Icon: Loader2, spin: false, tone: "text-muted-foreground" }, @@ -149,7 +150,7 @@ export function TaskChatToolCard({ item, progress: givenProgress }: {
    ) : null} {item.detail && showDetail ? ( -
    +        
               {item.detail}
             
    ) : null} diff --git a/ui/src/components/task-side-panel/TaskAttachmentPanel.tsx b/ui/src/components/task-side-panel/TaskAttachmentPanel.tsx index 738de068a7d..ba5e8264e9f 100644 --- a/ui/src/components/task-side-panel/TaskAttachmentPanel.tsx +++ b/ui/src/components/task-side-panel/TaskAttachmentPanel.tsx @@ -16,6 +16,8 @@ import { attachmentDownloadPath, isMarkdownAttachment, isTextAttachment } from " import { queryKeys } from "@/lib/queryKeys"; import { readTextPreview, TEXT_PREVIEW_MAX_BYTES } from "@/lib/text-preview"; +import { ANALYTICS_MASK_CLASS } from "@/lib/analytics/privacy"; +import { cn } from "@/lib/utils"; export { readTextPreview, TEXT_PREVIEW_MAX_BYTES } from "@/lib/text-preview"; export function TextAttachmentPreview({ title, text, markdown, html = false, csv = false, patch = isPatchFile(title), downloadUrl }: { @@ -40,13 +42,13 @@ export function TextAttachmentPreview({ title, text, markdown, html = false, csv -
    +
    {text.length === 0 ?

    File is empty.

    : renderCsv ? : renderHtml ? : markdown && mode === "rendered" ? {text} - : patch ?
    - :
    {text}
    } + : patch ?
    + :
    {text}
    }
    ); diff --git a/ui/src/components/transcript/RunTranscriptView.tsx b/ui/src/components/transcript/RunTranscriptView.tsx index af8a05676bd..166eb701a42 100644 --- a/ui/src/components/transcript/RunTranscriptView.tsx +++ b/ui/src/components/transcript/RunTranscriptView.tsx @@ -14,6 +14,7 @@ import { User, } from "lucide-react"; import { toolTaxonomy } from "../task-chat/tool-taxonomy"; +import { ANALYTICS_MASK_CLASS } from "@/lib/analytics/privacy"; /** Family glyph for a tool block/row; the taxonomy falls back to Wrench. */ function ToolFamilyIcon({ name, className }: { name: string; className?: string }) { @@ -878,7 +879,7 @@ function TranscriptProviderActivity({ block, density }: { block: Extract 0 ?
      {steps.map((step, index) =>
    1. {String(step.body ?? "")}
    2. )}
    : null} {children.length > 0 ?
      {children.map((child, index) =>
    • {String(child.role ?? "Child agent")} · {String(child.status ?? "unknown")}
      {String(child.summary ?? "")}
    • )}
    : null} {sources.length > 0 ?
      {sources.map((source, index) => { const url = typeof source.url === "string" && /^https?:\/\//.test(source.url) ? source.url : null; return
    • {url ? {String(source.title ?? url)} : String(source.title ?? "Unavailable source")} Provider-reported
    • ; })}
    : null} - {output ?
    {output}
    : null} + {output ?
    {output}
    : null} {block.family === "provider_notice" && Array.isArray(block.payload.details) ?
    {block.payload.details.slice(0, 64).map((value, index) => { const detail = asRecord(value); return detail && typeof detail.name === "string" && typeof detail.value === "string" ?
    {detail.name}
    {detail.value}
    : null; })}
    : null} {block.family === "model_identity" ?
    Requested {String(block.payload.requestedModel ?? "—")} · Effective {String(block.payload.effectiveModel ?? "—")}
    : null}
    : null} @@ -1109,7 +1110,7 @@ function TranscriptToolCard({
    Input
    -
    +                
                       {formatToolPayload(block.input) || ""}
                     
    @@ -1117,7 +1118,7 @@ function TranscriptToolCard({
    Result
    -
    @@ -1262,7 +1263,7 @@ function TranscriptCommandGroup({
                     
                   
                   {item.result && (
    -                
    @@ -1403,14 +1404,14 @@ function TranscriptToolGroup({
                   
    Input
    -
    +                  
                         {formatToolPayload(item.input) || ""}
                       
    {item.result && (
    Result
    -
    @@ -1506,7 +1507,7 @@ function TranscriptEventRow({
                 
    )} {block.detail && ( -
    +            
                   {block.detail}
                 
    )} @@ -1559,7 +1560,7 @@ function TranscriptDiffGroup({ {open ? : }
    {open && ( -
    @@ -1637,7 +1638,7 @@ function TranscriptStderrGroup({
             {open ?  : }
           
           {open && (
    -        
    +        
               {block.lines.map((line, i) => (
                 
                   {i > 0 ? "\n" : ""}
    @@ -1674,7 +1675,7 @@ function TranscriptSystemGroup({
             {open ?  : }
           
           {open && (
    -        
    +        
               {block.lines.map((line, i) => (
                 
                   {i > 0 ? "\n" : ""}
    @@ -1714,7 +1715,7 @@ function TranscriptStdoutRow({
             
           
           {open && (
    -        
    @@ -1834,7 +1835,7 @@ function RawTranscriptView({
               
                 {entry.kind}
               
    -          
    +          
                 {rawEntryContent(entry)}
               
    @@ -1868,7 +1869,7 @@ export function RunTranscriptView({ if (entries.length === 0) { return ( -
    +
    {emptyMessage}
    ); @@ -1876,14 +1877,14 @@ export function RunTranscriptView({ if (mode === "raw") { return ( -
    +
    ); } return ( -
    +
    {keyedBlocks.map(({ block, key }, index) => (
    & VariantProps & { asChild?: boolean - /** The label is fixed product copy, so session replay may show it. */ - analyticsChrome?: boolean } >(function Button({ className, variant = "default", size = "default", asChild = false, - analyticsChrome = false, ...props }, ref) { const Comp = asChild ? Slot.Root : "button" @@ -62,7 +58,6 @@ const Button = React.forwardRef< & { - /** The text is fixed product copy, so session replay may show it. */ - analyticsChrome?: boolean -}) { +}: React.ComponentProps) { return ( & { - /** The text is fixed product copy, so session replay may show it. */ - analyticsChrome?: boolean -}) { +}: React.ComponentProps) { return (
    Speko charge
    {charge(report.costMicroUsd)}
    {report.durationSeconds !== null &&
    Duration
    {report.durationSeconds} seconds
    }

    Agent costs are separate. Recordings remain in Speko.

    - {report.transcript.length ?
      {report.transcript.map(turn =>
    1. {turn.speaker === "caller" ? "You" : "Agent"}{turn.interrupted ? " · interrupted" : ""}

      {turn.text}

    2. )}
    + {report.transcript.length ?
      {report.transcript.map(turn =>
    1. {turn.speaker === "caller" ? "You" : "Agent"}{turn.interrupted ? " · interrupted" : ""}

      {turn.text}

    2. )}
    :

    {report.status === "unavailable" ? "The transcript is unavailable. Paperclip will retry while Speko finishes the report." : report.status === "pending" ? "The transcript will appear after Speko finishes the call report." : "Speko did not provide a transcript for this call."}

    }
    ; } diff --git a/ui/src/components/voice/VoiceTranscript.tsx b/ui/src/components/voice/VoiceTranscript.tsx index 66b8b498049..6003ad7d041 100644 --- a/ui/src/components/voice/VoiceTranscript.tsx +++ b/ui/src/components/voice/VoiceTranscript.tsx @@ -1,4 +1,6 @@ import type { VoiceTranscriptEntry } from "@/lib/voice-transcript"; +import { ANALYTICS_MASK_CLASS } from "@/lib/analytics/privacy"; +import { cn } from "@/lib/utils"; export interface VoiceTranscriptProps { entries: readonly VoiceTranscriptEntry[]; @@ -11,7 +13,7 @@ export function VoiceTranscript({ entries, agentName, unavailable = false }: Voi if (unavailable) return

    The transcript is unavailable. Your task history is still available.

    ; if (!entries.length) return

    Your conversation will appear here.

    ; return ( -
      +
        {entries.map((entry) => (
      1. diff --git a/ui/src/features/connections/ConnectionChoiceList.tsx b/ui/src/features/connections/ConnectionChoiceList.tsx index 2aaea7f85c4..b3c318699cf 100644 --- a/ui/src/features/connections/ConnectionChoiceList.tsx +++ b/ui/src/features/connections/ConnectionChoiceList.tsx @@ -1,5 +1,7 @@ import type { ReactNode } from "react"; import { Check, ChevronRight, Loader2 } from "lucide-react"; +import { ANALYTICS_MASK_CLASS } from "@/lib/analytics/privacy"; +import { cn } from "@/lib/utils"; /** The account-reuse rows shared by connection setup and agent bindings. */ export function ConnectionChoiceList({ choices, selectedId, pendingId, disabled, onSelect }: { @@ -21,7 +23,7 @@ export function ConnectionChoiceList({ choices, selectedId, pendingId, disabled, > {choice.icon && } - {choice.name} + {choice.name} {choice.description} {pendingId === choice.id ? diff --git a/ui/src/features/connections/ConnectionInstructions.tsx b/ui/src/features/connections/ConnectionInstructions.tsx index 562b4065b84..923f93299ae 100644 --- a/ui/src/features/connections/ConnectionInstructions.tsx +++ b/ui/src/features/connections/ConnectionInstructions.tsx @@ -19,6 +19,8 @@ import { Button } from "@/components/ui/button"; import { Textarea } from "@/components/ui/textarea"; import { ToggleSwitch } from "@/components/ui/toggle-switch"; import { InlineBanner } from "@/components/InlineBanner"; +import { ANALYTICS_MASK_CLASS } from "@/lib/analytics/privacy"; +import { cn } from "@/lib/utils"; export function ConnectionInstructionsEditor({ provider, template, value, onChange, disabled = false }: { provider: string; @@ -39,7 +41,7 @@ export function ConnectionInstructionsEditor({ provider, template, value, onChan {!value.enabled && Agents can still use this connection’s tools, but won’t receive these instructions.} {editing ?
    {formatDateTime(row.startedAt)}
    {row.feature === "settings.test" ? "Setup test" : row.feature}
    {row.actorType === "system" ? "Paperclip services" : row.userName ?? (row.responsibleUserId === "local-board" ? "Board" : "Former user")} {row.issueId ? {row.issueIdentifier ?? "View task"} : "—"}{row.connectionName ?? (row.connectionId ? "Removed connection" : "—")}{row.connectionName ?? (row.connectionId ? "Removed connection" : "—")}{row.model}
    {row.status === "succeeded" ? "Succeeded" : row.status === "running" ? "Running" : row.status === "unknown" ? "Unresolved" : row.status === "skipped" ? "Skipped" : row.status === "pending" ? "Pending" : "Failed"}
    {row.publicationStatus &&
    {row.publicationStatus}
    }{row.errorCode &&
    {row.errorCode.replaceAll("_", " ")}
    }
    {row.durationMs === null ? "—" : `${(row.durationMs / 1000).toFixed(1)}s`}