Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions apps/mobile/app/(tabs)/(home)/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
quietChannels,
type ConnectedHost,
} from '../../../src/host/host-session';
import { prefetchInbox } from '../../../src/host/inbox';
import { prefetchInbox } from '@botharness/host-client/inbox';
import { useMessageSearch, type MessageSearchHit } from '../../../src/host/message-search';
import { hostLooks, useHostLook } from '../../../src/host/native-host-look';
import { cloudClient, useCloudSnapshot } from '../../../src/cloud/native';
Expand Down Expand Up @@ -49,7 +49,7 @@ import {
computerEnvironmentKey,
cloudEnvironmentKey,
} from '../../../src/host/conversation-environments';
import { shownHostName } from '../../../src/ui/design/host-look';
import { shownHostName } from '@botharness/host-client/ui/design/host-look';
import { Text } from '../../../src/ui/primitives/text';
import { Button } from '../../../src/ui/primitives/button';
import { HeaderAction } from '../../../src/ui/shell/header-action';
Expand All @@ -61,7 +61,7 @@ import { LastChatPreview, LastChatSwipe } from '../../../src/ui/shell/last-chat-
import { useWorkspacePanel } from '../../../src/ui/shell/use-workspace-panel';
import { recentHostIds, useRecentChats } from '../../../src/ui/shell/recent-chats';
import { tobComputer, tobModeHostId, tobModeHref } from '../../../src/ui/shell/tob-mode-model';
import { recordFeature } from '../../../src/telemetry/features';
import { recordFeature } from '@botharness/host-client/telemetry/features';
import {
chatsSearchResults,
messageSearchResults,
Expand Down Expand Up @@ -93,7 +93,7 @@ type MessageItem = {
conversation: Conversation;
};
type HomeItem = EnvironmentChatItem | { type: 'message-heading'; key: string } | MessageItem;
import type { ConnectionState } from '../../../src/host/client';
import type { ConnectionState } from '@botharness/host-client/client';
import { sectionCollapse, useCollapsedSections } from '../../../src/host/native-section-collapse';

const quickRetryMs = 2_000;
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/app/(tabs)/(settings)/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useCallback, useMemo } from 'react';

