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): remove retired mobile hosts (#125615)

Chris Volzerf1601fb8a6da
diff --git a/.agents/skills/posthog-desktop/SKILL.md b/.agents/skills/posthog-desktop/SKILL.md
index 981b29b2114e..b84018ad3c54 100644
--- a/.agents/skills/posthog-desktop/SKILL.md
+++ b/.agents/skills/posthog-desktop/SKILL.md
@@ -5,7 +5,7 @@ description: >
workspace imported from the now-archived PostHog/code repo, with posthog/posthog the only
source of truth for PRs, CI and publishing, and not part of the root frontend or Django build.
Use when the user says /posthog-desktop, or works on the Electron desktop app, apps/code, apps/web,
- apps/mobile, packages/core, packages/ui, packages/workspace-server, @posthog/api-client,
+ packages/core, packages/ui, packages/workspace-server, @posthog/api-client,
@posthog/agent, or the agent framework. Pins the working directory to products/desktop, swaps
in that tree's toolchain and conventions in place of the monorepo's, and defines the few paths
outside the tree that may be touched (Django APIs the app calls, desktop-* CI at the root).
diff --git a/.easignore b/.easignore
index 2a055bb2a022..494375c2a776 100644
--- a/.easignore
+++ b/.easignore
@@ -9,10 +9,6 @@
.flox/log/
node_modules/
.vite/
-/products/desktop/apps/mobile/ios/
-/products/desktop/apps/mobile/android/
-/products/desktop/apps/mobilehog/ios/
-/products/desktop/apps/mobilehog/android/
.parcel-cache/
.postgres-backups/
.typegen/
diff --git a/.github/scripts/desktop/react-doctor-comment.mjs b/.github/scripts/desktop/react-doctor-comment.mjs
index 7c6bb879bebe..df31ec34d58f 100644
--- a/.github/scripts/desktop/react-doctor-comment.mjs
+++ b/.github/scripts/desktop/react-doctor-comment.mjs
@@ -65,7 +65,7 @@ if (!report) {
} else {
const summary = report.summary ?? {};
const total = summary.totalDiagnosticCount ?? 0;
- // Diagnostic filePaths are relative to their project (e.g. apps/mobile), not
+ // Diagnostic filePaths are relative to their project (e.g. apps/web), not
// the scan root; rejoin them so labels and blob links resolve.
const scanRoot = String(report.directory ?? "").replace(/\/+$/, "");
const diagnostics = (report.projects ?? []).flatMap((project) => {
diff --git a/.github/workflows/desktop-mobile-build.yml b/.github/workflows/desktop-mobile-build.yml
deleted file mode 100644
index 03f72e73ef38..000000000000
--- a/.github/workflows/desktop-mobile-build.yml
+++ /dev/null
@@ -1,103 +0,0 @@
-name: Desktop Mobile Build
-
-# Builds the Expo mobile app (products/desktop/apps/mobile) for iOS and Android on EAS.
-# The two platforms run as parallel matrix jobs, so both builds are queued
-# simultaneously.
-#
-# Required repository secret:
-# EXPO_TOKEN - an Expo access token with build permissions for the
-# "posthog" account (https://expo.dev/settings/access-tokens).
-
-on:
- workflow_dispatch:
- inputs:
- profile:
- description: 'EAS build profile'
- type: choice
- default: production
- options:
- - development
- - preview
- - production
- wait:
- description: 'Wait for the EAS build to finish (uncheck to just queue and exit)'
- type: boolean
- default: true
-
-concurrency:
- group: desktop-mobile-build-${{ github.ref }}-${{ inputs.profile }}
- cancel-in-progress: false
-
-env:
- # npm's audit blocks the pnpm bootstrap. See .github/actions/pnpm-install for why.
- NPM_CONFIG_AUDIT: 'false'
- NPM_CONFIG_FUND: 'false'
-
-jobs:
- build:
- name: Build (${{ matrix.platform }})
- if: github.repository == 'PostHog/posthog'
- runs-on: depot-ubuntu-24.04-4
- timeout-minutes: 120
- strategy:
- fail-fast: false
- matrix:
- platform: [ios, android]
- permissions:
- contents: read
- defaults:
- run:
- working-directory: products/desktop/apps/mobile
- steps:
- - name: Checkout
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- with:
- persist-credentials: false
-
- - name: Setup pnpm
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
- with:
- package_json_file: products/desktop/package.json
-
- - name: Setup Node.js
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
- with:
- node-version-file: products/desktop/.node-version
- cache: 'pnpm'
- cache-dependency-path: products/desktop/pnpm-lock.yaml
-
- - name: Setup EAS
- uses: expo/expo-github-action@eab7a230208c952974db8c3245cfd78402c7b385 # 9.0.0
- with:
- eas-version: latest
- token: ${{ secrets.EXPO_TOKEN }}
-
- - name: Install dependencies
- run: pnpm install --frozen-lockfile
- working-directory: products/desktop
-
- - name: EAS build
- env:
- PLATFORM: ${{ matrix.platform }}
- PROFILE: ${{ inputs.profile }}
- WAIT_FLAG: ${{ inputs.wait && '--wait' || '--no-wait' }}
- run: |
- eas build \
- --non-interactive \
- --platform "$PLATFORM" \
- --profile "$PROFILE" \
- "$WAIT_FLAG"
-
- # Auto-promote the freshly built production binaries. Only runs when the build
- # job waited for completion (otherwise there is no finished build to submit).
- promote:
- permissions:
- contents: read
- needs: build
- if: ${{ inputs.profile == 'production' && inputs.wait }}
- uses: ./.github/workflows/desktop-mobile-promote.yml
- with:
- platform: all
- profile: production
- secrets:
- EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
diff --git a/.github/workflows/desktop-mobile-promote.yml b/.github/workflows/desktop-mobile-promote.yml
deleted file mode 100644
index e31e687ddf58..000000000000
--- a/.github/workflows/desktop-mobile-promote.yml
+++ /dev/null
@@ -1,106 +0,0 @@
-name: Desktop Mobile Promote
-
-# Promotes the most recent finished EAS build to the stores:
-# iOS -> App Store Connect (build becomes available in TestFlight)
-# Android -> Google Play "internal" testing track
-#
-# Uses `eas submit --latest`, which submits the latest successful build for the
-# selected platform/profile. Run "Desktop Mobile Build" with the matching profile first.
-#
-# Required repository secret:
-# EXPO_TOKEN - Expo access token (submit permissions).
-#
-# Store credentials live on EAS, not in this repo: the iOS App Store Connect API
-# key and the Android Google Play service account key are configured once via
-# `eas credentials` so that `--non-interactive` submits can authenticate.
-
-on:
- workflow_dispatch:
- inputs:
- platform:
- description: 'Platform to promote'
- type: choice
- default: all
- options:
- - all
- - ios
- - android
- profile:
- description: 'EAS submit profile'
- type: choice
- default: production
- options:
- - production
- # Allows "Desktop Mobile Build" to chain into this workflow after a successful build.
- workflow_call:
- inputs:
- platform:
- type: string
- default: all
- profile:
- type: string
- default: production
- secrets:
- EXPO_TOKEN:
- required: true
-
-concurrency:
- group: desktop-mobile-promote-${{ github.ref }}
- cancel-in-progress: false
-
-env:
- # npm's audit blocks the pnpm bootstrap. See .github/actions/pnpm-install for why.
- NPM_CONFIG_AUDIT: 'false'
- NPM_CONFIG_FUND: 'false'
-
-jobs:
- submit:
- name: Submit (${{ matrix.platform }})
- if: github.repository == 'PostHog/posthog'
- runs-on: depot-ubuntu-24.04
- timeout-minutes: 30
- strategy:
- fail-fast: false
- matrix:
- platform: ${{ inputs.platform == 'all' && fromJSON('["ios","android"]') || fromJSON(format('["{0}"]', inputs.platform)) }}
- permissions:
- contents: read
- defaults:
- run:
- working-directory: products/desktop/apps/mobile
- steps:
- - name: Checkout
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- with:
- persist-credentials: false
-
- - name: Setup pnpm
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
- with:
- package_json_file: products/desktop/package.json
-
- - name: Setup Node.js
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
- with:
- node-version-file: products/desktop/.node-version
-
- - name: Setup EAS
- uses: expo/expo-github-action@eab7a230208c952974db8c3245cfd78402c7b385 # 9.0.0
- with:
- eas-version: latest
- token: ${{ secrets.EXPO_TOKEN }}
-
- - name: Install dependencies
- run: pnpm install --frozen-lockfile
- working-directory: products/desktop
-
- - name: EAS submit
- env:
- PLATFORM: ${{ matrix.platform }}
- PROFILE: ${{ inputs.profile }}
- run: |
- eas submit \
- --non-interactive \
- --platform "$PLATFORM" \
- --profile "$PROFILE" \
- --latest
diff --git a/docs/internal/mobilehog-release-checks.md b/docs/internal/mobilehog-release-checks.md
index ffe60665e704..5fd21fe4be3d 100644
--- a/docs/internal/mobilehog-release-checks.md
+++ b/docs/internal/mobilehog-release-checks.md
@@ -1,190 +1,11 @@
-# posthog release checks
+# Retired mobile hosts
-The posthog mobile app lives in `products/desktop/apps/mobilehog`.
-Its bundle ID is `com.posthog.mobilehog`.
-The build workflows for `apps/mobile` target a different app.
-Build and install a new native binary to update the displayed app name to `posthog`.
-Keep the bundle ID and storage keys stable so updates preserve existing installations.
+The legacy mobile hosts in `products/desktop/apps/mobile` and `products/desktop/apps/mobilehog` have been removed.
+Their build and release instructions no longer apply.
-## Updates
+The [proposed independent mobile app](https://github.com/PostHog/posthog/pull/118584) lives under `products/mobile` on its feature branch.
+Use that proposal's README and release documentation when working on the replacement; it is not part of the desktop workspace.
-The app has its own EAS project ID, but over-the-air updates remain disabled.
-Store builds use the bundled JavaScript.
-
-To enable updates, run `eas update:configure` from `products/desktop/apps/mobilehog` with access to the correct Expo organization.
-Check that `extra.eas.projectId` and `updates.url` refer to that project, then set `updates.enabled` to `true`.
-Build and install a new binary before publishing an update to its channel.
-Do not reuse the older mobile app's project ID.
-
-## Account changes
-
-On iOS, Get started opens a fresh browser sign-in so users can choose a PostHog account.
-The app saves the selected account's session in secure device storage and restores it on restart.
-Each signed-in account has a separate query client.
-Logout clears queries, task transcripts, run watchers, and composer state.
-Repository selection and seen reports use storage keys scoped to the host, project, and user.
-The old unscoped values are not loaded.
-Appearance remains a device preference.
-Late authentication results cannot restore a session after logout.
-Settings > Project lists projects available to the current sign-in.
-The selected project persists across restarts and token refreshes.
-Switching projects clears the previous project's cached data and navigation state.
-Cloud sign-in lists only projects included in the OAuth grant.
-
-## Tasks
-
-The drawer starts with the signed-in user's cloud tasks in the selected project, including tasks started from Desktop.
-The drawer shows one task list across all spaces, without space names or space filters.
-Tasks use system text, relative timestamps, and a running indicator. Task rows have no read markers or status filters.
-The active list excludes archived tasks. Task list options opens the archive view.
-Task lists use the server's most recent activity order and support loading older pages.
-The search button opens a separate screen with its input above the keyboard.
-Search matches task titles, descriptions, and task numbers on the server, across all of the user's spaces in the selected project.
-Before a query, Search shows up to eight recent searches, not recent tasks. Completed searches stay on this device and are scoped to the signed-in account and project.
-Local Desktop runs remain on Desktop. Archived tasks stay outside the task list.
-Pull to refresh or return to the app to update tasks.
-
-New tasks omit the channel so the server creates them in the user's personal space.
-Accessible tasks owned by the user remain visible and can receive replies, regardless of their space.
-The mobile app does not show space names in the drawer, search, composer, or Activity.
-
-## Push notifications
-
-Task completion from Desktop or mobile uses the same server-side owner notification path. Delivery requires a signed-in account, permission to show notifications, an Expo push token registered with the server, and working iOS push credentials for the app's EAS project.
-The app registers after sign-in and retries when it becomes active. Notification permissions stay in iOS settings. Expo push delivery can be tested on a supported iOS simulator or a physical device; it needs a push-enabled native build.
-To check cross-device delivery, start a cloud task from Desktop, put the mobile app in the background, and confirm that the completion alert arrives and opens that task. Server delivery metrics count Expo acceptance, not confirmed device delivery.
-
-Self-driving pushes use the same `posthog-code-mobile-push` flag as task pushes. A report first appearing sends "New report for you" to its suggested reviewers. A PR becoming open sends "PR ready to review" to the linked reports' active claimant and suggested reviewers, with one push per person when reports share the PR. Recipients must still have project access, and tapping either alert opens the report. Importing historical legacy assignments, including `backfill_report_pull_requests`, sends no PR-ready push.
-
-## Self-driving and task conversations
-
-Self-driving lists reports needing attention and PRs ready for review where the signed-in user is a suggested reviewer.
-Its status control filters All active, Needs attention, Review PR, Resolved, or Dismissed before pagination. Newest first is the default; the sort menu also offers Priority.
-Opening a report marks it read for the current account and syncs with Desktop. Read actions clear the new-item indicators without dismissing the reports.
-Tapping a report in the list opens a separate full-detail screen. Report actions stay in its options menu. The visible Triage button opens the optional decision deck. Existing PRs remain in the report list.
-The sync notice sits below the deck and cannot cover a card.
-Dismiss changes the report state for the project. Activity read state is stored on the server.
-Both lists support refresh and loading older items.
-Read actions appear only when visible items are unread.
-Empty lists have a centered explanation. Loading and request failures have separate states.
-The empty Self-driving list does not show report instructions or review actions.
-
-Task conversations keep the header and reply box outside the scrolling messages.
-Conversations have no new-chat shortcut; use the drawer to start another task. The reply box has no top divider.
-The + button in both composers selects up to ten photos at once from the device library. Previews scroll horizontally.
-The composer previews selected photos, lets the user remove them, and sends images with the task message.
-Image-only messages get a short prompt. Images total no more than 5 MB; unsupported iOS formats convert to JPEG.
-New tasks keep the composer open until an image message is accepted, so a failed send keeps the draft.
-Select more than three photos, remove one preview, and restart the app. Confirm that the remaining draft photos return.
-This uses native image picker and file system modules, so install a fresh native build before testing attachments.
-Images can be expanded. Saved insights and SQL references render charts or tables; unsupported insight types link to PostHog.
-Mobile run requests set `X-PostHog-Client-Platform: mobile` for the PR footer.
-The backend carries that value to the agent as run state. It does not change GitHub authorship or commit signing.
-The Mobile footer needs the backend and agent changes to be deployed.
-
-Before sharing a build:
-
-- Sign in to one account in Safari, then tap Get started in the app and sign in to another account.
- Confirm that the app uses the selected account and keeps it after a restart.
- Check saved-password autofill on a device with saved PostHog credentials.
-- Sign in with access to multiple projects. Open Settings > Project, search, and select another project.
- Confirm that tasks, spaces, reports, and repository choices belong to the selected project.
- Restart the app and confirm that it keeps the selected project.
-- Switch projects while a token refresh or task request is pending.
- The old project must not return, and old results must not appear in the new project.
-- Disconnect the network before opening the project list or selecting a project.
- Confirm that the app shows an error, keeps the current project, and permits another attempt.
-- Sign in, open a task and a report, select a repository, then log out and sign in with another account.
- No data or selection from the first account should appear.
-- Log out while token refresh or a task command is pending.
- The old session must not return, and the command must not start work under the new account.
-- Start a cloud task in Desktop, then sign in to the same account and project on mobile.
- Confirm that Tasks shows it alongside tasks from other spaces and excludes tasks by other users.
- Open search with the sidebar button. Find a task from a different space and reply to it.
- Search for an older task by title, description text, and task number, then open a result.
- Confirm that the keyboard leaves the search field and results visible. Close search and confirm that the task list still spans all spaces.
- Load older pages. Check loading, empty, and error states. Confirm that no space names or picker appear.
-- Start a task from mobile and confirm that Desktop shows it in your personal space.
- Switch projects and confirm that tasks still belong to the selected project.
-- Create a task in Desktop while mobile is in the background, then return to mobile.
- Confirm that the task appears. Disconnect the network and check that refresh shows an error with Retry.
-- Tap the login button twice quickly.
- Only one login flow should start.
-- Open Self-driving with reports for different suggested reviewers. Only your reports should appear. Select Priority and confirm that P0 appears first.
- Open a report, mark loaded reports read, and confirm that the drawer indicator clears. Restart and check read state.
- Dismiss a report and confirm it leaves the project inbox. Disconnect the network and check that failed actions permit another attempt.
-- Open Activity with no items, then with only read items. Confirm that no mark-as-read action appears.
- Mark one unread item read, then mark the remaining visible items read. Confirm that the action disappears and the badge updates.
- Load older items. New activity that arrives during a read action must remain unread.
-- Open Self-driving with no reports. Confirm that the empty state has no read or triage action and no report instructions.
- Disconnect the network and refresh. Confirm that the screen shows a request error with Retry, rather than a successful empty state.
-- Open a task with an uploaded image, a Markdown image, and a saved insight. Expand the images and read chart values.
- Reopen the task and check that stored attachments still load. Check an unavailable image and insight, then retry.
-- Start a new task with a selected photo and text. Reply to a Desktop task with a photo but no text.
- Confirm that the agent receives each image, both conversations render it, and the picker stays available after a canceled selection.
- Remove a photo before sending and confirm that it is not sent. Try an image larger than 5 MB, then disconnect the network.
- Confirm that the draft stays available with an error rather than sending text without the image.
-- In a long conversation, scroll up while the agent works. Open and close the keyboard, send a reply, and use Latest message.
- Messages must remain clear of the header and reply box, without a large blank space or forced scrolling while reading history.
-- Start a task from mobile and let it create a PR. Confirm its footer says PostHog Mobile and its GitHub author is unchanged.
-- Open an MCP app from a task result, enter fullscreen, then return inline.
- The content must load in each view, and app controls must still work.
-- Check the login button on a device without Liquid Glass.
- Its orange background must remain visible.
-
-Native checks need an iOS simulator or a device.
-Type checks alone do not validate WebView messages, native appearance, or cloud login.
-
-## Rich content, dictation, and report controls
-
-- Sign out and sign in to grant insight access. Open a saved insight and a SQL chart with multiple lines.
- Open a report with attached charts. Check loading, data, unavailable content, and Retry.
-- Open Mermaid flow and sequence diagrams in a stored conversation. Check light and dark appearance.
- Check an invalid diagram and Show diagram source. Diagrams must not load external content or run links.
-- Open a cloud attachment after returning to an older task. Retry a failed image load and expand the image.
-- In Self-driving, check all four sort orders across two pages. Open a report directly from the list.
- Start triage from the options menu. Mark loaded reports as read and confirm that unloaded reports do not change.
-- Check the compact and expanded composer with the keyboard open and closed.
- Check a narrow iPhone screen, a long model name, photos, dictation, and a task that is still working.
-- Dictate into a new task and an existing reply. Stop manually, then repeat and wait for silence.
- Check that each transcript appears once and stays editable before sending.
- Deny permission, cancel dictation, leave the screen, and put the app in the background.
- The microphone must stop, the existing text must remain, and the app must permit another attempt.
-
-Dictation needs a new native build. Existing sign-ins need renewed authorization for saved insights.
-The [app README](../../products/desktop/apps/mobilehog/README.md) covers setup and feature limits.
-
-## Drafts and recovery
-
-- Write a new-task draft and a reply with a photo. Close and reopen the app. Confirm that both drafts remain in their own composers. Send one; only that draft clears.
-- Switch projects and accounts with a draft open. The next account must not show it. Sign out and confirm that draft files and cached conversations are removed.
-- Open tasks and Self-driving, then disconnect the network. Saved content remains readable, drafts remain editable, and Send is disabled. Reconnect; the app must not send the draft by itself.
-- Interrupt a send. The draft must remain. Check for server acceptance before retrying when the result is uncertain.
-- Rename, archive, and restore a task. Confirm the same state in Desktop and use each status filter. Archived running tasks must keep running.
-- Mark a report read on mobile and check Desktop, then reverse the direction. Mark unread, dismiss, undo, and restore from the Dismissed status filter. Another user's read state must not change.
-- Search task and report text. Only Tasks and Self-driving tabs appear. A result opens its task or report.
-- Open task options. Only Rename and Archive (or Restore) appear. Internal tasks and sandbox image-builder tasks stay out of the task list.
-- Use large text and VoiceOver to operate task menus, search tabs, the composer, and report actions. Check reduced motion and a narrow device in both appearances.
-- Install a preview build, publish a compatible test update, and use Settings to apply it. A native-module change must produce a different fingerprint and require a new build.
-- In the configured telemetry project, confirm that a test failure resolves to source code. Inspect the event payload: no prompt, image, token, search text, response body, or exception text may be present.
-
-## Model selection and loading
-
-- Open a running task, select another model from the same provider, and send a reply. Confirm the agent accepts the model and reasoning setting before it receives the reply.
-- Reject a model change and confirm the message stays unsent and the draft stays available. Repeat with a Pi task from Desktop.
-- Select different models in two tasks and a new-task draft. Move between them and confirm that each composer keeps its selection.
-- Open a task, return to the list, then open it again within one minute. Confirm the conversation remains visible and the live stream is reused.
-- Open a report from the list and Search. Confirm both open the full report screen, with triage available only from the Self-driving menu.
-- Delay report read-state requests. Confirm loaded reports appear before those requests finish.
-
-Deploy the report read-state migration and API, and task notification title before distributing the matching mobile build.
-Mobile PR footers also require the task worker and agent image update. Existing runs can retain their previous agent image.
-
-## Read state and chat rendering
-
-- Mark a task update and a comment notification read. Both indicators and the Activity count clear. Fail a read request and confirm the indicator returns with a dismissible alert.
-- Open a task from Recent Tasks. Its loaded activity clears; an update newer than the loaded conversation stays unread. Read icons are neutral and unread icons are yellow, as on Desktop.
-- Make the report read-state endpoint unavailable. Mark a report read, restart, and confirm it stays read locally. Restore the endpoint and confirm pending changes sync. Switch accounts and confirm pending changes remain separate.
-- Open a long conversation. Recent messages appear before older history is requested. Load older messages across an agent message and a tool-update boundary; text must join correctly without duplicate messages or lost live updates.
-- Render a Markdown table, nested list, inline and plain URL, image, insight, and Mermaid diagram. Links stay within their sentences; wide tables scroll horizontally.
-- Deny dictation permission. The Settings dialog can be closed, and no red warning remains in the composer. Other composer errors can be dismissed without deleting the draft.
+Removing the legacy source does not retire installed apps or their service registrations.
+Do not delete or change OAuth clients, Expo/EAS projects, signing credentials, store records, bundle identifiers, URL schemes, or notification configuration as part of this source cleanup.
+Any migration of those resources needs a separate review that accounts for existing installations and the replacement app.
diff --git a/docs/internal/monorepo-layout.md b/docs/internal/monorepo-layout.md
index d06700628eb2..5f0a8b59a3fc 100644
--- a/docs/internal/monorepo-layout.md
+++ b/docs/internal/monorepo-layout.md
@@ -70,7 +70,7 @@ User-facing features with their own backend (Django app) and frontend (React). E
See [products/README.md](/products/README.md) for how to create products. For new isolated products, see [products/architecture.md](/products/architecture.md) for design principles (DTOs, facades, isolation rules).
-One exception to the Django-plus-React shape: `products/desktop/` is the PostHog desktop app (Electron, plus mobile and web hosts), imported from the PostHog/code repo. It is a nested standalone pnpm workspace with its own lockfile, Node version and Biome toolchain, deliberately excluded from the root pnpm workspace, with its own `desktop-*` CI. Its `AGENTS.md` covers the architecture. Day to day, drive it through `hogli desktop:*` commands, or `cd products/desktop` and use pnpm directly.
+One exception to the Django-plus-React shape: `products/desktop/` is the PostHog desktop app (Electron, plus a web host), imported from the PostHog/code repo. It is a nested standalone pnpm workspace with its own lockfile, Node version and Biome toolchain, deliberately excluded from the root pnpm workspace, with its own `desktop-*` CI. Its `AGENTS.md` covers the architecture. Day to day, drive it through `hogli desktop:*` commands, or `cd products/desktop` and use pnpm directly.
The agent runtime the desktop app bundles is a second nested workspace at `packages/agent/` (`@posthog/agent` plus `agent-contracts`, `enricher`, `git` and `harness`), because cloud task sandboxes boot the published agent without the desktop app.
Desktop depends on it through `link:` paths, since turbo rejects a workspace member outside its root.
diff --git a/products/desktop/.gitignore b/products/desktop/.gitignore
index e36fac71d813..5911913f8ede 100644
--- a/products/desktop/.gitignore
+++ b/products/desktop/.gitignore
@@ -81,7 +81,6 @@ plugins/posthog/checkout-skills.ready
.claude/settings.local.json
CLAUDE.local.md
-apps/mobile/ROADMAP.md
# Local quill tarball for ChatX thread testing (not committed)
.local-quill/
diff --git a/products/desktop/AGENTS.md b/products/desktop/AGENTS.md
index 987b43ce387c..eb1cd0b769e4 100644
--- a/products/desktop/AGENTS.md
+++ b/products/desktop/AGENTS.md
@@ -6,7 +6,7 @@ Feature-level guides follow the same convention: the content lives in `<dir>/AGE
## Architecture
-PostHog uses a layered architecture. Business logic and UI live in shared `packages/*`. Each `apps/*` host boots those packages and binds host-specific implementations. `@posthog/core` and `@posthog/ui` must run unchanged on desktop, web, and mobile.
+PostHog uses a layered architecture. Business logic and UI live in shared `packages/*`. Each `apps/*` host boots those packages and binds host-specific implementations. `@posthog/core` and `@posthog/ui` must run unchanged on desktop and web.
Principle: logic is portable; hosts are thin.
@@ -43,7 +43,6 @@ Hosts:
- `apps/code`: Electron desktop host.
- `apps/web`: web host and portability smoke test.
-- `apps/mobile`: React Native host.
## Rules
@@ -195,7 +194,7 @@ packages/ui/src/features/<feature>/
- Tokens are standalone `export const TOKEN = Symbol.for("posthog.<area>.<thing>")` consts, defined beside the interface in the owning package. Standalone consts infer `unique symbol`, which is what lets a `BindingMap` key on them; object-literal token bags do not and are forbidden.
- Each composition root (`apps/code` main + renderer, `apps/web`, `packages/workspace-server`) owns a `BindingMap` interface mapping every token it binds to the bound type, and constructs `new TypedContainer<BindingMap>()` (from `@inversifyjs/strongly-typed`). `bind`/`get`/`isBound` are then checked against the map at compile time.
- Services bind in feature `.module.ts` files with `ContainerModule` (typed via `TypedContainerModule<BindingMap>` where the root is typed).
-- Hosts load modules in `desktop-contributions.ts` or the equivalent web/mobile composition file.
+- Hosts load modules in `desktop-contributions.ts` or the equivalent web composition file.
- Hosts bind platform implementations in `desktop-services.ts`, `main/index.ts`, or host equivalents.
- Hosts call `setRootContainer(container)` before resolving services through React or host seams.
- `CONTRIBUTION` starts subscriptions, commands, routes, menus, and feature boot.
@@ -226,24 +225,8 @@ await boot(container);
- `pnpm --filter <pkg> typecheck|test|build`: run a scoped task.
- `pnpm --filter code package|make`: package the Electron app.
- `node scripts/check-host-boundaries.mjs`: verify host boundary allowlist.
-- `node scripts/check-mobile-types.mjs`: typecheck `apps/mobile` against its error baseline.
- `pnpm --filter @posthog/api-client generate-client` (or the `@posthog/code` alias): regenerate the typed PostHog API client from the local OpenAPI schema. See [API client](#api-client).
-## Mobile Host Types
-
-`apps/mobile` typechecks against a baseline of pre-existing errors, not against zero.
-`pnpm typecheck` runs it like every other package; `scripts/check-mobile-types.mjs` fails only on errors absent from `scripts/mobile-type-baseline.json`.
-
-Metro strips types instead of checking them, so before this the mobile host was the one place a shared-package change could break without CI noticing — a new method on a `@posthog/platform` interface, a renamed `@posthog/core` export.
-
-After fixing baselined errors, shrink the baseline:
-
-```bash
-node scripts/check-mobile-types.mjs --prune
-```
-
-Do not use `--init` to baseline new errors.
-
## API client
`packages/api-client/src/generated.ts` is the typed PostHog API client. It is generated, formatted, and committed; never edit it by hand.
diff --git a/products/desktop/README.md b/products/desktop/README.md
index d9d5429b8b83..fdfe5acefebd 100644
--- a/products/desktop/README.md
+++ b/products/desktop/README.md
@@ -7,7 +7,7 @@ Found a bug or want to share feedback? Open the account menu in PostHog Desktop
# PostHog Desktop
-This is the source for the PostHog desktop and mobile apps and the agent framework that powers them.
+This is the source for the PostHog desktop and web hosts and the agent framework that powers them.
> [!NOTE]
> This directory lives at `products/desktop` inside [posthog/posthog](https://github.com/PostHog/posthog). If you already have that repo checked out, there is no separate clone: `cd products/desktop` and follow the setup below. It is a standalone pnpm workspace with its own lockfile and Node version.
@@ -67,7 +67,6 @@ Scripts in `scripts/` for development and debugging:
products/desktop/
├── apps/
│ ├── code/ # Electron desktop app (React, Vite)
-│ ├── mobile/ # React Native mobile app (Expo)
│ └── web/ # Web host (cloud-only)
├── packages/
│ ├── agent/ # TypeScript agent framework
@@ -84,7 +83,7 @@ products/desktop/
|------|-------------|
| [Documentation index](./docs/README.md) | Development, architecture, testing, operations, and feature guides |
| [Desktop app guide](./apps/code/README.md) | Building, signing, distribution, and workspace configuration |
-| [Mobile app guide](./apps/mobile/README.md) | Expo setup, EAS builds, and TestFlight deployment |
+| [Proposed mobile replacement](https://github.com/PostHog/posthog/pull/118584) | Independent native app proposed for `products/mobile` |
| [Architecture and code rules](./AGENTS.md) | Source of truth for architecture, code style, and testing rules |
| [Contributing](./CONTRIBUTING.md) | How to contribute to PostHog Desktop |
diff --git a/products/desktop/apps/mobile/.env.example b/products/desktop/apps/mobile/.env.example
deleted file mode 100644
index 3a0e65e00480..000000000000
--- a/products/desktop/apps/mobile/.env.example
+++ /dev/null
@@ -1,6 +0,0 @@
-# PostHog analytics destination. Both desktop and mobile report to the shared
-# posthog.com project (team 2) — events are segmented by the `team` and
-# `$app_namespace` properties. Production builds get these from EAS env vars
-# (EXPO_PUBLIC_* values are inlined at build time).
-EXPO_PUBLIC_POSTHOG_API_KEY=sTMFPsFhdP1Ssg
-EXPO_PUBLIC_POSTHOG_HOST=https://us.i.posthog.com
diff --git a/products/desktop/apps/mobile/.gitignore b/products/desktop/apps/mobile/.gitignore
deleted file mode 100644
index 4b0a6ea621bb..000000000000
--- a/products/desktop/apps/mobile/.gitignore
+++ /dev/null
@@ -1,41 +0,0 @@
-# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files
-
-# dependencies
-node_modules/
-
-# Expo
-.expo/
-dist/
-web-build/
-expo-env.d.ts
-
-# Native
-.kotlin/
-*.orig.*
-*.jks
-*.p8
-*.p12
-*.key
-*.mobileprovision
-
-# Metro
-.metro-health-check*
-
-# debug
-npm-debug.*
-yarn-debug.*
-yarn-error.*
-
-# macOS
-.DS_Store
-*.pem
-
-# local env files
-.env*.local
-
-# typescript
-*.tsbuildinfo
-
-# generated native folders
-/ios/*
-/android
diff --git a/products/desktop/apps/mobile/README.md b/products/desktop/apps/mobile/README.md
deleted file mode 100644
index 56fde82a45f8..000000000000
--- a/products/desktop/apps/mobile/README.md
+++ /dev/null
@@ -1,286 +0,0 @@
-# PostHog Mobile App
-
-React Native mobile app built with Expo and expo-router.
-
-## Quick Start
-
-From the **repository root**:
-
-```bash
-# Install dependencies (workspaces are wired up, so the root install covers mobile)
-pnpm install
-
-# Build and run on iOS simulator
-pnpm --filter @posthog/mobile ios
-
-# Start the development server (after initial build)
-pnpm --filter @posthog/mobile start
-```
-
-> First-time iOS setup also requires the **watchOS SDK** to be installed in Xcode — see [Prerequisites](#prerequisites).
-
-## Tech Stack
-
-- [Expo](https://expo.dev) - Build tooling, native APIs, OTA updates
-- [expo-router](https://docs.expo.dev/router/introduction/) - File-based routing
-- [NativeWind](https://www.nativewind.dev/) - Tailwind CSS for React Native
-- [React Query](https://tanstack.com/query) - Async data fetching and caching
-- [Zustand](https://zustand-demo.pmnd.rs/) - Client state management (UI state, selections, local flags)
-- [Phosphor Icons](https://phosphoricons.com/) - Icon library
-
-## Architecture
-
-### Feature Folders
-
-Code is organized by feature in `src/features/`. Features own native components, one-source hooks, and view state. They do not own copies of cloud contracts, transport, orchestration, or presentation rules.
-
-```
-src/features/
-├── auth/ # Authentication & user session
-│ ├── hooks/
-│ ├── lib/
-│ ├── stores/
-│ └── types.ts
-├── chat/ # PostHog AI chat interface
-│ ├── components/
-│ ├── hooks/
-│ ├── stores/
-│ └── types.ts
-├── inbox/ # Native inbox rendering and query hooks
-│ ├── components/
-│ ├── hooks/
-│ └── stores/
-└── tasks/ # Native cloud-task rendering and host adapters
- ├── components/
- ├── hooks/
- ├── services/
- └── stores/
-```
-
-### Portability boundary
-
-Mobile and desktop use the same cloud-task architecture. New work must preserve these ownership rules:
-
-- `@posthog/agent-contracts` owns runtime contracts and Zod schemas; `@posthog/shared` re-exports them for desktop code.
-- `@posthog/api-client` owns authenticated PostHog HTTPS transport and its request/response types.
-- `@posthog/core` owns cloud-task orchestration and headless presentation decisions, including sessions, queues, permissions, models, repositories, and inbox rules.
-- `apps/mobile` owns Expo lifecycle, React Native rendering, gestures, sheets, notifications, audio, secure storage, and small persisted view-state stores.
-- `@posthog/ui` owns the DOM/Quill renderer and web view state.
-
-Do not add a mobile API facade, duplicate a shared type, or re-export a core helper through a mobile file. Import the owning package directly. If desktop and mobile need different visuals, add a headless descriptor or decision function to core and keep two thin renderers.
-
-Intentional host differences are limited to platform capabilities and view state. Mobile may persist native navigation state, cached picker snapshots, optimistic attachment echoes, and notification preferences; it must not implement retries, reconnection, transport parsing, task lifecycle, or cross-store decisions in those stores.
-
-### File-Based Routing
-
-Routes for the screens are defined by the file structure in `src/app/` using expo-router.
-
-- `(tabs)/` - Parentheses create a layout group (tab navigator)
-- `_layout.tsx` - Configures the navigator for that directory
-- `[id].tsx` - Square brackets define dynamic route parameters
-- Stacks and modals live outside tab group, configured in `_layout.tsx`
-
-```
-src/app/
-├── _layout.tsx # Root layout
-├── index.tsx # Entry redirect
-├── auth.tsx # Auth screen (unauthenticated)
-├── (tabs)/ # Tabs group
-│ ├── _layout.tsx # Layout for all tabs
-│ ├── index.tsx # Home tab (Conversations)
-│ ├── tasks.tsx # Tasks tab
-│ └── settings.tsx # Settings tab
-├── chat/ # Chat stack
-│ ├── index.tsx # New chat
-│ └── [id].tsx # Chat by ID (dynamic route)
-└── task/ # Task stack
- ├── index.tsx # New task
- └── [id].tsx # Task by ID (dynamic route)
-```
-
-### Shared Code
-
-```
-src/
-├── components/ # Reusable UI components (Text, etc.)
-└── lib/
- ├── posthog.ts # Analytics setup
- ├── queryClient.ts # React Query client
- ├── theme.ts # Design tokens
- └── logger.ts # Logger setup
-```
-
-## Prerequisites
-
-- Node.js 22+
-- pnpm 10.23.0
-- Xcode (for iOS development)
-- **watchOS SDK** (iOS builds embed the Apple Watch companion; without this SDK installed, `expo run:ios` fails with `watchOS X.X must be installed in order to run the scheme`)
- - Install via `xcodebuild -downloadPlatform watchOS`, or in Xcode → **Settings → Components → Platforms** → download the latest watchOS
-- Android Studio (for Android development)
-- EAS CLI is optional — all `eas` commands below are invoked via `npx eas`. Install globally with `npm install -g eas-cli` only if you prefer the bare command.
-
-## Commands
-
-### From Repository Root
-
-All commands use `pnpm --filter @posthog/mobile <script>` to target this workspace package. (`-F` is a shorter alias for `--filter`.)
-
-**Development server:**
-```bash
-pnpm --filter @posthog/mobile start # Start Expo dev server
-pnpm --filter @posthog/mobile start:clear # Start with cleared Metro cache
-```
-
-**Build and run:**
-```bash
-pnpm --filter @posthog/mobile ios # iOS simulator
-pnpm --filter @posthog/mobile ios:device # iOS device (requires Apple Developer account)
-pnpm --filter @posthog/mobile android # Android emulator/device
-```
-
-**Native code generation:**
-```bash
-pnpm --filter @posthog/mobile prebuild # Generate ios/ and android/ folders
-pnpm --filter @posthog/mobile prebuild:clean # Delete and regenerate (when adding native deps)
-```
-
-**EAS builds:**
-```bash
-pnpm --filter @posthog/mobile build:dev # Development build (iOS, cloud)
-pnpm --filter @posthog/mobile build:dev:local # Development build (iOS, local)
-pnpm --filter @posthog/mobile build:preview # Preview build (iOS)
-pnpm --filter @posthog/mobile build:production # Production build (iOS)
-```
-
-**TestFlight:**
-```bash
-pnpm --filter @posthog/mobile testflight # Submit to TestFlight
-```
-
-**Utilities:**
-```bash
-pnpm install # Installs all workspaces, including mobile
-pnpm --filter @posthog/mobile lint # Run Biome check
-pnpm --filter @posthog/mobile lint:fix # Run Biome check with auto-fix
-pnpm --filter @posthog/mobile format # Run Biome format
-```
-
-### From apps/mobile/ Directory
-
-```bash
-cd apps/mobile
-
-# Development server
-pnpm start # alias for: expo start
-pnpm start:clear # alias for: expo start --clear
-
-# Build and run
-pnpm ios # alias for: expo run:ios
-pnpm ios:device # alias for: expo run:ios --device
-pnpm android # alias for: expo run:android
-
-# Generate native code
-pnpm prebuild # alias for: expo prebuild
-pnpm prebuild:clean # alias for: expo prebuild --clean
-
-# EAS builds (iOS) — pnpm aliases exist for these
-pnpm build:dev # eas build --profile development --platform ios
-pnpm build:dev:local # eas build --profile development --platform ios --local
-pnpm build:preview # eas build --profile preview --platform ios
-pnpm build:production # eas build --profile production --platform ios
-
-# EAS builds (Android) — no aliases, invoke directly
-npx eas build --profile development --platform android
-npx eas build --profile preview --platform android
-npx eas build --profile production --platform android
-
-# TestFlight
-pnpm testflight # alias for: eas submit --platform ios
-
-# Linting
-pnpm lint
-pnpm lint:fix
-pnpm format
-```
-
-## Prebuild Explained
-
-`expo prebuild` generates the native `ios/` and `android/` folders from your Expo configuration.
-
-**When to run `prebuild`:**
-- First time setting up the project
-- After adding/removing native dependencies (e.g., `expo-camera`, `react-native-maps`)
-- After changing `app.json` iOS/Android configuration
-- After updating Expo SDK version
-
-**When to use `--clean`:**
-- Switching between Expo SDK versions
-- Native build is failing and you want a fresh start
-- You've made manual changes to native files that you want to discard
-
-The `--clean` flag removes existing `ios/` and `android/` directories before regenerating.
-
-## Apple Watch companion
-
-> The iOS app embeds the watchOS companion as part of its build, so **the watchOS SDK must be installed in Xcode** even if you're only running on an iPhone simulator. Without it, `expo run:ios` fails before compilation with `watchOS X.X must be installed in order to run the scheme`. Install via `xcodebuild -downloadPlatform watchOS` or Xcode → **Settings → Components → Platforms**. This is a one-time setup.
-
-The watchOS companion is a native SwiftUI target generated during Expo prebuild by the local config plugin at `plugins/withWatchApp.js`.
-
-Canonical native source lives outside generated iOS output:
-
-- `native/watch/` — SwiftUI watch app source, Info.plists, and entitlements
-- `native/ios/` — iPhone WatchConnectivity bridge
-
-Generated output lives under `ios/`, including `ios/watch/`, `ios/PostHog/WatchTaskControlModule.*`, and `PostHog.xcodeproj/project.pbxproj`.
-
-### Watch architecture
-
-- iPhone remains the authenticated relay for the paired watch.
-- Mobile derives compact task snapshots from task/session state and sends them through WatchConnectivity.
-- Desktop-started local tasks work through the shared PostHog task run log/status backend, then iPhone relays to the watch.
-- Watch actions send compact commands back to iPhone, which routes them through existing mobile commands (`permission_response`, `cancel`, retry/resume, and handoff URLs).
-- Direct watch-to-Mac WatchConnectivity is not supported by Apple; Mac handoff uses `posthog-code://task/{taskId}/run/{taskRunId}`.
-
-### Rebuilding native watch targets
-
-```bash
-cd apps/mobile
-pnpm prebuild
-# or, when regenerating native projects:
-pnpm prebuild:clean
-```
-
-The `./plugins/withWatchApp` plugin copies native sources from `native/`, recreates the watch app/extension targets, and embeds them in the iOS app. If generated iOS files or Xcode targets drift, update `native/` and rerun prebuild instead of editing generated project files manually.
-
-### Running in simulators
-
-1. Open `ios/PostHog.xcworkspace` in Xcode.
-2. Select the iOS app scheme with a paired iPhone + Apple Watch simulator destination.
-3. Build/run the iOS app; Xcode should install the embedded watch app.
-4. Sign in on iPhone and open or start a PostHog task.
-5. Open the watch app and verify the mission overview, checklist, timeline, approvals, and blocker cards.
-
-### Verification checklist
-
-- Cloud task from phone/mac updates progress on watch.
-- Desktop/local task shows a `Local` badge and receives progress through persisted task run logs.
-- Approval card actions reach the existing permission response path.
-- Stop maps to the existing cancel command; retry maps to resume/retry from iPhone.
-- Open on iPhone uses `posthog://task/{taskId}`; Open on Mac uses `posthog-code://task/{taskId}/run/{taskRunId}`.
-- Haptics fire once for approval needed, completion, failure/stale blockers, and action acceptance — not on every polling update.
-- Intermittent connectivity shows cached mission state rather than raw errors/logs.
-
-## Build Profiles
-
-Defined in `eas.json`:
-
-| Profile | Purpose | Distribution |
-|---------|---------|--------------|
-| `development` | Dev client with debugging | Internal only |
-| `preview` | Production-like for testing | Internal only |
-| `production` | App Store / Play Store release | Public |
-
-**Local vs Cloud builds:**
-- Cloud (default): Runs on Expo's servers, no local Xcode needed
-- Local (`--local`): Runs on your machine, faster iteration, requires Xcode/Android SDK
\ No newline at end of file
diff --git a/products/desktop/apps/mobile/app.json b/products/desktop/apps/mobile/app.json
deleted file mode 100644
index c22c8dc8d117..000000000000
--- a/products/desktop/apps/mobile/app.json
+++ /dev/null
@@ -1,131 +0,0 @@
-{
- "expo": {
- "name": "PostHog",
- "slug": "posthog",
- "version": "1.0.0",
- "orientation": "portrait",
- "userInterfaceStyle": "automatic",
- "scheme": "posthog",
- "icon": "./assets/app-icon.png",
- "ios": {
- "icon": "./assets/app.icon",
- "supportsTablet": true,
- "bundleIdentifier": "com.posthog.code.mobile",
- "associatedDomains": ["applinks:code.posthog.com"],
- "infoPlist": {
- "NSMicrophoneUsageDescription": "Allow PostHog to use your microphone for voice-to-text input",
- "NSSpeechRecognitionUsageDescription": "Allow PostHog to transcribe your voice input on-device",
- "NSPhotoLibraryUsageDescription": "Allow PostHog to access your photos for attaching images to tasks",
- "NSCameraUsageDescription": "Allow PostHog to use your camera to scan QR codes for sign-in",
- "ITSAppUsesNonExemptEncryption": false,
- "LSApplicationQueriesSchemes": ["posthog-code"]
- }
- },
- "android": {
- "adaptiveIcon": {
- "foregroundImage": "./assets/adaptive-icon.png",
- "backgroundColor": "#FFFFFF"
- },
- "predictiveBackGestureEnabled": false,
- "package": "com.posthog.code.mobile",
- "permissions": [
- "android.permission.RECORD_AUDIO",
- "android.permission.MODIFY_AUDIO_SETTINGS",
- "android.permission.CAMERA"
- ],
- "intentFilters": [
- {
- "action": "VIEW",
- "autoVerify": true,
- "data": [
- {
- "scheme": "https",
- "host": "code.posthog.com"
- }
- ],
- "category": ["BROWSABLE", "DEFAULT"]
- }
- ]
- },
- "web": {
- "favicon": "./assets/favicon.png"
- },
- "plugins": [
- "expo-router",
- "expo-audio",
- [
- "expo-camera",
- {
- "cameraPermission": "Allow PostHog to use your camera to scan QR codes for sign-in"
- }
- ],
- "./plugins/withPodfileResourceBundleFix",
- [
- "expo-font",
- {
- "android": {
- "fonts": [
- {
- "fontFamily": "Open Runde",
- "fontDefinitions": [
- {
- "path": "./assets/fonts/OpenRunde/OpenRunde-Regular.ttf",
- "weight": 400
- },
- {
- "path": "./assets/fonts/OpenRunde/OpenRunde-Medium.ttf",
- "weight": 500
- },
- {
- "path": "./assets/fonts/OpenRunde/OpenRunde-Semibold.ttf",
- "weight": 600
- },
- {
- "path": "./assets/fonts/OpenRunde/OpenRunde-Bold.ttf",
- "weight": 700
- }
- ]
- }
- ]
- },
- "ios": {
- "fonts": [
- "./assets/fonts/OpenRunde/OpenRunde-Regular.ttf",
- "./assets/fonts/OpenRunde/OpenRunde-Medium.ttf",
- "./assets/fonts/OpenRunde/OpenRunde-Semibold.ttf",
- "./assets/fonts/OpenRunde/OpenRunde-Bold.ttf"
- ]
- }
- }
- ],
- "expo-localization",
- "expo-notifications",
- "./plugins/with-adi-registration",
- [
- "expo-speech-recognition",
- {
- "microphonePermission": "Allow PostHog to use your microphone for voice-to-text input",
- "speechRecognitionPermission": "Allow PostHog to transcribe your voice input on-device"
- }
- ],
- "expo-secure-store",
- [
- "expo-splash-screen",
- {
- "image": "./assets/splash-icon.png",
- "resizeMode": "contain",
- "backgroundColor": "#0f0f0f"
- }
- ],
- "expo-status-bar",
- "expo-web-browser"
- ],
- "extra": {
- "router": {},
- "eas": {
- "projectId": "4eb57b2f-79f6-4ab0-ae2c-bbd82af2cef9"
- }
- },
- "owner": "posthog"
- }
-}
diff --git a/products/desktop/apps/mobile/assets/adaptive-icon.png b/products/desktop/apps/mobile/assets/adaptive-icon.png
deleted file mode 100644
index c44991ba0846..000000000000
Binary files a/products/desktop/apps/mobile/assets/adaptive-icon.png and /dev/null differ
diff --git a/products/desktop/apps/mobile/assets/app-icon.png b/products/desktop/apps/mobile/assets/app-icon.png
deleted file mode 100644
index c44991ba0846..000000000000
Binary files a/products/desktop/apps/mobile/assets/app-icon.png and /dev/null differ
diff --git a/products/desktop/apps/mobile/assets/app.icon/Assets/logo.png b/products/desktop/apps/mobile/assets/app.icon/Assets/logo.png
deleted file mode 100644
index c44991ba0846..000000000000
Binary files a/products/desktop/apps/mobile/assets/app.icon/Assets/logo.png and /dev/null differ
diff --git a/products/desktop/apps/mobile/assets/app.icon/icon.json b/products/desktop/apps/mobile/assets/app.icon/icon.json
deleted file mode 100644
index 76c74d9b86f7..000000000000
--- a/products/desktop/apps/mobile/assets/app.icon/icon.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- "fill": {
- "solid": "display-p3:0.97647,0.93333,0.88235,1.00000"
- },
- "groups": [
- {
- "blur-material": null,
- "layers": [
- {
- "glass": false,
- "image-name": "logo.png",
- "name": "logo"
- }
- ],
- "lighting": "individual",
- "shadow": {
- "kind": "neutral",
- "opacity": 0.5
- },
- "specular": true,
- "translucency": {
- "enabled": true,
- "value": 0.5
- }
- }
- ],
- "supported-platforms": {
- "circles": ["watchOS"],
- "squares": "shared"
- }
-}
diff --git a/products/desktop/apps/mobile/assets/favicon.png b/products/desktop/apps/mobile/assets/favicon.png
deleted file mode 100644
index d37491d1692e..000000000000
Binary files a/products/desktop/apps/mobile/assets/favicon.png and /dev/null differ
diff --git a/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-Bold.ttf b/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-Bold.ttf
deleted file mode 100644
index 8c93043de645..000000000000
Binary files a/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-Bold.ttf and /dev/null differ
diff --git a/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-BoldItalic.ttf b/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-BoldItalic.ttf
deleted file mode 100644
index 1ddf216d1884..000000000000
Binary files a/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-BoldItalic.ttf and /dev/null differ
diff --git a/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-ExtraBold.ttf b/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-ExtraBold.ttf
deleted file mode 100644
index 435d7a726594..000000000000
Binary files a/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-ExtraBold.ttf and /dev/null differ
diff --git a/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-ExtraBoldItalic.ttf b/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-ExtraBoldItalic.ttf
deleted file mode 100644
index 79e616ebc740..000000000000
Binary files a/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-ExtraBoldItalic.ttf and /dev/null differ
diff --git a/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-ExtraLight.ttf b/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-ExtraLight.ttf
deleted file mode 100644
index c131cbf2c60c..000000000000
Binary files a/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-ExtraLight.ttf and /dev/null differ
diff --git a/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-ExtraLightItalic.ttf b/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-ExtraLightItalic.ttf
deleted file mode 100644
index a768985bdfe7..000000000000
Binary files a/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-ExtraLightItalic.ttf and /dev/null differ
diff --git a/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-Italic.ttf b/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-Italic.ttf
deleted file mode 100644
index ccc9d6a5bc15..000000000000
Binary files a/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-Italic.ttf and /dev/null differ
diff --git a/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-Light.ttf b/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-Light.ttf
deleted file mode 100644
index 15f15a2a121f..000000000000
Binary files a/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-Light.ttf and /dev/null differ
diff --git a/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-LightItalic.ttf b/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-LightItalic.ttf
deleted file mode 100644
index 506208f6bb73..000000000000
Binary files a/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-LightItalic.ttf and /dev/null differ
diff --git a/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-Medium.ttf b/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-Medium.ttf
deleted file mode 100644
index 97671156df25..000000000000
Binary files a/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-Medium.ttf and /dev/null differ
diff --git a/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-MediumItalic.ttf b/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-MediumItalic.ttf
deleted file mode 100644
index 415a9e34d350..000000000000
Binary files a/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-MediumItalic.ttf and /dev/null differ
diff --git a/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-Regular.ttf b/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-Regular.ttf
deleted file mode 100644
index dff66cc50702..000000000000
Binary files a/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-Regular.ttf and /dev/null differ
diff --git a/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-SemiBold.ttf b/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-SemiBold.ttf
deleted file mode 100644
index a70e69bd21aa..000000000000
Binary files a/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-SemiBold.ttf and /dev/null differ
diff --git a/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-SemiBoldItalic.ttf b/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-SemiBoldItalic.ttf
deleted file mode 100644
index 968602e88d18..000000000000
Binary files a/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-SemiBoldItalic.ttf and /dev/null differ
diff --git a/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-Thin.ttf b/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-Thin.ttf
deleted file mode 100644
index 7dbe2ac6ba53..000000000000
Binary files a/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-Thin.ttf and /dev/null differ
diff --git a/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-ThinItalic.ttf b/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-ThinItalic.ttf
deleted file mode 100644
index c6ad6c219402..000000000000
Binary files a/products/desktop/apps/mobile/assets/fonts/JetBrainsMono-ThinItalic.ttf and /dev/null differ
diff --git a/products/desktop/apps/mobile/assets/fonts/OpenRunde/OpenRunde-Bold.ttf b/products/desktop/apps/mobile/assets/fonts/OpenRunde/OpenRunde-Bold.ttf
deleted file mode 100644
index 323c57d5e611..000000000000
Binary files a/products/desktop/apps/mobile/assets/fonts/OpenRunde/OpenRunde-Bold.ttf and /dev/null differ
diff --git a/products/desktop/apps/mobile/assets/fonts/OpenRunde/OpenRunde-Medium.ttf b/products/desktop/apps/mobile/assets/fonts/OpenRunde/OpenRunde-Medium.ttf
deleted file mode 100644
index 60327fe3b322..000000000000
Binary files a/products/desktop/apps/mobile/assets/fonts/OpenRunde/OpenRunde-Medium.ttf and /dev/null differ
diff --git a/products/desktop/apps/mobile/assets/fonts/OpenRunde/OpenRunde-Regular.ttf b/products/desktop/apps/mobile/assets/fonts/OpenRunde/OpenRunde-Regular.ttf
deleted file mode 100644
index 6d795419d2f6..000000000000
Binary files a/products/desktop/apps/mobile/assets/fonts/OpenRunde/OpenRunde-Regular.ttf and /dev/null differ
diff --git a/products/desktop/apps/mobile/assets/fonts/OpenRunde/OpenRunde-Semibold.ttf b/products/desktop/apps/mobile/assets/fonts/OpenRunde/OpenRunde-Semibold.ttf
deleted file mode 100644
index b11dc30a3c0d..000000000000
Binary files a/products/desktop/apps/mobile/assets/fonts/OpenRunde/OpenRunde-Semibold.ttf and /dev/null differ
diff --git a/products/desktop/apps/mobile/assets/sounds/drop.mp3 b/products/desktop/apps/mobile/assets/sounds/drop.mp3
deleted file mode 100644
index d2da29d0e330..000000000000
Binary files a/products/desktop/apps/mobile/assets/sounds/drop.mp3 and /dev/null differ
diff --git a/products/desktop/apps/mobile/assets/sounds/icq.mp3 b/products/desktop/apps/mobile/assets/sounds/icq.mp3
deleted file mode 100644
index c279380a0000..000000000000
Binary files a/products/desktop/apps/mobile/assets/sounds/icq.mp3 and /dev/null differ
diff --git a/products/desktop/apps/mobile/assets/sounds/knock.mp3 b/products/desktop/apps/mobile/assets/sounds/knock.mp3
deleted file mode 100644
index 674527c806a2..000000000000
Binary files a/products/desktop/apps/mobile/assets/sounds/knock.mp3 and /dev/null differ
diff --git a/products/desktop/apps/mobile/assets/sounds/meep-smol.mp3 b/products/desktop/apps/mobile/assets/sounds/meep-smol.mp3
deleted file mode 100644
index 5dce1864c789..000000000000
Binary files a/products/desktop/apps/mobile/assets/sounds/meep-smol.mp3 and /dev/null differ
diff --git a/products/desktop/apps/mobile/assets/sounds/meep.mp3 b/products/desktop/apps/mobile/assets/sounds/meep.mp3
deleted file mode 100644
index fd7b4cf7e0af..000000000000
Binary files a/products/desktop/apps/mobile/assets/sounds/meep.mp3 and /dev/null differ
diff --git a/products/desktop/apps/mobile/assets/sounds/ring.mp3 b/products/desktop/apps/mobile/assets/sounds/ring.mp3
deleted file mode 100644
index b5b1b8bd1170..000000000000
Binary files a/products/desktop/apps/mobile/assets/sounds/ring.mp3 and /dev/null differ
diff --git a/products/desktop/apps/mobile/assets/sounds/shoot.mp3 b/products/desktop/apps/mobile/assets/sounds/shoot.mp3
deleted file mode 100644
index bb3f9bc308d1..000000000000
Binary files a/products/desktop/apps/mobile/assets/sounds/shoot.mp3 and /dev/null differ
diff --git a/products/desktop/apps/mobile/assets/sounds/slide.mp3 b/products/desktop/apps/mobile/assets/sounds/slide.mp3
deleted file mode 100644
index 9ea8649f1da3..000000000000
Binary files a/products/desktop/apps/mobile/assets/sounds/slide.mp3 and /dev/null differ
diff --git a/products/desktop/apps/mobile/assets/splash-icon.png b/products/desktop/apps/mobile/assets/splash-icon.png
deleted file mode 100644
index 311441d69c81..000000000000
Binary files a/products/desktop/apps/mobile/assets/splash-icon.png and /dev/null differ
diff --git a/products/desktop/apps/mobile/babel.config.js b/products/desktop/apps/mobile/babel.config.js
deleted file mode 100644
index adde72108f41..000000000000
--- a/products/desktop/apps/mobile/babel.config.js
+++ /dev/null
@@ -1,9 +0,0 @@
-module.exports = (api) => {
- api.cache(true);
- return {
- presets: [
- ["babel-preset-expo", { jsxImportSource: "nativewind" }],
- "nativewind/babel",
- ],
- };
-};
diff --git a/products/desktop/apps/mobile/eas.json b/products/desktop/apps/mobile/eas.json
deleted file mode 100644
index 8a5188286075..000000000000
--- a/products/desktop/apps/mobile/eas.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
- "cli": {
- "version": ">= 16.28.0",
- "appVersionSource": "remote"
- },
- "build": {
- "base": {
- "node": "22.19.0"
- },
- "development": {
- "extends": "base",
- "developmentClient": true,
- "distribution": "internal"
- },
- "preview": {
- "extends": "base",
- "distribution": "internal"
- },
- "production": {
- "extends": "base",
- "autoIncrement": true,
- "android": {
- "buildType": "app-bundle"
- }
- },
- "play-registration": {
- "extends": "base",
- "distribution": "internal",
- "android": {
- "buildType": "apk"
- }
- }
- },
- "submit": {
- "production": {
- "ios": {
- "ascAppId": "6762366098"
- },
- "android": {
- "track": "internal"
- }
- }
- }
-}
diff --git a/products/desktop/apps/mobile/global.css b/products/desktop/apps/mobile/global.css
deleted file mode 100644
index b5c61c956711..000000000000
--- a/products/desktop/apps/mobile/global.css
+++ /dev/null
@@ -1,3 +0,0 @@
-@tailwind base;
-@tailwind components;
-@tailwind utilities;
diff --git a/products/desktop/apps/mobile/index.js b/products/desktop/apps/mobile/index.js
deleted file mode 100644
index 80d3d998f1d0..000000000000
--- a/products/desktop/apps/mobile/index.js
+++ /dev/null
@@ -1 +0,0 @@
-import "expo-router/entry";
diff --git a/products/desktop/apps/mobile/metro.config.js b/products/desktop/apps/mobile/metro.config.js
deleted file mode 100644
index f50070c98b71..000000000000
--- a/products/desktop/apps/mobile/metro.config.js
+++ /dev/null
@@ -1,78 +0,0 @@
-const { getDefaultConfig } = require("expo/metro-config");
-const { withNativeWind } = require("nativewind/metro");
-const path = require("node:path");
-
-const projectRoot = __dirname;
-const monorepoRoot = path.resolve(projectRoot, "../..");
-const agentContractsRoot = path.resolve(
- monorepoRoot,
- "../../packages/agent/packages/agent-contracts",
-);
-
-const config = getDefaultConfig(projectRoot);
-
-// Metro only bundles files under a watched folder, so agent-contracts is listed too.
-config.watchFolders = [monorepoRoot, agentContractsRoot];
-
-// Let Metro find modules in both locations
-config.resolver.nodeModulesPaths = [
- path.resolve(projectRoot, "node_modules"),
- path.resolve(monorepoRoot, "node_modules"),
-];
-
-// Force React to resolve from monorepo root
-config.resolver.extraNodeModules = {
- react: path.resolve(monorepoRoot, "node_modules/react"),
-};
-
-// Apply NativeWind first so its resolver/transformer changes are in place
-// before we layer the SVG transformer on top.
-const nativeWindConfig = withNativeWind(config, { input: "./global.css" });
-
-// Treat .svg files as React components via react-native-svg-transformer so
-// we can `import Icon from "./logo.svg"` and render it like any RN component.
-// This must run AFTER withNativeWind — NativeWind overwrites the resolver
-// and would clobber the assetExts/sourceExts changes if applied later.
-nativeWindConfig.transformer = {
- ...nativeWindConfig.transformer,
- babelTransformerPath: require.resolve("react-native-svg-transformer/expo"),
-};
-nativeWindConfig.resolver = {
- ...nativeWindConfig.resolver,
- assetExts: nativeWindConfig.resolver.assetExts.filter((ext) => ext !== "svg"),
- sourceExts: [...nativeWindConfig.resolver.sourceExts, "svg"],
-};
-
-// Resolve @posthog/shared, and the @posthog/agent-contracts package it
-// re-exports, to their TypeScript source so Babel transpiles them.
-// Their package.json `exports` point at `dist/`, which is only present after a
-// `pnpm build` -- EAS Build never runs one, so bundling there fails outright.
-// This must be a resolveRequest hook rather than an `extraNodeModules` alias:
-// pnpm symlinks the package into node_modules, so Metro resolves it there
-// first and never consults the alias, and an alias also cannot map subpath
-// imports like `@posthog/shared/domain-types`.
-const SOURCE_RESOLVED_PACKAGES = {
- "@posthog/shared": path.resolve(monorepoRoot, "packages/shared/src"),
- "@posthog/agent-contracts": path.resolve(agentContractsRoot, "src"),
-};
-const upstreamResolveRequest = nativeWindConfig.resolver.resolveRequest;
-
-nativeWindConfig.resolver.resolveRequest = (context, moduleName, platform) => {
- for (const [packageName, src] of Object.entries(SOURCE_RESOLVED_PACKAGES)) {
- if (
- moduleName === packageName ||
- moduleName.startsWith(`${packageName}/`)
- ) {
- const subpath = moduleName.slice(packageName.length + 1) || "index";
- return context.resolveRequest(context, path.join(src, subpath), platform);
- }
- }
-
- return (upstreamResolveRequest ?? context.resolveRequest)(
- context,
- moduleName,
- platform,
- );
-};
-
-module.exports = nativeWindConfig;
diff --git a/products/desktop/apps/mobile/nativewind-env.d.ts b/products/desktop/apps/mobile/nativewind-env.d.ts
deleted file mode 100644
index a13e3136bbdc..000000000000
--- a/products/desktop/apps/mobile/nativewind-env.d.ts
+++ /dev/null
@@ -1 +0,0 @@
-/// <reference types="nativewind/types" />
diff --git a/products/desktop/apps/mobile/package.json b/products/desktop/apps/mobile/package.json
deleted file mode 100644
index 7e429d39164c..000000000000
--- a/products/desktop/apps/mobile/package.json
+++ /dev/null
@@ -1,112 +0,0 @@
-{
- "name": "@posthog/mobile",
- "version": "1.0.0",
- "main": "./index.js",
- "scripts": {
- "start": "expo start",
- "start:clear": "expo start --clear",
- "android": "expo run:android",
- "ios": "expo run:ios",
- "ios:device": "expo run:ios --device",
- "web": "expo start --web",
- "typecheck": "node ../../scripts/check-mobile-types.mjs",
- "test": "vitest run",
- "test:watch": "vitest",
- "prebuild": "expo prebuild",
- "prebuild:clean": "expo prebuild --clean",
- "build:dev": "eas build --profile development --platform ios",
- "build:dev:local": "eas build --profile development --platform ios --local",
- "build:preview": "eas build --profile preview --platform ios",
- "build:production": "eas build --profile production --platform ios",
- "testflight": "eas submit --platform ios",
- "lint": "biome check .",
- "lint:fix": "biome check --write .",
- "format": "biome format --write .",
- "clean": "node ../../scripts/rimraf.mjs .turbo .expo"
- },
- "expo": {
- "autolinking": {
- "buildFromSource": [
- "react-native-worklets"
- ]
- },
- "install": {
- "exclude": [
- "react",
- "react-dom",
- "typescript"
- ]
- }
- },
- "dependencies": {
- "@expo/metro-runtime": "~57.0.7",
- "@expo/ui": "57.0.7",
- "@modelcontextprotocol/ext-apps": "^1.2.2",
- "@modelcontextprotocol/sdk": "^1.29.0",
- "@posthog/api-client": "workspace:*",
- "@posthog/core": "workspace:*",
- "@posthog/react-native-plugin": "^2.13.0",
- "@posthog/shared": "workspace:*",
- "@react-native-async-storage/async-storage": "^2.2.0",
- "@react-native-community/netinfo": "^12.0.1",
- "@tanstack/react-query": "^5.90.12",
- "date-fns": "^4.1.0",
- "expo": "~57.0.8",
- "expo-application": "~57.0.2",
- "expo-audio": "~57.0.3",
- "expo-auth-session": "^57.0.5",
- "expo-camera": "^57.0.3",
- "expo-clipboard": "^57.0.1",
- "expo-constants": "~57.0.7",
- "expo-crypto": "^57.0.1",
- "expo-dev-client": "~57.0.9",
- "expo-device": "~57.0.1",
- "expo-document-picker": "~57.0.1",
- "expo-file-system": "~57.0.1",
- "expo-font": "^57.0.1",
- "expo-glass-effect": "~57.0.1",
- "expo-haptics": "^57.0.1",
- "expo-image-picker": "~57.0.6",
- "expo-linear-gradient": "^57.0.1",
- "expo-linking": "~57.0.4",
- "expo-localization": "~57.0.1",
- "expo-notifications": "~57.0.7",
- "expo-router": "~57.0.8",
- "expo-secure-store": "^57.0.1",
- "expo-speech-recognition": "^56.0.1",
- "expo-splash-screen": "~57.0.5",
- "expo-status-bar": "~57.0.1",
- "expo-system-ui": "~57.0.1",
- "expo-video": "~57.0.3",
- "expo-web-browser": "^57.0.2",
- "highlight.js": "^11.11.1",
- "nativewind": "^4.2.1",
- "phosphor-react-native": "^3.0.2",
- "posthog-react-native": "^4.83.0",
- "react": "catalog:",
- "react-dom": "catalog:",
- "react-native": "0.86.0",
- "react-native-keyboard-controller": "1.21.9",
- "react-native-reanimated": "~4.5.0",
- "react-native-safe-area-context": "~5.7.0",
- "react-native-screens": "~4.26.2",
- "react-native-svg": "^15.15.4",
- "react-native-web": "^0.21.2",
- "react-native-webview": "^13.16.1",
- "react-native-worklets": "0.10.0",
- "zustand": "^4.5.7"
- },
- "devDependencies": {
- "@testing-library/react-native": "^13.3.3",
- "@types/react": "^19.2.0",
- "@types/react-test-renderer": "^19.1.0",
- "@vitejs/plugin-react": "^4.7.0",
- "react-native-svg-transformer": "^1.5.3",
- "react-test-renderer": "19.2.6",
- "tailwindcss": "^3.4.18",
- "typescript": "~5.9.2",
- "vite": "^6.4.1",
- "vitest": "^4.1.6"
- },
- "private": true
-}
diff --git a/products/desktop/apps/mobile/plugins/PostHogSceneDelegate.swift b/products/desktop/apps/mobile/plugins/PostHogSceneDelegate.swift
deleted file mode 100644
index 5105ac4be0c5..000000000000
--- a/products/desktop/apps/mobile/plugins/PostHogSceneDelegate.swift
+++ /dev/null
@@ -1,71 +0,0 @@
-class PostHogSceneDelegate: UIResponder, UIWindowSceneDelegate {
- var window: UIWindow?
-
- private var appDelegate: AppDelegate? {
- UIApplication.shared.delegate as? AppDelegate
- }
-
- func scene(
- _ scene: UIScene,
- willConnectTo session: UISceneSession,
- options connectionOptions: UIScene.ConnectionOptions
- ) {
- guard let windowScene = scene as? UIWindowScene,
- let appDelegate,
- let factory = appDelegate.reactNativeFactory else { return }
-
- let window = UIWindow(windowScene: windowScene)
- self.window = window
- appDelegate.window = window
-
- var launchOptions = appDelegate.initialLaunchOptions ?? [:]
- if let context = connectionOptions.urlContexts.first {
- launchOptions[.url] = context.url
- launchOptions[.sourceApplication] = context.options.sourceApplication
- }
- if let activity = connectionOptions.userActivities.first {
- launchOptions[.userActivityDictionary] = [
- "UIApplicationLaunchOptionsUserActivityKey": activity,
- "UIApplicationLaunchOptionsUserActivityTypeKey": activity.activityType,
- ]
- }
-
- factory.startReactNative(withModuleName: "main", in: window, launchOptions: launchOptions)
- window.makeKeyAndVisible()
- self.scene(scene, openURLContexts: connectionOptions.urlContexts)
- for activity in connectionOptions.userActivities {
- self.scene(scene, continue: activity)
- }
- }
-
- func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
- for context in URLContexts {
- var options: [UIApplication.OpenURLOptionsKey: Any] = [
- .openInPlace: context.options.openInPlace,
- ]
- options[.sourceApplication] = context.options.sourceApplication
- options[.annotation] = context.options.annotation
- _ = appDelegate?.application(UIApplication.shared, open: context.url, options: options)
- }
- }
-
- func scene(_ scene: UIScene, continue userActivity: NSUserActivity) {
- _ = appDelegate?.application(UIApplication.shared, continue: userActivity, restorationHandler: { _ in })
- }
-
- func sceneDidBecomeActive(_ scene: UIScene) {
- appDelegate?.applicationDidBecomeActive(UIApplication.shared)
- }
-
- func sceneWillResignActive(_ scene: UIScene) {
- appDelegate?.applicationWillResignActive(UIApplication.shared)
- }
-
- func sceneWillEnterForeground(_ scene: UIScene) {
- appDelegate?.applicationWillEnterForeground(UIApplication.shared)
- }
-
- func sceneDidEnterBackground(_ scene: UIScene) {
- appDelegate?.applicationDidEnterBackground(UIApplication.shared)
- }
-}
diff --git a/products/desktop/apps/mobile/plugins/with-adi-registration.js b/products/desktop/apps/mobile/plugins/with-adi-registration.js
deleted file mode 100644
index 84de2709aa3c..000000000000
--- a/products/desktop/apps/mobile/plugins/with-adi-registration.js
+++ /dev/null
@@ -1,26 +0,0 @@
-const { withDangerousMod } = require("expo/config-plugins");
-const fs = require("node:fs");
-const path = require("node:path");
-
-const ADI_SNIPPET = "D4HHLU7245454AAAAAAAAAAAAA";
-
-module.exports = function withAdiRegistration(config) {
- return withDangerousMod(config, [
- "android",
- async (cfg) => {
- const assetsDir = path.join(
- cfg.modRequest.platformProjectRoot,
- "app",
- "src",
- "main",
- "assets",
- );
- fs.mkdirSync(assetsDir, { recursive: true });
- fs.writeFileSync(
- path.join(assetsDir, "adi-registration.properties"),
- ADI_SNIPPET,
- );
- return cfg;
- },
- ]);
-};
diff --git a/products/desktop/apps/mobile/plugins/withIosBuildCompatibility.js b/products/desktop/apps/mobile/plugins/withIosBuildCompatibility.js
deleted file mode 100644
index 19745ffbe1fb..000000000000
--- a/products/desktop/apps/mobile/plugins/withIosBuildCompatibility.js
+++ /dev/null
@@ -1,28 +0,0 @@
-const {
- withPodfileProperties,
- withXcodeProject,
-} = require("expo/config-plugins");
-const fs = require("node:fs");
-const path = require("node:path");
-
-module.exports = function withIosBuildCompatibility(config) {
- config = withPodfileProperties(config, (cfg) => {
- // ExpoVideo's precompiled binary references a symbol absent from ExpoModulesCore 57.0.7.
- cfg.modResults.EXPO_USE_PRECOMPILED_MODULES = "false";
- return cfg;
- });
- return withXcodeProject(config, (cfg) => {
- const name = cfg.modRequest.projectName;
- const schemes = path.join(
- cfg.modRequest.platformProjectRoot,
- `${name}.xcodeproj`,
- "xcshareddata/xcschemes",
- );
- // The PostHog SDK pod also exports a PostHog scheme; CLI builds can select the library.
- fs.copyFileSync(
- path.join(schemes, `${name}.xcscheme`),
- path.join(schemes, "PostHogMobile.xcscheme"),
- );
- return cfg;
- });
-};
diff --git a/products/desktop/apps/mobile/plugins/withPodfileResourceBundleFix.js b/products/desktop/apps/mobile/plugins/withPodfileResourceBundleFix.js
deleted file mode 100644
index fb2a190bdffa..000000000000
--- a/products/desktop/apps/mobile/plugins/withPodfileResourceBundleFix.js
+++ /dev/null
@@ -1,99 +0,0 @@
-// Xcode 14+ refuses to build resource-bundle targets that don't have a
-// development team set. Several common Pods (react-native-svg in
-// particular) ship bundles without a team and break EAS builds with:
-//
-// "Starting from Xcode 14, resource bundles are signed by default,
-// which requires setting the development team for each resource
-// bundle target."
-//
-// Disabling code signing for those bundle targets is the standard
-// workaround — they don't actually need to be signed because the host
-// app's signature covers them at runtime.
-//
-// Injecting this via a config plugin (instead of hand-editing Podfile)
-// means `expo prebuild --clean` won't wipe the fix.
-
-const { withDangerousMod } = require("@expo/config-plugins");
-const fs = require("node:fs");
-const path = require("node:path");
-
-const MARKER = "# CODE_SIGNING_ALLOWED resource-bundle fix";
-
-const POST_INSTALL_SNIPPET = `
- ${MARKER}
- installer.pods_project.targets.each do |target|
- if target.respond_to?(:product_type) && target.product_type == "com.apple.product-type.bundle"
- target.build_configurations.each do |config|
- config.build_settings["CODE_SIGNING_ALLOWED"] = "NO"
- end
- end
- end
-`;
-
-const withPodfileResourceBundleFix = (config) =>
- withDangerousMod(config, [
- "ios",
- async (cfg) => {
- const podfilePath = path.join(
- cfg.modRequest.platformProjectRoot,
- "Podfile",
- );
- const contents = fs.readFileSync(podfilePath, "utf8");
-
- if (contents.includes(MARKER)) {
- return cfg;
- }
-
- // Inject the snippet at the END of the existing post_install block.
- // The block opens with `post_install do |installer|` and closes at
- // the matching `end` — we find the closing `end` of that block by
- // tracking nesting depth.
- const startMatch = contents.match(/post_install do \|installer\|/);
- if (!startMatch) {
- throw new Error(
- "[withPodfileResourceBundleFix] could not find a post_install block to patch",
- );
- }
- const startIdx = startMatch.index + startMatch[0].length;
- const lines = contents.slice(startIdx).split("\n");
- let depth = 1;
- let endLineOffset = -1;
- for (let i = 0; i < lines.length; i++) {
- const line = lines[i].trim();
- // crude but sufficient for the generated Podfile shape
- if (
- /\bdo\b/.test(line) ||
- /^(if|begin|case|class|def|module)\b/.test(line)
- ) {
- depth += 1;
- }
- if (/^end\b/.test(line)) {
- depth -= 1;
- if (depth === 0) {
- endLineOffset = i;
- break;
- }
- }
- }
- if (endLineOffset === -1) {
- throw new Error(
- "[withPodfileResourceBundleFix] could not find the end of the post_install block",
- );
- }
-
- // Insert our snippet just before that closing `end`.
- const insertAt =
- startIdx +
- lines.slice(0, endLineOffset).join("\n").length +
- (endLineOffset > 0 ? 1 : 0);
- const patched =
- contents.slice(0, insertAt) +
- POST_INSTALL_SNIPPET +
- contents.slice(insertAt);
-
- fs.writeFileSync(podfilePath, patched, "utf8");
- return cfg;
- },
- ]);
-
-module.exports = withPodfileResourceBundleFix;
diff --git a/products/desktop/apps/mobile/plugins/withSceneLifecycle.js b/products/desktop/apps/mobile/plugins/withSceneLifecycle.js
deleted file mode 100644
index 356e5e566283..000000000000
--- a/products/desktop/apps/mobile/plugins/withSceneLifecycle.js
+++ /dev/null
@@ -1,52 +0,0 @@
-const { withAppDelegate, withInfoPlist } = require("expo/config-plugins");
-const fs = require("node:fs");
-const path = require("node:path");
-
-const startup =
- / {4}window = UIWindow\(frame: UIScreen\.main\.bounds\)\s+factory\.startReactNative\(\s+withModuleName: "main",\s+in: window,\s+launchOptions: launchOptions\)/;
-
-module.exports = function withSceneLifecycle(config) {
- config = withInfoPlist(config, (cfg) => {
- cfg.modResults.UIApplicationSceneManifest = {
- UIApplicationSupportsMultipleScenes: false,
- UISceneConfigurations: {
- UIWindowSceneSessionRoleApplication: [
- {
- UISceneConfigurationName: "Default Configuration",
- UISceneDelegateClassName:
- "$(PRODUCT_MODULE_NAME).PostHogSceneDelegate",
- },
- ],
- },
- };
- return cfg;
- });
-
- return withAppDelegate(config, (cfg) => {
- if (cfg.modResults.language !== "swift") {
- throw new Error("withSceneLifecycle requires a Swift AppDelegate");
- }
- const contents = cfg.modResults.contents;
- if (contents.includes("class PostHogSceneDelegate:")) {
- return cfg;
- }
- if (!startup.test(contents)) {
- throw new Error(
- "Expo AppDelegate startup changed; review withSceneLifecycle before building",
- );
- }
- if (!contents.includes(" var window: UIWindow?")) {
- throw new Error(
- "Expo AppDelegate window declaration changed; review withSceneLifecycle before building",
- );
- }
- cfg.modResults.contents = `${contents
- .replace(
- " var window: UIWindow?",
- " var window: UIWindow?\n var initialLaunchOptions: [UIApplication.LaunchOptionsKey: Any]?",
- )
- .replace(startup, " initialLaunchOptions = launchOptions")}
-${fs.readFileSync(path.join(__dirname, "PostHogSceneDelegate.swift"), "utf8")}`;
- return cfg;
- });
-};
diff --git a/products/desktop/apps/mobile/plugins/withSceneLifecycle.test.js b/products/desktop/apps/mobile/plugins/withSceneLifecycle.test.js
deleted file mode 100644
index d8ab7ba6dd51..000000000000
--- a/products/desktop/apps/mobile/plugins/withSceneLifecycle.test.js
+++ /dev/null
@@ -1,47 +0,0 @@
-import { describe, expect, it } from "vitest";
-import withSceneLifecycle from "./withSceneLifecycle";
-
-const appDelegate = `class AppDelegate: ExpoAppDelegate {
- var window: UIWindow?
- func application() {
- window = UIWindow(frame: UIScreen.main.bounds)
- factory.startReactNative(
- withModuleName: "main",
- in: window,
- launchOptions: launchOptions)
- }
-}`;
-
-async function apply(contents, language = "swift") {
- const config = withSceneLifecycle({ name: "PostHog", slug: "posthog" });
- const result = await config.mods.ios.appDelegate({
- ...config,
- modRequest: { platform: "ios", modName: "appDelegate" },
- modResults: { contents, language },
- });
- return result.modResults.contents;
-}
-
-describe("withSceneLifecycle", () => {
- it("moves window creation into a single scene delegate across repeated prebuilds", async () => {
- const result = await apply(appDelegate);
- expect(result).not.toContain("UIWindow(frame: UIScreen.main.bounds)");
- expect(result).toContain("UIWindow(windowScene: windowScene)");
- expect(result).toContain("initialLaunchOptions = launchOptions");
- expect(result).toContain(
- "var launchOptions = appDelegate.initialLaunchOptions ?? [:]",
- );
- expect(await apply(result)).toBe(result);
- });
-
- it.each([
- [appDelegate.replace("factory.startReactNative", "factory.start"), "swift"],
- [appDelegate.replace(" var window: UIWindow?", ""), "swift"],
- [appDelegate, "objc"],
- ])(
- "rejects unsupported native templates instead of generating a broken app",
- async (contents, language) => {
- await expect(apply(contents, language)).rejects.toThrow();
- },
- );
-});
diff --git a/products/desktop/apps/mobile/react-native-web.d.ts b/products/desktop/apps/mobile/react-native-web.d.ts
deleted file mode 100644
index f700126b2e1b..000000000000
--- a/products/desktop/apps/mobile/react-native-web.d.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-// react-native-web ships no type declarations. Tests use it as the DOM stand-in
-// for react-native, so borrow that module's surface rather than widen to any.
-declare module "react-native-web" {
- export * from "react-native";
-}
diff --git a/products/desktop/apps/mobile/scripts/push-sim.sh b/products/desktop/apps/mobile/scripts/push-sim.sh
deleted file mode 100755
index d4504a258d1c..000000000000
--- a/products/desktop/apps/mobile/scripts/push-sim.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/env bash
-# Send a fake push to the booted iOS simulator. No Expo, no APNs, no token.
-# Requires Xcode tools (`xcrun simctl` ships with Xcode).
-#
-# Usage: ./scripts/push-sim.sh ["Title"] ["Body"] [taskId] [taskRunId]
-# All args optional; defaults to a generic test push.
-
-set -euo pipefail
-
-BUNDLE_ID="com.posthog.code.mobile"
-TITLE="${1:-PostHog}"
-BODY="${2:-Test push — tap me}"
-TASK_ID="${3:-00000000-0000-0000-0000-000000000000}"
-TASK_RUN_ID="${4:-00000000-0000-0000-0000-000000000000}"
-
-# Verify a simulator is booted.
-if ! xcrun simctl list devices booted | grep -q "Booted"; then
- echo "ERROR: no booted simulator. Start one with: pnpm --filter @posthog/mobile ios" >&2
- exit 1
-fi
-
-PAYLOAD=$(mktemp -t push-sim.XXXXXX.json)
-trap 'rm -f "$PAYLOAD"' EXIT
-
-cat > "$PAYLOAD" <<EOF
-{
- "aps": {
- "alert": { "title": "$TITLE", "body": "$BODY" },
- "sound": "default"
- },
- "data": {
- "taskId": "$TASK_ID",
- "taskRunId": "$TASK_RUN_ID"
- }
-}
-EOF
-
-xcrun simctl push booted "$BUNDLE_ID" "$PAYLOAD"
-echo "Sent: \"$TITLE\" → $BUNDLE_ID (booted simulator)"
diff --git a/products/desktop/apps/mobile/scripts/send-test-push.sh b/products/desktop/apps/mobile/scripts/send-test-push.sh
deleted file mode 100755
index aec829794dd4..000000000000
--- a/products/desktop/apps/mobile/scripts/send-test-push.sh
+++ /dev/null
@@ -1,93 +0,0 @@
-#!/usr/bin/env bash
-# Send a test push to your dev device through Expo's push service.
-# Usage:
-# ./scripts/send-test-push.sh
-#
-# Paste your token into TOKEN below ONCE. After that just run the script.
-# Edit TITLE / BODY / TASK_ID / TASK_RUN_ID as needed.
-
-set -euo pipefail
-
-# ─── EDIT THIS ─────────────────────────────────────────────────────────────
-TOKEN="ExponentPushToken[PASTE_YOUR_TOKEN_HERE]"
-TITLE="PostHog"
-BODY="Test push — tap me"
-# These two fields are required by the app to navigate when the user taps
-# the notification (see notifications.ts:111). Use a real taskId + taskRunId
-# from your account if you want the tap to open a real screen.
-TASK_ID="00000000-0000-0000-0000-000000000000"
-TASK_RUN_ID="00000000-0000-0000-0000-000000000000"
-# ───────────────────────────────────────────────────────────────────────────
-
-if [[ "$TOKEN" == *"PASTE_YOUR_TOKEN_HERE"* ]]; then
- echo "ERROR: edit TOKEN in $(basename "$0") first." >&2
- exit 1
-fi
-
-if [[ "$TOKEN" != ExponentPushToken\[* ]]; then
- echo "ERROR: token should look like ExponentPushToken[xxx]. Got: $TOKEN" >&2
- exit 1
-fi
-
-echo "Sending push…"
-
-# Send the push. -s silences progress, --fail-with-body returns non-zero on
-# HTTP errors but still prints the body so we can see the reason.
-RESP=$(
- curl -sS --fail-with-body \
- -H "Content-Type: application/json" \
- -H "Accept: application/json" \
- -H "Accept-Encoding: gzip, deflate" \
- -X POST https://exp.host/--/api/v2/push/send \
- -d "$(cat <<EOF
-{
- "to": "$TOKEN",
- "title": "$TITLE",
- "body": "$BODY",
- "sound": "default",
- "priority": "high",
- "data": { "taskId": "$TASK_ID", "taskRunId": "$TASK_RUN_ID" }
-}
-EOF
-)"
-)
-
-echo "Response: $RESP"
-
-# Pull the receipt id out of {"data":{"id":"…","status":"ok"}}
-ID=$(printf '%s' "$RESP" | sed -n 's/.*"id":"\([^"]*\)".*/\1/p')
-STATUS=$(printf '%s' "$RESP" | sed -n 's/.*"status":"\([^"]*\)".*/\1/p')
-
-if [[ "$STATUS" != "ok" ]]; then
- echo "Expo refused the push. Status: ${STATUS:-unknown}" >&2
- exit 1
-fi
-
-echo "Accepted by Expo (id=$ID). Waiting 3s before checking delivery receipt…"
-sleep 3
-
-RECEIPT=$(
- curl -sS \
- -H "Content-Type: application/json" \
- -X POST https://exp.host/--/api/v2/push/getReceipts \
- -d "{\"ids\":[\"$ID\"]}"
-)
-
-echo "Receipt: $RECEIPT"
-
-case "$RECEIPT" in
- *'"status":"ok"'*)
- echo "Delivered to APNs/FCM."
- ;;
- *'"status":"error"'*)
- echo "Delivery error — read the message field above (common: DeviceNotRegistered)." >&2
- exit 1
- ;;
- *'{}'*|*'"data":{}'*)
- echo "Receipt not ready yet — re-run the receipt check in a few seconds:"
- echo " curl -sS -H 'Content-Type: application/json' -X POST https://exp.host/--/api/v2/push/getReceipts -d '{\"ids\":[\"$ID\"]}'"
- ;;
- *)
- echo "Unrecognized receipt shape — check the raw response above." >&2
- ;;
-esac
diff --git a/products/desktop/apps/mobile/src/app/(tabs)/_layout.tsx b/products/desktop/apps/mobile/src/app/(tabs)/_layout.tsx
deleted file mode 100644
index 9aa167a8a8f3..000000000000
--- a/products/desktop/apps/mobile/src/app/(tabs)/_layout.tsx
+++ /dev/null
@@ -1,89 +0,0 @@
-import { Stack, usePathname, useRouter } from "expo-router";
-import { useEffect, useRef } from "react";
-import { BackHandler, PanResponder, View } from "react-native";
-import { NavDrawer } from "@/features/navigation/components/NavDrawer";
-import { useNavDrawerStore } from "@/features/navigation/stores/navDrawerStore";
-import { useThemeColors } from "@/lib/theme";
-
-// Edge-swipe drawer trigger: tap-and-drag from the very left edge of the
-// screen pulls the drawer open. Matches iOS native back-swipe affordance
-// without taking the gesture from card swipes / scroll lists deeper in.
-const EDGE_SWIPE_HIT_WIDTH = 22;
-
-const HOME_ROUTE = "/tasks";
-const TAB_ROUTES = new Set(["/tasks", "/inbox"]);
-
-export default function TabsLayout() {
- const themeColors = useThemeColors();
- const router = useRouter();
- const pathname = usePathname();
-
- // Persisted across re-renders so the responder's grant doesn't get
- // rebuilt on every drawer-state change.
- const edgePanResponder = useRef(
- PanResponder.create({
- onStartShouldSetPanResponder: () => false,
- onMoveShouldSetPanResponder: (e, gesture) =>
- !useNavDrawerStore.getState().isOpen &&
- e.nativeEvent.pageX <= EDGE_SWIPE_HIT_WIDTH &&
- gesture.dx > 6 &&
- gesture.dx > Math.abs(gesture.dy),
- onMoveShouldSetPanResponderCapture: (e, gesture) =>
- !useNavDrawerStore.getState().isOpen &&
- e.nativeEvent.pageX <= EDGE_SWIPE_HIT_WIDTH &&
- gesture.dx > 10 &&
- gesture.dx > Math.abs(gesture.dy * 1.2),
- onPanResponderRelease: (_, gesture) => {
- if (gesture.dx > 40) useNavDrawerStore.getState().open();
- },
- }),
- ).current;
-
- // Android: each drawer destination replaces (no back stack between them), so
- // hardware back from a non-home destination should go home instead of exiting.
- useEffect(() => {
- const subscription = BackHandler.addEventListener(
- "hardwareBackPress",
- () => {
- const store = useNavDrawerStore.getState();
- // Drawer always-mounted: close it explicitly here since there's no
- // Modal onRequestClose to fall through to.
- if (store.isOpen) {
- store.close();
- return true;
- }
- // Only intercept when we're actually on a tab destination. Modals
- // pushed on top of the tabs (e.g. /task) keep this
- // handler mounted; without the guard we'd redirect to /tasks instead
- // of letting the modal dismiss naturally.
- if (!TAB_ROUTES.has(pathname)) return false;
- if (pathname === HOME_ROUTE) return false;
- router.replace(HOME_ROUTE);
- return true;
- },
- );
- return () => subscription.remove();
- }, [pathname, router]);
-
- return (
- <View className="flex-1 bg-background">
- <Stack
- screenOptions={{
- headerShown: false,
- contentStyle: { backgroundColor: themeColors.background },
- }}
- >
- <Stack.Screen name="tasks" />
- <Stack.Screen name="inbox" />
- </Stack>
- {/* Invisible left-edge strip that captures the open-drawer gesture. */}
- <View
- pointerEvents="box-only"
- className="absolute top-0 bottom-0 left-0 z-10"
- style={{ width: EDGE_SWIPE_HIT_WIDTH }}
- {...edgePanResponder.panHandlers}
- />
- <NavDrawer />
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/app/(tabs)/inbox.tsx b/products/desktop/apps/mobile/src/app/(tabs)/inbox.tsx
deleted file mode 100644
index f8af16a2a018..000000000000
--- a/products/desktop/apps/mobile/src/app/(tabs)/inbox.tsx
+++ /dev/null
@@ -1,225 +0,0 @@
-import { buildInboxViewedProperties } from "@posthog/core/inbox/engagement";
-import { INBOX_PIPELINE_STATUSES } from "@posthog/core/inbox/reportFiltering";
-import type { InboxReviewerScope } from "@posthog/shared";
-import type { SignalReport } from "@posthog/shared/domain-types";
-import { useFocusEffect, useRouter } from "expo-router";
-import { useCallback, useEffect, useMemo, useRef, useState } from "react";
-import { View } from "react-native";
-import { useSafeAreaInsets } from "react-native-safe-area-context";
-import { ArchivedReportList } from "@/features/inbox/components/ArchivedReportList";
-import { FilterSheet } from "@/features/inbox/components/FilterSheet";
-import { FloatingInboxHeader } from "@/features/inbox/components/FloatingInboxHeader";
-import {
- type InboxViewMode,
- InboxViewToggle,
-} from "@/features/inbox/components/InboxViewToggle";
-import { ReportList } from "@/features/inbox/components/ReportList";
-import { ReviewerFilterSheet } from "@/features/inbox/components/ReviewerFilterSheet";
-import { TinderView } from "@/features/inbox/components/TinderView";
-import {
- useArchivedReports,
- useInboxReports,
-} from "@/features/inbox/hooks/useInboxReports";
-import {
- decidedIds,
- useDismissedReportsStore,
-} from "@/features/inbox/stores/dismissedReportsStore";
-import { useInboxFilterStore } from "@/features/inbox/stores/inboxFilterStore";
-import { useInboxStore } from "@/features/inbox/stores/inboxStore";
-import { ANALYTICS_EVENTS, useAnalytics } from "@/lib/analytics";
-
-export default function InboxScreen() {
- const insets = useSafeAreaInsets();
- const router = useRouter();
- const { reports, totalCount, isFetching, isLoading, error } =
- useInboxReports();
- const [filterOpen, setFilterOpen] = useState(false);
- const [reviewerOpen, setReviewerOpen] = useState(false);
- const [viewMode, setViewMode] = useState<InboxViewMode>("list");
- const archived = useArchivedReports({ enabled: viewMode === "archive" });
- const reviewerFilterCount = useInboxFilterStore(
- (s) => s.suggestedReviewerFilter.length,
- );
- const sourceProductFilter = useInboxFilterStore((s) => s.sourceProductFilter);
- const statusFilter = useInboxFilterStore((s) => s.statusFilter);
- const priorityFilter = useInboxFilterStore((s) => s.priorityFilter);
- const suggestedReviewerFilter = useInboxFilterStore(
- (s) => s.suggestedReviewerFilter,
- );
-
- const analytics = useAnalytics();
- // Fire INBOX_VIEWED once per focus when the report list has settled. We
- // bump a focus counter on every focus so the useEffect re-runs even when
- // the data is already cached (no loading/filter/list change to trigger it
- // on its own), then guard against double-fires within the same focus via
- // a ref keyed on the focus-version we last fired for.
- const [focusVersion, setFocusVersion] = useState(0);
- useFocusEffect(
- useCallback(() => {
- setFocusVersion((v) => v + 1);
- }, []),
- );
- const viewedFiredForFocusRef = useRef<number | null>(null);
- useEffect(() => {
- if (focusVersion === 0) return;
- if (isLoading) return;
- if (viewedFiredForFocusRef.current === focusVersion) return;
- viewedFiredForFocusRef.current = focusVersion;
- analytics.track(
- ANALYTICS_EVENTS.INBOX_VIEWED,
- buildInboxViewedProperties({
- visibleReports: reports,
- totalCount,
- filters: {
- surface: "mobile",
- sourceProductFilter,
- statusFilter,
- suggestedReviewerFilter,
- priorityFilter,
- defaultStatusFilter: INBOX_PIPELINE_STATUSES,
- },
- }),
- );
- }, [
- analytics,
- focusVersion,
- isLoading,
- reports,
- totalCount,
- sourceProductFilter,
- statusFilter,
- suggestedReviewerFilter,
- priorityFilter,
- ]);
-
- // ── Tinder mode data ──────────────────────────────────────────────────────
- const decided = useDismissedReportsStore(decidedIds);
- const setCurrentIndex = useInboxStore((s) => s.setCurrentIndex);
- const setLastVisibleReportIds = useInboxStore(
- (s) => s.setLastVisibleReportIds,
- );
-
- // Snapshot the visible-list IDs into the store so the detail screen can
- // record rank/list_size on OPENED. Only the list view exposes a rank — the
- // tinder card stack swaps cards in place.
- useEffect(() => {
- if (viewMode === "list") {
- setLastVisibleReportIds(reports.map((r) => r.id));
- } else {
- setLastVisibleReportIds([]);
- }
- }, [viewMode, reports, setLastVisibleReportIds]);
-
- // Same data as the list view, excluding already-decided reports.
- const tinderReports = useMemo(
- () => reports.filter((r) => !decided.includes(r.id)),
- [reports, decided],
- );
-
- // Reset card index when switching to tinder mode
- useEffect(() => {
- if (viewMode === "tinder") {
- setCurrentIndex(0);
- }
- }, [viewMode, setCurrentIndex]);
-
- const hasActiveFilters =
- sourceProductFilter.length > 0 ||
- priorityFilter.length > 0 ||
- statusFilter.length < INBOX_PIPELINE_STATUSES.length ||
- suggestedReviewerFilter.length > 0;
-
- // Coarse reviewer scope. Mobile has no scope control yet, so a non-empty
- // reviewer filter reads as "teammate" without leaking a specific UUID.
- const triageScope: InboxReviewerScope =
- suggestedReviewerFilter.length > 0 ? "teammate" : "entire-project";
-
- // Bracket tinder mode with triage_started / triage_ended so we can measure
- // how many cards users clear before exiting. The live ref lets the cleanup
- // read the current decided count without re-firing the pair on every swipe;
- // it is set in an effect so we don't mutate refs during render.
- const triageLiveRef = useRef({ decided: 0 });
- useEffect(() => {
- triageLiveRef.current.decided = decided.length;
- });
- // Snapshot filters/queue at tinder-mode entry; swipes don't re-fire the pair.
- // biome-ignore lint/correctness/useExhaustiveDependencies: intentional snapshot
- useEffect(() => {
- if (viewMode !== "tinder") return;
- const startedAt = Date.now();
- const entry = {
- queueSize: tinderReports.length,
- initialDecided: decided.length,
- hasActiveFilters,
- scope: triageScope,
- };
- analytics.track(ANALYTICS_EVENTS.INBOX_TRIAGE_STARTED, {
- queue_size: entry.queueSize,
- has_active_filters: entry.hasActiveFilters,
- scope: entry.scope,
- });
- return () => {
- const reviewed = Math.max(
- 0,
- triageLiveRef.current.decided - entry.initialDecided,
- );
- analytics.track(ANALYTICS_EVENTS.INBOX_TRIAGE_ENDED, {
- queue_size: entry.queueSize,
- has_active_filters: entry.hasActiveFilters,
- scope: entry.scope,
- reports_reviewed: reviewed,
- duration_ms: Date.now() - startedAt,
- end_reason: reviewed >= entry.queueSize ? "completed" : "exited",
- });
- };
- }, [viewMode, analytics]);
-
- // ── List mode handlers ────────────────────────────────────────────────────
- const handleReportPress = useCallback(
- (report: SignalReport) => {
- router.push(`/inbox/${report.id}`);
- },
- [router],
- );
-
- // Header occupies insets.top + 6 (top pad) + 40 (MenuButton) + 8 (bottom
- // pad), plus a small buffer so the first row isn't hugging the fade edge.
- const headerHeight = insets.top + 60;
-
- return (
- <View className="flex-1 bg-background">
- {viewMode === "list" ? (
- <ReportList
- onReportPress={handleReportPress}
- contentInsetTop={headerHeight}
- />
- ) : viewMode === "archive" ? (
- <ArchivedReportList
- onReportPress={handleReportPress}
- contentInsetTop={headerHeight}
- />
- ) : (
- <View style={{ paddingTop: headerHeight }} className="flex-1">
- <TinderView reports={tinderReports} isLoading={isLoading} />
- </View>
- )}
-
- <FloatingInboxHeader
- isFetching={viewMode === "archive" ? archived.isFetching : isFetching}
- hasError={viewMode === "archive" ? !!archived.error : !!error}
- reviewerFilterCount={reviewerFilterCount}
- showFilters={viewMode === "list"}
- onReviewerPress={() => setReviewerOpen(true)}
- onFilterPress={() => setFilterOpen(true)}
- />
-
- <InboxViewToggle mode={viewMode} onModeChange={setViewMode} />
-
- <FilterSheet visible={filterOpen} onClose={() => setFilterOpen(false)} />
- <ReviewerFilterSheet
- visible={reviewerOpen}
- onClose={() => setReviewerOpen(false)}
- />
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/app/(tabs)/tasks.tsx b/products/desktop/apps/mobile/src/app/(tabs)/tasks.tsx
deleted file mode 100644
index cd1af5285991..000000000000
--- a/products/desktop/apps/mobile/src/app/(tabs)/tasks.tsx
+++ /dev/null
@@ -1,82 +0,0 @@
-import { useFocusEffect, useRouter } from "expo-router";
-import { useCallback, useMemo, useRef } from "react";
-import { InteractionManager, View } from "react-native";
-import { useSafeAreaInsets } from "react-native-safe-area-context";
-import { FloatingNewTaskButton } from "@/features/tasks/components/FloatingNewTaskButton";
-import { FloatingTasksHeader } from "@/features/tasks/components/FloatingTasksHeader";
-import {
- TaskFilterMenu,
- useTaskFilterMenu,
-} from "@/features/tasks/components/TaskFilterMenu";
-import { TaskList } from "@/features/tasks/components/TaskList";
-import { useTasks } from "@/features/tasks/hooks/useTasks";
-import { useArchivedTasksStore } from "@/features/tasks/stores/archivedTasksStore";
-
-export default function TasksScreen() {
- const router = useRouter();
- const insets = useSafeAreaInsets();
- const readyRef = useRef(true);
- const filterMenu = useTaskFilterMenu();
- const { tasks } = useTasks({ originProduct: "user_created" });
- const archivedTasks = useArchivedTasksStore((s) => s.archivedTasks);
- const hasActiveTasks = useMemo(
- () => tasks.some((task) => !(task.id in archivedTasks)),
- [tasks, archivedTasks],
- );
-
- // Block navigation while a modal dismiss animation is in progress.
- // When the screen loses focus (modal opens), readyRef is false.
- // When focus returns (modal dismissed), we wait for all native
- // animations to finish before allowing the next push.
- useFocusEffect(
- useCallback(() => {
- const handle = InteractionManager.runAfterInteractions(() => {
- readyRef.current = true;
- });
- return () => {
- readyRef.current = false;
- handle.cancel();
- };
- }, []),
- );
-
- const handleCreateTask = useCallback(() => {
- if (!readyRef.current) return;
- readyRef.current = false;
- router.push("/task");
- }, [router]);
-
- const handleTaskPress = useCallback(
- (taskId: string) => {
- if (!readyRef.current) return;
- readyRef.current = false;
- router.push(`/task/${taskId}`);
- },
- [router],
- );
-
- // Header occupies insets.top + 6 (top pad) + 44 (button) + 8 (bottom pad),
- // plus a small visual buffer so the first row isn't hugging the divider.
- const headerHeight = insets.top + 64;
-
- return (
- <View className="flex-1 bg-background">
- <TaskList
- onTaskPress={handleTaskPress}
- onCreateTask={handleCreateTask}
- contentInsetTop={headerHeight}
- />
-
- <FloatingTasksHeader
- onFilterPress={filterMenu.show}
- showFilter={hasActiveTasks}
- />
-
- {hasActiveTasks ? (
- <FloatingNewTaskButton onPress={handleCreateTask} />
- ) : null}
-
- <TaskFilterMenu open={filterMenu.open} onClose={filterMenu.hide} />
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/app/_layout.tsx b/products/desktop/apps/mobile/src/app/_layout.tsx
deleted file mode 100644
index 832b1bdbe82b..000000000000
--- a/products/desktop/apps/mobile/src/app/_layout.tsx
+++ /dev/null
@@ -1,214 +0,0 @@
-import "../../global.css";
-import "@/lib/textDefaults";
-
-import { QueryClientProvider } from "@tanstack/react-query";
-import { router, Stack, usePathname } from "expo-router";
-import { StatusBar } from "expo-status-bar";
-import { useColorScheme } from "nativewind";
-import { PostHogProvider } from "posthog-react-native";
-import { useEffect, useRef } from "react";
-import { ActivityIndicator, View } from "react-native";
-import { KeyboardProvider } from "react-native-keyboard-controller";
-import { SafeAreaProvider } from "react-native-safe-area-context";
-import {
- OFFLINE_BANNER_HEIGHT,
- OfflineBanner,
-} from "@/components/OfflineBanner";
-import { useAuthStore } from "@/features/auth";
-import { useOrgConsent } from "@/features/consent/hooks/useOrgConsent";
-import { setupNotificationResponseListener } from "@/features/notifications/lib/notifications";
-import { usePreferencesStore } from "@/features/preferences/stores/preferencesStore";
-import { PendingPromptRecovery } from "@/features/tasks/components/PendingPromptRecovery";
-import { useNetworkStatus } from "@/hooks/useNetworkStatus";
-import {
- POSTHOG_API_KEY,
- POSTHOG_OPTIONS,
- useIdentifyUser,
- useRegisterSuperProperties,
- useScreenTracking,
-} from "@/lib/posthog";
-import { queryClient } from "@/lib/queryClient";
-import { darkTheme, lightTheme, useThemeColors } from "@/lib/theme";
-
-interface RootLayoutNavProps {
- isConnected: boolean;
-}
-
-function RootLayoutNav({ isConnected }: RootLayoutNavProps) {
- const { isAuthenticated, isLoading, initializeAuth } = useAuthStore();
- const themeColors = useThemeColors();
- const pathname = usePathname();
- const consent = useOrgConsent();
-
- useScreenTracking();
- useIdentifyUser();
- useRegisterSuperProperties();
-
- useEffect(() => {
- initializeAuth();
- }, [initializeAuth]);
-
- useEffect(() => {
- return setupNotificationResponseListener(({ path }) => {
- router.push(path);
- });
- }, []);
-
- // Auth gate. If a deep link drops an unauthed user on a protected route
- // (e.g. `posthog://task/abc` from a notification or shared link), bounce
- // them to /auth with a `next` param so the sign-in flow can resume the
- // originally-intended navigation.
- useEffect(() => {
- if (isLoading) return;
- if (isAuthenticated) return;
- if (!pathname || pathname === "/auth") return;
- const next = pathname !== "/" ? pathname : undefined;
- router.replace(next ? { pathname: "/auth", params: { next } } : "/auth");
- }, [isAuthenticated, isLoading, pathname]);
-
- // Consent gate. Keep a signed-in user out of the app until their organization
- // has met both consent requirements, even if a deep link drops them straight
- // onto a protected route. Wait for the status to resolve before routing so we
- // never bounce a user whose consent we haven't checked yet.
- const consentSatisfied = consent.status === "resolved" && consent.satisfied;
- // Where the user was heading when the gate intercepted, so a deep link opened
- // before consent is restored once both requirements are met.
- const pendingHrefRef = useRef<string | null>(null);
- useEffect(() => {
- if (isLoading || !isAuthenticated || pathname === "/auth") return;
- if (consent.status === "loading") return;
- if (!consentSatisfied) {
- if (pathname !== "/consent") {
- if (pathname !== "/") pendingHrefRef.current = pathname;
- router.replace("/consent");
- }
- } else if (pathname === "/consent") {
- const next = pendingHrefRef.current ?? "/(tabs)/tasks";
- pendingHrefRef.current = null;
- router.replace(next);
- }
- }, [isAuthenticated, isLoading, consent.status, consentSatisfied, pathname]);
-
- // Hold the app on a spinner while an authenticated user's consent is unknown
- // or unmet, so no protected route renders for a frame before the gate
- // redirects to /consent.
- const blockUntilConsent =
- isAuthenticated &&
- !consentSatisfied &&
- pathname !== "/consent" &&
- pathname !== "/auth";
- if (isLoading || blockUntilConsent) {
- return (
- <View className="flex-1 items-center justify-center bg-background">
- <ActivityIndicator size="large" color={themeColors.accent[9]} />
- </View>
- );
- }
-
- return (
- <Stack
- screenOptions={{
- headerShown: false,
- contentStyle: {
- backgroundColor: themeColors.background,
- paddingTop: isConnected ? 0 : OFFLINE_BANNER_HEIGHT,
- },
- }}
- >
- <Stack.Screen name="(tabs)" options={{ headerShown: false }} />
- <Stack.Screen name="auth" options={{ headerShown: false }} />
- <Stack.Screen name="consent" options={{ headerShown: false }} />
- <Stack.Screen name="index" options={{ headerShown: false }} />
-
- {/* Tinder-style inbox review */}
- <Stack.Screen name="review" options={{ headerShown: false }} />
-
- {/* Settings — pushed on top of whatever the user was viewing, so
- back / iOS swipe-back / Android hardware-back all return to it. */}
- <Stack.Screen name="settings/index" options={{ headerShown: false }} />
-
- {/* MCP servers — marketplace + installed management. */}
- <Stack.Screen name="mcp-servers/index" options={{ headerShown: false }} />
- <Stack.Screen
- name="mcp-servers/add-custom"
- options={{ headerShown: false }}
- />
- <Stack.Screen
- name="mcp-servers/template/[id]"
- options={{ headerShown: false }}
- />
- <Stack.Screen
- name="mcp-servers/installation/[id]"
- options={{ headerShown: false }}
- />
-
- {/* Inbox report detail - modal presentation, no native header
- (the in-content title block is the canonical header). Catch-all
- segment so the route also tolerates the cosmetic slug suffix on
- shared links: `posthog://inbox/<reportId>` and
- `posthog://inbox/<reportId>/<slug>` both resolve here. */}
- <Stack.Screen
- name="inbox/[...id]"
- options={{ presentation: "modal", headerShown: false }}
- />
-
- {/* Task routes - modal presentation, no native header. */}
- <Stack.Screen
- name="task/index"
- options={{ presentation: "modal", headerShown: false }}
- />
- <Stack.Screen
- name="task/[id]"
- options={{ presentation: "modal", headerShown: false }}
- />
- <Stack.Screen
- name="pr-diff"
- options={{
- presentation: "modal",
- headerShown: true,
- title: "Files changed",
- headerStyle: { backgroundColor: themeColors.background },
- headerTintColor: themeColors.gray[12],
- }}
- />
- </Stack>
- );
-}
-
-export default function RootLayout() {
- const { colorScheme, setColorScheme } = useColorScheme();
- const themePreference = usePreferencesStore((s) => s.theme);
-
- // Sync the user's theme preference into NativeWind's color scheme so the
- // entire app honours it (including light/dark/system).
- useEffect(() => {
- setColorScheme(themePreference);
- }, [themePreference, setColorScheme]);
-
- const themeVars = colorScheme === "dark" ? darkTheme : lightTheme;
- const { isConnected } = useNetworkStatus();
-
- return (
- <SafeAreaProvider>
- <KeyboardProvider>
- <PostHogProvider
- apiKey={POSTHOG_API_KEY}
- options={POSTHOG_OPTIONS}
- autocapture={{
- captureTouches: true,
- captureScreens: false, // We handle screen tracking manually for expo-router
- }}
- >
- <QueryClientProvider client={queryClient}>
- <View style={themeVars} className="flex-1">
- <RootLayoutNav isConnected={isConnected} />
- <OfflineBanner isConnected={isConnected} />
- <PendingPromptRecovery />
- </View>
- <StatusBar style={colorScheme === "dark" ? "light" : "dark"} />
- </QueryClientProvider>
- </PostHogProvider>
- </KeyboardProvider>
- </SafeAreaProvider>
- );
-}
diff --git a/products/desktop/apps/mobile/src/app/auth.tsx b/products/desktop/apps/mobile/src/app/auth.tsx
deleted file mode 100644
index 7b230cd3e10a..000000000000
--- a/products/desktop/apps/mobile/src/app/auth.tsx
+++ /dev/null
@@ -1,316 +0,0 @@
-import { router, useLocalSearchParams } from "expo-router";
-import { useCallback, useMemo, useState } from "react";
-import {
- ActivityIndicator,
- ScrollView,
- Text,
- TextInput,
- TouchableOpacity,
- View,
-} from "react-native";
-import { SafeAreaView } from "react-native-safe-area-context";
-import { QrScanModal, type QrScanResult } from "@/components/QrScanModal";
-import { type CloudRegion, useAuthStore } from "@/features/auth";
-import {
- ANALYTICS_EVENTS,
- type SignInFailureReason,
- type SignInMethod,
- useAnalytics,
-} from "@/lib/analytics";
-import { useThemeColors } from "@/lib/theme";
-
-type RegionOption = { value: CloudRegion; label: string };
-
-const PRODUCTION_REGIONS: RegionOption[] = [
- { value: "us", label: "US Cloud" },
- { value: "eu", label: "EU Cloud" },
-];
-
-const DEV_REGIONS: RegionOption[] = [
- ...PRODUCTION_REGIONS,
- { value: "dev", label: "Development" },
-];
-
-export default function AuthScreen() {
- const themeColors = useThemeColors();
- const { next } = useLocalSearchParams<{ next?: string }>();
-
- // Only show dev region in development builds
- const regions = useMemo<RegionOption[]>(
- () => (__DEV__ ? DEV_REGIONS : PRODUCTION_REGIONS),
- [],
- );
- const [selectedRegion, setSelectedRegion] = useState<CloudRegion>("us");
- const [isLoading, setIsLoading] = useState(false);
- const [error, setError] = useState<string | null>(null);
- const [devToken, setDevToken] = useState("");
- const [devProjectId, setDevProjectId] = useState("");
- const [scannerVisible, setScannerVisible] = useState(false);
-
- const { loginWithOAuth, loginWithPersonalApiKey } = useAuthStore();
- const analytics = useAnalytics();
-
- const trackSignInStarted = (method: SignInMethod) => {
- analytics.track(ANALYTICS_EVENTS.SIGN_IN_STARTED, {
- method,
- region: selectedRegion,
- });
- };
-
- const trackSignInCompleted = (method: SignInMethod) => {
- analytics.track(ANALYTICS_EVENTS.SIGN_IN_COMPLETED, {
- method,
- region: selectedRegion,
- });
- };
-
- const trackSignInFailed = (method: SignInMethod, message: string) => {
- const reason: SignInFailureReason = message.includes("cancel")
- ? "cancelled"
- : message.includes("timed out")
- ? "timeout"
- : "error";
- analytics.track(ANALYTICS_EVENTS.SIGN_IN_FAILED, {
- method,
- region: selectedRegion,
- reason,
- error_message: message,
- });
- };
-
- // After successful sign-in, resume the originally-requested deep link if
- // there was one, otherwise drop into the default tab. Guards against `next`
- // pointing back at /auth (which would loop) or being a non-local URL.
- const navigateAfterLogin = useCallback(() => {
- const target =
- typeof next === "string" &&
- next.startsWith("/") &&
- !next.startsWith("/auth")
- ? next
- : "/(tabs)/tasks";
- router.replace(target);
- }, [next]);
-
- const handleQrScan = async (result: QrScanResult) => {
- setScannerVisible(false);
- setDevToken(result.apiKey);
- setDevProjectId(String(result.projectId));
- setIsLoading(true);
- setError(null);
- trackSignInStarted("qr_scan");
- try {
- await loginWithPersonalApiKey({
- token: result.apiKey,
- projectId: result.projectId,
- region: selectedRegion,
- });
- trackSignInCompleted("qr_scan");
- navigateAfterLogin();
- } catch (err) {
- const message = err instanceof Error ? err.message : "Failed to sign in";
- trackSignInFailed("qr_scan", message);
- setError(message);
- } finally {
- setIsLoading(false);
- }
- };
-
- const handleDevSignIn = async () => {
- setIsLoading(true);
- setError(null);
- trackSignInStarted("dev_api_key");
- try {
- const projectIdNum = Number(devProjectId);
- if (!Number.isFinite(projectIdNum) || projectIdNum <= 0) {
- throw new Error("Project ID must be a positive number");
- }
- await loginWithPersonalApiKey({
- token: devToken,
- projectId: projectIdNum,
- region: selectedRegion,
- });
- trackSignInCompleted("dev_api_key");
- navigateAfterLogin();
- } catch (err) {
- const message = err instanceof Error ? err.message : "Failed to sign in";
- trackSignInFailed("dev_api_key", message);
- setError(message);
- } finally {
- setIsLoading(false);
- }
- };
-
- const handleSignIn = async () => {
- setIsLoading(true);
- setError(null);
- trackSignInStarted("oauth");
-
- try {
- await loginWithOAuth(selectedRegion);
- trackSignInCompleted("oauth");
- // Navigate to tabs on success
- navigateAfterLogin();
- } catch (err) {
- const message =
- err instanceof Error ? err.message : "Failed to authenticate";
- trackSignInFailed("oauth", message);
-
- if (message.includes("cancelled") || message.includes("cancel")) {
- setError("Authorization cancelled.");
- } else if (message.includes("timed out")) {
- setError("Authorization timed out. Please try again.");
- } else {
- setError(message);
- }
- } finally {
- setIsLoading(false);
- }
- };
-
- return (
- <SafeAreaView className="flex-1 bg-gray-1">
- <ScrollView
- className="flex-1"
- contentContainerClassName="px-6 pt-16 pb-10"
- keyboardShouldPersistTaps="handled"
- >
- {/* Header */}
- <View className="mb-10">
- <Text className="mb-2 font-semibold text-2xl text-gray-12">
- PostHog Mobile
- </Text>
- <Text className="text-base text-gray-11">
- Sign in with your PostHog account
- </Text>
- </View>
-
- {/* Form */}
- <View className="gap-4">
- <Text className="mb-2 font-medium text-gray-11 text-sm">
- PostHog region
- </Text>
-
- {/* Region Picker */}
- <View className="mb-4 flex-row gap-3">
- {regions.map((region) => (
- <TouchableOpacity
- key={region.value}
- className={`flex-1 items-center rounded-lg border px-4 py-3 ${
- selectedRegion === region.value
- ? "border-accent-9 bg-accent-3"
- : "border-gray-6 bg-gray-3"
- }`}
- onPress={() => setSelectedRegion(region.value)}
- >
- <Text
- className={`font-medium text-sm ${
- selectedRegion === region.value
- ? "text-accent-11"
- : "text-gray-11"
- }`}
- >
- {region.label}
- </Text>
- </TouchableOpacity>
- ))}
- </View>
-
- {/* Error Message */}
- {error && (
- <View className="rounded-lg border border-status-error bg-status-error/10 p-3">
- <Text className="text-sm text-status-error">{error}</Text>
- </View>
- )}
-
- {/* Loading Message */}
- {isLoading && (
- <View className="rounded-lg border border-status-info bg-status-info/10 p-3">
- <Text className="text-sm text-status-info">
- Waiting for authorization in your browser...
- </Text>
- </View>
- )}
-
- {/* Sign In Button */}
- <TouchableOpacity
- className={`mt-2 items-center rounded-lg py-4 ${
- isLoading ? "bg-gray-7" : "bg-accent-9"
- }`}
- onPress={handleSignIn}
- disabled={isLoading}
- >
- {isLoading ? (
- <ActivityIndicator color={themeColors.gray[12]} />
- ) : (
- <Text className="font-semibold text-accent-contrast text-base">
- Sign in with PostHog
- </Text>
- )}
- </TouchableOpacity>
-
- {__DEV__ && (
- <View className="mt-8 gap-3 rounded-lg border border-gray-6 bg-gray-2 p-4">
- <Text className="font-semibold text-gray-12 text-sm">
- Dev sign-in (personal API key)
- </Text>
- <Text className="text-gray-11 text-xs">
- Skips OAuth. Create a personal API key at Settings → User API
- keys with scopes: user:read, project:read, task:write,
- integration:read, conversation:write, query:read,
- llm_skill:read.
- </Text>
- <TextInput
- value={devToken}
- onChangeText={setDevToken}
- placeholder="phx_..."
- placeholderTextColor={themeColors.gray[9]}
- autoCapitalize="none"
- autoCorrect={false}
- secureTextEntry
- className="rounded-md border border-gray-6 bg-gray-3 px-3 py-2 text-gray-12"
- />
- <TextInput
- value={devProjectId}
- onChangeText={setDevProjectId}
- placeholder="Project ID (e.g. 2)"
- placeholderTextColor={themeColors.gray[9]}
- keyboardType="number-pad"
- className="rounded-md border border-gray-6 bg-gray-3 px-3 py-2 text-gray-12"
- />
- <TouchableOpacity
- className={`items-center rounded-md py-3 ${
- isLoading || !devToken || !devProjectId
- ? "bg-gray-7"
- : "bg-gray-9"
- }`}
- onPress={handleDevSignIn}
- disabled={isLoading || !devToken || !devProjectId}
- >
- <Text className="font-medium text-gray-12 text-sm">
- Dev sign in
- </Text>
- </TouchableOpacity>
- <TouchableOpacity
- className="items-center rounded-md border border-gray-7 py-3"
- onPress={() => {
- setError(null);
- setScannerVisible(true);
- }}
- disabled={isLoading}
- >
- <Text className="font-medium text-gray-12 text-sm">
- Scan QR code
- </Text>
- </TouchableOpacity>
- </View>
- )}
- </View>
- </ScrollView>
- <QrScanModal
- visible={scannerVisible}
- onClose={() => setScannerVisible(false)}
- onScan={handleQrScan}
- />
- </SafeAreaView>
- );
-}
diff --git a/products/desktop/apps/mobile/src/app/consent.tsx b/products/desktop/apps/mobile/src/app/consent.tsx
deleted file mode 100644
index caab852e51db..000000000000
--- a/products/desktop/apps/mobile/src/app/consent.tsx
+++ /dev/null
@@ -1,89 +0,0 @@
-import { Text } from "@components/text";
-import { EXTERNAL_LINKS } from "@posthog/shared";
-import { ANALYTICS_EVENTS } from "@posthog/shared/analytics-events";
-import { useQueryClient } from "@tanstack/react-query";
-import { router } from "expo-router";
-import { usePostHog } from "posthog-react-native";
-import { ActivityIndicator, Pressable, ScrollView, View } from "react-native";
-import { SafeAreaView } from "react-native-safe-area-context";
-import { useAuthStore, useUserQuery } from "@/features/auth";
-import { ConsentError } from "@/features/consent/components/ConsentError";
-import { ConsentPanel } from "@/features/consent/components/ConsentPanel";
-import {
- desktopBetaTermsKeys,
- useOrgConsent,
-} from "@/features/consent/hooks/useOrgConsent";
-import { openExternalUrl } from "@/lib/openExternalUrl";
-import { getPostHogApiClient } from "@/lib/posthogApiClient";
-import { useThemeColors } from "@/lib/theme";
-
-const ORGANIZATION_ADMIN_LEVEL = 8;
-
-export default function ConsentScreen() {
- const themeColors = useThemeColors();
- const consent = useOrgConsent();
- const { data: user } = useUserQuery();
- const logout = useAuthStore((s) => s.logout);
- const posthog = usePostHog();
- const queryClient = useQueryClient();
-
- const organization = user?.organization;
- const isAdmin =
- (organization?.membership_level ?? 0) >= ORGANIZATION_ADMIN_LEVEL;
-
- const acceptAi = async (): Promise<void> => {
- if (!organization) return;
- await getPostHogApiClient().approveAiDataProcessing(organization.id);
- posthog?.capture(ANALYTICS_EVENTS.AI_CONSENT_GRANTED_INAPP);
- await queryClient.invalidateQueries({ queryKey: ["user"] });
- };
-
- const acceptBeta = async (): Promise<void> => {
- if (!organization) return;
- await getPostHogApiClient().acceptDesktopBetaTerms();
- posthog?.capture(ANALYTICS_EVENTS.DESKTOP_BETA_TERMS_ACCEPTED_INAPP);
- await queryClient.invalidateQueries({
- queryKey: desktopBetaTermsKeys.all(),
- });
- };
-
- const handleLogout = async (): Promise<void> => {
- await logout();
- router.replace("/auth");
- };
-
- return (
- <SafeAreaView className="flex-1 bg-gray-1">
- <ScrollView
- className="flex-1"
- contentContainerClassName="px-6 pt-12 pb-8"
- keyboardShouldPersistTaps="handled"
- >
- {consent.status === "error" ? (
- <ConsentError onRetry={consent.retry} />
- ) : consent.status === "resolved" && !consent.satisfied ? (
- <ConsentPanel
- organizationName={organization?.name}
- needsAiConsent={consent.needsAiConsent}
- needsBetaTerms={consent.needsBetaTerms}
- isAdmin={isAdmin}
- onAcceptAi={acceptAi}
- onAcceptBeta={acceptBeta}
- />
- ) : (
- <View className="items-center py-24">
- <ActivityIndicator size="large" color={themeColors.accent[9]} />
- </View>
- )}
- </ScrollView>
- <View className="flex-row items-center justify-between px-6 pb-4">
- <Pressable onPress={() => openExternalUrl(EXTERNAL_LINKS.discord)}>
- <Text className="text-gray-11 text-sm">Get support</Text>
- </Pressable>
- <Pressable onPress={handleLogout}>
- <Text className="text-gray-11 text-sm">Log out</Text>
- </Pressable>
- </View>
- </SafeAreaView>
- );
-}
diff --git a/products/desktop/apps/mobile/src/app/inbox/[...id].tsx b/products/desktop/apps/mobile/src/app/inbox/[...id].tsx
deleted file mode 100644
index 462765cba986..000000000000
--- a/products/desktop/apps/mobile/src/app/inbox/[...id].tsx
+++ /dev/null
@@ -1,680 +0,0 @@
-import { Text } from "@components/text";
-import { computeRefundEligibility } from "@posthog/core/inbox/refundEligibility";
-import { buildCreatePrReportPrompt } from "@posthog/core/inbox/reportActions";
-import {
- formatSignalReportSummaryMarkdown,
- humanizeReportTitle,
- inboxStatusLabel,
- parseConventionalCommitTitle,
-} from "@posthog/core/inbox/reportPresentation";
-import {
- DISMISSAL_REASON_OPTIONS,
- SIGNALS_PR_REFUNDS_FLAG,
-} from "@posthog/shared";
-import type {
- ActionabilityJudgmentContent,
- SignalFindingContent,
- SignalReportPriority,
- SignalReportStatus,
- SuggestedReviewersArtefact,
-} from "@posthog/shared/domain-types";
-import { differenceInHours, format, formatDistanceToNow } from "date-fns";
-import * as Haptics from "expo-haptics";
-import { useLocalSearchParams, useRouter } from "expo-router";
-import {
- CaretDown,
- CaretRight,
- ChatCircle,
- Lightning,
- Receipt,
- ThumbsDown,
-} from "phosphor-react-native";
-import { useFeatureFlag, usePostHog } from "posthog-react-native";
-import { useCallback, useEffect, useMemo, useState } from "react";
-import {
- ActivityIndicator,
- Alert,
- type NativeScrollEvent,
- type NativeSyntheticEvent,
- Pressable,
- ScrollView,
- View,
-} from "react-native";
-import { useSafeAreaInsets } from "react-native-safe-area-context";
-import { useUserQuery } from "@/features/auth";
-import { MarkdownText } from "@/features/chat/components/MarkdownText";
-import { ConventionalCommitTag } from "@/features/inbox/components/ConventionalCommitTag";
-import { CreatePrFeedbackSheet } from "@/features/inbox/components/CreatePrFeedbackSheet";
-import { DiscussReportSheet } from "@/features/inbox/components/DiscussReportSheet";
-import {
- type DismissReportResult,
- DismissReportSheet,
-} from "@/features/inbox/components/DismissReportSheet";
-import { RefundReportSheet } from "@/features/inbox/components/RefundReportSheet";
-import { ReportActivity } from "@/features/inbox/components/ReportActivity";
-import { ReportFeedbackFooter } from "@/features/inbox/components/ReportFeedbackFooter";
-import { ReportVerdictBanner } from "@/features/inbox/components/ReportVerdictBanner";
-import { SignalCard } from "@/features/inbox/components/SignalCard";
-import {
- type ReviewerActionExtra,
- SuggestedReviewers,
-} from "@/features/inbox/components/SuggestedReviewers";
-import { useInboxEngagementTracker } from "@/features/inbox/hooks/useInboxEngagementTracker";
-import {
- useInboxReport,
- useInboxReportArtefacts,
- useInboxReportSignals,
-} from "@/features/inbox/hooks/useInboxReports";
-import { isReportAwaitingInput } from "@/features/inbox/reportVerdictAction";
-import { useInboxStore } from "@/features/inbox/stores/inboxStore";
-import { PrStatusBadge } from "@/features/tasks/components/PrStatusBadge";
-import {
- computeReportAgeHours,
- type InboxReportActionType,
- useAnalytics,
-} from "@/lib/analytics";
-import { openExternalUrl } from "@/lib/openExternalUrl";
-import { useThemeColors } from "@/lib/theme";
-
-const statusColorMap: Record<string, { bg: string; text: string }> = {
- ready: { bg: "bg-status-success/20", text: "text-status-success" },
- pending_input: { bg: "bg-accent-3", text: "text-accent-11" },
- in_progress: { bg: "bg-status-warning/20", text: "text-status-warning" },
- candidate: { bg: "bg-status-info/20", text: "text-status-info" },
- potential: { bg: "bg-gray-5/20", text: "text-gray-9" },
- failed: { bg: "bg-status-error/20", text: "text-status-error" },
- resolved: { bg: "bg-status-success/20", text: "text-status-success" },
- suppressed: { bg: "bg-gray-5/20", text: "text-gray-9" },
- deleted: { bg: "bg-gray-5/20", text: "text-gray-9" },
-};
-
-const priorityColorMap: Record<string, { bg: string; text: string }> = {
- P0: { bg: "bg-status-error/20", text: "text-status-error" },
- P1: { bg: "bg-status-warning/20", text: "text-status-warning" },
- P2: { bg: "bg-status-warning/20", text: "text-status-warning" },
- P3: { bg: "bg-gray-5/20", text: "text-gray-9" },
- P4: { bg: "bg-gray-5/20", text: "text-gray-9" },
-};
-
-const actionabilityColorMap: Record<string, { bg: string; text: string }> = {
- immediately_actionable: {
- bg: "bg-status-success/20",
- text: "text-status-success",
- },
- requires_human_input: {
- bg: "bg-status-warning/20",
- text: "text-status-warning",
- },
- not_actionable: { bg: "bg-gray-5/20", text: "text-gray-9" },
-};
-
-const actionabilityLabel: Record<string, string> = {
- immediately_actionable: "Actionable",
- requires_human_input: "Needs input",
- not_actionable: "Not actionable",
-};
-
-function StatusBadge({ status }: { status: SignalReportStatus }) {
- const colors = statusColorMap[status] ?? statusColorMap.potential;
- return (
- <View className={`rounded px-2 py-1 ${colors.bg}`}>
- <Text className={`font-medium text-[12px] ${colors.text}`}>
- {inboxStatusLabel(status)}
- </Text>
- </View>
- );
-}
-
-function PriorityBadge({ priority }: { priority: SignalReportPriority }) {
- const colors = priorityColorMap[priority] ?? priorityColorMap.P3;
- return (
- <View className={`rounded px-2 py-1 ${colors.bg}`}>
- <Text className={`font-medium text-[12px] ${colors.text}`}>
- {priority}
- </Text>
- </View>
- );
-}
-
-function ActionabilityBadge({ value }: { value: string }) {
- const colors =
- actionabilityColorMap[value] ?? actionabilityColorMap.not_actionable;
- const label = actionabilityLabel[value] ?? value;
- return (
- <View className={`rounded px-2 py-1 ${colors.bg}`}>
- <Text className={`font-medium text-[12px] ${colors.text}`}>{label}</Text>
- </View>
- );
-}
-
-export default function ReportDetailScreen() {
- // Catch-all route: `id` arrives as string[] for `/inbox/<uuid>/<slug>` and
- // we only read the first segment (the UUID). The slug is purely cosmetic;
- // receivers ignore everything past the UUID, matching the desktop contract
- // in `apps/code/src/shared/deeplink.ts`. Expo-router can hand us either a
- // string or string[] depending on the URL shape, so tolerate both.
- const { id: idParam } = useLocalSearchParams<{ id: string | string[] }>();
- const reportId = Array.isArray(idParam) ? idParam[0] : idParam;
- const router = useRouter();
- const themeColors = useThemeColors();
- const insets = useSafeAreaInsets();
- const posthog = usePostHog();
- const refundFlagEnabled = !!useFeatureFlag(SIGNALS_PR_REFUNDS_FLAG);
- const { data: report, isLoading, error } = useInboxReport(reportId ?? null);
- const { data: me } = useUserQuery();
- const [dismissOpen, setDismissOpen] = useState(false);
- const [discussOpen, setDiscussOpen] = useState(false);
- const [createPrFeedbackOpen, setCreatePrFeedbackOpen] = useState(false);
- const [refundOpen, setRefundOpen] = useState(false);
- const [signalsExpanded, setSignalsExpanded] = useState(false);
-
- const artefactsQuery = useInboxReportArtefacts(reportId ?? null);
- const signalsQuery = useInboxReportSignals(reportId ?? null);
-
- // ── Engagement analytics ────────────────────────────────────────────────
- const analytics = useAnalytics();
- const lastVisibleReportIds = useInboxStore((s) => s.lastVisibleReportIds);
- const previousOpenedReportId = useInboxStore((s) => s.previousOpenedReportId);
- const setPreviousOpenedReportId = useInboxStore(
- (s) => s.setPreviousOpenedReportId,
- );
- const rank = useMemo(() => {
- if (!reportId) return -1;
- const idx = lastVisibleReportIds.indexOf(reportId);
- return idx;
- }, [reportId, lastVisibleReportIds]);
- const listSize = lastVisibleReportIds.length;
- const tracker = useInboxEngagementTracker({
- analytics,
- report: report ?? null,
- rank,
- listSize,
- openMethod: "click",
- previousReportId: previousOpenedReportId,
- });
- // Remember this report as the "previous" once it's been opened so the next
- // OPENED event can chain to it.
- useEffect(() => {
- if (!reportId) return;
- setPreviousOpenedReportId(reportId);
- }, [reportId, setPreviousOpenedReportId]);
-
- const handleScroll = useCallback(
- (_event: NativeSyntheticEvent<NativeScrollEvent>) => {
- tracker.signalScroll();
- },
- [tracker],
- );
-
- const fireReviewerAction = useCallback(
- (action_type: InboxReportActionType, extra?: ReviewerActionExtra) => {
- if (!report) return;
- tracker.signalAction({
- report_id: report.id,
- report_title: report.title ?? null,
- report_age_hours: computeReportAgeHours(report.created_at),
- action_type,
- surface: "detail_pane",
- is_bulk: false,
- bulk_size: 1,
- ...extra,
- });
- },
- [report, tracker],
- );
-
- const handleToggleSignals = useCallback(() => {
- // Fire analytics outside the state updater — Strict Mode double-invokes
- // updaters in development, which would double-fire the event.
- const next = !signalsExpanded;
- if (next && report) {
- tracker.signalAction({
- report_id: report.id,
- report_title: report.title ?? null,
- report_age_hours: computeReportAgeHours(report.created_at),
- action_type: "expand_signal",
- surface: "detail_pane",
- is_bulk: false,
- bulk_size: 1,
- });
- }
- setSignalsExpanded(next);
- }, [report, tracker, signalsExpanded]);
-
- // ── Derive artefact bits ────────────────────────────────────────────────
- const artefacts = artefactsQuery.data?.results ?? [];
-
- const actionabilityJudgment =
- useMemo((): ActionabilityJudgmentContent | null => {
- for (const a of artefacts) {
- if (a.type === "actionability_judgment") {
- return a.content as ActionabilityJudgmentContent;
- }
- }
- return null;
- }, [artefacts]);
-
- const reviewerArtefact = useMemo((): SuggestedReviewersArtefact | null => {
- for (const a of artefacts) {
- if (a.type === "suggested_reviewers") {
- return a as SuggestedReviewersArtefact;
- }
- }
- return null;
- }, [artefacts]);
-
- const findingsBySignalId = useMemo(() => {
- const map = new Map<string, SignalFindingContent>();
- for (const a of artefacts) {
- if (a.type === "signal_finding") {
- const c = a.content as SignalFindingContent;
- map.set(c.signal_id, c);
- }
- }
- return map;
- }, [artefacts]);
-
- const allSignals = signalsQuery.data?.signals ?? [];
- // Match web: split session_problem evidence from main Signals list.
- const signals = allSignals.filter(
- (s) =>
- !(
- s.source_product === "session_replay" &&
- s.source_type === "session_problem"
- ),
- );
-
- const handleStartTask = useCallback(
- (feedback?: string) => {
- if (!report) return;
- Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium);
- setCreatePrFeedbackOpen(false);
- tracker.signalAction({
- report_id: report.id,
- report_title: report.title ?? null,
- report_age_hours: computeReportAgeHours(report.created_at),
- action_type: "create_pr",
- surface: "detail_pane",
- is_bulk: false,
- bulk_size: 1,
- has_feedback: !!feedback,
- ...(feedback ? { feedback_text: feedback.slice(0, 500) } : {}),
- });
- const prompt = buildCreatePrReportPrompt({
- reportId: report.id,
- feedback,
- });
- router.push({
- pathname: "/task",
- params: {
- prompt,
- signalReport: report.id,
- signalReportRelationship: "implementation",
- },
- });
- },
- [report, router, tracker],
- );
-
- const handleBannerStart = useCallback(() => {
- Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
- setCreatePrFeedbackOpen(true);
- }, []);
-
- const handleOpenPr = useCallback(
- (url: string) => {
- if (!report) return;
- tracker.signalAction({
- report_id: report.id,
- report_title: report.title ?? null,
- report_age_hours: computeReportAgeHours(report.created_at),
- action_type: "open_pr",
- surface: "detail_pane",
- is_bulk: false,
- bulk_size: 1,
- });
- openExternalUrl(url);
- },
- [report, tracker],
- );
-
- const handleDismissed = useCallback(
- (result: DismissReportResult) => {
- setDismissOpen(false);
- if (report) {
- const reasonOption = DISMISSAL_REASON_OPTIONS.find(
- (o) => o.value === result.reason,
- );
- const isSnooze =
- reasonOption !== undefined &&
- "snoozesInsteadOfDismiss" in reasonOption &&
- reasonOption.snoozesInsteadOfDismiss === true;
- tracker.signalAction({
- report_id: report.id,
- report_title: report.title ?? null,
- report_age_hours: computeReportAgeHours(report.created_at),
- action_type: isSnooze ? "snooze" : "dismiss",
- surface: "detail_pane",
- is_bulk: false,
- bulk_size: 1,
- ...(isSnooze
- ? {}
- : {
- dismissal_reason: result.reason,
- ...(result.note
- ? { dismissal_note: result.note.slice(0, 1000) }
- : {}),
- }),
- });
- }
- if (router.canGoBack()) router.back();
- },
- [router, report, tracker],
- );
-
- const handleRefunded = useCallback(() => {
- setRefundOpen(false);
- if (router.canGoBack()) router.back();
- }, [router]);
-
- const handleDiscussSubmit = useCallback(
- ({ prompt, question }: { prompt: string; question: string }) => {
- setDiscussOpen(false);
- if (!report) return;
- posthog?.capture("Inbox report action", {
- report_id: report.id,
- report_title: report.title ?? null,
- action_type: "discuss",
- surface: "detail_pane",
- is_bulk: false,
- bulk_size: 1,
- has_question: question.length > 0,
- ...(question.length > 0
- ? { question_text: question.slice(0, 500) }
- : {}),
- });
- router.push({
- pathname: "/task",
- params: {
- prompt,
- signalReport: report.id,
- signalReportRelationship: "discussion",
- signalReportDiscussionQuestion: question,
- },
- });
- },
- [report, router, posthog],
- );
-
- if (error) {
- return (
- <View className="flex-1 items-center justify-center bg-background px-4">
- <Text className="mb-4 text-center text-status-error">
- Failed to load report
- </Text>
- <Pressable
- onPress={() => router.back()}
- className="rounded-lg bg-gray-3 px-4 py-2"
- >
- <Text className="text-gray-12">Go back</Text>
- </Pressable>
- </View>
- );
- }
-
- if (isLoading || !report) {
- return (
- <View className="flex-1 items-center justify-center bg-background">
- <ActivityIndicator size="large" color={themeColors.accent[9]} />
- </View>
- );
- }
-
- const conventionalTitle = parseConventionalCommitTitle(report.title);
- const updatedAt = new Date(report.updated_at);
- const hoursSince = differenceInHours(new Date(), updatedAt);
- const timeDisplay =
- hoursSince < 24
- ? formatDistanceToNow(updatedAt, { addSuffix: true })
- : format(updatedAt, "MMM d, yyyy");
-
- const isReady = report.status === "ready";
-
- const isAwaitingInput = isReportAwaitingInput(report);
-
- const alreadyAddressed =
- report.already_addressed ??
- actionabilityJudgment?.already_addressed ??
- false;
-
- // Fold the artefact-derived already_addressed onto the report the verdict
- // reads, so the "already fixed" verdict shows even when only the judgment
- // artefact carries it.
- const bannerReport = { ...report, already_addressed: alreadyAddressed };
-
- const { canRefund: canRefundPr, disabledReason: refundDisabledReason } =
- computeRefundEligibility(report, refundFlagEnabled);
-
- return (
- <>
- <ScrollView
- className="flex-1 bg-background"
- contentContainerStyle={{
- paddingHorizontal: 16,
- paddingTop: 16,
- paddingBottom: insets.bottom + 100,
- }}
- onScroll={handleScroll}
- scrollEventThrottle={250}
- >
- {/* Badges row */}
- <View className="mb-3 flex-row flex-wrap items-center gap-1.5">
- <StatusBadge status={report.status} />
- {report.priority && <PriorityBadge priority={report.priority} />}
- {report.actionability && (
- <ActionabilityBadge value={report.actionability} />
- )}
- {conventionalTitle ? (
- <ConventionalCommitTag
- type={conventionalTitle.type}
- scope={conventionalTitle.scope}
- />
- ) : null}
- {report.is_suggested_reviewer && (
- <View className="rounded bg-status-warning/20 px-2 py-1">
- <Text className="font-medium text-[12px] text-status-warning">
- For you
- </Text>
- </View>
- )}
- </View>
-
- {/* Title */}
- <Text className="mb-2 font-semibold text-[18px] text-gray-12">
- {humanizeReportTitle(report.title, "Untitled report")}
- </Text>
-
- {/* Meta row */}
- <View className="mb-4 flex-row items-center gap-3">
- <View className="flex-row items-center gap-1">
- <Lightning size={13} color={themeColors.gray[9]} />
- <Text className="text-[12px] text-gray-9">
- {report.signal_count} signal{report.signal_count !== 1 ? "s" : ""}
- </Text>
- </View>
- <Text className="text-[12px] text-gray-9">Updated {timeDisplay}</Text>
- {report.implementation_pr_url ? (
- <View className="ml-auto">
- <PrStatusBadge
- prUrl={report.implementation_pr_url}
- hideWhenUnresolved
- size="sm"
- />
- </View>
- ) : null}
- </View>
-
- {/* Verdict banner: the report's state and its one ask, up front */}
- <ReportVerdictBanner
- report={bannerReport}
- onStart={handleBannerStart}
- onOpenPr={handleOpenPr}
- />
-
- {/* Summary */}
- {report.summary && (
- <View className="mb-4" style={{ opacity: isReady ? 1 : 0.7 }}>
- <MarkdownText
- content={formatSignalReportSummaryMarkdown(report.summary)}
- />
- </View>
- )}
-
- {/* Suggested reviewers */}
- {reviewerArtefact && (
- <SuggestedReviewers
- reportId={report.id}
- artefact={reviewerArtefact}
- meUuid={me?.uuid}
- fireAction={fireReviewerAction}
- />
- )}
-
- {/* Signals */}
- {signals.length > 0 && (
- <View className="mb-4">
- <Pressable
- onPress={handleToggleSignals}
- hitSlop={6}
- accessibilityRole="button"
- accessibilityState={{ expanded: signalsExpanded }}
- className="mb-2 flex-row items-center gap-1.5 self-start py-1 active:opacity-60"
- >
- {signalsExpanded ? (
- <CaretDown size={14} color={themeColors.gray[12]} />
- ) : (
- <CaretRight size={14} color={themeColors.gray[12]} />
- )}
- <Text className="font-semibold text-[14px] text-gray-12">
- Signals ({signals.length})
- </Text>
- </Pressable>
- {signalsExpanded && (
- <View className="gap-2">
- {signals.map((signal) => (
- <SignalCard
- key={signal.signal_id}
- signal={signal}
- finding={findingsBySignalId.get(signal.signal_id)}
- />
- ))}
- </View>
- )}
- </View>
- )}
- {signalsQuery.isLoading && (
- <Text className="text-[12px] text-gray-9">Loading signals…</Text>
- )}
-
- {/* Activity log */}
- <ReportActivity
- reportId={report.id}
- artefacts={artefacts}
- collapsedNoteCount={report.collapsed_note_count}
- />
-
- {/* Usefulness feedback */}
- <ReportFeedbackFooter report={report} />
- </ScrollView>
-
- <View
- className="absolute inset-x-0 flex-row flex-wrap items-center justify-center gap-3 px-4"
- style={{ bottom: insets.bottom + 16 }}
- pointerEvents="box-none"
- >
- <Pressable
- onPress={() => setDismissOpen(true)}
- accessibilityLabel="Dismiss report"
- className="flex-row items-center gap-2 rounded-full border border-gray-6 bg-background px-4 py-3.5 shadow-lg active:opacity-80"
- >
- <ThumbsDown size={16} color={themeColors.gray[11]} weight="fill" />
- <Text className="font-semibold text-[15px] text-gray-11">
- Dismiss
- </Text>
- </Pressable>
-
- <Pressable
- onPress={() => {
- Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
- setDiscussOpen(true);
- }}
- accessibilityLabel="Discuss report"
- className="flex-row items-center gap-2 rounded-full border border-gray-6 bg-background px-4 py-3.5 shadow-lg active:opacity-80"
- >
- <ChatCircle size={16} color={themeColors.gray[11]} weight="fill" />
- <Text className="font-semibold text-[15px] text-gray-11">
- Discuss
- </Text>
- </Pressable>
-
- {canRefundPr && (
- <Pressable
- onPress={() => {
- if (refundDisabledReason) {
- Alert.alert("Can't refund this PR", refundDisabledReason);
- return;
- }
- Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
- setRefundOpen(true);
- }}
- accessibilityLabel="Refund PR"
- accessibilityState={{ disabled: refundDisabledReason !== null }}
- className={`flex-row items-center gap-2 rounded-full border border-gray-6 bg-background px-4 py-3.5 shadow-lg active:opacity-80 ${
- refundDisabledReason ? "opacity-50" : ""
- }`}
- >
- <Receipt size={16} color={themeColors.gray[11]} weight="fill" />
- <Text className="font-semibold text-[15px] text-gray-11">
- Refund
- </Text>
- </Pressable>
- )}
- </View>
-
- <DismissReportSheet
- visible={dismissOpen}
- reportId={report.id}
- reportTitle={report.title?.trim() ? report.title : "Untitled report"}
- hasOpenPr={
- Boolean(report.implementation_pr_url) &&
- report.implementation_pr_merged !== true
- }
- onClose={() => setDismissOpen(false)}
- onDismissed={handleDismissed}
- />
-
- <DiscussReportSheet
- visible={discussOpen}
- reportId={report.id}
- reportTitle={report.title}
- onClose={() => setDiscussOpen(false)}
- onSubmit={handleDiscussSubmit}
- />
-
- <CreatePrFeedbackSheet
- visible={createPrFeedbackOpen}
- isAwaitingInput={isAwaitingInput}
- onClose={() => setCreatePrFeedbackOpen(false)}
- onSubmit={handleStartTask}
- />
-
- <RefundReportSheet
- visible={refundOpen}
- reportId={report.id}
- reportTitle={report.title?.trim() || "Untitled report"}
- onClose={() => setRefundOpen(false)}
- onRefunded={handleRefunded}
- />
- </>
- );
-}
diff --git a/products/desktop/apps/mobile/src/app/index.tsx b/products/desktop/apps/mobile/src/app/index.tsx
deleted file mode 100644
index 9421715b13ac..000000000000
--- a/products/desktop/apps/mobile/src/app/index.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { Redirect } from "expo-router";
-import { useAuthStore } from "@/features/auth";
-
-export default function Index() {
- const { isAuthenticated } = useAuthStore();
-
- // Redirect to tasks if authenticated, otherwise to login. The consent gate in
- // the root layout bounces unconsented users to /consent from here.
- if (isAuthenticated) {
- return <Redirect href="/(tabs)/tasks" />;
- }
-
- return <Redirect href="/auth" />;
-}
diff --git a/products/desktop/apps/mobile/src/app/mcp-servers/add-custom.tsx b/products/desktop/apps/mobile/src/app/mcp-servers/add-custom.tsx
deleted file mode 100644
index cb48d1b68ef1..000000000000
--- a/products/desktop/apps/mobile/src/app/mcp-servers/add-custom.tsx
+++ /dev/null
@@ -1,222 +0,0 @@
-import { Text } from "@components/text";
-import type { McpAuthType } from "@posthog/api-client/types";
-import { router } from "expo-router";
-import { Lock } from "phosphor-react-native";
-import { useState } from "react";
-import {
- ActivityIndicator,
- KeyboardAvoidingView,
- Platform,
- Pressable,
- ScrollView,
- TextInput,
- View,
-} from "react-native";
-import { FloatingMcpHeader } from "@/features/mcp/components/FloatingMcpHeader";
-import { useMcpInstallations } from "@/features/mcp/hooks";
-import { installCustomWithOAuth } from "@/features/mcp/oauth";
-import { useScreenInsets } from "@/hooks/useScreenInsets";
-import { logger } from "@/lib/logger";
-import { useThemeColors } from "@/lib/theme";
-
-const log = logger.scope("mcp-add-custom");
-
-const AUTH_OPTIONS: { value: McpAuthType; label: string }[] = [
- { value: "none", label: "None" },
- { value: "api_key", label: "API key" },
- { value: "oauth", label: "OAuth" },
-];
-
-export default function AddCustomMcpServerScreen() {
- const themeColors = useThemeColors();
- const { insets, bottom } = useScreenInsets();
- const installations = useMcpInstallations();
-
- const [name, setName] = useState("");
- const [url, setUrl] = useState("");
- const [description, setDescription] = useState("");
- const [authType, setAuthType] = useState<McpAuthType>("none");
- const [apiKey, setApiKey] = useState("");
- const [clientId, setClientId] = useState("");
- const [clientSecret, setClientSecret] = useState("");
-
- const [submitting, setSubmitting] = useState(false);
- const [error, setError] = useState<string | null>(null);
-
- const handleSubmit = async () => {
- setError(null);
- if (!name.trim()) return setError("Name is required");
- if (!url.trim()) return setError("URL is required");
-
- setSubmitting(true);
- try {
- await installCustomWithOAuth({
- name: name.trim(),
- url: url.trim(),
- auth_type: authType,
- description: description.trim() || undefined,
- api_key:
- authType === "api_key" && apiKey.trim() ? apiKey.trim() : undefined,
- client_id:
- authType === "oauth" && clientId.trim() ? clientId.trim() : undefined,
- client_secret:
- authType === "oauth" && clientSecret.trim()
- ? clientSecret.trim()
- : undefined,
- });
- await installations.refetch();
- router.back();
- } catch (err) {
- log.warn("Custom install failed", err);
- setError(err instanceof Error ? err.message : "Install failed");
- setSubmitting(false);
- }
- };
-
- return (
- <View className="flex-1 bg-background">
- <FloatingMcpHeader title="Add custom server" />
- <KeyboardAvoidingView
- className="flex-1"
- behavior={Platform.OS === "ios" ? "padding" : undefined}
- keyboardVerticalOffset={insets.top + 60}
- >
- <ScrollView
- className="flex-1"
- contentContainerStyle={{
- paddingTop: insets.top + 60,
- paddingBottom: bottom("default"),
- paddingHorizontal: 16,
- }}
- keyboardShouldPersistTaps="handled"
- >
- <FieldLabel>Name</FieldLabel>
- <FieldInput
- value={name}
- onChangeText={setName}
- placeholder="My server"
- autoCapitalize="none"
- autoCorrect={false}
- />
-
- <FieldLabel>URL</FieldLabel>
- <FieldInput
- value={url}
- onChangeText={setUrl}
- placeholder="https://example.com/mcp"
- autoCapitalize="none"
- autoCorrect={false}
- keyboardType="url"
- />
-
- <FieldLabel>Description (optional)</FieldLabel>
- <FieldInput
- value={description}
- onChangeText={setDescription}
- placeholder="What does this server do?"
- />
-
- <FieldLabel>Auth type</FieldLabel>
- <View className="mb-4 flex-row gap-2">
- {AUTH_OPTIONS.map((option) => {
- const active = authType === option.value;
- return (
- <Pressable
- key={option.value}
- onPress={() => setAuthType(option.value)}
- className={`flex-1 items-center rounded-lg border px-3 py-2 ${active ? "border-accent-9 bg-accent-3" : "border-gray-5 bg-card active:bg-gray-2"}`}
- >
- <Text
- className={`font-medium text-[13px] ${active ? "text-accent-11" : "text-gray-11"}`}
- >
- {option.label}
- </Text>
- </Pressable>
- );
- })}
- </View>
-
- {authType === "api_key" ? (
- <>
- <FieldLabel>API key</FieldLabel>
- <FieldInput
- value={apiKey}
- onChangeText={setApiKey}
- placeholder="Paste your API key"
- secureTextEntry
- autoCapitalize="none"
- autoCorrect={false}
- />
- </>
- ) : null}
-
- {authType === "oauth" ? (
- <>
- <View className="mb-3 flex-row items-start gap-2 rounded-lg border border-gray-5 bg-card p-3">
- <Lock size={14} color={themeColors.gray[11]} />
- <Text className="flex-1 text-[12px] text-gray-11">
- You'll be sent to the provider to sign in after submitting.
- </Text>
- </View>
- <FieldLabel>OAuth client ID</FieldLabel>
- <FieldInput
- value={clientId}
- onChangeText={setClientId}
- placeholder="OAuth client ID"
- autoCapitalize="none"
- autoCorrect={false}
- />
- <FieldLabel>OAuth client secret</FieldLabel>
- <FieldInput
- value={clientSecret}
- onChangeText={setClientSecret}
- placeholder="OAuth client secret"
- secureTextEntry
- autoCapitalize="none"
- autoCorrect={false}
- />
- </>
- ) : null}
-
- {error ? (
- <Text className="mb-3 text-[13px] text-status-error">{error}</Text>
- ) : null}
-
- <Pressable
- onPress={handleSubmit}
- disabled={submitting}
- className="items-center rounded-lg bg-accent-9 py-3 active:opacity-80"
- >
- {submitting ? (
- <ActivityIndicator color={themeColors.accent.contrast} />
- ) : (
- <Text className="font-semibold text-[15px] text-accent-contrast">
- Install
- </Text>
- )}
- </Pressable>
- </ScrollView>
- </KeyboardAvoidingView>
- </View>
- );
-}
-
-function FieldLabel({ children }: { children: string }) {
- return (
- <Text className="mt-3 mb-1 font-medium text-[13px] text-gray-12">
- {children}
- </Text>
- );
-}
-
-function FieldInput(props: React.ComponentProps<typeof TextInput>) {
- const themeColors = useThemeColors();
- return (
- <TextInput
- {...props}
- placeholderTextColor={themeColors.gray[10]}
- className="rounded-lg border border-gray-5 bg-card px-3 py-2.5 text-[14px] text-gray-12"
- style={{ minHeight: 44 }}
- />
- );
-}
diff --git a/products/desktop/apps/mobile/src/app/mcp-servers/index.tsx b/products/desktop/apps/mobile/src/app/mcp-servers/index.tsx
deleted file mode 100644
index 680609d4005e..000000000000
--- a/products/desktop/apps/mobile/src/app/mcp-servers/index.tsx
+++ /dev/null
@@ -1,234 +0,0 @@
-import { Text } from "@components/text";
-import type {
- McpRecommendedServer,
- McpServerInstallation,
-} from "@posthog/api-client/types";
-import { useRouter } from "expo-router";
-import { MagnifyingGlass, Plus, PuzzlePiece } from "phosphor-react-native";
-import { useMemo, useState } from "react";
-import {
- ActivityIndicator,
- FlatList,
- Pressable,
- RefreshControl,
- TextInput,
- View,
-} from "react-native";
-import { FloatingMcpHeader } from "@/features/mcp/components/FloatingMcpHeader";
-import {
- installationToRowProps,
- McpServerRow,
- recommendedToRowProps,
-} from "@/features/mcp/components/McpServerRow";
-import { useMcpInstallations, useMcpMarketplace } from "@/features/mcp/hooks";
-import { useScreenInsets } from "@/hooks/useScreenInsets";
-import { useThemeColors } from "@/lib/theme";
-
-type Tab = "installed" | "marketplace";
-
-export default function McpServersScreen() {
- const themeColors = useThemeColors();
- const { insets, bottom } = useScreenInsets();
- const router = useRouter();
- const [tab, setTab] = useState<Tab>("installed");
- const [search, setSearch] = useState("");
-
- const installations = useMcpInstallations();
- const marketplace = useMcpMarketplace();
-
- const installedNames = useMemo(
- () => new Set((installations.data ?? []).map((i) => i.name)),
- [installations.data],
- );
-
- const handleAddCustom = () => router.push("/mcp-servers/add-custom");
-
- const handleOpenInstallation = (i: McpServerInstallation) =>
- router.push({
- pathname: "/mcp-servers/installation/[id]",
- params: { id: i.id },
- });
-
- const handleOpenTemplate = (t: McpRecommendedServer) =>
- router.push({
- pathname: "/mcp-servers/template/[id]",
- params: { id: t.id },
- });
-
- const filteredInstallations = useMemo(() => {
- const list = installations.data ?? [];
- if (!search) return list;
- const q = search.toLowerCase();
- return list.filter(
- (i) =>
- (i.display_name ?? i.name).toLowerCase().includes(q) ||
- i.url?.toLowerCase().includes(q),
- );
- }, [installations.data, search]);
-
- const filteredMarketplace = useMemo(() => {
- const list = marketplace.data ?? [];
- if (!search) return list;
- const q = search.toLowerCase();
- return list.filter(
- (t) =>
- t.name.toLowerCase().includes(q) ||
- t.description?.toLowerCase().includes(q),
- );
- }, [marketplace.data, search]);
-
- const isPending =
- tab === "installed" ? installations.isPending : marketplace.isPending;
-
- return (
- <View className="flex-1 bg-background">
- <FloatingMcpHeader title="MCP servers" onAddPress={handleAddCustom} />
-
- <View className="flex-1" style={{ paddingTop: insets.top + 60 }}>
- {/* Tab bar */}
- <View className="mb-2 flex-row gap-2 px-4">
- {(["installed", "marketplace"] as const).map((t) => {
- const active = tab === t;
- return (
- <Pressable
- key={t}
- onPress={() => setTab(t)}
- className={`flex-1 items-center rounded-lg border px-3 py-2 ${active ? "border-accent-9 bg-accent-3" : "border-gray-5 bg-card active:bg-gray-2"}`}
- >
- <Text
- className={`font-medium text-[14px] ${active ? "text-accent-11" : "text-gray-11"}`}
- >
- {t === "installed" ? "Installed" : "Marketplace"}
- </Text>
- </Pressable>
- );
- })}
- </View>
-
- {/* Search */}
- <View className="mb-3 px-4">
- <View className="flex-row items-center gap-2 rounded-lg border border-gray-5 bg-card px-3 py-2">
- <MagnifyingGlass size={16} color={themeColors.gray[10]} />
- <TextInput
- value={search}
- onChangeText={setSearch}
- placeholder={
- tab === "installed" ? "Filter installed" : "Search marketplace"
- }
- placeholderTextColor={themeColors.gray[10]}
- className="flex-1 text-[14px] text-gray-12"
- autoCapitalize="none"
- autoCorrect={false}
- />
- </View>
- </View>
-
- {isPending ? (
- <View className="flex-1 items-center justify-center">
- <ActivityIndicator color={themeColors.accent[9]} />
- </View>
- ) : tab === "installed" ? (
- <FlatList
- data={filteredInstallations}
- keyExtractor={(i) => i.id}
- renderItem={({ item }) => (
- <McpServerRow
- {...installationToRowProps(item, handleOpenInstallation)}
- />
- )}
- ListEmptyComponent={
- <InstalledEmpty
- onBrowsePress={() => setTab("marketplace")}
- onAddCustom={handleAddCustom}
- />
- }
- refreshControl={
- <RefreshControl
- refreshing={installations.isRefetching}
- onRefresh={() => installations.refetch()}
- tintColor={themeColors.accent[9]}
- />
- }
- contentContainerStyle={{ paddingBottom: bottom("default") }}
- />
- ) : (
- <FlatList
- data={filteredMarketplace}
- keyExtractor={(t) => t.id}
- renderItem={({ item }) => (
- <McpServerRow
- {...recommendedToRowProps(
- item,
- installedNames,
- handleOpenTemplate,
- )}
- />
- )}
- ListEmptyComponent={<MarketplaceEmpty />}
- refreshControl={
- <RefreshControl
- refreshing={marketplace.isRefetching}
- onRefresh={() => marketplace.refetch()}
- tintColor={themeColors.accent[9]}
- />
- }
- contentContainerStyle={{ paddingBottom: bottom("default") }}
- />
- )}
- </View>
- </View>
- );
-}
-
-function InstalledEmpty({
- onBrowsePress,
- onAddCustom,
-}: {
- onBrowsePress: () => void;
- onAddCustom: () => void;
-}) {
- const themeColors = useThemeColors();
- return (
- <View className="items-center px-8 py-16">
- <View className="mb-4 h-12 w-12 items-center justify-center rounded-full bg-gray-3">
- <PuzzlePiece size={22} color={themeColors.gray[11]} weight="bold" />
- </View>
- <Text className="mb-1 font-semibold text-[16px] text-gray-12">
- No MCP servers installed
- </Text>
- <Text className="mb-5 text-center text-[13px] text-gray-10 leading-snug">
- MCP servers extend your agent with extra tools. Browse the marketplace
- or add a custom URL to get started.
- </Text>
- <View className="flex-row gap-2">
- <Pressable
- onPress={onBrowsePress}
- className="rounded-lg bg-accent-9 px-4 py-2 active:opacity-80"
- >
- <Text className="font-semibold text-[14px] text-accent-contrast">
- Browse marketplace
- </Text>
- </Pressable>
- <Pressable
- onPress={onAddCustom}
- className="flex-row items-center gap-1 rounded-lg border border-gray-5 bg-card px-3 py-2 active:bg-gray-2"
- >
- <Plus size={14} color={themeColors.gray[12]} weight="bold" />
- <Text className="font-medium text-[14px] text-gray-12">
- Add custom
- </Text>
- </Pressable>
- </View>
- </View>
- );
-}
-
-function MarketplaceEmpty() {
- return (
- <View className="items-center px-8 py-16">
- <Text className="text-center text-[13px] text-gray-10">
- No servers match your search.
- </Text>
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/app/mcp-servers/installation/[id].tsx b/products/desktop/apps/mobile/src/app/mcp-servers/installation/[id].tsx
deleted file mode 100644
index 2d182b00134c..000000000000
--- a/products/desktop/apps/mobile/src/app/mcp-servers/installation/[id].tsx
+++ /dev/null
@@ -1,351 +0,0 @@
-import { Text } from "@components/text";
-import type { McpApprovalState } from "@posthog/api-client/types";
-import { router, useLocalSearchParams } from "expo-router";
-import {
- ArrowsClockwise,
- CheckCircle,
- Trash,
- Warning,
-} from "phosphor-react-native";
-import { useMemo, useState } from "react";
-import {
- ActivityIndicator,
- Alert,
- Pressable,
- RefreshControl,
- ScrollView,
- Switch,
- View,
-} from "react-native";
-import { FloatingMcpHeader } from "@/features/mcp/components/FloatingMcpHeader";
-import { ServerIcon } from "@/features/mcp/components/ServerIcon";
-import {
- useMcpInstallations,
- useMcpInstallationTools,
- useRefreshMcpInstallationTools,
- useUninstallMcpServer,
- useUpdateMcpServerInstallation,
- useUpdateMcpToolApproval,
-} from "@/features/mcp/hooks";
-import { reauthorizeInstallation } from "@/features/mcp/oauth";
-import { isStdioMcpServer } from "@/features/mcp/presentation";
-import { getMcpConnectionManager } from "@/features/mcp/service";
-import { useScreenInsets } from "@/hooks/useScreenInsets";
-import { logger } from "@/lib/logger";
-import { useThemeColors } from "@/lib/theme";
-
-const log = logger.scope("mcp-installation-detail");
-
-export default function McpInstallationDetailScreen() {
- const { id } = useLocalSearchParams<{ id: string }>();
- const themeColors = useThemeColors();
- const { insets, bottom } = useScreenInsets();
-
- const installations = useMcpInstallations();
- const installation = useMemo(
- () => installations.data?.find((i) => i.id === id) ?? null,
- [installations.data, id],
- );
-
- const tools = useMcpInstallationTools(installation?.id ?? null);
- const refreshMutation = useRefreshMcpInstallationTools();
- const uninstallMutation = useUninstallMcpServer();
- const updateMutation = useUpdateMcpServerInstallation();
- const approvalMutation = useUpdateMcpToolApproval();
-
- const [reauthLoading, setReauthLoading] = useState(false);
-
- if (installations.isPending || !installation) {
- return (
- <View className="flex-1 bg-background">
- <FloatingMcpHeader title="Server" />
- <View
- className="flex-1 items-center justify-center"
- style={{ paddingTop: insets.top + 60 }}
- >
- {installations.isPending ? (
- <ActivityIndicator color={themeColors.accent[9]} />
- ) : (
- <Text className="text-[14px] text-gray-11">
- Installation not found.
- </Text>
- )}
- </View>
- </View>
- );
- }
-
- const stdio = isStdioMcpServer(installation);
-
- const handleEnabledChange = (enabled: boolean) => {
- updateMutation.mutate({
- installationId: installation.id,
- updates: { is_enabled: enabled },
- });
- };
-
- const handleReauthorize = async () => {
- setReauthLoading(true);
- try {
- await reauthorizeInstallation(installation.id);
- await installations.refetch();
- } catch (err) {
- log.warn("Reauth failed", err);
- } finally {
- setReauthLoading(false);
- }
- };
-
- const handleUninstall = () => {
- Alert.alert(
- "Uninstall server",
- `Remove "${installation.display_name || installation.name}"? Any task using its tools will lose access.`,
- [
- { text: "Cancel", style: "cancel" },
- {
- text: "Uninstall",
- style: "destructive",
- onPress: async () => {
- try {
- await uninstallMutation.mutateAsync(installation.id);
- await getMcpConnectionManager().close(installation.id);
- await installations.refetch();
- router.back();
- } catch (err) {
- log.warn("Uninstall failed", err);
- Alert.alert(
- "Failed to uninstall",
- err instanceof Error ? err.message : "Unknown error",
- );
- }
- },
- },
- ],
- );
- };
-
- const handleApprovalChange = (toolName: string, state: McpApprovalState) => {
- approvalMutation.mutate({
- installationId: installation.id,
- toolName,
- approval_state: state,
- });
- };
-
- return (
- <View className="flex-1 bg-background">
- <FloatingMcpHeader
- title={installation.display_name || installation.name}
- />
-
- <ScrollView
- className="flex-1"
- contentContainerStyle={{
- paddingTop: insets.top + 60,
- paddingBottom: bottom("default"),
- paddingHorizontal: 16,
- }}
- refreshControl={
- <RefreshControl
- refreshing={installations.isRefetching || tools.isRefetching}
- onRefresh={() => {
- installations.refetch();
- tools.refetch();
- }}
- tintColor={themeColors.accent[9]}
- />
- }
- >
- {/* Header */}
- <View className="mb-4 flex-row items-center gap-3">
- <ServerIcon
- iconDomain={installation.icon_domain}
- serverUrl={installation.url}
- size={48}
- />
- <View className="min-w-0 flex-1">
- <Text className="font-semibold text-[18px] text-gray-12">
- {installation.display_name || installation.name}
- </Text>
- {installation.description ? (
- <Text
- className="mt-0.5 text-[12px] text-gray-10"
- numberOfLines={2}
- >
- {installation.description}
- </Text>
- ) : null}
- </View>
- </View>
-
- {/* Status pills */}
- <View className="mb-4 flex-row flex-wrap gap-2">
- <View className="rounded bg-gray-3 px-2 py-0.5">
- <Text className="font-medium text-[11px] text-gray-11 uppercase">
- {installation.auth_type === "oauth"
- ? "OAuth"
- : installation.auth_type === "api_key"
- ? "API key"
- : "No auth"}
- </Text>
- </View>
- {stdio ? (
- <View className="rounded bg-gray-3 px-2 py-0.5">
- <Text className="font-medium text-[11px] text-gray-11 uppercase">
- Desktop only
- </Text>
- </View>
- ) : null}
- {installation.needs_reauth ? (
- <View className="flex-row items-center gap-1 rounded bg-card px-2 py-0.5">
- <Warning size={12} color={themeColors.status.warning} />
- <Text className="font-medium text-[11px] text-status-warning uppercase">
- Needs reauth
- </Text>
- </View>
- ) : null}
- </View>
-
- {/* Enabled toggle */}
- <View className="mb-4 flex-row items-center justify-between rounded-lg border border-gray-5 bg-card px-4 py-3">
- <View className="flex-1">
- <Text className="font-medium text-[15px] text-gray-12">
- Enabled
- </Text>
- <Text className="text-[12px] text-gray-10">
- Allow your agent to call this server's tools
- </Text>
- </View>
- <Switch
- value={installation.is_enabled ?? true}
- onValueChange={handleEnabledChange}
- />
- </View>
-
- {/* Reauth */}
- {installation.needs_reauth ? (
- <Pressable
- onPress={handleReauthorize}
- disabled={reauthLoading}
- className="mb-4 flex-row items-center justify-center gap-2 rounded-lg bg-accent-9 py-3 active:opacity-80"
- >
- {reauthLoading ? (
- <ActivityIndicator color={themeColors.accent.contrast} />
- ) : (
- <Text className="font-semibold text-[14px] text-accent-contrast">
- Reauthorize
- </Text>
- )}
- </Pressable>
- ) : null}
-
- {/* Tools */}
- <View className="mb-3 flex-row items-center justify-between">
- <Text className="font-semibold text-[14px] text-gray-12">
- Tools ({installation.tool_count})
- </Text>
- <Pressable
- onPress={() => refreshMutation.mutate(installation.id)}
- disabled={refreshMutation.isPending}
- hitSlop={8}
- className="flex-row items-center gap-1 rounded-md bg-gray-3 px-2 py-1 active:opacity-60"
- >
- <ArrowsClockwise
- size={12}
- color={themeColors.gray[12]}
- weight="bold"
- />
- <Text className="font-medium text-[12px] text-gray-12">
- Refresh
- </Text>
- </Pressable>
- </View>
-
- {tools.isPending ? (
- <View className="rounded-lg border border-gray-5 bg-card p-4">
- <ActivityIndicator color={themeColors.accent[9]} />
- </View>
- ) : tools.data?.length ? (
- <View className="overflow-hidden rounded-lg border border-gray-5 bg-card">
- {tools.data.map((tool, idx) => {
- const last = idx === (tools.data?.length ?? 0) - 1;
- const isApproved = tool.approval_state === "approved";
- return (
- <View
- key={tool.id}
- className={`px-4 py-3 ${last ? "" : "border-gray-5 border-b"}`}
- >
- <View className="flex-row items-center justify-between">
- <View className="min-w-0 flex-1 pr-3">
- <Text
- className="font-medium text-[14px] text-gray-12"
- numberOfLines={1}
- >
- {tool.display_name || tool.tool_name}
- </Text>
- {tool.description ? (
- <Text
- className="mt-0.5 text-[12px] text-gray-10 leading-snug"
- numberOfLines={2}
- >
- {tool.description}
- </Text>
- ) : null}
- </View>
- <Pressable
- onPress={() =>
- handleApprovalChange(
- tool.tool_name,
- isApproved ? "needs_approval" : "approved",
- )
- }
- hitSlop={6}
- className="flex-row items-center gap-1"
- >
- {isApproved ? (
- <>
- <CheckCircle
- size={14}
- color={themeColors.status.success}
- weight="fill"
- />
- <Text className="font-medium text-[12px] text-status-success">
- Approved
- </Text>
- </>
- ) : (
- <View className="rounded bg-gray-3 px-2 py-1">
- <Text className="font-medium text-[11px] text-gray-11 uppercase">
- Approve
- </Text>
- </View>
- )}
- </Pressable>
- </View>
- </View>
- );
- })}
- </View>
- ) : (
- <View className="rounded-lg border border-gray-5 bg-card p-4">
- <Text className="text-[13px] text-gray-10">
- No tools discovered yet. Tap Refresh to retry.
- </Text>
- </View>
- )}
-
- {/* Uninstall */}
- <Pressable
- onPress={handleUninstall}
- disabled={uninstallMutation.isPending}
- className="mt-6 flex-row items-center justify-center gap-2 rounded-lg border border-status-error bg-card py-3 active:opacity-60"
- >
- <Trash size={14} color={themeColors.status.error} weight="bold" />
- <Text className="font-semibold text-[14px] text-status-error">
- Uninstall server
- </Text>
- </Pressable>
- </ScrollView>
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/app/mcp-servers/template/[id].tsx b/products/desktop/apps/mobile/src/app/mcp-servers/template/[id].tsx
deleted file mode 100644
index 50951b052af3..000000000000
--- a/products/desktop/apps/mobile/src/app/mcp-servers/template/[id].tsx
+++ /dev/null
@@ -1,264 +0,0 @@
-import { Text } from "@components/text";
-import { router, useLocalSearchParams } from "expo-router";
-import { Lock, Warning } from "phosphor-react-native";
-import { useMemo, useState } from "react";
-import {
- ActivityIndicator,
- Pressable,
- ScrollView,
- TextInput,
- View,
-} from "react-native";
-import { FloatingMcpHeader } from "@/features/mcp/components/FloatingMcpHeader";
-import { ServerIcon } from "@/features/mcp/components/ServerIcon";
-import {
- useInstallMcpTemplate,
- useMcpInstallations,
- useMcpMarketplace,
-} from "@/features/mcp/hooks";
-import { installTemplateWithOAuth } from "@/features/mcp/oauth";
-import { isStdioMcpServer } from "@/features/mcp/presentation";
-import { useScreenInsets } from "@/hooks/useScreenInsets";
-import { logger } from "@/lib/logger";
-import { openExternalUrl } from "@/lib/openExternalUrl";
-import { useThemeColors } from "@/lib/theme";
-
-const log = logger.scope("mcp-template-detail");
-
-export default function McpTemplateDetailScreen() {
- const { id } = useLocalSearchParams<{ id: string }>();
- const themeColors = useThemeColors();
- const { insets, bottom } = useScreenInsets();
-
- const marketplace = useMcpMarketplace();
- const installations = useMcpInstallations();
- const template = useMemo(
- () => marketplace.data?.find((t) => t.id === id) ?? null,
- [marketplace.data, id],
- );
- const installed = useMemo(
- () =>
- template
- ? (installations.data ?? []).some((i) => i.name === template.name)
- : false,
- [installations.data, template],
- );
-
- const [apiKey, setApiKey] = useState("");
- const [installing, setInstalling] = useState(false);
- const [error, setError] = useState<string | null>(null);
- const installMutation = useInstallMcpTemplate();
-
- if (marketplace.isPending) {
- return (
- <Loading topInset={insets.top + 60} themeColor={themeColors.accent[9]} />
- );
- }
-
- if (!template) {
- return (
- <View className="flex-1 bg-background">
- <FloatingMcpHeader title="Server" />
- <View
- className="flex-1 items-center justify-center px-8"
- style={{ paddingTop: insets.top + 60 }}
- >
- <Text className="text-center text-[14px] text-gray-11">
- Template not found.
- </Text>
- </View>
- </View>
- );
- }
-
- const stdio = isStdioMcpServer(template);
-
- const handleInstall = async () => {
- if (!template) return;
- setError(null);
- setInstalling(true);
- try {
- if (template.auth_type === "oauth") {
- const result = await installTemplateWithOAuth({
- template_id: template.id,
- });
- if (result === "cancelled") {
- setInstalling(false);
- return;
- }
- } else if (template.auth_type === "api_key") {
- if (!apiKey.trim()) {
- setError("API key is required");
- setInstalling(false);
- return;
- }
- await installMutation.mutateAsync({
- template_id: template.id,
- api_key: apiKey.trim(),
- });
- } else {
- await installMutation.mutateAsync({ template_id: template.id });
- }
- // Refresh and pop back to the list.
- await installations.refetch();
- router.back();
- } catch (err) {
- log.warn("Install failed", err);
- setError(err instanceof Error ? err.message : "Install failed");
- setInstalling(false);
- }
- };
-
- return (
- <View className="flex-1 bg-background">
- <FloatingMcpHeader title={template.name} />
- <ScrollView
- className="flex-1"
- contentContainerStyle={{
- paddingTop: insets.top + 60,
- paddingBottom: bottom("default"),
- paddingHorizontal: 16,
- }}
- >
- <View className="mb-4 flex-row items-center gap-3">
- <ServerIcon
- iconDomain={template.icon_domain}
- serverUrl={template.url}
- size={48}
- />
- <View className="min-w-0 flex-1">
- <Text className="font-semibold text-[18px] text-gray-12">
- {template.name}
- </Text>
- {template.category ? (
- <Text className="text-[12px] text-gray-10">
- {template.category}
- </Text>
- ) : null}
- </View>
- </View>
-
- {template.description ? (
- <Text className="mb-4 text-[14px] text-gray-11 leading-snug">
- {template.description}
- </Text>
- ) : null}
-
- <View className="mb-4 gap-2">
- <View className="flex-row items-center gap-2">
- <View className="rounded bg-gray-3 px-2 py-0.5">
- <Text className="font-medium text-[11px] text-gray-11 uppercase">
- {template.auth_type === "oauth"
- ? "OAuth"
- : template.auth_type === "api_key"
- ? "API key"
- : "No auth"}
- </Text>
- </View>
- {stdio ? (
- <View className="rounded bg-gray-3 px-2 py-0.5">
- <Text className="font-medium text-[11px] text-gray-11 uppercase">
- Desktop only
- </Text>
- </View>
- ) : null}
- </View>
- {template.url ? (
- <Text className="text-[12px] text-gray-10" numberOfLines={2}>
- {template.url}
- </Text>
- ) : null}
- </View>
-
- {template.docs_url ? (
- <Pressable
- onPress={() => openExternalUrl(template.docs_url as string)}
- className="mb-4 rounded-lg border border-gray-5 bg-card px-3 py-2 active:bg-gray-2"
- >
- <Text className="font-medium text-[13px] text-accent-11">
- View docs ↗
- </Text>
- </Pressable>
- ) : null}
-
- {stdio ? (
- <View className="mb-4 flex-row items-start gap-2 rounded-lg border border-gray-5 bg-card p-3">
- <Warning size={16} color={themeColors.status.warning} />
- <Text className="flex-1 text-[13px] text-gray-12">
- This server uses stdio and can't run on mobile. Install it from
- the desktop client to use it on this device.
- </Text>
- </View>
- ) : null}
-
- {template.auth_type === "api_key" && !stdio ? (
- <View className="mb-4">
- <Text className="mb-1 font-medium text-[13px] text-gray-12">
- API key
- </Text>
- <TextInput
- value={apiKey}
- onChangeText={setApiKey}
- placeholder="Paste your API key"
- placeholderTextColor={themeColors.gray[10]}
- autoCapitalize="none"
- autoCorrect={false}
- secureTextEntry
- className="rounded-lg border border-gray-5 bg-card px-3 py-2.5 text-[14px] text-gray-12"
- />
- </View>
- ) : null}
-
- {template.auth_type === "oauth" && !stdio ? (
- <View className="mb-4 flex-row items-start gap-2 rounded-lg border border-gray-5 bg-card p-3">
- <Lock size={14} color={themeColors.gray[11]} />
- <Text className="flex-1 text-[13px] text-gray-11">
- You'll be sent to the provider to sign in, then bounced back to
- the app once you authorize.
- </Text>
- </View>
- ) : null}
-
- {error ? (
- <Text className="mb-3 text-[13px] text-status-error">{error}</Text>
- ) : null}
-
- <Pressable
- onPress={handleInstall}
- disabled={installing || installed || stdio}
- className={`items-center rounded-lg py-3 ${stdio || installed ? "bg-gray-3 opacity-60" : "bg-accent-9 active:opacity-80"}`}
- >
- {installing ? (
- <ActivityIndicator color={themeColors.accent.contrast} />
- ) : (
- <Text
- className={`font-semibold text-[15px] ${stdio || installed ? "text-gray-11" : "text-accent-contrast"}`}
- >
- {installed ? "Already installed" : "Install"}
- </Text>
- )}
- </Pressable>
- </ScrollView>
- </View>
- );
-}
-
-function Loading({
- topInset,
- themeColor,
-}: {
- topInset: number;
- themeColor: string;
-}) {
- return (
- <View className="flex-1 bg-background">
- <FloatingMcpHeader title="Server" />
- <View
- className="flex-1 items-center justify-center"
- style={{ paddingTop: topInset }}
- >
- <ActivityIndicator color={themeColor} />
- </View>
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/app/pr-diff.tsx b/products/desktop/apps/mobile/src/app/pr-diff.tsx
deleted file mode 100644
index bb895e60615f..000000000000
--- a/products/desktop/apps/mobile/src/app/pr-diff.tsx
+++ /dev/null
@@ -1,75 +0,0 @@
-import { Text } from "@components/text";
-import { useLocalSearchParams } from "expo-router";
-import { ActivityIndicator, FlatList, View } from "react-native";
-import { FileDiff } from "@/features/tasks/components/FileDiff";
-import {
- type ChangedFile,
- usePrChangedFiles,
-} from "@/features/tasks/hooks/usePrChangedFiles";
-import { useScreenInsets } from "@/hooks/useScreenInsets";
-import { useThemeColors } from "@/lib/theme";
-
-export default function PrDiffScreen() {
- const { prUrl } = useLocalSearchParams<{ prUrl?: string }>();
- const themeColors = useThemeColors();
- const { bottom } = useScreenInsets();
-
- const { data: files, isLoading } = usePrChangedFiles(prUrl ?? null);
-
- if (isLoading) {
- return (
- <View className="flex-1 items-center justify-center bg-background">
- <ActivityIndicator size="large" color={themeColors.accent[9]} />
- </View>
- );
- }
-
- if (!files || files.length === 0) {
- return (
- <View className="flex-1 items-center justify-center bg-background px-6">
- <Text className="text-center text-[14px] text-gray-11">
- No file diffs available.{"\n"}
- Private repositories require authentication.
- </Text>
- </View>
- );
- }
-
- const totalAdditions = files.reduce((s, f) => s + f.additions, 0);
- const totalDeletions = files.reduce((s, f) => s + f.deletions, 0);
-
- return (
- <FlatList<ChangedFile>
- data={files}
- keyExtractor={(f) => f.filename}
- renderItem={({ item }) => <FileDiff file={item} />}
- className="flex-1 bg-background"
- contentContainerStyle={{
- paddingHorizontal: 12,
- paddingTop: 8,
- paddingBottom: bottom("default"),
- }}
- ListHeaderComponent={
- <View className="mb-2 flex-row items-center justify-between px-1 py-1">
- <Text className="text-[13px] text-gray-11">
- {files.length} file{files.length === 1 ? "" : "s"} changed
- </Text>
- <View className="flex-row items-center gap-2">
- <Text
- className="text-[13px]"
- style={{ color: themeColors.status.success }}
- >
- +{totalAdditions}
- </Text>
- <Text
- className="text-[13px]"
- style={{ color: themeColors.status.error }}
- >
- −{totalDeletions}
- </Text>
- </View>
- </View>
- }
- />
- );
-}
diff --git a/products/desktop/apps/mobile/src/app/review.tsx b/products/desktop/apps/mobile/src/app/review.tsx
deleted file mode 100644
index 4ec6004a33dc..000000000000
--- a/products/desktop/apps/mobile/src/app/review.tsx
+++ /dev/null
@@ -1,51 +0,0 @@
-import { Text } from "@components/text";
-import { useEffect, useMemo } from "react";
-import { ActivityIndicator, View } from "react-native";
-import { useSafeAreaInsets } from "react-native-safe-area-context";
-import { FloatingBackButton } from "@/components/FloatingBackButton";
-import { TinderView } from "@/features/inbox/components/TinderView";
-import { useInboxReports } from "@/features/inbox/hooks/useInboxReports";
-import {
- decidedIds,
- useDismissedReportsStore,
-} from "@/features/inbox/stores/dismissedReportsStore";
-import { useInboxStore } from "@/features/inbox/stores/inboxStore";
-import { useThemeColors } from "@/lib/theme";
-
-export default function ReviewScreen() {
- const insets = useSafeAreaInsets();
- const themeColors = useThemeColors();
- const decided = useDismissedReportsStore(decidedIds);
- const setCurrentIndex = useInboxStore((s) => s.setCurrentIndex);
-
- const { reports, isLoading } = useInboxReports();
-
- const tinderReports = useMemo(
- () => reports.filter((r) => !decided.includes(r.id)),
- [reports, decided],
- );
-
- // Reset card index each time the review screen mounts
- useEffect(() => {
- setCurrentIndex(0);
- }, [setCurrentIndex]);
-
- if (isLoading) {
- return (
- <View className="flex-1 items-center justify-center bg-background">
- <FloatingBackButton />
- <ActivityIndicator size="large" color={themeColors.accent[9]} />
- <Text className="mt-4 text-gray-11">Loading reports...</Text>
- </View>
- );
- }
-
- return (
- <View className="flex-1 bg-background">
- <FloatingBackButton />
- <View style={{ paddingTop: insets.top + 56 }} className="flex-1">
- <TinderView reports={tinderReports} />
- </View>
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/app/settings/index.tsx b/products/desktop/apps/mobile/src/app/settings/index.tsx
deleted file mode 100644
index caaf4dcdc791..000000000000
--- a/products/desktop/apps/mobile/src/app/settings/index.tsx
+++ /dev/null
@@ -1,735 +0,0 @@
-import { Text } from "@components/text";
-import {
- EFFORT_LEVEL_LABELS,
- EFFORT_LEVELS,
-} from "@posthog/shared/domain-types";
-import { router } from "expo-router";
-import { ArrowSquareOut, CaretRight, SpeakerHigh } from "phosphor-react-native";
-import { useState } from "react";
-import { Linking, Pressable, ScrollView, Switch, View } from "react-native";
-import { useAuthStore, useProjectsQuery, useUserQuery } from "@/features/auth";
-import { useDismissedReportsStore } from "@/features/inbox/stores/dismissedReportsStore";
-import { usePushTokenStore } from "@/features/notifications/stores/pushTokenStore";
-import {
- type CompletionSound,
- type DefaultReasoningEffort,
- type FontSizePreference,
- type InitialTaskMode,
- type ThemePreference,
- usePreferencesStore,
-} from "@/features/preferences/stores/preferencesStore";
-import { DailyReportLimitRow } from "@/features/settings/components/DailyReportLimitRow";
-import { DebugInfoSection } from "@/features/settings/components/DebugInfoSection";
-import { FloatingSettingsHeader } from "@/features/settings/components/FloatingSettingsHeader";
-import { SettingsRow } from "@/features/settings/components/SettingsRow";
-import { SettingsSection } from "@/features/settings/components/SettingsSection";
-import { SelectSheet } from "@/features/tasks/composer/SelectSheet";
-import {
- type MessagingMode,
- useMessagingModeStore,
-} from "@/features/tasks/stores/messagingModeStore";
-import { playCompletionSound } from "@/features/tasks/utils/sounds";
-import { useScreenInsets } from "@/hooks/useScreenInsets";
-import { logger } from "@/lib/logger";
-import { useThemeColors } from "@/lib/theme";
-
-const THEME_OPTIONS = [
- { value: "system", label: "Match system" },
- { value: "light", label: "Light" },
- { value: "dark", label: "Dark" },
-] as const;
-
-const FONT_SIZE_OPTIONS: ReadonlyArray<{
- value: FontSizePreference;
- label: string;
-}> = [
- { value: "small", label: "Small" },
- { value: "default", label: "Default" },
- { value: "large", label: "Large" },
- { value: "xlarge", label: "Extra Large" },
-];
-
-const SOUND_OPTIONS: ReadonlyArray<{ value: CompletionSound; label: string }> =
- [
- { value: "meep", label: "Meep" },
- { value: "meep-smol", label: "Meep (smol)" },
- { value: "knock", label: "Knock" },
- { value: "ring", label: "Ring" },
- { value: "shoot", label: "Shoot" },
- { value: "slide", label: "Slide" },
- { value: "drop", label: "Drop" },
- { value: "icq", label: "ICQ" },
- ];
-
-const VOLUME_OPTIONS = [
- { value: "25", label: "Quiet (25%)" },
- { value: "50", label: "Normal (50%)" },
- { value: "75", label: "Loud (75%)" },
- { value: "100", label: "Max (100%)" },
-] as const;
-
-const TASK_MODE_OPTIONS = [
- {
- value: "plan",
- label: "Plan",
- description: "New tasks always start in Plan mode",
- },
- {
- value: "last_used",
- label: "Last used",
- description: "Remember the mode you picked last time",
- },
-] as const;
-
-const MESSAGING_MODE_OPTIONS: ReadonlyArray<{
- value: MessagingMode;
- label: string;
- description: string;
-}> = [
- {
- value: "queue",
- label: "Queue",
- description: "Hold messages until the current turn finishes",
- },
- {
- value: "steer",
- label: "Steer",
- description: "Interrupt the current turn and send right away",
- },
-];
-
-const REASONING_EFFORT_OPTIONS: ReadonlyArray<{
- value: DefaultReasoningEffort;
- label: string;
- description?: string;
-}> = [
- {
- value: "last_used",
- label: "Last used",
- description: "Remember the effort level you picked last time",
- },
- ...EFFORT_LEVELS.map((value) => ({
- value,
- label: EFFORT_LEVEL_LABELS[value],
- })),
-];
-
-function themeLabel(theme: ThemePreference): string {
- return THEME_OPTIONS.find((o) => o.value === theme)?.label ?? "Match system";
-}
-
-function fontSizeLabel(size: FontSizePreference): string {
- return FONT_SIZE_OPTIONS.find((o) => o.value === size)?.label ?? "Default";
-}
-
-function soundLabel(sound: CompletionSound): string {
- return SOUND_OPTIONS.find((o) => o.value === sound)?.label ?? "Meep";
-}
-
-function volumeLabel(volume: number): string {
- if (volume >= 100) return "Max";
- if (volume >= 75) return "Loud";
- if (volume >= 50) return "Normal";
- return "Quiet";
-}
-
-function taskModeLabel(mode: InitialTaskMode): string {
- return TASK_MODE_OPTIONS.find((o) => o.value === mode)?.label ?? "Plan";
-}
-
-function messagingModeLabel(mode: MessagingMode): string {
- return MESSAGING_MODE_OPTIONS.find((o) => o.value === mode)?.label ?? "Queue";
-}
-
-function reasoningEffortLabel(effort: DefaultReasoningEffort): string {
- return (
- REASONING_EFFORT_OPTIONS.find((o) => o.value === effort)?.label ??
- "Last used"
- );
-}
-
-export default function SettingsScreen() {
- const themeColors = useThemeColors();
- const { insets, bottom } = useScreenInsets();
-
- const {
- logout,
- cloudRegion,
- projectId,
- scopedTeams,
- setProjectId,
- getCloudUrlFromRegion,
- } = useAuthStore();
- const { data: userData } = useUserQuery();
- const { data: projects } = useProjectsQuery();
-
- const pingsEnabled = usePreferencesStore((s) => s.pingsEnabled);
- const setPingsEnabled = usePreferencesStore((s) => s.setPingsEnabled);
- const pushNotificationsEnabled = usePreferencesStore(
- (s) => s.pushNotificationsEnabled,
- );
- const setPushNotificationsEnabled = usePreferencesStore(
- (s) => s.setPushNotificationsEnabled,
- );
- const theme = usePreferencesStore((s) => s.theme);
- const setTheme = usePreferencesStore((s) => s.setTheme);
- const fontSize = usePreferencesStore((s) => s.fontSize);
- const setFontSize = usePreferencesStore((s) => s.setFontSize);
- const completionSound = usePreferencesStore((s) => s.completionSound);
- const setCompletionSound = usePreferencesStore((s) => s.setCompletionSound);
- const completionVolume = usePreferencesStore((s) => s.completionVolume);
- const setCompletionVolume = usePreferencesStore((s) => s.setCompletionVolume);
- const scaleSoundWithTaskLength = usePreferencesStore(
- (s) => s.scaleSoundWithTaskLength,
- );
- const setScaleSoundWithTaskLength = usePreferencesStore(
- (s) => s.setScaleSoundWithTaskLength,
- );
- const defaultInitialTaskMode = usePreferencesStore(
- (s) => s.defaultInitialTaskMode,
- );
- const setDefaultInitialTaskMode = usePreferencesStore(
- (s) => s.setDefaultInitialTaskMode,
- );
- const defaultReasoningEffort = usePreferencesStore(
- (s) => s.defaultReasoningEffort,
- );
- const setDefaultReasoningEffort = usePreferencesStore(
- (s) => s.setDefaultReasoningEffort,
- );
- const autoPublishCloudRuns = usePreferencesStore(
- (s) => s.autoPublishCloudRuns,
- );
- const setAutoPublishCloudRuns = usePreferencesStore(
- (s) => s.setAutoPublishCloudRuns,
- );
- const rtkEnabledCloud = usePreferencesStore((s) => s.rtkEnabledCloud);
- const setRtkEnabledCloud = usePreferencesStore((s) => s.setRtkEnabledCloud);
- const defaultMessagingMode = useMessagingModeStore((s) => s.defaultMode);
- const setDefaultMessagingMode = useMessagingModeStore(
- (s) => s.setDefaultMode,
- );
- const decidedCount = useDismissedReportsStore(
- (s) => s.dismissedIds.length + s.acceptedIds.length,
- );
- const clearDismissed = useDismissedReportsStore((s) => s.clearDismissed);
-
- const [themeSheetOpen, setThemeSheetOpen] = useState(false);
- const [fontSizeSheetOpen, setFontSizeSheetOpen] = useState(false);
- const [soundSheetOpen, setSoundSheetOpen] = useState(false);
- const [volumeSheetOpen, setVolumeSheetOpen] = useState(false);
- const [taskModeSheetOpen, setTaskModeSheetOpen] = useState(false);
- const [reasoningEffortSheetOpen, setReasoningEffortSheetOpen] =
- useState(false);
- const [messagingModeSheetOpen, setMessagingModeSheetOpen] = useState(false);
- const [projectSheetOpen, setProjectSheetOpen] = useState(false);
-
- // The selected project's name. Prefer the names fetched for the scoped teams
- // (matched on the active projectId), falling back to the backend's current
- // team name, then a bare ID. The picker is only useful with >1 project.
- const selectedProjectName =
- projects?.find((p) => p.id === projectId)?.name ||
- userData?.team?.name ||
- (projectId != null ? `Project ${projectId}` : "—");
- const canSwitchProject = scopedTeams.length > 1;
-
- const handleTogglePushNotifications = (enabled: boolean) => {
- setPushNotificationsEnabled(enabled);
- if (enabled) {
- usePushTokenStore
- .getState()
- .registerAndUpload()
- .catch((error) => {
- logger.warn("Push token registration failed", error);
- });
- } else {
- usePushTokenStore
- .getState()
- .clear()
- .catch((error) => {
- logger.warn("Push token clear failed", error);
- });
- }
- };
-
- const handleLogout = async () => {
- await logout();
- router.replace("/auth");
- };
-
- const handleOpenWebSettings = () => {
- if (!cloudRegion) return;
- const baseUrl = getCloudUrlFromRegion(cloudRegion);
- Linking.openURL(`${baseUrl}/settings`).catch(() => {});
- };
-
- const handleTestSound = () => {
- playCompletionSound().catch(() => {});
- };
-
- // Top padding leaves room for the floating header (insets.top + ~52). Bottom
- // padding clears the home indicator and gives breathing room past the last
- // row so it never hides behind it.
- const contentPaddingTop = insets.top + 60;
- const contentPaddingBottom = bottom("default");
-
- return (
- <View className="flex-1 bg-background">
- <FloatingSettingsHeader />
-
- <ScrollView
- className="flex-1"
- contentContainerStyle={{
- paddingTop: contentPaddingTop,
- paddingBottom: contentPaddingBottom,
- paddingHorizontal: 16,
- }}
- showsVerticalScrollIndicator={false}
- >
- {/* Appearance */}
- <SettingsSection title="Appearance">
- <SettingsRow
- label="Theme"
- description="Choose light, dark, or follow your system preference"
- onPress={() => setThemeSheetOpen(true)}
- rightSlot={
- <>
- <Text className="text-[14px] text-gray-11">
- {themeLabel(theme)}
- </Text>
- <CaretRight size={14} color={themeColors.gray[10]} />
- </>
- }
- />
- <SettingsRow
- label="Font size"
- description="Scale text size across the app"
- onPress={() => setFontSizeSheetOpen(true)}
- showDivider={false}
- rightSlot={
- <>
- <Text className="text-[14px] text-gray-11">
- {fontSizeLabel(fontSize)}
- </Text>
- <CaretRight size={14} color={themeColors.gray[10]} />
- </>
- }
- />
- </SettingsSection>
-
- {/* Notifications */}
- <SettingsSection title="Notifications">
- <SettingsRow
- label="Push notifications"
- description="Get notified when a task finishes or needs your input"
- rightSlot={
- <Switch
- value={pushNotificationsEnabled}
- onValueChange={handleTogglePushNotifications}
- />
- }
- />
- <SettingsRow
- label="Enable pings"
- description="Play a sound when a task completes"
- showDivider={false}
- rightSlot={
- <Switch value={pingsEnabled} onValueChange={setPingsEnabled} />
- }
- />
- </SettingsSection>
-
- {/* Sound */}
- {pingsEnabled ? (
- <SettingsSection title="Sound">
- <SettingsRow
- label="Completion sound"
- description="Pick the sound that plays when a task completes"
- onPress={() => setSoundSheetOpen(true)}
- rightSlot={
- <>
- <Pressable
- onPress={handleTestSound}
- hitSlop={8}
- className="rounded-md bg-gray-3 px-2 py-1 active:opacity-60"
- >
- <SpeakerHigh size={14} color={themeColors.gray[12]} />
- </Pressable>
- <Text className="text-[14px] text-gray-11">
- {soundLabel(completionSound)}
- </Text>
- <CaretRight size={14} color={themeColors.gray[10]} />
- </>
- }
- />
- <SettingsRow
- label="Sound volume"
- description="How loud the completion sound plays"
- onPress={() => setVolumeSheetOpen(true)}
- rightSlot={
- <>
- <Text className="text-[14px] text-gray-11">
- {volumeLabel(completionVolume)} ({completionVolume}%)
- </Text>
- <CaretRight size={14} color={themeColors.gray[10]} />
- </>
- }
- />
- <SettingsRow
- label="Scale sound speed with task length"
- description="Play the sound faster for quick tasks and slower for long ones"
- showDivider={false}
- rightSlot={
- <Switch
- value={scaleSoundWithTaskLength}
- onValueChange={setScaleSoundWithTaskLength}
- />
- }
- />
- </SettingsSection>
- ) : null}
-
- {/* Input */}
- <SettingsSection title="Input">
- <SettingsRow
- label="Initial task mode"
- description="What mode new tasks start in"
- onPress={() => setTaskModeSheetOpen(true)}
- rightSlot={
- <>
- <Text className="text-[14px] text-gray-11">
- {taskModeLabel(defaultInitialTaskMode)}
- </Text>
- <CaretRight size={14} color={themeColors.gray[10]} />
- </>
- }
- />
- <SettingsRow
- label="Default effort level"
- description="Reasoning effort to pre-fill on new tasks"
- onPress={() => setReasoningEffortSheetOpen(true)}
- rightSlot={
- <>
- <Text className="text-[14px] text-gray-11">
- {reasoningEffortLabel(defaultReasoningEffort)}
- </Text>
- <CaretRight size={14} color={themeColors.gray[10]} />
- </>
- }
- />
- <SettingsRow
- label="Messaging mode"
- description="Mode new sessions start in. Steer applies messages mid-turn. Queue holds them until the turn ends."
- onPress={() => setMessagingModeSheetOpen(true)}
- rightSlot={
- <>
- <Text className="text-[14px] text-gray-11">
- {messagingModeLabel(defaultMessagingMode)}
- </Text>
- <CaretRight size={14} color={themeColors.gray[10]} />
- </>
- }
- />
- <SettingsRow
- label="Always create pull requests for cloud runs"
- description="Cloud runs push their changes and open a draft pull request when they finish, without waiting for you to ask"
- rightSlot={
- <Switch
- value={autoPublishCloudRuns}
- onValueChange={setAutoPublishCloudRuns}
- />
- }
- />
- <SettingsRow
- label="Compress command output"
- description="Route verbose shell command output through rtk so it is compressed before it reaches the model, reducing token usage"
- showDivider={false}
- rightSlot={
- <Switch
- value={rtkEnabledCloud}
- onValueChange={setRtkEnabledCloud}
- />
- }
- />
- </SettingsSection>
-
- {/* Integrations */}
- <SettingsSection title="Integrations">
- <SettingsRow
- label="MCP servers"
- description="Browse the marketplace, manage installed servers, approve tools"
- onPress={() => router.push("/mcp-servers")}
- showDivider={false}
- rightSlot={<CaretRight size={14} color={themeColors.gray[10]} />}
- />
- </SettingsSection>
-
- {/* Inbox */}
- <SettingsSection title="Inbox">
- <DailyReportLimitRow />
- <SettingsRow
- label="Reviewed reports"
- description={`${decidedCount} report${decidedCount === 1 ? "" : "s"} reviewed in tinder mode`}
- showDivider={false}
- rightSlot={
- <Pressable
- onPress={clearDismissed}
- disabled={decidedCount === 0}
- hitSlop={6}
- className={`rounded-md border px-3 py-1.5 ${decidedCount > 0 ? "border-gray-6 bg-gray-3 active:opacity-60" : "border-gray-4 opacity-40"}`}
- >
- <Text className="font-medium text-[13px] text-gray-12">
- Clear
- </Text>
- </Pressable>
- }
- />
- </SettingsSection>
-
- {/* Organization */}
- <SettingsSection title="Organization">
- <SettingsRow
- label="Region"
- rightSlot={
- <Text className="font-medium text-[14px] text-gray-12">
- {cloudRegion?.toUpperCase() || "—"}
- </Text>
- }
- />
- <SettingsRow
- label="Display name"
- showDivider={false}
- rightSlot={
- <Text
- className="max-w-[180px] text-right font-medium text-[14px] text-gray-12"
- numberOfLines={1}
- >
- {userData?.organization?.name || "—"}
- </Text>
- }
- />
- </SettingsSection>
-
- {/* Project */}
- <SettingsSection title="Project">
- {canSwitchProject ? (
- <SettingsRow
- label="Active project"
- description="Tasks and inbox use this project"
- onPress={() => setProjectSheetOpen(true)}
- showDivider={false}
- rightSlot={
- <>
- <Text
- className="max-w-[180px] text-right font-medium text-[14px] text-gray-12"
- numberOfLines={1}
- >
- {selectedProjectName}
- </Text>
- <CaretRight size={14} color={themeColors.gray[10]} />
- </>
- }
- />
- ) : (
- <SettingsRow
- label="Display name"
- showDivider={false}
- rightSlot={
- <Text
- className="max-w-[180px] text-right font-medium text-[14px] text-gray-12"
- numberOfLines={1}
- >
- {selectedProjectName}
- </Text>
- }
- />
- )}
- </SettingsSection>
-
- {/* Profile */}
- <SettingsSection title="Profile">
- <SettingsRow
- label="First name"
- rightSlot={
- <Text
- className="max-w-[180px] text-right font-medium text-[14px] text-gray-12"
- numberOfLines={1}
- >
- {userData?.first_name || "—"}
- </Text>
- }
- />
- <SettingsRow
- label="Last name"
- rightSlot={
- <Text
- className="max-w-[180px] text-right font-medium text-[14px] text-gray-12"
- numberOfLines={1}
- >
- {userData?.last_name || "—"}
- </Text>
- }
- />
- <SettingsRow
- label="Email"
- showDivider={false}
- rightSlot={
- <Text
- className="max-w-[220px] text-right font-medium text-[14px] text-gray-12"
- numberOfLines={1}
- >
- {userData?.email || "—"}
- </Text>
- }
- />
- </SettingsSection>
-
- {/* Account */}
- <SettingsSection title="Account">
- <SettingsRow
- label="All PostHog settings"
- description="Open your full settings on the PostHog website"
- onPress={handleOpenWebSettings}
- disabled={!cloudRegion}
- rightSlot={
- <ArrowSquareOut size={16} color={themeColors.gray[11]} />
- }
- />
- <SettingsRow
- label="Sign out"
- description="Sign out of this device"
- onPress={handleLogout}
- showDivider={false}
- rightSlot={
- <Text className="font-medium text-[14px] text-status-error">
- Sign out
- </Text>
- }
- />
- </SettingsSection>
-
- {/* Debug info — staff only */}
- {userData?.is_staff ? (
- <DebugInfoSection
- cloudRegion={cloudRegion}
- projectId={projectId}
- userId={userData.id}
- userUuid={userData.uuid}
- />
- ) : null}
- </ScrollView>
-
- <SelectSheet
- open={themeSheetOpen}
- title="Theme"
- value={theme}
- onChange={(value) => setTheme(value as ThemePreference)}
- onClose={() => setThemeSheetOpen(false)}
- options={THEME_OPTIONS.map((option) => ({
- value: option.value,
- label: option.label,
- }))}
- />
-
- <SelectSheet
- open={fontSizeSheetOpen}
- title="Font size"
- value={fontSize}
- onChange={(value) => setFontSize(value as FontSizePreference)}
- onClose={() => setFontSizeSheetOpen(false)}
- options={FONT_SIZE_OPTIONS.map((option) => ({
- value: option.value,
- label: option.label,
- }))}
- />
-
- <SelectSheet
- open={soundSheetOpen}
- title="Completion sound"
- value={completionSound}
- onChange={(value) => {
- const next = value as CompletionSound;
- setCompletionSound(next);
- playCompletionSound(next).catch(() => {});
- }}
- onClose={() => setSoundSheetOpen(false)}
- options={SOUND_OPTIONS.map((option) => ({
- value: option.value,
- label: option.label,
- }))}
- />
-
- <SelectSheet
- open={volumeSheetOpen}
- title="Sound volume"
- value={String(completionVolume) as "25" | "50" | "75" | "100"}
- onChange={(value) => {
- const next = parseInt(value, 10);
- setCompletionVolume(next);
- playCompletionSound(undefined, next).catch(() => {});
- }}
- onClose={() => setVolumeSheetOpen(false)}
- options={VOLUME_OPTIONS.map((option) => ({
- value: option.value,
- label: option.label,
- }))}
- />
-
- <SelectSheet
- open={taskModeSheetOpen}
- title="Initial task mode"
- value={defaultInitialTaskMode}
- onChange={(value) =>
- setDefaultInitialTaskMode(value as InitialTaskMode)
- }
- onClose={() => setTaskModeSheetOpen(false)}
- options={TASK_MODE_OPTIONS.map((option) => ({
- value: option.value,
- label: option.label,
- description: option.description,
- }))}
- />
-
- <SelectSheet
- open={reasoningEffortSheetOpen}
- title="Default effort level"
- value={defaultReasoningEffort}
- onChange={(value) =>
- setDefaultReasoningEffort(value as DefaultReasoningEffort)
- }
- onClose={() => setReasoningEffortSheetOpen(false)}
- options={REASONING_EFFORT_OPTIONS.map((option) => ({
- value: option.value,
- label: option.label,
- description: option.description,
- }))}
- />
-
- <SelectSheet
- open={messagingModeSheetOpen}
- title="Messaging mode"
- value={defaultMessagingMode}
- onChange={(value) => setDefaultMessagingMode(value as MessagingMode)}
- onClose={() => setMessagingModeSheetOpen(false)}
- options={MESSAGING_MODE_OPTIONS.map((option) => ({
- value: option.value,
- label: option.label,
- description: option.description,
- }))}
- />
-
- <SelectSheet
- open={projectSheetOpen}
- title="Active project"
- value={projectId != null ? String(projectId) : ""}
- onChange={(value) => setProjectId(Number(value))}
- onClose={() => setProjectSheetOpen(false)}
- options={scopedTeams.map((id) => ({
- value: String(id),
- label: projects?.find((p) => p.id === id)?.name || `Project ${id}`,
- description: String(id),
- }))}
- />
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/app/task/[id].tsx b/products/desktop/apps/mobile/src/app/task/[id].tsx
deleted file mode 100644
index 623b02536d1d..000000000000
--- a/products/desktop/apps/mobile/src/app/task/[id].tsx
+++ /dev/null
@@ -1,920 +0,0 @@
-import { Text } from "@components/text";
-import { getCloudReasoningConfigOptionId } from "@posthog/core/sessions/cloudSessionConfig";
-import { getDefaultExecutionModeForAdapter } from "@posthog/core/sessions/executionModes";
-import {
- countUserMessages,
- getSessionActivityPhase,
-} from "@posthog/core/sessions/sessionActivity";
-import type { CloudComposerSelection } from "@posthog/core/task-detail/composerModelPolicy";
-import { isTaskRunning } from "@posthog/core/tasks/taskArchive";
-import {
- type Adapter,
- DEFAULT_CODEX_MODEL,
- DEFAULT_GATEWAY_MODEL,
- DEFAULT_REASONING_EFFORT,
- type ExecutionMode,
- isSupportedReasoningEffort,
- readPrUrls,
- type SupportedReasoningEffort,
- serializeCloudPrompt,
- type Task,
-} from "@posthog/shared";
-import { useQueryClient } from "@tanstack/react-query";
-import * as Haptics from "expo-haptics";
-import { useLocalSearchParams, useRouter } from "expo-router";
-import { UserSwitch } from "phosphor-react-native";
-import { useCallback, useEffect, useRef, useState } from "react";
-import {
- ActivityIndicator,
- Alert,
- Platform,
- Pressable,
- View,
-} from "react-native";
-import { useReanimatedKeyboardAnimation } from "react-native-keyboard-controller";
-import Animated, { useAnimatedStyle } from "react-native-reanimated";
-import { FloatingBackButton } from "@/components/FloatingBackButton";
-import { useUserQuery } from "@/features/auth";
-import { usePreferencesStore } from "@/features/preferences/stores/preferencesStore";
-import { CustomImageBadge } from "@/features/tasks/components/CustomImageBadge";
-import { FloatingTaskHeader } from "@/features/tasks/components/FloatingTaskHeader";
-import { HandoffTaskSheet } from "@/features/tasks/components/HandoffTaskSheet";
-import { PrDiffStatsBadge } from "@/features/tasks/components/PrDiffStatsBadge";
-import { PrStatusBadge } from "@/features/tasks/components/PrStatusBadge";
-import { StopRunButton } from "@/features/tasks/components/StopRunButton";
-import { TaskArtifacts } from "@/features/tasks/components/TaskArtifacts";
-import { TaskSessionView } from "@/features/tasks/components/TaskSessionView";
-import { buildCloudPromptBlocks } from "@/features/tasks/composer/attachments/buildCloudPrompt";
-import type { PendingAttachment } from "@/features/tasks/composer/attachments/types";
-import {
- type ContextWindow,
- DEFAULT_CONTEXT_WINDOW,
-} from "@/features/tasks/composer/options";
-import { QueuedMessagesDock } from "@/features/tasks/composer/QueuedMessagesDock";
-import { TaskChatComposer } from "@/features/tasks/composer/TaskChatComposer";
-import {
- useMessagingMode,
- useQueuedCount,
- useToggleMessagingMode,
-} from "@/features/tasks/hooks/useMessagingMode";
-import { taskKeys } from "@/features/tasks/hooks/useTasks";
-import {
- type MoveDirection,
- type QueuedMessage,
- useMessageQueueStore,
-} from "@/features/tasks/stores/messageQueueStore";
-import {
- pendingTaskPromptStoreApi,
- usePendingTaskPrompt,
-} from "@/features/tasks/stores/pendingTaskPromptStore";
-import { useTaskSessionStore } from "@/features/tasks/stores/taskSessionStore";
-import { useTaskStore } from "@/features/tasks/stores/taskStore";
-import { confirmStopRun } from "@/features/tasks/utils/archiveGuard";
-import { buildCloudTaskRunConfig } from "@/features/tasks/utils/cloudTaskRunConfig";
-import { useScreenInsets } from "@/hooks/useScreenInsets";
-import {
- ANALYTICS_EVENTS,
- useActiveTaskAnalyticsContext,
- useAnalytics,
-} from "@/lib/analytics";
-import { logger } from "@/lib/logger";
-import { getPostHogApiClient } from "@/lib/posthogApiClient";
-import { useThemeColors } from "@/lib/theme";
-
-const log = logger.scope("task-detail");
-
-function getFirstParam(value?: string | string[]): string | undefined {
- return Array.isArray(value) ? value[0] : value;
-}
-
-export default function TaskDetailScreen() {
- const { id: taskId, prompt: initialPrompt } = useLocalSearchParams<{
- id: string;
- prompt?: string;
- }>();
- const router = useRouter();
- const queryClient = useQueryClient();
- const { insets, composerBottom } = useScreenInsets();
- // Pre-compute outside the worklet: useAnimatedStyle runs on the UI thread and
- // can't call the non-worklet getter. Capturing the primitive keeps the worklet
- // closure stable (matches the pattern in task/index.tsx).
- const composerBottomValue = composerBottom();
- const themeColors = useThemeColors();
- const [task, setTask] = useState<Task | null>(null);
- const [loading, setLoading] = useState(true);
- const [error, setError] = useState<string | null>(null);
- const [retrying, setRetrying] = useState(false);
- const [handoffOpen, setHandoffOpen] = useState(false);
- const { data: currentUser } = useUserQuery();
-
- const {
- connectToTask,
- disconnectFromTask,
- sendPrompt,
- cancelPrompt,
- sendInterrupting,
- sendPermissionResponse,
- setConfigOption,
- getSessionForTask,
- setFocusedTaskId,
- steerQueuedMessage,
- flushQueuedMessagesIfIdle,
- stopRun,
- } = useTaskSessionStore();
-
- useEffect(() => {
- if (!taskId) return;
- setFocusedTaskId(taskId);
- return () => {
- setFocusedTaskId(null);
- };
- }, [taskId, setFocusedTaskId]);
-
- // Tag every PostHog event fired while this task is open with the originating
- // inbox report id, so a discuss-launched run can be filtered down in PostHog.
- // Cleared when the screen unmounts. Matches the desktop super-property.
- useActiveTaskAnalyticsContext(task?.signal_report ?? null);
-
- const session = taskId ? getSessionForTask(taskId) : undefined;
-
- // Optimistic echo set by the new-task screen (or the terminal-resume path
- // below) so the user's prompt appears in the thread immediately, before
- // the live session catches up.
- const optimisticPrompt = usePendingTaskPrompt(taskId);
-
- // Clear the echo once the canonical user_message_chunk with matching text
- // arrives via SSE — `TaskSessionView` also dedups visually, but clearing
- // the store frees it for the next submit. Only events with `ts >= setAt`
- // qualify so a text-identical historical turn (e.g. resubmitting
- // "Continue") doesn't drop the echo before the real copy lands.
- useEffect(() => {
- if (!taskId || !optimisticPrompt) return;
- const matched = session?.events.some(
- (e) =>
- e.type === "session_update" &&
- e.notification?.update?.sessionUpdate === "user_message_chunk" &&
- e.notification.update.content?.text === optimisticPrompt.promptText &&
- (e.ts ?? 0) >= optimisticPrompt.setAt,
- );
- if (matched) {
- pendingTaskPromptStoreApi.clear(taskId);
- }
- }, [taskId, optimisticPrompt, session?.events]);
-
- // Per-task composer pill values. Persisted in taskStore so reopening the
- // task keeps the user's choices; defaults fall back to the same constants
- // the new-task composer uses.
- const composerConfig = useTaskStore((s) =>
- taskId ? s.composerConfigByTaskId[taskId] : undefined,
- );
- const pendingPrompt = useTaskStore((s) =>
- taskId ? s.pendingPromptByTaskId[taskId] : undefined,
- );
- const setComposerConfig = useTaskStore((s) => s.setComposerConfig);
- const setPendingPrompt = useTaskStore((s) => s.setPendingPrompt);
- const consumePendingPrompt = useTaskStore((s) => s.consumePendingPrompt);
- const [initialComposerMessage, setInitialComposerMessage] = useState<
- string | undefined
- >();
- const composerAdapter: Adapter =
- task?.latest_run?.runtime_adapter &&
- !session?.terminalStatus &&
- composerConfig?.adapter !== task.latest_run.runtime_adapter
- ? task.latest_run.runtime_adapter
- : (composerConfig?.adapter ??
- task?.latest_run?.runtime_adapter ??
- "claude");
- const composerConfigMatchesAdapter =
- composerConfig?.adapter === undefined
- ? composerAdapter === "claude"
- : composerConfig.adapter === composerAdapter;
- const composerMode: ExecutionMode =
- (composerConfigMatchesAdapter ? composerConfig?.mode : undefined) ??
- getDefaultExecutionModeForAdapter(composerAdapter);
- // The composer independently re-resolves this against the live config once mounted.
- const composerModel =
- (composerConfigMatchesAdapter ? composerConfig?.model : undefined) ??
- task?.latest_run?.model ??
- (composerAdapter === "codex" ? DEFAULT_CODEX_MODEL : DEFAULT_GATEWAY_MODEL);
- const requestedComposerReasoning = composerConfigMatchesAdapter
- ? composerConfig?.reasoning
- : undefined;
- const composerReasoning: SupportedReasoningEffort =
- requestedComposerReasoning &&
- isSupportedReasoningEffort(
- composerAdapter,
- composerModel,
- requestedComposerReasoning,
- )
- ? requestedComposerReasoning
- : DEFAULT_REASONING_EFFORT;
- const composerContextWindow: ContextWindow =
- (composerConfigMatchesAdapter
- ? composerConfig?.contextWindow
- : undefined) ?? DEFAULT_CONTEXT_WINDOW;
- const composerFastMode: boolean =
- (composerConfigMatchesAdapter ? composerConfig?.fastMode : undefined) ??
- false;
-
- const messagingMode = useMessagingMode(taskId);
- const queuedCount = useQueuedCount(taskId);
- const editingQueuedId = useMessageQueueStore((s) =>
- taskId ? s.editingByTaskId[taskId] : undefined,
- );
- const toggleMessagingMode = useToggleMessagingMode(taskId);
- const analytics = useAnalytics();
-
- const { height } = useReanimatedKeyboardAnimation();
-
- // useReanimatedKeyboardAnimation returns negative height values
- // e.g., -300 when keyboard is open, 0 when closed
- const contentPosition = useAnimatedStyle(() => {
- return {
- transform: [{ translateY: height.value }],
- };
- }, []);
-
- const inputContainerStyle = useAnimatedStyle(() => {
- // contentPosition already translates the whole content up by the keyboard
- // height, so the composer sits at the keyboard top — no extra gap needed
- // when open. Closed state keeps a comfortable bottom inset.
- return {
- marginBottom: height.value < 0 ? 0 : composerBottomValue,
- };
- }, [composerBottomValue]);
-
- useEffect(() => {
- if (!taskId) return;
- const prompt = getFirstParam(initialPrompt)?.trim();
- if (prompt) setPendingPrompt(taskId, prompt);
- }, [taskId, initialPrompt, setPendingPrompt]);
-
- useEffect(() => {
- if (!taskId || !pendingPrompt) return;
- const prompt = consumePendingPrompt(taskId);
- if (prompt) setInitialComposerMessage(prompt);
- }, [taskId, pendingPrompt, consumePendingPrompt]);
-
- useEffect(() => {
- if (!taskId) return;
-
- let cancelled = false;
- setLoading(true);
- setError(null);
-
- getPostHogApiClient()
- .getTask(taskId)
- .then((fetchedTask) => {
- if (cancelled) return;
- setTask(fetchedTask);
- return connectToTask(fetchedTask);
- })
- .catch((err) => {
- if (cancelled) return;
- log.error("Failed to load task", err);
- setError("Failed to load task");
- })
- .finally(() => {
- if (cancelled) return;
- setLoading(false);
- });
-
- return () => {
- cancelled = true;
- disconnectFromTask(taskId);
- };
- }, [taskId, connectToTask, disconnectFromTask]);
-
- // Auto-reconnect if the session disappears while the screen is active
- // (e.g., cloud sandbox expired and the session was cleaned up).
- // Re-fetches the task to get a fresh S3 presigned URL.
- useEffect(() => {
- if (!taskId || !task || loading) return;
- if (session) return;
- if (retrying) return;
-
- let cancelled = false;
- getPostHogApiClient()
- .getTask(taskId)
- .then((freshTask) => {
- if (cancelled) return;
- setTask(freshTask);
- return connectToTask(freshTask);
- })
- .catch((err) => {
- if (cancelled) return;
- log.error("Failed to reconnect to task", err);
- });
-
- return () => {
- cancelled = true;
- };
- }, [taskId, task, loading, session, connectToTask, retrying]);
-
- const updateTaskInCache = useCallback(
- (updated: Task) => {
- // Directly patch the task in all list query caches so the task list
- // reflects the change immediately (e.g., environment: local → cloud).
- queryClient.setQueriesData<Task[]>(
- { queryKey: taskKeys.lists() },
- (old) => old?.map((t) => (t.id === updated.id ? updated : t)),
- );
- },
- [queryClient],
- );
-
- // Resume a terminal (completed/failed) run with a new user prompt. Mirrors
- // the desktop "send on a finished task continues the conversation" UX —
- // creates a fresh run that resumes from the previous one and queues the
- // message as pending_user_message.
- const handleSendAfterTerminal = useCallback(
- async (
- text: string,
- attachments: PendingAttachment[],
- ): Promise<boolean> => {
- if (!taskId || !task) return false;
- // Optimistically echo into the chat before tearing down the old session
- // and waiting for the resume run's SSE stream to come up.
- const echoAttachments = attachments.map((a) => ({
- kind: a.kind,
- uri: a.uri,
- fileName: a.fileName,
- mimeType: a.mimeType,
- }));
- pendingTaskPromptStoreApi.set(taskId, {
- promptText: text,
- attachments: echoAttachments.length > 0 ? echoAttachments : undefined,
- setAt: Date.now(),
- });
- try {
- setRetrying(true);
- disconnectFromTask(taskId);
-
- const pendingUserMessage =
- attachments.length > 0
- ? serializeCloudPrompt(
- await buildCloudPromptBlocks(text, attachments),
- )
- : text;
-
- const updatedTask = await getPostHogApiClient().runTaskInCloud(
- taskId,
- undefined,
- {
- resumeFromRunId: task.latest_run?.id,
- pendingUserMessage,
- ...buildCloudTaskRunConfig({
- adapter: composerAdapter,
- mode: composerMode,
- model: composerModel,
- reasoning: composerReasoning,
- contextWindow: composerContextWindow,
- fastMode: composerFastMode,
- }),
- rtkEnabled: usePreferencesStore.getState().rtkEnabledCloud,
- },
- );
- setTask(updatedTask);
- await connectToTask(updatedTask);
- updateTaskInCache(updatedTask);
- return true;
- } catch (err) {
- log.error("Failed to send after terminal", err);
- pendingTaskPromptStoreApi.clear(taskId);
- setRetrying(false);
- Alert.alert(
- "Failed to send",
- "Could not continue this task. Please try again.",
- );
- return false;
- }
- },
- [
- taskId,
- task,
- disconnectFromTask,
- connectToTask,
- updateTaskInCache,
- composerMode,
- composerAdapter,
- composerModel,
- composerReasoning,
- composerContextWindow,
- composerFastMode,
- ],
- );
-
- const trackPromptSent = useCallback(
- (text: string, isSteer: boolean) => {
- if (!taskId) return;
- analytics.track(ANALYTICS_EVENTS.PROMPT_SENT, {
- task_id: taskId,
- is_initial: false,
- execution_type: "cloud",
- prompt_length_chars: text.length,
- is_steer: isSteer,
- });
- },
- [taskId, analytics],
- );
-
- const handleSendPrompt = useCallback(
- async (
- text: string,
- attachments: PendingAttachment[],
- ): Promise<boolean> => {
- if (!taskId) return false;
- Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
-
- // Saving an in-place edit: overwrite the queued message and release the
- // drain hold. If the turn already ended while editing, flush now — the
- // turn-end drain won't fire again on its own.
- const queue = useMessageQueueStore.getState();
- const editingId = queue.editingByTaskId[taskId];
- if (editingId) {
- queue.update(taskId, editingId, { content: text, attachments });
- queue.clearEditing(taskId);
- flushQueuedMessagesIfIdle(taskId);
- return true;
- }
-
- if (session?.terminalStatus) {
- return handleSendAfterTerminal(text, attachments);
- }
-
- // A turn is running. Queue holds the message locally until it ends;
- // Steer interrupts the turn and resends right away.
- const isSteer = !!session?.isPromptPending;
- if (isSteer && messagingMode === "queue") {
- useMessageQueueStore.getState().enqueue(taskId, text, attachments);
- return true;
- }
-
- try {
- if (isSteer) {
- await sendInterrupting(taskId, text, attachments);
- } else {
- await sendPrompt(taskId, text, attachments);
- }
- trackPromptSent(text, isSteer);
- return true;
- } catch (err) {
- log.error("Failed to send prompt", err);
- Alert.alert(
- "Failed to send",
- "Your message could not be delivered. Please try again.",
- );
- return false;
- }
- },
- [
- taskId,
- sendPrompt,
- sendInterrupting,
- session?.terminalStatus,
- session?.isPromptPending,
- messagingMode,
- handleSendAfterTerminal,
- trackPromptSent,
- flushQueuedMessagesIfIdle,
- ],
- );
-
- const [restoredDraft, setRestoredDraft] = useState<{
- text: string;
- attachments: PendingAttachment[];
- }>();
-
- const handleSteerQueued = useCallback(
- (message: QueuedMessage) => {
- if (!taskId) return;
- steerQueuedMessage(taskId, message.id)
- .then(() => trackPromptSent(message.content, true))
- .catch((err) => {
- log.error("Failed to steer queued message", err);
- Alert.alert(
- "Couldn't steer",
- "This message is still queued. Please try again.",
- );
- });
- },
- [taskId, steerQueuedMessage, trackPromptSent],
- );
-
- // Pull a queued message into the composer for an in-place edit. It stays in
- // the queue at its position (marked as the edit target); the next send saves
- // it back rather than sending a new prompt.
- const handleEditQueued = useCallback(
- (message: QueuedMessage) => {
- if (!taskId) return;
- useMessageQueueStore.getState().setEditing(taskId, message.id);
- setRestoredDraft({
- text: message.content,
- attachments: message.attachments,
- });
- },
- [taskId],
- );
-
- const handleCancelEdit = useCallback(() => {
- if (!taskId) return;
- useMessageQueueStore.getState().clearEditing(taskId);
- setRestoredDraft({ text: "", attachments: [] });
- flushQueuedMessagesIfIdle(taskId);
- }, [taskId, flushQueuedMessagesIfIdle]);
-
- const handleMoveQueued = useCallback(
- (message: QueuedMessage, direction: MoveDirection) => {
- if (!taskId) return;
- Haptics.selectionAsync();
- useMessageQueueStore.getState().move(taskId, message.id, direction);
- },
- [taskId],
- );
-
- const handleDiscardQueued = useCallback(
- (message: QueuedMessage) => {
- if (!taskId) return;
- const wasEditing =
- useMessageQueueStore.getState().editingByTaskId[taskId] === message.id;
- useMessageQueueStore.getState().remove(taskId, message.id);
- if (wasEditing) setRestoredDraft({ text: "", attachments: [] });
- },
- [taskId],
- );
-
- const handleModeChange = useCallback(
- (value: ExecutionMode) => {
- if (!taskId) return;
- setComposerConfig(taskId, { mode: value });
- // Push to the live cloud session so the next turn uses the new mode.
- // Silently ignore failures — value is already persisted locally and
- // will be replayed if the user resumes from a terminal state.
- setConfigOption(taskId, "mode", value).catch(() => {});
- },
- [taskId, setComposerConfig, setConfigOption],
- );
-
- const handleAdapterChange = useCallback(
- (selection: CloudComposerSelection) => {
- if (!taskId) return;
- setComposerConfig(taskId, {
- ...selection,
- contextWindow: DEFAULT_CONTEXT_WINDOW,
- fastMode: false,
- });
- usePreferencesStore
- .getState()
- .resetLastUsedAgentConfig(selection.mode, selection.reasoning);
- },
- [taskId, setComposerConfig],
- );
-
- const handleModelChange = useCallback(
- (value: string) => {
- if (!taskId) return;
- setComposerConfig(taskId, { model: value });
- setConfigOption(taskId, "model", value).catch(() => {});
- },
- [taskId, setComposerConfig, setConfigOption],
- );
-
- const handleReasoningChange = useCallback(
- (value: SupportedReasoningEffort) => {
- if (!taskId) return;
- setComposerConfig(taskId, { reasoning: value });
- setConfigOption(
- taskId,
- getCloudReasoningConfigOptionId(composerAdapter),
- value,
- ).catch(() => {});
- usePreferencesStore.getState().setLastUsedReasoningEffort(value);
- },
- [taskId, composerAdapter, setComposerConfig, setConfigOption],
- );
-
- const handleContextWindowChange = useCallback(
- (value: ContextWindow) => {
- if (!taskId) return;
- setComposerConfig(taskId, { contextWindow: value });
- usePreferencesStore.getState().setLastUsedContextWindow(value);
- },
- [taskId, setComposerConfig],
- );
-
- const handleFastModeChange = useCallback(
- (value: boolean) => {
- if (!taskId) return;
- setComposerConfig(taskId, { fastMode: value });
- usePreferencesStore.getState().setLastUsedFastMode(value);
- },
- [taskId, setComposerConfig],
- );
-
- const handleStop = useCallback(() => {
- if (!taskId) return;
- // cancelPrompt returns false on failure — no need to alert,
- // the agent may have already finished or the sandbox expired.
- cancelPrompt(taskId).catch(() => {});
- }, [taskId, cancelPrompt]);
-
- const handleStopRun = useCallback(() => {
- if (!taskId) return;
- confirmStopRun(() => {
- const promptsSent = countUserMessages(getSessionForTask(taskId)?.events);
- stopRun(taskId)
- .then((ok) => {
- if (ok) {
- analytics.track(ANALYTICS_EVENTS.TASK_RUN_STOPPED, {
- task_id: taskId,
- execution_type: "cloud",
- prompts_sent: promptsSent,
- });
- } else {
- Alert.alert(
- "Couldn't stop",
- "The run could not be stopped. Please try again.",
- );
- }
- })
- .catch(() => {});
- });
- }, [taskId, stopRun, analytics, getSessionForTask]);
-
- const canStopRun =
- !!task &&
- !!session &&
- !session.terminalStatus &&
- !session.stopRequested &&
- task.latest_run?.environment !== "local" &&
- isTaskRunning(task);
-
- const handleRetry = useCallback(async () => {
- if (!taskId || !task) return;
- try {
- setRetrying(true);
- disconnectFromTask(taskId);
-
- const updatedTask = await getPostHogApiClient().runTaskInCloud(
- taskId,
- undefined,
- {
- resumeFromRunId: task.latest_run?.id,
- ...buildCloudTaskRunConfig({
- adapter: composerAdapter,
- mode: composerMode,
- model: composerModel,
- reasoning: composerReasoning,
- contextWindow: composerContextWindow,
- fastMode: composerFastMode,
- }),
- rtkEnabled: usePreferencesStore.getState().rtkEnabledCloud,
- },
- );
- setTask(updatedTask);
- await connectToTask(updatedTask);
- updateTaskInCache(updatedTask);
- // Don't clear retrying here — the effect below clears it
- // once the session shows meaningful state (thinking or terminal).
- } catch (err) {
- log.error("Failed to retry task", err);
- setRetrying(false);
- Alert.alert(
- "Retry failed",
- "Could not restart the task. Please try again.",
- );
- }
- }, [
- taskId,
- task,
- disconnectFromTask,
- connectToTask,
- updateTaskInCache,
- composerAdapter,
- composerModel,
- composerReasoning,
- composerMode,
- composerContextWindow,
- composerFastMode,
- ]);
-
- // Clear retrying once the agent finishes a turn or the run terminates.
- useEffect(() => {
- if (!retrying || !session) return;
- if (!session.isPromptPending || session.terminalStatus) {
- setRetrying(false);
- }
- }, [retrying, session]);
-
- const handleSendPermissionResponse = useCallback(
- (args: Parameters<typeof sendPermissionResponse>[1]) => {
- if (!taskId) return;
- sendPermissionResponse(taskId, args).catch((err) => {
- log.error("Failed to send permission response", err);
- Alert.alert(
- "Failed to respond",
- "Your permission response could not be sent. Please try again.",
- );
- });
- },
- [taskId, sendPermissionResponse],
- );
-
- const handleOpenTask = useCallback(
- (newTaskId: string) => {
- router.replace(`/task/${newTaskId}`);
- },
- [router],
- );
-
- // Only the owner may hand a task off, matching the desktop menu gate.
- const canHandoff =
- !!task && currentUser != null && task.created_by?.id === currentUser.id;
-
- const prUrl = readPrUrls(task?.latest_run?.output)[0];
-
- const isHistoryLoading =
- !!task?.latest_run &&
- !!session &&
- session.status === "connecting" &&
- session.events.length === 0;
- const activityPhase = getSessionActivityPhase({
- retrying: retrying || isHistoryLoading,
- session,
- });
- const isConnecting = activityPhase === "connecting";
- const isThinking = activityPhase === "working";
- const showLoading = !task && loading && !optimisticPrompt;
-
- // Haptic pulse when connecting/thinking indicators dismiss
- const prevWaiting = useRef(false);
- useEffect(() => {
- const waiting = isConnecting || isThinking;
- if (prevWaiting.current && !waiting) {
- Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
- }
- prevWaiting.current = waiting;
- }, [isConnecting, isThinking]);
-
- if (error || (!task && !loading)) {
- return (
- <View className="flex-1 items-center justify-center bg-background px-4">
- <FloatingBackButton />
- <Text className="mb-4 text-center text-status-error">
- {error || "Task not found"}
- </Text>
- <Pressable
- onPress={() => router.back()}
- className="rounded-lg bg-gray-3 px-4 py-2"
- >
- <Text className="text-gray-12">Go back</Text>
- </Pressable>
- </View>
- );
- }
-
- return (
- <View className="flex-1 bg-background">
- <FloatingTaskHeader
- title={showLoading ? "Loading..." : task?.title || "Task"}
- subtitle={task?.repository ?? undefined}
- rightSlot={
- <>
- {task ? <CustomImageBadge task={task} /> : null}
- {canHandoff ? (
- <Pressable
- onPress={() => setHandoffOpen(true)}
- hitSlop={8}
- className="h-9 w-9 items-center justify-center rounded-full active:bg-gray-3"
- accessibilityRole="button"
- accessibilityLabel="Hand off task"
- >
- <UserSwitch size={20} color={themeColors.gray[12]} />
- </Pressable>
- ) : null}
- {canStopRun ? (
- <StopRunButton onPress={handleStopRun} />
- ) : prUrl ? (
- <>
- <PrDiffStatsBadge prUrl={prUrl} />
- <PrStatusBadge prUrl={prUrl} />
- </>
- ) : null}
- </>
- }
- />
- <Animated.View className="flex-1" style={contentPosition}>
- {/* Always render TaskSessionView so the FlatList can layout behind
- the loading overlay. This prevents the "flash of messages" when
- switching from loading spinner to rendered content. The FlatList
- takes the available space above the composer (flex-1), so we
- don't need to reserve composer height as paddingTop — only the
- top header's space (paddingBottom in an inverted list) plus a
- small visual buffer at the bottom. */}
- <TaskSessionView
- events={session?.events ?? []}
- taskId={taskId}
- runId={task?.latest_run?.id}
- pendingPermissions={session?.pendingPermissions}
- isConnecting={isConnecting}
- isThinking={isThinking}
- terminalStatus={retrying ? undefined : session?.terminalStatus}
- lastError={retrying ? undefined : session?.lastError}
- onRetry={
- !retrying && session?.terminalStatus ? handleRetry : undefined
- }
- onOpenTask={handleOpenTask}
- onSendPermissionResponse={handleSendPermissionResponse}
- optimisticUserMessage={
- optimisticPrompt
- ? {
- text: optimisticPrompt.promptText,
- attachments: optimisticPrompt.attachments,
- setAt: optimisticPrompt.setAt,
- }
- : undefined
- }
- contentContainerStyle={{
- paddingTop: 8,
- paddingBottom: (Platform.OS === "ios" ? 6 : insets.top) + 60,
- }}
- />
-
- {showLoading && (
- <View className="absolute inset-0 items-center justify-center bg-background">
- <ActivityIndicator size="large" color={themeColors.accent[9]} />
- <Text className="mt-4 text-gray-11">Loading task...</Text>
- </View>
- )}
-
- {/* Composer below the list in flex flow — its real height
- determines how much vertical space the list above gets, so the
- last message can never sit behind the input. Stays visible on
- terminal runs so the user can send a follow-up that resumes. */}
- <Animated.View style={inputContainerStyle}>
- {taskId ? (
- <QueuedMessagesDock
- taskId={taskId}
- canSteer={
- !!session?.isPromptPending &&
- !session?.isCompacting &&
- !session?.terminalStatus
- }
- onSteer={handleSteerQueued}
- onEdit={handleEditQueued}
- onDiscard={handleDiscardQueued}
- onMove={handleMoveQueued}
- />
- ) : null}
- <TaskChatComposer
- key={taskId}
- adapter={composerAdapter}
- canChangeAdapter={!!session?.terminalStatus}
- onSend={handleSendPrompt}
- restoredDraft={restoredDraft}
- editing={!!editingQueuedId}
- onCancelEdit={handleCancelEdit}
- onStop={handleStop}
- isUserTurn={!(session?.isPromptPending ?? true)}
- placeholder={
- session?.terminalStatus ? "Resume this task..." : "Ask a question"
- }
- initialMessage={initialComposerMessage}
- mode={composerMode}
- model={composerModel}
- reasoning={composerReasoning}
- contextWindow={composerContextWindow}
- fastMode={composerFastMode}
- onAdapterChange={handleAdapterChange}
- onModeChange={handleModeChange}
- onModelChange={handleModelChange}
- onReasoningChange={handleReasoningChange}
- onContextWindowChange={handleContextWindowChange}
- onFastModeChange={handleFastModeChange}
- messagingMode={messagingMode}
- queuedCount={queuedCount}
- onToggleMessagingMode={toggleMessagingMode}
- artifactsSlot={
- <TaskArtifacts
- taskId={taskId}
- runId={task?.latest_run?.id}
- enabled={!retrying && !!session?.terminalStatus}
- />
- }
- />
- </Animated.View>
- </Animated.View>
- {task ? (
- <HandoffTaskSheet
- visible={handoffOpen}
- task={task}
- onClose={() => setHandoffOpen(false)}
- onHandedOff={() => {
- setHandoffOpen(false);
- if (router.canGoBack()) router.back();
- }}
- />
- ) : null}
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/app/task/index.tsx b/products/desktop/apps/mobile/src/app/task/index.tsx
deleted file mode 100644
index 1b77af83a1ab..000000000000
--- a/products/desktop/apps/mobile/src/app/task/index.tsx
+++ /dev/null
@@ -1,815 +0,0 @@
-import { Text } from "@components/text";
-import {
- DEFAULT_CLAUDE_EXECUTION_MODE,
- getAvailableModesForAdapter,
-} from "@posthog/core/sessions/executionModes";
-import { resolveCloudComposerModelChange } from "@posthog/core/task-detail/composerModelPolicy";
-import {
- type Adapter,
- DEFAULT_GATEWAY_MODEL,
- DEFAULT_REASONING_EFFORT,
- type ExecutionMode,
- getReasoningEffortOptions,
- isSupportedReasoningEffort,
- type SupportedReasoningEffort,
- serializeCloudPrompt,
- supports1MContext,
- supportsFastMode,
-} from "@posthog/shared";
-import { LinearGradient } from "expo-linear-gradient";
-import { Stack, useLocalSearchParams, useRouter } from "expo-router";
-import {
- ArrowUp,
- CaretDown,
- GithubLogo,
- MicrophoneIcon,
- PaperclipIcon,
- StopIcon,
-} from "phosphor-react-native";
-import { useCallback, useEffect, useRef, useState } from "react";
-import {
- ActivityIndicator,
- Alert,
- Pressable,
- ScrollView,
- TextInput,
- View,
-} from "react-native";
-import {
- useKeyboardHandler,
- useReanimatedKeyboardAnimation,
-} from "react-native-keyboard-controller";
-import Animated, { runOnJS, useAnimatedStyle } from "react-native-reanimated";
-import { useVoiceRecording } from "@/features/chat";
-import { usePreferencesStore } from "@/features/preferences/stores/preferencesStore";
-import { GitHubConnectionPrompt } from "@/features/tasks/components/GitHubConnectionPrompt";
-import { GitHubLoadNotice } from "@/features/tasks/components/GitHubLoadNotice";
-import { AgentConfigControls } from "@/features/tasks/composer/AgentConfigControls";
-import { AttachmentSheet } from "@/features/tasks/composer/attachments/AttachmentSheet";
-import { AttachmentsBar } from "@/features/tasks/composer/attachments/AttachmentsBar";
-import { buildCloudPromptBlocks } from "@/features/tasks/composer/attachments/buildCloudPrompt";
-import {
- captureFromCamera,
- pickDocument,
- pickPhotoFromLibrary,
-} from "@/features/tasks/composer/attachments/pickers";
-import type { PendingAttachment } from "@/features/tasks/composer/attachments/types";
-import { DotBackground } from "@/features/tasks/composer/DotBackground";
-import {
- type ContextWindow,
- DEFAULT_CONTEXT_WINDOW,
- getMobileExecutionModes,
- getModelConfigOption,
-} from "@/features/tasks/composer/options";
-import { RepositoryPickerInline } from "@/features/tasks/composer/RepositoryPickerInline";
-import { useCloudTaskConfigOptions } from "@/features/tasks/hooks/useCloudTaskConfigOptions";
-import { useUserIntegrations } from "@/features/tasks/hooks/useUserIntegrations";
-import { useWarmTask } from "@/features/tasks/hooks/useWarmTask";
-import { pendingPromptRecoveryStoreApi } from "@/features/tasks/stores/pendingPromptRecoveryStore";
-import {
- generatePendingTaskKey,
- pendingTaskPromptStoreApi,
-} from "@/features/tasks/stores/pendingTaskPromptStore";
-import { useTaskStore } from "@/features/tasks/stores/taskStore";
-import type { RepositorySelection } from "@/features/tasks/types";
-import { buildCloudTaskRunConfig } from "@/features/tasks/utils/cloudTaskRunConfig";
-import {
- findRepositoryOption,
- isRepositorySelectionComplete,
- toRepositorySelection,
-} from "@/features/tasks/utils/repositorySelection";
-import { useScreenInsets } from "@/hooks/useScreenInsets";
-import { logger } from "@/lib/logger";
-import { getPostHogApiClient } from "@/lib/posthogApiClient";
-import { toRgba, useThemeColors } from "@/lib/theme";
-
-const log = logger.scope("task-create");
-const SUGGESTIONS = [
- "Create or update my CLAUDE.md file",
- "Search for a TODO comment and fix it",
- "Recommend areas to improve our tests",
-] as const;
-
-export default function NewTaskScreen() {
- const {
- prompt: initialPrompt,
- repo: initialRepo,
- signalReport,
- signalReportRelationship,
- signalReportDiscussionQuestion,
- } = useLocalSearchParams<{
- prompt?: string;
- repo?: string;
- signalReport?: string;
- signalReportRelationship?: string;
- signalReportDiscussionQuestion?: string;
- }>();
- const router = useRouter();
- const themeColors = useThemeColors();
- const { insets, bottom } = useScreenInsets();
- const keyboard = useReanimatedKeyboardAnimation();
- const restingBottom = bottom("compact");
- const [adapter, setAdapter] = useState<Adapter>("claude");
- const [model, setModel] = useState<string>(DEFAULT_GATEWAY_MODEL);
- const { configOptions, modelGroups, hasLiveConfig, isConfigReady } =
- useCloudTaskConfigOptions(adapter, model);
- const modelConfigOption = getModelConfigOption(configOptions);
- const {
- error,
- hasGithubIntegration,
- repositoryOptions,
- repositoryWarning,
- isLoading,
- isRefreshingInBackground,
- refetch,
- getUserIntegrationId,
- } = useUserIntegrations({ enabled: !signalReport });
-
- const containerStyle = useAnimatedStyle(() => {
- const kbHeight = -keyboard.height.value;
- const progress = keyboard.progress.value;
- return {
- paddingBottom: kbHeight + restingBottom * (1 - progress),
- };
- });
-
- const suggestionsStyle = useAnimatedStyle(() => ({
- opacity: 1 - keyboard.progress.value,
- }));
-
- const [keyboardActive, setKeyboardActive] = useState(false);
- useKeyboardHandler(
- {
- onStart: (event) => {
- "worklet";
- runOnJS(setKeyboardActive)(event.height > 0);
- },
- },
- [],
- );
-
- // Default the repo to the URL param (deep-link from a signal report etc.),
- // falling back to the most recently used repo so the user doesn't have to
- // re-pick the same one for every new task.
- const lastRepository = useTaskStore((s) => s.lastRepository);
- const setLastRepository = useTaskStore((s) => s.setLastRepository);
- const setComposerConfig = useTaskStore((s) => s.setComposerConfig);
- const [prompt, setPrompt] = useState(initialPrompt ?? "");
- const [selection, setSelectionState] = useState<RepositorySelection>(() => {
- if (initialRepo) {
- const match = repositoryOptions.find(
- (o) => o.repository.toLowerCase() === initialRepo.toLowerCase(),
- );
- if (match) return toRepositorySelection(match);
- // Repo known but integration not yet loaded — set repo, integrationId will resolve later
- return { integrationId: null, repository: initialRepo };
- }
- return lastRepository;
- });
- const setSelection = useCallback(
- (next: RepositorySelection) => {
- setSelectionState(next);
- setLastRepository(next);
- },
- [setLastRepository],
- );
- const [mode, setMode] = useState<ExecutionMode>(() => {
- if (signalReport && signalReportRelationship === "discussion")
- return "auto";
- const prefs = usePreferencesStore.getState();
- if (prefs.defaultInitialTaskMode === "last_used") {
- const last = prefs.lastNewTaskMode;
- const isValidMode = getMobileExecutionModes(
- getAvailableModesForAdapter("claude"),
- ).some((mode) => mode.id === last);
- if (isValidMode) return last as ExecutionMode;
- }
- return DEFAULT_CLAUDE_EXECUTION_MODE;
- });
- const [reasoning, setReasoning] = useState<SupportedReasoningEffort>(() => {
- const prefs = usePreferencesStore.getState();
- const desired =
- prefs.defaultReasoningEffort === "last_used"
- ? prefs.lastUsedReasoningEffort
- : prefs.defaultReasoningEffort;
- return isSupportedReasoningEffort("claude", DEFAULT_GATEWAY_MODEL, desired)
- ? desired
- : DEFAULT_REASONING_EFFORT;
- });
- const [contextWindow, setContextWindow] = useState<ContextWindow>(
- () => usePreferencesStore.getState().lastUsedContextWindow,
- );
- const [fastMode, setFastMode] = useState<boolean>(
- () => usePreferencesStore.getState().lastUsedFastMode,
- );
-
- useEffect(() => {
- if (!hasLiveConfig) return;
- const next = resolveCloudComposerModelChange({
- adapter,
- modelOption: modelConfigOption,
- requestedModel: model,
- reasoning,
- });
- if (next.model !== model) setModel(next.model);
- if (next.reasoning !== reasoning) setReasoning(next.reasoning);
- }, [adapter, hasLiveConfig, model, modelConfigOption, reasoning]);
- const [creating, setCreating] = useState(false);
- const creatingRef = useRef(false);
- const reportTaskRef = useRef<{
- reportId: string;
- relationship: string;
- id: string;
- } | null>(null);
- const [repoSheetOpen, setRepoSheetOpen] = useState(false);
- const [attachments, setAttachments] = useState<PendingAttachment[]>([]);
- const [attachmentSheetOpen, setAttachmentSheetOpen] = useState(false);
-
- const appendTranscript = useCallback((transcript: string) => {
- setPrompt((prev) => (prev ? `${prev} ${transcript}` : transcript));
- }, []);
-
- const {
- status: voiceStatus,
- startRecording,
- stopRecording,
- cancelRecording,
- } = useVoiceRecording({ onTranscript: appendTranscript });
- const isRecording = voiceStatus === "recording";
- const isTranscribing = voiceStatus === "transcribing";
-
- const handleMicPress = useCallback(async () => {
- if (isRecording) {
- await stopRecording();
- } else if (!isTranscribing) {
- await startRecording();
- }
- }, [isRecording, isTranscribing, startRecording, stopRecording]);
-
- const handleMicLongPress = useCallback(async () => {
- if (isRecording) {
- await cancelRecording();
- }
- }, [isRecording, cancelRecording]);
-
- const addAttachment = useCallback(
- async (picker: () => Promise<PendingAttachment | null>) => {
- try {
- const att = await picker();
- if (att) setAttachments((prev) => [...prev, att]);
- } catch (err) {
- log.error("Failed to pick attachment", err);
- }
- },
- [],
- );
-
- const removeAttachment = useCallback((id: string) => {
- setAttachments((prev) => prev.filter((a) => a.id !== id));
- }, []);
-
- const selectedRepositoryOption = findRepositoryOption(
- repositoryOptions,
- selection,
- );
- const repositoryLabel = selectedRepositoryOption
- ? repositoryOptions.filter(
- (option) => option.repository === selectedRepositoryOption.repository,
- ).length > 1
- ? `${selectedRepositoryOption.repository} · ${selectedRepositoryOption.integrationLabel}`
- : selectedRepositoryOption.repository
- : "Select repository…";
- const repositoryLoadBlocked =
- !!repositoryWarning && repositoryOptions.length === 0;
- const repositoryReady =
- !!signalReport || isRepositorySelectionComplete(selection);
-
- const handleCreateTask = useCallback(async () => {
- const hasContent = !!prompt.trim() || attachments.length > 0;
- if (
- !hasContent ||
- !repositoryReady ||
- !isConfigReady ||
- creatingRef.current
- ) {
- return;
- }
-
- creatingRef.current = true;
- setCreating(true);
-
- // Echo the prompt into the chat thread the moment the user taps send.
- // The key is transient until `createTask` returns the real task id, at
- // which point we `move` it so the detail screen can pick it up.
- const pendingKey = generatePendingTaskKey();
- const trimmedPrompt = prompt.trim();
- const echoAttachments = attachments.map((a) => ({
- kind: a.kind,
- uri: a.uri,
- fileName: a.fileName,
- mimeType: a.mimeType,
- }));
- pendingTaskPromptStoreApi.set(pendingKey, {
- promptText: trimmedPrompt,
- attachments: echoAttachments.length > 0 ? echoAttachments : undefined,
- setAt: Date.now(),
- });
-
- // Durably record the prompt so it survives the app being killed. Cleared
- // once the task exists; kept on failure so the next launch can restore
- // the draft into the composer.
- if (trimmedPrompt) {
- pendingPromptRecoveryStoreApi.set(pendingKey, trimmedPrompt);
- }
-
- // Tracks where the optimistic echo currently lives so the catch block
- // can clear the correct key regardless of how far the flow got.
- let currentPendingKey = pendingKey;
-
- try {
- // The task description is plain text (it shows up as the task title and
- // in metadata). Attachments only enter the agent prompt via the cloud
- // payload below.
- const descriptionText =
- trimmedPrompt ||
- (attachments.length === 1
- ? `Attached: ${attachments[0].fileName}`
- : `Attached ${attachments.length} files`);
-
- const client = getPostHogApiClient();
- const taskOptions = {
- description: descriptionText,
- title: descriptionText.slice(0, 100),
- };
- const relationship =
- signalReportRelationship === "discussion"
- ? "discussion"
- : "implementation";
- const existingReportTask = reportTaskRef.current;
- const task = signalReport
- ? existingReportTask?.reportId === signalReport &&
- existingReportTask.relationship === relationship
- ? existingReportTask
- : await client.createSignalReportTask({
- ...taskOptions,
- reportId: signalReport,
- relationship,
- question: signalReportDiscussionQuestion,
- })
- : await client.createTask({
- ...taskOptions,
- repository: selection.repository ?? undefined,
- github_user_integration: getUserIntegrationId(
- selection.integrationId,
- ),
- });
-
- if (signalReport) {
- reportTaskRef.current = {
- reportId: signalReport,
- relationship,
- id: task.id,
- };
- }
-
- pendingTaskPromptStoreApi.move(pendingKey, task.id);
- currentPendingKey = task.id;
- pendingPromptRecoveryStoreApi.clear(pendingKey);
-
- // Seed the per-task composer config with the mode/model/reasoning the
- // user picked here, so the task detail screen reflects them and every
- // subsequent run (resume-after-terminal) reuses the selected mode rather
- // than falling back to the default plan mode.
- setComposerConfig(task.id, {
- adapter,
- mode,
- model,
- reasoning,
- contextWindow,
- fastMode,
- });
-
- const pendingUserMessage =
- attachments.length > 0
- ? serializeCloudPrompt(
- await buildCloudPromptBlocks(trimmedPrompt, attachments),
- )
- : trimmedPrompt;
-
- await client.runTaskInCloud(task.id, undefined, {
- pendingUserMessage,
- ...buildCloudTaskRunConfig({
- adapter,
- mode,
- model,
- reasoning,
- contextWindow,
- fastMode,
- }),
- autoPublish: usePreferencesStore.getState().autoPublishCloudRuns,
- rtkEnabled: usePreferencesStore.getState().rtkEnabledCloud,
- ...(signalReport
- ? {
- runSource: "signal_report" as const,
- signalReportId: signalReport,
- }
- : {}),
- });
-
- router.replace(`/task/${task.id}`);
- } catch (creationError) {
- log.error("Failed to create task", creationError);
- pendingTaskPromptStoreApi.clear(currentPendingKey);
- Alert.alert(
- "Could not start task",
- creationError instanceof Error
- ? creationError.message
- : "Check your connection and open the task list to check whether the task was created.",
- );
- } finally {
- creatingRef.current = false;
- setCreating(false);
- }
- }, [
- attachments,
- adapter,
- mode,
- model,
- prompt,
- reasoning,
- contextWindow,
- fastMode,
- router,
- selection,
- signalReport,
- signalReportRelationship,
- signalReportDiscussionQuestion,
- repositoryReady,
- isConfigReady,
- getUserIntegrationId,
- setComposerConfig,
- ]);
-
- const hasContent = !!prompt.trim() || attachments.length > 0;
- const canSubmit = isConfigReady && hasContent && repositoryReady && !creating;
- const reasoningOptions = getReasoningEffortOptions(adapter, model) ?? [];
- const showReasoningPill = reasoningOptions.length > 0;
-
- // Best-effort prewarm; failures are swallowed. `selection.integrationId` is
- // the GitHub installation id, not a PostHog integration id — the backend
- // resolves the integration from the repository, so this only keys the warm.
- useWarmTask({
- repository: signalReport ? null : selection.repository,
- githubIntegrationId: signalReport ? null : selection.integrationId,
- composerIsEmpty: !hasContent || !isConfigReady,
- runtimeAdapter: adapter,
- model,
- reasoningEffort: showReasoningPill ? reasoning : null,
- permissionMode: mode,
- contextWindow: supports1MContext(model) ? contextWindow : null,
- fastMode: supportsFastMode(model) ? fastMode : null,
- });
-
- if (isLoading && hasGithubIntegration === null) {
- return (
- <>
- <Stack.Screen
- options={{
- headerShown: true,
- headerTitle: "New task",
- headerStyle: { backgroundColor: themeColors.background },
- headerTintColor: themeColors.gray[12],
- presentation: "modal",
- }}
- />
- <View className="flex-1 items-center justify-center bg-background">
- <ActivityIndicator size="large" color={themeColors.accent[9]} />
- <Text className="mt-4 text-gray-11">Loading repositories...</Text>
- </View>
- </>
- );
- }
-
- if (error || repositoryLoadBlocked) {
- return (
- <>
- <Stack.Screen
- options={{
- headerShown: true,
- headerTitle: "New task",
- headerStyle: { backgroundColor: themeColors.background },
- headerTintColor: themeColors.gray[12],
- presentation: "modal",
- }}
- />
- <View className="flex-1 justify-center bg-background px-4">
- <GitHubLoadNotice
- message={
- error ??
- repositoryWarning ??
- "Could not load GitHub repositories."
- }
- onRetry={refetch}
- />
- </View>
- </>
- );
- }
-
- if (hasGithubIntegration === false) {
- return (
- <View className="flex-1 bg-background">
- <View style={{ paddingTop: insets.top + 56 }} className="flex-1">
- <GitHubConnectionPrompt onConnected={refetch} />
- </View>
- </View>
- );
- }
-
- return (
- <>
- <View className="flex-1 bg-background">
- <DotBackground />
-
- <Animated.View style={[{ flex: 1 }, containerStyle]}>
- <View className="flex-1 justify-center px-4">
- <View style={{ width: "100%", maxWidth: 600, alignSelf: "center" }}>
- {!signalReport && (
- <View className="mb-2">
- <RepositoryPickerInline
- open={repoSheetOpen}
- repositoryOptions={repositoryOptions}
- selected={selectedRepositoryOption}
- loading={isLoading && repositoryOptions.length === 0}
- isRefreshing={isRefreshingInBackground}
- onChange={(option) =>
- setSelection(toRepositorySelection(option))
- }
- onClose={() => setRepoSheetOpen(false)}
- />
- </View>
- )}
-
- {repositoryWarning ? (
- <GitHubLoadNotice
- message={repositoryWarning}
- onRetry={refetch}
- tone="warning"
- />
- ) : null}
-
- {!signalReport && (
- <View className="mb-2 flex-row items-center">
- <Pressable
- onPress={() => setRepoSheetOpen((prev) => !prev)}
- className={`flex-row items-center gap-2 rounded-md border py-1.5 pr-2.5 pl-2 active:bg-gray-2 ${
- repoSheetOpen
- ? "border-accent-7 bg-accent-3"
- : "border-gray-6 bg-card"
- }`}
- >
- <GithubLogo
- size={16}
- color={
- selectedRepositoryOption
- ? themeColors.gray[12]
- : themeColors.gray[10]
- }
- weight={selectedRepositoryOption ? "fill" : "regular"}
- />
- <Text
- className={`text-[13px] ${
- selectedRepositoryOption
- ? "text-gray-12"
- : "text-gray-10"
- }`}
- numberOfLines={1}
- >
- {repositoryLabel}
- </Text>
- <CaretDown
- size={12}
- color={themeColors.gray[10]}
- style={{
- transform: [
- { rotate: repoSheetOpen ? "180deg" : "0deg" },
- ],
- }}
- />
- </Pressable>
- </View>
- )}
-
- <View className="overflow-hidden rounded-lg border border-gray-6 bg-card">
- <AttachmentsBar
- attachments={attachments}
- onRemove={removeAttachment}
- />
- <TextInput
- className="px-4 pt-3.5 pb-3 text-[15px] text-gray-12"
- style={{ minHeight: 92, maxHeight: 200 }}
- placeholder="What do you want to ship?"
- placeholderTextColor={themeColors.gray[9]}
- value={prompt}
- onChangeText={setPrompt}
- multiline
- textAlignVertical="top"
- />
-
- <View className="flex-row items-center gap-2 px-2 pb-2">
- <Pressable
- hitSlop={8}
- onPress={() => setAttachmentSheetOpen(true)}
- accessibilityLabel="Add attachment"
- accessibilityRole="button"
- className="h-9 w-9 items-center justify-center active:opacity-60"
- >
- <PaperclipIcon
- size={18}
- color={
- attachments.length > 0
- ? themeColors.accent[11]
- : themeColors.gray[10]
- }
- weight={attachments.length > 0 ? "fill" : "regular"}
- />
- </Pressable>
-
- <View className="relative flex-1">
- <ScrollView
- horizontal
- showsHorizontalScrollIndicator={false}
- keyboardShouldPersistTaps="handled"
- contentContainerStyle={{
- alignItems: "center",
- gap: 6,
- paddingRight: 16,
- }}
- >
- <AgentConfigControls
- adapter={adapter}
- mode={mode}
- model={model}
- reasoning={reasoning}
- contextWindow={contextWindow}
- fastMode={fastMode}
- configOptions={configOptions}
- modelGroups={modelGroups}
- onAdapterChange={(next) => {
- setAdapter(next.adapter);
- setMode(next.mode);
- setModel(next.model);
- setReasoning(next.reasoning);
- setContextWindow(DEFAULT_CONTEXT_WINDOW);
- setFastMode(false);
- usePreferencesStore
- .getState()
- .resetLastUsedAgentConfig(
- next.mode,
- next.reasoning,
- );
- }}
- onModeChange={(next) => {
- setMode(next);
- usePreferencesStore
- .getState()
- .setLastNewTaskMode(next);
- }}
- onModelChange={setModel}
- onReasoningChange={(next) => {
- setReasoning(next);
- usePreferencesStore
- .getState()
- .setLastUsedReasoningEffort(next);
- }}
- onContextWindowChange={(next) => {
- setContextWindow(next);
- usePreferencesStore
- .getState()
- .setLastUsedContextWindow(next);
- }}
- onFastModeChange={(next) => {
- setFastMode(next);
- usePreferencesStore
- .getState()
- .setLastUsedFastMode(next);
- }}
- />
- </ScrollView>
- {/* Right-edge fade hints that more pills exist when the row
- overflows. Non-interactive so taps fall through. */}
- <LinearGradient
- pointerEvents="none"
- colors={[toRgba(themeColors.card, 0), themeColors.card]}
- start={{ x: 0, y: 0.5 }}
- end={{ x: 1, y: 0.5 }}
- style={{
- position: "absolute",
- top: 0,
- bottom: 0,
- right: 0,
- width: 24,
- }}
- />
- </View>
-
- <Pressable
- onPress={
- isTranscribing
- ? undefined
- : isRecording
- ? handleMicPress
- : hasContent
- ? handleCreateTask
- : handleMicPress
- }
- onLongPress={handleMicLongPress}
- disabled={
- isTranscribing ||
- (hasContent && !canSubmit && !isRecording)
- }
- accessibilityLabel={
- isRecording
- ? "Stop recording"
- : hasContent
- ? "Create task"
- : "Record voice"
- }
- className={`h-9 w-9 items-center justify-center rounded-lg ${
- canSubmit ||
- isRecording ||
- (!hasContent && !isTranscribing)
- ? "bg-gray-12"
- : "bg-gray-5"
- }`}
- >
- {creating || isTranscribing ? (
- <ActivityIndicator
- size="small"
- color={themeColors.background}
- />
- ) : isRecording ? (
- <StopIcon
- size={18}
- color={themeColors.status.error}
- weight="fill"
- />
- ) : hasContent ? (
- <ArrowUp
- size={18}
- color={
- canSubmit
- ? themeColors.background
- : themeColors.gray[9]
- }
- weight="bold"
- />
- ) : (
- <MicrophoneIcon
- size={18}
- color={themeColors.background}
- />
- )}
- </Pressable>
- </View>
- </View>
-
- {!repoSheetOpen && prompt.trim().length === 0 ? (
- <Animated.View
- style={suggestionsStyle}
- pointerEvents={keyboardActive ? "none" : "auto"}
- className="mt-6"
- >
- <Text className="mb-2 px-2.5 font-medium text-[13px] text-gray-11">
- Suggestions
- </Text>
- <View className="gap-2">
- {SUGGESTIONS.map((suggestion) => (
- <Pressable
- key={suggestion}
- onPress={() => setPrompt(suggestion)}
- className="rounded-lg border border-gray-5 bg-gray-2 px-3 py-2.5 active:bg-gray-3"
- >
- <Text className="text-[13px] text-gray-12">
- {suggestion}
- </Text>
- </Pressable>
- ))}
- </View>
- </Animated.View>
- ) : null}
- </View>
- </View>
- </Animated.View>
- </View>
-
- <AttachmentSheet
- open={attachmentSheetOpen}
- onClose={() => setAttachmentSheetOpen(false)}
- onPickPhoto={() => addAttachment(pickPhotoFromLibrary)}
- onPickCamera={() => addAttachment(captureFromCamera)}
- onPickDocument={() => addAttachment(pickDocument)}
- />
- </>
- );
-}
diff --git a/products/desktop/apps/mobile/src/components/FloatingBackButton.tsx b/products/desktop/apps/mobile/src/components/FloatingBackButton.tsx
deleted file mode 100644
index 6c7b25f40172..000000000000
--- a/products/desktop/apps/mobile/src/components/FloatingBackButton.tsx
+++ /dev/null
@@ -1,42 +0,0 @@
-import { useRouter } from "expo-router";
-import { CaretLeft } from "phosphor-react-native";
-import { Pressable } from "react-native";
-import { useSafeAreaInsets } from "react-native-safe-area-context";
-import { useThemeColors } from "@/lib/theme";
-
-interface FloatingBackButtonProps {
- /** Override the default `router.back()` action. */
- onPress?: () => void;
-}
-
-/**
- * Pill-shaped back button that floats over the top-left of a screen. Used in
- * place of a native stack header so the content can fill the full screen
- * (e.g. behind a dotted background).
- */
-export function FloatingBackButton({ onPress }: FloatingBackButtonProps) {
- const router = useRouter();
- const insets = useSafeAreaInsets();
- const themeColors = useThemeColors();
-
- const handlePress = () => {
- if (onPress) {
- onPress();
- return;
- }
- if (router.canGoBack()) {
- router.back();
- }
- };
-
- return (
- <Pressable
- onPress={handlePress}
- hitSlop={8}
- className="absolute left-3 z-10 h-11 w-11 items-center justify-center rounded-full border border-gray-6 bg-card active:bg-gray-3"
- style={{ top: insets.top + 8 }}
- >
- <CaretLeft size={22} color={themeColors.gray[12]} weight="bold" />
- </Pressable>
- );
-}
diff --git a/products/desktop/apps/mobile/src/components/OfflineBanner.tsx b/products/desktop/apps/mobile/src/components/OfflineBanner.tsx
deleted file mode 100644
index f93ad9caa129..000000000000
--- a/products/desktop/apps/mobile/src/components/OfflineBanner.tsx
+++ /dev/null
@@ -1,27 +0,0 @@
-import { WifiSlash } from "phosphor-react-native";
-import { Text, View } from "react-native";
-import { useSafeAreaInsets } from "react-native-safe-area-context";
-
-export const OFFLINE_BANNER_HEIGHT = 36;
-
-interface OfflineBannerProps {
- isConnected: boolean;
-}
-
-export function OfflineBanner({ isConnected }: OfflineBannerProps) {
- const insets = useSafeAreaInsets();
-
- if (isConnected) return null;
-
- return (
- <View
- className="absolute inset-x-0 z-50 flex-row items-center justify-center gap-2 bg-status-error px-4 py-2"
- style={{ top: insets.top, minHeight: OFFLINE_BANNER_HEIGHT }}
- >
- <WifiSlash size={16} color="#fff" weight="bold" />
- <Text className="font-medium text-sm text-white">
- No internet connection
- </Text>
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/components/QrScanModal.tsx b/products/desktop/apps/mobile/src/components/QrScanModal.tsx
deleted file mode 100644
index b9cdc9c8aecf..000000000000
--- a/products/desktop/apps/mobile/src/components/QrScanModal.tsx
+++ /dev/null
@@ -1,134 +0,0 @@
-import { CameraView, useCameraPermissions } from "expo-camera";
-import { useCallback, useRef, useState } from "react";
-import {
- ActivityIndicator,
- Modal,
- Text,
- TouchableOpacity,
- View,
-} from "react-native";
-import { SafeAreaView } from "react-native-safe-area-context";
-
-export type QrScanResult = {
- apiKey: string;
- projectId: number;
-};
-
-type QrScanModalProps = {
- visible: boolean;
- onClose: () => void;
- onScan: (result: QrScanResult) => void;
-};
-
-function parseQrPayload(raw: string): QrScanResult | null {
- try {
- const parsed = JSON.parse(raw);
- const apiKey = typeof parsed.apiKey === "string" ? parsed.apiKey : null;
- const projectIdRaw = parsed.projectId;
- const projectId =
- typeof projectIdRaw === "number"
- ? projectIdRaw
- : typeof projectIdRaw === "string"
- ? Number(projectIdRaw)
- : NaN;
- if (!apiKey || !Number.isFinite(projectId) || projectId <= 0) {
- return null;
- }
- return { apiKey, projectId };
- } catch {
- return null;
- }
-}
-
-export function QrScanModal({ visible, onClose, onScan }: QrScanModalProps) {
- const [permission, requestPermission] = useCameraPermissions();
- const [error, setError] = useState<string | null>(null);
- const hasScannedRef = useRef(false);
-
- const handleBarcode = useCallback(
- (event: { data: string }) => {
- if (hasScannedRef.current) {
- return;
- }
- const parsed = parseQrPayload(event.data);
- if (!parsed) {
- setError("QR code is not a valid PostHog sign-in code");
- return;
- }
- hasScannedRef.current = true;
- onScan(parsed);
- },
- [onScan],
- );
-
- const handleClose = useCallback(() => {
- hasScannedRef.current = false;
- setError(null);
- onClose();
- }, [onClose]);
-
- return (
- <Modal
- visible={visible}
- animationType="slide"
- onRequestClose={handleClose}
- onShow={() => {
- hasScannedRef.current = false;
- setError(null);
- }}
- >
- <SafeAreaView className="flex-1 bg-black">
- <View className="flex-row items-center justify-between px-4 py-3">
- <Text className="font-semibold text-base text-white">
- Scan sign-in QR
- </Text>
- <TouchableOpacity onPress={handleClose} className="px-3 py-2">
- <Text className="font-medium text-base text-white">Close</Text>
- </TouchableOpacity>
- </View>
-
- <View className="flex-1">
- {!permission ? (
- <View className="flex-1 items-center justify-center">
- <ActivityIndicator color="#ffffff" />
- </View>
- ) : !permission.granted ? (
- <View className="flex-1 items-center justify-center px-6">
- <Text className="mb-4 text-center text-base text-white">
- PostHog needs camera access to scan the QR code shown on the web
- app.
- </Text>
- <TouchableOpacity
- className="rounded-lg bg-white px-5 py-3"
- onPress={requestPermission}
- >
- <Text className="font-semibold text-base text-black">
- Grant camera access
- </Text>
- </TouchableOpacity>
- </View>
- ) : (
- <CameraView
- style={{ flex: 1 }}
- facing="back"
- barcodeScannerSettings={{ barcodeTypes: ["qr"] }}
- onBarcodeScanned={handleBarcode}
- >
- <View className="flex-1 items-center justify-end px-6 pb-10">
- {error ? (
- <View className="mb-3 rounded-lg bg-black/70 px-4 py-2">
- <Text className="text-sm text-white">{error}</Text>
- </View>
- ) : null}
- <Text className="rounded-lg bg-black/60 px-4 py-2 text-center text-sm text-white">
- Point your camera at the QR code shown in the PostHog web app
- after creating a personal API key.
- </Text>
- </View>
- </CameraView>
- )}
- </View>
- </SafeAreaView>
- </Modal>
- );
-}
diff --git a/products/desktop/apps/mobile/src/components/SheetContainer.tsx b/products/desktop/apps/mobile/src/components/SheetContainer.tsx
deleted file mode 100644
index 1d2c2008f528..000000000000
--- a/products/desktop/apps/mobile/src/components/SheetContainer.tsx
+++ /dev/null
@@ -1,78 +0,0 @@
-import type { ReactNode } from "react";
-import { Modal, Pressable, View, type ViewStyle } from "react-native";
-import {
- type BottomGapVariant,
- useScreenInsets,
-} from "@/hooks/useScreenInsets";
-
-const SHEET_SHADOW = {
- shadowColor: "#000",
- shadowOpacity: 0.15,
- shadowRadius: 20,
- shadowOffset: { width: 0, height: -4 },
- elevation: 12,
-} as const;
-
-interface SheetContainerProps {
- open: boolean;
- onClose: () => void;
- children: ReactNode;
- /**
- * Bottom padding gap above the safe-area inset. Defaults to "compact"
- * because that is the gap both legacy sheets (SelectSheet, AttachmentSheet)
- * inherited — deliberately not BOTTOM_GAP's own "default" (24). Pass
- * "default"/"roomy" when a sheet wants more breathing room.
- */
- bottomGap?: BottomGapVariant;
- /** Extra classes for the sheet panel. */
- className?: string;
- /** Extra inline styles for the sheet panel (e.g. a measured maxHeight). */
- style?: ViewStyle;
-}
-
-/**
- * Bottom-sheet shell: a dimmed backdrop, a panel pinned to the bottom edge with
- * the standard rounded top, border, shadow, drag handle, and safe-area-aware
- * bottom padding. Tapping the backdrop closes; taps inside the panel don't.
- *
- * Use this instead of re-implementing the `mt-auto rounded-t-2xl …` markup so
- * every sheet shares one shape and one inset policy.
- */
-export function SheetContainer({
- open,
- onClose,
- children,
- bottomGap = "compact",
- className = "",
- style,
-}: SheetContainerProps) {
- const { bottom } = useScreenInsets();
-
- return (
- <Modal
- visible={open}
- transparent
- animationType="slide"
- onRequestClose={onClose}
- statusBarTranslucent
- >
- <Pressable className="flex-1 bg-black/40" onPress={onClose}>
- <Pressable
- onPress={() => {}}
- className={`mt-auto rounded-t-2xl border-gray-6 border-t bg-background ${className}`}
- style={{
- paddingBottom: bottom(bottomGap),
- ...SHEET_SHADOW,
- ...style,
- }}
- >
- {/* Drag handle */}
- <View className="items-center pt-2 pb-1">
- <View className="h-1 w-10 rounded-full bg-gray-6" />
- </View>
- {children}
- </Pressable>
- </Pressable>
- </Modal>
- );
-}
diff --git a/products/desktop/apps/mobile/src/components/text.tsx b/products/desktop/apps/mobile/src/components/text.tsx
deleted file mode 100644
index dfe3f03deec3..000000000000
--- a/products/desktop/apps/mobile/src/components/text.tsx
+++ /dev/null
@@ -1,5 +0,0 @@
-import { Text as RNText, type TextProps } from "react-native";
-
-export function Text({ className, ...props }: TextProps) {
- return <RNText className={`font-sans ${className || ""}`} {...props} />;
-}
diff --git a/products/desktop/apps/mobile/src/features/auth/hooks/useAuth.ts b/products/desktop/apps/mobile/src/features/auth/hooks/useAuth.ts
deleted file mode 100644
index b4d97735df0c..000000000000
--- a/products/desktop/apps/mobile/src/features/auth/hooks/useAuth.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-import { useAuthStore } from "../stores/authStore";
-
-/**
- * A convenience hook for accessing common auth state and methods.
- */
-export function useAuth() {
- const {
- isAuthenticated,
- isLoading,
- oauthAccessToken,
- cloudRegion,
- projectId,
- loginWithOAuth,
- logout,
- refreshAccessToken,
- initializeAuth,
- } = useAuthStore();
-
- return {
- // State
- isAuthenticated,
- isLoading,
- accessToken: oauthAccessToken,
- cloudRegion,
- projectId,
-
- // Methods
- login: loginWithOAuth,
- logout,
- refresh: refreshAccessToken,
- initialize: initializeAuth,
- };
-}
diff --git a/products/desktop/apps/mobile/src/features/auth/hooks/useProjectsQuery.ts b/products/desktop/apps/mobile/src/features/auth/hooks/useProjectsQuery.ts
deleted file mode 100644
index 43a1aac114c2..000000000000
--- a/products/desktop/apps/mobile/src/features/auth/hooks/useProjectsQuery.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-import { useQuery } from "@tanstack/react-query";
-import { authedFetch, getBaseUrl } from "@/lib/api";
-import { useAuthStore } from "../stores/authStore";
-
-export interface ProjectSummary {
- id: number;
- name: string;
-}
-
-/**
- * Fetch the display name for every team/project the OAuth token is scoped to,
- * so the settings project picker can show names instead of bare IDs. There is
- * no list endpoint scoped to a token's teams, so we fetch each
- * `/api/projects/{id}/` individually. A failed lookup degrades to `Project N`
- * rather than dropping the project from the list.
- */
-export function useProjectsQuery() {
- const { cloudRegion, oauthAccessToken, scopedTeams } = useAuthStore();
-
- return useQuery({
- queryKey: ["projects", cloudRegion, scopedTeams],
- queryFn: async (): Promise<ProjectSummary[]> => {
- const baseUrl = getBaseUrl();
-
- return Promise.all(
- scopedTeams.map(async (id): Promise<ProjectSummary> => {
- try {
- const response = await authedFetch(
- `${baseUrl}/api/projects/${id}/`,
- );
- if (!response.ok) return { id, name: `Project ${id}` };
- const data: { name?: string } = await response.json();
- return { id, name: data.name || `Project ${id}` };
- } catch {
- return { id, name: `Project ${id}` };
- }
- }),
- );
- },
- enabled: !!cloudRegion && !!oauthAccessToken && scopedTeams.length > 0,
- staleTime: 5 * 60 * 1000,
- });
-}
diff --git a/products/desktop/apps/mobile/src/features/auth/hooks/useUserQuery.ts b/products/desktop/apps/mobile/src/features/auth/hooks/useUserQuery.ts
deleted file mode 100644
index 2e7a33b36959..000000000000
--- a/products/desktop/apps/mobile/src/features/auth/hooks/useUserQuery.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import { useQuery } from "@tanstack/react-query";
-import { authedFetch, getBaseUrl } from "@/lib/api";
-import { useAuthStore } from "../stores/authStore";
-
-export interface UserData {
- id: number;
- uuid: string;
- first_name: string;
- last_name?: string;
- email: string;
- is_staff?: boolean;
- organization?: {
- id: string;
- name: string;
- is_ai_data_processing_approved?: boolean;
- membership_level?: number;
- };
- team?: {
- id: number;
- name: string;
- };
-}
-
-export function useUserQuery() {
- const { cloudRegion, oauthAccessToken } = useAuthStore();
-
- return useQuery({
- queryKey: ["user", "me"],
- queryFn: async (): Promise<UserData> => {
- const response = await authedFetch(`${getBaseUrl()}/api/users/@me/`);
-
- if (!response.ok) {
- throw new Error(`Failed to fetch user: ${response.statusText}`);
- }
-
- const data: UserData = await response.json();
- return data;
- },
- enabled: !!cloudRegion && !!oauthAccessToken,
- staleTime: 5 * 60 * 1000, // 5 minutes
- });
-}
diff --git a/products/desktop/apps/mobile/src/features/auth/index.ts b/products/desktop/apps/mobile/src/features/auth/index.ts
deleted file mode 100644
index 3fe5d896c728..000000000000
--- a/products/desktop/apps/mobile/src/features/auth/index.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-// Auth feature
-
-export { useAuth } from "./hooks/useAuth";
-export type { ProjectSummary } from "./hooks/useProjectsQuery";
-export { useProjectsQuery } from "./hooks/useProjectsQuery";
-export type { UserData } from "./hooks/useUserQuery";
-export { useUserQuery } from "./hooks/useUserQuery";
-export * from "./lib/constants";
-export * from "./lib/oauth";
-export * from "./lib/secureStorage";
-export { useAuthStore } from "./stores/authStore";
-export * from "./types";
diff --git a/products/desktop/apps/mobile/src/features/auth/lib/constants.ts b/products/desktop/apps/mobile/src/features/auth/lib/constants.ts
deleted file mode 100644
index 8c7c2bfa61c1..000000000000
--- a/products/desktop/apps/mobile/src/features/auth/lib/constants.ts
+++ /dev/null
@@ -1,49 +0,0 @@
-import type { CloudRegion } from "../types";
-
-export const POSTHOG_US_CLIENT_ID = "a5TY7w9IjFYfes6dkPgZe6envclWw3bm2UD8ZTlm";
-export const POSTHOG_EU_CLIENT_ID = "1A7vO138Fh5sYmJislicN4F5HnttI6urmFttxPDU";
-export const POSTHOG_DEV_CLIENT_ID = "DC5uRLVbGI02YQ82grxgnK6Qn12SXWpCqdPb60oZ";
-
-export const OAUTH_SCOPES = [
- "user:read",
- // Required for POST /api/users/@me/push_tokens/ — without it the backend
- // rejects push-token registration with 403 and notifications never fire.
- "user:write",
- "project:read",
- // Required for the organization consent gate: the beta-terms read and the
- // AI-data-processing / beta-terms writes hit organization-scoped endpoints.
- "organization:read",
- "organization:write",
- "task:write",
- "integration:read",
- "conversation:write",
- "query:read",
- "llm_skill:read",
-];
-
-export const OAUTH_SCOPE_VERSION = 2;
-
-// Token refresh settings
-export const TOKEN_REFRESH_BUFFER_MS = 5 * 60 * 1000; // 5 minutes before expiry
-
-export function getCloudUrlFromRegion(region: CloudRegion): string {
- switch (region) {
- case "us":
- return "https://us.posthog.com";
- case "eu":
- return "https://eu.posthog.com";
- case "dev":
- return "http://localhost:8010";
- }
-}
-
-export function getOauthClientIdFromRegion(region: CloudRegion): string {
- switch (region) {
- case "us":
- return POSTHOG_US_CLIENT_ID;
- case "eu":
- return POSTHOG_EU_CLIENT_ID;
- case "dev":
- return POSTHOG_DEV_CLIENT_ID;
- }
-}
diff --git a/products/desktop/apps/mobile/src/features/auth/lib/oauth.test.ts b/products/desktop/apps/mobile/src/features/auth/lib/oauth.test.ts
deleted file mode 100644
index b4e963544ae6..000000000000
--- a/products/desktop/apps/mobile/src/features/auth/lib/oauth.test.ts
+++ /dev/null
@@ -1,94 +0,0 @@
-import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
-
-vi.mock("expo-auth-session", () => ({
- makeRedirectUri: () => "posthog://callback",
- AuthRequest: class {},
-}));
-
-vi.mock("expo-web-browser", () => ({
- maybeCompleteAuthSession: () => {},
-}));
-
-import { refreshAccessToken, TokenRefreshError } from "./oauth";
-
-const originalFetch = global.fetch;
-
-function mockResponse(status: number, body: unknown): Response {
- return new Response(JSON.stringify(body), {
- status,
- statusText: `Status ${status}`,
- headers: { "Content-Type": "application/json" },
- });
-}
-
-describe("refreshAccessToken", () => {
- beforeEach(() => {
- global.fetch = vi.fn() as unknown as typeof fetch;
- });
-
- afterEach(() => {
- global.fetch = originalFetch;
- });
-
- it("returns the parsed token response on success", async () => {
- vi.mocked(global.fetch).mockResolvedValueOnce(
- mockResponse(200, { access_token: "fresh", expires_in: 3600 }),
- );
-
- const result = await refreshAccessToken("refresh", "us");
-
- expect(result.access_token).toBe("fresh");
- });
-
- it.each([
- { name: "401", status: 401, body: {} },
- { name: "403", status: 403, body: {} },
- {
- name: "400 invalid_grant",
- status: 400,
- body: { error: "invalid_grant" },
- },
- {
- name: "400 invalid_token",
- status: 400,
- body: { error: "invalid_token" },
- },
- ])("classifies $name as auth_error", async ({ status, body }) => {
- vi.mocked(global.fetch).mockResolvedValueOnce(mockResponse(status, body));
-
- await expect(refreshAccessToken("refresh", "us")).rejects.toMatchObject({
- errorCode: "auth_error",
- });
- });
-
- it.each([
- { name: "invalid_client", body: { error: "invalid_client" } },
- { name: "invalid_request", body: { error: "invalid_request" } },
- ])("classifies a 400 $name as unknown_error", async ({ body }) => {
- vi.mocked(global.fetch).mockResolvedValueOnce(mockResponse(400, body));
-
- await expect(refreshAccessToken("refresh", "us")).rejects.toMatchObject({
- errorCode: "unknown_error",
- });
- });
-
- it.each([500, 502, 503])(
- "classifies a %i as server_error",
- async (status) => {
- vi.mocked(global.fetch).mockResolvedValueOnce(mockResponse(status, {}));
-
- await expect(refreshAccessToken("refresh", "us")).rejects.toMatchObject({
- errorCode: "server_error",
- });
- },
- );
-
- it("classifies a thrown fetch as network_error", async () => {
- vi.mocked(global.fetch).mockRejectedValueOnce(new Error("offline"));
-
- const error = await refreshAccessToken("refresh", "us").catch((e) => e);
-
- expect(error).toBeInstanceOf(TokenRefreshError);
- expect(error.errorCode).toBe("network_error");
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/auth/lib/oauth.ts b/products/desktop/apps/mobile/src/features/auth/lib/oauth.ts
deleted file mode 100644
index a61afa1415f9..000000000000
--- a/products/desktop/apps/mobile/src/features/auth/lib/oauth.ts
+++ /dev/null
@@ -1,210 +0,0 @@
-import * as AuthSession from "expo-auth-session";
-import * as WebBrowser from "expo-web-browser";
-import type { CloudRegion, OAuthConfig, OAuthTokenResponse } from "../types";
-import { getCloudUrlFromRegion, getOauthClientIdFromRegion } from "./constants";
-
-// Required for web browser auth session to work properly
-WebBrowser.maybeCompleteAuthSession();
-
-export function getRedirectUri(): string {
- return AuthSession.makeRedirectUri({
- scheme: "posthog",
- path: "callback",
- });
-}
-
-export function getAuthorizationEndpoint(region: CloudRegion): string {
- return `${getCloudUrlFromRegion(region)}/oauth/authorize`;
-}
-
-export function getTokenEndpoint(region: CloudRegion): string {
- return `${getCloudUrlFromRegion(region)}/oauth/token`;
-}
-
-export async function exchangeCodeForToken(
- code: string,
- codeVerifier: string,
- config: OAuthConfig,
-): Promise<OAuthTokenResponse> {
- const cloudUrl = getCloudUrlFromRegion(config.cloudRegion);
- const redirectUri = getRedirectUri();
-
- const response = await fetch(`${cloudUrl}/oauth/token`, {
- method: "POST",
- headers: {
- "Content-Type": "application/json",
- },
- body: JSON.stringify({
- grant_type: "authorization_code",
- code,
- redirect_uri: redirectUri,
- client_id: getOauthClientIdFromRegion(config.cloudRegion),
- code_verifier: codeVerifier,
- }),
- });
-
- if (!response.ok) {
- const errorText = await response.text();
- throw new Error(
- `Token exchange failed: ${response.statusText} - ${errorText}`,
- );
- }
-
- return response.json();
-}
-
-export type OAuthRefreshErrorCode =
- | "auth_error"
- | "server_error"
- | "network_error"
- | "unknown_error";
-
-export class TokenRefreshError extends Error {
- readonly errorCode: OAuthRefreshErrorCode;
-
- constructor(errorCode: OAuthRefreshErrorCode, message: string) {
- super(message);
- this.name = "TokenRefreshError";
- this.errorCode = errorCode;
- }
-}
-
-async function parseOAuthErrorCode(response: Response): Promise<string | null> {
- try {
- const body = (await response.json()) as { error?: unknown };
- return typeof body.error === "string" ? body.error : null;
- } catch {
- return null;
- }
-}
-
-export async function refreshAccessToken(
- refreshToken: string,
- region: CloudRegion,
-): Promise<OAuthTokenResponse> {
- const cloudUrl = getCloudUrlFromRegion(region);
-
- let response: Response;
- try {
- response = await fetch(`${cloudUrl}/oauth/token`, {
- method: "POST",
- headers: {
- "Content-Type": "application/json",
- },
- body: JSON.stringify({
- grant_type: "refresh_token",
- refresh_token: refreshToken,
- client_id: getOauthClientIdFromRegion(region),
- }),
- });
- } catch (error) {
- throw new TokenRefreshError(
- "network_error",
- error instanceof Error ? error.message : "Token refresh network error",
- );
- }
-
- if (!response.ok) {
- // 401/403 are always auth failures. A 400 only means a dead refresh token
- // when the OAuth error is invalid_grant/invalid_token; other 400s like
- // invalid_client are config bugs that must not sign the user out, or they
- // could never log back in with the same broken config.
- const oauthErrorCode =
- response.status === 400 ? await parseOAuthErrorCode(response) : null;
- const isAuthError =
- response.status === 401 ||
- response.status === 403 ||
- oauthErrorCode === "invalid_grant" ||
- oauthErrorCode === "invalid_token";
- const errorCode: OAuthRefreshErrorCode = isAuthError
- ? "auth_error"
- : response.status >= 500
- ? "server_error"
- : "unknown_error";
- throw new TokenRefreshError(
- errorCode,
- `Token refresh failed: ${response.status} ${response.statusText}`,
- );
- }
-
- return response.json();
-}
-
-export interface OAuthFlowResult {
- success: boolean;
- data?: OAuthTokenResponse;
- error?: string;
-}
-
-export async function performOAuthFlow(
- config: OAuthConfig,
-): Promise<OAuthFlowResult> {
- try {
- const redirectUri = getRedirectUri();
- const clientId = getOauthClientIdFromRegion(config.cloudRegion);
-
- const discovery: AuthSession.DiscoveryDocument = {
- authorizationEndpoint: getAuthorizationEndpoint(config.cloudRegion),
- tokenEndpoint: getTokenEndpoint(config.cloudRegion),
- };
-
- // Let expo-auth-session handle PKCE internally
- const authRequest = new AuthSession.AuthRequest({
- clientId,
- scopes: config.scopes,
- redirectUri,
- usePKCE: true,
- extraParams: {
- required_access_level: "project",
- },
- });
-
- // promptAsync will load the request internally and generate PKCE
- const authResult = await authRequest.promptAsync(discovery);
-
- if (authResult.type === "cancel" || authResult.type === "dismiss") {
- return {
- success: false,
- error: "Authorization cancelled",
- };
- }
-
- if (authResult.type === "error") {
- return {
- success: false,
- error: authResult.error?.message || "Authorization failed",
- };
- }
-
- if (authResult.type !== "success" || !authResult.params.code) {
- return {
- success: false,
- error: "No authorization code received",
- };
- }
-
- // Use the AuthRequest's codeVerifier for token exchange
- if (!authRequest.codeVerifier) {
- return {
- success: false,
- error: "PKCE code verifier not available",
- };
- }
-
- const tokenResponse = await exchangeCodeForToken(
- authResult.params.code,
- authRequest.codeVerifier,
- config,
- );
-
- return {
- success: true,
- data: tokenResponse,
- };
- } catch (error) {
- return {
- success: false,
- error: error instanceof Error ? error.message : "Unknown error",
- };
- }
-}
diff --git a/products/desktop/apps/mobile/src/features/auth/lib/secureStorage.ts b/products/desktop/apps/mobile/src/features/auth/lib/secureStorage.ts
deleted file mode 100644
index 99c5ad3fa2a2..000000000000
--- a/products/desktop/apps/mobile/src/features/auth/lib/secureStorage.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import * as SecureStore from "expo-secure-store";
-import type { StoredTokens } from "../types";
-
-const TOKENS_KEY = "posthog_oauth_tokens";
-
-export async function saveTokens(tokens: StoredTokens): Promise<void> {
- await SecureStore.setItemAsync(TOKENS_KEY, JSON.stringify(tokens));
-}
-
-export async function getTokens(): Promise<StoredTokens | null> {
- const value = await SecureStore.getItemAsync(TOKENS_KEY);
- if (!value) return null;
-
- try {
- return JSON.parse(value) as StoredTokens;
- } catch {
- return null;
- }
-}
-
-export async function deleteTokens(): Promise<void> {
- await SecureStore.deleteItemAsync(TOKENS_KEY);
-}
diff --git a/products/desktop/apps/mobile/src/features/auth/stores/authStore.test.ts b/products/desktop/apps/mobile/src/features/auth/stores/authStore.test.ts
deleted file mode 100644
index c455579ec7e2..000000000000
--- a/products/desktop/apps/mobile/src/features/auth/stores/authStore.test.ts
+++ /dev/null
@@ -1,204 +0,0 @@
-import { beforeEach, describe, expect, it, vi } from "vitest";
-
-const {
- mockPerformOAuthFlow,
- mockRefreshAccessTokenRequest,
- mockGetTokens,
- mockSaveTokens,
- mockDeleteTokens,
- mockRegisterAndUpload,
- mockClearPushToken,
- mockQueryClientClear,
-} = vi.hoisted(() => ({
- mockPerformOAuthFlow: vi.fn(),
- mockRefreshAccessTokenRequest: vi.fn(),
- mockGetTokens: vi.fn(),
- mockSaveTokens: vi.fn(),
- mockDeleteTokens: vi.fn(),
- mockRegisterAndUpload: vi.fn(),
- mockClearPushToken: vi.fn(),
- mockQueryClientClear: vi.fn(),
-}));
-
-vi.mock("@react-native-async-storage/async-storage", () => ({
- default: {
- getItem: vi.fn(),
- setItem: vi.fn(),
- removeItem: vi.fn(),
- },
-}));
-
-vi.mock("../lib/oauth", () => ({
- performOAuthFlow: mockPerformOAuthFlow,
- refreshAccessToken: mockRefreshAccessTokenRequest,
- TokenRefreshError: class TokenRefreshError extends Error {
- readonly errorCode: string;
- constructor(errorCode: string, message: string) {
- super(message);
- this.errorCode = errorCode;
- }
- },
-}));
-
-vi.mock("../lib/secureStorage", () => ({
- getTokens: mockGetTokens,
- saveTokens: mockSaveTokens,
- deleteTokens: mockDeleteTokens,
-}));
-
-vi.mock("@/features/notifications/stores/pushTokenStore", () => ({
- usePushTokenStore: {
- getState: () => ({
- registerAndUpload: mockRegisterAndUpload,
- clear: mockClearPushToken,
- }),
- },
-}));
-
-vi.mock("@/features/preferences/stores/preferencesStore", () => ({
- usePreferencesStore: {
- getState: () => ({
- pushNotificationsEnabled: false,
- }),
- },
-}));
-
-vi.mock("@/lib/queryClient", () => ({
- queryClient: {
- clear: mockQueryClientClear,
- },
-}));
-
-import { OAUTH_SCOPE_VERSION } from "../lib/constants";
-import { TokenRefreshError } from "../lib/oauth";
-import { useAuthStore } from "./authStore";
-
-function expiredStoredTokens() {
- return {
- accessToken: "old-token",
- refreshToken: "old-refresh",
- expiresAt: Date.now() - 1_000,
- cloudRegion: "us" as const,
- scopedTeams: [42],
- scopeVersion: OAUTH_SCOPE_VERSION,
- };
-}
-
-describe("authStore", () => {
- beforeEach(() => {
- mockPerformOAuthFlow.mockReset();
- mockRefreshAccessTokenRequest.mockReset();
- mockGetTokens.mockReset();
- mockSaveTokens.mockReset();
- mockDeleteTokens.mockReset();
- mockRegisterAndUpload.mockReset();
- mockClearPushToken.mockReset();
- mockQueryClientClear.mockReset();
-
- useAuthStore.setState({
- oauthAccessToken: null,
- oauthRefreshToken: null,
- tokenExpiry: null,
- cloudRegion: null,
- projectId: null,
- isAuthenticated: false,
- isLoading: true,
- });
- });
-
- it("stores the current OAuth scope version on login", async () => {
- mockPerformOAuthFlow.mockResolvedValueOnce({
- success: true,
- data: {
- access_token: "access-token",
- refresh_token: "refresh-token",
- expires_in: 3600,
- token_type: "Bearer",
- scope: "user:read",
- scoped_teams: [42],
- },
- });
-
- await useAuthStore.getState().loginWithOAuth("us");
-
- expect(mockSaveTokens).toHaveBeenCalledWith(
- expect.objectContaining({
- accessToken: "access-token",
- refreshToken: "refresh-token",
- scopedTeams: [42],
- scopeVersion: OAUTH_SCOPE_VERSION,
- }),
- );
- });
-
- it("forces reauthentication when persisted tokens use an older scope version", async () => {
- mockGetTokens.mockResolvedValueOnce({
- accessToken: "old-token",
- refreshToken: "old-refresh",
- expiresAt: Date.now() + 60_000,
- cloudRegion: "us",
- scopedTeams: [42],
- scopeVersion: OAUTH_SCOPE_VERSION - 1,
- });
-
- const initialized = await useAuthStore.getState().initializeAuth();
-
- expect(initialized).toBe(false);
- expect(mockDeleteTokens).toHaveBeenCalledOnce();
- expect(mockQueryClientClear).toHaveBeenCalledOnce();
- expect(useAuthStore.getState()).toMatchObject({
- oauthAccessToken: null,
- oauthRefreshToken: null,
- projectId: null,
- isAuthenticated: false,
- isLoading: false,
- });
- });
-
- it("signs out when refreshing an expired token is rejected as auth_error", async () => {
- mockGetTokens.mockResolvedValueOnce(expiredStoredTokens());
- mockRefreshAccessTokenRequest.mockRejectedValueOnce(
- new TokenRefreshError("auth_error", "invalid_grant"),
- );
-
- const initialized = await useAuthStore.getState().initializeAuth();
-
- expect(initialized).toBe(false);
- expect(mockDeleteTokens).toHaveBeenCalledOnce();
- expect(useAuthStore.getState()).toMatchObject({
- isAuthenticated: false,
- isLoading: false,
- });
- });
-
- it.each([
- {
- name: "server_error",
- error: new TokenRefreshError("server_error", "5xx"),
- },
- {
- name: "network_error",
- error: new TokenRefreshError("network_error", "offline"),
- },
- {
- name: "unknown_error (config 400)",
- error: new TokenRefreshError("unknown_error", "invalid_client"),
- },
- ])(
- "keeps the session when an expired-token refresh fails with $name",
- async ({ error }) => {
- mockGetTokens.mockResolvedValueOnce(expiredStoredTokens());
- mockRefreshAccessTokenRequest.mockRejectedValueOnce(error);
-
- const initialized = await useAuthStore.getState().initializeAuth();
-
- expect(initialized).toBe(true);
- expect(mockDeleteTokens).not.toHaveBeenCalled();
- expect(useAuthStore.getState()).toMatchObject({
- oauthAccessToken: "old-token",
- isAuthenticated: true,
- isLoading: false,
- });
- },
- );
-});
diff --git a/products/desktop/apps/mobile/src/features/auth/stores/authStore.ts b/products/desktop/apps/mobile/src/features/auth/stores/authStore.ts
deleted file mode 100644
index 49f353e0782f..000000000000
--- a/products/desktop/apps/mobile/src/features/auth/stores/authStore.ts
+++ /dev/null
@@ -1,383 +0,0 @@
-import AsyncStorage from "@react-native-async-storage/async-storage";
-import { create } from "zustand";
-import { createJSONStorage, persist } from "zustand/middleware";
-import { usePushTokenStore } from "@/features/notifications/stores/pushTokenStore";
-import { usePreferencesStore } from "@/features/preferences/stores/preferencesStore";
-import { logger } from "@/lib/logger";
-import { queryClient } from "@/lib/queryClient";
-import {
- getCloudUrlFromRegion,
- OAUTH_SCOPE_VERSION,
- OAUTH_SCOPES,
- TOKEN_REFRESH_BUFFER_MS,
-} from "../lib/constants";
-import {
- performOAuthFlow,
- refreshAccessToken as refreshAccessTokenRequest,
- TokenRefreshError,
-} from "../lib/oauth";
-import { deleteTokens, getTokens, saveTokens } from "../lib/secureStorage";
-import type { CloudRegion, StoredTokens } from "../types";
-
-interface AuthState {
- // OAuth state
- oauthAccessToken: string | null;
- oauthRefreshToken: string | null;
- tokenExpiry: number | null;
- cloudRegion: CloudRegion | null;
- projectId: number | null;
- // Every team/project the OAuth token can access. The picker chooses among
- // these; `projectId` is the active one. Derived from the token's
- // `scoped_teams` and re-derived on refresh/init.
- scopedTeams: number[];
-
- // Auth status
- isAuthenticated: boolean;
- isLoading: boolean;
-
- // Methods
- loginWithOAuth: (region: CloudRegion) => Promise<void>;
- setProjectId: (projectId: number) => void;
- loginWithPersonalApiKey: (params: {
- token: string;
- projectId: number;
- region: CloudRegion;
- }) => Promise<void>;
- refreshAccessToken: () => Promise<void>;
- scheduleTokenRefresh: () => void;
- initializeAuth: () => Promise<boolean>;
- logout: () => Promise<void>;
- getCloudUrlFromRegion: (region: CloudRegion) => string;
-}
-
-let refreshTimeoutId: ReturnType<typeof setTimeout> | null = null;
-
-function buildStoredTokens(args: {
- accessToken: string;
- refreshToken: string;
- expiresAt: number;
- cloudRegion: CloudRegion;
- scopedTeams?: number[];
-}): StoredTokens {
- return {
- ...args,
- scopeVersion: OAUTH_SCOPE_VERSION,
- };
-}
-
-/**
- * Pick the active project after the token's scoped teams are (re)derived.
- * Keep the user's current selection if it's still in scope; otherwise fall
- * back to the first scoped team. This is what makes a picked project survive
- * token refresh and app relaunch instead of snapping back to `scoped_teams[0]`.
- */
-function resolveActiveProjectId(
- scopedTeams: number[],
- current: number | null,
-): number | null {
- if (current && scopedTeams.includes(current)) return current;
- return scopedTeams[0] ?? null;
-}
-
-function isDeadRefreshToken(error: unknown): boolean {
- return error instanceof TokenRefreshError && error.errorCode === "auth_error";
-}
-
-const CLEARED_AUTH_STATE = {
- oauthAccessToken: null,
- oauthRefreshToken: null,
- tokenExpiry: null,
- cloudRegion: null,
- projectId: null,
- scopedTeams: [],
- isAuthenticated: false,
-} satisfies Partial<AuthState>;
-
-function maybeRegisterPushToken(): void {
- if (!usePreferencesStore.getState().pushNotificationsEnabled) return;
- usePushTokenStore
- .getState()
- .registerAndUpload()
- .catch((error) => {
- logger.warn("Push token registration failed", error);
- });
-}
-
-export const useAuthStore = create<AuthState>()(
- persist(
- (set, get) => ({
- // OAuth state
- oauthAccessToken: null,
- oauthRefreshToken: null,
- tokenExpiry: null,
- cloudRegion: null,
- projectId: null,
- scopedTeams: [],
-
- // Auth status
- isAuthenticated: false,
- isLoading: true,
-
- // Helper method to get cloud URL
- getCloudUrlFromRegion,
-
- setProjectId: (projectId: number) => {
- const { scopedTeams, projectId: current } = get();
- // Guard: only switch to a project the token is actually scoped to.
- if (!scopedTeams.includes(projectId) || projectId === current) return;
- set({ projectId });
- // Drop cached data scoped to the previous project so tasks, inbox,
- // etc. refetch against the newly-selected one.
- queryClient.clear();
- },
-
- loginWithOAuth: async (region: CloudRegion) => {
- const result = await performOAuthFlow({
- scopes: OAUTH_SCOPES,
- cloudRegion: region,
- });
-
- if (!result.success || !result.data) {
- throw new Error(result.error || "OAuth flow failed");
- }
-
- const tokenResponse = result.data;
- const expiresAt = Date.now() + tokenResponse.expires_in * 1000;
- const scopedTeams = tokenResponse.scoped_teams ?? [];
- const projectId = scopedTeams[0];
-
- if (!projectId) {
- throw new Error("No team found in OAuth scopes");
- }
-
- const storedTokens = buildStoredTokens({
- accessToken: tokenResponse.access_token,
- refreshToken: tokenResponse.refresh_token,
- expiresAt,
- cloudRegion: region,
- scopedTeams,
- });
-
- // Save tokens securely
- await saveTokens(storedTokens);
-
- set({
- oauthAccessToken: tokenResponse.access_token,
- oauthRefreshToken: tokenResponse.refresh_token,
- tokenExpiry: expiresAt,
- cloudRegion: region,
- projectId,
- scopedTeams,
- isAuthenticated: true,
- });
-
- get().scheduleTokenRefresh();
- maybeRegisterPushToken();
- },
-
- loginWithPersonalApiKey: async ({ token, projectId, region }) => {
- if (!__DEV__) {
- throw new Error(
- "Dev sign-in is only available in development builds",
- );
- }
- const trimmed = token.trim();
- if (!trimmed) {
- throw new Error("Personal API key is required");
- }
- if (!Number.isFinite(projectId) || projectId <= 0) {
- throw new Error("Valid project ID is required");
- }
-
- const storedTokens = buildStoredTokens({
- accessToken: trimmed,
- refreshToken: "",
- expiresAt: Number.MAX_SAFE_INTEGER,
- cloudRegion: region,
- scopedTeams: [projectId],
- });
-
- await saveTokens(storedTokens);
-
- set({
- oauthAccessToken: trimmed,
- oauthRefreshToken: null,
- tokenExpiry: null,
- cloudRegion: region,
- projectId,
- scopedTeams: [projectId],
- isAuthenticated: true,
- });
-
- maybeRegisterPushToken();
- },
-
- refreshAccessToken: async () => {
- const state = get();
-
- if (!state.oauthRefreshToken || !state.cloudRegion) {
- throw new Error("No refresh token available");
- }
-
- const tokenResponse = await refreshAccessTokenRequest(
- state.oauthRefreshToken,
- state.cloudRegion,
- );
-
- const expiresAt = Date.now() + tokenResponse.expires_in * 1000;
- const scopedTeams = tokenResponse.scoped_teams ?? state.scopedTeams;
- const projectId = resolveActiveProjectId(scopedTeams, state.projectId);
-
- const storedTokens = buildStoredTokens({
- accessToken: tokenResponse.access_token,
- refreshToken: tokenResponse.refresh_token,
- expiresAt,
- cloudRegion: state.cloudRegion,
- scopedTeams,
- });
-
- // Save tokens securely
- await saveTokens(storedTokens);
-
- set({
- oauthAccessToken: tokenResponse.access_token,
- oauthRefreshToken: tokenResponse.refresh_token,
- tokenExpiry: expiresAt,
- projectId,
- scopedTeams,
- });
-
- get().scheduleTokenRefresh();
- },
-
- scheduleTokenRefresh: () => {
- const state = get();
-
- if (refreshTimeoutId) {
- clearTimeout(refreshTimeoutId);
- refreshTimeoutId = null;
- }
-
- // Personal API key sessions have no refresh token — nothing to schedule.
- if (!state.tokenExpiry || !state.oauthRefreshToken) {
- return;
- }
-
- const timeUntilRefresh =
- state.tokenExpiry - Date.now() - TOKEN_REFRESH_BUFFER_MS;
-
- if (timeUntilRefresh > 0) {
- refreshTimeoutId = setTimeout(() => {
- get()
- .refreshAccessToken()
- .catch((error) => {
- logger.error("Proactive token refresh failed:", error);
- });
- }, timeUntilRefresh);
- } else {
- get()
- .refreshAccessToken()
- .catch((error) => {
- logger.error("Immediate token refresh failed:", error);
- });
- }
- },
-
- initializeAuth: async () => {
- set({ isLoading: true });
-
- try {
- const tokens = await getTokens();
-
- if (!tokens) {
- set({ isLoading: false, isAuthenticated: false });
- return false;
- }
-
- if (tokens.scopeVersion !== OAUTH_SCOPE_VERSION) {
- await deleteTokens();
- queryClient.clear();
- set({ ...CLEARED_AUTH_STATE, isLoading: false });
- return false;
- }
-
- const now = Date.now();
- const isExpired = tokens.expiresAt <= now;
-
- const scopedTeams = tokens.scopedTeams ?? [];
- // `get().projectId` was rehydrated from persisted storage by the
- // persist middleware. Keep that selection if it's still in scope so
- // a user's chosen project survives relaunch.
- const projectId = resolveActiveProjectId(
- scopedTeams,
- get().projectId,
- );
-
- set({
- oauthAccessToken: tokens.accessToken,
- oauthRefreshToken: tokens.refreshToken,
- tokenExpiry: tokens.expiresAt,
- cloudRegion: tokens.cloudRegion,
- projectId,
- scopedTeams,
- });
-
- if (isExpired) {
- try {
- await get().refreshAccessToken();
- } catch (error) {
- if (isDeadRefreshToken(error)) {
- logger.error("Refresh token rejected on startup; signing out");
- await deleteTokens();
- queryClient.clear();
- set({ ...CLEARED_AUTH_STATE, isLoading: false });
- return false;
- }
- // Transient (network/server) or config failure: keep the stored
- // session so the next request's authedFetch retry can recover.
- logger.warn(
- "Token refresh failed transiently on startup; keeping session",
- error,
- );
- }
- }
-
- set({ isLoading: false, isAuthenticated: true });
- get().scheduleTokenRefresh();
- maybeRegisterPushToken();
- return true;
- } catch (error) {
- logger.error("Failed to initialize auth:", error);
- set({ isLoading: false, isAuthenticated: false });
- return false;
- }
- },
-
- logout: async () => {
- if (refreshTimeoutId) {
- clearTimeout(refreshTimeoutId);
- refreshTimeoutId = null;
- }
-
- // Delete push token from the backend before we drop credentials.
- await usePushTokenStore.getState().clear();
-
- await deleteTokens();
-
- // Clear React Query cache to prevent data leakage between sessions
- queryClient.clear();
-
- set(CLEARED_AUTH_STATE);
- },
- }),
- {
- name: "posthog-auth",
- storage: createJSONStorage(() => AsyncStorage),
- partialize: (state) => ({
- cloudRegion: state.cloudRegion,
- projectId: state.projectId,
- scopedTeams: state.scopedTeams,
- }),
- },
- ),
-);
diff --git a/products/desktop/apps/mobile/src/features/auth/types.ts b/products/desktop/apps/mobile/src/features/auth/types.ts
deleted file mode 100644
index 66a9ccd49cef..000000000000
--- a/products/desktop/apps/mobile/src/features/auth/types.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-export type CloudRegion = "us" | "eu" | "dev";
-
-export interface OAuthTokenResponse {
- access_token: string;
- expires_in: number;
- token_type: string;
- scope: string;
- refresh_token: string;
- scoped_teams?: number[];
- scoped_organizations?: string[];
-}
-
-export interface OAuthConfig {
- scopes: string[];
- cloudRegion: CloudRegion;
-}
-
-export interface StoredTokens {
- accessToken: string;
- refreshToken: string;
- expiresAt: number;
- cloudRegion: CloudRegion;
- scopedTeams?: number[];
- scopeVersion?: number;
-}
diff --git a/products/desktop/apps/mobile/src/features/chat/components/AgentMessage.test.tsx b/products/desktop/apps/mobile/src/features/chat/components/AgentMessage.test.tsx
deleted file mode 100644
index f71e0016756e..000000000000
--- a/products/desktop/apps/mobile/src/features/chat/components/AgentMessage.test.tsx
+++ /dev/null
@@ -1,68 +0,0 @@
-import { type ComponentProps, createElement } from "react";
-import { act, create, type ReactTestRenderer } from "react-test-renderer";
-import { describe, expect, it, vi } from "vitest";
-
-vi.mock("@posthog/core/sessions/thinkingActivities", () => ({
- pickThinkingActivity: () => "thinking",
-}));
-vi.mock("@/lib/theme", () => ({
- useThemeColors: () => ({ gray: {}, status: {} }),
-}));
-vi.mock("@/lib/format", () => ({ formatRelativeTime: () => "now" }));
-vi.mock("../hooks/usePeriodicRerender", () => ({
- usePeriodicRerender: () => {},
-}));
-vi.mock("./MarkdownText", () => ({ MarkdownText: () => null }));
-vi.mock("./ToolMessage", () => ({ ToolMessage: () => null }));
-vi.mock("./CopyButton", () => ({
- CopyButton: (props: Record<string, unknown>) =>
- createElement("CopyButton", props),
-}));
-vi.mock("./TurnFeedback", () => ({
- TurnFeedback: (props: Record<string, unknown>) =>
- createElement("TurnFeedback", props),
-}));
-
-import { AgentMessage } from "./AgentMessage";
-
-function render(props: ComponentProps<typeof AgentMessage>) {
- let renderer: ReactTestRenderer | null = null;
- act(() => {
- renderer = create(createElement(AgentMessage, props));
- });
- if (!renderer) throw new Error("Renderer not created");
- return renderer as ReactTestRenderer;
-}
-
-function hasTurnFeedback(renderer: ReactTestRenderer) {
- return (
- renderer.root.findAll((n) => String(n.type) === "TurnFeedback").length > 0
- );
-}
-
-describe("AgentMessage", () => {
- it("shows the thumbs on a completed agent turn", () => {
- const renderer = render({
- content: "A reply",
- timestamp: 1,
- turnId: "agent-0",
- taskId: "task-1",
- });
- expect(hasTurnFeedback(renderer)).toBe(true);
- });
-
- it("hides the thumbs while the turn is still streaming", () => {
- const renderer = render({
- content: "partial",
- isLoading: true,
- turnId: "agent-0",
- taskId: "task-1",
- });
- expect(hasTurnFeedback(renderer)).toBe(false);
- });
-
- it("hides the thumbs when there is no turn id", () => {
- const renderer = render({ content: "A reply", timestamp: 1 });
- expect(hasTurnFeedback(renderer)).toBe(false);
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/chat/components/AgentMessage.tsx b/products/desktop/apps/mobile/src/features/chat/components/AgentMessage.tsx
deleted file mode 100644
index 48c31cc4d37e..000000000000
--- a/products/desktop/apps/mobile/src/features/chat/components/AgentMessage.tsx
+++ /dev/null
@@ -1,144 +0,0 @@
-import { pickThinkingActivity } from "@posthog/core/sessions/thinkingActivities";
-import { Brain } from "phosphor-react-native";
-import { useState } from "react";
-import { Pressable, Text, View } from "react-native";
-import { formatRelativeTime } from "@/lib/format";
-import { useThemeColors } from "@/lib/theme";
-import { usePeriodicRerender } from "../hooks/usePeriodicRerender";
-import { CopyButton } from "./CopyButton";
-import { MarkdownText } from "./MarkdownText";
-import { ToolMessage } from "./ToolMessage";
-import { TurnFeedback } from "./TurnFeedback";
-
-interface AssistantToolCall {
- id: string;
- name: string;
- args: Record<string, unknown>;
- type: "tool_call";
-}
-
-interface AgentMessageProps {
- content: string;
- isLoading?: boolean;
- thinkingText?: string;
- toolCalls?: AssistantToolCall[];
- hasHumanMessageAfter?: boolean;
- onOpenTask?: (taskId: string) => void;
- timestamp?: number;
- turnId?: string;
- taskId?: string | null;
-}
-
-interface ReasoningBlockProps {
- content: string;
- isComplete: boolean;
-}
-
-function ReasoningBlock({ content, isComplete }: ReasoningBlockProps) {
- const [isExpanded, setIsExpanded] = useState(false);
- const themeColors = useThemeColors();
-
- if (!isComplete) {
- // Show thinking content
- return (
- <View className="px-4 py-0.5">
- <View className="flex-row items-start gap-2">
- <Brain size={12} color={themeColors.gray[9]} />
- <Text className="ml-1 font-mono text-[12px] text-gray-9 leading-4">
- {content}
- </Text>
- </View>
- </View>
- );
- }
-
- // Show collapsible "Thought" block
- return (
- <View className="px-4 py-0.5">
- <Pressable
- onPress={() => setIsExpanded(!isExpanded)}
- className="flex-row items-center gap-2"
- >
- <Brain size={12} color={themeColors.gray[9]} />
- <Text className="font-mono text-[13px] text-gray-12">Thought</Text>
- </Pressable>
- {isExpanded && (
- <Text className="my-2 ml-5 font-mono text-[12px] text-gray-9 leading-4">
- {content}
- </Text>
- )}
- </View>
- );
-}
-
-const THINKING_MESSAGE_INTERVAL_MS = 2000;
-
-export function AgentMessage({
- content,
- isLoading,
- thinkingText,
- toolCalls,
- hasHumanMessageAfter,
- onOpenTask,
- timestamp,
- turnId,
- taskId,
-}: AgentMessageProps) {
- usePeriodicRerender(isLoading ? THINKING_MESSAGE_INTERVAL_MS : 0);
-
- const hasContent = !!content;
- const isComplete = !isLoading && hasContent;
-
- return (
- <View className="py-2">
- {toolCalls && toolCalls.length > 0 && (
- <View className="mb-1">
- {toolCalls.map((tc) => (
- <ToolMessage
- key={tc.id}
- toolName={tc.name}
- status="completed"
- args={tc.args}
- hasHumanMessageAfter={hasHumanMessageAfter}
- onOpenTask={onOpenTask}
- />
- ))}
- </View>
- )}
-
- {/* Show reasoning/thinking block if available */}
- {thinkingText && (
- <ReasoningBlock content={thinkingText} isComplete={isComplete} />
- )}
-
- {/* Show loading state with random thinking message */}
- {isLoading && !content && !thinkingText && (
- <View className="max-w-[95%] px-4 py-1">
- <Text className="font-mono text-[13px] text-gray-9 italic">
- {pickThinkingActivity(Math.random())}...
- </Text>
- </View>
- )}
-
- {content && (
- <View className="max-w-[95%] px-4 py-1">
- <MarkdownText content={content} />
- </View>
- )}
-
- {!isLoading && (hasContent || timestamp) && (
- <View className="flex-row items-center gap-3 px-4 pt-1">
- {isComplete && <CopyButton text={content} label="Copy message" />}
- {isComplete && turnId && (
- <TurnFeedback turnId={turnId} taskId={taskId} />
- )}
- {timestamp && (
- <Text className="font-mono text-[10px] text-gray-8">
- {formatRelativeTime(timestamp)}
- </Text>
- )}
- </View>
- )}
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/chat/components/CopyButton.tsx b/products/desktop/apps/mobile/src/features/chat/components/CopyButton.tsx
deleted file mode 100644
index c5c428dc2081..000000000000
--- a/products/desktop/apps/mobile/src/features/chat/components/CopyButton.tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-import * as Haptics from "expo-haptics";
-import { Check, Copy } from "phosphor-react-native";
-import { useCallback } from "react";
-import { Pressable } from "react-native";
-import { useThemeColors } from "@/lib/theme";
-import { useCopy } from "../hooks/useCopy";
-
-interface CopyButtonProps {
- text: string;
- size?: number;
- label?: string;
-}
-
-export function CopyButton({ text, size = 14, label }: CopyButtonProps) {
- const themeColors = useThemeColors();
- const { copied, copy } = useCopy();
-
- const handlePress = useCallback(() => {
- copy(text, () => Haptics.selectionAsync());
- }, [copy, text]);
-
- return (
- <Pressable
- onPress={handlePress}
- hitSlop={8}
- accessibilityRole="button"
- accessibilityLabel={label ?? "Copy"}
- >
- {copied ? (
- <Check size={size} color={themeColors.status.success} />
- ) : (
- <Copy size={size} color={themeColors.gray[9]} />
- )}
- </Pressable>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/chat/components/GithubRefChip.test.tsx b/products/desktop/apps/mobile/src/features/chat/components/GithubRefChip.test.tsx
deleted file mode 100644
index 6a53234c909a..000000000000
--- a/products/desktop/apps/mobile/src/features/chat/components/GithubRefChip.test.tsx
+++ /dev/null
@@ -1,114 +0,0 @@
-import { createElement } from "react";
-import { act, create } from "react-test-renderer";
-import { describe, expect, it, vi } from "vitest";
-import type { PrStatus } from "../../tasks/hooks/usePrStatus";
-import { GithubRefChip } from "./GithubRefChip";
-
-vi.mock("@/lib/theme", () => ({
- useThemeColors: () => ({
- gray: { 11: "#444444" },
- status: { success: "#00aa00", error: "#cc0000" },
- }),
- toRgba: (hex: string, alpha: number) => `${hex}/${alpha}`,
- MERGED_COLOR: "#8e4ec6",
-}));
-
-vi.mock("@/lib/openExternalUrl", () => ({ openExternalUrl: vi.fn() }));
-
-vi.mock("../../tasks/hooks/usePrStatus", () => ({ usePrStatus: vi.fn() }));
-
-import { usePrStatus } from "../../tasks/hooks/usePrStatus";
-
-const mockUsePrStatus = vi.mocked(usePrStatus);
-
-function setStatus(data: PrStatus | null | undefined) {
- mockUsePrStatus.mockReturnValue({ data } as ReturnType<typeof usePrStatus>);
-}
-
-const href = "https://github.com/a/b/pull/1";
-
-function render(props: Parameters<typeof GithubRefChip>[0]) {
- let renderer: ReturnType<typeof create> | null = null;
- act(() => {
- renderer = create(createElement(GithubRefChip, props));
- });
- if (!renderer) throw new Error("Renderer not created");
- return renderer as ReturnType<typeof create>;
-}
-
-function chip(renderer: ReturnType<typeof create>): {
- accessibilityLabel: string;
- color: string | undefined;
-} {
- const node = renderer.root.findAll(
- (n) => typeof n.props?.onPress === "function",
- )[0];
- return {
- accessibilityLabel: node.props.accessibilityLabel as string,
- color: (node.props.style as { color?: string } | undefined)?.color,
- };
-}
-
-const base: PrStatus = {
- state: "open",
- merged: false,
- draft: false,
- additions: 0,
- deletions: 0,
-};
-
-describe("GithubRefChip", () => {
- it.each([
- { name: "open", status: { ...base }, color: "#00aa00", state: "open" },
- {
- name: "draft",
- status: { ...base, draft: true },
- color: "#444444",
- state: "draft",
- },
- {
- name: "closed",
- status: { ...base, state: "closed" as const },
- color: "#cc0000",
- state: "closed",
- },
- {
- name: "merged",
- status: { ...base, state: "closed" as const, merged: true },
- color: "#8e4ec6",
- state: "merged",
- },
- ])("tints a $name PR and names its state", ({ status, color, state }) => {
- setStatus(status);
- const { accessibilityLabel, color: rendered } = chip(
- render({ href, kind: "pr", label: "a/b#1" }),
- );
- expect(rendered).toBe(color);
- expect(accessibilityLabel).toBe(`GitHub pull request a/b#1, ${state}`);
- });
-
- it.each([
- { name: "loading", data: undefined },
- { name: "unresolved (private/404/non-GitHub)", data: null },
- ])("falls back to a neutral, untinted PR chip when $name", ({ data }) => {
- setStatus(data);
- const { accessibilityLabel, color } = chip(
- render({ href, kind: "pr", label: "a/b#1" }),
- );
- expect(color).toBeUndefined();
- expect(accessibilityLabel).toBe("GitHub pull request a/b#1");
- });
-
- it("renders an issue as a neutral chip without fetching status", () => {
- const { accessibilityLabel, color } = chip(
- render({
- href: "https://github.com/a/b/issues/1",
- kind: "issue",
- label: "a/b#1",
- }),
- );
- expect(color).toBeUndefined();
- expect(accessibilityLabel).toBe("GitHub issue a/b#1");
- expect(mockUsePrStatus).not.toHaveBeenCalled();
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/chat/components/GithubRefChip.tsx b/products/desktop/apps/mobile/src/features/chat/components/GithubRefChip.tsx
deleted file mode 100644
index 91953cf6e5c7..000000000000
--- a/products/desktop/apps/mobile/src/features/chat/components/GithubRefChip.tsx
+++ /dev/null
@@ -1,99 +0,0 @@
-import {
- getPrVisualConfig,
- type PrVisualConfig,
-} from "@posthog/core/git-interaction/prStatus";
-import { Text } from "react-native";
-import { usePrStatus } from "@/features/tasks/hooks/usePrStatus";
-import { openExternalUrl } from "@/lib/openExternalUrl";
-import {
- MERGED_COLOR,
- type ThemeColors,
- toRgba,
- useThemeColors,
-} from "@/lib/theme";
-
-interface GithubRefChipProps {
- href: string;
- kind: "issue" | "pr";
- label: string;
-}
-
-function toneColor(color: PrVisualConfig["color"], theme: ThemeColors): string {
- switch (color) {
- case "green":
- return theme.status.success;
- case "red":
- return theme.status.error;
- case "purple":
- return MERGED_COLOR;
- default:
- return theme.gray[11];
- }
-}
-
-// Rendered as a plain <Text> so it can be embedded inline within markdown
-// paragraphs (RN does not allow <View> children inside <Text>). The icon
-// from the desktop chip is omitted for the same reason — visual distinction
-// comes from the chip background + monospace + accent color.
-export function GithubRefChip({ href, kind, label }: GithubRefChipProps) {
- if (kind === "pr") {
- return <GithubPrRefChip href={href} label={label} />;
- }
- return (
- <RefChip
- href={href}
- label={label}
- accessibilityLabel={`GitHub issue ${label}`}
- />
- );
-}
-
-// The PR's live lifecycle drives the chip's tint and its accessibility label,
-// since a phone has no hover card to carry the state. Unknown status (still
-// loading, private repo, or a failed request) falls back to the neutral chip.
-function GithubPrRefChip({ href, label }: { href: string; label: string }) {
- const { data: status } = usePrStatus(href);
- const themeColors = useThemeColors();
-
- const config = status
- ? getPrVisualConfig(status.state, status.merged, status.draft)
- : undefined;
- return (
- <RefChip
- href={href}
- label={label}
- accessibilityLabel={
- config
- ? `GitHub pull request ${label}, ${config.label.toLowerCase()}`
- : `GitHub pull request ${label}`
- }
- color={config ? toneColor(config.color, themeColors) : undefined}
- />
- );
-}
-
-function RefChip({
- href,
- label,
- accessibilityLabel,
- color,
-}: {
- href: string;
- label: string;
- accessibilityLabel: string;
- color?: string;
-}) {
- return (
- <Text
- onPress={() => openExternalUrl(href)}
- className="rounded-md bg-gray-3 px-1.5 py-0.5 font-mono text-[11px] text-accent-11"
- style={
- color ? { backgroundColor: toRgba(color, 0.12), color } : undefined
- }
- accessibilityRole="link"
- accessibilityLabel={accessibilityLabel}
- >
- {label}
- </Text>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/chat/components/HumanMessage.tsx b/products/desktop/apps/mobile/src/features/chat/components/HumanMessage.tsx
deleted file mode 100644
index 65561f8dc82a..000000000000
--- a/products/desktop/apps/mobile/src/features/chat/components/HumanMessage.tsx
+++ /dev/null
@@ -1,151 +0,0 @@
-import * as Clipboard from "expo-clipboard";
-import * as Haptics from "expo-haptics";
-import { LinearGradient } from "expo-linear-gradient";
-import { CaretDown, CaretUp, File as FileIcon } from "phosphor-react-native";
-import { type ReactNode, useCallback, useState } from "react";
-import {
- Alert,
- type LayoutChangeEvent,
- Pressable,
- Text,
- View,
-} from "react-native";
-import { formatRelativeTime } from "@/lib/format";
-import { toRgba, useThemeColors } from "@/lib/theme";
-import { MarkdownText } from "./MarkdownText";
-
-export interface HumanMessageAttachment {
- kind: "image" | "document";
- uri: string;
- fileName: string;
- mimeType?: string;
- // Bytes stored as a cloud run artifact rather than on this device. When set,
- // the preview must be resolved through a presigned URL — the raw `uri` points
- // at the sandbox filesystem and is not fetchable here.
- cloudArtifact?: { runId: string; artifactId: string };
-}
-
-interface HumanMessageProps {
- content: string;
- timestamp?: number;
- attachments?: HumanMessageAttachment[];
- // Lets a host (e.g. tasks) resolve cloud-backed image previews. Without one,
- // attachments render as plain file chips.
- renderAttachment?: (attachment: HumanMessageAttachment) => ReactNode;
-}
-
-export function MessageFileChip({ fileName }: { fileName: string }) {
- const themeColors = useThemeColors();
- return (
- <View className="flex-row items-center gap-2 self-start rounded-md border border-gray-6 bg-gray-3 px-2 py-1.5">
- <FileIcon size={14} color={themeColors.gray[11]} />
- <Text className="font-mono text-[12px] text-gray-12" numberOfLines={1}>
- {fileName}
- </Text>
- </View>
- );
-}
-
-const COLLAPSED_MAX_HEIGHT = 160;
-
-export function HumanMessage({
- content,
- timestamp,
- attachments,
- renderAttachment,
-}: HumanMessageProps) {
- const themeColors = useThemeColors();
- const [isExpanded, setIsExpanded] = useState(false);
- const [contentHeight, setContentHeight] = useState<number | null>(null);
-
- const isOverflowing =
- contentHeight !== null && contentHeight > COLLAPSED_MAX_HEIGHT;
- const collapse = isOverflowing && !isExpanded;
- const hasContent = content.trim().length > 0;
- const hasAttachments = (attachments?.length ?? 0) > 0;
-
- const handleLongPress = useCallback(() => {
- Clipboard.setStringAsync(content).then(() => {
- Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success);
- Alert.alert("Copied", "Message copied to clipboard.");
- });
- }, [content]);
-
- const handleLayout = useCallback((e: LayoutChangeEvent) => {
- setContentHeight(e.nativeEvent.layout.height);
- }, []);
-
- return (
- <View className="px-4 py-2">
- <Pressable onLongPress={handleLongPress} delayLongPress={400}>
- <View
- className="mt-3 border-l-2 bg-gray-2 py-2 pr-3 pl-3"
- style={{ borderColor: themeColors.accent[9] }}
- >
- {hasContent && (
- <View
- style={{
- maxHeight: collapse ? COLLAPSED_MAX_HEIGHT : undefined,
- overflow: "hidden",
- }}
- >
- <View onLayout={handleLayout}>
- <MarkdownText content={content} />
- </View>
- {collapse && (
- <LinearGradient
- pointerEvents="none"
- colors={[
- toRgba(themeColors.gray[2], 0),
- toRgba(themeColors.gray[2], 1),
- ]}
- style={{
- position: "absolute",
- left: 0,
- right: 0,
- bottom: 0,
- height: 48,
- }}
- />
- )}
- </View>
- )}
- {hasContent && isOverflowing && (
- <Pressable
- onPress={() => setIsExpanded((v) => !v)}
- hitSlop={6}
- className="mt-1 flex-row items-center gap-1 self-start"
- >
- {isExpanded ? (
- <CaretUp size={12} color={themeColors.accent[11]} />
- ) : (
- <CaretDown size={12} color={themeColors.accent[11]} />
- )}
- <Text className="text-[12px] text-accent-11">
- {isExpanded ? "Show less" : "Show more"}
- </Text>
- </Pressable>
- )}
- {hasAttachments && (
- <View className={hasContent ? "mt-2 gap-2" : "gap-2"}>
- {attachments?.map((att) => (
- <View key={`${att.uri}-${att.fileName}`}>
- {renderAttachment ? (
- renderAttachment(att)
- ) : (
- <MessageFileChip fileName={att.fileName} />
- )}
- </View>
- ))}
- </View>
- )}
- </View>
- </Pressable>
- {timestamp && (
- <Text className="mt-1 px-1 font-mono text-[10px] text-gray-8">
- {formatRelativeTime(timestamp)}
- </Text>
- )}
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/chat/components/MarkdownImage.test.tsx b/products/desktop/apps/mobile/src/features/chat/components/MarkdownImage.test.tsx
deleted file mode 100644
index 6de581471f95..000000000000
--- a/products/desktop/apps/mobile/src/features/chat/components/MarkdownImage.test.tsx
+++ /dev/null
@@ -1,72 +0,0 @@
-import { createElement } from "react";
-import { Image } from "react-native";
-import { act, create } from "react-test-renderer";
-import { beforeEach, describe, expect, it, vi } from "vitest";
-import { openExternalUrl } from "@/lib/openExternalUrl";
-import { MarkdownImage } from "./MarkdownImage";
-
-vi.mock("@/lib/openExternalUrl", () => ({ openExternalUrl: vi.fn() }));
-
-vi.mock("@/lib/theme", () => ({
- useThemeColors: () => ({ gray: { 9: "#777", 11: "#555" } }),
-}));
-
-vi.mock("phosphor-react-native", () => ({
- ArrowSquareOut: (props: Record<string, unknown>) =>
- createElement("ArrowSquareOut", props),
- ImageBroken: (props: Record<string, unknown>) =>
- createElement("ImageBroken", props),
-}));
-
-function render(props: {
- url: string;
- alt?: string;
- disableRemoteImages?: boolean;
-}) {
- let renderer: ReturnType<typeof create> | null = null;
- act(() => {
- renderer = create(createElement(MarkdownImage, props));
- });
- if (!renderer) throw new Error("Renderer not created");
- return renderer as ReturnType<typeof create>;
-}
-
-describe("MarkdownImage", () => {
- beforeEach(() => {
- vi.clearAllMocks();
- });
-
- it("fetches image size for remote images by default", () => {
- const getSize = vi.spyOn(Image, "getSize").mockImplementation(() => {});
- render({ url: "http://127.0.0.1/secret", alt: "x" });
- expect(getSize).toHaveBeenCalledWith(
- "http://127.0.0.1/secret",
- expect.any(Function),
- expect.any(Function),
- );
- });
-
- it("does not fetch remote images when disableRemoteImages is set", () => {
- const getSize = vi.spyOn(Image, "getSize").mockImplementation(() => {});
- const tree = JSON.stringify(
- render({
- url: "http://127.0.0.1/secret",
- alt: "sneaky",
- disableRemoteImages: true,
- }).toJSON(),
- );
- expect(getSize).not.toHaveBeenCalled();
- // Renders a tap-to-open placeholder that shows the alt text.
- expect(tree).toContain("sneaky");
- expect(openExternalUrl).not.toHaveBeenCalled();
- });
-
- it("still fetches non-remote images even when disableRemoteImages is set", () => {
- const getSize = vi.spyOn(Image, "getSize").mockImplementation(() => {});
- render({
- url: "data:image/png;base64,AAAA",
- disableRemoteImages: true,
- });
- expect(getSize).toHaveBeenCalled();
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/chat/components/MarkdownImage.tsx b/products/desktop/apps/mobile/src/features/chat/components/MarkdownImage.tsx
deleted file mode 100644
index 55537d302393..000000000000
--- a/products/desktop/apps/mobile/src/features/chat/components/MarkdownImage.tsx
+++ /dev/null
@@ -1,118 +0,0 @@
-import { ArrowSquareOut, ImageBroken } from "phosphor-react-native";
-import { useEffect, useState } from "react";
-import { ActivityIndicator, Image, Pressable, Text, View } from "react-native";
-import { openExternalUrl } from "@/lib/openExternalUrl";
-import { useThemeColors } from "@/lib/theme";
-
-interface MarkdownImageProps {
- url: string;
- alt?: string;
- // When true, remote (http/https) images are not fetched automatically.
- // Untrusted content (e.g. a generated artifact) could otherwise make the
- // device issue requests to arbitrary Internet or local-network URLs just by
- // being previewed. Instead we render a placeholder that only opens the image
- // externally on an explicit user tap.
- disableRemoteImages?: boolean;
-}
-
-type LoadState =
- | { status: "loading" }
- | { status: "loaded"; aspectRatio: number }
- | { status: "error" };
-
-const MAX_HEIGHT = 320;
-
-function isRemoteUrl(url: string): boolean {
- return url.startsWith("http://") || url.startsWith("https://");
-}
-
-export function MarkdownImage({
- url,
- alt,
- disableRemoteImages,
-}: MarkdownImageProps) {
- const themeColors = useThemeColors();
- const deferred = Boolean(disableRemoteImages) && isRemoteUrl(url);
- const [state, setState] = useState<LoadState>({ status: "loading" });
-
- useEffect(() => {
- if (deferred) return;
- let cancelled = false;
- setState({ status: "loading" });
- Image.getSize(
- url,
- (width, height) => {
- if (cancelled) return;
- const aspectRatio = height > 0 ? width / height : 1;
- setState({ status: "loaded", aspectRatio });
- },
- () => {
- if (cancelled) return;
- setState({ status: "error" });
- },
- );
- return () => {
- cancelled = true;
- };
- }, [url, deferred]);
-
- if (deferred) {
- return (
- <Pressable
- onPress={() => openExternalUrl(url)}
- accessibilityRole="button"
- accessibilityLabel={alt ? `Open image: ${alt}` : "Open image"}
- className="flex-row items-center gap-2 rounded-md border border-gray-6 bg-gray-2 px-3 py-2 active:opacity-70"
- >
- <ArrowSquareOut size={16} color={themeColors.gray[9]} />
- <Text className="flex-1 text-[12px] text-gray-11" numberOfLines={1}>
- {alt || "Tap to open image"}
- </Text>
- </Pressable>
- );
- }
-
- if (state.status === "error") {
- return (
- <View className="flex-row items-center gap-2 rounded-md border border-gray-6 bg-gray-2 px-3 py-2">
- <ImageBroken size={16} color={themeColors.gray[9]} />
- <Text className="flex-1 text-[12px] text-gray-10" numberOfLines={1}>
- {alt || "Failed to load image"}
- </Text>
- </View>
- );
- }
-
- if (state.status === "loading") {
- return (
- <View className="h-32 items-center justify-center rounded-md border border-gray-6 bg-gray-2">
- <ActivityIndicator size="small" color={themeColors.gray[9]} />
- </View>
- );
- }
-
- return (
- <Pressable
- onPress={() => openExternalUrl(url)}
- accessibilityRole="image"
- accessibilityLabel={alt || "Image"}
- className="active:opacity-80"
- >
- <Image
- source={{ uri: url }}
- resizeMode="contain"
- style={{
- width: "100%",
- aspectRatio: state.aspectRatio,
- maxHeight: MAX_HEIGHT,
- borderRadius: 6,
- }}
- />
- {alt ? (
- <Text className="mt-1 text-[11px] text-gray-9 italic" numberOfLines={2}>
- {alt}
- </Text>
- ) : null}
- </Pressable>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/chat/components/MarkdownText.test.tsx b/products/desktop/apps/mobile/src/features/chat/components/MarkdownText.test.tsx
deleted file mode 100644
index 901cdc3a7f02..000000000000
--- a/products/desktop/apps/mobile/src/features/chat/components/MarkdownText.test.tsx
+++ /dev/null
@@ -1,99 +0,0 @@
-import { createElement } from "react";
-import { act, create } from "react-test-renderer";
-import { describe, expect, it, vi } from "vitest";
-import { MarkdownText } from "./MarkdownText";
-
-vi.mock("./CopyButton", () => ({ CopyButton: () => null }));
-
-vi.mock("@/features/auth", () => ({
- useAuthStore: (selector: (state: { cloudRegion: null }) => unknown) =>
- selector({ cloudRegion: null }),
- getCloudUrlFromRegion: () => null,
-}));
-
-vi.mock("@/lib/theme", () => ({
- useThemeColors: () => ({
- gray: { 11: "#444444", 12: "#000000" },
- status: { success: "#00aa00", error: "#cc0000" },
- }),
- toRgba: (hex: string, alpha: number) => `${hex}/${alpha}`,
- MERGED_COLOR: "#8e4ec6",
-}));
-
-vi.mock("@/lib/openExternalUrl", () => ({ openExternalUrl: vi.fn() }));
-
-vi.mock("../../tasks/hooks/usePrStatus", () => ({
- usePrStatus: () => ({ data: undefined }),
-}));
-
-function renderTree(content: string): string {
- let renderer: ReturnType<typeof create> | null = null;
- act(() => {
- renderer = create(createElement(MarkdownText, { content }));
- });
- if (!renderer) throw new Error("Renderer not created");
- return JSON.stringify((renderer as ReturnType<typeof create>).toJSON());
-}
-
-describe("MarkdownText", () => {
- it.each([
- {
- name: "ordered list starting at 1",
- content: "1. Alpha\n2. Beta\n3. Gamma",
- present: ["1.", "2.", "3."],
- absent: ["•"],
- },
- {
- name: "ordered list starting above 1 preserves the source numbers",
- content: "3. Alpha\n4. Beta\n5. Gamma",
- present: ["3.", "4.", "5."],
- absent: ["1.", "2."],
- },
- {
- name: "unordered list uses bullets",
- content: "- Alpha\n- Beta",
- present: ["•"],
- absent: ["1."],
- },
- {
- name: "task list uses checkboxes",
- content: "- [ ] Alpha\n- [x] Beta",
- present: ["☐", "☑"],
- absent: ["•", "1."],
- },
- {
- name: "object tag renders its label without the raw markup",
- content: 'Check the <insight id="9pQx3">checkout funnel</insight> now',
- present: ["checkout funnel", "Check the", "now"],
- absent: ["<insight", "</insight"],
- },
- {
- name: "still-streaming object tag renders nothing",
- content: 'Loading <flag id="4',
- present: ["Loading"],
- absent: ["<flag"],
- },
- {
- name: "bare review-comment link labels the comment",
- content:
- "[https://github.com/o/r/pull/12#discussion_r99](https://github.com/o/r/pull/12#discussion_r99)",
- present: ["Comment on PR #12"],
- absent: ["o/r#12"],
- },
- {
- name: "review-comment link with explicit text keeps that text",
- content:
- "[see the review](https://github.com/o/r/pull/12#discussion_r99)",
- present: ["see the review"],
- absent: ["Comment on PR"],
- },
- ])("$name", ({ content, present, absent }) => {
- const tree = renderTree(content);
- for (const marker of present) {
- expect(tree).toContain(marker);
- }
- for (const marker of absent) {
- expect(tree).not.toContain(marker);
- }
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/chat/components/MarkdownText.tsx b/products/desktop/apps/mobile/src/features/chat/components/MarkdownText.tsx
deleted file mode 100644
index 7b8f262ce2e7..000000000000
--- a/products/desktop/apps/mobile/src/features/chat/components/MarkdownText.tsx
+++ /dev/null
@@ -1,674 +0,0 @@
-import { parseObjectTags } from "@posthog/core/inbox/objectTags";
-import { useMemo } from "react";
-import { ScrollView, Text, View } from "react-native";
-import { getCloudUrlFromRegion, useAuthStore } from "@/features/auth";
-import { UNIVERSAL_LINK_PREFIX } from "@/lib/deep-links";
-import { parseGithubIssueUrl } from "@/lib/githubIssueUrl";
-import { openExternalUrl } from "@/lib/openExternalUrl";
-import { type ParsePostHogUrlOptions, parsePostHogUrl } from "@/lib/posthogUrl";
-import { getColorForClass, highlightCode } from "@/lib/syntax-highlight";
-import { useThemeColors } from "@/lib/theme";
-import { CopyButton } from "./CopyButton";
-import { GithubRefChip } from "./GithubRefChip";
-import { MarkdownImage } from "./MarkdownImage";
-import { ObjectTagChip, ObjectTagPreviewProvider } from "./ObjectTagChip";
-import { PostHogRefChip } from "./PostHogRefChip";
-
-const IMAGE_LINE_PATTERN = /^!\[([^\]]*)\]\(([^)\s]+)\)\s*$/;
-const BARE_POSTHOG_REF_PATTERN =
- /(https?:\/\/(?:app\.posthog\.com|(?:us|eu)\.posthog\.com|code\.posthog\.com|(?:www\.)?posthog\.com|localhost(?::\d+)?)\/[^\s<>()\]]+|\/(?:insights|project|organization|settings|feature_flags|experiments|dashboard|dashboards|replay|session_replay|recordings|error_tracking|task|inbox)\b[^\s<>()\]]*)/g;
-
-interface MarkdownTextProps {
- content: string;
- // When true, remote images embedded in the markdown are not fetched
- // automatically. Set this for untrusted content (e.g. generated artifact
- // previews) so opening the preview can't make the device issue requests to
- // arbitrary URLs; images render as a tap-to-open placeholder instead.
- disableRemoteImages?: boolean;
-}
-
-function HighlightedCode({
- code,
- language,
-}: {
- code: string;
- language: string;
-}) {
- const themeColors = useThemeColors();
- const segments = useMemo(
- () => highlightCode(code, language),
- [code, language],
- );
-
- if (!segments) {
- return (
- <Text className="font-mono text-[12px] text-gray-12 leading-4" selectable>
- {code}
- </Text>
- );
- }
-
- return (
- <Text className="font-mono text-[12px] leading-4" selectable>
- {segments.map((segment, i) => (
- <Text
- key={`s-${i}-${segment.className ?? "p"}`}
- style={{
- color: getColorForClass(segment.className) ?? themeColors.gray[12],
- }}
- >
- {segment.text}
- </Text>
- ))}
- </Text>
- );
-}
-
-interface Block {
- type:
- | "paragraph"
- | "code"
- | "heading"
- | "list"
- | "table"
- | "blockquote"
- | "image"
- | "hr";
- content: string;
- language?: string;
- level?: number;
- items?: string[];
- ordered?: boolean;
- start?: number;
- rows?: string[][];
- url?: string;
- alt?: string;
-}
-
-function parseBlocks(text: string): Block[] {
- const lines = text.split("\n");
- const blocks: Block[] = [];
- let i = 0;
-
- while (i < lines.length) {
- const line = lines[i];
-
- // Code block
- if (line.startsWith("```")) {
- const language = line.slice(3).trim() || undefined;
- const codeLines: string[] = [];
- i++;
- while (i < lines.length && !lines[i].startsWith("```")) {
- codeLines.push(lines[i]);
- i++;
- }
- i++; // skip closing ```
- blocks.push({ type: "code", content: codeLines.join("\n"), language });
- continue;
- }
-
- // Image on its own line: ![alt](url)
- const imageMatch = line.match(IMAGE_LINE_PATTERN);
- if (imageMatch) {
- blocks.push({
- type: "image",
- content: "",
- alt: imageMatch[1],
- url: imageMatch[2],
- });
- i++;
- continue;
- }
-
- // Heading
- const headingMatch = line.match(/^(#{1,6})\s+(.+)$/);
- if (headingMatch) {
- blocks.push({
- type: "heading",
- content: headingMatch[2],
- level: headingMatch[1].length,
- });
- i++;
- continue;
- }
-
- // Horizontal rule (---, ***, ___ with optional spaces, 3+ chars)
- if (/^([-*_])\s*\1\s*\1[\s1]*$/.test(line)) {
- blocks.push({ type: "hr", content: "" });
- i++;
- continue;
- }
-
- // Blockquote (consecutive > lines)
- if (/^>\s?/.test(line)) {
- const quoteLines: string[] = [];
- while (i < lines.length && /^>\s?/.test(lines[i])) {
- quoteLines.push(lines[i].replace(/^>\s?/, ""));
- i++;
- }
- blocks.push({ type: "blockquote", content: quoteLines.join("\n") });
- continue;
- }
-
- // Unordered list (consecutive - or * lines)
- if (/^\s*[-*]\s/.test(line)) {
- const items: string[] = [];
- while (i < lines.length && /^\s*[-*]\s/.test(lines[i])) {
- items.push(lines[i].replace(/^\s*[-*]\s+/, ""));
- i++;
- }
- blocks.push({ type: "list", content: "", items });
- continue;
- }
-
- // Ordered list (consecutive 1. 2. lines)
- const orderedMatch = line.match(/^\s*(\d+)[.)]\s/);
- if (orderedMatch) {
- const items: string[] = [];
- while (i < lines.length && /^\s*\d+[.)]\s/.test(lines[i])) {
- items.push(lines[i].replace(/^\s*\d+[.)]\s+/, ""));
- i++;
- }
- blocks.push({
- type: "list",
- content: "",
- items,
- ordered: true,
- start: Number(orderedMatch[1]),
- });
- continue;
- }
-
- // Table: lines with pipes, second line is separator (|---|---|)
- if (
- line.includes("|") &&
- i + 1 < lines.length &&
- /^\s*\|?[\s-:|]+\|/.test(lines[i + 1])
- ) {
- const rows: string[][] = [];
- while (i < lines.length && lines[i].includes("|")) {
- const row = lines[i]
- .replace(/^\s*\|/, "")
- .replace(/\|\s*$/, "")
- .split("|")
- .map((cell) => cell.trim());
- // Skip the separator row
- if (!/^[\s-:|]+$/.test(lines[i].replace(/\|/g, ""))) {
- rows.push(row);
- }
- i++;
- }
- if (rows.length > 0) {
- blocks.push({ type: "table", content: "", rows });
- }
- continue;
- }
-
- // Empty line
- if (line.trim() === "") {
- i++;
- continue;
- }
-
- // Paragraph: collect consecutive non-special lines
- const paraLines: string[] = [];
- while (
- i < lines.length &&
- lines[i].trim() !== "" &&
- !lines[i].startsWith("```") &&
- !lines[i].match(/^#{1,6}\s/) &&
- !IMAGE_LINE_PATTERN.test(lines[i]) &&
- !/^\s*[-*]\s/.test(lines[i]) &&
- !/^\s*\d+[.)]\s/.test(lines[i]) &&
- !/^>\s?/.test(lines[i]) &&
- !/^([-*_])\s*\1\s*\1[\s1]*$/.test(lines[i]) &&
- !(
- lines[i].includes("|") &&
- i + 1 < lines.length &&
- /^\s*\|?[\s-:|]+\|/.test(lines[i + 1])
- )
- ) {
- paraLines.push(lines[i]);
- i++;
- }
- if (paraLines.length > 0) {
- blocks.push({ type: "paragraph", content: paraLines.join("\n") });
- }
- }
-
- return blocks;
-}
-
-function openUrl(url: string) {
- openExternalUrl(url);
-}
-
-function splitTrailingPunctuation(text: string): {
- reference: string;
- trailing: string;
-} {
- const reference = text.replace(/[.,!?;:]+$/u, "");
- return {
- reference,
- trailing: text.slice(reference.length),
- };
-}
-
-function renderPlainText(
- text: string,
- posthogUrlOptions: ParsePostHogUrlOptions,
- keyBase: string,
-): React.ReactNode[] {
- const nodes: React.ReactNode[] = [];
- for (const [i, segment] of parseObjectTags(text).entries()) {
- const key = `${keyBase}-${i}`;
- if (segment.type === "tag") {
- nodes.push(<ObjectTagChip key={key} tag={segment.ref} />);
- } else {
- nodes.push(...renderUrlText(segment.value, posthogUrlOptions, key));
- }
- }
- return nodes;
-}
-
-function renderUrlText(
- text: string,
- posthogUrlOptions: ParsePostHogUrlOptions,
- keyBase: string,
-): React.ReactNode[] {
- const nodes: React.ReactNode[] = [];
- let lastIndex = 0;
- let match: RegExpExecArray | null = null;
-
- BARE_POSTHOG_REF_PATTERN.lastIndex = 0;
-
- // biome-ignore lint/suspicious/noAssignInExpressions: regex exec loop
- while ((match = BARE_POSTHOG_REF_PATTERN.exec(text)) !== null) {
- if (match.index > lastIndex) {
- nodes.push(text.slice(lastIndex, match.index));
- }
-
- const candidate = match[0];
- const { reference, trailing } = splitTrailingPunctuation(candidate);
- const posthogRef = parsePostHogUrl(reference, posthogUrlOptions);
-
- if (posthogRef) {
- nodes.push(
- <PostHogRefChip
- key={`${keyBase}-${match.index}`}
- href={posthogRef.normalizedUrl}
- kind={posthogRef.kind}
- label={posthogRef.defaultLabel}
- />,
- );
-
- if (trailing) {
- nodes.push(trailing);
- }
- } else {
- nodes.push(candidate);
- }
-
- lastIndex = match.index + candidate.length;
- }
-
- if (lastIndex < text.length) {
- nodes.push(text.slice(lastIndex));
- }
-
- return nodes.length > 0 ? nodes : [text];
-}
-
-function formatPostHogChipLabel(
- posthogRef: ReturnType<typeof parsePostHogUrl>,
- linkText: string,
- url: string,
-): string {
- if (!posthogRef) return linkText;
- if (linkText === url) return posthogRef.defaultLabel;
-
- const normalizedLinkText = linkText.trim();
- if (!posthogRef.refId) return normalizedLinkText;
- if (normalizedLinkText.endsWith(`(${posthogRef.refId})`)) {
- return normalizedLinkText;
- }
-
- return `${normalizedLinkText} (${posthogRef.refId})`;
-}
-
-function renderInline(
- text: string,
- posthogUrlOptions: ParsePostHogUrlOptions,
-): React.ReactNode[] {
- const nodes: React.ReactNode[] = [];
- // Links must come first to avoid bold/italic consuming text inside [].
- // Order after links: strikethrough, bold, italic, inline code.
- const pattern =
- /(\[([^\]]+)\]\(([^)]+)\)|~~(.+?)~~|\*\*(.+?)\*\*|\*(.+?)\*|`([^`]+)`)/g;
- let lastIndex = 0;
- let match: RegExpExecArray | null = null;
-
- // biome-ignore lint/suspicious/noAssignInExpressions: regex exec loop
- while ((match = pattern.exec(text)) !== null) {
- if (match.index > lastIndex) {
- nodes.push(
- ...renderPlainText(
- text.slice(lastIndex, match.index),
- posthogUrlOptions,
- `plain-${match.index}`,
- ),
- );
- }
-
- if (match[2] && match[3]) {
- // Link: [text](url)
- const linkText = match[2];
- const url = match[3];
- const githubRef = parseGithubIssueUrl(url);
- if (githubRef) {
- const isAutoLink = linkText === url;
- const autoLinkLabel = githubRef.isReviewComment
- ? `Comment on PR #${githubRef.number}`
- : `${githubRef.owner}/${githubRef.repo}#${githubRef.number}`;
- const label = isAutoLink ? autoLinkLabel : linkText;
- nodes.push(
- <GithubRefChip
- key={match.index}
- href={githubRef.normalizedUrl}
- kind={githubRef.kind}
- label={label}
- />,
- );
- } else {
- const posthogRef = parsePostHogUrl(url, posthogUrlOptions);
- if (posthogRef) {
- nodes.push(
- <PostHogRefChip
- key={match.index}
- href={posthogRef.normalizedUrl}
- kind={posthogRef.kind}
- label={formatPostHogChipLabel(posthogRef, linkText, url)}
- />,
- );
- } else {
- nodes.push(
- <Text
- key={match.index}
- className="text-accent-11 underline"
- onPress={() => openUrl(url)}
- >
- {linkText}
- <Text className="text-accent-11">{" ↗"}</Text>
- </Text>,
- );
- }
- }
- } else if (match[4]) {
- // Strikethrough: ~~text~~
- nodes.push(
- <Text key={match.index} className="text-gray-9 line-through">
- {match[4]}
- </Text>,
- );
- } else if (match[5]) {
- // Bold
- nodes.push(
- <Text key={match.index} className="font-bold text-accent-11">
- {match[5]}
- </Text>,
- );
- } else if (match[6]) {
- // Italic
- nodes.push(
- <Text key={match.index} className="italic">
- {match[6]}
- </Text>,
- );
- } else if (match[7]) {
- // Inline code
- nodes.push(
- <Text
- key={match.index}
- className="rounded bg-gray-4 px-1 font-mono text-[12px] text-accent-11"
- >
- {match[7]}
- </Text>,
- );
- }
-
- lastIndex = match.index + match[0].length;
- }
-
- if (lastIndex < text.length) {
- nodes.push(
- ...renderPlainText(
- text.slice(lastIndex),
- posthogUrlOptions,
- `plain-tail-${lastIndex}`,
- ),
- );
- }
-
- return nodes.length > 0 ? nodes : [text];
-}
-
-export function MarkdownText({
- content,
- disableRemoteImages,
-}: MarkdownTextProps) {
- const blocks = parseBlocks(content);
- const cloudRegion = useAuthStore((state) => state.cloudRegion);
- const posthogUrlOptions = useMemo<ParsePostHogUrlOptions>(
- () => ({
- appBaseUrl: cloudRegion ? getCloudUrlFromRegion(cloudRegion) : null,
- codeBaseUrl: UNIVERSAL_LINK_PREFIX,
- }),
- [cloudRegion],
- );
-
- const rendered = (
- <View style={{ gap: 8 }}>
- {blocks.map((block, i) => {
- const key = `block-${i}`;
-
- switch (block.type) {
- case "code":
- return (
- <View
- key={key}
- className="rounded-md border border-gray-6 bg-gray-3"
- >
- <View className="flex-row items-center justify-between border-gray-6 border-b px-3 py-1">
- <Text className="font-mono text-[10px] text-gray-9">
- {block.language}
- </Text>
- <CopyButton
- text={block.content}
- size={13}
- label="Copy code"
- />
- </View>
- <View className="px-3 py-2">
- {block.language ? (
- <HighlightedCode
- code={block.content}
- language={block.language}
- />
- ) : (
- <Text
- className="font-mono text-[12px] text-gray-12 leading-4"
- selectable
- >
- {block.content}
- </Text>
- )}
- </View>
- </View>
- );
-
- case "heading":
- return (
- <Text
- key={key}
- className={`font-bold text-accent-11 ${
- block.level === 1
- ? "text-[16px]"
- : block.level === 2
- ? "text-[14px]"
- : "text-[13px]"
- }`}
- >
- {renderInline(block.content, posthogUrlOptions)}
- </Text>
- );
-
- case "list":
- return (
- <View key={key} style={{ gap: 4 }}>
- {block.items?.map((item, idx) => {
- const taskMatch = !block.ordered
- ? item.match(/^\[([ xX])\]\s+(.*)$/)
- : null;
- const isTask = taskMatch !== null;
- const isChecked = isTask && /[xX]/.test(taskMatch[1]);
- const itemText = isTask ? taskMatch[2] : item;
- return (
- <View
- key={`${key}-${idx}-${item}`}
- className="flex-row items-start pl-2"
- >
- {isTask ? (
- <Text
- className={`mr-2 font-mono text-[13px] ${
- isChecked ? "text-accent-11" : "text-gray-9"
- }`}
- >
- {isChecked ? "☑" : "☐"}
- </Text>
- ) : (
- <Text className="mr-2 text-[13px] text-gray-9">
- {block.ordered ? `${(block.start ?? 1) + idx}.` : "•"}
- </Text>
- )}
- <Text
- className={`flex-1 text-[13px] leading-5 ${
- isTask && isChecked
- ? "text-gray-10 line-through"
- : "text-gray-12"
- }`}
- >
- {renderInline(itemText, posthogUrlOptions)}
- </Text>
- </View>
- );
- })}
- </View>
- );
-
- case "table": {
- const rows = block.rows ?? [];
- const header = rows[0];
- const body = rows.slice(1);
- return (
- <ScrollView
- key={key}
- horizontal
- showsHorizontalScrollIndicator={false}
- >
- <View className="overflow-hidden rounded-md border border-gray-6">
- {header && (
- <View className="flex-row bg-gray-3">
- {header.map((cell, col) => {
- const colKey = `${key}-h${col}-${cell}`;
- return (
- <View
- key={colKey}
- className="border-gray-6 px-3 py-1.5"
- style={
- col > 0
- ? {
- borderLeftWidth: 1,
- borderLeftColor: "#3333",
- }
- : undefined
- }
- >
- <Text className="font-bold text-[12px] text-gray-12">
- {renderInline(cell, posthogUrlOptions)}
- </Text>
- </View>
- );
- })}
- </View>
- )}
- {body.map((row, ri) => {
- const rowKey = `${key}-r${ri}`;
- return (
- <View
- key={rowKey}
- className="flex-row border-gray-6 border-t"
- >
- {row.map((cell, col) => {
- const cellKey = `${rowKey}-c${col}-${cell}`;
- return (
- <View
- key={cellKey}
- className="px-3 py-1.5"
- style={
- col > 0
- ? {
- borderLeftWidth: 1,
- borderLeftColor: "#3333",
- }
- : undefined
- }
- >
- <Text className="text-[12px] text-gray-12">
- {renderInline(cell, posthogUrlOptions)}
- </Text>
- </View>
- );
- })}
- </View>
- );
- })}
- </View>
- </ScrollView>
- );
- }
-
- case "blockquote":
- return (
- <View key={key} className="border-accent-6 border-l-2 pl-3">
- <Text className="text-[13px] text-gray-11 italic leading-5">
- {renderInline(block.content, posthogUrlOptions)}
- </Text>
- </View>
- );
-
- case "image":
- return block.url ? (
- <MarkdownImage
- key={key}
- url={block.url}
- alt={block.alt}
- disableRemoteImages={disableRemoteImages}
- />
- ) : null;
-
- case "hr":
- return <View key={key} className="my-1 h-px bg-gray-6" />;
-
- default:
- return (
- <Text key={key} className="text-[13px] text-gray-12 leading-5">
- {renderInline(block.content, posthogUrlOptions)}
- </Text>
- );
- }
- })}
- </View>
- );
-
- return <ObjectTagPreviewProvider>{rendered}</ObjectTagPreviewProvider>;
-}
diff --git a/products/desktop/apps/mobile/src/features/chat/components/ObjectTagChip.tsx b/products/desktop/apps/mobile/src/features/chat/components/ObjectTagChip.tsx
deleted file mode 100644
index 15ae24159cb8..000000000000
--- a/products/desktop/apps/mobile/src/features/chat/components/ObjectTagChip.tsx
+++ /dev/null
@@ -1,184 +0,0 @@
-import type { EvidencePreview } from "@posthog/api-client/evidence-previews";
-import {
- getObjectKind,
- type ObjectTagRef,
- objectWebPath,
-} from "@posthog/core/inbox/objectTags";
-import { useQuery } from "@tanstack/react-query";
-import {
- Bug,
- ChartLine,
- ChatCircleText,
- ClipboardText,
- CursorClick,
- Database,
- Flag,
- Flask,
- type Icon,
- Lightning,
- PlayCircle,
- Pulse,
- ShieldCheck,
- Sparkle,
- SquaresFour,
- Tray,
- User,
- UsersThree,
-} from "phosphor-react-native";
-import { createContext, type ReactNode, useContext, useState } from "react";
-import { ActivityIndicator, Pressable, Text, View } from "react-native";
-import { SheetContainer } from "@/components/SheetContainer";
-import { getCloudUrlFromRegion, useAuthStore } from "@/features/auth";
-import { openExternalUrl } from "@/lib/openExternalUrl";
-import { getPostHogApiClient } from "@/lib/posthogApiClient";
-import { useThemeColors } from "@/lib/theme";
-
-const KIND_ICONS: Record<string, Icon> = {
- insight: ChartLine,
- hogql: Database,
- dashboard: SquaresFour,
- error: Bug,
- replay: PlayCircle,
- flag: Flag,
- experiment: Flask,
- survey: ClipboardText,
- ticket: ChatCircleText,
- report: Tray,
- trace: Sparkle,
- eval: ShieldCheck,
- event: Lightning,
- cohort: UsersThree,
- action: CursorClick,
- person: User,
-};
-
-const ObjectTagContext = createContext<(tag: ObjectTagRef) => void>(() => {});
-
-function useObjectPreviewUrl(kind: string, id: string): string | null {
- const cloudRegion = useAuthStore((state) => state.cloudRegion);
- const projectId = useAuthStore((state) => state.projectId);
- const path = objectWebPath(kind, id);
- if (!path || !cloudRegion || !projectId) return null;
- return `${getCloudUrlFromRegion(cloudRegion)}/project/${projectId}${path}`;
-}
-
-function ObjectPreviewSheet({
- tag,
- onClose,
-}: {
- tag: ObjectTagRef;
- onClose: () => void;
-}) {
- const themeColors = useThemeColors();
- const meta = getObjectKind(tag.kind);
- const KindIcon = KIND_ICONS[tag.kind] ?? Pulse;
-
- const { data, isLoading } = useQuery<EvidencePreview | null>({
- queryKey: ["evidence-preview", tag.kind, tag.id],
- staleTime: 5 * 60 * 1000,
- retry: 1,
- queryFn: () => getPostHogApiClient().getEvidencePreview(tag.kind, tag.id),
- });
-
- const url = useObjectPreviewUrl(tag.kind, data?.resolvedId ?? tag.id);
-
- return (
- <SheetContainer open onClose={onClose}>
- <View className="gap-3 px-5 pt-2">
- <View className="flex-row items-center gap-1.5">
- <KindIcon size={13} color={themeColors.gray[9]} />
- <Text className="font-mono text-[11px] text-gray-9 uppercase tracking-wide">
- {meta.kindLabel}
- </Text>
- <Text className="ml-auto text-[11px] text-gray-9">{meta.source}</Text>
- </View>
-
- {isLoading ? (
- <ActivityIndicator color={themeColors.gray[9]} />
- ) : (
- <View className="gap-2">
- <Text className="font-semibold text-[15px] text-gray-12 leading-snug">
- {data?.title ?? tag.label}
- </Text>
- {data?.detail && (
- <Text className="text-[12px] text-gray-10 leading-snug">
- {data.detail}
- </Text>
- )}
- {data?.facts && data.facts.length > 0 && (
- <View className="flex-row flex-wrap gap-1.5">
- {data.facts.map((fact) => (
- <Text
- key={fact}
- className="rounded bg-gray-3 px-1.5 py-0.5 text-[11px] text-gray-11"
- >
- {fact}
- </Text>
- ))}
- </View>
- )}
- {tag.kind === "hogql" && (
- <Text className="rounded bg-gray-3 p-2 font-mono text-[11px] text-gray-11 leading-4">
- {tag.id}
- </Text>
- )}
- </View>
- )}
-
- {url && (
- <Pressable
- onPress={() => openExternalUrl(url)}
- className="mt-1 self-start rounded-md bg-gray-3 px-3 py-1.5"
- accessibilityRole="button"
- >
- <Text className="text-[12px] text-accent-11">
- Open in PostHog ↗
- </Text>
- </Pressable>
- )}
- </View>
- </SheetContainer>
- );
-}
-
-/**
- * Holds the single preview sheet for a message. The sheet is a Modal, so it
- * cannot render from inside a chip (chips live inside a paragraph `Text`);
- * chips open it through context instead.
- */
-export function ObjectTagPreviewProvider({
- children,
-}: {
- children: ReactNode;
-}) {
- const [active, setActive] = useState<ObjectTagRef | null>(null);
- return (
- <ObjectTagContext.Provider value={setActive}>
- {children}
- {active && (
- <ObjectPreviewSheet tag={active} onClose={() => setActive(null)} />
- )}
- </ObjectTagContext.Provider>
- );
-}
-
-/**
- * Inline reference to a PostHog object in an agent message, authored as a
- * `<kind id="...">label</kind>` tag. Tapping opens a sheet that resolves the
- * object's live name and status. Previews fetch only on tap, so a message full
- * of references never fans out concurrent authenticated queries.
- */
-export function ObjectTagChip({ tag }: { tag: ObjectTagRef }) {
- const openPreview = useContext(ObjectTagContext);
- const meta = getObjectKind(tag.kind);
- return (
- <Text
- onPress={() => openPreview(tag)}
- className="rounded-md bg-gray-3 px-1.5 py-0.5 text-[12px] text-gray-12"
- accessibilityRole="button"
- accessibilityLabel={`${meta.kindLabel}: ${tag.label}`}
- >
- {tag.label}
- </Text>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/chat/components/PostHogRefChip.tsx b/products/desktop/apps/mobile/src/features/chat/components/PostHogRefChip.tsx
deleted file mode 100644
index 9da4a236aa4a..000000000000
--- a/products/desktop/apps/mobile/src/features/chat/components/PostHogRefChip.tsx
+++ /dev/null
@@ -1,31 +0,0 @@
-import { Text } from "react-native";
-import { openExternalUrl } from "@/lib/openExternalUrl";
-import type { PostHogRefKind } from "@/lib/posthogUrl";
-
-interface PostHogRefChipProps {
- href: string;
- kind: PostHogRefKind;
- label: string;
-}
-
-export function PostHogRefChip({ href, kind, label }: PostHogRefChipProps) {
- const destination =
- kind === "docs"
- ? "docs"
- : kind === "code"
- ? "Code"
- : kind === "website"
- ? "website"
- : "app";
-
- return (
- <Text
- onPress={() => openExternalUrl(href)}
- className="rounded-md bg-gray-3 px-1.5 py-0.5 font-mono text-[11px] text-accent-11"
- accessibilityRole="link"
- accessibilityLabel={`PostHog ${destination} link ${label}`}
- >
- {label}
- </Text>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/chat/components/ToolMessage.test.tsx b/products/desktop/apps/mobile/src/features/chat/components/ToolMessage.test.tsx
deleted file mode 100644
index 6c7b5f6f64b5..000000000000
--- a/products/desktop/apps/mobile/src/features/chat/components/ToolMessage.test.tsx
+++ /dev/null
@@ -1,77 +0,0 @@
-import { createElement } from "react";
-import { act, create } from "react-test-renderer";
-import { describe, expect, it, vi } from "vitest";
-import { ToolMessage, type ToolMessageProps } from "./ToolMessage";
-
-vi.mock("expo-router", () => ({ useRouter: () => ({ push: vi.fn() }) }));
-
-vi.mock("@/features/mcp/components/McpAppHost", () => ({
- McpAppHost: () => null,
-}));
-
-vi.mock("@/lib/syntax-highlight", () => ({
- getColorForClass: () => null,
- highlightCode: () => null,
- languageFromPath: () => null,
-}));
-
-vi.mock("@/lib/theme", () => ({
- useThemeColors: () => ({
- gray: { 8: "#888888", 9: "#999999", 11: "#bbbbbb", 12: "#cccccc" },
- accent: { 3: "#eef", 9: "#3366ff", contrast: "#ffffff" },
- status: { success: "#00aa00", error: "#cc0000" },
- }),
-}));
-
-function render(props: ToolMessageProps) {
- let renderer: ReturnType<typeof create> | null = null;
- act(() => {
- renderer = create(createElement(ToolMessage, props));
- });
- if (!renderer) throw new Error("Renderer not created");
- return renderer as ReturnType<typeof create>;
-}
-
-function expand(renderer: ReturnType<typeof create>) {
- const pressable = renderer.root.findAll(
- (n) => typeof n.props?.onPress === "function",
- )[0];
- act(() => {
- pressable.props.onPress();
- });
-}
-
-function tree(renderer: ReturnType<typeof create>): string {
- return JSON.stringify(renderer.toJSON());
-}
-
-const ERROR_OUTPUT = "Error: query failed: invalid HogQL syntax near token";
-
-const base: ToolMessageProps = {
- toolName: "exec",
- rawToolName: "mcp__posthog__exec",
- status: "error",
- args: { command: "call query-run {}" },
- result: ERROR_OUTPUT,
-};
-
-describe("ToolMessage posthog-exec error reason", () => {
- it("hides output in the collapsed state for a failed call", () => {
- const renderer = render(base);
- expect(tree(renderer)).not.toContain(ERROR_OUTPUT);
- });
-
- it.each<[ToolMessageProps["status"], boolean]>([
- ["error", true],
- ["completed", true],
- ["running", false],
- ])("status=%s → output visible after expand: %s", (status, expectVisible) => {
- const renderer = render({ ...base, status });
- expand(renderer);
- if (expectVisible) {
- expect(tree(renderer)).toContain(ERROR_OUTPUT);
- } else {
- expect(tree(renderer)).not.toContain(ERROR_OUTPUT);
- }
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/chat/components/ToolMessage.tsx b/products/desktop/apps/mobile/src/features/chat/components/ToolMessage.tsx
deleted file mode 100644
index 2555a211e1b4..000000000000
--- a/products/desktop/apps/mobile/src/features/chat/components/ToolMessage.tsx
+++ /dev/null
@@ -1,1230 +0,0 @@
-import {
- formatPosthogExecBody,
- getPostHogExecDisplay,
- isPostHogExecTool,
-} from "@posthog/core/sessions/posthogExecDisplay";
-import { parseMcpToolName } from "@posthog/shared";
-import { useRouter } from "expo-router";
-import {
- ArrowsClockwise,
- Brain,
- FileText,
- GitBranch,
- Globe,
- type IconProps,
- ListChecks,
- MagnifyingGlass,
- PencilSimple,
- Play,
- Terminal,
- Trash,
- Wrench,
-} from "phosphor-react-native";
-import { useMemo, useState } from "react";
-import {
- ActivityIndicator,
- Pressable,
- Text,
- TouchableOpacity,
- View,
-} from "react-native";
-import { McpAppHost } from "@/features/mcp/components/McpAppHost";
-import {
- getColorForClass,
- highlightCode,
- languageFromPath,
-} from "@/lib/syntax-highlight";
-import { useThemeColors } from "@/lib/theme";
-
-export type ToolStatus = "pending" | "running" | "completed" | "error";
-export type ToolKind =
- | "read"
- | "edit"
- | "delete"
- | "move"
- | "search"
- | "execute"
- | "think"
- | "fetch"
- | "switch_mode"
- | "create_task"
- | "other";
-
-type PhosphorIcon = React.ComponentType<IconProps>;
-
-const kindIcons: Record<ToolKind, PhosphorIcon> = {
- read: FileText,
- edit: PencilSimple,
- delete: Trash,
- move: FileText,
- search: MagnifyingGlass,
- execute: Terminal,
- think: Brain,
- fetch: Globe,
- switch_mode: ArrowsClockwise,
- create_task: ListChecks,
- other: Wrench,
-};
-
-const POSTHOG_EXEC_INPUT_PREVIEW_MAX_LENGTH = 120;
-
-export function deriveToolKind(toolName: string): ToolKind {
- // Agent titles can include file paths, e.g. "Edit `src/foo.ts`" or
- // "Read 200 lines in `bar.ts`", so match on prefix / keyword.
- const name = toolName.toLowerCase();
- if (name.startsWith("read") || name === "read_file") return "read";
- if (
- name.startsWith("edit") ||
- name.startsWith("write") ||
- name.startsWith("multiedit") ||
- name.startsWith("multi_edit") ||
- name === "search_replace"
- )
- return "edit";
- if (name.startsWith("delete")) return "delete";
- if (
- name.startsWith("grep") ||
- name.startsWith("search") ||
- name.startsWith("glob") ||
- name.startsWith("find") ||
- name.startsWith("list")
- )
- return "search";
- if (
- name.startsWith("bash") ||
- name.startsWith("execute") ||
- name.startsWith("terminal")
- )
- return "execute";
- if (name.startsWith("think")) return "think";
- if (name.startsWith("webfetch") || name.startsWith("fetch")) return "fetch";
- if (name === "create_task") return "create_task";
- return "other";
-}
-
-export function getToolSubtitle(
- toolName: string,
- args?: Record<string, unknown>,
-): string | null {
- if (!args) return null;
- const kind = deriveToolKind(toolName);
-
- switch (kind) {
- case "read":
- case "edit":
- case "delete":
- case "move":
- if (typeof args.file_path === "string")
- return shortenPath(args.file_path);
- if (typeof args.target_file === "string")
- return shortenPath(args.target_file);
- return null;
- case "search":
- if (typeof args.pattern === "string") return `"${args.pattern}"`;
- return null;
- case "execute":
- if (typeof args.command === "string")
- return args.command.length > 60
- ? `${args.command.slice(0, 60)}...`
- : args.command;
- return null;
- case "fetch":
- if (typeof args.url === "string")
- return args.url.length > 60 ? `${args.url.slice(0, 60)}...` : args.url;
- return null;
- case "think":
- if (typeof args.content === "string")
- return args.content.length > 60
- ? `${args.content.slice(0, 60)}...`
- : args.content;
- return null;
- default:
- return null;
- }
-}
-
-interface CreateTaskArgs {
- title?: string;
- description?: string;
- repository?: string;
-}
-
-export interface ToolMessageProps {
- toolName: string;
- rawToolName?: string;
- kind?: ToolKind;
- status: ToolStatus;
- args?: Record<string, unknown>;
- result?: unknown;
- hasHumanMessageAfter?: boolean;
- onOpenTask?: (taskId: string) => void;
-}
-
-export function formatToolTitle(
- toolName: string,
- args?: Record<string, unknown>,
-): string {
- if (!args) return toolName;
-
- // Format common tool patterns like the desktop app
- if (toolName.toLowerCase() === "grep" && args.pattern) {
- return `grep "${args.pattern}"`;
- }
- if (toolName.toLowerCase() === "read_file" && args.target_file) {
- return "Read File";
- }
- if (toolName.toLowerCase() === "write" && args.file_path) {
- return "Write File";
- }
- if (toolName.toLowerCase() === "search_replace") {
- return "Search Replace";
- }
-
- return toolName;
-}
-
-// Shape guards for file-editing tool args. The agent forwards Claude's raw
-// tool input through the ACP `rawInput` field, so we can detect Edit / Write /
-// MultiEdit by the keys present in args.
-interface EditArgs {
- file_path: string;
- old_string: string;
- new_string: string;
-}
-
-interface MultiEditArgs {
- file_path: string;
- edits: Array<{ old_string: string; new_string: string }>;
-}
-
-interface WriteArgs {
- file_path: string;
- content: string;
-}
-
-function asEditArgs(
- args: Record<string, unknown> | undefined,
-): EditArgs | null {
- if (!args) return null;
- if (
- typeof args.file_path === "string" &&
- typeof args.old_string === "string" &&
- typeof args.new_string === "string"
- ) {
- return {
- file_path: args.file_path,
- old_string: args.old_string,
- new_string: args.new_string,
- };
- }
- return null;
-}
-
-function asMultiEditArgs(
- args: Record<string, unknown> | undefined,
-): MultiEditArgs | null {
- if (!args || typeof args.file_path !== "string") return null;
- if (!Array.isArray(args.edits)) return null;
- const edits: MultiEditArgs["edits"] = [];
- for (const raw of args.edits) {
- if (
- raw &&
- typeof raw === "object" &&
- typeof (raw as Record<string, unknown>).old_string === "string" &&
- typeof (raw as Record<string, unknown>).new_string === "string"
- ) {
- edits.push({
- old_string: (raw as Record<string, unknown>).old_string as string,
- new_string: (raw as Record<string, unknown>).new_string as string,
- });
- }
- }
- if (edits.length === 0) return null;
- return { file_path: args.file_path, edits };
-}
-
-function asWriteArgs(
- args: Record<string, unknown> | undefined,
-): WriteArgs | null {
- if (!args) return null;
- if (
- typeof args.file_path === "string" &&
- typeof args.content === "string" &&
- args.old_string === undefined
- ) {
- return { file_path: args.file_path, content: args.content };
- }
- return null;
-}
-
-// Strip ANSI escape codes from terminal output
-function stripAnsi(text: string): string {
- // biome-ignore lint/suspicious/noControlCharactersInRegex: stripping ANSI codes requires matching control chars
- return text.replace(/\x1b\[[0-9;]*[a-zA-Z]/g, "");
-}
-
-function extractResultText(result: unknown): string | null {
- if (typeof result === "string") return result;
- if (result && typeof result === "object") {
- const obj = result as Record<string, unknown>;
- for (const key of ["stdout", "output", "text", "content"] as const) {
- if (typeof obj[key] === "string") return obj[key] as string;
- }
- }
- return null;
-}
-
-function countDiffLines(
- editArgs: EditArgs | null,
- multiEditArgs: MultiEditArgs | null,
- writeArgs: WriteArgs | null,
-): { added: number; removed: number } {
- let added = 0;
- let removed = 0;
-
- const countFromDiff = (oldText: string, newText: string) => {
- const lines = computeLineDiff(oldText, newText, Number.MAX_SAFE_INTEGER);
- for (const line of lines) {
- if (line.kind === "added") added++;
- else if (line.kind === "removed") removed++;
- }
- };
-
- if (editArgs) {
- countFromDiff(editArgs.old_string ?? "", editArgs.new_string ?? "");
- } else if (multiEditArgs) {
- for (const edit of multiEditArgs.edits) {
- countFromDiff(edit.old_string ?? "", edit.new_string ?? "");
- }
- } else if (writeArgs) {
- added = writeArgs.content ? writeArgs.content.split("\n").length : 0;
- }
-
- return { added, removed };
-}
-
-// Extract a file path from agent tool titles like "Read `src/foo.ts`" or
-// "Read 200 lines in `bar.ts`" when rawInput/args are unavailable.
-function extractPathFromTitle(title: string): string | null {
- const backtickMatch = title.match(/`([^`]+)`/);
- if (backtickMatch) return backtickMatch[1];
- // Fallback: strip common prefixes like "Read file", "Read 200 lines in"
- const stripped = title
- .replace(/^read\s+/i, "")
- .replace(/^file\s*/i, "")
- .replace(/^\d+\s+lines?\s+in\s+/i, "")
- .trim();
- // Only treat the remainder as a path if it looks like one
- if (stripped.includes("/") || stripped.includes(".")) return stripped;
- return null;
-}
-
-function shortenPath(path: string, maxLen = 48): string {
- if (path.length <= maxLen) return path;
- const parts = path.split("/");
- if (parts.length <= 2) return `…${path.slice(-(maxLen - 1))}`;
- return `…/${parts.slice(-2).join("/")}`;
-}
-
-function truncateText(text: string, maxLen: number): string {
- return text.length > maxLen ? `${text.slice(0, maxLen)}...` : text;
-}
-
-// Unified diff support — detects and renders `git diff` output when the agent
-// runs commands like `git diff` through the Bash tool and the result comes
-// back as stdout rather than a structured tool content block.
-type UnifiedDiffLine =
- | { kind: "file"; text: string }
- | { kind: "hunk"; text: string }
- | { kind: "added"; text: string }
- | { kind: "removed"; text: string }
- | { kind: "context"; text: string }
- | { kind: "meta"; text: string };
-
-function looksLikeUnifiedDiff(text: string): boolean {
- if (!text) return false;
- if (/(^|\n)diff --git /.test(text)) return true;
- return /(^|\n)--- /.test(text) && /(^|\n)\+\+\+ /.test(text);
-}
-
-function extractDiffFromResult(result: unknown): string | null {
- if (typeof result === "string") {
- return looksLikeUnifiedDiff(result) ? result : null;
- }
- if (result && typeof result === "object") {
- const obj = result as Record<string, unknown>;
- for (const key of ["stdout", "output", "text", "content"] as const) {
- const value = obj[key];
- if (typeof value === "string" && looksLikeUnifiedDiff(value)) {
- return value;
- }
- }
- }
- return null;
-}
-
-function parseUnifiedDiff(text: string): UnifiedDiffLine[] {
- const result: UnifiedDiffLine[] = [];
- for (const line of text.split("\n")) {
- if (
- line.startsWith("diff --git ") ||
- line.startsWith("--- ") ||
- line.startsWith("+++ ") ||
- line.startsWith("index ") ||
- line.startsWith("new file mode") ||
- line.startsWith("deleted file mode") ||
- line.startsWith("similarity index") ||
- line.startsWith("rename ")
- ) {
- result.push({ kind: "file", text: line });
- } else if (line.startsWith("@@")) {
- result.push({ kind: "hunk", text: line });
- } else if (line.startsWith("+")) {
- result.push({ kind: "added", text: line });
- } else if (line.startsWith("-")) {
- result.push({ kind: "removed", text: line });
- } else if (line.startsWith(" ")) {
- result.push({ kind: "context", text: line });
- } else {
- result.push({ kind: "meta", text: line });
- }
- }
- return result;
-}
-
-interface UnifiedDiffBlockProps {
- diffText: string;
- maxLines?: number;
-}
-
-function UnifiedDiffBlock({ diffText, maxLines = 120 }: UnifiedDiffBlockProps) {
- const allLines = parseUnifiedDiff(diffText);
- const truncated = allLines.length > maxLines;
- const lines = truncated ? allLines.slice(0, maxLines) : allLines;
-
- return (
- <View className="mt-1.5 overflow-hidden rounded-md border border-gray-6 bg-gray-2">
- {lines.map((line, i) => {
- let cls = "font-mono text-[11px] leading-4 text-gray-11 px-2";
- if (line.kind === "file") {
- cls += " text-gray-9";
- } else if (line.kind === "hunk") {
- cls += " bg-accent-3 text-accent-11";
- } else if (line.kind === "added") {
- cls += " bg-status-success/10 text-status-success";
- } else if (line.kind === "removed") {
- cls += " bg-status-error/10 text-status-error";
- } else if (line.kind === "context") {
- cls += " text-gray-11";
- } else {
- cls += " text-gray-9";
- }
- return (
- <Text key={`${i}-${line.kind}`} className={cls} selectable>
- {line.text || " "}
- </Text>
- );
- })}
- {truncated && (
- <Text className="px-2 py-1 font-mono text-[11px] text-gray-9 italic">
- … {allLines.length - maxLines} more lines
- </Text>
- )}
- </View>
- );
-}
-
-// LCS-based line diff: correctly identifies unchanged lines even when
-// changes are scattered throughout the block, then collapses distant
-// context into separators.
-type DiffLine =
- | { kind: "context"; text: string }
- | { kind: "added"; text: string }
- | { kind: "removed"; text: string }
- | { kind: "separator" };
-
-// O(n*m) LCS — fine for typical edit blocks (< 200 lines).
-function lcsBacktrack(a: string[], b: string[]): DiffLine[] {
- const m = a.length;
- const n = b.length;
-
- // Build LCS table
- const dp: number[][] = [];
- for (let i = 0; i <= m; i++) {
- dp[i] = new Array(n + 1).fill(0);
- }
- for (let i = 1; i <= m; i++) {
- for (let j = 1; j <= n; j++) {
- dp[i][j] =
- a[i - 1] === b[j - 1]
- ? dp[i - 1][j - 1] + 1
- : Math.max(dp[i - 1][j], dp[i][j - 1]);
- }
- }
-
- // Backtrack to produce diff
- const result: DiffLine[] = [];
- let i = m;
- let j = n;
- while (i > 0 || j > 0) {
- if (i > 0 && j > 0 && a[i - 1] === b[j - 1]) {
- result.push({ kind: "context", text: a[i - 1] });
- i--;
- j--;
- } else if (j > 0 && (i === 0 || dp[i][j - 1] >= dp[i - 1][j])) {
- result.push({ kind: "added", text: b[j - 1] });
- j--;
- } else {
- result.push({ kind: "removed", text: a[i - 1] });
- i--;
- }
- }
- result.reverse();
- return result;
-}
-
-// Collapse context lines far from changes into separators.
-function collapseContext(lines: DiffLine[], contextLines: number): DiffLine[] {
- // Mark which lines are near a change
- const isChange = lines.map((l) => l.kind === "added" || l.kind === "removed");
- const nearChange = new Array(lines.length).fill(false);
- for (let i = 0; i < lines.length; i++) {
- if (isChange[i]) {
- for (
- let k = Math.max(0, i - contextLines);
- k <= Math.min(lines.length - 1, i + contextLines);
- k++
- ) {
- nearChange[k] = true;
- }
- }
- }
-
- const result: DiffLine[] = [];
- let inSkip = false;
- for (let i = 0; i < lines.length; i++) {
- if (nearChange[i] || isChange[i]) {
- inSkip = false;
- result.push(lines[i]);
- } else if (!inSkip) {
- inSkip = true;
- result.push({ kind: "separator" });
- }
- }
- return result;
-}
-
-function computeLineDiff(
- oldText: string,
- newText: string,
- contextLines = 2,
-): DiffLine[] {
- const oldLines = oldText.length > 0 ? oldText.split("\n") : [];
- const newLines = newText.length > 0 ? newText.split("\n") : [];
-
- if (oldLines.length === 0) {
- return newLines.map((l) => ({ kind: "added" as const, text: l }));
- }
- if (newLines.length === 0) {
- return oldLines.map((l) => ({ kind: "removed" as const, text: l }));
- }
-
- const raw = lcsBacktrack(oldLines, newLines);
- return collapseContext(raw, contextLines);
-}
-
-interface DiffBlockProps {
- oldText: string;
- newText: string;
- language?: string | null;
- maxLines?: number;
-}
-
-function HighlightedDiffLine({
- text,
- language,
- fallbackColor,
-}: {
- text: string;
- language?: string | null;
- fallbackColor: string;
-}) {
- const segments = useMemo(
- () => (language ? highlightCode(text, language) : null),
- [text, language],
- );
-
- if (!segments) {
- return <>{text || " "}</>;
- }
-
- return (
- <>
- {segments.map((seg, i) => {
- const color = getColorForClass(seg.className);
- return (
- <Text
- key={`h-${i}-${seg.className ?? "p"}`}
- style={{ color: color ?? fallbackColor }}
- >
- {seg.text}
- </Text>
- );
- })}
- </>
- );
-}
-
-function DiffBlock({
- oldText,
- newText,
- language,
- maxLines = 60,
-}: DiffBlockProps) {
- const themeColors = useThemeColors();
- const [expanded, setExpanded] = useState(false);
- const allLines = computeLineDiff(oldText, newText);
- const truncated = !expanded && allLines.length > maxLines;
- const lines = truncated ? allLines.slice(0, maxLines) : allLines;
-
- return (
- <View className="mt-1.5 overflow-hidden rounded-md border border-gray-6 bg-gray-2">
- {lines.map((line, i) => {
- const key = `${line.kind}-${i}`;
- if (line.kind === "separator") {
- return (
- <Text
- key={key}
- className="px-2 font-mono text-[11px] text-gray-8 leading-4"
- >
- ···
- </Text>
- );
- }
- let cls = "font-mono text-[11px] leading-4 px-2";
- const fallbackColor =
- line.kind === "added"
- ? themeColors.status.success
- : line.kind === "removed"
- ? themeColors.status.error
- : themeColors.gray[11];
- if (line.kind === "added") {
- cls += " bg-status-success/10";
- } else if (line.kind === "removed") {
- cls += " bg-status-error/10";
- }
- const prefix =
- line.kind === "added" ? "+ " : line.kind === "removed" ? "- " : " ";
- return (
- <Text key={key} className={cls} selectable>
- <Text style={{ color: fallbackColor }}>{prefix}</Text>
- <HighlightedDiffLine
- text={line.text}
- language={language}
- fallbackColor={fallbackColor}
- />
- </Text>
- );
- })}
- {truncated && (
- <Pressable onPress={() => setExpanded(true)}>
- <Text className="px-2 py-1.5 font-mono text-[11px] text-accent-11">
- Show all {allLines.length} lines
- </Text>
- </Pressable>
- )}
- </View>
- );
-}
-
-function CreateTaskPreview({
- args,
- showAction,
- onOpenTask,
-}: {
- args: CreateTaskArgs;
- showAction: boolean;
- onOpenTask?: (taskId: string) => void;
-}) {
- const router = useRouter();
- const themeColors = useThemeColors();
- const [isRunning, setIsRunning] = useState(false);
- const [error, setError] = useState<string | null>(null);
-
- const handleRunTask = async () => {
- if (!args.description) return;
-
- setIsRunning(true);
- setError(null);
-
- try {
- // Dynamic import to avoid circular dependency
- const [{ runTaskInCloud }, { getPostHogApiClient }] = await Promise.all([
- import("../../tasks/api"),
- import("@/lib/posthogApiClient"),
- ]);
-
- const task = await getPostHogApiClient().createTask({
- title: args.title,
- description: args.description,
- repository: args.repository,
- });
-
- await runTaskInCloud(task.id);
-
- if (onOpenTask) {
- onOpenTask(task.id);
- } else {
- router.push(`/task/${task.id}`);
- }
- } catch (err) {
- console.error("Failed to create/run task:", err);
- setError(err instanceof Error ? err.message : "Failed to run task");
- } finally {
- setIsRunning(false);
- }
- };
-
- return (
- <View className="mt-2 overflow-hidden rounded-lg border border-gray-7 bg-gray-3">
- {/* Header */}
- <View className="flex-row items-center gap-2 border-gray-7 border-b px-3 py-2">
- <ListChecks size={14} color={themeColors.accent[9]} />
- <Text className="font-mono text-[12px] text-gray-11">New task</Text>
- </View>
-
- {/* Content */}
- <View className="px-3 py-3">
- {/* Title */}
- {args.title && (
- <Text className="mb-2 font-medium text-[14px] text-gray-12">
- {args.title}
- </Text>
- )}
-
- {/* Description */}
- {args.description && (
- <Text
- className="mb-3 text-[13px] text-gray-11 leading-5"
- numberOfLines={4}
- >
- {args.description}
- </Text>
- )}
-
- {/* Repository */}
- {args.repository && (
- <View
- className={
- showAction
- ? "mb-3 flex-row items-center gap-1.5"
- : "flex-row items-center gap-1.5"
- }
- >
- <GitBranch size={12} color={themeColors.gray[9]} />
- <Text className="font-mono text-[12px] text-gray-9">
- {args.repository}
- </Text>
- </View>
- )}
-
- {/* Error message */}
- {error && (
- <View className="mb-3 rounded bg-status-error/20 px-2 py-1.5">
- <Text className="text-[12px] text-status-error">{error}</Text>
- </View>
- )}
-
- {/* Action button */}
- {showAction && (
- <TouchableOpacity
- onPress={handleRunTask}
- disabled={isRunning || !args.description}
- className={`flex-row items-center justify-center gap-2 rounded-lg px-4 py-2.5 ${
- isRunning ? "bg-accent-9/50" : "bg-accent-9"
- }`}
- activeOpacity={0.7}
- >
- {isRunning ? (
- <ActivityIndicator
- size={14}
- color={themeColors.accent.contrast}
- />
- ) : (
- <Play
- size={14}
- color={themeColors.accent.contrast}
- weight="fill"
- />
- )}
- <Text className="font-medium text-[13px] text-accent-contrast">
- {isRunning ? "Starting..." : "Open this task"}
- </Text>
- </TouchableOpacity>
- )}
- </View>
- </View>
- );
-}
-
-export function ToolMessage({
- toolName,
- rawToolName,
- kind,
- status,
- args,
- result,
- hasHumanMessageAfter,
- onOpenTask,
-}: ToolMessageProps) {
- const themeColors = useThemeColors();
- const [isOpen, setIsOpen] = useState(false);
-
- const isLoading = status === "pending" || status === "running";
- const isFailed = status === "error";
- const displayTitle = formatToolTitle(toolName, args);
- const KindIcon = kind ? kindIcons[kind] : Wrench;
- const effectiveToolName = rawToolName ?? toolName;
-
- const isCreateTask =
- effectiveToolName.toLowerCase() === "create_task" || kind === "create_task";
-
- // File-editing tools get a proper diff view using the rawInput we already
- // receive on the wire. Detection is by shape, not tool name, so it works
- // regardless of how the agent labels the tool.
- const editArgs = asEditArgs(args);
- const multiEditArgs = !editArgs ? asMultiEditArgs(args) : null;
- const writeArgs = !editArgs && !multiEditArgs ? asWriteArgs(args) : null;
- const fileToolArgs = editArgs ?? multiEditArgs ?? writeArgs;
-
- // Unified-diff-in-result: when the agent runs commands like `git diff`
- // via the Bash tool, the result comes back as stdout containing a unified
- // diff string. Detect that and render it as a real diff view.
- const unifiedDiffText = !fileToolArgs ? extractDiffFromResult(result) : null;
-
- if (fileToolArgs && !isCreateTask) {
- const stats = countDiffLines(editArgs, multiEditArgs, writeArgs);
- const diffLanguage = languageFromPath(fileToolArgs.file_path);
- // Collapse diffs for failed edits (retries make them noise)
- const showDiff = !isFailed || isOpen;
-
- return (
- <View className="px-4 py-1">
- {/* Header row */}
- <Pressable
- onPress={() => isFailed && setIsOpen(!isOpen)}
- className="flex-row items-center gap-2"
- disabled={!isFailed}
- >
- {isLoading ? (
- <ActivityIndicator size={12} color={themeColors.gray[9]} />
- ) : (
- <PencilSimple
- size={12}
- color={isFailed ? themeColors.status.error : themeColors.gray[9]}
- />
- )}
- <Text
- className={`font-mono text-[13px] ${isFailed ? "text-gray-9" : "text-gray-12"}`}
- numberOfLines={1}
- >
- {shortenPath(fileToolArgs.file_path)}
- </Text>
- {stats.added > 0 && !isFailed && (
- <Text className="font-mono text-[11px] text-status-success">
- +{stats.added}
- </Text>
- )}
- {stats.removed > 0 && !isFailed && (
- <Text className="font-mono text-[11px] text-status-error">
- -{stats.removed}
- </Text>
- )}
- {diffLanguage && !isFailed && (
- <Text className="font-mono text-[10px] text-gray-8">
- {diffLanguage}
- </Text>
- )}
- {isFailed && (
- <Text className="font-mono text-[12px] text-status-error">
- Failed
- </Text>
- )}
- </Pressable>
-
- {/* Diff content — collapsed when failed */}
- {showDiff && (
- <>
- {editArgs && (
- <DiffBlock
- oldText={editArgs.old_string}
- newText={editArgs.new_string}
- language={languageFromPath(fileToolArgs.file_path)}
- />
- )}
- {multiEditArgs?.edits.map((edit, i) => (
- <DiffBlock
- key={`${multiEditArgs.file_path}-${i}`}
- oldText={edit.old_string}
- newText={edit.new_string}
- language={languageFromPath(fileToolArgs.file_path)}
- />
- ))}
- {writeArgs && (
- <DiffBlock
- oldText=""
- newText={writeArgs.content}
- language={languageFromPath(fileToolArgs.file_path)}
- />
- )}
- </>
- )}
- </View>
- );
- }
-
- // Unified-diff-in-result renderer (e.g. `git diff` via Bash)
- if (unifiedDiffText && !isCreateTask) {
- return (
- <View className="px-4 py-1">
- <View className="flex-row items-center gap-2">
- {isLoading ? (
- <ActivityIndicator size={12} color={themeColors.gray[9]} />
- ) : (
- <KindIcon size={12} color={themeColors.gray[9]} />
- )}
- <Text
- className="font-mono text-[13px] text-gray-12"
- numberOfLines={1}
- >
- {displayTitle}
- </Text>
- {isFailed && (
- <Text className="font-mono text-[13px] text-gray-9">(Failed)</Text>
- )}
- </View>
- <UnifiedDiffBlock diffText={unifiedDiffText} />
- </View>
- );
- }
-
- // For create_task, show rich preview instead of expandable
- if (isCreateTask && args) {
- return (
- <View className="px-4 py-1">
- <View className="mb-1 flex-row items-center gap-2">
- {isLoading ? (
- <ActivityIndicator size={12} color={themeColors.gray[9]} />
- ) : (
- <ListChecks size={12} color={themeColors.accent[9]} />
- )}
- <Text className="font-mono text-[13px] text-gray-11">
- create_task
- </Text>
- </View>
- <CreateTaskPreview
- args={args as CreateTaskArgs}
- showAction={!hasHumanMessageAfter}
- onOpenTask={onOpenTask}
- />
- </View>
- );
- }
-
- const resolvedKind = kind ?? deriveToolKind(toolName);
- const isPending = status === "pending";
- const isRunning = status === "running";
- const isCompleted = status === "completed";
- const resultText = extractResultText(result);
- const isPostHogExec = isPostHogExecTool(effectiveToolName);
- const posthogExecDisplay = isPostHogExec ? getPostHogExecDisplay(args) : null;
-
- // MCP App tools render via the WebView host — skip PostHog exec (which has
- // its own renderer above) and only kick in once the tool finished or while
- // it's running so we don't show empty WebView shells for pending tools.
- const isMcpAppTool =
- !isPostHogExec && parseMcpToolName(effectiveToolName) !== undefined;
-
- if (isMcpAppTool && !isPending) {
- return (
- <View className="px-4 py-1">
- <McpAppHost
- rawToolName={effectiveToolName}
- toolArgs={args}
- toolResult={result}
- status={status}
- />
- </View>
- );
- }
-
- if (isPostHogExec) {
- const label = posthogExecDisplay?.label ?? "exec";
- const inputPreview = posthogExecDisplay?.input;
- const fullInput =
- formatPosthogExecBody(posthogExecDisplay?.input) ??
- (typeof args?.command === "string" ? args.command : undefined);
- const outputText = resultText ? stripAnsi(resultText) : null;
- const hasOutput = !!outputText?.trim();
- const isExpandable = !!fullInput || hasOutput;
- // Surface output for failures too — otherwise a failed call shows "Failed"
- // with no reason, even though the error text lives in the result content.
- const showOutput = (isCompleted || isFailed) && hasOutput;
-
- return (
- <View className={`px-4 py-1 ${isRunning ? "bg-accent-3/30" : ""}`}>
- <Pressable
- onPress={() => isExpandable && setIsOpen(!isOpen)}
- className="flex-row items-center gap-2"
- disabled={!isExpandable}
- >
- {isLoading ? (
- <ActivityIndicator size={12} color={themeColors.gray[9]} />
- ) : (
- <Wrench
- size={12}
- color={isFailed ? themeColors.status.error : themeColors.gray[9]}
- />
- )}
- <Text
- className="flex-1 font-mono text-[13px] text-gray-12"
- numberOfLines={1}
- >
- posthog - {label} (MCP)
- </Text>
- {isPending && (
- <Text className="font-mono text-[11px] text-gray-8">Queued</Text>
- )}
- {isFailed && (
- <Text className="font-mono text-[12px] text-status-error">
- Failed
- </Text>
- )}
- </Pressable>
-
- {inputPreview && !isPending && (
- <Text
- className="mt-0.5 ml-5 font-mono text-[11px] text-gray-9"
- numberOfLines={2}
- ellipsizeMode="tail"
- >
- {truncateText(inputPreview, POSTHOG_EXEC_INPUT_PREVIEW_MAX_LENGTH)}
- </Text>
- )}
-
- {isOpen && fullInput && (
- <View className="mt-1.5 ml-5 rounded border border-gray-6 bg-gray-2 px-2 py-1.5">
- <Text
- className="font-mono text-[11px] text-gray-11 leading-4"
- selectable
- >
- {fullInput}
- </Text>
- </View>
- )}
-
- {isOpen && showOutput && outputText && (
- <View className="mt-1.5 ml-5 rounded border border-gray-6 bg-gray-2 px-2 py-1.5">
- <Text
- className="font-mono text-[11px] text-gray-11 leading-4"
- numberOfLines={30}
- selectable
- >
- {outputText}
- </Text>
- </View>
- )}
- </View>
- );
- }
-
- // Execute/Bash: show description + command subtitle + expandable output
- if (resolvedKind === "execute") {
- const command = typeof args?.command === "string" ? args.command : null;
- const description =
- typeof args?.description === "string" ? args.description : null;
- const outputText = resultText ? stripAnsi(resultText) : null;
- const hasOutput = outputText && outputText.trim().length > 0;
-
- return (
- <View className={`px-4 py-1 ${isRunning ? "bg-accent-3/30" : ""}`}>
- {/* Header */}
- <Pressable
- onPress={() => hasOutput && setIsOpen(!isOpen)}
- className="flex-row items-center gap-2"
- disabled={!hasOutput}
- >
- {isLoading ? (
- <ActivityIndicator size={12} color={themeColors.gray[9]} />
- ) : (
- <Terminal
- size={12}
- color={isFailed ? themeColors.status.error : themeColors.gray[9]}
- />
- )}
- <Text
- className="font-mono text-[13px] text-gray-12"
- numberOfLines={1}
- >
- {description ?? displayTitle}
- </Text>
- {isFailed && (
- <Text className="font-mono text-[12px] text-status-error">
- Failed
- </Text>
- )}
- </Pressable>
-
- {/* Command as subtitle line */}
- {command && (
- <Text
- className="mt-0.5 ml-5 font-mono text-[11px] text-gray-9"
- numberOfLines={2}
- ellipsizeMode="tail"
- >
- $ {command}
- </Text>
- )}
-
- {/* Output */}
- {isOpen && hasOutput && (
- <View className="mt-1.5 ml-5 rounded border border-gray-6 bg-gray-2 px-2 py-1.5">
- <Text
- className="font-mono text-[11px] text-gray-11 leading-4"
- numberOfLines={30}
- selectable
- >
- {outputText}
- </Text>
- </View>
- )}
- </View>
- );
- }
-
- // Read: show file path, line range, and expandable content preview
- if (resolvedKind === "read") {
- // Try args first, then extract a path from the tool title (e.g.
- // "Read `src/foo.ts`" or "Read 200 lines in `bar.ts`").
- const filePath =
- typeof args?.file_path === "string"
- ? args.file_path
- : typeof args?.target_file === "string"
- ? args.target_file
- : extractPathFromTitle(toolName);
- const hasContent = resultText && resultText.trim().length > 0;
- const lineCount = hasContent ? resultText.split("\n").length : null;
- const offset = typeof args?.offset === "number" ? args.offset : null;
- const limit = typeof args?.limit === "number" ? args.limit : null;
- const lineRange = offset
- ? `lines ${offset}–${offset + (limit ?? lineCount ?? 0)}`
- : lineCount
- ? `${lineCount} lines`
- : null;
-
- return (
- <View className={`px-4 py-1 ${isRunning ? "bg-accent-3/30" : ""}`}>
- <Pressable
- onPress={() => hasContent && setIsOpen(!isOpen)}
- className="flex-row items-center gap-2"
- disabled={!hasContent}
- >
- {isLoading ? (
- <ActivityIndicator size={12} color={themeColors.gray[9]} />
- ) : (
- <FileText size={12} color={themeColors.gray[9]} />
- )}
- <Text
- className="font-mono text-[13px] text-gray-11"
- numberOfLines={1}
- >
- Read
- </Text>
- {filePath ? (
- <Text
- className="flex-1 font-mono text-[13px] text-gray-12"
- numberOfLines={1}
- ellipsizeMode="middle"
- >
- {shortenPath(filePath, 36)}
- </Text>
- ) : null}
- {lineRange && isCompleted && (
- <Text className="font-mono text-[11px] text-gray-9">
- {lineRange}
- </Text>
- )}
- {isFailed && (
- <Text className="font-mono text-[12px] text-status-error">
- Failed
- </Text>
- )}
- </Pressable>
-
- {/* Content preview */}
- {isOpen && hasContent && (
- <View className="mt-1.5 ml-5 rounded border border-gray-6 bg-gray-2 px-2 py-1.5">
- <Text
- className="font-mono text-[11px] text-gray-11 leading-4"
- numberOfLines={20}
- selectable
- >
- {resultText}
- </Text>
- </View>
- )}
- </View>
- );
- }
-
- // Default: all other tools (search, think, fetch, etc.)
- const subtitle = getToolSubtitle(toolName, args);
-
- return (
- <View
- className={`px-4 py-0.5 ${
- isRunning ? "bg-accent-3/30" : isPending ? "opacity-50" : ""
- }`}
- >
- <View className="flex-row items-center gap-2">
- {/* Status indicator */}
- {isLoading ? (
- <ActivityIndicator size={12} color={themeColors.gray[9]} />
- ) : (
- <KindIcon
- size={12}
- color={isFailed ? themeColors.status.error : themeColors.gray[9]}
- />
- )}
-
- {/* Tool name */}
- <Text className="font-mono text-[13px] text-gray-12" numberOfLines={1}>
- {displayTitle}
- </Text>
-
- {/* Queued label */}
- {isPending && (
- <Text className="font-mono text-[11px] text-gray-8">Queued</Text>
- )}
-
- {/* Failed indicator */}
- {isFailed && (
- <Text className="font-mono text-[12px] text-status-error">
- Failed
- </Text>
- )}
- </View>
-
- {/* Contextual subtitle */}
- {subtitle && !isPending && (
- <Text
- className="mt-0.5 ml-5 font-mono text-[11px] text-gray-9"
- numberOfLines={1}
- ellipsizeMode="middle"
- >
- {subtitle}
- </Text>
- )}
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/chat/components/TurnFeedback.test.tsx b/products/desktop/apps/mobile/src/features/chat/components/TurnFeedback.test.tsx
deleted file mode 100644
index 7bd848b14711..000000000000
--- a/products/desktop/apps/mobile/src/features/chat/components/TurnFeedback.test.tsx
+++ /dev/null
@@ -1,92 +0,0 @@
-import { createElement } from "react";
-import { act, create, type ReactTestRenderer } from "react-test-renderer";
-import { beforeEach, describe, expect, it, vi } from "vitest";
-
-const mockPosthog = {
- register: vi.fn(),
- unregister: vi.fn(),
- capture: vi.fn(),
-};
-vi.mock("posthog-react-native", () => ({ usePostHog: () => mockPosthog }));
-vi.mock("expo-haptics", () => ({
- impactAsync: vi.fn(),
- ImpactFeedbackStyle: { Light: "light" },
-}));
-vi.mock("@/lib/theme", () => ({
- useThemeColors: () => ({ gray: { 9: "#000000" } }),
-}));
-
-import { useTurnFeedbackStore } from "@/features/tasks/stores/turnFeedbackStore";
-import { TurnFeedback } from "./TurnFeedback";
-
-function render(props: { turnId: string; taskId?: string | null }) {
- let renderer: ReactTestRenderer | null = null;
- act(() => {
- renderer = create(createElement(TurnFeedback, props));
- });
- if (!renderer) throw new Error("Renderer not created");
- return renderer as ReactTestRenderer;
-}
-
-function press(renderer: ReactTestRenderer, label: string) {
- const node = renderer.root.findAll(
- (n) => n.props?.accessibilityLabel === label,
- )[0];
- act(() => node.props.onPress());
-}
-
-function storedSentiment(turnId: string) {
- return useTurnFeedbackStore.getState().sentimentByTurnId[turnId] ?? null;
-}
-
-describe("TurnFeedback", () => {
- beforeEach(() => {
- mockPosthog.capture.mockReset();
- useTurnFeedbackStore.setState({ sentimentByTurnId: {} });
- });
-
- it("records feedback on the first tap", () => {
- const renderer = render({ turnId: "agent-0", taskId: "task-1" });
- press(renderer, "Good response");
- expect(mockPosthog.capture).toHaveBeenCalledTimes(1);
- expect(mockPosthog.capture).toHaveBeenCalledWith("Agent turn feedback", {
- task_id: "task-1",
- turn_id: "agent-0",
- sentiment: "positive",
- });
- expect(storedSentiment("agent-0")).toBe("positive");
- });
-
- it("ignores a re-tap of the already-lit thumb", () => {
- const renderer = render({ turnId: "agent-0", taskId: "task-1" });
- press(renderer, "Good response");
- press(renderer, "Good response");
- expect(mockPosthog.capture).toHaveBeenCalledTimes(1);
- });
-
- it("records the new sentiment when switching thumbs", () => {
- const renderer = render({ turnId: "agent-0", taskId: "task-1" });
- press(renderer, "Good response");
- press(renderer, "Bad response");
- expect(mockPosthog.capture).toHaveBeenCalledTimes(2);
- expect(mockPosthog.capture).toHaveBeenLastCalledWith(
- "Agent turn feedback",
- {
- task_id: "task-1",
- turn_id: "agent-0",
- sentiment: "negative",
- },
- );
- expect(storedSentiment("agent-0")).toBe("negative");
- });
-
- it("sends a null task_id when no task is provided", () => {
- const renderer = render({ turnId: "agent-0" });
- press(renderer, "Bad response");
- expect(mockPosthog.capture).toHaveBeenCalledWith("Agent turn feedback", {
- task_id: null,
- turn_id: "agent-0",
- sentiment: "negative",
- });
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/chat/components/TurnFeedback.tsx b/products/desktop/apps/mobile/src/features/chat/components/TurnFeedback.tsx
deleted file mode 100644
index 844e9047dc94..000000000000
--- a/products/desktop/apps/mobile/src/features/chat/components/TurnFeedback.tsx
+++ /dev/null
@@ -1,68 +0,0 @@
-import type { AgentTurnFeedbackSentiment } from "@posthog/shared";
-import * as Haptics from "expo-haptics";
-import { ThumbsDown, ThumbsUp } from "phosphor-react-native";
-import { useCallback } from "react";
-import { Pressable, View } from "react-native";
-import {
- useTurnFeedback,
- useTurnFeedbackStore,
-} from "@/features/tasks/stores/turnFeedbackStore";
-import { ANALYTICS_EVENTS, useAnalytics } from "@/lib/analytics";
-import { useThemeColors } from "@/lib/theme";
-
-interface TurnFeedbackProps {
- turnId: string;
- taskId?: string | null;
-}
-
-export function TurnFeedback({ turnId, taskId }: TurnFeedbackProps) {
- const themeColors = useThemeColors();
- const analytics = useAnalytics();
- const sentiment = useTurnFeedback(turnId);
- const setTurnFeedback = useTurnFeedbackStore((s) => s.setTurnFeedback);
-
- const rate = useCallback(
- (next: AgentTurnFeedbackSentiment) => {
- if (sentiment === next) return;
- Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
- setTurnFeedback(turnId, next);
- analytics.track(ANALYTICS_EVENTS.AGENT_TURN_FEEDBACK, {
- task_id: taskId ?? null,
- turn_id: turnId,
- sentiment: next,
- });
- },
- [sentiment, setTurnFeedback, analytics, turnId, taskId],
- );
-
- return (
- <View className="flex-row items-center gap-3">
- <Pressable
- onPress={() => rate("positive")}
- hitSlop={8}
- accessibilityRole="button"
- accessibilityLabel="Good response"
- accessibilityState={{ selected: sentiment === "positive" }}
- >
- <ThumbsUp
- size={14}
- color={themeColors.gray[9]}
- weight={sentiment === "positive" ? "fill" : "regular"}
- />
- </Pressable>
- <Pressable
- onPress={() => rate("negative")}
- hitSlop={8}
- accessibilityRole="button"
- accessibilityLabel="Bad response"
- accessibilityState={{ selected: sentiment === "negative" }}
- >
- <ThumbsDown
- size={14}
- color={themeColors.gray[9]}
- weight={sentiment === "negative" ? "fill" : "regular"}
- />
- </Pressable>
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/chat/hooks/useCopy.test.ts b/products/desktop/apps/mobile/src/features/chat/hooks/useCopy.test.ts
deleted file mode 100644
index 9e02c314cea0..000000000000
--- a/products/desktop/apps/mobile/src/features/chat/hooks/useCopy.test.ts
+++ /dev/null
@@ -1,71 +0,0 @@
-import { createElement } from "react";
-import { act, create } from "react-test-renderer";
-import { afterEach, describe, expect, it, vi } from "vitest";
-
-const setStringAsync = vi.fn(async (_text: string) => true);
-vi.mock("expo-clipboard", () => ({
- setStringAsync: (text: string) => setStringAsync(text),
-}));
-
-import { useCopy } from "./useCopy";
-
-afterEach(() => {
- vi.clearAllMocks();
- vi.useRealTimers();
-});
-
-function renderUseCopy(resetMs?: number) {
- const state: { current: ReturnType<typeof useCopy> } = {
- current: { copied: false, copy: () => {} },
- };
- function Harness() {
- state.current = useCopy(resetMs);
- return null;
- }
- act(() => {
- create(createElement(Harness));
- });
- return state;
-}
-
-describe("useCopy", () => {
- it("writes to the clipboard and flips copied true then false", async () => {
- vi.useFakeTimers();
- const state = renderUseCopy(2000);
-
- expect(state.current.copied).toBe(false);
-
- await act(async () => {
- state.current.copy("hello");
- });
-
- expect(setStringAsync).toHaveBeenCalledWith("hello");
- expect(state.current.copied).toBe(true);
-
- act(() => {
- vi.advanceTimersByTime(2000);
- });
-
- expect(state.current.copied).toBe(false);
- });
-
- it("runs onSuccess only after a successful write", async () => {
- setStringAsync.mockRejectedValueOnce(new Error("denied"));
- const onSuccess = vi.fn();
- const state = renderUseCopy();
-
- await act(async () => {
- state.current.copy("nope", onSuccess);
- });
-
- expect(state.current.copied).toBe(false);
- expect(onSuccess).not.toHaveBeenCalled();
-
- await act(async () => {
- state.current.copy("yep", onSuccess);
- });
-
- expect(state.current.copied).toBe(true);
- expect(onSuccess).toHaveBeenCalledTimes(1);
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/chat/hooks/useCopy.ts b/products/desktop/apps/mobile/src/features/chat/hooks/useCopy.ts
deleted file mode 100644
index bcf657abbd92..000000000000
--- a/products/desktop/apps/mobile/src/features/chat/hooks/useCopy.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import * as Clipboard from "expo-clipboard";
-import { useCallback, useEffect, useRef, useState } from "react";
-
-export function useCopy(resetMs = 2000): {
- copied: boolean;
- copy: (text: string, onSuccess?: () => void) => void;
-} {
- const [copied, setCopied] = useState(false);
- const timeout = useRef<ReturnType<typeof setTimeout>>(undefined);
-
- useEffect(() => () => clearTimeout(timeout.current), []);
-
- const copy = useCallback(
- (text: string, onSuccess?: () => void) => {
- Clipboard.setStringAsync(text).then(
- () => {
- setCopied(true);
- clearTimeout(timeout.current);
- timeout.current = setTimeout(() => setCopied(false), resetMs);
- onSuccess?.();
- },
- () => {},
- );
- },
- [resetMs],
- );
-
- return { copied, copy };
-}
diff --git a/products/desktop/apps/mobile/src/features/chat/hooks/usePeriodicRerender.ts b/products/desktop/apps/mobile/src/features/chat/hooks/usePeriodicRerender.ts
deleted file mode 100644
index 6bae19171ee4..000000000000
--- a/products/desktop/apps/mobile/src/features/chat/hooks/usePeriodicRerender.ts
+++ /dev/null
@@ -1,58 +0,0 @@
-import { useEffect, useRef, useState } from "react";
-import { AppState, type AppStateStatus } from "react-native";
-
-/**
- * Hook that triggers a re-render at the specified interval.
- * Pauses when the app goes to background.
- * Pass 0 to disable the interval.
- */
-export function usePeriodicRerender(milliseconds: number): void {
- const [, setTick] = useState(0);
- const intervalIdRef = useRef<ReturnType<typeof setInterval> | null>(null);
-
- useEffect(() => {
- // Don't start interval if milliseconds is 0 or negative
- if (milliseconds <= 0) {
- return;
- }
-
- const startInterval = (): void => {
- if (intervalIdRef.current) {
- return;
- }
- intervalIdRef.current = setInterval(
- () => setTick((state) => state + 1),
- milliseconds,
- );
- };
-
- const stopInterval = (): void => {
- if (intervalIdRef.current) {
- clearInterval(intervalIdRef.current);
- intervalIdRef.current = null;
- }
- };
-
- const handleAppStateChange = (nextAppState: AppStateStatus): void => {
- if (nextAppState === "active") {
- setTick((state) => state + 1); // Immediate update when returning to foreground
- startInterval();
- } else {
- stopInterval();
- }
- };
-
- // Start immediately
- startInterval();
-
- const subscription = AppState.addEventListener(
- "change",
- handleAppStateChange,
- );
-
- return () => {
- stopInterval();
- subscription.remove();
- };
- }, [milliseconds]);
-}
diff --git a/products/desktop/apps/mobile/src/features/chat/hooks/useVoiceRecording.ts b/products/desktop/apps/mobile/src/features/chat/hooks/useVoiceRecording.ts
deleted file mode 100644
index a3b5aae113e9..000000000000
--- a/products/desktop/apps/mobile/src/features/chat/hooks/useVoiceRecording.ts
+++ /dev/null
@@ -1,243 +0,0 @@
-import { ExpoSpeechRecognitionModule } from "expo-speech-recognition";
-import { useCallback, useEffect, useRef, useState } from "react";
-import { logger } from "@/lib/logger";
-
-const log = logger.scope("voice-recording");
-
-type RecordingStatus = "idle" | "recording" | "transcribing" | "error";
-
-interface UseVoiceRecordingOptions {
- /**
- * Fires with the final transcript whenever recognition finishes — whether
- * the caller invoked stopRecording() or the engine ended on its own
- * (silence timeout on iOS 17-, `isFinal` result on iOS 18+/Android, etc).
- * Use this to append voice input to a text field reliably; the previous
- * promise-only API silently dropped transcripts when the engine auto-ended
- * before the user tapped stop.
- */
- onTranscript?: (transcript: string) => void;
-}
-
-interface UseVoiceRecordingReturn {
- status: RecordingStatus;
- error: string | null;
- startRecording: () => Promise<void>;
- stopRecording: () => Promise<void>;
- cancelRecording: () => Promise<void>;
-}
-
-export function useVoiceRecording(
- options: UseVoiceRecordingOptions = {},
-): UseVoiceRecordingReturn {
- const [status, setStatus] = useState<RecordingStatus>("idle");
- const [error, setError] = useState<string | null>(null);
- const transcriptRef = useRef<string>("");
- const listenersRef = useRef<(() => void)[]>([]);
- /** Resolves stopRecording() when a final event arrives. Null otherwise. */
- const stopWaitRef = useRef<(() => void) | null>(null);
- /** Set by cancelRecording so the next event discards the transcript. */
- const canceledRef = useRef(false);
- /** Keep the latest callback without re-attaching listeners. */
- const onTranscriptRef = useRef(options.onTranscript);
- useEffect(() => {
- onTranscriptRef.current = options.onTranscript;
- });
-
- const removeListeners = useCallback(() => {
- for (const remove of listenersRef.current) {
- try {
- remove();
- } catch {}
- }
- listenersRef.current = [];
- }, []);
-
- /**
- * Called when the engine emits a terminal event: a `result` with
- * `isFinal: true`, an `end` event, or a non-fatal error like `no-speech`.
- * Delivers the transcript via the callback and tears down listeners.
- *
- * This must work even when the user hasn't called stopRecording() — on
- * iOS 17- the engine ends after ~3s of silence regardless, and on iOS 18+
- * a short utterance can finalize before the user taps stop.
- */
- const handleFinalEvent = useCallback(() => {
- const wasCanceled = canceledRef.current;
- canceledRef.current = false;
- const text = wasCanceled ? "" : transcriptRef.current.trim();
- log.debug("final event", { text: text.slice(0, 60), wasCanceled });
-
- removeListeners();
- transcriptRef.current = "";
- setStatus("idle");
-
- if (text) {
- onTranscriptRef.current?.(text);
- }
-
- const waiter = stopWaitRef.current;
- stopWaitRef.current = null;
- if (waiter) waiter();
- }, [removeListeners]);
-
- const startRecording = useCallback(async () => {
- try {
- // Tear down any lingering state from a prior session so we don't pick
- // up stale listeners or transcripts.
- removeListeners();
- stopWaitRef.current = null;
- canceledRef.current = false;
- transcriptRef.current = "";
- setError(null);
-
- if (!ExpoSpeechRecognitionModule.isRecognitionAvailable()) {
- setError("Speech recognition is not available on this device");
- setStatus("error");
- return;
- }
-
- const { granted } =
- await ExpoSpeechRecognitionModule.requestPermissionsAsync();
- if (!granted) {
- setError("Speech recognition permission is required");
- setStatus("error");
- return;
- }
-
- const resultSub = ExpoSpeechRecognitionModule.addListener(
- "result",
- (event) => {
- const best = event.results[0]?.transcript;
- if (best) transcriptRef.current = best;
- log.debug("result", { isFinal: event.isFinal, hasText: !!best });
- if (event.isFinal) {
- handleFinalEvent();
- }
- },
- );
-
- const errorSub = ExpoSpeechRecognitionModule.addListener(
- "error",
- (event) => {
- log.debug("error event", {
- code: event.error,
- message: event.message,
- });
- // "no-speech" and "aborted" are non-fatal — fall through the
- // normal end path so any accumulated transcript still delivers.
- if (event.error === "no-speech" || event.error === "aborted") {
- handleFinalEvent();
- return;
- }
- setError(event.message || "Speech recognition failed");
- removeListeners();
- transcriptRef.current = "";
- const waiter = stopWaitRef.current;
- stopWaitRef.current = null;
- setStatus("error");
- waiter?.();
- },
- );
-
- const endSub = ExpoSpeechRecognitionModule.addListener("end", () => {
- log.debug("end event", { hasTranscript: !!transcriptRef.current });
- handleFinalEvent();
- });
-
- listenersRef.current = [
- () => resultSub.remove(),
- () => errorSub.remove(),
- () => endSub.remove(),
- ];
-
- const useOnDevice =
- ExpoSpeechRecognitionModule.supportsOnDeviceRecognition();
-
- ExpoSpeechRecognitionModule.start({
- lang: "en-US",
- interimResults: true,
- requiresOnDeviceRecognition: useOnDevice,
- addsPunctuation: true,
- });
-
- setStatus("recording");
- } catch (err) {
- log.error("Failed to start speech recognition", err);
- setError("Failed to start speech recognition");
- setStatus("error");
- }
- }, [removeListeners, handleFinalEvent]);
-
- const stopRecording = useCallback(async (): Promise<void> => {
- // Engine already auto-finished — transcript was delivered via callback.
- if (status !== "recording") return;
-
- setStatus("transcribing");
-
- try {
- ExpoSpeechRecognitionModule.stop();
- } catch (err) {
- log.warn("Speech recognition stop failed", err);
- }
-
- // Wait briefly for the platform's final event so the transcript is fully
- // formed. Some Android engines never fire result/end after a manual stop;
- // the timeout flushes whatever interim results we captured so the caller
- // doesn't hang on "Transcribing…" forever.
- await new Promise<void>((resolve) => {
- let settled = false;
- const finish = () => {
- if (settled) return;
- settled = true;
- resolve();
- };
- const timeoutId = setTimeout(() => {
- log.warn("stop timeout — flushing interim transcript");
- const text = transcriptRef.current.trim();
- removeListeners();
- transcriptRef.current = "";
- stopWaitRef.current = null;
- setStatus("idle");
- if (text) onTranscriptRef.current?.(text);
- finish();
- }, 1500);
- stopWaitRef.current = () => {
- clearTimeout(timeoutId);
- finish();
- };
- });
- }, [status, removeListeners]);
-
- const cancelRecording = useCallback(async () => {
- canceledRef.current = true;
- try {
- ExpoSpeechRecognitionModule.abort();
- } catch {}
- removeListeners();
- transcriptRef.current = "";
- const waiter = stopWaitRef.current;
- stopWaitRef.current = null;
- setStatus("idle");
- setError(null);
- waiter?.();
- }, [removeListeners]);
-
- // Tear down any in-flight recognition on unmount so events don't dispatch
- // into a torn-down component.
- useEffect(() => {
- return () => {
- try {
- ExpoSpeechRecognitionModule.abort();
- } catch {}
- removeListeners();
- };
- }, [removeListeners]);
-
- return {
- status,
- error,
- startRecording,
- stopRecording,
- cancelRecording,
- };
-}
diff --git a/products/desktop/apps/mobile/src/features/chat/index.ts b/products/desktop/apps/mobile/src/features/chat/index.ts
deleted file mode 100644
index f1935307071e..000000000000
--- a/products/desktop/apps/mobile/src/features/chat/index.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-// Shared chat-style UI primitives reused by tasks and inbox. The standalone
-// PostHog AI conversations feature has been removed, but these components
-// (markdown rendering, tool-call display, agent/human bubbles, voice input)
-// are still used elsewhere.
-
-// Components
-export { AgentMessage } from "./components/AgentMessage";
-export {
- HumanMessage,
- type HumanMessageAttachment,
- MessageFileChip,
-} from "./components/HumanMessage";
-export { MarkdownImage } from "./components/MarkdownImage";
-export { MarkdownText } from "./components/MarkdownText";
-export type {
- ToolKind,
- ToolMessageProps,
- ToolStatus,
-} from "./components/ToolMessage";
-export { deriveToolKind, ToolMessage } from "./components/ToolMessage";
-
-// Hooks
-export { usePeriodicRerender } from "./hooks/usePeriodicRerender";
-export { useVoiceRecording } from "./hooks/useVoiceRecording";
diff --git a/products/desktop/apps/mobile/src/features/chat/utils/posthogExecDisplay.test.ts b/products/desktop/apps/mobile/src/features/chat/utils/posthogExecDisplay.test.ts
deleted file mode 100644
index 168f98639432..000000000000
--- a/products/desktop/apps/mobile/src/features/chat/utils/posthogExecDisplay.test.ts
+++ /dev/null
@@ -1,115 +0,0 @@
-import {
- formatPosthogExecBody,
- getPostHogExecDisplay,
- isPostHogExecTool,
-} from "@posthog/core/sessions/posthogExecDisplay";
-import { describe, expect, it } from "vitest";
-
-describe("isPostHogExecTool", () => {
- it("matches the bare posthog exec tool", () => {
- expect(isPostHogExecTool("mcp__posthog__exec")).toBe(true);
- });
-
- it("matches plugin-prefixed variants", () => {
- expect(isPostHogExecTool("mcp__posthog_posthog__exec")).toBe(true);
- expect(isPostHogExecTool("mcp__plugin_posthog_posthog__exec")).toBe(true);
- expect(isPostHogExecTool("mcp__posthog_cloud__exec")).toBe(true);
- });
-
- it("rejects other MCP tools", () => {
- expect(isPostHogExecTool("mcp__posthog__list")).toBe(false);
- expect(isPostHogExecTool("mcp__other__exec")).toBe(false);
- expect(isPostHogExecTool("Bash")).toBe(false);
- });
-});
-
-describe("getPostHogExecDisplay", () => {
- it("collapses `call <tool>` to the bare sub-tool label", () => {
- expect(getPostHogExecDisplay({ command: "call experiment-list" })).toEqual({
- label: "List experiment",
- input: undefined,
- });
- });
-
- it("uses the JSON args portion as input", () => {
- expect(
- getPostHogExecDisplay({
- command: 'call execute-sql {"query":"SELECT 1"}',
- }),
- ).toEqual({
- label: "Execute sql",
- input: '{"query":"SELECT 1"}',
- });
- });
-
- it("formats `info <tool>` with no args", () => {
- expect(getPostHogExecDisplay({ command: "info execute-sql" })).toEqual({
- label: "Read execute-sql",
- input: undefined,
- });
- });
-
- it("does not infer an action from an unknown `all` suffix", () => {
- expect(getPostHogExecDisplay({ command: "call foo-bar-all" })).toEqual({
- label: "Foo bar all",
- input: undefined,
- });
- });
-
- it("formats `schema <tool> <field_path>` as a dotted locator", () => {
- expect(
- getPostHogExecDisplay({
- command: "schema query-trends series",
- }),
- ).toEqual({
- label: "Inspect query-trends.series",
- input: undefined,
- });
- });
-
- it("uses the regex pattern as input for search", () => {
- expect(getPostHogExecDisplay({ command: "search query-" })).toEqual({
- label: "Search tools",
- input: "query-",
- });
- });
-
- it("formats bare `tools`", () => {
- expect(getPostHogExecDisplay({ command: "tools" })).toEqual({
- label: "List tools",
- input: undefined,
- });
- });
-
- it("prefers an explicit object `input` over command-embedded args", () => {
- expect(
- getPostHogExecDisplay({
- command: "call execute-sql",
- input: { query: "SELECT 1" },
- }),
- ).toEqual({
- label: "Execute sql",
- input: '{"query":"SELECT 1"}',
- });
- });
-
- it("returns null for malformed input", () => {
- expect(getPostHogExecDisplay(undefined)).toBeNull();
- expect(getPostHogExecDisplay({})).toBeNull();
- expect(getPostHogExecDisplay({ command: "call" })).toBeNull();
- });
-});
-
-describe("formatPosthogExecBody", () => {
- it("pretty-prints JSON object payloads", () => {
- expect(formatPosthogExecBody('{"id":3}')).toBe('{\n "id": 3\n}');
- });
-
- it("returns non-JSON strings unchanged", () => {
- expect(formatPosthogExecBody("query-")).toBe("query-");
- });
-
- it("returns JSON primitives unchanged", () => {
- expect(formatPosthogExecBody("42")).toBe("42");
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/consent/components/ConsentError.tsx b/products/desktop/apps/mobile/src/features/consent/components/ConsentError.tsx
deleted file mode 100644
index ce580f8a1851..000000000000
--- a/products/desktop/apps/mobile/src/features/consent/components/ConsentError.tsx
+++ /dev/null
@@ -1,28 +0,0 @@
-import { Text } from "@components/text";
-import { Pressable, View } from "react-native";
-
-interface ConsentErrorProps {
- onRetry: () => void;
-}
-
-export function ConsentError({ onRetry }: ConsentErrorProps) {
- return (
- <View className="gap-4">
- <Text className="font-semibold text-2xl text-gray-12">
- Couldn't check organization consent
- </Text>
- <Text className="text-base text-gray-11">
- Check your connection and try again. If it keeps happening, contact
- support.
- </Text>
- <Pressable
- className="mt-1 items-center rounded-lg bg-accent-9 py-3 active:opacity-80"
- onPress={onRetry}
- >
- <Text className="font-semibold text-accent-contrast text-sm">
- Retry
- </Text>
- </Pressable>
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/consent/components/ConsentPanel.test.tsx b/products/desktop/apps/mobile/src/features/consent/components/ConsentPanel.test.tsx
deleted file mode 100644
index dcce208c9338..000000000000
--- a/products/desktop/apps/mobile/src/features/consent/components/ConsentPanel.test.tsx
+++ /dev/null
@@ -1,80 +0,0 @@
-import { createElement } from "react";
-import { act, create } from "react-test-renderer";
-import { describe, expect, it, vi } from "vitest";
-import { ConsentPanel } from "./ConsentPanel";
-
-type Renderer = NonNullable<ReturnType<typeof create>>;
-
-function render(props: Partial<Parameters<typeof ConsentPanel>[0]> = {}) {
- let renderer!: Renderer;
- act(() => {
- renderer = create(
- createElement(ConsentPanel, {
- organizationName: "Acme",
- needsAiConsent: true,
- needsBetaTerms: false,
- isAdmin: true,
- onAcceptAi: vi.fn(async () => {}),
- onAcceptBeta: vi.fn(async () => {}),
- ...props,
- }),
- );
- });
- return renderer;
-}
-
-function texts(renderer: Renderer): string[] {
- return renderer.root
- .findAll((node) => typeof node.props.children === "string")
- .map((node) => node.props.children as string);
-}
-
-function acceptButton(renderer: Renderer) {
- return renderer.root.find(
- (node) =>
- typeof node.props.onPress === "function" && "disabled" in node.props,
- );
-}
-
-describe("ConsentPanel", () => {
- it("shows the accept action for an admin", () => {
- const renderer = render({ isAdmin: true });
- expect(texts(renderer)).toContain("Approve AI data processing");
- });
-
- it("directs a non-admin to an org admin with no accept action", () => {
- const renderer = render({ isAdmin: false });
- const content = texts(renderer);
- expect(content).toContain(
- "Ask an organization admin to approve AI data processing.",
- );
- expect(content).not.toContain("Approve AI data processing");
- });
-
- it("cannot be double-submitted while a request is in flight", async () => {
- let resolveAccept!: () => void;
- const onAcceptAi = vi.fn(
- () =>
- new Promise<void>((resolve) => {
- resolveAccept = resolve;
- }),
- );
- const renderer = render({ isAdmin: true, onAcceptAi });
-
- act(() => {
- acceptButton(renderer).props.onPress();
- });
- act(() => {
- acceptButton(renderer).props.onPress();
- });
-
- expect(onAcceptAi).toHaveBeenCalledTimes(1);
- expect(acceptButton(renderer).props.disabled).toBe(true);
-
- await act(async () => {
- resolveAccept();
- });
-
- expect(acceptButton(renderer).props.disabled).toBe(false);
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/consent/components/ConsentPanel.tsx b/products/desktop/apps/mobile/src/features/consent/components/ConsentPanel.tsx
deleted file mode 100644
index 739f9470f6ed..000000000000
--- a/products/desktop/apps/mobile/src/features/consent/components/ConsentPanel.tsx
+++ /dev/null
@@ -1,165 +0,0 @@
-import { Text } from "@components/text";
-import { useState } from "react";
-import { ActivityIndicator, Pressable, View } from "react-native";
-import { openExternalUrl } from "@/lib/openExternalUrl";
-import { useThemeColors } from "@/lib/theme";
-
-type Requirement = "ai" | "beta";
-
-interface ConsentPanelProps {
- organizationName?: string;
- needsAiConsent: boolean;
- needsBetaTerms: boolean;
- isAdmin: boolean;
- onAcceptAi: () => Promise<void>;
- onAcceptBeta: () => Promise<void>;
-}
-
-const ERROR_COPY: Record<Requirement, string> = {
- ai: "Couldn't approve AI data processing. Try again, or contact support.",
- beta: "Couldn't save your beta terms acceptance. Try again, or contact support.",
-};
-
-export function ConsentPanel({
- organizationName,
- needsAiConsent,
- needsBetaTerms,
- isAdmin,
- onAcceptAi,
- onAcceptBeta,
-}: ConsentPanelProps) {
- const [submitting, setSubmitting] = useState<Requirement | null>(null);
- const [error, setError] = useState<string | null>(null);
-
- const accept = async (kind: Requirement): Promise<void> => {
- if (submitting) return;
- setError(null);
- setSubmitting(kind);
- try {
- await (kind === "ai" ? onAcceptAi() : onAcceptBeta());
- } catch {
- setError(ERROR_COPY[kind]);
- } finally {
- setSubmitting(null);
- }
- };
-
- return (
- <View className="gap-5">
- <View className="gap-1">
- <Text className="font-semibold text-2xl text-gray-12">
- Before you continue
- </Text>
- <Text className="text-base text-gray-11">
- {organizationName
- ? `Review the required items for ${organizationName}.`
- : "Review the required items for your organization."}
- </Text>
- </View>
-
- {needsAiConsent && (
- <ConsentCard
- title="PostHog AI needs approval"
- summary={
- organizationName
- ? `${organizationName} hasn't approved AI data processing yet.`
- : "Your organization hasn't approved AI data processing yet."
- }
- detail="PostHog AI features process identifying user data with external AI providers. Your data won't be used to train their models."
- actionLabel="Approve AI data processing"
- adminHelp="Ask an organization admin to approve AI data processing."
- isAdmin={isAdmin}
- isSubmitting={submitting === "ai"}
- isDisabled={submitting !== null}
- onAccept={() => void accept("ai")}
- />
- )}
-
- {needsBetaTerms && (
- <ConsentCard
- title="PostHog Desktop beta terms"
- summary="Accept the additional data-processing terms for the PostHog Desktop beta."
- detail="PostHog Desktop uses Baseten and Modal to process customer data, personal data, and PII. They aren't listed as PostHog subprocessors for this feature yet. Your organization agrees to proceed. This beta may change or be discontinued."
- actionLabel="Accept beta terms"
- adminHelp="Ask an organization admin to accept the Desktop beta terms."
- isAdmin={isAdmin}
- isSubmitting={submitting === "beta"}
- isDisabled={submitting !== null}
- onAccept={() => void accept("beta")}
- link={{
- label: "View PostHog subprocessors",
- url: "https://posthog.com/subprocessors",
- }}
- />
- )}
-
- {error && (
- <View className="rounded-lg border border-status-error bg-status-error/10 p-3">
- <Text className="text-sm text-status-error">{error}</Text>
- </View>
- )}
- </View>
- );
-}
-
-interface ConsentCardProps {
- title: string;
- summary: string;
- detail: string;
- actionLabel: string;
- adminHelp: string;
- isAdmin: boolean;
- isSubmitting: boolean;
- isDisabled: boolean;
- onAccept: () => void;
- link?: { label: string; url: string };
-}
-
-function ConsentCard({
- title,
- summary,
- detail,
- actionLabel,
- adminHelp,
- isAdmin,
- isSubmitting,
- isDisabled,
- onAccept,
- link,
-}: ConsentCardProps) {
- const themeColors = useThemeColors();
-
- return (
- <View className="gap-3 rounded-lg border border-gray-6 bg-gray-2 p-4">
- <View className="gap-1">
- <Text className="font-semibold text-base text-gray-12">{title}</Text>
- <Text className="text-gray-11 text-sm">{summary}</Text>
- </View>
- <Text className="text-gray-11 text-sm leading-5">{detail}</Text>
- {link && (
- <Pressable onPress={() => openExternalUrl(link.url)}>
- <Text className="text-accent-11 text-sm">{link.label}</Text>
- </Pressable>
- )}
- {isAdmin ? (
- <Pressable
- className={`mt-1 items-center rounded-lg py-3 ${
- isDisabled ? "bg-gray-7" : "bg-accent-9 active:opacity-80"
- }`}
- onPress={onAccept}
- disabled={isDisabled}
- >
- {isSubmitting ? (
- <ActivityIndicator color={themeColors.accent.contrast} />
- ) : (
- <Text className="font-semibold text-accent-contrast text-sm">
- {actionLabel}
- </Text>
- )}
- </Pressable>
- ) : (
- <Text className="text-gray-11 text-sm">{adminHelp}</Text>
- )}
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/consent/consentState.test.ts b/products/desktop/apps/mobile/src/features/consent/consentState.test.ts
deleted file mode 100644
index 50e68e9b2ceb..000000000000
--- a/products/desktop/apps/mobile/src/features/consent/consentState.test.ts
+++ /dev/null
@@ -1,100 +0,0 @@
-import { describe, expect, it } from "vitest";
-import { deriveOrgConsent, type OrgConsentInputs } from "./consentState";
-
-describe("deriveOrgConsent", () => {
- const org = (approved: boolean | undefined) => ({
- is_ai_data_processing_approved: approved,
- });
-
- it.each<{
- name: string;
- inputs: OrgConsentInputs;
- expected: ReturnType<typeof deriveOrgConsent>;
- }>([
- {
- name: "loading while the user has not resolved",
- inputs: {
- organization: undefined,
- betaTermsAccepted: undefined,
- hasError: false,
- },
- expected: { status: "loading" },
- },
- {
- name: "loading while beta terms are still pending",
- inputs: {
- organization: org(true),
- betaTermsAccepted: undefined,
- hasError: false,
- },
- expected: { status: "loading" },
- },
- {
- name: "error takes priority over loaded data",
- inputs: {
- organization: org(true),
- betaTermsAccepted: true,
- hasError: true,
- },
- expected: { status: "error" },
- },
- {
- name: "both requirements unmet",
- inputs: {
- organization: org(false),
- betaTermsAccepted: false,
- hasError: false,
- },
- expected: {
- status: "resolved",
- needsAiConsent: true,
- needsBetaTerms: true,
- satisfied: false,
- },
- },
- {
- name: "only beta terms unmet",
- inputs: {
- organization: org(true),
- betaTermsAccepted: false,
- hasError: false,
- },
- expected: {
- status: "resolved",
- needsAiConsent: false,
- needsBetaTerms: true,
- satisfied: false,
- },
- },
- {
- name: "only AI consent unmet",
- inputs: {
- organization: org(false),
- betaTermsAccepted: true,
- hasError: false,
- },
- expected: {
- status: "resolved",
- needsAiConsent: true,
- needsBetaTerms: false,
- satisfied: false,
- },
- },
- {
- name: "both requirements satisfied",
- inputs: {
- organization: org(true),
- betaTermsAccepted: true,
- hasError: false,
- },
- expected: {
- status: "resolved",
- needsAiConsent: false,
- needsBetaTerms: false,
- satisfied: true,
- },
- },
- ])("returns $name", ({ inputs, expected }) => {
- expect(deriveOrgConsent(inputs)).toEqual(expected);
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/consent/consentState.ts b/products/desktop/apps/mobile/src/features/consent/consentState.ts
deleted file mode 100644
index 6b8e735f1941..000000000000
--- a/products/desktop/apps/mobile/src/features/consent/consentState.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-export type OrgConsent =
- | { status: "loading" }
- | { status: "error" }
- | {
- status: "resolved";
- needsAiConsent: boolean;
- needsBetaTerms: boolean;
- satisfied: boolean;
- };
-
-export interface OrgConsentInputs {
- organization: { is_ai_data_processing_approved?: boolean } | undefined;
- betaTermsAccepted: boolean | undefined;
- hasError: boolean;
-}
-
-export function deriveOrgConsent({
- organization,
- betaTermsAccepted,
- hasError,
-}: OrgConsentInputs): OrgConsent {
- if (hasError) {
- return { status: "error" };
- }
- if (!organization || betaTermsAccepted === undefined) {
- return { status: "loading" };
- }
-
- const needsAiConsent = organization.is_ai_data_processing_approved !== true;
- const needsBetaTerms = !betaTermsAccepted;
- return {
- status: "resolved",
- needsAiConsent,
- needsBetaTerms,
- satisfied: !needsAiConsent && !needsBetaTerms,
- };
-}
diff --git a/products/desktop/apps/mobile/src/features/consent/hooks/useOrgConsent.ts b/products/desktop/apps/mobile/src/features/consent/hooks/useOrgConsent.ts
deleted file mode 100644
index f9d93e8e8542..000000000000
--- a/products/desktop/apps/mobile/src/features/consent/hooks/useOrgConsent.ts
+++ /dev/null
@@ -1,49 +0,0 @@
-import { useQuery, useQueryClient } from "@tanstack/react-query";
-import { useCallback } from "react";
-import { useUserQuery } from "@/features/auth/hooks/useUserQuery";
-import { useAuthStore } from "@/features/auth/stores/authStore";
-import { getPostHogApiClient } from "@/lib/posthogApiClient";
-import { deriveOrgConsent, type OrgConsent } from "../consentState";
-
-export type OrgConsentResult = OrgConsent & { retry: () => void };
-
-export const desktopBetaTermsKeys = {
- all: () => ["consent", "desktop-beta-terms"] as const,
- acceptance: (organizationId: string) =>
- [...desktopBetaTermsKeys.all(), organizationId] as const,
-};
-
-export function useDesktopBetaTerms(organizationId: string | undefined) {
- const isAuthenticated = useAuthStore((s) => s.isAuthenticated);
- return useQuery({
- queryKey: desktopBetaTermsKeys.acceptance(organizationId ?? "unknown"),
- queryFn: () => {
- if (!organizationId) throw new Error("No organization");
- return getPostHogApiClient().areDesktopBetaTermsAccepted();
- },
- enabled: isAuthenticated && !!organizationId,
- staleTime: 5 * 60 * 1000,
- });
-}
-
-export function useOrgConsent(): OrgConsentResult {
- const userQuery = useUserQuery();
- const organization = userQuery.data?.organization;
- const betaTermsQuery = useDesktopBetaTerms(organization?.id);
- const queryClient = useQueryClient();
-
- const retry = useCallback(() => {
- void queryClient.invalidateQueries({ queryKey: ["user"] });
- void queryClient.invalidateQueries({
- queryKey: desktopBetaTermsKeys.all(),
- });
- }, [queryClient]);
-
- const consent = deriveOrgConsent({
- organization,
- betaTermsAccepted: betaTermsQuery.data,
- hasError: userQuery.isError || betaTermsQuery.isError,
- });
-
- return { ...consent, retry };
-}
diff --git a/products/desktop/apps/mobile/src/features/inbox/activityLog.test.ts b/products/desktop/apps/mobile/src/features/inbox/activityLog.test.ts
deleted file mode 100644
index 84d202fcdd5f..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/activityLog.test.ts
+++ /dev/null
@@ -1,159 +0,0 @@
-import {
- attributionLabel,
- taskRunLabel,
-} from "@posthog/core/inbox/activityLog";
-import type { AnySignalReportArtefact } from "@posthog/shared/domain-types";
-import { describe, expect, it } from "vitest";
-import {
- parseDiffLines,
- selectActivityArtefacts,
- shortSha,
-} from "./activityLog";
-
-function commit(id: string, createdAt: string): AnySignalReportArtefact {
- return {
- id,
- type: "commit",
- created_at: createdAt,
- content: {
- repository: "posthog/posthog",
- branch: "main",
- commit_sha: "abcdef1234567890",
- message: "fix",
- },
- };
-}
-
-function taskRun(id: string, createdAt: string): AnySignalReportArtefact {
- return {
- id,
- type: "task_run",
- created_at: createdAt,
- content: { task_id: "t1", product: "signals", type: "research" },
- };
-}
-
-describe("selectActivityArtefacts", () => {
- it("keeps only commit, task_run and parsed ranking_score, sorted oldest-first", () => {
- const artefacts: AnySignalReportArtefact[] = [
- taskRun("b", "2026-01-02T00:00:00Z"),
- {
- id: "x",
- type: "note",
- created_at: "2026-01-03T00:00:00Z",
- content: { note: "" },
- },
- commit("a", "2026-01-01T00:00:00Z"),
- {
- id: "r",
- type: "ranking_score",
- created_at: "2026-01-04T00:00:00Z",
- content: {
- scored_at: null,
- manifest_version: null,
- served: {
- key: "m@1",
- roles: ["served"],
- status: "scored",
- skip_reason: null,
- heads: [],
- },
- challengers: [],
- },
- },
- {
- id: "degraded",
- type: "ranking_score",
- created_at: "2026-01-05T00:00:00Z",
- content: { content: "{}" },
- degraded: true,
- } as AnySignalReportArtefact,
- ];
-
- expect(selectActivityArtefacts(artefacts).map((a) => a.id)).toEqual([
- "a",
- "b",
- "r",
- ]);
- });
-
- it("returns an empty list when there is no activity", () => {
- const artefacts: AnySignalReportArtefact[] = [
- {
- id: "x",
- type: "note",
- created_at: "2026-01-01T00:00:00Z",
- content: { note: "" },
- },
- ];
- expect(selectActivityArtefacts(artefacts)).toEqual([]);
- });
-});
-
-describe("shortSha", () => {
- it("truncates to 12 characters", () => {
- expect(shortSha("abcdef1234567890")).toBe("abcdef123456");
- });
-});
-
-describe("taskRunLabel", () => {
- it.each([
- [
- "maps known signals task type to friendly label",
- "signals",
- "repo_selection",
- "Repo selection",
- ],
- [
- "humanizes unknown signals task type",
- "signals",
- "unknown_op",
- "Unknown op",
- ],
- [
- "humanizes identifiers for other products",
- "custom",
- "code-review",
- "Code review",
- ],
- ] as const)("%s", (_desc, product, type, expected) => {
- expect(taskRunLabel({ product, type })).toBe(expected);
- });
-});
-
-describe("attributionLabel", () => {
- it.each([
- [
- "prefers first name over email",
- { created_by: { first_name: "Ada", email: "[email protected]" } },
- "Ada",
- ],
- [
- "falls back to email when first name is absent",
- { created_by: { email: "[email protected]" } },
- ],
- ["returns 'agent' when only task_id is set", { task_id: "t1" }, "agent"],
- ["returns null when no attribution is present", {}, null],
- ] as const)("%s", (_desc, input, expected) => {
- expect(attributionLabel(input)).toBe(expected);
- });
-});
-
-describe("parseDiffLines", () => {
- it("classifies added, removed, hunk and context lines", () => {
- const lines = parseDiffLines(
- ["@@ -1 +1 @@", "+added", "-removed", " ctx", "+++ b/f", "--- a/f"].join(
- "\n",
- ),
- );
- expect(lines.map((l) => l.kind)).toEqual([
- "hunk",
- "add",
- "del",
- "context",
- "context",
- "context",
- ]);
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/inbox/activityLog.ts b/products/desktop/apps/mobile/src/features/inbox/activityLog.ts
deleted file mode 100644
index 51a84707f15b..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/activityLog.ts
+++ /dev/null
@@ -1,47 +0,0 @@
-import type { AnySignalReportArtefact } from "@posthog/shared/domain-types";
-
-export type ActivityArtefact = Extract<
- AnySignalReportArtefact,
- { type: "commit" | "task_run" | "ranking_score" }
->;
-
-export function selectActivityArtefacts(
- artefacts: AnySignalReportArtefact[],
-): ActivityArtefact[] {
- return artefacts
- .filter(
- (artefact): artefact is ActivityArtefact =>
- artefact.type === "commit" ||
- artefact.type === "task_run" ||
- // A degraded score has no heads to show.
- (artefact.type === "ranking_score" && !artefact.degraded),
- )
- .sort((left, right) => left.created_at.localeCompare(right.created_at));
-}
-
-export function shortSha(sha: string): string {
- return sha.slice(0, 12);
-}
-
-export type DiffLineKind = "add" | "del" | "hunk" | "context";
-
-export interface DiffLine {
- text: string;
- kind: DiffLineKind;
-}
-
-export function parseDiffLines(diff: string): DiffLine[] {
- return diff
- .replace(/\n$/, "")
- .split("\n")
- .map((text) => {
- if (text.startsWith("+") && !text.startsWith("+++")) {
- return { text, kind: "add" as const };
- }
- if (text.startsWith("-") && !text.startsWith("---")) {
- return { text, kind: "del" as const };
- }
- if (text.startsWith("@@")) return { text, kind: "hunk" as const };
- return { text, kind: "context" as const };
- });
-}
diff --git a/products/desktop/apps/mobile/src/features/inbox/api.ts b/products/desktop/apps/mobile/src/features/inbox/api.ts
deleted file mode 100644
index 1afbcb3c8bca..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/api.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { extractRepoSelectionRepository } from "@posthog/core/inbox/artefacts";
-import { getPostHogApiClient } from "@/lib/posthogApiClient";
-
-/** Resolve the repository associated with a signal report via its repo_selection artefact. */
-export async function getReportRepository(
- reportId: string,
-): Promise<string | null> {
- const { results } =
- await getPostHogApiClient().getSignalReportArtefacts(reportId);
- return extractRepoSelectionRepository(results);
-}
diff --git a/products/desktop/apps/mobile/src/features/inbox/components/ArchivedReportList.tsx b/products/desktop/apps/mobile/src/features/inbox/components/ArchivedReportList.tsx
deleted file mode 100644
index 03524e145dbc..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/components/ArchivedReportList.tsx
+++ /dev/null
@@ -1,239 +0,0 @@
-import { Text } from "@components/text";
-import { isRestorableReport } from "@posthog/core/inbox/reportMembership";
-import { inboxStatusLabel } from "@posthog/core/inbox/reportPresentation";
-import { dismissalReasonLabel } from "@posthog/shared";
-import type { SignalReport } from "@posthog/shared/domain-types";
-import * as Haptics from "expo-haptics";
-import { ArrowCounterClockwise, Tray } from "phosphor-react-native";
-import { memo, useCallback, useEffect, useRef, useState } from "react";
-import {
- ActivityIndicator,
- FlatList,
- Pressable,
- RefreshControl,
- View,
-} from "react-native";
-import { useThemeColors } from "@/lib/theme";
-import { useArchivedReports, useRestoreReport } from "../hooks/useInboxReports";
-import { formatReportTimestamp } from "../utils";
-
-interface ArchivedReportListProps {
- onReportPress?: (report: SignalReport) => void;
- contentInsetTop?: number;
-}
-
-type Feedback = { kind: "success" | "info" | "error"; text: string };
-
-interface ArchivedRowProps {
- report: SignalReport;
- onPress: (report: SignalReport) => void;
- onRestore: (reportId: string) => void;
- restoring: boolean;
-}
-
-const ArchivedRow = memo(function ArchivedRow({
- report,
- onPress,
- onRestore,
- restoring,
-}: ArchivedRowProps) {
- const themeColors = useThemeColors();
- const when = formatReportTimestamp(new Date(report.updated_at));
- const restorable = isRestorableReport(report);
- const reasonLabel = report.dismissal_reason
- ? dismissalReasonLabel(report.dismissal_reason)
- : null;
-
- return (
- <Pressable
- onPress={() => onPress(report)}
- className="flex-row items-start gap-2.5 border-gray-6 border-b px-3 py-2.5 active:bg-gray-3"
- >
- <View className="min-w-0 flex-1">
- <Text
- className="font-medium text-[14px] text-gray-12 leading-snug"
- numberOfLines={2}
- ellipsizeMode="tail"
- >
- {report.title ?? "Untitled report"}
- </Text>
-
- <View className="mt-1 flex-row flex-wrap items-center gap-2">
- {restorable ? (
- <Text className="text-[11px] text-gray-9">Archived {when}</Text>
- ) : (
- <>
- <Text className="rounded bg-status-success/20 px-1.5 py-0.5 font-medium text-[11px] text-status-success">
- {inboxStatusLabel(report.status)}
- </Text>
- <Text className="text-[11px] text-gray-9">{when}</Text>
- </>
- )}
- {reasonLabel ? (
- <Text className="rounded bg-gray-3 px-1.5 py-0.5 text-[11px] text-gray-11">
- {reasonLabel}
- </Text>
- ) : null}
- </View>
- </View>
-
- {restorable ? (
- <Pressable
- onPress={() => onRestore(report.id)}
- disabled={restoring}
- hitSlop={8}
- accessibilityLabel="Restore report to inbox"
- accessibilityRole="button"
- className="flex-row items-center gap-1.5 self-center rounded-full border border-gray-6 px-3 py-1.5 active:bg-gray-3"
- >
- {restoring ? (
- <ActivityIndicator size="small" color={themeColors.gray[11]} />
- ) : (
- <>
- <ArrowCounterClockwise size={14} color={themeColors.gray[11]} />
- <Text className="font-medium text-[12px] text-gray-11">
- Restore
- </Text>
- </>
- )}
- </Pressable>
- ) : null}
- </Pressable>
- );
-});
-
-export function ArchivedReportList({
- onReportPress,
- contentInsetTop = 0,
-}: ArchivedReportListProps) {
- const { reports, isLoading, error, refetch } = useArchivedReports();
- const themeColors = useThemeColors();
- const restore = useRestoreReport();
- const [feedback, setFeedback] = useState<Feedback | null>(null);
- const feedbackTimer = useRef<ReturnType<typeof setTimeout> | null>(null);
-
- const showFeedback = useCallback((next: Feedback) => {
- setFeedback(next);
- if (feedbackTimer.current) clearTimeout(feedbackTimer.current);
- feedbackTimer.current = setTimeout(() => setFeedback(null), 4000);
- }, []);
-
- useEffect(() => {
- return () => {
- if (feedbackTimer.current) clearTimeout(feedbackTimer.current);
- };
- }, []);
-
- const handlePress = useCallback(
- (report: SignalReport) => onReportPress?.(report),
- [onReportPress],
- );
-
- const restoreMutate = restore.mutate;
- const handleRestore = useCallback(
- (reportId: string) => {
- restoreMutate(reportId, {
- onSuccess: (restored) => {
- Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success);
- showFeedback(
- restored
- ? { kind: "success", text: "Restored to inbox" }
- : { kind: "info", text: "Already back in your inbox" },
- );
- },
- onError: (err) => {
- Haptics.notificationAsync(Haptics.NotificationFeedbackType.Error);
- showFeedback({
- kind: "error",
- text: err.message || "Failed to restore report",
- });
- },
- });
- },
- [restoreMutate, showFeedback],
- );
-
- if (error) {
- return (
- <View className="flex-1 items-center justify-center p-6">
- <Text className="mb-4 text-center text-status-error">{error}</Text>
- <Pressable
- onPress={() => refetch()}
- className="rounded-lg bg-gray-3 px-4 py-2"
- >
- <Text className="text-gray-12">Retry</Text>
- </Pressable>
- </View>
- );
- }
-
- if (isLoading && reports.length === 0) {
- return (
- <View className="flex-1 items-center justify-center">
- <ActivityIndicator size="large" color={themeColors.accent[9]} />
- <Text className="mt-4 text-gray-11">Loading archive...</Text>
- </View>
- );
- }
-
- if (reports.length === 0) {
- return (
- <View className="flex-1 items-center justify-center p-6">
- <View className="mb-6 h-16 w-16 items-center justify-center rounded-full bg-gray-3">
- <Tray size={28} color={themeColors.gray[10]} />
- </View>
- <Text className="mb-2 text-center font-semibold text-[16px] text-gray-12">
- Archive is empty
- </Text>
- <Text className="text-center text-[13px] text-gray-11">
- Dismissed and resolved reports show up here.
- </Text>
- </View>
- );
- }
-
- return (
- <View className="flex-1">
- <FlatList
- data={reports}
- keyExtractor={(item) => item.id}
- renderItem={({ item }) => (
- <ArchivedRow
- report={item}
- onPress={handlePress}
- onRestore={handleRestore}
- restoring={restore.isPending && restore.variables === item.id}
- />
- )}
- refreshControl={
- <RefreshControl
- refreshing={isLoading}
- onRefresh={() => refetch()}
- tintColor={themeColors.accent[9]}
- progressViewOffset={contentInsetTop}
- />
- }
- contentContainerStyle={{
- paddingTop: contentInsetTop,
- paddingBottom: 100,
- }}
- />
-
- {feedback ? (
- <View
- className={`absolute inset-x-4 bottom-24 rounded-xl px-4 py-3 shadow-lg ${
- feedback.kind === "success"
- ? "bg-status-success"
- : feedback.kind === "error"
- ? "bg-status-error"
- : "bg-gray-12"
- }`}
- >
- <Text className="text-center font-medium text-[14px] text-white">
- {feedback.text}
- </Text>
- </View>
- ) : null}
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/inbox/components/ArtefactCommit.tsx b/products/desktop/apps/mobile/src/features/inbox/components/ArtefactCommit.tsx
deleted file mode 100644
index 19f4cc2510e3..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/components/ArtefactCommit.tsx
+++ /dev/null
@@ -1,80 +0,0 @@
-import { Text } from "@components/text";
-import type { CommitContent } from "@posthog/shared/domain-types";
-import { CaretDown, CaretRight } from "phosphor-react-native";
-import { useState } from "react";
-import { ActivityIndicator, Pressable, View } from "react-native";
-import { useThemeColors } from "@/lib/theme";
-import { shortSha } from "../activityLog";
-import { useCommitDiff } from "../hooks/useInboxReports";
-import { DiffBlock } from "./DiffBlock";
-
-export function ArtefactCommit({
- reportId,
- artefactId,
- content,
-}: {
- reportId: string;
- artefactId: string;
- content: CommitContent;
-}) {
- const themeColors = useThemeColors();
- const [expanded, setExpanded] = useState(false);
- const diffQuery = useCommitDiff(reportId, artefactId, expanded);
-
- return (
- <View>
- <Text className="text-[13px] text-gray-12">{content.message}</Text>
- <Text className="font-mono text-[11px] text-gray-9">
- {shortSha(content.commit_sha)} · {content.repository}@{content.branch}
- </Text>
- {content.note?.trim() ? (
- <Text className="mt-0.5 text-[12px] text-gray-11">{content.note}</Text>
- ) : null}
-
- <Pressable
- onPress={() => setExpanded((v) => !v)}
- hitSlop={6}
- accessibilityRole="button"
- accessibilityState={{ expanded }}
- className="mt-1.5 flex-row items-center gap-1 self-start py-1 active:opacity-60"
- >
- {expanded ? (
- <CaretDown size={12} color={themeColors.gray[11]} />
- ) : (
- <CaretRight size={12} color={themeColors.gray[11]} />
- )}
- <Text className="text-[12px] text-gray-11">
- {expanded ? "Hide diff" : "View diff"}
- </Text>
- </Pressable>
-
- {expanded ? (
- <View className="mt-1.5">
- {diffQuery.isLoading ? (
- <View className="flex-row items-center gap-2">
- <ActivityIndicator size="small" color={themeColors.gray[9]} />
- <Text className="text-[12px] text-gray-9">Fetching diff…</Text>
- </View>
- ) : diffQuery.isError ? (
- <Text className="text-[12px] text-status-error">
- Couldn’t load the diff.
- </Text>
- ) : diffQuery.data?.diff.trim() ? (
- <>
- <DiffBlock diff={diffQuery.data.diff} />
- {diffQuery.data.truncated ? (
- <Text className="mt-1 text-[11px] text-gray-9">
- Diff truncated — too large to display in full.
- </Text>
- ) : null}
- </>
- ) : (
- <Text className="text-[12px] text-gray-9">
- No changes recorded for this commit.
- </Text>
- )}
- </View>
- ) : null}
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/inbox/components/ArtefactRankingScore.tsx b/products/desktop/apps/mobile/src/features/inbox/components/ArtefactRankingScore.tsx
deleted file mode 100644
index f8edc5fc00c6..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/components/ArtefactRankingScore.tsx
+++ /dev/null
@@ -1,85 +0,0 @@
-import { Text } from "@components/text";
-import { humanizeIdentifier } from "@posthog/core/inbox/activityLog";
-import {
- formatRankingLift,
- formatRankingProbability,
- rankingLiftBarPercent,
-} from "@posthog/core/inbox/rankingFormat";
-import type {
- RankingHead,
- RankingScoreContent,
-} from "@posthog/shared/domain-types";
-import { View } from "react-native";
-
-function RankingHeadRow({ head }: { head: RankingHead }) {
- const tone = head.readable ? "text-gray-12" : "text-gray-10";
- const values = [
- humanizeIdentifier(head.name),
- head.lift !== null ? formatRankingLift(head.lift) : null,
- formatRankingProbability(head.probability),
- head.readable ? null : "no holdout read yet",
- ];
- return (
- <View
- className="flex-row items-center gap-2"
- accessible
- accessibilityLabel={values.filter(Boolean).join(", ")}
- >
- <Text className={`w-24 text-[12px] ${tone}`} numberOfLines={1}>
- {humanizeIdentifier(head.name)}
- </Text>
- <View className="relative h-1.5 flex-1 overflow-hidden rounded-full bg-gray-4">
- {head.lift !== null ? (
- <View
- className={`h-full rounded-full ${head.readable ? "bg-accent-9" : "bg-gray-8"}`}
- style={{ width: `${rankingLiftBarPercent(head.lift)}%` }}
- />
- ) : null}
- <View className="absolute top-0 bottom-0 left-1/2 w-px bg-gray-9" />
- </View>
- <Text
- className={`min-w-10 text-right text-[12px] ${tone}`}
- numberOfLines={1}
- >
- {head.lift !== null ? formatRankingLift(head.lift) : ""}
- </Text>
- <Text
- className="min-w-11 text-right text-[12px] text-gray-10"
- numberOfLines={1}
- >
- {formatRankingProbability(head.probability)}
- </Text>
- </View>
- );
-}
-
-/** The served model's heads. Dimmed heads have no holdout read yet. */
-export function ArtefactRankingScore({
- content,
-}: {
- content: RankingScoreContent;
-}) {
- const { served } = content;
- const hasUnreadable = served.heads.some((head) => !head.readable);
- return (
- <View className="gap-1">
- {served.status === "skipped" || served.heads.length === 0 ? (
- <Text className="text-[12px] text-gray-10">
- Skipped{served.skip_reason ? `: ${served.skip_reason}` : ""}
- </Text>
- ) : (
- served.heads.map((head) => (
- <RankingHeadRow key={head.name} head={head} />
- ))
- )}
- {hasUnreadable ? (
- <Text className="text-[11px] text-gray-9">
- Dimmed heads have no holdout read yet.
- </Text>
- ) : null}
- <Text className="font-mono text-[11px] text-gray-9" numberOfLines={1}>
- {served.key}
- </Text>
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/inbox/components/ArtefactTaskRun.tsx b/products/desktop/apps/mobile/src/features/inbox/components/ArtefactTaskRun.tsx
deleted file mode 100644
index f7d5f2d1546b..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/components/ArtefactTaskRun.tsx
+++ /dev/null
@@ -1,49 +0,0 @@
-import { Text } from "@components/text";
-import { taskRunLabel } from "@posthog/core/inbox/activityLog";
-import type { TaskRunArtefactContent } from "@posthog/shared/domain-types";
-import { useRouter } from "expo-router";
-import { CaretRight } from "phosphor-react-native";
-import { Pressable, View } from "react-native";
-import { useTask } from "@/features/tasks";
-import { useThemeColors } from "@/lib/theme";
-
-export function ArtefactTaskRun({
- content,
-}: {
- content: TaskRunArtefactContent;
-}) {
- const router = useRouter();
- const themeColors = useThemeColors();
- const taskQuery = useTask(content.task_id);
-
- const task = taskQuery.data;
- const label = taskRunLabel(content);
- const status = task?.latest_run?.status;
-
- return (
- <Pressable
- onPress={() => router.push(`/task/${content.task_id}`)}
- hitSlop={4}
- accessibilityRole="button"
- className="flex-row items-center gap-2 py-1 active:opacity-60"
- >
- <View className="rounded bg-gray-4 px-1.5 py-0.5">
- <Text className="font-medium text-[11px] text-gray-11">{label}</Text>
- </View>
- <Text
- className="min-w-0 flex-1 text-[13px] text-gray-12"
- numberOfLines={1}
- >
- {taskQuery.isLoading
- ? "Loading task…"
- : (task?.title ?? content.task_id)}
- </Text>
- {status ? (
- <View className="rounded bg-gray-4 px-1.5 py-0.5">
- <Text className="text-[11px] text-gray-11">{status}</Text>
- </View>
- ) : null}
- <CaretRight size={14} color={themeColors.gray[9]} />
- </Pressable>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/inbox/components/ConventionalCommitTag.tsx b/products/desktop/apps/mobile/src/features/inbox/components/ConventionalCommitTag.tsx
deleted file mode 100644
index 973aa95a8690..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/components/ConventionalCommitTag.tsx
+++ /dev/null
@@ -1,71 +0,0 @@
-import { Text } from "@components/text";
-import {
- ArrowCounterClockwise,
- ArrowsClockwise,
- BookOpen,
- Broom,
- Flask,
- type Icon,
- Lightning,
- Package,
- PaintBrush,
- PlayCircle,
- Question,
- Sparkle,
- Wrench,
-} from "phosphor-react-native";
-import { View } from "react-native";
-import { type ThemeColors, useThemeColors } from "@/lib/theme";
-
-type TagColor = "green" | "blue" | "amber" | "gray";
-
-interface TypeMeta {
- icon: Icon;
- color: TagColor;
-}
-
-const TYPE_META: Record<string, TypeMeta> = {
- feat: { icon: Sparkle, color: "green" },
- fix: { icon: Wrench, color: "blue" },
- docs: { icon: BookOpen, color: "blue" },
- style: { icon: PaintBrush, color: "gray" },
- refactor: { icon: ArrowsClockwise, color: "amber" },
- test: { icon: Flask, color: "blue" },
- chore: { icon: Broom, color: "gray" },
- build: { icon: Package, color: "gray" },
- ci: { icon: PlayCircle, color: "blue" },
- perf: { icon: Lightning, color: "amber" },
- revert: { icon: ArrowCounterClockwise, color: "gray" },
-};
-
-const DEFAULT_META: TypeMeta = { icon: Question, color: "gray" };
-
-const COLOR_RESOLVERS: Record<TagColor, (t: ThemeColors) => string> = {
- green: (t) => t.status.success,
- blue: (t) => t.status.info,
- amber: (t) => t.status.warning,
- gray: (t) => t.gray[10],
-};
-
-interface ConventionalCommitTagProps {
- type: string;
- scope: string | null;
-}
-
-export function ConventionalCommitTag({
- type,
- scope,
-}: ConventionalCommitTagProps) {
- const themeColors = useThemeColors();
- const meta = TYPE_META[type] ?? DEFAULT_META;
- const IconCmp = meta.icon;
- const label = scope ? `${type}(${scope})` : type;
- const iconColor = COLOR_RESOLVERS[meta.color](themeColors);
-
- return (
- <View className="shrink-0 flex-row items-center gap-1 rounded border border-gray-6 bg-gray-2 px-1.5 py-0.5">
- <IconCmp size={10} color={iconColor} weight="bold" />
- <Text className="font-mono text-[11px] text-gray-11">{label}</Text>
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/inbox/components/CreatePrFeedbackSheet.tsx b/products/desktop/apps/mobile/src/features/inbox/components/CreatePrFeedbackSheet.tsx
deleted file mode 100644
index 1c9b9c8b1b1f..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/components/CreatePrFeedbackSheet.tsx
+++ /dev/null
@@ -1,97 +0,0 @@
-import { Text } from "@components/text";
-import * as Haptics from "expo-haptics";
-import { Play, Plus } from "phosphor-react-native";
-import { useState } from "react";
-import {
- KeyboardAvoidingView,
- Platform,
- Pressable,
- TextInput,
- View,
-} from "react-native";
-import { SheetContainer } from "@/components/SheetContainer";
-import { useThemeColors } from "@/lib/theme";
-
-interface CreatePrFeedbackSheetProps {
- visible: boolean;
- isAwaitingInput: boolean;
- onClose: () => void;
- onSubmit: (feedback: string) => void;
-}
-
-export function CreatePrFeedbackSheet({
- visible,
- isAwaitingInput,
- onClose,
- onSubmit,
-}: CreatePrFeedbackSheetProps) {
- const themeColors = useThemeColors();
- const [feedback, setFeedback] = useState("");
- const [prevVisible, setPrevVisible] = useState(visible);
- const confirmLabel = isAwaitingInput ? "Implement as new task" : "Start task";
-
- // Reset the draft when the sheet opens. Adjusting during render (rather than
- // in an effect) avoids a flash of the previous value on the next open.
- if (visible !== prevVisible) {
- setPrevVisible(visible);
- if (visible) setFeedback("");
- }
-
- const handleSubmit = () => {
- Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium);
- onSubmit(feedback.trim());
- };
-
- return (
- <SheetContainer open={visible} onClose={onClose} bottomGap="default">
- <KeyboardAvoidingView
- behavior={Platform.OS === "ios" ? "padding" : undefined}
- >
- <View className="px-4 pt-2 pb-3">
- <Text className="mb-1 font-semibold text-[16px] text-gray-12">
- Add feedback
- </Text>
- <Text className="mb-3 text-[13px] text-gray-11 leading-snug">
- Optional. The agent takes this into account, including any questions
- raised in the report thread.
- </Text>
- <TextInput
- value={feedback}
- onChangeText={setFeedback}
- placeholder="Add any extra feedback, e.g. answers to questions raised in the report thread..."
- placeholderTextColor={themeColors.gray[9]}
- multiline
- maxLength={2000}
- autoFocus
- className="min-h-[96px] rounded-xl bg-gray-2 px-3 py-3 text-[14px] text-gray-12"
- style={{ textAlignVertical: "top" }}
- />
- <View className="mt-3 flex-row items-center justify-end gap-2">
- <Pressable
- onPress={onClose}
- hitSlop={6}
- className="rounded-full px-4 py-2.5 active:opacity-60"
- >
- <Text className="text-[14px] text-gray-11">Cancel</Text>
- </Pressable>
- <Pressable
- onPress={handleSubmit}
- accessibilityRole="button"
- accessibilityLabel={confirmLabel}
- className="flex-row items-center gap-1.5 rounded-full bg-accent-9 px-4 py-2.5 active:opacity-80"
- >
- {isAwaitingInput ? (
- <Plus size={16} color="#ffffff" weight="bold" />
- ) : (
- <Play size={16} color="#ffffff" weight="fill" />
- )}
- <Text className="font-semibold text-[14px] text-white">
- {confirmLabel}
- </Text>
- </Pressable>
- </View>
- </View>
- </KeyboardAvoidingView>
- </SheetContainer>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/inbox/components/DiffBlock.tsx b/products/desktop/apps/mobile/src/features/inbox/components/DiffBlock.tsx
deleted file mode 100644
index f6329cbd3b7d..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/components/DiffBlock.tsx
+++ /dev/null
@@ -1,34 +0,0 @@
-import { Text } from "@components/text";
-import { parseDiffLines } from "@posthog/core/inbox/activityLog";
-import { ScrollView, View } from "react-native";
-
-const LINE_CLASS: Record<string, string> = {
- add: "bg-status-success/15 text-status-success",
- del: "bg-status-error/15 text-status-error",
- hunk: "text-gray-9",
- context: "text-gray-12",
-};
-
-export function DiffBlock({ diff }: { diff: string }) {
- const lines = parseDiffLines(diff);
-
- return (
- <ScrollView
- horizontal
- showsHorizontalScrollIndicator
- className="max-h-72 rounded-lg border border-gray-6 bg-gray-2"
- >
- <View className="p-2">
- {lines.map((line, i) => (
- <Text
- // biome-ignore lint/suspicious/noArrayIndexKey: stable parse output, never reorders
- key={i}
- className={`font-mono text-[11px] leading-[16px] ${LINE_CLASS[line.kind]}`}
- >
- {line.text || " "}
- </Text>
- ))}
- </View>
- </ScrollView>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/inbox/components/DiscussReportSheet.tsx b/products/desktop/apps/mobile/src/features/inbox/components/DiscussReportSheet.tsx
deleted file mode 100644
index 350bf194ea57..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/components/DiscussReportSheet.tsx
+++ /dev/null
@@ -1,99 +0,0 @@
-import { Text } from "@components/text";
-import { buildDiscussReportPrompt } from "@posthog/shared";
-import * as Haptics from "expo-haptics";
-import { ChatCircle } from "phosphor-react-native";
-import { useEffect, useState } from "react";
-import {
- KeyboardAvoidingView,
- Platform,
- Pressable,
- TextInput,
- View,
-} from "react-native";
-import { SheetContainer } from "@/components/SheetContainer";
-import { inboxReportShareUrl } from "@/lib/deep-links";
-import { useThemeColors } from "@/lib/theme";
-
-interface DiscussReportSheetProps {
- visible: boolean;
- reportId: string;
- reportTitle?: string | null;
- onClose: () => void;
- onSubmit: (params: { prompt: string; question: string }) => void;
-}
-
-export function DiscussReportSheet({
- visible,
- reportId,
- reportTitle,
- onClose,
- onSubmit,
-}: DiscussReportSheetProps) {
- const themeColors = useThemeColors();
- const [question, setQuestion] = useState("");
-
- useEffect(() => {
- if (visible) setQuestion("");
- }, [visible]);
-
- const handleSubmit = () => {
- Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
- const trimmed = question.trim();
- const reportLink = inboxReportShareUrl(reportId, reportTitle);
- const prompt = buildDiscussReportPrompt({
- reportId,
- reportLink,
- question: trimmed || undefined,
- });
- onSubmit({ prompt, question: trimmed });
- };
-
- return (
- <SheetContainer open={visible} onClose={onClose} bottomGap="default">
- <KeyboardAvoidingView
- behavior={Platform.OS === "ios" ? "padding" : undefined}
- >
- <View className="px-4 pt-2 pb-3">
- <Text className="mb-1 font-semibold text-[16px] text-gray-12">
- Discuss this report
- </Text>
- <Text className="mb-3 text-[13px] text-gray-11 leading-snug">
- Ask a question, or leave it blank for a brief readout from the
- agent.
- </Text>
- <TextInput
- value={question}
- onChangeText={setQuestion}
- placeholder="What do you want to know?"
- placeholderTextColor={themeColors.gray[9]}
- multiline
- maxLength={2000}
- autoFocus
- className="min-h-[96px] rounded-xl bg-gray-2 px-3 py-3 text-[14px] text-gray-12"
- style={{ textAlignVertical: "top" }}
- />
- <View className="mt-3 flex-row items-center justify-end gap-2">
- <Pressable
- onPress={onClose}
- hitSlop={6}
- className="rounded-full px-4 py-2.5 active:opacity-60"
- >
- <Text className="text-[14px] text-gray-11">Cancel</Text>
- </Pressable>
- <Pressable
- onPress={handleSubmit}
- accessibilityRole="button"
- accessibilityLabel="Start discussion"
- className="flex-row items-center gap-1.5 rounded-full bg-accent-9 px-4 py-2.5 active:opacity-80"
- >
- <ChatCircle size={16} color="#ffffff" weight="fill" />
- <Text className="font-semibold text-[14px] text-white">
- Discuss
- </Text>
- </Pressable>
- </View>
- </View>
- </KeyboardAvoidingView>
- </SheetContainer>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/inbox/components/DismissReportSheet.test.tsx b/products/desktop/apps/mobile/src/features/inbox/components/DismissReportSheet.test.tsx
deleted file mode 100644
index 69cb68dff6d6..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/components/DismissReportSheet.test.tsx
+++ /dev/null
@@ -1,295 +0,0 @@
-import {
- DISMISSAL_REASON_OPTIONS,
- isDismissalReasonSnooze,
-} from "@posthog/shared";
-import { createElement } from "react";
-import { act, create, type ReactTestInstance } from "react-test-renderer";
-import { beforeEach, describe, expect, it, vi } from "vitest";
-import { useDismissDraftStore } from "../stores/dismissDraftStore";
-
-const mocks = vi.hoisted(() => ({
- updateState: vi.fn(),
-}));
-
-vi.mock("../hooks/useInboxReports", () => ({
- useDismissReport: () => ({
- mutateAsync: (input: unknown) => mocks.updateState(input),
- }),
-}));
-
-vi.mock("@/lib/theme", () => ({
- useThemeColors: () => ({ gray: { 9: "#888" }, accent: { 9: "#09f" } }),
-}));
-
-vi.mock("expo-haptics", () => ({
- notificationAsync: vi.fn(),
- NotificationFeedbackType: { Success: "success", Error: "error" },
-}));
-
-vi.mock("react-native", async () => {
- const actual = await import("react-native-web");
- const { createElement } = await import("react");
- return {
- ...actual,
- Alert: { alert: vi.fn() },
- Platform: {
- OS: "ios",
- select: <T,>(options: { ios?: T; android?: T; default?: T }) =>
- options.ios ?? options.default,
- },
- TextInput: (props: Record<string, unknown>) =>
- createElement("TextInput", props),
- // react-native-web's Modal is portal-based and renders nothing under the
- // node test environment; a pass-through wrapper lets us inspect the tree.
- Modal: (props: { visible?: boolean; children?: unknown }) =>
- props.visible === false
- ? null
- : createElement("Modal", null, props.children as never),
- };
-});
-
-import { DismissReportSheet } from "./DismissReportSheet";
-
-const REPORT_ID = "report-1";
-const FIRST_REASON = DISMISSAL_REASON_OPTIONS[0];
-
-function renderSheet(visible = true, extraProps: { hasOpenPr?: boolean } = {}) {
- const onClose = vi.fn();
- const onDismissed = vi.fn();
- let renderer: ReturnType<typeof create> | null = null;
- act(() => {
- renderer = create(
- createElement(DismissReportSheet, {
- visible,
- reportId: REPORT_ID,
- reportTitle: "Report one",
- onClose,
- onDismissed,
- ...extraProps,
- }),
- );
- });
- if (!renderer) throw new Error("Renderer not created");
- return {
- renderer: renderer as ReturnType<typeof create>,
- onClose,
- onDismissed,
- };
-}
-
-function pressByLabel(
- renderer: ReturnType<typeof create>,
- label: string,
-): void {
- const node: ReactTestInstance = renderer.root.find(
- (n) => n.props?.accessibilityLabel === label,
- );
- act(() => {
- node.props.onPress();
- });
-}
-
-function noteInput(renderer: ReturnType<typeof create>): ReactTestInstance {
- return renderer.root.find(
- (n) =>
- typeof n.props?.onChangeText === "function" &&
- n.props?.multiline === true,
- );
-}
-
-function findRadioByLabel(
- renderer: ReturnType<typeof create>,
- label: string,
-): ReactTestInstance {
- const matches = renderer.root.findAll(
- (n) =>
- n.props?.accessibilityLabel === label &&
- typeof n.props?.onPress === "function",
- );
- if (matches.length === 0) throw new Error(`No radio for ${label}`);
- return matches[0];
-}
-
-function findGroupByLabel(
- renderer: ReturnType<typeof create>,
- label: string,
-): ReactTestInstance {
- const matches = renderer.root.findAll(
- (n) =>
- n.props?.accessibilityLabel === label &&
- n.props?.accessibilityRole === "radiogroup",
- );
- if (matches.length === 0) throw new Error(`No group for ${label}`);
- return matches[0];
-}
-
-function hasTextNode(
- renderer: ReturnType<typeof create>,
- content: string,
-): boolean {
- return renderer.root.findAll((n) => n.props?.children === content).length > 0;
-}
-
-describe("DismissReportSheet", () => {
- beforeEach(() => {
- mocks.updateState.mockReset();
- useDismissDraftStore.setState({ drafts: {} });
- });
-
- it("closes and notifies before the request settles", () => {
- mocks.updateState.mockReturnValue(new Promise(() => {}));
- const { renderer, onClose, onDismissed } = renderSheet(true);
-
- pressByLabel(renderer, `Dismissal reason: ${FIRST_REASON.label}`);
- pressByLabel(renderer, "Confirm dismissal");
-
- expect(onClose).toHaveBeenCalledTimes(1);
- expect(onDismissed).toHaveBeenCalledWith({
- reason: FIRST_REASON.value,
- note: null,
- });
- expect(mocks.updateState).toHaveBeenCalledTimes(1);
- });
-
- it("mounts open, prefilled, when a prior failure left a retry draft", () => {
- useDismissDraftStore.setState({
- drafts: {
- [REPORT_ID]: {
- reason: FIRST_REASON.value,
- note: "left over",
- reopen: true,
- errorMessage: "was offline",
- },
- },
- });
- const { renderer } = renderSheet(false);
-
- expect(noteInput(renderer).props.value).toBe("left over");
- });
-
- it("groups reasons by outcome and shows the outcome line below the note", () => {
- const { renderer } = renderSheet(true);
-
- const pauseGroup = findGroupByLabel(
- renderer,
- "Pause until a new matching signal",
- );
- const hideGroup = findGroupByLabel(renderer, "Don't surface again");
-
- const optionValuesIn = (group: ReactTestInstance): string[] => {
- const seen = new Set<string>();
- const labels: string[] = [];
- for (const n of group.findAll(
- (node) =>
- node.props?.accessibilityRole === "radio" &&
- typeof node.props?.accessibilityLabel === "string" &&
- typeof node.props?.onPress === "function",
- )) {
- const label = String(n.props.accessibilityLabel).replace(
- "Dismissal reason: ",
- "",
- );
- if (seen.has(label)) continue;
- seen.add(label);
- labels.push(label);
- }
- return labels;
- };
-
- const expectedPause = DISMISSAL_REASON_OPTIONS.filter((o) =>
- isDismissalReasonSnooze(o.value),
- ).map((o) => o.label);
- const expectedHide = DISMISSAL_REASON_OPTIONS.filter(
- (o) => !isDismissalReasonSnooze(o.value),
- ).map((o) => o.label);
-
- expect(optionValuesIn(pauseGroup)).toEqual(expectedPause);
- expect(optionValuesIn(hideGroup)).toEqual(expectedHide);
-
- pressByLabel(renderer, `Dismissal reason: ${expectedPause[0]}`);
- expect(
- findRadioByLabel(renderer, `Dismissal reason: ${expectedPause[0]}`).props
- .accessibilityState.checked,
- ).toBe(true);
- expect(
- hasTextNode(
- renderer,
- "The report comes back if another matching signal arrives.",
- ),
- ).toBe(true);
-
- pressByLabel(renderer, `Dismissal reason: ${expectedHide[0]}`);
- expect(
- hasTextNode(renderer, "Matching signals won't surface the report again."),
- ).toBe(true);
- });
-
- it("appends the pull request outcome when the report has an open PR", () => {
- const { renderer } = renderSheet(true, { hasOpenPr: true });
- const hideValue = DISMISSAL_REASON_OPTIONS.find(
- (o) => !isDismissalReasonSnooze(o.value),
- );
- if (!hideValue) throw new Error("no hide option");
-
- pressByLabel(renderer, `Dismissal reason: ${hideValue.label}`);
-
- expect(
- hasTextNode(
- renderer,
- "Matching signals won't surface the report again. The open pull request will be closed.",
- ),
- ).toBe(true);
- });
-
- it("selects the other reason when a note is typed with no reason picked", () => {
- const { renderer } = renderSheet(true);
-
- act(() => {
- noteInput(renderer).props.onChangeText("Some detail");
- });
-
- const otherOption = findRadioByLabel(
- renderer,
- "Dismissal reason: Something else…",
- );
- expect(otherOption.props.accessibilityState.checked).toBe(true);
- });
-
- it("keeps the picked reason when the user then adds a note", () => {
- const { renderer } = renderSheet(true);
-
- pressByLabel(renderer, `Dismissal reason: ${FIRST_REASON.label}`);
- act(() => {
- noteInput(renderer).props.onChangeText("extra context");
- });
-
- const firstOption = findRadioByLabel(
- renderer,
- `Dismissal reason: ${FIRST_REASON.label}`,
- );
- expect(firstOption.props.accessibilityState.checked).toBe(true);
- });
-
- it("reopens with the typed reason and note when the write fails", async () => {
- mocks.updateState.mockRejectedValue(new Error("network down"));
- const { renderer } = renderSheet(true);
-
- pressByLabel(renderer, `Dismissal reason: ${FIRST_REASON.label}`);
- act(() => {
- noteInput(renderer).props.onChangeText("please retry");
- });
-
- await act(async () => {
- pressByLabel(renderer, "Confirm dismissal");
- await Promise.resolve();
- });
-
- const stored = useDismissDraftStore.getState().drafts[REPORT_ID];
- expect(stored).toMatchObject({
- reason: FIRST_REASON.value,
- note: "please retry",
- reopen: true,
- });
- expect(noteInput(renderer).props.value).toBe("please retry");
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/inbox/components/DismissReportSheet.tsx b/products/desktop/apps/mobile/src/features/inbox/components/DismissReportSheet.tsx
deleted file mode 100644
index e6f180de14f5..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/components/DismissReportSheet.tsx
+++ /dev/null
@@ -1,292 +0,0 @@
-import { Text } from "@components/text";
-import {
- DISMISSAL_REASON_OPTIONS,
- type DismissalReasonOptionValue,
- isDismissalReasonSnooze,
-} from "@posthog/shared";
-import * as Haptics from "expo-haptics";
-import { Check } from "phosphor-react-native";
-import { useEffect, useRef, useState } from "react";
-import {
- Alert,
- KeyboardAvoidingView,
- Modal,
- Platform,
- Pressable,
- ScrollView,
- TextInput,
- View,
-} from "react-native";
-import { useScreenInsets } from "@/hooks/useScreenInsets";
-import { useThemeColors } from "@/lib/theme";
-import { useDismissReport } from "../hooks/useInboxReports";
-import { useDismissDraftStore } from "../stores/dismissDraftStore";
-
-export interface DismissReportResult {
- reason: DismissalReasonOptionValue;
- /** Trimmed note text the user provided, if any. Empty/whitespace-only notes become null. */
- note: string | null;
-}
-
-const PAUSE_OPTIONS = DISMISSAL_REASON_OPTIONS.filter((option) =>
- isDismissalReasonSnooze(option.value),
-);
-const HIDE_OPTIONS = DISMISSAL_REASON_OPTIONS.filter(
- (option) => !isDismissalReasonSnooze(option.value),
-);
-
-interface DismissReportSheetProps {
- visible: boolean;
- reportId: string;
- reportTitle: string;
- hasOpenPr?: boolean;
- onClose: () => void;
- /** Fires the moment the user confirms, before the API write settles. */
- onDismissed: (result: DismissReportResult) => void;
-}
-
-export function DismissReportSheet({
- visible,
- reportId,
- reportTitle,
- hasOpenPr = false,
- onClose,
- onDismissed,
-}: DismissReportSheetProps) {
- const { insets, bottom, sheetContentTop } = useScreenInsets();
- const themeColors = useThemeColors();
- const draft = useDismissDraftStore((s) => s.drafts[reportId]);
- const setDraft = useDismissDraftStore((s) => s.setDraft);
- const [reason, setReason] = useState<DismissalReasonOptionValue | null>(null);
- const [note, setNote] = useState("");
- const dismiss = useDismissReport(reportId);
-
- const sheetVisible = visible || draft?.reopen === true;
- const openTransitionRef = useRef(false);
-
- useEffect(() => {
- if (!sheetVisible) {
- openTransitionRef.current = false;
- return;
- }
- if (openTransitionRef.current) return;
- openTransitionRef.current = true;
- if (draft?.reopen) {
- setReason(draft.reason);
- setNote(draft.note);
- } else {
- setReason(null);
- setNote("");
- }
- }, [sheetVisible, draft]);
-
- const displayedError = draft?.reopen ? draft.errorMessage : undefined;
-
- const outcome =
- reason == null
- ? null
- : isDismissalReasonSnooze(reason)
- ? "The report comes back if another matching signal arrives."
- : `Matching signals won't surface the report again.${hasOpenPr ? " The open pull request will be closed." : ""}`;
-
- const handleClose = () => {
- setDraft(reportId, undefined);
- onClose();
- };
-
- const handleConfirm = () => {
- if (!reason) return;
- const trimmedNote = note.trim();
- const noteOrNull = trimmedNote || null;
- setDraft(reportId, { reason, note: trimmedNote, reopen: false });
- onClose();
- onDismissed({ reason, note: noteOrNull });
- // Use an independently managed promise rather than mutate()'s per-call
- // callbacks: onDismissed above can trigger navigation that unmounts this
- // sheet before the write settles, and per-call mutate callbacks are only
- // fired while the initiating component is still mounted. A plain promise
- // chain has no such dependency, so the draft is always reconciled.
- dismiss.mutateAsync({ reason, note: trimmedNote || undefined }).then(
- () => {
- setDraft(reportId, undefined);
- Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success);
- },
- (err) => {
- const message =
- err instanceof Error
- ? err.message
- : "Could not dismiss this report. Please try again.";
- setDraft(reportId, {
- reason,
- note: trimmedNote,
- reopen: true,
- errorMessage: message,
- });
- Haptics.notificationAsync(Haptics.NotificationFeedbackType.Error);
- Alert.alert("Couldn't dismiss report", message);
- },
- );
- };
-
- const canSubmit = !!reason;
-
- return (
- <Modal
- visible={sheetVisible}
- animationType="slide"
- presentationStyle="pageSheet"
- onRequestClose={handleClose}
- >
- <KeyboardAvoidingView
- className="flex-1 bg-background"
- behavior={Platform.OS === "ios" ? "padding" : "height"}
- keyboardVerticalOffset={0}
- >
- <View
- className="flex-1 bg-background"
- style={{ paddingTop: sheetContentTop() }}
- >
- <View className="flex-row items-center justify-between border-gray-6 border-b px-4 pb-3">
- <Text className="font-semibold text-[18px] text-gray-12">
- Dismiss report
- </Text>
- <Pressable onPress={handleClose} hitSlop={12}>
- <Text className="text-[14px] text-accent-9">Cancel</Text>
- </Pressable>
- </View>
-
- <ScrollView
- keyboardShouldPersistTaps="handled"
- contentContainerStyle={{
- paddingHorizontal: 16,
- paddingTop: 16,
- paddingBottom: insets.bottom + 120,
- }}
- >
- <Text className="text-[13px] text-gray-11 leading-snug">
- {`This will remove "${reportTitle}" from your inbox. Your feedback is saved on the report and helps the agent.`}
- </Text>
-
- <ReasonGroup
- heading="Pause until a new matching signal"
- options={PAUSE_OPTIONS}
- selected={reason}
- onSelect={setReason}
- accentColor={themeColors.accent[9]}
- />
-
- <ReasonGroup
- heading="Don't surface again"
- options={HIDE_OPTIONS}
- selected={reason}
- onSelect={setReason}
- accentColor={themeColors.accent[9]}
- />
-
- <Text className="mt-5 mb-2 font-semibold text-[12px] text-gray-10 uppercase tracking-wide">
- Details (optional)
- </Text>
- <TextInput
- value={note}
- onChangeText={(value) => {
- setNote(value);
- if (reason === null && value.trim()) {
- setReason("other");
- }
- }}
- placeholder="What should the agent know?"
- placeholderTextColor={themeColors.gray[9]}
- multiline
- numberOfLines={3}
- maxLength={4000}
- className="min-h-[88px] rounded-xl bg-gray-2 px-3 py-3 text-[14px] text-gray-12"
- style={{ textAlignVertical: "top" }}
- />
-
- {outcome && (
- <Text
- accessibilityLiveRegion="polite"
- className="mt-3 text-[13px] text-gray-11"
- >
- {outcome}
- </Text>
- )}
-
- {displayedError && (
- <Text className="mt-3 text-[13px] text-status-error">
- {displayedError}
- </Text>
- )}
- </ScrollView>
-
- <View
- className="border-gray-6 border-t bg-background px-4 pt-3"
- style={{ paddingBottom: bottom("compact") }}
- >
- <Pressable
- onPress={handleConfirm}
- disabled={!canSubmit}
- accessibilityLabel="Confirm dismissal"
- className={`flex-row items-center justify-center rounded-full px-6 py-3.5 ${
- canSubmit ? "bg-accent-9 active:opacity-80" : "bg-gray-4"
- }`}
- >
- <Text
- className={`font-semibold text-[15px] ${
- canSubmit ? "text-gray-12" : "text-gray-9"
- }`}
- >
- Dismiss & teach the agent
- </Text>
- </Pressable>
- </View>
- </View>
- </KeyboardAvoidingView>
- </Modal>
- );
-}
-
-function ReasonGroup({
- heading,
- options,
- selected,
- onSelect,
- accentColor,
-}: {
- heading: string;
- options: readonly (typeof DISMISSAL_REASON_OPTIONS)[number][];
- selected: DismissalReasonOptionValue | null;
- onSelect: (value: DismissalReasonOptionValue) => void;
- accentColor: string;
-}) {
- return (
- <View accessibilityRole="radiogroup" accessibilityLabel={heading}>
- <Text className="mt-5 mb-2 font-semibold text-[12px] text-gray-10 uppercase tracking-wide">
- {heading}
- </Text>
- <View className="overflow-hidden rounded-xl bg-gray-2">
- {options.map((option, idx) => {
- const isSelected = selected === option.value;
- return (
- <Pressable
- key={option.value}
- onPress={() => onSelect(option.value)}
- accessibilityLabel={`Dismissal reason: ${option.label}`}
- accessibilityRole="radio"
- accessibilityState={{ checked: isSelected }}
- hitSlop={4}
- className={`flex-row items-center justify-between px-3 py-3.5 active:bg-gray-3 ${
- idx > 0 ? "border-gray-5 border-t" : ""
- }`}
- >
- <Text className="flex-1 pr-3 text-[14px] text-gray-12">
- {option.label}
- </Text>
- {isSelected && <Check size={16} color={accentColor} />}
- </Pressable>
- );
- })}
- </View>
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/inbox/components/EditReviewersSheet.tsx b/products/desktop/apps/mobile/src/features/inbox/components/EditReviewersSheet.tsx
deleted file mode 100644
index ad1d1e013c23..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/components/EditReviewersSheet.tsx
+++ /dev/null
@@ -1,126 +0,0 @@
-import { Text } from "@components/text";
-import {
- buildReviewerOptions,
- reviewerMatchesAvailable,
-} from "@posthog/core/inbox/artefacts";
-import type {
- AvailableSuggestedReviewer,
- SuggestedReviewer,
-} from "@posthog/shared/domain-types";
-import { MagnifyingGlass } from "phosphor-react-native";
-import { useMemo, useState } from "react";
-import {
- ActivityIndicator,
- Modal,
- Pressable,
- ScrollView,
- TextInput,
- View,
-} from "react-native";
-import { useDebouncedValue } from "@/hooks/useDebouncedValue";
-import { useScreenInsets } from "@/hooks/useScreenInsets";
-import { useThemeColors } from "@/lib/theme";
-import { useAvailableSuggestedReviewers } from "../hooks/useInboxReports";
-import { ReviewerOptionRow } from "./ReviewerOptionRow";
-
-interface EditReviewersSheetProps {
- visible: boolean;
- reviewers: SuggestedReviewer[];
- meUuid?: string | null;
- onClose: () => void;
- onToggle: (option: AvailableSuggestedReviewer) => void;
-}
-
-export function EditReviewersSheet({
- visible,
- reviewers,
- meUuid,
- onClose,
- onToggle,
-}: EditReviewersSheetProps) {
- const { bottom, sheetContentTop } = useScreenInsets();
- const themeColors = useThemeColors();
- const [query, setQuery] = useState("");
- const debouncedQuery = useDebouncedValue(query, 250);
- const { data: available, isLoading } = useAvailableSuggestedReviewers({
- enabled: visible,
- query: debouncedQuery,
- });
-
- const options = useMemo(
- () => buildReviewerOptions(available?.results ?? [], meUuid ?? undefined),
- [available?.results, meUuid],
- );
-
- return (
- <Modal
- visible={visible}
- animationType="slide"
- presentationStyle="pageSheet"
- onRequestClose={onClose}
- >
- <View
- className="flex-1 bg-background"
- style={{ paddingTop: sheetContentTop() }}
- >
- <View className="flex-row items-center justify-between border-gray-6 border-b px-4 pb-3">
- <Text className="font-semibold text-[18px] text-gray-12">
- Add reviewer
- </Text>
- <Pressable onPress={onClose}>
- <Text className="font-semibold text-[14px] text-accent-9">
- Done
- </Text>
- </Pressable>
- </View>
-
- <View className="px-4 pt-3">
- <View className="flex-row items-center gap-2 rounded-lg bg-gray-2 px-3 py-2">
- <MagnifyingGlass size={16} color={themeColors.gray[9]} />
- <TextInput
- value={query}
- onChangeText={setQuery}
- placeholder="Filter users…"
- placeholderTextColor={themeColors.gray[9]}
- autoCapitalize="none"
- autoCorrect={false}
- className="min-w-0 flex-1 text-[14px] text-gray-12"
- />
- </View>
- </View>
-
- {options.length === 0 ? (
- isLoading ? (
- <View className="flex-1 items-center justify-center">
- <ActivityIndicator size="large" color={themeColors.accent[9]} />
- </View>
- ) : (
- <View className="flex-1 items-center justify-center p-6">
- <Text className="text-[14px] text-gray-10">No users found</Text>
- </View>
- )
- ) : (
- <ScrollView
- keyboardShouldPersistTaps="handled"
- contentContainerStyle={{
- paddingHorizontal: 16,
- paddingTop: 12,
- paddingBottom: bottom("roomy"),
- }}
- >
- {options.map((reviewer) => (
- <ReviewerOptionRow
- key={reviewer.uuid}
- reviewer={reviewer}
- selected={reviewers.some((r) =>
- reviewerMatchesAvailable(r, reviewer),
- )}
- onPress={() => onToggle(reviewer)}
- />
- ))}
- </ScrollView>
- )}
- </View>
- </Modal>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/inbox/components/FilterSheet.tsx b/products/desktop/apps/mobile/src/features/inbox/components/FilterSheet.tsx
deleted file mode 100644
index 4fe00766277c..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/components/FilterSheet.tsx
+++ /dev/null
@@ -1,249 +0,0 @@
-import { Text } from "@components/text";
-import { INBOX_PIPELINE_STATUSES } from "@posthog/core/inbox/reportFiltering";
-import { inboxStatusLabel } from "@posthog/core/inbox/reportPresentation";
-import type { SignalReportPriority } from "@posthog/shared/domain-types";
-import { Check } from "phosphor-react-native";
-import { useMemo } from "react";
-import { Modal, Pressable, ScrollView, View } from "react-native";
-import { useScreenInsets } from "@/hooks/useScreenInsets";
-import { useThemeColors } from "@/lib/theme";
-import { useSignalSourceConfigs } from "../hooks/useSignalSourceConfigs";
-import { narrowSourceProductOptions } from "../sourceFilterOptions";
-import { useInboxFilterStore } from "../stores/inboxFilterStore";
-
-interface FilterSheetProps {
- visible: boolean;
- onClose: () => void;
-}
-
-type SortOption = {
- label: string;
- field: "priority" | "created_at" | "total_weight";
- direction: "asc" | "desc";
-};
-
-const SORT_OPTIONS: SortOption[] = [
- { label: "Priority", field: "priority", direction: "asc" },
- { label: "Strongest signal", field: "total_weight", direction: "desc" },
- { label: "Newest first", field: "created_at", direction: "desc" },
- { label: "Oldest first", field: "created_at", direction: "asc" },
-];
-
-function useStatusDotColors(): Record<string, string> {
- const themeColors = useThemeColors();
- return {
- ready: themeColors.status.success,
- pending_input: themeColors.accent[9],
- in_progress: themeColors.status.warning,
- candidate: themeColors.status.info,
- potential: themeColors.gray[9],
- failed: themeColors.status.error,
- };
-}
-
-const FILTERABLE_PRIORITIES: SignalReportPriority[] = [
- "P0",
- "P1",
- "P2",
- "P3",
- "P4",
-];
-
-function usePriorityDotColors(): Record<SignalReportPriority, string> {
- const themeColors = useThemeColors();
- return {
- P0: themeColors.status.error,
- P1: themeColors.status.warning,
- P2: themeColors.status.warning,
- P3: themeColors.gray[9],
- P4: themeColors.gray[9],
- };
-}
-
-function SectionHeader({ title }: { title: string }) {
- return (
- <Text className="mb-1 font-semibold text-[12px] text-gray-10 uppercase tracking-wide">
- {title}
- </Text>
- );
-}
-
-function OptionRow({
- label,
- selected,
- onPress,
- left,
-}: {
- label: string;
- selected: boolean;
- onPress: () => void;
- left?: React.ReactNode;
-}) {
- const themeColors = useThemeColors();
- return (
- <Pressable
- onPress={onPress}
- className="flex-row items-center justify-between rounded-md px-2 py-2.5 active:bg-gray-3"
- >
- <View className="flex-row items-center gap-2">
- {left}
- <Text className="text-[14px] text-gray-12">{label}</Text>
- </View>
- {selected && <Check size={16} color={themeColors.gray[12]} />}
- </Pressable>
- );
-}
-
-export function FilterSheet({ visible, onClose }: FilterSheetProps) {
- const { bottom, sheetContentTop } = useScreenInsets();
- const themeColors = useThemeColors();
- const statusDotColors = useStatusDotColors();
- const priorityDotColors = usePriorityDotColors();
-
- const sortField = useInboxFilterStore((s) => s.sortField);
- const sortDirection = useInboxFilterStore((s) => s.sortDirection);
- const setSort = useInboxFilterStore((s) => s.setSort);
- const statusFilter = useInboxFilterStore((s) => s.statusFilter);
- const toggleStatus = useInboxFilterStore((s) => s.toggleStatus);
- const sourceProductFilter = useInboxFilterStore((s) => s.sourceProductFilter);
- const toggleSourceProduct = useInboxFilterStore((s) => s.toggleSourceProduct);
- const clearSourceProductFilter = useInboxFilterStore(
- (s) => s.clearSourceProductFilter,
- );
- const priorityFilter = useInboxFilterStore((s) => s.priorityFilter);
- const togglePriority = useInboxFilterStore((s) => s.togglePriority);
- const setPriorityFilter = useInboxFilterStore((s) => s.setPriorityFilter);
- const resetFilters = useInboxFilterStore((s) => s.resetFilters);
-
- const { data: sourceConfigs } = useSignalSourceConfigs();
- const sourceOptions = useMemo(
- () => narrowSourceProductOptions(sourceConfigs, sourceProductFilter),
- [sourceConfigs, sourceProductFilter],
- );
-
- const hasActiveFilters =
- sourceProductFilter.length > 0 ||
- priorityFilter.length > 0 ||
- statusFilter.length < INBOX_PIPELINE_STATUSES.length;
-
- return (
- <Modal
- visible={visible}
- animationType="slide"
- presentationStyle="pageSheet"
- onRequestClose={onClose}
- >
- <View
- className="flex-1 bg-background"
- style={{ paddingTop: sheetContentTop() }}
- >
- {/* Header */}
- <View className="flex-row items-center justify-between border-gray-6 border-b px-4 pb-3">
- <Text className="font-semibold text-[18px] text-gray-12">
- Filter & Sort
- </Text>
- <View className="flex-row items-center gap-3">
- {hasActiveFilters && (
- <Pressable onPress={resetFilters}>
- <Text className="text-[14px] text-accent-9">Reset</Text>
- </Pressable>
- )}
- <Pressable onPress={onClose}>
- <Text className="font-semibold text-[14px] text-accent-9">
- Done
- </Text>
- </Pressable>
- </View>
- </View>
-
- <ScrollView
- contentContainerStyle={{
- paddingHorizontal: 16,
- paddingTop: 16,
- paddingBottom: bottom("roomy"),
- }}
- >
- {/* Sort */}
- <SectionHeader title="Sort by" />
- <View className="mb-5">
- {SORT_OPTIONS.map((option) => (
- <OptionRow
- key={`${option.field}-${option.direction}`}
- label={option.label}
- selected={
- sortField === option.field &&
- sortDirection === option.direction
- }
- onPress={() => setSort(option.field, option.direction)}
- />
- ))}
- </View>
-
- {/* Status */}
- <SectionHeader title="Status" />
- <View className="mb-5">
- {INBOX_PIPELINE_STATUSES.map((status) => (
- <OptionRow
- key={status}
- label={inboxStatusLabel(status)}
- selected={statusFilter.includes(status)}
- onPress={() => toggleStatus(status)}
- left={
- <View
- className="h-2.5 w-2.5 rounded-full"
- style={{
- backgroundColor:
- statusDotColors[status] ?? themeColors.gray[8],
- }}
- />
- }
- />
- ))}
- </View>
-
- {/* Priority */}
- <SectionHeader title="Priority" />
- <View className="mb-5">
- <OptionRow
- label="Any"
- selected={priorityFilter.length === 0}
- onPress={() => setPriorityFilter([])}
- />
- {FILTERABLE_PRIORITIES.map((priority) => (
- <OptionRow
- key={priority}
- label={priority}
- selected={priorityFilter.includes(priority)}
- onPress={() => togglePriority(priority)}
- left={
- <View
- className="h-2.5 w-2.5 rounded-full"
- style={{ backgroundColor: priorityDotColors[priority] }}
- />
- }
- />
- ))}
- </View>
-
- {/* Source */}
- <SectionHeader title="Source" />
- <View className="mb-5">
- <OptionRow
- label="Any"
- selected={sourceProductFilter.length === 0}
- onPress={clearSourceProductFilter}
- />
- {sourceOptions.map((option) => (
- <OptionRow
- key={option.value}
- label={option.label}
- selected={sourceProductFilter.includes(option.value)}
- onPress={() => toggleSourceProduct(option.value)}
- />
- ))}
- </View>
- </ScrollView>
- </View>
- </Modal>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/inbox/components/FloatingInboxHeader.tsx b/products/desktop/apps/mobile/src/features/inbox/components/FloatingInboxHeader.tsx
deleted file mode 100644
index 94b317b9099a..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/components/FloatingInboxHeader.tsx
+++ /dev/null
@@ -1,119 +0,0 @@
-import { Text } from "@components/text";
-import { LinearGradient } from "expo-linear-gradient";
-import { FunnelSimple, UsersThree } from "phosphor-react-native";
-import { Pressable, View } from "react-native";
-import { useSafeAreaInsets } from "react-native-safe-area-context";
-import { MenuButton } from "@/features/navigation/components/MenuButton";
-import { toRgba, useThemeColors } from "@/lib/theme";
-import { LiveDot } from "./LiveDot";
-
-interface FloatingInboxHeaderProps {
- isFetching: boolean;
- hasError: boolean;
- reviewerFilterCount: number;
- showFilters?: boolean;
- onReviewerPress: () => void;
- onFilterPress: () => void;
-}
-
-/**
- * Floating header for the inbox screen — hamburger menu on the left,
- * centered "Inbox" title with live-polling indicator, and reviewer / filter
- * buttons on the right. Sits over the content with a top-to-bottom fade so
- * the list disappears gracefully behind it.
- */
-export function FloatingInboxHeader({
- isFetching,
- hasError,
- reviewerFilterCount,
- showFilters = true,
- onReviewerPress,
- onFilterPress,
-}: FloatingInboxHeaderProps) {
- const insets = useSafeAreaInsets();
- const themeColors = useThemeColors();
-
- const fadeHeight = insets.top + 80;
-
- return (
- <View
- pointerEvents="box-none"
- className="absolute inset-x-0 top-0 z-10"
- style={{ height: fadeHeight }}
- >
- <LinearGradient
- pointerEvents="none"
- colors={[
- toRgba(themeColors.background, 1),
- toRgba(themeColors.background, 0.92),
- toRgba(themeColors.background, 0),
- ]}
- locations={[0, 0.65, 1]}
- style={{ position: "absolute", top: 0, left: 0, right: 0, bottom: 0 }}
- />
-
- <View
- className="flex-row items-center justify-between px-3"
- style={{ paddingTop: insets.top + 6, paddingBottom: 8 }}
- >
- <MenuButton />
-
- <View
- pointerEvents="none"
- className="absolute inset-x-0 flex-row items-center justify-center gap-1.5"
- style={{ top: insets.top + 6, bottom: 8 }}
- >
- <Text
- className="font-semibold text-[15px] text-gray-12"
- numberOfLines={1}
- >
- Inbox
- </Text>
- <LiveDot active={isFetching} hasError={hasError} />
- </View>
-
- <View className="flex-row items-center gap-2">
- {showFilters ? (
- <>
- <Pressable
- onPress={onReviewerPress}
- hitSlop={8}
- accessibilityLabel="Filter by reviewer"
- accessibilityRole="button"
- className={`h-9 flex-row items-center justify-center gap-1 rounded-md border border-gray-6 px-2 active:bg-gray-3 ${
- reviewerFilterCount > 0 ? "bg-gray-3" : "bg-gray-2"
- }`}
- >
- <UsersThree
- size={16}
- color={
- reviewerFilterCount > 0
- ? themeColors.gray[12]
- : themeColors.gray[11]
- }
- />
- {reviewerFilterCount > 0 && (
- <Text className="font-medium text-[12px] text-gray-12">
- {reviewerFilterCount}
- </Text>
- )}
- </Pressable>
- <Pressable
- onPress={onFilterPress}
- hitSlop={8}
- accessibilityLabel="Filter and sort reports"
- accessibilityRole="button"
- className="h-9 w-9 items-center justify-center rounded-md border border-gray-6 bg-gray-2 active:bg-gray-3"
- >
- <FunnelSimple size={16} color={themeColors.gray[11]} />
- </Pressable>
- </>
- ) : (
- // Keep horizontal space reserved so the title stays centered.
- <View className="h-9 w-9" />
- )}
- </View>
- </View>
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/inbox/components/InboxReportSection.tsx b/products/desktop/apps/mobile/src/features/inbox/components/InboxReportSection.tsx
deleted file mode 100644
index 6514cf92d26e..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/components/InboxReportSection.tsx
+++ /dev/null
@@ -1,96 +0,0 @@
-import { Text } from "@components/text";
-import type { SignalReport } from "@posthog/shared/domain-types";
-import { CaretDown } from "phosphor-react-native";
-import { useState } from "react";
-import { Pressable, View } from "react-native";
-import { useThemeColors } from "@/lib/theme";
-
-const SECTION_PREVIEW_LIMIT = 5;
-
-interface InboxReportSectionProps {
- title: string;
- reports: SignalReport[];
- count: number;
- emptyNote?: string;
- defaultOpen?: boolean;
- renderReport: (report: SignalReport) => React.ReactNode;
- onOpenChange?: (open: boolean) => void;
-}
-
-export function InboxReportSection({
- title,
- reports,
- count,
- emptyNote,
- defaultOpen = true,
- renderReport,
- onOpenChange,
-}: InboxReportSectionProps) {
- const themeColors = useThemeColors();
- const [open, setOpen] = useState(defaultOpen);
- const [visibleCount, setVisibleCount] = useState(SECTION_PREVIEW_LIMIT);
- if (count === 0 && reports.length === 0 && !emptyNote) return null;
-
- const visible = reports.slice(0, visibleCount);
- const remainingHidden = Math.max(0, count - visible.length);
- const revealMore = () =>
- setVisibleCount((current) =>
- Math.min(current + SECTION_PREVIEW_LIMIT, count),
- );
-
- return (
- <View className="mb-3">
- <Pressable
- onPress={() =>
- setOpen((current) => {
- const next = !current;
- onOpenChange?.(next);
- return next;
- })
- }
- hitSlop={6}
- accessibilityRole="button"
- accessibilityState={{ expanded: open }}
- className="mb-1 flex-row items-center gap-2 px-3 py-2 active:opacity-70"
- >
- <View className="flex-row items-center gap-1">
- <Text className="font-mono font-semibold text-[11px] text-gray-10 uppercase tracking-widest">
- {title}
- </Text>
- <Text className="font-mono text-[11px] text-gray-10 tabular-nums">
- ({count})
- </Text>
- </View>
- <View className="h-px flex-1 bg-gray-5" />
- <CaretDown
- size={12}
- color={themeColors.gray[9]}
- style={{ transform: [{ rotate: open ? "180deg" : "0deg" }] }}
- />
- </Pressable>
- {open ? (
- reports.length === 0 && emptyNote ? (
- <Text className="px-3 py-2 text-[13px] text-gray-10">
- {emptyNote}
- </Text>
- ) : (
- <View>
- {visible.map((report) => renderReport(report))}
- {remainingHidden > 0 ? (
- <Pressable
- onPress={revealMore}
- hitSlop={6}
- accessibilityRole="button"
- className="self-center px-3 py-2 active:opacity-70"
- >
- <Text className="font-medium text-[13px] text-gray-10">
- Show more ({remainingHidden})
- </Text>
- </Pressable>
- ) : null}
- </View>
- )
- ) : null}
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/inbox/components/InboxViewToggle.tsx b/products/desktop/apps/mobile/src/features/inbox/components/InboxViewToggle.tsx
deleted file mode 100644
index 2c8665f077dc..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/components/InboxViewToggle.tsx
+++ /dev/null
@@ -1,65 +0,0 @@
-import * as Haptics from "expo-haptics";
-import { Archive, Cards, type Icon, ListBullets } from "phosphor-react-native";
-import { Pressable, View } from "react-native";
-import { useSafeAreaInsets } from "react-native-safe-area-context";
-import { useThemeColors } from "@/lib/theme";
-
-export type InboxViewMode = "list" | "tinder" | "archive";
-
-const VIEW_MODES: { mode: InboxViewMode; icon: Icon; label: string }[] = [
- { mode: "list", icon: ListBullets, label: "List view" },
- { mode: "tinder", icon: Cards, label: "Card view" },
- { mode: "archive", icon: Archive, label: "Archive" },
-];
-
-interface InboxViewToggleProps {
- mode: InboxViewMode;
- onModeChange: (mode: InboxViewMode) => void;
-}
-
-/**
- * Floating pill toggle at the bottom of the inbox screen, with the active
- * segment highlighted.
- */
-export function InboxViewToggle({ mode, onModeChange }: InboxViewToggleProps) {
- const insets = useSafeAreaInsets();
- const themeColors = useThemeColors();
-
- const handlePress = (next: InboxViewMode) => {
- if (next === mode) return;
- Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
- onModeChange(next);
- };
-
- return (
- <View
- className="absolute inset-x-0 items-center"
- style={{ bottom: insets.bottom + 16 }}
- pointerEvents="box-none"
- >
- <View className="elevation-4 flex-row items-center overflow-hidden rounded-full border border-gray-6 bg-card shadow-lg">
- {VIEW_MODES.map(({ mode: m, icon: IconCmp, label }) => {
- const active = mode === m;
- return (
- <Pressable
- key={m}
- onPress={() => handlePress(m)}
- hitSlop={4}
- accessibilityLabel={label}
- accessibilityRole="button"
- className={`items-center justify-center rounded-full px-5 py-3 ${active ? "bg-accent-9" : "active:bg-gray-3"}`}
- >
- <IconCmp
- size={20}
- weight={active ? "bold" : "regular"}
- color={
- active ? themeColors.accent.contrast : themeColors.gray[11]
- }
- />
- </Pressable>
- );
- })}
- </View>
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/inbox/components/LiveDot.tsx b/products/desktop/apps/mobile/src/features/inbox/components/LiveDot.tsx
deleted file mode 100644
index 114baa2382a1..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/components/LiveDot.tsx
+++ /dev/null
@@ -1,71 +0,0 @@
-import { useEffect } from "react";
-import Animated, {
- useAnimatedStyle,
- useSharedValue,
- withRepeat,
- withSequence,
- withTiming,
-} from "react-native-reanimated";
-
-interface LiveDotProps {
- /** True while a background fetch is in flight */
- active: boolean;
- /** True when there's a network/fetch error */
- hasError?: boolean;
-}
-
-/**
- * Strobing red dot that indicates the inbox is live-polling.
- * Pulses brighter/larger when actively fetching, dims when idle.
- */
-const COLOR_LIVE = "#e5484d";
-const COLOR_ERROR = "#f5a623";
-
-export function LiveDot({ active, hasError }: LiveDotProps) {
- const color = hasError ? COLOR_ERROR : COLOR_LIVE;
- const scale = useSharedValue(0.92);
- const opacity = useSharedValue(0.5);
-
- useEffect(() => {
- if (active) {
- scale.value = withRepeat(
- withSequence(
- withTiming(1.15, { duration: 400 }),
- withTiming(0.92, { duration: 400 }),
- ),
- -1,
- true,
- );
- opacity.value = withRepeat(
- withSequence(
- withTiming(1, { duration: 400 }),
- withTiming(0.5, { duration: 400 }),
- ),
- -1,
- true,
- );
- } else {
- scale.value = withTiming(0.92, { duration: 600 });
- opacity.value = withTiming(0.5, { duration: 600 });
- }
- }, [active, scale, opacity]);
-
- const animatedStyle = useAnimatedStyle(() => ({
- transform: [{ scale: scale.value }],
- opacity: opacity.value,
- }));
-
- return (
- <Animated.View
- style={[
- {
- width: 7,
- height: 7,
- borderRadius: 3.5,
- backgroundColor: color,
- },
- animatedStyle,
- ]}
- />
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/inbox/components/RefundReportSheet.tsx b/products/desktop/apps/mobile/src/features/inbox/components/RefundReportSheet.tsx
deleted file mode 100644
index 931fc32091fd..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/components/RefundReportSheet.tsx
+++ /dev/null
@@ -1,188 +0,0 @@
-import { Text } from "@components/text";
-import { REFUND_REASON_OPTIONS } from "@posthog/shared";
-import type { SignalReportRefundReason } from "@posthog/shared/domain-types";
-import * as Haptics from "expo-haptics";
-import { Check } from "phosphor-react-native";
-import { useEffect, useState } from "react";
-import {
- ActivityIndicator,
- KeyboardAvoidingView,
- Modal,
- Platform,
- Pressable,
- ScrollView,
- TextInput,
- View,
-} from "react-native";
-import { useScreenInsets } from "@/hooks/useScreenInsets";
-import { useThemeColors } from "@/lib/theme";
-import { useRefundReport } from "../hooks/useInboxReports";
-
-interface RefundReportSheetProps {
- visible: boolean;
- reportId: string;
- reportTitle: string;
- onClose: () => void;
- onRefunded: () => void;
-}
-
-export function RefundReportSheet({
- visible,
- reportId,
- reportTitle,
- onClose,
- onRefunded,
-}: RefundReportSheetProps) {
- const { insets, bottom, sheetContentTop } = useScreenInsets();
- const themeColors = useThemeColors();
- const [reason, setReason] = useState<SignalReportRefundReason | null>(null);
- const [note, setNote] = useState("");
- const [error, setError] = useState<string | null>(null);
- const refund = useRefundReport(reportId);
-
- useEffect(() => {
- if (visible) {
- setReason(null);
- setNote("");
- setError(null);
- }
- }, [visible]);
-
- const handleConfirm = async () => {
- if (!reason || refund.isPending) return;
- setError(null);
- const trimmedNote = note.trim();
- try {
- await refund.mutateAsync({
- reason,
- note: trimmedNote || undefined,
- });
- Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success);
- onRefunded();
- } catch (err) {
- Haptics.notificationAsync(Haptics.NotificationFeedbackType.Error);
- setError(err instanceof Error ? err.message : "Couldn't refund this PR.");
- }
- };
-
- const canSubmit = !!reason && !refund.isPending;
-
- return (
- <Modal
- visible={visible}
- animationType="slide"
- presentationStyle="pageSheet"
- onRequestClose={onClose}
- >
- <KeyboardAvoidingView
- className="flex-1 bg-background"
- behavior={Platform.OS === "ios" ? "padding" : "height"}
- keyboardVerticalOffset={0}
- >
- <View
- className="flex-1 bg-background"
- style={{ paddingTop: sheetContentTop() }}
- >
- <View className="flex-row items-center justify-between border-gray-6 border-b px-4 pb-3">
- <Text className="font-semibold text-[18px] text-gray-12">
- Refund PR
- </Text>
- <Pressable
- onPress={onClose}
- hitSlop={12}
- disabled={refund.isPending}
- >
- <Text className="text-[14px] text-accent-9">Cancel</Text>
- </Pressable>
- </View>
-
- <ScrollView
- keyboardShouldPersistTaps="handled"
- contentContainerStyle={{
- paddingHorizontal: 16,
- paddingTop: 16,
- paddingBottom: insets.bottom + 120,
- }}
- >
- <Text className="text-[13px] text-gray-11 leading-snug">
- {`You won't pay for the PR on "${reportTitle}" and it won't count toward your included PRs. The report is archived as part of the refund and can't be restored.`}
- </Text>
-
- <Text className="mt-5 mb-2 font-semibold text-[12px] text-gray-10 uppercase tracking-wide">
- Reason
- </Text>
- <View className="overflow-hidden rounded-xl bg-gray-2">
- {REFUND_REASON_OPTIONS.map((option, idx) => {
- const selected = reason === option.value;
- return (
- <Pressable
- key={option.value}
- onPress={() => setReason(option.value)}
- hitSlop={4}
- className={`flex-row items-center justify-between px-3 py-3.5 active:bg-gray-3 ${
- idx > 0 ? "border-gray-5 border-t" : ""
- }`}
- >
- <Text className="flex-1 pr-3 text-[14px] text-gray-12">
- {option.label}
- </Text>
- {selected && (
- <Check size={16} color={themeColors.accent[9]} />
- )}
- </Pressable>
- );
- })}
- </View>
-
- <Text className="mt-5 mb-2 font-semibold text-[12px] text-gray-10 uppercase tracking-wide">
- Note (optional)
- </Text>
- <TextInput
- value={note}
- onChangeText={setNote}
- placeholder="Helps us review refunds"
- placeholderTextColor={themeColors.gray[9]}
- multiline
- numberOfLines={3}
- maxLength={4000}
- editable={!refund.isPending}
- className="min-h-[88px] rounded-xl bg-gray-2 px-3 py-3 text-[14px] text-gray-12"
- style={{ textAlignVertical: "top" }}
- />
-
- {error && (
- <Text className="mt-3 text-[13px] text-status-error">
- {error}
- </Text>
- )}
- </ScrollView>
-
- <View
- className="border-gray-6 border-t bg-background px-4 pt-3"
- style={{ paddingBottom: bottom("compact") }}
- >
- <Pressable
- onPress={handleConfirm}
- disabled={!canSubmit}
- className={`flex-row items-center justify-center rounded-full px-6 py-3.5 ${
- canSubmit ? "bg-accent-9 active:opacity-80" : "bg-gray-4"
- }`}
- >
- {refund.isPending ? (
- <ActivityIndicator color={themeColors.gray[12]} />
- ) : (
- <Text
- className={`font-semibold text-[15px] ${
- canSubmit ? "text-gray-12" : "text-gray-9"
- }`}
- >
- Refund PR
- </Text>
- )}
- </Pressable>
- </View>
- </View>
- </KeyboardAvoidingView>
- </Modal>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/inbox/components/ReportActivity.test.tsx b/products/desktop/apps/mobile/src/features/inbox/components/ReportActivity.test.tsx
deleted file mode 100644
index 5f2ba9f01ee1..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/components/ReportActivity.test.tsx
+++ /dev/null
@@ -1,125 +0,0 @@
-import type { AnySignalReportArtefact } from "@posthog/shared/domain-types";
-import { createElement } from "react";
-import { act, create } from "react-test-renderer";
-import { describe, expect, it, vi } from "vitest";
-
-vi.mock("./ArtefactCommit", () => ({ ArtefactCommit: () => null }));
-vi.mock("./ArtefactTaskRun", () => ({ ArtefactTaskRun: () => null }));
-
-import { ReportActivity } from "./ReportActivity";
-
-const commit: AnySignalReportArtefact = {
- id: "a1",
- type: "commit",
- created_at: "2026-01-01T00:00:00Z",
- content: {
- repository: "posthog/posthog",
- branch: "main",
- commit_sha: "abcdef1234567890",
- message: "fix",
- },
-};
-
-function render(props: {
- artefacts?: AnySignalReportArtefact[];
- collapsedNoteCount?: number;
-}) {
- let renderer: ReturnType<typeof create> | null = null;
- act(() => {
- renderer = create(
- createElement(ReportActivity, {
- reportId: "r1",
- artefacts: props.artefacts ?? [],
- collapsedNoteCount: props.collapsedNoteCount,
- }),
- );
- });
- if (!renderer) throw new Error("Renderer not created");
- return renderer as ReturnType<typeof create>;
-}
-
-function visibleText(renderer: ReturnType<typeof create>): string {
- const strings: string[] = [];
- const walk = (node: unknown): void => {
- if (typeof node === "string") strings.push(node);
- else if (Array.isArray(node)) for (const child of node) walk(child);
- else if (node && typeof node === "object" && "children" in node) {
- walk((node as { children: unknown }).children);
- }
- };
- walk(renderer.toJSON());
- return strings.join("");
-}
-
-describe("ReportActivity", () => {
- it("renders nothing when there are no artefacts and no confirmations", () => {
- expect(render({}).toJSON()).toBeNull();
- });
-
- it("renders the artefact count without a confirmation suffix", () => {
- const output = visibleText(render({ artefacts: [commit] }));
- expect(output).toContain("Activity");
- expect(output).toContain("(1)");
- expect(output).not.toContain("confirmation");
- expect(output).not.toContain("Corroborated");
- });
-
- it("shows each ranking head's lift beside its probability", () => {
- const renderer = render({
- artefacts: [
- {
- id: "r1",
- type: "ranking_score",
- created_at: "2026-01-01T00:00:00Z",
- content: {
- scored_at: null,
- manifest_version: null,
- served: {
- key: "report_embeddings@1",
- roles: ["served"],
- status: "scored",
- skip_reason: null,
- heads: [
- {
- name: "pr_merged",
- probability: 0.52,
- lift: 2.6,
- readable: true,
- },
- {
- name: "refund",
- probability: 0.04,
- lift: null,
- readable: false,
- },
- ],
- },
- challengers: [],
- },
- },
- ],
- });
- const output = visibleText(renderer);
- expect(output).toContain("Ranking scored");
- expect(output).toContain("Pr merged2.6x52%");
- expect(output).toContain("Refund4.0%");
- expect(output).toContain("Dimmed heads have no holdout read yet.");
- expect(
- renderer.root
- .findAll((node) => typeof node.props.accessibilityLabel === "string")
- .map((node) => node.props.accessibilityLabel),
- ).toContain("Refund, 4.0%, no holdout read yet");
- });
-
- it.each([
- [1, "1 confirmation", "Corroborated 1 more time by a scout"],
- [3, "3 confirmations", "Corroborated 3 more times by a scout"],
- ] as const)(
- "shows collapsed confirmations with the right singular or plural (%s)",
- (count, headerSuffix, line) => {
- const output = visibleText(render({ collapsedNoteCount: count }));
- expect(output).toContain(`(0) · ${headerSuffix}`);
- expect(output).toContain(`${line}, with nothing new to add.`);
- },
- );
-});
diff --git a/products/desktop/apps/mobile/src/features/inbox/components/ReportActivity.tsx b/products/desktop/apps/mobile/src/features/inbox/components/ReportActivity.tsx
deleted file mode 100644
index 057d0d0c6f77..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/components/ReportActivity.tsx
+++ /dev/null
@@ -1,107 +0,0 @@
-import { Text } from "@components/text";
-import { attributionLabel } from "@posthog/core/inbox/activityLog";
-import type { AnySignalReportArtefact } from "@posthog/shared/domain-types";
-import { ClockCounterClockwise } from "phosphor-react-native";
-import { useMemo } from "react";
-import { View } from "react-native";
-import { formatRelativeTime } from "@/lib/format";
-import { useThemeColors } from "@/lib/theme";
-import { type ActivityArtefact, selectActivityArtefacts } from "../activityLog";
-import { ArtefactCommit } from "./ArtefactCommit";
-import { ArtefactRankingScore } from "./ArtefactRankingScore";
-import { ArtefactTaskRun } from "./ArtefactTaskRun";
-
-const ARTEFACT_LABELS: Record<ActivityArtefact["type"], string> = {
- commit: "Commit pushed",
- task_run: "Task run",
- ranking_score: "Ranking scored",
-};
-
-function ArtefactRow({
- reportId,
- artefact,
-}: {
- reportId: string;
- artefact: ActivityArtefact;
-}) {
- const attribution = attributionLabel(artefact);
- const timestampMs = Date.parse(artefact.created_at);
-
- return (
- <View className="rounded-xl border border-gray-6 bg-gray-1 p-3">
- <View className="mb-1.5 flex-row items-center gap-2">
- <Text className="font-medium text-[12px] text-gray-12">
- {ARTEFACT_LABELS[artefact.type]}
- </Text>
- <View className="flex-1" />
- {attribution ? (
- <Text className="text-[11px] text-gray-9">by {attribution}</Text>
- ) : null}
- {!Number.isNaN(timestampMs) ? (
- <Text className="text-[11px] text-gray-9">
- {formatRelativeTime(timestampMs)}
- </Text>
- ) : null}
- </View>
- {artefact.type === "commit" ? (
- <ArtefactCommit
- reportId={reportId}
- artefactId={artefact.id}
- content={artefact.content}
- />
- ) : artefact.type === "ranking_score" ? (
- <ArtefactRankingScore content={artefact.content} />
- ) : (
- <ArtefactTaskRun content={artefact.content} />
- )}
- </View>
- );
-}
-
-export function ReportActivity({
- reportId,
- artefacts,
- collapsedNoteCount = 0,
-}: {
- reportId: string;
- artefacts: AnySignalReportArtefact[];
- collapsedNoteCount?: number;
-}) {
- const themeColors = useThemeColors();
- const activity = useMemo(
- () => selectActivityArtefacts(artefacts),
- [artefacts],
- );
-
- if (activity.length === 0 && collapsedNoteCount === 0) return null;
-
- return (
- <View className="mb-4">
- <View className="mb-2 flex-row items-center gap-1.5">
- <ClockCounterClockwise size={14} color={themeColors.gray[12]} />
- <Text className="font-semibold text-[14px] text-gray-12">
- Activity ({activity.length})
- {collapsedNoteCount > 0
- ? ` · ${collapsedNoteCount} ${collapsedNoteCount === 1 ? "confirmation" : "confirmations"}`
- : ""}
- </Text>
- </View>
- {collapsedNoteCount > 0 ? (
- <Text className="mb-2 text-[12px] text-gray-10">
- Corroborated {collapsedNoteCount} more{" "}
- {collapsedNoteCount === 1 ? "time" : "times"} by a scout, with nothing
- new to add.
- </Text>
- ) : null}
- <View className="gap-2">
- {activity.map((artefact) => (
- <ArtefactRow
- key={artefact.id}
- reportId={reportId}
- artefact={artefact}
- />
- ))}
- </View>
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/inbox/components/ReportFeedbackFooter.tsx b/products/desktop/apps/mobile/src/features/inbox/components/ReportFeedbackFooter.tsx
deleted file mode 100644
index 1db466cc9eae..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/components/ReportFeedbackFooter.tsx
+++ /dev/null
@@ -1,163 +0,0 @@
-import { Text } from "@components/text";
-import type { SignalReport } from "@posthog/shared/domain-types";
-import * as Haptics from "expo-haptics";
-import { ThumbsDown, ThumbsUp } from "phosphor-react-native";
-import { useCallback, useState } from "react";
-import { Pressable, TextInput, View } from "react-native";
-import {
- ANALYTICS_EVENTS,
- computeReportAgeHours,
- type InboxReportFeedbackSentiment,
- useAnalytics,
-} from "@/lib/analytics";
-import { useThemeColors } from "@/lib/theme";
-
-/** Bounded to keep the note within the analytics client's per-property limit. */
-const FEEDBACK_NOTE_MAX_LENGTH = 4000;
-
-/**
- * Thumbs rating at the end of the report body. The rating submits on the first
- * tap; only once it's recorded does an optional note appear, so the note can
- * never gate the rating. Feedback is analytics-only — it never changes the
- * report's state. Mirrors the desktop/cloud feedback footer so ranking
- * analysis is comparable across clients.
- */
-export function ReportFeedbackFooter({ report }: { report: SignalReport }) {
- const analytics = useAnalytics();
- const themeColors = useThemeColors();
-
- const [sentiment, setSentiment] =
- useState<InboxReportFeedbackSentiment | null>(null);
- const [noteOpen, setNoteOpen] = useState(false);
- const [noteDraft, setNoteDraft] = useState("");
- const [noteSent, setNoteSent] = useState(false);
-
- // Re-tapping the chosen thumb is a no-op rather than a second identical
- // feedback event; switching thumbs records the new sentiment.
- const chooseSentiment = useCallback(
- (next: InboxReportFeedbackSentiment) => {
- if (sentiment === next) return;
- Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
- setSentiment(next);
- analytics.track(ANALYTICS_EVENTS.INBOX_REPORT_FEEDBACK, {
- report_id: report.id,
- report_age_hours: computeReportAgeHours(report.created_at),
- priority: report.priority ?? null,
- actionability: report.actionability ?? null,
- sentiment: next,
- has_pr: !!report.implementation_pr_url,
- surface: "detail_footer",
- });
- },
- [sentiment, analytics, report],
- );
-
- const submitNote = useCallback(() => {
- const trimmed = noteDraft.trim();
- if (!trimmed || !sentiment) return;
- analytics.track(ANALYTICS_EVENTS.INBOX_REPORT_FEEDBACK_NOTE, {
- report_id: report.id,
- report_age_hours: computeReportAgeHours(report.created_at),
- priority: report.priority ?? null,
- actionability: report.actionability ?? null,
- sentiment,
- has_pr: !!report.implementation_pr_url,
- surface: "detail_footer",
- note: trimmed.slice(0, FEEDBACK_NOTE_MAX_LENGTH),
- });
- setNoteDraft("");
- setNoteOpen(false);
- setNoteSent(true);
- }, [noteDraft, sentiment, analytics, report]);
-
- const isPositive = sentiment === "positive";
- const isNegative = sentiment === "negative";
-
- return (
- <View className="mt-2 border-gray-4 border-t pt-4">
- <View className="flex-row flex-wrap items-center gap-2">
- <Text className="text-[13px] text-gray-11">
- {sentiment ? "Thanks for the feedback" : "Was this report useful?"}
- </Text>
- <View className="flex-row items-center gap-1.5">
- <Pressable
- onPress={() => chooseSentiment("positive")}
- accessibilityRole="button"
- accessibilityLabel="This report was useful"
- accessibilityState={{ selected: isPositive }}
- hitSlop={6}
- className={`rounded-full border px-3 py-2 active:opacity-70 ${
- isPositive
- ? "border-accent-9 bg-accent-9"
- : "border-gray-6 bg-background"
- }`}
- >
- <ThumbsUp
- size={16}
- weight={isPositive ? "fill" : "regular"}
- color={isPositive ? "#ffffff" : themeColors.gray[11]}
- />
- </Pressable>
- <Pressable
- onPress={() => chooseSentiment("negative")}
- accessibilityRole="button"
- accessibilityLabel="This report was not useful"
- accessibilityState={{ selected: isNegative }}
- hitSlop={6}
- className={`rounded-full border px-3 py-2 active:opacity-70 ${
- isNegative
- ? "border-accent-9 bg-accent-9"
- : "border-gray-6 bg-background"
- }`}
- >
- <ThumbsDown
- size={16}
- weight={isNegative ? "fill" : "regular"}
- color={isNegative ? "#ffffff" : themeColors.gray[11]}
- />
- </Pressable>
- </View>
- {sentiment && !noteOpen && !noteSent && (
- <Pressable
- onPress={() => setNoteOpen(true)}
- hitSlop={6}
- className="rounded-full px-2 py-1 active:opacity-60"
- >
- <Text className="text-[13px] text-accent-11">Add a note</Text>
- </Pressable>
- )}
- {noteSent && (
- <Text className="text-[13px] text-gray-9">Note added</Text>
- )}
- </View>
- {noteOpen && (
- <View className="mt-3">
- <TextInput
- value={noteDraft}
- onChangeText={setNoteDraft}
- placeholder="What was useful or off?"
- placeholderTextColor={themeColors.gray[9]}
- multiline
- maxLength={FEEDBACK_NOTE_MAX_LENGTH}
- autoFocus
- className="min-h-[80px] rounded-xl bg-gray-2 px-3 py-3 text-[14px] text-gray-12"
- style={{ textAlignVertical: "top" }}
- />
- <View className="mt-2 flex-row items-center justify-end">
- <Pressable
- onPress={submitNote}
- disabled={noteDraft.trim().length === 0}
- accessibilityRole="button"
- accessibilityLabel="Send note"
- className={`rounded-full px-4 py-2.5 active:opacity-80 ${
- noteDraft.trim().length === 0 ? "bg-gray-4" : "bg-accent-9"
- }`}
- >
- <Text className="font-semibold text-[14px] text-white">Send</Text>
- </Pressable>
- </View>
- </View>
- )}
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/inbox/components/ReportList.tsx b/products/desktop/apps/mobile/src/features/inbox/components/ReportList.tsx
deleted file mode 100644
index c3912ffa05e3..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/components/ReportList.tsx
+++ /dev/null
@@ -1,151 +0,0 @@
-import { Text } from "@components/text";
-import { partitionInboxReports } from "@posthog/core/inbox/reportInboxSections";
-import type { SignalReport } from "@posthog/shared/domain-types";
-import { Tray } from "phosphor-react-native";
-import { useMemo, useState } from "react";
-import {
- ActivityIndicator,
- Pressable,
- RefreshControl,
- ScrollView,
- View,
-} from "react-native";
-import { useThemeColors } from "@/lib/theme";
-import { useArchivedReports, useInboxReports } from "../hooks/useInboxReports";
-import { InboxReportSection } from "./InboxReportSection";
-import { ReportListRow } from "./ReportListRow";
-
-interface ReportListProps {
- onReportPress?: (report: SignalReport) => void;
- contentInsetTop?: number;
-}
-
-export function ReportList({
- onReportPress,
- contentInsetTop = 0,
-}: ReportListProps) {
- const {
- reports,
- isLoading,
- error,
- refetch,
- hasNextPage,
- isFetchingNextPage,
- fetchNextPage,
- } = useInboxReports();
- const themeColors = useThemeColors();
-
- const { reviewAndMerge, needsPr } = useMemo(
- () => partitionInboxReports(reports),
- [reports],
- );
-
- // Resolved (terminal) reports are loaded only when the section is opened.
- const isEmpty = reviewAndMerge.length === 0 && needsPr.length === 0;
- const [resolvedOpen, setResolvedOpen] = useState(false);
- const resolved = useArchivedReports({
- enabled: !isEmpty && resolvedOpen,
- });
-
- const handlePress = (report: SignalReport) => {
- onReportPress?.(report);
- };
-
- const renderReport = (report: SignalReport) => (
- <ReportListRow key={report.id} report={report} onPress={handlePress} />
- );
-
- if (error) {
- return (
- <View className="flex-1 items-center justify-center p-6">
- <Text className="mb-4 text-center text-status-error">{error}</Text>
- <Pressable
- onPress={() => refetch()}
- className="rounded-lg bg-gray-3 px-4 py-2"
- >
- <Text className="text-gray-12">Retry</Text>
- </Pressable>
- </View>
- );
- }
-
- if (isLoading && reports.length === 0) {
- return (
- <View className="flex-1 items-center justify-center">
- <ActivityIndicator size="large" color={themeColors.accent[9]} />
- <Text className="mt-4 text-gray-11">Loading reports...</Text>
- </View>
- );
- }
-
- return (
- <ScrollView
- onScrollEndDrag={({ nativeEvent }) => {
- const { layoutMeasurement, contentOffset, contentSize } = nativeEvent;
- const nearBottom =
- layoutMeasurement.height + contentOffset.y >=
- contentSize.height - 200;
- if (nearBottom && hasNextPage && !isFetchingNextPage) {
- fetchNextPage();
- }
- }}
- scrollEventThrottle={200}
- refreshControl={
- <RefreshControl
- refreshing={isLoading}
- onRefresh={() => refetch()}
- tintColor={themeColors.accent[9]}
- progressViewOffset={contentInsetTop}
- />
- }
- contentContainerStyle={{
- paddingTop: contentInsetTop,
- paddingBottom: 100,
- flexGrow: 1,
- }}
- >
- {isEmpty ? (
- <View className="flex-1 items-center justify-center px-6 py-16">
- <Tray size={28} color={themeColors.gray[10]} />
- <Text className="mt-3 text-center font-semibold text-[16px] text-gray-12">
- Nothing to review
- </Text>
- <Text className="mt-1 text-center text-[13px] text-gray-11">
- Reports show up here as your agents find things worth acting on.
- </Text>
- </View>
- ) : (
- <>
- <InboxReportSection
- title="Review and merge"
- reports={reviewAndMerge}
- count={reviewAndMerge.length}
- emptyNote="No pull requests open yet. Start one from a report below."
- renderReport={renderReport}
- />
- <InboxReportSection
- title="Needs a PR"
- reports={needsPr}
- count={needsPr.length}
- emptyNote="No reports are waiting for a pull request."
- renderReport={renderReport}
- />
- {isFetchingNextPage ? (
- <View className="py-4">
- <ActivityIndicator color={themeColors.accent[9]} />
- </View>
- ) : null}
- <InboxReportSection
- title="Resolved"
- reports={resolved.reports}
- count={resolved.totalCount}
- defaultOpen={false}
- emptyNote="Nothing resolved or archived yet."
- onOpenChange={setResolvedOpen}
- renderReport={renderReport}
- />
- </>
- )}
- </ScrollView>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/inbox/components/ReportListRow.tsx b/products/desktop/apps/mobile/src/features/inbox/components/ReportListRow.tsx
deleted file mode 100644
index a16f11725f22..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/components/ReportListRow.tsx
+++ /dev/null
@@ -1,119 +0,0 @@
-import { Text } from "@components/text";
-import {
- humanizeReportTitle,
- parseConventionalCommitTitle,
-} from "@posthog/core/inbox/reportPresentation";
-import type { SignalReport } from "@posthog/shared/domain-types";
-import { memo } from "react";
-import { Pressable, View } from "react-native";
-import { PrStatusBadge } from "@/features/tasks/components/PrStatusBadge";
-import { useThemeColors } from "@/lib/theme";
-import { formatReportTimestamp } from "../utils";
-import { ConventionalCommitTag } from "./ConventionalCommitTag";
-import { SuggestedReviewerAvatarStack } from "./SuggestedReviewerAvatarStack";
-
-interface ReportListRowProps {
- report: SignalReport;
- onPress: (report: SignalReport) => void;
-}
-
-// Single colored dot conveys status at a glance — full label still
-// available on the detail screen.
-const statusDotMap: Record<string, string> = {
- ready: "success",
- pending_input: "accent",
- in_progress: "warning",
- candidate: "info",
- potential: "muted",
- failed: "error",
- suppressed: "muted",
- deleted: "muted",
-};
-
-const priorityColorMap: Record<string, string> = {
- P0: "text-status-error",
- P1: "text-status-warning",
- P2: "text-status-warning",
- P3: "text-gray-10",
- P4: "text-gray-10",
-};
-
-function ReportListRowComponent({ report, onPress }: ReportListRowProps) {
- const themeColors = useThemeColors();
- const timeDisplay = formatReportTimestamp(new Date(report.updated_at));
- const conventionalTitle = parseConventionalCommitTitle(report.title);
- const displayTitle = humanizeReportTitle(report.title, "Untitled report");
-
- const dotKind = statusDotMap[report.status] ?? "muted";
- const dotColor =
- dotKind === "success"
- ? themeColors.status.success
- : dotKind === "warning"
- ? themeColors.status.warning
- : dotKind === "error"
- ? themeColors.status.error
- : dotKind === "info"
- ? themeColors.status.info
- : dotKind === "accent"
- ? themeColors.accent[9]
- : themeColors.gray[8];
-
- const priorityClass = report.priority
- ? (priorityColorMap[report.priority] ?? "text-gray-10")
- : null;
-
- return (
- <Pressable
- onPress={() => onPress(report)}
- className="flex-row items-start gap-2.5 border-gray-6 border-b px-3 py-2.5 active:bg-gray-3"
- >
- <View
- className="mt-1.5 h-2 w-2 shrink-0 rounded-full"
- style={{ backgroundColor: dotColor }}
- />
-
- <View className="min-w-0 flex-1">
- <Text
- className="font-medium text-[14px] text-gray-12 leading-snug"
- numberOfLines={2}
- ellipsizeMode="tail"
- >
- {displayTitle}
- </Text>
-
- {conventionalTitle ? (
- <View className="mt-1 flex-row">
- <ConventionalCommitTag
- type={conventionalTitle.type}
- scope={conventionalTitle.scope}
- />
- </View>
- ) : null}
-
- <View className="mt-1 flex-row items-center gap-2">
- {priorityClass ? (
- <Text className={`font-semibold text-[11px] ${priorityClass}`}>
- {report.priority}
- </Text>
- ) : null}
- <Text className="flex-1 text-[11px] text-gray-9" numberOfLines={1}>
- {timeDisplay}
- </Text>
- <SuggestedReviewerAvatarStack report={report} />
- </View>
- </View>
-
- {report.implementation_pr_url ? (
- <View className="self-center">
- <PrStatusBadge
- prUrl={report.implementation_pr_url}
- hideWhenUnresolved
- size="sm"
- />
- </View>
- ) : null}
- </Pressable>
- );
-}
-
-export const ReportListRow = memo(ReportListRowComponent);
diff --git a/products/desktop/apps/mobile/src/features/inbox/components/ReportVerdictBanner.tsx b/products/desktop/apps/mobile/src/features/inbox/components/ReportVerdictBanner.tsx
deleted file mode 100644
index 07f5c9e85fb0..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/components/ReportVerdictBanner.tsx
+++ /dev/null
@@ -1,89 +0,0 @@
-import { Text } from "@components/text";
-import {
- deriveReportVerdict,
- type ReportVerdictTone,
-} from "@posthog/core/inbox/reportVerdict";
-import type { SignalReport } from "@posthog/shared/domain-types";
-import { ArrowSquareOut, Play, Plus } from "phosphor-react-native";
-import { ActivityIndicator, Pressable, View } from "react-native";
-import { resolveReportVerdictAction } from "@/features/inbox/reportVerdictAction";
-import { useThemeColors } from "@/lib/theme";
-
-const TONE_CONTAINER: Record<ReportVerdictTone, string> = {
- decision: "border-status-warning/40 bg-status-warning/10",
- danger: "border-status-error/40 bg-status-error/10",
- progress: "border-gray-6 bg-gray-2",
- info: "border-gray-6 bg-gray-2",
-};
-
-interface ReportVerdictBannerProps {
- report: SignalReport;
- onStart: () => void;
- onOpenPr: (url: string) => void;
-}
-
-/**
- * Leads the report detail with its verdict: what state the report is in, what it
- * asks of the reader, and the one action that answers the ask.
- */
-export function ReportVerdictBanner({
- report,
- onStart,
- onOpenPr,
-}: ReportVerdictBannerProps) {
- const themeColors = useThemeColors();
- const action = resolveReportVerdictAction(report);
- const verdict = deriveReportVerdict(report, {
- hasExistingPr: action?.kind === "view_pr",
- });
-
- return (
- <View
- className={`mb-4 gap-2 rounded-xl border p-4 ${TONE_CONTAINER[verdict.tone]}`}
- >
- <View className="flex-row items-center gap-2">
- {verdict.tone === "progress" && (
- <ActivityIndicator size="small" color={themeColors.gray[11]} />
- )}
- <Text className="flex-1 font-semibold text-[15px] text-gray-12">
- {verdict.title}
- </Text>
- </View>
- <Text className="text-[13px] text-gray-11 leading-snug">
- {verdict.body}
- </Text>
-
- {action?.kind === "start" && (
- <Pressable
- onPress={onStart}
- accessibilityRole="button"
- accessibilityLabel={action.label}
- className="mt-1 flex-row items-center gap-2 self-start rounded-full bg-accent-9 px-4 py-2.5 active:opacity-80"
- >
- {action.awaitingInput ? (
- <Plus size={16} color="#ffffff" weight="bold" />
- ) : (
- <Play size={16} color="#ffffff" weight="fill" />
- )}
- <Text className="font-semibold text-[14px] text-white">
- {action.label}
- </Text>
- </Pressable>
- )}
-
- {action?.kind === "view_pr" && (
- <Pressable
- onPress={() => onOpenPr(action.url)}
- accessibilityRole="button"
- accessibilityLabel="View PR"
- className="mt-1 flex-row items-center gap-2 self-start rounded-full border border-gray-6 bg-background px-4 py-2.5 active:opacity-80"
- >
- <ArrowSquareOut size={16} color={themeColors.gray[12]} />
- <Text className="font-semibold text-[14px] text-gray-12">
- View PR
- </Text>
- </Pressable>
- )}
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/inbox/components/ReviewerFilterSheet.tsx b/products/desktop/apps/mobile/src/features/inbox/components/ReviewerFilterSheet.tsx
deleted file mode 100644
index 44ac730dafdc..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/components/ReviewerFilterSheet.tsx
+++ /dev/null
@@ -1,115 +0,0 @@
-import { Text } from "@components/text";
-import { buildReviewerOptions } from "@posthog/core/inbox/artefacts";
-import { useMemo } from "react";
-import {
- ActivityIndicator,
- Modal,
- Pressable,
- ScrollView,
- View,
-} from "react-native";
-import { useUserQuery } from "@/features/auth";
-import { useScreenInsets } from "@/hooks/useScreenInsets";
-import { useThemeColors } from "@/lib/theme";
-import { useAvailableSuggestedReviewers } from "../hooks/useInboxReports";
-import { useInboxFilterStore } from "../stores/inboxFilterStore";
-import { ReviewerOptionRow } from "./ReviewerOptionRow";
-
-interface ReviewerFilterSheetProps {
- visible: boolean;
- onClose: () => void;
-}
-
-export function ReviewerFilterSheet({
- visible,
- onClose,
-}: ReviewerFilterSheetProps) {
- const { bottom, sheetContentTop } = useScreenInsets();
- const themeColors = useThemeColors();
- const { data: currentUser } = useUserQuery();
- const { data: available, isLoading } = useAvailableSuggestedReviewers();
-
- const suggestedReviewerFilter = useInboxFilterStore(
- (s) => s.suggestedReviewerFilter,
- );
- const toggleSuggestedReviewer = useInboxFilterStore(
- (s) => s.toggleSuggestedReviewer,
- );
- const setSuggestedReviewerFilter = useInboxFilterStore(
- (s) => s.setSuggestedReviewerFilter,
- );
-
- const options = useMemo(
- () => buildReviewerOptions(available?.results ?? [], currentUser?.uuid),
- [available?.results, currentUser?.uuid],
- );
-
- const hasSelection = suggestedReviewerFilter.length > 0;
-
- return (
- <Modal
- visible={visible}
- animationType="slide"
- presentationStyle="pageSheet"
- onRequestClose={onClose}
- >
- <View
- className="flex-1 bg-background"
- style={{ paddingTop: sheetContentTop() }}
- >
- {/* Header */}
- <View className="flex-row items-center justify-between border-gray-6 border-b px-4 pb-3">
- <Text className="font-semibold text-[18px] text-gray-12">
- Suggested Reviewer
- </Text>
- <View className="flex-row items-center gap-3">
- {hasSelection && (
- <Pressable onPress={() => setSuggestedReviewerFilter([])}>
- <Text className="text-[14px] text-accent-9">Clear</Text>
- </Pressable>
- )}
- <Pressable onPress={onClose}>
- <Text className="font-semibold text-[14px] text-accent-9">
- Done
- </Text>
- </Pressable>
- </View>
- </View>
-
- {isLoading && options.length === 0 ? (
- <View className="flex-1 items-center justify-center">
- <ActivityIndicator size="large" color={themeColors.accent[9]} />
- </View>
- ) : options.length === 0 ? (
- <View className="flex-1 items-center justify-center p-6">
- <Text className="text-[14px] text-gray-10">No reviewers found</Text>
- </View>
- ) : (
- <ScrollView
- contentContainerStyle={{
- paddingHorizontal: 16,
- paddingTop: 12,
- paddingBottom: bottom("roomy"),
- }}
- >
- {options.map((reviewer, index) => {
- const showDivider = reviewer.isMe && index < options.length - 1;
- return (
- <View key={reviewer.uuid}>
- <ReviewerOptionRow
- reviewer={reviewer}
- selected={suggestedReviewerFilter.includes(reviewer.uuid)}
- onPress={() => toggleSuggestedReviewer(reviewer.uuid)}
- />
- {showDivider && (
- <View className="mx-2 my-1 border-gray-6 border-t" />
- )}
- </View>
- );
- })}
- </ScrollView>
- )}
- </View>
- </Modal>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/inbox/components/ReviewerOptionRow.tsx b/products/desktop/apps/mobile/src/features/inbox/components/ReviewerOptionRow.tsx
deleted file mode 100644
index 0c21699177a8..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/components/ReviewerOptionRow.tsx
+++ /dev/null
@@ -1,56 +0,0 @@
-import { Text } from "@components/text";
-import {
- type ReviewerOption,
- reviewerOptionLabel,
-} from "@posthog/core/inbox/artefacts";
-import { Check } from "phosphor-react-native";
-import { Image, Pressable, View } from "react-native";
-import { useThemeColors } from "@/lib/theme";
-
-interface ReviewerOptionRowProps {
- reviewer: ReviewerOption;
- selected: boolean;
- onPress: () => void;
-}
-
-export function ReviewerOptionRow({
- reviewer,
- selected,
- onPress,
-}: ReviewerOptionRowProps) {
- const themeColors = useThemeColors();
- return (
- <Pressable
- onPress={onPress}
- className="flex-row items-center justify-between rounded-md px-2 py-2.5 active:bg-gray-3"
- >
- <View className="min-w-0 flex-1 flex-row items-center gap-2.5">
- {reviewer.github_login ? (
- <Image
- source={{
- uri: `https://github.com/${reviewer.github_login}.png?size=32`,
- }}
- className="h-6 w-6 rounded-full bg-gray-4"
- />
- ) : (
- <View className="h-6 w-6 items-center justify-center rounded-full bg-gray-4">
- <Text className="text-[11px] text-gray-10">
- {(reviewer.name || reviewer.email || "?")[0].toUpperCase()}
- </Text>
- </View>
- )}
- <View className="min-w-0 flex-1">
- <Text className="text-[14px] text-gray-12" numberOfLines={1}>
- {reviewerOptionLabel(reviewer)}
- </Text>
- {reviewer.email && (
- <Text className="text-[12px] text-gray-9" numberOfLines={1}>
- {reviewer.email}
- </Text>
- )}
- </View>
- </View>
- {selected && <Check size={16} color={themeColors.gray[12]} />}
- </Pressable>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/inbox/components/SignalCard.tsx b/products/desktop/apps/mobile/src/features/inbox/components/SignalCard.tsx
deleted file mode 100644
index cc9b7b16cc83..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/components/SignalCard.tsx
+++ /dev/null
@@ -1,493 +0,0 @@
-import { Text } from "@components/text";
-import type { RecordingExport } from "@posthog/api-client/posthog-client";
-import {
- EXTERNAL_INBOX_SOURCE_BY_PRODUCT,
- type SourceProduct,
-} from "@posthog/shared";
-import type {
- Signal,
- SignalFindingContent,
-} from "@posthog/shared/domain-types";
-import { useQuery } from "@tanstack/react-query";
-import {
- ArrowSquareOut,
- Bug,
- CaretDown,
- CaretRight,
- ChatCircle,
- CheckCircle,
- Code,
- Compass,
- FirstAid,
- GithubLogo,
- LinkSimple,
- Play,
- Plug,
- Question,
- Robot,
- WarningCircle,
-} from "phosphor-react-native";
-import { type ReactNode, useState } from "react";
-import { Pressable, View } from "react-native";
-import { useAuthStore } from "@/features/auth";
-import { MarkdownText } from "@/features/chat/components/MarkdownText";
-import { formatRelativeTime } from "@/lib/format";
-import { openExternalUrl } from "@/lib/openExternalUrl";
-import { getPostHogApiClient } from "@/lib/posthogApiClient";
-import { type ThemeColors, useThemeColors } from "@/lib/theme";
-import {
- type ConversationsTicketExtra,
- conversationsTicketRef,
- supportTicketUrl,
-} from "../conversationsTicket";
-import {
- colonOffsetFromSeconds,
- colonOffsetToSeconds,
-} from "../recordingOffset";
-import { sourceLine } from "../utils";
-import { WatchRecordingSheet } from "./WatchRecordingSheet";
-
-const COLLAPSE_THRESHOLD = 280;
-
-function SourceIcon({
- product,
- size = 14,
- color,
-}: {
- product: string;
- size?: number;
- color: string;
-}) {
- switch (product) {
- case "error_tracking":
- return <Bug size={size} color={color} />;
- case "github":
- return <GithubLogo size={size} color={color} />;
- case "session_replay":
- return <ChatCircle size={size} color={color} />;
- case "llm_analytics":
- return <Robot size={size} color={color} />;
- case "conversations":
- case "zendesk":
- return <ChatCircle size={size} color={color} />;
- case "linear":
- return <LinkSimple size={size} color={color} />;
- case "signals_scout":
- return <Compass size={size} color={color} />;
- case "health_checks":
- return <FirstAid size={size} color={color} />;
- default:
- if (EXTERNAL_INBOX_SOURCE_BY_PRODUCT[product as SourceProduct])
- return <Plug size={size} color={color} />;
- return <WarningCircle size={size} color={color} />;
- }
-}
-
-function truncateBody(body: string): string {
- if (body.length <= COLLAPSE_THRESHOLD) return body;
- const truncated = body.slice(0, COLLAPSE_THRESHOLD);
- const lastNewline = truncated.lastIndexOf("\n");
- const cut =
- lastNewline > COLLAPSE_THRESHOLD * 0.5 ? lastNewline : COLLAPSE_THRESHOLD;
- let result = truncated.slice(0, cut);
- const fenceCount = (result.match(/^```/gm) || []).length;
- if (fenceCount % 2 !== 0) {
- const lastFence = result.lastIndexOf("```");
- const afterFence = result.slice(lastFence + 3).trim();
- if (!afterFence) {
- result = result.slice(0, lastFence).trimEnd();
- } else {
- result += "\n```";
- }
- }
- return `${result}\n\n…`;
-}
-
-function CollapsibleBody({ body }: { body: string }) {
- const themeColors = useThemeColors();
- const [expanded, setExpanded] = useState(false);
- const isLong = body.length > COLLAPSE_THRESHOLD;
- const processed = body.replace(/\\`/g, "`");
- const display = isLong && !expanded ? truncateBody(processed) : processed;
-
- return (
- <View>
- <MarkdownText content={display} />
- {isLong && (
- <Pressable
- onPress={() => setExpanded((v) => !v)}
- hitSlop={6}
- className="mt-1 flex-row items-center gap-1 self-start py-1 active:opacity-60"
- >
- {expanded ? (
- <CaretDown size={12} color={themeColors.accent[11]} />
- ) : (
- <CaretRight size={12} color={themeColors.accent[11]} />
- )}
- <Text className="font-medium text-[12px] text-accent-11">
- {expanded ? "Show less" : "Show more"}
- </Text>
- </Pressable>
- )}
- </View>
- );
-}
-
-function CodePathsDisclosure({ paths }: { paths: string[] }) {
- const themeColors = useThemeColors();
- const [expanded, setExpanded] = useState(false);
- if (paths.length === 0) return null;
-
- return (
- <View className="mt-2 border-gray-5 border-t pt-2">
- <Pressable
- onPress={() => setExpanded((v) => !v)}
- hitSlop={6}
- className="flex-row items-center gap-1 self-start py-1 active:opacity-60"
- >
- {expanded ? (
- <CaretDown size={12} color={themeColors.gray[11]} />
- ) : (
- <CaretRight size={12} color={themeColors.gray[11]} />
- )}
- <Code size={12} color={themeColors.gray[11]} />
- <Text className="font-medium text-[12px] text-gray-11">
- Relevant code ({paths.length})
- </Text>
- </Pressable>
- {expanded && (
- <View className="mt-1 gap-1 pl-[18px]">
- {paths.map((raw) => {
- const trimmed = raw.trim();
- const parenIdx = trimmed.indexOf(" (");
- const filePath =
- parenIdx >= 0 ? trimmed.slice(0, parenIdx) : trimmed;
- const comment = parenIdx >= 0 ? trimmed.slice(parenIdx + 1) : null;
- return (
- <Text key={raw} className="text-[11px]">
- <Text className="font-mono text-[11px] text-gray-12">
- {filePath}
- </Text>
- {comment && (
- <Text className="text-[11px] text-gray-9"> {comment}</Text>
- )}
- </Text>
- );
- })}
- </View>
- )}
- </View>
- );
-}
-
-function VerifiedBadge({ verified }: { verified: boolean }) {
- const themeColors = useThemeColors();
- const color = verified ? themeColors.status.success : themeColors.gray[9];
- const Icon = verified ? CheckCircle : Question;
- return (
- <View className="flex-row items-center gap-1">
- <Icon size={12} color={color} weight={verified ? "fill" : "bold"} />
- <Text className="text-[11px]" style={{ color }}>
- {verified ? "Verified" : "Unverified"}
- </Text>
- </View>
- );
-}
-
-interface RecordingEvidence {
- sessionId: string;
- exportedAssetId: number | null;
- seekSeconds: number | null;
-}
-
-function extractRecordingEvidence(signal: Signal): RecordingEvidence | null {
- const extra = signal.extra ?? {};
- const sessionId =
- typeof extra.session_id === "string" ? extra.session_id : null;
- if (!sessionId) return null;
-
- const isSessionProblem =
- signal.source_product === "session_replay" && "segment_title" in extra;
- const isScannerFinding =
- signal.source_product === "replay_vision" && "scanner_name" in extra;
- if (!isSessionProblem && !isScannerFinding) return null;
-
- const exportedAssetId =
- typeof extra.exported_asset_id === "number"
- ? extra.exported_asset_id
- : null;
-
- let seekSeconds: number | null = null;
- const startTime = extra.start_time;
- if (typeof startTime === "number") {
- seekSeconds = startTime;
- } else if (typeof startTime === "string") {
- seekSeconds = colonOffsetToSeconds(startTime);
- }
-
- return { sessionId, exportedAssetId, seekSeconds };
-}
-
-function EvidenceActionPill({
- glyph,
- label,
- onPress,
-}: {
- glyph: ReactNode;
- label: string;
- onPress: () => void;
-}) {
- return (
- <Pressable
- onPress={onPress}
- hitSlop={6}
- className="mt-2 flex-row items-center gap-1.5 self-start rounded-full border border-gray-5 bg-gray-2 py-1 pr-2.5 pl-1.5 active:opacity-70"
- >
- <View className="size-4 items-center justify-center rounded-full bg-accent-9">
- {glyph}
- </View>
- <Text className="font-medium text-[12px] text-gray-11">{label}</Text>
- </Pressable>
- );
-}
-
-function WatchRecordingAction({ evidence }: { evidence: RecordingEvidence }) {
- const themeColors = useThemeColors();
- const [open, setOpen] = useState(false);
- const { sessionId, exportedAssetId, seekSeconds } = evidence;
- const { projectId, oauthAccessToken, cloudRegion, getCloudUrlFromRegion } =
- useAuthStore();
-
- const playerUrl =
- cloudRegion && projectId
- ? `${getCloudUrlFromRegion(cloudRegion)}/project/${projectId}/replay/${encodeURIComponent(sessionId)}${seekSeconds != null ? `?t=${seekSeconds}` : ""}`
- : null;
-
- const exportQuery = useQuery<RecordingExport | null>({
- queryKey: ["recording-export", projectId, exportedAssetId, sessionId],
- queryFn: async () => {
- if (!projectId) return null;
- const client = getPostHogApiClient();
- return exportedAssetId != null
- ? await client.getRecordingExport(projectId, exportedAssetId)
- : await client.findRecordingExport(projectId, sessionId);
- },
- enabled: !!projectId && !!oauthAccessToken,
- staleTime: Infinity,
- });
- const clip = exportQuery.data ?? null;
-
- const contentQuery = useQuery<string | null>({
- queryKey: ["recording-clip-url", projectId, clip?.id],
- queryFn: async () => {
- if (!projectId || clip == null) return null;
- return await getPostHogApiClient().getExportContentUrl(
- projectId,
- clip.id,
- );
- },
- enabled: open && !!projectId && clip != null,
- staleTime: Infinity,
- });
-
- const momentLabel =
- seekSeconds != null ? colonOffsetFromSeconds(seekSeconds) : null;
- const pillLabel = momentLabel
- ? `Watch at ${momentLabel}`
- : "Watch the recording";
-
- const hasNoClip = exportQuery.isFetched && clip == null;
- const clipUnavailable = contentQuery.isError || contentQuery.data === null;
- const clipPending = !clipUnavailable && contentQuery.data == null;
-
- if (exportQuery.isError || hasNoClip) {
- if (!playerUrl) return null;
- return (
- <EvidenceActionPill
- glyph={<ArrowSquareOut size={9} color="#ffffff" weight="bold" />}
- label={pillLabel}
- onPress={() => openExternalUrl(playerUrl)}
- />
- );
- }
-
- return (
- <>
- <EvidenceActionPill
- glyph={
- <Play
- size={9}
- color={themeColors.gray[1]}
- weight="fill"
- style={{ marginLeft: 0.5 }}
- />
- }
- label={pillLabel}
- onPress={() => setOpen(true)}
- />
-
- <WatchRecordingSheet
- visible={open}
- clip={clip}
- contentUrl={contentQuery.data ?? null}
- contentPending={clipPending}
- contentUnavailable={clipUnavailable}
- seekSeconds={seekSeconds ?? null}
- playerUrl={playerUrl}
- onClose={() => setOpen(false)}
- />
- </>
- );
-}
-
-function ConversationsTicketFooter({
- signal,
- extra,
- themeColors,
-}: {
- signal: Signal;
- extra: ConversationsTicketExtra;
- themeColors: ThemeColors;
-}) {
- const { projectId, cloudRegion } = useAuthStore();
- const ticketRef = conversationsTicketRef(signal, extra);
- const ticketUrl =
- ticketRef !== null
- ? supportTicketUrl(ticketRef, { projectId, cloudRegion })
- : null;
-
- return (
- <View className="mt-2 flex-row flex-wrap items-center gap-x-3 gap-y-1">
- {extra.ticket_number != null && (
- <Text className="font-mono text-[11px] text-gray-10">
- #{extra.ticket_number}
- </Text>
- )}
- {extra.status && (
- <Text className="text-[11px] text-gray-10">Status: {extra.status}</Text>
- )}
- {extra.priority && (
- <Text className="text-[11px] text-gray-10">
- Priority: {extra.priority}
- </Text>
- )}
- <View className="flex-1" />
- {ticketUrl ? (
- <Pressable
- onPress={() => openExternalUrl(ticketUrl)}
- hitSlop={6}
- className="flex-row items-center gap-1 active:opacity-60"
- >
- <Text className="text-[11px] text-gray-10">Open ticket</Text>
- <ArrowSquareOut size={12} color={themeColors.gray[10]} />
- </Pressable>
- ) : (
- <Text className="text-[11px] text-gray-10">
- Source ticket unavailable
- </Text>
- )}
- </View>
- );
-}
-
-interface SignalCardProps {
- signal: Signal;
- finding?: SignalFindingContent;
-}
-
-export function SignalCard({ signal, finding }: SignalCardProps) {
- const themeColors = useThemeColors();
- const verified = finding?.verified;
- const codePaths = finding?.relevant_code_paths ?? [];
-
- const extra = signal.extra ?? {};
- const issueUrl =
- typeof extra.html_url === "string" ? (extra.html_url as string) : null;
- const issueNumber =
- typeof extra.number === "number" ? (extra.number as number) : null;
- const ticketUrl =
- typeof extra.url === "string" ? (extra.url as string) : null;
-
- const conversationsExtra =
- signal.source_product === "conversations" && signal.source_type === "ticket"
- ? (extra as ConversationsTicketExtra)
- : null;
-
- const externalUrl = issueUrl ?? ticketUrl ?? null;
- const recordingEvidence = extractRecordingEvidence(signal);
-
- const timestampMs = signal.timestamp ? Date.parse(signal.timestamp) : NaN;
- const hasTimestamp = !Number.isNaN(timestampMs) && timestampMs <= Date.now();
-
- return (
- <View className="overflow-hidden rounded-xl border border-gray-6 bg-gray-1 p-3">
- {/* Header */}
- <View className="mb-2 flex-row items-center gap-2">
- <SourceIcon
- product={signal.source_product}
- color={themeColors.gray[10]}
- />
- <Text
- className="min-w-0 shrink font-medium text-[13px] text-gray-10"
- numberOfLines={1}
- >
- {sourceLine(signal)}
- </Text>
- <View className="flex-1" />
- {hasTimestamp && (
- <Text className="shrink-0 text-[11px] text-gray-10">
- {formatRelativeTime(timestampMs)}
- </Text>
- )}
- {verified !== undefined && <VerifiedBadge verified={verified} />}
- </View>
-
- {conversationsExtra?.email_subject && (
- <Text
- className="mb-1 font-medium text-[13px] text-gray-12"
- numberOfLines={2}
- >
- {conversationsExtra.email_subject}
- </Text>
- )}
-
- {/* Body */}
- <CollapsibleBody body={signal.content} />
-
- {recordingEvidence && (
- <WatchRecordingAction evidence={recordingEvidence} />
- )}
-
- {conversationsExtra ? (
- <ConversationsTicketFooter
- signal={signal}
- extra={conversationsExtra}
- themeColors={themeColors}
- />
- ) : (
- (issueNumber !== null || externalUrl) && (
- <View className="mt-2 flex-row items-center gap-3">
- {issueNumber !== null && (
- <Text className="font-medium text-[11px] text-gray-10">
- #{issueNumber}
- </Text>
- )}
- <View className="flex-1" />
- {externalUrl && (
- <Pressable
- onPress={() => openExternalUrl(externalUrl)}
- hitSlop={6}
- className="flex-row items-center gap-1 active:opacity-60"
- >
- <Text className="text-[11px] text-gray-10">Open</Text>
- <ArrowSquareOut size={12} color={themeColors.gray[10]} />
- </Pressable>
- )}
- </View>
- )
- )}
-
- <CodePathsDisclosure paths={codePaths} />
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/inbox/components/SuggestedReviewerAvatarStack.test.tsx b/products/desktop/apps/mobile/src/features/inbox/components/SuggestedReviewerAvatarStack.test.tsx
deleted file mode 100644
index 323a8401ce2d..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/components/SuggestedReviewerAvatarStack.test.tsx
+++ /dev/null
@@ -1,134 +0,0 @@
-import type {
- SignalReport,
- SignalReportArtefactsResponse,
- SuggestedReviewer,
-} from "@posthog/shared/domain-types";
-import { createElement } from "react";
-import { act, create } from "react-test-renderer";
-import { beforeEach, describe, expect, it, vi } from "vitest";
-
-const mocks = vi.hoisted(() => ({
- currentUserUuid: "user-me" as string | undefined,
- mutate: vi.fn(),
- track: vi.fn(),
-}));
-
-vi.mock("@/features/auth", () => ({
- useUserQuery: () => ({ data: { uuid: mocks.currentUserUuid } }),
-}));
-
-vi.mock("../hooks/useInboxReports", () => ({
- useInboxReportArtefacts: () => ({ data: artefacts }),
- useUpdateSuggestedReviewers: () => ({
- mutate: mocks.mutate,
- isPending: false,
- }),
-}));
-
-vi.mock("@/lib/analytics", () => ({
- ANALYTICS_EVENTS: { INBOX_REPORT_ACTION: "Inbox report action" },
- computeReportAgeHours: () => 0,
- useAnalytics: () => ({ track: mocks.track }),
-}));
-
-vi.mock("@/lib/theme", () => ({
- useThemeColors: () => ({ gray: { 9: "#888" } }),
-}));
-
-// react-native-web's Image touches `window` in a mount effect, which the node
-// test environment lacks. A stub keeps the avatar stack renderable.
-vi.mock("react-native", async () => {
- const actual = await import("react-native-web");
- const { createElement } = await import("react");
- return {
- ...actual,
- Image: (props: Record<string, unknown>) => createElement("Image", props),
- };
-});
-
-import { SuggestedReviewerAvatarStack } from "./SuggestedReviewerAvatarStack";
-
-function reviewer(login: string, uuid: string): SuggestedReviewer {
- return {
- github_login: login,
- github_name: login,
- relevant_commits: [],
- user: {
- id: 1,
- uuid,
- email: `${login}@example.com`,
- first_name: login,
- last_name: "",
- },
- };
-}
-
-const me = reviewer("alice", "user-me");
-const teammate = reviewer("bob", "user-bob");
-const report = { id: "report-1", title: "Checkout failures" } as SignalReport;
-const artefacts: SignalReportArtefactsResponse = {
- count: 1,
- results: [
- {
- id: "reviewers-1",
- type: "suggested_reviewers",
- created_at: "2026-01-01T00:00:00Z",
- content: [me, teammate],
- },
- ],
-};
-
-function mount() {
- let renderer: ReturnType<typeof create> | null = null;
- act(() => {
- renderer = create(createElement(SuggestedReviewerAvatarStack, { report }));
- });
- if (!renderer) throw new Error("Renderer not created");
- return renderer as ReturnType<typeof create>;
-}
-
-function removeButton(renderer: ReturnType<typeof create>) {
- return renderer.root.findAll(
- (node) =>
- node.props.accessibilityLabel === "Remove yourself from reviewers",
- );
-}
-
-describe("SuggestedReviewerAvatarStack", () => {
- beforeEach(() => {
- vi.clearAllMocks();
- mocks.currentUserUuid = "user-me";
- });
-
- it.each([
- ["the current user is a reviewer", "user-me", true],
- ["the current user is not a reviewer", "user-other", false],
- ])("is interactive when %s", (_case, currentUserUuid, interactive) => {
- mocks.currentUserUuid = currentUserUuid;
- expect(removeButton(mount()).length > 0).toBe(interactive);
- });
-
- it("removes the current user and tracks the list action", () => {
- const renderer = mount();
- act(() => {
- removeButton(renderer)[0].props.onPress();
- });
-
- expect(mocks.mutate).toHaveBeenCalledWith({
- artefactId: "reviewers-1",
- content: [{ user_uuid: "user-bob" }],
- action: "remove",
- targets: [{ user_uuid: "user-me" }],
- optimisticReviewers: [teammate],
- });
- expect(mocks.track).toHaveBeenCalledWith(
- "Inbox report action",
- expect.objectContaining({
- action_type: "remove_suggested_reviewer",
- surface: "list_row",
- suggested_reviewer_login: "alice",
- suggested_reviewer_uuid: "user-me",
- }),
- );
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/inbox/components/SuggestedReviewerAvatarStack.tsx b/products/desktop/apps/mobile/src/features/inbox/components/SuggestedReviewerAvatarStack.tsx
deleted file mode 100644
index 0e46ef681749..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/components/SuggestedReviewerAvatarStack.tsx
+++ /dev/null
@@ -1,127 +0,0 @@
-import { Text } from "@components/text";
-import { toSuggestedReviewerWriteContent } from "@posthog/core/inbox/artefacts";
-import { selectSuggestedReviewersArtefact } from "@posthog/core/inbox/reportArtefacts";
-import type { SignalReport } from "@posthog/shared/domain-types";
-import { ActivityIndicator, Image, Pressable, View } from "react-native";
-import { useUserQuery } from "@/features/auth";
-import {
- ANALYTICS_EVENTS,
- computeReportAgeHours,
- useAnalytics,
-} from "@/lib/analytics";
-import { useThemeColors } from "@/lib/theme";
-import {
- useInboxReportArtefacts,
- useUpdateSuggestedReviewers,
-} from "../hooks/useInboxReports";
-
-const MAX_VISIBLE = 4;
-const OVERLAP = { marginLeft: -6 };
-
-interface SuggestedReviewerAvatarStackProps {
- report: SignalReport;
-}
-
-export function SuggestedReviewerAvatarStack({
- report,
-}: SuggestedReviewerAvatarStackProps) {
- const themeColors = useThemeColors();
- const { data: me } = useUserQuery();
- const { data: artefacts } = useInboxReportArtefacts(report.id, {
- staleTime: 5 * 60 * 1000,
- refetchInterval: false,
- });
- const { mutate: updateReviewers, isPending } = useUpdateSuggestedReviewers(
- report.id,
- );
- const analytics = useAnalytics();
-
- const reviewerArtefact = selectSuggestedReviewersArtefact(
- artefacts?.results ?? [],
- );
- const reviewers = (reviewerArtefact?.content ?? []).filter(
- (reviewer) => reviewer.github_login,
- );
- if (reviewers.length === 0) {
- return null;
- }
-
- const currentReviewer = reviewers.find(
- (reviewer) => reviewer.user?.uuid === me?.uuid,
- );
- const visible = reviewers.slice(0, MAX_VISIBLE);
- const overflow = reviewers.length - visible.length;
-
- const stack = (
- <View className="flex-row items-center">
- {visible.map((reviewer, index) => (
- <Image
- key={reviewer.github_login}
- source={{
- uri: `https://github.com/${reviewer.github_login}.png?size=48`,
- }}
- className="h-6 w-6 rounded-full border-2 border-background bg-gray-4"
- style={index > 0 ? OVERLAP : undefined}
- />
- ))}
- {overflow > 0 ? (
- <View
- className="h-6 min-w-6 items-center justify-center rounded-full border-2 border-background bg-gray-3 px-1"
- style={OVERLAP}
- >
- <Text className="font-semibold text-[10px] text-gray-11">
- +{overflow}
- </Text>
- </View>
- ) : null}
- </View>
- );
-
- if (!currentReviewer || !reviewerArtefact) {
- return stack;
- }
-
- const removeSelf = () => {
- const next = reviewerArtefact.content.filter(
- (reviewer) => reviewer.user?.uuid !== me?.uuid,
- );
- analytics.track(ANALYTICS_EVENTS.INBOX_REPORT_ACTION, {
- report_id: report.id,
- report_title: report.title ?? null,
- report_age_hours: computeReportAgeHours(report.created_at),
- priority: report.priority ?? null,
- actionability: report.actionability ?? null,
- action_type: "remove_suggested_reviewer",
- surface: "list_row",
- is_bulk: false,
- bulk_size: 1,
- rank: 0,
- list_size: 0,
- suggested_reviewer_login: currentReviewer.github_login || undefined,
- suggested_reviewer_uuid: currentReviewer.user?.uuid,
- });
- updateReviewers({
- artefactId: reviewerArtefact.id,
- content: toSuggestedReviewerWriteContent(next),
- action: "remove",
- targets: toSuggestedReviewerWriteContent([currentReviewer]),
- optimisticReviewers: next,
- });
- };
-
- return (
- <Pressable
- onPress={removeSelf}
- disabled={isPending}
- hitSlop={8}
- accessibilityRole="button"
- accessibilityLabel="Remove yourself from reviewers"
- className="flex-row items-center gap-1.5 py-1 active:opacity-70"
- >
- {stack}
- {isPending ? (
- <ActivityIndicator size="small" color={themeColors.gray[9]} />
- ) : null}
- </Pressable>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/inbox/components/SuggestedReviewers.tsx b/products/desktop/apps/mobile/src/features/inbox/components/SuggestedReviewers.tsx
deleted file mode 100644
index 2161e6573695..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/components/SuggestedReviewers.tsx
+++ /dev/null
@@ -1,240 +0,0 @@
-import { Text } from "@components/text";
-import {
- orderSuggestedReviewers,
- reviewerMatchesAvailable,
- toSuggestedReviewerWriteContent,
-} from "@posthog/core/inbox/artefacts";
-import type {
- AvailableSuggestedReviewer,
- SuggestedReviewer,
- SuggestedReviewersArtefact,
-} from "@posthog/shared/domain-types";
-import { Eye, Plus, X } from "phosphor-react-native";
-import { useMemo, useState } from "react";
-import {
- ActivityIndicator,
- Image,
- Pressable,
- ScrollView,
- View,
-} from "react-native";
-import type {
- InboxReportActionProperties,
- InboxReportActionType,
-} from "@/lib/analytics";
-import { openExternalUrl } from "@/lib/openExternalUrl";
-import { useThemeColors } from "@/lib/theme";
-import { useUpdateSuggestedReviewers } from "../hooks/useInboxReports";
-import { EditReviewersSheet } from "./EditReviewersSheet";
-
-export type ReviewerActionExtra = Pick<
- InboxReportActionProperties,
- "suggested_reviewer_login" | "suggested_reviewer_uuid"
->;
-
-interface SuggestedReviewersProps {
- reportId: string;
- artefact: SuggestedReviewersArtefact;
- meUuid?: string | null;
- fireAction: (
- action: InboxReportActionType,
- extra?: ReviewerActionExtra,
- ) => void;
-}
-
-export function SuggestedReviewers({
- reportId,
- artefact,
- meUuid,
- fireAction,
-}: SuggestedReviewersProps) {
- const themeColors = useThemeColors();
- const [editOpen, setEditOpen] = useState(false);
- const { mutate: updateReviewers, isPending } =
- useUpdateSuggestedReviewers(reportId);
-
- const reviewers = artefact.content;
-
- const displayReviewers = useMemo(
- () => orderSuggestedReviewers(reviewers, meUuid),
- [reviewers, meUuid],
- );
-
- const removeReviewer = (target: SuggestedReviewer) => {
- const next = reviewers.filter((r) => r !== target);
- fireAction("remove_suggested_reviewer", {
- suggested_reviewer_login: target.github_login || undefined,
- suggested_reviewer_uuid: target.user?.uuid,
- });
- updateReviewers({
- artefactId: artefact.id,
- content: toSuggestedReviewerWriteContent(next),
- action: "remove",
- targets: toSuggestedReviewerWriteContent([target]),
- optimisticReviewers: next,
- });
- };
-
- const toggleReviewer = (option: AvailableSuggestedReviewer) => {
- if (isPending) return;
- const existing = reviewers.find((r) => reviewerMatchesAvailable(r, option));
- if (existing) {
- removeReviewer(existing);
- return;
- }
-
- const optimisticEntry: SuggestedReviewer = {
- github_login: option.github_login,
- github_name: option.name || null,
- relevant_commits: [],
- user: {
- id: 0,
- uuid: option.uuid,
- email: option.email,
- first_name: option.name,
- last_name: "",
- },
- };
- fireAction("add_suggested_reviewer", {
- suggested_reviewer_login: option.github_login || undefined,
- suggested_reviewer_uuid: option.uuid,
- });
- updateReviewers({
- artefactId: artefact.id,
- content: [
- ...toSuggestedReviewerWriteContent(reviewers),
- { user_uuid: option.uuid },
- ],
- action: "add",
- targets: [{ user_uuid: option.uuid }],
- optimisticReviewers: [...reviewers, optimisticEntry],
- });
- };
-
- return (
- <View className="mb-4">
- <View className="mb-2 flex-row items-center gap-2">
- <Text className="font-semibold text-[12px] text-gray-10 uppercase tracking-wide">
- Suggested reviewers
- </Text>
- {isPending && (
- <ActivityIndicator size="small" color={themeColors.gray[9]} />
- )}
- <View className="flex-1" />
- <Pressable
- onPress={() => setEditOpen(true)}
- disabled={isPending}
- accessibilityLabel="Add suggested reviewer"
- hitSlop={6}
- className="flex-row items-center gap-1 rounded-full border border-gray-6 px-2.5 py-1 active:opacity-70 disabled:opacity-50"
- >
- <Plus size={12} color={themeColors.gray[11]} weight="bold" />
- <Text className="text-[12px] text-gray-11">Add</Text>
- </Pressable>
- </View>
-
- {displayReviewers.length === 0 ? (
- <Text className="text-[13px] text-gray-9">
- No reviewers assigned. Use “Add” to suggest one.
- </Text>
- ) : (
- <ScrollView
- horizontal
- showsHorizontalScrollIndicator={false}
- contentContainerStyle={{ gap: 8 }}
- >
- {displayReviewers.map((reviewer) => {
- const isMe =
- !!reviewer.user?.uuid &&
- !!meUuid &&
- reviewer.user.uuid === meUuid;
- const displayName =
- reviewer.user?.first_name ??
- reviewer.github_name ??
- reviewer.github_login ??
- reviewer.user?.email ??
- "Reviewer";
- const reviewerBody = (
- <>
- {reviewer.github_login ? (
- <Image
- source={{
- uri: `https://github.com/${reviewer.github_login}.png?size=48`,
- }}
- className="h-6 w-6 rounded-full bg-gray-4"
- />
- ) : (
- <View className="h-6 w-6 items-center justify-center rounded-full bg-gray-4">
- <Text className="text-[11px] text-gray-11">
- {displayName.slice(0, 1).toUpperCase()}
- </Text>
- </View>
- )}
- <Text className="text-[13px] text-gray-12">{displayName}</Text>
- {isMe && (
- <View className="rounded bg-status-warning/20 px-1 py-0.5">
- <Eye
- size={10}
- color={themeColors.status.warning}
- weight="bold"
- />
- </View>
- )}
- </>
- );
- return (
- <View
- key={
- reviewer.user?.uuid ??
- reviewer.user_uuid ??
- reviewer.github_login ??
- displayName
- }
- className="flex-row items-center gap-2 rounded-full border border-gray-6 bg-gray-2 py-1.5 pr-1.5 pl-1.5"
- >
- {reviewer.github_login ? (
- <Pressable
- onPress={() => {
- fireAction("click_suggested_reviewer", {
- suggested_reviewer_login:
- reviewer.github_login ?? undefined,
- });
- openExternalUrl(
- `https://github.com/${reviewer.github_login}`,
- );
- }}
- hitSlop={4}
- className="flex-row items-center gap-2 active:opacity-70"
- >
- {reviewerBody}
- </Pressable>
- ) : (
- <View className="flex-row items-center gap-2">
- {reviewerBody}
- </View>
- )}
- <Pressable
- onPress={() => removeReviewer(reviewer)}
- disabled={isPending}
- accessibilityLabel={`Remove ${displayName}`}
- hitSlop={6}
- className="h-5 w-5 items-center justify-center rounded-full active:bg-gray-4 disabled:opacity-50"
- >
- <X size={12} color={themeColors.gray[10]} weight="bold" />
- </Pressable>
- </View>
- );
- })}
- </ScrollView>
- )}
-
- <EditReviewersSheet
- visible={editOpen}
- reviewers={reviewers}
- meUuid={meUuid}
- onClose={() => setEditOpen(false)}
- onToggle={toggleReviewer}
- />
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/inbox/components/SwipeableReportCard.tsx b/products/desktop/apps/mobile/src/features/inbox/components/SwipeableReportCard.tsx
deleted file mode 100644
index 3c281d390e6e..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/components/SwipeableReportCard.tsx
+++ /dev/null
@@ -1,320 +0,0 @@
-import { Text } from "@components/text";
-import {
- humanizeReportTitle,
- inboxStatusLabel,
- parseConventionalCommitTitle,
-} from "@posthog/core/inbox/reportPresentation";
-import type {
- SignalReport,
- SignalReportPriority,
- SignalReportStatus,
-} from "@posthog/shared/domain-types";
-import { formatDistanceToNow } from "date-fns";
-import * as Haptics from "expo-haptics";
-import { GithubLogo, Lightning } from "phosphor-react-native";
-import { useRef } from "react";
-import { Animated, PanResponder, Pressable, View } from "react-native";
-import { MarkdownText } from "@/features/chat/components/MarkdownText";
-import { PrStatusBadge } from "@/features/tasks/components/PrStatusBadge";
-import { useThemeColors } from "@/lib/theme";
-import { ConventionalCommitTag } from "./ConventionalCommitTag";
-
-const SWIPE_THRESHOLD = 120;
-const TAP_THRESHOLD = 10;
-
-const statusColorMap: Record<string, { bg: string; text: string }> = {
- ready: { bg: "bg-status-success/20", text: "text-status-success" },
- pending_input: { bg: "bg-accent-3", text: "text-accent-11" },
- in_progress: { bg: "bg-status-warning/20", text: "text-status-warning" },
- candidate: { bg: "bg-status-info/20", text: "text-status-info" },
- potential: { bg: "bg-gray-5/20", text: "text-gray-9" },
- failed: { bg: "bg-status-error/20", text: "text-status-error" },
- suppressed: { bg: "bg-gray-5/20", text: "text-gray-9" },
- deleted: { bg: "bg-gray-5/20", text: "text-gray-9" },
-};
-
-const priorityColorMap: Record<
- SignalReportPriority,
- { bg: string; text: string }
-> = {
- P0: { bg: "bg-status-error/20", text: "text-status-error" },
- P1: { bg: "bg-status-warning/20", text: "text-status-warning" },
- P2: { bg: "bg-status-info/20", text: "text-status-info" },
- P3: { bg: "bg-gray-5/20", text: "text-gray-9" },
- P4: { bg: "bg-gray-5/20", text: "text-gray-9" },
-};
-
-interface SwipeableReportCardProps {
- report: SignalReport;
- onDismiss: (reportId: string) => void;
- onAccept: (report: SignalReport) => Promise<boolean>;
- onExpand: (report: SignalReport) => void;
- isTopCard: boolean;
- /** Vertical offset in px — cards further back sit lower. */
- stackOffset?: number;
- /** Repository slug to show at the bottom of the card. */
- repo?: string | null;
-}
-
-function StatusBadge({ status }: { status: SignalReportStatus }) {
- const colors = statusColorMap[status] ?? statusColorMap.potential;
- return (
- <View className={`rounded-full px-2 py-0.5 ${colors.bg}`}>
- <Text className={`font-medium text-[11px] ${colors.text}`}>
- {inboxStatusLabel(status)}
- </Text>
- </View>
- );
-}
-
-function PriorityBadge({ priority }: { priority: SignalReportPriority }) {
- const colors = priorityColorMap[priority] ?? priorityColorMap.P4;
- return (
- <View className={`rounded-full px-2 py-0.5 ${colors.bg}`}>
- <Text className={`font-medium text-[11px] ${colors.text}`}>
- {priority}
- </Text>
- </View>
- );
-}
-
-export function SwipeableReportCard({
- report,
- onDismiss,
- onAccept,
- onExpand,
- isTopCard,
- stackOffset = 0,
- repo,
-}: SwipeableReportCardProps) {
- const themeColors = useThemeColors();
- const translateX = useRef(new Animated.Value(0)).current;
- const maxDxRef = useRef(0);
-
- const propsRef = useRef({ report, onDismiss, onAccept, onExpand });
- propsRef.current = { report, onDismiss, onAccept, onExpand };
-
- const panResponder = useRef(
- PanResponder.create({
- onStartShouldSetPanResponder: () => false,
- onMoveShouldSetPanResponder: (_, gesture) =>
- Math.abs(gesture.dx) > 8 && Math.abs(gesture.dx) > Math.abs(gesture.dy),
- onPanResponderTerminationRequest: () => false,
- onPanResponderGrant: () => {
- maxDxRef.current = 0;
- },
- onPanResponderMove: (_, gesture) => {
- maxDxRef.current = Math.max(maxDxRef.current, Math.abs(gesture.dx));
- translateX.setValue(gesture.dx);
- },
- onPanResponderRelease: (_, gesture) => {
- const p = propsRef.current;
-
- // Tap detection: no significant movement
- if (maxDxRef.current < TAP_THRESHOLD) {
- translateX.setValue(0);
- p.onExpand(p.report);
- return;
- }
-
- if (gesture.dx > SWIPE_THRESHOLD) {
- // Swipe right → accept
- Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium);
- Animated.timing(translateX, {
- toValue: 500,
- duration: 200,
- useNativeDriver: true,
- }).start(async () => {
- const accepted = await p.onAccept(p.report);
- if (!accepted) translateX.setValue(0);
- });
- } else if (gesture.dx < -SWIPE_THRESHOLD) {
- // Swipe left → dismiss
- Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium);
- Animated.timing(translateX, {
- toValue: -500,
- duration: 200,
- useNativeDriver: true,
- }).start(() => {
- p.onDismiss(p.report.id);
- });
- } else {
- // Spring back
- Animated.spring(translateX, {
- toValue: 0,
- useNativeDriver: true,
- tension: 40,
- friction: 8,
- }).start();
- }
- },
- onPanResponderTerminate: () => {
- Animated.spring(translateX, {
- toValue: 0,
- useNativeDriver: true,
- }).start();
- },
- }),
- ).current;
-
- const rotate = translateX.interpolate({
- inputRange: [-200, 0, 200],
- outputRange: ["-12deg", "0deg", "12deg"],
- extrapolate: "clamp",
- });
-
- const acceptOpacity = translateX.interpolate({
- inputRange: [0, 120],
- outputRange: [0, 1],
- extrapolate: "clamp",
- });
-
- const dismissOpacity = translateX.interpolate({
- inputRange: [-120, 0],
- outputRange: [1, 0],
- extrapolate: "clamp",
- });
-
- const updatedAt = formatDistanceToNow(new Date(report.updated_at), {
- addSuffix: true,
- });
-
- // Non-top cards: static, offset down, no gestures
- if (!isTopCard) {
- return (
- <View
- className="absolute inset-x-0 top-0 rounded-2xl border border-gray-6 bg-card shadow-lg"
- style={{
- bottom: -stackOffset,
- opacity: 0.85,
- elevation: 2,
- }}
- >
- <CardContent
- report={report}
- updatedAt={updatedAt}
- themeColors={themeColors}
- repo={repo}
- />
- </View>
- );
- }
-
- return (
- <Animated.View
- className="absolute inset-0 rounded-2xl border border-gray-6 bg-card shadow-lg"
- style={{
- transform: [{ translateX }, { rotate }],
- elevation: 4,
- }}
- {...panResponder.panHandlers}
- >
- {/* Accept overlay — LEFT side (visible when tilting right) */}
- <Animated.View
- className="absolute top-0 bottom-0 left-0 z-10 w-16 items-center justify-center rounded-l-2xl bg-status-success/30"
- style={{ opacity: acceptOpacity }}
- pointerEvents="none"
- >
- <Text className="font-bold text-[28px] text-status-success">✓</Text>
- </Animated.View>
-
- {/* Dismiss overlay — RIGHT side (visible when tilting left) */}
- <Animated.View
- className="absolute top-0 right-0 bottom-0 z-10 w-16 items-center justify-center rounded-r-2xl bg-status-error/30"
- style={{ opacity: dismissOpacity }}
- pointerEvents="none"
- >
- <Text className="font-bold text-[28px] text-status-error">✗</Text>
- </Animated.View>
-
- <Pressable
- onPress={() => onExpand(report)}
- className="flex-1 active:opacity-80"
- >
- <CardContent
- report={report}
- updatedAt={updatedAt}
- themeColors={themeColors}
- repo={repo}
- />
- </Pressable>
- </Animated.View>
- );
-}
-
-interface CardContentProps {
- report: SignalReport;
- updatedAt: string;
- themeColors: ReturnType<typeof useThemeColors>;
- repo?: string | null;
-}
-
-function CardContent({
- report,
- updatedAt,
- themeColors,
- repo,
-}: CardContentProps) {
- const conventionalTitle = parseConventionalCommitTitle(report.title);
- const displayTitle = humanizeReportTitle(report.title, "Untitled report");
- return (
- <View className="flex-1 p-4">
- {/* Title */}
- <Text
- className="font-bold text-[16px] text-gray-12 leading-snug"
- numberOfLines={2}
- >
- {displayTitle}
- </Text>
-
- {/* Badges row */}
- <View className="mt-2 flex-row flex-wrap items-center gap-1.5">
- <StatusBadge status={report.status} />
- {report.priority && <PriorityBadge priority={report.priority} />}
- {conventionalTitle ? (
- <ConventionalCommitTag
- type={conventionalTitle.type}
- scope={conventionalTitle.scope}
- />
- ) : null}
- </View>
-
- {/* Summary — fills remaining space so footer sticks to the bottom */}
- <View className="mt-3 flex-1 overflow-hidden">
- {report.summary && <MarkdownText content={report.summary} />}
- </View>
-
- {/* Footer: signal count + time + repo */}
- <View className="mt-3 flex-row items-center gap-3">
- <View className="flex-row items-center gap-1">
- <Lightning size={13} color={themeColors.gray[9]} weight="fill" />
- <Text className="text-[12px] text-gray-9">
- {report.signal_count} signal{report.signal_count !== 1 ? "s" : ""}
- </Text>
- </View>
- <Text className="text-[12px] text-gray-9">·</Text>
- <Text className="text-[12px] text-gray-9">{updatedAt}</Text>
- {repo && (
- <>
- <Text className="text-[12px] text-gray-9">·</Text>
- <View className="flex-row items-center gap-1 rounded-full border border-gray-6 bg-gray-2 px-2 py-0.5">
- <GithubLogo size={10} color={themeColors.gray[9]} weight="fill" />
- <Text className="text-[11px] text-gray-9" numberOfLines={1}>
- {repo}
- </Text>
- </View>
- </>
- )}
- {report.implementation_pr_url ? (
- <View className="ml-auto">
- <PrStatusBadge
- prUrl={report.implementation_pr_url}
- hideWhenUnresolved
- size="sm"
- />
- </View>
- ) : null}
- </View>
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/inbox/components/TinderView.tsx b/products/desktop/apps/mobile/src/features/inbox/components/TinderView.tsx
deleted file mode 100644
index bba8843b91f0..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/components/TinderView.tsx
+++ /dev/null
@@ -1,520 +0,0 @@
-import { Text } from "@components/text";
-import { buildCreatePrReportPrompt } from "@posthog/core/inbox/reportActions";
-import {
- formatSignalReportSummaryMarkdown,
- humanizeReportTitle,
- inboxStatusLabel,
- parseConventionalCommitTitle,
-} from "@posthog/core/inbox/reportPresentation";
-import type {
- SignalReport,
- SignalReportPriority,
- SignalReportStatus,
-} from "@posthog/shared/domain-types";
-import { formatDistanceToNow } from "date-fns";
-import * as Haptics from "expo-haptics";
-import { useRouter } from "expo-router";
-import { Check, GithubLogo, Lightning, X } from "phosphor-react-native";
-import { useCallback, useEffect, useRef, useState } from "react";
-import {
- ActivityIndicator,
- Modal,
- Pressable,
- ScrollView,
- View,
-} from "react-native";
-import {
- SafeAreaView,
- useSafeAreaInsets,
-} from "react-native-safe-area-context";
-import { MarkdownText } from "@/features/chat/components/MarkdownText";
-import { usePreferencesStore } from "@/features/preferences/stores/preferencesStore";
-import { getModelConfigOption } from "@/features/tasks/composer/options";
-import { useCloudTaskConfigOptions } from "@/features/tasks/hooks/useCloudTaskConfigOptions";
-import {
- ANALYTICS_EVENTS,
- computeReportAgeHours,
- useAnalytics,
-} from "@/lib/analytics";
-import { logger } from "@/lib/logger";
-import { getPostHogApiClient } from "@/lib/posthogApiClient";
-import { useThemeColors } from "@/lib/theme";
-import { getReportRepository } from "../api";
-import { useDismissedReportsStore } from "../stores/dismissedReportsStore";
-import { useInboxStore } from "../stores/inboxStore";
-import { ConventionalCommitTag } from "./ConventionalCommitTag";
-import { SwipeableReportCard } from "./SwipeableReportCard";
-
-const log = logger.scope("tinder-view");
-
-// ─── Badge helpers (duplicated from SwipeableReportCard to avoid barrel exports) ───
-
-const statusColorMap: Record<string, { bg: string; text: string }> = {
- ready: { bg: "bg-status-success/20", text: "text-status-success" },
- pending_input: { bg: "bg-accent-3", text: "text-accent-11" },
- in_progress: { bg: "bg-status-warning/20", text: "text-status-warning" },
- candidate: { bg: "bg-status-info/20", text: "text-status-info" },
- potential: { bg: "bg-gray-5/20", text: "text-gray-9" },
- failed: { bg: "bg-status-error/20", text: "text-status-error" },
- suppressed: { bg: "bg-gray-5/20", text: "text-gray-9" },
- deleted: { bg: "bg-gray-5/20", text: "text-gray-9" },
-};
-
-const priorityColorMap: Record<
- SignalReportPriority,
- { bg: string; text: string }
-> = {
- P0: { bg: "bg-status-error/20", text: "text-status-error" },
- P1: { bg: "bg-status-warning/20", text: "text-status-warning" },
- P2: { bg: "bg-status-info/20", text: "text-status-info" },
- P3: { bg: "bg-gray-5/20", text: "text-gray-9" },
- P4: { bg: "bg-gray-5/20", text: "text-gray-9" },
-};
-
-function StatusBadge({ status }: { status: SignalReportStatus }) {
- const colors = statusColorMap[status] ?? statusColorMap.potential;
- return (
- <View className={`rounded-full px-2 py-0.5 ${colors.bg}`}>
- <Text className={`font-medium text-[11px] ${colors.text}`}>
- {inboxStatusLabel(status)}
- </Text>
- </View>
- );
-}
-
-function PriorityBadge({ priority }: { priority: SignalReportPriority }) {
- const colors = priorityColorMap[priority] ?? priorityColorMap.P4;
- return (
- <View className={`rounded-full px-2 py-0.5 ${colors.bg}`}>
- <Text className={`font-medium text-[11px] ${colors.text}`}>
- {priority}
- </Text>
- </View>
- );
-}
-
-// ─── Empty state ───
-
-function EmptyState() {
- const decidedCount = useDismissedReportsStore(
- (s) => s.dismissedIds.length + s.acceptedIds.length,
- );
- const clearDismissed = useDismissedReportsStore((s) => s.clearDismissed);
-
- return (
- <View className="items-center gap-3 px-8">
- <Text className="text-[32px]">🎉</Text>
- <Text className="font-semibold text-[17px] text-gray-12">
- All caught up!
- </Text>
- <Text className="text-center text-[14px] text-gray-10">
- You've reviewed all reports assigned to you. Check back later for new
- ones.
- </Text>
- {decidedCount > 0 && (
- <Pressable
- onPress={clearDismissed}
- className="mt-2 rounded-full border border-gray-6 bg-gray-2 px-4 py-2 active:bg-gray-3"
- >
- <Text className="text-[13px] text-gray-11">
- Reset {decidedCount} reviewed
- </Text>
- </Pressable>
- )}
- </View>
- );
-}
-
-// ─── Main component ───
-
-interface TinderViewProps {
- reports: SignalReport[];
- isLoading?: boolean;
-}
-
-export function TinderView({ reports, isLoading }: TinderViewProps) {
- const themeColors = useThemeColors();
- const router = useRouter();
- const insets = useSafeAreaInsets();
- const { configOptions, isConfigReady } = useCloudTaskConfigOptions("claude");
- const model = getModelConfigOption(configOptions).currentValue;
-
- // Store state
- const currentIndex = useInboxStore((s) => s.currentIndex);
- const _advanceCard = useInboxStore((s) => s.advanceCard);
- const dismissReport = useDismissedReportsStore((s) => s.dismissReport);
- const acceptReport = useDismissedReportsStore((s) => s.acceptReport);
-
- const analytics = useAnalytics();
-
- const trackReportAction = useCallback(
- (
- report: SignalReport,
- actionType: "dismiss" | "create_pr",
- position: number,
- total: number,
- ) => {
- analytics.track(ANALYTICS_EVENTS.INBOX_REPORT_ACTION, {
- report_id: report.id,
- report_title: report.title ?? null,
- report_age_hours: computeReportAgeHours(report.created_at),
- priority: report.priority ?? null,
- actionability: report.actionability ?? null,
- action_type: actionType,
- surface: "triage",
- is_bulk: false,
- bulk_size: 1,
- rank: position,
- list_size: total,
- });
- },
- [analytics],
- );
-
- // Local state
- const [expandedReport, setExpandedReport] = useState<SignalReport | null>(
- null,
- );
- const [creating, setCreating] = useState(false);
- const creatingRef = useRef(false);
- const reportTaskIdsRef = useRef(new Map<string, string>());
- const [error, setError] = useState<string | null>(null);
- const [toast, setToast] = useState<{
- taskId: string | null;
- title: string;
- pending: boolean;
- } | null>(null);
- const toastTimer = useRef<ReturnType<typeof setTimeout> | null>(null);
-
- const showToastPending = useCallback((title: string) => {
- if (toastTimer.current) clearTimeout(toastTimer.current);
- setToast({ taskId: null, title, pending: true });
- }, []);
-
- const showToastDone = useCallback((taskId: string, title: string) => {
- if (toastTimer.current) clearTimeout(toastTimer.current);
- setToast({ taskId, title, pending: false });
- toastTimer.current = setTimeout(() => setToast(null), 10_000);
- }, []);
-
- const reportsRef = useRef(reports);
- reportsRef.current = reports;
-
- const handleDismiss = useCallback(
- (reportId: string) => {
- Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
- const visible = reportsRef.current;
- const idx = visible.findIndex((r) => r.id === reportId);
- const target = idx >= 0 ? visible[idx] : null;
- if (target) trackReportAction(target, "dismiss", idx, visible.length);
- dismissReport(reportId);
- // Don't advanceCard() — the parent filters dismissed IDs from the
- // reports array, so removing the report shifts the next one into
- // the current index position automatically.
- },
- [dismissReport, trackReportAction],
- );
-
- const handleAccept = useCallback(
- async (report: SignalReport) => {
- if (creatingRef.current || !isConfigReady) return false;
- creatingRef.current = true;
- setCreating(true);
- setError(null);
- showToastPending(report.title ?? "Untitled report");
- // Snapshot rank/list_size before the swipe completes — accepting filters
- // the report out of the visible deck.
- const visibleBefore = reportsRef.current;
- const acceptedRank = visibleBefore.findIndex((r) => r.id === report.id);
- const acceptedListSize = visibleBefore.length;
- try {
- Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium);
-
- const prompt = buildCreatePrReportPrompt({ reportId: report.id });
- const client = getPostHogApiClient();
- let taskId = reportTaskIdsRef.current.get(report.id);
- if (!taskId) {
- const task = await client.createSignalReportTask({
- description: prompt,
- title: prompt.slice(0, 255),
- reportId: report.id,
- relationship: "implementation",
- });
- taskId = task.id;
- reportTaskIdsRef.current.set(report.id, taskId);
- }
-
- await client.runTaskInCloud(taskId, undefined, {
- pendingUserMessage: prompt,
- adapter: "claude",
- model,
- initialPermissionMode: "plan",
- runSource: "signal_report",
- signalReportId: report.id,
- rtkEnabled: usePreferencesStore.getState().rtkEnabledCloud,
- });
-
- acceptReport(report.id);
- trackReportAction(report, "create_pr", acceptedRank, acceptedListSize);
- showToastDone(taskId, report.title ?? "Untitled report");
- return true;
- } catch (e) {
- const message =
- e instanceof Error ? e.message : "Failed to create task";
- log.error("Accept failed", message);
- setError(message);
- setToast(null);
- return false;
- } finally {
- creatingRef.current = false;
- setCreating(false);
- }
- },
- [
- model,
- isConfigReady,
- showToastPending,
- showToastDone,
- acceptReport,
- trackReportAction,
- ],
- );
-
- const currentReport =
- currentIndex < reports.length ? reports[currentIndex] : null;
-
- // ── Repo resolution ────────────────────────────────────────────────────────
- const [repoMap, setRepoMap] = useState<Record<string, string | null>>({});
- const fetchingRef = useRef<Set<string>>(new Set());
-
- // Lazily resolve repos for the next few visible cards
- useEffect(() => {
- const upcoming = reports.slice(currentIndex, currentIndex + 3);
- for (const r of upcoming) {
- if (r.id in repoMap || fetchingRef.current.has(r.id)) continue;
- fetchingRef.current.add(r.id);
- getReportRepository(r.id)
- .then((repo) => setRepoMap((prev) => ({ ...prev, [r.id]: repo })))
- .catch(() => setRepoMap((prev) => ({ ...prev, [r.id]: null })))
- .finally(() => fetchingRef.current.delete(r.id));
- }
- }, [reports, currentIndex, repoMap]);
-
- const STACK_OFFSET = 12; // px between each stacked card
- const MAX_VISIBLE = 3;
-
- return (
- <View className="flex-1">
- {isLoading ? (
- <View className="flex-1 items-center justify-center">
- <ActivityIndicator size="large" color={themeColors.accent[9]} />
- <Text className="mt-3 text-[13px] text-gray-9">
- Loading reports...
- </Text>
- </View>
- ) : !currentReport ? (
- <View className="flex-1 items-center justify-center">
- <EmptyState />
- </View>
- ) : (
- <View className="flex-1 px-4 pt-2 pb-4">
- <View className="relative flex-[0.9]">
- {reports
- .slice(currentIndex, currentIndex + MAX_VISIBLE)
- .reverse()
- .map((report, i, arr) => {
- const depth = arr.length - 1 - i;
- return (
- <SwipeableReportCard
- key={report.id}
- report={report}
- onDismiss={handleDismiss}
- onAccept={handleAccept}
- onExpand={setExpandedReport}
- isTopCard={depth === 0}
- stackOffset={depth * STACK_OFFSET}
- repo={repoMap[report.id]}
- />
- );
- })}
- </View>
- </View>
- )}
-
- {/* Error display */}
- {error && (
- <View className="mx-4 mb-4 rounded-lg bg-status-error/10 px-3 py-2">
- <Text className="text-[13px] text-status-error">{error}</Text>
- </View>
- )}
-
- {/* "Task started" toast — sits above the mode switcher pill */}
- {toast && (
- <Pressable
- onPress={() => {
- if (toast.pending || !toast.taskId) return;
- setToast(null);
- router.push(`/task/${toast.taskId}`);
- }}
- disabled={toast.pending}
- className="elevation-4 absolute inset-x-4 flex-row items-center justify-between rounded-2xl bg-status-success px-5 py-4 shadow-lg active:opacity-80"
- style={{ bottom: insets.bottom + 76 }}
- >
- <View className="min-w-0 flex-1">
- <Text className="font-semibold text-[15px] text-white">
- {toast.pending ? "Starting task\u2026" : "Task started"}
- </Text>
- <Text
- className="mt-0.5 text-[13px] text-white/80"
- numberOfLines={1}
- >
- {toast.title}
- </Text>
- </View>
- {toast.pending ? (
- <ActivityIndicator className="ml-3" color="white" size="small" />
- ) : (
- <Text className="ml-3 font-semibold text-[14px] text-white">
- View →
- </Text>
- )}
- </Pressable>
- )}
-
- {/* Expanded report modal */}
- <Modal
- visible={!!expandedReport}
- animationType="slide"
- presentationStyle="pageSheet"
- onRequestClose={() => setExpandedReport(null)}
- >
- {expandedReport && (
- <View className="flex-1 bg-background">
- <SafeAreaView edges={["top"]} className="flex-1">
- {/* Header with close button */}
- <View className="flex-row items-center justify-between border-gray-6 border-b px-4 py-3">
- <Text
- className="flex-1 font-semibold text-[17px] text-gray-12"
- numberOfLines={1}
- >
- {humanizeReportTitle(expandedReport.title, "Untitled report")}
- </Text>
- <Pressable
- onPress={() => setExpandedReport(null)}
- hitSlop={10}
- className="pl-3 active:opacity-70"
- >
- <X size={20} color={themeColors.gray[11]} />
- </Pressable>
- </View>
-
- {/* Scrollable content */}
- <ScrollView
- className="flex-1"
- contentContainerStyle={{ padding: 16, paddingBottom: 100 }}
- >
- {/* Badges */}
- <View className="mb-3 flex-row flex-wrap items-center gap-1.5">
- <StatusBadge status={expandedReport.status} />
- {expandedReport.priority && (
- <PriorityBadge priority={expandedReport.priority} />
- )}
- {(() => {
- const conv = parseConventionalCommitTitle(
- expandedReport.title,
- );
- return conv ? (
- <ConventionalCommitTag
- type={conv.type}
- scope={conv.scope}
- />
- ) : null;
- })()}
- </View>
-
- {/* Summary */}
- {expandedReport.summary && (
- <MarkdownText
- content={formatSignalReportSummaryMarkdown(
- expandedReport.summary,
- )}
- />
- )}
-
- {/* Signal count + time */}
- <View className="mt-4 flex-row items-center gap-3">
- <View className="flex-row items-center gap-1">
- <Lightning
- size={13}
- color={themeColors.gray[9]}
- weight="fill"
- />
- <Text className="text-[12px] text-gray-9">
- {expandedReport.signal_count} signal
- {expandedReport.signal_count !== 1 ? "s" : ""}
- </Text>
- </View>
- <Text className="text-[12px] text-gray-9">
- Updated{" "}
- {formatDistanceToNow(new Date(expandedReport.updated_at), {
- addSuffix: true,
- })}
- </Text>
- </View>
-
- {/* Repo pill */}
- {repoMap[expandedReport.id] && (
- <View className="mt-4 flex-row">
- <View className="flex-row items-center gap-1.5 rounded-full border border-gray-6 bg-gray-2 px-2.5 py-1">
- <GithubLogo
- size={12}
- color={themeColors.gray[9]}
- weight="fill"
- />
- <Text className="text-[11px] text-gray-9">
- {repoMap[expandedReport.id]}
- </Text>
- </View>
- </View>
- )}
- </ScrollView>
-
- {/* Bottom action buttons */}
- <View className="absolute inset-x-0 bottom-0 flex-row items-center justify-center gap-8 border-gray-6 border-t bg-background pt-4 pb-8">
- <Pressable
- onPress={() => {
- handleDismiss(expandedReport.id);
- setExpandedReport(null);
- }}
- className="h-16 w-16 items-center justify-center rounded-full border-2 border-status-error bg-status-error/10 active:bg-status-error/20"
- hitSlop={8}
- >
- <X size={28} color={themeColors.status.error} weight="bold" />
- </Pressable>
- <Pressable
- onPress={() => {
- handleAccept(expandedReport);
- setExpandedReport(null);
- }}
- className="h-16 w-16 items-center justify-center rounded-full border-2 border-status-success bg-status-success/10 active:bg-status-success/20"
- disabled={creating || !isConfigReady}
- hitSlop={8}
- >
- {creating ? (
- <ActivityIndicator color={themeColors.status.success} />
- ) : (
- <Check
- size={28}
- color={themeColors.status.success}
- weight="bold"
- />
- )}
- </Pressable>
- </View>
- </SafeAreaView>
- </View>
- )}
- </Modal>
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/inbox/components/WatchRecordingSheet.tsx b/products/desktop/apps/mobile/src/features/inbox/components/WatchRecordingSheet.tsx
deleted file mode 100644
index 71c1343c9c13..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/components/WatchRecordingSheet.tsx
+++ /dev/null
@@ -1,161 +0,0 @@
-import { Text } from "@components/text";
-import type { RecordingExport } from "@posthog/api-client/posthog-client";
-import { useVideoPlayer, VideoView } from "expo-video";
-import { ArrowSquareOut, X } from "phosphor-react-native";
-import { useMemo } from "react";
-import {
- ActivityIndicator,
- Modal,
- Pressable,
- useWindowDimensions,
- View,
-} from "react-native";
-import { openExternalUrl } from "@/lib/openExternalUrl";
-import { clipTimeForMoment } from "../recordingClipTime";
-import { colonOffsetFromSeconds } from "../recordingOffset";
-
-interface WatchRecordingSheetProps {
- visible: boolean;
- clip: RecordingExport | null;
- contentUrl: string | null;
- contentPending: boolean;
- contentUnavailable: boolean;
- seekSeconds?: number | null;
- playerUrl?: string | null;
- onClose: () => void;
-}
-
-export function WatchRecordingSheet({
- visible,
- clip,
- contentUrl,
- contentPending,
- contentUnavailable,
- seekSeconds,
- playerUrl,
- onClose,
-}: WatchRecordingSheetProps) {
- const { width, height } = useWindowDimensions();
-
- const targetClipTime = useMemo(() => {
- if (clip == null || seekSeconds == null) return null;
- return clipTimeForMoment(clip, seekSeconds);
- }, [clip, seekSeconds]);
- const momentReachable = seekSeconds == null ? null : targetClipTime != null;
- const momentLabel =
- seekSeconds != null ? colonOffsetFromSeconds(seekSeconds) : null;
-
- const player = useVideoPlayer(contentUrl, (p) => {
- p.muted = true;
- if (targetClipTime != null) p.currentTime = targetClipTime;
- p.play();
- });
-
- const seekToMoment = () => {
- if (targetClipTime == null) return;
- const duration = player.duration;
- player.currentTime =
- duration > 0 ? Math.min(targetClipTime, duration) : targetClipTime;
- player.play();
- };
-
- const videoWidth = Math.min(width - 32, 720);
- const videoHeight = Math.min(videoWidth * (9 / 16), height * 0.6);
-
- return (
- <Modal
- visible={visible}
- transparent
- animationType="fade"
- onRequestClose={onClose}
- statusBarTranslucent
- >
- <Pressable
- className="flex-1 items-center justify-center bg-black/80 px-4"
- onPress={onClose}
- >
- <Pressable onPress={() => {}} className="w-full max-w-[720px] gap-3">
- <View className="flex-row items-center justify-between">
- <View className="flex-1 pr-3">
- <Text className="font-semibold text-[16px] text-white">
- Session recording
- </Text>
- <Text
- className="mt-0.5 text-[12px] text-white/70"
- numberOfLines={2}
- >
- {describeClipStatus(momentLabel, momentReachable)}
- </Text>
- </View>
- <Pressable
- onPress={onClose}
- hitSlop={12}
- className="rounded-full bg-white/10 p-2 active:opacity-70"
- accessibilityLabel="Close"
- >
- <X size={16} color="#ffffff" weight="bold" />
- </Pressable>
- </View>
-
- <View
- className="items-center justify-center overflow-hidden rounded-xl bg-black"
- style={{ width: videoWidth, height: videoHeight }}
- >
- {contentUnavailable ? (
- <Text className="px-6 text-center text-[13px] text-white/70">
- This clip is no longer available.
- </Text>
- ) : contentPending || contentUrl == null ? (
- <ActivityIndicator color="#ffffff" />
- ) : (
- <VideoView
- player={player}
- style={{ width: videoWidth, height: videoHeight }}
- nativeControls
- contentFit="contain"
- />
- )}
- </View>
-
- <View className="flex-row items-center justify-between">
- {momentLabel && momentReachable === true ? (
- <Pressable
- onPress={seekToMoment}
- hitSlop={6}
- className="rounded-full bg-white/10 px-3 py-2 active:opacity-70"
- >
- <Text className="text-[12px] text-white">
- Back to {momentLabel}
- </Text>
- </Pressable>
- ) : (
- <View />
- )}
- {playerUrl && (
- <Pressable
- onPress={() => openExternalUrl(playerUrl)}
- hitSlop={6}
- className="flex-row items-center gap-1 active:opacity-70"
- >
- <Text className="text-[12px] text-white/80">
- Open in PostHog
- </Text>
- <ArrowSquareOut size={12} color="#ffffff" />
- </Pressable>
- )}
- </View>
- </Pressable>
- </Pressable>
- </Modal>
- );
-}
-
-function describeClipStatus(
- momentLabel: string | null,
- momentReachable: boolean | null,
-): string {
- if (momentLabel == null) return "The rendered clip from this session.";
- if (momentReachable === false)
- return `The clip stops before ${momentLabel}. Open the session in PostHog to reach that moment.`;
- return `The rendered clip, at ${momentLabel} in the session.`;
-}
diff --git a/products/desktop/apps/mobile/src/features/inbox/conversationsTicket.test.ts b/products/desktop/apps/mobile/src/features/inbox/conversationsTicket.test.ts
deleted file mode 100644
index e4f30f181524..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/conversationsTicket.test.ts
+++ /dev/null
@@ -1,92 +0,0 @@
-import type { Signal } from "@posthog/shared/domain-types";
-import { describe, expect, it } from "vitest";
-import {
- conversationsTicketRef,
- supportTicketUrl,
-} from "./conversationsTicket";
-
-function makeSignal(overrides: Partial<Signal> = {}): Signal {
- return {
- signal_id: "s1",
- content: "",
- source_product: "conversations",
- source_type: "ticket",
- source_id: "0197-ticket-uuid",
- weight: 1,
- timestamp: "",
- extra: {},
- ...overrides,
- };
-}
-
-describe("conversationsTicketRef", () => {
- it.each([
- [
- "the ticket number when the emitter stored one",
- { ticket_number: 4821 },
- 4821,
- ],
- [
- "the ticket uuid for evidence stored without a number",
- {},
- "0197-ticket-uuid",
- ],
- ])("resolves to %s", (_label, extra, expected) => {
- expect(conversationsTicketRef(makeSignal(), extra)).toBe(expected);
- });
-
- it.each([
- ["a non-positive integer", 0],
- ["a non-integer", 12.5],
- ])(
- "falls back to source_id when ticket_number is %s",
- (_label, ticket_number) => {
- expect(conversationsTicketRef(makeSignal(), { ticket_number })).toBe(
- "0197-ticket-uuid",
- );
- },
- );
-
- it("returns null when neither identifier resolves", () => {
- expect(
- conversationsTicketRef(makeSignal({ source_id: "" }), {}),
- ).toBeNull();
- });
-});
-
-describe("supportTicketUrl", () => {
- it.each([
- [
- "a ticket number",
- 4821,
- "https://us.posthog.com/project/123/support/tickets/4821",
- ],
- [
- "a ticket uuid",
- "0197-uuid",
- "https://us.posthog.com/project/123/support/tickets/0197-uuid",
- ],
- [
- "an unsafe ticket ref",
- "a/b?c",
- "https://us.posthog.com/project/123/support/tickets/a%2Fb%3Fc",
- ],
- ])(
- "links the source project's ticket page by %s",
- (_label, ref, expected) => {
- expect(supportTicketUrl(ref, { projectId: 123, cloudRegion: "us" })).toBe(
- expected,
- );
- },
- );
-
- it.each([
- ["project", { projectId: null, cloudRegion: "us" as const }],
- ["region", { projectId: 123, cloudRegion: null }],
- ])(
- "has no destination without a %s to resolve against",
- (_label, options) => {
- expect(supportTicketUrl(4821, options)).toBeNull();
- },
- );
-});
diff --git a/products/desktop/apps/mobile/src/features/inbox/conversationsTicket.ts b/products/desktop/apps/mobile/src/features/inbox/conversationsTicket.ts
deleted file mode 100644
index cd0b214b14f6..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/conversationsTicket.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-import type { Signal } from "@posthog/shared/domain-types";
-import { getCloudUrlFromRegion } from "@/features/auth/lib/constants";
-import type { CloudRegion } from "@/features/auth/types";
-
-export interface ConversationsTicketExtra {
- ticket_number?: number;
- status?: string;
- priority?: string;
- email_subject?: string;
-}
-
-export function conversationsTicketRef(
- signal: Signal,
- extra: ConversationsTicketExtra,
-): string | number | null {
- if (
- typeof extra.ticket_number === "number" &&
- Number.isInteger(extra.ticket_number) &&
- extra.ticket_number > 0
- ) {
- return extra.ticket_number;
- }
- return signal.source_id || null;
-}
-
-export function supportTicketUrl(
- ticketRef: string | number,
- options: {
- projectId: number | null;
- cloudRegion: CloudRegion | null;
- },
-): string | null {
- const { projectId, cloudRegion } = options;
- if (projectId === null || cloudRegion === null) return null;
- return `${getCloudUrlFromRegion(cloudRegion)}/project/${projectId}/support/tickets/${encodeURIComponent(String(ticketRef))}`;
-}
diff --git a/products/desktop/apps/mobile/src/features/inbox/hooks/useInboxEngagementTracker.test.ts b/products/desktop/apps/mobile/src/features/inbox/hooks/useInboxEngagementTracker.test.ts
deleted file mode 100644
index 16cd3b1f64f2..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/hooks/useInboxEngagementTracker.test.ts
+++ /dev/null
@@ -1,273 +0,0 @@
-import { createElement } from "react";
-import { act, create, type ReactTestRenderer } from "react-test-renderer";
-import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
-
-// posthog-react-native pulls in real react-native at import time, which vitest
-// can't parse. The hook only uses `Analytics.track`, which is passed in by the
-// caller — so mocking the module to a no-op keeps the import graph quiet.
-vi.mock("posthog-react-native", () => ({
- usePostHog: () => null,
-}));
-
-import type { SignalReport } from "@posthog/shared/domain-types";
-import { ANALYTICS_EVENTS, type Analytics } from "@/lib/analytics";
-import {
- type InboxEngagementTracker,
- type UseInboxEngagementTrackerOptions,
- useInboxEngagementTracker,
-} from "./useInboxEngagementTracker";
-
-function makeReport(overrides: Partial<SignalReport> = {}): SignalReport {
- return {
- id: "r1",
- title: "Report 1",
- summary: null,
- status: "ready",
- total_weight: 0,
- signal_count: 0,
- created_at: "2026-01-01T12:00:00Z",
- updated_at: "2026-01-01T12:00:00Z",
- artefact_count: 0,
- priority: "P1",
- actionability: "immediately_actionable",
- source_products: ["error_tracking"],
- ...overrides,
- };
-}
-
-function renderTracker(initial: UseInboxEngagementTrackerOptions) {
- const trackerRef: { current: InboxEngagementTracker | null } = {
- current: null,
- };
- let currentOptions = initial;
- function Wrapper() {
- trackerRef.current = useInboxEngagementTracker(currentOptions);
- return null;
- }
- let renderer: ReactTestRenderer | null = null;
- act(() => {
- renderer = create(createElement(Wrapper));
- });
- return {
- tracker: () => {
- if (!trackerRef.current) throw new Error("tracker not initialised");
- return trackerRef.current;
- },
- rerender: (next: UseInboxEngagementTrackerOptions) => {
- currentOptions = next;
- act(() => {
- renderer?.update(createElement(Wrapper));
- });
- },
- unmount: () => {
- act(() => {
- renderer?.unmount();
- });
- },
- };
-}
-
-describe("useInboxEngagementTracker", () => {
- beforeEach(() => {
- vi.useFakeTimers();
- vi.setSystemTime(new Date("2026-01-01T13:00:00Z"));
- });
- afterEach(() => {
- vi.useRealTimers();
- });
-
- it("fires OPENED on mount with the right snapshot of report fields", () => {
- const track = vi.fn();
- const analytics: Analytics = { track };
- const report = makeReport();
- renderTracker({
- analytics,
- report,
- rank: 2,
- listSize: 5,
- openMethod: "click",
- previousReportId: "prev-1",
- });
- expect(track).toHaveBeenCalledWith(
- ANALYTICS_EVENTS.INBOX_REPORT_OPENED,
- expect.objectContaining({
- report_id: "r1",
- report_title: "Report 1",
- report_age_hours: 1,
- status: "ready",
- priority: "P1",
- actionability: "immediately_actionable",
- source_products: ["error_tracking"],
- rank: 2,
- list_size: 5,
- open_method: "click",
- previous_report_id: "prev-1",
- }),
- );
- });
-
- it("fires CLOSED on unmount with time_spent, scrolled, close_method", () => {
- const track = vi.fn();
- const report = makeReport();
- const hook = renderTracker({
- analytics: { track },
- report,
- rank: 0,
- listSize: 1,
- openMethod: "click",
- previousReportId: null,
- });
- act(() => {
- hook.tracker().signalScroll();
- });
- vi.advanceTimersByTime(2500);
- hook.unmount();
- const closeCall = track.mock.calls.find(
- ([name]) => name === ANALYTICS_EVENTS.INBOX_REPORT_CLOSED,
- );
- expect(closeCall).toBeDefined();
- expect(closeCall?.[1]).toMatchObject({
- report_id: "r1",
- scrolled: true,
- close_method: "deselected",
- priority: "P1",
- actionability: "immediately_actionable",
- });
- expect((closeCall?.[1] as { time_spent_ms: number }).time_spent_ms).toBe(
- 2500,
- );
- });
-
- it("fires SCROLLED at most once per open", () => {
- const track = vi.fn();
- const hook = renderTracker({
- analytics: { track },
- report: makeReport(),
- rank: 0,
- listSize: 1,
- openMethod: "click",
- previousReportId: null,
- });
- act(() => {
- hook.tracker().signalScroll();
- hook.tracker().signalScroll();
- hook.tracker().signalScroll();
- });
- const scrollCalls = track.mock.calls.filter(
- ([name]) => name === ANALYTICS_EVENTS.INBOX_REPORT_SCROLLED,
- );
- expect(scrollCalls).toHaveLength(1);
- });
-
- it("signalAction inherits rank/list_size/priority/actionability from the current open", () => {
- const track = vi.fn();
- const report = makeReport({ priority: "P0" });
- const hook = renderTracker({
- analytics: { track },
- report,
- rank: 3,
- listSize: 7,
- openMethod: "click",
- previousReportId: null,
- });
- act(() => {
- hook.tracker().signalAction({
- report_id: "r1",
- report_title: "Report 1",
- report_age_hours: 1,
- action_type: "create_pr",
- surface: "detail_pane",
- is_bulk: false,
- bulk_size: 1,
- });
- });
- const actionCall = track.mock.calls.find(
- ([name]) => name === ANALYTICS_EVENTS.INBOX_REPORT_ACTION,
- );
- expect(actionCall?.[1]).toMatchObject({
- rank: 3,
- list_size: 7,
- priority: "P0",
- actionability: "immediately_actionable",
- });
- });
-
- it("does not re-fire OPENED/CLOSED when rank/listSize/report change while the same report stays open", () => {
- // Regression for a background-refetch spike: rank, listSize, and the
- // report shape are inputs to OPENED but only `reportId` should gate the
- // open/close lifecycle.
- const track = vi.fn();
- const report = makeReport();
- const hook = renderTracker({
- analytics: { track },
- report,
- rank: 2,
- listSize: 5,
- openMethod: "click",
- previousReportId: null,
- });
- const openedBefore = track.mock.calls.filter(
- ([name]) => name === ANALYTICS_EVENTS.INBOX_REPORT_OPENED,
- ).length;
- const closedBefore = track.mock.calls.filter(
- ([name]) => name === ANALYTICS_EVENTS.INBOX_REPORT_CLOSED,
- ).length;
- hook.rerender({
- analytics: { track },
- report: makeReport({ priority: "P2", actionability: "not_actionable" }),
- rank: 4,
- listSize: 6,
- openMethod: "click",
- previousReportId: null,
- });
- const openedAfter = track.mock.calls.filter(
- ([name]) => name === ANALYTICS_EVENTS.INBOX_REPORT_OPENED,
- ).length;
- const closedAfter = track.mock.calls.filter(
- ([name]) => name === ANALYTICS_EVENTS.INBOX_REPORT_CLOSED,
- ).length;
- expect(openedAfter).toBe(openedBefore);
- expect(closedAfter).toBe(closedBefore);
- });
-
- it("signalAction lets explicit overrides win for a different report", () => {
- const track = vi.fn();
- const hook = renderTracker({
- analytics: { track },
- report: makeReport(),
- rank: 0,
- listSize: 1,
- openMethod: "click",
- previousReportId: null,
- });
- act(() => {
- hook.tracker().signalAction({
- report_id: "other-report",
- report_title: "Other",
- report_age_hours: 0,
- action_type: "dismiss",
- surface: "toolbar",
- is_bulk: false,
- bulk_size: 1,
- rank: 9,
- list_size: 12,
- priority: "P4",
- actionability: "not_actionable",
- dismissal_reason: "other",
- dismissal_note: "junk",
- });
- });
- const actionCall = track.mock.calls.find(
- ([name]) => name === ANALYTICS_EVENTS.INBOX_REPORT_ACTION,
- );
- expect(actionCall?.[1]).toMatchObject({
- report_id: "other-report",
- rank: 9,
- list_size: 12,
- priority: "P4",
- actionability: "not_actionable",
- dismissal_reason: "other",
- dismissal_note: "junk",
- });
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/inbox/hooks/useInboxEngagementTracker.ts b/products/desktop/apps/mobile/src/features/inbox/hooks/useInboxEngagementTracker.ts
deleted file mode 100644
index 323f03a93877..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/hooks/useInboxEngagementTracker.ts
+++ /dev/null
@@ -1,183 +0,0 @@
-import type { SignalReport } from "@posthog/shared/domain-types";
-import { useCallback, useEffect, useRef } from "react";
-import {
- ANALYTICS_EVENTS,
- type Analytics,
- computeReportAgeHours,
- type InboxReportActionProperties,
- type InboxReportCloseMethod,
- type InboxReportOpenMethod,
-} from "@/lib/analytics";
-
-interface OpenInfo {
- reportId: string;
- reportTitle: string | null;
- reportCreatedAt: string | null;
- reportPriority: string | null;
- reportActionability: string | null;
- openedAt: number;
- rank: number;
- listSize: number;
- hasScrolled: boolean;
-}
-
-export interface InboxEngagementTracker {
- signalScroll(): void;
- signalAction(
- action: Omit<
- InboxReportActionProperties,
- "rank" | "list_size" | "priority" | "actionability"
- > & {
- rank?: number;
- list_size?: number;
- priority?: string | null;
- actionability?: string | null;
- },
- ): void;
-}
-
-export interface UseInboxEngagementTrackerOptions {
- analytics: Analytics;
- report: SignalReport | null;
- /** Rank of the report in the visible inbox list, or -1 if not in a list view. */
- rank: number;
- /** Size of the visible inbox list, or 0 if not in a list view. */
- listSize: number;
- /** Method that brought the user to this report. */
- openMethod: InboxReportOpenMethod;
- /** Previously-opened report id; null on the first open of a session. */
- previousReportId: string | null;
-}
-
-export function useInboxEngagementTracker(
- options: UseInboxEngagementTrackerOptions,
-): InboxEngagementTracker {
- const { analytics, report, rank, listSize, openMethod, previousReportId } =
- options;
-
- const openInfoRef = useRef<OpenInfo | null>(null);
-
- const analyticsRef = useRef(analytics);
- analyticsRef.current = analytics;
-
- // Snapshot the inputs through refs so the OPENED/CLOSED lifecycle effect
- // can read them without being a dep — a background list refetch (rank /
- // listSize / report shape changing while the user is reading) would
- // otherwise fire spurious CLOSED+OPENED pairs.
- const reportRef = useRef(report);
- reportRef.current = report;
- const rankRef = useRef(rank);
- rankRef.current = rank;
- const listSizeRef = useRef(listSize);
- listSizeRef.current = listSize;
- const openMethodRef = useRef(openMethod);
- openMethodRef.current = openMethod;
- const previousReportIdRef = useRef(previousReportId);
- previousReportIdRef.current = previousReportId;
-
- const fireClose = useCallback((closeMethod: InboxReportCloseMethod) => {
- const info = openInfoRef.current;
- if (!info) return;
- analyticsRef.current.track(ANALYTICS_EVENTS.INBOX_REPORT_CLOSED, {
- report_id: info.reportId,
- report_title: info.reportTitle,
- report_age_hours: computeReportAgeHours(info.reportCreatedAt),
- priority: info.reportPriority,
- actionability: info.reportActionability,
- time_spent_ms: Date.now() - info.openedAt,
- scrolled: info.hasScrolled,
- close_method: closeMethod,
- });
- openInfoRef.current = null;
- }, []);
-
- const reportId = report?.id ?? null;
-
- useEffect(() => {
- if (!reportId) return;
- const snapshotReport = reportRef.current;
- if (!snapshotReport) return;
-
- const info: OpenInfo = {
- reportId,
- reportTitle: snapshotReport.title ?? null,
- reportCreatedAt: snapshotReport.created_at ?? null,
- reportPriority: snapshotReport.priority ?? null,
- reportActionability: snapshotReport.actionability ?? null,
- openedAt: Date.now(),
- rank: rankRef.current,
- listSize: listSizeRef.current,
- hasScrolled: false,
- };
- openInfoRef.current = info;
-
- analyticsRef.current.track(ANALYTICS_EVENTS.INBOX_REPORT_OPENED, {
- report_id: info.reportId,
- report_title: info.reportTitle,
- report_age_hours: computeReportAgeHours(info.reportCreatedAt),
- status: snapshotReport.status ?? null,
- priority: info.reportPriority,
- actionability: info.reportActionability,
- source_products: snapshotReport.source_products ?? [],
- rank: info.rank,
- list_size: info.listSize,
- open_method: openMethodRef.current,
- previous_report_id: previousReportIdRef.current,
- });
-
- return () => {
- fireClose("deselected");
- };
- }, [reportId, fireClose]);
-
- const signalScroll = useCallback(() => {
- const info = openInfoRef.current;
- if (!info || info.hasScrolled) return;
- info.hasScrolled = true;
- analyticsRef.current.track(ANALYTICS_EVENTS.INBOX_REPORT_SCROLLED, {
- report_id: info.reportId,
- report_title: info.reportTitle,
- report_age_hours: computeReportAgeHours(info.reportCreatedAt),
- priority: info.reportPriority,
- actionability: info.reportActionability,
- rank: info.rank,
- list_size: info.listSize,
- time_since_open_ms: Date.now() - info.openedAt,
- });
- }, []);
-
- const signalAction = useCallback<InboxEngagementTracker["signalAction"]>(
- (action) => {
- const info = openInfoRef.current;
- const currentInfo =
- info && info.reportId === action.report_id ? info : null;
- const {
- rank: rankOverride,
- list_size: listSizeOverride,
- priority: priorityOverride,
- actionability: actionabilityOverride,
- ...rest
- } = action;
- analyticsRef.current.track(ANALYTICS_EVENTS.INBOX_REPORT_ACTION, {
- ...rest,
- rank:
- rankOverride !== undefined ? rankOverride : (currentInfo?.rank ?? -1),
- list_size:
- listSizeOverride !== undefined
- ? listSizeOverride
- : (currentInfo?.listSize ?? 0),
- priority:
- priorityOverride !== undefined
- ? priorityOverride
- : (currentInfo?.reportPriority ?? null),
- actionability:
- actionabilityOverride !== undefined
- ? actionabilityOverride
- : (currentInfo?.reportActionability ?? null),
- });
- },
- [],
- );
-
- return { signalScroll, signalAction };
-}
diff --git a/products/desktop/apps/mobile/src/features/inbox/hooks/useInboxReports.test.ts b/products/desktop/apps/mobile/src/features/inbox/hooks/useInboxReports.test.ts
deleted file mode 100644
index 542886a407fa..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/hooks/useInboxReports.test.ts
+++ /dev/null
@@ -1,98 +0,0 @@
-import type {
- SignalReport,
- SignalReportsResponse,
-} from "@posthog/shared/domain-types";
-import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
-import { createElement } from "react";
-import { act, create } from "react-test-renderer";
-import { afterEach, describe, expect, it, vi } from "vitest";
-
-vi.mock("@/features/auth", () => ({
- useAuthStore: () => ({ projectId: 1, oauthAccessToken: "token" }),
-}));
-
-const getAvailableSuggestedReviewers = vi.fn(async (_query?: string) => ({
- results: [],
- count: 0,
-}));
-vi.mock("@/lib/posthogApiClient", () => ({
- getPostHogApiClient: () => ({
- getAvailableSuggestedReviewers: (query?: string) =>
- getAvailableSuggestedReviewers(query),
- }),
-}));
-
-import {
- getReportsNextPageParam,
- useAvailableSuggestedReviewers,
-} from "./useInboxReports";
-
-function page(count: number, resultCount: number): SignalReportsResponse {
- return {
- count,
- results: Array.from({ length: resultCount }, () => ({}) as SignalReport),
- };
-}
-
-describe("getReportsNextPageParam", () => {
- it.each([
- {
- name: "offset after the first page when more remain",
- pages: [page(250, 100)],
- expected: 100,
- },
- {
- name: "offset after later pages when more remain",
- pages: [page(250, 100), page(250, 100)],
- expected: 200,
- },
- {
- name: "undefined once every report is loaded",
- pages: [page(150, 100), page(150, 50)],
- expected: undefined,
- },
- {
- name: "undefined when the first page already holds everything",
- pages: [page(40, 40)],
- expected: undefined,
- },
- ])("returns the $name", ({ pages, expected }) => {
- const lastPage = pages[pages.length - 1];
- expect(getReportsNextPageParam(lastPage, pages)).toBe(expected);
- });
-});
-
-async function renderHook(query?: string) {
- const client = new QueryClient({
- defaultOptions: { queries: { retry: false } },
- });
- function Wrapper() {
- useAvailableSuggestedReviewers({ query });
- return null;
- }
- await act(async () => {
- create(
- createElement(QueryClientProvider, { client }, createElement(Wrapper)),
- );
- await Promise.resolve();
- });
-}
-
-describe("useAvailableSuggestedReviewers", () => {
- afterEach(() => {
- vi.clearAllMocks();
- });
-
- it.each([
- { name: "forwards a trimmed query", query: " alice ", expected: "alice" },
- {
- name: "omits a whitespace-only query",
- query: " ",
- expected: undefined,
- },
- { name: "omits an undefined query", query: undefined, expected: undefined },
- ])("$name to the server", async ({ query, expected }) => {
- await renderHook(query);
- expect(getAvailableSuggestedReviewers).toHaveBeenCalledWith(expected);
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/inbox/hooks/useInboxReports.ts b/products/desktop/apps/mobile/src/features/inbox/hooks/useInboxReports.ts
deleted file mode 100644
index 91085e37ef94..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/hooks/useInboxReports.ts
+++ /dev/null
@@ -1,358 +0,0 @@
-import type { SuggestedReviewerEdit } from "@posthog/api-client/posthog-client";
-import {
- buildArchiveListOrdering,
- buildPriorityFilterParam,
- buildSignalReportListOrdering,
- buildStatusFilterParam,
- buildSuggestedReviewerFilterParam,
- INBOX_ACTIONABLE_ACTIONABILITY_FILTER,
- INBOX_DISMISSED_STATUS_FILTER,
- INBOX_REFETCH_INTERVAL_MS,
-} from "@posthog/core/inbox/reportFiltering";
-import { isRestorableReport } from "@posthog/core/inbox/reportMembership";
-import type { DismissalReasonOptionValue } from "@posthog/shared";
-import type {
- AvailableSuggestedReviewersResponse,
- CommitDiffResponse,
- SignalProcessingStateResponse,
- SignalReport,
- SignalReportArtefactsResponse,
- SignalReportRefundReason,
- SignalReportSignalsResponse,
- SignalReportsQueryParams,
- SignalReportsResponse,
- SuggestedReviewer,
- SuggestedReviewersArtefact,
- SuggestedReviewerWriteEntry,
-} from "@posthog/shared/domain-types";
-import {
- useInfiniteQuery,
- useMutation,
- useQuery,
- useQueryClient,
-} from "@tanstack/react-query";
-import { useMemo } from "react";
-import { useAuthStore } from "@/features/auth";
-import { getPostHogApiClient } from "@/lib/posthogApiClient";
-import { useInboxFilterStore } from "../stores/inboxFilterStore";
-
-export const inboxKeys = {
- all: ["inbox", "signal-reports"] as const,
- list: (params?: SignalReportsQueryParams) =>
- [...inboxKeys.all, "list", params ?? {}] as const,
- archived: (params?: SignalReportsQueryParams) =>
- [...inboxKeys.all, "archived", params ?? {}] as const,
- detail: (reportId: string) => [...inboxKeys.all, reportId, "detail"] as const,
- artefacts: (reportId: string) =>
- [...inboxKeys.all, reportId, "artefacts"] as const,
- signals: (reportId: string) =>
- [...inboxKeys.all, reportId, "signals"] as const,
- commitDiff: (reportId: string, artefactId: string) =>
- [...inboxKeys.all, reportId, "artefacts", artefactId, "diff"] as const,
- processingState: ["inbox", "signal-processing-state"] as const,
-};
-
-const REPORTS_PAGE_SIZE = 100;
-
-export function getReportsNextPageParam(
- lastPage: SignalReportsResponse,
- allPages: SignalReportsResponse[],
-): number | undefined {
- const loaded = allPages.reduce((n, page) => n + page.results.length, 0);
- return loaded < lastPage.count ? loaded : undefined;
-}
-
-export function useInboxReports(options?: { enabled?: boolean }) {
- const { projectId, oauthAccessToken } = useAuthStore();
- const sortField = useInboxFilterStore((s) => s.sortField);
- const sortDirection = useInboxFilterStore((s) => s.sortDirection);
- const statusFilter = useInboxFilterStore((s) => s.statusFilter);
- const sourceProductFilter = useInboxFilterStore((s) => s.sourceProductFilter);
- const suggestedReviewerFilter = useInboxFilterStore(
- (s) => s.suggestedReviewerFilter,
- );
- const priorityFilter = useInboxFilterStore((s) => s.priorityFilter);
-
- const params: SignalReportsQueryParams = {
- status: buildStatusFilterParam(statusFilter),
- ordering: buildSignalReportListOrdering(sortField, sortDirection),
- actionability: INBOX_ACTIONABLE_ACTIONABILITY_FILTER,
- source_product:
- sourceProductFilter.length > 0
- ? sourceProductFilter.join(",")
- : undefined,
- suggested_reviewers:
- suggestedReviewerFilter.length > 0
- ? buildSuggestedReviewerFilterParam(suggestedReviewerFilter)
- : undefined,
- priority: buildPriorityFilterParam(priorityFilter),
- };
-
- const query = useInfiniteQuery({
- queryKey: inboxKeys.list(params),
- queryFn: ({ pageParam }) =>
- getPostHogApiClient().getSignalReports({
- ...params,
- limit: REPORTS_PAGE_SIZE,
- offset: pageParam,
- }),
- enabled: !!projectId && !!oauthAccessToken && (options?.enabled ?? true),
- refetchInterval: INBOX_REFETCH_INTERVAL_MS,
- initialPageParam: 0,
- getNextPageParam: getReportsNextPageParam,
- });
-
- const reports = useMemo(
- () => query.data?.pages.flatMap((page) => page.results) ?? [],
- [query.data?.pages],
- );
-
- return {
- reports,
- totalCount: query.data?.pages[0]?.count ?? 0,
- isLoading: query.isLoading,
- isFetching: query.isFetching,
- error: query.error?.message ?? null,
- refetch: query.refetch,
- hasNextPage: query.hasNextPage,
- isFetchingNextPage: query.isFetchingNextPage,
- fetchNextPage: () => query.fetchNextPage({ cancelRefetch: false }),
- };
-}
-
-export function useArchivedReports(options?: { enabled?: boolean }) {
- const { projectId, oauthAccessToken } = useAuthStore();
-
- const params: SignalReportsQueryParams = {
- status: INBOX_DISMISSED_STATUS_FILTER,
- ordering: buildArchiveListOrdering("updated_at", "desc"),
- };
-
- const query = useQuery<SignalReportsResponse>({
- queryKey: inboxKeys.archived(params),
- queryFn: () => getPostHogApiClient().getSignalReports(params),
- enabled: !!projectId && !!oauthAccessToken && (options?.enabled ?? true),
- });
-
- return {
- reports: query.data?.results ?? [],
- totalCount: query.data?.count ?? 0,
- isLoading: query.isLoading,
- isFetching: query.isFetching,
- error: query.error?.message ?? null,
- refetch: query.refetch,
- };
-}
-
-export function useInboxReport(reportId: string | null) {
- const { projectId, oauthAccessToken } = useAuthStore();
-
- return useQuery<SignalReport | null>({
- queryKey: inboxKeys.detail(reportId ?? ""),
- queryFn: () => {
- if (!reportId) throw new Error("reportId is required");
- return getPostHogApiClient().getSignalReport(reportId);
- },
- enabled: !!projectId && !!oauthAccessToken && !!reportId,
- });
-}
-
-export function useSignalProcessingState(options?: { enabled?: boolean }) {
- const { projectId, oauthAccessToken } = useAuthStore();
-
- return useQuery<SignalProcessingStateResponse>({
- queryKey: inboxKeys.processingState,
- queryFn: () => getPostHogApiClient().getSignalProcessingState(),
- enabled: !!projectId && !!oauthAccessToken && (options?.enabled ?? true),
- refetchInterval: INBOX_REFETCH_INTERVAL_MS,
- });
-}
-
-export function useAvailableSuggestedReviewers(options?: {
- enabled?: boolean;
- query?: string;
-}) {
- const { projectId, oauthAccessToken } = useAuthStore();
- const query = options?.query?.trim() ?? "";
-
- return useQuery<AvailableSuggestedReviewersResponse>({
- queryKey: [...inboxKeys.all, "available-reviewers", query] as const,
- queryFn: () =>
- getPostHogApiClient().getAvailableSuggestedReviewers(query || undefined),
- enabled: !!projectId && !!oauthAccessToken && (options?.enabled ?? true),
- staleTime: 5 * 60 * 1000,
- // Only poll the unfiltered list; search terms are transient and each one
- // would otherwise spawn its own background poller.
- refetchInterval: query === "" ? 60_000 : false,
- });
-}
-
-export function useInboxReportArtefacts(
- reportId: string | null,
- options?: { staleTime?: number; refetchInterval?: number | false },
-) {
- const { projectId, oauthAccessToken } = useAuthStore();
-
- return useQuery<SignalReportArtefactsResponse>({
- queryKey: inboxKeys.artefacts(reportId ?? ""),
- queryFn: () => {
- if (!reportId) throw new Error("reportId is required");
- return getPostHogApiClient().getSignalReportArtefacts(reportId);
- },
- enabled: !!projectId && !!oauthAccessToken && !!reportId,
- // The log is a live work record — agents append artefacts while a report
- // is open, so refresh it gently rather than trusting the default staleTime.
- // List rows pass a calmer profile: reviewer suggestions rarely change mid-scroll.
- staleTime: options?.staleTime ?? 10_000,
- refetchInterval: options?.refetchInterval ?? 20_000,
- });
-}
-
-export function useCommitDiff(
- reportId: string,
- artefactId: string,
- enabled: boolean,
-) {
- const { projectId, oauthAccessToken } = useAuthStore();
-
- return useQuery<CommitDiffResponse>({
- queryKey: inboxKeys.commitDiff(reportId, artefactId),
- queryFn: () => getPostHogApiClient().getCommitDiff(reportId, artefactId),
- // A commit's diff is immutable, so only fetch once expanded and never retry.
- enabled: enabled && !!projectId && !!oauthAccessToken,
- staleTime: 5 * 60_000,
- retry: false,
- });
-}
-
-export function useInboxReportSignals(reportId: string | null) {
- const { projectId, oauthAccessToken } = useAuthStore();
-
- return useQuery<SignalReportSignalsResponse>({
- queryKey: inboxKeys.signals(reportId ?? ""),
- queryFn: () => {
- if (!reportId) throw new Error("reportId is required");
- return getPostHogApiClient().getSignalReportSignals(reportId);
- },
- enabled: !!projectId && !!oauthAccessToken && !!reportId,
- });
-}
-
-interface UpdateSuggestedReviewersVariables extends SuggestedReviewerEdit {
- artefactId: string;
- content: SuggestedReviewerWriteEntry[];
- optimisticReviewers: SuggestedReviewer[];
-}
-
-export function useUpdateSuggestedReviewers(reportId: string) {
- const queryClient = useQueryClient();
- const queryKey = inboxKeys.artefacts(reportId);
-
- return useMutation<
- void,
- Error,
- UpdateSuggestedReviewersVariables,
- { previous: SignalReportArtefactsResponse | undefined }
- >({
- mutationFn: ({ artefactId, content, action, targets }) =>
- getPostHogApiClient()
- .updateSignalReportArtefact(reportId, artefactId, content, {
- action,
- targets,
- })
- .then(() => undefined),
- onMutate: async ({ artefactId, optimisticReviewers }) => {
- await queryClient.cancelQueries({ queryKey });
- const previous =
- queryClient.getQueryData<SignalReportArtefactsResponse>(queryKey);
- if (previous) {
- queryClient.setQueryData<SignalReportArtefactsResponse>(queryKey, {
- ...previous,
- results: previous.results.map((artefact) => {
- if (
- artefact.id === artefactId &&
- artefact.type === "suggested_reviewers"
- ) {
- const updatedArtefact: SuggestedReviewersArtefact = {
- ...artefact,
- type: "suggested_reviewers",
- content: optimisticReviewers,
- };
- return updatedArtefact;
- }
- return artefact;
- }),
- });
- }
- return { previous };
- },
- onError: (_err, _vars, context) => {
- if (context?.previous) {
- queryClient.setQueryData(queryKey, context.previous);
- }
- },
- onSettled: () => {
- queryClient.invalidateQueries({ queryKey: inboxKeys.all });
- },
- });
-}
-
-export function useDismissReport(reportId: string) {
- const queryClient = useQueryClient();
-
- return useMutation<
- SignalReport,
- Error,
- { reason: DismissalReasonOptionValue; note?: string }
- >({
- mutationFn: (input) =>
- getPostHogApiClient().updateSignalReportState(reportId, {
- state: "suppressed",
- dismissal_reason: input.reason,
- ...(input.note?.trim() ? { dismissal_note: input.note.trim() } : {}),
- }),
- onSuccess: () => {
- queryClient.invalidateQueries({ queryKey: inboxKeys.detail(reportId) });
- queryClient.invalidateQueries({ queryKey: inboxKeys.all });
- },
- });
-}
-
-export function useRefundReport(reportId: string) {
- const queryClient = useQueryClient();
-
- return useMutation<
- SignalReport,
- Error,
- { reason: SignalReportRefundReason; note?: string }
- >({
- mutationFn: (input) =>
- getPostHogApiClient().refundSignalReport(reportId, input),
- onSuccess: () => {
- queryClient.invalidateQueries({ queryKey: inboxKeys.detail(reportId) });
- queryClient.invalidateQueries({ queryKey: inboxKeys.all });
- },
- });
-}
-
-export function useRestoreReport() {
- const queryClient = useQueryClient();
-
- // Resolves to whether the report was actually re-queued. Revalidate against
- // the server first so a stale row can't silently reopen an already-active
- // report.
- return useMutation<boolean, Error, string>({
- mutationFn: async (reportId) => {
- const client = getPostHogApiClient();
- const current = await client.getSignalReport(reportId);
- if (current && !isRestorableReport(current)) {
- return false;
- }
- await client.updateSignalReportState(reportId, { state: "potential" });
- return true;
- },
- onSuccess: () => {
- queryClient.invalidateQueries({ queryKey: inboxKeys.all });
- },
- });
-}
diff --git a/products/desktop/apps/mobile/src/features/inbox/hooks/useSignalSourceConfigs.ts b/products/desktop/apps/mobile/src/features/inbox/hooks/useSignalSourceConfigs.ts
deleted file mode 100644
index f67188852662..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/hooks/useSignalSourceConfigs.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import type { SignalSourceConfig } from "@posthog/api-client/posthog-client";
-import { useQuery } from "@tanstack/react-query";
-import { useAuthStore } from "@/features/auth";
-import { getPostHogApiClient } from "@/lib/posthogApiClient";
-
-export function useSignalSourceConfigs() {
- const { projectId, oauthAccessToken } = useAuthStore();
-
- return useQuery<SignalSourceConfig[]>({
- queryKey: ["inbox", "signal-source-configs", projectId],
- queryFn: () =>
- projectId
- ? getPostHogApiClient().listSignalSourceConfigs(projectId)
- : Promise.resolve([]),
- enabled: !!projectId && !!oauthAccessToken,
- staleTime: 30_000,
- });
-}
diff --git a/products/desktop/apps/mobile/src/features/inbox/hooks/useSignalTeamConfig.ts b/products/desktop/apps/mobile/src/features/inbox/hooks/useSignalTeamConfig.ts
deleted file mode 100644
index 3501a431607d..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/hooks/useSignalTeamConfig.ts
+++ /dev/null
@@ -1,41 +0,0 @@
-import type { SignalTeamConfig } from "@posthog/shared/domain-types";
-import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
-import { useAuthStore } from "@/features/auth";
-import { getPostHogApiClient } from "@/lib/posthogApiClient";
-
-function teamConfigKey(projectId: number | null) {
- return ["signals", "team-config", projectId] as const;
-}
-
-export function useSignalTeamConfig() {
- const { projectId, oauthAccessToken } = useAuthStore();
-
- // The backend lazily creates the singleton, so a read never means "no config".
- // Let auth/5xx/network failures surface as query errors instead of a false
- // no-cap state.
- return useQuery<SignalTeamConfig>({
- queryKey: teamConfigKey(projectId),
- queryFn: () => getPostHogApiClient().getSignalTeamConfig(),
- enabled: !!projectId && !!oauthAccessToken,
- staleTime: 30_000,
- });
-}
-
-/** Save (`number`) or clear (`null`) the per-project daily report cap. */
-export function useUpdateMaxReportsPerDay() {
- const { projectId } = useAuthStore();
- const queryClient = useQueryClient();
-
- return useMutation<SignalTeamConfig, Error, number | null>({
- mutationFn: (limit) =>
- getPostHogApiClient().updateSignalTeamConfig({
- max_reports_per_day: limit,
- }),
- onSuccess: (fresh) => {
- queryClient.setQueryData<SignalTeamConfig>(
- teamConfigKey(projectId),
- fresh,
- );
- },
- });
-}
diff --git a/products/desktop/apps/mobile/src/features/inbox/recordingClipTime.test.ts b/products/desktop/apps/mobile/src/features/inbox/recordingClipTime.test.ts
deleted file mode 100644
index 6418c103513b..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/recordingClipTime.test.ts
+++ /dev/null
@@ -1,95 +0,0 @@
-import type {
- RecordingClipSegment,
- RecordingExport,
-} from "@posthog/api-client/posthog-client";
-import { describe, expect, it } from "vitest";
-import { clipTimeForMoment } from "./recordingClipTime";
-
-function makeClip(overrides: Partial<RecordingExport> = {}): RecordingExport {
- return {
- id: 1,
- startOffsetSeconds: 0,
- endOffsetSeconds: null,
- clipDurationSeconds: null,
- truncated: false,
- segments: [],
- ...overrides,
- };
-}
-
-function segment(
- sessionFrom: number,
- sessionTo: number,
- clipFrom: number,
- clipTo: number,
- active = true,
-): RecordingClipSegment {
- return {
- sessionFromSeconds: sessionFrom,
- sessionToSeconds: sessionTo,
- clipFromSeconds: clipFrom,
- clipToSeconds: clipTo,
- active,
- };
-}
-
-describe("clipTimeForMoment", () => {
- describe("a render that kept every stretch", () => {
- it.each([
- ["a whole-session clip", 0, 120, 120],
- ["a clip whose window opens late", 100, 160, 60],
- ])("maps %s", (_label, startOffset, sessionOffset, expected) => {
- const clip = makeClip({
- startOffsetSeconds: startOffset,
- clipDurationSeconds: 300,
- });
- expect(clipTimeForMoment(clip, sessionOffset)).toBe(expected);
- });
-
- it.each([
- ["the moment sits before the window", 100, 40],
- ["the moment sits past the clip's end", 0, 400],
- ])("returns null when %s", (_label, startOffset, sessionOffset) => {
- const clip = makeClip({
- startOffsetSeconds: startOffset,
- clipDurationSeconds: 300,
- });
- expect(clipTimeForMoment(clip, sessionOffset)).toBeNull();
- });
- });
-
- describe("a render that dropped idle stretches", () => {
- const clip = makeClip({
- clipDurationSeconds: 120,
- segments: [
- segment(0, 60, 0, 60),
- segment(60, 300, 60, 60, false),
- segment(300, 360, 60, 120),
- ],
- });
-
- it.each([
- ["inside the first active stretch", 30, 30],
- ["at the boundary into the dropped stretch", 60, 60],
- ["inside the second active stretch", 330, 90],
- ["at the very end of the clip", 360, 120],
- ])("maps a moment %s", (_label, sessionOffset, expected) => {
- expect(clipTimeForMoment(clip, sessionOffset)).toBe(expected);
- });
-
- it("resolves a moment inside a dropped stretch to the next frame", () => {
- expect(clipTimeForMoment(clip, 200)).toBe(60);
- });
-
- it("returns null for a moment the render never reached", () => {
- expect(clipTimeForMoment(clip, 420)).toBeNull();
- });
-
- it("returns the clip start for a moment before the first stretch", () => {
- const late = makeClip({
- segments: [segment(100, 160, 0, 60)],
- });
- expect(clipTimeForMoment(late, 40)).toBe(0);
- });
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/inbox/recordingClipTime.ts b/products/desktop/apps/mobile/src/features/inbox/recordingClipTime.ts
deleted file mode 100644
index 965d3b7771de..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/recordingClipTime.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-import type { RecordingExport } from "@posthog/api-client/posthog-client";
-
-export function clipTimeForMoment(
- clip: RecordingExport,
- sessionOffsetSeconds: number,
-): number | null {
- if (clip.segments.length === 0) {
- const clipTime = sessionOffsetSeconds - clip.startOffsetSeconds;
- if (clipTime < 0) return null;
- if (
- clip.clipDurationSeconds != null &&
- clipTime > clip.clipDurationSeconds
- ) {
- return null;
- }
- return clipTime;
- }
-
- for (const segment of clip.segments) {
- if (sessionOffsetSeconds < segment.sessionFromSeconds) {
- return segment.clipFromSeconds;
- }
- const sessionTo = segment.sessionToSeconds ?? segment.sessionFromSeconds;
- if (sessionOffsetSeconds <= sessionTo) {
- if (!segment.active) return segment.clipFromSeconds;
- const intoSegment = sessionOffsetSeconds - segment.sessionFromSeconds;
- return Math.min(
- segment.clipFromSeconds + intoSegment,
- segment.clipToSeconds,
- );
- }
- }
- return null;
-}
diff --git a/products/desktop/apps/mobile/src/features/inbox/recordingOffset.test.ts b/products/desktop/apps/mobile/src/features/inbox/recordingOffset.test.ts
deleted file mode 100644
index c0131ac86ca2..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/recordingOffset.test.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import { describe, expect, it } from "vitest";
-import {
- colonOffsetFromSeconds,
- colonOffsetToSeconds,
-} from "./recordingOffset";
-
-describe("colonOffsetToSeconds", () => {
- it.each([
- ["MM:SS", "01:47", 107],
- ["HH:MM:SS", "1:02:03", 3723],
- ["zero-padded minutes", "10:00", 600],
- ])("parses %s", (_label, offset, expected) => {
- expect(colonOffsetToSeconds(offset)).toBe(expected);
- });
-
- it.each([
- ["a bare number", "47"],
- ["too many parts", "1:2:3:4"],
- ["a non-numeric part", "ab:cd"],
- ["a negative part", "-1:00"],
- ["an empty segment", "1::2"],
- ["a hex literal", "0x10:00"],
- ["scientific notation", "1e308:00"],
- ["padded whitespace", " 1 : 2 "],
- ["seconds of 60", "1:60"],
- ["minutes of 60 in HH:MM:SS", "1:60:00"],
- ])("returns null for %s", (_label, offset) => {
- expect(colonOffsetToSeconds(offset)).toBeNull();
- });
-});
-
-describe("colonOffsetFromSeconds", () => {
- it.each([
- ["under an hour", 107, "01:47"],
- ["exactly zero", 0, "00:00"],
- ["over an hour", 3723, "01:02:03"],
- ["rounding fractional seconds", 30.4, "00:30"],
- ["clamping negatives to zero", -5, "00:00"],
- ])("formats %s", (_label, seconds, expected) => {
- expect(colonOffsetFromSeconds(seconds)).toBe(expected);
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/inbox/recordingOffset.ts b/products/desktop/apps/mobile/src/features/inbox/recordingOffset.ts
deleted file mode 100644
index f7683a6bdb1e..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/recordingOffset.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-export function colonOffsetToSeconds(offset: string): number | null {
- const parts = offset.split(":");
- if (parts.length < 2 || parts.length > 3) return null;
- if (parts.some((p) => !/^\d+$/.test(p))) return null;
- const nums = parts.map(Number);
- const [h, m, s] = parts.length === 3 ? nums : [0, nums[0], nums[1]];
- if (m >= 60 || s >= 60) return null;
- const total = h * 3600 + m * 60 + s;
- return Number.isSafeInteger(total) ? total : null;
-}
-
-export function colonOffsetFromSeconds(seconds: number): string {
- const total = Math.max(0, Math.round(seconds));
- const mins = Math.floor(total / 60);
- const secs = total % 60;
- const hrs = Math.floor(mins / 60);
- const pad = (n: number) => String(n).padStart(2, "0");
- return hrs > 0
- ? `${pad(hrs)}:${pad(mins % 60)}:${pad(secs)}`
- : `${pad(mins)}:${pad(secs)}`;
-}
diff --git a/products/desktop/apps/mobile/src/features/inbox/reportTaskLaunch.test.tsx b/products/desktop/apps/mobile/src/features/inbox/reportTaskLaunch.test.tsx
deleted file mode 100644
index da3b7f335be5..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/reportTaskLaunch.test.tsx
+++ /dev/null
@@ -1,477 +0,0 @@
-import { DEFAULT_GATEWAY_MODEL } from "@posthog/shared";
-import type { SignalReport } from "@posthog/shared/domain-types";
-import { createElement } from "react";
-import { Alert, Animated, Pressable } from "react-native";
-import { act, create, type ReactTestRenderer } from "react-test-renderer";
-import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
-import ReportDetailScreen from "@/app/inbox/[...id]";
-import NewTaskScreen from "@/app/task/index";
-import { useTaskStore } from "@/features/tasks/stores/taskStore";
-import { CreatePrFeedbackSheet } from "./components/CreatePrFeedbackSheet";
-import { DiscussReportSheet } from "./components/DiscussReportSheet";
-import { SwipeableReportCard } from "./components/SwipeableReportCard";
-import { TinderView } from "./components/TinderView";
-import { useDismissedReportsStore } from "./stores/dismissedReportsStore";
-
-const mocks = vi.hoisted(() => ({
- params: {} as Record<string, string>,
- createReportTask: vi.fn(),
- createTask: vi.fn(),
- runTask: vi.fn(),
- replace: vi.fn(),
- push: vi.fn(),
- integrations: vi.fn(),
- configReady: true,
-}));
-
-vi.mock("react-native", () => {
- const host = (name: string) => (props: Record<string, unknown>) =>
- createElement(name, props);
- return {
- View: host("View"),
- ScrollView: host("ScrollView"),
- Pressable: host("Pressable"),
- TextInput: host("TextInput"),
- ActivityIndicator: host("ActivityIndicator"),
- Modal: host("Modal"),
- Platform: { OS: "ios" },
- Alert: { alert: vi.fn() },
- Animated: {
- View: "AnimatedView",
- Value: class {
- value = 0;
- setValue(value: number) {
- this.value = value;
- }
- interpolate() {
- return 0;
- }
- },
- timing: (
- value: { setValue: (value: number) => void },
- config: { toValue: number },
- ) => ({
- start: (callback: () => Promise<void>) => {
- value.setValue(config.toValue);
- return callback();
- },
- }),
- },
- PanResponder: {
- create: (handlers: Record<string, unknown>) => ({
- panHandlers: handlers,
- }),
- },
- };
-});
-vi.mock("@components/text", () => ({ Text: "Text" }));
-vi.mock("expo-router", () => ({
- Stack: { Screen: () => null },
- useLocalSearchParams: () => mocks.params,
- useRouter: () => ({ replace: mocks.replace, push: mocks.push }),
-}));
-vi.mock("expo-linear-gradient", () => ({ LinearGradient: "Gradient" }));
-vi.mock("expo-haptics", () => ({
- impactAsync: vi.fn(),
- ImpactFeedbackStyle: { Light: "light", Medium: "medium" },
-}));
-vi.mock("react-native-keyboard-controller", () => ({
- useKeyboardHandler: vi.fn(),
- useReanimatedKeyboardAnimation: () => ({
- height: { value: 0 },
- progress: { value: 0 },
- }),
-}));
-vi.mock("@/features/chat", () => ({
- useVoiceRecording: () => ({ status: "idle" }),
-}));
-vi.mock("@/features/chat/components/MarkdownText", () => ({
- MarkdownText: "Markdown",
-}));
-vi.mock("@/hooks/useScreenInsets", () => ({
- useScreenInsets: () => ({ insets: { top: 0 }, bottom: () => 0 }),
-}));
-vi.mock("@/lib/theme", () => ({
- useThemeColors: () => ({
- gray: {},
- accent: {},
- status: {},
- background: "#fff",
- card: "#fff",
- }),
- toRgba: () => "#fff",
-}));
-vi.mock("@/lib/posthogApiClient", () => ({
- getPostHogApiClient: () => ({
- createSignalReportTask: mocks.createReportTask,
- createTask: mocks.createTask,
- runTaskInCloud: mocks.runTask,
- }),
-}));
-vi.mock("@/lib/analytics", () => ({
- useAnalytics: () => ({ track: vi.fn() }),
- ANALYTICS_EVENTS: { INBOX_REPORT_ACTION: "report action" },
- computeReportAgeHours: () => 1,
-}));
-vi.mock("./api", () => ({ getReportRepository: async () => null }));
-vi.mock("./components/ConventionalCommitTag", () => ({
- ConventionalCommitTag: () => null,
-}));
-vi.mock("@/features/tasks/hooks/useWarmTask", () => ({ useWarmTask: vi.fn() }));
-vi.mock("@/features/tasks/hooks/useUserIntegrations", () => ({
- useUserIntegrations: (options: { enabled: boolean }) => {
- mocks.integrations(options);
- return {
- repositoryOptions: [],
- hasGithubIntegration: options.enabled ? true : null,
- isLoading: false,
- getUserIntegrationId: vi.fn(),
- };
- },
-}));
-vi.mock("@/features/tasks/hooks/useCloudTaskConfigOptions", () => ({
- useCloudTaskConfigOptions: () => ({
- configOptions: [
- { category: "model", currentValue: DEFAULT_GATEWAY_MODEL, options: [] },
- ],
- modelGroups: [],
- hasLiveConfig: false,
- isConfigReady: mocks.configReady,
- }),
-}));
-vi.mock("@/features/tasks/composer/AgentConfigControls", () => ({
- AgentConfigControls: () => null,
-}));
-vi.mock("@/features/tasks/composer/DotBackground", () => ({
- DotBackground: () => null,
-}));
-vi.mock("@/features/tasks/composer/RepositoryPickerInline", () => ({
- RepositoryPickerInline: "RepositoryPicker",
-}));
-vi.mock("@/features/tasks/components/GitHubConnectionPrompt", () => ({
- GitHubConnectionPrompt: "ConnectGitHub",
-}));
-vi.mock("@/features/tasks/components/GitHubLoadNotice", () => ({
- GitHubLoadNotice: "GitHubLoadNotice",
-}));
-vi.mock("@/features/tasks/composer/attachments/AttachmentSheet", () => ({
- AttachmentSheet: () => null,
-}));
-vi.mock("@/features/tasks/composer/attachments/AttachmentsBar", () => ({
- AttachmentsBar: () => null,
-}));
-vi.mock("@/features/tasks/composer/attachments/pickers", () => ({
- captureFromCamera: vi.fn(),
- pickDocument: vi.fn(),
- pickPhotoFromLibrary: vi.fn(),
-}));
-vi.mock("@/features/tasks/composer/attachments/buildCloudPrompt", () => ({
- buildCloudPromptBlocks: vi.fn(),
-}));
-
-const report: SignalReport = {
- id: "report-1",
- title: "Fix sample failure",
- summary: "Check the evidence.",
- status: "ready",
- priority: "P2",
- total_weight: 1,
- signal_count: 1,
- artefact_count: 0,
- created_at: "2026-09-01T00:00:00Z",
- updated_at: "2026-09-01T00:00:00Z",
-};
-
-let renderer: ReactTestRenderer;
-async function renderComposer(): Promise<void> {
- await act(async () => {
- renderer = create(createElement(NewTaskScreen));
- });
-}
-function submitButton() {
- return renderer.root.find(
- (node) =>
- node.type === Pressable &&
- node.props.accessibilityLabel === "Create task",
- );
-}
-async function renderTriage(): Promise<void> {
- await act(async () => {
- renderer = create(createElement(TinderView, { reports: [report] }));
- });
-}
-function acceptCard(): Promise<boolean> {
- return renderer.root.findByType(SwipeableReportCard).props.onAccept(report);
-}
-
-async function swipeRight(): Promise<void> {
- const card = renderer.root
- .findAllByType(Animated.View)
- .find((node) => node.props.onPanResponderRelease);
- if (!card) throw new Error("Swipe card not found");
- const gesture = { dx: 150, dy: 0 };
- card.props.onPanResponderGrant();
- card.props.onPanResponderMove({}, gesture);
- await card.props.onPanResponderRelease({}, gesture);
-}
-
-function cardOffset(): number {
- return renderer.root
- .findAllByType(Animated.View)
- .find((node) => node.props.onPanResponderRelease)?.props.style.transform[0]
- .translateX.value;
-}
-
-describe("Mobile report task launches", () => {
- it.each(["implementation", "discussion"])(
- "keeps the report detail %s intent when opening the composer",
- async (relationship) => {
- mocks.params = { id: report.id };
- await act(async () => {
- renderer = create(createElement(ReportDetailScreen));
- });
- await act(async () => {
- if (relationship === "discussion") {
- renderer.root.findByType(DiscussReportSheet).props.onSubmit({
- prompt: "Discuss the evidence",
- question: "Why did this happen?",
- });
- } else {
- renderer.root
- .findByType(CreatePrFeedbackSheet)
- .props.onSubmit("Add regression coverage");
- }
- });
- const route = mocks.push.mock.calls[0][0];
- expect(route.pathname).toBe("/task");
- expect(route.params).toEqual({
- signalReport: report.id,
- signalReportRelationship: relationship,
- prompt:
- relationship === "discussion"
- ? "Discuss the evidence"
- : expect.stringContaining(report.id),
- ...(relationship === "discussion"
- ? { signalReportDiscussionQuestion: "Why did this happen?" }
- : {}),
- });
- if (relationship === "implementation") {
- expect(route.params.prompt).toContain("Add regression coverage");
- }
- },
- );
- beforeEach(() => {
- vi.clearAllMocks();
- mocks.params = {
- prompt: "Read the report evidence",
- signalReport: report.id,
- };
- mocks.configReady = true;
- mocks.createReportTask.mockResolvedValue({ id: "task-1" });
- mocks.runTask.mockResolvedValue({ id: "run-1" });
- useTaskStore.setState({
- lastRepository: { integrationId: null, repository: null },
- });
- useDismissedReportsStore.getState().clearDismissed();
- });
- afterEach(() => {
- if (renderer) act(() => renderer.unmount());
- });
-
- it.each(["implementation", "discussion"])(
- "starts a report %s without a personal repository",
- async (relationship) => {
- mocks.params.signalReportRelationship = relationship;
- mocks.params.signalReportDiscussionQuestion = "What caused this?";
- await renderComposer();
- expect(mocks.integrations).toHaveBeenCalledWith({ enabled: false });
- expect(
- renderer.root.findAll(
- (node) => String(node.type) === "RepositoryPicker",
- ),
- ).toHaveLength(0);
- expect(submitButton().props.disabled).toBe(false);
- await act(async () => {
- await submitButton().props.onPress();
- });
- expect(mocks.createReportTask).toHaveBeenCalledWith({
- reportId: report.id,
- relationship,
- question: "What caused this?",
- description: "Read the report evidence",
- title: "Read the report evidence",
- });
- expect(mocks.createTask).not.toHaveBeenCalled();
- expect(mocks.runTask).toHaveBeenCalledWith(
- "task-1",
- undefined,
- expect.objectContaining({
- runSource: "signal_report",
- signalReportId: report.id,
- ...(relationship === "discussion"
- ? { initialPermissionMode: "auto" }
- : {}),
- }),
- );
- expect(mocks.replace).toHaveBeenCalledWith("/task/task-1");
- },
- );
-
- it("still requires a repository for an ordinary task", async () => {
- mocks.params = { prompt: "Fix a sample failure" };
- await renderComposer();
- expect(submitButton().props.disabled).toBe(true);
- await act(async () => {
- await submitButton().props.onPress();
- });
- expect(mocks.createTask).not.toHaveBeenCalled();
- expect(mocks.createReportTask).not.toHaveBeenCalled();
- });
-
- it("does not submit twice before the composer rerenders", async () => {
- await renderComposer();
- const press = submitButton().props.onPress;
- await act(async () => {
- await Promise.all([press(), press()]);
- });
- expect(mocks.createReportTask).toHaveBeenCalledOnce();
- expect(mocks.runTask).toHaveBeenCalledOnce();
- });
-
- it.each(["implementation", "discussion"])(
- "retries the existing %s task after a startup error",
- async (relationship) => {
- mocks.params.signalReportRelationship = relationship;
- mocks.runTask.mockRejectedValueOnce(new Error("Cloud start failed"));
- await renderComposer();
- await act(async () => {
- await submitButton().props.onPress();
- });
- expect(Alert.alert).toHaveBeenCalledWith(
- "Could not start task",
- "Cloud start failed",
- );
- expect(mocks.replace).not.toHaveBeenCalled();
- await act(async () => {
- await submitButton().props.onPress();
- });
- expect(mocks.createReportTask).toHaveBeenCalledOnce();
- expect(mocks.runTask).toHaveBeenCalledTimes(2);
- expect(mocks.runTask.mock.calls.map(([taskId]) => taskId)).toEqual([
- "task-1",
- "task-1",
- ]);
- expect(mocks.replace).toHaveBeenCalledWith("/task/task-1");
- },
- );
-
- it("starts one triage implementation and accepts it only after startup", async () => {
- let finish!: () => void;
- mocks.runTask.mockReturnValueOnce(
- new Promise<void>((resolve) => {
- finish = resolve;
- }),
- );
- await renderTriage();
- let pending!: Promise<boolean>;
- await act(async () => {
- pending = acceptCard();
- });
- expect(useDismissedReportsStore.getState().acceptedIds).toEqual([]);
- await act(async () => {
- await acceptCard();
- finish();
- await pending;
- });
- expect(mocks.createReportTask).toHaveBeenCalledOnce();
- expect(mocks.createReportTask).toHaveBeenCalledWith({
- reportId: report.id,
- relationship: "implementation",
- description: expect.stringContaining(report.id),
- title: expect.any(String),
- });
- expect(mocks.runTask).toHaveBeenCalledOnce();
- expect(useDismissedReportsStore.getState().acceptedIds).toEqual([
- report.id,
- ]);
- });
-
- it("resets a failed swipe and retries the existing triage task", async () => {
- mocks.runTask.mockRejectedValueOnce(new Error("Cloud start failed"));
- await renderTriage();
- await act(async () => {
- await swipeRight();
- });
- expect(useDismissedReportsStore.getState().acceptedIds).toEqual([]);
- expect(JSON.stringify(renderer.toJSON())).toContain("Cloud start failed");
- expect(cardOffset()).toBe(0);
- await act(async () => {
- await swipeRight();
- });
- expect(mocks.createReportTask).toHaveBeenCalledOnce();
- expect(mocks.runTask).toHaveBeenCalledTimes(2);
- expect(mocks.runTask.mock.calls.map(([taskId]) => taskId)).toEqual([
- "task-1",
- "task-1",
- ]);
- expect(useDismissedReportsStore.getState().acceptedIds).toEqual([
- report.id,
- ]);
- });
-
- it("does not launch a swipe before cloud configuration is ready", async () => {
- mocks.configReady = false;
- await renderTriage();
- await act(async () => {
- await swipeRight();
- });
- expect(mocks.createReportTask).not.toHaveBeenCalled();
- expect(cardOffset()).toBe(0);
- });
-});
-
-vi.mock("posthog-react-native", () => ({
- useFeatureFlag: () => false,
- usePostHog: () => ({ capture: vi.fn() }),
-}));
-vi.mock("@/features/auth", () => ({
- useUserQuery: () => ({ data: { id: 1 } }),
-}));
-vi.mock("./hooks/useInboxReports", () => ({
- useInboxReport: () => ({ data: report }),
- useInboxReportArtefacts: () => ({ data: { results: [] } }),
- useInboxReportSignals: () => ({ data: { results: [] } }),
-}));
-vi.mock("./hooks/useInboxEngagementTracker", () => ({
- useInboxEngagementTracker: () => ({
- signalAction: vi.fn(),
- signalScroll: vi.fn(),
- }),
-}));
-vi.mock("./components/CreatePrFeedbackSheet", () => ({
- CreatePrFeedbackSheet: () => null,
-}));
-vi.mock("./components/DiscussReportSheet", () => ({
- DiscussReportSheet: () => null,
-}));
-vi.mock("./components/DismissReportSheet", () => ({
- DismissReportSheet: () => null,
-}));
-vi.mock("./components/RefundReportSheet", () => ({
- RefundReportSheet: () => null,
-}));
-vi.mock("./components/ReportActivity", () => ({ ReportActivity: () => null }));
-vi.mock("./components/ReportFeedbackFooter", () => ({
- ReportFeedbackFooter: () => null,
-}));
-vi.mock("./components/ReportVerdictBanner", () => ({
- ReportVerdictBanner: () => null,
-}));
-vi.mock("./components/SignalCard", () => ({ SignalCard: () => null }));
-vi.mock("./components/SuggestedReviewers", () => ({
- SuggestedReviewers: () => null,
-}));
-vi.mock("@/features/tasks/components/PrStatusBadge", () => ({
- PrStatusBadge: () => null,
-}));
-vi.mock("@/lib/openExternalUrl", () => ({ openExternalUrl: vi.fn() }));
diff --git a/products/desktop/apps/mobile/src/features/inbox/reportVerdictAction.test.ts b/products/desktop/apps/mobile/src/features/inbox/reportVerdictAction.test.ts
deleted file mode 100644
index d130fa14bbc8..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/reportVerdictAction.test.ts
+++ /dev/null
@@ -1,129 +0,0 @@
-import type {
- SignalReport,
- SignalReportActionability,
- SignalReportStatus,
-} from "@posthog/shared/domain-types";
-import { describe, expect, it } from "vitest";
-import {
- type ReportVerdictAction,
- resolveReportVerdictAction,
-} from "./reportVerdictAction";
-
-function report(overrides: Partial<SignalReport>): SignalReport {
- return {
- id: "r1",
- title: "A report",
- summary: "",
- status: "ready",
- total_weight: 1,
- signal_count: 1,
- created_at: "2024-01-01T00:00:00Z",
- updated_at: "2024-01-01T00:00:00Z",
- artefact_count: 0,
- ...overrides,
- };
-}
-
-describe("resolveReportVerdictAction", () => {
- const cases: Array<{
- name: string;
- overrides: Partial<SignalReport>;
- expected: ReportVerdictAction;
- }> = [
- {
- name: "ready + immediately actionable → start",
- overrides: { status: "ready", actionability: "immediately_actionable" },
- expected: { kind: "start", label: "Start task", awaitingInput: false },
- },
- {
- name: "ready + requires human input → implement as new task",
- overrides: { status: "ready", actionability: "requires_human_input" },
- expected: {
- kind: "start",
- label: "Implement as new task",
- awaitingInput: true,
- },
- },
- {
- name: "pending_input → implement as new task",
- overrides: { status: "pending_input" },
- expected: {
- kind: "start",
- label: "Implement as new task",
- awaitingInput: true,
- },
- },
- {
- name: "live PR takes precedence over start",
- overrides: {
- status: "ready",
- actionability: "immediately_actionable",
- implementation_pr_url: "https://github.com/o/r/pull/1",
- },
- expected: { kind: "view_pr", url: "https://github.com/o/r/pull/1" },
- },
- {
- name: "merged PR is not live: offer a fresh start",
- overrides: {
- status: "ready",
- actionability: "immediately_actionable",
- implementation_pr_url: "https://github.com/o/r/pull/1",
- implementation_pr_merged: true,
- },
- expected: { kind: "start", label: "Start task", awaitingInput: false },
- },
- {
- name: "non-GitHub PR url is not trusted: no action, not presented as a PR",
- overrides: {
- status: "ready",
- actionability: "immediately_actionable",
- implementation_pr_url: "https://attacker.example/pull/1",
- },
- expected: null,
- },
- {
- name: "already addressed → no action",
- overrides: {
- status: "ready",
- actionability: "immediately_actionable",
- already_addressed: true,
- },
- expected: null,
- },
- {
- name: "not actionable → no action",
- overrides: { status: "ready", actionability: "not_actionable" },
- expected: null,
- },
- {
- name: "in progress → no action",
- overrides: { status: "in_progress" },
- expected: null,
- },
- {
- name: "failed → no action",
- overrides: { status: "failed" },
- expected: null,
- },
- ];
-
- it.each(cases)("$name", ({ overrides, expected }) => {
- expect(resolveReportVerdictAction(report(overrides))).toEqual(expected);
- });
-
- it.each<SignalReportStatus>(["resolved", "suppressed", "deleted"])(
- "terminal status %s offers no action even with a live PR",
- (status) => {
- expect(
- resolveReportVerdictAction(
- report({
- status,
- actionability:
- "immediately_actionable" as SignalReportActionability,
- implementation_pr_url: "https://github.com/o/r/pull/1",
- }),
- ),
- ).toBeNull();
- },
- );
-});
diff --git a/products/desktop/apps/mobile/src/features/inbox/reportVerdictAction.ts b/products/desktop/apps/mobile/src/features/inbox/reportVerdictAction.ts
deleted file mode 100644
index 2c4679c7f53f..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/reportVerdictAction.ts
+++ /dev/null
@@ -1,58 +0,0 @@
-import { canCreateImplementationPr } from "@posthog/core/inbox/reportActions";
-import { parsePrUrl } from "@posthog/core/inbox/reportPresentation";
-import type { SignalReport } from "@posthog/shared/domain-types";
-
-export type ReportVerdictAction =
- | { kind: "start"; label: string; awaitingInput: boolean }
- | { kind: "view_pr"; url: string }
- | null;
-
-/** True when the report is blocked on user input the reader can supply. */
-export function isReportAwaitingInput(report: SignalReport): boolean {
- return (
- report.status === "pending_input" ||
- (report.status === "ready" &&
- report.actionability === "requires_human_input")
- );
-}
-
-/**
- * The implementation PR to link to, or null. A merged PR is history, not live
- * work. `implementation_pr_url` flows in from task-run output, so it is only
- * trusted as a canonical GitHub PR URL — anything else is not presented as
- * "View PR".
- */
-function liveImplementationPrUrl(report: SignalReport): string | null {
- if (report.implementation_pr_merged) return null;
- const url = report.implementation_pr_url;
- if (!url || !parsePrUrl(url)) return null;
- return url;
-}
-
-/**
- * The one action the verdict banner offers: open the live PR, start the fix, or
- * nothing. Mobile has no continuable-task lookup, so an existing PR is read from
- * `implementation_pr_url` alone.
- */
-export function resolveReportVerdictAction(
- report: SignalReport,
-): ReportVerdictAction {
- if (
- report.status === "resolved" ||
- report.status === "suppressed" ||
- report.status === "deleted"
- ) {
- return null;
- }
- const prUrl = liveImplementationPrUrl(report);
- if (prUrl) return { kind: "view_pr", url: prUrl };
- if (canCreateImplementationPr(report)) {
- const awaitingInput = isReportAwaitingInput(report);
- return {
- kind: "start",
- label: awaitingInput ? "Implement as new task" : "Start task",
- awaitingInput,
- };
- }
- return null;
-}
diff --git a/products/desktop/apps/mobile/src/features/inbox/sourceFilterOptions.test.ts b/products/desktop/apps/mobile/src/features/inbox/sourceFilterOptions.test.ts
deleted file mode 100644
index e4e2c4046d67..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/sourceFilterOptions.test.ts
+++ /dev/null
@@ -1,69 +0,0 @@
-import type { SignalSourceConfig } from "@posthog/api-client/posthog-client";
-import { EXTERNAL_INBOX_SOURCES, type SourceProduct } from "@posthog/shared";
-import { describe, expect, it } from "vitest";
-import {
- narrowSourceProductOptions,
- SOURCE_PRODUCT_OPTIONS,
-} from "./sourceFilterOptions";
-
-describe("SOURCE_PRODUCT_OPTIONS", () => {
- it("includes every warehouse-backed source from the shared registry", () => {
- const values = new Set(SOURCE_PRODUCT_OPTIONS.map((o) => o.value));
- for (const source of EXTERNAL_INBOX_SOURCES) {
- expect(values.has(source.product)).toBe(true);
- }
- });
-
- it("keeps the native products", () => {
- const values = SOURCE_PRODUCT_OPTIONS.map((o) => o.value);
- expect(values).toContain("replay_vision");
- expect(values).toContain("signals_scout");
- });
-});
-
-function config(
- source_product: SourceProduct,
- enabled: boolean,
-): SignalSourceConfig {
- return {
- id: source_product,
- source_product,
- source_type: "issue",
- enabled,
- config: {},
- created_at: "",
- updated_at: "",
- status: null,
- };
-}
-
-describe("narrowSourceProductOptions", () => {
- const values = (
- configs: SignalSourceConfig[] | undefined,
- selected: SourceProduct[] = [],
- ) => narrowSourceProductOptions(configs, selected).map((o) => o.value);
-
- it("shows an enabled warehouse source and hides a disabled one", () => {
- const result = values([config("github", true), config("sentry", false)]);
- expect(result).toContain("github");
- expect(result).not.toContain("sentry");
- });
-
- it("always keeps PostHog's own products", () => {
- const result = values([]);
- expect(result).toContain("replay_vision");
- expect(result).toContain("signals_scout");
- expect(result).not.toContain("github");
- });
-
- it("keeps a disabled source while it is selected", () => {
- const result = values([config("sentry", false)], ["sentry"]);
- expect(result).toContain("sentry");
- });
-
- it("hides nothing while the source configs are unknown", () => {
- expect(values(undefined)).toEqual(
- SOURCE_PRODUCT_OPTIONS.map((o) => o.value),
- );
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/inbox/sourceFilterOptions.ts b/products/desktop/apps/mobile/src/features/inbox/sourceFilterOptions.ts
deleted file mode 100644
index 8774c6bcf4f7..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/sourceFilterOptions.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import type { SignalSourceConfig } from "@posthog/api-client/posthog-client";
-import {
- EXTERNAL_INBOX_SOURCES,
- filterInboxSourceOptions,
- type SourceProduct,
-} from "@posthog/shared";
-
-export const SOURCE_PRODUCT_OPTIONS: { value: SourceProduct; label: string }[] =
- [
- { value: "replay_vision", label: "Replay Vision" },
- { value: "error_tracking", label: "Error tracking" },
- { value: "llm_analytics", label: "AI observability" },
- { value: "conversations", label: "Conversations" },
- { value: "signals_scout", label: "Scout" },
- ...EXTERNAL_INBOX_SOURCES.map((source) => ({
- value: source.product,
- label: source.label,
- })),
- ];
-
-export function narrowSourceProductOptions(
- configs: SignalSourceConfig[] | undefined,
- selected: SourceProduct[],
-): { value: SourceProduct; label: string }[] {
- const enabled = configs
- ? new Set(configs.filter((c) => c.enabled).map((c) => c.source_product))
- : undefined;
- return filterInboxSourceOptions(SOURCE_PRODUCT_OPTIONS, enabled, selected);
-}
diff --git a/products/desktop/apps/mobile/src/features/inbox/stores/dismissDraftStore.ts b/products/desktop/apps/mobile/src/features/inbox/stores/dismissDraftStore.ts
deleted file mode 100644
index db68514fece9..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/stores/dismissDraftStore.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-import type { DismissalReasonOptionValue } from "@posthog/shared";
-import { create } from "zustand";
-
-export interface DismissDraft {
- reason: DismissalReasonOptionValue;
- note: string;
- reopen: boolean;
- errorMessage?: string;
-}
-
-interface DismissDraftState {
- drafts: Record<string, DismissDraft | undefined>;
- setDraft: (reportId: string, draft: DismissDraft | undefined) => void;
-}
-
-export const useDismissDraftStore = create<DismissDraftState>((set) => ({
- drafts: {},
- setDraft: (reportId, draft) =>
- set((state) => {
- const next = { ...state.drafts };
- if (draft === undefined) {
- delete next[reportId];
- } else {
- next[reportId] = draft;
- }
- return { drafts: next };
- }),
-}));
diff --git a/products/desktop/apps/mobile/src/features/inbox/stores/dismissedReportsStore.ts b/products/desktop/apps/mobile/src/features/inbox/stores/dismissedReportsStore.ts
deleted file mode 100644
index 680952945cd0..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/stores/dismissedReportsStore.ts
+++ /dev/null
@@ -1,59 +0,0 @@
-import AsyncStorage from "@react-native-async-storage/async-storage";
-import { create } from "zustand";
-import { createJSONStorage, persist } from "zustand/middleware";
-
-interface DismissedReportsState {
- /** Report IDs swiped left (dismissed). */
- dismissedIds: string[];
- /** Report IDs swiped right (accepted / task started). */
- acceptedIds: string[];
-}
-
-interface DismissedReportsActions {
- dismissReport: (reportId: string) => void;
- acceptReport: (reportId: string) => void;
- undismissReport: (reportId: string) => void;
- clearDismissed: () => void;
-}
-
-type DismissedReportsStore = DismissedReportsState & DismissedReportsActions;
-
-/** All report IDs the user has acted on (swiped left or right). */
-export function decidedIds(state: DismissedReportsState): string[] {
- return [...state.dismissedIds, ...state.acceptedIds];
-}
-
-export const useDismissedReportsStore = create<DismissedReportsStore>()(
- persist(
- (set) => ({
- dismissedIds: [],
- acceptedIds: [],
- dismissReport: (reportId) =>
- set((state) => ({
- dismissedIds: state.dismissedIds.includes(reportId)
- ? state.dismissedIds
- : [...state.dismissedIds, reportId],
- })),
- acceptReport: (reportId) =>
- set((state) => ({
- acceptedIds: state.acceptedIds.includes(reportId)
- ? state.acceptedIds
- : [...state.acceptedIds, reportId],
- })),
- undismissReport: (reportId) =>
- set((state) => ({
- dismissedIds: state.dismissedIds.filter((id) => id !== reportId),
- acceptedIds: state.acceptedIds.filter((id) => id !== reportId),
- })),
- clearDismissed: () => set({ dismissedIds: [], acceptedIds: [] }),
- }),
- {
- name: "dismissed-reports-storage",
- storage: createJSONStorage(() => AsyncStorage),
- partialize: (state) => ({
- dismissedIds: state.dismissedIds,
- acceptedIds: state.acceptedIds,
- }),
- },
- ),
-);
diff --git a/products/desktop/apps/mobile/src/features/inbox/stores/inboxFilterStore.test.ts b/products/desktop/apps/mobile/src/features/inbox/stores/inboxFilterStore.test.ts
deleted file mode 100644
index 3bfc12271bae..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/stores/inboxFilterStore.test.ts
+++ /dev/null
@@ -1,89 +0,0 @@
-import type { SourceProduct } from "@posthog/shared";
-import { beforeEach, describe, expect, it, vi } from "vitest";
-
-vi.mock("@react-native-async-storage/async-storage", () => ({
- default: {
- getItem: vi.fn(),
- setItem: vi.fn(),
- removeItem: vi.fn(),
- },
-}));
-
-import { useInboxFilterStore } from "./inboxFilterStore";
-
-describe("inboxFilterStore", () => {
- beforeEach(() => {
- useInboxFilterStore.getState().resetFilters();
- });
-
- it.each<SourceProduct>(["signals_scout", "error_tracking", "sentry"])(
- "toggles %s in and out of the source filter",
- (source) => {
- const { toggleSourceProduct } = useInboxFilterStore.getState();
-
- toggleSourceProduct(source);
- expect(useInboxFilterStore.getState().sourceProductFilter).toEqual([
- source,
- ]);
-
- toggleSourceProduct(source);
- expect(useInboxFilterStore.getState().sourceProductFilter).toEqual([]);
- },
- );
-
- it("clears the source filter", () => {
- const { toggleSourceProduct, clearSourceProductFilter } =
- useInboxFilterStore.getState();
-
- toggleSourceProduct("github");
- toggleSourceProduct("linear");
- expect(useInboxFilterStore.getState().sourceProductFilter).toEqual([
- "github",
- "linear",
- ]);
-
- clearSourceProductFilter();
- expect(useInboxFilterStore.getState().sourceProductFilter).toEqual([]);
- });
-});
-
-const INITIAL_STATE = useInboxFilterStore.getState();
-
-describe("inboxFilterStore priority filter", () => {
- beforeEach(() => {
- useInboxFilterStore.setState(INITIAL_STATE, true);
- });
-
- it("starts empty (no priority filter)", () => {
- expect(useInboxFilterStore.getState().priorityFilter).toEqual([]);
- });
-
- it("toggles a priority on and off", () => {
- const { togglePriority } = useInboxFilterStore.getState();
-
- togglePriority("P0");
- expect(useInboxFilterStore.getState().priorityFilter).toEqual(["P0"]);
-
- togglePriority("P0");
- expect(useInboxFilterStore.getState().priorityFilter).toEqual([]);
- });
-
- it("accumulates multiple priorities", () => {
- const { togglePriority } = useInboxFilterStore.getState();
-
- togglePriority("P0");
- togglePriority("P2");
- expect(useInboxFilterStore.getState().priorityFilter).toEqual(["P0", "P2"]);
- });
-
- it("dedupes when set directly", () => {
- useInboxFilterStore.getState().setPriorityFilter(["P1", "P1", "P3"]);
- expect(useInboxFilterStore.getState().priorityFilter).toEqual(["P1", "P3"]);
- });
-
- it("clears the priority filter on reset", () => {
- useInboxFilterStore.getState().setPriorityFilter(["P0", "P1"]);
- useInboxFilterStore.getState().resetFilters();
- expect(useInboxFilterStore.getState().priorityFilter).toEqual([]);
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/inbox/stores/inboxFilterStore.ts b/products/desktop/apps/mobile/src/features/inbox/stores/inboxFilterStore.ts
deleted file mode 100644
index 1f779d7dd74a..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/stores/inboxFilterStore.ts
+++ /dev/null
@@ -1,116 +0,0 @@
-import { INBOX_PIPELINE_STATUSES } from "@posthog/core/inbox/reportFiltering";
-import type { SourceProduct } from "@posthog/shared";
-import type {
- SignalReportOrderingField,
- SignalReportPriority,
- SignalReportStatus,
-} from "@posthog/shared/domain-types";
-import AsyncStorage from "@react-native-async-storage/async-storage";
-import { create } from "zustand";
-import { createJSONStorage, persist } from "zustand/middleware";
-
-type SortField = Extract<
- SignalReportOrderingField,
- "priority" | "created_at" | "total_weight"
->;
-
-type SortDirection = "asc" | "desc";
-
-interface InboxFilterState {
- sortField: SortField;
- sortDirection: SortDirection;
- statusFilter: SignalReportStatus[];
- sourceProductFilter: SourceProduct[];
- suggestedReviewerFilter: string[];
- priorityFilter: SignalReportPriority[];
-}
-
-interface InboxFilterActions {
- setSort: (field: SortField, direction: SortDirection) => void;
- setStatusFilter: (statuses: SignalReportStatus[]) => void;
- toggleStatus: (status: SignalReportStatus) => void;
- toggleSourceProduct: (source: SourceProduct) => void;
- clearSourceProductFilter: () => void;
- toggleSuggestedReviewer: (reviewerUuid: string) => void;
- setSuggestedReviewerFilter: (reviewerUuids: string[]) => void;
- togglePriority: (priority: SignalReportPriority) => void;
- setPriorityFilter: (priorities: SignalReportPriority[]) => void;
- resetFilters: () => void;
-}
-
-type InboxFilterStore = InboxFilterState & InboxFilterActions;
-
-export const useInboxFilterStore = create<InboxFilterStore>()(
- persist(
- (set) => ({
- sortField: "priority",
- sortDirection: "asc",
- statusFilter: [...INBOX_PIPELINE_STATUSES],
- sourceProductFilter: [],
- suggestedReviewerFilter: [],
- priorityFilter: [],
-
- setSort: (sortField, sortDirection) => set({ sortField, sortDirection }),
- setStatusFilter: (statusFilter) => set({ statusFilter }),
- toggleStatus: (status) =>
- set((state) => {
- const current = state.statusFilter;
- const next = current.includes(status)
- ? current.filter((s) => s !== status)
- : [...current, status];
- // Don't allow empty — keep at least one
- return { statusFilter: next.length > 0 ? next : current };
- }),
- toggleSourceProduct: (source) =>
- set((state) => {
- const current = state.sourceProductFilter;
- const next = current.includes(source)
- ? current.filter((s) => s !== source)
- : [...current, source];
- return { sourceProductFilter: next };
- }),
- clearSourceProductFilter: () => set({ sourceProductFilter: [] }),
- toggleSuggestedReviewer: (reviewerUuid) =>
- set((state) => {
- const current = state.suggestedReviewerFilter;
- const next = current.includes(reviewerUuid)
- ? current.filter((uuid) => uuid !== reviewerUuid)
- : [...current, reviewerUuid];
- return { suggestedReviewerFilter: next };
- }),
- setSuggestedReviewerFilter: (reviewerUuids) =>
- set({
- suggestedReviewerFilter: Array.from(new Set(reviewerUuids)),
- }),
- togglePriority: (priority) =>
- set((state) => {
- const current = state.priorityFilter;
- const next = current.includes(priority)
- ? current.filter((p) => p !== priority)
- : [...current, priority];
- return { priorityFilter: next };
- }),
- setPriorityFilter: (priorities) =>
- set({ priorityFilter: Array.from(new Set(priorities)) }),
- resetFilters: () =>
- set({
- statusFilter: [...INBOX_PIPELINE_STATUSES],
- sourceProductFilter: [],
- suggestedReviewerFilter: [],
- priorityFilter: [],
- }),
- }),
- {
- name: "inbox-filter-storage",
- storage: createJSONStorage(() => AsyncStorage),
- partialize: (state) => ({
- sortField: state.sortField,
- sortDirection: state.sortDirection,
- statusFilter: state.statusFilter,
- sourceProductFilter: state.sourceProductFilter,
- suggestedReviewerFilter: state.suggestedReviewerFilter,
- priorityFilter: state.priorityFilter,
- }),
- },
- ),
-);
diff --git a/products/desktop/apps/mobile/src/features/inbox/stores/inboxStore.ts b/products/desktop/apps/mobile/src/features/inbox/stores/inboxStore.ts
deleted file mode 100644
index 32120c07a2c3..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/stores/inboxStore.ts
+++ /dev/null
@@ -1,64 +0,0 @@
-import type { SignalReportOrderingField } from "@posthog/shared/domain-types";
-import { create } from "zustand";
-
-type OrderDirection = "asc" | "desc";
-
-/** Set of report IDs the user has swiped past (skipped) this session. */
-type SkippedSet = Set<string>;
-
-interface InboxStoreState {
- /** Field used for API ordering */
- orderByField: SignalReportOrderingField;
- /** Sort direction */
- orderDirection: OrderDirection;
- /** Report IDs skipped (swiped left) during this session */
- skippedIds: SkippedSet;
- /** Index of the currently visible card in the deck */
- currentIndex: number;
- /**
- * Snapshot of the report IDs visible in the last-rendered list view, used
- * for analytics (rank + list_size) when a detail screen is opened by tapping
- * a list row.
- */
- lastVisibleReportIds: string[];
- /** Most recently opened report ID, used for `previous_report_id` on OPENED events. */
- previousOpenedReportId: string | null;
-}
-
-interface InboxStoreActions {
- setOrderByField: (field: SignalReportOrderingField) => void;
- setOrderDirection: (direction: OrderDirection) => void;
- skipReport: (reportId: string) => void;
- resetSkipped: () => void;
- setCurrentIndex: (index: number) => void;
- advanceCard: () => void;
- setLastVisibleReportIds: (ids: string[]) => void;
- setPreviousOpenedReportId: (id: string | null) => void;
-}
-
-type InboxStore = InboxStoreState & InboxStoreActions;
-
-export const useInboxStore = create<InboxStore>((set) => ({
- orderByField: "priority",
- orderDirection: "desc",
- skippedIds: new Set(),
- currentIndex: 0,
- lastVisibleReportIds: [],
- previousOpenedReportId: null,
-
- setOrderByField: (orderByField) => set({ orderByField }),
- setOrderDirection: (orderDirection) => set({ orderDirection }),
- skipReport: (reportId) =>
- set((state) => {
- const next = new Set(state.skippedIds);
- next.add(reportId);
- return { skippedIds: next };
- }),
- resetSkipped: () => set({ skippedIds: new Set(), currentIndex: 0 }),
- setCurrentIndex: (currentIndex) => set({ currentIndex }),
- advanceCard: () => set((state) => ({ currentIndex: state.currentIndex + 1 })),
- setLastVisibleReportIds: (lastVisibleReportIds) =>
- set({ lastVisibleReportIds }),
- setPreviousOpenedReportId: (previousOpenedReportId) =>
- set({ previousOpenedReportId }),
-}));
diff --git a/products/desktop/apps/mobile/src/features/inbox/utils.test.ts b/products/desktop/apps/mobile/src/features/inbox/utils.test.ts
deleted file mode 100644
index 8433219dd09c..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/utils.test.ts
+++ /dev/null
@@ -1,344 +0,0 @@
-import { buildInboxViewedProperties } from "@posthog/core/inbox/engagement";
-import {
- buildArchiveListOrdering,
- buildPriorityFilterParam,
- buildSignalReportListOrdering,
- INBOX_PIPELINE_STATUSES,
-} from "@posthog/core/inbox/reportFiltering";
-import { isRestorableReport } from "@posthog/core/inbox/reportMembership";
-import { formatSignalReportSummaryMarkdown } from "@posthog/core/inbox/reportPresentation";
-import { dismissalReasonLabel } from "@posthog/shared";
-import type {
- Signal,
- SignalReport,
- SignalReportOrderingField,
- SignalReportStatus,
-} from "@posthog/shared/domain-types";
-import { describe, expect, it } from "vitest";
-import { sourceLine } from "./utils";
-
-function signal(source_product: string, source_type: string): Signal {
- return {
- signal_id: "s1",
- content: "",
- source_product,
- source_type,
- source_id: "id",
- weight: 1,
- timestamp: "",
- extra: {},
- };
-}
-
-function buildMobileInboxViewedProperties(
- reports: SignalReport[],
- totalCount: number,
- filters: {
- sourceProductFilter: string[];
- statusFilter: readonly SignalReportStatus[];
- suggestedReviewerFilter: string[];
- priorityFilter: string[];
- defaultStatusFilter: readonly SignalReportStatus[];
- },
-) {
- return buildInboxViewedProperties({
- visibleReports: reports,
- totalCount,
- filters: { surface: "mobile", ...filters },
- });
-}
-
-function makeReport(
- partial: Partial<SignalReport> & Pick<SignalReport, "id">,
-): SignalReport {
- return {
- title: null,
- summary: null,
- status: "ready",
- total_weight: 0,
- signal_count: 0,
- created_at: "2026-01-01T00:00:00Z",
- updated_at: "2026-01-01T00:00:00Z",
- artefact_count: 0,
- ...partial,
- };
-}
-
-describe("formatSignalReportSummaryMarkdown", () => {
- it.each([
- {
- name: "puts section body on a new line after the header",
- input:
- "**What's happening:** Error tracking issue keyed on `app:dashboard_query`.",
- expected:
- "**What's happening:**\n\nError tracking issue keyed on `app:dashboard_query`.",
- },
- {
- name: "splits consecutive headers packed on one line",
- input:
- "**What's happening:** Users hit rate limits. **Root cause:** Limiters are contended. **How to resolve:** Reduce blocking.",
- expected:
- "**What's happening:**\n\nUsers hit rate limits.\n\n**Root cause:**\n\nLimiters are contended.\n\n**How to resolve:**\n\nReduce blocking.",
- },
- {
- name: "leaves already-separated headers sane",
- input:
- "**What's happening:**\n\nUsers hit rate limits.\n\n**Root cause:**\n\nLimiters are contended.",
- expected:
- "**What's happening:**\n\nUsers hit rate limits.\n\n**Root cause:**\n\nLimiters are contended.",
- },
- {
- name: "leaves content without headers unchanged",
- input: "Plain summary with no structured sections.",
- expected: "Plain summary with no structured sections.",
- },
- {
- name: "matches headers case-insensitively",
- input: "**what's happening:** lowercase header body.",
- expected: "**what's happening:**\n\nlowercase header body.",
- },
- ])("$name", ({ input, expected }) => {
- expect(formatSignalReportSummaryMarkdown(input)).toBe(expected);
- });
-});
-
-describe("buildInboxViewedProperties", () => {
- it("emits zero counts for an empty list", () => {
- const props = buildMobileInboxViewedProperties([], 0, {
- sourceProductFilter: [],
- statusFilter: INBOX_PIPELINE_STATUSES,
- suggestedReviewerFilter: [],
- priorityFilter: [],
- defaultStatusFilter: INBOX_PIPELINE_STATUSES,
- });
- expect(props).toMatchObject({
- report_count: 0,
- total_count: 0,
- ready_count: 0,
- has_active_filters: false,
- is_empty: true,
- priority_p0_count: 0,
- priority_p1_count: 0,
- priority_p2_count: 0,
- priority_p3_count: 0,
- priority_p4_count: 0,
- priority_unknown_count: 0,
- actionability_immediately_actionable_count: 0,
- actionability_requires_human_input_count: 0,
- actionability_not_actionable_count: 0,
- actionability_unknown_count: 0,
- });
- });
-
- it("breaks visible reports down by priority and actionability", () => {
- const reports: SignalReport[] = [
- makeReport({
- id: "1",
- priority: "P0",
- actionability: "immediately_actionable",
- status: "ready",
- }),
- makeReport({
- id: "2",
- priority: "P2",
- actionability: "requires_human_input",
- status: "ready",
- }),
- makeReport({
- id: "3",
- priority: "P2",
- actionability: "not_actionable",
- status: "potential",
- }),
- makeReport({ id: "4", status: "failed" }),
- ];
-
- const props = buildMobileInboxViewedProperties(reports, 4, {
- sourceProductFilter: [],
- statusFilter: INBOX_PIPELINE_STATUSES,
- suggestedReviewerFilter: [],
- priorityFilter: [],
- defaultStatusFilter: INBOX_PIPELINE_STATUSES,
- });
-
- expect(props.report_count).toBe(4);
- expect(props.total_count).toBe(4);
- expect(props.ready_count).toBe(2);
- expect(props.priority_p0_count).toBe(1);
- expect(props.priority_p2_count).toBe(2);
- expect(props.priority_unknown_count).toBe(1);
- expect(props.actionability_immediately_actionable_count).toBe(1);
- expect(props.actionability_requires_human_input_count).toBe(1);
- expect(props.actionability_not_actionable_count).toBe(1);
- expect(props.actionability_unknown_count).toBe(1);
- });
-
- it("marks filters active when any of status/source/reviewer/priority differs from defaults", () => {
- const narrowed = buildMobileInboxViewedProperties([], 0, {
- sourceProductFilter: [],
- statusFilter: ["ready"],
- suggestedReviewerFilter: [],
- priorityFilter: [],
- defaultStatusFilter: INBOX_PIPELINE_STATUSES,
- });
- expect(narrowed.has_active_filters).toBe(true);
- expect(narrowed.status_filter_count).toBe(1);
-
- const sourced = buildMobileInboxViewedProperties([], 0, {
- sourceProductFilter: ["error_tracking"],
- statusFilter: INBOX_PIPELINE_STATUSES,
- suggestedReviewerFilter: [],
- priorityFilter: [],
- defaultStatusFilter: INBOX_PIPELINE_STATUSES,
- });
- expect(sourced.has_active_filters).toBe(true);
- expect(sourced.source_product_filter).toEqual(["error_tracking"]);
-
- const reviewer = buildMobileInboxViewedProperties([], 0, {
- sourceProductFilter: [],
- statusFilter: INBOX_PIPELINE_STATUSES,
- suggestedReviewerFilter: ["uuid-1"],
- priorityFilter: [],
- defaultStatusFilter: INBOX_PIPELINE_STATUSES,
- });
- expect(reviewer.has_active_filters).toBe(true);
-
- const prioritized = buildMobileInboxViewedProperties([], 0, {
- sourceProductFilter: [],
- statusFilter: INBOX_PIPELINE_STATUSES,
- suggestedReviewerFilter: [],
- priorityFilter: ["P0"],
- defaultStatusFilter: INBOX_PIPELINE_STATUSES,
- });
- expect(prioritized.has_active_filters).toBe(true);
- });
-
- it("treats a reordered default status set as not filtered", () => {
- const props = buildMobileInboxViewedProperties([], 0, {
- sourceProductFilter: [],
- statusFilter: [...INBOX_PIPELINE_STATUSES].reverse(),
- suggestedReviewerFilter: [],
- priorityFilter: [],
- defaultStatusFilter: INBOX_PIPELINE_STATUSES,
- });
- expect(props.has_active_filters).toBe(false);
- });
-});
-
-describe("buildSignalReportListOrdering", () => {
- it.each([
- {
- field: "priority" as SignalReportOrderingField,
- direction: "desc" as const,
- expected: "status,-priority,-created_at",
- },
- {
- field: "priority" as SignalReportOrderingField,
- direction: "asc" as const,
- expected: "status,priority,-created_at",
- },
- {
- field: "signal_count" as SignalReportOrderingField,
- direction: "desc" as const,
- expected: "status,-signal_count,priority",
- },
- {
- field: "total_weight" as SignalReportOrderingField,
- direction: "asc" as const,
- expected: "status,total_weight,priority",
- },
- {
- field: "created_at" as SignalReportOrderingField,
- direction: "desc" as const,
- expected: "status,-created_at,priority",
- },
- {
- field: "updated_at" as SignalReportOrderingField,
- direction: "asc" as const,
- expected: "status,updated_at,priority",
- },
- ])(
- "orders $field $direction as $expected",
- ({ field, direction, expected }) => {
- expect(buildSignalReportListOrdering(field, direction)).toBe(expected);
- },
- );
-});
-
-describe("buildPriorityFilterParam", () => {
- it.each([
- {
- name: "returns undefined for an empty selection",
- input: [],
- expected: undefined,
- },
- {
- name: "joins selected priorities with commas",
- input: ["P0", "P2"] as const,
- expected: "P0,P2",
- },
- {
- name: "dedupes repeated priorities",
- input: ["P1", "P1", "P3"] as const,
- expected: "P1,P3",
- },
- ])("$name", ({ input, expected }) => {
- expect(buildPriorityFilterParam([...input])).toBe(expected);
- });
-});
-
-describe("buildArchiveListOrdering", () => {
- it.each([
- { direction: "desc" as const, expected: "-updated_at" },
- { direction: "asc" as const, expected: "updated_at" },
- ])(
- "sorts by field without a status prefix ($direction)",
- ({ direction, expected }) => {
- expect(buildArchiveListOrdering("updated_at", direction)).toBe(expected);
- },
- );
-});
-
-describe("isRestorableReport", () => {
- it.each([
- { status: "suppressed" as SignalReportStatus, expected: true },
- { status: "resolved" as SignalReportStatus, expected: false },
- { status: "ready" as SignalReportStatus, expected: false },
- { status: "deleted" as SignalReportStatus, expected: false },
- ])("is $expected for $status", ({ status, expected }) => {
- expect(isRestorableReport({ status })).toBe(expected);
- });
-});
-
-describe("dismissalReasonLabel", () => {
- it.each([
- { value: "analysis_wrong", expected: "Agent's analysis is wrong" },
- { value: "other", expected: "Something else…" },
- { value: "totally_unknown_code", expected: "totally_unknown_code" },
- ])("maps $value", ({ value, expected }) => {
- expect(dismissalReasonLabel(value)).toBe(expected);
- });
-});
-
-describe("sourceLine", () => {
- it.each([
- {
- product: "error_tracking",
- type: "issue_created",
- expected: "Error tracking · New issue",
- },
- { product: "sentry", type: "issue", expected: "Sentry · issue" },
- {
- product: "conversations",
- type: "ticket",
- expected: "Conversations · Ticket",
- },
- {
- product: "mystery_source",
- type: "thing",
- expected: "mystery source · thing",
- },
- ])("labels $product", ({ product, type, expected }) => {
- expect(sourceLine(signal(product, type))).toBe(expected);
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/inbox/utils.ts b/products/desktop/apps/mobile/src/features/inbox/utils.ts
deleted file mode 100644
index be66132ebb29..000000000000
--- a/products/desktop/apps/mobile/src/features/inbox/utils.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-import {
- EXTERNAL_INBOX_SOURCE_BY_PRODUCT,
- type SourceProduct,
-} from "@posthog/shared";
-import type { Signal } from "@posthog/shared/domain-types";
-import { differenceInHours, format, formatDistanceToNow } from "date-fns";
-
-const ERROR_TRACKING_TYPE_LABELS: Record<string, string> = {
- issue_created: "New issue",
- issue_reopened: "Issue reopened",
- issue_spiking: "Volume spike",
-};
-
-export function sourceLine(signal: Signal): string {
- const { source_product, source_type } = signal;
- if (source_product === "error_tracking") {
- const label =
- ERROR_TRACKING_TYPE_LABELS[source_type] ?? source_type.replace(/_/g, " ");
- return `Error tracking · ${label}`;
- }
- if (source_product === "session_replay" && source_type === "session_problem")
- return "Session replay · Session problem";
- if (source_product === "llm_analytics" && source_type === "evaluation")
- return "AI observability · Evaluation";
- if (source_product === "conversations" && source_type === "ticket")
- return "Conversations · Ticket";
- if (source_product === "zendesk" && source_type === "ticket")
- return "Zendesk · Ticket";
- if (source_product === "github" && source_type === "issue")
- return "GitHub · Issue";
- if (source_product === "linear" && source_type === "issue")
- return "Linear · Issue";
- if (
- source_product === "signals_scout" &&
- source_type === "cross_source_issue"
- )
- return "Scout · Cross-source issue";
- if (source_product === "signals_scout") return "Scout";
- if (source_product === "health_checks" && source_type === "health_issue")
- return "Health checks · Issue";
- const warehouseSource =
- EXTERNAL_INBOX_SOURCE_BY_PRODUCT[source_product as SourceProduct];
- const product = warehouseSource?.label ?? source_product.replace(/_/g, " ");
- return `${product} · ${source_type.replace(/_/g, " ")}`;
-}
-/** Relative time for the last day, absolute "MMM d" beyond it. */
-export function formatReportTimestamp(date: Date): string {
- return differenceInHours(new Date(), date) < 24
- ? formatDistanceToNow(date, { addSuffix: true })
- : format(date, "MMM d");
-}
diff --git a/products/desktop/apps/mobile/src/features/mcp/components/FloatingMcpHeader.tsx b/products/desktop/apps/mobile/src/features/mcp/components/FloatingMcpHeader.tsx
deleted file mode 100644
index 2bff698446b7..000000000000
--- a/products/desktop/apps/mobile/src/features/mcp/components/FloatingMcpHeader.tsx
+++ /dev/null
@@ -1,89 +0,0 @@
-import { Text } from "@components/text";
-import { LinearGradient } from "expo-linear-gradient";
-import { useRouter } from "expo-router";
-import { CaretLeft, Plus } from "phosphor-react-native";
-import type { ReactNode } from "react";
-import { Pressable, View } from "react-native";
-import { useSafeAreaInsets } from "react-native-safe-area-context";
-import { toRgba, useThemeColors } from "@/lib/theme";
-
-interface FloatingMcpHeaderProps {
- title: string;
- onAddPress?: () => void;
- rightSlot?: ReactNode;
-}
-
-export function FloatingMcpHeader({
- title,
- onAddPress,
- rightSlot,
-}: FloatingMcpHeaderProps) {
- const router = useRouter();
- const insets = useSafeAreaInsets();
- const themeColors = useThemeColors();
-
- const handleBack = () => {
- if (router.canGoBack()) router.back();
- else router.replace("/tasks");
- };
-
- const fadeHeight = insets.top + 88;
-
- return (
- <View
- pointerEvents="box-none"
- className="absolute inset-x-0 top-0 z-10"
- style={{ height: fadeHeight }}
- >
- <LinearGradient
- pointerEvents="none"
- colors={[
- toRgba(themeColors.background, 1),
- toRgba(themeColors.background, 0.92),
- toRgba(themeColors.background, 0),
- ]}
- locations={[0, 0.65, 1]}
- style={{ position: "absolute", top: 0, left: 0, right: 0, bottom: 0 }}
- />
-
- <View
- className="flex-row items-center px-3"
- style={{ paddingTop: insets.top + 6, paddingBottom: 8 }}
- >
- <Pressable
- onPress={handleBack}
- hitSlop={10}
- className="h-11 w-11 items-center justify-center active:opacity-60"
- accessibilityLabel="Back"
- accessibilityRole="button"
- >
- <CaretLeft size={22} color={themeColors.gray[12]} weight="bold" />
- </Pressable>
-
- <View className="min-w-0 flex-1 items-center px-2">
- <Text
- className="font-semibold text-[17px] text-gray-12"
- numberOfLines={1}
- >
- {title}
- </Text>
- </View>
-
- <View className="h-11 w-11 items-center justify-end">
- {rightSlot ??
- (onAddPress ? (
- <Pressable
- onPress={onAddPress}
- hitSlop={10}
- className="h-11 w-11 items-center justify-center active:opacity-60"
- accessibilityLabel="Add custom server"
- accessibilityRole="button"
- >
- <Plus size={22} color={themeColors.gray[12]} weight="bold" />
- </Pressable>
- ) : null)}
- </View>
- </View>
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/mcp/components/McpAppHost.tsx b/products/desktop/apps/mobile/src/features/mcp/components/McpAppHost.tsx
deleted file mode 100644
index a92a6966e458..000000000000
--- a/products/desktop/apps/mobile/src/features/mcp/components/McpAppHost.tsx
+++ /dev/null
@@ -1,310 +0,0 @@
-import { Text } from "@components/text";
-import type { McpUiDisplayMode } from "@modelcontextprotocol/ext-apps/app-bridge";
-import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
-import { isSafeExternalUrl, parseMcpToolName } from "@posthog/shared";
-import * as WebBrowser from "expo-web-browser";
-import { ArrowsIn, ArrowsOut, Warning } from "phosphor-react-native";
-import { useCallback, useMemo, useRef, useState } from "react";
-import {
- ActivityIndicator,
- Modal,
- Pressable,
- StyleSheet,
- useColorScheme,
- View,
-} from "react-native";
-import { useSafeAreaInsets } from "react-native-safe-area-context";
-import WebView, { type WebViewMessageEvent } from "react-native-webview";
-import { logger } from "@/lib/logger";
-import { useThemeColors } from "@/lib/theme";
-import { useMcpInstallations } from "../hooks";
-import { sandboxProxyHtml } from "../sandbox/sandboxProxyHtml";
-import { useMcpUiResource } from "../sandbox/useMcpUiResource";
-import { type Phase, useMobileAppBridge } from "../sandbox/useMobileAppBridge";
-import { getMcpConnectionManager } from "../service";
-
-interface McpAppHostProps {
- /** Raw tool name from the agent — `mcp__<server>__<tool>`. */
- rawToolName: string;
- /** Args the agent sent to the tool, if any. */
- toolArgs?: Record<string, unknown>;
- /** The tool result the agent already received, if completed. */
- toolResult?: unknown;
- status: "pending" | "running" | "completed" | "error";
-}
-
-const log = logger.scope("McpAppHost");
-
-const INLINE_MIN_HEIGHT = 180;
-const INLINE_MAX_HEIGHT = 520;
-
-function asCallToolResult(value: unknown): CallToolResult | null {
- if (!value || typeof value !== "object") return null;
- const v = value as { content?: unknown };
- if (!Array.isArray(v.content)) return null;
- return value as CallToolResult;
-}
-
-export function McpAppHost(props: McpAppHostProps) {
- const themeColors = useThemeColors();
- const scheme = useColorScheme();
- const isDarkMode = scheme === "dark";
- const insets = useSafeAreaInsets();
-
- const parsed = useMemo(
- () => parseMcpToolName(props.rawToolName),
- [props.rawToolName],
- );
-
- const installations = useMcpInstallations();
- const installation = useMemo(() => {
- if (!parsed) return null;
- return installations.data?.find((i) => i.name === parsed.server) ?? null;
- }, [installations.data, parsed]);
-
- const uiResource = useMcpUiResource({
- installation,
- toolName: parsed?.tool ?? "",
- });
-
- const webViewRef = useRef<WebView | null>(null);
- const [webViewWidth, setWebViewWidth] = useState(0);
- const [phase, setPhase] = useState<Phase>("loading");
- const [displayMode, setDisplayMode] = useState<McpUiDisplayMode>("inline");
- const [iframeHeight, setIframeHeight] = useState(INLINE_MIN_HEIGHT);
-
- const handleProxyToolCall = useCallback(
- async (args: {
- serverName: string;
- toolName: string;
- args?: Record<string, unknown>;
- }) => {
- if (!installation) {
- throw new Error("MCP installation unavailable");
- }
- return getMcpConnectionManager().callTool({
- installationId: installation.id,
- serverName: installation.name,
- proxyUrl: installation.proxy_url,
- toolName: args.toolName,
- arguments: args.args,
- });
- },
- [installation],
- );
-
- const handleProxyResourceRead = useCallback(
- async (args: { serverName: string; uri: string }) => {
- if (!installation) {
- throw new Error("MCP installation unavailable");
- }
- return getMcpConnectionManager().readResource({
- installationId: installation.id,
- serverName: installation.name,
- proxyUrl: installation.proxy_url,
- uri: args.uri,
- });
- },
- [installation],
- );
-
- const handleOpenLink = useCallback(async (args: { url: string }) => {
- if (!isSafeExternalUrl(args.url)) {
- log.warn("Blocked external URL with unsafe scheme", args.url);
- return;
- }
- await WebBrowser.openBrowserAsync(args.url);
- }, []);
-
- const { handleWebViewMessage } = useMobileAppBridge({
- webViewRef,
- uiResource: uiResource.data?.resource ?? null,
- serverName: parsed?.server ?? "",
- toolDefinition: uiResource.data?.tool ?? null,
- toolInput: props.toolArgs ?? null,
- existingToolResult:
- props.status === "completed" || props.status === "error"
- ? asCallToolResult(props.toolResult)
- : null,
- themeColors,
- isDarkMode,
- displayMode,
- containerWidth: webViewWidth,
- safeAreaInsets: insets,
- onPhaseChange: setPhase,
- onSizeChange: setIframeHeight,
- onDisplayModeChange: setDisplayMode,
- proxyToolCall: handleProxyToolCall,
- proxyResourceRead: handleProxyResourceRead,
- openLink: handleOpenLink,
- });
-
- const onMessage = useCallback(
- (event: WebViewMessageEvent) => {
- handleWebViewMessage(event.nativeEvent.data);
- },
- [handleWebViewMessage],
- );
-
- if (!parsed) {
- return null;
- }
-
- if (installations.isPending) {
- return <LoadingCard themeColors={themeColors} message="Loading…" />;
- }
-
- if (!installation) {
- return (
- <ErrorCard
- themeColors={themeColors}
- message={`No installed MCP server named "${parsed.serverName}"`}
- />
- );
- }
-
- if (uiResource.isError) {
- return (
- <ErrorCard
- themeColors={themeColors}
- message={`Couldn't load MCP UI: ${uiResource.error?.message ?? "unknown error"}`}
- />
- );
- }
-
- if (uiResource.isPending) {
- return <LoadingCard themeColors={themeColors} message="Connecting…" />;
- }
-
- if (!uiResource.data) {
- // Tool doesn't expose a UI resource — render nothing and fall back to
- // the parent's default tool view.
- return null;
- }
-
- const inlineHeight = Math.min(
- Math.max(iframeHeight, INLINE_MIN_HEIGHT),
- INLINE_MAX_HEIGHT,
- );
-
- const webView = (
- <View
- onLayout={(e) => setWebViewWidth(e.nativeEvent.layout.width)}
- className="overflow-hidden rounded-lg border border-gray-5 bg-card"
- style={{
- height: displayMode === "fullscreen" ? "100%" : inlineHeight,
- }}
- >
- <WebView
- ref={webViewRef}
- originWhitelist={["*"]}
- source={{ html: sandboxProxyHtml }}
- onMessage={onMessage}
- javaScriptEnabled
- domStorageEnabled
- allowsInlineMediaPlayback
- scrollEnabled
- setSupportMultipleWindows={false}
- // Allow file-less iframe via document.write inside the sandbox proxy.
- mixedContentMode="always"
- style={{ backgroundColor: "transparent" }}
- />
- {phase !== "initialized" && phase !== "error" ? (
- <View
- pointerEvents="none"
- style={[
- StyleSheet.absoluteFillObject,
- { alignItems: "center", justifyContent: "center" },
- ]}
- >
- <ActivityIndicator color={themeColors.accent[9]} />
- </View>
- ) : null}
- </View>
- );
-
- return (
- <View className="mb-2">
- <View className="mb-1 flex-row items-center justify-between">
- <Text className="text-[12px] text-gray-10" numberOfLines={1}>
- {parsed.serverName} · {parsed.toolName}
- </Text>
- <Pressable
- onPress={() =>
- setDisplayMode(
- displayMode === "fullscreen" ? "inline" : "fullscreen",
- )
- }
- hitSlop={8}
- className="active:opacity-60"
- >
- {displayMode === "fullscreen" ? (
- <ArrowsIn size={16} color={themeColors.gray[11]} />
- ) : (
- <ArrowsOut size={16} color={themeColors.gray[11]} />
- )}
- </Pressable>
- </View>
-
- {displayMode === "fullscreen" ? (
- <Modal
- visible
- animationType="slide"
- presentationStyle="fullScreen"
- onRequestClose={() => setDisplayMode("inline")}
- >
- <View
- className="flex-1 bg-background"
- style={{ paddingTop: insets.top }}
- >
- <View className="flex-row items-center justify-between px-4 pb-2">
- <Text className="font-semibold text-[16px] text-gray-12">
- {parsed.toolName}
- </Text>
- <Pressable
- onPress={() => setDisplayMode("inline")}
- hitSlop={8}
- className="active:opacity-60"
- >
- <ArrowsIn size={20} color={themeColors.gray[12]} />
- </Pressable>
- </View>
- <View className="flex-1 px-3 pb-4">{webView}</View>
- </View>
- </Modal>
- ) : (
- webView
- )}
- </View>
- );
-}
-
-function LoadingCard({
- themeColors,
- message,
-}: {
- themeColors: ReturnType<typeof useThemeColors>;
- message: string;
-}) {
- return (
- <View className="mb-2 items-center rounded-lg border border-gray-5 bg-card p-4">
- <ActivityIndicator color={themeColors.accent[9]} />
- <Text className="mt-2 text-[13px] text-gray-11">{message}</Text>
- </View>
- );
-}
-
-function ErrorCard({
- themeColors,
- message,
-}: {
- themeColors: ReturnType<typeof useThemeColors>;
- message: string;
-}) {
- return (
- <View className="mb-2 flex-row items-start gap-2 rounded-lg border border-gray-5 bg-card p-3">
- <Warning size={16} color={themeColors.status.error} />
- <Text className="flex-1 text-[13px] text-gray-12">{message}</Text>
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/mcp/components/McpServerRow.tsx b/products/desktop/apps/mobile/src/features/mcp/components/McpServerRow.tsx
deleted file mode 100644
index eaa165ea4751..000000000000
--- a/products/desktop/apps/mobile/src/features/mcp/components/McpServerRow.tsx
+++ /dev/null
@@ -1,150 +0,0 @@
-import { Text } from "@components/text";
-import type {
- McpRecommendedServer,
- McpServerInstallation,
-} from "@posthog/api-client/types";
-import { CaretRight, Lock, Warning } from "phosphor-react-native";
-import type { ReactNode } from "react";
-import { Pressable, View } from "react-native";
-import { useThemeColors } from "@/lib/theme";
-import { isStdioMcpServer } from "../presentation";
-import { ServerIcon } from "./ServerIcon";
-
-interface McpServerRowProps {
- title: string;
- subtitle?: string;
- description?: string;
- authType?: "api_key" | "oauth" | "none";
- badge?: ReactNode;
- isStdio?: boolean;
- needsReauth?: boolean;
- installed?: boolean;
- iconDomain?: string | null;
- serverUrl?: string | null;
- onPress: () => void;
-}
-
-function authBadge(auth?: "api_key" | "oauth" | "none") {
- if (auth === "oauth") return "OAuth";
- if (auth === "api_key") return "API key";
- return null;
-}
-
-export function McpServerRow({
- title,
- subtitle,
- description,
- authType,
- badge,
- isStdio,
- needsReauth,
- installed,
- iconDomain,
- serverUrl,
- onPress,
-}: McpServerRowProps) {
- const themeColors = useThemeColors();
- const auth = authBadge(authType);
-
- return (
- <Pressable
- onPress={onPress}
- className="flex-row items-center gap-3 border-gray-5 border-b bg-card px-4 py-3 active:bg-gray-2"
- >
- <ServerIcon iconDomain={iconDomain} serverUrl={serverUrl} size={36} />
- <View className="min-w-0 flex-1">
- <View className="flex-row items-center gap-2">
- <Text
- className="font-semibold text-[15px] text-gray-12"
- numberOfLines={1}
- >
- {title}
- </Text>
- {installed ? (
- <View className="rounded bg-accent-3 px-1.5 py-0.5">
- <Text className="font-medium text-[10px] text-accent-11 uppercase">
- Installed
- </Text>
- </View>
- ) : null}
- {isStdio ? (
- <View className="rounded bg-gray-3 px-1.5 py-0.5">
- <Text className="font-medium text-[10px] text-gray-11 uppercase">
- Desktop only
- </Text>
- </View>
- ) : null}
- {needsReauth ? (
- <View className="flex-row items-center gap-1 rounded bg-card px-1.5 py-0.5">
- <Warning size={10} color={themeColors.status.warning} />
- <Text className="font-medium text-[10px] text-status-warning uppercase">
- Reauth
- </Text>
- </View>
- ) : null}
- {badge}
- </View>
- {subtitle ? (
- <Text className="mt-0.5 text-[12px] text-gray-10" numberOfLines={1}>
- {subtitle}
- </Text>
- ) : null}
- {description ? (
- <Text
- className="mt-0.5 text-[12px] text-gray-11 leading-snug"
- numberOfLines={2}
- >
- {description}
- </Text>
- ) : null}
- </View>
- <View className="flex-row items-center gap-1">
- {auth ? (
- <View className="flex-row items-center gap-1 rounded bg-gray-3 px-1.5 py-0.5">
- {authType === "oauth" ? (
- <Lock size={10} color={themeColors.gray[11]} />
- ) : null}
- <Text className="font-medium text-[10px] text-gray-11 uppercase">
- {auth}
- </Text>
- </View>
- ) : null}
- <CaretRight size={14} color={themeColors.gray[10]} />
- </View>
- </Pressable>
- );
-}
-
-export function recommendedToRowProps(
- template: McpRecommendedServer,
- installedNames: Set<string>,
- onPress: (template: McpRecommendedServer) => void,
-): McpServerRowProps {
- return {
- title: template.name,
- description: template.description,
- authType: template.auth_type,
- isStdio: isStdioMcpServer(template),
- installed: installedNames.has(template.name),
- iconDomain: template.icon_domain,
- serverUrl: template.url,
- onPress: () => onPress(template),
- };
-}
-
-export function installationToRowProps(
- installation: McpServerInstallation,
- onPress: (installation: McpServerInstallation) => void,
-): McpServerRowProps {
- return {
- title: installation.display_name || installation.name,
- subtitle: installation.url,
- authType: installation.auth_type,
- isStdio: isStdioMcpServer(installation),
- needsReauth: installation.needs_reauth,
- installed: true,
- iconDomain: installation.icon_domain,
- serverUrl: installation.url,
- onPress: () => onPress(installation),
- };
-}
diff --git a/products/desktop/apps/mobile/src/features/mcp/components/ServerIcon.tsx b/products/desktop/apps/mobile/src/features/mcp/components/ServerIcon.tsx
deleted file mode 100644
index ccfb78feb785..000000000000
--- a/products/desktop/apps/mobile/src/features/mcp/components/ServerIcon.tsx
+++ /dev/null
@@ -1,81 +0,0 @@
-import { useColorScheme } from "nativewind";
-import { PuzzlePiece } from "phosphor-react-native";
-import { useState } from "react";
-import { Image, View } from "react-native";
-import { useAuthStore } from "@/features/auth";
-import { useThemeColors } from "@/lib/theme";
-import { iconDomainFromServerUrl } from "../iconDomain";
-
-interface ServerIconProps {
- /** The template's brand domain (`icon_domain`). Falls back to deriving one from serverUrl. */
- iconDomain?: string | null;
- /** The MCP server URL — lets custom installs without a template still get a brand icon. */
- serverUrl?: string | null;
- size?: number;
- className?: string;
-}
-
-/**
- * Renders the brand logo for an MCP server through the authenticated logo.dev
- * icon proxy (`mcp_servers/icon/`), keyed by the template's `icon_domain` with
- * a best-effort domain derived from the server URL as fallback. Falls back to
- * a generic plug glyph when no domain resolves or the proxy has no icon (404).
- */
-export function ServerIcon({
- iconDomain,
- serverUrl,
- size = 32,
- className,
-}: ServerIconProps) {
- const themeColors = useThemeColors();
- const { colorScheme } = useColorScheme();
- const oauthAccessToken = useAuthStore((state) => state.oauthAccessToken);
- const cloudRegion = useAuthStore((state) => state.cloudRegion);
- const projectId = useAuthStore((state) => state.projectId);
- const getCloudUrlFromRegion = useAuthStore(
- (state) => state.getCloudUrlFromRegion,
- );
-
- const domain = iconDomain || iconDomainFromServerUrl(serverUrl);
- // logo.dev picks the logo variant suited to the active background theme.
- const theme = colorScheme === "dark" ? "dark" : "light";
- // Failure latches per (domain, theme) — the unit the request URL varies
- // over — so a transient failure in one theme doesn't blank the other and a
- // theme flip retries.
- const iconCacheKey = `${domain}|${theme}`;
- const [failedIconKey, setFailedIconKey] = useState<string | null>(null);
-
- const iconUrl =
- domain &&
- oauthAccessToken &&
- cloudRegion &&
- projectId &&
- failedIconKey !== iconCacheKey
- ? `${getCloudUrlFromRegion(cloudRegion)}/api/environments/${projectId}/mcp_servers/icon/?domain=${encodeURIComponent(domain)}&theme=${theme}`
- : null;
-
- return (
- <View
- className={`shrink-0 items-center justify-center overflow-hidden rounded-md bg-card ${className ?? ""}`}
- style={{ width: size, height: size }}
- >
- {iconUrl ? (
- <Image
- source={{
- uri: iconUrl,
- headers: { Authorization: `Bearer ${oauthAccessToken}` },
- }}
- style={{ width: size, height: size }}
- resizeMode="contain"
- onError={() => setFailedIconKey(iconCacheKey)}
- />
- ) : (
- <PuzzlePiece
- size={Math.round(size * 0.55)}
- color={themeColors.gray[11]}
- weight="bold"
- />
- )}
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/mcp/hooks.ts b/products/desktop/apps/mobile/src/features/mcp/hooks.ts
deleted file mode 100644
index 6d6f07756e8d..000000000000
--- a/products/desktop/apps/mobile/src/features/mcp/hooks.ts
+++ /dev/null
@@ -1,144 +0,0 @@
-import type {
- InstallCustomMcpServerOptions,
- InstallMcpTemplateOptions,
- McpApprovalState,
- UpdateMcpServerInstallationOptions,
-} from "@posthog/api-client/types";
-import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
-import { getPostHogApiClient } from "@/lib/posthogApiClient";
-
-const mcpKeys = {
- all: ["mcp"] as const,
- marketplace: () => [...mcpKeys.all, "marketplace"] as const,
- installations: () => [...mcpKeys.all, "installations"] as const,
- tools: (installationId: string) =>
- [...mcpKeys.all, "tools", installationId] as const,
-};
-
-export function useMcpMarketplace() {
- return useQuery({
- queryKey: mcpKeys.marketplace(),
- queryFn: () => getPostHogApiClient().getMcpServers(),
- staleTime: 5 * 60 * 1000,
- });
-}
-
-export function useMcpInstallations() {
- return useQuery({
- queryKey: mcpKeys.installations(),
- queryFn: () => getPostHogApiClient().getMcpServerInstallations(),
- staleTime: 30 * 1000,
- });
-}
-
-export function useMcpInstallationTools(installationId: string | null) {
- return useQuery({
- queryKey: mcpKeys.tools(installationId ?? ""),
- queryFn: () =>
- getPostHogApiClient().getMcpInstallationTools(installationId as string),
- enabled: !!installationId,
- staleTime: 30 * 1000,
- });
-}
-
-function invalidateInstallations(
- queryClient: ReturnType<typeof useQueryClient>,
-) {
- queryClient.invalidateQueries({ queryKey: mcpKeys.installations() });
-}
-
-export function useInstallCustomMcpServer() {
- const queryClient = useQueryClient();
- return useMutation({
- mutationFn: (options: InstallCustomMcpServerOptions) =>
- getPostHogApiClient().installCustomMcpServer(options),
- onSuccess: () => invalidateInstallations(queryClient),
- });
-}
-
-export function useInstallMcpTemplate() {
- const queryClient = useQueryClient();
- return useMutation({
- mutationFn: (options: InstallMcpTemplateOptions) =>
- getPostHogApiClient().installMcpTemplate(options),
- onSuccess: () => invalidateInstallations(queryClient),
- });
-}
-
-export function useUpdateMcpServerInstallation() {
- const queryClient = useQueryClient();
- return useMutation({
- mutationFn: ({
- installationId,
- updates,
- }: {
- installationId: string;
- updates: UpdateMcpServerInstallationOptions;
- }) =>
- getPostHogApiClient().updateMcpServerInstallation(
- installationId,
- updates,
- ),
- onSuccess: () => invalidateInstallations(queryClient),
- });
-}
-
-export function useUninstallMcpServer() {
- const queryClient = useQueryClient();
- return useMutation({
- mutationFn: (installationId: string) =>
- getPostHogApiClient().uninstallMcpServer(installationId),
- onSuccess: () => invalidateInstallations(queryClient),
- });
-}
-
-export function useAuthorizeMcpInstallation() {
- return useMutation({
- mutationFn: (args: {
- installation_id: string;
- install_source?: "posthog" | "posthog-code" | "posthog-mobile";
- posthog_code_callback_url?: string;
- }) => getPostHogApiClient().authorizeMcpInstallation(args),
- });
-}
-
-export function useRefreshMcpInstallationTools() {
- const queryClient = useQueryClient();
- return useMutation({
- mutationFn: (installationId: string) =>
- getPostHogApiClient().refreshMcpInstallationTools(installationId),
- onSuccess: (_, installationId) => {
- queryClient.invalidateQueries({
- queryKey: mcpKeys.tools(installationId),
- });
- invalidateInstallations(queryClient);
- },
- });
-}
-
-export function useUpdateMcpToolApproval() {
- const queryClient = useQueryClient();
- return useMutation({
- mutationFn: ({
- installationId,
- toolName,
- approval_state,
- }: {
- installationId: string;
- toolName: string;
- approval_state: McpApprovalState;
- }) =>
- getPostHogApiClient().updateMcpToolApproval(
- installationId,
- toolName,
- approval_state,
- ),
- onSuccess: (_, { installationId }) => {
- queryClient.invalidateQueries({
- queryKey: mcpKeys.tools(installationId),
- });
- },
- });
-}
-
-export const MCP_QUERY_KEYS = mcpKeys;
diff --git a/products/desktop/apps/mobile/src/features/mcp/iconDomain.test.ts b/products/desktop/apps/mobile/src/features/mcp/iconDomain.test.ts
deleted file mode 100644
index 9cdcffb78620..000000000000
--- a/products/desktop/apps/mobile/src/features/mcp/iconDomain.test.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-import { describe, expect, it } from "vitest";
-import { iconDomainFromServerUrl } from "./iconDomain";
-
-// Mirrors packages/core/src/mcp-servers/iconDomain.test.ts — the helper is
-// duplicated because mobile doesn't depend on @posthog/core.
-describe("iconDomainFromServerUrl", () => {
- it.each([
- ["strips mcp. from deep hosts", "https://mcp.linear.app/sse", "linear.app"],
- ["strips api. from deep hosts", "https://api.acme.com/mcp", "acme.com"],
- ["strips www. from deep hosts", "https://www.acme.com/mcp", "acme.com"],
- ["keeps bare brand domains", "https://notion.com/mcp", "notion.com"],
- [
- "keeps two-label hosts named like a prefix",
- "https://mcp.com/x",
- "mcp.com",
- ],
- [
- "keeps unrelated subdomains",
- "https://server.smithery.ai/mcp",
- "server.smithery.ai",
- ],
- ["lowercases the host", "https://MCP.Linear.APP/sse", "linear.app"],
- ])("%s", (_name, url, expected) => {
- expect(iconDomainFromServerUrl(url)).toBe(expected);
- });
-
- it.each([
- ["null", null],
- ["undefined", undefined],
- ["an empty string", ""],
- ["a non-URL", "not a url"],
- ["a dotless host", "https://localhost:3000/mcp"],
- ])("returns null for %s", (_name, url) => {
- expect(iconDomainFromServerUrl(url)).toBeNull();
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/mcp/iconDomain.ts b/products/desktop/apps/mobile/src/features/mcp/iconDomain.ts
deleted file mode 100644
index a5c5f89265a7..000000000000
--- a/products/desktop/apps/mobile/src/features/mcp/iconDomain.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-// Mirrors `@posthog/core/mcp-servers/iconDomain` (mobile doesn't depend on
-// @posthog/core, same as the hand-mirrored types in ./types.ts).
-
-// Machine-facing subdomains stripped when deriving a brand domain from a
-// server URL, so a custom install at https://mcp.linear.app/mcp still
-// resolves the vendor's brand (linear.app).
-const STRIPPED_SUBDOMAINS = ["mcp.", "api.", "www."];
-
-/**
- * Best-effort brand domain for an MCP server without a template-provided
- * `icon_domain`: the server URL's hostname with machine-facing subdomains
- * stripped. Null when no plausible brand domain exists (invalid URL, or a
- * dotless host like localhost).
- */
-export function iconDomainFromServerUrl(
- serverUrl: string | null | undefined,
-): string | null {
- if (!serverUrl) {
- return null;
- }
- let host: string;
- try {
- host = new URL(serverUrl).hostname.toLowerCase();
- } catch {
- return null;
- }
- for (const prefix of STRIPPED_SUBDOMAINS) {
- if (host.startsWith(prefix) && host.split(".").length >= 3) {
- return host.slice(prefix.length);
- }
- }
- return host.includes(".") ? host : null;
-}
diff --git a/products/desktop/apps/mobile/src/features/mcp/mcpUiResource.ts b/products/desktop/apps/mobile/src/features/mcp/mcpUiResource.ts
deleted file mode 100644
index f9e934bfa607..000000000000
--- a/products/desktop/apps/mobile/src/features/mcp/mcpUiResource.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-export interface McpUiResource {
- uri: string;
- html: string;
- csp?: Record<string, unknown>;
- permissions?: Record<string, Record<string, unknown>>;
-}
diff --git a/products/desktop/apps/mobile/src/features/mcp/oauth.ts b/products/desktop/apps/mobile/src/features/mcp/oauth.ts
deleted file mode 100644
index d3648678af55..000000000000
--- a/products/desktop/apps/mobile/src/features/mcp/oauth.ts
+++ /dev/null
@@ -1,114 +0,0 @@
-import type {
- InstallCustomMcpServerOptions,
- InstallMcpTemplateOptions,
- McpInstallResponse,
- McpServerInstallation,
-} from "@posthog/api-client/types";
-import * as Linking from "expo-linking";
-import * as WebBrowser from "expo-web-browser";
-import { getPostHogApiClient } from "@/lib/posthogApiClient";
-import { isMcpOAuthRedirect } from "./presentation";
-
-/** Custom URL scheme registered via app.json (`scheme: "posthog"`). The cloud
- * bounces the OAuth redirect back to this URL once the provider completes
- * auth, and `expo-linking` catches it on both iOS and Android. */
-export const OAUTH_CALLBACK_URL = "posthog://mcp-oauth/callback";
-
-const INSTALL_SOURCE = "posthog-code" as const;
-
-/**
- * Open the cloud-provided redirect URL in the system browser and wait for the
- * user to complete the OAuth dance. Resolves once the cloud bounces the
- * callback back to `OAUTH_CALLBACK_URL`, or once the user dismisses the
- * browser without completing.
- */
-async function waitForOAuthCallback(
- redirectUrl: string,
-): Promise<"completed" | "cancelled"> {
- // `openAuthSessionAsync` automatically dismisses the browser sheet on the
- // first incoming deep link matching our scheme — handy for OAuth on both
- // iOS (ASWebAuthenticationSession) and Android (Custom Tabs).
- const result = await WebBrowser.openAuthSessionAsync(
- redirectUrl,
- OAUTH_CALLBACK_URL,
- );
-
- if (result.type === "success") return "completed";
- return "cancelled";
-}
-
-/**
- * Run the install flow for a marketplace template. If the cloud responds with
- * an OAuth redirect, take the user through it and resolve once they're back.
- */
-export async function installTemplateWithOAuth(
- options: Omit<
- InstallMcpTemplateOptions,
- "install_source" | "posthog_code_callback_url"
- >,
-): Promise<McpServerInstallation | "cancelled"> {
- const response: McpInstallResponse =
- await getPostHogApiClient().installMcpTemplate({
- ...options,
- install_source: INSTALL_SOURCE,
- posthog_code_callback_url: OAUTH_CALLBACK_URL,
- });
-
- if (!isMcpOAuthRedirect(response)) return response;
-
- const outcome = await waitForOAuthCallback(response.redirect_url);
- if (outcome === "cancelled") return "cancelled";
-
- // Cloud has stored the refresh token on success — we don't get the
- // installation row back from the OAuth dance, so callers refetch the
- // installations list.
- return "cancelled";
-}
-
-/** Same as install-template, for custom servers. */
-export async function installCustomWithOAuth(
- options: Omit<
- InstallCustomMcpServerOptions,
- "install_source" | "posthog_code_callback_url"
- >,
-): Promise<McpServerInstallation | "cancelled"> {
- const response: McpInstallResponse =
- await getPostHogApiClient().installCustomMcpServer({
- ...options,
- install_source: INSTALL_SOURCE,
- posthog_code_callback_url: OAUTH_CALLBACK_URL,
- });
-
- if (!isMcpOAuthRedirect(response)) return response;
- const outcome = await waitForOAuthCallback(response.redirect_url);
- return outcome === "cancelled" ? "cancelled" : "cancelled";
-}
-
-/**
- * Trigger a re-auth flow for an installation whose OAuth token has expired
- * (cloud sets `needs_reauth: true`). Opens the cloud's authorize endpoint,
- * which returns a redirect URL, then runs the same WebBrowser session.
- */
-export async function reauthorizeInstallation(
- installationId: string,
-): Promise<"completed" | "cancelled"> {
- const { redirect_url } = await getPostHogApiClient().authorizeMcpInstallation(
- {
- installation_id: installationId,
- install_source: INSTALL_SOURCE,
- posthog_code_callback_url: OAUTH_CALLBACK_URL,
- },
- );
- return waitForOAuthCallback(redirect_url);
-}
-
-/** Subscribe to deep-link events for the OAuth callback. Mainly useful when
- * the WebBrowser session can't auto-dismiss for some reason. */
-export function onOAuthCallback(handler: (url: string) => void): {
- remove(): void;
-} {
- const subscription = Linking.addEventListener("url", ({ url }) => {
- if (url.startsWith(OAUTH_CALLBACK_URL)) handler(url);
- });
- return subscription;
-}
diff --git a/products/desktop/apps/mobile/src/features/mcp/presentation.ts b/products/desktop/apps/mobile/src/features/mcp/presentation.ts
deleted file mode 100644
index 66b3bfd895a2..000000000000
--- a/products/desktop/apps/mobile/src/features/mcp/presentation.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-export function isMcpOAuthRedirect(
- response: object,
-): response is { redirect_url: string } {
- return (
- "redirect_url" in response && typeof response.redirect_url === "string"
- );
-}
-
-export function isStdioMcpServer(server: {
- transport_type?: string | null;
-}): boolean {
- return server.transport_type === "stdio";
-}
diff --git a/products/desktop/apps/mobile/src/features/mcp/sandbox/mcpAppTheme.ts b/products/desktop/apps/mobile/src/features/mcp/sandbox/mcpAppTheme.ts
deleted file mode 100644
index 612bb880c9cd..000000000000
--- a/products/desktop/apps/mobile/src/features/mcp/sandbox/mcpAppTheme.ts
+++ /dev/null
@@ -1,113 +0,0 @@
-import type { McpUiStyles } from "@modelcontextprotocol/ext-apps/app-bridge";
-import type { ThemeColors } from "@/lib/theme";
-
-/**
- * Builds the `McpUiStyles` payload an MCP App receives at initialize / on
- * host-context-changed. Mirrors the desktop builder (apps/code/src/renderer/
- * features/mcp-apps/utils/mcp-app-theme.ts) but reads from our mobile
- * `ThemeColors` instead of computed CSS variables (which don't exist in RN).
- *
- * MCP Apps render inside a sandboxed WebView, so we hand them a minimal but
- * complete set of design tokens — they have no other access to our theme.
- */
-export function buildMcpHostStyles(
- themeColors: ThemeColors,
- isDarkMode: boolean,
-): { variables: McpUiStyles; css: { fonts: string } } {
- const variables: Record<string, string> = {
- "--color-background-primary": themeColors.background,
- "--color-background-secondary": themeColors.gray[2],
- "--color-background-tertiary": themeColors.gray[3],
- "--color-background-inverse": themeColors.gray[12],
- "--color-background-ghost": "transparent",
- "--color-background-info": themeColors.accent[3],
- "--color-background-danger": isDarkMode ? "#3b0d0d" : "#fde8e8",
- "--color-background-success": isDarkMode ? "#0f2d18" : "#dcfce7",
- "--color-background-warning": isDarkMode ? "#3a2c00" : "#fef3c7",
- "--color-background-disabled": themeColors.gray[3],
-
- "--color-text-primary": themeColors.gray[12],
- "--color-text-secondary": themeColors.gray[11],
- "--color-text-tertiary": themeColors.gray[10],
- "--color-text-inverse": themeColors.gray[1],
- "--color-text-ghost": themeColors.gray[10],
- "--color-text-info": themeColors.accent[11],
- "--color-text-danger": themeColors.status.error,
- "--color-text-success": themeColors.status.success,
- "--color-text-warning": themeColors.status.warning,
- "--color-text-disabled": themeColors.gray[6],
-
- "--color-border-primary": themeColors.gray[6],
- "--color-border-secondary": themeColors.gray[5],
- "--color-border-tertiary": themeColors.gray[3],
- "--color-border-inverse": themeColors.gray[12],
- "--color-border-ghost": "transparent",
- "--color-border-info": themeColors.accent[6],
- "--color-border-danger": themeColors.status.error,
- "--color-border-success": themeColors.status.success,
- "--color-border-warning": themeColors.status.warning,
- "--color-border-disabled": themeColors.gray[5],
-
- "--color-ring-primary": themeColors.accent[9],
- "--color-ring-secondary": themeColors.gray[6],
- "--color-ring-inverse": themeColors.gray[1],
- "--color-ring-info": themeColors.accent[9],
- "--color-ring-danger": themeColors.status.error,
- "--color-ring-success": themeColors.status.success,
- "--color-ring-warning": themeColors.status.warning,
-
- "--font-sans":
- "-apple-system, BlinkMacSystemFont, 'Open Runde', 'Segoe UI', Roboto, sans-serif",
- "--font-mono": "ui-monospace, 'JetBrains Mono', 'SF Mono', monospace",
-
- "--font-weight-normal": "400",
- "--font-weight-medium": "500",
- "--font-weight-semibold": "600",
- "--font-weight-bold": "700",
-
- "--font-text-xs-size": "12px",
- "--font-text-sm-size": "14px",
- "--font-text-md-size": "16px",
- "--font-text-lg-size": "18px",
- "--font-heading-xs-size": "18px",
- "--font-heading-sm-size": "20px",
- "--font-heading-md-size": "24px",
- "--font-heading-lg-size": "28px",
- "--font-heading-xl-size": "32px",
- "--font-heading-2xl-size": "48px",
- "--font-heading-3xl-size": "60px",
-
- "--font-text-xs-line-height": "1.5",
- "--font-text-sm-line-height": "1.5",
- "--font-text-md-line-height": "1.5",
- "--font-text-lg-line-height": "1.5",
- "--font-heading-xs-line-height": "1.3",
- "--font-heading-sm-line-height": "1.3",
- "--font-heading-md-line-height": "1.25",
- "--font-heading-lg-line-height": "1.25",
- "--font-heading-xl-line-height": "1.2",
- "--font-heading-2xl-line-height": "1.2",
- "--font-heading-3xl-line-height": "1.1",
-
- "--border-radius-xs": "2px",
- "--border-radius-sm": "4px",
- "--border-radius-md": "8px",
- "--border-radius-lg": "12px",
- "--border-radius-xl": "16px",
- "--border-radius-full": "9999px",
-
- "--border-width-regular": "1px",
-
- "--shadow-hairline": `0 0 0 1px ${themeColors.gray[6]}`,
- "--shadow-sm": "0 1px 2px rgba(0,0,0,0.05)",
- "--shadow-md":
- "0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06)",
- "--shadow-lg":
- "0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05)",
- };
-
- return {
- variables: variables as unknown as McpUiStyles,
- css: { fonts: "" },
- };
-}
diff --git a/products/desktop/apps/mobile/src/features/mcp/sandbox/sandboxProxyHtml.ts b/products/desktop/apps/mobile/src/features/mcp/sandbox/sandboxProxyHtml.ts
deleted file mode 100644
index 1104def1c0b2..000000000000
--- a/products/desktop/apps/mobile/src/features/mcp/sandbox/sandboxProxyHtml.ts
+++ /dev/null
@@ -1,127 +0,0 @@
-/**
- * Sandbox proxy HTML for mobile MCP Apps.
- *
- * Mirrors the desktop double-iframe pattern (see
- * apps/code/src/shared/mcp-sandbox-proxy.html) but routes messages through
- * `react-native-webview`'s bridge instead of `window.parent.postMessage`.
- *
- * RN host ←→ WebView (this HTML, the outer "proxy") ←→ Inner iframe (MCP App)
- *
- * Wire format on both sides is JSON-RPC, identical to desktop. The differences
- * are only in how messages cross the boundary:
- *
- * - Inbound (RN → WebView): RN calls `window.__mcpReceive(jsonString)` via
- * `webView.injectJavaScript`.
- * - Outbound (WebView → RN): the proxy calls
- * `window.ReactNativeWebView.postMessage(jsonString)`.
- *
- * The inner iframe still uses standard `window.parent.postMessage` to reach
- * the proxy — that part doesn't change.
- */
-export const sandboxProxyHtml = `<!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover">
- <style>
- html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; background: transparent; }
- iframe { border: none; width: 100%; height: 100%; display: block; }
- </style>
-</head>
-<body>
-<script>
-(function () {
- "use strict";
-
- function postToHost(data) {
- try {
- window.ReactNativeWebView.postMessage(JSON.stringify(data));
- } catch (err) {
- // Best-effort; nothing to do if the bridge is gone.
- }
- }
-
- function log() {
- var args = Array.prototype.slice.call(arguments);
- postToHost({ jsonrpc: "2.0", method: "ui/notifications/log", params: { args: args } });
- }
-
- var inner = document.createElement("iframe");
- inner.setAttribute("sandbox", "allow-scripts allow-forms");
- document.body.appendChild(inner);
-
- // contentWindow survives navigation, so an app that calls location.replace()
- // would keep the bridge. Only the first load of our srcdoc may use it.
- var appLoaded = false;
- var bridgeClosed = false;
- function onInnerLoad() {
- if (!appLoaded) {
- appLoaded = true;
- return;
- }
- bridgeClosed = true;
- }
-
- function buildAllowAttribute(permissions) {
- if (!permissions || typeof permissions !== "object") return "";
- var mapping = {
- camera: "camera",
- microphone: "microphone",
- geolocation: "geolocation",
- clipboardWrite: "clipboard-write"
- };
- return Object.keys(permissions)
- .filter(function (k) { return mapping[k] && permissions[k] != null; })
- .map(function (k) { return mapping[k] + " *"; })
- .join("; ");
- }
-
- // Inbound from RN host. The RN side injects:
- // window.__mcpReceive(JSON.stringify(message))
- window.__mcpReceive = function (jsonString) {
- var data;
- try { data = JSON.parse(jsonString); } catch (e) { return; }
- if (!data || typeof data !== "object") return;
-
- if (data.method === "ui/notifications/sandbox-resource-ready") {
- var params = data.params || {};
- if (typeof params.html === "string") {
- var allowValue = buildAllowAttribute(params.permissions);
- if (allowValue) inner.setAttribute("allow", allowValue);
-
- inner.addEventListener("load", onInnerLoad);
- inner.setAttribute("srcdoc", params.html);
- }
- return;
- }
-
- // All other host messages get relayed into the inner iframe untouched.
- if (!bridgeClosed && inner.contentWindow) {
- // An opaque origin serializes to "null", which postMessage rejects.
- inner.contentWindow.postMessage(data, "*");
- }
- };
-
- // Inner iframe → relay to RN host.
- window.addEventListener("message", function (event) {
- var data = event.data;
- if (!data || typeof data !== "object") return;
- if (event.source !== inner.contentWindow) return;
- if (bridgeClosed) return;
- postToHost(data);
- });
-
- // Tell RN we're ready. Retry a few times — RN may not have attached its
- // onMessage handler yet on first paint.
- var ready = { jsonrpc: "2.0", method: "ui/notifications/sandbox-proxy-ready", params: {} };
- var attempts = 0;
- function announce() {
- attempts++;
- postToHost(ready);
- if (attempts < 4) setTimeout(announce, 50 * attempts);
- }
- announce();
-})();
-</script>
-</body>
-</html>`;
diff --git a/products/desktop/apps/mobile/src/features/mcp/sandbox/useMcpUiResource.ts b/products/desktop/apps/mobile/src/features/mcp/sandbox/useMcpUiResource.ts
deleted file mode 100644
index 5dfb7f8117ab..000000000000
--- a/products/desktop/apps/mobile/src/features/mcp/sandbox/useMcpUiResource.ts
+++ /dev/null
@@ -1,82 +0,0 @@
-import {
- getToolUiResourceUri,
- type McpUiResourceCsp,
- RESOURCE_MIME_TYPE,
-} from "@modelcontextprotocol/ext-apps/app-bridge";
-import type { Tool } from "@modelcontextprotocol/sdk/types.js";
-import type { McpServerInstallation } from "@posthog/api-client/types";
-import { useQuery } from "@tanstack/react-query";
-import type { McpUiResource } from "../mcpUiResource";
-import { getMcpConnectionManager } from "../service";
-
-interface UseMcpUiResourceArgs {
- installation: McpServerInstallation | null;
- toolName: string;
-}
-
-interface UiResourceBundle {
- resource: McpUiResource;
- tool: Tool;
-}
-
-/**
- * Resolve the MCP App UI resource for a given installation + tool. Connects
- * to the MCP server (lazy, cached), lists its tools to find the UI URI on
- * `_meta.ui.resourceUri`, then reads the resource and returns its HTML
- * payload alongside the tool definition.
- */
-export function useMcpUiResource({
- installation,
- toolName,
-}: UseMcpUiResourceArgs) {
- return useQuery<UiResourceBundle | null>({
- queryKey: ["mcp", "ui-resource", installation?.id ?? null, toolName],
- queryFn: async () => {
- if (!installation) return null;
- const manager = getMcpConnectionManager();
- const args = {
- installationId: installation.id,
- serverName: installation.name,
- proxyUrl: installation.proxy_url,
- };
- const tool = await manager.getTool({ ...args, toolName });
- if (!tool) return null;
- const uri = getToolUiResourceUri(tool);
- if (!uri) return null;
-
- const readResult = await manager.readResource({ ...args, uri });
- const contents = readResult.contents.find((c) => c.uri === uri) as
- | (Record<string, unknown> & { uri: string })
- | undefined;
- const textValue = contents
- ? (contents as { text?: unknown }).text
- : undefined;
- const text = typeof textValue === "string" ? textValue : null;
- if (!text) return null;
-
- const mimeValue = contents
- ? (contents as { mimeType?: unknown }).mimeType
- : undefined;
- const mime = typeof mimeValue === "string" ? mimeValue : "";
- if (!mime.includes(RESOURCE_MIME_TYPE.split(";")[0])) {
- // Resource doesn't look like an MCP App profile — skip rather than
- // mount arbitrary HTML.
- return null;
- }
-
- const meta = (contents as { _meta?: Record<string, unknown> })._meta;
- const ui = (meta?.ui as Record<string, unknown>) ?? {};
- const permissions =
- (ui.permissions as Record<string, Record<string, unknown>>) ??
- undefined;
- const csp = ui.csp as McpUiResourceCsp | undefined;
-
- return {
- resource: { uri, html: text, csp, permissions },
- tool,
- };
- },
- enabled: !!installation,
- staleTime: 5 * 60 * 1000,
- });
-}
diff --git a/products/desktop/apps/mobile/src/features/mcp/sandbox/useMobileAppBridge.ts b/products/desktop/apps/mobile/src/features/mcp/sandbox/useMobileAppBridge.ts
deleted file mode 100644
index 6744f828dbeb..000000000000
--- a/products/desktop/apps/mobile/src/features/mcp/sandbox/useMobileAppBridge.ts
+++ /dev/null
@@ -1,336 +0,0 @@
-import {
- AppBridge,
- type McpUiDisplayMode,
- type McpUiHostCapabilities,
- type McpUiHostContext,
- type McpUiResourceCsp,
-} from "@modelcontextprotocol/ext-apps/app-bridge";
-import type {
- CallToolResult,
- ReadResourceResult,
- Tool,
-} from "@modelcontextprotocol/sdk/types.js";
-import { applyCspToHtml } from "@posthog/core/mcp-apps/csp";
-import { useCallback, useEffect, useRef } from "react";
-import { Platform } from "react-native";
-import type { EdgeInsets } from "react-native-safe-area-context";
-import type WebView from "react-native-webview";
-import { logger } from "@/lib/logger";
-import type { ThemeColors } from "@/lib/theme";
-import { buildMcpHostStyles } from "./mcpAppTheme";
-import { WebViewTransport } from "./webViewTransport";
-
-const log = logger.scope("mobile-mcp-app-bridge");
-
-export type Phase =
- | "loading"
- | "proxy-ready"
- | "resource-sent"
- | "initialized"
- | "error";
-
-interface UiResource {
- uri: string;
- html: string;
- csp?: McpUiResourceCsp;
- permissions?: Record<string, Record<string, unknown>>;
-}
-
-interface UseMobileAppBridgeArgs {
- webViewRef: { current: WebView | null };
- uiResource: UiResource | null | undefined;
- serverName: string;
- toolDefinition?: Tool | null;
- toolInput?: Record<string, unknown> | null;
- /** Already-completed tool result, used when remounting after the original
- * result event was missed. */
- existingToolResult?: CallToolResult | null;
- themeColors: ThemeColors;
- isDarkMode: boolean;
- displayMode: McpUiDisplayMode;
- containerWidth: number;
- safeAreaInsets: EdgeInsets;
- onPhaseChange?: (phase: Phase) => void;
- onSizeChange?: (height: number) => void;
- onDisplayModeChange?: (mode: McpUiDisplayMode) => void;
- /** Called when the app requests a tool call via `serverTools`. Round-trip
- * through the mobile MCP service. */
- proxyToolCall: (args: {
- serverName: string;
- toolName: string;
- args?: Record<string, unknown>;
- }) => Promise<CallToolResult>;
- proxyResourceRead: (args: {
- serverName: string;
- uri: string;
- }) => Promise<ReadResourceResult>;
- openLink: (args: { url: string }) => Promise<void>;
- /** Called when the app sends a `ui/message` (e.g. pre-fill chat input). */
- onAppMessage?: (text: string) => void;
-}
-
-interface UseMobileAppBridgeReturn {
- /** Call from the WebView's `onMessage` to feed incoming JSON-RPC. */
- handleWebViewMessage: (payload: string) => void;
- /** Buffer a callback until the app finishes initializing. */
- sendWhenReady: (fn: (bridge: AppBridge) => void) => void;
-}
-
-const HOST_INFO = { name: "posthog-code-mobile", version: "1.0.0" };
-
-const HOST_CAPABILITIES: McpUiHostCapabilities = {
- openLinks: {},
- serverTools: {},
- serverResources: {},
- logging: {},
- message: { text: {} },
- sandbox: {},
-};
-
-function buildInitialContext(args: UseMobileAppBridgeArgs): McpUiHostContext {
- const hostStyles = buildMcpHostStyles(args.themeColors, args.isDarkMode);
- return {
- theme: args.isDarkMode ? "dark" : "light",
- styles: { variables: hostStyles.variables, css: hostStyles.css },
- availableDisplayModes: ["inline", "fullscreen"],
- displayMode: args.displayMode,
- containerDimensions: {
- width: args.containerWidth,
- // Inline default; the WebView re-sizes after onsizechange fires.
- height: 320,
- },
- locale: "en-US",
- timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
- userAgent: `posthog-code-mobile/${Platform.OS}`,
- platform: "mobile",
- deviceCapabilities: { touch: true, hover: false },
- safeAreaInsets: {
- top: args.safeAreaInsets.top,
- right: args.safeAreaInsets.right,
- bottom: args.safeAreaInsets.bottom,
- left: args.safeAreaInsets.left,
- },
- ...(args.toolDefinition ? { toolInfo: { tool: args.toolDefinition } } : {}),
- };
-}
-
-/**
- * Manages a single `AppBridge` lifecycle bound to a WebView. Mirror of
- * desktop's `useAppBridge`, with the iframe `PostMessageTransport` swapped
- * for our `WebViewTransport` and DOM-only host context replaced with
- * React Native equivalents.
- */
-export function useMobileAppBridge(
- args: UseMobileAppBridgeArgs,
-): UseMobileAppBridgeReturn {
- const bridgeRef = useRef<AppBridge | null>(null);
- const transportRef = useRef<WebViewTransport | null>(null);
- const initializedRef = useRef(false);
- const pendingRef = useRef<Array<(bridge: AppBridge) => void>>([]);
-
- // Mutable mirror of props so handlers always read latest values.
- const latest = useRef(args);
- latest.current = args;
-
- // Build/destroy bridge when the UI resource identity changes.
- const { webViewRef, uiResource: uiResourceProp } = args;
- useEffect(() => {
- if (!uiResourceProp) return;
- // Snapshot the resource at effect time so the callback always uses the
- // value we keyed the effect on, even if `args` mutates mid-flight.
- const uiResource = uiResourceProp;
-
- let cleanedUp = false;
-
- const setup = async () => {
- try {
- const transport = new WebViewTransport(webViewRef);
-
- // Wait for the proxy to signal it's ready by capturing the
- // sandbox-proxy-ready notification on the first message.
- const ready = new Promise<void>((resolve, reject) => {
- let resolved = false;
- const previousOnError = transport.onerror;
- const previousOnMessage = transport.onmessage;
- transport.onmessage = (msg) => {
- const m = msg as { method?: string };
- if (
- !resolved &&
- m.method === "ui/notifications/sandbox-proxy-ready"
- ) {
- resolved = true;
- transport.onmessage = previousOnMessage;
- resolve();
- return;
- }
- previousOnMessage?.(msg);
- };
- transport.onerror = (err) => {
- if (!resolved) reject(err);
- previousOnError?.(err);
- };
- });
-
- await transport.start();
- transportRef.current = transport;
-
- if (cleanedUp) return;
- await ready;
- if (cleanedUp) return;
-
- latest.current.onPhaseChange?.("proxy-ready");
-
- const hostContext = buildInitialContext(latest.current);
- const bridge = new AppBridge(null, HOST_INFO, HOST_CAPABILITIES, {
- hostContext,
- });
-
- bridge.oncalltool = async (params) =>
- latest.current.proxyToolCall({
- serverName: latest.current.serverName,
- toolName: params.name,
- args: params.arguments,
- });
-
- bridge.onreadresource = async (params) =>
- latest.current.proxyResourceRead({
- serverName: latest.current.serverName,
- uri: params.uri,
- });
-
- bridge.onopenlink = async (params) => {
- await latest.current.openLink({ url: params.url });
- return {};
- };
-
- bridge.onmessage = async (params) => {
- const text = params.content
- .filter(
- (block): block is { type: "text"; text: string } =>
- block.type === "text",
- )
- .map((block) => block.text)
- .join("\n");
- if (text) latest.current.onAppMessage?.(text);
- return {};
- };
-
- bridge.onrequestdisplaymode = async (params) => {
- if (params.mode === "inline" || params.mode === "fullscreen") {
- latest.current.onDisplayModeChange?.(params.mode);
- return { mode: params.mode };
- }
- return { mode: latest.current.displayMode };
- };
-
- bridge.onsizechange = (params) => {
- if (typeof params.height === "number" && params.height > 0) {
- latest.current.onSizeChange?.(params.height);
- }
- };
-
- bridge.onloggingmessage = (params) => {
- log.info("App log", {
- server: latest.current.serverName,
- level: params.level,
- data: params.data,
- });
- };
-
- bridge.oninitialized = () => {
- if (cleanedUp) return;
- initializedRef.current = true;
- latest.current.onPhaseChange?.("initialized");
-
- if (latest.current.toolInput) {
- bridge.sendToolInput({ arguments: latest.current.toolInput });
- }
- if (latest.current.existingToolResult) {
- bridge.sendToolResult(latest.current.existingToolResult);
- }
-
- for (const fn of pendingRef.current) fn(bridge);
- pendingRef.current = [];
- };
-
- await bridge.connect(transport);
- bridgeRef.current = bridge;
-
- await bridge.sendSandboxResourceReady({
- html: applyCspToHtml(uiResource.html, uiResource.csp),
- csp: uiResource.csp,
- permissions: uiResource.permissions,
- });
-
- if (!cleanedUp) latest.current.onPhaseChange?.("resource-sent");
- } catch (err) {
- log.error("Failed to initialize mobile MCP bridge", err);
- if (!cleanedUp) latest.current.onPhaseChange?.("error");
- }
- };
-
- void setup();
-
- return () => {
- cleanedUp = true;
- const bridge = bridgeRef.current;
- const transport = transportRef.current;
- bridgeRef.current = null;
- transportRef.current = null;
- initializedRef.current = false;
- pendingRef.current = [];
- if (bridge) {
- bridge.teardownResource({}).catch(() => {});
- bridge.close().catch(() => {});
- }
- if (transport) {
- transport.close().catch(() => {});
- }
- };
- // Re-run when the resource object identity changes (React Query gives a
- // stable reference per cache key). Everything else flows through
- // `latest.current` inside the handlers.
- }, [uiResourceProp, webViewRef]);
-
- // Host context changes (theme, display mode, container size, safe areas).
- useEffect(() => {
- if (!initializedRef.current || !bridgeRef.current) return;
- const bridge = bridgeRef.current;
- const hostStyles = buildMcpHostStyles(args.themeColors, args.isDarkMode);
- bridge.sendHostContextChange({
- theme: args.isDarkMode ? "dark" : "light",
- styles: { variables: hostStyles.variables, css: hostStyles.css },
- displayMode: args.displayMode,
- containerDimensions: {
- width: args.containerWidth,
- height: 320,
- },
- safeAreaInsets: {
- top: args.safeAreaInsets.top,
- right: args.safeAreaInsets.right,
- bottom: args.safeAreaInsets.bottom,
- left: args.safeAreaInsets.left,
- },
- });
- }, [
- args.isDarkMode,
- args.displayMode,
- args.containerWidth,
- args.themeColors,
- args.safeAreaInsets,
- ]);
-
- const handleWebViewMessage = useCallback((payload: string) => {
- transportRef.current?.acceptIncoming(payload);
- }, []);
-
- const sendWhenReady = useCallback((fn: (bridge: AppBridge) => void) => {
- if (initializedRef.current && bridgeRef.current) {
- fn(bridgeRef.current);
- } else {
- pendingRef.current.push(fn);
- }
- }, []);
-
- return { handleWebViewMessage, sendWhenReady };
-}
diff --git a/products/desktop/apps/mobile/src/features/mcp/sandbox/webViewTransport.test.ts b/products/desktop/apps/mobile/src/features/mcp/sandbox/webViewTransport.test.ts
deleted file mode 100644
index 8f7971a21155..000000000000
--- a/products/desktop/apps/mobile/src/features/mcp/sandbox/webViewTransport.test.ts
+++ /dev/null
@@ -1,111 +0,0 @@
-import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
-import { WebViewTransport } from "./webViewTransport";
-
-type FakeWebView = {
- injectJavaScript: ReturnType<typeof vi.fn>;
-};
-
-function makeRef(): { current: FakeWebView } {
- return {
- current: {
- injectJavaScript: vi.fn(),
- },
- };
-}
-
-describe("WebViewTransport", () => {
- let ref: { current: FakeWebView };
- let transport: WebViewTransport;
-
- beforeEach(() => {
- ref = makeRef();
- // Cast through unknown — the real type expects a WebView instance, but
- // we only ever read `injectJavaScript` so the duck-typed fake suffices.
- transport = new WebViewTransport(
- ref as unknown as {
- current: import("react-native-webview").default | null;
- },
- );
- });
-
- afterEach(() => {
- vi.restoreAllMocks();
- });
-
- it("injects send() payloads as a __mcpReceive call", async () => {
- await transport.start();
- await transport.send({ jsonrpc: "2.0", id: 1, method: "ping" });
- const snippet = ref.current.injectJavaScript.mock.calls[0][0];
- expect(snippet).toContain("window.__mcpReceive");
- expect(snippet).toContain('"method":"ping"');
- });
-
- it("escapes embedded </script> in payloads", async () => {
- await transport.start();
- await transport.send({
- jsonrpc: "2.0",
- method: "ui/notifications/log",
- params: { html: "</script><img src=x>" },
- });
- const snippet = ref.current.injectJavaScript.mock.calls[0][0];
- expect(snippet).not.toContain("</script>");
- expect(snippet).toContain("<\\/script>");
- });
-
- it("dispatches incoming messages to onmessage once started", async () => {
- const received: unknown[] = [];
- transport.onmessage = (msg) => {
- received.push(msg);
- };
- await transport.start();
- transport.acceptIncoming(
- JSON.stringify({
- jsonrpc: "2.0",
- method: "ui/notifications/sandbox-proxy-ready",
- }),
- );
- expect(received).toHaveLength(1);
- expect((received[0] as { method: string }).method).toBe(
- "ui/notifications/sandbox-proxy-ready",
- );
- });
-
- it("ignores incoming messages before start()", () => {
- const received: unknown[] = [];
- transport.onmessage = (msg) => received.push(msg);
- transport.acceptIncoming(JSON.stringify({ jsonrpc: "2.0", method: "x" }));
- expect(received).toHaveLength(0);
- });
-
- it("calls onerror on malformed JSON", async () => {
- const errors: Error[] = [];
- transport.onerror = (err) => errors.push(err);
- await transport.start();
- transport.acceptIncoming("not-json{");
- expect(errors).toHaveLength(1);
- });
-
- it("send() after close throws", async () => {
- await transport.start();
- await transport.close();
- await expect(
- transport.send({ jsonrpc: "2.0", method: "x" }),
- ).rejects.toThrow(/closed/i);
- });
-
- it("close() fires onclose exactly once", async () => {
- const onclose = vi.fn();
- transport.onclose = onclose;
- await transport.close();
- await transport.close();
- expect(onclose).toHaveBeenCalledTimes(1);
- });
-
- it("send() is a no-op when the WebView ref is null", async () => {
- ref.current = null as unknown as FakeWebView;
- await transport.start();
- await expect(
- transport.send({ jsonrpc: "2.0", method: "x" }),
- ).resolves.toBeUndefined();
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/mcp/sandbox/webViewTransport.ts b/products/desktop/apps/mobile/src/features/mcp/sandbox/webViewTransport.ts
deleted file mode 100644
index 9940e3a75d09..000000000000
--- a/products/desktop/apps/mobile/src/features/mcp/sandbox/webViewTransport.ts
+++ /dev/null
@@ -1,83 +0,0 @@
-import type { Transport } from "@modelcontextprotocol/sdk/shared/transport.js";
-import type { JSONRPCMessage } from "@modelcontextprotocol/sdk/types.js";
-import type WebView from "react-native-webview";
-
-/**
- * MCP `Transport` implementation that bridges JSON-RPC messages between the
- * RN host and a `react-native-webview`-hosted sandbox proxy.
- *
- * Inbound (WebView → RN): the caller hands us messages via `acceptIncoming`
- * (typically called from the WebView's `onMessage` prop).
- * Outbound (RN → WebView): `send` injects a tiny JS snippet that invokes the
- * sandbox proxy's `window.__mcpReceive` entry point.
- *
- * The transport never validates origin (there isn't a meaningful one inside a
- * WebView) — the host MUST only inject HTML it trusts via `WebView`'s
- * `source`. Since the sandbox proxy HTML is hard-coded in
- * `sandboxProxyHtml.ts` and the inner iframe's content comes from a UI
- * resource the user has already chosen to install, that boundary is fine.
- */
-export class WebViewTransport implements Transport {
- private webViewRef: { current: WebView | null };
- private started = false;
- private closed = false;
-
- onmessage?: (message: JSONRPCMessage) => void;
- onerror?: (error: Error) => void;
- onclose?: () => void;
- // Required by Transport; we honour it but the protocol version is not
- // meaningful at the WebView boundary.
- setProtocolVersion?: (version: string) => void;
-
- constructor(webViewRef: { current: WebView | null }) {
- this.webViewRef = webViewRef;
- }
-
- async start(): Promise<void> {
- this.started = true;
- }
-
- /**
- * Forward a JSON-RPC message from the host to the WebView. Idempotent and
- * safe to call before `start()` — `injectJavaScript` will just no-op until
- * the WebView is mounted.
- */
- async send(message: JSONRPCMessage): Promise<void> {
- if (this.closed) throw new Error("Transport closed");
- const webView = this.webViewRef.current;
- if (!webView) return;
- const json = JSON.stringify(message);
- // The escape pass below is the standard way to embed an already-JSON
- // string inside another script payload — without it, a literal `</script>`
- // sequence in the data could prematurely end the injected snippet.
- const escaped = json.replace(/<\/script>/gi, "<\\/script>");
- const snippet = `void (window.__mcpReceive && window.__mcpReceive(${escaped}));`;
- webView.injectJavaScript(snippet);
- }
-
- /**
- * Called from the WebView's `onMessage` handler with the raw JSON payload
- * the sandbox proxy posted. Parses, validates shape, and dispatches.
- */
- acceptIncoming(payload: string): void {
- if (this.closed) return;
- if (!this.started) return;
- let message: unknown;
- try {
- message = JSON.parse(payload);
- } catch (err) {
- this.onerror?.(
- err instanceof Error ? err : new Error("Invalid JSON from WebView"),
- );
- return;
- }
- if (!message || typeof message !== "object") return;
- this.onmessage?.(message as JSONRPCMessage);
- }
-
- async close(): Promise<void> {
- if (this.closed) return;
- this.closed = true;
- this.onclose?.();
- }
-}
diff --git a/products/desktop/apps/mobile/src/features/mcp/service.ts b/products/desktop/apps/mobile/src/features/mcp/service.ts
deleted file mode 100644
index 199c08c2084d..000000000000
--- a/products/desktop/apps/mobile/src/features/mcp/service.ts
+++ /dev/null
@@ -1,184 +0,0 @@
-import { Client } from "@modelcontextprotocol/sdk/client/index.js";
-import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
-import type {
- CallToolResult,
- ReadResourceResult,
- Tool,
-} from "@modelcontextprotocol/sdk/types.js";
-import { AppState, type AppStateStatus } from "react-native";
-import { useAuthStore } from "@/features/auth";
-import { logger } from "@/lib/logger";
-
-const log = logger.scope("mcp-service");
-
-interface ServerConnection {
- installationId: string;
- serverName: string;
- proxyUrl: string;
- client: Client;
- transport: StreamableHTTPClientTransport;
-}
-
-const CLIENT_INFO = { name: "posthog-code-mobile", version: "1.0.0" };
-
-/**
- * Mobile-side service that owns MCP `Client` connections per installation.
- *
- * Each installation gets a lazy `StreamableHTTPClientTransport` pointed at the
- * cloud-hosted proxy URL the API returned. Auth is injected per-request via
- * the user's PostHog access token in the `Authorization` header — the cloud
- * proxy strips it and forwards a fresh server-side credential to the MCP
- * server, so the mobile token never reaches the upstream.
- *
- * Connections are kept alive across screens (one per server). They're torn
- * down when the app backgrounds for more than a few seconds so we don't
- * accumulate sockets, and re-opened on demand.
- */
-class McpConnectionManager {
- private connections = new Map<string, ServerConnection>();
- private pendingConnects = new Map<string, Promise<ServerConnection>>();
- private appStateSubscription: { remove(): void } | null = null;
-
- registerAppStateListener(): void {
- if (this.appStateSubscription) return;
- this.appStateSubscription = AppState.addEventListener(
- "change",
- (nextState) => {
- if (nextState !== "active") {
- // Background — drop all connections to avoid stale-socket churn.
- // Next request re-opens them lazily.
- void this.closeAll();
- }
- },
- );
- }
-
- /** Returns a connected MCP `Client` for the given installation, creating
- * one on first use. Concurrent callers share the same pending promise. */
- async getClient(args: {
- installationId: string;
- serverName: string;
- proxyUrl: string;
- }): Promise<Client> {
- const existing = this.connections.get(args.installationId);
- if (existing) return existing.client;
-
- const pending = this.pendingConnects.get(args.installationId);
- if (pending) {
- const connection = await pending;
- return connection.client;
- }
-
- const promise = this.connect(args);
- this.pendingConnects.set(args.installationId, promise);
- try {
- const connection = await promise;
- this.connections.set(args.installationId, connection);
- return connection.client;
- } finally {
- this.pendingConnects.delete(args.installationId);
- }
- }
-
- private async connect(args: {
- installationId: string;
- serverName: string;
- proxyUrl: string;
- }): Promise<ServerConnection> {
- const { oauthAccessToken } = useAuthStore.getState();
- if (!oauthAccessToken) {
- throw new Error("Not authenticated");
- }
-
- const url = new URL(args.proxyUrl);
- const transport = new StreamableHTTPClientTransport(url, {
- requestInit: {
- headers: {
- Authorization: `Bearer ${oauthAccessToken}`,
- },
- },
- });
-
- const client = new Client(CLIENT_INFO, { capabilities: {} });
- await client.connect(transport);
- log.info("MCP client connected", {
- installationId: args.installationId,
- serverName: args.serverName,
- });
-
- return {
- installationId: args.installationId,
- serverName: args.serverName,
- proxyUrl: args.proxyUrl,
- client,
- transport,
- };
- }
-
- async callTool(args: {
- installationId: string;
- serverName: string;
- proxyUrl: string;
- toolName: string;
- arguments?: Record<string, unknown>;
- }): Promise<CallToolResult> {
- const client = await this.getClient(args);
- const result = await client.callTool({
- name: args.toolName,
- arguments: args.arguments ?? {},
- });
- return result as CallToolResult;
- }
-
- async readResource(args: {
- installationId: string;
- serverName: string;
- proxyUrl: string;
- uri: string;
- }): Promise<ReadResourceResult> {
- const client = await this.getClient(args);
- return (await client.readResource({ uri: args.uri })) as ReadResourceResult;
- }
-
- async getTool(args: {
- installationId: string;
- serverName: string;
- proxyUrl: string;
- toolName: string;
- }): Promise<Tool | null> {
- const client = await this.getClient(args);
- const { tools } = await client.listTools();
- return tools.find((t) => t.name === args.toolName) ?? null;
- }
-
- /** Close a single connection (e.g., after uninstall). */
- async close(installationId: string): Promise<void> {
- const connection = this.connections.get(installationId);
- if (!connection) return;
- this.connections.delete(installationId);
- try {
- await connection.client.close();
- } catch (err) {
- log.warn("Failed to close MCP client", { installationId, err });
- }
- }
-
- async closeAll(): Promise<void> {
- const ids = [...this.connections.keys()];
- await Promise.allSettled(ids.map((id) => this.close(id)));
- }
-}
-
-let manager: McpConnectionManager | null = null;
-
-export function getMcpConnectionManager(): McpConnectionManager {
- if (!manager) {
- manager = new McpConnectionManager();
- manager.registerAppStateListener();
- }
- return manager;
-}
-
-// Exported for tests.
-export { McpConnectionManager };
-export type { AppStateStatus };
diff --git a/products/desktop/apps/mobile/src/features/navigation/components/MenuButton.tsx b/products/desktop/apps/mobile/src/features/navigation/components/MenuButton.tsx
deleted file mode 100644
index b123197d718b..000000000000
--- a/products/desktop/apps/mobile/src/features/navigation/components/MenuButton.tsx
+++ /dev/null
@@ -1,27 +0,0 @@
-import { List } from "phosphor-react-native";
-import { Pressable } from "react-native";
-import { useThemeColors } from "@/lib/theme";
-import { useNavDrawerStore } from "../stores/navDrawerStore";
-
-interface MenuButtonProps {
- className?: string;
-}
-
-export function MenuButton({ className }: MenuButtonProps) {
- const open = useNavDrawerStore((s) => s.open);
- const themeColors = useThemeColors();
-
- return (
- <Pressable
- // Fire on touch-down (not release) so the drawer starts animating in
- // the same frame the finger lands.
- onPressIn={open}
- hitSlop={12}
- className={`h-10 w-10 items-center justify-center rounded-lg active:bg-gray-3 ${className ?? ""}`}
- accessibilityLabel="Open navigation menu"
- accessibilityRole="button"
- >
- <List size={24} color={themeColors.gray[12]} />
- </Pressable>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/navigation/components/NavDrawer.tsx b/products/desktop/apps/mobile/src/features/navigation/components/NavDrawer.tsx
deleted file mode 100644
index b5805ccd4cd1..000000000000
--- a/products/desktop/apps/mobile/src/features/navigation/components/NavDrawer.tsx
+++ /dev/null
@@ -1,360 +0,0 @@
-import { Text } from "@components/text";
-import { usePathname, useRouter } from "expo-router";
-import {
- CaretRight,
- GearSix,
- ListBullets,
- PuzzlePiece,
- Tray,
-} from "phosphor-react-native";
-import { memo, type ReactNode, useEffect, useMemo, useState } from "react";
-import {
- Dimensions,
- Pressable,
- ScrollView,
- StyleSheet,
- View,
-} from "react-native";
-import Animated, {
- Easing,
- useAnimatedStyle,
- useSharedValue,
- withTiming,
-} from "react-native-reanimated";
-import { useSafeAreaInsets } from "react-native-safe-area-context";
-import { OFFLINE_BANNER_HEIGHT } from "@/components/OfflineBanner";
-import { TaskStatusIcon } from "@/features/tasks/components/TaskStatusIcon";
-import { useTasks } from "@/features/tasks/hooks/useTasks";
-import { useArchivedTasksStore } from "@/features/tasks/stores/archivedTasksStore";
-import { useNetworkStatus } from "@/hooks/useNetworkStatus";
-import { useThemeColors } from "@/lib/theme";
-import { useNavDrawerStore } from "../stores/navDrawerStore";
-import { SwipeableArchivedDrawerRow } from "./SwipeableArchivedDrawerRow";
-
-const { width: SCREEN_WIDTH } = Dimensions.get("window");
-const DRAWER_WIDTH = Math.min(320, Math.round(SCREEN_WIDTH * 0.85));
-const OPEN_DURATION = 280;
-const CLOSE_DURATION = 220;
-
-interface DrawerItemProps {
- icon: ReactNode;
- label: string;
- active?: boolean;
- onPress: () => void;
-}
-
-function DrawerItem({ icon, label, active, onPress }: DrawerItemProps) {
- return (
- <Pressable
- onPress={onPress}
- className={`flex-row items-center gap-3 rounded-md px-3 py-3 ${active ? "bg-gray-3" : "active:bg-gray-2"}`}
- >
- <View className="h-6 w-6 shrink-0 items-center justify-center">
- {icon}
- </View>
- <Text
- className="flex-1 font-medium text-[16px] text-gray-12"
- numberOfLines={1}
- >
- {label}
- </Text>
- </Pressable>
- );
-}
-
-interface NavDrawerContentProps {
- paddingTop: number;
-}
-
-/**
- * Heavy drawer body — extracted so it doesn't re-render every time the open
- * state toggles. `paddingTop` is the only prop and only changes when the
- * offline banner appears/disappears, so the memo stays effective.
- */
-const NavDrawerContent = memo(function NavDrawerContent({
- paddingTop,
-}: NavDrawerContentProps) {
- const close = useNavDrawerStore((s) => s.close);
- const router = useRouter();
- const pathname = usePathname();
- const themeColors = useThemeColors();
- const insets = useSafeAreaInsets();
- const { tasks } = useTasks({ originProduct: "user_created" });
- const { archivedTasks, unarchive } = useArchivedTasksStore();
- const [archivedExpanded, setArchivedExpanded] = useState(false);
-
- const { activeTasks, archivedTaskList } = useMemo(() => {
- const active: typeof tasks = [];
- const archived: typeof tasks = [];
- for (const task of tasks) {
- if (task.id in archivedTasks) {
- archived.push(task);
- } else {
- active.push(task);
- }
- }
- archived.sort(
- (a, b) => (archivedTasks[b.id] ?? 0) - (archivedTasks[a.id] ?? 0),
- );
- return { activeTasks: active, archivedTaskList: archived };
- }, [tasks, archivedTasks]);
-
- const navigateTo = (target: string) => {
- close();
- if (pathname === target) return;
- router.replace(target);
- };
-
- const handleTasks = () => navigateTo("/tasks");
- const handleInbox = () => navigateTo("/inbox");
- // Settings is pushed (not replaced) so back / swipe-back returns the user
- // to whichever tab they were viewing when they opened the drawer.
- const handleSettings = () => {
- close();
- if (pathname === "/settings") return;
- router.push("/settings");
- };
- const handleMcpServers = () => {
- close();
- if (pathname === "/mcp-servers") return;
- router.push("/mcp-servers");
- };
- const handleHome = () => navigateTo("/tasks");
-
- const handleTaskPress = (taskId: string) => {
- close();
- router.push(`/task/${taskId}`);
- };
-
- const iconColor = themeColors.gray[11];
- const iconColorActive = themeColors.gray[12];
- const isOnTasks = pathname === "/tasks";
- const isOnInbox = pathname === "/inbox";
- const isOnSettings = pathname === "/settings";
- const isOnMcpServers = pathname === "/mcp-servers";
-
- return (
- <View
- className="flex-1"
- style={{ paddingTop, paddingBottom: insets.bottom }}
- >
- <Pressable onPress={handleHome} className="px-4 pb-3 active:opacity-60">
- <Text className="font-bold text-[20px] text-gray-12">PostHog</Text>
- </Pressable>
-
- <View className="gap-0.5 px-2 pb-2">
- <DrawerItem
- icon={
- <ListBullets
- size={22}
- color={isOnTasks ? iconColorActive : iconColor}
- weight={isOnTasks ? "bold" : "regular"}
- />
- }
- label="Tasks"
- active={isOnTasks}
- onPress={handleTasks}
- />
- <DrawerItem
- icon={
- <Tray
- size={22}
- color={isOnInbox ? iconColorActive : iconColor}
- weight={isOnInbox ? "fill" : "regular"}
- />
- }
- label="Inbox"
- active={isOnInbox}
- onPress={handleInbox}
- />
- <DrawerItem
- icon={
- <PuzzlePiece
- size={22}
- color={isOnMcpServers ? iconColorActive : iconColor}
- weight={isOnMcpServers ? "fill" : "regular"}
- />
- }
- label="MCP servers"
- active={isOnMcpServers}
- onPress={handleMcpServers}
- />
- </View>
-
- <View className="mx-3 mb-1 border-gray-6 border-t" />
-
- <View className="px-4 pt-3 pb-1.5">
- <Text
- className="font-medium text-[11px] text-gray-10 uppercase"
- style={{ letterSpacing: 0.5 }}
- >
- Tasks
- </Text>
- </View>
-
- <ScrollView
- className="flex-1"
- contentContainerStyle={{ paddingHorizontal: 8, paddingBottom: 12 }}
- >
- {activeTasks.length === 0 && archivedTaskList.length === 0 ? (
- <View className="px-2.5 py-2">
- <Text className="text-[13px] text-gray-10">No tasks yet</Text>
- </View>
- ) : (
- <>
- {activeTasks.map((task) => {
- const taskHref = `/task/${task.id}`;
- const active = pathname === taskHref;
- return (
- <Pressable
- key={task.id}
- onPress={() => handleTaskPress(task.id)}
- className={`flex-row items-center gap-3 rounded-md px-3 py-2.5 ${active ? "bg-gray-3" : "active:bg-gray-2"}`}
- >
- <View className="h-5 w-5 shrink-0 items-center justify-center">
- <TaskStatusIcon task={task} size={16} />
- </View>
- <Text
- className="flex-1 text-[15px] text-gray-12"
- numberOfLines={1}
- ellipsizeMode="tail"
- >
- {task.title}
- </Text>
- </Pressable>
- );
- })}
-
- {archivedTaskList.length > 0 && (
- <View className="mt-2">
- <Pressable
- onPress={() => setArchivedExpanded((prev) => !prev)}
- className="flex-row items-center gap-2 rounded-md px-3 py-2 active:bg-gray-2"
- >
- <CaretRight
- size={12}
- color={themeColors.gray[10]}
- style={{
- transform: [
- { rotate: archivedExpanded ? "90deg" : "0deg" },
- ],
- }}
- />
- <Text
- className="flex-1 font-medium text-[11px] text-gray-10 uppercase"
- style={{ letterSpacing: 0.5 }}
- >
- Archived
- </Text>
- <Text className="text-[11px] text-gray-9">
- {archivedTaskList.length}
- </Text>
- </Pressable>
-
- {archivedExpanded &&
- archivedTaskList.map((task) => {
- const taskHref = `/task/${task.id}`;
- return (
- <SwipeableArchivedDrawerRow
- key={task.id}
- task={task}
- active={pathname === taskHref}
- onPress={handleTaskPress}
- onUnarchive={unarchive}
- />
- );
- })}
- </View>
- )}
- </>
- )}
- </ScrollView>
-
- <View className="mx-3 mt-1 border-gray-6 border-t" />
-
- <View className="gap-0.5 px-2 pt-2 pb-2">
- <DrawerItem
- icon={
- <GearSix
- size={22}
- color={isOnSettings ? iconColorActive : iconColor}
- weight={isOnSettings ? "fill" : "regular"}
- />
- }
- label="Settings"
- active={isOnSettings}
- onPress={handleSettings}
- />
- </View>
- </View>
- );
-});
-
-export function NavDrawer() {
- // `isOpen` is read only to gate `pointerEvents`. The heavy drawer body is
- // memoized below so this re-render is essentially free — it just flips a
- // prop on the outer wrappers.
- const isOpen = useNavDrawerStore((s) => s.isOpen);
- const close = useNavDrawerStore((s) => s.close);
- const insets = useSafeAreaInsets();
- const { isConnected } = useNetworkStatus();
-
- // When offline, the banner occupies `insets.top + OFFLINE_BANNER_HEIGHT` at
- // the top of the screen — push the panel down by that amount and drop the
- // inner safe-area padding to compensate.
- const drawerTop = isConnected ? 0 : insets.top + OFFLINE_BANNER_HEIGHT;
- const drawerPaddingTop = isConnected ? insets.top + 12 : 12;
-
- // Drive the slide off a SharedValue so the animation can start on the UI
- // thread the instant the store updates, with no React render in the
- // critical path. Imperative subscription avoids re-rendering NavDrawer
- // before kicking off `withTiming`.
- const progress = useSharedValue(0);
-
- useEffect(() => {
- progress.value = useNavDrawerStore.getState().isOpen ? 1 : 0;
- return useNavDrawerStore.subscribe((state, prev) => {
- if (state.isOpen === prev.isOpen) return;
- progress.value = withTiming(state.isOpen ? 1 : 0, {
- duration: state.isOpen ? OPEN_DURATION : CLOSE_DURATION,
- easing: state.isOpen
- ? Easing.out(Easing.cubic)
- : Easing.in(Easing.cubic),
- });
- });
- }, [progress]);
-
- const drawerStyle = useAnimatedStyle(() => ({
- transform: [{ translateX: -DRAWER_WIDTH + progress.value * DRAWER_WIDTH }],
- }));
-
- const backdropStyle = useAnimatedStyle(() => ({
- opacity: progress.value,
- }));
-
- return (
- <View
- pointerEvents={isOpen ? "auto" : "none"}
- style={StyleSheet.absoluteFillObject}
- >
- <Animated.View
- pointerEvents={isOpen ? "auto" : "none"}
- style={[
- StyleSheet.absoluteFillObject,
- { backgroundColor: "rgba(0,0,0,0.4)" },
- backdropStyle,
- ]}
- >
- {/* Touch-down close so the dismiss starts the moment the finger lands. */}
- <Pressable className="flex-1" onPressIn={close} />
- </Animated.View>
-
- <Animated.View
- className="absolute bottom-0 left-0 border-gray-6 border-r bg-gray-2"
- style={[{ top: drawerTop, width: DRAWER_WIDTH }, drawerStyle]}
- >
- <NavDrawerContent paddingTop={drawerPaddingTop} />
- </Animated.View>
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/navigation/components/SwipeableArchivedDrawerRow.tsx b/products/desktop/apps/mobile/src/features/navigation/components/SwipeableArchivedDrawerRow.tsx
deleted file mode 100644
index 6e942a268807..000000000000
--- a/products/desktop/apps/mobile/src/features/navigation/components/SwipeableArchivedDrawerRow.tsx
+++ /dev/null
@@ -1,132 +0,0 @@
-import { Text } from "@components/text";
-import type { Task } from "@posthog/shared";
-import * as Haptics from "expo-haptics";
-import { ArrowCounterClockwise } from "phosphor-react-native";
-import { useEffect, useRef } from "react";
-import {
- Animated,
- Easing,
- LayoutAnimation,
- PanResponder,
- Pressable,
- View,
-} from "react-native";
-import { TaskStatusIcon } from "@/features/tasks/components/TaskStatusIcon";
-import { useThemeColors } from "@/lib/theme";
-
-const SWIPE_THRESHOLD = 60;
-
-interface SwipeableArchivedDrawerRowProps {
- task: Task;
- active: boolean;
- onPress: (taskId: string) => void;
- onUnarchive: (taskId: string) => void;
-}
-
-export function SwipeableArchivedDrawerRow({
- task,
- active,
- onPress,
- onUnarchive,
-}: SwipeableArchivedDrawerRowProps) {
- const themeColors = useThemeColors();
- const translateX = useRef(new Animated.Value(0)).current;
- const actionTriggeredRef = useRef(false);
-
- const propsRef = useRef({ task, onUnarchive });
- propsRef.current = { task, onUnarchive };
-
- useEffect(() => {
- translateX.setValue(0);
- actionTriggeredRef.current = false;
- }, [translateX]);
-
- const panResponder = useRef(
- PanResponder.create({
- onStartShouldSetPanResponder: () => false,
- onMoveShouldSetPanResponder: (_, gesture) =>
- Math.abs(gesture.dx) > 5 &&
- Math.abs(gesture.dx) > Math.abs(gesture.dy) &&
- gesture.dx < 0,
- onMoveShouldSetPanResponderCapture: (_, gesture) =>
- Math.abs(gesture.dx) > 8 &&
- Math.abs(gesture.dx) > Math.abs(gesture.dy * 1.2) &&
- gesture.dx < 0,
- onPanResponderTerminationRequest: () => false,
- onShouldBlockNativeResponder: () => true,
- onPanResponderGrant: () => {
- actionTriggeredRef.current = false;
- },
- onPanResponderMove: (_, gesture) => {
- translateX.setValue(gesture.dx > 0 ? 0 : gesture.dx);
- },
- onPanResponderRelease: (_, gesture) => {
- const p = propsRef.current;
- if (gesture.dx < -SWIPE_THRESHOLD && !actionTriggeredRef.current) {
- actionTriggeredRef.current = true;
- Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium);
- Animated.timing(translateX, {
- toValue: -400,
- duration: 150,
- easing: Easing.in(Easing.ease),
- useNativeDriver: true,
- }).start(() => {
- LayoutAnimation.configureNext(
- LayoutAnimation.Presets.easeInEaseOut,
- );
- p.onUnarchive(p.task.id);
- });
- } else {
- Animated.spring(translateX, {
- toValue: 0,
- useNativeDriver: true,
- tension: 40,
- friction: 8,
- }).start();
- }
- },
- onPanResponderTerminate: () => {
- Animated.spring(translateX, {
- toValue: 0,
- useNativeDriver: true,
- }).start();
- },
- }),
- ).current;
-
- return (
- <View className="overflow-hidden">
- <View
- className="absolute inset-y-0 right-0 left-0 flex-row items-center justify-end px-4"
- style={{ backgroundColor: themeColors.accent[9] }}
- >
- <ArrowCounterClockwise size={16} color="#fff" />
- <Text className="ml-1.5 font-medium text-white text-xs">Unarchive</Text>
- </View>
-
- <Animated.View
- style={{
- transform: [{ translateX }],
- backgroundColor: themeColors.background,
- }}
- {...panResponder.panHandlers}
- >
- <Pressable
- onPress={() => onPress(task.id)}
- className={`flex-row items-center gap-3 rounded-md px-3 py-2.5 ${active ? "bg-gray-3" : "active:bg-gray-2"}`}
- >
- <View className="h-5 w-5 shrink-0 items-center justify-center">
- <TaskStatusIcon task={task} size={16} />
- </View>
- <Text
- className="flex-1 text-[15px] text-gray-10"
- numberOfLines={1}
- ellipsizeMode="tail"
- >
- {task.title}
- </Text>
- </Pressable>
- </Animated.View>
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/navigation/stores/navDrawerStore.ts b/products/desktop/apps/mobile/src/features/navigation/stores/navDrawerStore.ts
deleted file mode 100644
index adf285374c67..000000000000
--- a/products/desktop/apps/mobile/src/features/navigation/stores/navDrawerStore.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { create } from "zustand";
-
-interface NavDrawerState {
- isOpen: boolean;
- open: () => void;
- close: () => void;
- toggle: () => void;
-}
-
-export const useNavDrawerStore = create<NavDrawerState>((set) => ({
- isOpen: false,
- open: () => set({ isOpen: true }),
- close: () => set({ isOpen: false }),
- toggle: () => set((state) => ({ isOpen: !state.isOpen })),
-}));
diff --git a/products/desktop/apps/mobile/src/features/notifications/lib/notifications.ts b/products/desktop/apps/mobile/src/features/notifications/lib/notifications.ts
deleted file mode 100644
index 780dc5196313..000000000000
--- a/products/desktop/apps/mobile/src/features/notifications/lib/notifications.ts
+++ /dev/null
@@ -1,175 +0,0 @@
-import Constants from "expo-constants";
-import * as Device from "expo-device";
-import * as Notifications from "expo-notifications";
-import { Platform } from "react-native";
-import { externalUrlToAppPath, paths } from "@/lib/deep-links";
-import { logger } from "@/lib/logger";
-
-const log = logger.scope("notifications");
-
-/**
- * Shape of `content.data` we expect on incoming notifications.
- *
- * Two forms are accepted (in priority order):
- * 1. `{ url: "posthog://task/abc" }` or `{ url: "/task/abc" }` — generic
- * deep link. Preferred for new notification types.
- * 2. `{ taskId, taskRunId? }` — legacy task-specific shape kept for
- * backwards compatibility with already-queued server notifications.
- */
-export interface NotificationData {
- taskId: string;
- taskRunId: string;
-}
-
-export interface NotificationTapPayload {
- /** App-relative path to navigate to (e.g. "/task/abc"). */
- path: string;
-}
-
-export type NotificationResponseHandler = (
- payload: NotificationTapPayload,
-) => void;
-
-let handlerConfigured = false;
-
-function configureHandler(): void {
- if (handlerConfigured) return;
- handlerConfigured = true;
- Notifications.setNotificationHandler({
- handleNotification: async () => ({
- shouldShowBanner: true,
- shouldShowList: true,
- shouldPlaySound: true,
- shouldSetBadge: false,
- }),
- });
-}
-
-/**
- * Requests permission and returns an Expo push token for this device, or null
- * if permission is denied / not supported (e.g. iOS Simulator).
- */
-export async function registerForPushNotificationsAsync(): Promise<
- string | null
-> {
- configureHandler();
-
- if (Platform.OS === "android") {
- await Notifications.setNotificationChannelAsync("default", {
- name: "default",
- importance: Notifications.AndroidImportance.DEFAULT,
- vibrationPattern: [0, 250, 250, 250],
- lightColor: "#FF231F7C",
- });
- }
-
- const { status: existingStatus } = await Notifications.getPermissionsAsync();
- let finalStatus = existingStatus;
- if (existingStatus !== "granted") {
- const { status } = await Notifications.requestPermissionsAsync();
- finalStatus = status;
- }
- if (finalStatus !== "granted") {
- log.debug("Push notification permission not granted", { finalStatus });
- return null;
- }
-
- if (!Device.isDevice) {
- log.debug("Skipping push token retrieval: not a physical device");
- return null;
- }
-
- const projectId = Constants.expoConfig?.extra?.eas?.projectId;
- if (!projectId) {
- log.warn("Missing EAS projectId in app config; cannot fetch push token");
- return null;
- }
-
- try {
- const tokenResponse = await Notifications.getExpoPushTokenAsync({
- projectId,
- });
- log.debug("Retrieved Expo push token");
- return tokenResponse.data;
- } catch (err) {
- log.warn("Failed to retrieve Expo push token", { error: err });
- return null;
- }
-}
-
-export async function presentLocalNotification(args: {
- title: string;
- body: string;
- data: NotificationData;
-}): Promise<void> {
- configureHandler();
- try {
- await Notifications.scheduleNotificationAsync({
- content: {
- title: args.title,
- body: args.body,
- data: args.data as unknown as Record<string, unknown>,
- sound: "default",
- },
- trigger: null,
- });
- } catch (err) {
- log.warn("Failed to present local notification", { error: err });
- }
-}
-
-function extractTapPayload(
- response: Notifications.NotificationResponse,
-): NotificationTapPayload | null {
- const data = response.notification.request.content.data as
- | { url?: unknown; taskId?: unknown; taskRunId?: unknown }
- | undefined;
- if (!data) return null;
-
- if (typeof data.url === "string" && data.url.length > 0) {
- // Already-shaped app path → use as-is. External URL → translate to one.
- if (data.url.startsWith("/")) return { path: data.url };
- const path = externalUrlToAppPath(data.url);
- if (path) return { path };
- log.warn("Notification url did not match a known scheme", {
- url: data.url,
- });
- return null;
- }
-
- if (typeof data.taskId === "string") {
- return { path: paths.task(data.taskId) };
- }
-
- return null;
-}
-
-/**
- * Wires a listener that fires when the user taps a notification. Returns an
- * unsubscribe function. Also checks for a cold-start notification (the app
- * was launched by tapping a notification) and invokes the handler once.
- */
-export function setupNotificationResponseListener(
- onTap: NotificationResponseHandler,
-): () => void {
- configureHandler();
-
- Notifications.getLastNotificationResponseAsync()
- .then((response) => {
- if (!response) return;
- const payload = extractTapPayload(response);
- if (payload) onTap(payload);
- })
- .catch((err) => {
- log.warn("Failed to read last notification response", { error: err });
- });
-
- const subscription = Notifications.addNotificationResponseReceivedListener(
- (response) => {
- const payload = extractTapPayload(response);
- if (payload) onTap(payload);
- },
- );
-
- return () => subscription.remove();
-}
diff --git a/products/desktop/apps/mobile/src/features/notifications/stores/pushTokenStore.ts b/products/desktop/apps/mobile/src/features/notifications/stores/pushTokenStore.ts
deleted file mode 100644
index 4f334f258e0d..000000000000
--- a/products/desktop/apps/mobile/src/features/notifications/stores/pushTokenStore.ts
+++ /dev/null
@@ -1,100 +0,0 @@
-import * as SecureStore from "expo-secure-store";
-import { Platform } from "react-native";
-import { create } from "zustand";
-import { deletePushToken, registerPushToken } from "@/lib/api";
-import { logger } from "@/lib/logger";
-import { registerForPushNotificationsAsync } from "../lib/notifications";
-
-const log = logger.scope("push-token-store");
-
-const TOKEN_KEY = "posthog_expo_push_token";
-const LAST_UPLOADED_KEY = "posthog_expo_push_token_uploaded";
-
-interface PushTokenState {
- expoPushToken: string | null;
- lastUploadedToken: string | null;
- isHydrated: boolean;
-
- hydrate: () => Promise<void>;
- registerAndUpload: () => Promise<void>;
- clear: () => Promise<void>;
-}
-
-async function readSecure(key: string): Promise<string | null> {
- try {
- return await SecureStore.getItemAsync(key);
- } catch (err) {
- log.warn("SecureStore read failed", { key, error: err });
- return null;
- }
-}
-
-async function writeSecure(key: string, value: string | null): Promise<void> {
- try {
- if (value === null) {
- await SecureStore.deleteItemAsync(key);
- } else {
- await SecureStore.setItemAsync(key, value);
- }
- } catch (err) {
- log.warn("SecureStore write failed", { key, error: err });
- }
-}
-
-export const usePushTokenStore = create<PushTokenState>((set, get) => ({
- expoPushToken: null,
- lastUploadedToken: null,
- isHydrated: false,
-
- hydrate: async () => {
- if (get().isHydrated) return;
- const [expoPushToken, lastUploadedToken] = await Promise.all([
- readSecure(TOKEN_KEY),
- readSecure(LAST_UPLOADED_KEY),
- ]);
- set({ expoPushToken, lastUploadedToken, isHydrated: true });
- },
-
- registerAndUpload: async () => {
- await get().hydrate();
-
- const token = await registerForPushNotificationsAsync();
- if (!token) return;
-
- if (token !== get().expoPushToken) {
- await writeSecure(TOKEN_KEY, token);
- set({ expoPushToken: token });
- }
-
- if (token === get().lastUploadedToken) return;
-
- try {
- await registerPushToken({ token, platform: Platform.OS });
- await writeSecure(LAST_UPLOADED_KEY, token);
- set({ lastUploadedToken: token });
- } catch (err) {
- // Surface as warn so a misconfigured OAuth scope or backend regression
- // doesn't fail silently — push notifications won't work until this row
- // lands on the backend.
- log.warn("Push token upload failed", {
- error: err instanceof Error ? err.message : String(err),
- });
- }
- },
-
- clear: async () => {
- const { expoPushToken } = get();
- if (expoPushToken) {
- try {
- await deletePushToken({ token: expoPushToken });
- } catch (err) {
- log.debug("Push token delete failed", { error: err });
- }
- }
- await Promise.all([
- writeSecure(TOKEN_KEY, null),
- writeSecure(LAST_UPLOADED_KEY, null),
- ]);
- set({ expoPushToken: null, lastUploadedToken: null });
- },
-}));
diff --git a/products/desktop/apps/mobile/src/features/preferences/stores/preferencesStore.test.ts b/products/desktop/apps/mobile/src/features/preferences/stores/preferencesStore.test.ts
deleted file mode 100644
index fc2718571ac8..000000000000
--- a/products/desktop/apps/mobile/src/features/preferences/stores/preferencesStore.test.ts
+++ /dev/null
@@ -1,163 +0,0 @@
-import { beforeEach, describe, expect, it } from "vitest";
-
-import {
- FONT_SCALE_BY_PREFERENCE,
- type FontSizePreference,
- usePreferencesStore,
-} from "./preferencesStore";
-
-const INITIAL_STATE = usePreferencesStore.getState();
-
-beforeEach(() => {
- // Reset to the store's defined defaults between tests so persisted state from
- // earlier cases doesn't leak in.
- usePreferencesStore.setState(INITIAL_STATE, true);
-});
-
-describe("preferencesStore reasoning effort", () => {
- it("defaults defaultReasoningEffort to last_used", () => {
- expect(usePreferencesStore.getState().defaultReasoningEffort).toBe(
- "last_used",
- );
- });
-
- it("defaults lastUsedReasoningEffort to high", () => {
- expect(usePreferencesStore.getState().lastUsedReasoningEffort).toBe("high");
- });
-
- it.each(["low", "medium", "high", "xhigh", "max", "last_used"] as const)(
- "updates defaultReasoningEffort to %s via setter",
- (effort) => {
- usePreferencesStore.getState().setDefaultReasoningEffort(effort);
- expect(usePreferencesStore.getState().defaultReasoningEffort).toBe(
- effort,
- );
- },
- );
-
- it.each(["low", "medium", "high", "xhigh", "max"] as const)(
- "updates lastUsedReasoningEffort to %s via setter",
- (effort) => {
- usePreferencesStore.getState().setLastUsedReasoningEffort(effort);
- expect(usePreferencesStore.getState().lastUsedReasoningEffort).toBe(
- effort,
- );
- },
- );
-
- it("keeps lastUsedReasoningEffort independent of defaultReasoningEffort", () => {
- usePreferencesStore.getState().setDefaultReasoningEffort("low");
- usePreferencesStore.getState().setLastUsedReasoningEffort("max");
-
- const state = usePreferencesStore.getState();
- expect(state.defaultReasoningEffort).toBe("low");
- expect(state.lastUsedReasoningEffort).toBe("max");
- });
-});
-
-describe("preferencesStore agent config", () => {
- it("defaults context window to 1m and fast mode off", () => {
- const state = usePreferencesStore.getState();
- expect(state.lastUsedContextWindow).toBe("1m");
- expect(state.lastUsedFastMode).toBe(false);
- });
-
- it.each(["200k", "1m"] as const)(
- "updates lastUsedContextWindow to %s via setter",
- (value) => {
- usePreferencesStore.getState().setLastUsedContextWindow(value);
- expect(usePreferencesStore.getState().lastUsedContextWindow).toBe(value);
- },
- );
-
- it.each([true, false])(
- "updates lastUsedFastMode to %s via setter",
- (enabled) => {
- usePreferencesStore.getState().setLastUsedFastMode(enabled);
- expect(usePreferencesStore.getState().lastUsedFastMode).toBe(enabled);
- },
- );
-
- it("resets the last-used agent config to a harness's mode and effort", () => {
- usePreferencesStore.getState().setLastUsedContextWindow("200k");
- usePreferencesStore.getState().setLastUsedFastMode(true);
-
- usePreferencesStore.getState().resetLastUsedAgentConfig("auto", "medium");
-
- const state = usePreferencesStore.getState();
- expect(state.lastNewTaskMode).toBe("auto");
- expect(state.lastUsedReasoningEffort).toBe("medium");
- expect(state.lastUsedContextWindow).toBe("1m");
- expect(state.lastUsedFastMode).toBe(false);
- });
-
- it("resets the stale agent selection when migrating a pre-versioned install", () => {
- const migrate = usePreferencesStore.persist.getOptions().migrate;
- const migrated = migrate?.(
- {
- theme: "dark",
- lastUsedReasoningEffort: "ultracode",
- defaultReasoningEffort: "low",
- },
- 0,
- ) as Record<string, unknown>;
-
- expect(migrated).toMatchObject({
- theme: "dark",
- defaultReasoningEffort: "low",
- lastUsedReasoningEffort: "high",
- lastUsedContextWindow: "1m",
- lastUsedFastMode: false,
- });
- });
-});
-
-describe("preferencesStore scale sound with task length", () => {
- it("defaults to false", () => {
- expect(usePreferencesStore.getState().scaleSoundWithTaskLength).toBe(false);
- });
-
- it.each([true, false])("updates to %s via setter", (enabled) => {
- usePreferencesStore.getState().setScaleSoundWithTaskLength(enabled);
- expect(usePreferencesStore.getState().scaleSoundWithTaskLength).toBe(
- enabled,
- );
- });
-
- it("persists the value to storage", async () => {
- const AsyncStorage = (
- await import("@react-native-async-storage/async-storage")
- ).default;
- usePreferencesStore.getState().setScaleSoundWithTaskLength(true);
- await Promise.resolve();
- const persisted = await AsyncStorage.getItem("posthog-preferences");
- expect(persisted).not.toBeNull();
- expect(JSON.parse(persisted as string).state.scaleSoundWithTaskLength).toBe(
- true,
- );
- });
-});
-
-describe("preferencesStore font size", () => {
- it("defaults to a known preference with a 'default' scale of 1", () => {
- const { fontSize } = usePreferencesStore.getState();
- expect(FONT_SCALE_BY_PREFERENCE[fontSize]).toBeGreaterThanOrEqual(1);
- expect(FONT_SCALE_BY_PREFERENCE.default).toBe(1);
- });
-
- it.each([
- ["small", 0.9],
- ["large", 1.15],
- ["xlarge", 1.3],
- ] as const)("FONT_SCALE_BY_PREFERENCE.%s equals %s", (size, expected) => {
- expect(FONT_SCALE_BY_PREFERENCE[size]).toBe(expected);
- });
-
- it.each(["small", "default", "large", "xlarge"] as const)(
- "updates fontSize to %s via setter",
- (size: FontSizePreference) => {
- usePreferencesStore.getState().setFontSize(size);
- expect(usePreferencesStore.getState().fontSize).toBe(size);
- },
- );
-});
diff --git a/products/desktop/apps/mobile/src/features/preferences/stores/preferencesStore.ts b/products/desktop/apps/mobile/src/features/preferences/stores/preferencesStore.ts
deleted file mode 100644
index 527d42cfa2cf..000000000000
--- a/products/desktop/apps/mobile/src/features/preferences/stores/preferencesStore.ts
+++ /dev/null
@@ -1,197 +0,0 @@
-import type { EffortLevel } from "@posthog/shared/domain-types";
-import AsyncStorage from "@react-native-async-storage/async-storage";
-import { Platform } from "react-native";
-import { create } from "zustand";
-import { createJSONStorage, persist } from "zustand/middleware";
-import {
- type ContextWindow,
- DEFAULT_CONTEXT_WINDOW,
-} from "@/features/tasks/composer/options";
-
-export type ThemePreference = "light" | "dark" | "system";
-
-export type FontSizePreference = "small" | "default" | "large" | "xlarge";
-
-/**
- * Multiplier applied to every rendered font size. Consumed by the global
- * `Text.render` patch in `lib/textDefaults`, which scales each text node's
- * explicit `fontSize` by this factor. Children without an explicit size keep
- * inheriting their (already-scaled) parent, so the whole UI scales uniformly.
- */
-export const FONT_SCALE_BY_PREFERENCE: Record<FontSizePreference, number> = {
- small: 0.9,
- default: 1,
- large: 1.15,
- xlarge: 1.3,
-};
-
-/**
- * iOS reads noticeably smaller than Android at the same point size, so iOS
- * ships one notch larger out of the box. Other platforms keep the 1.0
- * baseline. Either way the user can change it in Settings.
- */
-const DEFAULT_FONT_SIZE: FontSizePreference =
- Platform.OS === "ios" ? "large" : "default";
-
-export type CompletionSound =
- | "meep"
- | "meep-smol"
- | "knock"
- | "ring"
- | "shoot"
- | "slide"
- | "drop"
- | "icq";
-
-export type InitialTaskMode = "plan" | "last_used";
-
-export type DefaultReasoningEffort = EffortLevel | "last_used";
-
-interface PreferencesState {
- pingsEnabled: boolean;
- setPingsEnabled: (enabled: boolean) => void;
- pushNotificationsEnabled: boolean;
- setPushNotificationsEnabled: (enabled: boolean) => void;
-
- theme: ThemePreference;
- setTheme: (theme: ThemePreference) => void;
-
- fontSize: FontSizePreference;
- setFontSize: (size: FontSizePreference) => void;
-
- completionSound: CompletionSound;
- setCompletionSound: (sound: CompletionSound) => void;
- completionVolume: number;
- setCompletionVolume: (volume: number) => void;
- scaleSoundWithTaskLength: boolean;
- setScaleSoundWithTaskLength: (enabled: boolean) => void;
-
- defaultInitialTaskMode: InitialTaskMode;
- setDefaultInitialTaskMode: (mode: InitialTaskMode) => void;
- /** Most recent mode the user picked in the new-task composer. Persisted so
- * `defaultInitialTaskMode === "last_used"` can pre-fill it next time. */
- lastNewTaskMode: string;
- setLastNewTaskMode: (mode: string) => void;
-
- defaultReasoningEffort: DefaultReasoningEffort;
- setDefaultReasoningEffort: (effort: DefaultReasoningEffort) => void;
- /** Most recent reasoning effort the user picked. Persisted so
- * `defaultReasoningEffort === "last_used"` can pre-fill it next time. */
- lastUsedReasoningEffort: string;
- setLastUsedReasoningEffort: (effort: string) => void;
-
- /** Most recent context window + fast mode picked in the merged agent config
- * control. Persisted so the next new-task composer restores them. */
- lastUsedContextWindow: ContextWindow;
- setLastUsedContextWindow: (contextWindow: ContextWindow) => void;
- lastUsedFastMode: boolean;
- setLastUsedFastMode: (enabled: boolean) => void;
- /** Resets the last-used agent selection to a new harness's mode/effort with
- * default context window and fast mode off, in one write. */
- resetLastUsedAgentConfig: (mode: string, reasoning: string) => void;
-
- autoPublishCloudRuns: boolean;
- setAutoPublishCloudRuns: (enabled: boolean) => void;
-
- rtkEnabledCloud: boolean;
- setRtkEnabledCloud: (enabled: boolean) => void;
-}
-
-export const usePreferencesStore = create<PreferencesState>()(
- persist(
- (set) => ({
- pingsEnabled: true,
- setPingsEnabled: (enabled) => set({ pingsEnabled: enabled }),
- pushNotificationsEnabled: true,
- setPushNotificationsEnabled: (enabled) =>
- set({ pushNotificationsEnabled: enabled }),
-
- theme: "system",
- setTheme: (theme) => set({ theme }),
-
- fontSize: DEFAULT_FONT_SIZE,
- setFontSize: (size) => set({ fontSize: size }),
-
- completionSound: "meep",
- setCompletionSound: (sound) => set({ completionSound: sound }),
- completionVolume: 70,
- setCompletionVolume: (volume) =>
- set({
- completionVolume: Math.max(0, Math.min(100, Math.round(volume))),
- }),
- scaleSoundWithTaskLength: false,
- setScaleSoundWithTaskLength: (enabled) =>
- set({ scaleSoundWithTaskLength: enabled }),
-
- defaultInitialTaskMode: "plan",
- setDefaultInitialTaskMode: (mode) =>
- set({ defaultInitialTaskMode: mode }),
- lastNewTaskMode: "plan",
- setLastNewTaskMode: (mode) => set({ lastNewTaskMode: mode }),
-
- defaultReasoningEffort: "last_used",
- setDefaultReasoningEffort: (effort) =>
- set({ defaultReasoningEffort: effort }),
- lastUsedReasoningEffort: "high",
- setLastUsedReasoningEffort: (effort) =>
- set({ lastUsedReasoningEffort: effort }),
-
- lastUsedContextWindow: DEFAULT_CONTEXT_WINDOW,
- setLastUsedContextWindow: (contextWindow) =>
- set({ lastUsedContextWindow: contextWindow }),
- lastUsedFastMode: false,
- setLastUsedFastMode: (enabled) => set({ lastUsedFastMode: enabled }),
- resetLastUsedAgentConfig: (mode, reasoning) =>
- set({
- lastNewTaskMode: mode,
- lastUsedReasoningEffort: reasoning,
- lastUsedContextWindow: DEFAULT_CONTEXT_WINDOW,
- lastUsedFastMode: false,
- }),
-
- autoPublishCloudRuns: true,
- setAutoPublishCloudRuns: (enabled) =>
- set({ autoPublishCloudRuns: enabled }),
-
- rtkEnabledCloud: true,
- setRtkEnabledCloud: (enabled) => set({ rtkEnabledCloud: enabled }),
- }),
- {
- name: "posthog-preferences",
- storage: createJSONStorage(() => AsyncStorage),
- // Bumped to 1 when the merged agent config control shipped: existing
- // installs drop their stale last-used agent selection so they land on the
- // new preset defaults instead of a model/effort pair off the new scale.
- version: 1,
- migrate: (persisted, fromVersion) => {
- const state = (persisted ?? {}) as Partial<PreferencesState>;
- if (fromVersion < 1) {
- return {
- ...state,
- lastUsedReasoningEffort: "high",
- lastUsedContextWindow: DEFAULT_CONTEXT_WINDOW,
- lastUsedFastMode: false,
- } as PreferencesState;
- }
- return state as PreferencesState;
- },
- partialize: (state) => ({
- pingsEnabled: state.pingsEnabled,
- pushNotificationsEnabled: state.pushNotificationsEnabled,
- theme: state.theme,
- fontSize: state.fontSize,
- completionSound: state.completionSound,
- completionVolume: state.completionVolume,
- scaleSoundWithTaskLength: state.scaleSoundWithTaskLength,
- defaultInitialTaskMode: state.defaultInitialTaskMode,
- lastNewTaskMode: state.lastNewTaskMode,
- defaultReasoningEffort: state.defaultReasoningEffort,
- lastUsedReasoningEffort: state.lastUsedReasoningEffort,
- lastUsedContextWindow: state.lastUsedContextWindow,
- lastUsedFastMode: state.lastUsedFastMode,
- autoPublishCloudRuns: state.autoPublishCloudRuns,
- rtkEnabledCloud: state.rtkEnabledCloud,
- }),
- },
- ),
-);
diff --git a/products/desktop/apps/mobile/src/features/settings/components/DailyReportLimitRow.tsx b/products/desktop/apps/mobile/src/features/settings/components/DailyReportLimitRow.tsx
deleted file mode 100644
index ad58653769b6..000000000000
--- a/products/desktop/apps/mobile/src/features/settings/components/DailyReportLimitRow.tsx
+++ /dev/null
@@ -1,205 +0,0 @@
-import { Text } from "@components/text";
-import {
- dailyReportLimitFieldValue,
- describeDailyReportLimit,
- parseDailyReportLimit,
-} from "@posthog/core/inbox/dailyReportLimit";
-import { CaretRight } from "phosphor-react-native";
-import { useState } from "react";
-import {
- ActivityIndicator,
- KeyboardAvoidingView,
- Platform,
- Pressable,
- TextInput,
- View,
-} from "react-native";
-import { SheetContainer } from "@/components/SheetContainer";
-import {
- useSignalTeamConfig,
- useUpdateMaxReportsPerDay,
-} from "@/features/inbox/hooks/useSignalTeamConfig";
-import { useThemeColors } from "@/lib/theme";
-
-export function DailyReportLimitRow() {
- const themeColors = useThemeColors();
- const { data: config, isLoading, isError } = useSignalTeamConfig();
- const updateLimit = useUpdateMaxReportsPerDay();
- const [sheetOpen, setSheetOpen] = useState(false);
- const [draft, setDraft] = useState("");
- const [error, setError] = useState<string | null>(null);
-
- const status = describeDailyReportLimit(config);
- const savedValue = dailyReportLimitFieldValue(config);
- // A failed background refetch keeps the cached config while flipping isError,
- // so only treat the case with no cached config as a hard error. Otherwise a
- // transient failure would hide a known cap and block editing a value the user
- // can still read from cache.
- const showLoadError = isError && config === undefined;
- const rightLabel = showLoadError
- ? "—"
- : status.limit === null
- ? "No limit"
- : String(status.limit);
-
- // Reset the field from the saved value when the sheet opens (an event, not a
- // prop-sync effect).
- const openSheet = () => {
- setDraft(savedValue);
- setError(null);
- setSheetOpen(true);
- };
-
- const save = async (limit: number | null) => {
- setError(null);
- try {
- await updateLimit.mutateAsync(limit);
- setSheetOpen(false);
- } catch (e) {
- setError(e instanceof Error ? e.message : "Failed to save the limit.");
- }
- };
-
- const handleSave = () => {
- const parsed = parseDailyReportLimit(draft);
- if (!parsed.ok) {
- setError(parsed.error);
- return;
- }
- void save(parsed.value);
- };
-
- return (
- <>
- <Pressable
- onPress={openSheet}
- disabled={isLoading || showLoadError}
- className={`active:bg-gray-2 ${isLoading || showLoadError ? "opacity-50" : ""}`}
- >
- <View className="flex-row items-center gap-3 border-gray-5 border-b px-4 py-3">
- <View className="min-w-0 flex-1">
- <Text className="font-medium text-[15px] text-gray-12">
- Daily report limit
- </Text>
- <Text
- className={`mt-0.5 text-[12px] leading-snug ${showLoadError ? "text-status-error" : "text-gray-10"}`}
- >
- {showLoadError
- ? "Couldn't load the limit. Try again later."
- : status.usageText}
- </Text>
- {!showLoadError && status.reachedText ? (
- <Text className="mt-0.5 text-[12px] text-status-warning leading-snug">
- {status.reachedText}
- </Text>
- ) : null}
- </View>
- <View className="shrink-0 flex-row items-center gap-2">
- <Text className="text-[14px] text-gray-11">{rightLabel}</Text>
- <CaretRight size={14} color={themeColors.gray[10]} />
- </View>
- </View>
- </Pressable>
-
- <DailyReportLimitSheet
- open={sheetOpen}
- draft={draft}
- error={error}
- isSaving={updateLimit.isPending}
- hasSavedValue={savedValue !== ""}
- onChangeDraft={(text) => {
- setDraft(text);
- setError(null);
- }}
- onClose={() => setSheetOpen(false)}
- onSave={handleSave}
- onClear={() => void save(null)}
- />
- </>
- );
-}
-
-interface DailyReportLimitSheetProps {
- open: boolean;
- draft: string;
- error: string | null;
- isSaving: boolean;
- hasSavedValue: boolean;
- onChangeDraft: (text: string) => void;
- onClose: () => void;
- onSave: () => void;
- onClear: () => void;
-}
-
-function DailyReportLimitSheet({
- open,
- draft,
- error,
- isSaving,
- hasSavedValue,
- onChangeDraft,
- onClose,
- onSave,
- onClear,
-}: DailyReportLimitSheetProps) {
- const themeColors = useThemeColors();
-
- return (
- <SheetContainer open={open} onClose={onClose}>
- <KeyboardAvoidingView
- behavior={Platform.OS === "ios" ? "padding" : undefined}
- >
- <View className="gap-3 px-4 pt-2 pb-2">
- <Text className="font-semibold text-[16px] text-gray-12">
- Daily report limit
- </Text>
- <Text className="text-[13px] text-gray-10 leading-snug">
- Cap how many new reports reach the inbox each day. Leave the field
- empty for no limit.
- </Text>
-
- <TextInput
- value={draft}
- onChangeText={onChangeDraft}
- keyboardType="number-pad"
- placeholder="No limit"
- placeholderTextColor={themeColors.gray[9]}
- editable={!isSaving}
- className="rounded-lg border border-gray-6 bg-gray-2 px-3 py-2.5 text-[15px] text-gray-12"
- />
-
- {error ? (
- <Text className="text-[12.5px] text-status-error">{error}</Text>
- ) : null}
-
- <View className="flex-row gap-2">
- <Pressable
- onPress={onSave}
- disabled={isSaving}
- className={`flex-1 flex-row items-center justify-center rounded-lg bg-accent-9 py-3 ${isSaving ? "opacity-60" : "active:opacity-80"}`}
- >
- {isSaving ? (
- <ActivityIndicator size="small" color={themeColors.gray[1]} />
- ) : (
- <Text className="font-semibold text-[15px] text-gray-1">
- Save
- </Text>
- )}
- </Pressable>
- {hasSavedValue ? (
- <Pressable
- onPress={onClear}
- disabled={isSaving}
- className={`flex-row items-center justify-center rounded-lg border border-gray-6 px-4 py-3 ${isSaving ? "opacity-60" : "active:bg-gray-2"}`}
- >
- <Text className="font-semibold text-[15px] text-gray-12">
- Clear
- </Text>
- </Pressable>
- ) : null}
- </View>
- </View>
- </KeyboardAvoidingView>
- </SheetContainer>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/settings/components/DebugInfoSection.tsx b/products/desktop/apps/mobile/src/features/settings/components/DebugInfoSection.tsx
deleted file mode 100644
index 8f1dda91ed9a..000000000000
--- a/products/desktop/apps/mobile/src/features/settings/components/DebugInfoSection.tsx
+++ /dev/null
@@ -1,117 +0,0 @@
-import { Text } from "@components/text";
-import * as Application from "expo-application";
-import * as Clipboard from "expo-clipboard";
-import Constants from "expo-constants";
-import * as Haptics from "expo-haptics";
-import { Copy } from "phosphor-react-native";
-import { useState } from "react";
-import { Platform, Pressable, View } from "react-native";
-import { useThemeColors } from "@/lib/theme";
-import { SettingsRow } from "./SettingsRow";
-import { SettingsSection } from "./SettingsSection";
-
-interface DebugInfoSectionProps {
- cloudRegion: string | null;
- projectId: number | null;
- userId?: number;
- userUuid?: string;
-}
-
-/**
- * Staff-only diagnostics shown at the bottom of Settings. Surfaces the build /
- * version identifiers we need to tell exactly which binary a user is running
- * (native app version + build number, runtime version, EAS project, execution
- * environment) plus the active region/project/user. Gate rendering on
- * `is_staff` at the call site — this component does not check itself.
- */
-export function DebugInfoSection({
- cloudRegion,
- projectId,
- userId,
- userUuid,
-}: DebugInfoSectionProps) {
- const themeColors = useThemeColors();
- const [copied, setCopied] = useState(false);
-
- const appVersion =
- Application.nativeApplicationVersion ??
- Constants.expoConfig?.version ??
- "—";
- const buildVersion = Application.nativeBuildVersion ?? "—";
- const bundleId = Application.applicationId ?? "—";
- const runtimeVersion =
- typeof Constants.expoConfig?.runtimeVersion === "string"
- ? Constants.expoConfig.runtimeVersion
- : "—";
- const easProjectId =
- (Constants.expoConfig?.extra?.eas?.projectId as string | undefined) ?? "—";
- const platform = `${Platform.OS} ${String(Platform.Version)}`;
- const executionEnv = Constants.executionEnvironment ?? "—";
- const buildType = __DEV__ ? "development" : "production";
-
- // Build-number label differs by platform (iOS buildNumber vs Android
- // versionCode) — name it so staff aren't guessing which they're reading.
- const buildLabel =
- Platform.OS === "android" ? "Version code" : "Build number";
-
- const rows: Array<{ label: string; value: string }> = [
- { label: "App version", value: appVersion },
- { label: buildLabel, value: buildVersion },
- { label: "Runtime version", value: runtimeVersion },
- { label: "Build type", value: buildType },
- { label: "Execution env", value: executionEnv },
- { label: "Platform", value: platform },
- { label: "Bundle ID", value: bundleId },
- { label: "EAS project", value: easProjectId },
- { label: "Region", value: cloudRegion?.toUpperCase() ?? "—" },
- { label: "Project ID", value: projectId != null ? String(projectId) : "—" },
- { label: "User ID", value: userId != null ? String(userId) : "—" },
- { label: "User UUID", value: userUuid ?? "—" },
- ];
-
- const handleCopy = async () => {
- const payload = rows.map((r) => `${r.label}: ${r.value}`).join("\n");
- await Clipboard.setStringAsync(payload);
- Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success).catch(
- () => {},
- );
- setCopied(true);
- setTimeout(() => setCopied(false), 1500);
- };
-
- return (
- <SettingsSection
- title="Debug info"
- description="Staff only — useful for identifying which build this is"
- >
- {rows.map((row, index) => (
- <SettingsRow
- key={row.label}
- label={row.label}
- showDivider={index < rows.length - 1}
- rightSlot={
- <Text
- className="max-w-[220px] text-right text-[13px] text-gray-11"
- numberOfLines={1}
- selectable
- >
- {row.value}
- </Text>
- }
- />
- ))}
- <View className="border-gray-5 border-t px-4 py-3">
- <Pressable
- onPress={handleCopy}
- hitSlop={6}
- className="flex-row items-center justify-center gap-2 rounded-md border border-gray-6 bg-gray-3 py-2.5 active:opacity-60"
- >
- <Copy size={15} color={themeColors.gray[12]} />
- <Text className="font-medium text-[14px] text-gray-12">
- {copied ? "Copied!" : "Copy debug info"}
- </Text>
- </Pressable>
- </View>
- </SettingsSection>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/settings/components/FloatingSettingsHeader.tsx b/products/desktop/apps/mobile/src/features/settings/components/FloatingSettingsHeader.tsx
deleted file mode 100644
index 4c7a5c876f26..000000000000
--- a/products/desktop/apps/mobile/src/features/settings/components/FloatingSettingsHeader.tsx
+++ /dev/null
@@ -1,74 +0,0 @@
-import { Text } from "@components/text";
-import { LinearGradient } from "expo-linear-gradient";
-import { useRouter } from "expo-router";
-import { CaretLeft } from "phosphor-react-native";
-import { Pressable, View } from "react-native";
-import { useSafeAreaInsets } from "react-native-safe-area-context";
-import { toRgba, useThemeColors } from "@/lib/theme";
-
-/**
- * Floating header for the settings screen — back arrow on the left and a
- * centered "Settings" title. Sits over the content with a top-to-bottom fade
- * so the scrolled list disappears gracefully behind it.
- */
-export function FloatingSettingsHeader() {
- const router = useRouter();
- const insets = useSafeAreaInsets();
- const themeColors = useThemeColors();
-
- const handleBack = () => {
- if (router.canGoBack()) {
- router.back();
- return;
- }
- router.replace("/tasks");
- };
-
- const fadeHeight = insets.top + 88;
-
- return (
- <View
- pointerEvents="box-none"
- className="absolute inset-x-0 top-0 z-10"
- style={{ height: fadeHeight }}
- >
- <LinearGradient
- pointerEvents="none"
- colors={[
- toRgba(themeColors.background, 1),
- toRgba(themeColors.background, 0.92),
- toRgba(themeColors.background, 0),
- ]}
- locations={[0, 0.65, 1]}
- style={{ position: "absolute", top: 0, left: 0, right: 0, bottom: 0 }}
- />
-
- <View
- className="flex-row items-center px-3"
- style={{ paddingTop: insets.top + 6, paddingBottom: 8 }}
- >
- <Pressable
- onPress={handleBack}
- hitSlop={10}
- className="h-11 w-11 items-center justify-center active:opacity-60"
- accessibilityLabel="Back"
- accessibilityRole="button"
- >
- <CaretLeft size={22} color={themeColors.gray[12]} weight="bold" />
- </Pressable>
-
- <View className="min-w-0 flex-1 items-center px-2">
- <Text
- className="font-semibold text-[17px] text-gray-12"
- numberOfLines={1}
- >
- Settings
- </Text>
- </View>
-
- {/* Right spacer to keep the title visually centered against the back button. */}
- <View className="h-11 w-11" />
- </View>
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/settings/components/SettingsRow.tsx b/products/desktop/apps/mobile/src/features/settings/components/SettingsRow.tsx
deleted file mode 100644
index d60cb39b02ad..000000000000
--- a/products/desktop/apps/mobile/src/features/settings/components/SettingsRow.tsx
+++ /dev/null
@@ -1,69 +0,0 @@
-import { Text } from "@components/text";
-import type { ReactNode } from "react";
-import { Pressable, View } from "react-native";
-
-interface BaseRowProps {
- label: string;
- description?: string;
- /** Right-aligned content (value, switch, chevron, etc.). */
- rightSlot?: ReactNode;
- /** Set `false` to hide the bottom divider — typically the last row in a section. */
- showDivider?: boolean;
-}
-
-interface DisplayRowProps extends BaseRowProps {
- onPress?: never;
- disabled?: never;
-}
-
-interface PressableRowProps extends BaseRowProps {
- onPress: () => void;
- disabled?: boolean;
-}
-
-type SettingsRowProps = DisplayRowProps | PressableRowProps;
-
-/**
- * One row inside a `SettingsSection`. Label + optional description on the
- * left, action / value on the right. Used as a building block for switch
- * rows, picker rows, info rows, and action rows.
- */
-export function SettingsRow(props: SettingsRowProps) {
- const { label, description, rightSlot, showDivider = true } = props;
- const onPress = "onPress" in props ? props.onPress : undefined;
- const disabled = "disabled" in props ? props.disabled : undefined;
-
- const Body = (
- <View
- className={`flex-row items-center gap-3 px-4 py-3 ${showDivider ? "border-gray-5 border-b" : ""}`}
- >
- <View className="min-w-0 flex-1">
- <Text className="font-medium text-[15px] text-gray-12">{label}</Text>
- {description ? (
- <Text className="mt-0.5 text-[12px] text-gray-10 leading-snug">
- {description}
- </Text>
- ) : null}
- </View>
- {rightSlot ? (
- <View className="shrink-0 flex-row items-center gap-2">
- {rightSlot}
- </View>
- ) : null}
- </View>
- );
-
- if (onPress) {
- return (
- <Pressable
- onPress={onPress}
- disabled={disabled}
- className={`active:bg-gray-2 ${disabled ? "opacity-50" : ""}`}
- >
- {Body}
- </Pressable>
- );
- }
-
- return Body;
-}
diff --git a/products/desktop/apps/mobile/src/features/settings/components/SettingsSection.tsx b/products/desktop/apps/mobile/src/features/settings/components/SettingsSection.tsx
deleted file mode 100644
index f9526e4f70a0..000000000000
--- a/products/desktop/apps/mobile/src/features/settings/components/SettingsSection.tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-import { Text } from "@components/text";
-import type { ReactNode } from "react";
-import { View } from "react-native";
-
-interface SettingsSectionProps {
- title: string;
- description?: string;
- children: ReactNode;
-}
-
-/**
- * Grouped section of setting rows. Renders a labelled title above a rounded
- * card. Mirrors the desktop `SettingRow` grouping pattern: a small section
- * heading and an outlined panel of rows below it.
- */
-export function SettingsSection({
- title,
- description,
- children,
-}: SettingsSectionProps) {
- return (
- <View className="mb-6">
- <Text className="mb-2 px-1 font-medium text-[13px] text-gray-11 uppercase">
- {title}
- </Text>
- {description ? (
- <Text className="mb-2 px-1 text-[12px] text-gray-10 leading-snug">
- {description}
- </Text>
- ) : null}
- <View className="overflow-hidden rounded-2xl border border-gray-5 bg-card">
- {children}
- </View>
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/api.test.ts b/products/desktop/apps/mobile/src/features/tasks/api.test.ts
deleted file mode 100644
index bcb3f5c1f0a3..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/api.test.ts
+++ /dev/null
@@ -1,230 +0,0 @@
-import { beforeEach, describe, expect, it, vi } from "vitest";
-
-const { mockFetch, mockRunTaskInCloud } = vi.hoisted(() => ({
- mockFetch: vi.fn(),
- mockRunTaskInCloud: vi.fn(),
-}));
-
-vi.mock("expo/fetch", () => ({
- fetch: mockFetch,
-}));
-
-vi.mock("@/lib/api", () => ({
- HttpError: class HttpError extends Error {
- constructor(
- readonly status: number,
- readonly statusText: string,
- message: string,
- ) {
- super(message);
- this.name = "HttpError";
- }
- },
- getBaseUrl: () => "https://app.posthog.test",
- getProjectId: () => 42,
- getAccessToken: () => "token",
- createTimeoutSignal: () => undefined,
- authedFetch: (url: string, init?: RequestInit) =>
- mockFetch(url, {
- ...init,
- headers: {
- Authorization: "Bearer token",
- "Content-Type": "application/json",
- ...((init?.headers as Record<string, string> | undefined) ?? {}),
- },
- }),
-}));
-
-vi.mock("@/lib/posthogApiClient", () => ({
- getPostHogApiClient: () => ({ runTaskInCloud: mockRunTaskInCloud }),
-}));
-
-import {
- cancelRun,
- HttpError,
- presignTaskRunArtifact,
- runTaskInCloud,
-} from "./api";
-
-function bodyOf(call: unknown): Record<string, unknown> {
- const [, init] = call as [string, RequestInit];
- return JSON.parse(init.body as string);
-}
-
-describe("runTaskInCloud", () => {
- beforeEach(() => {
- mockRunTaskInCloud.mockReset();
- mockRunTaskInCloud.mockResolvedValue({ id: "task-1" });
- });
-
- it.each([true, false])(
- "forwards auto_publish=%s to the payload",
- async (flag) => {
- await runTaskInCloud("task-1", { autoPublish: flag });
-
- expect(mockRunTaskInCloud).toHaveBeenCalledWith(
- "task-1",
- undefined,
- expect.objectContaining({ autoPublish: flag }),
- );
- },
- );
-
- it("omits auto_publish when not provided", async () => {
- await runTaskInCloud("task-1", { model: "claude-opus-4-8" });
-
- expect(mockRunTaskInCloud).toHaveBeenCalledWith(
- "task-1",
- undefined,
- expect.objectContaining({ autoPublish: undefined }),
- );
- });
-
- it("sends no body for the plain initial run", async () => {
- await runTaskInCloud("task-1");
-
- expect(mockRunTaskInCloud).toHaveBeenCalledWith("task-1");
- });
-
- it("forwards the selected sandbox environment and custom image", async () => {
- await runTaskInCloud("task-1", {
- sandboxEnvironmentId: "environment-123",
- customImageId: "image-123",
- });
-
- expect(mockRunTaskInCloud).toHaveBeenCalledWith(
- "task-1",
- undefined,
- expect.objectContaining({
- sandboxEnvironmentId: "environment-123",
- customImageId: "image-123",
- }),
- );
- });
-
- it("omits the sandbox environment and custom image when unset", async () => {
- await runTaskInCloud("task-1", {
- model: "claude-opus-4-8",
- sandboxEnvironmentId: null,
- customImageId: null,
- });
-
- expect(mockRunTaskInCloud).toHaveBeenCalledWith(
- "task-1",
- undefined,
- expect.objectContaining({
- sandboxEnvironmentId: undefined,
- customImageId: undefined,
- }),
- );
- });
-
- it("sends rtk_enabled=false when the run opts out", async () => {
- await runTaskInCloud("task-1", { rtkEnabled: false });
-
- expect(mockRunTaskInCloud).toHaveBeenCalledWith(
- "task-1",
- undefined,
- expect.objectContaining({ rtkEnabled: false }),
- );
- });
-
- it("omits rtk_enabled when the run keeps compression on", async () => {
- await runTaskInCloud("task-1", { rtkEnabled: true });
-
- expect(mockRunTaskInCloud).toHaveBeenCalledWith(
- "task-1",
- undefined,
- expect.objectContaining({ rtkEnabled: true }),
- );
- });
-});
-
-describe("cancelRun", () => {
- beforeEach(() => {
- mockFetch.mockReset();
- });
-
- it("POSTs to the run cancel endpoint with an empty body", async () => {
- mockFetch.mockResolvedValue(
- new Response(JSON.stringify({ status: "cancelled" }), { status: 200 }),
- );
-
- const result = await cancelRun("task-1", "run-1");
-
- const [url, init] = mockFetch.mock.calls[0] as [string, RequestInit];
- expect(url).toBe(
- "https://app.posthog.test/api/projects/42/tasks/task-1/runs/run-1/cancel/",
- );
- expect(init.method).toBe("POST");
- expect(bodyOf(mockFetch.mock.calls[0])).toEqual({});
- expect(result).toEqual({ status: "cancelled" });
- });
-
- it("forwards a reason when provided", async () => {
- mockFetch.mockResolvedValue(new Response("{}", { status: 200 }));
-
- await cancelRun("task-1", "run-1", "user requested");
-
- expect(bodyOf(mockFetch.mock.calls[0])).toEqual({
- reason: "user requested",
- });
- });
-
- it("throws with the backend error message on failure", async () => {
- mockFetch.mockResolvedValue(
- new Response(JSON.stringify({ error: "Run already finished" }), {
- status: 409,
- }),
- );
-
- await expect(cancelRun("task-1", "run-1")).rejects.toMatchObject({
- status: 409,
- message: expect.stringContaining("Run already finished"),
- });
- });
-
- it("falls back to a generic message when the body has no error", async () => {
- mockFetch.mockResolvedValue(new Response("boom", { status: 500 }));
-
- await expect(cancelRun("task-1", "run-1")).rejects.toBeInstanceOf(
- HttpError,
- );
- });
-});
-
-describe("presignTaskRunArtifact", () => {
- beforeEach(() => {
- mockFetch.mockReset();
- });
-
- it("posts the storage path and returns the presigned URL", async () => {
- mockFetch.mockResolvedValue(
- new Response(
- JSON.stringify({ url: "https://s3.example.com/x.png?sig=abc" }),
- { status: 200 },
- ),
- );
-
- await expect(
- presignTaskRunArtifact("task-1", "run-1", "tasks/run-1/artifacts/x.png"),
- ).resolves.toBe("https://s3.example.com/x.png?sig=abc");
-
- const [url, init] = mockFetch.mock.calls[0] as [string, RequestInit];
- expect(url).toBe(
- "https://app.posthog.test/api/projects/42/tasks/task-1/runs/run-1/artifacts/presign/",
- );
- expect(init.method).toBe("POST");
- expect(bodyOf(mockFetch.mock.calls[0])).toEqual({
- storage_path: "tasks/run-1/artifacts/x.png",
- });
- });
-
- it("throws an HttpError on a non-OK response", async () => {
- mockFetch.mockResolvedValue(new Response("nope", { status: 500 }));
-
- await expect(
- presignTaskRunArtifact("task-1", "run-1", "tasks/run-1/artifacts/x.png"),
- ).rejects.toBeInstanceOf(HttpError);
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/tasks/api.ts b/products/desktop/apps/mobile/src/features/tasks/api.ts
deleted file mode 100644
index 64f25e8cd95a..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/api.ts
+++ /dev/null
@@ -1,402 +0,0 @@
-import type {
- Adapter,
- ExecutionMode,
- StoredLogEntry,
- Task,
- TaskRun,
- TaskRunArtifact,
-} from "@posthog/shared";
-import { fetch } from "expo/fetch";
-import {
- authedFetch,
- getAccessToken,
- getBaseUrl,
- getProjectId,
- HttpError,
-} from "@/lib/api";
-import { getPostHogApiClient } from "@/lib/posthogApiClient";
-
-export { HttpError } from "@/lib/api";
-
-async function withRetry<T>(
- fn: () => Promise<T>,
- options: {
- maxRetries?: number;
- baseDelayMs?: number;
- shouldRetry?: (error: unknown) => boolean;
- } = {},
-): Promise<T> {
- const { maxRetries = 3, baseDelayMs = 200, shouldRetry } = options;
-
- for (let attempt = 1; attempt <= maxRetries; attempt++) {
- try {
- return await fn();
- } catch (error) {
- const isLastAttempt = attempt === maxRetries;
- const canRetry = shouldRetry ? shouldRetry(error) : true;
-
- if (isLastAttempt || !canRetry) {
- throw error;
- }
-
- const delay = baseDelayMs * 2 ** (attempt - 1);
- await new Promise((resolve) => setTimeout(resolve, delay));
- }
- }
- throw new Error("Unreachable");
-}
-
-function isRetryableError(error: unknown): boolean {
- if (
- error instanceof Error &&
- "status" in error &&
- typeof error.status === "number"
- ) {
- return error.status >= 500 && error.status < 600;
- }
- if (error instanceof Error) {
- const message = error.message.toLowerCase();
- if (message.includes("network")) return true;
- if (message.includes("timeout")) return true;
- if (message.includes("econnreset")) return true;
- }
- return false;
-}
-
-export interface RunTaskInCloudOptions {
- branch?: string | null;
- resumeFromRunId?: string;
- pendingUserMessage?: string;
- mode?: "interactive" | "background";
- /** Adapter to use on the cloud runner. Currently only "claude" on mobile. */
- runtimeAdapter?: Adapter;
- /** Gateway model ID, e.g. "claude-opus-4-8". */
- model?: string;
- /** Reasoning effort: "low" | "medium" | "high" (model-dependent). */
- reasoningEffort?: string;
- /** Context window size; only sent for models that support the 1M beta. */
- contextWindow?: "200k" | "1m";
- /** Fast mode; only sent for models that support it. */
- fastMode?: boolean;
- /** Permission mode: "default" | "acceptEdits" | "plan" | "auto". */
- initialPermissionMode?: string;
- /** Source that triggered this run. */
- runSource?: "manual" | "signal_report";
- /** Signal report ID when run_source is "signal_report". */
- signalReportId?: string;
- /** When true, the cloud run pushes its changes and opens a draft PR on
- * completion without waiting for an explicit ask. */
- autoPublish?: boolean;
- /** Only false is sent: opts the run out of rtk command-output compression. */
- rtkEnabled?: boolean;
- sandboxEnvironmentId?: string | null;
- customImageId?: string | null;
-}
-
-export async function runTaskInCloud(
- taskId: string,
- options?: RunTaskInCloudOptions,
-): Promise<Task> {
- if (!options) {
- return getPostHogApiClient().runTaskInCloud(taskId);
- }
-
- return getPostHogApiClient().runTaskInCloud(taskId, options.branch, {
- adapter: options.runtimeAdapter,
- model: options.model,
- reasoningLevel: options.reasoningEffort,
- contextWindow: options.contextWindow,
- fastMode: options.fastMode,
- initialPermissionMode: options.initialPermissionMode as
- | ExecutionMode
- | undefined,
- runSource: options.runSource,
- signalReportId: options.signalReportId,
- autoPublish: options.autoPublish,
- rtkEnabled: options.rtkEnabled,
- sandboxEnvironmentId: options.sandboxEnvironmentId ?? undefined,
- customImageId: options.customImageId ?? undefined,
- resumeFromRunId: options.resumeFromRunId,
- pendingUserMessage: options.pendingUserMessage,
- });
-}
-
-export async function getTaskRun(
- taskId: string,
- runId: string,
-): Promise<TaskRun> {
- const baseUrl = getBaseUrl();
- const projectId = getProjectId();
-
- const response = await authedFetch(
- `${baseUrl}/api/projects/${projectId}/tasks/${taskId}/runs/${runId}/`,
- );
-
- if (!response.ok) {
- throw new HttpError(
- response.status,
- response.statusText,
- "Failed to fetch task run",
- );
- }
-
- return await response.json();
-}
-
-/**
- * Exchanges an artifact's storage path for a short-lived presigned S3 URL used
- * to render image attachment previews.
- */
-export async function presignTaskRunArtifact(
- taskId: string,
- runId: string,
- storagePath: string,
-): Promise<string> {
- const baseUrl = getBaseUrl();
- const projectId = getProjectId();
-
- const response = await authedFetch(
- `${baseUrl}/api/projects/${projectId}/tasks/${taskId}/runs/${runId}/artifacts/presign/`,
- {
- method: "POST",
- body: JSON.stringify({ storage_path: storagePath }),
- },
- );
-
- if (!response.ok) {
- throw new HttpError(
- response.status,
- response.statusText,
- "Failed to generate artifact preview URL",
- );
- }
-
- const data = (await response.json()) as { url: string };
- return data.url;
-}
-
-/** Hides or restores every version of a file on the run, returning the updated manifest. */
-export async function dismissTaskRunArtifacts(
- taskId: string,
- runId: string,
- artifactIds: string[],
- dismissed: boolean,
-): Promise<TaskRunArtifact[]> {
- const baseUrl = getBaseUrl();
- const projectId = getProjectId();
-
- const response = await authedFetch(
- `${baseUrl}/api/projects/${projectId}/tasks/${taskId}/runs/${runId}/artifacts/dismiss/`,
- {
- method: "POST",
- body: JSON.stringify({ artifact_ids: artifactIds, dismissed }),
- },
- );
-
- if (!response.ok) {
- throw new HttpError(
- response.status,
- response.statusText,
- "Failed to update artifact",
- );
- }
-
- const data = (await response.json()) as { artifacts?: TaskRunArtifact[] };
- return data.artifacts ?? [];
-}
-
-export async function cancelRun(
- taskId: string,
- runId: string,
- reason?: string,
-): Promise<{ status?: string }> {
- const baseUrl = getBaseUrl();
- const projectId = getProjectId();
-
- const response = await authedFetch(
- `${baseUrl}/api/projects/${projectId}/tasks/${taskId}/runs/${runId}/cancel/`,
- {
- method: "POST",
- body: JSON.stringify(reason ? { reason } : {}),
- },
- );
-
- if (!response.ok) {
- const payload = (await response.json().catch(() => null)) as {
- error?: unknown;
- } | null;
- const message =
- typeof payload?.error === "string" && payload.error
- ? payload.error
- : "Failed to stop run";
- throw new HttpError(response.status, response.statusText, message);
- }
-
- return (await response.json().catch(() => ({}))) as { status?: string };
-}
-
-export async function appendTaskRunLog(
- taskId: string,
- runId: string,
- entries: StoredLogEntry[],
-): Promise<void> {
- return withRetry(
- async () => {
- const baseUrl = getBaseUrl();
- const projectId = getProjectId();
-
- const response = await authedFetch(
- `${baseUrl}/api/projects/${projectId}/tasks/${taskId}/runs/${runId}/append_log/`,
- {
- method: "POST",
- body: JSON.stringify({ entries }),
- },
- );
-
- if (!response.ok) {
- throw new HttpError(
- response.status,
- response.statusText,
- "Failed to append log",
- );
- }
- },
- { shouldRetry: isRetryableError },
- );
-}
-
-/**
- * Structured error thrown by `sendCloudCommand`. Exposes the HTTP status and
- * the backend error payload so callers can branch on specific failure modes
- * (e.g. "No active sandbox for this task run" → trigger a resume flow).
- */
-export class CloudCommandError extends Error {
- readonly status: number;
- readonly backendError: string | null;
- readonly method: string;
-
- constructor(
- method: string,
- status: number,
- backendError: string | null,
- message: string,
- ) {
- super(message);
- this.name = "CloudCommandError";
- this.method = method;
- this.status = status;
- this.backendError = backendError;
- }
-
- /** True when the cloud sandbox for this run has terminated. */
- isSandboxInactive(): boolean {
- return (
- !!this.backendError?.includes("No active sandbox") ||
- !!this.backendError?.includes("returned 404") ||
- this.status === 404
- );
- }
-}
-
-/**
- * Sends a JSON-RPC command to a running cloud task. This is the correct path
- * for delivering follow-up user prompts to the agent — it gets translated into
- * `session/prompt` on the agent side. Note: `appendTaskRunLog` only writes to
- * S3 for display; it does NOT notify the agent.
- */
-export async function sendCloudCommand(
- taskId: string,
- runId: string,
- method: string,
- params: Record<string, unknown> = {},
-): Promise<unknown> {
- const baseUrl = getBaseUrl();
- const projectId = getProjectId();
-
- const body = {
- jsonrpc: "2.0",
- method,
- params,
- id: `posthog-mobile-${Date.now()}`,
- };
-
- const response = await authedFetch(
- `${baseUrl}/api/projects/${projectId}/tasks/${taskId}/runs/${runId}/command/`,
- {
- method: "POST",
- body: JSON.stringify(body),
- },
- );
-
- if (!response.ok) {
- const text = await response.text().catch(() => "");
- let backendError: string | null = null;
- try {
- const parsed = JSON.parse(text);
- backendError =
- typeof parsed?.error === "string"
- ? parsed.error
- : (parsed?.error?.message ?? null);
- } catch {
- backendError = text || null;
- }
- throw new CloudCommandError(
- method,
- response.status,
- backendError,
- `Cloud command '${method}' failed: ${response.status} ${response.statusText} ${text}`,
- );
- }
-
- const data = await response.json();
- if (data?.error) {
- const message =
- typeof data.error === "string"
- ? data.error
- : (data.error.message ?? JSON.stringify(data.error));
- throw new CloudCommandError(
- method,
- 200,
- message,
- `Cloud command '${method}' error: ${message}`,
- );
- }
- return data?.result;
-}
-
-export interface StreamCloudTaskOptions {
- lastEventId?: string | null;
- startLatest?: boolean;
- signal: AbortSignal;
-}
-
-export async function streamCloudTask(
- taskId: string,
- runId: string,
- options: StreamCloudTaskOptions,
-): Promise<Response> {
- const baseUrl = getBaseUrl();
- const projectId = getProjectId();
- const accessToken = getAccessToken();
-
- const url = new URL(
- `${baseUrl}/api/projects/${projectId}/tasks/${taskId}/runs/${runId}/stream/`,
- );
- if (options.startLatest && !options.lastEventId) {
- url.searchParams.set("start", "latest");
- }
-
- const headers: Record<string, string> = {
- Accept: "text/event-stream",
- Authorization: `Bearer ${accessToken}`,
- };
- if (options.lastEventId) {
- headers["Last-Event-ID"] = options.lastEventId;
- }
-
- return await fetch(url.toString(), {
- method: "GET",
- headers,
- signal: options.signal,
- });
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/components/ArtifactPreview.test.tsx b/products/desktop/apps/mobile/src/features/tasks/components/ArtifactPreview.test.tsx
deleted file mode 100644
index 075a6f50a3a8..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/components/ArtifactPreview.test.tsx
+++ /dev/null
@@ -1,195 +0,0 @@
-import type { TaskRunArtifact } from "@posthog/shared";
-import { createElement } from "react";
-import WebView from "react-native-webview";
-import { act, create } from "react-test-renderer";
-import { beforeEach, describe, expect, it, vi } from "vitest";
-import { ArtifactPreview } from "./ArtifactPreview";
-
-const mockPreview = vi.fn();
-const mockQuery = vi.fn();
-const mockOpenExternalUrl = vi.hoisted(() => vi.fn());
-
-vi.mock("../hooks/useCloudAttachmentPreview", () => ({
- useCloudAttachmentPreview: () => mockPreview(),
-}));
-
-vi.mock("@tanstack/react-query", () => ({
- useQuery: () => mockQuery(),
-}));
-
-vi.mock("react-native-webview", () => ({
- default: (props: Record<string, unknown>) => createElement("WebView", props),
-}));
-
-vi.mock("@posthog/core/mcp-apps/csp", () => ({
- applyCspToHtml: (html: string) => `csp:${html}`,
-}));
-
-vi.mock("@/features/chat", () => ({
- MarkdownText: (props: Record<string, unknown>) =>
- createElement("MarkdownText", props),
-}));
-
-vi.mock("@/lib/openExternalUrl", () => ({
- openExternalUrl: mockOpenExternalUrl,
-}));
-
-vi.mock("@/lib/theme", () => ({
- useThemeColors: () => ({
- gray: { 9: "#999", 11: "#555", 12: "#111" },
- accent: { 9: "#f54d00" },
- }),
-}));
-
-// The global react-native mock renders Modal through a DOM portal that is a
-// no-op under the node test env, so its children never mount. Substitute plain
-// host elements for the components the preview uses so the body is inspectable.
-vi.mock("react-native", () => {
- const host = (name: string) => (props: Record<string, unknown>) =>
- createElement(name, props);
- return {
- ActivityIndicator: host("ActivityIndicator"),
- Image: host("Image"),
- Modal: host("Modal"),
- Pressable: host("Pressable"),
- ScrollView: host("ScrollView"),
- Text: host("Text"),
- View: host("View"),
- };
-});
-
-function mount() {
- mockPreview.mockReturnValue({
- data: "https://s3.example/report.html",
- isLoading: false,
- });
- mockQuery.mockReturnValue({
- data: "<h1>hello</h1>",
- isLoading: false,
- isError: false,
- });
- let renderer: ReturnType<typeof create> | null = null;
- act(() => {
- renderer = create(
- createElement(ArtifactPreview, {
- taskId: "t1",
- runId: "r1",
- artifact: {
- id: "a1",
- name: "report.html",
- type: "output",
- } as TaskRunArtifact,
- onClose: vi.fn(),
- }),
- );
- });
- if (!renderer) throw new Error("Renderer not created");
- return renderer as ReturnType<typeof create>;
-}
-
-function webViews(renderer: ReturnType<typeof create>) {
- return renderer.root.findAll((node) => node.type === WebView);
-}
-
-describe("ArtifactPreview", () => {
- beforeEach(() => {
- mockOpenExternalUrl.mockClear();
- });
-
- it("runs HTML artifacts with scripts enabled and the CSP applied", () => {
- const renderer = mount();
- const rendered = webViews(renderer);
- expect(rendered).toHaveLength(1);
- expect(rendered[0].props.javaScriptEnabled).toBe(true);
- expect(rendered[0].props.setSupportMultipleWindows).toBe(false);
- const { html } = rendered[0].props.source;
- expect(html.startsWith("csp:")).toBe(true);
- expect(html).toContain("<h1>hello</h1>");
- // The media capture guard runs ahead of the artifact's own markup, since
- // mediaCapturePermissionGrantType below is an iOS-only prop.
- expect(html.indexOf("mediaDevices")).toBeLessThan(
- html.indexOf("<h1>hello</h1>"),
- );
- });
-
- it("keeps the sandbox sealed around the enabled scripts", () => {
- const webView = webViews(mount())[0].props;
- expect(webView.allowFileAccess).toBe(false);
- expect(webView.allowFileAccessFromFileURLs).toBe(false);
- expect(webView.allowUniversalAccessFromFileURLs).toBe(false);
- expect(webView.geolocationEnabled).toBe(false);
- expect(webView.mediaCapturePermissionGrantType).toBe("deny");
- // No bridge back into the app.
- expect(webView.onMessage).toBeUndefined();
- expect(webView.injectedJavaScript).toBeUndefined();
- });
-
- it("only lets the artifact's own document load in place", () => {
- const webView = webViews(mount())[0].props;
- expect(
- webView.onShouldStartLoadWithRequest({
- url: "about:blank",
- navigationType: "other",
- }),
- ).toBe(true);
- });
-
- it("denies navigation that is not a tapped web link", () => {
- const webView = webViews(mount())[0].props;
- for (const url of [
- "tel:+15550100",
- "sms:+15550100",
- "mailto:[email protected]",
- "itms-apps://apps.apple.com/app/id1",
- "myapp://do-thing",
- "data:text/html,<script></script>",
- "file:///etc/passwd",
- "https://evil.example",
- ]) {
- expect(
- webView.onShouldStartLoadWithRequest({ url, navigationType: "other" }),
- ).toBe(false);
- }
- // A non-web scheme is dropped even when it comes from a tap.
- expect(
- webView.onShouldStartLoadWithRequest({
- url: "myapp://do-thing",
- navigationType: "click",
- }),
- ).toBe(false);
- expect(mockOpenExternalUrl).not.toHaveBeenCalled();
- });
-
- it("opens a tapped web link externally instead of navigating", () => {
- const webView = webViews(mount())[0].props;
- expect(
- webView.onShouldStartLoadWithRequest({
- url: "https://posthog.com",
- navigationType: "click",
- }),
- ).toBe(false);
- expect(mockOpenExternalUrl).toHaveBeenCalledWith("https://posthog.com");
- });
-
- it("stops the preview by unmounting the web content and restarts it", () => {
- const renderer = mount();
- expect(webViews(renderer)).toHaveLength(1);
-
- const stop = renderer.root.findByProps({
- accessibilityLabel: "Stop preview",
- });
- act(() => {
- stop.props.onPress();
- });
- expect(webViews(renderer)).toHaveLength(0);
- expect(JSON.stringify(renderer.toJSON())).toContain("Preview stopped");
-
- const restart = renderer.root.findByProps({
- accessibilityLabel: "Restart preview",
- });
- act(() => {
- restart.props.onPress();
- });
- expect(webViews(renderer)).toHaveLength(1);
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/tasks/components/ArtifactPreview.tsx b/products/desktop/apps/mobile/src/features/tasks/components/ArtifactPreview.tsx
deleted file mode 100644
index 9a88401ebcf8..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/components/ArtifactPreview.tsx
+++ /dev/null
@@ -1,247 +0,0 @@
-import { applyCspToHtml } from "@posthog/core/mcp-apps/csp";
-import type { TaskRunArtifact } from "@posthog/shared";
-import { useQuery } from "@tanstack/react-query";
-import {
- ArrowSquareOut,
- ArrowsClockwise,
- Stop,
- Warning,
- X,
-} from "phosphor-react-native";
-import { useMemo, useState } from "react";
-import {
- ActivityIndicator,
- Image,
- Modal,
- Pressable,
- ScrollView,
- Text,
- View,
-} from "react-native";
-import { useSafeAreaInsets } from "react-native-safe-area-context";
-import WebView from "react-native-webview";
-import { MarkdownText } from "@/features/chat";
-import { openExternalUrl } from "@/lib/openExternalUrl";
-import { useThemeColors } from "@/lib/theme";
-import { useCloudAttachmentPreview } from "../hooks/useCloudAttachmentPreview";
-import {
- denyMediaCapture,
- removeAutomaticRedirects,
-} from "../utils/artifactHtml";
-import { artifactPreviewKind } from "../utils/artifactPreview";
-
-interface ArtifactPreviewProps {
- taskId: string;
- runId: string;
- artifact: TaskRunArtifact;
- onClose: () => void;
-}
-
-export function ArtifactPreview({
- taskId,
- runId,
- artifact,
- onClose,
-}: ArtifactPreviewProps) {
- const insets = useSafeAreaInsets();
- const themeColors = useThemeColors();
- const name = artifact.name ?? "artifact";
- const kind = artifactPreviewKind(name);
- const [stopped, setStopped] = useState(false);
-
- const { data: url, isLoading: urlLoading } = useCloudAttachmentPreview(
- taskId,
- artifact.id ? { runId, artifactId: artifact.id } : undefined,
- );
-
- // Markdown and HTML render from the file's text; images and the external
- // fallback only need the presigned URL.
- const needsText = kind === "markdown" || kind === "html";
- const {
- data: text,
- isLoading: textLoading,
- isError: textError,
- } = useQuery({
- queryKey: ["artifactText", url],
- enabled: needsText && Boolean(url),
- staleTime: Infinity,
- retry: false,
- queryFn: async (): Promise<string> => {
- const response = await fetch(url ?? "");
- if (!response.ok) throw new Error("Artifact fetch failed");
- return response.text();
- },
- });
-
- const loading = urlLoading || (needsText && textLoading);
- const htmlControlsVisible =
- kind === "html" && !!url && !textError && !loading;
- const previewControl = stopped
- ? {
- label: "Restart preview",
- Icon: ArrowsClockwise,
- onPress: () => setStopped(false),
- }
- : { label: "Stop preview", Icon: Stop, onPress: () => setStopped(true) };
- const html = useMemo(
- () =>
- applyCspToHtml(denyMediaCapture(removeAutomaticRedirects(text ?? ""))),
- [text],
- );
-
- return (
- <Modal
- visible
- animationType="slide"
- presentationStyle="fullScreen"
- onRequestClose={onClose}
- >
- <View className="flex-1 bg-background" style={{ paddingTop: insets.top }}>
- <View className="flex-row items-center gap-3 px-4 pb-2">
- <Text
- className="flex-1 font-semibold text-[16px] text-gray-12"
- numberOfLines={1}
- >
- {name}
- </Text>
- {htmlControlsVisible ? (
- <Pressable
- onPress={previewControl.onPress}
- hitSlop={8}
- className="active:opacity-60"
- accessibilityLabel={previewControl.label}
- >
- <previewControl.Icon size={20} color={themeColors.gray[12]} />
- </Pressable>
- ) : null}
- {url ? (
- <Pressable
- onPress={() => openExternalUrl(url)}
- hitSlop={8}
- className="active:opacity-60"
- accessibilityLabel="Open externally"
- >
- <ArrowSquareOut size={20} color={themeColors.gray[12]} />
- </Pressable>
- ) : null}
- <Pressable
- onPress={onClose}
- hitSlop={8}
- className="active:opacity-60"
- accessibilityLabel="Close preview"
- >
- <X size={20} color={themeColors.gray[12]} />
- </Pressable>
- </View>
-
- <View className="flex-1" style={{ paddingBottom: insets.bottom }}>
- {loading ? (
- <View className="flex-1 items-center justify-center">
- <ActivityIndicator color={themeColors.accent[9]} />
- </View>
- ) : !url || textError || kind === "unsupported" ? (
- <Unsupported
- url={url}
- onShare={() => url && openExternalUrl(url)}
- />
- ) : kind === "image" ? (
- <Image
- source={{ uri: url }}
- resizeMode="contain"
- style={{ flex: 1, width: "100%" }}
- />
- ) : kind === "markdown" ? (
- <ScrollView
- className="flex-1"
- contentContainerStyle={{ padding: 16 }}
- >
- <MarkdownText content={text ?? ""} disableRemoteImages />
- </ScrollView>
- ) : stopped ? (
- <PreviewStopped />
- ) : (
- // Untrusted agent scripts run in the WebView's isolated web-content
- // process; keep it sealed. Do not add onMessage or injectedJavaScript
- // (a bridge back into the app). The rest of the props deny file and
- // device access, and the CSP applied above denies the network.
- // Two props below are iOS-only, and Android is covered elsewhere:
- // onFileDownload (Android keeps the library's own DownloadListener,
- // so downloads there are suppressed by the navigation gate rejecting
- // the http(s) request first) and mediaCapturePermissionGrantType
- // (denyMediaCapture strips the getUserMedia entry points out of the
- // document instead).
- <WebView
- originWhitelist={["*"]}
- source={{ html }}
- javaScriptEnabled
- setSupportMultipleWindows={false}
- allowFileAccess={false}
- allowFileAccessFromFileURLs={false}
- allowUniversalAccessFromFileURLs={false}
- geolocationEnabled={false}
- mediaPlaybackRequiresUserAction
- mediaCapturePermissionGrantType="deny"
- onFileDownload={() => {}}
- onShouldStartLoadWithRequest={(req) => {
- // Allowlist, so the boundary fails closed: with scripts enabled
- // an artifact can set location.href to any scheme without a
- // gesture, and tel:/sms:/mailto:/deep links hand off to another
- // app. source={{ html }} loads against the about:blank base URL,
- // which is the only navigation allowed to happen in place.
- if (req.url === "about:blank") return true;
- // A link activation leaves the preview and opens in the system
- // browser instead; everything else is dropped.
- if (
- req.navigationType === "click" &&
- (req.url.startsWith("http://") ||
- req.url.startsWith("https://"))
- ) {
- openExternalUrl(req.url);
- }
- return false;
- }}
- style={{ flex: 1, backgroundColor: "#fff" }}
- />
- )}
- </View>
- </View>
- </Modal>
- );
-}
-
-function PreviewStopped() {
- return (
- <View className="flex-1 items-center justify-center px-8">
- <Text className="text-center text-[14px] text-gray-11">
- Preview stopped. Restart it to run the HTML again.
- </Text>
- </View>
- );
-}
-
-function Unsupported({
- url,
- onShare,
-}: {
- url: string | null | undefined;
- onShare: () => void;
-}) {
- const themeColors = useThemeColors();
- return (
- <View className="flex-1 items-center justify-center gap-4 px-8">
- <Warning size={28} color={themeColors.gray[9]} />
- <Text className="text-center text-[14px] text-gray-11">
- This file can't be previewed here.
- </Text>
- {url ? (
- <Pressable
- onPress={onShare}
- className="flex-row items-center gap-2 rounded-lg bg-gray-3 px-4 py-2.5 active:opacity-70"
- >
- <ArrowSquareOut size={16} color={themeColors.gray[12]} />
- <Text className="text-[14px] text-gray-12">Open externally</Text>
- </Pressable>
- ) : null}
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/components/CloudMessageAttachment.tsx b/products/desktop/apps/mobile/src/features/tasks/components/CloudMessageAttachment.tsx
deleted file mode 100644
index da2d629a8837..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/components/CloudMessageAttachment.tsx
+++ /dev/null
@@ -1,32 +0,0 @@
-import {
- type HumanMessageAttachment,
- MarkdownImage,
- MessageFileChip,
-} from "@/features/chat";
-import { useCloudAttachmentPreview } from "../hooks/useCloudAttachmentPreview";
-
-export function CloudMessageAttachment({
- attachment,
- taskId,
-}: {
- attachment: HumanMessageAttachment;
- taskId?: string;
-}) {
- const { data: previewUrl } = useCloudAttachmentPreview(
- taskId,
- attachment.cloudArtifact,
- );
-
- if (attachment.kind !== "image") {
- return <MessageFileChip fileName={attachment.fileName} />;
- }
-
- // Cloud images resolve to a presigned URL; local (in-flight) images render
- // straight from their device uri. Fall back to a chip when neither is ready.
- const imageUrl = attachment.cloudArtifact ? previewUrl : attachment.uri;
- if (!imageUrl) {
- return <MessageFileChip fileName={attachment.fileName} />;
- }
-
- return <MarkdownImage url={imageUrl} alt={attachment.fileName} />;
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/components/CustomImageBadge.test.tsx b/products/desktop/apps/mobile/src/features/tasks/components/CustomImageBadge.test.tsx
deleted file mode 100644
index cc6d38b3bded..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/components/CustomImageBadge.test.tsx
+++ /dev/null
@@ -1,149 +0,0 @@
-import type { Task, TaskRun } from "@posthog/shared";
-import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
-import { createElement } from "react";
-import { act, create } from "react-test-renderer";
-import { beforeEach, describe, expect, it, vi } from "vitest";
-
-const { mockUseAuthStore, mockGetImages, mockGetEnvironments } = vi.hoisted(
- () => ({
- mockUseAuthStore: vi.fn(),
- mockGetImages: vi.fn(),
- mockGetEnvironments: vi.fn(),
- }),
-);
-
-vi.mock("@/features/auth", () => ({ useAuthStore: mockUseAuthStore }));
-
-vi.mock("@/lib/posthogApiClient", () => ({
- getPostHogApiClient: () => ({
- listSandboxCustomImages: mockGetImages,
- listSandboxEnvironments: mockGetEnvironments,
- }),
-}));
-
-vi.mock("phosphor-react-native", () => ({
- Cube: (props: Record<string, unknown>) => createElement("Cube", props),
-}));
-
-vi.mock("@/lib/theme", () => ({
- toRgba: (hex: string, alpha: number) => `${hex}/${alpha}`,
-}));
-
-import { CustomImageBadge } from "./CustomImageBadge";
-
-function makeTask(run: Partial<TaskRun> | undefined): Task {
- return {
- id: "task-1",
- task_number: 1,
- slug: "task-1",
- title: "Task",
- description: "",
- created_at: "2026-01-01T00:00:00Z",
- updated_at: "2026-01-01T00:00:00Z",
- origin_product: "user_created",
- latest_run: run
- ? ({
- id: "run-1",
- task: "task-1",
- team: 1,
- branch: null,
- status: "completed",
- log_url: "",
- error_message: null,
- output: null,
- state: {},
- created_at: "2026-01-01T00:00:00Z",
- updated_at: "2026-01-01T00:00:00Z",
- completed_at: null,
- ...run,
- } as TaskRun)
- : undefined,
- };
-}
-
-async function render(task: Task) {
- const queryClient = new QueryClient({
- defaultOptions: { queries: { retry: false, gcTime: 0 } },
- });
- let renderer: ReturnType<typeof create> | null = null;
- await act(async () => {
- renderer = create(
- createElement(
- QueryClientProvider,
- { client: queryClient },
- createElement(CustomImageBadge, { task }),
- ),
- );
- });
- // Flush pending react-query resolutions so a resolved image name renders.
- await act(async () => {
- await Promise.resolve();
- await new Promise((resolve) => setTimeout(resolve, 0));
- });
- if (!renderer) throw new Error("Renderer not created");
- return renderer as ReturnType<typeof create>;
-}
-
-function label(renderer: ReturnType<typeof create>): string | undefined {
- const node = renderer.root.findAll(
- (n) => typeof n.props?.accessibilityLabel === "string",
- )[0];
- return node?.props.accessibilityLabel as string | undefined;
-}
-
-describe("CustomImageBadge", () => {
- beforeEach(() => {
- mockUseAuthStore.mockReturnValue({
- projectId: 1,
- oauthAccessToken: "token",
- });
- mockGetImages.mockReset();
- mockGetEnvironments.mockReset();
- mockGetImages.mockResolvedValue([]);
- mockGetEnvironments.mockResolvedValue([]);
- });
-
- it("renders nothing for a local run", async () => {
- const r = await render(
- makeTask({ environment: "local", state: { custom_image_id: "img-1" } }),
- );
- expect(r.toJSON()).toBeNull();
- expect(mockGetImages).not.toHaveBeenCalled();
- });
-
- it("renders nothing for a cloud run without a custom image id", async () => {
- const r = await render(makeTask({ environment: "cloud", state: {} }));
- expect(r.toJSON()).toBeNull();
- expect(mockGetImages).not.toHaveBeenCalled();
- });
-
- it("resolves the image name from a direct custom_image_id", async () => {
- mockGetImages.mockResolvedValue([{ id: "img-1", name: "My Image" }]);
- const r = await render(
- makeTask({ environment: "cloud", state: { custom_image_id: "img-1" } }),
- );
- expect(label(r)).toBe('Runs on custom base image "My Image"');
- });
-
- it("resolves the image name via sandbox_environment_id", async () => {
- mockGetEnvironments.mockResolvedValue([
- { id: "env-1", custom_image_id: "img-2", custom_image_name: null },
- ]);
- mockGetImages.mockResolvedValue([{ id: "img-2", name: "Env Image" }]);
- const r = await render(
- makeTask({
- environment: "cloud",
- state: { sandbox_environment_id: "env-1" },
- }),
- );
- expect(label(r)).toBe('Runs on custom base image "Env Image"');
- });
-
- it("renders nothing when the image cannot be resolved", async () => {
- mockGetImages.mockResolvedValue([{ id: "other", name: "Other" }]);
- const r = await render(
- makeTask({ environment: "cloud", state: { custom_image_id: "missing" } }),
- );
- expect(r.toJSON()).toBeNull();
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/tasks/components/CustomImageBadge.tsx b/products/desktop/apps/mobile/src/features/tasks/components/CustomImageBadge.tsx
deleted file mode 100644
index 13bf4e2d4a0c..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/components/CustomImageBadge.tsx
+++ /dev/null
@@ -1,52 +0,0 @@
-import { Text } from "@components/text";
-import type { Task } from "@posthog/shared";
-import { Cube } from "phosphor-react-native";
-import { View } from "react-native";
-import { toRgba } from "@/lib/theme";
-import { useCustomImageName } from "../hooks/useCustomImageName";
-
-// Theme tokens have no violet; a fixed Radix violet-9 mirrors the desktop
-// custom-image badge and reads well in both light and dark.
-const VIOLET = "#6e56cf";
-
-export function CustomImageBadge({ task }: { task: Task }) {
- const run = task.latest_run;
- const state = run?.state as
- | { custom_image_id?: unknown; sandbox_environment_id?: unknown }
- | undefined;
- const customImageId =
- typeof state?.custom_image_id === "string" ? state.custom_image_id : null;
- const sandboxEnvironmentId =
- typeof state?.sandbox_environment_id === "string"
- ? state.sandbox_environment_id
- : null;
-
- const imageName = useCustomImageName({
- customImageId,
- sandboxEnvironmentId,
- enabled: run?.environment === "cloud",
- });
-
- if (!imageName) return null;
-
- return (
- <View
- className="h-9 max-w-[160px] flex-row items-center gap-1 rounded-lg border px-2.5"
- style={{
- backgroundColor: toRgba(VIOLET, 0.12),
- borderColor: toRgba(VIOLET, 0.35),
- }}
- accessibilityRole="text"
- accessibilityLabel={`Runs on custom base image "${imageName}"`}
- >
- <Cube size={14} weight="fill" color={VIOLET} />
- <Text
- numberOfLines={1}
- className="font-semibold text-[13px]"
- style={{ color: VIOLET }}
- >
- {imageName}
- </Text>
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/components/FileDiff.tsx b/products/desktop/apps/mobile/src/features/tasks/components/FileDiff.tsx
deleted file mode 100644
index 38e33f9af44c..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/components/FileDiff.tsx
+++ /dev/null
@@ -1,119 +0,0 @@
-import { Text } from "@components/text";
-import { Platform, View } from "react-native";
-import { toRgba, useThemeColors } from "@/lib/theme";
-import type { ChangedFile } from "../hooks/usePrChangedFiles";
-import { type DiffLine, parsePatch } from "../utils/parsePatch";
-
-interface FileDiffProps {
- file: ChangedFile;
-}
-
-const MONO_FONT = Platform.OS === "ios" ? "Menlo" : "monospace";
-
-function statusLabel(status: ChangedFile["status"]): string {
- switch (status) {
- case "added":
- return "Added";
- case "removed":
- return "Deleted";
- case "renamed":
- return "Renamed";
- case "modified":
- return "Modified";
- default:
- return status;
- }
-}
-
-function linePrefix(type: DiffLine["type"]): string {
- if (type === "add") return "+";
- if (type === "delete") return "-";
- return " ";
-}
-
-export function FileDiff({ file }: FileDiffProps) {
- const themeColors = useThemeColors();
- const hunks = file.patch ? parsePatch(file.patch) : [];
-
- const addBg = toRgba(themeColors.status.success, 0.14);
- const delBg = toRgba(themeColors.status.error, 0.14);
- const hunkBg = themeColors.gray[3];
-
- const colorFor = (type: DiffLine["type"]): string => {
- if (type === "add") return themeColors.status.success;
- if (type === "delete") return themeColors.status.error;
- if (type === "no-newline") return themeColors.gray[9];
- return themeColors.gray[12];
- };
- const bgFor = (type: DiffLine["type"]): string => {
- if (type === "add") return addBg;
- if (type === "delete") return delBg;
- return "transparent";
- };
-
- return (
- <View className="mb-2 overflow-hidden rounded-lg border border-gray-6 bg-card">
- <View className="flex-row items-center gap-2 border-gray-6 border-b bg-gray-2 px-3 py-2">
- <Text
- numberOfLines={1}
- className="flex-1 font-medium text-[13px] text-gray-12"
- >
- {file.previous_filename
- ? `${file.previous_filename} → ${file.filename}`
- : file.filename}
- </Text>
- <Text
- className="text-[11px]"
- style={{
- color: themeColors.status.success,
- fontFamily: MONO_FONT,
- }}
- >
- +{file.additions}
- </Text>
- <Text
- className="text-[11px]"
- style={{ color: themeColors.status.error, fontFamily: MONO_FONT }}
- >
- −{file.deletions}
- </Text>
- </View>
-
- {hunks.length > 0 ? (
- hunks.map((hunk) => (
- <View key={hunk.header}>
- <View style={{ backgroundColor: hunkBg }} className="px-3 py-1">
- <Text
- style={{ fontFamily: MONO_FONT, color: themeColors.gray[10] }}
- className="text-[11px]"
- >
- {hunk.header}
- </Text>
- </View>
- {hunk.lines.map((line) => (
- <View
- key={line.key}
- style={{ backgroundColor: bgFor(line.type) }}
- className="px-3"
- >
- <Text
- style={{ fontFamily: MONO_FONT, color: colorFor(line.type) }}
- className="text-[11px] leading-[16px]"
- >
- {linePrefix(line.type)}
- {line.content}
- </Text>
- </View>
- ))}
- </View>
- ))
- ) : (
- <View className="px-3 py-3">
- <Text className="text-[12px] text-gray-10">
- {statusLabel(file.status)} — no preview available
- </Text>
- </View>
- )}
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/components/FloatingNewTaskButton.tsx b/products/desktop/apps/mobile/src/features/tasks/components/FloatingNewTaskButton.tsx
deleted file mode 100644
index 8907c3d15fa5..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/components/FloatingNewTaskButton.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-import { Plus } from "phosphor-react-native";
-import { Pressable } from "react-native";
-import { Text } from "@/components/text";
-import { useScreenInsets } from "@/hooks/useScreenInsets";
-import { useThemeColors } from "@/lib/theme";
-
-interface FloatingNewTaskButtonProps {
- onPress: () => void;
-}
-
-/**
- * Pill-shaped FAB anchored to the bottom-right corner. Stays in thumb reach
- * on phones of any size and respects the home indicator inset.
- */
-export function FloatingNewTaskButton({ onPress }: FloatingNewTaskButtonProps) {
- const { fabBottom } = useScreenInsets();
- const themeColors = useThemeColors();
-
- return (
- <Pressable
- onPress={onPress}
- hitSlop={8}
- accessibilityLabel="Create new task"
- accessibilityRole="button"
- className="absolute right-5 z-10 h-14 flex-row items-center justify-center gap-2 rounded-full bg-accent-9 pr-5 pl-4 active:opacity-85"
- style={{
- bottom: fabBottom(),
- shadowColor: "#000",
- shadowOpacity: 0.22,
- shadowRadius: 12,
- shadowOffset: { width: 0, height: 4 },
- elevation: 6,
- }}
- >
- <Plus size={22} color={themeColors.accent.contrast} weight="bold" />
- <Text className="font-semibold text-[15px] text-accent-contrast leading-tight">
- New task
- </Text>
- </Pressable>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/components/FloatingTaskHeader.tsx b/products/desktop/apps/mobile/src/features/tasks/components/FloatingTaskHeader.tsx
deleted file mode 100644
index 8c7909b6b51d..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/components/FloatingTaskHeader.tsx
+++ /dev/null
@@ -1,78 +0,0 @@
-import { Text } from "@components/text";
-import { useRouter } from "expo-router";
-import { CaretLeft } from "phosphor-react-native";
-import type { ReactNode } from "react";
-import { Platform, Pressable, View } from "react-native";
-import { useSafeAreaInsets } from "react-native-safe-area-context";
-import { useThemeColors } from "@/lib/theme";
-
-interface FloatingTaskHeaderProps {
- title: string;
- subtitle?: string | null;
- /** Optional right-side action (e.g. a Local-run indicator). */
- rightSlot?: ReactNode;
-}
-
-/** Task detail toolbar with navigation, task identity, and run actions. */
-export function FloatingTaskHeader({
- title,
- subtitle,
- rightSlot,
-}: FloatingTaskHeaderProps) {
- const router = useRouter();
- const insets = useSafeAreaInsets();
- const themeColors = useThemeColors();
-
- const handleBack = () => {
- if (router.canGoBack()) router.back();
- };
-
- // iOS modals already provide their own top chrome (drag handle / rounded
- // corners), so insets.top over-counts the space. Use a minimal fixed value
- // on iOS and fall back to the real inset on Android.
- const topInset = Platform.OS === "ios" ? 6 : insets.top;
-
- const headerHeight = topInset + 52;
-
- return (
- <View
- pointerEvents="box-none"
- className="absolute inset-x-0 top-0 z-10 border-gray-4 border-b bg-background"
- style={{ height: headerHeight }}
- >
- <View
- className="flex-row items-center px-3"
- style={{ paddingTop: topInset, paddingBottom: 4 }}
- >
- <Pressable
- onPress={handleBack}
- hitSlop={10}
- className="h-11 w-11 items-center justify-center active:opacity-60"
- >
- <CaretLeft size={22} color={themeColors.gray[12]} weight="bold" />
- </Pressable>
-
- <View className="min-w-0 flex-1 items-start px-2">
- <Text
- className="font-semibold text-[15px] text-gray-12"
- numberOfLines={1}
- >
- {title}
- </Text>
- {subtitle ? (
- <Text className="mt-0.5 text-[12px] text-gray-10" numberOfLines={1}>
- {subtitle}
- </Text>
- ) : null}
- </View>
-
- <View
- className="h-11 flex-row items-center justify-end gap-2"
- style={{ minWidth: 44 }}
- >
- {rightSlot}
- </View>
- </View>
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/components/FloatingTasksHeader.tsx b/products/desktop/apps/mobile/src/features/tasks/components/FloatingTasksHeader.tsx
deleted file mode 100644
index 61e5eea97523..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/components/FloatingTasksHeader.tsx
+++ /dev/null
@@ -1,69 +0,0 @@
-import { Text } from "@components/text";
-import { LinearGradient } from "expo-linear-gradient";
-import { View } from "react-native";
-import { useSafeAreaInsets } from "react-native-safe-area-context";
-import { MenuButton } from "@/features/navigation/components/MenuButton";
-import { toRgba, useThemeColors } from "@/lib/theme";
-import { TaskFilterButton } from "./TaskFilterMenu";
-
-interface FloatingTasksHeaderProps {
- onFilterPress: () => void;
- showFilter?: boolean;
-}
-
-/**
- * Floating header for the tasks list screen — hamburger menu on the left,
- * centered "Code" title, filter button on the right. Sits over the content
- * with a top-to-bottom fade so the list disappears gracefully behind it
- * rather than getting clipped by a hard edge.
- */
-export function FloatingTasksHeader({
- onFilterPress,
- showFilter = true,
-}: FloatingTasksHeaderProps) {
- const insets = useSafeAreaInsets();
- const themeColors = useThemeColors();
-
- const fadeHeight = insets.top + 88;
-
- return (
- <View
- pointerEvents="box-none"
- className="absolute inset-x-0 top-0 z-10"
- style={{ height: fadeHeight }}
- >
- <LinearGradient
- pointerEvents="none"
- colors={[
- toRgba(themeColors.background, 1),
- toRgba(themeColors.background, 0.92),
- toRgba(themeColors.background, 0),
- ]}
- locations={[0, 0.65, 1]}
- style={{ position: "absolute", top: 0, left: 0, right: 0, bottom: 0 }}
- />
-
- <View
- className="flex-row items-center px-3"
- style={{ paddingTop: insets.top + 6, paddingBottom: 8 }}
- >
- <MenuButton />
-
- <View className="min-w-0 flex-1 items-center px-2">
- <Text
- className="font-semibold text-[17px] text-gray-12"
- numberOfLines={1}
- >
- PostHog
- </Text>
- </View>
-
- {showFilter ? (
- <TaskFilterButton onPress={onFilterPress} />
- ) : (
- <View className="h-9 w-9" />
- )}
- </View>
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/components/GitHubConnectionPrompt.tsx b/products/desktop/apps/mobile/src/features/tasks/components/GitHubConnectionPrompt.tsx
deleted file mode 100644
index 08be555dcce7..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/components/GitHubConnectionPrompt.tsx
+++ /dev/null
@@ -1,103 +0,0 @@
-import { Text } from "@components/text";
-import { GITHUB_CODE_CONTEXT_MESSAGE } from "@posthog/core/integrations/connectErrors";
-import * as WebBrowser from "expo-web-browser";
-import { Pressable, View } from "react-native";
-import { useAuthStore } from "@/features/auth";
-import { logger } from "@/lib/logger";
-import { getPostHogApiClient } from "@/lib/posthogApiClient";
-import { useThemeColors } from "@/lib/theme";
-
-const log = logger.scope("github-connection-prompt");
-
-interface GitHubConnectionPromptProps {
- onConnected?: () => void;
- mode?: "card" | "empty";
- title?: string;
- description?: string;
-}
-
-export function GitHubConnectionPrompt({
- onConnected,
- mode = "card",
- title = "Connect GitHub to continue",
- description = GITHUB_CODE_CONTEXT_MESSAGE,
-}: GitHubConnectionPromptProps) {
- const { cloudRegion, projectId } = useAuthStore();
- const themeColors = useThemeColors();
-
- const handleConnectGitHub = async () => {
- if (!cloudRegion || !projectId) {
- return;
- }
-
- // Per-user flow (like desktop): the backend picks the right GitHub flow
- // and, because we pass `connect_from: "posthog_mobile"`, redirects the
- // callback to `posthog://github/callback` so this in-app browser closes.
- let authorizeUrl: string;
- try {
- const { install_url } =
- await getPostHogApiClient().startGithubUserIntegrationConnect();
- authorizeUrl = install_url;
- } catch (error) {
- log.error("Failed to start GitHub connection", { error });
- return;
- }
-
- const result = await WebBrowser.openAuthSessionAsync(
- authorizeUrl,
- "posthog://github/callback",
- );
-
- if (
- result.type === "dismiss" ||
- result.type === "cancel" ||
- result.type === "success"
- ) {
- onConnected?.();
- }
- };
-
- if (mode === "empty") {
- return (
- <View className="flex-1 items-center justify-center p-6">
- <View className="mb-6 h-16 w-16 items-center justify-center rounded-full bg-gray-3">
- <Text className="text-3xl">🔗</Text>
- </View>
- <Text className="mb-2 text-center font-semibold text-gray-12 text-lg">
- Connect GitHub
- </Text>
- <Text className="mb-6 text-center text-gray-11 text-sm">
- {GITHUB_CODE_CONTEXT_MESSAGE}
- </Text>
- <Pressable
- onPress={handleConnectGitHub}
- className="rounded-lg px-6 py-3"
- style={{ backgroundColor: themeColors.accent[9] }}
- >
- <Text className="font-semibold text-accent-contrast">
- Connect GitHub
- </Text>
- </Pressable>
- </View>
- );
- }
-
- return (
- <View className="mb-4 rounded-lg border border-gray-6 p-4">
- <View className="mb-3 flex-row items-center">
- <Text className="mr-2 text-xl">🔗</Text>
- <Text className="font-semibold text-gray-12">{title}</Text>
- </View>
- <Text className="mb-4 text-gray-11 text-sm">{description}</Text>
- <Pressable
- onPress={handleConnectGitHub}
- className="items-center rounded-lg py-3"
- style={{ backgroundColor: themeColors.accent[9] }}
- >
- <Text className="font-semibold text-accent-contrast">
- Connect GitHub
- </Text>
- </Pressable>
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/components/GitHubLoadNotice.tsx b/products/desktop/apps/mobile/src/features/tasks/components/GitHubLoadNotice.tsx
deleted file mode 100644
index 435ef7ad67ab..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/components/GitHubLoadNotice.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import { Text } from "@components/text";
-import { Pressable, View } from "react-native";
-
-interface GitHubLoadNoticeProps {
- message: string;
- onRetry: () => void;
- tone?: "error" | "warning";
-}
-
-export function GitHubLoadNotice({
- message,
- onRetry,
- tone = "error",
-}: GitHubLoadNoticeProps) {
- const containerClassName =
- tone === "warning"
- ? "mb-4 rounded-lg border border-status-warning/30 bg-status-warning/10 p-3"
- : "mb-4 rounded-lg border border-status-error bg-status-error/10 p-3";
- const messageClassName =
- tone === "warning" ? "text-status-warning" : "text-status-error";
-
- return (
- <View className={containerClassName}>
- <Text className={`text-sm ${messageClassName}`}>{message}</Text>
- <Pressable
- onPress={onRetry}
- className="mt-3 self-start rounded-lg bg-gray-3 px-3 py-2"
- >
- <Text className="text-gray-12 text-sm">Retry</Text>
- </Pressable>
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/components/HandoffTaskSheet.test.tsx b/products/desktop/apps/mobile/src/features/tasks/components/HandoffTaskSheet.test.tsx
deleted file mode 100644
index 3a79384e9c89..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/components/HandoffTaskSheet.test.tsx
+++ /dev/null
@@ -1,190 +0,0 @@
-import type { Task } from "@posthog/shared";
-import type { UserBasic } from "@posthog/shared/domain-types";
-import { createElement, type ReactElement } from "react";
-import { Pressable } from "react-native";
-import { act, create, type ReactTestRenderer } from "react-test-renderer";
-import { beforeEach, describe, expect, it, vi } from "vitest";
-
-const { handoffMutate, onHandedOff, membersRef, currentUserRef } = vi.hoisted(
- () => ({
- handoffMutate: vi.fn(),
- onHandedOff: vi.fn(),
- membersRef: { current: [] as UserBasic[] },
- currentUserRef: { current: { id: 1 } as { id: number } | undefined },
- }),
-);
-
-// The global react-native mock renders Modal through a DOM portal that is a
-// no-op under the node test env, so its children never mount. Substitute plain
-// host elements for the components the sheet uses so the body is inspectable.
-vi.mock("react-native", () => {
- const host = (name: string) => (props: Record<string, unknown>) =>
- createElement(name, props);
- return {
- ActivityIndicator: host("ActivityIndicator"),
- Alert: { alert: vi.fn() },
- FlatList: <T,>({
- data,
- renderItem,
- keyExtractor,
- }: {
- data: readonly T[];
- renderItem: (info: { item: T; index: number }) => ReactElement;
- keyExtractor?: (item: T, index: number) => string;
- }) =>
- createElement(
- "FlatList",
- {},
- (data ?? []).map((item, index) =>
- createElement(
- "FlatListItem",
- { key: keyExtractor?.(item, index) ?? index },
- renderItem({ item, index }),
- ),
- ),
- ),
- Modal: host("Modal"),
- Pressable: host("Pressable"),
- TextInput: host("TextInput"),
- View: host("View"),
- };
-});
-
-vi.mock("../hooks/useOrgMembers", () => ({
- useOrgMembers: () => ({ members: membersRef.current, isLoading: false }),
-}));
-
-vi.mock("../hooks/useTasks", () => ({
- useHandoffTask: () => ({ mutate: handoffMutate, isPending: false }),
-}));
-
-vi.mock("@/features/auth", () => ({
- useUserQuery: () => ({ data: currentUserRef.current }),
-}));
-
-vi.mock("@/hooks/useDebouncedValue", () => ({
- useDebouncedValue: (value: unknown) => value,
-}));
-
-vi.mock("@/hooks/useScreenInsets", () => ({
- useScreenInsets: () => ({ bottom: () => 0, sheetContentTop: () => 0 }),
-}));
-
-vi.mock("@/lib/theme", () => ({
- useThemeColors: () => ({ gray: {}, accent: {} }),
-}));
-
-vi.mock("@components/text", () => ({
- Text: (props: Record<string, unknown>) => createElement("Text", props),
-}));
-
-vi.mock("expo-haptics", () => ({
- impactAsync: vi.fn(),
- ImpactFeedbackStyle: { Medium: "medium" },
-}));
-
-vi.mock("phosphor-react-native", () => ({
- Check: (props: Record<string, unknown>) => createElement("Check", props),
- MagnifyingGlass: (props: Record<string, unknown>) =>
- createElement("MagnifyingGlass", props),
-}));
-
-function member(id: number, email: string, firstName?: string): UserBasic {
- return { id, uuid: `u-${id}`, email, first_name: firstName };
-}
-
-const TASK: Task = {
- id: "task-1",
- task_number: 1,
- slug: "task-1",
- title: "Fix the thing",
- description: "",
- created_at: "2026-01-01T00:00:00Z",
- updated_at: "2026-01-01T00:00:00Z",
- origin_product: "code",
-};
-
-function textOf(node: { props: { children?: unknown } }): string {
- const children = node.props.children;
- return Array.isArray(children) ? children.join("") : String(children ?? "");
-}
-
-function pressableWithText(tree: ReactTestRenderer, text: string) {
- return tree.root
- .findAllByType(Pressable)
- .find((pressable) =>
- pressable
- .findAll((n) => String(n.type) === "Text")
- .some((t) => textOf(t).includes(text)),
- );
-}
-
-function render(task: Task = TASK): ReactTestRenderer {
- let tree!: ReactTestRenderer;
- act(() => {
- tree = create(
- createElement(HandoffTaskSheet, {
- visible: true,
- task,
- onClose: vi.fn(),
- onHandedOff,
- }),
- );
- });
- return tree;
-}
-
-let HandoffTaskSheet: typeof import("./HandoffTaskSheet").HandoffTaskSheet;
-
-describe("HandoffTaskSheet", () => {
- beforeEach(async () => {
- handoffMutate.mockReset();
- handoffMutate.mockImplementation(
- (_vars, opts?: { onSuccess?: () => void }) => opts?.onSuccess?.(),
- );
- onHandedOff.mockReset();
- membersRef.current = [
- member(1, "[email protected]", "Me"),
- member(2, "[email protected]", "Alice"),
- ];
- currentUserRef.current = { id: 1 };
- ({ HandoffTaskSheet } = await import("./HandoffTaskSheet"));
- });
-
- it("excludes the current user from the roster", () => {
- const tree = render();
- const emails = tree.root
- .findAll((n) => String(n.type) === "Text")
- .map(textOf);
- expect(emails).toContain("[email protected]");
- expect(emails).not.toContain("[email protected]");
- });
-
- it("locks the commit until a colleague is picked and acknowledged", () => {
- const tree = render();
- expect(pressableWithText(tree, "Hand off")?.props.disabled).toBe(true);
-
- act(() => pressableWithText(tree, "[email protected]")?.props.onPress());
- expect(pressableWithText(tree, "Hand off")?.props.disabled).toBe(true);
-
- act(() => pressableWithText(tree, "I understand")?.props.onPress());
- const button = pressableWithText(tree, "Hand off");
- expect(button?.props.disabled).toBe(false);
-
- act(() => button?.props.onPress());
- expect(handoffMutate).toHaveBeenCalledWith(
- { taskId: "task-1", userId: 2 },
- expect.anything(),
- );
- expect(onHandedOff).toHaveBeenCalled();
- });
-
- it("warns that the requester can lose access", () => {
- const tree = render();
- const copy = tree.root
- .findAll((n) => String(n.type) === "Text")
- .map(textOf)
- .join(" ");
- expect(copy).toContain("you lose access");
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/tasks/components/HandoffTaskSheet.tsx b/products/desktop/apps/mobile/src/features/tasks/components/HandoffTaskSheet.tsx
deleted file mode 100644
index 8a85eb0520ec..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/components/HandoffTaskSheet.tsx
+++ /dev/null
@@ -1,252 +0,0 @@
-import { Text } from "@components/text";
-import { getUserInitials } from "@posthog/core/auth/userInitials";
-import type { Task } from "@posthog/shared";
-import type { UserBasic } from "@posthog/shared/domain-types";
-import * as Haptics from "expo-haptics";
-import { Check, MagnifyingGlass } from "phosphor-react-native";
-import { useMemo, useState } from "react";
-import {
- ActivityIndicator,
- Alert,
- FlatList,
- Modal,
- Pressable,
- TextInput,
- View,
-} from "react-native";
-import { useUserQuery } from "@/features/auth";
-import { useDebouncedValue } from "@/hooks/useDebouncedValue";
-import { useScreenInsets } from "@/hooks/useScreenInsets";
-import { useThemeColors } from "@/lib/theme";
-import { useOrgMembers } from "../hooks/useOrgMembers";
-import { useHandoffTask } from "../hooks/useTasks";
-import { userDisplayName } from "../utils/userDisplayName";
-
-interface HandoffTaskSheetProps {
- visible: boolean;
- task: Task;
- onClose: () => void;
- // The detail screen holds its own task/session state that a handoff makes
- // stale (and may revoke access to), so the host leaves the screen on success.
- onHandedOff: () => void;
-}
-
-function MemberRow({
- member,
- selected,
- onPress,
-}: {
- member: UserBasic;
- selected: boolean;
- onPress: () => void;
-}) {
- const themeColors = useThemeColors();
- return (
- <Pressable
- onPress={onPress}
- className="flex-row items-center justify-between rounded-md px-2 py-2.5 active:bg-gray-3"
- >
- <View className="min-w-0 flex-1 flex-row items-center gap-2.5">
- <View className="h-6 w-6 items-center justify-center rounded-full bg-gray-4">
- <Text className="text-[11px] text-gray-10">
- {getUserInitials(member)}
- </Text>
- </View>
- <View className="min-w-0 flex-1">
- <Text className="text-[14px] text-gray-12" numberOfLines={1}>
- {userDisplayName(member)}
- </Text>
- <Text className="text-[12px] text-gray-9" numberOfLines={1}>
- {member.email}
- </Text>
- </View>
- </View>
- {selected && <Check size={16} color={themeColors.gray[12]} />}
- </Pressable>
- );
-}
-
-export function HandoffTaskSheet({
- visible,
- task,
- onClose,
- onHandedOff,
-}: HandoffTaskSheetProps) {
- const { bottom, sheetContentTop } = useScreenInsets();
- const themeColors = useThemeColors();
- const { data: currentUser } = useUserQuery();
- const { mutate: handoffTask, isPending } = useHandoffTask();
- const { members, isLoading } = useOrgMembers({ enabled: visible });
-
- const [query, setQuery] = useState("");
- const debouncedQuery = useDebouncedValue(query, 250);
- const [selectedId, setSelectedId] = useState<number | null>(null);
- const [acknowledged, setAcknowledged] = useState(false);
-
- const [wasVisible, setWasVisible] = useState(visible);
- if (visible !== wasVisible) {
- setWasVisible(visible);
- if (visible) {
- setQuery("");
- setSelectedId(null);
- setAcknowledged(false);
- }
- }
-
- const options = useMemo(() => {
- const needle = debouncedQuery.trim().toLowerCase();
- return members.filter((member) => {
- if (member.id === currentUser?.id) return false;
- if (!needle) return true;
- return (
- userDisplayName(member).toLowerCase().includes(needle) ||
- member.email.toLowerCase().includes(needle)
- );
- });
- }, [members, currentUser?.id, debouncedQuery]);
-
- const selected = options.find((member) => member.id === selectedId);
- const canSubmit = selected !== undefined && acknowledged && !isPending;
-
- const handleConfirm = () => {
- if (!selected) return;
- Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium);
- handoffTask(
- { taskId: task.id, userId: selected.id },
- {
- onSuccess: onHandedOff,
- onError: () => {
- Alert.alert(
- "Couldn't hand off",
- "The task could not be handed off. Please try again.",
- );
- },
- },
- );
- };
-
- return (
- <Modal
- visible={visible}
- animationType="slide"
- presentationStyle="pageSheet"
- onRequestClose={isPending ? undefined : onClose}
- >
- <View
- className="flex-1 bg-background"
- style={{ paddingTop: sheetContentTop() }}
- >
- <View className="flex-row items-center justify-between border-gray-6 border-b px-4 pb-3">
- <Text className="font-semibold text-[18px] text-gray-12">
- Hand off task
- </Text>
- <Pressable onPress={onClose} disabled={isPending}>
- <Text className="font-semibold text-[14px] text-accent-9">
- Cancel
- </Text>
- </Pressable>
- </View>
-
- <View className="gap-1 px-4 pt-3">
- <Text className="text-[13px] text-gray-11">
- <Text className="font-medium text-gray-12">{task.title}</Text> goes
- to the person you pick. They steer it and get its notifications.
- </Text>
- <Text className="text-[13px] text-gray-11">
- If it's in your personal space, it moves to theirs and you lose
- access. Only they can hand it back.
- </Text>
- </View>
-
- <View className="px-4 pt-3">
- <View className="flex-row items-center gap-2 rounded-lg bg-gray-2 px-3 py-2">
- <MagnifyingGlass size={16} color={themeColors.gray[9]} />
- <TextInput
- value={query}
- onChangeText={setQuery}
- placeholder="Search people…"
- placeholderTextColor={themeColors.gray[9]}
- autoCapitalize="none"
- autoCorrect={false}
- className="min-w-0 flex-1 text-[14px] text-gray-12"
- />
- </View>
- </View>
-
- {options.length === 0 ? (
- isLoading ? (
- <View className="flex-1 items-center justify-center">
- <ActivityIndicator size="large" color={themeColors.accent[9]} />
- </View>
- ) : (
- <View className="flex-1 items-center justify-center p-6">
- <Text className="text-[14px] text-gray-10">No people found</Text>
- </View>
- )
- ) : (
- <FlatList
- className="flex-1"
- data={options}
- keyExtractor={(member) => String(member.id)}
- keyboardShouldPersistTaps="handled"
- contentContainerStyle={{ paddingHorizontal: 16, paddingTop: 12 }}
- renderItem={({ item }) => (
- <MemberRow
- member={item}
- selected={item.id === selectedId}
- onPress={() => setSelectedId(item.id)}
- />
- )}
- />
- )}
-
- <View
- className="gap-3 border-gray-6 border-t px-4 pt-3"
- style={{ paddingBottom: bottom("roomy") }}
- >
- <Pressable
- onPress={() => setAcknowledged((prev) => !prev)}
- disabled={isPending}
- className="flex-row items-center gap-2.5 active:opacity-70"
- >
- <View
- className={`h-5 w-5 items-center justify-center rounded border ${acknowledged ? "border-transparent" : "border-gray-7"}`}
- style={
- acknowledged ? { backgroundColor: themeColors.accent[9] } : null
- }
- >
- {acknowledged ? (
- <Check size={12} color="#fff" weight="bold" />
- ) : null}
- </View>
- <Text className="flex-1 text-[13px] text-gray-11">
- I understand I can't undo this myself.
- </Text>
- </Pressable>
-
- <Pressable
- onPress={handleConfirm}
- disabled={!canSubmit}
- className="h-11 flex-row items-center justify-center rounded-lg active:opacity-80"
- style={{
- backgroundColor: canSubmit
- ? themeColors.accent[9]
- : themeColors.gray[4],
- }}
- >
- {isPending ? (
- <ActivityIndicator color="#fff" />
- ) : (
- <Text
- className="font-semibold text-[15px]"
- style={{ color: canSubmit ? "#fff" : themeColors.gray[9] }}
- >
- Hand off
- </Text>
- )}
- </Pressable>
- </View>
- </View>
- </Modal>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/components/InlineArtifactCard.tsx b/products/desktop/apps/mobile/src/features/tasks/components/InlineArtifactCard.tsx
deleted file mode 100644
index 9ee07149c544..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/components/InlineArtifactCard.tsx
+++ /dev/null
@@ -1,174 +0,0 @@
-import { Text } from "@components/text";
-import { groupRunArtifactVersions } from "@posthog/core/canvas/runArtifactSchemas";
-import { parsePrUrl } from "@posthog/core/inbox/reportPresentation";
-import { readUploadedArtifactName } from "@posthog/core/sessions/inlineArtifacts";
-import type { TaskRunArtifact } from "@posthog/shared";
-import { File as FileIcon, GitPullRequest } from "phosphor-react-native";
-import { useMemo, useState } from "react";
-import { ActivityIndicator, Pressable, View } from "react-native";
-import type { ToolStatus } from "@/features/chat";
-import { openExternalUrl } from "@/lib/openExternalUrl";
-import { useThemeColors } from "@/lib/theme";
-import { useTaskArtifacts } from "../hooks/useTaskArtifacts";
-import { formatArtifactSize } from "../utils/artifactPreview";
-import { ArtifactPreview } from "./ArtifactPreview";
-import { PrDiffStatsBadge } from "./PrDiffStatsBadge";
-import { PrStatusBadge } from "./PrStatusBadge";
-
-function fileKindLabel(name: string): string {
- const extension = name.includes(".") ? name.split(".").pop() : undefined;
- return extension && extension.length <= 4 ? extension.toUpperCase() : "File";
-}
-
-function CardRow({
- icon,
- title,
- meta,
- onPress,
- accessibilityLabel,
- trailing,
-}: {
- icon: React.ReactNode;
- title: string;
- meta?: string | null;
- onPress?: () => void;
- accessibilityLabel?: string;
- trailing?: React.ReactNode;
-}) {
- return (
- <View className="mx-4 my-1 rounded-lg border border-gray-5 bg-gray-2">
- <View className="flex-row items-center gap-2.5 py-2 pr-1.5 pl-2">
- <Pressable
- className="min-w-0 flex-1 flex-row items-center gap-2.5 active:opacity-70"
- disabled={!onPress}
- accessibilityRole="button"
- accessibilityLabel={accessibilityLabel}
- onPress={onPress}
- >
- <View className="h-8 w-8 shrink-0 items-center justify-center rounded-md bg-gray-4">
- {icon}
- </View>
- <View className="min-w-0 flex-1">
- <Text
- className="font-medium text-[13px] text-gray-12"
- numberOfLines={1}
- >
- {title}
- </Text>
- {meta ? (
- <Text className="text-[12px] text-gray-10" numberOfLines={1}>
- {meta}
- </Text>
- ) : null}
- </View>
- </Pressable>
- {trailing ? (
- <View className="shrink-0 flex-row items-center gap-1">
- {trailing}
- </View>
- ) : null}
- </View>
- </View>
- );
-}
-
-// The manifest only loads once the run is terminal (`enabled`), so an upload
-// mid-run stays in its pending state rather than forcing an eager fetch.
-export function InlineUploadedArtifactCard({
- toolData,
- taskId,
- runId,
- enabled,
-}: {
- toolData: { status: ToolStatus; args?: Record<string, unknown> };
- taskId?: string;
- runId?: string;
- enabled: boolean;
-}) {
- const themeColors = useThemeColors();
- const [preview, setPreview] = useState<TaskRunArtifact | null>(null);
- const name = readUploadedArtifactName(toolData.args) ?? "File";
- const isLoading =
- toolData.status === "pending" || toolData.status === "running";
- const isFailed = toolData.status === "error";
-
- const { data: artifacts } = useTaskArtifacts(
- taskId,
- runId,
- enabled && !isLoading,
- );
- const resolved = useMemo(() => {
- if (!artifacts) return null;
- return (
- groupRunArtifactVersions(artifacts).find((group) => group.name === name)
- ?.latest ?? null
- );
- }, [artifacts, name]);
-
- const size = formatArtifactSize(resolved?.size);
- const meta = isLoading
- ? "Uploading…"
- : isFailed
- ? "Upload failed"
- : [fileKindLabel(name), size].filter(Boolean).join(" · ");
-
- const canOpen = Boolean(resolved?.id && taskId && runId);
-
- return (
- <>
- <CardRow
- icon={
- isLoading ? (
- <ActivityIndicator size="small" color={themeColors.gray[11]} />
- ) : (
- <FileIcon
- size={16}
- color={isFailed ? themeColors.status.error : themeColors.gray[11]}
- />
- )
- }
- title={name}
- meta={meta}
- accessibilityLabel={`View ${name}`}
- onPress={canOpen ? () => setPreview(resolved) : undefined}
- />
- {preview?.id && taskId && runId ? (
- <ArtifactPreview
- taskId={taskId}
- runId={runId}
- artifact={preview}
- onClose={() => setPreview(null)}
- />
- ) : null}
- </>
- );
-}
-
-/** The pull request a run just opened, drawn in the thread where it happened. */
-export function InlineCreatedPrCard({ url }: { url: string }) {
- const themeColors = useThemeColors();
- const parsed = parsePrUrl(url);
- const ref = parsed ? `${parsed.repoSlug}#${parsed.number}` : "Pull request";
-
- return (
- <CardRow
- icon={
- <GitPullRequest
- size={16}
- weight="bold"
- color={themeColors.status.success}
- />
- }
- title="Pull request"
- meta={ref}
- accessibilityLabel={`Open ${ref} on GitHub`}
- onPress={() => openExternalUrl(url)}
- trailing={
- <>
- <PrDiffStatsBadge prUrl={url} />
- <PrStatusBadge prUrl={url} size="sm" hideWhenUnresolved />
- </>
- }
- />
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/components/PendingPromptRecovery.test.tsx b/products/desktop/apps/mobile/src/features/tasks/components/PendingPromptRecovery.test.tsx
deleted file mode 100644
index b675a19feaee..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/components/PendingPromptRecovery.test.tsx
+++ /dev/null
@@ -1,125 +0,0 @@
-import { createElement } from "react";
-import { act, create } from "react-test-renderer";
-import { beforeEach, describe, expect, it, vi } from "vitest";
-
-const { mockPush, whenHydrated, getAllNewestFirst, clear, authState } =
- vi.hoisted(() => ({
- mockPush: vi.fn(),
- whenHydrated: vi.fn(() => Promise.resolve()),
- getAllNewestFirst: vi.fn(
- () => [] as Array<{ key: string; prompt: { promptText: string } }>,
- ),
- clear: vi.fn(),
- authState: { isAuthenticated: true },
- }));
-
-vi.mock("expo-router", () => ({ router: { push: mockPush } }));
-
-vi.mock("@/features/auth", () => ({
- useAuthStore: (selector: (s: typeof authState) => unknown) =>
- selector(authState),
-}));
-
-vi.mock("../stores/pendingPromptRecoveryStore", () => ({
- pendingPromptRecoveryStoreApi: { whenHydrated, getAllNewestFirst, clear },
-}));
-
-async function mountRecovery() {
- vi.resetModules();
- const { PendingPromptRecovery } = await import("./PendingPromptRecovery");
- await act(async () => {
- create(createElement(PendingPromptRecovery));
- await Promise.resolve();
- await Promise.resolve();
- });
- return PendingPromptRecovery;
-}
-
-describe("PendingPromptRecovery", () => {
- beforeEach(() => {
- mockPush.mockReset();
- clear.mockReset();
- whenHydrated.mockReset().mockResolvedValue(undefined);
- getAllNewestFirst.mockReset().mockReturnValue([]);
- authState.isAuthenticated = true;
- });
-
- it("recovers the newest orphaned prompt into the composer", async () => {
- getAllNewestFirst.mockReturnValue([
- { key: "newest", prompt: { promptText: "Newest prompt" } },
- { key: "older", prompt: { promptText: "Older prompt" } },
- ]);
-
- await mountRecovery();
-
- expect(clear).toHaveBeenCalledWith("newest");
- expect(mockPush).toHaveBeenCalledWith({
- pathname: "/task",
- params: { prompt: "Newest prompt" },
- });
- });
-
- it("runs only once even when re-mounted", async () => {
- getAllNewestFirst.mockReturnValue([
- { key: "newest", prompt: { promptText: "Newest prompt" } },
- ]);
-
- const PendingPromptRecovery = await mountRecovery();
- await act(async () => {
- create(createElement(PendingPromptRecovery));
- await Promise.resolve();
- });
-
- expect(mockPush).toHaveBeenCalledTimes(1);
- });
-
- it.each([
- { name: "there is no orphaned prompt", setup: () => {} },
- {
- name: "the user is not authenticated",
- setup: () => {
- authState.isAuthenticated = false;
- getAllNewestFirst.mockReturnValue([
- { key: "newest", prompt: { promptText: "Newest prompt" } },
- ]);
- },
- },
- ])("does nothing when $name", async ({ setup }) => {
- setup();
-
- await mountRecovery();
-
- expect(mockPush).not.toHaveBeenCalled();
- expect(clear).not.toHaveBeenCalled();
- });
-
- it("re-arms after logout so a new session recovers again", async () => {
- getAllNewestFirst.mockReturnValue([
- { key: "newest", prompt: { promptText: "Newest prompt" } },
- ]);
-
- vi.resetModules();
- const { PendingPromptRecovery } = await import("./PendingPromptRecovery");
- let renderer!: ReturnType<typeof create>;
- await act(async () => {
- renderer = create(createElement(PendingPromptRecovery));
- await Promise.resolve();
- await Promise.resolve();
- });
- expect(mockPush).toHaveBeenCalledTimes(1);
-
- authState.isAuthenticated = false;
- await act(async () => {
- renderer.update(createElement(PendingPromptRecovery));
- await Promise.resolve();
- });
-
- authState.isAuthenticated = true;
- await act(async () => {
- renderer.update(createElement(PendingPromptRecovery));
- await Promise.resolve();
- await Promise.resolve();
- });
- expect(mockPush).toHaveBeenCalledTimes(2);
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/tasks/components/PendingPromptRecovery.tsx b/products/desktop/apps/mobile/src/features/tasks/components/PendingPromptRecovery.tsx
deleted file mode 100644
index d4237930cd95..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/components/PendingPromptRecovery.tsx
+++ /dev/null
@@ -1,40 +0,0 @@
-import { router } from "expo-router";
-import { useEffect } from "react";
-import { useAuthStore } from "@/features/auth";
-import { logger } from "@/lib/logger";
-import { pendingPromptRecoveryStoreApi } from "../stores/pendingPromptRecoveryStore";
-
-const log = logger.scope("pending-prompt-recovery");
-
-let recoveryStarted = false;
-
-export function PendingPromptRecovery(): null {
- const isAuthenticated = useAuthStore((s) => s.isAuthenticated);
-
- useEffect(() => {
- // Re-arm on logout so a fresh session recovers again without a full app
- // restart (an orphaned prompt outlives logout in storage).
- if (!isAuthenticated) {
- recoveryStarted = false;
- return;
- }
- if (recoveryStarted) return;
- recoveryStarted = true;
- void recoverNewestPrompt();
- }, [isAuthenticated]);
-
- return null;
-}
-
-async function recoverNewestPrompt(): Promise<void> {
- await pendingPromptRecoveryStoreApi.whenHydrated();
- const [newest] = pendingPromptRecoveryStoreApi.getAllNewestFirst();
- if (!newest) return;
-
- log.info("Recovering a prompt whose task never finished creating");
- pendingPromptRecoveryStoreApi.clear(newest.key);
- router.push({
- pathname: "/task",
- params: { prompt: newest.prompt.promptText },
- });
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/components/PlanApprovalCard.test.tsx b/products/desktop/apps/mobile/src/features/tasks/components/PlanApprovalCard.test.tsx
deleted file mode 100644
index 28bb5cb8046f..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/components/PlanApprovalCard.test.tsx
+++ /dev/null
@@ -1,280 +0,0 @@
-import { createElement } from "react";
-import { TextInput } from "react-native";
-import { act, create } from "react-test-renderer";
-import { describe, expect, it, vi } from "vitest";
-import type { ToolStatus } from "@/features/chat";
-import { PlanApprovalCard } from "./PlanApprovalCard";
-
-vi.mock("phosphor-react-native", () => ({
- ArrowsClockwise: (props: Record<string, unknown>) =>
- createElement("ArrowsClockwise", props),
- ChatCircle: (props: Record<string, unknown>) =>
- createElement("ChatCircle", props),
- CheckCircle: (props: Record<string, unknown>) =>
- createElement("CheckCircle", props),
-}));
-
-vi.mock("@/lib/theme", () => ({
- useThemeColors: () => ({
- gray: {
- 9: "#666666",
- 11: "#444444",
- },
- accent: {
- 9: "#ff5500",
- },
- status: {
- success: "#00aa55",
- },
- }),
-}));
-
-vi.mock("@/features/chat", () => ({
- MarkdownText: (props: Record<string, unknown>) =>
- createElement("MarkdownText", props),
-}));
-
-function findPressableWithText(
- renderer: NonNullable<ReturnType<typeof create>>,
- label: string,
-) {
- return renderer.root.find(
- (node) =>
- typeof node.props.onPress === "function" &&
- node.findAll((child) => child.props.children === label).length > 0,
- );
-}
-
-describe("PlanApprovalCard", () => {
- it("renders the plan with the markdown renderer", () => {
- const plan = "# Plan\n\n1. Inspect renderer\n2. Fix markdown output";
- let renderer!: ReturnType<typeof create>;
-
- act(() => {
- renderer = create(
- createElement(PlanApprovalCard, {
- toolData: {
- toolCallId: "tool-plan",
- status: "pending",
- },
- permission: {
- requestId: "request-plan",
- toolCall: {
- toolCallId: "tool-plan",
- title: "Ready to code?",
- kind: "switch_mode",
- rawInput: { plan },
- },
- options: [
- {
- kind: "allow_once",
- optionId: "default",
- name: "Yes, and manually approve edits",
- },
- ],
- },
- }),
- );
- });
-
- expect(
- renderer.root.find((node) => node.props.content === plan).props.content,
- ).toBe(plan);
- });
-
- it("renders the plan from the tool call when the permission is gone", () => {
- const plan = "# Plan\n\n1. Inspect renderer\n2. Fix markdown output";
- let renderer!: ReturnType<typeof create>;
-
- act(() => {
- renderer = create(
- createElement(PlanApprovalCard, {
- toolData: {
- toolCallId: "tool-plan",
- status: "completed",
- args: { plan },
- },
- }),
- );
- });
-
- expect(
- renderer.root.find((node) => node.props.content === plan).props.content,
- ).toBe(plan);
- });
-
- it.each<[ToolStatus, string, string]>([
- ["error", "Sent back with guidance", "Plan approved"],
- ["completed", "Plan approved", "Sent back with guidance"],
- ])(
- "shows the outcome for a %s plan when the permission is gone",
- (status, expectedLabel, unexpectedLabel) => {
- const plan = "# Plan\n\n1. Inspect renderer";
- let renderer!: ReturnType<typeof create>;
-
- act(() => {
- renderer = create(
- createElement(PlanApprovalCard, {
- toolData: {
- toolCallId: "tool-plan",
- status,
- args: { plan },
- },
- }),
- );
- });
-
- const hasLabel = (label: string) =>
- renderer.root.findAll((node) => node.props.children === label).length >
- 0;
-
- expect(hasLabel(expectedLabel)).toBe(true);
- expect(hasLabel(unexpectedLabel)).toBe(false);
- },
- );
-
- it("shows a rejection when a live permission has no local response and errored", () => {
- const plan = "# Plan\n\n1. Inspect renderer";
- let renderer!: ReturnType<typeof create>;
-
- act(() => {
- renderer = create(
- createElement(PlanApprovalCard, {
- toolData: {
- toolCallId: "tool-plan",
- status: "error",
- args: { plan },
- },
- permission: {
- requestId: "request-plan",
- toolCall: {
- toolCallId: "tool-plan",
- title: "Ready to code?",
- kind: "switch_mode",
- rawInput: { plan },
- },
- options: [
- {
- kind: "allow_once",
- optionId: "default",
- name: "Yes, and manually approve edits",
- },
- ],
- },
- }),
- );
- });
-
- const hasLabel = (label: string) =>
- renderer.root.findAll((node) => node.props.children === label).length > 0;
-
- expect(hasLabel("Sent back with guidance")).toBe(true);
- expect(hasLabel("Plan approved")).toBe(false);
- });
-
- it("sends the selected approval option immediately", () => {
- const onSendPermissionResponse = vi.fn();
- let renderer!: ReturnType<typeof create>;
-
- act(() => {
- renderer = create(
- createElement(PlanApprovalCard, {
- toolData: {
- toolCallId: "tool-1",
- status: "pending",
- },
- permission: {
- requestId: "request-1",
- toolCall: {
- toolCallId: "tool-1",
- title: "Ready to code?",
- kind: "switch_mode",
- },
- options: [
- {
- kind: "allow_once",
- optionId: "default",
- name: "Yes, and manually approve edits",
- },
- ],
- },
- onSendPermissionResponse,
- }),
- );
- });
-
- const approveButton = findPressableWithText(
- renderer,
- "Yes, and manually approve edits",
- );
-
- act(() => {
- approveButton.props.onPress();
- });
-
- expect(onSendPermissionResponse).toHaveBeenCalledWith({
- toolCallId: "tool-1",
- optionId: "default",
- displayText: "Yes, and manually approve edits",
- });
- });
-
- it("collects feedback before sending the reject option", () => {
- const onSendPermissionResponse = vi.fn();
- let renderer!: ReturnType<typeof create>;
-
- act(() => {
- renderer = create(
- createElement(PlanApprovalCard, {
- toolData: {
- toolCallId: "tool-2",
- status: "pending",
- },
- permission: {
- requestId: "request-2",
- toolCall: {
- toolCallId: "tool-2",
- title: "Ready to code?",
- kind: "switch_mode",
- },
- options: [
- {
- kind: "reject_once",
- optionId: "reject_with_feedback",
- name: "No, and tell the agent what to do differently",
- _meta: { customInput: true },
- },
- ],
- },
- onSendPermissionResponse,
- }),
- );
- });
-
- const feedbackOption = findPressableWithText(
- renderer,
- "No, and tell the agent what to do differently",
- );
-
- act(() => {
- feedbackOption.props.onPress();
- });
-
- const input = renderer.root.findByType(TextInput);
- act(() => {
- input.props.onChangeText("Keep the rollback plan tighter.");
- });
-
- const sendButton = findPressableWithText(renderer, "Send feedback");
- act(() => {
- sendButton.props.onPress();
- });
-
- expect(onSendPermissionResponse).toHaveBeenCalledWith({
- toolCallId: "tool-2",
- optionId: "reject_with_feedback",
- customInput: "Keep the rollback plan tighter.",
- displayText: "Keep the rollback plan tighter.",
- });
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/tasks/components/PlanApprovalCard.tsx b/products/desktop/apps/mobile/src/features/tasks/components/PlanApprovalCard.tsx
deleted file mode 100644
index 051c03daa4b5..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/components/PlanApprovalCard.tsx
+++ /dev/null
@@ -1,236 +0,0 @@
-import {
- getPermissionOptionMeta,
- isPermissionRejection,
- permissionOptionUsesCustomInput,
-} from "@posthog/core/sessions/permissionResponse";
-import { extractPlanText } from "@posthog/core/sessions/planApprovalPresentation";
-import {
- ArrowsClockwise,
- ChatCircle,
- CheckCircle,
-} from "phosphor-react-native";
-import { useMemo, useState } from "react";
-import { Pressable, ScrollView, Text, TextInput, View } from "react-native";
-import { MarkdownText, type ToolStatus } from "@/features/chat";
-import { useThemeColors } from "@/lib/theme";
-import type { CloudPendingPermissionRequest } from "../types";
-
-interface ToolData {
- toolCallId: string;
- status: ToolStatus;
- args?: Record<string, unknown>;
-}
-
-interface PermissionResponseArgs {
- toolCallId: string;
- optionId: string;
- answers?: Record<string, string>;
- customInput?: string;
- displayText: string;
-}
-
-interface PlanApprovalCardProps {
- toolData: ToolData;
- permission?: CloudPendingPermissionRequest;
- onSendPermissionResponse?: (args: PermissionResponseArgs) => void;
-}
-
-export function PlanApprovalCard({
- toolData,
- permission,
- onSendPermissionResponse,
-}: PlanApprovalCardProps) {
- const themeColors = useThemeColors();
- const [selectedCustomOptionId, setSelectedCustomOptionId] = useState<
- string | null
- >(null);
- const [customInput, setCustomInput] = useState("");
-
- const response = permission?.response;
- const planText = useMemo(() => {
- if (permission) {
- return extractPlanText(permission.toolCall);
- }
- return extractPlanText({ rawInput: toolData.args });
- }, [permission, toolData.args]);
- const selectedOption = useMemo(
- () =>
- permission?.options.find(
- (option) => option.optionId === response?.optionId,
- ),
- [permission?.options, response?.optionId],
- );
- const isResolved =
- !!response ||
- toolData.status === "completed" ||
- toolData.status === "error";
-
- if (!permission && !planText) {
- return null;
- }
-
- const submitOption = (
- optionId: string,
- displayText: string,
- nextCustomInput?: string,
- ) => {
- if (!onSendPermissionResponse) return;
- onSendPermissionResponse({
- toolCallId: toolData.toolCallId,
- optionId,
- displayText,
- ...(nextCustomInput ? { customInput: nextCustomInput } : {}),
- });
- };
-
- const handleCustomSubmit = () => {
- const trimmed = customInput.trim();
- if (!selectedCustomOptionId || !trimmed) return;
- submitOption(selectedCustomOptionId, trimmed, trimmed);
- };
-
- const responseText =
- response?.customInput?.trim() ||
- selectedOption?.name ||
- response?.displayText ||
- null;
- const resolvedAsReject = selectedOption
- ? isPermissionRejection(selectedOption)
- : toolData.status === "error";
-
- return (
- <View className="mx-4 my-1 rounded-lg border border-accent-6 bg-gray-2">
- <View className="flex-row items-center gap-2 border-gray-6 border-b px-3 py-2">
- <ArrowsClockwise size={14} color={themeColors.accent[9]} />
- <Text className="font-mono text-[12px] text-gray-11">
- Implementation Plan
- </Text>
- </View>
-
- <View className="px-3 pt-3 pb-2">
- <Text className="font-mono text-[13px] text-gray-12 leading-5">
- Approve this plan to proceed?
- </Text>
- </View>
-
- {planText && (
- <View className="px-3 pb-3">
- <View className="overflow-hidden rounded-lg border border-accent-6 bg-accent-3/40">
- <ScrollView
- className="max-h-[320px]"
- nestedScrollEnabled
- showsVerticalScrollIndicator={false}
- >
- <View className="px-3 py-3">
- <MarkdownText content={planText} disableRemoteImages />
- </View>
- </ScrollView>
- </View>
- </View>
- )}
-
- {isResolved ? (
- <View className="px-3 pb-3">
- <View className="flex-row items-start gap-2 rounded-lg border border-gray-6 bg-gray-3 px-3 py-2.5">
- {resolvedAsReject ? (
- <ChatCircle size={14} color={themeColors.gray[11]} />
- ) : (
- <CheckCircle
- size={14}
- color={themeColors.status.success}
- weight="fill"
- />
- )}
- <View className="flex-1">
- <Text
- className={`font-mono text-[12px] ${
- resolvedAsReject ? "text-gray-11" : "text-status-success"
- }`}
- >
- {resolvedAsReject ? "Sent back with guidance" : "Plan approved"}
- </Text>
- {responseText && (
- <Text className="mt-1 font-mono text-[12px] text-gray-10 leading-4">
- {responseText}
- </Text>
- )}
- </View>
- </View>
- </View>
- ) : permission ? (
- <View className="px-3 pb-3">
- {permission.options.map((option) => {
- const meta = getPermissionOptionMeta(option);
- const usesCustomInput = permissionOptionUsesCustomInput(option);
- const isCustomSelected = selectedCustomOptionId === option.optionId;
-
- return (
- <View key={option.optionId} className="mb-2 last:mb-0">
- <Pressable
- onPress={() => {
- if (usesCustomInput) {
- setSelectedCustomOptionId((current) =>
- current === option.optionId ? null : option.optionId,
- );
- return;
- }
- submitOption(option.optionId, option.name);
- }}
- className={`rounded-lg border px-3 py-2.5 ${
- isCustomSelected
- ? "border-accent-8 bg-accent-3"
- : "border-gray-6 bg-gray-3"
- }`}
- >
- <Text
- className={`font-mono text-[13px] ${
- isCustomSelected ? "text-accent-11" : "text-gray-12"
- }`}
- >
- {option.name}
- </Text>
- {meta.description && (
- <Text className="mt-1 font-mono text-[11px] text-gray-9 leading-4">
- {meta.description}
- </Text>
- )}
- </Pressable>
-
- {usesCustomInput && isCustomSelected && (
- <View className="mt-2 rounded-lg border border-gray-6 bg-background px-3 py-3">
- <TextInput
- className="min-h-[88px] font-mono text-[13px] text-gray-12"
- placeholder="Type here to tell the agent what to do differently"
- placeholderTextColor={themeColors.gray[9]}
- value={customInput}
- onChangeText={setCustomInput}
- multiline
- textAlignVertical="top"
- />
- <Pressable
- onPress={handleCustomSubmit}
- disabled={!customInput.trim()}
- className={`mt-3 rounded-lg px-3 py-2 ${
- customInput.trim() ? "bg-accent-9" : "bg-gray-4"
- }`}
- >
- <Text
- className={`text-center font-medium ${
- customInput.trim()
- ? "text-accent-contrast"
- : "text-gray-9"
- }`}
- >
- Send feedback
- </Text>
- </Pressable>
- </View>
- )}
- </View>
- );
- })}
- </View>
- ) : null}
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/components/PlanStatusBar.tsx b/products/desktop/apps/mobile/src/features/tasks/components/PlanStatusBar.tsx
deleted file mode 100644
index 1db236aaa233..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/components/PlanStatusBar.tsx
+++ /dev/null
@@ -1,88 +0,0 @@
-import { CheckCircle, CircleDashed, XCircle } from "phosphor-react-native";
-import { useMemo, useState } from "react";
-import { ActivityIndicator, Pressable, Text, View } from "react-native";
-import { useThemeColors } from "@/lib/theme";
-import type { PlanEntry } from "../types";
-
-interface PlanStatusBarProps {
- plan: PlanEntry[] | null;
-}
-
-function StatusIcon({ status }: { status: string }) {
- const themeColors = useThemeColors();
-
- switch (status) {
- case "completed":
- return <CheckCircle size={14} color={themeColors.status.success} />;
- case "in_progress":
- return <ActivityIndicator size={12} color={themeColors.accent[9]} />;
- case "failed":
- return <XCircle size={14} color={themeColors.status.error} />;
- default:
- return <CircleDashed size={14} color={themeColors.gray[8]} />;
- }
-}
-
-export function PlanStatusBar({ plan }: PlanStatusBarProps) {
- const [isExpanded, setIsExpanded] = useState(false);
- const themeColors = useThemeColors();
-
- const stats = useMemo(() => {
- if (!plan?.length) return null;
-
- const completed = plan.filter((e) => e.status === "completed").length;
- const total = plan.length;
- const inProgress = plan.find((e) => e.status === "in_progress");
- const allCompleted = completed === total;
-
- return { completed, total, inProgress, allCompleted };
- }, [plan]);
-
- if (!stats || stats.allCompleted) return null;
-
- return (
- <View className="border-gray-6 border-b bg-gray-2">
- <Pressable
- onPress={() => setIsExpanded(!isExpanded)}
- className="flex-row items-center gap-2 px-4 py-2.5"
- >
- <Text className="font-mono text-[12px] text-gray-9">
- {stats.completed}/{stats.total} completed
- </Text>
- {stats.inProgress && (
- <>
- <Text className="text-[12px] text-gray-7">·</Text>
- <ActivityIndicator size={10} color={themeColors.accent[9]} />
- <Text
- className="flex-1 font-mono text-[12px] text-gray-11"
- numberOfLines={1}
- >
- {stats.inProgress.content}
- </Text>
- </>
- )}
- </Pressable>
-
- {isExpanded && plan && (
- <View className="border-gray-6 border-t px-4 pt-2 pb-2.5">
- {plan.map((entry, index) => (
- <View
- key={`${index}-${entry.content}`}
- className="flex-row items-center gap-2 py-1"
- >
- <StatusIcon status={entry.status} />
- <Text
- className={`flex-1 font-mono text-[12px] ${
- entry.status === "completed" ? "text-gray-9" : "text-gray-12"
- }`}
- numberOfLines={1}
- >
- {entry.content}
- </Text>
- </View>
- ))}
- </View>
- )}
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/components/PrDiffStatsBadge.tsx b/products/desktop/apps/mobile/src/features/tasks/components/PrDiffStatsBadge.tsx
deleted file mode 100644
index 86a79a3ee299..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/components/PrDiffStatsBadge.tsx
+++ /dev/null
@@ -1,54 +0,0 @@
-import { Text } from "@components/text";
-import { useRouter } from "expo-router";
-import { Pressable } from "react-native";
-import { useThemeColors } from "@/lib/theme";
-import { usePrStatus } from "../hooks/usePrStatus";
-
-interface PrDiffStatsBadgeProps {
- prUrl: string;
-}
-
-function compact(n: number): string {
- if (n < 1000) return String(n);
- if (n < 10_000) return `${(n / 1000).toFixed(1).replace(/\.0$/, "")}k`;
- if (n < 1_000_000) return `${Math.round(n / 1000)}k`;
- return `${(n / 1_000_000).toFixed(1).replace(/\.0$/, "")}M`;
-}
-
-export function PrDiffStatsBadge({ prUrl }: PrDiffStatsBadgeProps) {
- const themeColors = useThemeColors();
- const router = useRouter();
- const { data } = usePrStatus(prUrl);
-
- // Hide while loading or when the GitHub API call failed (e.g. private repo
- // without auth). The PR status icon next door still tells the user a PR
- // exists; we just can't show the diff numbers.
- if (!data) return null;
-
- const handlePress = () => {
- router.push({ pathname: "/pr-diff", params: { prUrl } });
- };
-
- return (
- <Pressable
- onPress={handlePress}
- hitSlop={10}
- className="h-9 flex-row items-center gap-1 rounded-lg border border-gray-6 bg-gray-3 px-2.5 active:opacity-60"
- accessibilityRole="link"
- accessibilityLabel={`${data.additions} added, ${data.deletions} removed`}
- >
- <Text
- className="font-semibold text-[13px]"
- style={{ color: themeColors.status.success }}
- >
- +{compact(data.additions)}
- </Text>
- <Text
- className="font-semibold text-[13px]"
- style={{ color: themeColors.status.error }}
- >
- −{compact(data.deletions)}
- </Text>
- </Pressable>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/components/PrStatusBadge.test.tsx b/products/desktop/apps/mobile/src/features/tasks/components/PrStatusBadge.test.tsx
deleted file mode 100644
index c71e512fc852..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/components/PrStatusBadge.test.tsx
+++ /dev/null
@@ -1,112 +0,0 @@
-import { createElement } from "react";
-import { act, create } from "react-test-renderer";
-import { describe, expect, it, vi } from "vitest";
-import type { PrStatus } from "../hooks/usePrStatus";
-import { PrStatusBadge } from "./PrStatusBadge";
-
-vi.mock("phosphor-react-native", () => ({
- GitMerge: (props: Record<string, unknown>) =>
- createElement("GitMerge", props),
- GitPullRequest: (props: Record<string, unknown>) =>
- createElement("GitPullRequest", props),
-}));
-
-vi.mock("@/lib/theme", () => ({
- useThemeColors: () => ({
- gray: { 11: "#444444" },
- status: { success: "#00aa00", error: "#cc0000" },
- }),
- toRgba: (hex: string, alpha: number) => `${hex}/${alpha}`,
- MERGED_COLOR: "#8e4ec6",
-}));
-
-vi.mock("@/lib/openExternalUrl", () => ({ openExternalUrl: vi.fn() }));
-
-vi.mock("../hooks/usePrStatus", () => ({ usePrStatus: vi.fn() }));
-
-import { usePrStatus } from "../hooks/usePrStatus";
-
-const mockUsePrStatus = vi.mocked(usePrStatus);
-
-function setStatus(data: PrStatus | null | undefined) {
- mockUsePrStatus.mockReturnValue({ data } as ReturnType<typeof usePrStatus>);
-}
-
-function render(props: Parameters<typeof PrStatusBadge>[0]) {
- let renderer: ReturnType<typeof create> | null = null;
- act(() => {
- renderer = create(createElement(PrStatusBadge, props));
- });
- if (!renderer) throw new Error("Renderer not created");
- return renderer as ReturnType<typeof create>;
-}
-
-function label(renderer: ReturnType<typeof create>): string | undefined {
- const node = renderer.root.findAll(
- (n) => typeof n.props?.accessibilityLabel === "string",
- )[0];
- return node?.props.accessibilityLabel as string | undefined;
-}
-
-function iconCount(renderer: ReturnType<typeof create>, type: string): number {
- return renderer.root.findAll((n) => n.type === type).length;
-}
-
-const base: PrStatus = {
- state: "open",
- merged: false,
- draft: false,
- additions: 0,
- deletions: 0,
-};
-
-describe("PrStatusBadge", () => {
- it("renders an open PR badge", () => {
- setStatus({ ...base, state: "open" });
- const r = render({ prUrl: "https://github.com/a/b/pull/1" });
- expect(label(r)).toBe("Open PR");
- expect(iconCount(r, "GitPullRequest")).toBe(1);
- });
-
- it("renders a merged PR badge with the merge icon", () => {
- setStatus({ ...base, state: "closed", merged: true });
- const r = render({ prUrl: "https://github.com/a/b/pull/1" });
- expect(label(r)).toBe("Open merged PR");
- expect(iconCount(r, "GitMerge")).toBe(1);
- expect(iconCount(r, "GitPullRequest")).toBe(0);
- });
-
- it("renders a closed PR badge", () => {
- setStatus({ ...base, state: "closed" });
- const r = render({ prUrl: "https://github.com/a/b/pull/1" });
- expect(label(r)).toBe("Open closed PR");
- });
-
- it("renders a draft PR badge", () => {
- setStatus({ ...base, state: "open", draft: true });
- const r = render({ prUrl: "https://github.com/a/b/pull/1" });
- expect(label(r)).toBe("Open draft PR");
- });
-
- it.each([
- { data: undefined, label: "loading" },
- { data: null, label: "unresolved (private/404/non-GitHub)" },
- ])(
- "renders nothing when hideWhenUnresolved is set and status is $label",
- ({ data }) => {
- setStatus(data);
- const r = render({
- prUrl: "https://github.com/a/b/pull/1",
- hideWhenUnresolved: true,
- });
- expect(r.toJSON()).toBeNull();
- },
- );
-
- it("still renders a neutral badge for an unresolved PR by default", () => {
- setStatus(null);
- const r = render({ prUrl: "https://github.com/a/b/pull/1" });
- expect(r.toJSON()).not.toBeNull();
- expect(label(r)).toBe("Open PR");
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/tasks/components/PrStatusBadge.tsx b/products/desktop/apps/mobile/src/features/tasks/components/PrStatusBadge.tsx
deleted file mode 100644
index 04c39034dc87..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/components/PrStatusBadge.tsx
+++ /dev/null
@@ -1,67 +0,0 @@
-import { GitMerge, GitPullRequest } from "phosphor-react-native";
-import { Pressable } from "react-native";
-import { openExternalUrl } from "@/lib/openExternalUrl";
-import { MERGED_COLOR, toRgba, useThemeColors } from "@/lib/theme";
-import { usePrStatus } from "../hooks/usePrStatus";
-
-interface PrStatusBadgeProps {
- prUrl: string;
- // Render nothing until the PR state resolves, and only for a canonical
- // GitHub PR URL. Inbox surfaces use this so an always-on neutral icon never
- // implies a status we couldn't confirm (private repo, 404, unparseable URL).
- hideWhenUnresolved?: boolean;
- size?: "sm" | "md";
-}
-
-export function PrStatusBadge({
- prUrl,
- hideWhenUnresolved = false,
- size = "md",
-}: PrStatusBadgeProps) {
- const themeColors = useThemeColors();
- const { data: status } = usePrStatus(prUrl);
-
- if (hideWhenUnresolved && !status) return null;
-
- const handlePress = () => {
- openExternalUrl(prUrl);
- };
-
- let color: string = themeColors.gray[11];
- let Icon: typeof GitPullRequest = GitPullRequest;
- let label = "Open PR";
-
- if (status?.merged) {
- color = MERGED_COLOR;
- Icon = GitMerge;
- label = "Open merged PR";
- } else if (status?.state === "closed") {
- color = themeColors.status.error;
- label = "Open closed PR";
- } else if (status?.draft) {
- color = themeColors.gray[11];
- label = "Open draft PR";
- } else if (status?.state === "open") {
- color = themeColors.status.success;
- label = "Open PR";
- }
-
- const box = size === "sm" ? "h-7 w-7" : "h-9 w-9";
- const iconSize = size === "sm" ? 16 : 20;
-
- return (
- <Pressable
- onPress={handlePress}
- hitSlop={10}
- className={`${box} items-center justify-center rounded-lg border active:opacity-60`}
- style={{
- backgroundColor: toRgba(color, 0.12),
- borderColor: toRgba(color, 0.35),
- }}
- accessibilityRole="link"
- accessibilityLabel={label}
- >
- <Icon size={iconSize} weight="bold" color={color} />
- </Pressable>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/components/QuestionCard.tsx b/products/desktop/apps/mobile/src/features/tasks/components/QuestionCard.tsx
deleted file mode 100644
index 6cca5c807303..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/components/QuestionCard.tsx
+++ /dev/null
@@ -1,378 +0,0 @@
-import {
- ChatCircle,
- CheckCircle,
- CircleDashed,
- RadioButton,
-} from "phosphor-react-native";
-import { useState } from "react";
-import {
- Pressable,
- Text,
- TextInput,
- TouchableOpacity,
- View,
-} from "react-native";
-import type { ToolStatus } from "@/features/chat";
-import { useThemeColors } from "@/lib/theme";
-
-interface QuestionOption {
- label: string;
- description?: string;
-}
-
-interface QuestionItem {
- question: string;
- header?: string;
- options: QuestionOption[];
- multiSelect?: boolean;
-}
-
-interface ToolData {
- toolName: string;
- toolCallId: string;
- status: ToolStatus;
- args?: Record<string, unknown>;
- result?: unknown;
-}
-
-interface PermissionResponseArgs {
- toolCallId: string;
- optionId: string;
- answers?: Record<string, string>;
- customInput?: string;
- displayText: string;
-}
-
-interface QuestionCardProps {
- toolData: ToolData;
- onSendPermissionResponse?: (args: PermissionResponseArgs) => void;
-}
-
-function extractQuestions(args?: Record<string, unknown>): QuestionItem[] {
- if (!args) return [];
- // Questions may be at top level or nested under input
- const raw =
- args.questions ?? (args.input as Record<string, unknown>)?.questions;
- if (!Array.isArray(raw)) return [];
- return raw.filter(
- (q): q is QuestionItem =>
- q != null &&
- typeof q === "object" &&
- typeof (q as QuestionItem).question === "string" &&
- Array.isArray((q as QuestionItem).options),
- );
-}
-
-function extractAnswer(result: unknown): string | null {
- if (typeof result === "string") return result;
- if (result && typeof result === "object") {
- const obj = result as Record<string, unknown>;
- if (typeof obj.answer === "string") return obj.answer;
- if (typeof obj.answers === "object" && obj.answers) {
- const answers = obj.answers as Record<string, string>;
- return Object.values(answers).join(", ");
- }
- if (typeof obj.text === "string") return obj.text;
- if (typeof obj.content === "string") return obj.content;
- }
- return null;
-}
-
-export function QuestionCard({
- toolData,
- onSendPermissionResponse,
-}: QuestionCardProps) {
- const themeColors = useThemeColors();
- const questions = extractQuestions(toolData.args);
- const isCompleted =
- toolData.status === "completed" || toolData.status === "error";
-
- if (questions.length === 0) {
- return null;
- }
-
- if (isCompleted) {
- const answer = extractAnswer(toolData.result);
- return (
- <View className="mx-4 my-1 rounded-lg border border-gray-6 bg-gray-2">
- <View className="flex-row items-center gap-2 px-3 py-2">
- <ChatCircle size={14} color={themeColors.gray[9]} />
- <Text
- className="flex-1 font-mono text-[12px] text-gray-11"
- numberOfLines={1}
- >
- {questions[0]?.header ?? "Question"}
- </Text>
- </View>
- <View className="border-gray-6 border-t px-3 py-2">
- <Text className="font-mono text-[12px] text-gray-9" numberOfLines={2}>
- {questions[0]?.question}
- </Text>
- {answer && (
- <View className="mt-1.5 flex-row items-start gap-1.5">
- <CheckCircle
- size={12}
- color={themeColors.status.success}
- weight="fill"
- />
- <Text className="flex-1 font-mono text-[12px] text-status-success">
- {answer}
- </Text>
- </View>
- )}
- </View>
- </View>
- );
- }
-
- return (
- <InteractiveQuestion
- questions={questions}
- toolCallId={toolData.toolCallId}
- onSendPermissionResponse={onSendPermissionResponse}
- />
- );
-}
-
-function InteractiveQuestion({
- questions,
- toolCallId,
- onSendPermissionResponse,
-}: {
- questions: QuestionItem[];
- toolCallId: string;
- onSendPermissionResponse?: (args: PermissionResponseArgs) => void;
-}) {
- const themeColors = useThemeColors();
- const [currentIndex, setCurrentIndex] = useState(0);
- const [selectedOptions, setSelectedOptions] = useState<
- Map<number, Set<string>>
- >(new Map());
- const [otherTexts, setOtherTexts] = useState<Map<number, string>>(new Map());
- const [showOtherInput, setShowOtherInput] = useState<Map<number, boolean>>(
- new Map(),
- );
-
- const question = questions[currentIndex];
- if (!question) return null;
-
- const isMultiSelect = question.multiSelect ?? false;
- const isLastQuestion = currentIndex === questions.length - 1;
- const selected = selectedOptions.get(currentIndex) ?? new Set<string>();
- const otherText = otherTexts.get(currentIndex) ?? "";
- const isOtherShown = showOtherInput.get(currentIndex) ?? false;
- const hasSelection = selected.size > 0 || otherText.trim().length > 0;
-
- const toggleOption = (label: string) => {
- const newSelected = new Map(selectedOptions);
- const current = new Set(selected);
-
- if (isMultiSelect) {
- if (current.has(label)) {
- current.delete(label);
- } else {
- current.add(label);
- }
- } else {
- if (current.has(label)) {
- current.clear();
- } else {
- current.clear();
- current.add(label);
- }
- // Clear "Other" when selecting a preset option
- const newOther = new Map(showOtherInput);
- newOther.set(currentIndex, false);
- setShowOtherInput(newOther);
- const newTexts = new Map(otherTexts);
- newTexts.set(currentIndex, "");
- setOtherTexts(newTexts);
- }
-
- newSelected.set(currentIndex, current);
- setSelectedOptions(newSelected);
- };
-
- const toggleOther = () => {
- const newOther = new Map(showOtherInput);
- const isNowShown = !isOtherShown;
- newOther.set(currentIndex, isNowShown);
- setShowOtherInput(newOther);
-
- if (!isMultiSelect && isNowShown) {
- // Clear preset selections when choosing "Other" in single-select
- const newSelected = new Map(selectedOptions);
- newSelected.set(currentIndex, new Set());
- setSelectedOptions(newSelected);
- }
- };
-
- const handleSubmit = () => {
- const parts: string[] = [];
- for (const label of selected) {
- parts.push(label);
- }
- const trimmedOther = otherText.trim();
- if (trimmedOther) {
- parts.push(trimmedOther);
- }
- const answer = parts.join(", ");
-
- if (!isLastQuestion) {
- setCurrentIndex(currentIndex + 1);
- return;
- }
-
- if (!answer || !onSendPermissionResponse) return;
-
- // Derive the ACP optionId the agent is expecting. Options are built
- // server-side (buildQuestionOptions in packages/agent) as
- // `${OPTION_PREFIX}${idx}` where OPTION_PREFIX is "option_". If the
- // user only typed into "Other", fall back to option_0 — the answers
- // map carries the actual content for the agent.
- const firstSelectedLabel = parts[0];
- const selectedIdx = question.options.findIndex(
- (o) => o.label === firstSelectedLabel,
- );
- const optionIdx = selectedIdx >= 0 ? selectedIdx : 0;
- const optionId = `option_${optionIdx}`;
-
- onSendPermissionResponse({
- toolCallId,
- optionId,
- answers: { [question.question]: answer },
- customInput: trimmedOther || undefined,
- displayText: answer,
- });
- };
-
- return (
- <View className="mx-4 my-1 rounded-lg border border-accent-6 bg-gray-2">
- {/* Header */}
- <View className="flex-row items-center gap-2 border-gray-6 border-b px-3 py-2">
- <ChatCircle size={14} color={themeColors.accent[9]} />
- <Text className="font-mono text-[12px] text-gray-11">
- {question.header ?? "Question"}
- </Text>
- {questions.length > 1 && (
- <Text className="font-mono text-[11px] text-gray-8">
- {currentIndex + 1}/{questions.length}
- </Text>
- )}
- </View>
-
- {/* Question text */}
- <View className="px-3 pt-3 pb-2">
- <Text className="font-mono text-[13px] text-gray-12 leading-5">
- {question.question}
- </Text>
- </View>
-
- {/* Options */}
- <View className="px-3 pb-2">
- {question.options.map((option) => {
- const isSelected = selected.has(option.label);
- return (
- <Pressable
- key={option.label}
- onPress={() => toggleOption(option.label)}
- className={`mb-1.5 rounded-lg border px-3 py-2.5 ${
- isSelected
- ? "border-accent-8 bg-accent-3"
- : "border-gray-6 bg-gray-3"
- }`}
- >
- <View className="flex-row items-center gap-2">
- {isMultiSelect ? (
- isSelected ? (
- <CheckCircle
- size={16}
- color={themeColors.accent[9]}
- weight="fill"
- />
- ) : (
- <CircleDashed size={16} color={themeColors.gray[8]} />
- )
- ) : isSelected ? (
- <RadioButton
- size={16}
- color={themeColors.accent[9]}
- weight="fill"
- />
- ) : (
- <CircleDashed size={16} color={themeColors.gray[8]} />
- )}
- <Text
- className={`flex-1 font-mono text-[13px] ${
- isSelected ? "text-accent-11" : "text-gray-12"
- }`}
- >
- {option.label}
- </Text>
- </View>
- {option.description && (
- <Text className="mt-1 ml-6 font-mono text-[11px] text-gray-9 leading-4">
- {option.description}
- </Text>
- )}
- </Pressable>
- );
- })}
-
- {/* Other option */}
- <Pressable
- onPress={toggleOther}
- className={`mb-1.5 rounded-lg border px-3 py-2.5 ${
- isOtherShown
- ? "border-accent-8 bg-accent-3"
- : "border-gray-6 bg-gray-3"
- }`}
- >
- <Text
- className={`font-mono text-[13px] ${
- isOtherShown ? "text-accent-11" : "text-gray-9"
- }`}
- >
- Other...
- </Text>
- </Pressable>
-
- {isOtherShown && (
- <TextInput
- className="mb-1.5 rounded-lg border border-gray-6 bg-gray-3 px-3 py-2.5 font-mono text-[13px] text-gray-12"
- placeholder="Type your answer..."
- placeholderTextColor={themeColors.gray[8]}
- value={otherText}
- onChangeText={(text) => {
- const newTexts = new Map(otherTexts);
- newTexts.set(currentIndex, text);
- setOtherTexts(newTexts);
- }}
- multiline
- autoFocus
- />
- )}
- </View>
-
- {/* Submit */}
- <View className="border-gray-6 border-t px-3 py-2.5">
- <TouchableOpacity
- onPress={handleSubmit}
- disabled={!hasSelection}
- className={`items-center rounded-lg px-4 py-2.5 ${
- hasSelection ? "bg-accent-9" : "bg-gray-4"
- }`}
- activeOpacity={0.7}
- >
- <Text
- className={`font-medium font-mono text-[13px] ${
- hasSelection ? "text-accent-contrast" : "text-gray-8"
- }`}
- >
- {isLastQuestion ? "Submit" : "Next"}
- </Text>
- </TouchableOpacity>
- </View>
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/components/StopRunButton.tsx b/products/desktop/apps/mobile/src/features/tasks/components/StopRunButton.tsx
deleted file mode 100644
index 8440d0ec1680..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/components/StopRunButton.tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-import { Text } from "@components/text";
-import { Stop } from "phosphor-react-native";
-import { Pressable } from "react-native";
-import { useThemeColors } from "@/lib/theme";
-
-interface StopRunButtonProps {
- onPress: () => void;
-}
-
-export function StopRunButton({ onPress }: StopRunButtonProps) {
- const themeColors = useThemeColors();
- return (
- <Pressable
- onPress={onPress}
- hitSlop={8}
- className="h-8 flex-row items-center gap-1 rounded-full border border-status-error/40 bg-status-error/10 px-2.5 active:opacity-60"
- >
- <Stop size={14} color={themeColors.status.error} weight="fill" />
- <Text className="font-medium text-[13px] text-status-error">Stop</Text>
- </Pressable>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/components/SwipeableTaskItem.tsx b/products/desktop/apps/mobile/src/features/tasks/components/SwipeableTaskItem.tsx
deleted file mode 100644
index 64bd68eb9ad2..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/components/SwipeableTaskItem.tsx
+++ /dev/null
@@ -1,200 +0,0 @@
-import { isTaskRunning } from "@posthog/core/tasks/taskArchive";
-import type { Task } from "@posthog/shared";
-import * as Haptics from "expo-haptics";
-import { Archive, ArrowCounterClockwise } from "phosphor-react-native";
-import { useEffect, useRef } from "react";
-import {
- Animated,
- Easing,
- LayoutAnimation,
- PanResponder,
- Text,
- View,
-} from "react-native";
-import { useThemeColors } from "@/lib/theme";
-import { confirmArchiveRunningTask } from "../utils/archiveGuard";
-import { TaskItem } from "./TaskItem";
-
-const SWIPE_THRESHOLD = 60;
-
-function springToRest(value: Animated.Value): void {
- Animated.spring(value, {
- toValue: 0,
- useNativeDriver: true,
- tension: 40,
- friction: 8,
- }).start();
-}
-
-// Slide the row off-screen, then smooth the list-height change before running
-// the archive/unarchive side effect.
-function slideOut(value: Animated.Value, onDone: () => void): void {
- Animated.timing(value, {
- toValue: -400,
- duration: 150,
- easing: Easing.in(Easing.ease),
- useNativeDriver: true,
- }).start(() => {
- LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
- onDone();
- });
-}
-
-interface SwipeableTaskItemProps {
- task: Task;
- isArchived: boolean;
- onPress: (task: Task) => void;
- onArchive: (taskId: string) => void;
- onUnarchive: (taskId: string) => void;
- onLongPress?: (task: Task) => void;
- selectionMode?: boolean;
- selected?: boolean;
- onSwipeStart?: () => void;
- onSwipeEnd?: () => void;
-}
-
-export function SwipeableTaskItem({
- task,
- isArchived,
- onPress,
- onArchive,
- onUnarchive,
- onLongPress,
- selectionMode = false,
- selected = false,
- onSwipeStart,
- onSwipeEnd,
-}: SwipeableTaskItemProps) {
- const themeColors = useThemeColors();
- const translateX = useRef(new Animated.Value(0)).current;
- const actionTriggeredRef = useRef(false);
-
- // PanResponder.create runs once per mount, so its callbacks close over the
- // *initial* prop values. Route through a ref so props stay current without
- // rebuilding the responder.
- const propsRef = useRef({
- task,
- isArchived,
- onArchive,
- onUnarchive,
- selectionMode,
- onSwipeStart,
- onSwipeEnd,
- });
- propsRef.current = {
- task,
- isArchived,
- onArchive,
- onUnarchive,
- selectionMode,
- onSwipeStart,
- onSwipeEnd,
- };
-
- // Reset position when the item reappears (e.g. moved between sections)
- useEffect(() => {
- translateX.setValue(0);
- actionTriggeredRef.current = false;
- }, [translateX]);
-
- const panResponder = useRef(
- PanResponder.create({
- // Start tracking immediately on horizontal movement
- onStartShouldSetPanResponder: () => false,
- onMoveShouldSetPanResponder: (_, gesture) =>
- !propsRef.current.selectionMode &&
- Math.abs(gesture.dx) > 5 &&
- Math.abs(gesture.dx) > Math.abs(gesture.dy) &&
- gesture.dx < 0,
- // Capture before children so FlatList doesn't steal
- onMoveShouldSetPanResponderCapture: (_, gesture) =>
- !propsRef.current.selectionMode &&
- Math.abs(gesture.dx) > 8 &&
- Math.abs(gesture.dx) > Math.abs(gesture.dy * 1.2) &&
- gesture.dx < 0,
- // Never let go once we have the gesture
- onPanResponderTerminationRequest: () => false,
- onShouldBlockNativeResponder: () => true,
- onPanResponderGrant: () => {
- actionTriggeredRef.current = false;
- propsRef.current.onSwipeStart?.();
- },
- onPanResponderMove: (_, gesture) => {
- // Clamp to left-only swipe
- translateX.setValue(gesture.dx > 0 ? 0 : gesture.dx);
- },
- onPanResponderRelease: (_, gesture) => {
- const p = propsRef.current;
- p.onSwipeEnd?.();
- if (gesture.dx < -SWIPE_THRESHOLD && !actionTriggeredRef.current) {
- actionTriggeredRef.current = true;
- Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium);
-
- // Archiving a running task stops its agent, so spring the row back
- // and confirm first — only slide out and archive once the user
- // agrees, matching the animation of every other archive action.
- if (!p.isArchived && isTaskRunning(p.task)) {
- springToRest(translateX);
- confirmArchiveRunningTask(p.task.title, () =>
- slideOut(translateX, () => p.onArchive(p.task.id)),
- );
- return;
- }
-
- slideOut(translateX, () => {
- if (p.isArchived) {
- p.onUnarchive(p.task.id);
- } else {
- p.onArchive(p.task.id);
- }
- });
- } else {
- springToRest(translateX);
- }
- },
- onPanResponderTerminate: () => {
- propsRef.current.onSwipeEnd?.();
- Animated.spring(translateX, {
- toValue: 0,
- useNativeDriver: true,
- }).start();
- },
- }),
- ).current;
-
- const actionBg = isArchived ? themeColors.accent[9] : themeColors.gray[8];
- const ActionIcon = isArchived ? ArrowCounterClockwise : Archive;
- const actionLabel = isArchived ? "Restore" : "Archive";
-
- return (
- <View className="overflow-hidden">
- {/* Action revealed behind the row */}
- <View
- className="absolute inset-y-0 right-0 left-0 flex-row items-center justify-end px-5"
- style={{ backgroundColor: actionBg }}
- >
- <ActionIcon size={18} color="#fff" />
- <Text className="ml-2 font-medium text-white text-xs">
- {actionLabel}
- </Text>
- </View>
-
- {/* Sliding task row */}
- <Animated.View
- style={{
- transform: [{ translateX }],
- backgroundColor: themeColors.background,
- }}
- {...panResponder.panHandlers}
- >
- <TaskItem
- task={task}
- onPress={onPress}
- onLongPress={onLongPress}
- selectionMode={selectionMode}
- selected={selected}
- />
- </Animated.View>
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/components/TaskArtifacts.test.tsx b/products/desktop/apps/mobile/src/features/tasks/components/TaskArtifacts.test.tsx
deleted file mode 100644
index 245e224cb5fd..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/components/TaskArtifacts.test.tsx
+++ /dev/null
@@ -1,236 +0,0 @@
-import type { TaskRunArtifact } from "@posthog/shared";
-import { createElement } from "react";
-import { act, create } from "react-test-renderer";
-import { beforeEach, describe, expect, it, vi } from "vitest";
-import { TaskArtifacts } from "./TaskArtifacts";
-
-const mockUseTaskArtifacts = vi.fn();
-const mockUseUserQuery = vi.fn();
-const dismissTaskRunArtifacts = vi.fn(async () => [] as TaskRunArtifact[]);
-
-vi.mock("../hooks/useTaskArtifacts", () => ({
- useTaskArtifacts: (...args: unknown[]) => mockUseTaskArtifacts(...args),
-}));
-
-vi.mock("@/features/auth", () => ({
- useUserQuery: () => mockUseUserQuery(),
-}));
-
-vi.mock("../api", () => ({
- presignTaskRunArtifact: vi.fn(),
- dismissTaskRunArtifacts: (...args: unknown[]) =>
- dismissTaskRunArtifacts(...(args as [])),
-}));
-
-vi.mock("@tanstack/react-query", () => ({
- useMutation: (opts: {
- mutationFn: (vars: unknown) => Promise<unknown>;
- onSuccess?: (data: unknown) => void;
- onError?: (error: unknown) => void;
- }) => ({
- isPending: false,
- mutate: (vars: unknown) => {
- Promise.resolve(opts.mutationFn(vars)).then(
- opts.onSuccess ?? (() => undefined),
- opts.onError ?? (() => undefined),
- );
- },
- }),
-}));
-
-vi.mock("@/components/SheetContainer", () => ({
- SheetContainer: ({
- open,
- children,
- }: {
- open: boolean;
- children: React.ReactNode;
- }) => (open ? createElement("SheetContainer", null, children) : null),
-}));
-
-vi.mock("./ArtifactPreview", () => ({
- ArtifactPreview: (props: Record<string, unknown>) =>
- createElement("ArtifactPreview", props),
-}));
-
-vi.mock("@/lib/openExternalUrl", () => ({ openExternalUrl: vi.fn() }));
-
-vi.mock("phosphor-react-native", () => ({
- CaretDown: (props: Record<string, unknown>) =>
- createElement("CaretDown", props),
- Check: (props: Record<string, unknown>) => createElement("Check", props),
- DownloadSimple: (props: Record<string, unknown>) =>
- createElement("DownloadSimple", props),
- File: (props: Record<string, unknown>) => createElement("File", props),
- Package: (props: Record<string, unknown>) => createElement("Package", props),
- X: (props: Record<string, unknown>) => createElement("X", props),
-}));
-
-vi.mock("@/lib/theme", () => ({
- useThemeColors: () => ({
- gray: { 4: "#eee", 10: "#888", 11: "#555", 12: "#111" },
- accent: { 9: "#09f", 11: "#06c" },
- }),
-}));
-
-function element() {
- return createElement(TaskArtifacts, {
- taskId: "t1",
- runId: "r1",
- enabled: true,
- });
-}
-
-function mount(artifacts: TaskRunArtifact[] | undefined) {
- mockUseTaskArtifacts.mockReturnValue({ data: artifacts, refetch: vi.fn() });
- let renderer: ReturnType<typeof create> | null = null;
- act(() => {
- renderer = create(element());
- });
- if (!renderer) throw new Error("Renderer not created");
- return renderer as ReturnType<typeof create>;
-}
-
-function json(renderer: ReturnType<typeof create>) {
- return JSON.stringify(renderer.toJSON());
-}
-
-function pressLabel(renderer: ReturnType<typeof create>, label: string) {
- const node = renderer.root.findByProps({ accessibilityLabel: label });
- act(() => {
- node.props.onPress();
- });
-}
-
-function openSheet(renderer: ReturnType<typeof create>) {
- const trigger = renderer.root.find((node) =>
- Boolean(
- (node.props.accessibilityLabel as string | undefined)?.startsWith(
- "Files (",
- ),
- ),
- );
- act(() => {
- trigger.props.onPress();
- });
-}
-
-function hasLabel(renderer: ReturnType<typeof create>, label: string): boolean {
- return (
- renderer.root.findAll((node) => node.props.accessibilityLabel === label)
- .length > 0
- );
-}
-
-describe("TaskArtifacts", () => {
- beforeEach(() => {
- dismissTaskRunArtifacts.mockClear();
- mockUseUserQuery.mockReturnValue({ data: { id: 7 } });
- });
-
- it("renders nothing when there are no artifacts", () => {
- expect(json(mount([]))).toBe("null");
- expect(json(mount(undefined))).toBe("null");
- });
-
- it("shows a count on the trigger and lists files once opened", () => {
- const renderer = mount([
- { id: "a1", name: "report.md", type: "output", size: 2_400 },
- { id: "a2", name: "chart.png", type: "output", size: 512 },
- ]);
- expect(hasLabel(renderer, "Files (2)")).toBe(true);
- expect(json(renderer)).not.toContain("report.md");
-
- openSheet(renderer);
- const shown = json(renderer);
- expect(shown).toContain("report.md");
- expect(shown).toContain("chart.png");
- });
-
- it("shows the version picker only when a file has more than one version", () => {
- const renderer = mount([
- {
- id: "a1",
- name: "report.md",
- type: "output",
- uploaded_at: "2024-01-01T00:00:00Z",
- },
- {
- id: "a2",
- name: "report.md",
- type: "output",
- uploaded_at: "2024-02-01T00:00:00Z",
- },
- { id: "b1", name: "chart.png", type: "output" },
- ]);
- openSheet(renderer);
-
- expect(hasLabel(renderer, "Choose a version of report.md")).toBe(true);
- expect(hasLabel(renderer, "Choose a version of chart.png")).toBe(false);
- });
-
- it("labels the uploader as the current user, a teammate, or the agent", () => {
- const renderer = mount([
- {
- id: "a1",
- name: "mine.md",
- type: "output",
- uploaded_by: "user",
- uploaded_by_user_id: 7,
- },
- {
- id: "a2",
- name: "theirs.md",
- type: "output",
- uploaded_by: "user",
- uploaded_by_user_id: 99,
- },
- { id: "a3", name: "agent.md", type: "output", uploaded_by: "agent" },
- ]);
- openSheet(renderer);
-
- const shown = json(renderer);
- expect(shown).toContain("You");
- expect(shown).toContain("Teammate");
- expect(shown).toContain("Agent");
- });
-
- it("dismisses a file through the api", () => {
- const renderer = mount([
- { id: "a1", name: "report.md", type: "output", size: 2_400 },
- ]);
- openSheet(renderer);
-
- pressLabel(renderer, "Dismiss report.md");
-
- expect(dismissTaskRunArtifacts).toHaveBeenCalledWith(
- "t1",
- "r1",
- ["a1"],
- true,
- );
- });
-
- it("restores a dismissed file through the api", () => {
- const renderer = mount([
- {
- id: "a1",
- name: "report.md",
- type: "output",
- dismissed_at: "2024-03-01T00:00:00Z",
- },
- ]);
- expect(hasLabel(renderer, "Files (0)")).toBe(true);
-
- openSheet(renderer);
- pressLabel(renderer, "Show 1 dismissed");
- pressLabel(renderer, "Restore report.md");
-
- expect(dismissTaskRunArtifacts).toHaveBeenCalledWith(
- "t1",
- "r1",
- ["a1"],
- false,
- );
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/tasks/components/TaskArtifacts.tsx b/products/desktop/apps/mobile/src/features/tasks/components/TaskArtifacts.tsx
deleted file mode 100644
index 2e4a9a6496d8..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/components/TaskArtifacts.tsx
+++ /dev/null
@@ -1,379 +0,0 @@
-import { Text } from "@components/text";
-import {
- groupRunArtifactVersions,
- type RunArtifactVersions,
- runArtifactUploaderLabel,
- runArtifactVersionKey,
- runArtifactVersionMetaLabel,
- runArtifactVersionShortLabel,
-} from "@posthog/core/canvas/runArtifactSchemas";
-import { formatRelativeTimeLong, type TaskRunArtifact } from "@posthog/shared";
-import { useMutation } from "@tanstack/react-query";
-import {
- CaretDown,
- Check,
- DownloadSimple,
- File as FileIcon,
- Package,
- X,
-} from "phosphor-react-native";
-import { useMemo, useState } from "react";
-import {
- ActivityIndicator,
- Alert,
- Pressable,
- ScrollView,
- View,
-} from "react-native";
-import { SheetContainer } from "@/components/SheetContainer";
-import { useUserQuery } from "@/features/auth";
-import { openExternalUrl } from "@/lib/openExternalUrl";
-import { useThemeColors } from "@/lib/theme";
-import { dismissTaskRunArtifacts, presignTaskRunArtifact } from "../api";
-import { useTaskArtifacts } from "../hooks/useTaskArtifacts";
-import { formatArtifactSize } from "../utils/artifactPreview";
-import { ArtifactPreview } from "./ArtifactPreview";
-
-type ArtifactGroup = RunArtifactVersions<TaskRunArtifact>;
-
-interface TaskArtifactsProps {
- taskId: string | undefined;
- runId: string | undefined;
- // Gate the manifest fetch on a terminal run, mirroring desktop.
- enabled: boolean;
-}
-
-export function TaskArtifacts({ taskId, runId, enabled }: TaskArtifactsProps) {
- const themeColors = useThemeColors();
- const { data: artifacts, refetch } = useTaskArtifacts(taskId, runId, enabled);
- const { data: currentUser } = useUserQuery();
- const [open, setOpen] = useState(false);
- const [preview, setPreview] = useState<TaskRunArtifact | null>(null);
- const [sharingId, setSharingId] = useState<string | null>(null);
- const [showDismissed, setShowDismissed] = useState(false);
- const [versionPickerFor, setVersionPickerFor] = useState<string | null>(null);
- const [selectedVersionByName, setSelectedVersionByName] = useState<
- Record<string, string>
- >({});
- const [dismissalOverrides, setDismissalOverrides] = useState<
- Record<string, string | null>
- >({});
-
- const groups = useMemo(
- () =>
- groupRunArtifactVersions(
- (artifacts ?? []).map((artifact) =>
- artifact.id && artifact.id in dismissalOverrides
- ? { ...artifact, dismissed_at: dismissalOverrides[artifact.id] }
- : artifact,
- ),
- ),
- [artifacts, dismissalOverrides],
- );
- const visibleGroups = groups.filter((group) => !group.dismissed);
- const dismissedGroups = groups.filter((group) => group.dismissed);
-
- const dismissal = useMutation({
- mutationFn: ({
- group,
- dismissed,
- }: {
- group: ArtifactGroup;
- dismissed: boolean;
- }) => {
- const ids = group.versions.flatMap((v) => (v.id ? [v.id] : []));
- if (ids.length !== group.versions.length) {
- throw new Error("Artifact versions are still uploading");
- }
- return dismissTaskRunArtifacts(taskId ?? "", runId ?? "", ids, dismissed);
- },
- // Overlay just the dismissal stamps from the response, then refetch and drop
- // the overlay so the manifest stays the source of truth.
- onSuccess: async (manifest) => {
- setDismissalOverrides((current) => ({
- ...current,
- ...Object.fromEntries(
- manifest.flatMap((entry) =>
- entry.id ? [[entry.id, entry.dismissed_at ?? null]] : [],
- ),
- ),
- }));
- const refreshed = await refetch();
- if (refreshed?.data) setDismissalOverrides({});
- },
- onError: () =>
- Alert.alert("Couldn't update this file", "Please try again."),
- });
-
- const shareArtifact = async (artifact: TaskRunArtifact): Promise<void> => {
- if (!taskId || !runId || !artifact.storage_path) return;
- setSharingId(artifact.id ?? artifact.storage_path);
- try {
- const url = await presignTaskRunArtifact(
- taskId,
- runId,
- artifact.storage_path,
- );
- openExternalUrl(url);
- } catch {
- Alert.alert("Couldn't open file", "Please try again.");
- } finally {
- setSharingId(null);
- }
- };
-
- if (!taskId || !runId || groups.length === 0) return null;
-
- const renderRow = (group: ArtifactGroup) => {
- const pickedIndex = group.versions.findIndex(
- (version) =>
- runArtifactVersionKey(version) === selectedVersionByName[group.name],
- );
- const newestVisibleIndex = group.versions.findIndex(
- (version) => !version.dismissed_at,
- );
- const selectedIndex =
- pickedIndex >= 0 ? pickedIndex : Math.max(newestVisibleIndex, 0);
- const selected = group.versions[selectedIndex];
- const size = formatArtifactSize(selected.size);
- const canPreview = Boolean(selected.id);
- const canChangeDismissal = group.versions.every((version) => version.id);
- const hasVersions = group.versions.length > 1;
- const pickerOpen = versionPickerFor === group.name;
-
- const meta = [
- runArtifactUploaderLabel(selected, currentUser),
- selected.uploaded_at
- ? formatRelativeTimeLong(selected.uploaded_at)
- : null,
- size,
- ]
- .filter(Boolean)
- .join(" · ");
-
- return (
- <View
- key={group.name}
- className="rounded-lg border border-gray-5 bg-gray-2"
- >
- <View className="flex-row items-center gap-2.5 py-2 pr-1.5 pl-2">
- <Pressable
- className="min-w-0 flex-1 flex-row items-center gap-2.5 active:opacity-70"
- disabled={!canPreview}
- accessibilityRole="button"
- accessibilityLabel={`View ${group.name}`}
- onPress={() => {
- setOpen(false);
- setPreview(selected);
- }}
- >
- <View className="h-8 w-8 shrink-0 items-center justify-center rounded-md bg-gray-4">
- <FileIcon size={16} color={themeColors.gray[11]} />
- </View>
- <View className="min-w-0 flex-1">
- <Text
- className="font-medium text-[13px] text-gray-12"
- numberOfLines={1}
- >
- {group.name}
- </Text>
- <View className="flex-row items-center gap-1">
- {meta ? (
- <Text className="text-[12px] text-gray-10" numberOfLines={1}>
- {meta}
- </Text>
- ) : null}
- {hasVersions ? (
- <>
- {meta ? (
- <Text className="text-[12px] text-gray-10">·</Text>
- ) : null}
- <Pressable
- hitSlop={6}
- accessibilityRole="button"
- accessibilityLabel={`Choose a version of ${group.name}`}
- onPress={() =>
- setVersionPickerFor(pickerOpen ? null : group.name)
- }
- className="flex-row items-center gap-0.5 active:opacity-60"
- >
- <Text className="text-[12px] text-gray-12">
- {runArtifactVersionShortLabel(
- selectedIndex,
- group.versions.length,
- )}
- </Text>
- <CaretDown size={10} color={themeColors.gray[11]} />
- </Pressable>
- </>
- ) : null}
- </View>
- </View>
- </Pressable>
-
- <View className="shrink-0 flex-row items-center gap-1">
- {group.dismissed ? (
- <Pressable
- hitSlop={6}
- disabled={dismissal.isPending || !canChangeDismissal}
- onPress={() => dismissal.mutate({ group, dismissed: false })}
- accessibilityRole="button"
- accessibilityLabel={`Restore ${group.name}`}
- className="rounded-md px-2 py-1.5 active:opacity-60"
- >
- <Text className="font-medium text-[13px] text-gray-12">
- Restore
- </Text>
- </Pressable>
- ) : (
- <>
- <Pressable
- hitSlop={6}
- disabled={!canPreview || sharingId !== null}
- onPress={() => void shareArtifact(selected)}
- accessibilityRole="button"
- accessibilityLabel={`Download ${group.name}`}
- className="h-8 w-8 items-center justify-center active:opacity-60"
- >
- {sharingId === (selected.id ?? selected.storage_path) ? (
- <ActivityIndicator
- size="small"
- color={themeColors.gray[11]}
- />
- ) : (
- <DownloadSimple size={16} color={themeColors.gray[11]} />
- )}
- </Pressable>
- <Pressable
- hitSlop={6}
- disabled={dismissal.isPending || !canChangeDismissal}
- onPress={() => dismissal.mutate({ group, dismissed: true })}
- accessibilityRole="button"
- accessibilityLabel={`Dismiss ${group.name}`}
- className="h-8 w-8 items-center justify-center active:opacity-60"
- >
- <X size={16} color={themeColors.gray[11]} />
- </Pressable>
- </>
- )}
- </View>
- </View>
-
- {pickerOpen && hasVersions ? (
- <View className="border-gray-5 border-t px-2 py-1">
- {group.versions.map((version, index) => {
- const key = runArtifactVersionKey(version);
- return (
- <Pressable
- key={key}
- onPress={() => {
- setSelectedVersionByName((current) => ({
- ...current,
- [group.name]: key,
- }));
- setVersionPickerFor(null);
- }}
- className="flex-row items-center gap-2 rounded-md px-2 py-2 active:bg-gray-3"
- >
- <Text
- className="min-w-0 flex-1 text-[13px] text-gray-12"
- numberOfLines={1}
- >
- {runArtifactVersionMetaLabel(
- version,
- index,
- group.versions.length,
- currentUser,
- )}
- </Text>
- {index === selectedIndex ? (
- <Check size={14} color={themeColors.accent[9]} />
- ) : null}
- </Pressable>
- );
- })}
- </View>
- ) : null}
- </View>
- );
- };
-
- const dismissedToggleLabel = showDismissed
- ? "Hide dismissed"
- : `Show ${dismissedGroups.length} dismissed`;
-
- return (
- <>
- <Pressable
- onPress={() => setOpen(true)}
- hitSlop={8}
- accessibilityRole="button"
- accessibilityLabel={`Files (${visibleGroups.length})`}
- className="h-9 w-9 items-center justify-center active:opacity-60"
- >
- <Package
- size={18}
- color={
- visibleGroups.length > 0
- ? themeColors.accent[11]
- : themeColors.gray[10]
- }
- weight={visibleGroups.length > 0 ? "fill" : "regular"}
- />
- {visibleGroups.length > 0 ? (
- <View className="absolute top-1 right-1 h-4 min-w-4 items-center justify-center rounded-full bg-accent-9 px-0.5">
- <Text className="font-semibold text-[9px] text-accent-contrast">
- {visibleGroups.length}
- </Text>
- </View>
- ) : null}
- </Pressable>
-
- <SheetContainer open={open} onClose={() => setOpen(false)}>
- {open ? (
- <>
- <View className="flex-row items-center justify-between px-4 pt-2 pb-2">
- <Text className="font-semibold text-[16px] text-gray-12">
- Files
- </Text>
- <Text className="text-[12px] text-gray-10">
- {visibleGroups.length === 1
- ? "1 file"
- : `${visibleGroups.length} files`}
- </Text>
- </View>
-
- <ScrollView
- className="max-h-96 px-4"
- contentContainerStyle={{ paddingBottom: 8, gap: 6 }}
- >
- {visibleGroups.map(renderRow)}
- {showDismissed ? dismissedGroups.map(renderRow) : null}
- {dismissedGroups.length > 0 ? (
- <Pressable
- onPress={() => setShowDismissed((current) => !current)}
- accessibilityRole="button"
- accessibilityLabel={dismissedToggleLabel}
- className="self-start py-1 active:opacity-60"
- >
- <Text className="font-medium text-[13px] text-accent-11">
- {dismissedToggleLabel}
- </Text>
- </Pressable>
- ) : null}
- </ScrollView>
- </>
- ) : null}
- </SheetContainer>
-
- {preview?.id ? (
- <ArtifactPreview
- taskId={taskId}
- runId={runId}
- artifact={preview}
- onClose={() => setPreview(null)}
- />
- ) : null}
- </>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/components/TaskFilterMenu.tsx b/products/desktop/apps/mobile/src/features/tasks/components/TaskFilterMenu.tsx
deleted file mode 100644
index 1b53a2a98efe..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/components/TaskFilterMenu.tsx
+++ /dev/null
@@ -1,174 +0,0 @@
-import { Text } from "@components/text";
-import { Check, FunnelSimple } from "phosphor-react-native";
-import { useState } from "react";
-import { Modal, Pressable, ScrollView, View } from "react-native";
-import { useUserQuery } from "@/features/auth";
-import { useScreenInsets } from "@/hooks/useScreenInsets";
-import { useThemeColors } from "@/lib/theme";
-import {
- type OrganizeMode,
- type SortMode,
- useTaskStore,
-} from "../stores/taskStore";
-
-interface TaskFilterMenuProps {
- open: boolean;
- onClose: () => void;
-}
-
-function SectionHeader({ title }: { title: string }) {
- return (
- <Text className="mb-1 font-semibold text-[12px] text-gray-10 uppercase tracking-wide">
- {title}
- </Text>
- );
-}
-
-interface OptionRowProps {
- label: string;
- selected: boolean;
- onPress: () => void;
-}
-
-function OptionRow({ label, selected, onPress }: OptionRowProps) {
- const themeColors = useThemeColors();
- return (
- <Pressable
- onPress={onPress}
- className="flex-row items-center justify-between rounded-md px-2 py-2.5 active:bg-gray-3"
- >
- <Text className="text-[14px] text-gray-12">{label}</Text>
- {selected && <Check size={16} color={themeColors.gray[12]} />}
- </Pressable>
- );
-}
-
-export function TaskFilterMenu({ open, onClose }: TaskFilterMenuProps) {
- const { bottom, sheetContentTop } = useScreenInsets();
- const organizeMode = useTaskStore((s) => s.organizeMode);
- const setOrganizeMode = useTaskStore((s) => s.setOrganizeMode);
- const sortMode = useTaskStore((s) => s.sortMode);
- const setSortMode = useTaskStore((s) => s.setSortMode);
- const showInternal = useTaskStore((s) => s.showInternal);
- const setShowInternal = useTaskStore((s) => s.setShowInternal);
- const { data: userData } = useUserQuery();
- const isStaff = userData?.is_staff === true;
-
- const pickOrganize = (mode: OrganizeMode) => {
- setOrganizeMode(mode);
- };
- const pickSort = (mode: SortMode) => {
- setSortMode(mode);
- };
-
- return (
- <Modal
- visible={open}
- animationType="slide"
- presentationStyle="pageSheet"
- onRequestClose={onClose}
- >
- <View
- className="flex-1 bg-background"
- style={{ paddingTop: sheetContentTop() }}
- >
- {/* Header */}
- <View className="flex-row items-center justify-between border-gray-6 border-b px-4 pb-3">
- <Text className="font-semibold text-[18px] text-gray-12">
- Filter & Sort
- </Text>
- <Pressable onPress={onClose}>
- <Text className="font-semibold text-[14px] text-accent-9">
- Done
- </Text>
- </Pressable>
- </View>
-
- <ScrollView
- contentContainerStyle={{
- paddingHorizontal: 16,
- paddingTop: 16,
- paddingBottom: bottom("roomy"),
- }}
- >
- {/* Organize */}
- <SectionHeader title="Organize" />
- <View className="mb-5">
- <OptionRow
- label="By project"
- selected={organizeMode === "by-project"}
- onPress={() => pickOrganize("by-project")}
- />
- <OptionRow
- label="Chronological list"
- selected={organizeMode === "chronological"}
- onPress={() => pickOrganize("chronological")}
- />
- </View>
-
- {/* Sort by */}
- <SectionHeader title="Sort by" />
- <View className="mb-5">
- <OptionRow
- label="Created"
- selected={sortMode === "created"}
- onPress={() => pickSort("created")}
- />
- <OptionRow
- label="Updated"
- selected={sortMode === "updated"}
- onPress={() => pickSort("updated")}
- />
- </View>
-
- {/* Task visibility (staff only) */}
- {isStaff ? (
- <>
- <SectionHeader title="Task visibility" />
- <View className="mb-5">
- <OptionRow
- label="External"
- selected={!showInternal}
- onPress={() => setShowInternal(false)}
- />
- <OptionRow
- label="Internal"
- selected={showInternal}
- onPress={() => setShowInternal(true)}
- />
- </View>
- </>
- ) : null}
- </ScrollView>
- </View>
- </Modal>
- );
-}
-
-interface TaskFilterButtonProps {
- onPress: () => void;
-}
-
-export function TaskFilterButton({ onPress }: TaskFilterButtonProps) {
- const themeColors = useThemeColors();
- return (
- <Pressable
- onPress={onPress}
- hitSlop={8}
- className="h-9 w-9 items-center justify-center rounded-md border border-gray-6 bg-gray-2 active:bg-gray-3"
- accessibilityLabel="Filter tasks"
- accessibilityRole="button"
- >
- <FunnelSimple size={16} color={themeColors.gray[11]} />
- </Pressable>
- );
-}
-
-export function useTaskFilterMenu() {
- const [open, setOpen] = useState(false);
- return {
- open,
- show: () => setOpen(true),
- hide: () => setOpen(false),
- };
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/components/TaskItem.test.tsx b/products/desktop/apps/mobile/src/features/tasks/components/TaskItem.test.tsx
deleted file mode 100644
index 6cc96a4e824d..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/components/TaskItem.test.tsx
+++ /dev/null
@@ -1,136 +0,0 @@
-import type { Task } from "@posthog/shared";
-import { createElement } from "react";
-import { act, create } from "react-test-renderer";
-import { describe, expect, it, vi } from "vitest";
-import { TaskItem } from "./TaskItem";
-
-vi.mock("phosphor-react-native", () => ({
- Check: (props: Record<string, unknown>) => createElement("Check", props),
- GitPullRequest: (props: Record<string, unknown>) =>
- createElement("GitPullRequest", props),
-}));
-
-vi.mock("@/lib/theme", () => ({
- useThemeColors: () => ({
- gray: { 11: "#444444" },
- accent: { 9: "#ff5500" },
- }),
-}));
-
-vi.mock("@components/text", () => ({
- Text: (props: Record<string, unknown>) => createElement("Text", props),
-}));
-
-vi.mock("./TaskStatusIcon", () => ({
- TaskStatusIcon: (props: Record<string, unknown>) =>
- createElement("TaskStatusIcon", props),
-}));
-
-function makeTask(run?: Partial<NonNullable<Task["latest_run"]>>): Task {
- return {
- id: "task-1",
- task_number: 1,
- slug: "task-1",
- title: "Test task",
- description: "",
- created_at: "2026-01-01T00:00:00Z",
- updated_at: "2026-01-01T00:00:00Z",
- origin_product: "code",
- latest_run: run
- ? {
- id: "run-1",
- task: "task-1",
- team: 1,
- branch: null,
- stage: null,
- environment: "cloud",
- status: "completed",
- log_url: "",
- error_message: null,
- output: null,
- state: {},
- created_at: "2026-01-01T00:00:00Z",
- updated_at: "2026-01-01T00:00:00Z",
- completed_at: null,
- ...run,
- }
- : undefined,
- };
-}
-
-function render(task: Task) {
- let renderer!: ReturnType<typeof create>;
- act(() => {
- renderer = create(createElement(TaskItem, { task, onPress: () => {} }));
- });
- return renderer;
-}
-
-describe("TaskItem", () => {
- function prIcons(renderer: ReturnType<typeof create>) {
- return renderer.root.findAll(
- (node) => String(node.type) === "GitPullRequest",
- );
- }
-
- function badgeNumber(renderer: ReturnType<typeof create>, label: string) {
- return renderer.root.findAll(
- (node) => String(node.type) === "Text" && node.props.children === label,
- );
- }
-
- it.each([
- [
- "pr_url is set",
- { pr_url: "https://github.com/PostHog/code/pull/2422" },
- "#2422",
- ],
- [
- "pr_urls is set",
- { pr_urls: ["https://github.com/PostHog/code/pull/2422"] },
- "#2422",
- ],
- [
- "both fields point at the same PR",
- {
- pr_url: "https://github.com/PostHog/code/pull/2422",
- pr_urls: ["https://github.com/PostHog/code/pull/2422"],
- },
- "#2422",
- ],
- [
- "pr_urls lists several PRs (shows the first)",
- {
- pr_urls: [
- "https://github.com/PostHog/code/pull/2422",
- "https://github.com/PostHog/code/pull/2423",
- ],
- },
- "#2422",
- ],
- ])("shows the PR badge when %s", (_label, output, expected) => {
- const renderer = render(makeTask({ output }));
-
- expect(prIcons(renderer)).toHaveLength(1);
- expect(badgeNumber(renderer, expected)).toHaveLength(1);
- });
-
- it.each([
- ["the task has no run", makeTask()],
- ["the run has no output", makeTask({ output: null })],
- ["pr_urls is empty", makeTask({ output: { pr_urls: [] } })],
- ["pr_url is an empty string", makeTask({ output: { pr_url: "" } })],
- [
- "the url is a GitHub issue, not a PR",
- makeTask({
- output: { pr_url: "https://github.com/PostHog/code/issues/42" },
- }),
- ],
- [
- "the url is not a GitHub url",
- makeTask({ output: { pr_url: "https://example.com/not-a-pr" } }),
- ],
- ])("does not show the PR badge when %s", (_label, task) => {
- expect(prIcons(render(task))).toHaveLength(0);
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/tasks/components/TaskItem.tsx b/products/desktop/apps/mobile/src/features/tasks/components/TaskItem.tsx
deleted file mode 100644
index 395e0557433a..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/components/TaskItem.tsx
+++ /dev/null
@@ -1,106 +0,0 @@
-import { Text } from "@components/text";
-import { readPrUrls, type Task } from "@posthog/shared";
-import { differenceInHours, format, formatDistanceToNow } from "date-fns";
-import { Check, GitPullRequest } from "phosphor-react-native";
-import { memo } from "react";
-import { Linking, Pressable, View } from "react-native";
-import { parseGithubIssueUrl } from "@/lib/githubIssueUrl";
-import { useThemeColors } from "@/lib/theme";
-import { TaskStatusIcon } from "./TaskStatusIcon";
-
-function PrBadge({ prUrl, number }: { prUrl: string; number: number }) {
- const themeColors = useThemeColors();
- return (
- <Pressable
- onPress={() => Linking.openURL(prUrl).catch(() => {})}
- hitSlop={8}
- className="shrink-0 flex-row items-center gap-0.5 rounded border border-gray-6 bg-gray-3 px-1.5 py-0.5 active:opacity-60"
- accessibilityRole="link"
- accessibilityLabel={`Open pull request #${number}`}
- >
- <GitPullRequest size={11} weight="bold" color={themeColors.gray[11]} />
- <Text className="text-[11px] text-gray-11">{`#${number}`}</Text>
- </Pressable>
- );
-}
-
-interface TaskItemProps {
- task: Task;
- onPress: (task: Task) => void;
- onLongPress?: (task: Task) => void;
- selectionMode?: boolean;
- selected?: boolean;
-}
-
-function TaskItemComponent({
- task,
- onPress,
- onLongPress,
- selectionMode = false,
- selected = false,
-}: TaskItemProps) {
- const themeColors = useThemeColors();
- const createdAt = new Date(task.created_at);
- const hoursSinceCreated = differenceInHours(new Date(), createdAt);
- const timeDisplay =
- hoursSinceCreated < 24
- ? formatDistanceToNow(createdAt, { addSuffix: true })
- : format(createdAt, "MMM d");
- const prUrl = readPrUrls(task.latest_run?.output)[0];
- const prRef = prUrl ? parseGithubIssueUrl(prUrl) : null;
-
- return (
- <Pressable
- onPress={() => onPress(task)}
- onLongPress={onLongPress ? () => onLongPress(task) : undefined}
- delayLongPress={300}
- className={`flex-row items-start gap-3 border-gray-6 border-b px-3 py-3 ${selected ? "bg-accent-3" : "active:bg-gray-3"}`}
- >
- {/* Status icon column (or selection checkbox in selection mode) */}
- <View className="mt-0.5 h-5 w-5 shrink-0 items-center justify-center">
- {selectionMode ? (
- <View
- className={`h-5 w-5 items-center justify-center rounded-full border ${selected ? "border-transparent" : "border-gray-7"}`}
- style={selected ? { backgroundColor: themeColors.accent[9] } : null}
- >
- {selected ? <Check size={12} color="#fff" weight="bold" /> : null}
- </View>
- ) : (
- <TaskStatusIcon task={task} size={16} />
- )}
- </View>
-
- {/* Content column */}
- <View className="min-w-0 flex-1">
- <View className="flex-row items-center gap-2">
- <Text
- className="flex-1 font-medium text-[14px] text-gray-12"
- numberOfLines={1}
- ellipsizeMode="tail"
- >
- {task.title}
- </Text>
- {prRef?.kind === "pr" ? (
- <PrBadge prUrl={prRef.normalizedUrl} number={prRef.number} />
- ) : (
- <Text className="shrink-0 text-[11px] text-gray-9">
- {timeDisplay}
- </Text>
- )}
- </View>
-
- {task.description ? (
- <Text
- className="mt-0.5 text-[12px] text-gray-10"
- numberOfLines={2}
- ellipsizeMode="tail"
- >
- {task.description}
- </Text>
- ) : null}
- </View>
- </Pressable>
- );
-}
-
-export const TaskItem = memo(TaskItemComponent);
diff --git a/products/desktop/apps/mobile/src/features/tasks/components/TaskList.tsx b/products/desktop/apps/mobile/src/features/tasks/components/TaskList.tsx
deleted file mode 100644
index e2a5a7e11a3a..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/components/TaskList.tsx
+++ /dev/null
@@ -1,415 +0,0 @@
-import { Text } from "@components/text";
-import { taskActivityTimestamp } from "@posthog/core/tasks/taskActivity";
-import type { Task } from "@posthog/shared";
-import * as Haptics from "expo-haptics";
-import { Archive, GitBranch, Plus, Sparkle, X } from "phosphor-react-native";
-import { useCallback, useMemo, useState } from "react";
-import {
- ActivityIndicator,
- FlatList,
- Pressable,
- RefreshControl,
- View,
-} from "react-native";
-import { useThemeColors } from "@/lib/theme";
-import { useTasks } from "../hooks/useTasks";
-import { useUserIntegrations } from "../hooks/useUserIntegrations";
-import { useArchivedTasksStore } from "../stores/archivedTasksStore";
-import { useTaskStore } from "../stores/taskStore";
-import { GitHubConnectionPrompt } from "./GitHubConnectionPrompt";
-import { GitHubLoadNotice } from "./GitHubLoadNotice";
-import { SwipeableTaskItem } from "./SwipeableTaskItem";
-
-interface TaskListProps {
- onTaskPress?: (taskId: string) => void;
- onCreateTask?: () => void;
- /** Top inset so the list can scroll behind a floating header. */
- contentInsetTop?: number;
-}
-
-interface CreateTaskEmptyStateProps {
- onCreateTask?: () => void;
-}
-
-function CreateTaskEmptyState({ onCreateTask }: CreateTaskEmptyStateProps) {
- const themeColors = useThemeColors();
-
- return (
- <View className="flex-1 items-center justify-center px-8">
- <View
- className="mb-6 h-20 w-20 items-center justify-center rounded-full"
- style={{ backgroundColor: `${themeColors.accent[9]}1A` }}
- >
- <Sparkle size={36} color={themeColors.accent[9]} weight="fill" />
- </View>
- <Text className="mb-2 text-center font-semibold text-[22px] text-gray-12 leading-tight">
- Start your first task
- </Text>
- <Text className="mb-8 max-w-[280px] text-center text-[15px] text-gray-11 leading-snug">
- Describe what you want built, fixed, or investigated.
- </Text>
- {onCreateTask && (
- <Pressable
- onPress={onCreateTask}
- className="flex-row items-center gap-2 rounded-full px-6 py-3.5 active:opacity-80"
- style={{ backgroundColor: themeColors.accent[9] }}
- >
- <Plus size={18} color={themeColors.accent.contrast} weight="bold" />
- <Text className="font-semibold text-[15px] text-accent-contrast">
- New task
- </Text>
- </Pressable>
- )}
- </View>
- );
-}
-
-type ListItem =
- | { type: "task"; task: Task }
- | { type: "repo-header"; repoLabel: string; count: number }
- | { type: "date-header"; label: string; count: number };
-
-const NO_REPO_LABEL = "No repository";
-
-function relativeDateGroup(ms: number): string {
- const startOfToday = new Date();
- startOfToday.setHours(0, 0, 0, 0);
- const startOfDate = new Date(ms);
- startOfDate.setHours(0, 0, 0, 0);
- const days = Math.round(
- (startOfToday.getTime() - startOfDate.getTime()) / 86_400_000,
- );
- if (days <= 0) return "Today";
- if (days === 1) return "Yesterday";
- if (days < 7) return "This week";
- if (days < 30) return "This month";
- return "Earlier";
-}
-
-const DATE_GROUP_ORDER = [
- "Today",
- "Yesterday",
- "This week",
- "This month",
- "Earlier",
-];
-
-export function TaskList({
- onTaskPress,
- onCreateTask,
- contentInsetTop = 0,
-}: TaskListProps) {
- const { tasks, isLoading, error, refetch } = useTasks({
- originProduct: "user_created",
- });
- const {
- error: integrationsError,
- hasGithubIntegration,
- refetch: refetchIntegrations,
- } = useUserIntegrations();
- const themeColors = useThemeColors();
- const { archivedTasks, archive, archiveMany, unarchive } =
- useArchivedTasksStore();
- const organizeMode = useTaskStore((s) => s.organizeMode);
- const sortMode = useTaskStore((s) => s.sortMode);
- const [scrollEnabled, setScrollEnabled] = useState(true);
-
- const [selectedIds, setSelectedIds] = useState<Set<string>>(new Set());
- const selectionMode = selectedIds.size > 0;
-
- const exitSelection = useCallback(() => {
- setSelectedIds(new Set());
- }, []);
-
- const toggleSelected = useCallback((taskId: string) => {
- setSelectedIds((prev) => {
- const next = new Set(prev);
- if (next.has(taskId)) {
- next.delete(taskId);
- } else {
- next.add(taskId);
- }
- return next;
- });
- }, []);
-
- const handleTaskPress = (task: Task) => {
- if (selectionMode) {
- toggleSelected(task.id);
- return;
- }
- onTaskPress?.(task.id);
- };
-
- const handleTaskLongPress = useCallback((task: Task) => {
- Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium);
- setSelectedIds((prev) => {
- if (prev.has(task.id)) return prev;
- const next = new Set(prev);
- next.add(task.id);
- return next;
- });
- }, []);
-
- const handleBulkArchive = useCallback(() => {
- if (selectedIds.size === 0) return;
- Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success);
- archiveMany(Array.from(selectedIds));
- exitSelection();
- }, [selectedIds, archiveMany, exitSelection]);
-
- const handleRefresh = async () => {
- await Promise.all([refetch(), refetchIntegrations()]);
- };
-
- const listItems = useMemo((): ListItem[] => {
- const active = tasks.filter((task) => !(task.id in archivedTasks));
- const items: ListItem[] = [];
-
- if (organizeMode === "by-project") {
- const groups = new Map<string, Task[]>();
- for (const task of active) {
- const key = task.repository?.trim() || NO_REPO_LABEL;
- const bucket = groups.get(key);
- if (bucket) {
- bucket.push(task);
- } else {
- groups.set(key, [task]);
- }
- }
-
- for (const tasksInRepo of groups.values()) {
- tasksInRepo.sort(
- (a, b) =>
- taskActivityTimestamp(b, sortMode) -
- taskActivityTimestamp(a, sortMode),
- );
- }
-
- const groupEntries = Array.from(groups.entries()).sort((a, b) => {
- if (a[0] === NO_REPO_LABEL) return 1;
- if (b[0] === NO_REPO_LABEL) return -1;
- return (
- taskActivityTimestamp(b[1][0], sortMode) -
- taskActivityTimestamp(a[1][0], sortMode)
- );
- });
-
- for (const [repoLabel, tasksInRepo] of groupEntries) {
- items.push({
- type: "repo-header",
- repoLabel,
- count: tasksInRepo.length,
- });
- for (const task of tasksInRepo) {
- items.push({ type: "task", task });
- }
- }
- } else {
- const sorted = [...active].sort(
- (a, b) =>
- taskActivityTimestamp(b, sortMode) -
- taskActivityTimestamp(a, sortMode),
- );
-
- const buckets = new Map<string, Task[]>();
- for (const task of sorted) {
- const label = relativeDateGroup(taskActivityTimestamp(task, sortMode));
- const bucket = buckets.get(label);
- if (bucket) {
- bucket.push(task);
- } else {
- buckets.set(label, [task]);
- }
- }
-
- for (const label of DATE_GROUP_ORDER) {
- const bucket = buckets.get(label);
- if (!bucket || bucket.length === 0) continue;
- items.push({ type: "date-header", label, count: bucket.length });
- for (const task of bucket) {
- items.push({ type: "task", task });
- }
- }
- }
-
- return items;
- }, [tasks, archivedTasks, organizeMode, sortMode]);
-
- if (error) {
- return (
- <View className="flex-1 items-center justify-center p-6">
- <Text className="mb-4 text-center text-status-error">{error}</Text>
- <Pressable
- onPress={handleRefresh}
- className="rounded-lg bg-gray-3 px-4 py-2"
- >
- <Text className="text-gray-12">Retry</Text>
- </Pressable>
- </View>
- );
- }
-
- if (integrationsError && tasks.length === 0) {
- return (
- <View className="flex-1 items-center justify-center p-6">
- <Text className="mb-4 text-center text-status-error">
- {integrationsError}
- </Text>
- <Pressable
- onPress={handleRefresh}
- className="rounded-lg bg-gray-3 px-4 py-2"
- >
- <Text className="text-gray-12">Retry</Text>
- </Pressable>
- </View>
- );
- }
-
- const isInitialLoading =
- (isLoading && tasks.length === 0) ||
- (tasks.length === 0 && hasGithubIntegration === null);
-
- if (isInitialLoading) {
- return (
- <View className="flex-1 items-center justify-center">
- <ActivityIndicator size="large" color={themeColors.accent[9]} />
- <Text className="mt-4 text-gray-11">Loading tasks...</Text>
- </View>
- );
- }
-
- const activeTaskCount = tasks.reduce(
- (count, task) => count + (task.id in archivedTasks ? 0 : 1),
- 0,
- );
-
- if (hasGithubIntegration === false && activeTaskCount === 0) {
- return <GitHubConnectionPrompt mode="empty" onConnected={handleRefresh} />;
- }
-
- if (activeTaskCount === 0) {
- return <CreateTaskEmptyState onCreateTask={onCreateTask} />;
- }
-
- return (
- <View className="flex-1">
- <FlatList
- scrollEnabled={scrollEnabled}
- data={listItems}
- keyExtractor={(item) => {
- switch (item.type) {
- case "repo-header":
- return `__repo__${item.repoLabel}`;
- case "date-header":
- return `__date__${item.label}`;
- case "task":
- return item.task.id;
- }
- }}
- ListHeaderComponent={
- integrationsError ? (
- <GitHubLoadNotice
- message={integrationsError}
- onRetry={handleRefresh}
- />
- ) : null
- }
- renderItem={({ item }) => {
- if (item.type === "repo-header") {
- return (
- <View className="flex-row items-center gap-2 bg-gray-2 px-3 py-2">
- <GitBranch size={14} color={themeColors.gray[10]} />
- <Text
- className="flex-1 font-medium text-[12px] text-gray-11"
- numberOfLines={1}
- >
- {item.repoLabel}
- </Text>
- <Text className="text-[11px] text-gray-9">{item.count}</Text>
- </View>
- );
- }
-
- if (item.type === "date-header") {
- return (
- <View className="flex-row items-center gap-2 bg-gray-2 px-3 py-2">
- <Text
- className="flex-1 font-medium text-[12px] text-gray-11 uppercase"
- style={{ letterSpacing: 0.5 }}
- numberOfLines={1}
- >
- {item.label}
- </Text>
- <Text className="text-[11px] text-gray-9">{item.count}</Text>
- </View>
- );
- }
-
- return (
- <SwipeableTaskItem
- task={item.task}
- isArchived={false}
- onPress={handleTaskPress}
- onArchive={archive}
- onUnarchive={unarchive}
- onLongPress={handleTaskLongPress}
- selectionMode={selectionMode}
- selected={selectedIds.has(item.task.id)}
- onSwipeStart={() => setScrollEnabled(false)}
- onSwipeEnd={() => setScrollEnabled(true)}
- />
- );
- }}
- refreshControl={
- <RefreshControl
- refreshing={isLoading}
- onRefresh={handleRefresh}
- tintColor={themeColors.accent[9]}
- />
- }
- contentContainerStyle={{
- paddingTop: contentInsetTop,
- paddingBottom: 100,
- }}
- />
-
- {selectionMode ? (
- <View
- className="absolute inset-x-0 bottom-0 flex-row items-center gap-3 border-gray-6 border-t bg-card px-4 pt-3"
- style={{ paddingBottom: 28 }}
- >
- <Pressable
- onPress={exitSelection}
- hitSlop={8}
- className="h-10 w-10 items-center justify-center rounded-full bg-gray-3 active:bg-gray-4"
- accessibilityLabel="Cancel selection"
- >
- <X size={18} color={themeColors.gray[11]} weight="bold" />
- </Pressable>
- <Text
- className="flex-1 font-medium text-[15px] text-gray-12"
- numberOfLines={1}
- >
- {selectedIds.size} selected
- </Text>
- <Pressable
- onPress={handleBulkArchive}
- className="flex-row items-center gap-2 rounded-full px-4 py-2.5 active:opacity-80"
- style={{ backgroundColor: themeColors.accent[9] }}
- accessibilityLabel="Archive selected tasks"
- >
- <Archive
- size={16}
- color={themeColors.accent.contrast}
- weight="fill"
- />
- <Text className="font-semibold text-[14px] text-accent-contrast">
- Archive
- </Text>
- </Pressable>
- </View>
- ) : null}
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/components/TaskSessionView.test.tsx b/products/desktop/apps/mobile/src/features/tasks/components/TaskSessionView.test.tsx
deleted file mode 100644
index e56292083921..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/components/TaskSessionView.test.tsx
+++ /dev/null
@@ -1,261 +0,0 @@
-import { createElement } from "react";
-import { act, create } from "react-test-renderer";
-import { describe, expect, it, vi } from "vitest";
-import { TaskSessionView } from "./TaskSessionView";
-
-vi.mock("phosphor-react-native", () => ({
- ArrowDown: (props: Record<string, unknown>) =>
- createElement("ArrowDown", props),
- Brain: (props: Record<string, unknown>) => createElement("Brain", props),
- CaretRight: (props: Record<string, unknown>) =>
- createElement("CaretRight", props),
- CloudArrowDown: (props: Record<string, unknown>) =>
- createElement("CloudArrowDown", props),
- Robot: (props: Record<string, unknown>) => createElement("Robot", props),
- Warning: (props: Record<string, unknown>) => createElement("Warning", props),
-}));
-
-vi.mock("@/features/chat", () => ({
- AgentMessage: (props: Record<string, unknown>) =>
- createElement("AgentMessage", props),
- HumanMessage: (props: Record<string, unknown>) =>
- createElement("HumanMessage", props),
- ToolMessage: (props: Record<string, unknown>) =>
- createElement("ToolMessage", props),
- deriveToolKind: () => "other",
-}));
-
-vi.mock("@posthog/core/sessions/thinkingActivities", () => ({
- pickThinkingActivity: () => "Thinking",
-}));
-
-vi.mock("@/lib/theme", () => ({
- useThemeColors: () => ({
- gray: { 8: "#888", 9: "#777", 11: "#555" },
- accent: { 9: "#f60" },
- status: { error: "#d00", warning: "#d97706" },
- }),
-}));
-
-vi.mock("./PlanStatusBar", () => ({
- PlanStatusBar: (props: Record<string, unknown>) =>
- createElement("PlanStatusBar", props),
-}));
-
-vi.mock("./QuestionCard", () => ({
- QuestionCard: (props: Record<string, unknown>) =>
- createElement("QuestionCard", props),
-}));
-
-vi.mock("./PlanApprovalCard", () => ({
- PlanApprovalCard: (props: Record<string, unknown>) =>
- createElement("PlanApprovalCard", props),
-}));
-
-vi.mock("./CloudMessageAttachment", () => ({
- CloudMessageAttachment: (props: Record<string, unknown>) =>
- createElement("CloudMessageAttachment", props),
-}));
-
-vi.mock("./TaskArtifacts", () => ({
- TaskArtifacts: (props: Record<string, unknown>) =>
- createElement("TaskArtifacts", props),
-}));
-
-vi.mock("./InlineArtifactCard", () => ({
- InlineUploadedArtifactCard: (props: Record<string, unknown>) =>
- createElement("InlineUploadedArtifactCard", props),
- InlineCreatedPrCard: (props: Record<string, unknown>) =>
- createElement("InlineCreatedPrCard", props),
-}));
-
-function renderTaskSessionView(
- props: Parameters<typeof TaskSessionView>[0],
-): ReturnType<typeof create> {
- let renderer!: ReturnType<typeof create>;
- act(() => {
- renderer = create(createElement(TaskSessionView, props));
- });
- return renderer;
-}
-
-function findHumanMessages(renderer: ReturnType<typeof create>) {
- // vi.mock'd `HumanMessage` is rendered as the literal string `"HumanMessage"`
- // (an intrinsic), so node.type is a string at runtime even though the type
- // says ElementType.
- return renderer.root.findAll(
- (node) => (node.type as unknown as string) === "HumanMessage",
- );
-}
-
-describe("TaskSessionView", () => {
- function userMessageEvent(text: string, ts: number) {
- return {
- type: "session_update" as const,
- ts,
- notification: {
- update: {
- sessionUpdate: "user_message_chunk",
- content: { type: "text", text },
- },
- },
- };
- }
-
- const SUBMIT_TS = 1000;
-
- it.each([
- {
- name: "no SSE echo yet → optimistic renders",
- events: [],
- expectedCount: 1,
- },
- {
- name: "matching SSE chunk after submit → optimistic suppressed",
- events: [userMessageEvent("Ship it", SUBMIT_TS + 5)],
- expectedCount: 1,
- },
- {
- name: "text-identical historical turn → optimistic still renders",
- // Same text but ts predates submit — a prior "Ship it" message shouldn't
- // cause the new optimistic echo to be deduped.
- events: [userMessageEvent("Ship it", SUBMIT_TS - 1000)],
- expectedCount: 2,
- },
- {
- name: "non-matching SSE text → optimistic still renders",
- events: [userMessageEvent("Different text", SUBMIT_TS + 5)],
- expectedCount: 2,
- },
- ])("optimistic echo: $name", ({ events, expectedCount }) => {
- const renderer = renderTaskSessionView({
- events,
- optimisticUserMessage: { text: "Ship it", setAt: SUBMIT_TS },
- });
-
- expect(findHumanMessages(renderer)).toHaveLength(expectedCount);
- });
-
- it("optimistic echo carries the submitted text into the rendered bubble", () => {
- const renderer = renderTaskSessionView({
- events: [],
- optimisticUserMessage: { text: "Ship it", setAt: SUBMIT_TS },
- });
-
- const humans = findHumanMessages(renderer);
- expect(humans).toHaveLength(1);
- expect(humans[0].props.content).toBe("Ship it");
- });
-
- it.each([
- {
- name: "full-params kill → warning row",
- params: {
- pid: 4242,
- comm: "vitest",
- treeRssBytes: 13.46 * 1024 ** 3,
- memoryCurrentBytes: 15 * 1024 ** 3,
- memoryLimitBytes: 16 * 1024 ** 3,
- signal: "SIGTERM",
- at: "2026-01-01T00:00:00.000Z",
- },
- expectedContent:
- "The sandbox stopped vitest because it was using 13.5 GiB of the 16.0 GiB available. The agent is still running.",
- },
- {
- name: "missing sizes → nothing",
- params: { comm: "vitest" },
- expectedContent: null,
- },
- ])("process_killed acp_message: $name", ({ params, expectedContent }) => {
- const renderer = renderTaskSessionView({
- events: [
- {
- type: "acp_message" as const,
- direction: "agent" as const,
- ts: 2,
- message: {
- jsonrpc: "2.0",
- method: "_posthog/process_killed",
- params,
- },
- },
- ],
- });
-
- const warnings = renderer.root.findAll(
- (node) => (node.type as unknown as string) === "Warning",
- );
-
- if (expectedContent === null) {
- expect(warnings).toHaveLength(0);
- return;
- }
-
- expect(warnings).toHaveLength(1);
- const matches = renderer.root.findAll(
- (node) => node.props?.children === expectedContent,
- );
- expect(matches.length).toBeGreaterThan(0);
- });
-
- it("keeps question tools pending after the run goes idle", () => {
- const events = [
- {
- type: "session_update" as const,
- ts: 1,
- notification: {
- update: {
- sessionUpdate: "tool_call",
- title: "Which license should I use?",
- toolCallId: "question-1",
- status: "pending" as const,
- rawInput: {
- questions: [
- {
- question: "Which license should I use?",
- options: [{ label: "MIT" }],
- },
- ],
- },
- _meta: {
- claudeCode: {
- toolName: "AskUserQuestion",
- },
- },
- },
- },
- },
- ];
-
- let renderer: ReturnType<typeof create> | null = null;
-
- act(() => {
- renderer = create(
- createElement(TaskSessionView, {
- events,
- isConnecting: false,
- isThinking: true,
- }),
- );
- });
-
- if (!renderer) {
- throw new Error("Renderer not created");
- }
-
- act(() => {
- renderer.update(
- createElement(TaskSessionView, {
- events,
- isConnecting: false,
- isThinking: false,
- }),
- );
- });
-
- expect(renderer.root.findByType("QuestionCard").props.toolData.status).toBe(
- "pending",
- );
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/tasks/components/TaskSessionView.tsx b/products/desktop/apps/mobile/src/features/tasks/components/TaskSessionView.tsx
deleted file mode 100644
index 5e95d8ef5a87..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/components/TaskSessionView.tsx
+++ /dev/null
@@ -1,1163 +0,0 @@
-import { POSTHOG_NOTIFICATIONS } from "@posthog/core/sessions/acpNotifications";
-import { formatProcessKilledNotice } from "@posthog/core/sessions/processKilledNotice";
-import { pickThinkingActivity } from "@posthog/core/sessions/thinkingActivities";
-import {
- ArrowDown,
- Brain,
- CaretRight,
- CloudArrowDown,
- Robot,
- Warning,
-} from "phosphor-react-native";
-import { useCallback, useEffect, useMemo, useRef, useState } from "react";
-import {
- ActivityIndicator,
- FlatList,
- Pressable,
- Text,
- View,
-} from "react-native";
-import {
- AgentMessage,
- deriveToolKind,
- HumanMessage,
- ToolMessage,
- type ToolStatus,
-} from "@/features/chat";
-import { useThemeColors } from "@/lib/theme";
-import type {
- CloudPendingPermissionRequest,
- PlanEntry,
- SessionEvent,
- SessionNotification,
- SessionNotificationAttachment,
- TerminalStatus,
-} from "../types";
-import { detectInlineArtifact } from "../utils/inlineArtifacts";
-import { CloudMessageAttachment } from "./CloudMessageAttachment";
-import {
- InlineCreatedPrCard,
- InlineUploadedArtifactCard,
-} from "./InlineArtifactCard";
-import { PlanApprovalCard } from "./PlanApprovalCard";
-import { PlanStatusBar } from "./PlanStatusBar";
-import { QuestionCard } from "./QuestionCard";
-import { TerminalStatusBanner } from "./TerminalStatusBanner";
-
-interface PermissionResponseArgs {
- toolCallId: string;
- optionId: string;
- answers?: Record<string, string>;
- customInput?: string;
- displayText: string;
-}
-
-interface OptimisticUserMessage {
- text: string;
- attachments?: SessionNotificationAttachment[];
- // Submit-time epoch ms. Dedup only fires against user messages whose `ts`
- // is at or after this — protects against a text-identical historical turn
- // suppressing the new optimistic echo.
- setAt: number;
-}
-
-interface TaskSessionViewProps {
- events: SessionEvent[];
- taskId?: string;
- runId?: string;
- pendingPermissions?: Record<string, CloudPendingPermissionRequest>;
- isConnecting?: boolean;
- isThinking?: boolean;
- terminalStatus?: TerminalStatus;
- lastError?: string | null;
- onRetry?: () => void;
- onOpenTask?: (taskId: string) => void;
- onSendPermissionResponse?: (args: PermissionResponseArgs) => void;
- contentContainerStyle?: object;
- // Renders a user message at the bottom of the thread before the SSE echo
- // arrives — for the gap between submit and the live session catching up.
- // Suppressed automatically once a real user_message_chunk with matching
- // text appears in `events`.
- optimisticUserMessage?: OptimisticUserMessage;
-}
-
-interface ToolData {
- toolName: string;
- rawToolName?: string;
- toolCallId: string;
- status: ToolStatus;
- args?: Record<string, unknown>;
- result?: unknown;
- isAgent?: boolean;
- parentToolCallId?: string;
- meta?: unknown;
-}
-
-interface ParsedMessage {
- id: string;
- type:
- | "user"
- | "agent"
- | "thought"
- | "tool"
- | "connecting"
- | "thinking"
- | "process_killed";
- content: string;
- ts?: number;
- toolData?: ToolData;
- children?: ParsedMessage[];
- attachments?: SessionNotificationAttachment[];
-}
-
-function mapToolStatus(
- status?: "pending" | "in_progress" | "completed" | "failed" | null,
-): ToolStatus {
- switch (status) {
- case "pending":
- return "pending";
- case "in_progress":
- return "running";
- case "completed":
- return "completed";
- case "failed":
- return "error";
- default:
- return "pending";
- }
-}
-
-type ParsedNotification =
- | {
- type: "user";
- content: string;
- attachments?: SessionNotificationAttachment[];
- }
- | { type: "agent" | "agent_complete" | "thought"; content: string }
- | { type: "tool" | "tool_update"; toolData: ToolData }
- | { type: "plan"; entries: PlanEntry[] };
-
-function parseSessionNotification(
- notification: SessionNotification,
-): ParsedNotification | null {
- const { update } = notification;
- if (!update?.sessionUpdate) {
- return null;
- }
-
- switch (update.sessionUpdate) {
- case "user_message_chunk":
- case "agent_message_chunk": {
- const hasText = update.content?.type === "text";
- const isUser = update.sessionUpdate === "user_message_chunk";
- if (isUser) {
- const attachments = update.attachments;
- // Drop only if there's neither text nor attachments to render.
- if (!hasText && (!attachments || attachments.length === 0)) {
- return null;
- }
- return {
- type: "user",
- content: hasText ? (update.content?.text ?? "") : "",
- attachments,
- };
- }
- if (hasText) {
- return {
- type: "agent",
- content: update.content?.text ?? "",
- };
- }
- return null;
- }
- // `agent_message` is the aggregated final message emitted by the server
- // once a response is complete. If we already received streaming chunks,
- // this is a duplicate — replace pending text instead of appending.
- case "agent_message": {
- if (update.content?.type === "text") {
- return {
- type: "agent_complete" as const,
- content: update.content.text,
- };
- }
- return null;
- }
- case "agent_thought_chunk": {
- if (update.content?.type === "text") {
- return { type: "thought", content: update.content.text };
- }
- return null;
- }
- case "tool_call": {
- const meta = update._meta?.claudeCode;
- const isAgent = meta?.toolName === "Agent" || meta?.toolName === "Task";
- return {
- type: "tool",
- toolData: {
- toolName: update.title ?? "Unknown Tool",
- rawToolName: meta?.toolName,
- toolCallId: update.toolCallId ?? "",
- status: mapToolStatus(update.status),
- args: update.rawInput,
- isAgent,
- parentToolCallId: meta?.parentToolCallId,
- meta: update._meta,
- },
- };
- }
- case "tool_call_update": {
- const meta = update._meta?.claudeCode;
- return {
- type: "tool_update",
- toolData: {
- toolName: update.title ?? "Unknown Tool",
- rawToolName: meta?.toolName,
- toolCallId: update.toolCallId ?? "",
- status: mapToolStatus(update.status),
- args: update.rawInput,
- result: update.rawOutput,
- parentToolCallId: meta?.parentToolCallId,
- meta: update._meta,
- },
- };
- }
- case "plan": {
- if (Array.isArray(update.entries)) {
- return { type: "plan", entries: update.entries };
- }
- return null;
- }
- default:
- return null;
- }
-}
-
-interface ProcessedEvents {
- messages: ParsedMessage[];
- plan: PlanEntry[] | null;
-}
-
-function isQuestionTool(toolData?: ToolData): boolean {
- if (!toolData) return false;
- if (toolData.toolName.toLowerCase().includes("question")) return true;
- if (Array.isArray(toolData.args?.questions)) return true;
- return false;
-}
-
-function hasPendingQuestionMessage(message: ParsedMessage): boolean {
- const isPendingQuestion =
- message.type === "tool" &&
- isQuestionTool(message.toolData) &&
- (message.toolData?.status === "pending" ||
- message.toolData?.status === "running");
-
- if (isPendingQuestion) {
- return true;
- }
-
- return message.children?.some(hasPendingQuestionMessage) ?? false;
-}
-
-function isPlanApprovalTool(
- toolData?: ToolData,
- permission?: CloudPendingPermissionRequest,
-): boolean {
- if (permission?.toolCall.kind === "switch_mode") return true;
- if (toolData?.rawToolName === "ExitPlanMode") return true;
- return typeof toolData?.args?.plan === "string";
-}
-
-function isInteractivePermissionTool(
- toolData?: ToolData,
- permission?: CloudPendingPermissionRequest,
-): boolean {
- return isQuestionTool(toolData) || isPlanApprovalTool(toolData, permission);
-}
-
-// Mutable processor state persisted across renders via useRef.
-// Only new events (past processedIdx) are processed on each call.
-interface EventProcessorState {
- messages: ParsedMessage[];
- plan: PlanEntry[] | null;
- pendingAgentText: string;
- pendingAgentTs?: number;
- pendingThoughtText: string;
- lastAgentMsgIdx: number | null;
- agentMessageCount: number;
- thoughtMessageCount: number;
- userMessageCount: number;
- processKilledCount: number;
- toolMessages: Map<string, ParsedMessage>;
- // Maps agent toolCallId → agent ParsedMessage for nesting children
- agentTools: Map<string, ParsedMessage>;
- processedIdx: number;
- // Snapshot tracking: only create a new array ref when messages grow.
- // Mutations (tool_update, agent_complete replacing content) reuse the
- // same snapshot so FlatList doesn't re-layout and reset scroll position.
- lastSnapshot: ParsedMessage[];
- lastSnapshotLength: number;
-}
-
-function createProcessorState(): EventProcessorState {
- return {
- messages: [],
- plan: null,
- pendingAgentText: "",
- pendingThoughtText: "",
- lastAgentMsgIdx: null,
- agentMessageCount: 0,
- thoughtMessageCount: 0,
- userMessageCount: 0,
- processKilledCount: 0,
- toolMessages: new Map(),
- agentTools: new Map(),
- processedIdx: 0,
- lastSnapshot: [],
- lastSnapshotLength: 0,
- };
-}
-
-function processNewEvents(
- state: EventProcessorState,
- events: SessionEvent[],
-): ProcessedEvents {
- // If events shrank (e.g. session reset), start fresh
- if (events.length < state.processedIdx) {
- Object.assign(state, createProcessorState());
- }
-
- // Nothing new to process
- if (events.length === state.processedIdx) {
- return { messages: state.messages, plan: state.plan };
- }
-
- let hasItemMutation = false;
-
- const flushAgentText = () => {
- if (!state.pendingAgentText) return;
- // If the last message is an in-progress agent message from a previous
- // batch, append to it instead of creating a new bubble. This keeps
- // streaming chunks that arrive across multiple SSE batches unified
- // into a single rendered message.
- if (
- state.lastAgentMsgIdx !== null &&
- state.messages[state.lastAgentMsgIdx]?.type === "agent"
- ) {
- state.messages[state.lastAgentMsgIdx].content += state.pendingAgentText;
- hasItemMutation = true;
- } else {
- const msg: ParsedMessage = {
- id: `agent-${state.agentMessageCount++}`,
- type: "agent",
- content: state.pendingAgentText,
- ts: state.pendingAgentTs,
- };
- state.messages.push(msg);
- state.lastAgentMsgIdx = state.messages.length - 1;
- }
- state.pendingAgentText = "";
- state.pendingAgentTs = undefined;
- };
-
- const flushThoughtText = () => {
- if (!state.pendingThoughtText) return;
- // Merge consecutive thoughts into one message instead of many rows
- const lastMsg = state.messages[state.messages.length - 1];
- if (lastMsg?.type === "thought") {
- lastMsg.content += state.pendingThoughtText;
- } else {
- state.messages.push({
- id: `thought-${state.thoughtMessageCount++}`,
- type: "thought",
- content: state.pendingThoughtText,
- });
- }
- state.pendingThoughtText = "";
- };
-
- const flushPending = () => {
- flushThoughtText();
- flushAgentText();
- };
-
- for (let i = state.processedIdx; i < events.length; i++) {
- const event = events[i];
-
- if (event.type === "acp_message") {
- const msg = event.message as { method?: string; params?: unknown };
- if (msg.method === POSTHOG_NOTIFICATIONS.PROCESS_KILLED) {
- const notice = formatProcessKilledNotice(msg.params);
- if (notice) {
- flushPending();
- state.messages.push({
- id: `process-killed-${state.processKilledCount++}`,
- type: "process_killed",
- content: notice,
- ts: event.ts,
- });
- state.lastAgentMsgIdx = null;
- }
- }
- continue;
- }
-
- if (event.type !== "session_update") continue;
-
- const parsed = parseSessionNotification(event.notification);
- if (!parsed) continue;
-
- switch (parsed.type) {
- case "user":
- flushPending();
- state.messages.push({
- id: `user-${state.userMessageCount++}`,
- type: "user",
- content: parsed.content ?? "",
- ts: event.ts,
- attachments: parsed.attachments,
- });
- state.lastAgentMsgIdx = null;
- break;
- case "agent":
- flushThoughtText();
- if (!state.pendingAgentTs) state.pendingAgentTs = event.ts;
- state.pendingAgentText += parsed.content ?? "";
- break;
- case "agent_complete":
- flushThoughtText();
- // Replace accumulated chunks with the finalized message
- if (
- state.lastAgentMsgIdx !== null &&
- state.messages[state.lastAgentMsgIdx]?.type === "agent"
- ) {
- state.messages[state.lastAgentMsgIdx].content = parsed.content ?? "";
- if (!state.messages[state.lastAgentMsgIdx].ts) {
- state.messages[state.lastAgentMsgIdx].ts = event.ts;
- }
- hasItemMutation = true;
- state.pendingAgentText = "";
- state.pendingAgentTs = undefined;
- } else {
- state.pendingAgentText = parsed.content ?? "";
- if (!state.pendingAgentTs) state.pendingAgentTs = event.ts;
- }
- break;
- case "thought":
- flushAgentText();
- state.pendingThoughtText += parsed.content ?? "";
- break;
- case "plan":
- state.plan = parsed.entries;
- break;
- case "tool":
- flushPending();
- if (parsed.toolData) {
- const existing = state.toolMessages.get(parsed.toolData.toolCallId);
- if (existing?.toolData) {
- existing.toolData = {
- ...existing.toolData,
- ...parsed.toolData,
- };
- } else {
- const msg: ParsedMessage = {
- id: `tool-${parsed.toolData.toolCallId}`,
- type: "tool",
- content: "",
- toolData: parsed.toolData,
- children: parsed.toolData.isAgent ? [] : undefined,
- };
- state.toolMessages.set(parsed.toolData.toolCallId, msg);
-
- // Agent tools: register for child nesting
- if (parsed.toolData.isAgent) {
- state.agentTools.set(parsed.toolData.toolCallId, msg);
- }
-
- // Child tools: nest under parent agent instead of top-level
- const parentId = parsed.toolData.parentToolCallId;
- const parent = parentId
- ? state.agentTools.get(parentId)
- : undefined;
- if (parent?.children) {
- parent.children.push(msg);
- hasItemMutation = true;
- } else {
- state.messages.push(msg);
- }
- }
- }
- state.lastAgentMsgIdx = null;
- break;
- case "tool_update":
- if (parsed.toolData) {
- const existing = state.toolMessages.get(parsed.toolData.toolCallId);
- if (existing?.toolData) {
- existing.toolData.status = parsed.toolData.status;
- existing.toolData.result = parsed.toolData.result;
- if (parsed.toolData.args) {
- existing.toolData.args = parsed.toolData.args;
- }
- hasItemMutation = true;
- }
- }
- break;
- }
- }
-
- flushPending();
- state.processedIdx = events.length;
-
- // Create a new array reference when messages were added or when a tool
- // received args for the first time (so the diff view can render).
- // Pure status/text mutations reuse the prior snapshot to avoid jumps.
- if (state.messages.length !== state.lastSnapshotLength || hasItemMutation) {
- state.lastSnapshot = [...state.messages];
- state.lastSnapshotLength = state.messages.length;
- }
-
- return { messages: state.lastSnapshot, plan: state.plan };
-}
-
-const THOUGHT_COLLAPSED_LINE_COUNT = 5;
-
-function CollapsedThought({ content }: { content: string }) {
- const themeColors = useThemeColors();
- const [expanded, setExpanded] = useState(false);
- const [showAllLines, setShowAllLines] = useState(false);
-
- const hasContent = content.trim().length > 0;
- const contentLines = content.split("\n");
- const isLineCollapsible =
- hasContent && contentLines.length > THOUGHT_COLLAPSED_LINE_COUNT;
- const hiddenLineCount = contentLines.length - THOUGHT_COLLAPSED_LINE_COUNT;
- const displayedContent =
- showAllLines || !isLineCollapsible
- ? content
- : contentLines.slice(0, THOUGHT_COLLAPSED_LINE_COUNT).join("\n");
-
- return (
- <View className="px-4 py-0.5">
- <Pressable
- onPress={() => {
- if (!hasContent) return;
- setExpanded((v) => !v);
- if (!expanded) setShowAllLines(false);
- }}
- className="flex-row items-center gap-2"
- >
- <Brain size={12} color={themeColors.gray[11]} />
- <Text className="text-[13px] text-gray-11">Thinking</Text>
- </Pressable>
- {expanded && hasContent && (
- <View className="mt-1 ml-5 overflow-hidden rounded-lg border border-gray-6 px-3 py-2">
- <Text
- className="font-mono text-[12px] text-gray-11 leading-4"
- selectable
- >
- {displayedContent}
- </Text>
- {isLineCollapsible && !showAllLines && (
- <Pressable
- onPress={() => setShowAllLines(true)}
- className="mt-1 self-start"
- hitSlop={6}
- >
- <Text className="text-[12px] text-gray-10">
- +{hiddenLineCount} more lines
- </Text>
- </Pressable>
- )}
- </View>
- )}
- </View>
- );
-}
-
-function ProcessKilledNotice({ message }: { message: string }) {
- const themeColors = useThemeColors();
- return (
- <View className="flex-row items-start gap-2 px-4 py-1">
- <Warning size={14} color={themeColors.status.warning} />
- <Text className="flex-1 text-[13px] text-gray-11 leading-4">
- {message}
- </Text>
- </View>
- );
-}
-
-// Detect objects like {"0":"E","1":"r","2":"r",...,"isError":true} — a string
-// serialized as char-per-key (possibly with extra metadata keys mixed in).
-function tryReassembleString(obj: Record<string, unknown>): string | null {
- const numericKeys = Object.keys(obj).filter((k) => /^\d+$/.test(k));
- if (numericKeys.length < 3) return null;
- if (
- numericKeys.every(
- (k) => typeof obj[k] === "string" && (obj[k] as string).length === 1,
- )
- ) {
- return numericKeys
- .sort((a, b) => Number(a) - Number(b))
- .map((k) => obj[k])
- .join("");
- }
- return null;
-}
-
-function extractErrorText(result: unknown): string | null {
- if (typeof result === "string") return result;
- if (Array.isArray(result)) {
- const texts = result.map(extractErrorText).filter(Boolean);
- return texts.length > 0 ? texts.join("\n") : null;
- }
- if (!result || typeof result !== "object") return null;
- const obj = result as Record<string, unknown>;
-
- // Reassemble char-per-key strings: {"0":"E","1":"r",...}
- const reassembled = tryReassembleString(obj);
- if (reassembled) return reassembled;
-
- // Check simple string fields, recurse into nested objects
- for (const key of [
- "error",
- "message",
- "stderr",
- "output",
- "text",
- "content",
- ]) {
- if (typeof obj[key] === "string") return obj[key] as string;
- if (obj[key] && typeof obj[key] === "object") {
- const nested = extractErrorText(obj[key]);
- if (nested) return nested;
- }
- }
-
- // Last resort: stringify the result so *something* shows
- try {
- const str = JSON.stringify(result, null, 2);
- if (str && str !== "{}") return str;
- } catch {
- // ignore
- }
-
- return null;
-}
-
-function agentPromptSummary(args?: Record<string, unknown>): string | null {
- if (!args) return null;
- const prompt =
- typeof args.prompt === "string"
- ? args.prompt
- : typeof args.description === "string"
- ? args.description
- : null;
- if (!prompt) return null;
- // Take the first meaningful line, truncated
- const firstLine = prompt
- .split("\n")
- .find((l) => l.trim())
- ?.trim();
- if (!firstLine) return null;
- return firstLine.length > 120 ? `${firstLine.slice(0, 120)}…` : firstLine;
-}
-
-function AgentToolCard({
- item,
- onOpenTask,
-}: {
- item: ParsedMessage;
- onOpenTask?: (taskId: string) => void;
-}) {
- const themeColors = useThemeColors();
- const [expanded, setExpanded] = useState(false);
- const toolData = item.toolData;
- const children = item.children ?? [];
- if (!toolData) return null;
-
- const isLoading =
- toolData.status === "pending" || toolData.status === "running";
- const isFailed = toolData.status === "error";
- const childCount = children.length;
- const subtitle = agentPromptSummary(toolData.args);
- const errorText = isFailed ? extractErrorText(toolData.result) : null;
-
- return (
- <View className="mx-4 my-1 overflow-hidden rounded-lg border border-gray-6 bg-gray-2">
- {/* Header */}
- <Pressable onPress={() => setExpanded(!expanded)} className="px-3 py-2">
- <View className="flex-row items-center gap-2">
- {isLoading ? (
- <ActivityIndicator size={12} color={themeColors.accent[9]} />
- ) : (
- <Robot
- size={14}
- color={
- isFailed ? themeColors.status.error : themeColors.accent[9]
- }
- />
- )}
- <Text
- className="flex-1 font-mono text-[13px] text-gray-12"
- numberOfLines={1}
- >
- {toolData.toolName}
- </Text>
- {childCount > 0 && (
- <Text className="font-mono text-[11px] text-gray-9">
- {childCount} {childCount === 1 ? "tool" : "tools"}
- </Text>
- )}
- {isFailed && (
- <Text className="font-mono text-[11px] text-status-error">
- Failed
- </Text>
- )}
- <CaretRight
- size={12}
- color={themeColors.gray[9]}
- style={{
- transform: [{ rotate: expanded ? "90deg" : "0deg" }],
- }}
- />
- </View>
- {subtitle && (
- <Text
- className="mt-1 ml-5 text-[12px] text-gray-9 leading-4"
- numberOfLines={2}
- >
- {subtitle}
- </Text>
- )}
- </Pressable>
-
- {/* Error message + nested tool calls */}
- {expanded && (
- <View className="border-gray-6 border-t">
- {errorText && (
- <View className="mx-3 my-2 rounded bg-status-error/10 px-3 py-2">
- <Text
- className="font-mono text-[12px] text-status-error leading-4"
- selectable
- >
- {errorText}
- </Text>
- </View>
- )}
- {children.map((child) => {
- if (!child.toolData) return null;
- return (
- <ToolMessage
- key={child.id}
- toolName={child.toolData.toolName}
- rawToolName={child.toolData.rawToolName}
- kind={deriveToolKind(
- child.toolData.rawToolName ?? child.toolData.toolName,
- )}
- status={child.toolData.status}
- args={child.toolData.args}
- result={child.toolData.result}
- onOpenTask={onOpenTask}
- />
- );
- })}
- </View>
- )}
- </View>
- );
-}
-
-function formatElapsed(seconds: number): string {
- const m = Math.floor(seconds / 60);
- const s = seconds % 60;
- return m > 0 ? `${m}m ${s}s` : `${s}s`;
-}
-
-function useElapsedTimer() {
- const [elapsed, setElapsed] = useState(0);
- useEffect(() => {
- setElapsed(0);
- const interval = setInterval(() => {
- setElapsed((e) => e + 1);
- }, 1000);
- return () => clearInterval(interval);
- }, []);
- return elapsed;
-}
-
-function ThinkingIndicator() {
- const [dots, setDots] = useState(1);
- const [activity, setActivity] = useState(() =>
- pickThinkingActivity(Math.random()),
- );
- const elapsed = useElapsedTimer();
- const themeColors = useThemeColors();
-
- useEffect(() => {
- const interval = setInterval(() => {
- setDots((d) => (d % 3) + 1);
- }, 500);
- return () => clearInterval(interval);
- }, []);
-
- useEffect(() => {
- const interval = setInterval(() => {
- setActivity(pickThinkingActivity(Math.random()));
- }, 2000);
- return () => clearInterval(interval);
- }, []);
-
- return (
- <View className="px-4 py-0.5">
- <View className="flex-row items-center justify-between">
- <View className="flex-row items-center gap-2">
- <Brain size={12} color={themeColors.gray[8]} />
- <Text className="font-mono text-[12px] text-gray-8">
- {activity}
- {".".repeat(dots)}
- </Text>
- </View>
- <Text className="font-mono text-[12px] text-gray-8">
- {formatElapsed(elapsed)}
- </Text>
- </View>
- </View>
- );
-}
-
-function ConnectingIndicator() {
- const [dots, setDots] = useState(1);
- const elapsed = useElapsedTimer();
- const themeColors = useThemeColors();
-
- useEffect(() => {
- const interval = setInterval(() => {
- setDots((d) => (d % 3) + 1);
- }, 500);
- return () => clearInterval(interval);
- }, []);
-
- return (
- <View className="px-4 py-0.5">
- <View className="flex-row items-center justify-between">
- <View className="flex-row items-center gap-2">
- <CloudArrowDown size={12} color={themeColors.gray[8]} />
- <Text className="font-mono text-[12px] text-gray-8">
- Connecting{".".repeat(dots)}
- </Text>
- </View>
- <Text className="font-mono text-[12px] text-gray-8">
- {formatElapsed(elapsed)}
- </Text>
- </View>
- </View>
- );
-}
-
-export function TaskSessionView({
- events,
- taskId,
- runId,
- pendingPermissions,
- isConnecting,
- isThinking,
- terminalStatus,
- lastError,
- onRetry,
- onOpenTask,
- onSendPermissionResponse,
- contentContainerStyle,
- optimisticUserMessage,
-}: TaskSessionViewProps) {
- const processorRef = useRef(createProcessorState());
- const prevEventsRef = useRef(events);
- // Reset processor when events array shrinks or changes identity completely
- // (e.g., navigating between tasks while Expo Router reuses the component).
- if (
- events.length === 0 ||
- (events !== prevEventsRef.current && events[0] !== prevEventsRef.current[0])
- ) {
- processorRef.current = createProcessorState();
- }
- prevEventsRef.current = events;
- const { messages, plan } = useMemo(
- () => processNewEvents(processorRef.current, events),
- [events],
- );
-
- // When the agent stops (cancel, completion, terminal), sweep any
- // tools still stuck in pending/running to "completed" so their
- // spinners stop.
- const agentActive = isConnecting || isThinking;
- const prevAgentActive = useRef(agentActive);
- if (prevAgentActive.current && !agentActive) {
- const state = processorRef.current;
- let swept = false;
- for (const msg of state.toolMessages.values()) {
- const permission = msg.toolData
- ? pendingPermissions?.[msg.toolData.toolCallId]
- : undefined;
- if (
- msg.toolData &&
- (msg.toolData.status === "pending" ||
- msg.toolData.status === "running") &&
- !isInteractivePermissionTool(msg.toolData, permission)
- ) {
- msg.toolData.status = "completed";
- swept = true;
- }
- }
- if (swept) {
- state.lastSnapshot = [...state.messages];
- state.lastSnapshotLength = state.messages.length;
- }
- }
- prevAgentActive.current = agentActive;
-
- // Append the optimistic user echo (if any) as the newest message, unless a
- // real `user` message with matching text *and a ts at or after submit time*
- // has already arrived via SSE. Gating on `ts` prevents a text-identical
- // historical turn from suppressing a freshly-submitted echo.
- const messagesWithOptimistic = useMemo(() => {
- if (!optimisticUserMessage) return messages;
- const alreadyEchoed = messages.some(
- (m) =>
- m.type === "user" &&
- m.content === optimisticUserMessage.text &&
- (m.ts ?? 0) >= optimisticUserMessage.setAt,
- );
- if (alreadyEchoed) return messages;
- const optimistic: ParsedMessage = {
- id: "optimistic-user",
- type: "user",
- content: optimisticUserMessage.text,
- attachments: optimisticUserMessage.attachments,
- };
- return [...messages, optimistic];
- }, [messages, optimisticUserMessage]);
-
- // Inverted FlatList renders data[0] at the visual bottom.
- // Reverse so newest messages are at index 0 = bottom.
- const reversedMessages = useMemo(
- () => [...messagesWithOptimistic].reverse(),
- [messagesWithOptimistic],
- );
- const themeColors = useThemeColors();
- const flatListRef = useRef<FlatList>(null);
- const hasPendingQuestion = useMemo(
- () => messages.some(hasPendingQuestionMessage),
- [messages],
- );
- const showActivityIndicator = agentActive && !hasPendingQuestion;
- const effectiveContentContainerStyle = useMemo(() => {
- const baseStyle = (contentContainerStyle ?? {}) as {
- paddingTop?: number;
- [key: string]: unknown;
- };
-
- if (!showActivityIndicator) {
- return baseStyle;
- }
-
- return {
- ...baseStyle,
- // In the inverted list, paddingTop becomes visual bottom spacing.
- // Reserve enough room so the floating activity indicator never
- // covers the last visible row while the agent is working.
- // 28pt was tight at default text sizes and let cards (e.g. the
- // Agent loading card) peek into the indicator strip — 44pt gives
- // a real buffer plus headroom for larger dynamic-type settings.
- paddingTop: (baseStyle.paddingTop ?? 0) + 44,
- };
- }, [contentContainerStyle, showActivityIndicator]);
- // Inverted FlatList: scrollY is the distance from the visual bottom, so
- // any non-trivial value means the user has scrolled up from the latest
- // message. Use a small threshold to ignore iOS bounce.
- const [scrolledFromBottom, setScrolledFromBottom] = useState(false);
-
- const scrollToBottom = useCallback(() => {
- // Optimistically hide the button — the scroll animation will fire
- // onScroll events too, but the throttle can leave the button visible
- // for a beat after tap if we rely on those alone.
- setScrolledFromBottom(false);
- flatListRef.current?.scrollToOffset({ offset: 0, animated: true });
- }, []);
-
- const handleScroll = useCallback(
- (e: { nativeEvent: { contentOffset: { y: number } } }) => {
- setScrolledFromBottom(e.nativeEvent.contentOffset.y > 100);
- },
- [],
- );
-
- const renderAttachment = useCallback(
- (attachment: SessionNotificationAttachment) => (
- <CloudMessageAttachment attachment={attachment} taskId={taskId} />
- ),
- [taskId],
- );
-
- const renderMessage = useCallback(
- ({ item }: { item: ParsedMessage }) => {
- switch (item.type) {
- case "user":
- return (
- <HumanMessage
- content={item.content}
- timestamp={item.ts}
- attachments={item.attachments}
- renderAttachment={renderAttachment}
- />
- );
- case "agent":
- return (
- <AgentMessage
- content={item.content}
- onOpenTask={onOpenTask}
- timestamp={item.ts}
- turnId={item.id}
- taskId={taskId}
- />
- );
- case "thought":
- return <CollapsedThought content={item.content} />;
- case "process_killed":
- return <ProcessKilledNotice message={item.content} />;
- case "tool":
- if (!item.toolData) return null;
- if (
- isPlanApprovalTool(
- item.toolData,
- pendingPermissions?.[item.toolData.toolCallId],
- )
- ) {
- return (
- <PlanApprovalCard
- toolData={item.toolData}
- permission={pendingPermissions?.[item.toolData.toolCallId]}
- onSendPermissionResponse={onSendPermissionResponse}
- />
- );
- }
- if (isQuestionTool(item.toolData)) {
- return (
- <QuestionCard
- toolData={item.toolData}
- onSendPermissionResponse={onSendPermissionResponse}
- />
- );
- }
- if (item.toolData.isAgent) {
- return <AgentToolCard item={item} onOpenTask={onOpenTask} />;
- }
- {
- const inline = detectInlineArtifact(item.toolData);
- if (inline?.kind === "upload") {
- return (
- <InlineUploadedArtifactCard
- toolData={item.toolData}
- taskId={taskId}
- runId={runId}
- enabled={!!terminalStatus}
- />
- );
- }
- return (
- <>
- <ToolMessage
- toolName={item.toolData.toolName}
- rawToolName={item.toolData.rawToolName}
- kind={deriveToolKind(
- item.toolData.rawToolName ?? item.toolData.toolName,
- )}
- status={item.toolData.status}
- args={item.toolData.args}
- result={item.toolData.result}
- onOpenTask={onOpenTask}
- />
- {inline?.kind === "pr" && (
- <InlineCreatedPrCard url={inline.url} />
- )}
- </>
- );
- }
- default:
- return null;
- }
- },
- [
- onOpenTask,
- onSendPermissionResponse,
- pendingPermissions,
- renderAttachment,
- taskId,
- runId,
- terminalStatus,
- ],
- );
-
- // Memoized so a live session's frequent re-renders (streaming, timers) don't
- // reconcile the banner subtree on every tick.
- const listHeader = useMemo(
- () =>
- terminalStatus ? (
- <TerminalStatusBanner
- terminalStatus={terminalStatus}
- lastError={lastError}
- onRetry={onRetry}
- />
- ) : null,
- [terminalStatus, lastError, onRetry],
- );
-
- return (
- <View className="flex-1">
- <PlanStatusBar plan={plan} />
- <FlatList
- ref={flatListRef}
- data={reversedMessages}
- renderItem={renderMessage}
- keyExtractor={(item) => item.id}
- inverted
- contentContainerStyle={effectiveContentContainerStyle}
- keyboardDismissMode="interactive"
- keyboardShouldPersistTaps="handled"
- showsVerticalScrollIndicator
- onScroll={handleScroll}
- scrollEventThrottle={100}
- maxToRenderPerBatch={15}
- windowSize={21}
- initialNumToRender={30}
- ListHeaderComponent={listHeader}
- />
- {/* Thinking/connecting indicators pinned to the bottom of the list area.
- The Composer is a sibling below TaskSessionView in flex flow, so
- `bottom-0` here sits the strip right above the composer's top edge.
- Solid bg so list rows scrolling under it are occluded instead of
- bleeding through. */}
- {showActivityIndicator && (
- <View className="absolute inset-x-0 bottom-0 bg-background pt-1 pb-2">
- {isConnecting ? (
- <ConnectingIndicator />
- ) : isThinking ? (
- <ThinkingIndicator />
- ) : null}
- </View>
- )}
- {scrolledFromBottom && (
- <Pressable
- onPress={scrollToBottom}
- className="absolute right-4 bottom-4 h-10 w-10 items-center justify-center rounded-full bg-gray-3"
- style={{
- shadowColor: "#000",
- shadowOffset: { width: 0, height: 2 },
- shadowOpacity: 0.2,
- shadowRadius: 4,
- elevation: 4,
- }}
- >
- <ArrowDown size={18} color={themeColors.gray[11]} />
- </Pressable>
- )}
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/components/TaskStatusIcon.test.ts b/products/desktop/apps/mobile/src/features/tasks/components/TaskStatusIcon.test.ts
deleted file mode 100644
index f7595cb7cb15..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/components/TaskStatusIcon.test.ts
+++ /dev/null
@@ -1,109 +0,0 @@
-import type { Task } from "@posthog/shared";
-import { describe, expect, it } from "vitest";
-import { getTaskStatusIconKind } from "./taskStatusIconKind";
-
-function makeTask(latestRun?: Partial<NonNullable<Task["latest_run"]>>): Task {
- return {
- id: "task-1",
- task_number: 1,
- slug: "task-1",
- title: "Test task",
- description: "",
- created_at: "2026-01-01T00:00:00Z",
- updated_at: "2026-01-01T00:00:00Z",
- origin_product: "code",
- latest_run: latestRun
- ? {
- id: "run-1",
- task: "task-1",
- team: 1,
- branch: null,
- stage: null,
- environment: "local",
- status: "not_started",
- log_url: "",
- error_message: null,
- output: null,
- state: {},
- created_at: "2026-01-01T00:00:00Z",
- updated_at: "2026-01-01T00:00:00Z",
- completed_at: null,
- ...latestRun,
- }
- : undefined,
- };
-}
-
-describe("getTaskStatusIconKind", () => {
- it.each([
- ["pr_url only", { pr_url: "https://github.com/PostHog/code/pull/1" }],
- ["pr_urls only", { pr_urls: ["https://github.com/PostHog/code/pull/2"] }],
- [
- "both fields",
- {
- pr_url: "https://github.com/PostHog/code/pull/1",
- pr_urls: ["https://github.com/PostHog/code/pull/2"],
- },
- ],
- ])("prioritizes PR over cloud status (%s)", (_label, output) => {
- const task = makeTask({
- environment: "cloud",
- status: "in_progress",
- output,
- });
-
- expect(getTaskStatusIconKind(task)).toBe("pr");
- });
-
- it.each([
- ["output has no PR fields", { commit: "abc123" }],
- ["pr_urls is empty", { pr_urls: [] }],
- ["pr_url is an empty string", { pr_url: "" }],
- ])("does not return pr when %s", (_label, output) => {
- expect(
- getTaskStatusIconKind(
- makeTask({ environment: "cloud", status: "in_progress", output }),
- ),
- ).toBe("chat");
- });
-
- it("shows chat for cloud tasks without a PR, regardless of run status", () => {
- expect(
- getTaskStatusIconKind(
- makeTask({ environment: "cloud", status: "queued" }),
- ),
- ).toBe("chat");
- expect(
- getTaskStatusIconKind(
- makeTask({ environment: "cloud", status: "in_progress" }),
- ),
- ).toBe("chat");
- expect(
- getTaskStatusIconKind(
- makeTask({ environment: "cloud", status: "completed" }),
- ),
- ).toBe("chat");
- expect(
- getTaskStatusIconKind(
- makeTask({ environment: "cloud", status: "cancelled" }),
- ),
- ).toBe("chat");
- });
-
- it("preserves local run-state icons", () => {
- expect(
- getTaskStatusIconKind(
- makeTask({ environment: "local", status: "in_progress" }),
- ),
- ).toBe("running");
- expect(
- getTaskStatusIconKind(
- makeTask({ environment: "local", status: "failed" }),
- ),
- ).toBe("failed");
- });
-
- it("falls back to chat when a task has no run yet", () => {
- expect(getTaskStatusIconKind(makeTask())).toBe("chat");
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/tasks/components/TaskStatusIcon.tsx b/products/desktop/apps/mobile/src/features/tasks/components/TaskStatusIcon.tsx
deleted file mode 100644
index 8736b203b002..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/components/TaskStatusIcon.tsx
+++ /dev/null
@@ -1,80 +0,0 @@
-import type { Task } from "@posthog/shared";
-import {
- ChatCircle,
- CheckCircle,
- CircleIcon,
- CircleNotch,
- GitPullRequest,
- XCircle,
-} from "phosphor-react-native";
-import { memo, useEffect, useRef } from "react";
-import { Animated, Easing } from "react-native";
-import { useThemeColors } from "@/lib/theme";
-import { getTaskStatusIconKind } from "./taskStatusIconKind";
-
-interface TaskStatusIconProps {
- task: Task;
- size?: number;
-}
-
-function TaskStatusIconComponent({ task, size = 16 }: TaskStatusIconProps) {
- const colors = useThemeColors();
- const iconKind = getTaskStatusIconKind(task);
-
- const rotation = useRef(new Animated.Value(0)).current;
- const isRunning = iconKind === "running";
-
- useEffect(() => {
- if (!isRunning) {
- rotation.stopAnimation();
- rotation.setValue(0);
- return;
- }
- const loop = Animated.loop(
- Animated.timing(rotation, {
- toValue: 1,
- duration: 1000,
- easing: Easing.linear,
- useNativeDriver: true,
- }),
- );
- loop.start();
- return () => loop.stop();
- }, [isRunning, rotation]);
-
- if (iconKind === "pr") {
- return (
- <GitPullRequest size={size} weight="bold" color={colors.status.success} />
- );
- }
-
- if (iconKind === "completed") {
- return (
- <CheckCircle size={size} weight="fill" color={colors.status.success} />
- );
- }
-
- if (iconKind === "failed") {
- return <XCircle size={size} weight="fill" color={colors.status.error} />;
- }
-
- if (iconKind === "running") {
- const spin = rotation.interpolate({
- inputRange: [0, 1],
- outputRange: ["0deg", "360deg"],
- });
- return (
- <Animated.View style={{ transform: [{ rotate: spin }] }}>
- <CircleNotch size={size} weight="bold" color={colors.accent[9]} />
- </Animated.View>
- );
- }
-
- if (iconKind === "started") {
- return <CircleIcon size={size} weight="duotone" color={colors.accent[9]} />;
- }
-
- return <ChatCircle size={size} weight="regular" color={colors.gray[9]} />;
-}
-
-export const TaskStatusIcon = memo(TaskStatusIconComponent);
diff --git a/products/desktop/apps/mobile/src/features/tasks/components/TerminalStatusBanner.test.tsx b/products/desktop/apps/mobile/src/features/tasks/components/TerminalStatusBanner.test.tsx
deleted file mode 100644
index 13af28ea8946..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/components/TerminalStatusBanner.test.tsx
+++ /dev/null
@@ -1,63 +0,0 @@
-import { createElement } from "react";
-import { act, create } from "react-test-renderer";
-import { describe, expect, it, vi } from "vitest";
-import {
- TerminalStatusBanner,
- type TerminalStatusBannerProps,
-} from "./TerminalStatusBanner";
-
-function render(props: TerminalStatusBannerProps) {
- let renderer!: ReturnType<typeof create>;
- act(() => {
- renderer = create(createElement(TerminalStatusBanner, props));
- });
- return renderer;
-}
-
-function renderedText(renderer: ReturnType<typeof create>): string {
- const acc: string[] = [];
- const walk = (node: unknown) => {
- if (typeof node === "string") {
- acc.push(node);
- } else if (Array.isArray(node)) {
- node.forEach(walk);
- } else if (node && typeof node === "object" && "children" in node) {
- walk((node as { children: unknown }).children);
- }
- };
- walk(renderer.toJSON());
- return acc.join(" ");
-}
-
-describe("TerminalStatusBanner", () => {
- it.each([
- { terminalStatus: "completed", label: "Run completed", button: "Continue" },
- { terminalStatus: "failed", label: "Run failed", button: "Retry" },
- { terminalStatus: "stopped", label: "Run stopped", button: "Continue" },
- ] as const)(
- "shows $label with a $button action for a $terminalStatus run",
- ({ terminalStatus, label, button }) => {
- const text = renderedText(render({ terminalStatus, onRetry: vi.fn() }));
- expect(text).toContain(label);
- expect(text).toContain(button);
- },
- );
-
- it("does not label a stopped run as failed", () => {
- const text = renderedText(render({ terminalStatus: "stopped" }));
- expect(text).not.toContain("Run failed");
- expect(text).not.toContain("Retry");
- });
-
- it("fires onRetry when the action is pressed", () => {
- const onRetry = vi.fn();
- const renderer = render({ terminalStatus: "stopped", onRetry });
- const pressable = renderer.root.findAll(
- (node) => node.props.onPress === onRetry,
- )[0];
- act(() => {
- pressable.props.onPress();
- });
- expect(onRetry).toHaveBeenCalledTimes(1);
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/tasks/components/TerminalStatusBanner.tsx b/products/desktop/apps/mobile/src/features/tasks/components/TerminalStatusBanner.tsx
deleted file mode 100644
index aff1b0a166a3..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/components/TerminalStatusBanner.tsx
+++ /dev/null
@@ -1,57 +0,0 @@
-import { Pressable, Text, View } from "react-native";
-import type { TerminalStatus } from "../types";
-
-export interface TerminalStatusBannerProps {
- terminalStatus: TerminalStatus;
- lastError?: string | null;
- onRetry?: () => void;
-}
-
-export function TerminalStatusBanner({
- terminalStatus,
- lastError,
- onRetry,
-}: TerminalStatusBannerProps) {
- const isFailed = terminalStatus === "failed";
- const label =
- terminalStatus === "failed"
- ? "Run failed"
- : terminalStatus === "stopped"
- ? "Run stopped"
- : "Run completed";
-
- return (
- <View
- className={`mx-4 mt-2 mb-4 rounded-lg px-4 py-3 ${
- isFailed ? "bg-status-error/10" : "bg-status-success/10"
- }`}
- >
- <Text
- className={`font-semibold text-sm ${
- isFailed ? "text-status-error" : "text-status-success"
- }`}
- >
- {label}
- </Text>
- {lastError && (
- <Text className="mt-1 text-gray-11 text-xs">{lastError}</Text>
- )}
- {onRetry && (
- <Pressable
- onPress={onRetry}
- className={`mt-2 self-start rounded-md px-3 py-1.5 ${
- isFailed ? "bg-status-error/20" : "bg-status-success/20"
- }`}
- >
- <Text
- className={`font-medium text-xs ${
- isFailed ? "text-status-error" : "text-status-success"
- }`}
- >
- {isFailed ? "Retry" : "Continue"}
- </Text>
- </Pressable>
- )}
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/components/taskStatusIconKind.ts b/products/desktop/apps/mobile/src/features/tasks/components/taskStatusIconKind.ts
deleted file mode 100644
index cac6a7c2ace4..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/components/taskStatusIconKind.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import { readPrUrls, type Task } from "@posthog/shared";
-
-export type TaskStatusIconKind =
- | "pr"
- | "completed"
- | "failed"
- | "running"
- | "started"
- | "chat";
-
-export function getTaskStatusIconKind(task: Task): TaskStatusIconKind {
- const hasPr = readPrUrls(task.latest_run?.output).length > 0;
- const status = task.latest_run?.status;
- const environment = task.latest_run?.environment;
-
- // Match desktop semantics, but let PR win when a cloud task also has one.
- if (hasPr) {
- return "pr";
- }
-
- if (environment === "cloud") {
- return "chat";
- }
-
- if (status === "completed") {
- return "completed";
- }
-
- if (status === "failed") {
- return "failed";
- }
-
- if (status === "in_progress") {
- return "running";
- }
-
- if (status === "queued") {
- return "started";
- }
-
- return "chat";
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/composer/AgentConfigControls.test.tsx b/products/desktop/apps/mobile/src/features/tasks/composer/AgentConfigControls.test.tsx
deleted file mode 100644
index ceb1e9259281..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/composer/AgentConfigControls.test.tsx
+++ /dev/null
@@ -1,246 +0,0 @@
-import type {
- CloudTaskConfigOption,
- CloudTaskConfigSelectGroup,
-} from "@posthog/shared";
-import { createElement, type ReactNode } from "react";
-import { act, create } from "react-test-renderer";
-import { describe, expect, it, vi } from "vitest";
-import { AgentConfigControls } from "./AgentConfigControls";
-
-const flagState = { fastMode: false as boolean };
-
-vi.mock("posthog-react-native", () => ({
- useFeatureFlag: () => flagState.fastMode,
-}));
-
-vi.mock("phosphor-react-native", () => {
- const icon = (name: string) => (props: Record<string, unknown>) =>
- createElement(name, props);
- return {
- ArrowCounterClockwise: icon("ArrowCounterClockwise"),
- CaretDown: icon("CaretDown"),
- Check: icon("Check"),
- Cpu: icon("Cpu"),
- Lightning: icon("Lightning"),
- PauseIcon: icon("PauseIcon"),
- PencilIcon: icon("PencilIcon"),
- Robot: icon("Robot"),
- ShieldCheck: icon("ShieldCheck"),
- Sparkle: icon("Sparkle"),
- };
-});
-
-vi.mock("@/components/SheetContainer", () => ({
- SheetContainer: ({
- open,
- children,
- }: {
- open: boolean;
- children: ReactNode;
- }) => (open ? createElement("SheetContainer", null, children) : null),
-}));
-
-vi.mock("@/lib/theme", () => ({
- useThemeColors: () => ({
- gray: { 10: "#777", 11: "#555", 12: "#111" },
- accent: { 9: "#f60", 11: "#f60" },
- status: { warning: "#d97706" },
- background: "#fff",
- }),
-}));
-
-const HARNESS_META = "posthog.code/modelHarness";
-
-const ladderModelOption: CloudTaskConfigOption = {
- id: "model",
- name: "Model",
- type: "select",
- currentValue: "claude-sonnet-5",
- options: [
- { value: "claude-sonnet-5", name: "Claude Sonnet 5" },
- { value: "claude-opus-5-5", name: "Claude Opus 5.5" },
- { value: "claude-fable-5-1", name: "Claude Fable 5.1" },
- ],
- category: "model",
- description: "Choose a model",
-};
-
-const configOptions: CloudTaskConfigOption[] = [ladderModelOption];
-
-const modelGroups: CloudTaskConfigSelectGroup[] = [
- {
- group: "anthropic",
- name: "Anthropic",
- options: [
- {
- value: "claude-sonnet-5",
- name: "Claude Sonnet 5",
- _meta: { [HARNESS_META]: "claude" },
- },
- {
- value: "claude-opus-5-5",
- name: "Claude Opus 5.5",
- _meta: { [HARNESS_META]: "claude" },
- },
- {
- value: "claude-fable-5-1",
- name: "Claude Fable 5.1",
- _meta: { [HARNESS_META]: "claude" },
- },
- ],
- },
- {
- group: "openai",
- name: "OpenAI",
- options: [
- {
- value: "gpt-5.6-sol",
- name: "GPT-5.6 Sol",
- _meta: { [HARNESS_META]: "codex" },
- },
- ],
- },
-];
-
-function baseProps() {
- return {
- adapter: "claude" as const,
- mode: "plan" as const,
- model: "claude-sonnet-5",
- reasoning: "medium" as const,
- contextWindow: "1m" as const,
- fastMode: false,
- configOptions,
- modelGroups,
- onAdapterChange: vi.fn(),
- onModeChange: vi.fn(),
- onModelChange: vi.fn(),
- onReasoningChange: vi.fn(),
- onContextWindowChange: vi.fn(),
- onFastModeChange: vi.fn(),
- };
-}
-
-function findPressableWithText(
- renderer: ReturnType<typeof create>,
- label: string,
-) {
- return renderer.root.find(
- (node) =>
- typeof node.props.onPress === "function" &&
- node.findAll((child) => child.props.children === label).length > 0,
- );
-}
-
-function render(props: ReturnType<typeof baseProps>) {
- let renderer!: ReturnType<typeof create>;
- act(() => {
- renderer = create(createElement(AgentConfigControls, props));
- });
- return renderer;
-}
-
-describe("AgentConfigControls", () => {
- it("summarizes model and reasoning in a single pill", () => {
- const renderer = render(baseProps());
- expect(() =>
- findPressableWithText(renderer, "Claude Sonnet 5 · Medium"),
- ).not.toThrow();
- });
-
- it("applies model and effort together when a preset is picked", () => {
- const props = baseProps();
- const renderer = render(props);
-
- act(() =>
- findPressableWithText(
- renderer,
- "Claude Sonnet 5 · Medium",
- ).props.onPress(),
- );
- act(() =>
- findPressableWithText(
- renderer,
- "Claude Opus 5.5 · Extra high",
- ).props.onPress(),
- );
-
- expect(props.onModelChange).toHaveBeenCalledWith("claude-opus-5-5");
- expect(props.onReasoningChange).toHaveBeenCalledWith("xhigh");
- });
-
- it("switches harness when picking a model from the other harness", () => {
- const props = baseProps();
- const renderer = render(props);
-
- act(() =>
- findPressableWithText(
- renderer,
- "Claude Sonnet 5 · Medium",
- ).props.onPress(),
- );
- act(() => findPressableWithText(renderer, "Advanced").props.onPress());
- act(() => findPressableWithText(renderer, "GPT-5.6 Sol").props.onPress());
-
- expect(props.onAdapterChange).toHaveBeenCalledWith({
- adapter: "codex",
- mode: "auto",
- model: "gpt-5.6-sol",
- reasoning: "high",
- });
- expect(props.onModelChange).not.toHaveBeenCalled();
- });
-
- it("keeps a same-harness pick on the current adapter", () => {
- const props = baseProps();
- const renderer = render(props);
-
- act(() =>
- findPressableWithText(
- renderer,
- "Claude Sonnet 5 · Medium",
- ).props.onPress(),
- );
- act(() => findPressableWithText(renderer, "Advanced").props.onPress());
- act(() =>
- findPressableWithText(renderer, "Claude Opus 5.5").props.onPress(),
- );
-
- expect(props.onModelChange).toHaveBeenCalledWith("claude-opus-5-5");
- expect(props.onAdapterChange).not.toHaveBeenCalled();
- });
-
- it("hides the other harness's models when the run locks the adapter", () => {
- const props = { ...baseProps(), canChangeAdapter: false };
- const renderer = render(props);
-
- act(() =>
- findPressableWithText(
- renderer,
- "Claude Sonnet 5 · Medium",
- ).props.onPress(),
- );
- act(() => findPressableWithText(renderer, "Advanced").props.onPress());
-
- expect(() => findPressableWithText(renderer, "GPT-5.6 Sol")).toThrow();
- expect(() =>
- findPressableWithText(renderer, "Claude Opus 5.5"),
- ).not.toThrow();
- });
-
- it("only surfaces the fast mode toggle when the flag is on and the model supports it", () => {
- flagState.fastMode = true;
- const props = { ...baseProps(), model: "claude-opus-5-5" };
- const renderer = render(props);
-
- act(() =>
- findPressableWithText(
- renderer,
- "Claude Opus 5.5 · Medium",
- ).props.onPress(),
- );
- expect(() => renderer.root.findByType("Lightning" as never)).not.toThrow();
-
- flagState.fastMode = false;
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/tasks/composer/AgentConfigControls.tsx b/products/desktop/apps/mobile/src/features/tasks/composer/AgentConfigControls.tsx
deleted file mode 100644
index 67d1d4284d9e..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/composer/AgentConfigControls.tsx
+++ /dev/null
@@ -1,239 +0,0 @@
-import { getAvailableModesForAdapter } from "@posthog/core/sessions/executionModes";
-import type { CloudComposerSelection } from "@posthog/core/task-detail/composerModelPolicy";
-import {
- type Adapter,
- type CloudTaskConfigOption,
- type CloudTaskConfigSelectGroup,
- type ExecutionMode,
- FAST_MODE_FLAG,
- getReasoningEffortOptions,
- type SupportedReasoningEffort,
- supports1MContext,
- supportsFastMode,
-} from "@posthog/shared";
-import {
- Cpu,
- Lightning,
- PauseIcon,
- PencilIcon,
- Robot,
- ShieldCheck,
- Sparkle,
-} from "phosphor-react-native";
-import { useFeatureFlag } from "posthog-react-native";
-import { type ReactNode, useMemo, useState } from "react";
-import { useThemeColors } from "@/lib/theme";
-import { AgentConfigSheet } from "./AgentConfigSheet";
-import {
- type AgentPreset,
- type ContextWindow,
- DEFAULT_CONTEXT_WINDOW,
- findModelOptionInGroups,
- getAgentPresets,
- getMiddlePreset,
- getMobileExecutionModes,
- getModelConfigOption,
- harnessForModel,
- resolveCrossHarnessModelSelection,
- toMobileModelGroups,
-} from "./options";
-import { Pill } from "./Pill";
-import { SelectSheet } from "./SelectSheet";
-
-interface AgentConfigControlsProps {
- adapter: Adapter;
- mode: ExecutionMode;
- model: string;
- reasoning: SupportedReasoningEffort;
- contextWindow: ContextWindow;
- fastMode: boolean;
- configOptions: readonly CloudTaskConfigOption[];
- modelGroups: readonly CloudTaskConfigSelectGroup[];
- /**
- * Called for both cross-harness picks and manual harness switches. Same
- * shape as the desktop `resolveCloudComposerAdapterChange` result.
- */
- onAdapterChange: (selection: CloudComposerSelection) => void;
- onModeChange: (mode: ExecutionMode) => void;
- onModelChange: (model: string) => void;
- onReasoningChange: (reasoning: SupportedReasoningEffort) => void;
- onContextWindowChange: (contextWindow: ContextWindow) => void;
- onFastModeChange: (enabled: boolean) => void;
- canChangeAdapter?: boolean;
-}
-
-function modeIcon(mode: ExecutionMode, color: string, size = 14): ReactNode {
- switch (mode) {
- case "plan":
- return <PauseIcon size={size} color={color} weight="bold" />;
- case "default":
- return <PencilIcon size={size} color={color} />;
- case "acceptEdits":
- return <ShieldCheck size={size} color={color} />;
- case "bypassPermissions":
- case "full-access":
- return <ShieldCheck size={size} color={color} weight="fill" />;
- case "read-only":
- return <PauseIcon size={size} color={color} />;
- case "auto":
- return <Sparkle size={size} color={color} weight="fill" />;
- }
-}
-
-export function AgentConfigControls({
- adapter,
- mode,
- model,
- reasoning,
- contextWindow,
- fastMode,
- configOptions,
- modelGroups,
- onAdapterChange,
- onModeChange,
- onModelChange,
- onReasoningChange,
- onContextWindowChange,
- onFastModeChange,
- canChangeAdapter = true,
-}: AgentConfigControlsProps) {
- const themeColors = useThemeColors();
- const [modeSheetOpen, setModeSheetOpen] = useState(false);
- const [configSheetOpen, setConfigSheetOpen] = useState(false);
- const fastModeFlagEnabled = !!useFeatureFlag(FAST_MODE_FLAG);
-
- const executionModes = getMobileExecutionModes(
- getAvailableModesForAdapter(adapter),
- );
- const modelConfigOption = getModelConfigOption(configOptions);
- // A running session locks the adapter, so hide the other harness's models —
- // picking one on a live session would push an invalid model to the run.
- const mobileModelGroups = useMemo(() => {
- const filtered = canChangeAdapter
- ? modelGroups
- : modelGroups
- .map((group) => ({
- ...group,
- options: group.options.filter(
- (option) =>
- harnessForModel(modelGroups, option.value) === adapter,
- ),
- }))
- .filter((group) => group.options.length > 0);
- return toMobileModelGroups(filtered);
- }, [modelGroups, canChangeAdapter, adapter]);
- const reasoningOptions = getReasoningEffortOptions(adapter, model) ?? [];
- const presets = useMemo(
- () => getAgentPresets(adapter, modelConfigOption),
- [adapter, modelConfigOption],
- );
-
- const modelLabel = findModelOptionInGroups(modelGroups, model)?.name ?? model;
- const effortLabel =
- reasoningOptions.find((option) => option.value === reasoning)?.name ??
- reasoning;
- const configLabel =
- reasoningOptions.length > 0 ? `${modelLabel} · ${effortLabel}` : modelLabel;
-
- const fastModeAvailable =
- fastModeFlagEnabled && adapter === "claude" && supportsFastMode(model);
- const fastActive = fastModeAvailable && fastMode;
- const contextWindowAvailable = supports1MContext(model);
-
- const applyPreset = (preset: AgentPreset) => {
- if (preset.model !== model) onModelChange(preset.model);
- if (preset.effort !== reasoning) onReasoningChange(preset.effort);
- };
-
- const handleModelChange = (next: string) => {
- const pickedHarness = harnessForModel(modelGroups, next);
- if (pickedHarness !== adapter) {
- onAdapterChange(resolveCrossHarnessModelSelection(pickedHarness, next));
- return;
- }
- onModelChange(next);
- };
-
- const handleReset = () => {
- const middle = getMiddlePreset(presets);
- if (middle) applyPreset(middle);
- if (contextWindow !== DEFAULT_CONTEXT_WINDOW) {
- onContextWindowChange(DEFAULT_CONTEXT_WINDOW);
- }
- if (fastMode) onFastModeChange(false);
- };
-
- return (
- <>
- <Pill
- icon={modeIcon(
- mode,
- mode === "plan" ? themeColors.accent[11] : themeColors.gray[11],
- )}
- label={
- executionModes.find((option) => option.id === mode)?.name ?? mode
- }
- accent={mode === "plan"}
- onPress={() => setModeSheetOpen(true)}
- />
-
- <Pill
- icon={
- fastActive ? (
- <Lightning
- size={14}
- color={themeColors.status.warning}
- weight="fill"
- />
- ) : adapter === "codex" ? (
- <Cpu size={14} color={themeColors.gray[11]} />
- ) : (
- <Robot size={14} color={themeColors.gray[11]} />
- )
- }
- label={configLabel}
- onPress={() => setConfigSheetOpen(true)}
- />
-
- <SelectSheet
- open={modeSheetOpen}
- title="Execution mode"
- value={mode}
- onChange={(value) => onModeChange(value as ExecutionMode)}
- onClose={() => setModeSheetOpen(false)}
- options={executionModes.map((option) => ({
- value: option.id,
- label: option.name,
- description: option.description,
- icon: modeIcon(
- option.id as ExecutionMode,
- option.id === "plan"
- ? themeColors.accent[11]
- : themeColors.gray[11],
- 16,
- ),
- }))}
- />
-
- <AgentConfigSheet
- open={configSheetOpen}
- onClose={() => setConfigSheetOpen(false)}
- model={model}
- reasoning={reasoning}
- contextWindow={contextWindow}
- fastMode={fastActive}
- presets={presets}
- reasoningOptions={reasoningOptions}
- modelGroups={mobileModelGroups}
- fastModeAvailable={fastModeAvailable}
- contextWindowAvailable={contextWindowAvailable}
- onSelectPreset={applyPreset}
- onModelChange={handleModelChange}
- onReasoningChange={onReasoningChange}
- onFastModeChange={onFastModeChange}
- onContextWindowChange={onContextWindowChange}
- onReset={handleReset}
- />
- </>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/composer/AgentConfigSheet.tsx b/products/desktop/apps/mobile/src/features/tasks/composer/AgentConfigSheet.tsx
deleted file mode 100644
index a8315a897cc1..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/composer/AgentConfigSheet.tsx
+++ /dev/null
@@ -1,264 +0,0 @@
-import { Text } from "@components/text";
-import type { SupportedReasoningEffort } from "@posthog/shared";
-import {
- ArrowCounterClockwise,
- CaretDown,
- Check,
- Lightning,
-} from "phosphor-react-native";
-import { Fragment, useState } from "react";
-import { Pressable, ScrollView, Switch, View } from "react-native";
-import { SheetContainer } from "@/components/SheetContainer";
-import { useThemeColors } from "@/lib/theme";
-import type { AgentPreset, ContextWindow, MobileModelGroup } from "./options";
-
-interface AgentConfigSheetProps {
- open: boolean;
- onClose: () => void;
- model: string;
- reasoning: SupportedReasoningEffort;
- contextWindow: ContextWindow;
- fastMode: boolean;
- presets: AgentPreset[];
- reasoningOptions: ReadonlyArray<{ value: string; name: string }>;
- modelGroups: MobileModelGroup[];
- fastModeAvailable: boolean;
- contextWindowAvailable: boolean;
- onSelectPreset: (preset: AgentPreset) => void;
- onModelChange: (model: string) => void;
- onReasoningChange: (value: SupportedReasoningEffort) => void;
- onFastModeChange: (enabled: boolean) => void;
- onContextWindowChange: (value: ContextWindow) => void;
- onReset: () => void;
-}
-
-function SectionLabel({ children }: { children: string }) {
- return (
- <Text className="px-4 pt-4 pb-1 font-medium text-[12px] text-gray-10 uppercase tracking-wide">
- {children}
- </Text>
- );
-}
-
-function GroupHeader({ children }: { children: string }) {
- return (
- <Text className="px-4 pt-3 pb-1 font-medium text-[11px] text-gray-10 uppercase tracking-wide">
- {children}
- </Text>
- );
-}
-
-function Row({
- label,
- description,
- selected,
- onPress,
-}: {
- label: string;
- description?: string;
- selected: boolean;
- onPress: () => void;
-}) {
- const themeColors = useThemeColors();
- return (
- <Pressable
- onPress={onPress}
- className="flex-row items-center gap-3 px-4 py-2.5 active:bg-gray-2"
- >
- <View className="min-w-0 flex-1">
- <Text className="text-[15px] text-gray-12">{label}</Text>
- {description ? (
- <Text className="mt-0.5 text-[12px] text-gray-10">{description}</Text>
- ) : null}
- </View>
- {selected ? (
- <Check size={16} color={themeColors.accent[9]} weight="bold" />
- ) : null}
- </Pressable>
- );
-}
-
-function Segmented<T extends string>({
- value,
- options,
- onChange,
-}: {
- value: T;
- options: ReadonlyArray<{ value: T; label: string }>;
- onChange: (value: T) => void;
-}) {
- return (
- <View className="mx-4 mt-1 mb-1 flex-row gap-1 rounded-lg bg-gray-3 p-1">
- {options.map((option) => {
- const active = option.value === value;
- return (
- <Pressable
- key={option.value}
- onPress={() => onChange(option.value)}
- className={`flex-1 items-center rounded-md py-1.5 ${
- active ? "bg-background" : "active:opacity-60"
- }`}
- >
- <Text
- className={`text-[13px] ${
- active ? "font-medium text-gray-12" : "text-gray-11"
- }`}
- >
- {option.label}
- </Text>
- </Pressable>
- );
- })}
- </View>
- );
-}
-
-export function AgentConfigSheet({
- open,
- onClose,
- model,
- reasoning,
- contextWindow,
- fastMode,
- presets,
- reasoningOptions,
- modelGroups,
- fastModeAvailable,
- contextWindowAvailable,
- onSelectPreset,
- onModelChange,
- onReasoningChange,
- onFastModeChange,
- onContextWindowChange,
- onReset,
-}: AgentConfigSheetProps) {
- const themeColors = useThemeColors();
- const [advancedOpen, setAdvancedOpen] = useState(false);
- const showGroupHeaders = modelGroups.length > 1;
-
- return (
- <SheetContainer open={open} onClose={onClose}>
- <View className="flex-row items-center justify-between px-4 pt-2 pb-1">
- <Text className="font-semibold text-[16px] text-gray-12">
- Model & reasoning
- </Text>
- {fastModeAvailable ? (
- <View className="flex-row items-center gap-2">
- <Lightning
- size={15}
- color={
- fastMode ? themeColors.status.warning : themeColors.gray[10]
- }
- weight={fastMode ? "fill" : "regular"}
- />
- <Text className="text-[13px] text-gray-11">Fast</Text>
- <Switch value={fastMode} onValueChange={onFastModeChange} />
- </View>
- ) : null}
- </View>
-
- <ScrollView className="max-h-[70vh]">
- {presets.length > 0 ? (
- <>
- <View className="flex-row items-center justify-between px-4 pt-3">
- <Text className="text-[12px] text-gray-10">Faster</Text>
- <Text className="text-[12px] text-gray-10">Smarter</Text>
- </View>
- {presets.map((preset) => {
- const selected =
- preset.model === model && preset.effort === reasoning;
- return (
- <Row
- key={`${preset.model}:${preset.effort}`}
- label={`${preset.modelLabel} · ${preset.effortLabel}`}
- selected={selected}
- onPress={() => onSelectPreset(preset)}
- />
- );
- })}
- </>
- ) : null}
-
- {contextWindowAvailable ? (
- <>
- <SectionLabel>Context window</SectionLabel>
- <Segmented
- value={contextWindow}
- onChange={onContextWindowChange}
- options={[
- { value: "200k", label: "200k" },
- { value: "1m", label: "1M" },
- ]}
- />
- </>
- ) : null}
-
- <Pressable
- onPress={() => setAdvancedOpen((prev) => !prev)}
- className="mt-4 flex-row items-center gap-1.5 px-4 py-2 active:opacity-60"
- >
- <CaretDown
- size={12}
- color={themeColors.gray[10]}
- style={{
- transform: [{ rotate: advancedOpen ? "0deg" : "-90deg" }],
- }}
- />
- <Text className="font-medium text-[13px] text-gray-11">Advanced</Text>
- </Pressable>
-
- {advancedOpen ? (
- <>
- <SectionLabel>Model</SectionLabel>
- {modelGroups.map((group) => (
- <Fragment key={group.key}>
- {showGroupHeaders ? (
- <GroupHeader>{group.name}</GroupHeader>
- ) : null}
- {group.options.map((option) => (
- <Row
- key={option.value}
- label={option.label}
- description={
- option.disabled ? "Upgrade required" : option.description
- }
- selected={option.value === model}
- onPress={() => {
- if (!option.disabled) onModelChange(option.value);
- }}
- />
- ))}
- </Fragment>
- ))}
-
- {reasoningOptions.length > 0 ? (
- <>
- <SectionLabel>Reasoning</SectionLabel>
- {reasoningOptions.map((option) => (
- <Row
- key={option.value}
- label={option.name}
- selected={option.value === reasoning}
- onPress={() =>
- onReasoningChange(
- option.value as SupportedReasoningEffort,
- )
- }
- />
- ))}
- </>
- ) : null}
-
- <Pressable
- onPress={onReset}
- className="mt-2 mb-2 flex-row items-center gap-2 px-4 py-3 active:bg-gray-2"
- >
- <ArrowCounterClockwise size={14} color={themeColors.gray[11]} />
- <Text className="text-[15px] text-gray-11">Reset to default</Text>
- </Pressable>
- </>
- ) : null}
- </ScrollView>
- </SheetContainer>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/composer/DotBackground.tsx b/products/desktop/apps/mobile/src/features/tasks/composer/DotBackground.tsx
deleted file mode 100644
index 84643ec3ea9d..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/composer/DotBackground.tsx
+++ /dev/null
@@ -1,23 +0,0 @@
-import { StyleSheet, View } from "react-native";
-import Svg, { Circle, Defs, Pattern, Rect } from "react-native-svg";
-import { useThemeColors } from "@/lib/theme";
-
-/**
- * Subtle tileable dot grid background, matching the desktop new-task screen.
- * Renders absolute-fill behind the composer.
- */
-export function DotBackground() {
- const colors = useThemeColors();
- return (
- <View pointerEvents="none" style={StyleSheet.absoluteFillObject}>
- <Svg width="100%" height="100%">
- <Defs>
- <Pattern id="dots" patternUnits="userSpaceOnUse" width={8} height={8}>
- <Circle cx={0.8} cy={0.8} r={0.6} fill={colors.gray[6]} />
- </Pattern>
- </Defs>
- <Rect width="100%" height="100%" fill="url(#dots)" />
- </Svg>
- </View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/composer/Pill.tsx b/products/desktop/apps/mobile/src/features/tasks/composer/Pill.tsx
deleted file mode 100644
index 94446f377059..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/composer/Pill.tsx
+++ /dev/null
@@ -1,49 +0,0 @@
-import { Text } from "@components/text";
-import { CaretDown } from "phosphor-react-native";
-import type { ReactNode } from "react";
-import { Pressable, View } from "react-native";
-import { useThemeColors } from "@/lib/theme";
-
-interface PillProps {
- icon?: ReactNode;
- label: string;
- /** Optional secondary muted label, e.g. placeholder text "Select…". */
- placeholder?: boolean;
- /** Tone the label in accent (used for Plan Mode in the desktop). */
- accent?: boolean;
- onPress?: () => void;
- disabled?: boolean;
-}
-
-export function Pill({
- icon,
- label,
- placeholder,
- accent,
- onPress,
- disabled = false,
-}: PillProps) {
- const themeColors = useThemeColors();
- return (
- <Pressable
- onPress={onPress}
- disabled={disabled}
- className="flex-row items-center gap-1.5 rounded-md border border-gray-6 bg-card px-2.5 py-1.5 active:bg-gray-3"
- >
- {icon ? <View className="shrink-0">{icon}</View> : null}
- <Text
- className={`shrink text-[13px] ${
- placeholder
- ? "text-gray-10"
- : accent
- ? "font-medium text-accent-11"
- : "text-gray-12"
- }`}
- numberOfLines={1}
- >
- {label}
- </Text>
- {disabled ? null : <CaretDown size={12} color={themeColors.gray[10]} />}
- </Pressable>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/composer/QueuedMessagesDock.tsx b/products/desktop/apps/mobile/src/features/tasks/composer/QueuedMessagesDock.tsx
deleted file mode 100644
index 7b17729167c0..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/composer/QueuedMessagesDock.tsx
+++ /dev/null
@@ -1,224 +0,0 @@
-import { Text } from "@components/text";
-import {
- CaretDown,
- CaretUp,
- Lightning,
- PaperclipIcon,
- PencilSimple,
- Stack,
- Trash,
-} from "phosphor-react-native";
-import { type ReactNode, useState } from "react";
-import { Pressable, View } from "react-native";
-import { SheetContainer } from "@/components/SheetContainer";
-import { useThemeColors } from "@/lib/theme";
-import {
- type MoveDirection,
- type QueuedMessage,
- useMessageQueueStore,
-} from "../stores/messageQueueStore";
-
-interface QueuedMessagesDockProps {
- taskId: string;
- canSteer: boolean;
- onSteer: (message: QueuedMessage) => void;
- onEdit: (message: QueuedMessage) => void;
- onDiscard: (message: QueuedMessage) => void;
- onMove: (message: QueuedMessage, direction: MoveDirection) => void;
-}
-
-function previewText(message: QueuedMessage): string {
- if (message.content.trim().length > 0) return message.content;
- const count = message.attachments.length;
- return count === 1 ? "1 attachment" : `${count} attachments`;
-}
-
-export function QueuedMessagesDock({
- taskId,
- canSteer,
- onSteer,
- onEdit,
- onDiscard,
- onMove,
-}: QueuedMessagesDockProps) {
- const themeColors = useThemeColors();
- const queued = useMessageQueueStore((s) => s.queuesByTaskId[taskId]);
- const editingId = useMessageQueueStore((s) => s.editingByTaskId[taskId]);
- const [activeId, setActiveId] = useState<string | null>(null);
-
- if (!queued || queued.length === 0) return null;
- const active = queued.find((m) => m.id === activeId) ?? null;
-
- return (
- <>
- <View className="gap-1 px-3 pb-2">
- {queued.map((message, index) => {
- const isEditing = message.id === editingId;
- return (
- <View
- key={message.id}
- className={`flex-row items-center gap-2 rounded-xl border px-3 py-2 ${
- isEditing
- ? "border-accent-7 bg-accent-2"
- : "border-gray-6 bg-card"
- }`}
- >
- <Pressable
- onPress={() => setActiveId(message.id)}
- accessibilityRole="button"
- accessibilityLabel="Queued message actions"
- className="min-w-0 flex-1 flex-row items-center gap-2 active:opacity-70"
- >
- <Stack size={14} color={themeColors.gray[10]} />
- <Text
- numberOfLines={1}
- className="flex-1 text-[13px] text-gray-11"
- >
- {previewText(message)}
- </Text>
- {message.attachments.length > 0 ? (
- <PaperclipIcon size={13} color={themeColors.gray[9]} />
- ) : null}
- <Text
- className={`text-[11px] ${
- isEditing ? "text-accent-11" : "text-gray-9"
- }`}
- >
- {isEditing ? "Editing" : "Queued"}
- </Text>
- </Pressable>
- <View className="flex-row items-center">
- <ReorderButton
- icon={<CaretUp size={16} color={themeColors.gray[11]} />}
- label="Move up"
- disabled={index === 0}
- onPress={() => onMove(message, "up")}
- />
- <ReorderButton
- icon={<CaretDown size={16} color={themeColors.gray[11]} />}
- label="Move down"
- disabled={index === queued.length - 1}
- onPress={() => onMove(message, "down")}
- />
- </View>
- </View>
- );
- })}
- </View>
-
- <SheetContainer open={active !== null} onClose={() => setActiveId(null)}>
- {active ? (
- <>
- <View className="px-4 pt-2 pb-3">
- <Text numberOfLines={3} className="text-[14px] text-gray-12">
- {previewText(active)}
- </Text>
- </View>
- {canSteer ? (
- <ActionRow
- icon={
- <Lightning
- size={18}
- color={themeColors.accent[11]}
- weight="fill"
- />
- }
- label="Steer now"
- description="Interrupt the current turn and send this now"
- onPress={() => {
- onSteer(active);
- setActiveId(null);
- }}
- />
- ) : null}
- <ActionRow
- icon={<PencilSimple size={18} color={themeColors.gray[11]} />}
- label="Edit in place"
- description="Revise it in the composer; it keeps its place in the queue"
- onPress={() => {
- onEdit(active);
- setActiveId(null);
- }}
- />
- <ActionRow
- icon={<Trash size={18} color={themeColors.status.error} />}
- label="Discard"
- destructive
- onPress={() => {
- onDiscard(active);
- setActiveId(null);
- }}
- />
- </>
- ) : null}
- </SheetContainer>
- </>
- );
-}
-
-function ReorderButton({
- icon,
- label,
- disabled,
- onPress,
-}: {
- icon: ReactNode;
- label: string;
- disabled: boolean;
- onPress: () => void;
-}) {
- return (
- <Pressable
- onPress={onPress}
- disabled={disabled}
- hitSlop={6}
- accessibilityRole="button"
- accessibilityLabel={label}
- accessibilityState={{ disabled }}
- className={`h-8 w-8 items-center justify-center rounded-lg active:bg-gray-3 ${
- disabled ? "opacity-30" : ""
- }`}
- >
- {icon}
- </Pressable>
- );
-}
-
-function ActionRow({
- icon,
- label,
- description,
- destructive = false,
- onPress,
-}: {
- icon: ReactNode;
- label: string;
- description?: string;
- destructive?: boolean;
- onPress: () => void;
-}) {
- return (
- <Pressable
- onPress={onPress}
- accessibilityRole="button"
- accessibilityLabel={label}
- className="flex-row items-center gap-3 px-4 py-3 active:bg-gray-2"
- >
- <View className="h-5 w-5 shrink-0 items-center justify-center">
- {icon}
- </View>
- <View className="min-w-0 flex-1">
- <Text
- className={`font-medium text-[15px] ${
- destructive ? "text-status-error" : "text-gray-12"
- }`}
- >
- {label}
- </Text>
- {description ? (
- <Text className="mt-0.5 text-[12px] text-gray-10">{description}</Text>
- ) : null}
- </View>
- </Pressable>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/composer/RepositoryPickerInline.tsx b/products/desktop/apps/mobile/src/features/tasks/composer/RepositoryPickerInline.tsx
deleted file mode 100644
index 861ff3b45a9e..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/composer/RepositoryPickerInline.tsx
+++ /dev/null
@@ -1,221 +0,0 @@
-import { Text } from "@components/text";
-import { ArrowsClockwise, Check, MagnifyingGlass } from "phosphor-react-native";
-import { useEffect, useMemo, useRef, useState } from "react";
-import {
- ActivityIndicator,
- FlatList,
- Pressable,
- TextInput,
- View,
-} from "react-native";
-import Animated, {
- Easing,
- useAnimatedStyle,
- useSharedValue,
- withTiming,
-} from "react-native-reanimated";
-import { useThemeColors } from "@/lib/theme";
-import type { RepositoryOption } from "../types";
-
-interface RepositoryPickerInlineProps {
- open: boolean;
- repositoryOptions: RepositoryOption[];
- selected: RepositoryOption | null;
- /** True when we have no data to show yet (no cache, fresh fetch in flight).
- * Mutually exclusive with `isRefreshing` from the caller's perspective. */
- loading?: boolean;
- /** True when we're rendering cached data while a background refetch runs.
- * Surfaces as a small spinner badge instead of a blocking state. */
- isRefreshing?: boolean;
- onChange: (option: RepositoryOption) => void;
- onClose: () => void;
-}
-
-/**
- * Inline repository picker that pops up above the composer with a quick
- * fade + lift animation. Lives in the screen tree (no Modal) so it stays
- * with the layout when the keyboard moves, and feels more like a dropdown
- * than a bottom sheet. Tap a row to select; tap outside the card (handled
- * by the caller's backdrop) or onClose to dismiss.
- */
-export function RepositoryPickerInline({
- open,
- repositoryOptions,
- selected,
- loading,
- isRefreshing,
- onChange,
- onClose,
-}: RepositoryPickerInlineProps) {
- const themeColors = useThemeColors();
- const [search, setSearch] = useState("");
- const searchInputRef = useRef<TextInput>(null);
-
- // Reset the search on each open so the user starts with the full list.
- useEffect(() => {
- if (open) {
- setSearch("");
- // Focusing the search lets the user type immediately. Slight delay
- // gives the popover its animation frame so the keyboard rise feels
- // synced with the popover entrance.
- const t = setTimeout(() => searchInputRef.current?.focus(), 80);
- return () => clearTimeout(t);
- }
- }, [open]);
-
- // Entrance/exit animation — fade + small upward translate so it reads as
- // a dropdown popping out of the pill rather than a slide-in sheet.
- const progress = useSharedValue(0);
- useEffect(() => {
- progress.value = withTiming(open ? 1 : 0, {
- duration: open ? 160 : 120,
- easing: Easing.out(Easing.cubic),
- });
- }, [open, progress]);
-
- const cardStyle = useAnimatedStyle(() => ({
- opacity: progress.value,
- transform: [{ translateY: (1 - progress.value) * 8 }],
- }));
-
- const filtered = useMemo(() => {
- const q = search.trim().toLowerCase();
- if (!q) return repositoryOptions;
- return repositoryOptions.filter(
- (option) =>
- option.repository.toLowerCase().includes(q) ||
- option.integrationLabel.toLowerCase().includes(q),
- );
- }, [repositoryOptions, search]);
-
- // Keep the popover mounted briefly after `open` flips to false so the
- // exit animation can play. Unmount after the animation duration.
- const [mounted, setMounted] = useState(open);
- useEffect(() => {
- if (open) {
- setMounted(true);
- return;
- }
- const t = setTimeout(() => setMounted(false), 140);
- return () => clearTimeout(t);
- }, [open]);
-
- const renderRow = (item: RepositoryOption) => {
- const isSelected =
- item.integrationId === selected?.integrationId &&
- item.repository === selected.repository;
- return (
- <Pressable
- key={`${item.integrationId}:${item.repository}`}
- onPress={() => {
- onChange(item);
- onClose();
- }}
- className={`flex-row items-center gap-2 px-3 py-2.5 active:bg-gray-2 ${
- isSelected ? "bg-accent-3" : ""
- }`}
- >
- <View className="min-w-0 flex-1">
- <Text
- className={`text-[13px] ${
- isSelected ? "text-accent-11" : "text-gray-12"
- }`}
- numberOfLines={1}
- >
- {item.repository}
- </Text>
- <Text className="mt-0.5 text-[11px] text-gray-10">
- {item.integrationLabel}
- </Text>
- </View>
- {isSelected ? (
- <Check size={14} color={themeColors.accent[9]} weight="bold" />
- ) : null}
- </Pressable>
- );
- };
-
- if (!mounted) return null;
-
- return (
- <Animated.View
- style={cardStyle}
- className="overflow-hidden rounded-2xl border border-gray-6 bg-card"
- >
- {/* Header: title + search + background-refresh indicator */}
- <View className="border-gray-6 border-b px-3 pt-3 pb-2">
- <View className="mb-2 flex-row items-center justify-between">
- <Text className="font-semibold text-[14px] text-gray-12">
- Repository
- </Text>
- <View className="flex-row items-center gap-2">
- {isRefreshing ? (
- <View className="flex-row items-center gap-1">
- <ArrowsClockwise size={11} color={themeColors.gray[9]} />
- <Text className="text-[11px] text-gray-9">Refreshing…</Text>
- </View>
- ) : null}
- <Pressable
- onPress={onClose}
- hitSlop={8}
- accessibilityLabel="Close repository picker"
- accessibilityRole="button"
- className="px-1 py-0.5 active:opacity-60"
- >
- <Text className="text-[12px] text-gray-10">Done</Text>
- </Pressable>
- </View>
- </View>
- <View className="flex-row items-center gap-2 rounded-md border border-gray-6 bg-gray-2 px-2.5 py-1.5">
- <MagnifyingGlass size={14} color={themeColors.gray[10]} />
- <TextInput
- ref={searchInputRef}
- className="flex-1 text-[13px] text-gray-12"
- placeholder="Search repositories"
- placeholderTextColor={themeColors.gray[9]}
- value={search}
- onChangeText={setSearch}
- autoCapitalize="none"
- autoCorrect={false}
- clearButtonMode="while-editing"
- returnKeyType="search"
- />
- </View>
- </View>
-
- {loading ? (
- <View className="items-center px-4 py-8">
- <ActivityIndicator size="small" color={themeColors.accent[9]} />
- <Text className="mt-2 text-[12px] text-gray-10">
- Loading repositories…
- </Text>
- </View>
- ) : filtered.length === 0 ? (
- <View className="items-center px-4 py-6">
- <Text className="text-center text-[13px] text-gray-10">
- {search
- ? `No repositories match “${search}”`
- : "No repositories available"}
- </Text>
- </View>
- ) : (
- // Windowing keeps the open animation snappy even when the user has
- // hundreds of repos, by only mounting the visible rows up front.
- <FlatList
- data={filtered}
- keyExtractor={(item) => `${item.integrationId}:${item.repository}`}
- keyboardShouldPersistTaps="handled"
- style={{ maxHeight: 240 }}
- contentContainerStyle={{ paddingVertical: 4 }}
- // Tuned so the first mount only pays for the rows the user
- // actually sees, then fills in lazily as they scroll.
- initialNumToRender={12}
- maxToRenderPerBatch={20}
- windowSize={5}
- removeClippedSubviews
- renderItem={({ item }) => renderRow(item)}
- />
- )}
- </Animated.View>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/composer/SelectSheet.tsx b/products/desktop/apps/mobile/src/features/tasks/composer/SelectSheet.tsx
deleted file mode 100644
index 2fb6daf18db1..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/composer/SelectSheet.tsx
+++ /dev/null
@@ -1,81 +0,0 @@
-import { Text } from "@components/text";
-import { Check } from "phosphor-react-native";
-import type { ReactNode } from "react";
-import { Pressable, ScrollView, View } from "react-native";
-import { SheetContainer } from "@/components/SheetContainer";
-import { useThemeColors } from "@/lib/theme";
-
-export interface SelectOption<T extends string> {
- value: T;
- label: string;
- description?: string;
- icon?: ReactNode;
- disabled?: boolean;
-}
-
-interface SelectSheetProps<T extends string> {
- open: boolean;
- title: string;
- options: SelectOption<T>[];
- value: T;
- onChange: (value: T) => void;
- onClose: () => void;
-}
-
-export function SelectSheet<T extends string>({
- open,
- title,
- options,
- value,
- onChange,
- onClose,
-}: SelectSheetProps<T>) {
- const themeColors = useThemeColors();
-
- return (
- <SheetContainer open={open} onClose={onClose}>
- <View className="px-4 pt-2 pb-2">
- <Text className="font-semibold text-[16px] text-gray-12">{title}</Text>
- </View>
-
- <ScrollView className="max-h-96">
- {options.map((option) => {
- const selected = option.value === value;
- return (
- <Pressable
- key={option.value}
- onPress={() => {
- if (option.disabled) return;
- onChange(option.value);
- onClose();
- }}
- disabled={option.disabled}
- className={`flex-row items-center gap-3 px-4 py-3 ${
- option.disabled ? "opacity-40" : "active:bg-gray-2"
- }`}
- >
- {option.icon ? (
- <View className="h-5 w-5 shrink-0 items-center justify-center">
- {option.icon}
- </View>
- ) : null}
- <View className="min-w-0 flex-1">
- <Text className="font-medium text-[15px] text-gray-12">
- {option.label}
- </Text>
- {option.description ? (
- <Text className="mt-0.5 text-[12px] text-gray-10">
- {option.description}
- </Text>
- ) : null}
- </View>
- {selected ? (
- <Check size={16} color={themeColors.accent[9]} weight="bold" />
- ) : null}
- </Pressable>
- );
- })}
- </ScrollView>
- </SheetContainer>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/composer/TaskChatComposer.tsx b/products/desktop/apps/mobile/src/features/tasks/composer/TaskChatComposer.tsx
deleted file mode 100644
index 57a555aa0af7..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/composer/TaskChatComposer.tsx
+++ /dev/null
@@ -1,499 +0,0 @@
-import { Text } from "@components/text";
-import { DEFAULT_CLAUDE_EXECUTION_MODE } from "@posthog/core/sessions/executionModes";
-import type { CloudComposerSelection } from "@posthog/core/task-detail/composerModelPolicy";
-import { resolveCloudComposerModelChange } from "@posthog/core/task-detail/composerModelPolicy";
-import {
- type Adapter,
- DEFAULT_GATEWAY_MODEL,
- DEFAULT_REASONING_EFFORT,
- type ExecutionMode,
- type SupportedReasoningEffort,
-} from "@posthog/shared";
-import * as Haptics from "expo-haptics";
-import {
- ArrowUp,
- Lightning,
- Microphone,
- PaperclipIcon,
- PencilIcon,
- Stack,
- Stop,
-} from "phosphor-react-native";
-import type { ReactNode } from "react";
-import { useCallback, useEffect, useRef, useState } from "react";
-import {
- ActivityIndicator,
- Alert,
- Keyboard,
- Pressable,
- ScrollView,
- TextInput,
- View,
-} from "react-native";
-import { useVoiceRecording } from "@/features/chat";
-import { useCloudTaskConfigOptions } from "@/features/tasks/hooks/useCloudTaskConfigOptions";
-import { logger } from "@/lib/logger";
-import { useThemeColors } from "@/lib/theme";
-import type { MessagingMode } from "../stores/messagingModeStore";
-import { AgentConfigControls } from "./AgentConfigControls";
-import { AttachmentSheet } from "./attachments/AttachmentSheet";
-import {
- type AttachmentStatus,
- AttachmentsBar,
-} from "./attachments/AttachmentsBar";
-import { attachmentPreparer } from "./attachments/buildCloudPrompt";
-import {
- captureFromCamera,
- pickDocument,
- pickPhotoFromLibrary,
-} from "./attachments/pickers";
-import type { PendingAttachment } from "./attachments/types";
-import {
- type ContextWindow,
- getModelConfigOption,
- resolveComposerPrimaryAction,
-} from "./options";
-import { Pill } from "./Pill";
-import {
- type ComposerContent,
- isComposerEmpty,
- submitComposerMessage,
-} from "./submitComposerMessage";
-
-const log = logger.scope("task-chat-composer");
-interface TaskChatComposerProps {
- onSend: (
- message: string,
- attachments: PendingAttachment[],
- ) => Promise<boolean>;
- onStop?: () => void;
- disabled?: boolean;
- placeholder?: string;
- initialMessage?: string;
- isUserTurn?: boolean;
- /** Current pill values (persisted per-task by the caller). */
- adapter: Adapter;
- mode: ExecutionMode;
- model: string;
- reasoning: SupportedReasoningEffort;
- contextWindow: ContextWindow;
- fastMode: boolean;
- onAdapterChange: (selection: CloudComposerSelection) => void;
- canChangeAdapter?: boolean;
- onModeChange: (mode: ExecutionMode) => void;
- onModelChange: (model: string) => void;
- onReasoningChange: (reasoning: SupportedReasoningEffort) => void;
- onContextWindowChange: (contextWindow: ContextWindow) => void;
- onFastModeChange: (enabled: boolean) => void;
- /** Steer vs Queue behaviour for messages sent while a turn is running. */
- messagingMode: MessagingMode;
- queuedCount: number;
- onToggleMessagingMode: () => void;
- /** A queued message pulled back for editing; pass a fresh object to restore. */
- restoredDraft?: { text: string; attachments: PendingAttachment[] };
- /** True while editing a queued message in place; the next send saves it. */
- editing?: boolean;
- onCancelEdit?: () => void;
- /** Run artifacts trigger, rendered in the composer toolbar row. */
- artifactsSlot?: ReactNode;
-}
-
-export function TaskChatComposer({
- onSend,
- onStop,
- disabled = false,
- placeholder = "Ask a question",
- initialMessage,
- isUserTurn = false,
- adapter,
- mode,
- model,
- reasoning,
- contextWindow,
- fastMode,
- onAdapterChange,
- canChangeAdapter = true,
- onModeChange,
- onModelChange,
- onReasoningChange,
- onContextWindowChange,
- onFastModeChange,
- messagingMode,
- queuedCount,
- onToggleMessagingMode,
- restoredDraft,
- editing = false,
- onCancelEdit,
- artifactsSlot,
-}: TaskChatComposerProps) {
- const themeColors = useThemeColors();
- const { configOptions, modelGroups, hasLiveConfig } =
- useCloudTaskConfigOptions(adapter, model);
- const modelConfigOption = getModelConfigOption(configOptions);
- const [message, setMessage] = useState(() => initialMessage ?? "");
- const [attachments, setAttachments] = useState<PendingAttachment[]>([]);
- const [attachmentStatus, setAttachmentStatus] = useState<
- Record<string, AttachmentStatus>
- >({});
- const [attachmentSheetOpen, setAttachmentSheetOpen] = useState(false);
-
- // Mirror composer state into refs so a failed send can read the current
- // value after awaiting, rather than the value captured when it was sent.
- const messageRef = useRef(message);
- messageRef.current = message;
- const attachmentsRef = useRef(attachments);
- attachmentsRef.current = attachments;
- const submissionRef = useRef(0);
-
- const clearStatus = useCallback((id: string) => {
- setAttachmentStatus((prev) => {
- if (!(id in prev)) return prev;
- const { [id]: _dropped, ...rest } = prev;
- return rest;
- });
- }, []);
-
- // Encode eagerly so oversized/unsupported files fail at attach, not send.
- const beginPreparing = useCallback(
- (att: PendingAttachment) => {
- setAttachmentStatus((prev) => ({ ...prev, [att.id]: "preparing" }));
- attachmentPreparer.prepare(att).then(
- () => {
- if (attachmentsRef.current.some((a) => a.id === att.id)) {
- clearStatus(att.id);
- }
- },
- (error: unknown) => {
- if (!attachmentsRef.current.some((a) => a.id === att.id)) return;
- setAttachmentStatus((prev) => ({ ...prev, [att.id]: "error" }));
- Alert.alert(
- "Attachment can't be sent",
- error instanceof Error
- ? error.message
- : "This file couldn't be prepared. Remove it and try another.",
- );
- },
- );
- },
- [clearStatus],
- );
-
- const loadAttachments = useCallback(
- (next: PendingAttachment[]) => {
- setAttachments(next);
- setAttachmentStatus({});
- for (const att of next) beginPreparing(att);
- },
- [beginPreparing],
- );
-
- useEffect(() => {
- if (!initialMessage) return;
- setMessage(initialMessage);
- }, [initialMessage]);
-
- useEffect(() => {
- if (!restoredDraft) return;
- setMessage(restoredDraft.text);
- loadAttachments(restoredDraft.attachments);
- }, [restoredDraft, loadAttachments]);
-
- useEffect(
- () => () => {
- for (const att of attachmentsRef.current) {
- attachmentPreparer.forget(att.id);
- }
- },
- [],
- );
-
- useEffect(() => {
- if (!hasLiveConfig) return;
- const next = resolveCloudComposerModelChange({
- adapter,
- modelOption: modelConfigOption,
- requestedModel: model,
- reasoning,
- });
- if (next.model !== model) onModelChange(next.model);
- if (next.reasoning !== reasoning) onReasoningChange(next.reasoning);
- }, [
- adapter,
- hasLiveConfig,
- model,
- modelConfigOption,
- onModelChange,
- onReasoningChange,
- reasoning,
- ]);
-
- const appendTranscript = useCallback((transcript: string) => {
- setMessage((prev) => (prev ? `${prev} ${transcript}` : transcript));
- }, []);
-
- const { status, startRecording, stopRecording, cancelRecording } =
- useVoiceRecording({ onTranscript: appendTranscript });
-
- const isRecording = status === "recording";
- const isTranscribing = status === "transcribing";
-
- const hasContent = !isComposerEmpty({ text: message, attachments });
- const statuses = Object.values(attachmentStatus);
- const attachmentsPreparing = statuses.includes("preparing");
- const sendBlocked = attachmentsPreparing || statuses.includes("error");
- const primaryAction = resolveComposerPrimaryAction({
- hasContent,
- disabled: disabled || sendBlocked,
- isRecording,
- isTranscribing,
- canStop: !isUserTurn && !!onStop,
- allowSendWhileRunning: true,
- });
- const canSend = primaryAction === "send";
- const showStop = primaryAction === "stop";
-
- const applyContent = (content: ComposerContent) => {
- setMessage(content.text);
- loadAttachments(content.attachments);
- };
-
- const handleSend = () => {
- if (!hasContent || disabled) return;
- const submitted: ComposerContent = { text: message.trim(), attachments };
- const submissionId = ++submissionRef.current;
- Keyboard.dismiss();
- void submitComposerMessage({
- submitted,
- clear: () => applyContent({ text: "", attachments: [] }),
- send: () => onSend(submitted.text, submitted.attachments),
- isLatestSubmission: () => submissionId === submissionRef.current,
- isEmpty: () =>
- isComposerEmpty({
- text: messageRef.current,
- attachments: attachmentsRef.current,
- }),
- restore: applyContent,
- });
- };
-
- const addAttachment = async (
- picker: () => Promise<PendingAttachment | null>,
- ) => {
- try {
- const att = await picker();
- if (att) {
- setAttachments((prev) => [...prev, att]);
- beginPreparing(att);
- }
- } catch (err) {
- log.error("Failed to pick attachment", err);
- }
- };
-
- const removeAttachment = (id: string) => {
- setAttachments((prev) => prev.filter((a) => a.id !== id));
- attachmentPreparer.forget(id);
- clearStatus(id);
- };
-
- const handleMicPress = async () => {
- if (isRecording) {
- await stopRecording();
- } else if (!isTranscribing) {
- await startRecording();
- }
- };
-
- const handleMicLongPress = async () => {
- if (isRecording) {
- await cancelRecording();
- }
- };
-
- const handleStop = () => {
- Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium);
- onStop?.();
- };
-
- const isSteer = messagingMode === "steer";
- const messagingModeLabel = isSteer
- ? "Steer"
- : queuedCount > 0
- ? `Queue (${queuedCount})`
- : "Queue";
-
- const handleToggleMessagingMode = () => {
- Haptics.selectionAsync();
- onToggleMessagingMode();
- };
-
- return (
- <>
- <View className="px-4">
- <View style={{ width: "100%", maxWidth: 600, alignSelf: "center" }}>
- <View className="overflow-hidden rounded-lg border border-gray-6 bg-card">
- {editing ? (
- <View className="flex-row items-center gap-2 border-gray-6 border-b bg-accent-2 px-3 py-2">
- <PencilIcon size={14} color={themeColors.accent[11]} />
- <Text className="flex-1 text-[12px] text-accent-11">
- Editing queued message
- </Text>
- <Pressable
- hitSlop={8}
- onPress={onCancelEdit}
- accessibilityRole="button"
- accessibilityLabel="Cancel editing"
- className="active:opacity-60"
- >
- <Text className="font-medium text-[12px] text-gray-11">
- Cancel
- </Text>
- </Pressable>
- </View>
- ) : null}
- <AttachmentsBar
- attachments={attachments}
- onRemove={removeAttachment}
- statuses={attachmentStatus}
- />
- <TextInput
- className="px-4 pt-3.5 pb-3 text-[15px] text-gray-12"
- style={{ minHeight: 64, maxHeight: 200 }}
- placeholder={
- isRecording
- ? "Recording..."
- : isTranscribing
- ? "Transcribing..."
- : placeholder
- }
- placeholderTextColor={themeColors.gray[9]}
- value={message}
- onChangeText={setMessage}
- editable={!disabled && !isRecording}
- multiline
- textAlignVertical="top"
- />
-
- <View className="flex-row items-center gap-2 px-2 pb-2">
- <Pressable
- hitSlop={8}
- onPress={() => setAttachmentSheetOpen(true)}
- disabled={disabled || isRecording}
- accessibilityLabel="Add attachment"
- accessibilityRole="button"
- className="h-9 w-9 items-center justify-center active:opacity-60"
- >
- <PaperclipIcon
- size={18}
- color={
- attachments.length > 0
- ? themeColors.accent[11]
- : themeColors.gray[10]
- }
- weight={attachments.length > 0 ? "fill" : "regular"}
- />
- </Pressable>
-
- {artifactsSlot}
-
- <ScrollView
- horizontal
- showsHorizontalScrollIndicator={false}
- keyboardShouldPersistTaps="handled"
- className="flex-1"
- contentContainerStyle={{
- alignItems: "center",
- gap: 6,
- paddingRight: 4,
- }}
- >
- <AgentConfigControls
- adapter={adapter}
- mode={mode}
- model={model}
- reasoning={reasoning}
- contextWindow={contextWindow}
- fastMode={fastMode}
- configOptions={configOptions}
- modelGroups={modelGroups}
- onAdapterChange={onAdapterChange}
- onModeChange={onModeChange}
- onModelChange={onModelChange}
- onReasoningChange={onReasoningChange}
- onContextWindowChange={onContextWindowChange}
- onFastModeChange={onFastModeChange}
- canChangeAdapter={canChangeAdapter}
- />
-
- <Pill
- icon={
- isSteer ? (
- <Lightning
- size={14}
- color={themeColors.accent[11]}
- weight="fill"
- />
- ) : (
- <Stack size={14} color={themeColors.gray[11]} />
- )
- }
- label={messagingModeLabel}
- accent={isSteer}
- onPress={handleToggleMessagingMode}
- />
- </ScrollView>
-
- <Pressable
- onPress={
- canSend ? handleSend : showStop ? handleStop : handleMicPress
- }
- onLongPress={handleMicLongPress}
- disabled={isTranscribing || disabled || sendBlocked}
- className={`h-9 w-9 items-center justify-center rounded-lg ${
- canSend ? "bg-gray-12" : "bg-gray-3"
- }`}
- >
- {isTranscribing || attachmentsPreparing ? (
- <ActivityIndicator
- size="small"
- color={themeColors.gray[12]}
- />
- ) : canSend || sendBlocked ? (
- <ArrowUp
- size={18}
- color={
- canSend ? themeColors.background : themeColors.gray[9]
- }
- weight="bold"
- />
- ) : isRecording || showStop ? (
- <Stop
- size={18}
- color={themeColors.status.error}
- weight="fill"
- />
- ) : (
- <Microphone size={18} color={themeColors.gray[12]} />
- )}
- </Pressable>
- </View>
- </View>
- </View>
- </View>
-
- <AttachmentSheet
- open={attachmentSheetOpen}
- onClose={() => setAttachmentSheetOpen(false)}
- onPickPhoto={() => addAttachment(pickPhotoFromLibrary)}
- onPickCamera={() => addAttachment(captureFromCamera)}
- onPickDocument={() => addAttachment(pickDocument)}
- />
- </>
- );
-}
-
-export const TASK_CHAT_DEFAULTS = {
- mode: DEFAULT_CLAUDE_EXECUTION_MODE,
- model: DEFAULT_GATEWAY_MODEL,
- reasoning: DEFAULT_REASONING_EFFORT,
-} as const;
diff --git a/products/desktop/apps/mobile/src/features/tasks/composer/attachments/AttachmentSheet.tsx b/products/desktop/apps/mobile/src/features/tasks/composer/attachments/AttachmentSheet.tsx
deleted file mode 100644
index 6bfb44badcae..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/composer/attachments/AttachmentSheet.tsx
+++ /dev/null
@@ -1,87 +0,0 @@
-import { Text } from "@components/text";
-import { Camera, FileText, Image as ImageIcon } from "phosphor-react-native";
-import { Pressable, View } from "react-native";
-import { SheetContainer } from "@/components/SheetContainer";
-import { useThemeColors } from "@/lib/theme";
-
-interface AttachmentSheetProps {
- open: boolean;
- onClose: () => void;
- onPickPhoto: () => void;
- onPickCamera: () => void;
- onPickDocument: () => void;
-}
-
-interface RowProps {
- icon: React.ReactNode;
- label: string;
- description: string;
- onPress: () => void;
-}
-
-function Row({ icon, label, description, onPress }: RowProps) {
- return (
- <Pressable
- onPress={onPress}
- className="flex-row items-center gap-3 px-4 py-3 active:bg-gray-2"
- >
- <View className="h-9 w-9 shrink-0 items-center justify-center rounded-full bg-gray-3">
- {icon}
- </View>
- <View className="min-w-0 flex-1">
- <Text className="font-medium text-[15px] text-gray-12">{label}</Text>
- <Text className="mt-0.5 text-[12px] text-gray-10">{description}</Text>
- </View>
- </Pressable>
- );
-}
-
-export function AttachmentSheet({
- open,
- onClose,
- onPickPhoto,
- onPickCamera,
- onPickDocument,
-}: AttachmentSheetProps) {
- const themeColors = useThemeColors();
-
- return (
- <SheetContainer open={open} onClose={onClose}>
- <View className="px-4 pt-2 pb-2">
- <Text className="font-semibold text-[16px] text-gray-12">
- Add attachment
- </Text>
- </View>
-
- <Row
- icon={
- <ImageIcon size={18} color={themeColors.gray[12]} weight="bold" />
- }
- label="Photo library"
- description="Pick a photo to share with the agent"
- onPress={() => {
- onClose();
- onPickPhoto();
- }}
- />
- <Row
- icon={<Camera size={18} color={themeColors.gray[12]} weight="bold" />}
- label="Take photo"
- description="Capture a new photo from the camera"
- onPress={() => {
- onClose();
- onPickCamera();
- }}
- />
- <Row
- icon={<FileText size={18} color={themeColors.gray[12]} weight="bold" />}
- label="File"
- description="Attach a text or code file from your device"
- onPress={() => {
- onClose();
- onPickDocument();
- }}
- />
- </SheetContainer>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/composer/attachments/AttachmentsBar.tsx b/products/desktop/apps/mobile/src/features/tasks/composer/attachments/AttachmentsBar.tsx
deleted file mode 100644
index 2fd9cfbd6c3a..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/composer/attachments/AttachmentsBar.tsx
+++ /dev/null
@@ -1,114 +0,0 @@
-import { Text } from "@components/text";
-import { FileText, WarningCircle, X } from "phosphor-react-native";
-import {
- ActivityIndicator,
- Image,
- Pressable,
- ScrollView,
- View,
-} from "react-native";
-import { useThemeColors } from "@/lib/theme";
-import type { PendingAttachment } from "./types";
-
-export type AttachmentStatus = "preparing" | "error";
-
-interface AttachmentsBarProps {
- attachments: PendingAttachment[];
- onRemove: (id: string) => void;
- statuses?: Record<string, AttachmentStatus>;
-}
-
-function truncate(name: string, max = 18): string {
- if (name.length <= max) return name;
- const ext = name.lastIndexOf(".");
- if (ext > 0 && name.length - ext <= 6) {
- return `${name.slice(0, max - (name.length - ext) - 1)}…${name.slice(ext)}`;
- }
- return `${name.slice(0, max - 1)}…`;
-}
-
-function StatusOverlay({ status }: { status?: AttachmentStatus }) {
- const themeColors = useThemeColors();
- if (!status) return null;
- return (
- <View
- className="absolute inset-0 items-center justify-center rounded-lg bg-gray-1/70"
- accessibilityLabel={
- status === "preparing"
- ? "Preparing attachment"
- : "Attachment failed to prepare"
- }
- >
- {status === "preparing" ? (
- <ActivityIndicator size="small" color={themeColors.gray[12]} />
- ) : (
- <WarningCircle
- size={20}
- color={themeColors.status.error}
- weight="fill"
- />
- )}
- </View>
- );
-}
-
-export function AttachmentsBar({
- attachments,
- onRemove,
- statuses,
-}: AttachmentsBarProps) {
- const themeColors = useThemeColors();
- if (attachments.length === 0) return null;
-
- return (
- <ScrollView
- horizontal
- showsHorizontalScrollIndicator={false}
- className="border-gray-5 border-b"
- contentContainerStyle={{
- paddingHorizontal: 8,
- paddingVertical: 8,
- gap: 8,
- }}
- >
- {attachments.map((att) => (
- <View
- key={att.id}
- className="relative h-16 rounded-lg border border-gray-6 bg-gray-2"
- style={{ minWidth: 64 }}
- >
- {att.kind === "image" ? (
- <Image
- source={{ uri: att.uri }}
- className="h-16 w-16 rounded-lg"
- resizeMode="cover"
- />
- ) : (
- <View className="h-16 w-32 flex-row items-center gap-2 px-2">
- <FileText
- size={20}
- color={themeColors.gray[11]}
- weight="regular"
- />
- <Text
- className="flex-1 text-[12px] text-gray-12"
- numberOfLines={2}
- >
- {truncate(att.fileName, 22)}
- </Text>
- </View>
- )}
- <StatusOverlay status={statuses?.[att.id]} />
- <Pressable
- onPress={() => onRemove(att.id)}
- hitSlop={8}
- accessibilityLabel={`Remove ${att.fileName}`}
- className="-top-1.5 -right-1.5 absolute h-5 w-5 items-center justify-center rounded-full bg-gray-12 active:opacity-80"
- >
- <X size={12} color={themeColors.background} weight="bold" />
- </Pressable>
- </View>
- ))}
- </ScrollView>
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/composer/attachments/attachmentPreparer.test.ts b/products/desktop/apps/mobile/src/features/tasks/composer/attachments/attachmentPreparer.test.ts
deleted file mode 100644
index 4a0a5ad46dba..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/composer/attachments/attachmentPreparer.test.ts
+++ /dev/null
@@ -1,78 +0,0 @@
-import { describe, expect, it, vi } from "vitest";
-import { createAttachmentPreparer } from "./attachmentPreparer";
-import type { CloudPromptBlock, PendingAttachment } from "./types";
-
-function attachment(id: string): PendingAttachment {
- return {
- kind: "document",
- id,
- uri: `file://${id}.txt`,
- fileName: `${id}.txt`,
- mimeType: "text/plain",
- };
-}
-
-function block(id: string): CloudPromptBlock {
- return { type: "text", text: id };
-}
-
-describe("createAttachmentPreparer", () => {
- it("caches a resolved block and reuses it across prepares", async () => {
- const build = vi.fn(async (att: PendingAttachment) => block(att.id));
- const preparer = createAttachmentPreparer(build);
-
- const first = await preparer.prepare(attachment("a"));
- const second = await preparer.prepare(attachment("a"));
-
- expect(first).toEqual(block("a"));
- expect(second).toBe(first);
- expect(build).toHaveBeenCalledTimes(1);
- });
-
- it("dedupes concurrent preparation of the same attachment", async () => {
- const build = vi.fn(async (att: PendingAttachment) => block(att.id));
- const preparer = createAttachmentPreparer(build);
-
- const [first, second] = await Promise.all([
- preparer.prepare(attachment("a")),
- preparer.prepare(attachment("a")),
- ]);
-
- expect(first).toBe(second);
- expect(build).toHaveBeenCalledTimes(1);
- });
-
- it("prepares distinct attachments independently", async () => {
- const build = vi.fn(async (att: PendingAttachment) => block(att.id));
- const preparer = createAttachmentPreparer(build);
-
- expect(await preparer.prepare(attachment("a"))).toEqual(block("a"));
- expect(await preparer.prepare(attachment("b"))).toEqual(block("b"));
- expect(build).toHaveBeenCalledTimes(2);
- });
-
- it("evicts a failed preparation so it can be retried", async () => {
- const build = vi
- .fn<(att: PendingAttachment) => Promise<CloudPromptBlock>>()
- .mockRejectedValueOnce(new Error("too large"))
- .mockImplementation(async (att) => block(att.id));
- const preparer = createAttachmentPreparer(build);
-
- await expect(preparer.prepare(attachment("a"))).rejects.toThrow(
- "too large",
- );
- expect(await preparer.prepare(attachment("a"))).toEqual(block("a"));
- expect(build).toHaveBeenCalledTimes(2);
- });
-
- it("re-reads after forget", async () => {
- const build = vi.fn(async (att: PendingAttachment) => block(att.id));
- const preparer = createAttachmentPreparer(build);
-
- await preparer.prepare(attachment("a"));
- preparer.forget("a");
- await preparer.prepare(attachment("a"));
-
- expect(build).toHaveBeenCalledTimes(2);
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/tasks/composer/attachments/attachmentPreparer.ts b/products/desktop/apps/mobile/src/features/tasks/composer/attachments/attachmentPreparer.ts
deleted file mode 100644
index 118ebdb4a841..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/composer/attachments/attachmentPreparer.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import type { CloudPromptBlock, PendingAttachment } from "./types";
-
-export interface AttachmentPreparer {
- prepare(attachment: PendingAttachment): Promise<CloudPromptBlock>;
- forget(id: string): void;
-}
-
-export function createAttachmentPreparer(
- build: (attachment: PendingAttachment) => Promise<CloudPromptBlock>,
-): AttachmentPreparer {
- const cache = new Map<string, Promise<CloudPromptBlock>>();
-
- return {
- prepare(attachment) {
- const existing = cache.get(attachment.id);
- if (existing) return existing;
-
- const pending = build(attachment).catch((error) => {
- cache.delete(attachment.id);
- throw error;
- });
- cache.set(attachment.id, pending);
- return pending;
- },
- forget(id) {
- cache.delete(id);
- },
- };
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/composer/attachments/buildCloudPrompt.ts b/products/desktop/apps/mobile/src/features/tasks/composer/attachments/buildCloudPrompt.ts
deleted file mode 100644
index 2f738a17f878..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/composer/attachments/buildCloudPrompt.ts
+++ /dev/null
@@ -1,159 +0,0 @@
-import * as FileSystem from "expo-file-system/legacy";
-import { createAttachmentPreparer } from "./attachmentPreparer";
-import type { CloudPromptBlock, PendingAttachment } from "./types";
-
-const MAX_EMBEDDED_TEXT_CHARS = 100_000;
-const MAX_EMBEDDED_IMAGE_BYTES = 5 * 1024 * 1024;
-
-const TEXT_MIME_PREFIXES = ["text/"];
-const TEXT_MIME_TYPES = new Set([
- "application/json",
- "application/xml",
- "application/javascript",
- "application/typescript",
- "application/x-sh",
- "application/x-yaml",
- "application/x-toml",
-]);
-const TEXT_EXTENSIONS = new Set([
- "c",
- "cc",
- "cfg",
- "conf",
- "cpp",
- "cs",
- "css",
- "csv",
- "env",
- "gitignore",
- "go",
- "h",
- "hpp",
- "html",
- "ini",
- "java",
- "js",
- "json",
- "jsx",
- "log",
- "md",
- "mjs",
- "py",
- "rb",
- "rs",
- "scss",
- "sh",
- "sql",
- "svg",
- "toml",
- "ts",
- "tsx",
- "txt",
- "xml",
- "yaml",
- "yml",
- "zsh",
-]);
-
-function getExt(fileName: string): string {
- const dot = fileName.lastIndexOf(".");
- return dot >= 0 ? fileName.slice(dot + 1).toLowerCase() : "";
-}
-
-function isTextAttachment(mimeType: string, fileName: string): boolean {
- const mt = mimeType.toLowerCase();
- if (TEXT_MIME_PREFIXES.some((p) => mt.startsWith(p))) return true;
- if (TEXT_MIME_TYPES.has(mt)) return true;
- return TEXT_EXTENSIONS.has(getExt(fileName));
-}
-
-function getTextMimeType(fileName: string, fallback: string): string {
- const ext = getExt(fileName);
- switch (ext) {
- case "json":
- return "application/json";
- case "md":
- return "text/markdown";
- case "svg":
- return "image/svg+xml";
- case "xml":
- return "application/xml";
- default:
- return fallback.startsWith("text/") ? fallback : "text/plain";
- }
-}
-
-function truncateText(text: string): string {
- if (text.length <= MAX_EMBEDDED_TEXT_CHARS) return text;
- return `${text.slice(0, MAX_EMBEDDED_TEXT_CHARS)}\n\n[Attachment truncated to ${MAX_EMBEDDED_TEXT_CHARS.toLocaleString()} characters for this cloud prompt.]`;
-}
-
-function estimateBase64Bytes(base64: string): number {
- const padding = base64.endsWith("==") ? 2 : base64.endsWith("=") ? 1 : 0;
- return Math.floor((base64.length * 3) / 4) - padding;
-}
-
-export async function buildAttachmentBlock(
- att: PendingAttachment,
-): Promise<CloudPromptBlock> {
- if (att.kind === "image") {
- const base64 = await FileSystem.readAsStringAsync(att.uri, {
- encoding: FileSystem.EncodingType.Base64,
- });
- if (estimateBase64Bytes(base64) > MAX_EMBEDDED_IMAGE_BYTES) {
- throw new Error(
- `${att.fileName} is too large for a cloud image attachment (max 5 MB).`,
- );
- }
- return {
- type: "image",
- data: base64,
- mimeType: att.mimeType || "image/jpeg",
- uri: `attachment://${att.fileName}`,
- };
- }
-
- // Document attachment — must be text-readable.
- if (!isTextAttachment(att.mimeType, att.fileName)) {
- throw new Error(
- `Cloud attachments support text and image files. Unsupported: ${att.fileName}`,
- );
- }
- const text = await FileSystem.readAsStringAsync(att.uri, {
- encoding: FileSystem.EncodingType.UTF8,
- });
- return {
- type: "resource",
- resource: {
- uri: `attachment://${att.fileName}`,
- text: truncateText(text),
- mimeType: getTextMimeType(att.fileName, att.mimeType),
- },
- };
-}
-
-export const attachmentPreparer =
- createAttachmentPreparer(buildAttachmentBlock);
-
-/**
- * Reads each attachment from disk and assembles the cloud-prompt block array
- * the agent server expects. Throws if any individual attachment fails so the
- * caller can surface a single, attributable error to the user.
- */
-export async function buildCloudPromptBlocks(
- text: string,
- attachments: PendingAttachment[],
-): Promise<CloudPromptBlock[]> {
- const blocks: CloudPromptBlock[] = [];
- const trimmed = text.trim();
- if (trimmed) blocks.push({ type: "text", text: trimmed });
- for (const attachment of attachments) {
- blocks.push(await attachmentPreparer.prepare(attachment));
- // Base64/text payloads are large; release once folded into the prompt.
- attachmentPreparer.forget(attachment.id);
- }
- if (blocks.length === 0) {
- throw new Error("Cloud prompt cannot be empty");
- }
- return blocks;
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/composer/attachments/pickers.ts b/products/desktop/apps/mobile/src/features/tasks/composer/attachments/pickers.ts
deleted file mode 100644
index 375948798d5e..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/composer/attachments/pickers.ts
+++ /dev/null
@@ -1,157 +0,0 @@
-import { getImageMimeType } from "@posthog/shared";
-import { Alert } from "react-native";
-import { logger } from "@/lib/logger";
-import type { PendingAttachment } from "./types";
-
-const log = logger.scope("attachments");
-
-function makeId(): string {
- return `att-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 7)}`;
-}
-
-function inferImageMime(uri: string, mime?: string | null): string {
- if (mime) return mime;
- const detected = getImageMimeType(uri);
- return detected === "application/octet-stream" ? "image/jpeg" : detected;
-}
-
-function deriveFileName(uri: string, fallback: string): string {
- const last = uri.split("/").pop();
- if (last && last.length > 0) return decodeURIComponent(last.split("?")[0]);
- return fallback;
-}
-
-function showNativeModuleAlert(kind: "document" | "image"): void {
- const label = kind === "document" ? "file attachments" : "photo attachments";
-
- Alert.alert(
- "App update needed",
- `This build does not include the native module for ${label} yet. Rebuild and reinstall the mobile app on your device to use this feature.`,
- );
-}
-
-async function loadDocumentPicker(): Promise<
- typeof import("expo-document-picker") | null
-> {
- try {
- return await import("expo-document-picker");
- } catch (err) {
- log.error("Document picker native module unavailable", err);
- showNativeModuleAlert("document");
- return null;
- }
-}
-
-async function loadImagePicker(): Promise<
- typeof import("expo-image-picker") | null
-> {
- try {
- return await import("expo-image-picker");
- } catch (err) {
- log.error("Image picker native module unavailable", err);
- showNativeModuleAlert("image");
- return null;
- }
-}
-
-/**
- * Open the photo library and return the picked image as a PendingAttachment.
- * Returns `null` if the user cancels or permission is denied.
- */
-export async function pickPhotoFromLibrary(): Promise<PendingAttachment | null> {
- const ImagePicker = await loadImagePicker();
- if (!ImagePicker) return null;
-
- const perm = await ImagePicker.requestMediaLibraryPermissionsAsync();
- if (!perm.granted) {
- Alert.alert(
- "Photo access needed",
- "Allow PostHog to access your photos in Settings to attach images.",
- );
- return null;
- }
-
- const result = await ImagePicker.launchImageLibraryAsync({
- mediaTypes: ["images"],
- quality: 0.8,
- allowsMultipleSelection: false,
- exif: false,
- });
- if (result.canceled || result.assets.length === 0) return null;
-
- const asset = result.assets[0];
- return {
- kind: "image",
- id: makeId(),
- uri: asset.uri,
- fileName: asset.fileName ?? deriveFileName(asset.uri, "image.jpg"),
- mimeType: inferImageMime(asset.uri, asset.mimeType),
- sizeBytes: asset.fileSize,
- };
-}
-
-/**
- * Open the camera and return the captured photo as a PendingAttachment.
- */
-export async function captureFromCamera(): Promise<PendingAttachment | null> {
- const ImagePicker = await loadImagePicker();
- if (!ImagePicker) return null;
-
- const perm = await ImagePicker.requestCameraPermissionsAsync();
- if (!perm.granted) {
- Alert.alert(
- "Camera access needed",
- "Allow PostHog to use your camera in Settings to capture attachments.",
- );
- return null;
- }
-
- const result = await ImagePicker.launchCameraAsync({
- mediaTypes: ["images"],
- quality: 0.8,
- exif: false,
- });
- if (result.canceled || result.assets.length === 0) return null;
-
- const asset = result.assets[0];
- return {
- kind: "image",
- id: makeId(),
- uri: asset.uri,
- fileName: asset.fileName ?? deriveFileName(asset.uri, "photo.jpg"),
- mimeType: inferImageMime(asset.uri, asset.mimeType),
- sizeBytes: asset.fileSize,
- };
-}
-
-/**
- * Open the document picker for text/code files. Binary documents are accepted
- * by the picker but rejected at send-time by `buildCloudPromptBlocks` because
- * the cloud agent only supports text or image content.
- */
-export async function pickDocument(): Promise<PendingAttachment | null> {
- try {
- const DocumentPicker = await loadDocumentPicker();
- if (!DocumentPicker) return null;
-
- const result = await DocumentPicker.getDocumentAsync({
- type: "*/*",
- copyToCacheDirectory: true,
- multiple: false,
- });
- if (result.canceled || result.assets.length === 0) return null;
-
- const asset = result.assets[0];
- return {
- kind: "document",
- id: makeId(),
- uri: asset.uri,
- fileName: asset.name,
- mimeType: asset.mimeType ?? "application/octet-stream",
- sizeBytes: asset.size,
- };
- } catch (err) {
- log.error("Document picker failed", err);
- return null;
- }
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/composer/attachments/types.ts b/products/desktop/apps/mobile/src/features/tasks/composer/attachments/types.ts
deleted file mode 100644
index f2fee3799f22..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/composer/attachments/types.ts
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * In-flight attachment held by the composer until the message is sent.
- * `uri` points at the picker's local file (e.g. ph://… or file://…). Bytes are
- * read lazily at send-time so we never hold large base64 strings in memory.
- */
-export type PendingAttachment =
- | {
- kind: "image";
- id: string;
- uri: string;
- fileName: string;
- mimeType: string;
- sizeBytes?: number;
- }
- | {
- kind: "document";
- id: string;
- uri: string;
- fileName: string;
- mimeType: string;
- sizeBytes?: number;
- };
-
-/**
- * Minimal subset of `@agentclientprotocol/sdk`'s `ContentBlock` that the
- * backend's `deserializeCloudPrompt` accepts. We mirror the wire shape rather
- * than depending on the ACP SDK from the mobile bundle.
- */
-export type CloudPromptBlock =
- | { type: "text"; text: string }
- | { type: "image"; data: string; mimeType: string; uri?: string }
- | {
- type: "resource";
- resource: {
- uri: string;
- text: string;
- mimeType: string;
- };
- };
diff --git a/products/desktop/apps/mobile/src/features/tasks/composer/options.test.ts b/products/desktop/apps/mobile/src/features/tasks/composer/options.test.ts
deleted file mode 100644
index afbce27170af..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/composer/options.test.ts
+++ /dev/null
@@ -1,198 +0,0 @@
-import {
- type CloudTaskConfigOption,
- type CloudTaskConfigSelectGroup,
- restrictedModelMeta,
-} from "@posthog/shared";
-import { describe, expect, it } from "vitest";
-import {
- getAgentPresets,
- getMiddlePreset,
- getMobileExecutionModes,
- harnessForModel,
- resolveComposerPrimaryAction,
- resolveCrossHarnessModelSelection,
- toMobileModelGroups,
-} from "./options";
-
-const HARNESS_META = "posthog.code/modelHarness";
-
-describe("mobile composer options", () => {
- it("hides unrestricted execution modes", () => {
- expect(
- getMobileExecutionModes([
- { id: "plan", name: "Plan", description: "Plan first" },
- {
- id: "bypassPermissions",
- name: "Bypass permissions",
- description: "Allow everything",
- },
- {
- id: "full-access",
- name: "Full access",
- description: "Allow everything",
- },
- ]).map((mode) => mode.id),
- ).toEqual(["plan"]);
- });
-
- describe("agent presets", () => {
- const ladderConfig: CloudTaskConfigOption = {
- id: "model",
- name: "Model",
- type: "select",
- currentValue: "claude-opus-5-5",
- options: [
- { value: "claude-sonnet-5-5", name: "Claude Sonnet 5.5" },
- { value: "claude-opus-5-5", name: "Claude Opus 5.5" },
- {
- value: "claude-fable-5-1",
- name: "Claude Fable 5.1",
- _meta: restrictedModelMeta(),
- },
- ],
- category: "model",
- description: "Choose a model",
- };
-
- it("maps only the offered, unrestricted, effort-valid ladder notches", () => {
- expect(getAgentPresets("claude", ladderConfig)).toEqual([
- {
- model: "claude-sonnet-5-5",
- effort: "medium",
- modelLabel: "Claude Sonnet 5.5",
- effortLabel: "Medium",
- },
- {
- model: "claude-sonnet-5-5",
- effort: "high",
- modelLabel: "Claude Sonnet 5.5",
- effortLabel: "High",
- },
- {
- model: "claude-opus-5-5",
- effort: "medium",
- modelLabel: "Claude Opus 5.5",
- effortLabel: "Medium",
- },
- {
- model: "claude-opus-5-5",
- effort: "xhigh",
- modelLabel: "Claude Opus 5.5",
- effortLabel: "Extra high",
- },
- ]);
- });
-
- it("returns the balanced middle notch", () => {
- const presets = getAgentPresets("claude", ladderConfig);
- expect(getMiddlePreset(presets)).toEqual({
- model: "claude-sonnet-5-5",
- effort: "high",
- modelLabel: "Claude Sonnet 5.5",
- effortLabel: "High",
- });
- expect(getMiddlePreset([])).toBeUndefined();
- });
- });
-
- describe("harnessForModel", () => {
- const groups: CloudTaskConfigSelectGroup[] = [
- {
- group: "anthropic",
- name: "Anthropic",
- options: [
- {
- value: "claude-opus-5-5",
- name: "Claude Opus 5.5",
- _meta: { [HARNESS_META]: "claude" },
- },
- ],
- },
- {
- group: "openai",
- name: "OpenAI",
- options: [
- {
- value: "gpt-5.6-sol",
- name: "GPT-5.6 Sol",
- _meta: { [HARNESS_META]: "codex" },
- },
- ],
- },
- ];
-
- it("reads the harness stamp from the picked option", () => {
- expect(harnessForModel(groups, "gpt-5.6-sol")).toBe("codex");
- });
-
- it("falls back to the model id shape when the pick is not in the catalog", () => {
- // A gateway blip may have dropped the model; the composer must still let
- // the currently-running model stay picked, so the harness has to resolve.
- expect(harnessForModel(groups, "gpt-5.9-nova")).toBe("codex");
- expect(harnessForModel(groups, "claude-opus-4-99")).toBe("claude");
- });
- });
-
- describe("resolveCrossHarnessModelSelection", () => {
- it("lands on the target harness's default mode and reasoning", () => {
- expect(resolveCrossHarnessModelSelection("codex", "gpt-5.6-sol")).toEqual(
- {
- adapter: "codex",
- mode: "auto",
- model: "gpt-5.6-sol",
- reasoning: "high",
- },
- );
- });
- });
-
- it("keys mobile groups on their vendor and adapts each option", () => {
- const groups: CloudTaskConfigSelectGroup[] = [
- {
- group: "anthropic",
- name: "Anthropic",
- options: [
- {
- value: "claude-opus-5-5",
- name: "Claude Opus 5.5",
- _meta: restrictedModelMeta(),
- },
- ],
- },
- ];
- expect(toMobileModelGroups(groups)).toEqual([
- {
- key: "anthropic",
- name: "Anthropic",
- options: [
- {
- value: "claude-opus-5-5",
- label: "Claude Opus 5.5",
- description: undefined,
- disabled: true,
- },
- ],
- },
- ]);
- });
-
- it.each([
- [{ hasContent: true }, "send"],
- [{ canStop: true }, "stop"],
- [{ isRecording: true }, "mic-stop"],
- [{ isRecording: true, canStop: true }, "mic-stop"],
- [{}, "mic"],
- ])("derives the mobile primary action", (overrides, expected) => {
- expect(
- resolveComposerPrimaryAction({
- hasContent: false,
- disabled: false,
- isRecording: false,
- isTranscribing: false,
- canStop: false,
- allowSendWhileRunning: true,
- ...overrides,
- }),
- ).toBe(expected);
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/tasks/composer/options.ts b/products/desktop/apps/mobile/src/features/tasks/composer/options.ts
deleted file mode 100644
index 5eb23e9d464a..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/composer/options.ts
+++ /dev/null
@@ -1,185 +0,0 @@
-import {
- getDefaultExecutionModeForAdapter,
- type ModeInfo,
-} from "@posthog/core/sessions/executionModes";
-import type { CloudComposerSelection } from "@posthog/core/task-detail/composerModelPolicy";
-import {
- type Adapter,
- adapterForModelId,
- type CloudTaskConfigOption,
- type CloudTaskConfigSelectGroup,
- DEFAULT_REASONING_EFFORT,
- getCapabilityLadder,
- getReasoningEffortOptions,
- isRestrictedModelOption,
- type SupportedReasoningEffort,
- selectOptionHarness,
-} from "@posthog/shared";
-
-export type ContextWindow = "200k" | "1m";
-export const DEFAULT_CONTEXT_WINDOW: ContextWindow = "1m";
-
-export interface AgentPreset {
- model: string;
- effort: SupportedReasoningEffort;
- modelLabel: string;
- effortLabel: string;
-}
-
-export interface MobileModelOption {
- value: string;
- label: string;
- description?: string;
- disabled: boolean;
-}
-
-export interface MobileModelGroup {
- key: string;
- name: string;
- options: MobileModelOption[];
-}
-
-export function getMobileExecutionModes(
- modes: readonly ModeInfo[],
-): ModeInfo[] {
- return modes.filter(
- (mode) => mode.id !== "bypassPermissions" && mode.id !== "full-access",
- );
-}
-
-export function getModelConfigOption(
- configOptions: readonly CloudTaskConfigOption[],
-): CloudTaskConfigOption {
- const option = configOptions.find((item) => item.category === "model");
- if (!option) throw new Error("Cloud task model configuration is unavailable");
- return option;
-}
-
-function toMobileModelOption(option: {
- value: string;
- name: string;
- description?: string;
- _meta?: Record<string, unknown>;
-}): MobileModelOption {
- return {
- value: option.value,
- label: option.name,
- description: option.description,
- disabled: isRestrictedModelOption(option._meta),
- };
-}
-
-export function toMobileModelGroups(
- groups: readonly CloudTaskConfigSelectGroup[],
-): MobileModelGroup[] {
- return groups.map((group) => ({
- key: group.group,
- name: group.name,
- options: group.options.map(toMobileModelOption),
- }));
-}
-
-export function findModelOptionInGroups(
- groups: readonly CloudTaskConfigSelectGroup[],
- value: string,
-):
- | { value: string; name: string; _meta?: Record<string, unknown> }
- | undefined {
- for (const group of groups) {
- const entry = group.options.find((option) => option.value === value);
- if (entry) return entry;
- }
- return undefined;
-}
-
-export function harnessForModel(
- groups: readonly CloudTaskConfigSelectGroup[],
- value: string,
-): Adapter {
- const entry = findModelOptionInGroups(groups, value);
- return selectOptionHarness(entry?._meta) ?? adapterForModelId(value);
-}
-
-/**
- * The composer selection for a cross-harness model pick: switches to the
- * picked model's harness, lands on that harness's default mode and reasoning
- * effort, and carries the picked model along.
- */
-export function resolveCrossHarnessModelSelection(
- adapter: Adapter,
- model: string,
-): CloudComposerSelection {
- return {
- adapter,
- mode: getDefaultExecutionModeForAdapter(adapter),
- model,
- reasoning: DEFAULT_REASONING_EFFORT,
- };
-}
-
-/**
- * The Faster → Smarter preset scale for the merged model + reasoning control,
- * derived from the shared capability ladder. A notch survives only when its
- * model is present and unrestricted in the live config and its effort is
- * supported for that model, so the scale never offers an unusable pairing.
- */
-export function getAgentPresets(
- adapter: Adapter,
- modelOption: CloudTaskConfigOption,
-): AgentPreset[] {
- return getCapabilityLadder(adapter).flatMap((notch) => {
- const entry = modelOption.options.find((o) => o.value === notch.model);
- if (!entry || isRestrictedModelOption(entry._meta)) return [];
- const effortOption = getReasoningEffortOptions(adapter, notch.model)?.find(
- (option) => option.value === notch.effort,
- );
- if (!effortOption) return [];
- return [
- {
- model: notch.model,
- effort: notch.effort,
- modelLabel: entry.name,
- effortLabel: effortOption.name,
- },
- ];
- });
-}
-
-function middleIndex(length: number): number {
- return Math.floor((length - 1) / 2);
-}
-
-export function getMiddlePreset(
- presets: readonly AgentPreset[],
-): AgentPreset | undefined {
- if (presets.length === 0) return undefined;
- return presets[middleIndex(presets.length)];
-}
-
-export type ComposerPrimaryAction =
- | "send"
- | "stop"
- | "mic"
- | "mic-stop"
- | "disabled";
-
-export function resolveComposerPrimaryAction({
- hasContent,
- disabled,
- isRecording,
- isTranscribing,
- canStop,
- allowSendWhileRunning,
-}: {
- hasContent: boolean;
- disabled: boolean;
- isRecording: boolean;
- isTranscribing: boolean;
- canStop: boolean;
- allowSendWhileRunning: boolean;
-}): ComposerPrimaryAction {
- if (disabled || isTranscribing) return "disabled";
- if (isRecording) return "mic-stop";
- if (canStop && (!allowSendWhileRunning || !hasContent)) return "stop";
- return hasContent ? "send" : "mic";
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/composer/submitComposerMessage.test.ts b/products/desktop/apps/mobile/src/features/tasks/composer/submitComposerMessage.test.ts
deleted file mode 100644
index e56a85564205..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/composer/submitComposerMessage.test.ts
+++ /dev/null
@@ -1,133 +0,0 @@
-import { describe, expect, it, vi } from "vitest";
-import type { PendingAttachment } from "./attachments/types";
-import {
- type ComposerContent,
- isComposerEmpty,
- submitComposerMessage,
-} from "./submitComposerMessage";
-
-const attachment: PendingAttachment = {
- kind: "image",
- id: "a1",
- uri: "file://x.png",
- fileName: "x.png",
- mimeType: "image/png",
-};
-
-const submitted: ComposerContent = {
- text: "hello there",
- attachments: [attachment],
-};
-
-function createComposer(
- initial: ComposerContent = { text: "", attachments: [] },
-) {
- let content = initial;
- return {
- get content() {
- return content;
- },
- clear: vi.fn(() => {
- content = { text: "", attachments: [] };
- }),
- restore: vi.fn((next: ComposerContent) => {
- content = next;
- }),
- isEmpty: () => isComposerEmpty(content),
- };
-}
-
-describe("isComposerEmpty", () => {
- const cases: Array<[ComposerContent, boolean]> = [
- [{ text: "", attachments: [] }, true],
- [{ text: " ", attachments: [] }, true],
- [{ text: "hi", attachments: [] }, false],
- [{ text: "", attachments: [attachment] }, false],
- ];
- it.each(cases)("%o -> %s", (content, expected) => {
- expect(isComposerEmpty(content)).toBe(expected);
- });
-});
-
-describe("submitComposerMessage", () => {
- it("clears and stays cleared on a successful send", async () => {
- const composer = createComposer();
-
- await submitComposerMessage({
- submitted,
- clear: composer.clear,
- send: async () => true,
- isLatestSubmission: () => true,
- isEmpty: composer.isEmpty,
- restore: composer.restore,
- });
-
- expect(composer.clear).toHaveBeenCalledOnce();
- expect(composer.restore).not.toHaveBeenCalled();
- expect(composer.content).toEqual({ text: "", attachments: [] });
- });
-
- it("restores text and attachments when a send fails", async () => {
- const composer = createComposer();
-
- await submitComposerMessage({
- submitted,
- clear: composer.clear,
- send: async () => false,
- isLatestSubmission: () => true,
- isEmpty: composer.isEmpty,
- restore: composer.restore,
- });
-
- expect(composer.restore).toHaveBeenCalledWith(submitted);
- expect(composer.content).toEqual(submitted);
- });
-
- it("treats a thrown send as a failure and restores", async () => {
- const composer = createComposer();
-
- await submitComposerMessage({
- submitted,
- clear: composer.clear,
- send: async () => {
- throw new Error("network");
- },
- isLatestSubmission: () => true,
- isEmpty: composer.isEmpty,
- restore: composer.restore,
- });
-
- expect(composer.content).toEqual(submitted);
- });
-
- it("does not restore when the user has typed a new draft", async () => {
- const composer = createComposer();
- composer.clear.mockImplementation(() => {});
-
- await submitComposerMessage({
- submitted,
- clear: composer.clear,
- send: async () => false,
- isLatestSubmission: () => true,
- isEmpty: () => false,
- restore: composer.restore,
- });
-
- expect(composer.restore).not.toHaveBeenCalled();
- });
-
- it("does not restore a stale failure over a newer submission", async () => {
- const composer = createComposer();
-
- await submitComposerMessage({
- submitted,
- clear: composer.clear,
- send: async () => false,
- isLatestSubmission: () => false,
- isEmpty: composer.isEmpty,
- restore: composer.restore,
- });
-
- expect(composer.restore).not.toHaveBeenCalled();
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/tasks/composer/submitComposerMessage.ts b/products/desktop/apps/mobile/src/features/tasks/composer/submitComposerMessage.ts
deleted file mode 100644
index 7b077578c914..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/composer/submitComposerMessage.ts
+++ /dev/null
@@ -1,41 +0,0 @@
-import type { PendingAttachment } from "./attachments/types";
-
-export interface ComposerContent {
- text: string;
- attachments: PendingAttachment[];
-}
-
-export function isComposerEmpty(content: ComposerContent): boolean {
- return content.text.trim().length === 0 && content.attachments.length === 0;
-}
-
-interface SubmitComposerMessageOptions {
- submitted: ComposerContent;
- clear: () => void;
- send: () => Promise<boolean>;
- isLatestSubmission: () => boolean;
- isEmpty: () => boolean;
- restore: (content: ComposerContent) => void;
-}
-
-export async function submitComposerMessage({
- submitted,
- clear,
- send,
- isLatestSubmission,
- isEmpty,
- restore,
-}: SubmitComposerMessageOptions): Promise<void> {
- clear();
-
- let sent = false;
- try {
- sent = await send();
- } catch {
- sent = false;
- }
-
- if (!sent && isLatestSubmission() && isEmpty()) {
- restore(submitted);
- }
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/hooks/useCloudAttachmentPreview.ts b/products/desktop/apps/mobile/src/features/tasks/hooks/useCloudAttachmentPreview.ts
deleted file mode 100644
index 79af47a5c7c4..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/hooks/useCloudAttachmentPreview.ts
+++ /dev/null
@@ -1,47 +0,0 @@
-import { useQuery, useQueryClient } from "@tanstack/react-query";
-import { getProjectId } from "@/lib/api";
-import { getTaskRun, presignTaskRunArtifact } from "../api";
-import type { CloudArtifactRef } from "../types";
-
-// Presigned URLs outlive this comfortably (backend issues ~1h), so we refetch
-// well before expiry rather than on every render.
-const PREVIEW_STALE_MS = 50 * 60 * 1000;
-
-/**
- * Resolves a cloud attachment to a presigned S3 preview URL. The run's artifact
- * manifest is fetched once per run through the shared query cache, so a message
- * with several images does not fire a manifest request per image. Returns
- * `null` when the artifact is missing so callers can fall back to a file chip.
- */
-export function useCloudAttachmentPreview(
- taskId: string | undefined,
- cloudArtifact: CloudArtifactRef | undefined,
-) {
- const queryClient = useQueryClient();
- const projectId = getProjectId();
-
- return useQuery({
- queryKey: [
- "cloudArtifactPreview",
- projectId,
- taskId,
- cloudArtifact?.runId,
- cloudArtifact?.artifactId,
- ],
- enabled: Boolean(taskId && cloudArtifact),
- staleTime: PREVIEW_STALE_MS,
- retry: false,
- queryFn: async () => {
- if (!taskId || !cloudArtifact) return null;
- const { runId, artifactId } = cloudArtifact;
- const artifacts = await queryClient.fetchQuery({
- queryKey: ["taskRunArtifacts", projectId, taskId, runId],
- queryFn: async () => (await getTaskRun(taskId, runId)).artifacts ?? [],
- staleTime: PREVIEW_STALE_MS,
- });
- const match = artifacts.find((artifact) => artifact.id === artifactId);
- if (!match?.storage_path) return null;
- return presignTaskRunArtifact(taskId, runId, match.storage_path);
- },
- });
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/hooks/useCloudTaskConfigOptions.test.ts b/products/desktop/apps/mobile/src/features/tasks/hooks/useCloudTaskConfigOptions.test.ts
deleted file mode 100644
index 82b02ac41710..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/hooks/useCloudTaskConfigOptions.test.ts
+++ /dev/null
@@ -1,222 +0,0 @@
-import { DEFAULT_GATEWAY_MODEL, type GatewayModel } from "@posthog/shared";
-import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
-import { createElement, type PropsWithChildren } from "react";
-import { act, create } from "react-test-renderer";
-import { beforeEach, describe, expect, it, vi } from "vitest";
-
-const { mockGetCloudTaskGatewayModels, mockUseAuthStore } = vi.hoisted(() => ({
- mockGetCloudTaskGatewayModels: vi.fn(),
- mockUseAuthStore: vi.fn(),
-}));
-
-vi.mock("@/features/auth", () => ({
- useAuthStore: mockUseAuthStore,
-}));
-
-vi.mock("@/lib/posthogApiClient", () => ({
- getPostHogApiClient: () => ({
- getCloudTaskGatewayModels: mockGetCloudTaskGatewayModels,
- }),
-}));
-
-import { getModelConfigOption } from "../composer/options";
-import { useCloudTaskConfigOptions } from "./useCloudTaskConfigOptions";
-
-function createWrapper(queryClient: QueryClient) {
- return function Wrapper({ children }: PropsWithChildren) {
- return createElement(
- QueryClientProvider,
- { client: queryClient },
- children,
- );
- };
-}
-
-async function renderHook(
- adapter: "claude" | "codex" = "claude",
- currentValue?: string,
-) {
- const queryClient = new QueryClient({
- defaultOptions: { queries: { retry: false } },
- });
- let currentResult: ReturnType<typeof useCloudTaskConfigOptions>;
-
- function HookProbe() {
- currentResult = useCloudTaskConfigOptions(adapter, currentValue);
- return null;
- }
-
- const Wrapper = createWrapper(queryClient);
- await act(async () => {
- create(createElement(Wrapper, null, createElement(HookProbe)));
- await Promise.resolve();
- });
-
- return {
- get current() {
- return currentResult;
- },
- };
-}
-
-async function waitForAssertion(assertion: () => void): Promise<void> {
- const timeoutAt = Date.now() + 10_000;
- while (Date.now() < timeoutAt) {
- try {
- assertion();
- return;
- } catch (error) {
- await new Promise((resolve) => setTimeout(resolve, 10));
- if (Date.now() >= timeoutAt) throw error;
- }
- }
-}
-
-function inferOwnedBy(id: string): string {
- if (id.startsWith("claude-") || id.startsWith("anthropic/"))
- return "anthropic";
- if (id.startsWith("gpt-") || id.startsWith("openai/")) return "openai";
- if (id.startsWith("@cf/")) return "cloudflare";
- if (id.startsWith("zai-org/") || id.includes("deepseek")) return "baseten";
- return id.split("/")[0] ?? "anthropic";
-}
-
-function gatewayModel(
- id: string,
- extra: Partial<GatewayModel> = {},
-): GatewayModel {
- return {
- id,
- owned_by: inferOwnedBy(id),
- context_window: 200_000,
- supports_streaming: true,
- supports_vision: false,
- allowed: true,
- ...extra,
- };
-}
-
-describe("useCloudTaskConfigOptions", () => {
- beforeEach(() => {
- mockGetCloudTaskGatewayModels.mockReset();
- mockUseAuthStore.mockImplementation((selector) =>
- selector({ oauthAccessToken: "token" }),
- );
- });
-
- it("builds per-adapter config options from the gateway models", async () => {
- mockGetCloudTaskGatewayModels.mockResolvedValue([
- gatewayModel("claude-sonnet-5"),
- gatewayModel("gpt-5.6-sol"),
- ]);
-
- const result = await renderHook("claude");
- await waitForAssertion(() => {
- const modelOption = getModelConfigOption(result.current.configOptions);
- expect(modelOption.options.map((o) => o.value)).toEqual([
- "claude-sonnet-5",
- ]);
- expect(result.current.hasLiveConfig).toBe(true);
- });
- });
-
- it("groups both harnesses' models by vendor for the cross-harness picker", async () => {
- mockGetCloudTaskGatewayModels.mockResolvedValue([
- gatewayModel("claude-sonnet-5"),
- gatewayModel("gpt-5.6-sol"),
- ]);
-
- const result = await renderHook("claude");
- await waitForAssertion(() => {
- const groups = result.current.modelGroups.map((g) => ({
- group: g.group,
- options: g.options.map((o) => o.value),
- }));
- expect(groups).toEqual([
- { group: "anthropic", options: ["claude-sonnet-5"] },
- { group: "openai", options: ["gpt-5.6-sol"] },
- ]);
- });
- });
-
- // The gateway serves these to everyone, and a second gate in this app used to hide them.
- it.each([
- { model: "zai-org/glm-5.3" },
- { model: "zai-org/glm-5.3-flash" },
- { model: "deepseek-ai/deepseek-v4-flash-0731" },
- ])("offers a served $model", async ({ model }) => {
- mockGetCloudTaskGatewayModels.mockResolvedValue([
- gatewayModel(model),
- gatewayModel("claude-sonnet-5"),
- ]);
-
- const result = await renderHook("claude");
- await waitForAssertion(() => {
- const modelOption = getModelConfigOption(result.current.configOptions);
- expect(modelOption.options.map((option) => option.value)).toContain(
- model,
- );
- });
- });
-
- it("keeps the shared fallback when unauthenticated", async () => {
- mockUseAuthStore.mockImplementation((selector) =>
- selector({ oauthAccessToken: null }),
- );
-
- const result = await renderHook("claude");
-
- expect(
- getModelConfigOption(result.current.configOptions).currentValue,
- ).toBe(DEFAULT_GATEWAY_MODEL);
- expect(mockGetCloudTaskGatewayModels).not.toHaveBeenCalled();
- expect(result.current.isConfigReady).toBe(true);
- });
-
- it("keeps a model missing from the catalog selectable via a synthetic entry", async () => {
- mockGetCloudTaskGatewayModels.mockResolvedValue([
- gatewayModel("claude-sonnet-5"),
- ]);
-
- // A gateway blip drops the running model; the picker must still list it so
- // the user can see what's selected instead of an empty highlight.
- const result = await renderHook("claude", "claude-fable-legacy");
- await waitForAssertion(() => {
- expect(
- result.current.modelGroups.some((group) =>
- group.options.some(
- (option) => option.value === "claude-fable-legacy",
- ),
- ),
- ).toBe(true);
- });
- });
-
- it("offers a served Kimi K3", async () => {
- mockGetCloudTaskGatewayModels.mockResolvedValue([
- gatewayModel("moonshotai/kimi-k3", { owned_by: "modal" }),
- gatewayModel("claude-sonnet-5"),
- ]);
-
- const result = await renderHook("claude");
- await waitForAssertion(() => {
- const values = getModelConfigOption(
- result.current.configOptions,
- ).options.map((option) => option.value);
- expect(values).toContain("moonshotai/kimi-k3");
- });
- });
-
- it("makes the shared fallback usable after the live catalog fails", async () => {
- mockGetCloudTaskGatewayModels.mockRejectedValue(new Error("offline"));
-
- const result = await renderHook("claude");
- await waitForAssertion(() => {
- expect(result.current.isConfigReady).toBe(true);
- });
-
- expect(
- getModelConfigOption(result.current.configOptions).currentValue,
- ).toBe(DEFAULT_GATEWAY_MODEL);
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/tasks/hooks/useCloudTaskConfigOptions.ts b/products/desktop/apps/mobile/src/features/tasks/hooks/useCloudTaskConfigOptions.ts
deleted file mode 100644
index c9a3eb75cc60..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/hooks/useCloudTaskConfigOptions.ts
+++ /dev/null
@@ -1,83 +0,0 @@
-import {
- type Adapter,
- buildCloudTaskConfigOptions,
- buildProviderModelGroups,
- type CloudTaskConfigOption,
- type CloudTaskConfigSelectGroup,
- type GatewayModel,
- isRestrictedModelOption,
-} from "@posthog/shared";
-import { useQuery } from "@tanstack/react-query";
-import { useMemo } from "react";
-import { useAuthStore } from "@/features/auth";
-import { getPostHogApiClient } from "@/lib/posthogApiClient";
-
-export const cloudTaskConfigOptionKeys = {
- all: ["cloud-task-config-options"] as const,
- models: () => [...cloudTaskConfigOptionKeys.all, "models"] as const,
-};
-
-const emptyModels: GatewayModel[] = [];
-
-export function useCloudTaskConfigOptions(
- adapter: Adapter = "claude",
- currentValue?: string,
-) {
- const oauthAccessToken = useAuthStore((state) => state.oauthAccessToken);
- const query = useQuery({
- queryKey: cloudTaskConfigOptionKeys.models(),
- queryFn: () => getPostHogApiClient().getCloudTaskGatewayModels(),
- enabled: !!oauthAccessToken,
- staleTime: 5 * 60 * 1000,
- });
- const models = query.data ?? emptyModels;
- const hasLiveConfig = query.data !== undefined;
-
- // The gateway listing is already scoped to the caller: it drops a model behind a rollout
- // flag the caller does not hold. A second gate here reads flags this app cannot see the
- // catalog for, which is how it hid models the gateway was serving.
- const visibleModels = models;
-
- const configOptions = useMemo(
- () =>
- buildCloudTaskConfigOptions(visibleModels, adapter).map((option) => {
- if (option.category !== "model") return option;
- const nextCurrent = option.options.some(
- (model) =>
- model.value === option.currentValue &&
- !isRestrictedModelOption(model._meta),
- )
- ? option.currentValue
- : (option.options.find(
- (model) => !isRestrictedModelOption(model._meta),
- )?.value ?? option.currentValue);
- return { ...option, currentValue: nextCurrent };
- }),
- [visibleModels, adapter],
- );
-
- const baseModelGroups = useMemo(
- () => buildProviderModelGroups(visibleModels, adapter),
- [visibleModels, adapter],
- );
-
- // Only rebuild with the synthetic current-value entry when the pick is
- // absent from the catalog. A same-catalog model change reuses baseModelGroups.
- const modelGroups = useMemo(() => {
- if (!currentValue) return baseModelGroups;
- const present = baseModelGroups.some((group) =>
- group.options.some((option) => option.value === currentValue),
- );
- if (present) return baseModelGroups;
- return buildProviderModelGroups(visibleModels, adapter, currentValue);
- }, [baseModelGroups, visibleModels, adapter, currentValue]);
-
- return {
- ...query,
- configOptions: configOptions as readonly CloudTaskConfigOption[],
- modelGroups: modelGroups as readonly CloudTaskConfigSelectGroup[],
- hasLiveConfig,
- isConfigReady:
- !oauthAccessToken || query.data !== undefined || query.isError,
- };
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/hooks/useCustomImageName.ts b/products/desktop/apps/mobile/src/features/tasks/hooks/useCustomImageName.ts
deleted file mode 100644
index a8bf916ce83f..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/hooks/useCustomImageName.ts
+++ /dev/null
@@ -1,55 +0,0 @@
-import { useQuery } from "@tanstack/react-query";
-import { useAuthStore } from "@/features/auth";
-import { getPostHogApiClient } from "@/lib/posthogApiClient";
-
-export const sandboxKeys = {
- customImages: () => ["sandbox-custom-images"] as const,
- environments: () => ["sandbox-environments"] as const,
-};
-
-interface UseCustomImageNameArgs {
- customImageId: string | null;
- sandboxEnvironmentId: string | null;
- enabled: boolean;
-}
-
-// Returns null while loading, when the fetch fails (custom images disabled), or
-// when the image can't be resolved — in every case the badge renders nothing.
-export function useCustomImageName({
- customImageId,
- sandboxEnvironmentId,
- enabled,
-}: UseCustomImageNameArgs): string | null {
- const { projectId, oauthAccessToken } = useAuthStore();
- const canQuery = enabled && !!projectId && !!oauthAccessToken;
- const hasImageRef = !!customImageId || !!sandboxEnvironmentId;
-
- const imagesQuery = useQuery({
- queryKey: sandboxKeys.customImages(),
- queryFn: () => getPostHogApiClient().listSandboxCustomImages(),
- enabled: canQuery && hasImageRef,
- staleTime: 60_000,
- retry: 0,
- });
-
- const environmentsQuery = useQuery({
- queryKey: sandboxKeys.environments(),
- queryFn: () => getPostHogApiClient().listSandboxEnvironments(),
- enabled: canQuery && !!sandboxEnvironmentId,
- staleTime: 60_000,
- retry: 0,
- });
-
- const environment = sandboxEnvironmentId
- ? environmentsQuery.data?.find((env) => env.id === sandboxEnvironmentId)
- : undefined;
-
- const imageId = customImageId ?? environment?.custom_image_id ?? null;
- if (!imageId) return null;
-
- return (
- imagesQuery.data?.find((image) => image.id === imageId)?.name ??
- environment?.custom_image_name ??
- null
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/hooks/useIntegrations.test.ts b/products/desktop/apps/mobile/src/features/tasks/hooks/useIntegrations.test.ts
deleted file mode 100644
index 461d54d5d6d0..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/hooks/useIntegrations.test.ts
+++ /dev/null
@@ -1,208 +0,0 @@
-import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
-import { createElement, type PropsWithChildren } from "react";
-import { act, create } from "react-test-renderer";
-import { beforeEach, describe, expect, it, vi } from "vitest";
-
-const { mockUseAuthStore, mockGetGithubRepositories, mockGetIntegrations } =
- vi.hoisted(() => ({
- mockUseAuthStore: vi.fn(),
- mockGetGithubRepositories: vi.fn(),
- mockGetIntegrations: vi.fn(),
- }));
-
-vi.mock("@/features/auth", () => ({
- useAuthStore: mockUseAuthStore,
-}));
-
-vi.mock("@/lib/posthogApiClient", () => ({
- getPostHogApiClient: vi.fn(() => ({
- getGithubRepositories: mockGetGithubRepositories,
- getIntegrations: mockGetIntegrations,
- })),
-}));
-
-import { useRepositoryCacheStore } from "../stores/repositoryCacheStore";
-import { useIntegrations } from "./useIntegrations";
-
-function createWrapper(queryClient: QueryClient) {
- return function Wrapper({ children }: PropsWithChildren) {
- return createElement(
- QueryClientProvider,
- { client: queryClient },
- children,
- );
- };
-}
-
-function renderTestHook<Result>(
- useHook: () => Result,
- wrapper:
- | ((props: PropsWithChildren) => ReturnType<typeof createElement>)
- | undefined,
-) {
- let currentResult: Result;
-
- function HookProbe() {
- currentResult = useHook();
- return null;
- }
-
- function TestTree() {
- if (!wrapper) {
- return createElement(HookProbe);
- }
-
- const Wrapper = wrapper;
- return createElement(Wrapper, null, createElement(HookProbe));
- }
-
- let renderer: ReturnType<typeof create>;
- act(() => {
- renderer = create(createElement(TestTree));
- });
-
- return {
- result: {
- get current() {
- return currentResult;
- },
- },
- unmount() {
- act(() => {
- renderer.unmount();
- });
- },
- };
-}
-
-async function waitForAssertion(assertion: () => void): Promise<void> {
- const timeoutAt = Date.now() + 10_000;
-
- while (Date.now() < timeoutAt) {
- try {
- assertion();
- return;
- } catch (error) {
- await new Promise((resolve) => setTimeout(resolve, 10));
- if (Date.now() >= timeoutAt) {
- throw error;
- }
- }
- }
-}
-
-describe("useIntegrations", () => {
- beforeEach(() => {
- mockUseAuthStore.mockImplementation((selector) =>
- selector
- ? selector({
- projectId: 42,
- oauthAccessToken: "token",
- })
- : {
- projectId: 42,
- oauthAccessToken: "token",
- },
- );
- mockGetIntegrations.mockReset();
- mockGetGithubRepositories.mockReset();
- useRepositoryCacheStore.setState({ options: [], updatedAt: null });
- });
-
- it("keeps repositories from healthy integrations when one repository fetch fails", async () => {
- mockGetIntegrations.mockResolvedValueOnce([
- {
- id: 7,
- kind: "github",
- display_name: "Personal GitHub",
- },
- {
- id: 11,
- kind: "github",
- display_name: "PostHog",
- },
- ]);
- mockGetGithubRepositories
- .mockResolvedValueOnce(["Annika/Mobile-App", ""])
- .mockRejectedValueOnce(new Error("GitHub repos failed"));
-
- const queryClient = new QueryClient({
- defaultOptions: {
- queries: { retry: false },
- },
- });
- const { result, unmount } = renderTestHook(
- () => useIntegrations(),
- createWrapper(queryClient),
- );
-
- await waitForAssertion(() => {
- expect(result.current.isLoading).toBe(false);
- expect(result.current.repositoryOptions).toEqual([
- {
- integrationId: 7,
- integrationLabel: "Personal GitHub",
- repository: "annika/mobile-app",
- },
- ]);
- });
-
- expect(result.current.repositoryWarning).toBe(
- "Some GitHub repositories could not be loaded. Pull to retry.",
- );
- expect(result.current.error).toBeNull();
- unmount();
- });
-
- it("surfaces integration fetch failures as blocking errors", async () => {
- mockGetIntegrations.mockRejectedValueOnce(
- new Error("Failed to fetch integrations"),
- );
-
- const queryClient = new QueryClient({
- defaultOptions: {
- queries: { retry: false },
- },
- });
- const { result, unmount } = renderTestHook(
- () => useIntegrations(),
- createWrapper(queryClient),
- );
-
- await waitForAssertion(() => {
- expect(result.current.isLoading).toBe(false);
- expect(result.current.error).toBe("Failed to fetch integrations");
- });
-
- expect(result.current.repositoryOptions).toEqual([]);
- expect(result.current.repositoryWarning).toBeNull();
- unmount();
- });
-
- it("skips integration loading when repository requirements are disabled", async () => {
- const queryClient = new QueryClient({
- defaultOptions: {
- queries: { retry: false },
- },
- });
- const { result, unmount } = renderTestHook(
- () => useIntegrations({ enabled: false }),
- createWrapper(queryClient),
- );
-
- expect(result.current.hasGithubIntegration).toBeNull();
- expect(result.current.githubIntegrations).toEqual([]);
- expect(result.current.repositories).toEqual([]);
- expect(result.current.repositoryOptions).toEqual([]);
- expect(result.current.isLoading).toBe(false);
- expect(result.current.error).toBeNull();
-
- await act(async () => {
- await result.current.refetch();
- });
-
- expect(mockGetIntegrations).not.toHaveBeenCalled();
- expect(mockGetGithubRepositories).not.toHaveBeenCalled();
- unmount();
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/tasks/hooks/useIntegrations.ts b/products/desktop/apps/mobile/src/features/tasks/hooks/useIntegrations.ts
deleted file mode 100644
index 97499a2a0d75..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/hooks/useIntegrations.ts
+++ /dev/null
@@ -1,202 +0,0 @@
-import { combineGithubRepositories } from "@posthog/core/integrations/repositories";
-import { useQuery } from "@tanstack/react-query";
-import { useEffect, useMemo } from "react";
-import { useAuthStore } from "@/features/auth";
-import { getPostHogApiClient } from "@/lib/posthogApiClient";
-import { useRepositoryCacheStore } from "../stores/repositoryCacheStore";
-import {
- buildRepositoryOptions,
- repositoryLoadWarning,
- repositoryOptionsEqual,
-} from "../utils/repositorySelection";
-
-export const integrationKeys = {
- all: ["integrations"] as const,
- lists: () => [...integrationKeys.all, "list"] as const,
- github: () => [...integrationKeys.all, "github"] as const,
- repos: (integrationId: number) =>
- [...integrationKeys.all, "repos", integrationId] as const,
-};
-
-interface RepositoryLoadResult {
- repositoriesByIntegration: Record<number, string[]>;
- partialError: string | null;
-}
-
-interface UseIntegrationsOptions {
- enabled?: boolean;
-}
-
-export function useIntegrations(options: UseIntegrationsOptions = {}) {
- const { enabled = true } = options;
- const { projectId, oauthAccessToken } = useAuthStore();
-
- // Persisted snapshot from the last successful fetch. Survives app launches
- // so the picker can render instantly while we refetch in the background.
- const cachedOptions = useRepositoryCacheStore((s) => s.options);
- const setCachedOptions = useRepositoryCacheStore((s) => s.setOptions);
-
- const integrationsQuery = useQuery({
- queryKey: integrationKeys.github(),
- queryFn: async () => {
- const data = await getPostHogApiClient().getIntegrations();
- return data.filter((i) => i.kind === "github");
- },
- enabled: enabled && !!projectId && !!oauthAccessToken,
- });
-
- const githubIntegrations = enabled ? (integrationsQuery.data ?? []) : [];
-
- const repositoriesQuery = useQuery({
- queryKey: [
- ...integrationKeys.all,
- "repos",
- githubIntegrations.map((i) => i.id),
- ],
- queryFn: async (): Promise<RepositoryLoadResult> => {
- const repositoriesByIntegration: Record<number, string[]> = {};
- const results = await Promise.allSettled(
- githubIntegrations.map(async (integration) => ({
- integrationId: integration.id,
- repositories: (
- await getPostHogApiClient().getGithubRepositories(integration.id)
- )
- .map((repository) => repository.toLowerCase())
- .filter(Boolean),
- })),
- );
-
- let failedCount = 0;
-
- for (const result of results) {
- if (result.status === "fulfilled") {
- repositoriesByIntegration[result.value.integrationId] =
- result.value.repositories;
- continue;
- }
-
- failedCount += 1;
- }
-
- return {
- repositoriesByIntegration,
- partialError: repositoryLoadWarning(
- failedCount,
- githubIntegrations.length,
- ),
- };
- },
- enabled: enabled && githubIntegrations.length > 0,
- });
-
- const repositoriesByIntegration =
- repositoriesQuery.data?.repositoriesByIntegration ?? {};
- const repositories = Object.keys(
- combineGithubRepositories(
- githubIntegrations.map((integration) => ({
- data: {
- integrationId: integration.id,
- repos: repositoriesByIntegration[integration.id] ?? [],
- },
- isPending: repositoriesQuery.isPending,
- isError: false,
- isRefetching: repositoriesQuery.isRefetching,
- })),
- githubIntegrations.map((integration) => integration.id),
- ).repositoryMap,
- ).sort();
-
- // Memoize the derived options list keyed on the underlying query data so
- // its reference is stable across renders when the data hasn't actually
- // changed. Without this, every render produces a fresh array — which both
- // churns the cache-write effect below AND defeats downstream React.memo /
- // useMemo callers that depend on `repositoryOptions`.
- const liveRepositoryOptions = useMemo(
- () => buildRepositoryOptions(githubIntegrations, repositoriesByIntegration),
- [githubIntegrations, repositoriesByIntegration],
- );
-
- // Mirror the latest successful fetch into the persisted cache so the next
- // cold start can render the picker instantly. We sync whatever the live
- // result is — including an empty array — but only once both queries have
- // succeeded, so a transient fetch failure or in-flight refresh can't wipe
- // out a working snapshot. Compare contents before writing so we don't
- // bump `updatedAt` (and re-render every cache subscriber) on no-op syncs.
- const integrationsSettled =
- integrationsQuery.isFetched && !integrationsQuery.isError;
- // biome-ignore lint/correctness/useExhaustiveDependencies: setCachedOptions is a stable Zustand action
- useEffect(() => {
- if (!enabled) return;
- if (!integrationsSettled) return;
- if (githubIntegrations.length === 0) {
- // No integrations — clear the cache so the picker doesn't surface
- // stale repos for a connection the user has since removed.
- if (cachedOptions.length > 0) setCachedOptions([]);
- return;
- }
- if (!repositoriesQuery.isSuccess) return;
- // Skip the write when the cache already matches — otherwise every
- // render that produces a structurally-equal options list (e.g. after
- // an unrelated re-render of the consumer) would push a new `updatedAt`,
- // re-trigger every cache subscriber, and the consumer's `useEffect`
- // would fire again on the new reference. Infinite loop.
- if (repositoryOptionsEqual(liveRepositoryOptions, cachedOptions)) return;
- setCachedOptions(liveRepositoryOptions);
- }, [
- enabled,
- integrationsSettled,
- githubIntegrations.length,
- repositoriesQuery.isSuccess,
- liveRepositoryOptions,
- cachedOptions,
- ]);
-
- // Prefer live data once it's in; fall back to the persisted snapshot so
- // consumers always have *something* to render on cold start.
- const repositoryOptions =
- liveRepositoryOptions.length > 0 ? liveRepositoryOptions : cachedOptions;
- const repositoryWarning = repositoriesQuery.data?.partialError ?? null;
- const hasCachedRepositories = cachedOptions.length > 0;
-
- const refetch = async () => {
- if (!enabled) {
- return;
- }
-
- await integrationsQuery.refetch();
- await repositoriesQuery.refetch();
- };
-
- return {
- hasGithubIntegration: !enabled
- ? null
- : integrationsQuery.isFetched
- ? githubIntegrations.length > 0
- : // If we have cached repos we know there's at least one integration,
- // so don't gate the screen on the integrations query.
- hasCachedRepositories
- ? true
- : null,
- githubIntegrations,
- repositories,
- repositoriesByIntegration,
- repositoryOptions,
- /** True iff we have cached options but the live fetch is still running.
- * Lets the UI render the cached list while showing a subtle background
- * refresh indicator instead of a blocking spinner. */
- isRefreshingInBackground:
- enabled &&
- hasCachedRepositories &&
- (integrationsQuery.isLoading || repositoriesQuery.isLoading),
- /** Only true when we have nothing to show yet — no cache, no live data.
- * Consumers should treat this as "block the screen on a spinner";
- * background refreshes don't count. */
- isLoading: enabled
- ? !hasCachedRepositories &&
- (integrationsQuery.isLoading || repositoriesQuery.isLoading)
- : false,
- error: enabled ? (integrationsQuery.error?.message ?? null) : null,
- repositoryWarning: enabled ? repositoryWarning : null,
- refetch,
- };
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/hooks/useMessagingMode.ts b/products/desktop/apps/mobile/src/features/tasks/hooks/useMessagingMode.ts
deleted file mode 100644
index 9e6cae927779..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/hooks/useMessagingMode.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-import { useCallback } from "react";
-import { useMessageQueueStore } from "../stores/messageQueueStore";
-import {
- type MessagingMode,
- useMessagingModeStore,
-} from "../stores/messagingModeStore";
-import { useTaskSessionStore } from "../stores/taskSessionStore";
-
-/** Effective mode for a task: per-task override, else the global default. */
-export function useMessagingMode(taskId: string | undefined): MessagingMode {
- return useMessagingModeStore((s) => s.getEffectiveMode(taskId));
-}
-
-export function useQueuedCount(taskId: string | undefined): number {
- return useMessageQueueStore((s) => (taskId ? s.getQueue(taskId).length : 0));
-}
-
-/**
- * Toggle the per-task messaging mode. Switching to Steer flushes any buffered
- * messages into the current turn so nothing stays stuck in a queue the user
- * just turned off.
- */
-export function useToggleMessagingMode(taskId: string | undefined): () => void {
- const mode = useMessagingMode(taskId);
- return useCallback(() => {
- if (!taskId) return;
- const next: MessagingMode = mode === "steer" ? "queue" : "steer";
- useMessagingModeStore.getState().setMode(taskId, next);
- if (next === "steer") {
- void useTaskSessionStore.getState().flushQueuedMessages(taskId);
- }
- }, [taskId, mode]);
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/hooks/useOrgMembers.ts b/products/desktop/apps/mobile/src/features/tasks/hooks/useOrgMembers.ts
deleted file mode 100644
index 6fd6f4aae242..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/hooks/useOrgMembers.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-import type { UserBasic } from "@posthog/shared/domain-types";
-import { useQuery } from "@tanstack/react-query";
-import { useMemo } from "react";
-import { useAuthStore } from "@/features/auth";
-import { getPostHogApiClient } from "@/lib/posthogApiClient";
-import { userDisplayName } from "../utils/userDisplayName";
-
-// Membership churn is slow; one fetch per session window is plenty.
-const ORG_MEMBERS_STALE_MS = 5 * 60_000;
-
-export function useOrgMembers(options?: { enabled?: boolean }): {
- members: UserBasic[];
- isLoading: boolean;
-} {
- const { projectId, oauthAccessToken } = useAuthStore();
-
- const query = useQuery({
- queryKey: ["org-members"],
- queryFn: () => getPostHogApiClient().listOrganizationMembersWithStatus(),
- enabled: (options?.enabled ?? true) && !!projectId && !!oauthAccessToken,
- staleTime: ORG_MEMBERS_STALE_MS,
- });
-
- const members = useMemo(
- () =>
- (query.data?.members ?? [])
- .flatMap((member) => (member.user?.email ? [member.user] : []))
- .sort((a, b) => userDisplayName(a).localeCompare(userDisplayName(b))),
- [query.data],
- );
-
- return { members, isLoading: query.isLoading };
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/hooks/usePrChangedFiles.ts b/products/desktop/apps/mobile/src/features/tasks/hooks/usePrChangedFiles.ts
deleted file mode 100644
index ff757b07df41..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/hooks/usePrChangedFiles.ts
+++ /dev/null
@@ -1,66 +0,0 @@
-import { useQuery } from "@tanstack/react-query";
-import { logger } from "@/lib/logger";
-
-const log = logger.scope("usePrChangedFiles");
-
-export type ChangedFileStatus =
- | "added"
- | "removed"
- | "modified"
- | "renamed"
- | "copied"
- | "changed"
- | "unchanged";
-
-export interface ChangedFile {
- filename: string;
- status: ChangedFileStatus;
- additions: number;
- deletions: number;
- previous_filename?: string;
- patch?: string;
-}
-
-function parsePrUrl(prUrl: string) {
- const match = prUrl.match(
- /^https?:\/\/github\.com\/([^/]+)\/([^/]+)\/pull\/(\d+)/,
- );
- if (!match) return null;
- return { owner: match[1], repo: match[2], number: match[3] };
-}
-
-export const prChangedFilesKeys = {
- byUrl: (prUrl: string) => ["pr-changed-files", prUrl] as const,
-};
-
-// Fetches the file-level diff for a PR via GitHub's public REST API. Public
-// repos respond without auth; private repos return 404 — handled as an empty
-// list so the screen can render a friendly "no preview" state.
-export function usePrChangedFiles(prUrl: string | null | undefined) {
- return useQuery({
- queryKey: prChangedFilesKeys.byUrl(prUrl ?? ""),
- enabled: !!prUrl,
- staleTime: 60_000,
- retry: 1,
- queryFn: async (): Promise<ChangedFile[]> => {
- if (!prUrl) return [];
- const p = parsePrUrl(prUrl);
- if (!p) return [];
-
- try {
- const res = await fetch(
- `https://api.github.com/repos/${p.owner}/${p.repo}/pulls/${p.number}/files?per_page=100`,
- { headers: { Accept: "application/vnd.github+json" } },
- );
- if (!res.ok) {
- log.info("PR files unavailable", { status: res.status });
- return [];
- }
- return (await res.json()) as ChangedFile[];
- } catch (err) {
- log.warn("Failed to fetch PR files", err);
- return [];
- }
- },
- });
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/hooks/usePrStatus.ts b/products/desktop/apps/mobile/src/features/tasks/hooks/usePrStatus.ts
deleted file mode 100644
index 0c4ed080eab1..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/hooks/usePrStatus.ts
+++ /dev/null
@@ -1,71 +0,0 @@
-import { useQuery } from "@tanstack/react-query";
-import { logger } from "@/lib/logger";
-
-const log = logger.scope("usePrStatus");
-
-export interface PrStatus {
- state: "open" | "closed";
- merged: boolean;
- draft: boolean;
- additions: number;
- deletions: number;
-}
-
-function parsePrUrl(
- prUrl: string,
-): { owner: string; repo: string; number: string } | null {
- const match = prUrl.match(
- /^https?:\/\/github\.com\/([^/]+)\/([^/]+)\/pull\/(\d+)/,
- );
- if (!match) return null;
- return { owner: match[1], repo: match[2], number: match[3] };
-}
-
-export const prStatusKeys = {
- byUrl: (prUrl: string) => ["pr-status", prUrl] as const,
-};
-
-// Fetches PR state via GitHub's public REST API. Public repos respond without
-// auth; private repos return 404 — in that case we resolve to `null` and the
-// UI falls back to a neutral icon (still tappable to open the PR).
-export function usePrStatus(prUrl: string | null | undefined) {
- return useQuery({
- queryKey: prStatusKeys.byUrl(prUrl ?? ""),
- enabled: !!prUrl,
- staleTime: 60_000,
- retry: 1,
- queryFn: async (): Promise<PrStatus | null> => {
- if (!prUrl) return null;
- const parsed = parsePrUrl(prUrl);
- if (!parsed) return null;
-
- try {
- const res = await fetch(
- `https://api.github.com/repos/${parsed.owner}/${parsed.repo}/pulls/${parsed.number}`,
- { headers: { Accept: "application/vnd.github+json" } },
- );
- if (!res.ok) {
- log.info("PR details unavailable", { status: res.status });
- return null;
- }
- const data = (await res.json()) as {
- state: string;
- merged: boolean;
- draft: boolean;
- additions?: number;
- deletions?: number;
- };
- return {
- state: data.state === "closed" ? "closed" : "open",
- merged: !!data.merged,
- draft: !!data.draft,
- additions: data.additions ?? 0,
- deletions: data.deletions ?? 0,
- };
- } catch (err) {
- log.warn("Failed to fetch PR status", err);
- return null;
- }
- },
- });
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/hooks/useTaskArtifacts.ts b/products/desktop/apps/mobile/src/features/tasks/hooks/useTaskArtifacts.ts
deleted file mode 100644
index 9a6f655bf435..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/hooks/useTaskArtifacts.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-import type { TaskRunArtifact } from "@posthog/shared";
-import { useQuery } from "@tanstack/react-query";
-import { getProjectId } from "@/lib/api";
-import { getTaskRun } from "../api";
-
-// Matches the manifest staleness used for attachment previews so both share the
-// same ["taskRunArtifacts", …] cache entry and refetch on the same schedule.
-const ARTIFACTS_STALE_MS = 50 * 60 * 1000;
-
-/**
- * Lists a run's generated output artifacts. `enabled` should gate on a terminal
- * run status — mirrors desktop, which only fetches the manifest once the run
- * has finished producing files.
- */
-export function useTaskArtifacts(
- taskId: string | undefined,
- runId: string | undefined,
- enabled: boolean,
-) {
- const projectId = getProjectId();
-
- return useQuery({
- queryKey: ["taskRunArtifacts", projectId, taskId, runId],
- enabled: enabled && Boolean(taskId && runId),
- staleTime: ARTIFACTS_STALE_MS,
- retry: false,
- queryFn: async (): Promise<TaskRunArtifact[]> =>
- (await getTaskRun(taskId ?? "", runId ?? "")).artifacts ?? [],
- select: (artifacts) => artifacts.filter((a) => a.type === "output"),
- });
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/hooks/useTasks.test.ts b/products/desktop/apps/mobile/src/features/tasks/hooks/useTasks.test.ts
deleted file mode 100644
index 1395c283e8fb..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/hooks/useTasks.test.ts
+++ /dev/null
@@ -1,131 +0,0 @@
-import { beforeEach, describe, expect, it, vi } from "vitest";
-
-const { mockUseAuthStore, mockUseUserQuery, mockUseTaskStore } = vi.hoisted(
- () => ({
- mockUseAuthStore: vi.fn(),
- mockUseUserQuery: vi.fn(),
- mockUseTaskStore: vi.fn(),
- }),
-);
-
-vi.mock("@/features/auth", () => ({
- useAuthStore: mockUseAuthStore,
- useUserQuery: mockUseUserQuery,
-}));
-
-vi.mock("@/lib/logger", () => {
- const mockLogger = {
- info: vi.fn(),
- warn: vi.fn(),
- error: vi.fn(),
- debug: vi.fn(),
- scope: () => mockLogger,
- };
-
- return {
- logger: mockLogger,
- };
-});
-
-vi.mock("@/lib/posthogApiClient", () => ({
- getPostHogApiClient: vi.fn(() => ({
- createTask: vi.fn(),
- deleteTask: vi.fn(),
- getTask: vi.fn(),
- getTasks: vi.fn(),
- runTaskInCloud: vi.fn(),
- updateTask: vi.fn(),
- })),
-}));
-
-vi.mock("../stores/taskStore", () => ({
- filterAndSortTasks: vi.fn((tasks) => tasks),
- useTaskStore: mockUseTaskStore,
-}));
-
-import { getTaskPollingInterval } from "./useTasks";
-
-const baseTask = {
- id: "task-1",
- task_number: 1,
- slug: "task-1",
- title: "Task 1",
- description: "Do something",
- created_at: "2026-05-13T00:00:00Z",
- updated_at: "2026-05-13T00:00:00Z",
- origin_product: "user_created",
-};
-
-describe("useTasks", () => {
- beforeEach(() => {
- mockUseAuthStore.mockReset();
- mockUseUserQuery.mockReset();
- mockUseTaskStore.mockReset();
- });
-
- it("only polls task queries while a run is still active", () => {
- expect(getTaskPollingInterval(undefined)).toBe(false);
- expect(getTaskPollingInterval(baseTask)).toBe(false);
- expect(
- getTaskPollingInterval({
- ...baseTask,
- latest_run: {
- id: "run-1",
- task: "task-1",
- team: 1,
- branch: null,
- environment: "cloud",
- status: "in_progress",
- log_url: "https://example.com/logs",
- error_message: null,
- output: null,
- state: {},
- created_at: "2026-05-13T00:00:00Z",
- updated_at: "2026-05-13T00:00:00Z",
- completed_at: null,
- },
- }),
- ).toBe(5_000);
- expect(
- getTaskPollingInterval([
- {
- ...baseTask,
- latest_run: {
- id: "run-2",
- task: "task-1",
- team: 1,
- branch: null,
- environment: "cloud",
- status: "completed",
- log_url: "https://example.com/logs",
- error_message: null,
- output: null,
- state: {},
- created_at: "2026-05-13T00:00:00Z",
- updated_at: "2026-05-13T00:00:00Z",
- completed_at: "2026-05-13T00:01:00Z",
- },
- },
- {
- ...baseTask,
- id: "task-2",
- latest_run: {
- id: "run-3",
- task: "task-2",
- team: 1,
- branch: null,
- environment: "cloud",
- status: "in_progress",
- log_url: "https://example.com/logs",
- error_message: null,
- output: null,
- state: {},
- created_at: "2026-05-13T00:00:00Z",
- updated_at: "2026-05-13T00:00:00Z",
- completed_at: null,
- },
- },
- ]),
- ).toBe(5_000);
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/tasks/hooks/useTasks.ts b/products/desktop/apps/mobile/src/features/tasks/hooks/useTasks.ts
deleted file mode 100644
index c80804e9762b..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/hooks/useTasks.ts
+++ /dev/null
@@ -1,203 +0,0 @@
-import { filterAndSortTasks } from "@posthog/core/tasks/taskActivity";
-import type { Task } from "@posthog/shared";
-import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
-import { useAuthStore, useUserQuery } from "@/features/auth";
-import { logger } from "@/lib/logger";
-import { getPostHogApiClient } from "@/lib/posthogApiClient";
-import { useTaskStore } from "../stores/taskStore";
-import type { CreateTaskOptions } from "../types";
-
-const log = logger.scope("tasks-mutations");
-const ACTIVE_TASK_POLLING_INTERVAL_MS = 5_000;
-const TERMINAL_TASK_RUN_STATUSES = new Set([
- "completed",
- "failed",
- "cancelled",
-]);
-
-export const taskKeys = {
- all: ["tasks"] as const,
- lists: () => [...taskKeys.all, "list"] as const,
- list: (filters?: {
- repository?: string;
- createdBy?: number;
- originProduct?: string;
- }) => [...taskKeys.lists(), filters] as const,
- details: () => [...taskKeys.all, "detail"] as const,
- detail: (id: string) => [...taskKeys.details(), id] as const,
-};
-
-export function getTaskPollingInterval(
- taskData: Task | Task[] | undefined,
-): number | false {
- if (!taskData) {
- return false;
- }
-
- if (Array.isArray(taskData)) {
- return taskData.some((task) => {
- const status = task.latest_run?.status;
- return !!status && !TERMINAL_TASK_RUN_STATUSES.has(status);
- })
- ? ACTIVE_TASK_POLLING_INTERVAL_MS
- : false;
- }
-
- const status = taskData.latest_run?.status;
- return status && !TERMINAL_TASK_RUN_STATUSES.has(status)
- ? ACTIVE_TASK_POLLING_INTERVAL_MS
- : false;
-}
-
-export function useTasks(filters?: {
- repository?: string;
- originProduct?: string;
-}) {
- const { projectId, oauthAccessToken } = useAuthStore();
- const { data: currentUser } = useUserQuery();
- const { sortMode, showInternal, filter } = useTaskStore();
-
- const queryFilters = {
- ...filters,
- createdBy: currentUser?.id,
- };
-
- const query = useQuery({
- queryKey: taskKeys.list(queryFilters),
- queryFn: () => getPostHogApiClient().getTasks(queryFilters),
- enabled: !!projectId && !!oauthAccessToken && !!currentUser?.id,
- refetchInterval: (query) =>
- getTaskPollingInterval(query.state.data as Task[] | undefined),
- });
-
- // Mobile never runs tasks locally — hide desktop-only local runs so the
- // mobile list mirrors what's actually shareable across devices.
- const cloudTasks = (query.data ?? []).filter(
- (task) => task.latest_run?.environment !== "local",
- );
-
- const filteredTasks = filterAndSortTasks(
- cloudTasks,
- sortMode,
- showInternal,
- filter,
- );
-
- return {
- tasks: filteredTasks,
- allTasks: cloudTasks,
- isLoading: query.isLoading,
- error: query.error?.message ?? null,
- refetch: query.refetch,
- };
-}
-
-export function useTask(taskId: string) {
- const { projectId, oauthAccessToken } = useAuthStore();
-
- return useQuery({
- queryKey: taskKeys.detail(taskId),
- queryFn: () => getPostHogApiClient().getTask(taskId),
- enabled: !!projectId && !!oauthAccessToken && !!taskId,
- refetchInterval: (query) =>
- getTaskPollingInterval(query.state.data as Task | undefined),
- });
-}
-
-export function useCreateTask() {
- const queryClient = useQueryClient();
-
- const invalidateTasks = () => {
- queryClient.invalidateQueries({ queryKey: taskKeys.lists() });
- };
-
- const mutation = useMutation({
- mutationFn: (options: CreateTaskOptions) =>
- getPostHogApiClient().createTask(options),
- onSuccess: () => {
- invalidateTasks();
- },
- onError: (error) => {
- log.error("Failed to create task", error.message);
- },
- });
-
- return { ...mutation, invalidateTasks };
-}
-
-export function useUpdateTask() {
- const queryClient = useQueryClient();
-
- return useMutation({
- mutationFn: ({
- taskId,
- updates,
- }: {
- taskId: string;
- updates: Partial<Task>;
- }) => {
- const client = getPostHogApiClient();
- return client.updateTask(
- taskId,
- updates as Parameters<typeof client.updateTask>[1],
- );
- },
- onSuccess: (updatedTask, { taskId }) => {
- // Update the detail cache immediately
- queryClient.setQueryData(taskKeys.detail(taskId), updatedTask);
- queryClient.invalidateQueries({ queryKey: taskKeys.lists() });
- },
- onError: (error) => {
- log.error("Failed to update task", error.message);
- },
- });
-}
-
-export function useDeleteTask() {
- const queryClient = useQueryClient();
-
- return useMutation({
- mutationFn: (taskId: string) => getPostHogApiClient().deleteTask(taskId),
- onSuccess: (_, taskId) => {
- // Remove from detail cache
- queryClient.removeQueries({ queryKey: taskKeys.detail(taskId) });
- queryClient.invalidateQueries({ queryKey: taskKeys.lists() });
- },
- onError: (error) => {
- log.error("Failed to delete task", error.message);
- },
- });
-}
-
-export function useHandoffTask() {
- const queryClient = useQueryClient();
-
- return useMutation({
- mutationFn: ({ taskId, userId }: { taskId: string; userId: number }) =>
- getPostHogApiClient().handoffTask(taskId, userId),
- // The task may leave the requester's own list, so nothing is seeded.
- onSuccess: (_, { taskId }) => {
- queryClient.invalidateQueries({ queryKey: taskKeys.lists() });
- queryClient.invalidateQueries({ queryKey: taskKeys.detail(taskId) });
- },
- onError: (error) => {
- log.error("Failed to hand off task", error.message);
- },
- });
-}
-
-export function useRunTask() {
- const queryClient = useQueryClient();
-
- return useMutation({
- mutationFn: (taskId: string) =>
- getPostHogApiClient().runTaskInCloud(taskId),
- onSuccess: (updatedTask, taskId) => {
- queryClient.setQueryData(taskKeys.detail(taskId), updatedTask);
- queryClient.invalidateQueries({ queryKey: taskKeys.lists() });
- },
- onError: (error) => {
- log.error("Failed to run task", error.message);
- },
- });
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/hooks/useUserIntegrations.ts b/products/desktop/apps/mobile/src/features/tasks/hooks/useUserIntegrations.ts
deleted file mode 100644
index 8cd5d44b0381..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/hooks/useUserIntegrations.ts
+++ /dev/null
@@ -1,156 +0,0 @@
-import { combineUserGithubRepositories } from "@posthog/core/integrations/repositories";
-import { useQuery } from "@tanstack/react-query";
-import { useCallback, useMemo } from "react";
-import { useAuthStore } from "@/features/auth";
-import { getPostHogApiClient } from "@/lib/posthogApiClient";
-import type { RepositoryOption } from "../types";
-import {
- buildUserRepositoryOptions,
- repositoryLoadWarning,
-} from "../utils/repositorySelection";
-
-/**
- * User-scoped sibling of {@link useIntegrations}. Reads the authenticated
- * user's personal GitHub integrations (`/api/users/@me/integrations/`) rather
- * than the team-level ones, matching how the desktop app links GitHub per user.
- *
- * Used by the interactive task-creation flow (new task screen, task list empty
- * state, connect prompt).
- *
- * Repos are keyed by the numeric GitHub `installation_id` so the existing
- * number-based picker/`RepositoryOption` keep working; `getUserIntegrationId`
- * maps that back to the `UserIntegration` UUID for task creation. No persisted
- * cache here (unlike the team hook) so it can't clobber the team cache.
- */
-export const userIntegrationKeys = {
- all: ["user-integrations"] as const,
- github: () => [...userIntegrationKeys.all, "github"] as const,
- repos: (installationIds: string[]) =>
- [...userIntegrationKeys.all, "repos", installationIds] as const,
-};
-
-interface UseUserIntegrationsOptions {
- enabled?: boolean;
-}
-
-export function useUserIntegrations(options: UseUserIntegrationsOptions = {}) {
- const { enabled = true } = options;
- const { oauthAccessToken } = useAuthStore();
-
- const integrationsQuery = useQuery({
- queryKey: userIntegrationKeys.github(),
- queryFn: async () => {
- const integrations =
- await getPostHogApiClient().getGithubUserIntegrations();
- return integrations.map(({ account, ...integration }) => ({
- ...integration,
- account: account
- ? {
- name: account.name ?? undefined,
- type: account.type ?? undefined,
- }
- : undefined,
- }));
- },
- enabled: enabled && !!oauthAccessToken,
- });
-
- const integrations = enabled ? (integrationsQuery.data ?? []) : [];
-
- const repositoriesQuery = useQuery({
- queryKey: userIntegrationKeys.repos(
- integrations.map((i) => i.installation_id),
- ),
- queryFn: async () => {
- const results = await Promise.allSettled(
- integrations.map(async (integration) => ({
- installationId: integration.installation_id,
- repositories: (
- await getPostHogApiClient().getGithubUserRepositories(
- integration.installation_id,
- )
- )
- .map((repository) => repository.toLowerCase())
- .filter(Boolean),
- })),
- );
-
- const combined = combineUserGithubRepositories(
- results.map((result) => ({
- data:
- result.status === "fulfilled"
- ? {
- userIntegrationId:
- integrations.find(
- (integration) =>
- integration.installation_id ===
- result.value.installationId,
- )?.id ?? "",
- installationId: result.value.installationId,
- repos: result.value.repositories,
- }
- : undefined,
- isPending: false,
- isError: result.status === "rejected",
- isRefetching: false,
- })),
- integrations.map((integration) => integration.installation_id),
- );
-
- return {
- byInstallation: combined.reposByInstallationId,
- partialError: repositoryLoadWarning(
- combined.failedInstallationIds.length,
- integrations.length,
- ),
- };
- },
- enabled: enabled && integrations.length > 0,
- });
-
- const repositoryOptions = useMemo<RepositoryOption[]>(() => {
- return buildUserRepositoryOptions(
- integrations,
- repositoriesQuery.data?.byInstallation ?? {},
- );
- }, [integrations, repositoriesQuery.data]);
-
- /** Resolve the `UserIntegration` UUID for a selected installation id, to send
- * as `github_user_integration` on task creation. */
- const getUserIntegrationId = useCallback(
- (installationId: number | null): string | undefined => {
- if (installationId == null) return undefined;
- return integrations.find(
- (i) => Number(i.installation_id) === installationId,
- )?.id;
- },
- [integrations],
- );
-
- const refetch = useCallback(async () => {
- if (!enabled) return;
- await integrationsQuery.refetch();
- await repositoriesQuery.refetch();
- }, [enabled, integrationsQuery, repositoriesQuery]);
-
- return {
- hasGithubIntegration: !enabled
- ? null
- : integrationsQuery.isFetched
- ? integrations.length > 0
- : null,
- integrations,
- repositoryOptions,
- getUserIntegrationId,
- // No persisted cache, so there is no "cached list while refreshing" state.
- isRefreshingInBackground: false,
- isLoading: enabled
- ? integrationsQuery.isLoading || repositoriesQuery.isLoading
- : false,
- error: enabled ? (integrationsQuery.error?.message ?? null) : null,
- repositoryWarning: enabled
- ? (repositoriesQuery.data?.partialError ?? null)
- : null,
- refetch,
- };
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/hooks/useWarmTask.test.tsx b/products/desktop/apps/mobile/src/features/tasks/hooks/useWarmTask.test.tsx
deleted file mode 100644
index 73d3b6ec9868..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/hooks/useWarmTask.test.tsx
+++ /dev/null
@@ -1,325 +0,0 @@
-import type { ExecutionMode } from "@posthog/shared";
-import { createElement } from "react";
-import { act, create, type ReactTestRenderer } from "react-test-renderer";
-import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
-
-const { mockWarmTask } = vi.hoisted(() => ({ mockWarmTask: vi.fn() }));
-const flagState = vi.hoisted(() => ({ enabled: true as boolean }));
-
-vi.mock("posthog-react-native", () => ({
- useFeatureFlag: () => flagState.enabled,
-}));
-vi.mock("@/lib/posthogApiClient", () => ({
- getPostHogApiClient: vi.fn(() => ({
- warmTask: mockWarmTask,
- })),
-}));
-vi.mock("@/lib/logger", () => {
- const mockLogger = {
- info: vi.fn(),
- warn: vi.fn(),
- error: vi.fn(),
- debug: vi.fn(),
- scope: () => mockLogger,
- };
- return { logger: mockLogger };
-});
-
-import { useWarmTask } from "./useWarmTask";
-
-interface Props {
- repository?: string | null;
- githubIntegrationId?: number | null;
- branch?: string | null;
- composerIsEmpty: boolean;
- runtimeAdapter?: string | null;
- model?: string | null;
- reasoningEffort?: string | null;
- permissionMode?: ExecutionMode | null;
- contextWindow?: "200k" | "1m" | null;
- fastMode?: boolean | null;
- sandboxEnvironmentId?: string | null;
- customImageId?: string | null;
-}
-
-const composing: Props = {
- repository: "acme/repo",
- githubIntegrationId: 42,
- branch: "main",
- composerIsEmpty: false,
-};
-
-const NULL_RUNTIME = {
- runtime_adapter: null,
- model: null,
- reasoning_effort: null,
- initial_permission_mode: null,
-};
-
-function render(initial: Props) {
- let current = initial;
- function Wrapper() {
- useWarmTask(current);
- return null;
- }
- let renderer: ReactTestRenderer | null = null;
- act(() => {
- renderer = create(createElement(Wrapper));
- });
- return {
- rerender: (next: Props) => {
- current = next;
- act(() => {
- renderer?.update(createElement(Wrapper));
- });
- },
- };
-}
-
-async function flushDebounce(): Promise<void> {
- await act(async () => {
- await vi.advanceTimersByTimeAsync(600);
- });
-}
-
-describe("useWarmTask", () => {
- beforeEach(() => {
- vi.useFakeTimers();
- vi.clearAllMocks();
- flagState.enabled = true;
- mockWarmTask.mockResolvedValue({ task_id: "task-1", run_id: "run-1" });
- });
-
- afterEach(() => {
- vi.runOnlyPendingTimers();
- vi.useRealTimers();
- });
-
- it("fires a debounced warm when repo selected + composing", async () => {
- render(composing);
- expect(mockWarmTask).not.toHaveBeenCalled();
-
- await flushDebounce();
-
- expect(mockWarmTask).toHaveBeenCalledWith({
- repository: "acme/repo",
- github_integration: 42,
- branch: "main",
- ...NULL_RUNTIME,
- });
- });
-
- it.each<{ name: string; props?: Partial<Props>; flagEnabled?: boolean }>([
- { name: "the flag is off", flagEnabled: false },
- { name: "no repository is selected", props: { repository: null } },
- { name: "no github integration", props: { githubIntegrationId: null } },
- { name: "the composer is empty", props: { composerIsEmpty: true } },
- ])("does not fire when $name", async ({ props, flagEnabled }) => {
- if (flagEnabled === false) {
- flagState.enabled = false;
- }
- render({ ...composing, ...props });
- await flushDebounce();
- expect(mockWarmTask).not.toHaveBeenCalled();
- });
-
- it("fires once the composer becomes non-empty", async () => {
- const { rerender } = render({ ...composing, composerIsEmpty: true });
- await flushDebounce();
- expect(mockWarmTask).not.toHaveBeenCalled();
-
- rerender(composing);
- await flushDebounce();
- expect(mockWarmTask).toHaveBeenCalledOnce();
- });
-
- it("does not re-fire for the same key after the composer empties and refills", async () => {
- const { rerender } = render(composing);
- await flushDebounce();
- expect(mockWarmTask).toHaveBeenCalledOnce();
-
- // Toggling `composerIsEmpty` flips `eligible` (a dep), so the effect
- // re-runs with the same key — the `lastWarmedKeyRef` guard, not React's
- // bail-out, is what blocks a second warm.
- rerender({ ...composing, composerIsEmpty: true });
- await flushDebounce();
- rerender({ ...composing, composerIsEmpty: false });
- await flushDebounce();
- expect(mockWarmTask).toHaveBeenCalledOnce();
- });
-
- it.each<{
- name: string;
- initial?: Partial<Props>;
- change: Partial<Props>;
- expected: Record<string, unknown>;
- }>([
- {
- name: "repository",
- change: { repository: "acme/other" },
- expected: {
- repository: "acme/other",
- github_integration: 42,
- branch: "main",
- ...NULL_RUNTIME,
- },
- },
- {
- name: "branch",
- change: { branch: "feature/x" },
- expected: {
- repository: "acme/repo",
- github_integration: 42,
- branch: "feature/x",
- ...NULL_RUNTIME,
- },
- },
- {
- name: "model",
- initial: {
- runtimeAdapter: "claude",
- model: "claude-opus-4-8",
- reasoningEffort: "high",
- },
- change: { model: "claude-sonnet-4-6" },
- expected: {
- repository: "acme/repo",
- github_integration: 42,
- branch: "main",
- runtime_adapter: "claude",
- model: "claude-sonnet-4-6",
- reasoning_effort: "high",
- initial_permission_mode: null,
- },
- },
- ])(
- "warms the new selection when the $name changes",
- async ({ initial, change, expected }) => {
- const base = { ...composing, ...initial };
- const { rerender } = render(base);
- await flushDebounce();
- expect(mockWarmTask).toHaveBeenCalledOnce();
-
- rerender({ ...base, ...change });
- await flushDebounce();
-
- expect(mockWarmTask).toHaveBeenLastCalledWith(expected);
- expect(mockWarmTask).toHaveBeenCalledTimes(2);
- },
- );
-
- it("forwards context window and fast mode", async () => {
- render({
- ...composing,
- runtimeAdapter: "claude",
- model: "claude-opus-4-8",
- reasoningEffort: "high",
- contextWindow: "200k",
- fastMode: true,
- });
- await flushDebounce();
-
- expect(mockWarmTask).toHaveBeenCalledWith({
- repository: "acme/repo",
- github_integration: 42,
- branch: "main",
- runtime_adapter: "claude",
- model: "claude-opus-4-8",
- reasoning_effort: "high",
- initial_permission_mode: null,
- context_window: "200k",
- fast_mode: true,
- });
- });
-
- it("forwards the sandbox environment and custom image", async () => {
- render({
- ...composing,
- sandboxEnvironmentId: "environment-123",
- customImageId: "image-123",
- });
- await flushDebounce();
-
- expect(mockWarmTask).toHaveBeenCalledWith({
- repository: "acme/repo",
- github_integration: 42,
- branch: "main",
- ...NULL_RUNTIME,
- sandbox_environment_id: "environment-123",
- custom_image_id: "image-123",
- });
- });
-
- it("re-warms when the custom image changes", async () => {
- const { rerender } = render({ ...composing, customImageId: "image-123" });
- await flushDebounce();
- expect(mockWarmTask).toHaveBeenCalledOnce();
-
- rerender({ ...composing, customImageId: "image-456" });
- await flushDebounce();
-
- expect(mockWarmTask).toHaveBeenCalledTimes(2);
- expect(mockWarmTask).toHaveBeenLastCalledWith({
- repository: "acme/repo",
- github_integration: 42,
- branch: "main",
- ...NULL_RUNTIME,
- custom_image_id: "image-456",
- });
- });
-
- it("warms again for a new selection after a failed warm", async () => {
- mockWarmTask.mockRejectedValueOnce(new Error("boom"));
- const { rerender } = render(composing);
- await flushDebounce();
- expect(mockWarmTask).toHaveBeenCalledOnce();
-
- rerender({ ...composing, branch: "feature/x" });
- await flushDebounce();
- expect(mockWarmTask).toHaveBeenCalledTimes(2);
- });
-
- it("forwards the permission mode picked in the composer", async () => {
- render({ ...composing, runtimeAdapter: "claude", permissionMode: "plan" });
- await flushDebounce();
-
- expect(mockWarmTask).toHaveBeenCalledWith({
- repository: "acme/repo",
- github_integration: 42,
- branch: "main",
- runtime_adapter: "claude",
- model: null,
- reasoning_effort: null,
- initial_permission_mode: "plan",
- });
- });
-
- it("re-warms when the permission mode changes", async () => {
- const base = { ...composing, runtimeAdapter: "claude" };
- const { rerender } = render({ ...base, permissionMode: "plan" });
- await flushDebounce();
- expect(mockWarmTask).toHaveBeenCalledOnce();
-
- rerender({ ...base, permissionMode: "auto" });
- await flushDebounce();
-
- expect(mockWarmTask).toHaveBeenCalledTimes(2);
- expect(mockWarmTask).toHaveBeenLastCalledWith({
- repository: "acme/repo",
- github_integration: 42,
- branch: "main",
- runtime_adapter: "claude",
- model: null,
- reasoning_effort: null,
- initial_permission_mode: "auto",
- });
- });
-
- it("swallows warm errors without throwing", async () => {
- mockWarmTask.mockRejectedValue(new Error("boom"));
- render(composing);
-
- await expect(flushDebounce()).resolves.not.toThrow();
- expect(mockWarmTask).toHaveBeenCalledOnce();
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/tasks/hooks/useWarmTask.ts b/products/desktop/apps/mobile/src/features/tasks/hooks/useWarmTask.ts
deleted file mode 100644
index a7b5fdc00695..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/hooks/useWarmTask.ts
+++ /dev/null
@@ -1,137 +0,0 @@
-import {
- type ExecutionMode,
- TASKS_PREWARM_SANDBOX_FLAG,
-} from "@posthog/shared";
-import { useFeatureFlag } from "posthog-react-native";
-import { useEffect, useRef } from "react";
-import { logger } from "@/lib/logger";
-import { getPostHogApiClient } from "@/lib/posthogApiClient";
-
-const log = logger.scope("warm-task");
-
-const WARM_DEBOUNCE_MS = 600;
-
-interface UseWarmTaskOptions {
- repository?: string | null;
- githubIntegrationId?: number | null;
- branch?: string | null;
- composerIsEmpty: boolean;
- runtimeAdapter?: string | null;
- model?: string | null;
- reasoningEffort?: string | null;
- permissionMode?: ExecutionMode | null;
- contextWindow?: "200k" | "1m" | null;
- fastMode?: boolean | null;
- sandboxEnvironmentId?: string | null;
- customImageId?: string | null;
-}
-
-export function useWarmTask({
- repository,
- githubIntegrationId,
- branch,
- composerIsEmpty,
- runtimeAdapter,
- model,
- reasoningEffort,
- permissionMode,
- contextWindow,
- fastMode,
- sandboxEnvironmentId,
- customImageId,
-}: UseWarmTaskOptions): void {
- const enabled = useFeatureFlag(TASKS_PREWARM_SANDBOX_FLAG);
-
- const debounceRef = useRef<ReturnType<typeof setTimeout> | null>(null);
- const lastWarmedKeyRef = useRef<string | null>(null);
-
- const normalizedBranch = branch ?? null;
- const normalizedRuntimeAdapter = runtimeAdapter ?? null;
- const normalizedModel = model ?? null;
- const normalizedReasoningEffort = reasoningEffort ?? null;
- const normalizedPermissionMode = runtimeAdapter
- ? (permissionMode ?? null)
- : null;
- const normalizedContextWindow = contextWindow ?? null;
- const normalizedFastMode = fastMode ?? null;
- const normalizedSandboxEnvironmentId = sandboxEnvironmentId ?? null;
- const normalizedCustomImageId = customImageId ?? null;
- const eligible =
- !!enabled &&
- !!repository &&
- githubIntegrationId != null &&
- !composerIsEmpty;
- const key =
- repository && githubIntegrationId != null
- ? `${githubIntegrationId}:${repository}:${normalizedBranch ?? ""}:${normalizedRuntimeAdapter ?? ""}:${normalizedModel ?? ""}:${normalizedReasoningEffort ?? ""}:${normalizedPermissionMode ?? ""}:${normalizedContextWindow ?? ""}:${normalizedFastMode ?? ""}:${normalizedSandboxEnvironmentId ?? ""}:${normalizedCustomImageId ?? ""}`
- : null;
-
- useEffect(() => {
- const clearDebounce = (): void => {
- if (debounceRef.current) {
- clearTimeout(debounceRef.current);
- debounceRef.current = null;
- }
- };
-
- if (!eligible || !key || !repository || githubIntegrationId == null) {
- clearDebounce();
- return;
- }
- if (lastWarmedKeyRef.current === key || debounceRef.current) {
- return;
- }
-
- const repo = repository;
- const githubIntegration = githubIntegrationId;
- const warmBranch = normalizedBranch;
- const warmRuntimeAdapter = normalizedRuntimeAdapter;
- const warmModel = normalizedModel;
- const warmReasoningEffort = normalizedReasoningEffort;
- const warmPermissionMode = normalizedPermissionMode;
- const warmContextWindow = normalizedContextWindow;
- const warmFastMode = normalizedFastMode;
- const warmSandboxEnvironmentId = normalizedSandboxEnvironmentId;
- const warmCustomImageId = normalizedCustomImageId;
- debounceRef.current = setTimeout(() => {
- debounceRef.current = null;
- lastWarmedKeyRef.current = key;
- void getPostHogApiClient()
- .warmTask({
- repository: repo,
- github_integration: githubIntegration,
- branch: warmBranch,
- runtime_adapter: warmRuntimeAdapter,
- model: warmModel,
- reasoning_effort: warmReasoningEffort,
- initial_permission_mode: warmPermissionMode,
- ...(warmContextWindow ? { context_window: warmContextWindow } : {}),
- ...(warmFastMode != null ? { fast_mode: warmFastMode } : {}),
- ...(warmSandboxEnvironmentId
- ? { sandbox_environment_id: warmSandboxEnvironmentId }
- : {}),
- ...(warmCustomImageId ? { custom_image_id: warmCustomImageId } : {}),
- })
- .catch((error) => {
- lastWarmedKeyRef.current = null;
- log.warn("Failed to warm task", error);
- });
- }, WARM_DEBOUNCE_MS);
-
- return clearDebounce;
- }, [
- eligible,
- key,
- repository,
- githubIntegrationId,
- normalizedBranch,
- normalizedRuntimeAdapter,
- normalizedModel,
- normalizedReasoningEffort,
- normalizedPermissionMode,
- normalizedContextWindow,
- normalizedFastMode,
- normalizedSandboxEnvironmentId,
- normalizedCustomImageId,
- ]);
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/index.ts b/products/desktop/apps/mobile/src/features/tasks/index.ts
deleted file mode 100644
index 2bcbcc35a71e..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/index.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-// Tasks feature
-
-// Components
-export { TaskItem } from "./components/TaskItem";
-export { TaskList } from "./components/TaskList";
-export { TaskSessionView } from "./components/TaskSessionView";
-// Hooks
-export { useIntegrations } from "./hooks/useIntegrations";
-export {
- taskKeys,
- useCreateTask,
- useDeleteTask,
- useRunTask,
- useTask,
- useTasks,
- useUpdateTask,
-} from "./hooks/useTasks";
-// Stores
-export {
- type TaskSession,
- useTaskSessionStore,
-} from "./stores/taskSessionStore";
-export { useTaskStore } from "./stores/taskStore";
-
-// Types
-export * from "./types";
diff --git a/products/desktop/apps/mobile/src/features/tasks/lib/cloudTaskStream.test.ts b/products/desktop/apps/mobile/src/features/tasks/lib/cloudTaskStream.test.ts
deleted file mode 100644
index a3fc53a61062..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/lib/cloudTaskStream.test.ts
+++ /dev/null
@@ -1,54 +0,0 @@
-import { beforeEach, describe, expect, it, vi } from "vitest";
-
-const mocks = vi.hoisted(() => ({
- engine: {
- off: vi.fn(),
- on: vi.fn(),
- reconnectIfDisconnected: vi.fn(),
- unwatch: vi.fn(),
- watch: vi.fn(),
- },
-}));
-
-vi.mock("@posthog/core/cloud-task/cloud-task-engine", () => ({
- createCloudTaskEngine: () => mocks.engine,
-}));
-
-vi.mock("@posthog/core/cloud-task/schemas", () => ({
- CloudTaskEvent: { Update: "cloud-task-update" },
-}));
-
-vi.mock("expo/fetch", () => ({ fetch: vi.fn() }));
-
-vi.mock("@/lib/api", () => ({
- authedFetch: vi.fn(),
- getBaseUrl: () => "https://app.posthog.test",
- getProjectId: () => 42,
-}));
-
-vi.mock("@/lib/logger", () => ({
- logger: { scope: vi.fn() },
-}));
-
-import { watchCloudTask } from "./cloudTaskStream";
-
-describe("watchCloudTask", () => {
- beforeEach(() => {
- vi.clearAllMocks();
- });
-
- it("asks the shared engine to reconnect only when disconnected", () => {
- const handle = watchCloudTask({
- taskId: "task-1",
- runId: "run-1",
- onUpdate: vi.fn(),
- });
-
- handle.reconnectIfDisconnected();
-
- expect(mocks.engine.reconnectIfDisconnected).toHaveBeenCalledWith(
- "task-1",
- "run-1",
- );
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/tasks/lib/cloudTaskStream.ts b/products/desktop/apps/mobile/src/features/tasks/lib/cloudTaskStream.ts
deleted file mode 100644
index ac761b6bc997..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/lib/cloudTaskStream.ts
+++ /dev/null
@@ -1,102 +0,0 @@
-import {
- type CloudTaskEngine,
- type CloudTaskFetch,
- createCloudTaskEngine,
-} from "@posthog/core/cloud-task/cloud-task-engine";
-import { CloudTaskEvent } from "@posthog/core/cloud-task/schemas";
-import type { CloudTaskUpdatePayload } from "@posthog/shared";
-import { fetch } from "expo/fetch";
-import {
- authedFetch,
- type FetchInit,
- getBaseUrl,
- getProjectId,
-} from "@/lib/api";
-import { logger } from "@/lib/logger";
-
-export interface WatchCloudTaskOptions {
- taskId: string;
- runId: string;
- onUpdate: (update: CloudTaskUpdatePayload) => void;
-}
-
-export interface WatchCloudTaskHandle {
- stop: () => void;
- reconnectIfDisconnected: () => void;
-}
-
-const mobileCloudTaskAnalytics = {
- initialize: () => {},
- track: () => {},
- identify: () => {},
- setCurrentUserId: () => {},
- getCurrentUserId: () => null,
- getOrCreateSessionId: () => "mobile-cloud-task",
- resetUser: () => {},
- captureException: () => {},
- flush: async () => {},
- shutdown: async () => {},
-};
-
-let cloudTaskEngine: CloudTaskEngine | null = null;
-
-function getCloudTaskEngine(): CloudTaskEngine {
- if (cloudTaskEngine) {
- return cloudTaskEngine;
- }
-
- cloudTaskEngine = createCloudTaskEngine({
- auth: {
- authenticatedFetch: (url, init) =>
- authedFetch(url, init as FetchInit | undefined),
- getCloudContext: async () => ({
- apiHost: getBaseUrl(),
- teamId: getProjectId(),
- }),
- },
- analytics: mobileCloudTaskAnalytics,
- logger,
- streamFetch: fetch as CloudTaskFetch,
- });
-
- return cloudTaskEngine;
-}
-
-export function watchCloudTask({
- taskId,
- runId,
- onUpdate,
-}: WatchCloudTaskOptions): WatchCloudTaskHandle {
- const engine = getCloudTaskEngine();
- const listener = (update: CloudTaskUpdatePayload): void => {
- if (update.taskId === taskId && update.runId === runId) {
- onUpdate(update);
- }
- };
-
- engine.on(CloudTaskEvent.Update, listener);
- engine.watch({
- taskId,
- runId,
- apiHost: getBaseUrl(),
- teamId: getProjectId(),
- });
-
- let stopped = false;
-
- return {
- stop: () => {
- if (stopped) {
- return;
- }
- stopped = true;
- engine.off(CloudTaskEvent.Update, listener);
- engine.unwatch(taskId, runId);
- },
- reconnectIfDisconnected: () => {
- if (!stopped) {
- engine.reconnectIfDisconnected(taskId, runId);
- }
- },
- };
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/stores/archivedTasksStore.ts b/products/desktop/apps/mobile/src/features/tasks/stores/archivedTasksStore.ts
deleted file mode 100644
index 72f880a73103..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/stores/archivedTasksStore.ts
+++ /dev/null
@@ -1,65 +0,0 @@
-import AsyncStorage from "@react-native-async-storage/async-storage";
-import { create } from "zustand";
-import { createJSONStorage, persist } from "zustand/middleware";
-
-// Cap on how many archived task IDs we persist. Beyond this, the oldest
-// entries are evicted so AsyncStorage doesn't grow without bound.
-const MAX_ARCHIVED_TASKS = 100;
-
-interface ArchivedTasksState {
- // taskId → timestamp (ms) for eviction ordering
- archivedTasks: Record<string, number>;
- archive: (taskId: string) => void;
- archiveMany: (taskIds: string[]) => void;
- unarchive: (taskId: string) => void;
- isArchived: (taskId: string) => boolean;
-}
-
-function withCap(entries: Record<string, number>): Record<string, number> {
- const ids = Object.keys(entries);
- if (ids.length <= MAX_ARCHIVED_TASKS) return entries;
- const kept = ids
- .sort((a, b) => entries[b] - entries[a])
- .slice(0, MAX_ARCHIVED_TASKS);
- const trimmed: Record<string, number> = {};
- for (const id of kept) trimmed[id] = entries[id];
- return trimmed;
-}
-
-export const useArchivedTasksStore = create<ArchivedTasksState>()(
- persist(
- (set, get) => ({
- archivedTasks: {},
-
- archive: (taskId: string) =>
- set((state) => ({
- archivedTasks: withCap({
- ...state.archivedTasks,
- [taskId]: Date.now(),
- }),
- })),
-
- archiveMany: (taskIds: string[]) =>
- set((state) => {
- if (taskIds.length === 0) return state;
- const now = Date.now();
- const next = { ...state.archivedTasks };
- for (const id of taskIds) next[id] = now;
- return { archivedTasks: withCap(next) };
- }),
-
- unarchive: (taskId: string) =>
- set((state) => {
- const { [taskId]: _, ...rest } = state.archivedTasks;
- return { archivedTasks: rest };
- }),
-
- isArchived: (taskId: string) => taskId in get().archivedTasks,
- }),
- {
- name: "archived-tasks",
- storage: createJSONStorage(() => AsyncStorage),
- partialize: (state) => ({ archivedTasks: state.archivedTasks }),
- },
- ),
-);
diff --git a/products/desktop/apps/mobile/src/features/tasks/stores/messageQueueStore.test.ts b/products/desktop/apps/mobile/src/features/tasks/stores/messageQueueStore.test.ts
deleted file mode 100644
index 53c1d4f3dc53..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/stores/messageQueueStore.test.ts
+++ /dev/null
@@ -1,332 +0,0 @@
-import { beforeEach, describe, expect, it } from "vitest";
-import type { PendingAttachment } from "../composer/attachments/types";
-import {
- combineQueuedMessages,
- type QueuedMessage,
- useMessageQueueStore,
-} from "./messageQueueStore";
-
-function image(id: string): PendingAttachment {
- return {
- kind: "image",
- id,
- uri: `file://${id}.png`,
- fileName: `${id}.png`,
- mimeType: "image/png",
- };
-}
-
-describe("messageQueueStore", () => {
- beforeEach(() => {
- useMessageQueueStore.setState(
- { queuesByTaskId: {}, editingByTaskId: {} },
- false,
- );
- });
-
- it("enqueues messages in FIFO order", () => {
- const { enqueue, getQueue } = useMessageQueueStore.getState();
- enqueue("t1", "first", []);
- enqueue("t1", "second", []);
- enqueue("t1", "third", []);
- expect(getQueue("t1").map((m) => m.content)).toEqual([
- "first",
- "second",
- "third",
- ]);
- });
-
- it("keeps separate queues per task", () => {
- const { enqueue, getQueue } = useMessageQueueStore.getState();
- enqueue("t1", "a", []);
- enqueue("t2", "b", []);
- expect(getQueue("t1").map((m) => m.content)).toEqual(["a"]);
- expect(getQueue("t2").map((m) => m.content)).toEqual(["b"]);
- });
-
- it("drains the queue in order and clears it", () => {
- const { enqueue, drain, getQueue } = useMessageQueueStore.getState();
- enqueue("t1", "a", []);
- enqueue("t1", "b", []);
- expect(drain("t1").map((m) => m.content)).toEqual(["a", "b"]);
- expect(getQueue("t1")).toEqual([]);
- // A second drain on the emptied queue is a no-op.
- expect(drain("t1")).toEqual([]);
- });
-
- it("prepends restored messages at the head (failed-flush rollback)", () => {
- const { enqueue, drain, prepend, getQueue } =
- useMessageQueueStore.getState();
- enqueue("t1", "a", []);
- enqueue("t1", "b", []);
- const drained = drain("t1");
-
- // A new message arrives while the flush is in flight.
- enqueue("t1", "c", []);
- // Flush failed — the drained messages go back ahead of the newcomer.
- prepend("t1", drained);
-
- expect(getQueue("t1").map((m) => m.content)).toEqual(["a", "b", "c"]);
- });
-
- it.each([
- {
- name: "removes exactly the targeted message",
- contents: ["a", "b", "c"],
- removeIndex: 1,
- expected: ["a", "c"],
- },
- {
- name: "clears the entry once the last message is removed",
- contents: ["only"],
- removeIndex: 0,
- expected: [],
- },
- ])("$name", ({ contents, removeIndex, expected }) => {
- const { enqueue, remove, getQueue } = useMessageQueueStore.getState();
- for (const content of contents) enqueue("t1", content, []);
- remove("t1", getQueue("t1")[removeIndex].id);
- expect(getQueue("t1").map((m) => m.content)).toEqual(expected);
- });
-
- it("ignores removal of an unknown id", () => {
- const { enqueue, remove, getQueue } = useMessageQueueStore.getState();
- enqueue("t1", "a", []);
- remove("t1", "nope");
- expect(getQueue("t1").map((m) => m.content)).toEqual(["a"]);
- });
-});
-
-describe("move", () => {
- beforeEach(() => {
- useMessageQueueStore.setState(
- { queuesByTaskId: {}, editingByTaskId: {} },
- false,
- );
- });
-
- function seed(contents: string[]) {
- const { enqueue, getQueue } = useMessageQueueStore.getState();
- for (const content of contents) enqueue("t1", content, []);
- return getQueue("t1");
- }
-
- it("moves a message down one slot", () => {
- const [a] = seed(["a", "b", "c"]);
- useMessageQueueStore.getState().move("t1", a.id, "down");
- expect(
- useMessageQueueStore
- .getState()
- .getQueue("t1")
- .map((m) => m.content),
- ).toEqual(["b", "a", "c"]);
- });
-
- it("moves a message up one slot", () => {
- const queue = seed(["a", "b", "c"]);
- useMessageQueueStore.getState().move("t1", queue[2].id, "up");
- expect(
- useMessageQueueStore
- .getState()
- .getQueue("t1")
- .map((m) => m.content),
- ).toEqual(["a", "c", "b"]);
- });
-
- it.each([
- { name: "up at the head", index: 0, direction: "up" as const },
- { name: "down at the tail", index: 2, direction: "down" as const },
- ])("is a no-op moving $name", ({ index, direction }) => {
- const queue = seed(["a", "b", "c"]);
- useMessageQueueStore.getState().move("t1", queue[index].id, direction);
- expect(
- useMessageQueueStore
- .getState()
- .getQueue("t1")
- .map((m) => m.content),
- ).toEqual(["a", "b", "c"]);
- });
-
- it("ignores an unknown id", () => {
- seed(["a", "b"]);
- useMessageQueueStore.getState().move("t1", "nope", "up");
- expect(
- useMessageQueueStore
- .getState()
- .getQueue("t1")
- .map((m) => m.content),
- ).toEqual(["a", "b"]);
- });
-});
-
-describe("edit in place", () => {
- beforeEach(() => {
- useMessageQueueStore.setState(
- { queuesByTaskId: {}, editingByTaskId: {} },
- false,
- );
- });
-
- it("updates content and attachments in place, keeping id and position", () => {
- const { enqueue, update, getQueue } = useMessageQueueStore.getState();
- enqueue("t1", "a", []);
- enqueue("t1", "b", []);
- const target = getQueue("t1")[0];
-
- update("t1", target.id, { content: "edited", attachments: [image("x")] });
-
- const queue = useMessageQueueStore.getState().getQueue("t1");
- expect(queue.map((m) => m.id)).toEqual([target.id, getQueue("t1")[1].id]);
- expect(queue[0].content).toBe("edited");
- expect(queue[0].attachments.map((att) => att.id)).toEqual(["x"]);
- expect(queue[1].content).toBe("b");
- });
-
- it("is a no-op when the target id is gone", () => {
- const { enqueue, update, getQueue } = useMessageQueueStore.getState();
- enqueue("t1", "a", []);
- update("t1", "missing", { content: "edited", attachments: [] });
- expect(getQueue("t1")[0].content).toBe("a");
- });
-
- it("set/clear stores and releases the edit hold", () => {
- const { enqueue, getQueue, setEditing, clearEditing } =
- useMessageQueueStore.getState();
- enqueue("t1", "a", []);
- const id = getQueue("t1")[0].id;
-
- setEditing("t1", id);
- expect(useMessageQueueStore.getState().editingByTaskId.t1).toBe(id);
-
- clearEditing("t1");
- expect(useMessageQueueStore.getState().editingByTaskId.t1).toBeUndefined();
- });
-
- it("clears the edit hold when the edited message is removed", () => {
- const { enqueue, getQueue, setEditing, remove } =
- useMessageQueueStore.getState();
- enqueue("t1", "a", []);
- enqueue("t1", "b", []);
- const id = getQueue("t1")[0].id;
- setEditing("t1", id);
-
- remove("t1", id);
-
- expect(useMessageQueueStore.getState().editingByTaskId.t1).toBeUndefined();
- expect(
- useMessageQueueStore
- .getState()
- .getQueue("t1")
- .map((m) => m.content),
- ).toEqual(["b"]);
- });
-
- it("keeps the edit hold when a different message is removed", () => {
- const { enqueue, getQueue, setEditing, remove } =
- useMessageQueueStore.getState();
- enqueue("t1", "a", []);
- enqueue("t1", "b", []);
- const editingId = getQueue("t1")[1].id;
- setEditing("t1", editingId);
-
- remove("t1", getQueue("t1")[0].id);
-
- expect(useMessageQueueStore.getState().editingByTaskId.t1).toBe(editingId);
- });
-});
-
-describe("drain boundary (stopAtEdited)", () => {
- beforeEach(() => {
- useMessageQueueStore.setState(
- { queuesByTaskId: {}, editingByTaskId: {} },
- false,
- );
- });
-
- function seed(contents: string[]) {
- const { enqueue, getQueue } = useMessageQueueStore.getState();
- for (const content of contents) enqueue("t1", content, []);
- return getQueue("t1");
- }
-
- it("drains only the messages before the edited one", () => {
- const queue = seed(["a", "b", "c"]);
- useMessageQueueStore.getState().setEditing("t1", queue[1].id);
-
- const drained = useMessageQueueStore
- .getState()
- .drain("t1", { stopAtEdited: true });
-
- expect(drained.map((m) => m.content)).toEqual(["a"]);
- // The edited message and everything after it stay queued.
- expect(
- useMessageQueueStore
- .getState()
- .getQueue("t1")
- .map((m) => m.content),
- ).toEqual(["b", "c"]);
- });
-
- it("drains nothing when the head message is being edited", () => {
- const queue = seed(["a", "b"]);
- useMessageQueueStore.getState().setEditing("t1", queue[0].id);
-
- const drained = useMessageQueueStore
- .getState()
- .drain("t1", { stopAtEdited: true });
-
- expect(drained).toEqual([]);
- expect(
- useMessageQueueStore
- .getState()
- .getQueue("t1")
- .map((m) => m.content),
- ).toEqual(["a", "b"]);
- });
-
- it("drains the whole queue when nothing is being edited", () => {
- seed(["a", "b", "c"]);
- const drained = useMessageQueueStore
- .getState()
- .drain("t1", { stopAtEdited: true });
- expect(drained.map((m) => m.content)).toEqual(["a", "b", "c"]);
- expect(useMessageQueueStore.getState().getQueue("t1")).toEqual([]);
- });
-
- it("ignores the boundary without stopAtEdited, even mid-edit", () => {
- const queue = seed(["a", "b", "c"]);
- useMessageQueueStore.getState().setEditing("t1", queue[1].id);
-
- const drained = useMessageQueueStore.getState().drain("t1");
-
- expect(drained.map((m) => m.content)).toEqual(["a", "b", "c"]);
- expect(useMessageQueueStore.getState().getQueue("t1")).toEqual([]);
- });
-});
-
-describe("combineQueuedMessages", () => {
- function msg(
- content: string,
- attachments: PendingAttachment[],
- ): QueuedMessage {
- return { id: content, content, attachments };
- }
-
- it("joins text in order with a blank line and concatenates attachments", () => {
- const result = combineQueuedMessages([
- msg("first", [image("one")]),
- msg("second", []),
- msg("third", [image("two"), image("three")]),
- ]);
- expect(result.text).toBe("first\n\nsecond\n\nthird");
- expect(result.attachments.map((a) => a.id)).toEqual([
- "one",
- "two",
- "three",
- ]);
- });
-
- it("handles an empty list", () => {
- expect(combineQueuedMessages([])).toEqual({ text: "", attachments: [] });
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/tasks/stores/messageQueueStore.ts b/products/desktop/apps/mobile/src/features/tasks/stores/messageQueueStore.ts
deleted file mode 100644
index f676cb326fae..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/stores/messageQueueStore.ts
+++ /dev/null
@@ -1,193 +0,0 @@
-import { create } from "zustand";
-import type { PendingAttachment } from "../composer/attachments/types";
-
-export interface QueuedMessage {
- id: string;
- content: string;
- attachments: PendingAttachment[];
-}
-
-const EMPTY: QueuedMessage[] = [];
-
-export type MoveDirection = "up" | "down";
-
-let queueIdCounter = 0;
-function nextQueueId(): string {
- queueIdCounter += 1;
- return `queue-${queueIdCounter}`;
-}
-
-// A message being edited in place acts as a drain boundary: only the messages
-// queued before it may auto-send; it and everything after stay put until the
-// edit is saved or cancelled. Returns the full length when nothing is being
-// edited (or the edited message has already left the queue). Mirrors
-// `sendableQueuePrefixLength` in @posthog/shared, reimplemented here because
-// mobile's queue rows (`{id, content, attachments}`) don't match the shared
-// `AgentSession` message shape.
-function sendablePrefixLength(
- queue: QueuedMessage[],
- editingId: string | undefined,
-): number {
- if (!editingId) return queue.length;
- const index = queue.findIndex((m) => m.id === editingId);
- return index === -1 ? queue.length : index;
-}
-
-interface MessageQueueState {
- queuesByTaskId: Record<string, QueuedMessage[]>;
- /** Per-task id of the queued message currently open in the composer. */
- editingByTaskId: Record<string, string>;
- enqueue: (
- taskId: string,
- content: string,
- attachments: PendingAttachment[],
- ) => void;
- /**
- * Remove and return queued messages from the head, in FIFO order. With
- * `stopAtEdited`, stops at the in-place edit boundary so the edited message
- * and everything after it stay queued.
- */
- drain: (
- taskId: string,
- options?: { stopAtEdited?: boolean },
- ) => QueuedMessage[];
- /** Restore messages at the head of the queue, e.g. after a failed flush. */
- prepend: (taskId: string, messages: QueuedMessage[]) => void;
- /** Drop a single queued message by id. Clears the edit hold if it targeted it. */
- remove: (taskId: string, messageId: string) => void;
- /** Reorder a queued message one slot up or down; the send order follows. */
- move: (taskId: string, messageId: string, direction: MoveDirection) => void;
- /** Replace a queued message's content/attachments in place, keeping position. */
- update: (
- taskId: string,
- messageId: string,
- patch: { content: string; attachments: PendingAttachment[] },
- ) => void;
- /** Mark a queued message as being edited in the composer (drain boundary). */
- setEditing: (taskId: string, messageId: string) => void;
- /** Release the in-place edit hold. */
- clearEditing: (taskId: string) => void;
- getQueue: (taskId: string) => QueuedMessage[];
-}
-
-export const useMessageQueueStore = create<MessageQueueState>((set, get) => ({
- queuesByTaskId: {},
- editingByTaskId: {},
- enqueue: (taskId, content, attachments) =>
- set((state) => ({
- queuesByTaskId: {
- ...state.queuesByTaskId,
- [taskId]: [
- ...(state.queuesByTaskId[taskId] ?? []),
- { id: nextQueueId(), content, attachments },
- ],
- },
- })),
- drain: (taskId, options) => {
- const queued = get().queuesByTaskId[taskId] ?? EMPTY;
- if (queued.length === 0) return EMPTY;
- const cutoff = options?.stopAtEdited
- ? sendablePrefixLength(queued, get().editingByTaskId[taskId])
- : queued.length;
- if (cutoff === 0) return EMPTY;
- const drained = queued.slice(0, cutoff);
- const rest = queued.slice(cutoff);
- set((state) => {
- if (rest.length === 0) {
- const { [taskId]: _drained, ...others } = state.queuesByTaskId;
- return { queuesByTaskId: others };
- }
- return {
- queuesByTaskId: { ...state.queuesByTaskId, [taskId]: rest },
- };
- });
- return drained;
- },
- prepend: (taskId, messages) =>
- set((state) => ({
- queuesByTaskId: {
- ...state.queuesByTaskId,
- [taskId]: [...messages, ...(state.queuesByTaskId[taskId] ?? [])],
- },
- })),
- remove: (taskId, messageId) =>
- set((state) => {
- const queue = state.queuesByTaskId[taskId];
- if (!queue) return state;
- const next = queue.filter((m) => m.id !== messageId);
- if (next.length === queue.length) return state;
- const editingByTaskId =
- state.editingByTaskId[taskId] === messageId
- ? omit(state.editingByTaskId, taskId)
- : state.editingByTaskId;
- if (next.length === 0) {
- const { [taskId]: _emptied, ...rest } = state.queuesByTaskId;
- return { queuesByTaskId: rest, editingByTaskId };
- }
- return {
- queuesByTaskId: { ...state.queuesByTaskId, [taskId]: next },
- editingByTaskId,
- };
- }),
- move: (taskId, messageId, direction) =>
- set((state) => {
- const queue = state.queuesByTaskId[taskId];
- if (!queue) return state;
- const from = queue.findIndex((m) => m.id === messageId);
- if (from === -1) return state;
- const to = direction === "up" ? from - 1 : from + 1;
- if (to < 0 || to >= queue.length) return state;
- const next = [...queue];
- const [moved] = next.splice(from, 1);
- next.splice(to, 0, moved);
- return {
- queuesByTaskId: { ...state.queuesByTaskId, [taskId]: next },
- };
- }),
- update: (taskId, messageId, patch) =>
- set((state) => {
- const queue = state.queuesByTaskId[taskId];
- if (!queue?.some((m) => m.id === messageId)) return state;
- const next = queue.map((m) =>
- m.id === messageId
- ? { ...m, content: patch.content, attachments: patch.attachments }
- : m,
- );
- return {
- queuesByTaskId: { ...state.queuesByTaskId, [taskId]: next },
- };
- }),
- setEditing: (taskId, messageId) =>
- set((state) => ({
- editingByTaskId: { ...state.editingByTaskId, [taskId]: messageId },
- })),
- clearEditing: (taskId) =>
- set((state) =>
- taskId in state.editingByTaskId
- ? { editingByTaskId: omit(state.editingByTaskId, taskId) }
- : state,
- ),
- getQueue: (taskId) => get().queuesByTaskId[taskId] ?? EMPTY,
-}));
-
-function omit<T extends Record<string, string>>(
- record: T,
- key: string,
-): Record<string, string> {
- const { [key]: _removed, ...rest } = record;
- return rest;
-}
-
-/**
- * Combine buffered messages into a single prompt, preserving the order they
- * were typed: texts join with a blank line, attachments concatenate.
- */
-export function combineQueuedMessages(messages: QueuedMessage[]): {
- text: string;
- attachments: PendingAttachment[];
-} {
- return {
- text: messages.map((m) => m.content).join("\n\n"),
- attachments: messages.flatMap((m) => m.attachments),
- };
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/stores/messagingModeStore.test.ts b/products/desktop/apps/mobile/src/features/tasks/stores/messagingModeStore.test.ts
deleted file mode 100644
index fa0042262371..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/stores/messagingModeStore.test.ts
+++ /dev/null
@@ -1,123 +0,0 @@
-import { beforeEach, describe, expect, it } from "vitest";
-import {
- type MessagingMode,
- migrateMessagingModeState,
- useMessagingModeStore,
-} from "./messagingModeStore";
-
-const INITIAL_STATE = useMessagingModeStore.getState();
-
-const migrate = useMessagingModeStore.persist.getOptions().migrate as (
- persisted: unknown,
- version: number,
-) => {
- modesByTaskId: Record<string, MessagingMode>;
- defaultMode: MessagingMode;
-};
-
-describe("messagingModeStore", () => {
- beforeEach(() => {
- useMessagingModeStore.setState(
- { ...INITIAL_STATE, modesByTaskId: {}, defaultMode: "steer" },
- true,
- );
- });
-
- it("defaults to Steer", () => {
- expect(useMessagingModeStore.getState().getEffectiveMode("t1")).toBe(
- "steer",
- );
- });
-
- it.each(["queue", "steer"] as const)(
- "falls back to the global default (%s) when a task has no override",
- (mode) => {
- useMessagingModeStore.getState().setDefaultMode(mode);
- expect(useMessagingModeStore.getState().getEffectiveMode("t1")).toBe(
- mode,
- );
- },
- );
-
- it("prefers a per-task override over the global default", () => {
- useMessagingModeStore.getState().setMode("t1", "queue");
- expect(useMessagingModeStore.getState().getEffectiveMode("t1")).toBe(
- "queue",
- );
- // A different task still resolves to the global default.
- expect(useMessagingModeStore.getState().getEffectiveMode("t2")).toBe(
- "steer",
- );
- });
-
- it("treats an undefined taskId as the global default", () => {
- useMessagingModeStore.getState().setDefaultMode("queue");
- expect(useMessagingModeStore.getState().getEffectiveMode(undefined)).toBe(
- "queue",
- );
- });
-
- // Exercises the migration through the persisted store's wired `migrate`
- // option, complementing the direct unit tests below.
- describe("migration", () => {
- it.each([
- {
- name: "flips a pre-v1 queue default to steer",
- version: 0,
- from: "queue",
- expected: "steer",
- },
- {
- name: "does not clobber a queue default set at the current version",
- version: 1,
- from: "queue",
- expected: "queue",
- },
- {
- name: "leaves a pre-v1 steer default untouched",
- version: 0,
- from: "steer",
- expected: "steer",
- },
- ] as const)("$name", ({ version, from, expected }) => {
- const migrated = migrate(
- { modesByTaskId: {}, defaultMode: from },
- version,
- );
- expect(migrated.defaultMode).toBe(expected);
- });
-
- it("preserves per-task overrides through migration", () => {
- const migrated = migrate(
- { modesByTaskId: { t1: "queue", t2: "steer" }, defaultMode: "queue" },
- 0,
- );
- expect(migrated.modesByTaskId).toEqual({ t1: "queue", t2: "steer" });
- expect(migrated.defaultMode).toBe("steer");
- });
- });
-});
-
-describe("migrateMessagingModeState", () => {
- it("moves v0 installs to steer while keeping per-task overrides", () => {
- const migrated = migrateMessagingModeState(
- { modesByTaskId: { t1: "queue" }, defaultMode: "queue" },
- 0,
- );
- expect(migrated).toEqual({
- modesByTaskId: { t1: "queue" },
- defaultMode: "steer",
- });
- });
-
- it("leaves already-migrated state untouched", () => {
- const state = { modesByTaskId: {}, defaultMode: "queue" as const };
- expect(migrateMessagingModeState(state, 1)).toEqual(state);
- });
-
- it("tolerates missing persisted state", () => {
- expect(migrateMessagingModeState(undefined, 0)).toEqual({
- defaultMode: "steer",
- });
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/tasks/stores/messagingModeStore.ts b/products/desktop/apps/mobile/src/features/tasks/stores/messagingModeStore.ts
deleted file mode 100644
index 154c4e0770b0..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/stores/messagingModeStore.ts
+++ /dev/null
@@ -1,59 +0,0 @@
-import AsyncStorage from "@react-native-async-storage/async-storage";
-import { create } from "zustand";
-import { createJSONStorage, persist } from "zustand/middleware";
-
-export type MessagingMode = "queue" | "steer";
-
-interface MessagingModeState {
- /** Per-task overrides. Absent entries fall back to `defaultMode`. */
- modesByTaskId: Record<string, MessagingMode>;
- defaultMode: MessagingMode;
- setMode: (taskId: string, mode: MessagingMode) => void;
- setDefaultMode: (mode: MessagingMode) => void;
- getEffectiveMode: (taskId: string | undefined) => MessagingMode;
-}
-
-/**
- * Mobile sessions are all cloud, where steer is stable, so the default moved to
- * steer. Existing installs persisted "queue" under v0 and would keep it, so v1
- * rehydrates them to steer. Per-task overrides are untouched; an explicit
- * "queue" default is indistinguishable from the old default, so it is reset too.
- */
-export function migrateMessagingModeState(
- persisted: unknown,
- version: number,
-): Partial<MessagingModeState> {
- const state = (persisted ?? {}) as Partial<MessagingModeState>;
- return version < 1 ? { ...state, defaultMode: "steer" } : state;
-}
-
-export const useMessagingModeStore = create<MessagingModeState>()(
- persist(
- (set, get) => ({
- modesByTaskId: {},
- defaultMode: "steer",
- setMode: (taskId, mode) =>
- set((state) => ({
- modesByTaskId: { ...state.modesByTaskId, [taskId]: mode },
- })),
- setDefaultMode: (defaultMode) => set({ defaultMode }),
- getEffectiveMode: (taskId) => {
- const state = get();
- return (
- (taskId ? state.modesByTaskId[taskId] : undefined) ??
- state.defaultMode
- );
- },
- }),
- {
- name: "messaging-mode-storage",
- storage: createJSONStorage(() => AsyncStorage),
- version: 1,
- migrate: migrateMessagingModeState,
- partialize: (state) => ({
- modesByTaskId: state.modesByTaskId,
- defaultMode: state.defaultMode,
- }),
- },
- ),
-);
diff --git a/products/desktop/apps/mobile/src/features/tasks/stores/pendingPromptRecoveryStore.test.ts b/products/desktop/apps/mobile/src/features/tasks/stores/pendingPromptRecoveryStore.test.ts
deleted file mode 100644
index 68f19884cf26..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/stores/pendingPromptRecoveryStore.test.ts
+++ /dev/null
@@ -1,67 +0,0 @@
-import { beforeEach, describe, expect, it, vi } from "vitest";
-import {
- pendingPromptRecoveryStoreApi,
- usePendingPromptRecoveryStore,
-} from "./pendingPromptRecoveryStore";
-
-describe("pendingPromptRecoveryStore", () => {
- beforeEach(() => {
- usePendingPromptRecoveryStore.setState({ byKey: {}, hasHydrated: true });
- });
-
- it("persists a prompt on submit and clears it on success", () => {
- pendingPromptRecoveryStoreApi.set("pending-1", "Fix the login bug");
- expect(pendingPromptRecoveryStoreApi.getAllNewestFirst()).toEqual([
- {
- key: "pending-1",
- prompt: expect.objectContaining({ promptText: "Fix the login bug" }),
- },
- ]);
-
- pendingPromptRecoveryStoreApi.clear("pending-1");
- expect(pendingPromptRecoveryStoreApi.getAllNewestFirst()).toEqual([]);
- });
-
- it("caps the persisted set to the newest 20 entries", () => {
- let now = 1000;
- const spy = vi.spyOn(Date, "now").mockImplementation(() => now++);
- for (let i = 0; i < 25; i++) {
- pendingPromptRecoveryStoreApi.set(`k-${i}`, `prompt ${i}`);
- }
- spy.mockRestore();
-
- const entries = pendingPromptRecoveryStoreApi.getAllNewestFirst();
- const keys = entries.map((e) => e.key);
- expect(entries).toHaveLength(20);
- expect(keys[0]).toBe("k-24");
- expect(keys).not.toContain("k-0");
- expect(keys).not.toContain("k-4");
- });
-
- it("orders recoverable prompts newest-first", () => {
- usePendingPromptRecoveryStore.setState({
- byKey: {
- old: { promptText: "old", createdAt: 1 },
- newest: { promptText: "newest", createdAt: 3 },
- mid: { promptText: "mid", createdAt: 2 },
- },
- });
-
- expect(
- pendingPromptRecoveryStoreApi.getAllNewestFirst().map((e) => e.key),
- ).toEqual(["newest", "mid", "old"]);
- });
-
- it("whenHydrated resolves once the rehydration flag flips", async () => {
- usePendingPromptRecoveryStore.setState({ hasHydrated: false });
- let resolved = false;
- const pending = pendingPromptRecoveryStoreApi.whenHydrated().then(() => {
- resolved = true;
- });
-
- expect(resolved).toBe(false);
- usePendingPromptRecoveryStore.getState().setHasHydrated(true);
- await pending;
- expect(resolved).toBe(true);
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/tasks/stores/pendingPromptRecoveryStore.ts b/products/desktop/apps/mobile/src/features/tasks/stores/pendingPromptRecoveryStore.ts
deleted file mode 100644
index bca210d849fc..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/stores/pendingPromptRecoveryStore.ts
+++ /dev/null
@@ -1,84 +0,0 @@
-import {
- capPendingPrompts,
- listPendingPromptsNewestFirst,
-} from "@posthog/core/tasks/pendingPrompts";
-import AsyncStorage from "@react-native-async-storage/async-storage";
-import { create } from "zustand";
-import { createJSONStorage, persist } from "zustand/middleware";
-
-// Persisted (unlike the transient in-memory echo store, whose entries vanish
-// the instant the live SSE copy lands) so a prompt survives the app being
-// killed mid-create and can be recovered on the next launch.
-export interface RecoverablePrompt {
- promptText: string;
- createdAt: number;
-}
-
-interface PendingPromptRecoveryState {
- byKey: Record<string, RecoverablePrompt>;
- hasHydrated: boolean;
- set: (key: string, promptText: string) => void;
- clear: (key: string) => void;
- setHasHydrated: (hydrated: boolean) => void;
-}
-
-export const usePendingPromptRecoveryStore =
- create<PendingPromptRecoveryState>()(
- persist(
- (set) => ({
- byKey: {},
- hasHydrated: false,
- set: (key, promptText) =>
- set((state) => ({
- byKey: capPendingPrompts({
- ...state.byKey,
- [key]: { promptText, createdAt: Date.now() },
- }),
- })),
- clear: (key) =>
- set((state) => {
- if (!(key in state.byKey)) return state;
- const { [key]: _removed, ...rest } = state.byKey;
- return { byKey: rest };
- }),
- setHasHydrated: (hydrated) => set({ hasHydrated: hydrated }),
- }),
- {
- name: "pending-task-prompt-recovery",
- storage: createJSONStorage(() => AsyncStorage),
- partialize: (state) => ({ byKey: state.byKey }),
- onRehydrateStorage: () => (state) => {
- (state ?? usePendingPromptRecoveryStore.getState()).setHasHydrated(
- true,
- );
- },
- },
- ),
- );
-
-export const pendingPromptRecoveryStoreApi = {
- set(key: string, promptText: string): void {
- usePendingPromptRecoveryStore.getState().set(key, promptText);
- },
- clear(key: string): void {
- usePendingPromptRecoveryStore.getState().clear(key);
- },
- getAllNewestFirst(): { key: string; prompt: RecoverablePrompt }[] {
- return listPendingPromptsNewestFirst(
- usePendingPromptRecoveryStore.getState().byKey,
- );
- },
- whenHydrated(): Promise<void> {
- if (usePendingPromptRecoveryStore.getState().hasHydrated) {
- return Promise.resolve();
- }
- return new Promise((resolve) => {
- const unsubscribe = usePendingPromptRecoveryStore.subscribe((state) => {
- if (state.hasHydrated) {
- unsubscribe();
- resolve();
- }
- });
- });
- },
-};
diff --git a/products/desktop/apps/mobile/src/features/tasks/stores/pendingTaskPromptStore.test.ts b/products/desktop/apps/mobile/src/features/tasks/stores/pendingTaskPromptStore.test.ts
deleted file mode 100644
index fa4cab91fed3..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/stores/pendingTaskPromptStore.test.ts
+++ /dev/null
@@ -1,71 +0,0 @@
-import { beforeEach, describe, expect, it } from "vitest";
-import {
- pendingTaskPromptStoreApi,
- usePendingTaskPromptStore,
-} from "./pendingTaskPromptStore";
-
-describe("pendingTaskPromptStore", () => {
- beforeEach(() => {
- usePendingTaskPromptStore.setState({ byKey: {} });
- });
-
- it("stores prompts keyed by an arbitrary id", () => {
- pendingTaskPromptStoreApi.set("uuid-1", {
- promptText: "Fix the login bug",
- setAt: 1000,
- });
-
- expect(pendingTaskPromptStoreApi.get("uuid-1")).toEqual({
- promptText: "Fix the login bug",
- setAt: 1000,
- });
- });
-
- it("moves a prompt from a transient key to the real task id", () => {
- pendingTaskPromptStoreApi.set("uuid-1", {
- promptText: "Do the thing",
- setAt: 1000,
- });
- pendingTaskPromptStoreApi.move("uuid-1", "task-123");
-
- expect(pendingTaskPromptStoreApi.get("uuid-1")).toBeUndefined();
- expect(pendingTaskPromptStoreApi.get("task-123")).toEqual({
- promptText: "Do the thing",
- setAt: 1000,
- });
- });
-
- it("ignores move when the source key has no prompt", () => {
- pendingTaskPromptStoreApi.move("missing", "task-999");
- expect(pendingTaskPromptStoreApi.get("task-999")).toBeUndefined();
- });
-
- it("clears prompts", () => {
- pendingTaskPromptStoreApi.set("task-42", {
- promptText: "Hi",
- setAt: 1000,
- });
- pendingTaskPromptStoreApi.clear("task-42");
- expect(pendingTaskPromptStoreApi.get("task-42")).toBeUndefined();
- });
-
- it("preserves attachments through move", () => {
- pendingTaskPromptStoreApi.set("uuid-1", {
- promptText: "Look at this",
- setAt: 1000,
- attachments: [
- {
- kind: "image",
- uri: "file://x.png",
- fileName: "x.png",
- mimeType: "image/png",
- },
- ],
- });
- pendingTaskPromptStoreApi.move("uuid-1", "task-7");
-
- expect(pendingTaskPromptStoreApi.get("task-7")?.attachments).toHaveLength(
- 1,
- );
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/tasks/stores/pendingTaskPromptStore.ts b/products/desktop/apps/mobile/src/features/tasks/stores/pendingTaskPromptStore.ts
deleted file mode 100644
index 8d759d0086d1..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/stores/pendingTaskPromptStore.ts
+++ /dev/null
@@ -1,88 +0,0 @@
-import { buildPendingPromptKey } from "@posthog/core/tasks/pendingPrompts";
-import { create } from "zustand";
-import type { SessionNotificationAttachment } from "../types";
-
-/**
- * Optimistic chat-thread echo for a prompt the user just submitted but whose
- * canonical SSE copy hasn't landed yet. Keyed first by a transient UUID (set
- * the instant the user taps send, before any task ID is known) and then
- * `move`d onto the real task ID once `createTask` returns.
- *
- * Pure UI state — not persisted. Cleared as soon as the live session echoes
- * the matching `user_message_chunk` back.
- */
-export interface PendingTaskPrompt {
- promptText: string;
- attachments?: SessionNotificationAttachment[];
- // Submit-time epoch ms. Consumers compare event `ts` against this so the
- // echo is only deduped against `user_message_chunk`s that arrived *after*
- // submit — protects against text-identical historical turns (e.g. a user
- // submitting "Continue" twice in a row) hiding the new optimistic echo.
- setAt: number;
-}
-
-interface PendingTaskPromptState {
- byKey: Record<string, PendingTaskPrompt>;
- set: (key: string, prompt: PendingTaskPrompt) => void;
- move: (fromKey: string, toKey: string) => void;
- clear: (key: string) => void;
-}
-
-export const usePendingTaskPromptStore = create<PendingTaskPromptState>(
- (set) => ({
- byKey: {},
- set: (key, prompt) =>
- set((state) => ({ byKey: { ...state.byKey, [key]: prompt } })),
- move: (fromKey, toKey) =>
- set((state) => {
- const value = state.byKey[fromKey];
- if (!value) return state;
- const { [fromKey]: _removed, ...rest } = state.byKey;
- return { byKey: { ...rest, [toKey]: value } };
- }),
- clear: (key) =>
- set((state) => {
- if (!(key in state.byKey)) return state;
- const { [key]: _removed, ...rest } = state.byKey;
- return { byKey: rest };
- }),
- }),
-);
-
-export function usePendingTaskPrompt(
- key: string | undefined | null,
-): PendingTaskPrompt | undefined {
- return usePendingTaskPromptStore((s) => (key ? s.byKey[key] : undefined));
-}
-
-/**
- * Non-reactive accessors so non-component code (screens, async flows) can
- * mutate the store without going through hooks. Mirrors the desktop
- * `pendingTaskPromptStoreApi` shape.
- */
-export const pendingTaskPromptStoreApi = {
- set(key: string, prompt: PendingTaskPrompt): void {
- usePendingTaskPromptStore.getState().set(key, prompt);
- },
- get(key: string): PendingTaskPrompt | undefined {
- return usePendingTaskPromptStore.getState().byKey[key];
- },
- move(fromKey: string, toKey: string): void {
- usePendingTaskPromptStore.getState().move(fromKey, toKey);
- },
- clear(key: string): void {
- usePendingTaskPromptStore.getState().clear(key);
- },
-};
-
-export function generatePendingTaskKey(): string {
- const cryptoObj =
- typeof globalThis !== "undefined"
- ? (globalThis as { crypto?: { randomUUID?: () => string } }).crypto
- : undefined;
- return buildPendingPromptKey(
- cryptoObj?.randomUUID?.() ?? null,
- Date.now(),
- Math.random().toString(36).slice(2, 10),
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/stores/repositoryCacheStore.ts b/products/desktop/apps/mobile/src/features/tasks/stores/repositoryCacheStore.ts
deleted file mode 100644
index fee1d54c732c..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/stores/repositoryCacheStore.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-import AsyncStorage from "@react-native-async-storage/async-storage";
-import { create } from "zustand";
-import { createJSONStorage, persist } from "zustand/middleware";
-import type { RepositoryOption } from "../types";
-
-interface RepositoryCacheState {
- /** Last successfully fetched, sorted list of repository options across all
- * GitHub integrations. Persisted to AsyncStorage so the picker can render
- * instantly on cold start while a background refetch confirms/updates the
- * list. Empty array means "no cache yet". */
- options: RepositoryOption[];
- /** Epoch ms of the last successful write. `null` before any cache hit —
- * useful if we want to surface a "last updated" hint or invalidate stale
- * caches in the future. */
- updatedAt: number | null;
- setOptions: (options: RepositoryOption[]) => void;
- clear: () => void;
-}
-
-export const useRepositoryCacheStore = create<RepositoryCacheState>()(
- persist(
- (set) => ({
- options: [],
- updatedAt: null,
- setOptions: (options) => set({ options, updatedAt: Date.now() }),
- clear: () => set({ options: [], updatedAt: null }),
- }),
- {
- name: "posthog-repository-cache",
- storage: createJSONStorage(() => AsyncStorage),
- partialize: (state) => ({
- options: state.options,
- updatedAt: state.updatedAt,
- }),
- },
- ),
-);
diff --git a/products/desktop/apps/mobile/src/features/tasks/stores/taskSessionStore.test.ts b/products/desktop/apps/mobile/src/features/tasks/stores/taskSessionStore.test.ts
deleted file mode 100644
index 40675d83cf48..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/stores/taskSessionStore.test.ts
+++ /dev/null
@@ -1,476 +0,0 @@
-import type {
- CloudTaskUpdatePayload,
- StoredLogEntry,
- Task,
- TaskRun,
-} from "@posthog/shared";
-import { beforeEach, describe, expect, it, vi } from "vitest";
-
-const { mockGetTask } = vi.hoisted(() => ({ mockGetTask: vi.fn() }));
-
-vi.mock("expo-haptics", () => ({
- impactAsync: vi.fn(),
- notificationAsync: vi.fn(),
- ImpactFeedbackStyle: { Light: "light", Medium: "medium" },
- NotificationFeedbackType: { Success: "success" },
-}));
-vi.mock("../lib/cloudTaskStream", () => ({ watchCloudTask: vi.fn() }));
-vi.mock("../composer/attachments/buildCloudPrompt", () => ({
- buildCloudPromptBlocks: vi.fn(() => Promise.resolve([])),
-}));
-vi.mock("../utils/sounds", () => ({
- playCompletionSound: vi.fn(() => Promise.resolve()),
-}));
-vi.mock("@/features/notifications/lib/notifications", () => ({
- presentLocalNotification: vi.fn(() => Promise.resolve()),
-}));
-vi.mock("../api", () => ({
- CloudCommandError: class CloudCommandError extends Error {},
- runTaskInCloud: vi.fn(),
- sendCloudCommand: vi.fn(),
-}));
-
-vi.mock("@/lib/posthogApiClient", () => ({
- getPostHogApiClient: () => ({ getTask: mockGetTask }),
-}));
-
-import { usePreferencesStore } from "@/features/preferences/stores/preferencesStore";
-import { runTaskInCloud } from "../api";
-import { playCompletionSound } from "../utils/sounds";
-import { useMessageQueueStore } from "./messageQueueStore";
-import {
- mapTerminalStatus,
- type TaskSession,
- useTaskSessionStore,
-} from "./taskSessionStore";
-import { useTaskStore } from "./taskStore";
-
-function seedSession(overrides: Partial<TaskSession> = {}): void {
- const session: TaskSession = {
- taskRunId: "run-1",
- taskId: "t1",
- events: [],
- status: "connected",
- isPromptPending: true,
- ...overrides,
- };
- useTaskSessionStore.setState({ sessions: { "run-1": session } });
-}
-
-describe("mapTerminalStatus", () => {
- it.each([
- { status: "completed", expected: "completed" },
- { status: "failed", expected: "failed" },
- { status: "cancelled", expected: "stopped" },
- { status: "in_progress", expected: undefined },
- { status: "queued", expected: undefined },
- { status: undefined, expected: undefined },
- { status: null, expected: undefined },
- ] as const)("maps $status to $expected", ({ status, expected }) => {
- expect(mapTerminalStatus(status)).toBe(expected);
- });
-});
-
-describe("steerQueuedMessage", () => {
- beforeEach(() => {
- useMessageQueueStore.setState({ queuesByTaskId: {} }, false);
- useTaskSessionStore.setState({ sessions: {} });
- });
-
- it("removes the message and resends it as a steer", async () => {
- seedSession();
- const sendInterrupting = vi.fn(() => Promise.resolve());
- useTaskSessionStore.setState({ sendInterrupting });
-
- useMessageQueueStore.getState().enqueue("t1", "first", []);
- useMessageQueueStore.getState().enqueue("t1", "second", []);
- const target = useMessageQueueStore.getState().getQueue("t1")[0];
-
- await useTaskSessionStore.getState().steerQueuedMessage("t1", target.id);
-
- expect(sendInterrupting).toHaveBeenCalledWith("t1", "first", []);
- expect(
- useMessageQueueStore
- .getState()
- .getQueue("t1")
- .map((m) => m.content),
- ).toEqual(["second"]);
- });
-
- it("rolls the message back onto the head when the resend fails", async () => {
- seedSession();
- const sendInterrupting = vi.fn(() => Promise.reject(new Error("boom")));
- useTaskSessionStore.setState({ sendInterrupting });
-
- useMessageQueueStore.getState().enqueue("t1", "first", []);
- useMessageQueueStore.getState().enqueue("t1", "second", []);
- const target = useMessageQueueStore.getState().getQueue("t1")[0];
-
- await expect(
- useTaskSessionStore.getState().steerQueuedMessage("t1", target.id),
- ).rejects.toThrow("boom");
-
- expect(
- useMessageQueueStore
- .getState()
- .getQueue("t1")
- .map((m) => m.content),
- ).toEqual(["first", "second"]);
- });
-
- it("no-ops while the session is compacting", async () => {
- seedSession({ isCompacting: true });
- const sendInterrupting = vi.fn(() => Promise.resolve());
- useTaskSessionStore.setState({ sendInterrupting });
-
- useMessageQueueStore.getState().enqueue("t1", "first", []);
- const target = useMessageQueueStore.getState().getQueue("t1")[0];
-
- await useTaskSessionStore.getState().steerQueuedMessage("t1", target.id);
-
- expect(sendInterrupting).not.toHaveBeenCalled();
- expect(
- useMessageQueueStore
- .getState()
- .getQueue("t1")
- .map((m) => m.content),
- ).toEqual(["first"]);
- });
-
- it("no-ops for an unknown message id", async () => {
- seedSession();
- const sendInterrupting = vi.fn(() => Promise.resolve());
- useTaskSessionStore.setState({ sendInterrupting });
-
- useMessageQueueStore.getState().enqueue("t1", "first", []);
-
- await useTaskSessionStore.getState().steerQueuedMessage("t1", "missing");
-
- expect(sendInterrupting).not.toHaveBeenCalled();
- expect(useMessageQueueStore.getState().getQueue("t1")).toHaveLength(1);
- });
-
- it("no-ops when no turn is running", async () => {
- seedSession({ isPromptPending: false });
- const sendInterrupting = vi.fn(() => Promise.resolve());
- useTaskSessionStore.setState({ sendInterrupting });
-
- useMessageQueueStore.getState().enqueue("t1", "first", []);
- const target = useMessageQueueStore.getState().getQueue("t1")[0];
-
- await useTaskSessionStore.getState().steerQueuedMessage("t1", target.id);
-
- expect(sendInterrupting).not.toHaveBeenCalled();
- expect(useMessageQueueStore.getState().getQueue("t1")).toHaveLength(1);
- });
-});
-
-describe("flushQueuedMessagesIfIdle", () => {
- beforeEach(() => {
- useMessageQueueStore.setState(
- { queuesByTaskId: {}, editingByTaskId: {} },
- false,
- );
- useTaskSessionStore.setState({ sessions: {} });
- });
-
- it("sends the queue when the agent is idle", async () => {
- seedSession({ isPromptPending: false });
- const sendInterrupting = vi.fn(() => Promise.resolve());
- useTaskSessionStore.setState({ sendInterrupting });
- useMessageQueueStore.getState().enqueue("t1", "a", []);
- useMessageQueueStore.getState().enqueue("t1", "b", []);
-
- useTaskSessionStore.getState().flushQueuedMessagesIfIdle("t1");
- await vi.waitFor(() => expect(sendInterrupting).toHaveBeenCalled());
-
- expect(sendInterrupting).toHaveBeenCalledWith("t1", "a\n\nb", []);
- expect(useMessageQueueStore.getState().getQueue("t1")).toEqual([]);
- });
-
- it("sends only the messages before the one being edited", async () => {
- seedSession({ isPromptPending: false });
- const sendInterrupting = vi.fn(() => Promise.resolve());
- useTaskSessionStore.setState({ sendInterrupting });
- useMessageQueueStore.getState().enqueue("t1", "a", []);
- useMessageQueueStore.getState().enqueue("t1", "b", []);
- useMessageQueueStore.getState().enqueue("t1", "c", []);
- const edited = useMessageQueueStore.getState().getQueue("t1")[1];
- useMessageQueueStore.getState().setEditing("t1", edited.id);
-
- useTaskSessionStore.getState().flushQueuedMessagesIfIdle("t1");
- await vi.waitFor(() => expect(sendInterrupting).toHaveBeenCalled());
-
- expect(sendInterrupting).toHaveBeenCalledWith("t1", "a", []);
- expect(
- useMessageQueueStore
- .getState()
- .getQueue("t1")
- .map((m) => m.content),
- ).toEqual(["b", "c"]);
- });
-
- it.each([
- { name: "a turn is running", overrides: { isPromptPending: true } },
- { name: "the run is terminal", overrides: { terminalStatus: "completed" } },
- { name: "the agent is compacting", overrides: { isCompacting: true } },
- ] as const)("no-ops when $name", async ({ overrides }) => {
- seedSession({ isPromptPending: false, ...overrides });
- const sendInterrupting = vi.fn(() => Promise.resolve());
- useTaskSessionStore.setState({ sendInterrupting });
- useMessageQueueStore.getState().enqueue("t1", "a", []);
-
- useTaskSessionStore.getState().flushQueuedMessagesIfIdle("t1");
- await Promise.resolve();
-
- expect(sendInterrupting).not.toHaveBeenCalled();
- expect(useMessageQueueStore.getState().getQueue("t1")).toHaveLength(1);
- });
-
- it("no-ops when the queue is empty", async () => {
- seedSession({ isPromptPending: false });
- const sendInterrupting = vi.fn(() => Promise.resolve());
- useTaskSessionStore.setState({ sendInterrupting });
-
- useTaskSessionStore.getState().flushQueuedMessagesIfIdle("t1");
- await Promise.resolve();
-
- expect(sendInterrupting).not.toHaveBeenCalled();
- });
-});
-
-describe("_resumeCloudRun", () => {
- const mockRunTaskInCloud = vi.mocked(runTaskInCloud);
-
- function previousTask(latestRun: Partial<TaskRun>): Task {
- return {
- id: "t1",
- latest_run: { id: "prev-run", ...latestRun } as TaskRun,
- } as Task;
- }
-
- beforeEach(() => {
- vi.clearAllMocks();
- useTaskStore.setState({ composerConfigByTaskId: {} });
- useTaskSessionStore.setState({ sessions: {} });
- usePreferencesStore.setState({ rtkEnabledCloud: true });
- mockRunTaskInCloud.mockResolvedValue({
- id: "t1",
- latest_run: { id: "new-run" },
- } as Task);
- });
-
- it("forwards the previous run's effort and permission mode", async () => {
- mockGetTask.mockResolvedValue(
- previousTask({
- branch: "feature",
- runtime_adapter: "claude",
- model: "claude-opus-4-8",
- reasoning_effort: "low",
- state: { initial_permission_mode: "acceptEdits" },
- }),
- );
-
- await useTaskSessionStore
- .getState()
- ._resumeCloudRun("t1", "prev-run", "hi");
-
- expect(mockRunTaskInCloud).toHaveBeenCalledWith("t1", {
- branch: "feature",
- runtimeAdapter: "claude",
- model: "claude-opus-4-8",
- resumeFromRunId: "prev-run",
- pendingUserMessage: "hi",
- reasoningEffort: "low",
- initialPermissionMode: "acceptEdits",
- rtkEnabled: true,
- });
- });
-
- it("forwards the rtk compression opt-out so resume preserves it", async () => {
- usePreferencesStore.setState({ rtkEnabledCloud: false });
- mockGetTask.mockResolvedValue(previousTask({ branch: "feature" }));
-
- await useTaskSessionStore
- .getState()
- ._resumeCloudRun("t1", "prev-run", "hi");
-
- expect(mockRunTaskInCloud).toHaveBeenCalledWith(
- "t1",
- expect.objectContaining({ rtkEnabled: false }),
- );
- });
-
- it("prefers the composer's current selection over the previous run", async () => {
- useTaskStore.setState({
- composerConfigByTaskId: {
- t1: {
- adapter: "codex",
- mode: "plan",
- model: "gpt-5.5",
- reasoning: "high",
- },
- },
- });
- mockGetTask.mockResolvedValue(
- previousTask({
- branch: null,
- reasoning_effort: "low",
- state: { initial_permission_mode: "acceptEdits" },
- }),
- );
-
- await useTaskSessionStore
- .getState()
- ._resumeCloudRun("t1", "prev-run", "hi");
-
- expect(mockRunTaskInCloud).toHaveBeenCalledWith(
- "t1",
- expect.objectContaining({
- runtimeAdapter: "codex",
- model: "gpt-5.5",
- reasoningEffort: "high",
- initialPermissionMode: "plan",
- }),
- );
- });
-
- it("drops stored reasoning unsupported by the resumed model", async () => {
- mockGetTask.mockResolvedValue(
- previousTask({
- runtime_adapter: "claude",
- model: "claude-sonnet-4-6",
- reasoning_effort: "max",
- }),
- );
-
- await useTaskSessionStore
- .getState()
- ._resumeCloudRun("t1", "prev-run", "hi");
-
- expect(mockRunTaskInCloud).toHaveBeenCalledWith(
- "t1",
- expect.objectContaining({ reasoningEffort: undefined }),
- );
- });
-
- it("ignores legacy Claude composer values when resuming Codex", async () => {
- useTaskStore.setState({
- composerConfigByTaskId: {
- t1: { mode: "plan", model: "claude-opus-4-8", reasoning: "high" },
- },
- });
- mockGetTask.mockResolvedValue(
- previousTask({
- runtime_adapter: "codex",
- model: "gpt-5.5",
- reasoning_effort: "medium",
- state: { initial_permission_mode: "auto" },
- }),
- );
-
- await useTaskSessionStore
- .getState()
- ._resumeCloudRun("t1", "prev-run", "hi");
-
- expect(mockRunTaskInCloud).toHaveBeenCalledWith(
- "t1",
- expect.objectContaining({
- runtimeAdapter: "codex",
- model: "gpt-5.5",
- reasoningEffort: "medium",
- initialPermissionMode: "auto",
- }),
- );
- });
-});
-
-describe("completion ping from the log stream", () => {
- beforeEach(() => {
- useTaskSessionStore.setState({ sessions: {} });
- usePreferencesStore.setState({ pingsEnabled: true });
- vi.mocked(playCompletionSound).mockClear();
- });
-
- function turnCompleteEntry(stopReason: string): StoredLogEntry {
- return {
- type: "notification",
- notification: {
- method: "_posthog/turn_complete",
- params: { sessionId: "s1", stopReason },
- },
- };
- }
-
- function logsUpdate(entries: StoredLogEntry[]): CloudTaskUpdatePayload {
- return {
- kind: "logs",
- taskId: "t1",
- runId: "run-1",
- newEntries: entries,
- totalEntryCount: entries.length,
- };
- }
-
- it("stays silent on an idle resume, then pings when the real turn ends", () => {
- seedSession({ awaitingPing: true });
- const store = useTaskSessionStore.getState();
-
- store._handleCloudUpdate(
- "run-1",
- logsUpdate([turnCompleteEntry("idle_resume")]),
- );
- expect(playCompletionSound).not.toHaveBeenCalled();
-
- store._handleCloudUpdate(
- "run-1",
- logsUpdate([turnCompleteEntry("end_turn")]),
- );
- expect(playCompletionSound).toHaveBeenCalledTimes(1);
- });
-});
-
-describe("compaction tracking from the log stream", () => {
- beforeEach(() => {
- useTaskSessionStore.setState({ sessions: {} });
- });
-
- function statusEntry(isComplete: boolean): StoredLogEntry {
- return {
- type: "notification",
- notification: {
- method: "_posthog/status",
- params: { status: "compacting", isComplete },
- },
- };
- }
-
- function logsUpdate(entries: StoredLogEntry[]): CloudTaskUpdatePayload {
- return {
- kind: "logs",
- taskId: "t1",
- runId: "run-1",
- newEntries: entries,
- totalEntryCount: entries.length,
- };
- }
-
- it("sets isCompacting on a compacting status and clears it on the boundary", () => {
- seedSession({ isCompacting: false });
- const store = useTaskSessionStore.getState();
-
- store._handleCloudUpdate("run-1", logsUpdate([statusEntry(false)]));
- expect(store.getSessionForTask("t1")?.isCompacting).toBe(true);
-
- store._handleCloudUpdate(
- "run-1",
- logsUpdate([
- {
- type: "notification",
- notification: { method: "_posthog/compact_boundary" },
- },
- ]),
- );
- expect(store.getSessionForTask("t1")?.isCompacting).toBe(false);
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/tasks/stores/taskSessionStore.ts b/products/desktop/apps/mobile/src/features/tasks/stores/taskSessionStore.ts
deleted file mode 100644
index 3a8c631e810c..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/stores/taskSessionStore.ts
+++ /dev/null
@@ -1,1259 +0,0 @@
-import { resolveCloudResumeOptions } from "@posthog/core/sessions/cloudRunOptions";
-import { convertStoredEntriesToPortableSessionEvents } from "@posthog/core/sessions/portableSessionEvents";
-import {
- type CloudTaskUpdatePayload,
- isIdleResumeTurnComplete,
- isTerminalStatus,
- type StoredLogEntry,
- serializeCloudPrompt,
- type Task,
-} from "@posthog/shared";
-import * as Haptics from "expo-haptics";
-import { AppState } from "react-native";
-import { create } from "zustand";
-import { presentLocalNotification } from "@/features/notifications/lib/notifications";
-import { usePreferencesStore } from "@/features/preferences/stores/preferencesStore";
-import { logger } from "@/lib/logger";
-import { getPostHogApiClient } from "@/lib/posthogApiClient";
-import {
- CloudCommandError,
- cancelRun,
- runTaskInCloud,
- sendCloudCommand,
-} from "../api";
-import { buildCloudPromptBlocks } from "../composer/attachments/buildCloudPrompt";
-import type { PendingAttachment } from "../composer/attachments/types";
-import {
- type WatchCloudTaskHandle,
- watchCloudTask,
-} from "../lib/cloudTaskStream";
-import type {
- CloudPendingPermissionRequest,
- SessionEvent,
- SessionNotification,
- SessionNotificationAttachment,
- TerminalStatus,
-} from "../types";
-import { playbackRateForTaskDuration } from "../utils/playbackRate";
-import { reinjectPromptAttachments } from "../utils/promptAttachments";
-import { playCompletionSound } from "../utils/sounds";
-import {
- combineQueuedMessages,
- useMessageQueueStore,
-} from "./messageQueueStore";
-import { useTaskStore } from "./taskStore";
-
-const log = logger.scope("task-session-store");
-
-function completionPlaybackRate(promptStartedAt?: number): number {
- if (
- !usePreferencesStore.getState().scaleSoundWithTaskLength ||
- promptStartedAt == null
- ) {
- return 1;
- }
- return playbackRateForTaskDuration(Date.now() - promptStartedAt);
-}
-
-type LocalNotificationKind =
- | "turn_complete"
- | "awaiting_user_input"
- | "task_failed";
-
-// Per-task cooldown so a noisy stream of terminal/awaiting events doesn't
-// fire a burst of identical banners. Keyed by taskId, value is the epoch ms
-// of the most recent notification for that task.
-const NOTIFICATION_DEDUP_WINDOW_MS = 30_000;
-const lastNotificationAt = new Map<string, number>();
-
-// TODO: server-side device presence. Today we can only suppress notifications
-// when *this* device is foregrounded on the task (`focusedTaskId` check
-// below). That leaves the cross-device case uncovered — e.g. desktop is open
-// on the same task, server fans the push to every registered token, mobile
-// still rings. Once the `/api/projects/{team_id}/tasks/{task_id}/presence/`
-// beacon endpoint lands in posthog/posthog, add:
-// 1. A stable per-install device_id (probably derive from pushTokenStore).
-// 2. POST presence every ~30s while a task screen is mounted AND AppState
-// is "active".
-// 3. DELETE presence on screen blur or AppState → "background"/"inactive".
-// The server will then drop pushes to devices with non-expired presence for
-// the target task, so this client-side maybePresentLocalNotification stays
-// as-is (it's only the OS fanout path we're improving).
-
-function maybePresentLocalNotification(args: {
- taskRunId: string;
- kind: LocalNotificationKind;
-}): void {
- if (!usePreferencesStore.getState().pushNotificationsEnabled) return;
-
- const storeState = useTaskSessionStore.getState();
- const session = storeState.sessions[args.taskRunId];
- if (!session) return;
-
- // Skip when the user is actively viewing this task — the UI already
- // surfaces what changed; an OS banner would be redundant noise.
- if (storeState.focusedTaskId === session.taskId) return;
-
- // Dedup: skip if we just notified about this task.
- const now = Date.now();
- const previous = lastNotificationAt.get(session.taskId);
- if (previous && now - previous < NOTIFICATION_DEDUP_WINDOW_MS) return;
- lastNotificationAt.set(session.taskId, now);
-
- const title = session.taskTitle ?? "PostHog";
- let body: string;
- switch (args.kind) {
- case "awaiting_user_input":
- body = `"${title}" needs your input`;
- break;
- case "task_failed":
- body = `"${title}" failed`;
- break;
- default:
- body = `"${title}" finished`;
- break;
- }
-
- presentLocalNotification({
- title: "PostHog",
- body,
- data: { taskId: session.taskId, taskRunId: session.taskRunId },
- }).catch(() => {});
-}
-
-// Session-update kinds that count as "the agent produced visible output" —
-// once we've seen one of these the connecting/thinking indicator should clear.
-const VISIBLE_AGENT_SESSION_UPDATES = new Set([
- "agent_message_chunk",
- "agent_message",
- "agent_thought_chunk",
- "tool_call",
- "tool_call_update",
-]);
-
-// Notification methods that mark the end of an agent turn — clearing
-// isPromptPending so the composer unblocks.
-const TURN_END_METHODS = new Set([
- "_posthog/turn_complete",
- "_posthog/task_complete",
- "_posthog/error",
- "_posthog/awaiting_user_input",
-]);
-
-interface BatchAnalysis {
- hasTurnEnd: boolean;
- hasNonIdleTurnEnd: boolean;
- hasAwaitingUserInput: boolean;
- hasTurnCompleted: boolean;
- hasTurnFailed: boolean;
- hasVisibleAgentOutput: boolean;
- externalUserMessageCount: number;
- agentMessageFinalized: boolean;
- // Latest compaction state seen in the batch (undefined = no change).
- compacting?: boolean;
-}
-
-function analyzeEntries(
- entries: StoredLogEntry[],
- localUserEchoes: Set<string>,
-): BatchAnalysis {
- let hasTurnEnd = false;
- let hasNonIdleTurnEnd = false;
- let hasAwaitingUserInput = false;
- let hasTurnCompleted = false;
- let hasTurnFailed = false;
- let hasVisibleAgentOutput = false;
- let externalUserMessageCount = 0;
- let agentMessageFinalized = false;
- let compacting: boolean | undefined;
-
- for (const entry of entries) {
- const method = entry.notification?.method;
- if (method && TURN_END_METHODS.has(method)) {
- const idleResume = isIdleResumeTurnComplete(entry);
- hasTurnEnd = true;
- if (!idleResume) {
- hasNonIdleTurnEnd = true;
- }
- if (method === "_posthog/awaiting_user_input") {
- hasAwaitingUserInput = true;
- }
- if (
- (method === "_posthog/turn_complete" && !idleResume) ||
- method === "_posthog/task_complete"
- ) {
- hasTurnCompleted = true;
- }
- if (method === "_posthog/error") {
- hasTurnFailed = true;
- }
- }
-
- if (method === "_posthog/status") {
- const params = entry.notification?.params as
- | { status?: string; isComplete?: boolean }
- | undefined;
- if (params?.status === "compacting") {
- compacting = !params.isComplete;
- }
- }
- if (method === "_posthog/compact_boundary") {
- compacting = false;
- }
-
- if (
- entry.type === "notification" &&
- method === "session/update" &&
- entry.notification?.params
- ) {
- const params = entry.notification.params as SessionNotification;
- const sessionUpdate = params.update?.sessionUpdate;
- if (sessionUpdate && VISIBLE_AGENT_SESSION_UPDATES.has(sessionUpdate)) {
- hasVisibleAgentOutput = true;
- }
- if (sessionUpdate === "agent_message") {
- agentMessageFinalized = true;
- }
- if (sessionUpdate === "user_message_chunk") {
- const text = params.update?.content?.text;
- if (text && !localUserEchoes.has(text)) {
- externalUserMessageCount += 1;
- }
- }
- }
- }
-
- return {
- hasTurnEnd,
- hasNonIdleTurnEnd,
- hasAwaitingUserInput,
- hasTurnCompleted,
- hasTurnFailed,
- hasVisibleAgentOutput,
- externalUserMessageCount,
- agentMessageFinalized,
- compacting,
- };
-}
-
-// Strip user_message_chunk entries whose text matches a pending local echo
-// (one match per echo). The echo set is mutated so each echo only cancels
-// one canonical copy.
-function dedupAgainstLocalEchoes(
- entries: StoredLogEntry[],
- localUserEchoes: Set<string>,
-): StoredLogEntry[] {
- if (localUserEchoes.size === 0) return entries;
- const result: StoredLogEntry[] = [];
- for (const entry of entries) {
- if (
- entry.type === "notification" &&
- entry.notification?.method === "session/update"
- ) {
- const params = entry.notification?.params as SessionNotification;
- const sessionUpdate = params?.update?.sessionUpdate;
- if (sessionUpdate === "user_message_chunk") {
- const text = params?.update?.content?.text;
- if (text && localUserEchoes.has(text)) {
- localUserEchoes.delete(text);
- continue;
- }
- }
- }
- result.push(entry);
- }
- return result;
-}
-
-export interface TaskSession {
- taskRunId: string;
- taskId: string;
- taskTitle?: string;
- events: SessionEvent[];
- status: "connecting" | "connected" | "disconnected" | "error";
- isPromptPending: boolean;
- // Content of user prompts echoed locally (before the agent writes them to
- // the log). Used to dedup the canonical copy against the echo.
- localUserEchoes?: Set<string>;
- // Terminal backend status for this run, populated by status updates so the
- // UI can surface "Run failed" / "Run completed" / "Run stopped".
- terminalStatus?: TerminalStatus;
- lastError?: string | null;
- // True when the user initiated work (new task, sendPrompt, resume) and
- // we should play a sound when control returns. False when reconnecting
- // to an already-running task to avoid spurious pings.
- awaitingPing?: boolean;
- // Timestamp when the current prompt started on this device. Used to scale
- // the completion sound's playback rate by how long the turn ran.
- promptStartedAt?: number;
- // True after a user prompt is sent, cleared when the first piece of
- // agent output (tool call, message, etc.) arrives.
- awaitingAgentOutput?: boolean;
- // Timestamp of the last new event received. Used to detect stale local
- // sessions (desktop stopped syncing).
- lastEventAt?: number;
- // Maps toolCallId → cloud requestId for routing permission responses. The
- // cloud's permission_response command requires the requestId it generated
- // when emitting the original permission_request SSE event; we capture it
- // here so the response can be routed back to the awaiting tool call.
- cloudPermissionRequestIds?: Record<string, string>;
- pendingPermissions?: Record<string, CloudPendingPermissionRequest>;
- // True while the agent is compacting context. Steering cancels and resends
- // the running turn, which would abort an in-flight compaction, so queued
- // messages are held until compaction ends.
- isCompacting?: boolean;
- // True once the user has requested the whole run be stopped, until the run
- // reaches a terminal status. Hides the Stop control so it can't be tapped
- // twice while the cancel is in flight.
- stopRequested?: boolean;
-}
-
-interface TaskSessionStore {
- sessions: Record<string, TaskSession>;
- focusedTaskId: string | null;
-
- setFocusedTaskId: (taskId: string | null) => void;
-
- connectToTask: (task: Task) => Promise<void>;
- disconnectFromTask: (taskId: string) => void;
- sendPrompt: (
- taskId: string,
- prompt: string,
- attachments?: PendingAttachment[],
- ) => Promise<void>;
- sendPermissionResponse: (
- taskId: string,
- args: {
- toolCallId: string;
- optionId: string;
- answers?: Record<string, string>;
- customInput?: string;
- displayText: string;
- },
- ) => Promise<void>;
- cancelPrompt: (taskId: string) => Promise<boolean>;
- /** Cancel the whole cloud run. Optimistically marks the session stop-requested
- * and reverts on failure. Returns false if there is no session or the API fails. */
- stopRun: (taskId: string) => Promise<boolean>;
- /** Send a prompt now, interrupting the running turn first if one is live. */
- sendInterrupting: (
- taskId: string,
- prompt: string,
- attachments?: PendingAttachment[],
- ) => Promise<void>;
- flushQueuedMessages: (taskId: string) => Promise<void>;
- /** Flush the queue only if the agent is idle. Used after an in-place edit is
- * saved or cancelled: the turn may have ended while the user was editing, so
- * nothing else would trigger the turn-end drain. A no-op mid-turn. */
- flushQueuedMessagesIfIdle: (taskId: string) => void;
- /** Drop one queued message and resend it now as a steer (interrupt + resend). */
- steerQueuedMessage: (taskId: string, messageId: string) => Promise<void>;
- setConfigOption: (
- taskId: string,
- configId: string,
- value: string,
- ) => Promise<void>;
- getSessionForTask: (taskId: string) => TaskSession | undefined;
-
- _handleCloudUpdate: (
- taskRunId: string,
- update: CloudTaskUpdatePayload,
- ) => void;
- _startWatcher: (taskRunId: string, taskId: string) => void;
- _stopWatcher: (taskRunId: string) => void;
- _resumeCloudRun: (
- taskId: string,
- previousRunId: string,
- prompt: string,
- ) => Promise<void>;
-}
-
-const watchHandles = new Map<string, WatchCloudTaskHandle>();
-const connectAttempts = new Set<string>();
-// Guards against a turn-end batch and a mode toggle racing to flush the same
-// queue twice.
-const flushingTasks = new Set<string>();
-
-export function mapTerminalStatus(
- status: string | undefined | null,
-): TerminalStatus | undefined {
- if (status === "completed") return "completed";
- if (status === "failed") return "failed";
- if (status === "cancelled") return "stopped";
- return undefined;
-}
-
-export const useTaskSessionStore = create<TaskSessionStore>((set, get) => ({
- sessions: {},
- focusedTaskId: null,
-
- setFocusedTaskId: (taskId) => set({ focusedTaskId: taskId }),
-
- connectToTask: async (task: Task) => {
- const taskId = task.id;
- const latestRunId = task.latest_run?.id;
-
- if (connectAttempts.has(taskId)) {
- log.debug("Connection already in progress", { taskId });
- return;
- }
-
- const existing = get().getSessionForTask(taskId);
- if (existing && existing.status === "connected") {
- log.debug("Already connected to task", { taskId });
- return;
- }
-
- connectAttempts.add(taskId);
-
- try {
- let runId = latestRunId;
- let awaitingPing = false;
-
- if (!runId) {
- log.debug("Task has no run yet, starting cloud run", { taskId });
- const updatedTask = await runTaskInCloud(taskId);
- runId = updatedTask.latest_run?.id;
- if (!runId) {
- log.error("Failed to start cloud run");
- return;
- }
- awaitingPing = true;
- }
-
- set((state) => ({
- sessions: {
- ...state.sessions,
- [runId]: {
- taskRunId: runId,
- taskId,
- taskTitle: task.title,
- events: [],
- status: "connecting",
- // Assume the run is working until the bootstrap snapshot tells
- // us otherwise — the SSE watcher will refine these fields.
- isPromptPending: true,
- awaitingPing,
- promptStartedAt: awaitingPing ? Date.now() : undefined,
- awaitingAgentOutput: true,
- },
- },
- }));
-
- get()._startWatcher(runId, taskId);
- log.debug("Started SSE watcher", { taskId, runId });
- } catch (error) {
- log.error("Failed to connect to task", error);
- } finally {
- connectAttempts.delete(taskId);
- }
- },
-
- disconnectFromTask: (taskId: string) => {
- const session = get().getSessionForTask(taskId);
- if (!session) return;
-
- get()._stopWatcher(session.taskRunId);
-
- set((state) => {
- const { [session.taskRunId]: _, ...rest } = state.sessions;
- return { sessions: rest };
- });
- log.debug("Disconnected from task", { taskId });
- },
-
- sendPrompt: async (
- taskId: string,
- prompt: string,
- attachments: PendingAttachment[] = [],
- ) => {
- const session = get().getSessionForTask(taskId);
- if (!session) {
- throw new Error("No active session for task");
- }
-
- // The local echo always shows the plain prompt text in the chat. When
- // attachments are present we send a structured cloud-prompt blob on the
- // wire (`__twig_cloud_prompt_v1__:…`) so the agent receives the image
- // and resource blocks alongside the text.
- const wirePayload =
- attachments.length > 0
- ? serializeCloudPrompt(
- await buildCloudPromptBlocks(prompt, attachments),
- )
- : prompt;
-
- const ts = Date.now();
- const echoAttachments: SessionNotificationAttachment[] =
- attachments.length > 0
- ? attachments.map((a) => ({
- kind: a.kind,
- uri: a.uri,
- fileName: a.fileName,
- mimeType: a.mimeType,
- }))
- : [];
- const userEvent: SessionEvent = {
- type: "session_update",
- ts,
- notification: {
- update: {
- sessionUpdate: "user_message_chunk",
- content: { type: "text", text: prompt },
- attachments: echoAttachments.length > 0 ? echoAttachments : undefined,
- },
- },
- };
- set((state) => {
- const current = state.sessions[session.taskRunId];
- const nextLocalEchoes = new Set(current.localUserEchoes ?? []);
- nextLocalEchoes.add(prompt);
- return {
- sessions: {
- ...state.sessions,
- [session.taskRunId]: {
- ...current,
- events: [...current.events, userEvent],
- localUserEchoes: nextLocalEchoes,
- isPromptPending: true,
- awaitingPing: true,
- promptStartedAt: ts,
- awaitingAgentOutput: true,
- },
- },
- };
- });
-
- try {
- await sendCloudCommand(taskId, session.taskRunId, "user_message", {
- content: wirePayload,
- });
- log.debug("Sent cloud command user_message", {
- taskId,
- runId: session.taskRunId,
- });
- } catch (err) {
- if (
- err instanceof CloudCommandError &&
- (err.status === 504 || err.status === 502 || err.status === 503)
- ) {
- log.warn("Transient server error sending prompt, rolling back", {
- status: err.status,
- taskId,
- });
- set((state) => {
- const current = state.sessions[session.taskRunId];
- if (!current) return state;
- const nextLocalEchoes = new Set(current.localUserEchoes ?? []);
- nextLocalEchoes.delete(prompt);
- return {
- sessions: {
- ...state.sessions,
- [session.taskRunId]: {
- ...current,
- events: current.events.filter((e) => e !== userEvent),
- localUserEchoes: nextLocalEchoes,
- isPromptPending: false,
- },
- },
- };
- });
- throw err;
- }
-
- let rollbackError: unknown = err;
- if (err instanceof CloudCommandError && err.isSandboxInactive()) {
- log.info("Sandbox inactive, creating resume run", {
- taskId,
- previousRunId: session.taskRunId,
- });
- try {
- await get()._resumeCloudRun(taskId, session.taskRunId, wirePayload);
- return;
- } catch (resumeErr) {
- log.error("Failed to resume cloud run", resumeErr);
- rollbackError = resumeErr;
- }
- }
-
- set((state) => {
- const current = state.sessions[session.taskRunId];
- if (!current) return state;
- const nextLocalEchoes = new Set(current.localUserEchoes ?? []);
- nextLocalEchoes.delete(prompt);
- return {
- sessions: {
- ...state.sessions,
- [session.taskRunId]: {
- ...current,
- events: current.events.filter((e) => e !== userEvent),
- localUserEchoes: nextLocalEchoes,
- isPromptPending: false,
- },
- },
- };
- });
- throw rollbackError;
- }
- },
-
- sendPermissionResponse: async (taskId, args) => {
- const session = get().getSessionForTask(taskId);
- if (!session) {
- throw new Error("No active session for task");
- }
-
- const ts = Date.now();
- const userEvent: SessionEvent = {
- type: "session_update",
- ts,
- notification: {
- update: {
- sessionUpdate: "user_message_chunk",
- content: { type: "text", text: args.displayText },
- },
- },
- };
-
- set((state) => {
- const current = state.sessions[session.taskRunId];
- if (!current) return state;
- const nextLocalEchoes = new Set(current.localUserEchoes ?? []);
- nextLocalEchoes.add(args.displayText);
- return {
- sessions: {
- ...state.sessions,
- [session.taskRunId]: {
- ...current,
- events: [...current.events, userEvent],
- localUserEchoes: nextLocalEchoes,
- isPromptPending: true,
- awaitingPing: true,
- promptStartedAt: ts,
- awaitingAgentOutput: true,
- },
- },
- };
- });
-
- // The cloud command requires the requestId it generated when emitting
- // the permission_request SSE event — toolCallId alone is not sufficient
- // for routing the response back to the awaiting tool call.
- const cloudRequestId =
- session.cloudPermissionRequestIds?.[args.toolCallId] ??
- session.pendingPermissions?.[args.toolCallId]?.requestId;
-
- set((state) => {
- const current = state.sessions[session.taskRunId];
- const currentPermission = current?.pendingPermissions?.[args.toolCallId];
- if (!current || !currentPermission) return state;
- return {
- sessions: {
- ...state.sessions,
- [session.taskRunId]: {
- ...current,
- pendingPermissions: {
- ...(current.pendingPermissions ?? {}),
- [args.toolCallId]: {
- ...currentPermission,
- response: {
- optionId: args.optionId,
- displayText: args.displayText,
- ...(args.answers ? { answers: args.answers } : {}),
- ...(args.customInput
- ? { customInput: args.customInput }
- : {}),
- },
- },
- },
- },
- },
- };
- });
-
- try {
- await sendCloudCommand(taskId, session.taskRunId, "permission_response", {
- ...(cloudRequestId ? { requestId: cloudRequestId } : {}),
- toolCallId: args.toolCallId,
- optionId: args.optionId,
- ...(args.answers ? { answers: args.answers } : {}),
- ...(args.customInput ? { customInput: args.customInput } : {}),
- });
- log.debug("Sent permission_response", {
- taskId,
- runId: session.taskRunId,
- toolCallId: args.toolCallId,
- requestId: cloudRequestId,
- });
-
- // One-shot: drop the mapping once we've responded so we don't reuse
- // it accidentally.
- if (cloudRequestId) {
- set((state) => {
- const current = state.sessions[session.taskRunId];
- if (!current?.cloudPermissionRequestIds) return state;
- const next = { ...current.cloudPermissionRequestIds };
- delete next[args.toolCallId];
- return {
- sessions: {
- ...state.sessions,
- [session.taskRunId]: {
- ...current,
- cloudPermissionRequestIds: next,
- },
- },
- };
- });
- }
- } catch (err) {
- log.error("Failed to send permission_response", err);
- set((state) => {
- const current = state.sessions[session.taskRunId];
- if (!current) return state;
- const nextLocalEchoes = new Set(current.localUserEchoes ?? []);
- nextLocalEchoes.delete(args.displayText);
- const currentPermission = current.pendingPermissions?.[args.toolCallId];
- return {
- sessions: {
- ...state.sessions,
- [session.taskRunId]: {
- ...current,
- events: current.events.filter((e) => e !== userEvent),
- localUserEchoes: nextLocalEchoes,
- pendingPermissions: currentPermission
- ? {
- ...(current.pendingPermissions ?? {}),
- [args.toolCallId]: {
- ...currentPermission,
- response: undefined,
- },
- }
- : current.pendingPermissions,
- isPromptPending: false,
- },
- },
- };
- });
- throw err;
- }
- },
-
- setConfigOption: async (taskId, configId, value) => {
- const session = get().getSessionForTask(taskId);
- if (!session || session.terminalStatus) return;
-
- try {
- await sendCloudCommand(taskId, session.taskRunId, "set_config_option", {
- configId,
- value,
- });
- log.debug("Sent set_config_option", {
- taskId,
- runId: session.taskRunId,
- configId,
- value,
- });
- } catch (err) {
- log.warn("Failed to send set_config_option", {
- taskId,
- configId,
- error: err,
- });
- throw err;
- }
- },
-
- cancelPrompt: async (taskId: string) => {
- const session = get().getSessionForTask(taskId);
- if (!session) return false;
-
- try {
- await sendCloudCommand(taskId, session.taskRunId, "cancel");
- log.debug("Sent cancel command", {
- taskId,
- runId: session.taskRunId,
- });
-
- set((state) => ({
- sessions: {
- ...state.sessions,
- [session.taskRunId]: {
- ...state.sessions[session.taskRunId],
- isPromptPending: false,
- awaitingPing: false,
- promptStartedAt: undefined,
- awaitingAgentOutput: false,
- },
- },
- }));
- return true;
- } catch (error) {
- log.error("Failed to send cancel request", error);
- return false;
- }
- },
-
- stopRun: async (taskId: string) => {
- const session = get().getSessionForTask(taskId);
- if (!session) return false;
- const runId = session.taskRunId;
-
- const previous = {
- stopRequested: session.stopRequested,
- isPromptPending: session.isPromptPending,
- };
- set((state) => ({
- sessions: {
- ...state.sessions,
- [runId]: {
- ...state.sessions[runId],
- stopRequested: true,
- isPromptPending: false,
- },
- },
- }));
-
- try {
- await cancelRun(taskId, runId);
- return true;
- } catch (error) {
- log.error("Failed to stop cloud run", error);
- set((state) => {
- const current = state.sessions[runId];
- if (!current) return state;
- return {
- sessions: {
- ...state.sessions,
- [runId]: { ...current, ...previous },
- },
- };
- });
- return false;
- }
- },
-
- sendInterrupting: async (taskId, prompt, attachments) => {
- // The cloud has no mid-turn inject, so steering interrupts the running
- // turn and resends as a fresh prompt.
- if (get().getSessionForTask(taskId)?.isPromptPending) {
- await get().cancelPrompt(taskId);
- }
- await get().sendPrompt(taskId, prompt, attachments);
- },
-
- flushQueuedMessages: async (taskId: string) => {
- if (flushingTasks.has(taskId)) return;
- flushingTasks.add(taskId);
- try {
- const drained = useMessageQueueStore
- .getState()
- .drain(taskId, { stopAtEdited: true });
- if (drained.length === 0) return;
-
- const { text, attachments } = combineQueuedMessages(drained);
- try {
- await get().sendInterrupting(taskId, text, attachments);
- } catch (err) {
- log.warn("Failed to flush queued messages, restoring queue", {
- taskId,
- error: err,
- });
- useMessageQueueStore.getState().prepend(taskId, drained);
- }
- } finally {
- flushingTasks.delete(taskId);
- }
- },
-
- flushQueuedMessagesIfIdle: (taskId: string) => {
- const session = get().getSessionForTask(taskId);
- if (
- session?.status === "connected" &&
- !session.isPromptPending &&
- !session.terminalStatus &&
- !session.isCompacting &&
- useMessageQueueStore.getState().getQueue(taskId).length > 0
- ) {
- get()
- .flushQueuedMessages(taskId)
- .catch((err) => log.warn("Queue flush failed", err));
- }
- },
-
- steerQueuedMessage: async (taskId: string, messageId: string) => {
- const session = get().getSessionForTask(taskId);
- // Steering only makes sense against a live turn. Mid-compaction it would
- // abort the compaction; with no turn running there is nothing to interrupt
- // and the message drains via the normal turn-end flush.
- if (!session || !session.isPromptPending || session.isCompacting) return;
-
- const message = useMessageQueueStore
- .getState()
- .getQueue(taskId)
- .find((m) => m.id === messageId);
- if (!message) return;
-
- useMessageQueueStore.getState().remove(taskId, messageId);
- try {
- await get().sendInterrupting(
- taskId,
- message.content,
- message.attachments,
- );
- } catch (err) {
- // Restore at the head so a failed steer never silently drops the message.
- useMessageQueueStore.getState().prepend(taskId, [message]);
- throw err;
- }
- },
-
- getSessionForTask: (taskId: string) => {
- return Object.values(get().sessions).find((s) => s.taskId === taskId);
- },
-
- _startWatcher: (taskRunId: string, taskId: string) => {
- if (watchHandles.has(taskRunId)) return;
-
- const handle = watchCloudTask({
- taskId,
- runId: taskRunId,
- onUpdate: (update) => get()._handleCloudUpdate(taskRunId, update),
- });
- watchHandles.set(taskRunId, handle);
- },
-
- _stopWatcher: (taskRunId: string) => {
- const handle = watchHandles.get(taskRunId);
- if (handle) {
- handle.stop();
- watchHandles.delete(taskRunId);
- log.debug("Stopped SSE watcher", { taskRunId });
- }
- },
-
- _handleCloudUpdate: (taskRunId: string, update: CloudTaskUpdatePayload) => {
- if (update.kind === "error") {
- set((state) => {
- const current = state.sessions[taskRunId];
- if (!current) return state;
- return {
- sessions: {
- ...state.sessions,
- [taskRunId]: {
- ...current,
- status: "error",
- isPromptPending: false,
- lastError: update.errorMessage,
- },
- },
- };
- });
- return;
- }
-
- if (update.kind === "permission_request") {
- // The tool_call UI itself comes from the `session/update` log stream;
- // this SSE-only payload exists so we can capture the cloud-side
- // requestId required to route a permission_response back to the
- // correct pending tool call.
- const toolCallId = update.toolCall?.toolCallId;
- if (toolCallId && update.requestId) {
- set((state) => {
- const current = state.sessions[taskRunId];
- if (!current) return state;
- return {
- sessions: {
- ...state.sessions,
- [taskRunId]: {
- ...current,
- cloudPermissionRequestIds: {
- ...(current.cloudPermissionRequestIds ?? {}),
- [toolCallId]: update.requestId,
- },
- pendingPermissions: {
- ...(current.pendingPermissions ?? {}),
- [toolCallId]: {
- requestId: update.requestId,
- toolCall: update.toolCall,
- options: update.options,
- },
- },
- },
- },
- };
- });
- }
- return;
- }
-
- if (update.kind === "snapshot" || update.kind === "logs") {
- const isSnapshot = update.kind === "snapshot";
-
- // Snapshot replaces all events; drop pending echoes since the snapshot
- // already includes the canonical copies.
- const existing = get().sessions[taskRunId];
- const echoSet = isSnapshot
- ? new Set<string>()
- : new Set(existing?.localUserEchoes ?? []);
-
- const dedupedEntries = isSnapshot
- ? update.newEntries
- : dedupAgainstLocalEchoes(update.newEntries, echoSet);
-
- const events =
- convertStoredEntriesToPortableSessionEvents(dedupedEntries);
- // Snapshots are S3-backed and replay user turns as text-only chunks;
- // reattach the images from the `session/prompt` entries in the same log.
- if (isSnapshot) {
- reinjectPromptAttachments(events);
- }
-
- const analysis = analyzeEntries(
- dedupedEntries,
- isSnapshot ? new Set() : echoSet,
- );
-
- const wasAwaitingPing = existing?.awaitingPing ?? false;
- const wasPromptPending = existing?.isPromptPending ?? false;
-
- set((state) => {
- const current = state.sessions[taskRunId];
- if (!current) return state;
-
- let nextIsPromptPending = current.isPromptPending;
- if (analysis.externalUserMessageCount > 0) nextIsPromptPending = true;
- if (analysis.hasTurnEnd || analysis.agentMessageFinalized) {
- nextIsPromptPending = false;
- }
-
- // Snapshots replay historical content — we don't mutate awaitingPing
- // based on history, otherwise turn-end markers inside an existing
- // run's snapshot would clear the user's pending ping before the
- // status block has a chance to fire its (more specific, e.g.
- // "task_failed") notification. The status block below is the
- // canonical owner of awaitingPing for terminal snapshots.
- //
- // awaitingPing is only ever set by this-device actions (sendPrompt,
- // sendPermissionResponse, fresh runs, resumes). External user
- // messages — i.e. another device chatting in the same task — must
- // NOT arm it; otherwise mobile would fire notifications for desktop
- // activity. Clearing on turn-end / finalized agent message stays.
- let nextAwaitingPing = current.awaitingPing;
- if (
- !isSnapshot &&
- (analysis.hasNonIdleTurnEnd || analysis.agentMessageFinalized)
- ) {
- nextAwaitingPing = false;
- }
-
- const nextAwaitingAgentOutput =
- current.awaitingAgentOutput && !analysis.hasVisibleAgentOutput;
-
- const nextEvents = isSnapshot
- ? events
- : events.length > 0
- ? [...current.events, ...events]
- : current.events;
-
- return {
- sessions: {
- ...state.sessions,
- [taskRunId]: {
- ...current,
- events: nextEvents,
- status: "connected",
- isPromptPending: nextIsPromptPending,
- awaitingPing: nextAwaitingPing,
- awaitingAgentOutput: nextAwaitingAgentOutput,
- isCompacting: analysis.compacting ?? current.isCompacting,
- localUserEchoes: echoSet.size > 0 ? echoSet : undefined,
- lastEventAt: events.length > 0 ? Date.now() : current.lastEventAt,
- },
- },
- };
- });
-
- // Live `logs` deltas fire pings for three turn-boundary cases:
- // * agent is blocked on the user (_posthog/awaiting_user_input)
- // * agent finished its turn (_posthog/turn_complete / task_complete)
- // * agent errored out the turn (_posthog/error)
- // The terminal-status block below can't be relied on for these: the
- // turn-end log entry arrives first and clears `awaitingPing`, so by
- // the time status terminal fires its `preState.awaitingPing` is
- // already false. Status-only termination (sandbox killed without a
- // turn-end log) still falls through to the status block. Snapshots
- // are historical replay — never ping for those.
- const shouldPingForAwaitingInput =
- !isSnapshot && wasAwaitingPing && analysis.hasAwaitingUserInput;
- const shouldPingForTurnComplete =
- !isSnapshot &&
- wasAwaitingPing &&
- analysis.hasTurnCompleted &&
- !analysis.hasAwaitingUserInput;
- const shouldPingForTurnFailed =
- !isSnapshot &&
- wasAwaitingPing &&
- analysis.hasTurnFailed &&
- !analysis.hasAwaitingUserInput &&
- !analysis.hasTurnCompleted;
- const shouldPingNow =
- shouldPingForAwaitingInput ||
- shouldPingForTurnComplete ||
- shouldPingForTurnFailed;
- if (shouldPingNow && usePreferencesStore.getState().pingsEnabled) {
- playCompletionSound(
- undefined,
- undefined,
- completionPlaybackRate(existing?.promptStartedAt),
- ).catch(() => {});
- Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success);
- }
- if (shouldPingForAwaitingInput) {
- maybePresentLocalNotification({
- taskRunId,
- kind: "awaiting_user_input",
- });
- } else if (shouldPingForTurnComplete) {
- maybePresentLocalNotification({
- taskRunId,
- kind: "turn_complete",
- });
- } else if (shouldPingForTurnFailed) {
- maybePresentLocalNotification({
- taskRunId,
- kind: "task_failed",
- });
- }
-
- // Turn just ended on a live delta — drain any queued messages the user
- // buffered while it was running. Deferred a tick so the store state is
- // committed before the flush reads it.
- const after = get().sessions[taskRunId];
- if (
- !isSnapshot &&
- wasPromptPending &&
- after &&
- !after.isPromptPending &&
- after.status === "connected" &&
- useMessageQueueStore.getState().getQueue(after.taskId).length > 0
- ) {
- const flushTaskId = after.taskId;
- setTimeout(() => {
- get()
- .flushQueuedMessages(flushTaskId)
- .catch((err) => log.warn("Queue flush failed", err));
- }, 0);
- }
- }
-
- if (update.kind === "status" || update.kind === "snapshot") {
- if (isTerminalStatus(update.status)) {
- const preState = get().sessions[taskRunId];
- const shouldPing = preState?.awaitingPing ?? false;
- const terminal = mapTerminalStatus(update.status);
- set((state) => {
- const current = state.sessions[taskRunId];
- if (!current) return state;
- return {
- sessions: {
- ...state.sessions,
- [taskRunId]: {
- ...current,
- isPromptPending: false,
- terminalStatus: terminal,
- lastError: update.errorMessage ?? null,
- awaitingPing: false,
- },
- },
- };
- });
- if (shouldPing && usePreferencesStore.getState().pingsEnabled) {
- playCompletionSound(
- undefined,
- undefined,
- completionPlaybackRate(preState?.promptStartedAt),
- ).catch(() => {});
- Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success);
- }
- if (shouldPing) {
- maybePresentLocalNotification({
- taskRunId,
- kind: terminal === "failed" ? "task_failed" : "turn_complete",
- });
- }
- }
- }
- },
-
- _resumeCloudRun: async (
- taskId: string,
- previousRunId: string,
- prompt: string,
- ) => {
- const freshTask = await getPostHogApiClient().getTask(taskId);
- const previousRun = freshTask.latest_run;
- const previousBranch = previousRun?.branch ?? null;
-
- const composerConfig =
- useTaskStore.getState().composerConfigByTaskId[taskId];
- const runtimeOptions = resolveCloudResumeOptions(
- composerConfig,
- previousRun,
- );
-
- const updatedTask = await runTaskInCloud(taskId, {
- branch: previousBranch,
- runtimeAdapter: runtimeOptions.adapter,
- model: runtimeOptions.model,
- resumeFromRunId: previousRunId,
- pendingUserMessage: prompt,
- reasoningEffort: runtimeOptions.reasoningLevel,
- initialPermissionMode: runtimeOptions.initialPermissionMode,
- rtkEnabled: usePreferencesStore.getState().rtkEnabledCloud,
- });
-
- const newRun = updatedTask.latest_run;
- if (!newRun?.id) {
- throw new Error("Resume run was created but has no id");
- }
-
- get()._stopWatcher(previousRunId);
-
- set((state) => {
- const previousSession = state.sessions[previousRunId];
- if (!previousSession) return state;
- const { [previousRunId]: _old, ...rest } = state.sessions;
- return {
- sessions: {
- ...rest,
- [newRun.id]: {
- ...previousSession,
- taskRunId: newRun.id,
- status: "connecting",
- isPromptPending: true,
- awaitingPing: true,
- promptStartedAt: Date.now(),
- awaitingAgentOutput: true,
- },
- },
- };
- });
-
- get()._startWatcher(newRun.id, taskId);
- log.debug("Swapped to resume run", {
- taskId,
- previousRunId,
- newRunId: newRun.id,
- });
- },
-}));
-
-// When the app returns from background, iOS may have killed the SSE
-// connection. Nudge every active watcher to reconnect so the stream resumes
-// with Last-Event-ID.
-AppState.addEventListener("change", (nextState) => {
- if (nextState !== "active") return;
- for (const handle of watchHandles.values()) {
- handle.reconnectIfDisconnected();
- }
-});
diff --git a/products/desktop/apps/mobile/src/features/tasks/stores/taskStore.ts b/products/desktop/apps/mobile/src/features/tasks/stores/taskStore.ts
deleted file mode 100644
index 20ce1259c296..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/stores/taskStore.ts
+++ /dev/null
@@ -1,116 +0,0 @@
-import type { TaskActivitySortMode } from "@posthog/core/tasks/taskActivity";
-import type {
- Adapter,
- ExecutionMode,
- SupportedReasoningEffort,
-} from "@posthog/shared";
-import AsyncStorage from "@react-native-async-storage/async-storage";
-import { create } from "zustand";
-import { createJSONStorage, persist } from "zustand/middleware";
-import type { ContextWindow } from "../composer/options";
-import type { RepositorySelection } from "../types";
-
-export type OrganizeMode = "by-project" | "chronological";
-export type SortMode = TaskActivitySortMode;
-
-const EMPTY_REPOSITORY_SELECTION: RepositorySelection = {
- integrationId: null,
- repository: null,
-};
-
-/** Per-task chat composer pill values. Persisted so reopening a task keeps
- * the mode/model/reasoning the user last selected for it. */
-export interface TaskComposerConfig {
- adapter?: Adapter;
- mode?: ExecutionMode;
- model?: string;
- reasoning?: SupportedReasoningEffort;
- contextWindow?: ContextWindow;
- fastMode?: boolean;
-}
-
-interface TaskUIState {
- selectedTaskId: string | null;
- organizeMode: OrganizeMode;
- sortMode: SortMode;
- showInternal: boolean;
- filter: string;
- /** Most-recently-used repository for the new-task composer. Pre-fills the
- * repo pill so users don't have to re-pick the same repo every time. */
- lastRepository: RepositorySelection;
- composerConfigByTaskId: Record<string, TaskComposerConfig>;
- pendingPromptByTaskId: Record<string, string>;
-
- selectTask: (taskId: string | null) => void;
- setOrganizeMode: (mode: OrganizeMode) => void;
- setSortMode: (mode: SortMode) => void;
- setShowInternal: (showInternal: boolean) => void;
- setFilter: (filter: string) => void;
- setLastRepository: (selection: RepositorySelection) => void;
- setComposerConfig: (
- taskId: string,
- config: Partial<TaskComposerConfig>,
- ) => void;
- setPendingPrompt: (taskId: string, prompt: string) => void;
- consumePendingPrompt: (taskId: string) => string | undefined;
-}
-
-export const useTaskStore = create<TaskUIState>()(
- persist(
- (set, get) => ({
- selectedTaskId: null,
- organizeMode: "by-project",
- sortMode: "updated",
- showInternal: false,
- filter: "",
- lastRepository: EMPTY_REPOSITORY_SELECTION,
- composerConfigByTaskId: {},
- pendingPromptByTaskId: {},
-
- selectTask: (selectedTaskId) => set({ selectedTaskId }),
- setOrganizeMode: (organizeMode) => set({ organizeMode }),
- setSortMode: (sortMode) => set({ sortMode }),
- setShowInternal: (showInternal) => set({ showInternal }),
- setFilter: (filter) => set({ filter }),
- setLastRepository: (lastRepository) => set({ lastRepository }),
- setComposerConfig: (taskId, config) =>
- set((state) => ({
- composerConfigByTaskId: {
- ...state.composerConfigByTaskId,
- [taskId]: {
- ...state.composerConfigByTaskId[taskId],
- ...config,
- },
- },
- })),
- setPendingPrompt: (taskId, prompt) =>
- set((state) => ({
- pendingPromptByTaskId: {
- ...state.pendingPromptByTaskId,
- [taskId]: prompt,
- },
- })),
- consumePendingPrompt: (taskId) => {
- const prompt = get().pendingPromptByTaskId[taskId];
- if (!prompt) return undefined;
- set((state) => {
- const remaining = { ...state.pendingPromptByTaskId };
- delete remaining[taskId];
- return { pendingPromptByTaskId: remaining };
- });
- return prompt;
- },
- }),
- {
- name: "posthog-task-ui",
- storage: createJSONStorage(() => AsyncStorage),
- partialize: (state) => ({
- organizeMode: state.organizeMode,
- sortMode: state.sortMode,
- showInternal: state.showInternal,
- lastRepository: state.lastRepository,
- composerConfigByTaskId: state.composerConfigByTaskId,
- }),
- },
- ),
-);
diff --git a/products/desktop/apps/mobile/src/features/tasks/stores/turnFeedbackStore.ts b/products/desktop/apps/mobile/src/features/tasks/stores/turnFeedbackStore.ts
deleted file mode 100644
index e1cee17f7746..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/stores/turnFeedbackStore.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import type { AgentTurnFeedbackSentiment } from "@posthog/shared";
-import { create } from "zustand";
-
-interface TurnFeedbackState {
- // Keeps the chosen thumb lit as the FlatList recycles turn rows. Feedback is
- // analytics-only, so this is in-memory only and never persisted.
- sentimentByTurnId: Record<string, AgentTurnFeedbackSentiment>;
- setTurnFeedback: (
- turnId: string,
- sentiment: AgentTurnFeedbackSentiment,
- ) => void;
-}
-
-export const useTurnFeedbackStore = create<TurnFeedbackState>((set) => ({
- sentimentByTurnId: {},
- setTurnFeedback: (turnId, sentiment) =>
- set((state) => ({
- sentimentByTurnId: { ...state.sentimentByTurnId, [turnId]: sentiment },
- })),
-}));
-
-export const useTurnFeedback = (
- turnId: string,
-): AgentTurnFeedbackSentiment | null =>
- useTurnFeedbackStore((s) => s.sentimentByTurnId[turnId] ?? null);
diff --git a/products/desktop/apps/mobile/src/features/tasks/types.ts b/products/desktop/apps/mobile/src/features/tasks/types.ts
deleted file mode 100644
index 7f16dcbd20fb..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/types.ts
+++ /dev/null
@@ -1,81 +0,0 @@
-import type {
- CloudPermissionOption,
- CloudTaskPermissionRequestUpdate,
-} from "@posthog/shared";
-
-export type TerminalStatus = "completed" | "failed" | "stopped";
-
-export interface SessionNotificationAttachment {
- kind: "image" | "document";
- uri: string;
- fileName: string;
- mimeType?: string;
-}
-
-export interface PlanEntry {
- content: string;
- status: "pending" | "in_progress" | "completed" | "failed";
- priority: string;
-}
-
-export interface CloudPermissionResponseSelection {
- optionId: string;
- displayText: string;
- customInput?: string;
- answers?: Record<string, string>;
-}
-
-export interface CloudPendingPermissionRequest {
- requestId: string;
- toolCall: CloudTaskPermissionRequestUpdate["toolCall"];
- options: CloudPermissionOption[];
- response?: CloudPermissionResponseSelection;
-}
-
-export interface Integration {
- id: number;
- kind: string;
- display_name?: string;
- config?: {
- account?: {
- login?: string;
- };
- };
-}
-
-/**
- * A user-scoped GitHub integration from `/api/users/@me/integrations/`.
- * `id` is the PostHog `UserIntegration` UUID (used as `github_user_integration`
- * on task creation); `installation_id` is the numeric GitHub App installation id
- * (used to fetch repos and as the numeric key in `RepositoryOption`).
- */
-export interface UserGithubIntegration {
- id: string;
- kind: string;
- installation_id: string;
- account?: {
- name?: string;
- type?: string;
- };
-}
-
-export interface RepositoryOption {
- integrationId: number;
- integrationLabel: string;
- repository: string;
-}
-
-export interface RepositorySelection {
- integrationId: number | null;
- repository: string | null;
-}
-
-export interface CreateTaskOptions {
- description: string;
- title?: string;
- repository?: string;
- github_integration?: number;
- /** User-scoped GitHub integration UUID (UserIntegration pk) for user-authored
- * cloud runs. Preferred over `github_integration` for interactive tasks. */
- github_user_integration?: string;
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/utils/archiveGuard.test.ts b/products/desktop/apps/mobile/src/features/tasks/utils/archiveGuard.test.ts
deleted file mode 100644
index 730e0d98d6b1..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/utils/archiveGuard.test.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import { Alert } from "react-native";
-import { describe, expect, it, vi } from "vitest";
-import { confirmArchiveRunningTask } from "./archiveGuard";
-
-describe("confirmArchiveRunningTask", () => {
- it("archives only when the user confirms", () => {
- const onConfirm = vi.fn();
- confirmArchiveRunningTask("My task", onConfirm);
-
- expect(Alert.alert).toHaveBeenCalledTimes(1);
- const [title, message, buttons] = vi.mocked(Alert.alert).mock.calls[0];
- expect(title).toBe("Archive running task?");
- expect(message).toContain("My task");
- expect(message).toContain("stop the agent");
-
- const cancelButton = buttons?.find((b) => b.text === "Cancel");
- const archiveButton = buttons?.find((b) => b.text === "Archive");
-
- cancelButton?.onPress?.();
- expect(onConfirm).not.toHaveBeenCalled();
-
- archiveButton?.onPress?.();
- expect(onConfirm).toHaveBeenCalledTimes(1);
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/tasks/utils/archiveGuard.ts b/products/desktop/apps/mobile/src/features/tasks/utils/archiveGuard.ts
deleted file mode 100644
index d5e8cd968715..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/utils/archiveGuard.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import { Alert } from "react-native";
-
-export function confirmArchiveRunningTask(
- taskTitle: string,
- onConfirm: () => void,
-): void {
- Alert.alert(
- "Archive running task?",
- `"${taskTitle}" is still running. Archiving it now will stop the agent. You can unarchive it later.`,
- [
- { text: "Cancel", style: "cancel" },
- { text: "Archive", style: "destructive", onPress: onConfirm },
- ],
- );
-}
-
-export function confirmStopRun(onConfirm: () => void): void {
- Alert.alert(
- "Stop this run?",
- "This cancels the running agent. You can start a new run afterwards.",
- [
- { text: "Cancel", style: "cancel" },
- { text: "Stop", style: "destructive", onPress: onConfirm },
- ],
- );
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/utils/artifactHtml.test.ts b/products/desktop/apps/mobile/src/features/tasks/utils/artifactHtml.test.ts
deleted file mode 100644
index ce8bef4a1727..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/utils/artifactHtml.test.ts
+++ /dev/null
@@ -1,115 +0,0 @@
-import { describe, expect, it } from "vitest";
-import { denyMediaCapture, removeAutomaticRedirects } from "./artifactHtml";
-
-describe("removeAutomaticRedirects", () => {
- it.each([
- ['<meta http-equiv="refresh" content="0;url=https://evil.example">'],
- ['<META HTTP-EQUIV="REFRESH" CONTENT="5">'],
- ["<meta http-equiv='refresh' content='0'>"],
- ['<meta content="0;url=/next" http-equiv="refresh">'],
- ['<meta http-equiv = "refresh" content="0">'],
- ["<meta http-equiv=refresh content=0>"],
- ['<meta http-equiv="refresh" content="0"/>'],
- // A quoted ">" does not end the tag for an HTML tokenizer, so it must not
- // end it for this helper either.
- ['<meta title=">" http-equiv="refresh" content="0;url=/evil">'],
- ])("strips the auto-refresh meta %#", (meta) => {
- const html = `<!doctype html><html><head>${meta}<title>t</title></head><body><script>ok()</script></body></html>`;
- const result = removeAutomaticRedirects(html);
- expect(result.toLowerCase()).not.toContain("http-equiv");
- expect(result).toContain("<title>t</title>");
- expect(result).toContain("<script>ok()</script>");
- });
-
- it.each([
- ['<meta charset="utf-8">'],
- ['<meta http-equiv="content-type" content="text/html; charset=utf-8">'],
- ['<meta name="viewport" content="width=device-width, initial-scale=1">'],
- // http-equiv is read as an attribute, not matched as loose tag text, so a
- // value that merely mentions it is left alone.
- ['<meta name="note" content="http-equiv=refresh">'],
- ])("keeps non-refresh markup untouched %#", (meta) => {
- const html = `<!doctype html><head>${meta}</head>`;
- expect(removeAutomaticRedirects(html)).toBe(html);
- });
-
- it("strips every auto-refresh meta in the document", () => {
- const refresh = '<meta http-equiv="refresh" content="0">';
- const html = `<head><meta charset="utf-8">${refresh}${refresh}</head>`;
- expect(removeAutomaticRedirects(html)).toBe(
- '<head><meta charset="utf-8"></head>',
- );
- });
-});
-
-describe("denyMediaCapture", () => {
- // The guard is the whole output when there is no artifact markup to wrap.
- const guardScript = () => {
- const guard = denyMediaCapture("");
- return guard.slice("<script>".length, guard.length - "</script>".length);
- };
-
- it("runs the guard ahead of the artifact's own markup", () => {
- const result = denyMediaCapture("<body><script>ok()</script></body>");
- expect(result.indexOf("mediaDevices")).toBeLessThan(
- result.indexOf("<body>"),
- );
- });
-
- it("keeps the doctype first so the document stays out of quirks mode", () => {
- const result = denyMediaCapture("<!doctype html><html></html>");
- expect(result.startsWith("<!doctype html><script>")).toBe(true);
- expect(result.endsWith("<html></html>")).toBe(true);
- });
-
- it("removes the media capture entry points beyond recovery", () => {
- const fakeNavigator: Record<string, unknown> = {
- mediaDevices: { getUserMedia: () => undefined },
- getUserMedia: () => undefined,
- webkitGetUserMedia: () => undefined,
- mozGetUserMedia: () => undefined,
- };
- new Function("navigator", guardScript())(fakeNavigator);
-
- for (const key of [
- "mediaDevices",
- "getUserMedia",
- "webkitGetUserMedia",
- "mozGetUserMedia",
- ]) {
- expect(fakeNavigator[key]).toBeUndefined();
- // Non-writable and non-configurable, so artifact scripts cannot put the
- // API back once the guard has run.
- const descriptor = Object.getOwnPropertyDescriptor(fakeNavigator, key);
- expect(descriptor?.writable).toBe(false);
- expect(descriptor?.configurable).toBe(false);
- }
- });
-
- it("does not throw when an entry point is already missing", () => {
- const fakeNavigator: Record<string, unknown> = {};
- expect(() =>
- new Function("navigator", guardScript())(fakeNavigator),
- ).not.toThrow();
- expect(fakeNavigator.mediaDevices).toBeUndefined();
- });
-
- // Records the limitation documented in artifactHtml.ts as something the
- // suite states rather than a claim in a comment: the guard reaches one
- // realm's navigator, so a script that builds a fresh realm (an about:blank
- // iframe, which frame-src 'none' does not cover) finds an unpatched one
- // there. Closing that needs a native WebChromeClient denying
- // onPermissionRequest, not a bigger script.
- it("only covers the realm it runs in", () => {
- const topRealmNavigator: Record<string, unknown> = {
- mediaDevices: { getUserMedia: () => undefined },
- };
- const freshRealmNavigator: Record<string, unknown> = {
- mediaDevices: { getUserMedia: () => undefined },
- };
- new Function("navigator", guardScript())(topRealmNavigator);
-
- expect(topRealmNavigator.mediaDevices).toBeUndefined();
- expect(freshRealmNavigator.mediaDevices).toBeDefined();
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/tasks/utils/artifactHtml.ts b/products/desktop/apps/mobile/src/features/tasks/utils/artifactHtml.ts
deleted file mode 100644
index 9a3f6f9eb017..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/utils/artifactHtml.ts
+++ /dev/null
@@ -1,106 +0,0 @@
-// Mobile has no DOMParser, so this removes the meta tag at the string level
-// rather than reusing the desktop DOM-based removal. The scan is attribute
-// aware — a quoted ">" inside an attribute value does not end the tag, and
-// http-equiv is read as a parsed attribute rather than matched as loose text —
-// so it agrees with what an HTML tokenizer sees.
-
-// Returns the index just past the ">" that closes the tag opened at `from`,
-// skipping over quoted attribute values.
-function tagEnd(html: string, from: number): number {
- let index = from;
- while (index < html.length) {
- const char = html[index];
- if (char === '"' || char === "'") {
- const closingQuote = html.indexOf(char, index + 1);
- // An unterminated quote swallows the rest of the document, exactly as a
- // tokenizer stuck in the attribute-value state would.
- if (closingQuote === -1) return html.length;
- index = closingQuote + 1;
- continue;
- }
- if (char === ">") return index + 1;
- index += 1;
- }
- return html.length;
-}
-
-const META_TAG = /<meta\b/gi;
-const ATTRIBUTE = /([^\s/>=]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]*)))?/g;
-
-function isRefreshMeta(tag: string): boolean {
- ATTRIBUTE.lastIndex = "<meta".length;
- let attribute = ATTRIBUTE.exec(tag);
- while (attribute !== null) {
- const name = attribute[1].toLowerCase();
- const value = attribute[2] ?? attribute[3] ?? attribute[4] ?? "";
- if (name === "http-equiv" && value.trim().toLowerCase() === "refresh") {
- return true;
- }
- attribute = ATTRIBUTE.exec(tag);
- }
- return false;
-}
-
-export function removeAutomaticRedirects(html: string): string {
- META_TAG.lastIndex = 0;
- let kept = "";
- let copiedUpTo = 0;
- let stripped = false;
- let match = META_TAG.exec(html);
- while (match !== null) {
- const end = tagEnd(html, match.index + match[0].length);
- if (isRefreshMeta(html.slice(match.index, end))) {
- kept += html.slice(copiedUpTo, match.index);
- copiedUpTo = end;
- stripped = true;
- }
- META_TAG.lastIndex = end;
- match = META_TAG.exec(html);
- }
- return stripped ? kept + html.slice(copiedUpTo) : html;
-}
-
-// mediaCapturePermissionGrantType is an iOS-only prop. On Android
-// react-native-webview's WebChromeClient grants a getUserMedia request whenever
-// the host app already holds CAMERA or RECORD_AUDIO, which this app does for QR
-// sign-in and voice input — so an artifact could otherwise reach the camera or
-// microphone. Removing the entry points from the document is the only lever
-// available without patching the library's native WebChromeClient, so treat it
-// as defence in depth: a script that builds a fresh realm (an about:blank
-// iframe, which frame-src 'none' does not cover) can still find an unpatched
-// navigator. That gap cannot be closed from script — patching
-// HTMLIFrameElement's contentWindow getter still leaves window[0], an
-// unconfigurable WindowProxy index. Closing it properly means a native
-// WebChromeClient whose onPermissionRequest denies RESOURCE_VIDEO_CAPTURE and
-// RESOURCE_AUDIO_CAPTURE, i.e. a patch to react-native-webview, which affects
-// every WebView in the app and so needs its own change.
-const MEDIA_CAPTURE_GUARD = `<script>(function () {
- var hide = function (target, key) {
- try {
- Object.defineProperty(target, key, {
- value: undefined,
- writable: false,
- configurable: false,
- });
- } catch (error) {}
- };
- hide(navigator, "mediaDevices");
- hide(navigator, "getUserMedia");
- hide(navigator, "webkitGetUserMedia");
- hide(navigator, "mozGetUserMedia");
-})();</script>`;
-
-// Inserted after the doctype, which must stay first or the document drops into
-// quirks mode. The parser hoists the script into <head>, ahead of the
-// artifact's own markup, so it runs before any of the artifact's scripts.
-export function denyMediaCapture(html: string): string {
- const doctype = html.match(/^\s*<!doctype[^>]*>/i);
- if (doctype) {
- return (
- html.slice(0, doctype[0].length) +
- MEDIA_CAPTURE_GUARD +
- html.slice(doctype[0].length)
- );
- }
- return MEDIA_CAPTURE_GUARD + html;
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/utils/artifactPreview.test.ts b/products/desktop/apps/mobile/src/features/tasks/utils/artifactPreview.test.ts
deleted file mode 100644
index 09df3413b160..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/utils/artifactPreview.test.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-import { describe, expect, it } from "vitest";
-import {
- type ArtifactPreviewKind,
- artifactPreviewKind,
- formatArtifactSize,
-} from "./artifactPreview";
-
-describe("artifactPreviewKind", () => {
- it.each<[string, ArtifactPreviewKind]>([
- ["chart.png", "image"],
- ["photo.JPEG", "image"],
- ["diagram.webp", "image"],
- ["report.md", "markdown"],
- ["notes.markdown", "markdown"],
- ["doc.MDX", "markdown"],
- ["page.html", "html"],
- ["page.htm", "html"],
- ["data.csv", "unsupported"],
- ["archive.zip", "unsupported"],
- ["noextension", "unsupported"],
- ])("maps %s to %s", (fileName, expected) => {
- expect(artifactPreviewKind(fileName)).toBe(expected);
- });
-});
-
-describe("formatArtifactSize", () => {
- it.each<[number | undefined, string | null]>([
- [undefined, null],
- [0, "0 B"],
- [512, "512 B"],
- [1_500, "2 KB"],
- [2_400_000, "2.4 MB"],
- ])("formats %s as %s", (size, expected) => {
- expect(formatArtifactSize(size)).toBe(expected);
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/tasks/utils/artifactPreview.ts b/products/desktop/apps/mobile/src/features/tasks/utils/artifactPreview.ts
deleted file mode 100644
index 8f52babca695..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/utils/artifactPreview.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import { isRasterImageFile } from "@posthog/shared";
-
-export type ArtifactPreviewKind = "image" | "markdown" | "html" | "unsupported";
-
-const MARKDOWN_EXTENSIONS = new Set(["md", "mdx", "markdown"]);
-
-function extension(fileName: string): string {
- return fileName.split(".").pop()?.toLowerCase() ?? "";
-}
-
-export function artifactPreviewKind(fileName: string): ArtifactPreviewKind {
- if (isRasterImageFile(fileName)) return "image";
- const ext = extension(fileName);
- if (MARKDOWN_EXTENSIONS.has(ext)) return "markdown";
- if (ext === "html" || ext === "htm") return "html";
- return "unsupported";
-}
-
-export function formatArtifactSize(size: number | undefined): string | null {
- if (size === undefined) return null;
- if (size < 1_000) return `${size} B`;
- if (size < 1_000_000) return `${Math.round(size / 1_000)} KB`;
- return `${(size / 1_000_000).toFixed(1)} MB`;
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/utils/cloudTaskRunConfig.test.ts b/products/desktop/apps/mobile/src/features/tasks/utils/cloudTaskRunConfig.test.ts
deleted file mode 100644
index d313be721864..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/utils/cloudTaskRunConfig.test.ts
+++ /dev/null
@@ -1,77 +0,0 @@
-import { describe, expect, it } from "vitest";
-import { buildCloudTaskRunConfig } from "./cloudTaskRunConfig";
-
-describe("buildCloudTaskRunConfig", () => {
- it("forwards the selected Codex configuration to cloud task dispatch", () => {
- expect(
- buildCloudTaskRunConfig({
- adapter: "codex",
- mode: "full-access",
- model: "gpt-5.5",
- reasoning: "high",
- }),
- ).toEqual({
- adapter: "codex",
- initialPermissionMode: "full-access",
- model: "gpt-5.5",
- reasoningLevel: "high",
- });
- });
-
- it("omits reasoning when the selected model does not support it", () => {
- expect(
- buildCloudTaskRunConfig({
- adapter: "claude",
- mode: "plan",
- model: "claude-haiku-4-5",
- reasoning: "high",
- }).reasoningLevel,
- ).toBeUndefined();
- });
-
- it("sends context window and fast mode for a supporting model", () => {
- expect(
- buildCloudTaskRunConfig({
- adapter: "claude",
- mode: "plan",
- model: "claude-opus-4-8",
- reasoning: "high",
- contextWindow: "200k",
- fastMode: true,
- }),
- ).toEqual({
- adapter: "claude",
- model: "claude-opus-4-8",
- reasoningLevel: "high",
- initialPermissionMode: "plan",
- contextWindow: "200k",
- fastMode: true,
- });
- });
-
- it("omits fast mode for a model that supports 1M context but not fast mode", () => {
- const config = buildCloudTaskRunConfig({
- adapter: "claude",
- mode: "plan",
- model: "claude-sonnet-5",
- reasoning: "high",
- contextWindow: "1m",
- fastMode: true,
- });
- expect(config).toMatchObject({ contextWindow: "1m" });
- expect(config).not.toHaveProperty("fastMode");
- });
-
- it("omits context window for a model without the 1M beta", () => {
- const config = buildCloudTaskRunConfig({
- adapter: "claude",
- mode: "plan",
- model: "claude-haiku-4-5",
- reasoning: "high",
- contextWindow: "1m",
- fastMode: true,
- });
- expect(config).not.toHaveProperty("contextWindow");
- expect(config).not.toHaveProperty("fastMode");
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/tasks/utils/cloudTaskRunConfig.ts b/products/desktop/apps/mobile/src/features/tasks/utils/cloudTaskRunConfig.ts
deleted file mode 100644
index 0a12b1d3e3c5..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/utils/cloudTaskRunConfig.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-import {
- type Adapter,
- type ExecutionMode,
- getReasoningEffortOptions,
- type SupportedReasoningEffort,
- supports1MContext,
- supportsFastMode,
-} from "@posthog/shared";
-import type { ContextWindow } from "@/features/tasks/composer/options";
-
-export function buildCloudTaskRunConfig({
- adapter,
- mode,
- model,
- reasoning,
- contextWindow,
- fastMode,
-}: {
- adapter: Adapter;
- mode: ExecutionMode;
- model: string;
- reasoning: SupportedReasoningEffort;
- contextWindow?: ContextWindow;
- fastMode?: boolean;
-}) {
- return {
- adapter,
- model,
- reasoningLevel:
- getReasoningEffortOptions(adapter, model) === null
- ? undefined
- : reasoning,
- initialPermissionMode: mode,
- ...(contextWindow && supports1MContext(model) ? { contextWindow } : {}),
- ...(supportsFastMode(model) ? { fastMode: !!fastMode } : {}),
- };
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/utils/inlineArtifacts.test.ts b/products/desktop/apps/mobile/src/features/tasks/utils/inlineArtifacts.test.ts
deleted file mode 100644
index 3f9305882a94..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/utils/inlineArtifacts.test.ts
+++ /dev/null
@@ -1,96 +0,0 @@
-import { describe, expect, it } from "vitest";
-import { detectInlineArtifact, type InlineArtifact } from "./inlineArtifacts";
-
-const PR_URL = "https://github.com/PostHog/posthog/pull/82584";
-
-function mcpMeta(tool: string) {
- return { claudeCode: { toolName: `mcp__github__${tool}` } };
-}
-
-describe("detectInlineArtifact", () => {
- it("detects an upload_artifact call regardless of status", () => {
- expect(
- detectInlineArtifact({
- meta: {
- claudeCode: { toolName: "mcp__posthog-code-tools__upload_artifact" },
- },
- status: "running",
- args: { name: "report.csv" },
- }),
- ).toEqual({ kind: "upload" });
- });
-
- it.each<{
- name: string;
- toolData: Parameters<typeof detectInlineArtifact>[0];
- expected: InlineArtifact | null;
- }>([
- {
- name: "gh pr create",
- toolData: {
- meta: { claudeCode: { toolName: "Bash" } },
- status: "completed",
- args: { command: "gh pr create --fill" },
- result: `Creating pull request\n${PR_URL}`,
- },
- expected: { kind: "pr", url: PR_URL },
- },
- {
- name: "an MCP create_pull_request tool",
- toolData: {
- meta: mcpMeta("create_pull_request"),
- status: "completed",
- args: { title: "Fix" },
- result: { html_url: PR_URL },
- },
- expected: { kind: "pr", url: PR_URL },
- },
- {
- // create_pull_request_review contains the creation tool's whole name and
- // returns the url of the PR it reviewed — not this run's deliverable.
- name: "reviewing someone else's PR over MCP",
- toolData: {
- meta: mcpMeta("create_pull_request_review"),
- status: "completed",
- args: { pullNumber: 82584, event: "COMMENT" },
- result: { html_url: PR_URL },
- },
- expected: null,
- },
- {
- // The url sits inside a gh pr comment body, not in a command position.
- name: "a comment that only mentions creating one",
- toolData: {
- meta: { claudeCode: { toolName: "Bash" } },
- status: "completed",
- args: {
- command: `gh pr comment 82584 --body "next time run gh pr create"`,
- },
- result: PR_URL,
- },
- expected: null,
- },
- {
- name: "reading someone else's PR",
- toolData: {
- meta: { claudeCode: { toolName: "Bash" } },
- status: "completed",
- args: { command: "gh pr view 82584 --json url" },
- result: PR_URL,
- },
- expected: null,
- },
- {
- name: "a creation still running",
- toolData: {
- meta: { claudeCode: { toolName: "Bash" } },
- status: "running",
- args: { command: "gh pr create --fill" },
- result: "",
- },
- expected: null,
- },
- ])("resolves $name", ({ toolData, expected }) => {
- expect(detectInlineArtifact(toolData)).toEqual(expected);
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/tasks/utils/inlineArtifacts.ts b/products/desktop/apps/mobile/src/features/tasks/utils/inlineArtifacts.ts
deleted file mode 100644
index 3290af24b62c..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/utils/inlineArtifacts.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import {
- detectInlineArtifact as detectFromCall,
- type InlineArtifact,
-} from "@posthog/core/sessions/inlineArtifacts";
-
-export type { InlineArtifact };
-
-export function toolResultText(result: unknown): string {
- if (typeof result === "string") return result;
- try {
- return JSON.stringify(result) ?? "";
- } catch {
- return "";
- }
-}
-
-export function detectInlineArtifact(toolData: {
- meta?: unknown;
- status: string;
- args?: Record<string, unknown>;
- result?: unknown;
-}): InlineArtifact | null {
- return detectFromCall({
- status: toolData.status,
- meta: toolData.meta,
- rawInput: toolData.args,
- getOutputText: () => toolResultText(toolData.result),
- });
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/utils/parsePatch.ts b/products/desktop/apps/mobile/src/features/tasks/utils/parsePatch.ts
deleted file mode 100644
index 071ddf51bc1b..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/utils/parsePatch.ts
+++ /dev/null
@@ -1,46 +0,0 @@
-export type DiffLineType = "context" | "add" | "delete" | "no-newline";
-
-export interface DiffLine {
- type: DiffLineType;
- content: string;
- // Stable position-based key (the line's index in the original patch
- // string). Used as a React key so we don't trip the no-array-index-key
- // rule when iterating in the renderer.
- key: string;
-}
-
-export interface Hunk {
- header: string;
- lines: DiffLine[];
-}
-
-// GitHub's `patch` field contains only hunk content (no `diff --git` / `---`
-// / `+++` headers). Each hunk starts with `@@ -A,B +C,D @@` followed by lines
-// prefixed by ' ' (context), '+' (addition), '-' (deletion), or '\' (no
-// newline marker). We don't need line numbers on mobile — the prefix and
-// background colour already convey direction.
-export function parsePatch(patch: string): Hunk[] {
- const hunks: Hunk[] = [];
- const raw = patch.split("\n");
- let current: Hunk | null = null;
-
- for (let i = 0; i < raw.length; i++) {
- const line = raw[i];
- if (line.startsWith("@@")) {
- if (current) hunks.push(current);
- current = { header: line, lines: [] };
- continue;
- }
- if (!current) continue;
-
- let type: DiffLineType;
- if (line.startsWith("+")) type = "add";
- else if (line.startsWith("-")) type = "delete";
- else if (line.startsWith("\\")) type = "no-newline";
- else type = "context";
-
- current.lines.push({ type, content: line.slice(1), key: String(i) });
- }
- if (current) hunks.push(current);
- return hunks;
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/utils/playbackRate.test.ts b/products/desktop/apps/mobile/src/features/tasks/utils/playbackRate.test.ts
deleted file mode 100644
index 8390f395e2e0..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/utils/playbackRate.test.ts
+++ /dev/null
@@ -1,39 +0,0 @@
-import { describe, expect, it } from "vitest";
-
-import { playbackRateForTaskDuration } from "./playbackRate";
-
-describe("playbackRateForTaskDuration", () => {
- it.each([
- ["below the fast floor (10s)", 10 * 1000, 3],
- ["at the fast floor (30s)", 30 * 1000, 3],
- ["geometric mid of the fast ramp (60s)", 60 * 1000, Math.sqrt(3)],
- ["normal band start (2min)", 2 * 60 * 1000, 1],
- ["normal band end (4min)", 4 * 60 * 1000, 1],
- [
- "geometric mid of the slow ramp",
- Math.sqrt(4 * 60 * 1000 * (30 * 60 * 1000)),
- Math.sqrt(1 / 3),
- ],
- ["at the slow ceiling (30min)", 30 * 60 * 1000, 1 / 3],
- ["beyond the slow ceiling (2h)", 2 * 60 * 60 * 1000, 1 / 3],
- ["NaN (non-finite) → fast rate", Number.NaN, 3],
- ])("%s → %f", (_label, durationMs, expected) => {
- expect(playbackRateForTaskDuration(durationMs)).toBeCloseTo(expected, 5);
- });
-
- it("decreases monotonically as duration grows", () => {
- const durations = [
- 10 * 1000,
- 45 * 1000,
- 90 * 1000,
- 2 * 60 * 1000,
- 4 * 60 * 1000,
- 10 * 60 * 1000,
- 30 * 60 * 1000,
- ];
- const rates = durations.map(playbackRateForTaskDuration);
- for (let i = 1; i < rates.length; i++) {
- expect(rates[i]).toBeLessThanOrEqual(rates[i - 1]);
- }
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/tasks/utils/playbackRate.ts b/products/desktop/apps/mobile/src/features/tasks/utils/playbackRate.ts
deleted file mode 100644
index d6517d4405fb..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/utils/playbackRate.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-const MIN_RATE = 1 / 3;
-const MAX_RATE = 3;
-const FAST_MS = 30 * 1000;
-const NORMAL_START_MS = 2 * 60 * 1000;
-const NORMAL_END_MS = 4 * 60 * 1000;
-const SLOW_MS = 30 * 60 * 1000;
-
-// Maps a task's duration to an audio playback rate so a quick task rings fast
-// (and high-pitched) while a long one drags slow (and low). Anchored at: <=30s
-// -> 3x, the 2-4min "normal" band -> 1x, >=30min -> 1/3x, with smooth
-// log-interpolation across the two ramps so the rate doesn't jump at the edges.
-export function playbackRateForTaskDuration(durationMs: number): number {
- if (!Number.isFinite(durationMs) || durationMs <= FAST_MS) return MAX_RATE;
- if (durationMs >= SLOW_MS) return MIN_RATE;
- if (durationMs >= NORMAL_START_MS && durationMs <= NORMAL_END_MS) return 1;
-
- if (durationMs < NORMAL_START_MS) {
- const frac =
- (Math.log(durationMs) - Math.log(FAST_MS)) /
- (Math.log(NORMAL_START_MS) - Math.log(FAST_MS));
- return MAX_RATE ** (1 - frac);
- }
-
- const frac =
- (Math.log(durationMs) - Math.log(NORMAL_END_MS)) /
- (Math.log(SLOW_MS) - Math.log(NORMAL_END_MS));
- return MIN_RATE ** frac;
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/utils/promptAttachments.test.ts b/products/desktop/apps/mobile/src/features/tasks/utils/promptAttachments.test.ts
deleted file mode 100644
index c56aeb3528de..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/utils/promptAttachments.test.ts
+++ /dev/null
@@ -1,210 +0,0 @@
-import { describe, expect, it } from "vitest";
-import type { SessionEvent } from "../types";
-import {
- extractSessionPromptAttachments,
- parseCloudArtifactRef,
- reinjectPromptAttachments,
-} from "./promptAttachments";
-
-const CLOUD_IMAGE_URI =
- "file:///tmp/workspace/.posthog/attachments/run-123/artifact-456/screenshot.png";
-const CLOUD_DOC_URI =
- "file:///tmp/workspace/.posthog/attachments/run-123/artifact-789/notes.pdf";
-
-function promptEvent(prompt: unknown[]): SessionEvent {
- return {
- type: "acp_message",
- direction: "client",
- ts: 1,
- message: { id: 1, method: "session/prompt", params: { prompt } },
- };
-}
-
-function userChunk(text: string): SessionEvent {
- return {
- type: "session_update",
- ts: 2,
- notification: {
- update: {
- sessionUpdate: "user_message_chunk",
- content: { type: "text", text },
- },
- },
- };
-}
-
-describe("parseCloudArtifactRef", () => {
- it.each([
- {
- name: "resolves runId and artifactId",
- pathname:
- "/tmp/workspace/.posthog/attachments/run-123/artifact-456/x.png",
- expected: { runId: "run-123", artifactId: "artifact-456" },
- },
- {
- name: "ordinary file path is not a cloud artifact",
- pathname: "/tmp/screenshot.png",
- expected: undefined,
- },
- {
- name: "missing artifactId segment",
- pathname: "/tmp/.posthog/attachments/run-123",
- expected: undefined,
- },
- {
- name: "attachments dir without .posthog parent",
- pathname: "/tmp/attachments/run-123/artifact-456/x.png",
- expected: undefined,
- },
- ])("$name", ({ pathname, expected }) => {
- expect(parseCloudArtifactRef(pathname)).toEqual(expected);
- });
-});
-
-describe("extractSessionPromptAttachments", () => {
- it("extracts a cloud image attachment from a resource_link block", () => {
- const result = extractSessionPromptAttachments({
- method: "session/prompt",
- params: {
- prompt: [
- { type: "text", text: "what is this?" },
- {
- type: "resource_link",
- uri: CLOUD_IMAGE_URI,
- name: "screenshot.png",
- },
- ],
- },
- });
-
- expect(result).toEqual({
- text: "what is this?",
- attachments: [
- {
- kind: "image",
- uri: CLOUD_IMAGE_URI,
- fileName: "screenshot.png",
- cloudArtifact: { runId: "run-123", artifactId: "artifact-456" },
- },
- ],
- });
- });
-
- it("marks non-image cloud attachments as documents", () => {
- const result = extractSessionPromptAttachments({
- method: "session/prompt",
- params: { prompt: [{ type: "resource_link", uri: CLOUD_DOC_URI }] },
- });
-
- expect(result?.attachments[0]).toMatchObject({
- kind: "document",
- fileName: "notes.pdf",
- });
- });
-
- it("ignores hidden text blocks when reconstructing prompt text", () => {
- const result = extractSessionPromptAttachments({
- method: "session/prompt",
- params: {
- prompt: [
- { type: "text", text: "visible" },
- { type: "text", text: "hidden", _meta: { ui: { hidden: true } } },
- {
- type: "resource_link",
- uri: CLOUD_IMAGE_URI,
- name: "screenshot.png",
- },
- ],
- },
- });
-
- expect(result?.text).toBe("visible");
- });
-
- it.each([
- { name: "non-prompt method", message: { method: "session/update" } },
- {
- name: "prompt without attachments",
- message: {
- method: "session/prompt",
- params: { prompt: [{ type: "text", text: "hi" }] },
- },
- },
- {
- name: "ordinary file uri without cloud artifact path",
- message: {
- method: "session/prompt",
- params: { prompt: [{ type: "image", uri: "file:///tmp/local.png" }] },
- },
- },
- ])("returns null for $name", ({ message }) => {
- expect(extractSessionPromptAttachments(message)).toBeNull();
- });
-});
-
-describe("reinjectPromptAttachments", () => {
- it("reattaches attachments to the matching user_message_chunk", () => {
- const events: SessionEvent[] = [
- promptEvent([
- { type: "text", text: "what is this?" },
- { type: "resource_link", uri: CLOUD_IMAGE_URI, name: "screenshot.png" },
- ]),
- userChunk("what is this?"),
- ];
-
- reinjectPromptAttachments(events);
-
- const chunk = events[1];
- expect(
- chunk.type === "session_update" && chunk.notification.update?.attachments,
- ).toEqual([
- {
- kind: "image",
- uri: CLOUD_IMAGE_URI,
- fileName: "screenshot.png",
- cloudArtifact: { runId: "run-123", artifactId: "artifact-456" },
- },
- ]);
- });
-
- it("leaves ordinary user messages without attachments as-is", () => {
- const events: SessionEvent[] = [userChunk("no attachments here")];
-
- reinjectPromptAttachments(events);
-
- const chunk = events[0];
- expect(
- chunk.type === "session_update" && chunk.notification.update?.attachments,
- ).toBeUndefined();
- });
-
- it("matches identical prompt texts in FIFO order", () => {
- const secondUri =
- "file:///tmp/workspace/.posthog/attachments/run-123/artifact-999/second.png";
- const events: SessionEvent[] = [
- promptEvent([
- { type: "text", text: "same" },
- { type: "resource_link", uri: CLOUD_IMAGE_URI, name: "first.png" },
- ]),
- promptEvent([
- { type: "text", text: "same" },
- { type: "resource_link", uri: secondUri, name: "second.png" },
- ]),
- userChunk("same"),
- userChunk("same"),
- ];
-
- reinjectPromptAttachments(events);
-
- const first = events[2];
- const second = events[3];
- expect(
- first.type === "session_update" &&
- first.notification.update?.attachments?.[0]?.fileName,
- ).toBe("first.png");
- expect(
- second.type === "session_update" &&
- second.notification.update?.attachments?.[0]?.fileName,
- ).toBe("second.png");
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/tasks/utils/promptAttachments.ts b/products/desktop/apps/mobile/src/features/tasks/utils/promptAttachments.ts
deleted file mode 100644
index 77f9d5be04fb..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/utils/promptAttachments.ts
+++ /dev/null
@@ -1,137 +0,0 @@
-// Mirrors the artifact-ref parsing in @posthog/core/sessions/promptContent;
-// mobile does not depend on @posthog/core, so the two are kept in sync by hand.
-import { getFileName, isRasterImageFile } from "@posthog/shared";
-import type {
- CloudArtifactRef,
- SessionEvent,
- SessionNotificationAttachment,
-} from "../types";
-
-interface PromptContentBlock {
- type?: string;
- text?: string;
- uri?: string;
- name?: string;
- resource?: { uri?: string };
- _meta?: { ui?: { hidden?: boolean } };
-}
-
-interface PromptMessage {
- method?: string;
- params?: { prompt?: PromptContentBlock[] };
-}
-
-export interface PromptAttachmentGroup {
- text: string;
- attachments: SessionNotificationAttachment[];
-}
-
-// Cloud attachment bytes are uploaded as run artifacts and referenced from the
-// stored prompt as `file://…/.posthog/attachments/<runId>/<artifactId>/<file>`.
-export function parseCloudArtifactRef(
- pathname: string,
-): CloudArtifactRef | undefined {
- const segments = pathname.split("/").filter(Boolean);
- const posthogIndex = segments.lastIndexOf(".posthog");
- if (
- posthogIndex < 0 ||
- segments[posthogIndex + 1] !== "attachments" ||
- !segments[posthogIndex + 2] ||
- !segments[posthogIndex + 3]
- ) {
- return undefined;
- }
- return {
- runId: segments[posthogIndex + 2],
- artifactId: segments[posthogIndex + 3],
- };
-}
-
-function blockUri(
- block: PromptContentBlock,
-): { uri: string; name?: string } | null {
- switch (block.type) {
- case "resource":
- return block.resource?.uri ? { uri: block.resource.uri } : null;
- case "image":
- return block.uri ? { uri: block.uri } : null;
- case "resource_link":
- return block.uri ? { uri: block.uri, name: block.name } : null;
- default:
- return null;
- }
-}
-
-function attachmentFromBlock(
- block: PromptContentBlock,
-): SessionNotificationAttachment | null {
- const ref = blockUri(block);
- if (!ref || !ref.uri.startsWith("file://")) return null;
-
- let pathname: string;
- try {
- pathname = decodeURIComponent(new URL(ref.uri).pathname);
- } catch {
- return null;
- }
-
- const cloudArtifact = parseCloudArtifactRef(pathname);
- if (!cloudArtifact) return null;
-
- const fileName = ref.name?.trim() || getFileName(pathname) || "attachment";
- return {
- kind: isRasterImageFile(fileName) ? "image" : "document",
- uri: ref.uri,
- fileName,
- cloudArtifact,
- };
-}
-
-export function extractSessionPromptAttachments(
- message: unknown,
-): PromptAttachmentGroup | null {
- const msg = message as PromptMessage | undefined;
- if (msg?.method !== "session/prompt") return null;
- const prompt = msg.params?.prompt;
- if (!Array.isArray(prompt)) return null;
-
- const textParts: string[] = [];
- const attachments: SessionNotificationAttachment[] = [];
- for (const block of prompt) {
- if (block.type === "text") {
- if (block._meta?.ui?.hidden) continue;
- if (typeof block.text === "string") textParts.push(block.text);
- continue;
- }
- const attachment = attachmentFromBlock(block);
- if (attachment) attachments.push(attachment);
- }
-
- if (attachments.length === 0) return null;
- return { text: textParts.join(""), attachments };
-}
-
-/**
- * S3-backed snapshots replay user turns as text-only `user_message_chunk`
- * events, dropping the attachment metadata. The `session/prompt` requests in the
- * same log still carry the cloud artifact references, so reattach them by
- * matching prompt text (FIFO on ties) to keep historical images renderable.
- */
-export function reinjectPromptAttachments(events: SessionEvent[]): void {
- const pending: PromptAttachmentGroup[] = [];
- for (const event of events) {
- if (event.type === "acp_message") {
- const group = extractSessionPromptAttachments(event.message);
- if (group) pending.push(group);
- continue;
- }
- const update = event.notification?.update;
- if (update?.sessionUpdate !== "user_message_chunk") continue;
- if (update.attachments && update.attachments.length > 0) continue;
- const text = update.content?.text ?? "";
- const idx = pending.findIndex((group) => group.text === text);
- if (idx < 0) continue;
- update.attachments = pending[idx].attachments;
- pending.splice(idx, 1);
- }
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/utils/repositorySelection.test.ts b/products/desktop/apps/mobile/src/features/tasks/utils/repositorySelection.test.ts
deleted file mode 100644
index b7177617e327..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/utils/repositorySelection.test.ts
+++ /dev/null
@@ -1,124 +0,0 @@
-import { describe, expect, it } from "vitest";
-import {
- buildRepositoryOptions,
- buildUserRepositoryOptions,
- findRepositoryOption,
- isRepositorySelectionComplete,
- repositoryLoadWarning,
- repositoryOptionsEqual,
- toRepositorySelection,
-} from "./repositorySelection";
-
-describe("repositorySelection", () => {
- const integrations = [
- { id: 7, kind: "github", display_name: "Personal GitHub" },
- {
- id: 11,
- kind: "github",
- config: { account: { login: "posthog" } },
- },
- ];
-
- it("preserves integration identity for each repository option", () => {
- expect(
- buildRepositoryOptions(integrations, {
- 7: ["annika/mobile-app"],
- 11: ["posthog/posthog", "posthog/code"],
- }),
- ).toEqual([
- {
- integrationId: 7,
- integrationLabel: "Personal GitHub",
- repository: "annika/mobile-app",
- },
- {
- integrationId: 11,
- integrationLabel: "posthog",
- repository: "posthog/code",
- },
- {
- integrationId: 11,
- integrationLabel: "posthog",
- repository: "posthog/posthog",
- },
- ]);
- });
-
- it("finds an exact repository option", () => {
- const options = buildRepositoryOptions(integrations, {
- 7: ["posthog/posthog"],
- 11: ["posthog/posthog"],
- });
-
- expect(
- findRepositoryOption(options, {
- integrationId: 11,
- repository: "posthog/posthog",
- }),
- ).toEqual({
- integrationId: 11,
- integrationLabel: "posthog",
- repository: "posthog/posthog",
- });
- });
-
- it.each([
- [{ installation_id: "42", account: { name: "PostHog" } }, "PostHog"],
- [{ installation_id: "43" }, "GitHub 43"],
- ])(
- "builds user integration options with the expected label",
- (integration, integrationLabel) => {
- expect(
- buildUserRepositoryOptions([integration], {
- [integration.installation_id]: ["posthog/code"],
- }),
- ).toEqual([
- {
- integrationId: Number(integration.installation_id),
- integrationLabel,
- repository: "posthog/code",
- },
- ]);
- },
- );
-
- it("treats a changed label as a different repository option", () => {
- const option = {
- integrationId: 11,
- integrationLabel: "posthog",
- repository: "posthog/code",
- };
-
- expect(
- repositoryOptionsEqual(
- [option],
- [{ ...option, integrationLabel: "PostHog GitHub" }],
- ),
- ).toBe(false);
- });
-
- it.each([
- [0, 2, null],
- [1, 2, "Some GitHub repositories could not be loaded. Pull to retry."],
- [2, 2, "Could not load GitHub repositories. Pull to retry."],
- ])(
- "maps repository failures to the expected warning",
- (failedCount, totalCount, expected) => {
- expect(repositoryLoadWarning(failedCount, totalCount)).toBe(expected);
- },
- );
-
- it("converts an option into a repository selection", () => {
- const selection = toRepositorySelection({
- integrationId: 11,
- integrationLabel: "posthog",
- repository: "posthog/code",
- });
-
- expect(selection).toEqual({
- integrationId: 11,
- repository: "posthog/code",
- });
- expect(isRepositorySelectionComplete(selection)).toBe(true);
- });
-});
diff --git a/products/desktop/apps/mobile/src/features/tasks/utils/repositorySelection.ts b/products/desktop/apps/mobile/src/features/tasks/utils/repositorySelection.ts
deleted file mode 100644
index bff8441a6a38..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/utils/repositorySelection.ts
+++ /dev/null
@@ -1,104 +0,0 @@
-import type {
- Integration,
- RepositoryOption,
- RepositorySelection,
- UserGithubIntegration,
-} from "../types";
-
-function getIntegrationLabel(integration: Integration): string {
- return (
- integration.display_name ??
- integration.config?.account?.login ??
- `GitHub ${integration.id}`
- );
-}
-
-export function buildRepositoryOptions(
- integrations: Integration[],
- repositoriesByIntegration: Record<number, string[]>,
-): RepositoryOption[] {
- return integrations
- .flatMap((integration) =>
- (repositoriesByIntegration[integration.id] ?? []).map((repository) => ({
- integrationId: integration.id,
- integrationLabel: getIntegrationLabel(integration),
- repository,
- })),
- )
- .sort((left, right) => left.repository.localeCompare(right.repository));
-}
-
-export function buildUserRepositoryOptions(
- integrations: UserGithubIntegration[],
- repositoriesByInstallation: Record<string, string[]>,
-): RepositoryOption[] {
- return integrations
- .flatMap((integration) =>
- (repositoriesByInstallation[integration.installation_id] ?? []).map(
- (repository) => ({
- integrationId: Number(integration.installation_id),
- integrationLabel:
- integration.account?.name ??
- `GitHub ${integration.installation_id}`,
- repository,
- }),
- ),
- )
- .sort((left, right) => left.repository.localeCompare(right.repository));
-}
-
-export function repositoryOptionsEqual(
- left: RepositoryOption[],
- right: RepositoryOption[],
-): boolean {
- return (
- left.length === right.length &&
- left.every((option, index) => {
- const other = right[index];
- return (
- other?.integrationId === option.integrationId &&
- other.integrationLabel === option.integrationLabel &&
- other.repository === option.repository
- );
- })
- );
-}
-
-export function repositoryLoadWarning(
- failedCount: number,
- totalCount: number,
-): string | null {
- if (failedCount === 0) return null;
- return failedCount === totalCount
- ? "Could not load GitHub repositories. Pull to retry."
- : "Some GitHub repositories could not be loaded. Pull to retry.";
-}
-
-export function findRepositoryOption(
- options: RepositoryOption[],
- selection: RepositorySelection,
-): RepositoryOption | null {
- if (!selection.integrationId || !selection.repository) return null;
- return (
- options.find(
- (option) =>
- option.integrationId === selection.integrationId &&
- option.repository === selection.repository,
- ) ?? null
- );
-}
-
-export function toRepositorySelection(
- option: RepositoryOption | null,
-): RepositorySelection {
- return {
- integrationId: option?.integrationId ?? null,
- repository: option?.repository ?? null,
- };
-}
-
-export function isRepositorySelectionComplete(
- selection: RepositorySelection,
-): boolean {
- return !!selection.integrationId && !!selection.repository;
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/utils/sounds.ts b/products/desktop/apps/mobile/src/features/tasks/utils/sounds.ts
deleted file mode 100644
index ebede7ffddf3..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/utils/sounds.ts
+++ /dev/null
@@ -1,63 +0,0 @@
-import { createAudioPlayer, setAudioModeAsync } from "expo-audio";
-import {
- type CompletionSound,
- usePreferencesStore,
-} from "@/features/preferences/stores/preferencesStore";
-
-// eslint-disable-next-line @typescript-eslint/no-require-imports
-const dropAsset = require("../../../../assets/sounds/drop.mp3");
-// eslint-disable-next-line @typescript-eslint/no-require-imports
-const icqAsset = require("../../../../assets/sounds/icq.mp3");
-// eslint-disable-next-line @typescript-eslint/no-require-imports
-const knockAsset = require("../../../../assets/sounds/knock.mp3");
-// eslint-disable-next-line @typescript-eslint/no-require-imports
-const meepAsset = require("../../../../assets/sounds/meep.mp3");
-// eslint-disable-next-line @typescript-eslint/no-require-imports
-const meepSmolAsset = require("../../../../assets/sounds/meep-smol.mp3");
-// eslint-disable-next-line @typescript-eslint/no-require-imports
-const ringAsset = require("../../../../assets/sounds/ring.mp3");
-// eslint-disable-next-line @typescript-eslint/no-require-imports
-const shootAsset = require("../../../../assets/sounds/shoot.mp3");
-// eslint-disable-next-line @typescript-eslint/no-require-imports
-const slideAsset = require("../../../../assets/sounds/slide.mp3");
-
-const SOUND_ASSETS: Record<CompletionSound, number> = {
- meep: meepAsset,
- "meep-smol": meepSmolAsset,
- knock: knockAsset,
- ring: ringAsset,
- shoot: shootAsset,
- slide: slideAsset,
- drop: dropAsset,
- icq: icqAsset,
-};
-
-let audioModeConfigured = false;
-
-async function ensureAudioMode(): Promise<void> {
- if (audioModeConfigured) return;
- await setAudioModeAsync({ playsInSilentMode: true });
- audioModeConfigured = true;
-}
-
-export async function playCompletionSound(
- sound?: CompletionSound,
- volume?: number,
- playbackRate = 1,
-): Promise<void> {
- const prefs = usePreferencesStore.getState();
- const which = sound ?? prefs.completionSound;
- const vol = (volume ?? prefs.completionVolume) / 100;
- await ensureAudioMode();
- const player = createAudioPlayer(SOUND_ASSETS[which]);
- player.volume = Math.max(0, Math.min(1, vol));
- player.shouldCorrectPitch = false;
- player.playbackRate = playbackRate;
- const subscription = player.addListener("playbackStatusUpdate", (status) => {
- if (status.didJustFinish) {
- subscription.remove();
- player.remove();
- }
- });
- player.play();
-}
diff --git a/products/desktop/apps/mobile/src/features/tasks/utils/userDisplayName.ts b/products/desktop/apps/mobile/src/features/tasks/utils/userDisplayName.ts
deleted file mode 100644
index 939a296cdb25..000000000000
--- a/products/desktop/apps/mobile/src/features/tasks/utils/userDisplayName.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-import type { UserBasic } from "@posthog/shared/domain-types";
-
-export function userDisplayName(user: UserBasic): string {
- const name = [user.first_name, user.last_name].filter(Boolean).join(" ");
- return name || user.email;
-}
diff --git a/products/desktop/apps/mobile/src/hooks/useDebouncedValue.ts b/products/desktop/apps/mobile/src/hooks/useDebouncedValue.ts
deleted file mode 100644
index a21281796493..000000000000
--- a/products/desktop/apps/mobile/src/hooks/useDebouncedValue.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import { useEffect, useState } from "react";
-
-export function useDebouncedValue<T>(value: T, delayMs: number): T {
- const [debounced, setDebounced] = useState(value);
-
- useEffect(() => {
- const id = setTimeout(() => setDebounced(value), delayMs);
- return () => clearTimeout(id);
- }, [value, delayMs]);
-
- return debounced;
-}
diff --git a/products/desktop/apps/mobile/src/hooks/useNetworkStatus.ts b/products/desktop/apps/mobile/src/hooks/useNetworkStatus.ts
deleted file mode 100644
index 87eaca61006d..000000000000
--- a/products/desktop/apps/mobile/src/hooks/useNetworkStatus.ts
+++ /dev/null
@@ -1,112 +0,0 @@
-import NetInfo from "@react-native-community/netinfo";
-import { useEffect, useRef, useState } from "react";
-import { AppState } from "react-native";
-
-const OFFLINE_RECOVERY_POLL_INTERVAL_MS = 5_000;
-
-type NetworkSnapshot = {
- isConnected: boolean | null;
- isInternetReachable?: boolean | null;
-};
-
-export function hasInternetConnection(state: NetworkSnapshot): boolean {
- if (state.isConnected === false) {
- return false;
- }
-
- if (state.isInternetReachable === false) {
- return false;
- }
-
- return true;
-}
-
-export function useNetworkStatus() {
- const [isConnected, setIsConnected] = useState(true);
- const isConnectedRef = useRef(isConnected);
-
- useEffect(() => {
- isConnectedRef.current = isConnected;
- }, [isConnected]);
-
- useEffect(() => {
- let isMounted = true;
- let recoveryPoller: ReturnType<typeof setInterval> | null = null;
-
- const stopRecoveryPoller = () => {
- if (!recoveryPoller) {
- return;
- }
-
- clearInterval(recoveryPoller);
- recoveryPoller = null;
- };
-
- const startRecoveryPoller = () => {
- if (recoveryPoller) {
- return;
- }
-
- recoveryPoller = setInterval(() => {
- if (isConnectedRef.current) {
- stopRecoveryPoller();
- return;
- }
-
- void refreshStatus();
- }, OFFLINE_RECOVERY_POLL_INTERVAL_MS);
- };
-
- const applyStatus = (state: NetworkSnapshot) => {
- if (!isMounted) {
- return;
- }
-
- const nextIsConnected = hasInternetConnection(state);
- isConnectedRef.current = nextIsConnected;
- setIsConnected(nextIsConnected);
-
- if (nextIsConnected) {
- stopRecoveryPoller();
- } else {
- startRecoveryPoller();
- }
- };
-
- const refreshStatus = async () => {
- try {
- const state = await NetInfo.fetch();
- applyStatus(state);
- } catch {
- applyStatus({
- isConnected: false,
- isInternetReachable: false,
- });
- }
- };
-
- const unsubscribe = NetInfo.addEventListener((state) => {
- applyStatus(state);
- });
-
- const appStateSubscription = AppState.addEventListener(
- "change",
- (nextState) => {
- if (nextState === "active") {
- void refreshStatus();
- }
- },
- );
-
- void refreshStatus();
-
- return () => {
- isMounted = false;
- unsubscribe();
- appStateSubscription.remove();
- stopRecoveryPoller();
- };
- }, []);
-
- return { isConnected };
-}
diff --git a/products/desktop/apps/mobile/src/hooks/useScreenInsets.test.ts b/products/desktop/apps/mobile/src/hooks/useScreenInsets.test.ts
deleted file mode 100644
index abccdc6cc13e..000000000000
--- a/products/desktop/apps/mobile/src/hooks/useScreenInsets.test.ts
+++ /dev/null
@@ -1,46 +0,0 @@
-import { describe, expect, it, vi } from "vitest";
-
-const mockInsets = { top: 47, bottom: 34, left: 0, right: 0 };
-
-vi.mock("react-native-safe-area-context", () => ({
- useSafeAreaInsets: () => mockInsets,
-}));
-
-// useMemo just needs to invoke its factory; we don't need a renderer to pin the
-// numeric scale, so stub it to call through.
-vi.mock("react", async () => {
- const actual = await vi.importActual<typeof import("react")>("react");
- return { ...actual, useMemo: (factory: () => unknown) => factory() };
-});
-
-import { BOTTOM_GAP, useScreenInsets } from "./useScreenInsets";
-
-describe("useScreenInsets", () => {
- it("pins the bottom gap scale onto the device inset", () => {
- const { bottom } = useScreenInsets();
- expect(bottom("compact")).toBe(mockInsets.bottom + 12);
- expect(bottom("default")).toBe(mockInsets.bottom + 24);
- expect(bottom("roomy")).toBe(mockInsets.bottom + 40);
- // default variant matches "default"
- expect(bottom()).toBe(bottom("default"));
- });
-
- it("keeps BOTTOM_GAP values frozen at 12 / 24 / 40", () => {
- expect(BOTTOM_GAP).toEqual({ compact: 12, default: 24, roomy: 40 });
- });
-
- it("computes the sheet top, fab, and composer offsets", () => {
- const { sheetContentTop, fabBottom, composerBottom } = useScreenInsets();
- expect(sheetContentTop()).toBe(mockInsets.top + 8);
- expect(fabBottom()).toBe(mockInsets.bottom + 20);
- // composer floor is above the inset here, so it tracks the inset
- expect(composerBottom()).toBe(Math.max(mockInsets.bottom, 50));
- });
-
- it("floors the composer bottom at COMPOSER_MIN_BOTTOM on zero-inset devices", () => {
- mockInsets.bottom = 0;
- const { composerBottom } = useScreenInsets();
- expect(composerBottom()).toBe(50);
- mockInsets.bottom = 34;
- });
-});
diff --git a/products/desktop/apps/mobile/src/hooks/useScreenInsets.ts b/products/desktop/apps/mobile/src/hooks/useScreenInsets.ts
deleted file mode 100644
index 70e218279429..000000000000
--- a/products/desktop/apps/mobile/src/hooks/useScreenInsets.ts
+++ /dev/null
@@ -1,74 +0,0 @@
-import { useMemo } from "react";
-import { useSafeAreaInsets } from "react-native-safe-area-context";
-
-/**
- * Single source of truth for screen spacing policy.
- *
- * The device safe-area insets (notch, home indicator, Android soft buttons)
- * come from `useSafeAreaInsets()` and vary per device — we never hardcode
- * those. What this hook centralizes is the *gap we add on top of the inset*,
- * which was previously hand-written per screen with a scatter of magic numbers
- * (12 / 16 / 20 / 24 / 32 / 40 / 50). Those are rationalized into one small
- * scale so spacing is consistent across surfaces and tunable in one place.
- */
-
-/**
- * Standard content gaps layered ON TOP of the bottom safe-area inset.
- * Pick by intent, not by pixel value.
- */
-export const BOTTOM_GAP = {
- /** Bottom sheets, sticky footers, tight composers. */
- compact: 12,
- /** Scrollable form / list content in modals and detail screens. */
- default: 24,
- /** Filter sheets and sections that want extra breathing room. */
- roomy: 40,
-} as const;
-
-/** Standard gap above the top safe-area inset for page-sheet content. */
-const TOP_GAP = 8;
-
-/** Bottom-right floating action buttons sit this far above the inset. */
-const FAB_GAP = 20;
-
-/**
- * The chat composer keeps at least this much bottom space when the keyboard
- * is closed, even on devices that report a zero bottom inset (e.g. older
- * Android with hardware buttons).
- */
-export const COMPOSER_MIN_BOTTOM = 50;
-
-export type BottomGapVariant = keyof typeof BOTTOM_GAP;
-
-export function useScreenInsets() {
- const insets = useSafeAreaInsets();
-
- return useMemo(() => {
- return {
- /** Raw device insets, for cases the helpers below don't cover. */
- insets,
- /** Bottom padding = device inset + the standard gap for this surface. */
- bottom: (variant: BottomGapVariant = "default") =>
- insets.bottom + BOTTOM_GAP[variant],
- /**
- * Top padding for bottom-sheet / filter-menu content (inset + the fixed
- * sheet top gap). Scoped to sheets on purpose — full screens that need a
- * measured header height should compute `insets.top + <headerHeight>`
- * directly rather than reaching for this.
- */
- sheetContentTop: () => insets.top + TOP_GAP,
- /**
- * Bottom offset for a floating action button. The `+FAB_GAP` is a
- * frozen domain-specific choice, not a `BOTTOM_GAP` variant — there is
- * no `fabBottom("roomy")`. Tune `FAB_GAP` if every FAB should move.
- */
- fabBottom: () => insets.bottom + FAB_GAP,
- /**
- * Chat composer bottom margin floor. The `COMPOSER_MIN_BOTTOM` floor is
- * a frozen domain-specific choice, not a `BOTTOM_GAP` variant — there is
- * no `composerBottom("compact")`.
- */
- composerBottom: () => Math.max(insets.bottom, COMPOSER_MIN_BOTTOM),
- };
- }, [insets]);
-}
diff --git a/products/desktop/apps/mobile/src/lib/analytics.test.ts b/products/desktop/apps/mobile/src/lib/analytics.test.ts
deleted file mode 100644
index 9658f08aeb7b..000000000000
--- a/products/desktop/apps/mobile/src/lib/analytics.test.ts
+++ /dev/null
@@ -1,150 +0,0 @@
-import { createElement } from "react";
-import { act, create, type ReactTestRenderer } from "react-test-renderer";
-import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
-import {
- ANALYTICS_EVENTS,
- computeReportAgeHours,
- INBOX_ANALYTICS_EVENT_NAMES,
- useActiveTaskAnalyticsContext,
- useAnalytics,
-} from "./analytics";
-
-const mockPosthog = {
- register: vi.fn(),
- unregister: vi.fn(),
- capture: vi.fn(),
-};
-
-vi.mock("posthog-react-native", () => ({
- usePostHog: () => mockPosthog,
-}));
-
-describe("computeReportAgeHours", () => {
- beforeEach(() => {
- vi.useFakeTimers();
- vi.setSystemTime(new Date("2026-01-01T12:00:00Z"));
- });
- afterEach(() => {
- vi.useRealTimers();
- });
-
- it("returns 0 for null/undefined input", () => {
- expect(computeReportAgeHours(null)).toBe(0);
- expect(computeReportAgeHours(undefined)).toBe(0);
- });
-
- it("rounds to one decimal", () => {
- // 1h 35m before "now" → 1.6h
- expect(computeReportAgeHours("2026-01-01T10:25:00Z")).toBe(1.6);
- });
-
- it("clamps at 0 when clock skew puts createdAt in the future", () => {
- expect(computeReportAgeHours("2026-01-02T00:00:00Z")).toBe(0);
- });
-});
-
-function renderActiveTaskHook(initial: string | null) {
- let currentId: string | null = initial;
- function Wrapper() {
- useActiveTaskAnalyticsContext(currentId);
- return null;
- }
- let renderer: ReactTestRenderer | null = null;
- act(() => {
- renderer = create(createElement(Wrapper));
- });
- return {
- rerender: (id: string | null) => {
- currentId = id;
- act(() => {
- renderer?.update(createElement(Wrapper));
- });
- },
- unmount: () => {
- act(() => {
- renderer?.unmount();
- });
- },
- };
-}
-
-describe("useActiveTaskAnalyticsContext", () => {
- beforeEach(() => {
- mockPosthog.register.mockClear();
- mockPosthog.unregister.mockClear();
- });
-
- it("registers and unregisters signal_report_id as the prop changes", () => {
- const hook = renderActiveTaskHook("report-1");
- expect(mockPosthog.register).toHaveBeenCalledWith({
- signal_report_id: "report-1",
- });
-
- hook.rerender("report-2");
- expect(mockPosthog.unregister).toHaveBeenCalledWith("signal_report_id");
- expect(mockPosthog.register).toHaveBeenLastCalledWith({
- signal_report_id: "report-2",
- });
-
- hook.unmount();
- expect(mockPosthog.unregister).toHaveBeenLastCalledWith("signal_report_id");
- });
-
- it("never registers when the id is null", () => {
- const hook = renderActiveTaskHook(null);
- expect(mockPosthog.register).not.toHaveBeenCalled();
- expect(mockPosthog.unregister).not.toHaveBeenCalled();
- hook.unmount();
- });
-});
-
-function renderTrack() {
- let track!: ReturnType<typeof useAnalytics>["track"];
- function Wrapper() {
- track = useAnalytics().track;
- return null;
- }
- act(() => {
- create(createElement(Wrapper));
- });
- return track;
-}
-
-describe("useAnalytics track", () => {
- beforeEach(() => {
- mockPosthog.capture.mockClear();
- });
-
- it.each([...INBOX_ANALYTICS_EVENT_NAMES])(
- "stamps inbox_client=mobile on %s",
- (eventName) => {
- const track = renderTrack();
- track(eventName as never, { foo: "bar" } as never);
- expect(mockPosthog.capture).toHaveBeenCalledWith(
- eventName,
- expect.objectContaining({ inbox_client: "mobile", foo: "bar" }),
- );
- },
- );
-
- it("does not stamp inbox_client on non-inbox events", () => {
- const track = renderTrack();
- track(ANALYTICS_EVENTS.PROMPT_SENT as never, { foo: "bar" } as never);
- const [, properties] = mockPosthog.capture.mock.calls[0];
- expect(properties).not.toHaveProperty("inbox_client");
- });
-
- it("lets a caller-provided inbox_client win over the default", () => {
- const track = renderTrack();
- track(
- ANALYTICS_EVENTS.INBOX_VIEWED as never,
- {
- inbox_client: "cloud",
- } as never,
- );
- expect(mockPosthog.capture).toHaveBeenCalledWith(
- ANALYTICS_EVENTS.INBOX_VIEWED,
- expect.objectContaining({ inbox_client: "cloud" }),
- );
- });
-});
diff --git a/products/desktop/apps/mobile/src/lib/analytics.ts b/products/desktop/apps/mobile/src/lib/analytics.ts
deleted file mode 100644
index d2fe8f5ae55e..000000000000
--- a/products/desktop/apps/mobile/src/lib/analytics.ts
+++ /dev/null
@@ -1,320 +0,0 @@
-import type {
- AgentTurnFeedbackProperties,
- InboxTriageEndedProperties,
- InboxTriageStartedProperties,
-} from "@posthog/shared";
-import { ANALYTICS_EVENTS as SHARED_ANALYTICS_EVENTS } from "@posthog/shared";
-import { type PostHog, usePostHog } from "posthog-react-native";
-import { useEffect, useMemo } from "react";
-
-/**
- * Event names mirror packages/shared/src/analytics-events.ts so PostHog reports
- * funnel the same events from desktop and mobile into a single bucket.
- */
-export const ANALYTICS_EVENTS = {
- INBOX_VIEWED: "Inbox viewed",
- INBOX_REPORT_OPENED: "Inbox report opened",
- INBOX_REPORT_CLOSED: "Inbox report closed",
- INBOX_REPORT_SCROLLED: "Inbox report scrolled",
- INBOX_REPORT_ACTION: "Inbox report action",
- INBOX_REPORT_FEEDBACK: "Inbox report feedback",
- INBOX_REPORT_FEEDBACK_NOTE: "Inbox report feedback note",
- INBOX_TRIAGE_STARTED: SHARED_ANALYTICS_EVENTS.INBOX_TRIAGE_STARTED,
- INBOX_TRIAGE_ENDED: SHARED_ANALYTICS_EVENTS.INBOX_TRIAGE_ENDED,
- SIGN_IN_STARTED: "Sign in started",
- SIGN_IN_COMPLETED: "Sign in completed",
- SIGN_IN_FAILED: "Sign in failed",
- PROMPT_SENT: "Prompt sent",
- TASK_RUN_STOPPED: "Task run stopped",
- AGENT_TURN_FEEDBACK: SHARED_ANALYTICS_EVENTS.AGENT_TURN_FEEDBACK,
-} as const;
-
-export type SignInMethod = "oauth" | "dev_api_key" | "qr_scan";
-
-export type SignInFailureReason = "cancelled" | "timeout" | "error";
-
-export interface SignInStartedProperties {
- method: SignInMethod;
- region: string;
-}
-
-export interface SignInCompletedProperties {
- method: SignInMethod;
- region: string;
-}
-
-export interface SignInFailedProperties {
- method: SignInMethod;
- region: string;
- reason: SignInFailureReason;
- error_message: string;
-}
-
-export type InboxReportOpenMethod =
- | "click"
- | "click_cmd"
- | "click_shift"
- | "keyboard"
- | "deeplink"
- | "unknown";
-
-export type InboxReportCloseMethod =
- | "next_report"
- | "deselected"
- | "navigated_away"
- | "unmount";
-
-export type InboxReportActionType =
- | "dismiss"
- | "snooze"
- | "delete"
- | "reingest"
- | "create_pr"
- | "open_pr"
- | "copy_link"
- | "discuss"
- | "expand_signal"
- | "collapse_signal"
- | "expand_signal_section"
- | "view_signal_external"
- | "expand_why"
- | "click_suggested_reviewer"
- | "add_suggested_reviewer"
- | "remove_suggested_reviewer"
- | "expand_task_section"
- | "play_session_recording";
-
-export type InboxReportActionSurface =
- | "detail_pane"
- | "detail_footer"
- | "toolbar"
- | "keyboard"
- | "list_row"
- | "triage";
-
-/** Sentiment captured by the report usefulness thumbs. */
-export type InboxReportFeedbackSentiment = "positive" | "negative";
-
-export interface InboxViewedProperties {
- report_count: number;
- total_count: number;
- ready_count: number;
- has_active_filters: boolean;
- source_product_filter: string[];
- status_filter_count: number;
- is_empty: boolean;
- priority_p0_count: number;
- priority_p1_count: number;
- priority_p2_count: number;
- priority_p3_count: number;
- priority_p4_count: number;
- priority_unknown_count: number;
- actionability_immediately_actionable_count: number;
- actionability_requires_human_input_count: number;
- actionability_not_actionable_count: number;
- actionability_unknown_count: number;
-}
-
-export interface InboxReportOpenedProperties {
- report_id: string;
- report_title: string | null;
- report_age_hours: number;
- status: string | null;
- priority: string | null;
- actionability: string | null;
- source_products: string[];
- rank: number;
- list_size: number;
- open_method: InboxReportOpenMethod;
- previous_report_id: string | null;
-}
-
-export interface InboxReportClosedProperties {
- report_id: string;
- report_title: string | null;
- report_age_hours: number;
- priority: string | null;
- actionability: string | null;
- time_spent_ms: number;
- scrolled: boolean;
- close_method: InboxReportCloseMethod;
-}
-
-export interface InboxReportScrolledProperties {
- report_id: string;
- report_title: string | null;
- report_age_hours: number;
- priority: string | null;
- actionability: string | null;
- rank: number;
- list_size: number;
- time_since_open_ms: number;
-}
-
-export interface InboxReportActionProperties {
- report_id: string;
- report_title: string | null;
- report_age_hours: number;
- priority: string | null;
- actionability: string | null;
- action_type: InboxReportActionType;
- surface: InboxReportActionSurface;
- is_bulk: boolean;
- bulk_size: number;
- rank: number;
- list_size: number;
- dismissal_reason?: string;
- dismissal_note?: string;
- signal_id?: string;
- signal_source_product?: string;
- signal_source_type?: string;
- signal_section?: "relevant_code" | "data_queried";
- why_field?: "priority" | "actionability";
- task_section?: "research" | "implementation";
- has_question?: boolean;
- question_text?: string;
- has_feedback?: boolean;
- feedback_text?: string;
- suggested_reviewer_login?: string;
- suggested_reviewer_uuid?: string;
-}
-
-/**
- * Thumbs-up/down verdict on a report's usefulness. Feedback-only: the report
- * keeps its state. Mirrors desktop/cloud `Inbox report feedback` so ranking
- * analysis is comparable across clients. `note` is optional.
- */
-export interface InboxReportFeedbackProperties {
- report_id: string;
- report_age_hours: number;
- priority: string | null;
- actionability: string | null;
- sentiment: InboxReportFeedbackSentiment;
- has_pr: boolean;
- surface: InboxReportActionSurface;
- note?: string;
-}
-
-/**
- * Optional free-text note, fired on its own event after a rating so sentiment
- * stays exactly one event per rating; join back on `report_id`.
- */
-export interface InboxReportFeedbackNoteProperties {
- report_id: string;
- report_age_hours: number;
- priority: string | null;
- actionability: string | null;
- sentiment: InboxReportFeedbackSentiment;
- has_pr: boolean;
- surface: InboxReportActionSurface;
- note: string;
-}
-
-export interface PromptSentProperties {
- task_id: string;
- is_initial: boolean;
- execution_type: "cloud";
- prompt_length_chars: number;
- /** True when the message interrupted a running turn (Steer mode). */
- is_steer: boolean;
-}
-
-export interface TaskRunStoppedProperties {
- task_id: string;
- execution_type: "cloud";
- prompts_sent?: number;
-}
-
-export type EventPropertyMap = {
- [ANALYTICS_EVENTS.INBOX_VIEWED]: InboxViewedProperties;
- [ANALYTICS_EVENTS.INBOX_REPORT_OPENED]: InboxReportOpenedProperties;
- [ANALYTICS_EVENTS.INBOX_REPORT_CLOSED]: InboxReportClosedProperties;
- [ANALYTICS_EVENTS.INBOX_REPORT_SCROLLED]: InboxReportScrolledProperties;
- [ANALYTICS_EVENTS.INBOX_REPORT_ACTION]: InboxReportActionProperties;
- [ANALYTICS_EVENTS.INBOX_REPORT_FEEDBACK]: InboxReportFeedbackProperties;
- [ANALYTICS_EVENTS.INBOX_REPORT_FEEDBACK_NOTE]: InboxReportFeedbackNoteProperties;
- [ANALYTICS_EVENTS.INBOX_TRIAGE_STARTED]: InboxTriageStartedProperties;
- [ANALYTICS_EVENTS.INBOX_TRIAGE_ENDED]: InboxTriageEndedProperties;
- [ANALYTICS_EVENTS.SIGN_IN_STARTED]: SignInStartedProperties;
- [ANALYTICS_EVENTS.SIGN_IN_COMPLETED]: SignInCompletedProperties;
- [ANALYTICS_EVENTS.SIGN_IN_FAILED]: SignInFailedProperties;
- [ANALYTICS_EVENTS.PROMPT_SENT]: PromptSentProperties;
- [ANALYTICS_EVENTS.TASK_RUN_STOPPED]: TaskRunStoppedProperties;
- [ANALYTICS_EVENTS.AGENT_TURN_FEEDBACK]: AgentTurnFeedbackProperties;
-};
-
-export interface Analytics {
- track<K extends keyof EventPropertyMap>(
- eventName: K,
- properties: EventPropertyMap[K],
- ): void;
-}
-
-type PostHogCaptureProperties = Parameters<PostHog["capture"]>[1];
-
-// Client discriminator stamped on inbox events so the shared PostHog project
-// can be sliced by surface (desktop sends "code", the web frontend sends
-// "cloud"). Mirrors packages/ui/src/shell/posthogAnalyticsImpl.ts.
-const INBOX_CLIENT = "mobile" as const;
-
-export const INBOX_ANALYTICS_EVENT_NAMES: ReadonlySet<string> = new Set([
- ANALYTICS_EVENTS.INBOX_VIEWED,
- ANALYTICS_EVENTS.INBOX_REPORT_OPENED,
- ANALYTICS_EVENTS.INBOX_REPORT_CLOSED,
- ANALYTICS_EVENTS.INBOX_REPORT_SCROLLED,
- ANALYTICS_EVENTS.INBOX_REPORT_ACTION,
- ANALYTICS_EVENTS.INBOX_REPORT_FEEDBACK,
- ANALYTICS_EVENTS.INBOX_REPORT_FEEDBACK_NOTE,
- ANALYTICS_EVENTS.INBOX_TRIAGE_STARTED,
- ANALYTICS_EVENTS.INBOX_TRIAGE_ENDED,
-]);
-
-export function useAnalytics(): Analytics {
- const posthog = usePostHog();
- return useMemo<Analytics>(
- () => ({
- track: (eventName, properties) => {
- // Spread first so a caller could override the client, matching desktop.
- const enriched = INBOX_ANALYTICS_EVENT_NAMES.has(eventName)
- ? { inbox_client: INBOX_CLIENT, ...properties }
- : properties;
- posthog?.capture(
- eventName,
- enriched as unknown as PostHogCaptureProperties,
- );
- },
- }),
- [posthog],
- );
-}
-
-/**
- * Tag every subsequent PostHog event with `signal_report_id` for as long as
- * the calling screen is mounted with a non-null `signalReportId`. Clears the
- * super-property on unmount or when `signalReportId` becomes null. Mirrors the
- * desktop `setActiveTaskAnalyticsContext` super-property behaviour so events
- * fired while inside a discuss-launched task can be filtered down to a single
- * inbox report.
- */
-export function useActiveTaskAnalyticsContext(
- signalReportId: string | null | undefined,
-): void {
- const posthog = usePostHog();
- useEffect(() => {
- if (!posthog || !signalReportId) return;
- posthog.register({ signal_report_id: signalReportId });
- return () => {
- posthog.unregister("signal_report_id");
- };
- }, [posthog, signalReportId]);
-}
-
-/** Report age at fire time in hours, rounded to one decimal. Clamped at 0 to guard against clock skew. */
-export function computeReportAgeHours(
- createdAt: string | null | undefined,
-): number {
- if (!createdAt) return 0;
- const ageMs = Date.now() - new Date(createdAt).getTime();
- if (!Number.isFinite(ageMs)) return 0;
- return Math.max(0, Math.round((ageMs / 3_600_000) * 10) / 10);
-}
diff --git a/products/desktop/apps/mobile/src/lib/api.test.ts b/products/desktop/apps/mobile/src/lib/api.test.ts
deleted file mode 100644
index 5cd7823ff51a..000000000000
--- a/products/desktop/apps/mobile/src/lib/api.test.ts
+++ /dev/null
@@ -1,216 +0,0 @@
-import { beforeEach, describe, expect, it, vi } from "vitest";
-
-const { mockFetch, mockRefreshAccessToken, mockGetState } = vi.hoisted(() => ({
- mockFetch: vi.fn(),
- mockRefreshAccessToken: vi.fn(),
- mockGetState: vi.fn(),
-}));
-
-vi.mock("expo/fetch", () => ({
- fetch: mockFetch,
-}));
-
-vi.mock("expo-constants", () => ({
- default: { expoConfig: { version: "0.0.0-test" } },
-}));
-
-vi.mock("@/features/auth", () => ({
- useAuthStore: {
- getState: mockGetState,
- },
-}));
-
-import { authedFetch } from "./api";
-
-const url = "https://app.posthog.test/api/projects/1/tasks/";
-const ok = (data: unknown = {}) =>
- new Response(JSON.stringify(data), {
- status: 200,
- headers: { "Content-Type": "application/json" },
- });
-const err = (status: number, body: unknown = { error: status }) =>
- new Response(JSON.stringify(body), {
- status,
- statusText: `Error ${status}`,
- headers: { "Content-Type": "application/json" },
- });
-
-function setupTokens(initial = "old-token", refreshed = "new-token") {
- let current = initial;
- mockRefreshAccessToken.mockImplementation(async () => {
- current = refreshed;
- });
- mockGetState.mockImplementation(() => ({
- oauthAccessToken: current,
- refreshAccessToken: mockRefreshAccessToken,
- }));
-}
-
-describe("authedFetch", () => {
- beforeEach(() => {
- mockFetch.mockReset();
- mockRefreshAccessToken.mockReset();
- mockGetState.mockReset();
- });
-
- it("attaches the bearer token from the auth store", async () => {
- setupTokens("my-token");
- mockFetch.mockResolvedValueOnce(ok());
-
- await authedFetch(url);
-
- expect(mockFetch).toHaveBeenCalledTimes(1);
- expect(mockRefreshAccessToken).not.toHaveBeenCalled();
- expect(mockFetch.mock.calls[0][1].headers.Authorization).toBe(
- "Bearer my-token",
- );
- });
-
- it.each([
- {
- name: "401",
- failure: () => err(401),
- },
- {
- name: "403 with authentication_failed body",
- failure: () =>
- err(403, {
- type: "authentication_error",
- code: "authentication_failed",
- detail: "Invalid access token.",
- }),
- },
- ])(
- "retries once with a freshly fetched token on $name",
- async ({ failure }) => {
- setupTokens("old-token", "new-token");
- mockFetch.mockResolvedValueOnce(failure()).mockResolvedValueOnce(ok());
-
- const response = await authedFetch(url);
-
- expect(response.ok).toBe(true);
- expect(mockRefreshAccessToken).toHaveBeenCalledTimes(1);
- expect(mockFetch).toHaveBeenCalledTimes(2);
- expect(mockFetch.mock.calls[0][1].headers.Authorization).toBe(
- "Bearer old-token",
- );
- expect(mockFetch.mock.calls[1][1].headers.Authorization).toBe(
- "Bearer new-token",
- );
- },
- );
-
- it.each([
- {
- name: "403 without authentication_failed body",
- response: () => err(403, { detail: "Permission denied." }),
- expectedStatus: 403,
- },
- {
- name: "400 bad request",
- response: () => err(400, { detail: "Bad request." }),
- expectedStatus: 400,
- },
- ])(
- "does not retry on $name",
- async ({ response: makeResponse, expectedStatus }) => {
- setupTokens("token");
- mockFetch.mockResolvedValueOnce(makeResponse());
-
- const response = await authedFetch(url);
-
- expect(response.status).toBe(expectedStatus);
- expect(mockRefreshAccessToken).not.toHaveBeenCalled();
- expect(mockFetch).toHaveBeenCalledTimes(1);
- },
- );
-
- it("returns the failed response when the retry still 401s", async () => {
- setupTokens("token-1", "token-2");
- mockFetch.mockResolvedValueOnce(err(401)).mockResolvedValueOnce(err(401));
-
- const response = await authedFetch(url);
-
- expect(response.status).toBe(401);
- expect(mockRefreshAccessToken).toHaveBeenCalledTimes(1);
- expect(mockFetch).toHaveBeenCalledTimes(2);
- });
-
- it("falls through with the original 401 when token refresh itself fails", async () => {
- mockGetState.mockReturnValue({
- oauthAccessToken: "token",
- refreshAccessToken: mockRefreshAccessToken,
- });
- mockRefreshAccessToken.mockRejectedValueOnce(new Error("refresh failed"));
- mockFetch.mockResolvedValueOnce(err(401));
-
- const response = await authedFetch(url);
-
- expect(response.status).toBe(401);
- expect(mockRefreshAccessToken).toHaveBeenCalledTimes(1);
- expect(mockFetch).toHaveBeenCalledTimes(1);
- });
-
- it("propagates network errors from the underlying fetch", async () => {
- setupTokens("token");
- mockFetch.mockRejectedValueOnce(new Error("Network failure"));
-
- await expect(authedFetch(url)).rejects.toThrow("Network failure");
- });
-
- it("merges caller-provided headers with the auth headers", async () => {
- setupTokens("my-token");
- mockFetch.mockResolvedValueOnce(ok());
-
- await authedFetch(url, {
- method: "POST",
- headers: { "X-Custom": "value" },
- body: "{}",
- });
-
- const init = mockFetch.mock.calls[0][1];
- expect(init.method).toBe("POST");
- expect(init.body).toBe("{}");
- expect(init.headers.Authorization).toBe("Bearer my-token");
- expect(init.headers["X-Custom"]).toBe("value");
- });
-
- it("dedups concurrent refreshes so only one fires on a 401 stampede", async () => {
- let current = "old-token";
- let resolveRefresh: () => void = () => {};
- const refreshPromise = new Promise<void>((resolve) => {
- resolveRefresh = () => {
- current = "new-token";
- resolve();
- };
- });
- mockRefreshAccessToken.mockImplementation(() => refreshPromise);
- mockGetState.mockImplementation(() => ({
- oauthAccessToken: current,
- refreshAccessToken: mockRefreshAccessToken,
- }));
-
- mockFetch
- .mockResolvedValueOnce(err(401))
- .mockResolvedValueOnce(err(401))
- .mockResolvedValueOnce(err(401))
- .mockResolvedValueOnce(ok({ n: 1 }))
- .mockResolvedValueOnce(ok({ n: 2 }))
- .mockResolvedValueOnce(ok({ n: 3 }));
-
- const pending = Promise.all([
- authedFetch(url),
- authedFetch(url),
- authedFetch(url),
- ]);
-
- // Drain microtasks until all three callers have parked on the shared
- // refresh, then release it and let the retries complete.
- for (let i = 0; i < 20; i++) await Promise.resolve();
- resolveRefresh();
- const responses = await pending;
-
- expect(responses.every((r) => r.ok)).toBe(true);
- expect(mockRefreshAccessToken).toHaveBeenCalledTimes(1);
- });
-});
diff --git a/products/desktop/apps/mobile/src/lib/api.ts b/products/desktop/apps/mobile/src/lib/api.ts
deleted file mode 100644
index ccc2a97a097f..000000000000
--- a/products/desktop/apps/mobile/src/lib/api.ts
+++ /dev/null
@@ -1,216 +0,0 @@
-import { fetch } from "expo/fetch";
-import Constants from "expo-constants";
-import { useAuthStore } from "@/features/auth";
-import { logger } from "@/lib/logger";
-
-export class HttpError extends Error {
- constructor(
- readonly status: number,
- readonly statusText: string,
- message: string,
- ) {
- super(message);
- this.name = "HttpError";
- }
-}
-
-// Derive the init shape directly from expo/fetch so we don't import from
-// expo's internal build output (which can move between versions).
-export type FetchInit = NonNullable<Parameters<typeof fetch>[1]>;
-
-const log = logger.scope("api");
-
-const USER_AGENT = `posthog/mobile.hog.dev; version: ${Constants.expoConfig?.version ?? "unknown"}`;
-
-export function getHeaders(): Record<string, string> {
- const { oauthAccessToken } = useAuthStore.getState();
- if (!oauthAccessToken) {
- throw new Error("Not authenticated");
- }
- return {
- Authorization: `Bearer ${oauthAccessToken}`,
- "Content-Type": "application/json",
- "User-Agent": USER_AGENT,
- };
-}
-
-export function getAccessToken(): string {
- const { oauthAccessToken } = useAuthStore.getState();
- if (!oauthAccessToken) {
- throw new Error("Not authenticated");
- }
- return oauthAccessToken;
-}
-
-export function getBaseUrl(): string {
- const { cloudRegion, getCloudUrlFromRegion } = useAuthStore.getState();
- if (!cloudRegion) {
- throw new Error("No cloud region set");
- }
- return getCloudUrlFromRegion(cloudRegion);
-}
-
-export function getProjectId(): number {
- const { projectId } = useAuthStore.getState();
- if (!projectId) {
- throw new Error("No project ID set");
- }
- return projectId;
-}
-
-/**
- * Returns an `AbortSignal` that aborts after `ms` milliseconds.
- *
- * Replaces `AbortSignal.timeout(ms)`, which is unimplemented in the Hermes
- * runtime that React Native uses — calling it throws
- * `TypeError: AbortSignal.timeout is not a function`. Use this helper for any
- * fetch that needs a request timeout on mobile.
- */
-export function createTimeoutSignal(ms: number): AbortSignal {
- const controller = new AbortController();
- setTimeout(() => controller.abort(), ms);
- return controller.signal;
-}
-
-// Concurrent 401s would otherwise stampede the refresh endpoint and have the
-// in-flight responses invalidate each other's new tokens. Share a single
-// pending refresh across all callers and reset it once it settles.
-let pendingRefresh: Promise<void> | null = null;
-
-export async function refreshAccessTokenOnce(): Promise<void> {
- if (pendingRefresh) return pendingRefresh;
- const promise = useAuthStore
- .getState()
- .refreshAccessToken()
- .finally(() => {
- if (pendingRefresh === promise) {
- pendingRefresh = null;
- }
- });
- pendingRefresh = promise;
- return promise;
-}
-
-async function isAuthFailureResponse(response: Response): Promise<boolean> {
- if (response.status === 401) return true;
- if (response.status !== 403) return false;
- try {
- const body = await response.clone().json();
- return (
- body?.code === "authentication_failed" ||
- body?.type === "authentication_error"
- );
- } catch {
- return false;
- }
-}
-
-function mergeHeaders(
- base: Record<string, string>,
- override: HeadersInit | undefined,
-): Record<string, string> {
- if (!override) return base;
- const merged: Record<string, string> = { ...base };
- if (override instanceof Headers) {
- override.forEach((value, key) => {
- merged[key] = value;
- });
- return merged;
- }
- if (Array.isArray(override)) {
- for (const [key, value] of override) {
- merged[key] = value;
- }
- return merged;
- }
- for (const [key, value] of Object.entries(override)) {
- merged[key] = value;
- }
- return merged;
-}
-
-/**
- * `fetch` against the PostHog API with automatic token refresh on auth
- * failure. On a 401 — or a 403 whose JSON body looks like an authentication
- * failure (`code: "authentication_failed"` / `type: "authentication_error"`) —
- * triggers a single shared token refresh and retries the request once. If the
- * refresh itself fails, the original response is returned so callers fall
- * through to their existing error-handling and sign-out flows.
- *
- * Mirrors the desktop fetcher's retry semantics
- * (apps/code/src/renderer/api/fetcher.ts).
- */
-export async function authedFetch(
- url: string,
- init: FetchInit = {},
-): Promise<Response> {
- const headers = mergeHeaders(getHeaders(), init.headers);
- let response: Response = await fetch(url, { ...init, headers });
-
- if (response.ok || !(await isAuthFailureResponse(response))) {
- return response;
- }
-
- try {
- await refreshAccessTokenOnce();
- } catch (err) {
- log.warn("Token refresh on auth failure failed", {
- url,
- status: response.status,
- error: err instanceof Error ? err.message : String(err),
- });
- return response;
- }
-
- const retryHeaders = mergeHeaders(getHeaders(), init.headers);
- response = await fetch(url, { ...init, headers: retryHeaders });
- return response;
-}
-
-export async function registerPushToken(args: {
- token: string;
- platform: string;
-}): Promise<void> {
- const baseUrl = getBaseUrl();
-
- // Push tokens are per-user, not per-project — endpoint lives under
- // /api/users/@me/ alongside the other user-scoped APIs.
- const url = `${baseUrl}/api/users/@me/push_tokens/`;
- const response = await authedFetch(url, {
- method: "POST",
- body: JSON.stringify(args),
- });
-
- if (!response.ok) {
- const body = await response.text().catch(() => "");
- log.warn("registerPushToken failed", {
- url,
- status: response.status,
- statusText: response.statusText,
- body: body.slice(0, 500),
- });
- throw new Error(
- `registerPushToken failed: ${response.status} ${response.statusText} — ${body.slice(0, 200)}`,
- );
- }
-}
-
-export async function deletePushToken(args: { token: string }): Promise<void> {
- const baseUrl = getBaseUrl();
-
- // Unregister is a POST sub-action (not DELETE) because some clients and
- // proxies strip request bodies on DELETE.
- const response = await authedFetch(
- `${baseUrl}/api/users/@me/push_tokens/unregister/`,
- {
- method: "POST",
- body: JSON.stringify(args),
- },
- );
-
- if (!response.ok) {
- log.debug("deletePushToken non-OK response", {
- status: response.status,
- });
- }
-}
diff --git a/products/desktop/apps/mobile/src/lib/deep-links.test.ts b/products/desktop/apps/mobile/src/lib/deep-links.test.ts
deleted file mode 100644
index d2455383dd9a..000000000000
--- a/products/desktop/apps/mobile/src/lib/deep-links.test.ts
+++ /dev/null
@@ -1,139 +0,0 @@
-import { describe, expect, it } from "vitest";
-import {
- externalUrlToAppPath,
- inboxReportShareUrl,
- slugifyTitle,
-} from "./deep-links";
-
-describe("slugifyTitle", () => {
- it.each([
- ["null", null],
- ["undefined", undefined],
- ["empty string", ""],
- ["whitespace only", " "],
- ["unsafe-only characters", ":::"],
- ])("returns an empty string when the title is %s", (_label, input) => {
- expect(slugifyTitle(input)).toBe("");
- });
-
- it("emits `--` for runs that mix a colon with other unsafe chars", () => {
- expect(slugifyTitle("fix(inbox): Add foo")).toBe("fix-inbox--Add-foo");
- });
-
- it("emits a single `-` for a colon-only run", () => {
- expect(slugifyTitle("feat:bar")).toBe("feat-bar");
- });
-
- it("preserves URL-unreserved punctuation (- _ . ~)", () => {
- expect(slugifyTitle("v1.2.3_final~ish")).toBe("v1.2.3_final~ish");
- });
-
- it("collapses runs of unsafe punctuation into a single hyphen", () => {
- expect(slugifyTitle("Cost $5, 50% off!")).toBe("Cost-5-50-off");
- });
-
- it("folds accented Latin letters to their ASCII base", () => {
- expect(slugifyTitle("café résumé naïve")).toBe("cafe-resume-naive");
- });
-
- it("hyphenizes non-Latin scripts that have no ASCII fold", () => {
- expect(slugifyTitle("Hello Привет world")).toBe("Hello-world");
- });
-
- it("preserves case", () => {
- expect(slugifyTitle("Hello World")).toBe("Hello-World");
- });
-});
-
-describe("inboxReportShareUrl", () => {
- it("returns just the UUID when no title argument is passed", () => {
- expect(inboxReportShareUrl("abc-123")).toBe("posthog://inbox/abc-123");
- });
-
- it.each([
- ["null", null],
- ["undefined", undefined],
- ["empty string", ""],
- ])(
- "returns just the UUID when the title is %s",
- (_label, input: string | null | undefined) => {
- expect(inboxReportShareUrl("abc-123", input)).toBe(
- "posthog://inbox/abc-123",
- );
- },
- );
-
- it("appends a slug derived from the title", () => {
- expect(inboxReportShareUrl("abc-123", "Hello World")).toBe(
- "posthog://inbox/abc-123/Hello-World",
- );
- });
-
- it.each([
- ["unsafe-only characters", ":::"],
- ["whitespace only", " "],
- ])("omits the slug when the title is %s", (_label, input) => {
- expect(inboxReportShareUrl("abc-123", input)).toBe(
- "posthog://inbox/abc-123",
- );
- });
-
- it("preserves the desktop colon-run convention", () => {
- expect(inboxReportShareUrl("abc-123", "fix(inbox): Add foo")).toBe(
- "posthog://inbox/abc-123/fix-inbox--Add-foo",
- );
- });
-});
-
-describe("externalUrlToAppPath", () => {
- it("returns the router path for a custom-scheme URL", () => {
- expect(externalUrlToAppPath("posthog://task/task-123")).toBe(
- "/task/task-123",
- );
- });
-
- it("returns the router path for a universal-link URL", () => {
- expect(externalUrlToAppPath("https://code.posthog.com/task/task-123")).toBe(
- "/task/task-123",
- );
- });
-
- it("preserves the query string", () => {
- expect(externalUrlToAppPath("posthog://task/task-123?foo=bar")).toBe(
- "/task/task-123?foo=bar",
- );
- });
-
- it("strips a trailing slug segment from inbox custom-scheme URLs", () => {
- expect(
- externalUrlToAppPath("posthog://inbox/report-abc/fix-inbox--Add-foo"),
- ).toBe("/inbox/report-abc");
- });
-
- it("strips a trailing slug segment from inbox universal links", () => {
- expect(
- externalUrlToAppPath(
- "https://code.posthog.com/inbox/report-abc/Hello-World",
- ),
- ).toBe("/inbox/report-abc");
- });
-
- it("preserves the query string when stripping an inbox slug", () => {
- expect(
- externalUrlToAppPath("posthog://inbox/report-abc/Hello-World?x=1"),
- ).toBe("/inbox/report-abc?x=1");
- });
-
- it("leaves a bare inbox URL untouched", () => {
- expect(externalUrlToAppPath("posthog://inbox/report-abc")).toBe(
- "/inbox/report-abc",
- );
- });
-
- it.each([
- ["unrelated https host", "https://example.com/inbox/x"],
- ["unparseable string", "not a url"],
- ])("ignores URLs from %s", (_label, input) => {
- expect(externalUrlToAppPath(input)).toBe(null);
- });
-});
diff --git a/products/desktop/apps/mobile/src/lib/deep-links.ts b/products/desktop/apps/mobile/src/lib/deep-links.ts
deleted file mode 100644
index ad790fcd3fec..000000000000
--- a/products/desktop/apps/mobile/src/lib/deep-links.ts
+++ /dev/null
@@ -1,156 +0,0 @@
-/**
- * Deep-link URL construction for the mobile app.
- *
- * Path shape mirrors the desktop app (apps/code/src/shared/deeplink.ts and
- * the registered handlers in main/services/*-link/) so a single URL can route
- * to either client:
- * posthog://task/<taskId>
- * posthog://task/<taskId>/run/<runId>
- * posthog://inbox/<reportId>
- * posthog://inbox/<reportId>/<slug> (slug is cosmetic, ignored on receive)
- *
- * Mobile uses the `posthog://` custom scheme (registered in app.json) and
- * https://code.posthog.com as the universal-link host. Both share the same
- * path shape, so a `code.posthog.com/task/X` URL opens the same screen as
- * `posthog://task/X`.
- *
- * For in-app navigation, prefer the `paths.*` helpers — they return the
- * router-relative path that `router.push()` expects. For external/shareable
- * links (push notifications, Slack messages, copy-link buttons), use
- * `universalUrl()` or `customSchemeUrl()`. To produce a human-readable share
- * link for an inbox report, use `inboxReportShareUrl(reportId, title)`.
- */
-
-export const MOBILE_SCHEME = "posthog";
-export const UNIVERSAL_LINK_HOST = "code.posthog.com";
-export const UNIVERSAL_LINK_PREFIX = `https://${UNIVERSAL_LINK_HOST}`;
-
-/**
- * Router-relative paths used inside the app with `router.push()` /
- * `router.replace()`. These are also the path shape that expo-router maps
- * incoming deep links to.
- */
-export const paths = {
- tasksTab: "/(tabs)/tasks" as const,
- inboxTab: "/(tabs)/inbox" as const,
- settings: "/settings" as const,
- newTask: "/task" as const,
- task: (taskId: string) => `/task/${taskId}` as const,
- inboxReport: (reportId: string) => `/inbox/${reportId}` as const,
-} as const;
-
-/** A path is the part after the host: starts with `/`, no scheme. */
-type AppPath = string;
-
-/** Build a shareable `posthog://...` URL for an in-app path. */
-export function customSchemeUrl(path: AppPath): string {
- const trimmed = path.replace(/^\/+/, "");
- return `${MOBILE_SCHEME}://${trimmed}`;
-}
-
-/** Build a shareable `https://code.posthog.com/...` URL for an in-app path. */
-export function universalUrl(path: AppPath): string {
- const normalized = path.startsWith("/") ? path : `/${path}`;
- return `${UNIVERSAL_LINK_PREFIX}${normalized}`;
-}
-
-/**
- * Slugify a free-form title for use as a trailing path segment on a shareable
- * deep link. Mirrors `buildInboxDeeplink`'s slug rules in the desktop app
- * (apps/code/src/shared/deeplink.ts) exactly:
- *
- * - Accented Latin letters are folded to their ASCII base (`café` → `cafe`)
- * via NFD decomposition + combining-mark stripping.
- * - Letters, digits, and the URL-unreserved punctuation `_ . ~` are kept
- * verbatim (case preserved).
- * - Any run of other characters collapses to a single `-`, except runs that
- * mix a colon with other unsafe chars collapse to `--`. This preserves the
- * title-like break in `fix(inbox): Add foo` → `fix-inbox--Add-foo` while
- * keeping standalone colons compact (`feat:bar` → `feat-bar`) and unrelated
- * runs single (`Cost $5, 50% off` → `Cost-5-50-off`).
- * - Leading and trailing hyphens are stripped.
- *
- * Returns the empty string when the input is null/undefined/empty or
- * slugifies to nothing.
- */
-export function slugifyTitle(title: string | null | undefined): string {
- if (!title) return "";
- return title
- .normalize("NFD")
- .replace(/\p{M}/gu, "")
- .replace(/[^a-zA-Z0-9_.~]+/g, (run) =>
- run.includes(":") && /[^:]/.test(run) ? "--" : "-",
- )
- .replace(/^-+|-+$/g, "");
-}
-
-/**
- * Build a shareable `posthog://inbox/<reportId>` URL, optionally with a
- * cosmetic slug suffix derived from the title. The slug is purely cosmetic;
- * receivers must ignore everything after the UUID. See
- * `externalUrlToAppPath` for the corresponding inbound tolerance.
- */
-export function inboxReportShareUrl(
- reportId: string,
- title?: string | null,
-): string {
- const slug = slugifyTitle(title);
- const path = slug ? `/inbox/${reportId}/${slug}` : `/inbox/${reportId}`;
- return customSchemeUrl(path);
-}
-
-/**
- * Convert an incoming external URL (custom scheme or universal link) to the
- * router-relative path expo-router uses. Returns null if the URL doesn't
- * belong to us.
- *
- * A `posthog://inbox/<id>/<slug>` link (or the universal-link equivalent) is
- * normalized to `/inbox/<id>` — the slug is decorative and the route only
- * cares about the UUID. Mirrors the desktop receiver, which also ignores the
- * slug.
- *
- * Used by the auth gate to round-trip the originally-requested URL through
- * the sign-in flow.
- */
-export function externalUrlToAppPath(url: string): AppPath | null {
- try {
- const parsed = new URL(url);
-
- let path: AppPath | null = null;
- if (parsed.protocol === `${MOBILE_SCHEME}:`) {
- // posthog://task/abc → /task/abc
- const host = parsed.hostname;
- if (!host) return null;
- const rest = parsed.pathname || "";
- const search = parsed.search || "";
- path = `/${host}${rest}${search}`;
- } else if (
- (parsed.protocol === "https:" || parsed.protocol === "http:") &&
- parsed.hostname === UNIVERSAL_LINK_HOST
- ) {
- // https://code.posthog.com/task/abc → /task/abc
- const pathname = parsed.pathname || "/";
- path = `${pathname}${parsed.search || ""}`;
- }
-
- if (path === null) return null;
- return stripInboxSlugSuffix(path);
- } catch {
- return null;
- }
-}
-
-/**
- * Collapse `/inbox/<id>/<slug>[?query]` to `/inbox/<id>[?query]`. No-op for
- * any path that isn't an inbox-report deep link with a trailing segment.
- */
-function stripInboxSlugSuffix(path: AppPath): AppPath {
- const queryStart = path.indexOf("?");
- const pathOnly = queryStart === -1 ? path : path.slice(0, queryStart);
- const query = queryStart === -1 ? "" : path.slice(queryStart);
- const segments = pathOnly.split("/").filter(Boolean);
- if (segments.length >= 3 && segments[0] === "inbox") {
- return `/inbox/${segments[1]}${query}`;
- }
- return path;
-}
diff --git a/products/desktop/apps/mobile/src/lib/format.ts b/products/desktop/apps/mobile/src/lib/format.ts
deleted file mode 100644
index 10e2a0f1509b..000000000000
--- a/products/desktop/apps/mobile/src/lib/format.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-export function formatRelativeTime(ts: number): string {
- const diffMs = Date.now() - ts;
- const diffSec = Math.floor(diffMs / 1000);
- if (diffSec < 60) return "just now";
- const diffMin = Math.floor(diffSec / 60);
- if (diffMin < 60) return `${diffMin}m ago`;
- const diffHr = Math.floor(diffMin / 60);
- if (diffHr < 24) return `${diffHr}h ago`;
- const diffDay = Math.floor(diffHr / 24);
- return `${diffDay}d ago`;
-}
diff --git a/products/desktop/apps/mobile/src/lib/githubIssueUrl.test.ts b/products/desktop/apps/mobile/src/lib/githubIssueUrl.test.ts
deleted file mode 100644
index 311427d85c63..000000000000
--- a/products/desktop/apps/mobile/src/lib/githubIssueUrl.test.ts
+++ /dev/null
@@ -1,47 +0,0 @@
-import { describe, expect, it } from "vitest";
-import { parseGithubIssueUrl } from "./githubIssueUrl";
-
-describe("parseGithubIssueUrl", () => {
- it.each([
- {
- name: "PR review comment via discussion anchor",
- url: "https://github.com/o/r/pull/12#discussion_r3647131256",
- isReviewComment: true,
- },
- {
- name: "PR review comment via files anchor",
- url: "https://github.com/o/r/pull/12/files#r3647131256",
- isReviewComment: true,
- },
- {
- name: "PR issue comment is not a review comment",
- url: "https://github.com/o/r/pull/12#issuecomment-123",
- isReviewComment: false,
- },
- {
- name: "issue with an r-style anchor is not a review comment",
- url: "https://github.com/o/r/issues/12#r3647131256",
- isReviewComment: false,
- },
- {
- name: "plain PR url",
- url: "https://github.com/o/r/pull/12",
- isReviewComment: false,
- },
- {
- name: "plain issue url",
- url: "https://github.com/o/r/issues/12",
- isReviewComment: false,
- },
- ])("$name", ({ url, isReviewComment }) => {
- expect(parseGithubIssueUrl(url)?.isReviewComment).toBe(isReviewComment);
- });
-
- it("keeps the comment anchor in the normalized url", () => {
- expect(
- parseGithubIssueUrl(
- "https://github.com/o/r/pull/12#discussion_r3647131256",
- )?.normalizedUrl,
- ).toBe("https://github.com/o/r/pull/12#discussion_r3647131256");
- });
-});
diff --git a/products/desktop/apps/mobile/src/lib/githubIssueUrl.ts b/products/desktop/apps/mobile/src/lib/githubIssueUrl.ts
deleted file mode 100644
index 56b17e8ae5f0..000000000000
--- a/products/desktop/apps/mobile/src/lib/githubIssueUrl.ts
+++ /dev/null
@@ -1,39 +0,0 @@
-export type GithubRefKind = "issue" | "pr";
-
-export interface ParsedGithubIssueUrl {
- kind: GithubRefKind;
- owner: string;
- repo: string;
- number: number;
- normalizedUrl: string;
- isReviewComment: boolean;
-}
-
-const GITHUB_ISSUE_URL_PATTERN =
- /^https?:\/\/github\.com\/([^/\s]+)\/([^/\s]+)\/(issues|pull)\/(\d+)([/?#].*)?$/;
-
-export function parseGithubIssueUrl(text: string): ParsedGithubIssueUrl | null {
- const trimmed = text.trim();
- const match = trimmed.match(GITHUB_ISSUE_URL_PATTERN);
- if (!match) return null;
-
- const [, owner, repo, segment, rawNumber, suffix = ""] = match;
- const number = Number(rawNumber);
- if (!Number.isInteger(number) || number <= 0) return null;
-
- const kind: GithubRefKind = segment === "pull" ? "pr" : "issue";
- // A fragment like #discussion_r123 anchors a specific comment, so keep the
- // whole suffix — anchors such as #r123 only resolve on the /files subpage
- // they were copied from. Without a fragment the tab/query suffix is noise.
- const hashIndex = suffix.indexOf("#");
- const hasFragment = hashIndex !== -1 && hashIndex < suffix.length - 1;
- const fragment = hasFragment ? suffix.slice(hashIndex + 1) : "";
- return {
- kind,
- owner,
- repo,
- number,
- normalizedUrl: `https://github.com/${owner}/${repo}/${segment}/${number}${hasFragment ? suffix : ""}`,
- isReviewComment: kind === "pr" && /^(?:discussion_)?r\d+$/.test(fragment),
- };
-}
diff --git a/products/desktop/apps/mobile/src/lib/logger.ts b/products/desktop/apps/mobile/src/lib/logger.ts
deleted file mode 100644
index adf2d764f5ea..000000000000
--- a/products/desktop/apps/mobile/src/lib/logger.ts
+++ /dev/null
@@ -1,40 +0,0 @@
-// TODO: Set up proper production logging
-// Currently, all logs are disabled in production builds.
-
-type LogFn = (message: string, ...args: unknown[]) => void;
-
-interface Logger {
- debug: LogFn;
- info: LogFn;
- warn: LogFn;
- error: LogFn;
- scope: (name: string) => Logger;
-}
-
-function createLogger(scope?: string): Logger {
- const prefix = scope ? `[${scope}]` : "";
-
- if (!__DEV__) {
- // Production: no-op for all log methods
- const noop: LogFn = () => {};
- return {
- debug: noop,
- info: noop,
- warn: noop,
- error: noop,
- scope: () => createLogger(scope),
- };
- }
-
- // Development: log everything
- return {
- debug: (message, ...args) => console.debug(prefix, message, ...args),
- info: (message, ...args) => console.info(prefix, message, ...args),
- warn: (message, ...args) => console.warn(prefix, message, ...args),
- error: (message, ...args) => console.error(prefix, message, ...args),
- scope: (name) => createLogger(scope ? `${scope}:${name}` : name),
- };
-}
-
-export const logger = createLogger();
-export type { Logger };
diff --git a/products/desktop/apps/mobile/src/lib/openExternalUrl.test.ts b/products/desktop/apps/mobile/src/lib/openExternalUrl.test.ts
deleted file mode 100644
index d4db07b5a09d..000000000000
--- a/products/desktop/apps/mobile/src/lib/openExternalUrl.test.ts
+++ /dev/null
@@ -1,56 +0,0 @@
-import { isSafeExternalUrl } from "@posthog/shared";
-import { beforeEach, describe, expect, it, vi } from "vitest";
-
-const openURL = vi.fn((_url: string) => Promise.resolve(true));
-
-vi.mock("react-native", () => ({
- Linking: { openURL: (url: string) => openURL(url) },
-}));
-
-import { openExternalUrl } from "./openExternalUrl";
-
-describe("isSafeExternalUrl in the mobile bundle", () => {
- it.each([
- "https://github.com/PostHog/code/pull/42",
- "http://example.com",
- "https://example.com/path?q=1#frag",
- "HTTPS://EXAMPLE.COM",
- "mailto:[email protected]",
- ])("allows %s", (url) => {
- expect(isSafeExternalUrl(url)).toBe(true);
- });
-
- it.each([
- "javascript:alert(1)",
- "file:///etc/passwd",
- "data:text/html,<script>alert(1)</script>",
- "smb://server/share",
- "ms-msdt:/id",
- "vscode://extension",
- "//evil.com",
- "/relative/path",
- "not a url",
- "",
- " ",
- ])("blocks %s", (url) => {
- expect(isSafeExternalUrl(url)).toBe(false);
- });
-});
-
-describe("openExternalUrl", () => {
- beforeEach(() => {
- openURL.mockClear();
- });
-
- it.each([
- ["https://example.com", "https://example.com"],
- ["javascript:alert(1)", null],
- ])("opens %s only when safe", (url, expectedCall) => {
- openExternalUrl(url);
- if (expectedCall === null) {
- expect(openURL).not.toHaveBeenCalled();
- } else {
- expect(openURL).toHaveBeenCalledWith(expectedCall);
- }
- });
-});
diff --git a/products/desktop/apps/mobile/src/lib/openExternalUrl.ts b/products/desktop/apps/mobile/src/lib/openExternalUrl.ts
deleted file mode 100644
index deb6c3a73974..000000000000
--- a/products/desktop/apps/mobile/src/lib/openExternalUrl.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { isSafeExternalUrl } from "@posthog/shared";
-import { Linking } from "react-native";
-import { logger } from "@/lib/logger";
-
-const log = logger.scope("openExternalUrl");
-
-export function openExternalUrl(url: string): void {
- if (!isSafeExternalUrl(url)) {
- log.warn("Blocked external URL with unsafe scheme", url);
- return;
- }
- void Linking.openURL(url).catch(() => {});
-}
diff --git a/products/desktop/apps/mobile/src/lib/posthog.test.ts b/products/desktop/apps/mobile/src/lib/posthog.test.ts
deleted file mode 100644
index 14239b917567..000000000000
--- a/products/desktop/apps/mobile/src/lib/posthog.test.ts
+++ /dev/null
@@ -1,125 +0,0 @@
-import { beforeEach, describe, expect, it, vi } from "vitest";
-
-const expoApplication = {
- nativeApplicationVersion: null as string | null,
-};
-
-const expoConstants = {
- expoConfig: null as { version?: string } | null,
-};
-
-vi.mock("posthog-react-native", () => ({
- usePostHog: () => null,
-}));
-
-vi.mock("expo-router", () => ({
- usePathname: () => "/",
- useSegments: () => [] as string[],
-}));
-
-vi.mock("expo-application", () => ({
- get nativeApplicationVersion() {
- return expoApplication.nativeApplicationVersion;
- },
-}));
-
-vi.mock("expo-constants", () => ({
- default: {
- get expoConfig() {
- return expoConstants.expoConfig;
- },
- },
-}));
-
-// posthog.ts imports the auth store and user query for useIdentifyUser. Their
-// real modules transitively pull in native expo modules (expo-secure-store,
-// expo-auth-session) that can't load under the node test environment, so mock
-// them — these app-version tests don't exercise identification.
-vi.mock("@/features/auth/stores/authStore", () => ({
- useAuthStore: () => false,
-}));
-
-vi.mock("@/features/auth/hooks/useUserQuery", () => ({
- useUserQuery: () => ({ data: undefined }),
-}));
-
-beforeEach(() => {
- vi.clearAllMocks();
- expoApplication.nativeApplicationVersion = null;
- expoConstants.expoConfig = { version: "0.0.0-test" };
-});
-
-describe("getAppVersion", () => {
- it("prefers the native application version when present", async () => {
- expoApplication.nativeApplicationVersion = "9.8.7";
- expoConstants.expoConfig = { version: "0.0.0-test" };
-
- const { getAppVersion } = await import("./posthog");
-
- expect(getAppVersion()).toBe("9.8.7");
- });
-
- it("falls back to the Expo config version when no native version is available", async () => {
- expoApplication.nativeApplicationVersion = null;
- expoConstants.expoConfig = { version: "1.2.3" };
-
- const { getAppVersion } = await import("./posthog");
-
- expect(getAppVersion()).toBe("1.2.3");
- });
-
- it("returns null when neither source has a version", async () => {
- expoApplication.nativeApplicationVersion = null;
- expoConstants.expoConfig = null;
-
- const { getAppVersion } = await import("./posthog");
-
- expect(getAppVersion()).toBeNull();
- });
-});
-
-describe("registerPersistentSuperProperties", () => {
- it("registers team and app_version as super properties on the PostHog client", async () => {
- const register = vi.fn();
- const { registerPersistentSuperProperties } = await import("./posthog");
-
- registerPersistentSuperProperties({ register }, "1.2.3");
-
- expect(register).toHaveBeenCalledTimes(1);
- expect(register).toHaveBeenCalledWith({
- team: "posthog-code",
- app_version: "1.2.3",
- });
- });
-
- it("does nothing when the PostHog client is not yet available", async () => {
- const { registerPersistentSuperProperties } = await import("./posthog");
-
- expect(() =>
- registerPersistentSuperProperties(null, "1.2.3"),
- ).not.toThrow();
- });
-
- it("still registers team when no app version can be resolved", async () => {
- const register = vi.fn();
- const { registerPersistentSuperProperties } = await import("./posthog");
-
- registerPersistentSuperProperties({ register }, null);
-
- expect(register).toHaveBeenCalledTimes(1);
- expect(register).toHaveBeenCalledWith({ team: "posthog-code" });
- });
-
- it("resolves the version from getAppVersion when none is provided", async () => {
- expoApplication.nativeApplicationVersion = "4.5.6";
- const register = vi.fn();
- const { registerPersistentSuperProperties } = await import("./posthog");
-
- registerPersistentSuperProperties({ register });
-
- expect(register).toHaveBeenCalledWith({
- team: "posthog-code",
- app_version: "4.5.6",
- });
- });
-});
diff --git a/products/desktop/apps/mobile/src/lib/posthog.ts b/products/desktop/apps/mobile/src/lib/posthog.ts
deleted file mode 100644
index 81c6643d2846..000000000000
--- a/products/desktop/apps/mobile/src/lib/posthog.ts
+++ /dev/null
@@ -1,166 +0,0 @@
-import * as Application from "expo-application";
-import Constants from "expo-constants";
-import { usePathname, useSegments } from "expo-router";
-import { usePostHog } from "posthog-react-native";
-import { useEffect, useRef } from "react";
-import { useUserQuery } from "@/features/auth/hooks/useUserQuery";
-import { useAuthStore } from "@/features/auth/stores/authStore";
-
-/**
- * PostHog configuration - used by PostHogProvider in _layout.tsx
- */
-export const POSTHOG_API_KEY = process.env.EXPO_PUBLIC_POSTHOG_API_KEY ?? "";
-export const POSTHOG_OPTIONS = {
- host: process.env.EXPO_PUBLIC_POSTHOG_HOST ?? "https://us.i.posthog.com",
- captureAppLifecycleEvents: true,
- enableSessionReplay: true,
- sessionReplayConfig: {
- // Recordings land in the shared posthog.com project; the auth flow takes
- // credentials, so text inputs must stay masked.
- maskAllTextInputs: true,
- maskAllImages: false,
- captureLog: true,
- captureNetworkTelemetry: true,
- },
- errorTracking: {
- autocapture: {
- uncaughtExceptions: true,
- unhandledRejections: true,
- },
- },
-};
-
-/**
- * Resolve the app version that should ride along on every custom event. Prefer
- * the native runtime value so OTA-updated binaries still report their actual
- * shipped version; fall back to the Expo config (app.json) when running where
- * expo-application has no native value (e.g. Expo Go, web preview).
- */
-export function getAppVersion(): string | null {
- return (
- Application.nativeApplicationVersion ??
- Constants.expoConfig?.version ??
- null
- );
-}
-
-type PostHogRegisterClient = {
- register: (properties: Record<string, string>) => unknown;
-};
-
-/**
- * Register the super properties attached to every event the client emits:
- * `team` (mirrors the desktop app so mobile and desktop events are segmentable
- * in the shared posthog.com project) and `app_version` when one is available.
- * No-op if the client is not yet ready.
- */
-export function registerPersistentSuperProperties(
- client: PostHogRegisterClient | null | undefined,
- version: string | null = getAppVersion(),
-) {
- if (!client) return;
- client.register({
- team: "posthog-code",
- ...(version !== null ? { app_version: version } : {}),
- });
-}
-
-/**
- * Hook variant of `registerPersistentSuperProperties`. Runs once per client
- * instance so the super properties are re-applied if the PostHog client is
- * recreated.
- */
-export function useRegisterSuperProperties() {
- const posthog = usePostHog();
-
- useEffect(() => {
- registerPersistentSuperProperties(posthog);
- }, [posthog]);
-}
-
-/**
- * Screen tracking hook for expo-router.
- * Must be used inside PostHogProvider.
- */
-export function useScreenTracking() {
- const pathname = usePathname();
- const segments = useSegments();
- const posthog = usePostHog();
- const previousPathname = useRef<string | null>(null);
-
- useEffect(() => {
- if (posthog && pathname && pathname !== previousPathname.current) {
- const screenName =
- segments.filter((segment) => !segment.startsWith("(")).join("/") ||
- "index";
-
- posthog.screen(screenName, {
- pathname,
- segments: segments.join("/"),
- });
-
- previousPathname.current = pathname;
- }
- }, [pathname, segments, posthog]);
-}
-
-/**
- * Associates captured events (and session replays) with the signed-in user.
- * Re-identifies whenever the user's identifying properties change (email, name,
- * staff status, organization) so mid-session updates are forwarded, and resets
- * on logout so the next session starts anonymous and events don't bleed across
- * accounts. Must be used inside PostHogProvider.
- */
-export function useIdentifyUser() {
- const posthog = usePostHog();
- const isAuthenticated = useAuthStore((s) => s.isAuthenticated);
- const { data: user } = useUserQuery();
- // Signature of the last forwarded payload, so we re-identify on real changes
- // but don't spam identify()/group() on every render with identical data.
- const lastIdentity = useRef<string | null>(null);
-
- useEffect(() => {
- if (!posthog) return;
-
- if (!isAuthenticated) {
- // Reset only if we previously identified, otherwise we'd churn the
- // anonymous distinct id on every render before sign-in.
- if (lastIdentity.current) {
- posthog.reset();
- // reset() wipes super properties.
- registerPersistentSuperProperties(posthog);
- lastIdentity.current = null;
- }
- return;
- }
-
- if (!user) return;
-
- const name = [user.first_name, user.last_name].filter(Boolean).join(" ");
- const isStaff = Boolean(user.is_staff);
- const signature = JSON.stringify([
- user.uuid,
- user.email,
- name,
- isStaff,
- user.organization?.id ?? null,
- user.organization?.name ?? null,
- ]);
-
- if (lastIdentity.current === signature) return;
-
- posthog.identify(user.uuid, {
- email: user.email,
- name,
- is_staff: isStaff,
- });
-
- if (user.organization) {
- posthog.group("organization", user.organization.id, {
- name: user.organization.name,
- });
- }
-
- lastIdentity.current = signature;
- }, [posthog, isAuthenticated, user]);
-}
diff --git a/products/desktop/apps/mobile/src/lib/posthogApiClient.test.ts b/products/desktop/apps/mobile/src/lib/posthogApiClient.test.ts
deleted file mode 100644
index 80adb096236b..000000000000
--- a/products/desktop/apps/mobile/src/lib/posthogApiClient.test.ts
+++ /dev/null
@@ -1,207 +0,0 @@
-import { beforeEach, describe, expect, it, vi } from "vitest";
-
-const mocks = vi.hoisted(() => ({
- authState: {
- cloudRegion: "us" as string | null,
- getCloudUrlFromRegion: vi.fn(() => "https://us.posthog.com"),
- oauthAccessToken: "access-token" as string | null,
- projectId: 123 as number | null,
- refreshAccessToken: vi.fn(async () => {}),
- },
- expoApplication: {
- nativeApplicationVersion: "1.2.3" as string | null,
- },
- expoConstants: {
- expoConfig: { version: "9.9.9" } as { version?: string } | null,
- },
- expoFetch: vi.fn(),
- instances: [] as Array<{
- apiHost: string;
- getAccessToken: () => Promise<string>;
- refreshAccessToken: () => Promise<string>;
- teamId: number | undefined;
- options: Record<string, unknown>;
- setTeamId: ReturnType<typeof vi.fn>;
- }>,
-}));
-
-vi.mock("@posthog/api-client/posthog-client", () => ({
- PostHogAPIClient: class {
- setTeamId = vi.fn();
-
- constructor(
- apiHost: string,
- getAccessToken: () => Promise<string>,
- refreshAccessToken: () => Promise<string>,
- teamId: number | undefined,
- options: Record<string, unknown>,
- ) {
- mocks.instances.push({
- apiHost,
- getAccessToken,
- refreshAccessToken,
- teamId,
- options,
- setTeamId: this.setTeamId,
- });
- }
- },
-}));
-
-vi.mock("expo-application", () => ({
- get nativeApplicationVersion() {
- return mocks.expoApplication.nativeApplicationVersion;
- },
-}));
-
-vi.mock("expo-constants", () => ({
- default: {
- get expoConfig() {
- return mocks.expoConstants.expoConfig;
- },
- },
-}));
-
-vi.mock("expo/fetch", () => ({ fetch: mocks.expoFetch }));
-
-vi.mock("@/features/auth", () => ({
- useAuthStore: {
- getState: () => mocks.authState,
- },
-}));
-
-beforeEach(() => {
- vi.resetModules();
- vi.clearAllMocks();
- mocks.instances.length = 0;
- mocks.authState.cloudRegion = "us";
- mocks.authState.oauthAccessToken = "access-token";
- mocks.authState.projectId = 123;
- mocks.authState.getCloudUrlFromRegion.mockReturnValue(
- "https://us.posthog.com",
- );
- mocks.authState.refreshAccessToken.mockImplementation(async () => {});
- mocks.expoApplication.nativeApplicationVersion = "1.2.3";
- mocks.expoConstants.expoConfig = { version: "9.9.9" };
-});
-
-describe("createPostHogApiClient", () => {
- it("configures the shared client for the mobile host", async () => {
- const { createPostHogApiClient } = await import("./posthogApiClient");
-
- createPostHogApiClient();
-
- expect(mocks.instances).toHaveLength(1);
- expect(mocks.instances[0]).toMatchObject({
- apiHost: "https://us.posthog.com",
- teamId: 123,
- options: {
- appVersion: "1.2.3",
- githubConnectFrom: "posthog_mobile",
- taskClientProvenance: "posthog_mobile",
- userAgent: "posthog/mobile.hog.dev; version: 1.2.3",
- },
- });
- });
-
- it("converts URL inputs before calling Expo fetch", async () => {
- const { createPostHogApiClient } = await import("./posthogApiClient");
- createPostHogApiClient();
- const mobileFetch = mocks.instances[0]?.options.fetch as typeof fetch;
- const init = { method: "GET" };
-
- await mobileFetch(
- new URL("https://us.posthog.com/api/projects/2/tasks/"),
- init,
- );
-
- expect(mocks.expoFetch).toHaveBeenCalledWith(
- "https://us.posthog.com/api/projects/2/tasks/",
- init,
- );
- });
-
- it("falls back to the Expo config version", async () => {
- mocks.expoApplication.nativeApplicationVersion = null;
- mocks.expoConstants.expoConfig = { version: "4.5.6" };
- const { createPostHogApiClient } = await import("./posthogApiClient");
-
- createPostHogApiClient();
-
- expect(mocks.instances[0]?.options).toMatchObject({
- appVersion: "4.5.6",
- userAgent: "posthog/mobile.hog.dev; version: 4.5.6",
- });
- });
-
- it("returns the refreshed token from the current auth store state", async () => {
- mocks.authState.refreshAccessToken.mockImplementation(async () => {
- mocks.authState.oauthAccessToken = "refreshed-token";
- });
- const { createPostHogApiClient } = await import("./posthogApiClient");
- createPostHogApiClient();
-
- await expect(mocks.instances[0]?.refreshAccessToken()).resolves.toBe(
- "refreshed-token",
- );
- expect(mocks.authState.refreshAccessToken).toHaveBeenCalledOnce();
- });
-
- it("shares one refresh across concurrent client retries", async () => {
- let resolveRefresh: (() => void) | undefined;
- mocks.authState.refreshAccessToken.mockImplementation(
- () =>
- new Promise<void>((resolve) => {
- resolveRefresh = () => {
- mocks.authState.oauthAccessToken = "refreshed-token";
- resolve();
- };
- }),
- );
- const { createPostHogApiClient } = await import("./posthogApiClient");
- createPostHogApiClient();
-
- const refreshes = [
- mocks.instances[0]?.refreshAccessToken(),
- mocks.instances[0]?.refreshAccessToken(),
- ];
- expect(mocks.authState.refreshAccessToken).toHaveBeenCalledOnce();
- resolveRefresh?.();
-
- await expect(Promise.all(refreshes)).resolves.toEqual([
- "refreshed-token",
- "refreshed-token",
- ]);
- });
-});
-
-describe("getPostHogApiClient", () => {
- it("reuses the regional client and updates its project", async () => {
- const { getPostHogApiClient } = await import("./posthogApiClient");
-
- const first = getPostHogApiClient();
- mocks.authState.projectId = 456;
- const second = getPostHogApiClient();
-
- expect(second).toBe(first);
- expect(mocks.instances).toHaveLength(1);
- expect(mocks.instances[0]?.setTeamId).toHaveBeenCalledWith(456);
- });
-
- it("creates a new client when the cloud region changes", async () => {
- const { getPostHogApiClient } = await import("./posthogApiClient");
-
- const first = getPostHogApiClient();
- mocks.authState.cloudRegion = "eu";
- mocks.authState.getCloudUrlFromRegion.mockReturnValue(
- "https://eu.posthog.com",
- );
- const second = getPostHogApiClient();
-
- expect(second).not.toBe(first);
- expect(mocks.instances.map(({ apiHost }) => apiHost)).toEqual([
- "https://us.posthog.com",
- "https://eu.posthog.com",
- ]);
- });
-});
diff --git a/products/desktop/apps/mobile/src/lib/posthogApiClient.ts b/products/desktop/apps/mobile/src/lib/posthogApiClient.ts
deleted file mode 100644
index 20a8bcaf070d..000000000000
--- a/products/desktop/apps/mobile/src/lib/posthogApiClient.ts
+++ /dev/null
@@ -1,95 +0,0 @@
-import type { FetchImplementation } from "@posthog/api-client/fetcher";
-import { PostHogAPIClient } from "@posthog/api-client/posthog-client";
-import { fetch } from "expo/fetch";
-import * as Application from "expo-application";
-import Constants from "expo-constants";
-import { useAuthStore } from "@/features/auth";
-import { refreshAccessTokenOnce } from "@/lib/api";
-
-const MOBILE_GITHUB_CONNECT_FROM = "posthog_mobile";
-
-let posthogApiClient: PostHogAPIClient | null = null;
-let posthogApiHost: string | null = null;
-
-const mobileFetch: FetchImplementation = (input, init) =>
- fetch(
- typeof input === "string"
- ? input
- : input instanceof URL
- ? input.toString()
- : input.url,
- init,
- );
-
-function getAppVersion(): string {
- return (
- Application.nativeApplicationVersion ??
- Constants.expoConfig?.version ??
- "unknown"
- );
-}
-
-function getAuthenticatedContext(): {
- apiHost: string;
- projectId: number;
-} {
- const { cloudRegion, getCloudUrlFromRegion, projectId } =
- useAuthStore.getState();
-
- if (!cloudRegion) {
- throw new Error("No cloud region set");
- }
- if (!projectId) {
- throw new Error("No project ID set");
- }
-
- return {
- apiHost: getCloudUrlFromRegion(cloudRegion),
- projectId,
- };
-}
-
-async function getAccessToken(): Promise<string> {
- const { oauthAccessToken } = useAuthStore.getState();
- if (!oauthAccessToken) {
- throw new Error("Not authenticated");
- }
- return oauthAccessToken;
-}
-
-async function refreshAccessToken(): Promise<string> {
- await refreshAccessTokenOnce();
- return getAccessToken();
-}
-
-export function createPostHogApiClient(): PostHogAPIClient {
- const { apiHost, projectId } = getAuthenticatedContext();
- const appVersion = getAppVersion();
-
- return new PostHogAPIClient(
- apiHost,
- getAccessToken,
- refreshAccessToken,
- projectId,
- {
- appVersion,
- fetch: mobileFetch,
- githubConnectFrom: MOBILE_GITHUB_CONNECT_FROM,
- taskClientProvenance: "posthog_mobile",
- userAgent: `posthog/mobile.hog.dev; version: ${appVersion}`,
- },
- );
-}
-
-export function getPostHogApiClient(): PostHogAPIClient {
- const { apiHost, projectId } = getAuthenticatedContext();
-
- if (!posthogApiClient || posthogApiHost !== apiHost) {
- posthogApiClient = createPostHogApiClient();
- posthogApiHost = apiHost;
- } else {
- posthogApiClient.setTeamId(projectId);
- }
-
- return posthogApiClient;
-}
diff --git a/products/desktop/apps/mobile/src/lib/posthogUrl.test.ts b/products/desktop/apps/mobile/src/lib/posthogUrl.test.ts
deleted file mode 100644
index 9639b64fdc07..000000000000
--- a/products/desktop/apps/mobile/src/lib/posthogUrl.test.ts
+++ /dev/null
@@ -1,103 +0,0 @@
-import { describe, expect, it } from "vitest";
-import { parsePostHogUrl } from "./posthogUrl";
-
-describe("parsePostHogUrl", () => {
- it("parses docs links into compact docs labels", () => {
- expect(parsePostHogUrl("https://posthog.com/docs/session-replay")).toEqual({
- kind: "docs",
- defaultLabel: "Docs / Session replay",
- normalizedUrl: "https://posthog.com/docs/session-replay",
- refId: null,
- });
- });
-
- it("parses PostHog task run links", () => {
- expect(
- parsePostHogUrl("https://code.posthog.com/task/task-123/run/run-456"),
- ).toEqual({
- kind: "code",
- defaultLabel: "Code / Task run (run-456)",
- normalizedUrl: "https://code.posthog.com/task/task-123/run/run-456",
- refId: "run-456",
- });
- });
-
- it.each([
- "project/7/feature_flags",
- "project/7/feature-flags",
- "feature_flags",
- "feature-flags",
- ])("parses %s links", (section) => {
- expect(parsePostHogUrl(`https://us.posthog.com/${section}/42`)).toEqual({
- kind: "app",
- defaultLabel: "Feature flag (42)",
- normalizedUrl: `https://us.posthog.com/${section}/42`,
- refId: "42",
- });
- });
-
- it("labels a SQL editor link by its query, not its project path", () => {
- expect(
- parsePostHogUrl(
- "https://us.posthog.com/project/7/sql?open_query=SELECT%201",
- )?.defaultLabel,
- ).toBe("SQL query");
- });
-
- it("parses relative insight paths using the signed-in app host", () => {
- expect(
- parsePostHogUrl("/insights/UiFKIsO3", {
- appBaseUrl: "https://us.posthog.com",
- }),
- ).toEqual({
- kind: "app",
- defaultLabel: "Insight (UiFKIsO3)",
- normalizedUrl: "https://us.posthog.com/insights/UiFKIsO3",
- refId: "UiFKIsO3",
- });
- });
-
- it("parses relative PostHog paths using the code host", () => {
- expect(
- parsePostHogUrl("/task/task-123/run/run-456", {
- codeBaseUrl: "https://code.posthog.com",
- }),
- ).toEqual({
- kind: "code",
- defaultLabel: "Code / Task run (run-456)",
- normalizedUrl: "https://code.posthog.com/task/task-123/run/run-456",
- refId: "run-456",
- });
- });
-
- it.each(["feature_flags", "feature-flags"])(
- "uses the %s search query when present",
- (section) => {
- expect(
- parsePostHogUrl(
- `https://eu.posthog.com/project/1/${section}?search=checkout-redesign`,
- ),
- ).toEqual({
- kind: "app",
- defaultLabel: "Feature flags / checkout-redesign",
- normalizedUrl: `https://eu.posthog.com/project/1/${section}?search=checkout-redesign`,
- refId: null,
- });
- },
- );
-
- it("falls back to generic website labels for non-docs pages", () => {
- expect(parsePostHogUrl("https://posthog.com/pricing")).toEqual({
- kind: "website",
- defaultLabel: "PostHog / Pricing",
- normalizedUrl: "https://posthog.com/pricing",
- refId: null,
- });
- });
-
- it("ignores non-PostHog links", () => {
- expect(parsePostHogUrl("https://example.com/docs/session-replay")).toBe(
- null,
- );
- });
-});
diff --git a/products/desktop/apps/mobile/src/lib/posthogUrl.ts b/products/desktop/apps/mobile/src/lib/posthogUrl.ts
deleted file mode 100644
index dc0d4980c1f8..000000000000
--- a/products/desktop/apps/mobile/src/lib/posthogUrl.ts
+++ /dev/null
@@ -1,287 +0,0 @@
-export type PostHogRefKind = "app" | "code" | "docs" | "website";
-
-export interface ParsedPostHogUrl {
- kind: PostHogRefKind;
- defaultLabel: string;
- normalizedUrl: string;
- refId: string | null;
-}
-
-export interface ParsePostHogUrlOptions {
- appBaseUrl?: string | null;
- codeBaseUrl?: string | null;
-}
-
-const POSTHOG_HOSTS = new Set([
- "app.posthog.com",
- "code.posthog.com",
- "eu.posthog.com",
- "localhost",
- "posthog.com",
- "us.posthog.com",
- "www.posthog.com",
-]);
-
-const POSTHOG_APP_HOSTS = new Set([
- "app.posthog.com",
- "eu.posthog.com",
- "localhost",
- "us.posthog.com",
-]);
-
-const POSTHOG_CODE_PATH_PATTERN = /^\/(?:task|inbox)(?:\/|$)/;
-
-function decodeSegment(segment: string): string {
- try {
- return decodeURIComponent(segment);
- } catch {
- return segment;
- }
-}
-
-function humanizeSegment(segment: string): string {
- const text = decodeSegment(segment).replace(/[-_]+/g, " ").trim();
- if (!text) return "";
- return `${text.charAt(0).toUpperCase()}${text.slice(1)}`;
-}
-
-function labelWithId(title: string, refId: string | null): string {
- return refId ? `${title} (${decodeSegment(refId)})` : title;
-}
-
-function joinLabel(prefix: string, parts: string[]): string {
- const compactParts = parts.filter(Boolean);
- return compactParts.length > 0
- ? `${prefix} / ${compactParts.join(" / ")}`
- : prefix;
-}
-
-function fallbackLabel(prefix: string, segments: string[]): string {
- return joinLabel(prefix, segments.slice(0, 2).map(humanizeSegment));
-}
-
-function labelForDocs(segments: string[]): string {
- return joinLabel("Docs", segments.slice(1, 3).map(humanizeSegment));
-}
-
-function labelForCode(segments: string[]): string {
- if (segments[0] === "task") {
- return segments[2] === "run"
- ? labelWithId("Code / Task run", segments[3] ?? null)
- : labelWithId("Code / Task", segments[1] ?? null);
- }
-
- if (segments[0] === "inbox") {
- return labelWithId("Code / Inbox", segments[1] ?? null);
- }
-
- return fallbackLabel("Code", segments);
-}
-
-function refIdForCode(segments: string[]): string | null {
- if (segments[0] === "task") {
- return segments[2] === "run"
- ? (segments[3] ?? null)
- : (segments[1] ?? null);
- }
-
- if (segments[0] === "inbox") {
- return segments[1] ?? null;
- }
-
- return null;
-}
-
-function labelForProjectView(
- parsed: URL,
- projectSegments: string[],
-): string | null {
- const [section, refId, nestedId] = projectSegments;
-
- switch (section) {
- case "feature-flags":
- case "feature_flags": {
- const search = parsed.searchParams.get("search")?.trim();
- if (refId) return labelWithId("Feature flag", refId);
- if (search) return `Feature flags / ${search}`;
- return "Feature flags";
- }
- case "experiments":
- return refId ? labelWithId("Experiment", refId) : "Experiments";
- case "insights":
- return refId ? labelWithId("Insight", refId) : "Insights";
- case "dashboard":
- case "dashboards":
- return refId ? labelWithId("Dashboard", refId) : "Dashboards";
- case "data-management":
- if (refId === "events" && nestedId) {
- return labelWithId("Event", nestedId);
- }
- return "Data management";
- case "settings":
- return refId ? `Settings / ${humanizeSegment(refId)}` : "Settings";
- case "session_replay":
- case "replay":
- case "recordings":
- return refId ? labelWithId("Replay", refId) : "Replay";
- case "error_tracking":
- return refId ? labelWithId("Error", refId) : "Error tracking";
- case "sql":
- return parsed.searchParams.get("open_query")?.trim()
- ? "SQL query"
- : "SQL editor";
- default:
- return null;
- }
-}
-
-function labelForApp(parsed: URL, segments: string[]): string {
- const [section, refId] = segments;
-
- switch (section) {
- case "insights":
- return refId ? labelWithId("Insight", refId) : "Insights";
- case "dashboard":
- case "dashboards":
- return refId ? labelWithId("Dashboard", refId) : "Dashboards";
- case "replay":
- case "recordings":
- case "session_replay":
- return refId ? labelWithId("Replay", refId) : "Replay";
- case "feature-flags":
- case "feature_flags":
- return refId ? labelWithId("Feature flag", refId) : "Feature flags";
- case "experiments":
- return refId ? labelWithId("Experiment", refId) : "Experiments";
- }
-
- if (segments[0] === "project" && segments[1]) {
- const projectLabel = labelForProjectView(parsed, segments.slice(2));
- if (projectLabel) return projectLabel;
- }
-
- return fallbackLabel("PostHog", segments);
-}
-
-function labelForWebsite(segments: string[]): string {
- if (segments[0] === "docs") {
- return labelForDocs(segments);
- }
-
- return fallbackLabel("PostHog", segments);
-}
-
-function refIdForApp(_parsed: URL, segments: string[]): string | null {
- const [section, refId] = segments;
-
- switch (section) {
- case "insights":
- case "dashboard":
- case "dashboards":
- case "replay":
- case "recordings":
- case "session_replay":
- case "feature-flags":
- case "feature_flags":
- case "experiments":
- return refId ?? null;
- case "project":
- switch (segments[2]) {
- case "feature-flags":
- case "feature_flags":
- case "experiments":
- case "insights":
- case "dashboard":
- case "dashboards":
- case "session_replay":
- case "replay":
- case "recordings":
- case "error_tracking":
- return segments[3] ?? null;
- case "data-management":
- return segments[3] === "events" ? (segments[4] ?? null) : null;
- default:
- return null;
- }
- default:
- return null;
- }
-}
-
-function ensureTrailingSlash(url: string): string {
- return url.endsWith("/") ? url : `${url}/`;
-}
-
-function resolvePostHogUrl(
- text: string,
- options: ParsePostHogUrlOptions,
-): URL | null {
- const trimmed = text.trim();
-
- if (trimmed.startsWith("/")) {
- const baseUrl = POSTHOG_CODE_PATH_PATTERN.test(trimmed)
- ? options.codeBaseUrl
- : options.appBaseUrl;
-
- if (!baseUrl) return null;
-
- try {
- return new URL(trimmed, ensureTrailingSlash(baseUrl));
- } catch {
- return null;
- }
- }
-
- let parsed: URL;
- try {
- parsed = new URL(trimmed);
- } catch {
- return null;
- }
-
- return parsed;
-}
-
-export function parsePostHogUrl(
- text: string,
- options: ParsePostHogUrlOptions = {},
-): ParsedPostHogUrl | null {
- const parsed = resolvePostHogUrl(text, options);
- if (!parsed) return null;
-
- if (parsed.protocol !== "https:" && parsed.protocol !== "http:") return null;
-
- const hostname = parsed.hostname.toLowerCase();
- if (!POSTHOG_HOSTS.has(hostname)) return null;
-
- const segments = parsed.pathname.split("/").filter(Boolean);
-
- if (hostname === "code.posthog.com") {
- return {
- kind: "code",
- defaultLabel: labelForCode(segments),
- normalizedUrl: parsed.toString(),
- refId: refIdForCode(segments),
- };
- }
-
- if (POSTHOG_APP_HOSTS.has(hostname)) {
- return {
- kind: "app",
- defaultLabel: labelForApp(parsed, segments),
- normalizedUrl: parsed.toString(),
- refId: refIdForApp(parsed, segments),
- };
- }
-
- if (hostname === "posthog.com" || hostname === "www.posthog.com") {
- return {
- kind: segments[0] === "docs" ? "docs" : "website",
- defaultLabel: labelForWebsite(segments),
- normalizedUrl: parsed.toString(),
- refId: null,
- };
- }
-
- return null;
-}
diff --git a/products/desktop/apps/mobile/src/lib/queryClient.ts b/products/desktop/apps/mobile/src/lib/queryClient.ts
deleted file mode 100644
index bc6a87b1f14e..000000000000
--- a/products/desktop/apps/mobile/src/lib/queryClient.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { QueryClient } from "@tanstack/react-query";
-
-export const queryClient = new QueryClient({
- defaultOptions: {
- queries: {
- staleTime: 1000 * 60, // 1 minute
- gcTime: 1000 * 60 * 5, // 5 minutes (formerly cacheTime)
- retry: 2,
- refetchOnWindowFocus: false, // not needed for mobile
- refetchOnReconnect: true,
- },
- mutations: {
- retry: 1,
- },
- },
-});
diff --git a/products/desktop/apps/mobile/src/lib/syntax-highlight.ts b/products/desktop/apps/mobile/src/lib/syntax-highlight.ts
deleted file mode 100644
index 60f46902e0b1..000000000000
--- a/products/desktop/apps/mobile/src/lib/syntax-highlight.ts
+++ /dev/null
@@ -1,192 +0,0 @@
-import hljs from "highlight.js/lib/core";
-import cpp from "highlight.js/lib/languages/cpp";
-import css from "highlight.js/lib/languages/css";
-import go from "highlight.js/lib/languages/go";
-import java from "highlight.js/lib/languages/java";
-import javascript from "highlight.js/lib/languages/javascript";
-import json from "highlight.js/lib/languages/json";
-import markdown from "highlight.js/lib/languages/markdown";
-import php from "highlight.js/lib/languages/php";
-import python from "highlight.js/lib/languages/python";
-import ruby from "highlight.js/lib/languages/ruby";
-import rust from "highlight.js/lib/languages/rust";
-import scss from "highlight.js/lib/languages/scss";
-import shell from "highlight.js/lib/languages/shell";
-import sql from "highlight.js/lib/languages/sql";
-import swift from "highlight.js/lib/languages/swift";
-import typescript from "highlight.js/lib/languages/typescript";
-import xml from "highlight.js/lib/languages/xml";
-import yaml from "highlight.js/lib/languages/yaml";
-
-hljs.registerLanguage("cpp", cpp);
-hljs.registerLanguage("c", cpp);
-hljs.registerLanguage("css", css);
-hljs.registerLanguage("go", go);
-hljs.registerLanguage("golang", go);
-hljs.registerLanguage("java", java);
-hljs.registerLanguage("javascript", javascript);
-hljs.registerLanguage("js", javascript);
-hljs.registerLanguage("jsx", javascript);
-hljs.registerLanguage("json", json);
-hljs.registerLanguage("markdown", markdown);
-hljs.registerLanguage("md", markdown);
-hljs.registerLanguage("php", php);
-hljs.registerLanguage("python", python);
-hljs.registerLanguage("py", python);
-hljs.registerLanguage("ruby", ruby);
-hljs.registerLanguage("rb", ruby);
-hljs.registerLanguage("rust", rust);
-hljs.registerLanguage("rs", rust);
-hljs.registerLanguage("scss", scss);
-hljs.registerLanguage("sass", scss);
-hljs.registerLanguage("shell", shell);
-hljs.registerLanguage("bash", shell);
-hljs.registerLanguage("sh", shell);
-hljs.registerLanguage("zsh", shell);
-hljs.registerLanguage("sql", sql);
-hljs.registerLanguage("swift", swift);
-hljs.registerLanguage("typescript", typescript);
-hljs.registerLanguage("ts", typescript);
-hljs.registerLanguage("tsx", typescript);
-hljs.registerLanguage("xml", xml);
-hljs.registerLanguage("html", xml);
-hljs.registerLanguage("svg", xml);
-hljs.registerLanguage("yaml", yaml);
-hljs.registerLanguage("yml", yaml);
-
-export interface HighlightSegment {
- text: string;
- className?: string;
-}
-
-// One Dark palette matching the desktop app
-const ONE_DARK_COLORS: Record<string, string> = {
- "hljs-keyword": "#c678dd",
- "hljs-built_in": "#e5c07b",
- "hljs-type": "#e5c07b",
- "hljs-literal": "#d19a66",
- "hljs-number": "#d19a66",
- "hljs-string": "#98c379",
- "hljs-regexp": "#56b6c2",
- "hljs-comment": "#8a8275",
- "hljs-doctag": "#c678dd",
- "hljs-function": "#61afef",
- "hljs-title": "#61afef",
- "hljs-title.function_": "#61afef",
- "hljs-params": "#c4baa8",
- "hljs-variable": "#e06c75",
- "hljs-attr": "#d19a66",
- "hljs-attribute": "#d19a66",
- "hljs-name": "#e06c75",
- "hljs-tag": "#e06c75",
- "hljs-selector-tag": "#e06c75",
- "hljs-selector-class": "#e5c07b",
- "hljs-selector-id": "#61afef",
- "hljs-property": "#e06c75",
- "hljs-meta": "#56b6c2",
- "hljs-operator": "#56b6c2",
- "hljs-punctuation": "#c4baa8",
- "hljs-subst": "#c4baa8",
- "hljs-symbol": "#56b6c2",
- "hljs-addition": "#98c379",
- "hljs-deletion": "#e06c75",
-};
-
-function decodeEntities(text: string): string {
- // Decode &amp; last to avoid double-unescaping (e.g. &amp;lt; → &lt; → <)
- return text
- .replace(/&lt;/g, "<")
- .replace(/&gt;/g, ">")
- .replace(/&quot;/g, '"')
- .replace(/&#x27;/g, "'")
- .replace(/&#39;/g, "'")
- .replace(/&amp;/g, "&");
-}
-
-/**
- * Parse highlight.js HTML output into segments.
- * Input: `<span class="hljs-keyword">const</span> x = <span ...>42</span>;`
- */
-function parseHljsHtml(html: string): HighlightSegment[] {
- const segments: HighlightSegment[] = [];
- const regex = /<span class="([^"]*)">([\s\S]*?)<\/span>|([^<]+)/g;
-
- for (let match = regex.exec(html); match !== null; match = regex.exec(html)) {
- if (match[3]) {
- segments.push({ text: decodeEntities(match[3]) });
- } else if (match[1] && match[2] !== undefined) {
- const className = match[1];
- const inner = match[2];
- if (inner.includes("<span")) {
- for (const nested of parseHljsHtml(inner)) {
- segments.push({
- text: nested.text,
- className: nested.className ?? className,
- });
- }
- } else {
- segments.push({ text: decodeEntities(inner), className });
- }
- }
- }
-
- return segments;
-}
-
-export function highlightCode(
- code: string,
- language: string,
-): HighlightSegment[] | null {
- if (!hljs.getLanguage(language)) return null;
-
- try {
- const result = hljs.highlight(code, { language });
- return parseHljsHtml(result.value);
- } catch {
- return null;
- }
-}
-
-export function getColorForClass(className?: string): string | undefined {
- if (!className) return undefined;
- return ONE_DARK_COLORS[className] ?? ONE_DARK_COLORS[className.split(" ")[0]];
-}
-
-const EXT_TO_LANGUAGE: Record<string, string> = {
- ts: "typescript",
- tsx: "typescript",
- js: "javascript",
- jsx: "javascript",
- mjs: "javascript",
- cjs: "javascript",
- py: "python",
- go: "go",
- rs: "rust",
- rb: "ruby",
- java: "java",
- c: "c",
- cpp: "cpp",
- h: "cpp",
- hpp: "cpp",
- css: "css",
- scss: "scss",
- html: "html",
- xml: "xml",
- svg: "xml",
- json: "json",
- yaml: "yaml",
- yml: "yaml",
- md: "markdown",
- sql: "sql",
- sh: "shell",
- bash: "shell",
- zsh: "shell",
- swift: "swift",
- php: "php",
-};
-
-export function languageFromPath(filePath: string): string | null {
- const ext = filePath.split(".").pop()?.toLowerCase();
- if (!ext) return null;
- return EXT_TO_LANGUAGE[ext] ?? null;
-}
diff --git a/products/desktop/apps/mobile/src/lib/textDefaults.ts b/products/desktop/apps/mobile/src/lib/textDefaults.ts
deleted file mode 100644
index 185cb36a3f69..000000000000
--- a/products/desktop/apps/mobile/src/lib/textDefaults.ts
+++ /dev/null
@@ -1,54 +0,0 @@
-import { cloneElement, type ReactElement } from "react";
-import { StyleSheet, Text, type TextProps, type TextStyle } from "react-native";
-import {
- FONT_SCALE_BY_PREFERENCE,
- usePreferencesStore,
-} from "@/features/preferences/stores/preferencesStore";
-
-// Apply Open Runde as the default fontFamily for every <Text>, including those
-// imported directly from react-native, and scale every explicit fontSize by the
-// user's chosen font-size preference. User-provided styles (e.g. font-mono via
-// NativeWind className) appear later in the style array and override the
-// default; the scaled fontSize is appended last so it always wins.
-type PatchableText = {
- render: (...args: unknown[]) => ReactElement<TextProps>;
- __posthogPatched?: boolean;
-};
-const TextRef = Text as unknown as PatchableText;
-
-const FONT_FAMILY_STYLE = { fontFamily: "Open Runde" } as const;
-
-if (!TextRef.__posthogPatched) {
- const baseRender = TextRef.render;
- TextRef.render = function patchedRender(...args) {
- const element = baseRender.apply(this, args);
-
- // Read the scale imperatively (this runs outside React, so no hooks). The
- // value is persisted and read on every render, so changing it in Settings
- // takes effect as each screen re-renders.
- const scale =
- FONT_SCALE_BY_PREFERENCE[usePreferencesStore.getState().fontSize];
-
- if (scale === 1) {
- return cloneElement(element, {
- style: [FONT_FAMILY_STYLE, element.props.style],
- });
- }
-
- // Only scale a fontSize that is explicitly set on this node. Nodes without
- // one inherit their (already-scaled) parent in React Native, so injecting a
- // default here would break inheritance for nested <Text>.
- const flattened = StyleSheet.flatten(element.props.style) as
- | TextStyle
- | undefined;
- const scaledStyle =
- flattened && typeof flattened.fontSize === "number"
- ? { fontSize: flattened.fontSize * scale }
- : null;
-
- return cloneElement(element, {
- style: [FONT_FAMILY_STYLE, element.props.style, scaledStyle],
- });
- };
- TextRef.__posthogPatched = true;
-}
diff --git a/products/desktop/apps/mobile/src/lib/theme.ts b/products/desktop/apps/mobile/src/lib/theme.ts
deleted file mode 100644
index 9dd229b9b215..000000000000
--- a/products/desktop/apps/mobile/src/lib/theme.ts
+++ /dev/null
@@ -1,179 +0,0 @@
-import { useColorScheme, vars } from "nativewind";
-
-/**
- * Single source of truth for all theme colors.
- * Defined as hex for readability, converted to RGB for NativeWind vars().
- */
-// Color palette mirrored from the desktop app (apps/code globals.css).
-// Light: slate gray + orange accent. Dark: slate gray + yellow accent.
-const colors = {
- light: {
- gray: {
- 1: "#f2f3ee",
- 2: "#eceee8",
- 3: "#e4e5de",
- 4: "#d8dbd1",
- 5: "#cbd0c3",
- 6: "#bcc1b4",
- 7: "#a9af9f",
- 8: "#93998a",
- 9: "#6b7165",
- 10: "#5a6054",
- 11: "#3a4036",
- 12: "#0d0d0d",
- },
- accent: {
- 1: "#fff5f0",
- 2: "#ffe8dc",
- 3: "#ffd0b8",
- 4: "#ffb38a",
- 5: "#ff8f56",
- 6: "#f57030",
- 7: "#e05a18",
- 8: "#c94800",
- 9: "#f54d00",
- 10: "#e64600",
- 11: "#a33300",
- 12: "#4d1800",
- contrast: "#ffffff",
- },
- status: {
- success: "#16a34a",
- error: "#dc2626",
- warning: "#d97706",
- info: "#2563eb",
- },
- background: "#f2f3ee",
- // "Card" surface — used for raised UI like buttons, composer card, pills.
- // Pure white in light mode for max contrast against the cream background;
- // gray-3 in dark mode so cards lift slightly off the bg.
- card: "#ffffff",
- },
- dark: {
- gray: {
- 1: "#131316",
- 2: "#18181f",
- 3: "#1e1e28",
- 4: "#24243e",
- 5: "#2a2a37",
- 6: "#2e2e3d",
- 7: "#40405a",
- 8: "#616180",
- 9: "#7c7c9e",
- 10: "#8d8daa",
- 11: "#9898b6",
- 12: "#e6e6e6",
- },
- accent: {
- 1: "#14120a",
- 2: "#1a1608",
- 3: "#261e07",
- 4: "#362900",
- 5: "#443300",
- 6: "#524007",
- 7: "#6b561a",
- 8: "#8c7230",
- 9: "#f8be2a",
- 10: "#ebb520",
- 11: "#fcc84e",
- 12: "#fde8b8",
- contrast: "#1a1200",
- },
- status: {
- success: "#4ade80",
- error: "#f87171",
- warning: "#fbbf24",
- info: "#60a5fa",
- },
- background: "#131316",
- card: "#1e1e28",
- },
-} as const;
-
-// Convert hex to RGB space-separated format for NativeWind vars()
-function hexToRgb(hex: string): string {
- const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
- if (!result) return "0 0 0";
- return `${parseInt(result[1], 16)} ${parseInt(result[2], 16)} ${parseInt(result[3], 16)}`;
-}
-
-// Convert hex to rgba format with alpha
-function hexToRgba(hex: string, alpha: number): string {
- const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
- if (!result) return `rgba(0,0,0,${alpha})`;
- const r = parseInt(result[1], 16);
- const g = parseInt(result[2], 16);
- const b = parseInt(result[3], 16);
- return `rgba(${r},${g},${b},${alpha})`;
-}
-
-// Generate NativeWind vars() from color definitions
-function createThemeVars(theme: (typeof colors)["light" | "dark"]) {
- return vars({
- "--gray-1": hexToRgb(theme.gray[1]),
- "--gray-2": hexToRgb(theme.gray[2]),
- "--gray-3": hexToRgb(theme.gray[3]),
- "--gray-4": hexToRgb(theme.gray[4]),
- "--gray-5": hexToRgb(theme.gray[5]),
- "--gray-6": hexToRgb(theme.gray[6]),
- "--gray-7": hexToRgb(theme.gray[7]),
- "--gray-8": hexToRgb(theme.gray[8]),
- "--gray-9": hexToRgb(theme.gray[9]),
- "--gray-10": hexToRgb(theme.gray[10]),
- "--gray-11": hexToRgb(theme.gray[11]),
- "--gray-12": hexToRgb(theme.gray[12]),
- "--accent-1": hexToRgb(theme.accent[1]),
- "--accent-2": hexToRgb(theme.accent[2]),
- "--accent-3": hexToRgb(theme.accent[3]),
- "--accent-4": hexToRgb(theme.accent[4]),
- "--accent-5": hexToRgb(theme.accent[5]),
- "--accent-6": hexToRgb(theme.accent[6]),
- "--accent-7": hexToRgb(theme.accent[7]),
- "--accent-8": hexToRgb(theme.accent[8]),
- "--accent-9": hexToRgb(theme.accent[9]),
- "--accent-10": hexToRgb(theme.accent[10]),
- "--accent-11": hexToRgb(theme.accent[11]),
- "--accent-12": hexToRgb(theme.accent[12]),
- "--accent-contrast": hexToRgb(theme.accent.contrast),
- "--status-success": hexToRgb(theme.status.success),
- "--status-error": hexToRgb(theme.status.error),
- "--status-warning": hexToRgb(theme.status.warning),
- "--status-info": hexToRgb(theme.status.info),
- "--background": hexToRgb(theme.background),
- "--card": hexToRgb(theme.card),
- });
-}
-
-// NativeWind vars() for runtime theming (used in root View style)
-export const lightTheme = createThemeVars(colors.light);
-export const darkTheme = createThemeVars(colors.dark);
-
-// Types
-export type ThemeColors = (typeof colors)["light" | "dark"];
-
-/**
- * Hook to get raw hex color values for native components.
- * Use for: ActivityIndicator, headerStyle, headerTintColor, RefreshControl, etc.
- *
- * For styled components, use Tailwind classes:
- * - bg-gray-1, text-gray-12, border-gray-6
- * - bg-accent-9, text-accent-11
- * - bg-background
- */
-export function useThemeColors(): ThemeColors {
- const { colorScheme } = useColorScheme();
- return colorScheme === "dark" ? colors.dark : colors.light;
-}
-
-/**
- * Convert hex color to rgba format.
- * Useful for creating transparent variants of theme colors (e.g., for gradients).
- */
-export function toRgba(hex: string, alpha: number): string {
- return hexToRgba(hex, alpha);
-}
-
-// Merged-PR purple, mirrored from the desktop app. The theme has no purple
-// scale, and this purple is recognisable enough that a fixed value works in
-// both light and dark.
-export const MERGED_COLOR = "#8e4ec6";
diff --git a/products/desktop/apps/mobile/src/test/setup.ts b/products/desktop/apps/mobile/src/test/setup.ts
deleted file mode 100644
index 5e322d9f399f..000000000000
--- a/products/desktop/apps/mobile/src/test/setup.ts
+++ /dev/null
@@ -1,278 +0,0 @@
-import { afterEach, vi } from "vitest";
-
-vi.mock("expo-constants", () => ({
- default: {
- expoConfig: {
- version: "0.0.0-test",
- },
- },
-}));
-
-// expo/fetch and expo-application ship as source that vitest's node environment
-// cannot load (Flow syntax, a missing __DEV__ global), wedging any module — e.g.
-// the PostHog API client — that imports them transitively.
-vi.mock("expo/fetch", () => ({ fetch: vi.fn() }));
-vi.mock("expo-application", () => ({ nativeApplicationVersion: "0.0.0-test" }));
-
-vi.mock("@react-native-async-storage/async-storage", () => {
- const store = new Map<string, string>();
- return {
- default: {
- getItem: vi.fn(async (key: string) => store.get(key) ?? null),
- setItem: vi.fn(async (key: string, value: string) => {
- store.set(key, value);
- }),
- removeItem: vi.fn(async (key: string) => {
- store.delete(key);
- }),
- clear: vi.fn(async () => {
- store.clear();
- }),
- getAllKeys: vi.fn(async () => Array.from(store.keys())),
- multiGet: vi.fn(async (keys: string[]) =>
- keys.map((key) => [key, store.get(key) ?? null]),
- ),
- multiSet: vi.fn(async (pairs: [string, string][]) => {
- for (const [key, value] of pairs) {
- store.set(key, value);
- }
- }),
- multiRemove: vi.fn(async (keys: string[]) => {
- for (const key of keys) {
- store.delete(key);
- }
- }),
- },
- };
-});
-
-vi.mock("phosphor-react-native", async () => {
- const { createElement } = await import("react");
- const icon = (name: string) => (props: Record<string, unknown>) =>
- createElement(name, props);
- return {
- __esModule: true,
- Archive: icon("Archive"),
- ArrowCounterClockwise: icon("ArrowCounterClockwise"),
- ArrowDown: icon("ArrowDown"),
- ArrowSquareOut: icon("ArrowSquareOut"),
- ArrowUp: icon("ArrowUp"),
- ArrowsClockwise: icon("ArrowsClockwise"),
- ArrowsIn: icon("ArrowsIn"),
- ArrowsOut: icon("ArrowsOut"),
- Brain: icon("Brain"),
- BrainIcon: icon("BrainIcon"),
- Bug: icon("Bug"),
- Camera: icon("Camera"),
- Cards: icon("Cards"),
- ChartLine: icon("ChartLine"),
- ChatCircleText: icon("ChatCircleText"),
- ClipboardText: icon("ClipboardText"),
- CursorClick: icon("CursorClick"),
- Database: icon("Database"),
- Flag: icon("Flag"),
- Flask: icon("Flask"),
- PlayCircle: icon("PlayCircle"),
- Pulse: icon("Pulse"),
- SquaresFour: icon("SquaresFour"),
- User: icon("User"),
- CaretDown: icon("CaretDown"),
- CaretLeft: icon("CaretLeft"),
- CaretRight: icon("CaretRight"),
- CaretUp: icon("CaretUp"),
- ChatCircle: icon("ChatCircle"),
- Check: icon("Check"),
- CheckCircle: icon("CheckCircle"),
- CircleDashed: icon("CircleDashed"),
- CircleIcon: icon("CircleIcon"),
- CircleNotch: icon("CircleNotch"),
- Clock: icon("Clock"),
- ClockCounterClockwise: icon("ClockCounterClockwise"),
- CloudArrowDown: icon("CloudArrowDown"),
- Code: icon("Code"),
- Copy: icon("Copy"),
- Eye: icon("Eye"),
- File: icon("File"),
- FileText: icon("FileText"),
- FunnelSimple: icon("FunnelSimple"),
- GearSix: icon("GearSix"),
- GitBranch: icon("GitBranch"),
- GitMerge: icon("GitMerge"),
- GitPullRequest: icon("GitPullRequest"),
- GithubLogo: icon("GithubLogo"),
- Globe: icon("Globe"),
- Image: icon("Image"),
- ImageBroken: icon("ImageBroken"),
- Lightning: icon("Lightning"),
- LinkSimple: icon("LinkSimple"),
- List: icon("List"),
- ListBullets: icon("ListBullets"),
- ListChecks: icon("ListChecks"),
- Lock: icon("Lock"),
- MagnifyingGlass: icon("MagnifyingGlass"),
- Microphone: icon("Microphone"),
- MicrophoneIcon: icon("MicrophoneIcon"),
- PaperclipIcon: icon("PaperclipIcon"),
- PauseIcon: icon("PauseIcon"),
- PencilIcon: icon("PencilIcon"),
- PencilSimple: icon("PencilSimple"),
- Play: icon("Play"),
- Plus: icon("Plus"),
- PuzzlePiece: icon("PuzzlePiece"),
- Question: icon("Question"),
- RadioButton: icon("RadioButton"),
- Robot: icon("Robot"),
- ShieldCheck: icon("ShieldCheck"),
- Sparkle: icon("Sparkle"),
- SpeakerHigh: icon("SpeakerHigh"),
- Stack: icon("Stack"),
- Stop: icon("Stop"),
- StopIcon: icon("StopIcon"),
- Terminal: icon("Terminal"),
- ThumbsDown: icon("ThumbsDown"),
- ThumbsUp: icon("ThumbsUp"),
- Trash: icon("Trash"),
- Tray: icon("Tray"),
- UsersThree: icon("UsersThree"),
- Warning: icon("Warning"),
- WarningCircle: icon("WarningCircle"),
- WifiSlash: icon("WifiSlash"),
- Wrench: icon("Wrench"),
- X: icon("X"),
- XCircle: icon("XCircle"),
- };
-});
-
-// nativewind cannot be evaluated under vitest's node environment — it pulls in
-// react-native internals shipped as Flow source, which fail to parse ("Unexpected
-// token 'typeof'") and wedge the module loader. Stub the two APIs the app uses so
-// any module that imports the theme (directly or transitively) loads cleanly.
-vi.mock("nativewind", () => ({
- useColorScheme: () => ({
- colorScheme: "light" as const,
- setColorScheme: vi.fn(),
- toggleColorScheme: vi.fn(),
- }),
- vars: (value: Record<string, string>) => value,
-}));
-
-// react-native-reanimated pulls in native worklet/runtime setup that never
-// resolves under vitest's node environment, hanging the worker indefinitely.
-// Replace it with a lightweight, side-effect-free stand-in so component trees
-// that import it (directly or transitively) can render in tests.
-vi.mock("react-native-reanimated", async () => {
- const { createElement } = await import("react");
- const animatedComponent =
- (name: string) => (props: Record<string, unknown>) =>
- createElement(name, props, (props?.children as never) ?? null);
- const passthroughEasing = () => 0;
- const easingFactory = () => passthroughEasing;
-
- return {
- default: {
- View: animatedComponent("Animated.View"),
- ScrollView: animatedComponent("Animated.ScrollView"),
- Text: animatedComponent("Animated.Text"),
- Image: animatedComponent("Animated.Image"),
- createAnimatedComponent: (component: unknown) => component,
- },
- Easing: {
- linear: passthroughEasing,
- ease: passthroughEasing,
- quad: passthroughEasing,
- cubic: passthroughEasing,
- in: easingFactory,
- out: easingFactory,
- inOut: easingFactory,
- bezier: easingFactory,
- },
- useSharedValue: <T>(initial: T) => ({ value: initial }),
- useAnimatedStyle: (factory: () => unknown) => {
- try {
- return factory();
- } catch {
- return {};
- }
- },
- useDerivedValue: (factory: () => unknown) => ({ value: factory() }),
- useAnimatedRef: () => ({ current: null }),
- withTiming: <T>(value: T) => value,
- withSpring: <T>(value: T) => value,
- withDelay: <T>(_delay: number, value: T) => value,
- withRepeat: <T>(value: T) => value,
- withSequence: <T>(...values: T[]) => values[values.length - 1],
- cancelAnimation: vi.fn(),
- runOnJS:
- <Args extends unknown[]>(fn: (...args: Args) => unknown) =>
- (...args: Args) =>
- fn(...args),
- runOnUI:
- <Args extends unknown[]>(fn: (...args: Args) => unknown) =>
- (...args: Args) =>
- fn(...args),
- interpolate: () => 0,
- Extrapolation: { CLAMP: "clamp", EXTEND: "extend", IDENTITY: "identity" },
- };
-});
-
-vi.mock("react-native-safe-area-context", async () => {
- const { createElement } = await import("react");
- return {
- SafeAreaProvider: (props: { children?: unknown }) =>
- createElement("SafeAreaProvider", null, props.children as never),
- SafeAreaView: (props: { children?: unknown }) =>
- createElement("SafeAreaView", null, props.children as never),
- useSafeAreaInsets: () => ({ top: 0, bottom: 0, left: 0, right: 0 }),
- useSafeAreaFrame: () => ({ x: 0, y: 0, width: 375, height: 812 }),
- };
-});
-
-vi.mock("react-native", async () => {
- const actual = await import("react-native-web");
- const { createElement } = await import("react");
-
- return {
- ...actual,
- Alert: {
- alert: vi.fn(),
- },
- BackHandler: {
- addEventListener: vi.fn(() => ({
- remove: vi.fn(),
- })),
- },
- InteractionManager: {
- runAfterInteractions: (callback: () => void) => {
- callback();
- return {
- cancel: vi.fn(),
- };
- },
- },
- Platform: {
- OS: "ios",
- select: <T>(options: { ios?: T; android?: T; default?: T }) =>
- options.ios ?? options.default,
- },
- TextInput: (props: Record<string, unknown>) =>
- createElement("TextInput", props),
- };
-});
-
-vi.mock("@/lib/logger", () => {
- const mockLogger = {
- info: vi.fn(),
- warn: vi.fn(),
- error: vi.fn(),
- debug: vi.fn(),
- scope: () => mockLogger,
- };
-
- return {
- logger: mockLogger,
- };
-});
-
-afterEach(() => {
- vi.clearAllMocks();
-});
diff --git a/products/desktop/apps/mobile/svg.d.ts b/products/desktop/apps/mobile/svg.d.ts
deleted file mode 100644
index f976e9e51a1b..000000000000
--- a/products/desktop/apps/mobile/svg.d.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-// Lets us `import Logo from "./logo.svg"` and have it typed as a React
-// component, courtesy of react-native-svg-transformer at build time.
-declare module "*.svg" {
- import type React from "react";
- import type { SvgProps } from "react-native-svg";
- const content: React.FC<SvgProps>;
- export default content;
-}
diff --git a/products/desktop/apps/mobile/tailwind.config.js b/products/desktop/apps/mobile/tailwind.config.js
deleted file mode 100644
index 0bed59fdba72..000000000000
--- a/products/desktop/apps/mobile/tailwind.config.js
+++ /dev/null
@@ -1,53 +0,0 @@
-/** @type {import('tailwindcss').Config} */
-module.exports = {
- presets: [require("nativewind/preset")],
- content: ["./App.{js,ts,jsx,tsx}", "./src/**/*.{js,ts,jsx,tsx}"],
- theme: {
- extend: {
- colors: {
- gray: {
- 1: "rgb(var(--gray-1) / <alpha-value>)",
- 2: "rgb(var(--gray-2) / <alpha-value>)",
- 3: "rgb(var(--gray-3) / <alpha-value>)",
- 4: "rgb(var(--gray-4) / <alpha-value>)",
- 5: "rgb(var(--gray-5) / <alpha-value>)",
- 6: "rgb(var(--gray-6) / <alpha-value>)",
- 7: "rgb(var(--gray-7) / <alpha-value>)",
- 8: "rgb(var(--gray-8) / <alpha-value>)",
- 9: "rgb(var(--gray-9) / <alpha-value>)",
- 10: "rgb(var(--gray-10) / <alpha-value>)",
- 11: "rgb(var(--gray-11) / <alpha-value>)",
- 12: "rgb(var(--gray-12) / <alpha-value>)",
- },
- accent: {
- 1: "rgb(var(--accent-1) / <alpha-value>)",
- 2: "rgb(var(--accent-2) / <alpha-value>)",
- 3: "rgb(var(--accent-3) / <alpha-value>)",
- 4: "rgb(var(--accent-4) / <alpha-value>)",
- 5: "rgb(var(--accent-5) / <alpha-value>)",
- 6: "rgb(var(--accent-6) / <alpha-value>)",
- 7: "rgb(var(--accent-7) / <alpha-value>)",
- 8: "rgb(var(--accent-8) / <alpha-value>)",
- 9: "rgb(var(--accent-9) / <alpha-value>)",
- 10: "rgb(var(--accent-10) / <alpha-value>)",
- 11: "rgb(var(--accent-11) / <alpha-value>)",
- 12: "rgb(var(--accent-12) / <alpha-value>)",
- contrast: "rgb(var(--accent-contrast) / <alpha-value>)",
- },
- status: {
- success: "rgb(var(--status-success) / <alpha-value>)",
- error: "rgb(var(--status-error) / <alpha-value>)",
- warning: "rgb(var(--status-warning) / <alpha-value>)",
- info: "rgb(var(--status-info) / <alpha-value>)",
- },
- background: "rgb(var(--background) / <alpha-value>)",
- card: "rgb(var(--card) / <alpha-value>)",
- },
- fontFamily: {
- sans: ["Open Runde"],
- mono: ["Open Runde"],
- },
- },
- },
- plugins: [],
-};
diff --git a/products/desktop/apps/mobile/tsconfig.json b/products/desktop/apps/mobile/tsconfig.json
deleted file mode 100644
index a293de21ebd2..000000000000
--- a/products/desktop/apps/mobile/tsconfig.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "extends": "expo/tsconfig.base",
- "compilerOptions": {
- "strict": true,
- "baseUrl": "./src",
- "paths": {
- "@/*": ["./*"],
- "@components/*": ["components/*"]
- }
- }
-}
diff --git a/products/desktop/apps/mobile/vitest.config.ts b/products/desktop/apps/mobile/vitest.config.ts
deleted file mode 100644
index 7fab851857c0..000000000000
--- a/products/desktop/apps/mobile/vitest.config.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import path from "node:path";
-import react from "@vitejs/plugin-react";
-import { defineConfig } from "vitest/config";
-import { trunkTestOptions } from "../../vitest.config.base";
-
-export default defineConfig({
- plugins: [react()],
- test: {
- globals: true,
- ...trunkTestOptions,
- environment: "node",
- setupFiles: ["./src/test/setup.ts"],
- exclude: ["**/node_modules/**", "**/dist/**"],
- },
- resolve: {
- alias: {
- "@": path.resolve(__dirname, "./src"),
- "@components": path.resolve(__dirname, "./src/components"),
- },
- },
-});
diff --git a/products/desktop/apps/mobilehog/.gitignore b/products/desktop/apps/mobilehog/.gitignore
deleted file mode 100644
index 4b0a6ea621bb..000000000000
--- a/products/desktop/apps/mobilehog/.gitignore
+++ /dev/null
@@ -1,41 +0,0 @@
-# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files
-
-# dependencies
-node_modules/
-
-# Expo
-.expo/
-dist/
-web-build/
-expo-env.d.ts
-
-# Native
-.kotlin/
-*.orig.*
-*.jks
-*.p8
-*.p12
-*.key
-*.mobileprovision
-
-# Metro
-.metro-health-check*
-
-# debug
-npm-debug.*
-yarn-debug.*
-yarn-error.*
-
-# macOS
-.DS_Store
-*.pem
-
-# local env files
-.env*.local
-
-# typescript
-*.tsbuildinfo
-
-# generated native folders
-/ios/*
-/android
diff --git a/products/desktop/apps/mobilehog/README.md b/products/desktop/apps/mobilehog/README.md
deleted file mode 100644
index b63a30ac45c1..000000000000
--- a/products/desktop/apps/mobilehog/README.md
+++ /dev/null
@@ -1,28 +0,0 @@
-# posthog
-
-A stripped-back Expo app over PostHog cloud tasks, built for a local stack.
-
-## Local stack
-
-In the posthog repo, once:
-
-```bash
-echo 'ALLOW_DEV_API_KEY_REVEAL=1' >> .env
-echo 'SANDBOX_PROVIDER=docker' >> .env
-flox activate -- bash -c "python manage.py setup_local_api_key"
-```
-
-Then restart the stack. The login screen posts email and password to `/api/login/`, reads the seeded local dev personal API key, and uses it as a bearer token from then on.
-
-## Run
-
-```bash
-cd products/desktop
-pnpm install
-pnpm --filter @posthog/mobilehog ios # first build
-pnpm --filter @posthog/mobilehog start # afterwards
-```
-
-The host lives in `src/config.ts`. Use your LAN IP instead of `localhost` on a real phone.
-
-See [posthog release checks](../../../../docs/internal/mobilehog-release-checks.md) before you share a build.
diff --git a/products/desktop/apps/mobilehog/app.json b/products/desktop/apps/mobilehog/app.json
deleted file mode 100644
index ad6ef71cb7a2..000000000000
--- a/products/desktop/apps/mobilehog/app.json
+++ /dev/null
@@ -1,94 +0,0 @@
-{
- "expo": {
- "name": "PostHog",
- "slug": "mobilehog",
- "owner": "posthog",
- "version": "0.1.0",
- "orientation": "portrait",
- "userInterfaceStyle": "automatic",
- "scheme": ["mobilehog", "posthog"],
- "icon": "./assets/app-icon.png",
- "newArchEnabled": true,
- "ios": {
- "supportsTablet": false,
- "bundleIdentifier": "com.posthog.mobilehog",
- "infoPlist": {
- "ITSAppUsesNonExemptEncryption": false,
- "NSAppTransportSecurity": {
- "NSAllowsLocalNetworking": true,
- "NSAllowsArbitraryLoads": true
- }
- }
- },
- "android": {
- "adaptiveIcon": {
- "foregroundImage": "./assets/adaptive-icon.png",
- "backgroundColor": "#FFFFFF"
- },
- "package": "com.posthog.mobilehog"
- },
- "plugins": [
- "expo-router",
- [
- "expo-image-picker",
- {
- "photosPermission": "Allow PostHog to attach photos to your tasks"
- }
- ],
- [
- "expo-speech-recognition",
- {
- "microphonePermission": "Allow PostHog to use the microphone for dictation.",
- "speechRecognitionPermission": "Allow PostHog to turn speech into a message draft."
- }
- ],
- "./plugins/withSceneLifecycle",
- "./plugins/withPodfileResourceBundleFix",
- [
- "expo-font",
- {
- "ios": {
- "fonts": [
- "./assets/fonts/JetBrainsMono-Regular.ttf",
- "./assets/fonts/JetBrainsMono-Medium.ttf"
- ]
- }
- }
- ],
- [
- "expo-notifications",
- {
- "icon": "./assets/logomark.png"
- }
- ],
- "expo-secure-store",
- [
- "expo-splash-screen",
- {
- "image": "./assets/logomark.png",
- "resizeMode": "contain",
- "backgroundColor": "#FFFFFF",
- "imageWidth": 160
- }
- ],
- "expo-status-bar",
- "expo-web-browser",
- "expo-updates"
- ],
- "extra": {
- "router": {},
- "eas": {
- "projectId": "d8e0731d-1107-4421-aa33-abf130eca27f"
- }
- },
- "runtimeVersion": {
- "policy": "fingerprint"
- },
- "updates": {
- "enabled": true,
- "checkAutomatically": "ON_LOAD",
- "fallbackToCacheTimeout": 0,
- "url": "https://u.expo.dev/d8e0731d-1107-4421-aa33-abf130eca27f"
- }
- }
-}
diff --git a/products/desktop/apps/mobilehog/assets/adaptive-icon.png b/products/desktop/apps/mobilehog/assets/adaptive-icon.png
deleted file mode 100644
index c44991ba0846..000000000000
Binary files a/products/desktop/apps/mobilehog/assets/adaptive-icon.png and /dev/null differ
diff --git a/products/desktop/apps/mobilehog/assets/app-icon.png b/products/desktop/apps/mobilehog/assets/app-icon.png
deleted file mode 100644
index c44991ba0846..000000000000
Binary files a/products/desktop/apps/mobilehog/assets/app-icon.png and /dev/null differ
diff --git a/products/desktop/apps/mobilehog/assets/favicon.png b/products/desktop/apps/mobilehog/assets/favicon.png
deleted file mode 100644
index d37491d1692e..000000000000
Binary files a/products/desktop/apps/mobilehog/assets/favicon.png and /dev/null differ
diff --git a/products/desktop/apps/mobilehog/assets/fonts/JetBrainsMono-Medium.ttf b/products/desktop/apps/mobilehog/assets/fonts/JetBrainsMono-Medium.ttf
deleted file mode 100644
index 97671156df25..000000000000
Binary files a/products/desktop/apps/mobilehog/assets/fonts/JetBrainsMono-Medium.ttf and /dev/null differ
diff --git a/products/desktop/apps/mobilehog/assets/fonts/JetBrainsMono-Regular.ttf b/products/desktop/apps/mobilehog/assets/fonts/JetBrainsMono-Regular.ttf
deleted file mode 100644
index dff66cc50702..000000000000
Binary files a/products/desktop/apps/mobilehog/assets/fonts/JetBrainsMono-Regular.ttf and /dev/null differ
diff --git a/products/desktop/apps/mobilehog/assets/fonts/RoundHog-Bold.ttf b/products/desktop/apps/mobilehog/assets/fonts/RoundHog-Bold.ttf
deleted file mode 100644
index 826824542a97..000000000000
Binary files a/products/desktop/apps/mobilehog/assets/fonts/RoundHog-Bold.ttf and /dev/null differ
diff --git a/products/desktop/apps/mobilehog/assets/fonts/RoundHog-Italic.ttf b/products/desktop/apps/mobilehog/assets/fonts/RoundHog-Italic.ttf
deleted file mode 100644
index 71026e03f2d5..000000000000
Binary files a/products/desktop/apps/mobilehog/assets/fonts/RoundHog-Italic.ttf and /dev/null differ
diff --git a/products/desktop/apps/mobilehog/assets/fonts/RoundHog-Medium.ttf b/products/desktop/apps/mobilehog/assets/fonts/RoundHog-Medium.ttf
deleted file mode 100644
index f4bd363f9e11..000000000000
Binary files a/products/desktop/apps/mobilehog/assets/fonts/RoundHog-Medium.ttf and /dev/null differ
diff --git a/products/desktop/apps/mobilehog/assets/fonts/RoundHog-SemiBold.ttf b/products/desktop/apps/mobilehog/assets/fonts/RoundHog-SemiBold.ttf
deleted file mode 100644
index f7e135801cb4..000000000000
Binary files a/products/desktop/apps/mobilehog/assets/fonts/RoundHog-SemiBold.ttf and /dev/null differ
diff --git a/products/desktop/apps/mobilehog/assets/fonts/RoundHog.ttf b/products/desktop/apps/mobilehog/assets/fonts/RoundHog.ttf
deleted file mode 100644
index e5f4e6902074..000000000000
Binary files a/products/desktop/apps/mobilehog/assets/fonts/RoundHog.ttf and /dev/null differ
diff --git a/products/desktop/apps/mobilehog/assets/hedgehog/idle-strip.png b/products/desktop/apps/mobilehog/assets/hedgehog/idle-strip.png
deleted file mode 100644
index 86e055d57e3a..000000000000
Binary files a/products/desktop/apps/mobilehog/assets/hedgehog/idle-strip.png and /dev/null differ
diff --git a/products/desktop/apps/mobilehog/assets/hedgehog/walk-strip.png b/products/desktop/apps/mobilehog/assets/hedgehog/walk-strip.png
deleted file mode 100644
index 2b98588e7a49..000000000000
Binary files a/products/desktop/apps/mobilehog/assets/hedgehog/walk-strip.png and /dev/null differ
diff --git a/products/desktop/apps/mobilehog/assets/hoggies/coding-group.png b/products/desktop/apps/mobilehog/assets/hoggies/coding-group.png
deleted file mode 100644
index 02bec887742d..000000000000
Binary files a/products/desktop/apps/mobilehog/assets/hoggies/coding-group.png and /dev/null differ
diff --git a/products/desktop/apps/mobilehog/assets/hoggies/im-the-driver.png b/products/desktop/apps/mobilehog/assets/hoggies/im-the-driver.png
deleted file mode 100644
index 7eb14253923f..000000000000
Binary files a/products/desktop/apps/mobilehog/assets/hoggies/im-the-driver.png and /dev/null differ
diff --git a/products/desktop/apps/mobilehog/assets/hoggies/remote-work.png b/products/desktop/apps/mobilehog/assets/hoggies/remote-work.png
deleted file mode 100644
index 93a44501dd2a..000000000000
Binary files a/products/desktop/apps/mobilehog/assets/hoggies/remote-work.png and /dev/null differ
diff --git a/products/desktop/apps/mobilehog/assets/logomark.png b/products/desktop/apps/mobilehog/assets/logomark.png
deleted file mode 100644
index 33ed2c697b40..000000000000
Binary files a/products/desktop/apps/mobilehog/assets/logomark.png and /dev/null differ
diff --git a/products/desktop/apps/mobilehog/assets/splash-icon.png b/products/desktop/apps/mobilehog/assets/splash-icon.png
deleted file mode 100644
index 311441d69c81..000000000000
Binary files a/products/desktop/apps/mobilehog/assets/splash-icon.png and /dev/null differ
diff --git a/products/desktop/apps/mobilehog/babel.config.js b/products/desktop/apps/mobilehog/babel.config.js
deleted file mode 100644
index cdd5ccd07d15..000000000000
--- a/products/desktop/apps/mobilehog/babel.config.js
+++ /dev/null
@@ -1,6 +0,0 @@
-module.exports = (api) => {
- api.cache(true);
- return {
- presets: ["babel-preset-expo"],
- };
-};
diff --git a/products/desktop/apps/mobilehog/eas.json b/products/desktop/apps/mobilehog/eas.json
deleted file mode 100644
index cbb4b215537f..000000000000
--- a/products/desktop/apps/mobilehog/eas.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "cli": {
- "version": ">= 16.0.0",
- "appVersionSource": "remote"
- },
- "build": {
- "development": {
- "developmentClient": true,
- "distribution": "internal",
- "channel": "development"
- },
- "preview": {
- "distribution": "internal",
- "channel": "preview"
- },
- "production": {
- "autoIncrement": true,
- "channel": "production"
- }
- },
- "submit": {
- "production": {}
- }
-}
diff --git a/products/desktop/apps/mobilehog/index.js b/products/desktop/apps/mobilehog/index.js
deleted file mode 100644
index 80d3d998f1d0..000000000000
--- a/products/desktop/apps/mobilehog/index.js
+++ /dev/null
@@ -1 +0,0 @@
-import "expo-router/entry";
diff --git a/products/desktop/apps/mobilehog/metro.config.js b/products/desktop/apps/mobilehog/metro.config.js
deleted file mode 100644
index 855936210279..000000000000
--- a/products/desktop/apps/mobilehog/metro.config.js
+++ /dev/null
@@ -1,47 +0,0 @@
-const { getDefaultConfig } = require("expo/metro-config");
-const path = require("node:path");
-
-const projectRoot = __dirname;
-const monorepoRoot = path.resolve(projectRoot, "../..");
-
-const config = getDefaultConfig(projectRoot);
-
-config.transformer.babelTransformerPath = require.resolve(
- "./metro.transformer.js",
-);
-
-config.watchFolders = [monorepoRoot];
-config.resolver.nodeModulesPaths = [
- path.resolve(projectRoot, "node_modules"),
- path.resolve(monorepoRoot, "node_modules"),
-];
-config.resolver.extraNodeModules = {
- react: path.resolve(monorepoRoot, "node_modules/react"),
-};
-
-// @posthog/shared's package exports point at dist/, which only exists after a
-// build. Resolve it to source so Babel transpiles it like the other packages.
-const SHARED_PACKAGE = "@posthog/shared";
-const sharedSrc = path.resolve(monorepoRoot, "packages/shared/src");
-const upstreamResolveRequest = config.resolver.resolveRequest;
-
-config.resolver.resolveRequest = (context, moduleName, platform) => {
- if (
- moduleName === SHARED_PACKAGE ||
- moduleName.startsWith(`${SHARED_PACKAGE}/`)
- ) {
- const subpath = moduleName.slice(SHARED_PACKAGE.length + 1) || "index";
- return context.resolveRequest(
- context,
- path.join(sharedSrc, subpath),
- platform,
- );
- }
- return (upstreamResolveRequest ?? context.resolveRequest)(
- context,
- moduleName,
- platform,
- );
-};
-
-module.exports = config;
diff --git a/products/desktop/apps/mobilehog/metro.transformer.js b/products/desktop/apps/mobilehog/metro.transformer.js
deleted file mode 100644
index e04bef64a1c5..000000000000
--- a/products/desktop/apps/mobilehog/metro.transformer.js
+++ /dev/null
@@ -1,25 +0,0 @@
-const path = require("node:path");
-
-const upstream = require(
- require.resolve("@expo/metro-config/babel-transformer", {
- paths: [path.dirname(require.resolve("expo/package.json"))],
- }),
-);
-
-// The WebView gets mermaid's browser bundle as text. Exporting it as a string
-// keeps Hermes from running a DOM library and keeps it out of startup until a
-// diagram requires it.
-const RAW_MODULES = [path.join("mermaid", "dist", "mermaid.min.js")];
-
-module.exports = {
- ...upstream,
- transform(props) {
- if (RAW_MODULES.some((suffix) => props.filename.endsWith(suffix))) {
- return upstream.transform({
- ...props,
- src: `module.exports = ${JSON.stringify(props.src)};`,
- });
- }
- return upstream.transform(props);
- },
-};
diff --git a/products/desktop/apps/mobilehog/package.json b/products/desktop/apps/mobilehog/package.json
deleted file mode 100644
index b45e5a764e4d..000000000000
--- a/products/desktop/apps/mobilehog/package.json
+++ /dev/null
@@ -1,88 +0,0 @@
-{
- "name": "@posthog/mobilehog",
- "version": "0.1.0",
- "main": "./index.js",
- "scripts": {
- "start": "expo start",
- "start:clear": "expo start --clear",
- "ios": "expo run:ios",
- "prebuild": "expo prebuild",
- "prebuild:clean": "expo prebuild --clean",
- "typecheck": "tsc --noEmit",
- "test": "vitest run",
- "lint": "biome check .",
- "lint:fix": "biome check --write .",
- "clean": "node ../../scripts/rimraf.mjs .turbo .expo"
- },
- "expo": {
- "autolinking": {
- "buildFromSource": [
- "react-native-worklets"
- ]
- },
- "install": {
- "exclude": [
- "react",
- "react-dom",
- "typescript"
- ]
- }
- },
- "dependencies": {
- "@expo/metro-runtime": "~57.0.15",
- "@expo/ui": "~57.0.7",
- "@modelcontextprotocol/ext-apps": "^1.2.2",
- "@modelcontextprotocol/sdk": "^1.29.0",
- "@posthog/api-client": "workspace:*",
- "@posthog/brand": "catalog:",
- "@posthog/core": "workspace:*",
- "@posthog/shared": "workspace:*",
- "@shopify/flash-list": "2.0.2",
- "@tanstack/query-sync-storage-persister": "5.101.0",
- "@tanstack/react-query": "^5.90.12",
- "@tanstack/react-query-persist-client": "5.101.0",
- "expo": "57.0.23",
- "expo-auth-session": "~57.0.5",
- "expo-constants": "~57.0.18",
- "expo-crypto": "~57.0.1",
- "expo-dev-client": "~57.0.19",
- "expo-device": "~57.0.2",
- "expo-file-system": "~57.0.7",
- "expo-font": "~57.0.4",
- "expo-glass-effect": "~57.0.3",
- "expo-haptics": "~57.0.3",
- "expo-image-picker": "~57.0.6",
- "expo-linking": "~57.0.10",
- "expo-network": "~57.0.2",
- "expo-notifications": "~57.0.19",
- "expo-router": "~57.0.21",
- "expo-secure-store": "~57.0.4",
- "expo-speech-recognition": "56.0.1",
- "expo-splash-screen": "~57.0.9",
- "expo-status-bar": "~57.0.1",
- "expo-system-ui": "~57.0.4",
- "expo-updates": "~57.0.22",
- "expo-web-browser": "~57.0.2",
- "marked": "16.4.2",
- "mermaid": "^11.17.0",
- "react": "catalog:",
- "react-dom": "catalog:",
- "react-native": "0.86.0",
- "react-native-gesture-handler": "~2.32.0",
- "react-native-keyboard-controller": "1.21.9",
- "react-native-mmkv": "4.3.2",
- "react-native-nitro-modules": "0.37.1",
- "react-native-reanimated": "~4.5.0",
- "react-native-safe-area-context": "~5.7.0",
- "react-native-screens": "~4.26.2",
- "react-native-webview": "13.16.1",
- "react-native-worklets": "0.10.0",
- "zustand": "^4.5.7"
- },
- "devDependencies": {
- "@types/react": "^19.2.0",
- "typescript": "~5.9.2",
- "vitest": "^4.1.8"
- },
- "private": true
-}
diff --git a/products/desktop/apps/mobilehog/plugins/withPodfileResourceBundleFix.js b/products/desktop/apps/mobilehog/plugins/withPodfileResourceBundleFix.js
deleted file mode 100644
index fb2a190bdffa..000000000000
--- a/products/desktop/apps/mobilehog/plugins/withPodfileResourceBundleFix.js
+++ /dev/null
@@ -1,99 +0,0 @@
-// Xcode 14+ refuses to build resource-bundle targets that don't have a
-// development team set. Several common Pods (react-native-svg in
-// particular) ship bundles without a team and break EAS builds with:
-//
-// "Starting from Xcode 14, resource bundles are signed by default,
-// which requires setting the development team for each resource
-// bundle target."
-//
-// Disabling code signing for those bundle targets is the standard
-// workaround — they don't actually need to be signed because the host
-// app's signature covers them at runtime.
-//
-// Injecting this via a config plugin (instead of hand-editing Podfile)
-// means `expo prebuild --clean` won't wipe the fix.
-
-const { withDangerousMod } = require("@expo/config-plugins");
-const fs = require("node:fs");
-const path = require("node:path");
-
-const MARKER = "# CODE_SIGNING_ALLOWED resource-bundle fix";
-
-const POST_INSTALL_SNIPPET = `
- ${MARKER}
- installer.pods_project.targets.each do |target|
- if target.respond_to?(:product_type) && target.product_type == "com.apple.product-type.bundle"
- target.build_configurations.each do |config|
- config.build_settings["CODE_SIGNING_ALLOWED"] = "NO"
- end
- end
- end
-`;
-
-const withPodfileResourceBundleFix = (config) =>
- withDangerousMod(config, [
- "ios",
- async (cfg) => {
- const podfilePath = path.join(
- cfg.modRequest.platformProjectRoot,
- "Podfile",
- );
- const contents = fs.readFileSync(podfilePath, "utf8");
-
- if (contents.includes(MARKER)) {
- return cfg;
- }
-
- // Inject the snippet at the END of the existing post_install block.
- // The block opens with `post_install do |installer|` and closes at
- // the matching `end` — we find the closing `end` of that block by
- // tracking nesting depth.
- const startMatch = contents.match(/post_install do \|installer\|/);
- if (!startMatch) {
- throw new Error(
- "[withPodfileResourceBundleFix] could not find a post_install block to patch",
- );
- }
- const startIdx = startMatch.index + startMatch[0].length;
- const lines = contents.slice(startIdx).split("\n");
- let depth = 1;
- let endLineOffset = -1;
- for (let i = 0; i < lines.length; i++) {
- const line = lines[i].trim();
- // crude but sufficient for the generated Podfile shape
- if (
- /\bdo\b/.test(line) ||
- /^(if|begin|case|class|def|module)\b/.test(line)
- ) {
- depth += 1;
- }
- if (/^end\b/.test(line)) {
- depth -= 1;
- if (depth === 0) {
- endLineOffset = i;
- break;
- }
- }
- }
- if (endLineOffset === -1) {
- throw new Error(
- "[withPodfileResourceBundleFix] could not find the end of the post_install block",
- );
- }
-
- // Insert our snippet just before that closing `end`.
- const insertAt =
- startIdx +
- lines.slice(0, endLineOffset).join("\n").length +
- (endLineOffset > 0 ? 1 : 0);
- const patched =
- contents.slice(0, insertAt) +
- POST_INSTALL_SNIPPET +
- contents.slice(insertAt);
-
- fs.writeFileSync(podfilePath, patched, "utf8");
- return cfg;
- },
- ]);
-
-module.exports = withPodfileResourceBundleFix;
diff --git a/products/desktop/apps/mobilehog/plugins/withSceneLifecycle.js b/products/desktop/apps/mobilehog/plugins/withSceneLifecycle.js
deleted file mode 100644
index fea83d233585..000000000000
--- a/products/desktop/apps/mobilehog/plugins/withSceneLifecycle.js
+++ /dev/null
@@ -1,65 +0,0 @@
-// Xcode 27's SDK refuses to launch apps that do not adopt the UIScene life
-// cycle. Expo 57.0.23 ships `ExpoAppSceneDelegate` but no plugin release yet,
-// so this mirrors @config-plugins/expo-uiscene-lifecycle: the AppDelegate
-// exposes its factory and the scene delegate creates the window.
-const { withDangerousMod, withInfoPlist } = require("@expo/config-plugins");
-const fs = require("node:fs");
-const path = require("node:path");
-
-const CLASS_LINE = "class AppDelegate: ExpoAppDelegate {";
-const SCENE_CLASS_LINE =
- "class AppDelegate: ExpoAppDelegate, ExpoReactNativeFactoryProvider {";
-
-function patchAppDelegate(source) {
- if (source.includes(SCENE_CLASS_LINE)) return source;
- if (!source.includes(CLASS_LINE)) {
- throw new Error(
- "withSceneLifecycle: AppDelegate.swift is not the Expo 57 template",
- );
- }
- let out = source.replace(CLASS_LINE, SCENE_CLASS_LINE);
- out = out.replace(
- /\n\s*window = UIWindow\(frame: UIScreen\.main\.bounds\)\n/,
- "\n",
- );
- out = out.replace(
- /\n\s*factory\.startReactNative\(\s*withModuleName: "main",\s*in: window,\s*launchOptions: launchOptions\)\n/,
- "\n",
- );
- if (out.includes("startReactNative(")) {
- throw new Error(
- "withSceneLifecycle: could not remove the AppDelegate React Native start",
- );
- }
- return out;
-}
-
-module.exports = function withSceneLifecycle(config) {
- config = withInfoPlist(config, (mod) => {
- mod.modResults.UIApplicationSceneManifest = {
- UIApplicationSupportsMultipleScenes: false,
- UISceneConfigurations: {
- UIWindowSceneSessionRoleApplication: [
- {
- UISceneConfigurationName: "Default Configuration",
- UISceneDelegateClassName: "EXExpoAppSceneDelegate",
- },
- ],
- },
- };
- return mod;
- });
-
- return withDangerousMod(config, [
- "ios",
- (mod) => {
- const file = path.join(
- mod.modRequest.platformProjectRoot,
- mod.modRequest.projectName,
- "AppDelegate.swift",
- );
- fs.writeFileSync(file, patchAppDelegate(fs.readFileSync(file, "utf8")));
- return mod;
- },
- ]);
-};
diff --git a/products/desktop/apps/mobilehog/src/app/(drawer)/_layout.tsx b/products/desktop/apps/mobilehog/src/app/(drawer)/_layout.tsx
deleted file mode 100644
index 4e3906aa055c..000000000000
--- a/products/desktop/apps/mobilehog/src/app/(drawer)/_layout.tsx
+++ /dev/null
@@ -1,46 +0,0 @@
-import { Drawer, useDrawerStatus } from "expo-router/drawer";
-import { useEffect } from "react";
-import { Keyboard } from "react-native";
-import { DrawerContent } from "@/components/DrawerContent";
-import { colors, drawer } from "@/lib/theme";
-
-// The drawer only hides the keyboard on a swipe, and its screens stay mounted,
-// so a focused composer kept the keyboard up over the drawer and the next screen.
-function DismissKeyboardOnOpen(): null {
- const open = useDrawerStatus() === "open";
- useEffect(() => {
- if (open) Keyboard.dismiss();
- }, [open]);
- return null;
-}
-
-export default function DrawerLayout() {
- return (
- <Drawer
- drawerContent={(props) => (
- <>
- <DismissKeyboardOnOpen />
- <DrawerContent closeDrawer={() => props.navigation.closeDrawer()} />
- </>
- )}
- screenListeners={{ blur: () => Keyboard.dismiss() }}
- screenOptions={{
- headerShown: false,
- drawerType: "back",
- overlayColor: "transparent",
- drawerStyle: {
- width: `${drawer.widthFraction * 100}%`,
- backgroundColor: colors.bgDeep,
- },
- sceneStyle: { backgroundColor: "transparent" },
- swipeEdgeWidth: 60,
- }}
- >
- <Drawer.Screen name="index" />
- <Drawer.Screen name="task/[id]" />
- <Drawer.Screen name="activity" />
- <Drawer.Screen name="self-driving" />
- <Drawer.Screen name="recents" />
- </Drawer>
- );
-}
diff --git a/products/desktop/apps/mobilehog/src/app/(drawer)/activity.tsx b/products/desktop/apps/mobilehog/src/app/(drawer)/activity.tsx
deleted file mode 100644
index 6670955bfdf0..000000000000
--- a/products/desktop/apps/mobilehog/src/app/(drawer)/activity.tsx
+++ /dev/null
@@ -1,271 +0,0 @@
-import { useNavigation, useRouter } from "expo-router";
-import { useMemo, useState } from "react";
-import {
- Pressable,
- ScrollView,
- StyleSheet,
- Switch,
- Text,
- TextInput,
- View,
-} from "react-native";
-import { useSafeAreaInsets } from "react-native-safe-area-context";
-import { DrawerScene } from "@/components/DrawerScene";
-import { Glass, GlassCircleButton } from "@/components/Glass";
-import { MenuIcon } from "@/components/Icons";
-import {
- type ActivityRow,
- groupByDay,
- toRows,
- useActivity,
- useMarkActivityRead,
-} from "@/lib/activity";
-import { useAuth } from "@/lib/auth";
-import { colors, fonts, radius } from "@/lib/theme";
-
-function AgentGlyph({ icon }: { icon: NonNullable<ActivityRow["icon"]> }) {
- const glyph = icon === "check" ? "✓" : icon === "question" ? "?" : "…";
- return (
- <View style={[styles.glyph, icon === "check" && styles.glyphAccent]}>
- <Text
- style={[styles.glyphText, icon === "check" && styles.glyphTextAccent]}
- >
- {glyph}
- </Text>
- </View>
- );
-}
-
-export default function ActivityScreen() {
- const router = useRouter();
- const navigation = useNavigation<{ openDrawer: () => void }>();
- const insets = useSafeAreaInsets();
- const email = useAuth((s) => s.session?.email ?? null);
- const name = useAuth((s) => s.session?.userName ?? null);
- const activity = useActivity();
- const markRead = useMarkActivityRead();
- const [unreadsOnly, setUnreadsOnly] = useState(false);
- const [query, setQuery] = useState("");
-
- const groups = useMemo(() => {
- const needle = query.trim().toLowerCase();
- const rows = toRows(activity.data, email, name).filter(
- (row) =>
- (!unreadsOnly || row.item.isUnread) &&
- (!needle || row.item.taskTitle.toLowerCase().includes(needle)),
- );
- return groupByDay(rows);
- }, [activity.data, email, name, unreadsOnly, query]);
-
- const open = (row: ActivityRow): void => {
- if (row.item.isUnread) markRead.mutate(row.item);
- router.push({
- pathname: "/(drawer)/task/[id]",
- params: { id: row.item.taskId },
- });
- };
-
- return (
- <DrawerScene>
- <View style={[styles.header, { paddingTop: insets.top + 6 }]}>
- <GlassCircleButton onPress={() => navigation.openDrawer()}>
- <MenuIcon />
- </GlassCircleButton>
- <Text style={styles.title}>Activity</Text>
- <View style={styles.unreads}>
- <Text style={styles.unreadsLabel}>Unreads</Text>
- <Switch
- value={unreadsOnly}
- onValueChange={setUnreadsOnly}
- trackColor={{ true: colors.accent }}
- />
- </View>
- </View>
- <ScrollView
- contentContainerStyle={[
- styles.scroll,
- { paddingBottom: insets.bottom + 24 },
- ]}
- keyboardDismissMode="on-drag"
- >
- <Glass style={styles.search}>
- <TextInput
- value={query}
- onChangeText={setQuery}
- placeholder="Search activity"
- placeholderTextColor={colors.inkMute}
- style={styles.searchInput}
- autoCorrect={false}
- />
- </Glass>
- {groups.length === 0 ? (
- <Text style={styles.empty}>
- {activity.isLoading ? "Loading" : "Nothing here"}
- </Text>
- ) : null}
- {groups.map((group) => (
- <View key={group.label} style={styles.group}>
- <Text style={styles.groupTitle}>{group.label}</Text>
- {group.rows.map((row) => (
- <Pressable
- key={row.item.id}
- onPress={() => open(row)}
- style={({ pressed }) => [
- styles.row,
- pressed && { opacity: 0.5 },
- ]}
- >
- {row.icon ? (
- <AgentGlyph icon={row.icon} />
- ) : (
- <View style={styles.avatar}>
- <Text style={styles.avatarText}>{row.initials}</Text>
- </View>
- )}
- <View style={styles.body}>
- <Text
- style={[
- styles.rowTitle,
- row.item.isUnread && styles.rowTitleUnread,
- ]}
- numberOfLines={1}
- >
- {row.item.taskTitle}
- </Text>
- <View style={styles.metaRow}>
- <Text style={styles.meta} numberOfLines={1}>
- {row.metadata}
- </Text>
- {row.space ? (
- <Text style={styles.spaceChip} numberOfLines={1}>
- {row.space}
- </Text>
- ) : null}
- </View>
- {row.item.snippet ? (
- <Text style={styles.snippet} numberOfLines={2}>
- {row.item.snippet}
- </Text>
- ) : null}
- </View>
- {row.item.isUnread ? <View style={styles.unreadDot} /> : null}
- </Pressable>
- ))}
- </View>
- ))}
- </ScrollView>
- </DrawerScene>
- );
-}
-
-const styles = StyleSheet.create({
- header: {
- flexDirection: "row",
- alignItems: "center",
- gap: 12,
- paddingHorizontal: 16,
- paddingBottom: 8,
- },
- title: {
- flex: 1,
- fontFamily: fonts.sansBold,
- fontSize: 26,
- color: colors.ink,
- },
- unreads: { flexDirection: "row", alignItems: "center", gap: 8 },
- unreadsLabel: { fontFamily: fonts.sans, fontSize: 15, color: colors.inkSoft },
- scroll: { paddingHorizontal: 16, gap: 18, paddingTop: 6 },
- search: {
- borderRadius: radius.pill,
- paddingHorizontal: 16,
- overflow: "hidden",
- },
- searchInput: {
- fontFamily: fonts.sans,
- fontSize: 16,
- color: colors.ink,
- paddingVertical: 12,
- },
- empty: {
- fontFamily: fonts.sans,
- fontSize: 14,
- color: colors.inkMute,
- paddingTop: 12,
- },
- group: { gap: 2 },
- groupTitle: {
- fontFamily: fonts.sansSemi,
- fontSize: 12,
- letterSpacing: 1.2,
- textTransform: "uppercase",
- color: colors.inkMute,
- marginBottom: 6,
- marginLeft: 4,
- },
- row: {
- flexDirection: "row",
- alignItems: "flex-start",
- gap: 12,
- paddingVertical: 10,
- paddingHorizontal: 4,
- },
- glyph: {
- width: 30,
- height: 30,
- borderRadius: 8,
- backgroundColor: colors.surface,
- alignItems: "center",
- justifyContent: "center",
- marginTop: 2,
- },
- glyphAccent: { backgroundColor: colors.accent },
- glyphText: {
- fontFamily: fonts.sansBold,
- fontSize: 14,
- color: colors.inkSoft,
- },
- glyphTextAccent: { color: "#FFFFFF" },
- avatar: {
- width: 30,
- height: 30,
- borderRadius: 8,
- backgroundColor: colors.bgDeep,
- alignItems: "center",
- justifyContent: "center",
- marginTop: 2,
- },
- avatarText: { fontFamily: fonts.sansBold, fontSize: 11, color: colors.ink },
- body: { flex: 1, gap: 2 },
- rowTitle: { fontFamily: fonts.sansMedium, fontSize: 16, color: colors.ink },
- rowTitleUnread: { fontFamily: fonts.sansSemi },
- metaRow: { flexDirection: "row", alignItems: "center", gap: 6 },
- meta: {
- flexShrink: 1,
- fontFamily: fonts.sans,
- fontSize: 13,
- color: colors.inkMute,
- },
- spaceChip: {
- fontFamily: fonts.sansMedium,
- fontSize: 12,
- color: colors.inkSoft,
- backgroundColor: colors.bgDeep,
- paddingHorizontal: 6,
- paddingVertical: 2,
- borderRadius: 5,
- overflow: "hidden",
- },
- snippet: {
- fontFamily: fonts.sans,
- fontSize: 14,
- color: colors.inkSoft,
- marginTop: 2,
- },
- unreadDot: {
- width: 8,
- height: 8,
- borderRadius: 4,
- backgroundColor: colors.accent,
- marginTop: 8,
- },
-});
diff --git a/products/desktop/apps/mobilehog/src/app/(drawer)/index.tsx b/products/desktop/apps/mobilehog/src/app/(drawer)/index.tsx
deleted file mode 100644
index aa85ae152c19..000000000000
--- a/products/desktop/apps/mobilehog/src/app/(drawer)/index.tsx
+++ /dev/null
@@ -1,117 +0,0 @@
-import { useRouter } from "expo-router";
-import { StyleSheet, Text, View } from "react-native";
-import {
- KeyboardStickyView,
- useReanimatedKeyboardAnimation,
-} from "react-native-keyboard-controller";
-import Animated, { useAnimatedStyle } from "react-native-reanimated";
-import { useSafeAreaInsets } from "react-native-safe-area-context";
-import { ChatHeader } from "@/components/ChatHeader";
-import { Composer } from "@/components/Composer";
-import { DrawerScene } from "@/components/DrawerScene";
-import { Logomark } from "@/components/Icons";
-import type { Photo } from "@/lib/attachments";
-import { sessionIdentity, useAuth } from "@/lib/auth";
-import { moveDraft, NEW_CHAT_DRAFT } from "@/lib/cache";
-import {
- createAndRunTask,
- useDefaultRepository,
- useInvalidateTasks,
-} from "@/lib/queries";
-import { useSessions } from "@/lib/session";
-import { colors, fonts } from "@/lib/theme";
-
-export default function NewChatScreen() {
- const router = useRouter();
- const insets = useSafeAreaInsets();
- const userName = useAuth((s) => s.session?.userName ?? "");
- const repository = useDefaultRepository();
- const invalidateTasks = useInvalidateTasks();
- // Keep the greeting centred in the space the keyboard leaves. The reported
- // height covers the bottom inset too, which the composer already occupied.
- const keyboard = useReanimatedKeyboardAnimation();
- const bottomInset = insets.bottom;
- const hero = useAnimatedStyle(() => ({
- transform: [
- {
- translateY: Math.min(0, keyboard.height.value + bottomInset) / 2,
- },
- ],
- }));
-
- // Open the chat immediately with the message in it; the task and its run
- // are created behind that screen, then the chat is re-keyed to the real id.
- const send = async (text: string, photos: Photo[]): Promise<void> => {
- const identity = sessionIdentity();
- const tempId = `new-${Date.now()}`;
- const { startPending, adopt, failPending } = useSessions.getState();
- startPending(
- tempId,
- text,
- `local-${Date.now()}`,
- photos.length ? photos.map((photo) => photo.uri) : undefined,
- );
- router.replace({ pathname: "/(drawer)/task/[id]", params: { id: tempId } });
- try {
- const task = await createAndRunTask({
- prompt: text,
- repository: repository.data ?? null,
- photos,
- });
- if (sessionIdentity() !== identity) return;
- adopt(tempId, task);
- moveDraft(tempId, task.id);
- invalidateTasks();
- router.replace({
- pathname: "/(drawer)/task/[id]",
- params: { id: task.id },
- });
- } catch (err) {
- if (sessionIdentity() !== identity) return;
- failPending(tempId, err instanceof Error ? err.message : String(err));
- // The placeholder chat cannot resend, so give the message back to the
- // new-chat composer.
- throw err;
- }
- };
-
- return (
- <DrawerScene>
- <ChatHeader showNewChat={false} />
- <Animated.View style={[styles.center, hero]}>
- <Logomark />
- <Text style={styles.greeting}>
- {userName ? `${userName} returns!` : "G'day"}
- </Text>
- </Animated.View>
- <KeyboardStickyView offset={{ closed: 0, opened: insets.bottom }}>
- <View style={[styles.composer, { paddingBottom: insets.bottom + 8 }]}>
- <Composer
- placeholder="Chat with PostHog"
- repository={repository.data ?? null}
- onSend={send}
- autoFocus
- draftKey={NEW_CHAT_DRAFT}
- />
- </View>
- </KeyboardStickyView>
- </DrawerScene>
- );
-}
-
-const styles = StyleSheet.create({
- center: {
- flex: 1,
- alignItems: "center",
- justifyContent: "center",
- gap: 8,
- paddingHorizontal: 32,
- },
- greeting: {
- fontFamily: fonts.serif,
- fontSize: 30,
- color: colors.ink,
- textAlign: "center",
- },
- composer: { paddingHorizontal: 12 },
-});
diff --git a/products/desktop/apps/mobilehog/src/app/(drawer)/recents.tsx b/products/desktop/apps/mobilehog/src/app/(drawer)/recents.tsx
deleted file mode 100644
index d9d7d0e3a32c..000000000000
--- a/products/desktop/apps/mobilehog/src/app/(drawer)/recents.tsx
+++ /dev/null
@@ -1,447 +0,0 @@
-import { Button, Host, Image, Menu } from "@expo/ui/swift-ui";
-import { frame, glassEffect } from "@expo/ui/swift-ui/modifiers";
-import type { SignalReport, Task } from "@posthog/shared/domain-types";
-import { FlashList } from "@shopify/flash-list";
-import { useQueries } from "@tanstack/react-query";
-import { useFocusEffect, useNavigation, useRouter } from "expo-router";
-import { useCallback, useEffect, useMemo, useRef, useState } from "react";
-import { Pressable, StyleSheet, Text, TextInput, View } from "react-native";
-import { KeyboardStickyView } from "react-native-keyboard-controller";
-import Animated, {
- FadeIn,
- FadeInDown,
- FadeOut,
- FadeOutDown,
- LinearTransition,
- ZoomIn,
- ZoomOut,
-} from "react-native-reanimated";
-import { useSafeAreaInsets } from "react-native-safe-area-context";
-import { DrawerScene } from "@/components/DrawerScene";
-import { FadeScrim } from "@/components/FadeScrim";
-import { Glass, GlassCircleButton } from "@/components/Glass";
-import { MenuIcon } from "@/components/Icons";
-import {
- activityAt,
- ChatRow,
- RowSkeletons,
- TaskChatRow,
-} from "@/components/TaskRow";
-import { useAuth } from "@/lib/auth";
-import { getClient } from "@/lib/client";
-import { lastOpened, loadOpened } from "@/lib/openedChats";
-import { keys, useTaskPages, useTasks } from "@/lib/queries";
-import { useReports } from "@/lib/reports";
-import { colors, fonts, radius } from "@/lib/theme";
-
-type Scope = "all" | "tasks" | "reports" | "archived";
-
-type Item =
- | { kind: "task"; id: string; time: string; task: Task }
- | { kind: "report"; id: string; time: string; report: SignalReport };
-
-const SCOPES = [
- { value: "all", label: "All", icon: "bubble.left.and.bubble.right" },
- { value: "tasks", label: "Tasks", icon: "bubble.left" },
- { value: "reports", label: "Self-driving", icon: "steeringwheel" },
- { value: "archived", label: "Archived", icon: "archivebox" },
-] as const;
-
-const HEADER_HEIGHT = 64;
-const LAST_OPENED_LIMIT = 8;
-
-function foundTasks(results: { data?: Task; isLoading: boolean }[]) {
- return {
- data: results.flatMap((result) => (result.data ? [result.data] : [])),
- isLoading: results.some((result) => result.isLoading),
- };
-}
-
-// Opened chats the recent page does not hold. Failed lookups (deleted tasks)
-// are left out.
-function useOpenedTasks(ids: readonly string[]) {
- const session = useAuth((s) => s.session);
- return useQueries({
- queries: ids.map((id) => ({
- queryKey: keys.task(id),
- queryFn: () => getClient().getTask(id),
- enabled: !!session,
- staleTime: 60_000,
- })),
- combine: foundTasks,
- });
-}
-
-function useDebounced(value: string, delay: number): string {
- const [debounced, setDebounced] = useState(value);
- useEffect(() => {
- const timer = setTimeout(() => setDebounced(value), delay);
- return () => clearTimeout(timer);
- }, [value, delay]);
- return debounced;
-}
-
-export default function RecentsScreen() {
- const router = useRouter();
- const navigation = useNavigation<{ openDrawer: () => void }>();
- const insets = useSafeAreaInsets();
- const input = useRef<TextInput>(null);
- const [searching, setSearching] = useState(false);
- const [query, setQuery] = useState("");
- const [scope, setScope] = useState<Scope>("all");
- const search = useDebounced(query.trim(), 250);
- const archived = scope === "archived";
- const recentMode = !search && scope === "all";
- const showReports = !recentMode && (scope === "all" || scope === "reports");
- const tasks = useTaskPages(search, archived);
- const reports = useReports(search);
- const recentTasks = useTasks();
- const [opened, setOpened] = useState(loadOpened);
- useFocusEffect(useCallback(() => setOpened(loadOpened()), []));
- // The recent page holds at most one page of tasks, so a chat opened from an
- // older search result is fetched on its own.
- const missing = useMemo(() => {
- if (!recentMode || !recentTasks.data) return [];
- const inPage = new Set(recentTasks.data.map((task) => task.id));
- return opened.slice(0, LAST_OPENED_LIMIT).filter((id) => !inPage.has(id));
- }, [recentMode, recentTasks.data, opened]);
- const openedTasks = useOpenedTasks(missing);
-
- const items = useMemo(() => {
- if (recentMode) {
- const recent = [...(recentTasks.data ?? [])].sort((a, b) =>
- activityAt(b).localeCompare(activityAt(a)),
- );
- return lastOpened(
- opened,
- recent,
- openedTasks.data,
- LAST_OPENED_LIMIT,
- ).map(
- (task): Item => ({
- kind: "task",
- id: task.id,
- time: activityAt(task),
- task,
- }),
- );
- }
- const list: Item[] = [];
- if (scope !== "reports") {
- for (const task of tasks.data?.pages.flatMap((page) => page.visible) ??
- []) {
- list.push({ kind: "task", id: task.id, time: activityAt(task), task });
- }
- }
- if (showReports) {
- for (const report of reports.data ?? []) {
- list.push({
- kind: "report",
- id: report.id,
- time: report.updated_at,
- report,
- });
- }
- }
- return list.sort((a, b) => b.time.localeCompare(a.time));
- }, [
- recentMode,
- recentTasks.data,
- openedTasks.data,
- opened,
- scope,
- showReports,
- tasks.data,
- reports.data,
- ]);
-
- const loading = recentMode
- ? recentTasks.isLoading || openedTasks.isLoading
- : (scope !== "reports" && tasks.isLoading) ||
- (showReports && reports.isLoading);
-
- const closeSearch = (): void => {
- setQuery("");
- input.current?.blur();
- setSearching(false);
- };
-
- const top = insets.top + HEADER_HEIGHT;
-
- return (
- <DrawerScene>
- <FlashList
- data={items}
- keyExtractor={(item) => `${item.kind}-${item.id}`}
- getItemType={(item) => item.kind}
- renderItem={({ item }) =>
- item.kind === "task" ? (
- <TaskChatRow
- task={item.task}
- archived={archived}
- onPress={() =>
- router.push({
- pathname: "/(drawer)/task/[id]",
- params: { id: item.id },
- })
- }
- />
- ) : (
- <ChatRow
- icon="steeringwheel"
- title={item.report.title ?? "Untitled report"}
- snippet="Report"
- onPress={() =>
- router.push({
- pathname: "/report/[id]",
- params: { id: item.id },
- })
- }
- />
- )
- }
- contentContainerStyle={{
- paddingTop: top,
- paddingBottom: insets.bottom + 140,
- paddingHorizontal: 18,
- }}
- ListHeaderComponent={
- recentMode && items.length > 0 ? (
- <Text style={styles.section}>Last opened</Text>
- ) : null
- }
- onEndReached={() => {
- if (
- !recentMode &&
- scope !== "reports" &&
- tasks.hasNextPage &&
- !tasks.isFetching
- ) {
- void tasks.fetchNextPage();
- }
- }}
- onEndReachedThreshold={0.5}
- ListFooterComponent={
- tasks.isFetchingNextPage && !recentMode ? (
- <RowSkeletons count={2} chat />
- ) : null
- }
- keyboardDismissMode="on-drag"
- keyboardShouldPersistTaps="handled"
- />
- {loading && items.length === 0 ? (
- <View style={[styles.overlay, { top }]} pointerEvents="none">
- <RowSkeletons chat />
- </View>
- ) : null}
- {!loading && items.length === 0 ? (
- <Text style={[styles.empty, { top: top + 12 }]}>
- {search ? `Nothing matches “${search}”` : "Nothing here yet"}
- </Text>
- ) : null}
- <FadeScrim
- style={[styles.topScrim, { height: top + 8 }]}
- color={colors.bg}
- />
- {searching ? null : (
- <Animated.View
- entering={FadeIn.duration(220)}
- exiting={FadeOut.duration(160)}
- style={[styles.header, { paddingTop: insets.top + 6 }]}
- pointerEvents="box-none"
- >
- <GlassCircleButton onPress={() => navigation.openDrawer()}>
- <MenuIcon />
- </GlassCircleButton>
- <Text style={styles.title}>Search</Text>
- <Host matchContents>
- <Menu
- label={
- <Image
- systemName="slider.horizontal.3"
- size={18}
- color={colors.ink}
- />
- }
- modifiers={[
- frame({ width: 46, height: 46 }),
- glassEffect({
- glass: { variant: "regular", interactive: true },
- shape: "circle",
- }),
- ]}
- >
- {SCOPES.map((option) => (
- <Button
- key={option.value}
- label={option.label}
- systemImage={
- scope === option.value ? "checkmark" : option.icon
- }
- onPress={() => setScope(option.value)}
- />
- ))}
- </Menu>
- </Host>
- </Animated.View>
- )}
- <KeyboardStickyView
- style={styles.dock}
- offset={{ closed: 0, opened: insets.bottom }}
- >
- <FadeScrim style={styles.bottomScrim} color={colors.bg} />
- <View style={{ paddingBottom: insets.bottom + 8 }}>
- {searching ? null : (
- <Animated.View
- entering={FadeInDown.duration(240)}
- exiting={FadeOutDown.duration(160)}
- style={styles.newTaskWrap}
- >
- <Pressable
- onPress={() => router.replace("/(drawer)")}
- style={({ pressed }) => [
- styles.newTask,
- pressed && { opacity: 0.8 },
- ]}
- >
- <Text style={styles.newTaskPlus}>+</Text>
- <Text style={styles.newTaskText}>New task</Text>
- </Pressable>
- </Animated.View>
- )}
- <View style={styles.searchRow}>
- <Animated.View
- layout={LinearTransition.duration(220)}
- style={styles.searchFlex}
- >
- <Glass interactive style={styles.searchBar}>
- <Host matchContents>
- <Image
- systemName="magnifyingglass"
- size={17}
- color={colors.inkSoft}
- />
- </Host>
- <TextInput
- ref={input}
- value={query}
- onChangeText={setQuery}
- onFocus={() => setSearching(true)}
- placeholder="Search"
- placeholderTextColor={colors.inkMute}
- autoCorrect={false}
- returnKeyType="search"
- clearButtonMode="while-editing"
- style={styles.searchInput}
- />
- </Glass>
- </Animated.View>
- {searching ? (
- <Animated.View
- entering={ZoomIn.duration(200)}
- exiting={ZoomOut.duration(160)}
- >
- <GlassCircleButton size={50} onPress={closeSearch}>
- <Host matchContents>
- <Image systemName="xmark" size={18} color={colors.ink} />
- </Host>
- </GlassCircleButton>
- </Animated.View>
- ) : null}
- </View>
- </View>
- </KeyboardStickyView>
- </DrawerScene>
- );
-}
-
-const styles = StyleSheet.create({
- header: {
- position: "absolute",
- top: 0,
- left: 0,
- right: 0,
- flexDirection: "row",
- alignItems: "center",
- gap: 12,
- paddingHorizontal: 16,
- },
- title: {
- flex: 1,
- fontFamily: fonts.sansBold,
- fontSize: 26,
- color: colors.ink,
- },
- topScrim: {
- position: "absolute",
- top: 0,
- left: 0,
- right: 0,
- transform: [{ rotate: "180deg" }],
- },
- overlay: { position: "absolute", left: 18, right: 18 },
- section: {
- fontFamily: fonts.sansSemi,
- fontSize: 12,
- letterSpacing: 1.2,
- textTransform: "uppercase",
- color: colors.inkMute,
- paddingLeft: 4,
- marginBottom: 4,
- },
- empty: {
- position: "absolute",
- left: 22,
- right: 22,
- fontFamily: fonts.sans,
- fontSize: 15,
- color: colors.inkMute,
- },
- dock: { position: "absolute", left: 0, right: 0, bottom: 0 },
- bottomScrim: { position: "absolute", left: 0, right: 0, top: -24, bottom: 0 },
- searchRow: {
- flexDirection: "row",
- alignItems: "center",
- gap: 10,
- paddingHorizontal: 16,
- },
- searchFlex: { flex: 1 },
- searchBar: {
- height: 50,
- borderRadius: radius.pill,
- flexDirection: "row",
- alignItems: "center",
- gap: 10,
- paddingHorizontal: 18,
- },
- searchInput: {
- flex: 1,
- height: "100%",
- fontFamily: fonts.sans,
- fontSize: 17,
- color: colors.ink,
- },
- newTaskWrap: { alignSelf: "flex-end", marginRight: 16, marginBottom: 12 },
- newTask: {
- height: 52,
- flexDirection: "row",
- alignItems: "center",
- gap: 8,
- backgroundColor: colors.dark,
- paddingLeft: 18,
- paddingRight: 24,
- borderRadius: radius.pill,
- },
- newTaskPlus: {
- color: colors.darkText,
- fontSize: 26,
- lineHeight: 28,
- fontFamily: fonts.sansMedium,
- marginTop: -2,
- },
- newTaskText: {
- color: colors.darkText,
- fontSize: 16,
- fontFamily: fonts.sansSemi,
- },
-});
diff --git a/products/desktop/apps/mobilehog/src/app/(drawer)/self-driving.tsx b/products/desktop/apps/mobilehog/src/app/(drawer)/self-driving.tsx
deleted file mode 100644
index 2c21945878c6..000000000000
--- a/products/desktop/apps/mobilehog/src/app/(drawer)/self-driving.tsx
+++ /dev/null
@@ -1,415 +0,0 @@
-import {
- Button,
- Host,
- Image,
- Menu,
- Picker,
- Text as SwiftText,
-} from "@expo/ui/swift-ui";
-import {
- accessibilityLabel,
- frame,
- glassEffect,
- pickerStyle,
- tag,
-} from "@expo/ui/swift-ui/modifiers";
-import { formatRelativeAge } from "@posthog/shared";
-import type { SignalReport } from "@posthog/shared/domain-types";
-import * as Haptics from "expo-haptics";
-import { useNavigation, useRouter } from "expo-router";
-import { useEffect, useMemo, useState } from "react";
-import { Pressable, StyleSheet, Text, View } from "react-native";
-import Animated, {
- FadeIn,
- FadeInDown,
- FadeOut,
- FadeOutDown,
-} from "react-native-reanimated";
-import { useSafeAreaInsets } from "react-native-safe-area-context";
-import { DrawerScene } from "@/components/DrawerScene";
-import { FadeScrim } from "@/components/FadeScrim";
-import { GlassCircleButton } from "@/components/Glass";
-import { MenuIcon } from "@/components/Icons";
-import { PriorityChip } from "@/components/ReportCard";
-import { TriageDeck } from "@/components/TriageDeck";
-import { REPORT_FILTERS, type ReportFilter } from "@/lib/reportFilters";
-import { REPORT_SCOPES, useReportScope } from "@/lib/reportScope";
-import {
- useDismissReport,
- useMarkReportRead,
- useReportReadStates,
- useReports,
- useStartReportTask,
-} from "@/lib/reports";
-import { colors, fonts, radius } from "@/lib/theme";
-
-const EMPTY: Record<ReportFilter, string> = {
- attention: "All clear",
- "pull-requests": "No pull requests ready",
- dismissed: "Nothing dismissed",
-};
-
-const EMPTY_FOR_YOU: Record<ReportFilter, string> = {
- attention: "Nothing for you right now.",
- "pull-requests": "No pull requests ready for you.",
- dismissed: "Nothing dismissed for you.",
-};
-
-export default function SelfDrivingScreen() {
- const navigation = useNavigation<{ openDrawer: () => void }>();
- const router = useRouter();
- const insets = useSafeAreaInsets();
- const [filter, setFilter] = useState<ReportFilter>("attention");
- const scope = useReportScope((s) => s.scope);
- const setScope = useReportScope((s) => s.setScope);
- // The deck always works on the reports that need attention.
- const reports = useReports("", "attention", { scope });
- const listed = useReports("", filter, { scope });
- const markRead = useMarkReportRead();
- const dismiss = useDismissReport();
- const startTask = useStartReportTask();
- // Locally swiped ids, so a card leaves the deck before the server catches up.
- const [handled, setHandled] = useState<Set<string>>(new Set());
- const [deck, setDeck] = useState<string[] | null>(null);
- const [notice, setNotice] = useState<string | null>(null);
- useEffect(() => {
- if (!notice) return;
- const timer = setTimeout(() => setNotice(null), 6000);
- return () => clearTimeout(timer);
- }, [notice]);
-
- const all = useMemo(
- () => (reports.data ?? []).filter((report) => !handled.has(report.id)),
- [reports.data, handled],
- );
- const rows = filter === "attention" ? all : (listed.data ?? []);
- const listFailed = listed.isError && !listed.data;
- const allIds = useMemo(() => all.map((report) => report.id), [all]);
- const rowIds = useMemo(() => rows.map((report) => report.id), [rows]);
- const readStates = useReportReadStates(allIds);
- const rowReadStates = useReportReadStates(rowIds);
-
- // Unread reports open the deck on their own.
- useEffect(() => {
- if (
- deck === null &&
- filter === "attention" &&
- reports.data &&
- readStates.settled
- ) {
- const unread = allIds.filter((id) => readStates.unread.has(id));
- if (unread.length > 0) setDeck(unread);
- }
- }, [deck, filter, reports.data, readStates, allIds]);
-
- const deckReports = useMemo(
- () =>
- (deck ?? [])
- .map((id) => all.find((report) => report.id === id))
- .filter((report): report is SignalReport => !!report),
- [deck, all],
- );
-
- // Whatever surfaces at the top of the deck counts as read.
- const topId = deckReports[0]?.id;
- useEffect(() => {
- if (topId) markRead(topId);
- }, [topId, markRead]);
-
- const finish = (report: SignalReport): void => {
- setHandled((current) => new Set(current).add(report.id));
- };
-
- // A failed action leaves the report open on the server, so put the card back
- // in the deck for another try.
- const restore = (report: SignalReport): void => {
- setHandled((current) => {
- const next = new Set(current);
- next.delete(report.id);
- return next;
- });
- };
-
- const onDismiss = (report: SignalReport): void => {
- Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Rigid).catch(() => {});
- finish(report);
- dismiss.mutate(report.id, {
- onError: (error) => {
- restore(report);
- setNotice(error.message);
- },
- });
- };
-
- const onStart = (report: SignalReport): void => {
- Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success).catch(
- () => {},
- );
- finish(report);
- startTask.start(report, router.push).catch(() => restore(report));
- };
-
- const openReport = (report: SignalReport): void => {
- router.push({ pathname: "/report/[id]", params: { id: report.id } });
- };
-
- const showDeck = deck !== null && deckReports.length > 0;
- const headerHeight = insets.top + 58;
-
- return (
- <DrawerScene>
- <View style={[styles.header, { paddingTop: insets.top + 6 }]}>
- {showDeck ? (
- <GlassCircleButton onPress={() => setDeck([])}>
- <Text style={styles.headerGlyph}>×</Text>
- </GlassCircleButton>
- ) : (
- <GlassCircleButton onPress={() => navigation.openDrawer()}>
- <MenuIcon />
- </GlassCircleButton>
- )}
- <Text style={styles.title}>{showDeck ? "Triage" : "Reports"}</Text>
- {showDeck ? (
- <View style={{ width: 46 }} />
- ) : (
- <Host matchContents>
- <Menu
- label={
- <Image
- systemName="slider.horizontal.3"
- size={18}
- color={colors.ink}
- />
- }
- modifiers={[
- frame({ width: 46, height: 46 }),
- glassEffect({
- glass: { variant: "regular", interactive: true },
- shape: "circle",
- }),
- accessibilityLabel("Report scope"),
- ]}
- >
- {REPORT_SCOPES.map((option) => (
- <Button
- key={option.value}
- label={option.label}
- systemImage={
- scope === option.value ? "checkmark" : option.icon
- }
- onPress={() => setScope(option.value)}
- />
- ))}
- </Menu>
- </Host>
- )}
- </View>
-
- {showDeck ? (
- <Animated.View
- key="deck"
- exiting={FadeOutDown.duration(200)}
- style={StyleSheet.absoluteFill}
- pointerEvents="box-none"
- >
- <TriageDeck
- reports={deckReports}
- onDismiss={onDismiss}
- onStart={onStart}
- onOpen={openReport}
- starting={startTask.isPending}
- headerHeight={headerHeight}
- />
- </Animated.View>
- ) : (
- <Animated.ScrollView
- key="list"
- entering={FadeIn.duration(240)}
- exiting={FadeOut.duration(160)}
- contentContainerStyle={[
- styles.list,
- { paddingBottom: insets.bottom + 100 },
- ]}
- >
- <Host matchContents={{ vertical: true }}>
- <Picker
- selection={filter}
- onSelectionChange={setFilter}
- modifiers={[pickerStyle("segmented")]}
- >
- {REPORT_FILTERS.map((option) => (
- <SwiftText key={option.value} modifiers={[tag(option.value)]}>
- {option.label}
- </SwiftText>
- ))}
- </Picker>
- </Host>
- {listed.isLoading ? <Text style={styles.muted}>Loading</Text> : null}
- {listFailed ? (
- <Pressable onPress={() => listed.refetch()}>
- <Text style={styles.muted}>
- Could not load reports. Tap to try again.
- </Text>
- </Pressable>
- ) : null}
- {rows.length === 0 && !listed.isLoading && !listFailed ? (
- scope === "for-you" ? (
- <Pressable onPress={() => setScope("entire-project")}>
- <Text style={styles.muted}>
- {EMPTY_FOR_YOU[filter]} Tap to show the entire project.
- </Text>
- </Pressable>
- ) : (
- <Text style={styles.sectionTitle}>{EMPTY[filter]}</Text>
- )
- ) : null}
- {rows.map((report) => (
- <Pressable
- key={report.id}
- onPress={() => openReport(report)}
- style={({ pressed }) => [styles.row, pressed && { opacity: 0.5 }]}
- >
- {report.priority ? (
- <PriorityChip priority={report.priority} />
- ) : null}
- <View style={styles.rowBody}>
- <Text style={styles.rowTitle} numberOfLines={2}>
- {report.title ?? "Untitled report"}
- </Text>
- <Text style={styles.rowMeta}>
- {report.signal_count} signal
- {report.signal_count === 1 ? "" : "s"} ·{" "}
- {formatRelativeAge(report.updated_at)}
- </Text>
- </View>
- {rowReadStates.unread.has(report.id) ? (
- <View style={styles.newDot} />
- ) : null}
- </Pressable>
- ))}
- </Animated.ScrollView>
- )}
- {notice ? (
- <Animated.View
- key={notice}
- entering={FadeInDown.duration(220)}
- exiting={FadeOutDown.duration(180)}
- style={[styles.toast, { bottom: insets.bottom + 124 }]}
- pointerEvents="none"
- >
- <Text style={styles.notice}>{notice}</Text>
- </Animated.View>
- ) : null}
- {!showDeck && filter === "attention" && all.length > 0 ? (
- <Animated.View
- entering={FadeInDown.duration(260)}
- exiting={FadeOutDown.duration(180)}
- style={[styles.floating, { paddingBottom: insets.bottom + 14 }]}
- >
- <FadeScrim style={styles.floatingScrim} />
- <Pressable
- onPress={() => setDeck(all.map((report) => report.id))}
- style={({ pressed }) => [
- styles.triage,
- pressed && { opacity: 0.8 },
- ]}
- >
- <Text style={styles.triageText}>
- Triage {all.length} report{all.length === 1 ? "" : "s"}
- </Text>
- </Pressable>
- </Animated.View>
- ) : null}
- </DrawerScene>
- );
-}
-
-const styles = StyleSheet.create({
- header: {
- flexDirection: "row",
- alignItems: "center",
- justifyContent: "space-between",
- paddingHorizontal: 16,
- paddingBottom: 6,
- },
- title: { fontFamily: fonts.sansBold, fontSize: 22, color: colors.ink },
- headerGlyph: {
- fontSize: 26,
- lineHeight: 28,
- color: colors.ink,
- marginTop: -2,
- },
- list: { paddingHorizontal: 18, paddingTop: 8, gap: 10 },
- toast: { position: "absolute", left: 18, right: 18, alignItems: "center" },
- notice: {
- fontFamily: fonts.sansMedium,
- fontSize: 14,
- color: colors.darkText,
- backgroundColor: colors.dark,
- paddingHorizontal: 16,
- paddingVertical: 11,
- borderRadius: radius.pill,
- overflow: "hidden",
- },
- floating: {
- position: "absolute",
- left: 18,
- right: 18,
- bottom: 0,
- },
- floatingScrim: {
- position: "absolute",
- left: -18,
- right: -18,
- top: -48,
- bottom: 0,
- },
- triage: {
- backgroundColor: colors.dark,
- borderRadius: radius.pill,
- paddingVertical: 16,
- alignItems: "center",
- shadowColor: "#000",
- shadowOpacity: 0.18,
- shadowRadius: 18,
- shadowOffset: { width: 0, height: 8 },
- },
- triageText: {
- fontFamily: fonts.sansSemi,
- fontSize: 16,
- color: colors.darkText,
- },
- sectionTitle: {
- fontFamily: fonts.sansSemi,
- fontSize: 12,
- letterSpacing: 1.2,
- textTransform: "uppercase",
- color: colors.inkMute,
- marginTop: 8,
- marginLeft: 4,
- },
- muted: { fontFamily: fonts.sans, fontSize: 14, color: colors.inkMute },
- row: {
- flexDirection: "row",
- alignItems: "flex-start",
- gap: 12,
- backgroundColor: colors.surface,
- borderRadius: 18,
- padding: 14,
- },
- rowBody: { flex: 1, gap: 3 },
- rowTitle: {
- fontFamily: fonts.sansMedium,
- fontSize: 15,
- lineHeight: 20,
- color: colors.ink,
- },
- rowMeta: { fontFamily: fonts.sans, fontSize: 12, color: colors.inkMute },
- newDot: {
- width: 8,
- height: 8,
- borderRadius: 4,
- backgroundColor: colors.accent,
- marginTop: 6,
- },
-});
diff --git a/products/desktop/apps/mobilehog/src/app/(drawer)/task/[id].tsx b/products/desktop/apps/mobilehog/src/app/(drawer)/task/[id].tsx
deleted file mode 100644
index 0e97531716a1..000000000000
--- a/products/desktop/apps/mobilehog/src/app/(drawer)/task/[id].tsx
+++ /dev/null
@@ -1,219 +0,0 @@
-import { FlashList, type FlashListRef } from "@shopify/flash-list";
-import { useLocalSearchParams } from "expo-router";
-import { useEffect, useMemo, useRef, useState } from "react";
-import { StyleSheet, Text, View } from "react-native";
-import { KeyboardStickyView } from "react-native-keyboard-controller";
-import { useSafeAreaInsets } from "react-native-safe-area-context";
-import { ChatHeader } from "@/components/ChatHeader";
-import { Composer } from "@/components/Composer";
-import { DrawerScene } from "@/components/DrawerScene";
-import { FadeScrim } from "@/components/FadeScrim";
-import { Hedgehog } from "@/components/Hedgehog";
-import {
- buildTranscriptRows,
- StatusLine,
- type TranscriptRow,
- TranscriptRowView,
-} from "@/components/Transcript";
-import type { Photo } from "@/lib/attachments";
-import { useComposer } from "@/lib/composer";
-import { recordOpened } from "@/lib/openedChats";
-import { usePrefs } from "@/lib/prefs";
-import { useTask } from "@/lib/queries";
-import { useSessions } from "@/lib/session";
-import { colors, fonts } from "@/lib/theme";
-
-export default function TaskScreen() {
- const { id } = useLocalSearchParams<{ id: string }>();
- const insets = useSafeAreaInsets();
- // Placeholder chats have no task yet; the store holds their session.
- const isPending = id.startsWith("new-");
- const task = useTask(isPending ? "" : id);
- const session = useSessions((s) => s.sessions[id]);
- const hedgehogMode = usePrefs((s) => s.hedgehogMode);
- const { connect, disconnect, sendPrompt, cancelTurn, respondToPermission } =
- useSessions();
- const setModel = useComposer((s) => s.setModel);
- const listRef = useRef<FlashListRef<TranscriptRow>>(null);
- const pendingScrollTo = useRef<string | null>(null);
- const [viewportHeight, setViewportHeight] = useState(0);
- const [composerHeight, setComposerHeight] = useState(0);
- // Extra room below the transcript only while a sent message is pinned near
- // the top; it goes away once the reply lands so idle chats have no gap.
- const [pinRoom, setPinRoom] = useState(false);
- const topPadding = insets.top + 70;
-
- useEffect(() => {
- if (!isPending) recordOpened(id);
- }, [id, isPending]);
-
- const runId = task.data?.latest_run?.id;
- useEffect(() => {
- if (task.data && runId) connect(task.data);
- }, [task.data, runId, connect]);
-
- useEffect(() => () => disconnect(id), [id, disconnect]);
-
- useEffect(() => {
- const runModel = task.data?.latest_run?.model;
- if (runModel) setModel(runModel);
- }, [task.data?.latest_run?.model, setModel]);
-
- const blocks = session?.blocks;
- // Walks while thinking or using tools; stands still once text is streaming.
- const tail = blocks?.[blocks.length - 1];
- const streamingText = tail?.kind === "agent" && !tail.complete;
- const walking = !!session?.turnActive && !streamingText;
- const booting =
- !!session &&
- (session.runStatus === "queued" || session.runStatus === "not_started") &&
- !blocks?.some((block) => block.kind !== "user");
-
- const turnActive = !!session?.turnActive;
- useEffect(() => {
- if (!turnActive) setPinRoom(false);
- }, [turnActive]);
-
- const workingLabel = session?.resuming
- ? "Reconnecting"
- : booting
- ? "Starting sandbox"
- : session?.connected
- ? "Working"
- : "Connecting";
- const rows = useMemo(
- () => (session ? buildTranscriptRows(session, workingLabel) : []),
- [session, workingLabel],
- );
-
- const send = async (text: string, photos: Photo[]): Promise<void> => {
- // The bubble lays out before the request resolves, so pick the id first.
- const blockId = `local-${Date.now()}`;
- pendingScrollTo.current = blockId;
- setPinRoom(true);
- try {
- await sendPrompt(id, text, blockId, photos);
- } catch (error) {
- if (pendingScrollTo.current === blockId) pendingScrollTo.current = null;
- throw error;
- }
- };
-
- // Once the sent bubble is a row, pin it near the top with a sliver of the
- // previous reply above it.
- useEffect(() => {
- const target = pendingScrollTo.current;
- if (!target) return;
- const index = rows.findIndex((row) => row.id === target);
- if (index < 0) return;
- pendingScrollTo.current = null;
- listRef.current?.scrollToIndex({
- index,
- viewPosition: 0,
- viewOffset: 56,
- animated: true,
- });
- }, [rows]);
-
- return (
- <DrawerScene>
- <ChatHeader task={task.data} />
- <FlashList
- ref={listRef}
- data={rows}
- keyExtractor={(row) => row.id}
- getItemType={(row) => row.kind}
- renderItem={({ item }) => (
- <TranscriptRowView
- row={item}
- taskId={id}
- onPermission={(toolCallId, optionId) =>
- respondToPermission(id, toolCallId, optionId)
- }
- />
- )}
- ItemSeparatorComponent={Gap}
- onLayout={(event) => setViewportHeight(event.nativeEvent.layout.height)}
- contentContainerStyle={{
- paddingTop: topPadding,
- paddingHorizontal: 18,
- // Clear the floating composer, and leave room to pin a fresh
- // message near the top of the screen.
- paddingBottom: pinRoom
- ? Math.max(composerHeight + 16, viewportHeight - 200)
- : composerHeight + 16,
- }}
- // Open at the end, and keep following it while the reader is near the
- // bottom; a pinned message sits far enough up to opt out on its own.
- maintainVisibleContentPosition={{
- startRenderingFromBottom: true,
- autoscrollToBottomThreshold: 0.2,
- animateAutoScrollToBottom: false,
- }}
- keyboardDismissMode="interactive"
- ListEmptyComponent={
- <View style={styles.loading}>
- <StatusLine
- label={task.error ? task.error.message : "Loading"}
- active={!task.error}
- />
- </View>
- }
- ListFooterComponent={
- session?.error ? (
- <Text style={styles.error}>{session.error}</Text>
- ) : null
- }
- />
- <KeyboardStickyView
- offset={{ closed: 0, opened: insets.bottom }}
- style={styles.dock}
- >
- <View
- style={[styles.composer, { paddingBottom: insets.bottom + 8 }]}
- onLayout={(event) =>
- setComposerHeight(event.nativeEvent.layout.height)
- }
- >
- {session && hedgehogMode ? <Hedgehog walking={walking} /> : null}
- <View>
- <FadeScrim style={styles.scrim} />
- <Composer
- placeholder="Reply"
- onSend={send}
- onStop={isPending ? undefined : () => cancelTurn(id)}
- busy={session?.turnActive}
- sending={isPending}
- draftKey={id}
- />
- </View>
- </View>
- </KeyboardStickyView>
- </DrawerScene>
- );
-}
-
-function Gap() {
- return <View style={styles.gap} />;
-}
-
-const styles = StyleSheet.create({
- loading: { paddingTop: 4 },
- gap: { height: 14 },
- error: {
- color: colors.danger,
- fontFamily: fonts.sans,
- fontSize: 13,
- paddingHorizontal: 18,
- marginTop: 8,
- },
- dock: { position: "absolute", left: 0, right: 0, bottom: 0 },
- scrim: {
- position: "absolute",
- top: -40,
- bottom: -60,
- left: -12,
- right: -12,
- },
- composer: { paddingHorizontal: 12 },
-});
diff --git a/products/desktop/apps/mobilehog/src/app/_layout.tsx b/products/desktop/apps/mobilehog/src/app/_layout.tsx
deleted file mode 100644
index e7d00ef38cf8..000000000000
--- a/products/desktop/apps/mobilehog/src/app/_layout.tsx
+++ /dev/null
@@ -1,134 +0,0 @@
-import { QueryClientProvider } from "@tanstack/react-query";
-import { useFonts } from "expo-font";
-import { Stack, useRouter, useSegments } from "expo-router";
-import * as SplashScreen from "expo-splash-screen";
-import { StatusBar } from "expo-status-bar";
-import { useEffect } from "react";
-import { AppState } from "react-native";
-import { GestureHandlerRootView } from "react-native-gesture-handler";
-import { KeyboardProvider } from "react-native-keyboard-controller";
-import { OfflinePill } from "@/components/OfflinePill";
-import { getAccountQueryClient } from "@/lib/accountLifecycle";
-import { sessionIdentity, useAuth } from "@/lib/auth";
-import "@/lib/network";
-import { usePushNotifications } from "@/lib/notifications";
-import { usePrefs } from "@/lib/prefs";
-import { useRepo } from "@/lib/repo";
-import { useSessions } from "@/lib/session";
-import { colors, fonts } from "@/lib/theme";
-
-SplashScreen.preventAutoHideAsync().catch(() => {});
-
-function AuthGate() {
- const { session, hydrated, hydrate } = useAuth();
- const segments = useSegments();
- const router = useRouter();
-
- const hydrateRepo = useRepo((s) => s.hydrate);
- const hydratePrefs = usePrefs((s) => s.hydrate);
- usePushNotifications();
- useEffect(() => {
- hydrate();
- hydratePrefs();
- }, [hydrate, hydratePrefs]);
-
- useEffect(() => {
- if (!useAuth.getState().session) return;
- hydrateRepo();
- }, [hydrateRepo]);
-
- useEffect(() => {
- if (!hydrated) return;
- const onLogin = segments[0] === "login";
- if (!session && !onLogin) router.replace("/login");
- if (session && onLogin) router.replace("/(drawer)");
- SplashScreen.hideAsync().catch(() => {});
- }, [hydrated, session, segments, router]);
-
- return null;
-}
-
-export default function RootLayout() {
- const identity = useAuth(sessionIdentity);
- const [fontsLoaded, fontError] = useFonts({
- "JetBrainsMono-Regular": require("../../assets/fonts/JetBrainsMono-Regular.ttf"),
- "JetBrainsMono-Medium": require("../../assets/fonts/JetBrainsMono-Medium.ttf"),
- RoundHog: require("../../assets/fonts/RoundHog.ttf"),
- "RoundHog-Medium": require("../../assets/fonts/RoundHog-Medium.ttf"),
- "RoundHog-SemiBold": require("../../assets/fonts/RoundHog-SemiBold.ttf"),
- "RoundHog-Bold": require("../../assets/fonts/RoundHog-Bold.ttf"),
- "RoundHog-Italic": require("../../assets/fonts/RoundHog-Italic.ttf"),
- });
- const reconnect = useSessions((s) => s.reconnect);
-
- useEffect(() => {
- const subscription = AppState.addEventListener("change", (state) => {
- if (state === "active") reconnect();
- });
- return () => subscription.remove();
- }, [reconnect]);
-
- // Keep going after a font error and accept fallback fonts. AuthGate hides
- // the splash screen, and it cannot mount while this returns null.
- if (!fontsLoaded && !fontError) return null;
-
- return (
- <GestureHandlerRootView style={{ flex: 1, backgroundColor: colors.bg }}>
- <KeyboardProvider>
- <QueryClientProvider key={identity} client={getAccountQueryClient()}>
- <StatusBar style="auto" />
- <AuthGate />
- <Stack
- screenOptions={{
- headerShown: false,
- contentStyle: { backgroundColor: colors.bg },
- }}
- >
- <Stack.Screen name="login" options={{ animation: "fade" }} />
- <Stack.Screen name="(drawer)" />
- <Stack.Screen
- name="report/[id]"
- options={{
- headerShown: true,
- title: "Report",
- headerBackButtonDisplayMode: "minimal",
- headerShadowVisible: false,
- headerTintColor: colors.ink,
- headerStyle: { backgroundColor: colors.bg },
- headerTitleStyle: { fontFamily: fonts.sansSemi },
- }}
- />
- <Stack.Screen
- name="config"
- options={{
- presentation: "formSheet",
- sheetAllowedDetents: [0.6, 1],
- sheetGrabberVisible: true,
- sheetCornerRadius: 32,
- contentStyle: { backgroundColor: colors.bg },
- }}
- />
- <Stack.Screen
- name="picker"
- options={{
- presentation: "formSheet",
- sheetAllowedDetents: [0.55, 1],
- sheetGrabberVisible: true,
- sheetCornerRadius: 32,
- contentStyle: { backgroundColor: colors.bg },
- }}
- />
- <Stack.Screen
- name="settings"
- options={{
- presentation: "modal",
- contentStyle: { backgroundColor: colors.bg },
- }}
- />
- </Stack>
- <OfflinePill />
- </QueryClientProvider>
- </KeyboardProvider>
- </GestureHandlerRootView>
- );
-}
diff --git a/products/desktop/apps/mobilehog/src/app/config/_layout.tsx b/products/desktop/apps/mobilehog/src/app/config/_layout.tsx
deleted file mode 100644
index 37ef611e84ae..000000000000
--- a/products/desktop/apps/mobilehog/src/app/config/_layout.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { Stack } from "expo-router";
-import { colors } from "@/lib/theme";
-
-// The run options sheet drills down with native pushes inside the sheet.
-export default function ConfigLayout() {
- return (
- <Stack
- screenOptions={{
- headerShown: false,
- contentStyle: { backgroundColor: colors.bg },
- }}
- />
- );
-}
diff --git a/products/desktop/apps/mobilehog/src/app/config/index.tsx b/products/desktop/apps/mobilehog/src/app/config/index.tsx
deleted file mode 100644
index 89d9548b6344..000000000000
--- a/products/desktop/apps/mobilehog/src/app/config/index.tsx
+++ /dev/null
@@ -1,46 +0,0 @@
-import { getReasoningEffortOptions } from "@posthog/shared";
-import { useRouter } from "expo-router";
-import { ScrollView, View } from "react-native";
-import { SheetHeader } from "@/components/SheetHeader";
-import { SheetRow, sheetStyles } from "@/components/SheetRow";
-import { useComposer } from "@/lib/composer";
-import { shortModelName } from "@/lib/models";
-
-export default function RunOptionsMenu() {
- const router = useRouter();
- const config = useComposer();
- const efforts = getReasoningEffortOptions(config.adapter, config.model);
- const effortLabel =
- efforts?.find((option) => option.value === config.reasoning)?.name ?? "";
-
- return (
- <ScrollView
- style={sheetStyles.root}
- contentContainerStyle={sheetStyles.list}
- >
- <SheetHeader title="Run options" />
- <View style={sheetStyles.card}>
- <SheetRow
- first
- label="Model"
- value={shortModelName(config.model)}
- onPress={() => router.push("/config/model")}
- />
- {efforts ? (
- <SheetRow
- label="Reasoning"
- value={effortLabel}
- onPress={() => router.push("/config/reasoning")}
- />
- ) : null}
- </View>
- <View style={sheetStyles.card}>
- <SheetRow
- first
- label="Reset to default"
- onPress={() => config.reset()}
- />
- </View>
- </ScrollView>
- );
-}
diff --git a/products/desktop/apps/mobilehog/src/app/config/model.tsx b/products/desktop/apps/mobilehog/src/app/config/model.tsx
deleted file mode 100644
index 152ea7a719d0..000000000000
--- a/products/desktop/apps/mobilehog/src/app/config/model.tsx
+++ /dev/null
@@ -1,54 +0,0 @@
-import { modelCostInfo } from "@posthog/core/billing/modelPricing";
-import { buildProviderModelGroups } from "@posthog/shared";
-import { useRouter } from "expo-router";
-import { useMemo } from "react";
-import { ScrollView, Text, View } from "react-native";
-import { SheetHeader } from "@/components/SheetHeader";
-import { SheetRow, sheetStyles } from "@/components/SheetRow";
-import { useComposer } from "@/lib/composer";
-import { shortModelName } from "@/lib/models";
-import { useModels } from "@/lib/queries";
-
-export default function ModelPage() {
- const router = useRouter();
- const models = useModels();
- const model = useComposer((s) => s.model);
- const adapter = useComposer((s) => s.adapter);
- const setModel = useComposer((s) => s.setModel);
- const groups = useMemo(
- () => buildProviderModelGroups(models.data ?? [], adapter, model),
- [models.data, adapter, model],
- );
-
- return (
- <ScrollView
- style={sheetStyles.root}
- contentContainerStyle={sheetStyles.list}
- >
- <SheetHeader title="Model" back />
- {groups.map((group) => (
- <View key={group.group} style={sheetStyles.section}>
- <Text style={sheetStyles.sectionTitle}>{group.name}</Text>
- <View style={sheetStyles.card}>
- {group.options.map((option, index) => (
- <SheetRow
- key={option.value}
- first={index === 0}
- radio={option.value === model}
- label={shortModelName(option.value)}
- trailing={modelCostInfo(option.value)?.multiplierLabel}
- onPress={() => {
- setModel(option.value);
- router.back();
- }}
- />
- ))}
- </View>
- </View>
- ))}
- <Text style={sheetStyles.footnote}>
- × is cost per token vs Claude Sonnet 5
- </Text>
- </ScrollView>
- );
-}
diff --git a/products/desktop/apps/mobilehog/src/app/config/reasoning.tsx b/products/desktop/apps/mobilehog/src/app/config/reasoning.tsx
deleted file mode 100644
index 11c10fbc0a6f..000000000000
--- a/products/desktop/apps/mobilehog/src/app/config/reasoning.tsx
+++ /dev/null
@@ -1,35 +0,0 @@
-import { getReasoningEffortOptions } from "@posthog/shared";
-import { useRouter } from "expo-router";
-import { ScrollView, View } from "react-native";
-import { SheetHeader } from "@/components/SheetHeader";
-import { SheetRow, sheetStyles } from "@/components/SheetRow";
-import { useComposer } from "@/lib/composer";
-
-export default function ReasoningPage() {
- const router = useRouter();
- const { adapter, model, reasoning, setReasoning } = useComposer();
- const options = getReasoningEffortOptions(adapter, model) ?? [];
-
- return (
- <ScrollView
- style={sheetStyles.root}
- contentContainerStyle={sheetStyles.list}
- >
- <SheetHeader title="Reasoning" back />
- <View style={sheetStyles.card}>
- {options.map((option, index) => (
- <SheetRow
- key={option.value}
- first={index === 0}
- radio={option.value === reasoning}
- label={option.name}
- onPress={() => {
- setReasoning(option.value);
- router.back();
- }}
- />
- ))}
- </View>
- </ScrollView>
- );
-}
diff --git a/products/desktop/apps/mobilehog/src/app/login.tsx b/products/desktop/apps/mobilehog/src/app/login.tsx
deleted file mode 100644
index 94b26e529632..000000000000
--- a/products/desktop/apps/mobilehog/src/app/login.tsx
+++ /dev/null
@@ -1,290 +0,0 @@
-import { useRef, useState } from "react";
-import {
- ActivityIndicator,
- Image,
- type NativeScrollEvent,
- type NativeSyntheticEvent,
- Pressable,
- ScrollView,
- StyleSheet,
- Text,
- useWindowDimensions,
- View,
-} from "react-native";
-import Animated, {
- useAnimatedStyle,
- withSpring,
-} from "react-native-reanimated";
-import { useSafeAreaInsets } from "react-native-safe-area-context";
-import { Glass } from "@/components/Glass";
-import { Logomark } from "@/components/Icons";
-import { DEV_EMAIL, DEV_PASSWORD } from "@/config";
-import { useAuth } from "@/lib/auth";
-import type { CloudRegion } from "@/lib/oauth";
-import { colors, fonts, radius } from "@/lib/theme";
-
-const SLIDES = [
- {
- image: require("../../assets/hoggies/remote-work.png"),
- title: "Code on the go",
- body: "Kick off a task from the couch and watch the agent work through it, tool call by tool call.",
- },
- {
- image: require("../../assets/hoggies/im-the-driver.png"),
- title: "Steer your self-driving agents",
- body: "Swipe through what the agents found overnight. Dismiss the noise, start a task on the rest.",
- },
- {
- image: require("../../assets/hoggies/coding-group.png"),
- title: "See what your team is shipping",
- body: "Every space, every task, every finished run, in one feed you can read between meetings.",
- },
-];
-
-const REGIONS: Array<{ key: CloudRegion; label: string }> = [
- { key: "us", label: "🇺🇸 US Cloud" },
- { key: "eu", label: "🇪🇺 EU Cloud" },
-];
-
-const SEGMENT_PAD = 4;
-
-// A glass pill that slides under the chosen region.
-function RegionSegment({
- value,
- onChange,
-}: {
- value: CloudRegion;
- onChange: (region: CloudRegion) => void;
-}) {
- const [width, setWidth] = useState(0);
- const item = (width - SEGMENT_PAD * 2) / REGIONS.length;
- const index = REGIONS.findIndex((option) => option.key === value);
- const slide = useAnimatedStyle(() => ({
- width: item,
- transform: [
- {
- translateX: withSpring(index * item, {
- duration: 420,
- dampingRatio: 0.85,
- }),
- },
- ],
- }));
- return (
- <Glass
- style={styles.segment}
- tint={colors.fill}
- onLayout={(event) => setWidth(event.nativeEvent.layout.width)}
- >
- {width > 0 ? (
- <Animated.View style={[styles.segmentPill, slide]}>
- <Glass interactive style={styles.pillGlass} />
- </Animated.View>
- ) : null}
- {REGIONS.map((option) => {
- const active = option.key === value;
- return (
- <Pressable
- key={option.key}
- onPress={() => onChange(option.key)}
- style={styles.segmentItem}
- >
- <Text
- style={[styles.segmentText, active && styles.segmentTextActive]}
- >
- {option.label}
- </Text>
- </Pressable>
- );
- })}
- </Glass>
- );
-}
-
-// The landing carousel: three things the app is for, then straight into
-// PostHog's own login sheet, which handles passwords, Google, GitHub and SSO.
-export default function LandingScreen() {
- const insets = useSafeAreaInsets();
- const { width } = useWindowDimensions();
- const [index, setIndex] = useState(0);
- const login = useAuth((s) => s.login);
- const loginWithOAuth = useAuth((s) => s.loginWithOAuth);
- const [region, setRegion] = useState<CloudRegion>("us");
- const [busy, setBusy] = useState<"cloud" | "local" | null>(null);
- const loginPending = useRef(false);
- const [error, setError] = useState<string | null>(null);
-
- const run = async (
- kind: "cloud" | "local",
- attempt: () => Promise<void>,
- ): Promise<void> => {
- if (loginPending.current) return;
- loginPending.current = true;
- setBusy(kind);
- setError(null);
- try {
- await attempt();
- } catch (err) {
- setError(err instanceof Error ? err.message : String(err));
- } finally {
- loginPending.current = false;
- setBusy(null);
- }
- };
-
- const onScrollEnd = (event: NativeSyntheticEvent<NativeScrollEvent>): void =>
- setIndex(Math.round(event.nativeEvent.contentOffset.x / width));
-
- return (
- <View style={styles.root}>
- <View style={[styles.brand, { paddingTop: insets.top + 24 }]}>
- <Logomark size={36} />
- <Text style={styles.wordmark}>PostHog</Text>
- </View>
- <ScrollView
- horizontal
- pagingEnabled
- showsHorizontalScrollIndicator={false}
- onMomentumScrollEnd={onScrollEnd}
- style={styles.pager}
- >
- {SLIDES.map((slide) => (
- <View key={slide.title} style={[styles.slide, { width }]}>
- <Image
- source={slide.image}
- style={styles.hoggie}
- resizeMode="contain"
- />
- <Text style={styles.title}>{slide.title}</Text>
- <Text style={styles.body}>{slide.body}</Text>
- </View>
- ))}
- </ScrollView>
- <View style={[styles.footer, { paddingBottom: insets.bottom + 20 }]}>
- <View style={styles.dots}>
- {SLIDES.map((slide, i) => (
- <View
- key={slide.title}
- style={[styles.dot, i === index && styles.dotActive]}
- />
- ))}
- </View>
- {error ? <Text style={styles.error}>{error}</Text> : null}
- <RegionSegment value={region} onChange={setRegion} />
- <Pressable
- onPress={() => run("cloud", () => loginWithOAuth(region))}
- disabled={!!busy}
- style={({ pressed }) => [
- busy !== null && busy !== "cloud" && { opacity: 0.4 },
- pressed && { opacity: 0.7 },
- ]}
- >
- <Glass interactive tint="rgba(255,92,28,0.9)" style={styles.button}>
- {busy === "cloud" ? (
- <ActivityIndicator color="#FFFFFF" />
- ) : (
- <Text style={styles.buttonText}>Get started</Text>
- )}
- </Glass>
- </Pressable>
- {__DEV__ ? (
- <Pressable
- onPress={() => run("local", () => login(DEV_EMAIL, DEV_PASSWORD))}
- disabled={!!busy}
- style={styles.devLink}
- >
- {busy === "local" ? (
- <ActivityIndicator size="small" color={colors.inkMute} />
- ) : (
- <Text style={styles.link}>Sign in to localhost</Text>
- )}
- </Pressable>
- ) : null}
- </View>
- </View>
- );
-}
-
-const styles = StyleSheet.create({
- root: { flex: 1, backgroundColor: colors.bg },
- brand: {
- flexDirection: "row",
- alignItems: "center",
- justifyContent: "center",
- gap: 10,
- },
- wordmark: { fontFamily: fonts.serif, fontSize: 24, color: colors.ink },
- pager: { flex: 1 },
- slide: {
- flex: 1,
- alignItems: "center",
- justifyContent: "center",
- paddingHorizontal: 36,
- gap: 14,
- },
- hoggie: { width: 260, height: 260, marginBottom: 10 },
- title: {
- fontFamily: fonts.sansBold,
- fontSize: 28,
- lineHeight: 34,
- color: colors.ink,
- textAlign: "center",
- },
- body: {
- fontFamily: fonts.sans,
- fontSize: 16,
- lineHeight: 23,
- color: colors.inkSoft,
- textAlign: "center",
- },
- footer: { paddingHorizontal: 28, gap: 22 },
- dots: { flexDirection: "row", justifyContent: "center", gap: 8 },
- dot: {
- width: 8,
- height: 8,
- borderRadius: 4,
- backgroundColor: colors.line,
- },
- dotActive: { backgroundColor: colors.ink, width: 22 },
- button: {
- borderRadius: radius.pill,
- paddingVertical: 17,
- alignItems: "center",
- overflow: "hidden",
- },
- buttonText: { color: "#FFFFFF", fontSize: 17, fontFamily: fonts.sansSemi },
- error: {
- color: colors.danger,
- fontFamily: fonts.sans,
- fontSize: 13,
- lineHeight: 18,
- textAlign: "center",
- },
- segment: {
- flexDirection: "row",
- borderRadius: radius.pill,
- padding: SEGMENT_PAD,
- overflow: "hidden",
- marginBottom: -8,
- },
- segmentPill: {
- position: "absolute",
- top: SEGMENT_PAD,
- bottom: SEGMENT_PAD,
- left: SEGMENT_PAD,
- },
- pillGlass: { flex: 1, borderRadius: radius.pill, overflow: "hidden" },
- segmentItem: {
- flex: 1,
- paddingVertical: 10,
- alignItems: "center",
- },
- segmentText: {
- fontFamily: fonts.sansMedium,
- fontSize: 15,
- color: colors.inkMute,
- },
- segmentTextActive: { color: colors.ink },
- devLink: { alignItems: "center", marginTop: -6 },
- link: { fontFamily: fonts.sansMedium, fontSize: 14, color: colors.inkMute },
-});
diff --git a/products/desktop/apps/mobilehog/src/app/picker.tsx b/products/desktop/apps/mobilehog/src/app/picker.tsx
deleted file mode 100644
index c0a2ce47cc33..000000000000
--- a/products/desktop/apps/mobilehog/src/app/picker.tsx
+++ /dev/null
@@ -1,149 +0,0 @@
-import { useRouter } from "expo-router";
-import { useMemo, useState } from "react";
-import {
- Pressable,
- ScrollView,
- StyleSheet,
- Text,
- TextInput,
- View,
-} from "react-native";
-import { Glass } from "@/components/Glass";
-import { SheetHeader } from "@/components/SheetHeader";
-import { useDefaultRepository, useRepositories } from "@/lib/queries";
-import { useRepo } from "@/lib/repo";
-import { colors, fonts, radius } from "@/lib/theme";
-
-interface Option {
- key: string;
- label: string;
- detail?: string;
- value: string | null;
-}
-
-export default function RepositorySheet() {
- const router = useRouter();
- const repositories = useRepositories();
- const repository = useDefaultRepository();
- const setRepository = useRepo((s) => s.setRepository);
- const [query, setQuery] = useState("");
-
- const options = useMemo<Option[]>(() => {
- const needle = query.trim().toLowerCase();
- return [
- { key: "none", label: "No repository", value: null },
- ...(repositories.data ?? [])
- .filter((repo) => !needle || repo.toLowerCase().includes(needle))
- .map((repo) => ({
- key: repo,
- label: repo.split("/")[1] ?? repo,
- detail: repo.split("/")[0],
- value: repo,
- })),
- ];
- }, [repositories.data, query]);
-
- const selected = repository.data ?? null;
- const loading = repositories.isLoading;
-
- const choose = (option: Option): void => {
- setRepository(option.value);
- router.back();
- };
-
- return (
- <ScrollView
- style={styles.root}
- contentContainerStyle={styles.list}
- keyboardDismissMode="on-drag"
- >
- <SheetHeader title="Repository" />
- <Glass style={styles.search}>
- <TextInput
- value={query}
- onChangeText={setQuery}
- placeholder="Search repositories"
- placeholderTextColor={colors.inkMute}
- autoCapitalize="none"
- autoCorrect={false}
- style={styles.searchInput}
- />
- </Glass>
- {loading && options.length <= 1 ? (
- <Text style={styles.empty}>Loading</Text>
- ) : null}
- <View style={styles.card}>
- {options.map((option, index) => {
- const active = option.value === selected;
- return (
- <Pressable
- key={option.key}
- onPress={() => choose(option)}
- style={({ pressed }) => [
- styles.row,
- index > 0 && styles.rowDivider,
- pressed && { opacity: 0.5 },
- ]}
- >
- <View style={{ flex: 1 }}>
- <Text style={[styles.label, active && styles.labelActive]}>
- {option.label}
- </Text>
- {option.detail ? (
- <Text style={styles.detail}>{option.detail}</Text>
- ) : null}
- </View>
- {active ? <Text style={styles.check}>✓</Text> : null}
- </Pressable>
- );
- })}
- </View>
- </ScrollView>
- );
-}
-
-const styles = StyleSheet.create({
- root: { flex: 1, backgroundColor: colors.bg },
- search: {
- borderRadius: radius.pill,
- paddingHorizontal: 16,
- overflow: "hidden",
- },
- searchInput: {
- fontFamily: fonts.sans,
- fontSize: 16,
- color: colors.ink,
- paddingVertical: 11,
- },
- list: { padding: 18, paddingBottom: 40, gap: 12 },
- empty: {
- fontFamily: fonts.sans,
- fontSize: 14,
- color: colors.inkMute,
- padding: 8,
- },
- card: {
- backgroundColor: colors.surface,
- borderRadius: radius.card,
- paddingHorizontal: 16,
- },
- row: {
- flexDirection: "row",
- alignItems: "center",
- gap: 12,
- paddingVertical: 13,
- },
- rowDivider: {
- borderTopWidth: StyleSheet.hairlineWidth,
- borderTopColor: colors.line,
- },
- label: { fontFamily: fonts.sans, fontSize: 16, color: colors.ink },
- labelActive: { fontFamily: fonts.sansSemi },
- detail: {
- fontFamily: fonts.sans,
- fontSize: 13,
- color: colors.inkMute,
- marginTop: 1,
- },
- check: { fontFamily: fonts.sansBold, fontSize: 16, color: colors.accent },
-});
diff --git a/products/desktop/apps/mobilehog/src/app/report/[id].tsx b/products/desktop/apps/mobilehog/src/app/report/[id].tsx
deleted file mode 100644
index 9f946baee5b0..000000000000
--- a/products/desktop/apps/mobilehog/src/app/report/[id].tsx
+++ /dev/null
@@ -1,160 +0,0 @@
-import { canCreateImplementationPr } from "@posthog/core/inbox/reportActions";
-import { isDismissedReport } from "@posthog/core/inbox/reportMembership";
-import * as Haptics from "expo-haptics";
-import { router, useLocalSearchParams } from "expo-router";
-import { useEffect } from "react";
-import {
- Alert,
- Linking,
- Pressable,
- StyleSheet,
- Text,
- View,
-} from "react-native";
-import { useSafeAreaInsets } from "react-native-safe-area-context";
-import { Glass } from "@/components/Glass";
-import { CardButton, ReportDetail } from "@/components/ReportCard";
-import {
- hasOpenImplementationPr,
- openPullRequestUrl,
-} from "@/lib/reportFilters";
-import {
- useDismissReport,
- useHasLiveImplementationTask,
- useMarkReportRead,
- useReport,
- useStartReportTask,
-} from "@/lib/reports";
-import { colors, fonts, radius } from "@/lib/theme";
-
-export default function ReportScreen() {
- const { id } = useLocalSearchParams<{ id: string }>();
- const insets = useSafeAreaInsets();
- const { data: report, isLoading } = useReport(id);
- const dismiss = useDismissReport();
- const startTask = useStartReportTask();
- const liveTask = useHasLiveImplementationTask(id);
- const markRead = useMarkReportRead();
- // A report that failed to load or is still loading stays unread.
- const reportId = report?.id;
- useEffect(() => {
- if (reportId) markRead(reportId);
- }, [reportId, markRead]);
-
- if (!report) {
- return (
- <View style={styles.root}>
- <Text style={styles.muted}>
- {isLoading ? "Loading" : "This report is not available."}
- </Text>
- </View>
- );
- }
-
- const canDismiss = !isDismissedReport(report);
- const canStart = canCreateImplementationPr(report, {
- hasLiveImplementationTask: liveTask.data === true,
- // Unknown task state must not offer a second task on live work.
- isTaskLookupPending: liveTask.isPending || liveTask.isError,
- });
- const taskCheckFailed = liveTask.isError && canCreateImplementationPr(report);
- // A report with an open PR cannot start another task, so the PR takes that
- // slot.
- const prUrl = canStart ? null : openPullRequestUrl(report);
-
- const runDismiss = (): void => {
- Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Rigid).catch(() => {});
- dismiss.mutate(report.id, { onSuccess: () => router.back() });
- };
-
- // Dismissing a report also closes its open PR on GitHub.
- const onDismiss = (): void => {
- if (!hasOpenImplementationPr(report)) {
- runDismiss();
- return;
- }
- Alert.alert(
- "Dismiss and close the PR?",
- "The open pull request for this report will be closed.",
- [
- { text: "Cancel", style: "cancel" },
- { text: "Dismiss", style: "destructive", onPress: runDismiss },
- ],
- );
- };
-
- // Pop back to the drawer and open the task there, so the report does not
- // stay under the chat.
- const onStart = (): void => {
- Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success).catch(
- () => {},
- );
- startTask.start(report, router.dismissTo).catch(() => {});
- };
-
- return (
- <View style={styles.root}>
- <ReportDetail report={report} />
- {canDismiss || canStart || taskCheckFailed || prUrl ? (
- <View style={[styles.actions, { paddingBottom: insets.bottom + 12 }]}>
- {dismiss.isError ? (
- <Text style={styles.error}>Could not dismiss. Try again.</Text>
- ) : null}
- {taskCheckFailed ? (
- <Pressable
- disabled={liveTask.isFetching}
- onPress={() => liveTask.refetch()}
- >
- <Text style={styles.error}>
- Could not check task status. Tap to try again.
- </Text>
- </Pressable>
- ) : null}
- <Glass style={styles.actionsGlass} tint={colors.glassTint}>
- {canDismiss ? (
- <CardButton
- label="Dismiss"
- disabled={dismiss.isPending}
- onPress={onDismiss}
- />
- ) : null}
- {prUrl ? (
- <CardButton
- label="Open pull request"
- primary
- onPress={() => Linking.openURL(prUrl).catch(() => {})}
- />
- ) : null}
- {canStart ? (
- <CardButton
- label="Start task"
- primary
- disabled={startTask.isPending}
- onPress={onStart}
- />
- ) : null}
- </Glass>
- </View>
- ) : null}
- </View>
- );
-}
-
-const styles = StyleSheet.create({
- root: { flex: 1, paddingHorizontal: 20, paddingTop: 12 },
- muted: { fontFamily: fonts.sans, fontSize: 14, color: colors.inkMute },
- actions: { position: "absolute", left: 16, right: 16, bottom: 0, gap: 8 },
- actionsGlass: {
- flexDirection: "row",
- gap: 8,
- padding: 10,
- borderRadius: radius.pill,
- overflow: "hidden",
- },
- error: {
- alignSelf: "center",
- fontFamily: fonts.sans,
- fontSize: 13,
- color: colors.inkMute,
- },
-});
diff --git a/products/desktop/apps/mobilehog/src/app/settings/_layout.tsx b/products/desktop/apps/mobilehog/src/app/settings/_layout.tsx
deleted file mode 100644
index 5aea9c61998d..000000000000
--- a/products/desktop/apps/mobilehog/src/app/settings/_layout.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { Stack } from "expo-router";
-import { colors } from "@/lib/theme";
-
-// Settings drills down with native pushes inside the modal.
-export default function SettingsLayout() {
- return (
- <Stack
- screenOptions={{
- headerShown: false,
- contentStyle: { backgroundColor: colors.bg },
- }}
- />
- );
-}
diff --git a/products/desktop/apps/mobilehog/src/app/settings/index.tsx b/products/desktop/apps/mobilehog/src/app/settings/index.tsx
deleted file mode 100644
index 20f42ec94cf5..000000000000
--- a/products/desktop/apps/mobilehog/src/app/settings/index.tsx
+++ /dev/null
@@ -1,369 +0,0 @@
-import Constants from "expo-constants";
-import { useRouter } from "expo-router";
-import * as Updates from "expo-updates";
-import { useState } from "react";
-import {
- Alert,
- Pressable,
- ScrollView,
- StyleSheet,
- Switch,
- Text,
- View,
-} from "react-native";
-import { GlassCircleButton } from "@/components/Glass";
-import { useAuth } from "@/lib/auth";
-import { unregisterPushToken } from "@/lib/notifications";
-import { type AppearanceMode, usePrefs } from "@/lib/prefs";
-import { colors, fonts, radius } from "@/lib/theme";
-
-export default function SettingsSheet() {
- const router = useRouter();
- const session = useAuth((s) => s.session);
- const logout = useAuth((s) => s.logout);
- const hedgehogMode = usePrefs((s) => s.hedgehogMode);
- const appearance = usePrefs((s) => s.appearance);
- const setPrefs = usePrefs((s) => s.set);
- const initials = (session?.userName ?? "").slice(0, 2).toUpperCase();
-
- const finishLogout = async (): Promise<void> => {
- router.back();
- await logout();
- };
-
- const signOut = async (): Promise<void> => {
- if (await unregisterPushToken()) {
- await finishLogout();
- return;
- }
- Alert.alert(
- "Could not turn off notifications",
- "This device can still get notifications for this account. Check your connection and try again.",
- [
- {
- text: "Log out anyway",
- style: "destructive",
- onPress: () => void finishLogout(),
- },
- { text: "Try again", style: "cancel", onPress: () => void signOut() },
- ],
- );
- };
-
- return (
- <ScrollView style={styles.root} contentContainerStyle={styles.content}>
- <View style={styles.header}>
- <GlassCircleButton size={44} onPress={() => router.back()}>
- <Text style={styles.close}>×</Text>
- </GlassCircleButton>
- <Text style={styles.title}>Settings</Text>
- <View style={{ width: 44 }} />
- </View>
-
- <View style={styles.card}>
- <Pressable
- onPress={() => router.push("/settings/projects")}
- style={({ pressed }) => [
- styles.accountRow,
- pressed && { opacity: 0.5 },
- ]}
- >
- <View style={styles.avatar}>
- <Text style={styles.avatarText}>{initials}</Text>
- </View>
- <View style={{ flex: 1 }}>
- <Text style={styles.email} numberOfLines={1}>
- {session?.email ?? session?.userName}
- </Text>
- <Text style={styles.sub} numberOfLines={1}>
- {session?.projectName}
- {session
- ? ` · ${session.region === "local" ? "Local" : session.region.toUpperCase()}`
- : ""}
- </Text>
- </View>
- <Text style={styles.chevron}>›</Text>
- </Pressable>
- </View>
-
- <Text style={styles.section}>Appearance</Text>
- <View style={styles.card}>
- <View style={styles.modes}>
- {MODES.map((mode) => (
- <ModeOption
- key={mode.value}
- mode={mode}
- selected={appearance === mode.value}
- onPress={() => setPrefs({ appearance: mode.value })}
- />
- ))}
- </View>
- <View style={[styles.row, styles.rowDivided]}>
- <Text style={styles.rowLabel}>Hedgehog mode</Text>
- <Switch
- value={hedgehogMode}
- onValueChange={(value) => setPrefs({ hedgehogMode: value })}
- trackColor={{ true: colors.accent }}
- />
- </View>
- </View>
-
- <Text style={styles.section}>About</Text>
- <View style={styles.card}>
- <View style={styles.row}>
- <Text style={styles.rowLabel}>Version</Text>
- <Text style={styles.rowValue}>
- {Constants.expoConfig?.version}
- {Constants.expoConfig?.ios?.buildNumber
- ? ` (${Constants.expoConfig.ios.buildNumber})`
- : ""}
- </Text>
- </View>
- {Updates.isEnabled ? <UpdateRow /> : null}
- </View>
-
- <Pressable
- onPress={() => void signOut()}
- style={({ pressed }) => [styles.logout, pressed && { opacity: 0.7 }]}
- >
- <Text style={styles.logoutText}>Log out</Text>
- </Pressable>
- </ScrollView>
- );
-}
-
-const MODES: { value: AppearanceMode; label: string }[] = [
- { value: "light", label: "Light" },
- { value: "dark", label: "Dark" },
- { value: "system", label: "System" },
-];
-
-// A tiny phone-screen mockup for each scheme; System is split diagonally.
-function ModeOption({
- mode,
- selected,
- onPress,
-}: {
- mode: (typeof MODES)[number];
- selected: boolean;
- onPress: () => void;
-}) {
- const Half = ({ dark }: { dark: boolean }) => (
- <View style={[styles.thumb, dark ? styles.thumbDark : styles.thumbLight]}>
- <View style={[styles.thumbCard, dark && styles.thumbCardDark]}>
- <View style={[styles.thumbLine, { width: 36 }]} />
- <View style={[styles.thumbLine, { width: 26 }]} />
- <View style={styles.thumbDot} />
- </View>
- </View>
- );
- return (
- <Pressable onPress={onPress} style={styles.mode}>
- <View style={[styles.thumbFrame, selected && styles.thumbSelected]}>
- <Half dark={mode.value === "dark"} />
- {mode.value === "system" ? (
- <View style={styles.diagonal}>
- <View style={styles.diagonalInner}>
- <Half dark />
- </View>
- </View>
- ) : null}
- </View>
- <Text style={[styles.modeLabel, selected && styles.modeLabelSelected]}>
- {mode.label}
- </Text>
- </Pressable>
- );
-}
-
-const THUMB_W = 96;
-const THUMB_H = 64;
-
-type UpdateState = "idle" | "checking" | "latest" | "ready" | "failed";
-
-const UPDATE_STATUS: Record<UpdateState, string> = {
- idle: "",
- checking: "Checking…",
- latest: "Up to date",
- ready: "Restart",
- failed: "Try again",
-};
-
-function UpdateRow() {
- const [state, setState] = useState<UpdateState>("idle");
- const onPress = async (): Promise<void> => {
- if (state === "ready") {
- await Updates.reloadAsync();
- return;
- }
- setState("checking");
- try {
- const result = await Updates.checkForUpdateAsync();
- if (!result.isAvailable) {
- setState("latest");
- return;
- }
- await Updates.fetchUpdateAsync();
- setState("ready");
- } catch {
- setState("failed");
- }
- };
- return (
- <Pressable
- onPress={onPress}
- disabled={state === "checking"}
- style={({ pressed }) => [
- styles.row,
- styles.rowDivided,
- pressed && { opacity: 0.5 },
- ]}
- >
- <Text style={styles.rowLabel}>
- {state === "ready" ? "Update ready" : "Check for updates"}
- </Text>
- <Text style={[styles.rowValue, state === "ready" && styles.rowAccent]}>
- {UPDATE_STATUS[state]}
- </Text>
- </Pressable>
- );
-}
-
-const styles = StyleSheet.create({
- modes: {
- flexDirection: "row",
- justifyContent: "space-between",
- paddingVertical: 14,
- paddingHorizontal: 2,
- },
- mode: { alignItems: "center", gap: 8 },
- thumbFrame: {
- width: THUMB_W,
- height: THUMB_H,
- borderRadius: 14,
- overflow: "hidden",
- borderWidth: 2,
- borderColor: "transparent",
- },
- thumbSelected: { borderColor: colors.accent },
- thumb: {
- width: THUMB_W - 4,
- height: THUMB_H - 4,
- padding: 6,
- borderRadius: 12,
- },
- thumbLight: { backgroundColor: "#F4F4F0" },
- thumbDark: { backgroundColor: "#0C0C0C" },
- thumbCard: {
- flex: 1,
- borderRadius: 8,
- backgroundColor: "#FFFFFF",
- padding: 7,
- gap: 4,
- },
- thumbCardDark: { backgroundColor: "#1C1C1C" },
- thumbLine: { height: 4, borderRadius: 2, backgroundColor: "#8F918D" },
- thumbDot: {
- position: "absolute",
- right: 8,
- bottom: 7,
- width: 10,
- height: 10,
- borderRadius: 5,
- backgroundColor: colors.accent,
- },
- // Dark half of the System thumb: an oversized clip rotated to the diagonal
- // and pushed below it, with the content counter-transformed back into place.
- diagonal: {
- position: "absolute",
- left: -THUMB_W / 2,
- top: -THUMB_H / 2,
- width: THUMB_W * 2,
- height: THUMB_H * 2,
- overflow: "hidden",
- transform: [{ rotate: "-34deg" }, { translateY: THUMB_H }],
- },
- diagonalInner: {
- position: "absolute",
- left: THUMB_W / 2,
- top: THUMB_H / 2,
- transform: [{ translateY: -THUMB_H }, { rotate: "34deg" }],
- },
- modeLabel: { fontFamily: fonts.sans, fontSize: 15, color: colors.ink },
- modeLabelSelected: { color: colors.accent },
- rowDivided: {
- borderTopWidth: StyleSheet.hairlineWidth,
- borderTopColor: colors.line,
- },
- root: { flex: 1, backgroundColor: colors.bg },
- content: { padding: 18, paddingTop: 22, gap: 14, paddingBottom: 40 },
- header: {
- flexDirection: "row",
- alignItems: "center",
- justifyContent: "space-between",
- marginBottom: 6,
- },
- close: { fontSize: 26, lineHeight: 28, color: colors.ink, marginTop: -2 },
- title: { fontFamily: fonts.sansSemi, fontSize: 17, color: colors.ink },
- card: {
- backgroundColor: colors.surface,
- borderRadius: radius.card,
- paddingHorizontal: 16,
- paddingVertical: 6,
- },
- accountRow: {
- flexDirection: "row",
- alignItems: "center",
- gap: 14,
- paddingVertical: 12,
- },
- avatar: {
- width: 44,
- height: 44,
- borderRadius: 22,
- backgroundColor: colors.bgDeep,
- alignItems: "center",
- justifyContent: "center",
- },
- avatarText: {
- fontFamily: fonts.sansBold,
- fontSize: 13,
- color: colors.accent,
- },
- email: { fontFamily: fonts.sansMedium, fontSize: 16, color: colors.ink },
- sub: {
- fontFamily: fonts.sans,
- fontSize: 13,
- color: colors.inkMute,
- marginTop: 2,
- },
- chevron: { fontSize: 20, lineHeight: 22, color: colors.inkMute },
- section: {
- fontFamily: fonts.sans,
- fontSize: 14,
- color: colors.inkMute,
- marginTop: 8,
- marginLeft: 6,
- },
- row: {
- flexDirection: "row",
- alignItems: "center",
- justifyContent: "space-between",
- paddingVertical: 10,
- },
- rowLabel: { fontFamily: fonts.sans, fontSize: 16, color: colors.ink },
- logout: {
- marginTop: 16,
- backgroundColor: colors.surface,
- borderRadius: radius.card,
- paddingVertical: 16,
- alignItems: "center",
- },
- logoutText: {
- fontFamily: fonts.sansSemi,
- fontSize: 16,
- color: colors.danger,
- },
- rowValue: { fontFamily: fonts.sans, fontSize: 16, color: colors.inkMute },
- rowAccent: { fontFamily: fonts.sansMedium, color: colors.accent },
-});
diff --git a/products/desktop/apps/mobilehog/src/app/settings/projects.tsx b/products/desktop/apps/mobilehog/src/app/settings/projects.tsx
deleted file mode 100644
index 803ac536529e..000000000000
--- a/products/desktop/apps/mobilehog/src/app/settings/projects.tsx
+++ /dev/null
@@ -1,54 +0,0 @@
-import { useRouter } from "expo-router";
-import { ActivityIndicator, Alert, ScrollView, Text, View } from "react-native";
-import { SheetHeader } from "@/components/SheetHeader";
-import { SheetRow, sheetStyles } from "@/components/SheetRow";
-import { useAuth } from "@/lib/auth";
-import { useProjects } from "@/lib/projects";
-import { colors } from "@/lib/theme";
-
-export default function ProjectsPage() {
- const router = useRouter();
- const projects = useProjects();
- const currentId = useAuth((s) => s.session?.projectId);
- const selectProject = useAuth((s) => s.selectProject);
-
- return (
- <ScrollView
- style={sheetStyles.root}
- contentContainerStyle={sheetStyles.list}
- >
- <SheetHeader title="Projects" back />
- {projects.isLoading ? (
- <ActivityIndicator color={colors.inkSoft} style={{ marginTop: 24 }} />
- ) : null}
- {projects.isError ? (
- <Text style={sheetStyles.footnote}>
- Could not load projects. Go back and try again.
- </Text>
- ) : null}
- {projects.data?.length ? (
- <View style={sheetStyles.card}>
- {projects.data.map((project, index) => (
- <SheetRow
- key={project.id}
- first={index === 0}
- checked={project.id === currentId}
- label={project.name}
- onPress={async () => {
- try {
- await selectProject(project.id, project.name);
- router.back();
- } catch {
- Alert.alert(
- "Could not switch project",
- "Check your connection and try again.",
- );
- }
- }}
- />
- ))}
- </View>
- ) : null}
- </ScrollView>
- );
-}
diff --git a/products/desktop/apps/mobilehog/src/components/ChatHeader.tsx b/products/desktop/apps/mobilehog/src/components/ChatHeader.tsx
deleted file mode 100644
index 4c019e347b3a..000000000000
--- a/products/desktop/apps/mobilehog/src/components/ChatHeader.tsx
+++ /dev/null
@@ -1,126 +0,0 @@
-import { Button, Host, Image, Menu } from "@expo/ui/swift-ui";
-import { frame } from "@expo/ui/swift-ui/modifiers";
-import { isSafeGitHubPullRequestUrl } from "@posthog/shared";
-import type { Task } from "@posthog/shared/domain-types";
-import { useNavigation, useRouter } from "expo-router";
-import { Linking, Pressable, StyleSheet, View } from "react-native";
-import { useSafeAreaInsets } from "react-native-safe-area-context";
-import { Glass, GlassCircleButton } from "@/components/Glass";
-import { MenuIcon } from "@/components/Icons";
-import { useTaskActions } from "@/components/TaskRow";
-import { colors } from "@/lib/theme";
-
-const BUTTON = 46;
-
-interface ChatHeaderProps {
- showNewChat?: boolean;
- // The open chat's task, for the options menu beside new chat.
- task?: Task;
-}
-
-export function ChatHeader({ showNewChat = true, task }: ChatHeaderProps) {
- const navigation = useNavigation<{ openDrawer: () => void }>();
- const router = useRouter();
- const insets = useSafeAreaInsets();
- const { rename, setArchived } = useTaskActions(task);
- const prUrl = task?.latest_run?.output?.pr_url;
- const safePrUrl =
- typeof prUrl === "string" && isSafeGitHubPullRequestUrl(prUrl)
- ? prUrl
- : null;
- return (
- <View
- style={[styles.root, { paddingTop: insets.top + 6 }]}
- pointerEvents="box-none"
- >
- <GlassCircleButton onPress={() => navigation.openDrawer()}>
- <MenuIcon />
- </GlassCircleButton>
- <View style={{ flex: 1 }} pointerEvents="none" />
- {showNewChat ? (
- <Glass interactive style={styles.pair}>
- <Pressable
- onPress={() => router.replace("/(drawer)")}
- hitSlop={8}
- style={({ pressed }) => [
- styles.pairButton,
- pressed && { opacity: 0.6 },
- ]}
- >
- <Host matchContents>
- <Image
- systemName="square.and.pencil"
- size={18}
- color={colors.ink}
- />
- </Host>
- </Pressable>
- {task ? (
- <>
- <View style={styles.divider} />
- <Host matchContents>
- <Menu
- label={
- <Image systemName="ellipsis" size={18} color={colors.ink} />
- }
- modifiers={[frame({ width: BUTTON, height: BUTTON })]}
- >
- {safePrUrl ? (
- <Button
- label="Open pull request"
- systemImage="arrow.triangle.pull"
- onPress={() => Linking.openURL(safePrUrl).catch(() => {})}
- />
- ) : null}
- <Button
- label="Rename"
- systemImage="pencil"
- onPress={rename}
- />
- <Button
- label="Archive"
- systemImage="archivebox"
- onPress={() =>
- setArchived(true, () => router.replace("/(drawer)"))
- }
- />
- </Menu>
- </Host>
- </>
- ) : null}
- </Glass>
- ) : null}
- </View>
- );
-}
-
-const styles = StyleSheet.create({
- root: {
- position: "absolute",
- top: 0,
- left: 0,
- right: 0,
- zIndex: 10,
- flexDirection: "row",
- alignItems: "center",
- paddingHorizontal: 16,
- },
- pair: {
- height: BUTTON,
- borderRadius: BUTTON / 2,
- flexDirection: "row",
- alignItems: "center",
- overflow: "hidden",
- },
- pairButton: {
- width: BUTTON,
- height: BUTTON,
- alignItems: "center",
- justifyContent: "center",
- },
- divider: {
- width: StyleSheet.hairlineWidth,
- height: 20,
- backgroundColor: colors.line,
- },
-});
diff --git a/products/desktop/apps/mobilehog/src/components/Composer.tsx b/products/desktop/apps/mobilehog/src/components/Composer.tsx
deleted file mode 100644
index c6de0fa7243b..000000000000
--- a/products/desktop/apps/mobilehog/src/components/Composer.tsx
+++ /dev/null
@@ -1,409 +0,0 @@
-import { Host, Image as SymbolImage } from "@expo/ui/swift-ui";
-import { getReasoningEffortOptions } from "@posthog/shared";
-import * as Haptics from "expo-haptics";
-import { useFocusEffect, useRouter } from "expo-router";
-import { useCallback, useEffect, useRef, useState } from "react";
-import {
- ActivityIndicator,
- Alert,
- type ColorValue,
- Image,
- Pressable,
- ScrollView,
- StyleSheet,
- Text,
- TextInput,
- View,
-} from "react-native";
-import Animated, {
- FadeIn,
- FadeOut,
- LinearTransition,
- ZoomIn,
- ZoomOut,
-} from "react-native-reanimated";
-import { Glass } from "@/components/Glass";
-import { ArrowUpIcon, StopIcon } from "@/components/Icons";
-import { Waveform } from "@/components/Waveform";
-import { MAX_PHOTOS, type Photo, pickPhotos } from "@/lib/attachments";
-import { sessionIdentity } from "@/lib/auth";
-import { beginSend, type Draft, loadDraft, saveDraft } from "@/lib/cache";
-import { useComposer } from "@/lib/composer";
-import { useDictation } from "@/lib/dictation";
-import { shortModelName } from "@/lib/models";
-import { colors, fonts, radius } from "@/lib/theme";
-
-function Glyph({
- name,
- size = 17,
- color = colors.ink,
-}: {
- name: "plus" | "mic" | "xmark" | "stop.fill";
- size?: number;
- color?: ColorValue;
-}) {
- return (
- <Host matchContents>
- <SymbolImage systemName={name} size={size} color={color} />
- </Host>
- );
-}
-
-interface ComposerProps {
- placeholder: string;
- // Shown as a second pill when provided (null = no repository chosen).
- repository?: string | null;
- onSend: (text: string, photos: Photo[]) => void | Promise<void>;
- onStop?: () => void;
- busy?: boolean;
- sending?: boolean;
- autoFocus?: boolean;
- // Where the unsent text and photos are kept; omit to keep no draft.
- draftKey?: string;
-}
-
-const DRAFT_DELAY = 400;
-
-export function Composer({
- placeholder,
- repository,
- onSend,
- onStop,
- busy,
- sending,
- autoFocus,
- draftKey,
-}: ComposerProps) {
- const router = useRouter();
- const [initial] = useState(() => (draftKey ? loadDraft(draftKey) : null));
- const [text, setText] = useState(initial?.text ?? "");
- const [photos, setPhotos] = useState<Photo[]>(initial?.photos ?? []);
- const latest = useRef<Draft>({ text, photos });
- const hydratedKey = useRef(draftKey);
- const withSpeech = (base: string, heard: string): string =>
- [base.trim(), heard.trim()].filter(Boolean).join(" ");
- const dictation = useDictation((heard) =>
- setText((current) => withSpeech(current, heard)),
- );
- // Drawer screens stay mounted when another route gets focus, so stop the microphone on blur.
- useFocusEffect(useCallback(() => dictation.cancel, [dictation.cancel]));
- const { model, adapter, reasoning } = useComposer();
- const effort = getReasoningEffortOptions(adapter, model)?.find(
- (option) => option.value === reasoning,
- )?.name;
- const shown = dictation.active
- ? withSpeech(text, dictation.transcript)
- : text;
- const canSend =
- (shown.trim().length > 0 || photos.length > 0) &&
- !sending &&
- !dictation.stopping;
-
- useEffect(() => {
- latest.current = { text, photos };
- }, [text, photos]);
-
- // The chat screen stays mounted across chats, so swap drafts with the key.
- useEffect(() => {
- if (draftKey === hydratedKey.current) return;
- hydratedKey.current = draftKey;
- const saved = draftKey ? loadDraft(draftKey) : null;
- setText(saved?.text ?? "");
- setPhotos(saved?.photos ?? []);
- }, [draftKey]);
-
- useEffect(() => {
- if (!draftKey) return;
- const timer = setTimeout(
- () => saveDraft(draftKey, { text, photos }),
- DRAFT_DELAY,
- );
- return () => clearTimeout(timer);
- }, [draftKey, text, photos]);
-
- // Leaving inside the debounce window still keeps the draft. A sign-out or
- // project switch remounts the app after the session changed, so skip that.
- useEffect(() => {
- if (!draftKey) return;
- const identity = sessionIdentity();
- return () => {
- if (sessionIdentity() === identity) saveDraft(draftKey, latest.current);
- };
- }, [draftKey]);
-
- const attach = async (): Promise<void> => {
- try {
- const picked = await pickPhotos(MAX_PHOTOS - photos.length);
- if (picked.length) setPhotos((current) => [...current, ...picked]);
- } catch {
- Alert.alert("Could not open photos", "Check photo access in Settings.");
- }
- };
-
- const startDictation = (): void => {
- Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light).catch(() => {});
- dictation.start();
- };
-
- const stopDictation = async (): Promise<void> => {
- const heard = await dictation.stop();
- if (heard !== null) setText((current) => withSpeech(current, heard));
- };
-
- // The input shows the live transcript, so an edit already holds it. Dropping the transcript keeps it from being added twice.
- const editText = (value: string): void => {
- if (dictation.active) dictation.cancel();
- setText(value);
- };
-
- const submit = async (): Promise<void> => {
- if (dictation.stopping || sending) return;
- const heard = dictation.active ? await dictation.stop() : "";
- // An edit, cancel or blur during the wait ends the send and keeps the draft.
- if (heard === null) return;
- const value = withSpeech(text, heard).trim();
- if ((!value && !photos.length) || sending) return;
- const attached = photos;
- setText("");
- setPhotos([]);
- latest.current = { text: "", photos: [] };
- const settle = draftKey
- ? beginSend(draftKey, { text: value, photos: attached })
- : undefined;
- try {
- await onSend(value, attached);
- } catch {
- settle?.(false);
- if (hydratedKey.current === draftKey) {
- // Keep a draft the person started while the send was in flight.
- setText((current) => (current.trim() ? current : value));
- setPhotos((current) => (current.length ? current : attached));
- }
- return;
- }
- settle?.(true);
- };
-
- return (
- <Glass style={styles.shell}>
- {photos.length ? (
- <ScrollView
- horizontal
- showsHorizontalScrollIndicator={false}
- contentContainerStyle={styles.thumbs}
- >
- {photos.map((photo) => (
- <Animated.View
- key={photo.id}
- entering={ZoomIn.duration(180)}
- exiting={ZoomOut.duration(140)}
- layout={LinearTransition.duration(180)}
- >
- <Image source={{ uri: photo.uri }} style={styles.thumb} />
- <Pressable
- accessibilityLabel="Remove photo"
- hitSlop={8}
- onPress={() =>
- setPhotos((current) =>
- current.filter((item) => item.id !== photo.id),
- )
- }
- style={styles.thumbRemove}
- >
- <Glyph name="xmark" size={10} color={colors.darkText} />
- </Pressable>
- </Animated.View>
- ))}
- </ScrollView>
- ) : null}
- <TextInput
- value={shown}
- onChangeText={editText}
- placeholder={placeholder}
- placeholderTextColor={colors.inkMute}
- style={styles.input}
- multiline
- autoFocus={autoFocus}
- />
- <View style={styles.row}>
- {dictation.active ? (
- <Pressable
- accessibilityLabel="Cancel dictation"
- onPress={dictation.cancel}
- style={({ pressed }) => [
- styles.circle,
- pressed && { opacity: 0.6 },
- ]}
- >
- <Glyph name="xmark" />
- </Pressable>
- ) : (
- <Pressable
- accessibilityLabel="Add photos"
- onPress={attach}
- disabled={photos.length >= MAX_PHOTOS}
- style={({ pressed }) => [
- styles.circle,
- pressed && { opacity: 0.6 },
- ]}
- >
- <Glyph name="plus" />
- </Pressable>
- )}
- {dictation.active ? (
- <Animated.View entering={FadeIn.duration(200)} style={styles.middle}>
- <Waveform levels={dictation.levels} head={dictation.head} />
- </Animated.View>
- ) : (
- <Animated.View
- entering={FadeIn.duration(200)}
- exiting={FadeOut.duration(120)}
- style={styles.middle}
- >
- <Pressable
- onPress={() => router.push("/config")}
- style={({ pressed }) => [
- styles.pill,
- pressed && { opacity: 0.6 },
- ]}
- >
- <Text style={styles.pillText} numberOfLines={1}>
- {shortModelName(model)}
- {effort ? (
- <Text style={styles.pillMuted}> {effort}</Text>
- ) : null}
- </Text>
- </Pressable>
- {repository !== undefined ? (
- <Pressable
- onPress={() => router.push("/picker")}
- style={({ pressed }) => [
- styles.pill,
- styles.pillWide,
- pressed && { opacity: 0.6 },
- ]}
- >
- <Text style={styles.pillText} numberOfLines={1}>
- {repository
- ? (repository.split("/")[1] ?? repository)
- : "No repo"}
- </Text>
- </Pressable>
- ) : null}
- </Animated.View>
- )}
- <Pressable
- accessibilityLabel={dictation.active ? "Stop dictation" : "Dictate"}
- onPress={dictation.active ? stopDictation : startDictation}
- style={({ pressed }) => [styles.circle, pressed && { opacity: 0.6 }]}
- >
- <Glyph
- name={dictation.active ? "stop.fill" : "mic"}
- size={dictation.active ? 14 : 17}
- />
- </Pressable>
- {busy && onStop ? (
- <Pressable
- onPress={onStop}
- style={({ pressed }) => [styles.send, pressed && { opacity: 0.7 }]}
- >
- <StopIcon />
- </Pressable>
- ) : (
- <Pressable
- onPress={submit}
- disabled={!canSend}
- style={({ pressed }) => [
- styles.send,
- !canSend && styles.sendDisabled,
- pressed && { opacity: 0.7 },
- ]}
- >
- {sending ? (
- <ActivityIndicator size="small" color={colors.darkText} />
- ) : (
- <ArrowUpIcon />
- )}
- </Pressable>
- )}
- </View>
- </Glass>
- );
-}
-
-const CONTROL = 36;
-
-const THUMB = 64;
-
-const styles = StyleSheet.create({
- thumbs: { gap: 8, paddingTop: 2, paddingRight: 8 },
- thumb: {
- width: THUMB,
- height: THUMB,
- borderRadius: 14,
- backgroundColor: colors.fill,
- },
- thumbRemove: {
- position: "absolute",
- top: 4,
- right: 4,
- width: 20,
- height: 20,
- borderRadius: 10,
- backgroundColor: "rgba(21, 21, 21, 0.6)",
- alignItems: "center",
- justifyContent: "center",
- },
- shell: {
- borderRadius: 28,
- paddingHorizontal: 16,
- paddingTop: 14,
- paddingBottom: 10,
- gap: 10,
- overflow: "hidden",
- },
- input: {
- fontFamily: fonts.sans,
- fontSize: 17,
- lineHeight: 22,
- color: colors.ink,
- maxHeight: 140,
- paddingTop: 0,
- },
- row: { flexDirection: "row", alignItems: "center", gap: 6 },
- circle: {
- width: CONTROL,
- height: CONTROL,
- borderRadius: CONTROL / 2,
- backgroundColor: colors.fill,
- alignItems: "center",
- justifyContent: "center",
- },
- pill: {
- height: CONTROL,
- justifyContent: "center",
- backgroundColor: colors.fill,
- paddingHorizontal: 12,
- borderRadius: radius.pill,
- },
- // Only the repository gives way when the row runs out of room.
- pillWide: { flexShrink: 1, maxWidth: 130 },
- pillText: { fontFamily: fonts.sansMedium, fontSize: 14, color: colors.ink },
- pillMuted: { color: colors.inkMute },
- send: {
- width: CONTROL,
- height: CONTROL,
- borderRadius: CONTROL / 2,
- backgroundColor: colors.dark,
- alignItems: "center",
- justifyContent: "center",
- },
- sendDisabled: { opacity: 0.3 },
- // Holds the pills or the waveform between the left button and the mic.
- middle: {
- flex: 1,
- flexDirection: "row",
- alignItems: "center",
- gap: 6,
- },
-});
diff --git a/products/desktop/apps/mobilehog/src/components/DrawerContent.tsx b/products/desktop/apps/mobilehog/src/components/DrawerContent.tsx
deleted file mode 100644
index 816b10367e1f..000000000000
--- a/products/desktop/apps/mobilehog/src/components/DrawerContent.tsx
+++ /dev/null
@@ -1,238 +0,0 @@
-import { Host, Image } from "@expo/ui/swift-ui";
-import { useRouter } from "expo-router";
-import { useDrawerStatus } from "expo-router/drawer";
-import { useMemo } from "react";
-import { Pressable, ScrollView, StyleSheet, Text, View } from "react-native";
-import { useSafeAreaInsets } from "react-native-safe-area-context";
-import { DrawerEdgeShadow } from "@/components/DrawerEdgeShadow";
-import { FadeScrim } from "@/components/FadeScrim";
-import { GlassCircleButton } from "@/components/Glass";
-import { BellIcon, SteeringIcon } from "@/components/Icons";
-import { activityAt, RowSkeletons, TaskRow } from "@/components/TaskRow";
-import { useActivity } from "@/lib/activity";
-import { useAuth } from "@/lib/auth";
-import { useTasks } from "@/lib/queries";
-import { useReportScope } from "@/lib/reportScope";
-import { useReportReadStates, useReports } from "@/lib/reports";
-import { colors, fonts, radius } from "@/lib/theme";
-
-export function DrawerContent({ closeDrawer }: { closeDrawer: () => void }) {
- const insets = useSafeAreaInsets();
- const router = useRouter();
- const tasks = useTasks();
- const userName = useAuth((s) => s.session?.userName ?? "");
- const unread = useActivity().data?.unread_count ?? 0;
- const scope = useReportScope((s) => s.scope);
- const reports = useReports("", "attention", { scope }).data;
- const reportIds = useMemo(
- () => (reports ?? []).map((report) => report.id),
- [reports],
- );
- // The badge shows only while the drawer is open, so read state does not poll
- // behind a closed drawer.
- const drawerOpen = useDrawerStatus() === "open";
- const newReports = useReportReadStates(reportIds, { enabled: drawerOpen })
- .unread.size;
- const sorted = useMemo(
- () =>
- [...(tasks.data ?? [])].sort((a, b) =>
- activityAt(b).localeCompare(activityAt(a)),
- ),
- [tasks.data],
- );
-
- const open = (taskId: string): void => {
- closeDrawer();
- router.push({ pathname: "/(drawer)/task/[id]", params: { id: taskId } });
- };
-
- return (
- <View style={[styles.root, { paddingTop: insets.top + 6 }]}>
- <DrawerEdgeShadow />
- <View style={styles.titleRow}>
- <Text style={styles.wordmark}>PostHog</Text>
- <GlassCircleButton
- onPress={() => {
- closeDrawer();
- router.push("/(drawer)/recents");
- }}
- >
- <Host matchContents>
- <Image systemName="magnifyingglass" size={18} color={colors.ink} />
- </Host>
- </GlassCircleButton>
- </View>
- <ScrollView
- contentContainerStyle={[
- styles.scroll,
- { paddingBottom: FOOTER_HEIGHT + insets.bottom + 24 },
- ]}
- showsVerticalScrollIndicator={false}
- >
- <Pressable
- onPress={() => {
- closeDrawer();
- router.push("/(drawer)/activity");
- }}
- style={({ pressed }) => [styles.navRow, pressed && { opacity: 0.5 }]}
- >
- <BellIcon />
- <Text style={styles.navLabel}>Activity</Text>
- {unread > 0 ? (
- <View style={styles.badge}>
- <Text style={styles.badgeText}>{unread}</Text>
- </View>
- ) : null}
- </Pressable>
- <Pressable
- onPress={() => {
- closeDrawer();
- router.push("/(drawer)/self-driving");
- }}
- style={({ pressed }) => [styles.navRow, pressed && { opacity: 0.5 }]}
- >
- <SteeringIcon />
- <Text style={styles.navLabel}>Self-driving</Text>
- {newReports > 0 ? (
- <View style={styles.badge}>
- <Text style={styles.badgeText}>{newReports}</Text>
- </View>
- ) : null}
- </Pressable>
- <View style={styles.group}>
- <Text style={styles.groupTitle}>Recent tasks</Text>
- {tasks.isLoading && sorted.length === 0 ? <RowSkeletons /> : null}
- {sorted.map((task) => (
- <TaskRow key={task.id} task={task} onPress={() => open(task.id)} />
- ))}
- </View>
- </ScrollView>
- <View
- style={[styles.footer, { paddingBottom: insets.bottom + 12 }]}
- pointerEvents="box-none"
- >
- <FadeScrim style={styles.footerScrim} color={colors.bgDeep} />
- <GlassCircleButton
- size={FOOTER_HEIGHT}
- onPress={() => router.push("/settings")}
- >
- <Text style={styles.avatarText}>
- {userName.slice(0, 2).toUpperCase()}
- </Text>
- </GlassCircleButton>
- <Pressable
- onPress={() => {
- closeDrawer();
- router.replace("/(drawer)");
- }}
- style={({ pressed }) => [styles.newTask, pressed && { opacity: 0.8 }]}
- >
- <Text style={styles.newTaskPlus}>+</Text>
- <Text style={styles.newTaskText}>New task</Text>
- </Pressable>
- </View>
- </View>
- );
-}
-
-const FOOTER_HEIGHT = 52;
-
-const styles = StyleSheet.create({
- root: {
- flex: 1,
- backgroundColor: colors.bgDeep,
- paddingLeft: 18,
- paddingRight: 18 + 72,
- marginRight: -72,
- },
- titleRow: {
- flexDirection: "row",
- alignItems: "center",
- justifyContent: "space-between",
- marginBottom: 18,
- },
- wordmark: {
- fontFamily: fonts.sansBold,
- fontSize: 30,
- color: colors.ink,
- marginLeft: 4,
- },
- scroll: { paddingBottom: 24, gap: 18 },
- navRow: {
- flexDirection: "row",
- alignItems: "center",
- gap: 12,
- paddingVertical: 8,
- paddingLeft: 4,
- },
- navLabel: {
- flex: 1,
- fontFamily: fonts.sansMedium,
- fontSize: 17,
- color: colors.ink,
- },
- badge: {
- minWidth: 22,
- height: 22,
- borderRadius: 11,
- backgroundColor: colors.accent,
- alignItems: "center",
- justifyContent: "center",
- paddingHorizontal: 6,
- },
- badgeText: { fontFamily: fonts.sansSemi, fontSize: 12, color: "#FFFFFF" },
- group: { gap: 2 },
- groupTitle: {
- fontFamily: fonts.sansSemi,
- fontSize: 12,
- letterSpacing: 1.2,
- textTransform: "uppercase",
- color: colors.inkMute,
- paddingLeft: 4,
- marginBottom: 4,
- },
- footer: {
- position: "absolute",
- left: 18,
- right: 18 + 72,
- bottom: 0,
- flexDirection: "row",
- alignItems: "center",
- justifyContent: "space-between",
- paddingTop: 12,
- },
- footerScrim: {
- position: "absolute",
- left: -18,
- right: -(18 + 72),
- top: -36,
- bottom: 0,
- },
- avatarText: {
- fontSize: 14,
- fontFamily: fonts.sansBold,
- color: colors.ink,
- },
- newTask: {
- height: FOOTER_HEIGHT,
- flexDirection: "row",
- alignItems: "center",
- gap: 8,
- backgroundColor: colors.dark,
- paddingLeft: 18,
- paddingRight: 24,
- borderRadius: radius.pill,
- },
- newTaskPlus: {
- color: colors.darkText,
- fontSize: 26,
- lineHeight: 28,
- fontFamily: fonts.sansMedium,
- marginTop: -2,
- },
- newTaskText: {
- color: colors.darkText,
- fontSize: 16,
- fontFamily: fonts.sansSemi,
- },
-});
diff --git a/products/desktop/apps/mobilehog/src/components/DrawerEdgeShadow.tsx b/products/desktop/apps/mobilehog/src/components/DrawerEdgeShadow.tsx
deleted file mode 100644
index 215db2256c65..000000000000
--- a/products/desktop/apps/mobilehog/src/components/DrawerEdgeShadow.tsx
+++ /dev/null
@@ -1,42 +0,0 @@
-import { useDrawerProgress } from "expo-router/drawer";
-import { StyleSheet, useWindowDimensions } from "react-native";
-import Animated, {
- interpolate,
- type SharedValue,
- useAnimatedStyle,
-} from "react-native-reanimated";
-import { colors, drawer } from "@/lib/theme";
-
-// The chat layer lives in a native screen that clips its shadow. This ghost
-// sits in the drawer exactly where the open chat layer lands, so only its
-// shadow shows, and it follows the same rounded corner.
-export function DrawerEdgeShadow() {
- const { width, height } = useWindowDimensions();
- const progress = useDrawerProgress() as SharedValue<number>;
- const fade = useAnimatedStyle(() => ({
- opacity: interpolate(progress.value, [0, 1], [0, 1]),
- }));
- return (
- <Animated.View
- pointerEvents="none"
- style={[
- styles.ghost,
- { left: width * drawer.widthFraction, width, height },
- fade,
- ]}
- />
- );
-}
-
-const styles = StyleSheet.create({
- ghost: {
- position: "absolute",
- top: 0,
- borderRadius: drawer.sceneRadius,
- backgroundColor: colors.bg,
- shadowColor: "#000",
- shadowOpacity: 0.14,
- shadowRadius: 28,
- shadowOffset: { width: -6, height: 0 },
- },
-});
diff --git a/products/desktop/apps/mobilehog/src/components/DrawerScene.tsx b/products/desktop/apps/mobilehog/src/components/DrawerScene.tsx
deleted file mode 100644
index 98207dd0ede1..000000000000
--- a/products/desktop/apps/mobilehog/src/components/DrawerScene.tsx
+++ /dev/null
@@ -1,42 +0,0 @@
-import { useDrawerProgress } from "expo-router/drawer";
-import type { ReactNode } from "react";
-import { StyleSheet } from "react-native";
-import Animated, {
- interpolate,
- type SharedValue,
- useAnimatedStyle,
-} from "react-native-reanimated";
-import { Glass } from "@/components/Glass";
-import { colors, drawer } from "@/lib/theme";
-
-// The chat surface is a frosted layer that slides over the menu: it dims and
-// rounds its corner while the drawer is open. Its shadow is painted by the
-// drawer (see DrawerEdgeShadow), because the native screen clips to bounds.
-export function DrawerScene({ children }: { children: ReactNode }) {
- const progress = useDrawerProgress() as SharedValue<number>;
- const clip = useAnimatedStyle(() => ({
- opacity: interpolate(progress.value, [0, 1], [1, 0.82]),
- borderRadius: interpolate(progress.value, [0, 1], [0, drawer.sceneRadius]),
- }));
- // Solid while closed so the drawer never ghosts through; fades out as the
- // drawer opens to let the glass edge frost it.
- const backing = useAnimatedStyle(() => ({
- opacity: interpolate(progress.value, [0, 1], [1, 0]),
- }));
- return (
- <Animated.View style={[styles.clip, clip]}>
- <Animated.View
- style={[StyleSheet.absoluteFill, styles.backing, backing]}
- />
- <Glass style={styles.scene} tint={colors.sceneTint}>
- {children}
- </Glass>
- </Animated.View>
- );
-}
-
-const styles = StyleSheet.create({
- clip: { flex: 1, overflow: "hidden" },
- backing: { backgroundColor: colors.bg },
- scene: { flex: 1 },
-});
diff --git a/products/desktop/apps/mobilehog/src/components/FadeScrim.tsx b/products/desktop/apps/mobilehog/src/components/FadeScrim.tsx
deleted file mode 100644
index fb25d92bbc9f..000000000000
--- a/products/desktop/apps/mobilehog/src/components/FadeScrim.tsx
+++ /dev/null
@@ -1,42 +0,0 @@
-import {
- type ColorValue,
- type StyleProp,
- StyleSheet,
- View,
- type ViewStyle,
-} from "react-native";
-import { colors } from "@/lib/theme";
-
-const STRIPS = 28;
-
-// Fades content out under the composer: clear at the top, solid at the
-// bottom. Stacked strips stand in for a gradient so no native module is needed.
-export function FadeScrim({
- style,
- color = colors.bg,
-}: {
- style?: StyleProp<ViewStyle>;
- color?: ColorValue;
-}) {
- return (
- <View pointerEvents="none" style={[styles.root, style]}>
- {Array.from({ length: STRIPS }, (_, index) => {
- const t = (index + 1) / STRIPS;
- return (
- <View
- key={String(index)}
- style={{
- flex: 1,
- backgroundColor: color,
- opacity: Math.min(1, t * t * 1.05),
- }}
- />
- );
- })}
- </View>
- );
-}
-
-const styles = StyleSheet.create({
- root: { flexDirection: "column" },
-});
diff --git a/products/desktop/apps/mobilehog/src/components/Glass.tsx b/products/desktop/apps/mobilehog/src/components/Glass.tsx
deleted file mode 100644
index eea0abd298c6..000000000000
--- a/products/desktop/apps/mobilehog/src/components/Glass.tsx
+++ /dev/null
@@ -1,115 +0,0 @@
-import { GlassView, isLiquidGlassAvailable } from "expo-glass-effect";
-import type { ReactNode } from "react";
-import {
- type ColorValue,
- type LayoutChangeEvent,
- Pressable,
- type StyleProp,
- StyleSheet,
- View,
- type ViewStyle,
-} from "react-native";
-import { colors } from "@/lib/theme";
-
-const liquid = isLiquidGlassAvailable();
-
-interface GlassProps {
- children?: ReactNode;
- style?: StyleProp<ViewStyle>;
- interactive?: boolean;
- tint?: ColorValue;
- onLayout?: (event: LayoutChangeEvent) => void;
-}
-
-// Real Liquid Glass on iOS 26, a translucent card everywhere else.
-export function Glass({
- children,
- style,
- interactive,
- tint,
- onLayout,
-}: GlassProps) {
- if (liquid) {
- return (
- <GlassView
- glassEffectStyle="regular"
- isInteractive={interactive}
- tintColor={tint}
- style={style}
- onLayout={onLayout}
- >
- {children}
- </GlassView>
- );
- }
- return (
- <View
- style={[
- styles.fallback,
- style,
- tint != null && { backgroundColor: tint },
- ]}
- onLayout={onLayout}
- >
- {children}
- </View>
- );
-}
-
-interface GlassButtonProps {
- children: ReactNode;
- onPress: () => void;
- size?: number;
- disabled?: boolean;
- tint?: ColorValue;
- style?: StyleProp<ViewStyle>;
-}
-
-export function GlassCircleButton({
- children,
- onPress,
- size = 46,
- disabled,
- tint,
- style,
-}: GlassButtonProps) {
- return (
- <Pressable onPress={onPress} disabled={disabled} hitSlop={8}>
- {({ pressed }) => (
- <Glass
- interactive
- tint={tint}
- style={[
- styles.circle,
- {
- width: size,
- height: size,
- borderRadius: size / 2,
- opacity: pressed ? 0.7 : 1,
- },
- style,
- ]}
- >
- {children}
- </Glass>
- )}
- </Pressable>
- );
-}
-
-const styles = StyleSheet.create({
- fallback: {
- backgroundColor: colors.glass,
- borderWidth: StyleSheet.hairlineWidth,
- borderColor: colors.line,
- shadowColor: "#000",
- shadowOpacity: 0.06,
- shadowRadius: 12,
- shadowOffset: { width: 0, height: 4 },
- },
- circle: {
- alignItems: "center",
- justifyContent: "center",
- overflow: "hidden",
- },
-});
diff --git a/products/desktop/apps/mobilehog/src/components/Hedgehog.tsx b/products/desktop/apps/mobilehog/src/components/Hedgehog.tsx
deleted file mode 100644
index 4f93953d0f46..000000000000
--- a/products/desktop/apps/mobilehog/src/components/Hedgehog.tsx
+++ /dev/null
@@ -1,110 +0,0 @@
-import { useEffect, useState } from "react";
-import { StyleSheet, View } from "react-native";
-import Animated, {
- cancelAnimation,
- Easing,
- useAnimatedStyle,
- useDerivedValue,
- useSharedValue,
- withRepeat,
- withSequence,
- withTiming,
-} from "react-native-reanimated";
-
-// Sprite strips from @posthog/hedgehog-mode's default skin, 80px frames.
-const WALK = {
- source: require("../../assets/hedgehog/walk-strip.png"),
- frames: 11,
- fps: 30,
-};
-const IDLE = {
- source: require("../../assets/hedgehog/idle-strip.png"),
- frames: 25,
- fps: 6,
-};
-
-const SIZE = 56;
-const SPEED = 70; // px per second
-
-interface HedgehogProps {
- walking: boolean;
-}
-
-// Paces back and forth while the agent thinks or runs tools, idles otherwise.
-// Everything animates on the UI thread, so the JS thread stays free for input.
-export function Hedgehog({ walking }: HedgehogProps) {
- const [width, setWidth] = useState(0);
- const anim = walking ? WALK : IDLE;
- const frame = useSharedValue(0);
- const x = useSharedValue(0);
- const previous = useSharedValue(0);
- const heading = useSharedValue(1);
-
- useEffect(() => {
- frame.value = 0;
- frame.value = withRepeat(
- withTiming(anim.frames, {
- duration: (anim.frames / anim.fps) * 1000,
- easing: Easing.linear,
- }),
- -1,
- );
- return () => cancelAnimation(frame);
- }, [anim, frame]);
-
- useEffect(() => {
- const max = Math.max(0, width - SIZE);
- if (!walking || max === 0) {
- cancelAnimation(x);
- return;
- }
- // Finish the current leg from wherever we are, then bounce between the edges.
- const toEnd = ((max - x.value) / SPEED) * 1000;
- const leg = (max / SPEED) * 1000;
- x.value = withSequence(
- withTiming(max, { duration: toEnd, easing: Easing.linear }),
- withRepeat(
- withSequence(
- withTiming(0, { duration: leg, easing: Easing.linear }),
- withTiming(max, { duration: leg, easing: Easing.linear }),
- ),
- -1,
- ),
- );
- }, [walking, width, x]);
-
- // Face the direction of travel; the sprites are drawn facing right.
- const facing = useDerivedValue(() => {
- if (x.value !== previous.value) {
- heading.value = x.value > previous.value ? 1 : -1;
- previous.value = x.value;
- }
- return heading.value;
- });
- const sprite = useAnimatedStyle(() => ({
- transform: [{ translateX: x.value }, { scaleX: facing.value }],
- }));
- const strip = useAnimatedStyle(() => ({
- transform: [{ translateX: -Math.floor(frame.value % anim.frames) * SIZE }],
- }));
-
- return (
- <View
- style={styles.track}
- onLayout={(event) => setWidth(event.nativeEvent.layout.width)}
- pointerEvents="none"
- >
- <Animated.View style={[styles.sprite, sprite]}>
- <Animated.Image
- source={anim.source}
- style={[{ width: SIZE * anim.frames, height: SIZE }, strip]}
- />
- </Animated.View>
- </View>
- );
-}
-
-const styles = StyleSheet.create({
- track: { height: SIZE, marginBottom: -6, zIndex: 1 },
- sprite: { width: SIZE, height: SIZE, overflow: "hidden" },
-});
diff --git a/products/desktop/apps/mobilehog/src/components/Icons.tsx b/products/desktop/apps/mobilehog/src/components/Icons.tsx
deleted file mode 100644
index 02a0278a224b..000000000000
--- a/products/desktop/apps/mobilehog/src/components/Icons.tsx
+++ /dev/null
@@ -1,177 +0,0 @@
-import { type ColorValue, Image, StyleSheet, Text, View } from "react-native";
-import { colors, fonts } from "@/lib/theme";
-
-// Tiny hand-drawn glyphs so the app has no icon dependency.
-
-export function MenuIcon({ color = colors.ink }: { color?: ColorValue }) {
- return (
- <View style={styles.menu}>
- <View style={[styles.bar, { width: 18, backgroundColor: color }]} />
- <View style={[styles.bar, { width: 12, backgroundColor: color }]} />
- <View style={[styles.bar, { width: 15, backgroundColor: color }]} />
- </View>
- );
-}
-
-export function ArrowUpIcon({
- color = colors.darkText,
-}: {
- color?: ColorValue;
-}) {
- return <Text style={[styles.glyph, { color }]}>↑</Text>;
-}
-
-export function StopIcon({ color = colors.darkText }: { color?: ColorValue }) {
- return <View style={[styles.stop, { backgroundColor: color }]} />;
-}
-
-export function Logomark({ size = 56 }: { size?: number }) {
- return (
- <Image
- source={require("../../assets/logomark.png")}
- style={{ width: size, height: size }}
- resizeMode="contain"
- />
- );
-}
-
-// Desktop's task status dot: solid for live states, a hollow ring otherwise.
-export function Dot({
- color = colors.inkMute,
- size = 8,
- hollow = false,
-}: {
- color?: ColorValue;
- size?: number;
- hollow?: boolean;
-}) {
- return (
- <View
- style={{
- width: size,
- height: size,
- borderRadius: size / 2,
- backgroundColor: hollow ? "transparent" : color,
- borderWidth: hollow ? 1.5 : 0,
- borderColor: color,
- }}
- />
- );
-}
-
-export function BellIcon({ color = colors.ink }: { color?: ColorValue }) {
- return (
- <View style={styles.bell}>
- <View style={[styles.bellBody, { borderColor: color }]} />
- <View style={[styles.bellClapper, { backgroundColor: color }]} />
- </View>
- );
-}
-
-export function SteeringIcon({ color = colors.ink }: { color?: ColorValue }) {
- return (
- <View style={styles.steer}>
- <View style={[styles.steerRing, { borderColor: color }]} />
- <View style={[styles.steerHub, { backgroundColor: color }]} />
- </View>
- );
-}
-
-export function CardsIcon({ color = colors.ink }: { color?: ColorValue }) {
- return (
- <View style={styles.cards}>
- <View style={[styles.cardBack, { borderColor: color }]} />
- <View style={[styles.cardFront, { borderColor: color }]} />
- </View>
- );
-}
-
-// A rubbish bin: handle, lid, then the body with two slats.
-export function BinIcon({ color = colors.ink }: { color?: ColorValue }) {
- return (
- <View style={styles.bin}>
- <View style={[styles.binHandle, { borderColor: color }]} />
- <View style={[styles.binLid, { backgroundColor: color }]} />
- <View style={[styles.binBody, { borderColor: color }]}>
- <View style={[styles.binSlat, { backgroundColor: color }]} />
- <View style={[styles.binSlat, { backgroundColor: color }]} />
- </View>
- </View>
- );
-}
-
-const styles = StyleSheet.create({
- bin: { alignItems: "center" },
- binHandle: {
- width: 10,
- height: 5,
- borderWidth: 2.5,
- borderBottomWidth: 0,
- borderTopLeftRadius: 3,
- borderTopRightRadius: 3,
- },
- binLid: { width: 24, height: 2.5, borderRadius: 2 },
- binBody: {
- width: 18,
- height: 18,
- marginTop: 2,
- borderWidth: 2.5,
- borderTopWidth: 0,
- borderBottomLeftRadius: 5,
- borderBottomRightRadius: 5,
- flexDirection: "row",
- justifyContent: "space-evenly",
- paddingTop: 2,
- },
- binSlat: { width: 2.5, height: 9, borderRadius: 2 },
- menu: { gap: 3.5, alignItems: "flex-start" },
- bar: { height: 2, borderRadius: 1 },
- glyph: { fontSize: 20, fontFamily: fonts.sansBold, marginTop: -1 },
- stop: { width: 14, height: 14, borderRadius: 3 },
- cards: { width: 22, height: 20 },
- cardBack: {
- position: "absolute",
- left: 6,
- top: 0,
- width: 12,
- height: 16,
- borderWidth: 1.8,
- borderRadius: 3,
- transform: [{ rotate: "12deg" }],
- },
- cardFront: {
- position: "absolute",
- left: 1,
- top: 2,
- width: 12,
- height: 16,
- borderWidth: 1.8,
- borderRadius: 3,
- backgroundColor: colors.bg,
- transform: [{ rotate: "-8deg" }],
- },
- steer: {
- width: 20,
- height: 20,
- alignItems: "center",
- justifyContent: "center",
- },
- steerRing: { width: 18, height: 18, borderRadius: 9, borderWidth: 1.8 },
- steerHub: { position: "absolute", width: 6, height: 6, borderRadius: 3 },
- bell: {
- width: 20,
- height: 20,
- alignItems: "center",
- justifyContent: "flex-end",
- },
- bellBody: {
- width: 14,
- height: 14,
- borderWidth: 1.8,
- borderTopLeftRadius: 7,
- borderTopRightRadius: 7,
- borderBottomLeftRadius: 2,
- borderBottomRightRadius: 2,
- },
- bellClapper: { width: 5, height: 2.5, borderRadius: 2, marginTop: 1 },
-});
diff --git a/products/desktop/apps/mobilehog/src/components/Markdown.tsx b/products/desktop/apps/mobilehog/src/components/Markdown.tsx
deleted file mode 100644
index 993381c4dee8..000000000000
--- a/products/desktop/apps/mobilehog/src/components/Markdown.tsx
+++ /dev/null
@@ -1,409 +0,0 @@
-import type { ObjectTagRef } from "@posthog/core/inbox/objectTags";
-import { isSafeExternalUrl } from "@posthog/shared";
-import type { MarkedToken, Token, Tokens } from "marked";
-import { type ReactNode, useMemo, useState } from "react";
-import {
- type ColorValue,
- Image,
- Linking,
- Pressable,
- ScrollView,
- StyleSheet,
- Text,
- View,
-} from "react-native";
-import { MermaidDiagram } from "@/components/MermaidDiagram";
-import {
- ObjectCard,
- openObjectUrl,
- useObjectUrl,
-} from "@/components/ObjectCard";
-import { lexMarkdown, splitImageRuns } from "@/lib/markdown";
-import { isClosedFence, isMermaidLang } from "@/lib/mermaid";
-import {
- isObjectCardToken,
- isObjectRefToken,
- isObjectTagMarkup,
-} from "@/lib/objectTags";
-import { colors, fonts } from "@/lib/theme";
-
-interface MarkdownProps {
- text: string;
- color?: ColorValue;
-}
-
-function openLink(href: string): void {
- if (isSafeExternalUrl(href)) Linking.openURL(href).catch(() => {});
-}
-
-// Kinds without a page in PostHog read as plain text.
-function ObjectChip({ target }: { target: ObjectTagRef }): ReactNode {
- const url = useObjectUrl(target.kind, target.id);
- return url ? (
- <Text style={styles.chip} onPress={() => openObjectUrl(url)}>
- {target.label}
- </Text>
- ) : (
- target.label
- );
-}
-
-function renderInline(
- tokens: Token[] | undefined,
- color: ColorValue,
- linked = false,
-): ReactNode[] {
- return (tokens ?? []).map((raw, index) => {
- const key = String(index);
- if (isObjectRefToken(raw)) {
- return <ObjectChip key={key} target={raw.ref} />;
- }
- const token = raw as MarkedToken;
- switch (token.type) {
- case "strong":
- return (
- <Text key={key} style={{ fontFamily: fonts.sansSemi, color }}>
- {renderInline(token.tokens, color, linked)}
- </Text>
- );
- case "em":
- return (
- <Text key={key} style={{ fontFamily: fonts.sansItalic, color }}>
- {renderInline(token.tokens, color, linked)}
- </Text>
- );
- case "del":
- return (
- <Text key={key} style={styles.strike}>
- {renderInline(token.tokens, color, linked)}
- </Text>
- );
- case "codespan":
- return (
- <Text key={key} style={styles.inlineCode}>
- {token.text}
- </Text>
- );
- case "link":
- return (
- <Text
- key={key}
- style={styles.link}
- onPress={() => openLink(token.href)}
- >
- {renderInline(token.tokens, colors.accent, true)}
- </Text>
- );
- case "image":
- return !linked && isSafeExternalUrl(token.href) ? (
- <Text
- key={key}
- style={styles.link}
- onPress={() => openLink(token.href)}
- >
- {token.text || token.href}
- </Text>
- ) : (
- token.text
- );
- case "br":
- return "\n";
- case "html":
- return isObjectTagMarkup(token.text) ? null : token.text;
- case "text":
- return token.tokens ? (
- <Text key={key}>{renderInline(token.tokens, color, linked)}</Text>
- ) : (
- token.text
- );
- default:
- return "text" in token ? String(token.text) : "";
- }
- });
-}
-
-// Width from the longest cell, so columns line up without measuring.
-function columnWidths(rows: string[][]): number[] {
- const count = Math.max(...rows.map((row) => row.length));
- return Array.from({ length: count }, (_, column) => {
- const longest = Math.max(...rows.map((row) => row[column]?.length ?? 0));
- return Math.min(240, Math.max(72, longest * 7.5 + 24));
- });
-}
-
-function Table({ token, color }: { token: Tokens.Table; color: ColorValue }) {
- const rows = [token.header, ...token.rows];
- const widths = columnWidths(rows.map((row) => row.map((cell) => cell.text)));
- return (
- <ScrollView horizontal showsHorizontalScrollIndicator={false}>
- <View style={styles.table}>
- {rows.map((row, rowIndex) => (
- <View
- key={String(rowIndex)}
- style={[
- styles.tableRow,
- rowIndex > 0 && styles.tableRowDivided,
- rowIndex === 0 && styles.tableHeader,
- ]}
- >
- {widths.map((width, column) => (
- <Text
- key={String(column)}
- style={[
- styles.tableCell,
- rowIndex === 0 && styles.tableHeaderText,
- { width, color },
- ]}
- selectable
- >
- {renderInline(row[column]?.tokens, color)}
- </Text>
- ))}
- </View>
- ))}
- </View>
- </ScrollView>
- );
-}
-
-function List({ token, color }: { token: Tokens.List; color: ColorValue }) {
- const start = typeof token.start === "number" ? token.start : 1;
- return (
- <View style={styles.list}>
- {token.items.map((item, index) => (
- <View key={String(index)} style={styles.bulletRow}>
- <Text style={[styles.bulletMark, { color }]}>
- {token.ordered ? `${start + index}.` : "•"}
- </Text>
- <View style={styles.bulletText}>
- {renderBlocks(item.tokens, color)}
- </View>
- </View>
- ))}
- </View>
- );
-}
-
-interface ImageSize {
- width: number;
- height: number;
-}
-
-function MarkdownImage({ token }: { token: Tokens.Image }) {
- const [size, setSize] = useState<ImageSize | null>(null);
- const [failed, setFailed] = useState(false);
- if (failed) {
- return (
- <Text
- style={[styles.body, styles.link]}
- onPress={() => openLink(token.href)}
- >
- {token.text || token.href}
- </Text>
- );
- }
- return (
- <Pressable
- onPress={() => openLink(token.href)}
- accessibilityRole="imagebutton"
- accessibilityLabel={token.text || undefined}
- >
- <Image
- source={{ uri: token.href }}
- onLoad={(event) => {
- const { width, height } = event.nativeEvent.source;
- if (width > 0 && height > 0) setSize({ width, height });
- }}
- onError={() => setFailed(true)}
- style={[
- styles.image,
- size
- ? { aspectRatio: size.width / size.height }
- : styles.imagePending,
- ]}
- />
- </Pressable>
- );
-}
-
-function Paragraph({ tokens, color }: { tokens: Token[]; color: ColorValue }) {
- const runs = splitImageRuns(tokens);
- if (!runs.some((run) => run.kind === "image")) {
- return (
- <Text style={[styles.body, { color }]} selectable>
- {renderInline(tokens, color)}
- </Text>
- );
- }
- return (
- <View style={styles.runs}>
- {runs.map((run, index) =>
- run.kind === "image" ? (
- <MarkdownImage key={`${index}-${run.token.href}`} token={run.token} />
- ) : (
- <Text key={String(index)} style={[styles.body, { color }]} selectable>
- {renderInline(run.tokens, color)}
- </Text>
- ),
- )}
- </View>
- );
-}
-
-function CodeBlock({ token }: { token: Tokens.Code }) {
- return (
- <View style={styles.codeBlock}>
- {token.lang ? <Text style={styles.codeLang}>{token.lang}</Text> : null}
- <Text style={styles.codeText} selectable>
- {token.text}
- </Text>
- </View>
- );
-}
-
-function renderBlocks(
- tokens: Token[] | undefined,
- color: ColorValue,
-): ReactNode[] {
- return (tokens ?? []).map((raw, index) => {
- const key = `${index}-${raw.type}`;
- if (isObjectCardToken(raw)) {
- return <ObjectCard key={key} spec={raw.spec} />;
- }
- const token = raw as MarkedToken;
- switch (token.type) {
- case "code":
- return isMermaidLang(token.lang) && isClosedFence(token.raw) ? (
- <MermaidDiagram
- key={key}
- code={token.text}
- fallback={<CodeBlock token={token} />}
- />
- ) : (
- <CodeBlock key={key} token={token} />
- );
- case "heading":
- return (
- <Text
- key={key}
- style={[
- styles.heading,
- {
- fontFamily: fonts.sans,
- fontSize: token.depth <= 2 ? 19 : 16,
- color,
- },
- ]}
- >
- {renderInline(token.tokens, color)}
- </Text>
- );
- case "list":
- return <List key={key} token={token} color={color} />;
- case "blockquote":
- return (
- <View key={key} style={styles.quote}>
- {renderBlocks(token.tokens, colors.inkSoft)}
- </View>
- );
- case "table":
- return <Table key={key} token={token} color={color} />;
- case "hr":
- return <View key={key} style={styles.rule} />;
- // Tight list items hold their text as a bare text token.
- case "paragraph":
- case "text":
- return (
- <Paragraph key={key} tokens={token.tokens ?? []} color={color} />
- );
- default:
- return null;
- }
- });
-}
-
-export function Markdown({ text, color = colors.ink }: MarkdownProps) {
- const tokens = useMemo(() => lexMarkdown(text), [text]);
- return <View style={styles.root}>{renderBlocks(tokens, color)}</View>;
-}
-
-const styles = StyleSheet.create({
- root: { gap: 8 },
- body: { fontFamily: fonts.sans, fontSize: 16, lineHeight: 24 },
- heading: { fontFamily: fonts.sansSemi, lineHeight: 26, marginTop: 4 },
- list: { gap: 4 },
- bulletRow: { flexDirection: "row", gap: 8, paddingLeft: 4 },
- bulletMark: {
- fontFamily: fonts.sans,
- fontSize: 16,
- lineHeight: 24,
- minWidth: 14,
- },
- bulletText: { flex: 1, gap: 4 },
- quote: {
- borderLeftWidth: 2,
- borderLeftColor: colors.line,
- paddingLeft: 12,
- gap: 8,
- },
- rule: { height: StyleSheet.hairlineWidth, backgroundColor: colors.line },
- codeBlock: {
- backgroundColor: colors.code,
- borderRadius: 12,
- padding: 12,
- gap: 4,
- },
- codeLang: {
- fontFamily: fonts.monoMedium,
- fontSize: 10,
- color: colors.inkMute,
- textTransform: "uppercase",
- letterSpacing: 1,
- },
- codeText: {
- fontFamily: fonts.mono,
- fontSize: 13,
- lineHeight: 19,
- color: colors.ink,
- },
- inlineCode: {
- fontFamily: fonts.mono,
- fontSize: 14,
- backgroundColor: colors.code,
- color: colors.ink,
- },
- strike: { textDecorationLine: "line-through" },
- runs: { gap: 8 },
- image: {
- width: "100%",
- borderRadius: 16,
- backgroundColor: colors.fill,
- },
- imagePending: { aspectRatio: 16 / 9 },
- link: { color: colors.accent, textDecorationLine: "underline" },
- chip: {
- fontFamily: fonts.sansMedium,
- color: colors.accent,
- backgroundColor: colors.fill,
- },
- table: {
- borderWidth: StyleSheet.hairlineWidth,
- borderColor: colors.line,
- borderRadius: 12,
- overflow: "hidden",
- },
- tableRow: { flexDirection: "row" },
- tableRowDivided: {
- borderTopWidth: StyleSheet.hairlineWidth,
- borderTopColor: colors.line,
- },
- tableHeader: { backgroundColor: colors.fill },
- tableCell: {
- fontFamily: fonts.sans,
- fontSize: 14,
- lineHeight: 20,
- paddingHorizontal: 10,
- paddingVertical: 8,
- },
- tableHeaderText: { fontFamily: fonts.sansSemi },
-});
diff --git a/products/desktop/apps/mobilehog/src/components/McpAppHost.tsx b/products/desktop/apps/mobilehog/src/components/McpAppHost.tsx
deleted file mode 100644
index 1fe2a0f0f00c..000000000000
--- a/products/desktop/apps/mobilehog/src/components/McpAppHost.tsx
+++ /dev/null
@@ -1,220 +0,0 @@
-import type { McpUiDisplayMode } from "@modelcontextprotocol/ext-apps/app-bridge";
-import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
-import { resolveResultResourceUri } from "@posthog/core/mcp-apps/schemas";
-import { useQuery } from "@tanstack/react-query";
-import { useRef, useState } from "react";
-import {
- ActivityIndicator,
- Modal,
- Pressable,
- StyleSheet,
- Text,
- useColorScheme,
- View,
-} from "react-native";
-import { useSafeAreaInsets } from "react-native-safe-area-context";
-import WebView from "react-native-webview";
-import { GlassCircleButton } from "@/components/Glass";
-import { listMcpTools, readMcpResource } from "@/lib/mcp/client";
-import { sandboxProxyHtml } from "@/lib/mcp/sandboxProxyHtml";
-import {
- type Phase,
- type UiResource,
- useAppBridge,
-} from "@/lib/mcp/useAppBridge";
-import { colors, fonts, radius } from "@/lib/theme";
-import type { Block } from "@/lib/transcript";
-
-const MIN_HEIGHT = 180;
-const MAX_HEIGHT = 520;
-
-// Does this tool result come with an MCP UI app to render it?
-export function appResourceUri(output: unknown): string | undefined {
- return resolveResultResourceUri(output);
-}
-
-function useUiResource(uri: string) {
- return useQuery<UiResource | null>({
- queryKey: ["mcp", "ui-resource", uri],
- queryFn: async () => {
- const read = await readMcpResource(uri);
- const content = read.contents.find((item) => item.uri === uri) as
- | {
- text?: unknown;
- mimeType?: unknown;
- _meta?: Record<string, unknown>;
- }
- | undefined;
- const html = typeof content?.text === "string" ? content.text : null;
- const mime =
- typeof content?.mimeType === "string" ? content.mimeType : "";
- if (!html || !mime.startsWith("text/html")) return null;
- const ui = (content?._meta?.ui ?? {}) as Record<string, unknown>;
- return {
- uri,
- html,
- csp: ui.csp as UiResource["csp"],
- permissions: ui.permissions as UiResource["permissions"],
- };
- },
- staleTime: 5 * 60_000,
- });
-}
-
-// Hosts an MCP UI app (a chart, a table) for a finished tool call, inline in
-// the transcript with a fullscreen mode.
-export function McpAppHost({ block }: { block: Block & { kind: "tool" } }) {
- const uri = appResourceUri(block.output) ?? "";
- const resource = useUiResource(uri);
- const tools = useQuery({ queryKey: ["mcp", "tools"], queryFn: listMcpTools });
- const scheme = useColorScheme();
- const insets = useSafeAreaInsets();
- const webViewRef = useRef<WebView | null>(null);
- const [width, setWidth] = useState(0);
- const [phase, setPhase] = useState<Phase>("loading");
- const [displayMode, setDisplayMode] = useState<McpUiDisplayMode>("inline");
- const [height, setHeight] = useState(MIN_HEIGHT);
-
- const { onWebViewMessage } = useAppBridge({
- webViewRef,
- resource: resource.data,
- tool: tools.data?.find((tool) => tool.name === (block.toolName ?? "exec")),
- toolInput: block.input,
- toolResult: block.output as CallToolResult | null,
- dark: scheme === "dark",
- displayMode,
- width,
- insets,
- onPhase: setPhase,
- onHeight: setHeight,
- onDisplayMode: setDisplayMode,
- });
-
- if (resource.isError || phase === "error") {
- return (
- <View style={styles.card}>
- <Text style={styles.muted}>Couldn't load this view.</Text>
- </View>
- );
- }
-
- const inlineHeight = Math.min(Math.max(height, MIN_HEIGHT), MAX_HEIGHT);
- const app = (
- <View
- onLayout={(event) => setWidth(event.nativeEvent.layout.width)}
- style={[
- styles.card,
- { height: displayMode === "fullscreen" ? "100%" : inlineHeight },
- ]}
- >
- {resource.data ? (
- <WebView
- ref={webViewRef}
- originWhitelist={["*"]}
- source={{ html: sandboxProxyHtml }}
- onLoadStart={() => setPhase("loading")}
- onMessage={(event) => onWebViewMessage(event.nativeEvent.data)}
- javaScriptEnabled
- domStorageEnabled
- setSupportMultipleWindows={false}
- mixedContentMode="always"
- style={styles.webview}
- />
- ) : null}
- {phase !== "initialized" ? (
- <View pointerEvents="none" style={styles.spinner}>
- <ActivityIndicator color={colors.inkMute} />
- </View>
- ) : null}
- {displayMode === "inline" ? (
- <Pressable
- onPress={() => setDisplayMode("fullscreen")}
- hitSlop={8}
- style={styles.expand}
- >
- <Text style={styles.expandText}>⤢</Text>
- </Pressable>
- ) : null}
- </View>
- );
-
- if (displayMode === "fullscreen") {
- return (
- <Modal
- visible
- animationType="slide"
- presentationStyle="fullScreen"
- onRequestClose={() => setDisplayMode("inline")}
- >
- <View style={[styles.full, { paddingTop: insets.top + 6 }]}>
- <View style={styles.fullHeader}>
- <GlassCircleButton onPress={() => setDisplayMode("inline")}>
- <Text style={styles.close}>×</Text>
- </GlassCircleButton>
- <Text style={styles.fullTitle} numberOfLines={1}>
- {block.title}
- </Text>
- <View style={{ width: 46 }} />
- </View>
- <View style={[styles.fullBody, { paddingBottom: insets.bottom }]}>
- {app}
- </View>
- </View>
- </Modal>
- );
- }
- return app;
-}
-
-const styles = StyleSheet.create({
- card: {
- backgroundColor: colors.surface,
- borderRadius: radius.card,
- overflow: "hidden",
- },
- webview: { flex: 1, backgroundColor: "transparent" },
- spinner: {
- position: "absolute",
- top: 0,
- left: 0,
- right: 0,
- bottom: 0,
- alignItems: "center",
- justifyContent: "center",
- },
- muted: {
- fontFamily: fonts.sans,
- fontSize: 14,
- color: colors.inkMute,
- padding: 16,
- },
- expand: {
- position: "absolute",
- top: 8,
- right: 8,
- width: 30,
- height: 30,
- borderRadius: 15,
- alignItems: "center",
- justifyContent: "center",
- backgroundColor: colors.fill,
- },
- expandText: { fontSize: 16, color: colors.inkSoft },
- full: { flex: 1, backgroundColor: colors.bg },
- fullHeader: {
- flexDirection: "row",
- alignItems: "center",
- justifyContent: "space-between",
- paddingHorizontal: 16,
- paddingBottom: 8,
- },
- fullTitle: {
- fontFamily: fonts.sansSemi,
- fontSize: 17,
- color: colors.ink,
- flex: 1,
- textAlign: "center",
- },
- close: { fontSize: 26, lineHeight: 28, color: colors.ink, marginTop: -2 },
- fullBody: { flex: 1, paddingHorizontal: 12 },
-});
diff --git a/products/desktop/apps/mobilehog/src/components/MermaidDiagram.tsx b/products/desktop/apps/mobilehog/src/components/MermaidDiagram.tsx
deleted file mode 100644
index fe70a58768fd..000000000000
--- a/products/desktop/apps/mobilehog/src/components/MermaidDiagram.tsx
+++ /dev/null
@@ -1,150 +0,0 @@
-import { type ReactNode, useMemo, useState } from "react";
-import {
- ActivityIndicator,
- ScrollView,
- StyleSheet,
- useColorScheme,
- View,
-} from "react-native";
-import WebView from "react-native-webview";
-import {
- type DiagramSize,
- hasRemoteImageNode,
- inlineScriptSource,
- mermaidHtml,
- parseMermaidMessage,
- rememberSize,
-} from "@/lib/mermaid";
-import { colors } from "@/lib/theme";
-
-const PADDING = 12;
-const PENDING_HEIGHT = 120;
-const SIZE_CACHE_LIMIT = 50;
-
-let bundle: string | null = null;
-
-// Metro exports the prebuilt browser bundle as a string (see metro.transformer.js).
-function mermaidBundle(): string {
- bundle ??= inlineScriptSource(
- require("mermaid/dist/mermaid.min.js") as string,
- );
- return bundle;
-}
-
-// Remounted rows keep their height instead of jumping while the WebView loads.
-const sizes = new Map<string, DiagramSize>();
-
-interface MermaidDiagramProps {
- code: string;
- fallback: ReactNode;
-}
-
-// Keyed by theme and code, so a new diagram starts without the old failure or size.
-export function MermaidDiagram(props: MermaidDiagramProps): ReactNode {
- const dark = useColorScheme() === "dark";
- const key = `${dark ? "dark" : "light"}\n${props.code}`;
- return <DiagramView key={key} cacheKey={key} dark={dark} {...props} />;
-}
-
-interface DiagramViewProps extends MermaidDiagramProps {
- cacheKey: string;
- dark: boolean;
-}
-
-function DiagramView({
- code,
- fallback,
- cacheKey,
- dark,
-}: DiagramViewProps): ReactNode {
- const html = useMemo(
- () => mermaidHtml(code, dark, mermaidBundle()),
- [code, dark],
- );
- const [width, setWidth] = useState(0);
- const [size, setSize] = useState(() => sizes.get(cacheKey) ?? null);
- const [failed, setFailed] = useState(false);
-
- if (failed || hasRemoteImageNode(code)) return fallback;
-
- const fail = () => setFailed(true);
- const onMessage = (data: string) => {
- const message = parseMermaidMessage(data);
- if (message?.type === "size") {
- const next = { width: message.width, height: message.height };
- rememberSize(sizes, cacheKey, next, SIZE_CACHE_LIMIT);
- setSize(next);
- } else if (message?.type === "error") {
- fail();
- }
- };
-
- return (
- <View
- style={styles.frame}
- onLayout={(event) =>
- setWidth(event.nativeEvent.layout.width - PADDING * 2)
- }
- >
- <ScrollView
- horizontal
- showsHorizontalScrollIndicator={false}
- contentContainerStyle={styles.content}
- >
- {width > 0 ? (
- <WebView
- source={{ html }}
- originWhitelist={["*"]}
- onShouldStartLoadWithRequest={(request) =>
- request.url.startsWith("about:")
- }
- onMessage={(event) => onMessage(event.nativeEvent.data)}
- onError={fail}
- onContentProcessDidTerminate={fail}
- onRenderProcessGone={fail}
- javaScriptEnabled
- scrollEnabled={false}
- bounces={false}
- setSupportMultipleWindows={false}
- showsHorizontalScrollIndicator={false}
- showsVerticalScrollIndicator={false}
- style={[
- styles.webview,
- size ?? { width, height: PENDING_HEIGHT, opacity: 0 },
- ]}
- />
- ) : (
- <View style={{ height: PENDING_HEIGHT }} />
- )}
- </ScrollView>
- {size ? null : (
- <View pointerEvents="none" style={styles.spinner}>
- <ActivityIndicator color={colors.inkMute} />
- </View>
- )}
- </View>
- );
-}
-
-const styles = StyleSheet.create({
- frame: {
- backgroundColor: colors.code,
- borderRadius: 12,
- overflow: "hidden",
- },
- content: {
- flexGrow: 1,
- justifyContent: "center",
- padding: PADDING,
- },
- webview: { backgroundColor: "transparent" },
- spinner: {
- position: "absolute",
- top: 0,
- left: 0,
- right: 0,
- bottom: 0,
- alignItems: "center",
- justifyContent: "center",
- },
-});
diff --git a/products/desktop/apps/mobilehog/src/components/ObjectCard.tsx b/products/desktop/apps/mobilehog/src/components/ObjectCard.tsx
deleted file mode 100644
index f02c0befbc13..000000000000
--- a/products/desktop/apps/mobilehog/src/components/ObjectCard.tsx
+++ /dev/null
@@ -1,137 +0,0 @@
-import { getObjectKind } from "@posthog/core/inbox/objectTags";
-import { isSafeExternalUrl } from "@posthog/shared";
-import { type ReactElement, useState } from "react";
-import { Linking, Pressable, StyleSheet, Text } from "react-native";
-import { useAuth } from "@/lib/auth";
-import { type ObjectCardSpec, objectWebUrl } from "@/lib/objectTags";
-import { useInsightSummary } from "@/lib/queries";
-import { colors, fonts } from "@/lib/theme";
-
-const COLLAPSED_LINES = 3;
-
-export function useObjectUrl(kind: string, id: string): string | null {
- const session = useAuth((s) => s.session);
- return session
- ? objectWebUrl(session.host, session.projectId, kind, id)
- : null;
-}
-
-export function openObjectUrl(url: string | null): void {
- if (url && isSafeExternalUrl(url)) Linking.openURL(url).catch(() => {});
-}
-
-function meta(kind: string): string {
- const { kindLabel, source } = getObjectKind(kind);
- return `${kindLabel} · ${source}`;
-}
-
-function InsightCard({
- shortId,
- title,
-}: {
- shortId: string;
- title?: string;
-}): ReactElement {
- const insight = useInsightSummary(shortId);
- const url = useObjectUrl("insight", shortId);
- const name = title ?? insight.data?.name;
- const placeholder = insight.isLoading
- ? "Loading"
- : insight.isError || insight.data === null
- ? "Couldn't load this insight."
- : "Untitled insight";
- return (
- <Pressable
- onPress={() => openObjectUrl(url)}
- style={({ pressed }) => [styles.card, pressed && styles.pressed]}
- >
- <Text style={styles.meta}>{meta("insight")}</Text>
- {name ? (
- <Text style={styles.title} numberOfLines={2}>
- {name}
- </Text>
- ) : (
- <Text style={styles.muted}>{placeholder}</Text>
- )}
- {insight.data?.description ? (
- <Text style={styles.description} numberOfLines={3}>
- {insight.data.description}
- </Text>
- ) : null}
- </Pressable>
- );
-}
-
-function QueryCard({
- query,
- title,
-}: {
- query: string;
- title?: string;
-}): ReactElement {
- const url = useObjectUrl("hogql", query);
- const [expanded, setExpanded] = useState(false);
- return (
- <Pressable
- onPress={() => openObjectUrl(url)}
- style={({ pressed }) => [styles.card, pressed && styles.pressed]}
- >
- <Text style={styles.meta}>{meta("hogql")}</Text>
- <Text style={styles.title} numberOfLines={2}>
- {title ?? "SQL query"}
- </Text>
- <Text
- style={styles.query}
- numberOfLines={expanded ? undefined : COLLAPSED_LINES}
- >
- {query}
- </Text>
- <Pressable hitSlop={8} onPress={() => setExpanded(!expanded)}>
- <Text style={styles.toggle}>{expanded ? "Show less" : "Show all"}</Text>
- </Pressable>
- </Pressable>
- );
-}
-
-export function ObjectCard({ spec }: { spec: ObjectCardSpec }): ReactElement {
- return spec.mode === "insight" ? (
- <InsightCard shortId={spec.shortId} title={spec.title} />
- ) : (
- <QueryCard query={spec.query} title={spec.title} />
- );
-}
-
-const styles = StyleSheet.create({
- card: {
- backgroundColor: colors.surface,
- borderRadius: 16,
- padding: 12,
- gap: 6,
- },
- pressed: { opacity: 0.5 },
- meta: { fontFamily: fonts.sansMedium, fontSize: 12, color: colors.inkMute },
- title: {
- fontFamily: fonts.sansSemi,
- fontSize: 15,
- lineHeight: 20,
- color: colors.ink,
- },
- description: {
- fontFamily: fonts.sans,
- fontSize: 14,
- lineHeight: 20,
- color: colors.inkSoft,
- },
- muted: { fontFamily: fonts.sans, fontSize: 14, color: colors.inkMute },
- query: {
- fontFamily: fonts.mono,
- fontSize: 12,
- lineHeight: 17,
- color: colors.inkSoft,
- backgroundColor: colors.code,
- borderRadius: 8,
- padding: 8,
- overflow: "hidden",
- },
- toggle: { fontFamily: fonts.sansMedium, fontSize: 13, color: colors.accent },
-});
diff --git a/products/desktop/apps/mobilehog/src/components/OfflinePill.tsx b/products/desktop/apps/mobilehog/src/components/OfflinePill.tsx
deleted file mode 100644
index 5837a2548554..000000000000
--- a/products/desktop/apps/mobilehog/src/components/OfflinePill.tsx
+++ /dev/null
@@ -1,80 +0,0 @@
-import { useEffect, useRef, useState } from "react";
-import { StyleSheet, View } from "react-native";
-import Animated, {
- FadeIn,
- FadeInUp,
- FadeOutUp,
- LinearTransition,
-} from "react-native-reanimated";
-import { useSafeAreaInsets } from "react-native-safe-area-context";
-import { Glass } from "@/components/Glass";
-import { useOnline } from "@/lib/network";
-import { colors, fonts, radius } from "@/lib/theme";
-
-const BACK_ONLINE_MS = 2000;
-
-export function OfflinePill() {
- const online = useOnline((s) => s.online);
- const insets = useSafeAreaInsets();
- const [backOnline, setBackOnline] = useState(false);
- const wasOffline = useRef(false);
-
- // Confirms the reconnect for a moment before the pill leaves.
- useEffect(() => {
- if (!online) {
- wasOffline.current = true;
- setBackOnline(false);
- return;
- }
- if (!wasOffline.current) return;
- wasOffline.current = false;
- setBackOnline(true);
- const timer = setTimeout(() => setBackOnline(false), BACK_ONLINE_MS);
- return () => clearTimeout(timer);
- }, [online]);
-
- if (online && !backOnline) return null;
- return (
- <View style={[styles.root, { top: insets.top + 4 }]} pointerEvents="none">
- <Animated.View
- entering={FadeInUp.duration(220)}
- exiting={FadeOutUp.duration(220)}
- layout={LinearTransition.duration(220)}
- >
- <Glass style={styles.pill}>
- <View
- style={[
- styles.dot,
- { backgroundColor: online ? colors.ok : colors.danger },
- ]}
- />
- <Animated.Text
- key={online ? "online" : "offline"}
- entering={FadeIn.duration(200)}
- style={styles.text}
- >
- {online ? "Back online" : "Offline"}
- </Animated.Text>
- </Glass>
- </Animated.View>
- </View>
- );
-}
-
-const styles = StyleSheet.create({
- root: { position: "absolute", left: 0, right: 0, alignItems: "center" },
- pill: {
- flexDirection: "row",
- alignItems: "center",
- gap: 8,
- paddingHorizontal: 14,
- paddingVertical: 8,
- borderRadius: radius.pill,
- },
- dot: {
- width: 7,
- height: 7,
- borderRadius: 4,
- },
- text: { fontFamily: fonts.sansMedium, fontSize: 13, color: colors.inkSoft },
-});
diff --git a/products/desktop/apps/mobilehog/src/components/ReportCard.tsx b/products/desktop/apps/mobilehog/src/components/ReportCard.tsx
deleted file mode 100644
index 32b31a4d077a..000000000000
--- a/products/desktop/apps/mobilehog/src/components/ReportCard.tsx
+++ /dev/null
@@ -1,309 +0,0 @@
-import {
- deriveHeadline,
- formatSignalReportSummaryMarkdown,
- parseConventionalCommitTitle,
- splitReportSummary,
-} from "@posthog/core/inbox/reportPresentation";
-import { formatRelativeAge } from "@posthog/shared";
-import type {
- SignalReport,
- SignalReportPriority,
- SuggestedReviewersArtefact,
-} from "@posthog/shared/domain-types";
-import {
- type ColorValue,
- Pressable,
- ScrollView,
- StyleSheet,
- Text,
- View,
-} from "react-native";
-import { Markdown } from "@/components/Markdown";
-import { useReportArtefacts, useReportSignals } from "@/lib/reports";
-import { colors, fonts, radius } from "@/lib/theme";
-
-const PRIORITY: Record<
- SignalReportPriority,
- { bg: ColorValue; fg: ColorValue }
-> = {
- P0: { bg: "rgba(255,71,77,0.16)", fg: colors.danger },
- P1: { bg: "rgba(255,92,28,0.16)", fg: colors.accent },
- P2: { bg: "rgba(20,144,232,0.14)", fg: "#106FB2" },
- P3: { bg: colors.fill, fg: colors.inkSoft },
- P4: { bg: colors.fill, fg: colors.inkSoft },
-};
-
-function sourceLabel(products: string[] | undefined): string {
- const first = products?.[0];
- if (!first) return "Signal";
- return first
- .split("_")
- .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
- .join(" ");
-}
-
-function parsedTitle(report: SignalReport): {
- tag: string | null;
- text: string;
-} {
- const raw =
- report.title ?? deriveHeadline(report.summary) ?? "Untitled report";
- const parsed = parseConventionalCommitTitle(raw);
- if (!parsed) return { tag: null, text: raw };
- const scope = parsed.scope ? `(${parsed.scope})` : "";
- return { tag: `${parsed.type}${scope}`, text: parsed.description };
-}
-
-export function PriorityChip({ priority }: { priority: SignalReportPriority }) {
- const tone = PRIORITY[priority];
- return (
- <View style={[styles.priority, { backgroundColor: tone.bg }]}>
- <Text style={[styles.priorityText, { color: tone.fg }]}>{priority}</Text>
- </View>
- );
-}
-
-// The face of a triage card: source, priority, title, lede and the meta line.
-// The top card also previews the first pieces of evidence.
-export function ReportSummary({
- report,
- withEvidence,
- hideLede,
-}: {
- report: SignalReport;
- withEvidence?: boolean;
- hideLede?: boolean;
-}) {
- const title = parsedTitle(report);
- const lede = hideLede ? null : deriveHeadline(report.summary);
- return (
- <View style={styles.summary}>
- <Text style={styles.source}>{sourceLabel(report.source_products)}</Text>
- <View style={styles.titleRow}>
- {report.priority ? <PriorityChip priority={report.priority} /> : null}
- {title.tag ? <Text style={styles.tag}>{title.tag}</Text> : null}
- </View>
- <Text style={styles.title}>{title.text}</Text>
- {lede && lede !== title.text ? (
- <Text style={styles.lede} numberOfLines={5}>
- {lede}
- </Text>
- ) : null}
- <Text style={styles.meta}>
- {report.signal_count} signal{report.signal_count === 1 ? "" : "s"} ·
- First seen {formatRelativeAge(report.created_at)} · Updated{" "}
- {formatRelativeAge(report.updated_at)}
- </Text>
- {withEvidence ? <EvidencePreview reportId={report.id} /> : null}
- </View>
- );
-}
-
-function EvidencePreview({ reportId }: { reportId: string }) {
- const signals = useReportSignals(reportId);
- const evidence = (signals.data?.signals ?? []).slice(0, 2);
- if (evidence.length === 0) return null;
- return (
- <View style={styles.preview}>
- <Text style={styles.previewTitle}>Evidence</Text>
- {evidence.map((signal) => (
- <View key={signal.signal_id} style={styles.evidence}>
- <Text style={styles.evidenceMeta}>
- {sourceLabel([signal.source_product])} ·{" "}
- {formatRelativeAge(signal.timestamp)}
- </Text>
- <Text style={styles.evidenceBody} numberOfLines={4}>
- {signal.content.trim()}
- </Text>
- </View>
- ))}
- </View>
- );
-}
-
-// The expanded card: full summary sections, evidence and reviewers.
-export function ReportDetail({ report }: { report: SignalReport }) {
- const signals = useReportSignals(report.id);
- const artefacts = useReportArtefacts(report.id);
- const summary = splitReportSummary(
- report.summary ? formatSignalReportSummaryMarkdown(report.summary) : "",
- );
- const reviewers = artefacts.data?.results.find(
- (artefact): artefact is SuggestedReviewersArtefact =>
- artefact.type === "suggested_reviewers",
- );
- const evidence = signals.data?.signals ?? [];
-
- return (
- <ScrollView
- style={styles.detail}
- contentContainerStyle={styles.detailContent}
- showsVerticalScrollIndicator={false}
- >
- <ReportSummary report={report} hideLede />
- {report.already_addressed ? (
- <View style={styles.notice}>
- <Text style={styles.noticeTitle}>Likely already fixed</Text>
- <Text style={styles.noticeBody}>
- The evidence suggests this was addressed. Skim the summary and
- dismiss it if you agree.
- </Text>
- </View>
- ) : null}
- {summary.lede ? <Markdown text={summary.lede} /> : null}
- {summary.sections.map((section) => (
- <View key={section.title} style={styles.section}>
- <Text style={styles.sectionTitle}>{section.title}</Text>
- <Markdown text={section.body} />
- </View>
- ))}
- <View style={styles.section}>
- <Text style={styles.sectionTitle}>
- Evidence{evidence.length ? ` · ${evidence.length}` : ""}
- </Text>
- {signals.isLoading ? <Text style={styles.muted}>Loading</Text> : null}
- {evidence.map((signal) => (
- <View key={signal.signal_id} style={styles.evidence}>
- <Text style={styles.evidenceMeta}>
- {sourceLabel([signal.source_product])} ·{" "}
- {formatRelativeAge(signal.timestamp)}
- </Text>
- <Text style={styles.evidenceBody} numberOfLines={8}>
- {signal.content.trim()}
- </Text>
- </View>
- ))}
- </View>
- {reviewers && reviewers.content.length > 0 ? (
- <View style={styles.section}>
- <Text style={styles.sectionTitle}>Reviewers</Text>
- {reviewers.content.map((reviewer) => (
- <Text
- key={reviewer.github_login ?? reviewer.github_name ?? "?"}
- style={styles.reviewer}
- >
- {reviewer.github_name ?? reviewer.github_login ?? "Unknown"}
- </Text>
- ))}
- </View>
- ) : null}
- </ScrollView>
- );
-}
-
-export function CardButton({
- label,
- onPress,
- primary,
- disabled,
-}: {
- label: string;
- onPress: () => void;
- primary?: boolean;
- disabled?: boolean;
-}) {
- return (
- <Pressable
- onPress={onPress}
- disabled={disabled}
- style={({ pressed }) => [
- styles.button,
- primary && styles.buttonPrimary,
- (pressed || disabled) && { opacity: 0.5 },
- ]}
- >
- <Text style={[styles.buttonText, primary && styles.buttonTextPrimary]}>
- {label}
- </Text>
- </Pressable>
- );
-}
-
-const styles = StyleSheet.create({
- summary: { gap: 10 },
- source: {
- fontFamily: fonts.sansMedium,
- fontSize: 13,
- color: colors.inkMute,
- },
- titleRow: { flexDirection: "row", alignItems: "center", gap: 8 },
- priority: { paddingHorizontal: 8, paddingVertical: 3, borderRadius: 6 },
- priorityText: { fontFamily: fonts.sansBold, fontSize: 12 },
- tag: {
- fontFamily: fonts.mono,
- fontSize: 12,
- color: colors.inkSoft,
- backgroundColor: colors.code,
- paddingHorizontal: 6,
- paddingVertical: 3,
- borderRadius: 6,
- overflow: "hidden",
- },
- title: {
- fontFamily: fonts.sansBold,
- fontSize: 22,
- lineHeight: 28,
- color: colors.ink,
- },
- lede: {
- fontFamily: fonts.sans,
- fontSize: 16,
- lineHeight: 23,
- color: colors.inkSoft,
- },
- meta: { fontFamily: fonts.sans, fontSize: 13, color: colors.inkMute },
- preview: { gap: 8, marginTop: 6 },
- previewTitle: {
- fontFamily: fonts.sansSemi,
- fontSize: 12,
- letterSpacing: 1.2,
- textTransform: "uppercase",
- color: colors.inkMute,
- },
- detail: { flex: 1 },
- detailContent: { gap: 18, paddingBottom: 120 },
- notice: {
- backgroundColor: "rgba(20,144,232,0.10)",
- borderRadius: radius.card,
- padding: 14,
- gap: 4,
- },
- noticeTitle: { fontFamily: fonts.sansSemi, fontSize: 15, color: colors.ink },
- noticeBody: {
- fontFamily: fonts.sans,
- fontSize: 14,
- lineHeight: 20,
- color: colors.inkSoft,
- },
- section: { gap: 8 },
- sectionTitle: { fontFamily: fonts.sansSemi, fontSize: 17, color: colors.ink },
- muted: { fontFamily: fonts.sans, fontSize: 14, color: colors.inkMute },
- evidence: {
- backgroundColor: colors.surface,
- borderRadius: 16,
- padding: 12,
- gap: 6,
- },
- evidenceMeta: {
- fontFamily: fonts.sansMedium,
- fontSize: 12,
- color: colors.inkMute,
- },
- evidenceBody: {
- fontFamily: fonts.sans,
- fontSize: 14,
- lineHeight: 20,
- color: colors.ink,
- },
- reviewer: { fontFamily: fonts.sans, fontSize: 15, color: colors.ink },
- button: {
- flex: 1,
- alignItems: "center",
- paddingVertical: 12,
- borderRadius: radius.pill,
- backgroundColor: colors.fill,
- },
- buttonPrimary: { backgroundColor: colors.accent },
- buttonText: { fontFamily: fonts.sansSemi, fontSize: 15, color: colors.ink },
- buttonTextPrimary: { color: "#FFFFFF" },
-});
diff --git a/products/desktop/apps/mobilehog/src/components/SheetHeader.tsx b/products/desktop/apps/mobilehog/src/components/SheetHeader.tsx
deleted file mode 100644
index 1b36532176ed..000000000000
--- a/products/desktop/apps/mobilehog/src/components/SheetHeader.tsx
+++ /dev/null
@@ -1,35 +0,0 @@
-import { useRouter } from "expo-router";
-import { StyleSheet, Text, View } from "react-native";
-import { GlassCircleButton } from "@/components/Glass";
-import { colors, fonts } from "@/lib/theme";
-
-// Header for pages inside a form sheet: X on the root page, back chevron deeper.
-export function SheetHeader({
- title,
- back,
-}: {
- title: string;
- back?: boolean;
-}) {
- const router = useRouter();
- return (
- <View style={styles.header}>
- <GlassCircleButton size={44} onPress={() => router.back()}>
- <Text style={styles.glyph}>{back ? "‹" : "×"}</Text>
- </GlassCircleButton>
- <Text style={styles.title}>{title}</Text>
- <View style={{ width: 44 }} />
- </View>
- );
-}
-
-const styles = StyleSheet.create({
- header: {
- flexDirection: "row",
- alignItems: "center",
- justifyContent: "space-between",
- marginBottom: 4,
- },
- glyph: { fontSize: 28, lineHeight: 30, color: colors.ink, marginTop: -3 },
- title: { fontFamily: fonts.sansSemi, fontSize: 17, color: colors.ink },
-});
diff --git a/products/desktop/apps/mobilehog/src/components/SheetRow.tsx b/products/desktop/apps/mobilehog/src/components/SheetRow.tsx
deleted file mode 100644
index 74a381026d5f..000000000000
--- a/products/desktop/apps/mobilehog/src/components/SheetRow.tsx
+++ /dev/null
@@ -1,127 +0,0 @@
-import { Host, Image } from "@expo/ui/swift-ui";
-import { Pressable, StyleSheet, Text, View } from "react-native";
-import { colors, fonts, radius } from "@/lib/theme";
-
-function Radio({ on }: { on: boolean }) {
- return (
- <View style={[styles.radio, on && styles.radioOn]}>
- {on ? <View style={styles.radioDot} /> : null}
- </View>
- );
-}
-
-// One row in a sheet card: a menu row (value + chevron), a radio option, or a checkmarked option.
-export function SheetRow({
- label,
- value,
- onPress,
- radio,
- checked,
- trailing,
- first,
-}: {
- label: string;
- value?: string;
- onPress?: () => void;
- radio?: boolean;
- checked?: boolean;
- trailing?: string;
- first?: boolean;
-}) {
- return (
- <Pressable
- onPress={onPress}
- disabled={!onPress}
- style={({ pressed }) => [
- styles.row,
- !first && styles.rowDivider,
- pressed && { opacity: 0.5 },
- ]}
- >
- {radio !== undefined ? <Radio on={radio} /> : null}
- <Text style={[styles.label, radio && styles.labelOn]} numberOfLines={1}>
- {label}
- </Text>
- <View style={{ flex: 1 }} />
- {value ? <Text style={styles.value}>{value}</Text> : null}
- {trailing ? <Text style={styles.trailing}>{trailing}</Text> : null}
- {checked ? (
- <Host matchContents>
- <Image systemName="checkmark" size={16} color={colors.accent} />
- </Host>
- ) : null}
- {onPress && radio === undefined && checked === undefined ? (
- <Text style={styles.chevron}>›</Text>
- ) : null}
- </Pressable>
- );
-}
-
-export const sheetStyles = StyleSheet.create({
- root: { flex: 1, backgroundColor: colors.bg },
- list: { padding: 18, paddingBottom: 40, gap: 14 },
- card: {
- backgroundColor: colors.surface,
- borderRadius: radius.card,
- paddingHorizontal: 16,
- },
- section: { gap: 8 },
- sectionTitle: {
- fontFamily: fonts.sansSemi,
- fontSize: 12,
- letterSpacing: 1.2,
- textTransform: "uppercase",
- color: colors.inkMute,
- marginLeft: 6,
- },
- footnote: {
- fontFamily: fonts.sans,
- fontSize: 12,
- color: colors.inkMute,
- marginLeft: 6,
- },
-});
-
-const styles = StyleSheet.create({
- row: {
- flexDirection: "row",
- alignItems: "center",
- gap: 12,
- paddingVertical: 13,
- },
- rowDivider: {
- borderTopWidth: StyleSheet.hairlineWidth,
- borderTopColor: colors.line,
- },
- label: {
- fontFamily: fonts.sans,
- fontSize: 16,
- color: colors.ink,
- flexShrink: 1,
- },
- labelOn: { fontFamily: fonts.sansSemi },
- value: { fontFamily: fonts.sans, fontSize: 16, color: colors.inkMute },
- trailing: { fontFamily: fonts.sans, fontSize: 14, color: colors.inkMute },
- chevron: {
- fontSize: 20,
- lineHeight: 22,
- color: colors.inkMute,
- marginLeft: 2,
- },
- radio: {
- width: 20,
- height: 20,
- borderRadius: 10,
- borderWidth: 1.5,
- borderColor: colors.line,
- alignItems: "center",
- justifyContent: "center",
- },
- radioOn: { borderColor: colors.accent, backgroundColor: colors.accent },
- radioDot: {
- width: 8,
- height: 8,
- borderRadius: 4,
- backgroundColor: colors.surface,
- },
-});
diff --git a/products/desktop/apps/mobilehog/src/components/ShimmerText.tsx b/products/desktop/apps/mobilehog/src/components/ShimmerText.tsx
deleted file mode 100644
index 0d34a57dffc8..000000000000
--- a/products/desktop/apps/mobilehog/src/components/ShimmerText.tsx
+++ /dev/null
@@ -1,106 +0,0 @@
-import type React from "react";
-import { useEffect, useState } from "react";
-import { StyleSheet, Text, type TextStyle, View } from "react-native";
-import Animated, {
- Easing,
- useAnimatedStyle,
- useSharedValue,
- withRepeat,
- withTiming,
-} from "react-native-reanimated";
-import { colors } from "@/lib/theme";
-
-// Soft edges come from a few strips of the highlight at rising opacity.
-const STRIP_ALPHAS = [0.35, 0.7, 1, 0.7, 0.35];
-const STRIP_WIDTH = 24;
-const BAND = STRIP_WIDTH * STRIP_ALPHAS.length;
-
-// Muted text with a bright band sweeping across it, the "thinking" shimmer.
-// No gradient module needed: a clipped copy of the text rides inside each strip.
-export function ShimmerText({
- children,
- style,
-}: {
- children: string;
- style?: TextStyle;
-}) {
- const [width, setWidth] = useState(0);
- const x = useSharedValue(-BAND);
-
- useEffect(() => {
- if (width === 0) return;
- x.value = -BAND;
- x.value = withRepeat(
- withTiming(width, { duration: 1400, easing: Easing.linear }),
- -1,
- );
- }, [width, x]);
-
- return (
- <View
- style={styles.root}
- onLayout={(event) => setWidth(event.nativeEvent.layout.width)}
- >
- <Text style={[style, styles.base]}>{children}</Text>
- {STRIP_ALPHAS.map((alpha, index) => (
- <Strip
- key={String(index)}
- x={x}
- index={index}
- alpha={alpha}
- width={width}
- >
- <Text style={[style, styles.highlight]} numberOfLines={1}>
- {children}
- </Text>
- </Strip>
- ))}
- </View>
- );
-}
-
-function Strip({
- x,
- index,
- alpha,
- width,
- children,
-}: {
- x: { value: number };
- index: number;
- alpha: number;
- width: number;
- children: React.ReactNode;
-}) {
- const offset = index * STRIP_WIDTH;
- const window = useAnimatedStyle(() => ({
- transform: [{ translateX: x.value + offset }],
- }));
- // The copy keeps the full text width so the strip clips rather than wraps it.
- const content = useAnimatedStyle(() => ({
- width,
- transform: [{ translateX: -(x.value + offset) }],
- }));
- return (
- <Animated.View
- pointerEvents="none"
- style={[styles.strip, { opacity: alpha }, window]}
- >
- <Animated.View style={content}>{children}</Animated.View>
- </Animated.View>
- );
-}
-
-const styles = StyleSheet.create({
- root: { alignSelf: "flex-start", overflow: "hidden" },
- base: { color: colors.inkSoft },
- highlight: { color: colors.inkMute },
- strip: {
- position: "absolute",
- top: 0,
- bottom: 0,
- left: 0,
- width: STRIP_WIDTH,
- overflow: "hidden",
- },
-});
diff --git a/products/desktop/apps/mobilehog/src/components/TaskRow.tsx b/products/desktop/apps/mobilehog/src/components/TaskRow.tsx
deleted file mode 100644
index 93d87d15b0ca..000000000000
--- a/products/desktop/apps/mobilehog/src/components/TaskRow.tsx
+++ /dev/null
@@ -1,346 +0,0 @@
-import {
- Button,
- ContextMenu,
- Host,
- Image,
- type ImageProps,
- RNHostView,
-} from "@expo/ui/swift-ui";
-import { formatRelativeAge } from "@posthog/shared";
-import type { Task } from "@posthog/shared/domain-types";
-import { type ReactElement, useEffect } from "react";
-import {
- ActivityIndicator,
- Alert,
- Pressable,
- StyleSheet,
- Text,
- useWindowDimensions,
- View,
-} from "react-native";
-import Animated, {
- Easing,
- useAnimatedStyle,
- useSharedValue,
- withRepeat,
- withTiming,
-} from "react-native-reanimated";
-import { useUpdateTask } from "@/lib/queries";
-import { colors, fonts } from "@/lib/theme";
-
-function isRunning(task: Task): boolean {
- const status = task.latest_run?.status;
- return status === "queued" || status === "in_progress";
-}
-
-export function activityAt(task: Task): string {
- return task.last_activity_at ?? task.updated_at;
-}
-
-function taskTitle(task: Task): string {
- return (
- task.title || task.description_preview || task.description || "Untitled"
- );
-}
-
-export function ListRow({
- title,
- label,
- time,
- running = false,
- onPress,
-}: {
- title: string;
- label?: string;
- time: string;
- running?: boolean;
- onPress: () => void;
-}) {
- const age = formatRelativeAge(time);
- return (
- <Pressable
- onPress={onPress}
- style={({ pressed }) => [styles.row, pressed && { opacity: 0.5 }]}
- >
- <View style={styles.body}>
- <Text style={styles.title} numberOfLines={2}>
- {title}
- </Text>
- <Text style={styles.time}>{label ? `${label} · ${age}` : age}</Text>
- </View>
- {running ? (
- <ActivityIndicator size="small" color={colors.inkSoft} />
- ) : null}
- </Pressable>
- );
-}
-
-export function useTaskActions(task: Task | undefined) {
- const updateTask = useUpdateTask();
- const rename = (): void => {
- if (!task) return;
- Alert.prompt(
- "Rename",
- "Enter a new name",
- [
- { text: "Cancel", style: "cancel" },
- {
- text: "OK",
- onPress: (title?: string) => {
- if (title?.trim()) {
- updateTask.mutate({ id: task.id, title: title.trim() });
- }
- },
- },
- ],
- "plain-text",
- taskTitle(task),
- );
- };
- const setArchived = (archived: boolean, onSuccess?: () => void): void => {
- if (task) updateTask.mutate({ id: task.id, archived }, { onSuccess });
- };
- return { rename, setArchived };
-}
-
-function TaskMenu({
- task,
- archived,
- children,
-}: {
- task: Task;
- archived: boolean;
- children: ReactElement;
-}) {
- const { rename, setArchived } = useTaskActions(task);
- return (
- <Host matchContents={{ vertical: true }}>
- <ContextMenu>
- <ContextMenu.Items>
- <Button label="Rename" systemImage="pencil" onPress={rename} />
- {archived ? (
- <Button
- label="Restore"
- systemImage="arrow.uturn.backward"
- onPress={() => setArchived(false)}
- />
- ) : (
- <Button
- label="Archive"
- systemImage="archivebox"
- onPress={() => setArchived(true)}
- />
- )}
- </ContextMenu.Items>
- <ContextMenu.Trigger>
- <RNHostView matchContents>{children}</RNHostView>
- </ContextMenu.Trigger>
- </ContextMenu>
- </Host>
- );
-}
-
-export function TaskRow({
- task,
- label,
- archived = false,
- onPress,
-}: {
- task: Task;
- label?: string;
- archived?: boolean;
- onPress: () => void;
-}) {
- return (
- <TaskMenu task={task} archived={archived}>
- <ListRow
- title={taskTitle(task)}
- label={label}
- time={activityAt(task)}
- running={isRunning(task)}
- onPress={onPress}
- />
- </TaskMenu>
- );
-}
-
-function oneLine(text: string): string {
- return text.replace(/\s+/g, " ").trim();
-}
-
-// Titles made from the prompt repeat it, so the age stands in for the snippet.
-function taskSnippet(task: Task, title: string): string {
- const snippet = oneLine(task.description_preview || task.description);
- return snippet && !snippet.startsWith(oneLine(title))
- ? snippet
- : formatRelativeAge(activityAt(task));
-}
-
-// A fixed height, so the SwiftUI host around a row never has to catch up with
-// a title that wraps. Only the two text lines follow the text size setting.
-function useChatRowHeight(): number {
- const { fontScale } = useWindowDimensions();
- return Math.ceil(21 + 39 * fontScale);
-}
-
-export function ChatRow({
- icon,
- title,
- snippet,
- running = false,
- onPress,
-}: {
- icon: NonNullable<ImageProps["systemName"]>;
- title: string;
- snippet: string;
- running?: boolean;
- onPress: () => void;
-}) {
- const height = useChatRowHeight();
- return (
- <Pressable
- onPress={onPress}
- style={({ pressed }) => [
- styles.chatRow,
- { height },
- pressed && { opacity: 0.5 },
- ]}
- >
- <View style={styles.chatIcon}>
- <Host matchContents>
- <Image systemName={icon} size={16} color={colors.inkSoft} />
- </Host>
- </View>
- <View style={styles.body}>
- <Text style={styles.chatTitle} numberOfLines={1}>
- {title}
- </Text>
- <Text style={styles.chatSnippet} numberOfLines={1}>
- {snippet}
- </Text>
- </View>
- {running ? (
- <ActivityIndicator size="small" color={colors.inkSoft} />
- ) : null}
- </Pressable>
- );
-}
-
-export function TaskChatRow({
- task,
- archived = false,
- onPress,
-}: {
- task: Task;
- archived?: boolean;
- onPress: () => void;
-}) {
- const title = taskTitle(task);
- return (
- <TaskMenu task={task} archived={archived}>
- <ChatRow
- icon="bubble.left"
- title={title}
- snippet={taskSnippet(task, title)}
- running={isRunning(task)}
- onPress={onPress}
- />
- </TaskMenu>
- );
-}
-
-const SKELETON_WIDTHS = ["72%", "54%", "86%", "62%", "78%"] as const;
-
-export function RowSkeletons({
- count = SKELETON_WIDTHS.length,
- chat = false,
-}: {
- count?: number;
- chat?: boolean;
-}) {
- const chatHeight = useChatRowHeight();
- const opacity = useSharedValue(1);
- useEffect(() => {
- opacity.value = withRepeat(
- withTiming(0.4, { duration: 800, easing: Easing.inOut(Easing.ease) }),
- -1,
- true,
- );
- }, [opacity]);
- const pulse = useAnimatedStyle(() => ({ opacity: opacity.value }));
- return (
- <Animated.View style={pulse}>
- {SKELETON_WIDTHS.slice(0, count).map((width) => (
- <View
- key={width}
- style={chat ? [styles.chatRow, { height: chatHeight }] : styles.row}
- >
- {chat ? <View style={styles.chatIcon} /> : null}
- <View style={styles.body}>
- <View style={[styles.skeletonTitle, { width }]} />
- <View style={styles.skeletonTime} />
- </View>
- </View>
- ))}
- </Animated.View>
- );
-}
-
-const styles = StyleSheet.create({
- row: {
- flexDirection: "row",
- alignItems: "center",
- gap: 12,
- minHeight: 64,
- paddingVertical: 12,
- paddingHorizontal: 4,
- },
- body: { flex: 1, minWidth: 0, gap: 3 },
- title: {
- fontFamily: fonts.sansMedium,
- fontSize: 17,
- lineHeight: 23,
- color: colors.ink,
- },
- time: { fontFamily: fonts.sans, fontSize: 14, color: colors.inkSoft },
- chatRow: {
- flexDirection: "row",
- alignItems: "center",
- gap: 12,
- paddingHorizontal: 4,
- },
- chatIcon: {
- width: 36,
- height: 36,
- borderRadius: 10,
- borderCurve: "continuous",
- backgroundColor: colors.fill,
- alignItems: "center",
- justifyContent: "center",
- },
- chatTitle: {
- fontFamily: fonts.sansMedium,
- fontSize: 16,
- lineHeight: 21,
- color: colors.ink,
- },
- chatSnippet: {
- fontFamily: fonts.sans,
- fontSize: 14,
- lineHeight: 18,
- color: colors.inkMute,
- },
- skeletonTitle: {
- height: 17,
- marginVertical: 3,
- borderRadius: 6,
- backgroundColor: colors.fill,
- },
- skeletonTime: {
- width: 56,
- height: 14,
- marginVertical: 2,
- borderRadius: 5,
- backgroundColor: colors.fill,
- },
-});
diff --git a/products/desktop/apps/mobilehog/src/components/Transcript.tsx b/products/desktop/apps/mobilehog/src/components/Transcript.tsx
deleted file mode 100644
index f3008107558d..000000000000
--- a/products/desktop/apps/mobilehog/src/components/Transcript.tsx
+++ /dev/null
@@ -1,754 +0,0 @@
-import { Host, Image as SymbolImage } from "@expo/ui/swift-ui";
-import { memo, useEffect, useState } from "react";
-import {
- ActivityIndicator,
- type ColorValue,
- Image,
- Pressable,
- StyleSheet,
- Text,
- View,
-} from "react-native";
-import Animated, { FadeIn } from "react-native-reanimated";
-import { Glass } from "@/components/Glass";
-import { Markdown } from "@/components/Markdown";
-import { appResourceUri, McpAppHost } from "@/components/McpAppHost";
-import { ShimmerText } from "@/components/ShimmerText";
-import { sentPhotoUri } from "@/lib/attachments";
-import { usePhotoUrl } from "@/lib/queries";
-import type { TaskSession } from "@/lib/session";
-import { colors, fonts, radius } from "@/lib/theme";
-import type {
- Block,
- PermissionRequest,
- PhotoRef,
- ToolStatus,
-} from "@/lib/transcript";
-
-interface TranscriptProps {
- onPermission: (toolCallId: string, optionId: string) => void;
-}
-
-type ToolBlock = Block & { kind: "tool" };
-type ThoughtBlock = Block & { kind: "thought" };
-
-interface Activity {
- kind: "activity";
- id: string;
- items: Array<ToolBlock | ThoughtBlock>;
- children: Map<string, ToolBlock[]>;
- permissions: TaskSession["permissions"];
- toolCount: number;
- start: number;
- end: number;
-}
-
-type Row =
- | { kind: "block"; block: Block }
- | { kind: "app"; block: ToolBlock }
- | Activity;
-
-// Consecutive tool calls and thoughts collapse into one activity row, so the
-// transcript reads as messages with a "Working" line between them.
-function arrange(
- blocks: Block[],
- permissions: TaskSession["permissions"],
-): Row[] {
- const children = new Map<string, ToolBlock[]>();
- for (const block of blocks) {
- if (block.kind === "tool" && block.parentId) {
- const list = children.get(block.parentId) ?? [];
- list.push(block);
- children.set(block.parentId, list);
- }
- }
- const rows: Row[] = [];
- let open: Activity | null = null;
- for (const block of blocks) {
- if (block.kind === "tool" && block.parentId) continue;
- if (block.kind === "tool" && appResourceUri(block.output)) {
- open = null;
- rows.push({ kind: "app", block });
- continue;
- }
- if (block.kind === "tool" || block.kind === "thought") {
- if (!open) {
- open = {
- kind: "activity",
- id: `activity-${block.id}`,
- items: [],
- children,
- permissions,
- toolCount: 0,
- start: block.at,
- end: block.at,
- };
- rows.push(open);
- }
- open.items.push(block);
- const latest = block.kind === "tool" ? block.updatedAt : block.at;
- open.end = Math.max(open.end, latest);
- if (block.kind === "tool") {
- open.toolCount += 1 + (children.get(block.id)?.length ?? 0);
- for (const child of children.get(block.id) ?? []) {
- open.end = Math.max(open.end, child.updatedAt);
- }
- }
- continue;
- }
- open = null;
- rows.push({ kind: "block", block });
- }
- return rows;
-}
-
-export type TranscriptRow =
- | { kind: "block"; id: string; block: Block }
- | { kind: "app"; id: string; block: ToolBlock }
- | (Activity & { active: boolean })
- | { kind: "permission"; id: string; request: PermissionRequest }
- | { kind: "status"; id: string; label: string };
-
-// Flattens a session into list rows: messages, collapsed activity, any
-// permission cards with no tool block yet, and the trailing status line.
-export function buildTranscriptRows(
- session: TaskSession,
- workingLabel = "Working",
-): TranscriptRow[] {
- const arranged = arrange(session.blocks, session.permissions);
- const last = arranged[arranged.length - 1];
- const rows: TranscriptRow[] = arranged.map((row) =>
- row.kind === "activity"
- ? { ...row, active: session.turnActive && row === last }
- : row.kind === "app"
- ? { kind: "app", id: `app-${row.block.id}`, block: row.block }
- : { kind: "block", id: row.block.id, block: row.block },
- );
- for (const request of Object.values(session.permissions)) {
- if (!session.blocks.some((block) => block.id === request.toolCallId)) {
- rows.push({ kind: "permission", id: request.requestId, request });
- }
- }
- if ((session.turnActive || !session.connected) && last?.kind !== "activity") {
- rows.push({ kind: "status", id: "status", label: workingLabel });
- }
- return rows;
-}
-
-export const TranscriptRowView = memo(
- function TranscriptRowView({
- row,
- taskId,
- onPermission,
- }: {
- row: TranscriptRow;
- taskId: string;
- onPermission: TranscriptProps["onPermission"];
- }) {
- switch (row.kind) {
- case "block":
- return <BlockView block={row.block} taskId={taskId} />;
- case "app":
- return <McpAppHost block={row.block} />;
- case "activity":
- return (
- <ActivityRow
- activity={row}
- active={row.active}
- permissions={row.permissions}
- onPermission={onPermission}
- />
- );
- case "permission":
- return (
- <PermissionCard request={row.request} onPermission={onPermission} />
- );
- case "status":
- return <StatusLine label={row.label} active />;
- }
- },
- // Rows are rebuilt on every fold; only re-render when their content moved.
- (prev, next) => {
- if (prev.row.kind !== next.row.kind || prev.row.id !== next.row.id) {
- return false;
- }
- if (
- (prev.row.kind === "block" && next.row.kind === "block") ||
- (prev.row.kind === "app" && next.row.kind === "app")
- ) {
- return prev.row.block === next.row.block;
- }
- if (prev.row.kind === "activity" && next.row.kind === "activity") {
- return (
- prev.row.active === next.row.active &&
- prev.row.end === next.row.end &&
- prev.row.items.length === next.row.items.length &&
- prev.row.permissions === next.row.permissions
- );
- }
- if (prev.row.kind === "status" && next.row.kind === "status") {
- return prev.row.label === next.row.label;
- }
- return prev.row.kind === "permission" && next.row.kind === "permission"
- ? prev.row.request === next.row.request
- : false;
- },
-);
-
-// Shows the file on disk when this device sent it, else a download URL.
-function SentPhoto({
- taskId,
- photo,
- savedUri,
-}: {
- taskId: string;
- photo: PhotoRef;
- savedUri?: string;
-}) {
- const localUri = sentPhotoUri(taskId, photo.artifactId) ?? savedUri;
- const [localFailed, setLocalFailed] = useState(false);
- const [failedUri, setFailedUri] = useState<string | null>(null);
- const showLocal = !!localUri && !localFailed;
- const remote = usePhotoUrl(taskId, showLocal ? null : photo);
- const uri = showLocal ? localUri : remote.data;
- // The failure belongs to one URL, so a refreshed URL loads the photo again.
- if (uri ? uri === failedUri : remote.isError) {
- return (
- <View
- accessibilityLabel={photo.name}
- style={[styles.userImage, styles.userImageMissing]}
- >
- <Host matchContents>
- <SymbolImage systemName="photo" size={20} color={colors.inkMute} />
- </Host>
- </View>
- );
- }
- if (!uri) return <View style={styles.userImage} />;
- return (
- <Image
- source={{ uri }}
- accessibilityLabel={photo.name}
- style={styles.userImage}
- onError={() => (showLocal ? setLocalFailed(true) : setFailedUri(uri))}
- />
- );
-}
-
-function BlockView({ block, taskId }: { block: Block; taskId: string }) {
- switch (block.kind) {
- case "user": {
- // A saved chat keeps the picker URIs in photo order, and they outlive
- // the in-memory list of sent photos when the app restarts.
- const savedUris =
- block.images?.length === block.photos?.length
- ? block.images
- : undefined;
- return (
- <View style={styles.userRow}>
- {block.photos?.length ? (
- <View style={styles.userImages}>
- {block.photos.map((photo, index) => (
- <SentPhoto
- key={photo.artifactId}
- taskId={taskId}
- photo={photo}
- savedUri={savedUris?.[index]}
- />
- ))}
- </View>
- ) : block.images?.length ? (
- <View style={styles.userImages}>
- {block.images.map((uri) => (
- <Image key={uri} source={{ uri }} style={styles.userImage} />
- ))}
- </View>
- ) : null}
- {block.text ? (
- <View style={styles.userBubble}>
- <Text style={styles.userText} selectable>
- {block.text}
- </Text>
- </View>
- ) : null}
- </View>
- );
- }
- case "agent":
- return (
- <View style={styles.agentRow}>
- <Markdown text={block.text} />
- </View>
- );
- case "plan":
- return (
- <View style={styles.plan}>
- <Text style={styles.planTitle}>Plan</Text>
- {block.entries.map((entry, index) => (
- <View key={`${index}-${entry.content}`} style={styles.planRow}>
- <Text style={styles.planMark}>
- {entry.status === "completed"
- ? "✓"
- : entry.status === "in_progress"
- ? "›"
- : "○"}
- </Text>
- <Text
- style={[
- styles.planText,
- entry.status === "completed" && { color: colors.inkMute },
- ]}
- >
- {entry.content}
- </Text>
- </View>
- ))}
- </View>
- );
- default:
- return null;
- }
-}
-
-function formatDuration(ms: number): string {
- const seconds = Math.max(0, Math.round(ms / 1000));
- if (seconds < 60) return `${seconds}s`;
- const minutes = Math.floor(seconds / 60);
- return `${minutes}m ${seconds % 60}s`;
-}
-
-function useNow(enabled: boolean): number {
- const [now, setNow] = useState(() => Date.now());
- useEffect(() => {
- if (!enabled) return;
- const interval = setInterval(() => setNow(Date.now()), 1000);
- return () => clearInterval(interval);
- }, [enabled]);
- return now;
-}
-
-// Fun stand-ins for "Working", rotated while a turn runs.
-const BUSY_WORDS = [
- "Working",
- "Thinking",
- "Noodling",
- "Rummaging",
- "Sniffing around",
- "Cooking",
- "Poking at it",
- "Hedgehogging",
-];
-
-function useBusyWord(enabled: boolean): string {
- const [index, setIndex] = useState(0);
- useEffect(() => {
- if (!enabled) return;
- const timer = setInterval(
- () => setIndex((value) => (value + 1) % BUSY_WORDS.length),
- 5000,
- );
- return () => clearInterval(timer);
- }, [enabled]);
- return BUSY_WORDS[index] ?? "Working";
-}
-
-export function StatusLine({
- label,
- active,
- detail,
- open,
- onPress,
-}: {
- label: string;
- active: boolean;
- detail?: string;
- open?: boolean;
- onPress?: () => void;
-}) {
- const rotate = active && label === "Working";
- const word = useBusyWord(rotate);
- const shown = rotate ? word : label;
- return (
- <Pressable
- onPress={onPress}
- disabled={!onPress}
- style={({ pressed }) => [styles.status, pressed && { opacity: 0.6 }]}
- >
- {onPress ? (
- <Text style={[styles.chevron, open && styles.chevronOpen]}>›</Text>
- ) : null}
- {active ? (
- <Animated.View key={shown} entering={FadeIn.duration(260)}>
- <ShimmerText style={styles.statusLabel}>{shown}</ShimmerText>
- </Animated.View>
- ) : (
- <Text style={styles.statusLabel}>{shown}</Text>
- )}
- {active ? (
- <ActivityIndicator size="small" color={colors.inkMute} />
- ) : null}
- {detail ? <Text style={styles.statusDetail}>{detail}</Text> : null}
- </Pressable>
- );
-}
-
-function ActivityRow({
- activity,
- active,
- permissions,
- onPermission,
-}: {
- activity: Activity;
- active: boolean;
- permissions: TaskSession["permissions"];
- onPermission: TranscriptProps["onPermission"];
-}) {
- const [open, setOpen] = useState(false);
- const now = useNow(active);
- const elapsed = formatDuration(
- (active ? now : activity.end) - activity.start,
- );
- const calls = `${activity.toolCount} tool call${
- activity.toolCount === 1 ? "" : "s"
- }`;
- const pending = activity.items
- .filter((item): item is ToolBlock => item.kind === "tool")
- .flatMap((tool) => [tool, ...(activity.children.get(tool.id) ?? [])])
- .map((tool) => permissions[tool.id])
- .filter((request): request is PermissionRequest => !!request);
- const latestThought = active
- ? [...activity.items].reverse().find((item) => item.kind === "thought")
- : undefined;
-
- return (
- <View style={styles.activity}>
- <StatusLine
- label={active ? "Working" : "Worked"}
- active={active}
- detail={`· ${elapsed}${activity.toolCount > 0 ? ` · ${calls}` : ""}`}
- open={open}
- onPress={() => setOpen((value) => !value)}
- />
- {!open && latestThought ? (
- <Text style={styles.thinkingPeek} numberOfLines={1}>
- {latestThought.text.trim()}
- </Text>
- ) : null}
- {open ? (
- <View style={styles.activityBody}>
- {activity.items.map((item) =>
- item.kind === "thought" ? (
- <Text key={item.id} style={styles.thoughtText} selectable>
- {item.text.trim()}
- </Text>
- ) : (
- <View key={item.id}>
- <ToolRow block={item} />
- {(activity.children.get(item.id) ?? []).map((child) => (
- <ToolRow key={child.id} block={child} nested />
- ))}
- </View>
- ),
- )}
- </View>
- ) : null}
- {pending.map((request) => (
- <PermissionCard
- key={request.requestId}
- request={request}
- onPermission={onPermission}
- />
- ))}
- </View>
- );
-}
-
-function statusColor(status: ToolStatus): ColorValue {
- switch (status) {
- case "completed":
- return colors.ok;
- case "failed":
- return colors.danger;
- case "running":
- return colors.accent;
- default:
- return colors.inkMute;
- }
-}
-
-function summarizeInput(input?: Record<string, unknown>): string {
- if (!input) return "";
- const preferred = [
- "command",
- "file_path",
- "path",
- "pattern",
- "query",
- "url",
- "description",
- "prompt",
- ];
- for (const key of preferred) {
- const value = input[key];
- if (typeof value === "string" && value.trim()) return value.trim();
- }
- const first = Object.values(input).find((value) => typeof value === "string");
- return typeof first === "string" ? first : "";
-}
-
-function pretty(value: unknown): string {
- if (value == null) return "";
- if (typeof value === "string") return value;
- try {
- return JSON.stringify(value, null, 2);
- } catch {
- return String(value);
- }
-}
-
-function ToolRow({ block, nested }: { block: ToolBlock; nested?: boolean }) {
- const [open, setOpen] = useState(false);
- const summary = summarizeInput(block.input);
- return (
- <Pressable
- onPress={() => setOpen((value) => !value)}
- style={[styles.tool, nested && styles.toolNested]}
- >
- <View style={styles.toolHeader}>
- {block.status === "running" ? (
- <ActivityIndicator size="small" color={colors.accent} />
- ) : (
- <View
- style={[
- styles.toolDot,
- { backgroundColor: statusColor(block.status) },
- ]}
- />
- )}
- <Text style={styles.toolTitle} numberOfLines={1}>
- {block.toolName ?? block.title}
- </Text>
- {summary ? (
- <Text style={styles.toolSummary} numberOfLines={1}>
- {summary}
- </Text>
- ) : null}
- </View>
- {open ? (
- <View style={styles.toolDetail}>
- {block.input ? (
- <>
- <Text style={styles.detailLabel}>Input</Text>
- <Text style={styles.detailText} selectable>
- {pretty(block.input)}
- </Text>
- </>
- ) : null}
- {block.output !== undefined ? (
- <>
- <Text style={styles.detailLabel}>Output</Text>
- <Text style={styles.detailText} selectable numberOfLines={60}>
- {pretty(block.output)}
- </Text>
- </>
- ) : null}
- </View>
- ) : null}
- </Pressable>
- );
-}
-
-function PermissionCard({
- request,
- onPermission,
-}: {
- request: PermissionRequest;
- onPermission: TranscriptProps["onPermission"];
-}) {
- const summary = summarizeInput(request.input);
- const answered = !!request.chosenOptionId;
- return (
- <Glass style={styles.permission} tint="rgba(217,117,91,0.08)">
- <Text style={styles.permissionTitle}>{request.title}</Text>
- {summary ? (
- <Text style={styles.detailText} numberOfLines={4}>
- {summary}
- </Text>
- ) : null}
- <View style={styles.optionRow}>
- {request.options.map((option) => {
- const primary = option.kind.startsWith("allow");
- const chosen = request.chosenOptionId === option.optionId;
- return (
- <Pressable
- key={option.optionId}
- disabled={answered}
- onPress={() => onPermission(request.toolCallId, option.optionId)}
- style={({ pressed }) => [
- styles.option,
- primary ? styles.optionPrimary : styles.optionSecondary,
- (pressed || (answered && !chosen)) && { opacity: 0.5 },
- ]}
- >
- <Text
- style={
- primary
- ? styles.optionPrimaryText
- : styles.optionSecondaryText
- }
- >
- {option.name}
- </Text>
- </Pressable>
- );
- })}
- </View>
- </Glass>
- );
-}
-
-const styles = StyleSheet.create({
- userRow: {
- alignItems: "flex-end",
- marginTop: 12,
- marginBottom: 6,
- },
- userImages: {
- flexDirection: "row",
- flexWrap: "wrap",
- justifyContent: "flex-end",
- gap: 6,
- maxWidth: "84%",
- marginBottom: 6,
- },
- userImage: {
- width: 120,
- height: 120,
- borderRadius: 16,
- backgroundColor: colors.fill,
- },
- userImageMissing: {
- alignItems: "center",
- justifyContent: "center",
- },
- userBubble: {
- maxWidth: "84%",
- backgroundColor: colors.dark,
- borderRadius: radius.bubble,
- borderBottomRightRadius: 6,
- paddingHorizontal: 14,
- paddingVertical: 10,
- },
- userText: {
- color: colors.darkText,
- fontFamily: fonts.sans,
- fontSize: 16,
- lineHeight: 22,
- },
- agentRow: { paddingRight: 8 },
- status: {
- flexDirection: "row",
- alignItems: "center",
- gap: 8,
- paddingVertical: 4,
- },
- chevron: {
- fontFamily: fonts.sans,
- fontSize: 20,
- lineHeight: 22,
- color: colors.inkMute,
- width: 12,
- textAlign: "center",
- },
- chevronOpen: { transform: [{ rotate: "90deg" }] },
- statusLabel: { fontFamily: fonts.sans, fontSize: 16, color: colors.ink },
- statusDetail: { fontFamily: fonts.sans, fontSize: 15, color: colors.inkMute },
- activity: { gap: 6 },
- thinkingPeek: {
- color: colors.inkMute,
- fontSize: 14,
- lineHeight: 20,
- paddingLeft: 20,
- fontFamily: fonts.sansItalic,
- },
- activityBody: { gap: 6, paddingLeft: 8 },
- thoughtText: {
- color: colors.inkMute,
- fontSize: 14,
- lineHeight: 20,
- fontFamily: fonts.sansItalic,
- paddingVertical: 4,
- },
- tool: { paddingVertical: 6 },
- toolNested: { paddingLeft: 18 },
- toolHeader: { flexDirection: "row", alignItems: "center", gap: 8 },
- toolDot: { width: 7, height: 7, borderRadius: 4 },
- toolTitle: { fontFamily: fonts.monoMedium, fontSize: 12, color: colors.ink },
- toolSummary: {
- flex: 1,
- fontFamily: fonts.mono,
- fontSize: 12,
- color: colors.inkSoft,
- },
- toolDetail: { marginTop: 8, gap: 4, paddingLeft: 15 },
- detailLabel: {
- fontFamily: fonts.monoMedium,
- fontSize: 10,
- letterSpacing: 1,
- textTransform: "uppercase",
- color: colors.inkMute,
- },
- detailText: {
- fontFamily: fonts.mono,
- fontSize: 12,
- lineHeight: 17,
- color: colors.inkSoft,
- },
- permission: {
- borderRadius: radius.card,
- padding: 14,
- gap: 8,
- overflow: "hidden",
- borderWidth: 1,
- borderColor: "rgba(217,117,91,0.35)",
- },
- permissionTitle: {
- fontSize: 15,
- fontFamily: fonts.sansSemi,
- color: colors.ink,
- },
- optionRow: { flexDirection: "row", flexWrap: "wrap", gap: 8, marginTop: 4 },
- option: {
- paddingHorizontal: 14,
- paddingVertical: 9,
- borderRadius: radius.pill,
- },
- optionPrimary: { backgroundColor: colors.dark },
- optionSecondary: { backgroundColor: colors.fill },
- optionPrimaryText: {
- color: colors.darkText,
- fontFamily: fonts.sansSemi,
- fontSize: 14,
- },
- optionSecondaryText: {
- color: colors.ink,
- fontFamily: fonts.sansMedium,
- fontSize: 14,
- },
- plan: { gap: 8, paddingVertical: 4 },
- planTitle: { fontSize: 15, fontFamily: fonts.sansSemi, color: colors.ink },
- planRow: { flexDirection: "row", gap: 8, alignItems: "flex-start" },
- planMark: {
- fontFamily: fonts.mono,
- color: colors.inkMute,
- width: 14,
- lineHeight: 20,
- },
- planText: {
- flex: 1,
- fontFamily: fonts.sans,
- fontSize: 14,
- lineHeight: 20,
- color: colors.ink,
- },
-});
diff --git a/products/desktop/apps/mobilehog/src/components/TriageDeck.tsx b/products/desktop/apps/mobilehog/src/components/TriageDeck.tsx
deleted file mode 100644
index 306a81d4b83a..000000000000
--- a/products/desktop/apps/mobilehog/src/components/TriageDeck.tsx
+++ /dev/null
@@ -1,248 +0,0 @@
-import type { SignalReport } from "@posthog/shared/domain-types";
-import * as Haptics from "expo-haptics";
-import { useState } from "react";
-import { Image, StyleSheet, Text, View } from "react-native";
-import { Gesture, GestureDetector } from "react-native-gesture-handler";
-import Animated, {
- FadeInDown,
- interpolate,
- runOnJS,
- useAnimatedStyle,
- useSharedValue,
- withSpring,
- withTiming,
-} from "react-native-reanimated";
-import { useSafeAreaInsets } from "react-native-safe-area-context";
-import { GlassCircleButton } from "@/components/Glass";
-import { BinIcon } from "@/components/Icons";
-import { CardButton, ReportSummary } from "@/components/ReportCard";
-import { colors, fonts, radius } from "@/lib/theme";
-
-const SWIPE_THRESHOLD = 110;
-const FLY_OUT = 600;
-const CARD_RADIUS = 28;
-// Room below the top card for the stack to peek out.
-const STACK_PEEK = 28;
-
-interface TriageDeckProps {
- reports: SignalReport[];
- onDismiss: (report: SignalReport) => void;
- onStart: (report: SignalReport) => void;
- onOpen: (report: SignalReport) => void;
- starting?: boolean;
- // Height of the screen header the deck sits under; the frame starts below it.
- headerHeight: number;
-}
-
-// Tinder-style stack: swipe left to dismiss, right to start a task, or open
-// the report to read all of it before deciding.
-export function TriageDeck({
- reports,
- onDismiss,
- onStart,
- onOpen,
- starting,
- headerHeight,
-}: TriageDeckProps) {
- const insets = useSafeAreaInsets();
- const [frame, setFrame] = useState({ x: 0, y: 0, w: 0, h: 0 });
- const x = useSharedValue(0);
- const y = useSharedValue(0);
- const top = reports[0];
- const rest = reports.slice(1, 3);
-
- const flyOut = (direction: 1 | -1, report: SignalReport): void => {
- Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium).catch(() => {});
- x.value = withTiming(direction * FLY_OUT, { duration: 220 }, (done) => {
- if (done) {
- runOnJS(direction === 1 ? onStart : onDismiss)(report);
- x.value = 0;
- y.value = 0;
- }
- });
- };
-
- const swipe = (direction: 1 | -1): void => {
- if (top) flyOut(direction, top);
- };
-
- const pan = Gesture.Pan()
- .enabled(!!top)
- .activeOffsetX([-12, 12])
- .failOffsetY([-16, 16])
- .onChange((event) => {
- x.value = event.translationX;
- y.value = event.translationY * 0.25;
- })
- .onEnd((event) => {
- if (event.translationX > SWIPE_THRESHOLD) {
- runOnJS(swipe)(1);
- } else if (event.translationX < -SWIPE_THRESHOLD) {
- runOnJS(swipe)(-1);
- } else {
- x.value = withSpring(0, { damping: 18, stiffness: 220 });
- y.value = withSpring(0, { damping: 18, stiffness: 220 });
- }
- });
-
- const topStyle = useAnimatedStyle(() => ({
- transform: [
- { translateX: x.value },
- { translateY: y.value },
- { rotate: `${interpolate(x.value, [-300, 0, 300], [-10, 0, 10])}deg` },
- ],
- }));
- const startHint = useAnimatedStyle(() => ({
- opacity: interpolate(x.value, [20, SWIPE_THRESHOLD], [0, 1], "clamp"),
- }));
- const dismissHint = useAnimatedStyle(() => ({
- opacity: interpolate(x.value, [-SWIPE_THRESHOLD, -20], [1, 0], "clamp"),
- }));
-
- return (
- <View style={styles.root} pointerEvents="box-none">
- <Animated.View
- entering={FadeInDown.duration(280)}
- style={[styles.frame, { marginTop: headerHeight + 8 }]}
- onLayout={(event) => {
- const {
- x: fx,
- y: fy,
- width: fw,
- height: fh,
- } = event.nativeEvent.layout;
- setFrame({ x: fx, y: fy, w: fw, h: fh });
- }}
- >
- {rest.map((report, index) => (
- <View
- key={report.id}
- style={[
- styles.card,
- styles.behind,
- {
- bottom: STACK_PEEK,
- zIndex: -(index + 1),
- transform: [
- { scale: 1 - (index + 1) * 0.05 },
- { translateY: (index + 1) * (STACK_PEEK / 2) + 6 },
- ],
- },
- ]}
- >
- <ReportSummary report={report} />
- </View>
- ))}
- </Animated.View>
-
- {top && frame.w > 0 ? (
- <GestureDetector gesture={pan}>
- <Animated.View
- entering={FadeInDown.duration(280)}
- style={[
- styles.card,
- styles.topCard,
- {
- left: frame.x,
- top: frame.y,
- width: frame.w,
- height: frame.h - STACK_PEEK,
- },
- topStyle,
- ]}
- >
- <View style={styles.face}>
- <ReportSummary report={top} withEvidence />
- <View style={styles.actions}>
- <CardButton label="Open report" onPress={() => onOpen(top)} />
- </View>
- <Animated.View style={[styles.hint, styles.hintStart, startHint]}>
- <Text style={styles.hintText}>Start</Text>
- </Animated.View>
- <Animated.View
- style={[styles.hint, styles.hintDismiss, dismissHint]}
- >
- <Text style={styles.hintText}>Dismiss</Text>
- </Animated.View>
- </View>
- </Animated.View>
- </GestureDetector>
- ) : null}
-
- {/* Glass never renders when mounted inside a layout animation, so the
- footer stays out of the deck's entering fade. */}
- <View style={[styles.footer, { paddingBottom: insets.bottom + 8 }]}>
- <View style={styles.verdict}>
- <GlassCircleButton
- size={64}
- disabled={!top}
- onPress={() => swipe(-1)}
- >
- <BinIcon />
- </GlassCircleButton>
- <Text style={styles.caption}>Dismiss</Text>
- </View>
- <Text style={styles.counter}>{reports.length} to triage</Text>
- <View style={styles.verdict}>
- <GlassCircleButton
- size={64}
- disabled={!top || starting}
- onPress={() => swipe(1)}
- >
- <View style={styles.goClip}>
- <Image
- source={require("../../assets/hedgehog/idle-strip.png")}
- style={styles.goSprite}
- />
- </View>
- </GlassCircleButton>
- <Text style={styles.caption}>Start task</Text>
- </View>
- </View>
- </View>
- );
-}
-
-const styles = StyleSheet.create({
- root: { position: "absolute", top: 0, left: 0, right: 0, bottom: 0 },
- frame: { flex: 1, marginHorizontal: 16, marginBottom: 12 },
- card: {
- backgroundColor: colors.bgRaised,
- borderRadius: CARD_RADIUS,
- padding: 20,
- shadowColor: "#000",
- shadowOpacity: 0.16,
- shadowRadius: 28,
- shadowOffset: { width: 0, height: 14 },
- },
- behind: { position: "absolute", top: 0, left: 0, right: 0 },
- topCard: { position: "absolute", justifyContent: "space-between" },
- face: { flex: 1, justifyContent: "space-between" },
- actions: { flexDirection: "row", gap: 8, marginTop: 16 },
- hint: {
- position: "absolute",
- top: 18,
- paddingHorizontal: 12,
- paddingVertical: 6,
- borderRadius: radius.pill,
- },
- hintStart: { left: 0, backgroundColor: colors.ok },
- hintDismiss: { right: 0, backgroundColor: colors.inkMute },
- hintText: { fontFamily: fonts.sansBold, fontSize: 13, color: "#FFFFFF" },
- footer: {
- flexDirection: "row",
- alignItems: "center",
- justifyContent: "space-between",
- paddingHorizontal: 32,
- },
- counter: { fontFamily: fonts.sans, fontSize: 14, color: colors.inkMute },
- verdict: { alignItems: "center", gap: 6 },
- caption: {
- fontFamily: fonts.sansMedium,
- fontSize: 12,
- color: colors.inkMute,
- },
- goClip: { width: 44, height: 44, overflow: "hidden", marginTop: -6 },
- // First idle frame of the 25-frame strip, scaled to sit in the circle.
- goSprite: { width: 44 * 25, height: 44 },
-});
diff --git a/products/desktop/apps/mobilehog/src/components/Waveform.tsx b/products/desktop/apps/mobilehog/src/components/Waveform.tsx
deleted file mode 100644
index 7d75b0c0936b..000000000000
--- a/products/desktop/apps/mobilehog/src/components/Waveform.tsx
+++ /dev/null
@@ -1,99 +0,0 @@
-import { useState } from "react";
-import { StyleSheet, View } from "react-native";
-import Animated, {
- type SharedValue,
- useAnimatedStyle,
- useSharedValue,
-} from "react-native-reanimated";
-import { colors } from "@/lib/theme";
-
-export const SAMPLE_MS = 80;
-// Ring of recent levels, larger than the widest strip in steps.
-export const RING = 96;
-const BAR = 3;
-const STEP = BAR + 4;
-const HEIGHT = 22;
-// Share of the strip over which bars grow in at the right and shrink out at the left.
-const FADE_IN = 0.06;
-const FADE_OUT = 0.08;
-
-function envelope(position: number): number {
- "worklet";
- return Math.max(
- 0,
- Math.min(1, (1 - position) / FADE_IN, position / FADE_OUT),
- );
-}
-
-// Slot k shows the sample k steps behind the head; slot -1 is the one entering.
-function Bar({
- slot,
- levels,
- head,
- width,
-}: {
- slot: number;
- levels: SharedValue<number[]>;
- head: SharedValue<number>;
- width: SharedValue<number>;
-}) {
- const style = useAnimatedStyle(() => {
- const id = Math.floor(head.value) - slot;
- const level = id >= 0 ? levels.value[id % RING] : -1;
- const x = width.value - STEP / 2 - (head.value - id) * STEP;
- const size = level < 0 ? 0 : level < 0.08 ? BAR : BAR + level * HEIGHT;
- const height = width.value > 0 ? size * envelope(x / width.value) : 0;
- const barWidth = Math.min(BAR, height);
- return {
- height,
- width: barWidth,
- transform: [
- { translateX: x - barWidth / 2 },
- { translateY: (HEIGHT + BAR - height) / 2 },
- ],
- };
- });
- return <Animated.View style={[styles.bar, style]} />;
-}
-
-// Renders once; every frame reads levels and the gliding head on the UI thread.
-export function Waveform({
- levels,
- head,
-}: {
- levels: SharedValue<number[]>;
- head: SharedValue<number>;
-}) {
- const width = useSharedValue(0);
- const [slots, setSlots] = useState(0);
- return (
- <View
- style={styles.root}
- onLayout={(event) => {
- width.value = event.nativeEvent.layout.width;
- setSlots(Math.ceil(event.nativeEvent.layout.width / STEP) + 1);
- }}
- >
- {Array.from({ length: slots + 1 }, (_, index) => (
- <Bar
- key={String(index)}
- slot={index - 1}
- levels={levels}
- head={head}
- width={width}
- />
- ))}
- </View>
- );
-}
-
-const styles = StyleSheet.create({
- root: { flex: 1, height: HEIGHT + BAR, overflow: "hidden" },
- bar: {
- position: "absolute",
- left: 0,
- top: 0,
- borderRadius: BAR / 2,
- backgroundColor: colors.ink,
- },
-});
diff --git a/products/desktop/apps/mobilehog/src/config.ts b/products/desktop/apps/mobilehog/src/config.ts
deleted file mode 100644
index a9ef6612411e..000000000000
--- a/products/desktop/apps/mobilehog/src/config.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-// Local stack by default. Use your LAN IP instead of localhost on a real phone.
-export const POSTHOG_HOST = "http://localhost:8010";
-
-// Prefilled on the login screen in development builds only.
-export const DEV_EMAIL = "[email protected]";
-export const DEV_PASSWORD = "12345678";
-
-// "owner/repo". Null uses the most recently used repository on the project.
-export const DEFAULT_REPOSITORY: string | null = null;
-
-export const DEFAULT_MODEL = "claude-opus-4-8";
-
-// PostHog's MCP server per region; local is the services/mcp dev server.
-export const MCP_HOSTS = {
- local: "http://localhost:8787/mcp",
- us: "https://mcp.posthog.com/mcp",
- eu: "https://mcp-eu.posthog.com/mcp",
-} as const;
diff --git a/products/desktop/apps/mobilehog/src/lib/accountLifecycle.ts b/products/desktop/apps/mobilehog/src/lib/accountLifecycle.ts
deleted file mode 100644
index a4d6f08376e4..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/accountLifecycle.ts
+++ /dev/null
@@ -1,53 +0,0 @@
-import { QueryClient } from "@tanstack/react-query";
-import { resetSentPhotos } from "@/lib/attachments";
-import { sessionIdentity, useAuth } from "@/lib/auth";
-import {
- CACHE_MAX_AGE,
- clearAccountCache,
- persistQueryCache,
-} from "@/lib/cache";
-import { resetClient } from "@/lib/client";
-import { useComposer } from "@/lib/composer";
-import { resetEngine } from "@/lib/engine";
-import { resetMcpClient } from "@/lib/mcp/client";
-import { useRepo } from "@/lib/repo";
-import { useReportScope } from "@/lib/reportScope";
-import { resetUnstartedReportTasks } from "@/lib/reports";
-import { useSessions } from "@/lib/session";
-
-let stopPersisting: (() => void) | undefined;
-
-function createQueryClient(): QueryClient {
- const client = new QueryClient({
- defaultOptions: {
- // Saved queries must outlive their screens to stay readable offline.
- queries: { retry: 1, refetchOnWindowFocus: false, gcTime: CACHE_MAX_AGE },
- },
- });
- stopPersisting?.();
- const { session } = useAuth.getState();
- stopPersisting = session ? persistQueryCache(client, session) : undefined;
- return client;
-}
-
-let queryClient = createQueryClient();
-
-useAuth.subscribe((state, previous) => {
- if (sessionIdentity(state) === sessionIdentity(previous)) return;
- if (previous.session && !state.session) clearAccountCache(previous.session);
- queryClient.clear();
- queryClient = createQueryClient();
- useSessions.getState().reset();
- resetEngine();
- resetClient();
- resetMcpClient();
- useComposer.getState().reset();
- useRepo.setState({ repository: undefined });
- useReportScope.setState({ scope: "for-you" });
- resetUnstartedReportTasks();
- resetSentPhotos();
-});
-
-export function getAccountQueryClient(): QueryClient {
- return queryClient;
-}
diff --git a/products/desktop/apps/mobilehog/src/lib/activity.ts b/products/desktop/apps/mobilehog/src/lib/activity.ts
deleted file mode 100644
index 4b13088a1725..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/activity.ts
+++ /dev/null
@@ -1,130 +0,0 @@
-import type { TaskActivityItem } from "@posthog/core/canvas/taskActivity";
-import { toTaskActivityItems } from "@posthog/core/canvas/taskActivity";
-import { formatRelativeAge, getRelativeDateGroup } from "@posthog/shared";
-import type { TaskActivityPage } from "@posthog/shared/domain-types";
-import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
-import { useAuth } from "@/lib/auth";
-import { getClient } from "@/lib/client";
-
-export const activityKey = ["activity"] as const;
-
-export function useActivity() {
- const session = useAuth((s) => s.session);
- return useQuery<TaskActivityPage>({
- queryKey: activityKey,
- queryFn: () => getClient().getTaskActivity(),
- enabled: !!session,
- refetchInterval: 30_000,
- });
-}
-
-export function useMarkActivityRead() {
- const queryClient = useQueryClient();
- return useMutation({
- mutationFn: (item: TaskActivityItem) =>
- getClient().markTaskActivityRead([
- {
- task_id: item.taskId,
- seen_before: item.activityAt,
- activity_id: item.id,
- },
- ]),
- onSuccess: () => queryClient.invalidateQueries({ queryKey: activityKey }),
- });
-}
-
-export type AgentIcon = "chat" | "check" | "question" | null;
-
-export interface ActivityRow {
- item: TaskActivityItem;
- icon: AgentIcon;
- initials: string | null;
- metadata: string;
- space: string | null;
-}
-
-function authorName(item: TaskActivityItem): string {
- const author = item.author;
- if (!author) return "Someone";
- return author.first_name || author.email || "Someone";
-}
-
-// Mirrors desktop's activityPresentation: who did what, and which glyph.
-function describe(
- item: TaskActivityItem,
- currentEmail?: string | null,
-): { action: string; icon: AgentIcon } {
- const inSpace = !!item.channelName;
- switch (item.activityKind) {
- case "awaiting_input":
- return { action: "Agent is waiting for your reply", icon: "question" };
- case "completed":
- return { action: "Agent finished", icon: "check" };
- case "message":
- if (!item.author) return { action: "Agent replied", icon: "chat" };
- return {
- action:
- item.author.email === currentEmail
- ? "You replied"
- : `${authorName(item)} replied`,
- icon: null,
- };
- case "mention":
- return { action: `${authorName(item)} mentioned you`, icon: null };
- case "thread_reply":
- return { action: `${authorName(item)} replied to a thread`, icon: null };
- case "owned_item_comment":
- return {
- action: `${authorName(item)} commented on your task`,
- icon: null,
- };
- case "created":
- return {
- action: inSpace ? "You created task in" : "You created",
- icon: null,
- };
- default:
- return { action: "Activity", icon: null };
- }
-}
-
-export function toRows(
- page: TaskActivityPage | undefined,
- currentEmail?: string | null,
- currentName?: string | null,
-): ActivityRow[] {
- if (!page) return [];
- return toTaskActivityItems(page.results).map((item) => {
- const { action, icon } = describe(item, currentEmail);
- const space = item.channelName
- ? item.channelName === "personal"
- ? "Personal"
- : item.channelName
- : null;
- const suffix = space && !action.endsWith(" in") ? " in" : "";
- return {
- item,
- icon,
- initials: icon
- ? null
- : (item.author?.first_name ?? currentName ?? "You")
- .slice(0, 2)
- .toUpperCase(),
- metadata: `${formatRelativeAge(item.activityAt)} · ${action}${suffix}`,
- space,
- };
- });
-}
-
-export function groupByDay(
- rows: ActivityRow[],
-): Array<{ label: string; rows: ActivityRow[] }> {
- const groups: Array<{ label: string; rows: ActivityRow[] }> = [];
- for (const row of rows) {
- const label = getRelativeDateGroup(row.item.activityAt) ?? "Today";
- const last = groups[groups.length - 1];
- if (last?.label === label) last.rows.push(row);
- else groups.push({ label, rows: [row] });
- }
- return groups;
-}
diff --git a/products/desktop/apps/mobilehog/src/lib/api.ts b/products/desktop/apps/mobilehog/src/lib/api.ts
deleted file mode 100644
index 8bb960b16175..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/api.ts
+++ /dev/null
@@ -1,94 +0,0 @@
-import { fetch } from "expo/fetch";
-import { requireSession, sessionIdentity, useAuth } from "@/lib/auth";
-
-export type FetchInit = NonNullable<Parameters<typeof fetch>[1]>;
-
-export function getBaseUrl(): string {
- return requireSession().host;
-}
-
-let pendingRefresh: { identity: string; promise: Promise<string> } | null =
- null;
-
-// One refresh at a time, so parallel 401s do not race each other's tokens.
-export function refreshAccessTokenOnce(): Promise<string> {
- const identity = sessionIdentity();
- if (!pendingRefresh || pendingRefresh.identity !== identity) {
- const promise = useAuth
- .getState()
- .refresh()
- .finally(() => {
- if (pendingRefresh?.promise === promise) pendingRefresh = null;
- });
- pendingRefresh = { identity, promise };
- }
- return pendingRefresh.promise;
-}
-
-export function getProjectId(): number {
- return requireSession().projectId;
-}
-
-export function getAccessToken(): string {
- return requireSession().apiKey;
-}
-
-// Hermes has no AbortSignal.timeout, so build one by hand.
-export function createTimeoutSignal(ms: number): AbortSignal {
- const controller = new AbortController();
- setTimeout(() => controller.abort(), ms);
- return controller.signal;
-}
-
-function mergeHeaders(
- base: Record<string, string>,
- override: HeadersInit | undefined,
-): Record<string, string> {
- const merged = { ...base };
- if (!override) return merged;
- if (override instanceof Headers) {
- override.forEach((value, key) => {
- merged[key] = value;
- });
- } else if (Array.isArray(override)) {
- for (const [key, value] of override) merged[key] = value;
- } else {
- Object.assign(merged, override);
- }
- return merged;
-}
-
-export async function authedFetch(
- url: string,
- init?: FetchInit,
-): Promise<Response> {
- const identity = sessionIdentity();
- const assertCurrent = (): void => {
- if (sessionIdentity() !== identity)
- throw new Error("Session changed. Sign in again.");
- };
- const headers = mergeHeaders(
- {
- Authorization: `Bearer ${getAccessToken()}`,
- "Content-Type": "application/json",
- "User-Agent": "posthog/mobilehog; version: 0.1.0",
- },
- init?.headers as HeadersInit | undefined,
- );
- // The login session cookie must not ride along, or Django takes the session
- // path and rejects the POST for a missing CSRF token.
- const response = await fetch(url, { ...init, headers, credentials: "omit" });
- assertCurrent();
- if (response.status !== 401 || !requireSession().refreshToken) {
- return response;
- }
- const token = await refreshAccessTokenOnce();
- assertCurrent();
- const retried = await fetch(url, {
- ...init,
- headers: { ...headers, Authorization: `Bearer ${token}` },
- credentials: "omit",
- });
- assertCurrent();
- return retried;
-}
diff --git a/products/desktop/apps/mobilehog/src/lib/attachments.test.ts b/products/desktop/apps/mobilehog/src/lib/attachments.test.ts
deleted file mode 100644
index 972118194f24..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/attachments.test.ts
+++ /dev/null
@@ -1,99 +0,0 @@
-import { beforeEach, describe, expect, it, vi } from "vitest";
-
-const mocks = vi.hoisted(() => {
- const photoBytes = new Uint8Array([137, 80, 78, 71]);
- class MockFile extends Blob {
- constructor(_uri: string) {
- super([photoBytes], { type: "image/png" });
- }
- }
-
- return {
- client: {
- finalizeTaskStagedArtifactUploads: vi.fn(),
- prepareTaskStagedArtifactUploads: vi.fn(),
- },
- expoFetch: vi.fn(),
- MockFile,
- photoBytes,
- };
-});
-
-vi.mock("expo/fetch", () => ({ fetch: mocks.expoFetch }));
-vi.mock("expo-file-system", () => ({ File: mocks.MockFile }));
-vi.mock("expo-image-picker", () => ({
- UIImagePickerPreferredAssetRepresentationMode: { Compatible: "compatible" },
- launchImageLibraryAsync: vi.fn(),
-}));
-vi.mock("@/lib/client", () => ({ getClient: () => mocks.client }));
-
-import {
- resetSentPhotos,
- sentPhotoUri,
- uploadStagedPhotos,
-} from "./attachments";
-
-const photo = {
- id: "photo-id",
- uri: "file:///photo.png",
- name: "photo.png",
- mimeType: "image/png",
- size: mocks.photoBytes.byteLength,
-};
-
-beforeEach(() => {
- vi.clearAllMocks();
- resetSentPhotos();
- mocks.client.prepareTaskStagedArtifactUploads.mockResolvedValue([
- {
- id: "prepared-id",
- presigned_post: {
- fields: { key: "artifact-key" },
- url: "https://uploads.example.com",
- },
- },
- ]);
- mocks.client.finalizeTaskStagedArtifactUploads.mockResolvedValue([
- { id: "artifact-id" },
- ]);
-});
-
-describe("uploadStagedPhotos", () => {
- it("sends the selected photo bytes through Expo fetch", async () => {
- let uploadedBytes: Uint8Array | undefined;
- mocks.expoFetch.mockImplementation(async (_url, init) => {
- const file = (init?.body as FormData).get("file") as Blob;
- uploadedBytes = new Uint8Array(await file.arrayBuffer());
- return { ok: true };
- });
-
- const result = await uploadStagedPhotos("task-id", [photo]);
-
- expect(uploadedBytes).toEqual(mocks.photoBytes);
- expect(mocks.expoFetch).toHaveBeenCalledWith(
- "https://uploads.example.com",
- expect.objectContaining({ method: "POST" }),
- );
- expect(result).toEqual(["artifact-id"]);
- expect(sentPhotoUri("task-id", "artifact-id")).toBe("file:///photo.png");
- });
-});
-
-describe("sentPhotoUri", () => {
- beforeEach(() => {
- mocks.expoFetch.mockResolvedValue({ ok: true });
- });
-
- it("shows a sent photo only in the task it was sent to", async () => {
- await uploadStagedPhotos("task-id", [photo]);
-
- expect(sentPhotoUri("other-task-id", "artifact-id")).toBeNull();
- });
-
- it("forgets sent photos when the account changes", async () => {
- await uploadStagedPhotos("task-id", [photo]);
- resetSentPhotos();
-
- expect(sentPhotoUri("task-id", "artifact-id")).toBeNull();
- });
-});
diff --git a/products/desktop/apps/mobilehog/src/lib/attachments.ts b/products/desktop/apps/mobilehog/src/lib/attachments.ts
deleted file mode 100644
index 4155b4090e62..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/attachments.ts
+++ /dev/null
@@ -1,160 +0,0 @@
-import type {
- PreparedTaskArtifactUpload,
- TaskArtifactUploadRequest,
-} from "@posthog/api-client/posthog-client";
-import { fetch } from "expo/fetch";
-import { File } from "expo-file-system";
-import * as ImagePicker from "expo-image-picker";
-import { getClient } from "@/lib/client";
-
-export const MAX_PHOTOS = 10;
-const MAX_PHOTO_BYTES = 30 * 1024 * 1024;
-
-// Photos sent from this device by task and artifact id, so the chat can show
-// the file already on disk rather than download it again. The account-change
-// reset clears it, so one account never shows another account's file.
-const sentPhotoUris = new Map<string, string>();
-
-function sentPhotoKey(taskId: string, artifactId: string): string {
- return `${taskId}/${artifactId}`;
-}
-
-export function sentPhotoUri(
- taskId: string,
- artifactId: string,
-): string | null {
- return sentPhotoUris.get(sentPhotoKey(taskId, artifactId)) ?? null;
-}
-
-export function resetSentPhotos(): void {
- sentPhotoUris.clear();
-}
-
-function rememberSent(
- taskId: string,
- photos: Photo[],
- artifactIds: string[],
-): string[] {
- artifactIds.forEach((artifactId, index) => {
- const photo = photos[index];
- if (photo) sentPhotoUris.set(sentPhotoKey(taskId, artifactId), photo.uri);
- });
- return artifactIds;
-}
-
-export interface Photo {
- id: string;
- uri: string;
- name: string;
- mimeType: string;
- size: number;
-}
-
-export async function pickPhotos(remaining: number): Promise<Photo[]> {
- if (remaining <= 0) return [];
- const result = await ImagePicker.launchImageLibraryAsync({
- mediaTypes: ["images"],
- allowsMultipleSelection: true,
- selectionLimit: remaining,
- orderedSelection: true,
- quality: 0.8,
- // HEIC comes back as JPEG, which the agent can read.
- preferredAssetRepresentationMode:
- ImagePicker.UIImagePickerPreferredAssetRepresentationMode.Compatible,
- });
- if (result.canceled) return [];
- return result.assets
- .slice(0, remaining)
- .filter((asset) => (asset.fileSize ?? 0) <= MAX_PHOTO_BYTES)
- .map((asset, index) => ({
- id: `${Date.now()}-${index}`,
- uri: asset.uri,
- name: asset.fileName ?? `photo-${index + 1}.jpg`,
- mimeType: asset.mimeType ?? "image/jpeg",
- size: asset.fileSize ?? 0,
- }));
-}
-
-function uploadRequests(photos: Photo[]): TaskArtifactUploadRequest[] {
- return photos.map((photo) => ({
- name: photo.name,
- type: "user_attachment",
- source: "posthog_code",
- size: photo.size,
- content_type: photo.mimeType,
- }));
-}
-
-async function postFiles(
- photos: Photo[],
- prepared: PreparedTaskArtifactUpload[],
-): Promise<void> {
- await Promise.all(
- prepared.map(async (artifact, index) => {
- const photo = photos[index];
- const form = new FormData();
- for (const [key, value] of Object.entries(
- artifact.presigned_post.fields,
- )) {
- form.append(key, value);
- }
- // Expo fetch rejects React Native's legacy { uri, name, type } part.
- // File supplies the bytes() contract that its multipart encoder requires;
- // React Native's FormData type does not yet include Expo's File support.
- form.append("file", new File(photo.uri) as unknown as Blob);
- const response = await fetch(artifact.presigned_post.url, {
- method: "POST",
- body: form,
- });
- if (!response.ok) throw new Error(`Could not upload ${photo.name}`);
- }),
- );
-}
-
-// Photos for a task that has no run yet; the run picks them up when it starts.
-export async function uploadStagedPhotos(
- taskId: string,
- photos: Photo[],
-): Promise<string[]> {
- if (!photos.length) return [];
- const client = getClient();
- const prepared = await client.prepareTaskStagedArtifactUploads(
- taskId,
- uploadRequests(photos),
- );
- await postFiles(photos, prepared);
- const finalized = await client.finalizeTaskStagedArtifactUploads(
- taskId,
- prepared,
- );
- return rememberSent(
- taskId,
- photos,
- finalized.map((artifact) => artifact.id),
- );
-}
-
-export async function uploadRunPhotos(
- taskId: string,
- runId: string,
- photos: Photo[],
-): Promise<string[]> {
- if (!photos.length) return [];
- const client = getClient();
- const prepared = await client.prepareTaskRunArtifactUploads(
- taskId,
- runId,
- uploadRequests(photos),
- );
- await postFiles(photos, prepared);
- const finalized = await client.finalizeTaskRunArtifactUploads(
- taskId,
- runId,
- prepared,
- );
- return rememberSent(
- taskId,
- photos,
- finalized.map((artifact) => artifact.id),
- );
-}
diff --git a/products/desktop/apps/mobilehog/src/lib/auth.test.ts b/products/desktop/apps/mobilehog/src/lib/auth.test.ts
deleted file mode 100644
index ce9b55cfdd86..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/auth.test.ts
+++ /dev/null
@@ -1,50 +0,0 @@
-import { beforeEach, describe, expect, it, vi } from "vitest";
-
-const secureStore = vi.hoisted(() => ({
- deleteItemAsync: vi.fn(),
- getItemAsync: vi.fn(),
- setItemAsync: vi.fn(),
-}));
-
-vi.mock("expo/fetch", () => ({ fetch: vi.fn() }));
-vi.mock("expo-secure-store", () => secureStore);
-vi.mock("expo-auth-session", () => ({}));
-vi.mock("expo-web-browser", () => ({ maybeCompleteAuthSession: vi.fn() }));
-
-import { type Session, useAuth } from "./auth";
-
-const savedSession: Session = {
- region: "us",
- host: "https://us.posthog.com",
- apiKey: "old-access-token",
- refreshToken: "old-refresh-token",
- expiresAt: Date.now() + 60_000,
- scopedTeams: [42],
- projectId: 42,
- projectName: "Demo project",
- userId: 7,
- userName: "Pat",
-};
-
-describe("mobilehog auth", () => {
- beforeEach(() => {
- secureStore.deleteItemAsync.mockReset();
- secureStore.getItemAsync.mockReset();
- secureStore.setItemAsync.mockReset();
- useAuth.setState({ session: null, hydrated: false, generation: 0 });
- });
-
- it("forces an existing OAuth session to reauthorize after scopes change", async () => {
- secureStore.getItemAsync.mockResolvedValue(JSON.stringify(savedSession));
-
- await useAuth.getState().hydrate();
-
- expect(secureStore.deleteItemAsync).toHaveBeenCalledWith(
- "mobilehog_session",
- );
- expect(useAuth.getState()).toMatchObject({
- session: null,
- hydrated: true,
- });
- });
-});
diff --git a/products/desktop/apps/mobilehog/src/lib/auth.ts b/products/desktop/apps/mobilehog/src/lib/auth.ts
deleted file mode 100644
index b818f73d0bf8..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/auth.ts
+++ /dev/null
@@ -1,303 +0,0 @@
-import { fetch } from "expo/fetch";
-import * as SecureStore from "expo-secure-store";
-import { create } from "zustand";
-import { POSTHOG_HOST } from "@/config";
-import {
- CLOUD_HOSTS,
- type CloudRegion,
- OAUTH_SCOPE_VERSION,
- refreshOAuth,
- type SignInOptions,
- signInWithOAuth,
-} from "@/lib/oauth";
-
-const SESSION_KEY = "mobilehog_session";
-
-export type Region = "local" | CloudRegion;
-
-export interface Session {
- region: Region;
- host: string;
- apiKey: string;
- // OAuth sessions only; a local dev key never expires.
- refreshToken?: string;
- expiresAt?: number;
- // The projects an OAuth token may reach; empty or missing means no limit.
- scopedTeams?: number[];
- scopeVersion?: number;
- projectId: number;
- projectName: string;
- userId: number;
- userName: string;
- email?: string;
-}
-
-interface AuthState {
- session: Session | null;
- hydrated: boolean;
- generation: number;
- hydrate: () => Promise<void>;
- login: (email: string, password: string) => Promise<void>;
- loginWithOAuth: (
- region: CloudRegion,
- options?: SignInOptions,
- ) => Promise<void>;
- // Swaps an expired OAuth access token; returns the new bearer.
- refresh: () => Promise<string>;
- selectProject: (projectId: number, projectName: string) => Promise<void>;
- logout: () => Promise<void>;
-}
-
-async function readJson<T>(response: Response, what: string): Promise<T> {
- if (!response.ok) {
- const text = await response.text().catch(() => "");
- let detail = text;
- try {
- const parsed = JSON.parse(text);
- detail = parsed.detail ?? parsed.error ?? text;
- } catch {}
- throw new Error(`${what} failed (${response.status}): ${detail}`);
- }
- return (await response.json()) as T;
-}
-
-// Log in without touching the cookie jar (a stale session there would trip the
-// CSRF check), pull the session id out of the response, and swap it for the
-// seeded local dev personal API key so every later call is a plain bearer.
-async function loginWithPassword(
- email: string,
- password: string,
-): Promise<Session> {
- const loginResponse = await fetch(`${POSTHOG_HOST}/api/login/`, {
- method: "POST",
- headers: { "Content-Type": "application/json" },
- body: JSON.stringify({ email, password }),
- credentials: "omit",
- });
- await readJson<{ success?: boolean }>(loginResponse, "Login");
- const sessionId = /sessionid=([^;,\s]+)/.exec(
- loginResponse.headers.get("set-cookie") ?? "",
- )?.[1];
- if (!sessionId) {
- throw new Error("Login succeeded but no session cookie came back.");
- }
-
- const keysResponse = await fetch(`${POSTHOG_HOST}/api/personal_api_keys/`, {
- headers: { Cookie: `sessionid=${sessionId}` },
- credentials: "omit",
- });
- const keys = await readJson<Array<{ local_dev_value?: string | null }>>(
- keysResponse,
- "Reading API keys",
- );
- const apiKey = keys.find((key) => key.local_dev_value)?.local_dev_value;
- if (!apiKey) {
- throw new Error(
- "No local dev API key found. Run `python manage.py setup_local_api_key` and set ALLOW_DEV_API_KEY_REVEAL=1, then restart the stack.",
- );
- }
-
- return describeSession({ region: "local", host: POSTHOG_HOST, apiKey });
-}
-
-async function describeSession(base: {
- region: Region;
- host: string;
- apiKey: string;
- refreshToken?: string;
- expiresAt?: number;
- projectId?: number;
-}): Promise<Session> {
- const meResponse = await fetch(`${base.host}/api/users/@me/`, {
- headers: { Authorization: `Bearer ${base.apiKey}` },
- credentials: "omit",
- });
- const me = await readJson<{
- id: number;
- first_name: string;
- email: string;
- team?: { id: number; name: string } | null;
- }>(meResponse, "Loading user");
- const projectId = base.projectId ?? me.team?.id;
- if (!projectId) {
- throw new Error("This user has no current project.");
- }
- let projectName = me.team?.id === projectId ? me.team.name : null;
- if (!projectName) {
- const projectResponse = await fetch(
- `${base.host}/api/projects/${projectId}/`,
- {
- headers: { Authorization: `Bearer ${base.apiKey}` },
- credentials: "omit",
- },
- );
- projectName =
- (await readJson<{ name?: string }>(projectResponse, "Loading project"))
- .name ?? `Project ${projectId}`;
- }
- return {
- ...base,
- projectId,
- projectName,
- userId: me.id,
- userName: me.first_name || me.email,
- email: me.email,
- };
-}
-
-let storageWrite: Promise<void> = Promise.resolve();
-let loginPending = false;
-
-function queueStorageWrite<T>(write: () => Promise<T>): Promise<T> {
- const pending = storageWrite.then(write);
- storageWrite = pending.then(
- () => {},
- () => {},
- );
- return pending;
-}
-
-export function sessionIdentity(state = useAuth.getState()): string {
- const { session, generation } = state;
- return JSON.stringify([
- generation,
- session?.host,
- session?.projectId,
- session?.userId,
- ]);
-}
-
-export function accountStorageKey(prefix: string): string {
- const session = requireSession();
- const host = Array.from(session.host, (character) =>
- character.charCodeAt(0).toString(16),
- ).join("-");
- return `${prefix}_${host}_${session.projectId}_${session.userId}`;
-}
-
-export const useAuth = create<AuthState>((set, get) => {
- // The builder runs inside the queued write so it sees every earlier commit,
- // such as a token refresh that finished while a project switch waited.
- const commit = async (
- build: (current: Session | null) => Session,
- generation: number,
- ): Promise<Session> => {
- return queueStorageWrite(async () => {
- if (get().generation !== generation)
- throw new Error("Session changed. Sign in again.");
- const session = build(get().session);
- await SecureStore.setItemAsync(SESSION_KEY, JSON.stringify(session));
- if (get().generation !== generation)
- throw new Error("Session changed. Sign in again.");
- set({ session, hydrated: true });
- return session;
- });
- };
-
- const login = async (attempt: () => Promise<Session>): Promise<void> => {
- if (loginPending) return;
- loginPending = true;
- if (get().session || !get().hydrated) {
- set({ session: null, generation: get().generation + 1, hydrated: true });
- }
- const generation = get().generation;
- try {
- const session = await attempt();
- await commit(() => session, generation);
- } finally {
- loginPending = false;
- }
- };
-
- return {
- session: null,
- hydrated: false,
- generation: 0,
-
- hydrate: async () => {
- if (get().hydrated) return;
- const generation = get().generation;
- try {
- const raw = await SecureStore.getItemAsync(SESSION_KEY);
- if (get().generation !== generation || get().session) return;
- const session = raw ? (JSON.parse(raw) as Session) : null;
- if (
- session &&
- session.region !== "local" &&
- session.scopeVersion !== OAUTH_SCOPE_VERSION
- ) {
- await SecureStore.deleteItemAsync(SESSION_KEY);
- if (get().generation === generation && !get().session) {
- set({ session: null, hydrated: true });
- }
- return;
- }
- set({ session, hydrated: true });
- } catch {
- if (get().generation === generation) set({ hydrated: true });
- }
- },
-
- login: (email, password) => login(() => loginWithPassword(email, password)),
-
- loginWithOAuth: (region, options) =>
- login(async () => {
- const tokens = await signInWithOAuth(region, options);
- const session = await describeSession({
- region,
- host: CLOUD_HOSTS[region],
- apiKey: tokens.access_token,
- refreshToken: tokens.refresh_token,
- expiresAt: Date.now() + tokens.expires_in * 1000,
- projectId: tokens.scoped_teams?.[0],
- });
- return {
- ...session,
- scopedTeams: tokens.scoped_teams,
- scopeVersion: OAUTH_SCOPE_VERSION,
- };
- }),
-
- refresh: async () => {
- const { session: current, generation } = get();
- if (!current?.refreshToken || current.region === "local") {
- throw new Error("Session cannot be refreshed");
- }
- const tokens = await refreshOAuth(current.region, current.refreshToken);
- const session = await commit((latest) => {
- if (!latest || latest.refreshToken !== current.refreshToken)
- throw new Error("Session changed. Sign in again.");
- return {
- ...latest,
- apiKey: tokens.access_token,
- refreshToken: tokens.refresh_token || current.refreshToken,
- expiresAt: Date.now() + tokens.expires_in * 1000,
- scopedTeams: tokens.scoped_teams ?? latest.scopedTeams,
- };
- }, generation);
- return session.apiKey;
- },
-
- selectProject: async (projectId, projectName) => {
- const current = get().session;
- if (!current || current.projectId === projectId) return;
- await commit((latest) => {
- if (!latest) throw new Error("Session changed. Sign in again.");
- return { ...latest, projectId, projectName };
- }, get().generation);
- },
-
- logout: async () => {
- set({ session: null, generation: get().generation + 1, hydrated: true });
- await queueStorageWrite(() => SecureStore.deleteItemAsync(SESSION_KEY));
- },
- };
-});
-
-export function requireSession(): Session {
- const { session } = useAuth.getState();
- if (!session) {
- throw new Error("Not signed in");
- }
- return session;
-}
diff --git a/products/desktop/apps/mobilehog/src/lib/cache.test.ts b/products/desktop/apps/mobilehog/src/lib/cache.test.ts
deleted file mode 100644
index ebec466bd030..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/cache.test.ts
+++ /dev/null
@@ -1,280 +0,0 @@
-import { beforeEach, describe, expect, it, vi } from "vitest";
-
-const mocks = vi.hoisted(() => {
- const stores = new Map<string, Map<string, string>>();
- const existing = new Set<string>();
- const session = {
- region: "us",
- host: "https://us.posthog.com",
- apiKey: "key",
- projectId: 1,
- projectName: "Project",
- userId: 7,
- userName: "Max",
- };
- const auth = { session: session as typeof session | null };
-
- function createMMKV({ id }: { id: string }) {
- let data = stores.get(id);
- if (!data) {
- data = new Map();
- stores.set(id, data);
- }
- const values = data;
- return {
- getString: (key: string) => values.get(key),
- set: (key: string, value: string) => values.set(key, value),
- remove: (key: string) => values.delete(key),
- contains: (key: string) => values.has(key),
- };
- }
-
- class MockFile {
- exists: boolean;
- constructor(uri: string) {
- this.exists = existing.has(uri);
- }
- }
-
- return { auth, createMMKV, existing, MockFile, session, stores };
-});
-
-vi.mock("react-native-mmkv", () => ({
- createMMKV: mocks.createMMKV,
- deleteMMKV: (id: string) => mocks.stores.delete(id),
-}));
-vi.mock("expo-secure-store", () => ({
- getItem: () => "secret",
- setItem: vi.fn(),
-}));
-vi.mock("expo-crypto", () => ({ getRandomBytes: () => new Uint8Array(16) }));
-vi.mock("expo-file-system", () => ({ File: mocks.MockFile }));
-vi.mock("@/lib/auth", () => ({
- useAuth: { getState: () => mocks.auth },
-}));
-
-import type { Photo } from "./attachments";
-import {
- accountStore,
- beginSend,
- clearAccountCache,
- keepUnsent,
- loadDraft,
- moveDraft,
- NEW_CHAT_DRAFT,
- saveDraft,
-} from "./cache";
-
-function photo(uri: string): Photo {
- return { id: uri, uri, name: "photo.jpg", mimeType: "image/jpeg", size: 3 };
-}
-
-function draftIndex(): string[] {
- const store = accountStore(mocks.session as never);
- return JSON.parse(store.getString("draft-1-index") ?? "[]");
-}
-
-beforeEach(() => {
- mocks.stores.clear();
- mocks.existing.clear();
- mocks.auth.session = { ...mocks.session };
- clearAccountCache(mocks.session as never);
-});
-
-describe("drafts", () => {
- it("restores the text and photos that were saved", () => {
- mocks.existing.add("file:///a.jpg");
- saveDraft("task-1", { text: "hello", photos: [photo("file:///a.jpg")] });
-
- expect(loadDraft("task-1")).toEqual({
- text: "hello",
- photos: [photo("file:///a.jpg")],
- });
- expect(loadDraft(NEW_CHAT_DRAFT)).toBeNull();
- });
-
- it("drops photos whose file is gone", () => {
- mocks.existing.add("file:///kept.jpg");
- saveDraft("task-1", {
- text: "look",
- photos: [photo("file:///kept.jpg"), photo("file:///purged.jpg")],
- });
-
- expect(loadDraft("task-1")?.photos).toEqual([photo("file:///kept.jpg")]);
- });
-
- it("returns nothing when only missing photos remain", () => {
- saveDraft("task-1", { text: " ", photos: [photo("file:///purged.jpg")] });
-
- expect(loadDraft("task-1")).toBeNull();
- });
-
- it("removes the key when the draft is empty", () => {
- saveDraft("task-1", { text: "hello", photos: [] });
- saveDraft("task-1", { text: " ", photos: [] });
-
- expect(loadDraft("task-1")).toBeNull();
- expect(draftIndex()).toEqual([]);
- });
-
- it("drops photos with missing fields", () => {
- mocks.existing.add("file:///a.jpg");
- const { name: _, ...partial } = photo("file:///a.jpg");
- saveDraft("task-1", { text: "look", photos: [partial as Photo] });
-
- expect(loadDraft("task-1")).toEqual({ text: "look", photos: [] });
- });
-
- it("ignores index entries that are not strings", () => {
- accountStore(mocks.session as never).set(
- "draft-1-index",
- JSON.stringify([1, "task-1", null]),
- );
- saveDraft("task-2", { text: "two", photos: [] });
-
- expect(draftIndex()).toEqual(["task-2", "task-1"]);
- });
-
- it("keeps only the most recent drafts", () => {
- for (let index = 0; index < 51; index++) {
- saveDraft(`task-${index}`, { text: `draft ${index}`, photos: [] });
- }
-
- expect(loadDraft("task-0")).toBeNull();
- expect(loadDraft("task-1")?.text).toBe("draft 1");
- expect(loadDraft("task-50")?.text).toBe("draft 50");
- expect(draftIndex()).toHaveLength(50);
- });
-
- it("keeps drafts per project", () => {
- saveDraft(NEW_CHAT_DRAFT, { text: "first project", photos: [] });
- mocks.auth.session = { ...mocks.session, projectId: 2 };
-
- expect(loadDraft(NEW_CHAT_DRAFT)).toBeNull();
- });
-
- it("does nothing without a session", () => {
- mocks.auth.session = null;
- saveDraft("task-1", { text: "hello", photos: [] });
-
- expect(loadDraft("task-1")).toBeNull();
- expect(mocks.stores.size).toBe(0);
- });
-
- it("is wiped with the account cache", () => {
- saveDraft("task-1", { text: "hello", photos: [] });
- clearAccountCache(mocks.session as never);
-
- expect(loadDraft("task-1")).toBeNull();
- });
-
- it("ignores a corrupt entry", () => {
- accountStore(mocks.session as never).set("draft-1-task-1", "{");
-
- expect(loadDraft("task-1")).toBeNull();
- });
-
- it("moves a draft and sends later saves to the new key", () => {
- saveDraft("new-1", { text: "typed", photos: [] });
- moveDraft("new-1", "task-1");
-
- expect(loadDraft("task-1")?.text).toBe("typed");
- expect(draftIndex()).toEqual(["task-1"]);
-
- saveDraft("new-1", { text: "typed more", photos: [] });
-
- expect(loadDraft("task-1")?.text).toBe("typed more");
- expect(draftIndex()).toEqual(["task-1"]);
- });
-});
-
-describe("keepUnsent", () => {
- const unsent = { text: "sent", photos: [photo("file:///sent.jpg")] };
-
- it("restores the unsent message into an empty draft", () => {
- expect(keepUnsent({ text: " ", photos: [] }, unsent)).toEqual(unsent);
- });
-
- it("keeps what was typed since the send", () => {
- const typed = { text: "new", photos: [photo("file:///new.jpg")] };
-
- expect(keepUnsent(typed, unsent)).toEqual(typed);
- expect(keepUnsent({ text: "new", photos: [] }, unsent)).toEqual({
- text: "new",
- photos: unsent.photos,
- });
- });
-});
-
-describe("sending a draft", () => {
- it("keeps the message saved until the send goes out", () => {
- saveDraft("task-1", { text: "hello", photos: [] });
- const settle = beginSend("task-1", { text: "hello", photos: [] });
-
- expect(loadDraft("task-1")).toBeNull();
- expect(draftIndex()).toEqual(["task-1"]);
-
- settle(true);
-
- expect(loadDraft("task-1")).toBeNull();
- expect(draftIndex()).toEqual([]);
- });
-
- it("keeps text typed during the send after it goes out", () => {
- const settle = beginSend("task-1", { text: "hello", photos: [] });
- saveDraft("task-1", { text: "next", photos: [] });
- settle(true);
-
- expect(loadDraft("task-1")?.text).toBe("next");
- });
-
- it("returns the message to the draft when the send fails", () => {
- const settle = beginSend("task-1", { text: "hello", photos: [] });
- saveDraft("task-1", { text: " ", photos: [] });
- settle(false);
-
- expect(loadDraft("task-1")?.text).toBe("hello");
- });
-
- it("restores a send the app did not finish", async () => {
- beginSend("task-1", { text: "hello", photos: [] });
- vi.resetModules();
- const relaunched = await import("./cache");
-
- expect(relaunched.loadDraft("task-1")?.text).toBe("hello");
- relaunched.saveDraft("task-1", { text: "", photos: [] });
- expect(relaunched.loadDraft("task-1")).toBeNull();
- });
-
- it("does not write after the project changed", () => {
- const settle = beginSend("task-1", { text: "hello", photos: [] });
- mocks.auth.session = { ...mocks.session, projectId: 2 };
- settle(false);
-
- expect(loadDraft("task-1")).toBeNull();
- mocks.auth.session = { ...mocks.session };
- expect(loadDraft("task-1")?.text).toBe("hello");
- });
-
- it("keeps a pending message out of another account", () => {
- beginSend(NEW_CHAT_DRAFT, { text: "private", photos: [] });
- const other = { ...mocks.session, host: "https://eu.posthog.com" };
- mocks.auth.session = other;
- saveDraft(NEW_CHAT_DRAFT, { text: "", photos: [] });
-
- expect(loadDraft(NEW_CHAT_DRAFT)).toBeNull();
- expect(accountStore(other as never).getString("draft-1-new-chat")).toBe(
- undefined,
- );
- });
-
- it("drops pending messages with the account cache", () => {
- beginSend(NEW_CHAT_DRAFT, { text: "private", photos: [] });
- clearAccountCache(mocks.session as never);
- saveDraft(NEW_CHAT_DRAFT, { text: "", photos: [] });
-
- expect(
- accountStore(mocks.session as never).getString("draft-1-new-chat"),
- ).toBe(undefined);
- });
-});
diff --git a/products/desktop/apps/mobilehog/src/lib/cache.ts b/products/desktop/apps/mobilehog/src/lib/cache.ts
deleted file mode 100644
index 04f38e2da52e..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/cache.ts
+++ /dev/null
@@ -1,345 +0,0 @@
-import { createSyncStoragePersister } from "@tanstack/query-sync-storage-persister";
-import { hydrate, type QueryClient } from "@tanstack/react-query";
-import {
- type PersistedClient,
- persistQueryClientSubscribe,
-} from "@tanstack/react-query-persist-client";
-import * as Crypto from "expo-crypto";
-import { File } from "expo-file-system";
-import * as SecureStore from "expo-secure-store";
-import { createMMKV, deleteMMKV, type MMKV } from "react-native-mmkv";
-import type { Photo } from "@/lib/attachments";
-import { type Session, useAuth } from "@/lib/auth";
-import type { Block } from "@/lib/transcript";
-
-export const CACHE_MAX_AGE = 7 * 24 * 60 * 60 * 1000;
-const KEY_NAME = "mobilehog_cache_key";
-const CACHED_QUERIES = new Set(["tasks", "reports", "activity", "models"]);
-
-const stores = new Map<string, MMKV>();
-
-// Cached tasks can hold code and secrets, so the store is encrypted with a device key.
-function encryptionKey(): string {
- const saved = SecureStore.getItem(KEY_NAME);
- if (saved) return saved;
- const key = Array.from(Crypto.getRandomBytes(16), (byte) =>
- byte.toString(16).padStart(2, "0"),
- ).join("");
- SecureStore.setItem(KEY_NAME, key);
- return key;
-}
-
-function storeId(session: Session): string {
- const host = Array.from(session.host, (character) =>
- character.charCodeAt(0).toString(16),
- ).join("");
- return `cache-${host}-${session.userId}`;
-}
-
-export function accountStore(session: Session): MMKV {
- const id = storeId(session);
- let store = stores.get(id);
- if (!store) {
- store = createMMKV({
- id,
- encryptionKey: encryptionKey(),
- encryptionType: "AES-256",
- });
- stores.set(id, store);
- }
- return store;
-}
-
-export function clearAccountCache(session: Session): void {
- const id = storeId(session);
- stores.delete(id);
- accountDrafts.delete(id);
- deleteMMKV(id);
-}
-
-// Restores synchronously so saved lists render on the first frame.
-export function persistQueryCache(
- client: QueryClient,
- session: Session,
-): () => void {
- const store = accountStore(session);
- const key = `queries-${session.projectId}`;
- const raw = store.getString(key);
- if (raw) {
- try {
- const saved = JSON.parse(raw) as PersistedClient;
- if (Date.now() - saved.timestamp < CACHE_MAX_AGE) {
- hydrate(client, saved.clientState);
- }
- } catch {
- store.remove(key);
- }
- }
- const persister = createSyncStoragePersister({
- key,
- throttleTime: 1000,
- storage: {
- getItem: (name) => store.getString(name) ?? null,
- setItem: (name, value) => store.set(name, value),
- removeItem: (name) => {
- store.remove(name);
- },
- },
- });
- return persistQueryClientSubscribe({
- queryClient: client,
- persister,
- buster: "",
- dehydrateOptions: {
- shouldDehydrateQuery: (query) =>
- query.state.status === "success" &&
- CACHED_QUERIES.has(String(query.queryKey[0])) &&
- !query.queryKey.includes("search"),
- },
- });
-}
-
-const TRANSCRIPT_LIMIT = 50;
-const DRAFT_LIMIT = 50;
-
-// The new-chat composer has no task id yet.
-export const NEW_CHAT_DRAFT = "new-chat";
-
-interface SavedTranscript {
- savedAt: number;
- blocks: Block[];
-}
-
-export interface Draft {
- text: string;
- photos: Photo[];
-}
-
-function projectScope(kind: string): { store: MMKV; prefix: string } | null {
- const { session } = useAuth.getState();
- if (!session) return null;
- return {
- store: accountStore(session),
- prefix: `${kind}-${session.projectId}`,
- };
-}
-
-function readIndex(store: MMKV, prefix: string): string[] {
- try {
- const order = JSON.parse(store.getString(`${prefix}-index`) ?? "[]");
- return Array.isArray(order)
- ? order.filter((item): item is string => typeof item === "string")
- : [];
- } catch {
- return [];
- }
-}
-
-// Moves the id to the front and drops the oldest entries past the limit.
-function touchIndex(
- store: MMKV,
- prefix: string,
- id: string,
- limit: number,
-): void {
- const order = [id, ...readIndex(store, prefix).filter((item) => item !== id)];
- for (const stale of order.slice(limit)) {
- store.remove(`${prefix}-${stale}`);
- }
- store.set(`${prefix}-index`, JSON.stringify(order.slice(0, limit)));
-}
-
-export function loadTranscript(taskId: string): Block[] | null {
- const scope = projectScope("transcript");
- const raw = scope?.store.getString(`${scope.prefix}-${taskId}`);
- if (!raw) return null;
- try {
- const saved = JSON.parse(raw) as SavedTranscript;
- return Date.now() - saved.savedAt < CACHE_MAX_AGE ? saved.blocks : null;
- } catch {
- return null;
- }
-}
-
-export function saveTranscript(taskId: string, blocks: Block[]): void {
- const scope = projectScope("transcript");
- if (!scope || blocks.length === 0) return;
- const saved: SavedTranscript = { savedAt: Date.now(), blocks };
- scope.store.set(`${scope.prefix}-${taskId}`, JSON.stringify(saved));
- touchIndex(scope.store, scope.prefix, taskId, TRANSCRIPT_LIMIT);
-}
-
-interface AccountDrafts {
- // A placeholder chat gets its task id after its screen saved under the
- // temporary id, so writes to that id follow the move.
- moved: Map<string, string>;
- // Messages whose send has not settled, by storage id. A saved message with
- // no entry here is from a send the app did not finish.
- sending: Map<string, Draft>;
-}
-
-interface DraftScope {
- store: MMKV;
- prefix: string;
- key: string;
- id: string;
- drafts: AccountDrafts;
-}
-
-const accountDrafts = new Map<string, AccountDrafts>();
-
-function draftScope(key: string): DraftScope | null {
- const { session } = useAuth.getState();
- if (!session) return null;
- const account = storeId(session);
- let drafts = accountDrafts.get(account);
- if (!drafts) {
- drafts = { moved: new Map(), sending: new Map() };
- accountDrafts.set(account, drafts);
- }
- const prefix = `draft-${session.projectId}`;
- const target = drafts.moved.get(`${prefix}-${key}`) ?? key;
- return {
- store: accountStore(session),
- prefix,
- key: target,
- id: `${prefix}-${target}`,
- drafts,
- };
-}
-
-function hasContent(draft: Draft): boolean {
- return draft.text.trim().length > 0 || draft.photos.length > 0;
-}
-
-// Picker copies live in the caches directory, which iOS can purge between
-// launches, so photos whose file is gone are dropped.
-function isUsablePhoto(value: unknown): value is Photo {
- const photo = value as Partial<Photo> | null;
- if (
- typeof photo?.id !== "string" ||
- typeof photo.uri !== "string" ||
- typeof photo.name !== "string" ||
- typeof photo.mimeType !== "string" ||
- typeof photo.size !== "number"
- ) {
- return false;
- }
- try {
- return new File(photo.uri).exists;
- } catch {
- return false;
- }
-}
-
-function parseDraft(value: unknown): Draft {
- const draft = (value ?? {}) as { text?: unknown; photos?: unknown };
- return {
- text: typeof draft.text === "string" ? draft.text : "",
- photos: Array.isArray(draft.photos)
- ? draft.photos.filter(isUsablePhoto)
- : [],
- };
-}
-
-function readDraft(
- store: MMKV,
- id: string,
-): { draft: Draft; unsent: Draft | null } | null {
- const raw = store.getString(id);
- if (!raw) return null;
- try {
- const saved = JSON.parse(raw);
- return {
- draft: parseDraft(saved),
- unsent: saved?.unsent ? parseDraft(saved.unsent) : null,
- };
- } catch {
- return null;
- }
-}
-
-function removeDraft({ store, prefix, key, id }: DraftScope): void {
- if (!store.contains(id)) return;
- store.remove(id);
- store.set(
- `${prefix}-index`,
- JSON.stringify(readIndex(store, prefix).filter((item) => item !== key)),
- );
-}
-
-function writeDraft(scope: DraftScope, draft: Draft): void {
- const unsent = scope.drafts.sending.get(scope.id);
- if (!hasContent(draft) && !unsent) {
- removeDraft(scope);
- return;
- }
- scope.store.set(
- scope.id,
- JSON.stringify({ text: draft.text, photos: draft.photos, unsent }),
- );
- touchIndex(scope.store, scope.prefix, scope.key, DRAFT_LIMIT);
-}
-
-// What the composer gets back when a send fails: text and photos typed since
-// then win over the unsent ones.
-export function keepUnsent(typed: Draft, unsent: Draft): Draft {
- return {
- text: typed.text.trim() ? typed.text : unsent.text,
- photos: typed.photos.length ? typed.photos : unsent.photos,
- };
-}
-
-export function loadDraft(key: string): Draft | null {
- const scope = draftScope(key);
- if (!scope) return null;
- const saved = readDraft(scope.store, scope.id);
- if (!saved) return null;
- let { draft } = saved;
- if (saved.unsent && !scope.drafts.sending.has(scope.id)) {
- draft = keepUnsent(draft, saved.unsent);
- writeDraft(scope, draft);
- }
- return hasContent(draft) ? draft : null;
-}
-
-export function saveDraft(key: string, draft: Draft): void {
- const scope = draftScope(key);
- if (scope) writeDraft(scope, { text: draft.text, photos: draft.photos });
-}
-
-// Keeps the message in the saved draft until the send settles, so it survives
-// the app closing mid-send. Call the result with whether the send went out.
-export function beginSend(
- key: string,
- message: Draft,
-): (sent: boolean) => void {
- const scope = draftScope(key);
- if (!scope) return () => {};
- scope.drafts.sending.set(scope.id, message);
- writeDraft(scope, { text: "", photos: [] });
- return (sent) => {
- if (scope.drafts.sending.get(scope.id) === message) {
- scope.drafts.sending.delete(scope.id);
- }
- const current = projectScope("draft");
- if (current?.store !== scope.store || current.prefix !== scope.prefix) {
- return;
- }
- const typed = readDraft(scope.store, scope.id)?.draft ?? {
- text: "",
- photos: [],
- };
- writeDraft(scope, sent ? typed : keepUnsent(typed, message));
- };
-}
-
-export function moveDraft(from: string, to: string): void {
- const source = draftScope(from);
- const target = draftScope(to);
- if (!source || !target) return;
- source.drafts.moved.set(source.id, target.key);
- const saved = readDraft(source.store, source.id);
- removeDraft(source);
- if (saved) writeDraft(target, saved.draft);
-}
diff --git a/products/desktop/apps/mobilehog/src/lib/client.ts b/products/desktop/apps/mobilehog/src/lib/client.ts
deleted file mode 100644
index e9fff1e2d117..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/client.ts
+++ /dev/null
@@ -1,67 +0,0 @@
-import type { FetchImplementation } from "@posthog/api-client/fetcher";
-import { PostHogAPIClient } from "@posthog/api-client/posthog-client";
-import { fetch } from "expo/fetch";
-import {
- getAccessToken,
- getBaseUrl,
- getProjectId,
- refreshAccessTokenOnce,
-} from "@/lib/api";
-import { sessionIdentity } from "@/lib/auth";
-
-const nativeFetch: FetchImplementation = (input, init) =>
- fetch(
- typeof input === "string"
- ? input
- : input instanceof URL
- ? input.toString()
- : input.url,
- { ...init, credentials: "omit" },
- );
-
-let client: PostHogAPIClient | null = null;
-let clientIdentity: string | null = null;
-
-export function getClient(): PostHogAPIClient {
- const identity = sessionIdentity();
- const projectId = getProjectId();
- const host = getBaseUrl();
- if (!client || clientIdentity !== identity) {
- const assertCurrent = (): void => {
- if (sessionIdentity() !== identity)
- throw new Error("Session changed. Sign in again.");
- };
- client = new PostHogAPIClient(
- host,
- async () => {
- assertCurrent();
- return getAccessToken();
- },
- async () => {
- assertCurrent();
- const token = await refreshAccessTokenOnce();
- assertCurrent();
- return token;
- },
- projectId,
- {
- appVersion: "0.1.0",
- fetch: async (input, init) => {
- assertCurrent();
- const response = await nativeFetch(input, init);
- assertCurrent();
- return response;
- },
- githubConnectFrom: "posthog_mobile",
- userAgent: "posthog/mobilehog; version: 0.1.0",
- },
- );
- clientIdentity = identity;
- }
- return client;
-}
-
-export function resetClient(): void {
- client = null;
- clientIdentity = null;
-}
diff --git a/products/desktop/apps/mobilehog/src/lib/composer.ts b/products/desktop/apps/mobilehog/src/lib/composer.ts
deleted file mode 100644
index 60efca994990..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/composer.ts
+++ /dev/null
@@ -1,69 +0,0 @@
-import type { Adapter } from "@posthog/shared";
-import {
- adapterForModelId,
- DEFAULT_GATEWAY_MODEL,
- getReasoningEffortOptions,
- type SupportedReasoningEffort,
- supportsFastMode,
-} from "@posthog/shared";
-import { create } from "zustand";
-
-interface ComposerConfig {
- // The harness follows the model: GPT models run on Codex, the rest on Claude Code.
- adapter: Adapter;
- model: string;
- reasoning: SupportedReasoningEffort;
-}
-
-interface ComposerState extends ComposerConfig {
- setModel: (model: string) => void;
- setReasoning: (reasoning: SupportedReasoningEffort) => void;
- reset: () => void;
-}
-
-const defaults: ComposerConfig = {
- adapter: "claude",
- model: DEFAULT_GATEWAY_MODEL,
- reasoning: "high",
-};
-
-// Keep the effort valid for the model, preferring the current one.
-function clampReasoning(
- adapter: Adapter,
- model: string,
- reasoning: SupportedReasoningEffort,
-): SupportedReasoningEffort {
- const options = getReasoningEffortOptions(adapter, model);
- if (!options || options.some((option) => option.value === reasoning)) {
- return reasoning;
- }
- return options[options.length - 1]?.value ?? reasoning;
-}
-
-export const useComposer = create<ComposerState>((set, get) => ({
- ...defaults,
- setModel: (model) => {
- const adapter = adapterForModelId(model);
- set({
- model,
- adapter,
- reasoning: clampReasoning(adapter, model, get().reasoning),
- });
- },
- setReasoning: (reasoning) => set({ reasoning }),
- reset: () => set({ ...defaults }),
-}));
-
-// The run request fields for the current picks, in api-client's names.
-export function currentRunConfig() {
- const { adapter, model, reasoning } = useComposer.getState();
- return {
- adapter,
- model,
- reasoningLevel:
- getReasoningEffortOptions(adapter, model) === null
- ? undefined
- : reasoning,
- ...(supportsFastMode(model) ? { fastMode: false } : {}),
- };
-}
diff --git a/products/desktop/apps/mobilehog/src/lib/dictation.test.ts b/products/desktop/apps/mobilehog/src/lib/dictation.test.ts
deleted file mode 100644
index 39ac64edd2d4..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/dictation.test.ts
+++ /dev/null
@@ -1,241 +0,0 @@
-import { ExpoSpeechRecognitionModule } from "expo-speech-recognition";
-import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
-
-const listeners = vi.hoisted(
- () => new Map<string, (event?: unknown) => void>(),
-);
-
-vi.mock("expo-speech-recognition", () => ({
- ExpoSpeechRecognitionModule: {
- requestPermissionsAsync: vi.fn(async () => ({ granted: true })),
- start: vi.fn(),
- stop: vi.fn(),
- abort: vi.fn(),
- },
- useSpeechRecognitionEvent: (
- name: string,
- listener: (event?: unknown) => void,
- ) => listeners.set(name, listener),
-}));
-vi.mock("react", () => ({
- useCallback: <T>(fn: T) => fn,
- useEffect: () => {},
- useRef: <T>(current: T) => ({ current }),
- useState: <T>(initial: T) => [initial, () => {}],
-}));
-vi.mock("react-native-reanimated", () => ({
- Easing: { linear: (t: number) => t },
- useSharedValue: <T>(value: T) => ({ value, modify: () => {} }),
- withTiming: (value: number) => value,
-}));
-vi.mock("@/components/Waveform", () => ({ RING: 96, SAMPLE_MS: 80 }));
-
-import {
- applyResult,
- type Dictation,
- type Heard,
- joinHeard,
- recognitionLang,
- useDictation,
- volumeToLevel,
-} from "./dictation";
-
-const result = (transcript: string, isFinal: boolean) => ({
- isFinal,
- results: [{ transcript, confidence: 0, segments: [] }],
-});
-
-describe("volumeToLevel", () => {
- it.each([
- [-2, 0],
- [0, 0],
- [1, 0],
- [4.5, 0.5],
- [8, 1],
- [10, 1],
- ])("maps volume %d to level %d", (volume, level) => {
- expect(volumeToLevel(volume)).toBeCloseTo(level);
- });
-});
-
-describe("applyResult", () => {
- const empty: Heard = { finals: [], interim: "" };
-
- it("replaces the interim text until a result is final", () => {
- const first = applyResult(empty, result("open the", false));
- const second = applyResult(first, result("open the pull request", false));
- expect(second).toEqual({ finals: [], interim: "open the pull request" });
- });
-
- it("moves a final result into finals and clears the interim text", () => {
- const partial = applyResult(empty, result("fix the bug", false));
- const done = applyResult(partial, result(" Fix the bug.", true));
- expect(done).toEqual({ finals: ["Fix the bug."], interim: "" });
- });
-
- it("ignores empty final results", () => {
- const heard: Heard = { finals: ["Hello."], interim: "and" };
- const event = { isFinal: true, results: [] };
- expect(applyResult(heard, event)).toEqual({
- finals: ["Hello."],
- interim: "",
- });
- });
-});
-
-describe("joinHeard", () => {
- it("joins finals and the interim text with single spaces", () => {
- expect(
- joinHeard({ finals: ["Fix the bug.", " Then ship it."], interim: "now" }),
- ).toBe("Fix the bug. Then ship it. now");
- });
-
- it("returns an empty string when nothing was heard", () => {
- expect(joinHeard({ finals: [], interim: "" })).toBe("");
- });
-});
-
-describe("recognitionLang", () => {
- it.each([
- ["en-US", "en-US"],
- ["de-DE", "de-DE"],
- ["en-GB-u-ca-gregory", "en-GB"],
- ["zh-Hans-CN", "zh-CN"],
- ["zh-Hant-TW", "zh-TW"],
- ["en", undefined],
- ["zh-Hans", undefined],
- ["", undefined],
- ])("maps locale %j to %j", (locale, lang) => {
- expect(recognitionLang(locale)).toBe(lang);
- });
-});
-
-describe("useDictation", () => {
- const native = vi.mocked(ExpoSpeechRecognitionModule);
-
- beforeEach(() => {
- vi.clearAllMocks();
- listeners.clear();
- });
-
- const startNative = async (): Promise<Dictation> => {
- const dictation = useDictation();
- dictation.start();
- await vi.waitFor(() => expect(native.start).toHaveBeenCalledTimes(1));
- return dictation;
- };
-
- it.each([
- ["stop", (dictation: Dictation) => dictation.stop()],
- ["cancel", (dictation: Dictation) => dictation.cancel()],
- ])("aborts a native start that finishes after %s", async (_, end) => {
- end(await startNative());
- native.abort.mockClear();
- listeners.get("start")?.();
- expect(native.abort).toHaveBeenCalledTimes(1);
- });
-
- it("keeps a native start while dictation is active", async () => {
- await startNative();
- listeners.get("start")?.();
- expect(native.abort).not.toHaveBeenCalled();
- });
-
- it("ignores a native start that it did not request", () => {
- useDictation();
- listeners.get("start")?.();
- expect(native.abort).not.toHaveBeenCalled();
- });
-});
-
-describe("useDictation stop", () => {
- const native = vi.mocked(ExpoSpeechRecognitionModule);
- const emit = (name: string, event?: unknown) => listeners.get(name)?.(event);
-
- beforeEach(() => {
- vi.clearAllMocks();
- listeners.clear();
- });
-
- afterEach(() => {
- vi.useRealTimers();
- });
-
- const listen = async (
- onEnd?: (heard: string) => void,
- ): Promise<Dictation> => {
- const dictation = useDictation(onEnd);
- dictation.start();
- await vi.waitFor(() => expect(native.start).toHaveBeenCalledTimes(1));
- emit("start");
- return dictation;
- };
-
- it("keeps the final result that arrives after stop", async () => {
- const onEnd = vi.fn();
- const dictation = await listen(onEnd);
- emit("result", result("Fix the", false));
- const stopped = dictation.stop();
- expect(native.stop).toHaveBeenCalledTimes(1);
- emit("result", result("Fix the bug.", true));
- emit("end");
- await expect(stopped).resolves.toBe("Fix the bug.");
- expect(onEnd).not.toHaveBeenCalled();
- });
-
- it("resolves a second stop with nothing so the words are kept once", async () => {
- const dictation = await listen();
- emit("result", result("Ship it.", true));
- const first = dictation.stop();
- const second = dictation.stop();
- emit("end");
- await expect(first).resolves.toBe("Ship it.");
- await expect(second).resolves.toBe("");
- expect(native.stop).toHaveBeenCalledTimes(1);
- });
-
- it("resolves with null when cancel comes during a stop", async () => {
- const dictation = await listen();
- emit("result", result("Ship it.", true));
- const stopped = dictation.stop();
- dictation.cancel();
- await expect(stopped).resolves.toBeNull();
- expect(native.abort).toHaveBeenCalledTimes(1);
- });
-
- it("ends with what was heard when the recognizer never reports end", async () => {
- const dictation = await listen();
- emit("result", result("Ship it", false));
- vi.useFakeTimers();
- const stopped = dictation.stop();
- vi.advanceTimersByTime(1500);
- await expect(stopped).resolves.toBe("Ship it");
- expect(native.abort).toHaveBeenCalledTimes(1);
- });
-
- it("aborts a native start that lands while a stop waits", async () => {
- const dictation = useDictation();
- dictation.start();
- await vi.waitFor(() => expect(native.start).toHaveBeenCalledTimes(1));
- const stopped = dictation.stop();
- emit("start");
- expect(native.abort).toHaveBeenCalledTimes(1);
- emit("end");
- await expect(stopped).resolves.toBe("");
- });
-
- it("stops at once when the recognizer has not started", async () => {
- const dictation = useDictation();
- dictation.start();
- await expect(dictation.stop()).resolves.toBe("");
- expect(native.stop).not.toHaveBeenCalled();
- });
-
- it("passes the words to onEnd when the recognizer ends on its own", async () => {
- const onEnd = vi.fn();
- await listen(onEnd);
- emit("result", result("Ship it.", true));
- emit("end");
- expect(onEnd).toHaveBeenCalledWith("Ship it.");
- });
-});
diff --git a/products/desktop/apps/mobilehog/src/lib/dictation.ts b/products/desktop/apps/mobilehog/src/lib/dictation.ts
deleted file mode 100644
index a204328c28dc..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/dictation.ts
+++ /dev/null
@@ -1,244 +0,0 @@
-import {
- ExpoSpeechRecognitionModule,
- type ExpoSpeechRecognitionResultEvent,
- useSpeechRecognitionEvent,
-} from "expo-speech-recognition";
-import { useCallback, useEffect, useRef, useState } from "react";
-import {
- Easing,
- type SharedValue,
- useSharedValue,
- withTiming,
-} from "react-native-reanimated";
-import { RING, SAMPLE_MS } from "@/components/Waveform";
-
-export interface Dictation {
- // Stays true while a stop waits for the final result.
- active: boolean;
- stopping: boolean;
- transcript: string;
- // Read on the UI thread by the waveform; updating them never re-renders React.
- levels: SharedValue<number[]>;
- head: SharedValue<number>;
- start: () => void;
- // Ends dictation and resolves with what was heard once the recognizer delivers its final result.
- // A second call during the wait resolves with "", so each caller gets the words only once.
- // Resolves with null when cancel ends the wait.
- stop: () => Promise<string | null>;
- // Ends dictation and drops what was heard.
- cancel: () => void;
-}
-
-export interface Heard {
- finals: string[];
- interim: string;
-}
-
-// The recognizer reports volume from -2 to 10; below QUIET is room noise.
-const QUIET = 1;
-const LOUD = 8;
-// Safety net for a recognizer that never reports end after stop.
-const STOP_TIMEOUT_MS = 1500;
-
-export function volumeToLevel(value: number): number {
- return Math.min(1, Math.max(0, (value - QUIET) / (LOUD - QUIET)));
-}
-
-export function applyResult(
- heard: Heard,
- event: ExpoSpeechRecognitionResultEvent,
-): Heard {
- const text = event.results[0]?.transcript.trim() ?? "";
- if (!event.isFinal) return { finals: heard.finals, interim: text };
- return { finals: text ? [...heard.finals, text] : heard.finals, interim: "" };
-}
-
-export function joinHeard({ finals, interim }: Heard): string {
- return [...finals, interim]
- .map((part) => part.trim())
- .filter(Boolean)
- .join(" ");
-}
-
-// Recognizers name locales by language and region, so a script subtag is dropped: zh-Hans-CN becomes zh-CN.
-// Any other shape returns undefined, and the recognizer then uses its en-US default.
-export function recognitionLang(locale: string): string | undefined {
- const match = /^([a-z]{2,3})(?:-[A-Z][a-z]{3})?(-[A-Z]{2})(?:-u-|$)/.exec(
- locale,
- );
- return match ? match[1] + match[2] : undefined;
-}
-
-const emptyRing = (): number[] => new Array(RING).fill(-1);
-const nothingHeard = (): Heard => ({ finals: [], interim: "" });
-
-// onEnd receives what was heard when the recognizer ends on its own.
-export function useDictation(onEnd?: (heard: string) => void): Dictation {
- const [active, setActive] = useState(false);
- const [stopping, setStopping] = useState(false);
- const [transcript, setTranscript] = useState("");
- const levels = useSharedValue<number[]>(emptyRing());
- const head = useSharedValue(-1);
- const count = useRef(0);
- const heard = useRef<Heard>(nothingHeard());
- // Bumped on every start and finish so a late permission answer cannot restart a finished session.
- const session = useRef(0);
- const live = useRef(false);
- const listening = useRef(false);
- // True from this hook's native start call until the recognizer reports start or a startup error.
- const starting = useRef(false);
- const pendingStop = useRef<((heard: string | null) => void) | null>(null);
- const stopTimer = useRef<ReturnType<typeof setTimeout> | undefined>(
- undefined,
- );
- const endRef = useRef(onEnd);
-
- useEffect(() => {
- endRef.current = onEnd;
- }, [onEnd]);
-
- const push = useCallback(
- (level: number) => {
- const id = count.current++;
- levels.modify((ring) => {
- "worklet";
- ring[id % RING] = level;
- return ring;
- });
- head.value = withTiming(id, {
- duration: SAMPLE_MS,
- easing: Easing.linear,
- });
- },
- [levels, head],
- );
-
- const finish = useCallback((kept: string | null = ""): boolean => {
- const wasListening = listening.current;
- const resolve = pendingStop.current;
- session.current++;
- live.current = false;
- listening.current = false;
- pendingStop.current = null;
- clearTimeout(stopTimer.current);
- setStopping(false);
- setActive(false);
- resolve?.(kept);
- return wasListening;
- }, []);
-
- // Before native start, an end or error can only come from the previous session.
- const endQuietly = useCallback(() => {
- if (!live.current || !listening.current) return;
- const text = joinHeard(heard.current);
- if (pendingStop.current) {
- finish(text);
- return;
- }
- finish();
- endRef.current?.(text);
- }, [finish]);
-
- useSpeechRecognitionEvent("volumechange", (event) => {
- if (live.current) push(volumeToLevel(event.value));
- });
-
- useSpeechRecognitionEvent("result", (event) => {
- if (!live.current) return;
- heard.current = applyResult(heard.current, event);
- setTranscript(joinHeard(heard.current));
- });
-
- // On iOS, native start runs in a task that stop and abort do not wait for.
- // A stop or cancel during startup can finish first, and the microphone then opens after dictation ended.
- useSpeechRecognitionEvent("start", () => {
- if (!starting.current) return;
- starting.current = false;
- if (!live.current || pendingStop.current) {
- ExpoSpeechRecognitionModule.abort();
- }
- });
-
- useSpeechRecognitionEvent("error", (event) => {
- if (event.error === "aborted") return;
- starting.current = false;
- endQuietly();
- });
-
- useSpeechRecognitionEvent("end", endQuietly);
-
- useEffect(
- () => () => {
- session.current++;
- live.current = false;
- clearTimeout(stopTimer.current);
- if (listening.current || starting.current) {
- ExpoSpeechRecognitionModule.abort();
- }
- },
- [],
- );
-
- const start = useCallback(() => {
- const id = ++session.current;
- count.current = 0;
- levels.value = emptyRing();
- head.value = -1;
- heard.current = nothingHeard();
- live.current = true;
- listening.current = false;
- setTranscript("");
- setActive(true);
- ExpoSpeechRecognitionModule.requestPermissionsAsync()
- .then((permission) => {
- if (id !== session.current) return;
- if (!permission.granted) {
- finish();
- return;
- }
- listening.current = true;
- starting.current = true;
- ExpoSpeechRecognitionModule.start({
- lang: recognitionLang(Intl.DateTimeFormat().resolvedOptions().locale),
- interimResults: true,
- continuous: true,
- addsPunctuation: true,
- volumeChangeEventOptions: {
- enabled: true,
- intervalMillis: SAMPLE_MS,
- },
- });
- })
- .catch(() => {
- if (id === session.current) finish();
- });
- }, [levels, head, finish]);
-
- // Results keep arriving after native stop, so the session stays live until the recognizer reports end.
- const stop = useCallback((): Promise<string | null> => {
- if (!live.current || pendingStop.current) return Promise.resolve("");
- if (!listening.current) {
- finish();
- return Promise.resolve(joinHeard(heard.current));
- }
- const done = new Promise<string | null>((resolve) => {
- pendingStop.current = resolve;
- });
- stopTimer.current = setTimeout(() => {
- if (finish(joinHeard(heard.current))) {
- ExpoSpeechRecognitionModule.abort();
- }
- }, STOP_TIMEOUT_MS);
- setStopping(true);
- ExpoSpeechRecognitionModule.stop();
- return done;
- }, [finish]);
-
- const cancel = useCallback(() => {
- if (finish(null)) ExpoSpeechRecognitionModule.abort();
- heard.current = nothingHeard();
- setTranscript("");
- }, [finish]);
-
- return { active, stopping, transcript, levels, head, start, stop, cancel };
-}
diff --git a/products/desktop/apps/mobilehog/src/lib/engine.ts b/products/desktop/apps/mobilehog/src/lib/engine.ts
deleted file mode 100644
index d9d8aac9c699..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/engine.ts
+++ /dev/null
@@ -1,103 +0,0 @@
-import {
- type CloudTaskEngine,
- type CloudTaskFetch,
- createCloudTaskEngine,
-} from "@posthog/core/cloud-task/cloud-task-engine";
-import { CloudTaskEvent } from "@posthog/core/cloud-task/schemas";
-import type { CloudTaskUpdatePayload } from "@posthog/shared";
-import { fetch } from "expo/fetch";
-import {
- authedFetch,
- type FetchInit,
- getBaseUrl,
- getProjectId,
-} from "@/lib/api";
-import { sessionIdentity } from "@/lib/auth";
-import { logger } from "@/lib/logger";
-
-const noopAnalytics = {
- initialize: () => {},
- track: () => {},
- identify: () => {},
- setCurrentUserId: () => {},
- getCurrentUserId: () => null,
- getOrCreateSessionId: () => "mobilehog",
- resetUser: () => {},
- captureException: () => {},
- flush: async () => {},
- shutdown: async () => {},
-};
-
-let engine: CloudTaskEngine | null = null;
-
-function getEngine(): CloudTaskEngine {
- if (engine) return engine;
- const identity = sessionIdentity();
- const assertCurrent = (): void => {
- if (sessionIdentity() !== identity)
- throw new Error("Session changed. Sign in again.");
- };
- engine = createCloudTaskEngine({
- auth: {
- authenticatedFetch: (url, init) => {
- assertCurrent();
- return authedFetch(url, init as FetchInit | undefined);
- },
- getCloudContext: async () => {
- assertCurrent();
- return { apiHost: getBaseUrl(), teamId: getProjectId() };
- },
- },
- analytics: noopAnalytics,
- logger,
- // React Native's global fetch cannot stream a body; expo/fetch can.
- streamFetch: ((url, init) =>
- fetch(url, { ...init, credentials: "omit" })) as CloudTaskFetch,
- });
- return engine;
-}
-
-export function resetEngine(): void {
- engine?.unwatchAll();
- engine = null;
-}
-
-export interface WatchHandle {
- stop: () => void;
- reconnectIfDisconnected: () => void;
-}
-
-export function watchRun(
- taskId: string,
- runId: string,
- onUpdate: (update: CloudTaskUpdatePayload) => void,
-): WatchHandle {
- const instance = getEngine();
- const listener = (update: CloudTaskUpdatePayload): void => {
- if (update.taskId === taskId && update.runId === runId) {
- onUpdate(update);
- }
- };
- instance.on(CloudTaskEvent.Update, listener);
- // A watcher for this run may survive a reload; drop it so we get a snapshot.
- instance.unwatch(taskId, runId);
- instance.watch({
- taskId,
- runId,
- apiHost: getBaseUrl(),
- teamId: getProjectId(),
- });
-
- let stopped = false;
- return {
- stop: () => {
- if (stopped) return;
- stopped = true;
- instance.off(CloudTaskEvent.Update, listener);
- instance.unwatch(taskId, runId);
- },
- reconnectIfDisconnected: () => {
- if (!stopped) instance.reconnectIfDisconnected(taskId, runId);
- },
- };
-}
diff --git a/products/desktop/apps/mobilehog/src/lib/logger.ts b/products/desktop/apps/mobilehog/src/lib/logger.ts
deleted file mode 100644
index f355fc320365..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/logger.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-type LogFn = (message: string, ...args: unknown[]) => void;
-
-export interface Logger {
- debug: LogFn;
- info: LogFn;
- warn: LogFn;
- error: LogFn;
- scope: (name: string) => Logger;
-}
-
-function createLogger(scope?: string): Logger {
- const prefix = scope ? `[${scope}]` : "";
- if (!__DEV__) {
- const noop: LogFn = () => {};
- return {
- debug: noop,
- info: noop,
- warn: noop,
- error: noop,
- scope: () => createLogger(scope),
- };
- }
- return {
- debug: (message, ...args) => console.debug(prefix, message, ...args),
- info: (message, ...args) => console.info(prefix, message, ...args),
- warn: (message, ...args) => console.warn(prefix, message, ...args),
- error: (message, ...args) => console.error(prefix, message, ...args),
- scope: (name) => createLogger(scope ? `${scope}:${name}` : name),
- };
-}
-
-export const logger = createLogger();
diff --git a/products/desktop/apps/mobilehog/src/lib/markdown.test.ts b/products/desktop/apps/mobilehog/src/lib/markdown.test.ts
deleted file mode 100644
index 21aae3cf5e4f..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/markdown.test.ts
+++ /dev/null
@@ -1,113 +0,0 @@
-import { marked, type Token, type Tokens } from "marked";
-import { describe, expect, it } from "vitest";
-import { isLoadableImageUrl, splitImageRuns } from "./markdown";
-
-function paragraphTokens(text: string): Token[] {
- const [paragraph] = marked.lexer(text) as Tokens.Paragraph[];
- return paragraph.tokens;
-}
-
-describe("splitImageRuns", () => {
- it("keeps a paragraph without images as one text run", () => {
- const runs = splitImageRuns(paragraphTokens("Just **text** here."));
- expect(runs).toHaveLength(1);
- expect(runs[0].kind).toBe("text");
- });
-
- it("lifts a lone image into an image run", () => {
- const runs = splitImageRuns(
- paragraphTokens("![A chart](https://example.com/chart.png)"),
- );
- expect(runs).toEqual([
- {
- kind: "image",
- token: expect.objectContaining({
- href: "https://example.com/chart.png",
- text: "A chart",
- }),
- },
- ]);
- });
-
- it("splits text around an inline image", () => {
- const runs = splitImageRuns(
- paragraphTokens("Before ![x](https://example.com/x.png) after"),
- );
- expect(runs.map((run) => run.kind)).toEqual(["text", "image", "text"]);
- });
-
- it("drops whitespace between images", () => {
- const runs = splitImageRuns(
- paragraphTokens(
- "![a](https://example.com/a.png) ![b](https://example.com/b.png)",
- ),
- );
- expect(runs.map((run) => run.kind)).toEqual(["image", "image"]);
- });
-
- it("keeps images with unsafe URLs inline", () => {
- const runs = splitImageRuns(
- paragraphTokens("See ![secret](file:///etc/passwd) now"),
- );
- expect(runs).toHaveLength(1);
- expect(runs[0].kind).toBe("text");
- });
-
- it("leaves images nested in links inline", () => {
- const runs = splitImageRuns(
- paragraphTokens(
- "[![badge](https://example.com/b.svg)](https://example.com)",
- ),
- );
- expect(runs).toHaveLength(1);
- expect(runs[0].kind).toBe("text");
- });
-
- it.each([
- ["bold", "**![x](https://example.com/x.png)**"],
- ["italic", "_![x](https://example.com/x.png)_"],
- ["struck", "~~![x](https://example.com/x.png)~~"],
- ])("lifts an image out of %s text", (_name, text) => {
- const runs = splitImageRuns(paragraphTokens(text));
- expect(runs.map((run) => run.kind)).toEqual(["image"]);
- });
-
- it("keeps the formatting of text around a lifted image", () => {
- const runs = splitImageRuns(
- paragraphTokens("**Before ![x](https://example.com/x.png) after**"),
- );
- expect(runs.map((run) => run.kind)).toEqual(["text", "image", "text"]);
- const [before, , after] = runs;
- for (const run of [before, after]) {
- expect(run.kind === "text" && run.tokens[0].type).toBe("strong");
- }
- });
-
- it("leaves formatted images nested in links inline", () => {
- const runs = splitImageRuns(
- paragraphTokens(
- "[**![badge](https://example.com/b.svg)**](https://example.com)",
- ),
- );
- expect(runs.map((run) => run.kind)).toEqual(["text"]);
- });
-
- it("keeps images with mailto URLs inline", () => {
- const runs = splitImageRuns(
- paragraphTokens("Write ![us](mailto:[email protected]) today"),
- );
- expect(runs.map((run) => run.kind)).toEqual(["text"]);
- });
-});
-
-describe("isLoadableImageUrl", () => {
- it.each([
- ["https://example.com/a.png", true],
- ["HTTP://example.com/a.png", true],
- ["mailto:[email protected]", false],
- ["file:///etc/passwd", false],
- ["not a url", false],
- ])("%s -> %s", (href, expected) => {
- expect(isLoadableImageUrl(href)).toBe(expected);
- });
-});
diff --git a/products/desktop/apps/mobilehog/src/lib/markdown.ts b/products/desktop/apps/mobilehog/src/lib/markdown.ts
deleted file mode 100644
index d9ae12a920ae..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/markdown.ts
+++ /dev/null
@@ -1,88 +0,0 @@
-import { isSafeExternalUrl } from "@posthog/shared";
-import { Marked, type Token, type Tokens } from "marked";
-import { objectTagExtensions } from "@/lib/objectTags";
-
-export type InlineRun =
- | { kind: "text"; tokens: Token[] }
- | { kind: "image"; token: Tokens.Image };
-
-type Piece =
- | { kind: "text"; token: Token }
- | { kind: "image"; token: Tokens.Image };
-
-export function isImageToken(token: Token): token is Tokens.Image {
- return token.type === "image";
-}
-
-export function isLoadableImageUrl(href: string): boolean {
- return /^https?:/i.test(href) && isSafeExternalUrl(href);
-}
-
-function isFormatToken(
- token: Token,
-): token is Tokens.Strong | Tokens.Em | Tokens.Del {
- return token.type === "strong" || token.type === "em" || token.type === "del";
-}
-
-// Links stay whole, so an image inside a link keeps its alt text inline.
-function liftImages(token: Token): Piece[] {
- if (isImageToken(token) && isLoadableImageUrl(token.href)) {
- return [{ kind: "image", token }];
- }
- if (!isFormatToken(token)) return [{ kind: "text", token }];
- const inner = token.tokens.flatMap(liftImages);
- if (!inner.some((piece) => piece.kind === "image")) {
- return [{ kind: "text", token }];
- }
- // Split the wrapper around each image so the text keeps its formatting.
- const pieces: Piece[] = [];
- let text: Token[] = [];
- const flush = () => {
- if (text.length) {
- const raw = text.map((child) => child.raw).join("");
- pieces.push({
- kind: "text",
- token: { ...token, raw, text: raw, tokens: text },
- });
- }
- text = [];
- };
- for (const piece of inner) {
- if (piece.kind === "image") {
- flush();
- pieces.push(piece);
- } else {
- text.push(piece.token);
- }
- }
- flush();
- return pieces;
-}
-
-// Images that can load stand on their own row between the text around them;
-// the rest stay inline and render their alt text.
-export function splitImageRuns(tokens: Token[]): InlineRun[] {
- const runs: InlineRun[] = [];
- let text: Token[] = [];
- const flush = () => {
- if (text.some((token) => token.raw.trim())) {
- runs.push({ kind: "text", tokens: text });
- }
- text = [];
- };
- for (const piece of tokens.flatMap(liftImages)) {
- if (piece.kind === "image") {
- flush();
- runs.push(piece);
- } else {
- text.push(piece.token);
- }
- }
- flush();
- return runs;
-}
-
-export function lexMarkdown(text: string): Token[] {
- const markdown = new Marked({ extensions: objectTagExtensions() });
- return markdown.Lexer.lex(text, markdown.defaults);
-}
diff --git a/products/desktop/apps/mobilehog/src/lib/mcp/client.ts b/products/desktop/apps/mobilehog/src/lib/mcp/client.ts
deleted file mode 100644
index 4b3b92baf952..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/mcp/client.ts
+++ /dev/null
@@ -1,95 +0,0 @@
-import { Client } from "@modelcontextprotocol/sdk/client/index.js";
-import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
-import type {
- CallToolResult,
- ReadResourceResult,
- Tool,
-} from "@modelcontextprotocol/sdk/types.js";
-import { MCP_HOSTS } from "@/config";
-import { requireSession, sessionIdentity } from "@/lib/auth";
-
-// The sandbox wrapper sends this too; it is what makes exec results carry the
-// UI-app resource URI and structured data instead of plain text.
-const CONSUMER = "posthog-code";
-
-interface Connection {
- key: string;
- client: Promise<Client>;
- tools?: Promise<Tool[]>;
-}
-
-let connection: Connection | null = null;
-
-export function resetMcpClient(): void {
- const previous = connection;
- connection = null;
- previous?.client.then((client) => client.close()).catch(() => {});
-}
-
-// One MCP client to the PostHog server for the signed-in host, opened lazily
-// and reopened if the session changes.
-function getConnection(): Connection {
- const session = requireSession();
- const key = `${sessionIdentity()}|${session.apiKey}`;
- if (connection?.key === key) return connection;
- resetMcpClient();
- const url = new URL(MCP_HOSTS[session.region]);
- const transport = new StreamableHTTPClientTransport(url, {
- requestInit: {
- headers: {
- Authorization: `Bearer ${session.apiKey}`,
- "x-posthog-mcp-consumer": CONSUMER,
- },
- },
- });
- const client = new Client(
- { name: "mobilehog", version: "1.0.0" },
- { capabilities: {} },
- );
- const ready = client.connect(transport).then(() => client);
- const next: Connection = { key, client: ready };
- ready.catch(() => {
- if (connection === next) connection = null;
- });
- connection = next;
- return next;
-}
-
-async function getClient(): Promise<Client> {
- const current = getConnection();
- const client = await current.client;
- if (connection !== current)
- throw new Error("Session changed. Sign in again.");
- return client;
-}
-
-export async function readMcpResource(
- uri: string,
-): Promise<ReadResourceResult> {
- const client = await getClient();
- return (await client.readResource({ uri })) as ReadResourceResult;
-}
-
-export async function callMcpTool(
- name: string,
- args?: Record<string, unknown>,
-): Promise<CallToolResult> {
- const client = await getClient();
- return (await client.callTool({
- name,
- arguments: args ?? {},
- })) as CallToolResult;
-}
-
-export function listMcpTools(): Promise<Tool[]> {
- const current = getConnection();
- if (!current.tools) {
- current.tools = getClient()
- .then((client) => client.listTools())
- .then((result) => result.tools);
- current.tools.catch(() => {
- current.tools = undefined;
- });
- }
- return current.tools;
-}
diff --git a/products/desktop/apps/mobilehog/src/lib/mcp/sandboxProxyHtml.ts b/products/desktop/apps/mobilehog/src/lib/mcp/sandboxProxyHtml.ts
deleted file mode 100644
index 1104def1c0b2..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/mcp/sandboxProxyHtml.ts
+++ /dev/null
@@ -1,127 +0,0 @@
-/**
- * Sandbox proxy HTML for mobile MCP Apps.
- *
- * Mirrors the desktop double-iframe pattern (see
- * apps/code/src/shared/mcp-sandbox-proxy.html) but routes messages through
- * `react-native-webview`'s bridge instead of `window.parent.postMessage`.
- *
- * RN host ←→ WebView (this HTML, the outer "proxy") ←→ Inner iframe (MCP App)
- *
- * Wire format on both sides is JSON-RPC, identical to desktop. The differences
- * are only in how messages cross the boundary:
- *
- * - Inbound (RN → WebView): RN calls `window.__mcpReceive(jsonString)` via
- * `webView.injectJavaScript`.
- * - Outbound (WebView → RN): the proxy calls
- * `window.ReactNativeWebView.postMessage(jsonString)`.
- *
- * The inner iframe still uses standard `window.parent.postMessage` to reach
- * the proxy — that part doesn't change.
- */
-export const sandboxProxyHtml = `<!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover">
- <style>
- html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; background: transparent; }
- iframe { border: none; width: 100%; height: 100%; display: block; }
- </style>
-</head>
-<body>
-<script>
-(function () {
- "use strict";
-
- function postToHost(data) {
- try {
- window.ReactNativeWebView.postMessage(JSON.stringify(data));
- } catch (err) {
- // Best-effort; nothing to do if the bridge is gone.
- }
- }
-
- function log() {
- var args = Array.prototype.slice.call(arguments);
- postToHost({ jsonrpc: "2.0", method: "ui/notifications/log", params: { args: args } });
- }
-
- var inner = document.createElement("iframe");
- inner.setAttribute("sandbox", "allow-scripts allow-forms");
- document.body.appendChild(inner);
-
- // contentWindow survives navigation, so an app that calls location.replace()
- // would keep the bridge. Only the first load of our srcdoc may use it.
- var appLoaded = false;
- var bridgeClosed = false;
- function onInnerLoad() {
- if (!appLoaded) {
- appLoaded = true;
- return;
- }
- bridgeClosed = true;
- }
-
- function buildAllowAttribute(permissions) {
- if (!permissions || typeof permissions !== "object") return "";
- var mapping = {
- camera: "camera",
- microphone: "microphone",
- geolocation: "geolocation",
- clipboardWrite: "clipboard-write"
- };
- return Object.keys(permissions)
- .filter(function (k) { return mapping[k] && permissions[k] != null; })
- .map(function (k) { return mapping[k] + " *"; })
- .join("; ");
- }
-
- // Inbound from RN host. The RN side injects:
- // window.__mcpReceive(JSON.stringify(message))
- window.__mcpReceive = function (jsonString) {
- var data;
- try { data = JSON.parse(jsonString); } catch (e) { return; }
- if (!data || typeof data !== "object") return;
-
- if (data.method === "ui/notifications/sandbox-resource-ready") {
- var params = data.params || {};
- if (typeof params.html === "string") {
- var allowValue = buildAllowAttribute(params.permissions);
- if (allowValue) inner.setAttribute("allow", allowValue);
-
- inner.addEventListener("load", onInnerLoad);
- inner.setAttribute("srcdoc", params.html);
- }
- return;
- }
-
- // All other host messages get relayed into the inner iframe untouched.
- if (!bridgeClosed && inner.contentWindow) {
- // An opaque origin serializes to "null", which postMessage rejects.
- inner.contentWindow.postMessage(data, "*");
- }
- };
-
- // Inner iframe → relay to RN host.
- window.addEventListener("message", function (event) {
- var data = event.data;
- if (!data || typeof data !== "object") return;
- if (event.source !== inner.contentWindow) return;
- if (bridgeClosed) return;
- postToHost(data);
- });
-
- // Tell RN we're ready. Retry a few times — RN may not have attached its
- // onMessage handler yet on first paint.
- var ready = { jsonrpc: "2.0", method: "ui/notifications/sandbox-proxy-ready", params: {} };
- var attempts = 0;
- function announce() {
- attempts++;
- postToHost(ready);
- if (attempts < 4) setTimeout(announce, 50 * attempts);
- }
- announce();
-})();
-</script>
-</body>
-</html>`;
diff --git a/products/desktop/apps/mobilehog/src/lib/mcp/theme.ts b/products/desktop/apps/mobilehog/src/lib/mcp/theme.ts
deleted file mode 100644
index 3f0119409d13..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/mcp/theme.ts
+++ /dev/null
@@ -1,117 +0,0 @@
-import type { McpUiStyles } from "@modelcontextprotocol/ext-apps/app-bridge";
-
-// The app runs in a WebView, so it needs literal colours rather than our
-// DynamicColorIOS tokens; these mirror the theme's light and dark values.
-const PALETTES = {
- light: {
- bg: "#EEEFE9",
- surface: "#FFFFFF",
- raised: "#F7F7F3",
- ink: "#151515",
- inkSoft: "#4F5150",
- inkMute: "#8F918D",
- line: "#DCDDD6",
- lineSoft: "#E7E8E1",
- },
- dark: {
- bg: "#151515",
- surface: "#222222",
- raised: "#1C1C1C",
- ink: "#EEEFE9",
- inkSoft: "#B8BAB4",
- inkMute: "#7C7E7A",
- line: "#333333",
- lineSoft: "#2A2A2A",
- },
-};
-
-const ACCENT = "#F54E00";
-const DANGER = "#FF474D";
-const OK = "#36C46F";
-const WARN = "#F9BD2B";
-
-export function buildHostStyles(dark: boolean): {
- variables: McpUiStyles;
- css: { fonts: string };
-} {
- const c = dark ? PALETTES.dark : PALETTES.light;
- const variables: Record<string, string> = {
- "--color-background-primary": c.bg,
- "--color-background-secondary": c.surface,
- "--color-background-tertiary": c.raised,
- "--color-background-inverse": c.ink,
- "--color-background-ghost": "transparent",
- "--color-background-info": dark ? "#2A1A10" : "#FFEFE6",
- "--color-background-danger": dark ? "#3b0d0d" : "#fde8e8",
- "--color-background-success": dark ? "#0f2d18" : "#dcfce7",
- "--color-background-warning": dark ? "#3a2c00" : "#fef3c7",
- "--color-background-disabled": c.raised,
- "--color-text-primary": c.ink,
- "--color-text-secondary": c.inkSoft,
- "--color-text-tertiary": c.inkMute,
- "--color-text-inverse": c.bg,
- "--color-text-ghost": c.inkMute,
- "--color-text-info": ACCENT,
- "--color-text-danger": DANGER,
- "--color-text-success": OK,
- "--color-text-warning": WARN,
- "--color-text-disabled": c.inkMute,
- "--color-border-primary": c.line,
- "--color-border-secondary": c.lineSoft,
- "--color-border-tertiary": c.lineSoft,
- "--color-border-inverse": c.ink,
- "--color-border-ghost": "transparent",
- "--color-border-info": ACCENT,
- "--color-border-danger": DANGER,
- "--color-border-success": OK,
- "--color-border-warning": WARN,
- "--color-border-disabled": c.lineSoft,
- "--color-ring-primary": ACCENT,
- "--color-ring-secondary": c.line,
- "--color-ring-inverse": c.bg,
- "--color-ring-info": ACCENT,
- "--color-ring-danger": DANGER,
- "--color-ring-success": OK,
- "--color-ring-warning": WARN,
- "--font-sans": "-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
- "--font-mono": "ui-monospace, 'JetBrains Mono', 'SF Mono', monospace",
- "--font-weight-normal": "400",
- "--font-weight-medium": "500",
- "--font-weight-semibold": "600",
- "--font-weight-bold": "700",
- "--font-text-xs-size": "12px",
- "--font-text-sm-size": "14px",
- "--font-text-md-size": "16px",
- "--font-text-lg-size": "18px",
- "--font-heading-xs-size": "18px",
- "--font-heading-sm-size": "20px",
- "--font-heading-md-size": "24px",
- "--font-heading-lg-size": "28px",
- "--font-heading-xl-size": "32px",
- "--font-heading-2xl-size": "48px",
- "--font-heading-3xl-size": "60px",
- "--font-text-xs-line-height": "1.5",
- "--font-text-sm-line-height": "1.5",
- "--font-text-md-line-height": "1.5",
- "--font-text-lg-line-height": "1.5",
- "--font-heading-xs-line-height": "1.3",
- "--font-heading-sm-line-height": "1.3",
- "--font-heading-md-line-height": "1.25",
- "--font-heading-lg-line-height": "1.25",
- "--font-heading-xl-line-height": "1.2",
- "--font-heading-2xl-line-height": "1.2",
- "--font-heading-3xl-line-height": "1.1",
- "--border-radius-xs": "4px",
- "--border-radius-sm": "8px",
- "--border-radius-md": "12px",
- "--border-radius-lg": "16px",
- "--border-radius-xl": "24px",
- "--border-radius-full": "9999px",
- "--border-width-regular": "1px",
- "--shadow-hairline": `0 0 0 1px ${c.line}`,
- "--shadow-sm": "0 1px 2px rgba(0,0,0,0.05)",
- "--shadow-md": "0 4px 6px -1px rgba(0,0,0,0.1)",
- "--shadow-lg": "0 10px 15px -3px rgba(0,0,0,0.1)",
- };
- return { variables: variables as unknown as McpUiStyles, css: { fonts: "" } };
-}
diff --git a/products/desktop/apps/mobilehog/src/lib/mcp/useAppBridge.ts b/products/desktop/apps/mobilehog/src/lib/mcp/useAppBridge.ts
deleted file mode 100644
index 514afd4af335..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/mcp/useAppBridge.ts
+++ /dev/null
@@ -1,212 +0,0 @@
-import {
- AppBridge,
- type McpUiDisplayMode,
- type McpUiHostCapabilities,
- type McpUiHostContext,
- type McpUiResourceCsp,
-} from "@modelcontextprotocol/ext-apps/app-bridge";
-import type { CallToolResult, Tool } from "@modelcontextprotocol/sdk/types.js";
-import { applyCspToHtml } from "@posthog/core/mcp-apps/csp";
-import { isSafeExternalUrl } from "@posthog/shared";
-import * as WebBrowser from "expo-web-browser";
-import {
- useCallback,
- useEffect,
- useLayoutEffect,
- useRef,
- useState,
-} from "react";
-import { Platform } from "react-native";
-import type { EdgeInsets } from "react-native-safe-area-context";
-import type WebView from "react-native-webview";
-import { callMcpTool, listMcpTools, readMcpResource } from "@/lib/mcp/client";
-import { buildHostStyles } from "@/lib/mcp/theme";
-import { WebViewTransport } from "@/lib/mcp/webViewTransport";
-
-export type Phase = "loading" | "proxy-ready" | "initialized" | "error";
-
-export interface UiResource {
- uri: string;
- html: string;
- csp?: McpUiResourceCsp;
- permissions?: Record<string, Record<string, unknown>>;
-}
-
-interface Args {
- webViewRef: { current: WebView | null };
- resource: UiResource | null | undefined;
- tool: Tool | null | undefined;
- toolInput: Record<string, unknown> | undefined;
- toolResult: CallToolResult | null;
- dark: boolean;
- displayMode: McpUiDisplayMode;
- width: number;
- insets: EdgeInsets;
- onPhase: (phase: Phase) => void;
- onHeight: (height: number) => void;
- onDisplayMode: (mode: McpUiDisplayMode) => void;
-}
-
-const HOST_INFO = { name: "mobilehog", version: "1.0.0" };
-const CAPABILITIES: McpUiHostCapabilities = {
- openLinks: {},
- serverTools: {},
- serverResources: {},
- logging: {},
- message: { text: {} },
- sandbox: {},
-};
-
-function hostContext(args: Args): McpUiHostContext {
- const styles = buildHostStyles(args.dark);
- return {
- theme: args.dark ? "dark" : "light",
- styles,
- availableDisplayModes: ["inline", "fullscreen"],
- displayMode: args.displayMode,
- containerDimensions: { width: args.width, height: 320 },
- locale: "en-US",
- timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
- userAgent: `mobilehog/${Platform.OS}`,
- platform: "mobile",
- deviceCapabilities: { touch: true, hover: false },
- safeAreaInsets: args.insets,
- ...(args.tool ? { toolInfo: { tool: args.tool } } : {}),
- };
-}
-
-// The transcript picks which app mounts, and a shared task's transcript can
-// come from another person, so an app may only call tools that declare a UI
-// and allow app calls (the same rule as the desktop MCP apps service).
-async function isAppCallable(name: string): Promise<boolean> {
- if (name === "exec") return false;
- const tool = (await listMcpTools()).find((item) => item.name === name);
- const ui = (
- tool?._meta as
- | { ui?: { resourceUri?: unknown; visibility?: unknown } }
- | undefined
- )?.ui;
- if (typeof ui?.resourceUri !== "string") return false;
- return !Array.isArray(ui.visibility) || ui.visibility.includes("app");
-}
-
-// One ext-apps AppBridge bound to a WebView: the proxy page relays JSON-RPC to
-// the sandboxed app, and tool or resource calls round-trip to the MCP server.
-export function useAppBridge(args: Args): {
- onWebViewMessage: (payload: string) => void;
-} {
- const transportRef = useRef<WebViewTransport | null>(null);
- const bridgeRef = useRef<AppBridge | null>(null);
- const latest = useRef(args);
- useLayoutEffect(() => {
- latest.current = args;
- });
- const [proxyGeneration, setProxyGeneration] = useState(0);
-
- const { webViewRef, resource } = args;
- useEffect(() => {
- if (!resource || proxyGeneration === 0) return;
- let gone = false;
-
- const transport = new WebViewTransport(webViewRef);
- const bridge = new AppBridge(null, HOST_INFO, CAPABILITIES, {
- hostContext: hostContext(latest.current),
- });
- transportRef.current = transport;
- bridgeRef.current = bridge;
-
- const setup = async () => {
- latest.current.onPhase("proxy-ready");
- bridge.oncalltool = async (params) => {
- if (!(await isAppCallable(params.name))) {
- return {
- content: [
- {
- type: "text",
- text: `Tool "${params.name}" is not accessible to apps`,
- },
- ],
- isError: true,
- };
- }
- return callMcpTool(params.name, params.arguments);
- };
- bridge.onreadresource = (params) => readMcpResource(params.uri);
- bridge.onopenlink = async (params) => {
- if (isSafeExternalUrl(params.url)) {
- await WebBrowser.openBrowserAsync(params.url);
- }
- return {};
- };
- bridge.onmessage = async () => ({});
- bridge.onrequestdisplaymode = async (params) => {
- if (params.mode === "inline" || params.mode === "fullscreen") {
- latest.current.onDisplayMode(params.mode);
- return { mode: params.mode };
- }
- return { mode: latest.current.displayMode };
- };
- bridge.onsizechange = (params) => {
- if (typeof params.height === "number" && params.height > 0) {
- latest.current.onHeight(params.height);
- }
- };
- bridge.oninitialized = () => {
- if (gone) return;
- latest.current.onPhase("initialized");
- if (latest.current.toolInput) {
- bridge.sendToolInput({ arguments: latest.current.toolInput });
- }
- if (latest.current.toolResult) {
- bridge.sendToolResult(latest.current.toolResult);
- }
- };
- await bridge.connect(transport);
- if (gone) return;
- await bridge.sendSandboxResourceReady({
- html: applyCspToHtml(resource.html, resource.csp),
- csp: resource.csp,
- permissions: resource.permissions,
- });
- };
-
- setup().catch(() => {
- if (!gone) latest.current.onPhase("error");
- });
-
- return () => {
- gone = true;
- bridge.close().catch(() => {});
- transport.close().catch(() => {});
- bridgeRef.current = null;
- transportRef.current = null;
- };
- }, [resource, webViewRef, proxyGeneration]);
-
- // Theme, size and display mode changes flow to a live app.
- useEffect(() => {
- const bridge = bridgeRef.current;
- if (!bridge) return;
- bridge.sendHostContextChange({
- theme: args.dark ? "dark" : "light",
- styles: buildHostStyles(args.dark),
- displayMode: args.displayMode,
- containerDimensions: { width: args.width, height: 320 },
- safeAreaInsets: args.insets,
- });
- }, [args.dark, args.displayMode, args.width, args.insets]);
-
- const onWebViewMessage = useCallback((payload: string) => {
- try {
- if (
- JSON.parse(payload)?.method === "ui/notifications/sandbox-proxy-ready"
- ) {
- setProxyGeneration((generation) => generation + 1);
- return;
- }
- } catch {}
- transportRef.current?.acceptIncoming(payload);
- }, []);
-
- return { onWebViewMessage };
-}
diff --git a/products/desktop/apps/mobilehog/src/lib/mcp/webViewTransport.ts b/products/desktop/apps/mobilehog/src/lib/mcp/webViewTransport.ts
deleted file mode 100644
index 949fcce2c9c1..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/mcp/webViewTransport.ts
+++ /dev/null
@@ -1,79 +0,0 @@
-import type { Transport } from "@modelcontextprotocol/sdk/shared/transport.js";
-import type { JSONRPCMessage } from "@modelcontextprotocol/sdk/types.js";
-import type WebView from "react-native-webview";
-
-/**
- * MCP `Transport` implementation that bridges JSON-RPC messages between the
- * RN host and a `react-native-webview`-hosted sandbox proxy.
- *
- * Inbound (WebView → RN): the caller hands us messages via `acceptIncoming`
- * (typically called from the WebView's `onMessage` prop).
- * Outbound (RN → WebView): `send` injects a tiny JS snippet that invokes the
- * sandbox proxy's `window.__mcpReceive` entry point.
- *
- * The transport never validates origin (there isn't a meaningful one inside a
- * WebView) — the host MUST only inject HTML it trusts via `WebView`'s
- * `source`. Since the sandbox proxy HTML is hard-coded in
- * `sandboxProxyHtml.ts` and the inner iframe's content comes from a UI
- * resource the user has already chosen to install, that boundary is fine.
- */
-export class WebViewTransport implements Transport {
- private webViewRef: { current: WebView | null };
- private started = false;
- private closed = false;
-
- onmessage?: (message: JSONRPCMessage) => void;
- onerror?: (error: Error) => void;
- onclose?: () => void;
- // Required by Transport; we honour it but the protocol version is not
- // meaningful at the WebView boundary.
- setProtocolVersion?: (version: string) => void;
-
- constructor(webViewRef: { current: WebView | null }) {
- this.webViewRef = webViewRef;
- }
-
- async start(): Promise<void> {
- this.started = true;
- }
-
- /**
- * Forward a JSON-RPC message from the host to the WebView. Idempotent and
- * safe to call before `start()` — `injectJavaScript` will just no-op until
- * the WebView is mounted.
- */
- async send(message: JSONRPCMessage): Promise<void> {
- if (this.closed) throw new Error("Transport closed");
- const webView = this.webViewRef.current;
- if (!webView) return;
- const payload = JSON.stringify(JSON.stringify(message));
- const snippet = `void (window.__mcpReceive && window.__mcpReceive(${payload}));`;
- webView.injectJavaScript(snippet);
- }
-
- /**
- * Called from the WebView's `onMessage` handler with the raw JSON payload
- * the sandbox proxy posted. Parses, validates shape, and dispatches.
- */
- acceptIncoming(payload: string): void {
- if (this.closed) return;
- if (!this.started) return;
- let message: unknown;
- try {
- message = JSON.parse(payload);
- } catch (err) {
- this.onerror?.(
- err instanceof Error ? err : new Error("Invalid JSON from WebView"),
- );
- return;
- }
- if (!message || typeof message !== "object") return;
- this.onmessage?.(message as JSONRPCMessage);
- }
-
- async close(): Promise<void> {
- if (this.closed) return;
- this.closed = true;
- this.onclose?.();
- }
-}
diff --git a/products/desktop/apps/mobilehog/src/lib/mermaid.test.ts b/products/desktop/apps/mobilehog/src/lib/mermaid.test.ts
deleted file mode 100644
index b7528d2ca9b6..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/mermaid.test.ts
+++ /dev/null
@@ -1,145 +0,0 @@
-import { readFileSync } from "node:fs";
-import { createRequire } from "node:module";
-import { runInNewContext } from "node:vm";
-import { describe, expect, it } from "vitest";
-import {
- type DiagramSize,
- hasRemoteImageNode,
- inlineScriptSource,
- isClosedFence,
- isMermaidLang,
- mermaidHtml,
- parseMermaidMessage,
- rememberSize,
-} from "./mermaid";
-
-describe("isMermaidLang", () => {
- it.each([
- ["mermaid", true],
- ["Mermaid", true],
- ["mermaid title", true],
- ["mermaidjs", false],
- ["ts", false],
- [undefined, false],
- ])("%s -> %s", (lang, expected) => {
- expect(isMermaidLang(lang)).toBe(expected);
- });
-});
-
-describe("isClosedFence", () => {
- it.each([
- ["```mermaid\ngraph TD\n```", true],
- ["```mermaid\ngraph TD\n```\n\n", true],
- ["~~~mermaid\ngraph TD\n~~~", true],
- ["````mermaid\ngraph TD\n````", true],
- ["```mermaid\ngraph TD\n A-->B", false],
- ["```mermaid\ngraph TD\n~~~", false],
- ["````mermaid\ngraph TD\n```", false],
- ["```mermaid", false],
- ])("%j -> %s", (raw, expected) => {
- expect(isClosedFence(raw)).toBe(expected);
- });
-});
-
-describe("hasRemoteImageNode", () => {
- it.each([
- ['flowchart TD\n A@{ img: "https://example.com/a.png" }', true],
- ["flowchart TD\n A@{ IMG: 'https://example.com/a.png' }", true],
- ["flowchart TD\n A@{ label: x, img: //example.com/a.png }", true],
- ['flowchart TD\n A@{ img: "data:image/png;base64,AAAA" }', false],
- ["flowchart TD\n A[img] --> B", false],
- ])("%j -> %s", (code, expected) => {
- expect(hasRemoteImageNode(code)).toBe(expected);
- });
-});
-
-describe("parseMermaidMessage", () => {
- it.each([
- [
- '{"type":"size","width":120,"height":80}',
- { type: "size", width: 120, height: 80 },
- ],
- ['{"type":"error"}', { type: "error" }],
- ['{"type":"size","width":0,"height":80}', null],
- ['{"type":"size","width":"120","height":80}', null],
- ["not json", null],
- ["null", null],
- ])("%s", (data, expected) => {
- expect(parseMermaidMessage(data)).toEqual(expected);
- });
-});
-
-describe("mermaidHtml", () => {
- it("keeps diagram text from closing the script tag", () => {
- const html = mermaidHtml(
- 'graph TD\n A["</script><img src=x>"]',
- false,
- "",
- );
- expect(html.match(/<\/script>/g)).toHaveLength(2);
- expect(html).toContain("\\u003c/script>\\u003cimg src=x>");
- });
-
- it("uses strict security and follows the color scheme", () => {
- expect(mermaidHtml("graph TD", true, "")).toContain('"theme":"dark"');
- expect(mermaidHtml("graph TD", false, "")).toContain('"theme":"default"');
- expect(mermaidHtml("graph TD", false, "")).toContain(
- '"securityLevel":"strict"',
- );
- });
-
- it("blocks every network fetch", () => {
- expect(mermaidHtml("graph TD", false, "")).toContain("default-src 'none'");
- });
-
- it("loads the bundle in a page script before the render script", () => {
- const html = mermaidHtml("graph TD", false, "window.mermaid = {};");
- expect(html).toContain("<script>window.mermaid = {};</script>");
- expect(html.indexOf("window.mermaid = {};")).toBeLessThan(
- html.indexOf("mermaid.initialize"),
- );
- });
-});
-
-describe("inlineScriptSource", () => {
- it("escapes sequences that end or nest a script tag", () => {
- const source = 'a="</script>";b=/<!--/;c="<SCRIPT>";d="a<b"';
- const escaped = inlineScriptSource(source);
- expect(escaped).not.toMatch(/<\/?script|<!--/i);
- expect(escaped).toContain('d="a<b"');
- const context = runInNewContext(
- `${escaped};({ a, b: b.test("<!--"), c, d })`,
- );
- expect(context).toEqual({
- a: "</script>",
- b: true,
- c: "<SCRIPT>",
- d: "a<b",
- });
- });
-
- it("keeps the real bundle runnable as a page script", () => {
- const path = createRequire(import.meta.url).resolve(
- "mermaid/dist/mermaid.min.js",
- );
- const source = inlineScriptSource(readFileSync(path, "utf8"));
- expect(source).not.toMatch(/<\/script/i);
- const context: Record<string, unknown> = {};
- runInNewContext(source, context);
- expect(context.mermaid).toBeDefined();
- });
-});
-
-describe("rememberSize", () => {
- const size = (width: number): DiagramSize => ({ width, height: 10 });
-
- it("drops the least recently stored entries over the limit", () => {
- const cache = new Map<string, DiagramSize>();
- rememberSize(cache, "a", size(1), 2);
- rememberSize(cache, "b", size(2), 2);
- rememberSize(cache, "a", size(3), 2);
- rememberSize(cache, "c", size(4), 2);
- expect([...cache.keys()]).toEqual(["a", "c"]);
- expect(cache.get("a")).toEqual(size(3));
- });
-});
diff --git a/products/desktop/apps/mobilehog/src/lib/mermaid.ts b/products/desktop/apps/mobilehog/src/lib/mermaid.ts
deleted file mode 100644
index 8ac6b745544f..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/mermaid.ts
+++ /dev/null
@@ -1,154 +0,0 @@
-const MERMAID_LANGUAGE = "mermaid";
-
-export function isMermaidLang(lang: string | undefined): boolean {
- return lang?.trim().split(/\s+/)[0].toLowerCase() === MERMAID_LANGUAGE;
-}
-
-// A fence without its closing line is still streaming; rendering each partial
-// diagram would reload the WebView on every token.
-export function isClosedFence(raw: string): boolean {
- const open = /^ {0,3}(`{3,}|~{3,})/.exec(raw);
- if (!open) return false;
- const fence = open[1];
- const lines = raw.trimEnd().split("\n");
- if (lines.length < 2) return false;
- const last = lines[lines.length - 1].trim();
- return (
- last.length >= fence.length &&
- /^(`+|~+)$/.test(last) &&
- last[0] === fence[0]
- );
-}
-
-// The `img` key of a shape metadata block, as in `A@{ img: "…" }`. Mermaid reads the key
-// case sensitively today, but matching either case keeps the guard off that detail.
-const IMAGE_NODE =
- /(?:^|[,{\s])["']?img["']?\s*:\s*(?<url>"[^"]*"|'[^']*'|[^,}\n]*)/gi;
-
-// Mermaid loads an image node through `new Image()` while it builds the SVG, before
-// DOMPurify ever sees the output. Diagrams reach us from agent output, so a remote
-// image node would let their author make the app fetch any URL.
-export function hasRemoteImageNode(code: string): boolean {
- for (const node of code.matchAll(IMAGE_NODE)) {
- const url = node.groups?.url?.trim() ?? "";
- if (!/^["']?data:/i.test(url)) return true;
- }
- return false;
-}
-
-export interface DiagramSize {
- width: number;
- height: number;
-}
-
-export type MermaidMessage =
- | ({ type: "size" } & DiagramSize)
- | { type: "error" };
-
-export function parseMermaidMessage(data: string): MermaidMessage | null {
- let message: unknown;
- try {
- message = JSON.parse(data);
- } catch {
- return null;
- }
- if (typeof message !== "object" || message === null) return null;
- const { type, width, height } = message as Record<string, unknown>;
- if (type === "error") return { type };
- if (
- type === "size" &&
- typeof width === "number" &&
- typeof height === "number" &&
- width > 0 &&
- height > 0
- ) {
- return { type, width, height };
- }
- return null;
-}
-
-export function rememberSize(
- cache: Map<string, DiagramSize>,
- key: string,
- size: DiagramSize,
- limit: number,
-): void {
- cache.delete(key);
- cache.set(key, size);
- for (const oldest of cache.keys()) {
- if (cache.size <= limit) break;
- cache.delete(oldest);
- }
-}
-
-// Embeds a value in an inline script without letting it close the tag.
-function scriptLiteral(value: unknown): string {
- return JSON.stringify(value).replace(/</g, "\\u003c");
-}
-
-// Keeps a script source from ending its tag early. The escape only appears in
-// strings, regexes and comments, where it still reads as "<".
-export function inlineScriptSource(source: string): string {
- return source.replace(/<(?=!--|\/?script)/gi, "\\x3C");
-}
-
-// The bundle loads in its own script tag before the render script. Injected
-// JavaScript runs inside a function on Android, where the bundle's top-level
-// `var` does not become a global, and it may run after the page scripts. The
-// policy blocks every network fetch, so the SVG can only use what it carries.
-export function mermaidHtml(
- code: string,
- dark: boolean,
- bundle: string,
-): string {
- const config = {
- startOnLoad: false,
- theme: dark ? "dark" : "default",
- securityLevel: "strict",
- suppressErrorRendering: true,
- fontFamily: "-apple-system, system-ui, sans-serif",
- };
- return `<!DOCTYPE html>
-<html>
-<head>
-<meta charset="utf-8">
-<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
-<meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'unsafe-inline'; style-src 'unsafe-inline'; img-src data:; font-src data:">
-<style>html, body { margin: 0; padding: 0; background: transparent; overflow: hidden; } svg { display: block; }</style>
-</head>
-<body>
-<div id="root"></div>
-<script>${bundle}</script>
-<script>
-(function () {
- function post(message) {
- window.ReactNativeWebView.postMessage(JSON.stringify(message));
- }
- function fail() {
- post({ type: "error" });
- }
- if (!window.mermaid) return fail();
- try {
- mermaid.initialize(${scriptLiteral(config)});
- mermaid.render("diagram", ${scriptLiteral(code)}).then(function (result) {
- var root = document.getElementById("root");
- root.innerHTML = result.svg;
- var svg = root.querySelector("svg");
- if (!svg) return fail();
- var box = svg.viewBox && svg.viewBox.baseVal;
- var rect = svg.getBoundingClientRect();
- var width = Math.ceil(box && box.width ? box.width : rect.width);
- var height = Math.ceil(box && box.height ? box.height : rect.height);
- svg.style.maxWidth = "none";
- svg.setAttribute("width", String(width));
- svg.setAttribute("height", String(height));
- post({ type: "size", width: width, height: height });
- }, fail);
- } catch (error) {
- fail();
- }
-})();
-</script>
-</body>
-</html>`;
-}
diff --git a/products/desktop/apps/mobilehog/src/lib/models.ts b/products/desktop/apps/mobilehog/src/lib/models.ts
deleted file mode 100644
index 33a30984119e..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/models.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-const BRANDS = new Set(["claude", "gemini", "anthropic", "openai"]);
-const ACRONYMS = new Set(["gpt", "o"]);
-
-// "claude-opus-5-5" reads as "Opus 5.5": no brand, version digits joined.
-export function shortModelName(id: string): string {
- const parts = (id.split("/").pop() ?? id).split("-");
- // Keep the brand when it is the only name, as in "gemini-3-pro".
- const dropBrand = BRANDS.has(parts[0]) && /^[a-z]/.test(parts[1] ?? "");
- const words = parts
- .slice(dropBrand ? 1 : 0)
- .filter((part) => !/^\d{8}$/.test(part));
- const out: string[] = [];
- for (const word of words) {
- const previous = out[out.length - 1];
- if (/^\d+$/.test(word) && previous && /^\d+(\.\d+)*$/.test(previous)) {
- out[out.length - 1] = `${previous}.${word}`;
- } else if (ACRONYMS.has(word)) {
- out.push(word.toUpperCase());
- } else {
- out.push(word.charAt(0).toUpperCase() + word.slice(1));
- }
- }
- return out.join(" ");
-}
diff --git a/products/desktop/apps/mobilehog/src/lib/network.ts b/products/desktop/apps/mobilehog/src/lib/network.ts
deleted file mode 100644
index 71cf8cf50eb9..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/network.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import { onlineManager } from "@tanstack/react-query";
-import * as Network from "expo-network";
-import { create } from "zustand";
-import { useSessions } from "@/lib/session";
-
-export const useOnline = create<{ online: boolean }>(() => ({ online: true }));
-
-// Queries pause instead of failing while offline, and live chats reconnect after.
-onlineManager.setEventListener((setOnline) => {
- const update = (state: Network.NetworkState): void => {
- const online =
- state.isConnected !== false && state.isInternetReachable !== false;
- if (online && !useOnline.getState().online) {
- useSessions.getState().reconnect();
- }
- useOnline.setState({ online });
- setOnline(online);
- };
- Network.getNetworkStateAsync()
- .then(update)
- .catch(() => {});
- const subscription = Network.addNetworkStateListener(update);
- return () => subscription.remove();
-});
diff --git a/products/desktop/apps/mobilehog/src/lib/notifications.ts b/products/desktop/apps/mobilehog/src/lib/notifications.ts
deleted file mode 100644
index 0395be811687..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/notifications.ts
+++ /dev/null
@@ -1,154 +0,0 @@
-import Constants from "expo-constants";
-import * as Notifications from "expo-notifications";
-import { useRouter } from "expo-router";
-import { useEffect } from "react";
-import { AppState, Platform } from "react-native";
-import { authedFetch, getBaseUrl } from "@/lib/api";
-import { sessionIdentity, useAuth } from "@/lib/auth";
-import { logger } from "@/lib/logger";
-
-const log = logger.scope("notifications");
-
-Notifications.setNotificationHandler({
- handleNotification: async () => ({
- shouldShowBanner: true,
- shouldShowList: true,
- shouldPlaySound: true,
- shouldSetBadge: false,
- }),
-});
-
-// The server sends `{ url: "posthog://task/<id>" }` or a legacy `{ taskId }`.
-function pathFromNotification(
- notification: Notifications.Notification,
-): string | null {
- const data = notification.request.content.data as Record<string, unknown>;
- if (typeof data.url === "string") {
- return data.url.replace(/^[a-z]+:\/\//, "/").replace(/^\/\/+/, "/");
- }
- if (typeof data.taskId === "string") return `/task/${data.taskId}`;
- return null;
-}
-
-async function fetchPushToken(): Promise<string | null> {
- const projectId =
- Constants.easConfig?.projectId ??
- Constants.expoConfig?.extra?.eas?.projectId;
- if (Platform.OS === "web" || !projectId) {
- if (Platform.OS !== "web")
- log.warn("Push registration unavailable: missing Expo project ID");
- return null;
- }
- const { status } = await Notifications.getPermissionsAsync();
- const granted =
- status === "granted" ||
- (await Notifications.requestPermissionsAsync()).status === "granted";
- if (!granted) {
- return null;
- }
- return (await Notifications.getExpoPushTokenAsync({ projectId })).data;
-}
-
-let registeredToken: string | null = null;
-let pendingRegistration: { identity: string; promise: Promise<void> } | null =
- null;
-
-export function registerPushToken(): Promise<void> {
- if (!useAuth.getState().session) return Promise.resolve();
- const identity = sessionIdentity();
- if (pendingRegistration?.identity === identity)
- return pendingRegistration.promise;
- const promise = (async () => {
- try {
- const token = await fetchPushToken();
- if (sessionIdentity() !== identity || !token) return;
- const response = await authedFetch(
- `${getBaseUrl()}/api/users/@me/push_tokens/`,
- {
- method: "POST",
- body: JSON.stringify({ token, platform: Platform.OS }),
- },
- );
- if (sessionIdentity() !== identity) return;
- if (!response.ok) {
- log.warn("Push token registration failed", response.status);
- return;
- }
- registeredToken = token;
- } catch {
- if (sessionIdentity() === identity)
- log.warn("Push registration failed on this device");
- }
- })().finally(() => {
- if (pendingRegistration?.promise === promise) pendingRegistration = null;
- });
- pendingRegistration = { identity, promise };
- return promise;
-}
-
-// After a restart the in-memory token is gone, but the server can still hold
-// this device's registration, so read the token again without prompting.
-async function currentDeviceToken(): Promise<string | null> {
- if (registeredToken) return registeredToken;
- const projectId =
- Constants.easConfig?.projectId ??
- Constants.expoConfig?.extra?.eas?.projectId;
- if (Platform.OS === "web" || !projectId) return null;
- const { status } = await Notifications.getPermissionsAsync();
- if (status !== "granted") return null;
- return (await Notifications.getExpoPushTokenAsync({ projectId })).data;
-}
-
-// Returns false when the server may still send this account's notifications
-// to the device, so the caller can offer a retry before signing out.
-export async function unregisterPushToken(): Promise<boolean> {
- await pendingRegistration?.promise;
- try {
- const token = await currentDeviceToken();
- if (!token) return true;
- const response = await authedFetch(
- `${getBaseUrl()}/api/users/@me/push_tokens/unregister/`,
- {
- method: "POST",
- headers: { "Content-Type": "application/json" },
- body: JSON.stringify({ token }),
- },
- );
- if (!response.ok) {
- log.warn("Push token removal failed", response.status);
- return false;
- }
- registeredToken = null;
- return true;
- } catch {
- log.warn("Push token removal failed on this device");
- return false;
- }
-}
-
-// Registers the device once a session exists and routes notification taps.
-export function usePushNotifications(): void {
- const session = useAuth((s) => s.session);
- const router = useRouter();
-
- useEffect(() => {
- if (!session) return;
- void registerPushToken();
- const subscription = AppState.addEventListener("change", (state) => {
- if (state === "active") void registerPushToken();
- });
- return () => subscription.remove();
- }, [session]);
-
- useEffect(() => {
- const open = (response: Notifications.NotificationResponse): void => {
- const path = pathFromNotification(response.notification);
- if (path) router.push(path as never);
- };
- Notifications.getLastNotificationResponseAsync().then((response) => {
- if (response) open(response);
- });
- const sub = Notifications.addNotificationResponseReceivedListener(open);
- return () => sub.remove();
- }, [router]);
-}
diff --git a/products/desktop/apps/mobilehog/src/lib/oauth.ts b/products/desktop/apps/mobilehog/src/lib/oauth.ts
deleted file mode 100644
index 7ea3bc4fdc5e..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/oauth.ts
+++ /dev/null
@@ -1,113 +0,0 @@
-import * as AuthSession from "expo-auth-session";
-import * as WebBrowser from "expo-web-browser";
-
-WebBrowser.maybeCompleteAuthSession();
-
-export type CloudRegion = "us" | "eu";
-
-// v1 mobile's public OAuth clients, registered for the posthog://callback scheme.
-const CLIENT_IDS: Record<CloudRegion, string> = {
- us: "a5TY7w9IjFYfes6dkPgZe6envclWw3bm2UD8ZTlm",
- eu: "1A7vO138Fh5sYmJislicN4F5HnttI6urmFttxPDU",
-};
-
-export const CLOUD_HOSTS: Record<CloudRegion, string> = {
- us: "https://us.posthog.com",
- eu: "https://eu.posthog.com",
-};
-
-const SCOPES = [
- "user:read",
- "user:write",
- "project:read",
- "organization:read",
- "organization:write",
- "task:write",
- "integration:read",
- "conversation:write",
- "insight:read",
- "query:read",
- "llm_skill:read",
-];
-
-export const OAUTH_SCOPE_VERSION = 1;
-
-export interface OAuthTokens {
- access_token: string;
- expires_in: number;
- refresh_token: string;
- scoped_teams?: number[];
-}
-
-function redirectUri(): string {
- return AuthSession.makeRedirectUri({ scheme: "posthog", path: "callback" });
-}
-
-async function tokenRequest(
- region: CloudRegion,
- body: Record<string, string>,
-): Promise<OAuthTokens> {
- const response = await fetch(`${CLOUD_HOSTS[region]}/oauth/token`, {
- method: "POST",
- headers: { "Content-Type": "application/json" },
- body: JSON.stringify({ ...body, client_id: CLIENT_IDS[region] }),
- });
- if (!response.ok) {
- throw new Error(
- `Token request failed (${response.status}): ${await response.text()}`,
- );
- }
- return (await response.json()) as OAuthTokens;
-}
-
-export interface SignInOptions {
- // Open account creation first; the browser lands on the authorize page
- // afterwards, so a new user ends up signed in to the app.
- signup?: boolean;
-}
-
-export async function signInWithOAuth(
- region: CloudRegion,
- { signup = false }: SignInOptions = {},
-): Promise<OAuthTokens> {
- const host = CLOUD_HOSTS[region];
- const request = new AuthSession.AuthRequest({
- clientId: CLIENT_IDS[region],
- scopes: SCOPES,
- redirectUri: redirectUri(),
- usePKCE: true,
- extraParams: { required_access_level: "project" },
- });
- const discovery = { authorizationEndpoint: `${host}/oauth/authorize` };
- const authUrl = await request.makeAuthUrlAsync(discovery);
- const next = encodeURIComponent(authUrl.slice(host.length));
- const result = await request.promptAsync(discovery, {
- url: signup ? `${host}/signup?next=${next}` : authUrl,
- // Let users choose an account without reusing Safari's signed-in account.
- preferEphemeralSession: true,
- });
- if (result.type !== "success" || !result.params.code) {
- throw new Error(
- result.type === "error"
- ? (result.error?.message ?? "Authorization failed")
- : "Sign in was cancelled",
- );
- }
- if (!request.codeVerifier) throw new Error("PKCE verifier missing");
- return tokenRequest(region, {
- grant_type: "authorization_code",
- code: result.params.code,
- redirect_uri: redirectUri(),
- code_verifier: request.codeVerifier,
- });
-}
-
-export function refreshOAuth(
- region: CloudRegion,
- refreshToken: string,
-): Promise<OAuthTokens> {
- return tokenRequest(region, {
- grant_type: "refresh_token",
- refresh_token: refreshToken,
- });
-}
diff --git a/products/desktop/apps/mobilehog/src/lib/objectTags.test.ts b/products/desktop/apps/mobilehog/src/lib/objectTags.test.ts
deleted file mode 100644
index 73f55e7030dc..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/objectTags.test.ts
+++ /dev/null
@@ -1,239 +0,0 @@
-import type { Token } from "marked";
-import { describe, expect, it } from "vitest";
-import { lexMarkdown } from "./markdown";
-import { isObjectTagMarkup, objectWebUrl } from "./objectTags";
-
-// The token tree without raw source, so cases read as structure.
-function shape(text: string): unknown {
- return JSON.parse(
- JSON.stringify(lexMarkdown(text), (key, value) =>
- key === "raw" || key === "escaped" ? undefined : value,
- ),
- );
-}
-
-function inline(text: string): Token[] {
- const [paragraph] = lexMarkdown(text) as { tokens: Token[] }[];
- return paragraph.tokens;
-}
-
-describe("object tags in markdown", () => {
- it("turns an inline tag into a reference with its label", () => {
- expect(
- inline('See <insight id="9pQx3">checkout funnel</insight> now'),
- ).toEqual([
- expect.objectContaining({ type: "text", text: "See " }),
- expect.objectContaining({
- type: "objectRef",
- ref: { kind: "insight", id: "9pQx3", label: "checkout funnel" },
- }),
- expect.objectContaining({ type: "text", text: " now" }),
- ]);
- });
-
- it.each([
- ['<flag id="42"/>', { kind: "flag", id: "42", label: "42" }],
- [
- '<hogql label="errors today">SELECT 1</hogql>',
- { kind: "hogql", id: "SELECT 1", label: "errors today" },
- ],
- [
- '<feature_flag id="7">beta</feature_flag>',
- { kind: "flag", id: "7", label: "beta" },
- ],
- ])("reads %s", (tag, ref) => {
- expect(inline(`x ${tag}`)[1]).toEqual(
- expect.objectContaining({ type: "objectRef", ref }),
- );
- });
-
- it.each([
- ['<gizmo id="1">Gizmo</gizmo>', "Gizmo"],
- ["<insight>Checkout funnel</insight>", "Checkout funnel"],
- ])(
- "renders only the label when %s cannot become a reference",
- (tag, label) => {
- expect(inline(`x ${tag}`)[1]).toEqual(
- expect.objectContaining({ type: "text", text: label }),
- );
- },
- );
-
- it("leaves other html alone", () => {
- expect(inline("x <b>bold</b>")[1]).toEqual(
- expect.objectContaining({ type: "html", text: "<b>" }),
- );
- });
-
- it.each([
- [
- '<insight id="9pQx3" display="block"/>',
- { mode: "insight", shortId: "9pQx3" },
- ],
- [
- '<hogql display="block" title="DAU">SELECT count() FROM events</hogql>',
- { mode: "hogql", query: "SELECT count() FROM events", title: "DAU" },
- ],
- [
- '<hogql display="block" title="DAU">\nSELECT 1\n\nFROM events\n</hogql>',
- { mode: "hogql", query: "SELECT 1\n\nFROM events", title: "DAU" },
- ],
- ])("turns a block tag on its own line into a card: %s", (text, spec) => {
- expect(shape(text)).toEqual([{ type: "objectCard", spec }]);
- });
-
- it("keeps a block tag inside a sentence as a reference", () => {
- expect(inline('Look: <insight id="a" display="block"/>')[1]).toEqual(
- expect.objectContaining({ type: "objectRef" }),
- );
- });
-
- it("starts a standalone card after prose on the previous line", () => {
- expect(shape('Here it is:\n<insight id="abc" display="block"/>')).toEqual([
- expect.objectContaining({ type: "paragraph", text: "Here it is:" }),
- {
- type: "objectCard",
- spec: { mode: "insight", shortId: "abc" },
- },
- ]);
- });
-
- it("renders a block tag of a kind without a card as a reference", () => {
- expect(shape('<dashboard id="7" display="block"/>')).toEqual([
- {
- type: "paragraph",
- text: '<dashboard id="7" display="block"/>',
- tokens: [
- {
- type: "objectRef",
- ref: { kind: "dashboard", id: "7", label: "7" },
- },
- ],
- },
- ]);
- });
-
- it("keeps text indented under a block tag without a card", () => {
- expect(shape('<dashboard id="7" display="block"/>\n text')).toEqual([
- expect.objectContaining({
- type: "paragraph",
- tokens: [
- expect.objectContaining({ type: "objectRef" }),
- expect.objectContaining({ type: "text", text: "\ntext" }),
- ],
- }),
- ]);
- });
-
- it("keeps a code block after a blank line under a block tag", () => {
- const tokens = lexMarkdown(
- '<dashboard id="7" display="block"/>\n\n code',
- );
- expect(tokens.map((token) => token.type)).toEqual([
- "paragraph",
- "space",
- "code",
- ]);
- });
-
- it.each([
- 'See <insight id="9pQx3',
- 'See <insight id="9pQx3"',
- 'See <insight id="9pQx3" title="Check',
- 'See <insight id="9pQx3">chec',
- 'See <insight id="9pQx3">checkout</insi',
- "See <insight",
- ])("hides an unfinished tag: %s", (text) => {
- expect(inline(text)).toEqual([
- expect.objectContaining({ type: "text", text: "See " }),
- expect.objectContaining({ type: "text", text: "" }),
- ]);
- });
-
- it("hides an unfinished block tag through blank lines", () => {
- expect(shape('<hogql display="block">\nSELECT 1\n\nFROM events')).toEqual([
- { type: "html", text: "" },
- ]);
- });
-
- it.each([
- `See <insight${" a= ".repeat(2000)}!`,
- `See <insight${' a="x" '.repeat(2000)}`,
- ])("preserves the source while scanning a large unfinished tag", (text) => {
- expect(
- lexMarkdown(text)
- .map((token) => token.raw)
- .join(""),
- ).toBe(text);
- });
-
- it("does not hide a tag name in prose", () => {
- expect(inline("x <insight, then y")).toEqual([
- expect.objectContaining({ type: "text", text: "x <insight, then y" }),
- ]);
- });
-
- it("does not hide a closed malformed tag or the text after it", () => {
- const tokens = inline("See <insight id=x/> now");
- expect(tokens.map((token) => token.raw).join("")).toBe(
- "See <insight id=x/> now",
- );
- expect(tokens.at(-1)).toEqual(
- expect.objectContaining({ type: "text", text: " now" }),
- );
- });
-
- it("caps the cards in one message and resets for the next", () => {
- const text = Array.from(
- { length: 12 },
- (_, i) => `<insight id="i${i}" display="block"/>`,
- ).join("\n\n");
- const cards = (source: string) =>
- lexMarkdown(source).filter((token) => token.type === "objectCard").length;
- expect(cards(text)).toBe(10);
- expect(cards(text)).toBe(10);
- });
-
- it("keeps tags in code literal", () => {
- expect(
- shape(
- '`<insight id="x"/>`\n\n```\n<insight id="x" display="block"/>\n```',
- ),
- ).toEqual([
- expect.objectContaining({
- type: "paragraph",
- tokens: [{ type: "codespan", text: '<insight id="x"/>' }],
- }),
- { type: "space" },
- { type: "code", lang: "", text: '<insight id="x" display="block"/>' },
- ]);
- });
-});
-
-describe("isObjectTagMarkup", () => {
- it.each([
- ['<insight id="x">', true],
- ["</insight>", true],
- ['<hogql display="block">', true],
- ["<b>", false],
- ["<br/>", false],
- ])("%s -> %s", (html, expected) => {
- expect(isObjectTagMarkup(html)).toBe(expected);
- });
-});
-
-describe("objectWebUrl", () => {
- it.each([
- ["insight", "9pQx3", "https://us.posthog.com/project/2/insights/9pQx3"],
- [
- "hogql",
- "SELECT 1 & 2",
- "https://us.posthog.com/project/2/sql?open_query=SELECT%201%20%26%202",
- ],
- ["flag", "42", "https://us.posthog.com/project/2/feature-flags/42"],
- ["flag", "my-flag", null],
- ["gizmo", "1", null],
- ])("%s %s", (kind, id, expected) => {
- expect(objectWebUrl("https://us.posthog.com/", 2, kind, id)).toBe(expected);
- });
-});
diff --git a/products/desktop/apps/mobilehog/src/lib/objectTags.ts b/products/desktop/apps/mobilehog/src/lib/objectTags.ts
deleted file mode 100644
index 573854b0b80f..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/objectTags.ts
+++ /dev/null
@@ -1,203 +0,0 @@
-import {
- buildObjectTagRef,
- type ObjectTagRef,
- objectWebPath,
- parseObjectTagAttrs,
- resolveObjectKindName,
-} from "@posthog/core/inbox/objectTags";
-import type { Token, TokenizerExtension } from "marked";
-
-// Agents embed PostHog objects in replies as tags, e.g.
-// <insight id="9pQx3">checkout funnel</insight>
-// <insight id="9pQx3" display="block"/>
-// <hogql display="block" title="DAU">SELECT ...</hogql>
-// These marked extensions turn them into chip and card tokens. Code spans and
-// fences are tokenized first, so tags inside them stay literal.
-
-// Each card makes a request on mount; past the cap a block tag becomes a chip.
-const MAX_CARDS = 10;
-
-const TAG_RE =
- /^<([a-z][\w-]*)((?:\s+[a-z][\w-]*\s*=\s*"[^"]*")*)\s*(?:\/>|>([\s\S]*?)<\/\1\s*>)/;
-const BLOCK_TAIL_RE = /^[ \t]*(?:\n+|$)/;
-const BLOCK_TAG_START_RE =
- /(?:^|\n) {0,3}<(?:(?:insight)|(?:hogql))(?=[\s/>])(?=[^>\n]*\sdisplay\s*=\s*"block"(?=\s|\/?>))[^>\n]*\/?>/;
-const OPEN_TAG_RE = /^<([a-z][\w-]*)(?:\s+[a-z][\w-]*\s*=\s*"[^"]*")*\s*>/;
-const TAG_NAME_RE = /^<([a-z][\w-]*)/;
-// One piece of an opening tag that is still streaming. Each piece consumes at
-// least one character and the pieces cannot overlap, so a scan stays linear.
-const PARTIAL_PART_RE = /\s+|[a-z][\w-]*|=|"[^"]*"|"[^"]*$|\/$/y;
-const TAG_START_RE = /<[a-z]/;
-const MARKUP_RE = /^<\/?([a-z][\w-]*)/;
-
-export type ObjectCardSpec =
- | { mode: "insight"; shortId: string; title?: string }
- | { mode: "hogql"; query: string; title?: string };
-
-export interface ObjectCardToken {
- type: "objectCard";
- raw: string;
- spec: ObjectCardSpec;
-}
-
-export interface ObjectRefToken {
- type: "objectRef";
- raw: string;
- ref: ObjectTagRef;
-}
-
-interface MatchedTag {
- raw: string;
- name: string;
- kind: string | null;
- attrs: Record<string, string>;
- body?: string;
-}
-
-function matchTag(src: string): MatchedTag | null {
- const match = TAG_RE.exec(src);
- if (!match) return null;
- return {
- raw: match[0],
- name: match[1],
- kind: resolveObjectKindName(match[1]),
- attrs: parseObjectTagAttrs(match[2]),
- body: match[3],
- };
-}
-
-function cardSpec(tag: MatchedTag): ObjectCardSpec | null {
- if (tag.attrs.display !== "block") return null;
- const title = tag.attrs.title?.trim() || undefined;
- if (tag.kind === "insight") {
- const shortId = tag.attrs.id?.trim();
- return shortId ? { mode: "insight", shortId, title } : null;
- }
- if (tag.kind === "hogql") {
- const query = tag.body?.trim();
- return query ? { mode: "hogql", query, title } : null;
- }
- return null;
-}
-
-// An unknown kind is still an object tag when it carries an id.
-function isObjectTag(tag: MatchedTag): boolean {
- return tag.kind !== null || "id" in tag.attrs;
-}
-
-// Unknown kinds, and known kinds without an id or query, keep only their label.
-function inlineToken(tag: MatchedTag): Token {
- const ref = tag.kind
- ? buildObjectTagRef(tag.kind, tag.attrs, tag.body)
- : null;
- if (ref) return { type: "objectRef", raw: tag.raw, ref } as Token;
- const label = tag.body?.trim() || tag.attrs.label?.trim();
- return { type: "text", raw: tag.raw, text: label ?? "" };
-}
-
-// A known tag that is still streaming has no end yet. It hides up to the end of
-// the text, so neither its markup nor its half-written label shows.
-// The name of a tag whose opening markup runs to the end of the text.
-function partialTagName(src: string): string | null {
- const head = TAG_NAME_RE.exec(src);
- if (!head) return null;
- PARTIAL_PART_RE.lastIndex = head[0].length;
- while (PARTIAL_PART_RE.lastIndex < src.length) {
- if (!PARTIAL_PART_RE.exec(src)) return null;
- }
- return head[1];
-}
-
-function isUnfinishedTag(src: string): boolean {
- const name = OPEN_TAG_RE.exec(src)?.[1] ?? partialTagName(src);
- if (!name || resolveObjectKindName(name) === null) return false;
- return !new RegExp(`</${name}\\s*>`).test(src);
-}
-
-// A fresh set per document, so the card cap counts one message at a time.
-export function objectTagExtensions(): TokenizerExtension[] {
- let cards = 0;
- return [
- {
- name: "objectCard",
- level: "block",
- start(src) {
- const match = BLOCK_TAG_START_RE.exec(src);
- return match ? match.index + match[0].lastIndexOf("<") : undefined;
- },
- tokenizer(src) {
- const indent = /^ {0,3}/.exec(src)?.[0].length ?? 0;
- const source = src.slice(indent);
- const tag = matchTag(source);
- if (!tag) {
- return isUnfinishedTag(source)
- ? { type: "html", raw: src, text: "" }
- : undefined;
- }
- if (!isObjectTag(tag)) return undefined;
- const end = indent + tag.raw.length;
- const tail = BLOCK_TAIL_RE.exec(src.slice(end));
- if (!tail) return undefined;
- const raw = src.slice(0, end + tail[0].length);
- const spec = cardSpec(tag);
- if (spec && cards < MAX_CARDS) {
- cards++;
- return { type: "objectCard", raw, spec };
- }
- // Like a Markdown paragraph, the fallback leaves its line breaks to the
- // lexer, so a blank line still ends it.
- return {
- type: "paragraph",
- raw: src.slice(0, end + tail[0].trimEnd().length),
- text: tag.raw,
- tokens: this.lexer.inline(tag.raw),
- };
- },
- },
- {
- name: "objectRef",
- level: "inline",
- start(src) {
- const index = src.search(TAG_START_RE);
- return index === -1 ? undefined : index;
- },
- tokenizer(src) {
- const tag = matchTag(src);
- if (tag) return isObjectTag(tag) ? inlineToken(tag) : undefined;
- return isUnfinishedTag(src)
- ? { type: "text", raw: src, text: "" }
- : undefined;
- },
- },
- ];
-}
-
-export function isObjectCardToken(
- token: Token,
-): token is Token & ObjectCardToken {
- return token.type === "objectCard";
-}
-
-export function isObjectRefToken(
- token: Token,
-): token is Token & ObjectRefToken {
- return token.type === "objectRef";
-}
-
-// Markup of a known tag that is malformed or still streaming stays hidden.
-export function isObjectTagMarkup(html: string): boolean {
- const match = MARKUP_RE.exec(html.trim());
- return match !== null && resolveObjectKindName(match[1]) !== null;
-}
-
-export function objectWebUrl(
- host: string,
- projectId: number,
- kind: string,
- id: string,
-): string | null {
- const path = objectWebPath(kind, id);
- return path
- ? `${host.replace(/\/+$/, "")}/project/${projectId}${path}`
- : null;
-}
diff --git a/products/desktop/apps/mobilehog/src/lib/openedChats.test.ts b/products/desktop/apps/mobilehog/src/lib/openedChats.test.ts
deleted file mode 100644
index 85d6491fd676..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/openedChats.test.ts
+++ /dev/null
@@ -1,132 +0,0 @@
-import type { Task } from "@posthog/shared/domain-types";
-import { beforeEach, describe, expect, it, vi } from "vitest";
-
-const mocks = vi.hoisted(() => {
- const stores = new Map<string, Map<string, string>>();
- const session = {
- region: "us",
- host: "https://us.posthog.com",
- apiKey: "key",
- projectId: 1,
- projectName: "Project",
- userId: 7,
- userName: "Max",
- };
- const auth = { session: session as typeof session | null };
-
- // One store per account, like accountStore in cache.ts.
- function accountStore({ host, userId }: { host: string; userId: number }) {
- const id = `${host}-${userId}`;
- let data = stores.get(id);
- if (!data) {
- data = new Map();
- stores.set(id, data);
- }
- const values = data;
- return {
- getString: (key: string) => values.get(key),
- set: (key: string, value: string) => values.set(key, value),
- };
- }
-
- return { accountStore, auth, session, stores };
-});
-
-vi.mock("@/lib/cache", () => ({ accountStore: mocks.accountStore }));
-vi.mock("@/lib/auth", () => ({
- useAuth: { getState: () => mocks.auth },
-}));
-
-import { lastOpened, loadOpened, recordOpened } from "./openedChats";
-
-function task(id: string): Task {
- return { id } as Task;
-}
-
-beforeEach(() => {
- mocks.stores.clear();
- mocks.auth.session = { ...mocks.session };
-});
-
-describe("opened chats", () => {
- it("keeps the most recently opened first without duplicates", () => {
- recordOpened("a");
- recordOpened("b");
- recordOpened("a");
-
- expect(loadOpened()).toEqual(["a", "b"]);
- });
-
- it("keeps each project and account separate", () => {
- recordOpened("a");
- mocks.auth.session = { ...mocks.session, projectId: 2 };
- recordOpened("b");
- mocks.auth.session = { ...mocks.session, userId: 8 };
- recordOpened("c");
-
- expect(loadOpened()).toEqual(["c"]);
- mocks.auth.session = { ...mocks.session, projectId: 2 };
- expect(loadOpened()).toEqual(["b"]);
- mocks.auth.session = { ...mocks.session };
- expect(loadOpened()).toEqual(["a"]);
- });
-
- it("drops the oldest past the limit", () => {
- for (let index = 0; index < 60; index++) recordOpened(`task-${index}`);
-
- const opened = loadOpened();
- expect(opened).toHaveLength(50);
- expect(opened[0]).toBe("task-59");
- expect(opened).not.toContain("task-9");
- });
-
- it("does nothing while signed out", () => {
- mocks.auth.session = null;
- recordOpened("a");
- mocks.auth.session = { ...mocks.session };
-
- expect(loadOpened()).toEqual([]);
- });
-});
-
-describe("lastOpened", () => {
- const recent = ["r1", "r2", "r3", "r4"].map(task);
-
- it.each([
- {
- name: "fills with recent tasks after the opened ones",
- opened: ["r3"],
- limit: 3,
- expected: ["r3", "r1", "r2"],
- },
- {
- name: "skips opened ids whose task is gone",
- opened: ["deleted", "r4"],
- limit: 2,
- expected: ["r4", "r1"],
- },
- {
- name: "stops at the limit",
- opened: ["r4", "r3", "r2"],
- limit: 2,
- expected: ["r4", "r3"],
- },
- {
- name: "shows recent tasks when nothing was opened",
- opened: [],
- limit: 8,
- expected: ["r1", "r2", "r3", "r4"],
- },
- {
- name: "finds an opened task outside the recent page",
- opened: ["old", "r2"],
- known: ["old"],
- limit: 3,
- expected: ["old", "r2", "r1"],
- },
- ])("$name", ({ opened, known = [], limit, expected }) => {
- expect(
- lastOpened(opened, recent, known.map(task), limit).map(({ id }) => id),
- ).toEqual(expected);
- });
-});
diff --git a/products/desktop/apps/mobilehog/src/lib/openedChats.ts b/products/desktop/apps/mobilehog/src/lib/openedChats.ts
deleted file mode 100644
index aa4e7e89576d..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/openedChats.ts
+++ /dev/null
@@ -1,63 +0,0 @@
-import type { Task } from "@posthog/shared/domain-types";
-import type { MMKV } from "react-native-mmkv";
-import { useAuth } from "@/lib/auth";
-import { accountStore } from "@/lib/cache";
-
-const OPENED_LIMIT = 50;
-
-function openedScope(): { store: MMKV; key: string } | null {
- const { session } = useAuth.getState();
- if (!session) return null;
- return {
- store: accountStore(session),
- key: `opened-${session.projectId}`,
- };
-}
-
-function readOpened(store: MMKV, key: string): string[] {
- try {
- const order = JSON.parse(store.getString(key) ?? "[]");
- return Array.isArray(order)
- ? order.filter((item): item is string => typeof item === "string")
- : [];
- } catch {
- return [];
- }
-}
-
-export function recordOpened(taskId: string): void {
- const scope = openedScope();
- if (!scope) return;
- const order = [
- taskId,
- ...readOpened(scope.store, scope.key).filter((id) => id !== taskId),
- ];
- scope.store.set(scope.key, JSON.stringify(order.slice(0, OPENED_LIMIT)));
-}
-
-// Task ids opened on this device, most recent first.
-export function loadOpened(): string[] {
- const scope = openedScope();
- return scope ? readOpened(scope.store, scope.key) : [];
-}
-
-// `known` holds opened tasks fetched outside the recent page. Opened ids with
-// no task are skipped, and recent tasks fill the rest so a fresh install still
-// shows something.
-export function lastOpened(
- opened: string[],
- recent: Task[],
- known: Task[],
- limit: number,
-): Task[] {
- const byId = new Map([...recent, ...known].map((task) => [task.id, task]));
- const picked = new Map<string, Task>();
- for (const task of [
- ...opened.flatMap((id) => byId.get(id) ?? []),
- ...recent,
- ]) {
- if (picked.size === limit) break;
- picked.set(task.id, task);
- }
- return [...picked.values()];
-}
diff --git a/products/desktop/apps/mobilehog/src/lib/prefs.ts b/products/desktop/apps/mobilehog/src/lib/prefs.ts
deleted file mode 100644
index dca2748f4d62..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/prefs.ts
+++ /dev/null
@@ -1,47 +0,0 @@
-import * as SecureStore from "expo-secure-store";
-import { Appearance } from "react-native";
-import { create } from "zustand";
-
-const KEY = "mobilehog_prefs";
-
-export type AppearanceMode = "light" | "dark" | "system";
-
-interface Prefs {
- hedgehogMode: boolean;
- appearance: AppearanceMode;
-}
-
-interface PrefsState extends Prefs {
- hydrate: () => Promise<void>;
- set: (patch: Partial<Prefs>) => Promise<void>;
-}
-
-const defaults: Prefs = { hedgehogMode: true, appearance: "system" };
-
-function applyAppearance(mode: AppearanceMode): void {
- Appearance.setColorScheme(mode === "system" ? "unspecified" : mode);
-}
-
-export const usePrefs = create<PrefsState>((set, get) => ({
- ...defaults,
- hydrate: async () => {
- try {
- const raw = await SecureStore.getItemAsync(KEY);
- const prefs = {
- ...defaults,
- ...(JSON.parse(raw ?? "{}") as Partial<Prefs>),
- };
- set(prefs);
- applyAppearance(prefs.appearance);
- } catch {}
- },
- set: async (patch) => {
- set(patch);
- const { hedgehogMode, appearance } = { ...get(), ...patch };
- applyAppearance(appearance);
- await SecureStore.setItemAsync(
- KEY,
- JSON.stringify({ hedgehogMode, appearance }),
- );
- },
-}));
diff --git a/products/desktop/apps/mobilehog/src/lib/projects.ts b/products/desktop/apps/mobilehog/src/lib/projects.ts
deleted file mode 100644
index dce144cefc4e..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/projects.ts
+++ /dev/null
@@ -1,55 +0,0 @@
-import { useQuery } from "@tanstack/react-query";
-import { authedFetch, getBaseUrl, refreshAccessTokenOnce } from "@/lib/api";
-import { requireSession, useAuth } from "@/lib/auth";
-
-export interface ProjectOption {
- id: number;
- name: string;
-}
-
-async function loadProject(projectId: number): Promise<ProjectOption | null> {
- const response = await authedFetch(
- `${getBaseUrl()}/api/projects/${projectId}/`,
- );
- if (response.status === 403 || response.status === 404) return null;
- if (!response.ok) throw new Error("Could not load the project. Try again.");
- return response.json();
-}
-
-async function loadProjects(): Promise<ProjectOption[]> {
- // Sessions from before scoped teams were stored learn them on the next refresh.
- if (requireSession().refreshToken && !requireSession().scopedTeams) {
- await refreshAccessTokenOnce();
- }
- const { scopedTeams } = requireSession();
- // A scoped token can reach projects outside the current organization.
- if (scopedTeams?.length) {
- const projects = await Promise.all(scopedTeams.map(loadProject));
- return projects.filter((project): project is ProjectOption => !!project);
- }
- const projects: ProjectOption[] = [];
- let hasNext = true;
- while (hasNext) {
- const response = await authedFetch(
- `${getBaseUrl()}/api/projects/?limit=100&offset=${projects.length}`,
- );
- if (!response.ok) throw new Error("Could not load projects. Try again.");
- const page = (await response.json()) as {
- results: ProjectOption[];
- next: string | null;
- };
- projects.push(...page.results);
- hasNext = !!page.next && page.results.length > 0;
- }
- return projects;
-}
-
-export function useProjects() {
- const session = useAuth((s) => s.session);
- return useQuery({
- queryKey: ["projects", session?.host, session?.userId],
- queryFn: loadProjects,
- enabled: !!session,
- staleTime: 5 * 60_000,
- });
-}
diff --git a/products/desktop/apps/mobilehog/src/lib/queries.ts b/products/desktop/apps/mobilehog/src/lib/queries.ts
deleted file mode 100644
index 424419dbe073..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/queries.ts
+++ /dev/null
@@ -1,282 +0,0 @@
-import type { GatewayModel } from "@posthog/shared";
-import type { Task } from "@posthog/shared/domain-types";
-import {
- useInfiniteQuery,
- useMutation,
- useQuery,
- useQueryClient,
-} from "@tanstack/react-query";
-import { DEFAULT_MODEL, DEFAULT_REPOSITORY } from "@/config";
-import { type Photo, uploadStagedPhotos } from "@/lib/attachments";
-import { type Session, useAuth } from "@/lib/auth";
-import { getClient } from "@/lib/client";
-import { currentRunConfig } from "@/lib/composer";
-import { useRepo } from "@/lib/repo";
-import type { PhotoRef } from "@/lib/transcript";
-
-const TERMINAL: ReadonlySet<string> = new Set([
- "completed",
- "failed",
- "cancelled",
-]);
-
-export const keys = {
- tasks: ["tasks"] as const,
- task: (id: string) => ["tasks", id] as const,
- models: ["models"] as const,
- repository: ["repository"] as const,
- repositories: ["repositories"] as const,
- runArtifacts: (taskId: string, runId: string) =>
- ["run-artifacts", taskId, runId] as const,
- photoUrl: (taskId: string, runId: string, artifactId: string) =>
- ["photo-url", taskId, runId, artifactId] as const,
- insight: (shortId: string) => ["insights", shortId] as const,
-};
-
-// Presigned photo URLs expire after an hour; refresh them well before that.
-const PHOTO_URL_TTL = 50 * 60_000;
-
-const PAGE_SIZE = 50;
-
-function visibleTasks(tasks: Task[]): Task[] {
- return tasks.filter(
- (task) =>
- !task.internal &&
- task.latest_run?.environment !== "local" &&
- !task.origin_key?.startsWith("desktop_onboarding"),
- );
-}
-
-// The full task history, newest activity first, one page at a time.
-export function useTaskPages(search: string, archived: boolean) {
- const session = useAuth((s) => s.session);
- const scope = archived ? "archived" : "active";
- return useInfiniteQuery({
- queryKey: search
- ? [
- ...keys.tasks,
- "created-by",
- session?.userId,
- "pages",
- scope,
- "search",
- search,
- ]
- : [...keys.tasks, "created-by", session?.userId, "pages", scope],
- initialPageParam: 0,
- queryFn: async ({ pageParam }) => {
- const page = await getClient().getTasksPage({
- basic: true,
- archived,
- createdBy: session?.userId,
- search: search || undefined,
- ordering: "-last_activity_at",
- limit: PAGE_SIZE,
- offset: pageParam,
- });
- return { ...page, visible: visibleTasks(page.tasks) };
- },
- getNextPageParam: (page, _pages, offset) => {
- const next = offset + page.tasks.length;
- return page.tasks.length > 0 && next < page.count ? next : undefined;
- },
- enabled: !!session,
- });
-}
-
-export function useTasks(search = "") {
- const session = useAuth((s) => s.session);
- return useQuery({
- queryKey: search
- ? [...keys.tasks, "created-by", session?.userId, "search", search]
- : [...keys.tasks, "created-by", session?.userId],
- queryFn: async () =>
- visibleTasks(
- await getClient().getTasks({
- basic: true,
- createdBy: session?.userId,
- search: search || undefined,
- }),
- ),
- enabled: !!session,
- refetchInterval: (query) => {
- const tasks = query.state.data as Task[] | undefined;
- const anyLive = tasks?.some((task) => {
- const status = task.latest_run?.status;
- return !!status && !TERMINAL.has(status);
- });
- return anyLive ? 5000 : 30000;
- },
- });
-}
-
-export function currentUserQuery(session: Session | null) {
- return {
- queryKey: ["me", session?.host, session?.userId],
- queryFn: () => getClient().getCurrentUser(),
- staleTime: Number.POSITIVE_INFINITY,
- };
-}
-
-export function useTask(taskId: string) {
- const session = useAuth((s) => s.session);
- return useQuery({
- queryKey: keys.task(taskId),
- queryFn: () => getClient().getTask(taskId),
- enabled: !!session && !!taskId,
- refetchInterval: (query) => {
- const status = (query.state.data as Task | undefined)?.latest_run?.status;
- return status && !TERMINAL.has(status) ? 5000 : false;
- },
- });
-}
-
-export function useInsightSummary(shortId: string) {
- const session = useAuth((s) => s.session);
- return useQuery({
- queryKey: keys.insight(shortId),
- queryFn: () => getClient().getInsightSummary(shortId),
- enabled: !!session,
- staleTime: 5 * 60_000,
- });
-}
-
-// The gateway may not be running locally, so the pill always has a default.
-export function useModels() {
- const session = useAuth((s) => s.session);
- return useQuery<GatewayModel[]>({
- queryKey: keys.models,
- queryFn: async () => {
- try {
- const models = await getClient().getCloudTaskGatewayModels();
- const allowed = models.filter((model) => model.allowed);
- return allowed.length > 0 ? allowed : fallbackModels();
- } catch {
- return fallbackModels();
- }
- },
- enabled: !!session,
- staleTime: 5 * 60_000,
- });
-}
-
-function fallbackModels(): GatewayModel[] {
- return [
- {
- id: DEFAULT_MODEL,
- owned_by: "anthropic",
- context_window: 200_000,
- supports_streaming: true,
- supports_vision: true,
- allowed: true,
- },
- ];
-}
-
-// Most recently used repository on this project, else the configured default.
-// The chosen repo wins, then the config default, then the most recently used.
-export function useDefaultRepository() {
- const tasks = useTasks();
- const chosen = useRepo((s) => s.repository);
- const recent = tasks.data?.find((task) => task.repository)?.repository;
- return {
- data:
- chosen !== undefined ? chosen : (DEFAULT_REPOSITORY ?? recent ?? null),
- isLoading: chosen === undefined && tasks.isLoading,
- };
-}
-
-export function useRepositories() {
- const session = useAuth((s) => s.session);
- return useQuery<string[]>({
- queryKey: keys.repositories,
- queryFn: async () => {
- const client = getClient();
- const integrations = await client.getGithubUserIntegrations();
- const lists = await Promise.all(
- integrations.map((integration) =>
- client.getGithubUserRepositories(integration.installation_id),
- ),
- );
- return [...new Set(lists.flat())].sort();
- },
- enabled: !!session,
- staleTime: 5 * 60_000,
- });
-}
-
-export function useUpdateTask() {
- const queryClient = useQueryClient();
- return useMutation({
- mutationFn: ({
- id,
- ...patch
- }: {
- id: string;
- title?: string;
- archived?: boolean;
- }) => getClient().updateTask(id, patch),
- onSettled: () => queryClient.invalidateQueries({ queryKey: keys.tasks }),
- });
-}
-
-export function useInvalidateTasks() {
- const queryClient = useQueryClient();
- return () => queryClient.invalidateQueries({ queryKey: keys.tasks });
-}
-
-export async function createAndRunTask(input: {
- prompt: string;
- repository: string | null;
- photos?: Photo[];
-}): Promise<Task> {
- const client = getClient();
- const task = await client.createTask({
- description: input.prompt,
- title: input.prompt.slice(0, 100),
- repository: input.repository ?? undefined,
- });
- const artifactIds = await uploadStagedPhotos(task.id, input.photos ?? []);
- return client.runTaskInCloud(task.id, undefined, {
- pendingUserMessage: input.prompt,
- pendingUserArtifactIds: artifactIds.length ? artifactIds : undefined,
- ...currentRunConfig(),
- });
-}
-
-// Resolves a sent photo to a short-lived download URL. Pass null to skip.
-export function usePhotoUrl(taskId: string, photo: PhotoRef | null) {
- const session = useAuth((s) => s.session);
- const queryClient = useQueryClient();
- return useQuery({
- queryKey: keys.photoUrl(
- taskId,
- photo?.runId ?? "",
- photo?.artifactId ?? "",
- ),
- queryFn: async () => {
- if (!photo) throw new Error("No photo");
- const client = getClient();
- const findPath = async (staleTime: number) => {
- const artifacts = await queryClient.fetchQuery({
- queryKey: keys.runArtifacts(taskId, photo.runId),
- queryFn: async () =>
- (await client.getTaskRun(taskId, photo.runId)).artifacts ?? [],
- staleTime,
- });
- return artifacts.find((artifact) => artifact.id === photo.artifactId)
- ?.storage_path;
- };
- // One manifest fetch serves every photo of the run, but a cached one can
- // predate a photo that was just sent, so a miss fetches it again.
- const storagePath = (await findPath(10_000)) ?? (await findPath(0));
- if (!storagePath) throw new Error("Photo not found");
- return client.presignTaskRunArtifact(taskId, photo.runId, storagePath);
- },
- enabled: !!session && !!photo,
- staleTime: PHOTO_URL_TTL,
- gcTime: PHOTO_URL_TTL,
- refetchInterval: PHOTO_URL_TTL,
- retry: false,
- });
-}
diff --git a/products/desktop/apps/mobilehog/src/lib/repo.ts b/products/desktop/apps/mobilehog/src/lib/repo.ts
deleted file mode 100644
index abf4a25e7b99..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/repo.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-import * as SecureStore from "expo-secure-store";
-import { create } from "zustand";
-import { accountStorageKey, sessionIdentity, useAuth } from "@/lib/auth";
-
-const KEY = "mobilehog_repository";
-
-interface RepoState {
- // undefined = not chosen yet, null = explicitly none.
- repository: string | null | undefined;
- hydrate: () => Promise<void>;
- setRepository: (repository: string | null) => Promise<void>;
-}
-
-export const useRepo = create<RepoState>((set) => ({
- repository: undefined,
- hydrate: async () => {
- if (!useAuth.getState().session) return;
- const identity = sessionIdentity();
- try {
- const raw = await SecureStore.getItemAsync(accountStorageKey(KEY));
- if (sessionIdentity() !== identity) return;
- set({ repository: raw === null ? undefined : raw === "" ? null : raw });
- } catch {
- if (sessionIdentity() === identity) set({ repository: undefined });
- }
- },
- setRepository: async (repository) => {
- set({ repository });
- await SecureStore.setItemAsync(accountStorageKey(KEY), repository ?? "");
- },
-}));
diff --git a/products/desktop/apps/mobilehog/src/lib/reportFilters.test.ts b/products/desktop/apps/mobilehog/src/lib/reportFilters.test.ts
deleted file mode 100644
index b1094a7b990c..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/reportFilters.test.ts
+++ /dev/null
@@ -1,95 +0,0 @@
-import type { SignalReport } from "@posthog/shared/domain-types";
-import { describe, expect, it } from "vitest";
-import {
- hasOpenImplementationPr,
- openPullRequestUrl,
- reportFilterParams,
-} from "./reportFilters";
-
-const PR = "https://github.com/acme/app/pull/12";
-
-function report(fields: Partial<SignalReport>): SignalReport {
- return { id: "r", ...fields } as SignalReport;
-}
-
-describe("reportFilters", () => {
- it.each([
- [
- "attention",
- {
- status: "ready,pending_input",
- actionability: "immediately_actionable,requires_human_input",
- ordering: "status,-priority,-created_at",
- },
- ],
- [
- "pull-requests",
- {
- status: "ready",
- has_implementation_pr: true,
- ordering: "status,-priority,-created_at",
- },
- ],
- ["dismissed", { status: "suppressed,resolved", ordering: "-updated_at" }],
- ] as const)("maps %s to its list params", (filter, params) => {
- expect(reportFilterParams(filter)).toEqual(params);
- });
-
- it.each([
- ["no PR", {}, false],
- [
- "an open PR",
- { implementation_pr_url: PR, implementation_pr_state: "open" },
- true,
- ],
- [
- "a draft PR",
- { implementation_pr_url: PR, implementation_pr_state: "draft" },
- true,
- ],
- ["a PR with no known state", { implementation_pr_url: PR }, true],
- [
- "a merged PR",
- { implementation_pr_url: PR, implementation_pr_state: "merged" },
- false,
- ],
- [
- "a closed PR",
- { implementation_pr_url: PR, implementation_pr_state: "closed" },
- false,
- ],
- [
- "a PR flagged merged",
- { implementation_pr_url: PR, implementation_pr_merged: true },
- false,
- ],
- ] as const)("treats a report with %s as open: %s", (_label, fields, open) => {
- expect(hasOpenImplementationPr(report(fields))).toBe(open);
- });
-
- it.each([
- [PR, PR],
- ["http://github.com/acme/app/pull/12", null],
- ["https://evil.example.com/acme/app/pull/12", null],
- ["mailto://github.com/acme/app/pull/1", null],
- ["javascript:alert(1)", null],
- ["myapp://github.com/acme/app/pull/1", null],
- ])("only opens %s as a GitHub PR link", (url, expected) => {
- expect(
- openPullRequestUrl(
- report({ implementation_pr_url: url, implementation_pr_state: "open" }),
- ),
- ).toBe(expected);
- });
-
- it("does not link a merged PR", () => {
- expect(
- openPullRequestUrl(
- report({
- implementation_pr_url: PR,
- implementation_pr_state: "merged",
- }),
- ),
- ).toBeNull();
- });
-});
diff --git a/products/desktop/apps/mobilehog/src/lib/reportFilters.ts b/products/desktop/apps/mobilehog/src/lib/reportFilters.ts
deleted file mode 100644
index 8d563137ac00..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/reportFilters.ts
+++ /dev/null
@@ -1,66 +0,0 @@
-import {
- buildArchiveListOrdering,
- buildSignalReportListOrdering,
- INBOX_ACTIONABLE_ACTIONABILITY_FILTER,
- INBOX_ACTIONABLE_REPORT_STATUS_FILTER,
- INBOX_DISMISSED_STATUS_FILTER,
- INBOX_PULL_REQUEST_STATUS_FILTER,
-} from "@posthog/core/inbox/reportFiltering";
-import { isSafeGitHubPullRequestUrl } from "@posthog/shared";
-import type {
- SignalReport,
- SignalReportsQueryParams,
-} from "@posthog/shared/domain-types";
-
-export type ReportFilter = "attention" | "pull-requests" | "dismissed";
-
-export const REPORT_FILTERS: { value: ReportFilter; label: string }[] = [
- { value: "attention", label: "Needs attention" },
- { value: "pull-requests", label: "PR ready" },
- { value: "dismissed", label: "Dismissed" },
-];
-
-export function reportFilterParams(
- filter: ReportFilter,
-): SignalReportsQueryParams {
- switch (filter) {
- case "attention":
- return {
- status: INBOX_ACTIONABLE_REPORT_STATUS_FILTER,
- actionability: INBOX_ACTIONABLE_ACTIONABILITY_FILTER,
- ordering: buildSignalReportListOrdering("priority", "desc"),
- };
- case "pull-requests":
- return {
- status: INBOX_PULL_REQUEST_STATUS_FILTER,
- has_implementation_pr: true,
- ordering: buildSignalReportListOrdering("priority", "desc"),
- };
- case "dismissed":
- return {
- status: INBOX_DISMISSED_STATUS_FILTER,
- ordering: buildArchiveListOrdering("updated_at", "desc"),
- };
- }
-}
-
-// The list API matches merged and closed PRs too, so the PR tab keeps only the
-// ones still open.
-export function hasOpenImplementationPr(report: SignalReport): boolean {
- if (!report.implementation_pr_url || report.implementation_pr_merged) {
- return false;
- }
- const state = report.implementation_pr_state;
- return state !== "merged" && state !== "closed";
-}
-
-// The URL comes from task output, so only a real GitHub PR link may reach the
-// OS link handler.
-export function openPullRequestUrl(report: SignalReport): string | null {
- const url = report.implementation_pr_url;
- return url &&
- hasOpenImplementationPr(report) &&
- isSafeGitHubPullRequestUrl(url)
- ? url
- : null;
-}
diff --git a/products/desktop/apps/mobilehog/src/lib/reportReadState.test.ts b/products/desktop/apps/mobilehog/src/lib/reportReadState.test.ts
deleted file mode 100644
index d6806ef3036e..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/reportReadState.test.ts
+++ /dev/null
@@ -1,52 +0,0 @@
-import { QueryClient } from "@tanstack/react-query";
-import { describe, expect, it } from "vitest";
-import {
- markReadOptimistically,
- restoreReadState,
- summarizeReadStates,
-} from "./reportReadState";
-
-describe("reportReadState", () => {
- it("counts only a fresh, successful false as unread", () => {
- const states = summarizeReadStates(
- ["read", "unread", "failed", "cached", "stale-after-error"],
- [
- { data: true, isError: false, isFetchedAfterMount: true },
- { data: false, isError: false, isFetchedAfterMount: true },
- { data: undefined, isError: true, isFetchedAfterMount: true },
- { data: false, isError: false, isFetchedAfterMount: false },
- { data: false, isError: true, isFetchedAfterMount: true },
- ],
- );
- expect([...states.unread]).toEqual(["unread"]);
- });
-
- it("is not settled while a cached state waits for the server", () => {
- const states = summarizeReadStates(
- ["a", "b"],
- [
- { data: false, isError: false, isFetchedAfterMount: false },
- { data: true, isError: false, isFetchedAfterMount: true },
- ],
- );
- expect(states.settled).toBe(false);
- });
-
- it.each([
- [false, false],
- [undefined, undefined],
- ])(
- "puts back %s after a failed write so the next open retries",
- async (previous, restored) => {
- const queryClient = new QueryClient();
- const key = ["reports", "read", "r"];
- if (previous !== undefined) queryClient.setQueryData(key, previous);
-
- const saved = await markReadOptimistically(queryClient, key);
- expect(queryClient.getQueryData(key)).toBe(true);
-
- await restoreReadState(queryClient, key, saved);
- expect(queryClient.getQueryData(key)).toBe(restored);
- },
- );
-});
diff --git a/products/desktop/apps/mobilehog/src/lib/reportReadState.ts b/products/desktop/apps/mobilehog/src/lib/reportReadState.ts
deleted file mode 100644
index e58749b1e1e6..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/reportReadState.ts
+++ /dev/null
@@ -1,63 +0,0 @@
-import type { QueryClient, QueryKey } from "@tanstack/react-query";
-
-export interface ReadStateResult {
- data?: boolean;
- isError: boolean;
- isFetchedAfterMount: boolean;
-}
-
-export interface ReportReadStates {
- unread: ReadonlySet<string>;
- // Every state came from the server since mount, not only from the saved
- // cache, so a report read on another device does not count as unread.
- settled: boolean;
-}
-
-// Only a fresh, successful answer counts as unread. A cached value or a failed
-// refresh counts as read, so stale or missing state never lights a dot or pops
-// the deck.
-export function summarizeReadStates(
- reportIds: readonly string[],
- results: readonly ReadStateResult[],
-): ReportReadStates {
- const unread = new Set<string>();
- reportIds.forEach((id, index) => {
- const result = results[index];
- if (
- result?.data === false &&
- result.isFetchedAfterMount &&
- !result.isError
- ) {
- unread.add(id);
- }
- });
- return {
- unread,
- settled: results.every((result) => result.isFetchedAfterMount),
- };
-}
-
-export async function markReadOptimistically(
- queryClient: QueryClient,
- key: QueryKey,
-): Promise<boolean | undefined> {
- await queryClient.cancelQueries({ queryKey: key, exact: true });
- const previous = queryClient.getQueryData<boolean>(key);
- queryClient.setQueryData(key, true);
- return previous;
-}
-
-// Put back what the cache held before the failed write, so the next open does
-// not see the report as read and tries the write again.
-export async function restoreReadState(
- queryClient: QueryClient,
- key: QueryKey,
- previous: boolean | undefined,
-): Promise<void> {
- if (previous === undefined) {
- await queryClient.resetQueries({ queryKey: key, exact: true });
- return;
- }
- queryClient.setQueryData(key, previous);
- await queryClient.invalidateQueries({ queryKey: key, exact: true });
-}
diff --git a/products/desktop/apps/mobilehog/src/lib/reportScope.test.ts b/products/desktop/apps/mobilehog/src/lib/reportScope.test.ts
deleted file mode 100644
index e8c90fdae47a..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/reportScope.test.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { describe, expect, it } from "vitest";
-import { reportScopeParams } from "./reportScope";
-
-describe("reportScopeParams", () => {
- it.each([
- ["entire-project", "user-1", {}],
- ["entire-project", undefined, {}],
- ["for-you", "user-1", { suggested_reviewers: "user-1" }],
- ["for-you", " user-1 ", { suggested_reviewers: "user-1" }],
- ["for-you", undefined, null],
- ["for-you", null, null],
- ["for-you", " ", null],
- ] as const)("%s with uuid %j", (scope, uuid, expected) => {
- expect(reportScopeParams(scope, uuid)).toEqual(expected);
- });
-});
diff --git a/products/desktop/apps/mobilehog/src/lib/reportScope.ts b/products/desktop/apps/mobilehog/src/lib/reportScope.ts
deleted file mode 100644
index 2c744996715c..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/reportScope.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-import { buildSuggestedReviewerFilterParam } from "@posthog/core/inbox/reportFiltering";
-import type { SignalReportsQueryParams } from "@posthog/shared/domain-types";
-import { create } from "zustand";
-
-export type ReportScope = "for-you" | "entire-project";
-
-export const REPORT_SCOPES = [
- { value: "for-you", label: "For you", icon: "person" },
- { value: "entire-project", label: "Entire project", icon: "person.2" },
-] as const;
-
-export const useReportScope = create<{
- scope: ReportScope;
- setScope: (scope: ReportScope) => void;
-}>((set) => ({
- scope: "for-you",
- setScope: (scope) => set({ scope }),
-}));
-
-// Null means "For you" has no reviewer to filter on. The caller must not fall
-// back to the whole project then.
-export function reportScopeParams(
- scope: ReportScope,
- userUuid: string | null | undefined,
-): Pick<SignalReportsQueryParams, "suggested_reviewers"> | null {
- if (scope === "entire-project") return {};
- const reviewers = buildSuggestedReviewerFilterParam(
- userUuid ? [userUuid] : [],
- );
- return reviewers ? { suggested_reviewers: reviewers } : null;
-}
diff --git a/products/desktop/apps/mobilehog/src/lib/reportTasks.test.ts b/products/desktop/apps/mobilehog/src/lib/reportTasks.test.ts
deleted file mode 100644
index 5cf6c0ba21ea..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/reportTasks.test.ts
+++ /dev/null
@@ -1,131 +0,0 @@
-import { ApiRequestError } from "@posthog/api-client/fetcher";
-import type {
- SignalReportArtefactsResponse,
- Task,
-} from "@posthog/shared/domain-types";
-import { describe, expect, it, vi } from "vitest";
-import {
- fetchHasLiveImplementationTask,
- implementationTaskIds,
- isLiveImplementationTask,
-} from "./reportTasks";
-
-function taskRun(taskId: string, type: string, product = "signals") {
- return {
- id: `artefact-${taskId}-${type}`,
- type: "task_run",
- created_at: "2026-01-01T00:00:00Z",
- content: { task_id: taskId, product, type },
- };
-}
-
-function artefacts(
- results: ReturnType<typeof taskRun>[],
-): SignalReportArtefactsResponse {
- return {
- results,
- count: results.length,
- } as unknown as SignalReportArtefactsResponse;
-}
-
-function task(
- id: string,
- status: string | null,
- output: Record<string, unknown> | null = null,
-): Task {
- return {
- id,
- latest_run: status === null ? undefined : { status, output },
- } as unknown as Task;
-}
-
-describe("implementationTaskIds", () => {
- it("keeps only signals implementation runs, once per task", () => {
- expect(
- implementationTaskIds(
- artefacts([
- taskRun("a", "implementation"),
- taskRun("a", "implementation"),
- taskRun("b", "research"),
- taskRun("c", "implementation", "custom"),
- taskRun("d", "implementation"),
- ]),
- ),
- ).toEqual(["a", "d"]);
- });
-});
-
-describe("isLiveImplementationTask", () => {
- it.each([
- ["a running run", task("t", "in_progress"), true],
- ["a failed run with no PR", task("t", "failed"), false],
- ["a task with no run", task("t", null), false],
- [
- "a finished run with an open PR",
- task("t", "completed", { pr_url: "https://github.com/o/r/pull/1" }),
- true,
- ],
- [
- "a merged PR",
- task("t", "completed", {
- pr_url: "https://github.com/o/r/pull/1",
- pr_state: "merged",
- }),
- false,
- ],
- [
- "a legacy merged PR",
- task("t", "completed", {
- pr_url: "https://github.com/o/r/pull/1",
- pr_merged: true,
- }),
- false,
- ],
- ])("%s", (_label, value, expected) => {
- expect(isLiveImplementationTask(value)).toBe(expected);
- });
-});
-
-describe("fetchHasLiveImplementationTask", () => {
- function client(tasks: Record<string, Task | Error>) {
- return {
- getSignalReportArtefacts: vi
- .fn()
- .mockResolvedValue(
- artefacts(
- Object.keys(tasks).map((id) => taskRun(id, "implementation")),
- ),
- ),
- getTask: vi.fn((id: string) => {
- const value = tasks[id];
- return value instanceof Error
- ? Promise.reject(value)
- : Promise.resolve(value);
- }),
- };
- }
-
- it("is true when one linked task is live", async () => {
- const c = client({
- a: task("a", "failed"),
- b: task("b", "in_progress"),
- });
- await expect(fetchHasLiveImplementationTask(c, "r")).resolves.toBe(true);
- expect(c.getSignalReportArtefacts).toHaveBeenCalledWith("r", {
- limit: 1000,
- });
- });
-
- it("skips a deleted task", async () => {
- const c = client({
- a: new ApiRequestError(404, "not found"),
- b: task("b", "completed"),
- });
- await expect(fetchHasLiveImplementationTask(c, "r")).resolves.toBe(false);
- });
-
- it("fails when a task lookup fails for another reason", async () => {
- const c = client({ a: new ApiRequestError(500, "boom") });
- await expect(fetchHasLiveImplementationTask(c, "r")).rejects.toThrow();
- });
-});
diff --git a/products/desktop/apps/mobilehog/src/lib/reportTasks.ts b/products/desktop/apps/mobilehog/src/lib/reportTasks.ts
deleted file mode 100644
index 22d1cc4aa66a..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/reportTasks.ts
+++ /dev/null
@@ -1,62 +0,0 @@
-import { requestErrorStatus } from "@posthog/api-client/fetcher";
-import type { PostHogAPIClient } from "@posthog/api-client/posthog-client";
-import {
- isTerminalStatus,
- type SignalReportArtefactsResponse,
- type Task,
- type TaskRunArtefactContent,
-} from "@posthog/shared/domain-types";
-
-type ReportTaskClient = Pick<
- PostHogAPIClient,
- "getSignalReportArtefacts" | "getTask"
->;
-
-export function implementationTaskIds(
- artefacts: SignalReportArtefactsResponse,
-): string[] {
- const ids = new Set<string>();
- for (const artefact of artefacts.results) {
- if (artefact.type !== "task_run") continue;
- const content = artefact.content as TaskRunArtefactContent;
- if (content.product === "signals" && content.type === "implementation") {
- ids.add(content.task_id);
- }
- }
- return [...ids];
-}
-
-// Live work is a run still going, or a PR that has not merged yet. Starting
-// another task on top of it would open a duplicate PR.
-export function isLiveImplementationTask(task: Task): boolean {
- const run = task.latest_run;
- if (!run) return false;
- const prUrl = run.output?.pr_url;
- if (typeof prUrl === "string" && prUrl.length > 0) {
- return run.output?.pr_state !== "merged" && run.output?.pr_merged !== true;
- }
- return !isTerminalStatus(run.status);
-}
-
-export async function fetchHasLiveImplementationTask(
- client: ReportTaskClient,
- reportId: string,
-): Promise<boolean> {
- // The whole log: a default page can drop the task_run rows.
- const artefacts = await client.getSignalReportArtefacts(reportId, {
- limit: 1000,
- });
- const tasks = await Promise.all(
- implementationTaskIds(artefacts).map((id) =>
- // A deleted task leaves its artefact behind. Skip it, but fail on any
- // other error so unknown state does not read as "no live work".
- client
- .getTask(id)
- .catch((error: unknown) => {
- if (requestErrorStatus(error) === 404) return null;
- throw error;
- }),
- ),
- );
- return tasks.some((task) => task !== null && isLiveImplementationTask(task));
-}
diff --git a/products/desktop/apps/mobilehog/src/lib/reports.ts b/products/desktop/apps/mobilehog/src/lib/reports.ts
deleted file mode 100644
index eb56cde23b18..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/reports.ts
+++ /dev/null
@@ -1,313 +0,0 @@
-import {
- buildCreatePrReportPrompt,
- canCreateImplementationPr,
-} from "@posthog/core/inbox/reportActions";
-import type {
- SignalReport,
- SignalReportArtefactsResponse,
- SignalReportSignalsResponse,
- SignalReportsResponse,
-} from "@posthog/shared/domain-types";
-import {
- type QueryClient,
- useMutation,
- useQueries,
- useQuery,
- useQueryClient,
-} from "@tanstack/react-query";
-import { type Href, router } from "expo-router";
-import { useCallback, useMemo } from "react";
-import { useAuth } from "@/lib/auth";
-import { getClient } from "@/lib/client";
-import { currentRunConfig } from "@/lib/composer";
-import { currentUserQuery } from "@/lib/queries";
-import {
- hasOpenImplementationPr,
- type ReportFilter,
- reportFilterParams,
-} from "@/lib/reportFilters";
-import {
- markReadOptimistically,
- type ReadStateResult,
- type ReportReadStates,
- restoreReadState,
- summarizeReadStates,
-} from "@/lib/reportReadState";
-import { type ReportScope, reportScopeParams } from "@/lib/reportScope";
-import { fetchHasLiveImplementationTask } from "@/lib/reportTasks";
-import { useSessions } from "@/lib/session";
-
-export const reportKeys = {
- all: ["reports"] as const,
- list: ["reports", "list"] as const,
- detail: (id: string) => ["reports", "detail", id] as const,
- read: (id: string) => ["reports", "read", id] as const,
- signals: (id: string) => ["reports", id, "signals"] as const,
- artefacts: (id: string) => ["reports", id, "artefacts"] as const,
- liveTask: (id: string) => ["reports", id, "live-task"] as const,
-};
-
-// Defaults to the reports a person can act on right now, across the project.
-export function useReports(
- search = "",
- filter: ReportFilter = "attention",
- { scope = "entire-project" }: { scope?: ReportScope } = {},
-) {
- const session = useAuth((s) => s.session);
- const queryClient = useQueryClient();
- const key = [...reportKeys.list, filter, scope];
- return useQuery({
- queryKey: search ? [...key, "search", search] : key,
- queryFn: async () => {
- // "For you" waits for the user's uuid, so it never shows the whole
- // project first.
- const user =
- scope === "for-you"
- ? await queryClient.ensureQueryData(currentUserQuery(session))
- : null;
- const scoped = reportScopeParams(scope, user?.uuid);
- if (!scoped) throw new Error("Could not load your account");
- return getClient().getSignalReports({
- ...reportFilterParams(filter),
- ...scoped,
- limit: 100,
- search: search || undefined,
- });
- },
- enabled: !!session,
- refetchInterval: 60_000,
- select: (page) => {
- if (filter === "attention") {
- return page.results.filter((report) =>
- canCreateImplementationPr(report),
- );
- }
- if (filter === "pull-requests") {
- return page.results.filter(hasOpenImplementationPr);
- }
- return page.results;
- },
- });
-}
-
-// Seeded from whichever list already holds the report, so the screen opens
-// with content and refreshes behind it.
-export function useReport(reportId: string) {
- const queryClient = useQueryClient();
- const cached = () => {
- for (const [key, page] of queryClient.getQueriesData<SignalReportsResponse>(
- { queryKey: reportKeys.list },
- )) {
- const report = page?.results.find((item) => item.id === reportId);
- if (report) return { report, key };
- }
- return undefined;
- };
- return useQuery({
- queryKey: reportKeys.detail(reportId),
- queryFn: () => getClient().getSignalReport(reportId),
- enabled: !!reportId,
- initialData: () => cached()?.report,
- initialDataUpdatedAt: () => {
- const key = cached()?.key;
- return key ? queryClient.getQueryState(key)?.dataUpdatedAt : undefined;
- },
- });
-}
-
-export function useReportSignals(reportId: string | null) {
- return useQuery<SignalReportSignalsResponse>({
- queryKey: reportKeys.signals(reportId ?? ""),
- queryFn: () => getClient().getSignalReportSignals(reportId ?? ""),
- enabled: !!reportId,
- staleTime: 5 * 60_000,
- });
-}
-
-export function useReportArtefacts(reportId: string | null) {
- return useQuery<SignalReportArtefactsResponse>({
- queryKey: reportKeys.artefacts(reportId ?? ""),
- queryFn: () => getClient().getSignalReportArtefacts(reportId ?? ""),
- enabled: !!reportId,
- staleTime: 5 * 60_000,
- });
-}
-
-export function useHasLiveImplementationTask(reportId: string) {
- return useQuery({
- queryKey: reportKeys.liveTask(reportId),
- queryFn: () => fetchHasLiveImplementationTask(getClient(), reportId),
- enabled: !!reportId,
- });
-}
-
-// Takes an acted-on report out of every loaded list at once, wherever the
-// action came from. A failed action refetches and brings it back.
-async function dropFromLists(
- queryClient: QueryClient,
- reportId: string,
-): Promise<void> {
- await queryClient.cancelQueries({ queryKey: reportKeys.list });
- queryClient.setQueriesData<SignalReportsResponse>(
- { queryKey: reportKeys.list },
- (page) =>
- page && {
- ...page,
- results: page.results.filter((report) => report.id !== reportId),
- },
- );
-}
-
-export function useDismissReport() {
- const queryClient = useQueryClient();
- return useMutation({
- mutationFn: (reportId: string) =>
- getClient().updateSignalReportState(reportId, { state: "suppressed" }),
- onMutate: (reportId) => dropFromLists(queryClient, reportId),
- onSettled: () =>
- queryClient.invalidateQueries({ queryKey: reportKeys.all }),
- });
-}
-
-// Tasks created for a report whose run failed to start. A retry reuses the
-// task so the report does not collect duplicate implementation tasks.
-const unstartedTasks = new Map<string, string>();
-
-export function resetUnstartedReportTasks(): void {
- unstartedTasks.clear();
-}
-
-// Swipe right: open a task on the report's repo and start the agent on it.
-export function useStartReport() {
- const queryClient = useQueryClient();
- return useMutation({
- mutationFn: async (report: SignalReport) => {
- const client = getClient();
- const prompt = buildCreatePrReportPrompt({ reportId: report.id });
- let taskId = unstartedTasks.get(report.id);
- if (!taskId) {
- if (await fetchHasLiveImplementationTask(client, report.id)) {
- throw new Error("This report already has a task in progress.");
- }
- // The server picks the repository from the report's repo selection.
- const task = await client.createTask({
- description: prompt,
- title: (report.title ?? "Signal report").slice(0, 255),
- origin_product: "signal_report",
- signal_report: report.id,
- signal_report_task_relationship: "implementation",
- });
- taskId = task.id;
- unstartedTasks.set(report.id, taskId);
- }
- const started = await client.runTaskInCloud(taskId, undefined, {
- pendingUserMessage: prompt,
- runSource: "signal_report",
- signalReportId: report.id,
- ...currentRunConfig(),
- });
- unstartedTasks.delete(report.id);
- return started;
- },
- onMutate: (report) => dropFromLists(queryClient, report.id),
- onSettled: () => {
- queryClient.invalidateQueries({ queryKey: reportKeys.all });
- queryClient.invalidateQueries({ queryKey: ["tasks"] });
- },
- });
-}
-
-// Opens the chat at once with the report prompt in it (the same pending
-// pattern as the new-chat screen), then re-keys it to the real task id.
-export function useStartReportTask() {
- const start = useStartReport();
- const run = (
- report: SignalReport,
- open: (href: Href) => void,
- ): Promise<void> => {
- const tempId = `new-${Date.now()}`;
- const prompt = buildCreatePrReportPrompt({ reportId: report.id });
- const { startPending, adopt, failPending } = useSessions.getState();
- startPending(tempId, prompt, `local-${Date.now()}`);
- open({ pathname: "/(drawer)/task/[id]", params: { id: tempId } });
- // mutateAsync, not mutate callbacks: the caller may unmount on navigation.
- return start.mutateAsync(report).then(
- (task) => {
- adopt(tempId, task);
- router.replace({
- pathname: "/(drawer)/task/[id]",
- params: { id: task.id },
- });
- },
- (error: Error) => {
- failPending(tempId, error.message);
- throw error;
- },
- );
- };
- return { start: run, isPending: start.isPending };
-}
-
-// Read state lives on the server, so a report read on one device is read on
-// all of them. The client batches the per-report lookups into one request.
-export function useReportReadStates(
- reportIds: readonly string[],
- { enabled = true }: { enabled?: boolean } = {},
-): ReportReadStates {
- const results = useQueries({
- queries: reportIds.map((id) => ({
- queryKey: reportKeys.read(id),
- queryFn: () => getClient().getReportReadState(id),
- enabled,
- // Unread needs a fetch after mount, so every new screen (and the drawer
- // when it opens) asks the server again even if the cache is recent.
- staleTime: 0,
- refetchInterval: enabled ? 30_000 : false,
- })),
- combine: pickReadStates,
- });
- return useMemo(
- () => summarizeReadStates(reportIds, results),
- [reportIds, results],
- );
-}
-
-function pickReadStates(results: ReadStateResult[]): ReadStateResult[] {
- return results.map(({ data, isError, isFetchedAfterMount }) => ({
- data,
- isError,
- isFetchedAfterMount,
- }));
-}
-
-export function useMarkReportRead(): (reportId: string) => void {
- const queryClient = useQueryClient();
- const { mutate } = useMutation({
- mutationFn: (reportId: string) =>
- getClient().getReportReadStates([reportId], true),
- onMutate: async (reportId) => ({
- previous: await markReadOptimistically(
- queryClient,
- reportKeys.read(reportId),
- ),
- }),
- onSuccess: (states, reportId) =>
- queryClient.setQueryData(
- reportKeys.read(reportId),
- states[reportId] === true,
- ),
- onError: (_error, reportId, context) =>
- restoreReadState(
- queryClient,
- reportKeys.read(reportId),
- context?.previous,
- ),
- });
- return useCallback(
- (reportId: string) => {
- if (queryClient.getQueryData(reportKeys.read(reportId)) === true) return;
- mutate(reportId);
- },
- [queryClient, mutate],
- );
-}
diff --git a/products/desktop/apps/mobilehog/src/lib/session.ts b/products/desktop/apps/mobilehog/src/lib/session.ts
deleted file mode 100644
index 1cf0cde9cf89..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/session.ts
+++ /dev/null
@@ -1,516 +0,0 @@
-import { CloudCommandError } from "@posthog/api-client/posthog-client";
-import type {
- CloudTaskUpdatePayload,
- Task,
- TaskRunStatus,
-} from "@posthog/shared";
-import * as Haptics from "expo-haptics";
-import { create } from "zustand";
-import { type Photo, uploadRunPhotos } from "@/lib/attachments";
-import { loadTranscript, saveTranscript } from "@/lib/cache";
-import { getClient } from "@/lib/client";
-import { currentRunConfig } from "@/lib/composer";
-import { type WatchHandle, watchRun } from "@/lib/engine";
-import { logger } from "@/lib/logger";
-import {
- type Block,
- closeOpenAgent,
- foldEntries,
- type PermissionRequest,
-} from "@/lib/transcript";
-
-const log = logger.scope("session");
-
-const TERMINAL: ReadonlySet<string> = new Set([
- "completed",
- "failed",
- "cancelled",
-]);
-
-export interface TaskSession {
- taskId: string;
- runId: string;
- blocks: Block[];
- runStatus: TaskRunStatus | null;
- stage: string | null;
- connected: boolean;
- turnActive: boolean;
- awaitingInput: boolean;
- error: string | null;
- permissions: Record<string, PermissionRequest>;
- // Prompts sent from this device, so their echo in the log is not shown twice.
- localEchoes: Set<string>;
- // Last prompt sent, kept so a dead sandbox can be resumed with it.
- lastPrompt: string | null;
- // A replacement run is being created for a finished one.
- resuming: boolean;
-}
-
-interface SessionState {
- sessions: Record<string, TaskSession>;
- reset: () => void;
- // A chat that exists on screen before its task does. `adopt` moves it under
- // the real task id once the run is created; `fail` leaves the prompt with an error.
- startPending: (
- tempId: string,
- prompt: string,
- localId: string,
- images?: string[],
- ) => void;
- adopt: (tempId: string, task: Task) => void;
- failPending: (tempId: string, message: string) => void;
- connect: (task: Task) => void;
- disconnect: (taskId: string) => void;
- reconnect: () => void;
- sendPrompt: (
- taskId: string,
- text: string,
- localId?: string,
- photos?: Photo[],
- ) => Promise<string | null>;
- cancelTurn: (taskId: string) => Promise<void>;
- stopRun: (taskId: string) => Promise<void>;
- respondToPermission: (
- taskId: string,
- toolCallId: string,
- optionId: string,
- ) => Promise<void>;
-}
-
-const handles = new Map<string, WatchHandle>();
-
-// A finished run answers commands with 409 "workflow has ended"; a dead
-// sandbox with 404. Both mean: start a replacement run carrying the message.
-function runIsGone(error: CloudCommandError): boolean {
- return (
- error.isSandboxInactive() ||
- error.status === 409 ||
- !!error.backendError?.toLowerCase().includes("workflow has ended")
- );
-}
-
-function emptySession(taskId: string, runId: string): TaskSession {
- return {
- taskId,
- runId,
- blocks: [],
- runStatus: null,
- stage: null,
- connected: false,
- turnActive: false,
- awaitingInput: false,
- error: null,
- permissions: {},
- localEchoes: new Set(),
- lastPrompt: null,
- resuming: false,
- };
-}
-
-export const useSessions = create<SessionState>((set, get) => {
- let generation = 0;
- const patch = (
- taskId: string,
- fn: (s: TaskSession) => Partial<TaskSession>,
- ): void => {
- set((state) => {
- const current = state.sessions[taskId];
- if (!current) return state;
- return {
- sessions: {
- ...state.sessions,
- [taskId]: { ...current, ...fn(current) },
- },
- };
- });
- };
-
- const applyUpdate = (
- taskId: string,
- update: CloudTaskUpdatePayload,
- ): void => {
- const session = get().sessions[taskId];
- if (!session || session.runId !== update.runId) return;
-
- if (update.kind === "error") {
- patch(taskId, () => ({ error: update.errorMessage, connected: false }));
- return;
- }
-
- if (update.kind === "permission_request") {
- const toolCallId = update.toolCall?.toolCallId;
- if (!toolCallId) return;
- patch(taskId, (s) => ({
- permissions: {
- ...s.permissions,
- [toolCallId]: {
- requestId: update.requestId,
- toolCallId,
- title: update.toolCall.title,
- input: update.toolCall.rawInput,
- options: update.options,
- },
- },
- }));
- Haptics.notificationAsync(Haptics.NotificationFeedbackType.Warning).catch(
- () => {},
- );
- return;
- }
-
- if (update.kind === "status") {
- patch(taskId, (s) => {
- const terminal = !!update.status && TERMINAL.has(update.status);
- return {
- runStatus: update.status ?? s.runStatus,
- stage: update.stage ?? s.stage,
- turnActive: terminal ? false : s.turnActive,
- error: update.errorMessage ?? s.error,
- };
- });
- return;
- }
-
- const isSnapshot = update.kind === "snapshot";
- const echoes = isSnapshot ? new Set<string>() : session.localEchoes;
- const folded = foldEntries(
- isSnapshot ? [] : session.blocks,
- update.newEntries,
- echoes,
- );
-
- patch(taskId, (s) => {
- const permissions = isSnapshot ? {} : { ...s.permissions };
- for (const request of folded.permissionRequests) {
- permissions[request.toolCallId] = request;
- }
- for (const requestId of folded.resolvedRequestIds) {
- for (const [key, value] of Object.entries(permissions)) {
- if (value.requestId === requestId) delete permissions[key];
- }
- }
- // A tool call that already finished no longer needs an answer.
- for (const block of folded.blocks) {
- if (
- block.kind === "tool" &&
- block.status !== "pending" &&
- permissions[block.id]
- ) {
- delete permissions[block.id];
- }
- }
-
- let turnActive = s.turnActive;
- if (folded.externalUserMessages > 0) turnActive = true;
- if (folded.turnEnded) turnActive = false;
- const status = isSnapshot ? (update.status ?? s.runStatus) : s.runStatus;
- if (status && TERMINAL.has(status)) turnActive = false;
- // A reopened live run with an unfinished agent block is still working.
- if (isSnapshot && status && !TERMINAL.has(status)) {
- const tail = folded.blocks[folded.blocks.length - 1];
- turnActive =
- tail?.kind === "user" ||
- (tail?.kind === "agent" && !tail.complete) ||
- tail?.kind === "tool";
- }
-
- return {
- blocks: folded.blocks,
- connected: true,
- turnActive,
- awaitingInput: folded.awaitingInput,
- error:
- folded.errorMessage ??
- (isSnapshot ? (update.errorMessage ?? null) : s.error),
- permissions,
- localEchoes: echoes,
- runStatus: status ?? s.runStatus,
- stage: isSnapshot ? (update.stage ?? s.stage) : s.stage,
- };
- });
-
- if (isSnapshot || folded.turnEnded) saveTranscript(taskId, folded.blocks);
-
- if (!isSnapshot && folded.turnEnded && session.turnActive) {
- Haptics.notificationAsync(
- folded.turnFailed
- ? Haptics.NotificationFeedbackType.Error
- : Haptics.NotificationFeedbackType.Success,
- ).catch(() => {});
- }
- };
-
- const watch = (taskId: string, runId: string): void => {
- const currentGeneration = generation;
- handles.get(taskId)?.stop();
- handles.set(
- taskId,
- watchRun(taskId, runId, (update) => {
- if (generation === currentGeneration) applyUpdate(taskId, update);
- }),
- );
- };
-
- const resumeRun = async (taskId: string, prompt: string): Promise<void> => {
- const currentGeneration = generation;
- const session = get().sessions[taskId];
- if (!session) return;
- log.info("Sandbox gone, resuming run", {
- taskId,
- previousRunId: session.runId,
- });
- const task = await getClient().runTaskInCloud(taskId, undefined, {
- resumeFromRunId: session.runId,
- pendingUserMessage: prompt,
- ...currentRunConfig(),
- });
- if (generation !== currentGeneration) return;
- const runId = task.latest_run?.id;
- if (!runId) throw new Error("Resume did not return a run");
- set((state) => ({
- sessions: {
- ...state.sessions,
- [taskId]: {
- ...emptySession(taskId, runId),
- blocks: state.sessions[taskId]?.blocks ?? [],
- turnActive: true,
- lastPrompt: prompt,
- resuming: true,
- },
- },
- }));
- watch(taskId, runId);
- };
-
- return {
- sessions: {},
-
- reset: () => {
- generation += 1;
- for (const handle of handles.values()) handle.stop();
- handles.clear();
- set({ sessions: {} });
- },
-
- startPending: (tempId, prompt, localId, images) => {
- set((state) => ({
- sessions: {
- ...state.sessions,
- [tempId]: {
- ...emptySession(tempId, ""),
- blocks: [{ kind: "user", id: localId, text: prompt, images }],
- runStatus: "queued",
- turnActive: true,
- localEchoes: new Set([prompt]),
- lastPrompt: prompt,
- },
- },
- }));
- },
-
- adopt: (tempId, task) => {
- const runId = task.latest_run?.id;
- const pending = get().sessions[tempId];
- if (!runId || !pending) return;
- set((state) => {
- const sessions = { ...state.sessions };
- delete sessions[tempId];
- sessions[task.id] = {
- ...pending,
- taskId: task.id,
- runId,
- runStatus: task.latest_run?.status ?? "queued",
- };
- return { sessions };
- });
- watch(task.id, runId);
- },
-
- failPending: (tempId, message) => {
- patch(tempId, () => ({ turnActive: false, error: message }));
- },
-
- connect: (task) => {
- const runId = task.latest_run?.id;
- if (!runId) return;
- const existing = get().sessions[task.id];
- if (existing?.runId === runId && handles.has(task.id)) return;
- set((state) => ({
- sessions: {
- ...state.sessions,
- // The saved chat shows at once; the live snapshot replaces it.
- [task.id]: {
- ...emptySession(task.id, runId),
- blocks: loadTranscript(task.id) ?? [],
- },
- },
- }));
- watch(task.id, runId);
- },
-
- disconnect: (taskId) => {
- const session = get().sessions[taskId];
- if (session) saveTranscript(taskId, session.blocks);
- handles.get(taskId)?.stop();
- handles.delete(taskId);
- },
-
- reconnect: () => {
- for (const handle of handles.values()) handle.reconnectIfDisconnected();
- },
-
- sendPrompt: async (
- taskId,
- text,
- localId = `local-${Date.now()}`,
- photos = [],
- ) => {
- const currentGeneration = generation;
- const session = get().sessions[taskId];
- if (!session) return null;
- const echoes = new Set(session.localEchoes);
- echoes.add(text);
- patch(taskId, (s) => {
- const blocks = [...s.blocks];
- closeOpenAgent(blocks);
- blocks.push({
- kind: "user",
- id: localId,
- text,
- images: photos.length ? photos.map((photo) => photo.uri) : undefined,
- });
- return {
- blocks,
- turnActive: true,
- awaitingInput: false,
- error: null,
- localEchoes: echoes,
- lastPrompt: text,
- };
- });
- Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light).catch(() => {});
- try {
- const artifactIds = await uploadRunPhotos(
- taskId,
- session.runId,
- photos,
- );
- if (artifactIds.length) {
- const sent = artifactIds.map((artifactId, index) => ({
- runId: session.runId,
- artifactId,
- name: photos[index].name,
- }));
- patch(taskId, (s) => ({
- blocks: s.blocks.map((block) =>
- block.id === localId && block.kind === "user"
- ? { ...block, photos: sent }
- : block,
- ),
- }));
- }
- await getClient().sendCloudRunCommand(
- taskId,
- session.runId,
- "user_message",
- artifactIds.length
- ? { content: text, artifact_ids: artifactIds }
- : { content: text },
- );
- } catch (error) {
- if (generation !== currentGeneration) return null;
- if (error instanceof CloudCommandError && runIsGone(error)) {
- patch(taskId, () => ({ resuming: true }));
- try {
- await resumeRun(taskId, text);
- } catch (resumeError) {
- if (generation !== currentGeneration) return null;
- patch(taskId, (s) => ({
- blocks: s.blocks.filter((block) => block.id !== localId),
- resuming: false,
- turnActive: false,
- error:
- resumeError instanceof Error
- ? resumeError.message
- : String(resumeError),
- }));
- throw resumeError;
- }
- return localId;
- }
- echoes.delete(text);
- // The composer gets the draft back, so drop the unsent bubble.
- patch(taskId, (s) => ({
- blocks: s.blocks.filter((block) => block.id !== localId),
- turnActive: false,
- error: error instanceof Error ? error.message : String(error),
- }));
- throw error;
- }
- return localId;
- },
-
- cancelTurn: async (taskId) => {
- const currentGeneration = generation;
- const session = get().sessions[taskId];
- if (!session) return;
- try {
- await getClient().sendCloudRunCommand(taskId, session.runId, "cancel");
- if (generation !== currentGeneration) return;
- patch(taskId, () => ({ turnActive: false }));
- } catch (error) {
- if (generation !== currentGeneration) return;
- patch(taskId, () => ({
- error: error instanceof Error ? error.message : String(error),
- }));
- }
- },
-
- stopRun: async (taskId) => {
- const currentGeneration = generation;
- const session = get().sessions[taskId];
- if (!session) return;
- await getClient().cancelTaskRun(taskId, session.runId);
- if (generation !== currentGeneration) return;
- patch(taskId, () => ({ turnActive: false, runStatus: "cancelled" }));
- },
-
- respondToPermission: async (taskId, toolCallId, optionId) => {
- const currentGeneration = generation;
- const session = get().sessions[taskId];
- const request = session?.permissions[toolCallId];
- if (!session || !request) return;
- patch(taskId, (s) => ({
- permissions: {
- ...s.permissions,
- [toolCallId]: { ...request, chosenOptionId: optionId },
- },
- turnActive: true,
- }));
- try {
- await getClient().sendCloudRunCommand(
- taskId,
- session.runId,
- "permission_response",
- {
- requestId: request.requestId,
- toolCallId,
- optionId,
- },
- );
- if (generation !== currentGeneration) return;
- patch(taskId, (s) => {
- const permissions = { ...s.permissions };
- delete permissions[toolCallId];
- return { permissions };
- });
- } catch (error) {
- if (generation !== currentGeneration) return;
- patch(taskId, (s) => ({
- permissions: { ...s.permissions, [toolCallId]: request },
- error: error instanceof Error ? error.message : String(error),
- }));
- }
- },
- };
-});
diff --git a/products/desktop/apps/mobilehog/src/lib/theme.ts b/products/desktop/apps/mobilehog/src/lib/theme.ts
deleted file mode 100644
index d022e3b0b1ff..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/theme.ts
+++ /dev/null
@@ -1,53 +0,0 @@
-import { colors as brand } from "@posthog/brand/colors";
-import { DynamicColorIOS } from "react-native";
-
-// Every token resolves per trait collection, so static stylesheets follow the
-// scheme without re-rendering. Light is posthog.com's tan and ink; dark inverts.
-const dyn = (light: string, dark: string) => DynamicColorIOS({ light, dark });
-
-export const colors = {
- bg: dyn("#EEEFE9", "#151515"),
- bgDeep: dyn("#E4E6DE", "#0C0C0C"),
- // Raised surfaces: a half step between the page and white.
- bgRaised: dyn("#F7F7F3", "#1C1C1C"),
- surface: dyn("#FFFFFF", "#222222"),
- ink: dyn("#151515", "#EEEFE9"),
- inkSoft: dyn("#4F5150", "#B8BAB4"),
- inkMute: dyn("#8F918D", "#7C7E7A"),
- line: dyn("rgba(21, 21, 21, 0.08)", "rgba(238, 239, 233, 0.10)"),
- fill: dyn("rgba(21, 21, 21, 0.06)", "rgba(238, 239, 233, 0.08)"),
- code: dyn("rgba(21, 21, 21, 0.05)", "rgba(238, 239, 233, 0.07)"),
- glass: dyn("rgba(255, 255, 255, 0.55)", "rgba(40, 40, 40, 0.55)"),
- glassTint: dyn("rgba(255, 255, 255, 0.75)", "rgba(34, 34, 34, 0.75)"),
- sceneTint: dyn("rgba(238, 239, 233, 0.72)", "rgba(21, 21, 21, 0.72)"),
- accent: brand.tangerine.core,
- danger: brand.coral.core,
- ok: brand.green.core,
- // High-contrast buttons: ink on tan, tan on ink.
- dark: dyn("#151515", "#EEEFE9"),
- darkText: dyn("#EEEFE9", "#151515"),
-};
-
-// RoundHog is the brand face; each weight is its own registered family.
-export const fonts = {
- sans: "RoundHog",
- sansMedium: "RoundHog-Medium",
- sansSemi: "RoundHog-SemiBold",
- sansBold: "RoundHog-Bold",
- sansItalic: "RoundHog-Italic",
- serif: "RoundHog-SemiBold",
- mono: "JetBrainsMono-Regular",
- monoMedium: "JetBrainsMono-Medium",
-};
-
-// Shared by the drawer layout and the shadow ghost behind the chat layer.
-export const drawer = {
- widthFraction: 0.82,
- sceneRadius: 44,
-};
-
-export const radius = {
- pill: 999,
- card: 24,
- bubble: 18,
-};
diff --git a/products/desktop/apps/mobilehog/src/lib/transcript.test.ts b/products/desktop/apps/mobilehog/src/lib/transcript.test.ts
deleted file mode 100644
index ba5741c53a5e..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/transcript.test.ts
+++ /dev/null
@@ -1,172 +0,0 @@
-import type { StoredLogEntry } from "@posthog/shared";
-import { describe, expect, it } from "vitest";
-import { type Block, foldEntries, promptPhotos } from "./transcript";
-
-const photoUri = (runId: string, artifactId: string, name: string) =>
- `file:///tmp/workspace/.posthog/attachments/${runId}/${artifactId}/${name}`;
-
-function promptEntry(prompt: unknown[]): StoredLogEntry {
- return {
- type: "notification",
- notification: { id: 1, method: "session/prompt", params: { prompt } },
- };
-}
-
-function userChunk(content: Record<string, unknown>): StoredLogEntry {
- return {
- type: "notification",
- notification: {
- method: "session/update",
- params: { update: { sessionUpdate: "user_message_chunk", content } },
- },
- };
-}
-
-const photoPrompt = [
- { type: "text", text: "what is this?" },
- {
- type: "resource_link",
- uri: photoUri("run-1", "artifact-1", "IMG_0001.jpg"),
- name: "IMG_0001.jpg",
- mimeType: "image/jpeg",
- },
-];
-
-// What the agent logs for a turn with a photo: the prompt, then its echo.
-const photoTurn = [
- promptEntry(photoPrompt),
- userChunk({ type: "text", text: "what is this?" }),
- userChunk(photoPrompt[1]),
-];
-
-const photo = {
- runId: "run-1",
- artifactId: "artifact-1",
- name: "IMG_0001.jpg",
-};
-
-describe("promptPhotos", () => {
- it("reads photos from visible attachment links and skips other files", () => {
- const result = promptPhotos([
- { type: "text", text: "look", _meta: { ui: { hidden: true } } },
- { type: "text", text: "at these" },
- {
- type: "resource_link",
- uri: photoUri("run-1", "artifact-1", "IMG_0001.HEIC"),
- name: "IMG_0001.HEIC",
- },
- {
- type: "resource_link",
- uri: photoUri("run-1", "artifact-3", "IMG_0002.jpg"),
- name: "IMG_0002.jpg",
- _meta: { ui: { hidden: true } },
- },
- {
- type: "resource_link",
- uri: photoUri("run-1", "artifact-2", "notes.pdf"),
- name: "notes.pdf",
- },
- { type: "resource_link", uri: "file:///repo/cat.png", name: "cat.png" },
- ]);
-
- expect(result).toEqual({
- text: "at these",
- texts: ["at these"],
- photos: [
- { runId: "run-1", artifactId: "artifact-1", name: "IMG_0001.HEIC" },
- ],
- });
- });
-});
-
-describe("foldEntries with photos", () => {
- it("rebuilds a user message with its photos from the log", () => {
- const result = foldEntries([], photoTurn, new Set());
-
- expect(result.blocks).toEqual([
- expect.objectContaining({
- kind: "user",
- text: "what is this?",
- photos: [photo],
- }),
- ]);
- expect(result.externalUserMessages).toBe(1);
- });
-
- it("rebuilds a photo-only message", () => {
- const result = foldEntries(
- [],
- [promptEntry([photoPrompt[1]]), userChunk(photoPrompt[1])],
- new Set(),
- );
-
- expect(result.blocks).toEqual([
- expect.objectContaining({ kind: "user", text: "", photos: [photo] }),
- ]);
- });
-
- it("adds the photos to a message sent from this device", () => {
- const sent: Block = {
- kind: "user",
- id: "local-1",
- text: "what is this?",
- images: ["file:///picker/IMG_0001.jpg"],
- };
- const echoes = new Set(["what is this?"]);
-
- const result = foldEntries([sent], photoTurn, echoes);
-
- expect(result.blocks).toEqual([{ ...sent, photos: [photo] }]);
- expect(result.externalUserMessages).toBe(0);
- expect(echoes.size).toBe(0);
- });
-
- it("keeps photos already known for a sent message", () => {
- const known = { ...photo, artifactId: "artifact-9" };
- const sent: Block = {
- kind: "user",
- id: "local-1",
- text: "what is this?",
- photos: [known],
- };
-
- const result = foldEntries([sent], photoTurn, new Set(["what is this?"]));
-
- expect(result.blocks).toEqual([sent]);
- });
-
- it("clears the echo of a photo-only message sent from this device", () => {
- const sent: Block = { kind: "user", id: "local-1", text: "" };
- const echoes = new Set([""]);
-
- const result = foldEntries([sent], [promptEntry([photoPrompt[1]])], echoes);
-
- expect(result.blocks).toEqual([{ ...sent, photos: [photo] }]);
- expect(echoes.size).toBe(0);
- });
-
- it("matches the prompt and its echo across batches", () => {
- const echoes = new Set<string>();
- const first = foldEntries([], [promptEntry(photoPrompt)], echoes);
- const second = foldEntries(first.blocks, photoTurn.slice(1), echoes);
-
- expect(second.blocks).toHaveLength(1);
- expect(second.externalUserMessages).toBe(0);
- });
-
- it("leaves text-only prompts to the message echo", () => {
- const result = foldEntries(
- [],
- [
- promptEntry([{ type: "text", text: "hello" }]),
- userChunk({ type: "text", text: "hello" }),
- ],
- new Set(),
- );
-
- expect(result.blocks).toEqual([
- expect.objectContaining({ kind: "user", text: "hello" }),
- ]);
- expect(result.blocks[0]).not.toHaveProperty("photos");
- });
-});
diff --git a/products/desktop/apps/mobilehog/src/lib/transcript.ts b/products/desktop/apps/mobilehog/src/lib/transcript.ts
deleted file mode 100644
index 4c2b8b68a40a..000000000000
--- a/products/desktop/apps/mobilehog/src/lib/transcript.ts
+++ /dev/null
@@ -1,382 +0,0 @@
-import { extractPromptDisplayContent } from "@posthog/core/sessions/promptContent";
-import type { StoredLogEntry } from "@posthog/shared";
-import { isIdleResumeTurnComplete, isRasterImageFile } from "@posthog/shared";
-
-export type ToolStatus = "pending" | "running" | "completed" | "failed";
-
-export interface PlanEntry {
- content: string;
- status: "pending" | "in_progress" | "completed" | "failed";
- priority?: string;
-}
-
-// A photo the person sent, stored as a run artifact.
-export interface PhotoRef {
- runId: string;
- artifactId: string;
- name: string;
-}
-
-export type Block =
- | {
- kind: "user";
- id: string;
- text: string;
- // Local picker URIs, shown until the sent photos are known.
- images?: string[];
- photos?: PhotoRef[];
- }
- | { kind: "agent"; id: string; text: string; complete: boolean }
- | { kind: "thought"; id: string; text: string; at: number }
- | {
- kind: "tool";
- id: string;
- title: string;
- toolName?: string;
- status: ToolStatus;
- input?: Record<string, unknown>;
- output?: unknown;
- parentId?: string;
- // Epoch ms of the first and latest log entries for this call.
- at: number;
- updatedAt: number;
- }
- | { kind: "plan"; id: string; entries: PlanEntry[] };
-
-interface SessionUpdate {
- sessionUpdate?: string;
- content?: { type: string; text: string };
- title?: string;
- toolCallId?: string;
- status?: "pending" | "in_progress" | "completed" | "failed" | null;
- rawInput?: Record<string, unknown>;
- rawOutput?: unknown;
- entries?: PlanEntry[];
- _meta?: { claudeCode?: { toolName?: string; parentToolCallId?: string } };
-}
-
-export interface PermissionOption {
- kind: string;
- optionId: string;
- name: string;
-}
-
-export interface PermissionRequest {
- requestId: string;
- toolCallId: string;
- title: string;
- input?: Record<string, unknown>;
- options: PermissionOption[];
- chosenOptionId?: string;
-}
-
-export interface FoldResult {
- blocks: Block[];
- // Signals for turn state, so the store does not re-walk entries.
- turnEnded: boolean;
- turnFailed: boolean;
- awaitingInput: boolean;
- externalUserMessages: number;
- // Permission requests replayed from the log, for reopened tasks.
- permissionRequests: PermissionRequest[];
- resolvedRequestIds: string[];
- errorMessage: string | null;
-}
-
-let counter = 0;
-function nextId(prefix: string): string {
- counter += 1;
- return `${prefix}-${counter}`;
-}
-
-function mapToolStatus(status: SessionUpdate["status"]): ToolStatus {
- switch (status) {
- case "in_progress":
- return "running";
- case "completed":
- return "completed";
- case "failed":
- return "failed";
- default:
- return "pending";
- }
-}
-
-function entryTime(entry: StoredLogEntry): number {
- const parsed = entry.timestamp ? Date.parse(entry.timestamp) : Number.NaN;
- return Number.isFinite(parsed) ? parsed : Date.now();
-}
-
-function last(blocks: Block[]): Block | undefined {
- return blocks[blocks.length - 1];
-}
-
-type PromptBlock = Parameters<typeof extractPromptDisplayContent>[0][number];
-
-// iOS photo names can end in .HEIC, which React Native renders.
-function isPhotoName(name: string): boolean {
- return isRasterImageFile(name) || /\.hei[cf]$/i.test(name);
-}
-
-export function promptPhotos(prompt: PromptBlock[]): {
- text: string;
- texts: string[];
- photos: PhotoRef[];
-} {
- // An upstream retry resends every block of the prompt as hidden, photo links
- // too, so hidden blocks must not add the photos again.
- const visible = prompt.filter(
- (block) =>
- !(block._meta as { ui?: { hidden?: boolean } } | undefined)?.ui?.hidden,
- );
- const { text, attachments } = extractPromptDisplayContent(visible);
- const texts = visible.flatMap((block) =>
- block.type === "text" && block.text ? [block.text] : [],
- );
- const photos = attachments.flatMap((attachment) =>
- attachment.cloudArtifact && isPhotoName(attachment.label)
- ? [{ ...attachment.cloudArtifact, name: attachment.label }]
- : [],
- );
- return { text, texts, photos };
-}
-
-export function closeOpenAgent(blocks: Block[]): void {
- const open = last(blocks);
- if (open?.kind === "agent" && !open.complete) {
- blocks[blocks.length - 1] = { ...open, complete: true };
- }
-}
-
-// Folds a batch of log entries into the block list. Consecutive agent chunks
-// append to the open agent block, so streaming updates in place.
-export function foldEntries(
- previous: Block[],
- entries: StoredLogEntry[],
- localEchoes: Set<string>,
-): FoldResult {
- const blocks = [...previous];
- const result: FoldResult = {
- blocks,
- turnEnded: false,
- turnFailed: false,
- awaitingInput: false,
- externalUserMessages: 0,
- permissionRequests: [],
- resolvedRequestIds: [],
- errorMessage: null,
- };
-
- for (const entry of entries) {
- const method = entry.notification?.method;
- if (!method) continue;
-
- if (method === "_posthog/turn_complete") {
- if (!isIdleResumeTurnComplete(entry)) {
- result.turnEnded = true;
- closeOpenAgent(blocks);
- }
- continue;
- }
- if (method === "_posthog/task_complete") {
- result.turnEnded = true;
- closeOpenAgent(blocks);
- continue;
- }
- if (method === "_posthog/awaiting_user_input") {
- result.turnEnded = true;
- result.awaitingInput = true;
- closeOpenAgent(blocks);
- continue;
- }
- if (method === "_posthog/error") {
- result.turnEnded = true;
- result.turnFailed = true;
- const params = entry.notification?.params as
- | { message?: string; error?: string }
- | undefined;
- result.errorMessage = params?.message ?? params?.error ?? "Agent error";
- continue;
- }
- if (method === "_posthog/permission_request") {
- const params = entry.notification?.params as
- | {
- requestId?: string;
- toolCallId?: string;
- toolCall?: {
- toolCallId?: string;
- title?: string;
- rawInput?: Record<string, unknown>;
- };
- options?: PermissionOption[];
- }
- | undefined;
- const toolCallId = params?.toolCallId ?? params?.toolCall?.toolCallId;
- if (params?.requestId && toolCallId) {
- result.permissionRequests.push({
- requestId: params.requestId,
- toolCallId,
- title: params.toolCall?.title ?? "Permission needed",
- input: params.toolCall?.rawInput,
- options: params.options ?? [],
- });
- }
- continue;
- }
- if (method === "_posthog/permission_resolved") {
- const params = entry.notification?.params as
- | { requestId?: string }
- | undefined;
- if (params?.requestId) result.resolvedRequestIds.push(params.requestId);
- continue;
- }
- // Only the prompt request links the attachments for every agent, so a turn
- // with photos is built from it and the text echo that follows is skipped.
- if (method === "session/prompt") {
- const prompt = (entry.notification?.params as { prompt?: unknown })
- ?.prompt;
- if (!Array.isArray(prompt)) continue;
- const { text, texts, photos } = promptPhotos(prompt as PromptBlock[]);
- if (!photos.length) continue;
- if (localEchoes.has(text)) {
- const index = blocks.findLastIndex(
- (block) => block.kind === "user" && block.text === text,
- );
- const sent = blocks[index];
- if (sent?.kind === "user" && !sent.photos) {
- blocks[index] = { ...sent, photos };
- }
- if (!text) localEchoes.delete(text);
- continue;
- }
- result.externalUserMessages += 1;
- closeOpenAgent(blocks);
- blocks.push({ kind: "user", id: nextId("user"), text, photos });
- for (const chunk of texts) localEchoes.add(chunk);
- continue;
- }
- if (method !== "session/update") continue;
-
- const update = (entry.notification?.params as { update?: SessionUpdate })
- ?.update;
- if (!update?.sessionUpdate) continue;
-
- switch (update.sessionUpdate) {
- case "user_message_chunk": {
- const text = update.content?.text ?? "";
- if (!text) break;
- if (localEchoes.has(text)) {
- localEchoes.delete(text);
- break;
- }
- result.externalUserMessages += 1;
- closeOpenAgent(blocks);
- blocks.push({ kind: "user", id: nextId("user"), text });
- break;
- }
- case "agent_message_chunk": {
- const text = update.content?.text;
- if (!text) break;
- const open = last(blocks);
- if (open?.kind === "agent" && !open.complete) {
- blocks[blocks.length - 1] = { ...open, text: open.text + text };
- } else {
- blocks.push({
- kind: "agent",
- id: nextId("agent"),
- text,
- complete: false,
- });
- }
- break;
- }
- case "agent_message": {
- const text = update.content?.text;
- if (!text) break;
- const open = last(blocks);
- if (open?.kind === "agent" && !open.complete) {
- blocks[blocks.length - 1] = { ...open, text, complete: true };
- } else {
- blocks.push({
- kind: "agent",
- id: nextId("agent"),
- text,
- complete: true,
- });
- }
- break;
- }
- case "agent_thought_chunk": {
- const text = update.content?.text;
- if (!text) break;
- const open = last(blocks);
- if (open?.kind === "thought") {
- blocks[blocks.length - 1] = { ...open, text: open.text + text };
- } else {
- blocks.push({
- kind: "thought",
- id: nextId("thought"),
- text,
- at: entryTime(entry),
- });
- }
- break;
- }
- case "tool_call":
- case "tool_call_update": {
- const toolCallId = update.toolCallId;
- if (!toolCallId) break;
- const meta = update._meta?.claudeCode;
- const index = blocks.findIndex(
- (block) => block.kind === "tool" && block.id === toolCallId,
- );
- const existing =
- index >= 0 ? (blocks[index] as Block & { kind: "tool" }) : null;
- const merged: Block = {
- kind: "tool",
- id: toolCallId,
- title: update.title ?? existing?.title ?? meta?.toolName ?? "Tool",
- toolName: meta?.toolName ?? existing?.toolName,
- status: update.status
- ? mapToolStatus(update.status)
- : (existing?.status ?? "pending"),
- input: update.rawInput ?? existing?.input,
- output:
- update.rawOutput !== undefined
- ? update.rawOutput
- : existing?.output,
- parentId: meta?.parentToolCallId ?? existing?.parentId,
- at: existing?.at ?? entryTime(entry),
- updatedAt: entryTime(entry),
- };
- if (existing) {
- blocks[index] = merged;
- } else {
- // Close any streaming agent text so the next chunk starts a new bubble.
- const open = last(blocks);
- if (open?.kind === "agent" && !open.complete) {
- blocks[blocks.length - 1] = { ...open, complete: true };
- }
- blocks.push(merged);
- }
- break;
- }
- case "plan": {
- if (!Array.isArray(update.entries)) break;
- const index = blocks.findIndex((block) => block.kind === "plan");
- const plan: Block = {
- kind: "plan",
- id: "plan",
- entries: update.entries,
- };
- if (index >= 0) blocks[index] = plan;
- else blocks.push(plan);
- break;
- }
- default:
- break;
- }
- }
-
- return result;
-}
diff --git a/products/desktop/apps/mobilehog/tsconfig.json b/products/desktop/apps/mobilehog/tsconfig.json
deleted file mode 100644
index bb3be0e2cf8a..000000000000
--- a/products/desktop/apps/mobilehog/tsconfig.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "extends": "expo/tsconfig.base",
- "compilerOptions": {
- "strict": true,
- "baseUrl": "./src",
- "paths": {
- "@/*": ["./*"]
- }
- },
- "include": ["src/**/*.ts", "src/**/*.tsx"]
-}
diff --git a/products/desktop/apps/mobilehog/vitest.config.ts b/products/desktop/apps/mobilehog/vitest.config.ts
deleted file mode 100644
index efc3e2036956..000000000000
--- a/products/desktop/apps/mobilehog/vitest.config.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import path from "node:path";
-import { defineConfig } from "vitest/config";
-import { trunkTestOptions } from "../../vitest.config.base";
-
-export default defineConfig({
- test: {
- ...trunkTestOptions,
- environment: "node",
- },
- resolve: {
- alias: {
- "@": path.resolve(__dirname, "./src"),
- },
- },
-});
diff --git a/products/desktop/biome.jsonc b/products/desktop/biome.jsonc
index 140621961463..8bc84268580c 100644
--- a/products/desktop/biome.jsonc
+++ b/products/desktop/biome.jsonc
@@ -101,10 +101,7 @@
},
{
// Files using unknownAtRules
- "includes": [
- "packages/ui/src/styles/globals.css",
- "apps/mobile/global.css"
- ],
+ "includes": ["packages/ui/src/styles/globals.css"],
"linter": {
"enabled": false
}
diff --git a/products/desktop/docs/README.md b/products/desktop/docs/README.md
index 226214330dca..184296fafea6 100644
--- a/products/desktop/docs/README.md
+++ b/products/desktop/docs/README.md
@@ -46,7 +46,7 @@ These documents capture design intent at a point in time. Check the current code
## App and package guides
- [Electron desktop app](../apps/code/README.md)
-- [Mobile app](../apps/mobile/README.md)
+- [Proposed independent mobile app](https://github.com/PostHog/posthog/pull/118584)
- [Web app](../apps/web/README.md)
- [Agent framework](../../../packages/agent/packages/agent/README.md)
- [Harness](../../../packages/agent/packages/harness/README.md)
diff --git a/products/desktop/docs/SELF-DRIVING-REPORTS.md b/products/desktop/docs/SELF-DRIVING-REPORTS.md
index 1e0d26618f40..1dde4e872955 100644
--- a/products/desktop/docs/SELF-DRIVING-REPORTS.md
+++ b/products/desktop/docs/SELF-DRIVING-REPORTS.md
@@ -54,18 +54,6 @@ Hover opens the user list without moving keyboard focus. Click the search field
The search starts empty and shows up to 20 options, including For you and Entire project.
Search by name or email across all users. The search field stays visible above the results.
-## Mobile report tasks
-
-Discuss starts a discussion task and forwards the question to the report's scout.
-Create PR starts an implementation task. Both actions use the report's repository and team GitHub integration, resolved by the server.
-The mobile report composer does not require a personal GitHub connection or offer a repository picker.
-If cloud startup fails after task creation, retrying in the same composer or triage view starts the existing task instead of creating another task.
-Triage resets the swiped card if configuration is not ready or task startup fails.
-An ordinary new task still requires a repository from the user's GitHub integration.
-
-The report detail and triage views use the same implementation prompt. The agent fetches the report and checks for an existing PR before starting new work.
-Triage advances only after the cloud run starts. A failed submission keeps the report available and shows the error.
-
## Storybook previews
The `Inbox/Reports` stories cover the sidebar, report list, report detail, and triage mode.
diff --git a/products/desktop/knip.json b/products/desktop/knip.json
index 73341ca93753..f08cc0b93c2d 100644
--- a/products/desktop/knip.json
+++ b/products/desktop/knip.json
@@ -96,25 +96,6 @@
"apps/web": {
"project": ["src/**/*.{ts,tsx}"],
"ignoreDependencies": ["tailwindcss"]
- },
- "apps/mobile": {
- "entry": ["src/**/*.{ts,tsx}"],
- "project": ["src/**/*.{ts,tsx}"],
- "ignoreDependencies": [
- "@expo/ui",
- "expo-crypto",
- "expo-dev-client",
- "expo-font",
- "expo-glass-effect",
- "expo-splash-screen",
- "expo-system-ui",
- "react-native-svg-transformer"
- ],
- "ignoreBinaries": ["eas"],
- "metro": false,
- "expo": false,
- "babel": false,
- "tailwind": false
}
},
"rules": {
diff --git a/products/desktop/mprocs.yaml b/products/desktop/mprocs.yaml
index aaf8be36c790..c0e526f97a70 100644
--- a/products/desktop/mprocs.yaml
+++ b/products/desktop/mprocs.yaml
@@ -37,12 +37,6 @@ procs:
groups:
layer: Tools
- mobile-ios:
- shell: 'node scripts/pnpm-run.mjs --filter @posthog/mobile run ios'
- autostart: false
- groups:
- layer: Application
-
chromium-log:
shell: 'tail -F ~/.posthog-code/logs-dev/chromium.log'
groups:
diff --git a/products/desktop/packages/ui/src/features/inbox/AGENTS.md b/products/desktop/packages/ui/src/features/inbox/AGENTS.md
index c8541e552d7c..3567b6b51a3c 100644
--- a/products/desktop/packages/ui/src/features/inbox/AGENTS.md
+++ b/products/desktop/packages/ui/src/features/inbox/AGENTS.md
@@ -195,7 +195,7 @@ The shared renderer type for the report is `SignalReport` in `packages/agent/pac
Report charts: `SignalReport.charts` carries scout-authored chart definitions (`chart_id`, `title`, `query`, `caption?`, `size?`). The desktop app renders them natively in the detail views: `packages/core/src/inbox/reportCharts.ts` classifies the stored query (runnable HogQL/trends vs saved-insight vs link-out fallback), `PostHogAPIClient.runQuery` executes runnable sources against `/api/projects/{teamId}/query/`, and `components/detail/ReportChartCard.tsx` draws the result with `@posthog/quill-charts`. Query kinds the app can't draw degrade to a card that links out to PostHog. Summary prose references charts as `[label](chart:<chart_id>)` links; `SignalReportSummaryMarkdown` turns those into in-page jumps to the chart card (plain text on list rows).
-PR refunds: `POST /api/projects/{teamId}/signals/reports/{id}/refund/` refunds a billed PR and archives the report (`PostHogAPIClient.refundSignalReport`). The action is gated behind the `signals-pr-refunds` flag (`SIGNALS_PR_REFUNDS_FLAG`) and `@posthog/core/inbox/refundEligibility`'s `computeRefundEligibility` (shared with the mobile host), which reads `implementation_pr_url`, `refund` (one `SignalReportRefund` per report, ever), `billing_exempt_reason`, and the backend-owned `refund_ineligibility_reason`. The server enforces the same rules, so the gate is display-only; `ReportDetailActions` shows no refund action when the report is ineligible.
+PR refunds: `POST /api/projects/{teamId}/signals/reports/{id}/refund/` refunds a billed PR and archives the report (`PostHogAPIClient.refundSignalReport`). The action is gated behind the `signals-pr-refunds` flag (`SIGNALS_PR_REFUNDS_FLAG`) and `@posthog/core/inbox/refundEligibility`'s `computeRefundEligibility`, which reads `implementation_pr_url`, `refund` (one `SignalReportRefund` per report, ever), `billing_exempt_reason`, and the backend-owned `refund_ineligibility_reason`. The server enforces the same rules, so the gate is display-only; `ReportDetailActions` shows no refund action when the report is ineligible.
Card headlines are derived client-side from `summary` by `utils/reportPresentation.ts`; there is no backend headline field.
diff --git a/products/desktop/patches/react-native-drawer-layout.patch b/products/desktop/patches/react-native-drawer-layout.patch
deleted file mode 100644
index ad92bc118256..000000000000
--- a/products/desktop/patches/react-native-drawer-layout.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-diff --git a/lib/module/views/Drawer.native.js b/lib/module/views/Drawer.native.js
---- a/lib/module/views/Drawer.native.js
-+++ b/lib/module/views/Drawer.native.js
-@@ -138,7 +138,7 @@
- velocity,
- stiffness: 1000,
- damping: 500,
-- mass: 3,
-+ mass: 1,
- overshootClamping: true,
- reduceMotion: ReduceMotion.Never
- }, finished => runOnJS(onAnimationEnd)(open, finished));
-@@ -328,7 +328,7 @@
- // But adding `overflowX: 'hidden'` prevents content from collapsing the URL bar.
- web: null,
- default: {
-- overflow: 'hidden'
-+ overflow: 'visible'
- }
- })
- }
-diff --git a/src/views/Drawer.native.tsx b/src/views/Drawer.native.tsx
---- a/src/views/Drawer.native.tsx
-+++ b/src/views/Drawer.native.tsx
-@@ -193,7 +193,7 @@
- velocity,
- stiffness: 1000,
- damping: 500,
-- mass: 3,
-+ mass: 1,
- overshootClamping: true,
- reduceMotion: ReduceMotion.Never,
- },
-@@ -524,7 +524,7 @@
- // FIXME: We need to hide `overflowX` on Web so the translated content doesn't show offscreen.
- // But adding `overflowX: 'hidden'` prevents content from collapsing the URL bar.
- web: null,
-- default: { overflow: 'hidden' },
-+ default: { overflow: 'visible' },
- }),
- },
- });
diff --git a/products/desktop/pnpm-lock.yaml b/products/desktop/pnpm-lock.yaml
index 68d89cc2def5..d48cdda934d5 100644
--- a/products/desktop/pnpm-lock.yaml
+++ b/products/desktop/pnpm-lock.yaml
@@ -106,7 +106,6 @@ patchedDependencies:
[email protected]: 4688f96749e3d76cf27bc535d874470bf264610a331db13644df7715d699acf1
node-pty: 4dfdf785f5ac51a03f5d6032371cebe89036381acd403621f250a896245647c5
react-hotkeys-hook: a8cd00b963d4ae6787cc267a2345cc1b32bcba5fa1131328b8017ee0d316ab0e
- react-native-drawer-layout: 2c85d47b8c522e96ada8afb04ee4070d68146adf9d4e3ce6e2d5eae27dd4e0bc
importers:
@@ -414,368 +413,6 @@ importers:
specifier: ^2.9.0
version: 2.9.0
- apps/mobile:
- dependencies:
- '@expo/metro-runtime':
- specifier: ~57.0.7
- '@expo/ui':
- specifier: 57.0.7
- '@modelcontextprotocol/ext-apps':
- specifier: ^1.2.2
- '@modelcontextprotocol/sdk':
- specifier: ^1.29.0
- '@posthog/api-client':
- specifier: workspace:*
- version: link:../../packages/api-client
- '@posthog/core':
- specifier: workspace:*
- version: link:../../packages/core
- '@posthog/react-native-plugin':
- specifier: ^2.13.0
- '@posthog/shared':
- specifier: workspace:*
- version: link:../../packages/shared
- '@react-native-async-storage/async-storage':
- specifier: ^2.2.0
- '@react-native-community/netinfo':
- specifier: ^12.0.1
- '@tanstack/react-query':
- specifier: ^5.90.12
- version: 5.90.20([email protected])
- date-fns:
- specifier: ^4.1.0
- version: 4.1.0
- expo:
- specifier: ~57.0.8
- version: 57.0.8(cece98f32a2022c0430d630815af4720)
- expo-application:
- specifier: ~57.0.2
- version: 57.0.2([email protected])
- expo-audio:
- specifier: ~57.0.3
- expo-auth-session:
- specifier: ^57.0.5
- expo-camera:
- specifier: ^57.0.3
- expo-clipboard:
- specifier: ^57.0.1
- expo-constants:
- specifier: ~57.0.7
- expo-crypto:
- specifier: ^57.0.1
- version: 57.0.1([email protected])
- expo-dev-client:
- specifier: ~57.0.9
- expo-device:
- specifier: ~57.0.1
- version: 57.0.1([email protected])
- expo-document-picker:
- specifier: ~57.0.1
- version: 57.0.1([email protected])
- expo-file-system:
- specifier: ~57.0.1
- expo-font:
- specifier: ^57.0.1
- expo-glass-effect:
- specifier: ~57.0.1
- expo-haptics:
- specifier: ^57.0.1
- version: 57.0.1([email protected])
- expo-image-picker:
- specifier: ~57.0.6
- version: 57.0.6([email protected])
- expo-linear-gradient:
- specifier: ^57.0.1
- expo-linking:
- specifier: ~57.0.4
- expo-localization:
- specifier: ~57.0.1
- expo-notifications:
- specifier: ~57.0.7
- expo-router:
- specifier: ~57.0.8
- version: 57.0.8(aeaf345642587960b4671195b62009d3)
- expo-secure-store:
- specifier: ^57.0.1
- version: 57.0.1([email protected])
- expo-speech-recognition:
- specifier: ^56.0.1
- expo-splash-screen:
- specifier: ~57.0.5
- expo-status-bar:
- specifier: ~57.0.1
- expo-system-ui:
- specifier: ~57.0.1
- expo-video:
- specifier: ~57.0.3
- expo-web-browser:
- specifier: ^57.0.2
- highlight.js:
- specifier: ^11.11.1
- version: 11.11.1
- nativewind:
- specifier: ^4.2.1
- version: 4.2.1(cdede081bba1d0b3a72e545f4ba8514a)
- phosphor-react-native:
- specifier: ^3.0.2
- posthog-react-native:
- specifier: ^4.83.0
- version: 4.83.0(c26a19fc3594f2db3c6353d64e9ae4e7)
- react:
- specifier: 19.2.6
- version: 19.2.6
- react-dom:
- specifier: 19.2.6
- version: 19.2.6([email protected])
- react-native:
- specifier: 0.86.0
- react-native-keyboard-controller:
- specifier: 1.21.9
- react-native-reanimated:
- specifier: ~4.5.0
- react-native-safe-area-context:
- specifier: ~5.7.0
- react-native-screens:
- specifier: ~4.26.2
- react-native-svg:
- specifier: ^15.15.4
- react-native-web:
- specifier: ^0.21.2
- react-native-webview:
- specifier: ^13.16.1
- react-native-worklets:
- specifier: 0.10.0
- zustand:
- specifier: ^4.5.7
- devDependencies:
- '@testing-library/react-native':
- specifier: ^13.3.3
- '@types/react':
- specifier: ^19.2.15
- version: 19.2.17
- '@types/react-test-renderer':
- specifier: ^19.1.0
- version: 19.1.0
- '@vitejs/plugin-react':
- specifier: ^4.7.0
- react-native-svg-transformer:
- specifier: ^1.5.3
- react-test-renderer:
- specifier: 19.2.6
- version: 19.2.6([email protected])
- tailwindcss:
- specifier: ^3.4.18
- typescript:
- specifier: ~5.9.2
- version: 5.9.3
- vite:
- specifier: npm:[email protected]
- vitest:
- specifier: ^4.1.6
-
- apps/mobilehog:
- dependencies:
- '@expo/metro-runtime':
- specifier: ~57.0.15
- '@expo/ui':
- specifier: ~57.0.7
- '@modelcontextprotocol/ext-apps':
- specifier: ^1.2.2
- '@modelcontextprotocol/sdk':
- specifier: ^1.29.0
- '@posthog/api-client':
- specifier: workspace:*
- version: link:../../packages/api-client
- '@posthog/brand':
- specifier: 'catalog:'
- version: 0.11.0([email protected])
- '@posthog/core':
- specifier: workspace:*
- version: link:../../packages/core
- '@posthog/shared':
- specifier: workspace:*
- version: link:../../packages/shared
- '@shopify/flash-list':
- specifier: 2.0.2
- '@tanstack/query-sync-storage-persister':
- specifier: 5.101.0
- version: 5.101.0
- '@tanstack/react-query':
- specifier: ^5.90.12
- version: 5.101.0([email protected])
- '@tanstack/react-query-persist-client':
- specifier: 5.101.0
- expo:
- specifier: 57.0.23
- version: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
- expo-auth-session:
- specifier: ~57.0.5
- expo-constants:
- specifier: ~57.0.18
- expo-crypto:
- specifier: ~57.0.1
- version: 57.0.1([email protected])
- expo-dev-client:
- specifier: ~57.0.19
- expo-device:
- specifier: ~57.0.2
- version: 57.0.2([email protected])
- expo-file-system:
- specifier: ~57.0.7
- expo-font:
- specifier: ~57.0.4
- expo-glass-effect:
- specifier: ~57.0.3
- expo-haptics:
- specifier: ~57.0.3
- version: 57.0.3([email protected])
- expo-image-picker:
- specifier: ~57.0.6
- version: 57.0.6([email protected])
- expo-linking:
- specifier: ~57.0.10
- expo-network:
- specifier: ~57.0.2
- expo-notifications:
- specifier: ~57.0.19
- expo-router:
- specifier: ~57.0.21
- version: 57.0.23(691084568689e210f8e7fee390d1f6f1)
- expo-secure-store:
- specifier: ~57.0.4
- version: 57.0.4([email protected])
- expo-speech-recognition:
- specifier: 56.0.1
- expo-splash-screen:
- specifier: ~57.0.9
- expo-status-bar:
- specifier: ~57.0.1
- expo-system-ui:
- specifier: ~57.0.4
- expo-updates:
- specifier: ~57.0.22
- expo-web-browser:
- specifier: ~57.0.2
- marked:
- specifier: 16.4.2
- version: 16.4.2
- mermaid:
- specifier: ^11.17.0
- version: 11.17.0
- react:
- specifier: 19.2.6
- version: 19.2.6
- react-dom:
- specifier: 19.2.6
- version: 19.2.6([email protected])
- react-native:
- specifier: 0.86.0
- react-native-gesture-handler:
- specifier: ~2.32.0
- react-native-keyboard-controller:
- specifier: 1.21.9
- react-native-mmkv:
- specifier: 4.3.2
- react-native-nitro-modules:
- specifier: 0.37.1
- react-native-reanimated:
- specifier: ~4.5.0
- react-native-safe-area-context:
- specifier: ~5.7.0
- react-native-screens:
- specifier: ~4.26.2
- react-native-webview:
- specifier: 13.16.1
- react-native-worklets:
- specifier: 0.10.0
- zustand:
- specifier: ^4.5.7
- devDependencies:
- '@types/react':
- specifier: ^19.2.15
- version: 19.2.17
- typescript:
- specifier: ~5.9.2
- version: 5.9.3
- vitest:
- specifier: ^4.1.8
-
apps/web:
dependencies:
'@agentclientprotocol/sdk':
@@ -1710,10 +1347,6 @@ packages:
peerDependencies:
zod: 4.4.3
- '@alloc/[email protected]':
- resolution: {integrity: sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==}
- engines: {node: '>=10'}
-
resolution: {integrity: sha512-MGQsmw10ZyI+EJo45CdSER4zEb+p31LpDAFp2Z3gkSd1yqVZGi0Ebx++YTEMonJy4oChEMLsxZ64j8FH6sSqtQ==}
@@ -1909,10 +1542,6 @@ packages:
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'}
@@ -1921,110 +1550,24 @@ 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'}
-
- '@babel/[email protected]':
- 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'}
-
- '@babel/[email protected]':
- resolution: {integrity: sha512-dTOdvsjnG3xNT9Y0AUg1wAl38y+4Rl4sf9caSQZOXdNqVn+H+HbbJ4IyyHaIqNR6SW9oJpA/RuRjsjCw2IdIow==}
- engines: {node: '>=6.9.0'}
- peerDependencies:
- '@babel/core': ^7.0.0
-
- '@babel/[email protected]':
- resolution: {integrity: sha512-RpLYy2sb51oNLjuu1iD3bwBqCBWUzjO0ocp+iaCP/lJtb2CPLcnC2Fftw+4sAzaMELGeWTgExSKADbdo0GFVzA==}
- engines: {node: '>=6.9.0'}
- 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
-
- '@babel/[email protected]':
- 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
-
- '@babel/[email protected]':
- 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'}
-
- '@babel/[email protected]':
- 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
-
- '@babel/[email protected]':
- 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'}
@@ -2033,38 +1576,6 @@ packages:
resolution: {integrity: sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw==}
engines: {node: '>=6.9.0'}
- '@babel/[email protected]':
- 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
-
- '@babel/[email protected]':
- 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
-
- '@babel/[email protected]':
- 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'}
@@ -2085,18 +1596,6 @@ 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'}
-
- '@babel/[email protected]':
- 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'}
@@ -2111,24 +1610,6 @@ packages:
engines: {node: '>=6.0.0'}
hasBin: true
- '@babel/[email protected]':
- resolution: {integrity: sha512-CVBVv3VY/XRMxRYq5dwr2DS7/MvqPm23cOCjbwNnVrfOqcWlnefua1uUs0sjdKOGjvPUG633o07uWzJq4oI6dA==}
- engines: {node: '>=6.9.0'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
-
- '@babel/[email protected]':
- resolution: {integrity: sha512-hjlsMBl1aJc5lp8MoCDEZCiYzlgdRAShOjAfRw6X+GlpLpUPU7c3XNLsKFZbQk/1cRzBlJ7CXg3xJAJMrFa1Uw==}
- engines: {node: '>=6.9.0'}
- 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:
@@ -2150,41 +1631,6 @@ packages:
peerDependencies:
'@babel/core': ^7.0.0-0
- '@babel/[email protected]':
- resolution: {integrity: sha512-71EYI0ONURHJBL4rSFXnITXqXrrY8q4P0q006DPfN+Rk+ASM+++IBXem/ruokgBZR8YNEWZ8R6B+rCb8VcUTqA==}
- engines: {node: '>=6.9.0'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
-
- '@babel/[email protected]':
- resolution: {integrity: sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==}
- peerDependencies:
- '@babel/core': ^7.0.0-0
-
- '@babel/[email protected]':
- resolution: {integrity: sha512-Svlx1fjJFnNz0LZeUaybRukSxZI3KkpApUmIRzEdXC5k8ErTOz0OD0kNrICi5Vc3GlpP5ZCeRyRO+mfWTSz+iQ==}
- engines: {node: '>=6.9.0'}
- 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
-
- '@babel/[email protected]':
- 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'}
@@ -2207,12 +1653,6 @@ 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:
@@ -2261,404 +1701,72 @@ 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'}
peerDependencies:
'@babel/core': ^7.0.0-0
- '@babel/[email protected]':
- resolution: {integrity: sha512-va0VdWro4zlBr2JsXC+ofCPB2iG12wPtVGTWFx2WLDOM3nYQZZIGP82qku2eW/JR83sD+k2k+CsNtyEbUqhU6w==}
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-6UzkCs+ejGdZ5mFFC/OCUrv028ab2fp1znZmCZjAOBKiBK2jXD1O+BPSfX8X2qjJ75fZBMSnQn3Rq2mrBJK2mw==}
engines: {node: '>=6.9.0'}
peerDependencies:
'@babel/core': ^7.0.0-0
- '@babel/[email protected]':
- resolution: {integrity: sha512-d98gXZkgswvkyohMBABkhm3GeXhYj8psWfwQ2C7gtfrKGTykQa/iOIi+JJhwMjPlZ6Vm2XN+DCf3Es1EoG4ZLA==}
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-zbwoTsBruTeKB9hSq73ha66iFeJHuaFkUbwvqElnygoNbj/jHRsSeokowZFN3CZ64IvEqcmmkVe89OPXc7ldAw==}
engines: {node: '>=6.9.0'}
peerDependencies:
'@babel/core': ^7.0.0-0
- '@babel/[email protected]':
- resolution: {integrity: sha512-ilTRcmbuXjsMmcZ3HASTe4caH5Tpo93PkTxF9oG2VZsSWsahydmcEHhix9Ik122RcTnZnUzPbmux4wh1swfv7g==}
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-05WQkdpL9COIMz4LjTxGpPNCdlpyimKppYNoJ5Di5EUObifl8t4tuLuUBBZEpoLYOmfvIWrsp9fCl0HoPRVTdA==}
engines: {node: '>=6.9.0'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
- '@babel/[email protected]':
- resolution: {integrity: sha512-pcUb2SS+RMo9TWVBwKGI5ShtoG7R+zBsFmCKDa6fe8c+hPr3XJlZgoE5j6i8W7gDjhyvy+85vmYexanvXh3d1w==}
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-JiDShH45zKHWyGe4ZNVRrCjBz8Nh9TMmZG1kh4QTK8hCBTWBi8Da+i7s1fJw7/lYpM4ccepSNfqzZ/QvABBi5g==}
engines: {node: '>=6.9.0'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
- '@babel/[email protected]':
- resolution: {integrity: sha512-tt/7wOtBmwHPNMPu7ax4pdPz6shjFrmHDghvNC+FG9Qvj7D6mJcoRQIF5dy4njmxR941l6rgtvfSB2zX3VlUIw==}
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw==}
engines: {node: '>=6.9.0'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
- '@babel/[email protected]':
- resolution: {integrity: sha512-ONyr4+AZhKh8yKWInVxU9AXA9EbsyeLcL6V0dJy6M2/62vuvpGm29zzuymbTpdc451GEpDIdAyPLP3r+P61yKQ==}
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ==}
engines: {node: '>=6.9.0'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
- '@babel/[email protected]':
- resolution: {integrity: sha512-dY2wS3I2G7D697VHndN91TJr8/AAfXQNt5ynCTI/MpxMsSzHp+52uNivYT5wCPax3whc47DR8Ba7cmlQMg24bw==}
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-4HPiQr0X7+waHfyXPZpWPfWL/J7dcN1mx9gL6WdQVMbPnF3+ZhSMs8tCxN7oHddJE9fhNE7+lxdnlyemKfJRuA==}
engines: {node: '>=6.9.0'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
- '@babel/[email protected]':
- resolution: {integrity: sha512-GtcpjFvanPfzNQi3eTitsCqtRRmmqzpy/A+yhTR1HaZo1Ly3EA8ZXxlPyHdR8/IuRMYc3E4wdGBewB2QKQjAaA==}
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==}
engines: {node: '>=6.9.0'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
- '@babel/[email protected]':
- resolution: {integrity: sha512-rfQ++ghVwTWTqQ7w8qyDxL1XGihjBss4CmTgGRCTAC9RIbhVpyp4fOeZtta0Lbf+dTNIVJer6ych2ibHwkZqsQ==}
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA==}
engines: {node: '>=6.9.0'}
- peerDependencies:
- '@babel/core': ^7.12.0
- '@babel/[email protected]':
- resolution: {integrity: sha512-EF5KONAqC5zAqT783iMGuM2ZtmEBy+mJMOKl2BCvPZ2lVrwvXnB6o+OBWCS+CoeCCpVRF2sA2RBKUxvT8tQT5Q==}
- engines: {node: '>=6.9.0'}
+ '@base-ui/[email protected]':
+ resolution: {integrity: sha512-FwpKqZbPz14AITp1CVgf4AjhKPe1OeeVKSBMdgD10zbFlj3QSWelmtCMLi2+/PFZZcIm3l87G7rwtCZJwHyXWA==}
+ engines: {node: '>=14.0.0'}
peerDependencies:
- '@babel/core': ^7.0.0-0
+ '@types/react': ^19.2.15
+ react: 19.2.6
+ react-dom: 19.2.6
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
- '@babel/[email protected]':
- resolution: {integrity: sha512-qV0OGGBVacduzQHE649JyCneOFI/maT+YKsO+K4Yi3xv2wTPNjM/W2o2gdzMwEAZz7fXNTHAe0NcSg30bIN69g==}
- engines: {node: '>=6.9.0'}
+ '@base-ui/[email protected]':
+ resolution: {integrity: sha512-yQ+qeuqohwhsNpoYDqqXaLllYAkPCP4vYdDrVo8FQXaAPfHWm1pG/Vm+jmGTA5JFS0BAIjookyapuJFY8F9PIw==}
peerDependencies:
- '@babel/core': ^7.0.0-0
-
- '@babel/[email protected]':
- 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
-
- '@babel/[email protected]':
- resolution: {integrity: sha512-tQvHWSZ3/jH2xuq/vZDy0jNn+ZdXJeM8gHvX4lnJmsc3+50yPlWdZXIc5ay+umX+2/tJIqHqiEqcJvxlmIvRvQ==}
- engines: {node: '>=6.9.0'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
-
- '@babel/[email protected]':
- resolution: {integrity: sha512-G5eDKsu50udECw7DL2AcsysXiQyB7Nfg521t2OAJ4tbfTJ27doHLeF/vlI1NZGlLdbb/v+ibvtL1YBQqYOwJGg==}
- engines: {node: '>=6.9.0'}
- 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
-
- '@babel/[email protected]':
- 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
-
- '@babel/[email protected]':
- resolution: {integrity: sha512-+anKKair6gpi8VsM/95kmomGNMD0eLz1NQ8+Pfw5sAwWH9fGYXT50E55ZpV0pHUHWf6IUTWPM+f/7AAff+wr9A==}
- engines: {node: '>=6.9.0'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
-
- '@babel/[email protected]':
- resolution: {integrity: sha512-jppVbf8IV9iWWwWTQIxJMAJCWBuuKx71475wHwYytrRGQ2CWiDvYlADQno3tcYpS/T2UUWFQp3nVtYfK/YBQrA==}
- engines: {node: '>=6.9.0'}
- 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
-
- '@babel/[email protected]':
- 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
-
- '@babel/[email protected]':
- 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
-
- '@babel/[email protected]':
- resolution: {integrity: sha512-5rh+JR4JBC4pGkXLAcYdLHZjXudVxWMXbB6u6+E9lRL5TrGVbHt1TjxGbZ8CkmYw9zjkB7jutzOROArsqtncEA==}
- engines: {node: '>=6.9.0'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
-
- '@babel/[email protected]':
- resolution: {integrity: sha512-R8ja/Pyrv0OGAvAXQhSTmWyPJPml+0TMqXlO5w+AsMEiwb2fg3WkOvob7UxFSL3OIttFSGSRFKQsOhJ/X6HQdQ==}
- engines: {node: '>=6.9.0'}
- 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
-
- '@babel/[email protected]':
- 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
-
- '@babel/[email protected]':
- resolution: {integrity: sha512-qBkYTYCb76RRxUM6CcZA5KRu8K4SM8ajzVeUgVdMVO9NN9uI/GaVmBg/WKJJGnNokV9SY8FxNOVWGXzqzUidBg==}
- engines: {node: '>=6.9.0'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
-
- '@babel/[email protected]':
- resolution: {integrity: sha512-piiuapX9CRv7+0st8lmuUlRSmX6mBcVeNQ1b4AYzJxfCMuBfB0vBXDiGSmm03pKJw1v6cZ8KSeM+oUnM6yAExg==}
- engines: {node: '>=6.9.0'}
- 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
-
- '@babel/[email protected]':
- 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
-
- '@babel/[email protected]':
- 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
-
- '@babel/[email protected]':
- resolution: {integrity: sha512-ykDdF5yI4f1WrAolLqeF3hmYU12j9ntLQl/AOG1HAS21jxyg1Q0/J/tpREuYLfatGdGmXp/3yS0ZA76kOlVq9Q==}
- engines: {node: '>=6.9.0'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
-
- '@babel/[email protected]':
- resolution: {integrity: sha512-6UzkCs+ejGdZ5mFFC/OCUrv028ab2fp1znZmCZjAOBKiBK2jXD1O+BPSfX8X2qjJ75fZBMSnQn3Rq2mrBJK2mw==}
- engines: {node: '>=6.9.0'}
- 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
-
- '@babel/[email protected]':
- 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
-
- '@babel/[email protected]':
- 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
-
- '@babel/[email protected]':
- resolution: {integrity: sha512-JfuinvDOsD9FVMTHpzA/pBLisxpv1aSf+OIV8lgH3MuWrks19R27e6a6DipIg4aX1Zm9Wpb04p8wljfKrVSnPA==}
- engines: {node: '>=6.9.0'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
-
- '@babel/[email protected]':
- resolution: {integrity: sha512-rNNFV0DBAJp988xW2DOntfDoYn1eR8GGF5AT5vYc+rjyfaQkM242c9tZUHHPe7KYaiJizXPWhQTzzdbXySyhBw==}
- engines: {node: '>=6.9.0'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
-
- '@babel/[email protected]':
- resolution: {integrity: sha512-jlaRT5dJtMaMCV6fAuLbsQMSwz/QkvaHOHOSXRitGGwSpR1blCY4KUKoyP2tYO8vJcqYe8cEj96cqSztv3uF9w==}
- engines: {node: '>=6.9.0'}
- 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
-
- '@babel/[email protected]':
- resolution: {integrity: sha512-N/wH1vcn4oYawbJ13Y/FxcQrWk63jhfNa7jef0ih7PHSIHX2LB7GWE1rkPrOnka9kwMxb6hMl19p7lidA+EHmQ==}
- engines: {node: '>=6.9.0'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
-
- '@babel/[email protected]':
- resolution: {integrity: sha512-fBJKiV7F2DxZUkg5EtHKXQdbsbURW3DZKQUWphDum0uRP6eHGGa/He9mc0mypL680pb+e/lDIthRohlv8NCHkg==}
- engines: {node: '>=6.9.0'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
-
- '@babel/[email protected]':
- resolution: {integrity: sha512-0YWL2RFxOqEm9Efk5PvreamxPME8OyY0wM5wh5lHjF+VtVhdneCWGzZeSqzOfiobVqQaNCd2z0tQvnI9DaPWPw==}
- engines: {node: '>=6.9.0'}
- 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
-
- '@babel/[email protected]':
- 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
-
- '@babel/[email protected]':
- resolution: {integrity: sha512-+bQy5WOI2V6LJZpPVxY+yp66XdZ2yifu0Mc1aP5CQKgjn4QM5IN2i5fAZ4xKop47pr8rpVhiAeu+nDQa12C8+g==}
- engines: {node: '>=6.9.0'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
-
- '@babel/[email protected]':
- resolution: {integrity: sha512-05WQkdpL9COIMz4LjTxGpPNCdlpyimKppYNoJ5Di5EUObifl8t4tuLuUBBZEpoLYOmfvIWrsp9fCl0HoPRVTdA==}
- engines: {node: '>=6.9.0'}
-
- '@babel/[email protected]':
- 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'}
-
- '@babel/[email protected]':
- 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'}
-
- '@babel/[email protected]':
- 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'}
-
- '@babel/[email protected]':
- resolution: {integrity: sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==}
- engines: {node: '>=6.9.0'}
-
- '@babel/[email protected]':
- resolution: {integrity: sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA==}
- engines: {node: '>=6.9.0'}
-
- '@base-ui/[email protected]':
- resolution: {integrity: sha512-FwpKqZbPz14AITp1CVgf4AjhKPe1OeeVKSBMdgD10zbFlj3QSWelmtCMLi2+/PFZZcIm3l87G7rwtCZJwHyXWA==}
- engines: {node: '>=14.0.0'}
- peerDependencies:
- '@types/react': ^19.2.15
- react: 19.2.6
- react-dom: 19.2.6
- peerDependenciesMeta:
- '@types/react':
- optional: true
-
- '@base-ui/[email protected]':
- resolution: {integrity: sha512-yQ+qeuqohwhsNpoYDqqXaLllYAkPCP4vYdDrVo8FQXaAPfHWm1pG/Vm+jmGTA5JFS0BAIjookyapuJFY8F9PIw==}
- peerDependencies:
- '@types/react': ^19.2.15
- react: 19.2.6
- react-dom: 19.2.6
- peerDependenciesMeta:
- '@types/react':
- optional: true
+ '@types/react': ^19.2.15
+ react: 19.2.6
+ react-dom: 19.2.6
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==}
@@ -2893,10 +2001,6 @@ packages:
resolution: {integrity: sha512-OdJCiYklkL3TqmdmGKUflHoLy9zw18GBYO0DPASZvGlP4RkDXAZzLLDt7cidJ6wUR7DBrKb13rrekDsXgMF60g==}
engines: {node: '>=22.19.0'}
- resolution: {integrity: sha512-XQsZgjm2EcVUiZQf11UBJQfmZeEmOW8DpI1gsFeln6w0ae0ii4dMQEQ0kjl6DspdWX1aGY1/loyXnP0JS06e/A==}
- engines: {node: '>=0.8.0'}
-
'@electron-internal/[email protected]':
resolution: {integrity: sha512-OjKpjB7gohtEjZiq6nDx1egqjZJhGPN1iFOIED+NFhB/MMkXw/XRcHjh1DGXKT5z2W9eW7Jy2UKU3gpjvusFTQ==}
engines: {node: '>=22.12.0'}
@@ -3768,331 +2872,23 @@ packages:
resolution: {integrity: sha512-+CNAzxglkrpNf/kKywqQfk74QjtceuOE7Qm+AF8miRvPF/wmmK5+OJOgVh3AVTT3RP2mH3+FOaxlE5v72owk0A==}
engines: {node: ^20.19.0 || ^22.13.0 || >=24}
- '@expo-google-fonts/[email protected]':
- resolution: {integrity: sha512-KZmHZRcthJ3KFZZlpzHjopA9guZgWR9fb3uVZlTR0BNlvG2pw1bnYBCpkze2PB0vRllwGhAM7lWXsfmcWCbXYg==}
-
- resolution: {integrity: sha512-mP+B9ZrTnRE94bxPM/kCVKPyuVuOTRvvsqbXVxdXtrAfOfF94YIZLGUtw/151cGFtdUPbsBsJ9gW02LhU+QMZA==}
- hasBin: true
- peerDependencies:
- expo: '*'
- expo-router: '*'
- react-native: '*'
- peerDependenciesMeta:
- expo-router:
- optional: true
- react-native:
- optional: true
+ '@floating-ui/[email protected]':
+ resolution: {integrity: sha512-C3HlIdsBxszvm5McXlB8PeOEWfBhcGBTZGkGlWc2U0KFY5IwG5OQEuQ8rq52DZmcHDlPLd+YFBK+cZcytwIFWg==}
- resolution: {integrity: sha512-Jauk4chxmpVG5ElrMLTCwjFP20jbYU7PB4l3LYV8j+4e/3HU5jdl7qTQ4eVy1AaDUE9Ia2NCQ5A9kar2V1gaLg==}
- hasBin: true
- peerDependencies:
- expo: '*'
- expo-router: '*'
- react-native: '*'
- peerDependenciesMeta:
- expo-router:
- optional: true
- react-native:
- optional: true
+ '@floating-ui/[email protected]':
+ resolution: {integrity: sha512-1Ih4WTWyw0+lKyFMcBHGbb5U5FtuHJuujoyyr5zTaWS5EYMeT6Jb2AuDeftsCsEuchO+mM2ij5+q9crhydzLhQ==}
- resolution: {integrity: sha512-iNe0puxwBNEcuua9gmTGzq+SuMDa0iATai1FlFTMHJ/vUmKvN/V//drXoLJkVb5i5H3iE/n/qIJxyoBnXouD0w==}
+ '@floating-ui/[email protected]':
+ resolution: {integrity: sha512-N0bD2kIPInNHUHehXhMke1rBGs1dwqvC9O9KYMyyjK7iXt7GAhnro7UlcuYcGdS/yYOlq0MAVgrow8IbWJwyqg==}
- resolution: {integrity: sha512-7CmKrS5Rnu8aSZyNlxH2qzA7Ls1HEa4EQvEVOAkHDKPr1e4Cg/nz7I7dUl09QDTVjMvkKYDH4Th0DuAsgqASaw==}
+ '@floating-ui/[email protected]':
+ resolution: {integrity: sha512-9gZSAI5XM36880PPMm//9dfiEngYoC6Am2izES1FF406YFsjvyBMmeJ2g4SAju3xWwtuynNRFL2s9hgxpLI5SQ==}
- resolution: {integrity: sha512-hHgfL1avkCdEvDSw7IwlKwRYYNgcxzbNNMIk6W6lTkJpY0MajinAfeJUS0J+wPCsjUfGbVqOJM+XhPaO5ulUxg==}
-
- resolution: {integrity: sha512-ewW08OonrcRIsRKIlFvvcmmafE5zemb1ocu3HkNwtVPyRtj2w42pZCAkMIROYpcVBaPnc3mDT9UZDzwXWC3i6g==}
-
- resolution: {integrity: sha512-VpMJpB/De/fb9bBFVVBiK6Ntg9lt0kAleLH9hcZz85CYRUQ3jVFVA8rNC5f8y4cp2+FiiPNFp62+kEOFI6pDiw==}
-
- resolution: {integrity: sha512-dmzlKraIFxa7wLwV6K7WzI8jp6QZpW6Mc5mGjLimJUFjzh4uQdYaT3m3plEutM5yxBoBEwqzks7l+I/ljCbxAQ==}
-
- resolution: {integrity: sha512-qC4eaxmKMTmJC2ahwyui6ud8f3W60Ss7pMkpBq40Hu3zyiAaugPXnZ24145U7K36qO9UHdZUVxsCvIpz2RYYCA==}
-
- resolution: {integrity: sha512-GyUf+wFNkbttaX0jR7MZa9bm77U0IrLg6d2AjpxdyoXw/w4abHoXG0oFufwLMgP9zLTd5+Ct4X/ffNUTnlzZgg==}
- peerDependencies:
- react: 19.2.6
- react-native: '*'
- peerDependenciesMeta:
- react:
- optional: true
- react-native:
- optional: true
-
- resolution: {integrity: sha512-lAKsME4SAq+8sf56oN0DX5TBYyruupoRxbWbD2xf9RnKY8y6x8eb9LCE5pxSN0qyWdqnp+0wmyWzDkKboThKAw==}
- peerDependencies:
- expo: '*'
- react: 19.2.6
- react-native: '*'
-
- resolution: {integrity: sha512-28pqaEqwnmLduZ00Pq9HkSzE5wbj1MTwp5/n8nm8rD8MCjR9eUnVOwmNksPI3Be2ReAPO/DbPn1puy0mvoocsQ==}
- engines: {node: '>=20.12.0'}
-
- resolution: {integrity: sha512-M1NXeZCA1mkMkYOyIe7PlyRX0/jqFtMoJgyblnlq/vpCRfmueFT7RnGSQG8uEFDF5WHOFGijAQ3fogPh3/n5Ng==}
- engines: {node: '>=20.12.0'}
-
- resolution: {integrity: sha512-cpsLZE4rqkc1Y3eZTkxB98jrqY1YXgetmtxFt8q89jBRmk3quRuk1BZo+VcnCSObZardjg99r1k5xijEMONFGA==}
-
- resolution: {integrity: sha512-h1x+w+JpNRu88a/5SMZRzJs9YDGR/f7R8ApCr7OdenhqmJ00hFxQMzvxajDLL+1P2Y2g/ND0xksusqvBqWSW5Q==}
- hasBin: true
-
- resolution: {integrity: sha512-cmC/6BOPRbdKr77Mgjwszb8aM0hY2RKBpMRCmjSdn9zIcn2FGor/ic4fHVr46cQFa1G6RDGg1GyAjRw3US4CCQ==}
- hasBin: true
-
- resolution: {integrity: sha512-pn/4770DIEOcYZr484uazuwg20FX/qaDkeMRF6J+oxejynDmEmO8wLsCudaNShFE0BhyKGQTYrs2rsRhqrqESw==}
-
- resolution: {integrity: sha512-KPQBTpmpAfy/Vu9y4wPW808/qtZxjYmyJg8cm2QCPAupp+qEWA3b5zmk0ulOwQ9OgeHxuCPgUqWgkwHFo7UsrQ==}
-
- resolution: {integrity: sha512-eHSxWYfgq65mP3Qz8PclVjUkSrDIlGl3va9U7PMcTpGItOvee/i0ZzGinH5A25oARR5ouD64eESBKwtT/CwdHg==}
-
- resolution: {integrity: sha512-Bz/khd1gIJqDkje7t5ejD5e9jFbm4xEJzWSwRKadRo6gruepbw1xJ3Eb+e58OS8fY1ZNQYjzZbspnuph67sN0g==}
-
- resolution: {integrity: sha512-zxHWj4MKKMAL29ZQSY/Fssx4Thluk40JmuGNaeS078wy/NhlFhnVi+rHHunulE3xJAJ0CM73m8VK2+GkF9eRwQ==}
-
- resolution: {integrity: sha512-B/cI73shkLSYBYuFyh+zCbS+WhqJgawWPW4MPdMiNLJKv9RmV4dv1FGjsidiIiG2k4kYKerBDLK4bLbC7qERQQ==}
-
- resolution: {integrity: sha512-SEdE0pAQrr90bRh3MNR0ZuwoIBw390cYdFgbn7Vk0Mtm9EHaBfP7kYj+2hXnXZJgOEm3/JMtfoD3rV7rWA9FGg==}
-
- resolution: {integrity: sha512-fuVNHhOerdRWtpq27gD6JTSVYESsfRu+SMdrNCWxW+gFnusS6dGKfx3lKGBZ4ZkMNiLWn8maBHo39YKzJNXFYQ==}
- peerDependencies:
- '@expo/dom-webview': ^57.0.1
- expo: '*'
- react: 19.2.6
- react-native: '*'
-
- resolution: {integrity: sha512-IxwS9s1L2muj8mj8AQSuiy7u8OFJdc02NRFo2me/Tj6DiaeG5SREqmpBE4rQpR2cadqSg5jl8Qab8Cjie616dg==}
- peerDependencies:
- '@expo/dom-webview': ^57.0.1
- expo: '*'
- react: 19.2.6
- react-native: '*'
-
- resolution: {integrity: sha512-S62Lrq35HZqBFD55423pmWb8PjaiR/W02zQC1uECBmw1vTN8WZaFz4TJ0i21EeJzwfebMb9MLxL8JZ102Z6VbA==}
- peerDependencies:
- expo: '*'
- peerDependenciesMeta:
- expo:
- optional: true
-
- resolution: {integrity: sha512-bVfEkg4zF1cA62OqAdYXmFOooJ6TB/I+REi7Se6Ct+PbSC+89TwSqWXnYx34L08eIs4z+1ilgbATakTZpgefmQ==}
- peerDependencies:
- expo: '*'
- peerDependenciesMeta:
- expo:
- optional: true
-
- resolution: {integrity: sha512-8JXfVstZN7QnP4NianZZnlTVboOWR0sG8trUDNajOjnbGlPln29vponXM84tY+3tAHapz5/TxE53L0ixUwqPtA==}
-
- resolution: {integrity: sha512-1OXy+uPYY5uc7Tm4VBsd2NRn+3wHhqeqNuEO/Xo4kmYgv8FjYgUAc+bUXON9FpC2ikcLn4EVlGM9ce2exx9Mlg==}
-
- resolution: {integrity: sha512-x43WgZoICpp37BhDV7vixe0bNxbVPPGaBLHYc98ZJ8MU+UC2dk39Y2XvkfYMRRbAUSIkCIJiwdERnptlPg0Ckw==}
- peerDependencies:
- '@expo/log-box': ^57.0.4
- expo: '*'
- react: 19.2.6
- react-dom: 19.2.6
- react-native: '*'
- peerDependenciesMeta:
- react-dom:
- optional: true
-
- resolution: {integrity: sha512-95UeoN/YsLellvskKsFGN9vKBwNc5k70ysO3skqfL3VusWlYIiYmPY+MpEWNz8A8W2CjLg9AKwZKAGrFj6znQg==}
- peerDependencies:
- '@expo/log-box': ^57.0.1
- expo: '*'
- react: 19.2.6
- react-dom: 19.2.6
- react-native: '*'
- peerDependenciesMeta:
- react-dom:
- optional: true
-
- resolution: {integrity: sha512-5gIgQHtEpjjvsjKfVtIv23a98LLRV0/y07PDShEwYSytAMlE3FSF8RHXqtHc1sUJL6dn7hnuIBpIbrLXXuVi0A==}
-
- resolution: {integrity: sha512-Ld5AeYMCCDa8bLeWhfuLbZFFjlV3f6ORqyPz2glGh6RltIngMuLf9BTC2yvHFjkKuGxL5SynijmA8xmNNWn5iA==}
-
- resolution: {integrity: sha512-Zn03EX6In7ts2lPUW2ESUSkEhEWQN1qqsiXjadtZMJOuZRkMiAg1ZQHuvz9DjByDWNJ2pBwAGyrts9lj9k389g==}
- engines: {node: '>=12'}
-
- resolution: {integrity: sha512-y/K+CaYYpZpNGZhSX4HyLT/vyIunFjNfyoxNysPBCefeLKI/VCx6f9LNPzrxayr3rCYO5bl9O8H+HRQK265Nkg==}
-
- resolution: {integrity: sha512-3gTReGIUm0oRaMClsAJYxBnVPCl6fVpsl8HS+DTVxDhW4GyVyxg9E/Znm3BvcHtUJ51RJJI14pC1wvrNilCRHw==}
-
- resolution: {integrity: sha512-QA8oMZ7y70kjOzw+abhRl9uYC8Nu/abeUTHr0YVxb3pgIC14gc7w543bYtI+5gEDI3q55jKUViIauC76QvZN1w==}
-
- resolution: {integrity: sha512-8g7RoXFvO/dxvLzRE/bvphzDL4bfV0w3/4Aj6DfwvgymZ1ULz5gW2x0js94opZRoZvWw4SolH6/74hLlZT3rAA==}
-
- resolution: {integrity: sha512-e7xbg/9BTQcsZE/oErafZXtI7kh5IgfasLJ97J5sFSzX2cA74pDvdlhW1KHVSaDkQyQv6h1LSLhsY7dEeOk7hw==}
- peerDependencies:
- typescript: ^5.0.0 || ^5.0.0-0 || ^6.0.0 || ^7.0.0
- peerDependenciesMeta:
- typescript:
- optional: true
-
- resolution: {integrity: sha512-kTAXj9lDFEIPMsbAOGCGbjBbMF0oi7CqkYM79KOX0DDD9wSwXmlKL1z2h8OwsrBf7mbOo2DjlRvZu4BEjrIxGw==}
- peerDependencies:
- typescript: ^5.0.0 || ^5.0.0-0 || ^6.0.0 || ^7.0.0
- peerDependenciesMeta:
- typescript:
- optional: true
-
- resolution: {integrity: sha512-0QxbqEkceb1WDeu5VqNdnTPVHlm3U183F7Y1t5LMohmGRAkHVL0PB4tCHBvEqKpLzOzHVObw3reGkJ1tX48h8Q==}
- peerDependencies:
- '@expo/metro-runtime': ^57.0.16
- expo: '*'
- expo-constants: ^57.0.19
- expo-font: ^57.0.4
- expo-router: '*'
- expo-server: ^57.0.3
- react: 19.2.6
- react-dom: 19.2.6
- react-server-dom-webpack: ~19.0.1 || ~19.1.2 || ~19.2.1
- peerDependenciesMeta:
- '@expo/metro-runtime':
- optional: true
- expo-router:
- optional: true
- react-dom:
- optional: true
- react-server-dom-webpack:
- optional: true
-
- resolution: {integrity: sha512-ucqCP0hK8nZb9+S8QJYdQxNCkfRClzkKdg2RpWYDKDYgRIHyoRyxEDRgDgvbhH+q78yfY83abU8OTx8MMOrf1g==}
- peerDependencies:
- '@expo/metro-runtime': ^57.0.7
- expo: '*'
- expo-constants: ^57.0.7
- expo-font: ^57.0.1
- expo-router: '*'
- expo-server: ^57.0.1
- react: 19.2.6
- react-dom: 19.2.6
- react-server-dom-webpack: ~19.0.1 || ~19.1.2 || ~19.2.1
- peerDependenciesMeta:
- '@expo/metro-runtime':
- optional: true
- expo-router:
- optional: true
- react-dom:
- optional: true
- react-server-dom-webpack:
- optional: true
-
- resolution: {integrity: sha512-fMu/jyN0l1Wzv7XkeWR4IYCx1M8ryui3FdBNGrWwbRgJ7EhxXxK8E2jxP2W3pbgUwUY0V3hG8+GyfCZwny+Lxw==}
-
- resolution: {integrity: sha512-Doz2bfiPndXYFPMRwPyGa1k5QaKDVpY806UJj570epIiMzWaYyCtobasyfC++qfIXVb5Ocy7r3tP9d62hAQ7IQ==}
-
- resolution: {integrity: sha512-eb9xxd/LbuEGSdua4NumCu/McVB9EM+F/JxB9pWgnERw4HQ9XyTNH1KapG6oqLWR8TuRK2LQfzJlmNi94CVobw==}
- engines: {node: '>=12'}
-
- resolution: {integrity: sha512-HHQigo3rQWKMDzYDLkubN5WQOYXJJE2eNqIQC2axC2iO3mHdwnIR7FgZVvHWtBwAdzBgAP0ECp8KqS8TiMKvgw==}
-
- resolution: {integrity: sha512-0ChmuyWBwEy3JHMR5wDkJGyvkTR5zH3BTwjJrv3f2ymtamhpU9hD5uH4GsLoWuB6MJFOPTuchq4zByZbtgPyNw==}
- peerDependencies:
- '@babel/core': '*'
- expo: '*'
- react: 19.2.6
- react-dom: 19.2.6
- react-native: '*'
- react-native-worklets: '*'
- peerDependenciesMeta:
- '@babel/core':
- optional: true
- react-dom:
- optional: true
- react-native-worklets:
- optional: true
-
- resolution: {integrity: sha512-WqRVabl8VpHf3+YLHVjUy7PMIuXXI6DG88Vgmavro7Nd8Ks13h9sEJH/RLSCaJE2daVnqzEKY1v797BibuY9aw==}
- peerDependencies:
- '@babel/core': '*'
- expo: '*'
- react: 19.2.6
- react-dom: 19.2.6
- react-native: '*'
- react-native-worklets: '*'
- peerDependenciesMeta:
- '@babel/core':
- optional: true
- react-dom:
- optional: true
- react-native-worklets:
- optional: true
-
- resolution: {integrity: sha512-j+JfTRdCk820J9dU0sA2SqshQIKFOMo7ED84w9MJFcebfbNQgsLztEY/SABDkGnjatrW4xGqnUhVRxSBVyCkXw==}
- peerDependencies:
- ws: 8.21.0
-
- resolution: {integrity: sha512-4aQzz9vgxcNXFfo/iyNgDDYfsU5XGKKxWxZopw0cVotHiW+U8IJbIxMaxsINs6bHhtkG3StKNPcOrn3eBuxKPw==}
- hasBin: true
-
- '@floating-ui/[email protected]':
- resolution: {integrity: sha512-C3HlIdsBxszvm5McXlB8PeOEWfBhcGBTZGkGlWc2U0KFY5IwG5OQEuQ8rq52DZmcHDlPLd+YFBK+cZcytwIFWg==}
-
- '@floating-ui/[email protected]':
- resolution: {integrity: sha512-1Ih4WTWyw0+lKyFMcBHGbb5U5FtuHJuujoyyr5zTaWS5EYMeT6Jb2AuDeftsCsEuchO+mM2ij5+q9crhydzLhQ==}
-
- '@floating-ui/[email protected]':
- resolution: {integrity: sha512-N0bD2kIPInNHUHehXhMke1rBGs1dwqvC9O9KYMyyjK7iXt7GAhnro7UlcuYcGdS/yYOlq0MAVgrow8IbWJwyqg==}
-
- '@floating-ui/[email protected]':
- resolution: {integrity: sha512-9gZSAI5XM36880PPMm//9dfiEngYoC6Am2izES1FF406YFsjvyBMmeJ2g4SAju3xWwtuynNRFL2s9hgxpLI5SQ==}
-
- '@floating-ui/[email protected]':
- resolution: {integrity: sha512-cC52bHwM/n/CxS87FH0yWdngEZrjdtLW/qVruo68qg+prK7ZQ4YGdut2GyDVpoGeAYe/h899rVeOVm6Oi40k2A==}
- peerDependencies:
- react: 19.2.6
- react-dom: 19.2.6
+ '@floating-ui/[email protected]':
+ resolution: {integrity: sha512-cC52bHwM/n/CxS87FH0yWdngEZrjdtLW/qVruo68qg+prK7ZQ4YGdut2GyDVpoGeAYe/h899rVeOVm6Oi40k2A==}
+ peerDependencies:
+ react: 19.2.6
+ react-dom: 19.2.6
'@floating-ui/[email protected]':
resolution: {integrity: sha512-31B8h5mm8YxotlE7/AU/PhNAl8eWxAmjL/v2QOxroDNkTFLk3Uu82u63N3b6TXa4EGJeeZLVcd/9AlNlVqzeog==}
@@ -4230,10 +3026,6 @@ packages:
resolution: {integrity: sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==}
engines: {node: '>=18.0.0'}
- '@isaacs/[email protected]':
- resolution: {integrity: sha512-RQgQ4uQ+pLbqXfOmieB91ejmLwvSgv9nLx6sT6sD83s7umBypgg+OIBOBbEUiJXrfpnp9j0mRhYYdzp9uqq3lA==}
- engines: {node: '>=12'}
-
'@istanbuljs/[email protected]':
resolution: {integrity: sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==}
engines: {node: '>=8'}
@@ -4300,10 +3092,6 @@ packages:
node-notifier:
optional: true
- resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
-
resolution: {integrity: sha512-i6b4qw5qnP8c5FEeBJg/uZQ4ddrkN6Ca8qISJh0pr7a5hfn3h3v5x60BEbOC7OYAGZNMs1LfFLwnW2CuK8F57Q==}
engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0}
@@ -4328,10 +3116,6 @@ packages:
resolution: {integrity: sha512-Wz0LyktlTvRefoymh+n64hQ84KNXsRGcwdoZ8CSa0Ea+fgYcHZlnk+hDP7v2MS7il2bQ5uTEIxf4/NNfhMN4KQ==}
engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0}
- resolution: {integrity: sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
-
resolution: {integrity: sha512-f1x/vJXIfjOlEmejYpbkbgw1gOqpPECwMvMEtBqe47j7H2Hg8h8w3o3ikhSXq3MI15kg+oQ0exWO0uCtTNJLoQ==}
engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0}
@@ -6070,9 +4854,6 @@ packages:
engines: {node: '>=14.14', npm: '>=6'}
hasBin: true
- '@posthog/[email protected]':
- resolution: {integrity: sha512-UpswaG2957O6Ywfx1aCeI8BbXcfoKduKwq1ytBml80AQuAmgK672OmhDcldA7wg4vGP49LpDTgxcNbLvZwQOqw==}
-
'@posthog/[email protected]':
resolution: {integrity: sha512-l3b6Dc2NmItwmyu6ot7K2jtStQOAQjZw/PB/gpZwk2W6SBCbvPg6YJzReSBSQLuok19ridbfVNk70a5hgoGX2Q==}
@@ -6104,20 +4885,11 @@ packages:
react-dom: 19.2.6
tailwindcss: ^4.0.0
- '@posthog/[email protected]':
- resolution: {integrity: sha512-OACM1UnyBf9Ld1KsKXFF1cvQu426EcvboZihaVbISLybiurdsqN6qnZzD7B6Q1Wg9/3bGqXQNzQKdIy115Iyag==}
- peerDependencies:
- react: 19.2.6
- react-native: '*'
-
'@posthog/[email protected]':
resolution: {integrity: sha512-6aOAx34tP6M8H4+3y9ydVeM/bK06ak+UUJgEA7pQCygkdHOsPcVFI6Tnd+rV4ZWQEMQDj6ZHZy9K5X7IIWj6Tg==}
peerDependencies:
rollup: 4.59.0
- '@posthog/[email protected]':
- resolution: {integrity: sha512-0/9+02s/0uDyrH4G/qUg1yyl6gXUg8Uuxw/PlDad3KLzo9FFS9zS/kAQaEshx/saVGupj1aAy/4EUBxWisBogw==}
-
'@posthog/[email protected]':
resolution: {integrity: sha512-WqDXUWH1R8OilBp2PfDpQIRZSCs3QyOnw7H3YK7lvZLCMIsOqSZAKJrrqYWt4f7FvnVCACRuNGCC0HKh3J/HWw==}
@@ -6899,141 +5671,6 @@ packages:
resolution: {integrity: sha512-LVfA+j5cFT0Szd958WRD8W/B8ucCtz4ViiveDKWLqAwBkZFW9VRW1ZvwOUhp/M3SmVPtjDaRkW12GvAuTArP+Q==}
hasBin: true
- '@react-native-async-storage/[email protected]':
- resolution: {integrity: sha512-gvRvjR5JAaUZF8tv2Kcq/Gbt3JHwbKFYfmb445rhOj6NUMx3qPLixmDx5pZAyb9at1bYvJ4/eTUipU5aki45xw==}
- peerDependencies:
- react-native: ^0.0.0-0 || >=0.65 <1.0
-
- '@react-native-community/[email protected]':
- resolution: {integrity: sha512-P/3caXIvfYSJG8AWJVefukg+ZGRPs+M4Lp3pNJtgcTYoJxCjWrKQGNnCkj/Cz//zWa/avGed0i/wzm0T8vV2IQ==}
- peerDependencies:
- react: 19.2.6
- react-native: '>=0.59'
-
- '@react-native-masked-view/[email protected]':
- resolution: {integrity: sha512-XwuQoW7/GEgWRMovOQtX3A4PrXhyaZm0lVUiY8qJDvdngjLms9Cpdck6SmGAUNqQwcj2EadHC1HwL0bEyoa/SQ==}
- peerDependencies:
- react: 19.2.6
- react-native: '>=0.57'
-
- '@react-native/[email protected]':
- resolution: {integrity: sha512-nIaXbm2jX1OTYp0qbviJ3O6KZivoE8z3BnhUQ2LsqfZSWRoOK/n1qsiAr6oALiNKWnXY3j2KPwtYORnZzp8xew==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
-
- '@react-native/[email protected]':
- resolution: {integrity: sha512-qdsABWNW7uTll90l4Vh03gjeyu3WVDi2CyiiyvYGMRDcoYbjbQi6df3BMAm9lQI2yslZ1T14LlDDAsgTwNxplA==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
-
- '@react-native/[email protected]':
- resolution: {integrity: sha512-O6Xza4JBGPIU8J7YbKTyBoYL4thpy8jMW/oaLDWdAyOwYHKIjK47pAL5HUEbOe2bWz2PEKjbYRF2ApkJv1ottQ==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
-
- '@react-native/[email protected]':
- resolution: {integrity: sha512-bYQcWiPySNvF4dns9Ls9gMmwgq66ohvM9Fwc/Kn8r85t66UNHxch3p1QwPiSorDelFauZwJbgo9+ReibTgvpbA==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
- peerDependencies:
- '@babel/core': '*'
-
- '@react-native/[email protected]':
- resolution: {integrity: sha512-uTs9DBo3+/lUqinsGZK0FKJRBVClrwMXoZToaDxE1Q2SL2e55vs2GwyZfIKzPl5uJnbu4PfFMIp0/mLXLWUMuA==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
- peerDependencies:
- '@babel/core': '*'
-
- '@react-native/[email protected]':
- resolution: {integrity: sha512-Ux4jHi0fh+bdtVEcL0gaPLbY56V+SvFUDl/8sRAE1jdb4k+o7fT/4Nc29yz4X+qfjstkSqObQTMBGhdzxH9JvA==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
- peerDependencies:
- '@babel/core': '*'
-
- '@react-native/[email protected]':
- resolution: {integrity: sha512-Jv8p1ebEPfTzs8gmrjsdT2XMXFfeAg45Pman+XPLFGaSeGAZkutRFRyX9Cs9aGTSOyIA9YPJ6vDNb1ayTf1FKQ==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
- peerDependencies:
- '@react-native-community/cli': '*'
- '@react-native/metro-config': 0.86.0
- peerDependenciesMeta:
- '@react-native-community/cli':
- optional: true
- '@react-native/metro-config':
- optional: true
-
- '@react-native/[email protected]':
- resolution: {integrity: sha512-7Mb3nDfyJeys+ELF75Ageu7VKERlnIMoO+aNPoXqTXvz+b41L6l2CqMyLpDHxkBSlenij6gEepPNgaIyWHbJZw==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
-
- '@react-native/[email protected]':
- resolution: {integrity: sha512-TQmeofQ0PcuylhhlleOeuzHYZfbrgm3gayXzowqUEzgRisTm1D40/J3ggqs7XkQi5HP5ZA3n8dHmKL9vIzPcsw==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
-
- '@react-native/[email protected]':
- resolution: {integrity: sha512-Y0zEkZzLz8ou6o/VLml1A31X/rMgc6DRjwxwzPMa94qRTMY070WeBCNTITQo4kKTBAUgbxh07oXPQqp0Tpja8w==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
-
- '@react-native/[email protected]':
- resolution: {integrity: sha512-O4ds+J7xZfxkbih9T+cAGegBdvKSPKYJm/lDgC9CpEjFMkmzWTpVLU3Qsv9sqZuo58z+sGhIcJfPsCFFWHpqbQ==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
-
- '@react-native/[email protected]':
- resolution: {integrity: sha512-20pTO6yTybmvXvro520H6C7jydIQnLKOl5qFtVEcHSdFrY63r3OGei+Rx9bILgSRmH6jgnfEcijcMx7pwWuQtw==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
-
- '@react-native/[email protected]':
- resolution: {integrity: sha512-LiEPTqTg/63bYUnrPyHLfjTDCNhA/+CUqI1+DsA9tYyewtSbULd5awsva6SgE10I+2iMhgKXS3ymkhU/kSCrGA==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
-
- '@react-native/[email protected]':
- resolution: {integrity: sha512-a1RcfaEDqWExCGfCwadIxt4l8FvKYgFqeMf2uzeKyAOnb+vTGNIeCvifFL2MqvgaeYxlER437HbMIajGcuJ1pQ==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
-
- '@react-native/[email protected]':
- resolution: {integrity: sha512-zYy/Cjd1VTnZ2iCNaG9bDF9C3l2ntESiPRscjIlI5FKugu6aeTwsDSv1aI8Bc4Kp3vEdoVg+UQhLAhE4svREaQ==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
-
- '@react-native/[email protected]':
- resolution: {integrity: sha512-SjKej3E5qIahqo/G+rSOrmJUQM44RyKtWtO+VfmKAAMoJWkBFomM22hTLKCIS5cdbIAJ9COAmU+KAi2wVSO0wQ==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
- peerDependencies:
- '@babel/core': '*'
-
- '@react-native/[email protected]':
- resolution: {integrity: sha512-7v+xbTeEci9ZcQ/Z1OqI4RXcqN69wSMDYL5BAMvOReZ7U04+aDQ0/SQhClYPn6x2/RxM4WzMKSAuNyLKqvYVtw==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
-
- '@react-native/[email protected]':
- resolution: {integrity: sha512-qoMMXddVKVhZ8PA1AbUCk83trpd6N+1nF2A6k1i6LsQObyS92fELuk8kU/lQs6M7BsMHwqyLCpQJ1uFgNvIQXg==}
-
- '@react-native/[email protected]':
- resolution: {integrity: sha512-kG0wfCGghUKlfxkJyyHCDVutWVYWK7/DG58ojA/4v9EfulgF+osuSQmlbNb3rcKX58qutm7JcldSeVLgGFha9g==}
-
- '@react-native/[email protected]':
- resolution: {integrity: sha512-Cv3CDkprb67GrzuaS9BGbBJC/6G4lIw3nyKOHRKTqTTum4bn37y5+R0Z04L8mcbQN85eEohNrRwb7IOM4j6uvg==}
-
- '@react-native/[email protected]':
- resolution: {integrity: sha512-4/ZLXdf/OSpPDVO0AsQ1SJdRIzt5t9BNQ46QwGgxvX7/cirYR5k8KXctNGGgW8lQo2gZChEfY2zFCZg9nM/jiw==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
- peerDependencies:
- '@types/react': ^19.2.15
- react: 19.2.6
- react-native: 0.86.0
- peerDependenciesMeta:
- '@types/react':
- optional: true
-
- '@react-navigation/[email protected]':
- resolution: {integrity: sha512-bCW1PsLA/eOXDOukcJFEzlcL3Zpy8DJuDCfkDDwAQlAgoSZ/J9+ZeDRUMmCUi6xbnFgvFEEIMertaLeErOFP0Q==}
- peerDependencies:
- react: 19.2.6
-
- '@react-navigation/[email protected]':
- resolution: {integrity: sha512-d1QDn+KNHfHGt3UIwOZvupvdsDdiHYZBEj7+wL2yDVo3tMezamYy60H9s3EnNVE1Ae1ty0trc7F2OKqo/RmsdQ==}
- peerDependencies:
- react: 19.2.6
- react-native: '*'
-
- '@react-navigation/[email protected]':
- resolution: {integrity: sha512-GI7eJm8/KsZUQaYcXvEExikKurRZRgEsSzyZ7faENfi65yqJBCXjDMwyN1pF6pNW1MoLH1ErDwDivFxY6BzD3w==}
-
'@remirror/[email protected]':
resolution: {integrity: sha512-42aWfPrimMfDKDi4YegyS7x+/0tlzaqwPQCULLanv3DMIlu96KTJR0fM5isWX2UViOqlGnX6YFgqWepcX+XMNg==}
@@ -7347,13 +5984,6 @@ packages:
'@shikijs/[email protected]':
resolution: {integrity: sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==}
- '@shopify/[email protected]':
- resolution: {integrity: sha512-zhlrhA9eiuEzja4wxVvotgXHtqd3qsYbXkQ3rsBfOgbFA9BVeErpDE/yEwtlIviRGEqpuFj/oU5owD6ByaNX+w==}
- peerDependencies:
- '@babel/runtime': '*'
- react: 19.2.6
- react-native: '*'
-
'@sideway/[email protected]':
resolution: {integrity: sha512-IqO/DUQHUkPeixNQ8n0JA6102hT9CmaljNTPmQ1u8MEhBo/R4Q8eKLN/vGZxuebwOroDB4cbpjheD4+/sKFK4Q==}
@@ -7369,9 +5999,6 @@ packages:
'@sinclair/[email protected]':
resolution: {integrity: sha512-Bckbrf1sJFTIVD88PvI0vWUfE3Sh/6pwu6Jov+6xyMrEqnabOxEFAmPSDWjB1FGPL5C1/HfdScwa1imwAtGi9w==}
- '@sinclair/[email protected]':
- resolution: {integrity: sha512-MTBk/3jGLNB2tVxv6uLlFh1iu64iYOQ2PbdOSK3NW8JZsmlaOh2q6sdtKowBhfw8QFLmYNzTW4/oK4uATIi6ZA==}
-
'@sinclair/[email protected]':
resolution: {integrity: sha512-auUj4k+f4pyrIVf4GW5UKquSZFHJWri06QgARy9C0t9ZTjJLIuNIrr1yl9bWcJWJ1Gz1vOvYN1D+QPaIlNMVkQ==}
@@ -7512,80 +6139,6 @@ packages:
peerDependencies:
storybook: ^0.0.0-0 || ^10.0.0 || ^10.0.0-0 || ^10.1.0-0 || ^10.2.0-0 || ^10.3.0-0 || ^10.4.0-0 || ^10.5.0-0 || ^10.6.0-0
- resolution: {integrity: sha512-b9MIk7yhdS1pMCZM8VeNfUlSKVRhsHZNMl5O9SfaX0l0t5wjdgu4IDzGB8bpnGBBOjGST3rRFVsaaEtI4W6f7g==}
- engines: {node: '>=14'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
-
- resolution: {integrity: sha512-BcCkm/STipKvbCl6b7QFrMh/vx00vIP63k2eM66MfHJzPr6O2U0jYEViXkHJWqXqQYjdeA9cuCl5KWmlwjDvbA==}
- engines: {node: '>=14'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
-
- resolution: {integrity: sha512-5BcGCBfBxB5+XSDSWnhTThfI9jcO5f0Ai2V24gZpG+wXF14BzwxxdDb4g6trdOux0rhibGs385BeFMSmxtS3uA==}
- engines: {node: '>=14'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
-
- resolution: {integrity: sha512-KVQ+PtIjb1BuYT3ht8M5KbzWBhdAjjUPdlMtpuw/VjT8coTrItWX6Qafl9+ji831JaJcu6PJNKCV0bp01lBNzQ==}
- engines: {node: '>=14'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
-
- resolution: {integrity: sha512-omNiKqwjNmOQJ2v6ge4SErBbkooV2aAWwaPFs2vUY7p7GhVkzRkJ00kILXQvRhA6miHnNpXv7MRnnSjdRjK8og==}
- engines: {node: '>=14'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
-
- resolution: {integrity: sha512-mURHYnu6Iw3UBTbhGwE/vsngtCIbHE43xCRK7kCw4t01xyGqb2Pd+WXekRRoFOBIY29ZoOhUCTEweDMdrjfi9g==}
- engines: {node: '>=14'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
-
- resolution: {integrity: sha512-Tx8T58CHo+7nwJ+EhUwx3LfdNSG9R2OKfaIXXs5soiy5HtgoAEkDay9LIimLOcG8dJQH1wPZp/cnAv6S9CrR1Q==}
- engines: {node: '>=14'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
-
- resolution: {integrity: sha512-DFx8xa3cZXTdb/k3kfPeaixecQLgKh5NVBMwD0AQxOzcZawK4oo1Jh9LbrcACUivsCA7TLG8eeWgrDXjTMhRmw==}
- engines: {node: '>=12'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
-
- resolution: {integrity: sha512-7EYDbHE7MxHpv4sxvnVPngw5fuR6pw79SkcrILHJ/iMpuKySNCl5W1qcwPEpU+LgyRXOaAFgH0KhwD18wwg6ug==}
- engines: {node: '>=14'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
-
- resolution: {integrity: sha512-8QqtOQT5ACVlmsvKOJNEaWmRPmcojMOzCz4Hs2BGG/toAp/K38LcsMRyLp349glq5AzJbCEeimEoxaX6v/fLrA==}
- engines: {node: '>=14'}
-
- resolution: {integrity: sha512-EbDKwO9GpfWP4jN9sGdYwPBU0kdomaPIL2Eu4YwmgP+sJeXT+L7bMwJUBnhzfH8Q2qMBqZ4fJwpCyYsAN3mt2Q==}
- engines: {node: '>=14'}
-
- resolution: {integrity: sha512-0xiIyBsLlr8quN+WyuxooNW9RJ0Dpr8uOnH/xrCVO8GLUcwHISwj1AG0k+LFzteTkAA0GbX0kj9q6Dk70PTiPA==}
- engines: {node: '>=14'}
- peerDependencies:
- '@svgr/core': '*'
-
- resolution: {integrity: sha512-Ywtl837OGO9pTLIN/onoWLmDQ4zFUycI1g76vuKGEz6evR/ZTJlJuz3G/fIkb6OVBJ2g0o6CGJzaEjfmEo3AHA==}
- engines: {node: '>=14'}
- peerDependencies:
- '@svgr/core': '*'
-
resolution: {integrity: sha512-v1aVuvXdo/BHxJzco9V2xpHrvwWmhfS8t6gziY5wJxd+Z2h8AeJRnAwPD8itCDaGXVBwJ/CaKfxEzTkG0Va0OA==}
engines: {node: '>=10'}
@@ -7904,31 +6457,11 @@ packages:
'@tanstack/[email protected]':
resolution: {integrity: sha512-cQetA74EB+seWySv1TTKr828TnP0u39m6LykwDXIo84SNortpDkp30TMEjkqtYCNP9c40uT/iwl6MLiufEt0Ow==}
- '@tanstack/[email protected]':
- resolution: {integrity: sha512-OMD2HLpNouXEfZJWcKeVKUgQ5n+n3A2JFmBaScpNDUqSrQSjiveC7dKMe53uJUg1nDG16ttFPz2xfilz6i2uVg==}
-
- '@tanstack/[email protected]':
- resolution: {integrity: sha512-LH99WepGVLwlLfuOcQcPK7f3Xg/Gf+xlMMIj9xWu/8oQ3egnDzjr+a4HvEmi6PGob5SmGXvmDKZaH5+In9dzjw==}
-
- '@tanstack/[email protected]':
- resolution: {integrity: sha512-UAGbsIJe9vkV/rbFxUBOPH27Eu6K17KuVLfK1mSy8qoSUJ4qt6JKGMxA8NMUoowbPG0ZnTfRt1Y5SFsqfqlfcA==}
-
- '@tanstack/[email protected]':
- resolution: {integrity: sha512-AUcdBgz8V6sM9axzdqkVmWjYSOETkhr6yAZSBnEFyZT2jo6vkFq3UrpRuxGs6fmhKMWv8FA+ZJGcbaKPaoAElQ==}
- peerDependencies:
- '@tanstack/react-query': ^5.101.0
- react: 19.2.6
-
'@tanstack/[email protected]':
resolution: {integrity: sha512-rLlJXSpkqfizLWgkR5+eLeIk0MvTx/meEIR7LRjxic+qxiQP8zVjq7BqQkiCMNLQBlLfuOLqqr6KO5GtrDlmSg==}
peerDependencies:
react: 19.2.6
- '@tanstack/[email protected]':
- resolution: {integrity: sha512-vXBxa+qeyveVO7OA0jX1z+DeyCA4JKnThKv411jd5SORpBKgkcVnYKCiBgECvADvniBX7tobwBmg01qq9JmMJw==}
- peerDependencies:
- react: 19.2.6
-
'@tanstack/[email protected]':
resolution: {integrity: sha512-nGw095EG7IHx0h5NtlEmzf6vcCTaFNPWdTSuDKazajhN0ct/v/TkekJ9J6KYUCeV1a8/2ZmToc58M+0rrOyn7w==}
engines: {node: '>=20.19'}
@@ -8021,18 +6554,6 @@ packages:
resolution: {integrity: sha512-zIcONa+hVtVSSep9UT3jZ5rizo2BsxgyDYU7WFD5eICBE7no3881HGeb/QkGfsJs6JTkY1aQhT7rIPC7e+0nnA==}
engines: {node: '>=14', npm: '>=6', yarn: '>=1'}
- '@testing-library/[email protected]':
- resolution: {integrity: sha512-k6Mjsd9dbZgvY4Bl7P1NIpePQNi+dfYtlJ5voi9KQlynxSyQkfOgJmYGCYmw/aSgH/rUcFvG8u5gd4npzgRDyg==}
- engines: {node: '>=18'}
- peerDependencies:
- jest: '>=29.0.0'
- react: 19.2.6
- react-native: '>=0.71'
- react-test-renderer: 19.2.6
- peerDependenciesMeta:
- jest:
- optional: true
-
'@testing-library/[email protected]':
resolution: {integrity: sha512-XU5/SytQM+ykqMnAnvB2umaJNIOsLF3PVv//1Ew4CTcpz0/BRyy/af40qqrt7SjKpDdT1saBMc42CUok5gaw+g==}
engines: {node: '>=18'}
@@ -8433,9 +6954,6 @@ packages:
resolution: {integrity: sha512-k/9fOUGO39yd2sCjrbAJvGDEQvRwRnQIZlBz43roGwUZo5SHAmyVvSFyaVVZkicRVCaDXPKlbxrUcBuJoSWunQ==}
- '@types/[email protected]':
- resolution: {integrity: sha512-cMQm7pxu6BxtHyqJ7mQZ2kXWV5SLmugybFdHCBbJ5eHzOo6VhBckEgAT3//rP5FwPHNPeEiq4SmQ5ucBwsOo4Q==}
-
resolution: {integrity: sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==}
@@ -8460,9 +6978,6 @@ packages:
resolution: {integrity: sha512-6C8nqWur3j98U6+lXDfTUWIfgvZU+EumvpHKcYjujKH7woYyLj2sUmff0tRhrqM7BohUw7Pz3ZB1jj2gW9Fvmg==}
- '@types/[email protected]':
- resolution: {integrity: sha512-ynRvcq6wvqexJ9brDMS4BnBLzmr0e14d6ZJTEShTBWKymQiHwlAyGu0ZPEFI2Fh1U53F7tN9ufClWM5KvqkKOw==}
-
resolution: {integrity: sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==}
@@ -8534,9 +7049,6 @@ packages:
peerDependencies:
'@types/react': ^19.2.15
- '@types/[email protected]':
- resolution: {integrity: sha512-XD0WZrHqjNrxA/MaR9O22w/RNidWR9YZmBdRGI7wcnWGrv/3dA8wKCJ8m63Sn+tLJhcjmuhOi629N66W6kgWzQ==}
-
resolution: {integrity: sha512-MXfmqaVPEVgkBT/aY0aGCkRWWtByiYQXo3xdQ8r5RzuFrPiRn8Gar2tQdXSUQ2GKV3bkXckek89V8wQBY2Q/Aw==}
@@ -8586,53 +7098,6 @@ packages:
resolution: {integrity: sha512-JSSwWNy+H0E/01jJEM+hrX6N0OFDzFzeIhHFSAS01tlVaevpG8cFyYRPhS5yjGOvBUx3sqQHVMjCL1CAZZMxBg==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
- '@typescript/[email protected]':
- resolution: {integrity: sha512-wny2pgKjGbiZtnOIHVa3tXC1UfDqxNEFzyPGmiqybedG8hipG2Nfp0l5UxbaKCjkLacUpH/W5bP2hBOMVhCOzg==}
- engines: {node: '>=16.20.0'}
- cpu: [arm64]
- os: [darwin]
-
- '@typescript/[email protected]':
- resolution: {integrity: sha512-Afc7M5zOwo+GpfcYwz5Z8HMB2tPVsui7nNIqEuuFB73MPdVqNn/Wmpe4tP4MRri0AtJnJknoHBaTJ/VDAp/Jhw==}
- engines: {node: '>=16.20.0'}
- cpu: [x64]
- os: [darwin]
-
- '@typescript/[email protected]':
- resolution: {integrity: sha512-iITBa2WjjTI5N9t5l7Z4KoOSI+2zBlhbvFzsD/f8qX8QoKjz/Y4DPyBDgezYi8nkqjjksbgSOJ3/ykzhwrB9cg==}
- engines: {node: '>=16.20.0'}
- cpu: [arm64]
- os: [linux]
-
- '@typescript/[email protected]':
- resolution: {integrity: sha512-hJm/UOqZTr9FHmR7uNm8VGX4oKtfWk0Jem0zPeJFNC8ckGUfSBueyiEYMZB+XmRc1aG4x1E46y3CplP4CLHvGQ==}
- engines: {node: '>=16.20.0'}
- cpu: [arm]
- os: [linux]
-
- '@typescript/[email protected]':
- resolution: {integrity: sha512-du0dzi6y97Po5vDNdPJTyyijHCpaS22JLRnKZEJXBDaO9gCIymOv/5QQokFRuOlQm0bWl3i9PF4OVdGP6uAOQA==}
- engines: {node: '>=16.20.0'}
- cpu: [x64]
- os: [linux]
-
- '@typescript/[email protected]':
- resolution: {integrity: sha512-SsAwfhyHJ1akgBc+99z4+hwdbHsdWaKB8EwCNIMA6JfSLMeUjffrYvxu+vfMyxVtOVOz7RrRXRoiDiu4a2sCtg==}
- engines: {node: '>=16.20.0'}
- cpu: [arm64]
- os: [win32]
-
- '@typescript/[email protected]':
- resolution: {integrity: sha512-DL4u27stv0fo71sVhOzHSwE+YMZsbBijVI+kg5dLDLilSH79WFTJ8RSQ46vJrCMt+Gjlv/JOZP1PuLJDfioYeQ==}
- engines: {node: '>=16.20.0'}
- cpu: [x64]
- os: [win32]
-
- '@typescript/[email protected]':
- resolution: {integrity: sha512-oUGp+Rep/hqMhPunyinsALUwSlzHINSxitifPiSaeqoKOKD2OlR9NE3TaPqwsl4NlGslsOSUXI1JotWQzpYCPg==}
- engines: {node: '>=16.20.0'}
- hasBin: true
-
resolution: {integrity: sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==}
deprecated: Potential CWE-502 - Update to 1.3.1 or higher
@@ -8784,23 +7249,9 @@ packages:
'@vitest/[email protected]':
resolution: {integrity: sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig==}
- '@vitest/[email protected]':
- resolution: {integrity: sha512-7EHDquPthALSV0jhhjgEW8FXaviMx7rSqu8W6oqCoAuOhKov814P99QDV1pxMA3QPv21YudvJngIhjrNI4opLg==}
-
'@vitest/[email protected]':
resolution: {integrity: sha512-h3nDO677RDLEGlBxyQ5CW8RlMThSKSRLUePLOx09gNIWRL40edgA1GCZSZgf1W55MFAG6/Sw14KeaAnqv0NKdQ==}
- '@vitest/[email protected]':
- resolution: {integrity: sha512-MCFc63czMjEInOlcY2cpQCvCN+KgbAn+60xu9cMgP4sKaLC5JNAKw7JH8QdAnoAC88hW1IiSNZ+GgVXlN1UcMQ==}
- peerDependencies:
- msw: ^2.4.9
- vite: ^6.0.0 || ^7.0.0 || ^8.0.0
- peerDependenciesMeta:
- msw:
- optional: true
- vite:
- optional: true
-
'@vitest/[email protected]':
resolution: {integrity: sha512-LEiN/xe4OSIbKe9HQIp5OC24agGD9J5CnmMgsLohVVoOPWL9a2sBoR6VBx43jQZb7Kr1l4RCuyCJzcAa0+dojw==}
peerDependencies:
@@ -8815,33 +7266,21 @@ packages:
'@vitest/[email protected]':
resolution: {integrity: sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA==}
- '@vitest/[email protected]':
- resolution: {integrity: sha512-h5SxD/IzNhZYnrSZRsUZQIC+vD0GY8cUvq0iwsmkFKixRCKLLWqCXa/FIQ4S1R+sI+PGoojkHsdNrbZiM9Qpgw==}
-
'@vitest/[email protected]':
resolution: {integrity: sha512-9GasEBxpZ1VYIpqHf/0+YGg121uSNwCKOJqIrTwWP/TB7DmFCiaBpNl3aPZzoLWfWkuqhbH8vJIVobZkvdo2cA==}
'@vitest/[email protected]':
resolution: {integrity: sha512-s0iufns3iIFitdgm+YR7g1whCAaGtXz459VS9/PqyKDEEFgYIhsHOQmXgIgDuYCt7DeQmiZT0Qe2OA2p4ZPu5A==}
- '@vitest/[email protected]':
- resolution: {integrity: sha512-nOPCmn2+yD0ZNmKdsXGv/UxMMWbMuKeD6GyYncNwdkYDxpQvrPSKYj2rWuDjC2Y4b6w6hjip5dBKFzEUuZe3vA==}
-
'@vitest/[email protected]':
resolution: {integrity: sha512-EmVxeBAfMJvycdjd6Hm+RbFBbA9fKvo0Kx37hNpBYoYeavH3RNsBXWDooR1mgD52dCrxIIuP7UotpfiwOikvcg==}
- '@vitest/[email protected]':
- resolution: {integrity: sha512-YhsdE6xAVfTDmzjxL2ZDUvjj+ZsgyOKe+TdQzqkD72wIOmHka8NuGQ6NpTNZv9D2Z63fbwWKJPeVpEw4EQgYxw==}
-
'@vitest/[email protected]':
resolution: {integrity: sha512-acfZboRmAIf05DEKcBQy33VXojFJjtUdLyo7oOmV9kebb2xdU01UknNiPuPZoJZQyO7DF0gZdTGTpeAzET9QPQ==}
'@vitest/[email protected]':
resolution: {integrity: sha512-vAfasCOe6AIK70iP5UD11Ac4siNUNJ9i/9PZ3NKx07sG6sUxeag1LWdNrMWeKKYBLlzuK+Gn65Yd5nyL6ds+nw==}
- '@vitest/[email protected]':
- resolution: {integrity: sha512-JFKxMx6udhwKh/Ldo270e17QX710vgunMkuPAvXjHSvC6oqLWAHhVhjg/I71q0u0CBSErIODV1Kjv0FQNSWjdg==}
-
'@vitest/[email protected]':
resolution: {integrity: sha512-6EevtBp6OZOPF7bmz36HrGMeP3txgVSrgebWxHOafDXGkhIzfXK14f8KF6MuFfgXXUeHxmpD3BQxkV00/3s5mA==}
@@ -8853,9 +7292,6 @@ packages:
'@vitest/[email protected]':
resolution: {integrity: sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA==}
- '@vitest/[email protected]':
- resolution: {integrity: sha512-FxIY+U81R3LGKCxaHHFRQ5+g6/iRgGLmeHWdp2Amj4ljQRrEIWHmZyDfDYBRZlpyqA7qKxtS9DD1dhk8RnRIVQ==}
-
'@vitest/[email protected]':
resolution: {integrity: sha512-uOJamYALNhfJ6iolExyQM40yIQwDqYnkKtQ5VCiSe17E33H0aQ/u+1GlRuz4LZBk6Mm3sg90G9hEbmEt37C1Zg==}
@@ -8951,14 +7387,6 @@ packages:
resolution: {integrity: sha512-a1wflyaL0tHtJSmLSOVybYhy22vRih4eduhhrkcjgrWGnRfrZtovJ2FRjxuTtkkj47O/baf0R86QU5OuYpz8fA==}
engines: {node: ^20.17.0 || >=22.9.0}
- resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==}
- engines: {node: '>=6.5'}
-
- resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==}
- engines: {node: '>= 0.6'}
-
resolution: {integrity: sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==}
engines: {node: '>= 0.6'}
@@ -9000,16 +7428,6 @@ packages:
resolution: {integrity: sha512-TQf59BsZnytt8GdJKLPfUZ54g/iaUL2OWDSFCCvMOhsHduDQxO8xC4PNeyIkVcA5KwL2phPSv0douC0fgWzmnA==}
engines: {node: '>= 20'}
- resolution: {integrity: sha512-qPgevFvpaQoBaRJVKzr8R7h1WPvV3DtbgRIQlne4le66KBzXx5hNBwo/+NTw67LgkKBlhCzksrdautpUdlls0Q==}
- engines: {node: '>=18.18'}
- hasBin: true
-
- resolution: {integrity: sha512-d8OWDVdZMgjhLUT9ZPgSv/BdFFF9pVuscC0JdUSz3bjwE15gcp6u/o0/JooM2yyAWC49KThFhXlgTXRa9B7yng==}
- engines: {node: '>=18.18'}
- hasBin: true
-
resolution: {integrity: sha512-nHlms9BkP8ZiY79HrwCGiA2DcNaXrAaJrCM/BEqQ7MEsSKyCk+2A76xPGylIfASZSZE0SaU3T0bNSg4rBPIJAQ==}
hasBin: true
@@ -9047,9 +7465,6 @@ packages:
resolution: {integrity: sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==}
- resolution: {integrity: sha512-hCv9AqTQ8ycjpSd3upOJd7vFwW1JaoYQ7tpham03GJ1ca8/65rqn0RpaWpItOAd6ylW9wAw6luXYPJIyPFVOww==}
-
resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==}
engines: {node: '>=8'}
@@ -9058,10 +7473,6 @@ packages:
resolution: {integrity: sha512-g6LhBsl+GBPRWGWsBtutpzBYuIIdBkLEvad5C/va/74Db018+5TZiyA26cZJAr3Rft5lprVqOIPxf5Vid6tqAw==}
engines: {node: '>=18'}
- resolution: {integrity: sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==}
- engines: {node: '>=6'}
-
resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==}
engines: {node: '>=8'}
@@ -9114,12 +7525,6 @@ packages:
resolution: {integrity: sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==}
- resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==}
-
- resolution: {integrity: sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==}
-
resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==}
@@ -9143,12 +7548,6 @@ packages:
resolution: {integrity: sha512-t54MZ7ti5BhOEvzEkgKnWvqj+UbDfWig+DHr5I34xatymPusKLS0lQpNJd8M6DzmIto2QGszHfNKoFIT8tMCZQ==}
- resolution: {integrity: sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ==}
-
- resolution: {integrity: sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==}
-
resolution: {integrity: sha512-S2s3aOytiKdFRdulw2qPE51MzjzVOisppcVv7jVFR+Kw0kxwvFrDcYA0h7Ndqbmj0HkMIXYWaoj7fli8kgx1eg==}
engines: {node: '>=12.0.0'}
@@ -9216,90 +7615,17 @@ packages:
resolution: {integrity: sha512-9EdtWM/sSfXLOGLwSn+GS6pIXyBnL07/8gyJlwFXjWy4DxMOyItqyUT29d4lQiS380EZwYlX7/At4PgBS+m2aA==}
engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0}
- resolution: {integrity: sha512-hR3GwrRwHUfYwGfrisXPIDP3JcYfBrW7wKE7+Au6wDYl7fm/ka1NEII6kORzxNU556JjfidZeBsO10kYvtV1aw==}
- 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:
- '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0
-
- resolution: {integrity: sha512-hYm+XLYRMvupxiQzrvXUj7YyvFFVfv5gI0R71AJzudg1g2AI2vyCPPIFEBjk162/wFzti3inBHo7isWFuEVS/A==}
- 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==}
-
- resolution: {integrity: sha512-SPD0J6qjJn8231i0HZhlAGH6NORe+QvRSQM2mwQEzJ2Fb3E4ruWTiiicPlHjmeWShDXLcvoorOCXjeR7k/lyWA==}
-
- resolution: {integrity: sha512-LhD0xdoedDw7ansQgXbB2DADLZIK/LRXuWNBPuVzMc5S2WK5GyT89tCM+cQzxFGO0mGyLK6D5TrVOJJzAoDy8Q==}
-
- resolution: {integrity: sha512-ycduwJbvdvIMmVvlAZqGggS+pm5Eu4Bk9pcV9Sm2Z4PJNRVsKkv0g7vHj+LeuC1gHTeF67sJXFOq61IlqCa2hA==}
-
- resolution: {integrity: sha512-g4aaCrDDOsWjbm0PUUeVnkcVd6AKJsVc/MbnPhEotEpkeJQP6b8nzewohQi7+QS8UyPehOhGWn0nOwjvWpmMvQ==}
-
resolution: {integrity: sha512-E/VlAEzRrsLEb2+dv8yp3bo4scof3l9nR4lrld+Iy5NyVqgVYUJnDAmunkhPMisRI32Qc4iRiz425d8vM++2fg==}
peerDependencies:
'@babel/core': ^7.0.0 || ^8.0.0-0
- resolution: {integrity: sha512-OOl3lqNQ4IagJfsNgtxuna0wpTWt1BswdyktGTOJ5EJCgdQUk/B2vaj/jsl03+kMyuIvpxKioVtbTzxh3mdvvQ==}
- peerDependencies:
- '@babel/runtime': ^7.20.0
- expo: '*'
- expo-widgets: ^57.0.21
- react-refresh: '>=0.14.0 <1.0.0'
- peerDependenciesMeta:
- '@babel/runtime':
- optional: true
- expo:
- optional: true
- expo-widgets:
- optional: true
-
- resolution: {integrity: sha512-EkFcNoE23HVzQT6ZNXs/adN8+G7rqEAF6tQn6LpRPYa1YY7wmX5GxhJF0kaYMNtBndNrMTN4+0rYE17VG13KFg==}
- peerDependencies:
- '@babel/runtime': ^7.20.0
- expo: '*'
- expo-widgets: ^57.0.6
- react-refresh: '>=0.14.0 <1.0.0'
- peerDependenciesMeta:
- '@babel/runtime':
- optional: true
- expo:
- optional: true
- expo-widgets:
- optional: true
-
resolution: {integrity: sha512-lBY4jxsNmCnSiu7kquw8ZC9F4+XLMOKypT3RnNHPvU2Kpd4W0xaPuLr5ZkRyOsvLYAY4yaW1ZwTW4xB7NIiZzg==}
engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0}
peerDependencies:
'@babel/core': ^7.11.0 || ^8.0.0-beta.1
- resolution: {integrity: sha512-NQGA7LcfCpSzIbGRbkgjgdWkjy7HI+Th5VLxTJfW5EeaAf3fnS+xWQaQOCYiny+q6QSvxqoSO04vCx+4u++EJw==}
-
resolution: {integrity: sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==}
@@ -9310,9 +7636,6 @@ packages:
resolution: {integrity: sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==}
engines: {node: 18 || 20 || >=22}
- resolution: {integrity: sha512-Q5kjXpVH5I3ItykNzbWmfWnNryFN1ZTWp10k9/PKJuS0RnoKR7jTrHEJODR4fn04bRomq7TJwie/Dr9fj/GoGQ==}
-
resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==}
@@ -9336,10 +7659,6 @@ packages:
resolution: {integrity: sha512-Ko0uX15oIUS7wJ3Rb30Fs6SkVbLmPBAKdlm7q9+ak9bbIeFf0MwuBsQV6z7+X768/cHsfg+WlysDWJcmthjsjQ==}
- resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==}
- engines: {node: '>=8'}
-
resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==}
@@ -9366,9 +7685,6 @@ packages:
resolution: {integrity: sha512-oP5VkATKlNwcgvxi0vM0p/D3n2C3EReYVX+DNYs5TjZFn/oQt2j+4sVJtSMr18pdRr8wjTcBl6LoV+FUwzPmNA==}
engines: {node: '>=18'}
- resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==}
-
resolution: {integrity: sha512-d0II/GO9uf9lfUHH2BQsjxzRJZBdsjgsBiW4BvhWk/3qoKwQFjIDVN19PfX8F2D/r9PCMTtLWjYVCFrpeYUzsw==}
deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
@@ -9376,13 +7692,6 @@ packages:
resolution: {integrity: sha512-tzPjzCxygAKWFOJP011oxFHs57HzIhOEracIgAePE4pqB3LikALKnSzUyU4MGs9/iCEUuHlAJTjTc5M+u7YEGg==}
- resolution: {integrity: sha512-sXaHZicyEEmY86WyueLTQesbeoH/mquvarJaQNbjuOQO+7gbFcDEWqKmcWA4cOTLzFlfgvkiVxolk1k5bBIpmg==}
-
- resolution: {integrity: sha512-PyJxiNtA5T2PlLIeBot4lbp7rj4OadzjnMZD/G5zuBNt8ei/yCU7+wW0h2bag9vr8c+/WuRWmSxbqAl9hL1rBA==}
- engines: {node: '>= 5.10.0'}
-
resolution: {integrity: sha512-apC2+fspHGI3mMKj+dGevkGo/tCqVB8jMb6i+OX+E29p0Iposz07fABkRIfVUPNd5A5VbuOz1bZbnmkKLYF+wQ==}
engines: {node: '>= 5.10.0'}
@@ -9487,10 +7796,6 @@ packages:
resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==}
engines: {node: '>=6'}
- resolution: {integrity: sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==}
- engines: {node: '>= 6'}
-
resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==}
engines: {node: '>=6'}
@@ -9555,10 +7860,6 @@ packages:
resolution: {integrity: sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA==}
engines: {node: '>= 16'}
- resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==}
- engines: {node: '>= 8.10.0'}
-
resolution: {integrity: sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==}
engines: {node: '>= 14.16.0'}
@@ -9574,28 +7875,13 @@ packages:
resolution: {integrity: sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==}
engines: {node: '>=18'}
- resolution: {integrity: sha512-zdLEwNo3aUVzIhKhTtXfxhdvZhUghrnmkvcAq2NoDd+LeOHKf03H5jwZ8T/STsAlzyALkBVK552iaG1fGf1xVQ==}
- engines: {node: '>=12.13.0'}
- hasBin: true
-
resolution: {integrity: sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ==}
engines: {node: '>=6.0'}
- resolution: {integrity: sha512-p03azHlGjtyRvFEee3cyvtsRYdniSkwjkzmM/KmVnqT5d7QkkwpJBhis/zCLMYdQMVJ5tt140TBNqqrZPaWeFA==}
-
resolution: {integrity: sha512-1R5Fho+jBq0DDydt+/vHWj5KJNJCKdARKOCwZUen84I5BreWoLqRLANH1U87eJy1tiASPtMnGqJJq0ZsLoRPOw==}
- resolution: {integrity: sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==}
-
- resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==}
- engines: {node: '>=8'}
-
resolution: {integrity: sha512-Wdy2Igu8OcBpI2pZePZ5oWjPC38tmDVx5WKUXKwlLYkA0ozo85sLsLvkBbBn/sZaSCMFOGZJ14fvW9t5/d7kdA==}
engines: {node: '>=8'}
@@ -9617,18 +7903,10 @@ packages:
resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==}
engines: {node: '>=6'}
- resolution: {integrity: sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw==}
- engines: {node: '>=4'}
-
resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==}
engines: {node: '>=18'}
- resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==}
- engines: {node: '>=6'}
-
resolution: {integrity: sha512-bXfOC4QcT1tKXGorxL3wbJm6XJPDqEnij2gQ2m7ESQuE+/z9YFIWnl/5RpTiKWbMq3EVKR4fRLJGn6DVfu0mpw==}
engines: {node: '>=18.20'}
@@ -9637,9 +7915,6 @@ packages:
resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==}
engines: {node: '>= 12'}
- resolution: {integrity: sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==}
-
resolution: {integrity: sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==}
@@ -9650,10 +7925,6 @@ packages:
resolution: {integrity: sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA==}
- resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==}
- engines: {node: '>=0.8'}
-
resolution: {integrity: sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==}
engines: {node: '>=6'}
@@ -9684,13 +7955,6 @@ packages:
resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==}
- resolution: {integrity: sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==}
-
- resolution: {integrity: sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==}
- engines: {node: '>=12.5.0'}
-
resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==}
engines: {node: '>= 0.8'}
@@ -9732,10 +7996,6 @@ packages:
resolution: {integrity: sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==}
engines: {node: ^12.20.0 || >=14}
- resolution: {integrity: sha512-taEtr3ozUmOB7it68Jll7s0Pwm+aoiHyXKrEC8SEodL4rNpdfDLqa7PfBlrgFoCNNdR8ImL+muti5IGvktJAAg==}
- engines: {node: '>= 6'}
-
resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==}
@@ -9743,14 +8003,6 @@ packages:
resolution: {integrity: sha512-pJDh5/4wrEnXX/VWRZvruAGHkzKdr46z11OlTPN+VrATlWWhSKewNCJ1futCO5C7eJB3nPMFZA1LeYtcFboZ2A==}
engines: {node: '>=0.10.0'}
- resolution: {integrity: sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==}
- engines: {node: '>= 0.6'}
-
- resolution: {integrity: sha512-9mAqGPHLakhCLeNyxPkK4xVo746zQ/czLH1Ky+vkitMnWfWZps8r0qXuwhwizagCRttsL4lfG4pIOvaWLpAP0w==}
- engines: {node: '>= 0.8.0'}
-
resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
@@ -9764,10 +8016,6 @@ packages:
resolution: {integrity: sha512-ysOGlgTFbN2/Y6Cg3Iye8YKulHw+R2fNXHrgSmXISQdMnomY6eNDprVdW9R5xBguEqI954+S6709UyiO7B+6OQ==}
- resolution: {integrity: sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ==}
- engines: {node: '>= 0.10.0'}
-
resolution: {integrity: sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==}
engines: {node: ^14.18.0 || >=16.10.0}
@@ -9805,9 +8053,6 @@ packages:
resolution: {integrity: sha512-7Vv6asjS4gMOuILabD3l739tsaxFQmC+a7pLZm02zyvs8p977bL3zEgq3yDk5rn9B0PbYgIv++jmHcuUab4RhA==}
engines: {node: '>=18'}
- resolution: {integrity: sha512-OM4cAF3D6VtH/WkLtWvyNC56EZVXsZdU3iqaMG2B4WvYrlqU831pc4UtG5yp0sE9z8Y02wVN7PjW5Zf9Gt0f1Q==}
-
resolution: {integrity: sha512-BRWgOLKkFeCgRudR6zrs8p9XJZcE14grzKMMssoYrk6krtuEZ7MTKPIY5RzOnqsEKIR9kst7wNzphttraT+Yqw==}
@@ -9824,58 +8069,23 @@ packages:
resolution: {integrity: sha512-AzlgcsCbUMymkADOJtQm3wO9S3ltPfYOFD5033keQn9NJzIbtnZj+UdBJe7DYml/8TdbtHJW3j58SOnKhWY/5g==}
- resolution: {integrity: sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA==}
- engines: {node: '>=14'}
- peerDependencies:
- typescript: '>=4.9.5'
- peerDependenciesMeta:
- typescript:
- optional: true
-
resolution: {integrity: sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==}
resolution: {integrity: sha512-+R08/oI0nl3vfPcqftZRpytksBXDzOUveBq/NBVx0sUp1axwzPQrKinNx5yd5sxPu8j1wIy8AfnVQ+5eFdha6Q==}
- resolution: {integrity: sha512-Q+xVJLoGOeIMXZmbUK4HYk+69cQH6LudR0Vu/pRm2YlU/hDV9CiS0gKUMaWY5f2NeUH9C1nV3bsTlCo0FsTV1Q==}
-
resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==}
engines: {node: '>= 8'}
- resolution: {integrity: sha512-fJAcud6B3rRu+KHYk+Bwf+WFL2MDCJJ1XG9x137tJQ0xYxor7XziQtuGFbWNdqrvF4Tk26O3H73nfVqXt/fW1A==}
-
- resolution: {integrity: sha512-TizTzUddG/xYLA3NXodFM0fSbNizXjOKhqiQQwvhlspadZokn1KDy0NZFS0wuEubIYAV5/c1/lAr0TaaFXEXzw==}
-
- resolution: {integrity: sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==}
- engines: {node: '>=8.0.0'}
-
resolution: {integrity: sha512-OA0mILzGc1kCOCSJerOeqDxDQ4HOh+G8NbOJFOTgOCzpw7fCBubk0fEyxp8AgOL/jvLgYA/uV0cMbe43ElF1JA==}
engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0, npm: '>=7.0.0'}
- resolution: {integrity: sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==}
- engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0}
-
- resolution: {integrity: sha512-u/O3vwbptzhMs3L1fQE82ZSLHQQfto5gyZzwteVIEyeaY5Fc7R4dapF/BvRoSYFeqfBk4m0V1Vafq5Pjv25wvA==}
- engines: {node: '>= 6'}
-
resolution: {integrity: sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==}
- resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==}
- engines: {node: '>=4'}
- hasBin: true
-
resolution: {integrity: sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ==}
engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0, npm: '>=7.0.0'}
@@ -10055,9 +8265,6 @@ packages:
resolution: {integrity: sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==}
engines: {node: '>=18'}
- resolution: {integrity: sha512-Ukq0owbQXxa/U3EGtsdVBkR1w7KOQ5gIBqdH2hkvknzZPYvBxb/aa6E8L7tmjFtkwZBu3UXBbjIgPo/Ez4xaNg==}
-
resolution: {integrity: sha512-okzr3f11N6WuqYtZSvm+F776mB41wRZMhKP+hc34YdW+KmtYYK9iqvHSwo2k9FEH3fhGXvOPV6yz2IcSrfRUDg==}
@@ -10068,22 +8275,6 @@ packages:
resolution: {integrity: sha512-rBMW+F2TXryBwB54Q0d8drNEI+TfoS9JpNTAoVpukbWEhjXQq4rySFYLaqXMFXwdv61Zb2OHtj5bviSoimqxRQ==}
engines: {node: '>=18'}
- resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==}
- peerDependencies:
- supports-color: '*'
- peerDependenciesMeta:
- supports-color:
- optional: true
-
- resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==}
- peerDependencies:
- supports-color: '*'
- peerDependenciesMeta:
- supports-color:
- optional: true
-
resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==}
engines: {node: '>=6.0'}
@@ -10103,10 +8294,6 @@ packages:
resolution: {integrity: sha512-GtpQYB283KrPp6nRw50q3U9/VfOutZOe103qlN7BPP6Ad27xYnOIWv4lPzo8HCAL+mMZofJ9KEy30fq6MfaK6Q==}
- resolution: {integrity: sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==}
- engines: {node: '>=0.10'}
-
resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==}
engines: {node: '>=10'}
@@ -10146,9 +8333,6 @@ packages:
resolution: {integrity: sha512-eXTJmRbm2TIt9MgWTsOH1wEuhew6XGZcMeGKCtLedIg/NCsg1iBePXkceTdK4Fii7pzmN9tGsZhKzZ4h7O/fxw==}
engines: {node: '>=8'}
- resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==}
-
resolution: {integrity: sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==}
engines: {node: '>=10'}
@@ -10180,10 +8364,6 @@ packages:
resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==}
engines: {node: '>=6'}
- resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==}
- engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16}
-
resolution: {integrity: sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==}
engines: {node: '>=0.10'}
@@ -10206,9 +8386,6 @@ packages:
resolution: {integrity: sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==}
- resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==}
-
resolution: {integrity: sha512-qejHi7bcSD4hQAZE0tNAawRK1ZtafHDmMTMkrrIGgSLl7hTnQHmKCeB45xAcbfTqK2zowkM3j3bHt/4b/ARbYQ==}
engines: {node: '>=0.3.1'}
@@ -10223,15 +8400,9 @@ packages:
resolution: {integrity: sha512-2xMCmOoMrdQIPHdsTawECdNPwlVFB9zGcz3kuhmBO6U3oU+UQjsue0i8ayLKpgBcm+hcXPMVSGUN9d+pvJ6+VQ==}
- resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==}
-
resolution: {integrity: sha512-O3zJUFUYHJKgzPqioHxfxzBzlSC1eXCSr79gMSBKBP5AgjjpmrydMsMLotEg9fAJF36vdUncb+4ndRNxoPdlSQ==}
- resolution: {integrity: sha512-Ndrrf6BMPalkQPd/zubL+4YghH2J9NspapQ09uDXwYbvOPkP0oaqf5CkcwJ0b50kS2O3ul6yVu+jz+RY62Cejg==}
-
resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==}
engines: {node: '>=6.0.0'}
@@ -10245,9 +8416,6 @@ packages:
resolution: {integrity: sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==}
- resolution: {integrity: sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==}
-
resolution: {integrity: sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==}
@@ -10257,22 +8425,12 @@ packages:
resolution: {integrity: sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==}
- resolution: {integrity: sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==}
- engines: {node: '>= 4'}
-
resolution: {integrity: sha512-2vmYIoqjze2d+kakP8S/nS5shfsl587kzwEjcGlTdiksUVgFHnFCsLYDVj/JNqJVOQZGSYBTmuycv0PodwmnMQ==}
resolution: {integrity: sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==}
- resolution: {integrity: sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw==}
-
- resolution: {integrity: sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==}
-
resolution: {integrity: sha512-MVUtAugQMOff5RnBy2d9N31iG0lNwg1qAoAOn7pOK5wf94WIaE3My2p3uwTQuvS2AcqchkcR3bHByjaM0mmi7Q==}
engines: {node: '>=20'}
@@ -10471,17 +8629,10 @@ packages:
resolution: {integrity: sha512-i6UzDscO/XfAcNYD75CfICkmfLedpyPDdozrLMmQc5ORaQcdMoc21OnlEylMIqI7U8eniKrPMxxtj8k0vhmJhA==}
engines: {node: '>=14'}
- resolution: {integrity: sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==}
- engines: {node: '>= 0.8'}
-
resolution: {integrity: sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==}
engines: {node: '>= 0.8'}
- resolution: {integrity: sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==}
-
resolution: {integrity: sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==}
@@ -10529,9 +8680,6 @@ packages:
resolution: {integrity: sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==}
- resolution: {integrity: sha512-Sk5V6wVazPhq5MhpO+AUxJn5x7XSXGl1R93Vn7i+zS15KDVxQijejNCrz8340/2bgLBjR9GtEG8ZVKONDjcqGQ==}
-
resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==}
engines: {node: '>= 0.4'}
@@ -10687,10 +8835,6 @@ packages:
resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==}
engines: {node: '>= 0.6'}
- resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==}
- engines: {node: '>=6'}
-
resolution: {integrity: sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==}
@@ -10741,604 +8885,69 @@ packages:
resolution: {integrity: sha512-PMARsyh/JtqC20HoGqlFcIlQAyqUtW4PlI1rup1uhYJtKuwAjbvWi3GQMAn+STdHum/dk8xrKfUM1+5SAwpolA==}
engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0}
- resolution: {integrity: sha512-q31YwcXyymviAmdrtDfAg3Dld4VMxLCNAfgMHip7vZpPX4lzF/AfwsywqBJUAjQnJknzaNAkzqvMVjO5XmKYDA==}
- peerDependencies:
- expo: '*'
+ resolution: {integrity: sha512-ZgEeZXj30q+I0EN+CbSSpIyPaJ5HVQD18Z1m+u1FXbAeT94mr1zw50q4q6jiiC447Nl/YTcIYSAftiGqetwXCA==}
- resolution: {integrity: sha512-t/CxeLio0NjY9/cOak1tQp62/hAUjzJxmhR4rVUR7K5bb9YoEtfl1ZekTn+Iuh+dYOMYzF0l72ODMSmY3CR1NA==}
+ resolution: {integrity: sha512-D1dKN+cmyPWuvB+G2SREQDzPY1agpBIcTa9sJxOPMCNeH3gwzhqJRDWCXW3gg0y//+LQ/8j52JbMROWyrKdMdw==}
+ engines: {node: '>= 16'}
peerDependencies:
- expo: '*'
+ express: '>= 4.11'
- resolution: {integrity: sha512-zDIQkUr0NM2S7YRj98Zohf/OBuM1q0o4ctxLz1C1oe4/33lHNLjp+2v3qUtBWVwn0zKka8UGADmS8M+83Wi6pw==}
- peerDependencies:
- expo: '*'
- react: 19.2.6
- react-native: '*'
+ resolution: {integrity: sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==}
+ engines: {node: '>= 18'}
- resolution: {integrity: sha512-TA6MRQq1HL0N6KGvNMzL6djdH5tGJ/eHPIhML+6bVu52mnXldmup2swdvP37zDnvoMUUXRVGsvwVHFmvhCbW6Q==}
- peerDependencies:
- expo: '*'
- react: 19.2.6
- react-native: '*'
+ resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==}
- resolution: {integrity: sha512-FzO0gnVmlrKmNoox7xc/795uNiuuqnYBovo2kgnNICDKJ0kDi1Y5UJjqX+NATxCelZcNv5BtWs3POkKJADhNCA==}
- peerDependencies:
- expo: '*'
- expo-asset: '*'
- react: 19.2.6
- react-native: '*'
+ resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==}
- resolution: {integrity: sha512-4u/CIMCrQ88QO9AKSaw61Vva+Gmtil254xBjDB2SuAeyN/I9mNxZKkG0xtcm3iDSmJFMuHkYDKNo3RvTn3sz+Q==}
- peerDependencies:
- react: 19.2.6
- react-native: '*'
+ resolution: {integrity: sha512-jt2DW/aNFNwke7AUd+Z+e6pz39KO5rzdbbFCg2sGafS4mk13MI7Z8O5z9cADNn5lhGODIgLwug6TZO2ctf7kcw==}
+ engines: {node: '>=6.0.0'}
- resolution: {integrity: sha512-Q+3aZ63eQCkdB6/FZrO/lfacNAg/j8JCeKQL2nBdf6vBeOo1Y2PKYx1/vK+U5LaRnIo/0tMGmCOzZ1JGhTeMIw==}
- peerDependencies:
- expo: '*'
- react: 19.2.6
- react-native: '*'
- react-native-web: '*'
- peerDependenciesMeta:
- react-native-web:
- optional: true
+ resolution: {integrity: sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==}
+ engines: {node: '>=8.6.0'}
- resolution: {integrity: sha512-HWICri4+1ao7S6QEfcorxVumXDiDnx1guGGewjZgGJWLGxFYs0RgH8ujBs+lkTzBkMmlwADaWSlaesR+nDJt5Q==}
- peerDependencies:
- expo: '*'
- react: 19.2.6
- react-native: '*'
+ resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==}
- resolution: {integrity: sha512-3eK1kZRwCdMizQLlM/PPlPwjaPnB5qKvdRDMBMnB1ZxmvWJBf9TB4uEO4DMMfIPaFUxYFs29dsR5fPr1gh3FTQ==}
- peerDependencies:
- expo: '*'
- react-native: '*'
+ resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==}
- resolution: {integrity: sha512-ShDwaKnh3UieCQ/dG0kO8PuicTTatn3WDGmXbq/fukyzPXWhdUxf37DINVDQS6D3DDG7nfqItij+QvnDHSQhTg==}
- peerDependencies:
- expo: '*'
- react-native: '*'
+ resolution: {integrity: sha512-n11RGP/lrWEFI/bWdygLxhI+pVeo1ZYIVwvvPkW7azl/rOy+F3HYRZ2K5zeE9mmkhQppyv9sQFx0JM9UabnpPQ==}
- resolution: {integrity: sha512-xwegXQw3ATgeL1ZuqbSNrGzOeG+zNeh6Z6DSJk825Qpa3TEQQ1kG3ioE1p3g/SNF373BAVz2iBKUTSytlIbBRA==}
- peerDependencies:
- expo: '*'
+ resolution: {integrity: sha512-8JnbkQ4juDyvYs4mgFGQqg4yCYtFDtUtmp2QIQq11ZZe5CFQ5wcqm1rqDgAh/QdMySuBnPzMUiJUNZG5N/AiQw==}
- resolution: {integrity: sha512-7giMK6BLL685GECHem2UAQvS473ImZLi5l+Q5tq+XSyv6I9UNVPs0p07mKwgBzq8z7DR3d4nTl702ziFxTjO3Q==}
- peerDependencies:
- expo: '*'
+ resolution: {integrity: sha512-LB+xjSTEbjHE1cWsxu+tN2Xqr1kpi+V9aADI7sVM5ZMaXyYGPHULQMzpJMYqOTULK/73pUkWVzzObFRBkPr+hg==}
- resolution: {integrity: sha512-DDqinc0EHMsqDUqkfad6c3pc5vr2oCxwAojSGVSBZe5paRIPgQTEWA+x76Qel13F1LO2LSG+DLs5W1vk3JwUow==}
- peerDependencies:
- expo: '*'
+ resolution: {integrity: sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==}
- resolution: {integrity: sha512-F6oAHaDn9j3L/gyMGE+OalriX6PHZWnZLxpN5jc6crTrp8f6hSwGhmsHpAvdOzijfMjyi3R2UkcISFsCIIQYFA==}
- peerDependencies:
- expo: '*'
- react-native: '*'
+ resolution: {integrity: sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==}
- resolution: {integrity: sha512-f2LhS6FaQBKACSNQ1opPR7bg6ehAJnrDuEkewqINJkTDryhGY7Y6P21uoXWJzEc9IFJAjUKan8A8AOztibGtMQ==}
- peerDependencies:
- expo: '*'
- react-native: '*'
+ resolution: {integrity: sha512-jKmm9YtsNXN789RS/0mSzOC1NUq9mkVd65vbSSVsKdjGvYXBuE4oWe2QOEoFeRmJg+lPuZxpmrfFclNhoRMneQ==}
- resolution: {integrity: sha512-F47VdzOHYc19FhI/jBgctpO8a5UskTIxG6a1E5t3W5gF8VImuvBQffdXXfLHhsuCl7dS3v3U0R45cleeVXO1Zg==}
+ resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==}
+ engines: {node: '>=12.0.0'}
peerDependencies:
- expo: '*'
+ picomatch: ^3 || ^4
+ peerDependenciesMeta:
+ picomatch:
+ optional: true
- resolution: {integrity: sha512-H7m9ENtVYz4FpJktQj+z/njIN1t7kOEaKCv8Qgv2SdAlyFTW8s2EnufxPoSlg2zUTanaauJ6wrR6XESHwW7kpw==}
- peerDependencies:
- expo: '*'
- react-native: '*'
-
- resolution: {integrity: sha512-OGU3Apwx1fr8HDUD9F66tk/CuxiIhYkHci4837vX7ZckS6yI/yL6gvcmgqvNCoE4pDV9demjaGEZmSJ2xTrUhg==}
- peerDependencies:
- expo: '*'
- react-native: '*'
-
- resolution: {integrity: sha512-jyEMDUticH+dhcL3GHa2aiifOvGXJsmb3oVT2R2q4i8bN7Bddy61+NkpMmuS2VAZrvoLQwf0TJJ/1vi1ukvutA==}
- peerDependencies:
- expo: '*'
-
- resolution: {integrity: sha512-1A0/FICR3CgrH43FeiDQP3l5eHDmiMoh4EjXfhfoHHkMgdBQdyD0kwDWskiGZlQ3E0Nd0LHkCFH6vJ1ofm/jow==}
- peerDependencies:
- expo: '*'
-
- resolution: {integrity: sha512-qBwM5oxDZ3I9kwFD3pUE1oK/WNv9artoEKO6UpqhQgNRr0XA1ALRVWYjkF4+ge9lUNDRehjTm/jenINkzqg84g==}
- peerDependencies:
- expo: '*'
-
- resolution: {integrity: sha512-VSPi6Kldu0EpPkC2e3bv3QNAUVDogbz1tTj7KgcdbsuUySt0hu24g4f1fJ/YjYzCw9G1l755x4QQctcX1j7UEA==}
-
- resolution: {integrity: sha512-w7/ERvQFrGP2apTO9lDtZ+O6JQIhfakL7+Xqzh+rfMO9B4LB4qwrz+YvLgir8KFRVX64JHBnRuYBVLY1oQZcqw==}
- peerDependencies:
- expo: '*'
- react-native: '*'
-
- resolution: {integrity: sha512-1vkZRadOsIputFDBcclqBa1pO3iXOO6iIsdqJipQWw4V5TSnWgmRTuOF7ro8IzrVue+PHbum++KCG3Tawem4cg==}
- peerDependencies:
- expo: '*'
- react-native: '*'
-
- resolution: {integrity: sha512-QyS9L1Kh9sKJg4gfU6rdbpxpmH+DyzBX8z6jVvXMUDoqLr1GqmkO/Wu379KCXjL///kWbhpNlbi7AgBuj4VdIQ==}
- peerDependencies:
- expo: '*'
- react: 19.2.6
- react-native: '*'
-
- resolution: {integrity: sha512-7WOMC2oA6xCfOm8bbofqWn2bIqyWFm7YLEnpc/gA1MJH0Ll0TfT/3+CqRkoW2eNRWMS8sxrz5WukUmSvmNquHA==}
- peerDependencies:
- expo: '*'
- react: 19.2.6
- react-native: '*'
-
- resolution: {integrity: sha512-m/n8maxqNcHk6ZDhuqXBfD5Kt1Iz3M8xykVgdB0iSCIXvF70IqWXmQhX8Psswhrp8eZ+3r0mAD0Jh/2gFA3QaA==}
- peerDependencies:
- expo: '*'
- react: 19.2.6
- react-native: '*'
-
- resolution: {integrity: sha512-/AG2Kljbqfgxu+GchI2YFIbxiF9cPsIpCy4iNDzlRiZk9rvR6BwRfB6gfQVu3V2ExaoGf2h5IsEnqVI5MYNBAg==}
- peerDependencies:
- expo: '*'
- react: 19.2.6
- react-native: '*'
-
- resolution: {integrity: sha512-8VhbnxlIrfXjP0syZr1JT197nafYicQu9119adOJnX62osU9Cw+PdDnAx/6LxuKJRzQdwxOMq7b7eWjhNL5zAQ==}
- peerDependencies:
- expo: '*'
-
- resolution: {integrity: sha512-qucUXtwtJdtECKSQK5D6TQBc/0SxKj7s5wQ4mrfSxhZsHrS9a4rcxINl/gbruMaY9spTXStco32ST4pV0vXmxw==}
- peerDependencies:
- expo: '*'
-
- resolution: {integrity: sha512-uhrZKLT/cTl2mXyR28kPpVkS5O+PK9N1QA/07IFM4f5T4g0lTW1JHT3NEWwEEsGFldPmVX4j7LwUVVZxE+woug==}
- peerDependencies:
- expo: '*'
-
- resolution: {integrity: sha512-6Of7SzyFVC+WFuFxhD4+nRTQ9joqldPhbiVWRsumg4ybttKmY8GxrnXAUSIDfa9DSk9PhgIAy2C1c5y1+CnU3g==}
- peerDependencies:
- expo: '*'
-
- resolution: {integrity: sha512-cgTe1NqzQdYs/WN+3nIY5IZg8s0pb0xaTUbhYvxQDn137GbwRfHoGM2se3m3Vsl4Qu+B9G4RPEK5WJDEU2Do7g==}
-
- resolution: {integrity: sha512-9kYZECLKE3pYZQs+kt3+ggY83Lfryog9/UEo3HJKGcHUZeKKtlFBIPFjI4LzREubsvjP7AsvG0FdEX9EquIoAQ==}
-
- resolution: {integrity: sha512-28lkFImeXTS+bhAjuCFV7w7tW5bXg27BJVrxv+nC/nyYa86qEa0oFeHwqol6ha5k4pdVDQgBF09GM4A1k76Ssg==}
- peerDependencies:
- expo: '*'
- react: 19.2.6
-
- resolution: {integrity: sha512-GqgH746wtJImmsbyHmCQoi7cOslKuWQBbJHXr53S35Bpf5UvxCAztvnitUEd7D0QvFN2rvkOhylbZpgZZfBLlQ==}
- peerDependencies:
- expo: '*'
- react: 19.2.6
-
- resolution: {integrity: sha512-CpS8eMqoIWcHVGKV66zbDvzotCw9qYp3f8CuI9N+h1LaO0tMLUzBpkhAKePUsXlpN3yolYlHFSPkfVZ/uSh+iA==}
- peerDependencies:
- expo: '*'
- react: 19.2.6
- react-native: '*'
-
- resolution: {integrity: sha512-bfTyiPb8szacs8XkGowXt5ssH/vbF26vFG8WUWQar8CcRpQcIzXY980ZkP7pK7Pcdy5MattwFdujrWOxwv5s3Q==}
- peerDependencies:
- react: 19.2.6
- react-native: '*'
-
- resolution: {integrity: sha512-e1alfHNJdywIfJkCuKMc6M3hBfAGPd2gKMeF/6V7qwFWzHCS2mTBqU+KaO4FLpltA5Nt6CYEx6zmUlGfUF+8lA==}
- peerDependencies:
- react: 19.2.6
- react-native: '*'
-
- resolution: {integrity: sha512-8Ffl4UTbOsQeGT0v5fxMbyPHyPMPnhSPDFQJa8p9rjJrthFoAtNi+fL6Ssmrvf1/7dmPq1mVY52MEt0TMEfgjA==}
- peerDependencies:
- expo: '*'
- react: 19.2.6
-
- resolution: {integrity: sha512-qB/mDG2dYdl+EvUeQuqP8KFYCFgFCQjJYdWIHo8SFBgDzMYmdF286DFY2M1M9Okr99wkb5M4tgA3aCcwv3aEQA==}
- peerDependencies:
- expo: '*'
-
- resolution: {integrity: sha512-pPIIcKR73OShwlWMg8H90WRzKUd2krDdKlKAwuQV1FtUwE7H3hQEFw0ePFQY9yFoGMF/77ryYwNKfI5umMcCog==}
- peerDependencies:
- expo: '*'
-
- resolution: {integrity: sha512-Hj5NjZRlfccazhKab+wK19leRVUr1Y/PUERaRvegIbUSkq4GVxKq6lU9QHlKQyC16MdD/VS4iwsiLivB4o7lvQ==}
- hasBin: true
-
- resolution: {integrity: sha512-lj2nsAKMMRLXSFnGgaaQrWJ2fdSpLPc/bca6Rkiw4g8zYPn7qX4MRUJgavvzm/hBrzvMnlhXVgJtidOGuwBh+w==}
- hasBin: true
-
- resolution: {integrity: sha512-eAJwa5u30r4BTT8cFAcrY3809qG1cPszmEci7//+RjWGA1OMXtwirhVY1H+YtCJPyVGs9MuwrIjqQDMReguG2g==}
- peerDependencies:
- react: 19.2.6
- react-native: '*'
- react-native-worklets: ^0.7.4 || ^0.8.0 || ^0.9.0 || ^0.10.0
- peerDependenciesMeta:
- react-native-worklets:
- optional: true
-
- resolution: {integrity: sha512-5HrbCfgYmLs0a5dzfM4GmRGelVTPIg+eYp0vmSbWnKRTOPj5DyVOfg1rHGEsuNKp07QwDxfLJfQVp8CNbuvxMQ==}
- peerDependencies:
- react: 19.2.6
- react-native: '*'
- react-native-worklets: ^0.7.4 || ^0.8.0 || ^0.9.0 || ^0.10.0
- peerDependenciesMeta:
- react-native-worklets:
- optional: true
-
- resolution: {integrity: sha512-vt7FyqUqqFXiRVnBqYD7y+GSPTgeua5Ocoy0+SYt+RSHkZEA2Fyop7If3g1TYDzQObYybPRo7TG2Rle1XLaWFw==}
- peerDependencies:
- react-native: '*'
-
- resolution: {integrity: sha512-ssnwz3ZuIgCbZj5A3J6NlhQrXZojg+BjkeWrOWqVJhyMHlV/A/cRT7s986chKku97BFt6ucmDu6/BCzrV45Wcw==}
- peerDependencies:
- react-native: '*'
-
- resolution: {integrity: sha512-BfK1kdftZcM6o9o1FAG7/y0l6vWX0n8td0M5lwkvaMeRXZ9LkRwOi9CQXwvsMTQGQiPwtQXgwiAze13cqjt75g==}
- peerDependencies:
- expo: '*'
- react: 19.2.6
-
- resolution: {integrity: sha512-CWBW6DxqRJ2MaYZW5+/WfEWwIwbiVk5UAPqx0kE676B4R1+PlAXARk/kuNeQBcVrcDNV6i9ihE9B0db8Cd2RXQ==}
- peerDependencies:
- expo: '*'
- react: 19.2.6
- react-native: '*'
-
- resolution: {integrity: sha512-77cqQ1E3B8RQ7FadKSl+bOeSzUfbMhbjMxklqQffXIHx1dILrRELFhq5/UkBW66r+F58KtGEMlw0atPVY2qJyQ==}
- peerDependencies:
- expo: '*'
- react: 19.2.6
- react-native: '*'
-
- resolution: {integrity: sha512-u/iWSdQovEma/owymgz8etxGAif5ZrC8YdXYeGQhDRZwXpAvraordYV0SWej1QWWbYoIkgXcoqHVkgsAff8P4w==}
- peerDependencies:
- '@expo/log-box': ^57.0.4
- '@expo/metro-runtime': ^57.0.16
- '@testing-library/react-native': '>= 13.2.0'
- expo: '*'
- expo-constants: ^57.0.19
- expo-linking: ^57.0.11
- react: 19.2.6
- react-dom: 19.2.6
- react-native: '*'
- react-native-gesture-handler: '*'
- react-native-reanimated: '*'
- react-native-safe-area-context: '>= 5.4.0'
- react-native-screens: ^4.26.0
- react-native-web: '*'
- react-server-dom-webpack: ~19.0.4 || ~19.1.5 || ~19.2.4
- peerDependenciesMeta:
- '@testing-library/react-native':
- optional: true
- react-dom:
- optional: true
- react-native-gesture-handler:
- optional: true
- react-native-reanimated:
- optional: true
- react-native-web:
- optional: true
- react-server-dom-webpack:
- optional: true
-
- resolution: {integrity: sha512-xAyTnZl597G9/r17GOuyTy6VlhjYCVmgzgmP00bhZ9b+VstPl3tTrOOhSFagVpeln47nKp7x7vgkANNheCv4eQ==}
- peerDependencies:
- '@expo/log-box': ^57.0.1
- '@expo/metro-runtime': ^57.0.7
- '@testing-library/react-native': '>= 13.2.0'
- expo: '*'
- expo-constants: ^57.0.7
- expo-linking: ^57.0.4
- react: 19.2.6
- react-dom: 19.2.6
- react-native: '*'
- react-native-gesture-handler: '*'
- react-native-reanimated: '*'
- react-native-safe-area-context: '>= 5.4.0'
- react-native-screens: ^4.26.0
- react-native-web: '*'
- react-server-dom-webpack: ~19.0.4 || ~19.1.5 || ~19.2.4
- peerDependenciesMeta:
- '@testing-library/react-native':
- optional: true
- react-dom:
- optional: true
- react-native-gesture-handler:
- optional: true
- react-native-reanimated:
- optional: true
- react-native-web:
- optional: true
- react-server-dom-webpack:
- optional: true
-
- resolution: {integrity: sha512-tLa1VmSadOq19mA/dwkl99RbHyjLE0T1qqBYMY3/OsguZTI+rlrDy/DDJjupqlVtmr95hD7o1pYqx5aL+B4YMA==}
- peerDependencies:
- expo: '*'
-
- resolution: {integrity: sha512-7zBA1RThURTXdP4w65kBzZNbcSsfArqVd+p+ETAnPRWXO8J296Qd0YaCVyRpJ0HSwlCnGdvOnqO+NgSreHsOhA==}
- peerDependencies:
- expo: '*'
-
- resolution: {integrity: sha512-sBfVDH6dmKVHZxqUxbfkzS00PZELMZt1IpnHKxcOTMZtR/t7CtRAFrbXcisG+EyzeqHSVDacZT+1tbYfZt5D8w==}
- engines: {node: '>=20.16.0'}
-
- resolution: {integrity: sha512-aK+LdKzauHSGmsOStZtyxdzv0zWssCkxTw3m4QuOhfDSJsZaMRTd9O41d8ixU/QfELTbaJ0oRNcF7JFV/7O9YQ==}
- engines: {node: '>=20.16.0'}
-
- resolution: {integrity: sha512-TpP1KCiq3vYfSQF0XpUkWLXp4mTw6MLuyMGPzVVKwqzs7oiKlJ/e0q3PNNjfqs058X47ftqT+31lTaWRWRbmPg==}
- peerDependencies:
- expo: '*'
- react: 19.2.6
- react-native: '*'
-
- resolution: {integrity: sha512-ZN0LDXlhHRNFjXTYZDojXk8IfaoUIu7qa3hhoBTXgyj1UB/iewGlH6+M3Nvhun2lY2d/+xhwqMhv0hIRoBo09Q==}
- peerDependencies:
- expo: '*'
-
- resolution: {integrity: sha512-7cKDn7uBwg0RkcmY015/5j9st4msWJ4zQiPmQdVZoppW3cFSbv05n7xhM6CjUU466Tx4VRTqDF21HuIHkmnEtA==}
- peerDependencies:
- expo: '*'
-
- resolution: {integrity: sha512-Xwaq1gAoVRWx5dPG5VhT5RSbnI9OilhZnO5qoPBnUaBAa5VzRzfdS8q0/bsPt0jR2DKLtGuP0bQ6efMJ4RIMDg==}
- peerDependencies:
- expo: '*'
- react: 19.2.6
- react-native: '*'
-
- resolution: {integrity: sha512-5VwmitVr2J716pOuHXWmEnHbZhZg63DBOZKH5tj0SR8Sps/3jSAf9wf9+UGTKcKgAxGf1PPwQ0lAQ2bG3RwjAg==}
-
- resolution: {integrity: sha512-8Zf+a83OywV0vf1NUtSKpNqKcULmO0GTI+zfFnGYl7SLDH9FjL5RcEZoy6CHvCgq2KDrQF21pl3r7Tb4ItPscw==}
- peerDependencies:
- expo: '*'
- expo-font: '*'
- react: 19.2.6
- react-native: '*'
-
- resolution: {integrity: sha512-uuK5yHLVR7kExUCrO/ItBvp/kp1maQ9Nkb6KvNy5ZUQnN0NMKwuhJ4GvbfS9N3ACmvCjTT4gKvg4yH5UuKIYNA==}
- peerDependencies:
- expo: '*'
- expo-font: '*'
- react: 19.2.6
- react-native: '*'
-
- resolution: {integrity: sha512-r8a6Jk2suL0vI7Uq4iKJab5Eesk8dkB56Q6HksVNkzuAExV0axoikQwZv8aAyHGbu2VHp0artB0N1/PQDLSgBg==}
- peerDependencies:
- expo: '*'
- react-native: '*'
- react-native-web: '*'
- peerDependenciesMeta:
- react-native-web:
- optional: true
-
- resolution: {integrity: sha512-z//rxQJzhTNA1PcKrUtWmrd21jAS3nEDu1b0n8B/7LTTR933OcsZYP1HnbaZifuo2ZH/h7nce2Ow61WZ1Ig2bg==}
- peerDependencies:
- expo: '*'
- react-native: '*'
- react-native-web: '*'
- peerDependenciesMeta:
- react-native-web:
- optional: true
-
- resolution: {integrity: sha512-+LUWwJ0gf/TEKMVdQAw/Gjih4dvrk+URgy24X9qEGKuuMDZqjBRm9T4yQyBVALGL5TTdPUaB6ILxx3lshm3pwQ==}
- peerDependencies:
- expo: '*'
-
- resolution: {integrity: sha512-x3SA5toiHZEkW+5oeNdUM1Rvt6M3ExegQsSwS3Z1+S9gn9utGYTGBkb8MBQivhjIZiRlQYDIhauxA8kySQEWtQ==}
- peerDependencies:
- expo: '*'
-
- resolution: {integrity: sha512-try1ndXkEH1qpMqs2Nf1fXxN/0GShZad9dWp8pbQpXAngyRk8k/MxJ5gJuVabkPJ2vEW3IgNvTkq54aOELkpZA==}
- hasBin: true
- peerDependencies:
- expo: '*'
- expo-dev-client: '*'
- react: 19.2.6
- react-native: '*'
- peerDependenciesMeta:
- expo-dev-client:
- optional: true
-
- resolution: {integrity: sha512-Z+rLdBSzICwoHm/HUxND5fm5nfgqiB+QPWAOKxmA8ScYwvxG1UGjZ6OaayvPc3GkT4aucsbycmFO0uUv/qnIhg==}
- peerDependencies:
- expo: '*'
- react: 19.2.6
- react-native: '*'
-
- resolution: {integrity: sha512-3vl5kvd7PB48ub6PpNIJUuPxO8xVa6D8RnIgNba6SXRwqFprOfeEZgwTgtm41kz0AAtvMOztUVNEUkwrHKjqMQ==}
- peerDependencies:
- expo: '*'
- react-native: '*'
-
- resolution: {integrity: sha512-/aBLZFTD7+BNHWV/q5XbNRFqMhW/CrHsYeq8CcS/iGz6lJHYwEMm4XFcdoaeliuMdo6ZjNrsTHkBIdGB8VMHTg==}
- hasBin: true
- peerDependencies:
- '@expo/metro-runtime': '*'
- react: 19.2.6
- react-dom: 19.2.6
- react-native: '*'
- react-native-web: '*'
- react-native-webview: '*'
- peerDependenciesMeta:
- '@expo/metro-runtime':
- optional: true
- react-dom:
- optional: true
- react-native-web:
- optional: true
- react-native-webview:
- optional: true
-
- resolution: {integrity: sha512-0IxxoPZbT54IH4fHL5NihkvED9HBVQx3uNdPvyv8pFUHWJ81RdFjL0aJys1IB7hbo09KTz4xW4I2aWVOXKAcJQ==}
- hasBin: true
- peerDependencies:
- '@expo/metro-runtime': '*'
- react: 19.2.6
- react-dom: 19.2.6
- react-native: '*'
- react-native-web: '*'
- react-native-webview: '*'
- peerDependenciesMeta:
- '@expo/metro-runtime':
- optional: true
- react-dom:
- optional: true
- react-native-web:
- optional: true
- react-native-webview:
- optional: true
-
- resolution: {integrity: sha512-ZgEeZXj30q+I0EN+CbSSpIyPaJ5HVQD18Z1m+u1FXbAeT94mr1zw50q4q6jiiC447Nl/YTcIYSAftiGqetwXCA==}
-
- resolution: {integrity: sha512-D1dKN+cmyPWuvB+G2SREQDzPY1agpBIcTa9sJxOPMCNeH3gwzhqJRDWCXW3gg0y//+LQ/8j52JbMROWyrKdMdw==}
- engines: {node: '>= 16'}
- peerDependencies:
- express: '>= 4.11'
-
- resolution: {integrity: sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==}
- engines: {node: '>= 18'}
-
- resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==}
-
- resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==}
-
- resolution: {integrity: sha512-jt2DW/aNFNwke7AUd+Z+e6pz39KO5rzdbbFCg2sGafS4mk13MI7Z8O5z9cADNn5lhGODIgLwug6TZO2ctf7kcw==}
- engines: {node: '>=6.0.0'}
-
- resolution: {integrity: sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==}
- engines: {node: '>=8.6.0'}
-
- resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==}
-
- resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==}
-
- resolution: {integrity: sha512-n11RGP/lrWEFI/bWdygLxhI+pVeo1ZYIVwvvPkW7azl/rOy+F3HYRZ2K5zeE9mmkhQppyv9sQFx0JM9UabnpPQ==}
-
- resolution: {integrity: sha512-8JnbkQ4juDyvYs4mgFGQqg4yCYtFDtUtmp2QIQq11ZZe5CFQ5wcqm1rqDgAh/QdMySuBnPzMUiJUNZG5N/AiQw==}
-
- resolution: {integrity: sha512-LB+xjSTEbjHE1cWsxu+tN2Xqr1kpi+V9aADI7sVM5ZMaXyYGPHULQMzpJMYqOTULK/73pUkWVzzObFRBkPr+hg==}
-
- resolution: {integrity: sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==}
-
- resolution: {integrity: sha512-XHYLKk9J4BupDxi9bSEhkfss0m+Vr9ChTrjhf9l2iw3jB5C7BnY4GVPoMcqbrTutsKJso6yj2nAB6BI/F2oZaA==}
- engines: {node: '>=20'}
- hasBin: true
-
- resolution: {integrity: sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==}
-
- resolution: {integrity: sha512-b2XGFAFdWZWg0phtAWLHCk836A1Xann+I+Dgd3Gk64MHKZO44FfoD1KxyvbSh0qZsIoXQGGlVztIY+oitJPpRQ==}
-
- resolution: {integrity: sha512-ztsSx77JBtkuMrEypfhgc3cI0+0h+svqeie7xHbh1k/IKdcydnvadp/mUaGgjAOXQmQSxsqgaRhS3q9fy+1kxg==}
-
- resolution: {integrity: sha512-jKmm9YtsNXN789RS/0mSzOC1NUq9mkVd65vbSSVsKdjGvYXBuE4oWe2QOEoFeRmJg+lPuZxpmrfFclNhoRMneQ==}
-
- resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==}
- engines: {node: '>=12.0.0'}
- peerDependencies:
- picomatch: ^3 || ^4
- peerDependenciesMeta:
- picomatch:
- optional: true
-
- resolution: {integrity: sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==}
- engines: {node: ^12.20 || >= 14.13}
-
- resolution: {integrity: sha512-m6I8ALe4L4XpdETy7MJZWs6L1IVMbjs99bwbpIKphxX+0CTns4IKDWJY0LWfr4YsFjfg+z1TjzTMU8lKl8rG0w==}
+ resolution: {integrity: sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==}
+ engines: {node: ^12.20 || >= 14.13}
resolution: {integrity: sha512-FJqqoDBR00Mdj9ppamLa/Y7vxm+PRmNWA67N846RvsoYVMKB4q3y/de5PA7gUmRMYK/8CMz2GDZQmCRN1wBcWA==}
@@ -11371,14 +8980,6 @@ packages:
resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==}
engines: {node: '>=8'}
- resolution: {integrity: sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ==}
- engines: {node: '>=0.10.0'}
-
- resolution: {integrity: sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==}
- engines: {node: '>= 0.8'}
-
resolution: {integrity: sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==}
engines: {node: '>= 18.0.0'}
@@ -11420,9 +9021,6 @@ packages:
resolution: {integrity: sha512-/zipXxyO6rGvuNGDiULY9MvEGSkb2gaG4GGH4ygMi0ZZzyMHdUZBmntJmx5x1G2VuPytCwGN4xsJP6cw+sK+vQ==}
- resolution: {integrity: sha512-3PYnM29RFXwvAN6Pc/scUfkI7RwhQ/xqyLUyPNlXUp9S40zI8nup9tUSrTLSVnWGBN38FNiGWbwZOB6uR4OGdw==}
-
resolution: {integrity: sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw==}
engines: {node: '>=4.0'}
@@ -11432,9 +9030,6 @@ packages:
debug:
optional: true
- resolution: {integrity: sha512-6FPvD/IVyT4ZlNe7Wcn5Fb/4ChigpucKYSvD6a+0iMoLn2inpo711eyIcKjmDtE5XNcgAkSH9uN/nfAeZzHEfg==}
-
resolution: {integrity: sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==}
engines: {node: '>=8.0.0'}
@@ -11474,10 +9069,6 @@ packages:
react-dom:
optional: true
- resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==}
- engines: {node: '>= 0.6'}
-
resolution: {integrity: sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==}
engines: {node: '>= 0.8'}
@@ -11590,10 +9181,6 @@ packages:
resolution: {integrity: sha512-EoY1N2xCn44xU6750Sx7OjOIT59FkmstNc3X6y5xpz7D5cBtZRe/3pSlTkDJgqsOk3WwZPkWfonhhUJfttQo3w==}
- resolution: {integrity: sha512-VilgtJj/ALgGY77fiLam5iD336eSWi96Q15JSAG1zi8NRBysm3LXKdGnHb4m5cuyxvOLQQKWpBZAT6ni4FI2iQ==}
- engines: {node: '>=6'}
-
resolution: {integrity: sha512-rI2asw77u0mGgwhV3qA+OEgYqaDn5UNqgs+Bx0FGwSpuqfYn+Ir6RQY5ENNQ8SbIiG/m5gVa7CD5RriO4f4Lsg==}
@@ -11754,43 +9341,15 @@ packages:
resolution: {integrity: sha512-IScLbePpkvO846sIwOtOTDjutRMWdXdJmXdMvk6gCBHxFO8d+QKOQedyZSxFTTFYRSmlgSTDtXqqq4pcenBXLQ==}
- resolution: {integrity: sha512-5meXwsZxgiqFaJjNzwjzI9IyUkuGGBisu+z9BvQWmGVpjH6nz11hgqkyxe4dl8UAdyIV4lTbz91+Dlnjz0VxqA==}
-
resolution: {integrity: sha512-0wUoCcLp+5Ev5pDW2OriHC2MJCbwLwuRx+gAqMTOkGKJJiBCLjtrvy4PWUGn6MIVefecRpzoOZ/UV6iGdOr+Cw==}
- resolution: {integrity: sha512-xVx5Opwy8Oo1I5yGpVRhCvWL/iV3M+ylksSKVNlxxD90cpDpR/AR1jLYqK8HWihm065a6UI3HeyAmYzwS8NOOg==}
-
- resolution: {integrity: sha512-A1+8zn5oss2CFP7pKsOaxorQG6FNIz1WU1VDqruLPPZl3LVgeE2C5xfFg8Ow6/Ow4mSslLLtYP1J3n38eKyW9w==}
-
- resolution: {integrity: sha512-guv1nQ6IJ7S83NRFPWc3SA7IBZrdNC9kapwOq6uXvF4wP+sDCgjzQbKPCoyYmoyZRzztF/n/c36l/rccCZSiCw==}
-
resolution: {integrity: sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA==}
- resolution: {integrity: sha512-9JLjeHxBx8T4CAsydZR49PNZUaix+WpQJwu9p2010lu+7Kwl6D/7wYFFJxoz+aXkaaClp9Zfg6W6/zVlSJORaA==}
-
- resolution: {integrity: sha512-GdpwMmH5x6IpC1cijvcvYnlPB60Mh6kTSF/NFdYV/j56gYdi+0RIakYs+eqOV+bbO0SW7mgVVGSsTJxyPQfo3w==}
-
- resolution: {integrity: sha512-GApNk4zLHi2UWoWZZkx7LNCOSzLSc5lB55pZ/PhK7ycFeg7u5LcF88p/WbpIi1XUDtE0MpHE3uRR3u3KB7TjSQ==}
-
resolution: {integrity: sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==}
- resolution: {integrity: sha512-Xwwo44whKBVCYoliBQwaPvtd/2tYFkRQtXDWj1nackaV2JPXx3L0+Jvd8/qCJ2p+ML0/XVkJ2q+Mr+UVdpJK5w==}
- engines: {node: '>=12.0.0'}
-
- resolution: {integrity: sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==}
-
resolution: {integrity: sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==}
engines: {node: '>=0.10.0'}
@@ -11803,10 +9362,6 @@ packages:
resolution: {integrity: sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==}
engines: {node: '>=10'}
- resolution: {integrity: sha512-puUZAUKT5m8Zzvs72XWy3HtvVbTWljRE66cP60bxJzAqf2DgICo7lYTY2IHUmLnNpjYvw5bvmoHvPc0QO2a62w==}
- engines: {node: ^16.14.0 || >=18.0.0}
-
resolution: {integrity: sha512-Hc+ghLoSt6QaYZUv0WBiIvmMDZuZZ7oaDvdH8MbfOO4lOsxdXLEvuC6ePoGs9H1X9oCLyq6+NVN0MKqD+ydxyg==}
engines: {node: ^20.17.0 || >=22.9.0}
@@ -11869,9 +9424,6 @@ packages:
resolution: {integrity: sha512-Y93lCzHYgGWdrJ66yIktxiaGULYc6oGiABxhcO5AufBeOyoIdZF7bIfLaOrbM0iGIOXQQgxxRrFEnb+Y6w1n4A==}
engines: {node: '>=10.18'}
- resolution: {integrity: sha512-WDC/ui2VVRrz3jOVi+XtjqkDjiVjTtFaAGiW37k6b+ohyQ5wYDOGkvCZa8+H0nx3gyvv0+BST9xuOgIyGQ00gw==}
-
resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==}
engines: {node: '>=0.10.0'}
@@ -11898,18 +9450,9 @@ packages:
resolution: {integrity: sha512-PfJGVgIfKQJuq3s0tTDOKtztksibuUEbJQIYT3by6wctQo+Rdlh7ef4evJ5NCdxY4CfMbvFkocEwbl4BF8RlJw==}
- resolution: {integrity: sha512-rH+46sQJ2dlwfjfhCyNx5thzrv+dtmBIhPHk0zgRUukHzZ/kRueTJXoYYsclBaKcSMBWuGbOFXtioLpzTb5euw==}
- engines: {node: '>=16.x'}
- hasBin: true
-
resolution: {integrity: sha512-6jQTc5z0KJFtr1UgFpIL3N9XSC3saRaI9PwWtzM2pSqkNGtiNkYY2OSwkOGDK2XcTRcLb1pi/aNkKZz0nxVH4Q==}
- resolution: {integrity: sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==}
- engines: {node: '>=6'}
-
resolution: {integrity: sha512-jTd2FfOgOWOdgjkHuk/1Ms8VKFXkPs15ymYBETw1sAOrO/dY3XeGVRWir9qBbw7pXr0T2eTFwfCZ+N02HmiNGA==}
engines: {node: '>=18'}
@@ -11943,9 +9486,6 @@ packages:
resolution: {integrity: sha512-Nb2ctOyNR8DqQoR0OwRG95uNWIC0C1lCgf5Naz5H6Ji72KZ8OcFZLz2P5sNgwlyoJ8Yif11oMuYs5pBQa86csA==}
- resolution: {integrity: sha512-lhYo5qNTQp3EvSSp3sRvXMbVQTLrvGV6DycRMJ5dm2BLMiJ30wpXKdDdgX+GmJZ5uQMucwRKHamXSst3Sj/Giw==}
-
resolution: {integrity: sha512-lDB5YccMydFBtasVtxnZ3MRBHuaoE8GKsppq+EchKL2U4nK/DmEpPHNH8MZe5HkMtpSiTSOZwfN0tzYjO/lJEw==}
@@ -11953,9 +9493,6 @@ packages:
resolution: {integrity: sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==}
engines: {node: '>=12'}
- resolution: {integrity: sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==}
-
resolution: {integrity: sha512-yZDprSSr8TyVeMGI/AOV4ws6gwjX22hj9Z8/oHAVpJORY6WRFTcUzhnZtibBUHEw2U8ArvHcR+i863DplQ3Cwg==}
@@ -11976,29 +9513,13 @@ packages:
resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==}
- resolution: {integrity: sha512-m6UrgzFVUYawGBh1dUsWR5M2Clqic9RVXC/9f8ceNlv2IcO9j9J/z8UoCLPqtsPBFNzEpfR3xftohbfqDx8EQA==}
-
- resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==}
- engines: {node: '>=8'}
-
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==}
- resolution: {integrity: sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==}
- engines: {node: '>=8'}
- hasBin: true
-
resolution: {integrity: sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
@@ -12039,10 +9560,6 @@ packages:
resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==}
engines: {node: '>=0.12.0'}
- resolution: {integrity: sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==}
- engines: {node: '>=8'}
-
resolution: {integrity: sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==}
engines: {node: '>=12'}
@@ -12076,10 +9593,6 @@ packages:
resolution: {integrity: sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==}
engines: {node: '>=0.10.0'}
- resolution: {integrity: sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==}
- engines: {node: '>=8'}
-
resolution: {integrity: sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==}
engines: {node: '>=16'}
@@ -12206,10 +9719,6 @@ packages:
resolution: {integrity: sha512-4FZYVOk85hz2AyT6BbarKy9u37g6DbrDyCdFhsnDdXqyrueYQvB+0zO4f/kqLCRD0BsPRXPMNJeQwihKZV8naw==}
engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0}
- resolution: {integrity: sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
-
resolution: {integrity: sha512-rFrcONd8jeFsyw+Z9CrScJgglRf2+NFmNam8dKu7n+SoHqNYT47mn0DdEcVUZJpvh7Iz6/si7f7yUH7GJHVgnw==}
engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0}
@@ -12283,18 +9792,10 @@ packages:
resolution: {integrity: sha512-tEOkkfOMppUyeiHwjZswOQ3lcnoTnws/q5FnGIaeIh/jmoU0ZlgMYRR8sTlTj+nNGCoJ0RDq6SfxGxCsyMTPmw==}
engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0}
- resolution: {integrity: sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
-
resolution: {integrity: sha512-vjQb1sACEiv13DKJMDToJpzVW0joCsIQrmbg0fi7CyOOt+g9jTuQl2A216pWRBYhOVt53XbL/2LbMKg1BECWOw==}
engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0}
- resolution: {integrity: sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
-
resolution: {integrity: sha512-PDWi4SOwLnwqNDfHZjOcsEFyZ4fc/2W2gVL3DEoyqnB6jCQMLRtfBong8s6omIw3lI0HWOus12xfnFmQtjW3fw==}
engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0}
@@ -12313,10 +9814,6 @@ packages:
resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==}
engines: {node: '>= 10.13.0'}
- resolution: {integrity: sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
-
resolution: {integrity: sha512-SHynN/q/QD++iNyvMdy+WMmbCGk8jIsNcRxycXbWubSOhvo6T+j2afcfUSl+3hYsiBebOTo0cT7c2H7CXugu1g==}
engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0}
@@ -12331,17 +9828,10 @@ packages:
node-notifier:
optional: true
- resolution: {integrity: sha512-dZ6Ra7u1G8c4Letq/B5EzAxj4tLFHL+cGtdpR+PVm4yzPDj+lCk+AbivWt1eOM+ikzkowtyV7qSqX6qr3t71Ww==}
-
resolution: {integrity: sha512-hNQh6rZtWfSVWSNVmvq87N5BPJsNH7k7I7qyrXf9DOma9xATQk3fsyHazCQe51nCjdkoWdTmh0vD7bjVSLoxxw==}
engines: {node: '>=18'}
- resolution: {integrity: sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==}
- hasBin: true
-
resolution: {integrity: sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==}
hasBin: true
@@ -12380,9 +9870,6 @@ packages:
resolution: {integrity: sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==}
hasBin: true
- resolution: {integrity: sha512-0wM3YBWtYePOjfyXQH5MWQ8H7sdk5EXSwZvmSLKk2RboVQ2Bu239jycHDz5J/8Blf3K0Qnoy2b6xD+z10MFB+Q==}
-
resolution: {integrity: sha512-Cvc9WUhxSMEo4McES3P7oK3QaXldCfNWp7pl2NNeiIFlCoLr3kfq9kb1fxftiwk1FLV7CvpvDfonxtzUDeSOPg==}
engines: {node: '>=18'}
@@ -12474,10 +9961,6 @@ packages:
resolution: {integrity: sha512-KHX39XIg7afe8ds+0MHPoLiKR9dCzsVK4oAmBUSaeJlcX0xur22f15C2DILbZ6GJ9eyqC+e6Sb1cTG7M17z+Tg==}
deprecated: Unstable Windows builds
- resolution: {integrity: sha512-ONPnazC96VKDntab9j9JKwIWhZ4ZUceB4A9Epu4Ssg0hYFmtHZSeQ+n15nIwTFmcBUKtExOer8WTJ4GF9MO64A==}
- hasBin: true
-
resolution: {integrity: sha512-QWBrQsMpH7gPr965dsKD/3cKWiNoTjpATQf++Xq63N6sKRGMwlVXz41O1IZTMfZQgBctD/K5Zt06+/I6pP6+HA==}
@@ -12498,9 +9981,6 @@ packages:
resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==}
engines: {node: '>= 0.8.0'}
- resolution: {integrity: sha512-gPWxznF6TKmUHrOQjlVo2UbaL2EJ71mb2CCeRs/2qBpi4L/g4LUVc9+3lKQ6DTUZwJswfM7ainGrLO1+fOqa2g==}
-
resolution: {integrity: sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==}
engines: {node: '>= 12.0.0'}
@@ -12513,12 +9993,6 @@ packages:
cpu: [arm64]
os: [android]
- resolution: {integrity: sha512-Gl/lqIXY+d+ySmMbgDf0pgaWSqrWYxVHoc88q+Vhf2YNzZ8DwoRzGt5NZDVqqIW5ScpSnmmjcgXP87Dn2ylSSQ==}
- engines: {node: '>= 12.0.0'}
- cpu: [arm64]
- os: [darwin]
-
resolution: {integrity: sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==}
engines: {node: '>= 12.0.0'}
@@ -12531,12 +10005,6 @@ packages:
cpu: [arm64]
os: [darwin]
- resolution: {integrity: sha512-0+mZa54IlcNAoQS9E0+niovhyjjQWEMrwW0p2sSdLRhLDc8LMQ/b67z7+B5q4VmjYCMSfnFi3djAAQFIDuj/Tg==}
- engines: {node: '>= 12.0.0'}
- cpu: [x64]
- os: [darwin]
-
resolution: {integrity: sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==}
engines: {node: '>= 12.0.0'}
@@ -12549,12 +10017,6 @@ packages:
cpu: [x64]
os: [darwin]
- resolution: {integrity: sha512-n1sEf85fePoU2aDN2PzYjoI8gbBqnmLGEhKq7q0DKLj0UTVmOTwDC7PtLcy/zFxzASTSBlVQYJUhwIStQMIpRA==}
- engines: {node: '>= 12.0.0'}
- cpu: [x64]
- os: [freebsd]
-
resolution: {integrity: sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==}
engines: {node: '>= 12.0.0'}
@@ -12567,12 +10029,6 @@ packages:
cpu: [x64]
os: [freebsd]
- resolution: {integrity: sha512-MUMRmtdRkOkd5z3h986HOuNBD1c2lq2BSQA1Jg88d9I7bmPGx08bwGcnB75dvr17CwxjxD6XPi3Qh8ArmKFqCA==}
- engines: {node: '>= 12.0.0'}
- cpu: [arm]
- os: [linux]
-
resolution: {integrity: sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==}
engines: {node: '>= 12.0.0'}
@@ -12585,13 +10041,6 @@ packages:
cpu: [arm]
os: [linux]
- resolution: {integrity: sha512-cPsxo1QEWq2sfKkSq2Bq5feQDHdUEwgtA9KaB27J5AX22+l4l0ptgjMZZtYtUnteBofjee+0oW1wQ1guv04a7A==}
- engines: {node: '>= 12.0.0'}
- cpu: [arm64]
- os: [linux]
- libc: [glibc]
-
resolution: {integrity: sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==}
engines: {node: '>= 12.0.0'}
@@ -12606,13 +10055,6 @@ packages:
os: [linux]
libc: [glibc]
- resolution: {integrity: sha512-rCGBm2ax7kQ9pBSeITfCW9XSVF69VX+fm5DIpvDZQl4NnQoMQyRwhZQm9pd59m8leZ1IesRqWk2v/DntMo26lg==}
- engines: {node: '>= 12.0.0'}
- cpu: [arm64]
- os: [linux]
- libc: [musl]
-
resolution: {integrity: sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==}
engines: {node: '>= 12.0.0'}
@@ -12627,13 +10069,6 @@ packages:
os: [linux]
libc: [musl]
- resolution: {integrity: sha512-Dk/jovSI7qqhJDiUibvaikNKI2x6kWPN79AQiD/E/KeQWMjdGe9kw51RAgoWFDi0coP4jinaH14Nrt/J8z3U4A==}
- engines: {node: '>= 12.0.0'}
- cpu: [x64]
- os: [linux]
- libc: [glibc]
-
resolution: {integrity: sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==}
engines: {node: '>= 12.0.0'}
@@ -12648,13 +10083,6 @@ packages:
os: [linux]
libc: [glibc]
- resolution: {integrity: sha512-QKjTxXm8A9s6v9Tg3Fk0gscCQA1t/HMoF7Woy1u68wCk5kS4fR+q3vXa1p3++REW784cRAtkYKrPy6JKibrEZA==}
- engines: {node: '>= 12.0.0'}
- cpu: [x64]
- os: [linux]
- libc: [musl]
-
resolution: {integrity: sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==}
engines: {node: '>= 12.0.0'}
@@ -12669,12 +10097,6 @@ packages:
os: [linux]
libc: [musl]
- resolution: {integrity: sha512-/wXegPS1hnhkeG4OXQKEMQeJd48RDC3qdh+OA8pCuOPCyvnm/yEayrJdJVqzBsqpy1aJklRCVxscpFur80o6iQ==}
- engines: {node: '>= 12.0.0'}
- cpu: [arm64]
- os: [win32]
-
resolution: {integrity: sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==}
engines: {node: '>= 12.0.0'}
@@ -12687,12 +10109,6 @@ packages:
cpu: [arm64]
os: [win32]
- resolution: {integrity: sha512-/OJLj94Zm/waZShL8nB5jsNj3CfNATLCTyFxZyouilfTmSoLDX7VlVAmhPHoZWVFp4vdmoiEbPEYC8HID3m6yw==}
- engines: {node: '>= 12.0.0'}
- cpu: [x64]
- os: [win32]
-
resolution: {integrity: sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==}
engines: {node: '>= 12.0.0'}
@@ -12705,10 +10121,6 @@ packages:
cpu: [x64]
os: [win32]
- resolution: {integrity: sha512-8f7aNmS1+etYSLHht0fQApPc2kNO8qGRutifN5rVIc6Xo6ABsEbqOr758UwI7ALVbTt4x1fllKt0PYgzD9S3yQ==}
- engines: {node: '>= 12.0.0'}
-
resolution: {integrity: sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==}
engines: {node: '>= 12.0.0'}
@@ -12749,9 +10161,6 @@ packages:
resolution: {integrity: sha512-J8xewKD/Gk22OZbhpOVSwcs60zhd95ESDwezOFuA3/099925PdHJ7OFHNTGtajL3AlZkykD32HykiMo+BIBI8A==}
- resolution: {integrity: sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==}
-
resolution: {integrity: sha512-TM9YBvyC84ZxE3rgfefxUWiQKLilstD6k7PTGt6wfbtXF8ixIJLOL3VYyV/z+ZiPLsVxAsKAFVwWlWeb2Y8Yyw==}
@@ -12762,17 +10171,10 @@ packages:
resolution: {integrity: sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==}
deprecated: This package is deprecated. Use require('node:util').isDeepStrictEqual instead.
- resolution: {integrity: sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ==}
-
resolution: {integrity: sha512-l1mfj2atMqndAHI3ls7XqPxEjV2J9ZkcNyHpoZA3r2T1LLwDB69jgkMWh71YKwhBbK0G2f4WSn05ahmQXVxupA==}
deprecated: Bad release. Please use [email protected] instead.
- resolution: {integrity: sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==}
- engines: {node: '>=4'}
-
resolution: {integrity: sha512-ja1E3yCr9i/0hmBVaM0bfwDjnGy8I/s6PP4DFp+yP+a+mrHO4Rm7DtmnqROTUkHIkqffC84YY7AeqX6oFk0WFg==}
engines: {node: '>=18'}
@@ -12794,9 +10196,6 @@ packages:
resolution: {integrity: sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==}
- resolution: {integrity: sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==}
-
resolution: {integrity: sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==}
engines: {node: '>=8'}
@@ -12866,9 +10265,6 @@ packages:
engines: {node: '>= 20'}
hasBin: true
- resolution: {integrity: sha512-ocnPZQLNpvbedwTy9kNrQEsknEfgvcLMvOtz3sFeWApDq1MXH1TqkCIx58xlpESsfwQOnuBO9beyQuNGzVvuhQ==}
-
resolution: {integrity: sha512-OkeDaAZ/bQCxeFAozM55PKcKU0yJMPGifLwV4Qgjitu+5MoAfSQN4lsLJeXZ1b8w0x+/Emda6MZgXS1jvsapng==}
engines: {node: '>=10'}
@@ -12925,15 +10321,9 @@ packages:
resolution: {integrity: sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==}
- resolution: {integrity: sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==}
-
resolution: {integrity: sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==}
- resolution: {integrity: sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==}
-
resolution: {integrity: sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==}
@@ -12946,20 +10336,10 @@ packages:
peerDependencies:
tslib: '2'
- resolution: {integrity: sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q==}
-
- resolution: {integrity: sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==}
-
resolution: {integrity: sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==}
engines: {node: '>=18'}
- resolution: {integrity: sha512-2Sug1+knBjkaMsMgf1ctR1Ujx+Ayku4EdJN4Z+C2+JzoeF7A3OZ9KM2GY0CpQS51NR61LTurMJrRKPhSs3ZRTQ==}
- engines: {node: '>=10'}
-
resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==}
@@ -12974,122 +10354,6 @@ packages:
resolution: {integrity: sha512-Jo9N377Wb4MSnHFPTbLi2SxFpsQl4eVHoxnW5U1Md9EazvgMp3s+4ohDxr81YNTgbn5Kj7HJ3yslrSJ52kwpbA==}
- resolution: {integrity: sha512-rvCfz8snl9h20VcvpOHxZuHP1SlAkv4HXbzw7nyyVwu6Eqo5PRerbakQ9XmUCOsRy70spJ37O+G1TK8oMzo48g==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
-
- resolution: {integrity: sha512-2WbHILKMiJUzfdjmGOQOqU1bWi9//gqiclc/tkk/AIsrrVw3efhZ1uhkOwMTxUEPOzqoo091H0olLmVZH5FHGQ==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
-
- resolution: {integrity: sha512-wVO79aGrkYImpnaVS4+d5RrRBRPX31QtvKB3wKGBuiNSznduZTQHzsrJZRroFJSwnygrzdsGUtDQPuqqFjFdvw==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
-
- resolution: {integrity: sha512-3dPB2TnvGjjf0/9O7AXVQURKXuQNauTZE7WpTGTlR017Gh/B5y0m/2wcqxfveUguHSpu89KhVxCAlr2k/H7uhQ==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
-
- resolution: {integrity: sha512-gpcFQdSLUwUCk71saKoE64jLFbx2nwTfVCcPSULMNT8QYq0p1eZZE29Jvd0HtT/UlhC3ZOutLxJME5xqD2JUZg==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
-
- resolution: {integrity: sha512-WHS0n2OxQqtwEjSeQFPePNrMvEFhmQcUQM9cRJMHByWoi/GMWFBEWOf7hVkAM/0KRutAXNbDlSu/cZB6CyxgQQ==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
-
- resolution: {integrity: sha512-PMotGDjXcXLWo2TMRH+VR99phFNgYTwqh4OoieIKK3yTJa1Jmkl+fZJxDO0jfBvNF+WESHciHvpNuBtXaF3B0Q==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
-
- resolution: {integrity: sha512-zie+uN6oohscowi2S7ByU+wUw6CrT4ZxW9uAbONOObSxx86RGmnIAmjXHLkfmcdYoY7jzOPEbqcI6oeVmqyBQA==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
-
- resolution: {integrity: sha512-HONpWC5LGXZn3ffkd4Hu6AIrfE7j4Z0g0wMo/goV24WOB3lhuFZ40KgvaDiSw8iyQHloMYay5N/wPX+z8oN/PQ==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
-
- resolution: {integrity: sha512-xwm605hCi5Y6eJTTb8ZWo6pkUcoBEIyiQOfkZh5GwtDwUrP9SNhTQZhzJHrBCwwxlf3Ptl/pxWJgQ1rsNYMnrA==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
-
- resolution: {integrity: sha512-KSVDi/u60hKPx++NLu3MTIvyjzNoJnFAF8PQFxaj1jiSka/wjw+Ua6sNuJ0TDHQv+7AAoFQxeMgaRAe8Yic5wQ==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
-
- resolution: {integrity: sha512-mlm/JL8toSbSc2akpKIGmzvrVRSCgZ5vkbycI34oMLoOnLGuLyC8WTyVJ6P0hZG/usDaGwZSl/s9BCRriqjGJA==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
-
- resolution: {integrity: sha512-5qpbaVOMC7CPitIpuewzVeGw7E+C3ykbv2mqTjQLl85Z3annSVGlSCTcsZjqXZzjupfK4Ztj3dDc4kc44NZwtQ==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
-
- resolution: {integrity: sha512-BJoFwCEDsYnagPqarayInv2+diCDNDdLlaof/p6s9w4gh+gc9HXYM+pDvsKGKKUumpZswNF3Z/ftTMqKl/5IBg==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
-
- resolution: {integrity: sha512-1qLgbxQ5ZGhhutuPot1Yp348ofDsATL2WkrHF65TobqTT9K3P9qJXw38bomk7ncp5B7OYMfWwtyBZo1lCV792A==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
-
- resolution: {integrity: sha512-VSSnepg1k6LyCwtb6eirWdAWlpKwBG8Rdtsr1mU38rMelFyWgh3/QuMSiZIZAIjwg/fsa8GhW5/FO54CAUPCEA==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
-
- resolution: {integrity: sha512-Jibypds4g7AhzdRKY+kDoj51s5EXMwgyp5ddtlreDAsWefMdOx+agWqgm0H2XSZ/ueanHHVM89fnf5OJnlxa8Q==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
-
- resolution: {integrity: sha512-U1m2+d1Pr+JO2/iVXBB2OfXXityz7tqwIorxfrT15IEgaHvpJBq/OHiqnOWPKJbUl3JcxjcdviZZOKk85oK4Qg==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
-
- resolution: {integrity: sha512-jbWkPxIesVuo1IWkvezmMJld6iu8nD62GsrZiV6jP37AOdbo4OBq1FJ+qkOg8sV05wAHB//jAbziuW0SlJfW4g==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
-
- resolution: {integrity: sha512-2BtV5L9uPc49F13Gn5wiP6bX/EncqzqTIk2VL/0F/96Vo0YEOjluT/qktQjFODfqGFsucwnh5mPEAl/2jVEfeg==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
-
- resolution: {integrity: sha512-OnfpacxUqGPZQ27t8qK9mFa7uqHIlVWeqRqkCbvMvreEBiamEeOn8krKtcwgP5M4cYDPwuSmCTopHMVthqG4zA==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
- hasBin: true
-
- resolution: {integrity: sha512-rQ40zYDAkaWBN9yvjUuAD0ZpzBMZSoKyGYXnb5JrfbKjun7fTvfoLHL3KXFYenBTYZkQtlp4cKSCv/1utxFyOw==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
- hasBin: true
-
- resolution: {integrity: sha512-kehr6HbAecqD0/a3xLXobELdPaAmRAl8bel0qagPF4vhZtux93nS8S4eq2kgKt6J2GnQpVjSoW1PXdst04mwow==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
-
- resolution: {integrity: sha512-+InaSVGaOyt0DyRo4Y/zIdPI6CZwnbNho5LAL23tgmuGwv7fyfkF7kKfPjZcfxXBcoYdTLLFnCfCH/dHSiCqNg==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
-
- resolution: {integrity: sha512-W1IYMvvXTu4MxYr7d9h7CeG2vpIr3bmLLIavkPY4O1ilzDrvS8z/NEe6y+pC44Ff7raMXQgYSfdqDUwN/i39gg==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
-
- resolution: {integrity: sha512-ui1Z8x4s5RL36gMmKLaMMO7O9NNDHNdthEZSCDQHAau3JcAsTaFOK6I+2q4I/kW5u8hSEjJk9L45TXSVJw6g1A==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
-
- resolution: {integrity: sha512-8ETTubqfD6ornDy2zYDvRcKnVDOXdFJsjetYDBsY4oAsb6NJkiwFR+FaMESyGppFmQUyBQA4H4sFGxzcQSGtFA==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
- hasBin: true
-
- resolution: {integrity: sha512-r1liLkyFZMVSEMNjU1CJU5pRzs3NdkxHqXS60O25c0rCIqAR+cGk7rPydw/g0WAIKVXojIBIF45yYBPagJGcgw==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
- hasBin: true
-
resolution: {integrity: sha512-RDBrHEMSxVFLg6xvnXmb1Ayr2WzLAWjeSATAoxwKYJV94TeNavgoIdA0a9ytzDSVzBy2YKFK+emCPOEibLeCrg==}
@@ -13194,11 +10458,6 @@ packages:
resolution: {integrity: sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==}
engines: {node: '>=18'}
- resolution: {integrity: sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==}
- engines: {node: '>=4'}
- hasBin: true
-
resolution: {integrity: sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==}
engines: {node: '>=4.0.0'}
@@ -13209,10 +10468,6 @@ packages:
engines: {node: '>=10.0.0'}
hasBin: true
- resolution: {integrity: sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==}
- engines: {node: '>=4'}
-
resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==}
engines: {node: '>=6'}
@@ -13299,9 +10554,6 @@ packages:
resolution: {integrity: sha512-Y3wQdFg2Va6etvQ5I82yUhGdsKrcYox6p7FfL1LbK2J4V01F9TGlepTIhnK24t7koZibmg82KGglhA1XK5IsLQ==}
engines: {node: '>=10'}
- resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==}
-
resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==}
@@ -13315,12 +10567,6 @@ packages:
typescript:
optional: true
- resolution: {integrity: sha512-H/J4fMLedtudftaYMOg7ajzLYgT3/rwbWVJbqr/iUgB8DQztn38ys5HOqI1CzSxx8QhXXwOOnnBvd4v3jG5+Mg==}
-
- resolution: {integrity: sha512-6GwVw5eLi9sThdtlS4PKwC7yRLaf45pYhIEzKBHdKxi+YOXGKFX8acIniH+Uh/+k9mS2lQOupTccjoe5r0/1IQ==}
-
resolution: {integrity: sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA==}
engines: {node: ^18.17.0 || >=20.5.0}
@@ -13338,11 +10584,6 @@ packages:
engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
hasBin: true
- resolution: {integrity: sha512-Y2tUNy4ouw6tq5oDSKeQYGOyhkUBhNOcGV/02KC+6kd9eDGqdZd++mjMiIDilrBYvjEnCYvVtsuHCuP+okSfug==}
- engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
- hasBin: true
-
resolution: {integrity: sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA==}
@@ -13351,23 +10592,9 @@ packages:
engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0}
hasBin: true
- resolution: {integrity: sha512-10uUB2Dlli3MH3NDL5nMHqJHz1A3e/E6mzjTj6cl7hHECClJ7HpE6v+xZL+GXdbwQSnWE+UWMIMsNz7yOQkAJQ==}
- engines: {node: '>=16'}
- peerDependencies:
- tailwindcss: '>3.3.0'
-
resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==}
- resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==}
- engines: {node: '>= 0.6'}
-
- resolution: {integrity: sha512-myRT3DiWPHqho5PrJaIRyaMv2kgYf0mUVgBNOYMuCH5Ki1yEiQaf/ZJuQ62nvpc44wL5WDbTX7yGJi1Neevw8w==}
- engines: {node: '>= 0.6'}
-
resolution: {integrity: sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==}
engines: {node: '>= 0.6'}
@@ -13375,9 +10602,6 @@ packages:
resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==}
- resolution: {integrity: sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==}
-
resolution: {integrity: sha512-KdHvFWZjEKDf0cakgFjebl371GPsISX2oZHcuyKqM7DtogIsHrqKeLTo8wBHxaXRAQlY2PsPlZmfo+9ZCxEREQ==}
engines: {node: '>=10'}
@@ -13397,23 +10621,10 @@ packages:
engines: {node: '>=10.5.0'}
deprecated: Use your platform's native DOMException instead
- resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==}
- engines: {node: 4.x || >=6.0.0}
- peerDependencies:
- encoding: ^0.1.0
- peerDependenciesMeta:
- encoding:
- optional: true
-
resolution: {integrity: sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
- resolution: {integrity: sha512-LarFH0+6VfriEhqMMcLX2F7SwSXeWwnEAJEsYm5QKWchiVYVvJyV9v7UDvUv+w5HO23ZpQTXDv/GxdDdMyOuoQ==}
- engines: {node: '>= 6.13.0'}
-
resolution: {integrity: sha512-OMcPNvqTCFUnNaBlmdgq+lfNqY7gTiSmNRDjY3uAXRyudeKZEZxu3CLtjMQrx4zZxCX2b/mpNqTtwuCJgXhHkw==}
engines: {node: ^20.17.0 || >=22.9.0}
@@ -13452,20 +10663,10 @@ packages:
resolution: {integrity: sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==}
engines: {node: '>=10'}
- resolution: {integrity: sha512-sHGJy8sOC1YraBywpzQlIKBE4pBbGbiF95U6Auspzyem956E0+FtDtsx1ZxlOJkQCZ1AFXAY/yuvtFYrOxF+Bw==}
- engines: {node: ^16.14.0 || >=18.0.0}
-
resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==}
engines: {node: '>=8'}
- resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==}
-
- resolution: {integrity: sha512-2vPPEi+Z7WqML2jZYddDIfy5Dqb0r2fze2zTxNNknZaFpVHU3mFB3R+DWeJWGVx0ecvttSGlJTI+WG+8Z4cDWw==}
-
resolution: {integrity: sha512-7wfH4sLbt4M0gCDzGE6vzQBo0bfTKjU7Sfpqy/7gs1qBfYz2vEJH6vXcBKpO3+6Yu1telwd0t9HpyOoLEQQbIQ==}
@@ -13474,22 +10675,10 @@ packages:
engines: {node: '>=8.9'}
hasBin: true
- resolution: {integrity: sha512-eJXMpz4aQHXF/YBB9ddqZDIS+ooO91hObo9FoW/xBkr54/zCwYYCDqT/O54vNo8kOkWs5Ou/y28NgdrV0edQNA==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
-
- resolution: {integrity: sha512-aH9RkoZc7w/90HBamFxTw8ZLFr05wXS+iOnvmrgo53Ep8Pyrm5FieQSaPIVROkfFVQISeD/zo92fes26TOwe+A==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
-
resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==}
engines: {node: '>=0.10.0'}
- resolution: {integrity: sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==}
- engines: {node: '>= 6'}
-
resolution: {integrity: sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==}
engines: {node: '>= 0.4'}
@@ -13504,25 +10693,13 @@ packages:
resolution: {integrity: sha512-LMJTtvgc/nugXj0Vcrrs68Mn2D1r0zf630VNtqtpI1FEO7e+O9FP4gqs9AcnBaSEeoHIPm28u6qgPR0oyEpGSw==}
- resolution: {integrity: sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==}
- engines: {node: '>= 0.8'}
-
resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==}
engines: {node: '>= 0.8'}
- resolution: {integrity: sha512-737ZY3yNnXy37FHkQxPzt4UZ2UWPWiCZWLvFZ4fu5cueciegX0zGPnrlY6bwRg4FdQOe9YU8MkmJwGhoMybl8A==}
- engines: {node: '>= 0.8'}
-
resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==}
- resolution: {integrity: sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ==}
- engines: {node: '>=4'}
-
resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==}
engines: {node: '>=6'}
@@ -13541,10 +10718,6 @@ packages:
resolution: {integrity: sha512-YgBpdJHPyQ2UE5x+hlSXcnejzAvD0b22U2OuAP+8OnlJT+PjWPxtgmGqKKc+RgTM63U9gN0YzrYc71R2WT/hTA==}
engines: {node: '>=18'}
- resolution: {integrity: sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==}
- engines: {node: '>=8'}
-
resolution: {integrity: sha512-MX2s3u2L5racTO0CC/SWpCOasJQBCJrqLKXK+l82cAhdeF8mPMBEe/gxMm0ZFa2xpKpOFLRjxv5afYEZbBXmbQ==}
engines: {node: '>=22.0.0'}
@@ -13579,10 +10752,6 @@ packages:
resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==}
engines: {node: '>= 0.8.0'}
- resolution: {integrity: sha512-eNwHudNbO1folBP3JsZ19v9azXWtQZjICdr3Q0TDPIaeBQ3mXLrh54wM+er0+hSp+dWKf+Z8KM58CYzEyIYxYg==}
- engines: {node: '>=6'}
-
resolution: {integrity: sha512-6VlU9MLXbjVQD04AZCMX28hVtA5bUoadvUqO76MUCVA0ilwJbMiHsITRPfyVm6p/BC0Av/BXMujx39WCe1LEqw==}
engines: {node: '>=20'}
@@ -13689,10 +10858,6 @@ packages:
resolution: {integrity: sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==}
- resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==}
- engines: {node: '>=6'}
-
resolution: {integrity: sha512-U4RrVsUFCleIOBsIGYOMKjn9PavsGOXxbvYGtMOEfnId0SVNsgehXh1DxUdVPLoxd5mvcEtvmKs2Mmf0Mpa1ZA==}
@@ -13713,10 +10878,6 @@ packages:
resolution: {integrity: sha512-1Y1A//QUXEZK7YKz+rD9WydcE1+EuPr6ZBgKecAB8tmoW6UFv0NREVJe1p+jRxtThkcbbKkfwIbWJe/IeE6m2Q==}
engines: {node: '>=0.10.0'}
- resolution: {integrity: sha512-Nt/a5SfCLiTnQAjx3fHlqp8hRgTL3z7kTQZzvIMS9uCAepnCyjpdEc6M/sz69WqMBdaDBw9sF1F1UaHROYzGkQ==}
- engines: {node: '>=10'}
-
resolution: {integrity: sha512-JyPSBnkTJ0AI8GGJLfMXvKq42cj5c006fnLz6fXy6zfoVjJizi8BNTpu8on8ziI1cKy9d9DGNuY17Ce7wuejpQ==}
@@ -13745,10 +10906,6 @@ packages:
resolution: {integrity: sha512-NOnmBpt5Y2RWbuv0LMzsayp3lVylAHLPUTut412ZA3l+C4uw4ZVkQbjShYCQ8TCpUMdPapr4YjUqLYD6v68j+w==}
- resolution: {integrity: sha512-ALzNPpyNq9AqXMBjeymIjFDAkAFH06mHJH/cSBHAgU0s4vfpBn6b2nf8tiRLvagKD8RbTpq2FKTBg7cl9l3c7Q==}
- deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
-
resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==}
engines: {node: '>=8'}
@@ -13778,10 +10935,6 @@ packages:
resolution: {integrity: sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA==}
- resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==}
- engines: {node: '>=8'}
-
resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==}
@@ -13793,13 +10946,6 @@ packages:
resolution: {integrity: sha512-eRWB5LBz7PpDu4PUlwT0PhnQfTQJlDDdPa35urV4Osrm0t0AqQFGn+UIkU3klZvwJ8KPO3VbBFsXquA6p6kqZw==}
engines: {node: '>=12', npm: '>=6'}
- resolution: {integrity: sha512-h8UIIG/V4pgm20uvkt7L8G/GsOWKaU7rnyu2jnGt1vKmaigE0GZWXOHoEw9wZcfATHwvUpr/mkubEG/nbKeJkg==}
- peerDependencies:
- react: 19.2.6
- react-native: '*'
- react-native-svg: '*'
-
resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==}
@@ -13811,14 +10957,6 @@ packages:
resolution: {integrity: sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==}
engines: {node: '>=12'}
- resolution: {integrity: sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==}
- engines: {node: '>=12'}
-
- resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==}
- engines: {node: '>=0.10.0'}
-
resolution: {integrity: sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==}
engines: {node: '>= 6'}
@@ -13882,18 +11020,6 @@ packages:
resolution: {integrity: sha512-25ClnWWuw7JbWZcgqY/gJ4FQWadKxGWk+3kR/7kD0tCaDtPPMj7oHu2ToLaVhfpnHrZzYby2w6tUA0eOIuUg8g==}
- resolution: {integrity: sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==}
- engines: {node: '>=14.0.0'}
- peerDependencies:
- postcss: ^8.0.0
-
- resolution: {integrity: sha512-oIAOTqgIo7q2EOwbhb8UalYePMvYoIeRY2YKntdpFQXNosSu3vLrniGgmH9OKs/qAkfoj5oB3le/7mINW1LCfw==}
- engines: {node: ^12 || ^14 || >= 16}
- peerDependencies:
- postcss: ^8.4.21
-
resolution: {integrity: sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==}
engines: {node: '>= 18'}
@@ -13912,19 +11038,6 @@ packages:
yaml:
optional: true
- resolution: {integrity: sha512-HQbt28KulC5AJzG+cZtj9kvKB93CFCdLvog1WFLf1D+xmMvPGlBstkpTEZfK5+AN9hfJocyBFCNiqyS48bpgzQ==}
- engines: {node: '>=12.0'}
- peerDependencies:
- postcss: ^8.2.14
-
- resolution: {integrity: sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==}
- engines: {node: '>=4'}
-
- resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==}
-
resolution: {integrity: sha512-FfR8sjd4em2T6fb3I2MwAJU7HWVMr9zba+enmQeeWFfCbm+UOC/0X4DS8XtpUTMwWMGbjKYP7xjfNekzyGmB3A==}
engines: {node: ^10 || ^12 || >=14}
@@ -13956,54 +11069,6 @@ packages:
rxjs:
optional: true
- resolution: {integrity: sha512-VQltdXgh4tR4pAx5HIpr3IxKgWGGmc+H1Qpl9akwNsyJ7UeobstCOqtFryTTEzyQoT0qvu7aJ6JopxSYvi5g7w==}
- hasBin: true
- peerDependencies:
- '@posthog/react-native-plugin': '>= 2.9.3'
- '@react-native-async-storage/async-storage': '>=1.0.0'
- '@react-navigation/native': '>= 5.0.0'
- expo-application: '>= 4.0.0'
- expo-device: '>= 4.0.0'
- expo-file-system: '>= 13.0.0'
- expo-localization: '>= 11.0.0'
- expo-updates: '>= 0.25.0'
- posthog-react-native-session-replay: '>= 1.6.0'
- react-native-device-info: '>= 10.0.0'
- react-native-localize: '>= 3.0.0'
- react-native-navigation: '>= 6.0.0'
- react-native-safe-area-context: '>= 4.0.0'
- react-native-svg: '>= 15.0.0'
- peerDependenciesMeta:
- '@posthog/react-native-plugin':
- optional: true
- '@react-native-async-storage/async-storage':
- optional: true
- '@react-navigation/native':
- optional: true
- expo-application:
- optional: true
- expo-device:
- optional: true
- expo-file-system:
- optional: true
- expo-localization:
- optional: true
- expo-updates:
- optional: true
- posthog-react-native-session-replay:
- optional: true
- react-native-device-info:
- optional: true
- react-native-localize:
- optional: true
- react-native-navigation:
- optional: true
- react-native-safe-area-context:
- optional: true
- react-native-svg:
- optional: true
-
resolution: {integrity: sha512-b9Eb8h2eVqNE8edvKdwqkrY6O7kAwmI8kcnBv1NScolYJbo59XUF0noFq+lxbC1yN20bmC0WBEbDC5H/7ASb0A==}
engines: {node: '>=14.0.0'}
@@ -14044,18 +11109,10 @@ packages:
resolution: {integrity: sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==}
engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0}
- resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
-
resolution: {integrity: sha512-K6KiKMHTL4jjX4u3Kir2EW07nRfcqVTXIImx50wbjHQTcZPgg+gjVeNTIT3l3L1Rd4UefxfogquC9J37SoFyyw==}
engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0}
- resolution: {integrity: sha512-g8+OnU/L2v+wyiVK+D5fA34J7EH8jZ8DDlvwhRCMxmMj7UCBvxiO1mGeN+36JXIKF4zevU4kRBd8lVgG9vLelA==}
- engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0}
-
resolution: {integrity: sha512-iG+GYldRf2BQ0UDUAd6JQ/RwzaQy6mXmsk/IzlYyal4A4SNFw54MeH4/tLkF4I5WoWG9SQwuqWzS99jaFQHBuQ==}
engines: {node: ^20.17.0 || >=22.9.0}
@@ -14075,12 +11132,6 @@ packages:
resolution: {integrity: sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==}
engines: {node: '>=10'}
- resolution: {integrity: sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==}
-
- resolution: {integrity: sha512-rZPNPKTOYVNEEKFaq1HqTgOwZD+4/YHS5ukLzQCypkj+OkYx7iv0mA91lJlpPPZ8vMau3IIGj5Qlwrx+8iiSmg==}
-
resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==}
engines: {node: '>= 6'}
@@ -14201,16 +11252,9 @@ packages:
resolution: {integrity: sha512-lT5yCqEBgfoMYpf3F2xQRK7zEr1rhIIZuceDK6+xRkJQ4NMbHTwXqk4NkwDwQMNqXgG9r9fyHnzwNVs6zV5KRw==}
- resolution: {integrity: sha512-hh2WYhq4fi8+b+/2Kg9CEge4fDPvHS534aOOvOZeQ3+Vf2mCFsaFBYj0i+iXcAq6I9Vzp5fjMFBlONvayDC1qg==}
- engines: {node: '>=6'}
-
resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==}
- resolution: {integrity: sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA==}
-
resolution: {integrity: sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==}
engines: {node: '>=10'}
@@ -14246,9 +11290,6 @@ packages:
resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==}
hasBin: true
- resolution: {integrity: sha512-ePrwPfxAnB+7hgnEr8vpKxL9cmnp7F322t8oqcPshbIQQhDKgFDW4tjhF2wjVbdXF9O/nyuy3sQWd9JGpiLPvA==}
-
resolution: {integrity: sha512-ZtAp5XTO5HRzQctjPU0ybY0RRCQO19X/8fxn3w7y2VVTUbGHDKULPTL4ky3vB05euSgG5NpALhEhDPvQ56wvXg==}
peerDependencies:
@@ -14268,15 +11309,6 @@ packages:
peerDependencies:
react: 19.2.6
- resolution: {integrity: sha512-nsO+KSNgo1SbJqJEYRE9ERzo7YtYbou/OqjSQKxV7jcKox7+usiUVZOAC+XnDOABXggQTno0Y1CpVnuWEc1boQ==}
-
- resolution: {integrity: sha512-r4F0Sec0BLxWicc7HEyo2x3/2icUTrRmDjaaRyzzn+7aDyFZliszMDOgLVwSnQnYENOlL1o569Ze2HZefk8clA==}
- engines: {node: '>=10'}
- peerDependencies:
- react: 19.2.6
-
resolution: {integrity: sha512-ohhsfXD4qN0j6cMQd56aaVJBPDF3kUdviF/Od1Eak/rEIXQ3svQ4gjkwTfuTZwTBnxHRL16p9JqdlVQO5nUHqA==}
hasBin: true
@@ -14301,9 +11333,6 @@ packages:
resolution: {integrity: sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==}
- resolution: {integrity: sha512-XjBR15BhXuylgWGuslhDKqlSayuqvqBX91BP8pauG8kd1zY8kotkNWbXksTCNRarse4kuGbe2kIY05ARtwNIvw==}
-
resolution: {integrity: sha512-s5un28nYxKJw5gvUHyW5PCC28CvBqLu9r3cWgzHT4Vo/5fqqkFcdRYsGcKf50WMPpjjFZS5d76fn3YCo2njKwQ==}
@@ -14313,166 +11342,29 @@ packages:
'@types/react': ^19.2.15
react: 19.2.6
- resolution: {integrity: sha512-B88f5rIymJXmy1sNC/MhTkb3xxBej1KkuAt7TiT9iM7oXz3RM8Bn+7GUrfR02TvSgKm4cg2XiSuLEKYfKwNsjA==}
- engines: {node: '>=18'}
+ resolution: {integrity: sha512-z6F7K9bV85EfseRCp2bzrpyQ0Gkw1uLoCel9XBVWPg/TjRj94SkJzUTGfOa4bs7iJvBWtQG0Wq7wnI0syw3EBQ==}
+ engines: {node: '>=0.10.0'}
+
+ resolution: {integrity: sha512-QgT5//D3jfjJb6Gsjxv0Slpj23ip+HtOpnNgnb2S5zU3CB26G/IDPGoy4RJB42wzFE46DRsstbW6tKHoKbhAxw==}
+ engines: {node: '>=0.10.0'}
+
+ resolution: {integrity: sha512-9r+yi9+mgU33AKcj6IbT9oRCO78WriSj6t/cF8DWBZJ9aOGPOTEDvdUDz1FwKim7QXWwmHqtdHnRJfhAxEG46Q==}
+ engines: {node: '>=10'}
peerDependencies:
+ '@types/react': ^19.2.15
react: 19.2.6
- react-native: '*'
- react-native-reanimated: '>=3.6.2'
- react-native-safe-area-context: '*'
- react-native-svg: '*'
- tailwindcss: ~3
peerDependenciesMeta:
- react-native-safe-area-context:
- optional: true
- react-native-svg:
+ '@types/react':
optional: true
- resolution: {integrity: sha512-ETOxvlhhb4LmuuG3RN7A3qwt9jr9AZ2it+1G2kNE4g2fTyxxay7QQkPm1HfKi/JzmMSWC5+YTepGSgZNpJIDGg==}
+ resolution: {integrity: sha512-Iqb9NjCCTt6Hf+vOdNIZGdTiH1QSqr27H/Ek9sv/a97gfueI/5h1s3yRi1nngzMUaOOToin5dI1dXKdXiF+u0Q==}
+ engines: {node: '>=10'}
peerDependencies:
- react: 19.2.6
- react-native: '*'
- react-native-gesture-handler: '>= 2.0.0'
- react-native-reanimated: '>= 2.0.0'
-
- resolution: {integrity: sha512-uYIMOKlKENORq2SABE+jIjbPU+h5I/sQKcq2v16zRq848nwEp1fWRVwML4QWqijc8UcXJC25o54S8GQd4Mf2OA==}
- peerDependencies:
- react: 19.2.6
- react-native: '*'
-
- resolution: {integrity: sha512-FLbPWl/MyYQWz+KwqOZsSyj2JmLKglHatd3xLZWskXOpRaio4LfEDEz8E/A6uD8QoTHW6Aobw1jbEwK7KMgR7Q==}
- peerDependencies:
- react: 19.2.6
- react-native: '*'
-
- resolution: {integrity: sha512-NIXU/iT5+ORyCc7p0z2nnlkouYKX425vuU1OEm6bMMtWWR9yvb+Xg5AZmImTKoF9abxCPqrKC3rOZsKzUYgYZA==}
- peerDependencies:
- react: 19.2.6
- react-native: '*'
-
- resolution: {integrity: sha512-+TkkFldht4+AXBQeDy1hLE7iqiW8/NkY/ekhcFsKIiRdI9qC5JDzx0TfAg1iYZB2IeOXppmURIy2jFCUjOcV1w==}
- peerDependencies:
- react: 19.2.6
- react-native: '*'
- react-native-reanimated: '>=3.0.0'
-
- resolution: {integrity: sha512-49OAyfkg0/TMWiWELZN6VuVQPZPhizwL4DTmp8b7B1md3dB/s3LH3mGfC3T+lp9W0y/rqxZMEnotLFTIbOAenQ==}
- peerDependencies:
- react: 19.2.6
- react-native: '*'
- react-native-nitro-modules: '*'
-
- resolution: {integrity: sha512-KpW6EQVQ/bfegpCGxN9Be+ndvsfj56t4IESEvCASu9gWpJa/NDfHpIeIwCOvZQ3eXmLEj6YD4wCLqcC1FJPr2w==}
- peerDependencies:
- react: 19.2.6
- react-native: '*'
-
- resolution: {integrity: sha512-+owIckpD4sA13XKHaLrr8V1RP4paqoxKvz/jy2wl/ULjMsfcRlfIJdKJxR1kcQr4McBZ6hAoPo01NyLnmy2ycQ==}
- peerDependencies:
- react: 19.2.6
- react-native: 0.83 - 0.86
- react-native-worklets: 0.10.x - 0.11.x
-
- resolution: {integrity: sha512-/9/MtQz8ODphjsLdZ+GZAIcC/RtoqW9EeShf7Uvnfgm/pzYrJ75y3PV/J1wuAV1T5Dye5ygq4EAW20RoBq0ABQ==}
- peerDependencies:
- react: 19.2.6
- react-native: '*'
-
- resolution: {integrity: sha512-2XnWsZToKj76trGtEZzx5ELD/qOICFEprEeUntImmitQFVUkea27fiWdUSITArI356Y1qynpXZINW+Unbhky/A==}
- peerDependencies:
- react: 19.2.6
- react-native: '*'
-
- resolution: {integrity: sha512-M4uFg5pUt35OMgjD4rWWbwd6PmxV96W7r/gQTTa+iZA5B+jO6aURhzAZGLHSrg1Kb91cKG0Rildy9q1WJvYstg==}
- peerDependencies:
- react-native: '>=0.59.0'
- react-native-svg: '>=12.0.0'
-
- resolution: {integrity: sha512-L4go5jA+GWutdJ/JucuN20cjAbMg1HmMtAP+wZ+3JLCf6Jd0bhXQHxciRP/AQm/FlrIEZwkMcHNZP+FXAiic0w==}
- peerDependencies:
- react: 19.2.6
- react-native: '*'
-
- resolution: {integrity: sha512-SO2t9/17zM4iEnFvlu2DA9jqNbzNhoUP+AItkoCOyFmDMOhUnBBznBDCYN92fGdfAkfQlWzPoez6+zLxFNsZEg==}
- peerDependencies:
- react: 19.2.6
- react-dom: 19.2.6
-
- resolution: {integrity: sha512-If0eHhoEdOYDcHsX+xBFwHMbWBGK1BvGDQDQdVkwtSIXiq1uiqjkpWVP2uQ1as94J0CzvFE9PUNDuhiX0Z6ubw==}
- peerDependencies:
- react: 19.2.6
- react-native: '*'
-
- resolution: {integrity: sha512-nu0OCC4xa9K5nihup2l2eDlOtQZ4mgMf0LN0EuP0/0JsLtqmMjGihIEO3NZ/rDHZ8uErORYUTp73naVeH0tG1g==}
- peerDependencies:
- react: 19.2.6
- react-native: '*'
-
- resolution: {integrity: sha512-JhE6IxDf6iabC0qu3+TAKA4v9RlluXmoIngPQX7/QUByf75lfrsHZ6/dQhyjEWnp1EEQiwzz8Cpew140ZcewDw==}
- peerDependencies:
- '@babel/core': '*'
- '@react-native/metro-config': '*'
- react: 19.2.6
- react-native: 0.83 - 0.86
-
- resolution: {integrity: sha512-17ALh/dd6AO4pgOVmOO5Axll5PbErEo3XFyLokyzW6usyi+OShIEPwUW26wLPlhVifgSOIfECCH0WN+0IqtJ1w==}
- engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0}
- hasBin: true
- peerDependencies:
- '@react-native/jest-preset': 0.86.0
- '@types/react': ^19.2.15
- react: 19.2.6
- peerDependenciesMeta:
- '@react-native/jest-preset':
- optional: true
- '@types/react':
- optional: true
-
- resolution: {integrity: sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA==}
- engines: {node: '>=0.10.0'}
-
- resolution: {integrity: sha512-z6F7K9bV85EfseRCp2bzrpyQ0Gkw1uLoCel9XBVWPg/TjRj94SkJzUTGfOa4bs7iJvBWtQG0Wq7wnI0syw3EBQ==}
- engines: {node: '>=0.10.0'}
-
- resolution: {integrity: sha512-QgT5//D3jfjJb6Gsjxv0Slpj23ip+HtOpnNgnb2S5zU3CB26G/IDPGoy4RJB42wzFE46DRsstbW6tKHoKbhAxw==}
- engines: {node: '>=0.10.0'}
-
- resolution: {integrity: sha512-9r+yi9+mgU33AKcj6IbT9oRCO78WriSj6t/cF8DWBZJ9aOGPOTEDvdUDz1FwKim7QXWwmHqtdHnRJfhAxEG46Q==}
- engines: {node: '>=10'}
- peerDependencies:
- '@types/react': ^19.2.15
- react: 19.2.6
- peerDependenciesMeta:
- '@types/react':
- optional: true
-
- resolution: {integrity: sha512-Iqb9NjCCTt6Hf+vOdNIZGdTiH1QSqr27H/Ek9sv/a97gfueI/5h1s3yRi1nngzMUaOOToin5dI1dXKdXiF+u0Q==}
- engines: {node: '>=10'}
- peerDependencies:
- '@types/react': ^19.2.15
+ '@types/react': ^19.2.15
react: 19.2.6
peerDependenciesMeta:
'@types/react':
@@ -14518,11 +11410,6 @@ packages:
'@types/react':
optional: true
- resolution: {integrity: sha512-GbS6V23YduFTPiWJ5xICbKEjRcqx1Z90js/V5miqhz7qp/d6xSe9Dd6NjSQODFRdzdsqRMPW82E/sFpPRbY5Mw==}
- peerDependencies:
- react: 19.2.6
-
resolution: {integrity: sha512-N2Hi6L78fFmhRra+ORpFSW7WST5x6kxpOPplIvtB0b7b+U2anpo1z1wLgaWRPS2kUSqcraRG+JgBCIlDJnqqAg==}
engines: {node: '>=8', npm: '>=5'}
@@ -14538,9 +11425,6 @@ packages:
resolution: {integrity: sha512-BNg9EN3DD3GsDXX7Aa8O4p92sryjkmzYYgmgTAc6CA4uGLEDzFfxOxugu21akOxpcXHiEgsYkC6nPsQvLLLmEg==}
hasBin: true
- resolution: {integrity: sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==}
-
resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==}
@@ -14548,10 +11432,6 @@ packages:
resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==}
engines: {node: '>= 6'}
- resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==}
- engines: {node: '>=8.10.0'}
-
resolution: {integrity: sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==}
engines: {node: '>= 14.18.0'}
@@ -14571,16 +11451,6 @@ packages:
resolution: {integrity: sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==}
- resolution: {integrity: sha512-m03P+zhBeQd1RGnYxrGyDAPpWX/epKirLrp8e3qevZdVkKtnCrjjWczIbYc8+xd6vcTStVlqfycTx1KR4LOr0g==}
- engines: {node: '>=4'}
-
- resolution: {integrity: sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==}
-
- resolution: {integrity: sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==}
-
resolution: {integrity: sha512-0YCaSCq2VRIebiaUviZNs0cBz1kg5kVS2UKUfNIx8YVs1cN3AV7NTctO5FOKBA+UT2BPJIWZauYHPqJODG50cg==}
@@ -14590,17 +11460,6 @@ packages:
resolution: {integrity: sha512-6VwtthbV4o/7+OaAF9I5L5V3llLEsoPyq9P1JVXkedTP33c7MfCG0/5NOPcSJn0TzXcG9YUrR0gQSWioew3LDg==}
- resolution: {integrity: sha512-0ghuzq67LI9bLXpOX/ISfve/Mq33a4aFRzoQYhnnok1JOFpmE/A2TBGkNVenOGEeSBCjIiWcc6MVOG5HEQv0sA==}
- engines: {node: '>=4'}
-
- resolution: {integrity: sha512-RvwtGe3d7LvWiDQXeQw8p5asZUmfU1G/l6WbUXeHta7Y2PEIvBTwH6E2EfmYUK8pxcxEdEmaomqyp0vZZ7C+3Q==}
-
- resolution: {integrity: sha512-NZQZdC5wOE/H3UT28fVGL+ikOZcEzfMGk/c3iN9UGxzWHMa1op7274oyiUVrAG4B2EuFhus8SvkaYnhvW92p9Q==}
- hasBin: true
-
resolution: {integrity: sha512-/aE8hCfKlQeA8LmyeyQvQF3eBiLRGNlfBJEvWH7ivp9sBqs7TNqBL5X3v157rM4IFETqDnIOO+z5M/biZbo9Ww==}
@@ -14656,10 +11515,6 @@ packages:
resolution: {integrity: sha512-QxMPqI6le2u0dCLyiGzgy92kjkkL6zO0XyvHzjdTNH3zM6e5Hz3BwG6+aEyNgiQ5Xz6PwTwgQEj3U50dByPKIA==}
engines: {node: '>=0.10.0'}
- resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==}
- engines: {node: '>=4'}
-
resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==}
engines: {node: '>=8'}
@@ -14667,26 +11522,14 @@ packages:
resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==}
- resolution: {integrity: sha512-nR23LHAvaI6aHtMg6RWoaHpdR4D881Nydkzi2CixINyg9T00KgaJdJI6Vwty+Ps8WLxZHuxsS0BseWjxSA4C+w==}
-
resolution: {integrity: sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==}
engines: {node: '>= 0.4'}
hasBin: true
- resolution: {integrity: sha512-TyeJ1zif53BPfHootBGwPRYT1RUt6oGWsaQr8UyZW/eAm9bKoijtvruSDEmZHm92CwS9nj7/fWttqPCgzep8CA==}
- engines: {node: '>= 0.4'}
- hasBin: true
-
resolution: {integrity: sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==}
- resolution: {integrity: sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q==}
- engines: {node: '>=4'}
-
resolution: {integrity: sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==}
engines: {node: '>=18'}
@@ -14787,9 +11630,6 @@ packages:
resolution: {integrity: sha512-guoltQEx+9aMf2gDZ0s62EcV8lsXR+0w8915TC3ITdn2YueuNjdAYh/levpU9nFaoChh9RUS5ZdQMrKfVEN9tw==}
- resolution: {integrity: sha512-PGMBq03+TTG/p/cRB7HCLKJ1MgDIi07+QU1faSjiYRfmY5UsAttV9Hs08jDAHVwcOwmVLcSJkpwyfXszVjWfIQ==}
-
resolution: {integrity: sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q==}
engines: {node: '>=18'}
@@ -14812,11 +11652,6 @@ packages:
resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==}
- resolution: {integrity: sha512-4lyHX0ZU0AZKwjgZ1InxZAa3PNpyEb8rOQ+Zss1ReYmhNzW0Q+h1zE5nvniXN0HaAWZaZE1zgVNEirb0R7LmNg==}
- engines: {node: '>=18.18'}
- hasBin: true
-
resolution: {integrity: sha512-9ZyI08PsvdQl2r/bBIGubpVdR3RR9sY6RDiWFPreA21C/EFlQhmgo20UZlNjZMMZNubusLhAQozkA0Od5J21Eg==}
@@ -14864,18 +11699,10 @@ packages:
engines: {node: '>=10'}
hasBin: true
- resolution: {integrity: sha512-VMbMxbDeehAxpOtWJXlcUS5E8iXh6QmN+BkRX1GARS3wRaXEEgzCcB10gTQazO42tpNIya8xIyNx8fll1OFPrg==}
- engines: {node: '>= 0.8.0'}
-
resolution: {integrity: sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==}
engines: {node: '>= 18'}
- resolution: {integrity: sha512-ghgmKt5o4Tly5yEG/UJp8qTd0AN7Xalw4XBtDEKP655B699qMEtra1WlXeE6WIvdEG481JvRxULKsInq/iNysw==}
- engines: {node: '>=0.10.0'}
-
resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==}
engines: {node: '>=10'}
@@ -14890,33 +11717,16 @@ packages:
resolution: {integrity: sha512-rVQVWjjSvlINzaQPZH5JFqsqEsIWdTxY3iJZCnTL/5gQbXIRooVZKI60tVCkOVfzcRPejboxO2t0P89dg5mQaA==}
engines: {node: '>=10'}
- resolution: {integrity: sha512-x0RTqQel6g5SY7Lg6ZreMmsOzncHFU7nhnRWkKgWuMTu5NN0DR5oruckMqRvacAN9d5w6ARnRBXl9xhDCgfMeA==}
- engines: {node: '>= 0.8.0'}
-
resolution: {integrity: sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==}
engines: {node: '>= 18'}
- resolution: {integrity: sha512-qepMx2JxAa5jjfzxG79yPPq+8BuFToHd1hm7kI+Z4zAq1ftQiP7HcxMhDDItrbtwVeLg/cY2JnKnrcFkmiswNA==}
-
resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==}
- resolution: {integrity: sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==}
-
resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==}
- resolution: {integrity: sha512-TPbeg0b7ylrswdGCji8FRGFAKuqbpQlLbL8SOle3j1iHSs5Ob5mhvMAxWN2UItOjgALAB5Zp3fmMfj8mbWvXKw==}
- engines: {node: '>=10'}
-
- resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==}
-
resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==}
engines: {node: '>=8'}
@@ -14964,15 +11774,9 @@ packages:
resolution: {integrity: sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==}
- resolution: {integrity: sha512-iMSw5i0XseMnrhtIzRb7XpQEXepa9xhWxGUojHBL43SIpQuDQkh3Wpy67ZbDzZVr6EKxvwVChnVpdl8hEVLDiw==}
-
resolution: {integrity: sha512-YT6MLqYsz7y1rQZOLFlOCCgSRpCi6bqY417yhoOLI7aVoBi29dD39EPrOE03W9DY25H0J0jizVsHZnkLzyGJFg==}
- resolution: {integrity: sha512-nAu1WFPQSMNr2Zn9PGSZK9AGn4t/y97lEm+MXTtUDwfP0ksAIX4nO+6ruD9Jwut4C49SB1Ws+fbXsm/yScWOHw==}
-
resolution: {integrity: sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==}
engines: {node: '>=10'}
@@ -14996,17 +11800,10 @@ packages:
resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==}
engines: {node: '>=14.16'}
- resolution: {integrity: sha512-h+z7HKHYXj6wJU+AnS/+IH8Uh9fdcX1Lrhg1/VMdf9PwoBQXFcXiAdsy2tSK0P6gKwJLXp02r90ahUCqHk9rrw==}
- engines: {node: '>=8.0.0'}
-
resolution: {integrity: sha512-dWUG8F5sIIARXih1DTaQAX4SsiTXhInKf1buxdY9DIg4ZYPZK5nGM1VRIYmEbDbsHt7USo99xSLFu5Q1IqTmsg==}
engines: {node: '>= 18'}
- resolution: {integrity: sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==}
-
resolution: {integrity: sha512-6hJeJMOcEX8ktqjpDoJZEmld3ijvcvWBDtiXBm7f4332SiFN66QeAQI1REQshvyUoISsSeJ4PHDauKYbwao9JQ==}
@@ -15020,10 +11817,6 @@ packages:
resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==}
- resolution: {integrity: sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==}
- engines: {node: '>=0.10.0'}
-
resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==}
engines: {node: '>=0.10.0'}
@@ -15042,10 +11835,6 @@ packages:
resolution: {integrity: sha512-28+AJr82moMVWolQvlAIv3JcYDkjkFTEmfDc503wxrF5l2rQ3dFz6DpbXp3kD4zmgGGldfM4xM4v1sFj/ZaIOA==}
- resolution: {integrity: sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw==}
- engines: {node: '>=6'}
-
resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==}
@@ -15062,16 +11851,6 @@ packages:
resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==}
- resolution: {integrity: sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==}
-
- resolution: {integrity: sha512-WjlahMgHmCJpqzU8bIBy4qtsZdU9lRlcZE3Lvyej6t4tuOuv1vk57OW3MBrj6hXBFx/nNoC9MPMTcr5YA7NQbg==}
- engines: {node: '>=6'}
-
- resolution: {integrity: sha512-YAmzwAiiQVocZxO/VGPFiQHcu5pKiz09QIGC0MK6aRMoa3E0QkoTQgcqJr7ZZ3OMiNhu4DkaGElFI5htjOIDbw==}
-
resolution: {integrity: sha512-BbHGOQK9olHPMvQNHWul6MYlrRTAOKn03rOe4A8O3CLWhNf4YHBqq2HJKKC+sfqpxiBY52pNeesD6jIiLDz8jg==}
@@ -15079,10 +11858,6 @@ packages:
resolution: {integrity: sha512-jH9EhtKIjuXZ2cWxmXS8ZP80XyC3iasQxMDV8jzhNJpfDb7VbQLVW4Wvsxz9QZvzV+G4YoSfBUVKDOyxLzi/sg==}
engines: {node: '>= 6'}
- resolution: {integrity: sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==}
- engines: {node: '>= 0.6'}
-
resolution: {integrity: sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==}
engines: {node: '>= 0.8'}
@@ -15109,17 +11884,9 @@ packages:
vite-plus:
optional: true
- resolution: {integrity: sha512-uyQK/mx5QjHun80FLJTfaWE7JtwfRMKBLkMne6udYOmvH0CawotVa7TfgYHzAnpphn4+TweIx1QKMnRIbipmUg==}
- engines: {node: '>= 0.10.0'}
-
resolution: {integrity: sha512-vMgjE/GGEPEFnhFub6pa4FmJBRBVOLpIII2hvCZ8Kzb7K0hlHo7mQv6xYrBvCL2LtAIBwFUK8wvuJgTVSQ5MFQ==}
- resolution: {integrity: sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ==}
- engines: {node: '>=4'}
-
resolution: {integrity: sha512-cEmp9QeXXRmjj/rVp9oyiqcvyocWab/HaoN4+bwFeZ7QzykJD6L3yD4v12K1x0tHpqRqVpJevN3gW7kyM39Bqg==}
@@ -15152,10 +11919,6 @@ packages:
resolution: {integrity: sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==}
- resolution: {integrity: sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==}
- engines: {node: '>=6'}
-
resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==}
engines: {node: '>=8'}
@@ -15204,9 +11967,6 @@ packages:
resolution: {integrity: sha512-ki4hZQfh5rX0QDLLkOCj+h+CVNkqmp/CMf8v8kZpkNVK6jGQooMytqzLZYUVYIZcFZ6yDB70EfD8POcFXiF5oA==}
engines: {node: '>=18'}
- resolution: {integrity: sha512-0MP/Cxx5SzeeZ10p/bZI0S6MpgD+yxAhi1BOQ34jgnMXsCq3j1t6tQnZu+KdlL7dvJTLT3g9xN8tl10TqgFMcg==}
-
resolution: {integrity: sha512-Y0AvSwDw8y+nlSNFXMm2g6L51rBGdAQT20J3YSOqxC53Lo3bjWRtr2BKcfYoAf352WYpsZSTURrA0tqhfgudPA==}
@@ -15222,9 +11982,6 @@ packages:
resolution: {integrity: sha512-LIN7rULI0jBscWQYaSswptyderlarFkjQ+t79nzty8tcIAceVomEVlLzH5VP4Cmsv6MtKhs7qaAiwlcp+Mgaxw==}
- resolution: {integrity: sha512-3ZUifmCDCQanjeej1f6kyl/BeP/Vae5EYkQ9iJfUm/QwZvlgnZzyflqAsAWYURdtea8Vkvswu2GrC57h3qffcA==}
-
resolution: {integrity: sha512-5Z9ZpRzfuH6l/UAvCPAPUo3665Nk2wLaZU3x+TLHKVzIz33+sbJqbtrYoC3KD4/uVOr2Zp+L0LySezP9OHV9yA==}
@@ -15253,22 +12010,10 @@ packages:
resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==}
engines: {node: '>=10'}
- resolution: {integrity: sha512-RpsAZlpWcDwOPQA22aCH4J0t7L8JmAvsCxfOSEwm7cQs3LshN36QaTkwd70DnBOXDWGssw2eUoc8CaRWT0XunA==}
- engines: {node: '>=8'}
-
resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==}
engines: {node: '>= 0.4'}
- resolution: {integrity: sha512-e4hG1hRwoOdRb37cIMSgzNsxyzKfayW6VOflrwvR+/bzrkyxY/31WkbgnQpgtrNp1SdpJvpUAGTa/ZoiPNDuRQ==}
-
- resolution: {integrity: sha512-+wn7I4p7YgJhHs38k2TNjy1vCfPIfLIJWR5MnCStsN8WuuTcBnRKcMHQLMM2ijxGZmDoZwNv8ipl5aTTen62ng==}
- engines: {node: '>=14.0.0'}
- hasBin: true
-
resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==}
@@ -15291,11 +12036,6 @@ packages:
peerDependencies:
tailwindcss: ^4
- resolution: {integrity: sha512-3ofp+LL8E+pK/JuPLPggVAIaEuhvIz4qNcf3nA1Xn2o/7fb7s/TYpHhwGDv1ZU3PkBluUVaF8PyCHcm48cKLWQ==}
- engines: {node: '>=14.0.0'}
- hasBin: true
-
resolution: {integrity: sha512-KWBIxs1Xb6NoLdMVqhbhgwZf2PGBpPEiwOqgI4pFIYbNTfBXiKYyWoTsXgBQ9WFg/OlhnvHaY+AEpW7wSmFo2Q==}
@@ -15328,10 +12068,6 @@ packages:
resolution: {integrity: sha512-yYrrsWnrXMcdsnu/7YMYAofM1ktpL5By7vZhf15CrXijWWrEYZks5AXBudalfSWJLlnen/QUJUB5aoB0kqZUGA==}
engines: {node: '>=6.0.0'}
- resolution: {integrity: sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ==}
- engines: {node: '>=8'}
-
resolution: {integrity: sha512-201R5j+sJpK8nFWwKVyNfZot8FaJbLZDq5evriVzbV1wDtSXDjRUDRfJzHpAaxFDMEhsZL1QkeqM61wgsS3KaQ==}
engines: {node: '>= 10.13.0'}
@@ -15397,9 +12133,6 @@ packages:
peerDependencies:
tslib: ^2
- resolution: {integrity: sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA==}
-
resolution: {integrity: sha512-01EAw5EDrcVrdgyCLgoSPvqznC0sVxDSVeiOz09FUpjh71G79VCqneOr+xvt7T1r76CF6ZZfPjHorN2+d+3mqA==}
@@ -15434,10 +12167,6 @@ 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}
@@ -15493,9 +12222,6 @@ packages:
resolution: {integrity: sha512-dRXchy+C0IgK8WPC6xvCHFRIWYUbqqdEIKPaKo/AcTUNzwLTK6AH7RjdLWsEZcAN/TBdtfUw3PYEgPr5VPr6ww==}
engines: {node: '>=14.16'}
- resolution: {integrity: sha512-FWAPzCIHZHnrE/5/w9MPk0kK25hSQSH2IKhYh9PyjS3SG/+IEMvlwIHbhz+oF7xl54I+ueZlVnMjyzdSwLmAwA==}
-
resolution: {integrity: sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==}
engines: {node: '>=6'}
@@ -15508,9 +12234,6 @@ packages:
resolution: {integrity: sha512-kXuRi1mtaKMrsLUxz3sQYvVl37B0Ns6MzfrtV5DvJceE9bPyspOqk9xxv7XbZWcfLWbFmm997vl83qUWVJA64w==}
engines: {node: '>=16'}
- resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==}
-
resolution: {integrity: sha512-hdF5ZgjTqgAntKkklYw0R03MG2x/bSzTtkxmIRw/sTNV8YXsCJ1tfLAX23lhxhHJlEf3CRCOCGGWw3vI3GaSPw==}
engines: {node: '>=18'}
@@ -15619,10 +12342,6 @@ packages:
resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==}
engines: {node: '>=10'}
- resolution: {integrity: sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg==}
- engines: {node: '>=8'}
-
resolution: {integrity: sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==}
engines: {node: '>=8'}
@@ -15663,14 +12382,6 @@ packages:
engines: {node: '>=14.17'}
hasBin: true
- resolution: {integrity: sha512-O3oYyCMPYgNNHuO7Jjk3uacJWZF8loBgwrfd/5LE/HyZ3lUIOdniQ7DNXJcIgZbwioZxk0fLfI4EVnetdiX5jg==}
- hasBin: true
-
- resolution: {integrity: sha512-LbBDqdIC5s8iROCUjMbW1f5dJQTEFB1+KO9ogbvlb3nm9n4YHa5p4KTvFPWvh2Hs8gZMBuiB1/8+pdfe/tDPug==}
- hasBin: true
-
resolution: {integrity: sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==}
@@ -15702,22 +12413,6 @@ packages:
resolution: {integrity: sha512-xamtWoB1EshgjpmlXd7GGm2VfdDtw1+rD8uhry8pSNW3If6S8E0m2T2+orSKeZXEn/aPJMviCpDBA65WJt8zhg==}
engines: {node: '>=22.19.0'}
- resolution: {integrity: sha512-dA8WbNeb2a6oQzAQ55YlT5vQAWGV9WXOsi3SskE3bcCdM0P4SDd+24zS/OCacdRq5BkdsRj9q3Pg6YyQoxIGqg==}
- engines: {node: '>=4'}
-
- resolution: {integrity: sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==}
- engines: {node: '>=4'}
-
- resolution: {integrity: sha512-JQ84qTuMg4nVkx8ga4A16a1epI9H6uTXAknqxkGF/aFfRLw1xC/Bp24HNLaZhHSkWd3+84t8iXnp1J0kYcZHhg==}
- engines: {node: '>=4'}
-
- resolution: {integrity: sha512-hpbDzxUY9BFwX+UeBnxv3Sh1q7HFxj48DTmXchNgRa46lO8uj3/1iEn3MiNUYTg1g9ctIqXCCERn8gYZhHC5lQ==}
- engines: {node: '>=4'}
-
resolution: {integrity: sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA==}
@@ -15784,11 +12479,6 @@ packages:
'@types/react':
optional: true
- resolution: {integrity: sha512-FvRG9i1HSo0wagmX63Vrm8SnlUU3LMM3WyZkQ76RnslpBrX694AdG4A0zQBx2B3ZifFA0yv/BaEHGBnEax5rZg==}
- peerDependencies:
- react: 19.2.6
-
resolution: {integrity: sha512-Fedw0aZvkhynoPYlA5WXrMCAMm+nSWdZt6lzJQ7Ok8S6Q+VsHmHpRWndVRJ8Be0ZbkfPc5LRYH+5XrzXcEeLRQ==}
engines: {node: '>=10'}
@@ -15813,10 +12503,6 @@ packages:
resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
- resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==}
- engines: {node: '>= 0.4.0'}
-
resolution: {integrity: sha512-USe1zesMYh4fjCA8ZH5+X5WIVD0J4V1Jksm1bFTVBX2F/cwSXt0RO5w/3UXbdLKmZX65MiWV+hwhSS8p6oBTGA==}
hasBin: true
@@ -15825,11 +12511,6 @@ packages:
resolution: {integrity: sha512-XQegIaBTVUjSHliKqcnFqYypAd4S+WCYt5NIeRs6w/UAry7z8Y9j5ZwRRL4kzq9U3sD6v+85er9FvkEaBpji2w==}
hasBin: true
- resolution: {integrity: sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg==}
- deprecated: uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028).
- hasBin: true
-
resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==}
deprecated: uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028).
@@ -15839,20 +12520,10 @@ packages:
resolution: {integrity: sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==}
engines: {node: '>=10.12.0'}
- resolution: {integrity: sha512-OljLrQ9SQdOUqTaQxqL5dEfZWrXExyyWsozYlAWFawPVNuD83igl7uJD2RTkNMbniIYgt8l81eCJGIdQF7avLQ==}
- engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0}
-
resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==}
engines: {node: '>= 0.8'}
- resolution: {integrity: sha512-ZFkClGpWyI2WUQjdLJ/BaGuV6AVQiJ3uELGk3OYtP+B6yCO7Cmn9vPFXVJkRaGkOJu3m8bQMgtyzNHixULceQA==}
- peerDependencies:
- react: 19.2.6
- react-dom: 19.2.6
-
resolution: {integrity: sha512-5yXvWDEgqeiYiBe1lbxYF7UMAIm/IcopxMHrMQDq3nvKcjPKIhZklUKL+AE7J7uApI4kwe2snsK+eI6UTj9EHg==}
@@ -15887,47 +12558,6 @@ packages:
peerDependencies:
vite: '*'
- resolution: {integrity: sha512-6lvjbS3p9b4CrdCmguzbh2/4uoXhGE2q71R4OX5sqF9R1bo9Xd6fGrMAfvp5wnCzlBnFVdCOp6onuTQVbo8iUQ==}
- engines: {node: ^20.0.0 || ^22.0.0 || >=24.0.0}
- hasBin: true
- peerDependencies:
- '@edge-runtime/vm': '*'
- '@opentelemetry/api': ^1.9.0
- '@types/node': ^20.0.0 || ^22.0.0 || >=24.0.0
- '@vitest/browser-playwright': 4.1.6
- '@vitest/browser-preview': 4.1.6
- '@vitest/browser-webdriverio': 4.1.6
- '@vitest/coverage-istanbul': 4.1.6
- '@vitest/coverage-v8': 4.1.6
- '@vitest/ui': 4.1.6
- happy-dom: '*'
- jsdom: '*'
- vite: ^6.0.0 || ^7.0.0 || ^8.0.0
- peerDependenciesMeta:
- '@edge-runtime/vm':
- optional: true
- '@opentelemetry/api':
- optional: true
- '@types/node':
- optional: true
- '@vitest/browser-playwright':
- optional: true
- '@vitest/browser-preview':
- optional: true
- '@vitest/browser-webdriverio':
- optional: true
- '@vitest/coverage-istanbul':
- optional: true
- '@vitest/coverage-v8':
- optional: true
- '@vitest/ui':
- optional: true
- happy-dom:
- optional: true
- jsdom:
- optional: true
-
resolution: {integrity: sha512-flY6ScbCIt9HThs+C5HS7jvGOB560DJtk/Z15IQROTA6zEy49Nh8T/dofWTQL+n3vswqn87sbJNiuqw1SDp5Ig==}
engines: {node: ^20.0.0 || ^22.0.0 || >=24.0.0}
@@ -15969,9 +12599,6 @@ packages:
jsdom:
optional: true
- resolution: {integrity: sha512-gQpnTgkubC6hQgdIcRdYGDSDc+SaujOdyesZQMv6JlfQee/9Mp0Qhnys6WxDWvQnL5WZdT7o2Ul187aSt0Rq+w==}
-
resolution: {integrity: sha512-rht18IFYv117UlqBn6o9j258SOtwhDBmtVrGwdoLPpSj6Z5LKQIzarQDd/tCRWneU68KEX25+nsh48tAoknKNw==}
@@ -15999,16 +12626,10 @@ packages:
resolution: {integrity: sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==}
- resolution: {integrity: sha512-VkQZJbO8zVImzYFteBXvBOZEl1qL175WH8VmZcxF2fZAoudNhNDvHi+doCaAEdU2l2vtcIwa2zn0QK5+I1HQ3Q==}
-
resolution: {integrity: sha512-6i/00NBjP4yGPs+caKSyRfpTF/8Torsu0MOW3mMzIbhgISFder8i7xbqgHlLMwJrdiN8ndBV3UA1/AfzPSr+jg==}
engines: {node: '>=10.13.0'}
- resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==}
-
resolution: {integrity: sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==}
@@ -16022,9 +12643,6 @@ packages:
resolution: {integrity: sha512-gsXecm82UQNlTBURJGuqOWy1Ww08S3kZUcr3aOJS02Pk0xLtkfeUAVC0u0xhgdonFme80edSJUIJyuvL/7250Q==}
- resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==}
-
resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==}
engines: {node: '>=12'}
@@ -16051,23 +12669,14 @@ packages:
engines: {node: '>=18'}
deprecated: Use @exodus/bytes instead for a more spec-conformant and faster implementation
- resolution: {integrity: sha512-EqhiFU6daOA8kpjOWTL0olhVOF3i7OrFzSYiGsEMB8GcXS+RrzauAERX65xMeNWVqxA6HXH2m69Z9LaKKdisfg==}
-
resolution: {integrity: sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==}
engines: {node: '>=18'}
- resolution: {integrity: sha512-XPEm0XFQWNVG292lII1PrRRJl3sItrs7CettZ4ncYxuDVpLyy+NwlGyut2hXI0JswcJUxeCH+CyOJK0ZzAXD6A==}
-
resolution: {integrity: sha512-De72GdQZzNTUBBChsXueQUnPKDkg/5A5zp7pFDuQAj5UFoENpiACU0wlCvzpAGnTkj++ihpKwKyYewn/XNUbKw==}
engines: {node: '>=18'}
- resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==}
-
resolution: {integrity: sha512-VGkKJ564kzt6Ms1dbgPP/yuIoQCrsFAnRbptpC5wOEsDaNsbCB2bnfnaA8i/vRs5tjUSEOtIuvl9/MyVsvQZCg==}
@@ -16124,18 +12733,6 @@ packages:
resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==}
engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0}
- resolution: {integrity: sha512-zS54Oen9bITtp7kp2XM3AydrCIq1D+HwJOuH+c+e4LfpL/lotP5osijd+UoMnxwAam1GN8R4KtLAyIrIcBNpiA==}
- engines: {node: '>=8.3.0'}
- peerDependencies:
- bufferutil: ^4.0.1
- utf-8-validate: ^5.0.2
- peerDependenciesMeta:
- bufferutil:
- optional: true
- utf-8-validate:
- optional: true
-
resolution: {integrity: sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==}
engines: {node: '>=10.0.0'}
@@ -16152,10 +12749,6 @@ packages:
resolution: {integrity: sha512-h3Fbisa2nKGPxCpm89Hk33lBLsnaGBvctQopaBSOW/uIs6FTe1ATyAnKFJrzVs9vpGdsTe73WF3V4lIsk4Gacw==}
engines: {node: '>=18'}
- resolution: {integrity: sha512-kCz5k7J7XbJtjABOvkc5lJmkiDh8VhjVCGNiqdKCscmVpdVUpEAyXv1xmCLkQJ5dsHqx3IPO4XW+NTDhU/fatA==}
- engines: {node: '>=10.0.0'}
-
resolution: {integrity: sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==}
engines: {node: '>=18'}
@@ -16167,10 +12760,6 @@ packages:
resolution: {integrity: sha512-drPFnkQJik/O+uPKpqSgr22mpuFHqKdbS835iAQrUC73L2F5WkboIRd63ai/2Yg6I1jzifPFKH2NTK+cfglkIA==}
engines: {node: '>=4.0.0'}
- resolution: {integrity: sha512-eLTh0kA8uHceqesPqSE+VvO1CDDJWMwlQfB6LuN6T8w6MaDJ8Txm8P7s5cHD0miF0V+GGTZrDQfxPZQVsur33w==}
- engines: {node: '>=4.0.0'}
-
resolution: {integrity: sha512-huCv9IH9Tcf95zuYCsQraZtWnJvBtLVE0QHMOs8bWyZAFZNDcYjsPq1nEx8jKA9y+Beo9v+7OBPRisQTjinQMw==}
@@ -16273,11 +12862,6 @@ packages:
resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==}
- resolution: {integrity: sha512-2YMAriaYHX9wrBY2k7H0epSo+dyCaCZg/vOtt+nEDXM9ul480gkXz/9SkwpOeHcD2H5qqDG8lWDSBwpTcZpa6w==}
- peerDependencies:
- '@types/emscripten': '>=1.39.6'
-
snapshots:
'@adobe/[email protected]': {}
@@ -16290,8 +12874,6 @@ snapshots:
dependencies:
zod: 4.4.3
- '@alloc/[email protected]': {}
-
dependencies:
package-manager-detector: 1.8.0
@@ -16598,8 +13180,6 @@ snapshots:
'@babel/[email protected]': {}
- '@babel/[email protected]': {}
-
dependencies:
'@babel/code-frame': 7.29.0
@@ -16628,22 +13208,6 @@ 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
-
- '@babel/[email protected]':
- dependencies:
- '@babel/types': 7.29.7
-
- '@babel/[email protected]':
- dependencies:
- '@babel/types': 7.29.7
-
dependencies:
'@babel/compat-data': 7.29.0
@@ -16652,106 +13216,7 @@ 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([email protected])
- '@babel/helper-annotate-as-pure': 7.27.3
- '@babel/helper-member-expression-to-functions': 7.28.5([email protected])
- '@babel/helper-optimise-call-expression': 7.27.1
- '@babel/helper-replace-supers': 7.28.6(@babel/[email protected]([email protected]))([email protected])
- '@babel/helper-skip-transparent-expression-wrappers': 7.27.1([email protected])
- '@babel/traverse': 7.29.0([email protected])
- semver: 6.3.1
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-annotate-as-pure': 7.27.3
- '@babel/helper-member-expression-to-functions': 7.28.5([email protected])
- '@babel/helper-optimise-call-expression': 7.27.1
- '@babel/helper-replace-supers': 7.28.6(@babel/[email protected]([email protected]))([email protected])
- '@babel/helper-skip-transparent-expression-wrappers': 7.27.1([email protected])
- '@babel/traverse': 7.29.0([email protected])
- semver: 6.3.1
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-annotate-as-pure': 7.29.7
- '@babel/helper-member-expression-to-functions': 7.29.7([email protected])
- '@babel/helper-optimise-call-expression': 7.29.7
- '@babel/helper-replace-supers': 7.29.7(@babel/[email protected]([email protected]))([email protected])
- '@babel/helper-skip-transparent-expression-wrappers': 7.29.7([email protected])
- '@babel/traverse': 7.29.7([email protected])
- semver: 6.3.1
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-annotate-as-pure': 7.27.3
- regexpu-core: 6.4.0
- semver: 6.3.1
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-annotate-as-pure': 7.29.7
- regexpu-core: 6.4.0
- semver: 6.3.1
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-compilation-targets': 7.29.7
- '@babel/helper-plugin-utils': 7.29.7
- debug: 4.4.3([email protected])
- lodash.debounce: 4.0.8
- resolve: 1.22.11
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-compilation-targets': 7.29.7
- '@babel/helper-plugin-utils': 7.29.7
- debug: 4.4.3([email protected])
- lodash.debounce: 4.0.8
- resolve: 1.22.12
- transitivePeerDependencies:
- - supports-color
-
- '@babel/[email protected]': {}
-
- '@babel/[email protected]': {}
-
- dependencies:
- '@babel/traverse': 7.29.0([email protected])
- '@babel/types': 7.29.7
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- '@babel/traverse': 7.29.7([email protected])
- '@babel/types': 7.29.7
- transitivePeerDependencies:
- - supports-color
+ '@babel/[email protected]': {}
dependencies:
@@ -16760,13 +13225,6 @@ snapshots:
transitivePeerDependencies:
- supports-color
- dependencies:
- '@babel/traverse': 7.29.7([email protected])
- '@babel/types': 7.29.7
- transitivePeerDependencies:
- - supports-color
-
dependencies:
'@babel/core': 7.29.0([email protected])
@@ -16776,77 +13234,10 @@ snapshots:
transitivePeerDependencies:
- supports-color
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-module-imports': 7.29.7([email protected])
- '@babel/helper-validator-identifier': 7.29.7
- '@babel/traverse': 7.29.7([email protected])
- transitivePeerDependencies:
- - supports-color
-
- '@babel/[email protected]':
- 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([email protected])
- '@babel/helper-annotate-as-pure': 7.27.3
- '@babel/helper-wrap-function': 7.28.6([email protected])
- '@babel/traverse': 7.29.0([email protected])
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-annotate-as-pure': 7.29.7
- '@babel/helper-wrap-function': 7.29.7([email protected])
- '@babel/traverse': 7.29.7([email protected])
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-member-expression-to-functions': 7.28.5([email protected])
- '@babel/helper-optimise-call-expression': 7.27.1
- '@babel/traverse': 7.29.0([email protected])
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-member-expression-to-functions': 7.29.7([email protected])
- '@babel/helper-optimise-call-expression': 7.29.7
- '@babel/traverse': 7.29.7([email protected])
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- '@babel/traverse': 7.29.0([email protected])
- '@babel/types': 7.29.7
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- '@babel/traverse': 7.29.7([email protected])
- '@babel/types': 7.29.7
- transitivePeerDependencies:
- - supports-color
-
'@babel/[email protected]': {}
'@babel/[email protected]': {}
@@ -16857,24 +13248,6 @@ snapshots:
'@babel/[email protected]': {}
- '@babel/[email protected]': {}
-
- dependencies:
- '@babel/template': 7.29.7
- '@babel/traverse': 7.29.7([email protected])
- '@babel/types': 7.29.7
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- '@babel/template': 7.29.7
- '@babel/traverse': 7.29.7([email protected])
- '@babel/types': 7.29.7
- transitivePeerDependencies:
- - supports-color
-
dependencies:
'@babel/template': 7.28.6
@@ -16888,25 +13261,6 @@ snapshots:
dependencies:
'@babel/types': 7.29.7
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-create-class-features-plugin': 7.29.3(@babel/[email protected]([email protected]))([email protected])
- '@babel/helper-plugin-utils': 7.28.6
- '@babel/plugin-syntax-decorators': 7.28.6(@babel/[email protected]([email protected]))
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-plugin-utils': 7.28.6
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-plugin-utils': 7.29.7
-
dependencies:
'@babel/core': 7.29.0([email protected])
@@ -16927,36 +13281,6 @@ snapshots:
'@babel/core': 7.29.0([email protected])
'@babel/helper-plugin-utils': 7.29.7
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-plugin-utils': 7.28.6
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-plugin-utils': 7.28.6
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-plugin-utils': 7.28.6
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-plugin-utils': 7.29.7
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-plugin-utils': 7.28.6
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-plugin-utils': 7.29.7
-
dependencies:
'@babel/core': 7.29.0([email protected])
@@ -16977,11 +13301,6 @@ snapshots:
'@babel/core': 7.29.0([email protected])
'@babel/helper-plugin-utils': 7.28.6
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-plugin-utils': 7.29.7
-
dependencies:
'@babel/core': 7.29.0([email protected])
@@ -17027,1107 +13346,679 @@ snapshots:
'@babel/core': 7.29.0([email protected])
'@babel/helper-plugin-utils': 7.28.6
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-plugin-utils': 7.29.7
-
dependencies:
'@babel/core': 7.29.0([email protected])
'@babel/helper-plugin-utils': 7.28.6
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-plugin-utils': 7.28.6
- '@babel/helper-remap-async-to-generator': 7.27.1(@babel/[email protected]([email protected]))([email protected])
- '@babel/traverse': 7.29.0([email protected])
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-plugin-utils': 7.29.7
- '@babel/helper-remap-async-to-generator': 7.29.7(@babel/[email protected]([email protected]))([email protected])
- '@babel/traverse': 7.29.7([email protected])
- transitivePeerDependencies:
- - supports-color
-
dependencies:
'@babel/core': 7.29.0([email protected])
- '@babel/helper-module-imports': 7.28.6([email protected])
'@babel/helper-plugin-utils': 7.28.6
- '@babel/helper-remap-async-to-generator': 7.27.1(@babel/[email protected]([email protected]))([email protected])
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-module-imports': 7.29.7([email protected])
- '@babel/helper-plugin-utils': 7.29.7
- '@babel/helper-remap-async-to-generator': 7.29.7(@babel/[email protected]([email protected]))([email protected])
- transitivePeerDependencies:
- - supports-color
dependencies:
'@babel/core': 7.29.0([email protected])
'@babel/helper-plugin-utils': 7.28.6
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-plugin-utils': 7.29.7
+ '@babel/[email protected]': {}
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-create-class-features-plugin': 7.29.3(@babel/[email protected]([email protected]))([email protected])
- '@babel/helper-plugin-utils': 7.28.6
- transitivePeerDependencies:
- - supports-color
+ '@babel/[email protected]': {}
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-create-class-features-plugin': 7.29.7(@babel/[email protected]([email protected]))([email protected])
- '@babel/helper-plugin-utils': 7.29.7
- transitivePeerDependencies:
- - supports-color
+ '@babel/[email protected]': {}
+ '@babel/[email protected]':
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-create-class-features-plugin': 7.29.3(@babel/[email protected]([email protected]))([email protected])
- '@babel/helper-plugin-utils': 7.28.6
- transitivePeerDependencies:
- - supports-color
+ '@babel/code-frame': 7.29.0
+ '@babel/parser': 7.29.7
+ '@babel/types': 7.29.7
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-annotate-as-pure': 7.27.3
- '@babel/helper-compilation-targets': 7.28.6
+ '@babel/code-frame': 7.29.0
+ '@babel/generator': 7.29.1
'@babel/helper-globals': 7.28.0
- '@babel/helper-plugin-utils': 7.28.6
- '@babel/helper-replace-supers': 7.28.6(@babel/[email protected]([email protected]))([email protected])
- '@babel/traverse': 7.29.0([email protected])
+ '@babel/parser': 7.29.0
+ '@babel/template': 7.28.6
+ '@babel/types': 7.29.7
+ debug: 4.4.3([email protected])
transitivePeerDependencies:
- supports-color
+ '@babel/[email protected]':
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@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]([email protected]))([email protected])
- '@babel/traverse': 7.29.7([email protected])
- transitivePeerDependencies:
- - supports-color
+ '@babel/helper-string-parser': 7.27.1
+ '@babel/helper-validator-identifier': 7.28.5
+ '@babel/[email protected]':
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-plugin-utils': 7.28.6
- '@babel/traverse': 7.29.0([email protected])
- transitivePeerDependencies:
- - supports-color
+ '@babel/helper-string-parser': 7.29.7
+ '@babel/helper-validator-identifier': 7.29.7
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-plugin-utils': 7.29.7
- '@babel/traverse': 7.29.7([email protected])
- transitivePeerDependencies:
- - supports-color
+ '@babel/runtime': 7.29.2
+ '@floating-ui/react-dom': 2.1.8([email protected]([email protected]))([email protected])
+ '@floating-ui/utils': 0.2.11
+ react: 19.2.6
+ react-dom: 19.2.6([email protected])
+ tabbable: 6.4.0
+ use-sync-external-store: 1.6.0([email protected])
+ optionalDependencies:
+ '@types/react': 19.2.17
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-plugin-utils': 7.28.6
+ '@babel/runtime': 7.29.7
+ '@floating-ui/utils': 0.2.11
+ react: 19.2.6
+ react-dom: 19.2.6([email protected])
+ reselect: 5.1.1
+ use-sync-external-store: 1.6.0([email protected])
+ optionalDependencies:
+ '@types/react': 19.2.17
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-plugin-utils': 7.28.6
- '@babel/plugin-syntax-flow': 7.28.6(@babel/[email protected]([email protected]))
+ '@bcoe/[email protected]': {}
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-plugin-utils': 7.29.7
- '@babel/plugin-syntax-flow': 7.29.7(@babel/[email protected]([email protected]))
+ '@bcoe/[email protected]': {}
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-plugin-utils': 7.28.6
- '@babel/helper-skip-transparent-expression-wrappers': 7.27.1([email protected])
- transitivePeerDependencies:
- - supports-color
+ '@biomejs/[email protected]':
+ optionalDependencies:
+ '@biomejs/cli-darwin-arm64': 2.2.4
+ '@biomejs/cli-darwin-x64': 2.2.4
+ '@biomejs/cli-linux-arm64': 2.2.4
+ '@biomejs/cli-linux-arm64-musl': 2.2.4
+ '@biomejs/cli-linux-x64': 2.2.4
+ '@biomejs/cli-linux-x64-musl': 2.2.4
+ '@biomejs/cli-win32-arm64': 2.2.4
+ '@biomejs/cli-win32-x64': 2.2.4
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-plugin-utils': 7.29.7
- '@babel/helper-skip-transparent-expression-wrappers': 7.29.7([email protected])
- transitivePeerDependencies:
- - supports-color
+ '@biomejs/[email protected]':
+ optional: true
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-plugin-utils': 7.28.6
+ '@biomejs/[email protected]':
+ optional: true
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-module-transforms': 7.28.6(@babel/[email protected]([email protected]))([email protected])
- '@babel/helper-plugin-utils': 7.28.6
- transitivePeerDependencies:
- - supports-color
+ '@biomejs/[email protected]':
+ optional: true
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-module-transforms': 7.29.7(@babel/[email protected]([email protected]))([email protected])
- '@babel/helper-plugin-utils': 7.29.7
- transitivePeerDependencies:
- - supports-color
+ '@biomejs/[email protected]':
+ optional: true
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-create-regexp-features-plugin': 7.28.5(@babel/[email protected]([email protected]))
- '@babel/helper-plugin-utils': 7.28.6
+ '@biomejs/[email protected]':
+ optional: true
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-create-regexp-features-plugin': 7.29.7(@babel/[email protected]([email protected]))
- '@babel/helper-plugin-utils': 7.29.7
+ '@biomejs/[email protected]':
+ optional: true
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-plugin-utils': 7.28.6
+ '@biomejs/[email protected]':
+ optional: true
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-plugin-utils': 7.29.7
+ '@biomejs/[email protected]':
+ optional: true
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-compilation-targets': 7.28.6
- '@babel/helper-plugin-utils': 7.28.6
- '@babel/plugin-transform-destructuring': 7.28.5(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-parameters': 7.27.7(@babel/[email protected]([email protected]))
- '@babel/traverse': 7.29.0([email protected])
- transitivePeerDependencies:
- - supports-color
+ '@borewit/[email protected]': {}
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-plugin-utils': 7.28.6
+ '@braintree/[email protected]': {}
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-plugin-utils': 7.29.7
+ '@chevrotain/[email protected]': {}
+ '@codemirror/[email protected]':
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-plugin-utils': 7.28.6
- '@babel/helper-skip-transparent-expression-wrappers': 7.27.1([email protected])
- transitivePeerDependencies:
- - supports-color
+ '@codemirror/language': 6.12.2
+ '@codemirror/state': 6.5.4
+ '@codemirror/view': 6.39.17
+ '@lezer/common': 1.5.1
+ '@codemirror/[email protected]':
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-plugin-utils': 7.29.7
- '@babel/helper-skip-transparent-expression-wrappers': 7.29.7([email protected])
- transitivePeerDependencies:
- - supports-color
+ '@codemirror/lang-html': 6.4.11
+ '@codemirror/lang-javascript': 6.2.4
+ '@codemirror/language': 6.12.2
+ '@lezer/common': 1.5.1
+ '@lezer/highlight': 1.2.3
+ '@lezer/lr': 1.4.8
+ '@codemirror/[email protected]':
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-plugin-utils': 7.28.6
+ '@codemirror/language': 6.12.2
+ '@lezer/cpp': 1.1.5
+ '@codemirror/[email protected]':
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-create-class-features-plugin': 7.29.3(@babel/[email protected]([email protected]))([email protected])
- '@babel/helper-plugin-utils': 7.28.6
- transitivePeerDependencies:
- - supports-color
+ '@codemirror/autocomplete': 6.20.0
+ '@codemirror/language': 6.12.2
+ '@codemirror/state': 6.5.4
+ '@lezer/common': 1.5.1
+ '@lezer/css': 1.3.0
+ '@codemirror/[email protected]':
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-create-class-features-plugin': 7.29.7(@babel/[email protected]([email protected]))([email protected])
- '@babel/helper-plugin-utils': 7.29.7
- transitivePeerDependencies:
- - supports-color
+ '@codemirror/autocomplete': 6.20.0
+ '@codemirror/language': 6.12.2
+ '@codemirror/state': 6.5.4
+ '@lezer/common': 1.5.1
+ '@lezer/go': 1.0.1
+ '@codemirror/[email protected]':
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-annotate-as-pure': 7.27.3
- '@babel/helper-create-class-features-plugin': 7.29.3(@babel/[email protected]([email protected]))([email protected])
- '@babel/helper-plugin-utils': 7.28.6
- transitivePeerDependencies:
- - supports-color
+ '@codemirror/autocomplete': 6.20.0
+ '@codemirror/lang-css': 6.3.1
+ '@codemirror/lang-javascript': 6.2.4
+ '@codemirror/language': 6.12.2
+ '@codemirror/state': 6.5.4
+ '@codemirror/view': 6.39.17
+ '@lezer/common': 1.5.1
+ '@lezer/css': 1.3.0
+ '@lezer/html': 1.3.13
+ '@codemirror/[email protected]':
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-annotate-as-pure': 7.29.7
- '@babel/helper-create-class-features-plugin': 7.29.7(@babel/[email protected]([email protected]))([email protected])
- '@babel/helper-plugin-utils': 7.29.7
- transitivePeerDependencies:
- - supports-color
+ '@codemirror/language': 6.12.2
+ '@lezer/java': 1.1.3
+ '@codemirror/[email protected]':
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-plugin-utils': 7.28.6
+ '@codemirror/autocomplete': 6.20.0
+ '@codemirror/language': 6.12.2
+ '@codemirror/lint': 6.9.3
+ '@codemirror/state': 6.5.4
+ '@codemirror/view': 6.39.17
+ '@lezer/common': 1.5.1
+ '@lezer/javascript': 1.5.4
+ '@codemirror/[email protected]':
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-plugin-utils': 7.29.7
+ '@codemirror/lang-html': 6.4.11
+ '@codemirror/language': 6.12.2
+ '@lezer/common': 1.5.1
+ '@lezer/highlight': 1.2.3
+ '@lezer/lr': 1.4.8
+ '@codemirror/[email protected]':
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/plugin-transform-react-jsx': 7.28.6(@babel/[email protected]([email protected]))([email protected])
- transitivePeerDependencies:
- - supports-color
+ '@codemirror/language': 6.12.2
+ '@lezer/json': 1.0.3
+ '@codemirror/[email protected]':
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-plugin-utils': 7.28.6
+ '@codemirror/autocomplete': 6.20.0
+ '@codemirror/lang-html': 6.4.11
+ '@codemirror/language': 6.12.2
+ '@codemirror/state': 6.5.4
+ '@codemirror/view': 6.39.17
+ '@lezer/common': 1.5.1
+ '@lezer/highlight': 1.2.3
+ '@lezer/lr': 1.4.8
+ '@codemirror/[email protected]':
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-plugin-utils': 7.29.7
+ '@codemirror/autocomplete': 6.20.0
+ '@codemirror/lang-html': 6.4.11
+ '@codemirror/language': 6.12.2
+ '@codemirror/state': 6.5.4
+ '@codemirror/view': 6.39.17
+ '@lezer/common': 1.5.1
+ '@lezer/markdown': 1.6.3
+ '@codemirror/[email protected]':
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-plugin-utils': 7.28.6
+ '@codemirror/lang-html': 6.4.11
+ '@codemirror/language': 6.12.2
+ '@codemirror/state': 6.5.4
+ '@lezer/common': 1.5.1
+ '@lezer/php': 1.0.5
+ '@codemirror/[email protected]':
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-plugin-utils': 7.29.7
+ '@codemirror/autocomplete': 6.20.0
+ '@codemirror/language': 6.12.2
+ '@codemirror/state': 6.5.4
+ '@lezer/common': 1.5.1
+ '@lezer/python': 1.1.18
+ '@codemirror/[email protected]':
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-annotate-as-pure': 7.27.3
- '@babel/helper-module-imports': 7.28.6([email protected])
- '@babel/helper-plugin-utils': 7.28.6
- '@babel/plugin-syntax-jsx': 7.28.6(@babel/[email protected]([email protected]))
- '@babel/types': 7.29.7
- transitivePeerDependencies:
- - supports-color
+ '@codemirror/language': 6.12.2
+ '@lezer/rust': 1.0.2
+ '@codemirror/[email protected]':
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-annotate-as-pure': 7.29.7
- '@babel/helper-module-imports': 7.29.7([email protected])
- '@babel/helper-plugin-utils': 7.29.7
- '@babel/plugin-syntax-jsx': 7.29.7(@babel/[email protected]([email protected]))
- '@babel/types': 7.29.7
- transitivePeerDependencies:
- - supports-color
+ '@codemirror/lang-css': 6.3.1
+ '@codemirror/language': 6.12.2
+ '@codemirror/state': 6.5.4
+ '@lezer/common': 1.5.1
+ '@lezer/sass': 1.1.0
+ '@codemirror/[email protected]':
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-annotate-as-pure': 7.27.3
- '@babel/helper-plugin-utils': 7.28.6
+ '@codemirror/autocomplete': 6.20.0
+ '@codemirror/language': 6.12.2
+ '@codemirror/state': 6.5.4
+ '@lezer/common': 1.5.1
+ '@lezer/highlight': 1.2.3
+ '@lezer/lr': 1.4.8
+ '@codemirror/[email protected]':
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-plugin-utils': 7.29.7
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-module-imports': 7.28.6([email protected])
- '@babel/helper-plugin-utils': 7.28.6
- babel-plugin-polyfill-corejs2: 0.4.15(@babel/[email protected]([email protected]))([email protected])
- babel-plugin-polyfill-corejs3: 0.13.0(@babel/[email protected]([email protected]))([email protected])
- babel-plugin-polyfill-regenerator: 0.6.6(@babel/[email protected]([email protected]))([email protected])
- semver: 6.3.1
- transitivePeerDependencies:
- - supports-color
+ '@codemirror/lang-html': 6.4.11
+ '@codemirror/lang-javascript': 6.2.4
+ '@codemirror/language': 6.12.2
+ '@lezer/common': 1.5.1
+ '@lezer/highlight': 1.2.3
+ '@lezer/lr': 1.4.8
+ '@codemirror/[email protected]':
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-module-imports': 7.29.7([email protected])
- '@babel/helper-plugin-utils': 7.29.7
- babel-plugin-polyfill-corejs2: 0.4.17(@babel/[email protected]([email protected]))([email protected])
- babel-plugin-polyfill-corejs3: 0.13.0(@babel/[email protected]([email protected]))([email protected])
- babel-plugin-polyfill-regenerator: 0.6.8(@babel/[email protected]([email protected]))([email protected])
- semver: 6.3.1
- transitivePeerDependencies:
- - supports-color
+ '@codemirror/language': 6.12.2
+ '@lezer/common': 1.5.1
+ '@lezer/highlight': 1.2.3
+ '@lezer/lr': 1.4.8
+ '@codemirror/[email protected]':
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-plugin-utils': 7.28.6
+ '@codemirror/autocomplete': 6.20.0
+ '@codemirror/language': 6.12.2
+ '@codemirror/state': 6.5.4
+ '@codemirror/view': 6.39.17
+ '@lezer/common': 1.5.1
+ '@lezer/xml': 1.0.6
+ '@codemirror/[email protected]':
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-plugin-utils': 7.28.6
+ '@codemirror/autocomplete': 6.20.0
+ '@codemirror/language': 6.12.2
+ '@codemirror/state': 6.5.4
+ '@lezer/common': 1.5.1
+ '@lezer/highlight': 1.2.3
+ '@lezer/lr': 1.4.8
+ '@lezer/yaml': 1.0.4
+ '@codemirror/[email protected]':
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-annotate-as-pure': 7.27.3
- '@babel/helper-create-class-features-plugin': 7.28.6(@babel/[email protected]([email protected]))([email protected])
- '@babel/helper-plugin-utils': 7.28.6
- '@babel/helper-skip-transparent-expression-wrappers': 7.27.1([email protected])
- '@babel/plugin-syntax-typescript': 7.28.6(@babel/[email protected]([email protected]))
- transitivePeerDependencies:
- - supports-color
+ '@codemirror/state': 6.5.4
+ '@codemirror/view': 6.39.17
+ '@lezer/common': 1.5.1
+ '@lezer/highlight': 1.2.3
+ '@lezer/lr': 1.4.8
+ style-mod: 4.1.3
+ '@codemirror/[email protected]':
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-annotate-as-pure': 7.29.7
- '@babel/helper-create-class-features-plugin': 7.29.7(@babel/[email protected]([email protected]))([email protected])
- '@babel/helper-plugin-utils': 7.29.7
- '@babel/helper-skip-transparent-expression-wrappers': 7.29.7([email protected])
- '@babel/plugin-syntax-typescript': 7.29.7(@babel/[email protected]([email protected]))
- transitivePeerDependencies:
- - supports-color
+ '@codemirror/state': 6.5.4
+ '@codemirror/view': 6.39.17
+ crelt: 1.0.6
+ '@codemirror/[email protected]':
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-create-regexp-features-plugin': 7.28.5(@babel/[email protected]([email protected]))
- '@babel/helper-plugin-utils': 7.28.6
+ '@codemirror/state': 6.5.4
+ '@codemirror/view': 6.39.17
+ crelt: 1.0.6
+ '@codemirror/[email protected]':
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-create-regexp-features-plugin': 7.29.7(@babel/[email protected]([email protected]))
- '@babel/helper-plugin-utils': 7.29.7
+ '@marijn/find-cluster-break': 1.0.2
+ '@codemirror/[email protected]':
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-plugin-utils': 7.28.6
- '@babel/helper-validator-option': 7.27.1
- '@babel/plugin-syntax-jsx': 7.28.6(@babel/[email protected]([email protected]))
- '@babel/plugin-transform-modules-commonjs': 7.28.6(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-typescript': 7.28.6(@babel/[email protected]([email protected]))([email protected])
- transitivePeerDependencies:
- - supports-color
-
- '@babel/[email protected]': {}
-
- '@babel/[email protected]': {}
+ '@codemirror/state': 6.5.4
+ crelt: 1.0.6
+ style-mod: 4.1.3
+ w3c-keyname: 2.2.8
- '@babel/[email protected]': {}
+ '@csstools/[email protected]': {}
- '@babel/[email protected]':
+ '@csstools/[email protected](@csstools/[email protected](@csstools/[email protected]))(@csstools/[email protected])':
dependencies:
- '@babel/code-frame': 7.29.0
- '@babel/parser': 7.29.7
- '@babel/types': 7.29.7
+ '@csstools/css-parser-algorithms': 3.0.5(@csstools/[email protected])
+ '@csstools/css-tokenizer': 3.0.4
- '@babel/[email protected]':
+ '@csstools/[email protected](@csstools/[email protected](@csstools/[email protected]))(@csstools/[email protected])':
dependencies:
- '@babel/code-frame': 7.29.7
- '@babel/parser': 7.29.7
- '@babel/types': 7.29.7
+ '@csstools/color-helpers': 5.1.0
+ '@csstools/css-calc': 2.1.4(@csstools/[email protected](@csstools/[email protected]))(@csstools/[email protected])
+ '@csstools/css-parser-algorithms': 3.0.5(@csstools/[email protected])
+ '@csstools/css-tokenizer': 3.0.4
+ '@csstools/[email protected](@csstools/[email protected])':
dependencies:
- '@babel/code-frame': 7.29.0
- '@babel/generator': 7.29.1
- '@babel/helper-globals': 7.28.0
- '@babel/parser': 7.29.0
- '@babel/template': 7.28.6
- '@babel/types': 7.29.7
- debug: 4.4.3([email protected])
- transitivePeerDependencies:
- - supports-color
+ '@csstools/css-tokenizer': 3.0.4
+
+ '@csstools/[email protected]': {}
+ '@dnd-kit/[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([email protected])
- transitivePeerDependencies:
- - supports-color
+ '@dnd-kit/geometry': 0.1.21
+ '@dnd-kit/state': 0.1.21
+ tslib: 2.8.1
- '@babel/[email protected]':
+ '@dnd-kit/[email protected]':
dependencies:
- '@babel/helper-string-parser': 7.27.1
- '@babel/helper-validator-identifier': 7.28.5
+ '@dnd-kit/abstract': 0.1.21
+ '@dnd-kit/geometry': 0.1.21
+ tslib: 2.8.1
- '@babel/[email protected]':
+ '@dnd-kit/[email protected]':
dependencies:
- '@babel/helper-string-parser': 7.29.7
- '@babel/helper-validator-identifier': 7.29.7
+ '@dnd-kit/abstract': 0.1.21
+ '@dnd-kit/collision': 0.1.21
+ '@dnd-kit/geometry': 0.1.21
+ '@dnd-kit/state': 0.1.21
+ tslib: 2.8.1
+ '@dnd-kit/[email protected]':
dependencies:
- '@babel/runtime': 7.29.2
- '@floating-ui/react-dom': 2.1.8([email protected]([email protected]))([email protected])
- '@floating-ui/utils': 0.2.11
- react: 19.2.6
- react-dom: 19.2.6([email protected])
- tabbable: 6.4.0
- use-sync-external-store: 1.6.0([email protected])
- optionalDependencies:
- '@types/react': 19.2.17
+ '@dnd-kit/state': 0.1.21
+ tslib: 2.8.1
dependencies:
- '@babel/runtime': 7.29.7
- '@floating-ui/utils': 0.2.11
+ '@dnd-kit/abstract': 0.1.21
+ '@dnd-kit/dom': 0.1.21
+ '@dnd-kit/state': 0.1.21
react: 19.2.6
react-dom: 19.2.6([email protected])
- reselect: 5.1.1
- use-sync-external-store: 1.6.0([email protected])
- optionalDependencies:
- '@types/react': 19.2.17
-
- '@bcoe/[email protected]': {}
-
- '@bcoe/[email protected]': {}
-
- '@biomejs/[email protected]':
- optionalDependencies:
- '@biomejs/cli-darwin-arm64': 2.2.4
- '@biomejs/cli-darwin-x64': 2.2.4
- '@biomejs/cli-linux-arm64': 2.2.4
- '@biomejs/cli-linux-arm64-musl': 2.2.4
- '@biomejs/cli-linux-x64': 2.2.4
- '@biomejs/cli-linux-x64-musl': 2.2.4
- '@biomejs/cli-win32-arm64': 2.2.4
- '@biomejs/cli-win32-x64': 2.2.4
-
- '@biomejs/[email protected]':
- optional: true
-
- '@biomejs/[email protected]':
- optional: true
-
- '@biomejs/[email protected]':
- optional: true
-
- '@biomejs/[email protected]':
- optional: true
-
- '@biomejs/[email protected]':
- optional: true
-
- '@biomejs/[email protected]':
- optional: true
-
- '@biomejs/[email protected]':
- optional: true
-
- '@biomejs/[email protected]':
- optional: true
-
- '@borewit/[email protected]': {}
-
- '@braintree/[email protected]': {}
-
- '@chevrotain/[email protected]': {}
+ tslib: 2.8.1
- '@codemirror/[email protected]':
+ '@dnd-kit/[email protected]':
dependencies:
- '@codemirror/language': 6.12.2
- '@codemirror/state': 6.5.4
- '@codemirror/view': 6.39.17
- '@lezer/common': 1.5.1
+ '@preact/signals-core': 1.13.0
+ tslib: 2.8.1
- '@codemirror/[email protected]':
- dependencies:
- '@codemirror/lang-html': 6.4.11
- '@codemirror/lang-javascript': 6.2.4
- '@codemirror/language': 6.12.2
- '@lezer/common': 1.5.1
- '@lezer/highlight': 1.2.3
- '@lezer/lr': 1.4.8
+ '@drizzle-team/[email protected]': {}
- '@codemirror/[email protected]':
dependencies:
- '@codemirror/language': 6.12.2
- '@lezer/cpp': 1.1.5
+ typebox: 1.3.27
+ transitivePeerDependencies:
+ - '@aws-sdk/credential-provider-node'
+ - '@modelcontextprotocol/sdk'
+ - '@smithy/hash-node'
+ - '@smithy/signature-v4'
+ - bufferutil
+ - kerberos
+ - supports-color
+ - undici
+ - utf-8-validate
+ - ws
+ - zod
- '@codemirror/[email protected]':
dependencies:
- '@codemirror/autocomplete': 6.20.0
- '@codemirror/language': 6.12.2
- '@codemirror/state': 6.5.4
- '@lezer/common': 1.5.1
- '@lezer/css': 1.3.0
+ '@anthropic-ai/sdk': 0.129.0([email protected])
+ '@aws-sdk/client-bedrock-runtime': 3.1127.0
+ '@earendil-works/pi-telemetry': 1.2.0
+ '@google/genai': 2.21.0(@modelcontextprotocol/[email protected]([email protected])([email protected]))([email protected])
+ '@smithy/node-http-handler': 4.12.1
+ http-proxy-agent: 9.1.0([email protected])
+ https-proxy-agent: 9.1.0([email protected])
+ partial-json: 0.1.7
+ typebox: 1.3.27
+ transitivePeerDependencies:
+ - '@aws-sdk/credential-provider-node'
+ - '@modelcontextprotocol/sdk'
+ - '@smithy/hash-node'
+ - '@smithy/signature-v4'
+ - bufferutil
+ - kerberos
+ - supports-color
+ - undici
+ - utf-8-validate
+ - ws
+ - zod
- '@codemirror/[email protected]':
+ '@earendil-works/[email protected]':
dependencies:
- '@codemirror/autocomplete': 6.20.0
- '@codemirror/language': 6.12.2
- '@codemirror/state': 6.5.4
- '@lezer/common': 1.5.1
- '@lezer/go': 1.0.1
+ quickjs-wasi: 3.6.2
- '@codemirror/[email protected]':
dependencies:
- '@codemirror/autocomplete': 6.20.0
- '@codemirror/lang-css': 6.3.1
- '@codemirror/lang-javascript': 6.2.4
- '@codemirror/language': 6.12.2
- '@codemirror/state': 6.5.4
- '@codemirror/view': 6.39.17
- '@lezer/common': 1.5.1
- '@lezer/css': 1.3.0
- '@lezer/html': 1.3.13
+ '@earendil-works/pi-codemode': 1.2.0
+ '@earendil-works/pi-mcp': 1.2.0
+ '@earendil-works/pi-tui': 1.2.0
+ '@silvia-odwyer/photon-node': 0.3.4
+ brace-expansion: 5.0.12
+ chalk: 6.0.0
+ cross-spawn: 7.0.6
+ diff: 8.0.4
+ grok-mermaid: 0.2.3
+ highlight.js: 10.7.3
+ hosted-git-info: 9.0.3
+ ignore: 7.0.8
+ jiti: 2.7.0
+ minimatch: 10.2.6
+ proper-lockfile: 4.1.2
+ quickjs-wasi: 3.6.2
+ semver: 7.8.5
+ typebox: 1.3.27
+ undici: 8.10.2
+ yaml: 2.9.0
+ transitivePeerDependencies:
+ - '@aws-sdk/credential-provider-node'
+ - '@modelcontextprotocol/sdk'
+ - '@smithy/hash-node'
+ - '@smithy/signature-v4'
+ - bufferutil
+ - kerberos
+ - supports-color
+ - utf-8-validate
+ - ws
+ - zod
- '@codemirror/[email protected]':
+ '@earendil-works/[email protected]':
dependencies:
- '@codemirror/language': 6.12.2
- '@lezer/java': 1.1.3
+ cross-spawn: 7.0.6
- '@codemirror/[email protected]':
- dependencies:
- '@codemirror/autocomplete': 6.20.0
- '@codemirror/language': 6.12.2
- '@codemirror/lint': 6.9.3
- '@codemirror/state': 6.5.4
- '@codemirror/view': 6.39.17
- '@lezer/common': 1.5.1
- '@lezer/javascript': 1.5.4
+ '@earendil-works/[email protected]': {}
- '@codemirror/[email protected]':
+ '@earendil-works/[email protected]':
dependencies:
- '@codemirror/lang-html': 6.4.11
- '@codemirror/language': 6.12.2
- '@lezer/common': 1.5.1
- '@lezer/highlight': 1.2.3
- '@lezer/lr': 1.4.8
+ get-east-asian-width: 1.6.0
+ marked: 18.0.11
- '@codemirror/[email protected]':
+ '@electron-internal/[email protected]': {}
+
+ '@electron/[email protected]':
dependencies:
- '@codemirror/language': 6.12.2
- '@lezer/json': 1.0.3
+ commander: 5.1.0
+ glob: 7.2.3
+ minimatch: 3.1.2
- '@codemirror/[email protected]':
+ '@electron/[email protected]':
dependencies:
- '@codemirror/autocomplete': 6.20.0
- '@codemirror/lang-html': 6.4.11
- '@codemirror/language': 6.12.2
- '@codemirror/state': 6.5.4
- '@codemirror/view': 6.39.17
- '@lezer/common': 1.5.1
- '@lezer/highlight': 1.2.3
- '@lezer/lr': 1.4.8
+ chalk: 4.1.2
+ fs-extra: 9.1.0
+ minimist: 1.2.8
- '@codemirror/[email protected]':
dependencies:
- '@codemirror/autocomplete': 6.20.0
- '@codemirror/lang-html': 6.4.11
- '@codemirror/language': 6.12.2
- '@codemirror/state': 6.5.4
- '@codemirror/view': 6.39.17
- '@lezer/common': 1.5.1
- '@lezer/markdown': 1.6.3
+ debug: 4.4.3([email protected])
+ env-paths: 2.2.1
+ fs-extra: 8.1.0
+ got: 11.8.6
+ progress: 2.0.3
+ semver: 6.3.1
+ sumchecker: 3.0.1([email protected])
+ optionalDependencies:
+ global-agent: 3.0.0
+ transitivePeerDependencies:
+ - supports-color
- '@codemirror/[email protected]':
dependencies:
- '@codemirror/lang-html': 6.4.11
- '@codemirror/language': 6.12.2
- '@codemirror/state': 6.5.4
- '@lezer/common': 1.5.1
- '@lezer/php': 1.0.5
+ debug: 4.4.3([email protected])
+ env-paths: 3.0.0
+ graceful-fs: 4.2.11
+ progress: 2.0.3
+ semver: 7.8.5
+ sumchecker: 3.0.1([email protected])
+ optionalDependencies:
+ undici: 7.28.0
+ transitivePeerDependencies:
+ - supports-color
- '@codemirror/[email protected]':
dependencies:
- '@codemirror/autocomplete': 6.20.0
- '@codemirror/language': 6.12.2
- '@codemirror/state': 6.5.4
- '@lezer/common': 1.5.1
- '@lezer/python': 1.1.18
+ debug: 4.4.3([email protected])
+ fs-extra: 9.1.0
+ promise-retry: 2.0.1
+ transitivePeerDependencies:
+ - supports-color
- '@codemirror/[email protected]':
dependencies:
- '@codemirror/language': 6.12.2
- '@lezer/rust': 1.0.2
+ compare-version: 0.1.2
+ debug: 4.4.3([email protected])
+ fs-extra: 10.1.0
+ isbinaryfile: 4.0.10
+ minimist: 1.2.8
+ plist: 3.1.0
+ transitivePeerDependencies:
+ - supports-color
- '@codemirror/[email protected]':
dependencies:
- '@codemirror/lang-css': 6.3.1
- '@codemirror/language': 6.12.2
- '@codemirror/state': 6.5.4
- '@lezer/common': 1.5.1
- '@lezer/sass': 1.1.0
+ '@malept/cross-spawn-promise': 2.0.0
+ debug: 4.4.3([email protected])
+ node-abi: 3.92.0
+ node-api-version: 0.2.1
+ node-gyp: 12.4.0
+ read-binary-file-arch: 1.0.6([email protected])
+ transitivePeerDependencies:
+ - supports-color
- '@codemirror/[email protected]':
dependencies:
- '@codemirror/autocomplete': 6.20.0
- '@codemirror/language': 6.12.2
- '@codemirror/state': 6.5.4
- '@lezer/common': 1.5.1
- '@lezer/highlight': 1.2.3
- '@lezer/lr': 1.4.8
+ '@electron/asar': 3.4.1
+ '@malept/cross-spawn-promise': 2.0.0
+ debug: 4.4.3([email protected])
+ dir-compare: 4.2.0
+ fs-extra: 11.3.3
+ minimatch: 9.0.5
+ plist: 3.1.0
+ transitivePeerDependencies:
+ - supports-color
- '@codemirror/[email protected]':
dependencies:
- '@codemirror/lang-html': 6.4.11
- '@codemirror/lang-javascript': 6.2.4
- '@codemirror/language': 6.12.2
- '@lezer/common': 1.5.1
- '@lezer/highlight': 1.2.3
- '@lezer/lr': 1.4.8
+ cross-dirname: 0.1.0
+ debug: 4.4.3([email protected])
+ fs-extra: 11.4.0
+ minimist: 1.2.8
+ postject: 1.0.0-alpha.6
+ transitivePeerDependencies:
+ - supports-color
+ optional: true
- '@codemirror/[email protected]':
+ '@emnapi/[email protected]':
dependencies:
- '@codemirror/language': 6.12.2
- '@lezer/common': 1.5.1
- '@lezer/highlight': 1.2.3
- '@lezer/lr': 1.4.8
+ '@emnapi/wasi-threads': 1.2.1
+ tslib: 2.8.1
+ optional: true
- '@codemirror/[email protected]':
+ '@emnapi/[email protected]':
dependencies:
- '@codemirror/autocomplete': 6.20.0
- '@codemirror/language': 6.12.2
- '@codemirror/state': 6.5.4
- '@codemirror/view': 6.39.17
- '@lezer/common': 1.5.1
- '@lezer/xml': 1.0.6
+ '@emnapi/wasi-threads': 1.2.2
+ tslib: 2.8.1
+ optional: true
- '@codemirror/[email protected]':
+ '@emnapi/[email protected]':
dependencies:
- '@codemirror/autocomplete': 6.20.0
- '@codemirror/language': 6.12.2
- '@codemirror/state': 6.5.4
- '@lezer/common': 1.5.1
- '@lezer/highlight': 1.2.3
- '@lezer/lr': 1.4.8
- '@lezer/yaml': 1.0.4
-
- '@codemirror/[email protected]':
- dependencies:
- '@codemirror/state': 6.5.4
- '@codemirror/view': 6.39.17
- '@lezer/common': 1.5.1
- '@lezer/highlight': 1.2.3
- '@lezer/lr': 1.4.8
- style-mod: 4.1.3
-
- '@codemirror/[email protected]':
- dependencies:
- '@codemirror/state': 6.5.4
- '@codemirror/view': 6.39.17
- crelt: 1.0.6
-
- '@codemirror/[email protected]':
- dependencies:
- '@codemirror/state': 6.5.4
- '@codemirror/view': 6.39.17
- crelt: 1.0.6
-
- '@codemirror/[email protected]':
- dependencies:
- '@marijn/find-cluster-break': 1.0.2
-
- '@codemirror/[email protected]':
- dependencies:
- '@codemirror/state': 6.5.4
- crelt: 1.0.6
- style-mod: 4.1.3
- w3c-keyname: 2.2.8
-
- '@csstools/[email protected]': {}
-
- '@csstools/[email protected](@csstools/[email protected](@csstools/[email protected]))(@csstools/[email protected])':
- dependencies:
- '@csstools/css-parser-algorithms': 3.0.5(@csstools/[email protected])
- '@csstools/css-tokenizer': 3.0.4
+ '@emnapi/wasi-threads': 1.1.0
+ tslib: 2.8.1
+ optional: true
- '@csstools/[email protected](@csstools/[email protected](@csstools/[email protected]))(@csstools/[email protected])':
+ '@emnapi/[email protected]':
dependencies:
- '@csstools/color-helpers': 5.1.0
- '@csstools/css-calc': 2.1.4(@csstools/[email protected](@csstools/[email protected]))(@csstools/[email protected])
- '@csstools/css-parser-algorithms': 3.0.5(@csstools/[email protected])
- '@csstools/css-tokenizer': 3.0.4
+ '@emnapi/wasi-threads': 1.2.1
+ tslib: 2.8.1
+ optional: true
- '@csstools/[email protected](@csstools/[email protected])':
+ '@emnapi/[email protected]':
dependencies:
- '@csstools/css-tokenizer': 3.0.4
-
- '@csstools/[email protected]': {}
+ tslib: 2.8.1
+ optional: true
- '@dnd-kit/[email protected]':
+ '@emnapi/[email protected]':
dependencies:
- '@dnd-kit/geometry': 0.1.21
- '@dnd-kit/state': 0.1.21
tslib: 2.8.1
+ optional: true
- '@dnd-kit/[email protected]':
+ '@emnapi/[email protected]':
dependencies:
- '@dnd-kit/abstract': 0.1.21
- '@dnd-kit/geometry': 0.1.21
tslib: 2.8.1
+ optional: true
- '@dnd-kit/[email protected]':
+ '@emnapi/[email protected]':
dependencies:
- '@dnd-kit/abstract': 0.1.21
- '@dnd-kit/collision': 0.1.21
- '@dnd-kit/geometry': 0.1.21
- '@dnd-kit/state': 0.1.21
tslib: 2.8.1
+ optional: true
- '@dnd-kit/[email protected]':
+ '@emnapi/[email protected]':
dependencies:
- '@dnd-kit/state': 0.1.21
tslib: 2.8.1
+ optional: true
+ '@emnapi/[email protected]':
dependencies:
- '@dnd-kit/abstract': 0.1.21
- '@dnd-kit/dom': 0.1.21
- '@dnd-kit/state': 0.1.21
- react: 19.2.6
- react-dom: 19.2.6([email protected])
tslib: 2.8.1
+ optional: true
- '@dnd-kit/[email protected]':
+ '@emnapi/[email protected]':
dependencies:
- '@preact/signals-core': 1.13.0
tslib: 2.8.1
+ optional: true
- '@drizzle-team/[email protected]': {}
-
+ '@esbuild-kit/[email protected]':
dependencies:
- typebox: 1.3.27
- transitivePeerDependencies:
- - '@aws-sdk/credential-provider-node'
- - '@modelcontextprotocol/sdk'
- - '@smithy/hash-node'
- - '@smithy/signature-v4'
- - bufferutil
- - kerberos
- - supports-color
- - undici
- - utf-8-validate
- - ws
- - zod
+ esbuild: 0.18.20
+ source-map-support: 0.5.21
+ '@esbuild-kit/[email protected]':
dependencies:
- '@anthropic-ai/sdk': 0.129.0([email protected])
- '@aws-sdk/client-bedrock-runtime': 3.1127.0
- '@earendil-works/pi-telemetry': 1.2.0
- '@google/genai': 2.21.0(@modelcontextprotocol/[email protected]([email protected])([email protected]))([email protected])
- '@smithy/node-http-handler': 4.12.1
- http-proxy-agent: 9.1.0([email protected])
- https-proxy-agent: 9.1.0([email protected])
- partial-json: 0.1.7
- typebox: 1.3.27
- transitivePeerDependencies:
- - '@aws-sdk/credential-provider-node'
- - '@modelcontextprotocol/sdk'
- - '@smithy/hash-node'
- - '@smithy/signature-v4'
- - bufferutil
- - kerberos
- - supports-color
- - undici
- - utf-8-validate
- - ws
- - zod
+ '@esbuild-kit/core-utils': 3.3.2
+ get-tsconfig: 4.13.1
- '@earendil-works/[email protected]':
- dependencies:
- quickjs-wasi: 3.6.2
+ '@esbuild/[email protected]':
+ optional: true
- dependencies:
- '@earendil-works/pi-codemode': 1.2.0
- '@earendil-works/pi-mcp': 1.2.0
- '@earendil-works/pi-tui': 1.2.0
- '@silvia-odwyer/photon-node': 0.3.4
- brace-expansion: 5.0.12
- chalk: 6.0.0
- cross-spawn: 7.0.6
- diff: 8.0.4
- grok-mermaid: 0.2.3
- highlight.js: 10.7.3
- hosted-git-info: 9.0.3
- ignore: 7.0.8
- jiti: 2.7.0
- minimatch: 10.2.6
- proper-lockfile: 4.1.2
- quickjs-wasi: 3.6.2
- semver: 7.8.5
- typebox: 1.3.27
- undici: 8.10.2
- yaml: 2.9.0
- transitivePeerDependencies:
- - '@aws-sdk/credential-provider-node'
- - '@modelcontextprotocol/sdk'
- - '@smithy/hash-node'
- - '@smithy/signature-v4'
- - bufferutil
- - kerberos
- - supports-color
- - utf-8-validate
- - ws
- - zod
+ '@esbuild/[email protected]':
+ optional: true
- '@earendil-works/[email protected]':
- dependencies:
- cross-spawn: 7.0.6
+ '@esbuild/[email protected]':
+ optional: true
- '@earendil-works/[email protected]': {}
+ '@esbuild/[email protected]':
+ optional: true
- '@earendil-works/[email protected]':
- dependencies:
- get-east-asian-width: 1.6.0
- marked: 18.0.11
+ '@esbuild/[email protected]':
+ optional: true
- dependencies:
- '@types/hammerjs': 2.0.46
+ '@esbuild/[email protected]':
+ optional: true
- '@electron-internal/[email protected]': {}
+ '@esbuild/[email protected]':
+ optional: true
- '@electron/[email protected]':
- dependencies:
- commander: 5.1.0
- glob: 7.2.3
- minimatch: 3.1.2
+ '@esbuild/[email protected]':
+ optional: true
- '@electron/[email protected]':
- dependencies:
- chalk: 4.1.2
- fs-extra: 9.1.0
- minimist: 1.2.8
+ '@esbuild/[email protected]':
+ optional: true
- dependencies:
- debug: 4.4.3([email protected])
- env-paths: 2.2.1
- fs-extra: 8.1.0
- got: 11.8.6
- progress: 2.0.3
- semver: 6.3.1
- sumchecker: 3.0.1([email protected])
- optionalDependencies:
- global-agent: 3.0.0
- transitivePeerDependencies:
- - supports-color
+ '@esbuild/[email protected]':
+ optional: true
- dependencies:
- debug: 4.4.3([email protected])
- env-paths: 3.0.0
- graceful-fs: 4.2.11
- progress: 2.0.3
- semver: 7.8.5
- sumchecker: 3.0.1([email protected])
- optionalDependencies:
- undici: 7.28.0
- transitivePeerDependencies:
- - supports-color
+ '@esbuild/[email protected]':
+ optional: true
- dependencies:
- debug: 4.4.3([email protected])
- fs-extra: 9.1.0
- promise-retry: 2.0.1
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- compare-version: 0.1.2
- debug: 4.4.3([email protected])
- fs-extra: 10.1.0
- isbinaryfile: 4.0.10
- minimist: 1.2.8
- plist: 3.1.0
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- '@malept/cross-spawn-promise': 2.0.0
- debug: 4.4.3([email protected])
- node-abi: 3.92.0
- node-api-version: 0.2.1
- node-gyp: 12.4.0
- read-binary-file-arch: 1.0.6([email protected])
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- '@electron/asar': 3.4.1
- '@malept/cross-spawn-promise': 2.0.0
- debug: 4.4.3([email protected])
- dir-compare: 4.2.0
- fs-extra: 11.3.3
- minimatch: 9.0.5
- plist: 3.1.0
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- cross-dirname: 0.1.0
- debug: 4.4.3([email protected])
- fs-extra: 11.4.0
- minimist: 1.2.8
- postject: 1.0.0-alpha.6
- transitivePeerDependencies:
- - supports-color
- optional: true
-
- '@emnapi/[email protected]':
- dependencies:
- '@emnapi/wasi-threads': 1.2.1
- tslib: 2.8.1
- optional: true
-
- '@emnapi/[email protected]':
- dependencies:
- '@emnapi/wasi-threads': 1.2.2
- tslib: 2.8.1
- optional: true
-
- '@emnapi/[email protected]':
- dependencies:
- '@emnapi/wasi-threads': 1.1.0
- tslib: 2.8.1
- optional: true
-
- '@emnapi/[email protected]':
- dependencies:
- '@emnapi/wasi-threads': 1.2.1
- tslib: 2.8.1
- optional: true
-
- '@emnapi/[email protected]':
- dependencies:
- tslib: 2.8.1
- optional: true
-
- '@emnapi/[email protected]':
- dependencies:
- tslib: 2.8.1
- optional: true
-
- '@emnapi/[email protected]':
- dependencies:
- tslib: 2.8.1
- optional: true
-
- '@emnapi/[email protected]':
- dependencies:
- tslib: 2.8.1
- optional: true
-
- '@emnapi/[email protected]':
- dependencies:
- tslib: 2.8.1
- optional: true
-
- '@emnapi/[email protected]':
- dependencies:
- tslib: 2.8.1
- optional: true
-
- '@emnapi/[email protected]':
- dependencies:
- tslib: 2.8.1
- optional: true
-
- '@esbuild-kit/[email protected]':
- dependencies:
- esbuild: 0.18.20
- source-map-support: 0.5.21
-
- '@esbuild-kit/[email protected]':
- dependencies:
- '@esbuild-kit/core-utils': 3.3.2
- get-tsconfig: 4.13.1
-
- '@esbuild/[email protected]':
- optional: true
-
- '@esbuild/[email protected]':
- optional: true
-
- '@esbuild/[email protected]':
- optional: true
-
- '@esbuild/[email protected]':
- optional: true
-
- '@esbuild/[email protected]':
- optional: true
-
- '@esbuild/[email protected]':
- optional: true
-
- '@esbuild/[email protected]':
- optional: true
-
- '@esbuild/[email protected]':
- optional: true
-
- '@esbuild/[email protected]':
- optional: true
-
- '@esbuild/[email protected]':
- optional: true
-
- '@esbuild/[email protected]':
- optional: true
-
- '@esbuild/[email protected]':
- optional: true
+ '@esbuild/[email protected]':
+ optional: true
'@esbuild/[email protected]':
optional: true
@@ -18501,1444 +14392,711 @@ snapshots:
'@eslint/core': 1.2.1
levn: 0.4.1
- '@expo-google-fonts/[email protected]': {}
-
- dependencies:
- '@expo/code-signing-certificates': 0.0.6
- '@expo/config': 57.0.6([email protected])([email protected])
- '@expo/config-plugins': 57.0.6([email protected])([email protected])
- '@expo/devcert': 1.2.1([email protected])
- '@expo/env': 2.4.2([email protected])
- '@expo/image-utils': 0.11.4([email protected])([email protected])
- '@expo/inline-modules': 0.1.3([email protected])([email protected])
- '@expo/json-file': 11.0.1
- '@expo/metro': 56.0.0([email protected])
- '@expo/metro-config': 57.0.7([email protected])([email protected])([email protected])
- '@expo/metro-file-map': 57.0.1([email protected])
- '@expo/osascript': 2.7.1
- '@expo/package-manager': 1.13.1
- '@expo/plist': 0.8.1
- '@expo/prebuild-config': 57.0.9([email protected])([email protected])
- '@expo/require-utils': 57.0.4([email protected])([email protected])
- '@expo/schema-utils': 57.0.2
- '@expo/spawn-async': 1.8.0
- '@expo/ws-tunnel': 2.0.0([email protected])
- '@expo/xcpretty': 4.4.4
- '@react-native/dev-middleware': 0.86.0([email protected])
- accepts: 1.3.8
- agent-cli-detector: 0.1.4
- arg: 5.0.2
- bplist-creator: 0.1.0
- bplist-parser: 0.3.2
- chalk: 4.1.2
- ci-info: 3.9.0
- compression: 1.8.1([email protected])
- connect: 3.7.0([email protected])
- debug: 4.4.3([email protected])
- dnssd-advertise: 1.1.6
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- expo-server: 57.0.1
- fetch-nodeshim: 0.4.10
- getenv: 2.0.0
- glob: 13.0.6
- lan-network: 0.2.1
- multitars: 1.0.0
- node-forge: 1.4.0
- npm-package-arg: 11.0.3
- ora: 3.4.0
- picomatch: 4.0.5
- pretty-format: 29.7.0
- progress: 2.0.3
- prompts: 2.4.2
- resolve-from: 5.0.0
- semver: 7.8.4
- send: 0.19.2([email protected])
- slugify: 1.6.6
- stacktrace-parser: 0.1.11
- structured-headers: 0.4.1
- terminal-link: 2.1.1
- toqr: 0.1.1
- wrap-ansi: 7.0.0
- ws: 8.21.0
- zod: 3.25.76
- optionalDependencies:
- expo-router: 57.0.8(aeaf345642587960b4671195b62009d3)
- transitivePeerDependencies:
- - '@expo/dom-webview'
- - '@expo/metro-runtime'
- - bufferutil
- - expo-constants
- - expo-font
- - react
- - react-dom
- - react-server-dom-webpack
- - supports-color
- - typescript
- - utf-8-validate
-
- dependencies:
- '@expo/code-signing-certificates': 0.0.6
- '@expo/config': 57.0.9([email protected])([email protected])
- '@expo/config-plugins': 57.0.9([email protected])([email protected])
- '@expo/devcert': 1.2.1([email protected])
- '@expo/env': 2.4.3([email protected])
- '@expo/image-utils': 0.11.5([email protected])([email protected])
- '@expo/inline-modules': 0.1.7([email protected])([email protected])
- '@expo/json-file': 11.0.1
- '@expo/metro': 56.0.2([email protected])
- '@expo/metro-config': 57.0.12([email protected])([email protected])([email protected])
- '@expo/metro-file-map': 57.0.3([email protected])
- '@expo/osascript': 2.7.1
- '@expo/package-manager': 1.13.1
- '@expo/plist': 0.8.1
- '@expo/prebuild-config': 57.0.16([email protected])([email protected])
- '@expo/require-utils': 57.0.5([email protected])([email protected])
- '@expo/schema-utils': 57.0.2
- '@expo/spawn-async': 1.8.0
- '@expo/ws-tunnel': 2.0.0([email protected])
- '@expo/xcpretty': 4.4.4
- '@react-native/dev-middleware': 0.86.3([email protected])
- accepts: 1.3.8
- agent-cli-detector: 0.1.7
- arg: 5.0.2
- bplist-creator: 0.1.0
- bplist-parser: 0.3.2
- chalk: 4.1.2
- ci-info: 3.9.0
- compression: 1.8.1([email protected])
- connect: 3.7.0([email protected])
- debug: 4.4.3([email protected])
- dnssd-advertise: 1.1.6
- expo: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
- expo-server: 57.0.3
- fetch-nodeshim: 0.4.10
- getenv: 2.0.0
- glob: 13.0.6
- lan-network: 0.2.1
- multitars: 1.0.2
- node-forge: 1.4.0
- npm-package-arg: 11.0.3
- ora: 3.4.0
- picomatch: 4.0.5
- pretty-format: 29.7.0
- progress: 2.0.3
- prompts: 2.4.2
- resolve-from: 5.0.0
- sandbox-cli-detector: 0.2.0
- semver: 7.8.4
- send: 0.19.2([email protected])
- slugify: 1.6.6
- stacktrace-parser: 0.1.11
- structured-headers: 0.4.1
- terminal-link: 2.1.1
- toqr: 0.1.1
- wrap-ansi: 7.0.0
- ws: 8.21.0
- zod: 3.25.76
- optionalDependencies:
- expo-router: 57.0.23(691084568689e210f8e7fee390d1f6f1)
- transitivePeerDependencies:
- - '@expo/dom-webview'
- - '@expo/metro-runtime'
- - bufferutil
- - expo-constants
- - expo-font
- - react
- - react-dom
- - react-server-dom-webpack
- - supports-color
- - typescript
- - utf-8-validate
-
- dependencies:
- node-forge: 1.4.0
-
- dependencies:
- '@expo/config-types': 57.0.2
- '@expo/json-file': 11.0.1
- '@expo/plist': 0.8.1
- '@expo/require-utils': 57.0.4([email protected])([email protected])
- '@expo/sdk-runtime-versions': 1.0.0
- chalk: 4.1.2
- debug: 4.4.3([email protected])
- getenv: 2.0.0
- glob: 13.0.6
- semver: 7.8.4
- slugify: 1.6.6
- xcode: 3.0.1
- xml2js: 0.6.0
- transitivePeerDependencies:
- - supports-color
- - typescript
-
+ '@floating-ui/[email protected]':
dependencies:
- '@expo/config-types': 57.0.2
- '@expo/json-file': 11.0.1
- '@expo/plist': 0.8.1
- '@expo/require-utils': 57.0.5([email protected])([email protected])
- '@expo/sdk-runtime-versions': 1.0.0
- chalk: 4.1.2
- debug: 4.4.3([email protected])
- getenv: 2.0.0
- glob: 13.0.6
- semver: 7.8.4
- slugify: 1.6.6
- xcode: 3.0.1
- xml2js: 0.6.0
- transitivePeerDependencies:
- - supports-color
- - typescript
-
- '@expo/[email protected]': {}
+ '@floating-ui/utils': 0.2.11
+ optional: true
+ '@floating-ui/[email protected]':
dependencies:
- '@expo/config-plugins': 57.0.6([email protected])([email protected])
- '@expo/config-types': 57.0.2
- '@expo/json-file': 11.0.1
- '@expo/require-utils': 57.0.4([email protected])([email protected])
- deepmerge: 4.3.1
- getenv: 2.0.0
- glob: 13.0.6
- resolve-workspace-root: 2.0.1
- semver: 7.8.4
- slugify: 1.6.6
- transitivePeerDependencies:
- - supports-color
- - typescript
+ '@floating-ui/utils': 0.2.11
+ '@floating-ui/[email protected]':
dependencies:
- '@expo/config-plugins': 57.0.9([email protected])([email protected])
- '@expo/config-types': 57.0.2
- '@expo/json-file': 11.0.1
- '@expo/require-utils': 57.0.5([email protected])([email protected])
- deepmerge: 4.3.1
- getenv: 2.0.0
- glob: 13.0.6
- resolve-workspace-root: 2.0.1
- semver: 7.8.4
- slugify: 1.6.6
- transitivePeerDependencies:
- - supports-color
- - typescript
+ '@floating-ui/core': 1.7.4
+ '@floating-ui/utils': 0.2.11
+ optional: true
+ '@floating-ui/[email protected]':
dependencies:
- '@expo/sudo-prompt': 9.3.2
- debug: 3.2.7([email protected])
- transitivePeerDependencies:
- - supports-color
+ '@floating-ui/core': 1.7.5
+ '@floating-ui/utils': 0.2.11
dependencies:
- chalk: 4.1.2
- optionalDependencies:
+ '@floating-ui/dom': 1.7.6
react: 19.2.6
+ react-dom: 19.2.6([email protected])
dependencies:
- expo: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
+ '@floating-ui/react-dom': 2.1.8([email protected]([email protected]))([email protected])
+ '@floating-ui/utils': 0.2.11
react: 19.2.6
+ react-dom: 19.2.6([email protected])
+ tabbable: 6.4.0
- dependencies:
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- react: 19.2.6
+ '@floating-ui/[email protected]': {}
dependencies:
- chalk: 4.1.2
- debug: 4.4.3([email protected])
- getenv: 2.0.0
+ google-auth-library: 10.9.0([email protected])
+ p-retry: 4.6.2
+ protobufjs: 7.6.5
+ ws: 8.21.0
+ optionalDependencies:
+ '@modelcontextprotocol/sdk': 1.29.0([email protected])([email protected])
transitivePeerDependencies:
+ - bufferutil
- supports-color
+ - utf-8-validate
- dependencies:
- chalk: 4.1.2
- debug: 4.4.3([email protected])
- getenv: 2.0.0
- transitivePeerDependencies:
- - supports-color
-
- '@expo/[email protected]': {}
+ '@hapi/[email protected]': {}
dependencies:
- '@expo/env': 2.4.3([email protected])
- '@expo/spawn-async': 1.8.0
- arg: 5.0.2
- chalk: 4.1.2
- debug: 4.4.3([email protected])
- getenv: 2.0.0
- glob: 13.0.6
- ignore: 5.3.2
- minimatch: 10.2.5
- resolve-from: 5.0.0
- semver: 7.8.4
- transitivePeerDependencies:
- - supports-color
+ '@hapi/hoek': 9.3.0
dependencies:
- '@expo/env': 2.4.2([email protected])
- '@expo/spawn-async': 1.8.0
- arg: 5.0.2
- chalk: 4.1.2
- debug: 4.4.3([email protected])
- getenv: 2.0.0
- glob: 13.0.6
- ignore: 5.3.2
- minimatch: 10.2.5
- resolve-from: 5.0.0
- semver: 7.8.4
- transitivePeerDependencies:
- - supports-color
+ hono: 4.12.28
dependencies:
- '@expo/require-utils': 57.0.4([email protected])([email protected])
- '@expo/spawn-async': 1.8.0
- chalk: 4.1.2
- getenv: 2.0.0
- jimp-compact: 0.16.1
- parse-png: 2.1.0
- semver: 7.8.4
- transitivePeerDependencies:
- - supports-color
- - typescript
+ '@trpc/server': 11.17.0([email protected])
+ hono: 4.12.28
+ '@humanfs/[email protected]':
dependencies:
- '@expo/require-utils': 57.0.5([email protected])([email protected])
- '@expo/spawn-async': 1.8.0
- chalk: 4.1.2
- getenv: 2.0.0
- jimp-compact: 0.16.1
- parse-png: 2.1.0
- semver: 7.8.4
- transitivePeerDependencies:
- - supports-color
- - typescript
+ '@humanfs/types': 0.15.0
+ '@humanfs/[email protected]':
dependencies:
- '@expo/config-plugins': 57.0.6([email protected])([email protected])
- transitivePeerDependencies:
- - supports-color
- - typescript
+ '@humanfs/core': 0.19.2
+ '@humanfs/types': 0.15.0
+ '@humanwhocodes/retry': 0.4.3
- dependencies:
- '@expo/config-plugins': 57.0.9([email protected])([email protected])
- transitivePeerDependencies:
- - supports-color
- - typescript
+ '@humanfs/[email protected]': {}
- dependencies:
- '@babel/code-frame': 7.29.7
- json5: 2.2.3
+ '@humanwhocodes/[email protected]': {}
- dependencies:
- '@expo/config': 57.0.6([email protected])([email protected])
- chalk: 4.1.2
- transitivePeerDependencies:
- - supports-color
- - typescript
+ '@humanwhocodes/[email protected]': {}
- dependencies:
- '@expo/config': 57.0.9([email protected])([email protected])
- chalk: 4.1.2
- transitivePeerDependencies:
- - supports-color
- - typescript
+ '@iarna/[email protected]': {}
- dependencies:
- anser: 1.4.10
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- react: 19.2.6
- stacktrace-parser: 0.1.11
+ '@iconify/[email protected]': {}
+ '@iconify/[email protected]':
dependencies:
- anser: 1.4.10
- expo: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
- react: 19.2.6
- stacktrace-parser: 0.1.11
+ '@antfu/install-pkg': 1.1.0
+ '@iconify/types': 2.0.0
+ import-meta-resolve: 4.2.0
- dependencies:
- anser: 1.4.10
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- react: 19.2.6
- stacktrace-parser: 0.1.11
+ '@inquirer/[email protected]':
+ optional: true
+ '@inquirer/[email protected](@types/[email protected])':
dependencies:
- '@babel/code-frame': 7.29.7
- '@babel/core': 7.29.0([email protected])
- '@babel/generator': 7.29.7
- '@expo/config': 57.0.9([email protected])([email protected])
- '@expo/env': 2.4.3([email protected])
- '@expo/json-file': 11.0.1
- '@expo/metro': 56.0.2([email protected])
- '@expo/require-utils': 57.0.5([email protected])([email protected])
- '@expo/spawn-async': 1.8.0
- '@jridgewell/gen-mapping': 0.3.13
- '@jridgewell/remapping': 2.3.5
- '@jridgewell/sourcemap-codec': 1.5.5
- browserslist: 4.28.7
- chalk: 4.1.2
- debug: 4.4.3([email protected])
- getenv: 2.0.0
- glob: 13.0.6
- hermes-parser: 0.36.1
- jsc-safe-url: 0.2.4
- lightningcss: 1.33.0
- picomatch: 4.0.5
- postcss: 8.5.23
- resolve-from: 5.0.0
+ '@inquirer/core': 10.3.2(@types/[email protected])
+ '@inquirer/type': 3.0.10(@types/[email protected])
optionalDependencies:
- expo: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
- transitivePeerDependencies:
- - bufferutil
- - supports-color
- - typescript
- - utf-8-validate
+ '@types/node': 20.19.41
+ optional: true
+ '@inquirer/[email protected](@types/[email protected])':
dependencies:
- '@babel/code-frame': 7.29.0
- '@babel/core': 7.29.0([email protected])
- '@babel/generator': 7.29.1
- '@expo/config': 57.0.6([email protected])([email protected])
- '@expo/env': 2.4.2([email protected])
- '@expo/json-file': 11.0.1
- '@expo/metro': 56.0.0([email protected])
- '@expo/require-utils': 57.0.4([email protected])([email protected])
- '@expo/spawn-async': 1.8.0
- '@jridgewell/gen-mapping': 0.3.13
- '@jridgewell/remapping': 2.3.5
- '@jridgewell/sourcemap-codec': 1.5.5
- browserslist: 4.28.1
- chalk: 4.1.2
- debug: 4.4.3([email protected])
- getenv: 2.0.0
- glob: 13.0.6
- hermes-parser: 0.36.1
- jsc-safe-url: 0.2.4
- lightningcss: 1.32.0
- picomatch: 4.0.5
- postcss: 8.5.15
- resolve-from: 5.0.0
+ '@inquirer/core': 10.3.2(@types/[email protected])
+ '@inquirer/type': 3.0.10(@types/[email protected])
optionalDependencies:
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- transitivePeerDependencies:
- - bufferutil
- - supports-color
- - typescript
- - utf-8-validate
+ '@types/node': 24.12.0
+ optional: true
+ '@inquirer/[email protected](@types/[email protected])':
dependencies:
- debug: 4.4.3([email protected])
- fb-watchman: 2.0.2
- invariant: 2.2.4
- jest-worker: 29.7.0
- micromatch: 4.0.8
- walker: 1.0.8
- transitivePeerDependencies:
- - supports-color
+ '@inquirer/core': 10.3.2(@types/[email protected])
+ '@inquirer/type': 3.0.10(@types/[email protected])
+ optionalDependencies:
+ '@types/node': 25.2.0
+ optional: true
+ '@inquirer/[email protected](@types/[email protected])':
dependencies:
- debug: 4.4.3([email protected])
- fb-watchman: 2.0.2
- invariant: 2.2.4
- jest-worker: 29.7.0
- micromatch: 4.0.8
- walker: 1.0.8
- transitivePeerDependencies:
- - supports-color
+ '@inquirer/ansi': 1.0.2
+ '@inquirer/figures': 1.0.15
+ '@inquirer/type': 3.0.10(@types/[email protected])
+ cli-width: 4.1.0
+ mute-stream: 2.0.0
+ signal-exit: 4.1.0
+ wrap-ansi: 6.2.0
+ yoctocolors-cjs: 2.1.3
+ optionalDependencies:
+ '@types/node': 20.19.41
+ optional: true
+ '@inquirer/[email protected](@types/[email protected])':
dependencies:
- anser: 1.4.10
- expo: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
- pretty-format: 29.7.0
- react: 19.2.6
- stacktrace-parser: 0.1.11
- whatwg-fetch: 3.6.20
+ '@inquirer/ansi': 1.0.2
+ '@inquirer/figures': 1.0.15
+ '@inquirer/type': 3.0.10(@types/[email protected])
+ cli-width: 4.1.0
+ mute-stream: 2.0.0
+ signal-exit: 4.1.0
+ wrap-ansi: 6.2.0
+ yoctocolors-cjs: 2.1.3
optionalDependencies:
- react-dom: 19.2.6([email protected])
+ '@types/node': 24.12.0
+ optional: true
+ '@inquirer/[email protected](@types/[email protected])':
dependencies:
- anser: 1.4.10
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- pretty-format: 29.7.0
- react: 19.2.6
- stacktrace-parser: 0.1.11
- whatwg-fetch: 3.6.20
+ '@inquirer/ansi': 1.0.2
+ '@inquirer/figures': 1.0.15
+ '@inquirer/type': 3.0.10(@types/[email protected])
+ cli-width: 4.1.0
+ mute-stream: 2.0.0
+ signal-exit: 4.1.0
+ wrap-ansi: 6.2.0
+ yoctocolors-cjs: 2.1.3
optionalDependencies:
- react-dom: 19.2.6([email protected])
+ '@types/node': 25.2.0
+ optional: true
- dependencies:
- metro: 0.84.4([email protected])
- metro-babel-transformer: 0.84.4([email protected])
- metro-cache: 0.84.4([email protected])
- metro-cache-key: 0.84.4
- metro-config: 0.84.4([email protected])
- metro-core: 0.84.4
- metro-file-map: 0.84.4([email protected])
- metro-minify-terser: 0.84.4
- metro-resolver: 0.84.4
- metro-runtime: 0.84.4
- metro-source-map: 0.84.4([email protected])
- metro-symbolicate: 0.84.4([email protected])
- metro-transform-plugins: 0.84.4([email protected])
- metro-transform-worker: 0.84.4([email protected])
- transitivePeerDependencies:
- - bufferutil
- - supports-color
- - utf-8-validate
+ '@inquirer/[email protected]':
+ optional: true
- dependencies:
- metro: 0.84.5([email protected])
- metro-babel-transformer: 0.84.5([email protected])
- metro-cache: 0.84.5([email protected])
- metro-cache-key: 0.84.5
- metro-config: 0.84.5([email protected])
- metro-core: 0.84.5
- metro-file-map: 0.84.5([email protected])
- metro-minify-terser: 0.84.5
- metro-resolver: 0.84.5
- metro-runtime: 0.84.5
- metro-source-map: 0.84.5([email protected])
- metro-symbolicate: 0.84.5([email protected])
- metro-transform-plugins: 0.84.5([email protected])
- metro-transform-worker: 0.84.5([email protected])
- transitivePeerDependencies:
- - bufferutil
- - supports-color
- - utf-8-validate
+ '@inquirer/[email protected](@types/[email protected])':
+ optionalDependencies:
+ '@types/node': 20.19.41
+ optional: true
- dependencies:
- '@expo/spawn-async': 1.8.0
+ '@inquirer/[email protected](@types/[email protected])':
+ optionalDependencies:
+ '@types/node': 24.12.0
+ optional: true
- dependencies:
- '@expo/json-file': 11.0.1
- '@expo/spawn-async': 1.8.0
- chalk: 4.1.2
- npm-package-arg: 11.0.3
- ora: 3.4.0
- resolve-workspace-root: 2.0.1
+ '@inquirer/[email protected](@types/[email protected])':
+ optionalDependencies:
+ '@types/node': 25.2.0
+ optional: true
- dependencies:
- '@xmldom/xmldom': 0.8.13
- base64-js: 1.5.1
- xmlbuilder: 15.1.1
+ '@inversifyjs/[email protected]': {}
dependencies:
- '@expo/config': 57.0.9([email protected])([email protected])
- '@expo/config-plugins': 57.0.9([email protected])([email protected])
- '@expo/config-types': 57.0.2
- '@expo/image-utils': 0.11.5([email protected])([email protected])
- '@expo/json-file': 11.0.1
- '@react-native/normalize-colors': 0.86.3
- debug: 4.4.3([email protected])
- expo-modules-autolinking: 57.0.13([email protected])([email protected])
- resolve-from: 5.0.0
- semver: 7.8.5
- transitivePeerDependencies:
- - supports-color
- - typescript
+ '@inversifyjs/common': 1.5.2
+ '@inversifyjs/core': 9.2.0([email protected])
+ '@inversifyjs/plugin': 0.2.0
+ '@inversifyjs/reflect-metadata-utils': 1.4.1([email protected])
+ reflect-metadata: 0.2.2
dependencies:
- '@expo/config': 57.0.6([email protected])([email protected])
- '@expo/config-plugins': 57.0.6([email protected])([email protected])
- '@expo/config-types': 57.0.2
- '@expo/image-utils': 0.11.4([email protected])([email protected])
- '@expo/json-file': 11.0.1
- '@react-native/normalize-colors': 0.86.0
- debug: 4.4.3([email protected])
- expo-modules-autolinking: 57.0.9([email protected])([email protected])
- resolve-from: 5.0.0
- semver: 7.8.5
+ '@inversifyjs/common': 1.5.2
+ '@inversifyjs/prototype-utils': 0.1.3
+ '@inversifyjs/reflect-metadata-utils': 1.4.1([email protected])
transitivePeerDependencies:
- - supports-color
- - typescript
+ - reflect-metadata
+
+ '@inversifyjs/[email protected]': {}
+ '@inversifyjs/[email protected]':
dependencies:
- '@babel/code-frame': 7.29.7
- '@babel/core': 7.29.0([email protected])
- '@babel/plugin-transform-modules-commonjs': 7.28.6(@babel/[email protected]([email protected]))([email protected])
- optionalDependencies:
- typescript: 5.9.3
- transitivePeerDependencies:
- - supports-color
+ '@inversifyjs/common': 1.5.2
dependencies:
- '@babel/code-frame': 7.29.7
- '@babel/core': 7.29.0([email protected])
- '@babel/plugin-transform-modules-commonjs': 7.29.7(@babel/[email protected]([email protected]))([email protected])
- optionalDependencies:
- typescript: 5.9.3
- transitivePeerDependencies:
- - supports-color
+ reflect-metadata: 0.2.2
dependencies:
- debug: 4.4.3([email protected])
- expo: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
- expo-server: 57.0.3
- react: 19.2.6
- optionalDependencies:
- expo-router: 57.0.23(691084568689e210f8e7fee390d1f6f1)
- react-dom: 19.2.6([email protected])
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- debug: 4.4.3([email protected])
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- expo-server: 57.0.1
- react: 19.2.6
- optionalDependencies:
- expo-router: 57.0.8(aeaf345642587960b4671195b62009d3)
- react-dom: 19.2.6([email protected])
- transitivePeerDependencies:
- - supports-color
-
- '@expo/[email protected]': {}
-
- '@expo/[email protected]': {}
+ inversify: 7.11.0([email protected])
+ '@isaacs/[email protected]':
dependencies:
- cross-spawn: 7.0.6
-
- '@expo/[email protected]': {}
+ string-width: 5.1.2
+ string-width-cjs: [email protected]
+ strip-ansi: 7.2.0
+ strip-ansi-cjs: [email protected]
+ wrap-ansi: 8.1.0
+ wrap-ansi-cjs: [email protected]
+ '@isaacs/[email protected]':
dependencies:
- expo: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
- react: 19.2.6
- sf-symbols-typescript: 2.2.0
- optionalDependencies:
- '@babel/core': 7.29.0([email protected])
- react-dom: 19.2.6([email protected])
- transitivePeerDependencies:
- - '@types/react'
- - '@types/react-dom'
+ minipass: 7.1.3
+ '@istanbuljs/[email protected]':
dependencies:
- expo: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
- react: 19.2.6
- sf-symbols-typescript: 2.2.0
- optionalDependencies:
- '@babel/core': 7.29.0([email protected])
- react-dom: 19.2.6([email protected])
- transitivePeerDependencies:
- - '@types/react'
- - '@types/react-dom'
+ camelcase: 5.3.1
+ find-up: 4.1.0
+ get-package-type: 0.1.0
+ js-yaml: 3.14.2
+ resolve-from: 5.0.0
- dependencies:
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- react: 19.2.6
- sf-symbols-typescript: 2.2.0
- optionalDependencies:
- '@babel/core': 7.29.0([email protected])
- react-dom: 19.2.6([email protected])
- transitivePeerDependencies:
- - '@types/react'
- - '@types/react-dom'
+ '@istanbuljs/[email protected]': {}
dependencies:
- ws: 8.21.0
+ '@jest/types': 30.4.1
+ '@types/node': 24.13.3
+ chalk: 4.1.2
+ jest-message-util: 30.4.1
+ jest-util: 30.4.1
+ slash: 3.0.0
dependencies:
- '@babel/code-frame': 7.29.7
+ '@jest/console': 30.4.1
+ '@jest/pattern': 30.4.0
+ '@jest/reporters': 30.4.1([email protected])
+ '@jest/test-result': 30.4.1
+ '@jest/transform': 30.4.1([email protected])
+ '@jest/types': 30.4.1
+ '@types/node': 24.13.3
+ ansi-escapes: 4.3.2
chalk: 4.1.2
- js-yaml: 4.1.1
+ ci-info: 4.4.0
+ exit-x: 0.2.2
+ 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
+ jest-resolve: 30.4.1
+ jest-resolve-dependencies: 30.4.2([email protected])
+ jest-runner: 30.4.2([email protected])
+ jest-runtime: 30.4.2([email protected])
+ jest-snapshot: 30.4.1([email protected])
+ jest-util: 30.4.1
+ jest-validate: 30.4.1
+ jest-watcher: 30.4.1
+ pretty-format: 30.4.1
+ slash: 3.0.0
+ transitivePeerDependencies:
+ - babel-plugin-macros
+ - esbuild-register
+ - supports-color
+ - ts-node
- '@floating-ui/[email protected]':
dependencies:
- '@floating-ui/utils': 0.2.11
- optional: true
+ '@jest/types': 30.4.1
- '@floating-ui/[email protected]':
- dependencies:
- '@floating-ui/utils': 0.2.11
+ '@jest/[email protected]': {}
- '@floating-ui/[email protected]':
dependencies:
- '@floating-ui/core': 1.7.4
- '@floating-ui/utils': 0.2.11
- optional: true
+ '@jest/fake-timers': 30.4.1
+ '@jest/types': 30.4.1
+ '@types/node': 24.13.3
+ jest-mock: 30.4.1
- '@floating-ui/[email protected]':
dependencies:
- '@floating-ui/core': 1.7.5
- '@floating-ui/utils': 0.2.11
+ '@jest/get-type': 30.1.0
dependencies:
- '@floating-ui/dom': 1.7.6
- react: 19.2.6
- react-dom: 19.2.6([email protected])
+ expect: 30.4.1
+ jest-snapshot: 30.4.1([email protected])
+ transitivePeerDependencies:
+ - supports-color
dependencies:
- '@floating-ui/react-dom': 2.1.8([email protected]([email protected]))([email protected])
- '@floating-ui/utils': 0.2.11
- react: 19.2.6
- react-dom: 19.2.6([email protected])
- tabbable: 6.4.0
+ '@jest/types': 30.4.1
+ '@sinonjs/fake-timers': 15.4.0
+ '@types/node': 24.13.3
+ jest-message-util: 30.4.1
+ jest-mock: 30.4.1
+ jest-util: 30.4.1
- '@floating-ui/[email protected]': {}
+ '@jest/[email protected]': {}
dependencies:
- google-auth-library: 10.9.0([email protected])
- p-retry: 4.6.2
- protobufjs: 7.6.5
- ws: 8.21.0
- optionalDependencies:
- '@modelcontextprotocol/sdk': 1.29.0([email protected])([email protected])
+ '@jest/environment': 30.4.1
+ '@jest/expect': 30.4.1([email protected])
+ '@jest/types': 30.4.1
+ jest-mock: 30.4.1
transitivePeerDependencies:
- - bufferutil
- supports-color
- - utf-8-validate
-
- '@hapi/[email protected]': {}
dependencies:
- '@hapi/hoek': 9.3.0
+ '@types/node': 24.13.3
+ jest-regex-util: 30.4.0
dependencies:
- hono: 4.12.28
+ '@bcoe/v8-coverage': 0.2.3
+ '@jest/console': 30.4.1
+ '@jest/test-result': 30.4.1
+ '@jest/transform': 30.4.1([email protected])
+ '@jest/types': 30.4.1
+ '@jridgewell/trace-mapping': 0.3.31
+ '@types/node': 24.13.3
+ chalk: 4.1.2
+ collect-v8-coverage: 1.0.3
+ exit-x: 0.2.2
+ glob: 10.5.0
+ graceful-fs: 4.2.11
+ istanbul-lib-coverage: 3.2.2
+ istanbul-lib-instrument: 6.0.3([email protected])
+ istanbul-lib-report: 3.0.1
+ istanbul-lib-source-maps: 5.0.6([email protected])
+ istanbul-reports: 3.2.0
+ jest-message-util: 30.4.1
+ jest-util: 30.4.1
+ jest-worker: 30.4.1
+ slash: 3.0.0
+ string-length: 4.0.2
+ v8-to-istanbul: 9.3.0
+ transitivePeerDependencies:
+ - supports-color
dependencies:
- '@trpc/server': 11.17.0([email protected])
- hono: 4.12.28
+ '@sinclair/typebox': 0.34.49
- '@humanfs/[email protected]':
dependencies:
- '@humanfs/types': 0.15.0
+ '@jest/types': 30.4.1
+ chalk: 4.1.2
+ graceful-fs: 4.2.11
+ natural-compare: 1.4.0
- '@humanfs/[email protected]':
dependencies:
- '@humanfs/core': 0.19.2
- '@humanfs/types': 0.15.0
- '@humanwhocodes/retry': 0.4.3
-
- '@humanfs/[email protected]': {}
-
- '@humanwhocodes/[email protected]': {}
-
- '@humanwhocodes/[email protected]': {}
-
- '@iarna/[email protected]': {}
-
- '@iconify/[email protected]': {}
+ '@jridgewell/trace-mapping': 0.3.31
+ callsites: 3.1.0
+ graceful-fs: 4.2.11
- '@iconify/[email protected]':
dependencies:
- '@antfu/install-pkg': 1.1.0
- '@iconify/types': 2.0.0
- import-meta-resolve: 4.2.0
-
- '@inquirer/[email protected]':
- optional: true
+ '@jest/console': 30.4.1
+ '@jest/types': 30.4.1
+ '@types/istanbul-lib-coverage': 2.0.6
+ collect-v8-coverage: 1.0.3
- '@inquirer/[email protected](@types/[email protected])':
dependencies:
- '@inquirer/core': 10.3.2(@types/[email protected])
- '@inquirer/type': 3.0.10(@types/[email protected])
- optionalDependencies:
- '@types/node': 20.19.41
- optional: true
+ '@jest/test-result': 30.4.1
+ graceful-fs: 4.2.11
+ jest-haste-map: 30.4.1
+ slash: 3.0.0
- '@inquirer/[email protected](@types/[email protected])':
dependencies:
- '@inquirer/core': 10.3.2(@types/[email protected])
- '@inquirer/type': 3.0.10(@types/[email protected])
- optionalDependencies:
- '@types/node': 24.12.0
- optional: true
+ '@babel/core': 7.29.0([email protected])
+ '@jest/types': 30.4.1
+ '@jridgewell/trace-mapping': 0.3.31
+ babel-plugin-istanbul: 7.0.1([email protected])
+ chalk: 4.1.2
+ convert-source-map: 2.0.0
+ fast-json-stable-stringify: 2.1.0
+ graceful-fs: 4.2.11
+ jest-haste-map: 30.4.1
+ jest-regex-util: 30.4.0
+ jest-util: 30.4.1
+ pirates: 4.0.7
+ slash: 3.0.0
+ write-file-atomic: 5.0.1
+ transitivePeerDependencies:
+ - supports-color
- '@inquirer/[email protected](@types/[email protected])':
dependencies:
- '@inquirer/core': 10.3.2(@types/[email protected])
- '@inquirer/type': 3.0.10(@types/[email protected])
- optionalDependencies:
- '@types/node': 25.2.0
- optional: true
+ '@jest/pattern': 30.4.0
+ '@jest/schemas': 30.4.1
+ '@types/istanbul-lib-coverage': 2.0.6
+ '@types/istanbul-reports': 3.0.4
+ '@types/node': 24.12.0
+ '@types/yargs': 17.0.35
+ chalk: 4.1.2
- '@inquirer/[email protected](@types/[email protected])':
dependencies:
- '@inquirer/ansi': 1.0.2
- '@inquirer/figures': 1.0.15
- '@inquirer/type': 3.0.10(@types/[email protected])
- cli-width: 4.1.0
- mute-stream: 2.0.0
- signal-exit: 4.1.0
- wrap-ansi: 6.2.0
- yoctocolors-cjs: 2.1.3
- optionalDependencies:
- '@types/node': 20.19.41
- optional: true
+ '@jimp/file-ops': 1.6.1
+ '@jimp/types': 1.6.1
+ '@jimp/utils': 1.6.1
+ await-to-js: 3.0.0
+ exif-parser: 0.1.12
+ file-type: 21.3.4([email protected])
+ mime: 3.0.0
+ transitivePeerDependencies:
+ - supports-color
- '@inquirer/[email protected](@types/[email protected])':
dependencies:
- '@inquirer/ansi': 1.0.2
- '@inquirer/figures': 1.0.15
- '@inquirer/type': 3.0.10(@types/[email protected])
- cli-width: 4.1.0
- mute-stream: 2.0.0
- signal-exit: 4.1.0
- wrap-ansi: 6.2.0
- yoctocolors-cjs: 2.1.3
- optionalDependencies:
- '@types/node': 24.12.0
- optional: true
+ '@jimp/plugin-resize': 1.6.1([email protected])
+ '@jimp/types': 1.6.1
+ '@jimp/utils': 1.6.1
+ pixelmatch: 5.3.0
+ transitivePeerDependencies:
+ - supports-color
- '@inquirer/[email protected](@types/[email protected])':
- dependencies:
- '@inquirer/ansi': 1.0.2
- '@inquirer/figures': 1.0.15
- '@inquirer/type': 3.0.10(@types/[email protected])
- cli-width: 4.1.0
- mute-stream: 2.0.0
- signal-exit: 4.1.0
- wrap-ansi: 6.2.0
- yoctocolors-cjs: 2.1.3
- optionalDependencies:
- '@types/node': 25.2.0
- optional: true
+ '@jimp/[email protected]': {}
- '@inquirer/[email protected]':
- optional: true
+ dependencies:
+ '@jimp/core': 1.6.1([email protected])
+ '@jimp/types': 1.6.1
+ '@jimp/utils': 1.6.1
+ bmp-ts: 1.0.9
+ transitivePeerDependencies:
+ - supports-color
- '@inquirer/[email protected](@types/[email protected])':
- optionalDependencies:
- '@types/node': 20.19.41
- optional: true
+ dependencies:
+ '@jimp/core': 1.6.1([email protected])
+ '@jimp/types': 1.6.1
+ gifwrap: 0.10.1
+ omggif: 1.0.10
+ transitivePeerDependencies:
+ - supports-color
- '@inquirer/[email protected](@types/[email protected])':
- optionalDependencies:
- '@types/node': 24.12.0
- optional: true
+ dependencies:
+ '@jimp/core': 1.6.1([email protected])
+ '@jimp/types': 1.6.1
+ jpeg-js: 0.4.4
+ transitivePeerDependencies:
+ - supports-color
- '@inquirer/[email protected](@types/[email protected])':
- optionalDependencies:
- '@types/node': 25.2.0
- optional: true
+ dependencies:
+ '@jimp/core': 1.6.1([email protected])
+ '@jimp/types': 1.6.1
+ pngjs: 7.0.0
+ transitivePeerDependencies:
+ - supports-color
- '@inversifyjs/[email protected]': {}
+ dependencies:
+ '@jimp/core': 1.6.1([email protected])
+ '@jimp/types': 1.6.1
+ utif2: 4.1.0
+ transitivePeerDependencies:
+ - supports-color
dependencies:
- '@inversifyjs/common': 1.5.2
- '@inversifyjs/core': 9.2.0([email protected])
- '@inversifyjs/plugin': 0.2.0
- '@inversifyjs/reflect-metadata-utils': 1.4.1([email protected])
- reflect-metadata: 0.2.2
+ '@jimp/types': 1.6.1
+ '@jimp/utils': 1.6.1
+ zod: 3.25.76
dependencies:
- '@inversifyjs/common': 1.5.2
- '@inversifyjs/prototype-utils': 0.1.3
- '@inversifyjs/reflect-metadata-utils': 1.4.1([email protected])
+ '@jimp/core': 1.6.1([email protected])
+ '@jimp/utils': 1.6.1
transitivePeerDependencies:
- - reflect-metadata
+ - supports-color
- '@inversifyjs/[email protected]': {}
+ dependencies:
+ '@jimp/types': 1.6.1
+ zod: 3.25.76
- '@inversifyjs/[email protected]':
dependencies:
- '@inversifyjs/common': 1.5.2
+ '@jimp/core': 1.6.1([email protected])
+ '@jimp/types': 1.6.1
+ '@jimp/utils': 1.6.1
+ tinycolor2: 1.6.0
+ zod: 3.25.76
+ transitivePeerDependencies:
+ - supports-color
dependencies:
- reflect-metadata: 0.2.2
+ '@jimp/core': 1.6.1([email protected])
+ '@jimp/plugin-blit': 1.6.1
+ '@jimp/plugin-resize': 1.6.1([email protected])
+ '@jimp/types': 1.6.1
+ '@jimp/utils': 1.6.1
+ zod: 3.25.76
+ transitivePeerDependencies:
+ - supports-color
dependencies:
- inversify: 7.11.0([email protected])
+ '@jimp/core': 1.6.1([email protected])
+ '@jimp/plugin-crop': 1.6.1([email protected])
+ '@jimp/plugin-resize': 1.6.1([email protected])
+ '@jimp/types': 1.6.1
+ zod: 3.25.76
+ transitivePeerDependencies:
+ - supports-color
- '@isaacs/[email protected]':
dependencies:
- string-width: 5.1.2
- string-width-cjs: [email protected]
- strip-ansi: 7.2.0
- strip-ansi-cjs: [email protected]
- wrap-ansi: 8.1.0
- wrap-ansi-cjs: [email protected]
+ '@jimp/core': 1.6.1([email protected])
+ '@jimp/types': 1.6.1
+ '@jimp/utils': 1.6.1
+ zod: 3.25.76
+ transitivePeerDependencies:
+ - supports-color
- '@isaacs/[email protected]':
dependencies:
- minipass: 7.1.3
+ '@jimp/types': 1.6.1
+ '@jimp/utils': 1.6.1
+ zod: 3.25.76
- '@isaacs/[email protected]': {}
+ dependencies:
+ '@jimp/types': 1.6.1
- '@istanbuljs/[email protected]':
dependencies:
- camelcase: 5.3.1
- find-up: 4.1.0
- get-package-type: 0.1.0
- js-yaml: 3.14.2
- resolve-from: 5.0.0
+ '@jimp/types': 1.6.1
+ '@jimp/utils': 1.6.1
+ zod: 3.25.76
- '@istanbuljs/[email protected]': {}
+ dependencies:
+ '@jimp/types': 1.6.1
+ zod: 3.25.76
dependencies:
- '@jest/types': 30.4.1
- '@types/node': 24.13.3
- chalk: 4.1.2
- jest-message-util: 30.4.1
- jest-util: 30.4.1
- slash: 3.0.0
+ '@jimp/core': 1.6.1([email protected])
+ '@jimp/js-bmp': 1.6.1([email protected])
+ '@jimp/js-jpeg': 1.6.1([email protected])
+ '@jimp/js-png': 1.6.1([email protected])
+ '@jimp/js-tiff': 1.6.1([email protected])
+ '@jimp/plugin-color': 1.6.1([email protected])
+ '@jimp/plugin-resize': 1.6.1([email protected])
+ '@jimp/types': 1.6.1
+ '@jimp/utils': 1.6.1
+ any-base: 1.1.0
+ transitivePeerDependencies:
+ - supports-color
dependencies:
- '@jest/console': 30.4.1
- '@jest/pattern': 30.4.0
- '@jest/reporters': 30.4.1([email protected])
- '@jest/test-result': 30.4.1
- '@jest/transform': 30.4.1([email protected])
- '@jest/types': 30.4.1
- '@types/node': 24.13.3
- ansi-escapes: 4.3.2
- chalk: 4.1.2
- ci-info: 4.4.0
- exit-x: 0.2.2
- 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
- jest-resolve: 30.4.1
- jest-resolve-dependencies: 30.4.2([email protected])
- jest-runner: 30.4.2([email protected])
- jest-runtime: 30.4.2([email protected])
- jest-snapshot: 30.4.1([email protected])
- jest-util: 30.4.1
- jest-validate: 30.4.1
- jest-watcher: 30.4.1
- pretty-format: 30.4.1
- slash: 3.0.0
- transitivePeerDependencies:
- - babel-plugin-macros
- - esbuild-register
- - supports-color
- - ts-node
-
- dependencies:
- '@jest/types': 30.4.1
-
- '@jest/[email protected]': {}
+ '@jimp/types': 1.6.1
+ zod: 3.25.76
dependencies:
- '@jest/fake-timers': 30.4.1
- '@jest/types': 30.4.1
- '@types/node': 24.13.3
- jest-mock: 30.4.1
+ '@jimp/core': 1.6.1([email protected])
+ '@jimp/js-jpeg': 1.6.1([email protected])
+ '@jimp/js-png': 1.6.1([email protected])
+ '@jimp/plugin-blit': 1.6.1
+ '@jimp/types': 1.6.1
+ parse-bmfont-ascii: 1.0.6
+ parse-bmfont-binary: 1.0.6
+ parse-bmfont-xml: 1.1.6
+ simple-xml-to-json: 1.2.3
+ zod: 3.25.76
+ transitivePeerDependencies:
+ - supports-color
dependencies:
- '@jest/get-type': 30.1.0
+ image-q: 4.0.0
+ zod: 3.25.76
dependencies:
- expect: 30.4.1
- jest-snapshot: 30.4.1([email protected])
+ '@jimp/core': 1.6.1([email protected])
+ '@jimp/types': 1.6.1
+ zod: 3.25.76
transitivePeerDependencies:
- supports-color
dependencies:
- '@jest/types': 30.4.1
- '@sinonjs/fake-timers': 15.4.0
- '@types/node': 24.13.3
- jest-message-util: 30.4.1
- jest-mock: 30.4.1
- jest-util: 30.4.1
-
- '@jest/[email protected]': {}
+ '@jimp/core': 1.6.1([email protected])
+ '@jimp/plugin-crop': 1.6.1([email protected])
+ '@jimp/plugin-resize': 1.6.1([email protected])
+ '@jimp/types': 1.6.1
+ '@jimp/utils': 1.6.1
+ zod: 3.25.76
+ transitivePeerDependencies:
+ - supports-color
dependencies:
- '@jest/environment': 30.4.1
- '@jest/expect': 30.4.1([email protected])
- '@jest/types': 30.4.1
- jest-mock: 30.4.1
+ '@jimp/core': 1.6.1([email protected])
+ '@jimp/plugin-color': 1.6.1([email protected])
+ '@jimp/plugin-hash': 1.6.1([email protected])
+ '@jimp/types': 1.6.1
+ '@jimp/utils': 1.6.1
+ zod: 3.25.76
transitivePeerDependencies:
- supports-color
dependencies:
- '@types/node': 24.13.3
- jest-regex-util: 30.4.0
+ zod: 3.25.76
dependencies:
- '@bcoe/v8-coverage': 0.2.3
- '@jest/console': 30.4.1
- '@jest/test-result': 30.4.1
- '@jest/transform': 30.4.1([email protected])
- '@jest/types': 30.4.1
- '@jridgewell/trace-mapping': 0.3.31
- '@types/node': 24.13.3
- chalk: 4.1.2
- collect-v8-coverage: 1.0.3
- exit-x: 0.2.2
- glob: 10.5.0
- graceful-fs: 4.2.11
- istanbul-lib-coverage: 3.2.2
- istanbul-lib-instrument: 6.0.3([email protected])
- istanbul-lib-report: 3.0.1
- istanbul-lib-source-maps: 5.0.6([email protected])
- istanbul-reports: 3.2.0
- jest-message-util: 30.4.1
- jest-util: 30.4.1
- jest-worker: 30.4.1
- slash: 3.0.0
- string-length: 4.0.2
- v8-to-istanbul: 9.3.0
- transitivePeerDependencies:
- - supports-color
+ '@jimp/types': 1.6.1
+ tinycolor2: 1.6.0
- dependencies:
- '@sinclair/typebox': 0.27.10
+ '@joplin/[email protected]': {}
dependencies:
- '@sinclair/typebox': 0.34.49
+ glob: 13.0.6
+ react-docgen-typescript: 2.4.0([email protected])
+ optionalDependencies:
+ typescript: 5.9.3
dependencies:
- '@jest/types': 30.4.1
- chalk: 4.1.2
- graceful-fs: 4.2.11
- natural-compare: 1.4.0
+ glob: 13.0.6
+ react-docgen-typescript: 2.4.0([email protected])
+ optionalDependencies:
+ typescript: 5.9.3
+ '@jridgewell/[email protected]':
dependencies:
+ '@jridgewell/sourcemap-codec': 1.5.5
'@jridgewell/trace-mapping': 0.3.31
- callsites: 3.1.0
- graceful-fs: 4.2.11
+ '@jridgewell/[email protected]':
dependencies:
- '@jest/console': 30.4.1
- '@jest/types': 30.4.1
- '@types/istanbul-lib-coverage': 2.0.6
- collect-v8-coverage: 1.0.3
+ '@jridgewell/gen-mapping': 0.3.13
+ '@jridgewell/trace-mapping': 0.3.31
- dependencies:
- '@jest/test-result': 30.4.1
- graceful-fs: 4.2.11
- jest-haste-map: 30.4.1
- slash: 3.0.0
+ '@jridgewell/[email protected]': {}
+ '@jridgewell/[email protected]':
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@jest/types': 30.4.1
+ '@jridgewell/gen-mapping': 0.3.13
'@jridgewell/trace-mapping': 0.3.31
- babel-plugin-istanbul: 7.0.1([email protected])
- chalk: 4.1.2
- convert-source-map: 2.0.0
- fast-json-stable-stringify: 2.1.0
- graceful-fs: 4.2.11
- jest-haste-map: 30.4.1
- jest-regex-util: 30.4.0
- jest-util: 30.4.1
- pirates: 4.0.7
- slash: 3.0.0
- write-file-atomic: 5.0.1
- transitivePeerDependencies:
- - supports-color
+ optional: true
+
+ '@jridgewell/[email protected]': {}
+ '@jridgewell/[email protected]':
dependencies:
- '@jest/schemas': 29.6.3
- '@types/istanbul-lib-coverage': 2.0.6
- '@types/istanbul-reports': 3.0.4
- '@types/node': 24.13.3
- '@types/yargs': 17.0.35
- chalk: 4.1.2
+ '@jridgewell/resolve-uri': 3.1.2
+ '@jridgewell/sourcemap-codec': 1.5.5
dependencies:
- '@jest/pattern': 30.4.0
- '@jest/schemas': 30.4.1
- '@types/istanbul-lib-coverage': 2.0.6
- '@types/istanbul-reports': 3.0.4
- '@types/node': 24.12.0
- '@types/yargs': 17.0.35
- chalk: 4.1.2
+ tslib: 2.8.1
dependencies:
- '@jimp/file-ops': 1.6.1
- '@jimp/types': 1.6.1
- '@jimp/utils': 1.6.1
- await-to-js: 3.0.0
- exif-parser: 0.1.12
- file-type: 21.3.4([email protected])
- mime: 3.0.0
- transitivePeerDependencies:
- - supports-color
+ tslib: 2.8.1
dependencies:
- '@jimp/plugin-resize': 1.6.1([email protected])
- '@jimp/types': 1.6.1
- '@jimp/utils': 1.6.1
- pixelmatch: 5.3.0
- transitivePeerDependencies:
- - supports-color
+ tslib: 2.8.1
- '@jimp/[email protected]': {}
+ dependencies:
+ tslib: 2.8.1
dependencies:
- '@jimp/core': 1.6.1([email protected])
- '@jimp/types': 1.6.1
- '@jimp/utils': 1.6.1
- bmp-ts: 1.0.9
- transitivePeerDependencies:
- - supports-color
+ tslib: 2.8.1
dependencies:
- '@jimp/core': 1.6.1([email protected])
- '@jimp/types': 1.6.1
- gifwrap: 0.10.1
- omggif: 1.0.10
- transitivePeerDependencies:
- - supports-color
+ tslib: 2.8.1
- dependencies:
- '@jimp/core': 1.6.1([email protected])
- '@jimp/types': 1.6.1
- jpeg-js: 0.4.4
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- '@jimp/core': 1.6.1([email protected])
- '@jimp/types': 1.6.1
- pngjs: 7.0.0
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- '@jimp/core': 1.6.1([email protected])
- '@jimp/types': 1.6.1
- utif2: 4.1.0
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- '@jimp/types': 1.6.1
- '@jimp/utils': 1.6.1
- zod: 3.25.76
-
- dependencies:
- '@jimp/core': 1.6.1([email protected])
- '@jimp/utils': 1.6.1
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- '@jimp/types': 1.6.1
- zod: 3.25.76
-
- dependencies:
- '@jimp/core': 1.6.1([email protected])
- '@jimp/types': 1.6.1
- '@jimp/utils': 1.6.1
- tinycolor2: 1.6.0
- zod: 3.25.76
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- '@jimp/core': 1.6.1([email protected])
- '@jimp/plugin-blit': 1.6.1
- '@jimp/plugin-resize': 1.6.1([email protected])
- '@jimp/types': 1.6.1
- '@jimp/utils': 1.6.1
- zod: 3.25.76
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- '@jimp/core': 1.6.1([email protected])
- '@jimp/plugin-crop': 1.6.1([email protected])
- '@jimp/plugin-resize': 1.6.1([email protected])
- '@jimp/types': 1.6.1
- zod: 3.25.76
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- '@jimp/core': 1.6.1([email protected])
- '@jimp/types': 1.6.1
- '@jimp/utils': 1.6.1
- zod: 3.25.76
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- '@jimp/types': 1.6.1
- '@jimp/utils': 1.6.1
- zod: 3.25.76
-
- dependencies:
- '@jimp/types': 1.6.1
-
- dependencies:
- '@jimp/types': 1.6.1
- '@jimp/utils': 1.6.1
- zod: 3.25.76
-
- dependencies:
- '@jimp/types': 1.6.1
- zod: 3.25.76
-
- dependencies:
- '@jimp/core': 1.6.1([email protected])
- '@jimp/js-bmp': 1.6.1([email protected])
- '@jimp/js-jpeg': 1.6.1([email protected])
- '@jimp/js-png': 1.6.1([email protected])
- '@jimp/js-tiff': 1.6.1([email protected])
- '@jimp/plugin-color': 1.6.1([email protected])
- '@jimp/plugin-resize': 1.6.1([email protected])
- '@jimp/types': 1.6.1
- '@jimp/utils': 1.6.1
- any-base: 1.1.0
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- '@jimp/types': 1.6.1
- zod: 3.25.76
-
- dependencies:
- '@jimp/core': 1.6.1([email protected])
- '@jimp/js-jpeg': 1.6.1([email protected])
- '@jimp/js-png': 1.6.1([email protected])
- '@jimp/plugin-blit': 1.6.1
- '@jimp/types': 1.6.1
- parse-bmfont-ascii: 1.0.6
- parse-bmfont-binary: 1.0.6
- parse-bmfont-xml: 1.1.6
- simple-xml-to-json: 1.2.3
- zod: 3.25.76
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- image-q: 4.0.0
- zod: 3.25.76
-
- dependencies:
- '@jimp/core': 1.6.1([email protected])
- '@jimp/types': 1.6.1
- zod: 3.25.76
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- '@jimp/core': 1.6.1([email protected])
- '@jimp/plugin-crop': 1.6.1([email protected])
- '@jimp/plugin-resize': 1.6.1([email protected])
- '@jimp/types': 1.6.1
- '@jimp/utils': 1.6.1
- zod: 3.25.76
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- '@jimp/core': 1.6.1([email protected])
- '@jimp/plugin-color': 1.6.1([email protected])
- '@jimp/plugin-hash': 1.6.1([email protected])
- '@jimp/types': 1.6.1
- '@jimp/utils': 1.6.1
- zod: 3.25.76
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- zod: 3.25.76
-
- dependencies:
- '@jimp/types': 1.6.1
- tinycolor2: 1.6.0
-
- '@joplin/[email protected]': {}
-
- dependencies:
- glob: 13.0.6
- react-docgen-typescript: 2.4.0([email protected])
- optionalDependencies:
- typescript: 5.9.3
-
- dependencies:
- glob: 13.0.6
- react-docgen-typescript: 2.4.0([email protected])
- optionalDependencies:
- typescript: 5.9.3
-
- '@jridgewell/[email protected]':
- dependencies:
- '@jridgewell/sourcemap-codec': 1.5.5
- '@jridgewell/trace-mapping': 0.3.31
-
- '@jridgewell/[email protected]':
- dependencies:
- '@jridgewell/gen-mapping': 0.3.13
- '@jridgewell/trace-mapping': 0.3.31
-
- '@jridgewell/[email protected]': {}
-
- '@jridgewell/[email protected]':
- dependencies:
- '@jridgewell/gen-mapping': 0.3.13
- '@jridgewell/trace-mapping': 0.3.31
-
- '@jridgewell/[email protected]': {}
-
- '@jridgewell/[email protected]':
- dependencies:
- '@jridgewell/resolve-uri': 3.1.2
- '@jridgewell/sourcemap-codec': 1.5.5
-
- dependencies:
- tslib: 2.8.1
-
- dependencies:
- tslib: 2.8.1
-
- dependencies:
- tslib: 2.8.1
-
- dependencies:
- tslib: 2.8.1
-
- dependencies:
- tslib: 2.8.1
-
- dependencies:
- tslib: 2.8.1
-
dependencies:
'@jsonjoy.com/fs-node-builtins': 4.57.7([email protected])
'@jsonjoy.com/fs-node-utils': 4.57.7([email protected])
@@ -21081,10 +16239,6 @@ snapshots:
dependencies:
detect-libc: 2.1.2
- '@posthog/[email protected]':
- dependencies:
- '@posthog/types': 1.416.0
-
'@posthog/[email protected]':
dependencies:
'@posthog/types': 1.418.0
@@ -21146,11 +16300,6 @@ snapshots:
tailwind-merge: 2.6.1
tailwindcss: 4.3.1
- dependencies:
- react: 19.2.6
-
dependencies:
'@posthog/cli': 0.18.12
@@ -21158,8 +16307,6 @@ snapshots:
magic-string: 0.30.21
rollup: 4.59.0
- '@posthog/[email protected]': {}
-
'@posthog/[email protected]': {}
'@posthog/[email protected]': {}
@@ -21840,5214 +16987,3577 @@ snapshots:
'@radix-ui/react-use-controllable-state': 1.2.2(@types/[email protected])([email protected])
react: 19.2.6
react-dom: 19.2.6([email protected])
- optionalDependencies:
- '@types/react': 19.2.17
- '@types/react-dom': 19.2.3(@types/[email protected])
-
- dependencies:
- '@radix-ui/primitive': 1.1.3
- '@radix-ui/react-use-controllable-state': 1.2.2(@types/[email protected])([email protected])
- react: 19.2.6
- react-dom: 19.2.6([email protected])
- optionalDependencies:
- '@types/react': 19.2.17
- '@types/react-dom': 19.2.3(@types/[email protected])
-
- dependencies:
- '@radix-ui/primitive': 1.1.3
- '@radix-ui/react-context': 1.1.2(@types/[email protected])([email protected])
- '@radix-ui/react-direction': 1.1.1(@types/[email protected])([email protected])
- '@radix-ui/react-roving-focus': 1.1.11(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])
- '@radix-ui/react-toggle-group': 1.1.11(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])
- react: 19.2.6
- react-dom: 19.2.6([email protected])
- optionalDependencies:
- '@types/react': 19.2.17
- '@types/react-dom': 19.2.3(@types/[email protected])
-
- dependencies:
- '@radix-ui/primitive': 1.1.3
- '@radix-ui/react-compose-refs': 1.1.2(@types/[email protected])([email protected])
- '@radix-ui/react-context': 1.1.2(@types/[email protected])([email protected])
- '@radix-ui/react-dismissable-layer': 1.1.11(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])
- '@radix-ui/react-id': 1.1.1(@types/[email protected])([email protected])
- '@radix-ui/react-slot': 1.2.3(@types/[email protected])([email protected])
- '@radix-ui/react-use-controllable-state': 1.2.2(@types/[email protected])([email protected])
- '@radix-ui/react-visually-hidden': 1.2.3(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])
- react: 19.2.6
- react-dom: 19.2.6([email protected])
- optionalDependencies:
- '@types/react': 19.2.17
- '@types/react-dom': 19.2.3(@types/[email protected])
-
- dependencies:
- react: 19.2.6
- optionalDependencies:
- '@types/react': 19.2.17
-
- dependencies:
- '@radix-ui/react-use-effect-event': 0.0.2(@types/[email protected])([email protected])
- '@radix-ui/react-use-layout-effect': 1.1.1(@types/[email protected])([email protected])
- react: 19.2.6
- optionalDependencies:
- '@types/react': 19.2.17
-
- dependencies:
- '@radix-ui/react-use-layout-effect': 1.1.1(@types/[email protected])([email protected])
- react: 19.2.6
- optionalDependencies:
- '@types/react': 19.2.17
-
- dependencies:
- '@radix-ui/react-use-callback-ref': 1.1.1(@types/[email protected])([email protected])
- react: 19.2.6
- optionalDependencies:
- '@types/react': 19.2.17
-
- dependencies:
- react: 19.2.6
- use-sync-external-store: 1.6.0([email protected])
- optionalDependencies:
- '@types/react': 19.2.17
-
- dependencies:
- react: 19.2.6
- optionalDependencies:
- '@types/react': 19.2.17
-
- dependencies:
- react: 19.2.6
- optionalDependencies:
- '@types/react': 19.2.17
-
- dependencies:
- '@radix-ui/rect': 1.1.1
- react: 19.2.6
- optionalDependencies:
- '@types/react': 19.2.17
-
- dependencies:
- '@radix-ui/react-use-layout-effect': 1.1.1(@types/[email protected])([email protected])
- react: 19.2.6
- optionalDependencies:
- '@types/react': 19.2.17
-
- dependencies:
- react: 19.2.6
- react-dom: 19.2.6([email protected])
- optionalDependencies:
- '@types/react': 19.2.17
- '@types/react-dom': 19.2.3(@types/[email protected])
-
- '@radix-ui/[email protected]': {}
-
- dependencies:
- '@radix-ui/colors': 3.0.0
- classnames: 2.5.1
- react: 19.2.6
- react-dom: 19.2.6([email protected])
- react-remove-scroll-bar: 2.3.8(@types/[email protected])([email protected])
- optionalDependencies:
- '@types/react': 19.2.17
- '@types/react-dom': 19.2.3(@types/[email protected])
-
- '@react-grab/[email protected]':
- dependencies:
- agent-install: 0.0.6
- commander: 14.0.3
- ignore: 7.0.5
- ora: 9.4.1
- package-manager-detector: 1.8.0
- picocolors: 1.1.1
- prompts: 2.4.2
- tinyexec: 1.2.4
-
- dependencies:
- merge-options: 3.0.4
-
- dependencies:
- react: 19.2.6
-
- dependencies:
- react: 19.2.6
-
- '@react-native/[email protected]': {}
-
- dependencies:
- '@babel/traverse': 7.29.0([email protected])
- '@react-native/codegen': 0.86.0(@babel/[email protected]([email protected]))
- transitivePeerDependencies:
- - '@babel/core'
- - supports-color
-
- dependencies:
- '@babel/traverse': 7.29.7([email protected])
- '@react-native/codegen': 0.86.3(@babel/[email protected]([email protected]))
- transitivePeerDependencies:
- - '@babel/core'
- - supports-color
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/plugin-proposal-export-default-from': 7.29.7(@babel/[email protected]([email protected]))
- '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/[email protected]([email protected]))
- '@babel/plugin-syntax-export-default-from': 7.29.7(@babel/[email protected]([email protected]))
- '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/[email protected]([email protected]))
- '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/[email protected]([email protected]))
- '@babel/plugin-transform-async-generator-functions': 7.29.7(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-async-to-generator': 7.29.7(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-block-scoping': 7.29.7(@babel/[email protected]([email protected]))
- '@babel/plugin-transform-class-properties': 7.29.7(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-classes': 7.29.7(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-destructuring': 7.29.7(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-flow-strip-types': 7.29.7(@babel/[email protected]([email protected]))
- '@babel/plugin-transform-for-of': 7.29.7(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-modules-commonjs': 7.29.7(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-named-capturing-groups-regex': 7.29.7(@babel/[email protected]([email protected]))
- '@babel/plugin-transform-nullish-coalescing-operator': 7.29.7(@babel/[email protected]([email protected]))
- '@babel/plugin-transform-optional-catch-binding': 7.29.7(@babel/[email protected]([email protected]))
- '@babel/plugin-transform-optional-chaining': 7.29.7(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-private-methods': 7.29.7(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-private-property-in-object': 7.29.7(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-react-display-name': 7.29.7(@babel/[email protected]([email protected]))
- '@babel/plugin-transform-react-jsx': 7.29.7(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-react-jsx-self': 7.29.7(@babel/[email protected]([email protected]))
- '@babel/plugin-transform-react-jsx-source': 7.29.7(@babel/[email protected]([email protected]))
- '@babel/plugin-transform-regenerator': 7.29.7(@babel/[email protected]([email protected]))
- '@babel/plugin-transform-runtime': 7.29.7(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-typescript': 7.29.7(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-unicode-regex': 7.29.7(@babel/[email protected]([email protected]))
- '@react-native/babel-plugin-codegen': 0.86.0(@babel/[email protected]([email protected]))([email protected])
- babel-plugin-syntax-hermes-parser: 0.36.0
- babel-plugin-transform-flow-enums: 0.0.2(@babel/[email protected]([email protected]))
- react-refresh: 0.14.2
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/parser': 7.29.7
- hermes-parser: 0.36.0
- invariant: 2.2.4
- nullthrows: 1.1.1
- tinyglobby: 0.2.15
- yargs: 17.7.2
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/parser': 7.29.7
- hermes-parser: 0.36.0
- invariant: 2.2.4
- nullthrows: 1.1.1
- tinyglobby: 0.2.17
- yargs: 17.7.2
-
- dependencies:
- '@react-native/dev-middleware': 0.86.0([email protected])
- debug: 4.4.3([email protected])
- invariant: 2.2.4
- metro: 0.84.4([email protected])
- metro-config: 0.84.4([email protected])
- metro-core: 0.84.4
- semver: 7.8.4
- optionalDependencies:
- '@react-native/metro-config': 0.86.0(@babel/[email protected]([email protected]))([email protected])
- transitivePeerDependencies:
- - bufferutil
- - supports-color
- - utf-8-validate
-
- '@react-native/[email protected]': {}
-
- '@react-native/[email protected]': {}
-
- dependencies:
- cross-spawn: 7.0.6
- debug: 4.4.3([email protected])
- fb-dotslash: 0.5.8
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- cross-spawn: 7.0.6
- debug: 4.4.3([email protected])
- fb-dotslash: 0.5.8
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- '@isaacs/ttlcache': 1.4.1
- '@react-native/debugger-frontend': 0.86.0
- '@react-native/debugger-shell': 0.86.0([email protected])
- chrome-launcher: 0.15.2([email protected])
- chromium-edge-launcher: 0.3.0([email protected])
- connect: 3.7.0([email protected])
- debug: 4.4.3([email protected])
- invariant: 2.2.4
- nullthrows: 1.1.1
- open: 7.4.2
- serve-static: 1.16.3([email protected])
- ws: 7.5.11
- transitivePeerDependencies:
- - bufferutil
- - supports-color
- - utf-8-validate
-
- dependencies:
- '@isaacs/ttlcache': 1.4.1
- '@react-native/debugger-frontend': 0.86.3
- '@react-native/debugger-shell': 0.86.3([email protected])
- chrome-launcher: 0.15.2([email protected])
- chromium-edge-launcher: 0.3.0([email protected])
- connect: 3.7.0([email protected])
- debug: 4.4.3([email protected])
- invariant: 2.2.4
- nullthrows: 1.1.1
- open: 7.4.2
- serve-static: 1.16.3([email protected])
- ws: 7.5.11
- transitivePeerDependencies:
- - bufferutil
- - supports-color
- - utf-8-validate
-
- '@react-native/[email protected]': {}
-
- '@react-native/[email protected]': {}
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@react-native/babel-preset': 0.86.0(@babel/[email protected]([email protected]))([email protected])
- hermes-parser: 0.36.0
- nullthrows: 1.1.1
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- '@react-native/js-polyfills': 0.86.0
- '@react-native/metro-babel-transformer': 0.86.0(@babel/[email protected]([email protected]))([email protected])
- metro-config: 0.84.5([email protected])
- metro-runtime: 0.84.5
- transitivePeerDependencies:
- - '@babel/core'
- - bufferutil
- - supports-color
- - utf-8-validate
-
- '@react-native/[email protected]': {}
-
- '@react-native/[email protected]': {}
-
- '@react-native/[email protected]': {}
-
- dependencies:
- invariant: 2.2.4
- nullthrows: 1.1.1
- react: 19.2.6
- optionalDependencies:
- '@types/react': 19.2.17
-
- '@react-navigation/[email protected]([email protected])':
- dependencies:
- '@react-navigation/routers': 7.6.4
- escape-string-regexp: 4.0.0
- fast-deep-equal: 3.1.3
- nanoid: 3.3.19
- query-string: 7.1.3
- react: 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.21.11([email protected])
- escape-string-regexp: 4.0.0
- fast-deep-equal: 3.1.3
- nanoid: 3.3.19
- react: 19.2.6
- use-latest-callback: 0.2.6([email protected])
- optional: true
-
- '@react-navigation/[email protected]':
- dependencies:
- nanoid: 3.3.19
- optional: true
-
- '@remirror/[email protected]': {}
-
- '@rolldown/[email protected]':
- optional: true
-
- '@rolldown/[email protected]':
- optional: true
-
- '@rolldown/[email protected]':
- optional: true
-
- '@rolldown/[email protected]':
- optional: true
-
- '@rolldown/[email protected]':
- optional: true
-
- '@rolldown/[email protected]':
- optional: true
-
- '@rolldown/[email protected]':
- optional: true
-
- '@rolldown/[email protected]':
- optional: true
-
- '@rolldown/[email protected]':
- optional: true
-
- '@rolldown/[email protected]':
- optional: true
-
- dependencies:
- '@napi-rs/wasm-runtime': 1.1.5(@emnapi/[email protected])(@emnapi/[email protected])
- transitivePeerDependencies:
- - '@emnapi/core'
- - '@emnapi/runtime'
- optional: true
-
- '@rolldown/[email protected]':
- optional: true
-
- '@rolldown/[email protected]':
- optional: true
-
- '@rolldown/[email protected]': {}
-
- '@rolldown/[email protected]': {}
-
- '@rolldown/[email protected]': {}
-
- dependencies:
- '@types/estree': 1.0.8
- estree-walker: 2.0.2
- picomatch: 4.0.3
- optionalDependencies:
- rollup: 4.59.0
-
- '@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
-
- '@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])([email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))':
- dependencies:
- '@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.10.0(@opentelemetry/[email protected])
- '@opentelemetry/exporter-trace-otlp-http': 0.208.0(@opentelemetry/[email protected])
- '@opentelemetry/instrumentation': 0.220.0(@opentelemetry/[email protected])([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]))([email protected])':
- dependencies:
- '@opentelemetry/api': 1.9.1
- '@opentelemetry/instrumentation': 0.220.0(@opentelemetry/[email protected])([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])([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([email protected])
- 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]))':
- dependencies:
- '@opentelemetry/api': 1.9.1
- '@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
-
- dependencies:
- '@apm-js-collab/code-transformer-bundler-plugins': 0.7.1
- '@apm-js-collab/tracing-hooks': 0.13.0([email protected])
- '@sentry/conventions': 0.16.0
- '@sentry/core': 10.68.0
- meriyah: 6.1.4
- transitivePeerDependencies:
- - supports-color
-
- '@shaderfrog/[email protected]': {}
-
- '@shikijs/[email protected]':
- dependencies:
- '@shikijs/types': 3.23.0
- '@shikijs/vscode-textmate': 10.0.2
- '@types/hast': 3.0.4
- hast-util-to-html: 9.0.5
-
- '@shikijs/[email protected]':
- dependencies:
- '@shikijs/types': 3.23.0
- '@shikijs/vscode-textmate': 10.0.2
- oniguruma-to-es: 4.3.5
-
- '@shikijs/[email protected]':
- dependencies:
- '@shikijs/types': 3.23.0
- '@shikijs/vscode-textmate': 10.0.2
-
- '@shikijs/[email protected]':
- dependencies:
- '@shikijs/types': 3.23.0
-
- '@shikijs/[email protected]':
- dependencies:
- '@shikijs/types': 3.23.0
-
- '@shikijs/[email protected]':
- dependencies:
- '@shikijs/core': 3.23.0
- '@shikijs/types': 3.23.0
-
- '@shikijs/[email protected]':
- dependencies:
- '@shikijs/vscode-textmate': 10.0.2
- '@types/hast': 3.0.4
-
- '@shikijs/[email protected]': {}
-
- dependencies:
- '@babel/runtime': 7.29.7
- react: 19.2.6
- tslib: 2.8.1
-
- '@sideway/[email protected]':
- dependencies:
- '@hapi/hoek': 9.3.0
-
- '@sideway/[email protected]': {}
-
- '@sideway/[email protected]': {}
-
- '@silvia-odwyer/[email protected]': {}
-
- '@sinclair/[email protected]':
- dependencies:
- '@sinclair/typebox': 0.33.22
- prettier: 2.8.8
- typescript: 5.9.3
-
- '@sinclair/[email protected]': {}
-
- '@sinclair/[email protected]': {}
-
- '@sinclair/[email protected]': {}
-
- '@sindresorhus/[email protected]': {}
-
- '@sinonjs/[email protected]':
- dependencies:
- type-detect: 4.0.8
-
- '@sinonjs/[email protected]':
- dependencies:
- '@sinonjs/commons': 3.0.1
-
- '@smithy/[email protected]':
- dependencies:
- '@smithy/types': 4.19.0
- tslib: 2.8.1
-
- '@smithy/[email protected]':
- dependencies:
- '@smithy/core': 3.35.1
- '@smithy/types': 4.19.0
- tslib: 2.8.1
-
- '@smithy/[email protected]':
- dependencies:
- '@smithy/core': 3.35.1
- '@smithy/types': 4.19.0
- tslib: 2.8.1
-
- '@smithy/[email protected]':
- dependencies:
- '@smithy/core': 3.35.1
- '@smithy/types': 4.19.0
- tslib: 2.8.1
-
- '@smithy/[email protected]':
- dependencies:
- '@smithy/core': 3.35.1
- '@smithy/types': 4.19.0
- tslib: 2.8.1
-
- '@smithy/[email protected]':
- dependencies:
- tslib: 2.8.1
-
- '@stablelib/[email protected]': {}
-
- '@standard-schema/[email protected]': {}
-
- dependencies:
- '@storybook/global': 5.0.0
- axe-core: 4.11.1
-
- dependencies:
- '@mdx-js/react': 3.1.1(@types/[email protected])([email protected])
- react: 19.2.6
- react-dom: 19.2.6([email protected])
- ts-dedent: 2.2.0
- optionalDependencies:
- '@types/react': 19.2.17
- transitivePeerDependencies:
- - '@types/react-dom'
- - esbuild
- - rollup
- - vite
- - webpack
-
- dependencies:
- ts-dedent: 2.2.0
- transitivePeerDependencies:
- - esbuild
- - rollup
- - webpack
-
- dependencies:
- ts-dedent: 2.2.0
- transitivePeerDependencies:
- - esbuild
- - rollup
- - webpack
-
- dependencies:
- unplugin: 2.3.11
- optionalDependencies:
- esbuild: 0.27.7
- rollup: 4.59.0
-
- dependencies:
- unplugin: 2.3.11
- optionalDependencies:
- esbuild: 0.27.7
- rollup: 4.59.0
-
- '@storybook/[email protected]': {}
-
- dependencies:
- react: 19.2.6
- react-dom: 19.2.6([email protected])
-
- dependencies:
- react: 19.2.6
- react-dom: 19.2.6([email protected])
- optionalDependencies:
- '@types/react': 19.2.17
- '@types/react-dom': 19.2.3(@types/[email protected])
-
- dependencies:
- '@rollup/pluginutils': 5.3.0([email protected])
- empathic: 2.0.0
- magic-string: 0.30.21
- react: 19.2.6
- react-docgen: 8.0.2([email protected])
- react-dom: 19.2.6([email protected])
- resolve: 1.22.11
- tsconfig-paths: 4.2.0
- transitivePeerDependencies:
- - '@types/react'
- - '@types/react-dom'
- - esbuild
- - rollup
- - supports-color
- - typescript
- - webpack
-
- dependencies:
- '@rollup/pluginutils': 5.3.0([email protected])
- empathic: 2.0.0
- magic-string: 0.30.21
- react: 19.2.6
- react-docgen: 8.0.2([email protected])
- react-dom: 19.2.6([email protected])
- resolve: 1.22.11
- tsconfig-paths: 4.2.0
- transitivePeerDependencies:
- - '@types/react'
- - '@types/react-dom'
- - esbuild
- - rollup
- - supports-color
- - typescript
- - webpack
-
- dependencies:
- '@storybook/global': 5.0.0
- react: 19.2.6
- react-docgen: 8.0.2([email protected])
- react-docgen-typescript: 2.4.0([email protected])
- react-dom: 19.2.6([email protected])
- optionalDependencies:
- '@types/react': 19.2.17
- '@types/react-dom': 19.2.3(@types/[email protected])
- typescript: 5.9.3
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/generator': 7.29.1
- '@babel/template': 7.28.6
- '@babel/types': 7.29.7
- '@jest/types': 30.4.1
- '@swc/core': 1.15.43
- '@swc/jest': 0.2.39(@swc/[email protected])
- expect-playwright: 0.8.0
- jest-circus: 30.4.2([email protected])
- jest-environment-node: 30.4.1
- jest-junit: 16.0.0
- jest-runner: 30.4.2([email protected])
- jest-serializer-html: 7.1.0
- nyc: 15.1.0([email protected])
- playwright: 1.60.0
- playwright-core: 1.60.0
- rimraf: 3.0.2
- uuid: 8.3.2
- transitivePeerDependencies:
- - '@swc/helpers'
- - '@types/node'
- - babel-plugin-macros
- - debug
- - esbuild-register
- - node-notifier
- - supports-color
- - ts-node
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@svgr/babel-plugin-add-jsx-attribute': 8.0.0(@babel/[email protected]([email protected]))
- '@svgr/babel-plugin-remove-jsx-attribute': 8.0.0(@babel/[email protected]([email protected]))
- '@svgr/babel-plugin-remove-jsx-empty-expression': 8.0.0(@babel/[email protected]([email protected]))
- '@svgr/babel-plugin-replace-jsx-attribute-value': 8.0.0(@babel/[email protected]([email protected]))
- '@svgr/babel-plugin-svg-dynamic-title': 8.0.0(@babel/[email protected]([email protected]))
- '@svgr/babel-plugin-svg-em-dimensions': 8.0.0(@babel/[email protected]([email protected]))
- '@svgr/babel-plugin-transform-react-native-svg': 8.1.0(@babel/[email protected]([email protected]))
- '@svgr/babel-plugin-transform-svg-component': 8.0.0(@babel/[email protected]([email protected]))
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@svgr/babel-preset': 8.1.0(@babel/[email protected]([email protected]))
- camelcase: 6.3.0
- cosmiconfig: 8.3.6([email protected])
- snake-case: 3.0.4
- transitivePeerDependencies:
- - supports-color
- - typescript
-
- dependencies:
- '@babel/types': 7.29.7
- entities: 4.5.0
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@svgr/babel-preset': 8.1.0(@babel/[email protected]([email protected]))
- '@svgr/core': 8.1.0([email protected])([email protected])
- '@svgr/hast-util-to-babel-ast': 8.0.0
- svg-parser: 2.0.4
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- '@svgr/core': 8.1.0([email protected])([email protected])
- cosmiconfig: 8.3.6([email protected])
- deepmerge: 4.3.1
- svgo: 3.3.3
- transitivePeerDependencies:
- - typescript
-
- optional: true
-
- optional: true
-
- optional: true
-
- optional: true
-
- optional: true
-
- optional: true
-
- optional: true
-
- optional: true
-
- optional: true
-
- optional: true
-
- optional: true
-
- optional: true
-
- dependencies:
- '@swc/counter': 0.1.3
- '@swc/types': 0.1.27
- optionalDependencies:
- '@swc/core-darwin-arm64': 1.15.43
- '@swc/core-darwin-x64': 1.15.43
- '@swc/core-linux-arm-gnueabihf': 1.15.43
- '@swc/core-linux-arm64-gnu': 1.15.43
- '@swc/core-linux-arm64-musl': 1.15.43
- '@swc/core-linux-ppc64-gnu': 1.15.43
- '@swc/core-linux-s390x-gnu': 1.15.43
- '@swc/core-linux-x64-gnu': 1.15.43
- '@swc/core-linux-x64-musl': 1.15.43
- '@swc/core-win32-arm64-msvc': 1.15.43
- '@swc/core-win32-ia32-msvc': 1.15.43
- '@swc/core-win32-x64-msvc': 1.15.43
-
- '@swc/[email protected]': {}
+ optionalDependencies:
+ '@types/react': 19.2.17
+ '@types/react-dom': 19.2.3(@types/[email protected])
dependencies:
- '@jest/create-cache-key-function': 30.4.1
- '@swc/core': 1.15.43
- '@swc/counter': 0.1.3
- jsonc-parser: 3.3.1
+ '@radix-ui/primitive': 1.1.3
+ '@radix-ui/react-use-controllable-state': 1.2.2(@types/[email protected])([email protected])
+ react: 19.2.6
+ react-dom: 19.2.6([email protected])
+ optionalDependencies:
+ '@types/react': 19.2.17
+ '@types/react-dom': 19.2.3(@types/[email protected])
dependencies:
- '@swc/counter': 0.1.3
+ '@radix-ui/primitive': 1.1.3
+ '@radix-ui/react-context': 1.1.2(@types/[email protected])([email protected])
+ '@radix-ui/react-direction': 1.1.1(@types/[email protected])([email protected])
+ '@radix-ui/react-roving-focus': 1.1.11(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])
+ '@radix-ui/react-toggle-group': 1.1.11(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])
+ react: 19.2.6
+ react-dom: 19.2.6([email protected])
+ optionalDependencies:
+ '@types/react': 19.2.17
+ '@types/react-dom': 19.2.3(@types/[email protected])
- '@szmarczak/[email protected]':
dependencies:
- defer-to-connect: 2.0.1
+ '@radix-ui/primitive': 1.1.3
+ '@radix-ui/react-compose-refs': 1.1.2(@types/[email protected])([email protected])
+ '@radix-ui/react-context': 1.1.2(@types/[email protected])([email protected])
+ '@radix-ui/react-dismissable-layer': 1.1.11(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])
+ '@radix-ui/react-id': 1.1.1(@types/[email protected])([email protected])
+ '@radix-ui/react-slot': 1.2.3(@types/[email protected])([email protected])
+ '@radix-ui/react-use-controllable-state': 1.2.2(@types/[email protected])([email protected])
+ '@radix-ui/react-visually-hidden': 1.2.3(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])
+ react: 19.2.6
+ react-dom: 19.2.6([email protected])
+ optionalDependencies:
+ '@types/react': 19.2.17
+ '@types/react-dom': 19.2.3(@types/[email protected])
- '@tailwindcss/[email protected]':
dependencies:
- '@jridgewell/remapping': 2.3.5
- enhanced-resolve: 5.19.0
- jiti: 2.7.0
- lightningcss: 1.32.0
- magic-string: 0.30.21
- source-map-js: 1.2.1
- tailwindcss: 4.2.2
+ react: 19.2.6
+ optionalDependencies:
+ '@types/react': 19.2.17
- '@tailwindcss/[email protected]':
dependencies:
- '@jridgewell/remapping': 2.3.5
- enhanced-resolve: 5.21.6
- jiti: 2.7.0
- lightningcss: 1.32.0
- magic-string: 0.30.21
- source-map-js: 1.2.1
- tailwindcss: 4.3.1
-
- '@tailwindcss/[email protected]':
- optional: true
-
- '@tailwindcss/[email protected]':
- optional: true
-
- '@tailwindcss/[email protected]':
- optional: true
+ '@radix-ui/react-use-effect-event': 0.0.2(@types/[email protected])([email protected])
+ '@radix-ui/react-use-layout-effect': 1.1.1(@types/[email protected])([email protected])
+ react: 19.2.6
+ optionalDependencies:
+ '@types/react': 19.2.17
- '@tailwindcss/[email protected]':
- optional: true
+ dependencies:
+ '@radix-ui/react-use-layout-effect': 1.1.1(@types/[email protected])([email protected])
+ react: 19.2.6
+ optionalDependencies:
+ '@types/react': 19.2.17
- '@tailwindcss/[email protected]':
- optional: true
+ dependencies:
+ '@radix-ui/react-use-callback-ref': 1.1.1(@types/[email protected])([email protected])
+ react: 19.2.6
+ optionalDependencies:
+ '@types/react': 19.2.17
- '@tailwindcss/[email protected]':
- optional: true
+ dependencies:
+ react: 19.2.6
+ use-sync-external-store: 1.6.0([email protected])
+ optionalDependencies:
+ '@types/react': 19.2.17
- '@tailwindcss/[email protected]':
- optional: true
+ dependencies:
+ react: 19.2.6
+ optionalDependencies:
+ '@types/react': 19.2.17
- '@tailwindcss/[email protected]':
- optional: true
+ dependencies:
+ react: 19.2.6
+ optionalDependencies:
+ '@types/react': 19.2.17
- '@tailwindcss/[email protected]':
- optional: true
+ dependencies:
+ '@radix-ui/rect': 1.1.1
+ react: 19.2.6
+ optionalDependencies:
+ '@types/react': 19.2.17
- '@tailwindcss/[email protected]':
- optional: true
+ dependencies:
+ '@radix-ui/react-use-layout-effect': 1.1.1(@types/[email protected])([email protected])
+ react: 19.2.6
+ optionalDependencies:
+ '@types/react': 19.2.17
- '@tailwindcss/[email protected]':
- optional: true
+ dependencies:
+ react: 19.2.6
+ react-dom: 19.2.6([email protected])
+ optionalDependencies:
+ '@types/react': 19.2.17
+ '@types/react-dom': 19.2.3(@types/[email protected])
- '@tailwindcss/[email protected]':
- optional: true
+ '@radix-ui/[email protected]': {}
- '@tailwindcss/[email protected]':
- optional: true
+ dependencies:
+ '@radix-ui/colors': 3.0.0
+ classnames: 2.5.1
+ react: 19.2.6
+ react-dom: 19.2.6([email protected])
+ react-remove-scroll-bar: 2.3.8(@types/[email protected])([email protected])
+ optionalDependencies:
+ '@types/react': 19.2.17
+ '@types/react-dom': 19.2.3(@types/[email protected])
- '@tailwindcss/[email protected]':
- optional: true
+ '@react-grab/[email protected]':
+ dependencies:
+ agent-install: 0.0.6
+ commander: 14.0.3
+ ignore: 7.0.5
+ ora: 9.4.1
+ package-manager-detector: 1.8.0
+ picocolors: 1.1.1
+ prompts: 2.4.2
+ tinyexec: 1.2.4
- '@tailwindcss/[email protected]':
- optional: true
+ '@remirror/[email protected]': {}
- '@tailwindcss/[email protected]':
+ '@rolldown/[email protected]':
optional: true
- '@tailwindcss/[email protected]':
+ '@rolldown/[email protected]':
optional: true
- '@tailwindcss/[email protected]':
+ '@rolldown/[email protected]':
optional: true
- '@tailwindcss/[email protected]':
+ '@rolldown/[email protected]':
optional: true
- '@tailwindcss/[email protected]':
+ '@rolldown/[email protected]':
optional: true
- '@tailwindcss/[email protected]':
+ '@rolldown/[email protected]':
optional: true
- '@tailwindcss/[email protected]':
+ '@rolldown/[email protected]':
optional: true
- '@tailwindcss/[email protected]':
+ '@rolldown/[email protected]':
optional: true
- '@tailwindcss/[email protected]':
+ '@rolldown/[email protected]':
optional: true
- '@tailwindcss/[email protected]':
- optionalDependencies:
- '@tailwindcss/oxide-android-arm64': 4.2.2
- '@tailwindcss/oxide-darwin-arm64': 4.2.2
- '@tailwindcss/oxide-darwin-x64': 4.2.2
- '@tailwindcss/oxide-freebsd-x64': 4.2.2
- '@tailwindcss/oxide-linux-arm-gnueabihf': 4.2.2
- '@tailwindcss/oxide-linux-arm64-gnu': 4.2.2
- '@tailwindcss/oxide-linux-arm64-musl': 4.2.2
- '@tailwindcss/oxide-linux-x64-gnu': 4.2.2
- '@tailwindcss/oxide-linux-x64-musl': 4.2.2
- '@tailwindcss/oxide-wasm32-wasi': 4.2.2
- '@tailwindcss/oxide-win32-arm64-msvc': 4.2.2
- '@tailwindcss/oxide-win32-x64-msvc': 4.2.2
-
- '@tailwindcss/[email protected]':
- optionalDependencies:
- '@tailwindcss/oxide-android-arm64': 4.3.1
- '@tailwindcss/oxide-darwin-arm64': 4.3.1
- '@tailwindcss/oxide-darwin-x64': 4.3.1
- '@tailwindcss/oxide-freebsd-x64': 4.3.1
- '@tailwindcss/oxide-linux-arm-gnueabihf': 4.3.1
- '@tailwindcss/oxide-linux-arm64-gnu': 4.3.1
- '@tailwindcss/oxide-linux-arm64-musl': 4.3.1
- '@tailwindcss/oxide-linux-x64-gnu': 4.3.1
- '@tailwindcss/oxide-linux-x64-musl': 4.3.1
- '@tailwindcss/oxide-wasm32-wasi': 4.3.1
- '@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:
- '@tanstack/devtools-event-client': 0.5.0
-
- '@tanstack/[email protected]':
- dependencies:
- ws: 8.21.0
- transitivePeerDependencies:
- - bufferutil
- - utf-8-validate
-
- '@tanstack/[email protected]': {}
+ '@rolldown/[email protected]':
+ optional: true
dependencies:
- '@tanstack/devtools-client': 0.0.8
- '@tanstack/devtools-event-bus': 0.4.2
- chalk: 5.6.2
- launch-editor: 2.14.1
- magic-string: 0.30.21
- oxc-parser: 0.120.0(@emnapi/[email protected])(@emnapi/[email protected])
- picomatch: 4.0.3
+ '@napi-rs/wasm-runtime': 1.1.5(@emnapi/[email protected])(@emnapi/[email protected])
transitivePeerDependencies:
- '@emnapi/core'
- '@emnapi/runtime'
- - bufferutil
- - utf-8-validate
+ optional: true
- '@tanstack/[email protected]': {}
+ '@rolldown/[email protected]':
+ optional: true
- '@tanstack/[email protected]': {}
+ '@rolldown/[email protected]':
+ optional: true
- '@tanstack/[email protected]': {}
+ '@rolldown/[email protected]': {}
- '@tanstack/[email protected]':
- dependencies:
- '@tanstack/query-core': 5.101.0
+ '@rolldown/[email protected]': {}
- '@tanstack/[email protected]':
- dependencies:
- '@tanstack/query-core': 5.101.0
- '@tanstack/query-persist-client-core': 5.101.0
+ '@rolldown/[email protected]': {}
dependencies:
- '@tanstack/query-persist-client-core': 5.101.0
- '@tanstack/react-query': 5.101.0([email protected])
- react: 19.2.6
+ '@types/estree': 1.0.8
+ estree-walker: 2.0.2
+ picomatch: 4.0.3
+ optionalDependencies:
+ rollup: 4.59.0
- dependencies:
- '@tanstack/query-core': 5.101.0
- react: 19.2.6
+ '@rollup/[email protected]':
+ optional: true
- dependencies:
- '@tanstack/query-core': 5.90.20
- react: 19.2.6
+ '@rollup/[email protected]':
+ optional: true
- dependencies:
- '@tanstack/react-router': 1.170.15([email protected]([email protected]))([email protected])
- '@tanstack/router-devtools-core': 1.168.0(@tanstack/[email protected])([email protected])
- react: 19.2.6
- react-dom: 19.2.6([email protected])
- optionalDependencies:
- '@tanstack/router-core': 1.171.13
- transitivePeerDependencies:
- - csstype
+ '@rollup/[email protected]':
+ optional: true
- dependencies:
- '@tanstack/history': 1.162.0
- '@tanstack/react-store': 0.9.3([email protected]([email protected]))([email protected])
- '@tanstack/router-core': 1.171.13
- isbot: 5.1.40
- react: 19.2.6
- react-dom: 19.2.6([email protected])
+ '@rollup/[email protected]':
+ optional: true
- dependencies:
- '@tanstack/store': 0.9.3
- react: 19.2.6
- react-dom: 19.2.6([email protected])
- use-sync-external-store: 1.6.0([email protected])
+ '@rollup/[email protected]':
+ optional: true
- dependencies:
- '@tanstack/virtual-core': 3.17.0
- react: 19.2.6
- react-dom: 19.2.6([email protected])
+ '@rollup/[email protected]':
+ optional: true
- '@tanstack/[email protected]':
- dependencies:
- '@tanstack/history': 1.162.0
- cookie-es: 3.1.1
- seroval: 1.5.6
- seroval-plugins: 1.5.6([email protected])
+ '@rollup/[email protected]':
+ optional: true
- dependencies:
- '@tanstack/router-core': 1.171.13
- clsx: 2.1.1
- goober: 2.1.19([email protected])
- optionalDependencies:
- csstype: 3.2.3
+ '@rollup/[email protected]':
+ optional: true
- dependencies:
- '@babel/types': 7.29.0
- '@tanstack/router-core': 1.171.13
- '@tanstack/router-utils': 1.162.2([email protected])
- '@tanstack/virtual-file-routes': 1.162.0
- jiti: 2.7.0
- magic-string: 0.30.21
- prettier: 3.8.1
- zod: 4.4.3
- transitivePeerDependencies:
- - supports-color
+ '@rollup/[email protected]':
+ optional: true
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/template': 7.28.6
- '@babel/types': 7.29.0
- '@tanstack/router-core': 1.171.13
- '@tanstack/router-generator': 1.167.17([email protected])
- '@tanstack/router-utils': 1.162.2([email protected])
- chokidar: 5.0.0
- unplugin: 3.0.0
- zod: 4.4.3
- optionalDependencies:
- '@tanstack/react-router': 1.170.15([email protected]([email protected]))([email protected])
- transitivePeerDependencies:
- - supports-color
+ '@rollup/[email protected]':
+ optional: true
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/template': 7.28.6
- '@babel/types': 7.29.0
- '@tanstack/router-core': 1.171.13
- '@tanstack/router-generator': 1.167.17([email protected])
- '@tanstack/router-utils': 1.162.2([email protected])
- chokidar: 5.0.0
- unplugin: 3.0.0
- zod: 4.4.3
- optionalDependencies:
- '@tanstack/react-router': 1.170.15([email protected]([email protected]))([email protected])
- transitivePeerDependencies:
- - supports-color
+ '@rollup/[email protected]':
+ optional: true
- dependencies:
- '@babel/generator': 7.29.1
- '@babel/parser': 7.29.0
- '@babel/types': 7.29.7
- ansis: 4.3.1
- babel-dead-code-elimination: 1.0.12([email protected])
- diff: 8.0.4
- pathe: 2.0.3
- tinyglobby: 0.2.15
- transitivePeerDependencies:
- - supports-color
+ '@rollup/[email protected]':
+ optional: true
- '@tanstack/[email protected]': {}
+ '@rollup/[email protected]':
+ optional: true
- '@tanstack/[email protected]': {}
+ '@rollup/[email protected]':
+ optional: true
- '@tanstack/[email protected]': {}
+ '@rollup/[email protected]':
+ optional: true
- '@testing-library/[email protected]':
- dependencies:
- '@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
- lz-string: 1.5.0
- picocolors: 1.1.1
- pretty-format: 27.5.1
+ '@rollup/[email protected]':
+ optional: true
- '@testing-library/[email protected]':
+ '@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
+
+ '@sentry/[email protected]': {}
+
+ '@sentry/[email protected]':
dependencies:
- '@adobe/css-tools': 4.4.4
- aria-query: 5.3.2
- css.escape: 1.5.1
- dom-accessibility-api: 0.6.3
- picocolors: 1.1.1
- redent: 3.0.0
+ '@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])([email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))':
dependencies:
- jest-matcher-utils: 30.4.1
- picocolors: 1.1.1
- pretty-format: 30.4.1
- react: 19.2.6
- react-test-renderer: 19.2.6([email protected])
- redent: 3.0.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:
- jest: 30.4.2(@types/[email protected])([email protected])
+ '@opentelemetry/api': 1.9.1
+ '@opentelemetry/core': 2.10.0(@opentelemetry/[email protected])
+ '@opentelemetry/exporter-trace-otlp-http': 0.208.0(@opentelemetry/[email protected])
+ '@opentelemetry/instrumentation': 0.220.0(@opentelemetry/[email protected])([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]))([email protected])':
+ dependencies:
+ '@opentelemetry/api': 1.9.1
+ '@opentelemetry/instrumentation': 0.220.0(@opentelemetry/[email protected])([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])([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([email protected])
+ 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]))':
dependencies:
- '@babel/runtime': 7.28.6
- '@testing-library/dom': 10.4.1
- react: 19.2.6
- react-dom: 19.2.6([email protected])
- optionalDependencies:
- '@types/react': 19.2.17
- '@types/react-dom': 19.2.3(@types/[email protected])
+ '@opentelemetry/api': 1.9.1
+ '@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
- '@testing-library/[email protected](@testing-library/[email protected])':
dependencies:
- '@testing-library/dom': 10.4.1
+ '@apm-js-collab/code-transformer-bundler-plugins': 0.7.1
+ '@apm-js-collab/tracing-hooks': 0.13.0([email protected])
+ '@sentry/conventions': 0.16.0
+ '@sentry/core': 10.68.0
+ meriyah: 6.1.4
+ transitivePeerDependencies:
+ - supports-color
- dependencies:
- '@tiptap/pm': 3.19.0
+ '@shaderfrog/[email protected]': {}
+ '@shikijs/[email protected]':
dependencies:
- '@tiptap/core': 3.19.0(@tiptap/[email protected])
+ '@shikijs/types': 3.23.0
+ '@shikijs/vscode-textmate': 10.0.2
+ '@types/hast': 3.0.4
+ hast-util-to-html: 9.0.5
+ '@shikijs/[email protected]':
dependencies:
- '@tiptap/core': 3.19.0(@tiptap/[email protected])
+ '@shikijs/types': 3.23.0
+ '@shikijs/vscode-textmate': 10.0.2
+ oniguruma-to-es: 4.3.5
+ '@shikijs/[email protected]':
dependencies:
- '@floating-ui/dom': 1.7.5
- '@tiptap/core': 3.19.0(@tiptap/[email protected])
- '@tiptap/pm': 3.19.0
- optional: true
+ '@shikijs/types': 3.23.0
+ '@shikijs/vscode-textmate': 10.0.2
+ '@shikijs/[email protected]':
dependencies:
- '@tiptap/extension-list': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])
+ '@shikijs/types': 3.23.0
+ '@shikijs/[email protected]':
dependencies:
- '@tiptap/core': 3.19.0(@tiptap/[email protected])
- '@tiptap/pm': 3.19.0
+ '@shikijs/types': 3.23.0
+ '@shikijs/[email protected]':
dependencies:
- '@tiptap/core': 3.19.0(@tiptap/[email protected])
+ '@shikijs/core': 3.23.0
+ '@shikijs/types': 3.23.0
+ '@shikijs/[email protected]':
dependencies:
- '@tiptap/core': 3.19.0(@tiptap/[email protected])
+ '@shikijs/vscode-textmate': 10.0.2
+ '@types/hast': 3.0.4
- dependencies:
- '@tiptap/extensions': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])
+ '@shikijs/[email protected]': {}
+ '@sideway/[email protected]':
dependencies:
- '@floating-ui/dom': 1.7.6
- '@tiptap/core': 3.19.0(@tiptap/[email protected])
- '@tiptap/pm': 3.19.0
- optional: true
+ '@hapi/hoek': 9.3.0
- dependencies:
- '@tiptap/extensions': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])
+ '@sideway/[email protected]': {}
- dependencies:
- '@tiptap/core': 3.19.0(@tiptap/[email protected])
+ '@sideway/[email protected]': {}
- dependencies:
- '@tiptap/core': 3.19.0(@tiptap/[email protected])
+ '@silvia-odwyer/[email protected]': {}
+ '@sinclair/[email protected]':
dependencies:
- '@tiptap/core': 3.19.0(@tiptap/[email protected])
- '@tiptap/pm': 3.19.0
+ '@sinclair/typebox': 0.33.22
+ prettier: 2.8.8
+ typescript: 5.9.3
- dependencies:
- '@tiptap/core': 3.19.0(@tiptap/[email protected])
+ '@sinclair/[email protected]': {}
- dependencies:
- '@tiptap/core': 3.19.0(@tiptap/[email protected])
- '@tiptap/pm': 3.19.0
- linkifyjs: 4.3.2
+ '@sinclair/[email protected]': {}
- dependencies:
- '@tiptap/extension-list': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])
+ '@sindresorhus/[email protected]': {}
+ '@sinonjs/[email protected]':
dependencies:
- '@tiptap/extension-list': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])
+ type-detect: 4.0.8
+ '@sinonjs/[email protected]':
dependencies:
- '@tiptap/core': 3.19.0(@tiptap/[email protected])
- '@tiptap/pm': 3.19.0
+ '@sinonjs/commons': 3.0.1
+ '@smithy/[email protected]':
dependencies:
- '@tiptap/core': 3.19.0(@tiptap/[email protected])
- '@tiptap/pm': 3.19.0
- '@tiptap/suggestion': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])
+ '@smithy/types': 4.19.0
+ tslib: 2.8.1
+ '@smithy/[email protected]':
dependencies:
- '@tiptap/extension-list': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])
+ '@smithy/core': 3.35.1
+ '@smithy/types': 4.19.0
+ tslib: 2.8.1
+ '@smithy/[email protected]':
dependencies:
- '@tiptap/core': 3.19.0(@tiptap/[email protected])
+ '@smithy/core': 3.35.1
+ '@smithy/types': 4.19.0
+ tslib: 2.8.1
+ '@smithy/[email protected]':
dependencies:
- '@tiptap/extensions': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])
+ '@smithy/core': 3.35.1
+ '@smithy/types': 4.19.0
+ tslib: 2.8.1
+ '@smithy/[email protected]':
dependencies:
- '@tiptap/core': 3.19.0(@tiptap/[email protected])
+ '@smithy/core': 3.35.1
+ '@smithy/types': 4.19.0
+ tslib: 2.8.1
+ '@smithy/[email protected]':
dependencies:
- '@tiptap/core': 3.19.0(@tiptap/[email protected])
+ tslib: 2.8.1
- dependencies:
- '@tiptap/core': 3.19.0(@tiptap/[email protected])
+ '@stablelib/[email protected]': {}
- dependencies:
- '@tiptap/core': 3.19.0(@tiptap/[email protected])
- '@tiptap/pm': 3.19.0
+ '@standard-schema/[email protected]': {}
- '@tiptap/[email protected]':
dependencies:
- prosemirror-changeset: 2.3.1
- prosemirror-collab: 1.3.1
- prosemirror-commands: 1.7.1
- prosemirror-dropcursor: 1.8.2
- prosemirror-gapcursor: 1.4.0
- prosemirror-history: 1.5.0
- prosemirror-inputrules: 1.5.1
- prosemirror-keymap: 1.2.3
- prosemirror-markdown: 1.13.3
- prosemirror-menu: 1.2.5
- prosemirror-model: 1.25.4
- prosemirror-schema-basic: 1.2.4
- prosemirror-schema-list: 1.5.1
- prosemirror-state: 1.4.4
- prosemirror-tables: 1.8.5
- prosemirror-trailing-node: 3.0.0([email protected])([email protected])([email protected])
- prosemirror-transform: 1.11.0
- prosemirror-view: 1.41.5
+ '@storybook/global': 5.0.0
+ axe-core: 4.11.1
dependencies:
- '@tiptap/core': 3.19.0(@tiptap/[email protected])
- '@tiptap/pm': 3.19.0
- '@types/react': 19.2.17
- '@types/react-dom': 19.2.3(@types/[email protected])
- '@types/use-sync-external-store': 0.0.6
- fast-equals: 5.4.0
+ '@mdx-js/react': 3.1.1(@types/[email protected])([email protected])
react: 19.2.6
react-dom: 19.2.6([email protected])
- use-sync-external-store: 1.6.0([email protected])
+ ts-dedent: 2.2.0
optionalDependencies:
- '@tiptap/extension-bubble-menu': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])
- '@tiptap/extension-floating-menu': 3.19.0(@floating-ui/[email protected])(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])
+ '@types/react': 19.2.17
transitivePeerDependencies:
- - '@floating-ui/dom'
+ - '@types/react-dom'
+ - esbuild
+ - rollup
+ - vite
+ - webpack
- '@tiptap/[email protected]':
dependencies:
- '@tiptap/core': 3.19.0(@tiptap/[email protected])
- '@tiptap/extension-blockquote': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))
- '@tiptap/extension-bold': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))
- '@tiptap/extension-bullet-list': 3.19.0(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))
- '@tiptap/extension-code': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))
- '@tiptap/extension-code-block': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])
- '@tiptap/extension-document': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))
- '@tiptap/extension-dropcursor': 3.19.0(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))
- '@tiptap/extension-gapcursor': 3.19.0(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))
- '@tiptap/extension-hard-break': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))
- '@tiptap/extension-heading': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))
- '@tiptap/extension-horizontal-rule': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])
- '@tiptap/extension-italic': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))
- '@tiptap/extension-link': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])
- '@tiptap/extension-list': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])
- '@tiptap/extension-list-item': 3.19.0(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))
- '@tiptap/extension-list-keymap': 3.19.0(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))
- '@tiptap/extension-ordered-list': 3.19.0(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))
- '@tiptap/extension-paragraph': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))
- '@tiptap/extension-strike': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))
- '@tiptap/extension-text': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))
- '@tiptap/extension-underline': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))
- '@tiptap/extensions': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])
- '@tiptap/pm': 3.19.0
+ ts-dedent: 2.2.0
+ transitivePeerDependencies:
+ - esbuild
+ - rollup
+ - webpack
+
+ dependencies:
+ ts-dedent: 2.2.0
+ transitivePeerDependencies:
+ - esbuild
+ - rollup
+ - webpack
dependencies:
- '@tiptap/core': 3.19.0(@tiptap/[email protected])
- '@tiptap/pm': 3.19.0
+ unplugin: 2.3.11
+ optionalDependencies:
+ esbuild: 0.27.7
+ rollup: 4.59.0
dependencies:
- debug: 4.4.3([email protected])
- token-types: 6.1.2
- transitivePeerDependencies:
- - supports-color
+ unplugin: 2.3.11
+ optionalDependencies:
+ esbuild: 0.27.7
+ rollup: 4.59.0
- '@tokenizer/[email protected]': {}
+ '@storybook/[email protected]': {}
dependencies:
- '@trpc/server': 11.17.0([email protected])
- typescript: 5.9.3
+ react: 19.2.6
+ react-dom: 19.2.6([email protected])
dependencies:
- '@trpc/server': 11.9.0([email protected])
- typescript: 5.9.3
+ react: 19.2.6
+ react-dom: 19.2.6([email protected])
+ optionalDependencies:
+ '@types/react': 19.2.17
+ '@types/react-dom': 19.2.3(@types/[email protected])
dependencies:
- typescript: 5.9.3
+ '@rollup/pluginutils': 5.3.0([email protected])
+ empathic: 2.0.0
+ magic-string: 0.30.21
+ react: 19.2.6
+ react-docgen: 8.0.2([email protected])
+ react-dom: 19.2.6([email protected])
+ resolve: 1.22.11
+ tsconfig-paths: 4.2.0
+ transitivePeerDependencies:
+ - '@types/react'
+ - '@types/react-dom'
+ - esbuild
+ - rollup
+ - supports-color
+ - typescript
+ - webpack
dependencies:
- typescript: 5.9.3
+ '@rollup/pluginutils': 5.3.0([email protected])
+ empathic: 2.0.0
+ magic-string: 0.30.21
+ react: 19.2.6
+ react-docgen: 8.0.2([email protected])
+ react-dom: 19.2.6([email protected])
+ resolve: 1.22.11
+ tsconfig-paths: 4.2.0
+ transitivePeerDependencies:
+ - '@types/react'
+ - '@types/react-dom'
+ - esbuild
+ - rollup
+ - supports-color
+ - typescript
+ - webpack
dependencies:
- '@tanstack/react-query': 5.101.0([email protected])
- '@trpc/client': 11.17.0(@trpc/[email protected]([email protected]))([email protected])
- '@trpc/server': 11.17.0([email protected])
+ '@storybook/global': 5.0.0
react: 19.2.6
+ react-docgen: 8.0.2([email protected])
+ react-docgen-typescript: 2.4.0([email protected])
+ react-dom: 19.2.6([email protected])
+ optionalDependencies:
+ '@types/react': 19.2.17
+ '@types/react-dom': 19.2.3(@types/[email protected])
typescript: 5.9.3
+ transitivePeerDependencies:
+ - supports-color
- '@turbo/[email protected]':
- optional: true
+ dependencies:
+ '@babel/core': 7.29.0([email protected])
+ '@babel/generator': 7.29.1
+ '@babel/template': 7.28.6
+ '@babel/types': 7.29.7
+ '@jest/types': 30.4.1
+ '@swc/core': 1.15.43
+ '@swc/jest': 0.2.39(@swc/[email protected])
+ expect-playwright: 0.8.0
+ jest-circus: 30.4.2([email protected])
+ jest-environment-node: 30.4.1
+ jest-junit: 16.0.0
+ jest-runner: 30.4.2([email protected])
+ jest-serializer-html: 7.1.0
+ nyc: 15.1.0([email protected])
+ playwright: 1.60.0
+ playwright-core: 1.60.0
+ rimraf: 3.0.2
+ uuid: 8.3.2
+ transitivePeerDependencies:
+ - '@swc/helpers'
+ - '@types/node'
+ - babel-plugin-macros
+ - debug
+ - esbuild-register
+ - node-notifier
+ - supports-color
+ - ts-node
- '@turbo/[email protected]':
optional: true
- '@turbo/[email protected]':
optional: true
- '@turbo/[email protected]':
optional: true
- '@turbo/[email protected]':
optional: true
- '@turbo/[email protected]':
optional: true
- '@tybys/[email protected]':
- dependencies:
- tslib: 2.8.1
optional: true
- '@tybys/[email protected]':
- dependencies:
- tslib: 2.8.1
optional: true
- '@tybys/[email protected]':
- dependencies:
- tslib: 2.8.1
optional: true
- '@types/[email protected]': {}
-
- '@types/[email protected]':
- dependencies:
- '@babel/parser': 7.29.0
- '@babel/types': 7.29.0
- '@types/babel__generator': 7.27.0
- '@types/babel__template': 7.4.4
- '@types/babel__traverse': 7.28.0
-
- '@types/[email protected]':
- dependencies:
- '@babel/types': 7.29.7
-
- '@types/[email protected]':
- dependencies:
- '@babel/parser': 7.29.0
- '@babel/types': 7.29.7
-
- '@types/[email protected]':
- dependencies:
- '@babel/types': 7.29.7
-
- '@types/[email protected]':
- dependencies:
- '@types/node': 24.12.0
-
- '@types/[email protected]':
- dependencies:
- '@types/http-cache-semantics': 4.2.0
- '@types/keyv': 3.1.4
- '@types/node': 24.13.3
- '@types/responselike': 1.0.3
-
- '@types/[email protected]': {}
-
- '@types/[email protected]':
- dependencies:
- '@types/deep-eql': 4.0.2
- assertion-error: 2.0.1
-
- '@types/[email protected]': {}
-
- '@types/[email protected]':
- dependencies:
- '@types/d3-selection': 3.0.11
-
- '@types/[email protected]':
- dependencies:
- '@types/d3-selection': 3.0.11
-
- '@types/[email protected]': {}
-
- '@types/[email protected]': {}
-
- '@types/[email protected]':
- dependencies:
- '@types/d3-array': 3.2.2
- '@types/geojson': 7946.0.16
-
- '@types/[email protected]': {}
-
- '@types/[email protected]': {}
+ optional: true
- '@types/[email protected]':
- dependencies:
- '@types/d3-selection': 3.0.11
+ optional: true
- '@types/[email protected]': {}
+ optional: true
- '@types/[email protected]': {}
+ optional: true
- '@types/[email protected]':
dependencies:
- '@types/d3-dsv': 3.0.7
-
- '@types/[email protected]': {}
+ '@swc/counter': 0.1.3
+ '@swc/types': 0.1.27
+ optionalDependencies:
+ '@swc/core-darwin-arm64': 1.15.43
+ '@swc/core-darwin-x64': 1.15.43
+ '@swc/core-linux-arm-gnueabihf': 1.15.43
+ '@swc/core-linux-arm64-gnu': 1.15.43
+ '@swc/core-linux-arm64-musl': 1.15.43
+ '@swc/core-linux-ppc64-gnu': 1.15.43
+ '@swc/core-linux-s390x-gnu': 1.15.43
+ '@swc/core-linux-x64-gnu': 1.15.43
+ '@swc/core-linux-x64-musl': 1.15.43
+ '@swc/core-win32-arm64-msvc': 1.15.43
+ '@swc/core-win32-ia32-msvc': 1.15.43
+ '@swc/core-win32-x64-msvc': 1.15.43
- '@types/[email protected]': {}
+ '@swc/[email protected]': {}
- '@types/[email protected]':
dependencies:
- '@types/geojson': 7946.0.16
-
- '@types/[email protected]': {}
+ '@jest/create-cache-key-function': 30.4.1
+ '@swc/core': 1.15.43
+ '@swc/counter': 0.1.3
+ jsonc-parser: 3.3.1
- '@types/[email protected]':
dependencies:
- '@types/d3-color': 3.1.3
-
- '@types/[email protected]': {}
-
- '@types/[email protected]': {}
-
- '@types/[email protected]': {}
-
- '@types/[email protected]': {}
-
- '@types/[email protected]': {}
+ '@swc/counter': 0.1.3
- '@types/[email protected]':
+ '@szmarczak/[email protected]':
dependencies:
- '@types/d3-time': 3.0.4
-
- '@types/[email protected]': {}
+ defer-to-connect: 2.0.1
- '@types/[email protected]':
+ '@tailwindcss/[email protected]':
dependencies:
- '@types/d3-path': 3.1.1
+ '@jridgewell/remapping': 2.3.5
+ enhanced-resolve: 5.19.0
+ jiti: 2.7.0
+ lightningcss: 1.32.0
+ magic-string: 0.30.21
+ source-map-js: 1.2.1
+ tailwindcss: 4.2.2
- '@types/[email protected]': {}
+ '@tailwindcss/[email protected]':
+ dependencies:
+ '@jridgewell/remapping': 2.3.5
+ enhanced-resolve: 5.21.6
+ jiti: 2.7.0
+ lightningcss: 1.32.0
+ magic-string: 0.30.21
+ source-map-js: 1.2.1
+ tailwindcss: 4.3.1
- '@types/[email protected]': {}
+ '@tailwindcss/[email protected]':
+ optional: true
- '@types/[email protected]': {}
+ '@tailwindcss/[email protected]':
+ optional: true
- '@types/[email protected]':
- dependencies:
- '@types/d3-selection': 3.0.11
+ '@tailwindcss/[email protected]':
+ optional: true
- '@types/[email protected]':
- dependencies:
- '@types/d3-interpolate': 3.0.4
- '@types/d3-selection': 3.0.11
+ '@tailwindcss/[email protected]':
+ optional: true
- '@types/[email protected]':
- dependencies:
- '@types/d3-array': 3.2.2
- '@types/d3-axis': 3.0.6
- '@types/d3-brush': 3.0.6
- '@types/d3-chord': 3.0.6
- '@types/d3-color': 3.1.3
- '@types/d3-contour': 3.0.6
- '@types/d3-delaunay': 6.0.4
- '@types/d3-dispatch': 3.0.7
- '@types/d3-drag': 3.0.7
- '@types/d3-dsv': 3.0.7
- '@types/d3-ease': 3.0.2
- '@types/d3-fetch': 3.0.7
- '@types/d3-force': 3.0.10
- '@types/d3-format': 3.0.4
- '@types/d3-geo': 3.1.1
- '@types/d3-hierarchy': 3.1.7
- '@types/d3-interpolate': 3.0.4
- '@types/d3-path': 3.1.1
- '@types/d3-polygon': 3.0.2
- '@types/d3-quadtree': 3.0.6
- '@types/d3-random': 3.0.4
- '@types/d3-scale': 4.0.9
- '@types/d3-scale-chromatic': 3.1.0
- '@types/d3-selection': 3.0.11
- '@types/d3-shape': 3.2.0
- '@types/d3-time': 3.0.4
- '@types/d3-time-format': 4.0.3
- '@types/d3-timer': 3.0.2
- '@types/d3-transition': 3.0.9
- '@types/d3-zoom': 3.0.8
+ '@tailwindcss/[email protected]':
+ optional: true
- '@types/[email protected]':
- dependencies:
- '@types/ms': 2.1.0
+ '@tailwindcss/[email protected]':
+ optional: true
- '@types/[email protected]': {}
+ '@tailwindcss/[email protected]':
+ optional: true
- '@types/[email protected]': {}
+ '@tailwindcss/[email protected]':
+ optional: true
- '@types/[email protected]': {}
+ '@tailwindcss/[email protected]':
+ optional: true
- '@types/[email protected]': {}
+ '@tailwindcss/[email protected]':
+ optional: true
- '@types/[email protected]':
- dependencies:
- '@types/eslint': 9.6.1
- '@types/estree': 1.0.9
+ '@tailwindcss/[email protected]':
optional: true
- '@types/[email protected]':
- dependencies:
- '@types/estree': 1.0.9
- '@types/json-schema': 7.0.15
+ '@tailwindcss/[email protected]':
optional: true
- '@types/[email protected]': {}
+ '@tailwindcss/[email protected]':
+ optional: true
- '@types/[email protected]':
- dependencies:
- '@types/estree': 1.0.9
+ '@tailwindcss/[email protected]':
+ optional: true
- '@types/[email protected]': {}
+ '@tailwindcss/[email protected]':
+ optional: true
- '@types/[email protected]': {}
+ '@tailwindcss/[email protected]':
+ optional: true
- '@types/[email protected]':
- dependencies:
- '@types/node': 24.13.3
+ '@tailwindcss/[email protected]':
+ optional: true
- '@types/[email protected]': {}
+ '@tailwindcss/[email protected]':
+ optional: true
- '@types/[email protected]': {}
+ '@tailwindcss/[email protected]':
+ optional: true
- '@types/[email protected]':
- dependencies:
- '@types/unist': 3.0.3
+ '@tailwindcss/[email protected]':
+ optional: true
- '@types/[email protected]': {}
+ '@tailwindcss/[email protected]':
+ optional: true
- '@types/[email protected]': {}
+ '@tailwindcss/[email protected]':
+ optional: true
- '@types/[email protected]':
- dependencies:
- '@types/istanbul-lib-coverage': 2.0.6
+ '@tailwindcss/[email protected]':
+ optional: true
- '@types/[email protected]':
- dependencies:
- '@types/istanbul-lib-report': 3.0.3
+ '@tailwindcss/[email protected]':
+ optional: true
- '@types/[email protected]': {}
+ '@tailwindcss/[email protected]':
+ optionalDependencies:
+ '@tailwindcss/oxide-android-arm64': 4.2.2
+ '@tailwindcss/oxide-darwin-arm64': 4.2.2
+ '@tailwindcss/oxide-darwin-x64': 4.2.2
+ '@tailwindcss/oxide-freebsd-x64': 4.2.2
+ '@tailwindcss/oxide-linux-arm-gnueabihf': 4.2.2
+ '@tailwindcss/oxide-linux-arm64-gnu': 4.2.2
+ '@tailwindcss/oxide-linux-arm64-musl': 4.2.2
+ '@tailwindcss/oxide-linux-x64-gnu': 4.2.2
+ '@tailwindcss/oxide-linux-x64-musl': 4.2.2
+ '@tailwindcss/oxide-wasm32-wasi': 4.2.2
+ '@tailwindcss/oxide-win32-arm64-msvc': 4.2.2
+ '@tailwindcss/oxide-win32-x64-msvc': 4.2.2
- '@types/[email protected]':
- dependencies:
- '@types/jest': 30.0.0
- '@types/pixelmatch': 5.2.6
- ssim.js: 3.5.0
+ '@tailwindcss/[email protected]':
+ optionalDependencies:
+ '@tailwindcss/oxide-android-arm64': 4.3.1
+ '@tailwindcss/oxide-darwin-arm64': 4.3.1
+ '@tailwindcss/oxide-darwin-x64': 4.3.1
+ '@tailwindcss/oxide-freebsd-x64': 4.3.1
+ '@tailwindcss/oxide-linux-arm-gnueabihf': 4.3.1
+ '@tailwindcss/oxide-linux-arm64-gnu': 4.3.1
+ '@tailwindcss/oxide-linux-arm64-musl': 4.3.1
+ '@tailwindcss/oxide-linux-x64-gnu': 4.3.1
+ '@tailwindcss/oxide-linux-x64-musl': 4.3.1
+ '@tailwindcss/oxide-wasm32-wasi': 4.3.1
+ '@tailwindcss/oxide-win32-arm64-msvc': 4.3.1
+ '@tailwindcss/oxide-win32-x64-msvc': 4.3.1
- '@types/[email protected]':
dependencies:
- expect: 30.4.1
- pretty-format: 30.4.1
-
- '@types/[email protected]': {}
+ '@tailwindcss/node': 4.2.2
+ '@tailwindcss/oxide': 4.2.2
+ tailwindcss: 4.2.2
- '@types/[email protected]':
dependencies:
- '@types/node': 24.13.3
-
- '@types/[email protected]': {}
+ '@tailwindcss/node': 4.3.1
+ '@tailwindcss/oxide': 4.3.1
+ tailwindcss: 4.3.1
- '@types/[email protected]':
+ '@tanstack/[email protected]':
dependencies:
- '@types/linkify-it': 5.0.0
- '@types/mdurl': 2.0.0
+ '@tanstack/devtools-event-client': 0.5.0
- '@types/[email protected]':
+ '@tanstack/[email protected]':
dependencies:
- '@types/unist': 3.0.3
-
- '@types/[email protected]': {}
+ ws: 8.21.0
+ transitivePeerDependencies:
+ - bufferutil
+ - utf-8-validate
- '@types/[email protected]': {}
+ '@tanstack/[email protected]': {}
- '@types/[email protected]': {}
+ dependencies:
+ '@tanstack/devtools-client': 0.0.8
+ '@tanstack/devtools-event-bus': 0.4.2
+ chalk: 5.6.2
+ launch-editor: 2.14.1
+ 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'
+ - bufferutil
+ - utf-8-validate
- '@types/[email protected]': {}
+ '@tanstack/[email protected]': {}
- '@types/[email protected]':
- dependencies:
- undici-types: 6.21.0
+ '@tanstack/[email protected]': {}
- '@types/[email protected]':
dependencies:
- undici-types: 7.16.0
+ '@tanstack/query-core': 5.101.0
+ react: 19.2.6
- '@types/[email protected]':
dependencies:
- undici-types: 7.18.2
+ '@tanstack/react-router': 1.170.15([email protected]([email protected]))([email protected])
+ '@tanstack/router-devtools-core': 1.168.0(@tanstack/[email protected])([email protected])
+ react: 19.2.6
+ react-dom: 19.2.6([email protected])
+ optionalDependencies:
+ '@tanstack/router-core': 1.171.13
+ transitivePeerDependencies:
+ - csstype
- '@types/[email protected]':
dependencies:
- undici-types: 7.16.0
- optional: true
+ '@tanstack/history': 1.162.0
+ '@tanstack/react-store': 0.9.3([email protected]([email protected]))([email protected])
+ '@tanstack/router-core': 1.171.13
+ isbot: 5.1.40
+ react: 19.2.6
+ react-dom: 19.2.6([email protected])
- '@types/[email protected]':
dependencies:
- '@types/node': 24.12.0
+ '@tanstack/store': 0.9.3
+ react: 19.2.6
+ react-dom: 19.2.6([email protected])
+ use-sync-external-store: 1.6.0([email protected])
dependencies:
- '@types/react': 19.2.17
+ '@tanstack/virtual-core': 3.17.0
+ react: 19.2.6
+ react-dom: 19.2.6([email protected])
- '@types/[email protected]':
+ '@tanstack/[email protected]':
dependencies:
- '@types/react': 19.2.17
+ '@tanstack/history': 1.162.0
+ cookie-es: 3.1.1
+ seroval: 1.5.6
+ seroval-plugins: 1.5.6([email protected])
- '@types/[email protected]':
dependencies:
+ '@tanstack/router-core': 1.171.13
+ clsx: 2.1.1
+ goober: 2.1.19([email protected])
+ optionalDependencies:
csstype: 3.2.3
- '@types/[email protected]': {}
-
- '@types/[email protected]':
dependencies:
- '@types/node': 24.13.3
-
- '@types/[email protected]': {}
-
- '@types/[email protected]': {}
-
- '@types/[email protected]': {}
-
- '@types/[email protected]':
- optional: true
-
- '@types/[email protected]':
- optional: true
-
- '@types/[email protected]': {}
-
- '@types/[email protected]': {}
-
- '@types/[email protected]': {}
-
- '@types/[email protected]': {}
+ '@babel/types': 7.29.0
+ '@tanstack/router-core': 1.171.13
+ '@tanstack/router-utils': 1.162.2([email protected])
+ '@tanstack/virtual-file-routes': 1.162.0
+ jiti: 2.7.0
+ magic-string: 0.30.21
+ prettier: 3.8.1
+ zod: 4.4.3
+ transitivePeerDependencies:
+ - supports-color
- '@types/[email protected]':
dependencies:
- '@types/node': 24.13.3
-
- '@types/[email protected]': {}
+ '@babel/core': 7.29.0([email protected])
+ '@babel/template': 7.28.6
+ '@babel/types': 7.29.0
+ '@tanstack/router-core': 1.171.13
+ '@tanstack/router-generator': 1.167.17([email protected])
+ '@tanstack/router-utils': 1.162.2([email protected])
+ chokidar: 5.0.0
+ unplugin: 3.0.0
+ zod: 4.4.3
+ optionalDependencies:
+ '@tanstack/react-router': 1.170.15([email protected]([email protected]))([email protected])
+ transitivePeerDependencies:
+ - supports-color
- '@types/[email protected]':
dependencies:
- '@types/yargs-parser': 21.0.3
-
- '@typescript-eslint/[email protected]': {}
-
- '@typescript/[email protected]':
- optional: true
-
- '@typescript/[email protected]':
- optional: true
-
- '@typescript/[email protected]':
- optional: true
-
- '@typescript/[email protected]':
- optional: true
-
- '@typescript/[email protected]':
- optional: true
-
- '@typescript/[email protected]':
- optional: true
-
- '@typescript/[email protected]':
- optional: true
-
- '@typescript/[email protected]':
+ '@babel/core': 7.29.0([email protected])
+ '@babel/template': 7.28.6
+ '@babel/types': 7.29.0
+ '@tanstack/router-core': 1.171.13
+ '@tanstack/router-generator': 1.167.17([email protected])
+ '@tanstack/router-utils': 1.162.2([email protected])
+ chokidar: 5.0.0
+ unplugin: 3.0.0
+ zod: 4.4.3
optionalDependencies:
- '@typescript/native-preview-darwin-arm64': 7.0.0-dev.20260707.2
- '@typescript/native-preview-darwin-x64': 7.0.0-dev.20260707.2
- '@typescript/native-preview-linux-arm': 7.0.0-dev.20260707.2
- '@typescript/native-preview-linux-arm64': 7.0.0-dev.20260707.2
- '@typescript/native-preview-linux-x64': 7.0.0-dev.20260707.2
- '@typescript/native-preview-win32-arm64': 7.0.0-dev.20260707.2
- '@typescript/native-preview-win32-x64': 7.0.0-dev.20260707.2
-
- '@ungap/[email protected]': {}
-
- optional: true
-
- optional: true
-
- optional: true
-
- optional: true
-
- optional: true
-
- optional: true
-
- optional: true
-
- optional: true
-
- optional: true
-
- optional: true
-
- optional: true
+ '@tanstack/react-router': 1.170.15([email protected]([email protected]))([email protected])
+ transitivePeerDependencies:
+ - supports-color
- optional: true
+ dependencies:
+ '@babel/generator': 7.29.1
+ '@babel/parser': 7.29.0
+ '@babel/types': 7.29.7
+ ansis: 4.3.1
+ babel-dead-code-elimination: 1.0.12([email protected])
+ diff: 8.0.4
+ pathe: 2.0.3
+ tinyglobby: 0.2.15
+ transitivePeerDependencies:
+ - supports-color
- optional: true
+ '@tanstack/[email protected]': {}
- optional: true
+ '@tanstack/[email protected]': {}
- optional: true
+ '@tanstack/[email protected]': {}
- optional: true
+ '@testing-library/[email protected]':
+ dependencies:
+ '@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
+ lz-string: 1.5.0
+ picocolors: 1.1.1
+ pretty-format: 27.5.1
- optional: true
+ '@testing-library/[email protected]':
+ dependencies:
+ '@adobe/css-tools': 4.4.4
+ aria-query: 5.3.2
+ css.escape: 1.5.1
+ dom-accessibility-api: 0.6.3
+ picocolors: 1.1.1
+ redent: 3.0.0
- optional: true
+ dependencies:
+ '@babel/runtime': 7.28.6
+ '@testing-library/dom': 10.4.1
+ react: 19.2.6
+ react-dom: 19.2.6([email protected])
+ optionalDependencies:
+ '@types/react': 19.2.17
+ '@types/react-dom': 19.2.3(@types/[email protected])
+ '@testing-library/[email protected](@testing-library/[email protected])':
dependencies:
- '@emnapi/core': 1.10.0
- '@emnapi/runtime': 1.10.0
- '@napi-rs/wasm-runtime': 1.1.6(@emnapi/[email protected])(@emnapi/[email protected])
- optional: true
+ '@testing-library/dom': 10.4.1
- optional: true
+ dependencies:
+ '@tiptap/pm': 3.19.0
- optional: true
+ dependencies:
+ '@tiptap/core': 3.19.0(@tiptap/[email protected])
- optional: true
+ dependencies:
+ '@tiptap/core': 3.19.0(@tiptap/[email protected])
- '@upsetjs/[email protected]':
- optionalDependencies:
- d3-selection: 3.0.0
- d3-transition: 3.0.1([email protected])
+ dependencies:
+ '@floating-ui/dom': 1.7.5
+ '@tiptap/core': 3.19.0(@tiptap/[email protected])
+ '@tiptap/pm': 3.19.0
+ optional: true
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/[email protected]([email protected]))
- '@babel/plugin-transform-react-jsx-source': 7.27.1(@babel/[email protected]([email protected]))
- '@rolldown/pluginutils': 1.0.0-beta.27
- '@types/babel__core': 7.20.5
- react-refresh: 0.17.0
- transitivePeerDependencies:
- - supports-color
+ '@tiptap/extension-list': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/[email protected]([email protected]))
- '@babel/plugin-transform-react-jsx-source': 7.27.1(@babel/[email protected]([email protected]))
- '@rolldown/pluginutils': 1.0.0-beta.27
- '@types/babel__core': 7.20.5
- react-refresh: 0.17.0
- transitivePeerDependencies:
- - supports-color
+ '@tiptap/core': 3.19.0(@tiptap/[email protected])
+ '@tiptap/pm': 3.19.0
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/[email protected]([email protected]))
- '@babel/plugin-transform-react-jsx-source': 7.27.1(@babel/[email protected]([email protected]))
- '@rolldown/pluginutils': 1.0.0-rc.3
- '@types/babel__core': 7.20.5
- react-refresh: 0.18.0
- transitivePeerDependencies:
- - supports-color
+ '@tiptap/core': 3.19.0(@tiptap/[email protected])
dependencies:
- '@bcoe/v8-coverage': 1.0.2
- '@vitest/utils': 4.1.9
- ast-v8-to-istanbul: 1.0.4
- istanbul-lib-coverage: 3.2.2
- istanbul-lib-report: 3.0.1
- istanbul-reports: 3.2.0
- magicast: 0.5.3
- obug: 2.1.1
- std-env: 4.1.0
- tinyrainbow: 3.1.0
+ '@tiptap/core': 3.19.0(@tiptap/[email protected])
- '@vitest/[email protected]':
dependencies:
- '@types/chai': 5.2.3
- '@vitest/spy': 3.2.4
- '@vitest/utils': 3.2.4
- chai: 5.3.3
- tinyrainbow: 2.0.0
+ '@tiptap/extensions': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])
- '@vitest/[email protected]':
dependencies:
- '@standard-schema/spec': 1.1.0
- '@types/chai': 5.2.3
- '@vitest/spy': 4.1.6
- '@vitest/utils': 4.1.6
- chai: 6.2.2
- tinyrainbow: 3.1.0
+ '@floating-ui/dom': 1.7.6
+ '@tiptap/core': 3.19.0(@tiptap/[email protected])
+ '@tiptap/pm': 3.19.0
+ optional: true
- '@vitest/[email protected]':
dependencies:
- '@standard-schema/spec': 1.1.0
- '@types/chai': 5.2.3
- '@vitest/spy': 4.1.8
- '@vitest/utils': 4.1.8
- chai: 6.2.2
- tinyrainbow: 3.1.0
+ '@tiptap/extensions': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])
dependencies:
- '@vitest/spy': 4.1.6
- estree-walker: 3.0.3
- magic-string: 0.30.21
- optionalDependencies:
- msw: 2.12.8(@types/[email protected])([email protected])
+ '@tiptap/core': 3.19.0(@tiptap/[email protected])
dependencies:
- '@vitest/spy': 4.1.8
- estree-walker: 3.0.3
- magic-string: 0.30.21
- optionalDependencies:
- msw: 2.12.8(@types/[email protected])([email protected])
+ '@tiptap/core': 3.19.0(@tiptap/[email protected])
dependencies:
- '@vitest/spy': 4.1.8
- estree-walker: 3.0.3
- magic-string: 0.30.21
- optionalDependencies:
- msw: 2.12.8(@types/[email protected])([email protected])
+ '@tiptap/core': 3.19.0(@tiptap/[email protected])
+ '@tiptap/pm': 3.19.0
dependencies:
- '@vitest/spy': 4.1.8
- estree-walker: 3.0.3
- magic-string: 0.30.21
- optionalDependencies:
- msw: 2.12.8(@types/[email protected])([email protected])
+ '@tiptap/core': 3.19.0(@tiptap/[email protected])
- '@vitest/[email protected]':
dependencies:
- tinyrainbow: 2.0.0
+ '@tiptap/core': 3.19.0(@tiptap/[email protected])
+ '@tiptap/pm': 3.19.0
+ linkifyjs: 4.3.2
- '@vitest/[email protected]':
dependencies:
- tinyrainbow: 3.1.0
+ '@tiptap/extension-list': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])
- '@vitest/[email protected]':
dependencies:
- tinyrainbow: 3.1.0
+ '@tiptap/extension-list': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])
- '@vitest/[email protected]':
dependencies:
- tinyrainbow: 3.1.0
+ '@tiptap/core': 3.19.0(@tiptap/[email protected])
+ '@tiptap/pm': 3.19.0
- '@vitest/[email protected]':
dependencies:
- '@vitest/utils': 4.1.6
- pathe: 2.0.3
+ '@tiptap/core': 3.19.0(@tiptap/[email protected])
+ '@tiptap/pm': 3.19.0
+ '@tiptap/suggestion': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])
- '@vitest/[email protected]':
dependencies:
- '@vitest/utils': 4.1.8
- pathe: 2.0.3
+ '@tiptap/extension-list': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])
- '@vitest/[email protected]':
dependencies:
- '@vitest/pretty-format': 4.1.6
- '@vitest/utils': 4.1.6
- magic-string: 0.30.21
- pathe: 2.0.3
+ '@tiptap/core': 3.19.0(@tiptap/[email protected])
- '@vitest/[email protected]':
dependencies:
- '@vitest/pretty-format': 4.1.8
- '@vitest/utils': 4.1.8
- magic-string: 0.30.21
- pathe: 2.0.3
+ '@tiptap/extensions': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])
- '@vitest/[email protected]':
dependencies:
- tinyspy: 4.0.4
+ '@tiptap/core': 3.19.0(@tiptap/[email protected])
- '@vitest/[email protected]': {}
+ dependencies:
+ '@tiptap/core': 3.19.0(@tiptap/[email protected])
- '@vitest/[email protected]': {}
+ dependencies:
+ '@tiptap/core': 3.19.0(@tiptap/[email protected])
dependencies:
- '@vitest/utils': 4.1.8
- fflate: 0.8.3
- flatted: 3.4.2
- pathe: 2.0.3
- sirv: 3.0.2
- tinyglobby: 0.2.15
- tinyrainbow: 3.1.0
+ '@tiptap/core': 3.19.0(@tiptap/[email protected])
+ '@tiptap/pm': 3.19.0
- '@vitest/[email protected]':
+ '@tiptap/[email protected]':
dependencies:
- '@vitest/pretty-format': 3.2.4
- loupe: 3.2.1
- tinyrainbow: 2.0.0
+ prosemirror-changeset: 2.3.1
+ prosemirror-collab: 1.3.1
+ prosemirror-commands: 1.7.1
+ prosemirror-dropcursor: 1.8.2
+ prosemirror-gapcursor: 1.4.0
+ prosemirror-history: 1.5.0
+ prosemirror-inputrules: 1.5.1
+ prosemirror-keymap: 1.2.3
+ prosemirror-markdown: 1.13.3
+ prosemirror-menu: 1.2.5
+ prosemirror-model: 1.25.4
+ prosemirror-schema-basic: 1.2.4
+ prosemirror-schema-list: 1.5.1
+ prosemirror-state: 1.4.4
+ prosemirror-tables: 1.8.5
+ prosemirror-trailing-node: 3.0.0([email protected])([email protected])([email protected])
+ prosemirror-transform: 1.11.0
+ prosemirror-view: 1.41.5
- '@vitest/[email protected]':
dependencies:
- '@vitest/pretty-format': 4.1.6
- convert-source-map: 2.0.0
- tinyrainbow: 3.1.0
+ '@tiptap/core': 3.19.0(@tiptap/[email protected])
+ '@tiptap/pm': 3.19.0
+ '@types/react': 19.2.17
+ '@types/react-dom': 19.2.3(@types/[email protected])
+ '@types/use-sync-external-store': 0.0.6
+ fast-equals: 5.4.0
+ react: 19.2.6
+ react-dom: 19.2.6([email protected])
+ use-sync-external-store: 1.6.0([email protected])
+ optionalDependencies:
+ '@tiptap/extension-bubble-menu': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])
+ '@tiptap/extension-floating-menu': 3.19.0(@floating-ui/[email protected])(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])
+ transitivePeerDependencies:
+ - '@floating-ui/dom'
- '@vitest/[email protected]':
+ '@tiptap/[email protected]':
dependencies:
- '@vitest/pretty-format': 4.1.8
- convert-source-map: 2.0.0
- tinyrainbow: 3.1.0
+ '@tiptap/core': 3.19.0(@tiptap/[email protected])
+ '@tiptap/extension-blockquote': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))
+ '@tiptap/extension-bold': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))
+ '@tiptap/extension-bullet-list': 3.19.0(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))
+ '@tiptap/extension-code': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))
+ '@tiptap/extension-code-block': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])
+ '@tiptap/extension-document': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))
+ '@tiptap/extension-dropcursor': 3.19.0(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))
+ '@tiptap/extension-gapcursor': 3.19.0(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))
+ '@tiptap/extension-hard-break': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))
+ '@tiptap/extension-heading': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))
+ '@tiptap/extension-horizontal-rule': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])
+ '@tiptap/extension-italic': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))
+ '@tiptap/extension-link': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])
+ '@tiptap/extension-list': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])
+ '@tiptap/extension-list-item': 3.19.0(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))
+ '@tiptap/extension-list-keymap': 3.19.0(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))
+ '@tiptap/extension-ordered-list': 3.19.0(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))
+ '@tiptap/extension-paragraph': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))
+ '@tiptap/extension-strike': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))
+ '@tiptap/extension-text': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))
+ '@tiptap/extension-underline': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))
+ '@tiptap/extensions': 3.19.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])
+ '@tiptap/pm': 3.19.0
- '@vitest/[email protected]':
dependencies:
- '@vitest/pretty-format': 4.1.9
- convert-source-map: 2.0.0
- tinyrainbow: 3.1.0
+ '@tiptap/core': 3.19.0(@tiptap/[email protected])
+ '@tiptap/pm': 3.19.0
- '@webassemblyjs/[email protected]':
dependencies:
- '@webassemblyjs/helper-numbers': 1.13.2
- '@webassemblyjs/helper-wasm-bytecode': 1.13.2
- optional: true
-
- '@webassemblyjs/[email protected]':
- optional: true
-
- '@webassemblyjs/[email protected]':
- optional: true
+ debug: 4.4.3([email protected])
+ token-types: 6.1.2
+ transitivePeerDependencies:
+ - supports-color
- '@webassemblyjs/[email protected]':
- optional: true
+ '@tokenizer/[email protected]': {}
- '@webassemblyjs/[email protected]':
dependencies:
- '@webassemblyjs/floating-point-hex-parser': 1.13.2
- '@webassemblyjs/helper-api-error': 1.13.2
- '@xtuc/long': 4.2.2
- optional: true
+ '@trpc/server': 11.17.0([email protected])
+ typescript: 5.9.3
- '@webassemblyjs/[email protected]':
- optional: true
+ dependencies:
+ '@trpc/server': 11.9.0([email protected])
+ typescript: 5.9.3
- '@webassemblyjs/[email protected]':
dependencies:
- '@webassemblyjs/ast': 1.14.1
- '@webassemblyjs/helper-buffer': 1.14.1
- '@webassemblyjs/helper-wasm-bytecode': 1.13.2
- '@webassemblyjs/wasm-gen': 1.14.1
- optional: true
+ typescript: 5.9.3
- '@webassemblyjs/[email protected]':
dependencies:
- '@xtuc/ieee754': 1.2.0
- optional: true
+ typescript: 5.9.3
- '@webassemblyjs/[email protected]':
dependencies:
- '@xtuc/long': 4.2.2
- optional: true
+ '@tanstack/react-query': 5.101.0([email protected])
+ '@trpc/client': 11.17.0(@trpc/[email protected]([email protected]))([email protected])
+ '@trpc/server': 11.17.0([email protected])
+ react: 19.2.6
+ typescript: 5.9.3
- '@webassemblyjs/[email protected]':
+ '@turbo/[email protected]':
optional: true
- '@webassemblyjs/[email protected]':
- dependencies:
- '@webassemblyjs/ast': 1.14.1
- '@webassemblyjs/helper-buffer': 1.14.1
- '@webassemblyjs/helper-wasm-bytecode': 1.13.2
- '@webassemblyjs/helper-wasm-section': 1.14.1
- '@webassemblyjs/wasm-gen': 1.14.1
- '@webassemblyjs/wasm-opt': 1.14.1
- '@webassemblyjs/wasm-parser': 1.14.1
- '@webassemblyjs/wast-printer': 1.14.1
+ '@turbo/[email protected]':
optional: true
- '@webassemblyjs/[email protected]':
- dependencies:
- '@webassemblyjs/ast': 1.14.1
- '@webassemblyjs/helper-wasm-bytecode': 1.13.2
- '@webassemblyjs/ieee754': 1.13.2
- '@webassemblyjs/leb128': 1.13.2
- '@webassemblyjs/utf8': 1.13.2
+ '@turbo/[email protected]':
optional: true
- '@webassemblyjs/[email protected]':
- dependencies:
- '@webassemblyjs/ast': 1.14.1
- '@webassemblyjs/helper-buffer': 1.14.1
- '@webassemblyjs/wasm-gen': 1.14.1
- '@webassemblyjs/wasm-parser': 1.14.1
+ '@turbo/[email protected]':
optional: true
- '@webassemblyjs/[email protected]':
- dependencies:
- '@webassemblyjs/ast': 1.14.1
- '@webassemblyjs/helper-api-error': 1.13.2
- '@webassemblyjs/helper-wasm-bytecode': 1.13.2
- '@webassemblyjs/ieee754': 1.13.2
- '@webassemblyjs/leb128': 1.13.2
- '@webassemblyjs/utf8': 1.13.2
+ '@turbo/[email protected]':
optional: true
- '@webassemblyjs/[email protected]':
- dependencies:
- '@webassemblyjs/ast': 1.14.1
- '@xtuc/long': 4.2.2
+ '@turbo/[email protected]':
optional: true
- '@webcontainer/[email protected]': {}
-
- '@webgpu/[email protected]': {}
-
- '@xmldom/[email protected]': {}
-
- dependencies:
- '@xterm/xterm': 5.5.0
-
- dependencies:
- '@xterm/xterm': 5.5.0
-
+ '@tybys/[email protected]':
dependencies:
- '@xterm/xterm': 5.5.0
+ tslib: 2.8.1
+ optional: true
+ '@tybys/[email protected]':
dependencies:
- '@xterm/xterm': 5.5.0
-
- '@xterm/[email protected]': {}
-
+ tslib: 2.8.1
optional: true
+ '@tybys/[email protected]':
+ dependencies:
+ tslib: 2.8.1
optional: true
+ '@types/[email protected]': {}
+ '@types/[email protected]':
dependencies:
- event-target-shim: 5.0.1
+ '@babel/parser': 7.29.0
+ '@babel/types': 7.29.0
+ '@types/babel__generator': 7.27.0
+ '@types/babel__template': 7.4.4
+ '@types/babel__traverse': 7.28.0
+ '@types/[email protected]':
dependencies:
- mime-types: 2.1.35
- negotiator: 0.6.3
+ '@babel/types': 7.29.7
+ '@types/[email protected]':
dependencies:
- mime-types: 3.0.2
- negotiator: 1.0.0
+ '@babel/parser': 7.29.0
+ '@babel/types': 7.29.7
+ '@types/[email protected]':
dependencies:
- acorn: 8.17.0
- optional: true
+ '@babel/types': 7.29.7
+ '@types/[email protected]':
dependencies:
- acorn: 8.17.0
-
-
-
+ '@types/node': 24.12.0
+ '@types/[email protected]':
dependencies:
- debug: 4.4.3([email protected])
- transitivePeerDependencies:
- - supports-color
-
-
-
+ '@types/http-cache-semantics': 4.2.0
+ '@types/keyv': 3.1.4
+ '@types/node': 24.13.3
+ '@types/responselike': 1.0.3
+ '@types/[email protected]': {}
+ '@types/[email protected]':
dependencies:
- '@iarna/toml': 2.2.5
- commander: 14.0.3
- jsonc-parser: 3.3.1
- picocolors: 1.1.1
- prompts: 2.4.2
- yaml: 2.9.0
+ '@types/deep-eql': 4.0.2
+ assertion-error: 2.0.1
+ '@types/[email protected]': {}
+
+ '@types/[email protected]':
dependencies:
- '@iarna/toml': 2.2.5
- commander: 14.0.3
- jsonc-parser: 3.3.1
- picocolors: 1.1.1
- prompts: 2.4.2
- yaml: 2.9.0
+ '@types/d3-selection': 3.0.11
+ '@types/[email protected]':
dependencies:
- clean-stack: 2.2.0
- indent-string: 4.0.0
+ '@types/d3-selection': 3.0.11
- optionalDependencies:
- ajv: 8.20.0
+ '@types/[email protected]': {}
- dependencies:
- ajv: 8.20.0
- optional: true
+ '@types/[email protected]': {}
+ '@types/[email protected]':
dependencies:
- ajv: 8.20.0
+ '@types/d3-array': 3.2.2
+ '@types/geojson': 7946.0.16
- dependencies:
- ajv: 8.20.0
- fast-deep-equal: 3.1.3
- optional: true
+ '@types/[email protected]': {}
- dependencies:
- fast-deep-equal: 3.1.3
- fast-json-stable-stringify: 2.1.0
- json-schema-traverse: 0.4.1
- uri-js: 4.4.1
+ '@types/[email protected]': {}
+ '@types/[email protected]':
dependencies:
- fast-deep-equal: 3.1.3
- fast-uri: 3.1.4
- json-schema-traverse: 1.0.0
- require-from-string: 2.0.2
+ '@types/d3-selection': 3.0.11
+ '@types/[email protected]': {}
- dependencies:
- type-fest: 0.21.3
+ '@types/[email protected]': {}
+ '@types/[email protected]':
dependencies:
- environment: 1.1.0
-
+ '@types/d3-dsv': 3.0.7
+ '@types/[email protected]': {}
+ '@types/[email protected]': {}
+ '@types/[email protected]':
dependencies:
- color-convert: 1.9.3
+ '@types/geojson': 7946.0.16
+ '@types/[email protected]': {}
+
+ '@types/[email protected]':
dependencies:
- color-convert: 2.0.1
+ '@types/d3-color': 3.1.3
+ '@types/[email protected]': {}
+ '@types/[email protected]': {}
+ '@types/[email protected]': {}
+ '@types/[email protected]': {}
+ '@types/[email protected]': {}
+ '@types/[email protected]':
dependencies:
- normalize-path: 3.0.0
- picomatch: 2.3.1
+ '@types/d3-time': 3.0.4
- [email protected](patch_hash=4688f96749e3d76cf27bc535d874470bf264610a331db13644df7715d699acf1)([email protected])([email protected])([email protected]):
- dependencies:
- '@electron/asar': 3.4.1
- '@electron/fuses': 1.8.0
- '@electron/get': 3.1.0([email protected])
- '@electron/notarize': 2.5.0([email protected])
- '@electron/osx-sign': 1.3.3([email protected])
- '@electron/rebuild': 4.0.4([email protected])
- '@electron/universal': 2.0.3([email protected])
- '@malept/flatpak-bundler': 0.4.0([email protected])
- '@noble/hashes': 2.2.0
- '@peculiar/webcrypto': 1.7.1
- '@types/fs-extra': 9.0.13
- ajv: 8.20.0
- asn1js: 3.0.10
- async-exit-hook: 2.0.1
- builder-util: 26.15.3([email protected])
- builder-util-runtime: 9.7.0([email protected])
- chromium-pickle-js: 0.2.0
- ci-info: 4.3.1
- debug: 4.4.3([email protected])
- dmg-builder: 26.15.3([email protected])([email protected])
- dotenv: 16.4.7
- dotenv-expand: 11.0.7
- ejs: 3.1.10
- electron-builder-squirrel-windows: 26.15.3([email protected])([email protected])
- electron-publish: 26.15.3([email protected])
- fs-extra: 10.1.0
- hosted-git-info: 4.1.0
- isbinaryfile: 5.0.7
- jiti: 2.7.0
- js-yaml: 4.1.1
- json5: 2.2.3
- lazy-val: 1.0.5
- minimatch: 10.2.5
- pkijs: 3.4.0
- plist: 3.1.0
- proper-lockfile: 4.1.2
- resedit: 1.7.2
- semver: 7.7.3
- tar: 7.5.22
- temp-file: 3.4.0
- tiny-async-pool: 1.3.0
- unzipper: 0.12.3
- which: 5.0.0
- transitivePeerDependencies:
- - supports-color
+ '@types/[email protected]': {}
+ '@types/[email protected]':
dependencies:
- default-require-extensions: 3.0.1
-
-
+ '@types/d3-path': 3.1.1
+ '@types/[email protected]': {}
- dependencies:
- sprintf-js: 1.0.3
+ '@types/[email protected]': {}
+ '@types/[email protected]': {}
+ '@types/[email protected]':
dependencies:
- tslib: 2.8.1
+ '@types/d3-selection': 3.0.11
+ '@types/[email protected]':
dependencies:
- dequal: 2.0.3
-
+ '@types/d3-interpolate': 3.0.4
+ '@types/d3-selection': 3.0.11
+ '@types/[email protected]':
dependencies:
- '@ark/util': 0.56.0
+ '@types/d3-array': 3.2.2
+ '@types/d3-axis': 3.0.6
+ '@types/d3-brush': 3.0.6
+ '@types/d3-chord': 3.0.6
+ '@types/d3-color': 3.1.3
+ '@types/d3-contour': 3.0.6
+ '@types/d3-delaunay': 6.0.4
+ '@types/d3-dispatch': 3.0.7
+ '@types/d3-drag': 3.0.7
+ '@types/d3-dsv': 3.0.7
+ '@types/d3-ease': 3.0.2
+ '@types/d3-fetch': 3.0.7
+ '@types/d3-force': 3.0.10
+ '@types/d3-format': 3.0.4
+ '@types/d3-geo': 3.1.1
+ '@types/d3-hierarchy': 3.1.7
+ '@types/d3-interpolate': 3.0.4
+ '@types/d3-path': 3.1.1
+ '@types/d3-polygon': 3.0.2
+ '@types/d3-quadtree': 3.0.6
+ '@types/d3-random': 3.0.4
+ '@types/d3-scale': 4.0.9
+ '@types/d3-scale-chromatic': 3.1.0
+ '@types/d3-selection': 3.0.11
+ '@types/d3-shape': 3.2.0
+ '@types/d3-time': 3.0.4
+ '@types/d3-time-format': 4.0.3
+ '@types/d3-timer': 3.0.2
+ '@types/d3-transition': 3.0.9
+ '@types/d3-zoom': 3.0.8
+ '@types/[email protected]':
dependencies:
- '@ark/schema': 0.56.0
- '@ark/util': 0.56.0
- arkregex: 0.0.5
-
+ '@types/ms': 2.1.0
+ '@types/[email protected]': {}
- dependencies:
- pvtsutils: 1.3.6
- pvutils: 1.1.5
- tslib: 2.8.1
+ '@types/[email protected]': {}
+ '@types/[email protected]': {}
+ '@types/[email protected]':
dependencies:
- tslib: 2.8.1
+ '@types/eslint': 9.6.1
+ '@types/estree': 1.0.9
+ optional: true
+ '@types/[email protected]':
dependencies:
- '@jridgewell/trace-mapping': 0.3.31
- estree-walker: 3.0.3
- js-tokens: 10.0.0
-
+ '@types/estree': 1.0.9
+ '@types/json-schema': 7.0.15
+ optional: true
+ '@types/[email protected]': {}
+ '@types/[email protected]':
+ dependencies:
+ '@types/estree': 1.0.9
+ '@types/[email protected]': {}
+ '@types/[email protected]': {}
+ '@types/[email protected]':
dependencies:
- stubborn-fs: 2.0.0
- when-exit: 2.1.5
+ '@types/node': 24.13.3
+ '@types/[email protected]': {}
+ '@types/[email protected]':
+ dependencies:
+ '@types/unist': 3.0.3
+ '@types/[email protected]': {}
- dependencies:
- follow-redirects: 1.16.0([email protected]([email protected]))
- form-data: 4.0.5
- https-proxy-agent: 5.0.1([email protected])
- proxy-from-env: 2.1.0
- transitivePeerDependencies:
- - debug
- - supports-color
+ '@types/[email protected]': {}
+ '@types/[email protected]':
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/parser': 7.29.7
- '@babel/traverse': 7.29.0([email protected])
- '@babel/types': 7.29.7
- transitivePeerDependencies:
- - supports-color
+ '@types/istanbul-lib-coverage': 2.0.6
+ '@types/[email protected]':
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@jest/transform': 30.4.1([email protected])
- '@types/babel__core': 7.20.5
- babel-plugin-istanbul: 7.0.1([email protected])
- babel-preset-jest: 30.4.0(@babel/[email protected]([email protected]))
- chalk: 4.1.2
- graceful-fs: 4.2.11
- slash: 3.0.0
- transitivePeerDependencies:
- - supports-color
+ '@types/istanbul-lib-report': 3.0.3
- dependencies:
- '@babel/helper-plugin-utils': 7.28.6
- '@istanbuljs/load-nyc-config': 1.1.0
- '@istanbuljs/schema': 0.1.3
- istanbul-lib-instrument: 6.0.3([email protected])
- test-exclude: 6.0.0
- transitivePeerDependencies:
- - supports-color
+ '@types/[email protected]': {}
+ '@types/[email protected]':
dependencies:
- '@types/babel__core': 7.20.5
+ '@types/jest': 30.0.0
+ '@types/pixelmatch': 5.2.6
+ ssim.js: 3.5.0
+ '@types/[email protected]':
dependencies:
- '@babel/compat-data': 7.29.0
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-define-polyfill-provider': 0.6.6(@babel/[email protected]([email protected]))([email protected])
- semver: 6.3.1
- transitivePeerDependencies:
- - supports-color
+ expect: 30.4.1
+ pretty-format: 30.4.1
- dependencies:
- '@babel/compat-data': 7.29.7
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-define-polyfill-provider': 0.6.8(@babel/[email protected]([email protected]))([email protected])
- semver: 6.3.1
- transitivePeerDependencies:
- - supports-color
+ '@types/[email protected]': {}
+ '@types/[email protected]':
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-define-polyfill-provider': 0.6.6(@babel/[email protected]([email protected]))([email protected])
- core-js-compat: 3.48.0
- transitivePeerDependencies:
- - supports-color
+ '@types/node': 24.13.3
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-define-polyfill-provider': 0.6.6(@babel/[email protected]([email protected]))([email protected])
- transitivePeerDependencies:
- - supports-color
+ '@types/[email protected]': {}
+ '@types/[email protected]':
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/helper-define-polyfill-provider': 0.6.8(@babel/[email protected]([email protected]))([email protected])
- transitivePeerDependencies:
- - supports-color
+ '@types/linkify-it': 5.0.0
+ '@types/mdurl': 2.0.0
+ '@types/[email protected]':
dependencies:
- '@babel/types': 7.29.7
+ '@types/unist': 3.0.3
+ '@types/[email protected]': {}
- dependencies:
- hermes-parser: 0.36.0
+ '@types/[email protected]': {}
+
+ '@types/[email protected]': {}
+
+ '@types/[email protected]': {}
+ '@types/[email protected]':
dependencies:
- hermes-parser: 0.36.1
+ undici-types: 6.21.0
+ '@types/[email protected]':
dependencies:
- '@babel/plugin-syntax-flow': 7.28.6(@babel/[email protected]([email protected]))
- transitivePeerDependencies:
- - '@babel/core'
+ undici-types: 7.16.0
+ '@types/[email protected]':
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/plugin-syntax-async-generators': 7.8.4(@babel/[email protected]([email protected]))
- '@babel/plugin-syntax-bigint': 7.8.3(@babel/[email protected]([email protected]))
- '@babel/plugin-syntax-class-properties': 7.12.13(@babel/[email protected]([email protected]))
- '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/[email protected]([email protected]))
- '@babel/plugin-syntax-import-attributes': 7.28.6(@babel/[email protected]([email protected]))
- '@babel/plugin-syntax-import-meta': 7.10.4(@babel/[email protected]([email protected]))
- '@babel/plugin-syntax-json-strings': 7.8.3(@babel/[email protected]([email protected]))
- '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/[email protected]([email protected]))
- '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/[email protected]([email protected]))
- '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/[email protected]([email protected]))
- '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/[email protected]([email protected]))
- '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/[email protected]([email protected]))
- '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/[email protected]([email protected]))
- '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/[email protected]([email protected]))
- '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/[email protected]([email protected]))
+ undici-types: 7.18.2
+ '@types/[email protected]':
dependencies:
- '@babel/generator': 7.29.7
- '@babel/helper-module-imports': 7.29.7([email protected])
- '@babel/plugin-proposal-decorators': 7.29.0(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-proposal-export-default-from': 7.29.7(@babel/[email protected]([email protected]))
- '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/[email protected]([email protected]))
- '@babel/plugin-syntax-export-default-from': 7.29.7(@babel/[email protected]([email protected]))
- '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/[email protected]([email protected]))
- '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/[email protected]([email protected]))
- '@babel/plugin-transform-async-generator-functions': 7.29.7(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-async-to-generator': 7.29.7(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-block-scoping': 7.29.7(@babel/[email protected]([email protected]))
- '@babel/plugin-transform-class-properties': 7.29.7(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-class-static-block': 7.28.6(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-classes': 7.29.7(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-destructuring': 7.29.7(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-export-namespace-from': 7.27.1(@babel/[email protected]([email protected]))
- '@babel/plugin-transform-flow-strip-types': 7.29.7(@babel/[email protected]([email protected]))
- '@babel/plugin-transform-for-of': 7.29.7(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-logical-assignment-operators': 7.28.6(@babel/[email protected]([email protected]))
- '@babel/plugin-transform-modules-commonjs': 7.29.7(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-named-capturing-groups-regex': 7.29.7(@babel/[email protected]([email protected]))
- '@babel/plugin-transform-nullish-coalescing-operator': 7.29.7(@babel/[email protected]([email protected]))
- '@babel/plugin-transform-object-rest-spread': 7.28.6(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-optional-catch-binding': 7.29.7(@babel/[email protected]([email protected]))
- '@babel/plugin-transform-optional-chaining': 7.29.7(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-parameters': 7.27.7(@babel/[email protected]([email protected]))
- '@babel/plugin-transform-private-methods': 7.29.7(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-private-property-in-object': 7.29.7(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-react-display-name': 7.29.7(@babel/[email protected]([email protected]))
- '@babel/plugin-transform-react-jsx': 7.29.7(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-react-jsx-development': 7.27.1(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-react-pure-annotations': 7.27.1(@babel/[email protected]([email protected]))
- '@babel/plugin-transform-runtime': 7.29.7(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-typescript': 7.29.7(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-unicode-regex': 7.29.7(@babel/[email protected]([email protected]))
- '@babel/preset-typescript': 7.28.5(@babel/[email protected]([email protected]))([email protected])
- '@react-native/babel-plugin-codegen': 0.86.3(@babel/[email protected]([email protected]))([email protected])
- babel-plugin-react-compiler: 1.0.0
- babel-plugin-react-native-web: 0.21.2
- babel-plugin-syntax-hermes-parser: 0.36.1
- babel-plugin-transform-flow-enums: 0.0.2(@babel/[email protected]([email protected]))
- debug: 4.4.3([email protected])
- react-refresh: 0.14.2
- optionalDependencies:
- '@babel/runtime': 7.29.7
- expo: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
- transitivePeerDependencies:
- - '@babel/core'
- - supports-color
+ undici-types: 7.16.0
+ optional: true
+ '@types/[email protected]':
dependencies:
- '@babel/generator': 7.29.1
- '@babel/helper-module-imports': 7.28.6([email protected])
- '@babel/plugin-proposal-decorators': 7.29.0(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-proposal-export-default-from': 7.27.1(@babel/[email protected]([email protected]))
- '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/[email protected]([email protected]))
- '@babel/plugin-syntax-export-default-from': 7.28.6(@babel/[email protected]([email protected]))
- '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/[email protected]([email protected]))
- '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/[email protected]([email protected]))
- '@babel/plugin-transform-async-generator-functions': 7.29.0(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-async-to-generator': 7.28.6(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-block-scoping': 7.28.6(@babel/[email protected]([email protected]))
- '@babel/plugin-transform-class-properties': 7.28.6(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-class-static-block': 7.28.6(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-classes': 7.28.6(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-destructuring': 7.28.5(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-export-namespace-from': 7.27.1(@babel/[email protected]([email protected]))
- '@babel/plugin-transform-flow-strip-types': 7.27.1(@babel/[email protected]([email protected]))
- '@babel/plugin-transform-for-of': 7.27.1(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-logical-assignment-operators': 7.28.6(@babel/[email protected]([email protected]))
- '@babel/plugin-transform-modules-commonjs': 7.28.6(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-named-capturing-groups-regex': 7.29.0(@babel/[email protected]([email protected]))
- '@babel/plugin-transform-nullish-coalescing-operator': 7.28.6(@babel/[email protected]([email protected]))
- '@babel/plugin-transform-object-rest-spread': 7.28.6(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-optional-catch-binding': 7.28.6(@babel/[email protected]([email protected]))
- '@babel/plugin-transform-optional-chaining': 7.28.6(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-parameters': 7.27.7(@babel/[email protected]([email protected]))
- '@babel/plugin-transform-private-methods': 7.28.6(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-private-property-in-object': 7.28.6(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-react-display-name': 7.28.0(@babel/[email protected]([email protected]))
- '@babel/plugin-transform-react-jsx': 7.28.6(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-react-jsx-development': 7.27.1(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-react-pure-annotations': 7.27.1(@babel/[email protected]([email protected]))
- '@babel/plugin-transform-runtime': 7.29.0(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-typescript': 7.28.6(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-unicode-regex': 7.27.1(@babel/[email protected]([email protected]))
- '@babel/preset-typescript': 7.28.5(@babel/[email protected]([email protected]))([email protected])
- '@react-native/babel-plugin-codegen': 0.86.0(@babel/[email protected]([email protected]))([email protected])
- babel-plugin-react-compiler: 1.0.0
- babel-plugin-react-native-web: 0.21.2
- babel-plugin-syntax-hermes-parser: 0.36.1
- babel-plugin-transform-flow-enums: 0.0.2(@babel/[email protected]([email protected]))
- debug: 4.4.3([email protected])
- react-refresh: 0.14.2
- optionalDependencies:
- '@babel/runtime': 7.29.2
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- transitivePeerDependencies:
- - '@babel/core'
- - supports-color
+ '@types/node': 24.12.0
dependencies:
- '@babel/core': 7.29.0([email protected])
- babel-plugin-jest-hoist: 30.4.0
- babel-preset-current-node-syntax: 1.2.0(@babel/[email protected]([email protected]))
+ '@types/react': 19.2.17
+ '@types/[email protected]':
+ dependencies:
+ csstype: 3.2.3
+ '@types/[email protected]': {}
+ '@types/[email protected]':
+ dependencies:
+ '@types/node': 24.13.3
+ '@types/[email protected]': {}
- dependencies:
- zxing-wasm: 3.0.2(@types/[email protected])
- transitivePeerDependencies:
- - '@types/emscripten'
+ '@types/[email protected]': {}
+ '@types/[email protected]': {}
+ '@types/[email protected]':
+ optional: true
+ '@types/[email protected]':
+ optional: true
- dependencies:
- bindings: 1.5.0
- prebuild-install: 7.1.3
+ '@types/[email protected]': {}
+ '@types/[email protected]': {}
+ '@types/[email protected]': {}
+ '@types/[email protected]': {}
+ '@types/[email protected]':
dependencies:
- file-uri-to-path: 1.0.0
+ '@types/node': 24.13.3
- dependencies:
- react: 19.2.6
+ '@types/[email protected]': {}
+ '@types/[email protected]':
dependencies:
- react: 19.2.6
+ '@types/yargs-parser': 21.0.3
- dependencies:
- buffer: 5.7.1
- inherits: 2.0.4
- readable-stream: 3.6.2
+ '@typescript-eslint/[email protected]': {}
+ '@ungap/[email protected]': {}
+ optional: true
- dependencies:
- bytes: 3.1.2
- content-type: 1.0.5
- debug: 4.4.3([email protected])
- http-errors: 2.0.1
- iconv-lite: 0.7.2
- on-finished: 2.4.1
- qs: 6.15.3
- raw-body: 3.0.2
- type-is: 2.0.1
- transitivePeerDependencies:
- - supports-color
+ optional: true
+ optional: true
optional: true
+ optional: true
- dependencies:
- stream-buffers: 2.2.0
+ optional: true
- dependencies:
- big-integer: 1.6.52
+ optional: true
- dependencies:
- big-integer: 1.6.52
+ optional: true
- dependencies:
- balanced-match: 1.0.2
- concat-map: 0.0.1
+ optional: true
- dependencies:
- balanced-match: 1.0.2
+ optional: true
- dependencies:
- balanced-match: 4.0.4
+ optional: true
- dependencies:
- fill-range: 7.1.1
+ optional: true
- dependencies:
- baseline-browser-mapping: 2.9.19
- caniuse-lite: 1.0.30001767
- electron-to-chromium: 1.5.286
- node-releases: 2.0.27
- update-browserslist-db: 1.2.3([email protected])
+ optional: true
- 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])
+ optional: true
- dependencies:
- node-int64: 0.4.0
+ optional: true
+ optional: true
+ optional: true
- dependencies:
- base64-js: 1.5.1
- ieee754: 1.2.1
+ optional: true
dependencies:
- debug: 4.4.3([email protected])
- sax: 1.6.0
- transitivePeerDependencies:
- - supports-color
+ '@emnapi/core': 1.10.0
+ '@emnapi/runtime': 1.10.0
+ '@napi-rs/wasm-runtime': 1.1.6(@emnapi/[email protected])(@emnapi/[email protected])
+ optional: true
- dependencies:
- '@types/debug': 4.1.13
- builder-util-runtime: 9.7.0([email protected])
- chalk: 4.1.2
- cross-spawn: 7.0.6
- debug: 4.4.3([email protected])
- fs-extra: 10.1.0
- http-proxy-agent: 7.0.2([email protected])
- https-proxy-agent: 7.0.6([email protected])
- js-yaml: 4.1.1
- sanitize-filename: 1.6.4
- source-map-support: 0.5.21
- stat-mode: 1.0.0
- temp-file: 3.4.0
- tiny-async-pool: 1.3.0
+ optional: true
+
+ optional: true
+
+ optional: true
+
+ '@upsetjs/[email protected]':
+ optionalDependencies:
+ d3-selection: 3.0.0
+ d3-transition: 3.0.1([email protected])
+
+ dependencies:
+ '@babel/core': 7.29.0([email protected])
+ '@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/[email protected]([email protected]))
+ '@babel/plugin-transform-react-jsx-source': 7.27.1(@babel/[email protected]([email protected]))
+ '@rolldown/pluginutils': 1.0.0-beta.27
+ '@types/babel__core': 7.20.5
+ react-refresh: 0.17.0
transitivePeerDependencies:
- supports-color
dependencies:
- '@types/node': 24.13.3
- optional: true
+ '@babel/core': 7.29.0([email protected])
+ '@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/[email protected]([email protected]))
+ '@babel/plugin-transform-react-jsx-source': 7.27.1(@babel/[email protected]([email protected]))
+ '@rolldown/pluginutils': 1.0.0-rc.3
+ '@types/babel__core': 7.20.5
+ react-refresh: 0.18.0
+ transitivePeerDependencies:
+ - supports-color
dependencies:
- run-applescript: 7.1.0
+ '@bcoe/v8-coverage': 1.0.2
+ '@vitest/utils': 4.1.9
+ ast-v8-to-istanbul: 1.0.4
+ istanbul-lib-coverage: 3.2.2
+ istanbul-lib-report: 3.0.1
+ istanbul-reports: 3.2.0
+ magicast: 0.5.3
+ obug: 2.1.1
+ std-env: 4.1.0
+ tinyrainbow: 3.1.0
+ '@vitest/[email protected]':
dependencies:
- esbuild: 0.27.2
- load-tsconfig: 0.2.5
-
-
-
-
-
+ '@types/chai': 5.2.3
+ '@vitest/spy': 3.2.4
+ '@vitest/utils': 3.2.4
+ chai: 5.3.3
+ tinyrainbow: 2.0.0
+ '@vitest/[email protected]':
dependencies:
- clone-response: 1.0.3
- get-stream: 5.2.0
- http-cache-semantics: 4.2.0
- keyv: 4.5.4
- lowercase-keys: 2.0.0
- normalize-url: 6.1.0
- responselike: 2.0.1
+ '@standard-schema/spec': 1.1.0
+ '@types/chai': 5.2.3
+ '@vitest/spy': 4.1.8
+ '@vitest/utils': 4.1.8
+ chai: 6.2.2
+ tinyrainbow: 3.1.0
dependencies:
- hasha: 5.2.2
- make-dir: 3.1.0
- package-hash: 4.0.0
- write-file-atomic: 3.0.3
+ '@vitest/spy': 4.1.8
+ estree-walker: 3.0.3
+ magic-string: 0.30.21
+ optionalDependencies:
+ msw: 2.12.8(@types/[email protected])([email protected])
dependencies:
- es-errors: 1.3.0
- function-bind: 1.1.2
+ '@vitest/spy': 4.1.8
+ estree-walker: 3.0.3
+ magic-string: 0.30.21
+ optionalDependencies:
+ msw: 2.12.8(@types/[email protected])([email protected])
dependencies:
- call-bind-apply-helpers: 1.0.2
- get-intrinsic: 1.3.0
-
+ '@vitest/spy': 4.1.8
+ estree-walker: 3.0.3
+ magic-string: 0.30.21
+ optionalDependencies:
+ msw: 2.12.8(@types/[email protected])([email protected])
+ '@vitest/[email protected]':
+ dependencies:
+ tinyrainbow: 2.0.0
+ '@vitest/[email protected]':
+ dependencies:
+ tinyrainbow: 3.1.0
+ '@vitest/[email protected]':
+ dependencies:
+ tinyrainbow: 3.1.0
+ '@vitest/[email protected]':
+ dependencies:
+ '@vitest/utils': 4.1.8
+ pathe: 2.0.3
+ '@vitest/[email protected]':
+ dependencies:
+ '@vitest/pretty-format': 4.1.8
+ '@vitest/utils': 4.1.8
+ magic-string: 0.30.21
+ pathe: 2.0.3
+ '@vitest/[email protected]':
+ dependencies:
+ tinyspy: 4.0.4
+ '@vitest/[email protected]': {}
+ dependencies:
+ '@vitest/utils': 4.1.8
+ fflate: 0.8.3
+ flatted: 3.4.2
+ pathe: 2.0.3
+ sirv: 3.0.2
+ tinyglobby: 0.2.15
+ tinyrainbow: 3.1.0
+ '@vitest/[email protected]':
dependencies:
- assertion-error: 2.0.1
- check-error: 2.1.3
- deep-eql: 5.0.2
+ '@vitest/pretty-format': 3.2.4
loupe: 3.2.1
- pathval: 2.0.1
-
+ tinyrainbow: 2.0.0
+ '@vitest/[email protected]':
dependencies:
- ansi-styles: 3.2.1
- escape-string-regexp: 1.0.5
- supports-color: 5.5.0
+ '@vitest/pretty-format': 4.1.8
+ convert-source-map: 2.0.0
+ tinyrainbow: 3.1.0
+ '@vitest/[email protected]':
dependencies:
- ansi-styles: 4.3.0
- supports-color: 7.2.0
-
-
+ '@vitest/pretty-format': 4.1.9
+ convert-source-map: 2.0.0
+ tinyrainbow: 3.1.0
+ '@webassemblyjs/[email protected]':
+ dependencies:
+ '@webassemblyjs/helper-numbers': 1.13.2
+ '@webassemblyjs/helper-wasm-bytecode': 1.13.2
+ optional: true
+ '@webassemblyjs/[email protected]':
+ optional: true
+ '@webassemblyjs/[email protected]':
+ optional: true
+ '@webassemblyjs/[email protected]':
+ optional: true
+ '@webassemblyjs/[email protected]':
+ dependencies:
+ '@webassemblyjs/floating-point-hex-parser': 1.13.2
+ '@webassemblyjs/helper-api-error': 1.13.2
+ '@xtuc/long': 4.2.2
+ optional: true
+ '@webassemblyjs/[email protected]':
+ optional: true
+ '@webassemblyjs/[email protected]':
dependencies:
- anymatch: 3.1.3
- braces: 3.0.3
- glob-parent: 5.1.2
- is-binary-path: 2.1.0
- is-glob: 4.0.3
- normalize-path: 3.0.0
- readdirp: 3.6.0
- optionalDependencies:
- fsevents: 2.3.3
+ '@webassemblyjs/ast': 1.14.1
+ '@webassemblyjs/helper-buffer': 1.14.1
+ '@webassemblyjs/helper-wasm-bytecode': 1.13.2
+ '@webassemblyjs/wasm-gen': 1.14.1
+ optional: true
+ '@webassemblyjs/[email protected]':
dependencies:
- readdirp: 4.1.2
+ '@xtuc/ieee754': 1.2.0
+ optional: true
+ '@webassemblyjs/[email protected]':
dependencies:
- readdirp: 5.0.0
+ '@xtuc/long': 4.2.2
+ optional: true
+ '@webassemblyjs/[email protected]':
+ optional: true
+ '@webassemblyjs/[email protected]':
+ dependencies:
+ '@webassemblyjs/ast': 1.14.1
+ '@webassemblyjs/helper-buffer': 1.14.1
+ '@webassemblyjs/helper-wasm-bytecode': 1.13.2
+ '@webassemblyjs/helper-wasm-section': 1.14.1
+ '@webassemblyjs/wasm-gen': 1.14.1
+ '@webassemblyjs/wasm-opt': 1.14.1
+ '@webassemblyjs/wasm-parser': 1.14.1
+ '@webassemblyjs/wast-printer': 1.14.1
+ optional: true
+ '@webassemblyjs/[email protected]':
dependencies:
- '@types/node': 24.13.3
- escape-string-regexp: 4.0.0
- is-wsl: 2.2.0
- lighthouse-logger: 1.4.2([email protected])
- transitivePeerDependencies:
- - supports-color
+ '@webassemblyjs/ast': 1.14.1
+ '@webassemblyjs/helper-wasm-bytecode': 1.13.2
+ '@webassemblyjs/ieee754': 1.13.2
+ '@webassemblyjs/leb128': 1.13.2
+ '@webassemblyjs/utf8': 1.13.2
+ optional: true
+ '@webassemblyjs/[email protected]':
+ dependencies:
+ '@webassemblyjs/ast': 1.14.1
+ '@webassemblyjs/helper-buffer': 1.14.1
+ '@webassemblyjs/wasm-gen': 1.14.1
+ '@webassemblyjs/wasm-parser': 1.14.1
+ optional: true
+
+ '@webassemblyjs/[email protected]':
+ dependencies:
+ '@webassemblyjs/ast': 1.14.1
+ '@webassemblyjs/helper-api-error': 1.13.2
+ '@webassemblyjs/helper-wasm-bytecode': 1.13.2
+ '@webassemblyjs/ieee754': 1.13.2
+ '@webassemblyjs/leb128': 1.13.2
+ '@webassemblyjs/utf8': 1.13.2
optional: true
+ '@webassemblyjs/[email protected]':
dependencies:
- '@types/node': 24.13.3
- escape-string-regexp: 4.0.0
- is-wsl: 2.2.0
- lighthouse-logger: 1.4.2([email protected])
- mkdirp: 1.0.4
- transitivePeerDependencies:
- - supports-color
-
-
-
+ '@webassemblyjs/ast': 1.14.1
+ '@xtuc/long': 4.2.2
+ optional: true
+ '@webcontainer/[email protected]': {}
+ '@webgpu/[email protected]': {}
+ '@xmldom/[email protected]': {}
dependencies:
- clsx: 2.1.1
-
+ '@xterm/xterm': 5.5.0
+ dependencies:
+ '@xterm/xterm': 5.5.0
dependencies:
- restore-cursor: 2.0.0
+ '@xterm/xterm': 5.5.0
dependencies:
- restore-cursor: 5.1.0
+ '@xterm/xterm': 5.5.0
+ '@xterm/[email protected]': {}
+ optional: true
optional: true
dependencies:
- string-width: 4.2.3
- strip-ansi: 6.0.1
- wrap-ansi: 6.2.0
+ mime-types: 3.0.2
+ negotiator: 1.0.0
dependencies:
- string-width: 4.2.3
- strip-ansi: 6.0.1
- wrap-ansi: 7.0.0
+ acorn: 8.17.0
+ optional: true
dependencies:
- mimic-response: 1.0.1
+ acorn: 8.17.0
+
dependencies:
- '@radix-ui/react-compose-refs': 1.1.2(@types/[email protected])([email protected])
- '@radix-ui/react-id': 1.1.1(@types/[email protected])([email protected])
- react: 19.2.6
- react-dom: 19.2.6([email protected])
+ debug: 4.4.3([email protected])
transitivePeerDependencies:
- - '@types/react'
- - '@types/react-dom'
+ - supports-color
dependencies:
- color-name: 1.1.3
+ '@iarna/toml': 2.2.5
+ commander: 14.0.3
+ jsonc-parser: 3.3.1
+ picocolors: 1.1.1
+ prompts: 2.4.2
+ yaml: 2.9.0
dependencies:
- color-name: 1.1.4
+ '@iarna/toml': 2.2.5
+ commander: 14.0.3
+ jsonc-parser: 3.3.1
+ picocolors: 1.1.1
+ prompts: 2.4.2
+ yaml: 2.9.0
+ dependencies:
+ clean-stack: 2.2.0
+ indent-string: 4.0.0
+ optionalDependencies:
+ ajv: 8.20.0
dependencies:
- color-name: 1.1.4
- simple-swizzle: 0.2.4
+ ajv: 8.20.0
+ optional: true
dependencies:
- color-convert: 2.0.1
- color-string: 1.9.1
+ ajv: 8.20.0
dependencies:
- delayed-stream: 1.0.0
-
-
-
-
-
-
-
-
-
-
+ ajv: 8.20.0
+ fast-deep-equal: 3.1.3
optional: true
dependencies:
- array-timsort: 1.0.3
- core-util-is: 1.0.3
- esprima: 4.0.1
-
-
+ fast-deep-equal: 3.1.3
+ fast-json-stable-stringify: 2.1.0
+ json-schema-traverse: 0.4.1
+ uri-js: 4.4.1
dependencies:
- mime-db: 1.54.0
+ fast-deep-equal: 3.1.3
+ fast-uri: 3.1.4
+ json-schema-traverse: 1.0.0
+ require-from-string: 2.0.2
dependencies:
- bytes: 3.1.2
- compressible: 2.0.18
- debug: 2.6.9([email protected])
- negotiator: 0.6.4
- on-headers: 1.1.0
- safe-buffer: 5.2.1
- vary: 1.1.2
- transitivePeerDependencies:
- - supports-color
-
+ type-fest: 0.21.3
dependencies:
- ajv: 8.20.0
- ajv-formats: 3.0.1
- atomically: 2.1.0
- debounce-fn: 6.0.0
- dot-prop: 10.1.0
- env-paths: 3.0.0
- json-schema-typed: 8.0.2
- semver: 7.8.4
- uint8array-extras: 1.5.0
+ environment: 1.1.0
dependencies:
- debug: 2.6.9([email protected])
- finalhandler: 1.1.2([email protected])
- parseurl: 1.3.3
- utils-merge: 1.0.1
- transitivePeerDependencies:
- - supports-color
-
-
+ color-convert: 1.9.3
+ dependencies:
+ color-convert: 2.0.1
- optional: true
+ dependencies:
+ normalize-path: 3.0.0
+ picomatch: 2.3.1
+ [email protected](patch_hash=4688f96749e3d76cf27bc535d874470bf264610a331db13644df7715d699acf1)([email protected])([email protected])([email protected]):
dependencies:
- is-what: 5.5.0
+ '@electron/asar': 3.4.1
+ '@electron/fuses': 1.8.0
+ '@electron/get': 3.1.0([email protected])
+ '@electron/notarize': 2.5.0([email protected])
+ '@electron/osx-sign': 1.3.3([email protected])
+ '@electron/rebuild': 4.0.4([email protected])
+ '@electron/universal': 2.0.3([email protected])
+ '@malept/flatpak-bundler': 0.4.0([email protected])
+ '@noble/hashes': 2.2.0
+ '@peculiar/webcrypto': 1.7.1
+ '@types/fs-extra': 9.0.13
+ ajv: 8.20.0
+ asn1js: 3.0.10
+ async-exit-hook: 2.0.1
+ builder-util: 26.15.3([email protected])
+ builder-util-runtime: 9.7.0([email protected])
+ chromium-pickle-js: 0.2.0
+ ci-info: 4.3.1
+ debug: 4.4.3([email protected])
+ dmg-builder: 26.15.3([email protected])([email protected])
+ dotenv: 16.4.7
+ dotenv-expand: 11.0.7
+ ejs: 3.1.10
+ electron-builder-squirrel-windows: 26.15.3([email protected])([email protected])
+ electron-publish: 26.15.3([email protected])
+ fs-extra: 10.1.0
+ hosted-git-info: 4.1.0
+ isbinaryfile: 5.0.7
+ jiti: 2.7.0
+ js-yaml: 4.1.1
+ json5: 2.2.3
+ lazy-val: 1.0.5
+ minimatch: 10.2.5
+ pkijs: 3.4.0
+ plist: 3.1.0
+ proper-lockfile: 4.1.2
+ resedit: 1.7.2
+ semver: 7.7.3
+ tar: 7.5.22
+ temp-file: 3.4.0
+ tiny-async-pool: 1.3.0
+ unzipper: 0.12.3
+ which: 5.0.0
+ transitivePeerDependencies:
+ - supports-color
dependencies:
- browserslist: 4.28.7
-
+ default-require-extensions: 3.0.1
dependencies:
- object-assign: 4.1.1
- vary: 1.1.2
+ sprintf-js: 1.0.3
- dependencies:
- layout-base: 1.0.2
dependencies:
- layout-base: 2.0.1
+ tslib: 2.8.1
dependencies:
- import-fresh: 3.3.1
- js-yaml: 4.1.1
- parse-json: 5.2.0
- path-type: 4.0.0
- optionalDependencies:
- typescript: 5.9.3
-
+ dequal: 2.0.3
- optional: true
dependencies:
- node-fetch: 2.7.0([email protected])
- transitivePeerDependencies:
- - encoding
+ '@ark/util': 0.56.0
dependencies:
- path-key: 3.1.1
- shebang-command: 2.0.0
- which: 2.0.2
+ '@ark/schema': 0.56.0
+ '@ark/util': 0.56.0
+ arkregex: 0.0.5
dependencies:
- hyphenate-style-name: 1.1.0
+ pvtsutils: 1.3.6
+ pvutils: 1.1.5
+ tslib: 2.8.1
- dependencies:
- boolbase: 1.0.0
- css-what: 6.2.2
- domhandler: 5.0.3
- domutils: 3.2.2
- nth-check: 2.1.1
dependencies:
- mdn-data: 2.0.14
- source-map: 0.6.1
+ tslib: 2.8.1
dependencies:
- mdn-data: 2.0.28
- source-map-js: 1.2.1
+ '@jridgewell/trace-mapping': 0.3.31
+ estree-walker: 3.0.3
+ js-tokens: 10.0.0
- dependencies:
- mdn-data: 2.0.30
- source-map-js: 1.2.1
- dependencies:
- css-tree: 2.2.1
dependencies:
- '@asamuzakjp/css-color': 3.2.0
- rrweb-cssom: 0.8.0
+ stubborn-fs: 2.0.0
+ when-exit: 2.1.5
- dependencies:
- find-pkg: 0.1.2
- fs-exists-sync: 0.1.0
- dependencies:
- cose-base: 1.0.3
- cytoscape: 3.34.1
dependencies:
- cose-base: 2.2.0
- cytoscape: 3.34.1
+ follow-redirects: 1.16.0([email protected]([email protected]))
+ form-data: 4.0.5
+ https-proxy-agent: 5.0.1([email protected])
+ proxy-from-env: 2.1.0
+ transitivePeerDependencies:
+ - debug
+ - supports-color
+ dependencies:
+ '@babel/core': 7.29.0([email protected])
+ '@babel/parser': 7.29.7
+ '@babel/traverse': 7.29.0([email protected])
+ '@babel/types': 7.29.7
+ transitivePeerDependencies:
+ - supports-color
dependencies:
- internmap: 1.0.1
+ '@babel/core': 7.29.0([email protected])
+ '@jest/transform': 30.4.1([email protected])
+ '@types/babel__core': 7.20.5
+ babel-plugin-istanbul: 7.0.1([email protected])
+ babel-preset-jest: 30.4.0(@babel/[email protected]([email protected]))
+ chalk: 4.1.2
+ graceful-fs: 4.2.11
+ slash: 3.0.0
+ transitivePeerDependencies:
+ - supports-color
dependencies:
- internmap: 2.0.3
+ '@babel/helper-plugin-utils': 7.28.6
+ '@istanbuljs/load-nyc-config': 1.1.0
+ '@istanbuljs/schema': 0.1.3
+ istanbul-lib-instrument: 6.0.3([email protected])
+ test-exclude: 6.0.0
+ transitivePeerDependencies:
+ - supports-color
+ dependencies:
+ '@types/babel__core': 7.20.5
dependencies:
- d3-dispatch: 3.0.1
- d3-drag: 3.0.0
- d3-interpolate: 3.0.1
- d3-selection: 3.0.0
- d3-transition: 3.0.1([email protected])
+ '@babel/core': 7.29.0([email protected])
+ '@babel/plugin-syntax-async-generators': 7.8.4(@babel/[email protected]([email protected]))
+ '@babel/plugin-syntax-bigint': 7.8.3(@babel/[email protected]([email protected]))
+ '@babel/plugin-syntax-class-properties': 7.12.13(@babel/[email protected]([email protected]))
+ '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/[email protected]([email protected]))
+ '@babel/plugin-syntax-import-attributes': 7.28.6(@babel/[email protected]([email protected]))
+ '@babel/plugin-syntax-import-meta': 7.10.4(@babel/[email protected]([email protected]))
+ '@babel/plugin-syntax-json-strings': 7.8.3(@babel/[email protected]([email protected]))
+ '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/[email protected]([email protected]))
+ '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/[email protected]([email protected]))
+ '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/[email protected]([email protected]))
+ '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/[email protected]([email protected]))
+ '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/[email protected]([email protected]))
+ '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/[email protected]([email protected]))
+ '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/[email protected]([email protected]))
+ '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/[email protected]([email protected]))
dependencies:
- d3-path: 3.1.0
+ '@babel/core': 7.29.0([email protected])
+ babel-plugin-jest-hoist: 30.4.0
+ babel-preset-current-node-syntax: 1.2.0(@babel/[email protected]([email protected]))
- dependencies:
- d3-array: 3.2.4
- dependencies:
- delaunator: 5.1.0
- dependencies:
- d3-dispatch: 3.0.1
- d3-selection: 3.0.0
+ optional: true
+
dependencies:
- commander: 7.2.0
- iconv-lite: 0.6.3
- rw: 1.3.3
+ bindings: 1.5.0
+ prebuild-install: 7.1.3
- dependencies:
- d3-dsv: 3.0.1
dependencies:
- d3-dispatch: 3.0.1
- d3-quadtree: 3.0.1
- d3-timer: 3.0.1
-
+ file-uri-to-path: 1.0.0
dependencies:
- d3-array: 3.2.4
+ react: 19.2.6
+ dependencies:
+ react: 19.2.6
dependencies:
- d3-color: 3.1.0
+ buffer: 5.7.1
+ inherits: 2.0.4
+ readable-stream: 3.6.2
+ dependencies:
+ bytes: 3.1.2
+ content-type: 1.0.5
+ debug: 4.4.3([email protected])
+ http-errors: 2.0.1
+ iconv-lite: 0.7.2
+ on-finished: 2.4.1
+ qs: 6.15.3
+ raw-body: 3.0.2
+ type-is: 2.0.1
+ transitivePeerDependencies:
+ - supports-color
+ optional: true
dependencies:
- d3-array: 2.12.1
- d3-shape: 1.3.7
+ big-integer: 1.6.52
dependencies:
- d3-color: 3.1.0
- d3-interpolate: 3.0.1
+ balanced-match: 1.0.2
+ concat-map: 0.0.1
dependencies:
- d3-array: 3.2.4
- d3-format: 3.1.2
- d3-interpolate: 3.0.1
- d3-time: 3.1.0
- d3-time-format: 4.1.0
+ balanced-match: 1.0.2
+ dependencies:
+ balanced-match: 4.0.4
dependencies:
- d3-path: 1.0.9
+ fill-range: 7.1.1
dependencies:
- d3-path: 3.1.0
+ baseline-browser-mapping: 2.9.19
+ caniuse-lite: 1.0.30001767
+ electron-to-chromium: 1.5.286
+ node-releases: 2.0.27
+ update-browserslist-db: 1.2.3([email protected])
dependencies:
- d3-time: 3.1.0
+ 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])
+ optional: true
dependencies:
- d3-array: 3.2.4
+ node-int64: 0.4.0
+
dependencies:
- d3-color: 3.1.0
- d3-dispatch: 3.0.1
- d3-ease: 3.0.1
- d3-interpolate: 3.0.1
- d3-selection: 3.0.0
- d3-timer: 3.0.1
+ base64-js: 1.5.1
+ ieee754: 1.2.1
dependencies:
- d3-dispatch: 3.0.1
- d3-drag: 3.0.0
- d3-interpolate: 3.0.1
- d3-selection: 3.0.0
- d3-transition: 3.0.1([email protected])
+ debug: 4.4.3([email protected])
+ sax: 1.6.0
+ transitivePeerDependencies:
+ - supports-color
dependencies:
- d3-array: 3.2.4
- d3-axis: 3.0.0
- d3-brush: 3.0.0
- d3-chord: 3.0.1
- d3-color: 3.1.0
- d3-contour: 4.0.2
- d3-delaunay: 6.0.4
- d3-dispatch: 3.0.1
- d3-drag: 3.0.0
- d3-dsv: 3.0.1
- d3-ease: 3.0.1
- d3-fetch: 3.0.1
- d3-force: 3.0.0
- d3-format: 3.1.2
- d3-geo: 3.1.1
- d3-hierarchy: 3.1.2
- d3-interpolate: 3.0.1
- d3-path: 3.1.0
- d3-polygon: 3.0.1
- d3-quadtree: 3.0.1
- d3-random: 3.0.1
- d3-scale: 4.0.2
- d3-scale-chromatic: 3.1.0
- d3-selection: 3.0.0
- d3-shape: 3.2.0
- d3-time: 3.1.0
- d3-time-format: 4.1.0
- d3-timer: 3.0.1
- d3-transition: 3.0.1([email protected])
- d3-zoom: 3.0.0
+ '@types/debug': 4.1.13
+ builder-util-runtime: 9.7.0([email protected])
+ chalk: 4.1.2
+ cross-spawn: 7.0.6
+ debug: 4.4.3([email protected])
+ fs-extra: 10.1.0
+ http-proxy-agent: 7.0.2([email protected])
+ https-proxy-agent: 7.0.6([email protected])
+ js-yaml: 4.1.1
+ sanitize-filename: 1.6.4
+ source-map-support: 0.5.21
+ stat-mode: 1.0.0
+ temp-file: 3.4.0
+ tiny-async-pool: 1.3.0
+ transitivePeerDependencies:
+ - supports-color
dependencies:
- d3: 7.9.0
- lodash-es: 4.18.1
+ '@types/node': 24.13.3
+ optional: true
+ dependencies:
+ run-applescript: 7.1.0
dependencies:
- whatwg-mimetype: 4.0.0
- whatwg-url: 14.2.0
+ esbuild: 0.27.2
+ load-tsconfig: 0.2.5
- dependencies:
- mimic-function: 5.0.1
- dependencies:
- ms: 2.0.0
- optionalDependencies:
- supports-color: 8.1.1
dependencies:
- ms: 2.1.3
- optionalDependencies:
- supports-color: 8.1.1
+ clone-response: 1.0.3
+ get-stream: 5.2.0
+ http-cache-semantics: 4.2.0
+ keyv: 4.5.4
+ lowercase-keys: 2.0.0
+ normalize-url: 6.1.0
+ responselike: 2.0.1
dependencies:
- ms: 2.1.3
- optionalDependencies:
- supports-color: 8.1.1
-
+ hasha: 5.2.2
+ make-dir: 3.1.0
+ package-hash: 4.0.0
+ write-file-atomic: 3.0.3
+ dependencies:
+ es-errors: 1.3.0
+ function-bind: 1.1.2
dependencies:
- character-entities: 2.0.2
+ call-bind-apply-helpers: 1.0.2
+ get-intrinsic: 1.3.0
- dependencies:
- mimic-response: 3.1.0
+ optional: true
dependencies:
- bundle-name: 4.1.0
- default-browser-id: 5.0.1
+ assertion-error: 2.0.1
+ check-error: 2.1.3
+ deep-eql: 5.0.2
+ loupe: 3.2.1
+ pathval: 2.0.1
+
dependencies:
- strip-bom: 4.0.0
+ ansi-styles: 3.2.1
+ escape-string-regexp: 1.0.5
+ supports-color: 5.5.0
dependencies:
- clone: 1.0.4
+ ansi-styles: 4.3.0
+ supports-color: 7.2.0
- dependencies:
- es-define-property: 1.0.1
- es-errors: 1.3.0
- gopd: 1.2.0
- optional: true
+
+
+
+
+
dependencies:
- define-data-property: 1.1.4
- has-property-descriptors: 1.0.2
- object-keys: 1.1.1
- optional: true
+ readdirp: 4.1.2
dependencies:
- robust-predicates: 3.0.3
+ readdirp: 5.0.0
+ optional: true
+
+ dependencies:
+ clsx: 2.1.1
- optional: true
dependencies:
- dequal: 2.0.3
-
+ restore-cursor: 5.1.0
+ optional: true
dependencies:
- htmlparser2: 3.10.1
+ string-width: 4.2.3
+ strip-ansi: 6.0.1
+ wrap-ansi: 6.2.0
dependencies:
- minimatch: 3.1.2
- p-limit: 3.1.0
-
+ string-width: 4.2.3
+ strip-ansi: 6.0.1
+ wrap-ansi: 7.0.0
dependencies:
- app-builder-lib: 26.15.3(patch_hash=4688f96749e3d76cf27bc535d874470bf264610a331db13644df7715d699acf1)([email protected])([email protected])([email protected])
- builder-util: 26.15.3([email protected])
- fs-extra: 10.1.0
- js-yaml: 4.1.1
- transitivePeerDependencies:
- - electron-builder-squirrel-windows
- - supports-color
+ mimic-response: 1.0.1
dependencies:
- esutils: 2.0.3
+ '@radix-ui/react-compose-refs': 1.1.2(@types/[email protected])([email protected])
+ '@radix-ui/react-id': 1.1.1(@types/[email protected])([email protected])
+ react: 19.2.6
+ react-dom: 19.2.6([email protected])
+ transitivePeerDependencies:
+ - '@types/react'
+ - '@types/react-dom'
dependencies:
- domelementtype: 2.3.0
- entities: 2.2.0
+ color-name: 1.1.3
dependencies:
- domelementtype: 2.3.0
- domhandler: 5.0.3
- entities: 4.5.0
+ color-name: 1.1.4
dependencies:
- domelementtype: 1.3.1
+ delayed-stream: 1.0.0
- dependencies:
- domelementtype: 2.3.0
- optionalDependencies:
- '@types/trusted-types': 2.0.7
- dependencies:
- dom-serializer: 0.2.2
- domelementtype: 1.3.1
- dependencies:
- dom-serializer: 2.0.0
- domelementtype: 2.3.0
- domhandler: 5.0.3
+ optional: true
- dependencies:
- no-case: 3.0.4
- tslib: 2.8.1
- dependencies:
- type-fest: 5.6.0
- dependencies:
- dotenv: 16.4.7
- dependencies:
- '@drizzle-team/brocli': 0.10.2
- '@esbuild-kit/esm-loader': 2.6.5
- esbuild: 0.25.12
- esbuild-register: 3.6.0([email protected])([email protected])
- transitivePeerDependencies:
- - supports-color
+ optional: true
- optionalDependencies:
- '@opentelemetry/api': 1.9.1
- '@types/better-sqlite3': 7.6.13
- better-sqlite3: 12.10.1
- bun-types: 1.3.14
- dependencies:
- call-bind-apply-helpers: 1.0.2
- es-errors: 1.3.0
- gopd: 1.2.0
- dependencies:
- readable-stream: 2.3.8
+ dependencies:
+ ajv: 8.20.0
+ ajv-formats: 3.0.1
+ atomically: 2.1.0
+ debounce-fn: 6.0.0
+ dot-prop: 10.1.0
+ env-paths: 3.0.0
+ json-schema-typed: 8.0.2
+ semver: 7.8.4
+ uint8array-extras: 1.5.0
- dependencies:
- safe-buffer: 5.2.1
- dependencies:
- jake: 10.9.4
- dependencies:
- app-builder-lib: 26.15.3(patch_hash=4688f96749e3d76cf27bc535d874470bf264610a331db13644df7715d699acf1)([email protected])([email protected])([email protected])
- builder-util: 26.15.3([email protected])
- electron-winstaller: 5.4.0([email protected])
- transitivePeerDependencies:
- - dmg-builder
- - supports-color
- dependencies:
- app-builder-lib: 26.15.3(patch_hash=4688f96749e3d76cf27bc535d874470bf264610a331db13644df7715d699acf1)([email protected])([email protected])([email protected])
- builder-util: 26.15.3([email protected])
- builder-util-runtime: 9.7.0([email protected])
- chalk: 4.1.2
- ci-info: 4.4.0
- dmg-builder: 26.15.3([email protected])([email protected])
- fs-extra: 10.1.0
- lazy-val: 1.0.5
- simple-update-notifier: 2.0.0
- yargs: 17.7.2
- transitivePeerDependencies:
- - electron-builder-squirrel-windows
- - supports-color
- dependencies:
- '@types/fs-extra': 9.0.13
- aws4: 1.13.2
- builder-util: 26.15.3([email protected])
- builder-util-runtime: 9.7.0([email protected])
- chalk: 4.1.2
- form-data: 4.0.5
- fs-extra: 10.1.0
- lazy-val: 1.0.5
- mime: 2.6.0
- transitivePeerDependencies:
- - supports-color
- dependencies:
- conf: 15.1.0
- type-fest: 5.4.3
+ optional: true
dependencies:
- builder-util-runtime: 9.7.0([email protected])
- fs-extra: 10.1.0
- js-yaml: 4.1.1
- lazy-val: 1.0.5
- lodash.escaperegexp: 4.1.2
- lodash.isequal: 4.5.0
- semver: 7.7.3
- tiny-typed-emitter: 2.1.0
- transitivePeerDependencies:
- - supports-color
+ is-what: 5.5.0
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/plugin-transform-arrow-functions': 7.27.1(@babel/[email protected]([email protected]))
- cac: 6.7.14
- esbuild: 0.25.12
- magic-string: 0.30.21
- picocolors: 1.1.1
- optionalDependencies:
- '@swc/core': 1.15.43
- transitivePeerDependencies:
- - supports-color
+
dependencies:
- '@electron/asar': 3.4.1
- debug: 4.4.3([email protected])
- fs-extra: 7.0.1
- lodash: 4.18.0
- temp: 0.9.4
- optionalDependencies:
- '@electron/windows-sign': 1.2.2([email protected])
- transitivePeerDependencies:
- - supports-color
+ object-assign: 4.1.1
+ vary: 1.1.2
dependencies:
- '@electron-internal/extract-zip': 1.0.3
- '@electron/get': 5.0.0([email protected])
- '@types/node': 24.13.3
- transitivePeerDependencies:
- - supports-color
+ layout-base: 1.0.2
+ dependencies:
+ layout-base: 2.0.1
+ optional: true
+ dependencies:
+ path-key: 3.1.1
+ shebang-command: 2.0.0
+ which: 2.0.2
+ dependencies:
+ mdn-data: 2.0.28
+ source-map-js: 1.2.1
+ optional: true
dependencies:
- iconv-lite: 0.6.3
+ css-tree: 2.2.1
optional: true
dependencies:
- once: 1.4.0
+ '@asamuzakjp/css-color': 3.2.0
+ rrweb-cssom: 0.8.0
- dependencies:
- graceful-fs: 4.2.11
- tapable: 2.3.0
dependencies:
- graceful-fs: 4.2.11
- tapable: 2.3.3
+ find-pkg: 0.1.2
+ fs-exists-sync: 0.1.0
dependencies:
- graceful-fs: 4.2.11
- tapable: 2.3.3
- optional: true
+ cose-base: 1.0.3
+ cytoscape: 3.34.1
+ dependencies:
+ cose-base: 2.2.0
+ cytoscape: 3.34.1
+ dependencies:
+ internmap: 1.0.1
+ dependencies:
+ internmap: 2.0.3
+ dependencies:
+ d3-dispatch: 3.0.1
+ d3-drag: 3.0.0
+ d3-interpolate: 3.0.1
+ d3-selection: 3.0.0
+ d3-transition: 3.0.1([email protected])
+ dependencies:
+ d3-path: 3.1.0
dependencies:
- is-arrayish: 0.2.1
+ d3-array: 3.2.4
dependencies:
- stackframe: 1.3.4
+ delaunator: 5.1.0
+ dependencies:
+ d3-dispatch: 3.0.1
+ d3-selection: 3.0.0
+ dependencies:
+ commander: 7.2.0
+ iconv-lite: 0.6.3
+ rw: 1.3.3
dependencies:
- es-errors: 1.3.0
+ d3-dsv: 3.0.1
dependencies:
- es-errors: 1.3.0
- get-intrinsic: 1.3.0
- has-tostringtag: 1.0.2
- hasown: 2.0.4
-
+ d3-dispatch: 3.0.1
+ d3-quadtree: 3.0.1
+ d3-timer: 3.0.1
dependencies:
- debug: 4.4.3([email protected])
- esbuild: 0.25.12
- transitivePeerDependencies:
- - supports-color
+ d3-array: 3.2.4
+
dependencies:
- debug: 4.4.3([email protected])
- esbuild: 0.27.7
- transitivePeerDependencies:
- - supports-color
- optional: true
+ d3-color: 3.1.0
- optionalDependencies:
- '@esbuild/android-arm': 0.18.20
- '@esbuild/android-arm64': 0.18.20
- '@esbuild/android-x64': 0.18.20
- '@esbuild/darwin-arm64': 0.18.20
- '@esbuild/darwin-x64': 0.18.20
- '@esbuild/freebsd-arm64': 0.18.20
- '@esbuild/freebsd-x64': 0.18.20
- '@esbuild/linux-arm': 0.18.20
- '@esbuild/linux-arm64': 0.18.20
- '@esbuild/linux-ia32': 0.18.20
- '@esbuild/linux-loong64': 0.18.20
- '@esbuild/linux-mips64el': 0.18.20
- '@esbuild/linux-ppc64': 0.18.20
- '@esbuild/linux-riscv64': 0.18.20
- '@esbuild/linux-s390x': 0.18.20
- '@esbuild/linux-x64': 0.18.20
- '@esbuild/netbsd-x64': 0.18.20
- '@esbuild/openbsd-x64': 0.18.20
- '@esbuild/sunos-x64': 0.18.20
- '@esbuild/win32-arm64': 0.18.20
- '@esbuild/win32-ia32': 0.18.20
- '@esbuild/win32-x64': 0.18.20
- optionalDependencies:
- '@esbuild/aix-ppc64': 0.25.12
- '@esbuild/android-arm': 0.25.12
- '@esbuild/android-arm64': 0.25.12
- '@esbuild/android-x64': 0.25.12
- '@esbuild/darwin-arm64': 0.25.12
- '@esbuild/darwin-x64': 0.25.12
- '@esbuild/freebsd-arm64': 0.25.12
- '@esbuild/freebsd-x64': 0.25.12
- '@esbuild/linux-arm': 0.25.12
- '@esbuild/linux-arm64': 0.25.12
- '@esbuild/linux-ia32': 0.25.12
- '@esbuild/linux-loong64': 0.25.12
- '@esbuild/linux-mips64el': 0.25.12
- '@esbuild/linux-ppc64': 0.25.12
- '@esbuild/linux-riscv64': 0.25.12
- '@esbuild/linux-s390x': 0.25.12
- '@esbuild/linux-x64': 0.25.12
- '@esbuild/netbsd-arm64': 0.25.12
- '@esbuild/netbsd-x64': 0.25.12
- '@esbuild/openbsd-arm64': 0.25.12
- '@esbuild/openbsd-x64': 0.25.12
- '@esbuild/openharmony-arm64': 0.25.12
- '@esbuild/sunos-x64': 0.25.12
- '@esbuild/win32-arm64': 0.25.12
- '@esbuild/win32-ia32': 0.25.12
- '@esbuild/win32-x64': 0.25.12
- optionalDependencies:
- '@esbuild/aix-ppc64': 0.27.2
- '@esbuild/android-arm': 0.27.2
- '@esbuild/android-arm64': 0.27.2
- '@esbuild/android-x64': 0.27.2
- '@esbuild/darwin-arm64': 0.27.2
- '@esbuild/darwin-x64': 0.27.2
- '@esbuild/freebsd-arm64': 0.27.2
- '@esbuild/freebsd-x64': 0.27.2
- '@esbuild/linux-arm': 0.27.2
- '@esbuild/linux-arm64': 0.27.2
- '@esbuild/linux-ia32': 0.27.2
- '@esbuild/linux-loong64': 0.27.2
- '@esbuild/linux-mips64el': 0.27.2
- '@esbuild/linux-ppc64': 0.27.2
- '@esbuild/linux-riscv64': 0.27.2
- '@esbuild/linux-s390x': 0.27.2
- '@esbuild/linux-x64': 0.27.2
- '@esbuild/netbsd-arm64': 0.27.2
- '@esbuild/netbsd-x64': 0.27.2
- '@esbuild/openbsd-arm64': 0.27.2
- '@esbuild/openbsd-x64': 0.27.2
- '@esbuild/openharmony-arm64': 0.27.2
- '@esbuild/sunos-x64': 0.27.2
- '@esbuild/win32-arm64': 0.27.2
- '@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
- optional: true
+
+
+ dependencies:
+ d3-array: 2.12.1
+ d3-shape: 1.3.7
- optionalDependencies:
- '@esbuild/aix-ppc64': 0.28.1
- '@esbuild/android-arm': 0.28.1
- '@esbuild/android-arm64': 0.28.1
- '@esbuild/android-x64': 0.28.1
- '@esbuild/darwin-arm64': 0.28.1
- '@esbuild/darwin-x64': 0.28.1
- '@esbuild/freebsd-arm64': 0.28.1
- '@esbuild/freebsd-x64': 0.28.1
- '@esbuild/linux-arm': 0.28.1
- '@esbuild/linux-arm64': 0.28.1
- '@esbuild/linux-ia32': 0.28.1
- '@esbuild/linux-loong64': 0.28.1
- '@esbuild/linux-mips64el': 0.28.1
- '@esbuild/linux-ppc64': 0.28.1
- '@esbuild/linux-riscv64': 0.28.1
- '@esbuild/linux-s390x': 0.28.1
- '@esbuild/linux-x64': 0.28.1
- '@esbuild/netbsd-arm64': 0.28.1
- '@esbuild/netbsd-x64': 0.28.1
- '@esbuild/openbsd-arm64': 0.28.1
- '@esbuild/openbsd-x64': 0.28.1
- '@esbuild/openharmony-arm64': 0.28.1
- '@esbuild/sunos-x64': 0.28.1
- '@esbuild/win32-arm64': 0.28.1
- '@esbuild/win32-ia32': 0.28.1
- '@esbuild/win32-x64': 0.28.1
+ dependencies:
+ d3-color: 3.1.0
+ d3-interpolate: 3.0.1
+ dependencies:
+ d3-array: 3.2.4
+ d3-format: 3.1.2
+ d3-interpolate: 3.0.1
+ d3-time: 3.1.0
+ d3-time-format: 4.1.0
+ dependencies:
+ d3-path: 1.0.9
+ dependencies:
+ d3-path: 3.1.0
+ dependencies:
+ d3-time: 3.1.0
+ dependencies:
+ d3-array: 3.2.4
+
dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/parser': 7.29.7
- hermes-parser: 0.25.1
- zod: 4.4.3
- zod-validation-error: 4.0.2([email protected])
- transitivePeerDependencies:
- - supports-color
+ d3-color: 3.1.0
+ d3-dispatch: 3.0.1
+ d3-ease: 3.0.1
+ d3-interpolate: 3.0.1
+ d3-selection: 3.0.0
+ d3-timer: 3.0.1
dependencies:
- esrecurse: 4.3.0
- estraverse: 4.3.0
- optional: true
+ d3-dispatch: 3.0.1
+ d3-drag: 3.0.0
+ d3-interpolate: 3.0.1
+ d3-selection: 3.0.0
+ d3-transition: 3.0.1([email protected])
dependencies:
- '@types/esrecurse': 4.3.1
- '@types/estree': 1.0.9
- esrecurse: 4.3.0
- estraverse: 5.3.0
+ d3-array: 3.2.4
+ d3-axis: 3.0.0
+ d3-brush: 3.0.0
+ d3-chord: 3.0.1
+ d3-color: 3.1.0
+ d3-contour: 4.0.2
+ d3-delaunay: 6.0.4
+ d3-dispatch: 3.0.1
+ d3-drag: 3.0.0
+ d3-dsv: 3.0.1
+ d3-ease: 3.0.1
+ d3-fetch: 3.0.1
+ d3-force: 3.0.0
+ d3-format: 3.1.2
+ d3-geo: 3.1.1
+ d3-hierarchy: 3.1.2
+ d3-interpolate: 3.0.1
+ d3-path: 3.1.0
+ d3-polygon: 3.0.1
+ d3-quadtree: 3.0.1
+ d3-random: 3.0.1
+ d3-scale: 4.0.2
+ d3-scale-chromatic: 3.1.0
+ d3-selection: 3.0.0
+ d3-shape: 3.2.0
+ d3-time: 3.1.0
+ d3-time-format: 4.1.0
+ d3-timer: 3.0.1
+ d3-transition: 3.0.1([email protected])
+ d3-zoom: 3.0.0
+ dependencies:
+ d3: 7.9.0
+ lodash-es: 4.18.1
dependencies:
- '@eslint-community/eslint-utils': 4.10.1([email protected]([email protected])([email protected]))
- '@eslint-community/regexpp': 4.12.2
- '@eslint/config-array': 0.23.5([email protected])
- '@eslint/config-helpers': 0.6.0
- '@eslint/core': 1.2.1
- '@eslint/plugin-kit': 0.7.2
- '@humanfs/node': 0.16.8
- '@humanwhocodes/module-importer': 1.0.1
- '@humanwhocodes/retry': 0.4.3
- '@types/estree': 1.0.9
- ajv: 6.15.0
- cross-spawn: 7.0.6
- debug: 4.4.3([email protected])
- escape-string-regexp: 4.0.0
- eslint-scope: 9.1.2
- eslint-visitor-keys: 5.0.1
- espree: 11.2.0
- esquery: 1.7.0
- esutils: 2.0.3
- fast-deep-equal: 3.1.3
- file-entry-cache: 8.0.0
- find-up: 5.0.0
- glob-parent: 6.0.2
- ignore: 5.3.2
- imurmurhash: 0.1.4
- is-glob: 4.0.3
- json-stable-stringify-without-jsonify: 1.0.1
- minimatch: 10.2.6
- natural-compare: 1.4.0
- optionator: 0.9.4
+ whatwg-mimetype: 4.0.0
+ whatwg-url: 14.2.0
+
+
+
+ dependencies:
+ mimic-function: 5.0.1
+
+ dependencies:
+ ms: 2.1.3
optionalDependencies:
- jiti: 2.7.0
- transitivePeerDependencies:
- - supports-color
+ supports-color: 8.1.1
+
+
dependencies:
- acorn: 8.17.0
- acorn-jsx: 5.3.2([email protected])
- eslint-visitor-keys: 5.0.1
+ character-entities: 2.0.2
+ dependencies:
+ mimic-response: 3.1.0
+
+
+
+
+
+
dependencies:
- estraverse: 5.3.0
+ bundle-name: 4.1.0
+ default-browser-id: 5.0.1
dependencies:
- estraverse: 5.3.0
+ strip-bom: 4.0.0
- optional: true
+ dependencies:
+ es-define-property: 1.0.1
+ es-errors: 1.3.0
+ gopd: 1.2.0
+ optional: true
+ dependencies:
+ define-data-property: 1.1.4
+ has-property-descriptors: 1.0.2
+ object-keys: 1.1.1
+ optional: true
dependencies:
- '@types/estree': 1.0.8
+ robust-predicates: 3.0.3
+
+
+
optional: true
+ dependencies:
+ dequal: 2.0.3
+
+
dependencies:
- eventsource-parser: 3.0.6
+ htmlparser2: 3.10.1
dependencies:
- cross-spawn: 7.0.6
- get-stream: 6.0.1
- human-signals: 2.1.0
- is-stream: 2.0.1
- merge-stream: 2.0.0
- npm-run-path: 4.0.1
- onetime: 5.1.2
- signal-exit: 3.0.7
- strip-final-newline: 2.0.0
+ minimatch: 3.1.2
+ p-limit: 3.1.0
+ dependencies:
+ app-builder-lib: 26.15.3(patch_hash=4688f96749e3d76cf27bc535d874470bf264610a331db13644df7715d699acf1)([email protected])([email protected])([email protected])
+ builder-util: 26.15.3([email protected])
+ fs-extra: 10.1.0
+ js-yaml: 4.1.1
+ transitivePeerDependencies:
+ - electron-builder-squirrel-windows
+ - supports-color
+ dependencies:
+ esutils: 2.0.3
dependencies:
- os-homedir: 1.0.2
+ domelementtype: 2.3.0
+ entities: 2.2.0
dependencies:
- '@jest/expect-utils': 30.4.1
- '@jest/get-type': 30.1.0
- jest-matcher-utils: 30.4.1
- jest-message-util: 30.4.1
- jest-mock: 30.4.1
- jest-util: 30.4.1
+ domelementtype: 1.3.1
- dependencies:
- expo: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
+ optionalDependencies:
+ '@types/trusted-types': 2.0.7
dependencies:
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
+ dom-serializer: 0.2.2
+ domelementtype: 1.3.1
dependencies:
- expo: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
+ type-fest: 5.6.0
dependencies:
- '@expo/image-utils': 0.11.5([email protected])([email protected])
- expo: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
- react: 19.2.6
- transitivePeerDependencies:
- - supports-color
- - typescript
+ dotenv: 16.4.7
- dependencies:
- '@expo/image-utils': 0.11.5([email protected])([email protected])
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- react: 19.2.6
- transitivePeerDependencies:
- - supports-color
- - typescript
+
dependencies:
- '@expo/image-utils': 0.11.4([email protected])([email protected])
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- react: 19.2.6
+ '@drizzle-team/brocli': 0.10.2
+ '@esbuild-kit/esm-loader': 2.6.5
+ esbuild: 0.25.12
+ esbuild-register: 3.6.0([email protected])([email protected])
transitivePeerDependencies:
- supports-color
- - typescript
- dependencies:
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- react: 19.2.6
+ optionalDependencies:
+ '@opentelemetry/api': 1.9.1
+ '@types/better-sqlite3': 7.6.13
+ better-sqlite3: 12.10.1
+ bun-types: 1.3.14
dependencies:
- expo-application: 57.0.2([email protected])
- expo-crypto: 57.0.1([email protected])
- invariant: 2.2.4
- react: 19.2.6
- transitivePeerDependencies:
- - expo
- - supports-color
+ call-bind-apply-helpers: 1.0.2
+ es-errors: 1.3.0
+ gopd: 1.2.0
dependencies:
- expo-application: 57.0.2([email protected])
- expo-crypto: 57.0.1([email protected])
- invariant: 2.2.4
- react: 19.2.6
- transitivePeerDependencies:
- - expo
- - supports-color
+ readable-stream: 2.3.8
- dependencies:
- barcode-detector: 3.1.2(@types/[email protected])
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- react: 19.2.6
- optionalDependencies:
- transitivePeerDependencies:
- - '@types/emscripten'
+
dependencies:
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- react: 19.2.6
+ safe-buffer: 5.2.1
+
dependencies:
- '@expo/env': 2.4.3([email protected])
- expo: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
- transitivePeerDependencies:
- - supports-color
+ jake: 10.9.4
dependencies:
- '@expo/env': 2.4.3([email protected])
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
+ app-builder-lib: 26.15.3(patch_hash=4688f96749e3d76cf27bc535d874470bf264610a331db13644df7715d699acf1)([email protected])([email protected])([email protected])
+ builder-util: 26.15.3([email protected])
+ electron-winstaller: 5.4.0([email protected])
transitivePeerDependencies:
+ - dmg-builder
- supports-color
dependencies:
- '@expo/env': 2.4.2([email protected])
- expo: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
+ app-builder-lib: 26.15.3(patch_hash=4688f96749e3d76cf27bc535d874470bf264610a331db13644df7715d699acf1)([email protected])([email protected])([email protected])
+ builder-util: 26.15.3([email protected])
+ builder-util-runtime: 9.7.0([email protected])
+ chalk: 4.1.2
+ ci-info: 4.4.0
+ dmg-builder: 26.15.3([email protected])([email protected])
+ fs-extra: 10.1.0
+ lazy-val: 1.0.5
+ simple-update-notifier: 2.0.0
+ yargs: 17.7.2
transitivePeerDependencies:
+ - electron-builder-squirrel-windows
- supports-color
+
dependencies:
- '@expo/env': 2.4.2([email protected])
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
+ '@types/fs-extra': 9.0.13
+ aws4: 1.13.2
+ builder-util: 26.15.3([email protected])
+ builder-util-runtime: 9.7.0([email protected])
+ chalk: 4.1.2
+ form-data: 4.0.5
+ fs-extra: 10.1.0
+ lazy-val: 1.0.5
+ mime: 2.6.0
transitivePeerDependencies:
- supports-color
dependencies:
- expo: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
+ conf: 15.1.0
+ type-fest: 5.4.3
- dependencies:
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- dependencies:
- expo: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
- expo-dev-menu-interface: 57.0.0([email protected])
- expo-manifests: 57.0.2([email protected])
- expo-updates-interface: 57.0.2([email protected])
- transitivePeerDependencies:
- - react-native
+ optional: true
dependencies:
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- expo-dev-menu-interface: 57.0.0([email protected])
- expo-manifests: 57.0.1([email protected])
- expo-updates-interface: 57.0.1([email protected])
+ builder-util-runtime: 9.7.0([email protected])
+ fs-extra: 10.1.0
+ js-yaml: 4.1.1
+ lazy-val: 1.0.5
+ lodash.escaperegexp: 4.1.2
+ lodash.isequal: 4.5.0
+ semver: 7.7.3
+ tiny-typed-emitter: 2.1.0
transitivePeerDependencies:
- - react-native
+ - supports-color
dependencies:
- '@expo/schema-utils': 57.0.2
- expo: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
- expo-manifests: 57.0.2([email protected])
+ '@babel/core': 7.29.0([email protected])
+ '@babel/plugin-transform-arrow-functions': 7.27.1(@babel/[email protected]([email protected]))
+ cac: 6.7.14
+ esbuild: 0.25.12
+ magic-string: 0.30.21
+ picocolors: 1.1.1
+ optionalDependencies:
+ '@swc/core': 1.15.43
+ transitivePeerDependencies:
+ - supports-color
dependencies:
- '@expo/schema-utils': 57.0.2
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- expo-manifests: 57.0.1([email protected])
+ '@electron/asar': 3.4.1
+ debug: 4.4.3([email protected])
+ fs-extra: 7.0.1
+ lodash: 4.18.0
+ temp: 0.9.4
+ optionalDependencies:
+ '@electron/windows-sign': 1.2.2([email protected])
+ transitivePeerDependencies:
+ - supports-color
dependencies:
- expo: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
+ '@electron-internal/extract-zip': 1.0.3
+ '@electron/get': 5.0.0([email protected])
+ '@types/node': 24.13.3
+ transitivePeerDependencies:
+ - supports-color
- dependencies:
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- dependencies:
- expo: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
- expo-dev-menu-interface: 57.0.0([email protected])
- dependencies:
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- expo-dev-menu-interface: 57.0.0([email protected])
- dependencies:
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- ua-parser-js: 0.7.41
- dependencies:
- expo: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
- ua-parser-js: 0.7.41
dependencies:
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
-
+ once: 1.4.0
dependencies:
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
+ graceful-fs: 4.2.11
+ tapable: 2.3.0
dependencies:
- expo: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
+ graceful-fs: 4.2.11
+ tapable: 2.3.3
dependencies:
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- fontfaceobserver: 2.3.0
- react: 19.2.6
+ graceful-fs: 4.2.11
+ tapable: 2.3.3
+ optional: true
- dependencies:
- expo: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
- fontfaceobserver: 2.3.0
- react: 19.2.6
- dependencies:
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- react: 19.2.6
- dependencies:
- expo: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
- react: 19.2.6
- dependencies:
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- dependencies:
- expo: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
- dependencies:
- expo: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
- dependencies:
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- dependencies:
- expo: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
- expo-image-loader: 57.0.1([email protected])
dependencies:
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- expo-image-loader: 57.0.1([email protected])
+ is-arrayish: 0.2.1
- dependencies:
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- react: 19.2.6
- dependencies:
- expo: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
- react: 19.2.6
dependencies:
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- react: 19.2.6
+ es-errors: 1.3.0
dependencies:
- invariant: 2.2.4
- react: 19.2.6
- transitivePeerDependencies:
- - expo
- - supports-color
+ es-errors: 1.3.0
+ get-intrinsic: 1.3.0
+ has-tostringtag: 1.0.2
+ hasown: 2.0.4
+
+
dependencies:
- invariant: 2.2.4
- react: 19.2.6
+ debug: 4.4.3([email protected])
+ esbuild: 0.25.12
transitivePeerDependencies:
- - expo
- supports-color
dependencies:
- invariant: 2.2.4
- react: 19.2.6
+ debug: 4.4.3([email protected])
+ esbuild: 0.27.7
transitivePeerDependencies:
- - expo
- supports-color
+ optional: true
- dependencies:
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- react: 19.2.6
- rtl-detect: 1.1.2
+ optionalDependencies:
+ '@esbuild/android-arm': 0.18.20
+ '@esbuild/android-arm64': 0.18.20
+ '@esbuild/android-x64': 0.18.20
+ '@esbuild/darwin-arm64': 0.18.20
+ '@esbuild/darwin-x64': 0.18.20
+ '@esbuild/freebsd-arm64': 0.18.20
+ '@esbuild/freebsd-x64': 0.18.20
+ '@esbuild/linux-arm': 0.18.20
+ '@esbuild/linux-arm64': 0.18.20
+ '@esbuild/linux-ia32': 0.18.20
+ '@esbuild/linux-loong64': 0.18.20
+ '@esbuild/linux-mips64el': 0.18.20
+ '@esbuild/linux-ppc64': 0.18.20
+ '@esbuild/linux-riscv64': 0.18.20
+ '@esbuild/linux-s390x': 0.18.20
+ '@esbuild/linux-x64': 0.18.20
+ '@esbuild/netbsd-x64': 0.18.20
+ '@esbuild/openbsd-x64': 0.18.20
+ '@esbuild/sunos-x64': 0.18.20
+ '@esbuild/win32-arm64': 0.18.20
+ '@esbuild/win32-ia32': 0.18.20
+ '@esbuild/win32-x64': 0.18.20
- dependencies:
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- expo-json-utils: 57.0.1
+ optionalDependencies:
+ '@esbuild/aix-ppc64': 0.25.12
+ '@esbuild/android-arm': 0.25.12
+ '@esbuild/android-arm64': 0.25.12
+ '@esbuild/android-x64': 0.25.12
+ '@esbuild/darwin-arm64': 0.25.12
+ '@esbuild/darwin-x64': 0.25.12
+ '@esbuild/freebsd-arm64': 0.25.12
+ '@esbuild/freebsd-x64': 0.25.12
+ '@esbuild/linux-arm': 0.25.12
+ '@esbuild/linux-arm64': 0.25.12
+ '@esbuild/linux-ia32': 0.25.12
+ '@esbuild/linux-loong64': 0.25.12
+ '@esbuild/linux-mips64el': 0.25.12
+ '@esbuild/linux-ppc64': 0.25.12
+ '@esbuild/linux-riscv64': 0.25.12
+ '@esbuild/linux-s390x': 0.25.12
+ '@esbuild/linux-x64': 0.25.12
+ '@esbuild/netbsd-arm64': 0.25.12
+ '@esbuild/netbsd-x64': 0.25.12
+ '@esbuild/openbsd-arm64': 0.25.12
+ '@esbuild/openbsd-x64': 0.25.12
+ '@esbuild/openharmony-arm64': 0.25.12
+ '@esbuild/sunos-x64': 0.25.12
+ '@esbuild/win32-arm64': 0.25.12
+ '@esbuild/win32-ia32': 0.25.12
+ '@esbuild/win32-x64': 0.25.12
- dependencies:
- expo: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
- expo-json-utils: 57.0.2
+ optionalDependencies:
+ '@esbuild/aix-ppc64': 0.27.2
+ '@esbuild/android-arm': 0.27.2
+ '@esbuild/android-arm64': 0.27.2
+ '@esbuild/android-x64': 0.27.2
+ '@esbuild/darwin-arm64': 0.27.2
+ '@esbuild/darwin-x64': 0.27.2
+ '@esbuild/freebsd-arm64': 0.27.2
+ '@esbuild/freebsd-x64': 0.27.2
+ '@esbuild/linux-arm': 0.27.2
+ '@esbuild/linux-arm64': 0.27.2
+ '@esbuild/linux-ia32': 0.27.2
+ '@esbuild/linux-loong64': 0.27.2
+ '@esbuild/linux-mips64el': 0.27.2
+ '@esbuild/linux-ppc64': 0.27.2
+ '@esbuild/linux-riscv64': 0.27.2
+ '@esbuild/linux-s390x': 0.27.2
+ '@esbuild/linux-x64': 0.27.2
+ '@esbuild/netbsd-arm64': 0.27.2
+ '@esbuild/netbsd-x64': 0.27.2
+ '@esbuild/openbsd-arm64': 0.27.2
+ '@esbuild/openbsd-x64': 0.27.2
+ '@esbuild/openharmony-arm64': 0.27.2
+ '@esbuild/sunos-x64': 0.27.2
+ '@esbuild/win32-arm64': 0.27.2
+ '@esbuild/win32-ia32': 0.27.2
+ '@esbuild/win32-x64': 0.27.2
- dependencies:
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- expo-json-utils: 57.0.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
optional: true
- dependencies:
- '@expo/require-utils': 57.0.5([email protected])([email protected])
- '@expo/spawn-async': 1.8.0
- chalk: 4.1.2
- commander: 7.2.0
- transitivePeerDependencies:
- - supports-color
- - typescript
+ optionalDependencies:
+ '@esbuild/aix-ppc64': 0.28.1
+ '@esbuild/android-arm': 0.28.1
+ '@esbuild/android-arm64': 0.28.1
+ '@esbuild/android-x64': 0.28.1
+ '@esbuild/darwin-arm64': 0.28.1
+ '@esbuild/darwin-x64': 0.28.1
+ '@esbuild/freebsd-arm64': 0.28.1
+ '@esbuild/freebsd-x64': 0.28.1
+ '@esbuild/linux-arm': 0.28.1
+ '@esbuild/linux-arm64': 0.28.1
+ '@esbuild/linux-ia32': 0.28.1
+ '@esbuild/linux-loong64': 0.28.1
+ '@esbuild/linux-mips64el': 0.28.1
+ '@esbuild/linux-ppc64': 0.28.1
+ '@esbuild/linux-riscv64': 0.28.1
+ '@esbuild/linux-s390x': 0.28.1
+ '@esbuild/linux-x64': 0.28.1
+ '@esbuild/netbsd-arm64': 0.28.1
+ '@esbuild/netbsd-x64': 0.28.1
+ '@esbuild/openbsd-arm64': 0.28.1
+ '@esbuild/openbsd-x64': 0.28.1
+ '@esbuild/openharmony-arm64': 0.28.1
+ '@esbuild/sunos-x64': 0.28.1
+ '@esbuild/win32-arm64': 0.28.1
+ '@esbuild/win32-ia32': 0.28.1
+ '@esbuild/win32-x64': 0.28.1
- dependencies:
- '@expo/require-utils': 57.0.4([email protected])([email protected])
- '@expo/spawn-async': 1.8.0
- chalk: 4.1.2
- commander: 7.2.0
- transitivePeerDependencies:
- - supports-color
- - typescript
- dependencies:
- '@expo/expo-modules-macros-plugin': 0.6.1
- invariant: 2.2.4
- react: 19.2.6
- optionalDependencies:
- dependencies:
- '@expo/expo-modules-macros-plugin': 0.6.1
- invariant: 2.2.4
- react: 19.2.6
- optionalDependencies:
- dependencies:
- dependencies:
- dependencies:
- expo: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
- react: 19.2.6
dependencies:
- '@expo/image-utils': 0.11.5([email protected])([email protected])
- abort-controller: 3.0.0
- badgin: 1.2.3
- expo: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
- expo-application: 57.0.3([email protected])
- react: 19.2.6
+ '@babel/core': 7.29.0([email protected])
+ '@babel/parser': 7.29.7
+ hermes-parser: 0.25.1
+ zod: 4.4.3
+ zod-validation-error: 4.0.2([email protected])
transitivePeerDependencies:
- supports-color
- - typescript
dependencies:
- '@expo/image-utils': 0.11.4([email protected])([email protected])
- abort-controller: 3.0.0
- badgin: 1.2.3
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- expo-application: 57.0.2([email protected])
- react: 19.2.6
- transitivePeerDependencies:
- - supports-color
- - typescript
+ esrecurse: 4.3.0
+ estraverse: 4.3.0
+ optional: true
- [email protected](691084568689e210f8e7fee390d1f6f1):
dependencies:
- '@expo/schema-utils': 57.0.2
- '@radix-ui/react-slot': 1.2.4(@types/[email protected])([email protected])
- client-only: 0.0.1
- color: 4.2.3
- debug: 4.4.3([email protected])
- escape-string-regexp: 4.0.0
- expo: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
- expo-server: 57.0.3
- fast-deep-equal: 3.1.3
- invariant: 2.2.4
- nanoid: 3.3.19
- query-string: 7.1.3
- react: 19.2.6
- react-fast-compare: 3.2.2
- react-is: 19.2.8
- react-native-drawer-layout: 4.2.9(patch_hash=2c85d47b8c522e96ada8afb04ee4070d68146adf9d4e3ce6e2d5eae27dd4e0bc)(d32d33a65e77f70270531dc9d691c4b5)
- server-only: 0.0.1
- sf-symbols-typescript: 2.2.0
- shallowequal: 1.1.0
- standard-navigation: 0.0.5
- optionalDependencies:
- react-dom: 19.2.6([email protected])
- transitivePeerDependencies:
- - '@babel/core'
- - '@types/react'
- - '@types/react-dom'
- - expo-font
- - react-native-worklets
- - supports-color
+ '@types/esrecurse': 4.3.1
+ '@types/estree': 1.0.9
+ esrecurse: 4.3.0
+ estraverse: 5.3.0
+
+
- [email protected](aeaf345642587960b4671195b62009d3):
dependencies:
- '@expo/schema-utils': 57.0.2
- '@radix-ui/react-slot': 1.2.4(@types/[email protected])([email protected])
- '@testing-library/jest-dom': 6.9.1
- '@testing-library/user-event': 14.6.1(@testing-library/[email protected])
- client-only: 0.0.1
- color: 4.2.3
+ '@eslint-community/eslint-utils': 4.10.1([email protected]([email protected])([email protected]))
+ '@eslint-community/regexpp': 4.12.2
+ '@eslint/config-array': 0.23.5([email protected])
+ '@eslint/config-helpers': 0.6.0
+ '@eslint/core': 1.2.1
+ '@eslint/plugin-kit': 0.7.2
+ '@humanfs/node': 0.16.8
+ '@humanwhocodes/module-importer': 1.0.1
+ '@humanwhocodes/retry': 0.4.3
+ '@types/estree': 1.0.9
+ ajv: 6.15.0
+ cross-spawn: 7.0.6
debug: 4.4.3([email protected])
escape-string-regexp: 4.0.0
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- expo-server: 57.0.1
+ eslint-scope: 9.1.2
+ eslint-visitor-keys: 5.0.1
+ espree: 11.2.0
+ esquery: 1.7.0
+ esutils: 2.0.3
fast-deep-equal: 3.1.3
- invariant: 2.2.4
- nanoid: 3.3.12
- query-string: 7.1.3
- react: 19.2.6
- react-fast-compare: 3.2.2
- react-is: 19.2.6
- react-native-drawer-layout: 4.2.9(patch_hash=2c85d47b8c522e96ada8afb04ee4070d68146adf9d4e3ce6e2d5eae27dd4e0bc)(d32d33a65e77f70270531dc9d691c4b5)
- server-only: 0.0.1
- sf-symbols-typescript: 2.2.0
- shallowequal: 1.1.0
- standard-navigation: 0.0.5
+ file-entry-cache: 8.0.0
+ find-up: 5.0.0
+ glob-parent: 6.0.2
+ ignore: 5.3.2
+ imurmurhash: 0.1.4
+ is-glob: 4.0.3
+ json-stable-stringify-without-jsonify: 1.0.1
+ minimatch: 10.2.6
+ natural-compare: 1.4.0
+ optionator: 0.9.4
optionalDependencies:
- react-dom: 19.2.6([email protected])
+ jiti: 2.7.0
transitivePeerDependencies:
- - '@babel/core'
- - '@testing-library/dom'
- - '@types/react'
- - '@types/react-dom'
- - expo-font
- - react-native-worklets
- supports-color
- dependencies:
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
-
dependencies:
- expo: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
-
+ acorn: 8.17.0
+ acorn-jsx: 5.3.2([email protected])
+ eslint-visitor-keys: 5.0.1
dependencies:
- expo: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
- react: 19.2.6
+ estraverse: 5.3.0
dependencies:
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- react: 19.2.6
+ estraverse: 5.3.0
- dependencies:
- '@expo/config-plugins': 57.0.6([email protected])([email protected])
- '@expo/image-utils': 0.11.4([email protected])([email protected])
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- xml2js: 0.6.0
- transitivePeerDependencies:
- - supports-color
- - typescript
+ optional: true
- dependencies:
- '@expo/config-plugins': 57.0.9([email protected])([email protected])
- '@expo/image-utils': 0.11.5([email protected])([email protected])
- expo: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
- xml2js: 0.6.0
- transitivePeerDependencies:
- - supports-color
- - typescript
- dependencies:
- expo: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
- react: 19.2.6
+
dependencies:
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- react: 19.2.6
+ '@types/estree': 1.0.8
- dependencies:
- '@expo-google-fonts/material-symbols': 0.4.42
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- react: 19.2.6
- sf-symbols-typescript: 2.2.0
- dependencies:
- '@expo-google-fonts/material-symbols': 0.4.42
- expo: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
- react: 19.2.6
- sf-symbols-typescript: 2.2.0
- dependencies:
- '@react-native/normalize-colors': 0.86.0
- debug: 4.4.3([email protected])
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- optionalDependencies:
- transitivePeerDependencies:
- - supports-color
+ optional: true
- dependencies:
- '@react-native/normalize-colors': 0.86.3
- debug: 4.4.3([email protected])
- expo: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
- optionalDependencies:
- transitivePeerDependencies:
- - supports-color
dependencies:
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
+ eventsource-parser: 3.0.6
dependencies:
- expo: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
+ cross-spawn: 7.0.6
+ get-stream: 6.0.1
+ human-signals: 2.1.0
+ is-stream: 2.0.1
+ merge-stream: 2.0.0
+ npm-run-path: 4.0.1
+ onetime: 5.1.2
+ signal-exit: 3.0.7
+ strip-final-newline: 2.0.0
- dependencies:
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- optional: true
- dependencies:
- '@expo/code-signing-certificates': 0.0.6
- '@expo/plist': 0.8.1
- '@expo/spawn-async': 1.8.0
- arg: 4.1.3
- chalk: 4.1.2
- debug: 4.4.3([email protected])
- expo: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
- expo-eas-client: 57.0.4
- expo-manifests: 57.0.2([email protected])
- expo-structured-headers: 57.0.1
- expo-updates-interface: 57.0.2([email protected])
- getenv: 2.0.0
- glob: 13.0.6
- ignore: 5.3.2
- nullthrows: 1.1.1
- react: 19.2.6
- resolve-from: 5.0.0
- optionalDependencies:
- transitivePeerDependencies:
- - supports-color
- dependencies:
- '@expo/code-signing-certificates': 0.0.6
- '@expo/plist': 0.8.1
- '@expo/spawn-async': 1.8.0
- arg: 4.1.3
- chalk: 4.1.2
- debug: 4.4.3([email protected])
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- expo-eas-client: 57.0.4
- expo-manifests: 57.0.2([email protected])
- expo-structured-headers: 57.0.1
- expo-updates-interface: 57.0.2([email protected])
- getenv: 2.0.0
- glob: 13.0.6
- ignore: 5.3.2
- nullthrows: 1.1.1
- react: 19.2.6
- resolve-from: 5.0.0
- optionalDependencies:
- transitivePeerDependencies:
- - supports-color
- optional: true
- dependencies:
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- react: 19.2.6
dependencies:
- expo: 57.0.23(c158e8574076c3ffb0337bc0b9650c26)
+ os-homedir: 1.0.2
- dependencies:
- expo: 57.0.8(cece98f32a2022c0430d630815af4720)
- [email protected](c158e8574076c3ffb0337bc0b9650c26):
- dependencies:
- '@babel/runtime': 7.29.7
- '@expo/config': 57.0.9([email protected])([email protected])
- '@expo/config-plugins': 57.0.9([email protected])([email protected])
- '@expo/fingerprint': 0.20.13([email protected])
- '@expo/local-build-cache-provider': 57.0.8([email protected])([email protected])
- '@expo/metro': 56.0.2([email protected])
- '@expo/metro-config': 57.0.12([email protected])([email protected])([email protected])
- '@ungap/structured-clone': 1.3.0
- expo-keep-awake: 57.0.2([email protected])([email protected])
- expo-modules-autolinking: 57.0.13([email protected])([email protected])
- pretty-format: 29.7.0
- react: 19.2.6
- react-refresh: 0.14.2
- whatwg-url-minimum: 0.1.2
- optionalDependencies:
- react-dom: 19.2.6([email protected])
- transitivePeerDependencies:
- - '@babel/core'
- - bufferutil
- - expo-router
- - expo-widgets
- - react-native-worklets
- - react-server-dom-webpack
- - supports-color
- - typescript
- - utf-8-validate
- [email protected](cece98f32a2022c0430d630815af4720):
dependencies:
- '@babel/runtime': 7.29.2
- '@expo/config': 57.0.6([email protected])([email protected])
- '@expo/config-plugins': 57.0.6([email protected])([email protected])
- '@expo/fingerprint': 0.20.6([email protected])
- '@expo/local-build-cache-provider': 57.0.4([email protected])([email protected])
- '@expo/metro': 56.0.0([email protected])
- '@expo/metro-config': 57.0.7([email protected])([email protected])([email protected])
- '@ungap/structured-clone': 1.3.0
- expo-keep-awake: 57.0.1([email protected])([email protected])
- expo-modules-autolinking: 57.0.9([email protected])([email protected])
- pretty-format: 29.7.0
- react: 19.2.6
- react-refresh: 0.14.2
- whatwg-url-minimum: 0.1.2
- optionalDependencies:
- react-dom: 19.2.6([email protected])
- transitivePeerDependencies:
- - '@babel/core'
- - bufferutil
- - expo-router
- - expo-widgets
- - react-native-worklets
- - react-server-dom-webpack
- - supports-color
- - typescript
- - utf-8-validate
+ '@jest/expect-utils': 30.4.1
+ '@jest/get-type': 30.1.0
+ jest-matcher-utils: 30.4.1
+ jest-message-util: 30.4.1
+ jest-mock: 30.4.1
+ jest-util: 30.4.1
@@ -27119,26 +20629,10 @@ snapshots:
dependencies:
reusify: 1.1.0
-
dependencies:
bser: 2.1.1
-
- dependencies:
- cross-fetch: 3.2.0([email protected])
- fbjs-css-vars: 1.0.2
- loose-envify: 1.4.0
- object-assign: 4.1.1
- promise: 7.3.1
- setimmediate: 1.0.5
- ua-parser-js: 1.0.41
- transitivePeerDependencies:
- - encoding
-
dependencies:
walk-up-path: 4.0.0
@@ -27147,17 +20641,11 @@ snapshots:
optionalDependencies:
picomatch: 4.0.3
- optionalDependencies:
- picomatch: 4.0.5
-
dependencies:
node-domexception: 1.0.0
web-streams-polyfill: 3.3.3
-
@@ -27191,20 +20679,6 @@ snapshots:
dependencies:
to-regex-range: 5.0.1
-
- dependencies:
- debug: 2.6.9([email protected])
- encodeurl: 1.0.2
- escape-html: 1.0.3
- on-finished: 2.3.0
- parseurl: 1.3.3
- statuses: 1.5.0
- unpipe: 1.0.0
- transitivePeerDependencies:
- - supports-color
-
dependencies:
debug: 4.4.3([email protected])
@@ -27262,14 +20736,10 @@ snapshots:
-
optionalDependencies:
debug: 4.4.3([email protected])
-
dependencies:
cross-spawn: 7.0.6
@@ -27307,8 +20777,6 @@ snapshots:
react: 19.2.6
react-dom: 19.2.6([email protected])
-
@@ -27425,8 +20893,6 @@ snapshots:
dependencies:
resolve-pkg-maps: 1.0.0
-
dependencies:
js-binary-schema-parser: 2.0.3
@@ -27677,40 +21143,14 @@ snapshots:
optional: true
-
-
-
-
dependencies:
hermes-estree: 0.25.1
- dependencies:
- hermes-estree: 0.35.0
-
- dependencies:
- hermes-estree: 0.36.0
-
- dependencies:
- hermes-estree: 0.36.1
-
-
- dependencies:
- react-is: 16.13.1
-
dependencies:
parse-passwd: 1.0.0
@@ -27721,10 +21161,6 @@ snapshots:
dependencies:
lru-cache: 6.0.0
- dependencies:
- lru-cache: 10.4.3
-
dependencies:
lru-cache: 11.2.5
@@ -27808,8 +21244,6 @@ snapshots:
-
dependencies:
safer-buffer: 2.1.2
@@ -27830,17 +21264,8 @@ snapshots:
dependencies:
'@types/node': 16.9.1
- dependencies:
- queue: 6.0.2
-
- dependencies:
- parent-module: 1.0.1
- resolve-from: 4.0.0
-
dependencies:
cjs-module-lexer: 2.2.0
@@ -27869,18 +21294,10 @@ snapshots:
- dependencies:
- css-in-js-utils: 3.1.0
-
- dependencies:
- loose-envify: 1.4.0
-
dependencies:
'@inversifyjs/common': 1.5.2
@@ -27902,24 +21319,12 @@ snapshots:
-
- dependencies:
- binary-extensions: 2.3.0
-
dependencies:
hasown: 2.0.2
- dependencies:
- hasown: 2.0.4
-
-
@@ -27945,8 +21350,6 @@ snapshots:
-
@@ -27965,10 +21368,6 @@ snapshots:
- dependencies:
- is-docker: 2.2.1
-
dependencies:
is-inside-container: 1.0.0
@@ -28094,78 +21493,26 @@ snapshots:
- babel-plugin-macros
- supports-color
- dependencies:
- '@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
- transitivePeerDependencies:
- - '@types/node'
- - babel-plugin-macros
- - esbuild-register
- - supports-color
- - ts-node
-
- dependencies:
- '@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-config: 30.4.2(@types/[email protected])([email protected])
- jest-util: 30.4.1
- jest-validate: 30.4.1
- yargs: 17.7.2
- transitivePeerDependencies:
- - '@types/node'
- - babel-plugin-macros
- - esbuild-register
- - supports-color
- - ts-node
- optional: true
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@jest/get-type': 30.1.0
- '@jest/pattern': 30.4.0
- '@jest/test-sequencer': 30.4.1
- '@jest/types': 30.4.1
- chalk: 4.1.2
- ci-info: 4.4.0
- deepmerge: 4.3.1
- glob: 10.5.0
- graceful-fs: 4.2.11
- jest-circus: 30.4.2([email protected])
- jest-docblock: 30.4.0
- jest-environment-node: 30.4.1
- jest-regex-util: 30.4.0
- jest-resolve: 30.4.1
- jest-runner: 30.4.2([email protected])
+ dependencies:
+ '@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
- parse-json: 5.2.0
- pretty-format: 30.4.1
- slash: 3.0.0
- strip-json-comments: 3.1.1
- optionalDependencies:
- '@types/node': 24.12.0
- esbuild-register: 3.6.0([email protected])([email protected])
+ yargs: 17.7.2
transitivePeerDependencies:
+ - '@types/node'
- babel-plugin-macros
+ - esbuild-register
- supports-color
+ - ts-node
dependencies:
'@babel/core': 7.29.0([email protected])
'@jest/get-type': 30.1.0
@@ -28191,13 +21538,13 @@ snapshots:
slash: 3.0.0
strip-json-comments: 3.1.1
optionalDependencies:
- '@types/node': 24.13.3
+ '@types/node': 24.12.0
esbuild-register: 3.6.0([email protected])([email protected])
transitivePeerDependencies:
- babel-plugin-macros
- supports-color
dependencies:
'@babel/core': 7.29.0([email protected])
'@jest/get-type': 30.1.0
@@ -28223,11 +21570,11 @@ snapshots:
slash: 3.0.0
strip-json-comments: 3.1.1
optionalDependencies:
- '@types/node': 25.2.0
+ '@types/node': 24.13.3
+ esbuild-register: 3.6.0([email protected])([email protected])
transitivePeerDependencies:
- babel-plugin-macros
- supports-color
- optional: true
dependencies:
@@ -28258,8 +21605,6 @@ snapshots:
jest-util: 30.4.1
jest-validate: 30.4.1
-
dependencies:
'@jest/types': 30.4.1
@@ -28449,15 +21794,6 @@ snapshots:
transitivePeerDependencies:
- supports-color
- dependencies:
- '@jest/types': 29.6.3
- '@types/node': 24.13.3
- chalk: 4.1.2
- ci-info: 3.9.0
- graceful-fs: 4.2.11
- picomatch: 2.3.1
-
dependencies:
'@jest/types': 30.4.1
@@ -28467,15 +21803,6 @@ snapshots:
graceful-fs: 4.2.11
picomatch: 4.0.3
- dependencies:
- '@jest/types': 29.6.3
- camelcase: 6.3.0
- chalk: 4.1.2
- jest-get-type: 29.6.3
- leven: 3.1.0
- pretty-format: 29.7.0
-
dependencies:
'@jest/get-type': 30.1.0
@@ -28514,13 +21841,6 @@ snapshots:
supports-color: 8.1.1
optional: true
- dependencies:
- '@types/node': 24.13.3
- jest-util: 29.7.0
- merge-stream: 2.0.0
- supports-color: 8.1.1
-
dependencies:
'@types/node': 24.13.3
@@ -28542,22 +21862,6 @@ snapshots:
- supports-color
- ts-node
- dependencies:
- '@jest/types': 30.4.1
- import-local: 3.2.0
- jest-cli: 30.4.2(@types/[email protected])([email protected])
- transitivePeerDependencies:
- - '@types/node'
- - babel-plugin-macros
- - esbuild-register
- - supports-color
- - ts-node
- optional: true
-
-
dependencies:
'@jimp/core': 1.6.1([email protected])
@@ -28590,8 +21894,6 @@ snapshots:
transitivePeerDependencies:
- supports-color
-
@@ -28625,8 +21927,6 @@ snapshots:
dependencies:
argparse: 2.0.1
-
dependencies:
cssstyle: 4.6.0
@@ -28759,8 +22059,6 @@ snapshots:
'@koromix/koffi-win32-ia32': 3.1.4
'@koromix/koffi-win32-x64': 3.1.4
-
dependencies:
picocolors: 1.1.1
@@ -28779,124 +22077,72 @@ snapshots:
prelude-ls: 1.2.1
type-check: 0.4.0
- dependencies:
- debug: 2.6.9([email protected])
- marky: 1.3.0
- transitivePeerDependencies:
- - supports-color
-
optional: true
optional: true
- optional: true
-
optional: true
optional: true
- optional: true
-
optional: true
optional: true
- optional: true
-
optional: true
optional: true
- optional: true
-
optional: true
optional: true
- optional: true
-
optional: true
optional: true
- optional: true
-
optional: true
optional: true
- optional: true
-
optional: true
optional: true
- optional: true
-
optional: true
optional: true
- optional: true
-
optional: true
optional: true
- optional: true
-
optional: true
optional: true
- dependencies:
- detect-libc: 1.0.3
- optionalDependencies:
- lightningcss-darwin-arm64: 1.27.0
- lightningcss-darwin-x64: 1.27.0
- lightningcss-freebsd-x64: 1.27.0
- lightningcss-linux-arm-gnueabihf: 1.27.0
- lightningcss-linux-arm64-gnu: 1.27.0
- lightningcss-linux-arm64-musl: 1.27.0
- lightningcss-linux-x64-gnu: 1.27.0
- lightningcss-linux-x64-musl: 1.27.0
- lightningcss-win32-arm64-msvc: 1.27.0
- lightningcss-win32-x64-msvc: 1.27.0
-
dependencies:
detect-libc: 2.1.2
@@ -28954,22 +22200,14 @@ snapshots:
-
-
- dependencies:
- chalk: 2.4.2
-
dependencies:
is-unicode-supported: 2.1.0
@@ -28987,10 +22225,6 @@ snapshots:
- dependencies:
- tslib: 2.8.1
-
@@ -29054,8 +22288,6 @@ snapshots:
-
dependencies:
escape-string-regexp: 4.0.0
@@ -29218,11 +22450,8 @@ snapshots:
dependencies:
'@types/mdast': 4.0.4
-
-
+ optional: true
@@ -29245,393 +22474,38 @@ snapshots:
tree-dump: 1.1.0([email protected])
tslib: 2.8.1
-
-
- dependencies:
- is-plain-obj: 2.1.0
-
-
-
-
- dependencies:
- '@braintree/sanitize-url': 7.1.2
- '@iconify/utils': 3.1.4
- '@mermaid-js/parser': 1.2.1
- '@types/d3': 7.4.3
- '@upsetjs/venn.js': 2.0.0
- cytoscape: 3.34.1
- cytoscape-cose-bilkent: 4.1.0([email protected])
- cytoscape-fcose: 2.2.0([email protected])
- d3: 7.9.0
- d3-sankey: 0.12.3
- dagre-d3-es: 7.0.14
- dayjs: 1.11.23
- dompurify: 3.4.13
- es-toolkit: 1.51.0
- fastdom: 1.0.12
- katex: 0.16.47
- khroma: 2.1.0
- marked: 16.4.2
- roughjs: 4.6.6
- stylis: 4.4.0
- ts-dedent: 2.2.0
- uuid: 13.0.0
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
- flow-enums-runtime: 0.0.6
- hermes-parser: 0.35.0
- metro-cache-key: 0.84.4
- nullthrows: 1.1.1
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
- flow-enums-runtime: 0.0.6
- hermes-parser: 0.35.0
- metro-cache-key: 0.84.5
- nullthrows: 1.1.1
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- flow-enums-runtime: 0.0.6
-
- dependencies:
- flow-enums-runtime: 0.0.6
-
- dependencies:
- exponential-backoff: 3.1.3
- flow-enums-runtime: 0.0.6
- https-proxy-agent: 7.0.6([email protected])
- metro-core: 0.84.4
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- exponential-backoff: 3.1.3
- flow-enums-runtime: 0.0.6
- https-proxy-agent: 7.0.6([email protected])
- metro-core: 0.84.5
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- connect: 3.7.0([email protected])
- flow-enums-runtime: 0.0.6
- jest-validate: 29.7.0
- metro: 0.84.4([email protected])
- metro-cache: 0.84.4([email protected])
- metro-core: 0.84.4
- metro-runtime: 0.84.4
- yaml: 2.9.0
- transitivePeerDependencies:
- - bufferutil
- - supports-color
- - utf-8-validate
-
- dependencies:
- connect: 3.7.0([email protected])
- flow-enums-runtime: 0.0.6
- jest-validate: 29.7.0
- metro: 0.84.5([email protected])
- metro-cache: 0.84.5([email protected])
- metro-core: 0.84.5
- metro-runtime: 0.84.5
- yaml: 2.9.0
- transitivePeerDependencies:
- - bufferutil
- - supports-color
- - utf-8-validate
-
- dependencies:
- flow-enums-runtime: 0.0.6
- lodash.throttle: 4.1.1
- metro-resolver: 0.84.4
-
- dependencies:
- flow-enums-runtime: 0.0.6
- lodash.throttle: 4.1.1
- metro-resolver: 0.84.5
-
- dependencies:
- debug: 4.4.3([email protected])
- fb-watchman: 2.0.2
- flow-enums-runtime: 0.0.6
- graceful-fs: 4.2.11
- invariant: 2.2.4
- jest-worker: 29.7.0
- micromatch: 4.0.8
- nullthrows: 1.1.1
- walker: 1.0.8
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- debug: 4.4.3([email protected])
- fb-watchman: 2.0.2
- flow-enums-runtime: 0.0.6
- graceful-fs: 4.2.11
- invariant: 2.2.4
- jest-worker: 29.7.0
- micromatch: 4.0.8
- nullthrows: 1.1.1
- walker: 1.0.8
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- flow-enums-runtime: 0.0.6
- terser: 5.46.0
-
- dependencies:
- flow-enums-runtime: 0.0.6
- terser: 5.46.0
-
- dependencies:
- flow-enums-runtime: 0.0.6
-
- dependencies:
- flow-enums-runtime: 0.0.6
-
- dependencies:
- '@babel/runtime': 7.29.2
- flow-enums-runtime: 0.0.6
-
- dependencies:
- '@babel/runtime': 7.29.7
- flow-enums-runtime: 0.0.6
-
- dependencies:
- '@babel/traverse': 7.29.0([email protected])
- '@babel/types': 7.29.7
- flow-enums-runtime: 0.0.6
- invariant: 2.2.4
- metro-symbolicate: 0.84.4([email protected])
- nullthrows: 1.1.1
- ob1: 0.84.4
- source-map: 0.5.7
- vlq: 1.0.1
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- '@babel/traverse': 7.29.7([email protected])
- '@babel/types': 7.29.7
- flow-enums-runtime: 0.0.6
- invariant: 2.2.4
- metro-symbolicate: 0.84.5([email protected])
- nullthrows: 1.1.1
- ob1: 0.84.5
- source-map: 0.5.7
- vlq: 1.0.1
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- flow-enums-runtime: 0.0.6
- invariant: 2.2.4
- metro-source-map: 0.84.4([email protected])
- nullthrows: 1.1.1
- source-map: 0.5.7
- vlq: 1.0.1
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- flow-enums-runtime: 0.0.6
- invariant: 2.2.4
- metro-source-map: 0.84.5([email protected])
- nullthrows: 1.1.1
- source-map: 0.5.7
- vlq: 1.0.1
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/generator': 7.29.1
- '@babel/template': 7.28.6
- '@babel/traverse': 7.29.0([email protected])
- flow-enums-runtime: 0.0.6
- nullthrows: 1.1.1
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/generator': 7.29.7
- '@babel/template': 7.29.7
- '@babel/traverse': 7.29.7([email protected])
- flow-enums-runtime: 0.0.6
- nullthrows: 1.1.1
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/generator': 7.29.1
- '@babel/parser': 7.29.7
- '@babel/types': 7.29.7
- flow-enums-runtime: 0.0.6
- metro: 0.84.4([email protected])
- metro-babel-transformer: 0.84.4([email protected])
- metro-cache: 0.84.4([email protected])
- metro-cache-key: 0.84.4
- metro-minify-terser: 0.84.4
- metro-source-map: 0.84.4([email protected])
- metro-transform-plugins: 0.84.4([email protected])
- nullthrows: 1.1.1
- transitivePeerDependencies:
- - bufferutil
- - supports-color
- - utf-8-validate
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/generator': 7.29.7
- '@babel/parser': 7.29.7
- '@babel/types': 7.29.7
- flow-enums-runtime: 0.0.6
- metro: 0.84.5([email protected])
- metro-babel-transformer: 0.84.5([email protected])
- metro-cache: 0.84.5([email protected])
- metro-cache-key: 0.84.5
- metro-minify-terser: 0.84.5
- metro-source-map: 0.84.5([email protected])
- metro-transform-plugins: 0.84.5([email protected])
- nullthrows: 1.1.1
- transitivePeerDependencies:
- - bufferutil
- - supports-color
- - utf-8-validate
- dependencies:
- '@babel/code-frame': 7.29.7
- '@babel/core': 7.29.0([email protected])
- '@babel/generator': 7.29.1
- '@babel/parser': 7.29.7
- '@babel/template': 7.28.6
- '@babel/traverse': 7.29.0([email protected])
- '@babel/types': 7.29.7
- accepts: 2.0.0
- ci-info: 2.0.0
- connect: 3.7.0([email protected])
- debug: 4.4.3([email protected])
- error-stack-parser: 2.1.4
- flow-enums-runtime: 0.0.6
- graceful-fs: 4.2.11
- hermes-parser: 0.35.0
- image-size: 1.2.1
- invariant: 2.2.4
- jest-worker: 29.7.0
- jsc-safe-url: 0.2.4
- lodash.throttle: 4.1.1
- metro-babel-transformer: 0.84.4([email protected])
- metro-cache: 0.84.4([email protected])
- metro-cache-key: 0.84.4
- metro-config: 0.84.4([email protected])
- metro-core: 0.84.4
- metro-file-map: 0.84.4([email protected])
- metro-resolver: 0.84.4
- metro-runtime: 0.84.4
- metro-source-map: 0.84.4([email protected])
- metro-symbolicate: 0.84.4([email protected])
- metro-transform-plugins: 0.84.4([email protected])
- metro-transform-worker: 0.84.4([email protected])
- mime-types: 3.0.2
- nullthrows: 1.1.1
- serialize-error: 2.1.0
- source-map: 0.5.7
- throat: 5.0.0
- ws: 7.5.11
- yargs: 17.7.2
- transitivePeerDependencies:
- - bufferutil
- - supports-color
- - utf-8-validate
dependencies:
- '@babel/code-frame': 7.29.7
- '@babel/core': 7.29.0([email protected])
- '@babel/generator': 7.29.7
- '@babel/parser': 7.29.7
- '@babel/template': 7.29.7
- '@babel/traverse': 7.29.7([email protected])
- '@babel/types': 7.29.7
- accepts: 2.0.0
- ci-info: 2.0.0
- connect: 3.7.0([email protected])
- debug: 4.4.3([email protected])
- error-stack-parser: 2.1.4
- flow-enums-runtime: 0.0.6
- graceful-fs: 4.2.11
- hermes-parser: 0.35.0
- invariant: 2.2.4
- jest-worker: 29.7.0
- jsc-safe-url: 0.2.4
- lodash.throttle: 4.1.1
- metro-babel-transformer: 0.84.5([email protected])
- metro-cache: 0.84.5([email protected])
- metro-cache-key: 0.84.5
- metro-config: 0.84.5([email protected])
- metro-core: 0.84.5
- metro-file-map: 0.84.5([email protected])
- metro-resolver: 0.84.5
- metro-runtime: 0.84.5
- metro-source-map: 0.84.5([email protected])
- metro-symbolicate: 0.84.5([email protected])
- metro-transform-plugins: 0.84.5([email protected])
- metro-transform-worker: 0.84.5([email protected])
- mime-types: 3.0.2
- nullthrows: 1.1.1
- serialize-error: 2.1.0
- source-map: 0.5.7
- throat: 5.0.0
- ws: 7.5.11
- yargs: 17.7.2
- transitivePeerDependencies:
- - bufferutil
- - supports-color
- - utf-8-validate
+ '@braintree/sanitize-url': 7.1.2
+ '@iconify/utils': 3.1.4
+ '@mermaid-js/parser': 1.2.1
+ '@types/d3': 7.4.3
+ '@upsetjs/venn.js': 2.0.0
+ cytoscape: 3.34.1
+ cytoscape-cose-bilkent: 4.1.0([email protected])
+ cytoscape-fcose: 2.2.0([email protected])
+ d3: 7.9.0
+ d3-sankey: 0.12.3
+ dagre-d3-es: 7.0.14
+ dayjs: 1.11.23
+ dompurify: 3.4.13
+ es-toolkit: 1.51.0
+ fastdom: 1.0.12
+ katex: 0.16.47
+ khroma: 2.1.0
+ marked: 16.4.2
+ roughjs: 4.6.6
+ stylis: 4.4.0
+ ts-dedent: 2.2.0
+ uuid: 13.0.0
dependencies:
@@ -29841,14 +22715,10 @@ snapshots:
dependencies:
mime-db: 1.54.0
-
-
@@ -29916,8 +22786,6 @@ snapshots:
-
@@ -29998,10 +22866,6 @@ snapshots:
- '@types/node'
optional: true
-
-
optional: true
@@ -30013,44 +22877,20 @@ snapshots:
-
+ optional: true
- [email protected](cdede081bba1d0b3a72e545f4ba8514a):
- dependencies:
- comment-json: 4.5.1
- debug: 4.4.3([email protected])
- react-native-css-interop: 0.2.1(cdede081bba1d0b3a72e545f4ba8514a)
- tailwindcss: 3.4.19([email protected])([email protected])
- transitivePeerDependencies:
- - react
- - react-native
- - react-native-reanimated
- - react-native-safe-area-context
- - react-native-svg
- - supports-color
-
-
-
optional: true
- dependencies:
- lower-case: 2.0.2
- tslib: 2.8.1
-
dependencies:
semver: 7.8.5
@@ -30065,20 +22905,12 @@ snapshots:
- dependencies:
- whatwg-url: 5.0.0
- optionalDependencies:
- encoding: 0.1.13
-
dependencies:
data-uri-to-buffer: 4.0.1
fetch-blob: 3.2.0
formdata-polyfill: 4.0.10
-
dependencies:
env-paths: 2.2.1
@@ -30106,7 +22938,8 @@ snapshots:
+ optional: true
dependencies:
@@ -30116,23 +22949,10 @@ snapshots:
- dependencies:
- hosted-git-info: 7.0.2
- proc-log: 4.2.0
- semver: 7.8.5
- validate-npm-package-name: 5.0.1
-
dependencies:
path-key: 3.1.1
- dependencies:
- boolbase: 1.0.0
-
-
@@ -30167,18 +22987,8 @@ snapshots:
transitivePeerDependencies:
- supports-color
- dependencies:
- flow-enums-runtime: 0.0.6
-
- dependencies:
- flow-enums-runtime: 0.0.6
-
-
@@ -30188,24 +22998,14 @@ snapshots:
- dependencies:
- ee-first: 1.1.1
-
dependencies:
ee-first: 1.1.1
-
dependencies:
wrappy: 1.0.2
- dependencies:
- mimic-fn: 1.2.0
-
dependencies:
mimic-fn: 2.1.0
@@ -30229,11 +23029,6 @@ snapshots:
is-inside-container: 1.0.0
wsl-utils: 0.1.0
- dependencies:
- is-docker: 2.2.1
- is-wsl: 2.2.0
-
optionalDependencies:
'@aws-sdk/credential-provider-node': 3.972.84
@@ -30257,15 +23052,6 @@ snapshots:
type-check: 0.4.0
word-wrap: 1.2.5
- dependencies:
- chalk: 2.4.2
- cli-cursor: 2.1.0
- cli-spinners: 2.9.2
- log-symbols: 2.2.0
- strip-ansi: 5.2.0
- wcwidth: 1.0.1
-
dependencies:
chalk: 5.6.2
@@ -30527,10 +23313,6 @@ snapshots:
- dependencies:
- callsites: 3.1.0
-
@@ -30559,10 +23341,6 @@ snapshots:
- dependencies:
- pngjs: 3.4.0
-
@@ -30585,8 +23363,6 @@ snapshots:
-
@@ -30610,30 +23386,18 @@ snapshots:
-
- dependencies:
- react: 19.2.6
-
-
-
@@ -30703,27 +23467,6 @@ snapshots:
path-data-parser: 0.1.0
points-on-curve: 0.2.0
- dependencies:
- postcss: 8.5.15
- postcss-value-parser: 4.2.0
- read-cache: 1.0.0
- resolve: 1.22.11
-
- dependencies:
- camelcase-css: 2.0.1
- postcss: 8.5.15
-
- dependencies:
- lilconfig: 3.1.3
- optionalDependencies:
- jiti: 1.21.7
- postcss: 8.5.15
- tsx: 4.22.4
- yaml: 2.9.0
-
dependencies:
lilconfig: 3.1.3
@@ -30733,18 +23476,6 @@ snapshots:
tsx: 4.22.4
yaml: 2.9.0
- dependencies:
- postcss: 8.5.15
- postcss-selector-parser: 6.1.2
-
- dependencies:
- cssesc: 3.0.0
- util-deprecate: 1.0.2
-
-
dependencies:
nanoid: 3.3.12
@@ -30756,6 +23487,7 @@ snapshots:
nanoid: 3.3.16
picocolors: 1.1.1
source-map-js: 1.2.1
+ optional: true
dependencies:
@@ -30782,22 +23514,6 @@ snapshots:
'@opentelemetry/api': 1.9.1
rxjs: 7.8.2
- [email protected](c26a19fc3594f2db3c6353d64e9ae4e7):
- dependencies:
- '@posthog/core': 1.60.1
- '@posthog/types': 1.416.0
- optionalDependencies:
- expo-application: 57.0.2([email protected])
- expo-device: 57.0.1([email protected])
- expo-localization: 57.0.1([email protected])([email protected])
-
dependencies:
commander: 9.5.0
@@ -30834,12 +23550,6 @@ snapshots:
ansi-styles: 5.2.0
react-is: 17.0.2
- dependencies:
- '@jest/schemas': 29.6.3
- ansi-styles: 5.2.0
- react-is: 18.3.1
-
dependencies:
'@jest/schemas': 30.4.1
@@ -30847,8 +23557,6 @@ snapshots:
react-is-18: [email protected]
react-is-19: [email protected]
-
@@ -30864,14 +23572,6 @@ snapshots:
err-code: 2.0.3
retry: 0.12.0
- dependencies:
- asap: 2.0.6
-
- dependencies:
- asap: 2.0.6
-
dependencies:
kleur: 3.0.3
@@ -31041,19 +23741,8 @@ snapshots:
- dependencies:
- decode-uri-component: 0.2.2
- filter-obj: 1.1.0
- split-on-first: 1.1.0
- strict-uri-encode: 2.0.0
-
- dependencies:
- inherits: 2.0.4
-
@@ -31139,14 +23828,6 @@ snapshots:
minimist: 1.2.8
strip-json-comments: 2.0.1
- dependencies:
- shell-quote: 1.9.0
- ws: 7.5.11
- transitivePeerDependencies:
- - bufferutil
- - utf-8-validate
-
dependencies:
typescript: 5.9.3
@@ -31194,259 +23875,50 @@ snapshots:
- oxlint-tsgolint
- react
- supports-color
- - vite-plus
-
- dependencies:
- react: 19.2.6
- scheduler: 0.27.0
-
-
- dependencies:
- react: 19.2.6
-
- dependencies:
- '@react-grab/cli': 0.2.0
- bippy: 0.6.1([email protected])
- optionalDependencies:
- react: 19.2.6
-
- [email protected](patch_hash=a8cd00b963d4ae6787cc267a2345cc1b32bcba5fa1131328b8017ee0d316ab0e)([email protected]([email protected]))([email protected]):
- dependencies:
- react: 19.2.6
- react-dom: 19.2.6([email protected])
-
-
-
-
-
-
- dependencies:
- '@types/hast': 3.0.4
- '@types/mdast': 4.0.4
- '@types/react': 19.2.17
- devlop: 1.1.0
- hast-util-to-jsx-runtime: 2.3.6([email protected])
- html-url-attributes: 3.0.1
- mdast-util-to-hast: 13.2.1
- react: 19.2.6
- remark-parse: 11.0.0([email protected])
- remark-rehype: 11.1.2
- unified: 11.0.5
- unist-util-visit: 5.1.0
- vfile: 6.0.3
- transitivePeerDependencies:
- - supports-color
-
- [email protected](cdede081bba1d0b3a72e545f4ba8514a):
- dependencies:
- '@babel/helper-module-imports': 7.28.6([email protected])
- '@babel/traverse': 7.29.0([email protected])
- '@babel/types': 7.29.7
- debug: 4.4.3([email protected])
- lightningcss: 1.27.0
- react: 19.2.6
- semver: 7.8.4
- tailwindcss: 3.4.19([email protected])([email protected])
- optionalDependencies:
- transitivePeerDependencies:
- - supports-color
-
- [email protected](patch_hash=2c85d47b8c522e96ada8afb04ee4070d68146adf9d4e3ce6e2d5eae27dd4e0bc)(d32d33a65e77f70270531dc9d691c4b5):
- dependencies:
- color: 4.2.3
- react: 19.2.6
- use-latest-callback: 0.2.6([email protected])
-
- dependencies:
- '@egjs/hammerjs': 2.0.17
- '@types/react-test-renderer': 19.1.0
- hoist-non-react-statics: 3.3.2
- invariant: 2.2.4
- react: 19.2.6
-
- dependencies:
- react: 19.2.6
-
- dependencies:
- react: 19.2.6
-
- dependencies:
- react: 19.2.6
-
- dependencies:
- react: 19.2.6
-
- dependencies:
- react: 19.2.6
-
- dependencies:
- react: 19.2.6
- semver: 7.8.4
-
- dependencies:
- react: 19.2.6
+ - vite-plus
dependencies:
react: 19.2.6
- react-freeze: 1.0.4([email protected])
- warn-once: 0.1.1
-
- dependencies:
- '@svgr/core': 8.1.0([email protected])([email protected])
- path-dirname: 1.0.2
- transitivePeerDependencies:
- - supports-color
- - typescript
+ scheduler: 0.27.0
dependencies:
- css-select: 5.2.2
- css-tree: 1.1.3
+ '@react-grab/cli': 0.2.0
+ bippy: 0.6.1([email protected])
+ optionalDependencies:
react: 19.2.6
+ [email protected](patch_hash=a8cd00b963d4ae6787cc267a2345cc1b32bcba5fa1131328b8017ee0d316ab0e)([email protected]([email protected]))([email protected]):
dependencies:
- '@babel/runtime': 7.28.6
- '@react-native/normalize-colors': 0.74.89
- fbjs: 3.0.5([email protected])
- inline-style-prefixer: 7.0.1
- memoize-one: 6.0.0
- nullthrows: 1.1.1
- postcss-value-parser: 4.2.0
react: 19.2.6
react-dom: 19.2.6([email protected])
- styleq: 0.1.3
- transitivePeerDependencies:
- - encoding
- dependencies:
- escape-string-regexp: 4.0.0
- invariant: 2.2.4
- react: 19.2.6
- dependencies:
- '@typescript/native-preview': 7.0.0-dev.20260707.2
- escape-string-regexp: 4.0.0
- invariant: 2.2.4
- react: 19.2.6
- dependencies:
- '@babel/core': 7.29.0([email protected])
- '@babel/plugin-transform-arrow-functions': 7.27.1(@babel/[email protected]([email protected]))
- '@babel/plugin-transform-class-properties': 7.28.6(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-classes': 7.28.6(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-nullish-coalescing-operator': 7.28.6(@babel/[email protected]([email protected]))
- '@babel/plugin-transform-optional-chaining': 7.28.6(@babel/[email protected]([email protected]))([email protected])
- '@babel/plugin-transform-shorthand-properties': 7.27.1(@babel/[email protected]([email protected]))
- '@babel/plugin-transform-template-literals': 7.27.1(@babel/[email protected]([email protected]))
- '@babel/plugin-transform-unicode-regex': 7.27.1(@babel/[email protected]([email protected]))
- '@babel/preset-typescript': 7.28.5(@babel/[email protected]([email protected]))([email protected])
- '@babel/types': 7.29.7
- '@react-native/metro-config': 0.86.0(@babel/[email protected]([email protected]))([email protected])
- convert-source-map: 2.0.0
- react: 19.2.6
- semver: 7.8.4
- transitivePeerDependencies:
- - supports-color
- dependencies:
- '@react-native/assets-registry': 0.86.0
- '@react-native/codegen': 0.86.0(@babel/[email protected]([email protected]))
- '@react-native/community-cli-plugin': 0.86.0(@react-native/[email protected](@babel/[email protected]([email protected]))([email protected]))([email protected])
- '@react-native/gradle-plugin': 0.86.0
- '@react-native/js-polyfills': 0.86.0
- '@react-native/normalize-colors': 0.86.0
- abort-controller: 3.0.0
- anser: 1.4.10
- ansi-regex: 5.0.1
- babel-plugin-syntax-hermes-parser: 0.36.0
- base64-js: 1.5.1
- commander: 12.1.0
- flow-enums-runtime: 0.0.6
- hermes-compiler: 250829098.0.14
- invariant: 2.2.4
- memoize-one: 5.2.1
- metro-runtime: 0.84.4
- metro-source-map: 0.84.4([email protected])
- nullthrows: 1.1.1
- pretty-format: 29.7.0
- promise: 8.3.0
- react: 19.2.6
- react-devtools-core: 6.1.5
- react-refresh: 0.14.2
- regenerator-runtime: 0.13.11
- scheduler: 0.27.0
- semver: 7.8.4
- stacktrace-parser: 0.1.11
- tinyglobby: 0.2.15
- whatwg-fetch: 3.6.20
- ws: 7.5.11
- yargs: 17.7.2
- optionalDependencies:
+
+ dependencies:
+ '@types/hast': 3.0.4
+ '@types/mdast': 4.0.4
'@types/react': 19.2.17
+ devlop: 1.1.0
+ hast-util-to-jsx-runtime: 2.3.6([email protected])
+ html-url-attributes: 3.0.1
+ mdast-util-to-hast: 13.2.1
+ react: 19.2.6
+ remark-parse: 11.0.0([email protected])
+ remark-rehype: 11.1.2
+ unified: 11.0.5
+ unist-util-visit: 5.1.0
+ vfile: 6.0.3
transitivePeerDependencies:
- - '@babel/core'
- - '@react-native-community/cli'
- - '@react-native/metro-config'
- - bufferutil
- supports-color
- - utf-8-validate
-
@@ -31523,12 +23995,6 @@ snapshots:
optionalDependencies:
'@types/react': 19.2.17
- dependencies:
- react: 19.2.6
- react-is: 19.2.6
- scheduler: 0.27.0
-
dependencies:
react: 19.2.6
@@ -31542,10 +24008,6 @@ snapshots:
transitivePeerDependencies:
- supports-color
- dependencies:
- pify: 2.3.0
-
dependencies:
core-util-is: 1.0.3
@@ -31562,10 +24024,6 @@ snapshots:
string_decoder: 1.3.0
util-deprecate: 1.0.2
- dependencies:
- picomatch: 2.3.1
-
@@ -31585,14 +24043,6 @@ snapshots:
- dependencies:
- regenerate: 1.4.2
-
-
-
dependencies:
regex-utilities: 2.3.0
@@ -31603,21 +24053,6 @@ snapshots:
dependencies:
regex-utilities: 2.3.0
- dependencies:
- regenerate: 1.4.2
- regenerate-unicode-properties: 10.2.2
- regjsgen: 0.8.0
- regjsparser: 0.13.0
- unicode-match-property-ecmascript: 2.0.0
- unicode-match-property-value-ecmascript: 2.2.1
-
-
- dependencies:
- jsesc: 3.1.0
-
dependencies:
'@types/hast': 3.0.4
@@ -31697,36 +24132,20 @@ snapshots:
expand-tilde: 1.2.2
global-modules: 0.2.3
-
-
dependencies:
is-core-module: 2.16.1
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
- dependencies:
- onetime: 2.0.1
- signal-exit: 3.0.7
-
dependencies:
onetime: 7.0.0
@@ -31803,27 +24222,6 @@ snapshots:
- '@emnapi/core'
- '@emnapi/runtime'
- dependencies:
- '@oxc-project/runtime': 0.101.0
- fdir: 6.5.0([email protected])
- lightningcss: 1.32.0
- picomatch: 4.0.3
- postcss: 8.5.15
- rolldown: 1.0.0-beta.53(@emnapi/[email protected])(@emnapi/[email protected])
- tinyglobby: 0.2.15
- optionalDependencies:
- '@types/node': 25.2.0
- esbuild: 0.27.7
- fsevents: 2.3.3
- jiti: 1.21.7
- terser: 5.46.0
- tsx: 4.22.4
- yaml: 2.9.0
- transitivePeerDependencies:
- - '@emnapi/core'
- - '@emnapi/runtime'
-
dependencies:
'@oxc-project/runtime': 0.101.0
@@ -31919,8 +24317,6 @@ snapshots:
-
@@ -31939,8 +24335,6 @@ snapshots:
-
dependencies:
truncate-utf8-bytes: 1.0.2
@@ -31976,24 +24370,6 @@ snapshots:
- dependencies:
- debug: 2.6.9([email protected])
- depd: 2.0.0
- destroy: 1.2.0
- encodeurl: 2.0.0
- escape-html: 1.0.3
- etag: 1.8.1
- fresh: 0.5.2
- http-errors: 2.0.1
- mime: 1.6.0
- ms: 2.1.3
- on-finished: 2.4.1
- range-parser: 1.2.1
- statuses: 2.0.2
- transitivePeerDependencies:
- - supports-color
-
dependencies:
debug: 4.4.3([email protected])
@@ -32010,8 +24386,6 @@ snapshots:
transitivePeerDependencies:
- supports-color
-
dependencies:
type-fest: 0.13.1
@@ -32023,15 +24397,6 @@ snapshots:
- dependencies:
- encodeurl: 2.0.0
- escape-html: 1.0.3
- parseurl: 1.3.3
- send: 0.19.2([email protected])
- transitivePeerDependencies:
- - supports-color
-
dependencies:
encodeurl: 2.0.0
@@ -32041,18 +24406,10 @@ snapshots:
transitivePeerDependencies:
- supports-color
-
-
-
-
dependencies:
shebang-regex: 3.0.0
@@ -32114,18 +24471,8 @@ snapshots:
once: 1.4.0
simple-concat: 1.0.1
- dependencies:
- bplist-creator: 0.1.0
- bplist-parser: 0.3.1
- plist: 3.1.0
-
- dependencies:
- is-arrayish: 0.3.4
-
dependencies:
semver: 7.8.4
@@ -32144,15 +24491,8 @@ snapshots:
-
- dependencies:
- dot-case: 3.0.4
- tslib: 2.8.1
-
dependencies:
csstype: 3.2.3
@@ -32172,8 +24512,6 @@ snapshots:
buffer-from: 1.1.2
source-map: 0.6.1
-
@@ -32198,8 +24536,6 @@ snapshots:
transitivePeerDependencies:
- supports-color
-
@@ -32213,14 +24549,6 @@ snapshots:
-
- dependencies:
- type-fest: 0.7.1
-
-
dependencies:
'@stablelib/base64': 1.0.1
@@ -32228,8 +24556,6 @@ snapshots:
-
@@ -32263,13 +24589,9 @@ snapshots:
- react-dom
- utf-8-validate
-
optional: true
-
@@ -32311,10 +24633,6 @@ snapshots:
character-entities-html4: 2.1.0
character-entities-legacy: 3.0.0
- dependencies:
- ansi-regex: 4.1.1
-
dependencies:
ansi-regex: 5.0.1
@@ -32349,8 +24667,6 @@ snapshots:
dependencies:
'@tokenizer/token': 0.3.0
-
dependencies:
stubborn-utils: 1.0.2
@@ -32367,8 +24683,6 @@ snapshots:
dependencies:
inline-style-parser: 0.2.7
-
@@ -32403,25 +24717,8 @@ snapshots:
dependencies:
has-flag: 4.0.0
- dependencies:
- has-flag: 4.0.0
- supports-color: 7.2.0
-
-
- dependencies:
- commander: 7.2.0
- css-select: 5.2.2
- css-tree: 2.3.1
- css-what: 6.2.2
- csso: 5.0.5
- picocolors: 1.1.1
- sax: 1.6.0
-
@@ -32438,34 +24735,6 @@ snapshots:
dependencies:
tailwindcss: 4.2.2
- dependencies:
- '@alloc/quick-lru': 5.2.0
- arg: 5.0.2
- chokidar: 3.6.0
- didyoumean: 1.2.2
- dlv: 1.1.3
- fast-glob: 3.3.3
- glob-parent: 6.0.2
- is-glob: 4.0.3
- jiti: 1.21.7
- lilconfig: 3.1.3
- micromatch: 4.0.8
- normalize-path: 3.0.0
- object-hash: 3.0.0
- picocolors: 1.1.1
- postcss: 8.5.15
- postcss-import: 15.1.0([email protected])
- postcss-js: 4.1.0([email protected])
- postcss-nested: 6.2.0([email protected])
- postcss-selector-parser: 6.1.2
- resolve: 1.22.11
- sucrase: 3.35.1
- transitivePeerDependencies:
- - tsx
- - yaml
-
@@ -32507,11 +24776,6 @@ snapshots:
mkdirp: 0.5.6
rimraf: 2.6.3
- dependencies:
- ansi-escapes: 4.3.2
- supports-hyperlinks: 2.3.0
-
dependencies:
'@jridgewell/trace-mapping': 0.3.31
@@ -32533,6 +24797,7 @@ snapshots:
acorn: 8.17.0
commander: 2.20.3
source-map-support: 0.5.21
+ optional: true
dependencies:
@@ -32552,8 +24817,6 @@ snapshots:
dependencies:
tslib: 2.8.1
-
dependencies:
semver: 5.7.2
@@ -32579,11 +24842,6 @@ snapshots:
fdir: 6.5.0([email protected])
picomatch: 4.0.3
- dependencies:
- fdir: 6.5.0([email protected])
- picomatch: 4.0.5
-
@@ -32630,8 +24888,6 @@ snapshots:
'@tokenizer/token': 0.3.0
ieee754: 1.2.1
-
@@ -32643,8 +24899,6 @@ snapshots:
tldts: 7.0.22
optional: true
-
dependencies:
punycode: 2.3.1
@@ -32777,8 +25031,6 @@ snapshots:
-
@@ -32825,10 +25077,6 @@ snapshots:
optional: true
-
-
@@ -32848,17 +25096,6 @@ snapshots:
-
- dependencies:
- unicode-canonical-property-names-ecmascript: 2.0.1
- unicode-property-aliases-ecmascript: 2.2.0
-
-
-
dependencies:
'@types/unist': 3.0.3
@@ -32960,6 +25197,7 @@ snapshots:
browserslist: 4.28.7
escalade: 3.2.0
picocolors: 1.1.1
+ optional: true
dependencies:
@@ -32972,10 +25210,6 @@ snapshots:
optionalDependencies:
'@types/react': 19.2.17
- dependencies:
- react: 19.2.6
-
dependencies:
detect-node-es: 1.1.0
@@ -32996,14 +25230,10 @@ snapshots:
-
-
@@ -33012,19 +25242,8 @@ snapshots:
'@types/istanbul-lib-coverage': 2.0.6
convert-source-map: 2.0.0
-
- dependencies:
- react: 19.2.6
- react-dom: 19.2.6([email protected])
- transitivePeerDependencies:
- - '@types/react'
- - '@types/react-dom'
-
dependencies:
'@types/unist': 3.0.3
@@ -33056,15 +25275,15 @@ snapshots:
- supports-color
- typescript
dependencies:
- '@vitest/expect': 4.1.6
- '@vitest/pretty-format': 4.1.6
- '@vitest/runner': 4.1.6
- '@vitest/snapshot': 4.1.6
- '@vitest/spy': 4.1.6
- '@vitest/utils': 4.1.6
+ '@vitest/expect': 4.1.8
+ '@vitest/pretty-format': 4.1.8
+ '@vitest/runner': 4.1.8
+ '@vitest/snapshot': 4.1.8
+ '@vitest/spy': 4.1.8
+ '@vitest/utils': 4.1.8
es-module-lexer: 2.0.0
expect-type: 1.3.0
magic-string: 0.30.21
@@ -33076,19 +25295,20 @@ 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
- '@types/node': 25.2.0
+ '@types/node': 20.19.41
+ '@vitest/ui': 4.1.8([email protected])
jsdom: 26.1.0([email protected])
transitivePeerDependencies:
- msw
dependencies:
'@vitest/expect': 4.1.8
'@vitest/pretty-format': 4.1.8
'@vitest/runner': 4.1.8
'@vitest/snapshot': 4.1.8
@@ -33105,17 +25325,18 @@ 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
- '@types/node': 20.19.41
+ '@types/node': 24.12.0
+ '@vitest/coverage-v8': 4.1.9([email protected])
'@vitest/ui': 4.1.8([email protected])
jsdom: 26.1.0([email protected])
transitivePeerDependencies:
- msw
dependencies:
'@vitest/expect': 4.1.8
@@ -33140,7 +25361,6 @@ snapshots:
optionalDependencies:
'@opentelemetry/api': 1.9.1
'@types/node': 24.12.0
- '@vitest/coverage-v8': 4.1.9([email protected])
'@vitest/ui': 4.1.8([email protected])
jsdom: 26.1.0([email protected])
transitivePeerDependencies:
@@ -33176,8 +25396,6 @@ snapshots:
transitivePeerDependencies:
- msw
-
dependencies:
'@types/jasmine': 3.10.19
@@ -33213,17 +25431,11 @@ snapshots:
dependencies:
makeerror: 1.0.12
-
dependencies:
graceful-fs: 4.2.11
optional: true
- dependencies:
- defaults: 1.0.4
-
@@ -33238,8 +25450,6 @@ snapshots:
asn1js: 3.0.10
tslib: 2.8.1
-
@@ -33293,22 +25503,13 @@ snapshots:
dependencies:
iconv-lite: 0.6.3
-
-
dependencies:
tr46: 5.1.1
webidl-conversions: 7.0.0
- dependencies:
- tr46: 0.0.3
- webidl-conversions: 3.0.1
-
@@ -33368,19 +25569,12 @@ snapshots:
imurmurhash: 0.1.4
signal-exit: 4.1.0
-
dependencies:
is-wsl: 3.1.0
- dependencies:
- simple-plist: 1.3.1
- uuid: 7.0.3
-
@@ -33390,11 +25584,6 @@ snapshots:
sax: 1.6.0
xmlbuilder: 11.0.1
- dependencies:
- sax: 1.6.0
- xmlbuilder: 11.0.1
-
@@ -33476,8 +25665,3 @@ snapshots:
react: 19.2.6
-
- dependencies:
- '@types/emscripten': 1.41.5
- type-fest: 5.6.0
diff --git a/products/desktop/pnpm-workspace.yaml b/products/desktop/pnpm-workspace.yaml
index 106dcef4440a..7a88a8f50e5b 100644
--- a/products/desktop/pnpm-workspace.yaml
+++ b/products/desktop/pnpm-workspace.yaml
@@ -172,5 +172,3 @@ patchedDependencies:
node-pty: patches/node-pty.patch
react-hotkeys-hook: patches/react-hotkeys-hook.patch
- # Drawer spring mass 3 -> 1: the stock open/close feels sluggish on mobilehog.
- react-native-drawer-layout: patches/react-native-drawer-layout.patch
diff --git a/products/desktop/scripts/check-mobile-types.mjs b/products/desktop/scripts/check-mobile-types.mjs
deleted file mode 100644
index acaaf233320e..000000000000
--- a/products/desktop/scripts/check-mobile-types.mjs
+++ /dev/null
@@ -1,183 +0,0 @@
-#!/usr/bin/env node
-import { spawnSync } from "node:child_process";
-import { existsSync, readFileSync, writeFileSync } from "node:fs";
-import { dirname, join } from "node:path";
-import { fileURLToPath } from "node:url";
-
-const ROOT = join(dirname(fileURLToPath(import.meta.url)), "..");
-const BASELINE = join(ROOT, "scripts", "mobile-type-baseline.json");
-const MOBILE = join(ROOT, "apps", "mobile");
-
-const USAGE = `check-mobile-types — typecheck apps/mobile, failing only on errors that are not already baselined.
-
- node scripts/check-mobile-types.mjs verify: fail on any error not in the baseline
- node scripts/check-mobile-types.mjs --init (re)generate the baseline from current errors
- node scripts/check-mobile-types.mjs --prune drop baseline entries that no longer error (after fixing)
-
-apps/mobile had no typecheck at all, so a breaking change to a shared package
-(a new method on a platform interface, a renamed export) only surfaced when
-someone opened the file. Metro strips types, so nothing else caught it. The
-baseline grandfathers the errors that already existed so that gap could be
-closed today; its length is the cleanup still owed. Goal: 0.`;
-
-const ERROR_LINE = /^(\S.*?)\((\d+),(\d+)\): error (TS\d+): (.*)$/;
-const ABSOLUTE_PATH = /\/\S*\/(node_modules\/\S*)/g;
-
-/**
- * Some messages quote a resolved absolute path (TS7016 names the JS file it
- * could not find types for). The path differs between a laptop and CI, so a
- * baseline written on one machine would not match on the other.
- */
-function normalizeMessage(message) {
- return message.replaceAll(ROOT, "<desktop>").replace(ABSOLUTE_PATH, "$1");
-}
-
-/**
- * Error identity is file + code + message, without line/column, so unrelated
- * edits above an error don't churn the baseline. The cost: swapping one
- * baselined error for an identical one elsewhere in the same file keeps the
- * count level and passes. Keying on lines would trade that narrow hole for a
- * baseline that needs rewriting on every edit, which is the worse deal.
- */
-function runTsc() {
- const result = spawnSync(
- "pnpm",
- ["exec", "tsc", "--noEmit", "--pretty", "false"],
- {
- cwd: MOBILE,
- encoding: "utf8",
- },
- );
- const output = `${result.stdout ?? ""}${result.stderr ?? ""}`;
- const errors = {};
- let parsed = 0;
-
- for (const line of output.split("\n")) {
- const match = ERROR_LINE.exec(line);
- if (!match) continue;
- const [, file, , , code, message] = match;
- const key = `${code} ${normalizeMessage(message)}`;
- errors[file] ??= {};
- errors[file][key] = (errors[file][key] ?? 0) + 1;
- parsed += 1;
- }
-
- // tsc exits non-zero for a broken config or a missing compiler too, and that
- // must not read as "no errors found".
- if (result.status !== 0 && parsed === 0) {
- console.error(`\n✗ tsc failed without reporting type errors:\n\n${output}`);
- process.exit(1);
- }
-
- return errors;
-}
-
-function loadBaseline() {
- if (!existsSync(BASELINE)) return {};
- return JSON.parse(readFileSync(BASELINE, "utf8")).files ?? {};
-}
-
-function saveBaseline(files) {
- const sorted = Object.fromEntries(
- Object.keys(files)
- .filter((file) => Object.keys(files[file]).length)
- .sort()
- .map((file) => [
- file,
- Object.fromEntries(
- Object.keys(files[file])
- .sort()
- .map((message) => [message, files[file][message]]),
- ),
- ]),
- );
- writeFileSync(
- BASELINE,
- `${JSON.stringify(
- {
- note: "Pre-existing apps/mobile type errors, counted per file and message. Remove entries as you fix them. Goal: empty.",
- files: sorted,
- },
- null,
- 2,
- )}\n`,
- );
-}
-
-function count(files) {
- return Object.values(files).reduce(
- (total, byKey) =>
- total + Object.values(byKey).reduce((sum, n) => sum + n, 0),
- 0,
- );
-}
-
-const mode = process.argv[2];
-if (mode === "--help" || mode === "-h") {
- console.log(USAGE);
- process.exit(0);
-}
-
-const current = runTsc();
-const baseline = loadBaseline();
-
-if (mode === "--init") {
- saveBaseline(current);
- console.log(`Baseline written: ${count(current)} known error(s).`);
- process.exit(0);
-}
-
-if (mode === "--prune") {
- const kept = {};
- for (const [file, byKey] of Object.entries(baseline)) {
- for (const [key, allowed] of Object.entries(byKey)) {
- const still = current[file]?.[key] ?? 0;
- if (!still) continue;
- kept[file] ??= {};
- kept[file][key] = Math.min(allowed, still);
- }
- }
- saveBaseline(kept);
- console.log(
- `Pruned. ${count(baseline) - count(kept)} fixed, ${count(kept)} remaining.`,
- );
- process.exit(0);
-}
-
-const fresh = [];
-let fixed = 0;
-
-for (const [file, byKey] of Object.entries(current)) {
- for (const [key, seen] of Object.entries(byKey)) {
- const allowed = baseline[file]?.[key] ?? 0;
- if (seen > allowed) fresh.push({ file, key, extra: seen - allowed });
- }
-}
-
-for (const [file, byKey] of Object.entries(baseline)) {
- for (const [key, allowed] of Object.entries(byKey)) {
- fixed += Math.max(0, allowed - (current[file]?.[key] ?? 0));
- }
-}
-
-if (fixed) {
- console.log(
- `\n✓ ${fixed} baselined error(s) fixed since the baseline — run --prune to shrink it.`,
- );
-}
-
-if (fresh.length) {
- console.error(`\n✗ ${fresh.length} NEW type error(s) in apps/mobile:\n`);
- for (const { file, key, extra } of fresh) {
- console.error(` ${file}\n ${key}${extra > 1 ? ` (×${extra})` : ""}`);
- }
- console.error(
- `\nFix them, or if this is a deliberate widening of an existing problem, justify it in review and rerun with --init.`,
- );
- process.exit(1);
-}
-
-console.log(
- `\n✓ No new type errors. ${count(baseline)} baselined error(s) remaining. Goal: 0.`,
-);
-process.exit(0);
diff --git a/products/desktop/scripts/mobile-type-baseline.json b/products/desktop/scripts/mobile-type-baseline.json
deleted file mode 100644
index aeccbdf3fb77..000000000000
--- a/products/desktop/scripts/mobile-type-baseline.json
+++ /dev/null
@@ -1,83 +0,0 @@
-{
- "note": "Pre-existing apps/mobile type errors, counted per file and message. Remove entries as you fix them. Goal: empty.",
- "files": {
- "src/app/mcp-servers/add-custom.tsx": {
- "TS2322 Type '\"none\"' is not assignable to type 'MCPAuthTypeEnum'.": 1,
- "TS2345 Argument of type '\"none\"' is not assignable to parameter of type 'MCPAuthTypeEnum | (() => MCPAuthTypeEnum)'.": 1
- },
- "src/app/mcp-servers/installation/[id].tsx": {
- "TS2559 Type 'McpServerInstallation' has no properties in common with type '{ transport_type?: string | null | undefined; }'.": 1
- },
- "src/app/mcp-servers/template/[id].tsx": {
- "TS2559 Type 'MCPServerTemplate' has no properties in common with type '{ transport_type?: string | null | undefined; }'.": 1
- },
- "src/app/task/[id].tsx": {
- "TS2322 Type 'TaskSession | undefined' is not assignable to type 'SessionActivityState | null | undefined'.": 1
- },
- "src/features/inbox/components/DiffBlock.tsx": {
- "TS2305 Module '\"@posthog/core/inbox/activityLog\"' has no exported member 'parseDiffLines'.": 1,
- "TS7006 Parameter 'i' implicitly has an 'any' type.": 1,
- "TS7006 Parameter 'line' implicitly has an 'any' type.": 1
- },
- "src/features/mcp/components/McpAppHost.tsx": {
- "TS2339 Property 'resource' does not exist on type 'NonNullable<NoInfer<TQueryFnData>>'.": 1,
- "TS2339 Property 'serverName' does not exist on type '{ server: string; tool: string; }'.": 2,
- "TS2339 Property 'tool' does not exist on type 'NonNullable<NoInfer<TQueryFnData>>'.": 1,
- "TS2339 Property 'toolName' does not exist on type '{ server: string; tool: string; }'.": 2,
- "TS2551 Property 'absoluteFillObject' does not exist on type 'typeof StyleSheet'. Did you mean 'absoluteFill'?": 1,
- "TS2769 No overload matches this call.": 1
- },
- "src/features/mcp/components/McpServerRow.tsx": {
- "TS2559 Type 'MCPServerTemplate' has no properties in common with type '{ transport_type?: string | null | undefined; }'.": 1,
- "TS2559 Type 'McpServerInstallation' has no properties in common with type '{ transport_type?: string | null | undefined; }'.": 1
- },
- "src/features/mcp/hooks.ts": {
- "TS2345 Argument of type 'InstallCustomMcpServerOptions' is not assignable to parameter of type '{ name: string; url: string; auth_type: MCPAuthTypeEnum; api_key?: string | undefined; description?: string | undefined; client_id?: string | undefined; client_secret?: string | undefined; install_source?: \"posthog\" | ... 1 more ... | undefined; posthog_code_callback_url?: string | undefined; } & McpGatewayInstallSh...'.": 1,
- "TS2345 Argument of type 'InstallMcpTemplateOptions' is not assignable to parameter of type '{ template_id: string; api_key?: string | undefined; install_source?: \"posthog\" | \"posthog-code\" | undefined; posthog_code_callback_url?: string | undefined; } & McpGatewayInstallSharingOptions'.": 1,
- "TS2345 Argument of type '{ installation_id: string; install_source?: \"posthog\" | \"posthog-code\" | \"posthog-mobile\" | undefined; posthog_code_callback_url?: string | undefined; }' is not assignable to parameter of type '{ installation_id: string; install_source?: \"posthog\" | \"posthog-code\" | undefined; posthog_code_callback_url?: string | undefined; }'.": 1
- },
- "src/features/mcp/sandbox/useMcpUiResource.ts": {
- "TS2769 No overload matches this call.": 1
- },
- "src/features/navigation/components/NavDrawer.tsx": {
- "TS2551 Property 'absoluteFillObject' does not exist on type 'typeof StyleSheet'. Did you mean 'absoluteFill'?": 2
- },
- "src/features/tasks/components/PlanApprovalCard.tsx": {
- "TS2345 Argument of type 'CloudPermissionOption' is not assignable to parameter of type 'PermissionOption'.": 3
- },
- "src/features/tasks/components/TaskSessionView.test.tsx": {
- "TS18047 'renderer' is possibly 'null'.": 1,
- "TS2339 Property 'root' does not exist on type 'never'.": 1
- },
- "src/features/tasks/components/TaskSessionView.tsx": {
- "TS2305 Module '\"../types\"' has no exported member 'SessionEvent'.": 1,
- "TS2305 Module '\"../types\"' has no exported member 'SessionNotification'.": 1
- },
- "src/features/tasks/composer/DotBackground.tsx": {
- "TS2551 Property 'absoluteFillObject' does not exist on type 'typeof StyleSheet'. Did you mean 'absoluteFill'?": 1
- },
- "src/features/tasks/hooks/useCloudAttachmentPreview.ts": {
- "TS2305 Module '\"../types\"' has no exported member 'CloudArtifactRef'.": 1
- },
- "src/features/tasks/hooks/useIntegrations.ts": {
- "TS2345 Argument of type '{ [key: string]: unknown; kind: string; id: string | number; }[]' is not assignable to parameter of type 'Integration[]'.": 1,
- "TS2345 Argument of type '{ data: { integrationId: string | number; repos: any; }; isPending: boolean; isError: false; isRefetching: boolean; }[]' is not assignable to parameter of type 'readonly RepositoryQueryResult<TeamRepositoriesResult>[]'.": 1,
- "TS7015 Element implicitly has an 'any' type because index expression is not of type 'number'.": 2
- },
- "src/features/tasks/stores/taskSessionStore.ts": {
- "TS2305 Module '\"../types\"' has no exported member 'SessionEvent'.": 1,
- "TS2305 Module '\"../types\"' has no exported member 'SessionNotification'.": 1
- },
- "src/features/tasks/utils/promptAttachments.test.ts": {
- "TS2305 Module '\"../types\"' has no exported member 'SessionEvent'.": 1
- },
- "src/features/tasks/utils/promptAttachments.ts": {
- "TS2305 Module '\"../types\"' has no exported member 'CloudArtifactRef'.": 1,
- "TS2305 Module '\"../types\"' has no exported member 'SessionEvent'.": 1,
- "TS2353 Object literal may only specify known properties, and 'cloudArtifact' does not exist in type 'SessionNotificationAttachment'.": 1
- },
- "src/features/tasks/utils/repositorySelection.test.ts": {
- "TS2322 Type '{ installation_id: string; account: { name: string; }; } | { installation_id: string; }' is not assignable to type 'UserGithubIntegration'.": 1
- }
- }
-}