diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d7c9184b..d26e701b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,6 +48,22 @@ jobs: - name: Typecheck + build site run: npm run typecheck:site && npm run build:site + # The Expo app (mobile/) imports shared state, transport and renderer + # modules from src/ and calls the server through the desktop's typed + # buildBackend API, so a desktop or server change can break it + # without touching mobile/. Typecheck catches signature and state + # shape drift; the iOS export catches a shared module growing an + # import Metro can't bundle (Node / DOM / Electron-only). + - name: Install mobile dependencies + run: npm ci --prefix mobile + + - name: Mobile typecheck + unit tests + run: npm run typecheck:mobile && npm run test:mobile + + - name: Mobile bundle + working-directory: mobile + run: npx expo export --platform ios --output-dir "$RUNNER_TEMP/mobile-export" + # The headless server bundle is built separately from the Electron # build above (different vite config, different output dir). Builds # both `dist-headless/main` and `dist-headless/web-client`. @@ -64,3 +80,11 @@ jobs: # runnable locally and not buried in YAML. - name: Headless smoke test run: bash scripts/smoke-headless.sh + + # The mobile client's own NessClient / Fleet / list model driving the + # freshly-built headless server over WebSocket: snapshot, repo + worktree + # listing, aliases / pins / snoozes, panes and Chat tabs, tools-panel + # data. A renamed handler or changed state shape fails here. Logic in + # mobile/test/contract.test.ts. + - name: Mobile contract test + run: npm run test:mobile:contract diff --git a/CLAUDE.md b/CLAUDE.md index 7b4c537f..4df532d3 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -905,6 +905,31 @@ Catches tarball-layout / module-resolution / boot-time regressions before they ride a tag push to release. Run locally: `npm run build:headless && bash scripts/smoke-headless.sh`. +### Mobile client guard on every PR + +The Expo app in `mobile/` is a separate client of the same server, and it +reuses code from `src/`: the state slices + `rootReducer`, the WebSocket +transport, `renderer/build-backend.ts` (its **only** way to call the +server — never a hand-written channel string), and pure renderer modules +(`merge-backend-states`, `worktree-list-model`, `turn-collapse`, +`tool-display`, `chat-image-src`, `themes`, `theme-apply`). A change to any +of those, or to a request handler, can break the phone without touching +`mobile/`. CI guards it in four steps: + +- `npm run typecheck:mobile` — signature / state-shape drift. Renaming a + channel or changing its args means updating `build-backend.ts`, and the + phone follows (or fails to compile). +- `npm run test:mobile` — unit tests in `mobile/test/`, including a check + that `mobile/src/themes.generated.ts` matches `styles.css` (regenerate + with `node mobile/scripts/gen-themes.mjs`). +- `npx expo export --platform ios` in `mobile/` — a shared module that + grows a Node / DOM / Electron-only import fails to bundle here. Keep + the modules above free of those. +- `npm run test:mobile:contract` (after `build:headless`) — the app's own + `NessClient` / `Fleet` / list model drive a fresh headless server. + +Mobile deps are installed separately (`npm ci --prefix mobile`). + ### Headless tarballs The `Headless Release` workflow (`.github/workflows/headless-release.yml`) diff --git a/mobile/.gitignore b/mobile/.gitignore new file mode 100644 index 00000000..d914c328 --- /dev/null +++ b/mobile/.gitignore @@ -0,0 +1,41 @@ +# 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/mobile/AGENTS.md b/mobile/AGENTS.md new file mode 100644 index 00000000..be05e778 --- /dev/null +++ b/mobile/AGENTS.md @@ -0,0 +1,41 @@ +This is an Expo/React Native mobile application. Prioritize mobile-first patterns, performance, and cross-platform compatibility. + +## Expo has changed — do not trust your training data + +Expo ships breaking changes every SDK release. APIs you remember are likely renamed, moved, or removed. Before writing any code that touches an Expo, EAS, or React Native API: + +1. Read the major version of the `expo` package in `package.json`. +2. Fetch the matching versioned docs: `https://docs.expo.dev/versions/v.0.0/` +3. For anything else, fetch https://docs.expo.dev/llms.txt — an index of all Expo docs with corrections to common LLM misconceptions. Follow its links to the specific page you need; never answer from memory. + +## Commands + +Use `bunx` instead of `npx` if the project uses bun (`bun.lock` present). + +```bash +npx expo install # ALWAYS use instead of npm/yarn/pnpm/bun add — resolves SDK-compatible versions +npx expo start # start the dev server +npx expo lint # lint +npx tsc --noEmit # typecheck +npx expo-doctor # diagnose dependency and config issues +npx expo install --fix # fix incompatible package versions +``` + +Run lint and typecheck before declaring any task done. + +## Navigation & Routing + +- Use **Expo Router** for all navigation. Routes live in `src/app/` — every file there is a screen, `_layout.tsx` files define navigators. Keep non-route code (components, hooks, utils) outside `src/app/`. +- Import `Link`, `router`, and `useLocalSearchParams` from `expo-router`. +- Docs: https://docs.expo.dev/router/introduction.md + +## Building with EAS + +Use EAS to build, sign, and submit the app in the cloud (`eas build`, `eas submit`) and to ship over-the-air updates (`eas update`) — no local Xcode or Android Studio required. Run EAS CLI as `bunx eas-cli ` in Bun projects, or `npx eas-cli@latest ` otherwise; substitute that for bare `eas` in docs examples. +Docs: https://docs.expo.dev/eas/index.md + +## Rules + +- If `ios/` and `android/` directories do not exist, they are generated (Continuous Native Generation). Never create or edit them by hand — configure native behavior in `app.json` and config plugins. +- Expo Go only includes its bundled native modules. After adding a library with native code, the app needs a development build: `npx expo run:ios|android` locally, or `eas build --profile development`. +- Prefer recommended Expo modules over third-party libraries, and check your available skills before adding dependencies. Docs: https://docs.expo.dev/versions/latest/index.md diff --git a/mobile/App.tsx b/mobile/App.tsx new file mode 100644 index 00000000..6fa29985 --- /dev/null +++ b/mobile/App.tsx @@ -0,0 +1,597 @@ +// Port of the web client's mobile shell (src/renderer/components/ +// MobileApp.tsx). Kept structurally parallel to it on purpose — selection +// fallback, rising-edge wake, add-tab and convert-menu behaviour all mirror +// that file, so read the two side by side when changing either. The +// worktree list itself comes from the renderer's own pure model code via +// src/fleet.ts, across every enabled backend. +import { StatusBar } from 'expo-status-bar' +import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context' +import { KeyboardAvoidingView, KeyboardProvider } from 'react-native-keyboard-controller' +import AsyncStorage from '@react-native-async-storage/async-storage' +import { useCallback, useEffect, useMemo, useRef, useState } from 'react' +import { + ActivityIndicator, + Keyboard, + Linking, + Pressable, + ScrollView, + StyleSheet, + Text, + useColorScheme, + useWindowDimensions, + View +} from 'react-native' +import { ChevronDown, FileDiff, FileText, Globe, Loader2, PanelRightClose, PanelRightOpen, Plus, SquareTerminal } from 'lucide-react-native' +import { parseConnectionUrl } from '../src/shared/transport/parse-connection-url' +import { supportsChat } from '../src/shared/agent-registry' +import type { PtyStatus, TerminalTab } from '../src/shared/state/terminals' +import { useBackends } from './src/backends' +import { consumeLaunchUrl } from './src/launchUrl' +import { firstLeafId, newChatTab, pickInitialTab } from './src/tabs' +import { Fleet, useFleetEntries, useMerged } from './src/fleet' +import { useNess, type NessClient } from './src/ness' +import { STATUS_DOT, applyTheme, c, fs, getThemeMode, themeKey, themed } from './src/theme' +import { AgentIcon } from './src/components/AgentIcon' +import { ChatView } from './src/components/ChatView' +import { WorktreePicker } from './src/components/WorktreePicker' +import { BackendsSheet } from './src/components/BackendsSheet' +import { Spin } from './src/components/Spin' +import { PanelsHost } from './src/panels/PanelsHost' +import { getLeaves } from '../src/shared/state/terminals' + +export default function Root() { + return ( + + + + + + ) +} + +function App() { + const backends = useBackends() + const fleet = useMemo(() => new Fleet(), []) + // In an effect, not during render: setClients notifies subscribers. + useEffect(() => fleet.setClients(backends.clients), [fleet, backends.clients]) + const [showBackends, setShowBackends] = useState(false) + const theme = useThemeFromSettings(fleet) + + // Deep-link pairing: ://pair?url=. + useEffect(() => { + const handle = (link: string | null | undefined) => { + const m = link && /[?&]url=([^&]+)/.exec(link) + if (!m) return + const r = parseConnectionUrl(decodeURIComponent(m[1])) + if (r.ok) backends.add({ wsUrl: r.parsed.wsUrl, token: r.parsed.token }) + } + void consumeLaunchUrl().then(handle) + const sub = Linking.addEventListener('url', (e) => handle(e.url)) + return () => sub.remove() + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []) + + if (!backends.loaded) { + return ( + + + + ) + } + if (backends.saved.length === 0) { + return ( + + + + ) + } + return ( + + setShowBackends(true)} /> + {showBackends && setShowBackends(false)} />} + + ) +} + +// Ness's colour theme is a client-owned setting; the phone follows the +// first connected backend's (normally the user's own desktop), with +// 'system' resolved against the phone's appearance. The palette is applied +// during render, before anything below reads `c`, and the returned key +// remounts the UI subtree so every component and themed() style picks up +// the new colours. Backend connections live above it and stay up. +function useThemeFromSettings(fleet: Fleet): string { + const entries = useFleetEntries(fleet) + const settings = entries[0]?.state.settings + const systemScheme = useColorScheme() + return useMemo(() => { + const inputs = { + themeMode: settings?.themeMode ?? 'dark', + themeLight: settings?.themeLight ?? '', + themeDark: settings?.themeDark ?? '', + customThemes: settings?.customThemes ?? [], + nessieColor: settings?.nessieColor ?? '', + systemScheme + } + applyTheme(inputs) + return themeKey(inputs) + }, [settings, systemScheme]) +} + +// keyboard-controller's KeyboardAvoidingView animates frame-by-frame with +// the keyboard on the UI thread (RN's own one ran a LayoutAnimation that +// moved the composer's button row and its text box at different speeds). +// +// Bottom edge: deliberately ignores the bottom safe area, so with the +// keyboard down the composer sits on the screen's bottom edge (only its own +// 12pt padding below it, over the home indicator) instead of 34pt higher. +// The KAV spans to the screen bottom, so its padding is exactly the +// keyboard height and the composer still rests 12pt above the keyboard. +function Shell({ children }: { children: React.ReactNode }) { + return ( + + + + {children} + + + ) +} + +const K_ACTIVE = 'ness.mobile.activeWorktree' +const K_TABS = 'ness.mobile.selectedTabs' + +function MobileApp({ fleet, onOpenBackends }: { fleet: Fleet; onOpenBackends: () => void }) { + const merged = useMerged(fleet) + const worktrees = merged.flatWorktrees + const [activeWorktreeId, setActiveWorktreeId] = useState(null) + // Mobile's own per-worktree tab focus, independent of desktop panes. + const [selectedTabByWorktree, setSelectedTabByWorktree] = useState>({}) + const [pickerOpen, setPickerOpen] = useState(false) + // Per-client UI focus, same as the web's rightPanelOpen. + const [rightPanelOpen, setRightPanelOpen] = useState(false) + const [convertMenu, setConvertMenu] = useState<{ tab: TerminalTab; x: number; y: number } | null>(null) + const windowWidth = useWindowDimensions().width + + // Usability deviation from the web (which starts at worktrees[0] on every + // load): a phone app is relaunched constantly, so restore the last + // worktree + per-worktree tab focus. Still per-client UI state. + const restored = useRef<{ wt: string | null; tabs: Record } | null>(null) + const [restoreDone, setRestoreDone] = useState(false) + useEffect(() => { + void AsyncStorage.multiGet([K_ACTIVE, K_TABS]).then((pairs) => { + const m = Object.fromEntries(pairs) + let tabs: Record = {} + try { + tabs = m[K_TABS] ? JSON.parse(m[K_TABS]) : {} + } catch { + // ignore corrupt entry + } + restored.current = { wt: m[K_ACTIVE] ?? null, tabs } + setSelectedTabByWorktree((prev) => ({ ...tabs, ...prev })) + setRestoreDone(true) + }) + }, []) + // Backends snapshot at different times: don't fall back to + // worktrees[0] while the saved worktree's host may still be connecting + // (that would also overwrite the saved choice). Capped so an offline + // host can't hold the first screen hostage. + const allSnapshotted = useFleetEntries(fleet).length === fleet.getClients().length + const [waitedEnough, setWaitedEnough] = useState(false) + useEffect(() => { + const t = setTimeout(() => setWaitedEnough(true), 3000) + return () => clearTimeout(t) + }, []) + useEffect(() => { + if (activeWorktreeId && worktrees.some((w) => w.path === activeWorktreeId)) return + if (worktrees.length === 0 || !restoreDone) return + const saved = restored.current?.wt + if (saved && worktrees.some((w) => w.path === saved)) setActiveWorktreeId(saved) + else if (!saved || allSnapshotted || waitedEnough) setActiveWorktreeId(worktrees[0].path) + }, [activeWorktreeId, worktrees, restoreDone, allSnapshotted, waitedEnough]) + useEffect(() => { + if (activeWorktreeId) void AsyncStorage.setItem(K_ACTIVE, activeWorktreeId) + }, [activeWorktreeId]) + useEffect(() => { + if (Object.keys(selectedTabByWorktree).length) void AsyncStorage.setItem(K_TABS, JSON.stringify(selectedTabByWorktree)) + }, [selectedTabByWorktree]) + + const activeWorktree = useMemo( + () => worktrees.find((w) => w.path === activeWorktreeId) ?? null, + [worktrees, activeWorktreeId] + ) + const client = activeWorktree ? fleet.client(merged.pathBackendId[activeWorktree.path]) ?? null : null + + useEffect(() => { + if (activeWorktree && client) void client.api.panesEnsureInitialized(activeWorktree.path) + }, [activeWorktree?.path, client]) + + // Once per backend as it joins, like MobileApp's mount effect. + const refreshed = useRef(new Set()) + const clients = fleet.getClients() + useEffect(() => { + for (const cl of clients) { + if (refreshed.current.has(cl.id) || !cl.getConn().hasSnapshot) continue + refreshed.current.add(cl.id) + void cl.api.refreshWorktreesList() + void cl.api.refreshPRsAllIfStale() + } + }) + + const tabs = activeWorktree ? merged.tabsByWorktree[activeWorktree.path] ?? [] : [] + + const selectedTabId = useMemo(() => { + if (!activeWorktree) return null + const claimed = selectedTabByWorktree[activeWorktree.path] + if (claimed && tabs.some((t) => t.id === claimed)) return claimed + return pickInitialTab(tabs) + }, [activeWorktree, selectedTabByWorktree, tabs]) + const selectedTab = tabs.find((t) => t.id === selectedTabId) ?? null + + // Rising-edge wake, mirroring MobileApp: PanesFSM hydrates persisted + // chat/shell tabs asleep, so a tab first opened from the phone would + // otherwise render blank. Only on selection change, so a tab slept from + // another client stays slept. + const prevSelectedTabRef = useRef(null) + useEffect(() => { + const prev = prevSelectedTabRef.current + prevSelectedTabRef.current = selectedTabId + if (prev === selectedTabId || !activeWorktree || !selectedTab || !client) return + if (selectedTab.type !== 'json-claude' && selectedTab.type !== 'shell') return + if ((selectedTab.mode ?? 'awake') !== 'asleep') return + void client.api.panesWakeTab(activeWorktree.path, selectedTab.id) + }, [activeWorktree, selectedTab, selectedTabId, client]) + + // ://open?wt=&tab= — jump straight to a + // chat. What a push notification for an approval will deep-link to. + useEffect(() => { + const handle = (link: string | null | undefined) => { + if (!link || !/\/open\?/.test(link)) return + const q = new URLSearchParams(link.slice(link.indexOf('?') + 1)) + const wt = q.get('wt') + const tab = q.get('tab') + if (!wt) return + setActiveWorktreeId(wt) + if (tab) setSelectedTabByWorktree((prev) => ({ ...prev, [wt]: tab })) + setPickerOpen(false) + } + void consumeLaunchUrl().then(handle) + const sub = Linking.addEventListener('url', (e) => handle(e.url)) + return () => sub.remove() + }, []) + + // Keep the selected tab visible: on a phone the strip overflows and the + // selected tab could otherwise sit under the details button. + const tabStripRef = useRef>(null) + const tabStripWidth = useRef(0) + const tabLayouts = useRef>({}) + useEffect(() => { + const id = selectedTabId + if (!id) return + // Layout lands a frame after the tab mounts. + const t = setTimeout(() => { + const l = tabLayouts.current[id] + if (!l) return + const visible = tabStripWidth.current + tabStripRef.current?.scrollTo({ x: Math.max(0, l.x + l.w - visible + 48), animated: true }) + }, 50) + return () => clearTimeout(t) + }, [selectedTabId, tabs.length]) + + const handleSelectWorktree = useCallback((wtPath: string) => { + setActiveWorktreeId(wtPath) + setPickerOpen(false) + setRightPanelOpen(false) + }, []) + + const handleSelectTab = useCallback( + (tabId: string) => { + if (!activeWorktree) return + setSelectedTabByWorktree((prev) => ({ ...prev, [activeWorktree.path]: tabId })) + setPickerOpen(false) + }, + [activeWorktree] + ) + + const handleAddChat = useCallback(() => { + if (!activeWorktree || !client) return + const wtPath = activeWorktree.path + const tree = merged.panes[wtPath] + const paneId = tree ? firstLeafId(tree) : undefined + const tab = newChatTab() + void client.api.panesAddTab(wtPath, tab, paneId) + setSelectedTabByWorktree((prev) => ({ ...prev, [wtPath]: tab.id })) + setPickerOpen(false) + }, [activeWorktree, client, merged.panes]) + + // Port of useTabHandlers' handleSendToAgent: the phone's selected tab if + // it's an agent/chat, else a pane's active one, else the first; chat gets + // a message, a terminal agent a bracketed paste. Then focus that tab. + const handleSendToAgent = useCallback( + (text: string) => { + if (!activeWorktree || !client) return + const sendable = (t: TerminalTab) => t.type === 'agent' || t.type === 'json-claude' + const tree = merged.panes[activeWorktree.path] + const leaves = tree ? getLeaves(tree) : [] + const target = + (selectedTab && sendable(selectedTab) ? selectedTab : undefined) ?? + leaves.map((l) => l.tabs.find((t) => t.id === l.activeTabId)).find((t): t is TerminalTab => !!t && sendable(t)) ?? + tabs.find(sendable) + if (!target) return + setSelectedTabByWorktree((prev) => ({ ...prev, [activeWorktree.path]: target.id })) + setRightPanelOpen(false) + if (target.type === 'json-claude') client.api.sendJsonClaudeMessage(target.id, text) + else client.api.writeTerminal(target.id, '\x1b[200~' + text + '\x1b[201~') + }, + [activeWorktree, client, merged.panes, selectedTab, tabs] + ) + + const handleConvertTabType = useCallback( + (tabId: string, newType: 'agent' | 'json-claude') => { + if (activeWorktree && client) void client.api.panesConvertTabType(activeWorktree.path, tabId, newType) + }, + [activeWorktree, client] + ) + + const label = activeWorktree + ? merged.aliases[activeWorktree.path] ?? (activeWorktree.branch || activeWorktree.path.split('/').pop()) + : null + + return ( + + + { + Keyboard.dismiss() + setPickerOpen((v) => !v) + }} + style={({ pressed }) => [s.pickerBtn, (pickerOpen || pressed) && { backgroundColor: c.surface }]} + accessibilityRole="button" + accessibilityLabel="Switch worktree" + > + {activeWorktree ? ( + <> + + + {activeWorktree.repoRoot.split('/').pop()} + + + {label} + + + + + ) : ( + Select a worktree + )} + + (tabStripWidth.current = e.nativeEvent.layout.width)} + > + {client && + tabs.map((tab) => { + const convertible = (tab.type === 'agent' && supportsChat(tab.agentKind)) || tab.type === 'json-claude' + return ( + handleSelectTab(tab.id)} + onLayout={(x, w) => (tabLayouts.current[tab.id] = { x, w })} + // With the picker open, a tap on the active tab means + // "dismiss the picker", so no convert menu. + onOpenMenu={convertible && !pickerOpen ? (pos) => setConvertMenu({ tab, ...pos }) : undefined} + /> + ) + })} + {activeWorktree && ( + [s.addBtn, pressed && { backgroundColor: c.panelRaised }]} accessibilityLabel="New chat"> + + + + )} + + {activeWorktree && ( + { + // The composer's keyboard would otherwise sit over the sheet. + Keyboard.dismiss() + setRightPanelOpen((v) => !v) + }} + style={({ pressed }) => [s.detailsBtn, (rightPanelOpen || pressed) && { backgroundColor: c.surface }]} + accessibilityLabel={rightPanelOpen ? 'Close worktree details' : 'Worktree details'} + > + {rightPanelOpen ? : } + + )} + + + + {activeWorktree && client && selectedTab && selectedTab.type === 'json-claude' && ( + + )} + {activeWorktree && selectedTab && (selectedTab.type === 'agent' || selectedTab.type === 'shell') && ( + + )} + {activeWorktree && selectedTab && !['json-claude', 'agent', 'shell'].includes(selectedTab.type) && ( + + )} + {activeWorktree && !selectedTab && } + {!activeWorktree && worktrees.length === 0 && } + + {convertMenu && ( + setConvertMenu(null)}> + + [s.menuItem, pressed && { backgroundColor: c.panel }]} + onPress={() => { + const { tab } = convertMenu + setConvertMenu(null) + handleConvertTabType(tab.id, tab.type === 'agent' ? 'json-claude' : 'agent') + }} + > + + {convertMenu.tab.type === 'agent' ? 'Switch to Chat mode' : 'Switch to Terminal mode'} + + + + + )} + {rightPanelOpen && activeWorktree && client && ( + setRightPanelOpen(false)} + /> + )} + {pickerOpen && ( + setPickerOpen(false)} + // One overlay at a time: the picker is accessibilityViewIsModal, + // so leaving it open under Backends hid Backends from VoiceOver. + onOpenBackends={() => { + setPickerOpen(false) + onOpenBackends() + }} + /> + )} + + + ) +} + +function TabChip({ + client, + tab, + active, + onSelect, + onOpenMenu, + onLayout +}: { + client: NessClient + tab: TerminalTab + active: boolean + onSelect: () => void + /** Tap the active tab → convert menu (mobile's right-click). */ + onOpenMenu?: (pos: { x: number; y: number }) => void + onLayout?: (x: number, width: number) => void +}) { + const ref = useRef>(null) + return ( + { + if (active && onOpenMenu) { + ref.current?.measureInWindow((x: number, y: number) => onOpenMenu({ x, y })) + return + } + onSelect() + }} + onLayout={(e) => onLayout?.(e.nativeEvent.layout.x, e.nativeEvent.layout.width)} + style={[s.tab, active && s.tabActive]} + accessibilityRole="tab" + accessibilityState={{ selected: active }} + > + + + {tab.customLabel ?? tab.label} + + + ) +} + +function TabIcon({ client, tab }: { client: NessClient; tab: TerminalTab }) { + const status = useNess(client, (st) => (st.terminals.statuses[tab.id] ?? 'idle') as PtyStatus) + const shellActive = useNess(client, (st) => !!st.terminals.shellActivity[tab.id]?.active) + if (tab.type === 'agent' || tab.type === 'json-claude') { + return ( + + + {/* Live status for agent AND chat tabs, like the desktop tab strip + (TerminalPanel's TAB_STATUS_DOT): chat tabs get processing / + waiting / needs-approval statuses too. */} + + + ) + } + if (tab.type === 'shell') return shellActive ? : + if (tab.type === 'diff') return + if (tab.type === 'file') return + if (tab.type === 'browser') return + return null +} + +function NonRunnablePlaceholder({ tab }: { tab: TerminalTab }) { + const label = tab.type === 'diff' ? 'Diff view' : tab.type === 'file' ? 'File view' : tab.type === 'browser' ? 'Browser tab' : 'This tab' + return ( + + {label} — desktop only + {tab.customLabel ?? tab.label} + {tab.type === 'browser' && tab.url && ( + void Linking.openURL(tab.url!)} hitSlop={10}> + Open URL in browser + + )} + + ) +} + +function Empty({ message }: { message: string }) { + return ( + + {message} + + ) +} + +const s = themed(() => StyleSheet.create({ + screen: { flex: 1, backgroundColor: c.app }, + // 45 = 44pt tap height + the 1px bottom border. + header: { height: 45, flexDirection: 'row', borderBottomWidth: 1, borderColor: c.border, backgroundColor: c.panel }, + pickerBtn: { + flexDirection: 'row', + alignItems: 'center', + gap: 6, + paddingHorizontal: 12, + maxWidth: '45%', + borderRightWidth: 1, + borderColor: c.border + }, + repoLabel: { color: c.dim, fontSize: fs.xs, textTransform: 'uppercase', letterSpacing: 0.6 }, + branchLabel: { color: c.fgBright, fontSize: fs.xs, fontWeight: '500' }, + tab: { flexDirection: 'row', alignItems: 'center', gap: 6, paddingHorizontal: 12, borderBottomWidth: 2, borderColor: 'transparent' }, + tabActive: { borderColor: c.muted, backgroundColor: c.app }, + tabText: { color: c.dim, fontSize: fs.xs, maxWidth: 140 }, + dot: { width: 6, height: 6, borderRadius: 3 }, + detailsBtn: { width: 44, alignItems: 'center', justifyContent: 'center', borderLeftWidth: 1, borderColor: c.border }, + addBtn: { flexDirection: 'row', alignItems: 'center', gap: 2, paddingHorizontal: 12, minWidth: 44, justifyContent: 'center' }, + empty: { flex: 1, alignItems: 'center', justifyContent: 'center', gap: 12, paddingHorizontal: 24 }, + menu: { + position: 'absolute', + minWidth: 224, + backgroundColor: c.panelRaised, + borderWidth: 1, + borderColor: c.borderStrong, + borderRadius: 4, + paddingVertical: 4 + }, + menuItem: { paddingHorizontal: 12, minHeight: 44, justifyContent: 'center' } +})) diff --git a/mobile/CLAUDE.md b/mobile/CLAUDE.md new file mode 100644 index 00000000..43c994c2 --- /dev/null +++ b/mobile/CLAUDE.md @@ -0,0 +1 @@ +@AGENTS.md diff --git a/mobile/SPIKE.md b/mobile/SPIKE.md new file mode 100644 index 00000000..d96b2403 --- /dev/null +++ b/mobile/SPIKE.md @@ -0,0 +1,462 @@ +# Expo mobile client: spike findings + +**Verdict: feasible, and cheaper than expected.** An Expo app can talk to +an unmodified Ness backend (desktop WS server or `harness-server`) by +importing `src/shared/state` and `src/shared/transport` directly. There +were **no server-side changes**. The demo pairs with a backend, lists +worktrees with live status, shows a json-mode transcript, sends messages, +and allows or denies permission requests. The approval was confirmed end +to end: the approved `touch` command really ran on the host. + +Verified on: + +- **Expo web** in a 393×852 mobile viewport against `harness-server` over + LAN `ws://`: the full flow, including send and approve. +- **Expo Go on the iOS 26 simulator** (iPhone 17, SDK 58, RN 0.88, Hermes): + deep-link pairing, the native `WebSocket` connect, the snapshot and the + live worktree list. +- **Hermes bundles** for iOS and Android (`npx expo export`), about 1.6MB each. + +Not verified: a physical device, Android at runtime, the camera scan on a +device, and expo-secure-store at runtime. Those parts need a device; the +code paths follow the SDK 58 docs. + +## 1. Code sharing: works with no changes to shared code + +- `src/shared/**` has **no package imports** (only relative imports, plus + `vitest` in tests), no Node built-ins and no DOM globals. Babel and Hermes + compile it without changes. +- Setup is `mobile/metro.config.js`, which adds `../src/shared` to + `watchFolders`. The repo isn't an npm workspace, so Expo's monorepo + auto-config doesn't trigger. Imports are plain relative paths + (`../src/shared/state`), and `tsc --noEmit` in `mobile/` typechecks the + shared files too. +- **Gotcha:** don't set `resolver.disableHierarchicalLookup`. npm nests + `expo/node_modules/expo-asset`. Web still bundles, but the iOS and Android + bundles fail. +- The phone store is about 80 lines (`mobile/src/ness.ts`). It is the + renderer's `ClientStore` pattern: `mergeWireSnapshot` on (re)connect, + `rootReducer` per event, and `useSyncExternalStore` selectors. + `ROLLUP_STATUS_RANK` and `parseConnectionUrl` are reused as-is. +- Not shareable: anything in `src/renderer` (DOM, Tailwind, xterm, Monaco). + The UI is a rewrite. A real app would want the json-mode entry rendering + (markdown, tool cards, diffs) factored into a renderer-agnostic model + layer; today that logic lives in `JsonModeChat.tsx`. +- **Risk:** shared code currently happens to be RN-safe. Nothing enforces + that. Add a lint rule or a CI step (`cd mobile && npx tsc --noEmit && + npx expo export`) so a stray `import 'fs'` in `src/shared` fails a PR. + +## 2. Connectivity and auth + +- **Token:** the server accepts `?token=` on the upgrade URL or + `Authorization: Bearer`. `WebSocketClientTransport` uses the query + param, which RN's `WebSocket` supports. RN can also send headers via its + non-standard third constructor arg, but that wasn't needed. +- **`URL`/`URLSearchParams`:** the transport calls + `url.searchParams.set(...)`. Bare RN's `URL` historically threw "not + implemented" there; Expo's runtime ships a full polyfill, and it worked in + Expo Go. +- **No Origin check** on the WS upgrade, so the Expo web dev server on a + different origin connected fine. That helps this spike, but it means the + token is the only gate (see security below). +- **Cleartext `ws://`:** + - *iOS:* App Transport Security allows local-network hosts only with + `NSAllowsLocalNetworking`. iOS 14+ also shows the Local Network + permission prompt, which needs `NSLocalNetworkUsageDescription`. Both are + set in `app.json` `ios.infoPlist`. Expo Go ships its own Info.plist, so + these only take effect in a dev or production build, and the simulator + test proves nothing about ATS. + - *Android:* release builds block cleartext by default. + `android.usesCleartextTraffic: true` is set in `app.json` for the spike. + I haven't verified that key against the SDK 58 app.json schema; run + `npx expo-doctor` before relying on it. +- **TLS story (recommended): Tailscale.** The phone and host join a + tailnet, and `tailscale serve` (or `tailscale cert` with a small TLS + front) gives `wss://..ts.net` with a real certificate. No + ATS or cleartext exceptions, it works off-LAN, and the tailnet ACL adds a + second auth layer. `parseConnectionUrl` already maps `https → wss`, so a + `https://…ts.net/?token=…` QR would work with no client changes. +- **Security notes for productionising:** + - The token travels in plain text on LAN `ws://`. + - The token never rotates unless you press Rotate. + - There is no per-device identity, so you can't revoke one phone. + - For a phone that can approve tool calls, use per-device tokens and + revocation, and make TLS mandatory off-LAN. + +## 3. Pairing UX + +- The Settings → **Web & mobile** QR encodes + `http://:/?token=<64-hex>`, the same URL the web client + opens. The app feeds it straight to `parseConnectionUrl`. +- Implemented: + - In-app scanning: `CameraView` with `barcodeScannerSettings={{ + barcodeTypes: ['qr'] }}`. + - Paste-a-link fallback. + - **Deep link:** `://pair?url=`. On iOS, the + simulator test used `xcrun simctl openurl booted + "exp:///--/pair?url=…"`. +- The connection is persisted with expo-secure-store on native and + `localStorage` on web (web has no secure-store support), under one + key, `ness.connection`. +- **Recommendation:** register a `ness://` scheme and have the desktop QR + encode `ness://pair?url=…`, or a universal link. The system camera then + opens the app already paired, and the in-app scanner becomes a fallback. + The catch: an `http://` QR also opens the web client in a mobile browser, + so encode both (the web client could offer an "Open in app" button) or + show two QRs. + +## 4. Minimum useful UI: channels and slices used + +| Feature | Reads (slices) | Calls (channels) | +|---|---|---| +| Worktree list and status dots | `worktrees.list`, `terminals.panes`, `terminals.statuses`, `terminals.lastActive` | (none) | +| Pending-approval count | `jsonClaude.pendingApprovals` | (none) | +| Transcript | `jsonClaude.sessions[id]` | `jsonClaude:getEntries` (req) | +| Wake a slept chat | `jsonClaude.sessions[id]` | `jsonClaude:start` (req, id must be a UUID) | +| Send a message | (none) | `jsonClaude:send` (**fire-and-forget signal**) | +| Allow / deny | `jsonClaude.pendingApprovals` | `jsonClaude:resolveApproval` (req; allow must echo `updatedInput: input`) | + +- A worktree's chat is a `json-claude` tab in its pane tree. The tab id is + the session id. +- Terminal (xterm) agent tabs still give a status dot. Their transcript + can't be read from a phone: it's PTY bytes, and the needs-approval prompt + is in the TUI. **Mobile is effectively json-mode-only.** +- `jsonClaude:send` is a signal and `WebSocketClientTransport.send` + **silently drops it while reconnecting**. On flaky mobile networks that + loses messages. A mobile client should use a request variant with an ack, + or queue locally until reconnect. + +## 5. Background notifications (investigated, not built) + +iOS suspends the app, and its socket, within seconds of backgrounding. +Android does the same under Doze. There's no reliable way to keep a WS +open, so "needs approval" alerts must come from push. Answering is +time-boxed but generous: Claude Code's MCP idle timeout abandons an +unanswered approval after 1800s (`approval-bridge.ts`), so a push that +gets the user back within minutes is good enough. + +Recommended design: + +1. **Register:** after pairing, the app gets an Expo push token + (`expo-notifications`; this needs a dev or production build, not Expo + Go) and calls a new request, `mobile:registerPushToken(token, + deviceLabel)`. Main persists it in config and keys it to the pairing. +2. **Derive:** a main-side subscriber watches `jsonClaude/approvalRequested`. + For xterm tabs it watches `terminals/statusChanged → 'needs-approval'`. + It dedups per request id, which is the ActivityDeriver pattern (see + CLAUDE.md anti-patterns #1 and #2). It should only push when no client + has been active recently, otherwise the desktop user gets buzzed too. +3. **Send:** POST to Expo's push service (`exp.host/--/api/v2/push/send`), + which relays to APNs and FCM. Keep the payload minimal (`": Claude + wants to run Bash"` plus request id and worktree path), because it + transits Expo's, Apple's and Google's servers. Don't send command text + unless the user opts in. Self-hosting APNs/FCM directly avoids the Expo + hop but needs signing keys on every `harness-server`. A hosted relay is + the usual compromise. +4. **Act:** use notification categories with Allow/Deny actions. Tapping + one wakes the app briefly in the background, so it reconnects, calls + `jsonClaude:resolveApproval` and exits. That works on LAN or Tailscale + only. Off-network it needs either a relay that proxies to the host or a + plain HTTP endpoint on the server, so the background task doesn't have + to complete a WS handshake and snapshot. + +Effort: about 2–3 days for push on the LAN or Tailscale path, and 1–2 weeks +if a hosted relay is in scope. + +## 6. Perf + +Measured against `harness-server` with this repo's 32 worktrees, using a +Node probe (`ws`) on the same wire: + +| Thing | Size | +|---|---| +| Full snapshot (wire, entries stripped) | **50–63 KB**: `terminals` ~21KB, `settings` ~17KB, `worktrees` ~10KB, rest <2KB | +| One complete chat turn (user msg → tool use → answer) | ~17 events, **~20 KB** | +| Largest single frame | ~10 KB `worktrees/listChanged` (whole list resent on any change) | +| Transcript fetch (`getEntries`) | Proportional to history; 3 entries ≈ 2.7 KB | + +- **The phone copes fine.** A 60KB JSON parse is about 1ms on Hermes, and + the reducer is the same one the desktop runs. No filtering is needed for + a first version. +- **Server-side changes worth making before shipping:** + 1. **`jsonClaude:getEntries` broadcasts.** The handler dispatches + `jsonClaude/entriesSeeded` through the store, so *every* connected + client receives the full transcript whenever any client opens a + chat. Return the entries in the response only, or seed per client. + This is the one real scaling issue. + 2. **Token deltas.** `--include-partial-messages` is on and + `assistantTextDelta` / `assistantThinkingDelta` are events, so with N + sessions streaming the phone receives every token of every session. + My test turns didn't emit any deltas, so this is **unmeasured**. Before + shipping, measure a long streamed answer with several sessions running + at once. If it's heavy, add per-client subscription scoping, at least + dropping delta events for sessions the client isn't viewing. + 3. `settings` (17KB) is irrelevant to the phone. A per-slice snapshot + filter is easy, but at this size it's optional. +- Reconnect re-snapshots every time (the existing transport design). With + mobile radio flapping that's 60KB per reconnect, which is acceptable. + +## 7. Parity with the web client's mobile view + +The app is a port of the web client's phone layout (`MobileApp.tsx`, +`WorktreeList variant="touch"`, `JsonModeChat.tsx`). To keep behaviour +identical by construction, it **imports the renderer's pure model code**, +not just `src/shared`: + +| Reused as-is from `src/renderer` | Drives | +|---|---| +| `merge-backend-states.ts` (`getMergedWorktrees`) | multi-backend merge, including one section per repo across hosts | +| `worktree-list-model.ts` (`buildWorktreeListBase`, `applyProjectAccordion`) | project rows, groups, accordion, archive tail, pending rows | +| `worktree-row-style.ts`, `pending-tool.ts` | status/PR colours, the pending-tool line | +| `json-mode-cards/grouping.ts`, `turn-collapse.ts`, `tool-timeline.ts`, `tool-display.ts`, `automation-label.ts` | sub-agent nesting, turn folding, tool group labels, tool icons, labels and intents | +| `fuzzy.ts`, `uuid.ts` | slash/model popover, new-chat ids | + +How that works: + +- **Metro.** It watches all of `../src`. A `resolveRequest` guard resolves + every package import made from `../src` against `mobile/node_modules`, + so the Electron app's React can never load. A check confirmed the + bundle has a single React. +- **Icon shims.** `tool-display` imports `lucide-react` and `react-icons/si`. + Metro serves those as `src/shims/*`: lucide-react-native (same icon + names), plus a brand-icon stand-in. `src/tw.ts` maps the desktop's + `className="icon-sm text-danger animate-pulse"` to RN props. The two + desktop icons that draw raw `` fall back to a wrench via an error + boundary. +- **One desktop refactor.** `automationLabel` moved out of + `JsonModeChat.tsx` into its own module, so both clients import it. + +**Ported behaviour.** Each item mirrors the named file. + +- **Shell** (`MobileApp`): + - All tab types appear, with the web's icons. + - The first tab picked is agent, then shell, then the first tab. + - Selecting a tab wakes it on the rising edge (`panes:wakeTab`). + - `panes:ensureInitialized` runs on worktree change. + - `worktrees:refreshList` and `prs:refreshAllIfStale` run once per backend. + - The New chat tab is `{id = sessionId = uuid}`. + - Tapping the active tab opens "Switch to Chat/Terminal mode" + (`panes:convertTabType`). + - Diff, file and browser tabs show desktop-only placeholders. +- **Picker** (`WorktreeList` touch): + - The header has unified/split, refresh (`prs:refreshAll`) and close, + plus a Backends button. + - Rows show the status dot (pulsing), shell spinner, pin, PR icon with + review dot, agent-review icon, alias, stale badge, and the subtitle: + detail prefs from settings, age, diff, milestone, PR pill. + - The "…" sheet offers Alias/Rename, Clear Alias, Pin/Unpin, and + Snooze/Wake (`settings.snoozeDefaultDays`). + - Inline alias editing goes through `aliases:set`. + - Group and tail collapse and project keep-open use the same storage + keys as the web. +- **Chat** (`JsonModeChat`): + - Start only when awake and no session exists. History is fetched once. + - `setComposerVisible` tracks app foreground. + - The first keystroke wakes a slept tab. `touchLastActive` is + debounced to 5s. + - Pipeline: `buildChildrenMap`, then the results map, then a + 150-entry window ("Show N earlier" / "Show all"), then `renderEntries`, + `foldFinishedTurns`, and `groupConsecutiveToolRows`. + - Cards: Bash, Edit, MultiEdit (unified diff with gutters via `diff`), + Write, Read, Grep, Glob, TodoWrite, Task (nested sub-agent + transcript), and Generic (parsed/raw args). + - Other entries: thinking, compact, exit/restart, auth, agent-error, + rate-limit, held notices, automated turns, queued bubbles with cancel. +- **Approval card** (`JsonClaudeApprovalCard`): + - Allow once. + - Allow `` this session (the permission-mode flip for edits). + - Allow with edits. + - Always allow… with the pattern ladder. + - Deny with reason and interrupt. + - Auto-approver status, and Edit guidance with Save & re-review. + - AskUserQuestion goes to the question card. +- **Composer:** + - State dot. + - Permission pill that cycles mid-turn. + - interrupt, and interrupt & send. + - Send, which snaps the transcript to the bottom. + - `/` popover with the two-stage `/model` picker. + - The auto-allow strip with clear. + - Density follows `settings.jsonModeChatDensity`. + +**Deliberate differences, for a phone:** + +- **Selection is remembered.** Last worktree and per-worktree tab are + restored across launches. The web starts at `worktrees[0]` every time. + The restore waits for every backend's snapshot (capped at 3s), so a + slow host can't overwrite the saved choice. +- **Composer text.** No hotkey hints. The placeholder is "Message + Claude", and Return inserts a newline unless send-on-Enter is on. +- **Origin badge.** Shown on rows only when more than one backend is + enabled. +- **Larger tap targets.** + - Every button and row in the picker is at least 44×44pt (audited). + - Chat rows keep the web's density but get `hitSlop` to roughly 44pt. + - Approval buttons are 44pt. + - The composer buttons are 36pt. +- **Two new deep links:** `://pair?url=…` and + `://open?wt=…&tab=…`. The second is also what an approval push + notification would open. + +**Fixed while porting** (the desktop fix is committed separately): + +- **Auto-sleep fix (desktop).** `panes:wakeTab` now counts as activity. + Previously, opening an idle chat from any phone woke it, and the next + auto-sleep sweep (within 60s) slept it again, because nothing touches + `lastActive` until a keystroke. +- **Modal replaced.** react-native-web's `Modal` failed to reopen after a + close and kept a focus trap. The sheet and menu are now in-tree overlays. +- **Composer focus.** Focus returns to the input after a popover pick. + +**Not ported yet:** + +- **Terminal tabs.** Deferred to its own worktree, as agreed. +- **New worktree screen and the details panel.** The details panel is PR + status, merge, commits and cost: about 1,750 lines of desktop UI. +- **Composer extras.** @-mentions, image attachments, prompt suggestions, + and the drag-to-resize handle. +- **Transcript extras.** Find-in-chat (no on-screen trigger on the web + either) and rewind/fork (right-click only on the web; long-press would + be the phone equivalent). +- **Brand icons.** They show as a plug icon. +- **Markdown.** Rendering is minimal: no tables, and no syntax + highlighting. + +**Tested:** + +- **Expo web**, at 393×852 against two `harness-server`s, covered all of + the above: + - picker accordion, the pin/alias/unpin round trip, and restore across + reloads; + - wake on keystroke, history, tool grouping, every approval mode + (Allow once executed for real), permission pill, slash and model + popovers, streaming, and interrupt. +- **Performance on web:** 0 long tasks (main-thread blocks over 50ms) + across 40s of a streamed 700-word markdown answer, on desktop CPU. +- **iOS simulator (Expo Go, Hermes):** the shell and a chat render + identically, including the svg and lucide icons through the shim, and + the deep link works. + +**Not tested:** + +- Native *interactions*: the simulator can't take synthetic taps with + this Xcode. +- The queued-message path (the turn finished before the follow-up + arrived). +- The jump-to-bottom pill: the hidden test tab never runs `scrollTo`. +- On-device Hermes performance. +- Android at runtime. + +**Bundle:** the Hermes bundle is 4.6MB, up from 1.6MB, mostly the whole +lucide icon set behind the shim. A babel import-rewrite to per-icon +modules would recover most of it. + +## 8. The tools panel (right column) + +Both phone clients now have the desktop's **full** right column, not the +web client's old four-panel subset. + +- **Web client:** `RightColumn` was split into `useRightPanelConfig` + (tools list, effective order/visibility, `repoConfig:set` writers) and + `RightPanelStack`. The desktop column and `MobileRightPanel` both render + them, so the phone web sheet gets every panel in the repo's order, plus + the visibility/reorder toolbar and "Build a custom tool…". The latter + pre-fills the phone's new-worktree screen, like the desktop. + - The diff, file and review openers became optional props. The phone + omits them, so those rows don't open a tab it can't render. + - Touch-only (`pointer-coarse:`) sizing gives the toolbar, panel headers + and header actions 44px targets. Measured: all 16 buttons in the sheet + are at least 44×44; they were 12–40px before. +- **App:** `mobile/src/panels/` contains `PanelsHost`, a ported + `RightPanel` chrome and a ported `useWatchedQuery` (watch and invalidate + signals plus a fallback poll), and RN ports of every panel: + - PR Status and Merge Locally + - Branch Commits, with the commit popover + - Changed Files and All Files + - Todos, Agents, Subscriptions + - Cost and Context, with the same interest gates + - Scratchpad + - custom tools + + Visibility and order edits write the repo's `.ness.json`, the same file + the desktop toolbar uses (verified). +- **Shared rules:** + - Send-to-agent uses the desktop's routing (selected tab, else the + pane's active tab, else the first agent or chat tab). + - Removing a worktree from either phone UI always asks first. +- **Desktop fixes found on the way:** several panels used `*-error` / + `text-text` classes that aren't theme tokens, so the Context meter's + tool rows, the Cost/Context totals, the GitHub API log errors and the + perf HUD rendered colourless. They now use `danger` / `fg`. +- **Verified on Expo web**, read-only on real repos: + - PR #421's data, the checks list and the commit popover. + - In the throwaway repo: visibility/order round-trip into `.ness.json`, + Merge Locally's main-worktree check, the Scratchpad save across a + reload, and Cost and Context loading live data on expand. +- **Not tested:** merge, approve and remove on a real PR/worktree + (deliberately not run); Todos and Agents with live data; Subscriptions; + a repo with custom tools. +- **React Native's `Alert` is a no-op on react-native-web**, so the app's + long-press detail popups and confirmations only appear on native. + +## Driving the simulator (agent testing) + +- **What works:** Xcode 27 ships an MCP server, `xcode-tools` + (`xcrun mcpbridge`). Its `DeviceInteraction*` tools tap, swipe and type, + and return a screenshot plus the UI hierarchy after each action. It's + registered with Claude Code for this repo (`claude mcp add xcode -- + xcrun mcpbridge`). This agent is approved; approval is raised by + `XcodeNewProject` / `XcodeOpenWorkspace` on a throwaway project. +- **What didn't work:** + - `idb` taps fail on Xcode 27: SimulatorKit moved to + `Contents/SharedFrameworks`. + - Device interaction needs an **iOS 27+ simulator**. + +## Recommended architecture to productionise + +- **Keep** importing `src/shared` directly. Enforce RN-safety in CI with + `tsc` plus `expo export` for `mobile/`. +- Move the mobile store into a small `src/shared/client-store.ts` that both + the renderer and mobile use, instead of duplicating it. +- Keep the renderer's model layer DOM-free (it mostly is). The one coupling + that forced shims is `tool-display.ts` owning icon components; splitting + labels from icons would remove the `lucide-react` shim. +- Navigation: switch to Expo Router (the spike uses state-switched screens + in one file). +- Transcript rendering: build an RN markdown renderer plus tool-call + summaries. Reuse the `JsonClaudeChatEntry` model, not the DOM components. +- Server: + - Make `getEntries` respond only to the asking client. + - Add an acked send. + - Optionally add per-client event scoping. + - Add a push-token registry with an approval push deriver. + - Issue per-device tokens. +- Transport: Tailscale `wss` by default, with LAN `ws` as an opt-in. + +**Rough effort:** + +- About 1 week for a polished LAN/Tailscale v1: list, transcript, send, + approve. +- Plus 2–3 days for push notifications. +- Plus 1–2 weeks for a hosted relay, off-network approvals and per-device + auth. +- Plus App Store and Play review overhead. + +## Running the spike + +```sh +# backend (from repo root) +npm run build:headless +HARNESS_DATA_DIR=./.headless-data HARNESS_WS_HOST=0.0.0.0 node dist-headless/main/index.js +# → prints "[web-client] open http://:37291/?token=…" + +# app +cd mobile && npm install +npx expo start --web # or --ios / --android (Expo Go) +# paste the printed link, scan the Settings QR, or deep-link: +xcrun simctl openurl booted "exp://:8081/--/pair?url=" +``` + +Note: starting `harness-server` installs Ness's status hooks into +`~/.claude/settings.json`, `~/.codex/hooks.json` and `~/.cursor/hooks.json`, +the same as the desktop app does. diff --git a/mobile/app.json b/mobile/app.json new file mode 100644 index 00000000..1c02858b --- /dev/null +++ b/mobile/app.json @@ -0,0 +1,43 @@ +{ + "expo": { + "name": "Ness Mobile (spike)", + "slug": "ness-mobile-spike", + "version": "1.0.0", + "orientation": "portrait", + "icon": "./assets/icon.png", + "userInterfaceStyle": "automatic", + "ios": { + "supportsTablet": true, + "infoPlist": { + "NSAppTransportSecurity": { + "NSAllowsLocalNetworking": true + }, + "NSLocalNetworkUsageDescription": "Connect to Ness running on your computer" + } + }, + "android": { + "adaptiveIcon": { + "backgroundColor": "#E6F4FE", + "foregroundImage": "./assets/android-icon-foreground.png", + "backgroundImage": "./assets/android-icon-background.png", + "monochromeImage": "./assets/android-icon-monochrome.png" + }, + "predictiveBackGestureEnabled": false, + "usesCleartextTraffic": true + }, + "web": { + "favicon": "./assets/favicon.png" + }, + "plugins": [ + [ + "expo-camera", + { + "cameraPermission": "Scan the pairing QR code shown in Ness Settings", + "microphonePermission": false, + "recordAudioAndroid": false + } + ], + "expo-secure-store" + ] + } +} diff --git a/mobile/assets/android-icon-background.png b/mobile/assets/android-icon-background.png new file mode 100644 index 00000000..5ffefc5b Binary files /dev/null and b/mobile/assets/android-icon-background.png differ diff --git a/mobile/assets/android-icon-foreground.png b/mobile/assets/android-icon-foreground.png new file mode 100644 index 00000000..3a9e5016 Binary files /dev/null and b/mobile/assets/android-icon-foreground.png differ diff --git a/mobile/assets/android-icon-monochrome.png b/mobile/assets/android-icon-monochrome.png new file mode 100644 index 00000000..77484ebd Binary files /dev/null and b/mobile/assets/android-icon-monochrome.png differ diff --git a/mobile/assets/favicon.png b/mobile/assets/favicon.png new file mode 100644 index 00000000..408bd746 Binary files /dev/null and b/mobile/assets/favicon.png differ diff --git a/mobile/assets/icon.png b/mobile/assets/icon.png new file mode 100644 index 00000000..7165a53c Binary files /dev/null and b/mobile/assets/icon.png differ diff --git a/mobile/assets/splash-icon.png b/mobile/assets/splash-icon.png new file mode 100644 index 00000000..03d6f6b6 Binary files /dev/null and b/mobile/assets/splash-icon.png differ diff --git a/mobile/index.ts b/mobile/index.ts new file mode 100644 index 00000000..1d6e981e --- /dev/null +++ b/mobile/index.ts @@ -0,0 +1,8 @@ +import { registerRootComponent } from 'expo'; + +import App from './App'; + +// registerRootComponent calls AppRegistry.registerComponent('main', () => App); +// It also ensures that whether you load the app in Expo Go or in a native build, +// the environment is set up appropriately +registerRootComponent(App); diff --git a/mobile/metro.config.js b/mobile/metro.config.js new file mode 100644 index 00000000..fb130f17 --- /dev/null +++ b/mobile/metro.config.js @@ -0,0 +1,45 @@ +// The app imports Ness's reducers, transport and the renderer's pure model +// code (worktree-list-model, merge-backend-states, turn-collapse, …) +// straight from ../src — no copies, so behaviour matches the web client by +// construction. That tree sits outside the project root and the repo isn't +// an npm workspace, so Expo's monorepo auto-config doesn't kick in. +// +// Only DOM-free, React-free modules may be imported from ../src. As a +// backstop, any bare-specifier import that originates outside mobile/ is +// resolved as if from mobile/, so hierarchical lookup can never reach the +// Electron app's ../node_modules and load a second React. +// +// Don't set disableHierarchicalLookup: npm nests some Expo deps +// (expo/node_modules/expo-asset) and the native bundle can't find them. +const path = require('path') +const { getDefaultConfig } = require('expo/metro-config') + +const projectRoot = __dirname +const srcRoot = path.resolve(projectRoot, '../src') + +const config = getDefaultConfig(projectRoot) +config.watchFolders = [...(config.watchFolders ?? []), srcRoot] +config.resolver.nodeModulesPaths = [path.resolve(projectRoot, 'node_modules')] + +// Web-only icon packages used by renderer modules we reuse (tool-display's +// icon registry): served as RN equivalents. See src/shims/. +const SHIMS = { + 'lucide-react': path.join(projectRoot, 'src/shims/lucide-react.js'), + 'react-icons/si': path.join(projectRoot, 'src/shims/react-icons-si.js') +} + +const isBare = (name) => !name.startsWith('.') && !path.isAbsolute(name) +config.resolver.resolveRequest = (context, moduleName, platform) => { + const fromSrc = context.originModulePath.startsWith(srcRoot + path.sep) + if (fromSrc && SHIMS[moduleName]) return { type: 'sourceFile', filePath: SHIMS[moduleName] } + if (isBare(moduleName) && fromSrc) { + return context.resolveRequest( + { ...context, originModulePath: path.join(projectRoot, 'index.ts') }, + moduleName, + platform + ) + } + return context.resolveRequest(context, moduleName, platform) +} + +module.exports = config diff --git a/mobile/package-lock.json b/mobile/package-lock.json new file mode 100644 index 00000000..c0bdf8bd --- /dev/null +++ b/mobile/package-lock.json @@ -0,0 +1,6892 @@ +{ + "name": "mobile", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "mobile", + "version": "1.0.0", + "dependencies": { + "@expo/metro-runtime": "~58.0.17", + "@react-native-async-storage/async-storage": "2.2.0", + "diff": "^9.0.0", + "expo": "~58.0.26", + "expo-camera": "~58.0.14", + "expo-clipboard": "~58.0.4", + "expo-secure-store": "~58.0.3", + "expo-status-bar": "~58.0.5", + "lucide-react-native": "^1.80.0", + "react": "19.3.0", + "react-dom": "19.3.0", + "react-native": "0.88.1", + "react-native-keyboard-controller": "1.22.7", + "react-native-reanimated": "4.7.1", + "react-native-safe-area-context": "~5.11.1", + "react-native-svg": "15.16.0", + "react-native-web": "^0.21.4", + "react-native-worklets": "0.13.0" + }, + "devDependencies": { + "@types/react": "~19.3.0", + "typescript": "~6.0.3" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", + "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.29.7", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.7.tgz", + "integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.29.13", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.13.tgz", + "integrity": "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.13", + "@babel/helper-compilation-targets": "^7.29.13", + "@babel/helper-module-transforms": "^7.29.13", + "@babel/helpers": "^7.29.13", + "@babel/parser": "^7.29.13", + "@babel/template": "^7.29.7", + "@babel/traverse": "^7.29.13", + "@babel/types": "^7.29.11", + "@jridgewell/remapping": "^2.3.5", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.2.tgz", + "integrity": "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/generator": { + "version": "7.29.15", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.15.tgz", + "integrity": "sha512-gNWJUX0FlevflramOkaInywOMhU1lkln38gAC7TFZv2tsWbLYbN/2WZFGcq8zbX0Z55e4vGa27IB/NaeZoauWQ==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.15", + "@babel/types": "^7.29.15", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-annotate-as-pure": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.29.7.tgz", + "integrity": "sha512-OoK6239jHPuSQOoS0kfTVKn0b/rVTk0seKq4Gd2UMLtmOVLjDC0ki3e+c90Trqv2gMfvJFqkiljrr568+qddiw==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.29.13", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.13.tgz", + "integrity": "sha512-8WxJ4/Vmes3ghacj8VOJy3NW8eyHiFY/4thU/LSBuBE470+igjR/j1ZTNn8fV5VdNrLx6iXUwig526UdOvfP0w==", + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.29.7", + "@babel/helper-validator-option": "^7.29.7", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.2.tgz", + "integrity": "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/helper-create-class-features-plugin": { + "version": "7.29.13", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.29.13.tgz", + "integrity": "sha512-fo8/Fr44/DMV71FQjk/HA0Npmu3bo5DFoWTCW1dhUR8Vx3NFfAVeEy0TbcBpt4e+hd2QhdmWgmspHo/9iWj8RA==", + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.29.7", + "@babel/helper-member-expression-to-functions": "^7.29.7", + "@babel/helper-optimise-call-expression": "^7.29.7", + "@babel/helper-replace-supers": "^7.29.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.29.13", + "@babel/traverse": "^7.29.13", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-create-class-features-plugin/node_modules/semver": { + "version": "6.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.2.tgz", + "integrity": "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/helper-create-regexp-features-plugin": { + "version": "7.29.14", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.29.14.tgz", + "integrity": "sha512-nKvzhuLMMnFHHsENpUZh4N2e+LqnKDgT0SMibSyv8aW8FqGKWMqLO/zdnRjAYcruH9At6LVicWg7DgTc6IPzNg==", + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.29.7", + "regexpu-core": "^6.5.4", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-create-regexp-features-plugin/node_modules/semver": { + "version": "6.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.2.tgz", + "integrity": "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/helper-define-polyfill-provider": { + "version": "0.6.8", + "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.8.tgz", + "integrity": "sha512-47UwBLPpQi1NoWzLuHNjRoHlYXMwIJoBf7MFou6viC/sIHWYygpvr0B6IAyh5sBdA2nr2LPIRww8lfaUVQINBA==", + "license": "MIT", + "dependencies": { + "@babel/helper-compilation-targets": "^7.28.6", + "@babel/helper-plugin-utils": "^7.28.6", + "debug": "^4.4.3", + "lodash.debounce": "^4.0.8", + "resolve": "^1.22.11" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/@babel/helper-globals": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.7.tgz", + "integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-member-expression-to-functions": { + "version": "7.29.14", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.29.14.tgz", + "integrity": "sha512-FuTSn8mXKAP+aHXnbkCYQsQAdlEIJptEutwc2NaPd28hyVqsjRDmBnI2EPJX6HCodKIqOHfayQHqtxQCkqwthA==", + "license": "MIT", + "dependencies": { + "@babel/helper-skip-transparent-expression-wrappers": "^7.29.13", + "@babel/traverse": "^7.29.14", + "@babel/types": "^7.29.14" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.29.7.tgz", + "integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==", + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.29.14", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.29.14.tgz", + "integrity": "sha512-2XDvQVd9JESaOgGc4jT2/jquTAO7ppA5noTZQqH+MmZ89yjCzScLwtCPbWtkPZylL+TLWR49IwWmk+QkRR4GsA==", + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7", + "@babel/traverse": "^7.29.14" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-optimise-call-expression": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.29.7.tgz", + "integrity": "sha512-+kmGVjcT9RGYzoDwdwEqEvGgKe3BYq+O1iGzjFubaNgZHwYHP6lsF2Yghf4kEuv9BV7tYDZ913aBW9am6YKong==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.29.7.tgz", + "integrity": "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-remap-async-to-generator": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.29.7.tgz", + "integrity": "sha512-16AMiW26DbXWBbr3B8wNozKM0ydMLB892vaOaJW/fPJdnT8vJk5sdkQcU/isqUxyCE0cEoa8wZOcbgDuC4b6Og==", + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.29.7", + "@babel/helper-wrap-function": "^7.29.7", + "@babel/traverse": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-replace-supers": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.29.7.tgz", + "integrity": "sha512-atfGXWSeCiF4DnKZIfmJfQRkSw9b9gNNXR1kqKjbhG4pGYCOnkp8OcTB8E3NXjBu8NpheSnOeNKz8KT7UNFTmQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-member-expression-to-functions": "^7.29.7", + "@babel/helper-optimise-call-expression": "^7.29.7", + "@babel/traverse": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-skip-transparent-expression-wrappers": { + "version": "7.29.13", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.29.13.tgz", + "integrity": "sha512-Abm4rKIH0tmCayJLwcoeOkdzpYUphTbO52fHhyEBHn7S0R+ni4epNLI/8nq1L0DN2Bl0u5qmgWm2Og/z4fBb+Q==", + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.29.13", + "@babel/types": "^7.29.11" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.29.15", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.15.tgz", + "integrity": "sha512-C2FuapQ2Kh1OnVHAoLi5rD3GBJ8COb9Q609T6HEpLqaBAo560PDP5OxBE5dCI/h951MBO/+bCUYU5SZ+8ZlV+w==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", + "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz", + "integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-wrap-function": { + "version": "7.29.15", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.29.15.tgz", + "integrity": "sha512-14dKROQSpuNYPw+4wpADe87YLS1VnP/ua3gKTRpEAX1ErBayLMgK/KpWbCP/uYiCSBAVGp/a7bY8MqRfFNRqOQ==", + "license": "MIT", + "dependencies": { + "@babel/template": "^7.29.7", + "@babel/traverse": "^7.29.15", + "@babel/types": "^7.29.15" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.29.15", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.15.tgz", + "integrity": "sha512-l+ezV2czw3t2d2ELq+3CwPL4WLKK5O8IywBXb9/gpmbCOVZFmRYJPmHVqSCv2k+8iKbE30Zf54siOoIZ52XOxA==", + "license": "MIT", + "dependencies": { + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.15" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.29.15", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.15.tgz", + "integrity": "sha512-RpKWyisHoP81twtSCgmE02iU0RnPcq1DN5bBEbpUePrjA9Q3wXhufnCJrrayPpoZieqFh3zyZQqwtSK0gGccRA==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.15" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-proposal-decorators": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.29.7.tgz", + "integrity": "sha512-EtU0Hi3GvrTqD56xKmZvV/uCXK2ZbwVNPNLAquVItcAZpUhkXwWlo3Fmj0c2LxgSf2I8IDULeAepwNP1OefLXg==", + "license": "MIT", + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/plugin-syntax-decorators": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-export-default-from": { + "version": "7.29.15", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-default-from/-/plugin-proposal-export-default-from-7.29.15.tgz", + "integrity": "sha512-G9TJJ6ZTxhCGuFlYXB2W8ljMXhkaR2nZEV1DVetC0LgwaibQSVBHq2gD4ldxsfT4/vSzy/V2ARtCmGz1NUlSZg==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-decorators": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.29.7.tgz", + "integrity": "sha512-9MTTLbF39X6sqM92JPEsoI7++26hjZvzkxKZy64aMhWLH2mPkJ/Q3AV4QLmls3R14FpSpkOwQQfUh962JGQxxg==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-dynamic-import": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", + "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-export-default-from": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-default-from/-/plugin-syntax-export-default-from-7.29.7.tgz", + "integrity": "sha512-foag0BB37ROhdeIX9O8G0jX7hw0UekJc04cHMrYLOnrErsnBKqJGHJ8eDRpoCFZBvEPPygmmtw4qyU97qa4oOw==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-flow": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.29.7.tgz", + "integrity": "sha512-ajMX6QPcyomotqwpzhkYGxcK2i/us0rs1Qo9QvUpa+Fca0FTmqrzKrctoIYLMxcOhGZldGT/BAVkRGTWBiR8gQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-jsx": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.29.7.tgz", + "integrity": "sha512-TSu8+mHCoEaaCDEZ0I3+6mvTBYR4PCxQwf2z9/r5Tbztv6NaLR3B9thGTTxX2WGuGHJqRiAbKPeGTJ5XWXVg6A==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-typescript": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.29.7.tgz", + "integrity": "sha512-ngr+82Sh0xMz25TPCZi+nC2iTzjfCdWS2ONXTp/PtSCHCgaCNBpdMqgvJ2ccdLlClVZ7sisIgB914j/JFe+RZA==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-arrow-functions": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.29.7.tgz", + "integrity": "sha512-N7zArUXWzAMzm+/N0uPBeVB3Fam5lMxtUwMmDK5f/IBBS7a7p1qeUoxd/6CckXoxUdgsntq1Dh8xNW06maZbDQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-async-generator-functions": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.29.7.tgz", + "integrity": "sha512-d98gXZkgswvkyohMBABkhm3GeXhYj8psWfwQ2C7gtfrKGTykQa/iOIi+JJhwMjPlZ6Vm2XN+DCf3Es1EoG4ZLA==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/helper-remap-async-to-generator": "^7.29.7", + "@babel/traverse": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-async-to-generator": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.29.7.tgz", + "integrity": "sha512-pcUb2SS+RMo9TWVBwKGI5ShtoG7R+zBsFmCKDa6fe8c+hPr3XJlZgoE5j6i8W7gDjhyvy+85vmYexanvXh3d1w==", + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/helper-remap-async-to-generator": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-block-scoping": { + "version": "7.29.15", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.29.15.tgz", + "integrity": "sha512-jfJWMNOYxJUQ3VMdMF0KpmPaugSKRbwLYqxM8UHOga7jKnlbhe18yhBKwiAkaOWrxmxesONjAhtEqTyn2rB2qg==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-class-properties": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.29.7.tgz", + "integrity": "sha512-GtcpjFvanPfzNQi3eTitsCqtRRmmqzpy/A+yhTR1HaZo1Ly3EA8ZXxlPyHdR8/IuRMYc3E4wdGBewB2QKQjAaA==", + "license": "MIT", + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-class-static-block": { + "version": "7.29.14", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.29.14.tgz", + "integrity": "sha512-4rr6WKSu9DzMYpcTlbjHw6hFRk0Gkys3D54mqNE4tOyYQFOTrf3RBhntYH62ec/fbvgGEVATh5cqGZjM2Yc3gw==", + "license": "MIT", + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.29.13", + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.12.0" + } + }, + "node_modules/@babel/plugin-transform-classes": { + "version": "7.29.11", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.29.11.tgz", + "integrity": "sha512-f8kTDM/nTvpLeafb+TJ4jboFr/Y3BbC+QzgPpPGzSKJqWLnj9LW0WLqv4XKA11LX5sr+EgvLE6Ix3YsCEusodw==", + "license": "MIT", + "dependencies": { + "@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/traverse": "^7.29.10" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-destructuring": { + "version": "7.29.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.29.13.tgz", + "integrity": "sha512-X2meXB39NOPPmmshSRJzyd50hX9uCzbscNQwVCjLCtq363PZIJFFxJIeZPpgAewC570vpdeGIHTcltwd0QUlJg==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/traverse": "^7.29.13" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-export-namespace-from": { + "version": "7.29.15", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.29.15.tgz", + "integrity": "sha512-wUo8dEPcDN/gO5/ZoNLDcAFqbJ//idBuMpprfa7NAZ6+Y3PRShTNLcgnKnBAW6vnEDMHiPDwDi62mM90qz7mcQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-flow-strip-types": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.29.7.tgz", + "integrity": "sha512-wRHeUjUjCZnMHmiO5bRgjFLcoEh7JyTdByOW11ahhwNa4V0bmeGEaIvt51yq0zQp2yWIpqfxXXPyUP6GFJZHOQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/plugin-syntax-flow": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-for-of": { + "version": "7.29.15", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.29.15.tgz", + "integrity": "sha512-JHa0QfVEG23goXwV1j8HT31EEIZ8nUJBKNTJ/UU1AwfRqY+7xXBEg9M61Tbz60sxKomE2MQBA3vovEbplL964Q==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.29.13" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-logical-assignment-operators": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.29.7.tgz", + "integrity": "sha512-A0H91hh6W8MFRkp5TqJmMr39jzGD1A1E1Ysiv2O06Sfbhkapm+XyIzxWCEh5kqwOZ1/8QZ0dY3SeQ7XBqfJd5Q==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs": { + "version": "7.29.14", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.29.14.tgz", + "integrity": "sha512-mbv2yy5dqP6e3DbusCx+5AypXkFbyJD/JhG4/XhA+BIADOw5o7W+X0ewSp/h3w7gRL3oR5yny2/K8ljiydj4uA==", + "license": "MIT", + "dependencies": { + "@babel/helper-module-transforms": "^7.29.14", + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-named-capturing-groups-regex": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.29.7.tgz", + "integrity": "sha512-vuFoLwr4qnv2xbZ16SQd6uPcH5FNrLHhk/Jzo++0XJFcaDsr4gjJVg6j398oMHiC+83k/GiBzviwF5KBJkPUtQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-transform-nullish-coalescing-operator": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.29.7.tgz", + "integrity": "sha512-idmp1dFaekP9GbcMvG24Kvw2BfhFZjHnNJCkV4WuIY4PskJzwI3f1N5OdgYke38T7rftO6ERulFRn2cFeZwRkg==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-object-rest-spread": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.29.7.tgz", + "integrity": "sha512-Ld98jn4c0smUywL57m7SgsHq3OpThOa6LqZJif3G6jYOovPleoFhVrBJ1WegRApSFB2wu4+RelAj9AC9G08Z4A==", + "license": "MIT", + "dependencies": { + "@babel/helper-compilation-targets": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/plugin-transform-destructuring": "^7.29.7", + "@babel/plugin-transform-parameters": "^7.29.7", + "@babel/traverse": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-optional-catch-binding": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.29.7.tgz", + "integrity": "sha512-sLsyndxK2VwX6yNUOakMb7Sh553ZTe/vVM1XJ+9Z5aW1ytsc8xOIwmyk05NNjN60vkc5/KqoTH6hB4V41LJhng==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-optional-chaining": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.29.7.tgz", + "integrity": "sha512-6GM1dhvK3gNODkXcEcMCOLEDCLSoZ/sBbro2Ax8HURyasQ4NshagQixkRFdh5niI6E4gmA/jYI/4aT7rRos3ZQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-parameters": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.29.7.tgz", + "integrity": "sha512-ZDOBqV/qLYJI0YElr8DcENEyARsFQeESqWXH6gZlghYXuPPjvweuDhP4VyEi4BlUBlLRFZVjxoZDMjxhLW766g==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-private-methods": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.29.7.tgz", + "integrity": "sha512-/6Rz4DK1ETDEM/bWHsPHcaEe7ZaT1EqSXjtSP/L0DijOYuaUhiRiOKcwpZ8P7zR4xXEHc2ITdiCgBm9Tpyv9ug==", + "license": "MIT", + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-private-property-in-object": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.29.7.tgz", + "integrity": "sha512-+BNo06dnrzdNNqCm1X6YUaVv0DKk8Q+JYcoZfOkLhYWNCXzlwTSRq8zGWayT1csjcpNXV9CQTBRRbmTLZac5cA==", + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.29.7", + "@babel/helper-create-class-features-plugin": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-display-name": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.29.7.tgz", + "integrity": "sha512-+1wdDMGNb4UPeY3Q4L5yLiYe6TXPXubs4NjrgRFw13hPRLJfEMw2Q5OXkee6/IfdqePIeW4Jjwe3aBh7SdKz4Q==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.29.7.tgz", + "integrity": "sha512-WsZulLVBUHXVj2cUcPVx6UE21TpalB6bHbSFErKT0Ib++ax24jjXe73FqlWvdylFOjiuPHYi6VCcgRad1ItN+A==", + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.29.7", + "@babel/helper-module-imports": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/plugin-syntax-jsx": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-development": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-development/-/plugin-transform-react-jsx-development-7.29.7.tgz", + "integrity": "sha512-Xfy3UVMF04+ypnFbkhvfqtmvwfe92qwQdbGZVonhE+6v35GzlofmOnA1szaZqzb9xYWr0nl1e5EMmzi0DNON1g==", + "license": "MIT", + "dependencies": { + "@babel/plugin-transform-react-jsx": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-self": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.29.7.tgz", + "integrity": "sha512-TL0hMc9xzy86VD31nUiwzd5otRAcyEPcsegCxolO0PvcXuH1v0kECe/UIznYFihpkvU5wg/jk4v0TTEFfm53fw==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-source": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.29.7.tgz", + "integrity": "sha512-06IyK09H3wi4cGbhDBwp5gUGo0IKtnYa8tyTiephirPCK6fbobVGiXMMI5zLQ4aKEYP3wZ3ArU44o+8KMrSG/Q==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-pure-annotations": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-pure-annotations/-/plugin-transform-react-pure-annotations-7.29.7.tgz", + "integrity": "sha512-H5E+HBgDpr6Q5t+Aj11tL7XkIui1jhbIoArVQnqjgXo5/3YxkN7ZEBcWF4RQlB0T4rrxJQbXS6kiFV6B7XTqUA==", + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-regenerator": { + "version": "7.29.15", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.29.15.tgz", + "integrity": "sha512-L9KQ+qXJeKgI/Kk5TOSsUlg/5x1XG/RzklXYDdQQ+KLbbxIYZ6IjiBqSWl5AU7FjGtiTLtwTkWGDyWRWI2CrSQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-runtime": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.29.7.tgz", + "integrity": "sha512-xmAscdE/AsqRW7vutbPNoUmu/nF5SrLKPs7aoJgEjo35lLKA/Bc0i2rMv/hr1+Y0o1bQCiVtith3u2vdgRL39Q==", + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7", + "babel-plugin-polyfill-corejs2": "^0.4.14", + "babel-plugin-polyfill-corejs3": "^0.13.0", + "babel-plugin-polyfill-regenerator": "^0.6.5", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-runtime/node_modules/semver": { + "version": "6.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.2.tgz", + "integrity": "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/plugin-transform-shorthand-properties": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.29.7.tgz", + "integrity": "sha512-I+WYbGBAiCn7nA6xBrlgPH+MB7HWb4u8pv5S0Pv7OtwNvIFvCCb24YlttKEeUFVurfBCEaOTnuhlqsb7f0Z5Dg==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-template-literals": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.29.7.tgz", + "integrity": "sha512-NCSEJ4sLFU2gqAub45HYh4fus2yQ36rr6ei6vpU7NdoJqCpxvEG8E6eJpscGyXP3VHD2Ny+fSXr04k1hoUrFqA==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-typescript": { + "version": "7.29.15", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.29.15.tgz", + "integrity": "sha512-FFuMssbHj8DFMDsTH8xrgKBiE1eXuDvO9jLqav7/vsIe6YdoyPQbWCgLNzQxkcIkOv5itBD17TvZkHGIjUMzLg==", + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.29.7", + "@babel/helper-create-class-features-plugin": "^7.29.13", + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.29.13", + "@babel/plugin-syntax-typescript": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-regex": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.29.7.tgz", + "integrity": "sha512-7D/x/23/d/3VqZ0QA+LGbZMlGwZjztBygSWWWsfTPoQ1oQ6Q1P6Mr3d0kk42XabyUVw+fha3LqdRsFqeKqvCyA==", + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/preset-typescript": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.29.7.tgz", + "integrity": "sha512-/Foi8vKY2EVbed/1eZx0gJEEwHAIxogrySI7rULcRIvhZzbvoE/b5qG5Ghc0WKAFKOHA9SD1x7RsFlOYdutIiQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/helper-validator-option": "^7.29.7", + "@babel/plugin-syntax-jsx": "^7.29.7", + "@babel/plugin-transform-modules-commonjs": "^7.29.7", + "@babel/plugin-transform-typescript": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/runtime": { + "version": "7.29.15", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.15.tgz", + "integrity": "sha512-304gsbbGVmQc+cNGHzwHBlqepYdWLKj3VXCQBGt/EGcV7PUPfKI7kAUNW1FZEOCwlQiLvQjg1JEaAlRQ616h+Q==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/template": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz", + "integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.29.15", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.15.tgz", + "integrity": "sha512-ZfawBo2i8vvt+BTt37dWDKBPjUfm/H+bw+ltwsCRhW7gPtyNVwUXuNo54eO2Xo+P4VXpalPFfFISbBTRKC8SOQ==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.15", + "@babel/helper-globals": "^7.29.7", + "@babel/parser": "^7.29.15", + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.15", + "debug": "^4.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.29.15", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.15.tgz", + "integrity": "sha512-/XKpKDakL//LZ66bq1XsZOswuqeI5MZqPLDu18o3XdkU1fNJ7bdPtzgnc4ZNS+bBGHV0FJG8jjb8SwcC3nNVQQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.29.15", + "@babel/helper-validator-identifier": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@expo/code-signing-certificates": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/@expo/code-signing-certificates/-/code-signing-certificates-0.0.7.tgz", + "integrity": "sha512-zP0tnfqrFFRL8INtOaQ6XwEYfdIpIH9vrEo7y0bHQGQa50z4/QWXE5CI4nRUHxqFW4MVWOwXFg1hom1aAZHNkQ==", + "license": "MIT", + "dependencies": { + "node-forge": "^1.4.0" + }, + "engines": { + "node": ">=22.13.0" + } + }, + "node_modules/@expo/config": { + "version": "58.0.12", + "resolved": "https://registry.npmjs.org/@expo/config/-/config-58.0.12.tgz", + "integrity": "sha512-Ch/4Cb8womWYpY1zI4BEEYT1rGuKti8O8aSzyAM79xNTVRx6nPw2h9j91Knq95OSH3wtjrcthZwVYZ3po4igNg==", + "license": "MIT", + "dependencies": { + "@expo/config-plugins": "~58.0.13", + "@expo/config-types": "^58.0.3", + "@expo/json-file": "^11.2.1", + "@expo/platforms": "^58.0.1", + "@expo/require-utils": "^58.0.6", + "resolve-workspace-root": "^2.0.0", + "semver": "^7.7.4", + "slugify": "^1.3.4" + } + }, + "node_modules/@expo/config-plugins": { + "version": "58.0.13", + "resolved": "https://registry.npmjs.org/@expo/config-plugins/-/config-plugins-58.0.13.tgz", + "integrity": "sha512-Vbkt0vpIJ9z+oCFr2simtfuiPxdpIovDgYnzenC9z7jX0rlo8nTLGQky+q+SJdovIbyymGAO45UR0YqwLgbvKw==", + "license": "MIT", + "dependencies": { + "@expo/config-types": "^58.0.3", + "@expo/json-file": "~11.2.1", + "@expo/plist": "^0.10.2", + "@expo/require-utils": "^58.0.6", + "@expo/sdk-runtime-versions": "^1.0.1", + "chalk": "^4.1.2", + "debug": "^4.3.5", + "semver": "^7.7.4", + "slugify": "^1.6.6", + "tinyglobby": "^0.2.15", + "xcode": "^4.0.0", + "xml2js": "0.6.0" + } + }, + "node_modules/@expo/config-types": { + "version": "58.0.3", + "resolved": "https://registry.npmjs.org/@expo/config-types/-/config-types-58.0.3.tgz", + "integrity": "sha512-wyfrwkTT/hQHzwyqkXkngKxoOa8L6ovsTP4h/UukS1mTmssee5et6HOPoN5RtawdJPnm5JO28f//C/wXlpka8Q==", + "license": "MIT" + }, + "node_modules/@expo/devcert": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@expo/devcert/-/devcert-1.2.2.tgz", + "integrity": "sha512-wz1YedXwdNbYqk/PRr34vixnuw1+l6uSwmPXUj649cot5iYNccb2zIOnK7Nonb1Pfd/dxAY6CvU6KM3uSdxC7A==", + "license": "MIT", + "dependencies": { + "@expo/sudo-prompt": "^9.3.1", + "debug": "^3.1.0" + } + }, + "node_modules/@expo/devcert/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/@expo/dom-webview": { + "version": "58.0.2", + "resolved": "https://registry.npmjs.org/@expo/dom-webview/-/dom-webview-58.0.2.tgz", + "integrity": "sha512-bLkREoP7qL3rEuzxP60xG+TjdPoGjbnZfxkvYo5imJxGWfKMOf7x962W06Pu+WWAr4gcDRk16iA+Clg8D0zjCg==", + "license": "MIT", + "peerDependencies": { + "expo": "*", + "react": "*", + "react-native": "*" + } + }, + "node_modules/@expo/env": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@expo/env/-/env-2.6.0.tgz", + "integrity": "sha512-pSNESQU0IGhLs/A3QlNPoh/acb1vWU7N721OjaIm3JT8yzgZymIM/m4x2y73YwpEtqgwWsCl6+japtq2PtXIPw==", + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">=20.12.0" + } + }, + "node_modules/@expo/fingerprint": { + "version": "0.21.10", + "resolved": "https://registry.npmjs.org/@expo/fingerprint/-/fingerprint-0.21.10.tgz", + "integrity": "sha512-u73rWDHOYijO1wT60uKjtuoGBKsU9/MFSh7WEE63K2jJ0ML8eycUCXF9FmLf3EVzzIjYIPu6Ns04LR7FVGh6mA==", + "license": "MIT", + "dependencies": { + "@expo/env": "^2.6.0", + "@expo/spawn-async": "^1.8.0", + "arg": "^5.0.2", + "chalk": "^4.1.2", + "debug": "^4.3.4", + "ignore": "^5.3.1", + "minimatch": "^10.2.6", + "resolve-from": "^5.0.0", + "semver": "^7.7.4" + }, + "bin": { + "fingerprint": "bin/cli.js" + } + }, + "node_modules/@expo/image-utils": { + "version": "0.12.7", + "resolved": "https://registry.npmjs.org/@expo/image-utils/-/image-utils-0.12.7.tgz", + "integrity": "sha512-fuiRQxvvkbj932BamtYh1UKuyRJ5tXBJ3XxpGm5pT4zzynPmygd3RtOQrzIhcsIZGcG6i1n+KvrszYRnk3evqQ==", + "license": "MIT", + "dependencies": { + "@expo/require-utils": "^58.0.6", + "@expo/spawn-async": "^1.8.0", + "chalk": "^4.0.0", + "jimp-compact": "0.16.1", + "parse-png": "^2.1.0", + "semver": "^7.7.4" + } + }, + "node_modules/@expo/inline-modules": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/@expo/inline-modules/-/inline-modules-0.2.10.tgz", + "integrity": "sha512-WFqhlOrUUc0VZxrUPq5X328aP2e/cQKvJJXhwNxNj9fqWS9iFWC1E9VRHHhJIqdu+qy2YU3s2OBDlyIz9X/5aA==", + "license": "MIT", + "dependencies": { + "@expo/config-plugins": "~58.0.13" + } + }, + "node_modules/@expo/json-file": { + "version": "11.2.1", + "resolved": "https://registry.npmjs.org/@expo/json-file/-/json-file-11.2.1.tgz", + "integrity": "sha512-UPhKoFCj8BcwgLB1rKQ1CuR/REITnZLiqxHEHOeH1tPsdXcHGtUDh0P5bLbr7oU0nKVdtJ5rzyKx8jniMQdESQ==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.20.0", + "json5": "^2.2.3" + } + }, + "node_modules/@expo/local-build-cache-provider": { + "version": "58.0.12", + "resolved": "https://registry.npmjs.org/@expo/local-build-cache-provider/-/local-build-cache-provider-58.0.12.tgz", + "integrity": "sha512-2fpz4A+cf7YybeVx6lc/kulUpMLOv0OrlhdcvOpMCQG/9Wp5IBOZUgykSN86wmU5ZGJe4JeDJ4Soq5H3hfvzIw==", + "license": "MIT", + "dependencies": { + "@expo/config": "~58.0.12", + "chalk": "^4.1.2" + } + }, + "node_modules/@expo/log-box": { + "version": "58.0.15", + "resolved": "https://registry.npmjs.org/@expo/log-box/-/log-box-58.0.15.tgz", + "integrity": "sha512-IBpaJcTdJlSqmiEtyI9XDiNPSRUZNpeWdRbzE4ic6I4k17mpy0LxWJ4Mz2hB7B48b9BrleUKFeZ+6VseglmvGQ==", + "license": "MIT", + "dependencies": { + "@expo/dom-webview": "^58.0.2", + "@expo/log-box-utils": "^58.0.2", + "anser": "^1.4.9", + "stacktrace-parser": "^0.1.10" + }, + "peerDependencies": { + "@expo/dom-webview": "^58.0.2", + "expo": "*", + "react": "*", + "react-native": "*" + }, + "peerDependenciesMeta": { + "expo": { + "optional": true + } + } + }, + "node_modules/@expo/log-box-utils": { + "version": "58.0.2", + "resolved": "https://registry.npmjs.org/@expo/log-box-utils/-/log-box-utils-58.0.2.tgz", + "integrity": "sha512-My8Lwe9FU/yDwwzqwi5LN2rzzDcJqIAZKrD9f0XHZEKz/FQnWJYdt1rsV7+RwqMGeGq2XsxTCVT1ggTCOvumxw==", + "license": "MIT" + }, + "node_modules/@expo/metro": { + "version": "58.0.0", + "resolved": "https://registry.npmjs.org/@expo/metro/-/metro-58.0.0.tgz", + "integrity": "sha512-PMD640ihB0C3Oqm0AnDVJ/8qF2cKbRUEqGuSOr4tM/OTb9ktxsQqsiSSSeaOEgdCZBq20AxRS0d6WHNhhH2P+g==", + "license": "MIT", + "dependencies": { + "metro": "0.87.1", + "metro-babel-transformer": "0.87.1", + "metro-cache": "0.87.1", + "metro-cache-key": "0.87.1", + "metro-config": "0.87.1", + "metro-core": "0.87.1", + "metro-file-map": "0.87.1", + "metro-minify-terser": "0.87.1", + "metro-resolver": "0.87.1", + "metro-runtime": "0.87.1", + "metro-source-map": "0.87.1", + "metro-symbolicate": "0.87.1", + "metro-transform-plugins": "0.87.1", + "metro-transform-worker": "0.87.1" + } + }, + "node_modules/@expo/metro-file-map": { + "version": "58.0.6", + "resolved": "https://registry.npmjs.org/@expo/metro-file-map/-/metro-file-map-58.0.6.tgz", + "integrity": "sha512-+kPFI328BSUxpK7OO0kM31NQlYG/z7WOTISbPEuY4fMZxmN/nLnmJIDNG8NTtM5ZHXlNPqgjRvdukxtsBEkvuw==", + "license": "MIT", + "dependencies": { + "2g": "^1.0.1", + "debug": "^4.3.4", + "fb-watchman": "^2.0.2", + "invariant": "^2.2.4", + "jest-worker": "^29.7.0", + "walker": "^1.0.8" + } + }, + "node_modules/@expo/metro-runtime": { + "version": "58.0.17", + "resolved": "https://registry.npmjs.org/@expo/metro-runtime/-/metro-runtime-58.0.17.tgz", + "integrity": "sha512-onJvBi90uwLj69F1EaVPmPeds/ndxc2/vNc0Z5n8rqcMKToMyLxGaL3Be6yf7OVjPhGvoDj+LWQ/IcbpN1hnoA==", + "license": "MIT", + "dependencies": { + "@expo/log-box": "^58.0.15", + "anser": "^1.4.9", + "pretty-format": "^29.7.0", + "stacktrace-parser": "^0.1.10", + "whatwg-fetch": "^3.0.0" + }, + "peerDependencies": { + "@expo/log-box": "^58.0.15", + "expo": "*", + "react": "*", + "react-dom": "*", + "react-native": "*" + }, + "peerDependenciesMeta": { + "react-dom": { + "optional": true + } + } + }, + "node_modules/@expo/modules-macros-linux-arm64": { + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/@expo/modules-macros-linux-arm64/-/modules-macros-linux-arm64-0.33.0.tgz", + "integrity": "sha512-5F4L/IJThOBq3oRo9NB5BI4+Od8K2YDTbU+2IHgsnXsrTc5icQtOlLwHOEfExghjo0PHCXGap4zprfOKvtANxw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@expo/modules-macros-linux-x64": { + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/@expo/modules-macros-linux-x64/-/modules-macros-linux-x64-0.33.0.tgz", + "integrity": "sha512-G3kxfmMpH7BDtoeBVeJA4vh5O3kQ3wmjmSfDremRBWENHKwHJXTOsyerLQqkJC39oPKCuXgXhzvp+/5qy+DyvA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@expo/modules-macros-win32-arm64": { + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/@expo/modules-macros-win32-arm64/-/modules-macros-win32-arm64-0.33.0.tgz", + "integrity": "sha512-sAYEhKqywo+38UcWt1KLNzJkSkpba4HYybSSZfpFsoA28/MCBupFZggkbU/E9z81fZeuiWVA2Ote1fp8ogqRAA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@expo/modules-macros-win32-x64": { + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/@expo/modules-macros-win32-x64/-/modules-macros-win32-x64-0.33.0.tgz", + "integrity": "sha512-O7tmET8ehVpmocxpVUlXkV9yfKCNo3uKvpN7wNyWcJlEIM6xo+WZuN4RDtndExI6CE5wn8Io608US+BYtrE9+w==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@expo/osascript": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/@expo/osascript/-/osascript-2.8.1.tgz", + "integrity": "sha512-SCi+6q6uOkGhiAn6AIP/OPFgaIq/iKD2oYpnAOg2rShHStJ8ey7wyT127RbOaZXmlcY/62rHOX1WiiMnD8u/BA==", + "license": "MIT", + "dependencies": { + "@expo/spawn-async": "^1.8.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@expo/package-manager": { + "version": "1.14.2", + "resolved": "https://registry.npmjs.org/@expo/package-manager/-/package-manager-1.14.2.tgz", + "integrity": "sha512-sftl0eRVVCarI6grMdjAB3jX2pX1Mt3cdSnajlXS4QyeDkaKRM/ntBy6dcagj1VL0+cEfEqctlyvinmlZdNubg==", + "license": "MIT", + "dependencies": { + "@expo/json-file": "^11.2.1", + "@expo/spawn-async": "^1.8.0", + "chalk": "^4.0.0", + "npm-package-arg": "^11.0.0", + "ora": "^3.4.0", + "resolve-workspace-root": "^2.0.0" + } + }, + "node_modules/@expo/platforms": { + "version": "58.0.1", + "resolved": "https://registry.npmjs.org/@expo/platforms/-/platforms-58.0.1.tgz", + "integrity": "sha512-KtLrtAvpShq16l9lTxd2fZSjULxcGxXrJTHA31iUVqrc+Af7aTAJW4ZB3yQBgi/w+kSb6BB/CG9RXI0ohbMm6g==", + "license": "MIT" + }, + "node_modules/@expo/plist": { + "version": "0.10.2", + "resolved": "https://registry.npmjs.org/@expo/plist/-/plist-0.10.2.tgz", + "integrity": "sha512-kaCDdGLtezkt5s1w7iCaISNJ+RkNac/1yBYYE8XyXLSJu3czGHZKzJGQ8fFOrpEGm6GdlIHFpzVeiF01ZVyHyg==", + "license": "MIT", + "dependencies": { + "@xmldom/xmldom": "^0.8.8", + "xmlbuilder": "^15.1.1" + } + }, + "node_modules/@expo/prebuild-config": { + "version": "58.0.20", + "resolved": "https://registry.npmjs.org/@expo/prebuild-config/-/prebuild-config-58.0.20.tgz", + "integrity": "sha512-lqXK5d6ni2MCNO/MbuXhojKC+Iy/gaYm0a3vVebwf/njoe1Fp3iw8mXDwoofmvlzZ3HO+beL7XCX6e6ZEYmVyg==", + "license": "MIT", + "dependencies": { + "@expo/config": "~58.0.12", + "@expo/config-plugins": "~58.0.13", + "@expo/config-types": "^58.0.3", + "@expo/image-utils": "^0.12.7", + "@expo/json-file": "^11.2.1", + "@react-native/normalize-colors": "0.88.1", + "debug": "^4.3.1", + "expo-modules-autolinking": "~58.1.0", + "resolve-from": "^5.0.0", + "semver": "^7.7.4" + } + }, + "node_modules/@expo/require-utils": { + "version": "58.0.6", + "resolved": "https://registry.npmjs.org/@expo/require-utils/-/require-utils-58.0.6.tgz", + "integrity": "sha512-k9Ce7indjY3+nRBNT6wKw7NghN7pP6WhFnYNjuDiAypwjtVgaZHpD9fo0/g3/emDUpM6ebl8Ekz/teyUGfD9og==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.20.0", + "@babel/core": "^7.25.2", + "@babel/plugin-transform-modules-commonjs": "^7.24.8" + }, + "peerDependencies": { + "typescript": "^5.0.0 || ^5.0.0-0 || ^6.0.0 || ^7.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@expo/schema-utils": { + "version": "58.0.3", + "resolved": "https://registry.npmjs.org/@expo/schema-utils/-/schema-utils-58.0.3.tgz", + "integrity": "sha512-DwoMEpT3H+r1lU+YUEP10UcUW7sDKmfvgE7oA+zQeuGyi0XxDSDgRZUUZ5nOGp+lymmTicoIUKkoN7rByuI04g==", + "license": "MIT" + }, + "node_modules/@expo/sdk-runtime-versions": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@expo/sdk-runtime-versions/-/sdk-runtime-versions-1.0.1.tgz", + "integrity": "sha512-kvisefkhxu8Fm/4M8G6DEqUaigrXfrSOm2lFw7hsk/nq0zchcp6B4wSk8rlheHY8FRi5iHxKtoVMGY/3M6h04A==", + "license": "MIT" + }, + "node_modules/@expo/spawn-async": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@expo/spawn-async/-/spawn-async-1.8.0.tgz", + "integrity": "sha512-eb9xxd/LbuEGSdua4NumCu/McVB9EM+F/JxB9pWgnERw4HQ9XyTNH1KapG6oqLWR8TuRK2LQfzJlmNi94CVobw==", + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.6" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@expo/sudo-prompt": { + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/@expo/sudo-prompt/-/sudo-prompt-9.3.2.tgz", + "integrity": "sha512-HHQigo3rQWKMDzYDLkubN5WQOYXJJE2eNqIQC2axC2iO3mHdwnIR7FgZVvHWtBwAdzBgAP0ECp8KqS8TiMKvgw==", + "license": "MIT" + }, + "node_modules/@expo/xcpretty": { + "version": "4.4.7", + "resolved": "https://registry.npmjs.org/@expo/xcpretty/-/xcpretty-4.4.7.tgz", + "integrity": "sha512-EbxYllZ7/ozONVZd425cm4XnolfW+AmSFT5aP7Jdno6oc3WrYQcHz2CO20z/2rwWwYgztmV2PXvYH+BQ8YFjqg==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.20.0", + "chalk": "^4.1.0", + "js-yaml": "^4.1.0" + }, + "bin": { + "excpretty": "build/cli.js" + } + }, + "node_modules/@isaacs/ttlcache": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/@isaacs/ttlcache/-/ttlcache-1.4.1.tgz", + "integrity": "sha512-RQgQ4uQ+pLbqXfOmieB91ejmLwvSgv9nLx6sT6sD83s7umBypgg+OIBOBbEUiJXrfpnp9j0mRhYYdzp9uqq3lA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "license": "MIT", + "dependencies": { + "@sinclair/typebox": "^0.27.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/types": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^17.0.8", + "chalk": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.3.tgz", + "integrity": "sha512-lhTtjtoEArWBjismtfS761S9Hlyn+nIZqOZVYoZ1Xn82PMNMVnk+jj/NhC4fAXGTs7ydONcJiR5vyQBTMDu27g==", + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/source-map": { + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.11.tgz", + "integrity": "sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==", + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@noxcturnal/noxcturnal-darwin-arm64": { + "version": "0.1.14", + "resolved": "https://registry.npmjs.org/@noxcturnal/noxcturnal-darwin-arm64/-/noxcturnal-darwin-arm64-0.1.14.tgz", + "integrity": "sha512-5g1fvtfmDsaDzNoqZicO7UKUUaGm9HOTJy30KNxXbSJRreLOQwK0fd0wuAA0OEbBgJSQAvVdAovpjT5HvYRIWw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@noxcturnal/noxcturnal-darwin-x64": { + "version": "0.1.14", + "resolved": "https://registry.npmjs.org/@noxcturnal/noxcturnal-darwin-x64/-/noxcturnal-darwin-x64-0.1.14.tgz", + "integrity": "sha512-rnZ8LRa+rYOyHmPS2PpPgxRHaeU0zJZ7Ii8huuAMbADfJHGceGBU8SQYqd7+Vs1VwSUcxRm4BMC4+QL1IgdqrA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@noxcturnal/noxcturnal-linux-arm64-gnu": { + "version": "0.1.14", + "resolved": "https://registry.npmjs.org/@noxcturnal/noxcturnal-linux-arm64-gnu/-/noxcturnal-linux-arm64-gnu-0.1.14.tgz", + "integrity": "sha512-9SZoiNaEKwFJ0V7cgpoCjHLh80fd8/wAJrbG1VWR8DJfkbVBvXhipTnxEISZ0LdidmthpVo0i2GiI6ToUdkmkg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@noxcturnal/noxcturnal-linux-arm64-musl": { + "version": "0.1.14", + "resolved": "https://registry.npmjs.org/@noxcturnal/noxcturnal-linux-arm64-musl/-/noxcturnal-linux-arm64-musl-0.1.14.tgz", + "integrity": "sha512-dxZXo7Xj00w8eeFac+ev/75lJd/62GSUIX4wwCN2yYn6r9Jrim3DJ6yKVZwmfqHDE0v55TZsif0/vdhNFxFXfQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@noxcturnal/noxcturnal-linux-x64-gnu": { + "version": "0.1.14", + "resolved": "https://registry.npmjs.org/@noxcturnal/noxcturnal-linux-x64-gnu/-/noxcturnal-linux-x64-gnu-0.1.14.tgz", + "integrity": "sha512-ek3098/TS+Ma2vJUjzpIZnhU70lryFzFPEdKdQ5u+1w00QKvMg0teFa2mec1H8/ndK74/xYWy8e4d92Uz+s9Dg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@noxcturnal/noxcturnal-linux-x64-musl": { + "version": "0.1.14", + "resolved": "https://registry.npmjs.org/@noxcturnal/noxcturnal-linux-x64-musl/-/noxcturnal-linux-x64-musl-0.1.14.tgz", + "integrity": "sha512-qblXyvGhD5HoJSK32Q8YN6PnEz4GPXgr2KLgStpRG1oG8+BRPlrqZCaQRbQI5Bn3L8NZ+OjyGWhLEG1kgdzHBw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@noxcturnal/noxcturnal-win32-arm64-msvc": { + "version": "0.1.14", + "resolved": "https://registry.npmjs.org/@noxcturnal/noxcturnal-win32-arm64-msvc/-/noxcturnal-win32-arm64-msvc-0.1.14.tgz", + "integrity": "sha512-K9Q82l32juE/p7Ca6p36rAWfNzORkCyoL0R2aDUq3tkYOmivu3xTewnxUwDLTzDIuLsMgb4niy5vrtr4IXdNXw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@noxcturnal/noxcturnal-win32-x64-msvc": { + "version": "0.1.14", + "resolved": "https://registry.npmjs.org/@noxcturnal/noxcturnal-win32-x64-msvc/-/noxcturnal-win32-x64-msvc-0.1.14.tgz", + "integrity": "sha512-qiiOLLQUYnLZai3traWx90yzMLGZlkvwGNYMFkGw5MwnMifVgfl3Z3ooFiSYaVKjkTYqxBF9rOCvhFL6yXaoxA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@oxc-project/types": { + "version": "0.154.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.154.0.tgz", + "integrity": "sha512-KYOUGQFlLWR+s4QMV2Q9ko38TZm7EdO87Qm7rvZLqk/webse/cDjtyxKhg/47l0byCbs/k46LT8qc4PKjAikzA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/oxc-project" + } + }, + "node_modules/@react-native-async-storage/async-storage": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@react-native-async-storage/async-storage/-/async-storage-2.2.0.tgz", + "integrity": "sha512-gvRvjR5JAaUZF8tv2Kcq/Gbt3JHwbKFYfmb445rhOj6NUMx3qPLixmDx5pZAyb9at1bYvJ4/eTUipU5aki45xw==", + "license": "MIT", + "dependencies": { + "merge-options": "^3.0.4" + }, + "peerDependencies": { + "react-native": "^0.0.0-0 || >=0.65 <1.0" + } + }, + "node_modules/@react-native/asset-utils": { + "version": "0.88.1", + "resolved": "https://registry.npmjs.org/@react-native/asset-utils/-/asset-utils-0.88.1.tgz", + "integrity": "sha512-BLb5FF7NgggGYiCsA7KKkK2qFhn0K+6iGXOI+4Ucd+G7Robzw9Gt4WsWwxLt+Od+G+/hyqfz8ASokyWFZ6VcLw==", + "license": "MIT", + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/@react-native/babel-plugin-codegen": { + "version": "0.88.1", + "resolved": "https://registry.npmjs.org/@react-native/babel-plugin-codegen/-/babel-plugin-codegen-0.88.1.tgz", + "integrity": "sha512-2r7aeE3dXu3hawHNYHgazWQl9MJNjcnA/gxLApFK2gPMxBCLiQOHVUSaemDQz4mKPs5svulbhtDehxo6LzTzpQ==", + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.29.0", + "@react-native/codegen": "0.88.1" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/@react-native/babel-preset": { + "version": "0.88.1", + "resolved": "https://registry.npmjs.org/@react-native/babel-preset/-/babel-preset-0.88.1.tgz", + "integrity": "sha512-tnacL6tECmtFyBf59tI1GuadSvpm/XCcRQ1vMkL3qoQECpgMVdCfhw79A6l7iZdKM78TcZ0xKV98kZlERydwCg==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/core": "^7.25.2", + "@babel/plugin-proposal-export-default-from": "^7.24.7", + "@babel/plugin-syntax-dynamic-import": "^7.8.3", + "@babel/plugin-syntax-export-default-from": "^7.24.7", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-transform-async-generator-functions": "^7.25.4", + "@babel/plugin-transform-async-to-generator": "^7.24.7", + "@babel/plugin-transform-block-scoping": "^7.25.0", + "@babel/plugin-transform-class-properties": "^7.25.4", + "@babel/plugin-transform-classes": "^7.25.4", + "@babel/plugin-transform-destructuring": "^7.24.8", + "@babel/plugin-transform-flow-strip-types": "^7.25.2", + "@babel/plugin-transform-for-of": "^7.24.7", + "@babel/plugin-transform-modules-commonjs": "^7.24.8", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.24.7", + "@babel/plugin-transform-nullish-coalescing-operator": "^7.24.7", + "@babel/plugin-transform-optional-catch-binding": "^7.24.7", + "@babel/plugin-transform-optional-chaining": "^7.24.8", + "@babel/plugin-transform-private-methods": "^7.24.7", + "@babel/plugin-transform-private-property-in-object": "^7.24.7", + "@babel/plugin-transform-react-display-name": "^7.24.7", + "@babel/plugin-transform-react-jsx": "^7.25.2", + "@babel/plugin-transform-react-jsx-self": "^7.24.7", + "@babel/plugin-transform-react-jsx-source": "^7.24.7", + "@babel/plugin-transform-regenerator": "^7.24.7", + "@babel/plugin-transform-runtime": "^7.24.7", + "@babel/plugin-transform-typescript": "^7.25.2", + "@babel/plugin-transform-unicode-regex": "^7.24.7", + "@react-native/babel-plugin-codegen": "0.88.1", + "babel-plugin-transform-flow-enums": "^0.0.2", + "flow-parser": "0.327.0", + "react-refresh": "^0.14.0" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + }, + "peerDependencies": { + "@babel/core": "*" + } + }, + "node_modules/@react-native/babel-preset/node_modules/flow-estree": { + "version": "0.327.0", + "resolved": "https://registry.npmjs.org/flow-estree/-/flow-estree-0.327.0.tgz", + "integrity": "sha512-f9vK751YUzD0qaHSpKc5/qQM6gqOlgGS+4ZRqTNcZOpVqn3mC55yEQ6dUG2K1eaVm5FbKkz9CFWe6XNvrkQFQg==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/@react-native/babel-preset/node_modules/flow-parser": { + "version": "0.327.0", + "resolved": "https://registry.npmjs.org/flow-parser/-/flow-parser-0.327.0.tgz", + "integrity": "sha512-/MYZ5hXWf5ozpbdfUDmazMgQXviLxWEiRLH3MppEGDdW0itRVqmB5UaU7QX+SBCDNiq+gEesSVn8nlxmPDyDkw==", + "license": "MIT", + "peer": true, + "dependencies": { + "flow-estree": "0.327.0" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/@react-native/codegen": { + "version": "0.88.1", + "resolved": "https://registry.npmjs.org/@react-native/codegen/-/codegen-0.88.1.tgz", + "integrity": "sha512-URPgPhnsxqeQSLyTRVzhZZ8iNXtZdR1Jop6lqaQacymvl3byghXisNIRR1YyG6PbXUfzPan5Jmz/kPhUUsZ2Yw==", + "license": "MIT", + "dependencies": { + "@babel/core": "^7.25.2", + "@babel/parser": "^7.29.0", + "flow-parser": "0.327.0", + "invariant": "^2.2.4", + "nullthrows": "^1.1.1", + "tinyglobby": "^0.2.15", + "yargs": "^17.6.2" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + }, + "peerDependencies": { + "@babel/core": "*" + } + }, + "node_modules/@react-native/codegen/node_modules/flow-estree": { + "version": "0.327.0", + "resolved": "https://registry.npmjs.org/flow-estree/-/flow-estree-0.327.0.tgz", + "integrity": "sha512-f9vK751YUzD0qaHSpKc5/qQM6gqOlgGS+4ZRqTNcZOpVqn3mC55yEQ6dUG2K1eaVm5FbKkz9CFWe6XNvrkQFQg==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@react-native/codegen/node_modules/flow-parser": { + "version": "0.327.0", + "resolved": "https://registry.npmjs.org/flow-parser/-/flow-parser-0.327.0.tgz", + "integrity": "sha512-/MYZ5hXWf5ozpbdfUDmazMgQXviLxWEiRLH3MppEGDdW0itRVqmB5UaU7QX+SBCDNiq+gEesSVn8nlxmPDyDkw==", + "license": "MIT", + "dependencies": { + "flow-estree": "0.327.0" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/@react-native/community-cli-plugin": { + "version": "0.88.1", + "resolved": "https://registry.npmjs.org/@react-native/community-cli-plugin/-/community-cli-plugin-0.88.1.tgz", + "integrity": "sha512-L2CQvzsOMz4oof6AVLSzesFL1Q92nrtXpK0uQH2VwdOmzzgkiHql8WFQSo9VLvMFGJDg8+G6enrHH573ruqqWA==", + "license": "MIT", + "dependencies": { + "@react-native/asset-utils": "0.88.1", + "@react-native/dev-middleware": "0.88.1", + "commander": "^12.0.0", + "debug": "^4.4.0", + "invariant": "^2.2.4", + "metro": "^0.87.1", + "semver": "^7.1.3" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + }, + "peerDependencies": { + "@react-native-community/cli": "*", + "@react-native/metro-config": "0.88.1" + }, + "peerDependenciesMeta": { + "@react-native-community/cli": { + "optional": true + }, + "@react-native/metro-config": { + "optional": true + } + } + }, + "node_modules/@react-native/community-cli-plugin/node_modules/commander": { + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", + "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@react-native/debugger-frontend": { + "version": "0.88.1", + "resolved": "https://registry.npmjs.org/@react-native/debugger-frontend/-/debugger-frontend-0.88.1.tgz", + "integrity": "sha512-4ZjH2093hZWWgsYs5ExqjzJX5uCS4R5yZa17eRHsQClUc6RjlV61kLdIk722sQReLL+NYtBn2RJtdcQtLCwiug==", + "license": "BSD-3-Clause", + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/@react-native/debugger-shell": { + "version": "0.88.1", + "resolved": "https://registry.npmjs.org/@react-native/debugger-shell/-/debugger-shell-0.88.1.tgz", + "integrity": "sha512-vrOLlxkp/417qcSUiS3x3gmdoQHYA/26oEKIWPB4EekJG0uJxKXsMR0tHIDiJWO0JH/2BO3M+507DjR1U74jQg==", + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.6", + "debug": "^4.4.0", + "fb-dotslash": "0.5.8" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/@react-native/dev-middleware": { + "version": "0.88.1", + "resolved": "https://registry.npmjs.org/@react-native/dev-middleware/-/dev-middleware-0.88.1.tgz", + "integrity": "sha512-0smOWE3NCdEYUwPiEdiwVXjTdvXcwSejviCM0YZB0Dj6HaQ+uu4hpSrvgERDevr5dvtSaqr8N4TdYZCLXiVgFw==", + "license": "MIT", + "dependencies": { + "@isaacs/ttlcache": "^1.4.1", + "@react-native/debugger-frontend": "0.88.1", + "@react-native/debugger-shell": "0.88.1", + "connect": "^3.6.5", + "debug": "^4.4.0", + "invariant": "^2.2.4", + "nullthrows": "^1.1.1", + "open": "^8.4.2", + "serve-static": "^1.16.2", + "ws": "^7.5.10" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/@react-native/gradle-plugin": { + "version": "0.88.1", + "resolved": "https://registry.npmjs.org/@react-native/gradle-plugin/-/gradle-plugin-0.88.1.tgz", + "integrity": "sha512-zalxoJJ/m5kxLnBy9I1zYrx4jaPxPXdys8DeROvrSOa3pSQkTwVVXRZ4FkXCdGodVA9KR2WitplDo/URNjyvFA==", + "license": "MIT", + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/@react-native/js-polyfills": { + "version": "0.88.1", + "resolved": "https://registry.npmjs.org/@react-native/js-polyfills/-/js-polyfills-0.88.1.tgz", + "integrity": "sha512-B62O6zVMYW7kK8dxIuCwpdJ5RYcIvET6ItScm0sfsTibJs+llS0krUVSAOHnEUn3lbFMfw+o+sNdWREOAc6FfQ==", + "license": "MIT", + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/@react-native/metro-babel-transformer": { + "version": "0.88.1", + "resolved": "https://registry.npmjs.org/@react-native/metro-babel-transformer/-/metro-babel-transformer-0.88.1.tgz", + "integrity": "sha512-74bvSM4lVZcv+M777/uYW2Nzs6Ga5/F0Ncn9dmeXyUPFMkJO3Ys5v9YlhI//AQ2+0nxojYYFVS/rlAjOkVjtHA==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/core": "^7.25.2", + "@react-native/babel-preset": "0.88.1", + "flow-parser": "0.327.0", + "nullthrows": "^1.1.1" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + }, + "peerDependencies": { + "@babel/core": "*" + } + }, + "node_modules/@react-native/metro-babel-transformer/node_modules/flow-estree": { + "version": "0.327.0", + "resolved": "https://registry.npmjs.org/flow-estree/-/flow-estree-0.327.0.tgz", + "integrity": "sha512-f9vK751YUzD0qaHSpKc5/qQM6gqOlgGS+4ZRqTNcZOpVqn3mC55yEQ6dUG2K1eaVm5FbKkz9CFWe6XNvrkQFQg==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/@react-native/metro-babel-transformer/node_modules/flow-parser": { + "version": "0.327.0", + "resolved": "https://registry.npmjs.org/flow-parser/-/flow-parser-0.327.0.tgz", + "integrity": "sha512-/MYZ5hXWf5ozpbdfUDmazMgQXviLxWEiRLH3MppEGDdW0itRVqmB5UaU7QX+SBCDNiq+gEesSVn8nlxmPDyDkw==", + "license": "MIT", + "peer": true, + "dependencies": { + "flow-estree": "0.327.0" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/@react-native/metro-config": { + "version": "0.88.1", + "resolved": "https://registry.npmjs.org/@react-native/metro-config/-/metro-config-0.88.1.tgz", + "integrity": "sha512-Q0rKoC55HSOIc4j55lCOHpjIt/JkGQ66u2KsorfTC99LaRIez9UYJ/mhMwhjkZqGHq5Z4iBT6PCd4eQf35zdgQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "@react-native/js-polyfills": "0.88.1", + "@react-native/metro-babel-transformer": "0.88.1", + "metro-config": "^0.87.1", + "metro-runtime": "^0.87.1" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/@react-native/normalize-colors": { + "version": "0.88.1", + "resolved": "https://registry.npmjs.org/@react-native/normalize-colors/-/normalize-colors-0.88.1.tgz", + "integrity": "sha512-2SAKiLyZRf+peBLkhhJWGY5vC26w1Uj9QBgUZvjAnOxjgeEKUGBE5riPS0R7+YoqSrRL0w8ucwZB4M+vvy9HMg==", + "license": "MIT" + }, + "node_modules/@react-native/virtualized-lists": { + "version": "0.88.1", + "resolved": "https://registry.npmjs.org/@react-native/virtualized-lists/-/virtualized-lists-0.88.1.tgz", + "integrity": "sha512-Zt+OGvJE6VgmzgemZL8TSA0VomNWpHMNcG0OvLkkBQEGrzY8OdDHRfjJh7S+f+UFJF77kicRC6o6mt3A7ER9lQ==", + "license": "MIT", + "dependencies": { + "invariant": "^2.2.4", + "nullthrows": "^1.1.1" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + }, + "peerDependencies": { + "@types/react": "^19.2.0", + "react": "*", + "react-native": "0.88.1" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@sinclair/typebox": { + "version": "0.27.12", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.12.tgz", + "integrity": "sha512-hhyNJ+nbR6ZR7pToHvllEFun9TL0sbL+tk/ON75lo+Xas054uez98qRbsuNt7MBCyZKK4+8Yli/OAGZhmfBZ/g==", + "license": "MIT" + }, + "node_modules/@types/emscripten": { + "version": "1.41.6", + "resolved": "https://registry.npmjs.org/@types/emscripten/-/emscripten-1.41.6.tgz", + "integrity": "sha512-uN+9i8bFT5CUcZfyIEYDrSueACEyKGbUs5kC/72DGlZZoinh84sJfVV0i8UOJD1asdzkvLPBRrKs41kZ8MdEXg==", + "license": "MIT" + }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", + "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", + "license": "MIT" + }, + "node_modules/@types/istanbul-lib-report": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", + "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", + "license": "MIT", + "dependencies": { + "@types/istanbul-lib-coverage": "*" + } + }, + "node_modules/@types/istanbul-reports": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", + "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", + "license": "MIT", + "dependencies": { + "@types/istanbul-lib-report": "*" + } + }, + "node_modules/@types/node": { + "version": "26.6.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.10.tgz", + "integrity": "sha512-WJuPHoGB8WNQuTksNF7SOQpnH02PXeDYz4iueWbBT6/hTWnShY5F3T/hoJA3fY9+uYReDZ7pyTKKx83jQa7aGg==", + "license": "MIT", + "dependencies": { + "undici-types": "~8.9.0" + } + }, + "node_modules/@types/react": { + "version": "19.3.3", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.3.3.tgz", + "integrity": "sha512-K8uWpJc4teiuOPdiP1umjeA9rGMgVPiXuoL66fcS1QlwBT1WMqY8PORmub9FadopIs+RCW6siYEs7Lpq+vDlog==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "csstype": "^3.2.2" + } + }, + "node_modules/@types/yargs": { + "version": "17.0.35", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.35.tgz", + "integrity": "sha512-qUHkeCyQFxMXg79wQfTtfndEC+N9ZZg76HJftDJp+qH2tV7Gj4OJi7l+PiWwJ+pWtW8GwSmqsDj/oymhrTWXjg==", + "license": "MIT", + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/@types/yargs-parser": { + "version": "21.0.3", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", + "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", + "license": "MIT" + }, + "node_modules/@ungap/structured-clone": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.4.0.tgz", + "integrity": "sha512-1mEZtMKPM09vDmQt5y7YvmN2+DFTP7Tg0EWXdic8/C6VRnpb33e4ghisCIE3WZjsE2N8mf+QV1Zqh7ZFYLWInQ==", + "license": "ISC" + }, + "node_modules/@xmldom/xmldom": { + "version": "0.8.15", + "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.15.tgz", + "integrity": "sha512-/5NV/vDALVFDXgLmfsy9TRCBlKwO2LNBFzpzvb9iIj+jR+eSc6DLYYvVOdivT/jm7MtU6TebYuRmzEOI7w40UA==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/2g": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/2g/-/2g-1.0.1.tgz", + "integrity": "sha512-+uViadKOS/wwR4pFu5g8TPn3QHpKqoX19JHCnp8k/3cLpImdcXozwvZA6Q/5PeW3AcU8neL8faaMidBcv7o8CA==", + "license": "MIT", + "bin": { + "2g": "bin/cli.js" + }, + "peerDependencies": { + "typescript": ">=5.8.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/accepts": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", + "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", + "license": "MIT", + "dependencies": { + "mime-types": "^3.0.0", + "negotiator": "^1.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/acorn": { + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.19.0.tgz", + "integrity": "sha512-oJlA3XiRm7Cyk6qFD2Jn8ak9B7jSy0qy00ADO3+8dpT0LSjFihQYv4C02LFCSYJV3Q37xYwwRy5m+IpIiUzqWw==", + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/agent-cli-detector": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/agent-cli-detector/-/agent-cli-detector-0.1.7.tgz", + "integrity": "sha512-d8OWDVdZMgjhLUT9ZPgSv/BdFFF9pVuscC0JdUSz3bjwE15gcp6u/o0/JooM2yyAWC49KThFhXlgTXRa9B7yng==", + "license": "MIT", + "bin": { + "agent-cli-detector": "dist/cli.js" + }, + "engines": { + "node": ">=18.18" + } + }, + "node_modules/anser": { + "version": "1.4.10", + "resolved": "https://registry.npmjs.org/anser/-/anser-1.4.10.tgz", + "integrity": "sha512-hCv9AqTQ8ycjpSd3upOJd7vFwW1JaoYQ7tpham03GJ1ca8/65rqn0RpaWpItOAd6ylW9wAw6luXYPJIyPFVOww==", + "license": "MIT" + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "license": "MIT", + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-escapes/node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/arg": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", + "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==", + "license": "MIT" + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "license": "Python-2.0" + }, + "node_modules/asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==", + "license": "MIT" + }, + "node_modules/babel-plugin-polyfill-corejs2": { + "version": "0.4.17", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.17.tgz", + "integrity": "sha512-aTyf30K/rqAsNwN76zYrdtx8obu0E4KoUME29B1xj+B3WxgvWkp943vYQ+z8Mv3lw9xHXMHpvSPOBxzAkIa94w==", + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.28.6", + "@babel/helper-define-polyfill-provider": "^0.6.8", + "semver": "^6.3.1" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/babel-plugin-polyfill-corejs2/node_modules/semver": { + "version": "6.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.2.tgz", + "integrity": "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/babel-plugin-polyfill-corejs3": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.13.0.tgz", + "integrity": "sha512-U+GNwMdSFgzVmfhNm8GJUX88AadB3uo9KpJqS3FaqNIPKgySuvMb+bHPsOmmuWyIcuqZj/pzt1RUIUZns4y2+A==", + "license": "MIT", + "dependencies": { + "@babel/helper-define-polyfill-provider": "^0.6.5", + "core-js-compat": "^3.43.0" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/babel-plugin-polyfill-regenerator": { + "version": "0.6.8", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.6.8.tgz", + "integrity": "sha512-M762rNHfSF1EV3SLtnCJXFoQbbIIz0OyRwnCmV0KPC7qosSfCO0QLTSuJX3ayAebubhE6oYBAYPrBA5ljowaZg==", + "license": "MIT", + "dependencies": { + "@babel/helper-define-polyfill-provider": "^0.6.8" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/babel-plugin-react-compiler": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/babel-plugin-react-compiler/-/babel-plugin-react-compiler-1.0.0.tgz", + "integrity": "sha512-Ixm8tFfoKKIPYdCCKYTsqv+Fd4IJ0DQqMyEimo+pxUOMUR9cVPlwTrFt9Avu+3cb6Zp3mAzl+t1MrG2fxxKsxw==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.26.0" + } + }, + "node_modules/babel-plugin-react-native-web": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/babel-plugin-react-native-web/-/babel-plugin-react-native-web-0.21.4.tgz", + "integrity": "sha512-FSclsDTGi5EcvpbW3TM7s8GLWwQqo5wI9zQqJr2m0IoJRenSkp1+bVvdeZXTNznI5Ms9Bry7DLBR+C5Shb9gtw==", + "license": "MIT" + }, + "node_modules/babel-plugin-syntax-hermes-parser": { + "version": "0.36.1", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-hermes-parser/-/babel-plugin-syntax-hermes-parser-0.36.1.tgz", + "integrity": "sha512-ycduwJbvdvIMmVvlAZqGggS+pm5Eu4Bk9pcV9Sm2Z4PJNRVsKkv0g7vHj+LeuC1gHTeF67sJXFOq61IlqCa2hA==", + "license": "MIT", + "dependencies": { + "hermes-parser": "0.36.1" + } + }, + "node_modules/babel-plugin-transform-flow-enums": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-flow-enums/-/babel-plugin-transform-flow-enums-0.0.2.tgz", + "integrity": "sha512-g4aaCrDDOsWjbm0PUUeVnkcVd6AKJsVc/MbnPhEotEpkeJQP6b8nzewohQi7+QS8UyPehOhGWn0nOwjvWpmMvQ==", + "license": "MIT", + "dependencies": { + "@babel/plugin-syntax-flow": "^7.12.1" + } + }, + "node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/barcode-detector": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/barcode-detector/-/barcode-detector-3.2.5.tgz", + "integrity": "sha512-TuJdsjU5U+b8+O5G1/ZgR8VeLHd1T/5GpjPDJLoafNZYuf438vVP6jriuvR1S9PWVbR2ZoOKleKEzG5ltdaM5g==", + "license": "MIT", + "dependencies": { + "zxing-wasm": "3.1.8" + } + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/baseline-browser-mapping": { + "version": "2.11.39", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.39.tgz", + "integrity": "sha512-Q9buOYhr2ggrEZpImICecZTJHCCd8yXkRUokFlUEQ8uiD6oP82F4W4jWnhOHZYV+wlvrC51V7Wy0ULyWjil5Wg==", + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.cjs" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/big-integer": { + "version": "1.6.52", + "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.52.tgz", + "integrity": "sha512-QxD8cf2eVqJOOz63z6JIN9BzvVs/dlySa5HGSBH5xtR8dPteIRQnBxxKqkNTiT6jbDTF6jAfrd4oMcND9RGbQg==", + "license": "Unlicense", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", + "license": "ISC" + }, + "node_modules/bplist-creator": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/bplist-creator/-/bplist-creator-0.1.0.tgz", + "integrity": "sha512-sXaHZicyEEmY86WyueLTQesbeoH/mquvarJaQNbjuOQO+7gbFcDEWqKmcWA4cOTLzFlfgvkiVxolk1k5bBIpmg==", + "license": "MIT", + "dependencies": { + "stream-buffers": "2.2.x" + } + }, + "node_modules/bplist-parser": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.3.1.tgz", + "integrity": "sha512-PyJxiNtA5T2PlLIeBot4lbp7rj4OadzjnMZD/G5zuBNt8ei/yCU7+wW0h2bag9vr8c+/WuRWmSxbqAl9hL1rBA==", + "license": "MIT", + "dependencies": { + "big-integer": "1.6.x" + }, + "engines": { + "node": ">= 5.10.0" + } + }, + "node_modules/brace-expansion": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.1.0.tgz", + "integrity": "sha512-aa11Dv491GKnYqxaul3aRJ0szew7yMJMfZPnqD44NjGrZXoj62l41OEDDpdpC4eE2P88vBFfLuSyRhpG91NUvg==", + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.29.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.6.tgz", + "integrity": "sha512-CmVVIQ3RVc5HxYEc9X84GvxK/C8C1wH8TlKAiO7uTxF8PDwt7r8t9Qk3J9NkMOVzX5O/HbLv3yzxZg9HPrnI9w==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "baseline-browser-mapping": "^2.11.37", + "caniuse-lite": "^1.0.30001826", + "electron-to-chromium": "^1.5.486", + "node-releases": "^2.0.64", + "update-browserslist-db": "^1.4.0" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/bser": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.2.tgz", + "integrity": "sha512-V2o8YS2EhrKMO9AumnkK0ynynfFlsajpYupwq7S46H5mhcanwxDkNTw3K67wPIcKTH1ffkA4vhMOtAc7gRmPZw==", + "license": "MIT", + "dependencies": { + "node-int64": "^0.4.0" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "license": "MIT" + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001828", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001828.tgz", + "integrity": "sha512-7MWeT+3DlrpuDybTWHl4Zb1Z80Z1fLLnOXuBjDXebzDVcqnEWUlV8JcbASg8B8BhcW8QT2UiR1KAtzYFIZHZYA==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/ci-info": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw==", + "license": "MIT", + "dependencies": { + "restore-cursor": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/cli-spinners": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", + "license": "MIT", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT" + }, + "node_modules/commander": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", + "license": "MIT", + "engines": { + "node": ">= 10" + } + }, + "node_modules/compressible": { + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", + "integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==", + "license": "MIT", + "dependencies": { + "mime-db": ">= 1.43.0 < 2" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/compression": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/compression/-/compression-1.8.2.tgz", + "integrity": "sha512-o8vI5RE5A6EVVOd9o41jKp41aJom+QTEO/Bx8MYNjexMo/Bv2WOjUfZr+aL0WnYSgymUy6zeguqLTsIhV0gMvQ==", + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "compressible": "~2.0.18", + "debug": "2.6.9", + "destroy": "1.2.0", + "negotiator": "~0.6.4", + "on-headers": "~1.1.0", + "safe-buffer": "5.2.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.8.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/compression/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/compression/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/compression/node_modules/negotiator": { + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.4.tgz", + "integrity": "sha512-myRT3DiWPHqho5PrJaIRyaMv2kgYf0mUVgBNOYMuCH5Ki1yEiQaf/ZJuQ62nvpc44wL5WDbTX7yGJi1Neevw8w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/connect": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/connect/-/connect-3.7.0.tgz", + "integrity": "sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "finalhandler": "1.1.2", + "parseurl": "~1.3.3", + "utils-merge": "1.0.1" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/connect/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/connect/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/content-type": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.1.0.tgz", + "integrity": "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "license": "MIT" + }, + "node_modules/core-js-compat": { + "version": "3.51.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.51.0.tgz", + "integrity": "sha512-52r6fkXgxv4GLMjmFcMWRx7X9bw071xTTdrDcdyPGRqU2oE+9pCG0bAOMifSBdLw0JRBZKEF0q3B55qPlLuE8g==", + "license": "MIT", + "dependencies": { + "browserslist": "^4.29.3" + }, + "engines": { + "node": ">=6.4.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, + "node_modules/cross-fetch": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.2.0.tgz", + "integrity": "sha512-Q+xVJLoGOeIMXZmbUK4HYk+69cQH6LudR0Vu/pRm2YlU/hDV9CiS0gKUMaWY5f2NeUH9C1nV3bsTlCo0FsTV1Q==", + "license": "MIT", + "dependencies": { + "node-fetch": "^2.7.0" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/css-in-js-utils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/css-in-js-utils/-/css-in-js-utils-3.1.0.tgz", + "integrity": "sha512-fJAcud6B3rRu+KHYk+Bwf+WFL2MDCJJ1XG9x137tJQ0xYxor7XziQtuGFbWNdqrvF4Tk26O3H73nfVqXt/fW1A==", + "license": "MIT", + "dependencies": { + "hyphenate-style-name": "^1.0.3" + } + }, + "node_modules/css-select": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.2.2.tgz", + "integrity": "sha512-TizTzUddG/xYLA3NXodFM0fSbNizXjOKhqiQQwvhlspadZokn1KDy0NZFS0wuEubIYAV5/c1/lAr0TaaFXEXzw==", + "license": "BSD-2-Clause", + "dependencies": { + "boolbase": "^1.0.0", + "css-what": "^6.1.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "nth-check": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/css-tree": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz", + "integrity": "sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==", + "license": "MIT", + "dependencies": { + "mdn-data": "2.0.14", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/css-tree/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/css-what": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.2.2.tgz", + "integrity": "sha512-u/O3vwbptzhMs3L1fQE82ZSLHQQfto5gyZzwteVIEyeaY5Fc7R4dapF/BvRoSYFeqfBk4m0V1Vafq5Pjv25wvA==", + "license": "BSD-2-Clause", + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/csstype": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.4.tgz", + "integrity": "sha512-PoKaoPzQapnEoqUSnHx1u6W6ku8CVEgKsnpmmzU3m1nwkidpPBQ8V/Zq2+bWNrsOKoKLwTGdbx6xF7BXP1zLVQ==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/defaults": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", + "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", + "license": "MIT", + "dependencies": { + "clone": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/define-lazy-prop": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", + "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "license": "MIT", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/diff": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-9.0.0.tgz", + "integrity": "sha512-svtcdpS8CgJyqAjEQIXdb3OjhFVVYjzGAPO8WGCmRbrml64SPw/jJD4GoE98aR7r25A0XcgrK3F02yw9R/vhQw==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/dnssd-advertise": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/dnssd-advertise/-/dnssd-advertise-1.1.6.tgz", + "integrity": "sha512-Ndrrf6BMPalkQPd/zubL+4YghH2J9NspapQ09uDXwYbvOPkP0oaqf5CkcwJ0b50kS2O3ul6yVu+jz+RY62Cejg==", + "license": "MIT" + }, + "node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "license": "MIT", + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "license": "BSD-2-Clause" + }, + "node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "license": "BSD-2-Clause", + "dependencies": { + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/domutils": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.2.2.tgz", + "integrity": "sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw==", + "license": "BSD-2-Clause", + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/electron-to-chromium": { + "version": "1.5.494", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.494.tgz", + "integrity": "sha512-Tph7ohL4Xc0ft3DXElYEIVTmPI3H0MtPCTdgtz5AwWGZG6q+vMiT3IzJ3RJX/HJQ8pYzeimQyvi6SsBTOS0nyQ==", + "license": "ISC" + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.4.tgz", + "integrity": "sha512-ImAQpWtQZKdkUxvj9CMNzB8M4IGg0DkRTZzmOHqgVFrf71JDmUacbt+iKljfIpD2yHcxI+HR76d8bwvdvtSvGA==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/error-stack-parser": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/error-stack-parser/-/error-stack-parser-2.1.4.tgz", + "integrity": "sha512-Sk5V6wVazPhq5MhpO+AUxJn5x7XSXGl1R93Vn7i+zS15KDVxQijejNCrz8340/2bgLBjR9GtEG8ZVKONDjcqGQ==", + "license": "MIT", + "dependencies": { + "stackframe": "^1.3.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/expo": { + "version": "58.0.26", + "resolved": "https://registry.npmjs.org/expo/-/expo-58.0.26.tgz", + "integrity": "sha512-6i4kqt5lbcQdxmtnkkJ3JR5sn+A3L+xO45duLhh2rndvrek/chX/GTysTYozl4oL3+txKD53pDlJd75XRYf9Ow==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.20.0", + "@expo/cli": "^58.1.21", + "@expo/config": "~58.0.12", + "@expo/config-plugins": "~58.0.13", + "@expo/devtools": "~58.0.2", + "@expo/dom-webview": "~58.0.2", + "@expo/fingerprint": "^0.21.10", + "@expo/local-build-cache-provider": "^58.0.12", + "@expo/log-box": "^58.0.15", + "@expo/log-box-utils": "^58.0.2", + "@expo/metro": "~58.0.0", + "@expo/metro-config": "~58.0.23", + "@ungap/structured-clone": "^1.3.0", + "babel-preset-expo": "~58.0.26", + "expo-asset": "~58.0.21", + "expo-constants": "~58.0.16", + "expo-file-system": "~58.0.14", + "expo-font": "~58.0.12", + "expo-keep-awake": "~58.0.4", + "expo-modules-autolinking": "~58.1.0", + "expo-modules-cli": "~0.5.0", + "expo-modules-core": "~58.1.0", + "pretty-format": "^29.7.0", + "react-refresh": "^0.14.2", + "whatwg-url-minimum": "^0.2.0" + }, + "bin": { + "expo": "bin/cli", + "expo-modules": "bin/modules", + "expo-modules-autolinking": "bin/autolinking", + "fingerprint": "bin/fingerprint" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || ^26.0.0 || >=27.0.0" + }, + "peerDependencies": { + "@expo/dom-webview": "*", + "@expo/metro-runtime": "*", + "react": "*", + "react-dom": "*", + "react-native": "*", + "react-native-web": "*", + "react-native-webview": "*" + }, + "peerDependenciesMeta": { + "@expo/dom-webview": { + "optional": true + }, + "@expo/metro-runtime": { + "optional": true + }, + "react-dom": { + "optional": true + }, + "react-native-web": { + "optional": true + }, + "react-native-webview": { + "optional": true + } + } + }, + "node_modules/expo-camera": { + "version": "58.0.14", + "resolved": "https://registry.npmjs.org/expo-camera/-/expo-camera-58.0.14.tgz", + "integrity": "sha512-yEiMuJ2d7A+EqsP8rlGIvgaUzdk/rW9CXR6R7WKqludxU3H+JcSUbPC3ldr3ZpmaYlgXP3x+oOO9BfQy7yKK2A==", + "license": "MIT", + "dependencies": { + "barcode-detector": "^3.0.0" + }, + "peerDependencies": { + "expo": "*", + "react": "*", + "react-native": "*", + "react-native-web": "*" + }, + "peerDependenciesMeta": { + "react-native-web": { + "optional": true + } + } + }, + "node_modules/expo-clipboard": { + "version": "58.0.4", + "resolved": "https://registry.npmjs.org/expo-clipboard/-/expo-clipboard-58.0.4.tgz", + "integrity": "sha512-b2eEJMwdWXLTrmrkg/otsmL2OV6s9D90tytSNBsY87UswrWf6JwxcB2OaWegyUWD9XnvtBVNeVK7lej0zZh+5A==", + "license": "MIT", + "peerDependencies": { + "expo": "*", + "react": "*", + "react-native": "*" + } + }, + "node_modules/expo-modules-autolinking": { + "version": "58.1.0", + "resolved": "https://registry.npmjs.org/expo-modules-autolinking/-/expo-modules-autolinking-58.1.0.tgz", + "integrity": "sha512-JAegkS+nC4LVEgKMHAnpWhUxs1BYHHaTJnncVW2EQION1bVz0y8/wEglAeGV+oq4BNS1V7s8zCMTZU0hMi28bA==", + "license": "MIT", + "dependencies": { + "@expo/platforms": "^58.0.1", + "@expo/require-utils": "^58.0.6", + "@expo/spawn-async": "^1.8.0", + "chalk": "^4.1.0", + "commander": "^7.2.0" + }, + "bin": { + "expo-modules-autolinking": "bin/expo-modules-autolinking.js" + } + }, + "node_modules/expo-modules-cli": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/expo-modules-cli/-/expo-modules-cli-0.5.0.tgz", + "integrity": "sha512-uBNKkp5NIMo2bmJiQL36EBLNMeX+2GEIxpz10BioT0EGQTsPcgrV0ypfGy31GtPoFOObyc9ibHhklsOtpzhblw==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.20.0", + "arg": "^5.0.2" + }, + "bin": { + "expo-modules": "bin/expo-modules.js" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || ^26.0.0 || >=27.0.0" + } + }, + "node_modules/expo-modules-core": { + "version": "58.1.0", + "resolved": "https://registry.npmjs.org/expo-modules-core/-/expo-modules-core-58.1.0.tgz", + "integrity": "sha512-eXHOPyxHkDyTxUWnKEatC+Hx4tLoPWCPd5pCynAU4WkaBvAG/l5t/wu5jXiE5eh2CRr2NU4iAQePX2zUfNEVhA==", + "license": "MIT", + "dependencies": { + "expo-modules-jsi": "~58.0.23", + "expo-modules-macros": "0.33.0", + "invariant": "^2.2.4" + }, + "peerDependencies": { + "react": "*", + "react-native": "*", + "react-native-worklets": ">=0.13.0" + }, + "peerDependenciesMeta": { + "react-native-worklets": { + "optional": true + } + } + }, + "node_modules/expo-modules-jsi": { + "version": "58.0.23", + "resolved": "https://registry.npmjs.org/expo-modules-jsi/-/expo-modules-jsi-58.0.23.tgz", + "integrity": "sha512-ex3CnT8KLubsPjUG0RpEL5VgmpnWxf7Ouc+WXEr8jEbIwqcULEWtA2tfhGZwjg6jS3zeNwjygF1w8QSstP7JfQ==", + "license": "MIT", + "peerDependencies": { + "react-native": "*" + } + }, + "node_modules/expo-modules-macros": { + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/expo-modules-macros/-/expo-modules-macros-0.33.0.tgz", + "integrity": "sha512-ddrT2jbYPYmiHmzcYOixRemFUUK9qQEb5pOBWgoFoW0gj3sGld1CZX0GwblUXeZMyEX65S9vc1bEhIAGVDRA9w==", + "license": "MIT", + "optionalDependencies": { + "@expo/modules-macros-linux-arm64": "0.33.0", + "@expo/modules-macros-linux-x64": "0.33.0", + "@expo/modules-macros-win32-arm64": "0.33.0", + "@expo/modules-macros-win32-x64": "0.33.0" + } + }, + "node_modules/expo-secure-store": { + "version": "58.0.3", + "resolved": "https://registry.npmjs.org/expo-secure-store/-/expo-secure-store-58.0.3.tgz", + "integrity": "sha512-RpubZfqJREEcwKbx3HFoWbtDd31t+yESMj7Ei5/mGQp5vViwUBzL4nUCZRLFyt+O690mT8We7dDtIUZeIk6LbQ==", + "license": "MIT", + "peerDependencies": { + "expo": "*" + } + }, + "node_modules/expo-server": { + "version": "58.1.0", + "resolved": "https://registry.npmjs.org/expo-server/-/expo-server-58.1.0.tgz", + "integrity": "sha512-jo7I6uHnP5OQYKx3+7lbpdVVnOEwFj2ryDkQdauUQSwgh2HuMUkiFXWUIVe01ts6DLRoff5U0Tv+uNb3CMq/kw==", + "license": "MIT", + "engines": { + "node": "^22.13.0 || ^24.3.0 || ^26.0.0 || >=27.0.0" + } + }, + "node_modules/expo-status-bar": { + "version": "58.0.5", + "resolved": "https://registry.npmjs.org/expo-status-bar/-/expo-status-bar-58.0.5.tgz", + "integrity": "sha512-Lq1h7QpNY2FY7+Dyrn15atrFZs1Yd4IfMfhwyyWb3TqWc+vwtYZH54W9VhhjqXtgitXe+RVAX7YZoCekjbLmug==", + "license": "MIT", + "peerDependencies": { + "expo": "*", + "react": "*", + "react-native": "*" + } + }, + "node_modules/expo/node_modules/@expo/cli": { + "version": "58.1.21", + "resolved": "https://registry.npmjs.org/@expo/cli/-/cli-58.1.21.tgz", + "integrity": "sha512-E+27FQ1Y26fVb0p1wVHBFkbe5oQubUXLwF/au5Vy8OCqDWrmbekBQamRI4mBhY15FhZQxAkyK0e6hXcEFKVBOw==", + "license": "MIT", + "dependencies": { + "@expo/code-signing-certificates": "^0.0.7", + "@expo/config": "~58.0.12", + "@expo/config-plugins": "~58.0.13", + "@expo/devcert": "^1.2.2", + "@expo/env": "~2.6.0", + "@expo/image-utils": "^0.12.7", + "@expo/inline-modules": "^0.2.10", + "@expo/json-file": "^11.2.1", + "@expo/log-box": "^58.0.15", + "@expo/log-box-utils": "^58.0.2", + "@expo/metro": "~58.0.0", + "@expo/metro-config": "58.0.23", + "@expo/metro-file-map": "^58.0.6", + "@expo/osascript": "^2.8.1", + "@expo/package-manager": "^1.14.2", + "@expo/platforms": "^58.0.1", + "@expo/plist": "^0.10.2", + "@expo/prebuild-config": "^58.0.20", + "@expo/require-utils": "^58.0.6", + "@expo/router-server": "^58.0.23", + "@expo/schema-utils": "^58.0.3", + "@expo/spawn-async": "^1.8.0", + "@expo/ws-tunnel": "^2.0.1", + "@expo/xcpretty": "^4.4.6", + "@react-native/asset-utils": "0.88.1", + "@react-native/dev-middleware": "0.88.1", + "@react-native/js-polyfills": "0.88.1", + "2g": "^1.0.1", + "accepts": "^1.3.8", + "agent-cli-detector": "0.1.7", + "arg": "^5.0.2", + "bplist-creator": "0.1.0", + "bplist-parser": "^0.3.1", + "chalk": "^4.0.0", + "ci-info": "^3.3.0", + "compression": "^1.7.4", + "connect": "^3.7.0", + "dnssd-advertise": "^1.1.6", + "expo-server": "^58.1.0", + "fetch-nodeshim": "^0.4.10", + "lan-network": "^0.2.1", + "multitars": "^1.0.2", + "node-forge": "^1.4.0", + "npm-package-arg": "^11.0.0", + "ora": "^3.4.0", + "picomatch": "^4.0.4", + "pretty-format": "^29.7.0", + "progress": "^2.0.3", + "prompts": "^2.3.2", + "resolve-from": "^5.0.0", + "sandbox-cli-detector": "^0.2.0", + "semver": "^7.7.4", + "send": "^0.19.0", + "slugify": "^1.3.4", + "stacktrace-parser": "^0.1.10", + "structured-headers": "^0.4.1", + "terminal-link": "^2.1.1", + "tinyglobby": "^0.2.15", + "toqr": "^0.1.1", + "wrap-ansi": "^7.0.0", + "ws": "^8.12.1" + }, + "bin": { + "expo-internal": "bin/cli.js" + }, + "peerDependencies": { + "expo": "*", + "expo-mcp": "*", + "expo-router": "*", + "react-native": "*" + }, + "peerDependenciesMeta": { + "expo-mcp": { + "optional": true + }, + "expo-router": { + "optional": true + }, + "react-native": { + "optional": true + } + } + }, + "node_modules/expo/node_modules/@expo/cli/node_modules/@expo/router-server": { + "version": "58.0.23", + "resolved": "https://registry.npmjs.org/@expo/router-server/-/router-server-58.0.23.tgz", + "integrity": "sha512-Vcd/mskn2BSGt9dVAzAKlUFGbagfUlMT3afTgkw7KDpn8pwtkbm6M4g11158OcVSZ10m3VLvoySeZDFPskHLaQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.3.4" + }, + "peerDependencies": { + "@expo/metro-runtime": "^58.0.17", + "expo": "*", + "expo-constants": "^58.0.16", + "expo-font": "^58.0.12", + "expo-router": "*", + "expo-server": "^58.1.0", + "react": "*", + "react-dom": "*", + "react-server-dom-webpack": "~19.0.1 || ~19.1.2 || ~19.2.1 || ~19.3.0" + }, + "peerDependenciesMeta": { + "@expo/metro-runtime": { + "optional": true + }, + "expo-router": { + "optional": true + }, + "react-dom": { + "optional": true + }, + "react-server-dom-webpack": { + "optional": true + } + } + }, + "node_modules/expo/node_modules/@expo/devtools": { + "version": "58.0.2", + "resolved": "https://registry.npmjs.org/@expo/devtools/-/devtools-58.0.2.tgz", + "integrity": "sha512-WBj/K+vv8JPSmY70ennL04YYOHkpEsGGkfuVY9lfv4XO7Qhbt5qz4q6W7maME194I5oGcimRMigUFfWNkBe90w==", + "license": "MIT", + "dependencies": { + "chalk": "^4.1.2" + }, + "peerDependencies": { + "expo": "*", + "react": "*", + "react-native": "*" + }, + "peerDependenciesMeta": { + "expo": { + "optional": true + }, + "react": { + "optional": true + }, + "react-native": { + "optional": true + } + } + }, + "node_modules/expo/node_modules/@expo/metro-config": { + "version": "58.0.23", + "resolved": "https://registry.npmjs.org/@expo/metro-config/-/metro-config-58.0.23.tgz", + "integrity": "sha512-cEFdrMxH4cddH9rHDg2FxUAl4FUC7TBs8d8GYE1r+zXOjsScoKrQhMtLOPqIc2VEj3ehUFvto3EycrEgrWck+A==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.20.0", + "@babel/core": "^7.20.0", + "@babel/generator": "^7.20.5", + "@expo/config": "~58.0.12", + "@expo/env": "~2.6.0", + "@expo/json-file": "~11.2.1", + "@expo/metro": "~58.0.0", + "@expo/platforms": "^58.0.1", + "@expo/require-utils": "^58.0.6", + "@expo/spawn-async": "^1.8.0", + "@jridgewell/gen-mapping": "^0.3.13", + "@jridgewell/remapping": "^2.3.5", + "@jridgewell/sourcemap-codec": "^1.5.5", + "@jridgewell/trace-mapping": "^0.3.31", + "@react-native/js-polyfills": "0.88.1", + "2g": "^1.0.1", + "browserslist": "^4.25.0", + "chalk": "^4.1.0", + "debug": "^4.3.2", + "hermes-parser": "^0.36.0", + "jsc-safe-url": "^0.2.4", + "lightningcss": "^1.30.1", + "noxcturnal": "^0.1.14", + "picomatch": "^4.0.4", + "postcss": "^8.5.23", + "resolve-from": "^5.0.0", + "tinyglobby": "^0.2.15" + }, + "peerDependencies": { + "expo": "*" + }, + "peerDependenciesMeta": { + "expo": { + "optional": true + } + } + }, + "node_modules/expo/node_modules/@expo/ws-tunnel": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@expo/ws-tunnel/-/ws-tunnel-2.1.0.tgz", + "integrity": "sha512-LW3LnoGxjuUFOOGa1+6nAmFexx9QcxikGyR5YDMPqCn2iFtnm1OpE++1v8zWLKsikYdRzwf5VcsAtExl3l23rA==", + "license": "MIT", + "dependencies": { + "2g": "^1.0.1", + "fetch-nodeshim": "^0.4.11" + }, + "peerDependencies": { + "ws": "^8.0.0" + } + }, + "node_modules/expo/node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "license": "MIT", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/expo/node_modules/babel-preset-expo": { + "version": "58.0.26", + "resolved": "https://registry.npmjs.org/babel-preset-expo/-/babel-preset-expo-58.0.26.tgz", + "integrity": "sha512-ZCH0nRF6T5Txn2r7FqY66xcYN2ni80WzH3snBA0pFGHZpMeSgaADnb5jJmPGEnWKcb7p34ViGFf17jXoFQ1zGg==", + "license": "MIT", + "dependencies": { + "@babel/generator": "^7.20.5", + "@babel/helper-module-imports": "^7.25.9", + "@babel/plugin-proposal-decorators": "^7.12.9", + "@babel/plugin-proposal-export-default-from": "^7.24.7", + "@babel/plugin-syntax-dynamic-import": "^7.8.3", + "@babel/plugin-syntax-export-default-from": "^7.24.7", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-transform-async-generator-functions": "^7.25.4", + "@babel/plugin-transform-async-to-generator": "^7.24.7", + "@babel/plugin-transform-block-scoping": "^7.25.0", + "@babel/plugin-transform-class-properties": "^7.25.4", + "@babel/plugin-transform-class-static-block": "^7.27.1", + "@babel/plugin-transform-classes": "^7.25.4", + "@babel/plugin-transform-destructuring": "^7.24.8", + "@babel/plugin-transform-export-namespace-from": "^7.25.9", + "@babel/plugin-transform-flow-strip-types": "^7.25.2", + "@babel/plugin-transform-for-of": "^7.24.7", + "@babel/plugin-transform-logical-assignment-operators": "^7.24.7", + "@babel/plugin-transform-modules-commonjs": "^7.24.8", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.24.7", + "@babel/plugin-transform-nullish-coalescing-operator": "^7.24.7", + "@babel/plugin-transform-object-rest-spread": "^7.24.7", + "@babel/plugin-transform-optional-catch-binding": "^7.24.7", + "@babel/plugin-transform-optional-chaining": "^7.24.8", + "@babel/plugin-transform-parameters": "^7.24.7", + "@babel/plugin-transform-private-methods": "^7.24.7", + "@babel/plugin-transform-private-property-in-object": "^7.24.7", + "@babel/plugin-transform-react-display-name": "^7.24.7", + "@babel/plugin-transform-react-jsx": "^7.28.6", + "@babel/plugin-transform-react-jsx-development": "^7.27.1", + "@babel/plugin-transform-react-pure-annotations": "^7.27.1", + "@babel/plugin-transform-runtime": "^7.24.7", + "@babel/plugin-transform-typescript": "^7.25.2", + "@babel/plugin-transform-unicode-regex": "^7.24.7", + "@babel/preset-typescript": "^7.23.0", + "@react-native/babel-plugin-codegen": "0.88.1", + "babel-plugin-react-compiler": "^1.0.0", + "babel-plugin-react-native-web": "~0.21.4", + "babel-plugin-syntax-hermes-parser": "^0.36.0", + "babel-plugin-transform-flow-enums": "^0.0.2", + "debug": "^4.3.4" + }, + "peerDependencies": { + "@babel/runtime": "^7.20.0", + "expo": "*", + "expo-widgets": "^58.0.29", + "react-refresh": ">=0.14.0 <1.0.0" + }, + "peerDependenciesMeta": { + "@babel/runtime": { + "optional": true + }, + "expo": { + "optional": true + }, + "expo-widgets": { + "optional": true + } + } + }, + "node_modules/expo/node_modules/expo-asset": { + "version": "58.0.21", + "resolved": "https://registry.npmjs.org/expo-asset/-/expo-asset-58.0.21.tgz", + "integrity": "sha512-qaJmuTtswggXdBQfiUdpxrVGM7l+tH8iEDHwVDMuxyCF/kAau8sUGVuWrDKYNW4yAx7Z8ncgsT8s27pXjRH5GA==", + "license": "MIT", + "dependencies": { + "@expo/image-utils": "^0.12.7", + "expo-constants": "~58.0.16" + }, + "peerDependencies": { + "expo": "*", + "react": "*", + "react-native": "*" + } + }, + "node_modules/expo/node_modules/expo-constants": { + "version": "58.0.16", + "resolved": "https://registry.npmjs.org/expo-constants/-/expo-constants-58.0.16.tgz", + "integrity": "sha512-sVETnE1ktBMclc2Ve3qNrHhOCCio75a9JdghnJYGbqblmKfrrfE+lO9K4g9kNtmslIBLTK9Dyty6PbubkXs3Yw==", + "license": "MIT", + "dependencies": { + "@expo/env": "~2.6.0", + "@expo/require-utils": "^58.0.6" + }, + "peerDependencies": { + "expo": "*", + "react-native": "*" + } + }, + "node_modules/expo/node_modules/expo-file-system": { + "version": "58.0.14", + "resolved": "https://registry.npmjs.org/expo-file-system/-/expo-file-system-58.0.14.tgz", + "integrity": "sha512-VK67RQPDmWRHGbvpmPY5MeA1Ulw1LiyKs4KIN8na/q7SlkxYuPPR8biWsyX1S1/8XAHm6y2txUnYjCKh9l93lQ==", + "license": "MIT", + "peerDependencies": { + "expo": "*", + "react-native": "*" + } + }, + "node_modules/expo/node_modules/expo-font": { + "version": "58.0.12", + "resolved": "https://registry.npmjs.org/expo-font/-/expo-font-58.0.12.tgz", + "integrity": "sha512-5m8TJrQ27DT1815P066HBtcHINgD8yuIqH4ca2ZyYwCsPa4QZ8UzOBDtrHnAMWMAlAgol+PGVj9aKeoYov70JA==", + "license": "MIT", + "peerDependencies": { + "expo": "*", + "react": "*", + "react-native": "*" + } + }, + "node_modules/expo/node_modules/expo-keep-awake": { + "version": "58.0.4", + "resolved": "https://registry.npmjs.org/expo-keep-awake/-/expo-keep-awake-58.0.4.tgz", + "integrity": "sha512-zXJJRBwMpWl2Q2Aj9rksMe1ncz6aphOPqYnG3rTkCFALZiM22xQCqpQqBloDcQ6g4RdGTy++lRnsDX7MWpK1qw==", + "license": "MIT", + "peerDependencies": { + "expo": "*", + "react": "*" + } + }, + "node_modules/expo/node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/expo/node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/expo/node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/expo/node_modules/picomatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", + "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/expo/node_modules/ws": { + "version": "8.23.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.23.0.tgz", + "integrity": "sha512-wCkmX8QMOrKjgO8HW2WyDbTSGeqkocxgDzS9iR79rEAexty6/2qzilx3Ag8Tqf9ykop3irLKle0MtVn5qjVnoQ==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/exponential-backoff": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/exponential-backoff/-/exponential-backoff-3.1.3.tgz", + "integrity": "sha512-ZgEeZXj30q+I0EN+CbSSpIyPaJ5HVQD18Z1m+u1FXbAeT94mr1zw50q4q6jiiC447Nl/YTcIYSAftiGqetwXCA==", + "license": "Apache-2.0" + }, + "node_modules/fb-dotslash": { + "version": "0.5.8", + "resolved": "https://registry.npmjs.org/fb-dotslash/-/fb-dotslash-0.5.8.tgz", + "integrity": "sha512-XHYLKk9J4BupDxi9bSEhkfss0m+Vr9ChTrjhf9l2iw3jB5C7BnY4GVPoMcqbrTutsKJso6yj2nAB6BI/F2oZaA==", + "license": "(MIT OR Apache-2.0)", + "bin": { + "dotslash": "bin/dotslash" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/fb-watchman": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.4.tgz", + "integrity": "sha512-tGQtaoYisPDriJBN0mT5yZSyNETnJGA1gTYxaVRAE5KUO3LI9kPUc9WIu8JXcxaIci+faIKlzXqXyPgrmubtBQ==", + "license": "MIT", + "dependencies": { + "bser": "2.1.2" + } + }, + "node_modules/fbjs": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/fbjs/-/fbjs-3.0.5.tgz", + "integrity": "sha512-ztsSx77JBtkuMrEypfhgc3cI0+0h+svqeie7xHbh1k/IKdcydnvadp/mUaGgjAOXQmQSxsqgaRhS3q9fy+1kxg==", + "license": "MIT", + "dependencies": { + "cross-fetch": "^3.1.5", + "fbjs-css-vars": "^1.0.0", + "loose-envify": "^1.0.0", + "object-assign": "^4.1.0", + "promise": "^7.1.1", + "setimmediate": "^1.0.5", + "ua-parser-js": "^1.0.35" + } + }, + "node_modules/fbjs-css-vars": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/fbjs-css-vars/-/fbjs-css-vars-1.0.2.tgz", + "integrity": "sha512-b2XGFAFdWZWg0phtAWLHCk836A1Xann+I+Dgd3Gk64MHKZO44FfoD1KxyvbSh0qZsIoXQGGlVztIY+oitJPpRQ==", + "license": "MIT" + }, + "node_modules/fbjs/node_modules/promise": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", + "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==", + "license": "MIT", + "dependencies": { + "asap": "~2.0.3" + } + }, + "node_modules/fetch-nodeshim": { + "version": "0.4.11", + "resolved": "https://registry.npmjs.org/fetch-nodeshim/-/fetch-nodeshim-0.4.11.tgz", + "integrity": "sha512-mdKkKZtNfL3PAK940FSnTgA5XhsGP2IZTE4mv6UoJxixPnslS2oG02Oz06BzH88QwDOJtXRaFqABIJ2Zha6h2A==", + "license": "MIT" + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/finalhandler": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", + "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "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" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/finalhandler/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/finalhandler/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/flow-enums-runtime": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/flow-enums-runtime/-/flow-enums-runtime-0.0.6.tgz", + "integrity": "sha512-3PYnM29RFXwvAN6Pc/scUfkI7RwhQ/xqyLUyPNlXUp9S40zI8nup9tUSrTLSVnWGBN38FNiGWbwZOB6uR4OGdw==", + "license": "MIT" + }, + "node_modules/flow-estree": { + "version": "0.331.0", + "resolved": "https://registry.npmjs.org/flow-estree/-/flow-estree-0.331.0.tgz", + "integrity": "sha512-FVLYkSL/ITb/QXBEQvNWPjPooRGswuUtGOwrH+puSlMDneNkxy640+FZsk/TfKL+b7Wbw/Fg9FTUv2bMQDpj2w==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/flow-parser": { + "version": "0.331.0", + "resolved": "https://registry.npmjs.org/flow-parser/-/flow-parser-0.331.0.tgz", + "integrity": "sha512-vEZcHIlnKeN8JSVtYFczj8sWJfHIJOkz+YG00O/oul/Bete+t1ZhTi+O6JRRLFYvGW+yJkZ0YgL16iStnbkUqQ==", + "license": "MIT", + "dependencies": { + "flow-estree": "0.331.0" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.12", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.12.tgz", + "integrity": "sha512-iuyGF2E4oafQfPsRrG2wtY2ILupMhvtdrhzrxB+0VcjsPpSPttpfYdjnGFGsTi5MaJFjI1jOKHPQ6UTbTj9TAw==", + "license": "BlueOak-1.0.0" + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/hasown": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hermes-compiler": { + "version": "260318099.0.5", + "resolved": "https://registry.npmjs.org/hermes-compiler/-/hermes-compiler-260318099.0.5.tgz", + "integrity": "sha512-4Gze+pGTGTUBRmnv6LtdOMo6ZzMMh3hEkvDiWzvuNL5LM0EO5YGhr8xh3fRjFaEqReUwEGjJGcGgEPFe9+E6Gw==", + "license": "MIT" + }, + "node_modules/hermes-estree": { + "version": "0.36.1", + "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.36.1.tgz", + "integrity": "sha512-guv1nQ6IJ7S83NRFPWc3SA7IBZrdNC9kapwOq6uXvF4wP+sDCgjzQbKPCoyYmoyZRzztF/n/c36l/rccCZSiCw==", + "license": "MIT" + }, + "node_modules/hermes-parser": { + "version": "0.36.1", + "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.36.1.tgz", + "integrity": "sha512-GApNk4zLHi2UWoWZZkx7LNCOSzLSc5lB55pZ/PhK7ycFeg7u5LcF88p/WbpIi1XUDtE0MpHE3uRR3u3KB7TjSQ==", + "license": "MIT", + "dependencies": { + "hermes-estree": "0.36.1" + } + }, + "node_modules/hosted-git-info": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-7.0.2.tgz", + "integrity": "sha512-puUZAUKT5m8Zzvs72XWy3HtvVbTWljRE66cP60bxJzAqf2DgICo7lYTY2IHUmLnNpjYvw5bvmoHvPc0QO2a62w==", + "license": "ISC", + "dependencies": { + "lru-cache": "^10.0.1" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/hosted-git-info/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "license": "ISC" + }, + "node_modules/http-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", + "license": "MIT", + "dependencies": { + "depd": "~2.0.0", + "inherits": "~2.0.4", + "setprototypeof": "~1.2.0", + "statuses": "~2.0.2", + "toidentifier": "~1.0.1" + }, + "engines": { + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/http-errors/node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/hyphenate-style-name": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/hyphenate-style-name/-/hyphenate-style-name-1.1.0.tgz", + "integrity": "sha512-WDC/ui2VVRrz3jOVi+XtjqkDjiVjTtFaAGiW37k6b+ohyQ5wYDOGkvCZa8+H0nx3gyvv0+BST9xuOgIyGQ00gw==", + "license": "BSD-3-Clause" + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/inline-style-prefixer": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/inline-style-prefixer/-/inline-style-prefixer-7.0.1.tgz", + "integrity": "sha512-lhYo5qNTQp3EvSSp3sRvXMbVQTLrvGV6DycRMJ5dm2BLMiJ30wpXKdDdgX+GmJZ5uQMucwRKHamXSst3Sj/Giw==", + "license": "MIT", + "dependencies": { + "css-in-js-utils": "^3.1.0" + } + }, + "node_modules/invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.0.0" + } + }, + "node_modules/is-core-module": { + "version": "2.18.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.18.0.tgz", + "integrity": "sha512-qyax9fgaKOEC4qK8WZn7Q4IcoZC9RC1O1fFxRcRTq/oMMkWT/uXpqpXa12kzWR409zAt1drYN9N9BO26UmBCmw==", + "license": "MIT", + "dependencies": { + "hasown": "^2.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-docker": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "license": "MIT", + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "license": "MIT", + "dependencies": { + "is-docker": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "license": "ISC" + }, + "node_modules/jest-get-type": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", + "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-validate": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", + "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "leven": "^3.1.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-worker": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", + "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", + "license": "MIT", + "dependencies": { + "@types/node": "*", + "jest-util": "^29.7.0", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-worker/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/jimp-compact": { + "version": "0.16.1", + "resolved": "https://registry.npmjs.org/jimp-compact/-/jimp-compact-0.16.1.tgz", + "integrity": "sha512-dZ6Ra7u1G8c4Letq/B5EzAxj4tLFHL+cGtdpR+PVm4yzPDj+lCk+AbivWt1eOM+ikzkowtyV7qSqX6qr3t71Ww==", + "license": "MIT" + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.2.tgz", + "integrity": "sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/nodeca" + } + ], + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsc-safe-url": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/jsc-safe-url/-/jsc-safe-url-0.2.4.tgz", + "integrity": "sha512-0wM3YBWtYePOjfyXQH5MWQ8H7sdk5EXSwZvmSLKk2RboVQ2Bu239jycHDz5J/8Blf3K0Qnoy2b6xD+z10MFB+Q==", + "license": "0BSD" + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/lan-network": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/lan-network/-/lan-network-0.2.1.tgz", + "integrity": "sha512-ONPnazC96VKDntab9j9JKwIWhZ4ZUceB4A9Epu4Ssg0hYFmtHZSeQ+n15nIwTFmcBUKtExOer8WTJ4GF9MO64A==", + "license": "MIT", + "bin": { + "lan-network": "dist/lan-network-cli.js" + } + }, + "node_modules/leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/lightningcss": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.33.0.tgz", + "integrity": "sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==", + "license": "MPL-2.0", + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-android-arm64": "1.33.0", + "lightningcss-darwin-arm64": "1.33.0", + "lightningcss-darwin-x64": "1.33.0", + "lightningcss-freebsd-x64": "1.33.0", + "lightningcss-linux-arm-gnueabihf": "1.33.0", + "lightningcss-linux-arm64-gnu": "1.33.0", + "lightningcss-linux-arm64-musl": "1.33.0", + "lightningcss-linux-x64-gnu": "1.33.0", + "lightningcss-linux-x64-musl": "1.33.0", + "lightningcss-win32-arm64-msvc": "1.33.0", + "lightningcss-win32-x64-msvc": "1.33.0" + } + }, + "node_modules/lightningcss-android-arm64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.33.0.tgz", + "integrity": "sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-arm64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.33.0.tgz", + "integrity": "sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-x64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.33.0.tgz", + "integrity": "sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-freebsd-x64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.33.0.tgz", + "integrity": "sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.33.0.tgz", + "integrity": "sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==", + "cpu": [ + "arm" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.33.0.tgz", + "integrity": "sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-musl": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.33.0.tgz", + "integrity": "sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-gnu": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.33.0.tgz", + "integrity": "sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-musl": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.33.0.tgz", + "integrity": "sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.33.0.tgz", + "integrity": "sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-x64-msvc": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.33.0.tgz", + "integrity": "sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lodash.debounce": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==", + "license": "MIT" + }, + "node_modules/lodash.throttle": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz", + "integrity": "sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ==", + "license": "MIT" + }, + "node_modules/log-symbols": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", + "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", + "license": "MIT", + "dependencies": { + "chalk": "^2.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/log-symbols/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/log-symbols/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/log-symbols/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/log-symbols/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "license": "MIT" + }, + "node_modules/log-symbols/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/log-symbols/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "license": "MIT", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/lucide-react-native": { + "version": "1.80.0", + "resolved": "https://registry.npmjs.org/lucide-react-native/-/lucide-react-native-1.80.0.tgz", + "integrity": "sha512-FjJT+bW4NuNJE2RgbnhIDGXGpgzjpGJuxk/Ajhtb2MAmXCrjgMbQiH656Z37z8DfzMYzBwH62DTwAu2jsIgTOg==", + "license": "ISC", + "peerDependencies": { + "@types/react": "*", + "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "react-native": "*", + "react-native-svg": "^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/makeerror": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", + "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", + "license": "BSD-3-Clause", + "dependencies": { + "tmpl": "1.0.5" + } + }, + "node_modules/mdn-data": { + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz", + "integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==", + "license": "CC0-1.0" + }, + "node_modules/memoize-one": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-5.2.1.tgz", + "integrity": "sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q==", + "license": "MIT" + }, + "node_modules/merge-options": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/merge-options/-/merge-options-3.0.4.tgz", + "integrity": "sha512-2Sug1+knBjkaMsMgf1ctR1Ujx+Ayku4EdJN4Z+C2+JzoeF7A3OZ9KM2GY0CpQS51NR61LTurMJrRKPhSs3ZRTQ==", + "license": "MIT", + "dependencies": { + "is-plain-obj": "^2.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "license": "MIT" + }, + "node_modules/metro": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/metro/-/metro-0.87.1.tgz", + "integrity": "sha512-1oyLU9elM7hPAsKIqKooEekwxiuWr27+MZBhUROPhzcbXhMDxK64GPF/hCXwBZVp1F89ODavCrBmJtLx9WtBoQ==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.0", + "@babel/core": "^7.25.2", + "@babel/generator": "^7.29.1", + "@babel/parser": "^7.29.0", + "@babel/template": "^7.28.6", + "@babel/traverse": "^7.29.0", + "@babel/types": "^7.29.0", + "accepts": "^2.0.0", + "connect": "^3.6.5", + "debug": "^4.4.0", + "error-stack-parser": "^2.0.6", + "flow-enums-runtime": "^0.0.6", + "flow-parser": "0.331.0", + "graceful-fs": "^4.2.4", + "invariant": "^2.2.4", + "jest-worker": "^29.7.0", + "jsc-safe-url": "^0.2.2", + "lodash.throttle": "^4.1.1", + "metro-babel-transformer": "0.87.1", + "metro-cache": "0.87.1", + "metro-cache-key": "0.87.1", + "metro-config": "0.87.1", + "metro-core": "0.87.1", + "metro-file-map": "0.87.1", + "metro-resolver": "0.87.1", + "metro-runtime": "0.87.1", + "metro-source-map": "0.87.1", + "metro-symbolicate": "0.87.1", + "metro-transform-plugins": "0.87.1", + "metro-transform-worker": "0.87.1", + "mime-types": "^3.0.1", + "nullthrows": "^1.1.1", + "serialize-error": "^2.1.0", + "source-map": "^0.5.6", + "throat": "^5.0.0", + "ws": "^7.5.10", + "yargs": "^17.6.2" + }, + "bin": { + "metro": "src/cli.js" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/metro-babel-transformer": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/metro-babel-transformer/-/metro-babel-transformer-0.87.1.tgz", + "integrity": "sha512-orvRIGpb0yK1yMbk5YP3dhVKjmoxUkRB9fdltGJxNppEqus/1tFpNuf9KnGFR3Qjg0izoUrJ4z6WgoBvdkXPrA==", + "license": "MIT", + "dependencies": { + "@babel/core": "^7.25.2", + "flow-enums-runtime": "^0.0.6", + "flow-parser": "0.331.0", + "metro-cache-key": "0.87.1", + "nullthrows": "^1.1.1" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/metro-cache": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/metro-cache/-/metro-cache-0.87.1.tgz", + "integrity": "sha512-juNPaj0Xi5tkLp8imXqvbSnEIijwKG36m7OiFFVJMqEkiURwAjkMFVek3/xpix1+LVQqO7kjVp3PvuvIM61mKQ==", + "license": "MIT", + "dependencies": { + "exponential-backoff": "^3.1.1", + "flow-enums-runtime": "^0.0.6", + "https-proxy-agent": "^7.0.5", + "metro-core": "0.87.1" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/metro-cache-key": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/metro-cache-key/-/metro-cache-key-0.87.1.tgz", + "integrity": "sha512-scqVVPMA2c+RVO12I3wyMDp5xCkRPLsyrcG4Qc3xfU5JR0EW/0sz2tjty+5UjMUtG09uiM1KYQ8HjWg7OQXHtw==", + "license": "MIT", + "dependencies": { + "flow-enums-runtime": "^0.0.6" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/metro-config": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/metro-config/-/metro-config-0.87.1.tgz", + "integrity": "sha512-NmkDlc/qZAdo5gTkVTuO2AKE/khemRKRH5IA+SKfqUBJigI5GqZ5TOXhmEokhlkAqzjt8dyzKhzI6FHvXoXaTQ==", + "license": "MIT", + "dependencies": { + "connect": "^3.6.5", + "flow-enums-runtime": "^0.0.6", + "jest-validate": "^29.7.0", + "metro": "0.87.1", + "metro-cache": "0.87.1", + "metro-core": "0.87.1", + "metro-runtime": "0.87.1" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/metro-core": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/metro-core/-/metro-core-0.87.1.tgz", + "integrity": "sha512-xizzky/4+c/Mkznege8OW05j7bSdM39VPoEps61Se4+hf32UQujmbvLvIE9+UnP6kNEPVomk0Fw8NsBK9iRQmw==", + "license": "MIT", + "dependencies": { + "flow-enums-runtime": "^0.0.6", + "lodash.throttle": "^4.1.1", + "metro-resolver": "0.87.1" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/metro-file-map": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/metro-file-map/-/metro-file-map-0.87.1.tgz", + "integrity": "sha512-9sPuNCojC3pS4vj+ZPY7FXmHGpdJeckXuKXQrDAfJvZc60AF8owRFTkI8XdwlwrmPIB2w++KraK9FMEXvC4wJw==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "fb-watchman": "^2.0.0", + "flow-enums-runtime": "^0.0.6", + "graceful-fs": "^4.2.4", + "invariant": "^2.2.4", + "jest-worker": "^29.7.0", + "micromatch": "^4.0.4", + "nullthrows": "^1.1.1" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/metro-minify-terser": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/metro-minify-terser/-/metro-minify-terser-0.87.1.tgz", + "integrity": "sha512-YK4k1oO1wV48hfE+Nbw2rJCnAgeabzrgT/xH5ha5n9gbK4p3HYFC898cERUiyTl9vRh58CNTiXRc88f7y6PfKg==", + "license": "MIT", + "dependencies": { + "flow-enums-runtime": "^0.0.6", + "terser": "^5.15.0" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/metro-resolver": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/metro-resolver/-/metro-resolver-0.87.1.tgz", + "integrity": "sha512-FXH/brY69wT6sPxaSW8BhMmDGD/6irmBr/cL4rUi+VWwqR3pbvdcfUOfyjcHucgQ7pe5IW3xJY21eHKLVKNumQ==", + "license": "MIT", + "dependencies": { + "flow-enums-runtime": "^0.0.6" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/metro-runtime": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/metro-runtime/-/metro-runtime-0.87.1.tgz", + "integrity": "sha512-kjeuSvInsM6OzBjkCQsWxnkrKZFMKtnkCl38oXWRI9lDGs2L9hGs9Tak9sQYJ9h3gtDujneB7wZio+irgqJKDw==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.25.0", + "flow-enums-runtime": "^0.0.6" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/metro-source-map": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/metro-source-map/-/metro-source-map-0.87.1.tgz", + "integrity": "sha512-Bqpm0PBGdy53pigIJb4HRF7QxD2pUOdgSmVh/4AWbP635kSCv+Y6ltVxUZgSnzS/QbSmzyCGijmRPlXMj2/qHw==", + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.29.0", + "@babel/types": "^7.29.0", + "flow-enums-runtime": "^0.0.6", + "invariant": "^2.2.4", + "metro-symbolicate": "0.87.1", + "nullthrows": "^1.1.1", + "ob1": "0.87.1", + "source-map": "^0.5.6", + "vlq": "^1.0.0" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/metro-symbolicate": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/metro-symbolicate/-/metro-symbolicate-0.87.1.tgz", + "integrity": "sha512-rcGvwabrg0lbXGRGRKl14PY3My3+dkno2jZYhdJEuH2DmjTtTkV5bYwgto4JtV/Lbe+sXE6GO1UGg654430uow==", + "license": "MIT", + "dependencies": { + "flow-enums-runtime": "^0.0.6", + "invariant": "^2.2.4", + "metro-source-map": "0.87.1", + "nullthrows": "^1.1.1", + "source-map": "^0.5.6", + "vlq": "^1.0.0" + }, + "bin": { + "metro-symbolicate": "src/index.js" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/metro-transform-plugins": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/metro-transform-plugins/-/metro-transform-plugins-0.87.1.tgz", + "integrity": "sha512-qMiJ/x+VfqumFJJSefKS6nj8uojzC29b2/aK8vlMuFABIqGjDucICEOXd2Yt6k/XMFAgAcaJvShUOT0HLyYaPw==", + "license": "MIT", + "dependencies": { + "@babel/core": "^7.25.2", + "@babel/generator": "^7.29.1", + "@babel/template": "^7.28.6", + "@babel/traverse": "^7.29.0", + "flow-enums-runtime": "^0.0.6", + "nullthrows": "^1.1.1" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/metro-transform-worker": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/metro-transform-worker/-/metro-transform-worker-0.87.1.tgz", + "integrity": "sha512-VOzs3OV405FuOLYdAhqA2wsn1F9lvueDVxMDLvCKaQ44U+yknIqphJ9eMjjsGwLDZiJq9sW3DMLhjD27JxQgqQ==", + "license": "MIT", + "dependencies": { + "@babel/core": "^7.25.2", + "@babel/generator": "^7.29.1", + "@babel/parser": "^7.29.0", + "@babel/types": "^7.29.0", + "flow-enums-runtime": "^0.0.6", + "metro": "0.87.1", + "metro-babel-transformer": "0.87.1", + "metro-cache": "0.87.1", + "metro-cache-key": "0.87.1", + "metro-minify-terser": "0.87.1", + "metro-source-map": "0.87.1", + "metro-transform-plugins": "0.87.1", + "nullthrows": "^1.1.1" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz", + "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==", + "license": "MIT", + "dependencies": { + "mime-db": "^1.54.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/minimatch": { + "version": "10.2.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", + "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.8" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/multitars": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/multitars/-/multitars-1.0.3.tgz", + "integrity": "sha512-5e2ayy9RjixFisCSfPL6pOgCJhDXYLLx73puYEnIT05A60q3kw3q0ipnqcCgmg6EAScLwatGMBJEHYmP7BSEYw==", + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.20", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz", + "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/negotiator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.1.0.tgz", + "integrity": "sha512-NMPBRMJgiQHjbd8phG3Vebdx4kZ1H121rbl5IkMqeOsahptB9BKo/d7oJ3zTXqTgagn2bWlNSXkh0QUGM31RYg==", + "license": "MIT", + "dependencies": { + "content-type": "^2.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "license": "MIT", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-forge": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.4.4.tgz", + "integrity": "sha512-T6VRRpF3+czIGcXW/LOeoD7Ej28d8CF1UMEAbJyJRUtYMvyXAgxUPW2kbUibumvV9LiUQAznJOFyeYclzSJMMg==", + "license": "(BSD-3-Clause OR GPL-2.0)", + "engines": { + "node": ">= 6.13.0" + } + }, + "node_modules/node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", + "license": "MIT" + }, + "node_modules/node-releases": { + "version": "2.0.65", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.65.tgz", + "integrity": "sha512-PfvofsGQ+MiOQIPkX9fU8ELUWmy5zL74CdQaph/ismKszfFkfwXaw0cGiwbwym2hT9k5+mdyl8O5WQ1MD8EHmA==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/noxcturnal": { + "version": "0.1.14", + "resolved": "https://registry.npmjs.org/noxcturnal/-/noxcturnal-0.1.14.tgz", + "integrity": "sha512-dYhWwCVfxlxnyzkVvP6W+XXd7lKikl04YckNur8xV4IejmgYDPq2ykSvzA2zfYVaNgEvmWDceOVRFn3sjry69Q==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.20.0", + "@oxc-project/types": "0.154.0" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@noxcturnal/noxcturnal-darwin-arm64": "0.1.14", + "@noxcturnal/noxcturnal-darwin-x64": "0.1.14", + "@noxcturnal/noxcturnal-linux-arm64-gnu": "0.1.14", + "@noxcturnal/noxcturnal-linux-arm64-musl": "0.1.14", + "@noxcturnal/noxcturnal-linux-x64-gnu": "0.1.14", + "@noxcturnal/noxcturnal-linux-x64-musl": "0.1.14", + "@noxcturnal/noxcturnal-win32-arm64-msvc": "0.1.14", + "@noxcturnal/noxcturnal-win32-x64-msvc": "0.1.14" + } + }, + "node_modules/npm-package-arg": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-11.0.3.tgz", + "integrity": "sha512-sHGJy8sOC1YraBywpzQlIKBE4pBbGbiF95U6Auspzyem956E0+FtDtsx1ZxlOJkQCZ1AFXAY/yuvtFYrOxF+Bw==", + "license": "ISC", + "dependencies": { + "hosted-git-info": "^7.0.0", + "proc-log": "^4.0.0", + "semver": "^7.3.5", + "validate-npm-package-name": "^5.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/nth-check": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", + "license": "BSD-2-Clause", + "dependencies": { + "boolbase": "^1.0.0" + }, + "funding": { + "url": "https://github.com/fb55/nth-check?sponsor=1" + } + }, + "node_modules/nullthrows": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/nullthrows/-/nullthrows-1.1.1.tgz", + "integrity": "sha512-2vPPEi+Z7WqML2jZYddDIfy5Dqb0r2fze2zTxNNknZaFpVHU3mFB3R+DWeJWGVx0ecvttSGlJTI+WG+8Z4cDWw==", + "license": "MIT" + }, + "node_modules/ob1": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/ob1/-/ob1-0.87.1.tgz", + "integrity": "sha512-i8iA8uij0g1YQzS8uOJPSRCgwDjO9warIHUAu1Fqj877Wc3wlfxDYBioYWgKTBF2+URVJttyDWSEpmd99nlvtQ==", + "license": "MIT", + "dependencies": { + "flow-enums-runtime": "^0.0.6" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/on-headers": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.1.0.tgz", + "integrity": "sha512-737ZY3yNnXy37FHkQxPzt4UZ2UWPWiCZWLvFZ4fu5cueciegX0zGPnrlY6bwRg4FdQOe9YU8MkmJwGhoMybl8A==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ==", + "license": "MIT", + "dependencies": { + "mimic-fn": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/open": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz", + "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==", + "license": "MIT", + "dependencies": { + "define-lazy-prop": "^2.0.0", + "is-docker": "^2.1.1", + "is-wsl": "^2.2.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/ora/-/ora-3.4.0.tgz", + "integrity": "sha512-eNwHudNbO1folBP3JsZ19v9azXWtQZjICdr3Q0TDPIaeBQ3mXLrh54wM+er0+hSp+dWKf+Z8KM58CYzEyIYxYg==", + "license": "MIT", + "dependencies": { + "chalk": "^2.4.2", + "cli-cursor": "^2.1.0", + "cli-spinners": "^2.0.0", + "log-symbols": "^2.2.0", + "strip-ansi": "^5.2.0", + "wcwidth": "^1.0.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/ora/node_modules/ansi-regex": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/ora/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/ora/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/ora/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/ora/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "license": "MIT" + }, + "node_modules/ora/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/ora/node_modules/strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/ora/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/parse-png": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/parse-png/-/parse-png-2.1.0.tgz", + "integrity": "sha512-Nt/a5SfCLiTnQAjx3fHlqp8hRgTL3z7kTQZzvIMS9uCAepnCyjpdEc6M/sz69WqMBdaDBw9sF1F1UaHROYzGkQ==", + "license": "MIT", + "dependencies": { + "pngjs": "^3.3.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/plist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/plist/-/plist-3.1.1.tgz", + "integrity": "sha512-ZIfcLJC+7E7FBFnDxm9MPmt7D+DidyQ26lewieO75AdhA2ayMtsJSES0iWzqJQbcVRSrTufQoy0DR94xHue0oA==", + "license": "MIT", + "dependencies": { + "@xmldom/xmldom": "^0.9.10", + "base64-js": "^1.5.1", + "xmlbuilder": "^15.1.1" + }, + "engines": { + "node": ">=10.4.0" + } + }, + "node_modules/plist/node_modules/@xmldom/xmldom": { + "version": "0.9.12", + "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.9.12.tgz", + "integrity": "sha512-5AXjrcMClTryPe9LgZrygpB1lj7s0S9E0+W+AHaVKAVyHanafK86iPSvG5xHVSp/jC+VH1UXu0TAEmY279xH7A==", + "license": "MIT", + "engines": { + "node": ">=14.6" + } + }, + "node_modules/pngjs": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-3.4.0.tgz", + "integrity": "sha512-NCrCHhWmnQklfH4MtJMRjZ2a8c80qXeMlQMv2uVp9ISJMTt562SbGd6n2oq0PaPgKm7Z6pL9E2UlLIhC+SHL3w==", + "license": "MIT", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/postcss": { + "version": "8.5.33", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.33.tgz", + "integrity": "sha512-RVHEU9/Pp1Fnjr/MpAJsZoADukCKhfIi15OunEYiGktIkYLkPVvC1sioWolGDS7XByMTx9m/IGbro0Js13zhnQ==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.20", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/postcss-value-parser": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", + "license": "MIT" + }, + "node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/proc-log": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-4.2.0.tgz", + "integrity": "sha512-g8+OnU/L2v+wyiVK+D5fA34J7EH8jZ8DDlvwhRCMxmMj7UCBvxiO1mGeN+36JXIKF4zevU4kRBd8lVgG9vLelA==", + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/promise": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/promise/-/promise-8.3.0.tgz", + "integrity": "sha512-rZPNPKTOYVNEEKFaq1HqTgOwZD+4/YHS5ukLzQCypkj+OkYx7iv0mA91lJlpPPZ8vMau3IIGj5Qlwrx+8iiSmg==", + "license": "MIT", + "dependencies": { + "asap": "~2.0.6" + } + }, + "node_modules/prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "license": "MIT", + "dependencies": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/react": { + "version": "19.3.0", + "resolved": "https://registry.npmjs.org/react/-/react-19.3.0.tgz", + "integrity": "sha512-E8LUcbtBWt20bbl2YoHfx4ZDBdxVTfOKtCZn9cDSJ4l6/nuoApcpIBcj47t2wZoVX8g2ZHuMHbiShgCR1T5Sog==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-devtools-core": { + "version": "6.1.5", + "resolved": "https://registry.npmjs.org/react-devtools-core/-/react-devtools-core-6.1.5.tgz", + "integrity": "sha512-ePrwPfxAnB+7hgnEr8vpKxL9cmnp7F322t8oqcPshbIQQhDKgFDW4tjhF2wjVbdXF9O/nyuy3sQWd9JGpiLPvA==", + "license": "MIT", + "dependencies": { + "shell-quote": "^1.6.1", + "ws": "^7" + } + }, + "node_modules/react-dom": { + "version": "19.3.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.3.0.tgz", + "integrity": "sha512-JDk8dgif51OjFoDE70+OT9ICyYr+69HlmihNwp1+Nsfbna3t5sIiCa9ZJktDmQ4/1b/rn26hIAR2uYXDMr5r0Q==", + "license": "MIT", + "dependencies": { + "scheduler": "^0.28.0" + }, + "peerDependencies": { + "react": "^19.3.0" + } + }, + "node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "license": "MIT" + }, + "node_modules/react-native": { + "version": "0.88.1", + "resolved": "https://registry.npmjs.org/react-native/-/react-native-0.88.1.tgz", + "integrity": "sha512-wajWcLZ93GCN7k4Uwh4CS4L2Ah8ohcvkOXnvIYmh4Yvuqho5j3APZ9qozK+nQrHWSgauq4h8D3HN5DKK84SrHA==", + "license": "MIT", + "dependencies": { + "@react-native/asset-utils": "0.88.1", + "@react-native/codegen": "0.88.1", + "@react-native/community-cli-plugin": "0.88.1", + "@react-native/gradle-plugin": "0.88.1", + "@react-native/normalize-colors": "0.88.1", + "@react-native/virtualized-lists": "0.88.1", + "anser": "^1.4.9", + "ansi-regex": "^5.0.0", + "base64-js": "^1.5.1", + "flow-enums-runtime": "^0.0.6", + "flow-parser": "0.327.0", + "hermes-compiler": "260318099.0.5", + "invariant": "^2.2.4", + "memoize-one": "^5.0.0", + "metro-runtime": "^0.87.1", + "metro-source-map": "^0.87.1", + "nullthrows": "^1.1.1", + "pretty-format": "^29.7.0", + "promise": "^8.3.0", + "react-devtools-core": "^6.1.5", + "react-refresh": "^0.14.0", + "regenerator-runtime": "^0.13.2", + "scheduler": "0.28.0", + "semver": "^7.1.3", + "stacktrace-parser": "^0.1.10", + "tinyglobby": "^0.2.15", + "whatwg-fetch": "^3.0.0", + "ws": "^7.5.10", + "yargs": "^17.6.2" + }, + "bin": { + "react-native": "cli.js" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + }, + "peerDependencies": { + "@types/react": "^19.1.1", + "react": "^19.3.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/react-native-is-edge-to-edge": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/react-native-is-edge-to-edge/-/react-native-is-edge-to-edge-1.3.1.tgz", + "integrity": "sha512-NIXU/iT5+ORyCc7p0z2nnlkouYKX425vuU1OEm6bMMtWWR9yvb+Xg5AZmImTKoF9abxCPqrKC3rOZsKzUYgYZA==", + "license": "MIT", + "peerDependencies": { + "react": "*", + "react-native": "*" + } + }, + "node_modules/react-native-keyboard-controller": { + "version": "1.22.7", + "resolved": "https://registry.npmjs.org/react-native-keyboard-controller/-/react-native-keyboard-controller-1.22.7.tgz", + "integrity": "sha512-IBR9z6Nl/iDLRfiv1zN9QQroOXAwYMugeAjVDb+CFbRBNC8fayXlHTBbshVcWc4j95Itsv+1/FgwfxKnIn1Vmg==", + "license": "MIT", + "dependencies": { + "react-native-is-edge-to-edge": "^1.2.1" + }, + "peerDependencies": { + "react": "*", + "react-native": "*", + "react-native-reanimated": ">=3.0.0" + } + }, + "node_modules/react-native-reanimated": { + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/react-native-reanimated/-/react-native-reanimated-4.7.1.tgz", + "integrity": "sha512-HviDFSZ6V4KTRsrLS6hRbBJ4j63l/L8a5az0EoWdJwaMLYnBNyYISTDxwXpEYkMbAbLzCMCviIdiOxXHYQWcNA==", + "license": "MIT", + "dependencies": { + "react-native-is-edge-to-edge": "^1.3.1", + "semver": "^7.7.3" + }, + "peerDependencies": { + "react": "*", + "react-native": "0.86 - 0.88", + "react-native-worklets": "0.13.x" + } + }, + "node_modules/react-native-safe-area-context": { + "version": "5.11.1", + "resolved": "https://registry.npmjs.org/react-native-safe-area-context/-/react-native-safe-area-context-5.11.1.tgz", + "integrity": "sha512-yCltXXwhwp42vMqfhAsH5BWgAysbLNgwfn3PDwNpOn/CgwfM+eMWgScZIbHbMzJYNLi5bKJEOIUEG4RwKNiECA==", + "license": "MIT", + "peerDependencies": { + "react": "*", + "react-native": "*" + } + }, + "node_modules/react-native-svg": { + "version": "15.16.0", + "resolved": "https://registry.npmjs.org/react-native-svg/-/react-native-svg-15.16.0.tgz", + "integrity": "sha512-uh8yktufYeRU3W9Omi8+SPyLF9BVN4JmLflSgc9oOcKkSKk/S5JUmmTjKZq/L8GHfQUtCvcu/W6X4xhEfBBAjQ==", + "license": "MIT", + "dependencies": { + "css-select": "^5.1.0", + "css-tree": "^1.1.3" + }, + "peerDependencies": { + "react": "*", + "react-native": "*" + } + }, + "node_modules/react-native-web": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/react-native-web/-/react-native-web-0.21.4.tgz", + "integrity": "sha512-77B6KlalB4osNIck91TNFixPkYPsTbuNEvw8P7IV+4v4/5wZSBRKZnw0Zhx6YjuauDTz71gc8IW+fVhcBMjr5A==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.18.6", + "@react-native/normalize-colors": "^0.74.1", + "fbjs": "^3.0.4", + "inline-style-prefixer": "^7.0.1", + "memoize-one": "^6.0.0", + "nullthrows": "^1.1.1", + "postcss-value-parser": "^4.2.0", + "styleq": "^0.1.3" + }, + "peerDependencies": { + "react": "^18.0.0 || ^19.0.0", + "react-dom": "^18.0.0 || ^19.0.0" + } + }, + "node_modules/react-native-web/node_modules/@react-native/normalize-colors": { + "version": "0.74.89", + "resolved": "https://registry.npmjs.org/@react-native/normalize-colors/-/normalize-colors-0.74.89.tgz", + "integrity": "sha512-qoMMXddVKVhZ8PA1AbUCk83trpd6N+1nF2A6k1i6LsQObyS92fELuk8kU/lQs6M7BsMHwqyLCpQJ1uFgNvIQXg==", + "license": "MIT" + }, + "node_modules/react-native-web/node_modules/memoize-one": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-6.0.0.tgz", + "integrity": "sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==", + "license": "MIT" + }, + "node_modules/react-native-worklets": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/react-native-worklets/-/react-native-worklets-0.13.0.tgz", + "integrity": "sha512-1OrhAeAKaZF4XrBa4YbPQbKzNOpjh52HDlId8e6ete1OCHNdAlrQHzG4gznJ225EAj3dgQXHViJvK51M9B52jQ==", + "license": "MIT", + "dependencies": { + "@babel/generator": "^7.27.1", + "@babel/plugin-transform-arrow-functions": "^7.27.1", + "@babel/plugin-transform-class-properties": "^7.28.6", + "@babel/plugin-transform-classes": "^7.28.6", + "@babel/plugin-transform-nullish-coalescing-operator": "^7.28.6", + "@babel/plugin-transform-optional-chaining": "^7.28.6", + "@babel/plugin-transform-shorthand-properties": "^7.27.1", + "@babel/plugin-transform-template-literals": "^7.27.1", + "@babel/plugin-transform-unicode-regex": "^7.27.1", + "@babel/preset-typescript": "^7.28.5", + "@babel/traverse": "^7.27.1", + "@babel/types": "^7.27.1", + "@jridgewell/remapping": "^2.3.5", + "convert-source-map": "^2.0.0", + "semver": "^7.7.4", + "whatwg-fetch": "^3.6.20" + }, + "peerDependencies": { + "@babel/core": "*", + "@react-native/metro-config": "*", + "react": "*", + "react-native": "0.86 - 0.88" + } + }, + "node_modules/react-native/node_modules/flow-estree": { + "version": "0.327.0", + "resolved": "https://registry.npmjs.org/flow-estree/-/flow-estree-0.327.0.tgz", + "integrity": "sha512-f9vK751YUzD0qaHSpKc5/qQM6gqOlgGS+4ZRqTNcZOpVqn3mC55yEQ6dUG2K1eaVm5FbKkz9CFWe6XNvrkQFQg==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/react-native/node_modules/flow-parser": { + "version": "0.327.0", + "resolved": "https://registry.npmjs.org/flow-parser/-/flow-parser-0.327.0.tgz", + "integrity": "sha512-/MYZ5hXWf5ozpbdfUDmazMgQXviLxWEiRLH3MppEGDdW0itRVqmB5UaU7QX+SBCDNiq+gEesSVn8nlxmPDyDkw==", + "license": "MIT", + "dependencies": { + "flow-estree": "0.327.0" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/react-refresh": { + "version": "0.14.2", + "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.14.2.tgz", + "integrity": "sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/regenerate": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.5.0.tgz", + "integrity": "sha512-1s+CxXjJ71i7LNVy8nYwg47XV4y6lAnOEhsMtSKq3WpmPfhl9LuKlTqKIn/3yUpE8lBz+W+TT88Bxyhnr0U4yw==", + "license": "MIT" + }, + "node_modules/regenerate-unicode-properties": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.3.0.tgz", + "integrity": "sha512-9ns8odR8e9q3otKeHj3DE80jZYKg6zVeZKE+zQmRKXFoVUcuiTGeO6iusDhPRoIQQPVPRvH+SfBhrTud4eczuw==", + "license": "MIT", + "dependencies": { + "regenerate": "^1.4.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/regenerator-runtime": { + "version": "0.13.11", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", + "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==", + "license": "MIT" + }, + "node_modules/regexpu-core": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-6.5.4.tgz", + "integrity": "sha512-VpdamrZ9bw4YmvMZfTA3Yg8IHU9Guvg21bonvgjC4l3KfBkOqCPJesHakz7cQeE4Vh4zz4r4Gy6igAcnJxZv9g==", + "license": "MIT", + "dependencies": { + "regenerate": "^1.5.0", + "regenerate-unicode-properties": "^10.3.0", + "regjsgen": "^0.8.0", + "regjsparser": "^0.14.0", + "unicode-match-property-ecmascript": "^2.0.0", + "unicode-match-property-value-ecmascript": "^2.2.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/regjsgen": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.8.0.tgz", + "integrity": "sha512-RvwtGe3d7LvWiDQXeQw8p5asZUmfU1G/l6WbUXeHta7Y2PEIvBTwH6E2EfmYUK8pxcxEdEmaomqyp0vZZ7C+3Q==", + "license": "MIT" + }, + "node_modules/regjsparser": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.14.1.tgz", + "integrity": "sha512-IeYboCLG1KBNRksrZQIZ1SV5KVWZiR0ikFokOcA0n63vLvlaFvCsfxN+fd4aXwL0KW3YD+ByRzIgo9ZAHdbldw==", + "license": "BSD-2-Clause", + "dependencies": { + "jsesc": "~3.1.0" + }, + "bin": { + "regjsparser": "bin/parser" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve": { + "version": "1.22.14", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.14.tgz", + "integrity": "sha512-1ZjYvR9sbkiwC5+9QHetqW5HmA2pHRMaoupD01t2HlYnV/vydC2zPwLixhsMieSWVZt0JJRg5LVIk0Ow1D/TrA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "is-core-module": "^2.18.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-workspace-root": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/resolve-workspace-root/-/resolve-workspace-root-2.0.1.tgz", + "integrity": "sha512-nR23LHAvaI6aHtMg6RWoaHpdR4D881Nydkzi2CixINyg9T00KgaJdJI6Vwty+Ps8WLxZHuxsS0BseWjxSA4C+w==", + "license": "MIT" + }, + "node_modules/restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q==", + "license": "MIT", + "dependencies": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/sandbox-cli-detector": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/sandbox-cli-detector/-/sandbox-cli-detector-0.2.0.tgz", + "integrity": "sha512-4lyHX0ZU0AZKwjgZ1InxZAa3PNpyEb8rOQ+Zss1ReYmhNzW0Q+h1zE5nvniXN0HaAWZaZE1zgVNEirb0R7LmNg==", + "license": "MIT", + "bin": { + "sandbox-cli-detector": "dist/cli.js" + }, + "engines": { + "node": ">=18.18" + } + }, + "node_modules/sax": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.6.1.tgz", + "integrity": "sha512-42tBVwLWnaQvW5zc4HbZrTuWccECCZfBi92FDuwtqxasH+JbPB3/FOKb1m222K42R4WxuxzzMsTswfzgtSu64Q==", + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=11.0.0" + } + }, + "node_modules/scheduler": { + "version": "0.28.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.28.0.tgz", + "integrity": "sha512-juorfCmIkIw8tT+p5BXSm6PJjQF/ycEYmKyzURCIt/RaZIhL+PulbQ9Yu2z1HdOJDdqDTlxA1+xKBmHXJsczAw==", + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz", + "integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/send": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.2.tgz", + "integrity": "sha512-VMbMxbDeehAxpOtWJXlcUS5E8iXh6QmN+BkRX1GARS3wRaXEEgzCcB10gTQazO42tpNIya8xIyNx8fll1OFPrg==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "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" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/send/node_modules/debug/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/send/node_modules/encodeurl": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.3.tgz", + "integrity": "sha512-mIteYONiEfc4xWf2F1WXovh1c8npzS00vNeiUPdwFF+QlVJni+gNvpQltLMQhob8rew/bWWc/bGTuUr0EUGt0w==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/send/node_modules/on-finished": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.2.tgz", + "integrity": "sha512-ATWUv387i+nLD49EiDoOft5scf32Vsdz3ktrQJG9bi7jRFmaXTssvyvj1EmeKVVgvesbqUtvQQvaS2TpTukAZQ==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/send/node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/serialize-error": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-2.1.0.tgz", + "integrity": "sha512-ghgmKt5o4Tly5yEG/UJp8qTd0AN7Xalw4XBtDEKP655B699qMEtra1WlXeE6WIvdEG481JvRxULKsInq/iNysw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/serve-static": { + "version": "1.16.3", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.3.tgz", + "integrity": "sha512-x0RTqQel6g5SY7Lg6ZreMmsOzncHFU7nhnRWkKgWuMTu5NN0DR5oruckMqRvacAN9d5w6ARnRBXl9xhDCgfMeA==", + "license": "MIT", + "dependencies": { + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "~0.19.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/serve-static/node_modules/encodeurl": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.3.tgz", + "integrity": "sha512-mIteYONiEfc4xWf2F1WXovh1c8npzS00vNeiUPdwFF+QlVJni+gNvpQltLMQhob8rew/bWWc/bGTuUr0EUGt0w==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", + "license": "MIT" + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/shell-quote": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.12.0.tgz", + "integrity": "sha512-PcByqNyT/38F2kDNi006HAMRJaULuBzq/FOsw3qdZvX/GA9W/jamDaRskgHjubHiftXK5sIFxLNkvrXUwcof6Q==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "license": "ISC" + }, + "node_modules/simple-plist": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/simple-plist/-/simple-plist-1.3.1.tgz", + "integrity": "sha512-iMSw5i0XseMnrhtIzRb7XpQEXepa9xhWxGUojHBL43SIpQuDQkh3Wpy67ZbDzZVr6EKxvwVChnVpdl8hEVLDiw==", + "license": "MIT", + "dependencies": { + "bplist-creator": "0.1.0", + "bplist-parser": "0.3.1", + "plist": "^3.0.5" + } + }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "license": "MIT" + }, + "node_modules/slugify": { + "version": "1.6.9", + "resolved": "https://registry.npmjs.org/slugify/-/slugify-1.6.9.tgz", + "integrity": "sha512-vZ7rfeehZui7wQs438JXBckYLkIIdfHOXsaVEUMyS5fHo1483l1bMdo0EDSWYclY0yZKFOipDy4KHuKs6ssvdg==", + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-js": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.4.tgz", + "integrity": "sha512-J7ZjMvHd9O1fcT/5V09QWaaSl2BbWx3F6O08spde82Namf9UB0GxRVIPiNbVsdKkoizHiSpTodo3vp2bAy91MA==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/source-map-support/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/stackframe": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.3.4.tgz", + "integrity": "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==", + "license": "MIT" + }, + "node_modules/stacktrace-parser": { + "version": "0.1.11", + "resolved": "https://registry.npmjs.org/stacktrace-parser/-/stacktrace-parser-0.1.11.tgz", + "integrity": "sha512-WjlahMgHmCJpqzU8bIBy4qtsZdU9lRlcZE3Lvyej6t4tuOuv1vk57OW3MBrj6hXBFx/nNoC9MPMTcr5YA7NQbg==", + "license": "MIT", + "dependencies": { + "type-fest": "^0.7.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/stream-buffers": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/stream-buffers/-/stream-buffers-2.2.0.tgz", + "integrity": "sha512-uyQK/mx5QjHun80FLJTfaWE7JtwfRMKBLkMne6udYOmvH0CawotVa7TfgYHzAnpphn4+TweIx1QKMnRIbipmUg==", + "license": "Unlicense", + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/structured-headers": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/structured-headers/-/structured-headers-0.4.1.tgz", + "integrity": "sha512-0MP/Cxx5SzeeZ10p/bZI0S6MpgD+yxAhi1BOQ34jgnMXsCq3j1t6tQnZu+KdlL7dvJTLT3g9xN8tl10TqgFMcg==", + "license": "MIT" + }, + "node_modules/styleq": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/styleq/-/styleq-0.1.3.tgz", + "integrity": "sha512-3ZUifmCDCQanjeej1f6kyl/BeP/Vae5EYkQ9iJfUm/QwZvlgnZzyflqAsAWYURdtea8Vkvswu2GrC57h3qffcA==", + "license": "MIT" + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-hyperlinks": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.3.0.tgz", + "integrity": "sha512-RpsAZlpWcDwOPQA22aCH4J0t7L8JmAvsCxfOSEwm7cQs3LshN36QaTkwd70DnBOXDWGssw2eUoc8CaRWT0XunA==", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0", + "supports-color": "^7.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/terminal-link": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz", + "integrity": "sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ==", + "license": "MIT", + "dependencies": { + "ansi-escapes": "^4.2.1", + "supports-hyperlinks": "^2.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/terser": { + "version": "5.51.4", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.51.4.tgz", + "integrity": "sha512-VPi1CkDvCWLGUVIToctNBG+NdHbSXwOPjHJnQ3pdB0XknaldnI76wSkAFOGxV2ZdkzOP5d6gpQ5c58XvDghRvw==", + "license": "BSD-2-Clause", + "dependencies": { + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.15.0", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/terser/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "license": "MIT" + }, + "node_modules/throat": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/throat/-/throat-5.0.0.tgz", + "integrity": "sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA==", + "license": "MIT" + }, + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinyglobby/node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", + "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/tmpl": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", + "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", + "license": "BSD-3-Clause" + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/toqr": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/toqr/-/toqr-0.1.1.tgz", + "integrity": "sha512-FWAPzCIHZHnrE/5/w9MPk0kK25hSQSH2IKhYh9PyjS3SG/+IEMvlwIHbhz+oF7xl54I+ueZlVnMjyzdSwLmAwA==", + "license": "MIT" + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "license": "MIT" + }, + "node_modules/type-fest": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.7.1.tgz", + "integrity": "sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg==", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=8" + } + }, + "node_modules/typescript": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", + "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", + "devOptional": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/ua-parser-js": { + "version": "1.0.41", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.41.tgz", + "integrity": "sha512-LbBDqdIC5s8iROCUjMbW1f5dJQTEFB1+KO9ogbvlb3nm9n4YHa5p4KTvFPWvh2Hs8gZMBuiB1/8+pdfe/tDPug==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/ua-parser-js" + }, + { + "type": "paypal", + "url": "https://paypal.me/faisalman" + }, + { + "type": "github", + "url": "https://github.com/sponsors/faisalman" + } + ], + "license": "MIT", + "bin": { + "ua-parser-js": "script/cli.js" + }, + "engines": { + "node": "*" + } + }, + "node_modules/undici-types": { + "version": "8.9.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.9.0.tgz", + "integrity": "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==", + "license": "MIT" + }, + "node_modules/unicode-canonical-property-names-ecmascript": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.1.tgz", + "integrity": "sha512-dA8WbNeb2a6oQzAQ55YlT5vQAWGV9WXOsi3SskE3bcCdM0P4SDd+24zS/OCacdRq5BkdsRj9q3Pg6YyQoxIGqg==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-match-property-ecmascript": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz", + "integrity": "sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==", + "license": "MIT", + "dependencies": { + "unicode-canonical-property-names-ecmascript": "^2.0.0", + "unicode-property-aliases-ecmascript": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-match-property-value-ecmascript": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.2.1.tgz", + "integrity": "sha512-JQ84qTuMg4nVkx8ga4A16a1epI9H6uTXAknqxkGF/aFfRLw1xC/Bp24HNLaZhHSkWd3+84t8iXnp1J0kYcZHhg==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-property-aliases-ecmascript": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.2.0.tgz", + "integrity": "sha512-hpbDzxUY9BFwX+UeBnxv3Sh1q7HFxj48DTmXchNgRa46lO8uj3/1iEn3MiNUYTg1g9ctIqXCCERn8gYZhHC5lQ==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.4.0.tgz", + "integrity": "sha512-WPJuOnjI9FWDct4fB+ej4Mz8opLaw5CDcZ2t44tFZ0vIQVYWzBhWR3mkixuUj/A7+vY4V9+ApOZ2YYLwdgq46w==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/validate-npm-package-name": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-5.0.1.tgz", + "integrity": "sha512-OljLrQ9SQdOUqTaQxqL5dEfZWrXExyyWsozYlAWFawPVNuD83igl7uJD2RTkNMbniIYgt8l81eCJGIdQF7avLQ==", + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/vlq": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/vlq/-/vlq-1.0.1.tgz", + "integrity": "sha512-gQpnTgkubC6hQgdIcRdYGDSDc+SaujOdyesZQMv6JlfQee/9Mp0Qhnys6WxDWvQnL5WZdT7o2Ul187aSt0Rq+w==", + "license": "MIT" + }, + "node_modules/walker": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", + "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", + "license": "Apache-2.0", + "dependencies": { + "makeerror": "1.0.12" + } + }, + "node_modules/wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", + "license": "MIT", + "dependencies": { + "defaults": "^1.0.3" + } + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "license": "BSD-2-Clause" + }, + "node_modules/whatwg-fetch": { + "version": "3.6.20", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.6.20.tgz", + "integrity": "sha512-EqhiFU6daOA8kpjOWTL0olhVOF3i7OrFzSYiGsEMB8GcXS+RrzauAERX65xMeNWVqxA6HXH2m69Z9LaKKdisfg==", + "license": "MIT" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "license": "MIT", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/whatwg-url-minimum": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/whatwg-url-minimum/-/whatwg-url-minimum-0.2.0.tgz", + "integrity": "sha512-BtjXU1caNcCFfETP2DhqSeVPfRDl2MTUitI107RE34rJXjR/izfUtR5IoTFOK1WqjNLXbbeqaCH/mQAOLjpc8g==", + "license": "MIT" + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/ws": { + "version": "7.5.14", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.14.tgz", + "integrity": "sha512-u9Oi2nQ8SZnTUAf6spLLKF5TyqoG3Nbbrd4ai6Sjo4P24bycDewhQqtNMIg4bFpnpH/TD4qk4IuAVhT0HIIqug==", + "license": "MIT", + "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 + } + } + }, + "node_modules/xcode": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xcode/-/xcode-4.0.0.tgz", + "integrity": "sha512-dDaoWzc9EP2fp9FS9PVZUkyvFxY4y1TOV9pcKaKLk++Ei/qb97XDFEVP7GnW7Osii/TzVABJ0jq2F+9/lq0TVA==", + "license": "Apache-2.0", + "dependencies": { + "simple-plist": "^1.3.1" + }, + "engines": { + "node": ">=14.17.0" + } + }, + "node_modules/xml2js": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.6.0.tgz", + "integrity": "sha512-eLTh0kA8uHceqesPqSE+VvO1CDDJWMwlQfB6LuN6T8w6MaDJ8Txm8P7s5cHD0miF0V+GGTZrDQfxPZQVsur33w==", + "license": "MIT", + "dependencies": { + "sax": ">=0.6.0", + "xmlbuilder": "~11.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/xml2js/node_modules/xmlbuilder": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", + "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", + "license": "MIT", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/xmlbuilder": { + "version": "15.1.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-15.1.1.tgz", + "integrity": "sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg==", + "license": "MIT", + "engines": { + "node": ">=8.0" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "license": "ISC" + }, + "node_modules/yargs": { + "version": "17.7.3", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.3.tgz", + "integrity": "sha512-GZtjxm/J/4TSxuL3FNYjCmLktBTnIw/rVmKSIyKeYAZpmJB2ig9VauCC5xsa82GNKVKDAqpOn3KVzNt0zmrU0g==", + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/zxing-wasm": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/zxing-wasm/-/zxing-wasm-3.1.8.tgz", + "integrity": "sha512-FpxLK7/lfZrlnmqoRUZd+4qpVlYabsuPx6tRxzN7V/E9IwijQ1dOJSlJGHoA2Yc62hkdvzDD8+qjRPGUx+5j+g==", + "license": "MIT", + "dependencies": { + "@types/emscripten": "^1.41.6" + }, + "peerDependencies": { + "@types/emscripten": ">=1.39.6" + } + } + } +} diff --git a/mobile/package.json b/mobile/package.json new file mode 100644 index 00000000..b69a522e --- /dev/null +++ b/mobile/package.json @@ -0,0 +1,36 @@ +{ + "name": "mobile", + "version": "1.0.0", + "main": "index.ts", + "dependencies": { + "@expo/metro-runtime": "~58.0.17", + "@react-native-async-storage/async-storage": "2.2.0", + "diff": "^9.0.0", + "expo": "~58.0.26", + "expo-camera": "~58.0.14", + "expo-clipboard": "~58.0.4", + "expo-secure-store": "~58.0.3", + "expo-status-bar": "~58.0.5", + "lucide-react-native": "^1.80.0", + "react": "19.3.0", + "react-dom": "19.3.0", + "react-native": "0.88.1", + "react-native-keyboard-controller": "1.22.7", + "react-native-reanimated": "4.7.1", + "react-native-safe-area-context": "~5.11.1", + "react-native-svg": "15.16.0", + "react-native-web": "^0.21.4", + "react-native-worklets": "0.13.0" + }, + "devDependencies": { + "@types/react": "~19.3.0", + "typescript": "~6.0.3" + }, + "scripts": { + "start": "expo start", + "android": "expo start --android", + "ios": "expo start --ios", + "web": "expo start --web" + }, + "private": true +} diff --git a/mobile/scripts/gen-themes.mjs b/mobile/scripts/gen-themes.mjs new file mode 100644 index 00000000..21a201e3 --- /dev/null +++ b/mobile/scripts/gen-themes.mjs @@ -0,0 +1,66 @@ +// Generates src/themes.generated.ts from the desktop's +// src/renderer/styles.css, so the app's palettes are the desktop's built-in +// themes exactly. Run from mobile/: `node scripts/gen-themes.mjs`. +// test/theme.test.ts fails when the committed file is stale. +// +// Cascade, same as the browser: the `@theme { … }` block is the default +// (Dark); each `[data-theme=""] { … }` block overrides tokens on top of +// it. `var(--color-x)` values resolve within the same theme. +import { readFileSync, writeFileSync } from 'node:fs' +import { dirname, join } from 'node:path' +import { fileURLToPath, pathToFileURL } from 'node:url' + +const here = dirname(fileURLToPath(import.meta.url)) +export const OUTPUT = join(here, '../src/themes.generated.ts') + +/** The generated module's source, and the palettes it holds. */ +export function generate() { + const css = readFileSync(join(here, '../../src/renderer/styles.css'), 'utf8') + + const blockAfter = (start) => { + const open = css.indexOf('{', start) + let depth = 0 + for (let i = open; i < css.length; i++) { + if (css[i] === '{') depth++ + else if (css[i] === '}' && --depth === 0) return css.slice(open + 1, i) + } + throw new Error('unbalanced block') + } + + const colorVars = (block) => { + const out = {} + for (const m of block.matchAll(/--color-([a-z-]+)\s*:\s*([^;]+);/g)) out[m[1]] = m[2].trim() + return out + } + + const base = colorVars(blockAfter(css.indexOf('@theme {'))) + const themes = { dark: { ...base } } + for (const m of css.matchAll(/^\[data-theme="([a-z0-9-]+)"\]\s*\{/gm)) { + themes[m[1]] = { ...base, ...(themes[m[1]] ?? {}), ...colorVars(blockAfter(m.index)) } + } + + const resolve = (t, v, depth = 0) => { + const ref = /^var\(--color-([a-z-]+)\)$/.exec(v) + if (!ref || depth > 5) return v + return resolve(t, t[ref[1]] ?? v, depth + 1) + } + for (const t of Object.values(themes)) for (const k of Object.keys(t)) t[k] = resolve(t, t[k]) + + const camel = (k) => k.replace(/-([a-z])/g, (_, ch) => ch.toUpperCase()) + const palettes = {} + for (const [id, t] of Object.entries(themes)) { + palettes[id] = Object.fromEntries(Object.entries(t).filter(([, v]) => /^#|^rgb/.test(v)).map(([k, v]) => [camel(k), v])) + } + + const source = `// GENERATED by scripts/gen-themes.mjs from src/renderer/styles.css — do not +// edit; regenerate when the desktop's themes change. +export const BUILT_IN_PALETTES: Record> = ${JSON.stringify(palettes, null, 2)} +` + return { source, palettes } +} + +if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) { + const { source, palettes } = generate() + writeFileSync(OUTPUT, source) + console.log(Object.keys(palettes).length, 'themes:', Object.keys(palettes).join(', ')) +} diff --git a/mobile/src/ambient.d.ts b/mobile/src/ambient.d.ts new file mode 100644 index 00000000..0699551c --- /dev/null +++ b/mobile/src/ambient.d.ts @@ -0,0 +1,10 @@ +// theme.ts imports renderer/theme-apply, whose type-only import of +// hooks/useActiveTheme pulls renderer/store.ts into the typecheck (not the +// bundle). That module reads this desktop global, declared in the +// renderer's own ambient.d.ts, which isn't part of this project. +export {} +declare global { + interface Window { + __HARNESS_WEB__?: boolean + } +} diff --git a/mobile/src/backends.ts b/mobile/src/backends.ts new file mode 100644 index 00000000..14395e50 --- /dev/null +++ b/mobile/src/backends.ts @@ -0,0 +1,85 @@ +// Saved backends + one live NessClient per *enabled* backend. Disabling a +// backend closes its socket; the entry (and its token) stays saved. +import { useCallback, useEffect, useRef, useState } from 'react' +import { NessClient } from './ness' +import { labelFor, loadBackends, newId, saveBackends, type SavedBackend } from './storage' + +export interface Backends { + loaded: boolean + saved: SavedBackend[] + clients: NessClient[] + add: (b: { wsUrl: string; token: string; label?: string }) => void + setEnabled: (id: string, enabled: boolean) => void + remove: (id: string) => void +} + +export function useBackends(): Backends { + const [saved, setSaved] = useState(null) + const [clients, setClients] = useState([]) + const live = useRef(new Map()) + + useEffect(() => { + void loadBackends().then(setSaved) + }, []) + + // Reconcile live clients with the enabled set. + useEffect(() => { + if (!saved) return + const map = live.current + const want = new Map(saved.filter((b) => b.enabled).map((b) => [b.id, b])) + for (const [id, client] of map) { + const b = want.get(id) + // Re-create if the URL, token or label changed (re-pairing a host). + if (!b || client.wsUrl !== b.wsUrl || client.token !== b.token || client.label !== b.label) { + client.close() + map.delete(id) + } + } + for (const b of want.values()) { + if (map.has(b.id)) continue + const client = new NessClient(b.id, b.label, b.wsUrl, b.token) + client.connect() + map.set(b.id, client) + } + setClients(saved.filter((b) => map.has(b.id)).map((b) => map.get(b.id)!)) + }, [saved]) + + // Clear the map too: Fast Refresh (and any remount) runs this cleanup and + // then the reconcile effect again. Leaving closed clients in the map made + // reconcile keep them, so a backend sat at its last "close code 1000" + // forever instead of reconnecting. + useEffect( + () => () => { + live.current.forEach((c) => c.close()) + live.current.clear() + }, + [] + ) + + const update = useCallback((fn: (list: SavedBackend[]) => SavedBackend[]) => { + setSaved((prev) => { + const next = fn(prev ?? []) + void saveBackends(next) + return next + }) + }, []) + + return { + loaded: saved !== null, + saved: saved ?? [], + clients, + add: ({ wsUrl, token, label }) => + update((list) => { + // Same host re-paired (e.g. after a token rotate) → replace in place. + const existing = list.find((b) => b.wsUrl === wsUrl) + if (existing) { + return list.map((b) => + b.id === existing.id ? { ...b, token, enabled: true, id: newId(), label: label || b.label } : b + ) + } + return [...list, { id: newId(), label: label || labelFor(wsUrl), wsUrl, token, enabled: true }] + }), + setEnabled: (id, enabled) => update((list) => list.map((b) => (b.id === id ? { ...b, enabled } : b))), + remove: (id) => update((list) => list.filter((b) => b.id !== id)) + } +} diff --git a/mobile/src/chat/ApprovalCard.tsx b/mobile/src/chat/ApprovalCard.tsx new file mode 100644 index 00000000..63223567 --- /dev/null +++ b/mobile/src/chat/ApprovalCard.tsx @@ -0,0 +1,431 @@ +// Port of JsonClaudeApprovalCard.tsx + JsonClaudeQuestionCard.tsx. Same +// modes, labels, conditions and channels; the summary text, tool display, +// permission-pattern ladder and question encoding all come from the +// shared/renderer modules the desktop card uses. Buttons use the desktop's +// mobile sizing (px-3.5 py-2.5) bumped to a 44pt minimum. +import { useMemo, useState, type ReactNode } from 'react' +import { Pressable, Text, TextInput, View } from 'react-native' +import { Check, Circle, Square, SquareCheck } from 'lucide-react-native' +import { EDIT_TOOL_NAMES, type JsonClaudePendingApproval, type JsonClaudeSession } from '../../../src/shared/state/json-claude' +import { getChatCapabilities } from '../../../src/shared/agent-registry' +import { suggestPermissionPatterns } from '../../../src/shared/permission-patterns' +import { buildQuestionResult, parseQuestions, type QuestionAnswer } from '../../../src/shared/ask-user-question' +import { formatPendingTool } from '../../../src/renderer/pending-tool' +import { extractArgs, getToolDisplay, prettyToolName } from '../../../src/renderer/components/json-mode-cards/tool-display' +import type { NessClient } from '../ness' +import { alpha, c, fs, mono, getThemeMode } from '../theme' +import { Spin } from '../components/Spin' +import { Loader2 } from 'lucide-react-native' +import { ToolIcon } from './cards' + +type Resolution = { + behavior: 'allow' | 'deny' + updatedInput?: Record + message?: string + interrupt?: boolean +} + +export function ApprovalSlot({ + approval, + client, + session +}: { + approval: JsonClaudePendingApproval + client: NessClient + session: JsonClaudeSession | undefined +}) { + const onResolve = (r: Resolution) => client.api.resolveJsonClaudeApproval(approval.requestId, r) + if (approval.toolName === 'AskUserQuestion') return + return +} + +type Mode = 'summary' | 'edit-input' | 'always' | 'deny' | 'edit-guidance' + +function ApprovalCard({ + approval, + client, + session, + onResolve +}: { + approval: JsonClaudePendingApproval + client: NessClient + session: JsonClaudeSession | undefined + onResolve: (r: Resolution) => Promise +}) { + const [mode, setMode] = useState('summary') + const [busy, setBusy] = useState(false) + const display = useMemo(() => getToolDisplay(approval.toolName), [approval.toolName]) + const args = useMemo(() => extractArgs(approval.input), [approval.input]) + const caps = getChatCapabilities(session?.agentKind) + const suggestions = useMemo(() => suggestPermissionPatterns(approval.toolName, approval.input), [approval.toolName, approval.input]) + const [selectedLabel, setSelectedLabel] = useState(() => suggestions[0]?.label ?? approval.toolName) + const selected = suggestions.find((x) => x.label === selectedLabel) ?? suggestions[0] + const [editJson, setEditJson] = useState(() => JSON.stringify(approval.input, null, 2)) + const [editError, setEditError] = useState(null) + const [denyReason, setDenyReason] = useState('') + const [denyInterrupt, setDenyInterrupt] = useState(false) + const savedGuidance = client.getState().settings.autoApproveSteerInstructions ?? '' + const [guidance, setGuidance] = useState(savedGuidance) + const [guidanceSaved, setGuidanceSaved] = useState(false) + + const isEditTool = (EDIT_TOOL_NAMES as readonly string[]).includes(approval.toolName) + const sessionGrantLabel = isEditTool ? 'Allow edits this session' : `Allow ${prettyToolName(approval.toolName)} this session` + // Edit tools flip the permission mode (no restart since 2.1.x), except + // in 'auto' where that would downgrade the whole session. + const grantViaPermissionMode = isEditTool && session?.permissionMode !== 'auto' + const alreadyGranted = grantViaPermissionMode + ? session?.permissionMode === 'acceptEdits' + : !!session && session.sessionToolApprovals.includes(approval.toolName) + + const run = (fn: () => Promise) => { + setBusy(true) + fn().finally(() => setBusy(false)) + } + const allow = () => run(() => onResolve({ behavior: 'allow', updatedInput: approval.input })) + const allowSession = () => + run(async () => { + // Resolve first, so the bridge answers before any respawn. + await onResolve({ behavior: 'allow', updatedInput: approval.input }) + if (grantViaPermissionMode) await client.api.setJsonClaudePermissionMode(approval.sessionId, 'acceptEdits') + else await client.api.grantJsonClaudeSessionToolApprovals(approval.sessionId, isEditTool ? [...EDIT_TOOL_NAMES] : [approval.toolName]) + }) + const alwaysAllow = () => { + if (!selected) return + run(async () => { + void client.api.grantPermission(selected.rule, session?.worktreePath) + await onResolve({ behavior: 'allow', updatedInput: approval.input }) + }) + } + const allowEdited = () => { + try { + const parsed = JSON.parse(editJson) as Record + run(() => onResolve({ behavior: 'allow', updatedInput: parsed })) + } catch (e) { + setEditError(`Invalid JSON: ${(e as Error).message}`) + } + } + const deny = () => + run(() => onResolve({ behavior: 'deny', message: denyReason.trim() || 'user denied', interrupt: denyInterrupt })) + + const autoReview = approval.autoReview + const cmd = typeof approval.input?.command === 'string' ? approval.input.command : null + const description = typeof approval.input?.description === 'string' ? approval.input.description : null + + return ( + + + NEEDS APPROVAL + + + {formatPendingTool({ name: approval.toolName, input: approval.input })} + + + + {autoReview?.state === 'pending' && ( + + + + + Asking auto-approver… + + )} + {autoReview?.state === 'finished' && autoReview.decision === 'ask' && ( + + + Auto-approver: + {autoReview.reason || 'deferred'} + + {mode !== 'edit-guidance' && ( + { + setGuidance(savedGuidance) + setGuidanceSaved(false) + setMode('edit-guidance') + }} + /> + )} + + )} + + + {mode === 'edit-guidance' && ( + <> + + Project-specific guidance appended to the auto-approver's policy. Save to persist for future requests; "Save & + re-review" also re-runs the reviewer on this request right now. + + + + + run(async () => { + setGuidanceSaved(true) + await client.api.setAutoApproveSteerInstructions(guidance) + await client.api.rerunJsonClaudeAutoApprovalReview(approval.requestId) + setMode('summary') + }) + } + /> + run(async () => { + await client.api.setAutoApproveSteerInstructions(guidance) + setGuidanceSaved(true) + })} + /> + setMode('summary')} /> + {guidanceSaved && Saved} + + + )} + + {mode === 'summary' && ( + <> + {cmd !== null ? ( + + + {description && {description}} + + ) : args.length > 0 ? ( + + {args.map((a) => ( + + {a.key} + + {a.value} + + + ))} + + ) : ( + No input. + )} + + + {!alreadyGranted && } + {caps.approvalEditInput && setMode('edit-input')} />} + {suggestions.length > 0 && setMode('always')} />} + setMode('deny')} /> + + + )} + + {mode === 'edit-input' && ( + <> + { setEditJson(v); setEditError(null) }} multiline mono /> + {editError && {editError}} + + + setMode('summary')} /> + + + )} + + {mode === 'always' && ( + <> + {suggestions.map((sg) => ( + setSelectedLabel(sg.label)} style={{ flexDirection: 'row', alignItems: 'center', gap: 8, minHeight: 44 }}> + {selectedLabel === sg.label ? : } + {sg.label} + + {sg.scope} + + + ))} + + + setMode('summary')} /> + + + )} + + {mode === 'deny' && ( + <> + {caps.approvalDenyReason && ( + + )} + setDenyInterrupt(!denyInterrupt)} style={{ flexDirection: 'row', alignItems: 'center', gap: 8, minHeight: 44 }}> + {denyInterrupt ? : } + Interrupt turn (abort the model's current response) + + + + setMode('summary')} /> + + + )} + + + ) +} + +// ── AskUserQuestion ───────────────────────────────────────────────────── + +const EMPTY: QuestionAnswer = { selected: [], custom: '' } + +function QuestionCard({ approval, onResolve }: { approval: JsonClaudePendingApproval; onResolve: (r: Resolution) => Promise }) { + const questions = useMemo(() => parseQuestions(approval.input), [approval.input]) + const [answers, setAnswers] = useState>({}) + const [replying, setReplying] = useState(false) + const [reply, setReply] = useState('') + const answered = questions.filter((q) => { + const a = answers[q.question] + return a && (a.selected.length > 0 || a.custom.trim() !== '') + }).length + const update = (q: string, patch: Partial) => setAnswers((p) => ({ ...p, [q]: { ...EMPTY, ...p[q], ...patch } })) + const toggle = (q: string, label: string, multi: boolean) => { + const cur = answers[q]?.selected ?? [] + update(q, { selected: multi ? (cur.includes(label) ? cur.filter((l) => l !== label) : [...cur, label]) : [label], custom: '' }) + } + + if (questions.length === 0) { + return ( + + Claude asked a question this client can't read. + void onResolve({ behavior: 'deny', message: 'malformed question' })} /> + + ) + } + return ( + + {questions.map((q) => { + const a = answers[q.question] ?? EMPTY + return ( + + {q.header && {q.header}} + {q.question} + {q.options.map((o) => { + const on = a.selected.includes(o.label) + const Icon = q.multiSelect ? (on ? SquareCheck : Square) : on ? Check : Circle + return ( + toggle(q.question, o.label, !!q.multiSelect)} style={{ flexDirection: 'row', gap: 8, minHeight: 44, alignItems: 'center' }}> + + + {o.label} + {o.description && {o.description}} + + + ) + })} + update(q.question, { custom: v, selected: v ? [] : a.selected })} placeholder="Other…" /> + + ) + })} + {replying ? ( + <> + + + void onResolve(buildQuestionResult(approval.input, questions, answers, reply))} /> + setReplying(false)} /> + + + ) : ( + + 0 && answered < questions.length ? `Submit ${answered} of ${questions.length}` : 'Submit'} + primary + disabled={answered === 0} + onPress={() => void onResolve(buildQuestionResult(approval.input, questions, answers))} + /> + setReplying(true)} /> + void onResolve(buildQuestionResult(approval.input, questions, {}))} /> + + )} + + ) +} + +// ── bits ──────────────────────────────────────────────────────────────── + +function Strip({ children }: { children: ReactNode }) { + return ( + + {children} + + ) +} + +function Row({ children }: { children: ReactNode }) { + return {children} +} + +function Code({ text }: { text: string }) { + return ( + + + {text} + + + ) +} + +function Field({ value, onChange, placeholder, multiline, mono: isMono }: { value: string; onChange: (v: string) => void; placeholder?: string; multiline?: boolean; mono?: boolean }) { + return ( + + ) +} + +export function Btn({ + label, + onPress, + primary, + danger, + disabled, + small +}: { + label: string + onPress: () => void + primary?: boolean + danger?: boolean + disabled?: boolean + small?: boolean +}) { + return ( + ({ + minHeight: small ? 28 : 44, + justifyContent: 'center', + paddingHorizontal: small ? 8 : 14, + borderRadius: 4, + borderWidth: 1, + borderColor: primary ? c.accent : danger ? alpha(c.danger, 0.4) : c.border, + backgroundColor: primary ? c.accent : danger ? alpha(c.danger, pressed ? 0.25 : 0.1) : pressed ? c.panelRaised : c.panel, + opacity: disabled ? 0.4 : 1 + })} + > + {label} + + ) +} diff --git a/mobile/src/chat/ChatImage.tsx b/mobile/src/chat/ChatImage.tsx new file mode 100644 index 00000000..e50444c5 --- /dev/null +++ b/mobile/src/chat/ChatImage.tsx @@ -0,0 +1,187 @@ +// Port of JsonModeChatImageThumb: chat images are files on the backend's +// machine (tool screenshots, pasted attachments, markdown image paths), so +// they're fetched through `jsonClaude:readAttachmentImage` (base64) and +// shown as a data URI. Remote http(s) URLs load directly. Tap opens a +// full-screen view; tap again to close (same as the web thumb). +import { createContext, useContext, useEffect, useState, useSyncExternalStore } from 'react' + +const noopSubscribe = () => () => {} +import { ActivityIndicator, Image, Modal, Pressable, ScrollView, Text, View, useWindowDimensions } from 'react-native' +import { ImageOff, X } from 'lucide-react-native' +import type { NessClient } from '../ness' +import type { ImageSizeHint } from '../../../src/shared/chat-image-src' +import { c } from '../theme' + +/** The chat's backend, so deep components (Markdown) can fetch images. */ +export const ChatClientContext = createContext(null) + +// Data URIs are big; keep a bounded cache per backend so scrolling back +// through a screenshot-heavy transcript doesn't refetch everything. +const LIMIT = 60 +const cache = new Map() +const inflight = new Map>() + +function mediaTypeFor(path: string, given?: string): string { + if (given) return given + const ext = path.split('.').pop()?.toLowerCase() + return ext === 'jpg' || ext === 'jpeg' ? 'image/jpeg' : ext === 'gif' ? 'image/gif' : ext === 'webp' ? 'image/webp' : 'image/png' +} + +/** `undefined` = the request failed (socket not up yet, dropped, timed + * out) — transient, so NOT cached: caching it left an image stuck on + * "unavailable" until the chat was reopened. `null` = the backend + * answered and there's no such image (missing / too big) — that's final. */ +const FAILED = undefined +function load(client: NessClient, path: string, mediaType?: string): Promise { + if (/^https?:\/\//.test(path) || path.startsWith('data:')) return Promise.resolve(path) + const key = `${client.id}:${path}` + if (cache.has(key)) return Promise.resolve(cache.get(key) ?? null) + let p = inflight.get(key) + if (!p) { + p = client + .api.readJsonClaudeAttachmentImage(path) + .then( + (b64) => { + const uri = b64 ? `data:${mediaTypeFor(path, mediaType)};base64,${b64}` : null + cache.set(key, uri) + while (cache.size > LIMIT) cache.delete(cache.keys().next().value as string) + return uri + }, + () => FAILED + ) + .finally(() => inflight.delete(key)) + inflight.set(key, p) + } + return p +} + +export function ChatImage({ + path, + mediaType, + height = 96, + maxWidth = 160, + alt, + size, + fit +}: { + path: string + mediaType?: string + height?: number + maxWidth?: number + alt?: string + /** Markdown size hint (px / % of the column / height). */ + size?: ImageSizeHint + /** Inline markdown image: size to the column (or the hint) at the + * image's own aspect ratio, instead of a fixed-height thumbnail. */ + fit?: boolean +}) { + const client = useContext(ChatClientContext) + // Re-run the load when the backend (re)connects. + const connected = useSyncExternalStore( + client?.subscribe ?? noopSubscribe, + () => client?.getConn().connected ?? false + ) + const [uri, setUri] = useState(undefined) + const [aspect, setAspect] = useState(4 / 3) + const [open, setOpen] = useState(false) + const win = useWindowDimensions() + + useEffect(() => { + if (!client) { + // Outside a chat there's no backend to read local files from. + setUri(/^(https?:|data:)/.test(path) ? path : null) + return + } + if (!connected) return // retried by this effect when the socket is back + let alive = true + let retry: ReturnType | undefined + const attempt = (left: number) => + void load(client, path, mediaType).then((u) => { + if (!alive) return + if (u !== FAILED) setUri(u) + else if (left > 0) retry = setTimeout(() => attempt(left - 1), 2000) + else setUri(null) + }) + attempt(2) + return () => { + alive = false + if (retry) clearTimeout(retry) + } + }, [client, path, mediaType, connected]) + + useEffect(() => { + if (uri) Image.getSize(uri, (w, h) => h > 0 && setAspect(w / h), () => {}) + }, [uri]) + + // The chat column is the screen minus the transcript's 16pt gutters. + const column = win.width - 32 + let width: number + let h: number + if (fit) { + const hinted = size?.widthPercent ? (column * size.widthPercent) / 100 : size?.width + width = Math.min(column, hinted ?? column) + h = size?.height ?? Math.round(width / aspect) + if (size?.height && !hinted) width = Math.min(column, Math.round(size.height * aspect)) + } else { + width = Math.min(maxWidth, Math.round(height * aspect)) + h = height + } + if (uri === undefined) { + return ( + + + + ) + } + if (uri === null) { + return ( + + + + {path.split('/').pop()} + + + ) + } + return ( + <> + setOpen(true)} accessibilityRole="imagebutton" accessibilityLabel={alt ? `Open image: ${alt}` : 'Open image'}> + + + setOpen(false)} supportedOrientations={['portrait', 'landscape']}> + setOpen(false)} accessibilityLabel="Close image"> + + + + + + + + + + ) +} + +/** A row of thumbnails (the web's CollapsedImageStrip / attachment row). */ +export function ImageStrip({ images, height = 72, max = 8 }: { images: { path: string; mediaType?: string }[]; height?: number; max?: number }) { + if (!images.length) return null + return ( + + {images.slice(0, max).map((img) => ( + + ))} + + ) +} diff --git a/mobile/src/chat/Composer.tsx b/mobile/src/chat/Composer.tsx new file mode 100644 index 00000000..9756fa4f --- /dev/null +++ b/mobile/src/chat/Composer.tsx @@ -0,0 +1,282 @@ +// Port of JsonModeChat's composer: state dot + text, the permission-mode +// pill (tap cycles, mid-turn), interrupt / interrupt & send while busy, +// Send, first-keystroke wake for an asleep tab, the debounced +// touchLastActive, and the `/` command popover with the two-stage +// `/model` picker. Differences on purpose: no hotkey hints (no keyboard), +// and Return inserts a newline unless the user turned on send-on-Enter, +// matching the web's default. +import { useMemo, useRef, useState } from 'react' +import { Keyboard, Pressable, ScrollView, Text, TextInput, View } from 'react-native' +import { Square } from 'lucide-react-native' +import type { JsonClaudeSession } from '../../../src/shared/state/json-claude' +import { CLAUDE_MODELS, getAgentInfo, getChatCapabilities } from '../../../src/shared/agent-registry' +import { fuzzyMatch } from '../../../src/renderer/fuzzy' +import type { NessClient } from '../ness' +import { useNess } from '../ness' +import { alpha, c, fs, themed, getThemeMode } from '../theme' + +const MODES = ['default', 'acceptEdits', 'plan', 'auto'] as const +const MODE_STYLE: Record = themed(() => ({ + default: { label: 'ask every time', color: null }, + acceptEdits: { label: 'accept edits', color: c.success }, + plan: { label: 'plan', color: c.accent }, + auto: { label: 'auto', color: c.warning } +})) +const BUILTIN_DESCRIPTIONS: Record = { + clear: 'Reset the conversation context', + compact: 'Summarize and compact prior messages', + context: 'Show context window usage' +} + +interface PopItem { + key: string + title: string + detail?: string + pick: () => void +} + +export function Composer({ + client, + session, + sessionId, + worktreePath, + mode, + onSent +}: { + client: NessClient + session: JsonClaudeSession | undefined + sessionId: string + worktreePath: string + mode: 'awake' | 'asleep' + /** Fired on every send, like the web's takeDraft: the transcript snaps + * back to the bottom so your own message is in view. */ + onSent?: () => void +}) { + const sendOnEnter = useNess(client, (s) => !!s.settings.jsonModeSendOnEnter) + const [draft, setDraft] = useState('') + const inputRef = useRef>(null) + const [focused, setFocused] = useState(false) + const [popDismissed, setPopDismissed] = useState(null) + const woke = useRef(false) + const lastTouch = useRef(0) + const caps = getChatCapabilities(session?.agentKind) + // The web says "Message Claude", not the registry's "Claude Code". + const agentName = (session?.agentKind ?? 'claude') === 'claude' ? 'Claude' : getAgentInfo(session!.agentKind!).displayName + + const state = session?.state ?? (mode === 'asleep' ? 'asleep' : 'connecting') + const exited = session?.state === 'exited' + const stateDot = state === 'running' ? c.success : state === 'connecting' ? c.warning : state === 'exited' ? c.danger : c.faint + const busy = !!session?.busy + const permissionMode = session?.permissionMode ?? 'default' + const ms = MODE_STYLE[permissionMode] ?? MODE_STYLE.default + + if (mode !== 'asleep') woke.current = false + + const onChange = (t: string) => { + setDraft(t) + setPopDismissed(null) + // First keystroke into an asleep tab wakes it (re-armed on next sleep). + if (mode === 'asleep' && !woke.current) { + woke.current = true + void client.api.panesWakeTab(worktreePath, sessionId) + } + const now = Date.now() + if (now - lastTouch.current > 5000) { + lastTouch.current = now + void client.api.touchWorktreeLastActive(worktreePath) + } + } + + // Collapse the composer once a message is away: dropping the keyboard + // brings the box back to the bottom edge and the transcript into view. + // Slash-popover picks that only change the draft don't come through here. + const afterSend = () => { + // Blur the field itself (not just Keyboard.dismiss) and do it after + // the cleared draft has rendered, so the re-render can't leave focus — + // and the keyboard — on the composer. + requestAnimationFrame(() => { + inputRef.current?.blur() + Keyboard.dismiss() + }) + onSent?.() + } + + const sendText = (text: string) => { + const trimmed = text.trim() + if (!trimmed || exited) return false + const model = /^\/model\s+(\S+)\s*$/.exec(trimmed) + if (model && caps.modelPicker) { + void client.api.setJsonClaudeTabModel(sessionId, model[1]) + } else { + client.api.sendJsonClaudeMessage(sessionId, trimmed) + } + setDraft('') + afterSend() + return true + } + + // ── slash popover ── + const slash = /(^|\s)\/([a-zA-Z0-9:-]*)$/.exec(draft) + const modelStage = /^\/model\s+(\S*)$/.exec(draft) + const popItems = useMemo(() => { + if (exited || !session) return [] + if (modelStage && caps.modelPicker) { + const models = session.availableModels ?? CLAUDE_MODELS + const q = modelStage[1] + const ranked = q ? fuzzyMatch(q, models.map((m) => m.id)).map((r) => models.find((m) => m.id === r.item)!) : models + const pickModel = (id: string) => { + void client.api.setJsonClaudeTabModel(sessionId, id) + setDraft('') + } + return [ + { key: '(default)', title: '(Default)', pick: () => pickModel('') }, + ...ranked.slice(0, 50).map((m) => ({ + key: m.id, + title: m.displayName ?? m.id, + detail: `${m.id}${m.id === session.currentModel ? ' · current' : ''}${(m as { tier?: string }).tier === 'legacy' ? ' · legacy' : ''}`, + pick: () => pickModel(m.id) + })) + ] + } + if (!slash) return [] + const q = slash[2] + const names = session.slashCommands ?? [] + const ranked = q ? fuzzyMatch(q, names).map((r) => r.item) : names + const out: PopItem[] = [] + if (caps.modelPicker && (!q || 'model'.startsWith(q))) { + out.push({ key: '/model', title: '/model', detail: `Change model — currently ${session.currentModel ?? 'default'}`, pick: () => setDraft('/model ') }) + } + for (const name of ranked.slice(0, 50)) { + out.push({ + key: name, + title: `/${name}`, + detail: BUILTIN_DESCRIPTIONS[name], + pick: () => { + // Whole draft is the command → send it; otherwise insert. + if (draft.trim() === `/${q}`) sendText(`/${name}`) + else setDraft(draft.replace(/\/[a-zA-Z0-9:-]*$/, `/${name} `)) + } + }) + } + return out + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [draft, session?.slashCommands, session?.availableModels, session?.currentModel, exited]) + const showPop = popItems.length > 0 && popDismissed !== draft + + const canSend = draft.trim().length > 0 && !exited + const placeholder = mode === 'asleep' ? 'Type to wake this session…' : `Message ${agentName}` + + return ( + + {showPop && ( + + + {popItems.map((it) => ( + { + it.pick() + // Keep typing after a pick (the tap took focus). + inputRef.current?.focus() + }} + style={({ pressed }) => ({ minHeight: 44, justifyContent: 'center', paddingHorizontal: 14, backgroundColor: pressed ? c.surface : 'transparent' })} + > + {it.title} + {it.detail ? ( + + {it.detail} + + ) : null} + + ))} + + setPopDismissed(draft)} style={{ position: 'absolute', right: 8, top: 6 }} hitSlop={12}> + esc + + + )} + + + setFocused(true)} + onBlur={() => setFocused(false)} + submitBehavior={sendOnEnter ? 'submit' : 'newline'} + returnKeyType={sendOnEnter ? 'send' : 'default'} + onSubmitEditing={sendOnEnter ? () => sendText(draft) : undefined} + /> + + {/* State + permission pill sit on the bottom edge of the row, + level with the bottom of the 44pt Send / interrupt buttons, + instead of floating mid-height beside them. */} + + + {state} + {caps.permissionModes && session && ( + { + const next = MODES[(MODES.indexOf(permissionMode as (typeof MODES)[number]) + 1) % MODES.length] + void client.api.setJsonClaudePermissionMode(sessionId, next) + }} + style={{ + borderWidth: 1, + borderRadius: 4, + paddingHorizontal: 6, + paddingVertical: 2, + backgroundColor: ms.color ? alpha(ms.color, 0.15) : c.surface, + borderColor: ms.color ? alpha(ms.color, 0.3) : c.border + }} + > + {ms.label} + + )} + + + {busy && ( + { + if (draft.trim()) { + void client.api.interruptAndSendJsonClaude(sessionId, draft.trim(), []) + setDraft('') + afterSend() + } else { + void client.api.interruptJsonClaude(sessionId) + } + }} + style={({ pressed }) => [btn, { backgroundColor: pressed ? c.surfaceHover : c.surface }]} + > + + {draft.trim() ? 'interrupt & send' : 'interrupt'} + + )} + sendText(draft)} disabled={!canSend} style={[btn, { backgroundColor: c.accent, opacity: canSend ? 1 : 0.4 }]}> + Send + + + + + + ) +} + +// The web's px-2.5 py-0.5 pill, at a 44pt thumb-sized height. +const btn = { flexDirection: 'row' as const, alignItems: 'center' as const, justifyContent: 'center' as const, gap: 5, borderRadius: 6, paddingHorizontal: 14, minHeight: 44, minWidth: 64 } diff --git a/mobile/src/chat/CopyText.tsx b/mobile/src/chat/CopyText.tsx new file mode 100644 index 00000000..6dc4faba --- /dev/null +++ b/mobile/src/chat/CopyText.tsx @@ -0,0 +1,99 @@ +// Copying chat text. The web chat gets free-form selection from the +// browser; React Native can't select across a message (iOS `selectable` +// only offers Copy for one whole Text). So, like the native chat apps: +// long-press a message for Copy / Select Text, and Select Text opens the +// message in a read-only text view, where iOS gives real selection handles, +// Select All, Look Up and Share. +import { createContext, useCallback, useContext, useState, type ReactNode } from 'react' +import { ActionSheetIOS, Alert, Modal, Platform, Pressable, Text, TextInput, View } from 'react-native' +import { useSafeAreaInsets } from 'react-native-safe-area-context' +import * as ExpoClipboard from 'expo-clipboard' +import { c, fs, getThemeMode } from '../theme' + +type OpenMenu = (text: string) => void +const CopyMenuContext = createContext(null) + +/** Hosts the menu and the Select Text sheet for a chat. Lives above the + * virtualized transcript so a row scrolling away doesn't close it. */ +export function CopyMenuHost({ children }: { children: ReactNode }) { + const [selecting, setSelecting] = useState(null) + const open = useCallback((text) => { + const copy = () => void ExpoClipboard.setStringAsync(text) + const select = () => setSelecting(text) + if (Platform.OS === 'ios') { + ActionSheetIOS.showActionSheetWithOptions( + { options: ['Copy', 'Select Text', 'Cancel'], cancelButtonIndex: 2, userInterfaceStyle: getThemeMode() }, + (i) => (i === 0 ? copy() : i === 1 ? select() : undefined) + ) + } else { + Alert.alert('Message', undefined, [ + { text: 'Copy', onPress: copy }, + { text: 'Select Text', onPress: select }, + { text: 'Cancel', style: 'cancel' } + ]) + } + }, []) + return ( + + {children} + setSelecting(null)} /> + + ) +} + +/** Wraps a message so a long-press opens the copy menu for `text`. Taps + * pass through to anything pressable inside (folds, images, links). */ +export function CopyableMessage({ text, children }: { text: string; children: ReactNode }) { + const open = useContext(CopyMenuContext) + if (!open || !text) return <>{children} + return ( + open(text)} delayLongPress={350} accessibilityHint="Long-press to copy or select text"> + {children} + + ) +} + +function SelectTextSheet({ text, onClose }: { text: string | null; onClose: () => void }) { + const insets = useSafeAreaInsets() + return ( + + + + Select Text + { + if (text) void ExpoClipboard.setStringAsync(text) + onClose() + }} + style={{ minHeight: 44, paddingHorizontal: 12, justifyContent: 'center' }} + accessibilityLabel="Copy all and close" + > + Copy All + + + Done + + + {/* Read-only, but still a UITextView: selection handles, the + edit menu and Select All all work; the keyboard never shows. */} + + + + ) +} diff --git a/mobile/src/chat/cards.tsx b/mobile/src/chat/cards.tsx new file mode 100644 index 00000000..8ee299a6 --- /dev/null +++ b/mobile/src/chat/cards.tsx @@ -0,0 +1,849 @@ +// RN port of renderer/components/json-mode-cards/* and the small cards +// that live in JsonModeChat.tsx. Labels, icons, intents and summaries come +// from the renderer's own tool-display / tool-timeline / turn-collapse +// modules (served to RN via the lucide shim), so they match the web +// client exactly; only the React-DOM layer is re-written. +import { Component, useEffect, useMemo, useRef, useState, type ReactNode } from 'react' +import { Pressable, ScrollView, Text, View } from 'react-native' +import { structuredPatch } from 'diff' +import { Bot, Brain, ChevronDown, ChevronRight, ListChecks, Loader2, RotateCcw, Sparkles, X, Wrench } from 'lucide-react-native' +import type { + JsonClaudeBackgroundAgent, + JsonClaudeImageRef, + JsonClaudeMessageBlock +} from '../../../src/shared/state/json-claude' +import { extractArgs, getToolDisplay, getToolIntent, isNessControl } from '../../../src/renderer/components/json-mode-cards/tool-display' +import { summarizeTools } from '../../../src/renderer/components/json-mode-cards/tool-timeline' +import { formatTurnDuration, type TurnSummary } from '../../../src/renderer/components/json-mode-cards/turn-collapse' +import { automationLabel } from '../../../src/renderer/components/json-mode-cards/automation-label' +import { alpha, c, mono } from '../theme' +import { tw } from '../tw' +import Svg, { G, Path, Rect } from 'react-native-svg' +import { NessIcon, McpGenericIcon } from '../../../src/renderer/components/json-mode-cards/tool-icons' +import { NESS_MARK_PATHS } from '../../../src/renderer/components/NessMark' +import { Markdown } from '../components/Markdown' +import { Spin } from '../components/Spin' +import { ROW_HIT_SLOP, useDensity, usePersistedChoice } from './density' +import { ImageStrip } from './ChatImage' +import { CopyableMessage } from './CopyText' + +export interface ToolResultView { + content: string + isError: boolean + images?: JsonClaudeImageRef[] +} + +// ── chrome ───────────────────────────────────────────────────────────── + +export function Chevron({ open }: { open: boolean }) { + return open ? : +} + +/** Desktop icon components can draw raw (the Ness mark), which RN + * can't host. Fall back to a wrench rather than crash the transcript. */ +class IconBoundary extends Component<{ children: ReactNode }, { failed: boolean }> { + state = { failed: false } + static getDerivedStateFromError() { + return { failed: true } + } + render() { + return this.state.failed ? : this.props.children + } +} + +type DesktopIcon = (p: { className?: string }) => ReactNode + +// The two desktop tool icons that draw raw instead of a lucide glyph, +// redrawn with react-native-svg from the same data. Rendering the DOM +// versions throws "View config getter callback for component `path`" — the +// IconBoundary below only catches that after dev's LogBox has already +// taken over the screen. +function RnNessIcon({ className }: { className?: string }) { + const size = tw(className).size ?? 12 + return ( + + + {NESS_MARK_PATHS.map((d) => ( + + ))} + + + ) +} +function RnMcpGenericIcon({ className }: { className?: string }) { + const t = tw(className) + const size = t.size ?? 12 + const col = t.color ?? c.muted + return ( + + + + + + ) +} +const RN_ICON = new Map([ + [NessIcon, RnNessIcon], + [McpGenericIcon, RnMcpGenericIcon] +]) + +export function ToolIcon({ icon, className = 'icon-xs text-muted' }: { icon: DesktopIcon | null | undefined; className?: string }) { + if (!icon) return null + const Icon = RN_ICON.get(icon) ?? icon + return ( + + + + ) +} + +/** CHAT_ROW_CLASS + CHAT_ROW_STYLE: a full-width muted row. */ +export function ChatRow({ onPress, children }: { onPress?: () => void; children: ReactNode }) { + const d = useDensity() + return ( + ({ flexDirection: 'row', alignItems: 'center', gap: 8, paddingVertical: d.chromePy, opacity: pressed ? 0.7 : 1 })} + > + {children} + + ) +} + +export function Meta({ children, color = c.muted, style }: { children: ReactNode; color?: string; style?: object }) { + const d = useDensity() + return ( + + {children} + + ) +} + +export function ToolCardChrome({ + name, + subtitle, + isError, + brand, + icon, + autoApproved, + sessionAllowed, + autoExpand = false, + images, + id, + children +}: { + /** Stable id (the tool_use id) so an expansion survives the row + * scrolling out of the virtualized transcript. */ + id?: string + /** Tool-result images: a thumbnail strip while collapsed (the web's + * collapsedImages), and at the top of the body when open. */ + images?: JsonClaudeImageRef[] + name: string + subtitle: ReactNode + isError?: boolean + brand?: boolean + icon?: DesktopIcon | null + autoApproved?: { model: string; reason: string } + sessionAllowed?: { toolName: string; rule?: string } + autoExpand?: boolean + children: ReactNode +}) { + const d = useDensity() + const [expanded, setExpanded] = usePersistedChoice(id ? `card:${id}` : undefined) + const isOpen = expanded ?? autoExpand + return ( + + setExpanded(!isOpen)}> + + + + {name} + + + {subtitle} + + {autoApproved && auto · haiku} + {sessionAllowed && {sessionAllowed.rule ? 'always' : 'session'}} + {isError && error} + + {!isOpen && images && images.length > 0 && } + {isOpen && ( + + {images && images.length > 0 && ( + + + + )} + {children} + + )} + + ) +} + +/**
 with a max height: scrolls inside the transcript. */
+export function Pre({ text, max, color = c.fg, maxHeight = 288 }: { text: string; max?: number; color?: string; maxHeight?: number }) {
+  const shown = max && text.length > max ? `${text.slice(0, max)}\n…` : text
+  return (
+    
+      
+        {shown}
+      
+    
+  )
+}
+
+function basename(p: unknown): string {
+  return typeof p === 'string' ? p.split('/').pop() || p : ''
+}
+function str(v: unknown): string {
+  return typeof v === 'string' ? v : ''
+}
+
+// ── per-tool cards (dispatchToolCard) ────────────────────────────────────
+
+export interface ToolCardProps {
+  block: JsonClaudeMessageBlock
+  result?: ToolResultView
+  autoApproved?: { model: string; reason: string }
+  sessionAllowed?: { toolName: string; rule?: string }
+  subAgentBody?: ReactNode
+  subAgentChildCount?: number
+  subAgentDescendantHasPendingApproval?: boolean
+  backgroundAgent?: JsonClaudeBackgroundAgent
+}
+
+export function dispatchToolCard(p: ToolCardProps): ReactNode {
+  switch (p.block.name) {
+    case 'Bash':
+      return 
+    case 'Edit':
+      return 
+    case 'MultiEdit':
+      return 
+    case 'Write':
+      return 
+    case 'Read':
+      return 
+    case 'Grep':
+      return 
+    case 'Glob':
+      return 
+    case 'TodoWrite':
+      return 
+    case 'Task':
+    case 'Agent':
+      return 
+    default:
+      return 
+  }
+}
+
+function common(p: ToolCardProps) {
+  const disp = getToolDisplay(p.block.name)
+  return {
+    icon: disp.icon as DesktopIcon,
+    id: p.block.id,
+    isError: !!p.result?.isError,
+    images: p.result?.images,
+    autoApproved: p.autoApproved,
+    sessionAllowed: p.sessionAllowed
+  }
+}
+
+function ErrorOnly({ result, max = 1000 }: { result?: ToolResultView; max?: number }) {
+  if (!result?.isError) return null
+  return 
+}
+
+function BashCard(p: ToolCardProps) {
+  const cmd = str(p.block.input?.command)
+  const intent = getToolIntent(p.block)
+  const subtitle = intent ?? (cmd.length > 80 ? `${cmd.slice(0, 80)}…` : cmd)
+  return (
+    
+      
+      {p.result && 
}
+    
+  )
+}
+
+function lineCount(s: string): number {
+  return s ? s.split('\n').length : 0
+}
+
+function EditCard(p: ToolCardProps) {
+  const path = str(p.block.input?.file_path)
+  const oldS = str(p.block.input?.old_string)
+  const newS = str(p.block.input?.new_string)
+  return (
+    
+      
+      
+      
+    
+  )
+}
+
+function MultiEditCard(p: ToolCardProps) {
+  const path = str(p.block.input?.file_path)
+  const edits = (Array.isArray(p.block.input?.edits) ? p.block.input.edits : []) as { old_string?: string; new_string?: string }[]
+  return (
+    
+      
+      {edits.length === 0 && No edits.}
+      {edits.map((e, i) => (
+        
+          
+            Edit {i + 1} of {edits.length}
+          
+          
+        
+      ))}
+      
+    
+  )
+}
+
+function WriteCard(p: ToolCardProps) {
+  const path = str(p.block.input?.file_path)
+  return (
+    
+      
+      
+      
+    
+  )
+}
+
+function ReadCard(p: ToolCardProps) {
+  const path = str(p.block.input?.file_path)
+  const off = p.block.input?.offset as number | undefined
+  const lim = p.block.input?.limit as number | undefined
+  const range = off !== undefined || lim !== undefined ? ` (${off ?? 1}–${(off ?? 1) + (lim ?? 0)})` : ''
+  const [all, setAll] = useState(false)
+  const lines = useMemo(() => (p.result && !p.result.isError ? p.result.content.split('\n') : []), [p.result])
+  const shown = all ? lines : lines.slice(0, 500)
+  return (
+    
+      
+      {p.result?.isError ? (
+        
+      ) : (
+        
+          {shown.map((l, i) => {
+            const m = /^\s*(\d+)[\t→](.*)$/.exec(l)
+            return (
+              
+                {m ? m[1] : ''}
+                {m ? m[2] : l}
+              
+            )
+          })}
+          {!all && lines.length > 500 && (
+             setAll(true)} hitSlop={ROW_HIT_SLOP} style={{ padding: 8 }}>
+              + {lines.length - 500} more lines
+            
+          )}
+        
+      )}
+    
+  )
+}
+
+function SimpleResultCard(p: ToolCardProps & { subtitle: string; max: number }) {
+  return (
+    
+      {p.result ? 
 : }
+    
+  )
+}
+
+function TodoWriteCard(p: ToolCardProps) {
+  const todos = (Array.isArray(p.block.input?.todos) ? p.block.input.todos : []) as { content?: string; status?: string; activeForm?: string }[]
+  return (
+    
+      
+        {todos.map((t, i) => {
+          const done = t.status === 'completed'
+          const doing = t.status === 'in_progress'
+          return (
+            
+              {done ? '☑' : doing ? '◐' : '☐'}
+              {t.content}
+            
+          )
+        })}
+      
+    
+  )
+}
+
+function GenericToolCard(p: ToolCardProps) {
+  const disp = getToolDisplay(p.block.name)
+  const args = extractArgs(p.block.input)
+  const [raw, setRaw] = useState(false)
+  return (
+     `${a.key} ${a.value}`).join('  ')}
+      {...common(p)}
+    >
+      {args.length > 0 && (
+        
+           setRaw(!raw)} hitSlop={ROW_HIT_SLOP} style={{ alignSelf: 'flex-end' }}>
+            {raw ? 'show parsed' : 'show raw'}
+          
+          {raw ? (
+            
+          ) : (
+            args.map((a) => (
+              
+                {a.key}
+                {a.value}
+              
+            ))
+          )}
+        
+      )}
+      {p.result && p.result.content.trim() !== '' && 
}
+    
+  )
+}
+
+/** TaskCard: the sub-agent runner with its nested transcript. */
+function TaskCard(p: ToolCardProps) {
+  const d = useDensity()
+  const desc = (str(p.block.input?.description) || str(p.block.input?.subagent_type) || 'Task').slice(0, 120)
+  const launchStub = !!p.result && /^Async agent launched|agentId:/m.test(p.result.content) && !!p.backgroundAgent
+  const bgRunning = p.backgroundAgent ? p.backgroundAgent.status === 'running' : false
+  const inFlight = (!p.result || launchStub) && (bgRunning || !p.backgroundAgent)
+  const pending = !!p.subAgentDescendantHasPendingApproval
+  const [userChoice, setUserChoiceRaw] = usePersistedChoice(p.block.id ? `task:${p.block.id}` : undefined)
+  const setUserChoice = (v: boolean | null | ((prev: boolean | null) => boolean | null)) => {
+    setUserChoiceRaw(typeof v === 'function' ? v(userChoice) : v)
+  }
+  const prev = useRef({ inFlight, pending })
+  useEffect(() => {
+    // Rising edge of "in flight" / "pending approval" opens; falling edge
+    // closes unless the user picked. A new approval overrides a manual close.
+    if (pending && !prev.current.pending) setUserChoice(null)
+    if (!inFlight && prev.current.inFlight && !pending) setUserChoice((v) => (v === null ? null : v))
+    prev.current = { inFlight, pending }
+  }, [inFlight, pending])
+  const open = userChoice ?? (inFlight || pending)
+  const count = p.subAgentChildCount ?? 0
+  const usage = count > 0 ? `${count} entr${count === 1 ? 'y' : 'ies'}` : inFlight ? 'starting…' : 'no activity'
+  return (
+    
+       setUserChoice(!open)}>
+        
+        
+        Task
+        
+          {desc}
+        
+        {p.block.input?.run_in_background && p.backgroundAgent ? background : null}
+        {usage}
+        {pending && needs approval}
+        {inFlight && (
+          
+            
+          
+        )}
+        {p.result?.isError && error}
+      
+      {open && (
+        
+          {p.subAgentBody ?? (
+            {inFlight ? 'sub-agent is starting…' : 'no sub-agent activity recorded'}
+          )}
+          {p.result && !launchStub && 
}
+        
+      )}
+    
+  )
+}
+
+function PathLine({ path }: { path: string }) {
+  return (
+    
+      {path}
+    
+  )
+}
+
+function Pending() {
+  return waiting for result…
+}
+
+/** Unified diff, 3 lines of context, `…` between hunks, old/new gutters. */
+export function Diff({ oldText, newText }: { oldText: string; newText: string }) {
+  const hunks = useMemo(() => structuredPatch('a', 'b', oldText, newText, '', '', { context: 3 }).hunks, [oldText, newText])
+  return (
+    
+      {hunks.map((h, hi) => {
+        let o = h.oldStart
+        let n = h.newStart
+        return (
+          
+            {hi > 0 && …}
+            {h.lines.map((line, li) => {
+              const kind = line[0]
+              const on = kind === '+' ? '' : String(o++)
+              const nn = kind === '-' ? '' : String(n++)
+              const bg = kind === '+' ? alpha(c.success, 0.12) : kind === '-' ? alpha(c.danger, 0.12) : 'transparent'
+              return (
+                
+                  {on}
+                  {nn}
+                  
+                    {line.slice(1) || ' '}
+                  
+                
+              )
+            })}
+          
+        )
+      })}
+    
+  )
+}
+
+// ── grouping chrome (ToolGroup / TurnGroup) ─────────────────────────────
+
+export interface GroupRow {
+  key: string
+  toolName?: string
+  toolIntent?: string
+  isThinking?: boolean
+  hasError?: boolean
+  hasPendingApproval?: boolean
+  images?: JsonClaudeImageRef[]
+  node: ReactNode
+}
+
+export function ToolGroup({ rows }: { rows: GroupRow[] }) {
+  // Keyed by the first row, the same key the group itself renders under.
+  const d = useDensity()
+  const hasError = rows.some((r) => r.hasError)
+  const hasPending = rows.some((r) => r.hasPendingApproval)
+  const [userChoice, setUserChoice] = usePersistedChoice(`group:${rows[0]?.key}`)
+  const expanded = userChoice ?? hasPending
+  const toolRows = rows.filter((r) => !r.isThinking)
+  const thinkingCount = rows.length - toolRows.length
+  const displays = toolRows.map((r) => {
+    const disp = getToolDisplay(r.toolName)
+    return { icon: disp.icon as DesktopIcon, text: r.toolIntent ?? disp.compactLabel }
+  })
+  const thinkingLabel = thinkingCount > 0 ? `${thinkingCount} thought${thinkingCount === 1 ? '' : 's'}` : ''
+  const countLabel = [thinkingLabel, ...summarizeTools(toolRows as never)].filter(Boolean).join(' · ')
+  return (
+    
+       setUserChoice(!expanded)}>
+        
+        {thinkingCount > 0 && }
+        {countLabel}
+        
+          {displays.slice(0, 6).map((x, i) => (
+            
+              {i > 0 && ·}
+              
+              
+                {x.text}
+              
+            
+          ))}
+        
+        {hasPending && needs approval}
+        {hasError && error}
+      
+      {!expanded && rows.some((r) => r.images?.length) && (
+         r.images ?? [])} height={56} />
+      )}
+      {expanded && (
+        
+          {rows.map((r) => (
+            {r.node}
+          ))}
+        
+      )}
+    
+  )
+}
+
+export function TurnGroup({ id, summary, hasError, images, children }: { id: string; summary: TurnSummary; hasError: boolean; images?: JsonClaudeImageRef[]; children: ReactNode }) {
+  const d = useDensity()
+  const [choice, setOpen] = usePersistedChoice(`turn:${id}`)
+  const open = choice ?? false
+  const parts = [
+    summary.durationMs !== undefined ? `Worked for ${formatTurnDuration(summary.durationMs)}` : 'Worked',
+    `${summary.toolCount} tool${summary.toolCount === 1 ? '' : 's'}`
+  ]
+  if (summary.editedFileCount > 0) parts.push(`${summary.editedFileCount} file${summary.editedFileCount === 1 ? '' : 's'} edited`)
+  return (
+    
+       setOpen(!open)}>
+        
+        {parts.join(' · ')}
+        {hasError && errors}
+      
+      {!open && images && images.length > 0 && }
+      {open && {children}}
+    
+  )
+}
+
+// ── non-tool cards from JsonModeChat.tsx ────────────────────────────────
+
+export function ThinkingCard({ id, text, isPartial }: { id?: string; text: string; isPartial: boolean }) {
+  const d = useDensity()
+  const [choice, setChoice] = usePersistedChoice(id ? `thinking:${id}` : undefined)
+  const [auto, setAuto] = useState(isPartial)
+  // Opens while streaming and closes when it finishes, unless the user
+  // picked (their choice persists across virtualization).
+  const open = choice ?? auto
+  const setOpen = (v: boolean) => setChoice(v)
+  const wasPartial = useRef(isPartial)
+  useEffect(() => {
+    if (wasPartial.current && !isPartial) setAuto(false)
+    wasPartial.current = isPartial
+  }, [isPartial])
+  return (
+    
+       setOpen(!open)}>
+        
+        
+        {isPartial ? 'Thinking' : 'Thought'}
+        {isPartial && (
+          
+            
+          
+        )}
+      
+      {open && (
+        
+          {text ? (
+            
+              
+            
+          ) : (
+            (hidden)
+          )}
+        
+      )}
+    
+  )
+}
+
+export function CompactCard({ trigger, pre, post }: { trigger?: string; pre?: number; post?: number }) {
+  const d = useDensity()
+  const k = (n: number) => `${Math.round(n / 1000)}k`
+  const detail = pre && post ? `${k(pre)} → ${k(post)} tokens` : pre ? `${k(pre)} tokens summarized` : 'conversation summarized'
+  return (
+    
+      
+      Compact
+      
+        {detail}
+      
+      {trigger && {trigger === 'manual' ? 'via /compact' : 'auto'}}
+    
+  )
+}
+
+function DangerCard({ title, detail, children }: { title: string; detail?: string; children?: ReactNode }) {
+  const d = useDensity()
+  return (
+    
+      
+        
+        {title}
+        {detail ? (
+          
+            {detail}
+          
+        ) : null}
+      
+      {children ? {children} : null}
+    
+  )
+}
+
+export function DangerButton({ label, onPress }: { label: string; onPress: () => void }) {
+  return (
+     ({
+        alignSelf: 'flex-start',
+        flexDirection: 'row',
+        alignItems: 'center',
+        gap: 6,
+        borderWidth: 1,
+        borderColor: alpha(c.danger, 0.4),
+        backgroundColor: alpha(c.danger, pressed ? 0.2 : 0.1),
+        borderRadius: 4,
+        paddingHorizontal: 12,
+        minHeight: 36
+      })}
+      hitSlop={4}
+    >
+      
+      {label}
+    
+  )
+}
+
+export function ExitCard({ message, isExited, onRestart }: { message: string; isExited: boolean; onRestart: () => void }) {
+  return (
+    
+      {isExited ?  : session restarted}
+    
+  )
+}
+
+export function AuthCard({ message, onSignIn, onRetry }: { message?: string; onSignIn: () => void; onRetry: () => void }) {
+  return (
+    
+      
+        
+        
+      
+    
+  )
+}
+
+export function SimpleDangerCard({ title, detail }: { title: string; detail?: string }) {
+  return 
+}
+
+export function NoticeCard({ title, detail, color = c.warning }: { title: string; detail?: string; color?: string }) {
+  const d = useDensity()
+  return (
+    
+      {title}
+      {detail ? (
+        
+          {detail}
+        
+      ) : null}
+    
+  )
+}
+
+/** Right-aligned prompt bubble; also the queued variant. */
+export function UserBubble({ text, queued, onCancel, images }: { text: string; queued?: boolean; onCancel?: () => void; images?: JsonClaudeImageRef[] }) {
+  const d = useDensity()
+  return (
+    
+      
+        
+          
+            
+          
+          {images && images.length > 0 && (
+            
+              
+            
+          )}
+        
+        {queued && (
+          
+            
+              queued
+            
+            
+              
+            
+          
+        )}
+      
+    
+  )
+}
+
+export function AutomatedTurnCard({
+  source,
+  from,
+  text,
+  queued,
+  onCancel
+}: {
+  source: Parameters[0]
+  from?: string
+  text: string
+  queued: boolean
+  onCancel: () => void
+}) {
+  const d = useDensity()
+  const { label, note, brand, collapsed } = automationLabel(source, from)
+  const [open, setOpen] = useState(!collapsed)
+  return (
+    
+      
+        {brand ?  : }
+        {label}
+        
+          {note}
+        
+        {collapsed && (
+           setOpen(!open)} hitSlop={12}>
+            {open ? 'Hide prompt' : 'Show prompt'}
+          
+        )}
+        {queued && (
+          
+            
+          
+        )}
+      
+      {open && }
+    
+  )
+}
+
+export function HeldNoticesCard({ notices }: { notices: { source: Parameters[0]; from?: string; body: string }[] }) {
+  const d = useDensity()
+  const [open, setOpen] = useState(false)
+  return (
+    
+      
+         setOpen(!open)} style={{ flexDirection: 'row', alignItems: 'center', gap: 8, paddingHorizontal: 16, paddingVertical: 10 }}>
+          
+          
+          
+            {notices.length === 1 ? '1 held notification' : `${notices.length} held notifications`}
+          
+          
+            delivered with this turn
+          
+        
+        {open && (
+          
+            {notices.map((n, i) => (
+              
+                {automationLabel(n.source, n.from).label}
+                
+              
+            ))}
+          
+        )}
+      
+    
+  )
+}
diff --git a/mobile/src/chat/density.ts b/mobile/src/chat/density.ts
new file mode 100644
index 00000000..5205ba6d
--- /dev/null
+++ b/mobile/src/chat/density.ts
@@ -0,0 +1,50 @@
+// The web chat's `--chat-*` density tokens (renderer/styles.css,
+// [data-chat-density]). Picked from settings.jsonModeChatDensity.
+import { createContext, useContext, useState } from 'react'
+import { mono } from '../theme'
+
+export interface Density {
+  body: number
+  chrome: number
+  meta: number
+  chromePx: number
+  chromePy: number
+  bubbleMax: `${number}%`
+  bubbleRadius: number
+  promptRadius: number
+  toolFamily: string | undefined
+}
+
+export const DENSITY: Record<'compact' | 'comfy', Density> = {
+  compact: { body: 14, chrome: 12, meta: 10, chromePx: 8, chromePy: 6, bubbleMax: '80%', bubbleRadius: 6, promptRadius: 12, toolFamily: mono },
+  comfy: { body: 16, chrome: 14, meta: 12, chromePx: 12, chromePy: 10, bubbleMax: '90%', bubbleRadius: 8, promptRadius: 16, toolFamily: undefined }
+}
+
+export const DensityContext = createContext(DENSITY.compact)
+export const useDensity = (): Density => useContext(DensityContext)
+
+/** Which cards the user opened/closed, per chat, keyed by a stable id
+ *  (tool_use id, group/turn key). The transcript is a virtualized list
+ *  that unmounts off-screen rows, so a card's own useState would forget
+ *  an expansion as soon as it scrolled away; the web keeps every row
+ *  mounted, so it never loses it. */
+export const ExpandStoreContext = createContext | null>(null)
+
+/** useState whose explicit choices outlive unmounting.
+ *  null = "no choice yet, follow the default". */
+export function usePersistedChoice(id: string | undefined): [boolean | null, (v: boolean | null) => void] {
+  const store = useContext(ExpandStoreContext)
+  const [v, setV] = useState(() => (id && store?.has(id) ? store.get(id)! : null))
+  const set = (next: boolean | null) => {
+    if (id && store) {
+      if (next === null) store.delete(id)
+      else store.set(id, next)
+    }
+    setV(next)
+  }
+  return [v, set]
+}
+
+/** Chat rows are visually ~28px tall (that's the web's density); extend
+ *  the touch area to ~44pt without changing the layout. */
+export const ROW_HIT_SLOP = { top: 8, bottom: 8, left: 0, right: 0 }
diff --git a/mobile/src/collapse.ts b/mobile/src/collapse.ts
new file mode 100644
index 00000000..d55341f7
--- /dev/null
+++ b/mobile/src/collapse.ts
@@ -0,0 +1,76 @@
+// Port of renderer/hooks/useWorktreeCollapse.ts: same keys, same defaults
+// (merged + snoozed start collapsed, new clients start split by repo), but
+// persisted in AsyncStorage because there's no localStorage on native.
+// Per-client layout, so not slice state.
+import { useCallback, useEffect, useRef, useState } from 'react'
+import AsyncStorage from '@react-native-async-storage/async-storage'
+import type { GroupKey } from '../../src/shared/worktree-sort'
+
+export interface CollapseState {
+  pinnedOpenRepos: Record
+  unifiedRepos: boolean
+  setUnifiedRepos: (fn: (v: boolean) => boolean) => void
+  isGroupCollapsed: (scope: string, key: GroupKey) => boolean
+  toggleGroup: (scope: string, key: GroupKey) => void
+  togglePinnedOpen: (scope: string) => void
+}
+
+function defaultCollapsed(key: GroupKey): boolean {
+  return key === 'merged' || key === 'snoozed'
+}
+
+const K_GROUPS = 'harness:collapsedGroups'
+const K_PINNED = 'harness:pinnedOpenRepos'
+const K_UNIFIED = 'harness:unifiedRepos'
+
+export function useCollapse(): CollapseState {
+  const [collapsedGroups, setCollapsedGroups] = useState>({})
+  const [pinnedOpenRepos, setPinnedOpenRepos] = useState>({})
+  const [unifiedRepos, setUnified] = useState(false)
+  const loaded = useRef(false)
+
+  useEffect(() => {
+    void AsyncStorage.multiGet([K_GROUPS, K_PINNED, K_UNIFIED]).then((pairs) => {
+      const m = Object.fromEntries(pairs)
+      try {
+        if (m[K_GROUPS]) setCollapsedGroups(JSON.parse(m[K_GROUPS]))
+        if (m[K_PINNED]) setPinnedOpenRepos(JSON.parse(m[K_PINNED]))
+      } catch {
+        // corrupt entry: keep defaults
+      }
+      setUnified(m[K_UNIFIED] === '1')
+      loaded.current = true
+    })
+  }, [])
+
+  useEffect(() => {
+    if (loaded.current) void AsyncStorage.setItem(K_GROUPS, JSON.stringify(collapsedGroups))
+  }, [collapsedGroups])
+  useEffect(() => {
+    if (loaded.current) void AsyncStorage.setItem(K_PINNED, JSON.stringify(pinnedOpenRepos))
+  }, [pinnedOpenRepos])
+  useEffect(() => {
+    if (loaded.current) void AsyncStorage.setItem(K_UNIFIED, unifiedRepos ? '1' : '0')
+  }, [unifiedRepos])
+
+  const isGroupCollapsed = useCallback(
+    (scope: string, key: GroupKey): boolean => {
+      const composite = `${scope}:${key}`
+      if (composite in collapsedGroups) return collapsedGroups[composite]
+      return defaultCollapsed(key)
+    },
+    [collapsedGroups]
+  )
+  const toggleGroup = useCallback((scope: string, key: GroupKey) => {
+    const composite = `${scope}:${key}`
+    setCollapsedGroups((prev) => {
+      const current = composite in prev ? prev[composite] : defaultCollapsed(key)
+      return { ...prev, [composite]: !current }
+    })
+  }, [])
+  const togglePinnedOpen = useCallback((scope: string) => {
+    setPinnedOpenRepos((prev) => ({ ...prev, [scope]: !prev[scope] }))
+  }, [])
+
+  return { pinnedOpenRepos, unifiedRepos, setUnifiedRepos: setUnified, isGroupCollapsed, toggleGroup, togglePinnedOpen }
+}
diff --git a/mobile/src/components/AgentIcon.tsx b/mobile/src/components/AgentIcon.tsx
new file mode 100644
index 00000000..ac2cae85
--- /dev/null
+++ b/mobile/src/components/AgentIcon.tsx
@@ -0,0 +1,17 @@
+// GENERATED from src/renderer/components/AgentIcon.tsx by the spike's
+// icon script — the same marks the desktop draws. Regenerate, don't edit.
+import Svg, { Path } from 'react-native-svg'
+import type { AgentKind } from '../../../src/shared/state/terminals'
+
+const ICONS: Record = {"claude": {"viewBox": "0 0 16 16", "paths": [{"fill": "#ee8334", "d": "m3.127 10.604 3.135-1.76.053-.153-.053-.085H6.11l-.525-.032-1.791-.048-1.554-.065-1.505-.08-.38-.081L0 7.832l.036-.234.32-.214.455.04 1.009.069 1.513.105 1.097.064 1.626.17h.259l.036-.105-.089-.065-.068-.064-1.566-1.062-1.695-1.121-.887-.646-.48-.327-.243-.306-.104-.67.435-.48.585.04.15.04.593.456 1.267.981 1.654 1.218.242.202.097-.068.012-.049-.109-.181-.9-1.626-.96-1.655-.428-.686-.113-.411a2 2 0 0 1-.068-.484l.496-.674L4.446 0l.662.089.279.242.411.94.666 1.48 1.033 2.014.302.597.162.553.06.17h.105v-.097l.085-1.134.157-1.392.154-1.792.052-.504.25-.605.497-.327.387.186.319.456-.045.294-.19 1.23-.37 1.93-.243 1.29h.142l.161-.16.654-.868 1.097-1.372.484-.545.565-.601.363-.287h.686l.505.751-.226.775-.707.895-.585.759-.839 1.13-.524.904.048.072.125-.012 1.897-.403 1.024-.186 1.223-.21.553.258.06.263-.218.536-1.307.323-1.533.307-2.284.54-.028.02.032.04 1.029.098.44.024h1.077l2.005.15.525.346.315.424-.053.323-.807.411-3.631-.863-.872-.218h-.12v.073l.726.71 1.331 1.202 1.667 1.55.084.383-.214.302-.226-.032-1.464-1.101-.565-.497-1.28-1.077h-.084v.113l.295.432 1.557 2.34.08.718-.112.234-.404.141-.444-.08-.911-1.28-.94-1.44-.759-1.291-.093.053-.448 4.821-.21.246-.484.186-.403-.307-.214-.496.214-.98.258-1.28.21-1.016.19-1.263.112-.42-.008-.028-.092.012-.953 1.307-1.448 1.957-1.146 1.227-.274.109-.477-.247.045-.44.266-.39 1.586-2.018.956-1.25.617-.723-.004-.105h-.036l-4.212 2.736-.75.096-.324-.302.04-.496.154-.162 1.267-.871z"}]}, "codex": {"viewBox": "0 0 16 16", "paths": [{"fill": "currentColor", "d": "M14.949 6.547a3.94 3.94 0 0 0-.348-3.273 4.11 4.11 0 0 0-4.4-1.934 4.1 4.1 0 0 0-1.778-.113 4.15 4.15 0 0 0-2.118.114 4.1 4.1 0 0 0-1.891.948 4.04 4.04 0 0 0-1.158 1.753 4.1 4.1 0 0 0-1.563.679 4 4 0 0 0-1.14 1.252 3.99 3.99 0 0 0 .502 4.731 3.94 3.94 0 0 0 .346 3.274 4.11 4.11 0 0 0 4.402 1.933c.382.425.852.764 1.377.995.526.231 1.095.35 1.67.346 1.78.002 3.358-1.132 3.901-2.804a4.1 4.1 0 0 0 1.563-.68 4 4 0 0 0 1.14-1.253 3.99 3.99 0 0 0-.506-4.716m-6.097 8.406a3.05 3.05 0 0 1-1.945-.694l.096-.054 3.23-1.838a.53.53 0 0 0 .265-.455v-4.49l1.366.778q.02.011.025.035v3.722c-.003 1.653-1.361 2.992-3.037 2.996m-6.53-2.75a2.95 2.95 0 0 1-.36-2.01l.095.057L5.29 12.09a.53.53 0 0 0 .527 0l3.949-2.246v1.555a.05.05 0 0 1-.022.041L6.473 13.3c-1.454.826-3.311.335-4.15-1.098m-.85-6.94A3.02 3.02 0 0 1 3.07 3.949v3.785a.51.51 0 0 0 .262.451l3.93 2.237-1.366.779a.05.05 0 0 1-.048 0L2.585 9.342a2.98 2.98 0 0 1-1.113-4.094zm11.216 2.571L8.747 5.576l1.362-.776a.05.05 0 0 1 .048 0l3.265 1.86a3 3 0 0 1 1.173 1.207 2.96 2.96 0 0 1-.27 3.2 3.05 3.05 0 0 1-1.36.997V8.279a.52.52 0 0 0-.276-.445m1.36-2.015-.097-.057-3.226-1.855a.53.53 0 0 0-.53 0L6.249 6.153V4.598a.04.04 0 0 1 .019-.04L9.533 2.7a3.07 3.07 0 0 1 3.257.139c.474.325.843.778 1.066 1.303.223.526.289 1.103.191 1.664zM5.503 8.575 4.139 7.8a.05.05 0 0 1-.026-.037V4.049c0-.57.166-1.127.476-1.607s.752-.864 1.275-1.105a3.08 3.08 0 0 1 3.234.41l-.096.054-3.23 1.838a.53.53 0 0 0-.265.455zm.742-1.577 1.758-1 1.762 1v2l-1.755 1-1.762-1z"}]}, "cursor": {"viewBox": "395 393 175 197", "paths": [{"fill": "#72716D", "d": "M483.395 490.5L566 538.297C565.493 539.178 564.757 539.93 563.845 540.456L486.636 585.13C484.632 586.29 482.159 586.29 480.154 585.13L402.945 540.456C402.034 539.93 401.297 539.178 400.79 538.297L483.395 490.5Z"}, {"fill": "#55544F", "d": "M483.395 395V490.5L400.79 538.297C400.282 537.416 400 536.398 400 535.346V445.654C400 443.545 401.122 441.6 402.945 440.544L480.15 395.87C481.154 395.29 482.273 395 483.391 395H483.395Z"}, {"fill": "#43413C", "d": "M565.996 442.703C565.489 441.822 564.752 441.07 563.841 440.544L486.632 395.87C485.632 395.29 484.513 395 483.395 395V490.5L566 538.297C566.507 537.416 566.789 536.398 566.789 535.346V445.654C566.789 444.598 566.511 443.588 566 442.703H565.996Z"}, {"fill": "#D6D5D2", "d": "M560.218 446.049C560.686 446.858 560.751 447.896 560.218 448.82L485.235 578.974C484.732 579.855 483.392 579.493 483.392 578.479V492.713C483.392 492.029 483.209 491.37 482.877 490.794L560.215 446.045H560.218V446.049Z"}, {"fill": "#FFFFFF", "d": "M560.218 446.049L482.88 490.797C482.552 490.224 482.073 489.737 481.48 489.394L407.369 446.511C406.49 446.006 406.851 444.663 407.862 444.663H557.824C558.889 444.663 559.754 445.239 560.218 446.049Z"}]}}
+
+export function AgentIcon({ kind, size = 12, color = '#a3a3a3' }: { kind?: AgentKind; size?: number; color?: string }) {
+  const icon = ICONS[kind ?? 'claude'] ?? ICONS.claude
+  return (
+    
+      {icon.paths.map((p, i) => (
+        
+      ))}
+    
+  )
+}
diff --git a/mobile/src/components/BackendsSheet.tsx b/mobile/src/components/BackendsSheet.tsx
new file mode 100644
index 00000000..7e4f99c2
--- /dev/null
+++ b/mobile/src/components/BackendsSheet.tsx
@@ -0,0 +1,280 @@
+// Backends manager: every saved Ness backend with an enable switch, live
+// connection state, remove, and "Add backend" (QR scan or pasted link —
+// the same URL Settings → Web & mobile shows).
+import { useRef, useState } from 'react'
+import { Pressable, ScrollView, StyleSheet, Switch, Text, TextInput, View } from 'react-native'
+import { CameraView, useCameraPermissions } from 'expo-camera'
+import { Plus, QrCode, Trash2, X } from 'lucide-react-native'
+import { parseConnectionUrl } from '../../../src/shared/transport/parse-connection-url'
+import type { Backends } from '../backends'
+import { NessClient, useConn, useNess } from '../ness'
+import { alpha, c, fs, mono, themed, getThemeMode } from '../theme'
+
+export function BackendsSheet({ backends, onClose }: { backends: Backends; onClose?: () => void }) {
+  const [adding, setAdding] = useState(backends.saved.length === 0)
+  return (
+    
+      
+        BACKENDS
+        {onClose && (
+           ({ width: 44, height: 44, marginRight: -12, alignItems: 'center', justifyContent: 'center', borderRadius: 6, backgroundColor: pressed ? c.surface : 'transparent' })}
+          >
+            
+          
+        )}
+      
+      
+        {backends.saved.map((b) => (
+          
+             cl.id === b.id)} enabled={b.enabled} />
+            
+              
+                {b.label}
+              
+              
+                {b.wsUrl}
+              
+               cl.id === b.id)} enabled={b.enabled} />
+              {backends.clients.some((cl) => cl.id === b.id) && }
+            
+             backends.setEnabled(b.id, v)}
+              accessibilityLabel={`Connect to ${b.label}`}
+              trackColor={{ true: c.accent, false: c.surface }}
+              thumbColor="#fff"
+            />
+             backends.remove(b.id)}
+              accessibilityLabel={`Remove ${b.label}`}
+              style={({ pressed }) => ({ width: 44, height: 44, marginRight: -10, alignItems: 'center', justifyContent: 'center', borderRadius: 6, backgroundColor: pressed ? c.surface : 'transparent' })}
+            >
+              
+            
+          
+        ))}
+        {adding ? (
+           {
+              backends.add(b)
+              setAdding(false)
+            }}
+            onCancel={backends.saved.length > 0 ? () => setAdding(false) : undefined}
+          />
+        ) : (
+           setAdding(true)}>
+            
+            Add backend
+          
+        )}
+      
+    
+  )
+}
+
+function BackendDot({ client, enabled }: { client?: NessClient; enabled: boolean }) {
+  if (!client || !enabled) return 
+  return 
+}
+
+function LiveDot({ client }: { client: NessClient }) {
+  const conn = useConn(client)
+  return 
+}
+
+function BackendStatus({ client, enabled }: { client?: NessClient; enabled: boolean }) {
+  if (!enabled || !client) return disabled
+  return 
+}
+
+/** Two Ness instances on one machine (e.g. the desktop app and a
+ *  harness-server) report the same worktree paths. The merged list can only
+ *  show one backend's view of each path — the later one in this list wins,
+ *  same as desktop — so its tabs, statuses and aliases replace the other's.
+ *  Say so instead of letting it happen silently. */
+function OverlapNote({ clients, selfId }: { clients: NessClient[]; selfId: string }) {
+  // Only rendered for an active client, so `self` exists.
+  const self = clients.find((cl) => cl.id === selfId)!
+  const mine = useNess(self, (st) => st.worktrees.list)
+  if (clients.length < 2) return null
+  const myPaths = new Set(mine.map((w) => w.path))
+  const myIndex = clients.indexOf(self)
+  const overlapping = clients.filter((o) => o !== self && o.getState().worktrees.list.some((w) => myPaths.has(w.path)))
+  if (overlapping.length === 0) return null
+  const shadowedBy = overlapping.filter((o) => clients.indexOf(o) > myIndex)
+  return (
+    
+      {shadowedBy.length > 0
+        ? `Same worktrees as ${shadowedBy.map((o) => o.label).join(', ')}, which is shown instead. Turn one off.`
+        : `Same worktrees as ${overlapping.map((o) => o.label).join(', ')}. This one is shown; turn one off.`}
+    
+  )
+}
+
+function LiveStatus({ client }: { client: NessClient }) {
+  const conn = useConn(client)
+  return (
+    
+      {conn.connected ? 'connected' : conn.error ? `${conn.error} — retrying` : 'connecting…'}
+    
+  )
+}
+
+function AddBackend({
+  onAdd,
+  onCancel
+}: {
+  onAdd: (b: { wsUrl: string; token: string; label?: string }) => void
+  onCancel?: () => void
+}) {
+  const [link, setLink] = useState('')
+  const [label, setLabel] = useState('')
+  const [error, setError] = useState(null)
+  const [scanning, setScanning] = useState(false)
+  const [permission, requestPermission] = useCameraPermissions()
+  const handled = useRef(false)
+
+  const submit = (raw: string) => {
+    // Same parser the desktop "Add Backend" modal uses.
+    const r = parseConnectionUrl(raw)
+    if (!r.ok) {
+      setError(r.error)
+      return
+    }
+    onAdd({ wsUrl: r.parsed.wsUrl, token: r.parsed.token, label: label.trim() || undefined })
+  }
+
+  return (
+    
+      Add a backend
+      
+        Scan the QR in Ness → Settings → Web & mobile, or paste the connection link. Works for the desktop app and for
+        harness-server.
+      
+      {scanning ? (
+        
+           {
+              if (handled.current) return
+              handled.current = true
+              setScanning(false)
+              submit(data)
+            }}
+          />
+        
+      ) : (
+         {
+            const p = permission?.granted ? permission : await requestPermission()
+            if (!p.granted) {
+              setError('Camera permission denied')
+              return
+            }
+            handled.current = false
+            setScanning(true)
+          }}
+        >
+          
+          Scan QR code
+        
+      )}
+       {
+          setLink(t)
+          setError(null)
+        }}
+        onSubmitEditing={() => submit(link)}
+      />
+      
+      {error && {error}}
+      
+        {onCancel && (
+          
+            Cancel
+          
+        )}
+         submit(link)}>
+          Connect
+        
+      
+    
+  )
+}
+
+const s = themed(() => StyleSheet.create({
+  // Above the worktree picker (z 30) and the panels sheet (z 40): Fabric
+  // flattens the unstyled wrappers between them, so all three end up
+  // competing in one stacking context.
+  sheet: { ...(StyleSheet.absoluteFill as object), backgroundColor: c.app, zIndex: 60, elevation: 60 },
+  head: {
+    height: 56,
+    flexDirection: 'row',
+    alignItems: 'center',
+    paddingHorizontal: 12,
+    borderBottomWidth: 1,
+    borderColor: c.border
+  },
+  title: { flex: 1, color: c.dim, fontSize: fs.xs, fontWeight: '600', letterSpacing: 1.2 },
+  card: {
+    flexDirection: 'row',
+    alignItems: 'center',
+    gap: 12,
+    padding: 12,
+    borderRadius: 8,
+    borderWidth: 1,
+    borderColor: c.border,
+    backgroundColor: c.panel
+  },
+  dot: { width: 8, height: 8, borderRadius: 4 },
+  label: { color: c.fgBright, fontSize: fs.sm, fontWeight: '600' },
+  url: { color: c.dim, fontSize: 11, fontFamily: mono, marginTop: 2 },
+  status: { color: c.muted, fontSize: 11, marginTop: 2 },
+  help: { color: c.muted, fontSize: fs.xs, lineHeight: 17 },
+  addRow: { flexDirection: 'row', alignItems: 'center', gap: 8, paddingHorizontal: 12, minHeight: 48 },
+  scanBtn: {
+    flexDirection: 'row',
+    alignItems: 'center',
+    justifyContent: 'center',
+    gap: 8,
+    minHeight: 44,
+    borderRadius: 6,
+    backgroundColor: alpha(c.accent, 0.15),
+    borderWidth: 1,
+    borderColor: alpha(c.accent, 0.3)
+  },
+  camera: { height: 260, borderRadius: 8, overflow: 'hidden' },
+  input: {
+    borderWidth: 1,
+    borderColor: c.border,
+    backgroundColor: c.app,
+    borderRadius: 6,
+    color: c.fg,
+    paddingHorizontal: 10,
+    minHeight: 44,
+    fontSize: 16
+  },
+  // 44pt: the thumb-sized minimum used everywhere else in the app.
+  btn: { borderWidth: 1, borderColor: c.border, borderRadius: 6, paddingHorizontal: 18, minHeight: 44, minWidth: 88, alignItems: 'center', justifyContent: 'center' }
+}))
diff --git a/mobile/src/components/ChatView.tsx b/mobile/src/components/ChatView.tsx
new file mode 100644
index 00000000..7eaa7478
--- /dev/null
+++ b/mobile/src/components/ChatView.tsx
@@ -0,0 +1,549 @@
+// Port of renderer/components/JsonModeChat.tsx for the phone. Read them
+// side by side: lifecycle, the transcript pipeline (buildChildrenMap →
+// results map → tail window → renderEntries → foldFinishedTurns →
+// groupConsecutiveToolRows) and the composer rules follow that file, and
+// the pure steps are imported from it rather than re-implemented.
+import { useCallback, useEffect, useMemo, useRef, useState, type ReactNode } from 'react'
+import { AppState as RNAppState, FlatList, Pressable, Text, View, type NativeScrollEvent, type NativeSyntheticEvent } from 'react-native'
+import { ChevronDown, Loader2, Sparkles, X } from 'lucide-react-native'
+import type { JsonClaudeChatEntry, JsonClaudePendingApproval, JsonClaudeSession } from '../../../src/shared/state/json-claude'
+import { DEFAULT_JSON_MODE_TRANSCRIPT_WINDOW } from '../../../src/shared/state/settings'
+import { buildChildrenMap, isSubAgentToolName } from '../../../src/renderer/components/json-mode-cards/grouping'
+import { foldFinishedTurns, getEditedPaths, type TurnSummary } from '../../../src/renderer/components/json-mode-cards/turn-collapse'
+import { getToolIntent } from '../../../src/renderer/components/json-mode-cards/tool-display'
+import type { NessClient } from '../ness'
+import { useNess } from '../ness'
+import { alpha, c } from '../theme'
+import { Markdown } from './Markdown'
+import { Spin } from './Spin'
+import {
+  AuthCard,
+  AutomatedTurnCard,
+  CompactCard,
+  ExitCard,
+  HeldNoticesCard,
+  NoticeCard,
+  SimpleDangerCard,
+  ThinkingCard,
+  ToolCardChrome,
+  ToolGroup,
+  TurnGroup,
+  UserBubble,
+  dispatchToolCard,
+  type GroupRow,
+  type ToolResultView
+} from '../chat/cards'
+import { ApprovalSlot } from '../chat/ApprovalCard'
+import { ChatClientContext } from '../chat/ChatImage'
+import { Composer } from '../chat/Composer'
+import { CopyableMessage, CopyMenuHost } from '../chat/CopyText'
+import { DENSITY, DensityContext, ExpandStoreContext } from '../chat/density'
+
+interface RenderedRow extends GroupRow {
+  entryId?: string
+  type: 'text' | 'tool'
+  timestamp?: number
+  isTurnStart?: boolean
+  isTurnError?: boolean
+  editedPaths?: string[]
+  coveredEntryIds?: string[]
+}
+
+interface Ctx {
+  results: Map
+  resultEntryIds: Map
+  children: Map
+  approvalCard: (toolUseId: string | undefined) => ReactNode
+  pendingToolUseIds: Set
+  session: JsonClaudeSession
+  onCancelQueued: (entryId: string) => void
+  onRestart: () => void
+  onSignIn: () => void
+}
+
+function renderEntries(entries: JsonClaudeChatEntry[], ctx: Ctx): RenderedRow[] {
+  const rows: RenderedRow[] = []
+  for (const entry of entries) {
+    if (entry.kind === 'user' && entry.heldNotices && entry.heldNotices.length > 0) {
+      rows.push({ key: `${entry.entryId}-held`, entryId: entry.entryId, type: 'text', node:  })
+    }
+    if (entry.kind === 'user' && entry.automation) {
+      rows.push({
+        key: entry.entryId,
+        entryId: entry.entryId,
+        type: 'text',
+        isTurnStart: !entry.isQueued,
+        node: (
+           ctx.onCancelQueued(entry.entryId)}
+          />
+        )
+      })
+      continue
+    }
+    if (entry.kind === 'user') {
+      rows.push({
+        key: entry.entryId,
+        entryId: entry.entryId,
+        type: 'text',
+        isTurnStart: !entry.isQueued,
+        node:  ctx.onCancelQueued(entry.entryId)} />
+      })
+      continue
+    }
+    if (entry.kind === 'compact') {
+      rows.push({ key: entry.entryId, entryId: entry.entryId, type: 'tool', node:  })
+      continue
+    }
+    if (entry.kind === 'error' && (entry.errorKind === 'subprocess-exit' || entry.errorKind === 'spawn-failed')) {
+      const msg = entry.errorMessage ?? (entry.errorKind === 'spawn-failed' ? "Couldn't launch Claude" : 'Session ended unexpectedly')
+      rows.push({ key: entry.entryId, entryId: entry.entryId, type: 'text', isTurnError: true, node:  })
+      continue
+    }
+    if (entry.kind === 'error' && entry.errorKind === 'auth-failure') {
+      rows.push({ key: entry.entryId, entryId: entry.entryId, type: 'tool', isTurnError: true, node:  })
+      continue
+    }
+    if (entry.kind === 'system' && entry.errorKind === 'rate-limit-warning') {
+      rows.push({ key: entry.entryId, entryId: entry.entryId, type: 'tool', node:  })
+      continue
+    }
+    if (entry.kind === 'error' && entry.errorKind === 'agent-error') {
+      rows.push({ key: entry.entryId, entryId: entry.entryId, type: 'tool', isTurnError: true, node:  })
+      continue
+    }
+    if (entry.kind === 'error' && entry.errorKind === 'rate-limit-error') {
+      rows.push({ key: entry.entryId, entryId: entry.entryId, type: 'tool', isTurnError: true, node:  })
+      continue
+    }
+    if (entry.kind === 'assistant' && entry.blocks) {
+      for (const [i, block] of entry.blocks.entries()) {
+        if (block.type === 'thinking') {
+          rows.push({ key: `${entry.entryId}-th-${i}`, entryId: entry.entryId, type: 'tool', isThinking: true, node:  })
+        } else if (block.type === 'text' && (block.text || entry.isPartial)) {
+          rows.push({ key: `${entry.entryId}-t`, entryId: entry.entryId, type: 'text', node:  })
+        } else if (block.type === 'tool_use') {
+          const result = block.id ? ctx.results.get(block.id) : undefined
+          const placeholder = entry.isPartial && (!block.input || Object.keys(block.input).length === 0)
+          let subAgentBody: ReactNode = null
+          let subAgentChildCount = 0
+          let descendantPending = false
+          const resultEntryId = block.id ? ctx.resultEntryIds.get(block.id) : undefined
+          const covered = resultEntryId ? [resultEntryId] : []
+          if (isSubAgentToolName(block.name) && block.id) {
+            const kids = ctx.children.get(block.id) ?? []
+            subAgentChildCount = kids.length
+            if (kids.length > 0) {
+              const childRows = renderEntries(kids, ctx)
+              descendantPending = childRows.some((r) => r.hasPendingApproval)
+              for (const k of kids) covered.push(k.entryId)
+              for (const r of childRows) covered.push(...(r.coveredEntryIds ?? []))
+              subAgentBody = 
+            }
+          }
+          rows.push({
+            key: `${entry.entryId}-${block.id || 'tu'}`,
+            entryId: entry.entryId,
+            type: 'tool',
+            toolName: block.name,
+            toolIntent: getToolIntent(block) ?? undefined,
+            hasError: !!result?.isError,
+            images: result?.images,
+            editedPaths: getEditedPaths(block.name, block.input),
+            ...(covered.length > 0 ? { coveredEntryIds: covered } : {}),
+            hasPendingApproval: (!!block.id && ctx.pendingToolUseIds.has(block.id)) || descendantPending,
+            node: (
+              <>
+                {placeholder ? (
+                  
+                    waiting for input
+                  
+                ) : (
+                  dispatchToolCard({
+                    block,
+                    result,
+                    autoApproved: block.id ? ctx.session.autoApprovedDecisions[block.id] : undefined,
+                    sessionAllowed: block.id ? ctx.session.sessionAllowedDecisions[block.id] : undefined,
+                    subAgentBody,
+                    subAgentChildCount,
+                    subAgentDescendantHasPendingApproval: descendantPending,
+                    backgroundAgent: block.id ? ctx.session.backgroundAgents?.[block.id] : undefined
+                  })
+                )}
+                {ctx.approvalCard(block.id)}
+              
+            )
+          })
+        }
+      }
+    }
+  }
+  const ts = new Map(entries.map((e) => [e.entryId, e.timestamp]))
+  for (const r of rows) if (r.entryId) r.timestamp = ts.get(r.entryId)
+  return rows
+}
+
+interface GroupedItem {
+  kind: 'single' | 'group'
+  key: string
+  rows: RenderedRow[]
+}
+type DisplayItem = GroupedItem | { kind: 'turn'; key: string; rows: RenderedRow[]; summary: TurnSummary; items: GroupedItem[] }
+
+function groupConsecutiveToolRows(rows: RenderedRow[]): GroupedItem[] {
+  const out: GroupedItem[] = []
+  let buf: RenderedRow[] = []
+  const flush = () => {
+    if (buf.length === 0) return
+    out.push(buf.length === 1 ? { kind: 'single', key: buf[0].key, rows: buf } : { kind: 'group', key: `group-${buf[0].key}`, rows: buf })
+    buf = []
+  }
+  for (const r of rows) {
+    if (r.type === 'tool') buf.push(r)
+    else {
+      flush()
+      out.push({ kind: 'single', key: r.key, rows: [r] })
+    }
+  }
+  flush()
+  return out
+}
+
+function Grouped({ items }: { items: GroupedItem[] }) {
+  return (
+    
+      {items.map((it) => (
+        
+      ))}
+    
+  )
+}
+
+function GroupedNode({ item }: { item: GroupedItem }) {
+  return item.kind === 'group' ?  : <>{item.rows[0].node}
+}
+
+function AssistantText({ text, streaming }: { text: string; streaming: boolean }) {
+  const d = DENSITY.compact
+  return (
+    
+      
+      {streaming && }
+    
+  )
+}
+
+// ── the view ───────────────────────────────────────────────────────────
+
+export function ChatView({
+  client,
+  sessionId,
+  worktreePath,
+  mode
+}: {
+  client: NessClient
+  sessionId: string
+  worktreePath: string
+  mode: 'awake' | 'asleep'
+}) {
+  const session = useNess(client, (s) => s.jsonClaude.sessions[sessionId])
+  const allApprovals = useNess(client, (s) => s.jsonClaude.pendingApprovals)
+  const settings = useNess(client, (s) => s.settings)
+  const density = DENSITY[settings.jsonModeChatDensity === 'comfy' ? 'comfy' : 'compact']
+
+  // Lifecycle (JsonModeChat.tsx:1864-1881): start only an awake tab with
+  // no session at all (an exited one waits for Restart); fetch history
+  // once per session.
+  const sessionExists = !!session
+  useEffect(() => {
+    if (mode === 'awake' && !sessionExists) void client.api.startJsonClaude(sessionId, worktreePath)
+  }, [client, sessionId, worktreePath, mode, sessionExists])
+  const fetched = useRef(new Set())
+  useEffect(() => {
+    if (!sessionExists || fetched.current.has(sessionId)) return
+    fetched.current.add(sessionId)
+    void client.api.getJsonClaudeEntries(sessionId)
+  }, [client, sessionId, sessionExists])
+
+  // setComposerVisible: tells main someone is looking (gates attention
+  // notifications). App backgrounding counts as hidden, like
+  // document.visibilityState on the web.
+  useEffect(() => {
+    if (mode === 'asleep') return
+    let visible = RNAppState.currentState === 'active'
+    if (visible) void client.api.setJsonClaudeComposerVisible(sessionId, true)
+    const sub = RNAppState.addEventListener('change', (st) => {
+      const next = st === 'active'
+      if (next === visible) return
+      visible = next
+      void client.api.setJsonClaudeComposerVisible(sessionId, next)
+    })
+    return () => {
+      sub.remove()
+      if (visible) void client.api.setJsonClaudeComposerVisible(sessionId, false)
+    }
+  }, [client, sessionId, mode])
+
+  const approvals = useMemo(
+    () => Object.values(allApprovals).filter((a) => a.sessionId === sessionId),
+    [allApprovals, sessionId]
+  )
+  const approvalByToolUseId = useMemo(() => {
+    const m = new Map()
+    for (const a of approvals) if (a.toolUseId) m.set(a.toolUseId, a)
+    return m
+  }, [approvals])
+  const pendingToolUseIds = useMemo(() => new Set(approvalByToolUseId.keys()), [approvalByToolUseId])
+
+  const windowSetting = settings.jsonModeTranscriptWindow ?? DEFAULT_JSON_MODE_TRANSCRIPT_WINDOW
+  const [windowSize, setWindowSize] = useState(windowSetting <= 0 ? Infinity : windowSetting)
+
+  const restart = useCallback(() => {
+    void (async () => {
+      await client.api.killJsonClaude(sessionId)
+      await client.api.startJsonClaude(sessionId, worktreePath)
+    })()
+  }, [client, sessionId, worktreePath])
+
+  const entries = session?.entries
+  const { rows, hidden, renderedToolUseIds } = useMemo(() => {
+    if (!session || !entries) return { rows: [] as RenderedRow[], hidden: 0, renderedToolUseIds: new Set() }
+    const { topLevelEntries, childrenByParentToolUseId } = buildChildrenMap(entries)
+    const results = new Map()
+    const resultEntryIds = new Map()
+    for (const e of entries) {
+      if (e.kind !== 'tool_result' || !e.blocks) continue
+      for (const b of e.blocks) {
+        if (b.type === 'tool_result' && b.toolUseId) {
+          resultEntryIds.set(b.toolUseId, e.entryId)
+          results.set(b.toolUseId, { content: b.content || '', isError: !!b.isError, ...(b.images?.length ? { images: b.images } : {}) })
+        }
+      }
+    }
+    const renderable = topLevelEntries.filter((e) => e.kind !== 'tool_result')
+    const start = Math.max(0, renderable.length - windowSize)
+    const seen = new Set()
+    const out = renderEntries(start === 0 ? renderable : renderable.slice(start), {
+      results,
+      resultEntryIds,
+      children: childrenByParentToolUseId,
+      pendingToolUseIds,
+      session,
+      approvalCard: (id) => {
+        if (!id) return null
+        const a = approvalByToolUseId.get(id)
+        if (!a) return null
+        seen.add(id)
+        return 
+      },
+      onCancelQueued: (entryId) => client.api.cancelQueuedJsonClaudeMessage(sessionId, entryId),
+      onRestart: restart,
+      onSignIn: () => void client.api.openJsonClaudeAuthLoginTab(worktreePath)
+    })
+    return { rows: out, hidden: start, renderedToolUseIds: seen }
+    // session identity changes per event; the deps below are what the
+    // pipeline actually reads.
+    // eslint-disable-next-line react-hooks/exhaustive-deps
+  }, [entries, windowSize, approvalByToolUseId, pendingToolUseIds, session?.state, session?.autoApprovedDecisions, session?.sessionAllowedDecisions, session?.backgroundAgents, client, sessionId, worktreePath, restart])
+
+  const busy = !!session?.busy
+  const turnStartedAt = session?.turnStartedAt
+  const items = useMemo(() => {
+    if (!settings.collapseFinishedTurns) return groupConsecutiveToolRows(rows)
+    return foldFinishedTurns(rows, { busy, turnStartedAt }).flatMap((it): DisplayItem[] =>
+      it.kind === 'rows'
+        ? groupConsecutiveToolRows(it.rows)
+        : [{ kind: 'turn', key: it.key, rows: it.rows, summary: it.summary, items: groupConsecutiveToolRows(it.rows) }]
+    )
+  }, [rows, settings.collapseFinishedTurns, busy, turnStartedAt])
+
+  // Approvals whose tool_use isn't on screen yet render at the bottom.
+  const orphans = approvals.filter((a) => !a.toolUseId || !renderedToolUseIds.has(a.toolUseId))
+
+  const lastEntry = entries?.[entries.length - 1]
+  const lastBlock = lastEntry?.blocks?.[lastEntry.blocks.length - 1]
+  const streamingVisible = lastEntry?.kind === 'assistant' && lastEntry.isPartial && (lastBlock?.type === 'text' || lastBlock?.type === 'tool_use')
+  const showWorking = busy && !streamingVisible
+
+  // Inverted list: index 0 is the bottom. Offset 0 = stuck to bottom.
+  const listRef = useRef>(null)
+  // One per chat (ChatView is keyed by session), outliving row unmounts.
+  const [expandStore] = useState(() => new Map())
+  const [awayFromBottom, setAway] = useState(false)
+  const onScroll = useCallback((e: NativeSyntheticEvent) => {
+    setAway(e.nativeEvent.contentOffset.y > 32)
+  }, [])
+  const reversed = useMemo(() => [...items].reverse(), [items])
+
+  const sessionApprovals = session?.sessionToolApprovals ?? []
+
+  // Nothing to show yet. Same three cases as the web (JsonModeChat's
+  // empty branch): history still on its way, a provider that loads history
+  // slowly (historyPending), or a genuinely new chat. The web renders blank
+  // while the lazy fetch runs because on a desktop it lands within a frame;
+  // over a phone's Wi-Fi it takes long enough that blank reads as broken,
+  // so the phone shows a loading line — after a short delay, so a fast
+  // fetch still doesn't flash a spinner.
+  const nothingYet = (entries?.length ?? 0) === 0 && approvals.length === 0 && !busy
+  const loadingPhase: 'starting' | 'history' | null = !nothingYet
+    ? null
+    : !session
+      ? mode === 'awake'
+        ? 'starting'
+        : null
+      : session.historyPending || !session.entriesHydrated
+        ? 'history'
+        : null
+  const showEmptyCard = nothingYet && !!session && session.entriesHydrated && !session.historyPending
+
+  return (
+    
+      
+    
+    
+      
+        {loadingPhase ? (
+          
+        ) : showEmptyCard ? (
+          
+        ) : (
+         i.key}
+          renderItem={({ item }) => }
+          contentContainerStyle={{ paddingHorizontal: 16, paddingVertical: 12, gap: 6 }}
+          onScroll={onScroll}
+          scrollEventThrottle={64}
+          keyboardShouldPersistTaps="handled"
+          keyboardDismissMode="interactive"
+          // Long transcripts: render the tail first, mount the rest lazily.
+          initialNumToRender={12}
+          maxToRenderPerBatch={8}
+          windowSize={9}
+          ListHeaderComponent={
+            
+              {orphans.map((a) => (
+                
+              ))}
+              {showWorking && (
+                
+                  
+                    
+                  
+                  thinking…
+                
+              )}
+            
+          }
+          ListFooterComponent={
+            hidden > 0 ? (
+              
+                 setWindowSize((w) => w + (windowSetting > 0 ? windowSetting : 150))}>
+                  
+                    Show {Math.min(hidden, windowSetting > 0 ? windowSetting : 150)} earlier message{hidden === 1 ? '' : 's'}
+                  
+                
+                 setWindowSize(Infinity)}>
+                  Show all ({hidden + rows.length})
+                
+              
+            ) : undefined
+          }
+        />
+        )}
+        {awayFromBottom && !loadingPhase && !showEmptyCard && (
+           {
+              listRef.current?.scrollToOffset({ offset: 0, animated: true })
+              // An animated scroll across rows that haven't been measured
+              // yet can stop short on a long transcript; land it.
+              setTimeout(() => listRef.current?.scrollToOffset({ offset: 0, animated: false }), 450)
+            }}
+            accessibilityLabel="Jump to bottom"
+            style={{ position: 'absolute', right: 12, bottom: 12, flexDirection: 'row', alignItems: 'center', gap: 4, backgroundColor: c.accent, borderRadius: 999, paddingHorizontal: 14, minHeight: 44 }}
+          >
+            
+            Jump to bottom
+          
+        )}
+      
+      {sessionApprovals.length > 0 && (
+        
+          auto-allowing:
+          
+            {sessionApprovals.join(', ')}
+          
+           void client.api.clearJsonClaudeSessionToolApprovals(sessionId)}>
+            
+          
+        
+      )}
+       listRef.current?.scrollToOffset({ offset: 0, animated: false })}
+      />
+    
+    
+      
+    
+  )
+}
+
+function ChatLoading({ phase }: { phase: 'starting' | 'history' }) {
+  const [visible, setVisible] = useState(false)
+  useEffect(() => {
+    const t = setTimeout(() => setVisible(true), 250)
+    return () => clearTimeout(t)
+  }, [])
+  return (
+    
+      {visible && (
+        
+          
+            
+          
+          {phase === 'starting' ? 'Starting Claude…' : 'Loading conversation…'}
+        
+      )}
+    
+  )
+}
+
+/** The web's empty-chat card ("What are we going to build today?"). */
+function EmptyChat() {
+  return (
+    
+      
+        
+      
+      What are we going to build today?
+      Send a message to get started.
+    
+  )
+}
+
+function DisplayRow({ item }: { item: DisplayItem }) {
+  if (item.kind === 'turn') {
+    return (
+       r.hasError)} images={item.rows.flatMap((r) => r.images ?? [])}>
+        
+      
+    )
+  }
+  return 
+}
diff --git a/mobile/src/components/Markdown.tsx b/mobile/src/components/Markdown.tsx
new file mode 100644
index 00000000..52ccd250
--- /dev/null
+++ b/mobile/src/components/Markdown.tsx
@@ -0,0 +1,169 @@
+// Enough markdown for chat to read like the web client: paragraphs,
+// fenced code, headings, bullet/numbered lists, blockquotes, `inline
+// code`, **bold**, *italic*, [links](url). The desktop uses react-markdown
+// + GFM; a real app would swap in a full RN markdown renderer.
+// `preserveNewlines` mirrors USER_REMARK_PLUGINS (typed prompts keep
+// single line breaks instead of reflowing them into one paragraph).
+import { memo, type ReactElement } from 'react'
+import { Linking, ScrollView, StyleSheet, Text, View } from 'react-native'
+import { c, mono, themed } from '../theme'
+import { ChatImage } from '../chat/ChatImage'
+import { parseImageAlt, parseImageTitle, resolveLocalImageSrc } from '../../../src/shared/chat-image-src'
+import { CopyableMessage } from '../chat/CopyText'
+
+// `![alt](src)` — local paths are fetched from the backend, like the web's
+// MarkdownImage (jsonClaude:readAttachmentImage).
+const IMAGE_RE = /!\[([^\]]*)\]\(([^)\s]+)(?:\s+"([^"]*)")?\)/g
+
+interface Props {
+  text: string
+  size?: number
+  color?: string
+  italic?: boolean
+  preserveNewlines?: boolean
+}
+
+export const Markdown = memo(function Markdown({ text, size = 14, color = c.fg, italic, preserveNewlines }: Props) {
+  const base = { color, fontSize: size, lineHeight: Math.round(size * 1.5), fontStyle: italic ? ('italic' as const) : undefined }
+  const blocks: ReactElement[] = []
+  const parts = text.split(/```[^\n]*\n([\s\S]*?)(?:```|$)/g)
+  parts.forEach((part, i) => {
+    if (i % 2 === 1) {
+      blocks.push(
+        // Long-press copies / selects just the code (the message's own
+        // long-press is the next one out).
+        
+          
+            {part.replace(/\n$/, '')}
+          
+        
+      )
+      return
+    }
+    for (const [j, para] of part.split(/\n{2,}/).entries()) {
+      const trimmed = para.replace(/^\n+|\n+$/g, '')
+      if (!trimmed.trim()) continue
+      const key = `${i}-${j}`
+      const h = /^(#{1,6})\s+(.*)$/.exec(trimmed)
+      if (h) {
+        blocks.push(
+          
+            
+          
+        )
+        continue
+      }
+      const lines = trimmed.split('\n')
+      if (lines.every((l) => /^\s*>/.test(l))) {
+        blocks.push(
+          
+            
+               l.replace(/^\s*>\s?/, '')).join('\n')} />
+            
+          
+        )
+        continue
+      }
+      if (lines.every((l) => /^\s*([-*+]|\d+[.)])\s+/.test(l) || /^\s{2,}\S/.test(l))) {
+        blocks.push(
+          
+            {lines.map((l, k) => {
+              const m = /^(\s*)([-*+]|\d+[.)])\s+(.*)$/.exec(l)
+              if (!m) return null
+              const indent = Math.min(3, Math.floor(m[1].length / 2))
+              const bullet = /\d/.test(m[2]) ? m[2] : '•'
+              return (
+                
+                  {bullet}
+                  
+                    
+                  
+                
+              )
+            })}
+          
+        )
+        continue
+      }
+      const images = [...trimmed.matchAll(IMAGE_RE)]
+      const prose = images.length ? trimmed.replace(IMAGE_RE, '').trim() : trimmed
+      if (prose) {
+        blocks.push(
+          
+            
+          
+        )
+      }
+      if (images.length) {
+        blocks.push(
+          
+            {images.map((m, k) => {
+              // Same resolution + sizing rules as the desktop (shared
+              // chat-image-src): `#w=300` / `|400` / `"=400x300"` are size
+              // hints, not part of the path; an alt/title spec outranks a
+              // fragment.
+              const alt = parseImageAlt(m[1])
+              const title = parseImageTitle(m[3])
+              const local = resolveLocalImageSrc(m[2])
+              const size = alt.size ?? title.size ?? local?.size ?? null
+              return (
+                
+              )
+            })}
+          
+        )
+      }
+    }
+  })
+  return {blocks}
+})
+
+function Inline({ text }: { text: string }) {
+  const tokens = text.split(/(`[^`]+`|\*\*[^*]+\*\*|\[[^\]]+\]\([^)\s]+\)|\*[^*\s][^*\n]*\*)/g)
+  return (
+    <>
+      {tokens.map((t, i) => {
+        if (!t) return null
+        if (t.startsWith('`') && t.endsWith('`') && t.length > 1)
+          return (
+            
+              {t.slice(1, -1)}
+            
+          )
+        if (t.startsWith('**') && t.endsWith('**'))
+          return (
+            
+              {t.slice(2, -2)}
+            
+          )
+        const link = /^\[([^\]]+)\]\(([^)\s]+)\)$/.exec(t)
+        if (link)
+          return (
+             void Linking.openURL(link[2])}>
+              {link[1]}
+            
+          )
+        if (t.length > 2 && t.startsWith('*') && t.endsWith('*'))
+          return (
+            
+              {t.slice(1, -1)}
+            
+          )
+        return t
+      })}
+    
+  )
+}
+
+const s = themed(() => StyleSheet.create({
+  code: { fontFamily: mono, fontSize: 12.6, backgroundColor: c.panelRaised, color: c.fg },
+  codeBlock: { backgroundColor: c.panel, borderWidth: 1, borderColor: c.border, borderRadius: 6 },
+  codeBlockText: { fontFamily: mono, fontSize: 12, lineHeight: 18, color: c.fg }
+}))
diff --git a/mobile/src/components/Spin.tsx b/mobile/src/components/Spin.tsx
new file mode 100644
index 00000000..48075ce0
--- /dev/null
+++ b/mobile/src/components/Spin.tsx
@@ -0,0 +1,39 @@
+// `animate-spin` / `animate-pulse` equivalents. Native-driver animations
+// run off the JS thread, so a screen full of spinners costs nothing per
+// frame on the JS side.
+import { useEffect, useRef } from 'react'
+import { Animated, Easing, Platform } from 'react-native'
+
+// The web has no native animated module; JS timing is fine there.
+const native = Platform.OS !== 'web'
+
+export function Spin({ children }: { children: React.ReactNode }) {
+  const v = useRef(new Animated.Value(0)).current
+  useEffect(() => {
+    const a = Animated.loop(Animated.timing(v, { toValue: 1, duration: 1000, easing: Easing.linear, useNativeDriver: native }))
+    a.start()
+    return () => a.stop()
+  }, [v])
+  const rotate = v.interpolate({ inputRange: [0, 1], outputRange: ['0deg', '360deg'] })
+  return {children}
+}
+
+/** Tailwind's animate-pulse: opacity 1 → .5 → 1 over 2s. */
+export function Pulse({ children, active = true }: { children: React.ReactNode; active?: boolean }) {
+  const v = useRef(new Animated.Value(1)).current
+  useEffect(() => {
+    if (!active) {
+      v.setValue(1)
+      return
+    }
+    const a = Animated.loop(
+      Animated.sequence([
+        Animated.timing(v, { toValue: 0.5, duration: 1000, easing: Easing.bezier(0.4, 0, 0.6, 1), useNativeDriver: native }),
+        Animated.timing(v, { toValue: 1, duration: 1000, easing: Easing.bezier(0.4, 0, 0.6, 1), useNativeDriver: native })
+      ])
+    )
+    a.start()
+    return () => a.stop()
+  }, [v, active])
+  return {children}
+}
diff --git a/mobile/src/components/WorktreePicker.tsx b/mobile/src/components/WorktreePicker.tsx
new file mode 100644
index 00000000..02ee6601
--- /dev/null
+++ b/mobile/src/components/WorktreePicker.tsx
@@ -0,0 +1,781 @@
+// Port of MobileApp's WorktreePickerSheet + WorktreeList variant="touch"
+// (renderer/components/WorktreeList.tsx, WorktreeTab.tsx,
+// WorktreeActionSheet.tsx). The model — sections, homes, groups, tail,
+// accordion, cross-host merging — is the renderer's own
+// buildWorktreeListBase/applyProjectAccordion via src/fleet.ts; this file
+// only draws it. Row actions route to whichever backend owns the path.
+//
+// One addition over the web picker: with more than one backend enabled,
+// rows show the desktop sidebar's origin badge (Server icon + host label),
+// which the web's single-backend picker never needs.
+import { memo, useEffect, useRef, useState, type ReactNode } from 'react'
+import { Pressable, ScrollView, StyleSheet, Text, TextInput, View } from 'react-native'
+import {
+  AlarmClock,
+  AlertCircle,
+  ChevronDown,
+  ChevronRight,
+  Ghost,
+  GitPullRequest,
+  Layers,
+  Loader2,
+  Moon,
+  MoreHorizontal,
+  Pin,
+  PinOff,
+  RefreshCw,
+  Rows3,
+  Server,
+  Tag,
+  TriangleAlert,
+  X
+} from 'lucide-react-native'
+import type { MergedWorktreeData } from '../../../src/renderer/merge-backend-states'
+import type { WorktreeListGroupModel, WorktreeRepoSectionModel, WorktreeRowModel } from '../../../src/renderer/worktree-list-model'
+import { repoLabelFor } from '../../../src/renderer/worktree-list-model'
+import { detachedLikeTooltip, prIconStyle, type DisplayStatus } from '../../../src/renderer/worktree-row-style'
+import { formatPendingTool } from '../../../src/renderer/pending-tool'
+import { latestAgentReviewStatus } from '../../../src/shared/review-status'
+import { findLeafByTabId } from '../../../src/shared/state/terminals'
+import { formatWakeAt } from '../../../src/shared/state/snooze'
+import { DEFAULT_SIDEBAR_DETAILS } from '../../../src/shared/state/settings'
+import type { PendingWorktree } from '../../../src/shared/state/worktrees'
+import type { AssignedPR } from '../../../src/shared/state/assigned-prs'
+import { Fleet, useFleetEntries, useListModel } from '../fleet'
+import { useCollapse, type CollapseState } from '../collapse'
+import { alpha, c, fs, mono, themed, getThemeMode } from '../theme'
+import { tokenColor, tw } from '../tw'
+import { Pulse, Spin } from './Spin'
+
+const STATUS: Record = themed(() => ({
+  idle: { color: c.faint, pulse: false },
+  processing: { color: c.success, pulse: true },
+  waiting: { color: c.warning, pulse: false },
+  'needs-approval': { color: c.danger, pulse: true },
+  merged: { color: c.accent, pulse: false }
+}))
+
+const REPO_BG = ['teal-400', 'cyan-400', 'sky-400', 'blue-400', 'indigo-400', 'violet-400', 'purple-400', 'fuchsia-400', 'pink-400', 'slate-400']
+function hash(s: string): number {
+  let h = 0
+  for (let i = 0; i < s.length; i++) h = ((h << 5) - h + s.charCodeAt(i)) | 0
+  return Math.abs(h)
+}
+const repoBg = (name: string) => tokenColor(`bg-${REPO_BG[hash(name) % 10]}/60`, 'bg')!
+const repoText = (name: string) => tokenColor(`text-${REPO_BG[hash(name) % 10]}`, 'text')!
+
+function formatWorktreeAge(createdAt: number, now = Date.now()): string {
+  // Same rules as renderer/components/worktree-detail.ts.
+  if (!createdAt) return '—'
+  const ms = now - createdAt
+  if (ms < 0) return '—'
+  const hours = ms / 3_600_000
+  if (hours < 1) return '<1h'
+  const days = hours / 24
+  if (days < 1) return `${Math.floor(hours)}h`
+  if (days < 365) return `${Math.floor(days)}d`
+  return `${(days / 365).toFixed(1)}y`
+}
+
+interface Action {
+  label: string
+  icon: ReactNode
+  tone?: 'accent' | 'warning' | 'danger'
+  run: () => void
+  /** Run only after the sheet has finished closing — anything that wants
+   *  keyboard focus (alias editor) loses it to the modal's focus trap
+   *  otherwise. */
+  afterClose?: boolean
+}
+
+interface Ctx {
+  fleet: Fleet
+  merged: MergedWorktreeData
+  collapse: CollapseState
+  activeWorktreeId: string | null
+  multiBackend: boolean
+  snoozeDays: number
+  editingAlias: string | null
+  setEditingAlias: (p: string | null) => void
+  openSheet: (title: string, subtitle: string | undefined, actions: Action[]) => void
+  onSelect: (path: string) => void
+}
+
+export function WorktreePicker({
+  fleet,
+  merged,
+  activeWorktreeId,
+  onSelect,
+  onClose,
+  onOpenBackends
+}: {
+  fleet: Fleet
+  merged: MergedWorktreeData
+  activeWorktreeId: string | null
+  onSelect: (path: string) => void
+  onClose: () => void
+  onOpenBackends: () => void
+}) {
+  const collapse = useCollapse()
+  const model = useListModel(fleet, merged, collapse, activeWorktreeId)
+  const entries = useFleetEntries(fleet)
+  const loading = entries.some((e) => e.state.prs.loading)
+  const snoozeDays = Math.max(1, Math.floor(entries[0]?.state.settings.snoozeDefaultDays ?? 7))
+  const [editingAlias, setEditingAlias] = useState(null)
+  const [sheet, setSheet] = useState<{ title: string; subtitle?: string; actions: Action[] } | null>(null)
+  const repoCount = merged.repoRoots.length
+
+  const ctx: Ctx = {
+    fleet,
+    merged,
+    collapse,
+    activeWorktreeId,
+    multiBackend: fleet.getClients().length > 1,
+    snoozeDays,
+    editingAlias,
+    setEditingAlias,
+    openSheet: (title, subtitle, actions) => setSheet({ title, subtitle, actions }),
+    onSelect
+  }
+
+  return (
+    
+      
+        WORKTREES
+         collapse.setUnifiedRepos((v) => !v)}
+        >
+          {collapse.unifiedRepos ?  : }
+        
+        
+          
+        
+         fleet.getClients().forEach((cl) => void cl.api.refreshPRsAll())}>
+          {loading ? (
+            
+              
+            
+          ) : (
+            
+          )}
+        
+        
+          
+        
+      
+      
+        {entries.length === 0 && Connecting to your backends…}
+        {model.sections.map((section, i) => {
+          const prev = model.sections[i - 1]
+          const gap = !prev ? 0 : !prev.unified && !prev.collapsed && !prev.holdsActive ? 12 : 6
+          return (
+            
+              
+ + ) + })} + + setSheet(null)} /> + + ) +} + +// ── sections ───────────────────────────────────────────────────────────── + +function Section({ section, ctx, showRepoLabels }: { section: WorktreeRepoSectionModel; ctx: Ctx; showRepoLabels: boolean }) { + const home = section.homes[0] + return ( + + {!section.unified && + (home ? ( + + ctx.collapse.togglePinnedOpen(section.scope)} + /> + + ) : ( + ctx.collapse.togglePinnedOpen(section.scope)} /> + ))} + {section.unified && ( + + {section.homes.map((h) => ( + + + + ))} + + )} + {!section.collapsed && ( + + {!section.unified && + section.homes.slice(1).map((h) => ( + + + + ))} + {section.pending.map((p) => ( + + ))} + {section.workGroups.map((g) => ( + + ))} + {section.tail && ( + + g.label).join(' · ')} + count={section.tail.count} + collapsed={section.tail.collapsed} + onPress={() => { + for (const g of section.tail!.groups) if (g.collapsed === section.tail!.collapsed) ctx.collapse.toggleGroup(section.scope, g.key) + }} + /> + {!section.tail.collapsed && + section.tail.groups.map((g) => ( + + {section.tail!.groups.length > 1 && {g.label}} + {g.rows.map((r) => ( + + + + ))} + {g.phantomPRs.map((pr) => ( + + ))} + + ))} + + )} + + )} + + ) +} + +function Group({ group, scope, ctx, showRepoLabels }: { group: WorktreeListGroupModel; scope: string; ctx: Ctx; showRepoLabels: boolean }) { + return ( + + ctx.collapse.toggleGroup(scope, group.key)} /> + {!group.collapsed && ( + <> + {group.rows.map((r) => ( + + + + ))} + {group.phantomPRs.map((pr) => ( + + ))} + + )} + + ) +} + +function GroupHeader({ label, count, collapsed, onPress }: { label: string; count: number; collapsed: boolean; onPress: () => void }) { + return ( + [s.groupHead, pressed && { opacity: 0.7 }]} accessibilityRole="button" accessibilityState={{ expanded: !collapsed }}> + {collapsed ? : } + {label} + + {count} + + ) +} + +/** RowBlock: mx-1.5 rounded-md, bg-surface when active, /50 for context. */ +function Block({ active, context, children }: { active: boolean; context?: boolean; children: ReactNode }) { + return ( + + {children} + + ) +} + +function BareRepoHeader({ section, onPress }: { section: WorktreeRepoSectionModel; onPress: () => void }) { + return ( + + + + {section.repoName} + + {section.collapsed && section.count > 0 && {section.count}} + + {section.collapsed ? : } + + ) +} + +function RepoIcon({ name, status, diamond }: { name: string; status?: DisplayStatus; diamond?: boolean }) { + return ( + + {name[0]?.toUpperCase()} + {status && ( + + + + + + )} + + ) +} + +// ── rows ─────────────────────────────────────────────────────────────── + +function clientFor(ctx: Ctx, path: string) { + return ctx.fleet.client(ctx.merged.pathBackendId[path]) +} + +function rowActions(row: WorktreeRowModel, ctx: Ctx, isProject: boolean): Action[] { + const client = clientFor(ctx, row.path) + if (!client || row.deleting) return [] + const api = client.api + const out: Action[] = [ + { + label: row.alias ? 'Rename Alias…' : 'Alias Worktree…', + icon: , + run: () => ctx.setEditingAlias(row.path), + afterClose: true + } + ] + if (row.alias) out.push({ label: 'Clear Alias', icon: , run: () => void api.clearAlias(row.path) }) + const locked = row.worktree.isMain + if (!locked) { + out.push( + row.isPinned + ? { label: 'Unpin Worktree', icon: , tone: 'accent', run: () => void api.unpinWorktree(row.path) } + : { label: 'Pin Worktree', icon: , tone: 'accent', run: () => void api.pinWorktree(row.path) } + ) + out.push( + row.isSnoozed + ? { + label: row.snoozeWakeAt ? `Wakes ${formatWakeAt(row.snoozeWakeAt)} — tap to wake up` : 'Wake up', + icon: , + tone: 'accent', + run: () => void api.unsnooze(row.path) + } + : { + label: 'Snooze', + icon: , + tone: 'accent', + run: () => void api.snooze(row.path, Date.now() + ctx.snoozeDays * 86_400_000) + } + ) + } else if (row.isPinned) { + out.push({ label: 'Unpin Worktree', icon: , tone: 'accent', run: () => void api.unpinWorktree(row.path) }) + } + void isProject + return out +} + +function MoreBtn({ onPress }: { onPress: () => void }) { + return ( + [s.icon44, { marginRight: -8 }, pressed && { backgroundColor: c.surface }]} accessibilityLabel="Worktree actions"> + + + ) +} + +const ProjectRow = memo(function ProjectRow({ + row, + ctx, + name, + repoRoot, + collapsed, + count, + collapsedStatus, + pinnedOpen, + onTogglePinned +}: { + row: WorktreeRowModel + ctx: Ctx + name: string + repoRoot: string + collapsed?: boolean + count?: number + collapsedStatus?: DisplayStatus + pinnedOpen?: boolean + onTogglePinned?: () => void +}) { + const active = ctx.activeWorktreeId === row.path + const title = row.alias ?? name + const actions = rowActions(row, ctx, true) + void repoRoot + return ( + ctx.onSelect(row.path)} style={({ pressed }) => [s.projectRow, pressed && !active && { backgroundColor: c.panelRaised }]}> + + + {ctx.editingAlias === row.path ? ( + + ) : ( + + + {title} + + {collapsed && !!count && {count}} + {row.home?.showBranch && ( + + {row.worktree.branch} + + )} + {row.prStatus && } + + {row.shellActive && ( + + + + )} + + )} + {row.displayStatus === 'needs-approval' && row.pendingTool && ( + + {formatPendingTool(row.pendingTool)} + + )} + + {actions.length > 0 && ctx.openSheet(title, row.worktree.branch, actions)} />} + {onTogglePinned && ( + + + + )} + + ) +}) + +const Row = memo(function Row({ row, ctx }: { row: WorktreeRowModel; ctx: Ctx }) { + const active = ctx.activeWorktreeId === row.path + const label = row.alias ?? row.worktree.branch + const prunable = !!row.worktree.prunable + const actions = rowActions(row, ctx, false) + const st = STATUS[row.displayStatus] + const pr = row.prStatus + const detached = detachedLikeTooltip(row.worktree.branch) + return ( + ctx.onSelect(row.path)} + style={({ pressed }) => [s.row, row.deleting && { opacity: 0.6 }, pressed && !active && { backgroundColor: c.panelRaised }]} + > + {row.deleting ? ( + + + + ) : ( + + + + )} + {row.shellActive && ( + + + + )} + {row.isPinned && } + {pr && ( + + + {(pr.reviewDecision === 'approved' || pr.reviewDecision === 'changes_requested') && ( + + )} + + )} + + + {ctx.editingAlias === row.path ? ( + + ) : ( + + {detached && } + + {label} + + {prunable && ( + + + STALE + + )} + + )} + + + {actions.length > 0 && ctx.openSheet(label, row.alias ? row.worktree.branch : undefined, actions)} />} + + ) +}) + +function Subtitle({ row, ctx, active, prunable }: { row: WorktreeRowModel; ctx: Ctx; active: boolean; prunable: boolean }) { + const tone = active ? c.muted : c.faint + if (row.displayStatus === 'needs-approval' && row.pendingTool) { + return ( + + {formatPendingTool(row.pendingTool)} + + ) + } + if (prunable) { + const segs = row.path.split('/') + return ( + + {row.repoLabel ? ( + <> + {row.repoLabel} · {segs.pop()} + + ) : ( + segs.slice(-2).join('/') + )} + + ) + } + // Touch forces comfy density but reads the prefs of the user's desktop + // density — same quirk as the web (WorktreeList.tsx:176-177). + const st = ctx.fleet.client(ctx.merged.pathBackendId[row.path])?.getState().settings + const prefs = st?.sidebarDetails?.[st.sidebarDensity ?? 'comfy'] ?? DEFAULT_SIDEBAR_DETAILS.comfy + const pr = row.prStatus + const backendId = ctx.merged.pathBackendId[row.path] + const origin = ctx.multiBackend && backendId ? ctx.merged.backendMeta[backendId]?.label : undefined + return ( + + {origin && ( + + + + {origin} + + + )} + {prefs.repoLabel && row.repoLabel && ( + + {row.repoLabel} + + )} + {prefs.branch && row.alias && ( + + {row.worktree.branch} + + )} + {prefs.age && {formatWorktreeAge(row.worktree.createdAt)}} + {prefs.diff && pr?.additions !== undefined && pr?.deletions !== undefined && ( + + +{pr.additions} + −{pr.deletions} + + )} + {prefs.milestone && pr?.milestone && ( + + {pr.milestone.title} + + )} + {prefs.prNumber && pr && ( + + #{pr.number} + + )} + + ) +} + +function ReviewIcon({ row, ctx, size }: { row: WorktreeRowModel; ctx: Ctx; size: number }) { + const state = ctx.fleet.client(ctx.merged.pathBackendId[row.path])?.getState() + if (!state) return null + const tree = state.terminals.panes[row.path] + const { kind, unsent, reviewerTabId } = latestAgentReviewStatus(state.reviews.byPath[row.path], (id) => !!tree && !!findLeafByTabId(tree, id)) + if (kind === 'none') return null + const reviewer = reviewerTabId ? state.terminals.statuses[reviewerTabId] : undefined + let cls: string + let IconName: string + if (kind === 'reviewing') { + if (reviewer === 'processing') [IconName, cls] = ['Loader2', 'text-accent animate-spin'] + else if (reviewer === 'needs-approval') [IconName, cls] = ['ListChecks', 'text-danger animate-pulse'] + else [IconName, cls] = ['ListChecks', 'text-accent opacity-60'] + } else if (kind === 'approve') [IconName, cls] = ['CircleCheck', 'text-success'] + else if (kind === 'changes-requested') [IconName, cls] = ['CircleAlert', 'text-warning'] + else [IconName, cls] = ['MessageSquare', 'text-info'] + // The lucide shim maps the desktop's class names to RN props. + // eslint-disable-next-line @typescript-eslint/no-require-imports + const Icons = require('../shims/lucide-react.js') as Record ReactNode> + const Icon = Icons[IconName] + return ( + + + {unsent && } + + ) +} + +function AliasEditor({ row, ctx }: { row: WorktreeRowModel; ctx: Ctx }) { + const [value, setValue] = useState(row.alias ?? '') + const done = useRef(false) + const commit = () => { + if (done.current) return + done.current = true + // Server trims and treats empty as clear (main/index.ts aliases:set). + void clientFor(ctx, row.path)?.api.setAlias(row.path, value) + ctx.setEditingAlias(null) + } + return ( + + ) +} + +function PendingRow({ pending, ctx }: { pending: PendingWorktree; ctx: Ctx }) { + const failed = pending.status === 'error' + const owner = ctx.fleet.client(ctx.merged.pendingBackendId[pending.id]) + return ( + + {failed ? ( + + ) : ( + + + + )} + + + {pending.branchName} + + {failed ? 'Failed to create' : 'Creating worktree…'} + + {failed && owner && ( + void owner.api.dismissPendingWorktree(pending.id)} accessibilityLabel="Dismiss"> + + + )} + + ) +} + +function PhantomRow({ pr, showRepo }: { pr: AssignedPR; showRepo: boolean }) { + // Not tappable on mobile (MobileApp passes no onOpenAssignedPR). + return ( + + + + + #{pr.number} + {pr.title} + + + {showRepo ? `${repoLabelFor(pr.repoRoot)} · ` : ''} + {pr.author?.login ? `by ${pr.author.login}` : 'assigned to you'} + + + + ) +} + +// ── action sheet (WorktreeActionSheet.tsx) ────────────────────────────── + +function ActionSheet({ sheet, onClose }: { sheet: { title: string; subtitle?: string; actions: Action[] } | null; onClose: () => void }) { + // In-tree overlay rather than RN : react-native-web's Modal + // intermittently fails to re-show after a close and leaves its focus + // trap behind, which stole the alias editor's focus. + if (!sheet) return null + const toneColor = (t?: Action['tone']) => (t === 'accent' ? c.accent : t === 'warning' ? c.warning : t === 'danger' ? c.danger : c.fgBright) + return ( + + + + + + {sheet.title} + + {sheet.subtitle ? {sheet.subtitle} : null} + + + {sheet.actions.map((a) => ( + { + onClose() + // Let the overlay unmount before anything grabs focus. + if (a.afterClose) setTimeout(a.run, 0) + else a.run() + }} + style={({ pressed }) => [s.actionItem, pressed && { backgroundColor: c.surface }]} + > + {a.icon} + {a.label} + + ))} + [s.actionItem, { borderBottomWidth: 0 }, pressed && { backgroundColor: c.surface }]}> + Cancel + + + + + + ) +} + +function IconBtn({ label, onPress, disabled, children }: { label: string; onPress: () => void; disabled?: boolean; children: ReactNode }) { + return ( + [s.icon44, { opacity: disabled ? 0.4 : 1 }, pressed && { backgroundColor: c.surface }]} + > + {children} + + ) +} + +const s = themed(() => StyleSheet.create({ + sheet: { ...(StyleSheet.absoluteFill as object), backgroundColor: c.app, zIndex: 30 }, + head: { flexDirection: 'row', alignItems: 'center', paddingLeft: 12, paddingRight: 4, borderBottomWidth: 1, borderColor: c.border, backgroundColor: c.panel }, + headTitle: { flex: 1, color: c.dim, fontSize: fs.xs, fontWeight: '600', letterSpacing: 1.2 }, + icon44: { width: 44, height: 44, alignItems: 'center', justifyContent: 'center', borderRadius: 4 }, + dimText: { color: c.dim, fontSize: fs.sm }, + faintXs: { color: c.faint, fontSize: fs.xs }, + groupHead: { flexDirection: 'row', alignItems: 'center', gap: 4, paddingHorizontal: 12, minHeight: 44, backgroundColor: alpha(c.app, 0.95) }, + projectRow: { flexDirection: 'row', alignItems: 'center', gap: 10, paddingHorizontal: 8, minHeight: 56, paddingVertical: 10, borderRadius: 6 }, + projectName: { color: c.fgBright, fontSize: 16, fontWeight: '600', flexShrink: 1 }, + branchPill: { maxWidth: '50%', backgroundColor: c.surface, borderRadius: 3, paddingHorizontal: 4, fontSize: fs.xs, color: c.dim, fontFamily: mono }, + pendingTool: { color: c.danger, fontSize: fs.xs, fontFamily: mono, marginTop: 2 }, + row: { flexDirection: 'row', alignItems: 'center', gap: 8, paddingHorizontal: 8, minHeight: 44, paddingVertical: 12 }, + rowLabel: { fontSize: fs.sm, fontWeight: '500', flexShrink: 1 }, + stale: { flexDirection: 'row', alignItems: 'center', gap: 3, paddingHorizontal: 6, paddingVertical: 2, borderRadius: 2, backgroundColor: alpha(c.warning, 0.15) }, + prPill: { flexShrink: 0, paddingHorizontal: 6, paddingVertical: 1, borderRadius: 999, backgroundColor: c.panel, borderWidth: 1, borderColor: c.borderStrong }, + actionSheet: { backgroundColor: c.panel, borderTopWidth: 1, borderColor: c.borderStrong, borderTopLeftRadius: 12, borderTopRightRadius: 12 }, + actionItem: { flexDirection: 'row', alignItems: 'center', gap: 12, paddingHorizontal: 16, minHeight: 48, borderBottomWidth: 1, borderColor: c.border } +})) diff --git a/mobile/src/fleet.ts b/mobile/src/fleet.ts new file mode 100644 index 00000000..3936991d --- /dev/null +++ b/mobile/src/fleet.ts @@ -0,0 +1,153 @@ +// Every enabled backend projected into the same `BackendStateLike[]` the +// desktop renderer feeds `getMergedWorktrees`, so the worktree list, its +// cross-host repo merging and its grouping come from the renderer's own +// pure model code rather than a re-implementation. +// +// Reference stability is the whole game (same as the desktop's +// SegmentedSelector): `entries` is a new array only when some backend's +// AppState object actually changed, and getMergedWorktrees / +// buildWorktreeListBase hand back previous results when nothing they read +// moved — so a streamed token on one chat doesn't rebuild the list. +import { useMemo, useSyncExternalStore } from 'react' +import type { AppState } from '../../src/shared/state' +import { getMergedWorktrees, type BackendStateLike, type MergedWorktreeData } from '../../src/renderer/merge-backend-states' +import { + applyProjectAccordion, + buildWorktreeListBase, + type WorktreeListModel +} from '../../src/renderer/worktree-list-model' +import type { NessClient } from './ness' +import type { CollapseState } from './collapse' + +export class Fleet { + private entries: readonly BackendStateLike[] = [] + private listeners = new Set<() => void>() + private unsubs: (() => void)[] = [] + private clients: NessClient[] = [] + + setClients(clients: NessClient[]): void { + if (sameList(clients, this.clients)) return + for (const u of this.unsubs) u() + this.clients = clients + this.unsubs = clients.map((c) => c.subscribe(() => this.refresh())) + this.refresh(true) + } + + getClients = (): NessClient[] => this.clients + getEntries = (): readonly BackendStateLike[] => this.entries + + client(id: string | undefined): NessClient | undefined { + return this.clients.find((c) => c.id === id) + } + + subscribe = (l: () => void): (() => void) => { + this.listeners.add(l) + return () => this.listeners.delete(l) + } + + private refresh(force = false): void { + // A backend with no snapshot yet contributes nothing (its state is + // initialState); including it would just add empty sections. + const next = this.clients + .filter((c) => c.getConn().hasSnapshot) + .map((c) => ({ backendId: c.id, label: c.label, kind: 'remote' as const, state: c.getState() })) + const prev = this.entries + const unchanged = + !force && + next.length === prev.length && + next.every((e, i) => e.backendId === prev[i].backendId && e.state === prev[i].state) + if (unchanged) return + this.entries = next + for (const l of this.listeners) l() + } +} + +function sameList(a: NessClient[], b: NessClient[]): boolean { + return a.length === b.length && a.every((c, i) => c === b[i]) +} + +export function useFleetEntries(fleet: Fleet): readonly BackendStateLike[] { + return useSyncExternalStore(fleet.subscribe, fleet.getEntries) +} + +/** Fleet view is always 'merged' on the phone: there's no backend chip + * strip, every enabled host is listed at once. */ +export function useMerged(fleet: Fleet): MergedWorktreeData { + return mergedFor(useFleetEntries(fleet)) +} + +export function mergedFor(entries: readonly BackendStateLike[]): MergedWorktreeData { + return getMergedWorktrees(entries, 'merged', entries[0]?.backendId ?? '') +} + +/** The worktree list the picker shows, as a plain function: the base + * build on merged inputs (same as useWorktreeListModel in + * renderer/hooks/useWorktreeListModel.ts), then the accordion pass. The + * hook below memoizes the two steps; the contract test calls this. */ +export function listModelFor( + entries: readonly BackendStateLike[], + merged: MergedWorktreeData, + collapse: Pick, + activeWorktreeId: string | null +): WorktreeListModel { + return applyProjectAccordion(listBaseFor(entries, merged, collapse), activeWorktreeId, collapse.pinnedOpenRepos) +} + +function listBaseFor( + entries: readonly BackendStateLike[], + merged: MergedWorktreeData, + collapse: Pick +): WorktreeListModel { + return buildWorktreeListBase({ + worktrees: merged.flatWorktrees, + repoRoots: merged.repoRoots, + repoBackendId: merged.repoBackendId, + repoRemotes: merged.repoRemotes, + pendingWorktrees: merged.pendingWorktrees, + pendingDeletions: merged.pendingDeletions, + tabsByWorktree: merged.tabsByWorktree, + statuses: merged.statuses, + pendingTools: merged.pendingTools, + shellActivity: merged.shellActivity, + prStatuses: merged.prStatuses, + mergedPaths: merged.mergedPaths, + snoozeByPath: merged.snoozeByPath, + pinnedPaths: merged.pinnedPaths, + aliases: merged.aliases, + viewerLogin: entries[0]?.state.settings.viewerLogin ?? null, + assignedPRsByRepo: merged.assignedPRsByRepo, + unifiedRepos: collapse.unifiedRepos, + isGroupCollapsed: collapse.isGroupCollapsed, + // Touch doesn't bind Cmd+N, same as MobileApp's picker. + assignOrdinals: false, + projectOrder: entries[0]?.state.settings.sidebarProjectOrder + }) +} + +export function useListModel( + fleet: Fleet, + merged: MergedWorktreeData, + collapse: CollapseState, + activeWorktreeId: string | null +): WorktreeListModel { + const entries = useFleetEntries(fleet) + const viewerLogin = entries[0]?.state.settings.viewerLogin ?? null + const projectOrder = entries[0]?.state.settings.sidebarProjectOrder + const { unifiedRepos, isGroupCollapsed, pinnedOpenRepos } = collapse + const base = useMemo( + () => listBaseFor(entries, merged, { unifiedRepos, isGroupCollapsed }), + // entries is read only for viewerLogin / projectOrder (listed instead, + // so a streamed token on one chat doesn't rebuild the list). + // eslint-disable-next-line react-hooks/exhaustive-deps + [merged, viewerLogin, unifiedRepos, isGroupCollapsed, projectOrder] + ) + return useMemo( + () => applyProjectAccordion(base, activeWorktreeId, pinnedOpenRepos), + [base, activeWorktreeId, pinnedOpenRepos] + ) +} + +/** Read one slice value from whichever backend owns `path`. */ +export function stateFor(fleet: Fleet, merged: MergedWorktreeData, path: string): AppState | undefined { + return fleet.client(merged.pathBackendId[path])?.getState() +} diff --git a/mobile/src/global-jsx.d.ts b/mobile/src/global-jsx.d.ts new file mode 100644 index 00000000..f86bab09 --- /dev/null +++ b/mobile/src/global-jsx.d.ts @@ -0,0 +1,13 @@ +// Renderer modules reused from ../src (tool-icons, NessMark, …) annotate +// returns as the global `JSX.Element`, which React 19's types no longer +// declare globally. Alias it so those files type-check from mobile/. +import type { JSX as ReactJSX } from 'react' + +declare global { + // eslint-disable-next-line @typescript-eslint/no-namespace + namespace JSX { + type Element = ReactJSX.Element + // eslint-disable-next-line @typescript-eslint/no-empty-object-type + interface IntrinsicElements extends ReactJSX.IntrinsicElements {} + } +} diff --git a/mobile/src/launchUrl.ts b/mobile/src/launchUrl.ts new file mode 100644 index 00000000..e4adea3a --- /dev/null +++ b/mobile/src/launchUrl.ts @@ -0,0 +1,27 @@ +// The app's launch URL, at most once. iOS / Expo Go hand back the SAME +// initial URL on every cold start and full reload of an app that was +// opened from a link — so a pairing QR (…/pair?url=…) kept re-adding and +// re-enabling its backend after the user had switched it off, and an +// open link (…/open?wt=…) kept yanking them back to that chat. A link is +// acted on the first time it's seen; replays of the same URL are ignored. +// Links that arrive while running (Linking 'url' events) are always fresh +// and don't go through here. +import AsyncStorage from '@react-native-async-storage/async-storage' +import { Linking } from 'react-native' + +const KEY = 'ness.mobile.consumedLaunchUrl' +let pending: Promise | null = null + +export function consumeLaunchUrl(): Promise { + if (!pending) { + pending = (async () => { + const url = await Linking.getInitialURL() + if (!url) return null + const last = await AsyncStorage.getItem(KEY) + if (last === url) return null + await AsyncStorage.setItem(KEY, url) + return url + })() + } + return pending +} diff --git a/mobile/src/ness.ts b/mobile/src/ness.ts new file mode 100644 index 00000000..765b3210 --- /dev/null +++ b/mobile/src/ness.ts @@ -0,0 +1,132 @@ +// Mobile client mirror, one per backend. Same shape as the renderer's +// ClientStore (src/renderer/store.ts): snapshot → mergeWireSnapshot, then +// every state frame through the shared rootReducer. The desktop's +// multi-backend registry is the same idea — one (transport, store) pair +// per backend, no cross-backend event routing. +import { useSyncExternalStore } from 'react' +import { WebSocketClientTransport } from '../../src/shared/transport/transport-websocket' +import { + initialState, + mergeWireSnapshot, + rootReducer, + type AppState +} from '../../src/shared/state' +import type { PaneNode, PtyStatus, TerminalTab } from '../../src/shared/state/terminals' +import { ROLLUP_STATUS_RANK } from '../../src/shared/status-rollup' +import { buildBackend } from '../../src/renderer/build-backend' +import type { ElectronAPI } from '../../src/renderer/types' +import type { LocalTransportHandle } from '../../src/shared/transport/transport' + +type Listener = () => void + +export interface ConnState { + connected: boolean + hasSnapshot: boolean + error?: string +} + +export class NessClient { + private state: AppState = initialState + private conn: ConnState = { connected: false, hasSnapshot: false } + private listeners = new Set() + readonly transport: WebSocketClientTransport + /** The desktop renderer's own typed backend API (build-backend.ts), bound + * to this connection. Every request and signal goes through it — never a + * hand-written channel string — so a server-side rename or signature + * change updates build-backend.ts and fails the mobile typecheck in CI + * instead of silently breaking the phone. */ + readonly api: ElectronAPI + + constructor( + readonly id: string, + readonly label: string, + readonly wsUrl: string, + readonly token: string + ) { + this.transport = new WebSocketClientTransport({ + url: wsUrl, + token, + onSnapshot: (snap) => { + this.state = mergeWireSnapshot(snap.state) + this.conn = { ...this.conn, hasSnapshot: true } + this.emit() + }, + onConnectionChange: (connected, reason) => { + this.conn = { ...this.conn, connected, error: connected ? undefined : reason } + this.emit() + } + }) + const t = this.transport + // Rejections are logged, not thrown: a fire-and-forget UI tap on a + // dropped connection shouldn't become an unhandled promise. + const handle: LocalTransportHandle = { + getStateSnapshot: () => t.getStateSnapshot(), + onStateEvent: (cb) => t.onStateEvent(cb), + request: (name, ...args) => { + const p = t.request(name, ...args) + p.catch((e: unknown) => console.warn(`[ness] ${name} failed`, e)) // eslint-disable-line no-console + return p + }, + send: (name, ...args) => t.send(name, ...args), + onSignal: (name, h) => t.onSignal(name, h), + getClientId: () => t.getClientId(), + onReconnect: (cb) => t.onReconnect(cb) + } + this.api = buildBackend(() => handle, () => handle, null) + this.transport.onStateEvent((event) => { + this.state = rootReducer(this.state, event) + this.emit() + }) + } + + connect(): void { + this.transport.connect().catch(() => { + // the transport schedules its own retry; ConnState carries the reason + }) + } + + close(): void { + this.transport.close() + } + + getState = (): AppState => this.state + getConn = (): ConnState => this.conn + + subscribe = (l: Listener): (() => void) => { + this.listeners.add(l) + return () => this.listeners.delete(l) + } + + private emit(): void { + for (const l of this.listeners) l() + } + +} + +export function useNess(client: NessClient, select: (s: AppState) => T): T { + return useSyncExternalStore(client.subscribe, () => select(client.getState())) +} + +export function useConn(client: NessClient): ConnState { + return useSyncExternalStore(client.subscribe, client.getConn) +} + +export function tabsOf(pane: PaneNode | undefined): TerminalTab[] { + if (!pane) return [] + if (pane.type === 'leaf') return pane.tabs + return [...tabsOf(pane.children[0]), ...tabsOf(pane.children[1])] +} + +export function chatTabsOf(state: AppState, worktreePath: string): TerminalTab[] { + return tabsOf(state.terminals.panes[worktreePath]).filter((t) => t.type === 'json-claude') +} + +/** Same rollup the sidebar uses: highest-ranked tab status wins. */ +export function rollupStatus(state: AppState, worktreePath: string): PtyStatus { + let best: PtyStatus = 'idle' + for (const tab of tabsOf(state.terminals.panes[worktreePath])) { + const s = state.terminals.statuses[tab.id] + if (s && ROLLUP_STATUS_RANK[s] > ROLLUP_STATUS_RANK[best]) best = s + } + return best +} diff --git a/mobile/src/panels/AgentsPanel.tsx b/mobile/src/panels/AgentsPanel.tsx new file mode 100644 index 00000000..21d2203c --- /dev/null +++ b/mobile/src/panels/AgentsPanel.tsx @@ -0,0 +1,444 @@ +// Port of renderer/components/JsonClaudeAgentsPanel.tsx, with its helpers +// (useSessionAgents, AgentStatusDot, AgentStepLine, AgentPeek) ported +// alongside. Tree/elapsed/status logic is the shared +// json-claude-agents module; the peek is an RN Modal instead of a portal. +// The row's hover title (kind, status, tool count) is in the peek's header, +// which tapping the row opens — same as the desktop's click target. +import { useCallback, useEffect, useMemo, useRef, useState } from 'react' +import { Modal, Pressable, ScrollView, Text, View, type ScrollViewInstance } from 'react-native' +import { Brain, CornerDownRight, Loader2, MessageSquare, Sparkles, Wrench, X } from 'lucide-react-native' +import { + agentElapsedMs, + buildAgentTree, + collectAgents, + countRunningAgents, + formatElapsed, + isSubAgentToolName, + type AgentStep, + type AgentSummary, + type AgentTree +} from '../../../src/shared/state/json-claude-agents' +import type { JsonClaudePendingApproval } from '../../../src/shared/state/json-claude' +import { extractArgs, getToolDisplay } from '../../../src/renderer/components/json-mode-cards/tool-display' +import { useSessionRevision } from '../../../src/renderer/session-revision' +import { useNess, type NessClient } from '../ness' +import { alpha, c, fs } from '../theme' +import { Spin } from '../components/Spin' +import { Markdown } from '../components/Markdown' +import { ToolIcon } from '../chat/cards' +import { RightPanel } from './RightPanel' +import type { PanelProps } from './types' + +/** Top-level agents shown before collapsing the rest behind a toggle. */ +const SETTLED_PREVIEW = 5 +/** max-h-72 on the desktop's RightPanel. */ +const MAX_H = 288 +/** AgentPeek's TEXT_PREVIEW. */ +const TEXT_PREVIEW = 600 + +// ── copied from renderer/hooks/useSessionAgents.ts ───────────────────── + +function pendingToolUseIdsKey(approvals: Record, sessionId: string | undefined): string { + if (!sessionId) return '' + const ids: string[] = [] + for (const p of Object.values(approvals)) { + if (p.sessionId === sessionId && p.toolUseId) ids.push(p.toolUseId) + } + return ids.sort().join('\n') +} + +function useSessionAgents(client: NessClient, tabSessionId: string): { agents: AgentSummary[]; running: number } { + const session = useNess(client, (s) => s.jsonClaude.sessions[tabSessionId] ?? null) + const sessionId = session?.sessionId + const pendingKey = useNess(client, (s) => pendingToolUseIdsKey(s.jsonClaude.pendingApprovals, sessionId)) + const pendingToolUseIds = useMemo(() => new Set(pendingKey ? pendingKey.split('\n') : []), [pendingKey]) + + const sessionRef = useRef(session) + sessionRef.current = session + const runningRef = useRef(0) + const revision = useSessionRevision(session, runningRef.current > 0) + const prevAgentsRef = useRef([]) + const agents = useMemo(() => { + const next = collectAgents(sessionRef.current, pendingToolUseIds, prevAgentsRef.current) + prevAgentsRef.current = next + return next + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [revision, pendingToolUseIds]) + + const running = countRunningAgents(agents) + runningRef.current = running + return { agents, running } +} + +// ── from JsonClaudeAgentsPanel.tsx ───────────────────────────────────── + +/** One shared 1s clock, only while something is running. */ +function useLiveClock(active: boolean): number { + const [now, setNow] = useState(() => Date.now()) + useEffect(() => { + if (!active) return + setNow(Date.now()) + const id = setInterval(() => setNow(Date.now()), 1000) + return () => clearInterval(id) + }, [active]) + return now +} + +// ── copied from renderer/components/AgentStatusDot.tsx ───────────────── + +function agentStatusLabel(agent: AgentSummary): string { + if (agent.hasPendingApproval) return 'needs approval' + switch (agent.status) { + case 'running': + return 'running' + case 'completed': + return 'done' + case 'failed': + return 'failed' + case 'interrupted': + return 'interrupted' + } +} + +function Spinner() { + return ( + + + + ) +} + +function AgentStatusDot({ agent }: { agent: AgentSummary }) { + if (agent.hasPendingApproval) { + return ( + + ⚠ + + ) + } + if (agent.status === 'running') return + const color = agent.status === 'completed' ? c.success : agent.status === 'failed' ? c.danger : c.faint + const glyph = agent.status === 'completed' ? '✓' : agent.status === 'failed' ? '✕' : '⊘' + return ( + + {glyph} + + ) +} + +// ── copied from renderer/components/AgentStepLine.tsx ────────────────── + +const SUBJECT_KEYS = ['file_path', 'path', 'command', 'pattern', 'query', 'url', 'prompt', 'description', 'subject'] + +function summarizeStepArgs(step: AgentStep): string { + if (step.kind !== 'tool') return '' + const args = extractArgs(step.input) + if (args.length === 0) return '' + const preferred = SUBJECT_KEYS.map((k) => args.find((a) => a.key === k)).find(Boolean) ?? args[0] + return preferred.value.replace(/\s+/g, ' ').trim() +} + +function AgentStepLine({ step, dim = false }: { step: AgentStep; dim?: boolean }) { + const row = { flexDirection: 'row' as const, alignItems: 'center' as const, gap: 6, minWidth: 0, flex: 1 } + if (step.kind === 'thinking') { + return ( + + + + thinking + + + ) + } + if (step.kind === 'text') { + return ( + + + + {step.text} + + + ) + } + const nested = isSubAgentToolName(step.toolName) + const display = getToolDisplay(step.toolName) + const detail = summarizeStepArgs(step) + const iconColor = step.isError ? c.danger : c.muted + return ( + + {nested ? ( + + ) : display.icon ? ( + + ) : ( + + )} + {display.compactLabel} + {!!detail && ( + + {detail} + + )} + + ) +} + +// ── AgentRow ─────────────────────────────────────────────────────────── + +function AgentRow({ + agent, + tree, + now, + depth, + isExpanded, + onToggle, + onPeek +}: { + agent: AgentSummary + tree: AgentTree + now: number + depth: number + isExpanded: (id: string) => boolean + onToggle: (id: string) => void + onPeek: (id: string) => void +}) { + const children = tree.childrenByParent.get(agent.toolUseId) ?? [] + const expanded = children.length > 0 && isExpanded(agent.toolUseId) + const lastStep = agent.steps.length ? agent.steps[agent.steps.length - 1] : null + const running = agent.status === 'running' + const elapsed = formatElapsed(agentElapsedMs(agent, now)) + return ( + + + {children.length > 0 ? ( + onToggle(agent.toolUseId)} + accessibilityState={{ expanded }} + accessibilityLabel={`${expanded ? 'Hide' : 'Show'} ${children.length} nested`} + hitSlop={{ left: 12, right: 4 }} + style={{ width: 28, minHeight: 44, justifyContent: 'center' }} + > + {expanded ? '▾' : '▸'} + + ) : ( + + )} + onPeek(agent.toolUseId)} + style={({ pressed }) => ({ flex: 1, minWidth: 0, minHeight: 44, justifyContent: 'center', paddingVertical: 4, backgroundColor: pressed ? c.app : 'transparent' })} + > + + + + {agent.description} + + {children.length > 0 && !expanded && ( + + + {children.length} + + )} + {agent.isBackground && ( + + bg + + )} + {elapsed} + + {running && lastStep && ( + + + + )} + + + {expanded && + children.map((child) => ( + + ))} + + ) +} + +// ── port of renderer/components/AgentPeek.tsx ────────────────────────── + +function AgentPeek({ agent, now, onClose, onPeekAgent }: { agent: AgentSummary; now: number; onClose: () => void; onPeekAgent: (id: string) => void }) { + const feedRef = useRef(null) + // Follow the tail only while the user hasn't scrolled away. + const pinnedToBottomRef = useRef(true) + + const elapsed = formatElapsed(agentElapsedMs(agent, now)) + const usage = agent.usage + const meta = [ + agent.subagentType, + agent.model, + `${agent.toolCount} ${agent.toolCount === 1 ? 'tool' : 'tools'}`, + usage?.totalTokens !== undefined ? `${Math.round(usage.totalTokens / 1000)}k tokens` : null, + elapsed + ].filter(Boolean) as string[] + + return ( + + + {}} + style={{ width: '100%', maxWidth: 704, height: '82%', backgroundColor: c.panel, borderWidth: 1, borderColor: c.border, borderRadius: 12, overflow: 'hidden' }} + > + + + + {agent.description} + + {agent.isBackground && ( + + background + + )} + + {agentStatusLabel(agent)} + + + + + + + {meta.map((m) => ( + + {m} + + ))} + {agent.parentDescription && ( + + via {agent.parentDescription} + + )} + + + { + const { contentSize, contentOffset, layoutMeasurement } = e.nativeEvent + pinnedToBottomRef.current = contentSize.height - contentOffset.y - layoutMeasurement.height < 32 + }} + onContentSizeChange={() => { + if (pinnedToBottomRef.current) feedRef.current?.scrollToEnd({ animated: false }) + }} + > + {agent.steps.length === 0 && ( + + {agent.status === 'running' ? 'agent is starting…' : 'no activity recorded'} + + )} + {agent.steps.map((step) => + step.kind === 'text' ? ( + + TEXT_PREVIEW ? `${step.text.slice(0, TEXT_PREVIEW)}…` : (step.text ?? '')} /> + + ) : step.childAgentToolUseId ? ( + onPeekAgent(step.childAgentToolUseId!)} + style={({ pressed }) => ({ minHeight: 44, justifyContent: 'center', paddingHorizontal: 4, borderRadius: 4, backgroundColor: pressed ? alpha(c.app, 0.6) : 'transparent', flexDirection: 'row' })} + > + + + ) : ( + + + + ) + )} + {agent.status === 'running' && ( + + + working… + + )} + + + {agent.result && ( + + + {agent.resultIsError ? 'error' : 'report'} + + + + + + )} + + + + ) +} + +// ── panel ────────────────────────────────────────────────────────────── + +export function AgentsPanel({ client, focusedTabId }: PanelProps) { + const { agents, running } = useSessionAgents(client, focusedTabId ?? '') + const [peekId, setPeekId] = useState(null) + const [showAllSettled, setShowAllSettled] = useState(false) + // Explicit user choices only; rows with a running descendant default open. + const [overrides, setOverrides] = useState>(() => new Map()) + + const tree = useMemo(() => buildAgentTree(agents), [agents]) + const now = useLiveClock(running > 0) + + const expandedFor = useCallback((id: string): boolean => overrides.get(id) ?? tree.hasRunningDescendant.has(id), [overrides, tree]) + const toggleExpanded = useCallback( + (id: string): void => + setOverrides((cur) => { + const next = new Map(cur) + next.set(id, !(cur.get(id) ?? tree.hasRunningDescendant.has(id))) + return next + }), + [tree] + ) + + // A peek whose agent vanished would trap the overlay — drop it. + const peeked = peekId ? agents.find((a) => a.toolUseId === peekId) : undefined + useEffect(() => { + if (peekId && !peeked) setPeekId(null) + }, [peekId, peeked]) + + if (agents.length === 0) return null + + // Only top-level agents are capped; `roots` is running-first. + const runningRoots = tree.roots.filter((a) => a.status === 'running').length + const settledRoots = tree.roots.length - runningRoots + const hiddenCount = showAllSettled ? 0 : Math.max(0, settledRoots - SETTLED_PREVIEW) + const shown = hiddenCount > 0 ? tree.roots.slice(0, runningRoots + SETTLED_PREVIEW) : tree.roots + + return ( + <> + {running > 0 ? `${running} running` : `${agents.length} done`} + } + > + + {shown.map((a) => ( + + ))} + {settledRoots > SETTLED_PREVIEW && ( + setShowAllSettled((v) => !v)} + style={({ pressed }) => ({ minHeight: 44, justifyContent: 'center', paddingHorizontal: 12, backgroundColor: pressed ? alpha(c.app, 0.6) : 'transparent' })} + > + {hiddenCount > 0 ? `show ${hiddenCount} more finished` : 'show fewer'} + + )} + + + {peeked && setPeekId(null)} onPeekAgent={setPeekId} />} + + ) +} diff --git a/mobile/src/panels/AllFilesPanel.tsx b/mobile/src/panels/AllFilesPanel.tsx new file mode 100644 index 00000000..3fb0cb60 --- /dev/null +++ b/mobile/src/panels/AllFilesPanel.tsx @@ -0,0 +1,277 @@ +// Port of renderer/components/AllFilesPanel.tsx. +// +// Desktop-only, omitted: row tap → file tab (onOpenFile), "Open worktree in +// editor" / "Open file in editor" (openInEditor), "Reveal in Finder" +// (openPath), the quick-open hotkey hint in the footer (no Quick Open on +// phone), and drag-a-row-into-the-composer (the @ button covers it). +import { Fragment, memo, useCallback, useEffect, useMemo, useRef, useState } from 'react' +import { Alert, Pressable, ScrollView, Text, TextInput, View } from 'react-native' +import { FileText, RefreshCw } from 'lucide-react-native' +import type { ChangedFile } from '../../../src/renderer/types' +import { buildTree, sortChildren, type TreeNode } from '../../../src/renderer/file-tree' +import { c, fs, mono, themed, getThemeMode } from '../theme' +import { PanelAction, RightPanel } from './RightPanel' +import { + AtButton, + DirRow, + FileListViewToggle, + STATUS_COLOR, + STATUS_LABEL, + fileTreeIndent, + flattenTree, + useChangedFilesSet, + useFileListView +} from './ChangedFilesPanel' +import type { PanelProps } from './types' + +/** List view renders every row with no virtualization, so cap it. */ +const LIST_VIEW_LIMIT = 1000 + +/** Copied from AllFilesPanel.tsx: while filtering, changed files sort above + * unchanged ones; stable tiebreak by sortChildren's alphabetical order. */ +function sortChildrenChangedFirst(node: TreeNode, changedByPath: Map, changedFolders: Set): TreeNode[] { + const base = sortChildren(node) + if (changedByPath.size === 0) return base + const isChanged = (n: TreeNode): boolean => (n.isFile ? changedByPath.has(n.path) : changedFolders.has(n.path)) + return base + .map((n, i) => ({ n, i, changed: isChanged(n) })) + .sort((a, b) => { + if (a.n.isFile !== b.n.isFile) return a.n.isFile ? 1 : -1 + if (a.changed !== b.changed) return a.changed ? -1 : 1 + return a.i - b.i + }) + .map((e) => e.n) +} + +type Row = + | { key: string; kind: 'dir'; node: TreeNode; depth: number; open: boolean } + | { key: string; kind: 'file'; name: string; path: string; depth: number | null } + | { key: string; kind: 'more'; label: string } + +export function AllFilesPanel({ client, worktreePath, onSendToAgent }: PanelProps) { + const [files, setFiles] = useState([]) + const [hasLoaded, setHasLoaded] = useState(false) + const [filter, setFilter] = useState('') + const [expanded, setExpanded] = useState>(() => new Set([''])) + const changed = useChangedFilesSet(client, worktreePath) + + // Route the (often fresh) callback through a ref so memoized rows keep stable props. + const onSendToAgentRef = useRef(onSendToAgent) + onSendToAgentRef.current = onSendToAgent + const sendToAgent = useCallback((text: string) => onSendToAgentRef.current(text), []) + const [view, toggleView] = useFileListView('all-files', 'tree') + + const refresh = useCallback(async () => { + if (!worktreePath) return + try { + const result = await client.api.listAllFiles(worktreePath) + setFiles(result) + } catch (err) { + console.error('Failed to list files:', err) // eslint-disable-line no-console + setFiles([]) + } finally { + setHasLoaded(true) + } + }, [client, worktreePath]) + + useEffect(() => { + setHasLoaded(false) + setFilter('') + setExpanded(new Set([''])) + }, [worktreePath]) + + useEffect(() => { + void refresh() + }, [refresh]) + + const sortedFiles = useMemo(() => (view === 'list' ? [...files].sort((a, b) => a.localeCompare(b)) : files), [files, view]) + + const filtered = useMemo(() => { + if (!filter.trim()) return sortedFiles + const q = filter.toLowerCase() + return sortedFiles.filter((f) => f.toLowerCase().includes(q)) + }, [sortedFiles, filter]) + + const filtering = filter.trim().length > 0 + + const tree = useMemo(() => (view === 'tree' ? buildTree(filtered) : null), [filtered, view]) + + // Changed files refresh on nearly every edit; only depend on them while + // filtering, when they reorder the list. + const changedFirstBy = filtering ? changed.byPath : null + const listed = useMemo(() => { + if (view !== 'list') return [] + if (!changedFirstBy || changedFirstBy.size === 0) return filtered.slice(0, LIST_VIEW_LIMIT) + const changedFiles = filtered.filter((f) => changedFirstBy.has(f)) + const rest = filtered.filter((f) => !changedFirstBy.has(f)) + return [...changedFiles, ...rest].slice(0, LIST_VIEW_LIMIT) + }, [filtered, view, changedFirstBy]) + + const toggle = useCallback((path: string) => { + setExpanded((prev) => { + const next = new Set(prev) + if (next.has(path)) next.delete(path) + else next.add(path) + return next + }) + }, []) + + const rows = useMemo(() => { + if (!worktreePath) return [] + if (tree && filtered.length > 0) { + const sorter = filtering ? (n: TreeNode) => sortChildrenChangedFirst(n, changed.byPath, changed.folders) : sortChildren + return flattenTree(tree, (p) => filtering || expanded.has(p), sorter).map((r) => + r.kind === 'dir' + ? { key: `d:${r.node.path}`, kind: 'dir', node: r.node, depth: r.depth, open: r.open } + : { key: `f:${r.node.path}`, kind: 'file', name: r.node.name, path: r.node.path, depth: r.depth } + ) + } + if (view !== 'list') return [] + const out: Row[] = listed.map((path) => ({ key: `f:${path}`, kind: 'file', name: path.slice(path.lastIndexOf('/') + 1), path, depth: null })) + if (filtered.length > listed.length) { + out.push({ key: 'more', kind: 'more', label: `Showing first ${listed.length} of ${filtered.length} — filter to narrow` }) + } + return out + }, [worktreePath, tree, filtered, filtering, expanded, view, listed, changed]) + + const actions = ( + <> + + {/* "Open worktree in editor" and "Reveal in Finder" — desktop-only, omitted. */} + void refresh()} label="Refresh"> + + + + ) + + const renderRow = (item: Row) => { + if (item.kind === 'dir') { + return ( + toggle(item.node.path)} + hasChangedDescendant={changed.folders.has(item.node.path)} + /> + ) + } + if (item.kind === 'more') { + return {item.label} + } + return ( + + ) + } + + return ( + + + + + {!worktreePath && No worktree selected} + {worktreePath && hasLoaded && files.length === 0 && No files found} + {worktreePath && filtering && filtered.length === 0 && files.length > 0 && No matches} + {rows.length > 0 && ( + // ScrollView + map, not FlatList: PanelsHost is already a ScrollView + // and nesting a VirtualizedList in one breaks windowing. Rows are capped + // at the desktop's LIST_VIEW_LIMIT, so rendering them all is bounded. + + {rows.map((item) => ( + + {renderRow(item)} + + ))} + + )} + {files.length > 0 && ( + + + {filtering ? `${filtered.length} / ${files.length}` : files.length} file + {files.length !== 1 ? 's' : ''} + + {/* " fuzzy open" hint omitted: no Quick Open on phone. */} + + )} + + ) +} + +const emptyText = themed(() => ({ padding: 12, fontSize: fs.xs, color: c.faint })) + +const FileRow = memo(function FileRow({ + name, + path, + depth, + onSendToAgent, + changedStatus +}: { + name: string + path: string + /** Tree indent level, or null in list view to show the full path. */ + depth: number | null + onSendToAgent: (text: string) => void + changedStatus?: ChangedFile['status'] +}) { + const dir = depth === null ? path.slice(0, path.length - name.length) : '' + return ( + // Row tap opens a file tab on desktop (omitted); long-press shows the path. + Alert.alert(path)} + style={({ pressed }) => ({ + minHeight: 44, + flexDirection: 'row', + alignItems: 'center', + gap: 4, + paddingLeft: depth === null ? 8 : fileTreeIndent(depth), + backgroundColor: pressed ? c.panelRaised : 'transparent' + })} + > + {changedStatus ? ( + + {STATUS_LABEL[changedStatus]} + + ) : ( + + )} + {depth === null ? ( + + {dir ? {dir} : null} + {name} + + ) : ( + + {name} + + )} + onSendToAgent(`@${path} `)} /> + + ) +}) diff --git a/mobile/src/panels/ChangedFilesPanel.tsx b/mobile/src/panels/ChangedFilesPanel.tsx new file mode 100644 index 00000000..f79793ad --- /dev/null +++ b/mobile/src/panels/ChangedFilesPanel.tsx @@ -0,0 +1,471 @@ +// Port of renderer/components/ChangedFilesPanel.tsx. Also hosts the RN +// ports of the pieces AllFilesPanel shares with it on desktop: +// FileTree.tsx (view toggle, dir rows, indent), useFileListView, +// changed-files-request (in-flight dedup) and useChangedFilesSet. +// +// Desktop-only, omitted: row tap → diff tab (onOpenDiff), the "Review" +// header button (onOpenReview opens a review tab), "Open file in editor" +// (openInEditor), and drag-a-row-into-the-composer (the @ button covers it). +import { Fragment, useCallback, useEffect, useMemo, useState } from 'react' +import { Alert, Pressable, ScrollView, Text, View } from 'react-native' +import AsyncStorage from '@react-native-async-storage/async-storage' +import { AtSign, ChevronRight, Folder, FolderOpen, List, ListTree, RefreshCw } from 'lucide-react-native' +import type { ChangedFile } from '../../../src/renderer/types' +import { buildTree, sortChildren as sortByName, type FileListView, type TreeNode } from '../../../src/renderer/file-tree' +import { destOf } from '../../../src/shared/git-paths' +import type { NessClient } from '../ness' +import { alpha, c, fs, mono, themed } from '../theme' +import { PanelAction, RightPanel } from './RightPanel' +import { useWatchedQuery } from './useWatchedQuery' +import type { PanelProps } from './types' + +type Mode = 'working' | 'branch' + +// --------------------------------------------------------------------------- +// Shared with AllFilesPanel +// --------------------------------------------------------------------------- + +/** CHANGED_STATUS_LABEL / _COLOR from useChangedFilesSet.ts (ChangedFilesPanel + * and CommitInfoModal define the same tables). */ +export const STATUS_LABEL: Record = { + added: 'A', + modified: 'M', + deleted: 'D', + renamed: 'R', + untracked: 'U' +} +export const STATUS_COLOR: Record = themed(() => ({ + added: c.success, + modified: c.warning, + deleted: c.danger, + renamed: c.info, + untracked: c.dim +})) + +// Port of hooks/changed-files-request.ts: in-flight-only dedup so this panel +// ('changedFiles') and useChangedFilesSet ('branchChangedFiles') don't ask the +// same branch diff twice at once. Keyed per backend too — paths can collide +// across backends. +const inFlight = new Map>() +export function requestChangedFiles( + client: NessClient, + path: string, + mode: Mode, + opts: { force?: boolean } = {} +): Promise { + const key = `${client.id}::${mode}::${path}` + if (!opts.force) { + const existing = inFlight.get(key) + if (existing) return existing + } + const promise = client.api.getChangedFiles(path, mode).finally(() => { + if (inFlight.get(key) === promise) inFlight.delete(key) + }) + inFlight.set(key, promise) + return promise +} + +// Port of hooks/useFileListView.ts — same key prefix, AsyncStorage instead +// of localStorage. +const VIEW_PREFIX = 'file-list-view:' +export function useFileListView(id: string, fallback: FileListView): [FileListView, () => void] { + const [view, setView] = useState(fallback) + const [loaded, setLoaded] = useState(false) + useEffect(() => { + void AsyncStorage.getItem(VIEW_PREFIX + id).then((saved) => { + if (saved === 'list' || saved === 'tree') setView(saved) + setLoaded(true) + }) + }, [id]) + useEffect(() => { + if (loaded) void AsyncStorage.setItem(VIEW_PREFIX + id, view) + }, [id, view, loaded]) + const toggle = useCallback(() => setView((v) => (v === 'list' ? 'tree' : 'list')), []) + return [view, toggle] +} + +// Port of hooks/useChangedFilesSet.ts. +export interface ChangedFilesSetResult { + byPath: Map + folders: Set + list: ChangedFile[] +} +const EMPTY_SET: ChangedFilesSetResult = { byPath: new Map(), folders: new Set(), list: [] } +export function useChangedFilesSet(client: NessClient, worktreePath: string | null): ChangedFilesSetResult { + const fetcher = useCallback( + (path: string, opts: { force: boolean }) => requestChangedFiles(client, path, 'branch', opts), + [client] + ) + const { data } = useWatchedQuery({ client, worktreePath, cacheKey: 'branchChangedFiles', fetcher }) + return useMemo(() => { + if (!data || data.length === 0) return EMPTY_SET + const byPath = new Map() + const folders = new Set() + for (const f of data) { + byPath.set(f.path, f) + let idx = f.path.indexOf('/') + while (idx >= 0) { + folders.add(f.path.slice(0, idx)) + idx = f.path.indexOf('/', idx + 1) + } + } + return { byPath, folders, list: data } + }, [data]) +} + +/** FileTree.tsx's FileListViewToggle. */ +export function FileListViewToggle({ view, onToggle }: { view: FileListView; onToggle: () => void }) { + const label = view === 'list' ? 'View as tree' : 'View as list' + return ( + + {view === 'list' ? : } + + ) +} + +/** FileTree.tsx's fileTreeIndent: left padding for a file row at `depth`. */ +export function fileTreeIndent(depth: number): number { + return 8 + depth * 12 + 10 +} + +/** TreeBranch's recursion, flattened to rows so a long tree renders as one + * flat list instead of one deep View hierarchy. Same visit order. */ +export type TreeRow = + | { kind: 'dir'; node: TreeNode; depth: number; open: boolean } + | { kind: 'file'; node: TreeNode; depth: number } +export function flattenTree( + root: TreeNode, + isOpen: (path: string) => boolean, + sortChildren: (node: TreeNode) => TreeNode[] = sortByName, + depth = 0, + out: TreeRow[] = [] +): TreeRow[] { + for (const child of sortChildren(root)) { + if (child.isFile) { + out.push({ kind: 'file', node: child, depth }) + continue + } + const open = isOpen(child.path) + out.push({ kind: 'dir', node: child, depth, open }) + if (open) flattenTree(child, isOpen, sortChildren, depth + 1, out) + } + return out +} + +/** FileTree.tsx's DirRow. */ +export function DirRow({ + name, + depth, + open, + onToggle, + hasChangedDescendant +}: { + name: string + depth: number + open: boolean + onToggle: () => void + hasChangedDescendant: boolean +}) { + return ( + ({ + minHeight: 44, + flexDirection: 'row', + alignItems: 'center', + gap: 4, + paddingRight: 8, + paddingLeft: 8 + depth * 12, + backgroundColor: pressed ? c.panelRaised : 'transparent' + })} + > + + {open ? : } + + {name} + + {hasChangedDescendant && ( + + )} + + ) +} + +/** The hover-revealed "Reference in Claude" button, always visible here. */ +export function AtButton({ onPress }: { onPress: () => void }) { + return ( + ({ + width: 44, + alignSelf: 'stretch', + alignItems: 'center', + justifyContent: 'center', + backgroundColor: pressed ? c.surface : 'transparent' + })} + > + + + ) +} + +// --------------------------------------------------------------------------- +// ChangedFilesPanel +// --------------------------------------------------------------------------- + +const EMPTY_FILES: ChangedFile[] = [] + +interface ChangedFilesData { + working: ChangedFile[] + branch: ChangedFile[] +} + +/** One list (staged / unstaged / committed) has its own tree-collapse set, + * like each desktop ChangedFileList instance. */ +type ListId = 'staged' | 'unstaged' | 'branch' + +type Row = + | { key: string; kind: 'section'; label: string; view: FileListView; onToggle: () => void; top: boolean } + | { key: string; kind: 'subsection'; label: string } + | { key: string; kind: 'empty'; label: string } + | { key: string; kind: 'file'; file: ChangedFile; depth?: number } + | { key: string; kind: 'dir'; list: ListId; node: TreeNode; depth: number; open: boolean } + +export function ChangedFilesPanel({ client, worktreePath, onSendToAgent }: PanelProps) { + const fetcher = useCallback( + async (path: string, opts: { force: boolean }): Promise => { + const [working, branch] = await Promise.all([ + requestChangedFiles(client, path, 'working', opts), + requestChangedFiles(client, path, 'branch', opts) + ]) + return { working, branch } + }, + [client] + ) + + const { data, loading, refresh } = useWatchedQuery({ + client, + worktreePath, + cacheKey: 'changedFiles', + fetcher + }) + + const workingFiles = data?.working ?? EMPTY_FILES + const branchFiles = data?.branch ?? EMPTY_FILES + const hasLoaded = !loading + + const stagedFiles = useMemo(() => workingFiles.filter((f) => f.staged), [workingFiles]) + const unstagedFiles = useMemo(() => workingFiles.filter((f) => !f.staged), [workingFiles]) + const totalCount = workingFiles.length + branchFiles.length + const [uncommittedView, toggleUncommittedView] = useFileListView('changed-files:uncommitted', 'list') + const [committedView, toggleCommittedView] = useFileListView('changed-files:committed', 'list') + + const [collapsed, setCollapsed] = useState>>(() => ({ + staged: new Set(), + unstaged: new Set(), + branch: new Set() + })) + useEffect(() => { + setCollapsed({ staged: new Set(), unstaged: new Set(), branch: new Set() }) + }, [worktreePath]) + const toggleDir = useCallback((list: ListId, path: string) => { + setCollapsed((prev) => { + const next = new Set(prev[list]) + if (next.has(path)) next.delete(path) + else next.add(path) + return { ...prev, [list]: next } + }) + }, []) + + const rows = useMemo(() => { + if (!worktreePath || !hasLoaded) return [] + const out: Row[] = [] + const pushList = (list: ListId, files: ChangedFile[], view: FileListView): void => { + if (view !== 'tree') { + for (const file of files) out.push({ key: `${list}:f:${file.path}`, kind: 'file', file }) + return + } + // Renames are "old -> new"; place them by destination so the arrow + // doesn't split into fake folders. + const byPath = new Map(files.map((f) => [destOf(f.path), f])) + const shut = collapsed[list] + for (const r of flattenTree(buildTree([...byPath.keys()]), (p) => !shut.has(p))) { + if (r.kind === 'dir') out.push({ key: `${list}:d:${r.node.path}`, kind: 'dir', list, node: r.node, depth: r.depth, open: r.open }) + else out.push({ key: `${list}:f:${r.node.path}`, kind: 'file', file: byPath.get(r.node.path)!, depth: r.depth }) + } + } + + out.push({ key: 's:uncommitted', kind: 'section', label: 'Uncommitted', view: uncommittedView, onToggle: toggleUncommittedView, top: true }) + if (workingFiles.length === 0) { + out.push({ key: 'e:working', kind: 'empty', label: 'No changes' }) + } else { + if (stagedFiles.length > 0) out.push({ key: 'ss:staged', kind: 'subsection', label: 'Staged' }) + pushList('staged', stagedFiles, uncommittedView) + if (unstagedFiles.length > 0) out.push({ key: 'ss:unstaged', kind: 'subsection', label: 'Unstaged' }) + pushList('unstaged', unstagedFiles, uncommittedView) + } + + out.push({ key: 's:committed', kind: 'section', label: 'Committed', view: committedView, onToggle: toggleCommittedView, top: false }) + if (branchFiles.length === 0) out.push({ key: 'e:branch', kind: 'empty', label: 'No commits on this branch yet' }) + else pushList('branch', branchFiles, committedView) + return out + }, [ + worktreePath, + hasLoaded, + workingFiles, + branchFiles, + stagedFiles, + unstagedFiles, + uncommittedView, + committedView, + toggleUncommittedView, + toggleCommittedView, + collapsed + ]) + + const actions = ( + // "Review" (onOpenReview) opens a review tab — desktop-only, omitted. + refresh()} label="Refresh"> + + + ) + + const renderRow = (item: Row) => { + switch (item.kind) { + case 'section': + return ( + + {item.label} + + + ) + case 'subsection': + return {item.label} + case 'empty': + return ( + + {item.label} + + ) + case 'dir': + return ( + toggleDir(item.list, item.node.path)} + hasChangedDescendant={false} + /> + ) + case 'file': + return + } + } + + return ( + + {!worktreePath && No worktree selected} + {rows.length > 0 && ( + // ScrollView + map, not FlatList: PanelsHost is already a ScrollView + // and nesting a VirtualizedList in one breaks windowing. A PR's changed + // set is small enough to render whole inside the capped height. + + {rows.map((item) => ( + + {renderRow(item)} + + ))} + + )} + + {totalCount > 0 && ( + + {workingFiles.length > 0 && `${workingFiles.length} uncommitted`} + {workingFiles.length > 0 && branchFiles.length > 0 && ' · '} + {branchFiles.length > 0 && `${branchFiles.length} committed`} + + )} + + ) +} + +const sectionText = themed(() => ({ + fontSize: fs.xs, + fontWeight: '500' as const, + color: c.dim, + textTransform: 'uppercase' as const, + letterSpacing: 0.6 +})) + +function FileRow({ + file, + depth, + onSendToAgent +}: { + file: ChangedFile + /** Set in tree view: indent to this depth and show only the file name. */ + depth?: number + onSendToAgent: (text: string) => void +}) { + const inTree = depth !== undefined + const lastSlash = file.path.lastIndexOf('/') + const dir = lastSlash >= 0 && !inTree ? file.path.slice(0, lastSlash + 1) : '' + // The tree places renames by destination, so name them by it too. + const shown = inTree ? destOf(file.path) : file.path + const name = shown.slice(shown.lastIndexOf('/') + 1) + + return ( + // Row tap opens a diff tab on desktop (omitted); long-press stands in + // for the full-path hover tooltip. + Alert.alert(file.path)} + style={({ pressed }) => ({ + minHeight: 44, + flexDirection: 'row', + alignItems: 'center', + gap: inTree ? 4 : 8, + paddingLeft: inTree ? fileTreeIndent(depth) : 12, + backgroundColor: pressed ? c.panelRaised : 'transparent' + })} + > + + {STATUS_LABEL[file.status]} + + {inTree ? ( + + {name} + + ) : ( + // Desktop truncates from the left (rtl + bdi) so the name stays visible. + + {dir ? {dir} : null} + {name} + + )} + {(file.additions !== undefined || file.deletions !== undefined) && ( + + {file.additions !== undefined && file.additions > 0 && +{file.additions}} + {file.deletions !== undefined && file.deletions > 0 && −{file.deletions}} + + )} + onSendToAgent(`@${file.path} `)} /> + {/* "Open file in editor" (openInEditor) — desktop-only, omitted. */} + + ) +} diff --git a/mobile/src/panels/CommitsPanel.tsx b/mobile/src/panels/CommitsPanel.tsx new file mode 100644 index 00000000..79aaaaaf --- /dev/null +++ b/mobile/src/panels/CommitsPanel.tsx @@ -0,0 +1,352 @@ +// Port of renderer/components/BranchCommitsPanel.tsx plus the commit-info +// popover it opens (CommitInfoModal.tsx, with its prev/next nav). The +// popover becomes a modal sheet; ↑/↓/Esc become buttons. +// +// Desktop-only, omitted: "Open diff in tab" on a commit's files +// (onOpenCommitFileDiff), and drag-a-commit-into-the-composer. +import { useCallback, useEffect, useRef, useState } from 'react' +import * as ExpoClipboard from 'expo-clipboard' +import { Alert, Modal, Pressable, ScrollView, Text, View } from 'react-native' +import { ArrowUp, Check, ChevronDown, ChevronUp, Copy, GitCommitHorizontal, RefreshCw, X } from 'lucide-react-native' +import type { BranchCommit, ChangedFile, CommitMeta } from '../../../src/renderer/types' +import type { NessClient } from '../ness' +import { Spin } from '../components/Spin' +import { alpha, c, fs, mono } from '../theme' +import { PanelAction, RightPanel } from './RightPanel' +import { useWatchedQuery } from './useWatchedQuery' +import { STATUS_COLOR, STATUS_LABEL } from './ChangedFilesPanel' +import type { PanelProps } from './types' + +/** navigator.clipboard.writeText stand-in (expo-clipboard; ships in Expo + * Go). Fire-and-forget like the desktop's copy. */ +function copyText(text: string): boolean { + ExpoClipboard.setStringAsync(text).catch(() => Alert.alert('Copy failed', text)) + return true +} + +export function CommitsPanel({ client, worktreePath }: PanelProps) { + const fetcher = useCallback((path: string) => client.api.getBranchCommits(path), [client]) + // Tracks the selected commit by index so the up/down controls can walk the list. + const [popover, setPopover] = useState(null) + + const { data, loading, refresh } = useWatchedQuery({ + client, + worktreePath, + cacheKey: 'branchCommits', + fetcher + }) + + const commits = data ?? [] + const hasLoaded = !loading + + if (!worktreePath) return null + + const actions = ( + <> + {commits.length > 0 && {commits.length}} + refresh()} label="Refresh"> + + + + ) + + const selected = popover !== null ? commits[popover] : undefined + + return ( + <> + + {commits.length === 0 && hasLoaded && ( + No commits ahead of base + )} + {commits.length > 0 && ( + // max-h-56 on desktop; taller here because rows are 44pt. A plain + // ScrollView (not FlatList) since PanelsHost already scrolls, and + // the padding lives on the content so it can't eat into the cap + // and push the last row under the next panel. + + {commits.map((cm, i) => ( + setPopover(i)} + /> + ))} + + )} + + {popover !== null && selected && ( + setPopover((p) => (p !== null && p > 0 ? p - 1 : p)), + onNext: () => setPopover((p) => (p !== null && p < commits.length - 1 ? p + 1 : p)), + hasPrev: popover > 0, + hasNext: popover < commits.length - 1 + }} + onClose={() => setPopover(null)} + /> + )} + + ) +} + +function CommitRow({ commit: cm, isFirst, isLast, onPress }: { commit: BranchCommit; isFirst: boolean; isLast: boolean; onPress: () => void }) { + const tipSuffix = cm.pushed ? 'pushed' : 'unpushed' + return ( + + Alert.alert(`${cm.shortHash} · ${cm.author} · ${cm.relativeDate} · ${tipSuffix}`, cm.subject, [ + { text: 'Copy commit SHA', onPress: () => copyText(cm.hash) }, + { text: 'Cancel', style: 'cancel' } + ]) + } + style={({ pressed }) => ({ + minHeight: 44, + flexDirection: 'row', + alignItems: 'center', + gap: 10, + paddingLeft: 16, + paddingRight: 12, + backgroundColor: pressed ? c.panelRaised : 'transparent' + })} + > + {/* Tree line + dot */} + + + + + {cm.shortHash} + + {cm.subject} + + {!cm.pushed && } + + ) +} + +interface CommitNav { + onPrev: () => void + onNext: () => void + hasPrev: boolean + hasNext: boolean +} + +/** CommitInfoModal.tsx as a modal sheet. Same requests, states and labels. */ +function CommitInfoSheet({ + client, + worktreePath, + sha, + nav, + onClose +}: { + client: NessClient + worktreePath: string + sha: string + nav: CommitNav + onClose: () => void +}) { + const [meta, setMeta] = useState(null) + const [files, setFiles] = useState([]) + const [state, setState] = useState<'loading' | 'ready' | 'error'>('loading') + const [copied, setCopied] = useState(false) + const [copiedPath, setCopiedPath] = useState(null) + const pathTimer = useRef | null>(null) + + useEffect(() => () => { + if (pathTimer.current !== null) clearTimeout(pathTimer.current) + }, []) + + const copyPath = (path: string): void => { + if (!copyText(path)) return + setCopiedPath(path) + if (pathTimer.current !== null) clearTimeout(pathTimer.current) + pathTimer.current = setTimeout(() => setCopiedPath(null), 1200) + } + + useEffect(() => { + let cancelled = false + setState('loading') + void Promise.all([ + client.api.getCommitMeta(worktreePath, sha), + client.api.getCommitChangedFiles(worktreePath, sha) + ]) + .then(([m, f]) => { + if (cancelled) return + if (m) { + setMeta(m) + setFiles(f) + setState('ready') + } else { + setState('error') + } + }) + .catch(() => { + if (!cancelled) setState('error') + }) + return () => { + cancelled = true + } + }, [client, worktreePath, sha]) + + const copySha = (): void => { + if (!copyText(meta?.hash ?? sha)) return + setCopied(true) + setTimeout(() => setCopied(false), 1200) + } + + const shortSha = meta?.shortHash ?? sha.slice(0, 10) + + return ( + + {/* Full-screen catcher: tap outside closes, like the desktop overlay. */} + + {}} + // Not an accessibility element itself, so VoiceOver reaches each + // header button separately instead of one flattened blob. + accessible={false} + style={{ maxHeight: '75%', backgroundColor: c.panelRaised, borderWidth: 1, borderColor: c.borderStrong, borderRadius: 8, overflow: 'hidden' }} + > + + + + {shortSha} + {copied ? : } + + + {state === 'ready' && meta ? meta.subject : ''} + + + + + + + + + + + + + {state === 'loading' && ( + + + + + Loading… + + )} + + {state === 'error' && ( + + Couldn't load commit {sha}. + + )} + + {state === 'ready' && meta && ( + + + {meta.author} + {meta.date ? ` · ${new Date(meta.date).toLocaleString()}` : ''} + + {meta.body.trim() !== '' && ( + + {meta.body.trim()} + + )} + + + {files.length} {files.length === 1 ? 'file' : 'files'} changed + + {files.map((file) => ( + copyPath(file.path)} /> + ))} + + + )} + + + + ) +} + +function HeaderBtn({ label, onPress, disabled, children }: { label: string; onPress: () => void; disabled?: boolean; children: React.ReactNode }) { + return ( + ({ + width: 44, + minHeight: 44, + alignItems: 'center', + justifyContent: 'center', + opacity: disabled ? 0.3 : 1, + backgroundColor: pressed ? c.surfaceHover : 'transparent' + })} + > + {children} + + ) +} + +/** CommitInfoModal's FileRow: tap copies the path. Its context menu's other + * item, "Open diff in tab", is desktop-only. */ +function CommitFileRow({ file, copied, onCopyPath }: { file: ChangedFile; copied: boolean; onCopyPath: () => void }) { + const lastSlash = file.path.lastIndexOf('/') + const dir = lastSlash >= 0 ? file.path.slice(0, lastSlash + 1) : '' + const name = lastSlash >= 0 ? file.path.slice(lastSlash + 1) : file.path + return ( + ({ + minHeight: 44, + flexDirection: 'row', + alignItems: 'center', + gap: 8, + borderRadius: 4, + backgroundColor: pressed ? c.surfaceHover : 'transparent' + })} + > + {STATUS_LABEL[file.status]} + + {dir ? {dir} : null} + {name} + + {copied ? : } + {(file.additions || file.deletions) ? ( + + {file.additions ? +{file.additions} : null} + {file.deletions ? −{file.deletions} : null} + + ) : null} + + ) +} diff --git a/mobile/src/panels/ContextPanel.tsx b/mobile/src/panels/ContextPanel.tsx new file mode 100644 index 00000000..7f83c7c1 --- /dev/null +++ b/mobile/src/panels/ContextPanel.tsx @@ -0,0 +1,226 @@ +// Port of renderer/components/ContextPanel.tsx. Same support check, rows, +// sort, Codex single-row fallback, and interest gate: +// `contextWindow:setInterest` follows the collapse state (RightPanel +// reports `true` = collapsed on unmount). Hover titles are tap-to-expand: +// tap a category row for its explanation, the "until compact" line for +// the threshold, the caveat for how the split is computed. The meter's +// per-segment titles are omitted — every segment is a row right below. +import { useMemo, useState } from 'react' +import { Pressable, ScrollView, Text, View } from 'react-native' +import { findTabById, isClaudeBackedTab } from '../../../src/shared/state/terminals' +import type { ContextSnapshot } from '../../../src/shared/state/context-window' +import { useNess } from '../ness' +import { alpha, c, fs } from '../theme' +import { RightPanel } from './RightPanel' +import type { PanelProps } from './types' + +function formatTokens(n: number): string { + if (n >= 1_000_000) return `${(n / 1_000_000).toFixed(2)}M` + if (n >= 10_000) return `${Math.round(n / 1000)}k` + if (n >= 1000) return `${(n / 1000).toFixed(1)}k` + return String(n) +} + +function shortModel(model: string): string { + return model.replace(/^claude-/, '') +} + +/** `mcp____` → `/`. */ +function shortToolName(name: string): string { + const mcp = name.match(/^mcp__([^_]+(?:_[^_]+)*?)__(.+)$/) + if (mcp) return `${mcp[1]}/${mcp[2]}` + return name +} + +interface Row { + label: string + tokens: number + /** Swatch + meter segment colour. */ + color: string + title?: string +} + +// Tool-result rows: `bg-danger` on the desktop (it used to be the +// non-existent `bg-error`, which rendered colourless). + + +function buildRows(snapshot: ContextSnapshot): Row[] { + const k = snapshot.categories + const rows: Row[] = [ + { + label: 'System + tools', + tokens: k.systemAndTools, + color: c.faint, + title: 'System prompt and tool schemas. Derived as the part of the window the conversation does not account for.' + }, + { + label: 'CLAUDE.md', + tokens: k.memoryFiles, + color: c.muted, + title: 'Memory files, sized from disk. The API folds these into the system block, so this is an estimate.' + }, + { label: 'Carried summary', tokens: k.carriedSummary, color: c.warning, title: 'The continuation summary written by the last compaction.' }, + { label: 'Attachments', tokens: k.attachments, color: c.accent, title: 'Skill listings, agent listings, todo reminders and @-mentioned files.' }, + { label: 'Your messages', tokens: k.userPrompts, color: c.success }, + { label: 'Claude replies', tokens: k.assistantText, color: c.fg }, + { label: 'Thinking', tokens: k.thinking, color: c.fgBright }, + { + label: 'Tool calls', + tokens: k.toolCalls, + color: c.danger, + title: 'Arguments passed to tools. Write and Edit carry whole file bodies, so this is often larger than it looks like it should be.' + } + ] + for (const [name, tokens] of Object.entries(k.toolResults)) { + rows.push({ label: shortToolName(name), tokens, color: c.danger, title: name }) + } + return rows +} + +const num = { fontSize: fs.xs, fontVariant: ['tabular-nums' as const] } + +function Meter({ rows, limit }: { rows: Row[]; limit: number }) { + return ( + + {rows + .filter((r) => r.tokens > 0) + .map((r) => ( + + ))} + + + ) +} + +function BarRow({ row, used }: { row: Row; used: number }) { + const [open, setOpen] = useState(false) + const pct = used > 0 ? (row.tokens / used) * 100 : 0 + return ( + setOpen((v) => !v)} disabled={!row.title} style={{ minHeight: 28, justifyContent: 'center' }} hitSlop={{ top: 8, bottom: 8 }}> + + + + {row.label} + + {pct >= 1 ? `${Math.round(pct)}%` : '<1%'} + {formatTokens(row.tokens)} + + {open && row.title && {row.title}} + + ) +} + +export function ContextPanel({ client, focusedTabId }: PanelProps) { + const panes = useNess(client, (s) => s.terminals.panes) + const snapshot = useNess(client, (s) => (focusedTabId ? s.contextWindow.byTerminal[focusedTabId] : undefined)) + const [showDiscoverable, setShowDiscoverable] = useState(false) + const [showCompactHint, setShowCompactHint] = useState(false) + const [showCaveat, setShowCaveat] = useState(false) + + // Non-Claude terminal tabs never produce a snapshot; hide outright. + const supported = useMemo(() => { + const tab = focusedTabId ? findTabById(panes, focusedTabId) : null + return tab?.type === 'json-claude' || isClaudeBackedTab(tab) + }, [panes, focusedTabId]) + + const rows = useMemo(() => (snapshot ? buildRows(snapshot) : []), [snapshot]) + + if (!supported) return null + + const breakdown = rows.filter((r) => r.tokens > 0).sort((a, b) => b.tokens - a.tokens) + // Codex reports a total but no breakdown; one row keeps the meter honest. + const sorted: Row[] = + breakdown.length === 0 && snapshot && snapshot.usedTokens > 0 + ? [{ label: 'In use', tokens: snapshot.usedTokens, color: c.fg, title: 'This agent reports how much of the window is in use, not what is using it.' }] + : breakdown + const pct = snapshot && snapshot.limit > 0 ? (snapshot.usedTokens / snapshot.limit) * 100 : 0 + const toCompact = snapshot ? snapshot.autocompactAt - snapshot.usedTokens : 0 + + return ( + { + void client.api.setContextWindowInterest(!collapsed) + }} + actions={snapshot ? {Math.round(pct)}% : undefined} + > + {!snapshot ? ( + No context data yet. Updates after each turn. + ) : ( + <> + {/* Pinned: the headline stays readable while the list scrolls. */} + + + {Math.round(pct)}% + + {formatTokens(snapshot.usedTokens)} / {formatTokens(snapshot.limit)} + + + + + setShowCompactHint((v) => !v)} hitSlop={12} style={{ flexShrink: 1 }}> + {toCompact > 0 ? `${formatTokens(toCompact)} until compact` : 'compact imminent'} + + {snapshot.model && ( + + {shortModel(snapshot.model)} + + )} + + {showCompactHint && ( + + {toCompact > 0 ? `Expected to auto-compact around ${formatTokens(snapshot.autocompactAt)}` : 'Past the expected auto-compact point'} + + )} + + + {/* max-h-48 scroller: the tool list is unbounded in practice. */} + + + {sorted.map((r) => ( + + ))} + + + {snapshot.compactions > 0 && ( + + {snapshot.compactions} compaction{snapshot.compactions === 1 ? '' : 's'} so far — everything before the last one is gone. + + )} + + {snapshot.discoverableTools.length > 0 && ( + + setShowDiscoverable((v) => !v)} style={{ minHeight: 44, justifyContent: 'center' }}> + + {showDiscoverable ? '▾' : '▸'} {snapshot.discoverableTools.length} tools discoverable, not loaded + + + {showDiscoverable && ( + <> + + Tools the agent can pull in on demand. Their schemas are not in the window until used. + + {snapshot.discoverableTools.map(shortToolName).join(', ')} + + )} + + )} + + {breakdown.length > 0 && ( + setShowCaveat((v) => !v)} style={{ minHeight: 44, justifyContent: 'center' }}> + total is exact, split is estimated + {showCaveat && ( + + The total is exact — it comes off the last turn's usage record. The category split is anchored to the measured token delta between turns and divided within each turn by char proportion. + + )} + + )} + + + )} + + ) +} diff --git a/mobile/src/panels/CostPanel.tsx b/mobile/src/panels/CostPanel.tsx new file mode 100644 index 00000000..1b71c03c --- /dev/null +++ b/mobile/src/panels/CostPanel.tsx @@ -0,0 +1,174 @@ +// Port of renderer/components/CostPanel.tsx. Same aggregation (agent + +// chat tabs in this worktree, deduped by transcriptPath), same sections, +// and the same interest gate: `costs:setInterest` follows the collapse +// state (RightPanel also reports `true` = collapsed on unmount), so the +// backend only tallies while someone is looking. Hover titles (message +// count, estimate caveat) are revealed by tapping the total / caveat. +import { useMemo, useState } from 'react' +import { Pressable, Text, View } from 'react-native' +import { getLeaves } from '../../../src/shared/state/terminals' +import { + totalForSession, + addBreakdown, + cloneBreakdown, + emptyBreakdown, + emptyTally, + type ContentBreakdown, + type ModelTally +} from '../../../src/shared/state/costs' +import { useNess } from '../ness' +import { alpha, c, fs } from '../theme' +import { RightPanel } from './RightPanel' +import type { PanelProps } from './types' + +function formatCost(n: number): string { + if (n === 0) return '$0.00' + if (n < 0.01) return '<$0.01' + return `$${n.toFixed(2)}` +} + +function shortModel(model: string): string { + return model.replace(/^claude-/, '') +} + +interface Row { + label: string + cost: number +} + +const num = { fontSize: fs.xs, fontVariant: ['tabular-nums' as const] } + +function Bar({ row, max, total }: { row: Row; max: number; total: number }) { + const pct = total > 0 ? (row.cost / total) * 100 : 0 + // Same as desktop: bar length is relative to the section's largest row + // (which always draws full), while the % label is the share of the total. + const width = max > 0 ? (row.cost / max) * 100 : 0 + return ( + + + {row.label} + + + + + {pct >= 1 ? `${Math.round(pct)}%` : '<1%'} + {formatCost(row.cost)} + + ) +} + +function Section({ title, rows, total }: { title: string; rows: Row[]; total: number }) { + const nonZero = rows.filter((r) => r.cost > 0).sort((a, b) => b.cost - a.cost) + if (nonZero.length === 0) return null + const max = nonZero[0].cost + return ( + + {title} + {nonZero.map((r) => ( + + ))} + + ) +} + +export function CostPanel({ client, worktreePath }: PanelProps) { + const costs = useNess(client, (s) => s.costs) + const panes = useNess(client, (s) => s.terminals.panes) + const [showMessages, setShowMessages] = useState(false) + const [showCaveat, setShowCaveat] = useState(false) + + const { total, breakdown, currentModel, hasData } = useMemo(() => { + const breakdown: ContentBreakdown = cloneBreakdown(emptyBreakdown) + const total: ModelTally = { ...emptyTally } + let currentModel: string | null = null + let latestTs = -Infinity + let hasData = false + + if (worktreePath) { + const tree = panes[worktreePath] + const terminalIds = new Set() + if (tree) { + for (const leaf of getLeaves(tree)) { + for (const tab of leaf.tabs) { + if (tab.type === 'agent' || tab.type === 'json-claude') terminalIds.add(tab.id) + } + } + } + // Dedup by transcriptPath so a --resume'd tab doesn't double-count. + const seenTranscripts = new Set() + for (const tid of terminalIds) { + const usage = costs.byTerminal[tid] + if (!usage || seenTranscripts.has(usage.transcriptPath)) continue + seenTranscripts.add(usage.transcriptPath) + hasData = true + const sessionTotal = totalForSession(usage) + total.messages += sessionTotal.messages + total.input += sessionTotal.input + total.output += sessionTotal.output + total.cacheRead += sessionTotal.cacheRead + total.cacheWrite += sessionTotal.cacheWrite + total.cost += sessionTotal.cost + addBreakdown(breakdown, usage.breakdown) + if (usage.updatedAt > latestTs && usage.currentModel) { + latestTs = usage.updatedAt + currentModel = usage.currentModel + } + } + } + return { total, breakdown, currentModel, hasData } + }, [worktreePath, costs, panes]) + + if (!worktreePath) return null + + const outputRows: Row[] = [ + { label: 'text', cost: breakdown.text }, + { label: 'thinking', cost: breakdown.thinking }, + { label: 'tool_use', cost: breakdown.toolUse } + ] + const inputRows: Row[] = [ + { label: 'user prompt', cost: breakdown.userPrompt }, + { label: 'asst echo', cost: breakdown.assistantEcho }, + ...Object.entries(breakdown.toolResults).map(([name, cost]) => ({ label: name, cost })) + ] + + return ( + { + void client.api.setCostsInterest(!collapsed) + }} + > + + {!hasData ? ( + No usage yet. Tallies update after each Claude turn. + ) : ( + <> + + setShowMessages((v) => !v)} hitSlop={12} style={{ flexDirection: 'row', alignItems: 'baseline', gap: 8 }}> + {formatCost(total.cost)} + {showMessages && {total.messages} assistant messages} + + {currentModel && ( + + {shortModel(currentModel)} + + )} + +
+
+ setShowCaveat((v) => !v)} style={{ minHeight: 44, justifyContent: 'center' }}> + breakdown is estimated + {showCaveat && ( + + Per-block token counts aren't in the Anthropic usage field. Category splits are estimated by char-length proportion within each turn. The top-line total is exact. + + )} + + + )} + + + ) +} diff --git a/mobile/src/panels/CustomToolPanel.tsx b/mobile/src/panels/CustomToolPanel.tsx new file mode 100644 index 00000000..3f9c228a --- /dev/null +++ b/mobile/src/panels/CustomToolPanel.tsx @@ -0,0 +1,425 @@ +// Port of renderer/components/CustomToolPanel.tsx, including an RN port of +// the markdown vocabulary SidebarMarkdown.tsx maps tool output onto +// (react-markdown + GFM isn't available here, so this is a small block + +// inline parser covering exactly the elements that map renders). +import { useCallback, useMemo, type ReactNode } from 'react' +import { Alert, Pressable, ScrollView, Text, View } from 'react-native' +import { RefreshCw, TriangleAlert } from 'lucide-react-native' +import type { ToolRunResult, ToolSpec } from '../../../src/shared/tools' +import { toolPanelKey } from '../../../src/shared/state/repo-configs' +import { Spin } from '../components/Spin' +import { alpha, c, fs, mono, themed } from '../theme' +import { PanelAction, RightPanel } from './RightPanel' +import { useWatchedQuery } from './useWatchedQuery' +import type { PanelProps } from './types' + +interface NessLinkAction { + verb: string + params: Map +} + +export function CustomToolPanel({ client, worktreePath, onSendToAgent, onOpenUrl, spec }: PanelProps & { spec: ToolSpec }) { + const fetcher = useCallback((path: string) => client.api.runTool(path, spec.id), [client, spec.id]) + + const { data, loading, refresh } = useWatchedQuery({ + client, + worktreePath, + cacheKey: `tool:${spec.id}`, + fetcher, + // A `manual` tool still runs on mount and on the refresh button, but + // never on a timer or a git change — tool scripts routinely hit the + // network, and the built-in panels' cadence would hammer an API. + fallbackPollMs: spec.refresh === 'auto' ? 30000 : 0, + revalidateOnFileChange: spec.refresh === 'auto' + }) + + const handleAction = useCallback( + (action: NessLinkAction) => { + if (action.verb === 'send') { + const text = action.params.get('text') + if (text) onSendToAgent(text) + return + } + // `ness:file` opens a file tab on desktop (onOpenFile) — desktop-only, ignored. + if (action.verb === 'refresh') refresh() + }, + [onSendToAgent, refresh] + ) + + if (!worktreePath) return null + + const actions = ( + <> + {data && !data.ok && ( + // Tooltip on desktop; tap to read the error here. + Alert.alert(spec.title, data.error || 'Tool failed')} label={data.error || 'Tool failed'}> + + + )} + refresh()} label="Refresh"> + {loading ? ( + + + + ) : ( + + )} + + + ) + + const body = data?.markdown?.trim() + + return ( + + {/* max-h-56 on desktop; taller here for 44pt rows. */} + + {!data && loading && Running…} + {body ? ( + + ) : ( + data && ( + + {data.ok ? 'No output' : data.error || 'Tool failed'} + + ) + )} + + + ) +} + +// --------------------------------------------------------------------------- +// SidebarMarkdown port. Same mapping: h1/h2 → section bar, h3 → light +// uppercase subheading, h4+ → muted subheading, list item → one truncated +// row, `code` → mono chip, **bold** → bright, *em* → faint italic, +// > → indented note, --- → divider, tables render cramped, images dropped, +// raw HTML inert. Links: `ness:` → onAction, http(s) → system browser, +// anything else → inert text. +// --------------------------------------------------------------------------- + +type Block = + | { t: 'h'; level: number; text: string } + | { t: 'li'; text: string } + | { t: 'p'; text: string } + | { t: 'quote'; text: string } + | { t: 'hr' } + | { t: 'pre'; text: string } + | { t: 'table'; head: string[]; rows: string[][] } + +const LIST_RE = /^\s*(?:[-*+]|\d+[.)])\s+(.*)$/ +const HR_RE = /^\s{0,3}([-*_])(\s*\1){2,}\s*$/ +const TABLE_SEP_RE = /^\s*\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)*\|?\s*$/ + +function splitRow(line: string): string[] { + return line.trim().replace(/^\|/, '').replace(/\|$/, '').split('|').map((s) => s.trim()) +} + +function parseBlocks(md: string): Block[] { + const lines = md.replace(/\r\n?/g, '\n').split('\n') + const out: Block[] = [] + let para: string[] = [] + const endPara = (): void => { + if (para.length) out.push({ t: 'p', text: para.join(' ') }) + para = [] + } + for (let i = 0; i < lines.length; i++) { + const line = lines[i] + if (/^\s*```/.test(line)) { + endPara() + const body: string[] = [] + for (i++; i < lines.length && !/^\s*```/.test(lines[i]); i++) body.push(lines[i]) + out.push({ t: 'pre', text: body.join('\n') }) + continue + } + if (!line.trim()) { + endPara() + continue + } + const h = /^\s{0,3}(#{1,6})\s+(.*?)\s*#*\s*$/.exec(line) + if (h) { + endPara() + out.push({ t: 'h', level: h[1].length, text: h[2] }) + continue + } + if (HR_RE.test(line)) { + // `text\n---` is a setext h2 in markdown. + if (para.length && /^\s*-+\s*$/.test(line)) { + out.push({ t: 'h', level: 2, text: para.join(' ') }) + para = [] + } else { + endPara() + out.push({ t: 'hr' }) + } + continue + } + const li = LIST_RE.exec(line) + if (li) { + endPara() + out.push({ t: 'li', text: li[1] }) + continue + } + if (/^\s*>/.test(line)) { + endPara() + const body: string[] = [line.replace(/^\s*>\s?/, '')] + while (i + 1 < lines.length && /^\s*>/.test(lines[i + 1])) body.push(lines[++i].replace(/^\s*>\s?/, '')) + out.push({ t: 'quote', text: body.join(' ') }) + continue + } + if (line.includes('|') && i + 1 < lines.length && TABLE_SEP_RE.test(lines[i + 1]) && lines[i + 1].includes('-')) { + endPara() + const head = splitRow(line) + const rows: string[][] = [] + for (i += 2; i < lines.length && lines[i].includes('|') && lines[i].trim(); i++) rows.push(splitRow(lines[i])) + i-- + out.push({ t: 'table', head, rows }) + continue + } + // Continuation of a list item's text (lazy line) folds into the row. + const last = out[out.length - 1] + if (!para.length && last?.t === 'li' && /^\s+\S/.test(line)) { + last.text += ' ' + line.trim() + continue + } + para.push(line.trim()) + } + endPara() + return out +} + +type Inline = + | { t: 'text'; text: string } + | { t: 'code'; text: string } + | { t: 'strong'; children: Inline[] } + | { t: 'em'; children: Inline[] } + | { t: 'link'; href: string; children: Inline[] } + +const INLINE_RE = + /(!\[[^\]]*\]\([^)]*\))|(`+)([\s\S]*?[^`])\2(?!`)|\[([^\]]+)\]\(\s*]*)>?(?:\s+"[^"]*")?\s*\)|<(https?:\/\/[^>\s]+)>|(https?:\/\/[^\s<]+[^\s<.,:;"')\]])|\*\*([\s\S]+?)\*\*|__([\s\S]+?)__|\*([^*\s][^*]*?)\*|\b_([^_\s][^_]*?)_\b/g + +function parseInline(text: string): Inline[] { + const out: Inline[] = [] + let last = 0 + const re = new RegExp(INLINE_RE.source, 'g') + let m: RegExpExecArray | null + while ((m = re.exec(text))) { + if (m.index > last) out.push({ t: 'text', text: unescape(text.slice(last, m.index)) }) + last = m.index + m[0].length + if (m[1]) continue // image: dropped + if (m[2]) out.push({ t: 'code', text: m[3].trim() || m[3] }) + else if (m[4] !== undefined) out.push({ t: 'link', href: m[5], children: parseInline(m[4]) }) + else if (m[6]) out.push({ t: 'link', href: m[6], children: [{ t: 'text', text: m[6] }] }) + else if (m[7]) out.push({ t: 'link', href: m[7], children: [{ t: 'text', text: m[7] }] }) + else if (m[8] ?? m[9]) out.push({ t: 'strong', children: parseInline((m[8] ?? m[9])!) }) + else if (m[10] ?? m[11]) out.push({ t: 'em', children: parseInline((m[10] ?? m[11])!) }) + } + if (last < text.length) out.push({ t: 'text', text: unescape(text.slice(last)) }) + return out +} + +function unescape(s: string): string { + return s.replace(/\\([\\`*_{}[\]()#+\-.!|>~])/g, '$1') +} + +/** `ness:verb?a=b` → action. URLSearchParams semantics (`+` is a space), + * parsed by hand because Hermes' URLSearchParams is incomplete. */ +function parseNessLink(href: string): NessLinkAction { + const rest = href.slice('ness:'.length) + const [verb, query = ''] = rest.split('?') + const params = new Map() + for (const pair of query.split('&')) { + if (!pair) continue + const eq = pair.indexOf('=') + const dec = (s: string): string => { + try { + return decodeURIComponent(s.replace(/\+/g, ' ')) + } catch { + return s + } + } + const k = dec(eq >= 0 ? pair.slice(0, eq) : pair) + if (!params.has(k)) params.set(k, dec(eq >= 0 ? pair.slice(eq + 1) : '')) + } + return { verb, params } +} + +/** The single link a row consists of, if any — the whole row becomes its + * 44pt tap target. */ +function soleLink(nodes: Inline[]): string | null { + const meaningful = nodes.filter((n) => !(n.t === 'text' && !n.text.trim())) + return meaningful.length === 1 && meaningful[0].t === 'link' ? meaningful[0].href : null +} + +const SECTION = themed(() => ({ + paddingHorizontal: 12, + paddingVertical: 6, + minHeight: 32, + justifyContent: 'center' as const, + backgroundColor: alpha(c.panelRaised, 0.5) +})) +const SECTION_TEXT = themed(() => ({ fontSize: fs.xs, fontWeight: '500' as const, color: c.dim, textTransform: 'uppercase' as const, letterSpacing: 0.6 })) + +function SidebarMarkdown({ + markdown, + onAction, + onOpenUrl +}: { + markdown: string + onAction: (action: NessLinkAction) => void + onOpenUrl: (url: string) => void +}) { + const blocks = useMemo(() => parseBlocks(markdown), [markdown]) + + const activate = useCallback( + (href: string): void => { + if (href.startsWith('ness:')) onAction(parseNessLink(href)) + else if (/^https?:/i.test(href)) onOpenUrl(href) + }, + [onAction, onOpenUrl] + ) + + const renderInline = (nodes: Inline[], key = ''): ReactNode => + nodes.map((n, i) => { + const k = `${key}${i}` + switch (n.t) { + case 'text': + return n.text + case 'code': + return ( + + {n.text} + + ) + case 'strong': + return ( + + {renderInline(n.children, `${k}.`)} + + ) + case 'em': + return ( + + {renderInline(n.children, `${k}.`)} + + ) + case 'link': + if (n.href.startsWith('ness:') || /^https?:/i.test(n.href)) { + return ( + activate(n.href)} suppressHighlighting={false}> + {renderInline(n.children, `${k}.`)} + + ) + } + return ( + + {renderInline(n.children, `${k}.`)} + + ) + } + }) + + return ( + + {blocks.map((b, i) => { + switch (b.t) { + case 'h': + if (b.level <= 2) + return ( + + + {renderInline(parseInline(b.text))} + + + ) + if (b.level === 3) + return ( + + {renderInline(parseInline(b.text))} + + ) + return ( + + {renderInline(parseInline(b.text))} + + ) + case 'li': { + const nodes = parseInline(b.text) + const href = soleLink(nodes) + const inner = ( + + {renderInline(nodes)} + + ) + if (href && (href.startsWith('ness:') || /^https?:/i.test(href))) { + return ( + activate(href)} + style={({ pressed }) => ({ minHeight: 44, flexDirection: 'row', alignItems: 'center', paddingHorizontal: 12, backgroundColor: pressed ? c.panelRaised : 'transparent' })} + > + {inner} + + ) + } + return ( + + {inner} + + ) + } + case 'p': + return ( + + {renderInline(parseInline(b.text))} + + ) + case 'quote': + return ( + + {renderInline(parseInline(b.text))} + + ) + case 'hr': + return + case 'pre': + return ( + + + {b.text} + + + ) + case 'table': + return ( + + + + {b.head.map((h, j) => ( + + {renderInline(parseInline(h))} + + ))} + + {b.rows.map((r, ri) => ( + + {b.head.map((_, j) => ( + + {renderInline(parseInline(r[j] ?? ''))} + + ))} + + ))} + + + ) + } + })} + + ) +} diff --git a/mobile/src/panels/PRPanels.tsx b/mobile/src/panels/PRPanels.tsx new file mode 100644 index 00000000..4213af4c --- /dev/null +++ b/mobile/src/panels/PRPanels.tsx @@ -0,0 +1,1325 @@ +// Port of renderer/components/PRStatusPanel.tsx (PRStatusPanel + +// MergeLocallyPanel). Same data sources, channels, conditions and labels; +// only the view layer changes. Phone-specific changes: +// - Desktop tooltips (hover-only) are reachable by long-press (Alert). +// - The PR panel's Approve / Merge live in the header like the desktop's +// while the panel is collapsed; when expanded they move into a full-width +// 44pt row at the top of the body so the two-tap merge confirm is +// comfortable on a phone. +// - Drag-a-URL-out (PR title, issues, checks) has no phone equivalent. +import { useCallback, useEffect, useRef, useState, type ReactNode } from 'react' +import { Alert, Image, Pressable, ScrollView, Text, View } from 'react-native' +import { + ArrowDown, + Bot, + Check, + ChevronDown, + CircleCheck, + CircleDot, + ExternalLink, + GitMerge, + GitMergeConflict, + GitPullRequest, + Info, + Loader2, + RefreshCw, + Square, + SquareCheck +} from 'lucide-react-native' +import type { CheckStatus, PRReview, PRStatus } from '../../../src/shared/state/prs' +import type { MergeStrategy } from '../../../src/shared/state/settings' +import type { Worktree } from '../../../src/shared/state/worktrees' +import { isCiNotifyEnabled } from '../../../src/shared/state/ci-notify' +import type { + GitHubMergeMethod, + MainWorktreeStatus, + MergeConflictFixResult, + MergeConflictPreview, + MergeLocalResult, + MergePRResult +} from '../../../src/renderer/types' +import { useNess, type NessClient } from '../ness' +import { alpha, c, fs, mono, themed } from '../theme' +import { Spin } from '../components/Spin' +import { PanelAction, RightPanel } from './RightPanel' +import type { PanelProps } from './types' + +const errMsg = (err: unknown): string => (err instanceof Error ? err.message : String(err)) +const tip = (text: string) => () => Alert.alert(text) + +/** Same as RightColumn/MobileRightPanel: a PAT or a detected `gh` login. */ +function useHasGithubToken(client: NessClient): boolean { + return useNess(client, (s) => s.settings.hasGithubToken || !!s.settings.githubAuthSource) +} + +/** Effective merge strategy = repo override → global default. */ +function useMergeStrategy(client: NessClient, repoRoot: string | null): MergeStrategy { + const repo = useNess(client, (s) => (repoRoot ? s.repoConfigs.byRepo[repoRoot]?.mergeStrategy : undefined)) + const global = useNess(client, (s) => s.settings.mergeStrategy) + return repo || global +} + +/** Port of renderer/store.ts useLocalMergeState. */ +function useLocalMergeState(client: NessClient, worktreePath: string, repoRoot: string) { + const merging = useNess(client, (s) => !!s.prs.mergingByPath[worktreePath]) + const repoBusy = useNess(client, (s) => { + for (const path in s.prs.mergingByPath) { + if (s.worktrees.list.some((w) => w.path === path && w.repoRoot === repoRoot)) return true + } + return false + }) + const merged = useNess(client, (s) => !!s.prs.mergedByPath[worktreePath]) + return { merging, repoBusy, merged } +} + +// ─── Shared view bits ─────────────────────────────────────────────────── + +function Icon({ busy, children }: { busy?: boolean; children: ReactNode }) { + return busy ? {children} : <>{children} +} + +/** Tinted full-width (or compact header) action button. */ +function ActionButton({ + label, + icon, + color, + bg, + border, + onPress, + onLongPress, + disabled, + dim, + compact, + accessibilityLabel +}: { + label: string + icon: ReactNode + color: string + bg: string + border?: string + onPress: () => void + onLongPress?: () => void + disabled?: boolean + /** Visual disabled (opacity) independent of tappability. */ + dim?: boolean + compact?: boolean + accessibilityLabel?: string +}) { + return ( + ({ + flex: compact ? undefined : 1, + minHeight: compact ? 32 : 44, + flexDirection: 'row', + alignItems: 'center', + justifyContent: 'center', + gap: 6, + paddingHorizontal: compact ? 8 : 12, + borderRadius: 6, + borderWidth: border ? 1 : 0, + borderColor: border, + backgroundColor: bg, + opacity: dim ? 0.45 : pressed ? 0.75 : 1 + })} + > + {icon} + + {label} + + + ) +} + +function ErrorRow({ error, onRetry }: { error: string; onRetry: () => void }) { + return ( + + {error} + ({ minHeight: 44, minWidth: 64, paddingHorizontal: 12, alignItems: 'center', justifyContent: 'center', borderRadius: 4, backgroundColor: pressed ? alpha(c.surface, 0.6) : c.surface })} + > + Retry + + + ) +} + +// ─── Merge Locally ────────────────────────────────────────────────────── + +const STRATEGY_BUTTON_LABELS: Record = { + squash: 'Squash and merge', + 'merge-commit': 'Create a merge commit', + 'fast-forward': 'Fast-forward merge' +} + +const STRATEGY_MENU_LABELS: Record = { + squash: 'Squash and merge', + 'merge-commit': 'Create a merge commit', + 'fast-forward': 'Fast-forward merge' +} + +/** How long after a worktree switch to wait before simulating the merge + * (same as desktop: scrubbing fires none, the warning is there by read time). */ +const CONFLICT_PREVIEW_DELAY_MS = 500 + +const STRATEGY_DESCRIPTIONS: Record = { + squash: 'The commits from this branch will be combined into one commit on the base branch.', + 'merge-commit': 'All commits from this branch will be added to the base branch via a merge commit.', + 'fast-forward': 'Only merge if the base can fast-forward (--ff-only). Fails on divergent history.' +} + +/** Shown only when there's no PR, it's not the main worktree, and GitHub is + * connected (same condition as the desktop). */ +export function MergePanel(props: PanelProps) { + const { client, worktree, worktreePath, onClose } = props + const hasGithubToken = useHasGithubToken(client) + const pr = useNess(client, (s) => (worktreePath ? s.prs.byPath[worktreePath] : null)) + const needsGithubToken = hasGithubToken === false + const show = !needsGithubToken && pr === null && worktree && !worktree.isMain + if (!show || !worktree) return null + // Desktop onMerged → prs:refreshAll; onRemoveWorktree → worktree:remove + // (as the web client's MobileRightPanel does), then close the sheet. + const onMerged = (): void => void client.api.refreshPRsAll() + // Always confirm on the phone: the desktop confirms only for locked / + // dirty / scratchpad-bearing worktrees, but a stray tap is much more + // likely on a touch screen and removal can't be undone from here. + const onRemoveWorktree = (path: string): void => { + Alert.alert('Remove worktree?', `${worktree.branch || path.split('/').pop()} will be removed from disk.`, [ + { text: 'Cancel', style: 'cancel' }, + { + text: 'Remove', + style: 'destructive', + onPress: () => { + void client.api.removeWorktree(worktree.repoRoot, path) + onClose() + } + } + ]) + } + return ( + + {/* Keyed per worktree so a merge in one never settles into another's view. */} + + + ) +} + +function MergeLocallyBody({ + client, + worktree, + onMerged, + onRemoveWorktree +}: { + client: NessClient + worktree: Worktree + onMerged: () => void + onRemoveWorktree: (worktreePath: string) => void +}) { + const [mainStatus, setMainStatus] = useState(null) + const [conflictPreview, setConflictPreview] = useState(null) + const [busy, setBusy] = useState<'idle' | 'checking' | 'fixing' | 'merging'>('idle') + const [error, setError] = useState(null) + const [success, setSuccess] = useState(null) + const [dismissed, setDismissed] = useState(false) + const [menuOpen, setMenuOpen] = useState(false) + const previewRef = useRef | null>(null) + + const { repoRoot, branch, path } = worktree + const strategy = useMergeStrategy(client, repoRoot) + const { merging: mergeInFlight, repoBusy, merged: mergedLocally } = useLocalMergeState(client, path, repoRoot) + + const refreshStatus = useCallback(async () => { + setBusy('checking') + try { + setMainStatus(await client.api.getMainWorktreeStatus(repoRoot)) + } catch (err) { + setError(errMsg(err)) + } finally { + setBusy('idle') + } + }, [client, repoRoot]) + + useEffect(() => { + void refreshStatus() + }, [refreshStatus]) + + useEffect(() => { + setConflictPreview(null) + previewRef.current = null + let cancelled = false + const timer = setTimeout(() => { + const pending = client + .api.previewMergeConflicts(repoRoot, branch, path) + .catch(() => null) + previewRef.current = pending + void pending.then((preview) => { + if (!cancelled) setConflictPreview(preview) + }) + }, CONFLICT_PREVIEW_DELAY_MS) + return () => { + cancelled = true + clearTimeout(timer) + } + }, [client, repoRoot, branch, path]) + + const handlePickStrategy = (s: MergeStrategy): void => { + setMenuOpen(false) + // Persist as new default — "last used wins". + void client.api.setMergeStrategy(s) + } + + const handleFix = async (): Promise => { + setError(null) + setBusy('fixing') + try { + setMainStatus(await client.api.prepareMainForMerge(repoRoot)) + } catch (err) { + setError(errMsg(err)) + } finally { + setBusy('idle') + } + } + + const handleMerge = async (): Promise => { + if (!mainStatus) return + setError(null) + setSuccess(null) + setBusy('merging') + try { + // Settle the deferred preview rather than racing it. + const preview = await (previewRef.current ?? + client.api.previewMergeConflicts(repoRoot, branch, path).catch(() => null)) + if (preview?.hasConflict) { + setConflictPreview(preview) + setError('Resolve merge conflicts before merging.') + return + } + void client.api.setMergeStrategy(strategy) + const result = await client.api.mergeWorktreeLocally(repoRoot, branch, strategy, path) + setSuccess(`Merged into ${result.baseBranch}`) + onMerged() + } catch (err) { + setError(errMsg(err)) + } finally { + setBusy('idle') + } + } + + const ready = mainStatus?.ready === true + const needsFix = mainStatus && !mainStatus.ready + const hasConflict = conflictPreview?.hasConflict === true + const merging = busy === 'merging' || mergeInFlight + const successMessage = + success ?? (mergedLocally && !dismissed && !merging && mainStatus ? `Merged into ${mainStatus.baseBranch}` : null) + const mergeDisabled = !ready || busy !== 'idle' || merging || repoBusy || hasConflict + + if (successMessage) { + return ( + + {successMessage} + onRemoveWorktree(worktree.path)} + /> + { + setSuccess(null) + setDismissed(true) + void refreshStatus() + }} + style={{ minHeight: 44, alignItems: 'center', justifyContent: 'center' }} + > + Dismiss + + + ) + } + + return ( + + + Merge {worktree.branch} + {mainStatus && ( + <> + {' '}into {mainStatus.baseBranch} + + )} + + + {/* GitHub-style split button; the strategy menu expands inline. */} + + void handleMerge()} + onLongPress={hasConflict ? tip('Resolve merge conflicts before merging') : undefined} + disabled={mergeDisabled} + style={({ pressed }) => ({ + flex: 1, + minHeight: 44, + flexDirection: 'row', + alignItems: 'center', + justifyContent: 'center', + gap: 6, + backgroundColor: alpha(c.accent, pressed ? 0.3 : 0.2), + borderTopLeftRadius: 6, + borderBottomLeftRadius: 6, + borderRightWidth: 1, + borderColor: alpha(c.accent, 0.4), + opacity: mergeDisabled ? 0.5 : 1 + })} + > + + + {merging ? 'Merging…' : STRATEGY_BUTTON_LABELS[strategy]} + + + setMenuOpen((v) => !v)} + disabled={merging} + accessibilityLabel="Change merge strategy" + style={({ pressed }) => ({ + width: 44, + minHeight: 44, + alignItems: 'center', + justifyContent: 'center', + backgroundColor: alpha(c.accent, pressed || menuOpen ? 0.3 : 0.2), + borderTopRightRadius: 6, + borderBottomRightRadius: 6, + opacity: merging ? 0.5 : 1 + })} + > + + + + + {menuOpen && ( + + {(['squash', 'merge-commit', 'fast-forward'] as MergeStrategy[]).map((s) => { + const active = s === strategy + return ( + handlePickStrategy(s)} + accessibilityState={{ selected: active }} + style={({ pressed }) => ({ + minHeight: 44, + flexDirection: 'row', + alignItems: 'flex-start', + gap: 8, + paddingHorizontal: 10, + paddingVertical: 8, + backgroundColor: active || pressed ? c.panelRaised : 'transparent' + })} + > + + + + + {STRATEGY_MENU_LABELS[s]} + {STRATEGY_DESCRIPTIONS[s]} + + + ) + })} + + )} + + {hasConflict && conflictPreview && ( + + + Merge conflict + {conflictPreview.files.length > 0 && ( + <> + {' '}in{' '} + + {conflictPreview.files.length === 1 ? conflictPreview.files[0] : `${conflictPreview.files.length} files`} + + + )} + . Resolve before merging. + + {conflictPreview.files.length > 1 && ( + + {conflictPreview.files.map((f) => ( + // ellipsizeMode="head" = the desktop's rtl trick: keep the filename end visible. + + {f} + + ))} + + )} + + )} + + {needsFix && mainStatus && ( + + + Main worktree isn't ready: + {mainStatus.isDirty && ' has uncommitted changes'} + {!mainStatus.isOnBase && ( + <> + {mainStatus.isDirty ? ' and' : ''} on{' '} + {mainStatus.currentBranch || 'detached HEAD'}, not{' '} + {mainStatus.baseBranch} + + )} + . + + void handleFix()} + disabled={busy !== 'idle' || repoBusy} + dim={busy !== 'idle' || repoBusy} + /> + + )} + + {error && {error}} + + ) +} + +// ─── Pull Request ─────────────────────────────────────────────────────── + +/** Copied from PRStatusPanel.tsx: first non-empty, non-heading line of a + * check's `output.summary`, capped. */ +function firstLine(summary: string | undefined): string { + if (!summary) return '' + for (const raw of summary.split('\n')) { + const line = raw.trim().replace(/^#+\s*/, '').replace(/^[-*]\s+/, '') + if (line) return line.length > 140 ? line.slice(0, 140) + '…' : line + } + return '' +} + +const STATE_LABELS: Record = { open: 'Open', draft: 'Draft', merged: 'Merged', closed: 'Closed' } +const STATE_PILL_COLORS: Record = themed(() => ({ open: c.success, draft: c.warning, merged: c.accent, closed: c.danger })) + +/** Copied from PRStatusPanel.tsx (GitHub's label-foreground rule). */ +function labelTextColor(hex: string): string { + if (!/^[0-9a-fA-F]{6}$/.test(hex)) return '#fff' + const r = parseInt(hex.slice(0, 2), 16) + const g = parseInt(hex.slice(2, 4), 16) + const b = parseInt(hex.slice(4, 6), 16) + const lum = 0.2126 * r + 0.7152 * g + 0.0722 * b + return lum > 140 ? '#1f2328' : '#ffffff' +} + +function ordinalSuffix(n: number): string { + const mod100 = n % 100 + if (mod100 >= 11 && mod100 <= 13) return 'th' + switch (n % 10) { + case 1: + return 'st' + case 2: + return 'nd' + case 3: + return 'rd' + default: + return 'th' + } +} + +function formatEta(seconds: number): string { + if (seconds < 60) return '<1m' + if (seconds < 3600) return `~${Math.round(seconds / 60)}m` + const hours = Math.floor(seconds / 3600) + const mins = Math.round((seconds % 3600) / 60) + return mins === 0 ? `~${hours}h` : `~${hours}h${mins}m` +} + +function queueBadgeLabel(position: number, etaSeconds?: number): string { + const eta = typeof etaSeconds === 'number' ? ` · ${formatEta(etaSeconds)}` : '' + if (position <= 1) return `Queued${eta}` + return `Queued (${position}${ordinalSuffix(position)}${eta})` +} + +type MilestoneDisplay = 'hidden' | 'pill' | 'placeholder' +function milestoneDisplay(pr: Pick): MilestoneDisplay { + if (pr.hasMilestones === false) return 'hidden' + return pr.milestone ? 'pill' : 'placeholder' +} + +const CHECK_ICONS: Record = themed(() => ({ + success: { symbol: '✓', color: c.success }, + failure: { symbol: '✗', color: c.danger }, + error: { symbol: '!', color: c.danger }, + pending: { symbol: '○', color: c.warning }, + neutral: { symbol: '-', color: c.dim }, + skipped: { symbol: '-', color: c.dim } +})) + +const OVERALL_COLORS: Record = themed(() => ({ success: c.success, failure: c.danger, pending: c.warning, none: c.dim })) + +const CHECK_STATE_PRIORITY: Record = { + failure: 0, + error: 0, + pending: 1, + success: 2, + neutral: 3, + skipped: 4 +} + +/** Failed → pending → success → neutral/skipped, then startedAt, then name. */ +function sortChecksForDisplay(checks: CheckStatus[]): CheckStatus[] { + return [...checks].sort((a, b) => { + const pa = CHECK_STATE_PRIORITY[a.state] + const pb = CHECK_STATE_PRIORITY[b.state] + if (pa !== pb) return pa - pb + const ta = a.startedAt ? Date.parse(a.startedAt) : Number.POSITIVE_INFINITY + const tb = b.startedAt ? Date.parse(b.startedAt) : Number.POSITIVE_INFINITY + if (ta !== tb) return ta - tb + return a.name.localeCompare(b.name) + }) +} + +const REVIEW_DECISION_LABELS: Record = themed(() => ({ + approved: { text: 'Approved', color: c.success }, + changes_requested: { text: 'Changes requested', color: c.warning }, + review_required: { text: 'Review pending', color: c.faint }, + none: { text: '', color: c.faint } +})) + +const REVIEW_STATE_ICONS: Record = themed(() => ({ + APPROVED: { symbol: '✓', color: c.success }, + CHANGES_REQUESTED: { symbol: '●', color: c.warning }, + COMMENTED: { symbol: '○', color: c.faint }, + DISMISSED: { symbol: '-', color: c.dim }, + PENDING: { symbol: '○', color: c.dim } +})) + +function ReviewSummary({ + reviews, + decision, + onOpenUrl +}: { + reviews: PRReview[] + decision: PRStatus['reviewDecision'] + onOpenUrl: (url: string) => void +}) { + const [expanded, setExpanded] = useState(false) + const label = REVIEW_DECISION_LABELS[decision] + // Dedupe to latest review per user. + const latestByUser = new Map() + for (const r of reviews) latestByUser.set(r.user, r) + const uniqueReviewers = [...latestByUser.values()] + + return ( + + setExpanded(!expanded)} style={{ minHeight: 44, flexDirection: 'row', alignItems: 'center', gap: 6 }}> + {!!label.text && {label.text}} + + ({uniqueReviewers.length} {uniqueReviewers.length === 1 ? 'reviewer' : 'reviewers'}){expanded ? '▴' : '▾'} + + + {expanded && + uniqueReviewers.map((review) => { + const icon = REVIEW_STATE_ICONS[review.state] + return ( + onOpenUrl(review.htmlUrl)} + onLongPress={tip(`${review.user}: ${review.state.toLowerCase().replace('_', ' ')}`)} + style={({ pressed }) => ({ minHeight: 44, flexDirection: 'row', alignItems: 'center', gap: 8, paddingHorizontal: 4, borderRadius: 4, backgroundColor: pressed ? c.panelRaised : 'transparent' })} + > + + + {review.user} + + {icon.symbol} + + + + + ) + })} + + ) +} + +// 'fast-forward' has no GitHub equivalent — 'rebase' is the closest. +const STRATEGY_TO_METHOD: Record = { + squash: 'squash', + 'merge-commit': 'merge', + 'fast-forward': 'rebase' +} +const METHOD_LABEL: Record = { squash: 'Squash', merge: 'Merge', rebase: 'Rebase' } + +/** Port of usePRMergeAction: same disabled reasons, 5s two-tap confirm, + * labels. Returns state + renderers instead of prebuilt JSX so the button + * can render compact (header) or full-width (body). */ +function usePRMergeAction(client: NessClient, pr: PRStatus | null | undefined, worktree: Worktree | null, needsGithubToken: boolean) { + const strategy = useMergeStrategy(client, worktree?.repoRoot ?? null) + const method = STRATEGY_TO_METHOD[strategy] + const methodLabel = METHOD_LABEL[method] + + const [confirming, setConfirming] = useState(false) + const [merging, setMerging] = useState(false) + const [error, setError] = useState(null) + const [justMerged, setJustMerged] = useState(false) + const confirmTimerRef = useRef | null>(null) + + useEffect(() => () => { + if (confirmTimerRef.current) clearTimeout(confirmTimerRef.current) + }, []) + + // Reset confirm flag if the PR identity changes underneath us. + useEffect(() => { + setConfirming(false) + setError(null) + setJustMerged(false) + if (confirmTimerRef.current) clearTimeout(confirmTimerRef.current) + }, [pr?.number, pr?.state]) + + const performMerge = useCallback(async () => { + if (!worktree) return + if (confirmTimerRef.current) { + clearTimeout(confirmTimerRef.current) + confirmTimerRef.current = null + } + setConfirming(false) + setMerging(true) + setError(null) + try { + const result = await client.api.mergePR(worktree.path, method) + if (result.ok) setJustMerged(true) + else setError(result.error || 'Merge failed') + } catch (err) { + setError(errMsg(err)) + } finally { + setMerging(false) + } + }, [client, worktree, method]) + + if (!pr) return { render: null, errorRow: null } + + const isTerminal = pr.state === 'merged' || pr.state === 'closed' + let disabledReason: string | null = null + if (needsGithubToken) disabledReason = 'Connect GitHub token to merge' + else if (!worktree) disabledReason = 'No active worktree' + else if (pr.state === 'merged') disabledReason = 'Already merged' + else if (pr.state === 'closed') disabledReason = 'PR is closed' + else if (pr.state === 'draft') disabledReason = "Draft PRs can't be merged" + else if (pr.hasConflict === true) disabledReason = 'There are merge conflicts' + const canMerge = disabledReason === null && !merging + + const startConfirm = (): void => { + setError(null) + setConfirming(true) + if (confirmTimerRef.current) clearTimeout(confirmTimerRef.current) + confirmTimerRef.current = setTimeout(() => { + setConfirming(false) + confirmTimerRef.current = null + }, 5000) + } + + let mergeLabel: string + if (merging) mergeLabel = 'Merging…' + else if (justMerged) mergeLabel = 'Merged' + else if (confirming) mergeLabel = `Confirm merge into ${pr.baseBranch}` + else mergeLabel = methodLabel + + let mergeTooltip: string + if (disabledReason) mergeTooltip = disabledReason + else if (confirming) mergeTooltip = 'Tap again to confirm' + else mergeTooltip = 'Merge the pull request' + + const showMergeButton = !isTerminal && !pr.queuePosition + const conflict = pr.hasConflict === true + const color = conflict ? c.danger : confirming ? c.warning : c.success + const bg = conflict ? alpha(c.danger, 0.2) : confirming ? alpha(c.warning, 0.3) : alpha(c.success, 0.2) + + const render = showMergeButton + ? (compact: boolean) => ( + + ) : justMerged ? ( + + ) : conflict ? ( + + ) : ( + + ) + } + // Disabled-with-a-reason stays tappable so the reason (a hover + // tooltip on desktop) can be shown. + onPress={() => { + if (justMerged || merging) return + if (!canMerge) { + if (disabledReason) Alert.alert(disabledReason) + return + } + if (confirming) void performMerge() + else startConfirm() + }} + onLongPress={tip(mergeTooltip)} + dim={(!canMerge || justMerged) && !conflict} + /> + ) + : null + + const errorRow = error ? ( + { + setError(null) + void performMerge() + }} + /> + ) : null + + return { render, errorRow } +} + +/** Port of usePRApproveAction (same visibility heuristic). */ +function usePRApproveAction( + client: NessClient, + pr: PRStatus | null | undefined, + worktree: Worktree | null, + viewerLogin: string | null, + needsGithubToken: boolean +) { + const [approving, setApproving] = useState(false) + const [error, setError] = useState(null) + const [justApproved, setJustApproved] = useState(false) + + useEffect(() => { + setApproving(false) + setError(null) + setJustApproved(false) + }, [pr?.number]) + + const performApprove = useCallback(async () => { + if (!worktree) return + setApproving(true) + setError(null) + try { + const result = await client.api.approvePR(worktree.path) + if (result.ok) setJustApproved(true) + else setError(result.error || 'Approval failed') + } catch (err) { + setError(errMsg(err)) + } finally { + setApproving(false) + } + }, [client, worktree]) + + const none = { render: null, errorRow: null } + if (!pr || !worktree || needsGithubToken) return none + if (pr.state !== 'open') return none + if (!viewerLogin) return none + if (pr.author?.login === viewerLogin) return none + + let viewerLatest: PRReview | null = null + for (const r of pr.reviews) { + if (r.user !== viewerLogin) continue + if (!viewerLatest || r.submittedAt > viewerLatest.submittedAt) viewerLatest = r + } + if (viewerLatest?.state === 'APPROVED') return none + const showApprove = pr.reviewDecision === 'review_required' || viewerLatest?.state === 'CHANGES_REQUESTED' + if (!showApprove) return none + + const render = (compact: boolean) => ( + + ) : ( + + ) + } + onPress={() => void performApprove()} + onLongPress={tip(justApproved ? 'Approved' : 'Approve this pull request')} + disabled={approving || justApproved} + dim={approving || justApproved} + /> + ) + + const errorRow = error ? ( + { + setError(null) + void performApprove() + }} + /> + ) : null + + return { render, errorRow } +} + +/** Port of useAiReviewAction: opens a reviewer Chat tab for this worktree. */ +function AiReviewRow({ client, worktree }: { client: NessClient; worktree: Worktree }) { + const [busy, setBusy] = useState(false) + const [error, setError] = useState(null) + const [done, setDone] = useState(false) + + useEffect(() => { + setBusy(false) + setError(null) + setDone(false) + }, [worktree.path]) + + const request = async (): Promise => { + setBusy(true) + setError(null) + try { + const result = await client.api.requestAiReview(worktree.path) + if (result.ok) setDone(true) + else setError(result.error) + } catch (err) { + setError(errMsg(err)) + } finally { + setBusy(false) + } + } + + return ( + + + ) : done ? ( + + ) : ( + + ) + } + onPress={() => void request()} + onLongPress={tip('Open an agent that reviews this branch and sends its review to your Chat tab')} + disabled={busy || done} + dim={busy || done} + /> + {error && {error}} + + ) +} + +export function PRPanel(props: PanelProps) { + const { client, worktree, worktreePath, onOpenUrl } = props + // Same as RightColumn: undefined = not polled yet ("Loading..."), null = no PR. + const pr = useNess(client, (s) => (worktreePath ? s.prs.byPath[worktreePath] : null)) + const loading = useNess(client, (s) => s.prs.loading) + const hasGithubToken = useHasGithubToken(client) + const viewerLogin = useNess(client, (s) => s.settings.viewerLogin) + const agentReviewsEnabled = useNess(client, (s) => s.settings.agentReviewsEnabled) + const notifyDefault = useNess(client, (s) => s.settings.notifyChatOnCiFailure) + const ciNotify = useNess(client, (s) => s.ciNotify) + + const [expanded, setExpanded] = useState(false) + const [collapsed, setCollapsed] = useState(false) + + // Auto-expand the check list whenever checks are failing. + useEffect(() => { + if (pr?.checksOverall === 'failure') setExpanded(true) + }, [pr?.checksOverall, pr?.number]) + + const needsGithubToken = hasGithubToken === false + const mergeAction = usePRMergeAction(client, pr, worktree, needsGithubToken) + const approveAction = usePRApproveAction(client, pr, worktree, viewerLogin, needsGithubToken) + const onRefresh = (): void => void client.api.refreshPRsAll() + + const refreshButton = !needsGithubToken ? ( + + + + + + ) : null + + const hasActionButtons = !!(approveAction.render || mergeAction.render) + const actions = + hasActionButtons || refreshButton ? ( + <> + {collapsed && approveAction.render?.(true)} + {collapsed && mergeAction.render?.(true)} + {refreshButton} + + ) : null + + return ( + + {/* The desktop also tints the header info-blue here; RightPanel's RN + port has no header-style slot, so only the body is tinted. */} + + {needsGithubToken && ( + // The desktop's "Connect GitHub" button opens Settings → GitHub; + // the phone has no settings screen, so only the prompt is shown. + + + + Connect a GitHub token to see PR status and open pull requests from Ness. + + + )} + + {!needsGithubToken && pr === null && ( + No PR for this branch + )} + + {!needsGithubToken && pr !== undefined && agentReviewsEnabled && worktree && ( + + )} + + {!needsGithubToken && pr === undefined && ( + Loading... + )} + + {/* Approve / Merge, full-size while expanded (header when collapsed). */} + {hasActionButtons && ( + + {approveAction.render?.(false)} + {mergeAction.render?.(false)} + + )} + + {mergeAction.errorRow} + {approveAction.errorRow} + + {!needsGithubToken && pr && ( + + {/* #nnn pill + title */} + + {(() => { + const pillColor = pr.queuePosition ? c.accent : STATE_PILL_COLORS[pr.state] + return ( + onOpenUrl(pr.url)} + onLongPress={tip(pr.queuePosition ? queueBadgeLabel(pr.queuePosition, pr.queueEstimatedSeconds) : STATE_LABELS[pr.state])} + accessibilityLabel="Open PR in browser" + accessibilityRole="link" + // The 44pt box is the target; the pill is drawn inside it. + style={{ minWidth: 44, minHeight: 44, alignItems: 'center', justifyContent: 'center' }} + > + {({ pressed }) => ( + + #{pr.number} + + )} + + ) + })()} + onOpenUrl(pr.url)} style={{ flex: 1, minHeight: 44, justifyContent: 'center' }} accessibilityLabel="Open PR in browser"> + + {pr.title} + + + + + + {pr.assignees.length > 0 && ( + `Assigned to ${a.login}`).join('\n'))} style={{ flexDirection: 'row' }}> + {pr.assignees.map((a, i) => ( + 0 ? -4 : 0 }} + /> + ))} + + )} + {!!pr.queuePosition && ( + + {queueBadgeLabel(pr.queuePosition, pr.queueEstimatedSeconds)} + + )} + {(() => { + const display = milestoneDisplay(pr) + if (display === 'hidden') return null + if (display === 'pill' && pr.milestone) { + const m = pr.milestone + const closed = m.state === 'closed' + return ( + onOpenUrl(m.url)} + onLongPress={tip(`Milestone: ${m.title}`)} + hitSlop={8} + style={{ maxWidth: 160, paddingHorizontal: 8, paddingVertical: 3, borderRadius: 999, backgroundColor: closed ? c.surface : alpha(c.accent, 0.2) }} + > + + {m.title} + + + ) + } + return ( + + No milestone + + ) + })()} + + {pr.baseBranch} + + {pr.state !== 'merged' && typeof pr.behindBy === 'number' && pr.behindBy > 0 && ( + + + {pr.behindBy} + + )} + {pr.state === 'merged' && ( + + {pr.firstReleaseTag ?? 'unreleased'} + + )} + {typeof pr.additions === 'number' && typeof pr.deletions === 'number' && ( + + +{pr.additions} + −{pr.deletions} + + )} + + + {pr.labels.length > 0 && ( + + {pr.labels.map((label) => ( + + {label.name} + + ))} + + )} + + {pr.linkedIssues.length > 0 && ( + + + {pr.linkedIssues.length === 1 ? 'Linked issue' : 'Linked issues'} + + {pr.linkedIssues.map((iss) => { + const closed = iss.state === 'closed' + return ( + onOpenUrl(iss.url)} + onLongPress={tip(`${iss.title} (#${iss.number})`)} + style={({ pressed }) => ({ minHeight: 44, flexDirection: 'row', alignItems: 'center', gap: 6, borderRadius: 4, backgroundColor: pressed ? c.panelRaised : 'transparent' })} + > + {closed ? : } + #{iss.number} + + {iss.title} + + + ) + })} + + )} + + {pr.reviews.length > 0 && } + + {/* Checks summary */} + setExpanded(!expanded)} style={{ minHeight: 44, flexDirection: 'row', alignItems: 'center', gap: 6 }}> + + {pr.checksOverall === 'success' && 'Checks passing'} + {pr.checksOverall === 'failure' && 'Checks failing'} + {pr.checksOverall === 'pending' && 'Checks running'} + {pr.checksOverall === 'none' && 'No checks'} + + {pr.checks.length > 0 && ( + + ({pr.checks.filter((ch) => ch.state === 'success').length}/{pr.checks.length}){expanded ? '▴' : '▾'} + + )} + + + {expanded && pr.checks.length > 0 && ( + + {sortChecksForDisplay(pr.checks).map((check) => { + const icon = CHECK_ICONS[check.state] + const isFailure = check.state === 'failure' || check.state === 'error' + const reason = isFailure ? check.description || firstLine(check.summary) : '' + const url = check.detailsUrl + return ( + { + if (url) onOpenUrl(url) + }} + onLongPress={tip(url ? `Open: ${url}` : check.description || check.name)} + style={({ pressed }) => ({ minHeight: url ? 44 : 28, flexDirection: 'row', alignItems: 'center', gap: 6, paddingHorizontal: 4, borderRadius: 4, backgroundColor: pressed ? c.panelRaised : 'transparent' })} + > + {icon.symbol} + + + + {check.name} + + {url && } + + {!!reason && ( + + {reason} + + )} + + + ) + })} + + )} + + {worktree && pr.hasConflict === true && pr.state !== 'merged' && pr.state !== 'closed' && ( + + )} + + {worktree && ( + + )} + + )} + + + ) +} + +/** Hands the conflict off to the worktree's agent (a button, not automatic: + * one bad merge base would otherwise put the whole workspace to work). */ +function FixConflictsButton({ client, worktreePath }: { client: NessClient; worktreePath: string }) { + const [phase, setPhase] = useState<'idle' | 'sending' | 'sent'>('idle') + const [error, setError] = useState(null) + + useEffect(() => { + if (phase !== 'sent') return + const t = setTimeout(() => setPhase('idle'), 4000) + return () => clearTimeout(t) + }, [phase]) + + const send = async (): Promise => { + setPhase('sending') + setError(null) + try { + const result = await client.api.requestMergeConflictFix(worktreePath) + setPhase(result.ok ? 'sent' : 'idle') + if (!result.ok) setError(result.error || 'Failed to reach the agent') + } catch (err) { + setPhase('idle') + setError(errMsg(err)) + } + } + + return ( + + + + ) : phase === 'sent' ? ( + + ) : ( + + ) + } + onPress={() => void send()} + onLongPress={tip("Post a message into this worktree's agent chat asking it to bring the branch up to date with its base and resolve the conflicts.")} + disabled={phase !== 'idle'} + dim={phase !== 'idle'} + /> + + {error && {error}} + + ) +} + +/** Per-worktree opt in/out of PR notifications to the agent. Toggling back + * to the global default drops the override (null) so it tracks the setting. */ +function CiNotifyToggle({ + client, + worktreePath, + enabled, + globalDefault +}: { + client: NessClient + worktreePath: string + enabled: boolean + globalDefault: boolean +}) { + const help = `Keep this worktree's agent posted on its PR: CI failures, change requests and conflicts interrupt it, routine updates wait for its next turn. Default for all worktrees: ${globalDefault ? 'on' : 'off'}.` + const toggle = (): void => { + const next = !enabled + void client.api.setCiNotifyOverride(worktreePath, next === globalDefault ? null : next) + } + return ( + + + {enabled ? : } + Tell the agent about its PR + + {/* The desktop's hover tooltip, reachable by tap. */} + + + + + ) +} diff --git a/mobile/src/panels/PanelsHost.tsx b/mobile/src/panels/PanelsHost.tsx new file mode 100644 index 00000000..090bad10 --- /dev/null +++ b/mobile/src/panels/PanelsHost.tsx @@ -0,0 +1,161 @@ +// Port of RightColumn.tsx + RightColumnToolbar.tsx as a full-screen sheet +// (the web client's MobileRightPanel shows only four panels; this shows +// the desktop's full column). Order and visibility are the repo's own +// `rightPanelOrder` / `hiddenRightPanels`, edited through `repoConfig:set` +// exactly like the desktop toolbar, so changes made here show up on the +// desktop and vice versa. +import { useCallback, useMemo, useState } from 'react' +import { Linking, Pressable, ScrollView, Switch, Text, View } from 'react-native' +import { ArrowDown, ArrowUp, Settings2, X } from 'lucide-react-native' +import { + effectiveHiddenRightPanels, + effectiveRightPanelOrder, + isCustomToolPanelKey, + toolPanelKey, + type HiddenRightPanels, + type RightPanelKey +} from '../../../src/shared/state/repo-configs' +import type { ToolSpec } from '../../../src/shared/tools' +import type { Worktree } from '../../../src/shared/state/worktrees' +import type { RepoConfig } from '../../../src/shared/state/repo-configs' +import { useNess, type NessClient } from '../ness' +import { c, fs } from '../theme' +import { PANELS, PANEL_LABELS } from './registry' +import { CustomToolPanel } from './CustomToolPanel' +import { useWatchedQuery } from './useWatchedQuery' +import type { PanelProps } from './types' + +export function PanelsHost({ + client, + worktree, + focusedTabId, + onSendToAgent, + onClose +}: { + client: NessClient + worktree: Worktree + focusedTabId: string | null + onSendToAgent: (text: string) => void + onClose: () => void +}) { + const repoRoot = worktree.repoRoot + const repoConfig = useNess(client, (s) => s.repoConfigs.byRepo[repoRoot] ?? null) + const fetchTools = useCallback((path: string) => client.api.listTools(path), [client]) + const { data: toolsData } = useWatchedQuery({ client, worktreePath: worktree.path, cacheKey: 'tools', fetcher: fetchTools }) + const tools = useMemo(() => toolsData ?? [], [toolsData]) + const toolKeys = useMemo(() => tools.map((t) => toolPanelKey(t.id)), [tools]) + const hidden = effectiveHiddenRightPanels(repoConfig) + const order = effectiveRightPanelOrder(repoConfig, toolKeys) + const [customizing, setCustomizing] = useState(false) + + const labelFor = (key: RightPanelKey): string => + isCustomToolPanelKey(key) ? tools.find((t) => toolPanelKey(t.id) === key)?.title ?? key : PANEL_LABELS[key] + + // Same payloads as RightColumn's handlers (legacy fields nulled so old + // values don't leak back through the effective-config migration). + const setHidden = (next: HiddenRightPanels) => + void client.api.setRepoConfig(repoRoot, { hiddenRightPanels: next, hideMergePanel: null, hidePrPanel: null } as unknown as Partial) + const setOrder = (next: RightPanelKey[]) => void client.api.setRepoConfig(repoRoot, { rightPanelOrder: next }) + + const props: PanelProps = { + client, + worktree, + worktreePath: worktree.path, + focusedTabId, + repoConfig, + onSendToAgent, + onOpenUrl: (url) => void Linking.openURL(url), + onClose + } + + return ( + + + + {customizing ? 'PANELS' : 'WORKTREE'} + + setCustomizing((v) => !v)} + accessibilityLabel="Panel visibility" + style={({ pressed }) => ({ width: 44, height: 44, alignItems: 'center', justifyContent: 'center', backgroundColor: pressed || customizing ? c.surface : 'transparent' })} + > + + + + + + + {customizing ? ( + + {order.map((key, i) => ( + + {/* The whole label area toggles, so the target is the full row + height rather than just the switch. */} + setHidden({ ...hidden, [key]: !hidden[key] })} + accessibilityRole="switch" + accessibilityState={{ checked: !hidden[key] }} + accessibilityLabel={`Show ${labelFor(key)}`} + style={({ pressed }) => ({ + flex: 1, + alignSelf: 'stretch', + minHeight: 48, + flexDirection: 'row', + alignItems: 'center', + paddingLeft: 12, + backgroundColor: pressed ? c.panelRaised : 'transparent' + })} + > + + setHidden({ ...hidden, [key]: !on })} + trackColor={{ true: c.accent, false: c.surface }} + thumbColor="#fff" + /> + + {labelFor(key)} + + setOrder(swap(order, i, i - 1))} + accessibilityLabel={`Move ${labelFor(key)} up`} + style={{ width: 44, height: 44, alignItems: 'center', justifyContent: 'center', opacity: i === 0 ? 0.3 : 1 }} + > + + + setOrder(swap(order, i, i + 1))} + accessibilityLabel={`Move ${labelFor(key)} down`} + style={{ width: 44, height: 44, alignItems: 'center', justifyContent: 'center', opacity: i === order.length - 1 ? 0.3 : 1 }} + > + + + + ))} + {/* "Build a custom tool…" opens the new-worktree screen on desktop, + which the app doesn't have yet. */} + + ) : ( + + {order.map((key) => { + if (hidden[key]) return null + if (isCustomToolPanelKey(key)) { + const spec = tools.find((t) => toolPanelKey(t.id) === key) + return spec ? : null + } + const Panel = PANELS[key] + return Panel ? : null + })} + + )} + + ) +} + +function swap(arr: T[], a: number, b: number): T[] { + const next = [...arr] + ;[next[a], next[b]] = [next[b], next[a]] + return next +} diff --git a/mobile/src/panels/RightPanel.tsx b/mobile/src/panels/RightPanel.tsx new file mode 100644 index 00000000..1bee5af7 --- /dev/null +++ b/mobile/src/panels/RightPanel.tsx @@ -0,0 +1,85 @@ +// Port of renderer/components/RightPanel.tsx — the collapsible section +// every right-column panel sits in. Same collapse-key prefix as the web +// (`right-panel-collapsed:`), persisted in AsyncStorage. The header is +// 44pt instead of the desktop's 36px so it's a comfortable tap target. +import { useEffect, useRef, useState, type ReactNode } from 'react' +import { Pressable, Text, View } from 'react-native' +import AsyncStorage from '@react-native-async-storage/async-storage' +import { ChevronRight } from 'lucide-react-native' +import { c, fs } from '../theme' + +const PREFIX = 'right-panel-collapsed:' + +export function RightPanel({ + id, + title, + children, + actions, + defaultCollapsed = false, + onCollapsedChange +}: { + id: string + title: string + children: ReactNode + /** Right side of the header; taps here don't toggle collapse. */ + actions?: ReactNode + defaultCollapsed?: boolean + /** Fires with the resolved initial state, on every toggle, and with + * `true` on unmount (interest-gated panels like Cost rely on that). */ + onCollapsedChange?: (collapsed: boolean) => void +}) { + const [collapsed, setCollapsed] = useState(defaultCollapsed) + const loaded = useRef(false) + const cb = useRef(onCollapsedChange) + cb.current = onCollapsedChange + + useEffect(() => { + void AsyncStorage.getItem(PREFIX + id).then((v) => { + if (v !== null) setCollapsed(v === '1') + loaded.current = true + }) + }, [id]) + useEffect(() => { + if (loaded.current) void AsyncStorage.setItem(PREFIX + id, collapsed ? '1' : '0') + cb.current?.(collapsed) + }, [id, collapsed]) + useEffect(() => () => cb.current?.(true), []) + + return ( + + + setCollapsed((v) => !v)} + // minHeight on the pressable itself (not the bordered row) so the + // target is a full 44pt; the row's bottom border sits below it. + style={({ pressed }) => ({ flex: 1, minHeight: 44, flexDirection: 'row', alignItems: 'center', gap: 6, paddingHorizontal: 12, backgroundColor: pressed ? c.panelRaised : 'transparent' })} + accessibilityRole="button" + accessibilityState={{ expanded: !collapsed }} + > + + + {title} + + + {actions ? {actions} : null} + + {!collapsed && {children}} + + ) +} + +/** Header action button: icon-sized visually, 44x44 touch target. The + * negative horizontal margin keeps neighbouring actions visually tight. */ +export function PanelAction({ onPress, label, children, disabled }: { onPress: () => void; label: string; children: ReactNode; disabled?: boolean }) { + return ( + + {({ pressed }) => {children}} + + ) +} diff --git a/mobile/src/panels/ScratchpadPanel.tsx b/mobile/src/panels/ScratchpadPanel.tsx new file mode 100644 index 00000000..cbafb0d9 --- /dev/null +++ b/mobile/src/panels/ScratchpadPanel.tsx @@ -0,0 +1,96 @@ +// Port of renderer/components/ScratchpadPanel.tsx: local text mirrors the +// scratchpad slice, edits flush to `scratchpad:setText` after 400ms idle, +// on blur, on worktree switch and on unmount. +import { useEffect, useRef, useState } from 'react' +import { TextInput } from 'react-native' +import { useNess } from '../ness' +import { c, fs, getThemeMode } from '../theme' +import { RightPanel } from './RightPanel' +import type { PanelProps } from './types' + +const FLUSH_DEBOUNCE_MS = 400 + +export function ScratchpadPanel({ client, worktreePath }: PanelProps) { + // Same selector as the renderer's useScratchpad(worktreePath). + const sliceText = useNess(client, (s) => (worktreePath ? s.scratchpad.byWorktreePath[worktreePath] ?? '' : '')) + + const [localText, setLocalText] = useState(sliceText) + const lastSyncedPathRef = useRef(worktreePath) + const pendingRef = useRef<{ path: string; text: string } | null>(null) + const timerRef = useRef | null>(null) + const clientRef = useRef(client) + clientRef.current = client + + const flush = (): void => { + if (timerRef.current) { + clearTimeout(timerRef.current) + timerRef.current = null + } + const pending = pendingRef.current + if (!pending) return + pendingRef.current = null + void clientRef.current.api.setScratchpadText(pending.path, pending.text) + } + + // When the active worktree changes, flush the previous worktree's + // pending edit (so we don't lose it) and re-seed local state from + // the slice for the new worktree. + useEffect(() => { + if (lastSyncedPathRef.current !== worktreePath) { + flush() + lastSyncedPathRef.current = worktreePath + setLocalText(sliceText) + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [worktreePath]) + + // If the slice value changes from elsewhere (another client, initial + // hydration completing) AND we have no pending local edit, mirror it. + useEffect(() => { + if (pendingRef.current) return + if (lastSyncedPathRef.current !== worktreePath) return + setLocalText(sliceText) + }, [sliceText, worktreePath]) + + // Flush any pending edit on unmount so a panel close doesn't lose it. + useEffect(() => { + return () => { + flush() + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []) + + const handleChange = (next: string): void => { + setLocalText(next) + if (!worktreePath) return + pendingRef.current = { path: worktreePath, text: next } + if (timerRef.current) clearTimeout(timerRef.current) + timerRef.current = setTimeout(flush, FLUSH_DEBOUNCE_MS) + } + + const disabled = !worktreePath + + return ( + + + + ) +} diff --git a/mobile/src/panels/SubscriptionsPanel.tsx b/mobile/src/panels/SubscriptionsPanel.tsx new file mode 100644 index 00000000..edca6bcc --- /dev/null +++ b/mobile/src/panels/SubscriptionsPanel.tsx @@ -0,0 +1,252 @@ +// Port of renderer/components/SubscriptionsPanel.tsx. Same JSON-string +// selector (stable across token churn), labels, and requests. Hover +// titles become tap-to-expand: a following row reveals its note and what +// its mode does, a held notice reveals its full body, and the "Deliver +// now" mid-turn explanation is shown inline while the button is disabled. +import { useMemo, useState, type ReactNode } from 'react' +import { Pressable, ScrollView, Text, View } from 'react-native' +import { Bell, BellOff, X } from 'lucide-react-native' +import { findTabInWorktree, tabLabel } from '../../../src/shared/agent-tabs' +import { tabSubscriptionsView, type Subscriber } from '../../../src/shared/subscribers' +import { parseAutomatedMessage, type JsonClaudeAutomationSource } from '../../../src/shared/state/json-claude' +import type { AppState } from '../../../src/shared/state' +import { useNess } from '../ness' +import { alpha, c, fs } from '../theme' +import { RightPanel } from './RightPanel' +import type { PanelProps } from './types' + +interface FollowRow { + targetPath: string + name: string + kind: Subscriber['kind'] + reason?: Subscriber['reason'] + mode: Subscriber['mode'] + note?: string +} + +interface FollowerRow { + worktree: string + tab: string + kind: Subscriber['kind'] + reason?: Subscriber['reason'] + mode: Subscriber['mode'] +} + +interface PanelView { + following: FollowRow[] + followers: FollowerRow[] +} + +const SOURCE_LABELS: Partial> = { + 'pr-update': 'PR update', + 'reviewed-pr-update': 'Reviewed PR update', + 'subscription-update': 'Worktree update', + 'progress-report': 'Progress report', + 'worktree-message': 'Message', + review: 'Review' +} + +/** max-h-72 on the desktop's RightPanel. */ +const MAX_H = 288 + +function worktreeName(s: AppState, path: string): string { + return s.aliases.byPath[path] || s.worktrees.list.find((w) => w.path === path)?.branch || path.split('/').pop() || path +} + +function kindLabel(kind: Subscriber['kind'], reason?: Subscriber['reason']): string { + if (reason === 'created-worktree') return 'created it' + if (reason === 'own-worktree') return 'own PR' + return kind === 'explicit' ? 'subscribed' : 'implicit' +} + +/** Copied from the desktop panel: one JSON string so the selector result + * compares by value. Empty when the focused tab isn't a Chat tab. */ +function selectView(s: AppState, worktreePath: string | null, tabId: string | null): string { + if (!worktreePath || !tabId) return '' + if (findTabInWorktree(s, worktreePath, tabId)?.type !== 'json-claude') return '' + const { following, followers } = tabSubscriptionsView(s, worktreePath, tabId) + const view: PanelView = { + following: following.map((f) => ({ + targetPath: f.targetPath, + name: f.reason === 'own-worktree' ? 'This worktree' : worktreeName(s, f.targetPath), + kind: f.kind, + ...(f.reason ? { reason: f.reason } : {}), + mode: f.mode, + ...(f.note ? { note: f.note } : {}) + })), + followers: followers.map((f) => { + const tab = findTabInWorktree(s, f.subscriberPath, f.subscriberTabId) + return { + worktree: worktreeName(s, f.subscriberPath), + tab: tab ? tabLabel(tab) : 'Chat', + kind: f.kind, + ...(f.reason ? { reason: f.reason } : {}), + mode: f.mode + } + }) + } + return JSON.stringify(view) +} + +const small = { fontSize: fs.xs } + +function IconBtn({ onPress, label, children }: { onPress: () => void; label: string; children: ReactNode }) { + return ( + ({ width: 36, minHeight: 44, alignItems: 'center', justifyContent: 'center', borderRadius: 4, backgroundColor: pressed ? c.surface : 'transparent' })} + > + {children} + + ) +} + +export function SubscriptionsPanel({ client, worktreePath, focusedTabId }: PanelProps) { + const json = useNess(client, (s) => selectView(s, worktreePath, focusedTabId)) + const view = useMemo(() => (json ? JSON.parse(json) : null), [json]) + const held = useNess(client, (s) => (focusedTabId ? s.notifications.pendingByTab[focusedTabId] : undefined)) + const busy = useNess(client, (s) => (focusedTabId ? s.jsonClaude.sessions[focusedTabId]?.busy === true : false)) + const [openRow, setOpenRow] = useState(null) + const [openNotice, setOpenNotice] = useState(null) + + if (!view || !worktreePath || !focusedTabId) return null + const heldCount = held?.length ?? 0 + + return ( + {heldCount > 0 ? `${heldCount} held` : `${view.following.length} following`} + } + > + + Following + {view.following.length === 0 ? ( + + Not following anything. Agents follow worktrees they create, or ones they subscribe to. + + ) : ( + view.following.map((f) => { + const open = openRow === f.targetPath + const ownPr = f.reason === 'own-worktree' + return ( + + + setOpenRow(open ? null : f.targetPath)} + style={{ flex: 1, minWidth: 0, minHeight: 44, flexDirection: 'row', alignItems: 'center', gap: 6 }} + > + + {f.name} + + {kindLabel(f.kind, f.reason)} + + {ownPr ? ( + // Own-PR updates are governed by "Tell the agent about + // its PR" (PR panel), not a subscription mode. + + ) : ( + void client.api.setSubscriptionMode(worktreePath, focusedTabId, f.targetPath, f.mode === 'interrupt' ? 'silent' : 'interrupt')} + > + {f.mode === 'interrupt' ? : } + + )} + {f.kind === 'explicit' ? ( + void client.api.unsubscribeTab(worktreePath, focusedTabId, f.targetPath)}> + + + ) : ( + + )} + + {open && ( + + {f.note && Watching for: {f.note}} + {!ownPr && ( + + {f.mode === 'interrupt' + ? 'Interrupts with every update. Tap the bell to hold routine updates for the next turn.' + : 'Routine updates are held for the next turn. Tap the bell to be interrupted by every update.'} + + )} + {f.kind === 'explicit' && Tap × to unsubscribe.} + + )} + + ) + }) + )} + + {view.followers.length > 0 && ( + <> + Followers + {view.followers.map((f, i) => ( + + + {f.worktree} · {f.tab} + + + {kindLabel(f.kind, f.reason)} · {f.mode} + + + ))} + + )} + + {heldCount > 0 && held && ( + <> + + Held + + void client.api.deliverHeldNotices(worktreePath, focusedTabId)} + style={{ minHeight: 44, justifyContent: 'center', paddingHorizontal: 6, opacity: busy ? 0.5 : 1 }} + > + Deliver now + + void client.api.discardHeldNotices(worktreePath, focusedTabId)} + accessibilityHint="Drop these without telling the agent" + style={{ minHeight: 44, justifyContent: 'center', paddingHorizontal: 6 }} + > + Discard + + + {busy && ( + The agent is mid-turn — these go out with its next turn + )} + {held.map((n) => { + const parsed = parseAutomatedMessage(n.wire) + const firstLine = parsed?.body.split('\n')[0] ?? '' + const open = openNotice === n.id + return ( + setOpenNotice(open ? null : n.id)} + style={({ pressed }) => ({ minHeight: 44, justifyContent: 'center', paddingHorizontal: 12, paddingVertical: 4, backgroundColor: pressed ? alpha(c.app, 0.6) : 'transparent' })} + > + + {SOURCE_LABELS[n.source] ?? n.source} + {n.from ? ` · ${n.from}` : ''} + + + {open ? (parsed?.body ?? '') : firstLine} + + + ) + })} + + )} + + + ) +} + +function SectionLabel({ children }: { children: string }) { + return {children} +} diff --git a/mobile/src/panels/TodosPanel.tsx b/mobile/src/panels/TodosPanel.tsx new file mode 100644 index 00000000..866f686c --- /dev/null +++ b/mobile/src/panels/TodosPanel.tsx @@ -0,0 +1,180 @@ +// Port of renderer/components/JsonClaudeTodosPanel.tsx. Same derivations +// (collectTasks / getLatestTodos keyed on useSessionRevision), same badge +// and labels. The desktop's hover titles (owner, blocked-by, description) +// are shown in the row's tap-to-expand detail instead. +import { useMemo, useRef, useState } from 'react' +import { Pressable, ScrollView, Text, View } from 'react-native' +import { Ban, User } from 'lucide-react-native' +import { getLatestTodos } from '../../../src/shared/state/json-claude-todos' +import { collectTasks, countOpenTasks, isTaskBlocked, type TaskRecord } from '../../../src/shared/state/json-claude-tasks' +import { useSessionRevision } from '../../../src/renderer/session-revision' +import { useNess } from '../ness' +import { c, fs } from '../theme' +import { RightPanel } from './RightPanel' +import type { PanelProps } from './types' + +const STATUS_GLYPH: Record = { + pending: '☐', + in_progress: '◐', + completed: '☑' +} + +function statusColor(status: TaskRecord['status']): string { + return status === 'completed' ? c.success : status === 'in_progress' ? c.warning : c.faint +} + +/** max-h-64 on the desktop's RightPanel. */ +const MAX_H = 256 + +function TaskRow({ task, blocked, expanded, onToggle }: { task: TaskRecord; blocked: boolean; expanded: boolean; onToggle: () => void }) { + const label = task.status === 'in_progress' && task.activeForm ? task.activeForm : task.subject + const hasDetail = task.description.length > 0 + // Owner / blocked-by are hover titles on desktop; tapping reveals them. + const tappable = hasDetail || !!task.owner || blocked + const blockedList = task.blockedBy.map((id) => `#${id}`) + return ( + + ({ + minHeight: 44, + paddingHorizontal: 12, + flexDirection: 'row', + alignItems: 'center', + gap: 8, + backgroundColor: pressed && tappable ? c.app : 'transparent' + })} + > + {STATUS_GLYPH[task.status]} + + {label} + + {task.owner && ( + + + + {task.owner} + + + )} + {blocked && ( + + + {blockedList.join(' ')} + + )} + + {expanded && tappable && ( + + {hasDetail && {task.description}} + {task.owner && owned by {task.owner}} + {blocked && blocked by {blockedList.join(', ')}} + + )} + + ) +} + +/** The session's work list: structured Tasks when the session uses them, + * else the flat TodoWrite array. Same `todos` panel id for both. */ +export function TodosPanel({ client, focusedTabId }: PanelProps) { + const session = useNess(client, (s) => s.jsonClaude.sessions[focusedTabId ?? ''] ?? null) + const [expandedId, setExpandedId] = useState(null) + // Keyed on the revision, not the session (identity churns per token). + const sessionRef = useRef(session) + sessionRef.current = session + const revision = useSessionRevision(session) + const tasks = useMemo( + () => collectTasks(sessionRef.current), + // eslint-disable-next-line react-hooks/exhaustive-deps + [revision] + ) + const todos = useMemo( + () => getLatestTodos(sessionRef.current), + // eslint-disable-next-line react-hooks/exhaustive-deps + [revision] + ) + const blockedIds = useMemo(() => { + const byId = new Map(tasks.map((t) => [t.id, t])) + const out = new Set() + for (const t of tasks) if (isTaskBlocked(t, byId)) out.add(t.id) + return out + }, [tasks]) + + if (tasks.length > 0) { + const open = countOpenTasks(tasks) + return ( + + {open}/{tasks.length} + + } + > + + {tasks.map((t) => ( + setExpandedId((cur) => (cur === t.id ? null : t.id))} + /> + ))} + + + ) + } + + if (!todos || todos.length === 0) return null + + const remaining = todos.filter((t) => t.status !== 'completed').length + + return ( + + {remaining}/{todos.length} + + } + > + {/* The desktop's TodoWrite list has no max-height; capped here so a + long list can't take over the sheet. */} + + {todos.map((t, i) => ( + + + {t.status === 'completed' ? '☑' : t.status === 'in_progress' ? '◐' : '☐'} + + + {t.content} + + + ))} + + + ) +} diff --git a/mobile/src/panels/registry.ts b/mobile/src/panels/registry.ts new file mode 100644 index 00000000..29605940 --- /dev/null +++ b/mobile/src/panels/registry.ts @@ -0,0 +1,43 @@ +// Builtin right-column panels by key (BuiltinRightPanelKey). Custom tools +// (`tool:`) are rendered by CustomToolPanel with their spec. +import type { BuiltinRightPanelKey } from '../../../src/shared/state/repo-configs' +import type { PanelComponent } from './types' +import { MergePanel, PRPanel } from './PRPanels' +import { CommitsPanel } from './CommitsPanel' +import { ChangedFilesPanel } from './ChangedFilesPanel' +import { AllFilesPanel } from './AllFilesPanel' +import { TodosPanel } from './TodosPanel' +import { AgentsPanel } from './AgentsPanel' +import { SubscriptionsPanel } from './SubscriptionsPanel' +import { CostPanel } from './CostPanel' +import { ContextPanel } from './ContextPanel' +import { ScratchpadPanel } from './ScratchpadPanel' + +export const PANELS: Record = { + merge: MergePanel, + pr: PRPanel, + commits: CommitsPanel, + changedFiles: ChangedFilesPanel, + allFiles: AllFilesPanel, + todos: TodosPanel, + agents: AgentsPanel, + subscriptions: SubscriptionsPanel, + cost: CostPanel, + context: ContextPanel, + scratchpad: ScratchpadPanel +} + +// Same labels as RightColumnToolbar.tsx's LABELS. +export const PANEL_LABELS: Record = { + merge: 'Merge Locally', + pr: 'PR Status', + commits: 'Branch Commits', + changedFiles: 'Changed Files', + allFiles: 'All Files', + todos: 'Todos', + agents: 'Agents', + subscriptions: 'Subscriptions', + cost: 'Cost', + context: 'Context', + scratchpad: 'Scratchpad' +} diff --git a/mobile/src/panels/types.ts b/mobile/src/panels/types.ts new file mode 100644 index 00000000..e1abf679 --- /dev/null +++ b/mobile/src/panels/types.ts @@ -0,0 +1,29 @@ +// Contract every ported right-column panel implements. Mirrors the props +// RightColumn.tsx hands its panels, minus desktop-only affordances (open a +// diff/file tab, open in editor), which have no phone equivalent yet. +import type { ComponentType } from 'react' +import type { Worktree } from '../../../src/shared/state/worktrees' +import type { RepoConfig } from '../../../src/shared/state/repo-configs' +import type { NessClient } from '../ness' + +export interface PanelProps { + /** Backend that owns `worktreePath`. Every request goes through it. */ + client: NessClient + worktree: Worktree | null + worktreePath: string | null + /** The tab the phone has selected in this worktree (the desktop passes + * the focused pane's tab). Todos/Agents/Context/Subscriptions read the + * json-claude session with this id. */ + focusedTabId: string | null + repoConfig: RepoConfig | null + /** Same routing as the desktop's handleSendToAgent: selected tab if it's + * an agent/chat, else the pane's active one, else the first; switches + * the phone to that tab and closes the panel sheet. */ + onSendToAgent: (text: string) => void + /** Opens a URL in the system browser (PR links, check runs). */ + onOpenUrl: (url: string) => void + /** Close the panel sheet (e.g. after "remove worktree"). */ + onClose: () => void +} + +export type PanelComponent = ComponentType diff --git a/mobile/src/panels/useWatchedQuery.ts b/mobile/src/panels/useWatchedQuery.ts new file mode 100644 index 00000000..1f146799 --- /dev/null +++ b/mobile/src/panels/useWatchedQuery.ts @@ -0,0 +1,108 @@ +// Port of renderer/hooks/useWatchedQuery.ts over a NessClient: stale- +// while-revalidate per (cacheKey, client, worktree), refetch on the +// backend's `worktree:changedFilesInvalidated` signal (after asking it to +// watch via `worktree:watchChangedFiles`), plus a fallback poll. +import { useCallback, useEffect, useRef, useState } from 'react' +import type { NessClient } from '../ness' + +const LIMIT = 100 +const caches = new Map>() +function cache(key: string): Map { + let m = caches.get(key) + if (!m) caches.set(key, (m = new Map())) + return m +} + +export interface WatchedQuery { + data: T | null + loading: boolean + error: string | null + refresh: (opts?: { force?: boolean }) => void +} + +export function useWatchedQuery({ + client, + worktreePath, + cacheKey, + fetcher, + fallbackPollMs = 30000, + revalidateOnFileChange = true, + enabled = true +}: { + client: NessClient + worktreePath: string | null + cacheKey: string + fetcher: (path: string, opts: { force: boolean }) => Promise + fallbackPollMs?: number + revalidateOnFileChange?: boolean + /** False while the panel is collapsed: no fetches, no watch. */ + enabled?: boolean +}): WatchedQuery { + const ck = `${cacheKey}@${client.id}` + const [data, setData] = useState(() => (worktreePath ? ((cache(ck).get(worktreePath) as T) ?? null) : null)) + const [loading, setLoading] = useState(() => !!worktreePath && !cache(ck).has(worktreePath)) + const [error, setError] = useState(null) + const current = useRef(worktreePath) + current.current = worktreePath + const fetchRef = useRef(fetcher) + fetchRef.current = fetcher + + const refresh = useCallback( + (opts: { force?: boolean } = {}) => { + if (!worktreePath) return + const path = worktreePath + fetchRef + .current(path, { force: opts.force ?? false }) + .then((r) => { + const m = cache(ck) + m.delete(path) + m.set(path, r) + while (m.size > LIMIT) m.delete(m.keys().next().value as string) + if (current.current !== path) return + setData(r) + setError(null) + setLoading(false) + }) + .catch((e: unknown) => { + if (current.current !== path) return + setError(e instanceof Error ? e.message : String(e)) + setLoading(false) + }) + }, + [worktreePath, ck] + ) + + // Show cached data for the new path immediately, then revalidate. + useEffect(() => { + if (!worktreePath) { + setData(null) + setLoading(false) + return + } + const hit = cache(ck).get(worktreePath) as T | undefined + setData(hit ?? null) + setLoading(hit === undefined) + if (enabled) refresh() + }, [worktreePath, ck, enabled, refresh]) + + useEffect(() => { + if (!worktreePath || !enabled) return + const interval = fallbackPollMs > 0 ? setInterval(() => refresh(), fallbackPollMs) : null + let off: (() => void) | null = null + if (revalidateOnFileChange) { + client.api.watchChangedFiles(worktreePath) + off = client.transport.onSignal('worktree:changedFilesInvalidated', (path: unknown) => { + if (path === worktreePath) refresh({ force: true }) + }) + } + return () => { + if (interval) clearInterval(interval) + if (off) { + off() + client.api.unwatchChangedFiles(worktreePath) + } + } + }, [client, worktreePath, enabled, fallbackPollMs, revalidateOnFileChange, refresh]) + + return { data, loading, error, refresh } +} diff --git a/mobile/src/shims/lucide-react.js b/mobile/src/shims/lucide-react.js new file mode 100644 index 00000000..7460a3ce --- /dev/null +++ b/mobile/src/shims/lucide-react.js @@ -0,0 +1,45 @@ +// Metro serves this for `lucide-react` when the importer lives in ../src +// (see metro.config.js). lucide-react-native exports the same icon names; +// each is wrapped so the desktop's `className="icon-sm text-danger"` +// becomes size/colour props, and animate-spin/pulse still animate. +const React = require('react') +const L = require('lucide-react-native') +const { tw } = require('../tw') +const { Spin, Pulse } = require('../components/Spin') +const { c } = require('../theme') + +const cache = Object.create(null) + +function wrap(name, Icon) { + function NessIcon({ className, size, color, fill, style, strokeWidth }) { + const t = tw(className) + const fillCurrent = typeof className === 'string' && className.includes('fill-current') + const col = color ?? t.color ?? c.muted + let el = React.createElement(Icon, { + size: size ?? t.size ?? 16, + color: col, + fill: fill ?? (fillCurrent ? col : 'none'), + strokeWidth, + style: t.opacity != null ? [{ opacity: t.opacity }, style] : style + }) + if (t.spin) el = React.createElement(Spin, null, el) + if (t.pulse) el = React.createElement(Pulse, null, el) + return el + } + NessIcon.displayName = name + return NessIcon +} + +module.exports = new Proxy( + {}, + { + get(_t, name) { + if (name === '__esModule') return true + if (typeof name !== 'string') return undefined + if (name in cache) return cache[name] + const Icon = L[name] + cache[name] = Icon ? wrap(name, Icon) : undefined + return cache[name] + } + } +) diff --git a/mobile/src/shims/react-icons-si.js b/mobile/src/shims/react-icons-si.js new file mode 100644 index 00000000..09243b49 --- /dev/null +++ b/mobile/src/shims/react-icons-si.js @@ -0,0 +1,22 @@ +// Stand-in for `react-icons/si` (web-only brand SVGs) when imported from +// ../src. Every brand icon becomes lucide's Plug in the brand colour the +// desktop passes — recognisable enough in a tool chip until real RN brand +// marks are worth bundling. +const React = require('react') +const { Plug } = require('lucide-react-native') +const { tw } = require('../tw') + +function Brand({ className, color }) { + const t = tw(className) + return React.createElement(Plug, { size: t.size ?? 16, color: color ?? t.color ?? '#a3a3a3' }) +} + +module.exports = new Proxy( + {}, + { + get(_t, name) { + if (name === '__esModule') return true + return typeof name === 'string' ? Brand : undefined + } + } +) diff --git a/mobile/src/storage.ts b/mobile/src/storage.ts new file mode 100644 index 00000000..f0d6d523 --- /dev/null +++ b/mobile/src/storage.ts @@ -0,0 +1,69 @@ +// Persisted backend list. expo-secure-store is iOS/Android only, so Expo +// web (used to drive the spike from a desktop browser) falls back to +// localStorage — fine for a demo, not for a real token. The whole list +// is one entry; at ~150 bytes per backend that stays well under the +// ~2KB value size some older iOS keychains reject. +import { Platform } from 'react-native' +import * as SecureStore from 'expo-secure-store' + +const KEY = 'ness.backends' +const LEGACY_KEY = 'ness.connection' + +export interface SavedBackend { + id: string + label: string + wsUrl: string + token: string + enabled: boolean +} + +async function read(key: string): Promise { + if (Platform.OS === 'web') return globalThis.localStorage?.getItem(key) ?? null + return SecureStore.getItemAsync(key) +} + +async function write(key: string, value: string | null): Promise { + if (Platform.OS === 'web') { + if (value === null) globalThis.localStorage?.removeItem(key) + else globalThis.localStorage?.setItem(key, value) + return + } + if (value === null) await SecureStore.deleteItemAsync(key) + else await SecureStore.setItemAsync(key, value) +} + +export async function loadBackends(): Promise { + const raw = await read(KEY) + if (raw) { + try { + return JSON.parse(raw) as SavedBackend[] + } catch { + return [] + } + } + // First spike build stored a single connection. + const legacy = await read(LEGACY_KEY) + if (!legacy) return [] + try { + const { wsUrl, token } = JSON.parse(legacy) as { wsUrl: string; token: string } + const migrated = [{ id: newId(), label: labelFor(wsUrl), wsUrl, token, enabled: true }] + await saveBackends(migrated) + await write(LEGACY_KEY, null) + return migrated + } catch { + return [] + } +} + +export async function saveBackends(list: SavedBackend[]): Promise { + await write(KEY, JSON.stringify(list)) +} + +export function newId(): string { + return Math.random().toString(36).slice(2, 10) + Date.now().toString(36) +} + +export function labelFor(wsUrl: string): string { + const host = wsUrl.replace(/^wss?:\/\//, '').split('/')[0] + return host || 'Backend' +} diff --git a/mobile/src/tabs.ts b/mobile/src/tabs.ts new file mode 100644 index 00000000..0cbf933e --- /dev/null +++ b/mobile/src/tabs.ts @@ -0,0 +1,18 @@ +// Tab choices the phone makes on its own, kept out of App.tsx so the +// contract test (test/contract.test.ts) runs the same code against a real +// server. +import { randomUUID } from '../../src/renderer/uuid' +import type { PaneNode, TerminalTab } from '../../src/shared/state/terminals' + +export { pickInitialTab } from '../../src/renderer/pick-initial-tab' + +/** A new Chat tab: one UUID as both tab id and session id, same as + * useTabHandlers. */ +export function newChatTab(): TerminalTab { + const sessionId = randomUUID() + return { id: sessionId, type: 'json-claude', label: 'Chat', sessionId } +} + +export function firstLeafId(tree: PaneNode): string { + return tree.type === 'leaf' ? tree.id : firstLeafId(tree.children[0]) +} diff --git a/mobile/src/theme.ts b/mobile/src/theme.ts new file mode 100644 index 00000000..1f69e408 --- /dev/null +++ b/mobile/src/theme.ts @@ -0,0 +1,153 @@ +// The active colour palette — Ness's `--color-*` tokens as a plain object. +// +// Theming model: `c` is ONE mutable object that every component reads at +// render time. applyTheme() swaps its values in place (palettes generated +// from the desktop's styles.css, custom themes from settings, the brand ramp +// from the Nessie colour) and bumps `themeVersion`; App remounts the UI +// subtree on that version so everything re-renders with the new values, +// while the backend connections (above the remount) stay up. +// +// Module-level styles must go through themed() rather than +// StyleSheet.create, so they're rebuilt lazily for the current palette +// instead of being frozen at import time. +import { Platform } from 'react-native' +import type { PtyStatus } from '../../src/shared/state/terminals' +import type { CustomTheme } from '../../src/shared/state/settings' +import { DEFAULT_DARK_THEME, DEFAULT_LIGHT_THEME, nessieColorById } from '../../src/shared/state/settings' +import { THEME_OPTIONS } from '../../src/renderer/themes' +import { customThemeBase, SEMANTIC_KEYS } from '../../src/renderer/theme-apply' +import { BUILT_IN_PALETTES } from './themes.generated' + +export interface Palette { + app: string + panel: string + panelRaised: string + surface: string + surfaceHover: string + well: string + border: string + borderStrong: string + fg: string + fgBright: string + muted: string + dim: string + faint: string + success: string + warning: string + danger: string + info: string + accent: string + brand: string + brandMid: string + brandDeep: string +} + +export const c: Palette = { ...(BUILT_IN_PALETTES.dark as unknown as Palette) } +let themeMode: 'light' | 'dark' = 'dark' +/** Resolved mode of the active theme (status bar, keyboard appearance). */ +export const getThemeMode = (): 'light' | 'dark' => themeMode +let version = 0 +export const themeVersion = (): number => version + +const camel = (k: string) => k.replace(/-([a-z])/g, (_, ch: string) => ch.toUpperCase()) + +export interface ThemeInputs { + themeMode: 'light' | 'dark' | 'system' | string + themeLight: string + themeDark: string + customThemes: CustomTheme[] + nessieColor: string + systemScheme: 'light' | 'dark' | null | undefined +} + +/** Which theme applies — copy of renderer/hooks/useActiveTheme's + * resolveTheme (that module imports the renderer store). A theme id that + * doesn't exist for the resolved mode falls back to that mode's default. */ +function resolve(inputs: ThemeInputs): { id: string; mode: 'light' | 'dark'; custom?: CustomTheme } { + const mode: 'light' | 'dark' = + inputs.themeMode === 'light' || inputs.themeMode === 'dark' + ? inputs.themeMode + : inputs.systemScheme === 'light' + ? 'light' + : 'dark' + const id = mode === 'light' ? inputs.themeLight : inputs.themeDark + const builtIn = THEME_OPTIONS.find((t) => t.id === id) + if (builtIn && builtIn.mode === mode) return { id, mode } + const custom = inputs.customThemes.find((t) => t.id === id) + if (custom && custom.mode === mode) return { id, mode, custom } + return { id: mode === 'dark' ? DEFAULT_DARK_THEME : DEFAULT_LIGHT_THEME, mode } +} + +/** Key for "did the effective theme change" (drives the UI remount). */ +export function themeKey(inputs: ThemeInputs): string { + const r = resolve(inputs) + return `${r.id}:${r.mode}:${inputs.nessieColor}:${r.custom ? JSON.stringify(r.custom.colors) : ''}` +} + +/** Same layering as renderer/theme-apply.ts applyTheme: base palette (the + * custom theme's base for customs), the Nessie brand ramp (a rung darker + * on light themes), then a custom theme's own semantic keys on top. */ +export function applyTheme(inputs: ThemeInputs): void { + const r = resolve(inputs) + const baseId = r.custom ? customThemeBase(r.custom) : r.id + const next = { ...(BUILT_IN_PALETTES.dark as unknown as Palette), ...((BUILT_IN_PALETTES[baseId] ?? {}) as unknown as Palette) } + const nessie = nessieColorById(inputs.nessieColor) + const light = r.mode === 'light' + next.brand = light ? nessie.deep : nessie.brand + next.brandMid = light ? nessie.deep : nessie.mid + next.brandDeep = nessie.deep + if (r.custom) { + for (const [k, v] of Object.entries(r.custom.colors)) { + if (SEMANTIC_KEYS.has(k)) (next as unknown as Record)[camel(k)] = v + } + } + Object.assign(c, next) + themeMode = r.mode + version++ +} + +/** Module-level styles that follow the theme: rebuilt for the current + * palette on first access after a theme change. Use instead of + * StyleSheet.create wherever the styles reference `c`. */ +export function themed(make: () => T): T { + let built = -1 + let cache = {} as T + return new Proxy({} as T, { + get(_t, key) { + if (built !== version) { + cache = make() + built = version + } + return (cache as Record)[key] + } + }) +} + +/** Tailwind's `color/NN` opacity modifier, for hex tokens. */ +export function alpha(hex: string, a: number): string { + if (!hex.startsWith('#')) return hex + const full = hex.length === 4 ? `#${hex[1]}${hex[1]}${hex[2]}${hex[2]}${hex[3]}${hex[3]}` : hex + const n = parseInt(full.slice(1, 7), 16) + return `rgba(${(n >> 16) & 255}, ${(n >> 8) & 255}, ${n & 255}, ${a})` +} + +export const mono = Platform.select({ ios: 'Menlo', android: 'monospace', default: 'ui-monospace, "SF Mono", Menlo, monospace' }) + +// text-xs / text-sm (the web client's chrome + chat body sizes). +export const fs = { xs: 12, sm: 14, base: 16, lg: 18 } + +/** Same mapping as MobileApp.tsx's STATUS_DOT — read live from the palette. */ +export const STATUS_DOT: Record = { + get idle() { + return c.faint + }, + get processing() { + return c.success + }, + get waiting() { + return c.warning + }, + get 'needs-approval'() { + return c.danger + } +} diff --git a/mobile/src/themes.generated.ts b/mobile/src/themes.generated.ts new file mode 100644 index 00000000..9cd02cd3 --- /dev/null +++ b/mobile/src/themes.generated.ts @@ -0,0 +1,349 @@ +// GENERATED by scripts/gen-themes.mjs from src/renderer/styles.css — do not +// edit; regenerate when the desktop's themes change. +export const BUILT_IN_PALETTES: Record> = { + "dark": { + "app": "#0a0a0a", + "panel": "#141414", + "panelRaised": "#1f1f1f", + "surface": "#262626", + "surfaceHover": "#404040", + "well": "#0a0a0a", + "border": "#262626", + "borderStrong": "#404040", + "fg": "#d4d4d4", + "fgBright": "#f5f5f5", + "muted": "#a3a3a3", + "dim": "#737373", + "faint": "#525252", + "success": "#22c55e", + "warning": "#fbbf24", + "danger": "#ef4444", + "info": "#60a5fa", + "accent": "#c084fc", + "brand": "#4ade80", + "brandMid": "#22c55e", + "brandDeep": "#16a34a" + }, + "solarized-dark": { + "app": "#002b36", + "panel": "#053340", + "panelRaised": "#073642", + "surface": "#0d4a5a", + "surfaceHover": "#114d5d", + "well": "#002b36", + "border": "#0d4452", + "borderStrong": "#586e75", + "fg": "#93a1a1", + "fgBright": "#eee8d5", + "muted": "#839496", + "dim": "#657b83", + "faint": "#586e75", + "success": "#859900", + "warning": "#b58900", + "danger": "#dc322f", + "info": "#268bd2", + "accent": "#6c71c4", + "brand": "#4ade80", + "brandMid": "#22c55e", + "brandDeep": "#16a34a" + }, + "light": { + "app": "#ffffff", + "panel": "#f4f4f4", + "panelRaised": "#efefef", + "surface": "#dbdbdb", + "surfaceHover": "#bababa", + "well": "#ffffff", + "border": "#dbdbdb", + "borderStrong": "#bababa", + "fg": "#262626", + "fgBright": "#0a0a0a", + "muted": "#4e4e4e", + "dim": "#5c5c5c", + "faint": "#6f6f6f", + "success": "#149343", + "warning": "#b45309", + "danger": "#dc2626", + "info": "#2563eb", + "accent": "#9333ea", + "brand": "#4ade80", + "brandMid": "#22c55e", + "brandDeep": "#16a34a" + }, + "solarized-light": { + "app": "#fdf6e3", + "panel": "#f2ebd6", + "panelRaised": "#eae3cd", + "surface": "#d8d1b9", + "surfaceHover": "#beb59d", + "well": "#fdf6e3", + "border": "#d8d1ba", + "borderStrong": "#aca48e", + "fg": "#2f3b40", + "fgBright": "#002b36", + "muted": "#3c4a4f", + "dim": "#48585e", + "faint": "#616a6a", + "success": "#718200", + "warning": "#9a7400", + "danger": "#dc322f", + "info": "#237fc0", + "accent": "#6c71c4", + "brand": "#4ade80", + "brandMid": "#22c55e", + "brandDeep": "#16a34a" + }, + "catppuccin-latte": { + "app": "#eff1f5", + "panel": "#e6e8ee", + "panelRaised": "#e0e3e9", + "surface": "#d2d6de", + "surfaceHover": "#b6bac3", + "well": "#eff1f5", + "border": "#c9cdd5", + "borderStrong": "#a2a5af", + "fg": "#393b50", + "fgBright": "#232634", + "muted": "#474a5c", + "dim": "#55586c", + "faint": "#696b7d", + "success": "#368825", + "warning": "#cc5009", + "danger": "#d20f39", + "info": "#1e66f5", + "accent": "#8839ef", + "brand": "#4ade80", + "brandMid": "#22c55e", + "brandDeep": "#16a34a" + }, + "gruvbox-light": { + "app": "#fbf1c7", + "panel": "#f1e6bd", + "panelRaised": "#ecdfb7", + "surface": "#e3d3ac", + "surfaceHover": "#c7b791", + "well": "#fbf1c7", + "border": "#dacca4", + "borderStrong": "#a3967e", + "fg": "#3c3836", + "fgBright": "#282828", + "muted": "#4f4844", + "dim": "#60564f", + "faint": "#75685e", + "success": "#79740e", + "warning": "#a36a12", + "danger": "#9d0006", + "info": "#076678", + "accent": "#8f3f71", + "brand": "#4ade80", + "brandMid": "#22c55e", + "brandDeep": "#16a34a" + }, + "tokyo-night-day": { + "app": "#e1e2e7", + "panel": "#d6d8e0", + "panelRaised": "#cbd0dd", + "surface": "#c2c6d4", + "surfaceHover": "#a6aabc", + "well": "#e1e2e7", + "border": "#bcbfcc", + "borderStrong": "#9096af", + "fg": "#1a2f65", + "fgBright": "#1c2b5a", + "muted": "#333e6d", + "dim": "#444c78", + "faint": "#585f83", + "success": "#587539", + "warning": "#87683c", + "danger": "#c04141", + "info": "#286cca", + "accent": "#894cd9", + "brand": "#4ade80", + "brandMid": "#22c55e", + "brandDeep": "#16a34a" + }, + "one-light": { + "app": "#fafafa", + "panel": "#ececed", + "panelRaised": "#e4e4e5", + "surface": "#ddddde", + "surfaceHover": "#c1c1c2", + "well": "#fafafa", + "border": "#d2d2d3", + "borderStrong": "#a9a9ac", + "fg": "#383a42", + "fgBright": "#202227", + "muted": "#4c4f59", + "dim": "#5a5d67", + "faint": "#6e7078", + "success": "#448943", + "warning": "#a47001", + "danger": "#d24f43", + "info": "#3e74eb", + "accent": "#a626a4", + "brand": "#4ade80", + "brandMid": "#22c55e", + "brandDeep": "#16a34a" + }, + "dracula": { + "app": "#282a36", + "panel": "#2f3142", + "panelRaised": "#21222c", + "surface": "#44475a", + "surfaceHover": "#565970", + "well": "#282a36", + "border": "#191a21", + "borderStrong": "#44475a", + "fg": "#f8f8f2", + "fgBright": "#ffffff", + "muted": "#bfbfbf", + "dim": "#6272a4", + "faint": "#4a5075", + "success": "#50fa7b", + "warning": "#f1fa8c", + "danger": "#ff5555", + "info": "#8be9fd", + "accent": "#bd93f9", + "brand": "#4ade80", + "brandMid": "#22c55e", + "brandDeep": "#16a34a" + }, + "nord": { + "app": "#2e3440", + "panel": "#353b49", + "panelRaised": "#3b4252", + "surface": "#434c5e", + "surfaceHover": "#4c566a", + "well": "#2e3440", + "border": "#3b4252", + "borderStrong": "#4c566a", + "fg": "#d8dee9", + "fgBright": "#eceff4", + "muted": "#a3adc2", + "dim": "#6b7590", + "faint": "#4c566a", + "success": "#a3be8c", + "warning": "#ebcb8b", + "danger": "#bf616a", + "info": "#88c0d0", + "accent": "#b48ead", + "brand": "#4ade80", + "brandMid": "#22c55e", + "brandDeep": "#16a34a" + }, + "gruvbox-dark": { + "app": "#282828", + "panel": "#2e2d2c", + "panelRaised": "#32302f", + "surface": "#3c3836", + "surfaceHover": "#504945", + "well": "#282828", + "border": "#3c3836", + "borderStrong": "#504945", + "fg": "#ebdbb2", + "fgBright": "#fbf1c7", + "muted": "#bdae93", + "dim": "#928374", + "faint": "#665c54", + "success": "#b8bb26", + "warning": "#fabd2f", + "danger": "#fb4934", + "info": "#83a598", + "accent": "#d3869b", + "brand": "#4ade80", + "brandMid": "#22c55e", + "brandDeep": "#16a34a" + }, + "tokyo-night": { + "app": "#1a1b26", + "panel": "#1f2030", + "panelRaised": "#16161e", + "surface": "#292e42", + "surfaceHover": "#3b4261", + "well": "#1a1b26", + "border": "#292e42", + "borderStrong": "#414868", + "fg": "#c0caf5", + "fgBright": "#ffffff", + "muted": "#a9b1d6", + "dim": "#565f89", + "faint": "#3b4261", + "success": "#9ece6a", + "warning": "#e0af68", + "danger": "#f7768e", + "info": "#7aa2f7", + "accent": "#bb9af7", + "brand": "#4ade80", + "brandMid": "#22c55e", + "brandDeep": "#16a34a" + }, + "catppuccin-mocha": { + "app": "#1e1e2e", + "panel": "#24243a", + "panelRaised": "#181825", + "surface": "#313244", + "surfaceHover": "#45475a", + "well": "#1e1e2e", + "border": "#313244", + "borderStrong": "#45475a", + "fg": "#cdd6f4", + "fgBright": "#ffffff", + "muted": "#bac2de", + "dim": "#7f849c", + "faint": "#585b70", + "success": "#a6e3a1", + "warning": "#f9e2af", + "danger": "#f38ba8", + "info": "#89b4fa", + "accent": "#cba6f7", + "brand": "#4ade80", + "brandMid": "#22c55e", + "brandDeep": "#16a34a" + }, + "one-dark": { + "app": "#282c34", + "panel": "#2d323c", + "panelRaised": "#21252b", + "surface": "#2c313a", + "surfaceHover": "#3e4451", + "well": "#282c34", + "border": "#21252b", + "borderStrong": "#3e4451", + "fg": "#abb2bf", + "fgBright": "#d7dae0", + "muted": "#9da5b4", + "dim": "#5c6370", + "faint": "#4b5263", + "success": "#98c379", + "warning": "#e5c07b", + "danger": "#e06c75", + "info": "#61afef", + "accent": "#c678dd", + "brand": "#4ade80", + "brandMid": "#22c55e", + "brandDeep": "#16a34a" + }, + "cyberfunk": { + "app": "#000000", + "panel": "#0a0014", + "panelRaised": "#14001f", + "surface": "#1f0033", + "surfaceHover": "#33005c", + "well": "#000000", + "border": "#ff00ff", + "borderStrong": "#ff66ff", + "fg": "#ffffff", + "fgBright": "#ffffff", + "muted": "#ff99ff", + "dim": "#cc66cc", + "faint": "#663366", + "success": "#00ff9d", + "warning": "#ffee00", + "danger": "#ff1a8c", + "info": "#00ffff", + "accent": "#ff6600", + "brand": "#4ade80", + "brandMid": "#22c55e", + "brandDeep": "#16a34a" + } +} diff --git a/mobile/src/tw.ts b/mobile/src/tw.ts new file mode 100644 index 00000000..b154f589 --- /dev/null +++ b/mobile/src/tw.ts @@ -0,0 +1,83 @@ +// Tiny Tailwind-class → RN-style translator for the handful of classes the +// desktop's icon components receive (`icon-sm text-danger animate-pulse`). +// Lets renderer modules that hand out icon components (tool-display's +// registry, row-style helpers) be reused unchanged: the className they +// pass still means the same size and colour here. +import { alpha, c, themed, themeVersion } from './theme' + +const ICON: Record = { + 'icon-2xs': 10, + 'icon-xs': 12, + 'icon-sm': 14, + 'icon-base': 16, + 'icon-lg': 20, + 'icon-xl': 32 +} + +const TOKENS: Record = themed(() => ({ + fg: c.fg, + 'fg-bright': c.fgBright, + muted: c.muted, + dim: c.dim, + faint: c.faint, + success: c.success, + warning: c.warning, + danger: c.danger, + info: c.info, + accent: c.accent, + white: '#ffffff', + // RepoIcon / repo label palette (Tailwind v4 *-400) + 'teal-400': '#2dd4bf', + 'cyan-400': '#22d3ee', + 'sky-400': '#38bdf8', + 'blue-400': '#60a5fa', + 'indigo-400': '#818cf8', + 'violet-400': '#a78bfa', + 'purple-400': '#c084fc', + 'fuchsia-400': '#e879f9', + 'pink-400': '#f472b6', + 'slate-400': '#94a3b8' +})) + +/** Resolve `text-accent`, `bg-teal-400/60`, `text-danger/80` → a colour. */ +export function tokenColor(cls: string, prefix: 'text' | 'bg'): string | undefined { + const m = new RegExp(`^${prefix}-([a-z0-9-]+?)(?:/(\\d+))?$`).exec(cls) + if (!m || TOKENS[m[1]] === undefined) return undefined + const hex = TOKENS[m[1]] + return m[2] ? alpha(hex, Number(m[2]) / 100) : hex +} + +export interface TwResult { + size?: number + color?: string + opacity?: number + spin: boolean + pulse: boolean +} + +// Keyed per theme: the colours resolve against the active palette. +const cache = new Map() +let cacheVersion = -1 + +export function tw(className: string | undefined): TwResult { + if (cacheVersion !== themeVersion()) { + cache.clear() + cacheVersion = themeVersion() + } + const key = className ?? '' + const hit = cache.get(key) + if (hit) return hit + const out: TwResult = { spin: false, pulse: false } + for (const cls of key.split(/\s+/)) { + if (cls in ICON) out.size = ICON[cls] + else if (cls === 'animate-spin') out.spin = true + else if (cls === 'animate-pulse') out.pulse = true + else if (cls.startsWith('opacity-')) out.opacity = Number(cls.slice(8)) / 100 + else { + const col = tokenColor(cls, 'text') + if (col) out.color = col + } + } + cache.set(key, out) + return out +} diff --git a/mobile/test/contract.test.ts b/mobile/test/contract.test.ts new file mode 100644 index 00000000..0dd367a9 --- /dev/null +++ b/mobile/test/contract.test.ts @@ -0,0 +1,223 @@ +// The mobile client against a real headless server. This is the guard +// for "a server or desktop change that didn't consider the phone": it +// drives the app's own NessClient (WebSocket transport + shared reducer +// mirror + the desktop's typed buildBackend API), Fleet and list model — +// the same code paths the screens use — and checks what they produce. +// +// Needs the headless build: `npm run build:headless` at the repo root, +// then `npm run test:mobile:contract`. CI runs it after the headless smoke. +// +// Not covered: anything that needs a real Claude (starting a chat, +// streaming, approvals) — CI has no Claude auth. +import { afterAll, beforeAll, describe, expect, it } from 'vitest' +import { spawn, execFileSync, type ChildProcess } from 'node:child_process' +import { existsSync, mkdirSync, mkdtempSync, realpathSync, rmSync, writeFileSync } from 'node:fs' +import { tmpdir } from 'node:os' +import { join, resolve } from 'node:path' +import { NessClient, chatTabsOf, tabsOf } from '../src/ness' +import { Fleet, listModelFor, mergedFor } from '../src/fleet' +import { newChatTab, firstLeafId, pickInitialTab } from '../src/tabs' +import { applyTheme, c, type ThemeInputs } from '../src/theme' +import type { AppState } from '../../src/shared/state' +import type { WorktreeListModel, WorktreeRowModel } from '../../src/renderer/worktree-list-model' +import WS from 'ws' + +// Node < 22 has no global WebSocket (React Native does). +globalThis.WebSocket ??= WS as unknown as typeof WebSocket + +const SERVER = resolve(__dirname, '../../dist-headless/main/index.js') +const TOKEN = 'mobile-contract-token' + +let tmp: string +let repo: string +let server: ChildProcess | undefined +let serverLog = '' +let client: NessClient +let fleet: Fleet + +function git(cwd: string, ...args: string[]): string { + return execFileSync('git', args, { cwd, encoding: 'utf8' }).trim() +} + +/** Resolve once `pred` holds for the client's state (checked on every + * state change), or fail with the server log after `ms`. */ +function until(pred: (s: AppState) => T | undefined | false | null, what: string, ms = 15_000): Promise { + return new Promise((ok, fail) => { + const check = (): boolean => { + const v = pred(client.getState()) + if (v) { + unsub() + clearTimeout(timer) + ok(v) + return true + } + return false + } + const unsub = client.subscribe(() => void check()) + const timer = setTimeout(() => { + unsub() + fail(new Error(`timed out waiting for ${what}\n--- server log ---\n${serverLog.slice(-4000)}`)) + }, ms) + check() + }) +} + +const NO_COLLAPSE = { unifiedRepos: false, isGroupCollapsed: () => false, pinnedOpenRepos: {} } +const model = (): WorktreeListModel => { + const entries = fleet.getEntries() + return listModelFor(entries, mergedFor(entries), NO_COLLAPSE, null) +} +function rows(m: WorktreeListModel): WorktreeRowModel[] { + const out: WorktreeRowModel[] = [] + const walk = (v: unknown): void => { + if (!v || typeof v !== 'object') return + if (Array.isArray(v)) return v.forEach(walk) + const o = v as Record + if (typeof o.path === 'string' && o.worktree && typeof o.worktree === 'object') out.push(o as unknown as WorktreeRowModel) + else Object.values(o).forEach(walk) + } + walk(m) + return out +} +const rowFor = (path: string): WorktreeRowModel | undefined => rows(model()).find((r) => r.path === path) + +beforeAll(async () => { + if (!existsSync(SERVER)) throw new Error(`${SERVER} missing — run \`npm run build:headless\` at the repo root first`) + tmp = realpathSync(mkdtempSync(join(tmpdir(), 'ness-mobile-contract-'))) + repo = join(tmp, 'demo') + mkdirSync(repo) + git(repo, 'init', '-q', '-b', 'main') + git(repo, 'config', 'user.email', 'contract@example.invalid') + git(repo, 'config', 'user.name', 'Contract') + writeFileSync(join(repo, 'README.md'), '# demo\n') + git(repo, 'add', '.') + git(repo, 'commit', '-q', '-m', 'init') + + mkdirSync(join(tmp, 'home')) + server = spawn(process.execPath, [SERVER, '--host', '127.0.0.1', '--port', '0'], { + // A throwaway HOME and data dir: the server never sees the developer's + // real config, tokens or ~/.claude. + env: { ...process.env, HOME: join(tmp, 'home'), HARNESS_DATA_DIR: join(tmp, 'data'), HARNESS_AUTH_TOKEN: TOKEN, GITHUB_TOKEN: '' }, + stdio: ['ignore', 'pipe', 'pipe'] + }) + const port = await new Promise((ok, fail) => { + const timer = setTimeout(() => fail(new Error(`server didn't start\n${serverLog}`)), 30_000) + const onData = (b: Buffer): void => { + serverLog += b.toString() + const m = /listening on ws:\/\/[^\s:]+:(\d+)/.exec(serverLog) + if (m) { + clearTimeout(timer) + ok(Number(m[1])) + } + } + server!.stdout!.on('data', onData) + server!.stderr!.on('data', onData) + server!.on('exit', (code) => fail(new Error(`server exited (${code})\n${serverLog}`))) + }) + + client = new NessClient('contract', 'Contract', `ws://127.0.0.1:${port}/`, TOKEN) + fleet = new Fleet() + fleet.setClients([client]) + client.connect() +}) + +afterAll(async () => { + client?.close() + if (server && server.exitCode === null) { + const exited = new Promise((ok) => server!.once('exit', ok)) + server.kill('SIGTERM') + await Promise.race([exited, new Promise((ok) => setTimeout(ok, 5000))]) + } + if (tmp) rmSync(tmp, { recursive: true, force: true, maxRetries: 3 }) +}) + +describe('mobile client ↔ headless server', () => { + it('connects and mirrors the snapshot', async () => { + await until((s) => client.getConn().hasSnapshot && s, 'snapshot') + expect(client.getConn().connected).toBe(true) + expect(fleet.getEntries()).toHaveLength(1) + }) + + it("themes from the server's settings", () => { + const st = client.getState().settings + const inputs: ThemeInputs = { + themeMode: st.themeMode, + themeLight: st.themeLight, + themeDark: st.themeDark, + customThemes: st.customThemes, + nessieColor: st.nessieColor, + systemScheme: 'dark' + } + applyTheme(inputs) + expect(c.app).toMatch(/^#|^rgb/) + expect(c.brand).toMatch(/^#|^rgb/) + }) + + it('lists a repo added on the server in the worktree picker', async () => { + const res = await client.api.addRepoAtPath(repo) + expect(res).toBeTruthy() + await until(() => rowFor(repo), 'main worktree row') + const row = rowFor(repo)! + expect(row.worktree.isMain).toBe(true) + expect(row.worktree.branch).toBe('main') + }) + + it('shows aliases, pins and snoozes set through the API', async () => { + await client.api.setAlias(repo, 'Contract Alias') + await until(() => rowFor(repo)?.alias === 'Contract Alias', 'alias on the row') + + await client.api.pinWorktree(repo) + await until(() => rowFor(repo)?.isPinned, 'pinned row') + await client.api.unpinWorktree(repo) + await until(() => rowFor(repo) && !rowFor(repo)!.isPinned, 'unpinned row') + + await client.api.clearAlias(repo) + await until(() => rowFor(repo) && !rowFor(repo)!.alias, 'alias cleared') + }) + + it('picks up a worktree created outside Ness and removes it', async () => { + const wt = join(tmp, 'demo-feature') + git(repo, 'worktree', 'add', '-q', '-b', 'feature/contract', wt) + await client.api.refreshWorktreesList() + await until(() => rowFor(wt), 'new worktree row') + expect(rowFor(wt)!.worktree.branch).toBe('feature/contract') + + await client.api.snooze(wt, Date.now() + 86_400_000) + await until(() => rowFor(wt)?.isSnoozed, 'snoozed row') + await client.api.unsnooze(wt) + await until(() => rowFor(wt) && !rowFor(wt)!.isSnoozed, 'woken row') + + await client.api.removeWorktree(repo, wt) + await until(() => !rowFor(wt) && !existsSync(wt), 'worktree removed', 30_000) + }) + + it('initialises panes the phone can open, and adds a Chat tab', async () => { + await client.api.panesEnsureInitialized(repo) + const tree = await until((s) => s.terminals.panes[repo], 'pane tree') + const tabs = tabsOf(tree) + expect(tabs.length).toBeGreaterThan(0) + // The server's default set (agent + Shell) must open on the agent, + // not the shell, whatever order the tabs come in. + const initial = tabs.find((t) => t.id === pickInitialTab(tabs)) + expect(initial?.type === 'json-claude' || initial?.type === 'agent').toBe(true) + + const tab = newChatTab() + await client.api.panesAddTab(repo, tab, firstLeafId(tree)) + await until((s) => chatTabsOf(s, repo).some((t) => t.id === tab.id && t.sessionId === tab.sessionId), 'chat tab') + // A never-started session has no transcript; the chat view relies on + // an empty list here, not an error. + expect(await client.api.getJsonClaudeEntries(tab.sessionId!)).toEqual([]) + }) + + it('serves the tools panel data', async () => { + writeFileSync(join(repo, 'NEW.md'), 'hi\n') + const changed = await client.api.getChangedFiles(repo, 'working') + expect(changed.map((f) => f.path)).toContain('NEW.md') + expect(await client.api.listAllFiles(repo)).toContain('README.md') + expect(Array.isArray(await client.api.getBranchCommits(repo))).toBe(true) + expect(Array.isArray(await client.api.listTools(repo))).toBe(true) + + await client.api.setScratchpadText(repo, 'note from the phone') + await until((s) => s.scratchpad.byWorktreePath[repo] === 'note from the phone', 'scratchpad text') + }) +}) diff --git a/mobile/test/stubs/react-native.ts b/mobile/test/stubs/react-native.ts new file mode 100644 index 00000000..1f81dd68 --- /dev/null +++ b/mobile/test/stubs/react-native.ts @@ -0,0 +1,4 @@ +export const Platform = { + OS: 'ios' as const, + select: (o: { ios?: T; default?: T }): T | undefined => o.ios ?? o.default +} diff --git a/mobile/test/theme.test.ts b/mobile/test/theme.test.ts new file mode 100644 index 00000000..7d417c89 --- /dev/null +++ b/mobile/test/theme.test.ts @@ -0,0 +1,101 @@ +// The phone's theming must track the desktop's: a theme added or retuned in +// styles.css, or a change to how custom themes / the Nessie colour layer, +// shows up here before it ships as a phone that's the wrong colour. +import { describe, expect, it } from 'vitest' +import { readFileSync } from 'node:fs' +import { THEME_OPTIONS } from '../../src/renderer/themes' +import { DEFAULT_DARK_THEME, DEFAULT_LIGHT_THEME, nessieColorById } from '../../src/shared/state/settings' +import { BUILT_IN_PALETTES } from '../src/themes.generated' +import { applyTheme, c, getThemeMode, themeKey, themed, type Palette, type ThemeInputs } from '../src/theme' +import { generate, OUTPUT } from '../scripts/gen-themes.mjs' + +const PALETTE_KEYS: (keyof Palette)[] = [ + 'app', 'panel', 'panelRaised', 'surface', 'surfaceHover', 'well', 'border', 'borderStrong', + 'fg', 'fgBright', 'muted', 'dim', 'faint', 'success', 'warning', 'danger', 'info', 'accent', + 'brand', 'brandMid', 'brandDeep' +] +const COLOR = /^(#[0-9a-fA-F]{3,8}|rgba?\([^)]*\))$/ + +const inputs = (over: Partial = {}): ThemeInputs => ({ + themeMode: 'dark', + themeLight: DEFAULT_LIGHT_THEME, + themeDark: DEFAULT_DARK_THEME, + customThemes: [], + nessieColor: 'loch', + systemScheme: 'dark', + ...over +}) + +describe('generated palettes', () => { + it('match styles.css (run `node scripts/gen-themes.mjs` in mobile/ if this fails)', () => { + expect(readFileSync(OUTPUT, 'utf8')).toBe(generate().source) + }) + + it('cover every built-in theme the desktop offers', () => { + for (const t of THEME_OPTIONS) expect(BUILT_IN_PALETTES, `theme ${t.id}`).toHaveProperty(t.id) + }) + + it('resolve every token the app reads to a colour', () => { + for (const [id, p] of Object.entries(BUILT_IN_PALETTES)) { + for (const k of PALETTE_KEYS) expect(p[k], `${id}.${k}`).toMatch(COLOR) + } + }) +}) + +describe('applyTheme', () => { + it('applies the chosen theme for the mode', () => { + applyTheme(inputs({ themeMode: 'light', themeLight: 'solarized-light' })) + expect(getThemeMode()).toBe('light') + expect(c.app).toBe(BUILT_IN_PALETTES['solarized-light'].app) + applyTheme(inputs({ themeDark: 'dracula' })) + expect(getThemeMode()).toBe('dark') + expect(c.app).toBe(BUILT_IN_PALETTES.dracula.app) + }) + + it("resolves 'system' against the phone's appearance", () => { + applyTheme(inputs({ themeMode: 'system', systemScheme: 'light', themeLight: 'one-light' })) + expect(c.app).toBe(BUILT_IN_PALETTES['one-light'].app) + applyTheme(inputs({ themeMode: 'system', systemScheme: 'dark', themeDark: 'nord' })) + expect(c.app).toBe(BUILT_IN_PALETTES.nord.app) + }) + + it("falls back to the mode's default for an unknown or wrong-mode id", () => { + applyTheme(inputs({ themeMode: 'light', themeLight: 'dracula' })) + expect(c.app).toBe(BUILT_IN_PALETTES[DEFAULT_LIGHT_THEME].app) + applyTheme(inputs({ themeDark: 'no-such-theme' })) + expect(c.app).toBe(BUILT_IN_PALETTES[DEFAULT_DARK_THEME].app) + }) + + it('layers a custom theme over its base', () => { + applyTheme( + inputs({ + themeDark: 'mine', + customThemes: [{ id: 'mine', name: 'Mine', mode: 'dark', colors: { app: '#123456', 'fg-bright': '#abcdef' } }] + }) + ) + expect(c.app).toBe('#123456') + expect(c.fgBright).toBe('#abcdef') + expect(c.border).toMatch(COLOR) + }) + + it('takes the brand ramp from the Nessie colour, a rung deeper on light themes', () => { + const n = nessieColorById('abyss') + applyTheme(inputs({ nessieColor: 'abyss' })) + expect(c.brand).toBe(n.brand) + applyTheme(inputs({ nessieColor: 'abyss', themeMode: 'light' })) + expect(c.brand).toBe(n.deep) + }) + + it('changes themeKey only when the effective theme changes', () => { + expect(themeKey(inputs())).toBe(themeKey(inputs({ themeLight: 'one-light' }))) + expect(themeKey(inputs())).not.toBe(themeKey(inputs({ themeDark: 'nord' }))) + }) + + it('rebuilds themed() styles after a theme change', () => { + const styles = themed(() => ({ box: { backgroundColor: c.app } })) + applyTheme(inputs({ themeDark: 'nord' })) + expect(styles.box.backgroundColor).toBe(BUILT_IN_PALETTES.nord.app) + applyTheme(inputs({ themeDark: 'dracula' })) + expect(styles.box.backgroundColor).toBe(BUILT_IN_PALETTES.dracula.app) + }) +}) diff --git a/mobile/tsconfig.json b/mobile/tsconfig.json new file mode 100644 index 00000000..b9567f60 --- /dev/null +++ b/mobile/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "expo/tsconfig.base", + "compilerOptions": { + "strict": true + } +} diff --git a/mobile/vitest.config.ts b/mobile/vitest.config.ts new file mode 100644 index 00000000..9668c8c3 --- /dev/null +++ b/mobile/vitest.config.ts @@ -0,0 +1,26 @@ +// Node-side tests for the mobile client: the pure logic it adds on top of +// the shared modules, and (test/contract.test.ts) the whole client against +// a real headless server. Run from the repo root: +// npm run test:mobile unit tests +// npm run test:mobile:contract + contract (needs `npm run build:headless`) +// Component rendering isn't covered here; nothing that imports a React +// Native view can load in Node. +import { defineConfig } from 'vitest/config' +import { fileURLToPath } from 'node:url' + +export default defineConfig({ + root: fileURLToPath(new URL('.', import.meta.url)), + resolve: { + alias: { + // theme.ts reads Platform for the monospace family. + 'react-native': fileURLToPath(new URL('./test/stubs/react-native.ts', import.meta.url)) + } + }, + test: { + include: ['test/**/*.test.ts'], + exclude: process.env.MOBILE_CONTRACT ? [] : ['test/contract.test.ts'], + environment: 'node', + testTimeout: 30_000, + hookTimeout: 60_000 + } +}) diff --git a/package.json b/package.json index 0c0e1c77..54d2ec0c 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,9 @@ "typecheck": "tsc -b --force", "test": "vitest run", "test:watch": "vitest", + "typecheck:mobile": "tsc -p mobile/tsconfig.json --noEmit", + "test:mobile": "vitest run --config mobile/vitest.config.ts", + "test:mobile:contract": "MOBILE_CONTRACT=1 vitest run --config mobile/vitest.config.ts", "postinstall": "electron-builder install-app-deps", "rebuild:dev": "electron-rebuild -f -w node-pty", "pack": "npm run build && CSC_IDENTITY_AUTO_DISCOVERY=false electron-builder --dir --arm64 --config.mac.identity=null", diff --git a/src/main/index.ts b/src/main/index.ts index e7f7d20e..2add1530 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -4086,6 +4086,14 @@ function registerIpcHandlers(): void { // unconditional side-effect added to either wake path can't silently // fire on the wrong tab type. const type = panesFSM.getTabType(wtPath, tabId) + // A wake is user activity. Without this, AutoSleepMonitor's next + // sweep (≤60s) sees the worktree's stale lastActive and sleeps the tab + // straight back — every open of an idle chat from a phone (web or + // app), where nothing else touches lastActive until a keystroke, + // woke the session only to kill it again. + if (type === 'json-claude' || type === 'shell') { + store.dispatch({ type: 'terminals/lastActiveChanged', payload: { worktreePath: wtPath, ts: Date.now() } }) + } if (type === 'json-claude') { panesFSM.wakeJsonClaudeTab(wtPath, await forkIfRunningElsewhere(wtPath, tabId)) } else if (type === 'shell') panesFSM.wakeShellTab(wtPath, tabId) diff --git a/src/renderer/components/AllFilesPanel.tsx b/src/renderer/components/AllFilesPanel.tsx index 1d23f1a2..392a8cd5 100644 --- a/src/renderer/components/AllFilesPanel.tsx +++ b/src/renderer/components/AllFilesPanel.tsx @@ -20,7 +20,8 @@ const LIST_VIEW_LIMIT = 1000 interface AllFilesPanelProps { worktreePath: string | null - onOpenFile: (filePath: string) => void + /** Absent on the phone web client (no file tabs there). */ + onOpenFile?: (filePath: string) => void onSendToAgent?: (text: string) => void } @@ -72,7 +73,7 @@ export function AllFilesPanel({ onOpenFileRef.current = onOpenFile onSendToAgentRef.current = onSendToAgent }) - const openFile = useCallback((path: string) => onOpenFileRef.current(path), []) + const openFile = useCallback((path: string) => onOpenFileRef.current?.(path), []) const sendToAgent = useCallback((text: string) => onSendToAgentRef.current?.(text), []) const rowSendToAgent = onSendToAgent ? sendToAgent : undefined const [view, toggleView] = useFileListView('all-files', 'tree') diff --git a/src/renderer/components/ChangedFilesPanel.tsx b/src/renderer/components/ChangedFilesPanel.tsx index fc3210ae..fc1e4d66 100644 --- a/src/renderer/components/ChangedFilesPanel.tsx +++ b/src/renderer/components/ChangedFilesPanel.tsx @@ -15,7 +15,9 @@ type Mode = 'working' | 'branch' interface ChangedFilesPanelProps { worktreePath: string | null - onOpenDiff: (filePath: string, staged: boolean, mode: Mode) => void + /** Absent on the phone web client, which can't show a diff tab: rows + * then don't open anything (send-to-agent still works). */ + onOpenDiff?: (filePath: string, staged: boolean, mode: Mode) => void onSendToAgent?: (text: string) => void onOpenReview?: () => void } @@ -126,7 +128,7 @@ export function ChangedFilesPanel({ worktreePath, onOpenDiff, onSendToAgent, onO files={stagedFiles} view={uncommittedView} worktreePath={worktreePath} - onOpen={(file) => onOpenDiff(file.path, true, 'working')} + onOpen={(file) => onOpenDiff?.(file.path, true, 'working')} onSendToAgent={onSendToAgent} /> {unstagedFiles.length > 0 && ( @@ -138,7 +140,7 @@ export function ChangedFilesPanel({ worktreePath, onOpenDiff, onSendToAgent, onO files={unstagedFiles} view={uncommittedView} worktreePath={worktreePath} - onOpen={(file) => onOpenDiff(file.path, false, 'working')} + onOpen={(file) => onOpenDiff?.(file.path, false, 'working')} onSendToAgent={onSendToAgent} /> @@ -156,7 +158,7 @@ export function ChangedFilesPanel({ worktreePath, onOpenDiff, onSendToAgent, onO files={branchFiles} view={committedView} worktreePath={worktreePath} - onOpen={(file) => onOpenDiff(file.path, false, 'branch')} + onOpen={(file) => onOpenDiff?.(file.path, false, 'branch')} onSendToAgent={onSendToAgent} /> )} diff --git a/src/renderer/components/ContextPanel.tsx b/src/renderer/components/ContextPanel.tsx index 3472d7c7..91a03523 100644 --- a/src/renderer/components/ContextPanel.tsx +++ b/src/renderer/components/ContextPanel.tsx @@ -66,7 +66,7 @@ function BarRow({ row, used }: { row: Row; used: number }): JSX.Element { {pct >= 1 ? `${Math.round(pct)}%` : '<1%'} - + {formatTokens(row.tokens)} @@ -111,7 +111,7 @@ function buildRows(snapshot: ContextSnapshot): Row[] { } ] for (const [name, tokens] of Object.entries(c.toolResults)) { - rows.push({ label: shortToolName(name), tokens, color: 'bg-error', title: name }) + rows.push({ label: shortToolName(name), tokens, color: 'bg-danger', title: name }) } return rows } @@ -180,7 +180,7 @@ export function ContextPanel({ focusedTabId }: ContextPanelProps): JSX.Element | {/* Pinned: the headline stays readable while the list scrolls. */}
- + {Math.round(pct)}% @@ -236,7 +236,7 @@ export function ContextPanel({ focusedTabId }: ContextPanelProps): JSX.Element | {snapshot.discoverableTools.length > 0 && (
@@ -168,7 +168,7 @@ export function CostPanel({ worktreePath }: CostPanelProps): JSX.Element | null <>
{formatCost(total.cost)} diff --git a/src/renderer/components/FileTree.tsx b/src/renderer/components/FileTree.tsx index 8808239a..b21fe503 100644 --- a/src/renderer/components/FileTree.tsx +++ b/src/renderer/components/FileTree.tsx @@ -18,7 +18,7 @@ export function FileListViewToggle({ e.stopPropagation() onToggle() }} - className="text-faint hover:text-fg transition-colors cursor-pointer" + className="text-faint hover:text-fg transition-colors cursor-pointer pointer-coarse:p-4 pointer-coarse:-my-4 pointer-coarse:-mr-4" aria-label={label} > {view === 'list' ? : } diff --git a/src/renderer/components/GitHubApiLogPanel.tsx b/src/renderer/components/GitHubApiLogPanel.tsx index ffa4aa74..9865696c 100644 --- a/src/renderer/components/GitHubApiLogPanel.tsx +++ b/src/renderer/components/GitHubApiLogPanel.tsx @@ -257,13 +257,13 @@ function statusColorClass(entry: GitHubApiEntry): string { const k = classifyStatus(entry) if (k === 'ok') return 'text-success' if (k === 'client-error') return 'text-warning' - return 'text-error' + return 'text-danger' } function durationColorClass(ms: number): string { if (ms < 500) return 'text-fg' if (ms < 2000) return 'text-warning' - return 'text-error' + return 'text-danger' } function formatRelative(pastMs: number, now: number): string { @@ -379,7 +379,7 @@ function DetailRow({
{label} {value} @@ -407,7 +407,7 @@ function RateLimitCard({ const pct = rateLimit.limit > 0 ? Math.max(0, rateLimit.remaining / rateLimit.limit) : 0 const remainingTone = - pct < 0.05 ? 'text-error' : pct < 0.2 ? 'text-warning' : 'text-success' + pct < 0.05 ? 'text-danger' : pct < 0.2 ? 'text-warning' : 'text-success' const used = Math.max(0, rateLimit.limit - rateLimit.remaining) return (
@@ -464,7 +464,7 @@ function VolumeChart({ {totalCalls} calls {totalErrors > 0 && ( - · {totalErrors} errors + · {totalErrors} errors )} {maxCount > 0 && ` · peak ${maxCount}/min`} @@ -547,7 +547,7 @@ function FilterChip({ : tone === 'warning' ? 'text-warning' : tone === 'error' - ? 'text-error' + ? 'text-danger' : 'text-fg' return ( diff --git a/src/renderer/components/MobileApp.tsx b/src/renderer/components/MobileApp.tsx index e4219d72..2e44d34b 100644 --- a/src/renderer/components/MobileApp.tsx +++ b/src/renderer/components/MobileApp.tsx @@ -17,6 +17,7 @@ import { AgentIcon } from './AgentIcon' import { randomUUID } from '../uuid' import { HotkeysProvider } from './Tooltip' import { resolveHotkeys } from '../hotkeys' +import { pickInitialTab } from '../pick-initial-tab' type RunnableTab = TerminalTab & { type: 'agent' | 'shell' | 'json-claude' } @@ -37,15 +38,6 @@ function isRunnable(tab: TerminalTab): tab is RunnableTab { return tab.type === 'agent' || tab.type === 'shell' || tab.type === 'json-claude' } -function pickInitialTab(tabs: TerminalTab[]): string | null { - return ( - tabs.find((t) => t.type === 'agent')?.id ?? - tabs.find((t) => t.type === 'shell')?.id ?? - tabs[0]?.id ?? - null - ) -} - /** Mobile has no CreatingWorktreeScreen to drop onto, so a failed creation is * surfaced as a thrown error that NewWorktreeScreen renders in its inline * error box. The picker can dismiss the leftover pending entry, but reading @@ -84,6 +76,8 @@ export function MobileApp(): JSX.Element { const [newWorktreeRepo, setNewWorktreeRepo] = useState(undefined) const [showNewWorktree, setShowNewWorktree] = useState(false) const [newWorktreeFocusPath, setNewWorktreeFocusPath] = useState(null) + // "Build a custom tool…" prefill, same as the desktop's newWorktreePrefill. + const [newWorktreePrefill, setNewWorktreePrefill] = useState<{ branch: string; prompt: string } | null>(null) useEffect(() => { if (!activeWorktreeId) return @@ -197,7 +191,37 @@ export function MobileApp(): JSX.Element { [activeWorktree] ) + // Same routing as the desktop's handleSendToAgent: the phone's selected + // tab if it takes messages, else a pane's active one, else the first. + const handleSendToAgent = useCallback( + (wtPath: string, text: string) => { + const tree = panes[wtPath] + const leaves = tree ? getLeaves(tree) : [] + const sendable = (t: TerminalTab): boolean => t.type === 'agent' || t.type === 'json-claude' + const all = leaves.flatMap((l) => l.tabs) + const claimed = all.find((t) => t.id === selectedTabByWorktree[wtPath]) + const target = + (claimed && sendable(claimed) ? claimed : undefined) ?? + leaves.map((l) => l.tabs.find((t) => t.id === l.activeTabId)).find((t): t is TerminalTab => !!t && sendable(t)) ?? + all.find(sendable) + if (!target) return + setSelectedTabByWorktree((prev) => ({ ...prev, [wtPath]: target.id })) + setRightPanelOpen(false) + if (target.type === 'json-claude') backend.sendJsonClaudeMessage(target.id, text) + else backend.writeTerminal(target.id, '\x1b[200~' + text + '\x1b[201~') + }, + [panes, selectedTabByWorktree] + ) + + const handleBuildCustomTool = useCallback((branch: string, prompt: string) => { + setNewWorktreePrefill({ branch, prompt }) + setNewWorktreeRepo(undefined) + setShowNewWorktree(true) + setRightPanelOpen(false) + }, []) + const handleOpenNewWorktree = useCallback((repoRoot?: string) => { + setNewWorktreePrefill(null) setNewWorktreeRepo(repoRoot) setShowNewWorktree(true) setPickerOpen(false) @@ -344,6 +368,8 @@ export function MobileApp(): JSX.Element { onCancel={() => setShowNewWorktree(false)} repoRoots={wtState.repoRoots} defaultRepoRoot={newWorktreeRepo ?? activeWorktree?.repoRoot} + initialBranch={newWorktreePrefill?.branch} + initialPrompt={newWorktreePrefill?.prompt} />
)} @@ -351,8 +377,12 @@ export function MobileApp(): JSX.Element { {rightPanelOpen && ( setRightPanelOpen(false)} /> )} @@ -574,10 +604,12 @@ function TabIcon({ tab, shellActivity, status }: { tab: TerminalTab; shellActivi ) } if (tab.type === 'json-claude') { + // Live status, same as agent tabs and the desktop tab strip — a fixed + // accent dot hid whether a chat was working or waiting on you. return ( - + ) } diff --git a/src/renderer/components/MobileRightPanel.tsx b/src/renderer/components/MobileRightPanel.tsx index 26fb445c..ea428c5c 100644 --- a/src/renderer/components/MobileRightPanel.tsx +++ b/src/renderer/components/MobileRightPanel.tsx @@ -1,35 +1,47 @@ import { useCallback } from 'react' import { useRepoConfigs, useSettings } from '../store' import { useBackend } from '../backend' -import { PRStatusPanel, MergeLocallyPanel } from './PRStatusPanel' -import { BranchCommitsPanel } from './BranchCommitsPanel' -import { CostPanel } from './CostPanel' +import { RightColumnToolbar } from './RightColumnToolbar' +import { RightPanelStack, useRightPanelConfig } from './RightColumn' +import { BUILD_CUSTOM_TOOL_BRANCH, BUILD_CUSTOM_TOOL_PROMPT } from '../../shared/tools' import type { Worktree, PRStatus } from '../types' interface MobileRightPanelProps { activeWorktree: Worktree | null + worktrees: Worktree[] + /** The tab the phone has selected — what the desktop calls the focused + * tab. Todos / Agents / Context / Subscriptions read its session. */ + focusedTabId: string | null prStatuses: Record prLoading: boolean + onSendToAgent: (worktreePath: string, text: string) => void + /** Opens the new-worktree screen pre-filled, as the desktop does. */ + onBuildCustomTool: (branch: string, prompt: string) => void onClose: () => void } -// Fullscreen takeover that surfaces the useful slices of the desktop -// right panel — PR status, local merge, branch commits, cost. File -// panels (ChangedFiles / AllFiles) are intentionally omitted: their -// primary interaction is "tap a file to open a diff tab", and mobile -// can't render diff/file tabs meaningfully. +// Fullscreen takeover with the desktop's full right column: the same +// panels, in the repo's configured order, with the same visibility / +// reorder toolbar (RightPanelStack is shared with RightColumn). Openers +// that need a diff or file tab — which a phone can't show — are left out, +// so those rows don't open anything; everything else is identical. export function MobileRightPanel({ activeWorktree, + worktrees, + focusedTabId, prStatuses, prLoading, + onSendToAgent, + onBuildCustomTool, onClose }: MobileRightPanelProps): JSX.Element { const backend = useBackend() const repoConfigs = useRepoConfigs() const settings = useSettings() const hasGithubToken = settings.hasGithubToken || !!settings.githubAuthSource - const activeRepoConfig = activeWorktree ? repoConfigs[activeWorktree.repoRoot] ?? null : null - void activeRepoConfig + const activeRepoRoot = activeWorktree?.repoRoot ?? null + const activeRepoConfig = activeRepoRoot ? repoConfigs[activeRepoRoot] ?? null : null + const config = useRightPanelConfig(activeWorktree?.path ?? null, activeRepoRoot, activeRepoConfig) const handleRefresh = useCallback(() => { void backend.refreshPRsAll() @@ -38,6 +50,8 @@ export function MobileRightPanel({ const handleRemoveWorktree = useCallback( (path: string): void => { if (!activeWorktree) return + // A stray tap is easy on a phone and removal can't be undone here. + if (!window.confirm(`Remove worktree ${activeWorktree.branch || path}? It will be deleted from disk.`)) return void backend.removeWorktree(activeWorktree.repoRoot, path) onClose() }, @@ -53,26 +67,33 @@ export function MobileRightPanel({ )} {activeWorktree && ( <> -
diff --git a/src/renderer/components/PerfMonitorHUD.tsx b/src/renderer/components/PerfMonitorHUD.tsx index 2dc6d4f8..24ad5808 100644 --- a/src/renderer/components/PerfMonitorHUD.tsx +++ b/src/renderer/components/PerfMonitorHUD.tsx @@ -37,13 +37,13 @@ const NOT_MEASURED_CLASS = 'text-faint' function statusClass(value: number, green: number, amber: number): string { if (value < green) return 'text-success' if (value < amber) return 'text-warning' - return 'text-error' + return 'text-danger' } function fpsClass(fps: number): string { if (fps >= 50) return 'text-success' if (fps >= 30) return 'text-warning' - return 'text-error' + return 'text-danger' } function formatBytes(bytes: number): string { diff --git a/src/renderer/components/RightColumn.tsx b/src/renderer/components/RightColumn.tsx index 00f2197d..6a0a090b 100644 --- a/src/renderer/components/RightColumn.tsx +++ b/src/renderer/components/RightColumn.tsx @@ -27,8 +27,10 @@ import { useBackend } from '../backend' type ChangedFilesPanelProps = React.ComponentProps type AllFilesPanelProps = React.ComponentProps -interface RightColumnProps { - width: number +/** Everything a stack of right-column panels needs. Shared by the desktop + * RightColumn and the phone web client's MobileRightPanel, so both show + * the same panels in the repo's configured order. */ +export interface RightPanelStackProps { activeWorktreeId: string | null activeRepoRoot: string | null /** Id of the currently focused tab in the active worktree's focused @@ -44,45 +46,33 @@ interface RightColumnProps { onOpenGithubSettings: () => void onMerged: () => void onRemoveWorktree: (path: string) => void - onOpenDiff: ChangedFilesPanelProps['onOpenDiff'] - onOpenCommitFileDiff: (commitHash: string, shortHash: string, filePath: string) => void - onOpenFile: AllFilesPanelProps['onOpenFile'] + /** The three openers below are desktop-only (diff/file tabs); the phone + * web client leaves them out and the panels hide or no-op them. */ + onOpenDiff?: ChangedFilesPanelProps['onOpenDiff'] + onOpenCommitFileDiff?: (commitHash: string, shortHash: string, filePath: string) => void + onOpenFile?: AllFilesPanelProps['onOpenFile'] onSendToAgent: (worktreePath: string, text: string) => void onOpenPR: (url: string) => void - onOpenReview: () => void + onOpenReview?: () => void +} + +interface RightColumnProps extends RightPanelStackProps { + width: number onCollapse: () => void /** Opens the new-worktree screen pre-filled with a branch name and the * custom-tool authoring contract as the kickoff prompt. */ onBuildCustomTool: (branch: string, prompt: string) => void } -/** Memoized so the sidebar's first-frame highlight render (see - * `sidebarActiveId` in App) can skip it; App keeps its props stable. */ -export const RightColumn = memo(function RightColumn({ - width, - activeWorktreeId, - activeRepoRoot, - focusedTabId, - worktrees, - prStatuses, - prLoading, - hasGithubToken, - activeRepoConfig, - onRefreshPRs, - onOpenGithubSettings, - onMerged, - onRemoveWorktree, - onOpenDiff, - onOpenCommitFileDiff, - onOpenFile, - onSendToAgent, - onOpenPR, - onOpenReview, - onCollapse, - onBuildCustomTool -}: RightColumnProps): JSX.Element { +/** Tools list, effective order/visibility and the repo-config writers for + * the active repo — the state both RightColumn's toolbar and the panel + * stack read. */ +export function useRightPanelConfig( + activeWorktreeId: string | null, + activeRepoRoot: string | null, + activeRepoConfig: RepoConfig | null +) { const backend = useBackend() - const toolsFetcher = useCallback( (path: string) => backend.listTools(path), [backend] @@ -120,6 +110,58 @@ export const RightColumn = memo(function RightColumn({ } as unknown as Partial) } + return { tools, toolLabels, hidden, order, handleChangeHidden, handleChangeOrder } +} + +/** Memoized so the sidebar's first-frame highlight render (see + * `sidebarActiveId` in App) can skip it; App keeps its props stable. */ +export const RightColumn = memo(function RightColumn(props: RightColumnProps): JSX.Element { + const { width, activeWorktreeId, activeRepoRoot, activeRepoConfig, onCollapse, onBuildCustomTool } = props + const config = useRightPanelConfig(activeWorktreeId, activeRepoRoot, activeRepoConfig) + return ( +
+
+ ) +}) + +/** The configured panels, in order, minus hidden ones. */ +export function RightPanelStack({ + config, + activeWorktreeId, + focusedTabId, + worktrees, + prStatuses, + prLoading, + hasGithubToken, + onRefreshPRs, + onOpenGithubSettings, + onMerged, + onRemoveWorktree, + onOpenDiff, + onOpenCommitFileDiff, + onOpenFile, + onSendToAgent, + onOpenPR, + onOpenReview +}: RightPanelStackProps & { config: ReturnType }): JSX.Element { + const { tools, hidden, order } = config const renderPanel = (key: RightPanelKey): JSX.Element | null => { if (hidden[key]) return null if (isCustomToolPanelKey(key)) { @@ -214,25 +256,5 @@ export const RightColumn = memo(function RightColumn({ } } - return ( -
-
- ) -}) + return <>{order.map((key) => renderPanel(key))} +} diff --git a/src/renderer/components/RightColumnToolbar.tsx b/src/renderer/components/RightColumnToolbar.tsx index 25da0227..bacb501e 100644 --- a/src/renderer/components/RightColumnToolbar.tsx +++ b/src/renderer/components/RightColumnToolbar.tsx @@ -89,7 +89,7 @@ export function RightColumnToolbar({ } return ( -
+
TOOLS
@@ -97,7 +97,7 @@ export function RightColumnToolbar({ {actions && ( -
{actions}
+ // On touch screens every header action gets a 44px target (the + // icons themselves stay icon-xs) — they're 12px squares otherwise. +
+ {actions} +
)}
{!collapsed &&
{children}
} diff --git a/src/renderer/components/json-mode-cards/automation-label.ts b/src/renderer/components/json-mode-cards/automation-label.ts new file mode 100644 index 00000000..9df9ccce --- /dev/null +++ b/src/renderer/components/json-mode-cards/automation-label.ts @@ -0,0 +1,95 @@ +import type { JsonClaudeAutomationSource } from '../../../shared/state/json-claude' + +/** `brand` picks the gradient chrome the ness-control tool cards use. + * A CI failure keeps the warning tone — it's a problem report, not a + * Ness feature showing off. */ +export function automationLabel( + source: JsonClaudeAutomationSource, + from?: string +): { label: string; note: string; brand: boolean; collapsed?: boolean } { + if (source === 'worktree-message') { + return { + label: from ? `Agent Message · from ${from}` : 'Agent Message', + note: 'sent by another worktree', + brand: true + } + } + if (source === 'subscription-started') { + return { + label: from ? `New Follower · ${from}` : 'New Follower', + note: 'another agent now follows this worktree', + brand: true + } + } + if (source === 'subscription-update') { + return { + label: from ? `Worktree Update · ${from}` : 'Worktree Update', + note: 'a worktree you follow changed', + brand: true + } + } + if (source === 'reviewed-pr-update') { + return { label: 'Ness · Reviewed PR update', note: 'the PR you are reviewing', brand: false } + } + if (source === 'pr-update') { + return { label: 'Ness · PR update', note: "this worktree's pull request", brand: false } + } + if (source === 'progress-report') { + return { + label: from ? `Progress Report · from ${from}` : 'Progress Report', + note: 'from a worktree you follow', + brand: true + } + } + if (source === 'review') { + return { + label: from ? `Code Review · from ${from}` : 'Code Review', + note: 'submitted in the Review tab', + brand: true + } + } + if (source === 'worktree-kickoff') { + return { + label: from ? `Task Brief · from ${from}` : 'Task Brief', + note: 'opened this worktree', + brand: true + } + } + // The body here is the human's own kickoff prompt — only the stripped + // footer (rename yourself) was Ness's, hence "your prompt". + if (source === 'worktree-autoname') { + return { + label: 'Kickoff Prompt', + note: 'opened this worktree · naming it from your prompt', + brand: true + } + } + // The one automation the user fires by hand, so it says who asked. + if (source === 'merge-conflict') { + return { + label: 'Ness · Merge conflicts', + note: 'you asked the agent to resolve them', + brand: false + } + } + if (source === 'review-request') { + return { + label: from ? `Review Request · from ${from}` : 'Review Request', + note: 'this agent is reviewing the branch', + brand: true + } + } + if (source === 'ci-failure') { + return { label: 'Ness · CI failure', note: 'sent automatically', brand: false } + } + if (source === 'first-run-kickoff') { + // The brief is instructions to the agent, not something the user needs + // to read before its greeting, so it starts folded away. + return { label: 'Ness · Getting started', note: 'sent when you pressed Start something new', brand: true, collapsed: true } + } + if (source === 'blame-ask') { + return { label: 'Blame · Ask about a line', note: 'you opened this from the gutter', brand: true } + } + const unhandled: never = source + return { label: `Ness · ${unhandled}`, note: 'sent automatically', brand: false } +} diff --git a/src/renderer/pick-initial-tab.test.ts b/src/renderer/pick-initial-tab.test.ts new file mode 100644 index 00000000..2ec1586a --- /dev/null +++ b/src/renderer/pick-initial-tab.test.ts @@ -0,0 +1,20 @@ +import { describe, expect, it } from 'vitest' +import type { TerminalTab } from '../shared/state/terminals' +import { pickInitialTab } from './pick-initial-tab' + +const tab = (id: string, type: TerminalTab['type']): TerminalTab => ({ id, type, label: id }) as TerminalTab + +describe('pickInitialTab', () => { + it('prefers a Chat tab over an earlier Shell', () => { + expect(pickInitialTab([tab('s', 'shell'), tab('c', 'json-claude')])).toBe('c') + }) + it('takes the first conversation in tab order, Chat or Claude Code', () => { + expect(pickInitialTab([tab('a', 'agent'), tab('c', 'json-claude')])).toBe('a') + expect(pickInitialTab([tab('c', 'json-claude'), tab('a', 'agent')])).toBe('c') + }) + it('falls back to a shell, then the first tab, then null', () => { + expect(pickInitialTab([tab('b', 'browser'), tab('s', 'shell')])).toBe('s') + expect(pickInitialTab([tab('b', 'browser')])).toBe('b') + expect(pickInitialTab([])).toBeNull() + }) +}) diff --git a/src/renderer/pick-initial-tab.ts b/src/renderer/pick-initial-tab.ts new file mode 100644 index 00000000..3bb3b81f --- /dev/null +++ b/src/renderer/pick-initial-tab.ts @@ -0,0 +1,15 @@ +import type { TerminalTab } from '../shared/state/terminals' + +/** The tab a phone opens a worktree on when it has no remembered choice: + * the first conversation (Chat or a Claude Code terminal, in tab order), + * then a shell, then whatever is there. Shared by the phone web client + * (MobileApp.tsx) and the Expo app (mobile/), so keep it free of DOM and + * React imports. */ +export function pickInitialTab(tabs: readonly TerminalTab[]): string | null { + return ( + tabs.find((t) => t.type === 'json-claude' || t.type === 'agent')?.id ?? + tabs.find((t) => t.type === 'shell')?.id ?? + tabs[0]?.id ?? + null + ) +} diff --git a/vitest.config.ts b/vitest.config.ts index 361851b3..358963b4 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -5,6 +5,7 @@ export default defineConfig({ setupFiles: ['./vitest.setup.ts'], // `tsc -b` emits compiled copies of every *.test.ts into out/, so without // this vitest runs each test twice — once from source, once from stale build output. - exclude: [...defaultExclude, 'out/**', 'dist-headless/**', 'release/**'] + // mobile/ is the Expo spike: its own package, its own toolchain. + exclude: [...defaultExclude, 'out/**', 'dist-headless/**', 'release/**', 'mobile/**'] } })