import { accountProfile } from '../../../src/account/native-account-profile';
import { useHostSession } from '../../../src/host/host-session';
import { loadUsage } from '../../../src/host/usage';
import { loadUsage } from '@botharness/host-client/usage';
import { appBuildLabel } from '../../../src/ui/app-build';
import { copyMessage } from '../../../src/ui/chat/message-menu';
import { currentAppBuild } from '../../../src/ui/native-app-build';
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/app/+native-intent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as SecureStore from 'expo-secure-store';
import { cloudAvailable } from '../src/cloud/available';
import { cloudNativeIntent } from '../src/cloud/native-intent';
import { parseInvitationLink } from '../src/cloud/invitation-link';
import { isConnectOAuthCallback } from '../src/host/connect-account';
import { isConnectOAuthCallback } from '@botharness/host-client/connect-account';
import { callLinkRedirect } from '../src/ui/chat/call-link';
import { isSharePath } from '../src/ui/share/share-path';
export async function redirectSystemPath({ path }: { path: string; initial: boolean }) {
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import { useSystemReducedMotion } from '../src/ui/primitives/use-system-reduced-
import { profileScreenOptions } from '../src/ui/chat/profile-presentation';
import { CallSessionHost } from '../src/ui/chat/call-session-host';
import { swipeEntryListeners, swipeEntryOptions } from '../src/ui/shell/swipe-entry';
import { installMediaStore, runAutoCleanup } from '../src/host/media-cache';
import { installMediaStore, runAutoCleanup } from '@botharness/host-client/media-cache';
import { nativeMediaStore } from '../src/host/native-media-store';
import { installPurgeTargets } from '../src/host/purge-caches';
import { installHostStoreOpener, retryHostStoreDeletes } from '../src/host/host-store';
Expand Down
7 changes: 5 additions & 2 deletions apps/mobile/app/browser/[slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import { Keyboard, Pressable, View, type ViewInstance, type TextInputInstance }
import { GestureHandlerRootView } from 'react-native-gesture-handler';
import { useSafeAreaInsets } from 'react-native-safe-area-context';

import { createBrowserViewer, type BrowserViewerState } from '../../src/host/browser-viewer';
import {
createBrowserViewer,
type BrowserViewerState,
} from '@botharness/host-client/browser-viewer';
import { useHostSession, useHostSnapshot } from '../../src/host/host-session';
import { BrowserStage, type BrowserTouchMode } from '../../src/ui/chat/browser-stage';
import { edge, radius, space } from '../../src/ui/design/tokens';
Expand All @@ -16,7 +19,7 @@ import { Text } from '../../src/ui/primitives/text';
import { KeyboardIcon } from '../../src/ui/shell/icons';
import { viewerHeaderOptions } from '../../src/ui/shell/viewer-header';
import { useMounted } from '../../src/ui/mounted';
import { recordFeature } from '../../src/telemetry/features';
import { recordFeature } from '@botharness/host-client/telemetry/features';
import { useStrings } from '../../src/ui/strings';
import { LoadingIndicator } from '../../src/ui/primitives/loading-indicator';

Expand Down
6 changes: 3 additions & 3 deletions apps/mobile/app/computer/[slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { GestureHandlerRootView } from 'react-native-gesture-handler';
import { useSharedValue } from 'react-native-reanimated';
import { useSafeAreaInsets } from 'react-native-safe-area-context';

import type { BrowserInput } from '../../src/host/browser-viewer';
import type { BrowserInput } from '@botharness/host-client/browser-viewer';
import {
addedText,
COMPUTER_KEYS,
Expand All @@ -17,7 +17,7 @@ import {
wheelInput,
type ComputerModifier,
type ComputerViewerState,
} from '../../src/host/computer-viewer';
} from '@botharness/host-client/computer-viewer';
import { useHostSession, useHostSnapshot } from '../../src/host/host-session';
import { BrowserStage, type BrowserTouchMode } from '../../src/ui/chat/browser-stage';
import {
Expand All @@ -32,7 +32,7 @@ import { Button } from '../../src/ui/primitives/button';
import { Text } from '../../src/ui/primitives/text';
import { viewerHeaderOptions } from '../../src/ui/shell/viewer-header';
import { useMounted } from '../../src/ui/mounted';
import { recordFeature } from '../../src/telemetry/features';
import { recordFeature } from '@botharness/host-client/telemetry/features';
import { useStrings } from '../../src/ui/strings';
import { LoadingIndicator } from '../../src/ui/primitives/loading-indicator';
import { LocalComputerScreen } from '../../src/ui/chat/local-computer-screen';
Expand Down
7 changes: 6 additions & 1 deletion apps/mobile/app/host-connection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ import { useLocalSearchParams, useRouter } from 'expo-router';
import * as Clipboard from 'expo-clipboard';
import { installedAppVersion } from '../src/host/app-version';
import { useHostSession, useHostSnapshot } from '../src/host/host-session';
import { isConnectRoute, isLanRoute, isLoopbackRoute, isTailscaleRoute } from '../src/host/route';
import {
isConnectRoute,
isLanRoute,
isLoopbackRoute,
isTailscaleRoute,
} from '@botharness/host-protocol/route';
import { SHEET_GROUP } from '../src/ui/chat/sheet';
import { space } from '../src/ui/design/tokens';
import { SheetHeader } from '../src/ui/primitives/sheet-header';
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/app/inbox/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
loadQuestion,
type ApprovalChoice,
type RequestRef,
} from '../../src/host/requests';
} from '@botharness/host-client/requests';
import { ApprovalView } from '../../src/ui/approval-view';
import { ATTENTION_KINDS, AttentionItemView } from '../../src/ui/attention-item';
import { GrantRequestCard } from '../../src/ui/chat/grant-request-card';
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/app/member-pairing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { View } from 'react-native';
import Svg, { Path } from 'react-native-svg';

import { useHostSession } from '../src/host/host-session';
import { memberPairingOffer, type MemberPairingOffer } from '../src/host/team-client';
import { memberPairingOffer, type MemberPairingOffer } from '@botharness/host-client/team-client';
import { qrCode, radius, space } from '../src/ui/design/tokens';
import { useMounted } from '../src/ui/mounted';
import { Button } from '../src/ui/primitives/button';
Expand Down
4 changes: 2 additions & 2 deletions apps/mobile/app/pair/account.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { ConnectionDiagnostic } from '../../src/host/connection-diagnostic';
import type { ConnectionDiagnostic } from '@botharness/host-client/connection-diagnostic';
import { Stack, useFocusEffect, useLocalSearchParams } from 'expo-router';
import { useCallback, useRef, useState } from 'react';
import { View } from 'react-native';
import { pairAccountSelection } from '../../src/host/account-pairing';
import type { ConnectHost } from '../../src/host/connect-account';
import type { ConnectHost } from '@botharness/host-client/connect-account';
import { useHostSession } from '../../src/host/host-session';
import { connectAccount } from '../../src/host/native-connect-account';
import { AccountHosts } from '../../src/ui/account-hosts';
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/app/pair/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useCallback, useRef, useState } from 'react';
import { Linking, ScrollView } from 'react-native';

import { cloudAvailable } from '../../src/cloud/available';
import { pairingLinkMode } from '../../src/host/pairing';
import { pairingLinkMode } from '@botharness/host-client/pairing';
import { SHEET_GROUP } from '../../src/ui/chat/sheet';
import { useDesignTheme } from '../../src/ui/design/theme';
import { space } from '../../src/ui/design/tokens';
Expand Down
4 changes: 2 additions & 2 deletions apps/mobile/app/pair/tailscale.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { useCallback, useRef, useState } from 'react';
import { Pressable, View, useWindowDimensions } from 'react-native';

import { readPairingImage, type PairingImageResult } from '../../src/host/pairing-image';
import type { PairingMethod } from '../../src/telemetry/schema';
import { HOST_NAME_MAX } from '../../src/ui/design/host-look';
import type { PairingMethod } from '@botharness/host-client/telemetry/schema';
import { HOST_NAME_MAX } from '@botharness/host-client/ui/design/host-look';
import { useDesignTheme } from '../../src/ui/design/theme';
import { pairingScan, radius, space } from '../../src/ui/design/tokens';
import { clearsPastedLink } from '../../src/ui/pairing-failure';
Expand Down
9 changes: 5 additions & 4 deletions apps/mobile/app/pair/team.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
import { showAppDialog } from '../../src/ui/primitives/app-dialog';
import Constants from 'expo-constants';
import { useLocalSearchParams, useRouter } from 'expo-router';
import { useRef, useState } from 'react';
import { Alert, Platform, View } from 'react-native';
import { Platform, View } from 'react-native';

import { hostSession } from '../../src/host/host-session';
import type { SavedHost } from '../../src/host/hosts';
import type { SavedHost } from '@botharness/host-client/hosts';
import { nativeCarrier } from '../../src/host/native-carrier';
import {
changeTeamDevicePassword,
parseTeamInvitation,
signInTeamDevice,
type TeamErrorCode,
type TeamInvitation,
} from '../../src/host/team-client';
} from '@botharness/host-client/team-client';
import { space } from '../../src/ui/design/tokens';
import { Button } from '../../src/ui/primitives/button';
import { KeyboardFormScroll } from '../../src/ui/primitives/keyboard-form';
Expand Down Expand Up @@ -63,7 +64,7 @@ export default function TeamSignInScreen() {
let result = await hostSession.pairMember(host);
if (!result.ok && result.code === 'identity-switch-required') {
const confirmed = await new Promise<boolean>((resolve) =>
Alert.alert(
showAppDialog(
t.teamSignIn.switchTitle,
t.teamSignIn.switchBody.replace('{name}', host.member?.displayName ?? ''),
[
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/app/qa/account-actions.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
connectionDiagnostic,
type ConnectionDiagnostic,
} from '../../src/host/connection-diagnostic';
} from '@botharness/host-client/connection-diagnostic';
import type { AccountPairResult } from '../../src/ui/primitives/account-panel';
import * as Application from 'expo-application';
import { Redirect, Stack, useLocalSearchParams } from 'expo-router';
Expand Down
4 changes: 2 additions & 2 deletions apps/mobile/app/settings/storage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
mediaUsage,
previewMediaEviction,
setAutoCleanup,
} from '../../src/host/media-cache';
} from '@botharness/host-client/media-cache';
import { hostStoreAvailable, hostStoreSize } from '../../src/host/host-store';
import { clearHostConversations } from '../../src/host/native-conversations';
import { forgetSharedCopies } from '../../src/host/share-attachment';
Expand All @@ -19,7 +19,7 @@ import {
loadStorageUsage,
previewStorageCleanup,
previewStorageMessages,
} from '../../src/host/storage';
} from '@botharness/host-client/storage';
import { StorageSettings, type StorageSettingsPort } from '../../src/ui/storage-settings';
import { useStrings } from '../../src/ui/strings';

Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/app/settings/usage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
loadMoreMemoryActivity,
loadMoreUsage,
loadUsage,
} from '../../src/host/usage';
} from '@botharness/host-client/usage';
import { UsageView, type UsageSources } from '../../src/ui/usage-view';

