Skip to content

Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.

feat(web): compare Codync with OpenAI's Dots

leepokai25a19fa5a544
diff --git a/CLAUDE.md b/CLAUDE.md
index 397a791f..4e19a22a 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -37,6 +37,7 @@ Bot-based remote for coding agents: persistent named bots on your computer, mess
- Environments: **dev** (`dev-api.codync.dev`, Clerk development instance, Debug builds) and **main** (`api.codync.dev`, Clerk production, Release builds); `apps/shared/Config/<env>.plist` becomes the iOS `AccountConfig.plist` and the desktop `resources/account-config.json` (`tools/account-config.mjs`). Details: [spec §14.0](docs/reference/remote-relay.md).
- Push: iOS registers its APNs token with `relay/` → gets an AES-GCM ticket → gives it (plus its X25519 push key) to the host; the host seals title/body to that key and a Notification Service Extension opens it, so `relay/` sees only generic text. Alert kinds: *needs you*, *done*, and *failed*, suppressed while the iOS app is connected. Delivery and lifecycle: [notification design](docs/design/push-and-live-activity.md).
- Voice call (iPhone, desktop): on-device speech (macOS desktop: the `codync-speech` helper), or OpenAI / Gemini realtime on the user's own key (kept in the host's vault, which mints per-call credentials; audio goes device ↔ provider); the host sees plain messages. Grok-style call bar: [docs/features/voice-call.md](docs/features/voice-call.md).
+- Analytics: opt-in PostHog, asked once per device, feature use only (never content); host events come from `api::dispatch`: [docs/features/analytics.md](docs/features/analytics.md).
- Usage: local only — `claude -p /usage --no-session-persistence`, the Claude status line (`codync-host statusline`, wrapping any existing one), Claude ACP `usage_update` rate-limit meta, Codex rollout files. Never call provider APIs with agent credentials.
- The desktop app is thin: the Mac build bundles `codync-host` in `Contents/Resources` (Linux uses the installed host) and installs it as a launchd/systemd agent via `codync-host install`; the menu bar/tray shows status/pairing/usage and opens the chat window. Not sandboxed, not Mac App Store (the host must spawn CLIs).
diff --git a/apps/desktop/src/renderer/demo/fake-host.ts b/apps/desktop/src/renderer/demo/fake-host.ts
index 95ce8576..cf4e49b9 100644
--- a/apps/desktop/src/renderer/demo/fake-host.ts
+++ b/apps/desktop/src/renderer/demo/fake-host.ts
@@ -19,6 +19,8 @@ export class FakeHost {
private listeners = new Set<(line: string) => void>()
private turns = new Map<string, number>()
private nextReply = new Map<string, number>()
+ /** Already chosen, so the demo never asks for consent. */
+ private analytics = false
constructor(
readonly version: string,
@@ -181,7 +183,7 @@ export class FakeHost {
case 'hello':
return {
hostId: this.hostId, computerId: story.COMPUTER_ID, signKey: '', boxKey: '', cloud: null, name: story.HOST_NAME,
- version: this.version, minApp: this.version, os: 'macos', device: 'MacBookPro', home: '/Users/demo', rev: this.rev,
+ version: this.version, minApp: this.version, os: 'macos', device: 'MacBookPro', home: '/Users/demo', rev: this.rev, analytics: this.analytics,
urls: [], backends: [
{ id: 'claude', name: 'Claude Code', available: true, installed: true, signedIn: true, command: 'claude', installHint: '' },
{ id: 'codex', name: 'Codex', available: true, installed: true, signedIn: true, command: 'codex', installHint: '' },
@@ -265,6 +267,11 @@ export class FakeHost {
return { configured: false, keyUrl: '' }
case 'credentialStatus':
return { provider: '', onePasswordConnected: false }
+ case 'setAnalytics':
+ this.analytics = b.enabled === true
+ return { enabled: this.analytics }
+ case 'track':
+ return {}
default:
throw fail(DEMO_UNAVAILABLE)
}
diff --git a/apps/desktop/src/renderer/store/app-model.ts b/apps/desktop/src/renderer/store/app-model.ts
index ab03d06e..21cd511b 100644
--- a/apps/desktop/src/renderer/store/app-model.ts
+++ b/apps/desktop/src/renderer/store/app-model.ts
@@ -2,6 +2,7 @@ import type { HostSnapshot } from '@shared/ipc'
import type { AccessRequest, Bot, Computer } from '@shared/models'
import { LoopbackTransport } from '../client/host-client'
import { Observable } from '../lib/observable'
+import { account } from './account'
import { BotStore } from './bot-store'
import { CloudModel } from './cloud'
@@ -47,6 +48,9 @@ export class AppModel extends Observable {
screenNeedsApproval = false
screenError: string | null = null
private screenSynced = false
+ private opened = false
+ /** Whether the account was signed in when last seen; null until its state first arrives. */
+ private signedIn: boolean | null = null
/** Approvals closed with "later"; they come back when the request changes (its code arrives). */
private deferred = new Set<string>()
private storeSubscriptions = new Map<string, () => void>()
@@ -57,6 +61,7 @@ export class AppModel extends Observable {
constructor(private mirrors = true) {
super()
this.cloud = new CloudModel(this)
+ account.subscribe(() => this.noteAccount())
}
setError(message: string | null) {
@@ -80,7 +85,10 @@ export class AppModel extends Observable {
const computer: Computer = cached ?? { id: local.computerId, name: 'This computer', signKey: '', urls: [] }
const store = new BotStore(computer, true, () => new LoopbackTransport(local.baseURL, local.token))
this.attach(computer, store)
- store.subscribe(() => this.syncScreen(store))
+ store.subscribe(() => {
+ this.syncScreen(store)
+ this.noteOpened(store)
+ })
} else if (!local && old) {
this.detach(old.computerId)
}
@@ -217,6 +225,21 @@ export class AppModel extends Observable {
})
}
+ /** `app_opened` once per launch, when this computer's host first answers. */
+ private noteOpened(store: BotStore) {
+ if (this.opened || !store.hello) return
+ this.opened = true
+ store.track('app_opened')
+ }
+
+ /** Sign-in and sign-out, not the state restored at launch. */
+ private noteAccount() {
+ if (!account.isReady) return
+ const now = account.isSignedIn
+ if (this.signedIn !== null && now !== this.signedIn) this.local?.track(now ? 'signed_in' : 'signed_out')
+ this.signedIn = now
+ }
+
clearErrors() {
this.lastError = null
for (const store of this.stores.values()) store.lastError = null
diff --git a/apps/desktop/src/renderer/store/bot-store.ts b/apps/desktop/src/renderer/store/bot-store.ts
index 9eadcd08..75aeb414 100644
--- a/apps/desktop/src/renderer/store/bot-store.ts
+++ b/apps/desktop/src/renderer/store/bot-store.ts
@@ -1,6 +1,7 @@
import {
isWorking,
needsInput,
+ type AnalyticsEvent,
type Bot,
type BotDraft,
type DirListing,
@@ -143,6 +144,23 @@ export class BotStore extends BotSync {
this.changed()
}
+ /** Product analytics consent: null until the owner chose, undefined before hello or on older hosts. */
+ get analytics() {
+ return this.hello?.analytics
+ }
+
+ /** Only the computer itself may change analytics (the host accepts it from loopback). */
+ async setAnalytics(enabled: boolean) {
+ const res = await (await this.ready()).call<{ enabled: boolean }>('setAnalytics', { enabled })
+ if (this.hello) this.hello = { ...this.hello, analytics: res.enabled }
+ this.changed()
+ }
+
+ /** Fire-and-forget; the host drops it unless analytics is on. */
+ track(event: AnalyticsEvent) {
+ void this.withLink((c) => c.call('track', { event })).catch((error: unknown) => console.warn(`track ${event} failed`, error))
+ }
+
/** Toggles the user's reaction; shown at once, then replaced by the host's copy. */
react(entry: Entry, emoji: string) {
const list = this.entries.get(entry.botId)
diff --git a/apps/desktop/src/renderer/views/AnalyticsPrompt.tsx b/apps/desktop/src/renderer/views/AnalyticsPrompt.tsx
new file mode 100644
index 00000000..1c699e4d
--- /dev/null
+++ b/apps/desktop/src/renderer/views/AnalyticsPrompt.tsx
@@ -0,0 +1,56 @@
+import { useState } from 'react'
+import { Button } from '../components/Controls'
+import { Icon } from '../components/Icon'
+import { ModalHeader, Sheet } from '../components/Overlay'
+import { font } from '../lib/fonts'
+import { useModel } from '../lib/observable'
+import { prefs, usePref } from '../lib/prefs'
+import { useApp } from '../store/context'
+import { errorText } from './settings/parts'
+
+const device = window.codync.platform === 'darwin' ? 'Mac' : 'computer'
+/** Read at launch: a welcome screen finished later was this launch's onboarding. */
+const onboardedAtLaunch = prefs.onboardingDone.get()
+
+/**
+ * Asks this computer's owner once whether to share product analytics: after the welcome screen,
+ * or on the first launch after updating. Closing without choosing asks again next launch.
+ */
+export function AnalyticsPrompt() {
+ const app = useApp()
+ const local = useModel(app.local)
+ const [onboarded] = usePref(prefs.onboardingDone)
+ const [closed, setClosed] = useState(false)
+ const open = onboarded && !closed && local !== null && local.connection.kind === 'online' && local.analytics === null
+
+ const choose = async (share: boolean) => {
+ setClosed(true)
+ if (!local) return
+ try {
+ await local.setAnalytics(share)
+ if (share && !onboardedAtLaunch) local.track('onboarding_completed')
+ } catch (e) {
+ app.setError(errorText(e))
+ }
+ }
+
+ return (
+ <Sheet open={open} onClose={() => setClosed(true)}>
+ <div style={{ width: 420, display: 'flex', flexDirection: 'column' }}>
+ <ModalHeader title="Help improve Codync" />
+ <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 16, padding: '0 24px 24px' }}>
+ <Icon name="chart.bar" size={36} weight="light" color="var(--secondary)" />
+ <div style={{ ...font('callout'), color: 'var(--secondary)', textAlign: 'center' }}>
+ Codync can record which features you use on this {device}, like creating a bot or sending a message. It never collects your messages, code, files, prompts or bot names. Your data stays private: it's used only to understand how people use Codync, never sold and never used for ads. When you're signed in, it's linked to your Codync account. You can turn this off anytime in Settings.
+ </div>
+ <div style={{ display: 'flex', gap: 12 }}>
+ <Button kind="secondary" onClick={() => void choose(false)}>
+ Don't share
+ </Button>
+ <Button onClick={() => void choose(true)}>Share usage</Button>
+ </div>
+ </div>
+ </div>
+ </Sheet>
+ )
+}
diff --git a/apps/desktop/src/renderer/views/ChatWindow.tsx b/apps/desktop/src/renderer/views/ChatWindow.tsx
index 1adb64bb..2dde37a7 100644
--- a/apps/desktop/src/renderer/views/ChatWindow.tsx
+++ b/apps/desktop/src/renderer/views/ChatWindow.tsx
@@ -21,6 +21,7 @@ import { SettingsView, type SettingsPage } from './settings/SettingsView'
import { ApprovalSheet } from './settings/ApprovalSheet'
import { UpdateNeededCard } from './UpdateNeededCard'
import { AccountWelcomeView } from './AccountWelcomeView'
+import { AnalyticsPrompt } from './AnalyticsPrompt'
import { OpenVoiceSettings } from './call/CallView'
import { AccountPanelLayer, DesktopActionMenu, ProfileAvatar } from './PanelMenus'
import { useTraySummary } from './tray-summary'
@@ -82,6 +83,7 @@ export function ChatWindow() {
) : (
<AccountWelcomeView onContinue={() => setOnboarded(true)} />
)}
+ <AnalyticsPrompt />
<Dialog
open={confirmReset}
title="Reset all data?"
diff --git a/apps/desktop/src/renderer/views/settings/SettingsView.tsx b/apps/desktop/src/renderer/views/settings/SettingsView.tsx
index 094d6032..2bd5b930 100644
--- a/apps/desktop/src/renderer/views/settings/SettingsView.tsx
+++ b/apps/desktop/src/renderer/views/settings/SettingsView.tsx
@@ -4,12 +4,13 @@ import { Button, CardForm, CardSection, ChoicePicker, IconButton, Switch, ValueR
import { Icon } from '../../components/Icon'
import { useDismiss } from '../../components/Overlay'
import { font } from '../../lib/fonts'
+import { useModel } from '../../lib/observable'
import { DEFAULT_TEXT_SIZE, prefs, TEXT_SIZES, usePref } from '../../lib/prefs'
import { useAccount } from '../../store/account'
import { StoreContext, useApp } from '../../store/context'
import { ComputerBadge } from '../ComputerBadge'
import { ComputersView } from './ComputersView'
-import { isMac, thisMac } from './parts'
+import { errorText, isMac, thisMac } from './parts'
import { UsageLimits } from './UsageLimits'
import { VoiceChatSettingsView } from './VoiceChatSettingsView'
@@ -154,10 +155,26 @@ function GeneralSettings() {
Open at login
</Switch>
</CardSection>
+ <PrivacySettings />
</CardForm>
)
}
+/** Product analytics on this computer's host; only the computer itself may change it. */
+function PrivacySettings() {
+ const app = useApp()
+ const local = useModel(app.local)
+ const running = local !== null && local.connection.kind === 'online'
+ const setShared = (on: boolean) => void local?.setAnalytics(on).catch((e: unknown) => app.setError(errorText(e)))
+ return (
+ <CardSection title="Privacy" footer="Which features you use, never your messages, code or files. Private, used only to improve Codync.">
+ <Switch on={local?.analytics === true} onChange={setShared} disabled={!running}>
+ Share usage analytics
+ </Switch>
+ </CardSection>
+ )
+}
+
/** Every computer's usage limits, grouped by computer when there's more than one. */
function UsageLimitsList() {
const app = useApp()
diff --git a/apps/desktop/src/shared/models.ts b/apps/desktop/src/shared/models.ts
index ed603b3e..797a3d67 100644
--- a/apps/desktop/src/shared/models.ts
+++ b/apps/desktop/src/shared/models.ts
@@ -271,8 +271,13 @@ export interface Hello {
boxKey?: string
minApp?: string
cloud?: string | null
+ /** Product analytics on this computer; null until its owner chose (absent on older hosts). */
+ analytics?: boolean | null
}
+/** Events only the desktop app knows about; the host records everything else from API calls. */
+export type AnalyticsEvent = 'app_opened' | 'onboarding_completed' | 'signed_in' | 'signed_out'
+
export interface PairingInfo {
pairingUrl: string
urls: string[]
diff --git a/apps/ios/App/AccountSession.swift b/apps/ios/App/AccountSession.swift
index 99d75f27..d4abf648 100644
--- a/apps/ios/App/AccountSession.swift
+++ b/apps/ios/App/AccountSession.swift
@@ -122,6 +122,7 @@ final class AccountSession {
errorMessage = "\(provider.rawValue) sign-up needs additional account information. Your account is not signed in yet."
}
}
+ if errorMessage == nil { Analytics.shared.capture(.signedIn) }
} catch let error as ASWebAuthenticationSessionError where error.code == .canceledLogin {
return
} catch let error as ASAuthorizationError where error.code == .canceled {
diff --git a/apps/ios/App/CodyncApp.swift b/apps/ios/App/CodyncApp.swift
index 08201c9f..67b3551e 100644
--- a/apps/ios/App/CodyncApp.swift
+++ b/apps/ios/App/CodyncApp.swift
@@ -15,6 +15,10 @@ struct CodyncApp: App {
@AppStorage("onboardingCompleted") private var onboardingCompleted = false
/// Cold launch with a computer to reach: the splash covers its connect and catch-up.
@State private var launching = !AppStore.shared.accounts.computers.isEmpty
+ /// nil until this iPhone answers "Help improve Codync".
+ @AppStorage(Analytics.enabledKey) private var analyticsEnabled: Bool?
+ /// Setup finished during this launch: a yes to analytics also reports `onboarding_completed`.
+ @State private var onboardedNow = false
init() {
// A tapped widget bot arrives as an intent, not a URL.
@@ -45,6 +49,16 @@ struct CodyncApp: App {
.environment(app.account)
.tint(Palette.accent)
}
+ // Asked once per iPhone after setup, once the splash and the account sheet are gone.
+ .codyncDialog("Help improve Codync", isPresented: Binding(
+ get: { onboardingCompleted && analyticsEnabled == nil && !launching && !app.account.showSwitcher },
+ set: { shown in if !shown && analyticsEnabled == nil { Analytics.shared.setEnabled(false) } }
+ ), message: Self.analyticsQuestion, cancel: "Don't share", inPlace: true) {
+ [DialogAction("Share usage") {
+ Analytics.shared.setEnabled(true)
+ if onboardedNow { Analytics.shared.capture(.onboardingCompleted) }
+ }]
+ }
.onChange(of: app.account.userID, initial: true) { _, userID in
app.switchAccount(to: userID)
}
@@ -56,7 +70,13 @@ struct CodyncApp: App {
}
}
.onOpenURL { url in app.open(url) }
+ .onChange(of: onboardingCompleted) { _, done in if done { onboardedNow = true } }
.onChange(of: scenePhase, initial: true) { _, phase in
+ switch phase {
+ case .active: Analytics.shared.becameActive()
+ case .background: Analytics.shared.enteredBackground()
+ default: break
+ }
// Only leaving for the background disconnects; `.inactive` (Control Center,
// app switcher, system prompts) comes and goes too often to drop the link.
app.accounts.setActive(phase != .background)
@@ -90,6 +110,10 @@ struct CodyncApp: App {
}
}
+extension CodyncApp {
+ static let analyticsQuestion = "Codync can record which features you use on this iPhone, like creating a bot or sending a message. It never collects your messages, code, files, prompts or bot names. Your data stays private: it's used only to understand how people use Codync, never sold and never used for ads. When you're signed in, it's linked to your Codync account. You can turn this off anytime in Settings."
+}
+
enum AppTab: Hashable { case bots, state }
/// One `AccountStore` per account context: switching accounts retires the old one so
@@ -117,6 +141,7 @@ final class AppStore {
let storage = SharedStore.Context(accountID: session.userID)
SharedStore.activeAccountID = session.userID
account = session
+ Analytics.shared.userID = { [session] in session.userID }
contextID = storage.id
(accounts, cloud) = Self.makeAccounts(storage, session: session)
}
@@ -148,6 +173,8 @@ final class AppStore {
/// Signing out forgets this account on this iPhone: its device keys, computers and caches (spec §3.2).
func signOut() async {
guard let userID = account.userID else { return }
+ // Sent first so it still counts toward the account.
+ Analytics.shared.capture(.signedOut)
await account.signOut()
guard account.userID != userID, !account.accounts.contains(where: { $0.id == userID }) else { return }
// Retire its stores first: a retiring store saves its cache one last time.
@@ -169,6 +196,7 @@ final class AppStore {
storage.bots = []
SharedStore.activeAccountID = nil
UserDefaults.standard.set(false, forKey: "onboardingCompleted")
+ Analytics.shared.setEnabled(nil)
showComputers = false
account.showSwitcher = false
marketplace = nil
@@ -181,7 +209,9 @@ final class AppStore {
}
func pair(_ pairing: Pairing) async throws -> Computer {
- try await accounts.pair(pairing, deviceName: UIDevice.current.name, platform: "ios")
+ let computer = try await accounts.pair(pairing, deviceName: UIDevice.current.name, platform: "ios")
+ Analytics.shared.capture(.computerPaired)
+ return computer
}
func open(_ url: URL) {
diff --git a/apps/ios/Kit/Sources/CodyncKit/Analytics/Analytics.swift b/apps/ios/Kit/Sources/CodyncKit/Analytics/Analytics.swift
new file mode 100644
index 00000000..db656e8d
--- /dev/null
+++ b/apps/ios/Kit/Sources/CodyncKit/Analytics/Analytics.swift
@@ -0,0 +1,176 @@
+import Foundation
+
+/// What the iPhone reports. Bot and message events come from the computer's host instead.
+public enum AnalyticsEvent: String, Sendable {
+ case appOpened = "app_opened"
+ case onboardingCompleted = "onboarding_completed"
+ case computerPaired = "computer_paired"
+ case signedIn = "signed_in"
+ case signedOut = "signed_out"
+ case voiceCallStarted = "voice_call_started"
+}
+
+/// Opt-in product analytics: batches events to PostHog. Nothing is recorded until this iPhone
+/// says yes. Only the app calls it; widgets and the notification extension never do.
+@MainActor
+public final class Analytics {
+ public static let shared = Analytics()
+
+ /// One event in PostHog's `/batch/` body.
+ struct Event: Encodable, Equatable {
+ let uuid = UUID()
+ let event: String
+ let distinct_id: String
+ let timestamp: String
+ let properties: [String: Value]
+ }
+
+ enum Value: Encodable, Equatable {
+ case string(String), bool(Bool)
+
+ func encode(to encoder: Encoder) throws {
+ var c = encoder.singleValueContainer()
+ switch self {
+ case .string(let s): try c.encode(s)
+ case .bool(let b): try c.encode(b)
+ }
+ }
+ }
+
+ private struct Batch: Encodable {
+ let api_key: String
+ let batch: [Event]
+ }
+
+ nonisolated static let endpoint = URL(string: "https://us.i.posthog.com/batch/")!
+ static let apiKey = "phc_rQHvxdSFKnMquPfMjmiMhXhM4tqJ5qCYsWuVEoFxCCWX"
+ /// `Bool?`: nil until asked.
+ public static let enabledKey = "analyticsEnabled"
+ private static let installKey = "analyticsInstallID"
+ private static let identifiedKey = "analyticsIdentifiedUsers"
+ private static let batchSize = 20
+ private static let maxPending = 500
+ private static let flushDelay = Duration.seconds(30)
+
+ /// The signed-in Codync account, read at capture time; nil = anonymous install ID.
+ public var userID: @MainActor () -> String? = { nil }
+ private let defaults: UserDefaults
+ private let upload: @Sendable (Data) async -> Bool
+ private(set) var pending: [Event] = []
+ private var timer: Task<Void, Never>?
+ private var sending = false
+ private var foreground = false
+
+ init(defaults: UserDefaults = .standard, upload: @escaping @Sendable (Data) async -> Bool = Analytics.post) {
+ self.defaults = defaults
+ self.upload = upload
+ }
+
+ /// nil until this iPhone answers the question.
+ public var isEnabled: Bool? { defaults.object(forKey: Self.enabledKey) as? Bool }
+
+ /// Turning it off (or back to "not asked") drops everything not yet sent.
+ public func setEnabled(_ enabled: Bool?) {
+ defaults.set(enabled, forKey: Self.enabledKey)
+ guard enabled != true else { return }
+ pending = []
+ timer?.cancel()
+ timer = nil
+ }
+
+ public func capture(_ event: AnalyticsEvent) {
+ guard isEnabled == true else { return }
+ if let user = userID() {
+ var identified = defaults.stringArray(forKey: Self.identifiedKey) ?? []
+ if !identified.contains(user) {
+ enqueue("$identify", user, ["$anon_distinct_id": .string(installID)])
+ identified.append(user)
+ defaults.set(identified, forKey: Self.identifiedKey)
+ }
+ enqueue(event.rawValue, user, [:])
+ } else {
+ enqueue(event.rawValue, installID, [:])
+ }
+ }
+
+ /// `app_opened` once per trip to the foreground (`.inactive` blips don't count).
+ public func becameActive() {
+ guard !foreground else { return }
+ foreground = true
+ capture(.appOpened)
+ }
+
+ public func enteredBackground() {
+ foreground = false
+ flush()
+ }
+
+ func flush() {
+ timer?.cancel()
+ timer = nil
+ guard !sending, !pending.isEmpty, isEnabled == true,
+ let body = try? JSONEncoder().encode(Batch(api_key: Self.apiKey, batch: pending)) else { return }
+ let sent = Set(pending.map(\.uuid))
+ sending = true
+ Task {
+ let ok = await upload(body)
+ sending = false
+ if ok { pending.removeAll { sent.contains($0.uuid) } }
+ if !pending.isEmpty { scheduleFlush() }
+ }
+ }
+
+ private var installID: String {
+ if let id = defaults.string(forKey: Self.installKey) { return id }
+ let id = UUID().uuidString
+ defaults.set(id, forKey: Self.installKey)
+ return id
+ }
+
+ private func enqueue(_ name: String, _ distinctID: String, _ extra: [String: Value]) {
+ var properties = Self.common.merging(extra) { $1 }
+ properties["$process_person_profile"] = .bool(distinctID != installID)
+ pending.append(Event(event: name, distinct_id: distinctID,
+ timestamp: Date.now.ISO8601Format(), properties: properties))
+ if pending.count > Self.maxPending { pending.removeFirst(pending.count - Self.maxPending) }
+ if pending.count >= Self.batchSize { flush() } else { scheduleFlush() }
+ }
+
+ private func scheduleFlush() {
+ guard timer == nil else { return }
+ timer = Task { [weak self] in
+ try? await Task.sleep(for: Self.flushDelay)
+ guard !Task.isCancelled else { return }
+ self?.timer = nil
+ self?.flush()
+ }
+ }
+
+ static let common: [String: Value] = {
+ let os = ProcessInfo.processInfo.operatingSystemVersion
+ #if DEBUG
+ let env = "dev"
+ #else
+ let env = "main"
+ #endif
+ return [
+ "$lib": .string("codync-ios"),
+ "app_version": .string(Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? ""),
+ "env": .string(env),
+ "$os": .string("iOS"),
+ "$os_version": .string("\(os.majorVersion).\(os.minorVersion).\(os.patchVersion)"),
+ "$geoip_disable": .bool(true),
+ ]
+ }()
+
+ /// Sent (or rejected for good) → true; network errors, 429 and 5xx → false, retried next flush.
+ nonisolated static func post(_ body: Data) async -> Bool {
+ var request = URLRequest(url: endpoint)
+ request.httpMethod = "POST"
+ request.setValue("application/json", forHTTPHeaderField: "Content-Type")
+ request.httpBody = body
+ guard let (_, response) = try? await URLSession.shared.data(for: request),
+ let status = (response as? HTTPURLResponse)?.statusCode else { return false }
+ return status < 500 && status != 429
+ }
+}
diff --git a/apps/ios/Kit/Sources/CodyncUI/Call/CallView.swift b/apps/ios/Kit/Sources/CodyncUI/Call/CallView.swift
index 6ad68046..0ae5525f 100644
--- a/apps/ios/Kit/Sources/CodyncUI/Call/CallView.swift
+++ b/apps/ios/Kit/Sources/CodyncUI/Call/CallView.swift
@@ -38,6 +38,7 @@ struct CallView: View {
.animation(Motion.reduced(Motion.fade, reduceMotion), value: notice)
.onAppear {
startedAt = .now
+ Analytics.shared.capture(.voiceCallStarted)
begin(cloud: VoiceSettings.provider)
}
.onDisappear {
diff --git a/apps/ios/Kit/Tests/CodyncKitTests/AnalyticsTests.swift b/apps/ios/Kit/Tests/CodyncKitTests/AnalyticsTests.swift
new file mode 100644
index 00000000..4d43d04e
--- /dev/null
+++ b/apps/ios/Kit/Tests/CodyncKitTests/AnalyticsTests.swift
@@ -0,0 +1,41 @@
+import Foundation
+import Testing
+@testable import CodyncKit
+
+@MainActor
+@Test func analyticsRecordsOnlyWhenEnabledAndIdentifiesAccountsOnce() throws {
+ let defaults = try #require(UserDefaults(suiteName: "AnalyticsTests-\(UUID())"))
+ let analytics = Analytics(defaults: defaults) { _ in false }
+
+ // Not asked yet, then declined: nothing recorded.
+ analytics.capture(.appOpened)
+ analytics.setEnabled(false)
+ analytics.capture(.appOpened)
+ #expect(analytics.pending.isEmpty)
+
+ // Anonymous: the install ID, no person profile, the common properties.
+ analytics.setEnabled(true)
+ analytics.capture(.computerPaired)
+ let anon = try #require(analytics.pending.first)
+ #expect(anon.event == "computer_paired")
+ #expect(anon.properties["$process_person_profile"] == .bool(false))
+ #expect(anon.properties["$lib"] == .string("codync-ios"))
+ #expect(anon.properties["$os"] == .string("iOS"))
+ #expect(anon.properties["$geoip_disable"] == .bool(true))
+ #expect(anon.properties["env"] != nil && anon.properties["app_version"] != nil)
+
+ // Signed in: $identify links the install ID once, then events carry the user ID.
+ analytics.userID = { "user_1" }
+ analytics.capture(.signedIn)
+ analytics.capture(.voiceCallStarted)
+ let names = analytics.pending.map(\.event)
+ #expect(names == ["computer_paired", "$identify", "signed_in", "voice_call_started"])
+ let identify = analytics.pending[1]
+ #expect(identify.distinct_id == "user_1")
+ #expect(identify.properties["$anon_distinct_id"] == .string(anon.distinct_id))
+ #expect(analytics.pending[2].properties["$process_person_profile"] == .bool(true))
+
+ // Turning it off drops what wasn't sent.
+ analytics.setEnabled(false)
+ #expect(analytics.pending.isEmpty)
+}
diff --git a/apps/ios/Resources/PrivacyInfo.xcprivacy b/apps/ios/Resources/PrivacyInfo.xcprivacy
index c9415a39..09509655 100644
--- a/apps/ios/Resources/PrivacyInfo.xcprivacy
+++ b/apps/ios/Resources/PrivacyInfo.xcprivacy
@@ -7,7 +7,21 @@
<key>NSPrivacyTrackingDomains</key>
<array/>
<key>NSPrivacyCollectedDataTypes</key>
- <array/>
+ <array>
+ <!-- Opt-in usage analytics (Settings → Share usage analytics), linked to the Codync account when signed in. -->
+ <dict>
+ <key>NSPrivacyCollectedDataType</key>
+ <string>NSPrivacyCollectedDataTypeProductInteraction</string>
+ <key>NSPrivacyCollectedDataTypeLinked</key>
+ <true/>
+ <key>NSPrivacyCollectedDataTypeTracking</key>
+ <false/>
+ <key>NSPrivacyCollectedDataTypePurposes</key>
+ <array>
+ <string>NSPrivacyCollectedDataTypePurposeAnalytics</string>
+ </array>
+ </dict>
+ </array>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict>
diff --git a/apps/ios/Views/SettingsView.swift b/apps/ios/Views/SettingsView.swift
index ab3fe5f3..f02e56d4 100644
--- a/apps/ios/Views/SettingsView.swift
+++ b/apps/ios/Views/SettingsView.swift
@@ -13,6 +13,7 @@ struct SettingsView: View {
@Environment(\.openURL) private var openURL
@State private var notificationsAllowed: Bool?
@AppStorage("notificationsEnabled") private var notificationsEnabled = true
+ @AppStorage(Analytics.enabledKey) private var analyticsEnabled: Bool?
@State private var addingComputer = false
@State private var confirmForget: Computer?
@State private var confirmRevoke: CloudComputer?
@@ -76,6 +77,12 @@ struct SettingsView: View {
notificationsRow
}
+ CardSection(footer: "Which features you use, never your messages, code or files. Private, used only to improve Codync.") {
+ Toggle("Share usage analytics", isOn: Binding(get: { analyticsEnabled == true },
+ set: { Analytics.shared.setEnabled($0) }))
+ .toggleStyle(.codync)
+ }
+
if !hiddenBots.isEmpty {
CardSection("Hidden bots") {
ForEach(hiddenBots) { item in
diff --git a/docs/features/analytics.md b/docs/features/analytics.md
new file mode 100644
index 00000000..7652e048
--- /dev/null
+++ b/docs/features/analytics.md
@@ -0,0 +1,42 @@
+# Usage analytics
+
+Opt-in product analytics in PostHog (US Cloud, project "Codync App", id 649427). Every
+device asks once and sends nothing until the user agrees; the answer can be changed in
+Settings anytime. The public promise lives in `web/app/privacy/page.tsx`: keep it true.
+
+## Rules
+
+- **Only feature use, never content.** No message text, prompts, code, file names, paths,
+ bot names, credentials or agent output. Properties are counts, booleans and public
+ catalog names (agent, model, connector catalog name; a custom connector is just `custom`).
+- **Consent per device.** The computer's owner decides for that computer (host kv
+ `analytics_enabled`, `null` until asked); each iPhone decides for itself
+ (`UserDefaults` `analyticsEnabled`). Turning it off drops anything still queued.
+- **Identity.** Signed in to a Codync account: the Clerk user id, with a person profile.
+ Otherwise a random install id (the host id on a computer, a UUID on the iPhone) and no
+ person profile. The first signed-in event sends `$identify` with `$anon_distinct_id` so
+ earlier events join the account.
+- **No IP or location**: the project discards client IPs and every event sets `$geoip_disable`.
+- `env` is `main` or `dev`; filter dev out in PostHog.
+
+## Where events come from
+
+- **Host** (`host/src/analytics.rs`): `api::dispatch` maps successful API calls to events
+ (`analytics::observe`), so every client is covered once: `bot_created`, `bot_updated`,
+ `bot_deleted`, `message_sent`, `turn_stopped`, `session_reset`, `permission_answered`,
+ `routine_saved`, `routine_deleted`, `routine_run`, `voice_call_finished`,
+ `remote_screen_opened`, `connector_installed`, `skill_installed`. `client` is `local`
+ (desktop app, terminal UI) or `remote` (phones). Batches go to `/batch/` every 30 s.
+- **Desktop and terminal UI** report app-level events through the loopback-only `track`
+ method (`app_opened`, `onboarding_completed`, `signed_in`, `signed_out`) and set consent
+ with `setAnalytics`; `hello` carries `analytics: true | false | null`.
+- **iPhone** (`CodyncKit` analytics client, no SDK) sends its own app-level events
+ (`app_opened`, `onboarding_completed`, `computer_paired`, `signed_in`, `signed_out`,
+ `voice_call_started`) straight to PostHog. Widgets and the notification extension never send.
+
+## Asking
+
+All clients show the same prompt ("Help improve Codync", *Share usage* / *Don't share*)
+when onboarding is done and the device hasn't answered, which covers new users right after
+the welcome screen and existing users once after updating. The App Store privacy label
+declares *Product Interaction*, linked to the user, not used for tracking.
diff --git a/host/src/analytics.rs b/host/src/analytics.rs
new file mode 100644
index 00000000..1bd192e8
--- /dev/null
+++ b/host/src/analytics.rs
@@ -0,0 +1,274 @@
+//! Opt-in product analytics (`PostHog`), decided once per computer by its owner
+//! (`setAnalytics`; nothing is sent until then). Events name the feature that was used
+//! and never carry content: no message text, prompts, file names, paths or bot names.
+//! What is collected and why: docs/features/analytics.md.
+
+use crate::LockExt as _;
+use crate::api::devices::Caller;
+use crate::hub::Hub;
+use crate::store::Store;
+use anyhow::Result;
+use serde::Deserialize;
+use serde_json::{Map, Value, json};
+use std::sync::{Arc, Mutex};
+use std::time::Duration;
+use tokio::sync::mpsc;
+
+const KV_ENABLED: &str = "analytics_enabled";
+/// The account the install id was last merged into (one `$identify` per account).
+const KV_IDENTIFIED: &str = "analytics_identified";
+/// Write-only project token: safe to ship in public builds.
+const TOKEN: &str = "phc_rQHvxdSFKnMquPfMjmiMhXhM4tqJ5qCYsWuVEoFxCCWX";
+const BATCH_URL: &str = "https://us.i.posthog.com/batch/";
+const FLUSH_EVERY: Duration = Duration::from_secs(30);
+/// Unsent events kept while offline; the oldest go first.
+const MAX_PENDING: usize = 500;
+
+/// Everything the host reports. Names follow the `object_verb` convention.
+#[derive(Clone, Copy, Debug, PartialEq, Eq, Deserialize)]
+#[serde(rename_all = "snake_case")]
+pub enum Event {
+ AppOpened,
+ OnboardingCompleted,
+ SignedIn,
+ SignedOut,
+ BotCreated,
+ BotUpdated,
+ BotDeleted,
+ MessageSent,
+ TurnStopped,
+ SessionReset,
+ PermissionAnswered,
+ RoutineSaved,
+ RoutineDeleted,
+ RoutineRun,
+ VoiceCallFinished,
+ RemoteScreenOpened,
+ ConnectorInstalled,
+ SkillInstalled,
+}
+
+impl Event {
+ fn name(self) -> &'static str {
+ match self {
+ Self::AppOpened => "app_opened",
+ Self::OnboardingCompleted => "onboarding_completed",
+ Self::SignedIn => "signed_in",
+ Self::SignedOut => "signed_out",
+ Self::BotCreated => "bot_created",
+ Self::BotUpdated => "bot_updated",
+ Self::BotDeleted => "bot_deleted",
+ Self::MessageSent => "message_sent",
+ Self::TurnStopped => "turn_stopped",
+ Self::SessionReset => "session_reset",
+ Self::PermissionAnswered => "permission_answered",
+ Self::RoutineSaved => "routine_saved",
+ Self::RoutineDeleted => "routine_deleted",
+ Self::RoutineRun => "routine_run",
+ Self::VoiceCallFinished => "voice_call_finished",
+ Self::RemoteScreenOpened => "remote_screen_opened",
+ Self::ConnectorInstalled => "connector_installed",
+ Self::SkillInstalled => "skill_installed",
+ }
+ }
+
+ /// Events the computer's own apps report through `track` (the rest come from API calls).
+ fn client_reported(self) -> bool {
+ matches!(self, Self::AppOpened | Self::OnboardingCompleted | Self::SignedIn | Self::SignedOut)
+ }
+}
+
+pub struct Analytics {
+ /// `None` until the owner has chosen.
+ enabled: Mutex<Option<bool>>,
+ tx: mpsc::UnboundedSender<Value>,
+ rx: Mutex<Option<mpsc::UnboundedReceiver<Value>>>,
+}
+
+impl Analytics {
+ pub fn load(store: &Store) -> Self {
+ let enabled = match store.kv_get(KV_ENABLED).as_deref() {
+ Some("1") => Some(true),
+ Some("0") => Some(false),
+ _ => None,
+ };
+ let (tx, rx) = mpsc::unbounded_channel();
+ Self { enabled: Mutex::new(enabled), tx, rx: Mutex::new(Some(rx)) }
+ }
+
+ /// `null` until asked, which is when the computer's apps ask.
+ pub fn state(&self) -> Option<bool> {
+ *self.enabled.locked()
+ }
+
+ pub fn set_enabled(&self, store: &Store, on: bool) -> Result<()> {
+ store.kv_set(KV_ENABLED, if on { "1" } else { "0" })?;
+ *self.enabled.locked() = Some(on);
+ Ok(())
+ }
+
+ fn enabled(&self) -> bool {
+ self.state() == Some(true)
+ }
+}
+
+/// `track`: an event the computer's own app reports (app opened, signed in, …).
+pub fn track(hub: &Hub, b: &Value) -> Result<()> {
+ let event = Event::deserialize(&b["event"]).map_err(|_| anyhow::anyhow!("unknown event"))?;
+ anyhow::ensure!(event.client_reported(), "unknown event");
+ capture(hub, event, Map::new());
+ Ok(())
+}
+
+/// The event an API call stands for, with its properties, read before the call runs.
+pub fn observe(caller: &Caller, method: &str, b: &Value) -> Option<(Event, Map<String, Value>)> {
+ let mut p = Map::new();
+ let event = match method {
+ "createBot" => {
+ let group = b["kind"] == "group";
+ p.insert("kind".into(), (if group { "group" } else { "bot" }).into());
+ if group {
+ p.insert("members".into(), b["members"].as_array().map_or(0, Vec::len).into());
+ } else {
+ p.insert("agent".into(), b["backend"].clone());
+ p.insert("model".into(), b["model"].clone());
+ }
+ Event::BotCreated
+ }
+ "updateBot" => Event::BotUpdated,
+ "deleteBot" => Event::BotDeleted,
+ "send" => {
+ let in_thread = b["threadId"].as_str().is_some_and(|t| !t.is_empty());
+ p.insert("in_thread".into(), in_thread.into());
+ p.insert("attachments".into(), b["attachments"].as_array().map_or(0, Vec::len).into());
+ Event::MessageSent
+ }
+ "stop" => Event::TurnStopped,
+ "newSession" => Event::SessionReset,
+ "respondPermission" => Event::PermissionAnswered,
+ "saveRoutine" => Event::RoutineSaved,
+ "deleteRoutine" => Event::RoutineDeleted,
+ "runRoutine" => Event::RoutineRun,
+ "logCall" => {
+ p.insert("seconds".into(), b["seconds"].as_u64().unwrap_or(0).into());
+ Event::VoiceCallFinished
+ }
+ "screenPrepare" => Event::RemoteScreenOpened,
+ "installConnector" => {
+ // A catalog name is public; a custom connector's URL or command is not.
+ let catalog = b["registryName"].as_str().unwrap_or("custom");
+ p.insert("connector".into(), catalog.into());
+ Event::ConnectorInstalled
+ }
+ "installSkill" => {
+ p.insert("custom".into(), (!b["source"].is_string()).into());
+ Event::SkillInstalled
+ }
+ _ => return None,
+ };
+ let client = if matches!(caller, Caller::Local) { "local" } else { "remote" };
+ p.insert("client".into(), client.into());
+ Some((event, p))
+}
+
+/// Queues one event when the owner said yes. Signed in to a Codync account, events are
+/// linked to that account; otherwise to this install's random id, with no person profile.
+pub fn capture(hub: &Hub, event: Event, mut properties: Map<String, Value>) {
+ if !hub.analytics.enabled() {
+ return;
+ }
+ let account = hub.cloud.status().owner.map(|o| o.user_id);
+ if let Some(user) = &account
+ && hub.store.kv_get(KV_IDENTIFIED).as_deref() != Some(user.as_str())
+ {
+ // Merges this install's earlier, anonymous events into the account.
+ let identify = json!({"$anon_distinct_id": hub.host_id, "$process_person_profile": true});
+ queue(hub, "$identify", user, identify.as_object().cloned().unwrap_or_default());
+ if let Err(e) = hub.store.kv_set(KV_IDENTIFIED, user) {
+ tracing::warn!(error = format!("{e:#}"), "couldn't save the analytics identity");
+ }
+ }
+ properties.insert("$process_person_profile".into(), account.is_some().into());
+ queue(hub, event.name(), account.as_deref().unwrap_or(&hub.host_id), properties);
+}
+
+fn queue(hub: &Hub, event: &str, distinct_id: &str, mut properties: Map<String, Value>) {
+ properties.extend([
+ ("$lib".into(), "codync-host".into()),
+ ("app_version".into(), env!("CARGO_PKG_VERSION").into()),
+ ("env".into(), (if option_env!("CODYNC_ENV") == Some("main") { "main" } else { "dev" }).into()),
+ ("$os".into(), std::env::consts::OS.into()),
+ ("arch".into(), std::env::consts::ARCH.into()),
+ ("$geoip_disable".into(), true.into()),
+ ]);
+ let _ = hub.analytics.tx.send(json!({"event": event, "distinct_id": distinct_id, "properties": properties}));
+}
+
+/// Sends queued events in batches every `FLUSH_EVERY`; turning analytics off drops them.
+pub fn start(hub: &Arc<Hub>) {
+ let Some(mut rx) = hub.analytics.rx.locked().take() else { return };
+ let hub = hub.clone();
+ tokio::spawn(async move {
+ let mut pending: Vec<Value> = Vec::new();
+ let mut tick = tokio::time::interval(FLUSH_EVERY);
+ loop {
+ tokio::select! {
+ event = rx.recv() => match event {
+ Some(e) => pending.push(e),
+ None => return,
+ },
+ _ = tick.tick() => {
+ let sent = hub.analytics.enabled() && !pending.is_empty() && send(&pending).await;
+ if sent || !hub.analytics.enabled() {
+ pending.clear();
+ }
+ }
+ }
+ if pending.len() > MAX_PENDING {
+ pending.drain(..pending.len() - MAX_PENDING);
+ }
+ }
+ });
+}
+
+async fn send(batch: &[Value]) -> bool {
+ let body = json!({"api_key": TOKEN, "batch": batch});
+ match crate::http().post(BATCH_URL).json(&body).timeout(Duration::from_secs(15)).send().await {
+ Ok(r) if r.status().is_success() => true,
+ Ok(r) => {
+ tracing::debug!(status = %r.status(), "analytics batch refused");
+ // Refused for good (bad payload): retrying would only repeat it.
+ r.status().is_client_error()
+ }
+ Err(e) => {
+ tracing::debug!(error = format!("{e:#}"), "analytics batch not sent");
+ false
+ }
+ }
+}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ fn observed_events_carry_no_content() {
+ let b = json!({"botId": "b1", "text": "secret plan", "threadId": "e1", "attachments": ["u1", "u2"]});
+ let (event, p) = observe(&Caller::Local, "send", &b).expect("send is tracked");
+ assert_eq!(event, Event::MessageSent);
+ assert_eq!(Value::Object(p.clone()), json!({"in_thread": true, "attachments": 2, "client": "local"}));
+ assert!(!Value::Object(p).to_string().contains("secret"));
+
+ let custom = json!({"name": "mine", "command": "/Users/me/bin/server"});
+ let (_, p) = observe(&Caller::Local, "installConnector", &custom).expect("tracked");
+ assert_eq!(p["connector"], "custom");
+ assert!(observe(&Caller::Local, "history", &json!({})).is_none());
+ }
+
+ #[test]
+ fn only_app_events_can_be_tracked_directly() {
+ assert!(Event::deserialize(&json!("app_opened")).is_ok_and(Event::client_reported));
+ assert!(!Event::deserialize(&json!("message_sent")).is_ok_and(Event::client_reported));
+ assert!(Event::deserialize(&json!("anything_else")).is_err());
+ }
+}
diff --git a/host/src/api/devices.rs b/host/src/api/devices.rs
index 2a79d92b..cccdd263 100644
--- a/host/src/api/devices.rs
+++ b/host/src/api/devices.rs
@@ -35,6 +35,9 @@ const LOCAL_ONLY: &[&str] = &[
"installHostUpdate",
"setHostAutomaticUpdates",
"setScreenEnabled",
+ // Analytics is the computer owner's choice; phones decide only for themselves.
+ "setAnalytics",
+ "track",
// Voice keys are entered on the computer itself; phones only use them.
"setVoiceKey",
"pairing",
diff --git a/host/src/api/host.rs b/host/src/api/host.rs
index ad27b189..36e71a40 100644
--- a/host/src/api/host.rs
+++ b/host/src/api/host.rs
@@ -74,6 +74,7 @@ pub(super) async fn call(hub: &Arc<Hub>, caller: &Caller, method: &str, b: Value
"backends": backends::list(),
"rev": hub.store.current_rev(),
"screen": hub.screen.state(),
+ "analytics": hub.analytics.state(),
// Shells out to `tailscale`: keep it off the async workers.
"urls": tokio::task::spawn_blocking(move || crate::service::addresses(port)).await?,
})
@@ -167,6 +168,14 @@ pub(super) async fn call(hub: &Arc<Hub>, caller: &Caller, method: &str, b: Value
hub.screen.takeover(b["on"].as_bool().unwrap_or(false));
hub.screen.state()
}
+ "setAnalytics" => {
+ hub.analytics.set_enabled(&hub.store, b["enabled"].as_bool().unwrap_or(false))?;
+ json!({"enabled": hub.analytics.state()})
+ }
+ "track" => {
+ crate::analytics::track(hub, &b)?;
+ json!({})
+ }
"setScreenEnabled" => {
hub.screen.set_enabled(&hub.store, b["enabled"].as_bool().unwrap_or(false)).await?;
hub.screen.state()
diff --git a/host/src/api/mod.rs b/host/src/api/mod.rs
index 239f9a5f..eb9e29af 100644
--- a/host/src/api/mod.rs
+++ b/host/src/api/mod.rs
@@ -55,6 +55,17 @@ fn str_arg<'a>(b: &'a Value, k: &str) -> Result<&'a str> {
/// Runs one API method for `caller` (permissions per spec §6.6).
pub async fn dispatch(hub: &Arc<Hub>, caller: &Caller, method: &str, b: Value) -> Result<Value> {
devices::permit(caller, method)?;
+ let observed = crate::analytics::observe(caller, method, &b);
+ let result = route(hub, caller, method, b).await;
+ if result.is_ok()
+ && let Some((event, properties)) = observed
+ {
+ crate::analytics::capture(hub, event, properties);
+ }
+ result
+}
+
+async fn route(hub: &Arc<Hub>, caller: &Caller, method: &str, b: Value) -> Result<Value> {
if method.contains("onnector")
|| method.starts_with("composio")
|| method == "setComposioKey"
diff --git a/host/src/hub.rs b/host/src/hub.rs
index ce4a7ac3..7c088a08 100644
--- a/host/src/hub.rs
+++ b/host/src/hub.rs
@@ -42,6 +42,7 @@ pub struct Runtime {
const MAX_REACTIONS: usize = 8;
pub struct Hub {
+ pub analytics: crate::analytics::Analytics,
pub routines: crate::routines::Routines,
pub team: crate::chat::team::Requests,
pub groups: crate::chat::group::Rooms,
@@ -84,6 +85,7 @@ impl Hub {
let (events, _) = broadcast::channel(1024);
let screen = Arc::new(Screen::new(Screen::load_enabled(&store), events.clone()));
Arc::new(Self {
+ analytics: crate::analytics::Analytics::load(&store),
routines: crate::routines::Routines::default(),
team: crate::chat::team::Requests::default(),
groups: crate::chat::group::Rooms::default(),
@@ -121,6 +123,7 @@ impl Hub {
}
}
crate::routines::start(self);
+ crate::analytics::start(self);
Ok(())
}
diff --git a/host/src/main.rs b/host/src/main.rs
index 0db7ebed..b667e3fa 100644
--- a/host/src/main.rs
+++ b/host/src/main.rs
@@ -1,6 +1,7 @@
//! `codync-host`: runs coding-agent bots over ACP and serves the Codync apps.
mod agent;
+mod analytics;
mod api;
mod chat;
mod compat;
diff --git a/host/src/remote/channel.rs b/host/src/remote/channel.rs
index c5f481fc..4259290d 100644
--- a/host/src/remote/channel.rs
+++ b/host/src/remote/channel.rs
@@ -751,7 +751,16 @@ mod tests {
assert!(hub.store.device(&p.dk()).unwrap().last_seen_at.is_some());
// Loopback-only methods are refused over the channel.
- for m in ["setScreenEnabled", "pairing", "devices", "revokeDevice", "claimSign", "computerCall"] {
+ for m in [
+ "setScreenEnabled",
+ "setAnalytics",
+ "track",
+ "pairing",
+ "devices",
+ "revokeDevice",
+ "claimSign",
+ "computerCall",
+ ] {
assert_eq!(p.call(2, m, json!({})).await["err"]["status"], 403, "{m}");
}
assert_eq!(p.call(3, "pair", json!({})).await["err"]["status"], 403);
diff --git a/host/src/tui/app/analytics.rs b/host/src/tui/app/analytics.rs
new file mode 100644
index 00000000..799548dc
--- /dev/null
+++ b/host/src/tui/app/analytics.rs
@@ -0,0 +1,96 @@
+//! Opt-in usage analytics: the one-time question, the ^k toggle and `app_opened`.
+//! The TUI only talks to the host over its loopback API, so it can always decide for this computer.
+
+use crossterm::event::{KeyCode, KeyEvent};
+use serde_json::{Value, json};
+
+use super::{After, App, Overlay};
+
+/// What a key does in the question.
+#[derive(Debug, PartialEq, Eq)]
+enum Pick {
+ /// Share (`true`) or don't.
+ Choose(bool),
+ /// Highlight this answer (`true` = Share usage).
+ Highlight(bool),
+ /// Close without answering: asked again next time.
+ Later,
+}
+
+fn pick(share: bool, code: KeyCode) -> Pick {
+ match code {
+ KeyCode::Char('y') => Pick::Choose(true),
+ KeyCode::Char('n') => Pick::Choose(false),
+ KeyCode::Enter => Pick::Choose(share),
+ KeyCode::Esc => Pick::Later,
+ KeyCode::Left | KeyCode::Char('h') => Pick::Highlight(true),
+ KeyCode::Right | KeyCode::Char('l') => Pick::Highlight(false),
+ KeyCode::Tab | KeyCode::BackTab => Pick::Highlight(!share),
+ _ => Pick::Highlight(share),
+ }
+}
+
+impl App {
+ /// Every `hello`: keep the setting; the first one of this run also reports the launch
+ /// and asks once when nobody has decided (a host without analytics has no such key).
+ pub(super) fn analytics_hello(&mut self, v: &Value) {
+ self.analytics = v["analytics"].as_bool();
+ if self.opened {
+ return;
+ }
+ self.opened = true;
+ self.call("track", json!({"event": "app_opened"}), After::Tracked);
+ if v.get("analytics").is_some_and(Value::is_null) {
+ self.overlays.push(Overlay::Consent(true));
+ }
+ }
+
+ pub(super) fn consent_key(&mut self, share: bool, k: KeyEvent) -> Option<Overlay> {
+ match pick(share, k.code) {
+ Pick::Choose(on) => {
+ self.set_analytics(on);
+ None
+ }
+ Pick::Highlight(share) => Some(Overlay::Consent(share)),
+ Pick::Later => None,
+ }
+ }
+
+ /// ^k → Share usage analytics: flips it, or asks first when it was never decided.
+ pub(super) fn toggle_analytics(&mut self) {
+ match self.analytics {
+ Some(on) => self.set_analytics(!on),
+ None => self.overlays.push(Overlay::Consent(true)),
+ }
+ }
+
+ fn set_analytics(&self, on: bool) {
+ self.call("setAnalytics", json!({"enabled": on}), After::Analytics);
+ }
+
+ pub(super) fn analytics_set(&mut self, v: &Value) {
+ self.analytics = v["enabled"].as_bool();
+ self.flash(if self.analytics == Some(true) {
+ "Sharing usage analytics"
+ } else {
+ "Not sharing usage analytics"
+ });
+ }
+}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ fn keys_choose_move_or_close() {
+ assert_eq!(pick(true, KeyCode::Char('n')), Pick::Choose(false));
+ assert_eq!(pick(false, KeyCode::Char('y')), Pick::Choose(true));
+ assert_eq!(pick(false, KeyCode::Enter), Pick::Choose(false));
+ assert_eq!(pick(true, KeyCode::Tab), Pick::Highlight(false));
+ assert_eq!(pick(true, KeyCode::Right), Pick::Highlight(false));
+ assert_eq!(pick(false, KeyCode::Left), Pick::Highlight(true));
+ assert_eq!(pick(false, KeyCode::Char('x')), Pick::Highlight(false));
+ assert_eq!(pick(true, KeyCode::Esc), Pick::Later);
+ }
+}
diff --git a/host/src/tui/app/events.rs b/host/src/tui/app/events.rs
index 74aecbf6..cfba8297 100644
--- a/host/src/tui/app/events.rs
+++ b/host/src/tui/app/events.rs
@@ -111,6 +111,7 @@ impl App {
Err(e) => {
match after {
After::Hello => self.error = Some(e),
+ After::Tracked => {}
After::History(id) => {
self.history_busy.remove(&id);
}
@@ -136,7 +137,7 @@ impl App {
}
};
match after {
- After::Nothing | After::Answered(_) | After::Sheet(_) | After::Sent(_) | After::Connection(_, _) => {}
+ After::Nothing | After::Tracked | After::Answered(_) | After::Sheet(_) | After::Sent(_) | After::Connection(_, _) => {}
After::Installed => {
self.error = None;
self.flash("Host installed; connecting…");
@@ -147,7 +148,9 @@ impl App {
v["name"].as_str().unwrap_or("computer").clone_into(&mut self.host);
v["home"].as_str().unwrap_or_default().clone_into(&mut self.home);
self.backends = v["backends"].as_array().cloned().unwrap_or_default();
+ self.analytics_hello(&v);
}
+ After::Analytics => self.analytics_set(&v),
After::Backends => {
self.backends = v["backends"].as_array().cloned().unwrap_or_default();
self.flash("Agents refreshed");
diff --git a/host/src/tui/app/mod.rs b/host/src/tui/app/mod.rs
index 74c59c39..c050318a 100644
--- a/host/src/tui/app/mod.rs
+++ b/host/src/tui/app/mod.rs
@@ -1,5 +1,6 @@
//! TUI state and everything that changes it: host events, keys, mouse, replies.
+mod analytics;
mod editor;
mod events;
mod forms;
@@ -91,6 +92,10 @@ pub struct App {
pub answering: HashMap<String, String>,
history_done: HashSet<String>,
pub hint: Option<(String, Instant)>,
+ /// Whether this computer shares usage analytics (`None`: nobody decided yet).
+ pub analytics: Option<bool>,
+ /// The first `hello` of this run was handled (`app_opened`, the analytics question).
+ opened: bool,
}
impl App {
@@ -140,6 +145,8 @@ impl App {
answering: HashMap::new(),
history_done: HashSet::new(),
hint: None,
+ analytics: None,
+ opened: false,
}
}
diff --git a/host/src/tui/app/model.rs b/host/src/tui/app/model.rs
index 8f82e831..bf4fe530 100644
--- a/host/src/tui/app/model.rs
+++ b/host/src/tui/app/model.rs
@@ -24,6 +24,9 @@ pub enum After {
Sent(String),
Connection(String, super::super::connections::Step),
Hello,
+ /// `track`: fire and forget (an older host doesn't know it).
+ Tracked,
+ Analytics,
History(String),
Thread,
Dirs,
diff --git a/host/src/tui/app/overlay_keys.rs b/host/src/tui/app/overlay_keys.rs
index e68e5339..35440ac0 100644
--- a/host/src/tui/app/overlay_keys.rs
+++ b/host/src/tui/app/overlay_keys.rs
@@ -54,6 +54,7 @@ impl App {
Action::Pair => self.open_pair(),
Action::Usage => self.overlays.push(Overlay::Usage),
Action::CheckUpdate => self.call("checkHostUpdate", json!({}), After::Update),
+ Action::Analytics => self.toggle_analytics(),
Action::Keys => self.overlays.push(Overlay::Help(Editor::default())),
}
}
@@ -106,6 +107,7 @@ impl App {
Overlay::Market(m) => self.market_key(m, k),
Overlay::Agent(a) => self.agent_key(a, k),
Overlay::Fields(f) => self.fields_key(f, k),
+ Overlay::Consent(share) => self.consent_key(share, k),
o @ (Overlay::Usage | Overlay::Pair(_)) => {
if matches!(k.code, KeyCode::Esc | KeyCode::Enter | KeyCode::Char('q' | 'U' | 'P')) {
None
diff --git a/host/src/tui/app/ui.rs b/host/src/tui/app/ui.rs
index 9fa03afc..6f5a1bee 100644
--- a/host/src/tui/app/ui.rs
+++ b/host/src/tui/app/ui.rs
@@ -52,12 +52,13 @@ pub enum Action {
Pair,
Usage,
CheckUpdate,
+ Analytics,
Keys,
}
pub const NEW_GROUP: &str = "New group chat";
-pub const ACTIONS: [(&str, &str, Action); 10] = [
+pub const ACTIONS: [(&str, &str, Action); 11] = [
("New bot…", "n", Action::NewBot),
("New group chat…", "m", Action::NewGroup),
("Marketplace: agents, connectors, skills…", "A", Action::Market),
@@ -67,6 +68,7 @@ pub const ACTIONS: [(&str, &str, Action); 10] = [
("Pair a phone…", "P", Action::Pair),
("Usage", "U", Action::Usage),
("Check for updates", "", Action::CheckUpdate),
+ ("Share usage analytics", "", Action::Analytics),
("Keys", "?", Action::Keys),
];
@@ -241,6 +243,8 @@ pub enum Overlay {
Market(Box<Market>),
Agent(AgentSetup),
Fields(Box<Fields>),
+ /// The one-time analytics question; `true` highlights Share usage.
+ Consent(bool),
}
pub struct Toast {
diff --git a/host/src/tui/view/consent.rs b/host/src/tui/view/consent.rs
new file mode 100644
index 00000000..1ed79d65
--- /dev/null
+++ b/host/src/tui/view/consent.rs
@@ -0,0 +1,32 @@
+//! The one-time usage analytics question (same copy as the phone and desktop apps).
+
+use ratatui::buffer::Buffer;
+use ratatui::layout::Rect;
+use ratatui::style::Modifier;
+use ratatui::text::Span;
+
+use super::super::md::wrap;
+use super::buffer::{centered, frame_box, put, put_line, u};
+use super::style::theme;
+
+const BODY: &str = "Codync can record which features you use on this computer, like creating a bot or \
+sending a message. It never collects your messages, code, files, prompts or bot names. Your data stays \
+private: it's used only to understand how people use Codync, never sold and never used for ads. When \
+you're signed in, it's linked to your Codync account. Turn it off anytime: ^k → Share usage analytics.";
+
+pub(super) fn consent(buf: &mut Buffer, area: Rect, share: bool) {
+ let t = theme();
+ let width: u16 = 66;
+ let lines = wrap(&[Span::styled(BODY, t.text.patch(t.panel))], usize::from(width - 4), &[], &[]);
+ let r = centered(area, width, u(lines.len() + 6));
+ let inner = frame_box(buf, r, t.text, t.panel, Some(("Help improve Codync", t.text)));
+ let mut y = inner.y;
+ for l in &lines {
+ put_line(buf, inner.x, y, inner.width, l);
+ y += 1;
+ }
+ let style = |on: bool| if on { t.sel } else { t.text.patch(t.btn) }.add_modifier(Modifier::BOLD);
+ let x = put(buf, inner.x, y + 1, 20, " y Share usage ", style(share)) + 1;
+ let x = put(buf, x, y + 1, 20, " n Don't share ", style(!share)) + 2;
+ put(buf, x, y + 1, inner.right().saturating_sub(x), "esc later", t.dim.patch(t.panel));
+}
diff --git a/host/src/tui/view/goto.rs b/host/src/tui/view/goto.rs
index a8d277fa..768f05ac 100644
--- a/host/src/tui/view/goto.rs
+++ b/host/src/tui/view/goto.rs
@@ -4,7 +4,7 @@ use ratatui::buffer::Buffer;
use ratatui::layout::Rect;
use ratatui::style::Modifier;
-use super::super::app::{ACTIONS, App, Click, FILTERS, GotoItem, Mark};
+use super::super::app::{ACTIONS, Action, App, Click, FILTERS, GotoItem, Mark};
use super::super::md::truncate;
use super::buffer::{centered, frame_box, hline, put, put_line, restyle, rput};
use super::overlay::field_line;
@@ -83,7 +83,13 @@ pub(super) fn goto(buf: &mut Buffer, area: Rect, app: &mut App, g: &super::super
}
if let Some((label, key, _)) = ACTIONS.iter().find(|x| x.2 == *a) {
put(buf, inner.x + 2, y, inner.width, label, if sel { t.bold } else { t.secondary }.patch(base));
- rput(buf, inner.right(), y, key, t.dim.patch(base));
+ let hint = match (a, app.analytics) {
+ (Action::Analytics, Some(true)) => "on",
+ (Action::Analytics, Some(false)) => "off",
+ (Action::Analytics, None) => "not set",
+ _ => key,
+ };
+ rput(buf, inner.right(), y, hint, t.dim.patch(base));
}
}
}
diff --git a/host/src/tui/view/help.rs b/host/src/tui/view/help.rs
index ca48aeb4..7a3add71 100644
--- a/host/src/tui/view/help.rs
+++ b/host/src/tui/view/help.rs
@@ -9,7 +9,7 @@ use super::buffer::{centered, frame_box, put, u};
use super::overlay::field_line;
use super::style::theme;
-const HELP: [(&str, &str, &str); 52] = [
+const HELP: [(&str, &str, &str); 53] = [
("MOVE", "j k ↑ ↓", "next / previous bot"),
("MOVE", "[ ]", "previous / next bot"),
("MOVE", "1…9", "jump to bot 1–9"),
@@ -58,6 +58,7 @@ const HELP: [(&str, &str, &str); 52] = [
("VIEW", "b", "compact roster"),
("VIEW", "U", "usage"),
("VIEW", "P", "pair a phone"),
+ ("VIEW", "^k share", "share usage analytics on / off"),
("VIEW", "esc", "close / go back"),
("VIEW", "q", "quit; bots keep going"),
("MOUSE", "click", "open, press a button"),
diff --git a/host/src/tui/view/mod.rs b/host/src/tui/view/mod.rs
index da3e8a69..d909aec0 100644
--- a/host/src/tui/view/mod.rs
+++ b/host/src/tui/view/mod.rs
@@ -8,6 +8,7 @@
mod buffer;
mod chat;
+mod consent;
mod forms;
mod goto;
mod help;
diff --git a/host/src/tui/view/overlay.rs b/host/src/tui/view/overlay.rs
index 8c446c77..0bd53b22 100644
--- a/host/src/tui/view/overlay.rs
+++ b/host/src/tui/view/overlay.rs
@@ -8,6 +8,7 @@ use ratatui::style::{Modifier, Style};
use super::super::app::{App, Editor, NEW_GROUP, Overlay, tilde};
use super::super::md::{truncate, width as w};
use super::buffer::{centered, dim_all, frame_box, put, restyle, rput, u};
+use super::consent::consent;
use super::forms::{form_view, group_view};
use super::goto::goto;
use super::help::help;
@@ -194,6 +195,7 @@ pub(super) fn overlay(buf: &mut Buffer, area: Rect, app: &mut App, top: &Overlay
Overlay::Market(m) => super::super::sheets::market(buf, area, app, m),
Overlay::Agent(a) => super::super::sheets::agent(buf, area, app, a),
Overlay::Fields(f) => super::super::sheets::fields(buf, area, f),
+ Overlay::Consent(share) => consent(buf, area, *share),
}
}
diff --git a/host/tests/fixtures/wire-shape.json b/host/tests/fixtures/wire-shape.json
index 8b23c687..38f1b5b7 100644
--- a/host/tests/fixtures/wire-shape.json
+++ b/host/tests/fixtures/wire-shape.json
@@ -154,6 +154,7 @@
"event:hello.rev": "number",
"event:hello.type": "string",
"hello": "object",
+ "hello.analytics": "null",
"hello.boxKey": "string",
"hello.cloud": "null",
"hello.computerId": "string",
diff --git a/web/app/compare/page.tsx b/web/app/compare/page.tsx
index f3ca84e0..6bd35eca 100644
--- a/web/app/compare/page.tsx
+++ b/web/app/compare/page.tsx
@@ -3,10 +3,10 @@ import { SiteFooter, SiteHeader } from "../components/site-chrome";
import CompareCards from "../components/compare-cards";
export const metadata: Metadata = {
- title: "Codync vs Grok Bot, Muse and Claude Code phone apps",
+ title: "Codync vs Grok Bot, Dots, Muse and Claude Code phone apps",
alternates: { canonical: "/compare" },
description:
- "How Codync, the 100% free and open-source way to message AI agents as bots, compares with Grok Bot, Muse and phone apps for Claude Code.",
+ "How Codync, the 100% free and open-source way to message AI agents as bots, compares with Grok Bot, Dots, Muse and phone apps for Claude Code.",
};
export default function CompareIndex() {
diff --git a/web/app/compare/rivals.ts b/web/app/compare/rivals.ts
index 942dbbb1..ffe24786 100644
--- a/web/app/compare/rivals.ts
+++ b/web/app/compare/rivals.ts
@@ -98,6 +98,36 @@ export const rivals: Rival[] = [
["Muse subscriptions", "https://www.meta.com/help/subscriptions/1021145227643680/"],
],
},
+ {
+ slug: "dots",
+ name: "Dots",
+ card: "OpenAI's always-on cloud agent, or any agent on your computer.",
+ summary:
+ "Dots are OpenAI's always-on agents: one dot per person, on GPT-6 Astra, working from its own cloud computer, with a ChatGPT Pro or Business Premium plan. Codync gives you a team of bots on your own computer that run Claude Code, Codex or any other agent you already use, for free.",
+ rows: [
+ ["Price", us.price, "Your first dot comes with ChatGPT Pro (from $100/mo) or Business Premium; deeper work draws on a plan allowance."],
+ ["Where bots run", us.runs, "On its own cloud computer and browser, run by OpenAI. It can use your laptop if you allow it."],
+ ["Agents and models", us.agents, "GPT-6 Astra. A dot can start tasks in Codex."],
+ ["Apps", us.apps, "ChatGPT on desktop, web and mobile, plus Slack and Teams."],
+ ["Your data", us.data, "In OpenAI's cloud. Personal plans can opt out of training."],
+ ["Source", us.source, "Not open source."],
+ ["Account", us.account, "Required: ChatGPT Pro or Business Premium, 18 or older, in eligible markets."],
+ ["Approvals", us.approvals, "Yes: auto-review, and Custom Rules to allow, require approval for or block actions."],
+ ["Group chats and threads", us.rooms, "One primary dot per person for now; teams of dots are planned. It joins Slack and Teams conversations."],
+ ["Memory and routines", us.memory, "Yes: memory, recurring tasks and background \"proactive research\"."],
+ ["Connected apps and tools", us.tools, "Over 4,000 apps through OpenAI plugins, and its own browser."],
+ ["Voice and screen", us.extras, "Voice calls. You can open its cloud computer to watch its work."],
+ ],
+ pickUs:
+ "you want more than one bot, on your own machine next to your files, running Claude Code, Codex or any agent you choose, without a $100 a month plan.",
+ pickThem: "you already pay for ChatGPT Pro or Business Premium and want one always-on assistant in OpenAI's cloud that also works in Slack and Teams.",
+ checked: "October 7, 2026",
+ sources: [
+ ["Introducing dots (OpenAI)", "https://openai.com/index/introducing-dots/"],
+ ["Getting started with your dot", "https://help.openai.com/en/articles/20001530-getting-started-with-your-dot"],
+ ["ChatGPT pricing", "https://chatgpt.com/pricing"],
+ ],
+ },
{
slug: "claude-remote-control",
name: "Claude Remote Control",
diff --git a/web/app/privacy/page.tsx b/web/app/privacy/page.tsx
index f28e2cb8..076099a7 100644
--- a/web/app/privacy/page.tsx
+++ b/web/app/privacy/page.tsx
@@ -8,7 +8,7 @@ export default function Privacy() {
<main className="flex-1 flex flex-col items-center px-6 py-16">
<article className="max-w-2xl w-full space-y-6">
<h1 className="text-3xl font-bold text-white">Privacy Policy</h1>
- <p className="text-neutral-400 text-sm">Last updated: October 4, 2026</p>
+ <p className="text-neutral-400 text-sm">Last updated: October 7, 2026</p>
<Section title="Overview">
Codync lets you message the AI agents that run on your own computer. It is built so that your files, conversations and credentials stay on your devices.
@@ -28,20 +28,30 @@ export default function Privacy() {
</Section>
<Section title="Data we collect">
- None. Codync has no analytics, no tracking and no advertising identifiers.
+ <p className="mb-2">
+ Only usage analytics, and only if you say yes. Each iPhone and each computer asks once; you can change your answer anytime in Settings. Until you agree, nothing is sent.
+ </p>
+ <ul className="list-disc pl-5 space-y-2">
+ <li><strong>What we record:</strong> which features you use, such as opening the app, creating or deleting a bot, sending a message (with the number of attachments, not the files), starting a routine or a voice call, and installing a connector from the catalog. Each event carries the app version, the platform and the agent and model a bot uses.</li>
+ <li><strong>What we never record:</strong> your messages, prompts, code, files, file names or paths, bot names, credentials or anything your agents produce. We don&apos;t store your IP address or location.</li>
+ <li><strong>Who it&apos;s linked to:</strong> your Codync account when you&apos;re signed in; otherwise a random ID created on that device.</li>
+ <li><strong>Why:</strong> only to understand how people use Codync and improve it. It is never sold, never shared for advertising and never used to track you across other apps or websites.</li>
+ </ul>
+ <p className="mt-2">Codync has no advertising identifiers.</p>
</Section>
<Section title="Third-party services">
<ul className="list-disc pl-5 space-y-2">
<li><strong>Apple Push Notification service</strong>: delivers notifications and Live Activity updates.</li>
<li><strong>Cloudflare Workers</strong>: runs the push relay (nothing stored).</li>
+ <li><strong>PostHog (US)</strong>: stores the usage analytics described above, only if you agreed to share them.</li>
<li><strong>The AI agents you choose</strong>: they run on your computer under their own terms and privacy policies.</li>
<li><strong>OpenAI or Google (optional, voice calls)</strong>: only if you add your own OpenAI or Gemini API key in a call&apos;s settings. Your voice then goes from your iPhone or Mac directly to that provider, under your account and its privacy policy, together with the bot&apos;s name and description and the chat messages it asks for during the call. The key is stored encrypted on your computer, which uses it only to start calls and list models. Without a key, voice calls use Apple speech recognition on your device.</li>
</ul>
</Section>
<Section title="Data retention">
- Everything lives on your devices. Delete a bot to remove its conversation; uninstall the host and delete <code>~/.codync</code> to remove all of it. Deleting the iPhone app removes its cache.
+ Everything lives on your devices. Delete a bot to remove its conversation; uninstall the host and delete <code>~/.codync</code> to remove all of it. Deleting the iPhone app removes its cache. Turning analytics off stops new events from being sent.
</Section>
<Section title="Children's privacy">