export default function UsageScreen() {
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/app/sign-in.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useRouter } from 'expo-router';
import { useRef, useState } from 'react';
import { Platform, View, type ViewInstance } from 'react-native';

import type { EmailCodeOutcome } from '../src/host/connect-account';
import type { EmailCodeOutcome } from '@botharness/host-client/connect-account';
import { takeEmailCodeSignIn } from '../src/host/email-code-bridge';
import { EmailCodeSignIn } from '../src/ui/account/email-code-sign-in';
import { useMounted } from '../src/ui/mounted';
Expand Down
2 changes: 2 additions & 0 deletions apps/mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
"generate:genui-runtime": "node scripts/generate-genui-runtime.mjs"
},
"dependencies": {
"@botharness/host-client": "workspace:*",
"@botharness/host-protocol": "workspace:*",
"@botharness/pixel-banner": "0.1.0",
"@expo/metro-runtime": "~58.0.17",
"@expo/ui": "~58.0.28",
Expand Down
4 changes: 3 additions & 1 deletion apps/mobile/scripts/generate-palette.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import { createRequire } from 'node:module';
import { fileURLToPath } from 'node:url';

const root = new URL('../../../', import.meta.url);
const OUTPUT = fileURLToPath(new URL('apps/mobile/src/ui/design/palette.generated.ts', root));
const OUTPUT = fileURLToPath(
new URL('packages/host-client/src/ui/design/palette.generated.ts', root),
);

export const ROLES = {
fg: 'alias-label-primary',
Expand Down
4 changes: 2 additions & 2 deletions apps/mobile/scripts/web-preview/host-look.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useCallback, useSyncExternalStore } from 'react';

import { createHostLooks } from '../../src/host/host-look';
import type { HostLook } from '../../src/ui/design/host-look';
import { createHostLooks } from '@botharness/host-client/host-look';
import type { HostLook } from '@botharness/host-client/ui/design/host-look';

const KEY = 'deepseekbot-host-looks';

Expand Down
4 changes: 2 additions & 2 deletions apps/mobile/scripts/web-preview/notification-preferences.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createDeviceNotificationPreferences } from '../../src/host/device-notification-preferences';
import { createDeviceNotificationPreferences } from '@botharness/host-client/device-notification-preferences';
import { nativeCarrier } from '../../src/host/native-carrier';
import { createHostPush } from '../../src/host/push';
import { createHostPush } from '@botharness/host-client/push';

const key = 'deepseekbot.notification-preferences.v1';

Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/src/account/account-profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type {
MarketplaceClient,
MarketplaceResult,
} from '../../../../packages/core/src/marketplace/client';
import type { ConnectResult } from '../host/connect-account';
import type { ConnectResult } from '@botharness/host-client/connect-account';

export const ACCOUNT_NAME_MAX = 40;

Expand Down
6 changes: 3 additions & 3 deletions apps/mobile/src/host/account-action-fixture.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createConnectAccount } from './connect-account';
import { createConnectAccount } from '@botharness/host-client/connect-account';
import { removeAccountConnections } from './account-connections';
import type { AccountOwner } from './account-owner';
import { parseSavedHosts, type SavedHost, type SavedHosts } from './hosts';
import type { AccountOwner } from '@botharness/host-client/account-owner';
import { parseSavedHosts, type SavedHost, type SavedHosts } from '@botharness/host-client/hosts';

export type AccountFixtureScenario =
| 'connection-diagnostics'
Expand Down
4 changes: 2 additions & 2 deletions apps/mobile/src/host/account-connections.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { sameAccount, type AccountOwner } from './account-owner';
import { withoutHost, type SavedHost, type SavedHosts } from './hosts';
import { sameAccount, type AccountOwner } from '@botharness/host-client/account-owner';
import { withoutHost, type SavedHost, type SavedHosts } from '@botharness/host-client/hosts';

export async function removeAccountConnections(options: {
owner: AccountOwner;
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/src/host/account-host-look.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ConnectHost } from './connect-account';
import type { ConnectHost } from '@botharness/host-client/connect-account';

export function accountHostLookId(connectHost: string): string {
return `connect-host:${connectHost.toLowerCase()}`;
Expand Down
6 changes: 3 additions & 3 deletions apps/mobile/src/host/account-pairing.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ConnectHost } from './connect-account';
import type { SavedHost } from './hosts';
import type { PairingFailure } from './pairing';
import type { ConnectHost } from '@botharness/host-client/connect-account';
import type { SavedHost } from '@botharness/host-client/hosts';
import type { PairingFailure } from '@botharness/host-client/pairing';

export function accountHostAdded(host: ConnectHost, saved: readonly SavedHost[]): boolean {
return saved.some(
Expand Down
4 changes: 2 additions & 2 deletions apps/mobile/src/host/activity-count.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Inbox } from './inbox';
import type { HumanAttentionPage } from './wire';
import type { Inbox } from '@botharness/host-client/inbox';
import type { HumanAttentionPage } from '@botharness/host-protocol/wire';

export const ACTIVITY_COUNT_KINDS = [
'approvals',
Expand Down
16 changes: 11 additions & 5 deletions apps/mobile/src/host/activity-sources.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import type { HostLook } from '../ui/design/host-look';
import { t } from '../ui/strings';
import type { HostLook } from '@botharness/host-client/ui/design/host-look';
import { observeActivityCount, type createActivityCountPreferences } from './activity-count';
import type { HostClient, HostSnapshot } from './client';
import type { HostClient, HostSnapshot } from '@botharness/host-client/client';
import {
INBOX_SECTIONS,
observeInbox,
type Inbox,
type InboxQuery,
type InboxSnapshot,
type InboxSection,
} from './inbox';
import type { HumanAttentionItem } from './wire';
} from '@botharness/host-client/inbox';
import type { HumanAttentionItem } from '@botharness/host-protocol/wire';

export interface ActivitySource {
hostId: string;
Expand Down Expand Up @@ -56,7 +57,12 @@ export function observeActivitySources(sources: readonly ActivitySource[], query
: [
{
source,
observer: observeInbox(source.client, { ...query, botSlug, channelId }),
observer: observeInbox(source.client, {
...query,
botSlug,
channelId,
activityUpdateHost: () => t.activityUpdateHost,
}),
},
];
});
Expand Down
4 changes: 2 additions & 2 deletions apps/mobile/src/host/approval-records.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { HostClient } from './client';
import { HostAnswerInvalid } from './bot-settings';
import type { HostClient } from '@botharness/host-client/client';
import { HostAnswerInvalid } from '@botharness/host-client/bot-settings';

export type ApprovalOutcome =
| 'allowed-once'
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/src/host/assignment-timeline.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { HostClient } from './client';
import type { HostClient } from '@botharness/host-client/client';
import type { ProfileAssignment } from './bot-profile';

export type AssignmentTimelineStatus = 'running' | 'done' | 'failed' | 'denied' | 'cancelled';
Expand Down
4 changes: 2 additions & 2 deletions apps/mobile/src/host/bot-access.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { HostAnswerInvalid } from './bot-settings';
import type { HostClient, RosterBot } from './client';
import { HostAnswerInvalid } from '@botharness/host-client/bot-settings';
import type { HostClient, RosterBot } from '@botharness/host-client/client';

export type BotAccessKind = 'browser' | 'computer';

Expand Down
Loading
Loading