From 6ce2b98ed878b1c14685000cabb6a873869f9795 Mon Sep 17 00:00:00 2001 From: DoodleBear Date: Mon, 16 Nov 2026 07:29:35 +0900 Subject: [PATCH 1/6] refactor: share Host protocol and client workspace packages Issue: #4201 Agent-Task: codex/local/01a1e112-8bdc-7472-b4a5-e7a2c592ecb7 Co-Authored-By: Codex --- .../docs-zh/docs/private-named-tunnel.mdx | 66 ++++++ .../content/docs-zh/docs/private-relay.mdx | 78 +++++++ .../docs/docs/private-named-tunnel.mdx | 66 ++++++ .../src/content/docs/docs/private-relay.mdx | 78 +++++++ apps/mobile/app/(tabs)/(home)/index.tsx | 8 +- .../mobile/app/(tabs)/(settings)/settings.tsx | 2 +- apps/mobile/app/+native-intent.tsx | 2 +- apps/mobile/app/_layout.tsx | 2 +- apps/mobile/app/browser/[slug].tsx | 7 +- apps/mobile/app/computer/[slug].tsx | 6 +- apps/mobile/app/host-connection.tsx | 7 +- apps/mobile/app/inbox/[id].tsx | 2 +- apps/mobile/app/member-pairing.tsx | 2 +- apps/mobile/app/pair/account.tsx | 4 +- apps/mobile/app/pair/index.tsx | 2 +- apps/mobile/app/pair/tailscale.tsx | 4 +- apps/mobile/app/pair/team.tsx | 9 +- apps/mobile/app/qa/account-actions.tsx | 2 +- apps/mobile/app/settings/storage.tsx | 4 +- apps/mobile/app/settings/usage.tsx | 2 +- apps/mobile/app/sign-in.tsx | 2 +- apps/mobile/package.json | 2 + apps/mobile/scripts/generate-palette.mjs | 4 +- apps/mobile/scripts/web-preview/host-look.ts | 4 +- .../web-preview/notification-preferences.ts | 4 +- apps/mobile/src/account/account-profile.ts | 2 +- .../mobile/src/host/account-action-fixture.ts | 6 +- apps/mobile/src/host/account-connections.ts | 4 +- apps/mobile/src/host/account-host-look.ts | 2 +- apps/mobile/src/host/account-pairing.ts | 6 +- apps/mobile/src/host/activity-count.ts | 4 +- apps/mobile/src/host/activity-sources.ts | 16 +- apps/mobile/src/host/approval-records.ts | 4 +- apps/mobile/src/host/assignment-timeline.ts | 2 +- apps/mobile/src/host/bot-access.ts | 4 +- apps/mobile/src/host/bot-activity.ts | 4 +- apps/mobile/src/host/bot-avatar.ts | 2 +- apps/mobile/src/host/bot-creation-entry.ts | 2 +- .../src/host/bot-creation-navigation.ts | 2 +- apps/mobile/src/host/bot-creation-steps.ts | 2 +- apps/mobile/src/host/bot-inbox.ts | 4 +- apps/mobile/src/host/bot-name.ts | 2 +- apps/mobile/src/host/bot-profile.ts | 9 +- apps/mobile/src/host/call-post.ts | 2 +- apps/mobile/src/host/call-test-diagnostics.ts | 2 +- apps/mobile/src/host/catch-up.ts | 4 +- .../src/host/channel-creation-transport.ts | 6 +- apps/mobile/src/host/channel-creation.ts | 2 +- apps/mobile/src/host/channel-files.ts | 6 +- apps/mobile/src/host/connect-follow.ts | 6 +- apps/mobile/src/host/connection-summary.ts | 4 +- .../src/host/conversation-environments.ts | 2 +- apps/mobile/src/host/conversation-playback.ts | 6 +- apps/mobile/src/host/deletion.ts | 2 +- apps/mobile/src/host/delivery-receipt.ts | 4 +- apps/mobile/src/host/device-alerts.ts | 4 +- apps/mobile/src/host/direct-channel.ts | 2 +- apps/mobile/src/host/dm-activity.ts | 2 +- apps/mobile/src/host/email-code-bridge.ts | 2 +- apps/mobile/src/host/group-channel.ts | 7 +- apps/mobile/src/host/host-availability.ts | 2 +- apps/mobile/src/host/host-dictation.ts | 2 +- apps/mobile/src/host/host-glance.ts | 8 +- apps/mobile/src/host/host-session.ts | 46 ++-- apps/mobile/src/host/host-store.ts | 2 +- apps/mobile/src/host/human.ts | 2 +- apps/mobile/src/host/live-activity-session.ts | 4 +- .../src/host/local-conversation-cache.ts | 6 +- apps/mobile/src/host/local-message-search.ts | 4 +- apps/mobile/src/host/local-video-actions.ts | 2 +- apps/mobile/src/host/local-video-pointer.ts | 7 +- apps/mobile/src/host/memory-changes.ts | 2 +- apps/mobile/src/host/memory-edit.ts | 2 +- apps/mobile/src/host/memory-preview.ts | 4 +- apps/mobile/src/host/message-display.ts | 4 +- apps/mobile/src/host/message-feedback.ts | 2 +- apps/mobile/src/host/message-search.ts | 2 +- .../src/host/native-activity-sources.ts | 2 +- .../src/host/native-background-catch-up.ts | 2 +- apps/mobile/src/host/native-bot-creation.ts | 4 +- apps/mobile/src/host/native-cache.ts | 2 +- apps/mobile/src/host/native-carrier.ts | 9 +- .../mobile/src/host/native-connect-account.ts | 7 +- .../host/native-connection-mode.android.ts | 2 +- apps/mobile/src/host/native-conversations.ts | 2 +- apps/mobile/src/host/native-host-look.ts | 4 +- apps/mobile/src/host/native-lan-socket.ts | 8 +- apps/mobile/src/host/native-live-activity.ts | 2 +- apps/mobile/src/host/native-local-store.ts | 7 +- apps/mobile/src/host/native-media-store.ts | 2 +- .../host/native-notification-preferences.ts | 4 +- apps/mobile/src/host/native-purge-targets.ts | 2 +- apps/mobile/src/host/native-push-decide.ts | 10 +- .../mobile/src/host/native-zip-import-file.ts | 4 +- .../src/host/noise-key-agreement.android.ts | 2 +- apps/mobile/src/host/noise-key-agreement.ts | 2 +- apps/mobile/src/host/notification-avatars.ts | 2 +- apps/mobile/src/host/pick-files.ts | 2 +- apps/mobile/src/host/private-input.ts | 4 +- apps/mobile/src/host/purge-caches.ts | 2 +- apps/mobile/src/host/push-actions.ts | 8 +- apps/mobile/src/host/push-answer.ts | 4 +- apps/mobile/src/host/push-resolve.ts | 2 +- apps/mobile/src/host/push-routing.ts | 8 +- apps/mobile/src/host/push-session.ts | 6 +- apps/mobile/src/host/routines.ts | 8 +- apps/mobile/src/host/saved-host.ts | 6 +- apps/mobile/src/host/saved-host.web.ts | 10 +- apps/mobile/src/host/session-stop.ts | 4 +- apps/mobile/src/host/share-attachment.ts | 4 +- apps/mobile/src/host/speech.ts | 2 +- apps/mobile/src/host/watch-account-hosts.ts | 4 +- .../src/marketplace/import-selection.ts | 2 +- apps/mobile/src/telemetry/native.ts | 8 +- apps/mobile/src/telemetry/posthog-sender.ts | 2 +- apps/mobile/src/ui/account-hosts.tsx | 10 +- .../src/ui/account/email-code-sign-in.tsx | 2 +- .../src/ui/account/sign-in-brand-button.tsx | 2 +- apps/mobile/src/ui/approval-note.ts | 2 +- apps/mobile/src/ui/approval-view.tsx | 2 +- apps/mobile/src/ui/attention-item.tsx | 6 +- apps/mobile/src/ui/attention-view.tsx | 2 +- apps/mobile/src/ui/bot-avatar.tsx | 2 +- apps/mobile/src/ui/bot-color.ts | 2 +- apps/mobile/src/ui/channel-notifications.tsx | 2 +- apps/mobile/src/ui/chat/activity-detail.tsx | 4 +- apps/mobile/src/ui/chat/activity-glance.tsx | 4 +- apps/mobile/src/ui/chat/activity-row.tsx | 6 +- apps/mobile/src/ui/chat/activity-text.ts | 6 +- apps/mobile/src/ui/chat/approval-card.tsx | 8 +- .../src/ui/chat/approval-diff.android.tsx | 2 +- apps/mobile/src/ui/chat/approval-diff.tsx | 2 +- .../src/ui/chat/approval-records-text.ts | 2 +- apps/mobile/src/ui/chat/approval-records.tsx | 4 +- apps/mobile/src/ui/chat/assignment-screen.tsx | 6 +- .../src/ui/chat/attachment-file-tile.tsx | 2 +- apps/mobile/src/ui/chat/avatar-editor.tsx | 2 +- apps/mobile/src/ui/chat/bot-access-screen.tsx | 4 +- apps/mobile/src/ui/chat/bot-inbox-screen.tsx | 4 +- apps/mobile/src/ui/chat/bot-name-setting.tsx | 2 +- apps/mobile/src/ui/chat/bot-permissions.tsx | 4 +- apps/mobile/src/ui/chat/bot-profile.tsx | 4 +- .../mobile/src/ui/chat/bot-settings-panel.tsx | 4 +- .../src/ui/chat/bot-settings-screen.tsx | 2 +- apps/mobile/src/ui/chat/bot-steps.ts | 2 +- apps/mobile/src/ui/chat/bot-tone.ts | 2 +- apps/mobile/src/ui/chat/browser-stage.tsx | 2 +- apps/mobile/src/ui/chat/call-button.ts | 2 +- apps/mobile/src/ui/chat/call-session-host.tsx | 2 +- .../src/ui/chat/channel-details-screen.tsx | 2 +- .../src/ui/chat/channel-files-screen.tsx | 4 +- apps/mobile/src/ui/chat/channel-files-tab.tsx | 2 +- apps/mobile/src/ui/chat/channel-media.tsx | 2 +- apps/mobile/src/ui/chat/channel-title.tsx | 2 +- apps/mobile/src/ui/chat/channel-viewport.ts | 2 +- apps/mobile/src/ui/chat/chat-title.tsx | 2 +- apps/mobile/src/ui/chat/composer-context.ts | 2 +- apps/mobile/src/ui/chat/composer-labels.ts | 2 +- .../src/ui/chat/computer-click-ripple.tsx | 2 +- apps/mobile/src/ui/chat/computer-controls.tsx | 6 +- .../ui/chat/computer-video-header.android.tsx | 2 +- .../src/ui/chat/computer-video-keyboard.tsx | 2 +- .../src/ui/chat/computer-video-stage.tsx | 2 +- .../src/ui/chat/computer-video-status.ts | 2 +- .../src/ui/chat/conversation-actions.ts | 4 +- apps/mobile/src/ui/chat/conversation-menu.ts | 2 +- apps/mobile/src/ui/chat/conversation-row.tsx | 2 +- .../src/ui/chat/conversation-screen.tsx | 14 +- .../ui/chat/conversation-section-sheet.tsx | 2 +- .../src/ui/chat/conversation-sections.ts | 2 +- .../src/ui/chat/conversation-top-bar.tsx | 2 +- apps/mobile/src/ui/chat/conversations.ts | 8 +- apps/mobile/src/ui/chat/delivery-sheet.tsx | 2 +- apps/mobile/src/ui/chat/delivery-stack.tsx | 4 +- .../src/ui/chat/folder-picker-sheet.tsx | 2 +- apps/mobile/src/ui/chat/follow-latest.ts | 2 +- .../src/ui/chat/genui-document-card.tsx | 4 +- apps/mobile/src/ui/chat/genui-view-client.ts | 4 +- .../mobile/src/ui/chat/grant-request-card.tsx | 4 +- apps/mobile/src/ui/chat/group-info.tsx | 4 +- apps/mobile/src/ui/chat/header-bot-stack.tsx | 2 +- apps/mobile/src/ui/chat/header-status.ts | 2 +- .../src/ui/chat/host-conversation-row.tsx | 2 +- apps/mobile/src/ui/chat/image-viewer.tsx | 2 +- apps/mobile/src/ui/chat/invite-selection.ts | 4 +- apps/mobile/src/ui/chat/invite-sheet.tsx | 2 +- .../ui/chat/local-computer-screen.android.tsx | 2 +- .../src/ui/chat/local-computer-screen.ios.tsx | 4 +- apps/mobile/src/ui/chat/local-video-notice.ts | 2 +- .../src/ui/chat/managed-conversation-row.tsx | 6 +- apps/mobile/src/ui/chat/mark-read.ts | 6 +- .../mobile/src/ui/chat/memory-file-screen.tsx | 4 +- apps/mobile/src/ui/chat/memory-file-view.tsx | 4 +- apps/mobile/src/ui/chat/memory-markdown.tsx | 4 +- .../src/ui/chat/memory-preview-image.tsx | 6 +- apps/mobile/src/ui/chat/mention-draft.ts | 6 +- .../src/ui/chat/message-actions.ios.tsx | 2 +- .../src/ui/chat/message-attachment-picker.tsx | 2 +- .../src/ui/chat/message-attachments.tsx | 2 +- apps/mobile/src/ui/chat/message-body.tsx | 6 +- apps/mobile/src/ui/chat/message-bubble.tsx | 4 +- apps/mobile/src/ui/chat/message-feedback.tsx | 2 +- apps/mobile/src/ui/chat/message-groups.ts | 2 +- apps/mobile/src/ui/chat/message-identities.ts | 2 +- apps/mobile/src/ui/chat/message-mentions.ts | 2 +- apps/mobile/src/ui/chat/message-popover.tsx | 2 +- apps/mobile/src/ui/chat/message-reactions.tsx | 2 +- .../mobile/src/ui/chat/message-search-row.tsx | 2 +- .../src/ui/chat/message-selection-ui.tsx | 2 +- apps/mobile/src/ui/chat/message-selection.ts | 2 +- apps/mobile/src/ui/chat/message-sheet.ts | 2 +- .../src/ui/chat/message-source-page.tsx | 2 +- .../src/ui/chat/message-source-state.ts | 2 +- apps/mobile/src/ui/chat/message-source.ts | 2 +- .../src/ui/chat/model-settings-screen.tsx | 11 +- apps/mobile/src/ui/chat/model-sheet.tsx | 2 +- .../mobile/src/ui/chat/private-input-card.tsx | 2 +- .../mobile/src/ui/chat/profile-page-target.ts | 2 +- apps/mobile/src/ui/chat/profile-routines.tsx | 4 +- .../src/ui/chat/profile-swipe-preview.tsx | 2 +- apps/mobile/src/ui/chat/question-card.tsx | 6 +- .../src/ui/chat/question-fields.android.tsx | 2 +- apps/mobile/src/ui/chat/question-fields.tsx | 4 +- apps/mobile/src/ui/chat/reaction-presence.ts | 2 +- apps/mobile/src/ui/chat/reply-bar.tsx | 2 +- apps/mobile/src/ui/chat/reply-quote.tsx | 6 +- .../src/ui/chat/request-activity-action.ts | 2 +- .../src/ui/chat/request-activity-control.tsx | 2 +- apps/mobile/src/ui/chat/routine-screen.tsx | 4 +- apps/mobile/src/ui/chat/routine-sheet.tsx | 4 +- apps/mobile/src/ui/chat/routine-text.ts | 6 +- .../src/ui/chat/session-failure-card.tsx | 6 +- apps/mobile/src/ui/chat/session-stops.ts | 4 +- apps/mobile/src/ui/chat/source-name.tsx | 2 +- apps/mobile/src/ui/chat/speaker-row.tsx | 2 +- apps/mobile/src/ui/chat/takeover-card.tsx | 4 +- apps/mobile/src/ui/chat/use-header-status.ts | 2 +- apps/mobile/src/ui/chat/voice-bar.tsx | 2 +- apps/mobile/src/ui/chat/working-status.tsx | 2 +- apps/mobile/src/ui/chat/workspace-sheet.tsx | 2 +- apps/mobile/src/ui/connection-presence.ts | 2 +- apps/mobile/src/ui/connection-recovery.ts | 2 +- apps/mobile/src/ui/design/controls.ts | 2 +- apps/mobile/src/ui/design/resolve-theme.ts | 53 +---- apps/mobile/src/ui/design/theme.tsx | 6 +- .../mobile/src/ui/host-compatibility-chip.tsx | 2 +- apps/mobile/src/ui/notification-settings.tsx | 4 +- apps/mobile/src/ui/pairing-failure.ts | 4 +- .../src/ui/primitives/account-panel.tsx | 4 +- .../ui/primitives/connection-failure-state.ts | 2 +- .../src/ui/primitives/connection-progress.tsx | 2 +- .../creation-tags-field.android.tsx | 2 +- .../src/ui/primitives/creation-tags-field.tsx | 2 +- .../src/ui/primitives/resource-image.tsx | 10 +- apps/mobile/src/ui/private-input-form.tsx | 4 +- apps/mobile/src/ui/question-view.tsx | 4 +- apps/mobile/src/ui/settings-view.tsx | 2 +- apps/mobile/src/ui/share/share-screen.tsx | 2 +- apps/mobile/src/ui/shell/activity-avatar.ts | 2 +- apps/mobile/src/ui/shell/activity-feed.tsx | 10 +- apps/mobile/src/ui/shell/activity-filters.tsx | 6 +- .../mobile/src/ui/shell/avatar-customizer.tsx | 2 +- .../mobile/src/ui/shell/bottom-navigation.tsx | 2 +- .../mobile/src/ui/shell/channel-navigation.ts | 4 +- apps/mobile/src/ui/shell/computer-row.tsx | 9 +- .../mobile/src/ui/shell/create-bot-screen.tsx | 6 +- .../src/ui/shell/create-channel-screen.tsx | 2 +- .../shell/creation-avatar-editor-screen.tsx | 5 +- apps/mobile/src/ui/shell/creation-avatar.tsx | 4 +- .../src/ui/shell/creation-header-contract.ts | 2 +- apps/mobile/src/ui/shell/home-header.tsx | 4 +- .../src/ui/shell/host-accent-provider.tsx | 2 +- apps/mobile/src/ui/shell/host-drawer-model.ts | 4 +- apps/mobile/src/ui/shell/host-drawer.tsx | 12 +- apps/mobile/src/ui/shell/host-look-editor.tsx | 2 +- apps/mobile/src/ui/shell/host-tile.tsx | 2 +- .../src/ui/shell/marketplace-daily-picks.tsx | 2 +- .../src/ui/shell/marketplace-navigation.ts | 2 +- .../src/ui/shell/marketplace-sections.tsx | 2 +- .../src/ui/shell/pairing-failure-notice.tsx | 6 +- apps/mobile/src/ui/shell/usage-card.tsx | 2 +- apps/mobile/src/ui/shell/use-pairing.ts | 13 +- apps/mobile/src/ui/storage-settings.tsx | 4 +- apps/mobile/src/ui/strings.ts | 10 +- apps/mobile/src/ui/theme.ts | 2 +- apps/mobile/src/ui/usage-view.tsx | 8 +- apps/mobile/test/account-actions.test.ts | 6 +- apps/mobile/test/account-hosts.test.tsx | 2 +- apps/mobile/test/account-pairing.test.ts | 6 +- apps/mobile/test/action-card-android.test.tsx | 4 +- apps/mobile/test/action-cards.test.ts | 8 +- apps/mobile/test/activity-avatar.test.ts | 2 +- apps/mobile/test/activity-clear-many.test.tsx | 4 +- apps/mobile/test/activity-count.test.ts | 4 +- apps/mobile/test/activity-detail.test.tsx | 4 +- apps/mobile/test/activity-feed.test.ts | 8 +- .../test/activity-multiple-hosts.test.tsx | 4 +- apps/mobile/test/activity-open-read.test.tsx | 4 +- apps/mobile/test/activity-row.test.tsx | 6 +- apps/mobile/test/activity-smoothing.test.ts | 10 +- apps/mobile/test/activity-sources.test.ts | 6 +- apps/mobile/test/approval-records.test.ts | 4 +- apps/mobile/test/assignment-detail.test.tsx | 2 +- apps/mobile/test/attachments.live.test.ts | 7 +- apps/mobile/test/attention-actions.test.ts | 8 +- .../mobile/test/attention-navigation.test.tsx | 2 +- apps/mobile/test/background-catch-up.test.ts | 2 +- apps/mobile/test/bot-access.test.tsx | 2 +- apps/mobile/test/bot-activity.test.ts | 2 +- apps/mobile/test/bot-avatar-choice.test.ts | 4 +- apps/mobile/test/bot-avatar.test.ts | 4 +- .../mobile/test/bot-background-entry.test.tsx | 4 +- apps/mobile/test/bot-creation-entry.test.ts | 5 +- .../test/bot-creation-navigation.test.ts | 2 +- apps/mobile/test/bot-creation-notice.test.tsx | 2 +- apps/mobile/test/bot-creation-screen.test.tsx | 4 +- apps/mobile/test/bot-creation-tags.test.ts | 4 +- .../test/bot-creation-transport.test.ts | 8 +- apps/mobile/test/bot-creation.test.ts | 6 +- apps/mobile/test/bot-import-screen.test.tsx | 4 +- apps/mobile/test/bot-import.live.test.ts | 13 +- apps/mobile/test/bot-import.test.ts | 2 +- apps/mobile/test/bot-inbox-screen.test.tsx | 4 +- apps/mobile/test/bot-inbox.test.ts | 2 +- apps/mobile/test/bot-name.test.ts | 4 +- .../test/bot-operation-telemetry.test.ts | 10 +- apps/mobile/test/bot-profile-sheet.test.tsx | 4 +- apps/mobile/test/bot-profile.live.test.ts | 4 +- apps/mobile/test/bot-profile.test.ts | 6 +- apps/mobile/test/bot-settings.test.ts | 6 +- apps/mobile/test/bot-zip-import.test.ts | 4 +- apps/mobile/test/bot-zip-transport.test.ts | 8 +- apps/mobile/test/browser-viewer.live.test.ts | 7 +- apps/mobile/test/browser-viewer.test.ts | 4 +- apps/mobile/test/call-post.test.ts | 4 +- apps/mobile/test/call-record.test.tsx | 4 +- apps/mobile/test/catch-up-power.test.ts | 2 +- apps/mobile/test/catch-up.test.ts | 2 +- apps/mobile/test/channel-activity.test.ts | 14 +- .../test/channel-creation-screen.test.tsx | 2 +- .../test/channel-creation-transport.test.ts | 4 +- apps/mobile/test/channel-files.test.ts | 4 +- apps/mobile/test/channel-list-store.test.ts | 6 +- .../test/channel-notifications.test.tsx | 2 +- apps/mobile/test/channel-viewport.test.tsx | 2 +- .../test/chat-header-layout-ios.test.tsx | 2 +- .../mobile/test/computer-availability.test.ts | 8 +- .../mobile/test/computer-video-status.test.ts | 2 +- apps/mobile/test/computer-viewer.test.ts | 4 +- .../mobile/test/connect-account-relay.test.ts | 2 +- apps/mobile/test/connect-account.test.ts | 4 +- apps/mobile/test/connect-email-code.test.ts | 2 +- apps/mobile/test/connect-follow.test.ts | 4 +- apps/mobile/test/connect-password.test.ts | 2 +- .../mobile/test/connection-diagnostic.test.ts | 2 +- .../test/connection-failure-actions.test.tsx | 2 +- apps/mobile/test/connection-summary.test.ts | 6 +- apps/mobile/test/connection-telemetry.test.ts | 7 +- .../test/conversation-attachments.test.ts | 8 +- apps/mobile/test/conversation-cursor.test.ts | 6 +- .../test/conversation-local-store.test.ts | 8 +- .../test/conversation-multiple-hosts.test.tsx | 4 +- .../test/conversation-navigation.test.tsx | 12 +- .../mobile/test/conversation-playback.test.ts | 5 +- .../test/conversation-streaming-rows.test.tsx | 4 +- apps/mobile/test/conversation.live.test.ts | 7 +- apps/mobile/test/conversation.test.ts | 8 +- apps/mobile/test/conversations.test.ts | 4 +- .../test/creation-tags-field-android.test.tsx | 2 +- apps/mobile/test/decision-feedback.test.tsx | 8 +- apps/mobile/test/deletion-client.test.ts | 4 +- apps/mobile/test/delivery-receipt.test.ts | 2 +- apps/mobile/test/design-tokens.test.ts | 10 +- apps/mobile/test/device-alerts.test.ts | 2 +- .../device-notification-preferences.test.ts | 6 +- apps/mobile/test/direct-reconnect.test.ts | 8 +- apps/mobile/test/dm-activity.test.ts | 2 +- apps/mobile/test/encrypted-carrier.test.ts | 37 ++-- apps/mobile/test/encrypted-upload.test.ts | 8 +- apps/mobile/test/feature-telemetry.test.ts | 7 +- .../test/follow-latest-gestures.test.tsx | 2 +- apps/mobile/test/follow-latest.test.tsx | 2 +- apps/mobile/test/genui-document.test.ts | 10 +- apps/mobile/test/genui-view.test.ts | 6 +- apps/mobile/test/grant-request-card.test.ts | 10 +- apps/mobile/test/group-channel.test.ts | 8 +- apps/mobile/test/group-info.test.tsx | 2 +- apps/mobile/test/header-status.test.ts | 2 +- .../test/home-host-compatibility.test.tsx | 4 +- apps/mobile/test/home-multiple-hosts.test.tsx | 4 +- apps/mobile/test/home-search.test.tsx | 10 +- apps/mobile/test/host-availability.test.tsx | 2 +- apps/mobile/test/host-client.live.test.ts | 6 +- apps/mobile/test/host-client.test.ts | 12 +- apps/mobile/test/host-connection.test.tsx | 6 +- apps/mobile/test/host-dictation.test.tsx | 2 +- apps/mobile/test/host-drawer.test.ts | 8 +- apps/mobile/test/host-health-probe.test.ts | 4 +- apps/mobile/test/host-look.test.tsx | 4 +- .../test/host-session-background.test.ts | 2 +- .../test/host-session-conversation.test.tsx | 9 +- apps/mobile/test/host-session-fixture.tsx | 6 +- .../test/host-session-ios-call-resume.test.ts | 2 +- .../test/host-session-ios-in-app.test.ts | 2 +- .../mobile/test/host-session-multiple.test.ts | 2 +- apps/mobile/test/host-session-unpair.test.ts | 14 +- apps/mobile/test/host-store-delete.test.ts | 2 +- apps/mobile/test/host-store.test.ts | 2 +- apps/mobile/test/in-app-banners.test.ts | 2 +- apps/mobile/test/inbox-live-refresh.test.ts | 4 +- apps/mobile/test/inbox-observer.test.ts | 6 +- apps/mobile/test/inbox-screens.test.ts | 4 +- apps/mobile/test/inbox.live.test.ts | 8 +- apps/mobile/test/inbox.test.ts | 19 +- apps/mobile/test/invite-selection.test.tsx | 2 +- apps/mobile/test/learned-routes.test.ts | 4 +- .../mobile/test/live-activity-session.test.ts | 4 +- apps/mobile/test/live-pairing.ts | 4 +- apps/mobile/test/local-message-search.test.ts | 8 +- apps/mobile/test/local-store.test.ts | 2 +- apps/mobile/test/local-video-actions.test.ts | 2 +- apps/mobile/test/local-video-carrier.test.ts | 10 +- apps/mobile/test/local-video-notice.test.ts | 2 +- apps/mobile/test/local-video-pointer.test.ts | 2 +- apps/mobile/test/mark-read.test.ts | 2 +- apps/mobile/test/markdown-tail.test.ts | 6 +- apps/mobile/test/marketplace-home.test.tsx | 4 +- apps/mobile/test/marketplace-import.test.ts | 2 +- apps/mobile/test/marketplace-screen.test.tsx | 5 +- apps/mobile/test/media-cache.test.ts | 4 +- apps/mobile/test/media-long-press.test.tsx | 2 +- apps/mobile/test/media-retention.test.ts | 2 +- apps/mobile/test/memory-browser.test.tsx | 6 +- apps/mobile/test/memory-changes.test.ts | 2 +- apps/mobile/test/memory-file-screen.test.tsx | 4 +- apps/mobile/test/memory-preview.live.test.ts | 4 +- apps/mobile/test/mention-draft.test.ts | 2 +- apps/mobile/test/message-actions-ios.test.tsx | 2 +- .../test/message-attachment-picker.test.tsx | 2 +- .../test/message-attachments-offline.test.tsx | 2 +- apps/mobile/test/message-bubble.test.tsx | 8 +- .../test/message-feedback-form.test.tsx | 4 +- apps/mobile/test/message-feedback.test.ts | 4 +- .../test/message-files-download.test.tsx | 2 +- apps/mobile/test/message-groups.test.ts | 2 +- .../mobile/test/message-menu-feedback.test.ts | 2 +- .../test/message-popover-android.test.tsx | 4 +- apps/mobile/test/message-selection.test.ts | 2 +- .../mobile/test/message-sheet-native.test.tsx | 4 +- .../mobile/test/message-source-state.test.tsx | 2 +- apps/mobile/test/message-source.test.ts | 2 +- .../test/mobile-telemetry-wire-live.test.ts | 4 +- apps/mobile/test/mobile-telemetry.test.ts | 2 +- apps/mobile/test/model-settings.test.ts | 8 +- .../native-live-activity-multiple.test.tsx | 6 +- .../mobile/test/native-live-activity.test.tsx | 4 +- apps/mobile/test/native-text-row.test.ts | 2 +- apps/mobile/test/node-carrier.ts | 2 +- apps/mobile/test/node-sql-connection.ts | 2 +- apps/mobile/test/noise-key-agreement.test.ts | 2 +- apps/mobile/test/notification-avatars.test.ts | 2 +- .../test/notification-discovery.test.ts | 6 +- .../test/notification-idle.android.test.tsx | 10 +- .../test/notification-preferences-web.test.ts | 4 +- .../test/notification-settings.test.tsx | 2 +- apps/mobile/test/pair-image-trust.test.ts | 6 +- apps/mobile/test/pairing-certificate.test.ts | 2 +- .../mobile/test/pairing-failure-cause.test.ts | 12 +- .../test/pairing-private-origins.test.ts | 4 +- apps/mobile/test/pairing-route-update.test.ts | 10 +- apps/mobile/test/pairing-telemetry.test.ts | 6 +- .../mobile/test/pairing-verification.test.tsx | 10 +- .../test/phone-connection-recovery.test.ts | 8 +- apps/mobile/test/pinned-list.test.ts | 2 +- apps/mobile/test/posthog-sender.test.ts | 4 +- apps/mobile/test/private-relay.test.ts | 14 +- apps/mobile/test/profile-navigation.test.tsx | 10 +- apps/mobile/test/profile-page-target.test.ts | 2 +- apps/mobile/test/profile-routines.test.tsx | 2 +- apps/mobile/test/purge-caches.test.ts | 4 +- apps/mobile/test/push-answer.test.ts | 2 +- apps/mobile/test/push-navigation.test.tsx | 4 +- .../test/push-routing-multiple.test.tsx | 2 +- apps/mobile/test/push-token-lifecycle.test.ts | 4 +- apps/mobile/test/push.test.ts | 9 +- apps/mobile/test/reaction-chips-exit.test.ts | 2 +- apps/mobile/test/recovery-summary.test.ts | 2 +- .../mobile/test/remote-keyboard-input.test.ts | 2 +- apps/mobile/test/reply-haptic.test.tsx | 2 +- apps/mobile/test/root-alert-insets.test.tsx | 2 +- apps/mobile/test/roster-sorting.test.ts | 2 +- apps/mobile/test/route-preference.test.ts | 10 +- apps/mobile/test/routine-sheet.test.tsx | 2 +- apps/mobile/test/routines.test.ts | 6 +- apps/mobile/test/session-failure.test.ts | 2 +- apps/mobile/test/session-stop.test.ts | 2 +- apps/mobile/test/share-attachment.test.ts | 2 +- apps/mobile/test/share-versioned.test.ts | 2 +- apps/mobile/test/source-name.test.tsx | 2 +- apps/mobile/test/statistics-settings.test.tsx | 5 +- apps/mobile/test/storage-settings.test.tsx | 4 +- apps/mobile/test/team-members.test.ts | 15 +- .../test/telemetry-device-context.test.ts | 7 +- apps/mobile/test/usage-screen.test.tsx | 4 +- apps/mobile/test/usage.test.ts | 6 +- apps/mobile/test/voice-call-carrier.test.ts | 2 +- apps/mobile/test/watch-account-hosts.test.ts | 2 +- apps/mobile/test/wire-contract.ts | 2 +- apps/mobile/test/working-status.test.tsx | 2 +- apps/mobile/test/workspace-lifecycle.test.tsx | 2 +- apps/mobile/test/zip-import-file.test.ts | 2 +- apps/mobile/test/zip-import-upload.test.ts | 4 +- docs/telemetry-events.md | 2 +- package.json | 2 +- packages/client/package.json | 2 + packages/client/src/client/actions.ts | 2 +- .../src/client/activity-center-view.tsx | 2 +- .../src/client/activity-environments.ts | 2 +- .../client/src/client/appearance-scope.ts | 2 +- packages/client/src/client/approval-input.tsx | 5 +- .../client/assignment-concurrency-setting.tsx | 2 +- .../src/client/bot-hop-limit-setting.tsx | 2 +- packages/client/src/client/bot-icon.tsx | 2 +- packages/client/src/client/bot-mode-prefs.ts | 2 +- .../src/client/bot-mode-setting-rows.tsx | 2 +- .../client/src/client/bot-mode-sidebar.tsx | 2 +- .../client/src/client/bot-primary-color.ts | 4 +- packages/client/src/client/bot-sidebar.tsx | 2 +- packages/client/src/client/bridge.ts | 5 +- packages/client/src/client/channel-live.ts | 2 +- .../src/client/channel-message-body.tsx | 2 +- .../client/src/client/composer-send-key.ts | 2 +- .../client/src/client/connection-hosts.tsx | 6 +- .../src/client/connection-management.ts | 4 +- .../client/src/client/environment-activity.ts | 2 +- .../client/src/client/environment-channels.ts | 2 +- .../src/client/environment-creation-owner.ts | 4 +- .../src/client/environment-creation.tsx | 4 +- .../src/client/environment-settings-source.ts | 2 +- .../client/src/client/genui-document-view.ts | 2 +- packages/client/src/client/genui-report.tsx | 2 +- .../src/client/host-activity-actions.ts | 6 +- .../client/src/client/host-bridge-call.ts | 2 +- packages/client/src/client/host-glyph.tsx | 2 +- .../client/src/client/host-look-control.ts | 8 +- .../client/src/client/host-look-settings.tsx | 2 +- packages/client/src/client/host-looks.ts | 6 +- packages/client/src/client/host-settings.tsx | 4 +- packages/client/src/client/host-tabs.tsx | 2 +- packages/client/src/client/index.ts | 5 +- packages/client/src/client/message-host.ts | 2 +- .../client/src/client/mobile-bot-panel.tsx | 2 +- .../client/src/client/motion-preference.ts | 2 +- .../client/src/client/overview-usage-view.tsx | 2 +- packages/client/src/client/paired-devices.tsx | 6 +- .../client/src/client/private-input-card.tsx | 4 +- .../src/client/relationship-settings.tsx | 6 +- packages/client/src/client/relationships.ts | 6 +- .../client/src/client/remote-activity.tsx | 4 +- packages/client/src/client/remote-avatar.tsx | 2 +- .../client/src/client/remote-folder-access.ts | 4 +- .../client/src/client/remote-host-activity.ts | 7 +- .../client/src/client/remote-host-models.tsx | 4 +- .../src/client/remote-host-settings-source.ts | 8 +- .../src/client/remote-host-viewer-panel.tsx | 4 +- .../client/src/client/remote-host-viewer.ts | 6 +- packages/client/src/client/remote-hosts.ts | 18 +- .../src/client/remote-native-conversation.ts | 2 +- .../client/remote-notification-settings.tsx | 2 +- .../client/src/client/remote-notifications.ts | 10 +- packages/client/src/client/roster-config.ts | 5 +- packages/client/src/client/roster-order.ts | 2 +- .../client/src/client/session-maintenance.ts | 2 +- packages/client/src/client/shortcut-help.tsx | 2 +- .../client/src/client/storage-settings.tsx | 4 +- packages/client/src/client/store.ts | 6 +- .../client/src/client/tob-presentation.ts | 2 +- .../client/src/client/tool-approval-card.tsx | 2 +- .../client/src/client/turn-continuation.ts | 2 +- packages/client/src/index.ts | 2 +- .../client/test/activity-environments.test.ts | 2 +- .../client/test/activity-inbox-clear.test.tsx | 2 +- .../test/activity-list-keyboard-batch.test.ts | 4 +- .../client/test/activity-smoothing.test.ts | 2 +- .../client/test/bot-session-folders.test.tsx | 2 +- packages/client/test/bot-sidebar.test.ts | 2 +- .../test/companion-channel-scope.test.ts | 14 +- .../test/companion-feed.test.ts | 12 +- .../test/companion-recovery.test.ts | 10 +- .../test/companion-terminal-recovery.test.ts | 8 +- .../client/test/connection-control.test.ts | 2 +- .../client/test/connection-hosts.test.tsx | 4 +- .../client/test/connection-management.test.ts | 6 +- packages/client/test/connection-relay.test.ts | 2 +- .../client/test/content-redactions.test.ts | 2 +- .../test/environment-creation-form.test.tsx | 2 +- .../environment-creation-recovery.test.ts | 2 +- .../client/test/environment-creation.test.ts | 2 +- .../test/environment-model-draft.test.tsx | 2 +- .../environment-settings-identity.test.tsx | 4 +- .../test/environment-settings-source.test.ts | 5 +- packages/client/test/host-bridge-call.test.ts | 4 +- .../client/test/host-look-control.test.ts | 4 +- packages/client/test/host-look-owner.test.ts | 4 +- .../test/host-look-r1-regression.test.ts | 4 +- packages/client/test/host-look-relay.test.ts | 2 +- packages/client/test/host-looks.test.ts | 2 +- packages/client/test/host-name-draft.test.tsx | 2 +- .../client/test/member-owner-sources.test.ts | 4 +- .../client/test/memory-image-view.test.tsx | 4 +- packages/client/test/mobile-bot-panel.test.ts | 2 +- .../client/test/mobile-import-gateway.test.ts | 4 +- .../client/test/model-preset-profile.test.ts | 2 +- packages/client/test/qr-image.test.ts | 2 +- packages/client/test/relationships.test.ts | 2 +- packages/client/test/remote-avatar.test.tsx | 2 +- .../test/remote-conversation-source.test.tsx | 2 +- .../client/test/remote-folder-access.test.ts | 4 +- .../client/test/remote-host-activity.test.ts | 2 +- .../test/remote-host-enrollment.test.ts | 4 +- .../client/test/remote-host-settings.test.ts | 6 +- .../test/remote-host-viewer-panel.test.tsx | 2 +- .../test/remote-host-viewer-recovery.test.ts | 10 +- .../test/remote-host-viewer-removal.test.ts | 4 +- .../client/test/remote-host-viewer.test.ts | 2 +- packages/client/test/remote-hosts.test.ts | 8 +- packages/client/test/remote-message.test.ts | 2 +- .../test/remote-native-conversation.test.ts | 4 +- .../client/test/remote-notifications.test.ts | 2 +- .../client/test/session-maintenance.test.ts | 2 +- packages/client/test/storage-settings.test.ts | 2 +- packages/client/test/team-mode-client.test.ts | 2 +- .../test/timeline-render-stability.test.ts | 2 +- .../test/tool-approval-card-keys.test.ts | 2 +- .../client/test/turn-continuation.test.ts | 2 +- packages/computer/package.json | 2 + .../computer/test/local-video-client.test.ts | 2 +- packages/core/package.json | 2 + packages/core/src/bots/cli-device-client.ts | 10 +- .../core/src/bots/cli-device-notifications.ts | 6 +- packages/core/src/bots/cli-devices.ts | 2 +- packages/core/src/bots/cli-live-activity.ts | 7 +- packages/core/src/bots/cli-live.ts | 2 +- .../core/src/bots/cli-phone-notifications.ts | 4 +- packages/core/src/bots/cli-relationships.ts | 4 +- packages/core/src/bots/cli-ssh.ts | 2 +- .../core/src/devices/bot-connect-bridge.ts | 2 +- packages/core/src/devices/bot-lan-bridge.ts | 2 +- packages/core/src/devices/bot-lan-control.ts | 2 +- .../core/src/devices/bot-lan-discovery.ts | 2 +- .../core/src/devices/bot-network-noise.ts | 2 +- packages/core/src/devices/bot-peer-channel.ts | 6 +- .../core/src/devices/bot-tailnet-bridge.ts | 2 +- packages/core/src/devices/connect-account.ts | 2 +- packages/core/src/devices/connect-health.ts | 4 +- .../src/devices/connect-identity-fetch.ts | 2 +- packages/core/src/devices/connect.ts | 2 +- packages/core/src/devices/direct.ts | 2 +- .../core/src/devices/encrypted-gateway.ts | 4 +- packages/core/src/devices/lan.ts | 4 +- packages/core/src/devices/mount.ts | 2 +- packages/core/src/devices/node-carrier.ts | 4 +- packages/core/src/devices/noise-identity.ts | 8 +- packages/core/src/devices/private-relay.ts | 2 +- packages/core/src/devices/private-tunnel.ts | 2 +- .../src/devices/relationship-admission.ts | 2 +- .../core/src/devices/relationship-contract.ts | 10 +- .../core/src/devices/relationship-control.ts | 8 +- .../src/devices/relationship-enrollment.ts | 12 +- packages/core/src/devices/routes.ts | 10 +- packages/core/src/devices/ssh-loopback.ts | 2 +- packages/core/src/devices/ssh-tunnel.ts | 2 +- packages/core/src/devices/tunnel-dns.ts | 2 +- packages/core/src/team/http.ts | 2 +- packages/core/src/team/member-urls.ts | 2 +- packages/core/test/account-enrollment.test.ts | 4 +- packages/core/test/bot-connect-bridge.test.ts | 2 +- .../core/test/bot-connect-channel.test.ts | 2 +- packages/core/test/bot-lan-network.test.ts | 2 +- .../core/test/bot-network-continuity.test.ts | 2 +- packages/core/test/bot-network-noise.test.ts | 2 +- packages/core/test/bot-tailnet-bridge.test.ts | 2 +- .../core/test/call-gateway-deadline.test.ts | 6 +- packages/core/test/cli-device-client.test.ts | 2 +- packages/core/test/cli-live-activity.test.ts | 4 +- .../core/test/cli-phone-notifications.test.ts | 4 +- .../test/cli-relationship-deadline.test.ts | 4 +- packages/core/test/cli-relationships.test.ts | 2 +- packages/core/test/connect-account.test.ts | 2 +- packages/core/test/connect-channel.test.ts | 4 +- .../test/connect-encrypted-gateway.test.ts | 6 +- packages/core/test/connect-health.test.ts | 4 +- .../core/test/connect-network-inbox.test.ts | 2 +- packages/core/test/connect-noise.test.ts | 6 +- packages/core/test/connect-pairing.test.ts | 8 +- packages/core/test/connect-zones.test.ts | 2 +- packages/core/test/device-lan.test.ts | 10 +- packages/core/test/direct.test.ts | 8 +- packages/core/test/network-withdrawal.test.ts | 2 +- packages/core/test/onboarding.test.ts | 7 +- packages/core/test/private-relay.test.ts | 8 +- packages/core/test/private-tunnel.test.ts | 8 +- .../core/test/relationship-control.test.ts | 16 +- packages/core/test/ssh-tunnel.test.ts | 4 +- packages/core/test/team-mode.test.ts | 25 +-- packages/core/test/telemetry-plan.test.ts | 4 +- packages/host-client/package.json | 13 ++ .../host-client/src}/account-owner.ts | 0 .../host-client/src}/attention-actions.ts | 6 +- .../host-client/src}/bot-avatar-choice.ts | 5 +- .../host-client/src}/bot-creation-tags.ts | 0 .../src}/bot-creation-transport.ts | 2 +- .../host-client/src}/bot-creation.ts | 6 +- .../host-client/src}/bot-settings.ts | 0 .../host-client/src}/browser-viewer.ts | 0 .../host-client/src}/channel-activity.ts | 8 +- .../host-client/src}/channel-list-store.ts | 2 +- .../host-client/src}/client.ts | 34 +-- .../host-client/src}/computer-availability.ts | 2 +- .../host-client/src}/computer-viewer.ts | 0 .../host-client/src}/connect-account.ts | 25 +-- .../host-client/src/connection-diagnostic.ts | 1 + .../host-client/src}/conversation.ts | 8 +- .../src}/device-notification-preferences.ts | 0 .../host-client/src}/encrypted-carrier.ts | 14 +- .../host-client}/src/genui/document.ts | 6 +- .../host-client}/src/genui/view.ts | 4 +- .../host-client/src}/host-look.ts | 2 +- .../host-client/src}/hosts.ts | 72 +------ .../host-client/src}/inbox.ts | 18 +- .../host-client/src}/learned-routes.ts | 2 +- .../host-client/src}/live-activity.ts | 4 +- .../host-client/src}/local-store.ts | 0 .../host-client/src}/media-cache.ts | 0 .../host-client/src}/member-identity.ts | 4 +- .../host-client/src}/model-settings.ts | 4 +- .../host-client/src}/pairing.ts | 204 +++--------------- .../host => packages/host-client/src}/push.ts | 4 +- .../host-client/src}/remote-keyboard-input.ts | 2 +- .../host-client/src}/requests.ts | 8 +- .../host-client/src}/roster-sorting.ts | 2 +- .../host-client/src}/session-failure.ts | 6 +- .../src/shared}/activity-smoothing.ts | 0 .../src/shared}/approval-diff.ts | 0 .../src/shared}/bot-mode-settings.ts | 0 .../src/shared}/bot-name-color.ts | 0 .../src/shared}/genui-view.ts | 0 .../src/shared/session-maintenance.ts | 0 .../src/shared/team-sign-in-page.ts | 0 .../src/shared/turn-continuation.ts | 0 .../host-client/src}/storage.ts | 0 .../host-client/src}/team-client.ts | 16 +- packages/host-client/src/team-invitation.ts | 1 + .../host-client}/src/telemetry/connection.ts | 2 +- .../src/telemetry/device-context.ts | 0 .../host-client}/src/telemetry/features.ts | 0 .../src/telemetry/mobile-telemetry.ts | 2 +- .../host-client}/src/telemetry/schema.ts | 4 +- .../host-client/src/ui/design/color-math.ts | 39 ++++ .../host-client}/src/ui/design/host-look.ts | 2 +- .../src/ui/design/palette.generated.ts | 0 .../host-client/src}/usage.ts | 9 +- .../host-client/src}/zip-import-file.ts | 2 +- .../host-client/src}/zip-import-upload.ts | 0 .../host-client}/test/fake-host.ts | 8 +- .../host-client}/test/fixtures/host-wire.json | 0 packages/host-protocol/package.json | 14 ++ .../host-protocol/src}/carrier.ts | 4 + packages/host-protocol/src/connect-refusal.ts | 18 ++ .../src}/connect-zones.ts | 0 .../src}/connection-diagnostic.ts | 0 packages/host-protocol/src/host-encryption.ts | 66 ++++++ .../src}/lan-address.ts | 0 .../src}/noise/channel.ts | 0 .../devices => host-protocol/src}/noise/xk.ts | 0 .../host-protocol/src}/pairing-detail.ts | 0 packages/host-protocol/src/pairing.ts | 161 ++++++++++++++ .../host-protocol/src}/route.ts | 7 +- .../host-protocol/src}/team-invitation.ts | 0 .../host-protocol/src}/wire.ts | 4 +- pnpm-lock.yaml | 45 ++++ scripts/check-package-boundaries.mjs | 107 +++++++++ scripts/cli-ui-inventory.json | 28 +-- scripts/test/ci-plan.test.mjs | 20 ++ scripts/test/package-boundaries.test.mjs | 54 +++++ scripts/verification-inventory.json | 8 +- tsconfig.json | 2 + tsdown.config.ts | 6 +- 788 files changed, 2587 insertions(+), 1755 deletions(-) create mode 100644 apps/docs/src/content/docs-zh/docs/private-named-tunnel.mdx create mode 100644 apps/docs/src/content/docs-zh/docs/private-relay.mdx create mode 100644 apps/docs/src/content/docs/docs/private-named-tunnel.mdx create mode 100644 apps/docs/src/content/docs/docs/private-relay.mdx rename packages/{core => client}/test/companion-channel-scope.test.ts (97%) rename packages/{core => client}/test/companion-feed.test.ts (92%) rename packages/{core => client}/test/companion-recovery.test.ts (98%) rename packages/{core => client}/test/companion-terminal-recovery.test.ts (94%) create mode 100644 packages/host-client/package.json rename {apps/mobile/src/host => packages/host-client/src}/account-owner.ts (100%) rename {apps/mobile/src/host => packages/host-client/src}/attention-actions.ts (98%) rename {apps/mobile/src/host => packages/host-client/src}/bot-avatar-choice.ts (85%) rename {apps/mobile/src/host => packages/host-client/src}/bot-creation-tags.ts (100%) rename {apps/mobile/src/host => packages/host-client/src}/bot-creation-transport.ts (98%) rename {apps/mobile/src/host => packages/host-client/src}/bot-creation.ts (99%) rename {apps/mobile/src/host => packages/host-client/src}/bot-settings.ts (100%) rename {apps/mobile/src/host => packages/host-client/src}/browser-viewer.ts (100%) rename {apps/mobile/src/host => packages/host-client/src}/channel-activity.ts (94%) rename {apps/mobile/src/host => packages/host-client/src}/channel-list-store.ts (98%) rename {apps/mobile/src/host => packages/host-client/src}/client.ts (98%) rename {apps/mobile/src/host => packages/host-client/src}/computer-availability.ts (92%) rename {apps/mobile/src/host => packages/host-client/src}/computer-viewer.ts (100%) rename {apps/mobile/src/host => packages/host-client/src}/connect-account.ts (98%) create mode 100644 packages/host-client/src/connection-diagnostic.ts rename {apps/mobile/src/host => packages/host-client/src}/conversation.ts (99%) rename {apps/mobile/src/host => packages/host-client/src}/device-notification-preferences.ts (100%) rename {apps/mobile/src/host => packages/host-client/src}/encrypted-carrier.ts (98%) rename {apps/mobile => packages/host-client}/src/genui/document.ts (96%) rename {apps/mobile => packages/host-client}/src/genui/view.ts (95%) rename {apps/mobile/src/host => packages/host-client/src}/host-look.ts (99%) rename {apps/mobile/src/host => packages/host-client/src}/hosts.ts (82%) rename {apps/mobile/src/host => packages/host-client/src}/inbox.ts (95%) rename {apps/mobile/src/host => packages/host-client/src}/learned-routes.ts (94%) rename {apps/mobile/src/host => packages/host-client/src}/live-activity.ts (94%) rename {apps/mobile/src/host => packages/host-client/src}/local-store.ts (100%) rename {apps/mobile/src/host => packages/host-client/src}/media-cache.ts (100%) rename {apps/mobile/src/host => packages/host-client/src}/member-identity.ts (95%) rename {apps/mobile/src/host => packages/host-client/src}/model-settings.ts (98%) rename {apps/mobile/src/host => packages/host-client/src}/pairing.ts (77%) rename {apps/mobile/src/host => packages/host-client/src}/push.ts (98%) rename {apps/mobile/src/host => packages/host-client/src}/remote-keyboard-input.ts (94%) rename {apps/mobile/src/host => packages/host-client/src}/requests.ts (98%) rename {apps/mobile/src/host => packages/host-client/src}/roster-sorting.ts (96%) rename {apps/mobile/src/host => packages/host-client/src}/session-failure.ts (92%) rename packages/{client/src/client => host-client/src/shared}/activity-smoothing.ts (100%) rename packages/{client/src/client => host-client/src/shared}/approval-diff.ts (100%) rename packages/{client/src => host-client/src/shared}/bot-mode-settings.ts (100%) rename packages/{client/src/client => host-client/src/shared}/bot-name-color.ts (100%) rename packages/{client/src/client => host-client/src/shared}/genui-view.ts (100%) rename packages/{client => host-client}/src/shared/session-maintenance.ts (100%) rename packages/{client => host-client}/src/shared/team-sign-in-page.ts (100%) rename packages/{client => host-client}/src/shared/turn-continuation.ts (100%) rename {apps/mobile/src/host => packages/host-client/src}/storage.ts (100%) rename {apps/mobile/src/host => packages/host-client/src}/team-client.ts (95%) create mode 100644 packages/host-client/src/team-invitation.ts rename {apps/mobile => packages/host-client}/src/telemetry/connection.ts (97%) rename {apps/mobile => packages/host-client}/src/telemetry/device-context.ts (100%) rename {apps/mobile => packages/host-client}/src/telemetry/features.ts (100%) rename {apps/mobile => packages/host-client}/src/telemetry/mobile-telemetry.ts (99%) rename {apps/mobile => packages/host-client}/src/telemetry/schema.ts (99%) create mode 100644 packages/host-client/src/ui/design/color-math.ts rename {apps/mobile => packages/host-client}/src/ui/design/host-look.ts (99%) rename {apps/mobile => packages/host-client}/src/ui/design/palette.generated.ts (100%) rename {apps/mobile/src/host => packages/host-client/src}/usage.ts (95%) rename {apps/mobile/src/host => packages/host-client/src}/zip-import-file.ts (96%) rename {apps/mobile/src/host => packages/host-client/src}/zip-import-upload.ts (100%) rename {apps/mobile => packages/host-client}/test/fake-host.ts (98%) rename {apps/mobile => packages/host-client}/test/fixtures/host-wire.json (100%) create mode 100644 packages/host-protocol/package.json rename {apps/mobile/src/host => packages/host-protocol/src}/carrier.ts (90%) create mode 100644 packages/host-protocol/src/connect-refusal.ts rename packages/{core/src/devices => host-protocol/src}/connect-zones.ts (100%) rename {apps/mobile/src/host => packages/host-protocol/src}/connection-diagnostic.ts (100%) create mode 100644 packages/host-protocol/src/host-encryption.ts rename packages/{core/src/devices => host-protocol/src}/lan-address.ts (100%) rename packages/{core/src/devices => host-protocol/src}/noise/channel.ts (100%) rename packages/{core/src/devices => host-protocol/src}/noise/xk.ts (100%) rename {apps/mobile/src/host => packages/host-protocol/src}/pairing-detail.ts (100%) create mode 100644 packages/host-protocol/src/pairing.ts rename {apps/mobile/src/host => packages/host-protocol/src}/route.ts (94%) rename {apps/mobile/src/host => packages/host-protocol/src}/team-invitation.ts (100%) rename {apps/mobile/src/host => packages/host-protocol/src}/wire.ts (98%) create mode 100644 scripts/check-package-boundaries.mjs create mode 100644 scripts/test/package-boundaries.test.mjs diff --git a/apps/docs/src/content/docs-zh/docs/private-named-tunnel.mdx b/apps/docs/src/content/docs-zh/docs/private-named-tunnel.mdx new file mode 100644 index 0000000000..f371de3cb0 --- /dev/null +++ b/apps/docs/src/content/docs-zh/docs/private-named-tunnel.mdx @@ -0,0 +1,66 @@ +--- +title: "Cloudflare Named Tunnel" +description: "手动或通过自己的 agent 配置固定隧道。" +sidebar: + order: 15 +--- + +使用自己 Cloudflare 账号下的固定主机名。Tobs 在电脑上运行内置 cloudflared,主动向 Cloudflare 建立出站隧道。手机访问该 HTTPS 主机名,再经隧道连接 Host 的加密设备通道,家中电脑不需要公网入站端口。这种方式使用 Cloudflare 基础设施,不依赖官方 Tobs Connect。 + +其他选择:[私有连接总览](private-connect.zh.md)、[HTTPS 入口](private-ingress.zh.md)、[Docker Relay](private-relay.zh.md)。 + +## 准备 + +- 按[安装教程](https://tobs.app/docs/installation/)准备 Tobs 与手机 App,保留现有 Host Profile。 +- Cloudflare 账号、该账号下的域名、未使用的主机名(例如 `bot.example.com`),以及创建 Tunnel/DNS 路由的权限。 +- 电脑到 Cloudflare 的出站连通性。域名注册和服务商费用另算,不保证所有账号或网络都免费可用。 + +控制台操作以当前 [Cloudflare 官方教程](https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/get-started/create-remote-tunnel/)为准。不要执行其中的连接器安装命令,Tobs 会运行自己的连接器。 + +## 配置固定地址 + +1. 在 Cloudflare One 打开 **Networks → Connectors → Cloudflare Tunnels**(控制台名称可能变化),创建 Cloudflared Tunnel,私下保管连接器令牌。 +2. 打开 **Bot 设置 → 连接 → 添加连接 → 用手机连接这台电脑 → 已安装 App,开始连接 → 进阶方式 → 固定 Cloudflare Tunnel**。旧版本入口为**私有连接 → 固定地址**。 +3. 填写纯主机名,例如 `bot.example.com`,在受保护字段填写连接器令牌并保存,记下 Tobs 的专用设备网关端口。完成下一步前,公网检查可能失败。 +4. 在该 Tunnel 的 **Published application routes**(旧称 Public Hostname)中,将主机名指向 HTTP 服务 `http://127.0.0.1:PORT`,把 `PORT` 换成 Tobs 实际显示的端口。连接器在 Host 上运行,loopback 指的就是 Host。不要转发 DSH 网页/管理端口。 +5. 等 Tobs 公网检查通过后显示手机配对码,完成[所选连接验证](private-connect.zh.md#验证所选连接)。 + +交互式 Cloudflare Access 登录页可能拦住手机 WebSocket,只使用已明确兼容手机的路径。拥有主机名或服务商账号不等于获得 Host 控制权。 + +## CLI 方式 + +新安装提供 `tobs` 命令;已有 `deepseekbot` 用户可继续使用原命令。 + +使用现有本机 Host 及平常的连接参数和私有令牌文件。连接器令牌从仅本人可读的私有文件传入: + +```bash +tobs private-tunnel-enable --hostname bot.example.com --token-stdin --confirm < /absolute/private/connector-token.txt +tobs devices +``` + +先检查已有连接,不覆盖已占用的 custom 位置。较新 Host 还提供[独立连接命令](bot-cli.zh.md)。 + +## 复制给你的 agent + +复制完整代码块,替换公开主机名,也可以让 agent 再询问。 + +```text +帮我为现有 Tobs Host 配置自己的 Cloudflare Named Tunnel。先读 https://tobs.app/docs/private-named-tunnel/;不可访问时读 https://github.com/BotHarness/DeepSeekBot/blob/main/docs/private-named-tunnel.zh.md。目标主机名:bot.example.com(替换成我的)。 + +1. 检查已安装 Tobs 版本、实际运行的 Host/Profile、CLI 帮助、已有私有连接,以及我的 Cloudflare 账号和域名权限。保留数据、配对、DNS 和其他隧道。不能操作电脑/账号时,提供准确手动步骤并标为待完成。 +2. 约定空闲主机名、具体资源及网络发布范围,不购买域名或开启付费服务,服务商登录由我完成。连接器令牌只通过本地受保护输入或私有文件/stdin 传入,不进入聊天、命令参数或日志。 +3. 创建约定的 Tunnel,配置 Tobs 固定地址,只将主机名转发到 Tobs 显示的专用设备网关 loopback 端口。使用内置 cloudflared,不额外启动连接器,不发布 Host 管理入口。custom 位置已被占用时,询问保留哪条,不自动覆盖。 +4. 检查 DNS、可信 HTTPS、WebSocket 转发和 Tobs 公网可达性,按错误原因修复,不跳过证书验证或切换官方 Connect。检查通过前不提供配对码。 +5. 让我在本机扫码、核对 Host 指纹并批准准确手机公钥,配对材料不进入聊天。用手机流量或外部 Wi-Fi 验证真实 Bot 回复,经授权再验证连接器重启后固定地址可用。不能仅凭健康检查或进程运行宣布完成。 +6. 报告修改资源、真实结果和待完成的手机/网络步骤,给出仅针对这条 Tunnel/DNS 的恢复与移除方法。保留 Profile 和其他资源;撤销手机与移除隧道分别处理。 +``` + +## 恢复与移除 + +已启用的 Named Tunnel 随 Host 重启恢复,主机名不变。电脑休眠或停止时无法访问。`dns` 错误检查主机名/DNS 路由;源站失败检查准确的 HTTP loopback 端口;连接器拒绝检查私有令牌/账号。保持 TLS 验证开启。 + +带停止/恢复控件的版本中,停止保留配置;移除忘记该连接,丢失的手机需单独撤销。退役时确认没有其他服务依赖,再只删除这条 Tunnel 和对应 DNS 路由,保留其他连接器与 DNS。 + +## 验证范围 + +[PR #3780](https://github.com/BotHarness/DeepSeekBot/pull/3780) 记录了免费套餐域名上 Named Tunnel 的 iOS 模拟器配对、真实回复、同地址连接器恢复及撤销验证。真机、中国大陆运营商与媒体功能仍需单独验收。 diff --git a/apps/docs/src/content/docs-zh/docs/private-relay.mdx b/apps/docs/src/content/docs-zh/docs/private-relay.mdx new file mode 100644 index 0000000000..bd64f9a0ae --- /dev/null +++ b/apps/docs/src/content/docs-zh/docs/private-relay.mdx @@ -0,0 +1,78 @@ +--- +title: "Docker 私有 Relay" +description: "手动或通过 agent 在自己的服务器上部署多 Host 中继。" +sidebar: + order: 15 +--- + +在自己管理的服务器上运行 Tobs 中继。一个部署支持最多 16 台电脑,各自独立认领和准入,不需要官方 Tobs 账号或 Cloudflare 账号。其他方式见[选择私有连接](private-connect.zh.md)。 + +**需要手机和电脑都能访问的公网 HTTPS 入口。** 可以使用已有公网服务器,或已正确配置公网访问的家用服务器/NAS。仅有域名、仅在家中 NAT 内运行 Docker,都不等于可以远程连接。部署不会自动购买服务器、修改 DNS 或路由器端口,也不保证所有运营商都可达。 + +## 部署 + +中继部署文件与多 Host 配置要求 **Tobs 1.7.0 或更新版本**;Host 更旧时先按[安装/升级教程](https://tobs.app/docs/installation/)升级。打开与已安装 Host 匹配的 [Tobs Release](https://github.com/BotHarness/DeepSeekBot/releases),下载源码归档,将完整 `deploy/private-relay` 目录复制到服务器并记录标签/提交。不要从任意移动分支部署或对现有部署重复初始化。该目录运行中继,不是将 Bot Host 装进 Docker 的镜像。 + +服务器需安装 Docker Compose 和 Node 24。将发布版本的 `deploy/private-relay` 目录复制到你管理的绝对路径,配置已有域名指向服务器,确保公网 TCP 80/443 可达且未被其他服务占用。Caddy 自动申请和续期证书;证书签发与运营商连通性仍需检查。 + +例如文件放在 `/opt/botharness-private`,在**该服务器的 Bash** 中执行;请替换为实际完整目录和域名: + +```bash +node /opt/botharness-private/setup.mjs relay.example.com +docker compose --project-name botharness-private --project-directory /opt/botharness-private --file /opt/botharness-private/compose.yaml up --build --detach +``` + +设置程序生成私有 `.env` 和 `bootstrap.secret`,不会打印密钥。不要提交、截图或分享这些文件。Compose 将密钥传入容器环境,服务器管理员仍可查看;这不能防范服务器管理员。中继以非特权用户运行,持久化准入凭据的哈希,转发加密数据,不保存聊天历史。 + +## 认领与手机配对 + +先检查公网 DNS/TLS,再从服务器之外请求 `https://relay.example.com/health`,应显示支持 `botharness-private-v1` 和 `botharness-private-v2`。健康检查只证明中继可达,不证明手机可用。如果其他服务占用 80/443,保留它并明确适配已有 HTTPS 代理,不原样启动 Compose 示例。 + +1. 在可信电脑打开**Bot 设置 → 连接 → 添加连接 → 用手机连接这台电脑 → 已安装 App,开始连接 → 进阶方式 → Docker 中继**。 +2. 填写 HTTPS 地址,并私下从服务器的 `bootstrap.secret` 复制首次设置密钥。不要发送到聊天或写入命令参数。 +3. 点击**认领并连接**,等待已连接。本机设置成功、容器运行或健康检查成功,均不能证明手机外网可达。 +4. 显示配对码,用手机扫描,核对完整 Host 指纹;再在电脑端核对并批准准确手机公钥。 +5. 从手机向 Bot 发消息,检查真实回复。外网验收使用手机流量,不只是在家中 Wi-Fi 测试。 + +首次成功认领者取得中继管理权;并发和重复认领会被拒绝。中继管理权不等于 Host 控制权,Host 身份和设备批准仍需独立核验。二维码含敏感中继准入信息,不要公开。撤销手机会拒绝 Host 访问并关闭已有加密连接;本切片不会因此替所有其他手机轮换共享中继准入密钥。 + +## 一个中继服务多台电脑 + +一个部署最多服务 16 台电脑。每台电脑有自己的一次性认领密钥、自己的所有者凭据和自己的手机准入,所以和一台电脑配对的手机无法经中继访问另一台,释放或撤销一台电脑也不会影响其他电脑。 + +在服务器上为每台新增电脑生成密钥: + +```bash +node /opt/botharness-private/setup.mjs add-host office-mac +``` + +它会写入 `host-office-mac.secret`(密钥,只留在服务器上),并只把它的哈希追加到 `hosts/keys`。中继每次认领时都会读取这个文件,不需要重启。在那台电脑上按上面的步骤认领,只是粘贴 `host-office-mac.secret` 的内容,而不是 `bootstrap.secret`。第一台电脑继续使用 `bootstrap.secret`。 + +从单台电脑的部署升级:拉取新的 `deploy/private-relay` 文件,在同一个项目目录运行 `docker compose --project-name botharness-private --project-directory /opt/botharness-private --file /opt/botharness-private/compose.yaml up --build --detach`。原有认领、手机和数据卷都照常工作,之后再用 `add-host` 添加电脑。线上协议见[中继标准](private-relay-standard.zh.md),附第三方中继可用的一致性测试脚本。 + +## 失败恢复 + +- **无法连接:**检查公网 DNS、端口、HTTPS 证书和容器状态。不要关闭证书校验;私有连接失败不会偷偷使用官方中继。 +- **已被认领:**回到原电脑和原 Profile,不要为了消除错误删除中继数据卷。 +- **认领时断网:**电脑会在请求前保存私有凭据。只有中继已接受认领时,重启才可重连;认领从未到达中继时,Host 会持续重试控制连接并显示 `private-relay-unreachable`,使用该所有者凭据认证的 `GET /status` 返回 `404`,再次从界面认领可能返回 `private-relay-already-configured`。保留 Profile 和中继状态排查,不重复认领、删除凭据或重置卷来强行恢复。目前没有已定义的重复认领恢复流程。 +- **服务器重启:**保留 `relay-data`、Caddy 数据卷和电脑凭据。删除卷是破坏性重建,不是升级步骤。 +- **手机丢失:**在可信电脑撤销旧设备。若所有可信密钥均丢失,需要重建并重新配对;服务器账号无法恢复旧 Host 身份。 + +停止部署时使用相同的绝对 Compose 路径和项目名执行 `down`,**不要加 `--volumes`**,不要改动其他服务。当前不含离线云队列、远程唤醒、新媒体能力或免费托管保证。中国大陆普通网络仍需单独通过发布验收。 + +CLI 见[私有连接命令](bot-cli.zh.md#docker-私有连接)。真机验收记录在 [#3746](https://github.com/BotHarness/DeepSeekBot/issues/3746);本文不代表已验收通过。 + +## 复制给你的 agent + +复制完整代码块,另外提供公开部署信息和已授权服务器访问方式;认领密钥不进入聊天。 + +```text +帮我在自己的服务器上部署 Tobs Docker 私有 Relay,再连接现有 Host。先读 https://tobs.app/docs/private-relay/ 和 https://tobs.app/docs/private-relay-standard/;不可访问时读 https://github.com/BotHarness/DeepSeekBot/blob/main/docs/private-relay.zh.md 和 https://github.com/BotHarness/DeepSeekBot/blob/main/docs/private-relay-standard.zh.md。缺少时询问公开主机名、已授权服务器访问方式、部署目录和目标 Host。 + +1. 检查 Host 版本/Profile/私有模式,以及服务器 DNS/入站连通性、Docker Compose、Node 24、已有项目和端口归属。家庭内网容器/域名本身不提供公网访问。保留其他服务栈和 Host 数据/配对。Docker Relay 是互斥模式,改变已有私有模式前先询问。 +2. 约定具体资源,不购买基础设施、开启付费服务、替换无关 DNS 或停止占用 80/443 的服务。选择与已安装受支持 Host 匹配的源码发布/标签,记录固定提交,复制完整 deploy/private-relay 目录。需要服务商登录/管理员确认时由我完成。 +3. 仅新部署运行 setup.mjs 配置约定主机名,再以明确项目名和目录启动 Compose。.env、bootstrap.secret、新 Host 密钥和所有者令牌留在本机私有位置;秘密只通过受保护输入/文件/stdin 传递,不进聊天、进程参数或日志。保留已有初始化文件/卷,不为强行认领重置或重复初始化。 +4. 验证公网可信 HTTPS 和 /health,再从实际本机 Host 用界面或 private-connect --hostname --token-stdin --confirm 认领,密钥从私有文件传入。结果未知时不自动重放,检查同一 Profile/状态,不暗中使用官方 Connect。 +5. 让我在本机扫码、核对 Host 指纹并批准准确手机公钥,二维码不进聊天。手机使用流量/外部 Wi-Fi 验证真实 Bot 回复,再经授权保留持久化卷重启并验证手机重连。新增电脑分别使用 add-host 密钥独立批准,不重复使用 bootstrap.secret。 +6. 分别报告服务健康、Host 连接、真实手机回复和待测试项目。提供不泄密的诊断和保留 relay-data/Caddy 卷及 Host Profile 的升级/回退方法。停止用同一项目的 down,不加 --volumes。仅经授权撤销测试手机;退役中继不等于撤销手机。 +``` diff --git a/apps/docs/src/content/docs/docs/private-named-tunnel.mdx b/apps/docs/src/content/docs/docs/private-named-tunnel.mdx new file mode 100644 index 0000000000..8e856acf3d --- /dev/null +++ b/apps/docs/src/content/docs/docs/private-named-tunnel.mdx @@ -0,0 +1,66 @@ +--- +title: "Cloudflare Named Tunnel" +description: "Set up your own fixed tunnel, manually or with your agent." +sidebar: + order: 15 +--- + +Use a fixed hostname under your own Cloudflare account. Tobs runs bundled cloudflared on your computer and opens an outbound tunnel to Cloudflare. Your phone reaches that HTTPS hostname and the tunnel forwards the encrypted device channel to the Host. Your home computer needs no public inbound port. This uses Cloudflare infrastructure, independently of official Tobs Connect. + +Other choices: [private connections](private-connect.md), [HTTPS ingress](private-ingress.md), [Docker relay](private-relay.md). + +## Prepare + +- Install Tobs and the phone App using the [installation guide](https://tobs.app/en/docs/installation/). Keep your existing Host Profile. +- Have a Cloudflare account, a domain on that account, an unused hostname such as `bot.example.com`, and permission to create its Tunnel/DNS route. +- The computer must reach Cloudflare outbound. Domain registration/provider charges are separate; do not assume every account or network is free or supported. + +Use the current [Cloudflare dashboard guide](https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/get-started/create-remote-tunnel/). Do not execute its connector install command: Tobs runs its own connector. + +## Configure the fixed address + +1. In Cloudflare One, open **Networks → Connectors → Cloudflare Tunnels** (dashboard labels can change). Create a Cloudflared Tunnel. Keep its connector token private. +2. Open **Bot settings → Connections → Add connection → Connect your phone to this computer → App installed, start connecting → Advanced methods → Fixed Cloudflare Tunnel**. Older versions show **Private connection → Fixed address**. +3. Enter only the hostname, for example `bot.example.com`, and enter the connector token in the protected field. Save and note Tobs's gateway-only port. The public check may fail until the next step. +4. In that Tunnel's **Published application routes** (formerly Public Hostname), route the hostname to HTTP service `http://127.0.0.1:PORT`, replacing `PORT` with Tobs's exact port. The connector runs on the Host, so loopback refers to the Host. Never forward the DSH web/admin port. +5. Wait for Tobs's public check to pass, show the phone pairing code, and complete [route verification](private-connect.md#verify-the-selected-route). + +An interactive Cloudflare Access login challenge can block the phone's WebSocket; use only a path explicitly compatible with the phone. The hostname or provider account alone never grants Host control. + +## CLI alternative + +New installations provide `tobs`; existing `deepseekbot` users may keep their command. + +Use the existing local Host and its usual connection/token-file arguments. Read the connector token from a private file readable only by you: + +```bash +tobs private-tunnel-enable --hostname bot.example.com --token-stdin --confirm < /absolute/private/connector-token.txt +tobs devices +``` + +Inspect existing routes first. Do not overwrite an occupied custom slot. Newer Hosts also expose [independent route commands](bot-cli.md#independently-managed-private-routes). + +## Copy to your agent + +Copy the whole block; replace the public hostname or let the agent ask for it. + +```text +Configure my existing Tobs Host with my own Cloudflare Named Tunnel. Read https://tobs.app/en/docs/private-named-tunnel/ first; if unavailable, use https://github.com/BotHarness/DeepSeekBot/blob/main/docs/private-named-tunnel.md. My intended hostname: bot.example.com (replace with mine). + +1. Inspect the installed Tobs version, actual running Host/Profile, CLI help, existing private routes and my Cloudflare account/domain access. Preserve data, pairings, DNS and other tunnels. If you cannot operate the computer/account, give exact manual steps and mark them pending. +2. Agree on an unused hostname and the concrete resources/network publication. Do not buy a domain or activate paid services. Let me complete provider login. Handle connector tokens only through protected local input or private files/stdin, never chat, command arguments or logs. +3. Create the agreed Tunnel, configure Tobs Fixed address and forward its hostname only to the gateway-only loopback port Tobs reports. Use bundled cloudflared; do not start a second connector or publish Host administration. If a private route already occupies the custom slot, ask what to keep rather than replacing it automatically. +4. Check DNS, trusted HTTPS, WebSocket forwarding and Tobs public readiness. Fix the reported cause without skipping certificate validation or falling back to official Connect. Do not offer a pairing code until ready. +5. Let me scan locally, compare the Host fingerprint and approve the exact phone key. Keep pairing material out of chat. Verify a real Bot reply on mobile data/outside Wi-Fi and, when authorized, a connector restart on the same hostname. A health check/process alone is not completion. +6. Report changed resources, actual results and pending phone/network steps. Provide recovery and removal instructions limited to this Tunnel/DNS route. Preserve the Profile and unrelated resources; phone revocation is separate from tunnel removal. +``` + +## Recovery and removal + +An enabled Named Tunnel restores with the Host and keeps its hostname. A sleeping/stopped computer is unavailable. For `dns`, check the hostname/DNS route; for an origin failure, check the exact HTTP loopback port; for a connector refusal, check the private token/account. Keep TLS validation enabled. + +On versions with Stop/Resume, Stop retains configuration. Remove forgets that route; revoke a lost phone separately. When retiring the deployment, confirm no other service depends on the Tunnel, then remove only its Tunnel and matching DNS route. Preserve other connectors and DNS records. + +## Qualification + +[PR #3780](https://github.com/BotHarness/DeepSeekBot/pull/3780) records iOS Simulator pairing, real replies, same-address connector recovery and revocation through a Named Tunnel on a free-plan domain. Physical phones, mainland carriers and media features remain separately qualified. diff --git a/apps/docs/src/content/docs/docs/private-relay.mdx b/apps/docs/src/content/docs/docs/private-relay.mdx new file mode 100644 index 0000000000..5c34cc55df --- /dev/null +++ b/apps/docs/src/content/docs/docs/private-relay.mdx @@ -0,0 +1,78 @@ +--- +title: "Docker private relay" +description: "Deploy a multi-Host relay on your server, manually or with your agent." +sidebar: + order: 15 +--- + +Run the Tobs relay on a server you control. One deployment supports up to 16 computers with independent claims and admission. No official Tobs account or Cloudflare account is required. See [Choose a private connection](private-connect.md) for the other options. + +**You need a public HTTPS endpoint reachable by both your phone and computer.** Use an existing public server, or a home/NAS endpoint with correctly configured public connectivity. A domain alone or Docker running only behind home NAT does not provide remote access. This setup does not purchase infrastructure, open router ports, configure DNS, or guarantee connectivity across every carrier. + +## Prepare the server + +Relay deployment files and multi-Host setup require **Tobs 1.7.0 or later**. If the installed Host is older, follow the [installation/upgrade guide](https://tobs.app/en/docs/installation/) first. Open the [Tobs release](https://github.com/BotHarness/DeepSeekBot/releases) matching your installed Host, download its source archive and copy the complete `deploy/private-relay` directory to your server. Record its tag/commit. Do not deploy an arbitrary moving branch or initialize over an existing deployment. This runs a relay, not a Docker image of the Bot Host. + +Install Docker Compose and Node 24 on the server. Copy the released `deploy/private-relay` directory to an absolute directory you control. Point an existing DNS name to that server and make inbound TCP 80/443 reachable. Other applications must not already own these ports. Caddy obtains and renews the HTTPS certificate; certificate issuance and carrier reachability can fail independently. + +For example, if you placed the files at `/opt/botharness-private`, run these commands in **Bash on that server**, substituting your actual full directory and domain: + +```bash +node /opt/botharness-private/setup.mjs relay.example.com +docker compose --project-name botharness-private --project-directory /opt/botharness-private --file /opt/botharness-private/compose.yaml up --build --detach +``` + +Setup creates private `.env` and `bootstrap.secret` files without printing the key. Keep both out of git, screenshots and shared logs. Compose passes the key to its container environment, which machine administrators can inspect; this does not protect secrets from administrators of that server. The relay runs as an unprivileged user, persists only hashed admission credentials, and carries encrypted application frames rather than chat history. + +## Claim and pair + +First check public DNS/TLS and request `https://relay.example.com/health` from outside the server. It should advertise `botharness-private-v1` and `botharness-private-v2`. A health response proves relay reachability, not phone access. If 80/443 belong to another service, preserve it and deliberately adapt the existing HTTPS proxy instead of starting the unmodified Compose example. + +1. On your trusted desktop, open **Bot settings → Connections → Add connection → Connect your phone to this computer → App installed, start connecting → Advanced methods → Docker relay**. +2. Enter the HTTPS origin and privately copy the initial setup key from the server's `bootstrap.secret` file. Do not send it to another person or put it into command arguments. +3. Choose **Claim and connect**. Wait for **Connected**. A successful local setup, container start or health response alone is not proof that your phone can reach it. +4. Choose **Show phone pairing code**. On the native phone, scan it and verify the full Host fingerprint against the trusted desktop. On the desktop, compare and approve the exact phone key. +5. Send a Bot message from the phone and check the actual reply. For external-access acceptance use mobile data, not only home Wi-Fi. + +The first successful claim wins. A repeated or competing claim is refused. Relay admission is not Host authorization: the pinned Host key and per-Host device approval remain mandatory. The QR includes sensitive relay admission material; treat it like a pairing invitation. Revoking a phone denies Host access and closes its active encrypted channels, even though the relay admission token shared by the phones of that computer is not rotated. + +## More computers on one relay + +One deployment serves up to 16 computers. Each computer gets its own one-time claim key, its own owner credential and its own phone admission, so a phone paired with one computer cannot reach another through the relay, and releasing or revoking one computer never affects the others. + +On the server, create a key for each extra computer: + +```bash +node /opt/botharness-private/setup.mjs add-host office-mac +``` + +This writes `host-office-mac.secret` (the key, private to the server) and appends only its hash to `hosts/keys`, which the relay reads on every claim, so no restart is needed. On that computer, claim with the same steps as above but paste the contents of `host-office-mac.secret` instead of `bootstrap.secret`. The first computer keeps using `bootstrap.secret`. + +Upgrading a single-computer deployment: pull the new `deploy/private-relay` files, then `docker compose --project-name botharness-private --project-directory /opt/botharness-private --file /opt/botharness-private/compose.yaml up --build --detach` with the same project directory. The existing claim, phones and volumes keep working unchanged; add more computers with `add-host` afterwards. The wire protocol is documented in [the relay standard](private-relay-standard.md), with a conformance script for third-party relays. + +## Failures and recovery + +- **Cannot reach the service:** check public DNS, inbound ports, HTTPS certificate and Docker status. Do not disable certificate validation. The app does not silently use the official relay. +- **Already claimed:** continue from the original desktop/Profile. Do not delete the relay data volume to make the error disappear. +- **Connection interrupted during claim:** the desktop saves private owner credentials before claiming. Restart reconnects only if the relay accepted that claim. If the claim never reached the relay, the Host keeps retrying its control connection with `private-relay-unreachable`; an authenticated `GET /status` with that owner credential returns `404`. Repeating the in-app claim can report `private-relay-already-configured`. Preserve the Profile and relay state for diagnosis; do not repeat the claim, delete credentials or reset volumes to force recovery. No repeat-claim recovery procedure is currently defined. +- **Server restart:** retain the `relay-data` and Caddy volumes and the desktop credential store. The same owner and phone pairing should reconnect. Removing a volume is destructive recovery, not an upgrade step. +- **Phone lost:** use the Host's existing paired-device revoke control. If all trusted Host credentials are lost, rebuild and re-pair; a server account cannot recover the original Host identity. + +Stop only this deployment with the same absolute Compose path and project name, using `down` **without** `--volumes`. Do not touch unrelated stacks. This candidate has no cloud offline queue, no remote wake, no new media promise, and no guaranteed free hosting allowance. Mainland ordinary-network qualification remains an explicit release gate. + +CLI operators can use [the private connection commands](bot-cli.md#docker-private-connectivity). Native acceptance evidence is tracked in [#3746](https://github.com/BotHarness/DeepSeekBot/issues/3746); this guide does not claim that acceptance has passed. + +## Copy to your agent + +Copy this whole block. Provide public deployment inputs and authorized server access separately; keep bootstrap keys out of chat. + +```text +Deploy a Tobs Docker private relay on my own server and connect my existing Host. Read https://tobs.app/en/docs/private-relay/ and https://tobs.app/en/docs/private-relay-standard/. If unavailable, read https://github.com/BotHarness/DeepSeekBot/blob/main/docs/private-relay.md and https://github.com/BotHarness/DeepSeekBot/blob/main/docs/private-relay-standard.md. Ask for the public hostname, authorized server access, deployment directory and target Host if missing. + +1. Inspect the Host version/Profile/private mode and server DNS/inbound connectivity, Docker Compose, Node 24, existing projects and port ownership. A home-only container/domain does not create internet reachability. Preserve other stacks and Host data/pairings. Docker relay is exclusive: ask before changing an existing private mode. +2. Agree on concrete resources. Do not purchase infrastructure, activate paid services, replace unrelated DNS or stop another service on 80/443. Use the source release/tag matching the supported installed Host, record its immutable revision and copy the complete deploy/private-relay directory. Let me complete provider login/privileged confirmation when needed. +3. Only for a new deployment, run setup.mjs with the agreed hostname, then Compose with an explicit project name and directory. Keep .env, bootstrap.secret, extra Host keys and owner tokens private. Secrets enter through protected local input/files/stdin, never chat, process arguments or logs. Preserve existing setup files/volumes; do not reset or repeat initialization to force a claim. +4. Verify public trusted HTTPS and /health. Claim from the actual local Host using its UI or private-connect --hostname --token-stdin --confirm with the key from a private file. Never automatically replay an unknown-outcome claim; inspect the same Profile/status. Do not fall back to official Connect. +5. Let me scan locally, compare the Host fingerprint and approve the exact phone key. Keep the QR out of chat. Verify a real Bot reply on mobile data/outside Wi-Fi, then an authorized restart retaining persistent volumes and phone reconnect. Additional computers each need a separate add-host key and independent approval; never reuse bootstrap.secret. +6. Report service health, Host connection, actual phone reply and pending checks separately. Provide diagnostics without secrets and upgrade/rollback instructions retaining relay-data/Caddy volumes and the Host Profile. Shutdown uses the same project's down without --volumes. Revoke a test phone only when authorized; retiring the relay is not phone revocation. +``` diff --git a/apps/mobile/app/(tabs)/(home)/index.tsx b/apps/mobile/app/(tabs)/(home)/index.tsx index 52f9c7d87c..d0fb2af40c 100644 --- a/apps/mobile/app/(tabs)/(home)/index.tsx +++ b/apps/mobile/app/(tabs)/(home)/index.tsx @@ -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'; @@ -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'; @@ -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, @@ -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; diff --git a/apps/mobile/app/(tabs)/(settings)/settings.tsx b/apps/mobile/app/(tabs)/(settings)/settings.tsx index 5128163cfe..61922bd4a0 100644 --- a/apps/mobile/app/(tabs)/(settings)/settings.tsx +++ b/apps/mobile/app/(tabs)/(settings)/settings.tsx @@ -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'; diff --git a/apps/mobile/app/+native-intent.tsx b/apps/mobile/app/+native-intent.tsx index d1c799434e..09bb5c9ecb 100644 --- a/apps/mobile/app/+native-intent.tsx +++ b/apps/mobile/app/+native-intent.tsx @@ -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 }) { diff --git a/apps/mobile/app/_layout.tsx b/apps/mobile/app/_layout.tsx index 832f28c2af..e36d8313f8 100644 --- a/apps/mobile/app/_layout.tsx +++ b/apps/mobile/app/_layout.tsx @@ -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'; diff --git a/apps/mobile/app/browser/[slug].tsx b/apps/mobile/app/browser/[slug].tsx index f71b305049..fcc0b87831 100644 --- a/apps/mobile/app/browser/[slug].tsx +++ b/apps/mobile/app/browser/[slug].tsx @@ -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'; @@ -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'; diff --git a/apps/mobile/app/computer/[slug].tsx b/apps/mobile/app/computer/[slug].tsx index e8dc0dd24f..83571cd4ca 100644 --- a/apps/mobile/app/computer/[slug].tsx +++ b/apps/mobile/app/computer/[slug].tsx @@ -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, @@ -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 { @@ -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'; diff --git a/apps/mobile/app/host-connection.tsx b/apps/mobile/app/host-connection.tsx index 5e1c7a01cb..f81c22f8eb 100644 --- a/apps/mobile/app/host-connection.tsx +++ b/apps/mobile/app/host-connection.tsx @@ -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'; diff --git a/apps/mobile/app/inbox/[id].tsx b/apps/mobile/app/inbox/[id].tsx index 599da08626..49b2840ff7 100644 --- a/apps/mobile/app/inbox/[id].tsx +++ b/apps/mobile/app/inbox/[id].tsx @@ -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'; diff --git a/apps/mobile/app/member-pairing.tsx b/apps/mobile/app/member-pairing.tsx index 584b9ea1e0..9d43c972c0 100644 --- a/apps/mobile/app/member-pairing.tsx +++ b/apps/mobile/app/member-pairing.tsx @@ -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'; diff --git a/apps/mobile/app/pair/account.tsx b/apps/mobile/app/pair/account.tsx index 2029833cb3..ba73f920b8 100644 --- a/apps/mobile/app/pair/account.tsx +++ b/apps/mobile/app/pair/account.tsx @@ -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'; diff --git a/apps/mobile/app/pair/index.tsx b/apps/mobile/app/pair/index.tsx index 67dbb95a1f..054d193874 100644 --- a/apps/mobile/app/pair/index.tsx +++ b/apps/mobile/app/pair/index.tsx @@ -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'; diff --git a/apps/mobile/app/pair/tailscale.tsx b/apps/mobile/app/pair/tailscale.tsx index 6d86455dde..dd4096141a 100644 --- a/apps/mobile/app/pair/tailscale.tsx +++ b/apps/mobile/app/pair/tailscale.tsx @@ -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'; diff --git a/apps/mobile/app/pair/team.tsx b/apps/mobile/app/pair/team.tsx index 24f4f8682e..d12deb4371 100644 --- a/apps/mobile/app/pair/team.tsx +++ b/apps/mobile/app/pair/team.tsx @@ -1,10 +1,11 @@ +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, @@ -12,7 +13,7 @@ import { 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'; @@ -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((resolve) => - Alert.alert( + showAppDialog( t.teamSignIn.switchTitle, t.teamSignIn.switchBody.replace('{name}', host.member?.displayName ?? ''), [ diff --git a/apps/mobile/app/qa/account-actions.tsx b/apps/mobile/app/qa/account-actions.tsx index fe7ed9172b..07c0a9dfe4 100644 --- a/apps/mobile/app/qa/account-actions.tsx +++ b/apps/mobile/app/qa/account-actions.tsx @@ -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'; diff --git a/apps/mobile/app/settings/storage.tsx b/apps/mobile/app/settings/storage.tsx index 5ef4d0f64e..613bddc85c 100644 --- a/apps/mobile/app/settings/storage.tsx +++ b/apps/mobile/app/settings/storage.tsx @@ -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'; @@ -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'; diff --git a/apps/mobile/app/settings/usage.tsx b/apps/mobile/app/settings/usage.tsx index 5bfb7f6fab..8b69c682ea 100644 --- a/apps/mobile/app/settings/usage.tsx +++ b/apps/mobile/app/settings/usage.tsx @@ -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() { diff --git a/apps/mobile/app/sign-in.tsx b/apps/mobile/app/sign-in.tsx index 55d7874e7f..46bcfcf95d 100644 --- a/apps/mobile/app/sign-in.tsx +++ b/apps/mobile/app/sign-in.tsx @@ -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'; diff --git a/apps/mobile/package.json b/apps/mobile/package.json index 20404c0412..4fcab969cb 100644 --- a/apps/mobile/package.json +++ b/apps/mobile/package.json @@ -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", diff --git a/apps/mobile/scripts/generate-palette.mjs b/apps/mobile/scripts/generate-palette.mjs index fb221af691..323f62d2b2 100644 --- a/apps/mobile/scripts/generate-palette.mjs +++ b/apps/mobile/scripts/generate-palette.mjs @@ -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', diff --git a/apps/mobile/scripts/web-preview/host-look.ts b/apps/mobile/scripts/web-preview/host-look.ts index 2c49bdacdc..ca2a79f935 100644 --- a/apps/mobile/scripts/web-preview/host-look.ts +++ b/apps/mobile/scripts/web-preview/host-look.ts @@ -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'; diff --git a/apps/mobile/scripts/web-preview/notification-preferences.ts b/apps/mobile/scripts/web-preview/notification-preferences.ts index ffc669bd2f..6421506d51 100644 --- a/apps/mobile/scripts/web-preview/notification-preferences.ts +++ b/apps/mobile/scripts/web-preview/notification-preferences.ts @@ -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'; diff --git a/apps/mobile/src/account/account-profile.ts b/apps/mobile/src/account/account-profile.ts index a65a291a43..e88ee5dec3 100644 --- a/apps/mobile/src/account/account-profile.ts +++ b/apps/mobile/src/account/account-profile.ts @@ -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; diff --git a/apps/mobile/src/host/account-action-fixture.ts b/apps/mobile/src/host/account-action-fixture.ts index 9e27708b58..4578626089 100644 --- a/apps/mobile/src/host/account-action-fixture.ts +++ b/apps/mobile/src/host/account-action-fixture.ts @@ -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' diff --git a/apps/mobile/src/host/account-connections.ts b/apps/mobile/src/host/account-connections.ts index eeeb325a30..604f2442f5 100644 --- a/apps/mobile/src/host/account-connections.ts +++ b/apps/mobile/src/host/account-connections.ts @@ -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; diff --git a/apps/mobile/src/host/account-host-look.ts b/apps/mobile/src/host/account-host-look.ts index 1c07c6e13e..b1ef1df081 100644 --- a/apps/mobile/src/host/account-host-look.ts +++ b/apps/mobile/src/host/account-host-look.ts @@ -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()}`; diff --git a/apps/mobile/src/host/account-pairing.ts b/apps/mobile/src/host/account-pairing.ts index 1e4a8457e5..3af7481064 100644 --- a/apps/mobile/src/host/account-pairing.ts +++ b/apps/mobile/src/host/account-pairing.ts @@ -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( diff --git a/apps/mobile/src/host/activity-count.ts b/apps/mobile/src/host/activity-count.ts index b60f74c419..6ccecbd684 100644 --- a/apps/mobile/src/host/activity-count.ts +++ b/apps/mobile/src/host/activity-count.ts @@ -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', diff --git a/apps/mobile/src/host/activity-sources.ts b/apps/mobile/src/host/activity-sources.ts index 7c668031a3..b114931dd0 100644 --- a/apps/mobile/src/host/activity-sources.ts +++ b/apps/mobile/src/host/activity-sources.ts @@ -1,6 +1,7 @@ -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, @@ -8,8 +9,8 @@ import { 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; @@ -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, + }), }, ]; }); diff --git a/apps/mobile/src/host/approval-records.ts b/apps/mobile/src/host/approval-records.ts index 1613a8612d..9531376775 100644 --- a/apps/mobile/src/host/approval-records.ts +++ b/apps/mobile/src/host/approval-records.ts @@ -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' diff --git a/apps/mobile/src/host/assignment-timeline.ts b/apps/mobile/src/host/assignment-timeline.ts index b647a76314..841bb9d223 100644 --- a/apps/mobile/src/host/assignment-timeline.ts +++ b/apps/mobile/src/host/assignment-timeline.ts @@ -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'; diff --git a/apps/mobile/src/host/bot-access.ts b/apps/mobile/src/host/bot-access.ts index 7a4f4dea11..c45ae2a8ed 100644 --- a/apps/mobile/src/host/bot-access.ts +++ b/apps/mobile/src/host/bot-access.ts @@ -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'; diff --git a/apps/mobile/src/host/bot-activity.ts b/apps/mobile/src/host/bot-activity.ts index 99e514ff51..198e099938 100644 --- a/apps/mobile/src/host/bot-activity.ts +++ b/apps/mobile/src/host/bot-activity.ts @@ -1,4 +1,4 @@ -import type { HostClient } from './client'; +import type { HostClient } from '@botharness/host-client/client'; import { isDay, shiftDay, trailingDays, weekStart } from './usage-days'; import type { ProfileActivity, @@ -6,7 +6,7 @@ import type { ProfileActivityReasonDay, ProfileActivityTokensDay, ProfileModelUsageRow, -} from './wire'; +} from '@botharness/host-protocol/wire'; export const ACTIVITY_WINDOWS = [1, 4, 26] as const; export type ActivityWindow = (typeof ACTIVITY_WINDOWS)[number]; diff --git a/apps/mobile/src/host/bot-avatar.ts b/apps/mobile/src/host/bot-avatar.ts index 3571be91b7..4771f55ebe 100644 --- a/apps/mobile/src/host/bot-avatar.ts +++ b/apps/mobile/src/host/bot-avatar.ts @@ -1,5 +1,5 @@ import { dmChannel, type ProfileBotRef } from './bot-profile'; -import type { HostClient } from './client'; +import type { HostClient } from '@botharness/host-client/client'; export async function setBotAvatar( client: HostClient, diff --git a/apps/mobile/src/host/bot-creation-entry.ts b/apps/mobile/src/host/bot-creation-entry.ts index 8a3b537a2d..abf289d0d4 100644 --- a/apps/mobile/src/host/bot-creation-entry.ts +++ b/apps/mobile/src/host/bot-creation-entry.ts @@ -1,4 +1,4 @@ -import type { createBotCreationController } from './bot-creation'; +import type { createBotCreationController } from '@botharness/host-client/bot-creation'; export type CreationEntrySource = 'blank' | 'git' | 'zip'; type Controller = ReturnType; diff --git a/apps/mobile/src/host/bot-creation-navigation.ts b/apps/mobile/src/host/bot-creation-navigation.ts index 2cc85edf31..6ef72db3a9 100644 --- a/apps/mobile/src/host/bot-creation-navigation.ts +++ b/apps/mobile/src/host/bot-creation-navigation.ts @@ -1,4 +1,4 @@ -import type { CreationSnapshot } from './bot-creation'; +import type { CreationSnapshot } from '@botharness/host-client/bot-creation'; export async function openBotCreationResult( port: { diff --git a/apps/mobile/src/host/bot-creation-steps.ts b/apps/mobile/src/host/bot-creation-steps.ts index 2d2c6808c4..d5582113a9 100644 --- a/apps/mobile/src/host/bot-creation-steps.ts +++ b/apps/mobile/src/host/bot-creation-steps.ts @@ -1,4 +1,4 @@ -import type { BotCreationDraft, BotCreationOperation } from './bot-creation'; +import type { BotCreationDraft, BotCreationOperation } from '@botharness/host-client/bot-creation'; import { hostUnavailable, type HostStatus } from './host-glance'; export type CreationFlow = 'blank' | 'git' | 'zip' | 'marketplace'; diff --git a/apps/mobile/src/host/bot-inbox.ts b/apps/mobile/src/host/bot-inbox.ts index 1910af7b7c..9d81d9cf50 100644 --- a/apps/mobile/src/host/bot-inbox.ts +++ b/apps/mobile/src/host/bot-inbox.ts @@ -1,5 +1,5 @@ -import type { HostClient } from './client'; -import type { BotInboxItem, BotInboxPage } from './wire'; +import type { HostClient } from '@botharness/host-client/client'; +import type { BotInboxItem, BotInboxPage } from '@botharness/host-protocol/wire'; export const BOT_INBOX_PAGE = 30; diff --git a/apps/mobile/src/host/bot-name.ts b/apps/mobile/src/host/bot-name.ts index 1333984112..d6a7465b3e 100644 --- a/apps/mobile/src/host/bot-name.ts +++ b/apps/mobile/src/host/bot-name.ts @@ -1,4 +1,4 @@ -import type { HostClient } from './client'; +import type { HostClient } from '@botharness/host-client/client'; export async function renameBot( client: HostClient, diff --git a/apps/mobile/src/host/bot-profile.ts b/apps/mobile/src/host/bot-profile.ts index 92f264952f..0f5634bb71 100644 --- a/apps/mobile/src/host/bot-profile.ts +++ b/apps/mobile/src/host/bot-profile.ts @@ -1,5 +1,10 @@ import { loadProfileActivity } from './bot-activity'; -import { MethodRefused, type HostClient, type RosterChannel, type RosterView } from './client'; +import { + MethodRefused, + type HostClient, + type RosterChannel, + type RosterView, +} from '@botharness/host-client/client'; import type { BotScheduleSummary, MemoryFile, @@ -7,7 +12,7 @@ import type { MemoryStanding, ProfileActivity, WorkspaceGrantSummary, -} from './wire'; +} from '@botharness/host-protocol/wire'; export type ProfilePart = | { status: 'ready'; value: T; staleError?: string } diff --git a/apps/mobile/src/host/call-post.ts b/apps/mobile/src/host/call-post.ts index 4dd9635d90..66337074bd 100644 --- a/apps/mobile/src/host/call-post.ts +++ b/apps/mobile/src/host/call-post.ts @@ -3,7 +3,7 @@ import { VOICE_CALL_LIMITS, VOICE_CALL_PATH, } from '../../../../packages/core/src/voice/call-contract'; -import type { HostClient } from './client'; +import type { HostClient } from '@botharness/host-client/client'; export function createCallPost(api: HostClient | undefined): CallPost { return async (body) => { diff --git a/apps/mobile/src/host/call-test-diagnostics.ts b/apps/mobile/src/host/call-test-diagnostics.ts index 764b478d49..817223be84 100644 --- a/apps/mobile/src/host/call-test-diagnostics.ts +++ b/apps/mobile/src/host/call-test-diagnostics.ts @@ -4,7 +4,7 @@ import { type CallClientState, type CallPost, } from '../../../../packages/core/src/voice/call-client'; -import { isConnectRoute, isLanRoute, isLoopbackRoute } from './route'; +import { isConnectRoute, isLanRoute, isLoopbackRoute } from '@botharness/host-protocol/route'; const PHASES = [ 'connecting', diff --git a/apps/mobile/src/host/catch-up.ts b/apps/mobile/src/host/catch-up.ts index 03435f2d3b..45410bf85a 100644 --- a/apps/mobile/src/host/catch-up.ts +++ b/apps/mobile/src/host/catch-up.ts @@ -1,6 +1,6 @@ -import type { CachedChanges } from './conversation'; +import type { CachedChanges } from '@botharness/host-client/conversation'; import { applyStoredChanges } from './local-conversation-cache'; -import type { LocalStore } from './local-store'; +import type { LocalStore } from '@botharness/host-client/local-store'; type ChangePage = { reset: true } | (CachedChanges & { reset?: never; hasMore: boolean }); diff --git a/apps/mobile/src/host/channel-creation-transport.ts b/apps/mobile/src/host/channel-creation-transport.ts index 0ea4924fea..9cecb49062 100644 --- a/apps/mobile/src/host/channel-creation-transport.ts +++ b/apps/mobile/src/host/channel-creation-transport.ts @@ -4,9 +4,9 @@ import { MethodRefused, type HostClient, type RemoteSource, -} from './client'; -import type { SavedHost } from './hosts'; -import type { HostCarrier } from './carrier'; +} from '@botharness/host-client/client'; +import type { SavedHost } from '@botharness/host-client/hosts'; +import type { HostCarrier } from '@botharness/host-protocol/carrier'; import { ChannelCreationNotAccepted, type ChannelCreationPort } from './channel-creation'; export function channelCreationTransport( diff --git a/apps/mobile/src/host/channel-creation.ts b/apps/mobile/src/host/channel-creation.ts index 8ece72168b..6cdbecd6cb 100644 --- a/apps/mobile/src/host/channel-creation.ts +++ b/apps/mobile/src/host/channel-creation.ts @@ -1,4 +1,4 @@ -import type { RemoteSource, RosterBot } from './client'; +import type { RemoteSource, RosterBot } from '@botharness/host-client/client'; export interface ChannelCandidate extends Pick< RosterBot, diff --git a/apps/mobile/src/host/channel-files.ts b/apps/mobile/src/host/channel-files.ts index fdac7dc4bf..daa5a6fb41 100644 --- a/apps/mobile/src/host/channel-files.ts +++ b/apps/mobile/src/host/channel-files.ts @@ -1,12 +1,12 @@ -import type { HostClient } from './client'; -import { attachmentsOf, type MessageAttachment } from './conversation'; +import type { HostClient } from '@botharness/host-client/client'; +import { attachmentsOf, type MessageAttachment } from '@botharness/host-client/conversation'; import type { ChannelLiveFrame, JournalEntry, JournalPage, RosterLiveFrame, WireAuthor, -} from './wire'; +} from '@botharness/host-protocol/wire'; export interface ChannelFile { key: string; diff --git a/apps/mobile/src/host/connect-follow.ts b/apps/mobile/src/host/connect-follow.ts index fc29f6793d..8a08f343ea 100644 --- a/apps/mobile/src/host/connect-follow.ts +++ b/apps/mobile/src/host/connect-follow.ts @@ -1,6 +1,6 @@ -import type { ConnectHost } from './connect-account'; -import type { SavedHost } from './hosts'; -import { isConnectRoute } from './route'; +import type { ConnectHost } from '@botharness/host-client/connect-account'; +import type { SavedHost } from '@botharness/host-client/hosts'; +import { isConnectRoute } from '@botharness/host-protocol/route'; export interface ConnectFollow { hostId: string; diff --git a/apps/mobile/src/host/connection-summary.ts b/apps/mobile/src/host/connection-summary.ts index 6653e2682f..ec3e4c4339 100644 --- a/apps/mobile/src/host/connection-summary.ts +++ b/apps/mobile/src/host/connection-summary.ts @@ -1,5 +1,5 @@ -import type { HostSnapshot } from './client'; -import type { InboxSnapshot } from './inbox'; +import type { HostSnapshot } from '@botharness/host-client/client'; +import type { InboxSnapshot } from '@botharness/host-client/inbox'; export interface ConnectionSummary { hosts: number; diff --git a/apps/mobile/src/host/conversation-environments.ts b/apps/mobile/src/host/conversation-environments.ts index 074e557591..757da2debb 100644 --- a/apps/mobile/src/host/conversation-environments.ts +++ b/apps/mobile/src/host/conversation-environments.ts @@ -1,5 +1,5 @@ import type { ConversationWorkspace } from '../cloud/conversations'; -import type { HostColorId, HostIcon } from '../ui/design/host-look'; +import type { HostColorId, HostIcon } from '@botharness/host-client/ui/design/host-look'; export type ConversationEnvironment = { key: string; diff --git a/apps/mobile/src/host/conversation-playback.ts b/apps/mobile/src/host/conversation-playback.ts index 82ae0b3ded..62cd18189d 100644 --- a/apps/mobile/src/host/conversation-playback.ts +++ b/apps/mobile/src/host/conversation-playback.ts @@ -1,4 +1,8 @@ -import type { Conversation, ConversationDraft, ConversationMessage } from './conversation'; +import type { + Conversation, + ConversationDraft, + ConversationMessage, +} from '@botharness/host-client/conversation'; import { playbackTiming, type TextPlayback } from './text-playback'; import { createPlaybackRuntime, type PlaybackRuntime } from './playback-runtime'; diff --git a/apps/mobile/src/host/deletion.ts b/apps/mobile/src/host/deletion.ts index dce5516025..14beb9d472 100644 --- a/apps/mobile/src/host/deletion.ts +++ b/apps/mobile/src/host/deletion.ts @@ -1,4 +1,4 @@ -import type { HostClient } from './client'; +import type { HostClient } from '@botharness/host-client/client'; import type { PersonaBotDeletionPreview, PersonaBotDeletion, diff --git a/apps/mobile/src/host/delivery-receipt.ts b/apps/mobile/src/host/delivery-receipt.ts index bce0ee3859..386203e102 100644 --- a/apps/mobile/src/host/delivery-receipt.ts +++ b/apps/mobile/src/host/delivery-receipt.ts @@ -1,5 +1,5 @@ -import type { ConversationMessage } from './conversation'; -import type { WireDeliveryState } from './wire'; +import type { ConversationMessage } from '@botharness/host-client/conversation'; +import type { WireDeliveryState } from '@botharness/host-protocol/wire'; export type ReceiptState = WireDeliveryState | 'missing'; diff --git a/apps/mobile/src/host/device-alerts.ts b/apps/mobile/src/host/device-alerts.ts index 2388a1a9da..ee833bf45b 100644 --- a/apps/mobile/src/host/device-alerts.ts +++ b/apps/mobile/src/host/device-alerts.ts @@ -1,5 +1,5 @@ -import type { HumanAttentionItem } from './wire'; -import type { PushKind, PushPreferences } from './push'; +import type { HumanAttentionItem } from '@botharness/host-protocol/wire'; +import type { PushKind, PushPreferences } from '@botharness/host-client/push'; const kinds: Record = { 'tool-approval': 'approval', diff --git a/apps/mobile/src/host/direct-channel.ts b/apps/mobile/src/host/direct-channel.ts index 4fcf7f6ff4..53c2f14922 100644 --- a/apps/mobile/src/host/direct-channel.ts +++ b/apps/mobile/src/host/direct-channel.ts @@ -1,4 +1,4 @@ -import type { HostSocket, HostSocketEvents } from './carrier'; +import type { HostSocket, HostSocketEvents } from '@botharness/host-protocol/carrier'; export const DIRECT_STUN = ['stun:stun.cloudflare.com:3478', 'stun:stun.l.google.com:19302']; diff --git a/apps/mobile/src/host/dm-activity.ts b/apps/mobile/src/host/dm-activity.ts index c014d3b63e..dd19ca1a8c 100644 --- a/apps/mobile/src/host/dm-activity.ts +++ b/apps/mobile/src/host/dm-activity.ts @@ -1,4 +1,4 @@ -import type { ConversationMessage } from './conversation'; +import type { ConversationMessage } from '@botharness/host-client/conversation'; export type DmActivityKind = 'posts' | 'memory'; export type DmActivitySettings = Record>; diff --git a/apps/mobile/src/host/email-code-bridge.ts b/apps/mobile/src/host/email-code-bridge.ts index d987719397..e86d726e92 100644 --- a/apps/mobile/src/host/email-code-bridge.ts +++ b/apps/mobile/src/host/email-code-bridge.ts @@ -1,4 +1,4 @@ -import type { EmailCodeFlow, EmailCodeOutcome } from './connect-account'; +import type { EmailCodeFlow, EmailCodeOutcome } from '@botharness/host-client/connect-account'; interface Pending { flow: EmailCodeFlow; diff --git a/apps/mobile/src/host/group-channel.ts b/apps/mobile/src/host/group-channel.ts index e6f722f23c..bbabcf58ad 100644 --- a/apps/mobile/src/host/group-channel.ts +++ b/apps/mobile/src/host/group-channel.ts @@ -1,5 +1,10 @@ import { workRows, type ProfileAssignment } from './bot-profile'; -import type { HostClient, RosterBot, RosterChannel, RosterView } from './client'; +import type { + HostClient, + RosterBot, + RosterChannel, + RosterView, +} from '@botharness/host-client/client'; export const GROUP_NAME_MAX = 120; diff --git a/apps/mobile/src/host/host-availability.ts b/apps/mobile/src/host/host-availability.ts index b8f8ba78b0..aa1eacd8cc 100644 --- a/apps/mobile/src/host/host-availability.ts +++ b/apps/mobile/src/host/host-availability.ts @@ -1,4 +1,4 @@ -import type { HostSnapshot } from './client'; +import type { HostSnapshot } from '@botharness/host-client/client'; import { liveGlance, type HostStatus } from './host-glance'; interface AvailabilityHost { diff --git a/apps/mobile/src/host/host-dictation.ts b/apps/mobile/src/host/host-dictation.ts index 7175e586f8..fc46d9d2a3 100644 --- a/apps/mobile/src/host/host-dictation.ts +++ b/apps/mobile/src/host/host-dictation.ts @@ -1,5 +1,5 @@ import { createVoiceDictationPort } from '../../../../packages/core/src/voice/dictation-client'; -import type { HostClient } from './client'; +import type { HostClient } from '@botharness/host-client/client'; const READINESS_TIMEOUT_MS = 2_500; const READINESS_TTL_MS = 60_000; diff --git a/apps/mobile/src/host/host-glance.ts b/apps/mobile/src/host/host-glance.ts index 37acc34ec1..9067090543 100644 --- a/apps/mobile/src/host/host-glance.ts +++ b/apps/mobile/src/host/host-glance.ts @@ -1,7 +1,7 @@ -import type { ConnectionState, HostClient } from './client'; -import type { SavedHost } from './hosts'; -import { actionCount, type InboxSnapshot } from './inbox'; -import type { HumanAttentionPage } from './wire'; +import type { ConnectionState, HostClient } from '@botharness/host-client/client'; +import type { SavedHost } from '@botharness/host-client/hosts'; +import { actionCount, type InboxSnapshot } from '@botharness/host-client/inbox'; +import type { HumanAttentionPage } from '@botharness/host-protocol/wire'; export type HostStatus = 'online' | 'offline' | 'checking' | 'refused'; diff --git a/apps/mobile/src/host/host-session.ts b/apps/mobile/src/host/host-session.ts index ee46bfdbed..c29a5ceb30 100644 --- a/apps/mobile/src/host/host-session.ts +++ b/apps/mobile/src/host/host-session.ts @@ -1,9 +1,10 @@ -import type { TeamResult } from './team-invitation'; -import { identitySwitchRequired } from './member-identity'; +import { installedAppVersion } from './app-version'; +import type { TeamResult } from '@botharness/host-protocol/team-invitation'; +import { identitySwitchRequired } from '@botharness/host-client/member-identity'; import { hostStore, hostStoreAvailable } from './host-store'; -import type { AccountOwner } from './account-owner'; +import type { AccountOwner } from '@botharness/host-client/account-owner'; import { removeAccountConnections } from './account-connections'; -import type { ConnectHost } from './connect-account'; +import type { ConnectHost } from '@botharness/host-client/connect-account'; import { followConnectHosts } from './connect-follow'; import { sourceDrafts } from './native-source-drafts'; import { use, useCallback, useMemo, useSyncExternalStore } from 'react'; @@ -11,13 +12,27 @@ import { HostScope } from './host-scope'; import { useFocusEffect } from 'expo-router'; import { AppState, Platform } from 'react-native'; -import { createHostClient, type HostClient, type HostSnapshot } from './client'; -import { createInbox, type Inbox, type InboxSnapshot } from './inbox'; -import { createConversation, type Conversation, type ConversationSnapshot } from './conversation'; +import { + createHostClient, + type HostClient, + type HostSnapshot, +} from '@botharness/host-client/client'; +import { createInbox, type Inbox, type InboxSnapshot } from '@botharness/host-client/inbox'; +import { + createConversation, + type Conversation, + type ConversationSnapshot, +} from '@botharness/host-client/conversation'; import { createConversationPlayback, type ConversationPlayback } from './conversation-playback'; import { useVisibleSnapshot } from './use-visible-snapshot'; import { hostAvailabilitySource } from './host-availability'; -import { currentHost, selectHost, withHost, withoutHost, type SavedHosts } from './hosts'; +import { + currentHost, + selectHost, + withHost, + withoutHost, + type SavedHosts, +} from '@botharness/host-client/hosts'; import { catchUpHostConversations, conversationCache, @@ -35,8 +50,8 @@ import { nativeCarrier } from './native-carrier'; import { nativeNotifications } from './native-notifications'; import { notificationAvatars } from './native-notification-avatars'; import { avatarInputs } from './notification-avatars'; -import { revokePairing } from './pairing'; -import { createHostPush, type PushDelivery } from './push'; +import { revokePairing } from '@botharness/host-client/pairing'; +import { createHostPush, type PushDelivery } from '@botharness/host-client/push'; import { createPushSession, type PushStatus } from './push-session'; import { notificationPreferences } from './native-notification-preferences'; import { connectionMode } from './native-connection-mode'; @@ -48,8 +63,8 @@ import { connectionSummary } from './connection-summary'; import { createQuietChannels } from './quiet-channels'; import { loadSavedHosts, saveHosts, type SavedHost } from './saved-host'; import { mobileTelemetry } from '../telemetry/native'; -import { createConnectionTelemetry } from '../telemetry/connection'; -import type { ConnectionTrigger } from '../telemetry/schema'; +import { createConnectionTelemetry } from '@botharness/host-client/telemetry/connection'; +import type { ConnectionTrigger } from '@botharness/host-client/telemetry/schema'; import { forgetRecentChats } from '../ui/shell/recent-chats'; import { locale, t } from '../ui/strings'; @@ -278,7 +293,9 @@ connectionMode.onApproval(({ hostId, itemId }) => { function connect(saved: SavedHost, trigger: ConnectionTrigger) { deviceAlerts.paired(saved.hostId); + const appVersion = installedAppVersion(); const client = createHostClient({ + ...(appVersion === undefined ? {} : { appVersion }), ...saved, onRoutePreferenceChanged: (routePreference) => serialize(async () => { @@ -320,7 +337,10 @@ function connect(saved: SavedHost, trigger: ConnectionTrigger) { }); clientHosts.set(client, saved.hostId); warmHostConversations(saved.hostId); - const inbox = createInbox(client, { notifications: localAlerts }); + const inbox = createInbox(client, { + notifications: localAlerts, + activityUpdateHost: () => t.activityUpdateHost, + }); const offInbox = inbox.subscribe(() => { reflectInbox(saved.hostId, inbox); publishFeeds(); diff --git a/apps/mobile/src/host/host-store.ts b/apps/mobile/src/host/host-store.ts index 29a2f33b98..284aa97f8d 100644 --- a/apps/mobile/src/host/host-store.ts +++ b/apps/mobile/src/host/host-store.ts @@ -1,4 +1,4 @@ -import { LocalStoreError, type LocalStore } from './local-store'; +import { LocalStoreError, type LocalStore } from '@botharness/host-client/local-store'; export interface HostStoreOpener { open(hostId: string): Promise; diff --git a/apps/mobile/src/host/human.ts b/apps/mobile/src/host/human.ts index d36ac475f4..dd383f1ac3 100644 --- a/apps/mobile/src/host/human.ts +++ b/apps/mobile/src/host/human.ts @@ -1,4 +1,4 @@ -import type { HostClient } from './client'; +import type { HostClient } from '@botharness/host-client/client'; export function humanNameOf(identity: unknown): string | undefined { const name = diff --git a/apps/mobile/src/host/live-activity-session.ts b/apps/mobile/src/host/live-activity-session.ts index ddfb2b9f87..69677c4515 100644 --- a/apps/mobile/src/host/live-activity-session.ts +++ b/apps/mobile/src/host/live-activity-session.ts @@ -1,5 +1,5 @@ -import { ActivityRequestFailed, type HostActivity } from './live-activity'; -import type { SavedHost } from './hosts'; +import { ActivityRequestFailed, type HostActivity } from '@botharness/host-client/live-activity'; +import type { SavedHost } from '@botharness/host-client/hosts'; export interface ActivityTarget { hostId: string; diff --git a/apps/mobile/src/host/local-conversation-cache.ts b/apps/mobile/src/host/local-conversation-cache.ts index 17de8d21b3..ed01120118 100644 --- a/apps/mobile/src/host/local-conversation-cache.ts +++ b/apps/mobile/src/host/local-conversation-cache.ts @@ -1,12 +1,12 @@ -import type { JournalEntry } from './wire'; +import type { JournalEntry } from '@botharness/host-protocol/wire'; import type { CachedChanges, CachedConversation, ChangeCursor, ConversationCache, OlderPage, -} from './conversation'; -import type { LocalStore, SqlWriter } from './local-store'; +} from '@botharness/host-client/conversation'; +import type { LocalStore, SqlWriter } from '@botharness/host-client/local-store'; const TAIL = 50; diff --git a/apps/mobile/src/host/local-message-search.ts b/apps/mobile/src/host/local-message-search.ts index 8bd17d174a..805d54fec7 100644 --- a/apps/mobile/src/host/local-message-search.ts +++ b/apps/mobile/src/host/local-message-search.ts @@ -1,5 +1,5 @@ -import type { LocalStore } from './local-store'; -import type { JournalEntry } from './wire'; +import type { LocalStore } from '@botharness/host-client/local-store'; +import type { JournalEntry } from '@botharness/host-protocol/wire'; const SNIPPET_BEFORE = 24; const SNIPPET_LENGTH = 120; diff --git a/apps/mobile/src/host/local-video-actions.ts b/apps/mobile/src/host/local-video-actions.ts index 6b5e36d49b..c308de7f56 100644 --- a/apps/mobile/src/host/local-video-actions.ts +++ b/apps/mobile/src/host/local-video-actions.ts @@ -2,7 +2,7 @@ import type { LocalVideoClient, LocalVideoClientState, } from '../../../../packages/computer/src/local-video-client'; -import type { ConnectionState } from './client'; +import type { ConnectionState } from '@botharness/host-client/client'; export function localVideoActions({ state, diff --git a/apps/mobile/src/host/local-video-pointer.ts b/apps/mobile/src/host/local-video-pointer.ts index 53bfecd344..2601a53e98 100644 --- a/apps/mobile/src/host/local-video-pointer.ts +++ b/apps/mobile/src/host/local-video-pointer.ts @@ -1,5 +1,10 @@ import type { DesktopInput } from '../../../../packages/computer/src/desktop-view'; -import { fittedFrame, stagePoint, type StageLayout, type StageZoom } from './browser-viewer'; +import { + fittedFrame, + stagePoint, + type StageLayout, + type StageZoom, +} from '@botharness/host-client/browser-viewer'; export function videoPointerScroll({ point, diff --git a/apps/mobile/src/host/memory-changes.ts b/apps/mobile/src/host/memory-changes.ts index 2494758994..0e28815a1a 100644 --- a/apps/mobile/src/host/memory-changes.ts +++ b/apps/mobile/src/host/memory-changes.ts @@ -1,5 +1,5 @@ import { dmChannel, type ProfileBotRef } from './bot-profile'; -import type { HostClient } from './client'; +import type { HostClient } from '@botharness/host-client/client'; export type MemoryChangeStatus = 'accepted' | 'pending' | 'needs-repair'; diff --git a/apps/mobile/src/host/memory-edit.ts b/apps/mobile/src/host/memory-edit.ts index 7efb2491c6..3f2ccb8683 100644 --- a/apps/mobile/src/host/memory-edit.ts +++ b/apps/mobile/src/host/memory-edit.ts @@ -1,5 +1,5 @@ import { dmChannel, type ProfileBotRef } from './bot-profile'; -import { MethodRefused, type HostClient } from './client'; +import { MethodRefused, type HostClient } from '@botharness/host-client/client'; export function memoryConflict(error: unknown): boolean { return error instanceof MethodRefused && error.code === 'memory-conflict'; diff --git a/apps/mobile/src/host/memory-preview.ts b/apps/mobile/src/host/memory-preview.ts index a8fa87c6ad..0e49aa5bbe 100644 --- a/apps/mobile/src/host/memory-preview.ts +++ b/apps/mobile/src/host/memory-preview.ts @@ -4,8 +4,8 @@ import { MAX_SVG_BYTES, type ImageMime, } from '../../../../packages/core/src/media/image-format'; -import type { HostClient, RemoteSource } from './client'; -import type { MemoryImage, MemoryMarkdown } from './wire'; +import type { HostClient, RemoteSource } from '@botharness/host-client/client'; +import type { MemoryImage, MemoryMarkdown } from '@botharness/host-protocol/wire'; export const MEMORY_IMAGE_LIMIT = 25 * 1024 * 1024; export type PreviewImage = { diff --git a/apps/mobile/src/host/message-display.ts b/apps/mobile/src/host/message-display.ts index 91a0f6974f..3fd9e9ca13 100644 --- a/apps/mobile/src/host/message-display.ts +++ b/apps/mobile/src/host/message-display.ts @@ -1,5 +1,5 @@ -import type { ConversationMessage } from './conversation'; -import type { ChannelWireMessage } from './wire'; +import type { ConversationMessage } from '@botharness/host-client/conversation'; +import type { ChannelWireMessage } from '@botharness/host-protocol/wire'; export function messageForDisplay(message: ConversationMessage): ChannelWireMessage { return ( diff --git a/apps/mobile/src/host/message-feedback.ts b/apps/mobile/src/host/message-feedback.ts index 440041e58d..4cdd9237cb 100644 --- a/apps/mobile/src/host/message-feedback.ts +++ b/apps/mobile/src/host/message-feedback.ts @@ -1,4 +1,4 @@ -import type { HostClient } from './client'; +import type { HostClient } from '@botharness/host-client/client'; import { feedbackRatingSchema, feedbackSelectionSchema, diff --git a/apps/mobile/src/host/message-search.ts b/apps/mobile/src/host/message-search.ts index 214db00bf9..1f090c273a 100644 --- a/apps/mobile/src/host/message-search.ts +++ b/apps/mobile/src/host/message-search.ts @@ -1,6 +1,6 @@ import { useCallback, useRef, useState } from 'react'; -import type { HostClient } from './client'; +import type { HostClient } from '@botharness/host-client/client'; import { hostStore, hostStoreAvailable } from './host-store'; import { searchStoredMessages } from './local-message-search'; diff --git a/apps/mobile/src/host/native-activity-sources.ts b/apps/mobile/src/host/native-activity-sources.ts index f426d2ddb3..07103cbfc5 100644 --- a/apps/mobile/src/host/native-activity-sources.ts +++ b/apps/mobile/src/host/native-activity-sources.ts @@ -3,7 +3,7 @@ import { useHostSessions } from './host-session'; import { useConversationFilter } from './native-conversation-filter'; import { includesComputerActivity } from './conversation-environments'; import { hostLooks } from './native-host-look'; -import { shownHostName } from '../ui/design/host-look'; +import { shownHostName } from '@botharness/host-client/ui/design/host-look'; import type { ActivitySource } from './activity-sources'; export function useActivitySources(visible = true): readonly ActivitySource[] { diff --git a/apps/mobile/src/host/native-background-catch-up.ts b/apps/mobile/src/host/native-background-catch-up.ts index e97d91f583..5a49e0255e 100644 --- a/apps/mobile/src/host/native-background-catch-up.ts +++ b/apps/mobile/src/host/native-background-catch-up.ts @@ -6,7 +6,7 @@ import { CATCH_UP_TASK, runBackgroundCatchUp, } from './background-catch-up'; -import { createHostClient, deviceRefusal } from './client'; +import { createHostClient, deviceRefusal } from '@botharness/host-client/client'; import { liveConversationKeys } from './host-session'; import { nativeCarrier } from './native-carrier'; import { catchUpInBackground } from './native-conversations'; diff --git a/apps/mobile/src/host/native-bot-creation.ts b/apps/mobile/src/host/native-bot-creation.ts index 779f21de3d..9e942622d4 100644 --- a/apps/mobile/src/host/native-bot-creation.ts +++ b/apps/mobile/src/host/native-bot-creation.ts @@ -1,8 +1,8 @@ import { File, Paths } from 'expo-file-system'; import { randomUUID } from 'expo-crypto'; import { useSyncExternalStore } from 'react'; -import { createBotCreationController } from './bot-creation'; -import { botCreationTransport } from './bot-creation-transport'; +import { createBotCreationController } from '@botharness/host-client/bot-creation'; +import { botCreationTransport } from '@botharness/host-client/bot-creation-transport'; import { hostSession } from './host-session'; import { nativeCarrier } from './native-carrier'; import { nativeZipFiles, pruneZipFiles } from './native-zip-import-file'; diff --git a/apps/mobile/src/host/native-cache.ts b/apps/mobile/src/host/native-cache.ts index c24d6999a4..f7ea6e17fe 100644 --- a/apps/mobile/src/host/native-cache.ts +++ b/apps/mobile/src/host/native-cache.ts @@ -1,6 +1,6 @@ import { Directory, File, Paths } from 'expo-file-system'; -import type { CachedConversation, ConversationCache } from './conversation'; +import type { CachedConversation, ConversationCache } from '@botharness/host-client/conversation'; const root = (): Directory => new Directory(Paths.cache, 'deepseekbot-conversations'); diff --git a/apps/mobile/src/host/native-carrier.ts b/apps/mobile/src/host/native-carrier.ts index fa9702ff95..3db0c9af11 100644 --- a/apps/mobile/src/host/native-carrier.ts +++ b/apps/mobile/src/host/native-carrier.ts @@ -1,7 +1,9 @@ +import { installedAppVersion } from './app-version'; +import { noiseKeyAgreement } from './noise-key-agreement'; import { requireOptionalNativeModule } from 'expo'; import { getRandomBytes } from 'expo-crypto'; -import type { HostCarrier } from './carrier'; -import { isLanRoute } from './route'; +import type { HostCarrier } from '@botharness/host-protocol/carrier'; +import { isLanRoute } from '@botharness/host-protocol/route'; import { localNetworkStatus, openLanSocket } from './native-lan-socket'; import { openDirectChannel, type DirectNative } from './direct-channel'; @@ -33,7 +35,10 @@ const directNative = requireOptionalNativeModule('LocalComputerVid const directSupported = typeof directNative?.directOffer === 'function'; export function nativeCarrier(): HostCarrier { + const appVersion = installedAppVersion(); return { + ...(appVersion === undefined ? {} : { appVersion }), + ...(noiseKeyAgreement === undefined ? {} : { keyAgreement: noiseKeyAgreement }), randomBytes: () => getRandomBytes(32), localNetworkStatus, transportFailure, diff --git a/apps/mobile/src/host/native-connect-account.ts b/apps/mobile/src/host/native-connect-account.ts index d2b726757b..90366c8497 100644 --- a/apps/mobile/src/host/native-connect-account.ts +++ b/apps/mobile/src/host/native-connect-account.ts @@ -7,10 +7,13 @@ import { fetch } from 'expo/fetch'; import { router } from 'expo-router'; import { AppState } from 'react-native'; -import { isConnectRoute } from './route'; +import { isConnectRoute } from '@botharness/host-protocol/route'; import { MOBILE_REDIRECT_URI } from '../cloud/instance-contract'; import { hostSession } from './host-session'; -import { authorizeWithLateRedirect, createConnectAccount } from './connect-account'; +import { + authorizeWithLateRedirect, + createConnectAccount, +} from '@botharness/host-client/connect-account'; import { startEmailCodeSignIn } from './email-code-bridge'; const KEY = 'botharness.connect-account.v1'; diff --git a/apps/mobile/src/host/native-connection-mode.android.ts b/apps/mobile/src/host/native-connection-mode.android.ts index 957cb4b019..f9c36ecc64 100644 --- a/apps/mobile/src/host/native-connection-mode.android.ts +++ b/apps/mobile/src/host/native-connection-mode.android.ts @@ -4,7 +4,7 @@ import { AppRegistry, AppState } from 'react-native'; import type { AlertSnapshot, LocalApprovalAlert } from './device-alerts'; import { alertBanners } from './alert-banners'; -import type { PushPreferences } from './push'; +import type { PushPreferences } from '@botharness/host-client/push'; import type { ConnectionSummary } from './connection-summary'; import { REQUESTS_CHANNEL } from './native-notifications'; import { t } from '../ui/strings'; diff --git a/apps/mobile/src/host/native-conversations.ts b/apps/mobile/src/host/native-conversations.ts index e89e28077c..0122e1b776 100644 --- a/apps/mobile/src/host/native-conversations.ts +++ b/apps/mobile/src/host/native-conversations.ts @@ -1,4 +1,4 @@ -import type { ConversationCache } from './conversation'; +import type { ConversationCache } from '@botharness/host-client/conversation'; import { deleteHostStore, hostStore, hostStoreAvailable } from './host-store'; import { createCatchUp, type CatchUpHost } from './catch-up'; import { BACKGROUND_PAGES } from './background-catch-up'; diff --git a/apps/mobile/src/host/native-host-look.ts b/apps/mobile/src/host/native-host-look.ts index 108d45e17b..17201d45ad 100644 --- a/apps/mobile/src/host/native-host-look.ts +++ b/apps/mobile/src/host/native-host-look.ts @@ -1,8 +1,8 @@ import { Directory, File, Paths } from 'expo-file-system'; import { useCallback, useSyncExternalStore } from 'react'; -import type { HostLook } from '../ui/design/host-look'; -import { createHostLooks } from './host-look'; +import type { HostLook } from '@botharness/host-client/ui/design/host-look'; +import { createHostLooks } from '@botharness/host-client/host-look'; const file = (): File => new File(Paths.document, 'deepseekbot-host-looks.json'); diff --git a/apps/mobile/src/host/native-lan-socket.ts b/apps/mobile/src/host/native-lan-socket.ts index cad6138b70..c2b80a80df 100644 --- a/apps/mobile/src/host/native-lan-socket.ts +++ b/apps/mobile/src/host/native-lan-socket.ts @@ -1,6 +1,10 @@ import { requireOptionalNativeModule } from 'expo'; -import type { HostSocket, HostSocketEvents, LocalNetworkStatus } from './carrier'; -import { isLanRoute } from './route'; +import type { + HostSocket, + HostSocketEvents, + LocalNetworkStatus, +} from '@botharness/host-protocol/carrier'; +import { isLanRoute } from '@botharness/host-protocol/route'; interface LanModule { open(id: string, address: string, port: number): void; diff --git a/apps/mobile/src/host/native-live-activity.ts b/apps/mobile/src/host/native-live-activity.ts index 57d68aad9f..b391ea3c7a 100644 --- a/apps/mobile/src/host/native-live-activity.ts +++ b/apps/mobile/src/host/native-live-activity.ts @@ -7,7 +7,7 @@ import type { LiveActivity } from 'expo-widgets'; import { useSyncExternalStore } from 'react'; import { hostSession, onHostRemoval } from './host-session'; import { nativeCarrier } from './native-carrier'; -import { ActivityRequestFailed, createHostActivity } from './live-activity'; +import { ActivityRequestFailed, createHostActivity } from '@botharness/host-client/live-activity'; import { subscribeActivityHost } from './live-activity-routing'; import { createActivitySession, diff --git a/apps/mobile/src/host/native-local-store.ts b/apps/mobile/src/host/native-local-store.ts index 7822219a4f..d8df960450 100644 --- a/apps/mobile/src/host/native-local-store.ts +++ b/apps/mobile/src/host/native-local-store.ts @@ -1,7 +1,12 @@ import { File, Paths } from 'expo-file-system'; import { defaultDatabaseDirectory, deleteDatabaseAsync, openDatabaseAsync } from 'expo-sqlite'; -import { localStoreName, openLocalStore, type LocalStore, type SqlValue } from './local-store'; +import { + localStoreName, + openLocalStore, + type LocalStore, + type SqlValue, +} from '@botharness/host-client/local-store'; const bind = (params: readonly SqlValue[] | undefined): SqlValue[] => (params ? [...params] : []); diff --git a/apps/mobile/src/host/native-media-store.ts b/apps/mobile/src/host/native-media-store.ts index 0dfbd8628f..4f1753874d 100644 --- a/apps/mobile/src/host/native-media-store.ts +++ b/apps/mobile/src/host/native-media-store.ts @@ -1,6 +1,6 @@ import { Directory, File, Paths } from 'expo-file-system'; -import type { MediaStore } from './media-cache'; +import type { MediaStore } from '@botharness/host-client/media-cache'; const mediaRoot = (): Directory => new Directory(Paths.cache, 'deepseekbot-media'); diff --git a/apps/mobile/src/host/native-notification-preferences.ts b/apps/mobile/src/host/native-notification-preferences.ts index dde1858ced..648cf0fa0e 100644 --- a/apps/mobile/src/host/native-notification-preferences.ts +++ b/apps/mobile/src/host/native-notification-preferences.ts @@ -1,7 +1,7 @@ import { File, Paths } from 'expo-file-system'; -import { createDeviceNotificationPreferences } from './device-notification-preferences'; +import { createDeviceNotificationPreferences } from '@botharness/host-client/device-notification-preferences'; import { nativeCarrier } from './native-carrier'; -import { createHostPush } from './push'; +import { createHostPush } from '@botharness/host-client/push'; const file = () => new File(Paths.document, 'deepseekbot-notification-preferences.json'); export const notificationPreferences = createDeviceNotificationPreferences({ diff --git a/apps/mobile/src/host/native-purge-targets.ts b/apps/mobile/src/host/native-purge-targets.ts index ac1853a7e0..bb91031d59 100644 --- a/apps/mobile/src/host/native-purge-targets.ts +++ b/apps/mobile/src/host/native-purge-targets.ts @@ -1,6 +1,6 @@ import { hostStore, hostStoreAvailable } from './host-store'; import { redactLocalConversations } from './local-conversation-cache'; -import { forgetMedia } from './media-cache'; +import { forgetMedia } from '@botharness/host-client/media-cache'; import { redactHostConversationCache } from './native-cache'; import type { PurgeTargets } from './purge-caches'; import { forgetSharedCopies } from './share-attachment'; diff --git a/apps/mobile/src/host/native-push-decide.ts b/apps/mobile/src/host/native-push-decide.ts index 0b9a193b55..b016b6eca5 100644 --- a/apps/mobile/src/host/native-push-decide.ts +++ b/apps/mobile/src/host/native-push-decide.ts @@ -1,7 +1,11 @@ -import { createHostClient } from './client'; -import type { SavedHost } from './hosts'; +import { createHostClient } from '@botharness/host-client/client'; +import type { SavedHost } from '@botharness/host-client/hosts'; import { nativeCarrier } from './native-carrier'; -import { decideApproval, type ApprovalChoice, type RequestRef } from './requests'; +import { + decideApproval, + type ApprovalChoice, + type RequestRef, +} from '@botharness/host-client/requests'; export async function decideOverRoute( host: SavedHost, diff --git a/apps/mobile/src/host/native-zip-import-file.ts b/apps/mobile/src/host/native-zip-import-file.ts index 19165a2b19..c279b85e00 100644 --- a/apps/mobile/src/host/native-zip-import-file.ts +++ b/apps/mobile/src/host/native-zip-import-file.ts @@ -1,13 +1,13 @@ import * as DocumentPicker from 'expo-document-picker'; import { Directory, File, FileMode, Paths } from 'expo-file-system'; import { randomUUID } from 'expo-crypto'; -import { BotCreationFailure } from './bot-creation'; +import { BotCreationFailure } from '@botharness/host-client/bot-creation'; import { hashZipFile, ZIP_MAX_BYTES, type ZipFilePort, type ZipFileReader, -} from './zip-import-file'; +} from '@botharness/host-client/zip-import-file'; const directory = () => new Directory(Paths.document, 'bot-imports'); const retainedFile = (id: string) => new File(directory(), `${id}.zip`); diff --git a/apps/mobile/src/host/noise-key-agreement.android.ts b/apps/mobile/src/host/noise-key-agreement.android.ts index cc680c6001..674a138126 100644 --- a/apps/mobile/src/host/noise-key-agreement.android.ts +++ b/apps/mobile/src/host/noise-key-agreement.android.ts @@ -1,5 +1,5 @@ import { scalarMultBase, sharedKey } from '@stablelib/x25519'; -import type { NoiseKeyAgreement } from '../../../../packages/core/src/devices/noise/xk'; +import type { NoiseKeyAgreement } from '@botharness/host-protocol/noise/xk'; export const noiseKeyAgreement: NoiseKeyAgreement = { publicKey(privateKey) { diff --git a/apps/mobile/src/host/noise-key-agreement.ts b/apps/mobile/src/host/noise-key-agreement.ts index 6e3faac90b..ee94222c04 100644 --- a/apps/mobile/src/host/noise-key-agreement.ts +++ b/apps/mobile/src/host/noise-key-agreement.ts @@ -1,3 +1,3 @@ -import type { NoiseKeyAgreement } from '../../../../packages/core/src/devices/noise/xk'; +import type { NoiseKeyAgreement } from '@botharness/host-protocol/noise/xk'; export const noiseKeyAgreement: NoiseKeyAgreement | undefined = undefined; diff --git a/apps/mobile/src/host/notification-avatars.ts b/apps/mobile/src/host/notification-avatars.ts index c1e1dbf848..685be58298 100644 --- a/apps/mobile/src/host/notification-avatars.ts +++ b/apps/mobile/src/host/notification-avatars.ts @@ -1,6 +1,6 @@ import { avatarSvg } from '../../../../packages/core/src/bots/avatar-appearance'; import { resolvedAvatarRecipe } from '../../../../packages/core/src/bots/primary-color'; -import type { RosterView } from './client'; +import type { RosterView } from '@botharness/host-client/client'; export interface AvatarImage { uri: string; diff --git a/apps/mobile/src/host/pick-files.ts b/apps/mobile/src/host/pick-files.ts index e67fc1bf86..1d846f998e 100644 --- a/apps/mobile/src/host/pick-files.ts +++ b/apps/mobile/src/host/pick-files.ts @@ -2,7 +2,7 @@ import * as DocumentPicker from 'expo-document-picker'; import { File, Paths } from 'expo-file-system'; import * as ImagePicker from 'expo-image-picker'; -import type { OutgoingFile } from './conversation'; +import type { OutgoingFile } from '@botharness/host-client/conversation'; export type PickSource = 'photos' | 'camera' | 'file'; diff --git a/apps/mobile/src/host/private-input.ts b/apps/mobile/src/host/private-input.ts index cfec793bd2..d91520520c 100644 --- a/apps/mobile/src/host/private-input.ts +++ b/apps/mobile/src/host/private-input.ts @@ -3,8 +3,8 @@ import { type PrivateInputDeclaration, type PrivateInputStatus, } from '../../../../packages/core/src/credentials/contracts'; -import type { HostClient } from './client'; -import type { RequestRef } from './requests'; +import type { HostClient } from '@botharness/host-client/client'; +import type { RequestRef } from '@botharness/host-client/requests'; export async function loadPrivateInput( client: HostClient, diff --git a/apps/mobile/src/host/purge-caches.ts b/apps/mobile/src/host/purge-caches.ts index 44a8652efd..55de0704dd 100644 --- a/apps/mobile/src/host/purge-caches.ts +++ b/apps/mobile/src/host/purge-caches.ts @@ -1,4 +1,4 @@ -import { mediaCacheKey } from './conversation'; +import { mediaCacheKey } from '@botharness/host-client/conversation'; export interface PurgedPlacement { sourceEventId: string; diff --git a/apps/mobile/src/host/push-actions.ts b/apps/mobile/src/host/push-actions.ts index 5615a5bb8f..2a035a649f 100644 --- a/apps/mobile/src/host/push-actions.ts +++ b/apps/mobile/src/host/push-actions.ts @@ -1,7 +1,7 @@ -import { checkRoute, isConnectRoute } from './route'; -import type { SavedHost } from './hosts'; -import type { PushTarget } from './push'; -import type { ApprovalChoice, DecisionResult, RequestRef } from './requests'; +import { checkRoute, isConnectRoute } from '@botharness/host-protocol/route'; +import type { SavedHost } from '@botharness/host-client/hosts'; +import type { PushTarget } from '@botharness/host-client/push'; +import type { ApprovalChoice, DecisionResult, RequestRef } from '@botharness/host-client/requests'; export const APPROVAL_CATEGORY = 'tool-approval'; export const APPROVAL_ONCE_CATEGORY = 'tool-approval-once'; diff --git a/apps/mobile/src/host/push-answer.ts b/apps/mobile/src/host/push-answer.ts index c9b0ad8e24..f8bd06934b 100644 --- a/apps/mobile/src/host/push-answer.ts +++ b/apps/mobile/src/host/push-answer.ts @@ -1,5 +1,5 @@ -import type { SavedHost } from './hosts'; -import { parsePushData } from './push'; +import type { SavedHost } from '@botharness/host-client/hosts'; +import { parsePushData } from '@botharness/host-client/push'; import { ANSWERED, APPROVAL_ACTIONS, decideFromPush, type PushDecision } from './push-actions'; export interface AnswerResponse { diff --git a/apps/mobile/src/host/push-resolve.ts b/apps/mobile/src/host/push-resolve.ts index 5affd79021..e665f2e49e 100644 --- a/apps/mobile/src/host/push-resolve.ts +++ b/apps/mobile/src/host/push-resolve.ts @@ -1,4 +1,4 @@ -import { parsePushData } from './push'; +import { parsePushData } from '@botharness/host-client/push'; export type PushResolved = { hostId: string; itemIds: readonly string[] }; diff --git a/apps/mobile/src/host/push-routing.ts b/apps/mobile/src/host/push-routing.ts index 0c5d7c57d2..8760def437 100644 --- a/apps/mobile/src/host/push-routing.ts +++ b/apps/mobile/src/host/push-routing.ts @@ -5,19 +5,19 @@ import { Alert, type ViewInstance } from 'react-native'; import { useMounted } from '../ui/mounted'; import { channelDestination, navigateChannel } from '../ui/shell/channel-navigation'; -import { createHostClient, type HostClient, type RosterView } from './client'; +import { createHostClient, type HostClient, type RosterView } from '@botharness/host-client/client'; import { hostSession } from './host-session'; import { conversationFilter } from './native-conversation-filter'; import { computerEnvironmentKey } from './conversation-environments'; import { nativeCarrier } from './native-carrier'; import { onNotificationTap } from './native-notifications'; import { alertBanners } from './alert-banners'; -import { parsePushData, pushHref, type PushTarget } from './push'; +import { parsePushData, pushHref, type PushTarget } from '@botharness/host-client/push'; import { ANSWERED, decideFromPush, removeFromPush } from './push-actions'; import { decideOverRoute } from './native-push-decide'; -import { removeDevice } from './pairing'; +import { removeDevice } from '@botharness/host-client/pairing'; import { t } from '../ui/strings'; -import { recordFeature } from '../telemetry/features'; +import { recordFeature } from '@botharness/host-client/telemetry/features'; class RoutingFailure extends Error {} diff --git a/apps/mobile/src/host/push-session.ts b/apps/mobile/src/host/push-session.ts index 116a4fc5dd..13d22851ed 100644 --- a/apps/mobile/src/host/push-session.ts +++ b/apps/mobile/src/host/push-session.ts @@ -1,6 +1,6 @@ -import type { SavedHost } from './hosts'; -import type { HostPush } from './push'; -import { parsePushData } from './push'; +import type { SavedHost } from '@botharness/host-client/hosts'; +import type { HostPush } from '@botharness/host-client/push'; +import { parsePushData } from '@botharness/host-client/push'; export type PermissionState = 'granted' | 'denied' | 'undetermined'; diff --git a/apps/mobile/src/host/routines.ts b/apps/mobile/src/host/routines.ts index b83f94580a..259771ed91 100644 --- a/apps/mobile/src/host/routines.ts +++ b/apps/mobile/src/host/routines.ts @@ -1,5 +1,9 @@ -import type { HostClient } from './client'; -import type { BotScheduleFiring, BotScheduleSummary, ScheduleTrigger } from './wire'; +import type { HostClient } from '@botharness/host-client/client'; +import type { + BotScheduleFiring, + BotScheduleSummary, + ScheduleTrigger, +} from '@botharness/host-protocol/wire'; export type RoutineTarget = { kind: 'new' } | { kind: 'open'; routine: BotScheduleSummary }; diff --git a/apps/mobile/src/host/saved-host.ts b/apps/mobile/src/host/saved-host.ts index 3658116d70..d9c1a8acb0 100644 --- a/apps/mobile/src/host/saved-host.ts +++ b/apps/mobile/src/host/saved-host.ts @@ -5,10 +5,10 @@ import { SavedHostsWriteError, serializeSavedHost, type SavedHosts, -} from './hosts'; +} from '@botharness/host-client/hosts'; -export { SavedHostsWriteError } from './hosts'; -export type { SavedHost, SavedHosts } from './hosts'; +export { SavedHostsWriteError } from '@botharness/host-client/hosts'; +export type { SavedHost, SavedHosts } from '@botharness/host-client/hosts'; const KEY = 'deepseekbot.hosts.v3'; const STAGED_KEY = 'deepseekbot.hosts.v3.staged'; diff --git a/apps/mobile/src/host/saved-host.web.ts b/apps/mobile/src/host/saved-host.web.ts index e09e1bf76f..63257630ee 100644 --- a/apps/mobile/src/host/saved-host.web.ts +++ b/apps/mobile/src/host/saved-host.web.ts @@ -1,7 +1,11 @@ -import { parseSavedHosts, serializeSavedHost, type SavedHosts } from './hosts'; +import { + parseSavedHosts, + serializeSavedHost, + type SavedHosts, +} from '@botharness/host-client/hosts'; -export { SavedHostsWriteError } from './hosts'; -export type { SavedHost, SavedHosts } from './hosts'; +export { SavedHostsWriteError } from '@botharness/host-client/hosts'; +export type { SavedHost, SavedHosts } from '@botharness/host-client/hosts'; const KEY = 'deepseekbot.hosts.v3'; const SINGLE_KEY = 'deepseekbot.host.v2'; diff --git a/apps/mobile/src/host/session-stop.ts b/apps/mobile/src/host/session-stop.ts index c3450aeeed..064b7e3046 100644 --- a/apps/mobile/src/host/session-stop.ts +++ b/apps/mobile/src/host/session-stop.ts @@ -1,5 +1,5 @@ -import type { HostClient, RosterBot } from './client'; -import type { WireSessionActivity } from './wire'; +import type { HostClient, RosterBot } from '@botharness/host-client/client'; +import type { WireSessionActivity } from '@botharness/host-protocol/wire'; export type RunningSession = WireSessionActivity & { role: 'orchestrator' | 'assignment' }; diff --git a/apps/mobile/src/host/share-attachment.ts b/apps/mobile/src/host/share-attachment.ts index 755c67ea94..ce914c0141 100644 --- a/apps/mobile/src/host/share-attachment.ts +++ b/apps/mobile/src/host/share-attachment.ts @@ -1,8 +1,8 @@ import { Directory, File, Paths } from 'expo-file-system'; import * as Sharing from 'expo-sharing'; -import type { MessageAttachment } from './conversation'; -import { cacheMedia, mediaCacheAvailable } from './media-cache'; +import type { MessageAttachment } from '@botharness/host-client/conversation'; +import { cacheMedia, mediaCacheAvailable } from '@botharness/host-client/media-cache'; function folderName(key: string): string { return key.replace(/[^a-z0-9-]/giu, '_'); diff --git a/apps/mobile/src/host/speech.ts b/apps/mobile/src/host/speech.ts index 782974c372..853d02e0f5 100644 --- a/apps/mobile/src/host/speech.ts +++ b/apps/mobile/src/host/speech.ts @@ -9,7 +9,7 @@ import { type ComposerDictation, type ComposerDictationStatus, } from '../../../../packages/core/src/voice/dictation-client'; -import type { HostClient } from './client'; +import type { HostClient } from '@botharness/host-client/client'; import { createDictationMic } from './dictation-mic'; import { hostDictationReady } from './host-dictation'; import { createOsRecognizer, type OsRecognizer } from './os-dictation'; diff --git a/apps/mobile/src/host/watch-account-hosts.ts b/apps/mobile/src/host/watch-account-hosts.ts index 1759f4f877..bd2c89e988 100644 --- a/apps/mobile/src/host/watch-account-hosts.ts +++ b/apps/mobile/src/host/watch-account-hosts.ts @@ -1,9 +1,9 @@ -import type { ConnectAccount, ConnectHost } from './connect-account'; +import type { ConnectAccount, ConnectHost } from '@botharness/host-client/connect-account'; import { connectionDiagnostic, networkDiagnosticReason, type ConnectionDiagnostic, -} from './connection-diagnostic'; +} from '@botharness/host-client/connection-diagnostic'; export function watchAccountHosts(options: { account: Pick; diff --git a/apps/mobile/src/marketplace/import-selection.ts b/apps/mobile/src/marketplace/import-selection.ts index 33baecfb6f..8a4f59ce8e 100644 --- a/apps/mobile/src/marketplace/import-selection.ts +++ b/apps/mobile/src/marketplace/import-selection.ts @@ -1,5 +1,5 @@ import type { MarketplaceDetail } from '../../../../packages/core/src/marketplace/client'; -import type { createBotCreationController } from '../host/bot-creation'; +import type { createBotCreationController } from '@botharness/host-client/bot-creation'; export async function selectMarketplaceImport( controller: ReturnType, diff --git a/apps/mobile/src/telemetry/native.ts b/apps/mobile/src/telemetry/native.ts index 604935cb2e..76f05a6e2a 100644 --- a/apps/mobile/src/telemetry/native.ts +++ b/apps/mobile/src/telemetry/native.ts @@ -3,11 +3,11 @@ import * as Device from 'expo-device'; import { File, Paths } from 'expo-file-system'; import { Platform } from 'react-native'; import { locale } from '../ui/strings'; -import { createMobileTelemetry } from './mobile-telemetry'; +import { createMobileTelemetry } from '@botharness/host-client/telemetry/mobile-telemetry'; import { createPostHogSender } from './posthog-sender'; -import { isUuid } from './schema'; -import { deviceTelemetryContext } from './device-context'; -import { setFeatureSink } from './features'; +import { isUuid } from '@botharness/host-client/telemetry/schema'; +import { deviceTelemetryContext } from '@botharness/host-client/telemetry/device-context'; +import { setFeatureSink } from '@botharness/host-client/telemetry/features'; const mode = process.env.EXPO_PUBLIC_MOBILE_TELEMETRY; const qaRun = process.env.EXPO_PUBLIC_MOBILE_TELEMETRY_QA_RUN; diff --git a/apps/mobile/src/telemetry/posthog-sender.ts b/apps/mobile/src/telemetry/posthog-sender.ts index 0ea05d3b3f..6729bc9ab8 100644 --- a/apps/mobile/src/telemetry/posthog-sender.ts +++ b/apps/mobile/src/telemetry/posthog-sender.ts @@ -1,5 +1,5 @@ import PostHog, { PostHogPersistedProperty } from 'posthog-react-native'; -import { sanitizeEvent, type TelemetryEvent } from './schema'; +import { sanitizeEvent, type TelemetryEvent } from '@botharness/host-client/telemetry/schema'; const HOST = 'https://t.botharness.ai'; type FetchOptions = Parameters[1]; diff --git a/apps/mobile/src/ui/account-hosts.tsx b/apps/mobile/src/ui/account-hosts.tsx index 8517ba0552..96993b2dce 100644 --- a/apps/mobile/src/ui/account-hosts.tsx +++ b/apps/mobile/src/ui/account-hosts.tsx @@ -2,11 +2,15 @@ import { connectionDiagnostic, networkDiagnosticReason, type ConnectionDiagnostic, -} from '../host/connection-diagnostic'; +} from '@botharness/host-client/connection-diagnostic'; import { useFocusEffect } from 'expo-router'; import { useCallback, useRef, useState } from 'react'; -import type { ConnectAccount, ConnectHost, ConnectResult } from '../host/connect-account'; -import type { SavedHost } from '../host/hosts'; +import type { + ConnectAccount, + ConnectHost, + ConnectResult, +} from '@botharness/host-client/connect-account'; +import type { SavedHost } from '@botharness/host-client/hosts'; import { accountHostAdded } from '../host/account-pairing'; import { confirmDestructive } from './primitives/app-dialog'; import { AccountPanel, type AccountPairResult } from './primitives/account-panel'; diff --git a/apps/mobile/src/ui/account/email-code-sign-in.tsx b/apps/mobile/src/ui/account/email-code-sign-in.tsx index 187f256efb..49bfcf0a5c 100644 --- a/apps/mobile/src/ui/account/email-code-sign-in.tsx +++ b/apps/mobile/src/ui/account/email-code-sign-in.tsx @@ -8,7 +8,7 @@ import { type EmailCodeRefusal, type PasswordOutcome, type SocialProvider, -} from '../../host/connect-account'; +} from '@botharness/host-client/connect-account'; import { useDesignTheme } from '../design/theme'; import { edge, radius, signInBrand, space } from '../design/tokens'; import { Button } from '../primitives/button'; diff --git a/apps/mobile/src/ui/account/sign-in-brand-button.tsx b/apps/mobile/src/ui/account/sign-in-brand-button.tsx index eb58759a25..ebae75a295 100644 --- a/apps/mobile/src/ui/account/sign-in-brand-button.tsx +++ b/apps/mobile/src/ui/account/sign-in-brand-button.tsx @@ -1,7 +1,7 @@ import { Pressable, View } from 'react-native'; import Svg, { Path } from 'react-native-svg'; -import type { SocialProvider } from '../../host/connect-account'; +import type { SocialProvider } from '@botharness/host-client/connect-account'; import { useDesignTheme } from '../design/theme'; import { edge, radius, signInBrand, space } from '../design/tokens'; import { Text } from '../primitives/text'; diff --git a/apps/mobile/src/ui/approval-note.ts b/apps/mobile/src/ui/approval-note.ts index 47955e928a..687f6f40db 100644 --- a/apps/mobile/src/ui/approval-note.ts +++ b/apps/mobile/src/ui/approval-note.ts @@ -1,4 +1,4 @@ -import type { ApprovalRequest } from '../host/requests'; +import type { ApprovalRequest } from '@botharness/host-client/requests'; import { t } from './strings'; export function alwaysNote(request: Pick): string { diff --git a/apps/mobile/src/ui/approval-view.tsx b/apps/mobile/src/ui/approval-view.tsx index a85b40be3c..86c7f583e2 100644 --- a/apps/mobile/src/ui/approval-view.tsx +++ b/apps/mobile/src/ui/approval-view.tsx @@ -7,7 +7,7 @@ import { type ApprovalChoice, type ApprovalRequest, type DecisionResult, -} from '../host/requests'; +} from '@botharness/host-client/requests'; import { alwaysNote, executionNote, expiryLabel, riskNote } from './approval-note'; import { ActionButton, diff --git a/apps/mobile/src/ui/attention-item.tsx b/apps/mobile/src/ui/attention-item.tsx index 7f4d11d737..b6b98242ac 100644 --- a/apps/mobile/src/ui/attention-item.tsx +++ b/apps/mobile/src/ui/attention-item.tsx @@ -9,9 +9,9 @@ import { loadAssignmentContext, replyToAssignment, type AttentionRef, -} from '../host/attention-actions'; -import type { HostClient } from '../host/client'; -import type { HumanAttentionItem } from '../host/wire'; +} from '@botharness/host-client/attention-actions'; +import type { HostClient } from '@botharness/host-client/client'; +import type { HumanAttentionItem } from '@botharness/host-protocol/wire'; import { AssignmentView, AutoRejectionView, JoinRequestView, RepairView } from './attention-view'; import { useMounted } from './mounted'; import { errorText, LoadFailed, Loading } from './request-parts'; diff --git a/apps/mobile/src/ui/attention-view.tsx b/apps/mobile/src/ui/attention-view.tsx index ba4b308da5..b59e141406 100644 --- a/apps/mobile/src/ui/attention-view.tsx +++ b/apps/mobile/src/ui/attention-view.tsx @@ -1,7 +1,7 @@ import { useCallback, useLayoutEffect, useRef, useState, type ReactNode } from 'react'; import { View, type ViewInstance } from 'react-native'; -import type { HumanAssignmentContext, HumanAttentionItem } from '../host/wire'; +import type { HumanAssignmentContext, HumanAttentionItem } from '@botharness/host-protocol/wire'; import { ActionCard, CardButtons, diff --git a/apps/mobile/src/ui/bot-avatar.tsx b/apps/mobile/src/ui/bot-avatar.tsx index 58a2b193d2..87fefa7e40 100644 --- a/apps/mobile/src/ui/bot-avatar.tsx +++ b/apps/mobile/src/ui/bot-avatar.tsx @@ -15,7 +15,7 @@ import Svg, { Rect } from 'react-native-svg'; import { avatarSvg } from '../../../../packages/core/src/bots/avatar-appearance'; import { resolvedAvatarRecipe } from '../../../../packages/core/src/bots/primary-color'; -import type { RemoteSource, RosterBot } from '../host/client'; +import type { RemoteSource, RosterBot } from '@botharness/host-client/client'; import { ResourceImage } from './primitives/resource-image'; import { stateRing } from './design/tokens'; import { useMounted } from './mounted'; diff --git a/apps/mobile/src/ui/bot-color.ts b/apps/mobile/src/ui/bot-color.ts index 3f775fba1f..05796f89dd 100644 --- a/apps/mobile/src/ui/bot-color.ts +++ b/apps/mobile/src/ui/bot-color.ts @@ -1,5 +1,5 @@ import { resolveBotPrimaryColor } from '../../../../packages/core/src/bots/primary-color'; -import type { RosterBot } from '../host/client'; +import type { RosterBot } from '@botharness/host-client/client'; export function botColor(bot: RosterBot): string { return resolveBotPrimaryColor({ diff --git a/apps/mobile/src/ui/channel-notifications.tsx b/apps/mobile/src/ui/channel-notifications.tsx index cc1befcf6a..151a471cb7 100644 --- a/apps/mobile/src/ui/channel-notifications.tsx +++ b/apps/mobile/src/ui/channel-notifications.tsx @@ -1,7 +1,7 @@ import { useCallback, useState } from 'react'; import { ScrollView, type ScrollViewInstance } from 'react-native'; -import { PushRequestFailed, type PushSettings } from '../host/push'; +import { PushRequestFailed, type PushSettings } from '@botharness/host-client/push'; import type { PushStatus } from '../host/push-session'; import { space } from './design/tokens'; import { useDesignTheme } from './design/theme'; diff --git a/apps/mobile/src/ui/chat/activity-detail.tsx b/apps/mobile/src/ui/chat/activity-detail.tsx index 6a4576c51a..ce14751bc1 100644 --- a/apps/mobile/src/ui/chat/activity-detail.tsx +++ b/apps/mobile/src/ui/chat/activity-detail.tsx @@ -12,9 +12,9 @@ import { type ModelUsage, type UsageBucket, } from '../../host/bot-activity'; -import type { RosterBot } from '../../host/client'; +import type { RosterBot } from '@botharness/host-client/client'; import { compactTokenCount, dayLabel, weekdayLabel } from '../../host/usage-days'; -import type { ProfileActivity } from '../../host/wire'; +import type { ProfileActivity } from '@botharness/host-protocol/wire'; import { botColor } from '../bot-color'; import { chart, heatTones, seriesTones } from '../design/chart'; import { AccentProvider, useDesignTheme } from '../design/theme'; diff --git a/apps/mobile/src/ui/chat/activity-glance.tsx b/apps/mobile/src/ui/chat/activity-glance.tsx index c7444904f4..db6498f60f 100644 --- a/apps/mobile/src/ui/chat/activity-glance.tsx +++ b/apps/mobile/src/ui/chat/activity-glance.tsx @@ -1,9 +1,9 @@ import { Pressable, View } from 'react-native'; import { weekGlance, type TokenTotal } from '../../host/bot-activity'; -import type { RosterBot } from '../../host/client'; +import type { RosterBot } from '@botharness/host-client/client'; import { dayLabel, weekdayLabel } from '../../host/usage-days'; -import type { ProfileActivity } from '../../host/wire'; +import type { ProfileActivity } from '@botharness/host-protocol/wire'; import { botColor } from '../bot-color'; import { chart } from '../design/chart'; import { AccentProvider, useDesignTheme } from '../design/theme'; diff --git a/apps/mobile/src/ui/chat/activity-row.tsx b/apps/mobile/src/ui/chat/activity-row.tsx index 7d8577b16a..dad5bd0595 100644 --- a/apps/mobile/src/ui/chat/activity-row.tsx +++ b/apps/mobile/src/ui/chat/activity-row.tsx @@ -2,9 +2,9 @@ import { measureMessageView } from '../primitives/measure-message-view'; import { useRef } from 'react'; import { Pressable, View, type ViewInstance } from 'react-native'; -import type { ChannelActivity } from '../../host/channel-activity'; -import type { RosterView } from '../../host/client'; -import type { ConversationMessage } from '../../host/conversation'; +import type { ChannelActivity } from '@botharness/host-client/channel-activity'; +import type { RosterView } from '@botharness/host-client/client'; +import type { ConversationMessage } from '@botharness/host-client/conversation'; import { BotAvatar } from '../bot-avatar'; import { useDesignTheme } from '../design/theme'; import { motion, radius, space } from '../design/tokens'; diff --git a/apps/mobile/src/ui/chat/activity-text.ts b/apps/mobile/src/ui/chat/activity-text.ts index f48b9c4dfc..2c39bde9a3 100644 --- a/apps/mobile/src/ui/chat/activity-text.ts +++ b/apps/mobile/src/ui/chat/activity-text.ts @@ -1,6 +1,6 @@ -import type { ChannelActivity } from '../../host/channel-activity'; -import type { RosterView } from '../../host/client'; -import type { ConversationMessage } from '../../host/conversation'; +import type { ChannelActivity } from '@botharness/host-client/channel-activity'; +import type { RosterView } from '@botharness/host-client/client'; +import type { ConversationMessage } from '@botharness/host-client/conversation'; import { t } from '../strings'; import { callRecordLines } from './call-record-text'; diff --git a/apps/mobile/src/ui/chat/approval-card.tsx b/apps/mobile/src/ui/chat/approval-card.tsx index f4b4fe6f82..37bcddee90 100644 --- a/apps/mobile/src/ui/chat/approval-card.tsx +++ b/apps/mobile/src/ui/chat/approval-card.tsx @@ -1,7 +1,7 @@ import { useCallback, useRef, useState } from 'react'; import { View, type ViewInstance } from 'react-native'; -import type { CardResolution } from '../../host/conversation'; +import type { CardResolution } from '@botharness/host-client/conversation'; import { approvalCommand, previewInput, @@ -9,9 +9,9 @@ import { type ApprovalChoice, type ApprovalRequest, type DecisionResult, -} from '../../host/requests'; -import type { ToolApprovalOutcome } from '../../host/wire'; -import { approvalFileChange } from '../../../../../packages/client/src/client/approval-diff'; +} from '@botharness/host-client/requests'; +import type { ToolApprovalOutcome } from '@botharness/host-protocol/wire'; +import { approvalFileChange } from '@botharness/host-client/shared/approval-diff'; import { alwaysNote, executionNote, expiryLabel, highRisk, riskNote } from '../approval-note'; import { useMounted } from '../mounted'; import { Button } from '../primitives/button'; diff --git a/apps/mobile/src/ui/chat/approval-diff.android.tsx b/apps/mobile/src/ui/chat/approval-diff.android.tsx index fb064850dc..3b45a7c716 100644 --- a/apps/mobile/src/ui/chat/approval-diff.android.tsx +++ b/apps/mobile/src/ui/chat/approval-diff.android.tsx @@ -10,7 +10,7 @@ import { testID, } from '@expo/ui/jetpack-compose/modifiers'; -import type { ApprovalFileChange } from '../../../../../packages/client/src/client/approval-diff'; +import type { ApprovalFileChange } from '@botharness/host-client/shared/approval-diff'; import { materialType, useMaterialRoles } from '../design/material-tokens'; import { useDesignTheme } from '../design/theme'; import { radius, space } from '../design/tokens'; diff --git a/apps/mobile/src/ui/chat/approval-diff.tsx b/apps/mobile/src/ui/chat/approval-diff.tsx index 759a697cee..65f8ec119e 100644 --- a/apps/mobile/src/ui/chat/approval-diff.tsx +++ b/apps/mobile/src/ui/chat/approval-diff.tsx @@ -1,7 +1,7 @@ import { useState } from 'react'; import { View } from 'react-native'; -import type { ApprovalFileChange } from '../../../../../packages/client/src/client/approval-diff'; +import type { ApprovalFileChange } from '@botharness/host-client/shared/approval-diff'; import { useDesignTheme } from '../design/theme'; import { radius, space } from '../design/tokens'; import { Button } from '../primitives/button'; diff --git a/apps/mobile/src/ui/chat/approval-records-text.ts b/apps/mobile/src/ui/chat/approval-records-text.ts index d454f5e226..43507991c1 100644 --- a/apps/mobile/src/ui/chat/approval-records-text.ts +++ b/apps/mobile/src/ui/chat/approval-records-text.ts @@ -3,7 +3,7 @@ import type { ApprovalOutcome, ApprovalRule, } from '../../host/approval-records'; -import { readableInput } from '../../host/requests'; +import { readableInput } from '@botharness/host-client/requests'; import { t } from '../strings'; const SUMMARY = 120; diff --git a/apps/mobile/src/ui/chat/approval-records.tsx b/apps/mobile/src/ui/chat/approval-records.tsx index 3e358c1140..17fb7fb977 100644 --- a/apps/mobile/src/ui/chat/approval-records.tsx +++ b/apps/mobile/src/ui/chat/approval-records.tsx @@ -9,8 +9,8 @@ import { type ApprovalHistoryEntry, type ApprovalRule, } from '../../host/approval-records'; -import { errorText, type Loadable } from '../../host/bot-settings'; -import type { HostClient } from '../../host/client'; +import { errorText, type Loadable } from '@botharness/host-client/bot-settings'; +import type { HostClient } from '@botharness/host-client/client'; import { useDesignTheme } from '../design/theme'; import { space } from '../design/tokens'; import { confirmDestructive } from '../primitives/app-dialog'; diff --git a/apps/mobile/src/ui/chat/assignment-screen.tsx b/apps/mobile/src/ui/chat/assignment-screen.tsx index 4493c95cb5..f063f46ec3 100644 --- a/apps/mobile/src/ui/chat/assignment-screen.tsx +++ b/apps/mobile/src/ui/chat/assignment-screen.tsx @@ -12,9 +12,9 @@ import { type AssignmentTimelineLane, type AssignmentTimelineRound, } from '../../host/assignment-timeline'; -import { errorText } from '../../host/bot-settings'; -import type { HostClient } from '../../host/client'; -import { MethodRefused } from '../../host/client'; +import { errorText } from '@botharness/host-client/bot-settings'; +import type { HostClient } from '@botharness/host-client/client'; +import { MethodRefused } from '@botharness/host-client/client'; import { useHostSession } from '../../host/host-session'; import { useDesignTheme } from '../design/theme'; import { edge, radius, rowGlyph, space } from '../design/tokens'; diff --git a/apps/mobile/src/ui/chat/attachment-file-tile.tsx b/apps/mobile/src/ui/chat/attachment-file-tile.tsx index 7a2970047e..1babe6a51b 100644 --- a/apps/mobile/src/ui/chat/attachment-file-tile.tsx +++ b/apps/mobile/src/ui/chat/attachment-file-tile.tsx @@ -1,5 +1,5 @@ import { View } from 'react-native'; -import type { MessageAttachment } from '../../host/conversation'; +import type { MessageAttachment } from '@botharness/host-client/conversation'; import { edge, fileTile, space } from '../design/tokens'; import { useDesignTheme } from '../design/theme'; import { Text } from '../primitives/text'; diff --git a/apps/mobile/src/ui/chat/avatar-editor.tsx b/apps/mobile/src/ui/chat/avatar-editor.tsx index 8e6d9b19f5..7786d6356f 100644 --- a/apps/mobile/src/ui/chat/avatar-editor.tsx +++ b/apps/mobile/src/ui/chat/avatar-editor.tsx @@ -1,7 +1,7 @@ import { useRef, useState, type ReactNode } from 'react'; import { Pressable, View } from 'react-native'; -import { errorText } from '../../host/bot-settings'; +import { errorText } from '@botharness/host-client/bot-settings'; import type { LayerName } from '../design/layers'; import { pressTint, useDesignTheme } from '../design/theme'; import { edge, space } from '../design/tokens'; diff --git a/apps/mobile/src/ui/chat/bot-access-screen.tsx b/apps/mobile/src/ui/chat/bot-access-screen.tsx index 3fe478e23a..67102e0214 100644 --- a/apps/mobile/src/ui/chat/bot-access-screen.tsx +++ b/apps/mobile/src/ui/chat/bot-access-screen.tsx @@ -2,8 +2,8 @@ import { useRef, useState } from 'react'; import { ScrollView, View } from 'react-native'; import { botAccess, setBotAccess, type BotAccess, type BotAccessKind } from '../../host/bot-access'; -import { errorText, HostAnswerInvalid } from '../../host/bot-settings'; -import type { HostClient, RosterBot } from '../../host/client'; +import { errorText, HostAnswerInvalid } from '@botharness/host-client/bot-settings'; +import type { HostClient, RosterBot } from '@botharness/host-client/client'; import { useDesignTheme } from '../design/theme'; import { edge, space } from '../design/tokens'; import { SettingsRow, SettingsSection } from '../primitives/settings-row'; diff --git a/apps/mobile/src/ui/chat/bot-inbox-screen.tsx b/apps/mobile/src/ui/chat/bot-inbox-screen.tsx index 55fbac41d8..5d4ef20ae9 100644 --- a/apps/mobile/src/ui/chat/bot-inbox-screen.tsx +++ b/apps/mobile/src/ui/chat/bot-inbox-screen.tsx @@ -3,8 +3,8 @@ import { useMemo, useSyncExternalStore } from 'react'; import { FlatList, View, type ViewInstance } from 'react-native'; import { createBotInbox, inboxOrder } from '../../host/bot-inbox'; -import type { HostClient } from '../../host/client'; -import type { BotInboxItem } from '../../host/wire'; +import type { HostClient } from '@botharness/host-client/client'; +import type { BotInboxItem } from '@botharness/host-protocol/wire'; import { useDesignTheme } from '../design/theme'; import { edge, radius, space } from '../design/tokens'; import { useMounted } from '../mounted'; diff --git a/apps/mobile/src/ui/chat/bot-name-setting.tsx b/apps/mobile/src/ui/chat/bot-name-setting.tsx index c5a87a38af..8ff2c30c29 100644 --- a/apps/mobile/src/ui/chat/bot-name-setting.tsx +++ b/apps/mobile/src/ui/chat/bot-name-setting.tsx @@ -1,7 +1,7 @@ import { useRef, useState } from 'react'; import { View } from 'react-native'; -import { errorText } from '../../host/bot-settings'; +import { errorText } from '@botharness/host-client/bot-settings'; import { space } from '../design/tokens'; import { Button } from '../primitives/button'; import { KeyboardFormScroll } from '../primitives/keyboard-form'; diff --git a/apps/mobile/src/ui/chat/bot-permissions.tsx b/apps/mobile/src/ui/chat/bot-permissions.tsx index 63d31fa600..8c7f6de059 100644 --- a/apps/mobile/src/ui/chat/bot-permissions.tsx +++ b/apps/mobile/src/ui/chat/bot-permissions.tsx @@ -3,8 +3,8 @@ import { useCallback, useMemo } from 'react'; import { View } from 'react-native'; import { botAccess } from '../../host/bot-access'; -import { botSettings } from '../../host/bot-settings'; -import type { HostClient, RosterBot } from '../../host/client'; +import { botSettings } from '@botharness/host-client/bot-settings'; +import type { HostClient, RosterBot } from '@botharness/host-client/client'; import { useDesignTheme } from '../design/theme'; import { edge } from '../design/tokens'; import { type RowIconName } from '../primitives/row-icon'; diff --git a/apps/mobile/src/ui/chat/bot-profile.tsx b/apps/mobile/src/ui/chat/bot-profile.tsx index 73fe6ab79e..c04a60a6b1 100644 --- a/apps/mobile/src/ui/chat/bot-profile.tsx +++ b/apps/mobile/src/ui/chat/bot-profile.tsx @@ -10,10 +10,10 @@ import { type ProfileAssignment, type ProfilePart, } from '../../host/bot-profile'; -import type { RosterBot, RosterChannel } from '../../host/client'; +import type { RosterBot, RosterChannel } from '@botharness/host-client/client'; import { runningSessions, type RunningSession, type SessionStopper } from '../../host/session-stop'; import type { MemoryChange, MemoryChangesPage } from '../../host/memory-changes'; -import type { BotScheduleSummary, ProfileActivity } from '../../host/wire'; +import type { BotScheduleSummary, ProfileActivity } from '@botharness/host-protocol/wire'; import { botBanner } from '../../marketplace/artwork'; import { BotAvatar } from '../bot-avatar'; import { useDesignTheme } from '../design/theme'; diff --git a/apps/mobile/src/ui/chat/bot-settings-panel.tsx b/apps/mobile/src/ui/chat/bot-settings-panel.tsx index 5512df2369..14cdab223b 100644 --- a/apps/mobile/src/ui/chat/bot-settings-panel.tsx +++ b/apps/mobile/src/ui/chat/bot-settings-panel.tsx @@ -3,10 +3,10 @@ import { useProfileFocusEffect } from './profile-visibility'; import { useMemo, useCallback, useRef, useState, type ReactNode } from 'react'; import { Platform, View } from 'react-native'; -import { botSettings, errorText } from '../../host/bot-settings'; +import { botSettings, errorText } from '@botharness/host-client/bot-settings'; import { dmChannel } from '../../host/bot-profile'; import { renameBot } from '../../host/bot-name'; -import type { HostClient, RosterBot } from '../../host/client'; +import type { HostClient, RosterBot } from '@botharness/host-client/client'; import { useHostSession } from '../../host/host-session'; import { useDesignTheme } from '../design/theme'; import { edge, space } from '../design/tokens'; diff --git a/apps/mobile/src/ui/chat/bot-settings-screen.tsx b/apps/mobile/src/ui/chat/bot-settings-screen.tsx index 34ec5a890b..bb6d5ccc72 100644 --- a/apps/mobile/src/ui/chat/bot-settings-screen.tsx +++ b/apps/mobile/src/ui/chat/bot-settings-screen.tsx @@ -2,7 +2,7 @@ import { useFocusEffect, useLocalSearchParams, useRouter } from 'expo-router'; import { useCallback, useMemo } from 'react'; import { View } from 'react-native'; -import { botSettings } from '../../host/bot-settings'; +import { botSettings } from '@botharness/host-client/bot-settings'; import { useHostSession, useHostSnapshot } from '../../host/host-session'; import { SheetPage } from '../primitives/sheet-page'; import { useStrings } from '../strings'; diff --git a/apps/mobile/src/ui/chat/bot-steps.ts b/apps/mobile/src/ui/chat/bot-steps.ts index 9c9b4febf9..e4e779dff6 100644 --- a/apps/mobile/src/ui/chat/bot-steps.ts +++ b/apps/mobile/src/ui/chat/bot-steps.ts @@ -1,4 +1,4 @@ -import type { AggregatedState, WireToolActivity } from '../../host/wire'; +import type { AggregatedState, WireToolActivity } from '@botharness/host-protocol/wire'; import { t } from '../strings'; export function stepLabel(activity: WireToolActivity | undefined, state: AggregatedState): string { diff --git a/apps/mobile/src/ui/chat/bot-tone.ts b/apps/mobile/src/ui/chat/bot-tone.ts index 5352532b29..9c26f5210f 100644 --- a/apps/mobile/src/ui/chat/bot-tone.ts +++ b/apps/mobile/src/ui/chat/bot-tone.ts @@ -1,4 +1,4 @@ -import type { RosterBot } from '../../host/client'; +import type { RosterBot } from '@botharness/host-client/client'; import type { ColorRole } from '../design/theme'; export function botStateTone(bot: RosterBot): ColorRole { diff --git a/apps/mobile/src/ui/chat/browser-stage.tsx b/apps/mobile/src/ui/chat/browser-stage.tsx index 95f53890ef..71c5e803aa 100644 --- a/apps/mobile/src/ui/chat/browser-stage.tsx +++ b/apps/mobile/src/ui/chat/browser-stage.tsx @@ -17,7 +17,7 @@ import { stagePoint, type BrowserFrame, type BrowserInput, -} from '../../host/browser-viewer'; +} from '@botharness/host-client/browser-viewer'; import { spring } from '../design/motion'; import { pointer, radius, edge } from '../design/tokens'; import { useDesignTheme } from '../design/theme'; diff --git a/apps/mobile/src/ui/chat/call-button.ts b/apps/mobile/src/ui/chat/call-button.ts index e7ec673696..63f96813e7 100644 --- a/apps/mobile/src/ui/chat/call-button.ts +++ b/apps/mobile/src/ui/chat/call-button.ts @@ -3,7 +3,7 @@ import { useCallback, useRef, useSyncExternalStore } from 'react'; import { readCallReadiness } from '../../../../../packages/core/src/voice/call-client'; import { VOICE_CALL_PATH } from '../../../../../packages/core/src/voice/call-contract'; -import type { HostClient } from '../../host/client'; +import type { HostClient } from '@botharness/host-client/client'; import { callMediaSupported } from '../../host/call-media'; import { showAppDialog } from '../primitives/app-dialog'; import { useStrings } from '../strings'; diff --git a/apps/mobile/src/ui/chat/call-session-host.tsx b/apps/mobile/src/ui/chat/call-session-host.tsx index 81ce70ffae..86521fb642 100644 --- a/apps/mobile/src/ui/chat/call-session-host.tsx +++ b/apps/mobile/src/ui/chat/call-session-host.tsx @@ -25,7 +25,7 @@ import { type CallActivityBadges, } from '../../host/native-call-activity-images'; import { callAudioPreference } from '../../host/native-call-audio-route'; -import { humanBubbleColors } from '../../../../../packages/client/src/client/bot-name-color'; +import { humanBubbleColors } from '@botharness/host-client/shared/bot-name-color'; import { botColor } from '../bot-color'; import { useDesignTheme } from '../design/theme'; import { useMounted } from '../mounted'; diff --git a/apps/mobile/src/ui/chat/channel-details-screen.tsx b/apps/mobile/src/ui/chat/channel-details-screen.tsx index 9e81719a08..972da0a69d 100644 --- a/apps/mobile/src/ui/chat/channel-details-screen.tsx +++ b/apps/mobile/src/ui/chat/channel-details-screen.tsx @@ -2,7 +2,7 @@ import { useRouter } from 'expo-router'; import type { ReactNode } from 'react'; import { View } from 'react-native'; -import type { RosterBot } from '../../host/client'; +import type { RosterBot } from '@botharness/host-client/client'; import { useHostSession, useHostSnapshot } from '../../host/host-session'; import { botBanner } from '../../marketplace/artwork'; import { BotAvatar } from '../bot-avatar'; diff --git a/apps/mobile/src/ui/chat/channel-files-screen.tsx b/apps/mobile/src/ui/chat/channel-files-screen.tsx index 0db3e96eda..4d95d83e8c 100644 --- a/apps/mobile/src/ui/chat/channel-files-screen.tsx +++ b/apps/mobile/src/ui/chat/channel-files-screen.tsx @@ -9,8 +9,8 @@ import { useCallback, useMemo, useRef, useState, useSyncExternalStore } from 're import { FlatList, Pressable, View } from 'react-native'; import { createChannelFiles, type ChannelFile } from '../../host/channel-files'; -import type { HostClient } from '../../host/client'; -import type { MessageAttachment } from '../../host/conversation'; +import type { HostClient } from '@botharness/host-client/client'; +import type { MessageAttachment } from '@botharness/host-client/conversation'; import { retainHostActivity, useHostSession, useHostSnapshot } from '../../host/host-session'; import { shareAttachment } from '../../host/share-attachment'; import { channelMedia, edge, space } from '../design/tokens'; diff --git a/apps/mobile/src/ui/chat/channel-files-tab.tsx b/apps/mobile/src/ui/chat/channel-files-tab.tsx index b6e5807c49..1337382cef 100644 --- a/apps/mobile/src/ui/chat/channel-files-tab.tsx +++ b/apps/mobile/src/ui/chat/channel-files-tab.tsx @@ -1,7 +1,7 @@ import { useState, type ReactNode } from 'react'; import { View } from 'react-native'; -import type { HostClient } from '../../host/client'; +import type { HostClient } from '@botharness/host-client/client'; import { space } from '../design/tokens'; import { LoadingIndicator } from '../primitives/loading-indicator'; import { Segmented } from '../primitives/segmented'; diff --git a/apps/mobile/src/ui/chat/channel-media.tsx b/apps/mobile/src/ui/chat/channel-media.tsx index ad64ff8d13..4c923a1d17 100644 --- a/apps/mobile/src/ui/chat/channel-media.tsx +++ b/apps/mobile/src/ui/chat/channel-media.tsx @@ -2,7 +2,7 @@ import { useState } from 'react'; import { Pressable, View } from 'react-native'; import type { ChannelFile } from '../../host/channel-files'; -import type { MessageAttachment } from '../../host/conversation'; +import type { MessageAttachment } from '@botharness/host-client/conversation'; import { useDesignTheme } from '../design/theme'; import { channelMedia, radius, space } from '../design/tokens'; import { ResourceImage as Image } from '../primitives/resource-image'; diff --git a/apps/mobile/src/ui/chat/channel-title.tsx b/apps/mobile/src/ui/chat/channel-title.tsx index f59224c727..2fa4eb8dda 100644 --- a/apps/mobile/src/ui/chat/channel-title.tsx +++ b/apps/mobile/src/ui/chat/channel-title.tsx @@ -4,7 +4,7 @@ import { View } from 'react-native'; import { HeaderTitleButton } from './header-title-button'; import { ConnectionProgress } from '../primitives/connection-progress'; -import type { RosterBot, RosterChannel } from '../../host/client'; +import type { RosterBot, RosterChannel } from '@botharness/host-client/client'; import { useDesignTheme } from '../design/theme'; import { radius, space } from '../design/tokens'; import { Text } from '../primitives/text'; diff --git a/apps/mobile/src/ui/chat/channel-viewport.ts b/apps/mobile/src/ui/chat/channel-viewport.ts index a31b41ccec..2161705ab8 100644 --- a/apps/mobile/src/ui/chat/channel-viewport.ts +++ b/apps/mobile/src/ui/chat/channel-viewport.ts @@ -2,7 +2,7 @@ import { useCallback, useMemo, useRef, useState, type RefObject } from 'react'; import type { FlatList, LayoutChangeEvent } from 'react-native'; import { useSharedValue, useReducedMotion } from 'react-native-reanimated'; -import type { ConversationMessage } from '../../host/conversation'; +import type { ConversationMessage } from '@botharness/host-client/conversation'; import { nativeChatRecycler } from '../primitives/chat-recycler'; import { useChatScrollAdapter, useChatOverlayStyle } from '../primitives/chat-scroll'; import { useFollowLatest } from './follow-latest'; diff --git a/apps/mobile/src/ui/chat/chat-title.tsx b/apps/mobile/src/ui/chat/chat-title.tsx index 08b2f847aa..56847e2ddc 100644 --- a/apps/mobile/src/ui/chat/chat-title.tsx +++ b/apps/mobile/src/ui/chat/chat-title.tsx @@ -3,7 +3,7 @@ import { HeaderTitleButton } from './header-title-button'; import { ConnectionProgress } from '../primitives/connection-progress'; import { View } from 'react-native'; -import type { RosterBot } from '../../host/client'; +import type { RosterBot } from '@botharness/host-client/client'; import { BotAvatar } from '../bot-avatar'; import { useDesignTheme } from '../design/theme'; import { radius, space } from '../design/tokens'; diff --git a/apps/mobile/src/ui/chat/composer-context.ts b/apps/mobile/src/ui/chat/composer-context.ts index fd7194dccc..0ff7ee7ef0 100644 --- a/apps/mobile/src/ui/chat/composer-context.ts +++ b/apps/mobile/src/ui/chat/composer-context.ts @@ -7,7 +7,7 @@ import { type AssignmentAccess, type BotSettings, type Loadable, -} from '../../host/bot-settings'; +} from '@botharness/host-client/bot-settings'; import { useMounted } from '../mounted'; function useLoadable(load: (() => Promise) | undefined) { diff --git a/apps/mobile/src/ui/chat/composer-labels.ts b/apps/mobile/src/ui/chat/composer-labels.ts index 66923f7765..fa7880f77a 100644 --- a/apps/mobile/src/ui/chat/composer-labels.ts +++ b/apps/mobile/src/ui/chat/composer-labels.ts @@ -3,7 +3,7 @@ import { type BotModel, type Loadable, type WorkspaceGrant, -} from '../../host/bot-settings'; +} from '@botharness/host-client/bot-settings'; import { t } from '../strings'; export function modelLabel(model: Loadable): string { diff --git a/apps/mobile/src/ui/chat/computer-click-ripple.tsx b/apps/mobile/src/ui/chat/computer-click-ripple.tsx index 84d56cb181..20df0aee63 100644 --- a/apps/mobile/src/ui/chat/computer-click-ripple.tsx +++ b/apps/mobile/src/ui/chat/computer-click-ripple.tsx @@ -12,7 +12,7 @@ import Animated, { type SharedValue, } from 'react-native-reanimated'; -import type { StageZoom } from '../../host/browser-viewer'; +import type { StageZoom } from '@botharness/host-client/browser-viewer'; import { videoPointerPosition } from '../../host/local-video-pointer'; import { decelerateCurve } from '../design/motion'; import { computerClickRipple as ripple, edge, pointer, radius } from '../design/tokens'; diff --git a/apps/mobile/src/ui/chat/computer-controls.tsx b/apps/mobile/src/ui/chat/computer-controls.tsx index 53c7c87217..c3a74c0a9b 100644 --- a/apps/mobile/src/ui/chat/computer-controls.tsx +++ b/apps/mobile/src/ui/chat/computer-controls.tsx @@ -8,7 +8,11 @@ import Animated, { withSpring, } from 'react-native-reanimated'; -import { COMPUTER_KEYS, WHEEL_STEP, type ComputerModifier } from '../../host/computer-viewer'; +import { + COMPUTER_KEYS, + WHEEL_STEP, + type ComputerModifier, +} from '@botharness/host-client/computer-viewer'; import { buttonColors } from '../design/controls'; import { useDesignTheme } from '../design/theme'; import { spring } from '../design/motion'; diff --git a/apps/mobile/src/ui/chat/computer-video-header.android.tsx b/apps/mobile/src/ui/chat/computer-video-header.android.tsx index 53871416ad..fb10c9a10f 100644 --- a/apps/mobile/src/ui/chat/computer-video-header.android.tsx +++ b/apps/mobile/src/ui/chat/computer-video-header.android.tsx @@ -4,7 +4,7 @@ import { View } from 'react-native'; import type { LocalVideoClientState } from '../../../../../packages/computer/src/local-video-client'; import { useHostLook } from '../../host/native-host-look'; -import { shownHostName } from '../design/host-look'; +import { shownHostName } from '@botharness/host-client/ui/design/host-look'; import { useDesignTheme } from '../design/theme'; import { radius, space } from '../design/tokens'; import { SystemSymbol } from '../primitives/system-symbol'; diff --git a/apps/mobile/src/ui/chat/computer-video-keyboard.tsx b/apps/mobile/src/ui/chat/computer-video-keyboard.tsx index 4bf1965cbf..28d8a4d498 100644 --- a/apps/mobile/src/ui/chat/computer-video-keyboard.tsx +++ b/apps/mobile/src/ui/chat/computer-video-keyboard.tsx @@ -4,7 +4,7 @@ import { View, type NativeSyntheticEvent, type ViewProps } from 'react-native'; import { createRemoteKeyboardInput, type RemoteKeyboardFailure, -} from '../../host/remote-keyboard-input'; +} from '@botharness/host-client/remote-keyboard-input'; import { useMounted } from '../mounted'; import type { DesktopInput } from '../../../../../packages/computer/src/desktop-view'; import { edge } from '../design/tokens'; diff --git a/apps/mobile/src/ui/chat/computer-video-stage.tsx b/apps/mobile/src/ui/chat/computer-video-stage.tsx index ed06790824..38fe800e83 100644 --- a/apps/mobile/src/ui/chat/computer-video-stage.tsx +++ b/apps/mobile/src/ui/chat/computer-video-stage.tsx @@ -8,7 +8,7 @@ import Animated, { } from 'react-native-reanimated'; import { scheduleOnRN } from 'react-native-worklets'; -import { fittedFrame, moveCursor, type StageZoom } from '../../host/browser-viewer'; +import { fittedFrame, moveCursor, type StageZoom } from '@botharness/host-client/browser-viewer'; import { resizeVideoPreview, revealVideoPointer, diff --git a/apps/mobile/src/ui/chat/computer-video-status.ts b/apps/mobile/src/ui/chat/computer-video-status.ts index 42cc282820..8655c4bf07 100644 --- a/apps/mobile/src/ui/chat/computer-video-status.ts +++ b/apps/mobile/src/ui/chat/computer-video-status.ts @@ -1,5 +1,5 @@ import type { LocalVideoClientState } from '../../../../../packages/computer/src/local-video-client'; -import type { ConnectionState } from '../../host/client'; +import type { ConnectionState } from '@botharness/host-client/client'; export function computerVideoStatus(state: LocalVideoClientState, connection: ConnectionState) { const connected = connection.status === 'connected'; diff --git a/apps/mobile/src/ui/chat/conversation-actions.ts b/apps/mobile/src/ui/chat/conversation-actions.ts index 7bb9154b4f..9b10f5e5b1 100644 --- a/apps/mobile/src/ui/chat/conversation-actions.ts +++ b/apps/mobile/src/ui/chat/conversation-actions.ts @@ -1,5 +1,5 @@ -import type { HostClient } from '../../host/client'; -import type { Inbox } from '../../host/inbox'; +import type { HostClient } from '@botharness/host-client/client'; +import type { Inbox } from '@botharness/host-client/inbox'; import { t } from '../strings'; import type { Conversation } from './conversations'; diff --git a/apps/mobile/src/ui/chat/conversation-menu.ts b/apps/mobile/src/ui/chat/conversation-menu.ts index a492fd8f9d..d16b7f6677 100644 --- a/apps/mobile/src/ui/chat/conversation-menu.ts +++ b/apps/mobile/src/ui/chat/conversation-menu.ts @@ -1,4 +1,4 @@ -import type { RosterSection } from '../../host/client'; +import type { RosterSection } from '@botharness/host-client/client'; import type { DeletionTarget } from '../../host/deletion'; import type { ItemMenuAction } from '../primitives/item-menu'; import { t } from '../strings'; diff --git a/apps/mobile/src/ui/chat/conversation-row.tsx b/apps/mobile/src/ui/chat/conversation-row.tsx index 8d80cc8da0..b6085bdec4 100644 --- a/apps/mobile/src/ui/chat/conversation-row.tsx +++ b/apps/mobile/src/ui/chat/conversation-row.tsx @@ -4,7 +4,7 @@ import { SourceMark, SourceName } from './source-name'; import { Platform, Pressable, View, type ViewInstance } from 'react-native'; import { BotAvatar } from '../bot-avatar'; -import type { HostLook } from '../design/host-look'; +import type { HostLook } from '@botharness/host-client/ui/design/host-look'; import { chatList, conversationType, diff --git a/apps/mobile/src/ui/chat/conversation-screen.tsx b/apps/mobile/src/ui/chat/conversation-screen.tsx index f73aa6fcf0..4c37441f1f 100644 --- a/apps/mobile/src/ui/chat/conversation-screen.tsx +++ b/apps/mobile/src/ui/chat/conversation-screen.tsx @@ -54,9 +54,9 @@ import { backgroundImageUri, } from '../../host/native-chat-background'; import { ChatBackground } from './chat-background'; -import type { HostClient, RosterBot } from '../../host/client'; +import type { HostClient, RosterBot } from '@botharness/host-client/client'; import { visibleDmActivity } from '../../host/dm-activity'; -import { latestTurnMessageId } from '../../host/session-failure'; +import { latestTurnMessageId } from '@botharness/host-client/session-failure'; import { useHiddenDmActivity } from '../../host/native-dm-activity'; import { useMessageDisplay } from '../../host/native-message-display'; import { useDeliveryReceiptPreferences } from '../../host/native-delivery-receipts'; @@ -68,9 +68,9 @@ import { type ConversationMessage, type MessageAttachment, type MessageCard, -} from '../../host/conversation'; -import type { Inbox } from '../../host/inbox'; -import type { WireAllBotPreview } from '../../host/wire'; +} from '@botharness/host-client/conversation'; +import type { Inbox } from '@botharness/host-client/inbox'; +import type { WireAllBotPreview } from '@botharness/host-protocol/wire'; import { shareAttachment } from '../../host/share-attachment'; import { MAX_PICKED, @@ -97,7 +97,7 @@ import { loadApproval, loadQuestion, type RequestRef, -} from '../../host/requests'; +} from '@botharness/host-client/requests'; import { useDictation } from '../../host/speech'; import { showDictationProblem } from './dictation-problem'; import { botColor } from '../bot-color'; @@ -164,7 +164,7 @@ import { ImageViewer } from './image-viewer'; import { JumpToLatest } from './jump-to-latest'; import { DeliverySheet } from './delivery-sheet'; import { GenuiInteraction, GenuiViewHost } from './genui-view-client'; -import type { GenuiDocumentReply } from '../../genui/document'; +import type { GenuiDocumentReply } from '@botharness/host-client/genui/document'; import { ChatOffline } from './chat-offline'; import { MessageActions, type MessageMenuTarget } from './message-actions'; import { MessageSourcePage } from './message-source-page'; diff --git a/apps/mobile/src/ui/chat/conversation-section-sheet.tsx b/apps/mobile/src/ui/chat/conversation-section-sheet.tsx index 9baf65f3d3..3ea77cc5c3 100644 --- a/apps/mobile/src/ui/chat/conversation-section-sheet.tsx +++ b/apps/mobile/src/ui/chat/conversation-section-sheet.tsx @@ -2,7 +2,7 @@ import { Stack } from 'expo-router'; import { useRef, useState, useSyncExternalStore } from 'react'; import { FlatList, Platform, View, type ViewInstance } from 'react-native'; -import type { HostClient } from '../../host/client'; +import type { HostClient } from '@botharness/host-client/client'; import { useHostSnapshot } from '../../host/host-session'; import { space } from '../design/tokens'; import { Button } from '../primitives/button'; diff --git a/apps/mobile/src/ui/chat/conversation-sections.ts b/apps/mobile/src/ui/chat/conversation-sections.ts index 0c8e230da1..1a0ae3c843 100644 --- a/apps/mobile/src/ui/chat/conversation-sections.ts +++ b/apps/mobile/src/ui/chat/conversation-sections.ts @@ -1,4 +1,4 @@ -import type { HostClient } from '../../host/client'; +import type { HostClient } from '@botharness/host-client/client'; type Section = { id: string | null; name: string }; export type SectionState = { diff --git a/apps/mobile/src/ui/chat/conversation-top-bar.tsx b/apps/mobile/src/ui/chat/conversation-top-bar.tsx index f67f738c2c..0931517270 100644 --- a/apps/mobile/src/ui/chat/conversation-top-bar.tsx +++ b/apps/mobile/src/ui/chat/conversation-top-bar.tsx @@ -1,4 +1,4 @@ -import type { RosterBot } from '../../host/client'; +import type { RosterBot } from '@botharness/host-client/client'; export type HeaderSelection = { count: number; diff --git a/apps/mobile/src/ui/chat/conversations.ts b/apps/mobile/src/ui/chat/conversations.ts index 368a747f59..140c779c44 100644 --- a/apps/mobile/src/ui/chat/conversations.ts +++ b/apps/mobile/src/ui/chat/conversations.ts @@ -4,10 +4,10 @@ import type { RosterChannel, RosterView, TopOrderEntry, -} from '../../host/client'; -import { approvalSummaryTool } from '../../host/requests'; -import { DEFAULT_ROSTER_SORTING } from '../../host/roster-sorting'; -import type { HumanAttentionItem } from '../../host/wire'; +} from '@botharness/host-client/client'; +import { approvalSummaryTool } from '@botharness/host-client/requests'; +import { DEFAULT_ROSTER_SORTING } from '@botharness/host-client/roster-sorting'; +import type { HumanAttentionItem } from '@botharness/host-protocol/wire'; import { t } from '../strings'; interface Attention { diff --git a/apps/mobile/src/ui/chat/delivery-sheet.tsx b/apps/mobile/src/ui/chat/delivery-sheet.tsx index 067911cd59..2d9d5f2b84 100644 --- a/apps/mobile/src/ui/chat/delivery-sheet.tsx +++ b/apps/mobile/src/ui/chat/delivery-sheet.tsx @@ -1,6 +1,6 @@ import { FlatList, Pressable, View } from 'react-native'; -import type { ConversationMessage } from '../../host/conversation'; +import type { ConversationMessage } from '@botharness/host-client/conversation'; import { receiptGroups, receiptRecipients } from '../../host/delivery-receipt'; import { useDesignTheme } from '../design/theme'; import { radius, rowGlyph, space } from '../design/tokens'; diff --git a/apps/mobile/src/ui/chat/delivery-stack.tsx b/apps/mobile/src/ui/chat/delivery-stack.tsx index 2b58414a8f..bdbea77c5a 100644 --- a/apps/mobile/src/ui/chat/delivery-stack.tsx +++ b/apps/mobile/src/ui/chat/delivery-stack.tsx @@ -10,8 +10,8 @@ import Animated, { withTiming, } from 'react-native-reanimated'; -import type { RosterBot } from '../../host/client'; -import type { ConversationMessage } from '../../host/conversation'; +import type { RosterBot } from '@botharness/host-client/client'; +import type { ConversationMessage } from '@botharness/host-client/conversation'; import { receiptGroups, receiptRecipients, diff --git a/apps/mobile/src/ui/chat/folder-picker-sheet.tsx b/apps/mobile/src/ui/chat/folder-picker-sheet.tsx index aa1dfd442c..601db28f4a 100644 --- a/apps/mobile/src/ui/chat/folder-picker-sheet.tsx +++ b/apps/mobile/src/ui/chat/folder-picker-sheet.tsx @@ -8,7 +8,7 @@ import { type HostFolderListing, type Loadable, type WorkspaceOption, -} from '../../host/bot-settings'; +} from '@botharness/host-client/bot-settings'; import { useMounted } from '../mounted'; import { Button } from '../primitives/button'; import { SettingsGroupItem, SettingsRow } from '../primitives/settings-row'; diff --git a/apps/mobile/src/ui/chat/follow-latest.ts b/apps/mobile/src/ui/chat/follow-latest.ts index fd2ddd071a..3b2464d84c 100644 --- a/apps/mobile/src/ui/chat/follow-latest.ts +++ b/apps/mobile/src/ui/chat/follow-latest.ts @@ -6,7 +6,7 @@ import type { NativeSyntheticEvent, } from 'react-native'; -import type { ConversationMessage } from '../../host/conversation'; +import type { ConversationMessage } from '@botharness/host-client/conversation'; export const LATEST_SLOP = 40; export const SETTLE_FRAMES = 45; diff --git a/apps/mobile/src/ui/chat/genui-document-card.tsx b/apps/mobile/src/ui/chat/genui-document-card.tsx index 7461915227..d6003e2aa3 100644 --- a/apps/mobile/src/ui/chat/genui-document-card.tsx +++ b/apps/mobile/src/ui/chat/genui-document-card.tsx @@ -24,10 +24,10 @@ import { rememberGenuiHeight, type GenuiDocument, type GenuiDocumentReply, -} from '../../genui/document'; +} from '@botharness/host-client/genui/document'; import { genuiStartQueue } from '../../genui/start-queue'; import { genuiWebViewPolicy } from '../../genui/webview-policy'; -import { genuiDocumentView, type GenuiDocumentViewModel } from '../../genui/view'; +import { genuiDocumentView, type GenuiDocumentViewModel } from '@botharness/host-client/genui/view'; import { radius, space } from '../design/tokens'; import { useDesignTheme } from '../design/theme'; import { Button } from '../primitives/button'; diff --git a/apps/mobile/src/ui/chat/genui-view-client.ts b/apps/mobile/src/ui/chat/genui-view-client.ts index 9ba09fa6f2..4453934527 100644 --- a/apps/mobile/src/ui/chat/genui-view-client.ts +++ b/apps/mobile/src/ui/chat/genui-view-client.ts @@ -1,7 +1,7 @@ import { createContext } from 'react'; -import type { GenuiDocumentReply } from '../../genui/document'; -import type { GenuiViewClient } from '../../genui/view'; +import type { GenuiDocumentReply } from '@botharness/host-client/genui/document'; +import type { GenuiViewClient } from '@botharness/host-client/genui/view'; import type { GenuiInputViewport } from './genui-input-viewport'; export const GenuiViewHost = createContext(undefined); diff --git a/apps/mobile/src/ui/chat/grant-request-card.tsx b/apps/mobile/src/ui/chat/grant-request-card.tsx index 1df5d66750..f20a1f1fcd 100644 --- a/apps/mobile/src/ui/chat/grant-request-card.tsx +++ b/apps/mobile/src/ui/chat/grant-request-card.tsx @@ -1,8 +1,8 @@ import { useCallback, useRef, useState } from 'react'; import { View, type ViewInstance } from 'react-native'; -import type { WorkspaceOption } from '../../host/bot-settings'; -import type { DecisionResult, GrantRequest } from '../../host/requests'; +import type { WorkspaceOption } from '@botharness/host-client/bot-settings'; +import type { DecisionResult, GrantRequest } from '@botharness/host-client/requests'; import { haptic } from '../haptics'; import { useMounted } from '../mounted'; import { Button } from '../primitives/button'; diff --git a/apps/mobile/src/ui/chat/group-info.tsx b/apps/mobile/src/ui/chat/group-info.tsx index 8e8fe4d4a6..a1f309621f 100644 --- a/apps/mobile/src/ui/chat/group-info.tsx +++ b/apps/mobile/src/ui/chat/group-info.tsx @@ -7,7 +7,7 @@ import { confirmDestructive, showActionMenu, showAppDialog } from '../primitives import { KeyboardFormScroll } from '../primitives/keyboard-form'; import type { ProfileAssignment, ProfilePart } from '../../host/bot-profile'; -import { errorText } from '../../host/bot-settings'; +import { errorText } from '@botharness/host-client/bot-settings'; import { GROUP_NAME_MAX, memberName, @@ -16,7 +16,7 @@ import { type GroupMember, type GroupPending, } from '../../host/group-channel'; -import type { RosterBot } from '../../host/client'; +import type { RosterBot } from '@botharness/host-client/client'; import { BotAvatar } from '../bot-avatar'; import { useDesignTheme } from '../design/theme'; import { profileShell, radius, space } from '../design/tokens'; diff --git a/apps/mobile/src/ui/chat/header-bot-stack.tsx b/apps/mobile/src/ui/chat/header-bot-stack.tsx index 5de5b4a9fc..65b9a4ee13 100644 --- a/apps/mobile/src/ui/chat/header-bot-stack.tsx +++ b/apps/mobile/src/ui/chat/header-bot-stack.tsx @@ -1,5 +1,5 @@ import { View } from 'react-native'; -import type { RosterBot } from '../../host/client'; +import type { RosterBot } from '@botharness/host-client/client'; import { BotAvatar } from '../bot-avatar'; import { space } from '../design/tokens'; diff --git a/apps/mobile/src/ui/chat/header-status.ts b/apps/mobile/src/ui/chat/header-status.ts index b34689e61a..32a6147c7a 100644 --- a/apps/mobile/src/ui/chat/header-status.ts +++ b/apps/mobile/src/ui/chat/header-status.ts @@ -1,4 +1,4 @@ -import type { RosterBot, RosterChannel } from '../../host/client'; +import type { RosterBot, RosterChannel } from '@botharness/host-client/client'; export function headerStatus( bot: RosterBot | undefined, diff --git a/apps/mobile/src/ui/chat/host-conversation-row.tsx b/apps/mobile/src/ui/chat/host-conversation-row.tsx index 88050a3ec7..bca85deef2 100644 --- a/apps/mobile/src/ui/chat/host-conversation-row.tsx +++ b/apps/mobile/src/ui/chat/host-conversation-row.tsx @@ -1,7 +1,7 @@ import { useHostLook } from '../../host/native-host-look'; import type { DeletionTarget } from '../../host/deletion'; import { ManagedConversationRow } from './managed-conversation-row'; -import { shownHostName } from '../design/host-look'; +import { shownHostName } from '@botharness/host-client/ui/design/host-look'; import type { EnvironmentChatRow as Row } from './environment-chat-list'; export function HostRow({ diff --git a/apps/mobile/src/ui/chat/image-viewer.tsx b/apps/mobile/src/ui/chat/image-viewer.tsx index fbab190d44..91117d6f3d 100644 --- a/apps/mobile/src/ui/chat/image-viewer.tsx +++ b/apps/mobile/src/ui/chat/image-viewer.tsx @@ -13,7 +13,7 @@ import Animated, { } from 'react-native-reanimated'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; -import type { MessageAttachment } from '../../host/conversation'; +import type { MessageAttachment } from '@botharness/host-client/conversation'; import { decelerateCurve, spring } from '../design/motion'; import { radius, space } from '../design/tokens'; import { useDesignTheme } from '../design/theme'; diff --git a/apps/mobile/src/ui/chat/invite-selection.ts b/apps/mobile/src/ui/chat/invite-selection.ts index 173f8ae4f8..1a15a11cd9 100644 --- a/apps/mobile/src/ui/chat/invite-selection.ts +++ b/apps/mobile/src/ui/chat/invite-selection.ts @@ -1,6 +1,6 @@ import { useRef, useState } from 'react'; -import type { RosterBot } from '../../host/client'; -import { errorText } from '../../host/bot-settings'; +import type { RosterBot } from '@botharness/host-client/client'; +import { errorText } from '@botharness/host-client/bot-settings'; import { t } from '../strings'; import { useMounted } from '../mounted'; diff --git a/apps/mobile/src/ui/chat/invite-sheet.tsx b/apps/mobile/src/ui/chat/invite-sheet.tsx index cb50a240a6..b1da087d92 100644 --- a/apps/mobile/src/ui/chat/invite-sheet.tsx +++ b/apps/mobile/src/ui/chat/invite-sheet.tsx @@ -6,7 +6,7 @@ import { useStrings } from '../strings'; import { SHEET_GROUP, Sheet, SheetNote } from './sheet'; import { useRef, useState } from 'react'; import { useMounted } from '../mounted'; -import { errorText } from '../../host/bot-settings'; +import { errorText } from '@botharness/host-client/bot-settings'; import { radius } from '../design/tokens'; export function InviteSheet({ candidates, onInvite, onClose }: InviteSheetProps) { diff --git a/apps/mobile/src/ui/chat/local-computer-screen.android.tsx b/apps/mobile/src/ui/chat/local-computer-screen.android.tsx index ca26c2b847..bc82e32bf6 100644 --- a/apps/mobile/src/ui/chat/local-computer-screen.android.tsx +++ b/apps/mobile/src/ui/chat/local-computer-screen.android.tsx @@ -32,7 +32,7 @@ import { } from '../../../../../packages/computer/src/local-video-client'; import { videoPointerClick, videoPointerScroll } from '../../host/local-video-pointer'; import type { DesktopInput } from '../../../../../packages/computer/src/desktop-view'; -import type { StageZoom } from '../../host/browser-viewer'; +import type { StageZoom } from '@botharness/host-client/browser-viewer'; import { useHostSession, useHostSnapshot } from '../../host/host-session'; import { localVideoActions, watchLocalVideoForeground } from '../../host/local-video-actions'; import { computerCanvas, space } from '../design/tokens'; diff --git a/apps/mobile/src/ui/chat/local-computer-screen.ios.tsx b/apps/mobile/src/ui/chat/local-computer-screen.ios.tsx index b05404e99d..b7a169fe26 100644 --- a/apps/mobile/src/ui/chat/local-computer-screen.ios.tsx +++ b/apps/mobile/src/ui/chat/local-computer-screen.ios.tsx @@ -20,13 +20,13 @@ import { type LocalVideoClientState, } from '../../../../../packages/computer/src/local-video-client'; import { videoPointerClick, videoPointerScroll } from '../../host/local-video-pointer'; -import type { StageZoom } from '../../host/browser-viewer'; +import type { StageZoom } from '@botharness/host-client/browser-viewer'; import { useHostSession, useHostSnapshot } from '../../host/host-session'; import { localVideoActions, watchLocalVideoForeground } from '../../host/local-video-actions'; import { computerCanvas, space } from '../design/tokens'; import { DesignThemeProvider, resolveTheme, useDesignTheme } from '../design/theme'; import { useHostLook } from '../../host/native-host-look'; -import { shownHostName } from '../design/host-look'; +import { shownHostName } from '@botharness/host-client/ui/design/host-look'; import type { ComputerClickFeedback } from './computer-click-ripple'; import { ComputerPointerControls } from './computer-pointer-controls.ios'; import { ComputerVideoControls } from './computer-video-controls.ios'; diff --git a/apps/mobile/src/ui/chat/local-video-notice.ts b/apps/mobile/src/ui/chat/local-video-notice.ts index b33bb7e957..72386e3c93 100644 --- a/apps/mobile/src/ui/chat/local-video-notice.ts +++ b/apps/mobile/src/ui/chat/local-video-notice.ts @@ -1,5 +1,5 @@ import type { LocalVideoClientState } from '../../../../../packages/computer/src/local-video-client'; -import type { ConnectionState } from '../../host/client'; +import type { ConnectionState } from '@botharness/host-client/client'; import { connectionRecoveryText } from '../connection-recovery'; import { t } from '../strings'; diff --git a/apps/mobile/src/ui/chat/managed-conversation-row.tsx b/apps/mobile/src/ui/chat/managed-conversation-row.tsx index a4dd767394..a1b7c85b67 100644 --- a/apps/mobile/src/ui/chat/managed-conversation-row.tsx +++ b/apps/mobile/src/ui/chat/managed-conversation-row.tsx @@ -3,10 +3,10 @@ import { Platform } from 'react-native'; import { showActionMenu } from '../primitives/app-dialog'; import { useStrings } from '../strings'; import { useNavigationContainerRef, useRouter } from 'expo-router'; -import type { HostClient, RosterArrangement } from '../../host/client'; +import type { HostClient, RosterArrangement } from '@botharness/host-client/client'; import type { DeletionTarget } from '../../host/deletion'; -import type { Inbox } from '../../host/inbox'; -import type { HostLook } from '../design/host-look'; +import type { Inbox } from '@botharness/host-client/inbox'; +import type { HostLook } from '@botharness/host-client/ui/design/host-look'; import { ItemMenu } from '../primitives/item-menu'; import { conversationPeek } from '../shell/conversation-peek'; import { conversationHref, openConversation } from '../shell/open-conversation'; diff --git a/apps/mobile/src/ui/chat/mark-read.ts b/apps/mobile/src/ui/chat/mark-read.ts index f4349a4197..87720bbdad 100644 --- a/apps/mobile/src/ui/chat/mark-read.ts +++ b/apps/mobile/src/ui/chat/mark-read.ts @@ -1,8 +1,8 @@ import { useMemo, useRef, type RefCallback } from 'react'; -import type { HostClient } from '../../host/client'; -import type { Conversation, ConversationMessage } from '../../host/conversation'; -import type { Inbox } from '../../host/inbox'; +import type { HostClient } from '@botharness/host-client/client'; +import type { Conversation, ConversationMessage } from '@botharness/host-client/conversation'; +import type { Inbox } from '@botharness/host-client/inbox'; import { useMounted } from '../mounted'; const SETTLE_MS = 250; diff --git a/apps/mobile/src/ui/chat/memory-file-screen.tsx b/apps/mobile/src/ui/chat/memory-file-screen.tsx index 98e4db7c2c..c6a15569ad 100644 --- a/apps/mobile/src/ui/chat/memory-file-screen.tsx +++ b/apps/mobile/src/ui/chat/memory-file-screen.tsx @@ -4,10 +4,10 @@ import { Platform, View, type ViewInstance } from 'react-native'; import { KeyboardAvoidingView } from 'react-native-keyboard-controller'; import type { PinnedRole } from '../../host/bot-profile'; -import type { HostClient } from '../../host/client'; +import type { HostClient } from '@botharness/host-client/client'; import { memoryConflict } from '../../host/memory-edit'; import type { MemoryPreviewIO } from '../../host/memory-preview'; -import type { MemoryFile } from '../../host/wire'; +import type { MemoryFile } from '@botharness/host-protocol/wire'; import { useDesignTheme } from '../design/theme'; import { radius, space } from '../design/tokens'; import { confirmDestructive } from '../primitives/app-dialog'; diff --git a/apps/mobile/src/ui/chat/memory-file-view.tsx b/apps/mobile/src/ui/chat/memory-file-view.tsx index 50561abed9..86f1906e0e 100644 --- a/apps/mobile/src/ui/chat/memory-file-view.tsx +++ b/apps/mobile/src/ui/chat/memory-file-view.tsx @@ -2,10 +2,10 @@ import { useCallback, useMemo, useRef, type ReactNode } from 'react'; import { Lexer } from 'marked'; import { FlatList, View, type ViewInstance } from 'react-native'; -import type { HostClient } from '../../host/client'; +import type { HostClient } from '@botharness/host-client/client'; import type { MemoryPreviewIO } from '../../host/memory-preview'; import type { PinnedRole } from '../../host/bot-profile'; -import type { MemoryFile } from '../../host/wire'; +import type { MemoryFile } from '@botharness/host-protocol/wire'; import { useDesignTheme } from '../design/theme'; import { space } from '../design/tokens'; import { Text } from '../primitives/text'; diff --git a/apps/mobile/src/ui/chat/memory-markdown.tsx b/apps/mobile/src/ui/chat/memory-markdown.tsx index 0a9a393e5d..2d38fe7176 100644 --- a/apps/mobile/src/ui/chat/memory-markdown.tsx +++ b/apps/mobile/src/ui/chat/memory-markdown.tsx @@ -2,9 +2,9 @@ import { decodeHTML } from 'entities'; import type { Token } from 'marked'; import { Linking, View } from 'react-native'; -import type { HostClient } from '../../host/client'; +import type { HostClient } from '@botharness/host-client/client'; import type { MemoryPreviewIO } from '../../host/memory-preview'; -import type { MemoryMarkdown } from '../../host/wire'; +import type { MemoryMarkdown } from '@botharness/host-protocol/wire'; import { useDesignTheme } from '../design/theme'; import { space } from '../design/tokens'; import { renderMarkdownInline } from '../markdown-inline'; diff --git a/apps/mobile/src/ui/chat/memory-preview-image.tsx b/apps/mobile/src/ui/chat/memory-preview-image.tsx index 438fc9f84b..302e30bf24 100644 --- a/apps/mobile/src/ui/chat/memory-preview-image.tsx +++ b/apps/mobile/src/ui/chat/memory-preview-image.tsx @@ -2,8 +2,8 @@ import { use, useState } from 'react'; import { Pressable, useWindowDimensions, View, type ViewInstance } from 'react-native'; import { Image } from 'expo-image'; -import type { HostClient } from '../../host/client'; -import type { MessageAttachment } from '../../host/conversation'; +import type { HostClient } from '@botharness/host-client/client'; +import type { MessageAttachment } from '@botharness/host-client/conversation'; import { imageReferenceKind, loadPreviewImage, @@ -11,7 +11,7 @@ import { type MemoryPreviewIO, type PreviewImage, } from '../../host/memory-preview'; -import type { MemoryImage, MemoryMarkdown } from '../../host/wire'; +import type { MemoryImage, MemoryMarkdown } from '@botharness/host-protocol/wire'; import { shareAttachment } from '../../host/share-attachment'; import { retainHostActivity } from '../../host/host-session'; import { useDesignTheme } from '../design/theme'; diff --git a/apps/mobile/src/ui/chat/mention-draft.ts b/apps/mobile/src/ui/chat/mention-draft.ts index 1958cdd909..47cb61ec01 100644 --- a/apps/mobile/src/ui/chat/mention-draft.ts +++ b/apps/mobile/src/ui/chat/mention-draft.ts @@ -6,9 +6,9 @@ import { type MentionQuery, type SelectedMention, } from '../../../../../packages/client/src/client/mentions'; -import type { RosterBot } from '../../host/client'; -import type { MessageTags } from '../../host/conversation'; -import type { WireAllBotPreview } from '../../host/wire'; +import type { RosterBot } from '@botharness/host-client/client'; +import type { MessageTags } from '@botharness/host-client/conversation'; +import type { WireAllBotPreview } from '@botharness/host-protocol/wire'; export { activeMentionQuery, diff --git a/apps/mobile/src/ui/chat/message-actions.ios.tsx b/apps/mobile/src/ui/chat/message-actions.ios.tsx index e0ffe75b2b..48a1ccae9c 100644 --- a/apps/mobile/src/ui/chat/message-actions.ios.tsx +++ b/apps/mobile/src/ui/chat/message-actions.ios.tsx @@ -34,7 +34,7 @@ import { Fragment, useRef, useState } from 'react'; import { Platform, useWindowDimensions } from 'react-native'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; -import { MENU_REACTIONS, reactedByMe } from '../../host/conversation'; +import { MENU_REACTIONS, reactedByMe } from '@botharness/host-client/conversation'; import { radius, space } from '../design/tokens'; import { useDesignTheme } from '../design/theme'; import { rowSymbol } from '../primitives/row-icon'; diff --git a/apps/mobile/src/ui/chat/message-attachment-picker.tsx b/apps/mobile/src/ui/chat/message-attachment-picker.tsx index 5a1f381e8d..b55abff622 100644 --- a/apps/mobile/src/ui/chat/message-attachment-picker.tsx +++ b/apps/mobile/src/ui/chat/message-attachment-picker.tsx @@ -1,7 +1,7 @@ import { useRef, useState } from 'react'; import { Pressable, ScrollView, View, type ScrollViewInstance } from 'react-native'; -import type { MessageAttachment } from '../../host/conversation'; +import type { MessageAttachment } from '@botharness/host-client/conversation'; import { edge, space } from '../design/tokens'; import { useDesignTheme } from '../design/theme'; import { LoadingIndicator } from '../primitives/loading-indicator'; diff --git a/apps/mobile/src/ui/chat/message-attachments.tsx b/apps/mobile/src/ui/chat/message-attachments.tsx index b7404d81cd..191401e6e0 100644 --- a/apps/mobile/src/ui/chat/message-attachments.tsx +++ b/apps/mobile/src/ui/chat/message-attachments.tsx @@ -7,7 +7,7 @@ import { singleImageAspect, type AlbumRect, } from '../../../../../packages/client/src/client/album-layout'; -import type { MessageAttachment, ReplyThumbnail } from '../../host/conversation'; +import type { MessageAttachment, ReplyThumbnail } from '@botharness/host-client/conversation'; import { over } from '../design/layers'; import { mediaBubble, radius, replyThumb, space } from '../design/tokens'; import { useDesignTheme } from '../design/theme'; diff --git a/apps/mobile/src/ui/chat/message-body.tsx b/apps/mobile/src/ui/chat/message-body.tsx index 2becec69f9..65eda736f3 100644 --- a/apps/mobile/src/ui/chat/message-body.tsx +++ b/apps/mobile/src/ui/chat/message-body.tsx @@ -1,9 +1,9 @@ import { useContext, useMemo, type ReactNode } from 'react'; import { View } from 'react-native'; -import { botNameColor } from '../../../../../packages/client/src/client/bot-name-color'; -import type { ConversationMessage } from '../../host/conversation'; -import type { WireMention } from '../../host/wire'; +import { botNameColor } from '@botharness/host-client/shared/bot-name-color'; +import type { ConversationMessage } from '@botharness/host-client/conversation'; +import type { WireMention } from '@botharness/host-protocol/wire'; import { BotAvatar } from '../bot-avatar'; import { botColor } from '../bot-color'; import { useDesignTheme } from '../design/theme'; diff --git a/apps/mobile/src/ui/chat/message-bubble.tsx b/apps/mobile/src/ui/chat/message-bubble.tsx index 18bc563cb9..2b8e7a1f6b 100644 --- a/apps/mobile/src/ui/chat/message-bubble.tsx +++ b/apps/mobile/src/ui/chat/message-bubble.tsx @@ -41,8 +41,8 @@ import { type ConversationMessage, type ConversationReaction, type MessageAttachment, -} from '../../host/conversation'; -import type { RosterBot } from '../../host/client'; +} from '@botharness/host-client/conversation'; +import type { RosterBot } from '@botharness/host-client/client'; import type { ConversationPlayback } from '../../host/conversation-playback'; import { spring } from '../design/motion'; import { doubleTap, lift, mediaBubble, motion, radius, space } from '../design/tokens'; diff --git a/apps/mobile/src/ui/chat/message-feedback.tsx b/apps/mobile/src/ui/chat/message-feedback.tsx index 58f87e3343..75934e70e0 100644 --- a/apps/mobile/src/ui/chat/message-feedback.tsx +++ b/apps/mobile/src/ui/chat/message-feedback.tsx @@ -5,7 +5,7 @@ import { shareFeedbackArchive } from '../../host/share-feedback'; import { useMemo, useRef, useState, type ReactNode } from 'react'; import { useMounted } from '../mounted'; import { FlatList, View, type ViewInstance } from 'react-native'; -import type { HostClient } from '../../host/client'; +import type { HostClient } from '@botharness/host-client/client'; import { createMessageFeedback, type FeedbackPreview, diff --git a/apps/mobile/src/ui/chat/message-groups.ts b/apps/mobile/src/ui/chat/message-groups.ts index 87cf7adcea..d44c02a7f6 100644 --- a/apps/mobile/src/ui/chat/message-groups.ts +++ b/apps/mobile/src/ui/chat/message-groups.ts @@ -1,4 +1,4 @@ -import type { ConversationMessage } from '../../host/conversation'; +import type { ConversationMessage } from '@botharness/host-client/conversation'; const GROUP_MS = 5 * 60 * 1000; const SEPARATOR_MS = 30 * 60 * 1000; diff --git a/apps/mobile/src/ui/chat/message-identities.ts b/apps/mobile/src/ui/chat/message-identities.ts index 4a9caa5947..025d54ee9d 100644 --- a/apps/mobile/src/ui/chat/message-identities.ts +++ b/apps/mobile/src/ui/chat/message-identities.ts @@ -1,5 +1,5 @@ import { createContext } from 'react'; -import type { RosterBot } from '../../host/client'; +import type { RosterBot } from '@botharness/host-client/client'; export const MessageIdentities = createContext<{ bots: readonly RosterBot[]; diff --git a/apps/mobile/src/ui/chat/message-mentions.ts b/apps/mobile/src/ui/chat/message-mentions.ts index d09d1cc2dc..1deba9cb78 100644 --- a/apps/mobile/src/ui/chat/message-mentions.ts +++ b/apps/mobile/src/ui/chat/message-mentions.ts @@ -1,7 +1,7 @@ import { Lexer } from 'marked'; import remend from 'remend'; import { textMarkdownSupported } from '../markdown-blocks'; -import type { WireMention } from '../../host/wire'; +import type { WireMention } from '@botharness/host-protocol/wire'; export function mentionMarkdownBody(body: string, streaming: boolean) { const normalized = body.replace(/\r\n?/g, '\n'); diff --git a/apps/mobile/src/ui/chat/message-popover.tsx b/apps/mobile/src/ui/chat/message-popover.tsx index c9e0e52c49..83d2a4b989 100644 --- a/apps/mobile/src/ui/chat/message-popover.tsx +++ b/apps/mobile/src/ui/chat/message-popover.tsx @@ -9,7 +9,7 @@ import { reactedByMe, type ConversationMessage, type MessageAttachment, -} from '../../host/conversation'; +} from '@botharness/host-client/conversation'; import { spring } from '../design/motion'; import { edge, radius, space } from '../design/tokens'; import { islandStyle } from '../design/island'; diff --git a/apps/mobile/src/ui/chat/message-reactions.tsx b/apps/mobile/src/ui/chat/message-reactions.tsx index 09fe432b85..b4e6d67ad3 100644 --- a/apps/mobile/src/ui/chat/message-reactions.tsx +++ b/apps/mobile/src/ui/chat/message-reactions.tsx @@ -1,7 +1,7 @@ import { useState } from 'react'; import { Pressable, View } from 'react-native'; -import { reactedByMe, type ConversationReaction } from '../../host/conversation'; +import { reactedByMe, type ConversationReaction } from '@botharness/host-client/conversation'; import { edge, radius, space } from '../design/tokens'; import { useDesignTheme } from '../design/theme'; import { Text } from '../primitives/text'; diff --git a/apps/mobile/src/ui/chat/message-search-row.tsx b/apps/mobile/src/ui/chat/message-search-row.tsx index aba72f2a37..3cec08b09f 100644 --- a/apps/mobile/src/ui/chat/message-search-row.tsx +++ b/apps/mobile/src/ui/chat/message-search-row.tsx @@ -1,7 +1,7 @@ import { View } from 'react-native'; import type { MessageSearchHit } from '../../host/message-search'; -import type { HostLook } from '../design/host-look'; +import type { HostLook } from '@botharness/host-client/ui/design/host-look'; import { chatList, space } from '../design/tokens'; import { LoadingIndicator } from '../primitives/loading-indicator'; import { Text } from '../primitives/text'; diff --git a/apps/mobile/src/ui/chat/message-selection-ui.tsx b/apps/mobile/src/ui/chat/message-selection-ui.tsx index bf1c4cd884..bf64bf0613 100644 --- a/apps/mobile/src/ui/chat/message-selection-ui.tsx +++ b/apps/mobile/src/ui/chat/message-selection-ui.tsx @@ -6,7 +6,7 @@ import { Modal, ScrollView, Pressable, View, type ViewInstance } from 'react-nat import { useSafeAreaInsets } from 'react-native-safe-area-context'; import { captureRef, releaseCapture } from 'react-native-view-shot'; import * as Sharing from 'expo-sharing'; -import type { ConversationMessage } from '../../host/conversation'; +import type { ConversationMessage } from '@botharness/host-client/conversation'; import { islandStyle } from '../design/island'; import { useDesignTheme } from '../design/theme'; import { radius, space } from '../design/tokens'; diff --git a/apps/mobile/src/ui/chat/message-selection.ts b/apps/mobile/src/ui/chat/message-selection.ts index 32c0b87d31..6234f7031d 100644 --- a/apps/mobile/src/ui/chat/message-selection.ts +++ b/apps/mobile/src/ui/chat/message-selection.ts @@ -1,4 +1,4 @@ -import type { ConversationMessage } from '../../host/conversation'; +import type { ConversationMessage } from '@botharness/host-client/conversation'; export const SELECTION_LIMIT = 50; export function toggleMessageSelection( ids: readonly string[], diff --git a/apps/mobile/src/ui/chat/message-sheet.ts b/apps/mobile/src/ui/chat/message-sheet.ts index 682e6e56af..8600e8803c 100644 --- a/apps/mobile/src/ui/chat/message-sheet.ts +++ b/apps/mobile/src/ui/chat/message-sheet.ts @@ -2,7 +2,7 @@ import { reactable, type ConversationMessage, type MessageAttachment, -} from '../../host/conversation'; +} from '@botharness/host-client/conversation'; import { t } from '../strings'; import type { BubbleGroup } from './bubble-shape'; import type { Rect } from './menu-placement'; diff --git a/apps/mobile/src/ui/chat/message-source-page.tsx b/apps/mobile/src/ui/chat/message-source-page.tsx index 10cadb890a..81bfc92ac0 100644 --- a/apps/mobile/src/ui/chat/message-source-page.tsx +++ b/apps/mobile/src/ui/chat/message-source-page.tsx @@ -1,7 +1,7 @@ import { useState } from 'react'; import { Modal, Platform, View } from 'react-native'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; -import type { ConversationMessage } from '../../host/conversation'; +import type { ConversationMessage } from '@botharness/host-client/conversation'; import { useDesignTheme } from '../design/theme'; import { NativePageNavigation } from '../primitives/native-page-navigation'; import { LoadingIndicator } from '../primitives/loading-indicator'; diff --git a/apps/mobile/src/ui/chat/message-source-state.ts b/apps/mobile/src/ui/chat/message-source-state.ts index 9cc220dfee..1078b55b3e 100644 --- a/apps/mobile/src/ui/chat/message-source-state.ts +++ b/apps/mobile/src/ui/chat/message-source-state.ts @@ -1,5 +1,5 @@ import { useCallback, useLayoutEffect, useRef, useState } from 'react'; -import type { ConversationMessage } from '../../host/conversation'; +import type { ConversationMessage } from '@botharness/host-client/conversation'; function retainedSource(messages: readonly ConversationMessage[], id: string) { return messages.find( diff --git a/apps/mobile/src/ui/chat/message-source.ts b/apps/mobile/src/ui/chat/message-source.ts index 95933f66c6..db95cff028 100644 --- a/apps/mobile/src/ui/chat/message-source.ts +++ b/apps/mobile/src/ui/chat/message-source.ts @@ -1,4 +1,4 @@ -import type { ConversationMessage } from '../../host/conversation'; +import type { ConversationMessage } from '@botharness/host-client/conversation'; export function messageSource(message: ConversationMessage): string { const html = message.genuiDocument?.html; diff --git a/apps/mobile/src/ui/chat/model-settings-screen.tsx b/apps/mobile/src/ui/chat/model-settings-screen.tsx index 8202161092..dca336a0d5 100644 --- a/apps/mobile/src/ui/chat/model-settings-screen.tsx +++ b/apps/mobile/src/ui/chat/model-settings-screen.tsx @@ -3,8 +3,13 @@ import { useCallback, useMemo, useRef, useState, type ReactNode } from 'react'; import { FlatList, Keyboard, View } from 'react-native'; import { KeyboardAvoidingView } from 'react-native-keyboard-controller'; -import { applyModelPreset, errorText, sameModel, type ModelRoute } from '../../host/bot-settings'; -import type { HostClient } from '../../host/client'; +import { + applyModelPreset, + errorText, + sameModel, + type ModelRoute, +} from '@botharness/host-client/bot-settings'; +import type { HostClient } from '@botharness/host-client/client'; import { useHostSession } from '../../host/host-session'; import { inheritModel, @@ -18,7 +23,7 @@ import { type ModelField, type ModelScope, type ModelSettingsState, -} from '../../host/model-settings'; +} from '@botharness/host-client/model-settings'; import { space } from '../design/tokens'; import { Button } from '../primitives/button'; import { renderKeyboardFormScroll } from '../primitives/keyboard-form'; diff --git a/apps/mobile/src/ui/chat/model-sheet.tsx b/apps/mobile/src/ui/chat/model-sheet.tsx index 3de1b3a035..ab58c66450 100644 --- a/apps/mobile/src/ui/chat/model-sheet.tsx +++ b/apps/mobile/src/ui/chat/model-sheet.tsx @@ -9,7 +9,7 @@ import { type Loadable, type ModelCatalogEntry, type ModelPreset, -} from '../../host/bot-settings'; +} from '@botharness/host-client/bot-settings'; import { SettingsGroupItem, SettingsRow, diff --git a/apps/mobile/src/ui/chat/private-input-card.tsx b/apps/mobile/src/ui/chat/private-input-card.tsx index 99da7e88e4..01df4a2b4c 100644 --- a/apps/mobile/src/ui/chat/private-input-card.tsx +++ b/apps/mobile/src/ui/chat/private-input-card.tsx @@ -1,7 +1,7 @@ import { useHostSession } from '../../host/host-session'; import { useRouter } from 'expo-router'; import { Button } from '../primitives/button'; -import type { RequestRef } from '../../host/requests'; +import type { RequestRef } from '@botharness/host-client/requests'; import { CardNote, CardPreview, ActionCard } from './action-card'; import { CardLine } from './card-line'; import type { BubbleGroup } from './bubble-shape'; diff --git a/apps/mobile/src/ui/chat/profile-page-target.ts b/apps/mobile/src/ui/chat/profile-page-target.ts index c37ccefdea..bd44ea195c 100644 --- a/apps/mobile/src/ui/chat/profile-page-target.ts +++ b/apps/mobile/src/ui/chat/profile-page-target.ts @@ -1,4 +1,4 @@ -import type { RosterView } from '../../host/client'; +import type { RosterView } from '@botharness/host-client/client'; import type { ChatPlace } from './chat-place'; export type ProfilePageTarget = diff --git a/apps/mobile/src/ui/chat/profile-routines.tsx b/apps/mobile/src/ui/chat/profile-routines.tsx index 5080d19de6..511ceaef95 100644 --- a/apps/mobile/src/ui/chat/profile-routines.tsx +++ b/apps/mobile/src/ui/chat/profile-routines.tsx @@ -1,8 +1,8 @@ import { Pressable, View } from 'react-native'; -import { errorText } from '../../host/bot-settings'; +import { errorText } from '@botharness/host-client/bot-settings'; import type { Routines } from '../../host/routines'; -import type { BotScheduleSummary, ScheduleTrigger } from '../../host/wire'; +import type { BotScheduleSummary, ScheduleTrigger } from '@botharness/host-protocol/wire'; import { useDesignTheme } from '../design/theme'; import { edge, radius, space } from '../design/tokens'; import { haptic } from '../haptics'; diff --git a/apps/mobile/src/ui/chat/profile-swipe-preview.tsx b/apps/mobile/src/ui/chat/profile-swipe-preview.tsx index 99856e7930..24f57767a6 100644 --- a/apps/mobile/src/ui/chat/profile-swipe-preview.tsx +++ b/apps/mobile/src/ui/chat/profile-swipe-preview.tsx @@ -1,7 +1,7 @@ import { Platform, View } from 'react-native'; import type { SharedValue } from 'react-native-reanimated'; import { useDesignTheme } from '../design/theme'; -import type { RosterBot } from '../../host/client'; +import type { RosterBot } from '@botharness/host-client/client'; import { BotAvatar } from '../bot-avatar'; import { profileShell, radius, space } from '../design/tokens'; import { ListSkeleton } from '../primitives/list-skeleton'; diff --git a/apps/mobile/src/ui/chat/question-card.tsx b/apps/mobile/src/ui/chat/question-card.tsx index 06244f3391..75a9af6f87 100644 --- a/apps/mobile/src/ui/chat/question-card.tsx +++ b/apps/mobile/src/ui/chat/question-card.tsx @@ -1,7 +1,7 @@ import { useCallback, useRef, useState } from 'react'; import { View, type ViewInstance } from 'react-native'; -import type { CardResolution } from '../../host/conversation'; +import type { CardResolution } from '@botharness/host-client/conversation'; import { buildAnswer, emptyDraft, @@ -9,8 +9,8 @@ import { type DecisionResult, type QuestionDraft, type QuestionRequest, -} from '../../host/requests'; -import type { QuestionAnswer } from '../../host/wire'; +} from '@botharness/host-client/requests'; +import type { QuestionAnswer } from '@botharness/host-protocol/wire'; import { useMounted } from '../mounted'; import { Button } from '../primitives/button'; import { errorText } from '../request-parts'; diff --git a/apps/mobile/src/ui/chat/question-fields.android.tsx b/apps/mobile/src/ui/chat/question-fields.android.tsx index 3e5fc298c5..f1267dff1a 100644 --- a/apps/mobile/src/ui/chat/question-fields.android.tsx +++ b/apps/mobile/src/ui/chat/question-fields.android.tsx @@ -14,7 +14,7 @@ import { } from '@expo/ui/jetpack-compose/modifiers'; import type { ComponentProps } from 'react'; -import { toggleOption, typeCustom } from '../../host/requests'; +import { toggleOption, typeCustom } from '@botharness/host-client/requests'; import { materialType, useMaterialRoles } from '../design/material-tokens'; import { useDesignTheme } from '../design/theme'; import { edge, radius, space } from '../design/tokens'; diff --git a/apps/mobile/src/ui/chat/question-fields.tsx b/apps/mobile/src/ui/chat/question-fields.tsx index b130049c50..ac905e8262 100644 --- a/apps/mobile/src/ui/chat/question-fields.tsx +++ b/apps/mobile/src/ui/chat/question-fields.tsx @@ -1,7 +1,7 @@ import { Pressable, View } from 'react-native'; -import { toggleOption, typeCustom, type QuestionDraft } from '../../host/requests'; -import type { QuestionItem } from '../../host/wire'; +import { toggleOption, typeCustom, type QuestionDraft } from '@botharness/host-client/requests'; +import type { QuestionItem } from '@botharness/host-protocol/wire'; import { useDesignTheme } from '../design/theme'; import { edge, radius, space } from '../design/tokens'; import { Text } from '../primitives/text'; diff --git a/apps/mobile/src/ui/chat/reaction-presence.ts b/apps/mobile/src/ui/chat/reaction-presence.ts index c0229ca5bc..1f4b9a1ac5 100644 --- a/apps/mobile/src/ui/chat/reaction-presence.ts +++ b/apps/mobile/src/ui/chat/reaction-presence.ts @@ -1,4 +1,4 @@ -import type { ConversationReaction } from '../../host/conversation'; +import type { ConversationReaction } from '@botharness/host-client/conversation'; export function shownReactions( shown: readonly ConversationReaction[], diff --git a/apps/mobile/src/ui/chat/reply-bar.tsx b/apps/mobile/src/ui/chat/reply-bar.tsx index 9125f779e5..a7cfce4fb8 100644 --- a/apps/mobile/src/ui/chat/reply-bar.tsx +++ b/apps/mobile/src/ui/chat/reply-bar.tsx @@ -1,5 +1,5 @@ import { Pressable, View } from 'react-native'; -import type { ConversationMessage } from '../../host/conversation'; +import type { ConversationMessage } from '@botharness/host-client/conversation'; import { useDesignTheme } from '../design/theme'; import { radius, space, swipeReply } from '../design/tokens'; import { CloseIcon, ReplyIcon } from '../shell/icons'; diff --git a/apps/mobile/src/ui/chat/reply-quote.tsx b/apps/mobile/src/ui/chat/reply-quote.tsx index 53108cba55..ad5160a16e 100644 --- a/apps/mobile/src/ui/chat/reply-quote.tsx +++ b/apps/mobile/src/ui/chat/reply-quote.tsx @@ -1,9 +1,9 @@ import { useContext, type ReactNode } from 'react'; import { Pressable, View } from 'react-native'; -import { botNameColor } from '../../../../../packages/client/src/client/bot-name-color'; -import type { RosterBot } from '../../host/client'; -import type { WireReplyPreview } from '../../host/wire'; +import { botNameColor } from '@botharness/host-client/shared/bot-name-color'; +import type { RosterBot } from '@botharness/host-client/client'; +import type { WireReplyPreview } from '@botharness/host-protocol/wire'; import { botColor } from '../bot-color'; import { pressTint, quoteFill, useDesignTheme, type DesignTheme } from '../design/theme'; import { radius, space, swipeReply } from '../design/tokens'; diff --git a/apps/mobile/src/ui/chat/request-activity-action.ts b/apps/mobile/src/ui/chat/request-activity-action.ts index ce21ce5f8d..4a3c9b74ee 100644 --- a/apps/mobile/src/ui/chat/request-activity-action.ts +++ b/apps/mobile/src/ui/chat/request-activity-action.ts @@ -1,6 +1,6 @@ import { showAppDialog } from '../primitives/app-dialog'; import { useRef, useState } from 'react'; -import { ActivityRequestFailed } from '../../host/live-activity'; +import { ActivityRequestFailed } from '@botharness/host-client/live-activity'; import type { ActivityTarget } from '../../host/live-activity-session'; import { requestActivitySession, useRequestActivity } from '../../host/native-live-activity'; import { useStrings } from '../strings'; diff --git a/apps/mobile/src/ui/chat/request-activity-control.tsx b/apps/mobile/src/ui/chat/request-activity-control.tsx index 0b0ef55436..3e528c8f26 100644 --- a/apps/mobile/src/ui/chat/request-activity-control.tsx +++ b/apps/mobile/src/ui/chat/request-activity-control.tsx @@ -1,6 +1,6 @@ import { Platform } from 'react-native'; import { useCallback, useSyncExternalStore } from 'react'; -import type { HostClient, RosterBot } from '../../host/client'; +import type { HostClient, RosterBot } from '@botharness/host-client/client'; import { useConversation } from '../../host/host-session'; import { activityStartTarget } from '../../host/live-activity-routing'; import { Button } from '../primitives/creation-button'; diff --git a/apps/mobile/src/ui/chat/routine-screen.tsx b/apps/mobile/src/ui/chat/routine-screen.tsx index 65ea49f5ba..8be7d3d654 100644 --- a/apps/mobile/src/ui/chat/routine-screen.tsx +++ b/apps/mobile/src/ui/chat/routine-screen.tsx @@ -3,9 +3,9 @@ import { useCallback, useMemo, useState } from 'react'; import { View } from 'react-native'; import { botRoutines } from '../../host/routines'; -import { errorText } from '../../host/bot-settings'; +import { errorText } from '@botharness/host-client/bot-settings'; import { useHostSession, useHostSnapshot } from '../../host/host-session'; -import type { BotScheduleSummary } from '../../host/wire'; +import type { BotScheduleSummary } from '@botharness/host-protocol/wire'; import { SheetPage } from '../primitives/sheet-page'; import { useStrings } from '../strings'; import { RoutineSheet } from './routine-sheet'; diff --git a/apps/mobile/src/ui/chat/routine-sheet.tsx b/apps/mobile/src/ui/chat/routine-sheet.tsx index 30c1700817..5f8ac42304 100644 --- a/apps/mobile/src/ui/chat/routine-sheet.tsx +++ b/apps/mobile/src/ui/chat/routine-sheet.tsx @@ -4,7 +4,7 @@ import { View } from 'react-native'; import { KeyboardFormScroll } from '../primitives/keyboard-form'; import type { KeyboardAwareScrollViewRef } from 'react-native-keyboard-controller'; -import { errorText, type Loadable } from '../../host/bot-settings'; +import { errorText, type Loadable } from '@botharness/host-client/bot-settings'; import { newRoutineForm, routineFormOf, @@ -15,7 +15,7 @@ import { type RoutineForm, type Routines, } from '../../host/routines'; -import type { BotScheduleFiring, BotScheduleSummary } from '../../host/wire'; +import type { BotScheduleFiring, BotScheduleSummary } from '@botharness/host-protocol/wire'; import { space } from '../design/tokens'; import { useMounted } from '../mounted'; import { Button } from '../primitives/button'; diff --git a/apps/mobile/src/ui/chat/routine-text.ts b/apps/mobile/src/ui/chat/routine-text.ts index f2305cb9e6..f39210aa6a 100644 --- a/apps/mobile/src/ui/chat/routine-text.ts +++ b/apps/mobile/src/ui/chat/routine-text.ts @@ -1,4 +1,8 @@ -import type { BotScheduleFiring, BotScheduleSummary, ScheduleTrigger } from '../../host/wire'; +import type { + BotScheduleFiring, + BotScheduleSummary, + ScheduleTrigger, +} from '@botharness/host-protocol/wire'; import { t } from '../strings'; export function triggerText(trigger: ScheduleTrigger): string { diff --git a/apps/mobile/src/ui/chat/session-failure-card.tsx b/apps/mobile/src/ui/chat/session-failure-card.tsx index ddd486bcc3..11cb5390ec 100644 --- a/apps/mobile/src/ui/chat/session-failure-card.tsx +++ b/apps/mobile/src/ui/chat/session-failure-card.tsx @@ -1,16 +1,16 @@ import { useMemo, useSyncExternalStore } from 'react'; -import type { HostClient } from '../../host/client'; +import type { HostClient } from '@botharness/host-client/client'; import { createFailureContinuation, createFailureMaintenance, type SessionFailure, -} from '../../host/session-failure'; +} from '@botharness/host-client/session-failure'; import { autoContinueSeconds, readSeconds, subscribeNever, subscribeSeconds, -} from '../../../../../packages/client/src/shared/turn-continuation'; +} from '@botharness/host-client/shared/turn-continuation'; import { Button } from '../primitives/button'; import { t } from '../strings'; import { ActionCard, CardButtons, CardNote, CardPreview, DetailRow } from './action-card'; diff --git a/apps/mobile/src/ui/chat/session-stops.ts b/apps/mobile/src/ui/chat/session-stops.ts index 10ead3fb79..c00d2cdfcd 100644 --- a/apps/mobile/src/ui/chat/session-stops.ts +++ b/apps/mobile/src/ui/chat/session-stops.ts @@ -1,7 +1,7 @@ import { useState } from 'react'; -import { errorText } from '../../host/bot-settings'; -import type { RosterBot } from '../../host/client'; +import { errorText } from '@botharness/host-client/bot-settings'; +import type { RosterBot } from '@botharness/host-client/client'; import { liveStopping, runningSessions, diff --git a/apps/mobile/src/ui/chat/source-name.tsx b/apps/mobile/src/ui/chat/source-name.tsx index 01b72f852e..a187f5676f 100644 --- a/apps/mobile/src/ui/chat/source-name.tsx +++ b/apps/mobile/src/ui/chat/source-name.tsx @@ -2,7 +2,7 @@ import { View } from 'react-native'; import { useDesignTheme } from '../design/theme'; import { conversationType, space } from '../design/tokens'; import { Text } from '../primitives/text'; -import { hostColorInk, type HostLook } from '../design/host-look'; +import { hostColorInk, type HostLook } from '@botharness/host-client/ui/design/host-look'; import { HostGlyph } from '../shell/host-tile'; import { CloudIcon, ComputerIcon } from '../shell/icons'; import { useStrings } from '../strings'; diff --git a/apps/mobile/src/ui/chat/speaker-row.tsx b/apps/mobile/src/ui/chat/speaker-row.tsx index d1b90e782c..c8a6c7bf7f 100644 --- a/apps/mobile/src/ui/chat/speaker-row.tsx +++ b/apps/mobile/src/ui/chat/speaker-row.tsx @@ -12,7 +12,7 @@ import Animated, { type SharedValue, } from 'react-native-reanimated'; -import type { RosterBot } from '../../host/client'; +import type { RosterBot } from '@botharness/host-client/client'; import { BotAvatar } from '../bot-avatar'; import { useDesignTheme } from '../design/theme'; import { spring } from '../design/motion'; diff --git a/apps/mobile/src/ui/chat/takeover-card.tsx b/apps/mobile/src/ui/chat/takeover-card.tsx index c74b2ad63a..dc1e190975 100644 --- a/apps/mobile/src/ui/chat/takeover-card.tsx +++ b/apps/mobile/src/ui/chat/takeover-card.tsx @@ -2,9 +2,9 @@ import { useState } from 'react'; import { View } from 'react-native'; import { useRouter } from 'expo-router'; -import type { HostClient } from '../../host/client'; +import type { HostClient } from '@botharness/host-client/client'; import { useHostSession } from '../../host/host-session'; -import type { RequestRef } from '../../host/requests'; +import type { RequestRef } from '@botharness/host-client/requests'; import { space } from '../design/tokens'; import { Button } from '../primitives/button'; import { useStrings } from '../strings'; diff --git a/apps/mobile/src/ui/chat/use-header-status.ts b/apps/mobile/src/ui/chat/use-header-status.ts index c69ac44f82..036f4870b9 100644 --- a/apps/mobile/src/ui/chat/use-header-status.ts +++ b/apps/mobile/src/ui/chat/use-header-status.ts @@ -1,4 +1,4 @@ -import type { RosterBot, RosterChannel } from '../../host/client'; +import type { RosterBot, RosterChannel } from '@botharness/host-client/client'; import { useMinuteClock } from '../minute-clock'; import { useStrings } from '../strings'; import { headerStatus } from './header-status'; diff --git a/apps/mobile/src/ui/chat/voice-bar.tsx b/apps/mobile/src/ui/chat/voice-bar.tsx index 7cdce38b16..1c35b8cf5b 100644 --- a/apps/mobile/src/ui/chat/voice-bar.tsx +++ b/apps/mobile/src/ui/chat/voice-bar.tsx @@ -2,7 +2,7 @@ import { setAudioModeAsync, useAudioPlayer, useAudioPlayerStatus } from 'expo-au import { useRef, useState } from 'react'; import { Pressable, View } from 'react-native'; -import type { MessageVoice } from '../../host/conversation'; +import type { MessageVoice } from '@botharness/host-client/conversation'; import { tint } from '../design/layers'; import { radius, space, voiceRow } from '../design/tokens'; import { useDesignTheme } from '../design/theme'; diff --git a/apps/mobile/src/ui/chat/working-status.tsx b/apps/mobile/src/ui/chat/working-status.tsx index a760eea7d1..52e8624126 100644 --- a/apps/mobile/src/ui/chat/working-status.tsx +++ b/apps/mobile/src/ui/chat/working-status.tsx @@ -1,6 +1,6 @@ import { View } from 'react-native'; -import type { RosterBot } from '../../host/client'; +import type { RosterBot } from '@botharness/host-client/client'; import { BotAvatar } from '../bot-avatar'; import { useDesignTheme } from '../design/theme'; import { edge, radius, space } from '../design/tokens'; diff --git a/apps/mobile/src/ui/chat/workspace-sheet.tsx b/apps/mobile/src/ui/chat/workspace-sheet.tsx index 741004f707..ebed90482b 100644 --- a/apps/mobile/src/ui/chat/workspace-sheet.tsx +++ b/apps/mobile/src/ui/chat/workspace-sheet.tsx @@ -14,7 +14,7 @@ import { type Loadable, type WorkspaceGrant, type WorkspaceOption, -} from '../../host/bot-settings'; +} from '@botharness/host-client/bot-settings'; import { useDesignTheme } from '../design/theme'; import { radius, space } from '../design/tokens'; import { Button } from '../primitives/button'; diff --git a/apps/mobile/src/ui/connection-presence.ts b/apps/mobile/src/ui/connection-presence.ts index 2eb5e99851..be24c432ad 100644 --- a/apps/mobile/src/ui/connection-presence.ts +++ b/apps/mobile/src/ui/connection-presence.ts @@ -1,4 +1,4 @@ -import type { ConnectionState } from '../host/client'; +import type { ConnectionState } from '@botharness/host-client/client'; export const CONNECTION_QUIET_MS = 4_000; export const CONNECTION_OFFLINE_MS = 15_000; diff --git a/apps/mobile/src/ui/connection-recovery.ts b/apps/mobile/src/ui/connection-recovery.ts index 0571edb43b..d9d29aa288 100644 --- a/apps/mobile/src/ui/connection-recovery.ts +++ b/apps/mobile/src/ui/connection-recovery.ts @@ -1,4 +1,4 @@ -import { isConnectRoute, isLanRoute } from '../host/route'; +import { isConnectRoute, isLanRoute } from '@botharness/host-protocol/route'; import { t } from './strings'; export function connectionRecoveryText(route: string): string { diff --git a/apps/mobile/src/ui/design/controls.ts b/apps/mobile/src/ui/design/controls.ts index 1e6ed180b0..6b26f718b4 100644 --- a/apps/mobile/src/ui/design/controls.ts +++ b/apps/mobile/src/ui/design/controls.ts @@ -1,5 +1,5 @@ import type { DesignTheme } from './resolve-theme'; -import { readable as readableColor } from '../../../../../packages/client/src/client/bot-name-color'; +import { readable as readableColor } from '@botharness/host-client/shared/bot-name-color'; import { distance, over, SEPARATION, tint, type LayerName } from './layers'; export const BUTTON_TONES = ['primary', 'secondary', 'tonal', 'danger'] as const; diff --git a/apps/mobile/src/ui/design/resolve-theme.ts b/apps/mobile/src/ui/design/resolve-theme.ts index 6f25232ea0..e0447e1f44 100644 --- a/apps/mobile/src/ui/design/resolve-theme.ts +++ b/apps/mobile/src/ui/design/resolve-theme.ts @@ -1,13 +1,16 @@ -import { - humanBubbleColors, - readable, -} from '../../../../../packages/client/src/client/bot-name-color'; +import { humanBubbleColors, readable } from '@botharness/host-client/shared/bot-name-color'; import { layers, tint, type Layer, type LayerName } from './layers'; -import { palette } from './palette.generated'; +import { palette } from '@botharness/host-client/ui/design/palette.generated'; import { mono, touch, typeScale, weight, type PlatformOS } from './tokens'; -export type ColorRole = keyof typeof palette.light; -export type ColorScheme = 'light' | 'dark'; +import { + contrast, + mix, + type ColorRole, + type ColorScheme, +} from '@botharness/host-client/ui/design/color-math'; +export { contrast, mix } from '@botharness/host-client/ui/design/color-math'; +export type { ColorRole, ColorScheme } from '@botharness/host-client/ui/design/color-math'; export type Appearance = { scheme?: 'system' | ColorScheme; @@ -30,46 +33,10 @@ export type DesignTheme = { const HEX = /^#([0-9a-f]{6})$/i; -function rgb(hex: string): number { - const digits = hex.slice(1); - return Number.parseInt( - digits.length === 3 ? [...digits].map((digit) => digit + digit).join('') : digits, - 16, - ); -} - -function luminance(hex: string): number { - const value = rgb(hex); - const channel = (shift: number) => { - const c = ((value >> shift) & 0xff) / 255; - return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4; - }; - return 0.2126 * channel(16) + 0.7152 * channel(8) + 0.0722 * channel(0); -} - -export function contrast(a: string, b: string): number { - const [hi, lo] = [luminance(a), luminance(b)].sort((x, y) => y - x) as [number, number]; - return (hi + 0.05) / (lo + 0.05); -} - const INK_LIGHT = '#ffffff'; const SCRIM: Record = { light: '#0f111566', dark: '#00000099' }; const BODY_CONTRAST = 4.5; -export function mix(from: string, to: string, amount: number): string { - const a = rgb(from); - const b = rgb(to); - return `#${[16, 8, 0] - .map((shift) => { - const start = (a >> shift) & 0xff; - const end = (b >> shift) & 0xff; - return Math.round(start + (end - start) * amount) - .toString(16) - .padStart(2, '0'); - }) - .join('')}`; -} - export function withAccent( color: Record, source: string | undefined, diff --git a/apps/mobile/src/ui/design/theme.tsx b/apps/mobile/src/ui/design/theme.tsx index e2c0de0a9c..2eb94b436f 100644 --- a/apps/mobile/src/ui/design/theme.tsx +++ b/apps/mobile/src/ui/design/theme.tsx @@ -2,11 +2,7 @@ import { createContext, useContext, useMemo, useSyncExternalStore, type ReactNod import { Dimensions, Platform, useColorScheme } from 'react-native'; import { resolveTheme, type Appearance, type ColorScheme, type DesignTheme } from './resolve-theme'; -import { - parseColor, - toHex, - type Rgb, -} from '../../../../../packages/client/src/client/bot-name-color'; +import { parseColor, toHex, type Rgb } from '@botharness/host-client/shared/bot-name-color'; import { glass, PRESS_TINT, replyQuote, type PlatformOS } from './tokens'; import { interfacePreferences } from '../interface-preferences'; diff --git a/apps/mobile/src/ui/host-compatibility-chip.tsx b/apps/mobile/src/ui/host-compatibility-chip.tsx index cde549685c..cce39c9f42 100644 --- a/apps/mobile/src/ui/host-compatibility-chip.tsx +++ b/apps/mobile/src/ui/host-compatibility-chip.tsx @@ -1,6 +1,6 @@ import { useSyncExternalStore } from 'react'; -import type { HostCompatibility } from '../host/client'; +import type { HostCompatibility } from '@botharness/host-client/client'; import { StatusChip } from './primitives/status-chip'; import { useStrings } from './strings'; diff --git a/apps/mobile/src/ui/notification-settings.tsx b/apps/mobile/src/ui/notification-settings.tsx index dbc9fceb16..fe3ea30b08 100644 --- a/apps/mobile/src/ui/notification-settings.tsx +++ b/apps/mobile/src/ui/notification-settings.tsx @@ -8,9 +8,9 @@ import { type PushKind, type PushPreferences, type PushSettings, -} from '../host/push'; +} from '@botharness/host-client/push'; import type { PushStatus } from '../host/push-session'; -import type { DevicePreferenceSnapshot } from '../host/device-notification-preferences'; +import type { DevicePreferenceSnapshot } from '@botharness/host-client/device-notification-preferences'; import { useMounted } from './mounted'; import { SettingsForm } from './primitives/settings-form'; import { SettingsRow, SettingsSection } from './primitives/settings-row'; diff --git a/apps/mobile/src/ui/pairing-failure.ts b/apps/mobile/src/ui/pairing-failure.ts index 257eaa86b1..e87b7e1417 100644 --- a/apps/mobile/src/ui/pairing-failure.ts +++ b/apps/mobile/src/ui/pairing-failure.ts @@ -1,5 +1,5 @@ -import type { PairingFailure } from '../host/pairing'; -import type { PairingMethod } from '../telemetry/schema'; +import type { PairingFailure } from '@botharness/host-client/pairing'; +import type { PairingMethod } from '@botharness/host-client/telemetry/schema'; import { t } from './strings'; const LINK_FAULTS = new Set([ diff --git a/apps/mobile/src/ui/primitives/account-panel.tsx b/apps/mobile/src/ui/primitives/account-panel.tsx index e98393a543..b324694962 100644 --- a/apps/mobile/src/ui/primitives/account-panel.tsx +++ b/apps/mobile/src/ui/primitives/account-panel.tsx @@ -1,8 +1,8 @@ import { Fragment } from 'react'; -import type { ConnectionDiagnostic } from '../../host/connection-diagnostic'; +import type { ConnectionDiagnostic } from '@botharness/host-client/connection-diagnostic'; import { ConnectionFailureActions } from './connection-failure-actions'; import { ScrollView, View } from 'react-native'; -import type { PairingFailure } from '../../host/pairing'; +import type { PairingFailure } from '@botharness/host-client/pairing'; import { useDesignTheme } from '../design/theme'; import { space } from '../design/tokens'; import { useStrings } from '../strings'; diff --git a/apps/mobile/src/ui/primitives/connection-failure-state.ts b/apps/mobile/src/ui/primitives/connection-failure-state.ts index f52eb120b1..fcd73dd7a8 100644 --- a/apps/mobile/src/ui/primitives/connection-failure-state.ts +++ b/apps/mobile/src/ui/primitives/connection-failure-state.ts @@ -6,7 +6,7 @@ import { Platform } from 'react-native'; import { connectionDiagnosticReport, type ConnectionDiagnostic, -} from '../../host/connection-diagnostic'; +} from '@botharness/host-client/connection-diagnostic'; export interface ConnectionFailureActionsProps { failure: ConnectionDiagnostic; diff --git a/apps/mobile/src/ui/primitives/connection-progress.tsx b/apps/mobile/src/ui/primitives/connection-progress.tsx index 393c64d6eb..647b1ef7d3 100644 --- a/apps/mobile/src/ui/primitives/connection-progress.tsx +++ b/apps/mobile/src/ui/primitives/connection-progress.tsx @@ -3,7 +3,7 @@ import { StyleSheet, View } from 'react-native'; import { LoadingIndicator } from './loading-indicator'; import { Text } from './text'; import { space } from '../design/tokens'; -import type { ConnectionState } from '../../host/client'; +import type { ConnectionState } from '@botharness/host-client/client'; import { connectionPresence, connectionDisrupted, diff --git a/apps/mobile/src/ui/primitives/creation-tags-field.android.tsx b/apps/mobile/src/ui/primitives/creation-tags-field.android.tsx index 864d376a9c..8262de513c 100644 --- a/apps/mobile/src/ui/primitives/creation-tags-field.android.tsx +++ b/apps/mobile/src/ui/primitives/creation-tags-field.android.tsx @@ -6,7 +6,7 @@ import { testID, } from '@expo/ui/jetpack-compose/modifiers'; import { View } from 'react-native'; -import { creationTags } from '../../host/bot-creation-tags'; +import { creationTags } from '@botharness/host-client/bot-creation-tags'; import { useDesignTheme } from '../design/theme'; import { space } from '../design/tokens'; import { useStrings } from '../strings'; diff --git a/apps/mobile/src/ui/primitives/creation-tags-field.tsx b/apps/mobile/src/ui/primitives/creation-tags-field.tsx index 5bf0e43586..b4d287f375 100644 --- a/apps/mobile/src/ui/primitives/creation-tags-field.tsx +++ b/apps/mobile/src/ui/primitives/creation-tags-field.tsx @@ -3,7 +3,7 @@ import { creationTags, type CreationTagDraft, type CreationTagEdit, -} from '../../host/bot-creation-tags'; +} from '@botharness/host-client/bot-creation-tags'; import { useDesignTheme } from '../design/theme'; import { radius, space } from '../design/tokens'; import { CloseIcon } from '../shell/icons'; diff --git a/apps/mobile/src/ui/primitives/resource-image.tsx b/apps/mobile/src/ui/primitives/resource-image.tsx index 1ebb0e6973..229df3cd11 100644 --- a/apps/mobile/src/ui/primitives/resource-image.tsx +++ b/apps/mobile/src/ui/primitives/resource-image.tsx @@ -1,9 +1,13 @@ import { useState, type ComponentProps } from 'react'; import { Image } from 'expo-image'; import { useMounted } from '../mounted'; -import type { RemoteSource } from '../../host/client'; -import { encodeBase64 } from '../../host/encrypted-carrier'; -import { cachedMediaUri, cacheMedia, mediaCacheAvailable } from '../../host/media-cache'; +import type { RemoteSource } from '@botharness/host-client/client'; +import { encodeBase64 } from '@botharness/host-client/encrypted-carrier'; +import { + cachedMediaUri, + cacheMedia, + mediaCacheAvailable, +} from '@botharness/host-client/media-cache'; type Resolved = { uri: string; headers: Record }; diff --git a/apps/mobile/src/ui/private-input-form.tsx b/apps/mobile/src/ui/private-input-form.tsx index 325c4fe046..25a1531e0e 100644 --- a/apps/mobile/src/ui/private-input-form.tsx +++ b/apps/mobile/src/ui/private-input-form.tsx @@ -1,8 +1,8 @@ import { useRef, useState } from 'react'; import { View, type ViewInstance } from 'react-native'; -import type { HostClient } from '../host/client'; +import type { HostClient } from '@botharness/host-client/client'; import { loadPrivateInput } from '../host/private-input'; -import type { RequestRef } from '../host/requests'; +import type { RequestRef } from '@botharness/host-client/requests'; import { useMounted } from './mounted'; import { space } from './design/tokens'; import { Button } from './primitives/button'; diff --git a/apps/mobile/src/ui/question-view.tsx b/apps/mobile/src/ui/question-view.tsx index c089295341..21fdace3fa 100644 --- a/apps/mobile/src/ui/question-view.tsx +++ b/apps/mobile/src/ui/question-view.tsx @@ -11,8 +11,8 @@ import { type DecisionResult, type QuestionDraft, type QuestionRequest, -} from '../host/requests'; -import type { QuestionAnswer, QuestionItem } from '../host/wire'; +} from '@botharness/host-client/requests'; +import type { QuestionAnswer, QuestionItem } from '@botharness/host-protocol/wire'; import { ActionButton, errorText, diff --git a/apps/mobile/src/ui/settings-view.tsx b/apps/mobile/src/ui/settings-view.tsx index bac387e6de..c8a5ecaabc 100644 --- a/apps/mobile/src/ui/settings-view.tsx +++ b/apps/mobile/src/ui/settings-view.tsx @@ -1,6 +1,6 @@ import { useState, type ReactNode } from 'react'; -import type { OverviewUsage } from '../host/usage'; +import type { OverviewUsage } from '@botharness/host-client/usage'; import { SHEET_GROUP } from './chat/sheet'; import { SettingsForm, SettingsFormItem } from './primitives/settings-form'; import { SettingsRow, SettingsSection } from './primitives/settings-row'; diff --git a/apps/mobile/src/ui/share/share-screen.tsx b/apps/mobile/src/ui/share/share-screen.tsx index 683057f7dc..35f50c92f4 100644 --- a/apps/mobile/src/ui/share/share-screen.tsx +++ b/apps/mobile/src/ui/share/share-screen.tsx @@ -15,7 +15,7 @@ import { Button } from '../primitives/button'; import { SheetHeader } from '../primitives/sheet-header'; import { Text } from '../primitives/text'; import { useMounted } from '../mounted'; -import { recordFeature } from '../../telemetry/features'; +import { recordFeature } from '@botharness/host-client/telemetry/features'; import { FileIcon } from '../shell/icons'; import { conversationHref } from '../shell/open-conversation'; import { useStrings } from '../strings'; diff --git a/apps/mobile/src/ui/shell/activity-avatar.ts b/apps/mobile/src/ui/shell/activity-avatar.ts index f00a61093c..19229ea68e 100644 --- a/apps/mobile/src/ui/shell/activity-avatar.ts +++ b/apps/mobile/src/ui/shell/activity-avatar.ts @@ -1,5 +1,5 @@ import type { ActivityItem } from '../../host/activity-sources'; -import type { RosterBot } from '../../host/client'; +import type { RosterBot } from '@botharness/host-client/client'; export type ActivityAvatarKind = | { kind: 'group'; avatar: string | undefined } diff --git a/apps/mobile/src/ui/shell/activity-feed.tsx b/apps/mobile/src/ui/shell/activity-feed.tsx index bf43faf063..154249c55f 100644 --- a/apps/mobile/src/ui/shell/activity-feed.tsx +++ b/apps/mobile/src/ui/shell/activity-feed.tsx @@ -2,7 +2,7 @@ import { ActivityInspector } from './activity-inspector'; import { HostGlyph } from './host-tile'; import { useIsFocused } from 'expo-router'; import { ActivitySheetRegistration } from './activity-sheet-root'; -import { DEFAULT_HOST_LOOK, hostColorInk } from '../design/host-look'; +import { DEFAULT_HOST_LOOK, hostColorInk } from '@botharness/host-client/ui/design/host-look'; import { KeyboardAvoidingView } from 'react-native-keyboard-controller'; import { KeyboardFormScroll } from '../primitives/keyboard-form'; import { PullToRefresh } from '../primitives/pull-to-refresh'; @@ -20,14 +20,14 @@ import { import { AccessibilityInfo, Platform, Pressable, View } from 'react-native'; import Animated, { FadeOut, LinearTransition } from 'react-native-reanimated'; -import type { HostClient, RosterBot } from '../../host/client'; +import type { HostClient, RosterBot } from '@botharness/host-client/client'; import { INBOX_SECTIONS, observeInbox, type Inbox, type InboxSection, type InboxSnapshot, -} from '../../host/inbox'; +} from '@botharness/host-client/inbox'; import { answerQuestion, approvalSummaryTool, @@ -37,7 +37,7 @@ import { requestRef, type DecisionResult, type RequestRef, -} from '../../host/requests'; +} from '@botharness/host-client/requests'; import { activityKey, activityBotKey, @@ -57,7 +57,7 @@ import { snoozeAttentionItem, snoozeUntil, type SnoozeChoice, -} from '../../host/attention-actions'; +} from '@botharness/host-client/attention-actions'; import { useFocusedSnapshot } from '../../host/use-focused-snapshot'; import { BotAvatar } from '../bot-avatar'; import { GroupMark } from '../chat/group-mark'; diff --git a/apps/mobile/src/ui/shell/activity-filters.tsx b/apps/mobile/src/ui/shell/activity-filters.tsx index 7a0fd2d002..a708f3a229 100644 --- a/apps/mobile/src/ui/shell/activity-filters.tsx +++ b/apps/mobile/src/ui/shell/activity-filters.tsx @@ -2,7 +2,11 @@ import type { ReactNode } from 'react'; import { FlatList, Modal, Platform, Pressable, View } from 'react-native'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; -import { INBOX_SECTIONS, type InboxSection, type InboxSetAside } from '../../host/inbox'; +import { + INBOX_SECTIONS, + type InboxSection, + type InboxSetAside, +} from '@botharness/host-client/inbox'; import { Sheet } from '../chat/sheet'; import { useDesignTheme } from '../design/theme'; import { androidSettings, edge, radius, space } from '../design/tokens'; diff --git a/apps/mobile/src/ui/shell/avatar-customizer.tsx b/apps/mobile/src/ui/shell/avatar-customizer.tsx index c5f4810d96..a64e8d77d1 100644 --- a/apps/mobile/src/ui/shell/avatar-customizer.tsx +++ b/apps/mobile/src/ui/shell/avatar-customizer.tsx @@ -21,7 +21,7 @@ import { changeAvatarFeature, type AvatarOption, } from '../../host/avatar-customization'; -import { randomAvatarSeed } from '../../host/bot-avatar-choice'; +import { randomAvatarSeed } from '@botharness/host-client/bot-avatar-choice'; import { useDesignTheme } from '../design/theme'; import { avatarEditor, edge, radius, space } from '../design/tokens'; import { AvatarRange } from '../primitives/avatar-range'; diff --git a/apps/mobile/src/ui/shell/bottom-navigation.tsx b/apps/mobile/src/ui/shell/bottom-navigation.tsx index e284b8a95b..36d7718bcc 100644 --- a/apps/mobile/src/ui/shell/bottom-navigation.tsx +++ b/apps/mobile/src/ui/shell/bottom-navigation.tsx @@ -20,7 +20,7 @@ import { cloudClient } from '../../cloud/native'; import { useCloudConversations } from '../../cloud/native-conversations'; import { cloudError } from '../../cloud/client'; import { prepareCloudCreation } from '../../cloud/prepare-creation'; -import { shownHostName } from '../design/host-look'; +import { shownHostName } from '@botharness/host-client/ui/design/host-look'; import { useDesignTheme } from '../design/theme'; import { fab, materialNavigationBar, navigationBar, radius, space } from '../design/tokens'; import { useMounted } from '../mounted'; diff --git a/apps/mobile/src/ui/shell/channel-navigation.ts b/apps/mobile/src/ui/shell/channel-navigation.ts index 39cc6841eb..b3b42f709d 100644 --- a/apps/mobile/src/ui/shell/channel-navigation.ts +++ b/apps/mobile/src/ui/shell/channel-navigation.ts @@ -2,8 +2,8 @@ import type { NavigationAction, NavigationState, PartialState } from 'expo-route import type { Stack } from 'expo-router'; import type { ComponentProps } from 'react'; -import type { RosterView } from '../../host/client'; -import type { ChatHref } from '../../host/push'; +import type { RosterView } from '@botharness/host-client/client'; +import type { ChatHref } from '@botharness/host-client/push'; import { swipeEntryOptions } from './swipe-entry'; export type ChannelLink = { channelId?: string; botSlug: string; messageId?: string }; diff --git a/apps/mobile/src/ui/shell/computer-row.tsx b/apps/mobile/src/ui/shell/computer-row.tsx index 784d33a9a3..509ceff4a8 100644 --- a/apps/mobile/src/ui/shell/computer-row.tsx +++ b/apps/mobile/src/ui/shell/computer-row.tsx @@ -1,7 +1,12 @@ import { Platform, Pressable, View } from 'react-native'; -import type { ConnectHost } from '../../host/connect-account'; +import type { ConnectHost } from '@botharness/host-client/connect-account'; import type { HostStatus } from '../../host/host-glance'; -import { hostColorInk, hostTileFill, shownHostName, type HostLook } from '../design/host-look'; +import { + hostColorInk, + hostTileFill, + shownHostName, + type HostLook, +} from '@botharness/host-client/ui/design/host-look'; import { useDesignTheme, type DesignTheme } from '../design/theme'; import { edge, radius, space, workspaceStack } from '../design/tokens'; import { DrawerListItem } from '../primitives/drawer-list-item'; diff --git a/apps/mobile/src/ui/shell/create-bot-screen.tsx b/apps/mobile/src/ui/shell/create-bot-screen.tsx index 9aaef4391a..ff31b7a583 100644 --- a/apps/mobile/src/ui/shell/create-bot-screen.tsx +++ b/apps/mobile/src/ui/shell/create-bot-screen.tsx @@ -12,7 +12,7 @@ import { useHostSession, useHostAvailability } from '../../host/host-session'; import { botCreation, useBotCreation } from '../../host/native-bot-creation'; import { enterBotCreation, type CreationEntrySource } from '../../host/bot-creation-entry'; import { hostUnavailable } from '../../host/host-glance'; -import type { BotCreationDraft } from '../../host/bot-creation'; +import type { BotCreationDraft } from '@botharness/host-client/bot-creation'; import { creationStepReady, creationSteps, @@ -24,7 +24,7 @@ import { import { botCreationTargets } from '../../host/bot-creation-targets'; import { createCreationVisibility } from '../../host/bot-creation-visibility'; import { hostLooks } from '../../host/native-host-look'; -import { shownHostName } from '../design/host-look'; +import { shownHostName } from '@botharness/host-client/ui/design/host-look'; import { space } from '../design/tokens'; import { useSheetContent } from '../primitives/sheet-content'; import { KeyboardFormScroll } from '../primitives/keyboard-form'; @@ -33,7 +33,7 @@ import { Button } from '../primitives/creation-button'; import { Text } from '../primitives/text'; import { CreationField as TextField } from '../primitives/creation-field'; import { CreationTagsField } from '../primitives/creation-tags-field'; -import { editCreationTags } from '../../host/bot-creation-tags'; +import { editCreationTags } from '@botharness/host-client/bot-creation-tags'; import { EnvironmentList } from '../primitives/environment-list'; import { StepBar, type StepBarProps } from '../primitives/step-bar'; import { creationCopy as copy, creationError } from './bot-creation-copy'; diff --git a/apps/mobile/src/ui/shell/create-channel-screen.tsx b/apps/mobile/src/ui/shell/create-channel-screen.tsx index f313778cf0..666ee0bcd8 100644 --- a/apps/mobile/src/ui/shell/create-channel-screen.tsx +++ b/apps/mobile/src/ui/shell/create-channel-screen.tsx @@ -7,7 +7,7 @@ import { hostLooks } from '../../host/native-host-look'; import { conversationFilter } from '../../host/native-conversation-filter'; import { computerEnvironmentKey } from '../../host/conversation-environments'; import { botCreationTargets } from '../../host/bot-creation-targets'; -import { shownHostName } from '../design/host-look'; +import { shownHostName } from '@botharness/host-client/ui/design/host-look'; import { useMounted } from '../mounted'; import { KeyboardFormScroll } from '../primitives/keyboard-form'; import { EnvironmentPicker } from '../primitives/environment-picker'; diff --git a/apps/mobile/src/ui/shell/creation-avatar-editor-screen.tsx b/apps/mobile/src/ui/shell/creation-avatar-editor-screen.tsx index 3d5b7a6731..4ad83020a1 100644 --- a/apps/mobile/src/ui/shell/creation-avatar-editor-screen.tsx +++ b/apps/mobile/src/ui/shell/creation-avatar-editor-screen.tsx @@ -1,7 +1,10 @@ import { router, Stack } from 'expo-router'; import { View } from 'react-native'; import { botCreation, useBotCreation } from '../../host/native-bot-creation'; -import { creationAvatarRecipe, type BotAvatarChoice } from '../../host/bot-avatar-choice'; +import { + creationAvatarRecipe, + type BotAvatarChoice, +} from '@botharness/host-client/bot-avatar-choice'; import { type AvatarRecipe } from '../../../../../packages/core/src/bots/avatar-appearance'; import { useStrings } from '../strings'; import { useDesignTheme } from '../design/theme'; diff --git a/apps/mobile/src/ui/shell/creation-avatar.tsx b/apps/mobile/src/ui/shell/creation-avatar.tsx index 87b04a1cef..1ba19a5c54 100644 --- a/apps/mobile/src/ui/shell/creation-avatar.tsx +++ b/apps/mobile/src/ui/shell/creation-avatar.tsx @@ -4,8 +4,8 @@ import { useMemo } from 'react'; import { Image, View } from 'react-native'; import { avatarSvg } from '../../../../../packages/core/src/bots/avatar-appearance'; -import { creationAvatarRecipe, randomAvatarSeed } from '../../host/bot-avatar-choice'; -import type { BotAvatarChoice } from '../../host/bot-creation'; +import { creationAvatarRecipe, randomAvatarSeed } from '@botharness/host-client/bot-avatar-choice'; +import type { BotAvatarChoice } from '@botharness/host-client/bot-creation'; import { pickAvatarImage } from '../../host/pick-avatar-image'; import { useDesignTheme } from '../design/theme'; import { creationAvatar, space } from '../design/tokens'; diff --git a/apps/mobile/src/ui/shell/creation-header-contract.ts b/apps/mobile/src/ui/shell/creation-header-contract.ts index 430a983066..bacfe80f9f 100644 --- a/apps/mobile/src/ui/shell/creation-header-contract.ts +++ b/apps/mobile/src/ui/shell/creation-header-contract.ts @@ -1,4 +1,4 @@ -import type { BotAvatarChoice } from '../../host/bot-creation'; +import type { BotAvatarChoice } from '@botharness/host-client/bot-creation'; export interface CreationHeaderProps { title: string; diff --git a/apps/mobile/src/ui/shell/home-header.tsx b/apps/mobile/src/ui/shell/home-header.tsx index 8c89b778b0..f188a32843 100644 --- a/apps/mobile/src/ui/shell/home-header.tsx +++ b/apps/mobile/src/ui/shell/home-header.tsx @@ -1,4 +1,4 @@ -import type { ConnectionState } from '../../host/client'; +import type { ConnectionState } from '@botharness/host-client/client'; import { ConnectionProgress, useConnectionProgress } from '../primitives/connection-progress'; import { useIsFocused } from 'expo-router'; import { StatusBar } from 'expo-status-bar'; @@ -6,7 +6,7 @@ import { useState, type ReactNode } from 'react'; import { Platform, Pressable, View, type ViewInstance } from 'react-native'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; import type { ConversationEnvironment } from '../../host/conversation-environments'; -import { hostColorInk } from '../design/host-look'; +import { hostColorInk } from '@botharness/host-client/ui/design/host-look'; import { materialSearchHeight, searchAppBarHeight } from '../design/material-search'; import { useDesignTheme } from '../design/theme'; import { chatList, space } from '../design/tokens'; diff --git a/apps/mobile/src/ui/shell/host-accent-provider.tsx b/apps/mobile/src/ui/shell/host-accent-provider.tsx index 6abad6cec1..05a06a25f8 100644 --- a/apps/mobile/src/ui/shell/host-accent-provider.tsx +++ b/apps/mobile/src/ui/shell/host-accent-provider.tsx @@ -5,7 +5,7 @@ import { computerEnvironmentKey } from '../../host/conversation-environments'; import { useConversationFilter } from '../../host/native-conversation-filter'; import { useHostSession } from '../../host/host-session'; import { useHostLook } from '../../host/native-host-look'; -import { HOST_COLORS } from '../design/host-look'; +import { HOST_COLORS } from '@botharness/host-client/ui/design/host-look'; import { AccentProvider, useDesignTheme } from '../design/theme'; export function HostAccentProvider({ children }: { children: ReactNode }) { diff --git a/apps/mobile/src/ui/shell/host-drawer-model.ts b/apps/mobile/src/ui/shell/host-drawer-model.ts index dbbe0121b8..0689072c21 100644 --- a/apps/mobile/src/ui/shell/host-drawer-model.ts +++ b/apps/mobile/src/ui/shell/host-drawer-model.ts @@ -1,6 +1,6 @@ -import type { ConnectHost } from '../../host/connect-account'; +import type { ConnectHost } from '@botharness/host-client/connect-account'; import type { HostGlance } from '../../host/host-glance'; -import type { SavedHost } from '../../host/hosts'; +import type { SavedHost } from '@botharness/host-client/hosts'; import { materialDrawer, modalRail } from '../design/tokens'; export const DRAWER_SHARE = 0.85; diff --git a/apps/mobile/src/ui/shell/host-drawer.tsx b/apps/mobile/src/ui/shell/host-drawer.tsx index 1c4fd598a1..a953c59785 100644 --- a/apps/mobile/src/ui/shell/host-drawer.tsx +++ b/apps/mobile/src/ui/shell/host-drawer.tsx @@ -1,4 +1,4 @@ -import type { ConnectionDiagnostic } from '../../host/connection-diagnostic'; +import type { ConnectionDiagnostic } from '@botharness/host-client/connection-diagnostic'; import { ReadFailure } from '../primitives/read-failure'; import { watchAccountHosts } from '../../host/watch-account-hosts'; import { closeWorkspacePage } from './workspace-paging'; @@ -38,11 +38,11 @@ import { import { computerEnvironmentKey } from '../../host/conversation-environments'; import { conversationFilter, useConversationFilter } from '../../host/native-conversation-filter'; -import type { ConnectHost } from '../../host/connect-account'; +import type { ConnectHost } from '@botharness/host-client/connect-account'; import { accountHostLookId } from '../../host/account-host-look'; import { connectAccount } from '../../host/native-connect-account'; import { liveGlance, type HostGlance, type HostStatus } from '../../host/host-glance'; -import { SavedHostsWriteError } from '../../host/hosts'; +import { SavedHostsWriteError } from '@botharness/host-client/hosts'; import { hostSession, useHostSession, @@ -52,7 +52,11 @@ import { } from '../../host/host-session'; import { useHostLook } from '../../host/native-host-look'; -import { hostColorInk, hostTileFill, shownHostName } from '../design/host-look'; +import { + hostColorInk, + hostTileFill, + shownHostName, +} from '@botharness/host-client/ui/design/host-look'; import { glassShadow, pressTint, useDesignTheme, type DesignTheme } from '../design/theme'; import { useMounted } from '../mounted'; import { spring } from '../design/motion'; diff --git a/apps/mobile/src/ui/shell/host-look-editor.tsx b/apps/mobile/src/ui/shell/host-look-editor.tsx index 4548f5886f..e222db3108 100644 --- a/apps/mobile/src/ui/shell/host-look-editor.tsx +++ b/apps/mobile/src/ui/shell/host-look-editor.tsx @@ -17,7 +17,7 @@ import { type HostColorId, type HostIcon, type HostLook, -} from '../design/host-look'; +} from '@botharness/host-client/ui/design/host-look'; import { contrast } from '../design/resolve-theme'; import { useDesignTheme } from '../design/theme'; import { edge, radius, space } from '../design/tokens'; diff --git a/apps/mobile/src/ui/shell/host-tile.tsx b/apps/mobile/src/ui/shell/host-tile.tsx index ae28af3910..7fa26b780e 100644 --- a/apps/mobile/src/ui/shell/host-tile.tsx +++ b/apps/mobile/src/ui/shell/host-tile.tsx @@ -1,6 +1,6 @@ import { View } from 'react-native'; -import { HOST_SYMBOLS, type HostIcon } from '../design/host-look'; +import { HOST_SYMBOLS, type HostIcon } from '@botharness/host-client/ui/design/host-look'; import { radius } from '../design/tokens'; import { SystemSymbol } from '../primitives/system-symbol'; import { Text } from '../primitives/text'; diff --git a/apps/mobile/src/ui/shell/marketplace-daily-picks.tsx b/apps/mobile/src/ui/shell/marketplace-daily-picks.tsx index 1d7c674abd..fdb6a97164 100644 --- a/apps/mobile/src/ui/shell/marketplace-daily-picks.tsx +++ b/apps/mobile/src/ui/shell/marketplace-daily-picks.tsx @@ -1,7 +1,7 @@ import { Pressable, View, type ViewInstance } from 'react-native'; import type { MarketplaceDigestSummary } from '../../../../../packages/core/src/marketplace/client'; import { marketplace, useCatalogueResource } from '../../marketplace/native-catalogue'; -import { recordFeature } from '../../telemetry/features'; +import { recordFeature } from '@botharness/host-client/telemetry/features'; import { pressTint, useDesignTheme } from '../design/theme'; import { marketplaceHome, radius, space } from '../design/tokens'; import { useMounted } from '../mounted'; diff --git a/apps/mobile/src/ui/shell/marketplace-navigation.ts b/apps/mobile/src/ui/shell/marketplace-navigation.ts index 9b3aee946d..cfb2f184e7 100644 --- a/apps/mobile/src/ui/shell/marketplace-navigation.ts +++ b/apps/mobile/src/ui/shell/marketplace-navigation.ts @@ -7,7 +7,7 @@ import type { import { botCreation } from '../../host/native-bot-creation'; import { selectMarketplaceImport } from '../../marketplace/import-selection'; import { marketplace } from '../../marketplace/native-catalogue'; -import { recordFeature } from '../../telemetry/features'; +import { recordFeature } from '@botharness/host-client/telemetry/features'; import { locale } from '../strings'; export type MarketplaceTarget = { entry: 'host'; hostId: string } | { entry: 'all' }; diff --git a/apps/mobile/src/ui/shell/marketplace-sections.tsx b/apps/mobile/src/ui/shell/marketplace-sections.tsx index dc2afad5e2..1d36524788 100644 --- a/apps/mobile/src/ui/shell/marketplace-sections.tsx +++ b/apps/mobile/src/ui/shell/marketplace-sections.tsx @@ -6,7 +6,7 @@ import type { MarketplaceSectionName, } from '../../../../../packages/core/src/marketplace/client'; import { marketplace, useCatalogueResource } from '../../marketplace/native-catalogue'; -import { recordFeature } from '../../telemetry/features'; +import { recordFeature } from '@botharness/host-client/telemetry/features'; import { pressTint, useDesignTheme } from '../design/theme'; import { marketplaceHome, radius, space } from '../design/tokens'; import { useMounted } from '../mounted'; diff --git a/apps/mobile/src/ui/shell/pairing-failure-notice.tsx b/apps/mobile/src/ui/shell/pairing-failure-notice.tsx index ade3a77c66..1252a5d2a7 100644 --- a/apps/mobile/src/ui/shell/pairing-failure-notice.tsx +++ b/apps/mobile/src/ui/shell/pairing-failure-notice.tsx @@ -3,9 +3,9 @@ import * as Clipboard from 'expo-clipboard'; import * as Device from 'expo-device'; import { useState } from 'react'; import { Linking, Platform, View } from 'react-native'; -import { pairingDiagnostics } from '../../host/pairing-detail'; -import type { PairingFailure } from '../../host/pairing'; -import type { PairingMethod } from '../../telemetry/schema'; +import { pairingDiagnostics } from '@botharness/host-protocol/pairing-detail'; +import type { PairingFailure } from '@botharness/host-client/pairing'; +import type { PairingMethod } from '@botharness/host-client/telemetry/schema'; import { space } from '../design/tokens'; import { pairingFailureText } from '../pairing-failure'; import { Button } from '../primitives/button'; diff --git a/apps/mobile/src/ui/shell/usage-card.tsx b/apps/mobile/src/ui/shell/usage-card.tsx index 9982b153e1..f702b0d682 100644 --- a/apps/mobile/src/ui/shell/usage-card.tsx +++ b/apps/mobile/src/ui/shell/usage-card.tsx @@ -2,7 +2,7 @@ import { useCallback, useRef, useState } from 'react'; import { Platform, Pressable, View, type ViewInstance } from 'react-native'; import { compactTokenCount, weekdayLabel } from '../../host/usage-days'; -import { usageWeek, type OverviewUsage } from '../../host/usage'; +import { usageWeek, type OverviewUsage } from '@botharness/host-client/usage'; import { useDesignTheme } from '../design/theme'; import { chart } from '../design/chart'; import type { LayerName } from '../design/layers'; diff --git a/apps/mobile/src/ui/shell/use-pairing.ts b/apps/mobile/src/ui/shell/use-pairing.ts index 20b86eabd9..daa99b6069 100644 --- a/apps/mobile/src/ui/shell/use-pairing.ts +++ b/apps/mobile/src/ui/shell/use-pairing.ts @@ -1,10 +1,13 @@ -import { connectionDiagnostic, type ConnectionDiagnostic } from '../../host/connection-diagnostic'; +import { + connectionDiagnostic, + type ConnectionDiagnostic, +} from '@botharness/host-client/connection-diagnostic'; import Constants from 'expo-constants'; import { useNavigationContainerRef, useRouter } from 'expo-router'; import { useRef, useState } from 'react'; import { Keyboard, Platform } from 'react-native'; -import type { AccountOwner } from '../../host/account-owner'; +import type { AccountOwner } from '@botharness/host-client/account-owner'; import { accountHostLookId } from '../../host/account-host-look'; import { hostSession } from '../../host/host-session'; import { nativeCarrier } from '../../host/native-carrier'; @@ -12,10 +15,10 @@ import { connectAccount } from '../../host/native-connect-account'; import { hostLooks } from '../../host/native-host-look'; import { conversationFilter } from '../../host/native-conversation-filter'; import { computerEnvironmentKey } from '../../host/conversation-environments'; -import { pairHost, type PairingFailure } from '../../host/pairing'; +import { pairHost, type PairingFailure } from '@botharness/host-client/pairing'; import { mobileTelemetry } from '../../telemetry/native'; -import type { PairingMethod } from '../../telemetry/schema'; -import { hostLookName } from '../design/host-look'; +import type { PairingMethod } from '@botharness/host-client/telemetry/schema'; +import { hostLookName } from '@botharness/host-client/ui/design/host-look'; import { clearsPastedLink } from '../pairing-failure'; import { openPairedHostSetup } from './workspace-navigation'; diff --git a/apps/mobile/src/ui/storage-settings.tsx b/apps/mobile/src/ui/storage-settings.tsx index febbaaecb5..3d3704ea7b 100644 --- a/apps/mobile/src/ui/storage-settings.tsx +++ b/apps/mobile/src/ui/storage-settings.tsx @@ -1,7 +1,7 @@ import { useCallback, useState } from 'react'; import { View, type ViewInstance } from 'react-native'; -import { MethodRefused } from '../host/client'; +import { MethodRefused } from '@botharness/host-client/client'; import { STORAGE_AGES, STORAGE_MEDIA_KINDS, @@ -16,7 +16,7 @@ import { type StorageMessagesResult, type StoragePartKind, type StorageUsage, -} from '../host/storage'; +} from '@botharness/host-client/storage'; import { chart } from './design/chart'; import { radius, space } from './design/tokens'; import { useDesignTheme } from './design/theme'; diff --git a/apps/mobile/src/ui/strings.ts b/apps/mobile/src/ui/strings.ts index 02016e7748..f25f928e6c 100644 --- a/apps/mobile/src/ui/strings.ts +++ b/apps/mobile/src/ui/strings.ts @@ -1,13 +1,13 @@ import { badgeCount } from './primitives/badge-count'; import { productName } from './product-name'; import { tapVerb } from './platform-copy'; -import type { DeviceRefusal } from '../host/client'; +import type { DeviceRefusal } from '@botharness/host-client/client'; import { useSyncExternalStore } from 'react'; import { interfacePreferences } from './interface-preferences'; -import type { PairingFailure } from '../host/pairing'; -import type { PushKind, PushRefusal } from '../host/push'; -import type { AggregatedState } from '../host/wire'; -import type { EmailCodeRefusal } from '../host/connect-account'; +import type { PairingFailure } from '@botharness/host-client/pairing'; +import type { PushKind, PushRefusal } from '@botharness/host-client/push'; +import type { AggregatedState } from '@botharness/host-protocol/wire'; +import type { EmailCodeRefusal } from '@botharness/host-client/connect-account'; type ToolGroup = 'shell' | 'browser' | 'files' | 'other'; diff --git a/apps/mobile/src/ui/theme.ts b/apps/mobile/src/ui/theme.ts index e8ed5dd820..4026f7b468 100644 --- a/apps/mobile/src/ui/theme.ts +++ b/apps/mobile/src/ui/theme.ts @@ -1,4 +1,4 @@ -import type { AggregatedState } from '../host/wire'; +import type { AggregatedState } from '@botharness/host-protocol/wire'; import { useDesignTheme, type DesignTheme } from './design/theme'; function legacy(color: DesignTheme['color']) { diff --git a/apps/mobile/src/ui/usage-view.tsx b/apps/mobile/src/ui/usage-view.tsx index 78977950f2..4a5c1a812f 100644 --- a/apps/mobile/src/ui/usage-view.tsx +++ b/apps/mobile/src/ui/usage-view.tsx @@ -1,8 +1,8 @@ import { useMemo, useState } from 'react'; import { Pressable, SectionList, View, type ViewInstance } from 'react-native'; -import type { RosterBot } from '../host/client'; -import { MethodRefused } from '../host/client'; +import type { RosterBot } from '@botharness/host-client/client'; +import { MethodRefused } from '@botharness/host-client/client'; import { USAGE_SPLIT, usageIsPartial, @@ -12,8 +12,8 @@ import { type OverviewMemory, type OverviewUsage, type UsagePeriod, -} from '../host/usage'; -import type { MemoryActivityBot, UsageBot } from '../host/wire'; +} from '@botharness/host-client/usage'; +import type { MemoryActivityBot, UsageBot } from '@botharness/host-protocol/wire'; import { BotAvatar } from './bot-avatar'; import { useDesignTheme } from './design/theme'; import { chart } from './design/chart'; diff --git a/apps/mobile/test/account-actions.test.ts b/apps/mobile/test/account-actions.test.ts index 200bcbe6f4..ef9929fc1e 100644 --- a/apps/mobile/test/account-actions.test.ts +++ b/apps/mobile/test/account-actions.test.ts @@ -1,9 +1,9 @@ import { describe, expect, it, vi } from 'vitest'; import { createAccountActionFixture } from '../src/host/account-action-fixture'; -import { createConnectAccount, type ConnectRuntime } from '../src/host/connect-account'; +import { createConnectAccount, type ConnectRuntime } from '@botharness/host-client/connect-account'; import { removeAccountConnections } from '../src/host/account-connections'; -import { parseSavedHosts, withHost, type SavedHosts } from '../src/host/hosts'; -import type { AccountOwner } from '../src/host/account-owner'; +import { parseSavedHosts, withHost, type SavedHosts } from '@botharness/host-client/hosts'; +import type { AccountOwner } from '@botharness/host-client/account-owner'; const owner: AccountOwner = { issuer: 'https://api.workos.com', diff --git a/apps/mobile/test/account-hosts.test.tsx b/apps/mobile/test/account-hosts.test.tsx index 55b1989f42..fdf2acab33 100644 --- a/apps/mobile/test/account-hosts.test.tsx +++ b/apps/mobile/test/account-hosts.test.tsx @@ -95,7 +95,7 @@ vi.mock('expo-router', () => ({ }, })); -import type { ConnectHost } from '../src/host/connect-account'; +import type { ConnectHost } from '@botharness/host-client/connect-account'; import { AccountHosts } from '../src/ui/account-hosts'; import { t } from '../src/ui/strings'; import { appDialogs } from '../src/ui/primitives/dialog-state'; diff --git a/apps/mobile/test/account-pairing.test.ts b/apps/mobile/test/account-pairing.test.ts index ecd8af9e15..66d3ae206d 100644 --- a/apps/mobile/test/account-pairing.test.ts +++ b/apps/mobile/test/account-pairing.test.ts @@ -1,8 +1,8 @@ import { expect, it, vi } from 'vitest'; import { accountHostAdded, pairAccountSelection } from '../src/host/account-pairing'; -import type { ConnectHost } from '../src/host/connect-account'; -import type { SavedHost } from '../src/host/hosts'; -import type { PairingFailure } from '../src/host/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'; const a: ConnectHost = { id: 'ha', name: 'Same name', diff --git a/apps/mobile/test/action-card-android.test.tsx b/apps/mobile/test/action-card-android.test.tsx index 2ff0125d1c..f67b8df458 100644 --- a/apps/mobile/test/action-card-android.test.tsx +++ b/apps/mobile/test/action-card-android.test.tsx @@ -34,8 +34,8 @@ vi.mock('../src/ui/design/theme', async () => { return { useDesignTheme: () => theme }; }); -import type { QuestionItem } from '../src/host/wire'; -import { emptyDraft } from '../src/host/requests'; +import type { QuestionItem } from '@botharness/host-protocol/wire'; +import { emptyDraft } from '@botharness/host-client/requests'; import { ActionCard, CardButtons, diff --git a/apps/mobile/test/action-cards.test.ts b/apps/mobile/test/action-cards.test.ts index a8c958e8c6..545cccaf07 100644 --- a/apps/mobile/test/action-cards.test.ts +++ b/apps/mobile/test/action-cards.test.ts @@ -11,7 +11,7 @@ vi.mock('react-native-safe-area-context', () => ({ useSafeAreaInsets: () => ({ top: 0, bottom: 0, left: 0, right: 0 }), })); -import { createHostClient, type HostClient } from '../src/host/client'; +import { createHostClient, type HostClient } from '@botharness/host-client/client'; import { answerInChat, answerQuestion, @@ -20,13 +20,13 @@ import { loadApproval, loadQuestion, requestRef, -} from '../src/host/requests'; -import type { HumanAttentionItem } from '../src/host/wire'; +} from '@botharness/host-client/requests'; +import type { HumanAttentionItem } from '@botharness/host-protocol/wire'; import { ApprovalCard } from '../src/ui/chat/approval-card'; import { QuestionCard } from '../src/ui/chat/question-card'; import { t } from '../src/ui/strings'; import { played } from './expo-haptics-shim'; -import { FakeHost } from './fake-host'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; import inboxWire from './fixtures/inbox-wire.json'; Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true }); diff --git a/apps/mobile/test/activity-avatar.test.ts b/apps/mobile/test/activity-avatar.test.ts index f36bde143f..a8c7e95fc0 100644 --- a/apps/mobile/test/activity-avatar.test.ts +++ b/apps/mobile/test/activity-avatar.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from 'vitest'; import type { ActivityItem } from '../src/host/activity-sources'; -import type { RosterBot } from '../src/host/client'; +import type { RosterBot } from '@botharness/host-client/client'; import { activityAvatar } from '../src/ui/shell/activity-avatar'; const item = (fields: Partial) => diff --git a/apps/mobile/test/activity-clear-many.test.tsx b/apps/mobile/test/activity-clear-many.test.tsx index d99f7b0d33..c026853af9 100644 --- a/apps/mobile/test/activity-clear-many.test.tsx +++ b/apps/mobile/test/activity-clear-many.test.tsx @@ -51,8 +51,8 @@ vi.mock('../src/ui/primitives/app-dialog', async (importOriginal) => ({ })); import { secure, remotes } from './host-session-fixture'; -import { FakeHost } from './fake-host'; -import { createHostLooks } from '../src/host/host-look'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; +import { createHostLooks } from '@botharness/host-client/host-look'; const push = vi.fn(); const looks = createHostLooks({ read: async () => undefined, write() {} }); diff --git a/apps/mobile/test/activity-count.test.ts b/apps/mobile/test/activity-count.test.ts index 121428e46c..3bf2f3afd5 100644 --- a/apps/mobile/test/activity-count.test.ts +++ b/apps/mobile/test/activity-count.test.ts @@ -6,8 +6,8 @@ import { observeActivityCount, readActivityCount, } from '../src/host/activity-count'; -import type { HumanAttentionItem, HumanAttentionPage } from '../src/host/wire'; -import type { InboxSnapshot } from '../src/host/inbox'; +import type { HumanAttentionItem, HumanAttentionPage } from '@botharness/host-protocol/wire'; +import type { InboxSnapshot } from '@botharness/host-client/inbox'; const item = (id: string, kind = 'tool-approval'): HumanAttentionItem => ({ id, diff --git a/apps/mobile/test/activity-detail.test.tsx b/apps/mobile/test/activity-detail.test.tsx index 4d8269012d..f843656b5b 100644 --- a/apps/mobile/test/activity-detail.test.tsx +++ b/apps/mobile/test/activity-detail.test.tsx @@ -18,9 +18,9 @@ vi.mock('../src/ui/shell/icons', async () => ({ ChevronRightIcon: () => null, })); -import type { RosterBot } from '../src/host/client'; +import type { RosterBot } from '@botharness/host-client/client'; import { shiftDay } from '../src/host/usage-days'; -import type { ProfileActivity } from '../src/host/wire'; +import type { ProfileActivity } from '@botharness/host-protocol/wire'; import { ActivityDetailView, type ActivityQuery } from '../src/ui/chat/activity-detail'; import { heatLevel, heatWeeks } from '../src/ui/primitives/day-heat'; import { chartSummary, peakBar } from '../src/ui/primitives/day-bars'; diff --git a/apps/mobile/test/activity-feed.test.ts b/apps/mobile/test/activity-feed.test.ts index 6fe4361146..c37cbb8381 100644 --- a/apps/mobile/test/activity-feed.test.ts +++ b/apps/mobile/test/activity-feed.test.ts @@ -33,12 +33,12 @@ vi.mock('../src/ui/bot-avatar', () => ({ createElement('span', { 'data-testid': `avatar-${bot.slug}` }), })); -import { createHostClient, type HostClient } from '../src/host/client'; -import { observeInbox, type InboxSnapshot } from '../src/host/inbox'; -import type { HumanAttentionItem } from '../src/host/wire'; +import { createHostClient, type HostClient } from '@botharness/host-client/client'; +import { observeInbox, type InboxSnapshot } from '@botharness/host-client/inbox'; +import type { HumanAttentionItem } from '@botharness/host-protocol/wire'; import { ActivityFeed, feedRows } from '../src/ui/shell/activity-feed'; import { t } from '../src/ui/strings'; -import { FakeHost } from './fake-host'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; import inboxWire from './fixtures/inbox-wire.json'; Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true }); diff --git a/apps/mobile/test/activity-multiple-hosts.test.tsx b/apps/mobile/test/activity-multiple-hosts.test.tsx index ac0703e9d8..a8a0bf24bf 100644 --- a/apps/mobile/test/activity-multiple-hosts.test.tsx +++ b/apps/mobile/test/activity-multiple-hosts.test.tsx @@ -39,9 +39,9 @@ vi.mock('../src/ui/bot-avatar', () => ({ })); import { secure, remotes } from './host-session-fixture'; -import { FakeHost } from './fake-host'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; import { t } from '../src/ui/strings'; -import { createHostLooks } from '../src/host/host-look'; +import { createHostLooks } from '@botharness/host-client/host-look'; import wire from './fixtures/inbox-wire.json'; vi.mock('expo-symbols', () => ({ SymbolView: ({ name, tintColor }: { name: { android: string }; tintColor: string }) => diff --git a/apps/mobile/test/activity-open-read.test.tsx b/apps/mobile/test/activity-open-read.test.tsx index 0e5f311f23..e17c0c68c3 100644 --- a/apps/mobile/test/activity-open-read.test.tsx +++ b/apps/mobile/test/activity-open-read.test.tsx @@ -42,8 +42,8 @@ vi.mock('../src/ui/bot-avatar', () => ({ vi.mock('expo-symbols', () => ({ SymbolView: () => null })); import { secure, remotes } from './host-session-fixture'; -import { FakeHost } from './fake-host'; -import { createHostLooks } from '../src/host/host-look'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; +import { createHostLooks } from '@botharness/host-client/host-look'; const push = vi.fn(); const looks = createHostLooks({ read: async () => undefined, write() {} }); diff --git a/apps/mobile/test/activity-row.test.tsx b/apps/mobile/test/activity-row.test.tsx index 2a78c928bf..e3382297a0 100644 --- a/apps/mobile/test/activity-row.test.tsx +++ b/apps/mobile/test/activity-row.test.tsx @@ -3,9 +3,9 @@ import { act, useImperativeHandle, type ReactNode, type Ref } from 'react'; import { createRoot, type Root } from 'react-dom/client'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; -import type { ChannelActivity } from '../src/host/channel-activity'; -import type { RosterView } from '../src/host/client'; -import type { ConversationMessage } from '../src/host/conversation'; +import type { ChannelActivity } from '@botharness/host-client/channel-activity'; +import type { RosterView } from '@botharness/host-client/client'; +import type { ConversationMessage } from '@botharness/host-client/conversation'; import { bubbleRow } from '../src/ui/chat/bubble-shape'; import { space } from '../src/ui/design/tokens'; diff --git a/apps/mobile/test/activity-smoothing.test.ts b/apps/mobile/test/activity-smoothing.test.ts index 497b6394a7..1f4694115b 100644 --- a/apps/mobile/test/activity-smoothing.test.ts +++ b/apps/mobile/test/activity-smoothing.test.ts @@ -1,8 +1,12 @@ import { afterEach, describe, expect, it } from 'vitest'; -import { createHostClient, type HostClient, type HostSnapshot } from '../src/host/client'; -import { FakeHost } from './fake-host'; -import wire from './fixtures/host-wire.json'; +import { + createHostClient, + type HostClient, + type HostSnapshot, +} from '@botharness/host-client/client'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; +import wire from '../../../packages/host-client/test/fixtures/host-wire.json'; const [baseline] = wire.mux.activity; const slug = baseline!.snapshot.bots[0]!.slug; diff --git a/apps/mobile/test/activity-sources.test.ts b/apps/mobile/test/activity-sources.test.ts index 431b08c3f2..b23a4697df 100644 --- a/apps/mobile/test/activity-sources.test.ts +++ b/apps/mobile/test/activity-sources.test.ts @@ -1,7 +1,7 @@ import { createActivityCountPreferences } from '../src/host/activity-count'; import { afterEach, expect, it } from 'vitest'; -import { createHostClient, type HostClient } from '../src/host/client'; -import { createInbox, type Inbox } from '../src/host/inbox'; +import { createHostClient, type HostClient } from '@botharness/host-client/client'; +import { createInbox, type Inbox } from '@botharness/host-client/inbox'; import { observeActivitySources, observeActivitySourceCount, @@ -9,7 +9,7 @@ import { activitySelection, type ActivitySource, } from '../src/host/activity-sources'; -import { FakeHost } from './fake-host'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; const clients: HostClient[] = []; const inboxes: Inbox[] = []; diff --git a/apps/mobile/test/approval-records.test.ts b/apps/mobile/test/approval-records.test.ts index 05a042d7fd..393b803395 100644 --- a/apps/mobile/test/approval-records.test.ts +++ b/apps/mobile/test/approval-records.test.ts @@ -6,7 +6,7 @@ import { revokeApprovalRule, type ApprovalRule, } from '../src/host/approval-records'; -import { createHostClient } from '../src/host/client'; +import { createHostClient } from '@botharness/host-client/client'; import { historyDetail, inputSummary, @@ -16,7 +16,7 @@ import { toolGlyph, } from '../src/ui/chat/approval-records-text'; import { t } from '../src/ui/strings'; -import { FakeHost } from './fake-host'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; const ROUTE = 'https://studio.tailnet-example.ts.net'; const slug = 'ada'; diff --git a/apps/mobile/test/assignment-detail.test.tsx b/apps/mobile/test/assignment-detail.test.tsx index 23407eff9f..da4181190c 100644 --- a/apps/mobile/test/assignment-detail.test.tsx +++ b/apps/mobile/test/assignment-detail.test.tsx @@ -23,7 +23,7 @@ import { loadAssignmentTimeline, parseAssignmentTimeline, } from '../src/host/assignment-timeline'; -import { MethodRefused, type HostClient } from '../src/host/client'; +import { MethodRefused, type HostClient } from '@botharness/host-client/client'; import { AssignmentDetail, AssignmentScreenBody } from '../src/ui/chat/assignment-screen'; import { t } from '../src/ui/strings'; diff --git a/apps/mobile/test/attachments.live.test.ts b/apps/mobile/test/attachments.live.test.ts index b899987033..b3a088da85 100644 --- a/apps/mobile/test/attachments.live.test.ts +++ b/apps/mobile/test/attachments.live.test.ts @@ -1,7 +1,10 @@ import { describe, expect, it } from 'vitest'; -import { createHostClient } from '../src/host/client'; -import { createConversation, type ConversationSnapshot } from '../src/host/conversation'; +import { createHostClient } from '@botharness/host-client/client'; +import { + createConversation, + type ConversationSnapshot, +} from '@botharness/host-client/conversation'; import { pairWithLiveHost } from './live-pairing'; import { nodeCarrier } from './node-carrier'; diff --git a/apps/mobile/test/attention-actions.test.ts b/apps/mobile/test/attention-actions.test.ts index 99170012d0..a42f5b6ac2 100644 --- a/apps/mobile/test/attention-actions.test.ts +++ b/apps/mobile/test/attention-actions.test.ts @@ -40,14 +40,14 @@ import { decideJoinRequest, findAttentionItem, replyToAssignment, -} from '../src/host/attention-actions'; -import { createHostClient, type HostClient } from '../src/host/client'; -import type { HumanAttentionItem } from '../src/host/wire'; +} from '@botharness/host-client/attention-actions'; +import { createHostClient, type HostClient } from '@botharness/host-client/client'; +import type { HumanAttentionItem } from '@botharness/host-protocol/wire'; import { AttentionItemView } from '../src/ui/attention-item'; import { PrivateInputCard } from '../src/ui/chat/private-input-card'; import { t } from '../src/ui/strings'; import { played } from './expo-haptics-shim'; -import { FakeHost } from './fake-host'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true }); diff --git a/apps/mobile/test/attention-navigation.test.tsx b/apps/mobile/test/attention-navigation.test.tsx index 7ac361a38b..ad76a0b56c 100644 --- a/apps/mobile/test/attention-navigation.test.tsx +++ b/apps/mobile/test/attention-navigation.test.tsx @@ -4,7 +4,7 @@ import { createRoot, type Root } from 'react-dom/client'; import { afterEach, expect, it, vi } from 'vitest'; vi.mock('expo-symbols', () => ({ SymbolView: () => null })); import { StackRouter } from '../node_modules/expo-router/build/react-navigation/routers/StackRouter.js'; -import type { HostSnapshot } from '../src/host/client'; +import type { HostSnapshot } from '@botharness/host-client/client'; const fixture = vi.hoisted(() => { const snapshot: HostSnapshot = { diff --git a/apps/mobile/test/background-catch-up.test.ts b/apps/mobile/test/background-catch-up.test.ts index ecfdc98bb5..169ff74b10 100644 --- a/apps/mobile/test/background-catch-up.test.ts +++ b/apps/mobile/test/background-catch-up.test.ts @@ -8,7 +8,7 @@ import { type BackgroundCatchUpOptions, } from '../src/host/background-catch-up'; import { createCatchUp, type CatchUpHost } from '../src/host/catch-up'; -import { openLocalStore, type LocalStore } from '../src/host/local-store'; +import { openLocalStore, type LocalStore } from '@botharness/host-client/local-store'; import { nodeSqlConnection } from './node-sql-connection'; type Saved = { hostId: string; routes: string[] }; diff --git a/apps/mobile/test/bot-access.test.tsx b/apps/mobile/test/bot-access.test.tsx index 8936166652..0e87d3150c 100644 --- a/apps/mobile/test/bot-access.test.tsx +++ b/apps/mobile/test/bot-access.test.tsx @@ -12,7 +12,7 @@ vi.mock('../src/ui/shell/icons', async () => ({ vi.mock('../src/ui/primitives/system-symbol', () => ({ SystemSymbol: () => null })); import { botAccess, setBotAccess } from '../src/host/bot-access'; -import type { HostClient, RosterBot } from '../src/host/client'; +import type { HostClient, RosterBot } from '@botharness/host-client/client'; import { BotAccessScreen } from '../src/ui/chat/bot-access-screen'; import { t } from '../src/ui/strings'; diff --git a/apps/mobile/test/bot-activity.test.ts b/apps/mobile/test/bot-activity.test.ts index e6af1d4ca5..705810d8d8 100644 --- a/apps/mobile/test/bot-activity.test.ts +++ b/apps/mobile/test/bot-activity.test.ts @@ -11,7 +11,7 @@ import { weekGlance, } from '../src/host/bot-activity'; import { compactTokenCount, trailingDays } from '../src/host/usage-days'; -import type { ProfileActivity, ProfileModelUsageRow } from '../src/host/wire'; +import type { ProfileActivity, ProfileModelUsageRow } from '@botharness/host-protocol/wire'; const row = (day: string, total: number | null, model = 'deepseek-v4'): ProfileModelUsageRow => ({ day, diff --git a/apps/mobile/test/bot-avatar-choice.test.ts b/apps/mobile/test/bot-avatar-choice.test.ts index 636164f258..8bb6835eb4 100644 --- a/apps/mobile/test/bot-avatar-choice.test.ts +++ b/apps/mobile/test/bot-avatar-choice.test.ts @@ -1,11 +1,11 @@ import { expect, it } from 'vitest'; -import { creationAvatarRecipe } from '../src/host/bot-avatar-choice'; +import { creationAvatarRecipe } from '@botharness/host-client/bot-avatar-choice'; import { createBotCreationController, parseCreationRecord, type BotCreationDraft, type CreationRecord, -} from '../src/host/bot-creation'; +} from '@botharness/host-client/bot-creation'; import { seededAvatarFor } from '../../../packages/core/src/bots/avatar-appearance'; it('a blank draft keeps its initial avatar through name edits, destination changes and reopening', async () => { diff --git a/apps/mobile/test/bot-avatar.test.ts b/apps/mobile/test/bot-avatar.test.ts index 5dd9ba10e2..11aab88b89 100644 --- a/apps/mobile/test/bot-avatar.test.ts +++ b/apps/mobile/test/bot-avatar.test.ts @@ -1,8 +1,8 @@ import { afterEach, describe, expect, it } from 'vitest'; import { setBotAvatar } from '../src/host/bot-avatar'; -import { createHostClient, type HostClient } from '../src/host/client'; -import { FakeHost } from './fake-host'; +import { createHostClient, type HostClient } from '@botharness/host-client/client'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; let client: HostClient | undefined; afterEach(() => client?.stop()); diff --git a/apps/mobile/test/bot-background-entry.test.tsx b/apps/mobile/test/bot-background-entry.test.tsx index 981f5d8591..a420b30b4a 100644 --- a/apps/mobile/test/bot-background-entry.test.tsx +++ b/apps/mobile/test/bot-background-entry.test.tsx @@ -31,10 +31,10 @@ vi.mock('../src/ui/chat/dm-activity-settings', () => ({ DmActivitySettings: () = vi.mock('../src/ui/chat/bot-name-setting', () => ({ BotNameSetting: () => null })); vi.mock('../src/ui/primitives/row-icon', () => ({ RowIcon: () => null })); -import { createHostClient } from '../src/host/client'; +import { createHostClient } from '@botharness/host-client/client'; import { BotSettingsPanel } from '../src/ui/chat/bot-settings-panel'; import { t } from '../src/ui/strings'; -import { FakeHost } from './fake-host'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true }); afterEach(() => push.mockReset()); diff --git a/apps/mobile/test/bot-creation-entry.test.ts b/apps/mobile/test/bot-creation-entry.test.ts index 4d45a6fd56..d49959e1ea 100644 --- a/apps/mobile/test/bot-creation-entry.test.ts +++ b/apps/mobile/test/bot-creation-entry.test.ts @@ -1,5 +1,8 @@ import { expect, it, vi } from 'vitest'; -import { createBotCreationController, type CreationRecord } from '../src/host/bot-creation'; +import { + createBotCreationController, + type CreationRecord, +} from '@botharness/host-client/bot-creation'; import { enterBotCreation } from '../src/host/bot-creation-entry'; const file = { diff --git a/apps/mobile/test/bot-creation-navigation.test.ts b/apps/mobile/test/bot-creation-navigation.test.ts index 0f3ffeaa17..035c878356 100644 --- a/apps/mobile/test/bot-creation-navigation.test.ts +++ b/apps/mobile/test/bot-creation-navigation.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it, vi } from 'vitest'; import { openBotCreationResult } from '../src/host/bot-creation-navigation'; -import type { CreationSnapshot } from '../src/host/bot-creation'; +import type { CreationSnapshot } from '@botharness/host-client/bot-creation'; import { createCreationVisibility } from '../src/host/bot-creation-visibility'; function setup() { diff --git a/apps/mobile/test/bot-creation-notice.test.tsx b/apps/mobile/test/bot-creation-notice.test.tsx index 85a61257b8..e8c6577565 100644 --- a/apps/mobile/test/bot-creation-notice.test.tsx +++ b/apps/mobile/test/bot-creation-notice.test.tsx @@ -2,7 +2,7 @@ import { act, createElement, type CSSProperties, type ReactNode, type Ref } from 'react'; import { createRoot, type Root } from 'react-dom/client'; import { afterEach, beforeEach, expect, it, vi } from 'vitest'; -import type { CreationSnapshot } from '../src/host/bot-creation'; +import type { CreationSnapshot } from '@botharness/host-client/bot-creation'; const fixture = vi.hoisted(() => ({ path: '/', diff --git a/apps/mobile/test/bot-creation-screen.test.tsx b/apps/mobile/test/bot-creation-screen.test.tsx index 4fb41c57c4..cf4b056e07 100644 --- a/apps/mobile/test/bot-creation-screen.test.tsx +++ b/apps/mobile/test/bot-creation-screen.test.tsx @@ -8,7 +8,7 @@ import { type BotCreationOperation, type CreationReceipt, type CreationRecord, -} from '../src/host/bot-creation'; +} from '@botharness/host-client/bot-creation'; Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true }); @@ -125,7 +125,7 @@ vi.mock('../src/host/native-conversation-filter', () => ({ conversationFilter: { ready: Promise.resolve(), set: () => {} }, })); vi.mock('../src/host/native-host-look', () => ({ hostLooks: { look: () => ({}) } })); -vi.mock('../src/ui/design/host-look', () => ({ +vi.mock('@botharness/host-client/ui/design/host-look', () => ({ shownHostName: (_look: unknown, name: string) => name, })); vi.mock('../src/ui/primitives/sheet-content', () => ({ diff --git a/apps/mobile/test/bot-creation-tags.test.ts b/apps/mobile/test/bot-creation-tags.test.ts index e6a40ab9c7..f0400593ab 100644 --- a/apps/mobile/test/bot-creation-tags.test.ts +++ b/apps/mobile/test/bot-creation-tags.test.ts @@ -1,11 +1,11 @@ import { expect, it } from 'vitest'; -import { creationTags, editCreationTags } from '../src/host/bot-creation-tags'; +import { creationTags, editCreationTags } from '@botharness/host-client/bot-creation-tags'; import { createBotCreationController, normalizedBlankInput, parseCreationRecord, type CreationRecord, -} from '../src/host/bot-creation'; +} from '@botharness/host-client/bot-creation'; const draft = { hostId: 'A', diff --git a/apps/mobile/test/bot-creation-transport.test.ts b/apps/mobile/test/bot-creation-transport.test.ts index d2879abde5..61f2beedd2 100644 --- a/apps/mobile/test/bot-creation-transport.test.ts +++ b/apps/mobile/test/bot-creation-transport.test.ts @@ -1,10 +1,10 @@ import { DEFAULT_LINE_RECIPE } from '../../../packages/core/src/bots/avatar-line'; import { describe, expect, it, vi } from 'vitest'; -import { botCreationTransport } from '../src/host/bot-creation-transport'; +import { botCreationTransport } from '@botharness/host-client/bot-creation-transport'; import { botCreationTargets } from '../src/host/bot-creation-targets'; -import type { HostCarrier } from '../src/host/carrier'; -import type { SavedHost } from '../src/host/hosts'; -import type { BotCreationOperation } from '../src/host/bot-creation'; +import type { HostCarrier } from '@botharness/host-protocol/carrier'; +import type { SavedHost } from '@botharness/host-client/hosts'; +import type { BotCreationOperation } from '@botharness/host-client/bot-creation'; const operation: BotCreationOperation = { hostId: 'B', diff --git a/apps/mobile/test/bot-creation.test.ts b/apps/mobile/test/bot-creation.test.ts index c95ae7f703..35fead5472 100644 --- a/apps/mobile/test/bot-creation.test.ts +++ b/apps/mobile/test/bot-creation.test.ts @@ -8,7 +8,7 @@ import { type CreationReceipt, type CreationRecord, type BotCreationDraft, -} from '../src/host/bot-creation'; +} from '@botharness/host-client/bot-creation'; const draft = { hostId: 'B', @@ -376,7 +376,7 @@ describe('native blank Bot creation recovery', () => { }); it('persists an avatar choice in the draft and rejects a malformed one', async () => { - const { parseCreationRecord } = await import('../src/host/bot-creation'); + const { parseCreationRecord } = await import('@botharness/host-client/bot-creation'); const draft = { hostId: 'A', displayName: 'Ada', persona: '', description: '', tags: '' }; expect( parseCreationRecord({ @@ -404,6 +404,6 @@ it.each([ ['https://gitlab.example/acme/bots/notes/', 'notes'], ['https://github.com/acme/helper?tab=readme', 'helper'], ])('names a Git import %s after its repository by default', async (url, name) => { - const { repositoryName } = await import('../src/host/bot-creation'); + const { repositoryName } = await import('@botharness/host-client/bot-creation'); expect(repositoryName(url)).toBe(name); }); diff --git a/apps/mobile/test/bot-import-screen.test.tsx b/apps/mobile/test/bot-import-screen.test.tsx index b20fd99c44..99f3efe939 100644 --- a/apps/mobile/test/bot-import-screen.test.tsx +++ b/apps/mobile/test/bot-import-screen.test.tsx @@ -6,7 +6,7 @@ import { BotCreationFailure, createBotCreationController, type BotCreationOperation, -} from '../src/host/bot-creation'; +} from '@botharness/host-client/bot-creation'; const fixture = vi.hoisted(() => ({ routeReady: true, @@ -89,7 +89,7 @@ vi.mock('../src/host/host-session', () => ({ useHostAvailability: () => fixture.hosts.map(({ hostId }) => ({ hostId, status: 'checking' })), })); vi.mock('../src/host/native-host-look', () => ({ hostLooks: { look: () => ({}) } })); -vi.mock('../src/ui/design/host-look', () => ({ +vi.mock('@botharness/host-client/ui/design/host-look', () => ({ shownHostName: (_look: unknown, name: string) => name, })); vi.mock('../src/ui/primitives/text', () => ({ diff --git a/apps/mobile/test/bot-import.live.test.ts b/apps/mobile/test/bot-import.live.test.ts index afcf3f9369..3cdeebc1a6 100644 --- a/apps/mobile/test/bot-import.live.test.ts +++ b/apps/mobile/test/bot-import.live.test.ts @@ -1,9 +1,12 @@ import { describe, expect, it } from 'vitest'; -import { createBotCreationController, type CreationRecord } from '../src/host/bot-creation'; -import { botCreationTransport } from '../src/host/bot-creation-transport'; -import { parsePairingLink, redeemPairing } from '../src/host/pairing'; -import { keyBytes } from '../src/host/encrypted-carrier'; -import { noiseFingerprint } from '../../../packages/core/src/devices/noise/xk'; +import { + createBotCreationController, + type CreationRecord, +} from '@botharness/host-client/bot-creation'; +import { botCreationTransport } from '@botharness/host-client/bot-creation-transport'; +import { parsePairingLink, redeemPairing } from '@botharness/host-client/pairing'; +import { keyBytes } from '@botharness/host-client/encrypted-carrier'; +import { noiseFingerprint } from '@botharness/host-protocol/noise/xk'; import { nodeCarrier } from './node-carrier'; const live = process.env['MOBILE_LIVE_HOST_URL']; diff --git a/apps/mobile/test/bot-import.test.ts b/apps/mobile/test/bot-import.test.ts index 2cbf594353..8602a9d77d 100644 --- a/apps/mobile/test/bot-import.test.ts +++ b/apps/mobile/test/bot-import.test.ts @@ -4,7 +4,7 @@ import { createBotCreationController, type BotCreationOperation, type CreationRecord, -} from '../src/host/bot-creation'; +} from '@botharness/host-client/bot-creation'; function setup() { let disk: CreationRecord | undefined; diff --git a/apps/mobile/test/bot-inbox-screen.test.tsx b/apps/mobile/test/bot-inbox-screen.test.tsx index c77c4bd86e..f5873f3040 100644 --- a/apps/mobile/test/bot-inbox-screen.test.tsx +++ b/apps/mobile/test/bot-inbox-screen.test.tsx @@ -11,8 +11,8 @@ vi.mock('../src/ui/shell/icons', async () => ({ ChevronRightIcon: () => null, })); -import type { HostClient } from '../src/host/client'; -import type { BotInboxItem } from '../src/host/wire'; +import type { HostClient } from '@botharness/host-client/client'; +import type { BotInboxItem } from '@botharness/host-protocol/wire'; import { BotInboxScreen } from '../src/ui/chat/bot-inbox-screen'; import { t } from '../src/ui/strings'; diff --git a/apps/mobile/test/bot-inbox.test.ts b/apps/mobile/test/bot-inbox.test.ts index d3c20167ca..5393c4bf0b 100644 --- a/apps/mobile/test/bot-inbox.test.ts +++ b/apps/mobile/test/bot-inbox.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it, vi } from 'vitest'; import { createBotInbox, inboxOrder } from '../src/host/bot-inbox'; -import type { BotInboxItem } from '../src/host/wire'; +import type { BotInboxItem } from '@botharness/host-protocol/wire'; const item = (id: string, sourceMessageId?: string): BotInboxItem => ({ id, diff --git a/apps/mobile/test/bot-name.test.ts b/apps/mobile/test/bot-name.test.ts index 9733d445e1..7824f1509e 100644 --- a/apps/mobile/test/bot-name.test.ts +++ b/apps/mobile/test/bot-name.test.ts @@ -1,8 +1,8 @@ import { afterEach, expect, it } from 'vitest'; import { renameBot } from '../src/host/bot-name'; -import { createHostClient, type HostClient } from '../src/host/client'; -import { FakeHost } from './fake-host'; +import { createHostClient, type HostClient } from '@botharness/host-client/client'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; let client: HostClient | undefined; afterEach(() => client?.stop()); diff --git a/apps/mobile/test/bot-operation-telemetry.test.ts b/apps/mobile/test/bot-operation-telemetry.test.ts index dd206405d1..572942c1c2 100644 --- a/apps/mobile/test/bot-operation-telemetry.test.ts +++ b/apps/mobile/test/bot-operation-telemetry.test.ts @@ -5,9 +5,13 @@ import { type BotCreationPort, type CreationReceipt, type CreationRecord, -} from '../src/host/bot-creation'; -import { createMobileTelemetry } from '../src/telemetry/mobile-telemetry'; -import { sanitizeEvent, type BotOperationKind, type TelemetryEvent } from '../src/telemetry/schema'; +} from '@botharness/host-client/bot-creation'; +import { createMobileTelemetry } from '@botharness/host-client/telemetry/mobile-telemetry'; +import { + sanitizeEvent, + type BotOperationKind, + type TelemetryEvent, +} from '@botharness/host-client/telemetry/schema'; const dispose: (() => void)[] = []; afterEach(() => dispose.splice(0).forEach((close) => close())); diff --git a/apps/mobile/test/bot-profile-sheet.test.tsx b/apps/mobile/test/bot-profile-sheet.test.tsx index 33e444cbbb..0c6224358a 100644 --- a/apps/mobile/test/bot-profile-sheet.test.tsx +++ b/apps/mobile/test/bot-profile-sheet.test.tsx @@ -72,8 +72,8 @@ vi.mock('../src/ui/shell/icons', async () => ({ import type { BotProfile } from '../src/host/bot-profile'; import { shiftDay, today as localToday, trailingDays } from '../src/host/usage-days'; -import type { ProfileActivity } from '../src/host/wire'; -import type { RosterBot } from '../src/host/client'; +import type { ProfileActivity } from '@botharness/host-protocol/wire'; +import type { RosterBot } from '@botharness/host-client/client'; import { BotProfilePage } from '../src/ui/chat/bot-profile'; import { createProfileTabMemory, type ProfileTab } from '../src/ui/chat/profile-tabs'; import { t } from '../src/ui/strings'; diff --git a/apps/mobile/test/bot-profile.live.test.ts b/apps/mobile/test/bot-profile.live.test.ts index feeb7c50ba..707e29c5b9 100644 --- a/apps/mobile/test/bot-profile.live.test.ts +++ b/apps/mobile/test/bot-profile.live.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it } from 'vitest'; import { loadBotProfile, pinnedMemory } from '../src/host/bot-profile'; -import { createHostClient } from '../src/host/client'; -import type { MemoryFile, MemorySnapshot } from '../src/host/wire'; +import { createHostClient } from '@botharness/host-client/client'; +import type { MemoryFile, MemorySnapshot } from '@botharness/host-protocol/wire'; import { pairWithLiveHost } from './live-pairing'; import { nodeCarrier } from './node-carrier'; diff --git a/apps/mobile/test/bot-profile.test.ts b/apps/mobile/test/bot-profile.test.ts index e91d26293e..30a2cba13a 100644 --- a/apps/mobile/test/bot-profile.test.ts +++ b/apps/mobile/test/bot-profile.test.ts @@ -12,9 +12,9 @@ import { unpinnedEntries, } from '../src/host/bot-profile'; import { parseProfileActivity, weekGlance } from '../src/host/bot-activity'; -import { createHostClient } from '../src/host/client'; -import { FakeHost } from './fake-host'; -import hostWire from './fixtures/host-wire.json'; +import { createHostClient } from '@botharness/host-client/client'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; +import hostWire from '../../../packages/host-client/test/fixtures/host-wire.json'; import profileWire from './fixtures/profile-wire.json'; const recordedActivity = hostWire.rpc.profileActivity[0]!.body.result.value; diff --git a/apps/mobile/test/bot-settings.test.ts b/apps/mobile/test/bot-settings.test.ts index 0a921fe9d6..06470fddb1 100644 --- a/apps/mobile/test/bot-settings.test.ts +++ b/apps/mobile/test/bot-settings.test.ts @@ -16,11 +16,11 @@ import { revokeWorkspaceGrant, setApprovalTemplate, setAssignmentAccess, -} from '../src/host/bot-settings'; -import { createHostClient } from '../src/host/client'; +} from '@botharness/host-client/bot-settings'; +import { createHostClient } from '@botharness/host-client/client'; import { modelLabel, workspaceLabel } from '../src/ui/chat/composer-labels'; import { t } from '../src/ui/strings'; -import { FakeHost } from './fake-host'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; const ROUTE = 'https://studio.tailnet-example.ts.net'; const slug = 'ada'; diff --git a/apps/mobile/test/bot-zip-import.test.ts b/apps/mobile/test/bot-zip-import.test.ts index a79d9b3aa4..c4781bf72e 100644 --- a/apps/mobile/test/bot-zip-import.test.ts +++ b/apps/mobile/test/bot-zip-import.test.ts @@ -4,8 +4,8 @@ import { createBotCreationController, type BotCreationOperation, type CreationRecord, -} from '../src/host/bot-creation'; -import type { ZipImportSource } from '../src/host/zip-import-upload'; +} from '@botharness/host-client/bot-creation'; +import type { ZipImportSource } from '@botharness/host-client/zip-import-upload'; const file = { fileId: '12345678-1234-1234-1234-123456789abc', diff --git a/apps/mobile/test/bot-zip-transport.test.ts b/apps/mobile/test/bot-zip-transport.test.ts index a863683463..4bbf7e2bf4 100644 --- a/apps/mobile/test/bot-zip-transport.test.ts +++ b/apps/mobile/test/bot-zip-transport.test.ts @@ -1,9 +1,9 @@ import { createHash } from 'node:crypto'; import { expect, it, vi } from 'vitest'; -import { botCreationTransport } from '../src/host/bot-creation-transport'; -import type { HostCarrier } from '../src/host/carrier'; -import type { BotCreationOperation } from '../src/host/bot-creation'; -import type { ZipImportSource } from '../src/host/zip-import-upload'; +import { botCreationTransport } from '@botharness/host-client/bot-creation-transport'; +import type { HostCarrier } from '@botharness/host-protocol/carrier'; +import type { BotCreationOperation } from '@botharness/host-client/bot-creation'; +import type { ZipImportSource } from '@botharness/host-client/zip-import-upload'; const bytes = new Uint8Array(30).fill(4); const source: ZipImportSource = { diff --git a/apps/mobile/test/browser-viewer.live.test.ts b/apps/mobile/test/browser-viewer.live.test.ts index 10b25565f9..aa2a772177 100644 --- a/apps/mobile/test/browser-viewer.live.test.ts +++ b/apps/mobile/test/browser-viewer.live.test.ts @@ -1,8 +1,11 @@ import { createServer } from 'node:http'; import { describe, expect, it } from 'vitest'; -import { createBrowserViewer, type BrowserViewerState } from '../src/host/browser-viewer'; -import { createHostClient } from '../src/host/client'; +import { + createBrowserViewer, + type BrowserViewerState, +} from '@botharness/host-client/browser-viewer'; +import { createHostClient } from '@botharness/host-client/client'; import { pairWithLiveHost } from './live-pairing'; import { nodeCarrier } from './node-carrier'; diff --git a/apps/mobile/test/browser-viewer.test.ts b/apps/mobile/test/browser-viewer.test.ts index 35a387b75d..d87a9ec372 100644 --- a/apps/mobile/test/browser-viewer.test.ts +++ b/apps/mobile/test/browser-viewer.test.ts @@ -8,8 +8,8 @@ import { scrollFor, stagePoint, type BrowserViewerState, -} from '../src/host/browser-viewer'; -import type { HostApiAnswer, HostApiInit } from '../src/host/client'; +} from '@botharness/host-client/browser-viewer'; +import type { HostApiAnswer, HostApiInit } from '@botharness/host-client/client'; type Call = { path: string; body?: Record }; diff --git a/apps/mobile/test/call-post.test.ts b/apps/mobile/test/call-post.test.ts index 9b31e2f8f6..a7537c69ea 100644 --- a/apps/mobile/test/call-post.test.ts +++ b/apps/mobile/test/call-post.test.ts @@ -1,7 +1,7 @@ import { afterEach, expect, it, vi } from 'vitest'; import { createCallPost } from '../src/host/call-post'; -import { createHostClient, type HostClient } from '../src/host/client'; -import type { HostResponse } from '../src/host/carrier'; +import { createHostClient, type HostClient } from '@botharness/host-client/client'; +import type { HostResponse } from '@botharness/host-protocol/carrier'; let client: HostClient | undefined; afterEach(() => { diff --git a/apps/mobile/test/call-record.test.tsx b/apps/mobile/test/call-record.test.tsx index 02f27af6cb..2d1ba0f525 100644 --- a/apps/mobile/test/call-record.test.tsx +++ b/apps/mobile/test/call-record.test.tsx @@ -4,8 +4,8 @@ import { vi, expect, it } from 'vitest'; vi.mock('react-native', async () => await import('./react-native-shim')); vi.mock('react-native-svg', () => ({ default: () => null, Path: () => null, Circle: () => null })); -import { activityOf } from '../src/host/channel-activity'; -import type { ChannelWireMessage } from '../src/host/wire'; +import { activityOf } from '@botharness/host-client/channel-activity'; +import type { ChannelWireMessage } from '@botharness/host-protocol/wire'; import { callRecordLines, callRecordPreview } from '../src/ui/chat/call-record-text'; import { callStrings } from '../src/ui/strings'; diff --git a/apps/mobile/test/catch-up-power.test.ts b/apps/mobile/test/catch-up-power.test.ts index 657fdebfaa..105095271b 100644 --- a/apps/mobile/test/catch-up-power.test.ts +++ b/apps/mobile/test/catch-up-power.test.ts @@ -1,7 +1,7 @@ import { afterEach, describe, expect, it, vi } from 'vitest'; import { createCatchUp } from '../src/host/catch-up'; -import { openLocalStore, type LocalStore } from '../src/host/local-store'; +import { openLocalStore, type LocalStore } from '@botharness/host-client/local-store'; import { nodeSqlConnection } from './node-sql-connection'; const battery = vi.hoisted(() => ({ diff --git a/apps/mobile/test/catch-up.test.ts b/apps/mobile/test/catch-up.test.ts index 5cf1e6f3d2..67f5aafb71 100644 --- a/apps/mobile/test/catch-up.test.ts +++ b/apps/mobile/test/catch-up.test.ts @@ -2,7 +2,7 @@ import { afterEach, describe, expect, it } from 'vitest'; import { createCatchUp } from '../src/host/catch-up'; import { applyStoredChanges } from '../src/host/local-conversation-cache'; -import { openLocalStore, type LocalStore } from '../src/host/local-store'; +import { openLocalStore, type LocalStore } from '@botharness/host-client/local-store'; import { nodeSqlConnection } from './node-sql-connection'; const stores: LocalStore[] = []; diff --git a/apps/mobile/test/channel-activity.test.ts b/apps/mobile/test/channel-activity.test.ts index c4419c1c1c..b23ce30773 100644 --- a/apps/mobile/test/channel-activity.test.ts +++ b/apps/mobile/test/channel-activity.test.ts @@ -3,14 +3,18 @@ import { describe, expect, it } from 'vitest'; import type { ChannelMessage } from '../../../packages/core/src/channels/channel'; import { visibleDmMessages } from '../../../packages/client/src/client/dm-actions'; import { en, zh } from '../../../packages/client/src/client/locale'; -import { activityOf } from '../src/host/channel-activity'; -import { reactable, shownInChat, type ConversationMessage } from '../src/host/conversation'; -import type { RosterView } from '../src/host/client'; +import { activityOf } from '@botharness/host-client/channel-activity'; +import { + reactable, + shownInChat, + type ConversationMessage, +} from '@botharness/host-client/conversation'; +import type { RosterView } from '@botharness/host-client/client'; import { visibleDmActivity } from '../src/host/dm-activity'; -import type { ChannelWireMessage } from '../src/host/wire'; +import type { ChannelWireMessage } from '@botharness/host-protocol/wire'; import { activityText } from '../src/ui/chat/activity-text'; import { activityStrings } from '../src/ui/strings'; -import fixture from './fixtures/host-wire.json'; +import fixture from '../../../packages/host-client/test/fixtures/host-wire.json'; const recorded = fixture.activityJournal; const messages = recorded.page.entries.map((entry) => entry.message) as ChannelMessage[]; diff --git a/apps/mobile/test/channel-creation-screen.test.tsx b/apps/mobile/test/channel-creation-screen.test.tsx index 30527e0dda..bfac75ae4f 100644 --- a/apps/mobile/test/channel-creation-screen.test.tsx +++ b/apps/mobile/test/channel-creation-screen.test.tsx @@ -121,7 +121,7 @@ vi.mock('../src/host/native-conversation-filter', () => ({ conversationFilter: { ready: Promise.resolve(), set: vi.fn() }, })); vi.mock('../src/host/native-host-look', () => ({ hostLooks: { look: () => ({}) } })); -vi.mock('../src/ui/design/host-look', () => ({ +vi.mock('@botharness/host-client/ui/design/host-look', () => ({ shownHostName: (_look: unknown, name: string) => name, })); vi.mock('../src/ui/primitives/text', () => ({ diff --git a/apps/mobile/test/channel-creation-transport.test.ts b/apps/mobile/test/channel-creation-transport.test.ts index 53229c2619..5dda8f566a 100644 --- a/apps/mobile/test/channel-creation-transport.test.ts +++ b/apps/mobile/test/channel-creation-transport.test.ts @@ -2,8 +2,8 @@ import { expect, it, vi } from 'vitest'; import { channelCreationTransport } from '../src/host/channel-creation-transport'; import { createChannelCreation } from '../src/host/channel-creation'; import { ChannelCreationNotAccepted } from '../src/host/channel-creation'; -import type { HostCarrier } from '../src/host/carrier'; -import type { SavedHost } from '../src/host/hosts'; +import type { HostCarrier } from '@botharness/host-protocol/carrier'; +import type { SavedHost } from '@botharness/host-client/hosts'; import { seededAvatarFor } from '../../../packages/core/src/bots/avatar-appearance'; const hosts: SavedHost[] = ['A', 'B'].map((hostId) => ({ diff --git a/apps/mobile/test/channel-files.test.ts b/apps/mobile/test/channel-files.test.ts index 3a696b82b0..995f2254a0 100644 --- a/apps/mobile/test/channel-files.test.ts +++ b/apps/mobile/test/channel-files.test.ts @@ -1,7 +1,7 @@ import { afterEach, expect, it } from 'vitest'; -import { createHostClient, type HostClient } from '../src/host/client'; +import { createHostClient, type HostClient } from '@botharness/host-client/client'; import { createChannelFiles, type ChannelFiles } from '../src/host/channel-files'; -import { FakeHost } from './fake-host'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; let client: HostClient | undefined; let files: ChannelFiles | undefined; diff --git a/apps/mobile/test/channel-list-store.test.ts b/apps/mobile/test/channel-list-store.test.ts index 3e1b91f987..c62b86674a 100644 --- a/apps/mobile/test/channel-list-store.test.ts +++ b/apps/mobile/test/channel-list-store.test.ts @@ -6,9 +6,9 @@ import { type ChannelListChanges, type ChannelListCursor, type ChannelListSource, -} from '../src/host/channel-list-store'; -import { openLocalStore, type LocalStore } from '../src/host/local-store'; -import type { ChannelListItem } from '../src/host/wire'; +} from '@botharness/host-client/channel-list-store'; +import { openLocalStore, type LocalStore } from '@botharness/host-client/local-store'; +import type { ChannelListItem } from '@botharness/host-protocol/wire'; import { nodeSqlConnection } from './node-sql-connection'; const opened: LocalStore[] = []; diff --git a/apps/mobile/test/channel-notifications.test.tsx b/apps/mobile/test/channel-notifications.test.tsx index 1ad2a0f826..16ccc5fa47 100644 --- a/apps/mobile/test/channel-notifications.test.tsx +++ b/apps/mobile/test/channel-notifications.test.tsx @@ -7,7 +7,7 @@ vi.mock('expo-symbols', () => ({ SymbolView: () => null })); vi.mock('react-native', () => import('./react-native-shim')); vi.mock('react-native-svg', () => ({ default: () => null, Path: () => null })); -import type { PushSettings } from '../src/host/push'; +import type { PushSettings } from '@botharness/host-client/push'; import { ChannelNotifications, type ChannelNotificationsPort, diff --git a/apps/mobile/test/channel-viewport.test.tsx b/apps/mobile/test/channel-viewport.test.tsx index 49d6d154e5..1e75624d7c 100644 --- a/apps/mobile/test/channel-viewport.test.tsx +++ b/apps/mobile/test/channel-viewport.test.tsx @@ -47,7 +47,7 @@ vi.mock('react-native-keyboard-controller', () => ({ })); import { useChannelViewport } from '../src/ui/chat/channel-viewport'; -import type { ConversationMessage } from '../src/host/conversation'; +import type { ConversationMessage } from '@botharness/host-client/conversation'; Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true }); let root: Root | undefined; diff --git a/apps/mobile/test/chat-header-layout-ios.test.tsx b/apps/mobile/test/chat-header-layout-ios.test.tsx index 66474ece19..a24651fe81 100644 --- a/apps/mobile/test/chat-header-layout-ios.test.tsx +++ b/apps/mobile/test/chat-header-layout-ios.test.tsx @@ -1,7 +1,7 @@ import { createElement, type ReactNode } from 'react'; import { renderToStaticMarkup } from 'react-dom/server'; import { describe, expect, it, vi } from 'vitest'; -import type { RosterBot } from '../src/host/client'; +import type { RosterBot } from '@botharness/host-client/client'; const device = vi.hoisted(() => ({ scale: 1 })); vi.mock('react-native', async () => ({ diff --git a/apps/mobile/test/computer-availability.test.ts b/apps/mobile/test/computer-availability.test.ts index b75a7573dd..f785e472c7 100644 --- a/apps/mobile/test/computer-availability.test.ts +++ b/apps/mobile/test/computer-availability.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it, vi } from 'vitest'; -import { readComputerAvailability } from '../src/host/computer-availability'; +import { readComputerAvailability } from '@botharness/host-client/computer-availability'; describe('paired Host Computer discovery', () => { it('discovers Local Computer without opening a viewer or selecting a Bot', async () => { @@ -33,9 +33,9 @@ describe('paired Host Computer discovery', () => { }, ); }); -import { createHostClient, type HostClient } from '../src/host/client'; -import { FakeHost } from './fake-host'; -import wire from './fixtures/host-wire.json'; +import { createHostClient, type HostClient } from '@botharness/host-client/client'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; +import wire from '../../../packages/host-client/test/fixtures/host-wire.json'; import { afterEach } from 'vitest'; const clients: HostClient[] = []; afterEach(() => { diff --git a/apps/mobile/test/computer-video-status.test.ts b/apps/mobile/test/computer-video-status.test.ts index 0adf7c08ce..0ed845c417 100644 --- a/apps/mobile/test/computer-video-status.test.ts +++ b/apps/mobile/test/computer-video-status.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest'; import type { LocalVideoClientState } from '../../../packages/computer/src/local-video-client'; -import type { ConnectionState } from '../src/host/client'; +import type { ConnectionState } from '@botharness/host-client/client'; import { computerVideoStatus } from '../src/ui/chat/computer-video-status'; const connected = { diff --git a/apps/mobile/test/computer-viewer.test.ts b/apps/mobile/test/computer-viewer.test.ts index 43cc14dc5d..e71fa8f3d5 100644 --- a/apps/mobile/test/computer-viewer.test.ts +++ b/apps/mobile/test/computer-viewer.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest'; -import type { HostApiAnswer, HostApiInit } from '../src/host/client'; +import type { HostApiAnswer, HostApiInit } from '@botharness/host-client/client'; import { addedText, createComputerViewer, @@ -8,7 +8,7 @@ import { wheelInput, WHEEL_STEP, type ComputerViewerState, -} from '../src/host/computer-viewer'; +} from '@botharness/host-client/computer-viewer'; type Call = { path: string; body?: Record }; diff --git a/apps/mobile/test/connect-account-relay.test.ts b/apps/mobile/test/connect-account-relay.test.ts index ec3c81b6b4..ea76c3be40 100644 --- a/apps/mobile/test/connect-account-relay.test.ts +++ b/apps/mobile/test/connect-account-relay.test.ts @@ -2,7 +2,7 @@ import { createServer } from 'node:http'; import { once } from 'node:events'; import { expect, it } from 'vitest'; import { setup, CLIENT_ID } from '../../../packages/connect-relay/test/support'; -import { createConnectAccount } from '../src/host/connect-account'; +import { createConnectAccount } from '@botharness/host-client/connect-account'; it('releases an offline slot through the mobile owner and HTTP relay without clearing local data', async () => { const revoked: string[] = []; diff --git a/apps/mobile/test/connect-account.test.ts b/apps/mobile/test/connect-account.test.ts index 1d18dccd1b..01bf787752 100644 --- a/apps/mobile/test/connect-account.test.ts +++ b/apps/mobile/test/connect-account.test.ts @@ -2,8 +2,8 @@ import { createHash } from 'node:crypto'; import { describe, expect, it, vi } from 'vitest'; -import { createConnectAccount } from '../src/host/connect-account'; -import { redeemPairing } from '../src/host/pairing'; +import { createConnectAccount } from '@botharness/host-client/connect-account'; +import { redeemPairing } from '@botharness/host-client/pairing'; const RELAY = 'https://relay.test'; const REDIRECT = 'ai.botharness.deepseekbot.dev:/oauth2redirect'; diff --git a/apps/mobile/test/connect-email-code.test.ts b/apps/mobile/test/connect-email-code.test.ts index 7920ab8096..723339a1df 100644 --- a/apps/mobile/test/connect-email-code.test.ts +++ b/apps/mobile/test/connect-email-code.test.ts @@ -10,7 +10,7 @@ import { type EmailCodeOutcome, type EmailCodeRefusal, type RedirectWatcher, -} from '../src/host/connect-account'; +} from '@botharness/host-client/connect-account'; import { startEmailCodeSignIn, takeEmailCodeSignIn } from '../src/host/email-code-bridge'; const RELAY = 'https://relay.test'; diff --git a/apps/mobile/test/connect-follow.test.ts b/apps/mobile/test/connect-follow.test.ts index 37e5bf6625..e0ce7f2967 100644 --- a/apps/mobile/test/connect-follow.test.ts +++ b/apps/mobile/test/connect-follow.test.ts @@ -1,8 +1,8 @@ import { expect, it } from 'vitest'; -import type { ConnectHost } from '../src/host/connect-account'; +import type { ConnectHost } from '@botharness/host-client/connect-account'; import { followConnectHosts } from '../src/host/connect-follow'; import { accountHostAdded } from '../src/host/account-pairing'; -import { parseSavedHost, type SavedHost } from '../src/host/hosts'; +import { parseSavedHost, type SavedHost } from '@botharness/host-client/hosts'; const owner = { issuer: 'https://api.workos.com' as const, diff --git a/apps/mobile/test/connect-password.test.ts b/apps/mobile/test/connect-password.test.ts index 9139044de8..18267c083c 100644 --- a/apps/mobile/test/connect-password.test.ts +++ b/apps/mobile/test/connect-password.test.ts @@ -3,7 +3,7 @@ import { createConnectAccount, type EmailCodeFlow, type EmailCodeOutcome, -} from '../src/host/connect-account'; +} from '@botharness/host-client/connect-account'; function setup( collect: (flow: EmailCodeFlow) => Promise, diff --git a/apps/mobile/test/connection-diagnostic.test.ts b/apps/mobile/test/connection-diagnostic.test.ts index a16f0ab217..38d1807cc6 100644 --- a/apps/mobile/test/connection-diagnostic.test.ts +++ b/apps/mobile/test/connection-diagnostic.test.ts @@ -3,7 +3,7 @@ import { connectionDiagnostic, connectionDiagnosticReport, networkDiagnosticReason, -} from '../src/host/connection-diagnostic'; +} from '@botharness/host-client/connection-diagnostic'; import { createAccountActionFixture } from '../src/host/account-action-fixture'; const app = { platform: 'ios', osVersion: '27.0', version: '1.7.0', build: '18' }; diff --git a/apps/mobile/test/connection-failure-actions.test.tsx b/apps/mobile/test/connection-failure-actions.test.tsx index d3a973377c..4484e7d849 100644 --- a/apps/mobile/test/connection-failure-actions.test.tsx +++ b/apps/mobile/test/connection-failure-actions.test.tsx @@ -31,7 +31,7 @@ vi.mock('@expo/ui/swift-ui', () => ({ vi.mock('@expo/ui/swift-ui/modifiers', () => ({ font: () => ({}) })); import { ConnectionFailureActions as Android } from '../src/ui/primitives/connection-failure-actions'; import { ConnectionFailureActions as IOS } from '../src/ui/primitives/connection-failure-actions.ios'; -import { connectionDiagnostic } from '../src/host/connection-diagnostic'; +import { connectionDiagnostic } from '@botharness/host-client/connection-diagnostic'; import { t } from '../src/ui/strings'; Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true }); let root: Root | undefined; diff --git a/apps/mobile/test/connection-summary.test.ts b/apps/mobile/test/connection-summary.test.ts index 07c49c5b61..8f6bfbbbd2 100644 --- a/apps/mobile/test/connection-summary.test.ts +++ b/apps/mobile/test/connection-summary.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it } from 'vitest'; import { connectionSummary } from '../src/host/connection-summary'; -import type { HumanAttentionItem } from '../src/host/wire'; -import type { InboxSnapshot } from '../src/host/inbox'; -import type { HostSnapshot } from '../src/host/client'; +import type { HumanAttentionItem } from '@botharness/host-protocol/wire'; +import type { InboxSnapshot } from '@botharness/host-client/inbox'; +import type { HostSnapshot } from '@botharness/host-client/client'; const request = (id: string, botSlug = 'same'): HumanAttentionItem => ({ id, diff --git a/apps/mobile/test/connection-telemetry.test.ts b/apps/mobile/test/connection-telemetry.test.ts index 9062a4deb4..e1355d3f5d 100644 --- a/apps/mobile/test/connection-telemetry.test.ts +++ b/apps/mobile/test/connection-telemetry.test.ts @@ -1,6 +1,9 @@ import { afterEach, expect, it, vi } from 'vitest'; -import { createConnectionTelemetry } from '../src/telemetry/connection'; -import { createMobileTelemetry, type TelemetryEvent } from '../src/telemetry/mobile-telemetry'; +import { createConnectionTelemetry } from '@botharness/host-client/telemetry/connection'; +import { + createMobileTelemetry, + type TelemetryEvent, +} from '@botharness/host-client/telemetry/mobile-telemetry'; afterEach(() => vi.useRealTimers()); it('times out observation without stopping the Host and records later recovery once', async () => { vi.useFakeTimers(); diff --git a/apps/mobile/test/conversation-attachments.test.ts b/apps/mobile/test/conversation-attachments.test.ts index 742599cc52..f3de693c13 100644 --- a/apps/mobile/test/conversation-attachments.test.ts +++ b/apps/mobile/test/conversation-attachments.test.ts @@ -1,14 +1,14 @@ import { afterEach, describe, expect, it } from 'vitest'; -import { createHostClient, type HostClient } from '../src/host/client'; +import { createHostClient, type HostClient } from '@botharness/host-client/client'; import { createConversation, type CachedConversation, type Conversation, type ConversationSnapshot, -} from '../src/host/conversation'; -import { installMediaStore, type MediaStore } from '../src/host/media-cache'; -import { FakeHost } from './fake-host'; +} from '@botharness/host-client/conversation'; +import { installMediaStore, type MediaStore } from '@botharness/host-client/media-cache'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; const ROUTE = 'https://studio.tailnet-example.ts.net'; const SLUG = 'bot-59296301f8d044d2b022d8784c5ed3fe'; diff --git a/apps/mobile/test/conversation-cursor.test.ts b/apps/mobile/test/conversation-cursor.test.ts index df3cba3b20..3da1f690e8 100644 --- a/apps/mobile/test/conversation-cursor.test.ts +++ b/apps/mobile/test/conversation-cursor.test.ts @@ -1,13 +1,13 @@ import { afterEach, describe, expect, it } from 'vitest'; -import { createHostClient, type HostClient } from '../src/host/client'; +import { createHostClient, type HostClient } from '@botharness/host-client/client'; import { createConversation, type CachedConversation, type Conversation, type ConversationSnapshot, -} from '../src/host/conversation'; -import { FakeHost } from './fake-host'; +} from '@botharness/host-client/conversation'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; const ROUTE = 'https://studio.tailnet-example.ts.net'; const SLUG = 'bot-59296301f8d044d2b022d8784c5ed3fe'; diff --git a/apps/mobile/test/conversation-local-store.test.ts b/apps/mobile/test/conversation-local-store.test.ts index 5f4ab0fc85..3ccc93ae0c 100644 --- a/apps/mobile/test/conversation-local-store.test.ts +++ b/apps/mobile/test/conversation-local-store.test.ts @@ -5,20 +5,20 @@ import { join } from 'node:path'; import { afterEach, describe, expect, it } from 'vitest'; import { createCatchUp } from '../src/host/catch-up'; -import { createHostClient, type HostClient } from '../src/host/client'; +import { createHostClient, type HostClient } from '@botharness/host-client/client'; import { createConversation, type CachedConversation, type Conversation, type ConversationSnapshot, -} from '../src/host/conversation'; +} from '@botharness/host-client/conversation'; import { createLocalConversationCache, pruneLocalConversations, redactLocalConversations, } from '../src/host/local-conversation-cache'; -import { openLocalStore, type LocalStore } from '../src/host/local-store'; -import { FakeHost } from './fake-host'; +import { openLocalStore, type LocalStore } from '@botharness/host-client/local-store'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; import { nodeSqlConnection } from './node-sql-connection'; const ROUTE = 'https://studio.tailnet-example.ts.net'; diff --git a/apps/mobile/test/conversation-multiple-hosts.test.tsx b/apps/mobile/test/conversation-multiple-hosts.test.tsx index d3ee9f4feb..f0e319c8d5 100644 --- a/apps/mobile/test/conversation-multiple-hosts.test.tsx +++ b/apps/mobile/test/conversation-multiple-hosts.test.tsx @@ -4,9 +4,9 @@ const channelHistory = channelNavigationHarness(); import { act, type ReactNode } from 'react'; import { createRoot } from 'react-dom/client'; import { expect, it, vi } from 'vitest'; -import type { RosterBot } from '../src/host/client'; +import type { RosterBot } from '@botharness/host-client/client'; import { secure, remotes } from './host-session-fixture'; -import { FakeHost } from './fake-host'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; import type { ActivityTarget } from '../src/host/live-activity-session'; const push = vi.hoisted(() => vi.fn()); diff --git a/apps/mobile/test/conversation-navigation.test.tsx b/apps/mobile/test/conversation-navigation.test.tsx index 316fdbc41d..faf3bae9ba 100644 --- a/apps/mobile/test/conversation-navigation.test.tsx +++ b/apps/mobile/test/conversation-navigation.test.tsx @@ -6,9 +6,9 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; let profileHistory = channelNavigationHarness(); const visibility = vi.hoisted(() => ({ recent: vi.fn(), read: vi.fn() })); vi.mock('../src/ui/chat/mark-read', () => ({ useMarkRead: () => visibility.read })); -import type { ChannelListItem } from '../src/host/wire'; -import type { RosterBot, RosterChannel } from '../src/host/client'; -import type { Conversation, ConversationSnapshot } from '../src/host/conversation'; +import type { ChannelListItem } from '@botharness/host-protocol/wire'; +import type { RosterBot, RosterChannel } from '@botharness/host-client/client'; +import type { Conversation, ConversationSnapshot } from '@botharness/host-client/conversation'; vi.mock('react-native-safe-area-context', () => ({ useSafeAreaInsets: () => ({ top: 0, bottom: 0, left: 0, right: 0 }), @@ -958,9 +958,9 @@ it('shows a message-shaped skeleton only while an empty history is opening', asy }); it('retries a failed earlier page through the Conversation owner without replacing loaded history', async () => { - const { createConversation } = await import('../src/host/conversation'); - const { createHostClient } = await import('../src/host/client'); - const { FakeHost } = await import('./fake-host'); + const { createConversation } = await import('@botharness/host-client/conversation'); + const { createHostClient } = await import('@botharness/host-client/client'); + const { FakeHost } = await import('../../../packages/host-client/test/fake-host.js'); const host = new FakeHost(); for (let index = 1; index <= 4; index += 1) host.channel('dm-ada').append({ id: `history-${index}`, body: `Earlier ${index}` }, false); diff --git a/apps/mobile/test/conversation-playback.test.ts b/apps/mobile/test/conversation-playback.test.ts index e483238dd9..79b37130e3 100644 --- a/apps/mobile/test/conversation-playback.test.ts +++ b/apps/mobile/test/conversation-playback.test.ts @@ -1,6 +1,9 @@ import { afterEach, describe, expect, it, vi } from 'vitest'; -import type { ConversationSnapshot, ConversationTimelineSnapshot } from '../src/host/conversation'; +import type { + ConversationSnapshot, + ConversationTimelineSnapshot, +} from '@botharness/host-client/conversation'; import { createConversationPlayback } from '../src/host/conversation-playback'; function fixture(initial: Partial = {}) { diff --git a/apps/mobile/test/conversation-streaming-rows.test.tsx b/apps/mobile/test/conversation-streaming-rows.test.tsx index 49b8eb05b5..2d1a146871 100644 --- a/apps/mobile/test/conversation-streaming-rows.test.tsx +++ b/apps/mobile/test/conversation-streaming-rows.test.tsx @@ -14,8 +14,8 @@ import { channelNavigationHarness } from './channel-navigation-harness'; let navigationHistory = channelNavigationHarness(); import { RequestActivityControl } from '../src/ui/chat/request-activity-control'; import { useHostSession } from '../src/host/host-session'; -import type { RosterBot } from '../src/host/client'; -import type { ConversationTimelineSnapshot } from '../src/host/conversation'; +import type { RosterBot } from '@botharness/host-client/client'; +import type { ConversationTimelineSnapshot } from '@botharness/host-client/conversation'; import type { ActivityTarget } from '../src/host/live-activity-session'; import type { DialogAction } from '../src/ui/primitives/dialog-state'; import { pickFiles, type PickedFile } from '../src/host/pick-files'; diff --git a/apps/mobile/test/conversation.live.test.ts b/apps/mobile/test/conversation.live.test.ts index d6ec96b238..f4c3de3334 100644 --- a/apps/mobile/test/conversation.live.test.ts +++ b/apps/mobile/test/conversation.live.test.ts @@ -1,7 +1,10 @@ import { describe, expect, it } from 'vitest'; -import { createHostClient, type HostClient } from '../src/host/client'; -import { createConversation, type ConversationSnapshot } from '../src/host/conversation'; +import { createHostClient, type HostClient } from '@botharness/host-client/client'; +import { + createConversation, + type ConversationSnapshot, +} from '@botharness/host-client/conversation'; import { pairWithLiveHost } from './live-pairing'; import { nodeCarrier } from './node-carrier'; diff --git a/apps/mobile/test/conversation.test.ts b/apps/mobile/test/conversation.test.ts index 0f1b4fbaf6..3d3800eda8 100644 --- a/apps/mobile/test/conversation.test.ts +++ b/apps/mobile/test/conversation.test.ts @@ -1,6 +1,6 @@ import { afterEach, describe, expect, it, vi } from 'vitest'; -import { createHostClient, type HostClient } from '../src/host/client'; +import { createHostClient, type HostClient } from '@botharness/host-client/client'; import { createConversation, reactable, @@ -8,11 +8,11 @@ import { type CachedConversation, type Conversation, type ConversationSnapshot, -} from '../src/host/conversation'; +} from '@botharness/host-client/conversation'; import { createConversationPlayback } from '../src/host/conversation-playback'; import { messageForDisplay } from '../src/host/message-display'; -import { FakeHost, type FakeChannel } from './fake-host'; -import wire from './fixtures/host-wire.json'; +import { FakeHost, type FakeChannel } from '../../../packages/host-client/test/fake-host.js'; +import wire from '../../../packages/host-client/test/fixtures/host-wire.json'; import type { ChannelMessage } from '../../../packages/core/src/channels/channel'; const ROUTE = 'https://studio.tailnet-example.ts.net'; diff --git a/apps/mobile/test/conversations.test.ts b/apps/mobile/test/conversations.test.ts index 69747e70df..e0ecd1e50c 100644 --- a/apps/mobile/test/conversations.test.ts +++ b/apps/mobile/test/conversations.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from 'vitest'; -import type { RosterView } from '../src/host/client'; -import type { HumanAttentionItem } from '../src/host/wire'; +import type { RosterView } from '@botharness/host-client/client'; +import type { HumanAttentionItem } from '@botharness/host-protocol/wire'; import { locale, t } from '../src/ui/strings'; import { interfacePreferences } from '../src/ui/interface-preferences'; import { diff --git a/apps/mobile/test/creation-tags-field-android.test.tsx b/apps/mobile/test/creation-tags-field-android.test.tsx index 6c9bc15108..e51a11b430 100644 --- a/apps/mobile/test/creation-tags-field-android.test.tsx +++ b/apps/mobile/test/creation-tags-field-android.test.tsx @@ -2,7 +2,7 @@ import { act, useState, type ReactNode } from 'react'; import { createRoot, type Root } from 'react-dom/client'; import { afterEach, expect, it, vi } from 'vitest'; -import { editCreationTags, type CreationTagDraft } from '../src/host/bot-creation-tags'; +import { editCreationTags, type CreationTagDraft } from '@botharness/host-client/bot-creation-tags'; Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true }); const native = vi.hoisted(() => ({ diff --git a/apps/mobile/test/decision-feedback.test.tsx b/apps/mobile/test/decision-feedback.test.tsx index 7c5bf7af2d..d9e66ef4c2 100644 --- a/apps/mobile/test/decision-feedback.test.tsx +++ b/apps/mobile/test/decision-feedback.test.tsx @@ -12,9 +12,13 @@ vi.mock('react-native-safe-area-context', () => ({ useSafeAreaInsets: () => ({ top: 0, bottom: 0, left: 0, right: 0 }), })); -import type { ApprovalRequest, DecisionResult, QuestionRequest } from '../src/host/requests'; +import type { + ApprovalRequest, + DecisionResult, + QuestionRequest, +} from '@botharness/host-client/requests'; import { ApprovalView, type ApprovalPort } from '../src/ui/approval-view'; -import type { HumanAttentionItem } from '../src/host/wire'; +import type { HumanAttentionItem } from '@botharness/host-protocol/wire'; import { JoinRequestView } from '../src/ui/attention-view'; import { ApprovalCard } from '../src/ui/chat/approval-card'; import { GrantRequestCard, type GrantRequestPort } from '../src/ui/chat/grant-request-card'; diff --git a/apps/mobile/test/deletion-client.test.ts b/apps/mobile/test/deletion-client.test.ts index c1cf4a3466..4e96ec8e88 100644 --- a/apps/mobile/test/deletion-client.test.ts +++ b/apps/mobile/test/deletion-client.test.ts @@ -1,7 +1,7 @@ import { expect, it } from 'vitest'; -import { createHostClient } from '../src/host/client'; +import { createHostClient } from '@botharness/host-client/client'; import { confirmBotDeletion, previewDeletion } from '../src/host/deletion'; -import { FakeHost } from './fake-host'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; it('carries the reviewed deletion scope through the paired-device client and rejects malformed previews', async () => { const host = new FakeHost(); diff --git a/apps/mobile/test/delivery-receipt.test.ts b/apps/mobile/test/delivery-receipt.test.ts index fe1d02f3ab..76763e306b 100644 --- a/apps/mobile/test/delivery-receipt.test.ts +++ b/apps/mobile/test/delivery-receipt.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest'; -import type { ConversationMessage } from '../src/host/conversation'; +import type { ConversationMessage } from '@botharness/host-client/conversation'; import { readingBots, receiptGroups, receiptRecipients } from '../src/host/delivery-receipt'; const message: ConversationMessage = { diff --git a/apps/mobile/test/design-tokens.test.ts b/apps/mobile/test/design-tokens.test.ts index d03e5b3fd2..34f2f84a9c 100644 --- a/apps/mobile/test/design-tokens.test.ts +++ b/apps/mobile/test/design-tokens.test.ts @@ -2,7 +2,7 @@ import { readFileSync } from 'node:fs'; import { describe, expect, it } from 'vitest'; import { palette as dshPalette, render } from '../scripts/generate-palette.mjs'; -import { palette } from '../src/ui/design/palette.generated'; +import { palette } from '@botharness/host-client/ui/design/palette.generated'; import { BUTTON_TONES, buttonColors, @@ -40,7 +40,13 @@ function px(value: string): number { describe('mobile design tokens', () => { it('match the DSH theme the Web Client paints with', () => { expect(render(dshPalette())).toBe( - readFileSync(new URL('../src/ui/design/palette.generated.ts', import.meta.url), 'utf8'), + readFileSync( + new URL( + '../../../packages/host-client/src/ui/design/palette.generated.ts', + import.meta.url, + ), + 'utf8', + ), ); }); diff --git a/apps/mobile/test/device-alerts.test.ts b/apps/mobile/test/device-alerts.test.ts index 888dbe619e..758053d599 100644 --- a/apps/mobile/test/device-alerts.test.ts +++ b/apps/mobile/test/device-alerts.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from 'vitest'; import { createDeviceAlerts, type AlertSnapshot } from '../src/host/device-alerts'; -import type { HumanAttentionItem } from '../src/host/wire'; +import type { HumanAttentionItem } from '@botharness/host-protocol/wire'; const approval: HumanAttentionItem = { id: 'approval-1', diff --git a/apps/mobile/test/device-notification-preferences.test.ts b/apps/mobile/test/device-notification-preferences.test.ts index 7f596cb203..9806591718 100644 --- a/apps/mobile/test/device-notification-preferences.test.ts +++ b/apps/mobile/test/device-notification-preferences.test.ts @@ -2,9 +2,9 @@ import { describe, expect, it, vi } from 'vitest'; import { createDeviceNotificationPreferences, DEFAULT_NOTIFICATION_PREFERENCES, -} from '../src/host/device-notification-preferences'; -import type { SavedHost } from '../src/host/hosts'; -import type { HostPush, PushPreferences } from '../src/host/push'; +} from '@botharness/host-client/device-notification-preferences'; +import type { SavedHost } from '@botharness/host-client/hosts'; +import type { HostPush, PushPreferences } from '@botharness/host-client/push'; import { createPushSession } from '../src/host/push-session'; const flush = async () => { diff --git a/apps/mobile/test/direct-reconnect.test.ts b/apps/mobile/test/direct-reconnect.test.ts index 7bf718b1d8..6acf8cb75f 100644 --- a/apps/mobile/test/direct-reconnect.test.ts +++ b/apps/mobile/test/direct-reconnect.test.ts @@ -1,13 +1,13 @@ import { randomBytes } from 'node:crypto'; import { afterEach, beforeEach, expect, it, vi } from 'vitest'; -import type { HostCarrier, HostSocketEvents } from '../src/host/carrier'; +import type { HostCarrier, HostSocketEvents } from '@botharness/host-protocol/carrier'; import { DIRECT_RETRY_MAX_MS, DIRECT_RETRY_MIN_MS, encryptedCarrier, -} from '../src/host/encrypted-carrier'; -import { ConnectChannel } from '../../../packages/core/src/devices/noise/channel'; -import { noisePublicKey } from '../../../packages/core/src/devices/noise/xk'; +} from '@botharness/host-client/encrypted-carrier'; +import { ConnectChannel } from '@botharness/host-protocol/noise/channel'; +import { noisePublicKey } from '@botharness/host-protocol/noise/xk'; const ORIGIN = 'https://host.deepseekbot.dev'; diff --git a/apps/mobile/test/dm-activity.test.ts b/apps/mobile/test/dm-activity.test.ts index 30d01d9184..f9635df64b 100644 --- a/apps/mobile/test/dm-activity.test.ts +++ b/apps/mobile/test/dm-activity.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from 'vitest'; import { createDmActivityPreferences, visibleDmActivity } from '../src/host/dm-activity'; -import type { ConversationMessage } from '../src/host/conversation'; +import type { ConversationMessage } from '@botharness/host-client/conversation'; describe('device-local DM activity preferences', () => { it('persists each Host and Bot independently, including changes before storage finishes loading', async () => { diff --git a/apps/mobile/test/encrypted-carrier.test.ts b/apps/mobile/test/encrypted-carrier.test.ts index b9fdb5a0cc..967d932dbd 100644 --- a/apps/mobile/test/encrypted-carrier.test.ts +++ b/apps/mobile/test/encrypted-carrier.test.ts @@ -1,10 +1,10 @@ import { expect, it, vi } from 'vitest'; -import { createHostClient } from '../src/host/client'; +import { createHostClient } from '@botharness/host-client/client'; import { decideFromPush } from '../src/host/push-actions'; -import { decideApproval } from '../src/host/requests'; -import { redeemPairing } from '../src/host/pairing'; -import { encryptedCarrier } from '../src/host/encrypted-carrier'; -import { parsePairingLink } from '../src/host/pairing'; +import { decideApproval } from '@botharness/host-client/requests'; +import { redeemPairing } from '@botharness/host-client/pairing'; +import { encryptedCarrier } from '@botharness/host-client/encrypted-carrier'; +import { parsePairingLink } from '@botharness/host-client/pairing'; it('accepts only a pinned single-loopback SSH v2 pairing without legacy fallback', () => { const payload = { @@ -38,10 +38,12 @@ it('accepts only a pinned single-loopback SSH v2 pairing without legacy fallback it('never sends an SSH pairing credential over raw loopback after a local port is replaced', async () => { const raw = { request: vi.fn(), - openSocket: vi.fn((_url: string, events: import('../src/host/carrier').HostSocketEvents) => { - queueMicrotask(() => events.closed('channel-disconnected')); - return { send: vi.fn(), close: vi.fn() }; - }), + openSocket: vi.fn( + (_url: string, events: import('@botharness/host-protocol/carrier').HostSocketEvents) => { + queueMicrotask(() => events.closed('channel-disconnected')); + return { send: vi.fn(), close: vi.fn() }; + }, + ), }; const saved = parseSavedHost({ hostId: 'host', @@ -107,7 +109,7 @@ it.each(['https://host.deepseekbot.dev', 'http://192.168.1.20:39101'])( }, ); -import { parseSavedHost, serializeSavedHost, withHost } from '../src/host/hosts'; +import { parseSavedHost, serializeSavedHost, withHost } from '@botharness/host-client/hosts'; it('persists the complete trust record and refuses a silent pin change or removal', () => { const host = { hostId: 'host', @@ -132,12 +134,12 @@ it('persists the complete trust record and refuses a silent pin change or remova expect(() => withHost({ hosts: [host] }, withoutPin)).toThrow('host-key-mismatch'); }); -import { openNoiseSocket } from '../src/host/encrypted-carrier'; -import { ConnectChannel } from '../../../packages/core/src/devices/noise/channel'; -import { noisePublicKey } from '../../../packages/core/src/devices/noise/xk'; +import { openNoiseSocket } from '@botharness/host-client/encrypted-carrier'; +import { ConnectChannel } from '@botharness/host-protocol/noise/channel'; +import { noisePublicKey } from '@botharness/host-protocol/noise/xk'; import { randomBytes } from 'node:crypto'; -import { createHostPush } from '../src/host/push'; -import { revokePairing, removeDevice } from '../src/host/pairing'; +import { createHostPush } from '@botharness/host-client/push'; +import { revokePairing, removeDevice } from '@botharness/host-client/pairing'; it('bounds unacknowledged native output even when bufferedAmount is absent', async () => { const hostKey = randomBytes(32); @@ -209,7 +211,10 @@ it.each([400, 500, 502, 503])( text: async () => '{}', bytes: async () => new Uint8Array(), })), - openSocket(_url: string, events: import('../src/host/carrier').HostSocketEvents) { + openSocket( + _url: string, + events: import('@botharness/host-protocol/carrier').HostSocketEvents, + ) { const peer = new ConnectChannel({ role: 'responder', hostId: 'host', diff --git a/apps/mobile/test/encrypted-upload.test.ts b/apps/mobile/test/encrypted-upload.test.ts index ae3cead5e1..f21c89f278 100644 --- a/apps/mobile/test/encrypted-upload.test.ts +++ b/apps/mobile/test/encrypted-upload.test.ts @@ -1,9 +1,9 @@ import { randomBytes } from 'node:crypto'; import { afterEach, expect, it, vi } from 'vitest'; -import { ConnectChannel } from '../../../packages/core/src/devices/noise/channel'; -import { noisePublicKey } from '../../../packages/core/src/devices/noise/xk'; -import { encryptedCarrier } from '../src/host/encrypted-carrier'; -import type { HostSocketEvents } from '../src/host/carrier'; +import { ConnectChannel } from '@botharness/host-protocol/noise/channel'; +import { noisePublicKey } from '@botharness/host-protocol/noise/xk'; +import { encryptedCarrier } from '@botharness/host-client/encrypted-carrier'; +import type { HostSocketEvents } from '@botharness/host-protocol/carrier'; afterEach(() => vi.unstubAllGlobals()); diff --git a/apps/mobile/test/feature-telemetry.test.ts b/apps/mobile/test/feature-telemetry.test.ts index 5ee2893df8..fd69918ea9 100644 --- a/apps/mobile/test/feature-telemetry.test.ts +++ b/apps/mobile/test/feature-telemetry.test.ts @@ -1,6 +1,9 @@ import { afterEach, expect, it, vi } from 'vitest'; -import { recordFeature, setFeatureSink } from '../src/telemetry/features'; -import { createMobileTelemetry, type TelemetryEvent } from '../src/telemetry/mobile-telemetry'; +import { recordFeature, setFeatureSink } from '@botharness/host-client/telemetry/features'; +import { + createMobileTelemetry, + type TelemetryEvent, +} from '@botharness/host-client/telemetry/mobile-telemetry'; afterEach(() => setFeatureSink(undefined)); diff --git a/apps/mobile/test/follow-latest-gestures.test.tsx b/apps/mobile/test/follow-latest-gestures.test.tsx index 0a070a2d44..de68b171c1 100644 --- a/apps/mobile/test/follow-latest-gestures.test.tsx +++ b/apps/mobile/test/follow-latest-gestures.test.tsx @@ -9,7 +9,7 @@ import type { } from 'react-native'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; -import type { ConversationMessage } from '../src/host/conversation'; +import type { ConversationMessage } from '@botharness/host-client/conversation'; import { CHECK_BUDGET, MOMENTUM_WAIT_MS, diff --git a/apps/mobile/test/follow-latest.test.tsx b/apps/mobile/test/follow-latest.test.tsx index f56647f891..2bde5ae6aa 100644 --- a/apps/mobile/test/follow-latest.test.tsx +++ b/apps/mobile/test/follow-latest.test.tsx @@ -1,7 +1,7 @@ import { renderToStaticMarkup } from 'react-dom/server'; import { describe, expect, it, vi } from 'vitest'; -import type { ConversationMessage } from '../src/host/conversation'; +import type { ConversationMessage } from '@botharness/host-client/conversation'; vi.mock('react-native', async () => { const { useWindowDimensions, StyleSheet } = await import('./react-native-shim'); diff --git a/apps/mobile/test/genui-document.test.ts b/apps/mobile/test/genui-document.test.ts index 58cbfec5fe..744b9ab86a 100644 --- a/apps/mobile/test/genui-document.test.ts +++ b/apps/mobile/test/genui-document.test.ts @@ -4,13 +4,13 @@ import { afterEach, describe, expect, it } from 'vitest'; import { syntheticGenuiDocument } from '../../../packages/core/test/fixtures/genui-document'; import { GENUI_EXECUTION_LIMITS } from '../../../packages/core/src/channels/genui-execution-limits'; import { genuiMobileRuntimeModule } from '../scripts/generate-genui-runtime.mjs'; -import { createHostClient, type HostClient } from '../src/host/client'; +import { createHostClient, type HostClient } from '@botharness/host-client/client'; import { createConversation, type CachedConversation, type Conversation, type ConversationSnapshot, -} from '../src/host/conversation'; +} from '@botharness/host-client/conversation'; import { genuiDocumentReply, GENUI_BRIDGE_BYTES, @@ -25,10 +25,10 @@ import { parseGenuiBridgeMessage, rememberedGenuiHeight, rememberGenuiHeight, -} from '../src/genui/document'; +} from '@botharness/host-client/genui/document'; import { GENUI_RUNTIME } from '../src/genui/runtime.generated'; -import { genuiDocumentView } from '../src/genui/view'; -import { FakeHost } from './fake-host'; +import { genuiDocumentView } from '@botharness/host-client/genui/view'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; const ROUTE = 'https://studio.tailnet-example.ts.net'; const SLUG = 'bot-59296301f8d044d2b022d8784c5ed3fe'; diff --git a/apps/mobile/test/genui-view.test.ts b/apps/mobile/test/genui-view.test.ts index 31c31b24fe..a45fb5ff5c 100644 --- a/apps/mobile/test/genui-view.test.ts +++ b/apps/mobile/test/genui-view.test.ts @@ -2,18 +2,18 @@ import { afterEach, describe, expect, it, vi } from 'vitest'; import { syntheticGenuiDocument } from '../../../packages/core/test/fixtures/genui-document'; import { initialGenuiDocumentState } from '../../../packages/core/src/channels/genui-document'; -import { MethodRefused } from '../src/host/client'; +import { MethodRefused } from '@botharness/host-client/client'; import { GENUI_RETAINED_VIEWS, forgetGenuiDocumentViews, genuiDocumentView, type GenuiViewClient, -} from '../src/genui/view'; +} from '@botharness/host-client/genui/view'; import { genuiRestoreMessage, parseGenuiBridgeMessage, type GenuiDocumentState, -} from '../src/genui/document'; +} from '@botharness/host-client/genui/document'; const document = syntheticGenuiDocument; const initial = initialGenuiDocumentState(document); diff --git a/apps/mobile/test/grant-request-card.test.ts b/apps/mobile/test/grant-request-card.test.ts index b8e7155c54..232291ed0b 100644 --- a/apps/mobile/test/grant-request-card.test.ts +++ b/apps/mobile/test/grant-request-card.test.ts @@ -12,12 +12,16 @@ vi.mock('react-native-safe-area-context', () => ({ useSafeAreaInsets: () => ({ top: 0, bottom: 0, left: 0, right: 0 }), })); -import { createHostClient, type HostClient } from '../src/host/client'; -import { grantRequestPort, loadGrantRequest, type RequestRef } from '../src/host/requests'; +import { createHostClient, type HostClient } from '@botharness/host-client/client'; +import { + grantRequestPort, + loadGrantRequest, + type RequestRef, +} from '@botharness/host-client/requests'; import { GrantRequestCard } from '../src/ui/chat/grant-request-card'; import { t } from '../src/ui/strings'; import { played } from './expo-haptics-shim'; -import { FakeHost } from './fake-host'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true }); diff --git a/apps/mobile/test/group-channel.test.ts b/apps/mobile/test/group-channel.test.ts index a0a797ebd5..fc6c060056 100644 --- a/apps/mobile/test/group-channel.test.ts +++ b/apps/mobile/test/group-channel.test.ts @@ -1,8 +1,12 @@ import { afterEach, describe, expect, it } from 'vitest'; -import { createHostClient, type HostClient, type HostSnapshot } from '../src/host/client'; +import { + createHostClient, + type HostClient, + type HostSnapshot, +} from '@botharness/host-client/client'; import { groupActions, groupInfo, loadGroupAssignments } from '../src/host/group-channel'; -import { FakeHost } from './fake-host'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; const ROUTE = 'https://studio.tailnet-example.ts.net'; const channelId = 'group-launch'; diff --git a/apps/mobile/test/group-info.test.tsx b/apps/mobile/test/group-info.test.tsx index fec8685060..155ad8f768 100644 --- a/apps/mobile/test/group-info.test.tsx +++ b/apps/mobile/test/group-info.test.tsx @@ -99,7 +99,7 @@ vi.mock('../src/ui/chat/sheet', () => { }); import type { ProfileAssignment } from '../src/host/bot-profile'; -import type { RosterBot } from '../src/host/client'; +import type { RosterBot } from '@botharness/host-client/client'; import type { GroupActions, GroupInfo } from '../src/host/group-channel'; import { GroupProfilePage, type GroupProfileProps } from '../src/ui/chat/group-info'; import { diff --git a/apps/mobile/test/header-status.test.ts b/apps/mobile/test/header-status.test.ts index c59d4553c7..65a9662ef8 100644 --- a/apps/mobile/test/header-status.test.ts +++ b/apps/mobile/test/header-status.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest'; -import type { RosterBot, RosterChannel } from '../src/host/client'; +import type { RosterBot, RosterChannel } from '@botharness/host-client/client'; import { headerStatus } from '../src/ui/chat/header-status'; const bot = (slug: string, state: RosterBot['state'], paused = false): RosterBot => ({ diff --git a/apps/mobile/test/home-host-compatibility.test.tsx b/apps/mobile/test/home-host-compatibility.test.tsx index e7dcafe6ec..1c51e4193d 100644 --- a/apps/mobile/test/home-host-compatibility.test.tsx +++ b/apps/mobile/test/home-host-compatibility.test.tsx @@ -4,7 +4,7 @@ const channelHistory = channelNavigationHarness(); import { expect, it, onTestFinished, vi } from 'vitest'; import { secure, remotes } from './host-session-fixture'; -import { FakeHost } from './fake-host'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; vi.mock('../src/host/app-version', () => ({ installedAppVersion: () => '1.7.0' })); vi.mock('react-native-keyboard-controller', async () => import('./keyboard-controller-shim')); vi.mock('react-native-tab-view', () => import('./tab-view-shim')); @@ -84,7 +84,7 @@ vi.mock('../src/ui/bot-avatar', () => ({ BotAvatar: () => null })); import { act, useLayoutEffect, type ReactNode } from 'react'; import { createRoot } from 'react-dom/client'; -import { createHostLooks } from '../src/host/host-look'; +import { createHostLooks } from '@botharness/host-client/host-look'; import { createSectionCollapse } from '../src/host/section-collapse'; const push = vi.fn(); const looks = createHostLooks({ read: async () => undefined, write() {} }); diff --git a/apps/mobile/test/home-multiple-hosts.test.tsx b/apps/mobile/test/home-multiple-hosts.test.tsx index 8d4a13d0da..2d72234304 100644 --- a/apps/mobile/test/home-multiple-hosts.test.tsx +++ b/apps/mobile/test/home-multiple-hosts.test.tsx @@ -5,7 +5,7 @@ import { expect, it, onTestFinished, vi } from 'vitest'; import { CONNECTION_OFFLINE_MS } from '../src/ui/connection-presence'; import { secure, remotes } from './host-session-fixture'; -import { FakeHost } from './fake-host'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; vi.mock('react-native-keyboard-controller', async () => import('./keyboard-controller-shim')); vi.mock('react-native-tab-view', () => import('./tab-view-shim')); vi.mock('react-native', () => import('./react-native-shim')); @@ -84,7 +84,7 @@ vi.mock('../src/ui/bot-avatar', () => ({ BotAvatar: () => null })); import { act, useLayoutEffect, type ReactNode } from 'react'; import { createRoot } from 'react-dom/client'; -import { createHostLooks } from '../src/host/host-look'; +import { createHostLooks } from '@botharness/host-client/host-look'; import { createSectionCollapse } from '../src/host/section-collapse'; const push = vi.fn(); const looks = createHostLooks({ read: async () => undefined, write() {} }); diff --git a/apps/mobile/test/home-search.test.tsx b/apps/mobile/test/home-search.test.tsx index 5bb4a48314..bb886f9651 100644 --- a/apps/mobile/test/home-search.test.tsx +++ b/apps/mobile/test/home-search.test.tsx @@ -1,8 +1,8 @@ // @vitest-environment jsdom import { act, memo, useLayoutEffect, useSyncExternalStore, type ReactNode } from 'react'; -import { createHostClient, type HostClient } from '../src/host/client'; +import { createHostClient, type HostClient } from '@botharness/host-client/client'; import { CONNECTION_OFFLINE_MS, CONNECTION_QUIET_MS } from '../src/ui/connection-presence'; -import { FakeHost } from './fake-host'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; import { createRoot, type Root } from 'react-dom/client'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; @@ -16,16 +16,16 @@ import { import { channelNavigationHarness } from './channel-navigation-harness'; let channelHistory = channelNavigationHarness(); const whoami = vi.fn(async (_id: string) => {}); -import type { HumanAttentionItem } from '../src/host/wire'; +import type { HumanAttentionItem } from '@botharness/host-protocol/wire'; import { publicInstance, MOBILE_REDIRECT_URI } from '../src/cloud/instance-contract'; import { cloudViewScope } from '../src/cloud/workspace-directory'; import { computerEnvironmentKey, cloudEnvironmentKey } from '../src/host/conversation-environments'; -import { HOST_COLORS, type HostColorId } from '../src/ui/design/host-look'; +import { HOST_COLORS, type HostColorId } from '@botharness/host-client/ui/design/host-look'; import { Platform } from 'react-native'; import { HostAccentProvider } from '../src/ui/shell/host-accent-provider'; import { HomeHeader } from '../src/ui/shell/home-header'; import { DesignThemeProvider, resolveTheme, useDesignTheme } from '../src/ui/design/theme'; -import type { RosterView } from '../src/host/client'; +import type { RosterView } from '@botharness/host-client/client'; import { hostDrawer } from '../src/ui/shell/host-drawer'; const { push, cloudState, directoryState, hostState, call, refresh, menus, rowProps } = vi.hoisted( diff --git a/apps/mobile/test/host-availability.test.tsx b/apps/mobile/test/host-availability.test.tsx index 9baa599578..22490bd0f1 100644 --- a/apps/mobile/test/host-availability.test.tsx +++ b/apps/mobile/test/host-availability.test.tsx @@ -2,7 +2,7 @@ import { act } from 'react'; import { createRoot } from 'react-dom/client'; import { expect, it } from 'vitest'; -import type { ConnectionState } from '../src/host/client'; +import type { ConnectionState } from '@botharness/host-client/client'; import { hostAvailabilitySource } from '../src/host/host-availability'; import { useVisibleSnapshot } from '../src/host/use-visible-snapshot'; diff --git a/apps/mobile/test/host-client.live.test.ts b/apps/mobile/test/host-client.live.test.ts index 65b17f8af0..55414cdab9 100644 --- a/apps/mobile/test/host-client.live.test.ts +++ b/apps/mobile/test/host-client.live.test.ts @@ -1,6 +1,10 @@ import { describe, expect, it } from 'vitest'; -import { createHostClient, type HostClient, type HostSnapshot } from '../src/host/client'; +import { + createHostClient, + type HostClient, + type HostSnapshot, +} from '@botharness/host-client/client'; import { pairWithLiveHost } from './live-pairing'; import { nodeCarrier } from './node-carrier'; diff --git a/apps/mobile/test/host-client.test.ts b/apps/mobile/test/host-client.test.ts index c7c0622222..ef072b6fa4 100644 --- a/apps/mobile/test/host-client.test.ts +++ b/apps/mobile/test/host-client.test.ts @@ -6,15 +6,15 @@ import { MAX_RECONNECT_DELAY_MS, type HostClient, type HostSnapshot, -} from '../src/host/client'; -import { parsePairingLink, redeemPairing } from '../src/host/pairing'; -import { checkRoute } from '../src/host/route'; +} from '@botharness/host-client/client'; +import { parsePairingLink, redeemPairing } from '@botharness/host-client/pairing'; +import { checkRoute } from '@botharness/host-protocol/route'; import { SECRET_ROUTE_METHODS } from '../../../packages/core/src/bridge/secret-route'; -import { openLocalStore, type LocalStore } from '../src/host/local-store'; -import { FakeHost } from './fake-host'; +import { openLocalStore, type LocalStore } from '@botharness/host-client/local-store'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; import { createConnectionLifetime } from '../src/host/connection-lifetime'; import { nodeSqlConnection } from './node-sql-connection'; -import wire from './fixtures/host-wire.json'; +import wire from '../../../packages/host-client/test/fixtures/host-wire.json'; const ROUTE = 'https://studio.tailnet-example.ts.net'; const recordedBot = wire.rpc.list.at(-1)!.body as { diff --git a/apps/mobile/test/host-connection.test.tsx b/apps/mobile/test/host-connection.test.tsx index 30baf90389..e888b46749 100644 --- a/apps/mobile/test/host-connection.test.tsx +++ b/apps/mobile/test/host-connection.test.tsx @@ -2,8 +2,8 @@ import { act } from 'react'; import { createRoot } from 'react-dom/client'; import { beforeEach, expect, it, vi } from 'vitest'; -import type { HostSnapshot } from '../src/host/client'; -import type { SavedHost } from '../src/host/hosts'; +import type { HostSnapshot } from '@botharness/host-client/client'; +import type { SavedHost } from '@botharness/host-client/hosts'; const clipboard = vi.hoisted(() => ({ setStringAsync: vi.fn(async () => true) })); const testRoute = vi.hoisted(() => vi.fn(async () => true)); @@ -33,7 +33,7 @@ vi.mock('react-native', () => import('./react-native-shim')); vi.mock('react-native-svg', () => ({ default: () => null, Path: () => null })); vi.mock('expo-symbols', () => ({ SymbolView: () => })); vi.mock('../src/host/native-carrier', () => ({ nativeCarrier: () => ({}) })); -vi.mock('../src/host/client', () => ({ createHostClient: () => undefined })); +vi.mock('@botharness/host-client/client', () => ({ createHostClient: () => undefined })); vi.mock('../src/host/host-session', () => { const client = { testRoute }; return { diff --git a/apps/mobile/test/host-dictation.test.tsx b/apps/mobile/test/host-dictation.test.tsx index d74ca2b3d5..af6bdab5ff 100644 --- a/apps/mobile/test/host-dictation.test.tsx +++ b/apps/mobile/test/host-dictation.test.tsx @@ -42,7 +42,7 @@ vi.mock('../src/host/dictation-mic', () => ({ const { useDictation } = await import('../src/host/speech'); const { hostDictationReady } = await import('../src/host/host-dictation'); -type HostClient = import('../src/host/client').HostClient; +type HostClient = import('@botharness/host-client/client').HostClient; Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true }); diff --git a/apps/mobile/test/host-drawer.test.ts b/apps/mobile/test/host-drawer.test.ts index fa477a7567..fb9f4f9a83 100644 --- a/apps/mobile/test/host-drawer.test.ts +++ b/apps/mobile/test/host-drawer.test.ts @@ -1,10 +1,10 @@ import { describe, expect, it, vi } from 'vitest'; -import type { ConnectionState, HostClient } from '../src/host/client'; +import type { ConnectionState, HostClient } from '@botharness/host-client/client'; import { createHostGlances, glanceHost, liveGlance } from '../src/host/host-glance'; -import type { SavedHost } from '../src/host/hosts'; -import type { InboxSnapshot } from '../src/host/inbox'; -import type { HumanAttentionItem } from '../src/host/wire'; +import type { SavedHost } from '@botharness/host-client/hosts'; +import type { InboxSnapshot } from '@botharness/host-client/inbox'; +import type { HumanAttentionItem } from '@botharness/host-protocol/wire'; import { addressLines, createHostDrawer, diff --git a/apps/mobile/test/host-health-probe.test.ts b/apps/mobile/test/host-health-probe.test.ts index d5ce64d374..5aea79872b 100644 --- a/apps/mobile/test/host-health-probe.test.ts +++ b/apps/mobile/test/host-health-probe.test.ts @@ -1,7 +1,7 @@ import { afterEach, expect, it, vi } from 'vitest'; -import { createHostClient, type HostClient } from '../src/host/client'; -import { FakeHost } from './fake-host'; +import { createHostClient, type HostClient } from '@botharness/host-client/client'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; let client: HostClient | undefined; afterEach(() => { diff --git a/apps/mobile/test/host-look.test.tsx b/apps/mobile/test/host-look.test.tsx index 7e6e2c7c1d..acedaab2a5 100644 --- a/apps/mobile/test/host-look.test.tsx +++ b/apps/mobile/test/host-look.test.tsx @@ -31,7 +31,7 @@ vi.mock('react-native-svg', () => ({ Stop: () => null, })); -import { createHostLooks, parseHostLook } from '../src/host/host-look'; +import { createHostLooks, parseHostLook } from '@botharness/host-client/host-look'; import { accountHostLookId, accountHostLookTarget } from '../src/host/account-host-look'; import { DEFAULT_HOST_LOOK, @@ -40,7 +40,7 @@ import { nearestHostColor, shownHostName, type HostLook, -} from '../src/ui/design/host-look'; +} from '@botharness/host-client/ui/design/host-look'; import { contrast, resolveTheme } from '../src/ui/design/resolve-theme'; import { HostLookEditor, type HostLookActions } from '../src/ui/shell/host-look-editor'; import { t } from '../src/ui/strings'; diff --git a/apps/mobile/test/host-session-background.test.ts b/apps/mobile/test/host-session-background.test.ts index 68b5af64e2..bbbad1f423 100644 --- a/apps/mobile/test/host-session-background.test.ts +++ b/apps/mobile/test/host-session-background.test.ts @@ -1,6 +1,6 @@ import { afterEach, expect, it, vi } from 'vitest'; import { secure, remotes } from './host-session-fixture'; -import { FakeHost } from './fake-host'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; const native = vi.hoisted(() => ({ running: true, diff --git a/apps/mobile/test/host-session-conversation.test.tsx b/apps/mobile/test/host-session-conversation.test.tsx index c898f2db98..2e7a75b6e7 100644 --- a/apps/mobile/test/host-session-conversation.test.tsx +++ b/apps/mobile/test/host-session-conversation.test.tsx @@ -3,9 +3,12 @@ import { act } from 'react'; import { createRoot, type Root } from 'react-dom/client'; import { afterAll, afterEach, beforeAll, beforeEach, expect, it, vi } from 'vitest'; import { remotes, secure } from './host-session-fixture'; -import { FakeHost } from './fake-host'; -import { createHostClient } from '../src/host/client'; -import type { Conversation, ConversationTimelineSnapshot } from '../src/host/conversation'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; +import { createHostClient } from '@botharness/host-client/client'; +import type { + Conversation, + ConversationTimelineSnapshot, +} from '@botharness/host-client/conversation'; vi.mock('expo-router', async () => { const { useEffect } = await import('react'); diff --git a/apps/mobile/test/host-session-fixture.tsx b/apps/mobile/test/host-session-fixture.tsx index f3c302687b..6560e304c3 100644 --- a/apps/mobile/test/host-session-fixture.tsx +++ b/apps/mobile/test/host-session-fixture.tsx @@ -63,7 +63,7 @@ vi.mock('../src/host/native-notification-avatars', () => ({ vi.mock('../src/telemetry/native', () => ({ mobileTelemetry: { foreground: () => undefined, send: () => undefined }, })); -vi.mock('../src/telemetry/connection', () => ({ +vi.mock('@botharness/host-client/telemetry/connection', () => ({ createConnectionTelemetry: () => undefined, })); vi.mock('../src/host/push-session', () => ({ @@ -79,8 +79,8 @@ vi.mock('../src/host/push-session', () => ({ }), })); -import { FakeHost } from './fake-host'; -import type { HostCarrier } from '../src/host/carrier'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; +import type { HostCarrier } from '@botharness/host-protocol/carrier'; export const remotes = new Map(); const carrier: HostCarrier = { diff --git a/apps/mobile/test/host-session-ios-call-resume.test.ts b/apps/mobile/test/host-session-ios-call-resume.test.ts index b8ae05d861..b7ba9e7f4b 100644 --- a/apps/mobile/test/host-session-ios-call-resume.test.ts +++ b/apps/mobile/test/host-session-ios-call-resume.test.ts @@ -1,6 +1,6 @@ import { afterEach, expect, it, vi } from 'vitest'; import { secure, remotes } from './host-session-fixture'; -import { FakeHost } from './fake-host'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; const native = vi.hoisted(() => ({ lifecycle: [] as Array<(state: string) => void> })); vi.mock('expo-router', () => ({ useFocusEffect: () => undefined })); diff --git a/apps/mobile/test/host-session-ios-in-app.test.ts b/apps/mobile/test/host-session-ios-in-app.test.ts index bbff261032..e8e415c57d 100644 --- a/apps/mobile/test/host-session-ios-in-app.test.ts +++ b/apps/mobile/test/host-session-ios-in-app.test.ts @@ -1,6 +1,6 @@ import { afterEach, expect, it, vi } from 'vitest'; import { secure, remotes } from './host-session-fixture'; -import { FakeHost } from './fake-host'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; interface Reconciled { inApp?: boolean; diff --git a/apps/mobile/test/host-session-multiple.test.ts b/apps/mobile/test/host-session-multiple.test.ts index 5cf5a3666a..f67b22dfd0 100644 --- a/apps/mobile/test/host-session-multiple.test.ts +++ b/apps/mobile/test/host-session-multiple.test.ts @@ -7,7 +7,7 @@ import { preferenceSync, preferenceRetry, } from './host-session-fixture'; -import { FakeHost } from './fake-host'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; vi.mock('expo-router', () => ({ useFocusEffect: () => undefined })); vi.mock('react-native', () => ({ AppState: { diff --git a/apps/mobile/test/host-session-unpair.test.ts b/apps/mobile/test/host-session-unpair.test.ts index 133fab350f..7926b62180 100644 --- a/apps/mobile/test/host-session-unpair.test.ts +++ b/apps/mobile/test/host-session-unpair.test.ts @@ -1,6 +1,6 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'; import { computerEnvironmentKey } from '../src/host/conversation-environments'; -import { parseSavedHosts } from '../src/host/hosts'; +import { parseSavedHosts } from '@botharness/host-client/hosts'; import { createHostDrawer } from '../src/ui/shell/host-drawer-model'; const secure = new Map(); @@ -59,7 +59,7 @@ vi.mock('../src/host/native-source-drafts', () => ({ removePersistedWhere: clearDrafts, }, })); -vi.mock('../src/host/conversation', () => ({ createConversation: vi.fn() })); +vi.mock('@botharness/host-client/conversation', () => ({ createConversation: vi.fn() })); vi.mock('../src/host/conversation-playback', () => ({ createConversationPlayback: vi.fn() })); vi.mock('../src/host/native-cache', () => ({ clearHostConversationCache: clearCache, @@ -103,10 +103,10 @@ vi.mock('../src/host/native-notification-preferences', () => ({ vi.mock('../src/telemetry/native', () => ({ mobileTelemetry: { foreground: () => undefined, send: () => undefined }, })); -vi.mock('../src/telemetry/connection', () => ({ +vi.mock('@botharness/host-client/telemetry/connection', () => ({ createConnectionTelemetry: () => ({}), })); -vi.mock('../src/host/client', () => ({ +vi.mock('@botharness/host-client/client', () => ({ createHostClient: () => ({ start() {}, stop: clientStops, @@ -119,7 +119,7 @@ vi.mock('../src/host/client', () => ({ getSnapshot: () => connection.snapshot, }), })); -vi.mock('../src/host/inbox', () => ({ +vi.mock('@botharness/host-client/inbox', () => ({ createInbox: () => ({ stop() {}, subscribe: () => () => {}, @@ -197,7 +197,7 @@ it('clears the saved chats when the Computer revokes this phone', async () => { it('stops the revoked Host conversations so no write recreates its store', async () => { const { hostSession } = await session('old', ['old']); - const { createConversation } = await import('../src/host/conversation'); + const { createConversation } = await import('@botharness/host-client/conversation'); const stop = vi.fn(); vi.mocked(createConversation).mockReturnValue({ start: () => undefined, @@ -579,7 +579,7 @@ it.each([false, true])( }; const { hostSession } = await import('../src/host/host-session'); await vi.waitFor(() => expect(hostSession.getState().saved).toBeNull()); - const { createConnectAccount } = await import('../src/host/connect-account'); + const { createConnectAccount } = await import('@botharness/host-client/connect-account'); let storedAccount: string | null = JSON.stringify({ clientId: owner.clientId, refreshToken: 'fixture', diff --git a/apps/mobile/test/host-store-delete.test.ts b/apps/mobile/test/host-store-delete.test.ts index 98437444e0..fb28f51903 100644 --- a/apps/mobile/test/host-store-delete.test.ts +++ b/apps/mobile/test/host-store-delete.test.ts @@ -6,7 +6,7 @@ import { installHostStoreOpener, retryHostStoreDeletes, } from '../src/host/host-store'; -import type { LocalStore } from '../src/host/local-store'; +import type { LocalStore } from '@botharness/host-client/local-store'; afterEach(() => installHostStoreOpener(undefined)); diff --git a/apps/mobile/test/host-store.test.ts b/apps/mobile/test/host-store.test.ts index 0ea3274c39..0100ea4493 100644 --- a/apps/mobile/test/host-store.test.ts +++ b/apps/mobile/test/host-store.test.ts @@ -12,7 +12,7 @@ import { installHostStoreOpener, } from '../src/host/host-store'; import { redactLocalConversations } from '../src/host/local-conversation-cache'; -import { localStoreName, openLocalStore } from '../src/host/local-store'; +import { localStoreName, openLocalStore } from '@botharness/host-client/local-store'; import { nodeSqlConnection } from './node-sql-connection'; const directory = mkdtempSync(join(tmpdir(), 'host-store-')); diff --git a/apps/mobile/test/in-app-banners.test.ts b/apps/mobile/test/in-app-banners.test.ts index 6fa0a3687e..e54a8c566b 100644 --- a/apps/mobile/test/in-app-banners.test.ts +++ b/apps/mobile/test/in-app-banners.test.ts @@ -2,7 +2,7 @@ import { describe, expect, it, vi } from 'vitest'; import { createDeviceAlerts, type AlertSnapshot } from '../src/host/device-alerts'; import { createInAppBanners } from '../src/host/in-app-banners'; -import type { HumanAttentionItem } from '../src/host/wire'; +import type { HumanAttentionItem } from '@botharness/host-protocol/wire'; const PREFERENCES = { approval: true, question: true, 'private-input': true, reply: true }; diff --git a/apps/mobile/test/inbox-live-refresh.test.ts b/apps/mobile/test/inbox-live-refresh.test.ts index fadd9324f1..6c1e47b8aa 100644 --- a/apps/mobile/test/inbox-live-refresh.test.ts +++ b/apps/mobile/test/inbox-live-refresh.test.ts @@ -1,6 +1,6 @@ import { afterEach, beforeEach, expect, it, vi } from 'vitest'; -import { createInbox } from '../src/host/inbox'; -import type { HostClient } from '../src/host/client'; +import { createInbox } from '@botharness/host-client/inbox'; +import type { HostClient } from '@botharness/host-client/client'; beforeEach(() => { vi.useFakeTimers(); diff --git a/apps/mobile/test/inbox-observer.test.ts b/apps/mobile/test/inbox-observer.test.ts index 1e9ba9e0ac..2431dae640 100644 --- a/apps/mobile/test/inbox-observer.test.ts +++ b/apps/mobile/test/inbox-observer.test.ts @@ -1,8 +1,8 @@ import { afterEach, describe, expect, it } from 'vitest'; -import { createHostClient, type HostClient } from '../src/host/client'; -import { observeInbox, prefetchInbox } from '../src/host/inbox'; -import { FakeHost } from './fake-host'; +import { createHostClient, type HostClient } from '@botharness/host-client/client'; +import { observeInbox, prefetchInbox } from '@botharness/host-client/inbox'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; const clients: HostClient[] = []; afterEach(() => { diff --git a/apps/mobile/test/inbox-screens.test.ts b/apps/mobile/test/inbox-screens.test.ts index 24919b1333..34ee4f896e 100644 --- a/apps/mobile/test/inbox-screens.test.ts +++ b/apps/mobile/test/inbox-screens.test.ts @@ -17,8 +17,8 @@ import type { ApprovalRequest, DecisionResult, QuestionRequest, -} from '../src/host/requests'; -import type { HumanAttentionItem, QuestionAnswer } from '../src/host/wire'; +} from '@botharness/host-client/requests'; +import type { HumanAttentionItem, QuestionAnswer } from '@botharness/host-protocol/wire'; import { ApprovalView, type ApprovalPort } from '../src/ui/approval-view'; import { QuestionView, type QuestionPort } from '../src/ui/question-view'; import { t } from '../src/ui/strings'; diff --git a/apps/mobile/test/inbox.live.test.ts b/apps/mobile/test/inbox.live.test.ts index 46676a45c6..a8b1e265aa 100644 --- a/apps/mobile/test/inbox.live.test.ts +++ b/apps/mobile/test/inbox.live.test.ts @@ -2,8 +2,8 @@ import { existsSync, readFileSync, rmSync } from 'node:fs'; import { describe, expect, it } from 'vitest'; -import { createHostClient, type HostClient } from '../src/host/client'; -import { createInbox, type Inbox } from '../src/host/inbox'; +import { createHostClient, type HostClient } from '@botharness/host-client/client'; +import { createInbox, type Inbox } from '@botharness/host-client/inbox'; import { answerQuestion, decideApproval, @@ -11,8 +11,8 @@ import { loadQuestion, requestRef, type RequestRef, -} from '../src/host/requests'; -import type { HumanAttentionItem } from '../src/host/wire'; +} from '@botharness/host-client/requests'; +import type { HumanAttentionItem } from '@botharness/host-protocol/wire'; import { pairWithLiveHost } from './live-pairing'; import { nodeCarrier } from './node-carrier'; diff --git a/apps/mobile/test/inbox.test.ts b/apps/mobile/test/inbox.test.ts index 9a27a27302..1f3ba4542b 100644 --- a/apps/mobile/test/inbox.test.ts +++ b/apps/mobile/test/inbox.test.ts @@ -1,7 +1,12 @@ import { afterEach, describe, expect, it } from 'vitest'; -import { createHostClient, type HostClient } from '../src/host/client'; -import { actionCount, createInbox, type Inbox, type InboxSnapshot } from '../src/host/inbox'; +import { createHostClient, type HostClient } from '@botharness/host-client/client'; +import { + actionCount, + createInbox, + type Inbox, + type InboxSnapshot, +} from '@botharness/host-client/inbox'; import { answerQuestion, buildAnswer, @@ -16,12 +21,12 @@ import { toggleOption, typeCustom, type RequestRef, -} from '../src/host/requests'; -import type { HumanAttentionItem, QuestionItem } from '../src/host/wire'; +} from '@botharness/host-client/requests'; +import type { HumanAttentionItem, QuestionItem } from '@botharness/host-protocol/wire'; import { t } from '../src/ui/strings'; -import { FakeHost } from './fake-host'; -import { messageHref, unreadHref } from '../src/host/push'; -import hostWire from './fixtures/host-wire.json'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; +import { messageHref, unreadHref } from '@botharness/host-client/push'; +import hostWire from '../../../packages/host-client/test/fixtures/host-wire.json'; import inboxWire from './fixtures/inbox-wire.json'; type Recorded = keyof typeof inboxWire.rpc; diff --git a/apps/mobile/test/invite-selection.test.tsx b/apps/mobile/test/invite-selection.test.tsx index abe95204dc..b0cafbe2b7 100644 --- a/apps/mobile/test/invite-selection.test.tsx +++ b/apps/mobile/test/invite-selection.test.tsx @@ -2,7 +2,7 @@ import { act, createElement } from 'react'; import { createRoot, type Root } from 'react-dom/client'; import { afterEach, describe, expect, it, vi } from 'vitest'; -import type { RosterBot } from '../src/host/client'; +import type { RosterBot } from '@botharness/host-client/client'; import { useInviteSelection, type InviteSheetProps } from '../src/ui/chat/invite-selection'; Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true }); diff --git a/apps/mobile/test/learned-routes.test.ts b/apps/mobile/test/learned-routes.test.ts index 827a492e7f..52067e7109 100644 --- a/apps/mobile/test/learned-routes.test.ts +++ b/apps/mobile/test/learned-routes.test.ts @@ -1,6 +1,6 @@ import { expect, it } from 'vitest'; -import { learnedRoutes } from '../src/host/learned-routes'; -import type { SavedHost } from '../src/host/hosts'; +import { learnedRoutes } from '@botharness/host-client/learned-routes'; +import type { SavedHost } from '@botharness/host-client/hosts'; const host: Pick = { hostId: 'one', diff --git a/apps/mobile/test/live-activity-session.test.ts b/apps/mobile/test/live-activity-session.test.ts index c2c34895cd..641751ee80 100644 --- a/apps/mobile/test/live-activity-session.test.ts +++ b/apps/mobile/test/live-activity-session.test.ts @@ -3,8 +3,8 @@ import { createActivitySession, type NativeRequestActivity, } from '../src/host/live-activity-session'; -import { ActivityRequestFailed } from '../src/host/live-activity'; -import type { SavedHost } from '../src/host/hosts'; +import { ActivityRequestFailed } from '@botharness/host-client/live-activity'; +import type { SavedHost } from '@botharness/host-client/hosts'; function fixture() { const host: SavedHost = { diff --git a/apps/mobile/test/live-pairing.ts b/apps/mobile/test/live-pairing.ts index e5a44357a2..3a83bc6f56 100644 --- a/apps/mobile/test/live-pairing.ts +++ b/apps/mobile/test/live-pairing.ts @@ -1,5 +1,5 @@ -import type { SavedHost } from '../src/host/hosts'; -import { parsePairingLink, redeemPairing } from '../src/host/pairing'; +import type { SavedHost } from '@botharness/host-client/hosts'; +import { parsePairingLink, redeemPairing } from '@botharness/host-client/pairing'; import { nodeCarrier } from './node-carrier'; export async function pairWithLiveHost( diff --git a/apps/mobile/test/local-message-search.test.ts b/apps/mobile/test/local-message-search.test.ts index 9d4d80629e..d7893c1dd5 100644 --- a/apps/mobile/test/local-message-search.test.ts +++ b/apps/mobile/test/local-message-search.test.ts @@ -9,13 +9,17 @@ import { redactLocalConversations, } from '../src/host/local-conversation-cache'; import { searchStoredMessages } from '../src/host/local-message-search'; -import { LOCAL_STORE_MIGRATIONS, openLocalStore, type LocalStore } from '../src/host/local-store'; +import { + LOCAL_STORE_MIGRATIONS, + openLocalStore, + type LocalStore, +} from '@botharness/host-client/local-store'; import { mergeMessageHits, searchLocalMessages, type MessageSearchHit, } from '../src/host/message-search'; -import type { JournalEntry } from '../src/host/wire'; +import type { JournalEntry } from '@botharness/host-protocol/wire'; import { nodeSqlConnection } from './node-sql-connection'; const CHANNEL = 'group-notes'; diff --git a/apps/mobile/test/local-store.test.ts b/apps/mobile/test/local-store.test.ts index 7d3ff3246a..d3efcd2a8e 100644 --- a/apps/mobile/test/local-store.test.ts +++ b/apps/mobile/test/local-store.test.ts @@ -10,7 +10,7 @@ import { localStoreName, openLocalStore, type LocalStore, -} from '../src/host/local-store'; +} from '@botharness/host-client/local-store'; import { nodeSqlConnection } from './node-sql-connection'; const opened: LocalStore[] = []; diff --git a/apps/mobile/test/local-video-actions.test.ts b/apps/mobile/test/local-video-actions.test.ts index a833b80fee..d6a017d894 100644 --- a/apps/mobile/test/local-video-actions.test.ts +++ b/apps/mobile/test/local-video-actions.test.ts @@ -1,7 +1,7 @@ import { expect, it, vi } from 'vitest'; import { localVideoActions, watchLocalVideoForeground } from '../src/host/local-video-actions'; import type { LocalVideoClientState } from '../../../packages/computer/src/local-video-client'; -import type { ConnectionState } from '../src/host/client'; +import type { ConnectionState } from '@botharness/host-client/client'; const connected = { status: 'connected', diff --git a/apps/mobile/test/local-video-carrier.test.ts b/apps/mobile/test/local-video-carrier.test.ts index 85f76025d4..5b4ed694f8 100644 --- a/apps/mobile/test/local-video-carrier.test.ts +++ b/apps/mobile/test/local-video-carrier.test.ts @@ -1,12 +1,12 @@ import { randomBytes } from 'node:crypto'; import { afterEach, expect, it, vi } from 'vitest'; -import { ConnectChannel } from '../../../packages/core/src/devices/noise/channel'; -import { noisePublicKey } from '../../../packages/core/src/devices/noise/xk'; +import { ConnectChannel } from '@botharness/host-protocol/noise/channel'; +import { noisePublicKey } from '@botharness/host-protocol/noise/xk'; import { LOCAL_VIDEO_PATH } from '../../../packages/computer/src/local-video-contract'; import { createLocalVideoClient } from '../../../packages/computer/src/local-video-client'; -import { createHostClient } from '../src/host/client'; -import { encryptedCarrier } from '../src/host/encrypted-carrier'; -import type { HostSocketEvents } from '../src/host/carrier'; +import { createHostClient } from '@botharness/host-client/client'; +import { encryptedCarrier } from '@botharness/host-client/encrypted-carrier'; +import type { HostSocketEvents } from '@botharness/host-protocol/carrier'; const origin = 'http://192.168.1.20:39101'; const path = '/botharness-device' + LOCAL_VIDEO_PATH; diff --git a/apps/mobile/test/local-video-notice.test.ts b/apps/mobile/test/local-video-notice.test.ts index 57c69cdf01..f705130c75 100644 --- a/apps/mobile/test/local-video-notice.test.ts +++ b/apps/mobile/test/local-video-notice.test.ts @@ -1,6 +1,6 @@ import { afterEach, describe, expect, it, vi } from 'vitest'; import type { LocalVideoClientState } from '../../../packages/computer/src/local-video-client'; -import type { ConnectionState } from '../src/host/client'; +import type { ConnectionState } from '@botharness/host-client/client'; const connected = { status: 'connected', diff --git a/apps/mobile/test/local-video-pointer.test.ts b/apps/mobile/test/local-video-pointer.test.ts index 87cfbfbba0..5aaacd0a88 100644 --- a/apps/mobile/test/local-video-pointer.test.ts +++ b/apps/mobile/test/local-video-pointer.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest'; -import { moveCursor, stagePoint } from '../src/host/browser-viewer'; +import { moveCursor, stagePoint } from '@botharness/host-client/browser-viewer'; import { resizeVideoPreview, revealVideoPointer, diff --git a/apps/mobile/test/mark-read.test.ts b/apps/mobile/test/mark-read.test.ts index 1b88b1275b..80365dc444 100644 --- a/apps/mobile/test/mark-read.test.ts +++ b/apps/mobile/test/mark-read.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it, vi } from 'vitest'; -import type { ConversationMessage } from '../src/host/conversation'; +import type { ConversationMessage } from '@botharness/host-client/conversation'; import { createReadMarker, readTarget } from '../src/ui/chat/mark-read'; const message = (id: string, delivery: ConversationMessage['delivery']): ConversationMessage => ({ diff --git a/apps/mobile/test/markdown-tail.test.ts b/apps/mobile/test/markdown-tail.test.ts index 6aad9504fd..7088601594 100644 --- a/apps/mobile/test/markdown-tail.test.ts +++ b/apps/mobile/test/markdown-tail.test.ts @@ -1,11 +1,11 @@ import { afterEach, expect, it, vi } from 'vitest'; -import { createHostClient, type HostClient } from '../src/host/client'; -import { createConversation, type Conversation } from '../src/host/conversation'; +import { createHostClient, type HostClient } from '@botharness/host-client/client'; +import { createConversation, type Conversation } from '@botharness/host-client/conversation'; import { createConversationPlayback, type ConversationPlayback, } from '../src/host/conversation-playback'; -import { FakeHost } from './fake-host'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; import body from './fixtures/markdown-tail.json'; const slug = 'bot-59296301f8d044d2b022d8784c5ed3fe'; diff --git a/apps/mobile/test/marketplace-home.test.tsx b/apps/mobile/test/marketplace-home.test.tsx index 10d7a9f6a0..cd0affc270 100644 --- a/apps/mobile/test/marketplace-home.test.tsx +++ b/apps/mobile/test/marketplace-home.test.tsx @@ -2,7 +2,7 @@ import { act, createElement, useLayoutEffect, type ReactNode } from 'react'; import { createRoot, type Root } from 'react-dom/client'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; -import { createBotCreationController } from '../src/host/bot-creation'; +import { createBotCreationController } from '@botharness/host-client/bot-creation'; const fixture = vi.hoisted(() => { const fetch = vi.fn(); @@ -53,7 +53,7 @@ vi.mock('../src/host/native-bot-creation', () => ({ })); import { digestCoverLayout } from '../src/marketplace/digest'; -import { setFeatureSink } from '../src/telemetry/features'; +import { setFeatureSink } from '@botharness/host-client/telemetry/features'; import { DigestCover } from '../src/ui/shell/marketplace-cover'; import { MarketplaceDigestScreen } from '../src/ui/shell/marketplace-digest-screen'; import { MarketplacePastPicksScreen } from '../src/ui/shell/marketplace-past-picks-screen'; diff --git a/apps/mobile/test/marketplace-import.test.ts b/apps/mobile/test/marketplace-import.test.ts index f0cff1663e..e4ca388107 100644 --- a/apps/mobile/test/marketplace-import.test.ts +++ b/apps/mobile/test/marketplace-import.test.ts @@ -5,7 +5,7 @@ import { createBotCreationController, type CreationRecord, type BotCreationOperation, -} from '../src/host/bot-creation'; +} from '@botharness/host-client/bot-creation'; import { selectMarketplaceImport } from '../src/marketplace/import-selection'; const detail: MarketplaceDetail = { diff --git a/apps/mobile/test/marketplace-screen.test.tsx b/apps/mobile/test/marketplace-screen.test.tsx index 1e87d525fb..46e7bab14e 100644 --- a/apps/mobile/test/marketplace-screen.test.tsx +++ b/apps/mobile/test/marketplace-screen.test.tsx @@ -3,7 +3,10 @@ import { act, createElement, useLayoutEffect, type ReactNode } from 'react'; import { createRoot, type Root } from 'react-dom/client'; import type { ScrollViewProps } from 'react-native'; import { afterEach, beforeEach, expect, it, vi } from 'vitest'; -import { createBotCreationController, type CreationRecord } from '../src/host/bot-creation'; +import { + createBotCreationController, + type CreationRecord, +} from '@botharness/host-client/bot-creation'; const fixture = vi.hoisted(() => { const fetch = vi.fn(); diff --git a/apps/mobile/test/media-cache.test.ts b/apps/mobile/test/media-cache.test.ts index 95b2599aa8..e8d2e941fc 100644 --- a/apps/mobile/test/media-cache.test.ts +++ b/apps/mobile/test/media-cache.test.ts @@ -45,10 +45,10 @@ vi.mock('expo-file-system', () => { }); const { cachedMediaUri, cacheMedia, forgetMedia, installMediaStore, mediaUsage } = - await import('../src/host/media-cache'); + await import('@botharness/host-client/media-cache'); const { nativeMediaStore } = await import('../src/host/native-media-store'); installMediaStore(nativeMediaStore); -const { attachmentsOf } = await import('../src/host/conversation'); +const { attachmentsOf } = await import('@botharness/host-client/conversation'); const source = ( cacheKey: string, diff --git a/apps/mobile/test/media-long-press.test.tsx b/apps/mobile/test/media-long-press.test.tsx index 5cba636814..9ec5abf9ab 100644 --- a/apps/mobile/test/media-long-press.test.tsx +++ b/apps/mobile/test/media-long-press.test.tsx @@ -7,7 +7,7 @@ vi.mock('react-native', async () => await import('./react-native-shim')); vi.mock('react-native-svg', () => ({ default: () => null, Path: () => null })); vi.mock('../src/ui/primitives/resource-image', () => ({ ResourceImage: () => null })); -import type { MessageAttachment } from '../src/host/conversation'; +import type { MessageAttachment } from '@botharness/host-client/conversation'; import { MediaLongPress } from '../src/ui/chat/media-long-press'; import { MessageAlbum, MessageFiles } from '../src/ui/chat/message-attachments'; diff --git a/apps/mobile/test/media-retention.test.ts b/apps/mobile/test/media-retention.test.ts index 74a8455aee..e765724838 100644 --- a/apps/mobile/test/media-retention.test.ts +++ b/apps/mobile/test/media-retention.test.ts @@ -10,7 +10,7 @@ import { runAutoCleanup, setAutoCleanup, type MediaStore, -} from '../src/host/media-cache'; +} from '@botharness/host-client/media-cache'; const DAY = 24 * 60 * 60 * 1000; const NOW = Date.UTC(2026, 10, 5); diff --git a/apps/mobile/test/memory-browser.test.tsx b/apps/mobile/test/memory-browser.test.tsx index 22c21c4609..b58a3434d4 100644 --- a/apps/mobile/test/memory-browser.test.tsx +++ b/apps/mobile/test/memory-browser.test.tsx @@ -36,8 +36,8 @@ import { MemoryPreviewImage } from '../src/ui/chat/memory-preview-image'; import { MemoryVisibility } from '../src/ui/chat/memory-visibility'; import { memoryInlineParts } from '../src/ui/chat/memory-markdown'; import { Lexer } from 'marked'; -import { createHostClient } from '../src/host/client'; -import { FakeHost } from './fake-host'; +import { createHostClient } from '@botharness/host-client/client'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; import { t } from '../src/ui/strings'; import profileWire from './fixtures/profile-wire.json'; @@ -194,7 +194,7 @@ function previewPort() { return { fetch: vi.fn( async ( - _source: import('../src/host/client').RemoteSource, + _source: import('@botharness/host-client/client').RemoteSource, _signal: AbortSignal, ): Promise => new Response(imageBytes), ), diff --git a/apps/mobile/test/memory-changes.test.ts b/apps/mobile/test/memory-changes.test.ts index 19ee7cb13c..c3eb9ce6e8 100644 --- a/apps/mobile/test/memory-changes.test.ts +++ b/apps/mobile/test/memory-changes.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it, vi } from 'vitest'; import { loadMemoryCommit, splitUnifiedDiff, wordMarks } from '../src/host/memory-changes'; -import type { HostClient } from '../src/host/client'; +import type { HostClient } from '@botharness/host-client/client'; const DIFF = [ 'diff --git a/MEMORY.md b/MEMORY.md', diff --git a/apps/mobile/test/memory-file-screen.test.tsx b/apps/mobile/test/memory-file-screen.test.tsx index 214cc33834..a7a53116f7 100644 --- a/apps/mobile/test/memory-file-screen.test.tsx +++ b/apps/mobile/test/memory-file-screen.test.tsx @@ -95,9 +95,9 @@ vi.mock('../src/ui/shell/icons', async () => ({ import { Platform } from 'react-native'; -import { MethodRefused } from '../src/host/client'; +import { MethodRefused } from '@botharness/host-client/client'; import { copyMessage } from '../src/ui/chat/message-menu'; -import type { MemoryFile } from '../src/host/wire'; +import type { MemoryFile } from '@botharness/host-protocol/wire'; import { MemoryFileScreen, memoryEditable } from '../src/ui/chat/memory-file-screen'; import { t } from '../src/ui/strings'; diff --git a/apps/mobile/test/memory-preview.live.test.ts b/apps/mobile/test/memory-preview.live.test.ts index 28f0adfc01..daf582a060 100644 --- a/apps/mobile/test/memory-preview.live.test.ts +++ b/apps/mobile/test/memory-preview.live.test.ts @@ -4,14 +4,14 @@ import { execFileSync } from 'node:child_process'; import { resolve } from 'node:path'; import { describe, expect, it } from 'vitest'; -import { createHostClient } from '../src/host/client'; +import { createHostClient } from '@botharness/host-client/client'; import { loadMemoryFile } from '../src/host/bot-profile'; import { loadPreviewImage, memoryPreviewSource, type MemoryPreviewIO, } from '../src/host/memory-preview'; -import type { MemoryMarkdown } from '../src/host/wire'; +import type { MemoryMarkdown } from '@botharness/host-protocol/wire'; import { pairWithLiveHost } from './live-pairing'; import { nodeCarrier } from './node-carrier'; diff --git a/apps/mobile/test/mention-draft.test.ts b/apps/mobile/test/mention-draft.test.ts index 2cb72d6707..b784e46535 100644 --- a/apps/mobile/test/mention-draft.test.ts +++ b/apps/mobile/test/mention-draft.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest'; -import type { RosterBot } from '../src/host/client'; +import type { RosterBot } from '@botharness/host-client/client'; import { activeMentionQuery, chooseMention, diff --git a/apps/mobile/test/message-actions-ios.test.tsx b/apps/mobile/test/message-actions-ios.test.tsx index aaadf5c87a..d383ed1380 100644 --- a/apps/mobile/test/message-actions-ios.test.tsx +++ b/apps/mobile/test/message-actions-ios.test.tsx @@ -1,7 +1,7 @@ import { renderToStaticMarkup } from 'react-dom/server'; import type { ReactNode } from 'react'; import { beforeEach, expect, it, vi } from 'vitest'; -import type { ConversationMessage } from '../src/host/conversation'; +import type { ConversationMessage } from '@botharness/host-client/conversation'; const native = vi.hoisted(() => ({ dismiss: () => {}, diff --git a/apps/mobile/test/message-attachment-picker.test.tsx b/apps/mobile/test/message-attachment-picker.test.tsx index 2656eb1984..4f9305589a 100644 --- a/apps/mobile/test/message-attachment-picker.test.tsx +++ b/apps/mobile/test/message-attachment-picker.test.tsx @@ -2,7 +2,7 @@ import { act, createElement, useState, type ReactNode } from 'react'; import { createRoot, type Root } from 'react-dom/client'; import { afterEach, describe, expect, it, vi } from 'vitest'; -import type { ConversationMessage, MessageAttachment } from '../src/host/conversation'; +import type { ConversationMessage, MessageAttachment } from '@botharness/host-client/conversation'; vi.mock('react-native', async () => ({ ...(await import('./react-native-shim')), diff --git a/apps/mobile/test/message-attachments-offline.test.tsx b/apps/mobile/test/message-attachments-offline.test.tsx index 57dda7bd7c..eea87a7047 100644 --- a/apps/mobile/test/message-attachments-offline.test.tsx +++ b/apps/mobile/test/message-attachments-offline.test.tsx @@ -11,7 +11,7 @@ vi.mock('../src/ui/primitives/resource-image', () => ({ ), })); -import type { MessageAttachment } from '../src/host/conversation'; +import type { MessageAttachment } from '@botharness/host-client/conversation'; import { ChatOffline } from '../src/ui/chat/chat-offline'; import { MessageAlbum } from '../src/ui/chat/message-attachments'; import { t } from '../src/ui/strings'; diff --git a/apps/mobile/test/message-bubble.test.tsx b/apps/mobile/test/message-bubble.test.tsx index 16ba66c9ea..1c478c038e 100644 --- a/apps/mobile/test/message-bubble.test.tsx +++ b/apps/mobile/test/message-bubble.test.tsx @@ -4,9 +4,9 @@ import { createRoot, type Root } from 'react-dom/client'; import { renderToStaticMarkup } from 'react-dom/server'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; -import { createConversation, type ConversationMessage } from '../src/host/conversation'; -import { createHostClient } from '../src/host/client'; -import { FakeHost } from './fake-host'; +import { createConversation, type ConversationMessage } from '@botharness/host-client/conversation'; +import { createHostClient } from '@botharness/host-client/client'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; import { syntheticGenuiDocument } from '../../../packages/core/test/fixtures/genui-document'; (globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = true; @@ -216,7 +216,7 @@ const { t } = await import('../src/ui/strings'); const { openMessageMenu, shareText } = await import('../src/ui/chat/message-menu'); const { MessageActions, dismissQueue, menuTime, messageMenuActions } = await import('../src/ui/chat/message-actions'); -const { MENU_REACTIONS, QUICK_REACTIONS } = await import('../src/host/conversation'); +const { MENU_REACTIONS, QUICK_REACTIONS } = await import('@botharness/host-client/conversation'); beforeEach(() => { native.os = 'ios'; diff --git a/apps/mobile/test/message-feedback-form.test.tsx b/apps/mobile/test/message-feedback-form.test.tsx index e9c174e2b3..05091c2ddf 100644 --- a/apps/mobile/test/message-feedback-form.test.tsx +++ b/apps/mobile/test/message-feedback-form.test.tsx @@ -14,8 +14,8 @@ vi.mock('react-native-keyboard-controller', async () => ({ vi.mock('../src/host/share-feedback', () => ({ shareFeedbackArchive: vi.fn() })); import { shareFeedbackArchive } from '../src/host/share-feedback'; import { MessageFeedbackForm } from '../src/ui/chat/message-feedback'; -import { createHostClient } from '../src/host/client'; -import type { HostCarrier } from '../src/host/carrier'; +import { createHostClient } from '@botharness/host-client/client'; +import type { HostCarrier } from '@botharness/host-protocol/carrier'; import { interfacePreferences } from '../src/ui/interface-preferences'; it('prevents a stale scope submission and retains the frozen report on retry', async () => { diff --git a/apps/mobile/test/message-feedback.test.ts b/apps/mobile/test/message-feedback.test.ts index 3e919e7508..7c03eb30d4 100644 --- a/apps/mobile/test/message-feedback.test.ts +++ b/apps/mobile/test/message-feedback.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from 'vitest'; -import { createHostClient } from '../src/host/client'; +import { createHostClient } from '@botharness/host-client/client'; import { createMessageFeedback } from '../src/host/message-feedback'; -import type { HostCarrier } from '../src/host/carrier'; +import type { HostCarrier } from '@botharness/host-protocol/carrier'; describe('phone feedback through the authenticated Host client', () => { it('previews selected evidence and retries the same frozen submission', async () => { diff --git a/apps/mobile/test/message-files-download.test.tsx b/apps/mobile/test/message-files-download.test.tsx index 3590a22c8d..46418dbd0a 100644 --- a/apps/mobile/test/message-files-download.test.tsx +++ b/apps/mobile/test/message-files-download.test.tsx @@ -4,7 +4,7 @@ import { createRoot, type Root } from 'react-dom/client'; import type { shareAsync } from 'expo-sharing'; import { afterEach, beforeEach, expect, it, vi } from 'vitest'; -import type { MessageAttachment } from '../src/host/conversation'; +import type { MessageAttachment } from '@botharness/host-client/conversation'; const native = vi.hoisted(() => ({ disk: new Map(), diff --git a/apps/mobile/test/message-groups.test.ts b/apps/mobile/test/message-groups.test.ts index e5f849fa7d..3157a0e422 100644 --- a/apps/mobile/test/message-groups.test.ts +++ b/apps/mobile/test/message-groups.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest'; -import type { ConversationMessage } from '../src/host/conversation'; +import type { ConversationMessage } from '@botharness/host-client/conversation'; import { chatRows, messageGroups, separatorLabel } from '../src/ui/chat/message-groups'; const message = ( diff --git a/apps/mobile/test/message-menu-feedback.test.ts b/apps/mobile/test/message-menu-feedback.test.ts index 389642b5d9..f2265c858b 100644 --- a/apps/mobile/test/message-menu-feedback.test.ts +++ b/apps/mobile/test/message-menu-feedback.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it, vi } from 'vitest'; import { messageMenuActions, runAction } from '../src/ui/chat/message-sheet'; -import type { ConversationMessage } from '../src/host/conversation'; +import type { ConversationMessage } from '@botharness/host-client/conversation'; const message: ConversationMessage = { id: 'm1', diff --git a/apps/mobile/test/message-popover-android.test.tsx b/apps/mobile/test/message-popover-android.test.tsx index 7b1641b5ce..b72780b591 100644 --- a/apps/mobile/test/message-popover-android.test.tsx +++ b/apps/mobile/test/message-popover-android.test.tsx @@ -3,7 +3,7 @@ import { act, createElement } from 'react'; import { createRoot, type Root } from 'react-dom/client'; import { afterEach, describe, expect, it, vi } from 'vitest'; -import type { ConversationMessage } from '../src/host/conversation'; +import type { ConversationMessage } from '@botharness/host-client/conversation'; vi.mock('react-native', async () => { const shim = await import('./react-native-shim'); @@ -33,7 +33,7 @@ vi.mock('../src/ui/shell/icons', () => ({ const { MessageActions } = await import('../src/ui/chat/message-actions.android'); const { t } = await import('../src/ui/strings'); -const { MENU_REACTIONS } = await import('../src/host/conversation'); +const { MENU_REACTIONS } = await import('@botharness/host-client/conversation'); Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true }); let root: Root | undefined; diff --git a/apps/mobile/test/message-selection.test.ts b/apps/mobile/test/message-selection.test.ts index 3883d8a237..c2164cc3b0 100644 --- a/apps/mobile/test/message-selection.test.ts +++ b/apps/mobile/test/message-selection.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest'; import { selectionText, toggleMessageSelection } from '../src/ui/chat/message-selection'; -import type { ConversationMessage } from '../src/host/conversation'; +import type { ConversationMessage } from '@botharness/host-client/conversation'; const message = (id: string, body: string): ConversationMessage => ({ id, body, diff --git a/apps/mobile/test/message-sheet-native.test.tsx b/apps/mobile/test/message-sheet-native.test.tsx index 3f6346c7cf..47bedc852e 100644 --- a/apps/mobile/test/message-sheet-native.test.tsx +++ b/apps/mobile/test/message-sheet-native.test.tsx @@ -3,7 +3,7 @@ import { act, createElement, type ReactNode } from 'react'; import { createRoot, type Root } from 'react-dom/client'; import { afterEach, describe, expect, it, vi } from 'vitest'; -import type { ConversationMessage } from '../src/host/conversation'; +import type { ConversationMessage } from '@botharness/host-client/conversation'; const native = vi.hoisted(() => ({ os: 'ios', @@ -189,7 +189,7 @@ vi.mock('@expo/ui/jetpack-compose', async () => { const ios = await import('../src/ui/chat/message-actions.ios'); const { menuGroups } = await import('../src/ui/chat/message-sheet'); const { t } = await import('../src/ui/strings'); -const { MENU_REACTIONS, QUICK_REACTIONS } = await import('../src/host/conversation'); +const { MENU_REACTIONS, QUICK_REACTIONS } = await import('@botharness/host-client/conversation'); Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true }); let root: Root | undefined; diff --git a/apps/mobile/test/message-source-state.test.tsx b/apps/mobile/test/message-source-state.test.tsx index d590224cd4..4bad869e04 100644 --- a/apps/mobile/test/message-source-state.test.tsx +++ b/apps/mobile/test/message-source-state.test.tsx @@ -2,7 +2,7 @@ import { act, useLayoutEffect } from 'react'; import { createRoot } from 'react-dom/client'; import { describe, expect, it } from 'vitest'; -import type { ConversationMessage } from '../src/host/conversation'; +import type { ConversationMessage } from '@botharness/host-client/conversation'; import { useMessageSourceState } from '../src/ui/chat/message-source-state'; Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true }); diff --git a/apps/mobile/test/message-source.test.ts b/apps/mobile/test/message-source.test.ts index 8f99d27482..8b1f01430e 100644 --- a/apps/mobile/test/message-source.test.ts +++ b/apps/mobile/test/message-source.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest'; -import type { ConversationMessage } from '../src/host/conversation'; +import type { ConversationMessage } from '@botharness/host-client/conversation'; import { messageSource } from '../src/ui/chat/message-source'; import { messageMenuActions, runAction } from '../src/ui/chat/message-sheet'; diff --git a/apps/mobile/test/mobile-telemetry-wire-live.test.ts b/apps/mobile/test/mobile-telemetry-wire-live.test.ts index fdf64e31b5..3175a99173 100644 --- a/apps/mobile/test/mobile-telemetry-wire-live.test.ts +++ b/apps/mobile/test/mobile-telemetry-wire-live.test.ts @@ -3,8 +3,8 @@ import { createRequire } from 'node:module'; import { randomUUID } from 'node:crypto'; import { readFileSync, writeFileSync } from 'node:fs'; import { dirname, join } from 'node:path'; -import { createMobileTelemetry } from '../src/telemetry/mobile-telemetry'; -import { isUuid, record, type TelemetryEvent } from '../src/telemetry/schema'; +import { createMobileTelemetry } from '@botharness/host-client/telemetry/mobile-telemetry'; +import { isUuid, record, type TelemetryEvent } from '@botharness/host-client/telemetry/schema'; const configPath = process.env.BH_MOBILE_WIRE_QA_CONFIG; diff --git a/apps/mobile/test/mobile-telemetry.test.ts b/apps/mobile/test/mobile-telemetry.test.ts index fd3c2d5f42..74164ec24a 100644 --- a/apps/mobile/test/mobile-telemetry.test.ts +++ b/apps/mobile/test/mobile-telemetry.test.ts @@ -3,7 +3,7 @@ import { createMobileTelemetry, type TelemetryEvent, type TelemetryOptions, -} from '../src/telemetry/mobile-telemetry'; +} from '@botharness/host-client/telemetry/mobile-telemetry'; function fixture(overrides: Partial = {}) { let stored: unknown; diff --git a/apps/mobile/test/model-settings.test.ts b/apps/mobile/test/model-settings.test.ts index 8fa0e76c18..84026af38c 100644 --- a/apps/mobile/test/model-settings.test.ts +++ b/apps/mobile/test/model-settings.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from 'vitest'; -import { loadBotModel } from '../src/host/bot-settings'; -import { createHostClient } from '../src/host/client'; +import { loadBotModel } from '@botharness/host-client/bot-settings'; +import { createHostClient } from '@botharness/host-client/client'; import { inheritModel, modelSettingsResource, @@ -10,8 +10,8 @@ import { setModelRoute, toggleAssignmentModel, type ModelSettingsState, -} from '../src/host/model-settings'; -import { FakeHost } from './fake-host'; +} from '@botharness/host-client/model-settings'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; const flash = { provider: 'deepseek', model: 'flash' }; const pro = { provider: 'deepseek', model: 'pro' }; diff --git a/apps/mobile/test/native-live-activity-multiple.test.tsx b/apps/mobile/test/native-live-activity-multiple.test.tsx index 9cf7161093..89c9efc527 100644 --- a/apps/mobile/test/native-live-activity-multiple.test.tsx +++ b/apps/mobile/test/native-live-activity-multiple.test.tsx @@ -1,6 +1,6 @@ import { afterEach, beforeEach, expect, it, vi } from 'vitest'; import { secure, remotes } from './host-session-fixture'; -import { FakeHost } from './fake-host'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; import type { ActivityTarget } from '../src/host/live-activity-session'; const native = vi.hoisted(() => ({ @@ -38,8 +38,8 @@ vi.mock('react-native', () => ({ })); vi.mock('../src/ui/strings', () => ({ locale: 'en', t: {} })); vi.mock('../src/ui/shell/recent-chats', () => ({ forgetRecentChats: async () => {} })); -vi.mock('../src/host/live-activity', async (original) => ({ - ...(await original()), +vi.mock('@botharness/host-client/live-activity', async (original) => ({ + ...(await original()), createHostActivity: () => ({ request: native.remote }), })); vi.mock('../src/ui/widgets/request-activity', () => { diff --git a/apps/mobile/test/native-live-activity.test.tsx b/apps/mobile/test/native-live-activity.test.tsx index e06e9ead85..faed93c5f8 100644 --- a/apps/mobile/test/native-live-activity.test.tsx +++ b/apps/mobile/test/native-live-activity.test.tsx @@ -87,8 +87,8 @@ vi.mock('../src/host/host-session', () => ({ }; }, })); -vi.mock('../src/host/live-activity', async (original) => ({ - ...(await original()), +vi.mock('@botharness/host-client/live-activity', async (original) => ({ + ...(await original()), createHostActivity: () => ({ request: device.remote }), })); vi.mock('../src/ui/widgets/request-activity', () => ({ diff --git a/apps/mobile/test/native-text-row.test.ts b/apps/mobile/test/native-text-row.test.ts index 9490444365..a5b37f42cf 100644 --- a/apps/mobile/test/native-text-row.test.ts +++ b/apps/mobile/test/native-text-row.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest'; -import type { ConversationMessage } from '../src/host/conversation'; +import type { ConversationMessage } from '@botharness/host-client/conversation'; import type { ChatRow } from '../src/ui/chat/message-groups'; import { nativeMarkdown, nativeTextRow, plainText } from '../src/ui/chat/native-text-row'; diff --git a/apps/mobile/test/node-carrier.ts b/apps/mobile/test/node-carrier.ts index 402129dc87..213a56dc1d 100644 --- a/apps/mobile/test/node-carrier.ts +++ b/apps/mobile/test/node-carrier.ts @@ -1,4 +1,4 @@ -import type { HostCarrier } from '../src/host/carrier'; +import type { HostCarrier } from '@botharness/host-protocol/carrier'; export function nodeCarrier(): HostCarrier { let cookie = ''; diff --git a/apps/mobile/test/node-sql-connection.ts b/apps/mobile/test/node-sql-connection.ts index 18c5b928e5..7823d5e582 100644 --- a/apps/mobile/test/node-sql-connection.ts +++ b/apps/mobile/test/node-sql-connection.ts @@ -1,6 +1,6 @@ import { DatabaseSync } from 'node:sqlite'; -import type { SqlConnection, SqlValue } from '../src/host/local-store'; +import type { SqlConnection, SqlValue } from '@botharness/host-client/local-store'; export function nodeSqlConnection( path = ':memory:', diff --git a/apps/mobile/test/noise-key-agreement.test.ts b/apps/mobile/test/noise-key-agreement.test.ts index 00a927cecb..82de45f3f3 100644 --- a/apps/mobile/test/noise-key-agreement.test.ts +++ b/apps/mobile/test/noise-key-agreement.test.ts @@ -1,6 +1,6 @@ import { expect, it } from 'vitest'; import { x25519 } from '@noble/curves/ed25519.js'; -import { NoiseXk } from '../../../packages/core/src/devices/noise/xk'; +import { NoiseXk } from '@botharness/host-protocol/noise/xk'; import vector from '../../../packages/core/test/fixtures/noise/xk-cacophony.json'; import { noiseKeyAgreement as android } from '../src/host/noise-key-agreement.android'; import { noiseKeyAgreement as fallback } from '../src/host/noise-key-agreement'; diff --git a/apps/mobile/test/notification-avatars.test.ts b/apps/mobile/test/notification-avatars.test.ts index 5ecbb3d016..563b16d7ee 100644 --- a/apps/mobile/test/notification-avatars.test.ts +++ b/apps/mobile/test/notification-avatars.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it, vi } from 'vitest'; -import type { RosterBot, RosterChannel, RosterView } from '../src/host/client'; +import type { RosterBot, RosterChannel, RosterView } from '@botharness/host-client/client'; import { avatarFile, avatarInputs, diff --git a/apps/mobile/test/notification-discovery.test.ts b/apps/mobile/test/notification-discovery.test.ts index e770ae467f..dfd3f9608b 100644 --- a/apps/mobile/test/notification-discovery.test.ts +++ b/apps/mobile/test/notification-discovery.test.ts @@ -1,7 +1,7 @@ import { expect, it, vi } from 'vitest'; -import { createInbox, prepareNotificationBaseline } from '../src/host/inbox'; -import type { HostClient } from '../src/host/client'; -import type { HumanAttentionItem } from '../src/host/wire'; +import { createInbox, prepareNotificationBaseline } from '@botharness/host-client/inbox'; +import type { HostClient } from '@botharness/host-client/client'; +import type { HumanAttentionItem } from '@botharness/host-protocol/wire'; const item = (id: string): HumanAttentionItem => ({ id, diff --git a/apps/mobile/test/notification-idle.android.test.tsx b/apps/mobile/test/notification-idle.android.test.tsx index 145e119078..fcb95c5f0a 100644 --- a/apps/mobile/test/notification-idle.android.test.tsx +++ b/apps/mobile/test/notification-idle.android.test.tsx @@ -10,8 +10,8 @@ vi.mock('react-native', async () => ({ Platform: { OS: 'android' }, })); vi.mock('react-native-svg', () => ({ default: () => null, Path: () => null })); -vi.mock('../src/host/pairing', () => ({ DEVICE_PREFIX: '/botharness-device' })); -vi.mock('../src/host/encrypted-carrier', () => ({ encryptedCarrier: vi.fn() })); +vi.mock('@botharness/host-client/pairing', () => ({ DEVICE_PREFIX: '/botharness-device' })); +vi.mock('@botharness/host-client/encrypted-carrier', () => ({ encryptedCarrier: vi.fn() })); vi.mock( '../src/ui/primitives/settings-list-item', () => import('../src/ui/primitives/settings-list-item.android'), @@ -34,9 +34,9 @@ vi.mock('@expo/ui/jetpack-compose', async () => { }; }); -import { createDeviceNotificationPreferences } from '../src/host/device-notification-preferences'; -import type { SavedHost } from '../src/host/hosts'; -import type { PushSettings } from '../src/host/push'; +import { createDeviceNotificationPreferences } from '@botharness/host-client/device-notification-preferences'; +import type { SavedHost } from '@botharness/host-client/hosts'; +import type { PushSettings } from '@botharness/host-client/push'; import { NotificationSettings } from '../src/ui/notification-settings'; import { t } from '../src/ui/strings'; diff --git a/apps/mobile/test/notification-preferences-web.test.ts b/apps/mobile/test/notification-preferences-web.test.ts index 6b894d560d..6d72e58d08 100644 --- a/apps/mobile/test/notification-preferences-web.test.ts +++ b/apps/mobile/test/notification-preferences-web.test.ts @@ -2,8 +2,8 @@ import { beforeEach, expect, it, vi } from 'vitest'; vi.mock('../src/host/native-carrier', () => ({ nativeCarrier: () => ({}) })); -vi.mock('../src/host/push', async (original) => ({ - ...(await original()), +vi.mock('@botharness/host-client/push', async (original) => ({ + ...(await original()), createHostPush: () => ({ settings: vi.fn(), setPreferences: vi.fn() }), })); diff --git a/apps/mobile/test/notification-settings.test.tsx b/apps/mobile/test/notification-settings.test.tsx index ce189b6f3e..0761a47520 100644 --- a/apps/mobile/test/notification-settings.test.tsx +++ b/apps/mobile/test/notification-settings.test.tsx @@ -8,7 +8,7 @@ vi.mock('expo-symbols', () => ({ SymbolView: () => null })); vi.mock('react-native', () => import('./react-native-shim')); vi.mock('react-native-svg', () => ({ default: () => null, Path: () => null })); -import { PushRequestFailed, type PushSettings } from '../src/host/push'; +import { PushRequestFailed, type PushSettings } from '@botharness/host-client/push'; import { NotificationSettings, type NotificationSettingsPort, diff --git a/apps/mobile/test/pair-image-trust.test.ts b/apps/mobile/test/pair-image-trust.test.ts index e1a98e837c..7b758e6d69 100644 --- a/apps/mobile/test/pair-image-trust.test.ts +++ b/apps/mobile/test/pair-image-trust.test.ts @@ -1,8 +1,8 @@ import { expect, it, vi } from 'vitest'; -import { noiseFingerprint } from '../../../packages/core/src/devices/noise/xk'; -import type { HostCarrier } from '../src/host/carrier'; -import { pairHost } from '../src/host/pairing'; +import { noiseFingerprint } from '@botharness/host-protocol/noise/xk'; +import type { HostCarrier } from '@botharness/host-protocol/carrier'; +import { pairHost } from '@botharness/host-client/pairing'; function imageLink(expiresAt = '2099-01-01T00:00:00Z'): string { return ( diff --git a/apps/mobile/test/pairing-certificate.test.ts b/apps/mobile/test/pairing-certificate.test.ts index a026614c06..9fe908e358 100644 --- a/apps/mobile/test/pairing-certificate.test.ts +++ b/apps/mobile/test/pairing-certificate.test.ts @@ -1,5 +1,5 @@ import { expect, it } from 'vitest'; -import { channelFailure } from '../src/host/pairing'; +import { channelFailure } from '@botharness/host-client/pairing'; import { pairingFailureText } from '../src/ui/pairing-failure'; import { interfacePreferences } from '../src/ui/interface-preferences'; diff --git a/apps/mobile/test/pairing-failure-cause.test.ts b/apps/mobile/test/pairing-failure-cause.test.ts index 288f43fe9e..acb7923b67 100644 --- a/apps/mobile/test/pairing-failure-cause.test.ts +++ b/apps/mobile/test/pairing-failure-cause.test.ts @@ -1,6 +1,10 @@ import { describe, expect, it, vi } from 'vitest'; -import type { HostCarrier, HostSocketEvents } from '../src/host/carrier'; -import { channelFailure, redeemPairing, type PairingPayload } from '../src/host/pairing'; +import type { HostCarrier, HostSocketEvents } from '@botharness/host-protocol/carrier'; +import { + channelFailure, + redeemPairing, + type PairingPayload, +} from '@botharness/host-client/pairing'; import { channelFailureDetail, isPairingFailureDetail, @@ -8,8 +12,8 @@ import { pairingDiagnostics, relayFailureDetail, reasonCode, -} from '../src/host/pairing-detail'; -import { sanitizeEvent } from '../src/telemetry/schema'; +} from '@botharness/host-protocol/pairing-detail'; +import { sanitizeEvent } from '@botharness/host-client/telemetry/schema'; const LAN = 'http://192.168.1.20:3080'; const CONNECT = 'https://abc123.deepseekbot.dev'; diff --git a/apps/mobile/test/pairing-private-origins.test.ts b/apps/mobile/test/pairing-private-origins.test.ts index 59bea20568..0a6f956777 100644 --- a/apps/mobile/test/pairing-private-origins.test.ts +++ b/apps/mobile/test/pairing-private-origins.test.ts @@ -1,6 +1,6 @@ import { expect, it, vi } from 'vitest'; -import { redeemPairing } from '../src/host/pairing'; -import type { HostCarrier } from '../src/host/carrier'; +import { redeemPairing } from '@botharness/host-client/pairing'; +import type { HostCarrier } from '@botharness/host-protocol/carrier'; const origin = 'https://primary.example'; const backup = 'https://backup.example'; diff --git a/apps/mobile/test/pairing-route-update.test.ts b/apps/mobile/test/pairing-route-update.test.ts index 4e42adb211..87e491ba94 100644 --- a/apps/mobile/test/pairing-route-update.test.ts +++ b/apps/mobile/test/pairing-route-update.test.ts @@ -1,10 +1,10 @@ import { randomBytes } from 'node:crypto'; import { expect, it, vi } from 'vitest'; -import { ConnectChannel } from '../../../packages/core/src/devices/noise/channel'; -import { noisePublicKey } from '../../../packages/core/src/devices/noise/xk'; -import { updatePairedRoutes } from '../src/host/pairing'; -import type { HostCarrier } from '../src/host/carrier'; -import type { SavedHost } from '../src/host/hosts'; +import { ConnectChannel } from '@botharness/host-protocol/noise/channel'; +import { noisePublicKey } from '@botharness/host-protocol/noise/xk'; +import { updatePairedRoutes } from '@botharness/host-client/pairing'; +import type { HostCarrier } from '@botharness/host-protocol/carrier'; +import type { SavedHost } from '@botharness/host-client/hosts'; it('updates scanned Tailscale addresses over pinned encryption with the existing device credential', async () => { const key = randomBytes(32); diff --git a/apps/mobile/test/pairing-telemetry.test.ts b/apps/mobile/test/pairing-telemetry.test.ts index d67849709b..e7b3170588 100644 --- a/apps/mobile/test/pairing-telemetry.test.ts +++ b/apps/mobile/test/pairing-telemetry.test.ts @@ -1,7 +1,7 @@ import { expect, it, vi } from 'vitest'; -import { SavedHostsWriteError } from '../src/host/hosts'; -import { pairHost } from '../src/host/pairing'; -import { FakeHost } from './fake-host'; +import { SavedHostsWriteError } from '@botharness/host-client/hosts'; +import { pairHost } from '@botharness/host-client/pairing'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; it('counts a submitted invalid link once and requires saved-Host persistence for success', async () => { const finish = vi.fn(); diff --git a/apps/mobile/test/pairing-verification.test.tsx b/apps/mobile/test/pairing-verification.test.tsx index 49d0f08569..cff9e21145 100644 --- a/apps/mobile/test/pairing-verification.test.tsx +++ b/apps/mobile/test/pairing-verification.test.tsx @@ -45,10 +45,10 @@ vi.mock('../src/host/native-conversation-filter', () => ({ vi.mock('../src/telemetry/native', () => ({ mobileTelemetry: { pairing: () => ({ finish: () => {} }) }, })); -vi.mock('../src/host/pairing', () => ({ pairHost: mocks.pairHost })); +vi.mock('@botharness/host-client/pairing', () => ({ pairHost: mocks.pairHost })); -import type { pairHost } from '../src/host/pairing'; -import type { SavedHost } from '../src/host/hosts'; +import type { pairHost } from '@botharness/host-client/pairing'; +import type { SavedHost } from '@botharness/host-client/hosts'; import { computerEnvironmentKey } from '../src/host/conversation-environments'; import { PairingVerification } from '../src/ui/shell/pairing-verification'; import { usePairing } from '../src/ui/shell/use-pairing'; @@ -316,7 +316,9 @@ it('refuses an alternate registration of an already saved Host before opening a mocks.getState.mockReturnValue({ hosts: [{ hostId: 'already-saved', encryption: { hostKey: '11'.repeat(32) } }], }); - const actual = await vi.importActual('../src/host/pairing'); + const actual = await vi.importActual( + '@botharness/host-client/pairing', + ); mocks.pairHost.mockImplementation(actual.pairHost); await act(async () => { expect( diff --git a/apps/mobile/test/phone-connection-recovery.test.ts b/apps/mobile/test/phone-connection-recovery.test.ts index f94123e3ba..8e7cebfb5e 100644 --- a/apps/mobile/test/phone-connection-recovery.test.ts +++ b/apps/mobile/test/phone-connection-recovery.test.ts @@ -1,6 +1,10 @@ import { afterEach, expect, it, vi } from 'vitest'; -import { createHostClient, type HostClient, type HostSnapshot } from '../src/host/client'; -import { FakeHost } from './fake-host'; +import { + createHostClient, + type HostClient, + type HostSnapshot, +} from '@botharness/host-client/client'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; const PRIMARY = 'https://studio.tailnet-example.ts.net'; const SECONDARY = 'https://studio.alternate.ts.net'; diff --git a/apps/mobile/test/pinned-list.test.ts b/apps/mobile/test/pinned-list.test.ts index e3755d0c9d..46260c8abf 100644 --- a/apps/mobile/test/pinned-list.test.ts +++ b/apps/mobile/test/pinned-list.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest'; import { chatList } from '../src/ui/chat/conversations'; -import type { RosterView } from '../src/host/client'; +import type { RosterView } from '@botharness/host-client/client'; describe('Pinned virtual list projection (not native geometry evidence)', () => { it('projects one flat-list item per pin alongside ordinary rows and keeps collapse counts', () => { diff --git a/apps/mobile/test/posthog-sender.test.ts b/apps/mobile/test/posthog-sender.test.ts index dd16f068a3..10ed740257 100644 --- a/apps/mobile/test/posthog-sender.test.ts +++ b/apps/mobile/test/posthog-sender.test.ts @@ -4,8 +4,8 @@ const require = createRequire(import.meta.url); const shim = require('./posthog-native-shim.cjs'); const { createPostHogSender } = await import('../src/telemetry/posthog-sender'); shim.restore(); -import type { TelemetryEvent } from '../src/telemetry/schema'; -import { createMobileTelemetry } from '../src/telemetry/mobile-telemetry'; +import type { TelemetryEvent } from '@botharness/host-client/telemetry/schema'; +import { createMobileTelemetry } from '@botharness/host-client/telemetry/mobile-telemetry'; const event: TelemetryEvent = { event: 'app:app_open', diff --git a/apps/mobile/test/private-relay.test.ts b/apps/mobile/test/private-relay.test.ts index 3e2c29a7d9..fef768cab4 100644 --- a/apps/mobile/test/private-relay.test.ts +++ b/apps/mobile/test/private-relay.test.ts @@ -1,9 +1,13 @@ import { describe, expect, it, vi } from 'vitest'; -import { checkRoute } from '../src/host/route'; -import { parseEncryption, parseSavedHost, parsePrivateAdmission } from '../src/host/hosts'; -import { parsePairingLink, pairingLinkMode, redeemPairing } from '../src/host/pairing'; -import { encryptedCarrier } from '../src/host/encrypted-carrier'; -import { learnedRoutes } from '../src/host/learned-routes'; +import { checkRoute } from '@botharness/host-protocol/route'; +import { + parseEncryption, + parseSavedHost, + parsePrivateAdmission, +} from '@botharness/host-client/hosts'; +import { parsePairingLink, pairingLinkMode, redeemPairing } from '@botharness/host-client/pairing'; +import { encryptedCarrier } from '@botharness/host-client/encrypted-carrier'; +import { learnedRoutes } from '@botharness/host-client/learned-routes'; const admission = { origin: 'https://relay.example.com', token: 'ab'.repeat(32) }; const encryption = { diff --git a/apps/mobile/test/profile-navigation.test.tsx b/apps/mobile/test/profile-navigation.test.tsx index 920b8ab63a..9bd379db7e 100644 --- a/apps/mobile/test/profile-navigation.test.tsx +++ b/apps/mobile/test/profile-navigation.test.tsx @@ -4,15 +4,19 @@ import { act, use, useLayoutEffect } from 'react'; import { createRoot, type Root } from 'react-dom/client'; import { afterEach, expect, it, vi } from 'vitest'; import { StackRouter } from '../node_modules/expo-router/build/react-navigation/routers/StackRouter.js'; -import type { ConversationSnapshot } from '../src/host/conversation'; -import { createHostClient, type HostClient, type HostSnapshot } from '../src/host/client'; +import type { ConversationSnapshot } from '@botharness/host-client/conversation'; +import { + createHostClient, + type HostClient, + type HostSnapshot, +} from '@botharness/host-client/client'; import { channelRouteId, channelStackRouter, navigateChannel, } from '../src/ui/shell/channel-navigation'; import { t } from '../src/ui/strings'; -import { FakeHost } from './fake-host'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; import { ChannelFilesScreen } from '../src/ui/chat/channel-files-screen'; import { ChannelFilesTab } from '../src/ui/chat/channel-files-tab'; import { HostScope } from '../src/host/host-scope'; diff --git a/apps/mobile/test/profile-page-target.test.ts b/apps/mobile/test/profile-page-target.test.ts index aede5d626f..9f921f2345 100644 --- a/apps/mobile/test/profile-page-target.test.ts +++ b/apps/mobile/test/profile-page-target.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest'; -import type { RosterView } from '../src/host/client'; +import type { RosterView } from '@botharness/host-client/client'; import { profilePageTarget } from '../src/ui/chat/profile-page-target'; const roster: RosterView = { diff --git a/apps/mobile/test/profile-routines.test.tsx b/apps/mobile/test/profile-routines.test.tsx index 6daf84160d..58b15647c5 100644 --- a/apps/mobile/test/profile-routines.test.tsx +++ b/apps/mobile/test/profile-routines.test.tsx @@ -18,7 +18,7 @@ vi.mock('../src/ui/primitives/app-dialog', () => ({ showActionMenu: vi.fn(), })); -import type { BotScheduleSummary, ScheduleTrigger } from '../src/host/wire'; +import type { BotScheduleSummary, ScheduleTrigger } from '@botharness/host-protocol/wire'; import { routineGroupOf, routineGroups, diff --git a/apps/mobile/test/purge-caches.test.ts b/apps/mobile/test/purge-caches.test.ts index 5f1ffe7d87..c892f0b65c 100644 --- a/apps/mobile/test/purge-caches.test.ts +++ b/apps/mobile/test/purge-caches.test.ts @@ -82,13 +82,13 @@ vi.mock('expo-file-system', () => { return { Directory, File, Paths: { cache: 'cache' } }; }); -const { installMediaStore, cacheMedia } = await import('../src/host/media-cache'); +const { installMediaStore, cacheMedia } = await import('@botharness/host-client/media-cache'); const { nativeMediaStore } = await import('../src/host/native-media-store'); const { cachedAttachmentUri } = await import('../src/host/share-attachment'); const { nativeConversationCache } = await import('../src/host/native-cache'); const { createPurgeCaches, purgedPlacements } = await import('../src/host/purge-caches'); const { nativePurgeTargets } = await import('../src/host/native-purge-targets'); -const { mediaCacheKey } = await import('../src/host/conversation'); +const { mediaCacheKey } = await import('@botharness/host-client/conversation'); installMediaStore(nativeMediaStore); const signal = new AbortController().signal; diff --git a/apps/mobile/test/push-answer.test.ts b/apps/mobile/test/push-answer.test.ts index 19bd75a36b..5132a70660 100644 --- a/apps/mobile/test/push-answer.test.ts +++ b/apps/mobile/test/push-answer.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest'; -import type { SavedHost } from '../src/host/hosts'; +import type { SavedHost } from '@botharness/host-client/hosts'; import { answerInPlace, type AnswerPort } from '../src/host/push-answer'; import type { PushDecision } from '../src/host/push-actions'; diff --git a/apps/mobile/test/push-navigation.test.tsx b/apps/mobile/test/push-navigation.test.tsx index f6999ecc5c..e3c10d659b 100644 --- a/apps/mobile/test/push-navigation.test.tsx +++ b/apps/mobile/test/push-navigation.test.tsx @@ -4,7 +4,7 @@ import { createRoot, type Root } from 'react-dom/client'; import { afterEach, beforeEach, expect, it, vi } from 'vitest'; import { View } from 'react-native'; import { StackRouter } from '../node_modules/expo-router/build/react-navigation/routers/StackRouter.js'; -import type { HostSnapshot } from '../src/host/client'; +import type { HostSnapshot } from '@botharness/host-client/client'; import { channelRouteId } from '../src/ui/shell/channel-navigation'; import { t } from '../src/ui/strings'; import { createHostDrawer } from '../src/ui/shell/host-drawer-model'; @@ -54,7 +54,7 @@ vi.mock('../src/host/native-conversation-filter', async () => { conversationFilter: createConversationFilter({ read: async () => undefined, write() {} }), }; }); -vi.mock('../src/host/client', () => ({ +vi.mock('@botharness/host-client/client', () => ({ createHostClient: () => ({ stop() {}, call: async () => { diff --git a/apps/mobile/test/push-routing-multiple.test.tsx b/apps/mobile/test/push-routing-multiple.test.tsx index fece4ad61f..43601e052c 100644 --- a/apps/mobile/test/push-routing-multiple.test.tsx +++ b/apps/mobile/test/push-routing-multiple.test.tsx @@ -5,7 +5,7 @@ import { act, createElement } from 'react'; import { createRoot } from 'react-dom/client'; import { expect, it, vi } from 'vitest'; import { secure, remotes, notificationTaps } from './host-session-fixture'; -import { FakeHost } from './fake-host'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; import { View } from 'react-native'; vi.mock('react-native', () => import('./react-native-shim')); const push = vi.fn(); diff --git a/apps/mobile/test/push-token-lifecycle.test.ts b/apps/mobile/test/push-token-lifecycle.test.ts index c2f8cef01f..61915187fd 100644 --- a/apps/mobile/test/push-token-lifecycle.test.ts +++ b/apps/mobile/test/push-token-lifecycle.test.ts @@ -1,8 +1,8 @@ import { afterEach, expect, it, vi } from 'vitest'; import { createPushSession, type NotificationsPort } from '../src/host/push-session'; -import type { HostPush, PushSettings } from '../src/host/push'; -import type { SavedHost } from '../src/host/hosts'; +import type { HostPush, PushSettings } from '@botharness/host-client/push'; +import type { SavedHost } from '@botharness/host-client/hosts'; const host: SavedHost = { hostId: 'host', diff --git a/apps/mobile/test/push.test.ts b/apps/mobile/test/push.test.ts index bc5fdcbd9f..de76dda591 100644 --- a/apps/mobile/test/push.test.ts +++ b/apps/mobile/test/push.test.ts @@ -21,8 +21,13 @@ import { withHost, withoutHost, type SavedHost, -} from '../src/host/hosts'; -import { createHostPush, parsePushData, pushHref, PushRequestFailed } from '../src/host/push'; +} from '@botharness/host-client/hosts'; +import { + createHostPush, + parsePushData, + pushHref, + PushRequestFailed, +} from '@botharness/host-client/push'; import { decideFromPush, registerApprovalCategories, diff --git a/apps/mobile/test/reaction-chips-exit.test.ts b/apps/mobile/test/reaction-chips-exit.test.ts index e22ecedd96..6ec4e535e3 100644 --- a/apps/mobile/test/reaction-chips-exit.test.ts +++ b/apps/mobile/test/reaction-chips-exit.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest'; -import type { ConversationReaction } from '../src/host/conversation'; +import type { ConversationReaction } from '@botharness/host-client/conversation'; import { shownReactions } from '../src/ui/chat/reaction-presence'; const reaction = (emoji: string, count = 1): ConversationReaction => ({ diff --git a/apps/mobile/test/recovery-summary.test.ts b/apps/mobile/test/recovery-summary.test.ts index 4b25748ed7..8702f71d1e 100644 --- a/apps/mobile/test/recovery-summary.test.ts +++ b/apps/mobile/test/recovery-summary.test.ts @@ -1,6 +1,6 @@ import { it, expect } from 'vitest'; import { createAlertBanners } from '../src/host/alert-banners'; -import { parsePushData, pushHref } from '../src/host/push'; +import { parsePushData, pushHref } from '@botharness/host-client/push'; import type { LocalApprovalAlert } from '../src/host/device-alerts'; const summary: LocalApprovalAlert = { diff --git a/apps/mobile/test/remote-keyboard-input.test.ts b/apps/mobile/test/remote-keyboard-input.test.ts index 02d5039ec4..559ef7e3c3 100644 --- a/apps/mobile/test/remote-keyboard-input.test.ts +++ b/apps/mobile/test/remote-keyboard-input.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it, vi } from 'vitest'; -import { createRemoteKeyboardInput } from '../src/host/remote-keyboard-input'; +import { createRemoteKeyboardInput } from '@botharness/host-client/remote-keyboard-input'; import type { DesktopInput } from '../../../packages/computer/src/desktop-view'; const key: DesktopInput = { kind: 'key', key: 'backspace', modifiers: [] }; diff --git a/apps/mobile/test/reply-haptic.test.tsx b/apps/mobile/test/reply-haptic.test.tsx index 346e88243b..e1b7cfcfdd 100644 --- a/apps/mobile/test/reply-haptic.test.tsx +++ b/apps/mobile/test/reply-haptic.test.tsx @@ -4,7 +4,7 @@ import { createRoot } from 'react-dom/client'; import { afterEach, expect, it, vi } from 'vitest'; import { createConversationPlayback, type BubblePlayback } from '../src/host/conversation-playback'; -import type { ConversationSnapshot } from '../src/host/conversation'; +import type { ConversationSnapshot } from '@botharness/host-client/conversation'; import { useReplyHaptic } from '../src/ui/chat/reply-haptic'; import { haptic, setHapticsEnabled, type HapticMoment } from '../src/ui/haptics'; import { played } from './expo-haptics-shim'; diff --git a/apps/mobile/test/root-alert-insets.test.tsx b/apps/mobile/test/root-alert-insets.test.tsx index 49ff65d1bd..e25aa91484 100644 --- a/apps/mobile/test/root-alert-insets.test.tsx +++ b/apps/mobile/test/root-alert-insets.test.tsx @@ -86,7 +86,7 @@ vi.mock('../src/ui/chat/call-session-host', () => ({ CallSessionHost: () => null vi.mock('../src/host/native-media-store', () => ({ nativeMediaStore: undefined })); vi.mock('../src/host/native-local-store', () => ({ nativeHostStoreOpener: undefined })); vi.mock('../src/host/native-purge-targets', () => ({ nativePurgeTargets: undefined })); -vi.mock('../src/host/media-cache', () => ({ +vi.mock('@botharness/host-client/media-cache', () => ({ installMediaStore: () => undefined, runAutoCleanup: () => undefined, })); diff --git a/apps/mobile/test/roster-sorting.test.ts b/apps/mobile/test/roster-sorting.test.ts index 2736174ed3..6c35fbd80f 100644 --- a/apps/mobile/test/roster-sorting.test.ts +++ b/apps/mobile/test/roster-sorting.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest'; -import { rosterSortingOf } from '../src/host/roster-sorting'; +import { rosterSortingOf } from '@botharness/host-client/roster-sorting'; describe('Host sorting settings projection', () => { it('reads only the canonical Web namespace and treats missing overrides as inherit', () => { diff --git a/apps/mobile/test/route-preference.test.ts b/apps/mobile/test/route-preference.test.ts index 0862c62950..dbb80202ae 100644 --- a/apps/mobile/test/route-preference.test.ts +++ b/apps/mobile/test/route-preference.test.ts @@ -1,7 +1,11 @@ import { afterEach, expect, it, vi } from 'vitest'; -import { createHostClient, type HostClient, type HostClientOptions } from '../src/host/client'; -import { parseSavedHost, serializeSavedHost } from '../src/host/hosts'; -import { FakeHost } from './fake-host'; +import { + createHostClient, + type HostClient, + type HostClientOptions, +} from '@botharness/host-client/client'; +import { parseSavedHost, serializeSavedHost } from '@botharness/host-client/hosts'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; const A = 'https://first.example.ts.net'; const B = 'https://second.example.ts.net'; diff --git a/apps/mobile/test/routine-sheet.test.tsx b/apps/mobile/test/routine-sheet.test.tsx index 8d087467c0..3d12d4db7a 100644 --- a/apps/mobile/test/routine-sheet.test.tsx +++ b/apps/mobile/test/routine-sheet.test.tsx @@ -30,7 +30,7 @@ vi.mock('../src/ui/shell/icons', async () => ({ })); import type { Routines } from '../src/host/routines'; -import type { BotScheduleFiring, BotScheduleSummary } from '../src/host/wire'; +import type { BotScheduleFiring, BotScheduleSummary } from '@botharness/host-protocol/wire'; import { RoutineSheet } from '../src/ui/chat/routine-sheet'; import { t } from '../src/ui/strings'; diff --git a/apps/mobile/test/routines.test.ts b/apps/mobile/test/routines.test.ts index 41bf8d0b73..256cac8f24 100644 --- a/apps/mobile/test/routines.test.ts +++ b/apps/mobile/test/routines.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest'; -import { createHostClient } from '../src/host/client'; +import { createHostClient } from '@botharness/host-client/client'; import { botRoutines, newRoutineForm, @@ -10,9 +10,9 @@ import { routineTriggerOf, type RoutineForm, } from '../src/host/routines'; -import type { BotScheduleSummary } from '../src/host/wire'; +import type { BotScheduleSummary } from '@botharness/host-protocol/wire'; import { t } from '../src/ui/strings'; -import { FakeHost } from './fake-host'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; import profileWire from './fixtures/profile-wire.json'; const ROUTE = 'https://studio.tailnet-example.ts.net'; diff --git a/apps/mobile/test/session-failure.test.ts b/apps/mobile/test/session-failure.test.ts index 995174516a..c0afbf1fc0 100644 --- a/apps/mobile/test/session-failure.test.ts +++ b/apps/mobile/test/session-failure.test.ts @@ -3,7 +3,7 @@ import { sessionFailure, createFailureContinuation, createFailureMaintenance, -} from '../src/host/session-failure'; +} from '@botharness/host-client/session-failure'; it('preserves failure identity for recovery without interpreting max-tokens as overflow', () => { const failure = sessionFailure({ diff --git a/apps/mobile/test/session-stop.test.ts b/apps/mobile/test/session-stop.test.ts index 486bae1952..0fd575eaf5 100644 --- a/apps/mobile/test/session-stop.test.ts +++ b/apps/mobile/test/session-stop.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it, vi } from 'vitest'; -import type { RosterBot } from '../src/host/client'; +import type { RosterBot } from '@botharness/host-client/client'; import { liveStopping, runningSessionCount, diff --git a/apps/mobile/test/share-attachment.test.ts b/apps/mobile/test/share-attachment.test.ts index 0caab1ee04..e95d7c8370 100644 --- a/apps/mobile/test/share-attachment.test.ts +++ b/apps/mobile/test/share-attachment.test.ts @@ -1,6 +1,6 @@ import { beforeEach, expect, it, vi } from 'vitest'; import { shareAttachment } from '../src/host/share-attachment'; -import type { MessageAttachment } from '../src/host/conversation'; +import type { MessageAttachment } from '@botharness/host-client/conversation'; const native = vi.hoisted(() => ({ download: vi.fn(), share: vi.fn(), write: vi.fn() })); vi.mock('expo-sharing', () => ({ shareAsync: native.share })); diff --git a/apps/mobile/test/share-versioned.test.ts b/apps/mobile/test/share-versioned.test.ts index d365b0fba5..d7b789346c 100644 --- a/apps/mobile/test/share-versioned.test.ts +++ b/apps/mobile/test/share-versioned.test.ts @@ -63,7 +63,7 @@ vi.mock('expo-file-system', () => { return { Directory, File, Paths: { cache: 'cache' } }; }); -const { installMediaStore } = await import('../src/host/media-cache'); +const { installMediaStore } = await import('@botharness/host-client/media-cache'); const { nativeMediaStore } = await import('../src/host/native-media-store'); const { cachedAttachmentUri, shareAttachment } = await import('../src/host/share-attachment'); installMediaStore(nativeMediaStore); diff --git a/apps/mobile/test/source-name.test.tsx b/apps/mobile/test/source-name.test.tsx index f488a66592..f1e7992317 100644 --- a/apps/mobile/test/source-name.test.tsx +++ b/apps/mobile/test/source-name.test.tsx @@ -14,7 +14,7 @@ vi.mock('react-native-svg', () => ({ Circle: () => null, })); -import { hostColorInk } from '../src/ui/design/host-look'; +import { hostColorInk } from '@botharness/host-client/ui/design/host-look'; import { resolveTheme } from '../src/ui/design/resolve-theme'; import { SourceName } from '../src/ui/chat/source-name'; diff --git a/apps/mobile/test/statistics-settings.test.tsx b/apps/mobile/test/statistics-settings.test.tsx index b757f347b8..f6ec8c20aa 100644 --- a/apps/mobile/test/statistics-settings.test.tsx +++ b/apps/mobile/test/statistics-settings.test.tsx @@ -3,7 +3,10 @@ import { act, createElement, type ComponentProps } from 'react'; import { createRoot, type Root } from 'react-dom/client'; import { afterEach, expect, it, vi } from 'vitest'; vi.mock('expo-symbols', () => ({ SymbolView: () => null })); -import { createMobileTelemetry, type MobileTelemetry } from '../src/telemetry/mobile-telemetry'; +import { + createMobileTelemetry, + type MobileTelemetry, +} from '@botharness/host-client/telemetry/mobile-telemetry'; import type { Toggle } from '../src/ui/primitives/toggle'; const native = vi.hoisted(() => ({ telemetry: undefined as MobileTelemetry | undefined })); diff --git a/apps/mobile/test/storage-settings.test.tsx b/apps/mobile/test/storage-settings.test.tsx index 388ec6b4bb..a8db0d2d16 100644 --- a/apps/mobile/test/storage-settings.test.tsx +++ b/apps/mobile/test/storage-settings.test.tsx @@ -12,8 +12,8 @@ vi.mock('react-native', async () => ({ })); vi.mock('react-native-svg', () => ({ default: () => null, Path: () => null })); -import { MethodRefused } from '../src/host/client'; -import type { StorageCleanupPreview, StorageUsage } from '../src/host/storage'; +import { MethodRefused } from '@botharness/host-client/client'; +import type { StorageCleanupPreview, StorageUsage } from '@botharness/host-client/storage'; import { StorageSettings, type StorageSettingsPort } from '../src/ui/storage-settings'; import { t } from '../src/ui/strings'; diff --git a/apps/mobile/test/team-members.test.ts b/apps/mobile/test/team-members.test.ts index 951a4293a8..5f36ef4443 100644 --- a/apps/mobile/test/team-members.test.ts +++ b/apps/mobile/test/team-members.test.ts @@ -1,19 +1,22 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'; import { randomBytes } from 'node:crypto'; -import { parseTeamInvitation, type TeamInvitation } from '../src/host/team-invitation'; +import { + parseTeamInvitation, + type TeamInvitation, +} from '@botharness/host-protocol/team-invitation'; import { changeTeamDevicePassword, signInTeamDevice, memberPairingOffer, -} from '../src/host/team-client'; +} from '@botharness/host-client/team-client'; import { memberPasswordGate, prepareMemberIdentity, identitySwitchRequired, -} from '../src/host/member-identity'; -import { parseSavedHosts, withHost, type SavedHost } from '../src/host/hosts'; -import type { HostCarrier } from '../src/host/carrier'; -import { noiseFingerprint, noisePublicKey } from '../../../packages/core/src/devices/noise/xk'; +} from '@botharness/host-client/member-identity'; +import { parseSavedHosts, withHost, type SavedHost } from '@botharness/host-client/hosts'; +import type { HostCarrier } from '@botharness/host-protocol/carrier'; +import { noiseFingerprint, noisePublicKey } from '@botharness/host-protocol/noise/xk'; const secure = new Map(); vi.mock('expo-secure-store', () => ({ diff --git a/apps/mobile/test/telemetry-device-context.test.ts b/apps/mobile/test/telemetry-device-context.test.ts index e75270debb..770ea64a91 100644 --- a/apps/mobile/test/telemetry-device-context.test.ts +++ b/apps/mobile/test/telemetry-device-context.test.ts @@ -1,6 +1,9 @@ import { expect, it } from 'vitest'; -import { deviceTelemetryContext, totalMemoryBucket } from '../src/telemetry/device-context'; -import { sanitizeEvent } from '../src/telemetry/schema'; +import { + deviceTelemetryContext, + totalMemoryBucket, +} from '@botharness/host-client/telemetry/device-context'; +import { sanitizeEvent } from '@botharness/host-client/telemetry/schema'; const context = deviceTelemetryContext({ osVersion: '26.1.2', diff --git a/apps/mobile/test/usage-screen.test.tsx b/apps/mobile/test/usage-screen.test.tsx index ce57b52dc9..47ee678e64 100644 --- a/apps/mobile/test/usage-screen.test.tsx +++ b/apps/mobile/test/usage-screen.test.tsx @@ -27,8 +27,8 @@ vi.mock('react-native-svg', () => ({ })); vi.mock('react-native-reanimated', () => import('./reanimated-shim')); -import type { OverviewMemory, OverviewUsage, UsagePeriod } from '../src/host/usage'; -import { MethodRefused } from '../src/host/client'; +import type { OverviewMemory, OverviewUsage, UsagePeriod } from '@botharness/host-client/usage'; +import { MethodRefused } from '@botharness/host-client/client'; import { dayLabel, trailingDays } from '../src/host/usage-days'; import { SettingsView, type SettingsActions } from '../src/ui/settings-view'; import { dayBars, daysLabel, tokenAmount } from '../src/ui/shell/usage-card'; diff --git a/apps/mobile/test/usage.test.ts b/apps/mobile/test/usage.test.ts index 4522d4ba72..0341349df8 100644 --- a/apps/mobile/test/usage.test.ts +++ b/apps/mobile/test/usage.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest'; -import { createHostClient, MethodRefused } from '../src/host/client'; +import { createHostClient, MethodRefused } from '@botharness/host-client/client'; import { loadMemoryActivity, loadMoreMemoryActivity, @@ -12,8 +12,8 @@ import { usageChartDays, type OverviewMemory, type OverviewUsage, -} from '../src/host/usage'; -import { FakeHost } from './fake-host'; +} from '@botharness/host-client/usage'; +import { FakeHost } from '../../../packages/host-client/test/fake-host.js'; import { trailingDays } from '../src/host/usage-days'; import usageWire from './fixtures/usage-wire.json'; diff --git a/apps/mobile/test/voice-call-carrier.test.ts b/apps/mobile/test/voice-call-carrier.test.ts index b944c912fd..bc7f478861 100644 --- a/apps/mobile/test/voice-call-carrier.test.ts +++ b/apps/mobile/test/voice-call-carrier.test.ts @@ -1,7 +1,7 @@ import { expect, it, vi } from 'vitest'; import { VOICE_CALL_PATH } from '../../../packages/core/src/voice/call-contract'; import { readCallReadiness } from '../../../packages/core/src/voice/call-client'; -import { createHostClient } from '../src/host/client'; +import { createHostClient } from '@botharness/host-client/client'; it('refuses Bot calls over Connect before any request leaves the phone', async () => { const raw = { request: vi.fn(), openSocket: vi.fn() }; diff --git a/apps/mobile/test/watch-account-hosts.test.ts b/apps/mobile/test/watch-account-hosts.test.ts index d1479681bc..55099e7022 100644 --- a/apps/mobile/test/watch-account-hosts.test.ts +++ b/apps/mobile/test/watch-account-hosts.test.ts @@ -1,6 +1,6 @@ import { expect, it, vi } from 'vitest'; import { watchAccountHosts } from '../src/host/watch-account-hosts'; -import type { ConnectHost } from '../src/host/connect-account'; +import type { ConnectHost } from '@botharness/host-client/connect-account'; const first: ConnectHost = { id: 'first', diff --git a/apps/mobile/test/wire-contract.ts b/apps/mobile/test/wire-contract.ts index 244f67751a..39a174dd54 100644 --- a/apps/mobile/test/wire-contract.ts +++ b/apps/mobile/test/wire-contract.ts @@ -52,7 +52,7 @@ import type { MuxServerFrame, PersonaBotSummary, RosterLiveFrame, -} from '../src/host/wire.js'; +} from '@botharness/host-protocol/wire'; type Assert = T; type Accepts = [Host] extends [App] ? true : false; diff --git a/apps/mobile/test/working-status.test.tsx b/apps/mobile/test/working-status.test.tsx index 8a198aded7..f24093279f 100644 --- a/apps/mobile/test/working-status.test.tsx +++ b/apps/mobile/test/working-status.test.tsx @@ -5,7 +5,7 @@ vi.mock('../src/ui/minute-clock', () => ({ useMinuteClock: () => new Date('2026-11-06T10:00:00Z'), })); -import type { RosterBot } from '../src/host/client'; +import type { RosterBot } from '@botharness/host-client/client'; vi.mock('react-native', async () => { const { useWindowDimensions, StyleSheet } = await import('./react-native-shim'); diff --git a/apps/mobile/test/workspace-lifecycle.test.tsx b/apps/mobile/test/workspace-lifecycle.test.tsx index 2dcde2cd5d..609741f3a5 100644 --- a/apps/mobile/test/workspace-lifecycle.test.tsx +++ b/apps/mobile/test/workspace-lifecycle.test.tsx @@ -101,7 +101,7 @@ vi.mock('../src/account/native-account-profile', () => ({ useAccountProfile: () => ({ status: 'signed-out' }), })); vi.mock('../src/host/native-carrier', () => ({ nativeCarrier: () => ({}) })); -vi.mock('../src/host/client', () => ({ +vi.mock('@botharness/host-client/client', () => ({ createHostClient: () => ({ call: async () => ({ items: [] }) }), })); vi.mock('../src/cloud/native', () => ({ diff --git a/apps/mobile/test/zip-import-file.test.ts b/apps/mobile/test/zip-import-file.test.ts index 4714ad7d6e..e49fa682ba 100644 --- a/apps/mobile/test/zip-import-file.test.ts +++ b/apps/mobile/test/zip-import-file.test.ts @@ -6,7 +6,7 @@ import { zipFile, ZIP_CHUNK_BYTES, ZIP_MAX_BYTES, -} from '../src/host/zip-import-file'; +} from '@botharness/host-client/zip-import-file'; const file = { fileId: '12345678-1234-1234-1234-123456789abc', diff --git a/apps/mobile/test/zip-import-upload.test.ts b/apps/mobile/test/zip-import-upload.test.ts index e56e856f12..152c199d92 100644 --- a/apps/mobile/test/zip-import-upload.test.ts +++ b/apps/mobile/test/zip-import-upload.test.ts @@ -1,7 +1,7 @@ import { createHash } from 'node:crypto'; import { describe, expect, it, vi } from 'vitest'; -import { uploadZip, type ZipImportSource } from '../src/host/zip-import-upload'; -import { ZIP_CHUNK_BYTES, type ZipFilePort } from '../src/host/zip-import-file'; +import { uploadZip, type ZipImportSource } from '@botharness/host-client/zip-import-upload'; +import { ZIP_CHUNK_BYTES, type ZipFilePort } from '@botharness/host-client/zip-import-file'; function fixture() { const bytes = new Uint8Array(ZIP_CHUNK_BYTES + 29).fill(4); diff --git a/docs/telemetry-events.md b/docs/telemetry-events.md index 73cb7d4912..24e2e21535 100644 --- a/docs/telemetry-events.md +++ b/docs/telemetry-events.md @@ -1,4 +1,4 @@ - + # Telemetry tracking plan diff --git a/package.json b/package.json index 8c9109a37a..6afff9add2 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "scripts": { "build": "tsdown", "typecheck": "tsc --noEmit && pnpm --filter @botharness/mobile typecheck", - "lint": "oxlint && node scripts/check-schema-migrations.mjs && node scripts/check-source-policy.mjs && node scripts/check-no-shell-scripts.mjs && node scripts/check-pr-evidence.mjs && pnpm changelog:check && node scripts/check-adr-numbers.mjs && node scripts/check-cli-parity.mjs && node scripts/check-tool-effects.mjs && node scripts/check-host-casts.mjs && node scripts/check-feature-map.mjs && node scripts/sync-bot-preset.mjs --check && node scripts/ci-plan.mjs --check && pnpm install:check", + "lint": "oxlint && node scripts/check-package-boundaries.mjs && node scripts/check-schema-migrations.mjs && node scripts/check-source-policy.mjs && node scripts/check-no-shell-scripts.mjs && node scripts/check-pr-evidence.mjs && pnpm changelog:check && node scripts/check-adr-numbers.mjs && node scripts/check-cli-parity.mjs && node scripts/check-tool-effects.mjs && node scripts/check-host-casts.mjs && node scripts/check-feature-map.mjs && node scripts/sync-bot-preset.mjs --check && node scripts/ci-plan.mjs --check && pnpm install:check", "lint:fix": "oxlint --fix", "format": "oxfmt --write .", "format:check": "oxfmt --check .", diff --git a/packages/client/package.json b/packages/client/package.json index 3575650b2b..e0204c4a55 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -38,6 +38,8 @@ "remark-gfm": "4.0.1" }, "devDependencies": { + "@botharness/host-client": "workspace:*", + "@botharness/host-protocol": "workspace:*", "@deepseek-ai/cordis": "4.1.0", "@deepseek-ai/dsh-api-gateway": "0.2.2-rc.1", "@deepseek-ai/dsh-api-session-controller": "0.2.2-rc.1", diff --git a/packages/client/src/client/actions.ts b/packages/client/src/client/actions.ts index ee13b614d7..d2430792cf 100644 --- a/packages/client/src/client/actions.ts +++ b/packages/client/src/client/actions.ts @@ -1,5 +1,5 @@ import { replyPreviewOf } from '../../../core/src/channels/reply-preview.js'; -import { gitImportSource } from '../../../../apps/mobile/src/host/bot-creation.js'; +import { gitImportSource } from '@botharness/host-client/bot-creation'; import { approveWorkspaceGrantRequest } from './bridge.js'; import { loadGenuiView, diff --git a/packages/client/src/client/activity-center-view.tsx b/packages/client/src/client/activity-center-view.tsx index 2591bba2d2..327dea0765 100644 --- a/packages/client/src/client/activity-center-view.tsx +++ b/packages/client/src/client/activity-center-view.tsx @@ -8,7 +8,7 @@ import { import { observeActivityEnvironments, combineActivityPages } from './activity-environments.js'; import { useThisHost } from './this-host.js'; import { hostLooks } from './host-looks.js'; -import { shownHostName } from '../../../../apps/mobile/src/ui/design/host-look.js'; +import { shownHostName } from '@botharness/host-client/ui/design/host-look'; import type { HumanAttentionItem } from './store.js'; import { createRemoteActivitySource, remoteActivityPage } from './remote-activity.js'; import type { DockPanelRegistry } from './dock-panels.js'; diff --git a/packages/client/src/client/activity-environments.ts b/packages/client/src/client/activity-environments.ts index e1b2df4708..219dd9988e 100644 --- a/packages/client/src/client/activity-environments.ts +++ b/packages/client/src/client/activity-environments.ts @@ -1,4 +1,4 @@ -import type { InboxSnapshot } from '../../../../apps/mobile/src/host/inbox.js'; +import type { InboxSnapshot } from '@botharness/host-client/inbox'; import type { ActivityQuery, ActivitySection } from './activity-feed.js'; import type { RemoteHosts } from './remote-hosts.js'; import type { ActivityListState } from './store.js'; diff --git a/packages/client/src/client/appearance-scope.ts b/packages/client/src/client/appearance-scope.ts index 2d8fefe04b..baa2d2973c 100644 --- a/packages/client/src/client/appearance-scope.ts +++ b/packages/client/src/client/appearance-scope.ts @@ -1,4 +1,4 @@ -import { BUBBLE_SURFACES, readable } from './bot-name-color.js'; +import { BUBBLE_SURFACES, readable } from '@botharness/host-client/shared/bot-name-color'; import { space } from './ds/tokens.stylex.js'; import { panelMaterials, validTargetId } from './appearance-panels.js'; import { appearanceMaterials } from './appearance-materials.js'; diff --git a/packages/client/src/client/approval-input.tsx b/packages/client/src/client/approval-input.tsx index 7c16bc92e4..95e1def0eb 100644 --- a/packages/client/src/client/approval-input.tsx +++ b/packages/client/src/client/approval-input.tsx @@ -1,5 +1,8 @@ import { useState, type ReactElement } from 'react'; -import { approvalFileChange, approvalShellCommand } from './approval-diff.js'; +import { + approvalFileChange, + approvalShellCommand, +} from '@botharness/host-client/shared/approval-diff'; import type { BotHarnessTranslate } from './locale.js'; export const APPROVAL_INPUT_PREVIEW_LINES = 12; diff --git a/packages/client/src/client/assignment-concurrency-setting.tsx b/packages/client/src/client/assignment-concurrency-setting.tsx index acf42bca26..ae3afa3bf7 100644 --- a/packages/client/src/client/assignment-concurrency-setting.tsx +++ b/packages/client/src/client/assignment-concurrency-setting.tsx @@ -1,7 +1,7 @@ import { useRef, useState, type ReactElement } from 'react'; import * as stylex from '@stylexjs/stylex'; -import { isAssignmentConcurrencyLimit } from '../bot-mode-settings.js'; +import { isAssignmentConcurrencyLimit } from '@botharness/host-client/shared/bot-mode-settings'; import { Note } from './ds/note.js'; import { NumberStepper } from './ds/number-stepper.js'; import { SettingsRow } from './ds/settings-row.js'; diff --git a/packages/client/src/client/bot-hop-limit-setting.tsx b/packages/client/src/client/bot-hop-limit-setting.tsx index 7e38fb10da..228a7866c6 100644 --- a/packages/client/src/client/bot-hop-limit-setting.tsx +++ b/packages/client/src/client/bot-hop-limit-setting.tsx @@ -1,6 +1,6 @@ import { useRef, useState, type ReactElement } from 'react'; -import { isBotHopLimit, MAX_BOT_HOP_LIMIT } from '../bot-mode-settings.js'; +import { isBotHopLimit, MAX_BOT_HOP_LIMIT } from '@botharness/host-client/shared/bot-mode-settings'; import { Note } from './ds/note.js'; import { NumberStepper } from './ds/number-stepper.js'; import { SettingsRow } from './ds/settings-row.js'; diff --git a/packages/client/src/client/bot-icon.tsx b/packages/client/src/client/bot-icon.tsx index 0a72251286..92227c5d3f 100644 --- a/packages/client/src/client/bot-icon.tsx +++ b/packages/client/src/client/bot-icon.tsx @@ -1,7 +1,7 @@ import { blobatar } from 'blobatar'; import type { CSSProperties, ReactElement } from 'react'; -import type { BotModeIcon } from '../bot-mode-settings.js'; +import type { BotModeIcon } from '@botharness/host-client/shared/bot-mode-settings'; import { DEEPSEEKBOT_DARK_DATA_URI, DEEPSEEKBOT_LIGHT_DATA_URI, diff --git a/packages/client/src/client/bot-mode-prefs.ts b/packages/client/src/client/bot-mode-prefs.ts index f4cf9272b5..4e765fa097 100644 --- a/packages/client/src/client/bot-mode-prefs.ts +++ b/packages/client/src/client/bot-mode-prefs.ts @@ -35,7 +35,7 @@ import { type BotModeMotionPreference, type BotModeSendKey, type BotModeSortMode, -} from '../bot-mode-settings.js'; +} from '@botharness/host-client/shared/bot-mode-settings'; import { resolveEffectiveMotion, type EffectiveMotion, diff --git a/packages/client/src/client/bot-mode-setting-rows.tsx b/packages/client/src/client/bot-mode-setting-rows.tsx index 935e450aa6..61d096ff0e 100644 --- a/packages/client/src/client/bot-mode-setting-rows.tsx +++ b/packages/client/src/client/bot-mode-setting-rows.tsx @@ -12,7 +12,7 @@ import { type BotModeMotionPreference, type BotModeSendKey, type BotModeSortMode, -} from '../bot-mode-settings.js'; +} from '@botharness/host-client/shared/bot-mode-settings'; import { BotHopLimitSetting } from './bot-hop-limit-setting.js'; import { AssignmentConcurrencySetting } from './assignment-concurrency-setting.js'; import { BotIcon } from './bot-icon.js'; diff --git a/packages/client/src/client/bot-mode-sidebar.tsx b/packages/client/src/client/bot-mode-sidebar.tsx index a909b0df29..c57ee34f32 100644 --- a/packages/client/src/client/bot-mode-sidebar.tsx +++ b/packages/client/src/client/bot-mode-sidebar.tsx @@ -9,7 +9,7 @@ import { import { Tooltip } from './ds/tooltip.js'; import { DeviceRequestsNotice } from './device-requests-notice.js'; -import type { BotModeSortMode } from '../bot-mode-settings.js'; +import type { BotModeSortMode } from '@botharness/host-client/shared/bot-mode-settings'; import type { BridgeActions } from './actions.js'; import { BotIcon } from './bot-icon.js'; import type { BotModePrefsSnapshot } from './bot-mode-prefs.js'; diff --git a/packages/client/src/client/bot-primary-color.ts b/packages/client/src/client/bot-primary-color.ts index da7d8d78be..59492bd20d 100644 --- a/packages/client/src/client/bot-primary-color.ts +++ b/packages/client/src/client/bot-primary-color.ts @@ -16,7 +16,7 @@ import { REFERENCE_SURFACES, type Rgb, type ThemeName, -} from './bot-name-color.js'; +} from '@botharness/host-client/shared/bot-name-color'; export { BUBBLE_SURFACES, BUBBLE_SEPARATION, @@ -29,7 +29,7 @@ export { REFERENCE_SURFACES, type Rgb, type ThemeName, -} from './bot-name-color.js'; +} from '@botharness/host-client/shared/bot-name-color'; export const CHART_CONTRAST = 3; export const CHART_TONE_LEVELS = { diff --git a/packages/client/src/client/bot-sidebar.tsx b/packages/client/src/client/bot-sidebar.tsx index 920c6e9292..d9c67a8cdf 100644 --- a/packages/client/src/client/bot-sidebar.tsx +++ b/packages/client/src/client/bot-sidebar.tsx @@ -82,7 +82,7 @@ import { isBotModeSortMode, PINNED_SORT_SCOPE_ID, type BotModeSortMode, -} from '../bot-mode-settings.js'; +} from '@botharness/host-client/shared/bot-mode-settings'; import type { BridgeActions } from './actions.js'; import type { WindowCompanions } from './window-companions.js'; import { diff --git a/packages/client/src/client/bridge.ts b/packages/client/src/client/bridge.ts index 764daa95e6..32a61f15ee 100644 --- a/packages/client/src/client/bridge.ts +++ b/packages/client/src/client/bridge.ts @@ -4,7 +4,10 @@ import { isTakeoverRequestCard, isTakeoverResolution, } from '../../../core/src/takeover/contracts.js'; -import { parseFailureAutoContinue, parseFailureProgress } from '../shared/turn-continuation.js'; +import { + parseFailureAutoContinue, + parseFailureProgress, +} from '@botharness/host-client/shared/turn-continuation'; import { isPixelBannerRecipe, type PixelBannerRecipe } from '@botharness/pixel-banner'; import { clientLog } from './diagnostic-log.js'; import { diff --git a/packages/client/src/client/channel-live.ts b/packages/client/src/client/channel-live.ts index 3bf0a99273..967351eb06 100644 --- a/packages/client/src/client/channel-live.ts +++ b/packages/client/src/client/channel-live.ts @@ -9,7 +9,7 @@ import { type ChannelEventSource, } from './messaging-defaults-live.js'; import { parseContentRedactions } from './content-redactions.js'; -import { purgeGenuiPrivateViews } from './genui-view.js'; +import { purgeGenuiPrivateViews } from '@botharness/host-client/shared/genui-view'; import { purgeGenuiDocumentViews } from './genui-document-view.js'; import { parseChannelMessage, diff --git a/packages/client/src/client/channel-message-body.tsx b/packages/client/src/client/channel-message-body.tsx index 82c0062320..ca5e13ba33 100644 --- a/packages/client/src/client/channel-message-body.tsx +++ b/packages/client/src/client/channel-message-body.tsx @@ -7,7 +7,7 @@ import { useNow, useTurnContinuation, } from './turn-continuation.js'; -import { autoContinueSeconds } from '../shared/turn-continuation.js'; +import { autoContinueSeconds } from '@botharness/host-client/shared/turn-continuation'; import { MessageFeedbackDialog } from './message-feedback.js'; import { useMessageHost } from './message-host.js'; import { BridgeAudio } from './bridge-audio.js'; diff --git a/packages/client/src/client/composer-send-key.ts b/packages/client/src/client/composer-send-key.ts index 39fe1536fe..991327cbf7 100644 --- a/packages/client/src/client/composer-send-key.ts +++ b/packages/client/src/client/composer-send-key.ts @@ -1,6 +1,6 @@ import { createContext } from 'react'; -import type { BotModeSendKey } from '../bot-mode-settings.js'; +import type { BotModeSendKey } from '@botharness/host-client/shared/bot-mode-settings'; export type ComposerSendKey = BotModeSendKey; diff --git a/packages/client/src/client/connection-hosts.tsx b/packages/client/src/client/connection-hosts.tsx index 8513b5c6e5..4fd12e1441 100644 --- a/packages/client/src/client/connection-hosts.tsx +++ b/packages/client/src/client/connection-hosts.tsx @@ -1,7 +1,7 @@ import { useRef, useState, useSyncExternalStore } from 'react'; import { Button } from '@deepseek-ai/dsh-client-ui-primitives'; import type { ConnectedHost } from '../../../core/src/devices/connect-account.js'; -import type { HostClient } from '../../../../apps/mobile/src/host/client.js'; +import type { HostClient } from '@botharness/host-client/client'; import type { BotHarnessTranslate } from './locale.js'; import { remoteHosts, type RemoteHost } from './remote-hosts.js'; import { @@ -24,8 +24,8 @@ import { isTailscaleRoute, isConnectRoute, isLoopbackRoute, -} from '../../../../apps/mobile/src/host/route.js'; -import { shownHostName } from '../../../../apps/mobile/src/ui/design/host-look.js'; +} from '@botharness/host-protocol/route'; +import { shownHostName } from '@botharness/host-client/ui/design/host-look'; function routeLabel(route: string, t: BotHarnessTranslate) { if (isLanRoute(route)) return t('connections.lan'); diff --git a/packages/client/src/client/connection-management.ts b/packages/client/src/client/connection-management.ts index 82710340fc..4fd8a120cc 100644 --- a/packages/client/src/client/connection-management.ts +++ b/packages/client/src/client/connection-management.ts @@ -1,12 +1,12 @@ import type { ConnectedHost } from '../../../core/src/devices/connect-account.js'; -import type { HostClient } from '../../../../apps/mobile/src/host/client.js'; +import type { HostClient } from '@botharness/host-client/client'; import type { RemoteHost, RemoteHosts } from './remote-hosts.js'; import { AppearanceError, object } from './appearance.js'; import { connectionMutationSchema, type ConnectionMutation, } from '../../../core/src/devices/connection-operation.js'; -import { isLanRoute, isConnectRoute } from '../../../../apps/mobile/src/host/route.js'; +import { isLanRoute, isConnectRoute } from '@botharness/host-protocol/route'; export function connectionRows(hosts: readonly RemoteHost[], account: readonly ConnectedHost[]) { const matched = new Set(); diff --git a/packages/client/src/client/environment-activity.ts b/packages/client/src/client/environment-activity.ts index 63bed2db44..480a73267c 100644 --- a/packages/client/src/client/environment-activity.ts +++ b/packages/client/src/client/environment-activity.ts @@ -1,6 +1,6 @@ import { ALL_HOSTS, THIS_HOST, type RemoteHostsSnapshot } from './remote-hosts.js'; import type { ActivityListState } from './store.js'; -import type { InboxSnapshot } from '../../../../apps/mobile/src/host/inbox.js'; +import type { InboxSnapshot } from '@botharness/host-client/inbox'; export function environmentUnread(inbox: InboxSnapshot): number | undefined { if (inbox.status !== 'ready' || inbox.stale || Object.values(inbox.cursors ?? {}).some(Boolean)) diff --git a/packages/client/src/client/environment-channels.ts b/packages/client/src/client/environment-channels.ts index 0ff4f8afa2..ace0ae7581 100644 --- a/packages/client/src/client/environment-channels.ts +++ b/packages/client/src/client/environment-channels.ts @@ -1,6 +1,6 @@ import type { ChannelSummary } from './store.js'; import type { RemoteHost, RemoteConversationTarget } from './remote-hosts.js'; -import type { RosterChannel, RosterView } from '../../../../apps/mobile/src/host/client.js'; +import type { RosterChannel, RosterView } from '@botharness/host-client/client'; import { parseChannelRecord } from './bridge.js'; import { isHumanDmChannel } from './channel-kind.js'; diff --git a/packages/client/src/client/environment-creation-owner.ts b/packages/client/src/client/environment-creation-owner.ts index b357d30ed2..4e811f718d 100644 --- a/packages/client/src/client/environment-creation-owner.ts +++ b/packages/client/src/client/environment-creation-owner.ts @@ -1,5 +1,5 @@ -import type { HostClient } from '../../../../apps/mobile/src/host/client.js'; -import { gitImportSource } from '../../../../apps/mobile/src/host/bot-creation.js'; +import type { HostClient } from '@botharness/host-client/client'; +import { gitImportSource } from '@botharness/host-client/bot-creation'; import { assignRosterChannel, createGroupChannel, diff --git a/packages/client/src/client/environment-creation.tsx b/packages/client/src/client/environment-creation.tsx index 5c2c196831..53cf5bb6b8 100644 --- a/packages/client/src/client/environment-creation.tsx +++ b/packages/client/src/client/environment-creation.tsx @@ -7,8 +7,8 @@ import { remoteHosts } from './remote-hosts.js'; import { memberPage } from './member-page.js'; import { useThisHost } from './this-host.js'; import { hostLooks, useHostName } from './host-looks.js'; -import { shownHostName } from '../../../../apps/mobile/src/ui/design/host-look.js'; -import type { HostClient } from '../../../../apps/mobile/src/host/client.js'; +import { shownHostName } from '@botharness/host-client/ui/design/host-look'; +import type { HostClient } from '@botharness/host-client/client'; import { bindBotCreationOwner, localCreationOwner, diff --git a/packages/client/src/client/environment-settings-source.ts b/packages/client/src/client/environment-settings-source.ts index 7b0b8bd28c..5135610451 100644 --- a/packages/client/src/client/environment-settings-source.ts +++ b/packages/client/src/client/environment-settings-source.ts @@ -1,4 +1,4 @@ -import type { ModelSettingsClient } from '../../../../apps/mobile/src/host/bot-settings.js'; +import type { ModelSettingsClient } from '@botharness/host-client/bot-settings'; import { unwrap, type BridgeCall } from './bridge.js'; interface LocalModelBinding { diff --git a/packages/client/src/client/genui-document-view.ts b/packages/client/src/client/genui-document-view.ts index 761bb2140b..7e715ee811 100644 --- a/packages/client/src/client/genui-document-view.ts +++ b/packages/client/src/client/genui-document-view.ts @@ -7,7 +7,7 @@ import { type GenuiDocumentReply, } from '../../../core/src/channels/genui-document.js'; import type { BridgeActions } from './actions.js'; -import { PrivateViewController } from './genui-view.js'; +import { PrivateViewController } from '@botharness/host-client/shared/genui-view'; import type { PurgedPlacement } from '../../../core/src/purge/contracts.js'; export type GenuiDocumentActions = Pick< diff --git a/packages/client/src/client/genui-report.tsx b/packages/client/src/client/genui-report.tsx index 75e131e7ae..49d68defc5 100644 --- a/packages/client/src/client/genui-report.tsx +++ b/packages/client/src/client/genui-report.tsx @@ -16,7 +16,7 @@ import { type GenuiViewState, } from '../../../core/src/channels/genui.js'; import type { BridgeActions } from './actions.js'; -import { getGenuiPrivateView } from './genui-view.js'; +import { getGenuiPrivateView } from '@botharness/host-client/shared/genui-view'; import type { BotHarnessTranslate } from './locale.js'; import { ActionButton, ActionGroup } from './ds/action-button.js'; import { border, color, radius, space, text } from './ds/tokens.stylex.js'; diff --git a/packages/client/src/client/host-activity-actions.ts b/packages/client/src/client/host-activity-actions.ts index 25656abdaf..e0bebd21fa 100644 --- a/packages/client/src/client/host-activity-actions.ts +++ b/packages/client/src/client/host-activity-actions.ts @@ -5,14 +5,14 @@ import { clearAttentionItem, decideJoinRequest, snoozeAttentionItem, -} from '../../../../apps/mobile/src/host/attention-actions.js'; -import type { HostClient } from '../../../../apps/mobile/src/host/client.js'; +} from '@botharness/host-client/attention-actions'; +import type { HostClient } from '@botharness/host-client/client'; import { loadApproval, loadQuestion, type DecisionResult, type RequestRef, -} from '../../../../apps/mobile/src/host/requests.js'; +} from '@botharness/host-client/requests'; import type { BridgeActions } from './actions.js'; import { ignoreHumanAssignmentReport, diff --git a/packages/client/src/client/host-bridge-call.ts b/packages/client/src/client/host-bridge-call.ts index f43b662c39..5bad752010 100644 --- a/packages/client/src/client/host-bridge-call.ts +++ b/packages/client/src/client/host-bridge-call.ts @@ -1,4 +1,4 @@ -import { MethodRefused } from '../../../../apps/mobile/src/host/client.js'; +import { MethodRefused } from '@botharness/host-client/client'; import { BridgeCallError, type BridgeCall } from './bridge.js'; export function hostBridgeCall( diff --git a/packages/client/src/client/host-glyph.tsx b/packages/client/src/client/host-glyph.tsx index 5ed256a44b..cbfc248a97 100644 --- a/packages/client/src/client/host-glyph.tsx +++ b/packages/client/src/client/host-glyph.tsx @@ -1,7 +1,7 @@ import * as stylex from '@stylexjs/stylex'; import { ChannelSidebarIcon } from './channel-sidebar-icon.js'; import { HOST_SYMBOL_GLYPHS, useHostInk } from './host-looks.js'; -import type { HostLook } from '../../../../apps/mobile/src/ui/design/host-look.js'; +import type { HostLook } from '@botharness/host-client/ui/design/host-look'; import { text } from './ds/tokens.stylex.js'; const styles = stylex.create({ diff --git a/packages/client/src/client/host-look-control.ts b/packages/client/src/client/host-look-control.ts index 9dd7f8ea87..291e8e6947 100644 --- a/packages/client/src/client/host-look-control.ts +++ b/packages/client/src/client/host-look-control.ts @@ -1,14 +1,10 @@ -import { - isHostColor, - isHostIcon, - type HostLooks, -} from '../../../../apps/mobile/src/host/host-look.js'; +import { isHostColor, isHostIcon, type HostLooks } from '@botharness/host-client/host-look'; import { withHostColor, withHostIcon, withHostName, type HostLook, -} from '../../../../apps/mobile/src/ui/design/host-look.js'; +} from '@botharness/host-client/ui/design/host-look'; import { AppearanceError, object } from './appearance.js'; export async function controlHostLook( diff --git a/packages/client/src/client/host-look-settings.tsx b/packages/client/src/client/host-look-settings.tsx index 174560ca1e..0ef9a1b895 100644 --- a/packages/client/src/client/host-look-settings.tsx +++ b/packages/client/src/client/host-look-settings.tsx @@ -24,7 +24,7 @@ import { withHostIcon, withHostColor, type HostLook, -} from '../../../../apps/mobile/src/ui/design/host-look.js'; +} from '@botharness/host-client/ui/design/host-look'; const focusRing = { default: 'none', ':focus-visible': `${border.focus} solid ${color.accent}` }; const styles = stylex.create({ diff --git a/packages/client/src/client/host-looks.ts b/packages/client/src/client/host-looks.ts index ddd38ac666..bb4d914166 100644 --- a/packages/client/src/client/host-looks.ts +++ b/packages/client/src/client/host-looks.ts @@ -1,6 +1,6 @@ import { useSyncExternalStore } from 'react'; -import { createHostLooks, type HostLooks } from '../../../../apps/mobile/src/host/host-look.js'; +import { createHostLooks, type HostLooks } from '@botharness/host-client/host-look'; import { DEFAULT_HOST_LOOK, shownHostName, @@ -10,8 +10,8 @@ import { type HostColorId, type HostLook, type HostSymbolId, -} from '../../../../apps/mobile/src/ui/design/host-look.js'; -import type { ColorRole } from '../../../../apps/mobile/src/ui/design/resolve-theme.js'; +} from '@botharness/host-client/ui/design/host-look'; +import type { ColorRole } from '@botharness/host-client/ui/design/color-math'; import { useBotColorScheme } from './bot-color-scheme.js'; export const HOST_LOOKS_STORAGE_KEY = 'botharness.hostLooks.v1'; diff --git a/packages/client/src/client/host-settings.tsx b/packages/client/src/client/host-settings.tsx index 7390498fa3..017ec0101a 100644 --- a/packages/client/src/client/host-settings.tsx +++ b/packages/client/src/client/host-settings.tsx @@ -7,7 +7,7 @@ import * as stylex from '@stylexjs/stylex'; import { HostGlyph } from './host-glyph.js'; import { HostLookSettings } from './host-look-settings.js'; import { useHostLook } from './host-looks.js'; -import { shownHostName } from '../../../../apps/mobile/src/ui/design/host-look.js'; +import { shownHostName } from '@botharness/host-client/ui/design/host-look'; import { RemoteNotificationSettings } from './remote-notification-settings.js'; import { ChannelSidebarIcon } from './channel-sidebar-icon.js'; import { space } from './ds/tokens.stylex.js'; @@ -29,7 +29,7 @@ import { remoteHostSettingsSource } from './remote-host-settings-source.js'; import { StorageSettings } from './storage-settings.js'; import { useThisHost } from './this-host.js'; import { localEnvironmentSettings } from './environment-settings-source.js'; -import type { HostClient } from '../../../../apps/mobile/src/host/client.js'; +import type { HostClient } from '@botharness/host-client/client'; const styles = stylex.create({ appearance: { borderWidth: 0, margin: 0, padding: 0, minWidth: 0 }, diff --git a/packages/client/src/client/host-tabs.tsx b/packages/client/src/client/host-tabs.tsx index 518e22c3ed..945ae935cf 100644 --- a/packages/client/src/client/host-tabs.tsx +++ b/packages/client/src/client/host-tabs.tsx @@ -28,7 +28,7 @@ import { DEFAULT_HOST_LOOK, shownHostName, type HostLook, -} from '../../../../apps/mobile/src/ui/design/host-look.js'; +} from '@botharness/host-client/ui/design/host-look'; import { hostLooks, unusedHostLook, useHostLook, useHostName } from './host-looks.js'; const focusRing = { default: 'none', ':focus-visible': `${border.focus} solid ${color.accent}` }; diff --git a/packages/client/src/client/index.ts b/packages/client/src/client/index.ts index 26565b3e01..b7bae0692a 100644 --- a/packages/client/src/client/index.ts +++ b/packages/client/src/client/index.ts @@ -40,7 +40,10 @@ import type {} from '@deepseek-ai/dsh-api-workspace-controller/client'; import type {} from '@deepseek-ai/dsh-api-session-controller/client'; import type { SessionId } from '@deepseek-ai/dsh-session/types'; -import { BOT_MODE_NAMESPACE, type BotModeSettings } from '../bot-mode-settings.js'; +import { + BOT_MODE_NAMESPACE, + type BotModeSettings, +} from '@botharness/host-client/shared/bot-mode-settings'; import { fullClientLocator, privateInputLocator, diff --git a/packages/client/src/client/message-host.ts b/packages/client/src/client/message-host.ts index 36bbc016b6..3c32b4f4dd 100644 --- a/packages/client/src/client/message-host.ts +++ b/packages/client/src/client/message-host.ts @@ -1,5 +1,5 @@ import { createContext, useContext } from 'react'; -import type { HostClient } from '../../../../apps/mobile/src/host/client.js'; +import type { HostClient } from '@botharness/host-client/client'; import type { PurgedPlacement } from '../../../core/src/purge/contracts.js'; export interface MessageHost { diff --git a/packages/client/src/client/mobile-bot-panel.tsx b/packages/client/src/client/mobile-bot-panel.tsx index dcb3972e48..0e6448679d 100644 --- a/packages/client/src/client/mobile-bot-panel.tsx +++ b/packages/client/src/client/mobile-bot-panel.tsx @@ -10,7 +10,7 @@ import { import { BotPanel } from './bot-main.js'; import { BotSidebar } from './bot-sidebar.js'; import type { BotModePrefsSnapshot } from './bot-mode-prefs.js'; -import type { BotModeSortMode } from '../bot-mode-settings.js'; +import type { BotModeSortMode } from '@botharness/host-client/shared/bot-mode-settings'; import { useMountedResource } from './mounted-resource.js'; import { store } from './store.js'; import { MOBILE_BOT_CSS } from './mobile-bot-styles.js'; diff --git a/packages/client/src/client/motion-preference.ts b/packages/client/src/client/motion-preference.ts index 197b714bd4..5101cf797d 100644 --- a/packages/client/src/client/motion-preference.ts +++ b/packages/client/src/client/motion-preference.ts @@ -1,6 +1,6 @@ import type { SnapshotStore } from '@deepseek-ai/dsh-client-store'; -import type { BotModeMotionPreference } from '../bot-mode-settings.js'; +import type { BotModeMotionPreference } from '@botharness/host-client/shared/bot-mode-settings'; export type EffectiveMotion = 'reduce' | 'full'; diff --git a/packages/client/src/client/overview-usage-view.tsx b/packages/client/src/client/overview-usage-view.tsx index 0460cc25e4..15a5667411 100644 --- a/packages/client/src/client/overview-usage-view.tsx +++ b/packages/client/src/client/overview-usage-view.tsx @@ -5,7 +5,7 @@ import { IconRefreshOutlineRegular, IconRightUpOutlineRegular, } from '@deepseek-ai/dsh-client-ui-primitives'; -import type { OverviewUsage } from '../../../../apps/mobile/src/host/usage.js'; +import type { OverviewUsage } from '@botharness/host-client/usage'; import { usageOverviewPeriods, type UsageOverviewPeriod, diff --git a/packages/client/src/client/paired-devices.tsx b/packages/client/src/client/paired-devices.tsx index a3aca1c3d3..0e10515a81 100644 --- a/packages/client/src/client/paired-devices.tsx +++ b/packages/client/src/client/paired-devices.tsx @@ -14,9 +14,9 @@ import { type PrivateTunnelStep, type PrivateTunnelView, } from './private-tunnel-settings.js'; -import { noiseFingerprint } from '../../../core/src/devices/noise/xk.js'; -import { keyBytes } from '../../../../apps/mobile/src/host/encrypted-carrier.js'; -import { checkRoute, isConnectRoute, isLanRoute } from '../../../../apps/mobile/src/host/route.js'; +import { noiseFingerprint } from '@botharness/host-protocol/noise/xk'; +import { keyBytes } from '@botharness/host-client/encrypted-carrier'; +import { checkRoute, isConnectRoute, isLanRoute } from '@botharness/host-protocol/route'; import { useRef, useState, type ComponentProps, type ReactElement } from 'react'; import * as stylex from '@stylexjs/stylex'; import { Button, Switch } from '@deepseek-ai/dsh-client-ui-primitives'; diff --git a/packages/client/src/client/private-input-card.tsx b/packages/client/src/client/private-input-card.tsx index 7f443d30ed..74dd31b63c 100644 --- a/packages/client/src/client/private-input-card.tsx +++ b/packages/client/src/client/private-input-card.tsx @@ -1,6 +1,6 @@ import { ActionButton } from './ds/action-button.js'; -import { MethodRefused } from '../../../../apps/mobile/src/host/client.js'; -import { isConnectRoute } from '../../../../apps/mobile/src/host/route.js'; +import { MethodRefused } from '@botharness/host-client/client'; +import { isConnectRoute } from '@botharness/host-protocol/route'; import { BridgeCallError } from './bridge.js'; import { useMessageHost } from './message-host.js'; import { useId, useRef, useState, type ReactElement } from 'react'; diff --git a/packages/client/src/client/relationship-settings.tsx b/packages/client/src/client/relationship-settings.tsx index 7b91ad0dad..3f7f6cd116 100644 --- a/packages/client/src/client/relationship-settings.tsx +++ b/packages/client/src/client/relationship-settings.tsx @@ -4,9 +4,9 @@ import { relationshipReplySchema, } from '../../../core/src/devices/relationship-contract.js'; import { Button, Input } from '@deepseek-ai/dsh-client-ui-primitives'; -import { noiseFingerprint } from '../../../core/src/devices/noise/xk.js'; -import { keyBytes } from '../../../../apps/mobile/src/host/encrypted-carrier.js'; -import { parsePairingLink } from '../../../../apps/mobile/src/host/pairing.js'; +import { noiseFingerprint } from '@botharness/host-protocol/noise/xk'; +import { keyBytes } from '@botharness/host-client/encrypted-carrier'; +import { parsePairingLink } from '@botharness/host-client/pairing'; import type { BotHarnessTranslate } from './locale.js'; import { relationshipRequest, diff --git a/packages/client/src/client/relationships.ts b/packages/client/src/client/relationships.ts index dbc8ebd16a..d5bd7b673f 100644 --- a/packages/client/src/client/relationships.ts +++ b/packages/client/src/client/relationships.ts @@ -4,9 +4,9 @@ import { type ClientRelationship, } from '../../../core/src/devices/relationship-contract.js'; export type { ClientRelationship } from '../../../core/src/devices/relationship-contract.js'; -import { parsePairingLink } from '../../../../apps/mobile/src/host/pairing.js'; -import { keyBytes } from '../../../../apps/mobile/src/host/encrypted-carrier.js'; -import { noiseFingerprint } from '../../../core/src/devices/noise/xk.js'; +import { parsePairingLink } from '@botharness/host-client/pairing'; +import { keyBytes } from '@botharness/host-client/encrypted-carrier'; +import { noiseFingerprint } from '@botharness/host-protocol/noise/xk'; import type { RemoteHosts, HostPairResult, RemotePairTrust } from './remote-hosts.js'; export class RelationshipRequestRefused extends Error { diff --git a/packages/client/src/client/remote-activity.tsx b/packages/client/src/client/remote-activity.tsx index 1673490a29..c789b46773 100644 --- a/packages/client/src/client/remote-activity.tsx +++ b/packages/client/src/client/remote-activity.tsx @@ -1,9 +1,9 @@ import { hostLooks } from './host-looks.js'; import { ActivityEnvironmentBadge } from './activity-environment-badge.js'; -import { shownHostName } from '../../../../apps/mobile/src/ui/design/host-look.js'; +import { shownHostName } from '@botharness/host-client/ui/design/host-look'; import { useRef, useState, type ReactElement } from 'react'; import { Button } from '@deepseek-ai/dsh-client-ui-primitives'; -import type { InboxSnapshot } from '../../../../apps/mobile/src/host/inbox.js'; +import type { InboxSnapshot } from '@botharness/host-client/inbox'; import { isAvatarAppearance } from '../../../core/src/bots/avatar-appearance.js'; import { parseHumanAttentionPage } from './bridge.js'; import type { ActivitySection } from './activity-feed.js'; diff --git a/packages/client/src/client/remote-avatar.tsx b/packages/client/src/client/remote-avatar.tsx index fa51fa2699..09445f6810 100644 --- a/packages/client/src/client/remote-avatar.tsx +++ b/packages/client/src/client/remote-avatar.tsx @@ -1,5 +1,5 @@ import type { ReactElement } from 'react'; -import type { RosterBot, RosterView } from '../../../../apps/mobile/src/host/client.js'; +import type { RosterBot, RosterView } from '@botharness/host-client/client'; import { isAvatarAppearance } from '../../../core/src/bots/avatar-appearance.js'; import { PersonaBotAvatar } from './avatar.js'; import { GroupChannelIcon, type GroupAvatarBot } from './group-avatar-stack.js'; diff --git a/packages/client/src/client/remote-folder-access.ts b/packages/client/src/client/remote-folder-access.ts index a8162e9cc5..1d0b8ca525 100644 --- a/packages/client/src/client/remote-folder-access.ts +++ b/packages/client/src/client/remote-folder-access.ts @@ -1,5 +1,5 @@ -import type { HostClient } from '../../../../apps/mobile/src/host/client.js'; -import { createWorkspace } from '../../../../apps/mobile/src/host/bot-settings.js'; +import type { HostClient } from '@botharness/host-client/client'; +import { createWorkspace } from '@botharness/host-client/bot-settings'; import type { createActions } from './actions.js'; import { BridgeCallError } from './bridge.js'; diff --git a/packages/client/src/client/remote-host-activity.ts b/packages/client/src/client/remote-host-activity.ts index 2894c8ea76..37cb381073 100644 --- a/packages/client/src/client/remote-host-activity.ts +++ b/packages/client/src/client/remote-host-activity.ts @@ -1,8 +1,5 @@ -import type { RosterBot } from '../../../../apps/mobile/src/host/client.js'; -import type { - WireToolActivity, - WireSessionActivity, -} from '../../../../apps/mobile/src/host/wire.js'; +import type { RosterBot } from '@botharness/host-client/client'; +import type { WireToolActivity, WireSessionActivity } from '@botharness/host-protocol/wire'; import type { PersonaBotSessionActivity, PersonaBotToolActivity, diff --git a/packages/client/src/client/remote-host-models.tsx b/packages/client/src/client/remote-host-models.tsx index 924796cb6b..45d16e08ae 100644 --- a/packages/client/src/client/remote-host-models.tsx +++ b/packages/client/src/client/remote-host-models.tsx @@ -7,7 +7,7 @@ import { HostAnswerInvalid, type ModelRoute, type ModelSettingsClient, -} from '../../../../apps/mobile/src/host/bot-settings.js'; +} from '@botharness/host-client/bot-settings'; import { modelRoutes, modelScopeKey, @@ -17,7 +17,7 @@ import { toggleAssignmentModel, type ModelScope, type ModelSettingsState, -} from '../../../../apps/mobile/src/host/model-settings.js'; +} from '@botharness/host-client/model-settings'; import { Combobox } from './combobox.js'; import { TextField } from './ds/field.js'; import { Note } from './ds/note.js'; diff --git a/packages/client/src/client/remote-host-settings-source.ts b/packages/client/src/client/remote-host-settings-source.ts index a7447512f0..fb9f707a9a 100644 --- a/packages/client/src/client/remote-host-settings-source.ts +++ b/packages/client/src/client/remote-host-settings-source.ts @@ -1,7 +1,7 @@ -import type { HostClient } from '../../../../apps/mobile/src/host/client.js'; -import * as storage from '../../../../apps/mobile/src/host/storage.js'; -import { loadMemoryActivity, loadUsage } from '../../../../apps/mobile/src/host/usage.js'; -import type { UsagePeriod } from '../../../../apps/mobile/src/host/usage.js'; +import type { HostClient } from '@botharness/host-client/client'; +import * as storage from '@botharness/host-client/storage'; +import { loadMemoryActivity, loadUsage } from '@botharness/host-client/usage'; +import type { UsagePeriod } from '@botharness/host-client/usage'; export function remoteHostSettingsSource(client: HostClient) { return { diff --git a/packages/client/src/client/remote-host-viewer-panel.tsx b/packages/client/src/client/remote-host-viewer-panel.tsx index 437447dd46..8b06ddf441 100644 --- a/packages/client/src/client/remote-host-viewer-panel.tsx +++ b/packages/client/src/client/remote-host-viewer-panel.tsx @@ -1,8 +1,8 @@ import { useMemo, useState, useSyncExternalStore, type ReactElement } from 'react'; import * as stylex from '@stylexjs/stylex'; import { Button, Input } from '@deepseek-ai/dsh-client-ui-primitives'; -import { pagePoint } from '../../../../apps/mobile/src/host/browser-viewer.js'; -import type { HostClient } from '../../../../apps/mobile/src/host/client.js'; +import { pagePoint } from '@botharness/host-client/browser-viewer'; +import type { HostClient } from '@botharness/host-client/client'; import { PanelEmptyState } from './ds/empty-state.js'; import { border, color, space, text } from './ds/tokens.stylex.js'; import type { BotHarnessTranslate } from './locale.js'; diff --git a/packages/client/src/client/remote-host-viewer.ts b/packages/client/src/client/remote-host-viewer.ts index 985ff22434..f99099d914 100644 --- a/packages/client/src/client/remote-host-viewer.ts +++ b/packages/client/src/client/remote-host-viewer.ts @@ -3,9 +3,9 @@ import { type BrowserFrame, type BrowserInput, type BrowserViewerStatus, -} from '../../../../apps/mobile/src/host/browser-viewer.js'; -import { createComputerViewer } from '../../../../apps/mobile/src/host/computer-viewer.js'; -import type { HostClient } from '../../../../apps/mobile/src/host/client.js'; +} from '@botharness/host-client/browser-viewer'; +import { createComputerViewer } from '@botharness/host-client/computer-viewer'; +import type { HostClient } from '@botharness/host-client/client'; export type RemoteViewerKind = 'browser' | 'computer'; diff --git a/packages/client/src/client/remote-hosts.ts b/packages/client/src/client/remote-hosts.ts index d288864294..8c86634653 100644 --- a/packages/client/src/client/remote-hosts.ts +++ b/packages/client/src/client/remote-hosts.ts @@ -5,9 +5,9 @@ import { } from '../../../core/src/devices/connection-operation.js'; import { hostLooks } from './host-looks.js'; import { memberPage } from './member-page.js'; -import { secureRandom, keyHex } from '../../../../apps/mobile/src/host/encrypted-carrier.js'; +import { secureRandom, keyHex } from '@botharness/host-client/encrypted-carrier'; import { browserAdmissionProtocols } from '../../../../deploy/private-relay/admission.mjs'; -import { isPrivateRoute } from '../../../../apps/mobile/src/host/route.js'; +import { isPrivateRoute } from '@botharness/host-protocol/route'; import { enrollRelationshipClient, commitRelationshipEnrollment, @@ -22,23 +22,23 @@ import { withRemoteHostCredentialWrite, } from './remote-host-storage-lock.js'; import { relationshipRequest, type ClientRelationship } from './relationships.js'; -import { shownHostName } from '../../../../apps/mobile/src/ui/design/host-look.js'; -import type { HostCarrier } from '../../../../apps/mobile/src/host/carrier.js'; +import { shownHostName } from '@botharness/host-client/ui/design/host-look'; +import type { HostCarrier } from '@botharness/host-protocol/carrier'; import { createHostClient, type HostClient, type HostSnapshot, -} from '../../../../apps/mobile/src/host/client.js'; +} from '@botharness/host-client/client'; import { createConversation, type Conversation, -} from '../../../../apps/mobile/src/host/conversation.js'; +} from '@botharness/host-client/conversation'; import { parseSavedHost, serializeSavedHost, type SavedHost, type PrivateAdmission, -} from '../../../../apps/mobile/src/host/hosts.js'; +} from '@botharness/host-client/hosts'; import { createInbox, prepareNotificationBaseline, @@ -46,14 +46,14 @@ import { type InboxSnapshot, observeInbox, type InboxQuery, -} from '../../../../apps/mobile/src/host/inbox.js'; +} from '@botharness/host-client/inbox'; import { DEVICE_PREFIX, parsePairingLink, redeemPairing, revokePairing, type PairingRefusal, -} from '../../../../apps/mobile/src/host/pairing.js'; +} from '@botharness/host-client/pairing'; import { store } from './store.js'; import { createRemoteActivityProjection, type RemoteBotActivity } from './remote-host-activity.js'; import { releaseRemoteHostViewers } from './remote-host-viewer.js'; diff --git a/packages/client/src/client/remote-native-conversation.ts b/packages/client/src/client/remote-native-conversation.ts index 25758792e3..34a8557d1e 100644 --- a/packages/client/src/client/remote-native-conversation.ts +++ b/packages/client/src/client/remote-native-conversation.ts @@ -1,7 +1,7 @@ import { useMemo, useSyncExternalStore } from 'react'; import { useMountedResource } from './mounted-resource.js'; import { isolateTeamIdentity } from './team-state.js'; -import type { HostClient } from '../../../../apps/mobile/src/host/client.js'; +import type { HostClient } from '@botharness/host-client/client'; import { createActions, type BridgeActions } from './actions.js'; import { loadJournalPage, type BridgeCall } from './bridge.js'; import { diff --git a/packages/client/src/client/remote-notification-settings.tsx b/packages/client/src/client/remote-notification-settings.tsx index 92eb271a37..243d47e307 100644 --- a/packages/client/src/client/remote-notification-settings.tsx +++ b/packages/client/src/client/remote-notification-settings.tsx @@ -1,7 +1,7 @@ import { useMountedResource } from './mounted-resource.js'; import { useState, useSyncExternalStore } from 'react'; import { Switch } from '@deepseek-ai/dsh-client-ui-primitives'; -import { PUSH_KINDS, type PushKind } from '../../../../apps/mobile/src/host/push.js'; +import { PUSH_KINDS, type PushKind } from '@botharness/host-client/push'; import type { RemoteNotifications } from './remote-notifications.js'; import type { BotHarnessTranslate, BotHarnessKey } from './locale.js'; import { Note } from './ds/note.js'; diff --git a/packages/client/src/client/remote-notifications.ts b/packages/client/src/client/remote-notifications.ts index 55c8ef74be..3f98a96068 100644 --- a/packages/client/src/client/remote-notifications.ts +++ b/packages/client/src/client/remote-notifications.ts @@ -1,13 +1,9 @@ import { DEFAULT_NOTIFICATION_PREFERENCES, parseNotificationPreferences, -} from '../../../../apps/mobile/src/host/device-notification-preferences.js'; -import { - PUSH_KINDS, - type PushKind, - type PushPreferences, -} from '../../../../apps/mobile/src/host/push.js'; -import type { HumanAttentionItem } from '../../../../apps/mobile/src/host/wire.js'; +} from '@botharness/host-client/device-notification-preferences'; +import { PUSH_KINDS, type PushKind, type PushPreferences } from '@botharness/host-client/push'; +import type { HumanAttentionItem } from '@botharness/host-protocol/wire'; import type { RemoteHost, HostStorage, RemoteConversationTarget } from './remote-hosts.js'; import { noticeBody, diff --git a/packages/client/src/client/roster-config.ts b/packages/client/src/client/roster-config.ts index 1b592a148f..e84ec60db3 100644 --- a/packages/client/src/client/roster-config.ts +++ b/packages/client/src/client/roster-config.ts @@ -1,4 +1,7 @@ -import { isBotModeSortMode, type BotModeSortMode } from '../bot-mode-settings.js'; +import { + isBotModeSortMode, + type BotModeSortMode, +} from '@botharness/host-client/shared/bot-mode-settings'; import { uniqueStrings } from './roster.js'; export interface RosterConfig { diff --git a/packages/client/src/client/roster-order.ts b/packages/client/src/client/roster-order.ts index 2f40bc6aaf..dc800bb89a 100644 --- a/packages/client/src/client/roster-order.ts +++ b/packages/client/src/client/roster-order.ts @@ -1,5 +1,5 @@ import { isHumanDmChannel } from './channel-kind.js'; -import type { BotModeSortMode } from '../bot-mode-settings.js'; +import type { BotModeSortMode } from '@botharness/host-client/shared/bot-mode-settings'; import { reconcileOrder, sameIds } from './roster.js'; import type { TopOrderEntry } from './roster.js'; import type { ChannelSummary } from './store.js'; diff --git a/packages/client/src/client/session-maintenance.ts b/packages/client/src/client/session-maintenance.ts index 925b3a2f86..e87d1c26c7 100644 --- a/packages/client/src/client/session-maintenance.ts +++ b/packages/client/src/client/session-maintenance.ts @@ -2,7 +2,7 @@ import { useMemo, useSyncExternalStore } from 'react'; import { sessionMaintenanceFor, type SessionMaintenanceNotice, -} from '../shared/session-maintenance.js'; +} from '@botharness/host-client/shared/session-maintenance'; import type { BridgeActions } from './actions.js'; import type { BotHarnessTranslate } from './locale.js'; const unavailableOwner = {}; diff --git a/packages/client/src/client/shortcut-help.tsx b/packages/client/src/client/shortcut-help.tsx index 3d5c0d2ef1..4b2627a16a 100644 --- a/packages/client/src/client/shortcut-help.tsx +++ b/packages/client/src/client/shortcut-help.tsx @@ -11,7 +11,7 @@ import * as stylex from '@stylexjs/stylex'; import { Button, IconEditOutlineRegular } from '@deepseek-ai/dsh-client-ui-primitives'; import { Tooltip } from './ds/tooltip.js'; -import type { BotModeSendKey } from '../bot-mode-settings.js'; +import type { BotModeSendKey } from '@botharness/host-client/shared/bot-mode-settings'; import type { BotModePrefsSnapshot } from './bot-mode-prefs.js'; import { isApplePlatform, KeyCombo, shortcutKeyLabel, type ShortcutKey } from './ds/kbd.js'; import { IconButton } from './ds/icon-button.js'; diff --git a/packages/client/src/client/storage-settings.tsx b/packages/client/src/client/storage-settings.tsx index c184303f18..9dc4a5397b 100644 --- a/packages/client/src/client/storage-settings.tsx +++ b/packages/client/src/client/storage-settings.tsx @@ -2,7 +2,7 @@ import { useRef, useState, type ReactElement } from 'react'; import * as stylex from '@stylexjs/stylex'; import { Button, Checkbox } from '@deepseek-ai/dsh-client-ui-primitives'; import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'; -import { MethodRefused } from '../../../../apps/mobile/src/host/client.js'; +import { MethodRefused } from '@botharness/host-client/client'; import { STORAGE_MEDIA_KINDS, type StorageCleanupScope, @@ -12,7 +12,7 @@ import { type StorageMessagesPreview, type StorageMessagesResult, type StorageUsage, -} from '../../../../apps/mobile/src/host/storage.js'; +} from '@botharness/host-client/storage'; import { formatBotZipSize } from './bot-zip.js'; import { diff --git a/packages/client/src/client/store.ts b/packages/client/src/client/store.ts index fad2281142..94d60ca99a 100644 --- a/packages/client/src/client/store.ts +++ b/packages/client/src/client/store.ts @@ -12,7 +12,7 @@ import type { RosterSection, TopOrderEntry } from './roster.js'; import type { PurgedPlacement } from '../../../core/src/purge/contracts.js'; import type { PixelBannerRecipe } from '@botharness/pixel-banner'; import { createContentRedactions, sameItems } from './content-redactions.js'; -import { ActivitySmoother } from './activity-smoothing.js'; +import { ActivitySmoother } from '@botharness/host-client/shared/activity-smoothing'; export type ClientMode = 'dsh' | 'bot'; @@ -200,8 +200,8 @@ export interface SessionFailureCard { status?: number; detail: string; context?: string; - progress?: import('../shared/turn-continuation.js').SessionFailureProgress; - autoContinue?: import('../shared/turn-continuation.js').SessionFailureAutoContinue; + progress?: import('@botharness/host-client/shared/turn-continuation').SessionFailureProgress; + autoContinue?: import('@botharness/host-client/shared/turn-continuation').SessionFailureAutoContinue; } export interface ChannelReaction { diff --git a/packages/client/src/client/tob-presentation.ts b/packages/client/src/client/tob-presentation.ts index f15897efb9..22da5472a4 100644 --- a/packages/client/src/client/tob-presentation.ts +++ b/packages/client/src/client/tob-presentation.ts @@ -1,5 +1,5 @@ import { useSyncExternalStore } from 'react'; -import type { BotModeIcon } from '../bot-mode-settings.js'; +import type { BotModeIcon } from '@botharness/host-client/shared/bot-mode-settings'; import type { BotSummary } from './store.js'; import { useClientStore } from './use-client-store.js'; import { useMessageHost } from './message-host.js'; diff --git a/packages/client/src/client/tool-approval-card.tsx b/packages/client/src/client/tool-approval-card.tsx index 0a5e9887a6..3e1d88b540 100644 --- a/packages/client/src/client/tool-approval-card.tsx +++ b/packages/client/src/client/tool-approval-card.tsx @@ -17,7 +17,7 @@ import { subscribeWorkspaceGrantChanges } from './workspace-grant-events.js'; import type { CompanionRequestTarget } from './companion-requests.js'; import { approvalCountdown } from './approval-countdown.js'; import { ApprovalInput } from './approval-input.js'; -import { approvalSummary } from './approval-diff.js'; +import { approvalSummary } from '@botharness/host-client/shared/approval-diff'; import { BotCreateApprovalPreview, botCreateArgs } from './bot-create-approval.js'; export function ToolApprovalCard({ diff --git a/packages/client/src/client/turn-continuation.ts b/packages/client/src/client/turn-continuation.ts index a7480747f2..f1c431ed26 100644 --- a/packages/client/src/client/turn-continuation.ts +++ b/packages/client/src/client/turn-continuation.ts @@ -6,7 +6,7 @@ import { subscribeSeconds, turnContinuationFor, type TurnContinuationNotice, -} from '../shared/turn-continuation.js'; +} from '@botharness/host-client/shared/turn-continuation'; import type { BridgeActions } from './actions.js'; import type { BotHarnessTranslate } from './locale.js'; import { store } from './store.js'; diff --git a/packages/client/src/index.ts b/packages/client/src/index.ts index 41277343d0..5b6a6bfd98 100644 --- a/packages/client/src/index.ts +++ b/packages/client/src/index.ts @@ -24,7 +24,7 @@ import { type BotModeSendKey, type BotModeSortMode, type BotModeSettings, -} from './bot-mode-settings.js'; +} from '@botharness/host-client/shared/bot-mode-settings'; export const name = 'botharness-client'; stampReleaseComponent(apply, import.meta.url); diff --git a/packages/client/test/activity-environments.test.ts b/packages/client/test/activity-environments.test.ts index c3f459c2a2..315ea77dd4 100644 --- a/packages/client/test/activity-environments.test.ts +++ b/packages/client/test/activity-environments.test.ts @@ -5,7 +5,7 @@ import { } from '../src/client/activity-environments.js'; import type { ActivityQuery } from '../src/client/activity-feed.js'; import type { ActivityListState, HumanAttentionItem } from '../src/client/store.js'; -import type { InboxSnapshot } from '../../../apps/mobile/src/host/inbox.js'; +import type { InboxSnapshot } from '@botharness/host-client/inbox'; const query: ActivityQuery = { category: 'all', diff --git a/packages/client/test/activity-inbox-clear.test.tsx b/packages/client/test/activity-inbox-clear.test.tsx index 5a102b33d6..a7b79ee623 100644 --- a/packages/client/test/activity-inbox-clear.test.tsx +++ b/packages/client/test/activity-inbox-clear.test.tsx @@ -57,7 +57,7 @@ import { ActivityInboxMenu } from '../src/client/activity-inbox-menu.js'; import { zhTranslate } from '../src/client/locale.js'; import { store, type HumanAttentionItem } from '../src/client/store.js'; import * as remoteHostModule from '../src/client/remote-hosts.js'; -import { FakeHost } from '../../../apps/mobile/test/fake-host.js'; +import { FakeHost } from '../../host-client/test/fake-host.js'; const repair: HumanAttentionItem = { id: 'repair:e1:ada', diff --git a/packages/client/test/activity-list-keyboard-batch.test.ts b/packages/client/test/activity-list-keyboard-batch.test.ts index f9aec28bd1..2291cd6621 100644 --- a/packages/client/test/activity-list-keyboard-batch.test.ts +++ b/packages/client/test/activity-list-keyboard-batch.test.ts @@ -359,10 +359,10 @@ describe('Human Inbox snooze', () => { import { remoteActivityPage } from '../src/client/remote-activity.js'; import { createRemoteHosts, REMOTE_HOSTS_STORAGE_KEY } from '../src/client/remote-hosts.js'; import { ActivityCenterView } from '../src/client/activity-center-view.js'; -import { FakeHost } from '../../../apps/mobile/test/fake-host.js'; +import { FakeHost } from '../../host-client/test/fake-host.js'; import { createDockPanelRegistry } from '../src/client/dock-panels.js'; import { en, zhTranslate } from '../src/client/locale.js'; -import type { InboxSnapshot } from '../../../apps/mobile/src/host/inbox.js'; +import type { InboxSnapshot } from '@botharness/host-client/inbox'; import { bindTobPresentation } from '../src/client/tob-presentation.js'; async function remoteFixture(host: FakeHost) { diff --git a/packages/client/test/activity-smoothing.test.ts b/packages/client/test/activity-smoothing.test.ts index d4f5369c1b..fb26a2335f 100644 --- a/packages/client/test/activity-smoothing.test.ts +++ b/packages/client/test/activity-smoothing.test.ts @@ -3,7 +3,7 @@ import { ACTIVITY_DETAIL_MS, ACTIVITY_HOLD_MS, ActivitySmoother, -} from '../src/client/activity-smoothing.js'; +} from '@botharness/host-client/shared/activity-smoothing'; import { createStore, type BotSummary, diff --git a/packages/client/test/bot-session-folders.test.tsx b/packages/client/test/bot-session-folders.test.tsx index 61f429bb9f..a9a393ffe8 100644 --- a/packages/client/test/bot-session-folders.test.tsx +++ b/packages/client/test/bot-session-folders.test.tsx @@ -10,7 +10,7 @@ import { type BotSessionFoldersProps, } from '../src/client/bot-session-folders.js'; import { zhTranslate } from '../src/client/locale.js'; -import type { BotModeIcon } from '../src/bot-mode-settings.js'; +import type { BotModeIcon } from '@botharness/host-client/shared/bot-mode-settings'; import { createStore, type BotSummary } from '../src/client/store.js'; vi.mock('@deepseek-ai/dsh-client-ui-primitives', () => ({ diff --git a/packages/client/test/bot-sidebar.test.ts b/packages/client/test/bot-sidebar.test.ts index 24771113af..8ed0786678 100644 --- a/packages/client/test/bot-sidebar.test.ts +++ b/packages/client/test/bot-sidebar.test.ts @@ -134,7 +134,7 @@ import { createQuickSwitcherLauncher } from '../src/client/quick-switcher-launch import { typeInto } from './primitive-mocks.js'; import { UNGROUPED_MOVE_TARGET } from '../src/client/section-management.js'; import type { BotModePrefsSnapshot } from '../src/client/bot-mode-prefs.js'; -import { PINNED_SORT_SCOPE_ID } from '../src/bot-mode-settings.js'; +import { PINNED_SORT_SCOPE_ID } from '@botharness/host-client/shared/bot-mode-settings'; import { zh, zhTranslate } from '../src/client/locale.js'; import { formatChannelListTime } from '../src/client/channel-row-status.js'; import type { RosterConfig } from '../src/client/roster-config.js'; diff --git a/packages/core/test/companion-channel-scope.test.ts b/packages/client/test/companion-channel-scope.test.ts similarity index 97% rename from packages/core/test/companion-channel-scope.test.ts rename to packages/client/test/companion-channel-scope.test.ts index c4bc52fee9..2fabc2b9fb 100644 --- a/packages/core/test/companion-channel-scope.test.ts +++ b/packages/client/test/companion-channel-scope.test.ts @@ -1,11 +1,11 @@ -import { OWNER_HUMAN_CONTEXT } from '../src/humans/context.js'; +import { OWNER_HUMAN_CONTEXT } from '../../core/src/humans/context.js'; import { expect, it } from 'vitest'; -import { createCore } from '../src/plugin.js'; -import { createTempRoot, FIXED_NOW } from './helpers.js'; -import { WindowCompanion } from '../../client/src/client/window-companion.js'; -import { createCompanionFeed } from '../src/companions/feed.js'; -import type { ChannelRecord } from '../src/channels/channel.js'; -import { attachOperationalModule } from '../src/database/owner.js'; +import { createCore } from '../../core/src/plugin.js'; +import { createTempRoot, FIXED_NOW } from '../../core/test/helpers.js'; +import { WindowCompanion } from '../src/client/window-companion.js'; +import { createCompanionFeed } from '../../core/src/companions/feed.js'; +import type { ChannelRecord } from '../../core/src/channels/channel.js'; +import { attachOperationalModule } from '../../core/src/database/owner.js'; it.each([ ['own-dm', true, true, ['own']], diff --git a/packages/core/test/companion-feed.test.ts b/packages/client/test/companion-feed.test.ts similarity index 92% rename from packages/core/test/companion-feed.test.ts rename to packages/client/test/companion-feed.test.ts index b483146f21..37822e6065 100644 --- a/packages/core/test/companion-feed.test.ts +++ b/packages/client/test/companion-feed.test.ts @@ -1,10 +1,10 @@ -import { OWNER_HUMAN_CONTEXT } from '../src/humans/context.js'; +import { OWNER_HUMAN_CONTEXT } from '../../core/src/humans/context.js'; import { afterEach, expect, it } from 'vitest'; -import { createCompanionFeed, type CompanionFeed } from '../src/companions/feed.js'; -import type { PersonaBotOutputCommitted } from '../src/channels/output.js'; -import { createCore } from '../src/plugin.js'; -import { createTempRoot, FIXED_NOW } from './helpers.js'; -import { WindowCompanion } from '../../client/src/client/window-companion.js'; +import { createCompanionFeed, type CompanionFeed } from '../../core/src/companions/feed.js'; +import type { PersonaBotOutputCommitted } from '../../core/src/channels/output.js'; +import { createCore } from '../../core/src/plugin.js'; +import { createTempRoot, FIXED_NOW } from '../../core/test/helpers.js'; +import { WindowCompanion } from '../src/client/window-companion.js'; const feeds: CompanionFeed[] = []; afterEach(() => { diff --git a/packages/core/test/companion-recovery.test.ts b/packages/client/test/companion-recovery.test.ts similarity index 98% rename from packages/core/test/companion-recovery.test.ts rename to packages/client/test/companion-recovery.test.ts index bf23ae4425..a61d358e5a 100644 --- a/packages/core/test/companion-recovery.test.ts +++ b/packages/client/test/companion-recovery.test.ts @@ -1,9 +1,9 @@ -import { OWNER_HUMAN_CONTEXT } from '../src/humans/context.js'; +import { OWNER_HUMAN_CONTEXT } from '../../core/src/humans/context.js'; import { expect, it, vi } from 'vitest'; -import { createCore } from '../src/plugin.js'; -import { createTempRoot, FIXED_NOW } from './helpers.js'; -import { WindowCompanions } from '../../client/src/client/window-companions.js'; -import { createCompanionFeed } from '../src/companions/feed.js'; +import { createCore } from '../../core/src/plugin.js'; +import { createTempRoot, FIXED_NOW } from '../../core/test/helpers.js'; +import { WindowCompanions } from '../src/client/window-companions.js'; +import { createCompanionFeed } from '../../core/src/companions/feed.js'; it.each(['header', 'query', 'header-priority'])( 'bounds canonical recovery reads and sixty-second leases with %s resumption', diff --git a/packages/core/test/companion-terminal-recovery.test.ts b/packages/client/test/companion-terminal-recovery.test.ts similarity index 94% rename from packages/core/test/companion-terminal-recovery.test.ts rename to packages/client/test/companion-terminal-recovery.test.ts index 5486d411d8..8377364813 100644 --- a/packages/core/test/companion-terminal-recovery.test.ts +++ b/packages/client/test/companion-terminal-recovery.test.ts @@ -1,8 +1,8 @@ -import { OWNER_HUMAN_CONTEXT } from '../src/humans/context.js'; +import { OWNER_HUMAN_CONTEXT } from '../../core/src/humans/context.js'; import { expect, it, vi } from 'vitest'; -import { createCore } from '../src/plugin.js'; -import { createTempRoot, FIXED_NOW } from './helpers.js'; -import { WindowCompanions } from '../../client/src/client/window-companions.js'; +import { createCore } from '../../core/src/plugin.js'; +import { createTempRoot, FIXED_NOW } from '../../core/test/helpers.js'; +import { WindowCompanions } from '../src/client/window-companions.js'; it('resumes canonical unplayed replies after terminal transport failures without losing reading or leaking retries', async () => { vi.useFakeTimers({ toFake: ['setTimeout', 'clearTimeout', 'performance'] }); diff --git a/packages/client/test/connection-control.test.ts b/packages/client/test/connection-control.test.ts index 5aebbc6b93..14acf39c21 100644 --- a/packages/client/test/connection-control.test.ts +++ b/packages/client/test/connection-control.test.ts @@ -1,5 +1,5 @@ import { expect, it, vi } from 'vitest'; -import { FakeHost } from '../../../apps/mobile/test/fake-host.js'; +import { FakeHost } from '../../host-client/test/fake-host.js'; import { pairingLink } from '../../core/src/devices/http.js'; import { createRemoteHosts } from '../src/client/remote-hosts.js'; import { createConnectionControl } from '../src/client/connection-control.js'; diff --git a/packages/client/test/connection-hosts.test.tsx b/packages/client/test/connection-hosts.test.tsx index 3378a4c795..351d7689d4 100644 --- a/packages/client/test/connection-hosts.test.tsx +++ b/packages/client/test/connection-hosts.test.tsx @@ -2,8 +2,8 @@ import { act, type ReactNode } from 'react'; import { createRoot } from 'react-dom/client'; import { afterEach, beforeEach, expect, it, vi } from 'vitest'; -import type { HostClient } from '../../../apps/mobile/src/host/client.js'; -import { FakeHost } from '../../../apps/mobile/test/fake-host.js'; +import type { HostClient } from '@botharness/host-client/client'; +import { FakeHost } from '../../host-client/test/fake-host.js'; import { ConnectionHosts, HostDetails } from '../src/client/connection-hosts.js'; import { createRemoteHosts, diff --git a/packages/client/test/connection-management.test.ts b/packages/client/test/connection-management.test.ts index faaf2cb55d..61041468d8 100644 --- a/packages/client/test/connection-management.test.ts +++ b/packages/client/test/connection-management.test.ts @@ -1,7 +1,7 @@ import { expect, it, vi } from 'vitest'; -import { FakeHost } from '../../../apps/mobile/test/fake-host.js'; -import type { SavedHost } from '../../../apps/mobile/src/host/hosts.js'; -import type { HostClient } from '../../../apps/mobile/src/host/client.js'; +import { FakeHost } from '../../host-client/test/fake-host.js'; +import type { SavedHost } from '@botharness/host-client/hosts'; +import type { HostClient } from '@botharness/host-client/client'; import type { ConnectionMutation } from '../../core/src/devices/connection-operation.js'; import { connectionMutationSchema, diff --git a/packages/client/test/connection-relay.test.ts b/packages/client/test/connection-relay.test.ts index 4314d35f65..4986b75119 100644 --- a/packages/client/test/connection-relay.test.ts +++ b/packages/client/test/connection-relay.test.ts @@ -1,5 +1,5 @@ import { afterEach, expect, it, vi } from 'vitest'; -import { FakeHost } from '../../../apps/mobile/test/fake-host.js'; +import { FakeHost } from '../../host-client/test/fake-host.js'; import { createAppearanceControl } from '../../core/src/appearance/control.js'; import { pairingLink } from '../../core/src/devices/http.js'; import { Appearance } from '../src/client/appearance.js'; diff --git a/packages/client/test/content-redactions.test.ts b/packages/client/test/content-redactions.test.ts index 37f92e754e..7152b7632e 100644 --- a/packages/client/test/content-redactions.test.ts +++ b/packages/client/test/content-redactions.test.ts @@ -2,7 +2,7 @@ import { expect, it, vi } from 'vitest'; import { createStore, type ChannelMessage, type ChannelSummary } from '../src/client/store.js'; import { createActions } from '../src/client/actions.js'; import { getGenuiDocumentView } from '../src/client/genui-document-view.js'; -import { getGenuiPrivateView } from '../src/client/genui-view.js'; +import { getGenuiPrivateView } from '@botharness/host-client/shared/genui-view'; import { initialGenuiView, GenuiError } from '../../core/src/channels/genui.js'; import { initialGenuiDocumentState } from '../../core/src/channels/genui-document.js'; import { syntheticGenuiDocument } from '../../core/test/fixtures/genui-document.js'; diff --git a/packages/client/test/environment-creation-form.test.tsx b/packages/client/test/environment-creation-form.test.tsx index 9117a7cdaa..c49c265d47 100644 --- a/packages/client/test/environment-creation-form.test.tsx +++ b/packages/client/test/environment-creation-form.test.tsx @@ -2,7 +2,7 @@ import { act, createElement, type ReactNode } from 'react'; import { createRoot } from 'react-dom/client'; import { afterEach, beforeEach, expect, it, vi } from 'vitest'; -import type { HostClient } from '../../../apps/mobile/src/host/client.js'; +import type { HostClient } from '@botharness/host-client/client'; import type { BridgeCall } from '../src/client/bridge.js'; const fixture = vi.hoisted(() => ({ diff --git a/packages/client/test/environment-creation-recovery.test.ts b/packages/client/test/environment-creation-recovery.test.ts index 8cef89bfdc..617315ea41 100644 --- a/packages/client/test/environment-creation-recovery.test.ts +++ b/packages/client/test/environment-creation-recovery.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it, vi } from 'vitest'; -import type { HostClient } from '../../../apps/mobile/src/host/client.js'; +import type { HostClient } from '@botharness/host-client/client'; import type { BridgeActions } from '../src/client/actions.js'; import type { CreatedBot } from '../src/client/bridge.js'; import { diff --git a/packages/client/test/environment-creation.test.ts b/packages/client/test/environment-creation.test.ts index fd8dfaa3da..89f64e6a7b 100644 --- a/packages/client/test/environment-creation.test.ts +++ b/packages/client/test/environment-creation.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it, vi } from 'vitest'; -import { MethodRefused, type HostClient } from '../../../apps/mobile/src/host/client.js'; +import { MethodRefused, type HostClient } from '@botharness/host-client/client'; import { BridgeCallError, type CreatedBot } from '../src/client/bridge.js'; import { bindBotCreationOwner, diff --git a/packages/client/test/environment-model-draft.test.tsx b/packages/client/test/environment-model-draft.test.tsx index 47986bf959..da931997a9 100644 --- a/packages/client/test/environment-model-draft.test.tsx +++ b/packages/client/test/environment-model-draft.test.tsx @@ -8,7 +8,7 @@ import { } from 'react'; import { createRoot } from 'react-dom/client'; import { expect, it, vi } from 'vitest'; -import type { ModelSettingsClient } from '../../../apps/mobile/src/host/bot-settings.js'; +import type { ModelSettingsClient } from '@botharness/host-client/bot-settings'; vi.mock('@deepseek-ai/dsh-client-ui-primitives', () => ({ Input: (props: InputHTMLAttributes) => createElement('input', props), diff --git a/packages/client/test/environment-settings-identity.test.tsx b/packages/client/test/environment-settings-identity.test.tsx index e3bbbf6a14..a32ad2cab5 100644 --- a/packages/client/test/environment-settings-identity.test.tsx +++ b/packages/client/test/environment-settings-identity.test.tsx @@ -2,8 +2,8 @@ import { act, createElement, type InputHTMLAttributes, type ReactNode } from 'react'; import { createRoot } from 'react-dom/client'; import { afterEach, beforeEach, expect, it, vi } from 'vitest'; -import type { ModelSettingsClient } from '../../../apps/mobile/src/host/bot-settings.js'; -import { DEFAULT_HOST_LOOK, type HostLook } from '../../../apps/mobile/src/ui/design/host-look.js'; +import type { ModelSettingsClient } from '@botharness/host-client/bot-settings'; +import { DEFAULT_HOST_LOOK, type HostLook } from '@botharness/host-client/ui/design/host-look'; import type { BridgeCall } from '../src/client/bridge.js'; import { mountLocalEnvironmentSettings } from '../src/client/environment-settings-source.js'; diff --git a/packages/client/test/environment-settings-source.test.ts b/packages/client/test/environment-settings-source.test.ts index b19e7e092b..fef0283fce 100644 --- a/packages/client/test/environment-settings-source.test.ts +++ b/packages/client/test/environment-settings-source.test.ts @@ -4,10 +4,7 @@ import { localEnvironmentSettings, mountLocalEnvironmentSettings, } from '../src/client/environment-settings-source.js'; -import { - modelSettingsResource, - setModelRoute, -} from '../../../apps/mobile/src/host/model-settings.js'; +import { modelSettingsResource, setModelRoute } from '@botharness/host-client/model-settings'; const releases: (() => void)[] = []; afterEach(() => { diff --git a/packages/client/test/host-bridge-call.test.ts b/packages/client/test/host-bridge-call.test.ts index bf5c590f02..d44a5c9e9b 100644 --- a/packages/client/test/host-bridge-call.test.ts +++ b/packages/client/test/host-bridge-call.test.ts @@ -1,6 +1,6 @@ import { expect, it, vi } from 'vitest'; -import { createHostClient, deviceRefusal } from '../../../apps/mobile/src/host/client.js'; -import { FakeHost } from '../../../apps/mobile/test/fake-host.js'; +import { createHostClient, deviceRefusal } from '@botharness/host-client/client'; +import { FakeHost } from '../../host-client/test/fake-host.js'; import { BridgeCallError } from '../src/client/bridge.js'; import { hostBridgeCall } from '../src/client/host-bridge-call.js'; diff --git a/packages/client/test/host-look-control.test.ts b/packages/client/test/host-look-control.test.ts index 96bbdb1a77..40068e97bf 100644 --- a/packages/client/test/host-look-control.test.ts +++ b/packages/client/test/host-look-control.test.ts @@ -1,6 +1,6 @@ import { afterEach, describe, expect, it, vi } from 'vitest'; -import { createHostLooks } from '../../../apps/mobile/src/host/host-look.js'; -import { shownHostName, type HostLook } from '../../../apps/mobile/src/ui/design/host-look.js'; +import { createHostLooks } from '@botharness/host-client/host-look'; +import { shownHostName, type HostLook } from '@botharness/host-client/ui/design/host-look'; import { controlHostLook } from '../src/client/host-look-control.js'; async function setup() { diff --git a/packages/client/test/host-look-owner.test.ts b/packages/client/test/host-look-owner.test.ts index d6a968a27a..93b9f9b940 100644 --- a/packages/client/test/host-look-owner.test.ts +++ b/packages/client/test/host-look-owner.test.ts @@ -1,6 +1,6 @@ import { expect, it, vi } from 'vitest'; -import { createHostLooks } from '../../../apps/mobile/src/host/host-look.js'; -import { DEFAULT_HOST_LOOK } from '../../../apps/mobile/src/ui/design/host-look.js'; +import { createHostLooks } from '@botharness/host-client/host-look'; +import { DEFAULT_HOST_LOOK } from '@botharness/host-client/ui/design/host-look'; it('preserves the native synchronous set and one-time legacy migration contracts', async () => { const write = vi.fn(); diff --git a/packages/client/test/host-look-r1-regression.test.ts b/packages/client/test/host-look-r1-regression.test.ts index cb603609f1..0c86023a11 100644 --- a/packages/client/test/host-look-r1-regression.test.ts +++ b/packages/client/test/host-look-r1-regression.test.ts @@ -1,6 +1,6 @@ import { expect, it, vi } from 'vitest'; -import { createHostLooks } from '../../../apps/mobile/src/host/host-look.js'; -import { DEFAULT_HOST_LOOK, type HostLook } from '../../../apps/mobile/src/ui/design/host-look.js'; +import { createHostLooks } from '@botharness/host-client/host-look'; +import { DEFAULT_HOST_LOOK, type HostLook } from '@botharness/host-client/ui/design/host-look'; import { runHostLook } from '../../core/src/bots/cli-host-look.js'; import { controlHostLook } from '../src/client/host-look-control.js'; diff --git a/packages/client/test/host-look-relay.test.ts b/packages/client/test/host-look-relay.test.ts index fac22d700a..e9ef4ff7c1 100644 --- a/packages/client/test/host-look-relay.test.ts +++ b/packages/client/test/host-look-relay.test.ts @@ -1,5 +1,5 @@ import { afterEach, expect, it, vi } from 'vitest'; -import { createHostLooks } from '../../../apps/mobile/src/host/host-look.js'; +import { createHostLooks } from '@botharness/host-client/host-look'; import { createAppearanceControl } from '../../core/src/appearance/control.js'; import { Appearance } from '../src/client/appearance.js'; import { mountAppearanceControl } from '../src/client/appearance-control.js'; diff --git a/packages/client/test/host-looks.test.ts b/packages/client/test/host-looks.test.ts index 3a2badea22..486ad58cdc 100644 --- a/packages/client/test/host-looks.test.ts +++ b/packages/client/test/host-looks.test.ts @@ -6,7 +6,7 @@ import { withHostColor, withHostIcon, withHostName, -} from '../../../apps/mobile/src/ui/design/host-look.js'; +} from '@botharness/host-client/ui/design/host-look'; import { HOST_LOOKS_STORAGE_KEY, browserHostLooks, diff --git a/packages/client/test/host-name-draft.test.tsx b/packages/client/test/host-name-draft.test.tsx index 409b94fb88..16ecb0be45 100644 --- a/packages/client/test/host-name-draft.test.tsx +++ b/packages/client/test/host-name-draft.test.tsx @@ -2,7 +2,7 @@ import { act, createElement, type InputHTMLAttributes, type ReactNode } from 'react'; import { createRoot } from 'react-dom/client'; import { expect, it, vi } from 'vitest'; -import { DEFAULT_HOST_LOOK, type HostLook } from '../../../apps/mobile/src/ui/design/host-look.js'; +import { DEFAULT_HOST_LOOK, type HostLook } from '@botharness/host-client/ui/design/host-look'; let look: HostLook = { ...DEFAULT_HOST_LOOK, name: 'Old alias' }; const update = vi.fn(async (_hostId: string, transform: (value: HostLook) => HostLook) => { diff --git a/packages/client/test/member-owner-sources.test.ts b/packages/client/test/member-owner-sources.test.ts index 90d67e3882..e2bb2ff1b5 100644 --- a/packages/client/test/member-owner-sources.test.ts +++ b/packages/client/test/member-owner-sources.test.ts @@ -45,8 +45,8 @@ it.each(['member', 'admin'])( vi.stubGlobal('indexedDB', { open }); const { createRemoteHosts, remoteHosts, REMOTE_HOSTS_STORAGE_KEY, HOST_TAB_STORAGE_KEY } = await import('../src/client/remote-hosts.js'); - const { createHostClient } = await import('../../../apps/mobile/src/host/client.js'); - const { FakeHost } = await import('../../../apps/mobile/test/fake-host.js'); + const { createHostClient } = await import('@botharness/host-client/client'); + const { FakeHost } = await import('../../host-client/test/fake-host.js'); const ownerClient = createHostClient({ hostId: 'owner-host', routes: ['http://127.0.0.1:47001'], diff --git a/packages/client/test/memory-image-view.test.tsx b/packages/client/test/memory-image-view.test.tsx index ca9e5a60ec..2adbc0cfac 100644 --- a/packages/client/test/memory-image-view.test.tsx +++ b/packages/client/test/memory-image-view.test.tsx @@ -9,8 +9,8 @@ vi.mock('@deepseek-ai/dsh-client-ui-primitives', () => ({ })); import { MemoryImageView, MemoryImageDiff } from '../src/client/memory-image-view.js'; import { MessageHostContext } from '../src/client/message-host.js'; -import { createHostClient } from '../../../apps/mobile/src/host/client.js'; -import { FakeHost } from '../../../apps/mobile/test/fake-host.js'; +import { createHostClient } from '@botharness/host-client/client'; +import { FakeHost } from '../../host-client/test/fake-host.js'; import type { MemoryImage } from '../src/client/bridge.js'; import type { BotHarnessTranslate } from '../src/client/locale.js'; const t: BotHarnessTranslate = (key) => key; diff --git a/packages/client/test/mobile-bot-panel.test.ts b/packages/client/test/mobile-bot-panel.test.ts index 2bfc87fa15..ab99bb002f 100644 --- a/packages/client/test/mobile-bot-panel.test.ts +++ b/packages/client/test/mobile-bot-panel.test.ts @@ -65,7 +65,7 @@ import { en, zhTranslate, type BotHarnessTranslate } from '../src/client/locale. import { store } from '../src/client/store.js'; import { ComposerDraftStore } from '../src/client/composer-draft-store.js'; import { BotModePrefs, type BotModePrefsSnapshot } from '../src/client/bot-mode-prefs.js'; -import type { BotModeIcon } from '../src/bot-mode-settings.js'; +import type { BotModeIcon } from '@botharness/host-client/shared/bot-mode-settings'; import type { BridgeActions } from '../src/client/actions.js'; let container: HTMLDivElement; diff --git a/packages/client/test/mobile-import-gateway.test.ts b/packages/client/test/mobile-import-gateway.test.ts index 67d30ca58d..ef95cf7276 100644 --- a/packages/client/test/mobile-import-gateway.test.ts +++ b/packages/client/test/mobile-import-gateway.test.ts @@ -5,8 +5,8 @@ import { execFileSync } from 'node:child_process'; import { writeFileSync } from 'node:fs'; import { join } from 'node:path'; import { afterEach, expect, it, vi } from 'vitest'; -import { createBotCreationController } from '../../../apps/mobile/src/host/bot-creation'; -import { botCreationTransport } from '../../../apps/mobile/src/host/bot-creation-transport'; +import { createBotCreationController } from '@botharness/host-client/bot-creation'; +import { botCreationTransport } from '@botharness/host-client/bot-creation-transport'; import { createCore } from '../../core/src/plugin'; import { createBridgeMethods } from '../../core/src/bridge/methods'; import { registerBridge } from '../../core/src/bridge/rpc'; diff --git a/packages/client/test/model-preset-profile.test.ts b/packages/client/test/model-preset-profile.test.ts index 9929183ce5..0b3e103742 100644 --- a/packages/client/test/model-preset-profile.test.ts +++ b/packages/client/test/model-preset-profile.test.ts @@ -118,7 +118,7 @@ import { OnboardingController } from '../src/client/onboarding.js'; import { ModelPresetProfile } from '../src/client/model-preset-profile.js'; import { OnboardingModelDialog, OnboardingWelcome } from '../src/client/onboarding-view.js'; import { RemoteHostModels } from '../src/client/remote-host-models.js'; -import { createHostClient } from '../../../apps/mobile/src/host/client.js'; +import { createHostClient } from '@botharness/host-client/client'; import { createCore } from '../../core/src/plugin.js'; import { createBridgeMethods } from '../../core/src/bridge/methods.js'; import { createTempRoot } from '../../core/test/helpers.js'; diff --git a/packages/client/test/qr-image.test.ts b/packages/client/test/qr-image.test.ts index ba83cc00a1..d7058c8e93 100644 --- a/packages/client/test/qr-image.test.ts +++ b/packages/client/test/qr-image.test.ts @@ -2,7 +2,7 @@ import { expect, it } from 'vitest'; import { encode } from 'uqr'; import { decodeQrPixels, QR_IMAGE_MAX_EDGE, readQrImage } from '../src/client/qr-image.js'; import { pairingLink } from '../../core/src/devices/http.js'; -import { parsePairingLink } from '../../../apps/mobile/src/host/pairing.js'; +import { parsePairingLink } from '@botharness/host-client/pairing'; it('reads a real pairing QR image with the full identity and routes unchanged', () => { const link = pairingLink({ diff --git a/packages/client/test/relationships.test.ts b/packages/client/test/relationships.test.ts index 8254e280c3..518711bfb2 100644 --- a/packages/client/test/relationships.test.ts +++ b/packages/client/test/relationships.test.ts @@ -1,5 +1,5 @@ import { afterEach, expect, it, vi } from 'vitest'; -import { FakeHost } from '../../../apps/mobile/test/fake-host.js'; +import { FakeHost } from '../../host-client/test/fake-host.js'; import { pairingLink } from '../../core/src/devices/http.js'; import { createRemoteHosts } from '../src/client/remote-hosts.js'; import { pairReciprocalHost } from '../src/client/relationships.js'; diff --git a/packages/client/test/remote-avatar.test.tsx b/packages/client/test/remote-avatar.test.tsx index e0759ec04f..ba02852969 100644 --- a/packages/client/test/remote-avatar.test.tsx +++ b/packages/client/test/remote-avatar.test.tsx @@ -1,7 +1,7 @@ import { createElement } from 'react'; import { renderToStaticMarkup } from 'react-dom/server'; import { describe, expect, it, vi } from 'vitest'; -import type { RosterBot, RosterView } from '../../../apps/mobile/src/host/client.js'; +import type { RosterBot, RosterView } from '@botharness/host-client/client'; import { RemoteAvatar } from '../src/client/remote-avatar.js'; import { bindTobPresentation } from '../src/client/tob-presentation.js'; import { zhTranslate } from '../src/client/locale.js'; diff --git a/packages/client/test/remote-conversation-source.test.tsx b/packages/client/test/remote-conversation-source.test.tsx index 6c8be53ef2..6f471ff039 100644 --- a/packages/client/test/remote-conversation-source.test.tsx +++ b/packages/client/test/remote-conversation-source.test.tsx @@ -75,7 +75,7 @@ vi.mock('@deepseek-ai/dsh-client-ui-primitives', async () => { }; }); -import { FakeHost } from '../../../apps/mobile/test/fake-host.js'; +import { FakeHost } from '../../host-client/test/fake-host.js'; import { createActions } from '../src/client/actions.js'; import { createDockPanelRegistry } from '../src/client/dock-panels.js'; import { BotMain } from '../src/client/bot-main.js'; diff --git a/packages/client/test/remote-folder-access.test.ts b/packages/client/test/remote-folder-access.test.ts index ca6d2f1ff6..c2ff974ebb 100644 --- a/packages/client/test/remote-folder-access.test.ts +++ b/packages/client/test/remote-folder-access.test.ts @@ -1,6 +1,6 @@ import { expect, it, vi } from 'vitest'; -import { createHostClient } from '../../../apps/mobile/src/host/client.js'; -import { FakeHost } from '../../../apps/mobile/test/fake-host.js'; +import { createHostClient } from '@botharness/host-client/client'; +import { FakeHost } from '../../host-client/test/fake-host.js'; import { createActions } from '../src/client/actions.js'; import { hostBridgeCall } from '../src/client/host-bridge-call.js'; import { remoteFolderAccess } from '../src/client/remote-folder-access.js'; diff --git a/packages/client/test/remote-host-activity.test.ts b/packages/client/test/remote-host-activity.test.ts index 7d9e7906cb..caa2e76c4c 100644 --- a/packages/client/test/remote-host-activity.test.ts +++ b/packages/client/test/remote-host-activity.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest'; -import type { RosterBot } from '../../../apps/mobile/src/host/client.js'; +import type { RosterBot } from '@botharness/host-client/client'; import { createRemoteActivityProjection } from '../src/client/remote-host-activity.js'; describe('remote activity presentation', () => { diff --git a/packages/client/test/remote-host-enrollment.test.ts b/packages/client/test/remote-host-enrollment.test.ts index 2f3c423f0e..bae8ec2dad 100644 --- a/packages/client/test/remote-host-enrollment.test.ts +++ b/packages/client/test/remote-host-enrollment.test.ts @@ -1,7 +1,7 @@ import { afterEach, expect, it, vi } from 'vitest'; -import type { HostCarrier } from '../../../apps/mobile/src/host/carrier.js'; +import type { HostCarrier } from '@botharness/host-protocol/carrier'; import * as enrollment from '../../core/src/devices/relationship-enrollment.js'; -import * as pairing from '../../../apps/mobile/src/host/pairing.js'; +import * as pairing from '@botharness/host-client/pairing'; import { createRemoteHosts, REMOTE_HOSTS_STORAGE_KEY, diff --git a/packages/client/test/remote-host-settings.test.ts b/packages/client/test/remote-host-settings.test.ts index f6e345f428..450eefaceb 100644 --- a/packages/client/test/remote-host-settings.test.ts +++ b/packages/client/test/remote-host-settings.test.ts @@ -1,11 +1,11 @@ import { describe, expect, it } from 'vitest'; -import { createHostClient } from '../../../apps/mobile/src/host/client.js'; +import { createHostClient } from '@botharness/host-client/client'; import { modelSettingsResource, saveModelPreset, setModelRoute, -} from '../../../apps/mobile/src/host/model-settings.js'; -import { FakeHost } from '../../../apps/mobile/test/fake-host.js'; +} from '@botharness/host-client/model-settings'; +import { FakeHost } from '../../host-client/test/fake-host.js'; import { remoteHostSettingsSource } from '../src/client/remote-host-settings-source.js'; function setup(name: string) { diff --git a/packages/client/test/remote-host-viewer-panel.test.tsx b/packages/client/test/remote-host-viewer-panel.test.tsx index c889199747..a74cc26f4f 100644 --- a/packages/client/test/remote-host-viewer-panel.test.tsx +++ b/packages/client/test/remote-host-viewer-panel.test.tsx @@ -6,7 +6,7 @@ import { } from 'react'; import { renderToStaticMarkup } from 'react-dom/server'; import { describe, expect, it, vi } from 'vitest'; -import { createHostClient } from '../../../apps/mobile/src/host/client.js'; +import { createHostClient } from '@botharness/host-client/client'; import { en, zhTranslate } from '../src/client/locale.js'; import type { RemoteHostViewerState } from '../src/client/remote-host-viewer.js'; import { RemoteHostViewerPanel } from '../src/client/remote-host-viewer-panel.js'; diff --git a/packages/client/test/remote-host-viewer-recovery.test.ts b/packages/client/test/remote-host-viewer-recovery.test.ts index cb7ec6288e..685ade9adc 100644 --- a/packages/client/test/remote-host-viewer-recovery.test.ts +++ b/packages/client/test/remote-host-viewer-recovery.test.ts @@ -1,11 +1,7 @@ import { afterEach, describe, expect, it, vi } from 'vitest'; -import { createBrowserViewer } from '../../../apps/mobile/src/host/browser-viewer.js'; -import { createComputerViewer } from '../../../apps/mobile/src/host/computer-viewer.js'; -import type { - HostApiAnswer, - HostApiInit, - HostClient, -} from '../../../apps/mobile/src/host/client.js'; +import { createBrowserViewer } from '@botharness/host-client/browser-viewer'; +import { createComputerViewer } from '@botharness/host-client/computer-viewer'; +import type { HostApiAnswer, HostApiInit, HostClient } from '@botharness/host-client/client'; import { createRemoteHostViewer } from '../src/client/remote-host-viewer.js'; afterEach(() => vi.useRealTimers()); diff --git a/packages/client/test/remote-host-viewer-removal.test.ts b/packages/client/test/remote-host-viewer-removal.test.ts index b2d73c257d..2cacfe6009 100644 --- a/packages/client/test/remote-host-viewer-removal.test.ts +++ b/packages/client/test/remote-host-viewer-removal.test.ts @@ -1,6 +1,6 @@ import { afterEach, describe, expect, it, vi } from 'vitest'; -import type { HostCarrier } from '../../../apps/mobile/src/host/carrier.js'; -import { FakeHost } from '../../../apps/mobile/test/fake-host.js'; +import type { HostCarrier } from '@botharness/host-protocol/carrier'; +import { FakeHost } from '../../host-client/test/fake-host.js'; import { createRemoteHostViewer } from '../src/client/remote-host-viewer.js'; import { createRemoteHosts, REMOTE_HOSTS_STORAGE_KEY } from '../src/client/remote-hosts.js'; diff --git a/packages/client/test/remote-host-viewer.test.ts b/packages/client/test/remote-host-viewer.test.ts index 095283b2ec..b457000e66 100644 --- a/packages/client/test/remote-host-viewer.test.ts +++ b/packages/client/test/remote-host-viewer.test.ts @@ -4,7 +4,7 @@ import type { HostApiInit, HostClient, HostSnapshot, -} from '../../../apps/mobile/src/host/client.js'; +} from '@botharness/host-client/client'; import { createRemoteHostViewer } from '../src/client/remote-host-viewer.js'; afterEach(() => vi.useRealTimers()); diff --git a/packages/client/test/remote-hosts.test.ts b/packages/client/test/remote-hosts.test.ts index 710eaa5a58..c3fc819ca4 100644 --- a/packages/client/test/remote-hosts.test.ts +++ b/packages/client/test/remote-hosts.test.ts @@ -1,9 +1,9 @@ import { afterEach, assert, describe, expect, it, vi } from 'vitest'; -import type { HostCarrier } from '../../../apps/mobile/src/host/carrier.js'; -import type { HumanAttentionItem as HostAttentionItem } from '../../../apps/mobile/src/host/wire.js'; -import { FakeHost } from '../../../apps/mobile/test/fake-host.js'; -import { serializeSavedHost, type SavedHost } from '../../../apps/mobile/src/host/hosts.js'; +import type { HostCarrier } from '@botharness/host-protocol/carrier'; +import type { HumanAttentionItem as HostAttentionItem } from '@botharness/host-protocol/wire'; +import { FakeHost } from '../../host-client/test/fake-host.js'; +import { serializeSavedHost, type SavedHost } from '@botharness/host-client/hosts'; import { connectionOperationIndexSchema } from '../../core/src/devices/connection-operation.js'; import { manageConnections } from '../src/client/connection-management.js'; import { createHostActivityActions } from '../src/client/host-activity-actions.js'; diff --git a/packages/client/test/remote-message.test.ts b/packages/client/test/remote-message.test.ts index 4f44959b63..b397812e2a 100644 --- a/packages/client/test/remote-message.test.ts +++ b/packages/client/test/remote-message.test.ts @@ -1,5 +1,5 @@ import { afterEach, expect, it, vi } from 'vitest'; -import { createHostClient } from '../../../apps/mobile/src/host/client.js'; +import { createHostClient } from '@botharness/host-client/client'; import { fetchMessageResource } from '../src/client/message-host.js'; afterEach(() => vi.restoreAllMocks()); it.each([false, true])( diff --git a/packages/client/test/remote-native-conversation.test.ts b/packages/client/test/remote-native-conversation.test.ts index e2c502d999..43ce154709 100644 --- a/packages/client/test/remote-native-conversation.test.ts +++ b/packages/client/test/remote-native-conversation.test.ts @@ -1,6 +1,6 @@ import { expect, it, vi } from 'vitest'; -import { createHostClient } from '../../../apps/mobile/src/host/client.js'; -import { FakeHost } from '../../../apps/mobile/test/fake-host.js'; +import { createHostClient } from '@botharness/host-client/client'; +import { FakeHost } from '../../host-client/test/fake-host.js'; import { createHostChannelFollow, hostChannelItems, diff --git a/packages/client/test/remote-notifications.test.ts b/packages/client/test/remote-notifications.test.ts index 01bfaab796..33927e7b6c 100644 --- a/packages/client/test/remote-notifications.test.ts +++ b/packages/client/test/remote-notifications.test.ts @@ -5,7 +5,7 @@ import { } from '../src/client/remote-notifications.js'; import type { RemoteHost } from '../src/client/remote-hosts.js'; import type { DesktopNotificationHandle } from '../src/client/desktop-notifications.js'; -import type { HumanAttentionItem } from '../../../apps/mobile/src/host/wire.js'; +import type { HumanAttentionItem } from '@botharness/host-protocol/wire'; const item = (id: string, kind = 'user-question', at = id): HumanAttentionItem => ({ id, diff --git a/packages/client/test/session-maintenance.test.ts b/packages/client/test/session-maintenance.test.ts index 9f94ca6954..97620fdf8e 100644 --- a/packages/client/test/session-maintenance.test.ts +++ b/packages/client/test/session-maintenance.test.ts @@ -2,7 +2,7 @@ import { expect, it, vi } from 'vitest'; import { createSessionMaintenance, sessionMaintenanceFor, -} from '../src/shared/session-maintenance.js'; +} from '@botharness/host-client/shared/session-maintenance'; it('shares one in-flight operation across surfaces and keeps the result', async () => { const owner = {}; let finish!: (result: unknown) => void; diff --git a/packages/client/test/storage-settings.test.ts b/packages/client/test/storage-settings.test.ts index c3e9fe085b..d7e81bd14d 100644 --- a/packages/client/test/storage-settings.test.ts +++ b/packages/client/test/storage-settings.test.ts @@ -55,7 +55,7 @@ vi.mock('../src/client/ds/select.js', async () => { import type { BridgeCall } from '../src/client/bridge.js'; import { StorageSettings, type StorageSettingsSource } from '../src/client/storage-settings.js'; -import { MethodRefused } from '../../../apps/mobile/src/host/client.js'; +import { MethodRefused } from '@botharness/host-client/client'; import { zhTranslate } from '../src/client/locale.js'; import { buttonNamed } from './primitive-mocks.js'; diff --git a/packages/client/test/team-mode-client.test.ts b/packages/client/test/team-mode-client.test.ts index fd7db57bbf..366b443577 100644 --- a/packages/client/test/team-mode-client.test.ts +++ b/packages/client/test/team-mode-client.test.ts @@ -11,7 +11,7 @@ import { } from '../src/client/team-bridge.js'; import { en, zh } from '../src/client/locale.js'; import { MEMBER_SETTINGS_SECTIONS } from '../src/client/member-settings.js'; -import { renderTeamSignInPage } from '../src/shared/team-sign-in-page.js'; +import { renderTeamSignInPage } from '@botharness/host-client/shared/team-sign-in-page'; const viewer = { humanId: 'local-human', diff --git a/packages/client/test/timeline-render-stability.test.ts b/packages/client/test/timeline-render-stability.test.ts index c2c1bb4b64..37ccefa831 100644 --- a/packages/client/test/timeline-render-stability.test.ts +++ b/packages/client/test/timeline-render-stability.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest'; -import { botNameColor } from '../src/client/bot-name-color.js'; +import { botNameColor } from '@botharness/host-client/shared/bot-name-color'; import { visibleDmMessages } from '../src/client/dm-actions.js'; import type { ChannelMessage } from '../src/client/store.js'; diff --git a/packages/client/test/tool-approval-card-keys.test.ts b/packages/client/test/tool-approval-card-keys.test.ts index 5428df035d..2d02e31bf3 100644 --- a/packages/client/test/tool-approval-card-keys.test.ts +++ b/packages/client/test/tool-approval-card-keys.test.ts @@ -8,7 +8,7 @@ import { approvalFileChange, approvalShellCommand, diffLines, -} from '../src/client/approval-diff.js'; +} from '@botharness/host-client/shared/approval-diff'; import { zhTranslate } from '../src/client/locale.js'; import { store, type ChannelMessage } from '../src/client/store.js'; import { ToolApprovalCard } from '../src/client/tool-approval-card.js'; diff --git a/packages/client/test/turn-continuation.test.ts b/packages/client/test/turn-continuation.test.ts index 4755d2e9ab..c1f4ce51e5 100644 --- a/packages/client/test/turn-continuation.test.ts +++ b/packages/client/test/turn-continuation.test.ts @@ -6,7 +6,7 @@ import { parseFailureAutoContinue, parseFailureProgress, turnContinuationFor, -} from '../src/shared/turn-continuation.js'; +} from '@botharness/host-client/shared/turn-continuation'; const dmFailure = { channelId: 'dm-ada', diff --git a/packages/computer/package.json b/packages/computer/package.json index 39a5dde74f..640ccf0290 100644 --- a/packages/computer/package.json +++ b/packages/computer/package.json @@ -23,6 +23,8 @@ "sharp": "0.35.4" }, "devDependencies": { + "@botharness/host-client": "workspace:*", + "@botharness/host-protocol": "workspace:*", "@deepseek-ai/cordis": "4.1.0", "@deepseek-ai/cordis-plugin-loader": "1.1.0", "@deepseek-ai/dsh-agent": "0.2.2-rc.1", diff --git a/packages/computer/test/local-video-client.test.ts b/packages/computer/test/local-video-client.test.ts index a8d8158e77..2fa53d4f69 100644 --- a/packages/computer/test/local-video-client.test.ts +++ b/packages/computer/test/local-video-client.test.ts @@ -7,7 +7,7 @@ import { } from '../src/local-video-contract.js'; import { createLocalVideoOwner } from '../src/local-video-owner.js'; import { localVideoCommand } from '../src/local-video-http.js'; -import { createRemoteKeyboardInput } from '../../../apps/mobile/src/host/remote-keyboard-input.js'; +import { createRemoteKeyboardInput } from '@botharness/host-client/remote-keyboard-input'; import type { DesktopInput } from '../src/desktop-view.js'; function deferred() { diff --git a/packages/core/package.json b/packages/core/package.json index 30a1597ee0..8d1308b3ad 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -38,6 +38,8 @@ "ws": "8.21.3" }, "devDependencies": { + "@botharness/host-client": "workspace:*", + "@botharness/host-protocol": "workspace:*", "@deepseek-ai/cordis": "4.1.0", "@deepseek-ai/dsh-agent": "0.2.2-rc.1", "@deepseek-ai/dsh-agent-preset-registry": "0.2.2-rc.1", diff --git a/packages/core/src/bots/cli-device-client.ts b/packages/core/src/bots/cli-device-client.ts index eff0aeab76..f4f1b81b19 100644 --- a/packages/core/src/bots/cli-device-client.ts +++ b/packages/core/src/bots/cli-device-client.ts @@ -1,11 +1,11 @@ import { createHash, randomBytes } from 'node:crypto'; import { existsSync, readFileSync, writeFileSync } from 'node:fs'; import { isAbsolute } from 'node:path'; -import { createConnectAccount } from '../../../../apps/mobile/src/host/connect-account.js'; -import { pairHost } from '../../../../apps/mobile/src/host/pairing.js'; -import { parseSavedHost, serializeSavedHost } from '../../../../apps/mobile/src/host/hosts.js'; -import { createHostClient } from '../../../../apps/mobile/src/host/client.js'; -import { isLanRoute, isEncryptedRoute } from '../../../../apps/mobile/src/host/route.js'; +import { createConnectAccount } from '@botharness/host-client/connect-account'; +import { pairHost } from '@botharness/host-client/pairing'; +import { parseSavedHost, serializeSavedHost } from '@botharness/host-client/hosts'; +import { createHostClient } from '@botharness/host-client/client'; +import { isLanRoute, isEncryptedRoute } from '@botharness/host-protocol/route'; import { nodeDeviceCarrier } from '../devices/node-carrier.js'; import { CliLiveError } from './cli-live-error.js'; import { requestConnectIdentity } from '../devices/connect-identity-fetch.js'; diff --git a/packages/core/src/bots/cli-device-notifications.ts b/packages/core/src/bots/cli-device-notifications.ts index 2b18e1f483..31acab3f41 100644 --- a/packages/core/src/bots/cli-device-notifications.ts +++ b/packages/core/src/bots/cli-device-notifications.ts @@ -1,7 +1,7 @@ import { readFileSync } from 'node:fs'; -import { parseSavedHost } from '../../../../apps/mobile/src/host/hosts.js'; -import { parseNotificationPreferences } from '../../../../apps/mobile/src/host/device-notification-preferences.js'; -import { createHostPush, PushRequestFailed } from '../../../../apps/mobile/src/host/push.js'; +import { parseSavedHost } from '@botharness/host-client/hosts'; +import { parseNotificationPreferences } from '@botharness/host-client/device-notification-preferences'; +import { createHostPush, PushRequestFailed } from '@botharness/host-client/push'; import { CliLiveError } from './cli-live-error.js'; export const DEVICE_NOTIFICATION_COMMANDS = [ diff --git a/packages/core/src/bots/cli-devices.ts b/packages/core/src/bots/cli-devices.ts index 5834f79778..7ea227182b 100644 --- a/packages/core/src/bots/cli-devices.ts +++ b/packages/core/src/bots/cli-devices.ts @@ -1,7 +1,7 @@ import { existsSync, writeFileSync } from 'node:fs'; import { CliLiveError } from './cli-live-error.js'; -import { noiseFingerprint } from '../devices/noise/xk.js'; +import { noiseFingerprint } from '@botharness/host-protocol/noise/xk'; export const DEVICES_COMMANDS = [ { diff --git a/packages/core/src/bots/cli-live-activity.ts b/packages/core/src/bots/cli-live-activity.ts index 3ff8eff9e7..a76c619fc0 100644 --- a/packages/core/src/bots/cli-live-activity.ts +++ b/packages/core/src/bots/cli-live-activity.ts @@ -1,9 +1,6 @@ import { readFileSync } from 'node:fs'; -import { parseSavedHost } from '../../../../apps/mobile/src/host/hosts.js'; -import { - ActivityRequestFailed, - createHostActivity, -} from '../../../../apps/mobile/src/host/live-activity.js'; +import { parseSavedHost } from '@botharness/host-client/hosts'; +import { ActivityRequestFailed, createHostActivity } from '@botharness/host-client/live-activity'; import { CliLiveError } from './cli-live-error.js'; import { nodeDeviceCarrier } from '../devices/node-carrier.js'; diff --git a/packages/core/src/bots/cli-live.ts b/packages/core/src/bots/cli-live.ts index 277d06ccec..a380428a15 100644 --- a/packages/core/src/bots/cli-live.ts +++ b/packages/core/src/bots/cli-live.ts @@ -1,4 +1,4 @@ -import { isLanAddress } from '../devices/lan-address.js'; +import { isLanAddress } from '@botharness/host-protocol/lan-address'; import { TEAM_COMMANDS, TEAM_OPTIONS, runTeamCommand } from './cli-team.js'; import { runDeviceActivity } from './cli-live-activity.js'; import { GENUI_COMMANDS, GENUI_OPTIONS, runGenuiCommand } from './cli-genui.js'; diff --git a/packages/core/src/bots/cli-phone-notifications.ts b/packages/core/src/bots/cli-phone-notifications.ts index 87d72479c5..84ec516df8 100644 --- a/packages/core/src/bots/cli-phone-notifications.ts +++ b/packages/core/src/bots/cli-phone-notifications.ts @@ -1,6 +1,6 @@ import { connect } from './development-inspector.mjs'; -import { parseNotificationPreferences } from '../../../../apps/mobile/src/host/device-notification-preferences.js'; -import type { PushPreferences } from '../../../../apps/mobile/src/host/push.js'; +import { parseNotificationPreferences } from '@botharness/host-client/device-notification-preferences'; +import type { PushPreferences } from '@botharness/host-client/push'; import { CliLiveError } from './cli-live-error.js'; export function phoneNotificationExpression(preferences?: PushPreferences): string { diff --git a/packages/core/src/bots/cli-relationships.ts b/packages/core/src/bots/cli-relationships.ts index cacc162b8b..8f3aceb76c 100644 --- a/packages/core/src/bots/cli-relationships.ts +++ b/packages/core/src/bots/cli-relationships.ts @@ -10,8 +10,8 @@ import { parseRelationshipSavedHost, updateRelationshipClientRoute, } from '../devices/relationship-enrollment.js'; -import { serializeSavedHost } from '../../../../apps/mobile/src/host/hosts.js'; -import { revokePairing, parsePairingLink } from '../../../../apps/mobile/src/host/pairing.js'; +import { serializeSavedHost } from '@botharness/host-client/hosts'; +import { revokePairing, parsePairingLink } from '@botharness/host-client/pairing'; import { relationshipListSchema, relationshipReplySchema, diff --git a/packages/core/src/bots/cli-ssh.ts b/packages/core/src/bots/cli-ssh.ts index 32c2cbf7c5..0fc758c7a4 100644 --- a/packages/core/src/bots/cli-ssh.ts +++ b/packages/core/src/bots/cli-ssh.ts @@ -1,6 +1,6 @@ import { closeSync, fstatSync, openSync, readFileSync, writeFileSync } from 'node:fs'; import { isAbsolute } from 'node:path'; -import { noiseFingerprint, NOISE_PROTOCOL } from '../devices/noise/xk.js'; +import { noiseFingerprint, NOISE_PROTOCOL } from '@botharness/host-protocol/noise/xk'; import { pairingLink, type PairingPayload } from '../devices/http.js'; import { openSshTunnel, SshTunnelError } from '../devices/ssh-tunnel.js'; import { CliLiveError } from './cli-live-error.js'; diff --git a/packages/core/src/devices/bot-connect-bridge.ts b/packages/core/src/devices/bot-connect-bridge.ts index 1bcc56d28c..9056f4d0a4 100644 --- a/packages/core/src/devices/bot-connect-bridge.ts +++ b/packages/core/src/devices/bot-connect-bridge.ts @@ -4,7 +4,7 @@ import { BotNetworkDeliveryError, type NetworkBotMessage } from '../runtime/bot- import { botNetworkScopes, type BotNetworkMembership } from '../channels/channel.js'; import { createBotConnectChannel } from './bot-connect-channel.js'; import { contactSchema, messageSchema, pageSchema } from './bot-network-wire.js'; -import { noisePublicKey } from './noise/xk.js'; +import { noisePublicKey } from '@botharness/host-protocol/noise/xk'; import type { createConnectBotNetwork, AuthenticatedConnectBotPeer, diff --git a/packages/core/src/devices/bot-lan-bridge.ts b/packages/core/src/devices/bot-lan-bridge.ts index 390e729cd0..ae76944f08 100644 --- a/packages/core/src/devices/bot-lan-bridge.ts +++ b/packages/core/src/devices/bot-lan-bridge.ts @@ -9,7 +9,7 @@ import { BotNetworkDeliveryError, type NetworkBotMessage } from '../runtime/bot- import type { createLanBotMembership, LanBotCandidate } from './bot-lan-membership.js'; import { createBotPeerChannel } from './bot-peer-channel.js'; import { contactSchema, hostId, messageSchema, pageSchema } from './bot-network-wire.js'; -import { noisePublicKey } from './noise/xk.js'; +import { noisePublicKey } from '@botharness/host-protocol/noise/xk'; export const BOT_LAN_PATH = '/botharness-device/lan-bots/v1'; export interface LanBotPeer extends LanBotCandidate { diff --git a/packages/core/src/devices/bot-lan-control.ts b/packages/core/src/devices/bot-lan-control.ts index 5a9681f08e..a2b13a337b 100644 --- a/packages/core/src/devices/bot-lan-control.ts +++ b/packages/core/src/devices/bot-lan-control.ts @@ -1,5 +1,5 @@ import type { createLanBotMembership, LanBotCandidate } from './bot-lan-membership.js'; -import { noiseFingerprint } from './noise/xk.js'; +import { noiseFingerprint } from '@botharness/host-protocol/noise/xk'; export function createLanBotControl(options: { membership: ReturnType; diff --git a/packages/core/src/devices/bot-lan-discovery.ts b/packages/core/src/devices/bot-lan-discovery.ts index 46648fff34..8f1a7c1a39 100644 --- a/packages/core/src/devices/bot-lan-discovery.ts +++ b/packages/core/src/devices/bot-lan-discovery.ts @@ -4,7 +4,7 @@ import { z } from 'zod'; import { hostId } from './bot-network-wire.js'; import type { LanBotCandidate } from './bot-lan-membership.js'; import type { LanBotPeer } from './bot-lan-bridge.js'; -import { isLanAddress } from './lan-address.js'; +import { isLanAddress } from '@botharness/host-protocol/lan-address'; const GROUP = '239.255.42.87'; const PORT = 43288; diff --git a/packages/core/src/devices/bot-network-noise.ts b/packages/core/src/devices/bot-network-noise.ts index cf53171ef2..e350988fa8 100644 --- a/packages/core/src/devices/bot-network-noise.ts +++ b/packages/core/src/devices/bot-network-noise.ts @@ -1,5 +1,5 @@ import { randomBytes, timingSafeEqual } from 'node:crypto'; -import { NoiseXk, type NoiseTransport } from './noise/xk.js'; +import { NoiseXk, type NoiseTransport } from '@botharness/host-protocol/noise/xk'; const MAX_PAYLOAD = 128 * 1024; const FRAME_BYTES = 48 * 1024; diff --git a/packages/core/src/devices/bot-peer-channel.ts b/packages/core/src/devices/bot-peer-channel.ts index e7b404ab2c..2fb23c6b40 100644 --- a/packages/core/src/devices/bot-peer-channel.ts +++ b/packages/core/src/devices/bot-peer-channel.ts @@ -8,7 +8,11 @@ import { encodeBotPayload, decodeBotPayload, } from './bot-network-noise.js'; -import { noisePublicKey, type NoiseXk, type NoiseTransport } from './noise/xk.js'; +import { + noisePublicKey, + type NoiseXk, + type NoiseTransport, +} from '@botharness/host-protocol/noise/xk'; export interface BotPeerIdentity { hostId: string; publicKey: string; diff --git a/packages/core/src/devices/bot-tailnet-bridge.ts b/packages/core/src/devices/bot-tailnet-bridge.ts index 97385c2ab0..420756c571 100644 --- a/packages/core/src/devices/bot-tailnet-bridge.ts +++ b/packages/core/src/devices/bot-tailnet-bridge.ts @@ -1,5 +1,5 @@ import { randomBytes } from 'node:crypto'; -import { NoiseXk, noisePublicKey, type NoiseTransport } from './noise/xk.js'; +import { NoiseXk, noisePublicKey, type NoiseTransport } from '@botharness/host-protocol/noise/xk'; import { botNetworkHandshake, finishBotHandshake, diff --git a/packages/core/src/devices/connect-account.ts b/packages/core/src/devices/connect-account.ts index fd1eb3f5d9..fd4ed88a51 100644 --- a/packages/core/src/devices/connect-account.ts +++ b/packages/core/src/devices/connect-account.ts @@ -9,7 +9,7 @@ import { z } from 'zod'; import type { DeviceConnect } from './connect.js'; import { CONNECT_ZONES } from './routes.js'; -import { checkRoute, isConnectRoute } from '../../../../apps/mobile/src/host/route.js'; +import { checkRoute, isConnectRoute } from '@botharness/host-protocol/route'; type Credentials = Pick; diff --git a/packages/core/src/devices/connect-health.ts b/packages/core/src/devices/connect-health.ts index 4014ecb9a8..21bcb47d83 100644 --- a/packages/core/src/devices/connect-health.ts +++ b/packages/core/src/devices/connect-health.ts @@ -1,10 +1,10 @@ -import { networkDiagnosticReason } from '../../../../apps/mobile/src/host/connection-diagnostic.js'; +import { networkDiagnosticReason } from '@botharness/host-client/connection-diagnostic'; import { createTunnelLookup } from './tunnel-dns.js'; import { randomBytes } from 'node:crypto'; import { setTimeout as delay } from 'node:timers/promises'; import { WebSocket } from 'ws'; import { z } from 'zod'; -import { ConnectChannel, CONNECT_CHANNEL_PATH } from './noise/channel.js'; +import { ConnectChannel, CONNECT_CHANNEL_PATH } from '@botharness/host-protocol/noise/channel'; import type { AccountStatus, ConnectedHost, ConnectedHostsResult } from './connect-account.js'; import type { ConnectStatus } from './connect.js'; diff --git a/packages/core/src/devices/connect-identity-fetch.ts b/packages/core/src/devices/connect-identity-fetch.ts index 78bc73bf66..9d57f77f7a 100644 --- a/packages/core/src/devices/connect-identity-fetch.ts +++ b/packages/core/src/devices/connect-identity-fetch.ts @@ -1,4 +1,4 @@ -import { CONNECT_HOSTNAME } from './connect-zones.js'; +import { CONNECT_HOSTNAME } from '@botharness/host-protocol/connect-zones'; import { createTrustFetch, systemTrustedCertificates } from './private-tunnel.js'; import { createTunnelLookup } from './tunnel-dns.js'; diff --git a/packages/core/src/devices/connect.ts b/packages/core/src/devices/connect.ts index 58145a0311..421074fc23 100644 --- a/packages/core/src/devices/connect.ts +++ b/packages/core/src/devices/connect.ts @@ -1,4 +1,4 @@ -import { CONNECT_CHANNEL_PATH } from './noise/channel.js'; +import { CONNECT_CHANNEL_PATH } from '@botharness/host-protocol/noise/channel'; import { BOT_CONNECT_PATH } from './bot-connect-channel.js'; import { spawn as spawnProcess } from 'node:child_process'; import { diff --git a/packages/core/src/devices/direct.ts b/packages/core/src/devices/direct.ts index 43ea9617b6..a052462972 100644 --- a/packages/core/src/devices/direct.ts +++ b/packages/core/src/devices/direct.ts @@ -1,6 +1,6 @@ import { RTCPeerConnection, type RTCDataChannel } from 'werift'; import { WebSocket } from 'ws'; -import { CONNECT_CHANNEL_PATH } from './noise/channel.js'; +import { CONNECT_CHANNEL_PATH } from '@botharness/host-protocol/noise/channel'; export const DIRECT_PATH = '/direct'; export const DIRECT_LABEL = 'botharness-direct-v1'; diff --git a/packages/core/src/devices/encrypted-gateway.ts b/packages/core/src/devices/encrypted-gateway.ts index 9ddd19c13d..6739e8457a 100644 --- a/packages/core/src/devices/encrypted-gateway.ts +++ b/packages/core/src/devices/encrypted-gateway.ts @@ -7,8 +7,8 @@ import { randomBytes } from 'node:crypto'; import type { Duplex } from 'node:stream'; import { WebSocket, WebSocketServer } from 'ws'; import { BROWSER_ADMISSION_PROTOCOL } from '../../../../deploy/private-relay/admission.mjs'; -import { ConnectChannel, CONNECT_CHANNEL_PATH } from './noise/channel.js'; -import { noisePublicKey } from './noise/xk.js'; +import { ConnectChannel, CONNECT_CHANNEL_PATH } from '@botharness/host-protocol/noise/channel'; +import { noisePublicKey } from '@botharness/host-protocol/noise/xk'; import type { DevicePairing } from './pairing.js'; import { LOCAL_VIDEO_LIMITS, diff --git a/packages/core/src/devices/lan.ts b/packages/core/src/devices/lan.ts index 222ac9e4a2..b7d21cd42d 100644 --- a/packages/core/src/devices/lan.ts +++ b/packages/core/src/devices/lan.ts @@ -3,8 +3,8 @@ import { networkInterfaces } from 'node:os'; import type { AddressInfo, Socket } from 'node:net'; import type { Duplex } from 'node:stream'; import { phoneRoute, type PhoneRoute } from './routes.js'; -import { CONNECT_CHANNEL_PATH } from './noise/channel.js'; -import { isLanAddress } from './lan-address.js'; +import { CONNECT_CHANNEL_PATH } from '@botharness/host-protocol/noise/channel'; +import { isLanAddress } from '@botharness/host-protocol/lan-address'; import { BOT_LAN_PATH } from './bot-lan-bridge.js'; export interface LanStatus { diff --git a/packages/core/src/devices/mount.ts b/packages/core/src/devices/mount.ts index c68914d67a..4c8df39ebc 100644 --- a/packages/core/src/devices/mount.ts +++ b/packages/core/src/devices/mount.ts @@ -20,7 +20,7 @@ import { createActivityDelivery, type ActivityDelivery } from '../live-activity/ import type { ChannelSendStatus } from '../channels/store.js'; import { createNoiseIdentity } from './noise-identity.js'; import { createEncryptedGateway, type CallChannelDiagnostic } from './encrypted-gateway.js'; -import { CONNECT_CHANNEL_PATH } from './noise/channel.js'; +import { CONNECT_CHANNEL_PATH } from '@botharness/host-protocol/noise/channel'; import type { Context } from '@deepseek-ai/cordis'; import { credentialKey, type CredentialProvider } from '@deepseek-ai/dsh-credentials'; import { createDeviceLan } from './lan.js'; diff --git a/packages/core/src/devices/node-carrier.ts b/packages/core/src/devices/node-carrier.ts index 3a03de3511..39bec9e7c3 100644 --- a/packages/core/src/devices/node-carrier.ts +++ b/packages/core/src/devices/node-carrier.ts @@ -1,9 +1,9 @@ import { randomBytes } from 'node:crypto'; import { WebSocket } from 'ws'; -import type { HostCarrier } from '../../../../apps/mobile/src/host/carrier.js'; +import type { HostCarrier } from '@botharness/host-protocol/carrier'; import { requestConnectIdentity } from './connect-identity-fetch.js'; import { createTunnelLookup } from './tunnel-dns.js'; -import { networkDiagnosticReason } from '../../../../apps/mobile/src/host/connection-diagnostic.js'; +import { networkDiagnosticReason } from '@botharness/host-client/connection-diagnostic'; export function nodeDeviceCarrier(): HostCarrier { return { diff --git a/packages/core/src/devices/noise-identity.ts b/packages/core/src/devices/noise-identity.ts index 6ad7ef336c..7f0612a727 100644 --- a/packages/core/src/devices/noise-identity.ts +++ b/packages/core/src/devices/noise-identity.ts @@ -1,7 +1,11 @@ import { randomBytes } from 'node:crypto'; import { credentialKey, type CredentialProvider } from '@deepseek-ai/dsh-credentials'; -import { noiseFingerprint, noisePublicKey, NOISE_PROTOCOL } from './noise/xk.js'; -import { CONNECT_PROTOCOL } from './noise/channel.js'; +import { + noiseFingerprint, + noisePublicKey, + NOISE_PROTOCOL, +} from '@botharness/host-protocol/noise/xk'; +import { CONNECT_PROTOCOL } from '@botharness/host-protocol/noise/channel'; export interface EncryptionIdentity { protocol: typeof CONNECT_PROTOCOL; diff --git a/packages/core/src/devices/private-relay.ts b/packages/core/src/devices/private-relay.ts index 0ba035c740..9e1905db78 100644 --- a/packages/core/src/devices/private-relay.ts +++ b/packages/core/src/devices/private-relay.ts @@ -1,7 +1,7 @@ import { randomBytes } from 'node:crypto'; import { credentialKey, type CredentialProvider } from '@deepseek-ai/dsh-credentials'; import { WebSocket } from 'ws'; -import { CONNECT_CHANNEL_PATH } from './noise/channel.js'; +import { CONNECT_CHANNEL_PATH } from '@botharness/host-protocol/noise/channel'; import { isConnectZoneHost } from './routes.js'; export interface PrivateRelayAdmission { diff --git a/packages/core/src/devices/private-tunnel.ts b/packages/core/src/devices/private-tunnel.ts index ff45567a99..61bc90dc09 100644 --- a/packages/core/src/devices/private-tunnel.ts +++ b/packages/core/src/devices/private-tunnel.ts @@ -16,7 +16,7 @@ import { type CloudflaredSource, } from './cloudflared.js'; import { validTunnelToken, type SpawnTunnel, type TunnelProcess } from './connect.js'; -import { CONNECT_CHANNEL_PATH } from './noise/channel.js'; +import { CONNECT_CHANNEL_PATH } from '@botharness/host-protocol/noise/channel'; import type { PrivateRelayAdmission } from './private-relay.js'; import { isConnectZoneHost } from './routes.js'; diff --git a/packages/core/src/devices/relationship-admission.ts b/packages/core/src/devices/relationship-admission.ts index 1101f3fbbc..c13cf3c371 100644 --- a/packages/core/src/devices/relationship-admission.ts +++ b/packages/core/src/devices/relationship-admission.ts @@ -5,7 +5,7 @@ import { } from '@deepseek-ai/dsh-credentials'; import { z } from 'zod'; import { createHash } from 'node:crypto'; -import { isPrivateRoute } from '../../../../apps/mobile/src/host/route.js'; +import { isPrivateRoute } from '@botharness/host-protocol/route'; import { relationshipRouteAdmissionSchema, type RelationshipTransportPeer, diff --git a/packages/core/src/devices/relationship-contract.ts b/packages/core/src/devices/relationship-contract.ts index 7dc7b76d15..962a1cc2c7 100644 --- a/packages/core/src/devices/relationship-contract.ts +++ b/packages/core/src/devices/relationship-contract.ts @@ -1,11 +1,7 @@ import { z } from 'zod'; -import { CONNECT_HOSTNAME } from './connect-zones.js'; -import { - checkRoute, - isPrivateRoute, - hasPrivateOrigin, -} from '../../../../apps/mobile/src/host/route.js'; -import type { PrivateAdmission } from '../../../../apps/mobile/src/host/hosts.js'; +import { CONNECT_HOSTNAME } from '@botharness/host-protocol/connect-zones'; +import { checkRoute, isPrivateRoute, hasPrivateOrigin } from '@botharness/host-protocol/route'; +import type { PrivateAdmission } from '@botharness/host-client/hosts'; export function relationshipAdmissionForRoutes( admission: PrivateAdmission | undefined, diff --git a/packages/core/src/devices/relationship-control.ts b/packages/core/src/devices/relationship-control.ts index ef1bce797a..d2eaf53477 100644 --- a/packages/core/src/devices/relationship-control.ts +++ b/packages/core/src/devices/relationship-control.ts @@ -12,10 +12,10 @@ import { createRelationshipAdmissions, type RelationshipCredentialProvider, } from './relationship-admission.js'; -import type { PrivateAdmission } from '../../../../apps/mobile/src/host/hosts.js'; -import { openNoiseSocket } from '../../../../apps/mobile/src/host/encrypted-carrier.js'; -import { checkRoute, isPrivateRoute } from '../../../../apps/mobile/src/host/route.js'; -import { parsePairingLink } from '../../../../apps/mobile/src/host/pairing.js'; +import type { PrivateAdmission } from '@botharness/host-client/hosts'; +import { openNoiseSocket } from '@botharness/host-client/encrypted-carrier'; +import { checkRoute, isPrivateRoute } from '@botharness/host-protocol/route'; +import { parsePairingLink } from '@botharness/host-client/pairing'; import { nodeDeviceCarrier } from './node-carrier.js'; import type { DevicePairing } from './pairing.js'; import type { EncryptionIdentity } from './noise-identity.js'; diff --git a/packages/core/src/devices/relationship-enrollment.ts b/packages/core/src/devices/relationship-enrollment.ts index ab3c85524c..0cfbe40d3b 100644 --- a/packages/core/src/devices/relationship-enrollment.ts +++ b/packages/core/src/devices/relationship-enrollment.ts @@ -1,31 +1,31 @@ import { z } from 'zod'; -import type { HostCarrier } from '../../../../apps/mobile/src/host/carrier.js'; +import type { HostCarrier } from '@botharness/host-protocol/carrier'; import { keyBytes, keyHex, secureRandom, -} from '../../../../apps/mobile/src/host/encrypted-carrier.js'; -import { redeemPairing, revokePairing } from '../../../../apps/mobile/src/host/pairing.js'; +} from '@botharness/host-client/encrypted-carrier'; +import { redeemPairing, revokePairing } from '@botharness/host-client/pairing'; import { checkRoute, isEncryptedRoute, isTailscaleRoute, isLoopbackRoute, privateRouteOrigins, -} from '../../../../apps/mobile/src/host/route.js'; +} from '@botharness/host-protocol/route'; import { parseSavedHost, serializeSavedHost, type SavedHost, type PrivateAdmission, -} from '../../../../apps/mobile/src/host/hosts.js'; +} from '@botharness/host-client/hosts'; import { relationshipTransportPeerSchema, relationshipAdmissionForRoutes, type ClientRelationship, pendingRelationshipEnrollmentSchema, } from './relationship-contract.js'; -import { noiseFingerprint, noisePublicKey } from './noise/xk.js'; +import { noiseFingerprint, noisePublicKey } from '@botharness/host-protocol/noise/xk'; export type RelationshipSavedHost = SavedHost & z.infer; export function parseRelationshipSavedHost(input: unknown): RelationshipSavedHost | undefined { const host = parseSavedHost(input); diff --git a/packages/core/src/devices/routes.ts b/packages/core/src/devices/routes.ts index cd61c57c95..322f486f06 100644 --- a/packages/core/src/devices/routes.ts +++ b/packages/core/src/devices/routes.ts @@ -1,6 +1,6 @@ import { execFileText } from '../process/exec-off-thread.js'; -import { CONNECT_HOSTNAME } from './connect-zones.js'; -import { isLanAddress } from './lan-address.js'; +import { CONNECT_HOSTNAME } from '@botharness/host-protocol/connect-zones'; +import { isLanAddress } from '@botharness/host-protocol/lan-address'; import { stalePhoneRoutes, type StalePhoneRoute } from './route-targets.js'; export interface PhoneRoute { @@ -137,7 +137,11 @@ function serveArgs(port: number, published: number): string[] { ]; } -export { CONNECT_HOSTNAME, CONNECT_ZONES, isConnectZoneHost } from './connect-zones.js'; +export { + CONNECT_HOSTNAME, + CONNECT_ZONES, + isConnectZoneHost, +} from '@botharness/host-protocol/connect-zones'; export const TAILNET_IPV4 = /^100\.(?:6[4-9]|[7-9]\d|1[01]\d|12[0-7])\.\d+\.\d+$/u; diff --git a/packages/core/src/devices/ssh-loopback.ts b/packages/core/src/devices/ssh-loopback.ts index 7b6a6eebf0..35d9fe3ee2 100644 --- a/packages/core/src/devices/ssh-loopback.ts +++ b/packages/core/src/devices/ssh-loopback.ts @@ -1,7 +1,7 @@ import { createServer as createHttpServer } from 'node:http'; import { connect, createServer, type Socket } from 'node:net'; import type { Duplex } from 'node:stream'; -import { CONNECT_CHANNEL_PATH } from './noise/channel.js'; +import { CONNECT_CHANNEL_PATH } from '@botharness/host-protocol/noise/channel'; export async function freeLoopbackPort(): Promise { const server = createServer(); diff --git a/packages/core/src/devices/ssh-tunnel.ts b/packages/core/src/devices/ssh-tunnel.ts index 8409370e4a..c11d2934f7 100644 --- a/packages/core/src/devices/ssh-tunnel.ts +++ b/packages/core/src/devices/ssh-tunnel.ts @@ -2,7 +2,7 @@ import { spawn } from 'node:child_process'; import { randomBytes } from 'node:crypto'; import { createServer } from 'node:net'; import { WebSocket } from 'ws'; -import { ConnectChannel, CONNECT_CHANNEL_PATH } from './noise/channel.js'; +import { ConnectChannel, CONNECT_CHANNEL_PATH } from '@botharness/host-protocol/noise/channel'; import { freeLoopbackPort, openSshLoopback } from './ssh-loopback.js'; export class SshTunnelError extends Error { diff --git a/packages/core/src/devices/tunnel-dns.ts b/packages/core/src/devices/tunnel-dns.ts index 3f12bebb85..0633294428 100644 --- a/packages/core/src/devices/tunnel-dns.ts +++ b/packages/core/src/devices/tunnel-dns.ts @@ -1,6 +1,6 @@ import { lookup, Resolver } from 'node:dns'; import type { LookupFunction } from 'node:net'; -import { CONNECT_HOSTNAME } from './connect-zones.js'; +import { CONNECT_HOSTNAME } from '@botharness/host-protocol/connect-zones'; type QueryIpv4 = ( hostname: string, diff --git a/packages/core/src/team/http.ts b/packages/core/src/team/http.ts index 311fa5ef08..c41c0dc76f 100644 --- a/packages/core/src/team/http.ts +++ b/packages/core/src/team/http.ts @@ -7,7 +7,7 @@ import type { PeerScope } from '@deepseek-ai/dsh-typert-protocol'; import type { TypertGateway } from '@deepseek-ai/dsh-api-gateway'; import { viewerCarrierScript } from '@deepseek-ai/dsh-experimental-liveshare-protocol'; import { z } from 'zod'; -import { renderTeamSignInPage } from '../../../client/src/shared/team-sign-in-page.js'; +import { renderTeamSignInPage } from '@botharness/host-client/shared/team-sign-in-page'; import { isConnectRequest } from '../devices/route-context.js'; import { TeamError, type TeamService } from './service.js'; diff --git a/packages/core/src/team/member-urls.ts b/packages/core/src/team/member-urls.ts index acc85865e9..c42f99efdc 100644 --- a/packages/core/src/team/member-urls.ts +++ b/packages/core/src/team/member-urls.ts @@ -1,5 +1,5 @@ import { isIPv4 } from 'node:net'; -import { isLanAddress } from '../devices/lan-address.js'; +import { isLanAddress } from '@botharness/host-protocol/lan-address'; export function memberUrls(addresses: string[], insecureHttpAllowed: boolean): string[] { return addresses.filter((address) => { diff --git a/packages/core/test/account-enrollment.test.ts b/packages/core/test/account-enrollment.test.ts index 90a1f553c7..d25612f10f 100644 --- a/packages/core/test/account-enrollment.test.ts +++ b/packages/core/test/account-enrollment.test.ts @@ -4,8 +4,8 @@ import type { AddressInfo } from 'node:net'; import { WebSocket } from 'ws'; import { expect, it, vi } from 'vitest'; import { createEncryptedGateway } from '../src/devices/encrypted-gateway.js'; -import { ConnectChannel } from '../src/devices/noise/channel.js'; -import { noisePublicKey } from '../src/devices/noise/xk.js'; +import { ConnectChannel } from '@botharness/host-protocol/noise/channel'; +import { noisePublicKey } from '@botharness/host-protocol/noise/xk'; import { createDevicePairing } from '../src/devices/pairing.js'; import { attachOperationalModule, mountOperationalDatabase } from '../src/database/owner.js'; import { BOT_HARNESS_SCHEMA_PLAN } from '../src/database/schema-plan.js'; diff --git a/packages/core/test/bot-connect-bridge.test.ts b/packages/core/test/bot-connect-bridge.test.ts index 0c1c704609..331816e8de 100644 --- a/packages/core/test/bot-connect-bridge.test.ts +++ b/packages/core/test/bot-connect-bridge.test.ts @@ -1,7 +1,7 @@ import { createServer } from 'node:http'; import { expect, it } from 'vitest'; import { createConnectBotBridge } from '../src/devices/bot-connect-bridge.js'; -import { noisePublicKey } from '../src/devices/noise/xk.js'; +import { noisePublicKey } from '@botharness/host-protocol/noise/xk'; import type { createConnectBotNetwork, AuthenticatedConnectBotPeer, diff --git a/packages/core/test/bot-connect-channel.test.ts b/packages/core/test/bot-connect-channel.test.ts index 980209786c..488827008c 100644 --- a/packages/core/test/bot-connect-channel.test.ts +++ b/packages/core/test/bot-connect-channel.test.ts @@ -5,7 +5,7 @@ import { BotNetworkDeliveryError } from '../src/runtime/bot-network.js'; import { createConnectBotNetwork } from '../src/devices/connect-bot-network.js'; import { createBotConnectChannel } from '../src/devices/bot-connect-channel.js'; import { createGatewayOrigin } from '../src/devices/connect.js'; -import { noisePublicKey } from '../src/devices/noise/xk.js'; +import { noisePublicKey } from '@botharness/host-protocol/noise/xk'; it.each(['success', 'lost-ack', 'withdrawn', 'sender-signed-out', 'refused', 'forged-refusal'])( 'handles %s over authenticated Noise without replay or Human device access', diff --git a/packages/core/test/bot-lan-network.test.ts b/packages/core/test/bot-lan-network.test.ts index 174afff4b4..61917355c2 100644 --- a/packages/core/test/bot-lan-network.test.ts +++ b/packages/core/test/bot-lan-network.test.ts @@ -7,7 +7,7 @@ import { createLanBotMembership } from '../src/devices/bot-lan-membership.js'; import { createLanBotBridge } from '../src/devices/bot-lan-bridge.js'; import { createDeviceLan } from '../src/devices/lan.js'; import { createBotNetworkRoutes } from '../src/devices/bot-network-routes.js'; -import { noisePublicKey } from '../src/devices/noise/xk.js'; +import { noisePublicKey } from '@botharness/host-protocol/noise/xk'; import { receiveNetworkBotDm } from '../src/runtime/bot-network.js'; import { createDshBotAgentAdapter } from '../src/runtime/dsh-bot-agent-adapter.js'; import { FakeAgentHost } from './dsh-agent-host-fixture.js'; diff --git a/packages/core/test/bot-network-continuity.test.ts b/packages/core/test/bot-network-continuity.test.ts index 7983a4c549..6296d8a070 100644 --- a/packages/core/test/bot-network-continuity.test.ts +++ b/packages/core/test/bot-network-continuity.test.ts @@ -6,7 +6,7 @@ import { createCore } from '../src/plugin.js'; import { createBotNetworkRoutes } from '../src/devices/bot-network-routes.js'; import { createTailnetBotBridge } from '../src/devices/bot-tailnet-bridge.js'; import { createConnectBotBridge } from '../src/devices/bot-connect-bridge.js'; -import { noisePublicKey } from '../src/devices/noise/xk.js'; +import { noisePublicKey } from '@botharness/host-protocol/noise/xk'; import type { AuthenticatedConnectBotPeer } from '../src/devices/connect-bot-network.js'; import { receiveNetworkBotDm } from '../src/runtime/bot-network.js'; import { createDshBotAgentAdapter } from '../src/runtime/dsh-bot-agent-adapter.js'; diff --git a/packages/core/test/bot-network-noise.test.ts b/packages/core/test/bot-network-noise.test.ts index 603dbce48f..02021601b7 100644 --- a/packages/core/test/bot-network-noise.test.ts +++ b/packages/core/test/bot-network-noise.test.ts @@ -1,6 +1,6 @@ import { randomBytes } from 'node:crypto'; import { expect, it } from 'vitest'; -import { noisePublicKey } from '../src/devices/noise/xk.js'; +import { noisePublicKey } from '@botharness/host-protocol/noise/xk'; import { botNetworkHandshake, finishBotHandshake, diff --git a/packages/core/test/bot-tailnet-bridge.test.ts b/packages/core/test/bot-tailnet-bridge.test.ts index c4fdd07f23..22a8289212 100644 --- a/packages/core/test/bot-tailnet-bridge.test.ts +++ b/packages/core/test/bot-tailnet-bridge.test.ts @@ -4,7 +4,7 @@ import { finishBotHandshake, encodeBotPayload, } from '../src/devices/bot-network-noise.js'; -import { noisePublicKey } from '../src/devices/noise/xk.js'; +import { noisePublicKey } from '@botharness/host-protocol/noise/xk'; import { randomBytes } from 'node:crypto'; import { expect, it } from 'vitest'; import { createTailnetBotBridge } from '../src/devices/bot-tailnet-bridge.js'; diff --git a/packages/core/test/call-gateway-deadline.test.ts b/packages/core/test/call-gateway-deadline.test.ts index b5a4be33cf..f4c3e935bd 100644 --- a/packages/core/test/call-gateway-deadline.test.ts +++ b/packages/core/test/call-gateway-deadline.test.ts @@ -4,13 +4,13 @@ import type { AddressInfo } from 'node:net'; import { afterEach, expect, it, vi } from 'vitest'; import { WebSocket } from 'ws'; -import { encryptedCarrier } from '../../../apps/mobile/src/host/encrypted-carrier.js'; -import type { HostRequest } from '../../../apps/mobile/src/host/carrier.js'; +import { encryptedCarrier } from '@botharness/host-client/encrypted-carrier'; +import type { HostRequest } from '@botharness/host-protocol/carrier'; import { attachOperationalModule, mountOperationalDatabase } from '../src/database/owner.js'; import { BOT_HARNESS_SCHEMA_PLAN } from '../src/database/schema-plan.js'; import { createDeviceGateway } from '../src/devices/gateway.js'; import { createEncryptedGateway } from '../src/devices/encrypted-gateway.js'; -import { noisePublicKey } from '../src/devices/noise/xk.js'; +import { noisePublicKey } from '@botharness/host-protocol/noise/xk'; import { createDevicePairing } from '../src/devices/pairing.js'; import type { VoiceCallResult } from '../src/voice/call-contract.js'; import { createTempRoot, trackTestOwner } from './helpers.js'; diff --git a/packages/core/test/cli-device-client.test.ts b/packages/core/test/cli-device-client.test.ts index e52ef258d4..cb2fa507f9 100644 --- a/packages/core/test/cli-device-client.test.ts +++ b/packages/core/test/cli-device-client.test.ts @@ -3,7 +3,7 @@ import { join } from 'node:path'; import { expect, it, vi } from 'vitest'; import { createTempRoot } from './helpers.js'; const paired = vi.hoisted(() => vi.fn()); -vi.mock('../../../apps/mobile/src/host/pairing.js', () => ({ pairHost: paired })); +vi.mock('@botharness/host-client/pairing', () => ({ pairHost: paired })); vi.mock('../src/devices/connect-identity-fetch.js', () => ({ requestConnectIdentity: (url: string, init?: RequestInit) => fetch(url, init), })); diff --git a/packages/core/test/cli-live-activity.test.ts b/packages/core/test/cli-live-activity.test.ts index 447a782331..c4b5586827 100644 --- a/packages/core/test/cli-live-activity.test.ts +++ b/packages/core/test/cli-live-activity.test.ts @@ -7,10 +7,10 @@ import { runBotCreateCli } from '../src/bots/bot-create-cli.js'; import { createTempRoot, trackTestOwner } from './helpers.js'; import { createEncryptedGateway } from '../src/devices/encrypted-gateway.js'; import { createDevicePairing } from '../src/devices/pairing.js'; -import { noisePublicKey } from '../src/devices/noise/xk.js'; +import { noisePublicKey } from '@botharness/host-protocol/noise/xk'; import { attachOperationalModule, mountOperationalDatabase } from '../src/database/owner.js'; import { BOT_HARNESS_SCHEMA_PLAN } from '../src/database/schema-plan.js'; -import { serializeSavedHost } from '../../../apps/mobile/src/host/hosts.js'; +import { serializeSavedHost } from '@botharness/host-client/hosts'; it('uses Device credentials from a file and activity tokens from stdin without printing either', async () => { const calls: { path: string | undefined; body: string }[] = []; diff --git a/packages/core/test/cli-phone-notifications.test.ts b/packages/core/test/cli-phone-notifications.test.ts index b5ddf27270..bc7002f3d1 100644 --- a/packages/core/test/cli-phone-notifications.test.ts +++ b/packages/core/test/cli-phone-notifications.test.ts @@ -8,8 +8,8 @@ import { connect } from '../src/bots/development-inspector.mjs'; import { createDeviceNotificationPreferences, DEFAULT_NOTIFICATION_PREFERENCES, -} from '../../../apps/mobile/src/host/device-notification-preferences.js'; -import type { PushPreferences } from '../../../apps/mobile/src/host/push.js'; +} from '@botharness/host-client/device-notification-preferences'; +import type { PushPreferences } from '@botharness/host-client/push'; const { WebSocketServer, WebSocket } = createRequire(import.meta.url)('ws'); const schedule = globalThis.setTimeout; diff --git a/packages/core/test/cli-relationship-deadline.test.ts b/packages/core/test/cli-relationship-deadline.test.ts index 15e2073539..6ba9951c3c 100644 --- a/packages/core/test/cli-relationship-deadline.test.ts +++ b/packages/core/test/cli-relationship-deadline.test.ts @@ -9,8 +9,8 @@ vi.mock('../src/devices/relationship-enrollment.js', async (original) => ({ ...(await original()), enrollRelationshipClient: enrollment.run, })); -vi.mock('../../../apps/mobile/src/host/pairing.js', async (original) => ({ - ...(await original()), +vi.mock('@botharness/host-client/pairing', async (original) => ({ + ...(await original()), revokePairing: revocation.run, })); import { runRelationshipCommand } from '../src/bots/cli-relationships.js'; diff --git a/packages/core/test/cli-relationships.test.ts b/packages/core/test/cli-relationships.test.ts index e88ce9b60f..619e26d683 100644 --- a/packages/core/test/cli-relationships.test.ts +++ b/packages/core/test/cli-relationships.test.ts @@ -4,7 +4,7 @@ import { readFileSync, writeFileSync } from 'node:fs'; import { join } from 'node:path'; import { createTempRoot } from './helpers.js'; import { pairingLink } from '../src/devices/http.js'; -import { noiseFingerprint, NOISE_PROTOCOL } from '../src/devices/noise/xk.js'; +import { noiseFingerprint, NOISE_PROTOCOL } from '@botharness/host-protocol/noise/xk'; import { enrollRelationshipClient } from '../src/devices/relationship-enrollment.js'; import { tmpdir } from 'node:os'; diff --git a/packages/core/test/connect-account.test.ts b/packages/core/test/connect-account.test.ts index cd95e7ebfb..42c0730bd7 100644 --- a/packages/core/test/connect-account.test.ts +++ b/packages/core/test/connect-account.test.ts @@ -4,7 +4,7 @@ import { credentialKey } from '@deepseek-ai/dsh-credentials'; import { describe, expect, it, vi } from 'vitest'; import { createConnectAccount } from '../src/devices/connect-account.js'; -import { CONNECT_ZONES } from '../src/devices/connect-zones.js'; +import { CONNECT_ZONES } from '@botharness/host-protocol/connect-zones'; import type { ConnectStatus, DeviceConnect } from '../src/devices/connect.js'; import { runConnectCommand } from '../src/bots/cli-connect.js'; diff --git a/packages/core/test/connect-channel.test.ts b/packages/core/test/connect-channel.test.ts index 9258bb54d9..d9bbbe35be 100644 --- a/packages/core/test/connect-channel.test.ts +++ b/packages/core/test/connect-channel.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from 'vitest'; import { randomBytes } from 'node:crypto'; -import { ConnectChannel } from '../src/devices/noise/channel.js'; -import { noisePublicKey } from '../src/devices/noise/xk.js'; +import { ConnectChannel } from '@botharness/host-protocol/noise/channel'; +import { noisePublicKey } from '@botharness/host-protocol/noise/xk'; function pair() { const hostKey = randomBytes(32); diff --git a/packages/core/test/connect-encrypted-gateway.test.ts b/packages/core/test/connect-encrypted-gateway.test.ts index 41de6ed026..091ca06be6 100644 --- a/packages/core/test/connect-encrypted-gateway.test.ts +++ b/packages/core/test/connect-encrypted-gateway.test.ts @@ -1,4 +1,4 @@ -import { encryptedCarrier } from '../../../apps/mobile/src/host/encrypted-carrier.js'; +import { encryptedCarrier } from '@botharness/host-client/encrypted-carrier'; import { createServer } from 'node:http'; import { randomBytes } from 'node:crypto'; import type { AddressInfo } from 'node:net'; @@ -13,8 +13,8 @@ import { type CallChannelDiagnostic, } from '../src/devices/encrypted-gateway.js'; import { createDeviceGateway } from '../src/devices/gateway.js'; -import { ConnectChannel } from '../src/devices/noise/channel.js'; -import { noisePublicKey } from '../src/devices/noise/xk.js'; +import { ConnectChannel } from '@botharness/host-protocol/noise/channel'; +import { noisePublicKey } from '@botharness/host-protocol/noise/xk'; import { createDevicePairing } from '../src/devices/pairing.js'; import { attachOperationalModule, mountOperationalDatabase } from '../src/database/owner.js'; import { BOT_HARNESS_SCHEMA_PLAN } from '../src/database/schema-plan.js'; diff --git a/packages/core/test/connect-health.test.ts b/packages/core/test/connect-health.test.ts index 3646925f82..55cee04372 100644 --- a/packages/core/test/connect-health.test.ts +++ b/packages/core/test/connect-health.test.ts @@ -7,8 +7,8 @@ import { afterEach, expect, it, vi } from 'vitest'; import { createServer } from 'node:http'; import { WebSocket, WebSocketServer } from 'ws'; import { randomBytes } from 'node:crypto'; -import { ConnectChannel } from '../src/devices/noise/channel.js'; -import { noisePublicKey } from '../src/devices/noise/xk.js'; +import { ConnectChannel } from '@botharness/host-protocol/noise/channel'; +import { noisePublicKey } from '@botharness/host-protocol/noise/xk'; import { checkPublicConnect, createConnectHealth } from '../src/devices/connect-health.js'; const disposals: Array<() => Promise> = []; diff --git a/packages/core/test/connect-network-inbox.test.ts b/packages/core/test/connect-network-inbox.test.ts index f108aa51b6..c96b6fe6b3 100644 --- a/packages/core/test/connect-network-inbox.test.ts +++ b/packages/core/test/connect-network-inbox.test.ts @@ -5,7 +5,7 @@ import { createCore } from '../src/plugin.js'; import { createBotNetworkRoutes } from '../src/devices/bot-network-routes.js'; import { createConnectBotBridge } from '../src/devices/bot-connect-bridge.js'; import { createServer, type Server } from 'node:http'; -import { noisePublicKey } from '../src/devices/noise/xk.js'; +import { noisePublicKey } from '@botharness/host-protocol/noise/xk'; import type { AuthenticatedConnectBotPeer } from '../src/devices/connect-bot-network.js'; import { attachOperationalModule } from '../src/database/owner.js'; import { receiveNetworkBotDm } from '../src/runtime/bot-network.js'; diff --git a/packages/core/test/connect-noise.test.ts b/packages/core/test/connect-noise.test.ts index 501bed1ea4..5845b8b343 100644 --- a/packages/core/test/connect-noise.test.ts +++ b/packages/core/test/connect-noise.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it } from 'vitest'; import vector from './fixtures/noise/xk-cacophony.json'; -import { NoiseXk } from '../src/devices/noise/xk.js'; -import { noisePublicKey } from '../src/devices/noise/xk.js'; -import { ConnectChannel } from '../src/devices/noise/channel.js'; +import { NoiseXk } from '@botharness/host-protocol/noise/xk'; +import { noisePublicKey } from '@botharness/host-protocol/noise/xk'; +import { ConnectChannel } from '@botharness/host-protocol/noise/channel'; import { randomBytes } from 'node:crypto'; it('refuses a Connect handshake replayed at the LAN entry', () => { diff --git a/packages/core/test/connect-pairing.test.ts b/packages/core/test/connect-pairing.test.ts index dee060dab1..65193594e5 100644 --- a/packages/core/test/connect-pairing.test.ts +++ b/packages/core/test/connect-pairing.test.ts @@ -3,11 +3,11 @@ import { randomBytes } from 'node:crypto'; import type { AddressInfo } from 'node:net'; import { WebSocket } from 'ws'; import { expect, it, vi } from 'vitest'; -import { redeemPairing, revokePairing } from '../../../apps/mobile/src/host/pairing.js'; -import { encryptedCarrier } from '../../../apps/mobile/src/host/encrypted-carrier.js'; -import type { HostCarrier } from '../../../apps/mobile/src/host/carrier.js'; +import { redeemPairing, revokePairing } from '@botharness/host-client/pairing'; +import { encryptedCarrier } from '@botharness/host-client/encrypted-carrier'; +import type { HostCarrier } from '@botharness/host-protocol/carrier'; import { createEncryptedGateway } from '../src/devices/encrypted-gateway.js'; -import { noisePublicKey, noiseFingerprint } from '../src/devices/noise/xk.js'; +import { noisePublicKey, noiseFingerprint } from '@botharness/host-protocol/noise/xk'; import { createDevicePairing } from '../src/devices/pairing.js'; import { attachOperationalModule, mountOperationalDatabase } from '../src/database/owner.js'; import { BOT_HARNESS_SCHEMA_PLAN } from '../src/database/schema-plan.js'; diff --git a/packages/core/test/connect-zones.test.ts b/packages/core/test/connect-zones.test.ts index a993377a48..66cd9da987 100644 --- a/packages/core/test/connect-zones.test.ts +++ b/packages/core/test/connect-zones.test.ts @@ -4,7 +4,7 @@ import { CONNECT_HOSTNAME, CONNECT_ZONES, isConnectZoneHost, -} from '../src/devices/connect-zones.js'; +} from '@botharness/host-protocol/connect-zones'; describe('Connect zones', () => { it('accepts any name in the dedicated zone and only Connect Host names in shared zones', () => { diff --git a/packages/core/test/device-lan.test.ts b/packages/core/test/device-lan.test.ts index 80c02a7eba..6b21773301 100644 --- a/packages/core/test/device-lan.test.ts +++ b/packages/core/test/device-lan.test.ts @@ -7,15 +7,15 @@ import { createDeviceLan } from '../src/devices/lan.js'; import { createEncryptedGateway } from '../src/devices/encrypted-gateway.js'; import { createDevicePairing } from '../src/devices/pairing.js'; import { createDevicesHttp } from '../src/devices/http.js'; -import { noisePublicKey } from '../src/devices/noise/xk.js'; +import { noisePublicKey } from '@botharness/host-protocol/noise/xk'; import { attachOperationalModule, mountOperationalDatabase } from '../src/database/owner.js'; import { BOT_HARNESS_SCHEMA_PLAN } from '../src/database/schema-plan.js'; import { createTempRoot, trackTestOwner } from './helpers.js'; import { createDeviceGateway } from '../src/devices/gateway.js'; -import { pairHost, revokePairing } from '../../../apps/mobile/src/host/pairing.js'; -import { encryptedCarrier } from '../../../apps/mobile/src/host/encrypted-carrier.js'; -import type { SavedHost } from '../../../apps/mobile/src/host/hosts.js'; -import type { HostCarrier } from '../../../apps/mobile/src/host/carrier.js'; +import { pairHost, revokePairing } from '@botharness/host-client/pairing'; +import { encryptedCarrier } from '@botharness/host-client/encrypted-carrier'; +import type { SavedHost } from '@botharness/host-client/hosts'; +import type { HostCarrier } from '@botharness/host-protocol/carrier'; it('opens only after opt-in, never serves operator HTTP, persists its port and releases it on disable', async () => { let saved: number | undefined; diff --git a/packages/core/test/direct.test.ts b/packages/core/test/direct.test.ts index 545f5bedf7..3eb7b84a01 100644 --- a/packages/core/test/direct.test.ts +++ b/packages/core/test/direct.test.ts @@ -11,13 +11,13 @@ import { createPrivateConnection } from '../src/devices/private-relay.js'; import { createEncryptedGateway } from '../src/devices/encrypted-gateway.js'; import { createDirectPeers, DIRECT_LABEL } from '../src/devices/direct.js'; import { createDevicePairing } from '../src/devices/pairing.js'; -import { noisePublicKey } from '../src/devices/noise/xk.js'; +import { noisePublicKey } from '@botharness/host-protocol/noise/xk'; import { attachOperationalModule, mountOperationalDatabase } from '../src/database/owner.js'; import { BOT_HARNESS_SCHEMA_PLAN } from '../src/database/schema-plan.js'; import { createTempRoot, trackTestOwner } from './helpers.js'; -import { redeemPairing } from '../../../apps/mobile/src/host/pairing.js'; -import { encryptedCarrier } from '../../../apps/mobile/src/host/encrypted-carrier.js'; -import type { HostCarrier } from '../../../apps/mobile/src/host/carrier.js'; +import { redeemPairing } from '@botharness/host-client/pairing'; +import { encryptedCarrier } from '@botharness/host-client/encrypted-carrier'; +import type { HostCarrier } from '@botharness/host-protocol/carrier'; const mapping = vi.hoisted(() => ({ relay: '' })); diff --git a/packages/core/test/network-withdrawal.test.ts b/packages/core/test/network-withdrawal.test.ts index 13804c764f..90e86c7377 100644 --- a/packages/core/test/network-withdrawal.test.ts +++ b/packages/core/test/network-withdrawal.test.ts @@ -6,7 +6,7 @@ import { createCore } from '../src/plugin.js'; import { createBotNetworkRoutes } from '../src/devices/bot-network-routes.js'; import { createTailnetBotBridge } from '../src/devices/bot-tailnet-bridge.js'; import { createConnectBotBridge } from '../src/devices/bot-connect-bridge.js'; -import { noisePublicKey } from '../src/devices/noise/xk.js'; +import { noisePublicKey } from '@botharness/host-protocol/noise/xk'; import type { AuthenticatedConnectBotPeer } from '../src/devices/connect-bot-network.js'; import type { TailnetChange } from '../src/devices/bot-tailnet-watch.js'; import { attachOperationalModule } from '../src/database/owner.js'; diff --git a/packages/core/test/onboarding.test.ts b/packages/core/test/onboarding.test.ts index 09d68be2e0..8bf4a532ed 100644 --- a/packages/core/test/onboarding.test.ts +++ b/packages/core/test/onboarding.test.ts @@ -8,11 +8,8 @@ import { createBridgeMethods } from '../src/bridge/methods.js'; import type { BotAgentAdapter, OrchestratorAgentRun } from '../src/runtime/bot-runtime.js'; import { createTempRoot } from './helpers.js'; import { DEEPSEEKBOT_RECIPE } from '../src/onboarding/service.js'; -import { createHostClient } from '../../../apps/mobile/src/host/client.js'; -import { - modelSettingsResource, - setModelRoute, -} from '../../../apps/mobile/src/host/model-settings.js'; +import { createHostClient } from '@botharness/host-client/client'; +import { modelSettingsResource, setModelRoute } from '@botharness/host-client/model-settings'; function adapter( run: (input: OrchestratorAgentRun) => Promise = async () => {}, diff --git a/packages/core/test/private-relay.test.ts b/packages/core/test/private-relay.test.ts index 6024ad59c3..1e6250cd5f 100644 --- a/packages/core/test/private-relay.test.ts +++ b/packages/core/test/private-relay.test.ts @@ -9,13 +9,13 @@ import { createPrivateRelay } from '../../../deploy/private-relay/server.mjs'; import { createPrivateConnection } from '../src/devices/private-relay.js'; import { createEncryptedGateway } from '../src/devices/encrypted-gateway.js'; import { createDevicePairing } from '../src/devices/pairing.js'; -import { noisePublicKey } from '../src/devices/noise/xk.js'; +import { noisePublicKey } from '@botharness/host-protocol/noise/xk'; import { attachOperationalModule, mountOperationalDatabase } from '../src/database/owner.js'; import { BOT_HARNESS_SCHEMA_PLAN } from '../src/database/schema-plan.js'; import { createTempRoot, trackTestOwner } from './helpers.js'; -import { redeemPairing } from '../../../apps/mobile/src/host/pairing.js'; -import { encryptedCarrier } from '../../../apps/mobile/src/host/encrypted-carrier.js'; -import type { HostCarrier } from '../../../apps/mobile/src/host/carrier.js'; +import { redeemPairing } from '@botharness/host-client/pairing'; +import { encryptedCarrier } from '@botharness/host-client/encrypted-carrier'; +import type { HostCarrier } from '@botharness/host-protocol/carrier'; const mapping = vi.hoisted(() => ({ relay: '' })); it('keeps a damaged private configuration in error rather than exposing default pairing routes', async () => { diff --git a/packages/core/test/private-tunnel.test.ts b/packages/core/test/private-tunnel.test.ts index e908e1c063..844b9d617f 100644 --- a/packages/core/test/private-tunnel.test.ts +++ b/packages/core/test/private-tunnel.test.ts @@ -30,16 +30,16 @@ import { import type { SpawnTunnel, TunnelProcess } from '../src/devices/connect.js'; import { createEncryptedGateway } from '../src/devices/encrypted-gateway.js'; import { createDevicePairing } from '../src/devices/pairing.js'; -import { noisePublicKey } from '../src/devices/noise/xk.js'; +import { noisePublicKey } from '@botharness/host-protocol/noise/xk'; import { attachOperationalModule, mountOperationalDatabase } from '../src/database/owner.js'; import { BOT_HARNESS_SCHEMA_PLAN } from '../src/database/schema-plan.js'; import { createTempRoot, trackTestOwner } from './helpers.js'; -import { redeemPairing } from '../../../apps/mobile/src/host/pairing.js'; -import { encryptedCarrier } from '../../../apps/mobile/src/host/encrypted-carrier.js'; +import { redeemPairing } from '@botharness/host-client/pairing'; +import { encryptedCarrier } from '@botharness/host-client/encrypted-carrier'; import { createDevicesHttp, type PairingOfferView } from '../src/devices/http.js'; import { detectPhoneRoutes } from '../src/devices/routes.js'; import { createNoiseIdentity } from '../src/devices/noise-identity.js'; -import type { HostCarrier } from '../../../apps/mobile/src/host/carrier.js'; +import type { HostCarrier } from '@botharness/host-protocol/carrier'; type Credentials = Pick; diff --git a/packages/core/test/relationship-control.test.ts b/packages/core/test/relationship-control.test.ts index 2efefb14ec..4226b8b3cd 100644 --- a/packages/core/test/relationship-control.test.ts +++ b/packages/core/test/relationship-control.test.ts @@ -3,18 +3,22 @@ import { createServer } from 'node:http'; import type { AddressInfo } from 'node:net'; import { expect, it } from 'vitest'; import { z } from 'zod'; -import { openNoiseSocket } from '../../../apps/mobile/src/host/encrypted-carrier.js'; +import { openNoiseSocket } from '@botharness/host-client/encrypted-carrier'; import { accountRelationshipVerifier, type AccountRelationshipProof, } from '../src/devices/account-relationship-proof.js'; import type { AccountRelationshipSession } from '../src/devices/connect-account.js'; import type { CredentialRecord } from '@deepseek-ai/dsh-credentials'; -import type { PrivateAdmission } from '../../../apps/mobile/src/host/hosts.js'; +import type { PrivateAdmission } from '@botharness/host-client/hosts'; import type { RelationshipCredentialProvider } from '../src/devices/relationship-admission.js'; import { createNoiseIdentity } from '../src/devices/noise-identity.js'; -import { noiseFingerprint, noisePublicKey, NOISE_PROTOCOL } from '../src/devices/noise/xk.js'; -import { CONNECT_PROTOCOL } from '../src/devices/noise/channel.js'; +import { + noiseFingerprint, + noisePublicKey, + NOISE_PROTOCOL, +} from '@botharness/host-protocol/noise/xk'; +import { CONNECT_PROTOCOL } from '@botharness/host-protocol/noise/channel'; import { createDevicePairing } from '../src/devices/pairing.js'; import { createHostRelationships } from '../src/devices/relationships.js'; import { createRelationshipControl } from '../src/devices/relationship-control.js'; @@ -23,8 +27,8 @@ import { enrollRelationshipClient } from '../src/devices/relationship-enrollment import { nodeDeviceCarrier } from '../src/devices/node-carrier.js'; import { createEncryptedGateway } from '../src/devices/encrypted-gateway.js'; import { pairingLink } from '../src/devices/http.js'; -import { parsePairingLink } from '../../../apps/mobile/src/host/pairing.js'; -import { parseSavedHost, serializeSavedHost } from '../../../apps/mobile/src/host/hosts.js'; +import { parsePairingLink } from '@botharness/host-client/pairing'; +import { parseSavedHost, serializeSavedHost } from '@botharness/host-client/hosts'; import { attachOperationalModule, mountOperationalDatabase } from '../src/database/owner.js'; import { BOT_HARNESS_SCHEMA_PLAN } from '../src/database/schema-plan.js'; import { createTempRoot, trackTestOwner } from './helpers.js'; diff --git a/packages/core/test/ssh-tunnel.test.ts b/packages/core/test/ssh-tunnel.test.ts index 39ebf3fb98..4bfe0d57cd 100644 --- a/packages/core/test/ssh-tunnel.test.ts +++ b/packages/core/test/ssh-tunnel.test.ts @@ -2,8 +2,8 @@ import { once } from 'node:events'; import { randomBytes } from 'node:crypto'; import { WebSocket, WebSocketServer } from 'ws'; import { describe, expect, it } from 'vitest'; -import { ConnectChannel } from '../src/devices/noise/channel.js'; -import { noisePublicKey } from '../src/devices/noise/xk.js'; +import { ConnectChannel } from '@botharness/host-protocol/noise/channel'; +import { noisePublicKey } from '@botharness/host-protocol/noise/xk'; import { readSshPairing } from '../src/bots/cli-ssh.js'; import { openSshTunnel, sshTunnelArgs, verifyTunnelHost } from '../src/devices/ssh-tunnel.js'; import { freeLoopbackPort, openSshLoopback } from '../src/devices/ssh-loopback.js'; diff --git a/packages/core/test/team-mode.test.ts b/packages/core/test/team-mode.test.ts index d1c812b7ab..6e494dadfc 100644 --- a/packages/core/test/team-mode.test.ts +++ b/packages/core/test/team-mode.test.ts @@ -1,21 +1,18 @@ -import { - parsePairingLink, - redeemPairing, - pairHost, -} from '../../../apps/mobile/src/host/pairing.js'; +import { parsePairingLink, redeemPairing, pairHost } from '@botharness/host-client/pairing'; import { createDevicePairing } from '../src/devices/pairing.js'; import { createMemberDevices } from '../src/team/devices.js'; import { createDeviceGateway } from '../src/devices/gateway.js'; import { createEncryptedGateway } from '../src/devices/encrypted-gateway.js'; -import { noisePublicKey, noiseFingerprint, NOISE_PROTOCOL } from '../src/devices/noise/xk.js'; -import { CONNECT_PROTOCOL } from '../src/devices/noise/channel.js'; +import { + noisePublicKey, + noiseFingerprint, + NOISE_PROTOCOL, +} from '@botharness/host-protocol/noise/xk'; +import { CONNECT_PROTOCOL } from '@botharness/host-protocol/noise/channel'; import { randomBytes } from 'node:crypto'; import { WebSocket } from 'ws'; -import { - signInTeamDevice, - changeTeamDevicePassword, -} from '../../../apps/mobile/src/host/team-client.js'; -import type { HostCarrier } from '../../../apps/mobile/src/host/carrier.js'; +import { signInTeamDevice, changeTeamDevicePassword } from '@botharness/host-client/team-client'; +import type { HostCarrier } from '@botharness/host-protocol/carrier'; import { roleModelsSchema } from '../src/team/permissions.js'; import { channelPolicySchema } from '../src/team/channel-contract.js'; import { createAttachmentStore } from '../src/attachments/store.js'; @@ -2298,9 +2295,7 @@ it('redeems a member self-pairing QR on Host HTTPS through the existing Noise pa deviceId: paired.host.deviceId, }); const another = await f.team.pairingOffer(f.human); - const save = vi.fn( - async (_host: import('../../../apps/mobile/src/host/hosts.js').SavedHost) => {}, - ); + const save = vi.fn(async (_host: import('@botharness/host-client/hosts').SavedHost) => {}); expect( await pairHost({ text: another.link, diff --git a/packages/core/test/telemetry-plan.test.ts b/packages/core/test/telemetry-plan.test.ts index ac746b7fa1..15c338903c 100644 --- a/packages/core/test/telemetry-plan.test.ts +++ b/packages/core/test/telemetry-plan.test.ts @@ -4,7 +4,7 @@ import { fileURLToPath } from 'node:url'; import { describe, expect, it } from 'vitest'; -import { MOBILE_EVENT_FIELDS } from '../../../apps/mobile/src/telemetry/schema.js'; +import { MOBILE_EVENT_FIELDS } from '@botharness/host-client/telemetry/schema'; import { LEGACY_EVENT_NAMES } from '../../ingest/src/taxonomy.js'; import { RESERVED_TELEMETRY_EVENTS, @@ -45,7 +45,7 @@ function renderPlan(): string { const legacy = Object.entries(LEGACY_EVENT_NAMES) .sort(([a], [b]) => a.localeCompare(b)) .map(([from, to]) => `| ${code(from)} | ${code(to)} |`); - return ` + return ` # Telemetry tracking plan diff --git a/packages/host-client/package.json b/packages/host-client/package.json new file mode 100644 index 0000000000..ef185c0421 --- /dev/null +++ b/packages/host-client/package.json @@ -0,0 +1,13 @@ +{ + "name": "@botharness/host-client", + "version": "0.0.0", + "private": true, + "type": "module", + "exports": { + "./*": "./src/*.ts" + }, + "dependencies": { + "@botharness/host-protocol": "workspace:*", + "@tanstack/query-core": "5.104.3" + } +} diff --git a/apps/mobile/src/host/account-owner.ts b/packages/host-client/src/account-owner.ts similarity index 100% rename from apps/mobile/src/host/account-owner.ts rename to packages/host-client/src/account-owner.ts diff --git a/apps/mobile/src/host/attention-actions.ts b/packages/host-client/src/attention-actions.ts similarity index 98% rename from apps/mobile/src/host/attention-actions.ts rename to packages/host-client/src/attention-actions.ts index bc824efddf..fda55aa759 100644 --- a/apps/mobile/src/host/attention-actions.ts +++ b/packages/host-client/src/attention-actions.ts @@ -1,7 +1,11 @@ import { HostAnswerInvalid } from './bot-settings'; import type { HostClient } from './client'; import { uuid } from './conversation'; -import type { HumanAssignmentContext, HumanAttentionItem, HumanAttentionPage } from './wire'; +import type { + HumanAssignmentContext, + HumanAttentionItem, + HumanAttentionPage, +} from '@botharness/host-protocol/wire'; export { decideApproval, answerQuestion, decideGrantRequest } from './requests'; export interface AttentionRef { diff --git a/apps/mobile/src/host/bot-avatar-choice.ts b/packages/host-client/src/bot-avatar-choice.ts similarity index 85% rename from apps/mobile/src/host/bot-avatar-choice.ts rename to packages/host-client/src/bot-avatar-choice.ts index 3dd05ca378..953cbc1862 100644 --- a/apps/mobile/src/host/bot-avatar-choice.ts +++ b/packages/host-client/src/bot-avatar-choice.ts @@ -1,7 +1,4 @@ -import { - seededAvatarFor, - type AvatarRecipe, -} from '../../../../packages/core/src/bots/avatar-appearance'; +import { seededAvatarFor, type AvatarRecipe } from '../../core/src/bots/avatar-appearance'; export type BotAvatarChoice = | { kind: 'generated'; seed: string; origin?: 'initial' } diff --git a/apps/mobile/src/host/bot-creation-tags.ts b/packages/host-client/src/bot-creation-tags.ts similarity index 100% rename from apps/mobile/src/host/bot-creation-tags.ts rename to packages/host-client/src/bot-creation-tags.ts diff --git a/apps/mobile/src/host/bot-creation-transport.ts b/packages/host-client/src/bot-creation-transport.ts similarity index 98% rename from apps/mobile/src/host/bot-creation-transport.ts rename to packages/host-client/src/bot-creation-transport.ts index 7d3fad6c9d..9fe9994bc0 100644 --- a/apps/mobile/src/host/bot-creation-transport.ts +++ b/packages/host-client/src/bot-creation-transport.ts @@ -1,5 +1,5 @@ import { createHostClient, deviceRefusal, MethodRefused } from './client'; -import type { HostCarrier } from './carrier'; +import type { HostCarrier } from '@botharness/host-protocol/carrier'; import type { SavedHost } from './hosts'; import type { ZipFilePort } from './zip-import-file'; import { uploadZip, zipUploadIdentity } from './zip-import-upload'; diff --git a/apps/mobile/src/host/bot-creation.ts b/packages/host-client/src/bot-creation.ts similarity index 99% rename from apps/mobile/src/host/bot-creation.ts rename to packages/host-client/src/bot-creation.ts index db764048bc..89b32641c8 100644 --- a/apps/mobile/src/host/bot-creation.ts +++ b/packages/host-client/src/bot-creation.ts @@ -1,11 +1,11 @@ import { zipFile, type ZipImportFile } from './zip-import-file'; import { initialBotAvatar, type BotAvatarChoice } from './bot-avatar-choice'; -import { isAvatarRecipe } from '../../../../packages/core/src/bots/avatar-appearance'; +import { isAvatarRecipe } from '../../core/src/bots/avatar-appearance'; import { creationTags, type CreationTagDraft } from './bot-creation-tags'; export type { BotAvatarChoice } from './bot-avatar-choice'; import type { ZipImportPreview, ZipImportSource } from './zip-import-upload'; -import type { MobileTelemetry } from '../telemetry/mobile-telemetry'; -import type { BotOperationPhase, BotOperationReason } from '../telemetry/schema'; +import type { MobileTelemetry } from './telemetry/mobile-telemetry'; +import type { BotOperationPhase, BotOperationReason } from './telemetry/schema'; export interface BotCreationDraft extends CreationTagDraft { hostId: string; diff --git a/apps/mobile/src/host/bot-settings.ts b/packages/host-client/src/bot-settings.ts similarity index 100% rename from apps/mobile/src/host/bot-settings.ts rename to packages/host-client/src/bot-settings.ts diff --git a/apps/mobile/src/host/browser-viewer.ts b/packages/host-client/src/browser-viewer.ts similarity index 100% rename from apps/mobile/src/host/browser-viewer.ts rename to packages/host-client/src/browser-viewer.ts diff --git a/apps/mobile/src/host/channel-activity.ts b/packages/host-client/src/channel-activity.ts similarity index 94% rename from apps/mobile/src/host/channel-activity.ts rename to packages/host-client/src/channel-activity.ts index f042cdd99f..c5993bc1e3 100644 --- a/apps/mobile/src/host/channel-activity.ts +++ b/packages/host-client/src/channel-activity.ts @@ -4,13 +4,13 @@ import type { ChannelMemberDeparture, ChannelMemoryCommit, ChannelTurnStop, -} from '../../../../packages/core/src/channels/channel'; -import { isChannelTurnStopTarget } from '../../../../packages/core/src/channels/turn-stop'; +} from '../../core/src/channels/channel'; +import { isChannelTurnStopTarget } from '../../core/src/channels/turn-stop'; import { isChannelVoiceCallRecord, type ChannelVoiceCallRecord, -} from '../../../../packages/core/src/channels/voice-call-record'; -import type { ChannelWireMessage } from './wire'; +} from '../../core/src/channels/voice-call-record'; +import type { ChannelWireMessage } from '@botharness/host-protocol/wire'; export type ChannelActivity = | ({ kind: 'dm-action' } & BotDmAction) diff --git a/apps/mobile/src/host/channel-list-store.ts b/packages/host-client/src/channel-list-store.ts similarity index 98% rename from apps/mobile/src/host/channel-list-store.ts rename to packages/host-client/src/channel-list-store.ts index b7e6c94161..e7a72cd9a4 100644 --- a/apps/mobile/src/host/channel-list-store.ts +++ b/packages/host-client/src/channel-list-store.ts @@ -1,5 +1,5 @@ import type { LocalStore, SqlWriter } from './local-store'; -import type { ChannelListItem } from './wire'; +import type { ChannelListItem } from '@botharness/host-protocol/wire'; export type ChannelListCursor = { epoch: string; seq: number }; diff --git a/apps/mobile/src/host/client.ts b/packages/host-client/src/client.ts similarity index 98% rename from apps/mobile/src/host/client.ts rename to packages/host-client/src/client.ts index 5ee18109c0..1c0fc778b5 100644 --- a/apps/mobile/src/host/client.ts +++ b/packages/host-client/src/client.ts @@ -8,13 +8,19 @@ import { } from './encrypted-carrier'; import type { HostEncryption } from './hosts'; import { learnedRoutes, preferredRoutes } from './learned-routes'; -import type { ConnectionTelemetry } from '../telemetry/connection'; -import { ActivitySmoother } from '../../../../packages/client/src/client/activity-smoothing'; -import type { BotPrimaryColor } from '../../../../packages/core/src/bots/primary-color'; -import type { HostCarrier, HostSocket } from './carrier'; +import type { ConnectionTelemetry } from './telemetry/connection'; +import { ActivitySmoother } from './shared/activity-smoothing'; +import type { BotPrimaryColor } from '../../core/src/bots/primary-color'; +import type { HostCarrier, HostSocket } from '@botharness/host-protocol/carrier'; import { rosterSortingOf, type RosterSorting } from './roster-sorting'; import { DEVICE_PREFIX } from './pairing'; -import { checkRoute, isConnectRoute, isEncryptedRoute, isLanRoute, socketOrigin } from './route'; +import { + checkRoute, + isConnectRoute, + isEncryptedRoute, + isLanRoute, + socketOrigin, +} from '@botharness/host-protocol/route'; import { readChannelList, readListBots, @@ -24,22 +30,18 @@ import { type ChannelListCursor, } from './channel-list-store'; import type { LocalStore } from './local-store'; -import { LOCAL_VIDEO_PATH } from '../../../../packages/computer/src/local-video-contract'; +import { LOCAL_VIDEO_PATH } from '../../computer/src/local-video-contract'; import { isChannelVoiceCallRecord, type ChannelVoiceCallRecord, -} from '../../../../packages/core/src/channels/voice-call-record'; -import { - VOICE_CALL_CONNECT_REFUSAL, - VOICE_CALL_PATH, -} from '../../../../packages/core/src/voice/call-contract'; -import { secretRouteRefusal } from '../../../../packages/core/src/bridge/secret-route'; +} from '../../core/src/channels/voice-call-record'; +import { VOICE_CALL_CONNECT_REFUSAL, VOICE_CALL_PATH } from '../../core/src/voice/call-contract'; +import { secretRouteRefusal } from '../../core/src/bridge/secret-route'; import { APP_VERSION_HEADER, MIN_HOST_VERSION, belowMinimum, -} from '../../../../packages/core/src/devices/client-compat'; -import { installedAppVersion } from './app-version'; +} from '../../core/src/devices/client-compat'; import { REMOTE_STREAM_MUX_PATH, type ActivityLiveFrame, @@ -55,7 +57,7 @@ import { type WireSessionActivity, type WireAuthor, type WireToolActivity, -} from './wire'; +} from '@botharness/host-protocol/wire'; export type ConnectionState = | { status: 'connecting'; route: string } @@ -392,7 +394,7 @@ export function createHostClient(options: HostClientOptions): HostClient { let routeChangePending = false; const routeChecks = new Map(); const authorization = { authorization: `Device ${options.credential}` }; - const appVersion = options.appVersion ?? installedAppVersion(); + const appVersion = options.appVersion ?? options.carrier.appVersion; const jsonAuthorization = { ...authorization, 'content-type': 'application/json', diff --git a/apps/mobile/src/host/computer-availability.ts b/packages/host-client/src/computer-availability.ts similarity index 92% rename from apps/mobile/src/host/computer-availability.ts rename to packages/host-client/src/computer-availability.ts index 07034d168e..82a85abdda 100644 --- a/apps/mobile/src/host/computer-availability.ts +++ b/packages/host-client/src/computer-availability.ts @@ -1,5 +1,5 @@ import type { HostApiAnswer, HostApiInit } from './client'; -import { LOCAL_VIDEO_PATH } from '../../../../packages/computer/src/local-video-contract'; +import { LOCAL_VIDEO_PATH } from '../../computer/src/local-video-contract'; export async function readComputerAvailability( api: (path: string, init?: HostApiInit) => Promise, localVideo: boolean, diff --git a/apps/mobile/src/host/computer-viewer.ts b/packages/host-client/src/computer-viewer.ts similarity index 100% rename from apps/mobile/src/host/computer-viewer.ts rename to packages/host-client/src/computer-viewer.ts diff --git a/apps/mobile/src/host/connect-account.ts b/packages/host-client/src/connect-account.ts similarity index 98% rename from apps/mobile/src/host/connect-account.ts rename to packages/host-client/src/connect-account.ts index a232f8cda9..0d35bb0ebf 100644 --- a/apps/mobile/src/host/connect-account.ts +++ b/packages/host-client/src/connect-account.ts @@ -1,3 +1,5 @@ +import type { ConnectRefusal } from '@botharness/host-protocol/connect-refusal'; +export type { ConnectRefusal } from '@botharness/host-protocol/connect-refusal'; import { connectionDiagnostic, networkDiagnosticReason, @@ -5,8 +7,8 @@ import { type ConnectionPhase, } from './connection-diagnostic'; import type { AccountOwner } from './account-owner'; -import { relayFailureDetail } from './pairing-detail'; -import { checkRoute, isConnectRoute } from './route'; +import { relayFailureDetail } from '@botharness/host-protocol/pairing-detail'; +import { checkRoute, isConnectRoute } from '@botharness/host-protocol/route'; import type { PairingPayload } from './pairing'; export const CONNECT_RELAY = 'https://connect.botharness.ai'; @@ -127,25 +129,6 @@ export type EmailCodeOutcome = | { kind: 'signed-in'; email: string | undefined } | { kind: 'cancelled' }; -export type ConnectRefusal = - | 'unreachable' - | 'sign-in-cancelled' - | 'sign-in-failed' - | 'sign-in-required' - | 'account-not-allowed' - | 'host-offline' - | 'host-refused' - | 'host-not-found' - | 'current-host' - | 'session-unknown' - | 'invalid-host-id' - | 'relay-unavailable' - | 'account-changed' - | 'account-identity-required' - | 'account-action-pending' - | 'account-cleanup-failed' - | 'account-deletion-uncertain'; - export interface ConnectHost { id: string; name: string; diff --git a/packages/host-client/src/connection-diagnostic.ts b/packages/host-client/src/connection-diagnostic.ts new file mode 100644 index 0000000000..2b81381e82 --- /dev/null +++ b/packages/host-client/src/connection-diagnostic.ts @@ -0,0 +1 @@ +export * from '@botharness/host-protocol/connection-diagnostic'; diff --git a/apps/mobile/src/host/conversation.ts b/packages/host-client/src/conversation.ts similarity index 99% rename from apps/mobile/src/host/conversation.ts rename to packages/host-client/src/conversation.ts index ad8a5021e5..99aa5f8e4d 100644 --- a/apps/mobile/src/host/conversation.ts +++ b/packages/host-client/src/conversation.ts @@ -1,11 +1,11 @@ import type { HostClient, RemoteSource } from './client'; -import { genuiDocumentOf, type GenuiDocument, type GenuiDocumentReply } from '../genui/document'; -import { forgetGenuiDocumentViews } from '../genui/view'; +import { genuiDocumentOf, type GenuiDocument, type GenuiDocumentReply } from './genui/document'; +import { forgetGenuiDocumentViews } from './genui/view'; import { forgetMedia } from './media-cache'; import { sessionFailure } from './session-failure'; import { activityOf, type ChannelActivity } from './channel-activity'; import { approvalCommand } from './requests'; -import { replyPreviewOf } from '../../../../packages/core/src/channels/reply-preview'; +import { replyPreviewOf } from '../../core/src/channels/reply-preview'; import type { AttachmentRef, WireAllBotMention, @@ -22,7 +22,7 @@ import type { WireMessageVoice, WireReaction, WireReplyPreview, -} from './wire'; +} from '@botharness/host-protocol/wire'; export type DeliveryState = 'pending' | 'committed' | 'failed'; diff --git a/apps/mobile/src/host/device-notification-preferences.ts b/packages/host-client/src/device-notification-preferences.ts similarity index 100% rename from apps/mobile/src/host/device-notification-preferences.ts rename to packages/host-client/src/device-notification-preferences.ts diff --git a/apps/mobile/src/host/encrypted-carrier.ts b/packages/host-client/src/encrypted-carrier.ts similarity index 98% rename from apps/mobile/src/host/encrypted-carrier.ts rename to packages/host-client/src/encrypted-carrier.ts index 78591540b0..d1d3991470 100644 --- a/apps/mobile/src/host/encrypted-carrier.ts +++ b/packages/host-client/src/encrypted-carrier.ts @@ -1,15 +1,11 @@ -import { noiseKeyAgreement } from './noise-key-agreement'; -import { - ConnectChannel, - CONNECT_CHANNEL_PATH, -} from '../../../../packages/core/src/devices/noise/channel'; +import { ConnectChannel, CONNECT_CHANNEL_PATH } from '@botharness/host-protocol/noise/channel'; import type { HostCarrier, HostRequest, HostResponse, HostSocket, HostSocketEvents, -} from './carrier'; +} from '@botharness/host-protocol/carrier'; import type { HostEncryption } from './hosts'; import { checkRoute, @@ -18,8 +14,8 @@ import { isEncryptedRoute, isLanRoute, socketOrigin, -} from './route'; -import { APP_VERSION_HEADER } from '../../../../packages/core/src/devices/client-compat'; +} from '@botharness/host-protocol/route'; +import { APP_VERSION_HEADER } from '../../core/src/devices/client-compat'; export const HOST_KEY_REJECTIONS: ReadonlySet = new Set([ 'channel-authentication-failed', @@ -137,7 +133,7 @@ export function openNoiseSocket(options: { throw new ConnectRefused('route-invalid'); const channel = new ConnectChannel({ role: 'initiator', - ...(noiseKeyAgreement === undefined ? {} : { keyAgreement: noiseKeyAgreement }), + ...(options.raw.keyAgreement === undefined ? {} : { keyAgreement: options.raw.keyAgreement }), hostId: options.hostId, hostKey: keyBytes(options.encryption.hostKey), staticKey: keyBytes(options.encryption.deviceKey), diff --git a/apps/mobile/src/genui/document.ts b/packages/host-client/src/genui/document.ts similarity index 96% rename from apps/mobile/src/genui/document.ts rename to packages/host-client/src/genui/document.ts index 573e994875..9578daeec7 100644 --- a/apps/mobile/src/genui/document.ts +++ b/packages/host-client/src/genui/document.ts @@ -5,13 +5,13 @@ import { type GenuiDocument, type GenuiDocumentReply, type GenuiDocumentState, -} from '../../../../packages/core/src/channels/genui-document'; -import { GENUI_EXECUTION_LIMITS } from '../../../../packages/core/src/channels/genui-execution-limits'; +} from '../../../core/src/channels/genui-document'; +import { GENUI_EXECUTION_LIMITS } from '../../../core/src/channels/genui-execution-limits'; import { buildGenuiPageHtml, GENUI_NATIVE_INBOUND_BYTES, GENUI_PAGE_FAILURES, -} from '../../../../packages/core/src/channels/genui-page'; +} from '../../../core/src/channels/genui-page'; export type { GenuiDocument, GenuiDocumentReply, GenuiDocumentState }; export type GenuiDocumentFailure = (typeof GENUI_PAGE_FAILURES)[number]; diff --git a/apps/mobile/src/genui/view.ts b/packages/host-client/src/genui/view.ts similarity index 95% rename from apps/mobile/src/genui/view.ts rename to packages/host-client/src/genui/view.ts index 5df2b470e2..da6ffede60 100644 --- a/apps/mobile/src/genui/view.ts +++ b/packages/host-client/src/genui/view.ts @@ -3,8 +3,8 @@ import { validateGenuiDocumentState, type GenuiDocument, type GenuiDocumentState, -} from '../../../../packages/core/src/channels/genui-document'; -import { PrivateViewController } from '../../../../packages/client/src/client/genui-view'; +} from '../../../core/src/channels/genui-document'; +import { PrivateViewController } from '../shared/genui-view'; export interface GenuiViewClient { call(method: string, args?: Record): Promise; diff --git a/apps/mobile/src/host/host-look.ts b/packages/host-client/src/host-look.ts similarity index 99% rename from apps/mobile/src/host/host-look.ts rename to packages/host-client/src/host-look.ts index 136e7a473b..25ff5b5193 100644 --- a/apps/mobile/src/host/host-look.ts +++ b/packages/host-client/src/host-look.ts @@ -11,7 +11,7 @@ import { type HostColorId, type HostIcon, type HostLook, -} from '../ui/design/host-look'; +} from './ui/design/host-look'; export interface LookStorage { read(): Promise; diff --git a/apps/mobile/src/host/hosts.ts b/packages/host-client/src/hosts.ts similarity index 82% rename from apps/mobile/src/host/hosts.ts rename to packages/host-client/src/hosts.ts index 75ece1cdf6..7251a13571 100644 --- a/apps/mobile/src/host/hosts.ts +++ b/packages/host-client/src/hosts.ts @@ -1,3 +1,9 @@ +import { + parsePrivateAdmission, + type HostEncryption, +} from '@botharness/host-protocol/host-encryption'; +export { parsePrivateAdmission } from '@botharness/host-protocol/host-encryption'; +export type { PrivateAdmission, HostEncryption } from '@botharness/host-protocol/host-encryption'; import { parseHostMemberIdentity, identitySwitchRequired, @@ -5,21 +11,7 @@ import { type HostMemberIdentity, } from './member-identity'; import { parseAccountOwner, type AccountOwner } from './account-owner'; -import { hasPrivateOrigin, isPrivateRoute } from './route'; - -export interface PrivateAdmission { - origin: string; - token: string; - additionalOrigins?: string[]; -} - -export interface HostEncryption { - privateRelay?: PrivateAdmission; - loopback?: 'encrypted'; - protocol: 'connect-noise-xk-v1'; - hostKey: string; - deviceKey: string; -} +import { hasPrivateOrigin } from '@botharness/host-protocol/route'; export interface SavedHost { member?: HostMemberIdentity; @@ -220,56 +212,6 @@ export function selectHost(state: SavedHosts, hostId: string): SavedHosts | unde : undefined; } -export function parsePrivateAdmission(input: unknown): PrivateAdmission | undefined { - const value = record(input); - if ( - typeof value['origin'] !== 'string' || - typeof value['token'] !== 'string' || - !/^[a-f0-9]{64}$/u.test(value['token']) - ) - return; - try { - const url = new URL(value['origin']); - if ( - !isPrivateRoute(url.origin) || - url.protocol !== 'https:' || - url.origin !== value['origin'] || - url.username || - url.password - ) - return; - const additional = value['additionalOrigins']; - if ( - additional !== undefined && - (!Array.isArray(additional) || - additional.length > 1 || - additional.some((origin) => { - if (typeof origin !== 'string' || origin === url.origin) return true; - try { - const extra = new URL(origin); - return ( - extra.origin !== origin || - !isPrivateRoute(origin) || - extra.protocol !== 'https:' || - !!extra.username || - !!extra.password - ); - } catch { - return true; - } - })) - ) - return; - return { - origin: url.origin, - token: value['token'], - ...(Array.isArray(additional) && additional.length ? { additionalOrigins: additional } : {}), - }; - } catch { - return; - } -} - export function parseEncryption(input: unknown): HostEncryption | undefined { const value = record(input); return value['protocol'] === 'connect-noise-xk-v1' && diff --git a/apps/mobile/src/host/inbox.ts b/packages/host-client/src/inbox.ts similarity index 95% rename from apps/mobile/src/host/inbox.ts rename to packages/host-client/src/inbox.ts index 8853537194..3180e0e7c0 100644 --- a/apps/mobile/src/host/inbox.ts +++ b/packages/host-client/src/inbox.ts @@ -1,6 +1,5 @@ -import { t } from '../ui/strings'; import type { HostClient } from './client'; -import type { HumanAttentionItem, HumanAttentionPage } from './wire'; +import type { HumanAttentionItem, HumanAttentionPage } from '@botharness/host-protocol/wire'; export const INBOX_SECTIONS = ['action', 'replies', 'unread', 'handled'] as const; export type InboxSection = (typeof INBOX_SECTIONS)[number]; @@ -18,6 +17,7 @@ const LIVE_REFRESH_DELAY_MS = 250; const LIMITS: Record = { action: 100, replies: 30, unread: 30, handled: 30 }; export interface InboxQuery { + activityUpdateHost?: () => string; botSlug?: string | undefined; channelId?: string | undefined; search?: string; @@ -87,10 +87,18 @@ export function createInbox( ...(options.activity ? { queryVersion: 1 } : {}), ...(cursor ? { cursor } : {}), }); - if (options.activity && page.queryVersion !== 1) throw new Error(t.activityUpdateHost); - if (setAside === 'cleared' && page.dismissed !== true) throw new Error(t.activityUpdateHost); + if (options.activity && page.queryVersion !== 1) + throw new Error( + options.activityUpdateHost?.() ?? 'Update this Host to use Activity search and sorting.', + ); + if (setAside === 'cleared' && page.dismissed !== true) + throw new Error( + options.activityUpdateHost?.() ?? 'Update this Host to use Activity search and sorting.', + ); if (setAside === 'snoozed' && page.items.some((item) => item.snoozedUntil === undefined)) - throw new Error(t.activityUpdateHost); + throw new Error( + options.activityUpdateHost?.() ?? 'Update this Host to use Activity search and sorting.', + ); return page; }; diff --git a/apps/mobile/src/host/learned-routes.ts b/packages/host-client/src/learned-routes.ts similarity index 94% rename from apps/mobile/src/host/learned-routes.ts rename to packages/host-client/src/learned-routes.ts index f6c1f3c93f..f058cea0f2 100644 --- a/apps/mobile/src/host/learned-routes.ts +++ b/packages/host-client/src/learned-routes.ts @@ -1,5 +1,5 @@ import type { SavedHost } from './hosts'; -import { checkRoute, isConnectRoute, isLanRoute } from './route'; +import { checkRoute, isConnectRoute, isLanRoute } from '@botharness/host-protocol/route'; const record = (value: unknown): Record => value !== null && typeof value === 'object' && !Array.isArray(value) diff --git a/apps/mobile/src/host/live-activity.ts b/packages/host-client/src/live-activity.ts similarity index 94% rename from apps/mobile/src/host/live-activity.ts rename to packages/host-client/src/live-activity.ts index 4cb4cce429..1ed1b92e6b 100644 --- a/apps/mobile/src/host/live-activity.ts +++ b/packages/host-client/src/live-activity.ts @@ -1,7 +1,7 @@ import { ConnectRefused, encryptedCarrier } from './encrypted-carrier'; -import type { HostCarrier } from './carrier'; +import type { HostCarrier } from '@botharness/host-protocol/carrier'; import type { SavedHost } from './hosts'; -import { isConnectRoute } from './route'; +import { isConnectRoute } from '@botharness/host-protocol/route'; export class ActivityRequestFailed extends Error { constructor(readonly code: string) { diff --git a/apps/mobile/src/host/local-store.ts b/packages/host-client/src/local-store.ts similarity index 100% rename from apps/mobile/src/host/local-store.ts rename to packages/host-client/src/local-store.ts diff --git a/apps/mobile/src/host/media-cache.ts b/packages/host-client/src/media-cache.ts similarity index 100% rename from apps/mobile/src/host/media-cache.ts rename to packages/host-client/src/media-cache.ts diff --git a/apps/mobile/src/host/member-identity.ts b/packages/host-client/src/member-identity.ts similarity index 95% rename from apps/mobile/src/host/member-identity.ts rename to packages/host-client/src/member-identity.ts index f73c66398d..3aac8d0650 100644 --- a/apps/mobile/src/host/member-identity.ts +++ b/packages/host-client/src/member-identity.ts @@ -1,5 +1,5 @@ -import { noiseFingerprint } from '../../../../packages/core/src/devices/noise/xk'; -import { teamRecord, type TeamResult } from './team-invitation'; +import { noiseFingerprint } from '@botharness/host-protocol/noise/xk'; +import { teamRecord, type TeamResult } from '@botharness/host-protocol/team-invitation'; import type { SavedHost, SavedHosts } from './hosts'; export interface HostMemberIdentity { diff --git a/apps/mobile/src/host/model-settings.ts b/packages/host-client/src/model-settings.ts similarity index 98% rename from apps/mobile/src/host/model-settings.ts rename to packages/host-client/src/model-settings.ts index a55c3ae7bb..b21906b753 100644 --- a/apps/mobile/src/host/model-settings.ts +++ b/packages/host-client/src/model-settings.ts @@ -1,4 +1,4 @@ -import { QueryClient } from '@tanstack/react-query'; +import { QueryClient } from '@tanstack/query-core'; import { currentModel, @@ -13,7 +13,7 @@ import { type ModelRoute, type ModelSettingsClient, } from './bot-settings'; -import { recordFeature } from '../telemetry/features'; +import { recordFeature } from './telemetry/features'; export type ModelScope = | { kind: 'global' } diff --git a/apps/mobile/src/host/pairing.ts b/packages/host-client/src/pairing.ts similarity index 77% rename from apps/mobile/src/host/pairing.ts rename to packages/host-client/src/pairing.ts index 6f1ec95721..12f0bc90f2 100644 --- a/apps/mobile/src/host/pairing.ts +++ b/packages/host-client/src/pairing.ts @@ -1,7 +1,16 @@ -import { teamHttpsRoute } from './team-invitation'; +import { teamRecord as record } from '@botharness/host-protocol/team-invitation'; +import { + DEVICE_PREFIX, + parsePairingLink, + type PairingPayload, + type PairingRefusal, + type ParsedLink, +} from '@botharness/host-protocol/pairing'; +export * from '@botharness/host-protocol/pairing'; +import { teamHttpsRoute } from '@botharness/host-protocol/team-invitation'; import { pairedMemberIdentity } from './member-identity'; import type { ConnectionDiagnostic } from './connection-diagnostic'; -import { noiseFingerprint, noisePublicKey } from '../../../../packages/core/src/devices/noise/xk'; +import { noiseFingerprint, noisePublicKey } from '@botharness/host-protocol/noise/xk'; import { ConnectRefused, encryptedCarrier, @@ -10,178 +19,15 @@ import { openNoiseSocket, secureRandom, } from './encrypted-carrier'; -import { - isConnectRoute, - isEncryptedRoute, - isLanRoute, - isLoopbackRoute, - isTailscaleRoute, -} from './route'; -import { channelFailureDetail, joinFailureDetails } from './pairing-detail'; -import { parsePrivateAdmission, SavedHostsWriteError, type HostEncryption } from './hosts'; -import { privateRouteOrigins } from './route'; -import type { HostCarrier, LocalNetworkStatus } from './carrier'; -import { checkRoute } from './route'; -import type { ConnectRefusal } from './connect-account'; +import { isConnectRoute, isEncryptedRoute, isLanRoute } from '@botharness/host-protocol/route'; +import { channelFailureDetail, joinFailureDetails } from '@botharness/host-protocol/pairing-detail'; +import { SavedHostsWriteError, type HostEncryption } from './hosts'; +import { privateRouteOrigins } from '@botharness/host-protocol/route'; +import type { HostCarrier, LocalNetworkStatus } from '@botharness/host-protocol/carrier'; +import { checkRoute } from '@botharness/host-protocol/route'; import type { SavedHost } from './hosts'; import { learnedRoutes } from './learned-routes'; -export const DEVICE_PREFIX = '/botharness-device'; - -export interface PairingPayload { - member?: true; - enrollment?: { body: string; signature: string }; - encryption?: { - protocol: 'connect-noise-xk-v1'; - publicKey: string; - loopback?: 'encrypted'; - privateRelay?: HostEncryption['privateRelay']; - }; - host: { id: string; name: string }; - offer: string; - routes: string[]; - expiresAt: string; - verifier?: string; -} - -export type PairingRefusal = - | 'lan-build-required' - | 'lan-unreachable' - | 'lan-permission-denied' - | 'already-paired' - | 'host-key-required' - | 'host-key-changed' - | 'host-key-confirmation-required' - | 'channel-authentication-failed' - | 'link-invalid' - | 'link-expired' - | 'no-route' - | 'offer-invalid' - | 'offer-expired' - | 'unreachable' - | 'certificate-untrusted' - | ConnectRefusal; - -export type ParsedLink = - | { ok: true; payload: PairingPayload } - | { ok: false; code: PairingRefusal; detail?: string; diagnostic?: ConnectionDiagnostic }; - -const SCHEMES = new Set(['deepseekbot:', 'deepseekbot-dev:']); - -function base64UrlDecode(value: string): string { - const base64 = value.replace(/-/gu, '+').replace(/_/gu, '/'); - const binary = atob(base64 + '='.repeat((4 - (base64.length % 4)) % 4)); - return decodeURIComponent( - Array.from(binary, (char) => `%${char.charCodeAt(0).toString(16).padStart(2, '0')}`).join(''), - ); -} - -function record(value: unknown): Record { - return typeof value === 'object' && value !== null ? (value as Record) : {}; -} - -export function pairingLinkMode(encoded: string, now = Date.now()): 'lan' | 'private' | undefined { - const parsed = parsePairingLink(`deepseekbot://pair?p=${encodeURIComponent(encoded)}`, now); - if (!parsed.ok) return undefined; - if (parsed.payload.encryption?.privateRelay) return 'private'; - const { routes } = parsed.payload; - const lan = (route: string) => isLanRoute(route) && !isTailscaleRoute(route); - return routes.some(lan) && routes.every((route) => lan(route) || isLoopbackRoute(route)) - ? 'lan' - : undefined; -} - -export function parsePairingLink(text: string, now = Date.now()): ParsedLink { - let encoded: string | null; - try { - const url = new URL(text.trim()); - if (!SCHEMES.has(url.protocol)) return { ok: false, code: 'link-invalid' }; - encoded = url.searchParams.get('p'); - } catch { - return { ok: false, code: 'link-invalid' }; - } - let value: Record; - try { - value = record(JSON.parse(base64UrlDecode(encoded ?? ''))); - } catch { - return { ok: false, code: 'link-invalid' }; - } - const host = record(value['host']); - if ( - (value['v'] !== 1 && value['v'] !== 2) || - typeof host['id'] !== 'string' || - typeof host['name'] !== 'string' || - typeof value['offer'] !== 'string' || - typeof value['expiresAt'] !== 'string' || - !Array.isArray(value['routes']) - ) - return { ok: false, code: 'link-invalid' }; - if (value['v'] === 2) { - const encryption = record(value['encryption']); - if ( - encryption['loopback'] !== 'encrypted' || - encryption['protocol'] !== 'connect-noise-xk-v1' || - typeof encryption['publicKey'] !== 'string' || - !/^[0-9a-f]{64}$/u.test(encryption['publicKey']) || - value['routes'].length !== 1 || - typeof value['routes'][0] !== 'string' || - !/^http:\/\/127\.0\.0\.1:[1-9]\d{0,4}$/u.test(value['routes'][0]) - ) - return { ok: false, code: 'link-invalid' }; - } - if (Date.parse(value['expiresAt']) <= now) return { ok: false, code: 'link-expired' }; - const privateRelay = parsePrivateAdmission(record(value['encryption'])['privateRelay']); - if (privateRelay && (value['routes'].length !== 1 || value['routes'][0] !== privateRelay.origin)) - return { ok: false, code: 'no-route' }; - const routes = value['routes'].flatMap((route) => { - const checked = - typeof route === 'string' - ? checkRoute( - route, - parsePrivateAdmission(record(value['encryption'])['privateRelay'])?.origin, - ) - : undefined; - return checked?.ok === true - ? [checked.origin] - : value['member'] === true && - teamHttpsRoute(route) && - record(value['encryption'])['protocol'] === 'connect-noise-xk-v1' - ? [new URL(route).origin] - : []; - }); - if (routes.length === 0) return { ok: false, code: 'no-route' }; - return { - ok: true, - payload: { - ...(value['member'] === true ? { member: true as const } : {}), - host: { id: host['id'], name: host['name'] }, - offer: value['offer'], - routes, - expiresAt: value['expiresAt'], - ...(record(value['encryption'])['protocol'] === 'connect-noise-xk-v1' && - typeof record(value['encryption'])['publicKey'] === 'string' && - /^[0-9a-f]{64}$/u.test(String(record(value['encryption'])['publicKey'])) - ? { - encryption: { - ...(parsePrivateAdmission(record(value['encryption'])['privateRelay']) - ? { - privateRelay: parsePrivateAdmission( - record(value['encryption'])['privateRelay'], - )!, - } - : {}), - protocol: 'connect-noise-xk-v1' as const, - ...(record(value['encryption'])['loopback'] === 'encrypted' - ? { loopback: 'encrypted' as const } - : {}), - publicKey: String(record(value['encryption'])['publicKey']), - }, - } - : {}), - }, - }; -} - export type Redemption = | { ok: true; host: SavedHost } | { ok: false; code: PairingRefusal; detail?: string; diagnostic?: ConnectionDiagnostic }; @@ -296,7 +142,11 @@ export async function revokePairing(options: { carrier: HostCarrier; timeoutMs?: number; }): Promise<'revoked' | 'unreachable'> { - const carrier = encryptedCarrier({ raw: options.carrier, ...options.host }); + const carrier = encryptedCarrier({ + raw: options.carrier, + ...options.host, + ...(options.host.member ? { trustedHttpsOrigins: options.host.routes } : {}), + }); try { for (const route of options.host.routes) { const controller = new AbortController(); @@ -350,7 +200,11 @@ export async function removeDevice(options: { }): Promise<'removed' | 'unreachable'> { if (options.deviceId === options.host.deviceId) return (await revokePairing(options)) === 'revoked' ? 'removed' : 'unreachable'; - const carrier = encryptedCarrier({ raw: options.carrier, ...options.host }); + const carrier = encryptedCarrier({ + raw: options.carrier, + ...options.host, + ...(options.host.member ? { trustedHttpsOrigins: options.host.routes } : {}), + }); try { for (const route of options.host.routes) { const controller = new AbortController(); @@ -382,13 +236,13 @@ export type PairingFailure = PairingRefusal | 'storage-failure' | 'cancelled' | export async function pairHost(options: { existing?: (hostId: string) => SavedHost | undefined; text: string | (() => Promise); - method: import('../telemetry/schema').PairingMethod; + method: import('./telemetry/schema').PairingMethod; deviceName: string; carrier: HostCarrier; save(host: SavedHost): Promise; onPending?: (deviceFingerprint: string) => void; confirmFingerprint?: (fingerprint: string, hostName: string) => Promise; - telemetry: Pick; + telemetry: Pick; signal?: AbortSignal; }): Promise< | { ok: true } diff --git a/apps/mobile/src/host/push.ts b/packages/host-client/src/push.ts similarity index 98% rename from apps/mobile/src/host/push.ts rename to packages/host-client/src/push.ts index b6a52d8fe2..bc1dc3c668 100644 --- a/apps/mobile/src/host/push.ts +++ b/packages/host-client/src/push.ts @@ -1,6 +1,6 @@ -import { isConnectRoute } from './route'; +import { isConnectRoute } from '@botharness/host-protocol/route'; import { encryptedCarrier } from './encrypted-carrier'; -import type { HostCarrier } from './carrier'; +import type { HostCarrier } from '@botharness/host-protocol/carrier'; import type { SavedHost } from './hosts'; import { DEVICE_PREFIX } from './pairing'; diff --git a/apps/mobile/src/host/remote-keyboard-input.ts b/packages/host-client/src/remote-keyboard-input.ts similarity index 94% rename from apps/mobile/src/host/remote-keyboard-input.ts rename to packages/host-client/src/remote-keyboard-input.ts index c608c5159e..b7515dc62b 100644 --- a/apps/mobile/src/host/remote-keyboard-input.ts +++ b/packages/host-client/src/remote-keyboard-input.ts @@ -1,4 +1,4 @@ -import type { DesktopInput } from '../../../../packages/computer/src/desktop-view'; +import type { DesktopInput } from '../../computer/src/desktop-view'; export type RemoteKeyboardFailure = 'queue-full' | 'input-unconfirmed'; diff --git a/apps/mobile/src/host/requests.ts b/packages/host-client/src/requests.ts similarity index 98% rename from apps/mobile/src/host/requests.ts rename to packages/host-client/src/requests.ts index 5341da0ce2..495aea5323 100644 --- a/apps/mobile/src/host/requests.ts +++ b/packages/host-client/src/requests.ts @@ -1,4 +1,4 @@ -import { approvalShellCommand } from '../../../../packages/client/src/client/approval-diff'; +import { approvalShellCommand } from './shared/approval-diff'; import { approveWorkspaceRequest, listHostFolders, @@ -7,8 +7,8 @@ import { type WorkspaceGrant, } from './bot-settings'; import { MethodRefused, type HostClient } from './client'; -import { recordFeature } from '../telemetry/features'; -import type { FeatureEntry } from '../telemetry/schema'; +import { recordFeature } from './telemetry/features'; +import type { FeatureEntry } from './telemetry/schema'; import type { HumanAttentionItem, QuestionAnswer, @@ -18,7 +18,7 @@ import type { ToolApprovalOutcome, ToolApprovalStatus, UserQuestionStatus, -} from './wire'; +} from '@botharness/host-protocol/wire'; export type RequestStatus = 'pending' | 'decided' | 'expired'; export type ApprovalStatus = RequestStatus | 'stopped'; diff --git a/apps/mobile/src/host/roster-sorting.ts b/packages/host-client/src/roster-sorting.ts similarity index 96% rename from apps/mobile/src/host/roster-sorting.ts rename to packages/host-client/src/roster-sorting.ts index 4c695e89af..96c37f023d 100644 --- a/apps/mobile/src/host/roster-sorting.ts +++ b/packages/host-client/src/roster-sorting.ts @@ -3,7 +3,7 @@ import { DEFAULT_BOT_MODE_SORT, isBotModeSortMode, type BotModeSortMode, -} from '../../../../packages/client/src/bot-mode-settings'; +} from './shared/bot-mode-settings'; export interface RosterSorting { sortMode: BotModeSortMode; diff --git a/apps/mobile/src/host/session-failure.ts b/packages/host-client/src/session-failure.ts similarity index 92% rename from apps/mobile/src/host/session-failure.ts rename to packages/host-client/src/session-failure.ts index 31d87d6443..07d0ea5291 100644 --- a/apps/mobile/src/host/session-failure.ts +++ b/packages/host-client/src/session-failure.ts @@ -1,12 +1,12 @@ -import { sessionMaintenanceFor } from '../../../../packages/client/src/shared/session-maintenance'; +import { sessionMaintenanceFor } from './shared/session-maintenance'; import { parseFailureAutoContinue, parseFailureProgress, turnContinuationFor, type SessionFailureAutoContinue, type SessionFailureProgress, -} from '../../../../packages/client/src/shared/turn-continuation'; -export { latestTurnMessageId } from '../../../../packages/core/src/channels/channel-notice'; +} from './shared/turn-continuation'; +export { latestTurnMessageId } from '../../core/src/channels/channel-notice'; export interface SessionFailure { role: 'orchestrator' | 'assignment'; sessionId: string; diff --git a/packages/client/src/client/activity-smoothing.ts b/packages/host-client/src/shared/activity-smoothing.ts similarity index 100% rename from packages/client/src/client/activity-smoothing.ts rename to packages/host-client/src/shared/activity-smoothing.ts diff --git a/packages/client/src/client/approval-diff.ts b/packages/host-client/src/shared/approval-diff.ts similarity index 100% rename from packages/client/src/client/approval-diff.ts rename to packages/host-client/src/shared/approval-diff.ts diff --git a/packages/client/src/bot-mode-settings.ts b/packages/host-client/src/shared/bot-mode-settings.ts similarity index 100% rename from packages/client/src/bot-mode-settings.ts rename to packages/host-client/src/shared/bot-mode-settings.ts diff --git a/packages/client/src/client/bot-name-color.ts b/packages/host-client/src/shared/bot-name-color.ts similarity index 100% rename from packages/client/src/client/bot-name-color.ts rename to packages/host-client/src/shared/bot-name-color.ts diff --git a/packages/client/src/client/genui-view.ts b/packages/host-client/src/shared/genui-view.ts similarity index 100% rename from packages/client/src/client/genui-view.ts rename to packages/host-client/src/shared/genui-view.ts diff --git a/packages/client/src/shared/session-maintenance.ts b/packages/host-client/src/shared/session-maintenance.ts similarity index 100% rename from packages/client/src/shared/session-maintenance.ts rename to packages/host-client/src/shared/session-maintenance.ts diff --git a/packages/client/src/shared/team-sign-in-page.ts b/packages/host-client/src/shared/team-sign-in-page.ts similarity index 100% rename from packages/client/src/shared/team-sign-in-page.ts rename to packages/host-client/src/shared/team-sign-in-page.ts diff --git a/packages/client/src/shared/turn-continuation.ts b/packages/host-client/src/shared/turn-continuation.ts similarity index 100% rename from packages/client/src/shared/turn-continuation.ts rename to packages/host-client/src/shared/turn-continuation.ts diff --git a/apps/mobile/src/host/storage.ts b/packages/host-client/src/storage.ts similarity index 100% rename from apps/mobile/src/host/storage.ts rename to packages/host-client/src/storage.ts diff --git a/apps/mobile/src/host/team-client.ts b/packages/host-client/src/team-client.ts similarity index 95% rename from apps/mobile/src/host/team-client.ts rename to packages/host-client/src/team-client.ts index 54531565eb..d9b4607fbe 100644 --- a/apps/mobile/src/host/team-client.ts +++ b/packages/host-client/src/team-client.ts @@ -1,4 +1,4 @@ -import type { HostCarrier } from './carrier'; +import type { HostCarrier } from '@botharness/host-protocol/carrier'; import type { HostEncryption, SavedHost } from './hosts'; import { ConnectRefused, @@ -8,8 +8,8 @@ import { openNoiseSocket, secureRandom, } from './encrypted-carrier'; -import { isConnectRoute } from './route'; -import { noiseFingerprint } from '../../../../packages/core/src/devices/noise/xk'; +import { isConnectRoute } from '@botharness/host-protocol/route'; +import { noiseFingerprint } from '@botharness/host-protocol/noise/xk'; import { parseTeamInvitation, teamHostIdentity, @@ -19,10 +19,14 @@ import { type TeamHostIdentity, type TeamInvitation, type TeamResult, -} from './team-invitation'; +} from '@botharness/host-protocol/team-invitation'; -export { parseTeamInvitation } from './team-invitation'; -export type { TeamInvitation, TeamErrorCode, TeamResult } from './team-invitation'; +export { parseTeamInvitation } from '@botharness/host-protocol/team-invitation'; +export type { + TeamInvitation, + TeamErrorCode, + TeamResult, +} from '@botharness/host-protocol/team-invitation'; export { memberPasswordGate, prepareMemberIdentity } from './member-identity'; const codes: ReadonlySet = new Set([ diff --git a/packages/host-client/src/team-invitation.ts b/packages/host-client/src/team-invitation.ts new file mode 100644 index 0000000000..427cf2a258 --- /dev/null +++ b/packages/host-client/src/team-invitation.ts @@ -0,0 +1 @@ +export * from '@botharness/host-protocol/team-invitation'; diff --git a/apps/mobile/src/telemetry/connection.ts b/packages/host-client/src/telemetry/connection.ts similarity index 97% rename from apps/mobile/src/telemetry/connection.ts rename to packages/host-client/src/telemetry/connection.ts index 568d822659..80a2cc727e 100644 --- a/apps/mobile/src/telemetry/connection.ts +++ b/packages/host-client/src/telemetry/connection.ts @@ -1,4 +1,4 @@ -import type { ConnectionState } from '../host/client'; +import type { ConnectionState } from '../client'; import type { MobileTelemetry } from './mobile-telemetry'; import type { ConnectionOutcome, ConnectionReason, ConnectionTrigger } from './schema'; diff --git a/apps/mobile/src/telemetry/device-context.ts b/packages/host-client/src/telemetry/device-context.ts similarity index 100% rename from apps/mobile/src/telemetry/device-context.ts rename to packages/host-client/src/telemetry/device-context.ts diff --git a/apps/mobile/src/telemetry/features.ts b/packages/host-client/src/telemetry/features.ts similarity index 100% rename from apps/mobile/src/telemetry/features.ts rename to packages/host-client/src/telemetry/features.ts diff --git a/apps/mobile/src/telemetry/mobile-telemetry.ts b/packages/host-client/src/telemetry/mobile-telemetry.ts similarity index 99% rename from apps/mobile/src/telemetry/mobile-telemetry.ts rename to packages/host-client/src/telemetry/mobile-telemetry.ts index 4f0e7dd5c5..c8407da681 100644 --- a/apps/mobile/src/telemetry/mobile-telemetry.ts +++ b/packages/host-client/src/telemetry/mobile-telemetry.ts @@ -1,4 +1,4 @@ -import { isPairingFailureDetail } from '../host/pairing-detail'; +import { isPairingFailureDetail } from '@botharness/host-protocol/pairing-detail'; import { durationBucket, isUuid, diff --git a/apps/mobile/src/telemetry/schema.ts b/packages/host-client/src/telemetry/schema.ts similarity index 99% rename from apps/mobile/src/telemetry/schema.ts rename to packages/host-client/src/telemetry/schema.ts index 25f9ca6f58..d1d8215ec6 100644 --- a/apps/mobile/src/telemetry/schema.ts +++ b/packages/host-client/src/telemetry/schema.ts @@ -1,9 +1,9 @@ import { MARKETPLACE_INSTALL_SOURCES, type MarketplaceInstallSource, -} from '../../../../packages/core/src/marketplace/client'; +} from '../../../core/src/marketplace/client'; import { isDeviceYearClass, isPublicModelId, type DeviceTelemetryContext } from './device-context'; -import { isPairingFailureDetail } from '../host/pairing-detail'; +import { isPairingFailureDetail } from '@botharness/host-protocol/pairing-detail'; export type PairingMethod = 'qr' | 'image' | 'paste' | 'deep_link' | 'account'; export type PairingOutcome = 'success' | 'refused' | 'failed' | 'cancelled'; diff --git a/packages/host-client/src/ui/design/color-math.ts b/packages/host-client/src/ui/design/color-math.ts new file mode 100644 index 0000000000..2eaadef6ea --- /dev/null +++ b/packages/host-client/src/ui/design/color-math.ts @@ -0,0 +1,39 @@ +import type { palette } from './palette.generated'; +export type ColorRole = keyof typeof palette.light; +export type ColorScheme = 'light' | 'dark'; + +function rgb(hex: string): number { + const digits = hex.slice(1); + return Number.parseInt( + digits.length === 3 ? [...digits].map((digit) => digit + digit).join('') : digits, + 16, + ); +} + +function luminance(hex: string): number { + const value = rgb(hex); + const channel = (shift: number) => { + const c = ((value >> shift) & 0xff) / 255; + return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4; + }; + return 0.2126 * channel(16) + 0.7152 * channel(8) + 0.0722 * channel(0); +} + +export function contrast(a: string, b: string): number { + const [hi, lo] = [luminance(a), luminance(b)].sort((x, y) => y - x) as [number, number]; + return (hi + 0.05) / (lo + 0.05); +} + +export function mix(from: string, to: string, amount: number): string { + const a = rgb(from); + const b = rgb(to); + return `#${[16, 8, 0] + .map((shift) => { + const start = (a >> shift) & 0xff; + const end = (b >> shift) & 0xff; + return Math.round(start + (end - start) * amount) + .toString(16) + .padStart(2, '0'); + }) + .join('')}`; +} diff --git a/apps/mobile/src/ui/design/host-look.ts b/packages/host-client/src/ui/design/host-look.ts similarity index 99% rename from apps/mobile/src/ui/design/host-look.ts rename to packages/host-client/src/ui/design/host-look.ts index e02e66fa41..757884d3ad 100644 --- a/apps/mobile/src/ui/design/host-look.ts +++ b/packages/host-client/src/ui/design/host-look.ts @@ -1,4 +1,4 @@ -import { contrast, mix, type ColorRole, type ColorScheme } from './resolve-theme'; +import { contrast, mix, type ColorRole, type ColorScheme } from './color-math'; export const HOST_SYMBOLS = { desktop: { ios: 'desktopcomputer', android: 'computer' }, diff --git a/apps/mobile/src/ui/design/palette.generated.ts b/packages/host-client/src/ui/design/palette.generated.ts similarity index 100% rename from apps/mobile/src/ui/design/palette.generated.ts rename to packages/host-client/src/ui/design/palette.generated.ts diff --git a/apps/mobile/src/host/usage.ts b/packages/host-client/src/usage.ts similarity index 95% rename from apps/mobile/src/host/usage.ts rename to packages/host-client/src/usage.ts index 5afced9905..65d4e69c0d 100644 --- a/apps/mobile/src/host/usage.ts +++ b/packages/host-client/src/usage.ts @@ -1,7 +1,12 @@ import type { HostClient } from './client'; -import type { OverviewMemory, OverviewUsage, UsageBuckets, UsagePeriod } from './wire'; +import type { + OverviewMemory, + OverviewUsage, + UsageBuckets, + UsagePeriod, +} from '@botharness/host-protocol/wire'; -export type { OverviewMemory, OverviewUsage, UsagePeriod } from './wire'; +export type { OverviewMemory, OverviewUsage, UsagePeriod } from '@botharness/host-protocol/wire'; export interface UsageDay { day: string; diff --git a/apps/mobile/src/host/zip-import-file.ts b/packages/host-client/src/zip-import-file.ts similarity index 96% rename from apps/mobile/src/host/zip-import-file.ts rename to packages/host-client/src/zip-import-file.ts index 1c1d6dbc55..6be40b8db2 100644 --- a/apps/mobile/src/host/zip-import-file.ts +++ b/packages/host-client/src/zip-import-file.ts @@ -1,4 +1,4 @@ -import { archiveHasher } from '../../../../packages/core/src/portability/archive-hash'; +import { archiveHasher } from '../../core/src/portability/archive-hash'; import { BotCreationFailure } from './bot-creation'; export const ZIP_CHUNK_BYTES = 256 * 1024; diff --git a/apps/mobile/src/host/zip-import-upload.ts b/packages/host-client/src/zip-import-upload.ts similarity index 100% rename from apps/mobile/src/host/zip-import-upload.ts rename to packages/host-client/src/zip-import-upload.ts diff --git a/apps/mobile/test/fake-host.ts b/packages/host-client/test/fake-host.ts similarity index 98% rename from apps/mobile/test/fake-host.ts rename to packages/host-client/test/fake-host.ts index 5a8f90e364..7b5cc91324 100644 --- a/apps/mobile/test/fake-host.ts +++ b/packages/host-client/test/fake-host.ts @@ -1,7 +1,7 @@ -import { pageChannelJournal } from '../../../packages/core/src/channels/timeline.js'; -import type { ChannelMessage } from '../../../packages/core/src/channels/channel.js'; -import type { HostCarrier, HostSocketEvents } from '../src/host/carrier'; -import type { ChannelLiveFrame, MuxClientFrame, WireDraft } from '../src/host/wire'; +import { pageChannelJournal } from '../../core/src/channels/timeline.js'; +import type { ChannelMessage } from '../../core/src/channels/channel.js'; +import type { HostCarrier, HostSocketEvents } from '@botharness/host-protocol/carrier'; +import type { ChannelLiveFrame, MuxClientFrame, WireDraft } from '@botharness/host-protocol/wire'; import wire from './fixtures/host-wire.json'; type Rpc = keyof typeof wire.rpc; diff --git a/apps/mobile/test/fixtures/host-wire.json b/packages/host-client/test/fixtures/host-wire.json similarity index 100% rename from apps/mobile/test/fixtures/host-wire.json rename to packages/host-client/test/fixtures/host-wire.json diff --git a/packages/host-protocol/package.json b/packages/host-protocol/package.json new file mode 100644 index 0000000000..89cb1c0aac --- /dev/null +++ b/packages/host-protocol/package.json @@ -0,0 +1,14 @@ +{ + "name": "@botharness/host-protocol", + "version": "0.0.0", + "private": true, + "type": "module", + "exports": { + "./*": "./src/*.ts" + }, + "dependencies": { + "@noble/ciphers": "2.4.0", + "@noble/curves": "2.4.0", + "@noble/hashes": "2.4.0" + } +} diff --git a/apps/mobile/src/host/carrier.ts b/packages/host-protocol/src/carrier.ts similarity index 90% rename from apps/mobile/src/host/carrier.ts rename to packages/host-protocol/src/carrier.ts index f073e1b969..f0a699912c 100644 --- a/apps/mobile/src/host/carrier.ts +++ b/packages/host-protocol/src/carrier.ts @@ -1,3 +1,5 @@ +import type { NoiseKeyAgreement } from './noise/xk'; + export interface HostResponse { status: number; text(): Promise; @@ -27,6 +29,8 @@ export interface HostSocket { export type LocalNetworkStatus = 'denied' | 'reachable' | 'unreachable' | 'timeout' | 'unknown'; export interface HostCarrier { + keyAgreement?: NoiseKeyAgreement; + appVersion?: string; randomBytes?(): Uint8Array; localNetworkStatus?(origin: string): Promise; transportFailure?(origin: string): Promise; diff --git a/packages/host-protocol/src/connect-refusal.ts b/packages/host-protocol/src/connect-refusal.ts new file mode 100644 index 0000000000..650f4fc57f --- /dev/null +++ b/packages/host-protocol/src/connect-refusal.ts @@ -0,0 +1,18 @@ +export type ConnectRefusal = + | 'unreachable' + | 'sign-in-cancelled' + | 'sign-in-failed' + | 'sign-in-required' + | 'account-not-allowed' + | 'host-offline' + | 'host-refused' + | 'host-not-found' + | 'current-host' + | 'session-unknown' + | 'invalid-host-id' + | 'relay-unavailable' + | 'account-changed' + | 'account-identity-required' + | 'account-action-pending' + | 'account-cleanup-failed' + | 'account-deletion-uncertain'; diff --git a/packages/core/src/devices/connect-zones.ts b/packages/host-protocol/src/connect-zones.ts similarity index 100% rename from packages/core/src/devices/connect-zones.ts rename to packages/host-protocol/src/connect-zones.ts diff --git a/apps/mobile/src/host/connection-diagnostic.ts b/packages/host-protocol/src/connection-diagnostic.ts similarity index 100% rename from apps/mobile/src/host/connection-diagnostic.ts rename to packages/host-protocol/src/connection-diagnostic.ts diff --git a/packages/host-protocol/src/host-encryption.ts b/packages/host-protocol/src/host-encryption.ts new file mode 100644 index 0000000000..3601eacbed --- /dev/null +++ b/packages/host-protocol/src/host-encryption.ts @@ -0,0 +1,66 @@ +import { isPrivateRoute } from './route'; +import { teamRecord as record } from './team-invitation'; + +export interface PrivateAdmission { + origin: string; + token: string; + additionalOrigins?: string[]; +} + +export interface HostEncryption { + privateRelay?: PrivateAdmission; + loopback?: 'encrypted'; + protocol: 'connect-noise-xk-v1'; + hostKey: string; + deviceKey: string; +} + +export function parsePrivateAdmission(input: unknown): PrivateAdmission | undefined { + const value = record(input); + if ( + typeof value['origin'] !== 'string' || + typeof value['token'] !== 'string' || + !/^[a-f0-9]{64}$/u.test(value['token']) + ) + return; + try { + const url = new URL(value['origin']); + if ( + !isPrivateRoute(url.origin) || + url.protocol !== 'https:' || + url.origin !== value['origin'] || + url.username || + url.password + ) + return; + const additional = value['additionalOrigins']; + if ( + additional !== undefined && + (!Array.isArray(additional) || + additional.length > 1 || + additional.some((origin) => { + if (typeof origin !== 'string' || origin === url.origin) return true; + try { + const extra = new URL(origin); + return ( + extra.origin !== origin || + !isPrivateRoute(origin) || + extra.protocol !== 'https:' || + !!extra.username || + !!extra.password + ); + } catch { + return true; + } + })) + ) + return; + return { + origin: url.origin, + token: value['token'], + ...(Array.isArray(additional) && additional.length ? { additionalOrigins: additional } : {}), + }; + } catch { + return; + } +} diff --git a/packages/core/src/devices/lan-address.ts b/packages/host-protocol/src/lan-address.ts similarity index 100% rename from packages/core/src/devices/lan-address.ts rename to packages/host-protocol/src/lan-address.ts diff --git a/packages/core/src/devices/noise/channel.ts b/packages/host-protocol/src/noise/channel.ts similarity index 100% rename from packages/core/src/devices/noise/channel.ts rename to packages/host-protocol/src/noise/channel.ts diff --git a/packages/core/src/devices/noise/xk.ts b/packages/host-protocol/src/noise/xk.ts similarity index 100% rename from packages/core/src/devices/noise/xk.ts rename to packages/host-protocol/src/noise/xk.ts diff --git a/apps/mobile/src/host/pairing-detail.ts b/packages/host-protocol/src/pairing-detail.ts similarity index 100% rename from apps/mobile/src/host/pairing-detail.ts rename to packages/host-protocol/src/pairing-detail.ts diff --git a/packages/host-protocol/src/pairing.ts b/packages/host-protocol/src/pairing.ts new file mode 100644 index 0000000000..e9c69a4698 --- /dev/null +++ b/packages/host-protocol/src/pairing.ts @@ -0,0 +1,161 @@ +import { teamHttpsRoute } from './team-invitation'; +import { checkRoute, isLanRoute, isTailscaleRoute, isLoopbackRoute } from './route'; +import { parsePrivateAdmission, type HostEncryption } from './host-encryption'; +import type { ConnectionDiagnostic } from './connection-diagnostic'; +import type { ConnectRefusal } from './connect-refusal'; + +export const DEVICE_PREFIX = '/botharness-device'; + +export interface PairingPayload { + member?: true; + enrollment?: { body: string; signature: string }; + encryption?: { + protocol: 'connect-noise-xk-v1'; + publicKey: string; + loopback?: 'encrypted'; + privateRelay?: HostEncryption['privateRelay']; + }; + host: { id: string; name: string }; + offer: string; + routes: string[]; + expiresAt: string; + verifier?: string; +} + +export type PairingRefusal = + | 'lan-build-required' + | 'lan-unreachable' + | 'lan-permission-denied' + | 'already-paired' + | 'host-key-required' + | 'host-key-changed' + | 'host-key-confirmation-required' + | 'channel-authentication-failed' + | 'link-invalid' + | 'link-expired' + | 'no-route' + | 'offer-invalid' + | 'offer-expired' + | 'unreachable' + | 'certificate-untrusted' + | ConnectRefusal; + +export type ParsedLink = + | { ok: true; payload: PairingPayload } + | { ok: false; code: PairingRefusal; detail?: string; diagnostic?: ConnectionDiagnostic }; + +const SCHEMES = new Set(['deepseekbot:', 'deepseekbot-dev:']); + +function base64UrlDecode(value: string): string { + const base64 = value.replace(/-/gu, '+').replace(/_/gu, '/'); + const binary = atob(base64 + '='.repeat((4 - (base64.length % 4)) % 4)); + return decodeURIComponent( + Array.from(binary, (char) => `%${char.charCodeAt(0).toString(16).padStart(2, '0')}`).join(''), + ); +} + +function record(value: unknown): Record { + return typeof value === 'object' && value !== null ? (value as Record) : {}; +} + +export function pairingLinkMode(encoded: string, now = Date.now()): 'lan' | 'private' | undefined { + const parsed = parsePairingLink(`deepseekbot://pair?p=${encodeURIComponent(encoded)}`, now); + if (!parsed.ok) return undefined; + if (parsed.payload.encryption?.privateRelay) return 'private'; + const { routes } = parsed.payload; + const lan = (route: string) => isLanRoute(route) && !isTailscaleRoute(route); + return routes.some(lan) && routes.every((route) => lan(route) || isLoopbackRoute(route)) + ? 'lan' + : undefined; +} + +export function parsePairingLink(text: string, now = Date.now()): ParsedLink { + let encoded: string | null; + try { + const url = new URL(text.trim()); + if (!SCHEMES.has(url.protocol)) return { ok: false, code: 'link-invalid' }; + encoded = url.searchParams.get('p'); + } catch { + return { ok: false, code: 'link-invalid' }; + } + let value: Record; + try { + value = record(JSON.parse(base64UrlDecode(encoded ?? ''))); + } catch { + return { ok: false, code: 'link-invalid' }; + } + const host = record(value['host']); + if ( + (value['v'] !== 1 && value['v'] !== 2) || + typeof host['id'] !== 'string' || + typeof host['name'] !== 'string' || + typeof value['offer'] !== 'string' || + typeof value['expiresAt'] !== 'string' || + !Array.isArray(value['routes']) + ) + return { ok: false, code: 'link-invalid' }; + if (value['v'] === 2) { + const encryption = record(value['encryption']); + if ( + encryption['loopback'] !== 'encrypted' || + encryption['protocol'] !== 'connect-noise-xk-v1' || + typeof encryption['publicKey'] !== 'string' || + !/^[0-9a-f]{64}$/u.test(encryption['publicKey']) || + value['routes'].length !== 1 || + typeof value['routes'][0] !== 'string' || + !/^http:\/\/127\.0\.0\.1:[1-9]\d{0,4}$/u.test(value['routes'][0]) + ) + return { ok: false, code: 'link-invalid' }; + } + if (Date.parse(value['expiresAt']) <= now) return { ok: false, code: 'link-expired' }; + const privateRelay = parsePrivateAdmission(record(value['encryption'])['privateRelay']); + if (privateRelay && (value['routes'].length !== 1 || value['routes'][0] !== privateRelay.origin)) + return { ok: false, code: 'no-route' }; + const routes = value['routes'].flatMap((route) => { + const checked = + typeof route === 'string' + ? checkRoute( + route, + parsePrivateAdmission(record(value['encryption'])['privateRelay'])?.origin, + ) + : undefined; + return checked?.ok === true + ? [checked.origin] + : value['member'] === true && + teamHttpsRoute(route) && + record(value['encryption'])['protocol'] === 'connect-noise-xk-v1' + ? [new URL(route).origin] + : []; + }); + if (routes.length === 0) return { ok: false, code: 'no-route' }; + return { + ok: true, + payload: { + ...(value['member'] === true ? { member: true as const } : {}), + host: { id: host['id'], name: host['name'] }, + offer: value['offer'], + routes, + expiresAt: value['expiresAt'], + ...(record(value['encryption'])['protocol'] === 'connect-noise-xk-v1' && + typeof record(value['encryption'])['publicKey'] === 'string' && + /^[0-9a-f]{64}$/u.test(String(record(value['encryption'])['publicKey'])) + ? { + encryption: { + ...(parsePrivateAdmission(record(value['encryption'])['privateRelay']) + ? { + privateRelay: parsePrivateAdmission( + record(value['encryption'])['privateRelay'], + )!, + } + : {}), + protocol: 'connect-noise-xk-v1' as const, + ...(record(value['encryption'])['loopback'] === 'encrypted' + ? { loopback: 'encrypted' as const } + : {}), + publicKey: String(record(value['encryption'])['publicKey']), + }, + } + : {}), + }, + }; +} diff --git a/apps/mobile/src/host/route.ts b/packages/host-protocol/src/route.ts similarity index 94% rename from apps/mobile/src/host/route.ts rename to packages/host-protocol/src/route.ts index 379aee30c8..3ee5a99fcd 100644 --- a/apps/mobile/src/host/route.ts +++ b/packages/host-protocol/src/route.ts @@ -1,8 +1,5 @@ -import { - CONNECT_HOSTNAME, - isConnectZoneHost, -} from '../../../../packages/core/src/devices/connect-zones'; -import { isLanAddress } from '../../../../packages/core/src/devices/lan-address'; +import { CONNECT_HOSTNAME, isConnectZoneHost } from './connect-zones'; +import { isLanAddress } from './lan-address'; export type RouteCheck = { ok: true; origin: string } | { ok: false; reason: string }; const isLoopbackHostname = (hostname: string): boolean => diff --git a/apps/mobile/src/host/team-invitation.ts b/packages/host-protocol/src/team-invitation.ts similarity index 100% rename from apps/mobile/src/host/team-invitation.ts rename to packages/host-protocol/src/team-invitation.ts diff --git a/apps/mobile/src/host/wire.ts b/packages/host-protocol/src/wire.ts similarity index 98% rename from apps/mobile/src/host/wire.ts rename to packages/host-protocol/src/wire.ts index 4e38403c74..45aed259dd 100644 --- a/apps/mobile/src/host/wire.ts +++ b/packages/host-protocol/src/wire.ts @@ -1,5 +1,5 @@ -import type { BotPrimaryColor } from '../../../../packages/core/src/bots/primary-color'; -import type { ChannelReplyPreviewMedia } from '../../../../packages/core/src/channels/reply-preview'; +import type { BotPrimaryColor } from '../../core/src/bots/primary-color'; +import type { ChannelReplyPreviewMedia } from '../../core/src/channels/reply-preview'; export type AggregatedState = 'idle' | 'thinking' | 'working' | 'waiting' | 'blocked'; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e33f848b3b..99316b6f91 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -349,6 +349,12 @@ importers: apps/mobile: dependencies: + '@botharness/host-client': + specifier: workspace:* + version: link:../../packages/host-client + '@botharness/host-protocol': + specifier: workspace:* + version: link:../../packages/host-protocol '@botharness/pixel-banner': specifier: 0.1.0 version: 0.1.0 @@ -689,6 +695,12 @@ importers: specifier: 4.0.1 version: 4.0.1(supports-color@10.2.2) devDependencies: + '@botharness/host-client': + specifier: workspace:* + version: link:../host-client + '@botharness/host-protocol': + specifier: workspace:* + version: link:../host-protocol '@deepseek-ai/cordis': specifier: 4.1.0 version: 4.1.0(@deepseek-ai/cordis-plugin-include@1.1.0)(@deepseek-ai/cordis-plugin-loader@1.1.0) @@ -801,6 +813,12 @@ importers: specifier: 0.35.4 version: 0.35.4(@types/node@22.20.3) devDependencies: + '@botharness/host-client': + specifier: workspace:* + version: link:../host-client + '@botharness/host-protocol': + specifier: workspace:* + version: link:../host-protocol '@deepseek-ai/cordis': specifier: 4.1.0 version: 4.1.0(@deepseek-ai/cordis-plugin-include@1.1.0)(@deepseek-ai/cordis-plugin-loader@1.1.0) @@ -928,6 +946,12 @@ importers: specifier: 8.21.3 version: 8.21.3 devDependencies: + '@botharness/host-client': + specifier: workspace:* + version: link:../host-client + '@botharness/host-protocol': + specifier: workspace:* + version: link:../host-protocol '@deepseek-ai/cordis': specifier: 4.1.0 version: 4.1.0(@deepseek-ai/cordis-plugin-include@1.1.0)(@deepseek-ai/cordis-plugin-loader@1.1.0) @@ -1074,6 +1098,27 @@ importers: specifier: 0.2.2-rc.1 version: 0.2.2-rc.1(de3ca408c713a130ae14636ca9841982) + packages/host-client: + dependencies: + '@botharness/host-protocol': + specifier: workspace:* + version: link:../host-protocol + '@tanstack/query-core': + specifier: 5.104.3 + version: 5.104.3 + + packages/host-protocol: + dependencies: + '@noble/ciphers': + specifier: 2.4.0 + version: 2.4.0 + '@noble/curves': + specifier: 2.4.0 + version: 2.4.0 + '@noble/hashes': + specifier: 2.4.0 + version: 2.4.0 + packages/ingest: dependencies: hono: diff --git a/scripts/check-package-boundaries.mjs b/scripts/check-package-boundaries.mjs new file mode 100644 index 0000000000..809745642b --- /dev/null +++ b/scripts/check-package-boundaries.mjs @@ -0,0 +1,107 @@ +import { execFileSync } from 'node:child_process'; +import { existsSync, readFileSync } from 'node:fs'; +import { dirname, posix, resolve } from 'node:path'; +import { fileURLToPath, pathToFileURL } from 'node:url'; +import { parse } from '@babel/parser'; + +export function packageBoundaryErrors(file, source, workspaces = new Map()) { + if (!file.startsWith('packages/')) return []; + const ast = parse(source, { + createImportExpressions: true, + sourceFilename: file, + sourceType: 'unambiguous', + plugins: [ + ['typescript', { dts: /\.d\.[cm]?ts$/u.test(file) }], + ...(file.endsWith('x') ? ['jsx'] : []), + ], + }); + const errors = []; + const queue = [ast]; + while (queue.length) { + const node = queue.pop(); + let input; + if (node.type === 'TSExternalModuleReference') input = node.expression; + if ( + [ + 'ImportDeclaration', + 'ExportNamedDeclaration', + 'ExportAllDeclaration', + 'ImportExpression', + ].includes(node.type) + ) + input = node.source; + if ( + node.type === 'CallExpression' && + ((node.callee.type === 'Identifier' && node.callee.name === 'require') || + (node.callee.type === 'MemberExpression' && node.callee.object.name === 'require')) + ) + input = node.arguments[0]; + if (input?.type === 'StringLiteral') { + const specifier = input.value; + const name = specifier.startsWith('@') + ? specifier.split('/').slice(0, 2).join('/') + : specifier.split('/')[0]; + const workspace = workspaces.get(name); + const target = specifier.startsWith('.') + ? posix.normalize(posix.join(posix.dirname(file), specifier)) + : workspace + ? `${workspace}/${specifier.slice(name.length + 1)}` + : specifier.startsWith('apps/') || specifier.startsWith('packages/') + ? specifier + : undefined; + if (target?.startsWith('apps/')) + errors.push( + `${file}:${input.loc.start.line}: packages must not import apps (${specifier})`, + ); + if ( + file.startsWith('packages/core/') && + (target?.startsWith('packages/client/') || name === '@botharness/ui') + ) + errors.push( + `${file}:${input.loc.start.line}: core must not import client source (${specifier})`, + ); + } + for (const value of Object.values(node)) { + if (Array.isArray(value)) queue.push(...value.filter((child) => child?.type)); + else if (value?.type) queue.push(value); + } + } + return errors; +} + +export function checkPackageBoundaries(root) { + const files = execFileSync( + 'git', + ['ls-files', '--cached', '--others', '--exclude-standard', '-z'], + { cwd: root, encoding: 'utf8', windowsHide: true }, + ) + .split('\0') + .filter((file) => file && existsSync(resolve(root, file))); + const workspaces = new Map(); + for (const file of files.filter((file) => + /^(?:apps|packages)\/[^/]+\/package\.json$/u.test(file), + )) { + const manifest = JSON.parse(readFileSync(resolve(root, file), 'utf8')); + workspaces.set(manifest.name, posix.dirname(file)); + } + return files + .filter((file) => /^packages\/.*\.[cm]?[jt]sx?$/u.test(file)) + .flatMap((file) => + (() => { + try { + return packageBoundaryErrors(file, readFileSync(resolve(root, file), 'utf8'), workspaces); + } catch (error) { + throw new Error(`${file}: ${error.message}`); + } + })(), + ); +} + +if (process.argv[1] && import.meta.url === pathToFileURL(resolve(process.argv[1])).href) { + const errors = checkPackageBoundaries(resolve(dirname(fileURLToPath(import.meta.url)), '..')); + if (errors.length) { + console.error(errors.join('\n')); + process.exitCode = 1; + } else + console.log('package boundaries: packages do not import apps; core does not import client'); +} diff --git a/scripts/cli-ui-inventory.json b/scripts/cli-ui-inventory.json index 9b439db964..f52ae2b95f 100644 --- a/scripts/cli-ui-inventory.json +++ b/scripts/cli-ui-inventory.json @@ -192,10 +192,10 @@ "description": "#2088 reuses native Settings for exactly four live fields: assignmentConcurrencyLimit, developerMode, showBotSessions and showApprovalReviewSessions. Scoped Tob writes add source/approval/revision guards; no new settings owner.", "scope": "Host / protected Tob Human DM", "surfaces": [ - "field:packages/client/src/bot-mode-settings.ts:assignmentConcurrencyLimit", - "field:packages/client/src/bot-mode-settings.ts:developerMode", - "field:packages/client/src/bot-mode-settings.ts:showApprovalReviewSessions", - "field:packages/client/src/bot-mode-settings.ts:showBotSessions", + "field:packages/host-client/src/shared/bot-mode-settings.ts:assignmentConcurrencyLimit", + "field:packages/host-client/src/shared/bot-mode-settings.ts:developerMode", + "field:packages/host-client/src/shared/bot-mode-settings.ts:showApprovalReviewSessions", + "field:packages/host-client/src/shared/bot-mode-settings.ts:showBotSessions", "setting:packages/client/src/client/assignment-concurrency-setting.tsx:{t('assignmentLimit.title')}", "setting:packages/client/src/client/bot-mode-setting-rows.tsx:{t('approvalReviewSessions.row.title')}", "setting:packages/client/src/client/bot-mode-setting-rows.tsx:{t('botSessions.row.title')}", @@ -208,16 +208,16 @@ "description": "Remaining native preferences reuse Human settings/settings-set; these fields are outside scoped Tob #2088 access (follow-ups #2094/#2095).", "scope": "Host", "surfaces": [ - "field:packages/client/src/bot-mode-settings.ts:autoAcceptGroupInvites", - "field:packages/client/src/bot-mode-settings.ts:autoCollapseMessages", - "field:packages/client/src/bot-mode-settings.ts:botIcon", - "field:packages/client/src/bot-mode-settings.ts:motionPreference", - "field:packages/client/src/bot-mode-settings.ts:sendKey", - "field:packages/client/src/bot-mode-settings.ts:sortMode", - "field:packages/client/src/bot-mode-settings.ts:sortModes", - "field:packages/client/src/bot-mode-settings.ts:showDeliveryReceipts", - "field:packages/client/src/bot-mode-settings.ts:streamReplies", - "field:packages/client/src/bot-mode-settings.ts:botHopLimit", + "field:packages/host-client/src/shared/bot-mode-settings.ts:autoAcceptGroupInvites", + "field:packages/host-client/src/shared/bot-mode-settings.ts:autoCollapseMessages", + "field:packages/host-client/src/shared/bot-mode-settings.ts:botIcon", + "field:packages/host-client/src/shared/bot-mode-settings.ts:motionPreference", + "field:packages/host-client/src/shared/bot-mode-settings.ts:sendKey", + "field:packages/host-client/src/shared/bot-mode-settings.ts:sortMode", + "field:packages/host-client/src/shared/bot-mode-settings.ts:sortModes", + "field:packages/host-client/src/shared/bot-mode-settings.ts:showDeliveryReceipts", + "field:packages/host-client/src/shared/bot-mode-settings.ts:streamReplies", + "field:packages/host-client/src/shared/bot-mode-settings.ts:botHopLimit", "setting:packages/client/src/client/bot-hop-limit-setting.tsx:{t('botHopLimit.title')}", "setting:packages/client/src/client/bot-mode-setting-rows.tsx:{t('groupAutoAccept.row.title')}", "setting:packages/client/src/client/bot-mode-setting-rows.tsx:{t('icon.row.title')}", diff --git a/scripts/test/ci-plan.test.mjs b/scripts/test/ci-plan.test.mjs index e610612082..911f5557a0 100644 --- a/scripts/test/ci-plan.test.mjs +++ b/scripts/test/ci-plan.test.mjs @@ -462,3 +462,23 @@ describe('CI test plan drift checks', () => { expect(syncGuide(synced)).toBe(synced); }); }); + +it('verifies mobile when a shared workspace package changes', () => { + const files = { + 'apps/mobile/package.json': JSON.stringify({ name: '@botharness/mobile' }), + 'apps/mobile/src/session.ts': "import { client } from '@botharness/host-client/client';", + 'packages/host-client/package.json': JSON.stringify({ name: '@botharness/host-client' }), + 'packages/host-client/src/client.ts': "import { codec } from '@botharness/host-protocol/wire';", + 'packages/host-protocol/package.json': JSON.stringify({ name: '@botharness/host-protocol' }), + 'packages/host-protocol/src/wire.ts': 'export const codec = 1;', + }; + for (const path of ['packages/host-client/src/client.ts', 'packages/host-protocol/src/wire.ts']) { + expect( + mobileVerification({ + event: 'pull_request', + changes: [{ status: 'modified', path }], + index: createIndex(Object.keys(files), (file) => files[file]), + }), + ).toEqual({ run: true, reason: `${path} is imported by mobile` }); + } +}); diff --git a/scripts/test/package-boundaries.test.mjs b/scripts/test/package-boundaries.test.mjs new file mode 100644 index 0000000000..a465f07eca --- /dev/null +++ b/scripts/test/package-boundaries.test.mjs @@ -0,0 +1,54 @@ +import { describe, expect, it } from 'vitest'; +import { packageBoundaryErrors } from '../check-package-boundaries.mjs'; + +const workspaces = new Map([ + ['@botharness/mobile', 'apps/mobile'], + ['@botharness/ui', 'packages/client'], + ['@botharness/host-client', 'packages/host-client'], +]); +describe('workspace dependency boundaries', () => { + it.each([ + "import type { T } from '../../../apps/mobile/src/host/types';", + "export * from '../../../apps/mobile/src/host/types';", + "const value = import('../../../apps/mobile/src/host/types');", + "const value = require('../../../apps/mobile/src/host/types');", + "import { value } from '@botharness/mobile/host/types';", + ])('rejects app dependencies including types, exports and runtime imports: %s', (source) => { + expect(packageBoundaryErrors('packages/core/src/example.ts', source, workspaces)).toHaveLength( + 1, + ); + }); + it.each([ + "import { value } from '../../client/src/example';", + "export * from '@botharness/ui/panels';", + ])('rejects core imports of client: %s', (source) => { + expect(packageBoundaryErrors('packages/core/src/example.ts', source, workspaces)).toHaveLength( + 1, + ); + }); + it('permits both apps and packages to consume shared logic', () => { + expect( + packageBoundaryErrors( + 'packages/core/src/example.ts', + "import { value } from '@botharness/host-client/team-client';", + workspaces, + ), + ).toEqual([]); + expect( + packageBoundaryErrors( + 'apps/mobile/src/example.ts', + "import { value } from '@botharness/host-client/team-client';", + workspaces, + ), + ).toEqual([]); + }); + it('ignores prose and local variable names', () => { + expect( + packageBoundaryErrors( + 'packages/core/src/example.ts', + 'const text = "apps/mobile/src";', + workspaces, + ), + ).toEqual([]); + }); +}); diff --git a/scripts/verification-inventory.json b/scripts/verification-inventory.json index f66fec7f9e..4d06566f10 100644 --- a/scripts/verification-inventory.json +++ b/scripts/verification-inventory.json @@ -435,7 +435,7 @@ { "id": "phone.browser", "label": "View Browser frame, take over, input and handle revocation", - "source": "apps/mobile/src/host/browser-viewer.ts", + "source": "packages/host-client/src/browser-viewer.ts", "guide": ".agents/skills/verify-deepseekbot/features/phone-browser.md", "task": 1976, "gap": null @@ -467,7 +467,7 @@ { "id": "phone.activity.inbox", "label": "Read current native Inbox and handle existing requests", - "source": "apps/mobile/src/host/inbox.ts", + "source": "packages/host-client/src/inbox.ts", "guide": null, "task": 1954, "gap": "Current main Inbox only. The unmerged #1954 redesign and its later options semantics are excluded from the implemented denominator; native requalification and complete map belong to #1954." @@ -675,7 +675,7 @@ { "id": "phone.full-client", "label": "Open paired full Client and revoke access without revoking operator", - "source": "apps/mobile/src/host/client.ts", + "source": "packages/host-client/src/client.ts", "guide": null, "task": 1967, "gap": "No maintained feature-map recipe binds this behavior to setup, user actions, authoritative read, cleanup and failure observation. Historical scripts below are candidates, not qualified paths." @@ -683,7 +683,7 @@ { "id": "phone.viewers", "label": "Read paired Browser/Computer viewers with isolation and revocation", - "source": "apps/mobile/src/host/computer-viewer.ts", + "source": "packages/host-client/src/computer-viewer.ts", "guide": null, "task": 1977, "gap": "No maintained feature-map recipe binds this behavior to setup, user actions, authoritative read, cleanup and failure observation. Historical scripts below are candidates, not qualified paths." diff --git a/tsconfig.json b/tsconfig.json index 7fec3c0e3a..d79842a932 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -25,6 +25,8 @@ "files": ["packages/client/src/dsh-client-context.d.ts"], "include": [ "packages/client/src", + "packages/host-client/src", + "packages/host-protocol/src", "packages/computer/src", "packages/vrm-companion/src", "packages/core/src", diff --git a/tsdown.config.ts b/tsdown.config.ts index b4efb91cd1..39e75ae5a1 100644 --- a/tsdown.config.ts +++ b/tsdown.config.ts @@ -12,6 +12,7 @@ import { genuiRuntimeAssetsPlugin } from './scripts/genui-runtime-assets.mjs'; const ROOT_DIR = fileURLToPath(new URL('.', import.meta.url)); const CLIENT_ID = '@botharness/ui'; +const SHARED_HOST_PACKAGES = /^@botharness\/host-(?:client|protocol)(?:\/|$)/; const PLATFORM_MODULES = [ /^react$/, @@ -39,6 +40,7 @@ function clientBundle(id: string, entry: string[], outDir: string): UserConfig { clean: true, sourcemap: true, external: PLATFORM_MODULES, + deps: { alwaysBundle: [SHARED_HOST_PACKAGES] }, plugins: [ { name: 'botharness:vfile-browser-imports', @@ -122,7 +124,7 @@ export const coreCliBundleOptions: UserConfig = { dts: false, clean: true, external: ['@resvg/resvg-js', 'silk-wasm', 'opus-decoder', 'css-tree', 'sharp'], - deps: { alwaysBundle: [/^@deepseek-ai\//] }, + deps: { alwaysBundle: [/^@deepseek-ai\//, SHARED_HOST_PACKAGES] }, }; function sourceBuildStamp(): { revision: string; dirty: boolean } | null { @@ -221,7 +223,7 @@ export default defineConfig([ platform: 'node', dts: true, clean: true, - noExternal: [/^pele(?:\/|$)/], + deps: { alwaysBundle: [/^pele(?:\/|$)/, SHARED_HOST_PACKAGES] }, external: [ '@resvg/resvg-js', 'silk-wasm', From 9d12f58e64ba0fe134a93348080fd520339b26d9 Mon Sep 17 00:00:00 2001 From: DoodleBear Date: Mon, 16 Nov 2026 07:30:03 +0900 Subject: [PATCH 2/6] feat: expose desktop Team member sign-in flow Issue: #4201 Agent-Task: codex/local/01a1e112-8bdc-7472-b4a5-e7a2c592ecb7 Co-Authored-By: Codex --- changes/4201-shared-host-client.md | 11 + docs/adr/0336-hosts-have-members.md | 4 + docs/architecture/botharness-architecture.md | 2 + .../architecture/team-mode-desktop-sign-in.md | 77 +++++ packages/client/src/client/remote-hosts.ts | 98 +++++- .../test/remote-host-enrollment.test.ts | 45 +++ .../client/test/remote-team-sign-in.test.ts | 115 +++++++ .../src/devices/relationship-enrollment.ts | 12 +- packages/host-client/src/hosts.ts | 10 + packages/host-client/src/team-sign-in.ts | 264 +++++++++++++++++ .../host-client/test/team-sign-in.test.ts | 280 ++++++++++++++++++ 11 files changed, 908 insertions(+), 10 deletions(-) create mode 100644 changes/4201-shared-host-client.md create mode 100644 docs/architecture/team-mode-desktop-sign-in.md create mode 100644 packages/client/test/remote-team-sign-in.test.ts create mode 100644 packages/host-client/src/team-sign-in.ts create mode 100644 packages/host-client/test/team-sign-in.test.ts diff --git a/changes/4201-shared-host-client.md b/changes/4201-shared-host-client.md new file mode 100644 index 0000000000..455c3133b5 --- /dev/null +++ b/changes/4201-shared-host-client.md @@ -0,0 +1,11 @@ +--- +section: Changed +--- + +## en + +- Desktop and mobile now share Host protocol and session modules. The desktop adapter recognizes Team invitations and exposes fingerprint confirmation, member sign-in and the first-password-change gate for the sign-in UI ([#4201](https://github.com/BotHarness/DeepSeekBot/issues/4201)). + +## zh + +- 桌面端与移动端现在共用 Host 协议和会话模块。桌面适配器可识别团队邀请,并为登录界面提供指纹确认、成员登录和首次修改密码流程([#4201](https://github.com/BotHarness/DeepSeekBot/issues/4201))。 diff --git a/docs/adr/0336-hosts-have-members.md b/docs/adr/0336-hosts-have-members.md index e7c71e9423..72b95d39bb 100644 --- a/docs/adr/0336-hosts-have-members.md +++ b/docs/adr/0336-hosts-have-members.md @@ -45,3 +45,7 @@ First delivery is **permission isolation among colleagues, not OS isolation agai Deliver as tracer bullets under a dedicated spec and hub, parallel to the Environment hub. M0 threads explicit Human context through Host methods with no behavior change. M1 is the first end-to-end slice: enable Team mode, set the Owner password, create a member, sign that member in from a LAN browser over HTTPS, show only the Tobs Client, join a public Channel and exchange messages with the Owner, with matching CLI. Seek Human feedback before broadening. Every slice proves refusals as well as successes: a member cannot read another member's private Bot, Channel, DM, Workspace root or approval content through the Client, the Gateway, the CLI with `--as`, or a Bot tool call. The design narrative and question log live in [Team mode design](../architecture/team-mode.md). + +## Shared client implementation seam (#4201) + +The Team invitation, pairing and Noise formats belong to the pure `packages/host-protocol` workspace. Desktop and mobile use `packages/host-client` for member requests, saved identities and the fingerprint → sign-in → forced-password-change flow. Native storage, installed version and key-agreement adapters remain application-owned and injected. This avoids package imports of the mobile app and preserves the Host as the sole identity/grant authority. The [desktop UI contract](../architecture/team-mode-desktop-sign-in.md) describes the adapter and its regression limits; visual and native acceptance are separate. diff --git a/docs/architecture/botharness-architecture.md b/docs/architecture/botharness-architecture.md index f68522607c..ad7c6fdf38 100644 --- a/docs/architecture/botharness-architecture.md +++ b/docs/architecture/botharness-architecture.md @@ -1687,6 +1687,8 @@ The application-defined Devices private connection owner manages a Quick Tunnel ### Team mode M1 identity and transport +Desktop and mobile share the pure `host-protocol` contracts and the framework-independent `host-client` session logic. Native storage and transports stay in the mobile app behind injected interfaces. The desktop remote-host adapter drives member sign-in without creating relationship grants; see [Desktop Team sign-in contract](team-mode-desktop-sign-in.md) for states, identity persistence and ownership boundaries. + The application-defined Team member owner separates durable identity, password credentials and revocable grants from the DSH-native Peer lifetime. Member page resources render for that Peer, and unary/stream operations dispatch through the API Gateway with an explicit member principal and default-deny access policy. Existing Owner devices retain `local-human`. Group public visibility reuses canonical Channel membership. See [Team mode M1 runtime boundaries](team-mode-m1-runtime.md) for persistence, transport, CLI and performance constraints; later Team slices remain separate. M2 adds application-defined private Bot ownership, one Tob per Human, scoped Activity projections and Human-bound push/Live Activity delivery. The member Peer remains the API Gateway principal; no Owner cookie is used by member traffic or a member Tob. See [Team mode M2 runtime boundaries](team-mode-m2-runtime.md) for persistence, authorization, CLI integration and regression budgets. diff --git a/docs/architecture/team-mode-desktop-sign-in.md b/docs/architecture/team-mode-desktop-sign-in.md new file mode 100644 index 0000000000..7acb814441 --- /dev/null +++ b/docs/architecture/team-mode-desktop-sign-in.md @@ -0,0 +1,77 @@ +# Desktop Team sign-in contract + +Issue [#4201](https://github.com/BotHarness/DeepSeekBot/issues/4201), stacked on M8 [#4165](https://github.com/BotHarness/DeepSeekBot/pull/4165). This contract supplies logic for the desktop sign-in stepper; Claude owns its visual components. It implements the identity and transport boundaries of [ADR-0336](../adr/0336-hosts-have-members.md). + +## Packages and ownership + +- `@botharness/host-protocol/*` owns the pure wire contracts, Host carrier interface, Noise XK/channel implementation, route rules, pairing link codec and Team invitation codec. It contains no React, React Native or Expo implementation. +- `@botharness/host-client/*` owns saved Host identities, Team requests and the sign-in flow, pairing redemption, encrypted carrier, Host session, conversations, inbox, model/settings and notification clients. Shared appearance values and non-visual presentation helpers live here because desktop and mobile both consume them. The model cache uses `@tanstack/query-core`, without a React adapter. +- `apps/mobile` owns SecureStore, native transport, app version, Android key agreement, localization and platform UI. `HostCarrier.keyAgreement` injects Android's existing key agreement implementation; `HostCarrier.appVersion` supplies the installed version. No native module is imported by either shared package. Inbox localization is supplied with the `InboxQuery.activityUpdateHost()` callback so an active inbox reads the current language. +- `packages/client/src/client/remote-hosts.ts` adapts the shared flow to the desktop Owner's existing remote-host storage lock and connection lifecycle. This change does not deliver the stepper or H3 Host-side credential custody. + +The computer-side bundles inline both private workspaces. Published plugin manifests keep them as build-time dependencies; installed plugins do not need unpublished workspace packages. Metro consumes the mobile workspace dependencies directly. + +`pnpm lint` rejects every package import of `apps/**`, including test, type-only, re-export, dynamic import and require paths. It also rejects core imports of desktop Client source. Shared test fixtures reside under `packages/host-client/test`; cross-layer companion tests reside under `packages/client/test`. + +## Entry points + +Import `remoteHosts` and types from `packages/client/src/client/remote-hosts.ts` in the desktop Client. The `RemoteHosts` adapter exposes: + +```ts +teamSignIn( + target: TeamSignInTarget, + localHostId?: string, + signal?: AbortSignal, +): Promise>; +``` + +`TeamSignInTarget` is either `{ kind: 'invitation', link }` or `{ kind: 'address', route, username }`. A manual address must be an HTTPS origin. Manual discovery reads `/botharness-device/channel` to obtain the Host id, name, public key and fingerprint, verifies their consistency, and sends no password. Display that fingerprint for independent comparison with the Host's fingerprint. Discovery alone is not identity verification. + +The existing `pair(link, deviceName, localHostId, trust)` returns `{ ok: false, code: 'team-sign-in-required', invitation }` for a valid Team invitation. The UI must route this result to `teamSignIn({ kind: 'invitation', link }, localHostId)`. Invalid or expired Team invitations retain their invitation-specific refusal code. They never become relationship enrollment or ordinary pairing offers. + +A UI can also use the framework-independent `prepareTeamSignIn` from `@botharness/host-client/team-sign-in`, injecting a `HostCarrier`, `previous(hostId)` and `commit(host, confirmed, signal)`. The commit callback must atomically recheck identity replacement and persistence ownership; use the desktop adapter for the built-in Client. + +## State and actions + +`flow.getSnapshot()` returns a discriminated `TeamSignInState`; `flow.subscribe(listener)` returns an unsubscribe function. Snapshots contain no password, credential or private key. The UI owns pending-button feedback while awaiting each action, and renders the last returned refusal alongside the current step. Refusals leave that step retryable. + +| State | Data | Action | +| ----------------------- | --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `fingerprint` | `host: { id, name, fingerprint }`, `username` | Compare with the Host; call `confirmFingerprint(fingerprint)` with the exact displayed value. | +| `sign-in` | Same Host and username | `await signIn({ password, deviceName })`. No password is sent before confirmation. | +| `password-change` | `member` | `await changePassword({ current, next })`. Clear password fields after success; keep them local to the form. | +| `identity-confirmation` | `member` | `await complete()`. If it refuses `identity-switch-required`, obtain explicit replacement confirmation and retry `complete(true)`. | +| `complete` | `member` | `complete` has returned `{ ok: true, value: SavedHost }`; close the stepper. | +| `cancelled` | No identity | Dismiss; start a fresh flow to retry. | + +A returning member skips `password-change` when the Host says `mustChangePassword: false`. `complete()` never persists a Host while that gate is set. Repeated or out-of-order actions refuse `flow-busy` or `flow-step-invalid`. The UI should disable duplicate submission. + +`await flow.cancel()` aborts sign-in work and attempts to revoke an uncommitted device grant. Unreachable revocation cannot guarantee remote cleanup. Cancellation waits for a commit already in progress: a completed save stays installed; a failed commit remains cancellable. The external `AbortSignal` cancels the flow as well. Dispose the subscription when closing the stepper. + +## Identity and authority + +`SavedHost.member` records member `humanId`, `username`, `displayName`, pinned `fingerprint` and `mustChangePassword`. Its absence is the backward-compatible Owner representation. `savedHostIdentity(host)` returns `{ kind: 'owner' }` or `{ kind: 'member', humanId, username }` for display and identity comparisons. Parsing refuses a `member.*` credential without valid member metadata. + +One saved identity is active per Host. Replacing Owner with member, or switching Human id, needs confirmation; a changed pinned Host fingerprint is always refused, even with replacement confirmation. The desktop adapter rechecks these conditions under the storage lock, retires the old session and its viewers, installs the member session and attempts to revoke the superseded grant. Member traffic uses the M8 device grant and member Peer, never an Owner cookie. Relationship and E6 enrollment refuse member credentials and cannot manufacture a member grant. + +Remote-host management is available only to the local Owner Client. This is independent of being a member on the remote Host. H3's credential custody migration remains a separate issue scope; existing desktop storage remains in place for this change. + +## Refusals + +All actions use `{ ok: true, value } | { ok: false, code, retryAfterSeconds? }`. Codes are stable machine values: + +- Invitation: `invitation-invalid`, `invitation-expired`, `invitation-version-unsupported`. +- Trust/transport: `fingerprint-mismatch`, `insecure-transport`, `unreachable`, `response-invalid`, `request-cancelled`. +- Authentication: `credentials-invalid`, `rate-limited`, `team-mode-off`, `member-suspended`, `remote-access/denied`. +- Password: `password-change-required`, `password-weak`, `password-reused`, `invalid-input`. +- Lifecycle/persistence: `identity-switch-required`, `storage-failed`, `flow-step-invalid`, `flow-busy`, `owner-required`, `this-host`. + +For `rate-limited`, honor a positive `retryAfterSeconds` and retain the username. A fingerprint mismatch must stop the sign-in attempt; do not offer a bypass. Passwords and device credentials never belong in logs or telemetry. Starting a new flow is required after cancellation. + +No new Host bridge method, `/api` route or Bot tool is introduced: the adapter uses M8's device sign-in/password/unpair surfaces. Existing CLI member commands and their parity checks remain unchanged. + +## Regression and performance limits + +The extraction preserves existing session algorithms, caches and refresh intervals. It adds no session polling or always-running timer. Invitation preparation and fingerprint confirmation are local; a regression asserts zero requests before confirmation. Manual discovery uses one GET. A successful HTTPS sign-in uses one discovery GET and one sign-in POST; first-password change adds one POST. Network timeouts remain bounded by the existing Team client (30 seconds overall, eight seconds per route attempt); there is no new retry loop. These request-count guards bound added work without claiming end-to-end speedups. + +Tests cover the complete adapter-to-storage path, first-password gate, invalid trust, identity switching, cancellation, retryable refusals, package lint and mobile CI selection. Existing mobile and desktop suites cover the moved surrounding journeys. Native-device, visual stepper and Human acceptance remain separate gates. diff --git a/packages/client/src/client/remote-hosts.ts b/packages/client/src/client/remote-hosts.ts index 8c86634653..df22015e8f 100644 --- a/packages/client/src/client/remote-hosts.ts +++ b/packages/client/src/client/remote-hosts.ts @@ -1,3 +1,15 @@ +import { + prepareTeamSignIn, + type TeamSignInTarget, + type TeamSignInFlow, + type TeamSignInError, +} from '@botharness/host-client/team-sign-in'; +import { + parseTeamInvitation, + type TeamResult, + type TeamInvitation, +} from '@botharness/host-protocol/team-invitation'; +import { prepareMemberIdentity } from '@botharness/host-client/member-identity'; import { connectionOperationIndexSchema, pendingConnectionSchema, @@ -29,10 +41,7 @@ import { type HostClient, type HostSnapshot, } from '@botharness/host-client/client'; -import { - createConversation, - type Conversation, -} from '@botharness/host-client/conversation'; +import { createConversation, type Conversation } from '@botharness/host-client/conversation'; import { parseSavedHost, serializeSavedHost, @@ -96,11 +105,13 @@ export interface RemoteHostsSnapshot { } export type HostPairResult = + | { ok: false; code: 'team-sign-in-required'; invitation: TeamInvitation } | { ok: true; host: SavedHost } | { ok: false; code: | PairingRefusal + | TeamSignInError | 'already-paired' | 'pairing-in-progress' | 'this-host' @@ -118,6 +129,11 @@ export interface RemotePairTrust { } export interface RemoteHosts { + teamSignIn( + target: TeamSignInTarget, + localHostId?: string, + signal?: AbortSignal, + ): Promise>; withConnectionOperation( hostId: string, client: HostClient, @@ -1210,9 +1226,83 @@ export function createRemoteHosts(options: { notifications.stop(); }; }, + async teamSignIn(target, localHostId, signal) { + if (!enabled) return { ok: false, code: 'owner-required' }; + const preparedFlow = await prepareTeamSignIn({ + target, + carrier, + ...(signal ? { signal } : {}), + previous: (hostId) => readHosts(storage).find((host) => host.hostId === hostId), + async commit(host, confirmed, flowSignal) { + if (host.hostId === localHostId) return { ok: false, code: 'this-host' }; + if (flowSignal.aborted) return { ok: false, code: 'request-cancelled' }; + if ( + hostSettingsDrafts.hasDirty(host.hostId) && + !(await hostSettingsDrafts.prepare(host.hostId)) + ) + return { ok: false, code: 'request-cancelled' }; + const previous = readHosts(storage).find((item) => item.hostId === host.hostId); + let refusal: TeamSignInError | undefined; + try { + await persistCredential(host.hostId, previous, (current) => { + if (flowSignal.aborted) throw new Error('request-cancelled'); + const prepared = prepareMemberIdentity( + { hosts: current ? [current] : [] }, + host, + confirmed, + ); + if (!prepared.ok) { + refusal = prepared.code; + throw new Error(prepared.code); + } + return host; + }); + } catch { + return { + ok: false, + code: refusal ?? (flowSignal.aborted ? 'request-cancelled' : 'storage-failed'), + }; + } + const existing = clients.get(host.hostId); + if (existing) { + const releasing = releaseRemoteHostViewers(existing.client); + retireEntry(existing); + await releasing.catch(() => undefined); + } + attach(host); + tab = host.hostId; + try { + storage?.setItem(HOST_TAB_STORAGE_KEY, tab); + } catch {} + publish(); + if (previous && previous.credential !== host.credential) { + try { + await revokePairing({ host: previous, carrier }); + } catch {} + } + return { ok: true, value: host }; + }, + }); + if (preparedFlow.ok) { + const step = preparedFlow.value.getSnapshot(); + if (step.kind === 'fingerprint' && step.host.id === localHostId) { + await preparedFlow.value.cancel(); + return { ok: false, code: 'this-host' }; + } + } + return preparedFlow; + }, async pair(link, deviceName, localHostId, trust) { if (!enabled) return { ok: false, code: 'owner-required' }; if (trust?.signal?.aborted) return { ok: false, code: 'cancelled' }; + try { + if (new URL(link.trim()).hostname === 'team') { + const invitation = parseTeamInvitation(link); + return invitation.ok + ? { ok: false, code: 'team-sign-in-required', invitation: invitation.value } + : invitation; + } + } catch {} const parsed = parsePairingLink(link); const refused = (code: 'this-host' | 'already-paired') => { record('remote_host:host_pair_complete', { outcome: 'refused' }); diff --git a/packages/client/test/remote-host-enrollment.test.ts b/packages/client/test/remote-host-enrollment.test.ts index bae8ec2dad..4ecb603438 100644 --- a/packages/client/test/remote-host-enrollment.test.ts +++ b/packages/client/test/remote-host-enrollment.test.ts @@ -640,3 +640,48 @@ it('preserves a replacement persisted before cancelled cleanup obtains the crede ); expect(revoke).toHaveBeenCalledOnce(); }); + +it('refuses persisted member credentials as relationship enrollment identities', () => { + const host = grant().host; + const member = { + humanId: 'member-human', + username: 'bob', + displayName: 'Bob', + fingerprint: 'ab'.repeat(32), + mustChangePassword: false, + }; + expect( + enrollment.parseRelationshipSavedHost({ + ...host, + credential: `member.${'a'.repeat(43)}`, + member, + }), + ).toBeUndefined(); + expect(enrollment.parseRelationshipSavedHost(host)).toBeDefined(); +}); + +it('revokes and refuses a member grant returned to the Owner relationship enrollment path', async () => { + const host = grant().host; + const memberHost = { + ...host, + credential: `member.${'a'.repeat(43)}`, + member: { + humanId: 'member-human', + username: 'bob', + displayName: 'Bob', + fingerprint: 'ab'.repeat(32), + mustChangePassword: false, + }, + }; + vi.spyOn(pairing, 'redeemPairing').mockResolvedValue({ ok: true, host: memberHost }); + const revoke = vi.spyOn(pairing, 'revokePairing').mockResolvedValue('revoked'); + const result = await enrollment.enrollRelationshipClient({ + relationshipId: relationship().id, + expectedPeer: { id: 'b', publicKey: 'ab'.repeat(32) }, + name: 'Desktop', + carrier: { ...carrier, randomBytes: () => new Uint8Array(32).fill(5) }, + request: async () => ({ peer: relationship().peer, offer: 'offer', expiresAt: '2030-01-01' }), + }); + expect(result).toEqual({ ok: false, code: 'owner-required' }); + expect(revoke).toHaveBeenCalledWith({ host: memberHost, carrier: expect.any(Object) }); +}); diff --git a/packages/client/test/remote-team-sign-in.test.ts b/packages/client/test/remote-team-sign-in.test.ts new file mode 100644 index 0000000000..e794bd45fe --- /dev/null +++ b/packages/client/test/remote-team-sign-in.test.ts @@ -0,0 +1,115 @@ +import { randomBytes } from 'node:crypto'; +import { describe, expect, it } from 'vitest'; +import type { HostCarrier } from '@botharness/host-protocol/carrier'; +import { noiseFingerprint, noisePublicKey } from '@botharness/host-protocol/noise/xk'; +import { savedHostIdentity } from '@botharness/host-client/hosts'; +import { + createRemoteHosts, + REMOTE_HOSTS_STORAGE_KEY, + type HostStorage, +} from '../src/client/remote-hosts'; + +const key = noisePublicKey(randomBytes(32)); +const fingerprint = noiseFingerprint(key); +const invitation = { + v: 1, + host: { id: 'team', name: 'Team', fingerprint }, + routes: ['https://team.example'], + username: 'bob', + expiresAt: '2030-01-01', +}; +const link = `deepseekbot://team?i=${Buffer.from(JSON.stringify(invitation)).toString('base64url')}`; +function setup(enabled = true) { + const saved = new Map(); + const storage: HostStorage = { + getItem: (key) => saved.get(key) ?? null, + setItem: (key, value) => { + saved.set(key, value); + }, + removeItem: (key) => { + saved.delete(key); + }, + }; + const calls: string[] = []; + const carrier: HostCarrier = { + randomBytes: () => randomBytes(32), + async request(url) { + calls.push(url); + return { + status: 200, + text: async () => + JSON.stringify( + url.endsWith('/channel') + ? { + host: invitation.host, + encryption: { publicKey: Buffer.from(key).toString('hex'), fingerprint }, + } + : { + host: invitation.host, + humanId: 'bob-id', + displayName: 'Bob', + mustChangePassword: false, + deviceId: 'desktop', + credential: `member.${'a'.repeat(43)}`, + }, + ), + }; + }, + openSocket() { + throw new Error('unexpected-socket'); + }, + }; + return { hosts: createRemoteHosts({ carrier, storage, enabled }), saved, calls }; +} + +describe('desktop Team sign-in adapter', () => { + it('recognizes a Team invitation as a sign-in request without redeeming a pairing offer', async () => { + const test = setup(); + expect(await test.hosts.pair(link, 'Desktop')).toMatchObject({ + ok: false, + code: 'team-sign-in-required', + invitation: { username: 'bob' }, + }); + expect(test.calls).toEqual([]); + }); + it('stores and exposes the signed-in member only after completing the flow', async () => { + const test = setup(); + const prepared = await test.hosts.teamSignIn({ kind: 'invitation', link }); + expect(prepared.ok).toBe(true); + if (!prepared.ok) return; + const flow = prepared.value; + flow.confirmFingerprint(fingerprint); + expect((await flow.signIn({ password: 'password', deviceName: 'Desktop' })).ok).toBe(true); + expect(test.saved.get(REMOTE_HOSTS_STORAGE_KEY)).toBeUndefined(); + const result = await flow.complete(); + expect(result.ok).toBe(true); + if (!result.ok) return; + expect(savedHostIdentity(result.value)).toEqual({ + kind: 'member', + humanId: 'bob-id', + username: 'bob', + }); + expect(JSON.parse(test.saved.get(REMOTE_HOSTS_STORAGE_KEY)!)[0].member).toMatchObject({ + humanId: 'bob-id', + username: 'bob', + }); + expect(test.hosts.getSnapshot().hosts[0]?.host.member?.humanId).toBe('bob-id'); + expect(test.calls.some((url) => /relationship|\/pair$/u.test(url))).toBe(false); + }); + it('refuses the local Host before password sign-in', async () => { + const test = setup(); + expect(await test.hosts.teamSignIn({ kind: 'invitation', link }, 'team')).toEqual({ + ok: false, + code: 'this-host', + }); + expect(test.calls).toEqual([]); + }); + it('refuses the adapter from a non-Owner local client', async () => { + const test = setup(false); + expect(await test.hosts.teamSignIn({ kind: 'invitation', link })).toEqual({ + ok: false, + code: 'owner-required', + }); + expect(test.calls).toEqual([]); + }); +}); diff --git a/packages/core/src/devices/relationship-enrollment.ts b/packages/core/src/devices/relationship-enrollment.ts index 0cfbe40d3b..00422f7f61 100644 --- a/packages/core/src/devices/relationship-enrollment.ts +++ b/packages/core/src/devices/relationship-enrollment.ts @@ -1,10 +1,6 @@ import { z } from 'zod'; import type { HostCarrier } from '@botharness/host-protocol/carrier'; -import { - keyBytes, - keyHex, - secureRandom, -} from '@botharness/host-client/encrypted-carrier'; +import { keyBytes, keyHex, secureRandom } from '@botharness/host-client/encrypted-carrier'; import { redeemPairing, revokePairing } from '@botharness/host-client/pairing'; import { checkRoute, @@ -29,7 +25,7 @@ import { noiseFingerprint, noisePublicKey } from '@botharness/host-protocol/nois export type RelationshipSavedHost = SavedHost & z.infer; export function parseRelationshipSavedHost(input: unknown): RelationshipSavedHost | undefined { const host = parseSavedHost(input); - if (!host) return undefined; + if (!host || host.member || host.credential.startsWith('member.')) return undefined; const parsed = pendingRelationshipEnrollmentSchema.safeParse(input); if (!parsed.success) return undefined; const pending = parsed.data.relationshipEnrollment; @@ -207,6 +203,10 @@ export async function enrollRelationshipClient(options: { }, }, }); + if (result.ok && (result.host.member || result.host.credential.startsWith('member.'))) { + await revokePairing({ host: result.host, carrier: options.carrier }); + return { ok: false, code: 'owner-required' } satisfies { ok: false; code: 'owner-required' }; + } if (result.ok && options.accountGeneration !== undefined) { try { if (options.signal?.aborted) throw new Error('cancelled'); diff --git a/packages/host-client/src/hosts.ts b/packages/host-client/src/hosts.ts index 7251a13571..7280f941a2 100644 --- a/packages/host-client/src/hosts.ts +++ b/packages/host-client/src/hosts.ts @@ -27,6 +27,16 @@ export interface SavedHost { credential: string; } +export type SavedHostIdentity = + | { kind: 'owner' } + | { kind: 'member'; humanId: string; username: string }; + +export function savedHostIdentity(host: SavedHost): SavedHostIdentity { + return host.member + ? { kind: 'member', humanId: host.member.humanId, username: host.member.username } + : { kind: 'owner' }; +} + export interface SavedHosts { hosts: SavedHost[]; current?: string; diff --git a/packages/host-client/src/team-sign-in.ts b/packages/host-client/src/team-sign-in.ts new file mode 100644 index 0000000000..1230301237 --- /dev/null +++ b/packages/host-client/src/team-sign-in.ts @@ -0,0 +1,264 @@ +import type { HostCarrier } from '@botharness/host-protocol/carrier'; +import { noiseFingerprint } from '@botharness/host-protocol/noise/xk'; +import { + parseTeamInvitation, + teamHostIdentity, + teamHttpsRoute, + teamRecord, + type TeamInvitation, + type TeamHostIdentity, + type TeamResult, + type TeamErrorCode, +} from '@botharness/host-protocol/team-invitation'; +import { keyBytes } from './encrypted-carrier'; +import type { SavedHost } from './hosts'; +import { prepareMemberIdentity, type HostMemberIdentity } from './member-identity'; +import { changeTeamDevicePassword, signInTeamDevice } from './team-client'; +import { revokePairing } from './pairing'; + +export type TeamSignInTarget = + | { kind: 'invitation'; link: string } + | { kind: 'address'; route: string; username: string }; +export type TeamSignInError = + | TeamErrorCode + | 'flow-step-invalid' + | 'flow-busy' + | 'owner-required' + | 'this-host'; +export type TeamSignInState = + | { kind: 'fingerprint'; host: TeamHostIdentity; username: string } + | { kind: 'sign-in'; host: TeamHostIdentity; username: string } + | { kind: 'password-change'; member: HostMemberIdentity } + | { kind: 'identity-confirmation'; member: HostMemberIdentity } + | { kind: 'complete'; member: HostMemberIdentity } + | { kind: 'cancelled' }; + +export interface TeamSignInFlow { + getSnapshot(): TeamSignInState; + subscribe(listener: () => void): () => void; + confirmFingerprint(fingerprint: string): TeamResult; + signIn(input: { + password: string; + deviceName: string; + }): Promise>; + changePassword(input: { + current: string; + next: string; + }): Promise>; + complete(confirmIdentitySwitch?: boolean): Promise>; + cancel(): Promise; +} + +export async function prepareTeamSignIn(options: { + target: TeamSignInTarget; + carrier: HostCarrier; + previous(hostId: string): SavedHost | undefined; + commit( + host: SavedHost, + confirmed: boolean, + signal: AbortSignal, + ): Promise>; + signal?: AbortSignal; + now?: () => number; +}): Promise> { + const now = options.now ?? Date.now; + let invitation: TeamInvitation; + if (options.target.kind === 'invitation') { + const parsed = parseTeamInvitation(options.target.link, now()); + if (!parsed.ok) return parsed; + invitation = parsed.value; + } else { + const { route, username } = options.target; + if (!teamHttpsRoute(route) || new URL(route).origin !== route) + return { ok: false, code: 'insecure-transport' }; + if (!/^[a-z0-9][a-z0-9._-]{0,63}$/u.test(username)) return { ok: false, code: 'invalid-input' }; + try { + const signal = AbortSignal.any([ + AbortSignal.timeout(8_000), + ...(options.signal ? [options.signal] : []), + ]); + const response = await options.carrier.request(`${route}/botharness-device/channel`, { + method: 'GET', + signal, + }); + if (response.status !== 200) return { ok: false, code: 'unreachable' }; + const value = teamRecord(JSON.parse(await response.text())); + const encryption = teamRecord(value['encryption']); + const host = teamHostIdentity({ + ...teamRecord(value['host']), + fingerprint: encryption['fingerprint'], + }); + if ( + !host || + typeof encryption['publicKey'] !== 'string' || + !/^[a-f0-9]{64}$/u.test(encryption['publicKey']) + ) + return { ok: false, code: 'response-invalid' }; + if (noiseFingerprint(keyBytes(encryption['publicKey'])) !== host.fingerprint) + return { ok: false, code: 'fingerprint-mismatch' }; + invitation = { + v: 1, + host, + routes: [route], + username, + expiresAt: new Date(now() + 30 * 60_000).toISOString(), + }; + } catch { + return { ok: false, code: options.signal?.aborted ? 'request-cancelled' : 'unreachable' }; + } + } + const previous = options.previous(invitation.host.id); + const pinned = + previous?.member?.fingerprint ?? + (previous?.encryption ? noiseFingerprint(keyBytes(previous.encryption.hostKey)) : undefined); + if (pinned !== undefined && pinned !== invitation.host.fingerprint) + return { ok: false, code: 'fingerprint-mismatch' }; + if (options.signal?.aborted) return { ok: false, code: 'request-cancelled' }; + const abort = new AbortController(); + const signal = options.signal ? AbortSignal.any([abort.signal, options.signal]) : abort.signal; + let state: TeamSignInState = { + kind: 'fingerprint', + host: invitation.host, + username: invitation.username, + }; + let pending: SavedHost | undefined; + let busy = false; + let committing: Promise | undefined; + let finishCommit: (() => void) | undefined; + const listeners = new Set<() => void>(); + const publish = (next: TeamSignInState) => { + state = next; + for (const listener of listeners) listener(); + }; + const refuse = (step: TeamSignInState['kind']): TeamResult | undefined => + signal.aborted + ? { ok: false, code: 'request-cancelled' } + : busy + ? { ok: false, code: 'flow-busy' } + : state.kind !== step + ? { ok: false, code: 'flow-step-invalid' } + : undefined; + const release = async (host: SavedHost) => { + try { + await revokePairing({ host, carrier: options.carrier }); + } catch {} + }; + const flow: TeamSignInFlow = { + getSnapshot: () => state, + subscribe(listener) { + listeners.add(listener); + return () => { + listeners.delete(listener); + }; + }, + confirmFingerprint(fingerprint) { + const refused = refuse('fingerprint'); + if (refused) return refused; + if (fingerprint !== invitation.host.fingerprint) + return { ok: false, code: 'fingerprint-mismatch' }; + publish({ kind: 'sign-in', host: invitation.host, username: invitation.username }); + return { ok: true, value: state }; + }, + async signIn(input) { + const refused = refuse('sign-in'); + if (refused) return refused; + busy = true; + try { + const result = await signInTeamDevice({ + ...input, + carrier: options.carrier, + invitation, + signal, + now: now(), + }); + if (!result.ok) return result; + if (signal.aborted) { + await release(result.value); + return { ok: false, code: 'request-cancelled' }; + } + pending = result.value; + if (!pending.member) { + await release(pending); + pending = undefined; + return { ok: false, code: 'response-invalid' }; + } + publish({ + kind: pending.member.mustChangePassword ? 'password-change' : 'identity-confirmation', + member: pending.member, + }); + return { ok: true, value: state }; + } finally { + busy = false; + } + }, + async changePassword(input) { + const refused = refuse('password-change'); + if (refused) return refused; + if (!pending) return { ok: false, code: 'flow-step-invalid' }; + busy = true; + try { + const result = await changeTeamDevicePassword({ + ...input, + carrier: options.carrier, + host: pending, + signal, + }); + if (!result.ok) return result; + if (signal.aborted) return { ok: false, code: 'request-cancelled' }; + pending = result.value; + if (!pending.member) return { ok: false, code: 'response-invalid' }; + publish({ kind: 'identity-confirmation', member: pending.member }); + return { ok: true, value: state }; + } finally { + busy = false; + } + }, + async complete(confirmed = false) { + const refused = refuse('identity-confirmation'); + if (refused) return refused; + if (!pending?.member || pending.member.mustChangePassword) + return { ok: false, code: 'password-change-required' }; + const existing = options.previous(pending.hostId); + const prepared = prepareMemberIdentity( + { hosts: existing ? [existing] : [] }, + pending, + confirmed, + ); + if (!prepared.ok) return prepared; + busy = true; + committing = new Promise((resolve) => { + finishCommit = resolve; + }); + try { + const result = await options.commit(pending, confirmed, signal); + if (!result.ok) return result; + const member = pending.member; + pending = undefined; + options.signal?.removeEventListener('abort', onAbort); + publish({ kind: 'complete', member }); + return result; + } catch { + return { ok: false, code: 'storage-failed' }; + } finally { + busy = false; + finishCommit?.(); + committing = undefined; + } + }, + async cancel() { + await committing; + if (state.kind === 'complete') return; + options.signal?.removeEventListener('abort', onAbort); + abort.abort(); + const host = pending; + pending = undefined; + publish({ kind: 'cancelled' }); + if (host) await release(host); + }, + }; + const onAbort = () => { + void flow.cancel(); + }; + options.signal?.addEventListener('abort', onAbort, { once: true }); + return { ok: true, value: flow }; +} diff --git a/packages/host-client/test/team-sign-in.test.ts b/packages/host-client/test/team-sign-in.test.ts new file mode 100644 index 0000000000..f53ec2335e --- /dev/null +++ b/packages/host-client/test/team-sign-in.test.ts @@ -0,0 +1,280 @@ +import { randomBytes } from 'node:crypto'; +import { describe, expect, it, vi } from 'vitest'; +import type { HostCarrier, HostRequest } from '@botharness/host-protocol/carrier'; +import { noiseFingerprint, noisePublicKey } from '@botharness/host-protocol/noise/xk'; +import { prepareTeamSignIn } from '../src/team-sign-in'; +import type { SavedHost } from '../src/hosts'; + +const publicKey = noisePublicKey(randomBytes(32)); +const fingerprint = noiseFingerprint(publicKey); +const invitation = { + v: 1, + host: { id: 'team', name: 'Team', fingerprint }, + routes: ['https://team.example'], + username: 'bob', + expiresAt: '2030-01-01T00:00:00.000Z', +}; +const link = (value = invitation) => + `deepseekbot://team?i=${Buffer.from(JSON.stringify(value)).toString('base64url')}`; +function setup(mustChangePassword = true) { + let previous: SavedHost | undefined; + const request = vi.fn(async (url: string, _input: HostRequest) => ({ + status: 200, + text: async () => + JSON.stringify( + url.endsWith('/channel') + ? { + host: invitation.host, + encryption: { publicKey: Buffer.from(publicKey).toString('hex'), fingerprint }, + } + : url.endsWith('/device-sign-in') + ? { + host: invitation.host, + deviceId: 'device', + credential: `member.${'a'.repeat(43)}`, + humanId: 'bob-id', + displayName: 'Bob', + mustChangePassword, + } + : {}, + ), + })); + const carrier: HostCarrier = { + request, + randomBytes: () => randomBytes(32), + openSocket() { + throw new Error('unexpected-socket'); + }, + }; + const commit = vi.fn(async (host: SavedHost) => { + previous = host; + return { ok: true as const, value: host }; + }); + const options = { carrier, previous: () => previous, commit }; + const prepare = async () => { + const result = await prepareTeamSignIn({ + ...options, + target: { kind: 'invitation', link: link() }, + }); + if (!result.ok) throw new Error(result.code); + return result.value; + }; + return { + prepare, + options, + request, + commit, + setPrevious(host: SavedHost) { + previous = host; + }, + }; +} + +describe('shared desktop Team sign-in flow', () => { + it('requires fingerprint confirmation, sign-in and first password change before storing a member identity', async () => { + const test = setup(); + const flow = await test.prepare(); + expect(flow.getSnapshot().kind).toBe('fingerprint'); + expect(await flow.signIn({ password: 'initial', deviceName: 'Desktop' })).toEqual({ + ok: false, + code: 'flow-step-invalid', + }); + expect(test.request).not.toHaveBeenCalled(); + expect(flow.confirmFingerprint('wrong')).toEqual({ ok: false, code: 'fingerprint-mismatch' }); + expect(flow.confirmFingerprint(fingerprint).ok).toBe(true); + expect((await flow.signIn({ password: 'initial', deviceName: 'Desktop' })).ok).toBe(true); + expect(flow.getSnapshot().kind).toBe('password-change'); + expect(await flow.complete()).toEqual({ ok: false, code: 'flow-step-invalid' }); + expect(test.commit).not.toHaveBeenCalled(); + expect( + (await flow.changePassword({ current: 'initial', next: 'new-secure-password' })).ok, + ).toBe(true); + const result = await flow.complete(); + expect(result).toMatchObject({ + ok: true, + value: { member: { humanId: 'bob-id', username: 'bob', mustChangePassword: false } }, + }); + expect(flow.getSnapshot()).toMatchObject({ kind: 'complete', member: { humanId: 'bob-id' } }); + expect(test.commit).toHaveBeenCalledTimes(1); + expect(test.request.mock.calls.filter(([url]) => url.endsWith('/channel'))).toHaveLength(1); + expect(JSON.stringify(flow.getSnapshot())).not.toContain('member.'); + }); + it('prepares address and username sign-in without sending a password during discovery', async () => { + const test = setup(false); + const result = await prepareTeamSignIn({ + ...test.options, + target: { kind: 'address', route: invitation.routes[0]!, username: 'bob' }, + }); + expect(result.ok).toBe(true); + expect(test.request.mock.calls).toHaveLength(1); + expect(test.request.mock.calls[0]?.[1].method).toBe('GET'); + if (!result.ok) return; + expect(result.value.getSnapshot()).toEqual({ + kind: 'fingerprint', + host: invitation.host, + username: 'bob', + }); + }); + it('refuses a changed pinned Host before any request', async () => { + const test = setup(); + test.setPrevious({ + hostId: 'team', + hostName: 'Team', + routes: invitation.routes, + deviceId: 'old', + credential: 'owner', + encryption: { + protocol: 'connect-noise-xk-v1', + hostKey: '01'.repeat(32), + deviceKey: '02'.repeat(32), + }, + }); + const result = await prepareTeamSignIn({ + ...test.options, + target: { kind: 'invitation', link: link() }, + }); + expect(result).toEqual({ ok: false, code: 'fingerprint-mismatch' }); + expect(test.request).not.toHaveBeenCalled(); + }); + it('checks identity replacement again immediately before commit', async () => { + const test = setup(false); + const flow = await test.prepare(); + flow.confirmFingerprint(fingerprint); + await flow.signIn({ password: 'password', deviceName: 'Desktop' }); + test.setPrevious({ + hostId: 'team', + hostName: 'Team', + routes: invitation.routes, + credential: 'owner', + deviceId: 'old', + }); + expect(await flow.complete()).toEqual({ ok: false, code: 'identity-switch-required' }); + expect(test.commit).not.toHaveBeenCalled(); + expect((await flow.complete(true)).ok).toBe(true); + }); + it('keeps a failed password change gated and retryable', async () => { + const test = setup(); + const flow = await test.prepare(); + flow.confirmFingerprint(fingerprint); + await flow.signIn({ password: 'initial', deviceName: 'Desktop' }); + test.request.mockResolvedValueOnce({ + status: 400, + text: async () => JSON.stringify({ code: 'password-weak' }), + }); + expect(await flow.changePassword({ current: 'initial', next: 'weak' })).toEqual({ + ok: false, + code: 'password-weak', + }); + expect(flow.getSnapshot().kind).toBe('password-change'); + expect(test.commit).not.toHaveBeenCalled(); + await flow.cancel(); + }); + it('revokes an uncommitted grant on cancel and cannot resume it', async () => { + const test = setup(false); + const flow = await test.prepare(); + flow.confirmFingerprint(fingerprint); + await flow.signIn({ password: 'password', deviceName: 'Desktop' }); + await flow.cancel(); + expect(flow.getSnapshot()).toEqual({ kind: 'cancelled' }); + expect(await flow.complete()).toEqual({ ok: false, code: 'request-cancelled' }); + expect(test.commit).not.toHaveBeenCalled(); + expect(test.request.mock.calls.some(([url]) => url.endsWith('/unpair'))).toBe(true); + }); + it('waits for an in-progress save before cancelling a committed identity', async () => { + const test = setup(false); + let release: (() => void) | undefined; + const waiting = new Promise((resolve) => { + release = resolve; + }); + const prepared = await prepareTeamSignIn({ + ...test.options, + target: { kind: 'invitation', link: link() }, + commit: async (host) => { + await waiting; + return { ok: true, value: host }; + }, + }); + if (!prepared.ok) throw new Error(prepared.code); + const flow = prepared.value; + flow.confirmFingerprint(fingerprint); + await flow.signIn({ password: 'password', deviceName: 'Desktop' }); + const saved = flow.complete(); + const cancelled = flow.cancel(); + release?.(); + expect((await saved).ok).toBe(true); + await cancelled; + expect(flow.getSnapshot().kind).toBe('complete'); + expect(test.request.mock.calls.some(([url]) => url.endsWith('/unpair'))).toBe(false); + }); + it('cancels through the supplied abort signal and revokes a pending grant', async () => { + const test = setup(false); + const abort = new AbortController(); + const prepared = await prepareTeamSignIn({ + ...test.options, + target: { kind: 'invitation', link: link() }, + signal: abort.signal, + }); + if (!prepared.ok) throw new Error(prepared.code); + const flow = prepared.value; + flow.confirmFingerprint(fingerprint); + await flow.signIn({ password: 'password', deviceName: 'Desktop' }); + abort.abort(); + await flow.cancel(); + expect(flow.getSnapshot().kind).toBe('cancelled'); + expect(test.commit).not.toHaveBeenCalled(); + }); + it('retains a sign-in refusal and rate-limit delay without saving a grant', async () => { + const test = setup(); + const flow = await test.prepare(); + flow.confirmFingerprint(fingerprint); + test.request.mockResolvedValueOnce({ + status: 200, + text: async () => + JSON.stringify({ + host: invitation.host, + encryption: { publicKey: Buffer.from(publicKey).toString('hex'), fingerprint }, + }), + }); + test.request.mockResolvedValueOnce({ + status: 429, + text: async () => JSON.stringify({ code: 'rate-limited', retryAfterSeconds: 30 }), + }); + expect(await flow.signIn({ password: 'bad-password', deviceName: 'Desktop' })).toEqual({ + ok: false, + code: 'rate-limited', + retryAfterSeconds: 30, + }); + expect(flow.getSnapshot().kind).toBe('sign-in'); + expect(test.commit).not.toHaveBeenCalled(); + await flow.cancel(); + }); + it('leaves an unsuccessful save retryable without repeating sign-in', async () => { + const test = setup(false); + test.commit.mockRejectedValueOnce(new Error('disk-full')); + const flow = await test.prepare(); + flow.confirmFingerprint(fingerprint); + await flow.signIn({ password: 'password', deviceName: 'Desktop' }); + expect(await flow.complete()).toEqual({ ok: false, code: 'storage-failed' }); + expect(flow.getSnapshot().kind).toBe('identity-confirmation'); + expect((await flow.complete()).ok).toBe(true); + expect(test.request.mock.calls.filter(([url]) => url.endsWith('/device-sign-in'))).toHaveLength( + 1, + ); + }); + it('rejects expired invitations and insecure manual addresses', async () => { + const test = setup(); + expect( + await prepareTeamSignIn({ + ...test.options, + target: { kind: 'invitation', link: link({ ...invitation, expiresAt: '2000-01-01' }) }, + }), + ).toEqual({ ok: false, code: 'invitation-expired' }); + expect( + await prepareTeamSignIn({ + ...test.options, + target: { kind: 'address', route: 'http://team.example', username: 'bob' }, + }), + ).toEqual({ ok: false, code: 'insecure-transport' }); + expect(test.request).not.toHaveBeenCalled(); + }); +}); From 3f220fa082712f8c926f588a7950a1547d1c6c84 Mon Sep 17 00:00:00 2001 From: DoodleBear Date: Mon, 16 Nov 2026 08:27:36 +0900 Subject: [PATCH 3/6] feat(client): sign in to a Team mode Host from desktop Pasting a Team invitation in Add Host, or choosing Sign in with a username, opens a stepper: compare the Host fingerprint, sign in with the one-time password, replace it, confirm an account switch when one is needed, then add the Host. Refusals are shown in plain words, and closing an unfinished sign-in cancels it. Issue: #4201 Co-Authored-By: Claude Opus 5.5 --- packages/client/src/client/host-tabs.tsx | 71 ++++ packages/client/src/client/locale.ts | 82 +++++ .../client/src/client/team-sign-in-dialog.tsx | 309 ++++++++++++++++++ .../client/test/team-sign-in-dialog.test.ts | 218 ++++++++++++ 4 files changed, 680 insertions(+) create mode 100644 packages/client/src/client/team-sign-in-dialog.tsx create mode 100644 packages/client/test/team-sign-in-dialog.test.ts diff --git a/packages/client/src/client/host-tabs.tsx b/packages/client/src/client/host-tabs.tsx index 945ae935cf..044be344f3 100644 --- a/packages/client/src/client/host-tabs.tsx +++ b/packages/client/src/client/host-tabs.tsx @@ -21,6 +21,8 @@ import { useThisHost, getThisHost } from './this-host.js'; import { useMountedResource } from './mounted-resource.js'; import { createConnectionControl, type ConnectionAttempt } from './connection-control.js'; import { ConnectionProgress } from './connection-progress.js'; +import { TeamSignInDialog } from './team-sign-in-dialog.js'; +import type { TeamSignInTarget } from '@botharness/host-client/team-sign-in'; export { useThisHost } from './this-host.js'; import { HostGlyph } from './host-glyph.js'; export { HostGlyph } from './host-glyph.js'; @@ -363,6 +365,9 @@ export function AddRemoteHostDialog({ const [error, setError] = useState(); const control = useRef>(); const attemptId = useRef(); + const attemptLink = useRef(''); + const [team, setTeam] = useState(); + const [manual, setManual] = useState<{ route: string; username: string }>(); const mount = useMountedResource(() => { const sources = remoteHosts(); const owner = createConnectionControl(sources, getThisHost); @@ -370,6 +375,12 @@ export function AddRemoteHostDialog({ const off = owner.subscribe(() => { if (!attemptId.current) return; const next = owner.getSnapshot(attemptId.current); + if (next?.state === 'failed' && next.code === 'team-sign-in-required') { + attemptId.current = undefined; + setAttempt(undefined); + setTeam({ kind: 'invitation', link: attemptLink.current }); + return; + } setAttempt(next); if (next?.state === 'connected' && next.hostId) { const looks = hostLooks(); @@ -418,6 +429,7 @@ export function AddRemoteHostDialog({ ); } else { attemptId.current = crypto.randomUUID(); + attemptLink.current = link.trim(); owner.execute({ action: 'start', attemptId: attemptId.current, link }, request); } } catch { @@ -425,6 +437,57 @@ export function AddRemoteHostDialog({ } }; const failed = attempt?.state === 'failed' || attempt?.state === 'cancelled'; + if (team !== undefined) + return ( +
+ onClose()} + t={t} + /> +
+ ); + if (manual !== undefined) { + const route = manual.route.trim(); + const username = manual.username.trim(); + return ( +
+ setManual(undefined)} + onClose={onClose} + onSubmit={() => setTeam({ kind: 'address', route, username })} + submitData={{ 'data-team-manual-submit': '' }} + > + setManual({ ...manual, route: value })} + initialFocus + /> + setManual({ ...manual, username: value })} + /> + +
+ ); + } return ( {t(readingImage ? 'remoteHosts.add.readingImage' : 'remoteHosts.add.image')} + ) : (
{t('connections.reading')}
diff --git a/packages/client/src/client/locale.ts b/packages/client/src/client/locale.ts index 75674a593f..4dfcc723f7 100644 --- a/packages/client/src/client/locale.ts +++ b/packages/client/src/client/locale.ts @@ -4960,6 +4960,47 @@ export const zh = { 'remoteHosts.add.link': '配对链接', 'remoteHosts.add.hint': '链接 10 分钟内有效,只能用一次。', 'remoteHosts.add.submit': '添加', + 'teamSignIn.useUsername': '用用户名登录', + 'teamSignIn.manualHint': '以成员身份登录别人的 Host。请向它的所有者索取 HTTPS 地址、你的用户名和一次性密码。', + 'teamSignIn.address': 'Host 地址', + 'teamSignIn.addressHint': 'Host 所有者给你的 HTTPS 地址。', + 'teamSignIn.username': '用户名', + 'teamSignIn.continue': '继续', + 'teamSignIn.titleGeneric': '登录 Team Host', + 'teamSignIn.title': '登录 {host}', + 'teamSignIn.as': '用户名:{username}', + 'teamSignIn.fingerprintHint': '请 Host 所有者读出这台 Host 的指纹,或与其 Team 设置中显示的指纹对照。每一组都一致时再继续。', + 'teamSignIn.password': '一次性密码', + 'teamSignIn.passwordHint': '使用 Host 所有者给你的密码。', + 'teamSignIn.signIn': '登录', + 'teamSignIn.changeHint': '继续之前,请先替换一次性密码。', + 'teamSignIn.newPassword': '新密码', + 'teamSignIn.confirmPassword': '确认新密码', + 'teamSignIn.rule': '至少 {min} 个字符。', + 'teamSignIn.changeSubmit': '保存密码', + 'teamSignIn.ready': '已登录为 {name}。', + 'teamSignIn.finish': '添加 Host', + 'teamSignIn.cancelled': '登录已取消。请重新开始。', + 'teamSignIn.switchTitle': '切换此 Host 上的账号?', + 'teamSignIn.switchBody': '此浏览器将以 {name} 的身份使用该 Host,原账号会在此浏览器上退出该 Host。', + 'teamSignIn.switchConfirm': '切换', + 'teamSignIn.error.generic': '无法登录,请重试。', + 'teamSignIn.error.invitation-invalid': '此邀请链接无效。', + 'teamSignIn.error.invitation-expired': '此邀请已过期,请索取新的邀请。', + 'teamSignIn.error.invitation-version-unsupported': '请更新 DeepSeekBot 后再使用此邀请。', + 'teamSignIn.error.credentials-invalid': '用户名或密码错误。', + 'teamSignIn.error.rate-limited': '尝试次数过多,请 {seconds} 秒后重试。', + 'teamSignIn.error.insecure-transport': '此 Host 不接受通过该地址登录,请索取它的 HTTPS 地址。', + 'teamSignIn.error.team-mode-off': '此 Host 暂不接受成员登录。', + 'teamSignIn.error.member-suspended': '你的账号已被停用,请联系 Host 所有者。', + 'teamSignIn.error.fingerprint-mismatch': '此 Host 与你拿到的信息不符,请不要登录。', + 'teamSignIn.error.password-weak': '至少使用 {min} 个字符。', + 'teamSignIn.error.password-reused': '请选择一个在此处未用过的密码。', + 'teamSignIn.error.mismatch': '两次输入的密码不一致。', + 'teamSignIn.error.unreachable': '无法连接到 Host,请检查地址和网络后重试。', + 'teamSignIn.error.storage-failed': '无法在此浏览器保存登录信息,请重试。', + 'teamSignIn.error.this-host': '这就是当前 Host,请从 Host 列表中打开它。', + 'teamSignIn.error.owner-required': '只有此 Host 的所有者可以在这里添加其他 Host。', 'remoteHosts.deviceName': '{name} 的浏览器', 'remoteHosts.offline': '{name} 现在连不上', 'remoteHosts.refused': '{name} 已移除这个浏览器,请重新添加', @@ -10980,6 +11021,47 @@ My relationship with you, established lore and topics to avoid: [fill in]. 'remoteHosts.add.link': 'Pairing link', 'remoteHosts.add.hint': 'The link works once, for 10 minutes.', 'remoteHosts.add.submit': 'Add', + 'teamSignIn.useUsername': 'Sign in with a username', + 'teamSignIn.manualHint': "Sign in as a member of someone else's Host. Ask its owner for the HTTPS address, your username and your one-time password.", + 'teamSignIn.address': 'Host address', + 'teamSignIn.addressHint': 'The HTTPS address the Host owner gave you.', + 'teamSignIn.username': 'Username', + 'teamSignIn.continue': 'Continue', + 'teamSignIn.titleGeneric': 'Sign in to a Team Host', + 'teamSignIn.title': 'Sign in to {host}', + 'teamSignIn.as': 'As {username}', + 'teamSignIn.fingerprintHint': "Ask the Host owner to read out this Host's fingerprint, or compare it with the one in their Team settings. Continue only if every group matches.", + 'teamSignIn.password': 'One-time password', + 'teamSignIn.passwordHint': 'Use the password your Host owner gave you.', + 'teamSignIn.signIn': 'Sign in', + 'teamSignIn.changeHint': 'Replace the one-time password before you continue.', + 'teamSignIn.newPassword': 'New password', + 'teamSignIn.confirmPassword': 'Confirm new password', + 'teamSignIn.rule': 'At least {min} characters.', + 'teamSignIn.changeSubmit': 'Save password', + 'teamSignIn.ready': 'Signed in as {name}.', + 'teamSignIn.finish': 'Add Host', + 'teamSignIn.cancelled': 'Sign-in was cancelled. Start again to retry.', + 'teamSignIn.switchTitle': 'Switch account on this Host?', + 'teamSignIn.switchBody': 'This browser will use the Host as {name}. The other account on this browser is signed out of it.', + 'teamSignIn.switchConfirm': 'Switch', + 'teamSignIn.error.generic': 'Could not sign in. Try again.', + 'teamSignIn.error.invitation-invalid': 'This invitation link is not valid.', + 'teamSignIn.error.invitation-expired': 'This invitation has expired. Ask for a new one.', + 'teamSignIn.error.invitation-version-unsupported': 'Update DeepSeekBot to use this invitation.', + 'teamSignIn.error.credentials-invalid': 'Wrong username or password.', + 'teamSignIn.error.rate-limited': 'Too many attempts. Try again in {seconds} s.', + 'teamSignIn.error.insecure-transport': 'This Host cannot accept sign-in over this address. Ask for its HTTPS address.', + 'teamSignIn.error.team-mode-off': 'This Host does not accept member sign-in right now.', + 'teamSignIn.error.member-suspended': 'Your account is suspended. Ask the Host owner.', + 'teamSignIn.error.fingerprint-mismatch': 'This Host does not match what you were given. Do not sign in.', + 'teamSignIn.error.password-weak': 'Use at least {min} characters.', + 'teamSignIn.error.password-reused': 'Choose a password you have not used here.', + 'teamSignIn.error.mismatch': 'Passwords do not match.', + 'teamSignIn.error.unreachable': 'Could not reach the Host. Check the address and network, then try again.', + 'teamSignIn.error.storage-failed': 'Could not save the sign-in in this browser. Try again.', + 'teamSignIn.error.this-host': 'That is this Host. Open it from the Host list instead.', + 'teamSignIn.error.owner-required': 'Only the owner of this Host can add other Hosts here.', 'remoteHosts.deviceName': 'Browser on {name}', 'remoteHosts.offline': "Can't reach {name} right now", 'remoteHosts.refused': '{name} removed this browser. Add it again.', diff --git a/packages/client/src/client/team-sign-in-dialog.tsx b/packages/client/src/client/team-sign-in-dialog.tsx new file mode 100644 index 0000000000..e1cf88e01b --- /dev/null +++ b/packages/client/src/client/team-sign-in-dialog.tsx @@ -0,0 +1,309 @@ +import { useCallback, useState, useSyncExternalStore, type ReactElement } from 'react'; +import * as stylex from '@stylexjs/stylex'; +import type { + TeamSignInError, + TeamSignInFlow, + TeamSignInState, + TeamSignInTarget, +} from '@botharness/host-client/team-sign-in'; +import { TEAM_PAGE_PASSWORD_MIN_LENGTH } from '@botharness/host-client/shared/team-sign-in-page'; + +import { FormDialog } from './ds/form-dialog.js'; +import { TextField } from './ds/field.js'; +import { Note } from './ds/note.js'; +import { color, radius, space, text } from './ds/tokens.stylex.js'; +import type { BotHarnessKey, BotHarnessTranslate } from './locale.js'; +import { useMountedResource } from './mounted-resource.js'; +import { remoteHosts } from './remote-hosts.js'; +import { getThisHost } from './this-host.js'; + +const styles = stylex.create({ + body: { display: 'flex', flexDirection: 'column', gap: space.x4, minWidth: 0 }, + host: { margin: 0, fontWeight: text.strong }, + muted: { margin: 0, color: color.muted, fontSize: text.metaSize, lineHeight: text.metaLine }, + fingerprint: { + display: 'block', + padding: space.x3, + borderRadius: radius.sm, + backgroundColor: color.well, + fontFamily: 'var(--dsw-font-mono, ui-monospace, monospace)', + overflowWrap: 'anywhere', + }, +}); + +const ERRORS: Partial> = { + 'invitation-invalid': 'teamSignIn.error.invitation-invalid', + 'invitation-expired': 'teamSignIn.error.invitation-expired', + 'invitation-version-unsupported': 'teamSignIn.error.invitation-version-unsupported', + 'credentials-invalid': 'teamSignIn.error.credentials-invalid', + 'rate-limited': 'teamSignIn.error.rate-limited', + 'insecure-transport': 'teamSignIn.error.insecure-transport', + 'team-mode-off': 'teamSignIn.error.team-mode-off', + 'member-suspended': 'teamSignIn.error.member-suspended', + 'fingerprint-mismatch': 'teamSignIn.error.fingerprint-mismatch', + 'password-weak': 'teamSignIn.error.password-weak', + 'password-reused': 'teamSignIn.error.password-reused', + mismatch: 'teamSignIn.error.mismatch', + unreachable: 'teamSignIn.error.unreachable', + 'storage-failed': 'teamSignIn.error.storage-failed', + 'this-host': 'teamSignIn.error.this-host', + 'owner-required': 'teamSignIn.error.owner-required', +}; + +export function teamSignInErrorText( + t: BotHarnessTranslate, + code: TeamSignInError | 'mismatch', + retryAfterSeconds?: number, +): string { + const key = ERRORS[code]; + if (key === undefined) return t('teamSignIn.error.generic'); + return t(key, { + seconds: String(retryAfterSeconds ?? 30), + min: String(TEAM_PAGE_PASSWORD_MIN_LENGTH), + }); +} + +const CANCELLED: TeamSignInState = { kind: 'cancelled' }; + +export function TeamSignInDialog({ + target, + onDone, + onClose, + inline = false, + footerContainer, + t, +}: { + readonly target: TeamSignInTarget; + readonly onDone: (hostId: string, hostName: string) => void; + readonly onClose: () => void; + readonly inline?: boolean; + readonly footerContainer?: HTMLElement | null | undefined; + readonly t: BotHarnessTranslate; +}): ReactElement { + const [flow, setFlow] = useState(); + const [startError, setStartError] = useState(); + const [error, setError] = useState(); + const [busy, setBusy] = useState(false); + const [password, setPassword] = useState(''); + const [next, setNext] = useState(''); + const [confirm, setConfirm] = useState(''); + const [switching, setSwitching] = useState(false); + const mount = useMountedResource(() => { + const controller = new AbortController(); + let started: TeamSignInFlow | undefined; + void remoteHosts() + .teamSignIn(target, getThisHost().id, controller.signal) + .then((result) => { + if (controller.signal.aborted) { + if (result.ok) void result.value.cancel(); + return; + } + if (result.ok) { + started = result.value; + setFlow(result.value); + } else setStartError(teamSignInErrorText(t, result.code, result.retryAfterSeconds)); + }); + return () => { + controller.abort(); + if (started !== undefined && started.getSnapshot().kind !== 'complete') void started.cancel(); + }; + }, [target]); + const subscribe = useCallback( + (listener: () => void) => flow?.subscribe(listener) ?? (() => {}), + [flow], + ); + const state = useSyncExternalStore(subscribe, () => flow?.getSnapshot() ?? CANCELLED); + const hostName = flow === undefined ? '' : stateHostName(state); + const run = async ( + action: () => Promise< + { ok: true } | { ok: false; code: TeamSignInError; retryAfterSeconds?: number } + >, + ): Promise => { + setBusy(true); + setError(undefined); + try { + const result = await action(); + if (!result.ok) { + if (result.code === 'identity-switch-required') setSwitching(true); + else setError(teamSignInErrorText(t, result.code, result.retryAfterSeconds)); + return false; + } + return true; + } finally { + setBusy(false); + } + }; + const finish = async (confirmSwitch: boolean): Promise => { + if (flow === undefined) return; + let saved: { hostId: string; hostName: string } | undefined; + const ok = await run(async () => { + const result = await flow.complete(confirmSwitch); + if (result.ok) saved = { hostId: result.value.hostId, hostName: result.value.hostName }; + return result; + }); + if (ok && saved !== undefined) onDone(saved.hostId, saved.hostName); + }; + const submit = (): void => { + if (flow === undefined || busy) return; + if (state.kind === 'fingerprint') { + const result = flow.confirmFingerprint(state.host.fingerprint); + if (!result.ok) setError(teamSignInErrorText(t, result.code)); + return; + } + if (state.kind === 'sign-in') { + void run(() => + flow.signIn({ + password, + deviceName: t('remoteHosts.deviceName', { name: getThisHost().name ?? 'Host' }), + }), + ).then((ok) => { + if (ok && flow.getSnapshot().kind !== 'password-change') setPassword(''); + }); + return; + } + if (state.kind === 'password-change') { + if (next.length < TEAM_PAGE_PASSWORD_MIN_LENGTH) { + setError(teamSignInErrorText(t, 'password-weak')); + return; + } + if (next !== confirm) { + setError(teamSignInErrorText(t, 'mismatch')); + return; + } + void run(() => flow.changePassword({ current: password, next })).then((ok) => { + if (!ok) return; + setPassword(''); + setNext(''); + setConfirm(''); + }); + return; + } + if (state.kind === 'identity-confirmation') void finish(switching); + }; + if (switching && state.kind === 'identity-confirmation') + return ( + <> + \n \n );\n const className = mainClassName === undefined ? 'bh-card-main' : 'bh-card-main ' + mainClassName;\n return (\n \n
\n {selection?.multiple === true ? (\n \n ) : onClick === undefined ? (\n
\n {body}\n
\n ) : (\n \n {body}\n \n )}\n {trailing === undefined ? null : {trailing}}\n
\n {detail === undefined ? null : (\n
\n {detail}\n
\n )}\n \n );\n}\n","export const LOCALE_NS = 'botharness-browser';\n\nexport const zh = {\n 'entry.profile.install': '安装 BotHarness Profile 控制扩展',\n 'entry.profile.instructions':\n '在 BotHarness Profile 控制扩展中输入地址和配对码,并确认允许整个 Profile。',\n 'entry.profile.forget': '解除 Profile 配对',\n 'entry.profile.disconnected': 'Profile 已配对,连接已断开',\n 'entry.profile.connected': 'Profile 已连接',\n 'entry.profile.pair': '配对 Chrome Profile',\n 'entry.profile.scope': '此 Chrome Profile 的所有普通网页标签页',\n 'settings.profile-control': '日常 Chrome · 整个 Profile',\n 'settings.daily-control': '日常 Chrome · 控制',\n 'entry.daily.install': '安装 Playwright 扩展',\n 'entry.daily.connect': '连接现有页面',\n 'entry.daily.select': '请在 Chrome 中选择一个现有标签页',\n 'entry.daily.confirm': '已连接,尚未允许操作',\n 'entry.daily.controlled': '已允许此页面的读取、输入和点击',\n 'entry.daily.allow': '允许控制此页面',\n\n 'entry.live': '已连接',\n 'entry.noScreen': '暂无画面',\n 'entry.connecting': '连接中',\n 'entry.reconnecting': '正在重新连接',\n 'entry.reconnect': '重新连接',\n 'entry.openFullscreen': '打开大屏',\n 'entry.collapseFullscreen': '收起全屏',\n 'entry.interactive.disable': '停止交互',\n 'entry.interactive.enable': '开启交互',\n 'entry.watchOnly': '观看模式',\n 'entry.stop': '停止',\n 'entry.stopping': '停止中',\n\n 'settings.localDriver': '本机驱动',\n 'settings.containerDriver': '容器驱动',\n 'settings.driver.current': '默认',\n 'settings.driver.agent-browser': 'agent-browser(试用)',\n 'settings.section': '浏览器控制',\n 'settings.target': '操作目标',\n 'settings.local': '本机 Browser',\n 'settings.container': 'Docker Browser',\n 'settings.extension': '日常浏览器',\n 'entry.borrow.none': '尚未借用标签页',\n 'entry.borrow.readOnly': '只读借用中',\n 'entry.borrow.pair': '连接浏览器扩展',\n 'entry.borrow.return': '归还标签页',\n 'entry.borrow.code': '配对码',\n 'entry.borrow.cancel': '取消配对',\n 'entry.borrow.instructions':\n '在扩展中输入此地址和配对码,再选择借出当前页面。配对码 5 分钟内有效,仅可使用一次。',\n 'entry.view.interaction': '允许 Human 操作',\n 'entry.view.inputMode.direct': '直接点按',\n 'entry.view.inputMode.trackpad': '触控板',\n 'entry.view.close': '关闭',\n 'entry.view.container': '容器浏览器',\n 'entry.view.browserTitle': '{name}的浏览器',\n 'entry.takeover.start': '接管',\n 'entry.takeover.stop': '取消接管',\n 'entry.takeover.active': '接管中',\n 'entry.label': '浏览器',\n 'entry.access.title': 'Browser Access',\n 'entry.access.on': 'Browser Access 已开启',\n 'entry.access.description': '开启后,该 Bot 的会话可以使用浏览器',\n 'entry.access.enable': '启用 Browser Access',\n 'entry.access.disable': '停用 Browser Access',\n 'entry.access.failed': '切换 Browser Access 失败',\n 'entry.access.failureHint': '授权失败',\n 'entry.profile.label': 'Profile',\n 'entry.profile.default': 'default',\n 'entry.profile.failed': '切换浏览器 profile 失败',\n 'entry.profile.choose': '选择浏览器 Profile',\n 'entry.profile.create': '创建“{name}”',\n 'entry.view.follow': '跟随 Bot',\n 'entry.view.pause': '暂停 Bot',\n 'entry.view.resume': '继续',\n 'entry.view.open': '打开 Bot 浏览器',\n 'entry.view.fullscreen': '全屏',\n 'entry.view.stop': '停止',\n 'entry.view.cleanupFailed': '浏览器清理失败。点击“停止”重试。',\n 'entry.view.opening': '正在打开…',\n 'entry.view.noFrame': '暂无画面',\n 'entry.view.noTabs': '暂无标签页',\n 'entry.view.tabs': '标签页',\n 'entry.chip.running': '运行中',\n 'entry.chip.stopped': '未运行',\n 'entry.chip.paused': '已暂停',\n 'entry.chip.disconnected': '未连接',\n 'entry.chip.connecting': '连接中',\n 'entry.chip.confirm': '待允许',\n 'entry.chip.controlled': '可操作',\n 'entry.chip.unpaired': '未配对',\n 'entry.chip.offline': '已断开',\n 'entry.chip.connected': '已连接',\n 'entry.chip.notShared': '未借用',\n 'entry.chip.readOnly': '只读',\n 'entry.provision.preparing': '正在准备下载浏览器…',\n 'entry.provision.downloading': '正在下载浏览器…{percent}%({downloaded}/{total})',\n 'entry.fail.details': '详情',\n 'entry.fail.provision-no-network.title': '浏览器下载失败——本机网络似乎不通。',\n 'entry.fail.provision-no-network.fault': '这是本机网络的问题,不是你的设置问题。',\n 'entry.fail.provision-no-network.action': '让本机连上网后,再点一次“打开”。',\n 'entry.fail.provision-no-disk-space.title': '浏览器下载失败——磁盘空间不足。',\n 'entry.fail.provision-no-disk-space.fault': '这是本机剩余空间的问题。',\n 'entry.fail.provision-no-disk-space.action': '至少腾出 500 MB 空间后,再点一次“打开”。',\n 'entry.fail.provision-no-permission.title': '浏览器下载失败——下载目录不可写。',\n 'entry.fail.provision-no-permission.fault': '这是本机目录权限的问题。',\n 'entry.fail.provision-no-permission.action':\n '请机器管理员放开浏览器目录的写权限后,再点一次“打开”。',\n 'entry.fail.provision-missing-libs.title': '这台机器缺少浏览器需要的系统库。',\n 'entry.install.missing': '需要安装 {count} 个系统包。',\n 'entry.install.manual':\n '安装需要管理员密码。请在这台机器的终端里运行下面的命令,装好后再点「打开」。',\n 'entry.install.button': '一键安装',\n 'entry.install.copy': '复制命令',\n 'entry.install.copied': '已复制',\n 'entry.install.progress': '正在安装系统库:{percent}%',\n 'entry.fail.provision-missing-libs.fault': '这是机器环境的问题,不是浏览器设置的问题。',\n 'entry.fail.provision-missing-libs.action':\n 'Ubuntu 24.04 上按“详情”里的命令安装系统库,装好后再点“打开”。',\n 'entry.fail.provision-failed.title': '浏览器下载失败。',\n 'entry.fail.provision-failed.fault': '暂时看不出具体原因。',\n 'entry.fail.provision-failed.action': '再点一次“打开”重试;多次失败请把“详情”发给机器管理员。',\n 'entry.fail.startup-missing-binary.title': '配置的浏览器文件不存在。',\n 'entry.fail.startup-missing-binary.fault': '这是插件配置里的浏览器路径问题。',\n 'entry.fail.startup-missing-binary.action':\n '修正浏览器插件配置中的 browserPath,或清空它改用自动下载。',\n 'entry.fail.startup-spawn-failed.title': '浏览器程序无法启动。',\n 'entry.fail.startup-spawn-failed.fault':\n '本机拦截或删除了浏览器文件——常见是杀毒软件,偶尔是权限问题。',\n 'entry.fail.startup-spawn-failed.action':\n '把浏览器目录加入杀毒软件白名单(或找机器管理员看权限),再点一次“打开”。',\n 'entry.fail.startup-sandbox.title': '浏览器因系统沙箱限制拒绝启动。',\n 'entry.fail.startup-sandbox.fault': '这是本机系统限制的问题。',\n 'entry.fail.startup-sandbox.action':\n 'Ubuntu 23.10 起通常是 AppArmor 限制了用户命名空间:按“详情”给这个浏览器加 AppArmor 配置后,再点一次“打开”。',\n 'entry.fail.startup-crashed.title': '浏览器在启动过程中退出了。',\n 'entry.fail.startup-crashed.fault': '这是本机浏览器的问题,不是页面问题。',\n 'entry.fail.startup-crashed.action': '再点一次“打开”重试;多次失败请把“详情”发给机器管理员。',\n 'entry.fail.startup-timeout.title': '浏览器启动超时。',\n 'entry.fail.startup-timeout.fault': '这台机器可能比较慢或负载较高。',\n 'entry.fail.startup-timeout.action': '再点一次“打开”重试;多次失败请重启机器或联系管理员。',\n 'entry.error': '浏览器操作失败',\n};\n\nexport type BrowserKey = keyof typeof zh;\n\nexport const en: Record = {\n 'entry.profile.install': 'Install BotHarness Profile Control extension',\n 'entry.profile.instructions':\n 'Enter the address and code in the BotHarness Profile Control extension and confirm Profile-wide access.',\n 'entry.profile.forget': 'Forget Profile pairing',\n 'entry.profile.disconnected': 'Profile paired · disconnected',\n 'entry.profile.connected': 'Profile connected',\n 'entry.profile.pair': 'Pair Chrome Profile',\n 'entry.profile.scope': 'All ordinary webpage tabs in this Chrome Profile',\n 'settings.profile-control': 'Daily Chrome · Entire Profile',\n 'settings.daily-control': 'Daily Chrome · Control',\n 'entry.daily.install': 'Install Playwright extension',\n 'entry.daily.connect': 'Connect existing page',\n 'entry.daily.select': 'Select one existing Chrome tab',\n 'entry.daily.confirm': 'Connected · control not granted',\n 'entry.daily.controlled': 'This document allows observe, type and click',\n 'entry.daily.allow': 'Allow control of this document',\n\n 'entry.live': 'Connected',\n 'entry.noScreen': 'No screen',\n 'entry.connecting': 'Connecting',\n 'entry.reconnecting': 'Reconnecting',\n 'entry.reconnect': 'Reconnect',\n 'entry.openFullscreen': 'Open fullscreen',\n 'entry.collapseFullscreen': 'Leave fullscreen',\n 'entry.interactive.disable': 'Disable interaction',\n 'entry.interactive.enable': 'Enable interaction',\n 'entry.watchOnly': 'Watch only',\n 'entry.stop': 'Stop',\n 'entry.stopping': 'Stopping',\n\n 'settings.localDriver': 'Local driver',\n 'settings.containerDriver': 'Container driver',\n 'settings.driver.current': 'Default',\n 'settings.driver.agent-browser': 'agent-browser (trial)',\n 'settings.section': 'Browser',\n 'settings.target': 'Browser Target',\n 'settings.local': 'Local Browser',\n 'settings.container': 'Docker Browser',\n 'settings.extension': 'Daily Browser',\n 'entry.borrow.none': 'No shared tab',\n 'entry.borrow.readOnly': 'Shared read-only',\n 'entry.borrow.pair': 'Connect browser extension',\n 'entry.borrow.return': 'Return tab',\n 'entry.borrow.code': 'Pairing code',\n 'entry.borrow.cancel': 'Cancel pairing',\n 'entry.borrow.instructions':\n 'Enter this address and code in the extension, then share the current page. The code expires in 5 minutes and can be used once.',\n 'entry.view.interaction': 'Enable Human interaction',\n 'entry.view.inputMode.direct': 'Direct tap',\n 'entry.view.inputMode.trackpad': 'Trackpad',\n 'entry.view.close': 'Close',\n 'entry.view.container': 'Container Browser',\n 'entry.view.browserTitle': \"{name}'s Browser\",\n 'entry.takeover.start': 'Take over',\n 'entry.takeover.stop': 'Release',\n 'entry.takeover.active': 'Taking over',\n 'entry.label': 'Browser',\n 'entry.access.title': 'Browser Access',\n 'entry.access.on': 'Browser Access is on',\n 'entry.access.description': \"This PersonaBot's sessions may use the browser\",\n 'entry.access.enable': 'Enable Browser Access',\n 'entry.access.disable': 'Disable Browser Access',\n 'entry.access.failed': 'Failed to switch Browser Access',\n 'entry.access.failureHint': 'Access failed',\n 'entry.profile.label': 'Profile',\n 'entry.profile.default': 'default',\n 'entry.profile.failed': 'Failed to switch the browser profile',\n 'entry.profile.choose': 'Choose browser profile',\n 'entry.profile.create': 'Create “{name}”',\n 'entry.view.follow': 'Follow the Bot',\n 'entry.view.pause': 'Pause Bot',\n 'entry.view.resume': 'Resume',\n 'entry.view.open': 'Open Bot Browser',\n 'entry.view.fullscreen': 'Fullscreen',\n 'entry.view.stop': 'Stop',\n 'entry.view.cleanupFailed': 'Browser cleanup failed. Click Stop to retry.',\n 'entry.view.opening': 'Opening…',\n 'entry.view.noFrame': 'No frame yet',\n 'entry.view.noTabs': 'No tabs yet',\n 'entry.view.tabs': 'Tabs',\n 'entry.chip.running': 'Running',\n 'entry.chip.stopped': 'Stopped',\n 'entry.chip.paused': 'Paused',\n 'entry.chip.disconnected': 'Not connected',\n 'entry.chip.connecting': 'Connecting',\n 'entry.chip.confirm': 'Needs approval',\n 'entry.chip.controlled': 'Controllable',\n 'entry.chip.unpaired': 'Not paired',\n 'entry.chip.offline': 'Disconnected',\n 'entry.chip.connected': 'Connected',\n 'entry.chip.notShared': 'Not shared',\n 'entry.chip.readOnly': 'Read-only',\n 'entry.provision.preparing': 'Preparing the browser download…',\n 'entry.provision.downloading': 'Downloading browser… {percent}% ({downloaded} / {total})',\n 'entry.fail.details': 'Details',\n 'entry.fail.provision-no-network.title':\n 'The browser download failed — this machine looks offline.',\n 'entry.fail.provision-no-network.fault':\n 'This is about the network on this machine, not your settings.',\n 'entry.fail.provision-no-network.action':\n 'Reconnect this machine to the internet, then click Open again.',\n 'entry.fail.provision-no-disk-space.title': 'The browser download failed — the disk is full.',\n 'entry.fail.provision-no-disk-space.fault': 'This is about free space on this machine.',\n 'entry.fail.provision-no-disk-space.action': 'Free at least 500 MB, then click Open again.',\n 'entry.fail.provision-no-permission.title':\n 'The browser download failed — the download folder is not writable.',\n 'entry.fail.provision-no-permission.fault': 'This is about folder permissions on this machine.',\n 'entry.fail.provision-no-permission.action':\n 'Ask the machine owner to make the browser folder writable, then click Open again.',\n 'entry.fail.provision-missing-libs.title':\n 'This machine is missing system libraries the browser needs.',\n 'entry.install.missing': '{count} system packages need to be installed.',\n 'entry.install.manual':\n 'Installing needs an administrator password. Run this command in a terminal on this machine, then click Open again.',\n 'entry.install.button': 'Install',\n 'entry.install.copy': 'Copy command',\n 'entry.install.copied': 'Copied',\n 'entry.install.progress': 'Installing system libraries: {percent}%',\n 'entry.fail.provision-missing-libs.fault':\n 'This is about the machine setup, not your browser settings.',\n 'entry.fail.provision-missing-libs.action':\n 'On Ubuntu 24.04, install them with the command in Details, then click Open again.',\n 'entry.fail.provision-failed.title': 'The browser download failed.',\n 'entry.fail.provision-failed.fault': 'The cause is unclear from here.',\n 'entry.fail.provision-failed.action':\n 'Click Open to retry; if it keeps failing, show Details to the machine owner.',\n 'entry.fail.startup-missing-binary.title': 'The configured browser file does not exist.',\n 'entry.fail.startup-missing-binary.fault':\n 'This is about the browser path in the plugin configuration.',\n 'entry.fail.startup-missing-binary.action':\n 'Fix browserPath in the browser plugin configuration, or clear it to use the automatic download.',\n 'entry.fail.startup-spawn-failed.title': 'The browser program could not be started.',\n 'entry.fail.startup-spawn-failed.fault':\n 'This machine blocked or removed the browser file — often antivirus, sometimes permissions.',\n 'entry.fail.startup-spawn-failed.action':\n 'Allow-list the browser folder in your antivirus (or ask the machine owner about permissions), then click Open again.',\n 'entry.fail.startup-sandbox.title': 'The browser refused to start because of its OS sandbox.',\n 'entry.fail.startup-sandbox.fault': 'This is about OS restrictions on this machine.',\n 'entry.fail.startup-sandbox.action':\n 'On Ubuntu 23.10 and later this is usually AppArmor restricting user namespaces: add the AppArmor profile from Details for this browser, then click Open again.',\n 'entry.fail.startup-crashed.title': 'The browser exited during startup.',\n 'entry.fail.startup-crashed.fault': 'This is about the browser on this machine, not the page.',\n 'entry.fail.startup-crashed.action':\n 'Click Open to retry; if it keeps failing, show Details to the machine owner.',\n 'entry.fail.startup-timeout.title': 'The browser took too long to start.',\n 'entry.fail.startup-timeout.fault': 'This machine may be slow or overloaded.',\n 'entry.fail.startup-timeout.action':\n 'Click Open to retry; if it keeps failing, restart the machine or ask its owner.',\n 'entry.error': 'Browser action failed',\n};\n\nexport type BrowserTranslate = (\n key: BrowserKey,\n params?: Record,\n) => string;\n","export type BrowserFailureKind =\n | 'provision-no-network'\n | 'provision-no-disk-space'\n | 'provision-no-permission'\n | 'provision-missing-libs'\n | 'provision-failed'\n | 'startup-missing-binary'\n | 'startup-spawn-failed'\n | 'startup-sandbox'\n | 'startup-crashed'\n | 'startup-timeout';\n\nexport const BROWSER_FAILURE_KINDS: readonly BrowserFailureKind[] = [\n 'provision-no-network',\n 'provision-no-disk-space',\n 'provision-no-permission',\n 'provision-missing-libs',\n 'provision-failed',\n 'startup-missing-binary',\n 'startup-spawn-failed',\n 'startup-sandbox',\n 'startup-crashed',\n 'startup-timeout',\n];\n\nexport function isBrowserFailureKind(value: unknown): value is BrowserFailureKind {\n return typeof value === 'string' && (BROWSER_FAILURE_KINDS as readonly string[]).includes(value);\n}\n\nexport interface BrowserInstallProgress {\n readonly downloadedBytes: number;\n readonly totalBytes: number;\n}\n","import type { ReactElement, ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\n\nimport { color, space, text } from './tokens.stylex.js';\n\nconst styles = stylex.create({\n note: {\n margin: 0,\n fontSize: text.metaSize,\n lineHeight: text.metaLine,\n overflowWrap: 'anywhere',\n },\n inset: { paddingBlock: space.x2, paddingInline: space.x2 },\n muted: { color: color.muted },\n subtle: { color: color.subtle },\n danger: { color: color.danger },\n success: { color: color.success },\n warning: { color: color.warning },\n});\n\nexport type NoteTone = 'muted' | 'subtle' | 'danger' | 'success' | 'warning';\n\nexport function Note({\n tone = 'muted',\n inset = false,\n children,\n}: {\n readonly tone?: NoteTone;\n readonly inset?: boolean;\n readonly children: ReactNode;\n}): ReactElement {\n return (\n \n {children}\n

\n );\n}\n","import { useState, type ReactElement, type ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { Button } from '@deepseek-ai/dsh-client-ui-primitives';\nimport { Note } from './ds/note.js';\nimport { color, radius, space, text } from './ds/tokens.stylex.js';\n\nconst styles = stylex.create({\n root: {\n display: 'grid',\n gap: space.x3,\n justifyItems: 'start',\n width: '100%',\n },\n progress: {\n display: 'grid',\n gap: space.x1,\n width: '100%',\n color: color.muted,\n fontSize: text.metaSize,\n lineHeight: text.metaLine,\n },\n bar: {\n width: '100%',\n height: '6px',\n accentColor: color.accent,\n },\n command: {\n margin: 0,\n width: '100%',\n boxSizing: 'border-box',\n paddingBlock: space.x2,\n paddingInline: space.x2,\n borderRadius: radius.sm,\n backgroundColor: color.hover,\n color: color.fg,\n fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Consolas, monospace',\n fontSize: text.metaSize,\n lineHeight: text.metaLine,\n whiteSpace: 'pre-wrap',\n overflowWrap: 'anywhere',\n },\n actions: {\n display: 'flex',\n gap: space.x2,\n flexWrap: 'wrap',\n },\n});\n\nexport type MissingPackagesAccess = 'root' | 'sudo' | 'none';\n\nexport interface MissingPackagesLabels {\n readonly missing: string;\n readonly manual: string;\n readonly install: string;\n readonly copy: string;\n readonly copied: string;\n}\n\nexport function formatProgressMiB(bytes: number): string {\n return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;\n}\n\nexport function ProgressLine({\n percent,\n label,\n}: {\n readonly percent: number;\n readonly label: string;\n}): ReactElement {\n const value = Math.max(0, Math.min(100, percent));\n return (\n
\n \n {label}\n
\n );\n}\n\nexport function MissingPackages({\n command,\n access,\n installing,\n busy = false,\n onInstall,\n labels,\n children,\n}: {\n readonly command: string;\n readonly access: MissingPackagesAccess;\n readonly installing?: { readonly percent: number; readonly label: string } | undefined;\n readonly busy?: boolean;\n readonly onInstall: () => void;\n readonly labels: MissingPackagesLabels;\n readonly children?: ReactNode;\n}): ReactElement {\n const [copied, setCopied] = useState(false);\n const copy = (): void => {\n void navigator.clipboard?.writeText(command).then(() => setCopied(true));\n };\n return (\n
\n {installing === undefined ? (\n {labels.missing}\n ) : (\n \n )}\n {access === 'none' && installing === undefined ? (\n <>\n {labels.manual}\n
{command}
\n \n ) : null}\n
\n {access !== 'none' && installing === undefined ? (\n \n ) : null}\n {access === 'none' ? (\n \n ) : null}\n {children}\n
\n
\n );\n}\n","import { useCallback, useRef, useState, type ReactElement } from 'react';\n\nimport {\n isBrowserFailureKind,\n type BrowserFailureKind,\n type BrowserInstallProgress,\n} from '../failure-kinds.js';\nimport {\n MissingPackages,\n type MissingPackagesAccess,\n} from '../../../client/src/client/missing-packages.js';\nimport type { BrowserTranslate } from './locale.js';\n\nexport interface BrowserFailure {\n readonly message: string;\n readonly code?: string;\n readonly detail?: string;\n readonly packages?: readonly string[];\n}\n\nexport class BrowserApiError extends Error {\n readonly code?: string;\n readonly detail?: string;\n readonly packages?: readonly string[];\n\n constructor(message: string, code?: string, detail?: string, packages?: readonly string[]) {\n super(message);\n this.name = 'BrowserApiError';\n if (code !== undefined) this.code = code;\n if (detail !== undefined) this.detail = detail;\n if (packages !== undefined) this.packages = packages;\n }\n}\n\nexport function readFailure(cause: unknown): BrowserFailure {\n if (cause instanceof BrowserApiError)\n return {\n message: cause.message,\n ...(cause.code === undefined ? {} : { code: cause.code }),\n ...(cause.detail === undefined ? {} : { detail: cause.detail }),\n ...(cause.packages === undefined ? {} : { packages: cause.packages }),\n };\n return { message: cause instanceof Error ? cause.message : String(cause) };\n}\n\ninterface InstallState {\n readonly access?: MissingPackagesAccess;\n readonly state?: 'installing' | 'installed' | 'failed';\n readonly percent?: number;\n readonly text?: string;\n}\n\nconst INSTALL_ENDPOINT = './api/browser/install-packages';\n\nfunction BrowserMissingLibs({\n packages,\n t,\n onRetry,\n}: {\n readonly packages: readonly string[];\n readonly t: BrowserTranslate;\n readonly onRetry?: (() => void) | undefined;\n}): ReactElement {\n const [install, setInstall] = useState({});\n const [busy, setBusy] = useState(false);\n const [error, setError] = useState();\n const retried = useRef(false);\n const read = useCallback(async (): Promise => {\n const response = await fetch(INSTALL_ENDPOINT, { cache: 'no-store' });\n const next = (await response.json()) as InstallState;\n setInstall(next);\n return next;\n }, []);\n const resource = useCallback(\n (node: HTMLDivElement | null): void => {\n if (node === null) return;\n void read().catch(() => undefined);\n },\n [read],\n );\n const poll = (): void => {\n void read()\n .then((next) => {\n if (next.state === 'installing') {\n setTimeout(poll, 1000);\n return;\n }\n if (next.state === 'installed' && !retried.current) {\n retried.current = true;\n onRetry?.();\n }\n })\n .catch((cause: unknown) => setError(String(cause)));\n };\n const start = (): void => {\n setBusy(true);\n setError(undefined);\n void fetch(INSTALL_ENDPOINT, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ authorize: true, packages }),\n })\n .then(async (response) => {\n if (!response.ok) throw new Error(((await response.json()) as { error?: string }).error);\n poll();\n })\n .catch((cause: unknown) => setError(String(cause)))\n .finally(() => setBusy(false));\n };\n const installing = install.state === 'installing';\n return (\n
\n {install.state === 'failed' && install.text !== undefined ? (\n
{install.text}
\n ) : null}\n {error === undefined ? null :
{error}
}\n \n
\n );\n}\n\nexport function BrowserFailureNotice({\n failure,\n t,\n onRetry,\n}: {\n readonly failure: BrowserFailure;\n readonly t: BrowserTranslate;\n readonly onRetry?: (() => void) | undefined;\n}): ReactElement | null {\n if (!isBrowserFailureKind(failure.code)) return null;\n const kind: BrowserFailureKind = failure.code;\n return (\n
\n
{t(`entry.fail.${kind}.title`)}
\n
{t(`entry.fail.${kind}.fault`)}
\n {kind === 'provision-missing-libs' && (failure.packages?.length ?? 0) > 0 ? (\n \n ) : (\n
{t(`entry.fail.${kind}.action`)}
\n )}\n {failure.detail === undefined || failure.detail === '' ? null : (\n
\n {t('entry.fail.details')}\n
{failure.detail}
\n
\n )}\n
\n );\n}\n\nfunction formatMiB(bytes: number): string {\n return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;\n}\n\nexport function BrowserProvisionProgress({\n progress,\n t,\n}: {\n readonly progress: BrowserInstallProgress;\n readonly t: BrowserTranslate;\n}): ReactElement {\n if (progress.totalBytes <= 0)\n return (\n
\n {t('entry.provision.preparing')}\n
\n );\n const percent = Math.max(\n 0,\n Math.min(99, Math.floor((progress.downloadedBytes / progress.totalBytes) * 100)),\n );\n return (\n
\n \n \n {t('entry.provision.downloading', {\n percent: String(percent),\n downloaded: formatMiB(progress.downloadedBytes),\n total: formatMiB(progress.totalBytes),\n })}\n \n
\n );\n}\n","import * as native from '@deepseek-ai/dsh-client-ui-primitives';\nimport { useId, useLayoutEffect, type CSSProperties, type RefObject } from 'react';\n\nconst useLegacyPosition = 'useAnchoredPosition' in native ? native.useAnchoredPosition : undefined;\n\nexport function useAnchoredPanel({\n open,\n anchorRef,\n panelRef,\n gap,\n margin,\n matchWidth = false,\n}: {\n open: boolean;\n anchorRef: RefObject;\n panelRef: RefObject;\n gap: number;\n margin: number;\n matchWidth?: boolean;\n}): CSSProperties {\n const position = useLegacyPosition?.({ open, anchorRef, panelRef, gap, margin });\n const id = useId();\n const name = `--bh-panel-${id.replace(/[^a-zA-Z0-9_-]/gu, '')}`;\n useLayoutEffect(() => {\n const anchor = anchorRef.current;\n if (useLegacyPosition !== undefined || !open || anchor === null) return;\n const previous = anchor.style.getPropertyValue('anchor-name');\n const priority = anchor.style.getPropertyPriority('anchor-name');\n anchor.style.setProperty('anchor-name', name);\n return () => anchor.style.setProperty('anchor-name', previous, priority);\n }, [open, anchorRef, name]);\n if (useLegacyPosition !== undefined) {\n return {\n ...position,\n ...(matchWidth ? { width: anchorRef.current?.getBoundingClientRect().width ?? 200 } : {}),\n visibility: position === null ? 'hidden' : undefined,\n };\n }\n return {\n position: 'fixed',\n positionAnchor: name,\n top: `max(${margin}px, var(--dsh-frame-overlay-top, ${margin}px), calc(anchor(bottom) + ${gap}px))`,\n bottom: margin,\n left: `max(${margin}px, anchor(left))`,\n right: margin,\n alignSelf: 'start',\n justifySelf: 'start',\n margin: 0,\n height: 'fit-content',\n maxWidth: `calc(100vw - ${margin * 2}px)`,\n positionTryFallbacks: 'flip-block, flip-inline, flip-block flip-inline',\n ...(matchWidth ? { width: `min(anchor-size(width), calc(100vw - ${margin * 2}px))` } : {}),\n };\n}\n","import { useAnchoredPanel } from './anchored-panel.js';\nimport { border, color, radius, space, text } from './ds/tokens.stylex.js';\nimport { useId, useRef, useState, type KeyboardEvent, type ReactElement } from 'react';\nimport { createPortal } from 'react-dom';\nimport {\n IconChevronDownOutlineRegular,\n IconPlusOutlineRegular,\n Input,\n MenuSurface,\n useDismissOnOutsidePointer,\n} from '@deepseek-ai/dsh-client-ui-primitives';\n\nexport interface ComboboxOption {\n readonly value: string;\n readonly label: string;\n readonly hint?: string | undefined;\n readonly disabled?: boolean | undefined;\n}\n\nexport const COMBOBOX_CSS = `\n.bh-combobox { position: relative; flex: 1; min-width: 0; }\n.bh-combobox-input { display: flex; padding-right: ${space.x6}; }\n.bh-combobox input { width: 100%; text-overflow: ellipsis; }\n.bh-combobox input[readonly] { cursor: pointer; }\n.bh-combobox-toggle {\n position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px;\n display: flex; align-items: center; justify-content: center;\n border: 0; border-radius: ${radius.sm}; padding: 0;\n color: var(--dsw-alias-label-secondary); background: transparent; cursor: pointer;\n}\n.bh-combobox-toggle:hover { background: var(--dsw-alias-interactive-bg-hover); }\n.bh-combobox-toggle:disabled { opacity: 0.5; cursor: default; }\n.bh-combobox-list {\n position: fixed; z-index: 1100; box-sizing: border-box;\n background: var(--dsw-alias-bg-base);\n --dsw-elevation-stroke-color: var(--dsw-alias-border-l1);\n box-shadow: var(--dsw-elevation-prominent);\n}\n.bh-combobox-scroll > button {\n display: flex; align-items: baseline; justify-content: space-between; gap: ${space.x4};\n width: 100%; min-height: 34px; padding: ${space.x2} ${space.x3};\n border: 0; border-radius: ${radius.sm}; background: transparent;\n color: var(--dsw-alias-label-primary); text-align: left; font: inherit; font-size: ${text.bodySize}; line-height: ${text.bodyLine}; cursor: pointer;\n overflow-wrap: anywhere;\n}\n.bh-combobox-scroll > button[aria-selected=\"true\"] { font-weight: ${text.strong}; }\n.bh-combobox-scroll > button:disabled { color: var(--dsw-alias-label-tertiary); cursor: default; }\n.bh-combobox-scroll > button:not(:disabled):hover, .bh-combobox-scroll > button[data-active] {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n.bh-combobox-scroll { max-height: 260px; overflow-y: auto; padding: ${space.x2}; box-sizing: border-box; }\n.bh-combobox-hint { flex: none; color: var(--dsw-alias-label-secondary); font-size: ${text.metaSize}; font-weight: ${text.regular}; }\n.bh-combobox-empty { padding: ${space.x2} ${space.x3}; color: var(--dsw-alias-label-secondary); font-size: ${text.bodySize}; }\n.bh-combobox-scroll > .bh-combobox-action { justify-content: flex-start; align-items: center; gap: ${space.x2}; border-top: ${border.hairline} solid ${color.divider}; border-radius: 0; margin-top: ${space.x2}; }\n`;\n\nexport function Combobox({\n value,\n options,\n onSelect,\n label,\n toggleLabel,\n disabled = false,\n invalid = false,\n errorId,\n placeholder,\n emptyLabel,\n fallbackValue,\n createLabel,\n searchable = true,\n className,\n action,\n}: {\n readonly value: string;\n readonly options: readonly ComboboxOption[];\n readonly onSelect: (value: string) => void;\n readonly label: string;\n readonly toggleLabel: string;\n readonly disabled?: boolean;\n readonly invalid?: boolean;\n readonly errorId?: string;\n readonly placeholder?: string;\n readonly emptyLabel?: string;\n readonly fallbackValue?: string;\n readonly createLabel?: (query: string) => string;\n readonly searchable?: boolean;\n readonly className?: string;\n readonly action?: {\n readonly label: string;\n readonly onSelect: () => void;\n readonly disabled?: boolean;\n };\n}): ReactElement {\n const root = useRef(null);\n const panel = useRef(null);\n const listId = useId();\n const actionValue = `${listId}-action`;\n const [open, setOpen] = useState(false);\n const [query, setQuery] = useState(undefined);\n const [active, setActive] = useState(undefined);\n const current = value === '' && fallbackValue !== undefined ? fallbackValue : value;\n const display = options.find((option) => option.value === current)?.label ?? current;\n const trimmed = query?.trim() ?? '';\n const needle = trimmed.toLowerCase();\n const matches: ComboboxOption[] = options.filter((option) =>\n [option.label, option.value, option.hint ?? ''].some((text) =>\n text.toLowerCase().includes(needle),\n ),\n );\n const canCreate =\n createLabel !== undefined &&\n trimmed !== '' &&\n !options.some((option) => option.value === trimmed);\n const choices: ComboboxOption[] = canCreate\n ? [...matches, { value: trimmed, label: createLabel(trimmed) }]\n : matches;\n const shown =\n action === undefined\n ? choices\n : [...choices, { value: actionValue, label: action.label, disabled: action.disabled }];\n const enabled = shown.filter((option) => option.disabled !== true);\n const hasPopup = shown.length > 0 || (choices.length === 0 && emptyLabel !== undefined);\n const highlighted = shown.findIndex(\n (option) => option.value === active && option.disabled !== true,\n );\n const position = useAnchoredPanel({\n open,\n anchorRef: root,\n panelRef: panel,\n matchWidth: true,\n gap: 4,\n margin: 12,\n });\n useDismissOnOutsidePointer(root, open, setOpen, panel);\n\n const dismiss = (): void => {\n setOpen(false);\n setQuery(undefined);\n setActive(undefined);\n };\n const select = (next: string): void => {\n dismiss();\n if (action !== undefined && next === actionValue) action.onSelect();\n else onSelect(next);\n };\n const typedChoice = (): string | undefined => {\n if (query === undefined) return current === '' ? undefined : current;\n if (trimmed === '') return fallbackValue;\n if (createLabel !== undefined) return trimmed;\n const available = matches.filter((option) => option.disabled !== true);\n const exact = available.find(\n (option) => option.value.toLowerCase() === needle || option.label.toLowerCase() === needle,\n );\n return (exact ?? available[0])?.value;\n };\n const onKeyDown = (event: KeyboardEvent): void => {\n if (event.nativeEvent.isComposing) return;\n if (event.key === 'Escape') {\n if (!open) return;\n event.preventDefault();\n event.stopPropagation();\n dismiss();\n } else if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n event.preventDefault();\n setOpen(true);\n if (enabled.length === 0) return;\n const offset = event.key === 'ArrowDown' ? 1 : -1;\n const at = enabled.findIndex((option) => option.value === active);\n const next =\n enabled[\n at < 0\n ? offset === 1\n ? 0\n : enabled.length - 1\n : (at + offset + enabled.length) % enabled.length\n ];\n setActive(next?.value);\n const index = shown.findIndex((option) => option.value === next?.value);\n document.getElementById(`${listId}-${index}`)?.scrollIntoView?.({ block: 'nearest' });\n } else if (event.key === 'Enter' && open) {\n event.preventDefault();\n const choice = shown[highlighted]?.value ?? typedChoice();\n if (choice === undefined) dismiss();\n else select(choice);\n }\n };\n\n return (\n \n = 0 ? `${listId}-${highlighted}` : undefined\n }\n aria-invalid={invalid}\n aria-describedby={invalid ? errorId : undefined}\n value={query ?? display}\n placeholder={placeholder}\n disabled={disabled}\n autoComplete=\"off\"\n readOnly={!searchable}\n data-searchable={searchable || undefined}\n onFocus={(event) => {\n if (searchable) event.currentTarget.select();\n setOpen(true);\n }}\n onClick={() => setOpen(true)}\n onChange={(event) => {\n setQuery(event.target.value);\n setActive(undefined);\n setOpen(true);\n }}\n onBlur={dismiss}\n onKeyDown={onKeyDown}\n />\n event.preventDefault()}\n onClick={() => {\n if (open) dismiss();\n else {\n root.current?.querySelector('input')?.focus();\n setOpen(true);\n }\n }}\n >\n \n \n {open && !disabled && hasPopup\n ? createPortal(\n \n
\n {choices.length === 0 && emptyLabel !== undefined ? (\n
{emptyLabel}
\n ) : null}\n {shown.map((option, index) => (\n event.preventDefault()}\n onMouseEnter={() => {\n if (option.disabled !== true) setActive(option.value);\n }}\n onClick={() => select(option.value)}\n >\n {option.value === actionValue ? : null}\n {option.label}\n {option.hint === undefined ? null : (\n {option.hint}\n )}\n \n ))}\n
\n ,\n document.body,\n )\n : null}\n \n );\n}\n","import type { ReactElement } from 'react';\n\nimport { Combobox } from '../../../client/src/client/combobox.js';\nimport type { BrowserTranslate } from './locale.js';\n\nexport function ProfileCombobox({\n value,\n profiles,\n disabled,\n invalid,\n errorId,\n onSelect,\n t,\n}: {\n readonly value: string;\n readonly profiles: readonly string[];\n readonly disabled: boolean;\n readonly invalid: boolean;\n readonly errorId: string;\n readonly onSelect: (name: string) => void;\n readonly t: BrowserTranslate;\n}): ReactElement {\n const names = [...new Set(['default', ...profiles, value === '' ? 'default' : value])];\n return (\n ({ value: name, label: name }))}\n onSelect={onSelect}\n label={t('entry.profile.label')}\n toggleLabel={t('entry.profile.choose')}\n disabled={disabled}\n invalid={invalid}\n errorId={errorId}\n fallbackValue=\"default\"\n createLabel={(name) => t('entry.profile.create', { name })}\n />\n );\n}\n","import { BUBBLE_SURFACES, readable } from './bot-name-color.js';\nimport { space } from './ds/tokens.stylex.js';\nimport { panelMaterials, validTargetId } from './appearance-panels.js';\nimport { appearanceMaterials } from './appearance-materials.js';\nimport {\n APPEARANCE_KEY,\n APPEARANCE_PRIMARY,\n Appearance,\n type AppearanceSnapshot,\n} from './appearance.js';\nimport { NATIVE_LIGHT, NATIVE_DARK } from './appearance-native-tokens.js';\nexport const APPEARANCE_CLASS = 'bh-appearance-scope';\nexport function appearanceCss(snapshot: AppearanceSnapshot): string {\n const { config, mode } = snapshot;\n const selected = config.modes[mode];\n const primary = selected.primary ?? APPEARANCE_PRIMARY[selected.preset][mode];\n const materials = appearanceMaterials(selected, mode);\n const tokens: Record = {\n ...NATIVE_LIGHT,\n ...(mode === 'dark' ? NATIVE_DARK : {}),\n };\n for (const part of ['header', 'body'] as const) {\n const material = materials[part];\n tokens[`--bh-global-${part}-fill`] =\n `color-mix(in srgb, ${material.color} ${material.opacity}%, transparent)`;\n tokens[`--bh-global-${part}-blur`] = `${material.blur}px`;\n }\n tokens['--dsw-alias-state-business-primary'] = primary;\n tokens['--dsw-alias-link'] = readable(primary, BUBBLE_SURFACES[mode].surface, 4.6);\n tokens['--dsw-alias-state-business-secondary'] =\n `color-mix(in srgb, ${primary} 45%, transparent)`;\n tokens['--dsw-alias-state-business-tertiary'] = `color-mix(in srgb, ${primary} 14%, transparent)`;\n tokens['--dsw-specific-sidebar-nav-item-active'] =\n `color-mix(in srgb, ${primary} 14%, transparent)`;\n return `.bh-root,.bh-workspace-mount[data-workspace-enabled],.${APPEARANCE_CLASS},[data-bh-appearance-owned]{color:var(--dsw-alias-label-primary);color-scheme:${mode};${Object.entries(\n tokens,\n )\n .map(([k, v]) => `${k}:${v}`)\n .join(\n ';',\n )}}:root [data-bh-appearance-owned][data-menu-material],:root .${APPEARANCE_CLASS}[data-menu-material],:root .${APPEARANCE_CLASS} [data-menu-material]{--dsw-elevation-stroke-color:var(--dsw-alias-border-${mode === 'dark' ? 'l3' : 'l4'})}${materialCss()}${panelCss(snapshot)}`;\n}\n\nexport function mountAppearance(owner: Appearance): () => void {\n const style = document.createElement('style');\n style.dataset.plugin = '@botharness/ui';\n style.dataset.pluginCss = '@botharness/ui/appearance';\n const update = () => {\n style.textContent = appearanceCss(owner.getSnapshot());\n style.dataset.bhAppearance = owner.getSnapshot().mode;\n document.documentElement.dataset.bhAppearance = owner.getSnapshot().mode;\n };\n const media = window.matchMedia('(prefers-color-scheme: dark)');\n const onStorage = (event: StorageEvent) => {\n if (event.key === APPEARANCE_KEY || event.key === null) owner.refresh();\n };\n update();\n document.head.appendChild(style);\n const off = owner.subscribe(update);\n media.addEventListener('change', owner.refresh);\n window.addEventListener('storage', onStorage);\n return () => {\n off();\n style.remove();\n delete document.documentElement.dataset.bhAppearance;\n media.removeEventListener('change', owner.refresh);\n window.removeEventListener('storage', onStorage);\n };\n}\n\nfunction materialCss(): string {\n const scope = ':root .bh-workspace-mount[data-workspace-enabled]';\n return `\n${scope} .bh-dock-theme { --dv-group-view-background-color:transparent; --dv-tabs-and-actions-container-background-color:transparent; --dv-activegroup-visiblepanel-tab-background-color:transparent; --dv-inactivegroup-visiblepanel-tab-background-color:transparent; --dv-activegroup-hiddenpanel-tab-background-color:transparent; --dv-inactivegroup-hiddenpanel-tab-background-color:transparent; }\n${scope} .bh-root, ${scope} .bh-workspace-rail { background:transparent; }\n${scope} .dv-tabs-and-actions-container, ${scope} .bh-channel-session-header { background:var(--bh-global-header-fill); backdrop-filter:blur(var(--bh-global-header-blur)); }\n${scope} [data-appearance-header] { background:var(--bh-global-header-fill); backdrop-filter:blur(var(--bh-global-header-blur)); }\n${scope} .bh-channel-subpanel-body { display:flex; flex-direction:column; flex:1; min-height:0; min-width:0; overflow:auto; }\n${scope} .bh-channel-subpanel-body > section { flex:1; min-height:0; }\n${scope} .bh-memory-commit-view { display:flex; flex-direction:column; padding:0; }\n${scope} .bh-memory-commit-header { margin:0; flex-shrink:0; }\n${scope} .bh-memory-detail-body { flex:1; padding:${space.x3} ${space.x4}; }\n${scope} [data-appearance-body], ${scope} .dv-content-container { background:var(--bh-global-body-fill); backdrop-filter:blur(var(--bh-global-body-blur)); }\n`;\n}\n\nfunction panelCss({ config, mode }: AppearanceSnapshot): string {\n return Object.keys(config.modes[mode].panels ?? {})\n .filter(validTargetId)\n .map((id) => {\n const material = panelMaterials(config.modes[mode], mode, id);\n const scope = `:root .bh-workspace-mount[data-workspace-enabled] .dv-groupview:has(> .dv-tabs-and-actions-container .dv-active-tab [data-dock-header=\"${id.slice(5)}\"])`;\n return (['header', 'body'] as const)\n .map(\n (part) =>\n `${scope} > ${part === 'header' ? '.dv-tabs-and-actions-container' : '.dv-content-container'}, :root .bh-workspace-mount[data-workspace-enabled] [data-appearance-${part}=\"${id.slice(5)}\"] { background:color-mix(in srgb, ${material[part].color} ${material[part].opacity}%, transparent); backdrop-filter:blur(${material[part].blur}px); }`,\n )\n .join('');\n })\n .join('');\n}\n","import { Modal as NativeModal, Menu as NativeMenu } from '@deepseek-ai/dsh-client-ui-primitives';\nimport type { ComponentProps, RefObject } from 'react';\nimport { APPEARANCE_CLASS } from './appearance-scope.js';\nexport function Modal(props: ComponentProps) {\n return (\n \n );\n}\ntype MenuProps = Omit, 'getAnchorRect'> & {\n anchorRef?: RefObject;\n};\n\nexport function Menu(props: MenuProps) {\n const { anchorRef } = props;\n const legacyAnchor =\n anchorRef === undefined\n ? {}\n : {\n getAnchorRect: () => anchorRef.current?.getBoundingClientRect() ?? null,\n };\n return (\n \n );\n}\n","import { Menu } from '../appearance-primitives.js';\nimport type { ComponentProps } from 'react';\nimport { createPortal } from 'react-dom';\nimport * as stylex from '@stylexjs/stylex';\n\nimport { useMountedResource } from '../mounted-resource.js';\nimport { border, space } from './tokens.stylex.js';\n\nexport interface MenuPoint {\n readonly x: number;\n readonly y: number;\n}\n\nexport function pointerMenuPosition(\n point: MenuPoint,\n width: number,\n height: number,\n viewport: { width: number; height: number; top: number },\n) {\n const margin = Number.parseFloat(space.x4);\n return {\n x: Math.max(margin, Math.min(point.x, viewport.width - width - margin)),\n y: Math.max(\n Math.max(margin, viewport.top),\n Math.min(point.y, viewport.height - height - margin),\n ),\n };\n}\n\ntype PointerMenuProps = Omit<\n ComponentProps,\n 'open' | 'portal' | 'anchorRef' | 'side' | 'align' | 'className'\n> & { point: MenuPoint; container?: Element; align?: 'start' | 'end' };\n\nexport function PointerMenu({\n point,\n container = document.body,\n align = 'start',\n ...props\n}: PointerMenuProps) {\n const mount = useMountedResource(\n (node) => {\n const menu = node.querySelector('[role=\"menu\"]');\n if (!menu) return;\n const originalMaxWidth = Number.parseFloat(getComputedStyle(menu).maxWidth);\n const originalMinWidth = Number.parseFloat(getComputedStyle(menu).minWidth);\n const place = () => {\n const scale = node.getBoundingClientRect();\n if (!scale.width || !scale.height) return;\n const cssZoom =\n 'currentCSSZoom' in node && typeof node.currentCSSZoom === 'number'\n ? node.currentCSSZoom\n : undefined;\n const scaleX = cssZoom ?? scale.width;\n const scaleY = cssZoom ?? scale.height;\n const root = document.documentElement;\n const clearance = root.hasAttribute('data-fullscreen')\n ? 0\n : Number.parseFloat(\n getComputedStyle(root).getPropertyValue('--dsh-frame-top-clearance'),\n ) || 0;\n const margin = Number.parseFloat(space.x4);\n const availableWidth = Math.max(0, innerWidth - 2 * margin) / scaleX;\n menu.style.minWidth = `${Math.min(originalMinWidth || 0, availableWidth)}px`;\n menu.style.maxWidth = `${Math.min(originalMaxWidth || Infinity, availableWidth)}px`;\n menu.style.maxHeight = `${Math.max(0, innerHeight - Math.max(margin, clearance) - margin) / scaleY}px`;\n const box = menu.getBoundingClientRect();\n const desired = pointerMenuPosition(\n { x: align === 'end' ? point.x - box.width : point.x, y: point.y },\n box.width,\n box.height,\n {\n width: innerWidth,\n height: innerHeight,\n top: clearance,\n },\n );\n const left = Number.parseFloat(node.style.left) || 0;\n const top = Number.parseFloat(node.style.top) || 0;\n node.style.left = `${left + (desired.x - box.left) / scaleX}px`;\n node.style.top = `${top + (desired.y - box.top) / scaleY}px`;\n };\n place();\n const observer =\n typeof ResizeObserver === 'undefined' ? undefined : new ResizeObserver(place);\n observer?.observe(menu);\n observer?.observe(node);\n window.addEventListener('resize', place);\n window.addEventListener('scroll', place, true);\n return () => {\n observer?.disconnect();\n window.removeEventListener('resize', place);\n window.removeEventListener('scroll', place, true);\n };\n },\n [point.x, point.y, align],\n );\n return createPortal(\n \n \n ,\n container,\n );\n}\n\nconst styles = stylex.create({\n origin: {\n position: 'fixed',\n left: 0,\n top: 0,\n width: border.hairline,\n height: border.hairline,\n zIndex: 1100,\n pointerEvents: 'none',\n },\n menu: { pointerEvents: 'auto' },\n});\n","import type { ButtonHTMLAttributes, InputHTMLAttributes, ReactElement, ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\n\nimport { actionColor, border, color, radius, size, space, text } from './tokens.stylex.js';\n\nexport const pillStyles = stylex.create({\n pill: {\n display: 'inline-flex',\n alignItems: 'center',\n gap: space.x2,\n maxWidth: '100%',\n height: size.icon,\n paddingInline: `${space.x4} ${space.x3}`,\n borderWidth: 0,\n borderRadius: radius.sm,\n backgroundColor: { default: actionColor.secondary, ':hover': actionColor.hover },\n color: color.fg,\n fontFamily: 'inherit',\n fontSize: text.bodySize,\n lineHeight: text.bodyLine,\n whiteSpace: 'nowrap',\n cursor: { default: 'pointer', ':disabled': 'default' },\n opacity: { default: 1, ':disabled': 0.5 },\n outline: { default: 'none', ':focus-visible': `${border.focus} solid ${color.accent}` },\n outlineOffset: '1px',\n },\n});\n\nexport function PillButton({\n children,\n ...rest\n}: { readonly children: ReactNode } & Omit<\n ButtonHTMLAttributes,\n 'className' | 'style' | 'type' | 'children'\n>): ReactElement {\n return (\n \n );\n}\n\nexport function PillFileButton({\n children,\n ...input\n}: { readonly children: ReactNode } & Omit<\n InputHTMLAttributes,\n 'className' | 'style' | 'type' | 'children' | 'hidden'\n>): ReactElement {\n return (\n \n );\n}\n","import { PointerMenu, type MenuPoint } from './pointer-menu.js';\nimport { useMountedResource } from '../mounted-resource.js';\nimport { useRef, useState, type ReactElement, type ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { IconChevronDownOutlineRegular } from '@deepseek-ai/dsh-client-ui-primitives';\n\nimport { pillStyles } from './pill-button.js';\nimport { color, space } from './tokens.stylex.js';\n\nconst styles = stylex.create({\n label: {\n minWidth: 0,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n },\n chevron: {\n display: 'inline-flex',\n flexShrink: 0,\n color: color.muted,\n },\n});\n\nexport interface SelectOption {\n readonly value: Value;\n readonly label: ReactNode;\n}\n\nexport interface SelectProps {\n readonly label: string;\n readonly value: Value;\n readonly options: readonly SelectOption[];\n readonly onChange: (value: Value) => void;\n readonly disabled?: boolean;\n readonly align?: 'start' | 'end';\n readonly autoFocus?: boolean;\n readonly reselect?: boolean;\n}\n\nexport function Select({\n label,\n value,\n options,\n onChange,\n disabled = false,\n align = 'end',\n autoFocus = false,\n reselect = false,\n}: SelectProps): ReactElement {\n const [open, setOpen] = useState(false);\n const [point, setPoint] = useState();\n const trigger = useRef(null);\n const active = open && !disabled;\n const mount = useMountedResource(\n (node) => {\n trigger.current = node;\n if (!active)\n return () => {\n trigger.current = null;\n };\n const place = () => {\n const rect = node.getBoundingClientRect();\n const scale = node.offsetHeight > 0 ? rect.height / node.offsetHeight : 1;\n const next = {\n x: align === 'end' ? rect.right : rect.left,\n y: rect.bottom + Number.parseFloat(space.x2) * scale,\n };\n setPoint((previous) => (previous?.x === next.x && previous.y === next.y ? previous : next));\n };\n place();\n const resize = typeof ResizeObserver === 'undefined' ? undefined : new ResizeObserver(place);\n resize?.observe(node);\n resize?.observe(document.documentElement);\n const observer = new MutationObserver(place);\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['style', 'data-fullscreen'],\n });\n window.addEventListener('resize', place);\n window.addEventListener('scroll', place, true);\n return () => {\n trigger.current = null;\n resize?.disconnect();\n observer.disconnect();\n window.removeEventListener('resize', place);\n window.removeEventListener('scroll', place, true);\n };\n },\n [active, align],\n );\n const close = () => {\n const button = trigger.current;\n const menu = document.activeElement?.closest('[data-pointer-menu]');\n setOpen(false);\n setPoint(undefined);\n queueMicrotask(() => {\n const focused = document.activeElement;\n if (\n button?.isConnected &&\n !button.disabled &&\n (focused === document.body || (focused !== null && menu?.contains(focused)))\n )\n button.focus({ preventScroll: true });\n });\n };\n const current = options.find((option) => option.value === value);\n return (\n <>\n {\n if (active) event.stopPropagation();\n }}\n onClick={() => {\n if (active) close();\n else setOpen(true);\n }}\n {...stylex.props(pillStyles.pill)}\n >\n {current?.label}\n \n \n \n \n {active && point ? (\n }\n items={options.map((option) => ({ id: option.value, label: option.label }))}\n selectedId={value}\n onSelect={(id) => {\n close();\n const next = options.find((option) => option.value === id);\n if (next !== undefined && (reselect || next.value !== value)) onChange(next.value);\n }}\n onClose={close}\n />\n ) : null}\n \n );\n}\n","import { useId, type ReactElement, type ReactNode, type Ref } from 'react';\nimport * as stylex from '@stylexjs/stylex';\n\nimport { border, color, space, text } from './tokens.stylex.js';\n\nconst NARROW = '@media (max-width: 648px)';\nconst COMPACT = '@container bh-settings (max-width: 480px)';\n\nconst styles = stylex.create({\n rows: {\n display: 'flex',\n flexDirection: 'column',\n minWidth: 0,\n },\n section: {\n display: 'flex',\n flexDirection: 'column',\n minWidth: 0,\n paddingTop: { default: space.x5, ':first-child': 0 },\n },\n sectionHead: {\n display: 'flex',\n flexDirection: 'column',\n gap: space.x1,\n paddingBottom: space.x2,\n },\n sectionTitle: {\n margin: 0,\n color: color.muted,\n fontSize: text.metaSize,\n lineHeight: text.metaLine,\n fontWeight: text.strong,\n },\n row: {\n display: 'flex',\n alignItems: { default: 'center', [NARROW]: 'stretch', [COMPACT]: 'stretch' },\n flexDirection: { default: 'row', [NARROW]: 'column', [COMPACT]: 'column' },\n gap: { default: space.x4, [NARROW]: space.x3, [COMPACT]: space.x3 },\n minWidth: 0,\n paddingBlock: space.x4,\n borderBottomWidth: border.hairline,\n borderBottomStyle: 'solid',\n borderBottomColor: { default: color.divider, ':last-child': 'transparent' },\n },\n text: {\n display: 'flex',\n flexDirection: 'column',\n gap: space.x1,\n flexGrow: 1,\n flexShrink: 1,\n flexBasis: 0,\n minWidth: 0,\n },\n title: {\n color: color.fg,\n fontSize: text.titleSize,\n lineHeight: text.titleLine,\n fontWeight: text.strong,\n overflowWrap: 'anywhere',\n },\n description: {\n color: color.muted,\n fontSize: text.metaSize,\n lineHeight: text.metaLine,\n overflowWrap: 'anywhere',\n },\n control: {\n display: 'flex',\n flexWrap: 'wrap',\n alignItems: 'center',\n justifyContent: { default: 'flex-end', [NARROW]: 'flex-start', [COMPACT]: 'flex-start' },\n gap: space.x3,\n flexShrink: 0,\n minWidth: 0,\n maxWidth: { default: '60%', [NARROW]: '100%', [COMPACT]: '100%' },\n },\n value: {\n color: color.muted,\n fontSize: text.bodySize,\n lineHeight: text.bodyLine,\n textAlign: 'end',\n overflowWrap: 'anywhere',\n },\n});\n\nexport function SettingsRows({\n children,\n rootRef,\n}: {\n readonly children: ReactNode;\n readonly rootRef?: Ref | undefined;\n}): ReactElement {\n return (\n
\n {children}\n
\n );\n}\n\nexport interface SettingsSectionProps {\n readonly title?: ReactNode;\n readonly description?: ReactNode;\n readonly children: ReactNode;\n}\n\nexport function SettingsSection({\n title,\n description,\n children,\n}: SettingsSectionProps): ReactElement {\n const id = useId();\n return (\n \n {title === undefined ? null : (\n
\n

\n {title}\n

\n {description === undefined ? null : (\n
{description}
\n )}\n
\n )}\n {children}\n \n );\n}\n\nexport interface SettingsRowProps {\n readonly title: ReactNode;\n readonly description?: ReactNode;\n readonly control?: ReactNode;\n readonly children?: ReactNode;\n readonly rootRef?: Ref | undefined;\n readonly data?: Readonly>;\n}\n\nexport function SettingsRow({\n title,\n description,\n control,\n children,\n rootRef,\n data,\n}: SettingsRowProps): ReactElement {\n const id = useId();\n const titleId = `${id}-title`;\n const descriptionId = `${id}-description`;\n return (\n \n
\n
\n {title}\n
\n {description === undefined ? null : (\n
\n {description}\n
\n )}\n {children}\n
\n {control === undefined ? null :
{control}
}\n \n );\n}\n\nexport function SettingsValue({ children }: { readonly children: ReactNode }): ReactElement {\n return {children};\n}\n","import { useMemo, useState, useSyncExternalStore, type ReactElement } from 'react';\nimport { Note } from '../../../client/src/client/ds/note.js';\nimport { Select } from '../../../client/src/client/ds/select.js';\nimport { SettingsRow, SettingsRows } from '../../../client/src/client/ds/settings-row.js';\nimport type { BrowserClientContext } from './index.js';\nimport { LOCALE_NS, type BrowserTranslate } from './locale.js';\n\ninterface TargetScope {\n getSnapshot(): {\n status: string;\n writable: boolean;\n value:\n | {\n target?: 'local' | 'container' | 'extension' | 'daily-control' | 'profile-control';\n localDriver?: 'current' | 'agent-browser';\n containerDriver?: 'current' | 'agent-browser';\n }\n | undefined;\n };\n subscribe(listener: () => void): () => void;\n set(field: string, value: unknown): Promise;\n}\n\nfunction ConfigChoice({\n scope,\n field,\n value,\n writable,\n title,\n items,\n}: {\n scope: TargetScope;\n field: 'target' | 'localDriver' | 'containerDriver';\n value: string;\n writable: boolean;\n title: string;\n items: { id: string; label: string }[];\n}): ReactElement {\n const [saving, setSaving] = useState(false);\n const [error, setError] = useState();\n return (\n <>\n ({ value: item.id, label: item.label }))}\n disabled={!writable || saving}\n onChange={(id) => {\n setSaving(true);\n setError(undefined);\n void scope\n .set(field, id)\n .then(() => {\n if (scope.getSnapshot().value?.[field] !== id)\n throw new Error('Browser setting was not saved');\n })\n .catch((cause: unknown) => setError(String(cause)))\n .finally(() => setSaving(false));\n }}\n />\n }\n />\n {error === undefined ? null : {error}}\n \n );\n}\n\nexport function BrowserTargetSettings({\n scope,\n t,\n}: {\n scope: TargetScope;\n t: BrowserTranslate;\n}): ReactElement {\n const store = useMemo(\n () => ({\n subscribe: (listener: () => void) => scope.subscribe(listener),\n getSnapshot: () => scope.getSnapshot(),\n }),\n [scope],\n );\n const snapshot = useSyncExternalStore(store.subscribe, store.getSnapshot);\n const target = snapshot.value?.target ?? 'local';\n return (\n \n ({ id, label: t(`settings.${id}`) }))}\n />\n {target !== 'local' && target !== 'container' ? null : (\n ({\n id,\n label: t(`settings.driver.${id}`),\n }))}\n />\n )}\n \n );\n}\n\nexport function registerBrowserSettings(ctx: BrowserClientContext, t: BrowserTranslate): void {\n ctx.inject(['configForms', 'slots'], (settingsCtx) => {\n const native = settingsCtx as unknown as {\n configForms: { get(namespace: string): TargetScope };\n slots: {\n inject(name: string, callback: () => unknown): () => void;\n register(\n options: {\n name: string;\n id: string;\n order: number;\n label: () => string;\n locale: string;\n inject: () => { scope: TargetScope; t: BrowserTranslate };\n },\n component: typeof BrowserTargetSettings,\n ): () => void;\n };\n };\n const scope = native.configForms.get('botharness-browser');\n return native.slots.inject('botharness.settings.section', () =>\n native.slots.register(\n {\n name: 'botharness.settings.section',\n id: 'browser',\n order: 32,\n label: () => t('settings.section'),\n locale: LOCALE_NS,\n inject: () => ({ scope, t }),\n },\n BrowserTargetSettings,\n ),\n );\n });\n}\n","import { useCallback, useRef, useState, type ReactElement } from 'react';\nimport { Button, Input, Tag } from '@deepseek-ai/dsh-client-ui-primitives';\nimport { SidebarCardList, SidebarCardRow } from '../../../client/src/client/sidebar-card.js';\nimport type { BrowserTranslate } from './locale.js';\n\nimport type { ProfileView } from '../profile-control.js';\n\nexport function ProfileBrowserControl({\n slug,\n view,\n paused,\n enabled,\n t,\n refresh,\n}: {\n readonly slug: string | undefined;\n readonly view: ProfileView | undefined;\n readonly paused: boolean;\n readonly enabled: boolean;\n readonly t: BrowserTranslate;\n readonly refresh: () => void;\n}): ReactElement {\n const [pair, setPair] = useState<{ code: string; expiresAt: number } | undefined>();\n const [busy, setBusy] = useState(false);\n const [error, setError] = useState();\n const active = useRef(false);\n const sequence = useRef(0);\n const resource = useCallback((node: HTMLDivElement | null): void => {\n active.current = node !== null;\n if (node === null) sequence.current += 1;\n }, []);\n const invoke = (action: 'pair' | 'forget' | 'pause'): void => {\n if (slug === undefined || busy) return;\n const request = ++sequence.current;\n setBusy(true);\n setError(undefined);\n setPair(undefined);\n void fetch(action === 'pause' ? './api/browser/takeover' : `./api/browser/profile/${action}`, {\n method: 'POST',\n cache: 'no-store',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ slug, ...(action === 'pause' ? { active: !paused } : {}) }),\n })\n .then(async (response) => {\n const body = (await response.json()) as {\n ok: boolean;\n error?: string;\n code?: string;\n expiresAt?: number;\n };\n if (!response.ok || !body.ok) throw new Error(body.error ?? t('entry.error'));\n if (!active.current || sequence.current !== request) return;\n if (action === 'pair' && body.code !== undefined && body.expiresAt !== undefined)\n setPair({ code: body.code, expiresAt: body.expiresAt });\n })\n .catch((cause: unknown) => {\n if (active.current && sequence.current === request)\n setError(cause instanceof Error ? cause.message : t('entry.error'));\n })\n .finally(() => {\n if (active.current && sequence.current === request) {\n setBusy(false);\n refresh();\n }\n });\n };\n return (\n
\n \n \n {view?.paired !== true ? (\n {t('entry.chip.unpaired')}\n ) : view.connected ? (\n {t('entry.chip.connected')}\n ) : (\n {t('entry.chip.offline')}\n )}\n {paused ? {t('entry.chip.paused')} : null}\n \n }\n meta={\n <>\n {t('entry.profile.scope')}\n \n {view?.paired\n ? t(view.connected ? 'entry.profile.connected' : 'entry.profile.disconnected')\n : t('entry.view.noTabs')}\n {view?.connected ? ` · ${view.tabs}` : ''}\n \n \n }\n detail={\n
\n \n {t('entry.profile.install')}\n \n
\n invoke(view?.paired ? 'forget' : 'pair')}\n >\n {t(view?.paired ? 'entry.profile.forget' : 'entry.profile.pair')}\n \n {view?.connected ? (\n invoke('pause')}\n >\n {t(paused ? 'entry.view.resume' : 'entry.view.pause')}\n \n ) : null}\n
\n {view?.paired || pair === undefined ? null : (\n <>\n {t('entry.profile.instructions')}\n \n {location.origin}\n \n )}\n
\n }\n />\n
\n {error === undefined ? null : (\n
\n {error}\n
\n )}\n
\n );\n}\n","import { useCallback, useRef, useState, type ReactElement } from 'react';\nimport { Button, Tag } from '@deepseek-ai/dsh-client-ui-primitives';\nimport { SidebarCardList, SidebarCardRow } from '../../../client/src/client/sidebar-card.js';\nimport type { DailyView } from '../daily.js';\nimport type { BrowserTranslate } from './locale.js';\n\nexport function DailyBrowserControl({\n slug,\n view,\n enabled,\n paused,\n t,\n refresh,\n}: {\n readonly slug: string | undefined;\n readonly view: DailyView | null;\n readonly enabled: boolean;\n readonly paused: boolean;\n readonly t: BrowserTranslate;\n readonly refresh: () => void;\n}): ReactElement {\n const [busy, setBusy] = useState(false);\n const [error, setError] = useState();\n const mounted = useRef(false);\n const resource = useCallback((node: HTMLDivElement | null): void => {\n mounted.current = node !== null;\n }, []);\n const invoke = (action: 'connect' | 'grant' | 'return' | 'pause'): void => {\n if (busy || slug === undefined) return;\n setBusy(true);\n setError(undefined);\n void fetch(action === 'pause' ? './api/browser/takeover' : `./api/browser/daily/${action}`, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ slug, ...(action === 'pause' ? { active: !paused } : {}) }),\n })\n .then(async (response) => {\n const body = (await response.json()) as { ok: boolean; error?: string };\n if (!response.ok || !body.ok) throw new Error(body.error ?? t('entry.error'));\n })\n .catch((cause: unknown) => {\n if (mounted.current) setError(cause instanceof Error ? cause.message : t('entry.error'));\n })\n .finally(() => {\n if (mounted.current) {\n setBusy(false);\n refresh();\n }\n });\n };\n return (\n
\n \n \n {view === null || view.state === 'error' ? (\n {t('entry.chip.disconnected')}\n ) : view.state === 'connecting' ? (\n {t('entry.chip.connecting')}\n ) : view.state === 'confirm' ? (\n {t('entry.chip.confirm')}\n ) : (\n {t('entry.chip.controlled')}\n )}\n {paused && view?.state === 'controlled' ? (\n {t('entry.chip.paused')}\n ) : null}\n \n }\n meta={\n view === null || view.state === 'error' ? undefined : (\n \n {t(\n view.state === 'connecting'\n ? 'entry.daily.select'\n : view.state === 'confirm'\n ? 'entry.daily.confirm'\n : 'entry.daily.controlled',\n )}\n \n )\n }\n detail={\n
\n {view === null || view.state === 'error' || view.url === '' ? null : (\n <>\n {view.title || view.url}\n {view.url}\n \n )}\n \n {t('entry.daily.install')}\n \n
\n {view === null || view.state === 'error' ? (\n invoke('connect')}\n >\n {t('entry.daily.connect')}\n \n ) : (\n <>\n {view.state === 'confirm' ? (\n invoke('grant')}\n >\n {t('entry.daily.allow')}\n \n ) : null}\n {view.state === 'controlled' ? (\n invoke('pause')}\n >\n {t(paused ? 'entry.view.resume' : 'entry.view.pause')}\n \n ) : null}\n invoke('return')}\n >\n {t(\n view.state === 'connecting' ? 'entry.borrow.cancel' : 'entry.borrow.return',\n )}\n \n \n )}\n
\n
\n }\n />\n
\n {view?.error === undefined ? null : (\n
\n {view.error}\n
\n )}\n {error === undefined ? null : (\n
\n {error}\n
\n )}\n
\n );\n}\n","import { useCallback, useRef, useState, type ReactElement } from 'react';\nimport { Button, Input, Tag } from '@deepseek-ai/dsh-client-ui-primitives';\nimport { SidebarCardList, SidebarCardRow } from '../../../client/src/client/sidebar-card.js';\nimport type { BrowserTranslate } from './locale.js';\n\nexport interface BorrowedTabView {\n readonly title: string;\n readonly url: string;\n readonly expiresAt: number;\n}\n\nexport function BorrowedBrowser({\n slug,\n tab,\n enabled,\n t,\n refresh,\n}: {\n readonly slug: string | undefined;\n readonly tab: BorrowedTabView | null | undefined;\n readonly enabled: boolean;\n readonly t: BrowserTranslate;\n readonly refresh: () => void;\n}): ReactElement {\n const [pair, setPair] = useState<{ code: string; expiresAt: number } | undefined>();\n const [busy, setBusy] = useState(false);\n const [error, setError] = useState();\n const active = useRef(false);\n const sequence = useRef(0);\n const resource = useCallback((node: HTMLDivElement | null): void => {\n active.current = node !== null;\n if (node === null) sequence.current += 1;\n }, []);\n const invoke = (action: 'pair' | 'return'): void => {\n if (slug === undefined || busy) return;\n const request = ++sequence.current;\n setBusy(true);\n setError(undefined);\n setPair(undefined);\n void fetch(`./api/browser/borrow/${action}`, {\n method: 'POST',\n cache: 'no-store',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ slug }),\n })\n .then(async (response) => {\n const body = (await response.json()) as {\n ok: boolean;\n error?: string;\n code?: string;\n expiresAt?: number;\n };\n if (!response.ok || !body.ok) throw new Error(body.error ?? t('entry.error'));\n if (!active.current || sequence.current !== request) return;\n if (action === 'pair' && body.code !== undefined && body.expiresAt !== undefined)\n setPair({ code: body.code, expiresAt: body.expiresAt });\n })\n .catch((cause: unknown) => {\n if (active.current && sequence.current === request)\n setError(cause instanceof Error ? cause.message : t('entry.error'));\n })\n .finally(() => {\n if (active.current && sequence.current === request) {\n setBusy(false);\n refresh();\n }\n });\n };\n return (\n
\n \n {t('entry.chip.notShared')}\n ) : (\n {t('entry.chip.readOnly')}\n )\n }\n meta={{t(tab == null ? 'entry.borrow.none' : 'entry.borrow.readOnly')}}\n detail={\n
\n {tab == null ? null : (\n <>\n {tab.title || tab.url}\n {tab.url}\n \n )}\n invoke(tab == null ? 'pair' : 'return')}\n >\n {t(tab == null ? 'entry.borrow.pair' : 'entry.borrow.return')}\n \n {tab != null || pair === undefined ? null : (\n <>\n {t('entry.borrow.instructions')}\n \n {location.origin}\n {\n sequence.current += 1;\n setPair(undefined);\n invoke('return');\n }}\n >\n {t('entry.borrow.cancel')}\n \n \n )}\n
\n }\n />\n
\n {error === undefined ? null : (\n
\n {error}\n
\n )}\n
\n );\n}\n","export const STYLEX_CSS: string = '@bh-stylex-css';\n","import { border, color, radius, space, text } from '../../../client/src/client/ds/tokens.stylex.js';\nimport { COMBOBOX_CSS } from '../../../client/src/client/combobox.js';\nimport { STYLEX_CSS } from '../../../client/src/client/ds/stylex-css.js';\n\nexport const styles =\n COMBOBOX_CSS +\n `\n.bh-browser-access-control { position: relative; display: flex; align-items: center; }\n.bh-browser-borrow { display: grid; gap: ${space.x3}; font-size: ${text.metaSize}; }\n.bh-browser-borrow-title, .bh-browser-daily-install { color: var(--dsw-alias-label-primary); text-underline-offset: 3px; }\n.bh-browser-borrow-url { overflow-wrap: anywhere; }\n.bh-browser-borrow-url { color: var(--dsw-alias-label-secondary); }\n.bh-browser-access-power {\n display: flex; align-items: center; justify-content: center; width: 28px; height: 28px;\n padding: 0; border: 0; border-radius: ${radius.md}; background: transparent;\n color: var(--dsw-alias-label-secondary); cursor: pointer;\n}\n.bh-browser-access-power:hover { background: var(--dsw-alias-interactive-bg-hover); }\n.bh-browser-access-power[aria-pressed='true'] { color: var(--dsw-alias-state-business-primary); background: var(--dsw-alias-interactive-bg-hover); }\n.bh-browser-access-power:focus-visible { outline: ${border.focus} solid var(--dsw-alias-state-business-primary); outline-offset: 2px; }\n.bh-browser-access-power:disabled { opacity: 0.5; cursor: default; }\n.bh-browser-access-power.bh-access-failed { color: var(--dsw-alias-state-error-primary); }\n.bh-browser-access-error { order: -1; padding: 0 ${space.x2}; color: var(--dsw-alias-state-error-primary); font-size: ${text.metaSize}; line-height: ${text.metaLine}; white-space: nowrap; }\n\n.bh-browser-local { display: grid; gap: ${space.x3}; font-size: ${text.metaSize}; }\n.bh-browser-card-detail { display: grid; gap: ${space.x3}; justify-items: start; font-size: ${text.metaSize}; }\n.bh-browser-card-field { display: flex; align-items: center; justify-content: space-between; gap: ${space.x3}; width: 100%; color: var(--dsw-alias-label-secondary); }\n.bh-browser-card-field > span:first-child { flex: none; }\n.bh-browser-cards .bh-card-meta [role=\"status\"] { color: inherit; }\n.bh-browser-note { color: var(--dsw-alias-label-secondary); }\n.bh-browser-frame { display: block; width: 100%; border: ${border.hairline} solid ${color.divider}; border-radius: ${radius.md}; }\n.bh-browser-actions { display: flex; flex-wrap: wrap; gap: ${space.x3}; }\n.bh-browser-tab[aria-pressed=\"true\"] { background: var(--dsw-alias-interactive-bg-hover); }\n.bh-browser-tab[aria-current=\"true\"] .bh-browser-tab-title { font-weight: ${text.strong}; }\n.bh-browser-tab .bh-browser-tab-url { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.bh-browser-tabs .bh-card-main { padding: ${space.x3} ${space.x3}; }\n.bh-browser-error { color: var(--dsw-alias-state-error-primary); overflow-wrap: anywhere; }\n.bh-viewer-btn-content { display: inline-flex; align-items: center; gap: ${space.x2}; }\n@media (max-width: 560px) {\n [data-bh-viewer-btn-label] { display: none; }\n}\n.bh-browser-progress { display: grid; gap: ${space.x2}; color: var(--dsw-alias-label-secondary); }\n.bh-browser-progress-bar { width: 100%; height: 6px; accent-color: var(--dsw-alias-state-business-primary); }\n.bh-browser-failure { display: grid; gap: ${space.x2}; overflow-wrap: anywhere; }\n.bh-browser-failure-title { color: var(--dsw-alias-label-primary); font-weight: ${text.strong}; }\n.bh-browser-failure-fault, .bh-browser-failure-action { color: var(--dsw-alias-label-secondary); }\n.bh-browser-failure-details { color: var(--dsw-alias-label-secondary); }\n.bh-browser-failure-details pre { overflow-x: auto; white-space: pre-wrap; font-size: ${text.metaSize}; }\n` +\n STYLEX_CSS;\n","/**\n * Vendored Access Power glyph from lucide-react@1.46.0 (ISC, ADR-0032).\n *\n * Source: the lucide `dist/esm/icons/power.mjs` glyph data. Vendored at the\n * stock 2-unit stroke without adding a `lucide-react` runtime dependency.\n *\n * ISC License\n *\n * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT).\n * All other copyright (c) for Lucide are held by Lucide Contributors 2022.\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\nimport type { ReactElement } from 'react';\nexport function AccessPowerIcon(): ReactElement {\n return (\n \n \n \n \n );\n}\n","import type { ReactElement } from 'react';\n\nfunction baseProps(size: number): {\n width: number;\n height: number;\n viewBox: string;\n fill: string;\n stroke: string;\n strokeWidth: number;\n strokeLinecap: 'round';\n strokeLinejoin: 'round';\n 'aria-hidden': true;\n} {\n return {\n width: size,\n height: size,\n viewBox: '0 0 24 24',\n fill: 'none',\n stroke: 'currentColor',\n strokeWidth: 2,\n strokeLinecap: 'round',\n strokeLinejoin: 'round',\n 'aria-hidden': true,\n };\n}\n\nexport function TrackpadIcon({ size = 14 }: { readonly size?: number }): ReactElement {\n return (\n \n \n \n \n );\n}\n\nexport function TakeoverIcon({ size = 14 }: { readonly size?: number }): ReactElement {\n return (\n \n \n \n \n \n );\n}\n","import { PanelEmptyState } from '../../../client/src/client/ds/empty-state.js';\nimport { RemoteViewer } from '../../../client/src/client/remote-viewer/index.js';\nimport type { ViewerTranslate } from '../../../client/src/client/remote-viewer/locale.js';\nimport {\n useId,\n useCallback,\n useRef,\n useState,\n useSyncExternalStore,\n type ComponentType,\n type ReactElement,\n} from 'react';\nimport {\n Button,\n IconFullscreenOutlineRegular,\n Switch,\n Tag,\n} from '@deepseek-ai/dsh-client-ui-primitives';\nimport { Tooltip } from '../../../client/src/client/ds/tooltip.js';\nimport { ChannelSidebarIcon } from '../../../client/src/client/channel-sidebar-icon.js';\nimport { useMountedResource } from '../../../client/src/client/mounted-resource.js';\nimport { recordViewerOpen } from '../../../client/src/client/telemetry-surface.js';\nimport { SidebarCardList, SidebarCardRow } from '../../../client/src/client/sidebar-card.js';\nimport type {} from '@deepseek-ai/dsh-client-ui-slots';\n\nimport { LOCALE_NS, en, zh, type BrowserTranslate } from './locale.js';\nimport {\n BrowserApiError,\n BrowserFailureNotice,\n BrowserProvisionProgress,\n readFailure,\n type BrowserFailure,\n} from './browser-failure.js';\nimport { isBrowserFailureKind } from '../failure-kinds.js';\nimport { ProfileCombobox } from './profile-combobox.js';\nimport { registerBrowserSettings } from './settings.js';\nimport { ProfileBrowserControl } from './profile-browser.js';\nimport type { ProfileView } from '../profile-control.js';\nimport { DailyBrowserControl } from './daily-browser.js';\nimport type { DailyView } from '../daily.js';\nimport { BorrowedBrowser, type BorrowedTabView } from './borrowed-browser.js';\nimport { styles } from './styles.js';\n\nconst ENTRY_ID = 'botharness-browser';\nconst OBSERVATION_ENDPOINT = './api/browser/observation';\nconst TAKEOVER_ENDPOINT = './api/browser/takeover';\nconst OPEN_ENDPOINT = './api/browser/open';\nconst STOP_ENDPOINT = './api/browser/stop';\nconst baseRelative = (path: string | null | undefined): string | undefined =>\n path === null || path === undefined ? undefined : path.startsWith('/') ? `.${path}` : path;\n\nimport { AccessPowerIcon } from './access-power-icon.js';\nimport { TakeoverIcon, TrackpadIcon } from './viewer-icons.js';\n\nexport const name = 'botharness-browser-client';\n\nexport const inject = ['channelSidebar', 'connection', 'locale'];\n\nexport interface BrowserClientContext {\n readonly locale: {\n bind(namespace: string): BrowserTranslate;\n register(namespace: string, dictionaries: { zh: unknown; en: unknown }): () => void;\n };\n inject(names: readonly string[], callback: (ctx: BrowserClientContext) => void): void;\n effect(callback: () => () => void, name: string): void;\n}\n\ninterface ChannelSidebarEntryProps {\n readonly botSlug?: string;\n readonly t: BrowserTranslate;\n readonly expanded?: boolean;\n readonly setExpanded?: (expanded: boolean) => void;\n readonly setExpandable?: (expandable: boolean) => void;\n}\n\ninterface ChannelSidebarRegistryLike {\n register(entry: {\n readonly id: string;\n readonly label: string;\n readonly icon?: string;\n readonly order: number;\n readonly scope: 'channel' | 'personabot';\n readonly component: ComponentType;\n readonly headerAction?: ComponentType;\n readonly badge?: ComponentType;\n readonly tab?: string;\n }): () => void;\n}\n\ninterface ConnectionRpcLike {\n call(\n path: string,\n method: string,\n options?: { args?: unknown },\n ): Promise<{ ok: boolean; value?: unknown; error?: { message?: string } }>;\n}\n\nlet connectionRpc: ConnectionRpcLike | undefined;\n\ninterface BotInfoView {\n readonly displayName: string | undefined;\n readonly browserAccess: boolean | undefined;\n readonly browserProfile: string | undefined;\n readonly profiles: readonly string[];\n}\n\ninterface BrowserTabView {\n readonly targetId: string;\n readonly url: string;\n readonly title: string;\n readonly current: boolean;\n}\n\ninterface BrowserObservation {\n readonly target?: 'local' | 'container' | 'extension' | 'daily-control' | 'profile-control';\n readonly daily?: DailyView | null;\n readonly profile?: ProfileView;\n readonly borrowed?: BorrowedTabView | null;\n readonly viewerUrl?: string | null;\n readonly cleanupRequired?: boolean;\n readonly running: boolean;\n readonly frame: string | null;\n readonly focused: string | null;\n readonly takeover: boolean;\n readonly handoffPending?: boolean;\n readonly provisioning?: { downloadedBytes: number; totalBytes: number } | null;\n readonly tabs: readonly BrowserTabView[];\n readonly profiles?: readonly string[];\n}\n\nasync function requestJson(url: string, init?: RequestInit): Promise {\n const response = await fetch(url, { cache: 'no-store', ...init });\n const body = (await response.json()) as T & {\n ok?: boolean;\n error?: string;\n code?: string;\n detail?: string;\n packages?: string[];\n };\n if (!response.ok || body.ok === false) {\n throw new BrowserApiError(\n body.error ?? `HTTP ${String(response.status)}`,\n body.code,\n body.detail,\n body.packages,\n );\n }\n return body;\n}\n\ninterface ReadableStore {\n subscribe(listener: () => void): () => void;\n getSnapshot(): T;\n}\n\ntype BotInfoStore = ReadableStore & {\n refresh(): void;\n setAccess(enabled: boolean): void;\n};\n\nconst botInfoStores = new Map();\n\nfunction botInfoStore(botSlug: string | undefined): BotInfoStore {\n const key = botSlug ?? '';\n const existing = botInfoStores.get(key);\n if (existing !== undefined) return existing;\n const created = createBotInfoStore(botSlug);\n botInfoStores.set(key, created);\n return created;\n}\n\nfunction createBotInfoStore(botSlug: string | undefined): BotInfoStore {\n let info: BotInfoView = {\n displayName: undefined,\n browserAccess: undefined,\n browserProfile: undefined,\n profiles: [],\n };\n const listeners = new Set<() => void>();\n let loadedAt = Number.NEGATIVE_INFINITY;\n const load = (): void => {\n const rpc = connectionRpc;\n if (rpc === undefined || botSlug === undefined) return;\n void rpc\n .call('/api', 'botharness/list', { args: {} })\n .then((result) => {\n if (!result.ok) return;\n const value = result.value as {\n bots?: readonly {\n slug?: unknown;\n displayName?: unknown;\n browserAccess?: unknown;\n browserProfile?: unknown;\n }[];\n };\n const bots = value.bots ?? [];\n const match = bots.find((bot) => bot.slug === botSlug);\n if (match === undefined) return;\n const profiles = [\n ...new Set(\n bots\n .map((bot) => (typeof bot.browserProfile === 'string' ? bot.browserProfile : ''))\n .filter((name) => name !== ''),\n ),\n ].sort();\n info = {\n displayName:\n typeof match.displayName === 'string' && match.displayName.length > 0\n ? match.displayName\n : undefined,\n browserAccess: match.browserAccess === true,\n browserProfile:\n typeof match.browserProfile === 'string' && match.browserProfile !== ''\n ? match.browserProfile\n : undefined,\n profiles,\n };\n for (const listener of listeners) listener();\n })\n .catch(() => undefined);\n };\n return {\n setAccess(enabled) {\n info = { ...info, browserAccess: enabled };\n for (const listener of listeners) listener();\n },\n subscribe(listener) {\n if (listeners.size === 0 && Date.now() - loadedAt > 5000) {\n loadedAt = Date.now();\n load();\n }\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n getSnapshot: () => info,\n refresh: load,\n };\n}\n\ninterface ObservationStore {\n subscribe(listener: () => void): () => void;\n getSnapshot(): BrowserObservation | undefined;\n setTab(targetId: string | undefined): void;\n refresh(): void;\n confirmTakeover(active: boolean): void;\n}\n\nfunction observationUrl(botSlug: string | undefined, tabId: string | undefined): string {\n const base = `${OBSERVATION_ENDPOINT}?slug=${encodeURIComponent(botSlug ?? '')}`;\n return tabId === undefined || tabId === '' ? base : `${base}&tab=${encodeURIComponent(tabId)}`;\n}\n\nfunction createObservationStore(botSlug: string | undefined): ObservationStore {\n let value: BrowserObservation | undefined;\n let tab: string | undefined;\n let timer: ReturnType | undefined;\n let refreshing = false;\n let revision = 0;\n let refreshAgain = false;\n const listeners = new Set<() => void>();\n const refresh = async (): Promise => {\n if (refreshing) {\n refreshAgain = true;\n return;\n }\n refreshing = true;\n const requestedTab = tab;\n const requestedRevision = revision;\n try {\n const next = await requestJson(observationUrl(botSlug, requestedTab));\n if (tab === requestedTab && revision === requestedRevision) value = next;\n } catch {\n if (tab === requestedTab && revision === requestedRevision) value = undefined;\n } finally {\n refreshing = false;\n }\n for (const listener of listeners) listener();\n if (refreshAgain && listeners.size > 0) {\n refreshAgain = false;\n void refresh();\n }\n };\n return {\n subscribe(listener) {\n listeners.add(listener);\n if (listeners.size === 1) {\n void refresh();\n timer = setInterval(() => void refresh(), 1500);\n }\n return () => {\n listeners.delete(listener);\n if (listeners.size === 0 && timer !== undefined) {\n clearInterval(timer);\n timer = undefined;\n }\n };\n },\n getSnapshot: () => value,\n setTab(targetId) {\n tab = targetId;\n void refresh();\n },\n confirmTakeover(active) {\n revision += 1;\n if (value !== undefined) value = { ...value, takeover: active };\n for (const listener of listeners) listener();\n },\n refresh: () => void refresh(),\n };\n}\n\nfunction BrowserHeaderAction({\n botSlug,\n t,\n setExpandable,\n setExpanded,\n}: ChannelSidebarEntryProps): ReactElement {\n const store = botInfoStore(botSlug);\n const [busy, setBusy] = useState(false);\n const inFlight = useRef(false);\n const [error, setError] = useState(false);\n const subscribe = (listener: () => void): (() => void) => {\n const sync = (): void => {\n setExpandable?.(store.getSnapshot().browserAccess !== undefined);\n };\n const unsubscribe = store.subscribe(() => {\n sync();\n listener();\n });\n sync();\n return unsubscribe;\n };\n const info = useSyncExternalStore(subscribe, store.getSnapshot);\n const accessOn = info.browserAccess === true;\n\n const onToggle = (next: boolean): void => {\n const rpc = connectionRpc;\n if (rpc === undefined || botSlug === undefined || inFlight.current) return;\n inFlight.current = true;\n setBusy(true);\n setError(false);\n void rpc\n .call('/api', 'botharness/browserAccessSet', { args: { slug: botSlug, enabled: next } })\n .then((result) => {\n if (!result.ok) {\n setError(true);\n return;\n }\n const value = result.value as { bot?: { browserAccess?: unknown } };\n const applied = value.bot?.browserAccess === true;\n store.setAccess(applied);\n setExpanded?.(applied);\n })\n .catch(() => {\n setError(true);\n })\n .finally(() => {\n inFlight.current = false;\n setBusy(false);\n });\n };\n\n const label = t(accessOn ? 'entry.access.disable' : 'entry.access.enable');\n return (\n \n \n onToggle(!accessOn)}\n >\n \n \n \n {error ? (\n \n {t('entry.access.failureHint')}\n \n ) : null}\n \n );\n}\n\nfunction BrowserBody({ botSlug, t }: ChannelSidebarEntryProps): ReactElement {\n const [store] = useState(() => createObservationStore(botSlug));\n const infoStore = botInfoStore(botSlug);\n const observation = useSyncExternalStore(store.subscribe, store.getSnapshot);\n const info = useSyncExternalStore(infoStore.subscribe, infoStore.getSnapshot);\n const [follow, setFollow] = useState(true);\n const [preview, setPreview] = useState(undefined);\n const [busy, setBusy] = useState(false);\n const errorId = useId();\n const [profileInvalid, setProfileInvalid] = useState(false);\n const [profileOverride, setProfileOverride] = useState(undefined);\n const [failure, setFailure] = useState(undefined);\n const [viewer, setViewer] = useState();\n const [interaction, setInteraction] = useState(false);\n const viewerScope = useRef('');\n const previousViewer = useRef<{ identity: string; url: string | undefined }>({\n identity: '',\n url: undefined,\n });\n const mounted = useRef(true);\n const viewerRequest = useRef(0);\n const interactionResource = useCallback((node: HTMLDivElement | null): void => {\n mounted.current = node !== null;\n if (node === null) viewerRequest.current += 1;\n }, []);\n const disableInteraction = useCallback(() => {\n viewerRequest.current += 1;\n setInteraction(false);\n }, []);\n const [inputMode, setInputMode] = useState<'direct' | 'trackpad'>(() =>\n typeof window !== 'undefined' &&\n window.innerWidth < 768 &&\n typeof window.matchMedia === 'function' &&\n window.matchMedia('(pointer: coarse)').matches\n ? 'trackpad'\n : 'direct',\n );\n const finePointer =\n typeof window !== 'undefined' &&\n typeof window.matchMedia === 'function' &&\n window.matchMedia('(pointer: fine)').matches;\n const showHeaderTakeover = inputMode === 'direct' && finePointer;\n\n const tabs = observation?.tabs ?? [];\n const focused = observation?.focused ?? null;\n const currentTab = tabs.find((tab) => tab.current);\n const orderedTabs =\n currentTab === undefined ? tabs : [currentTab, ...tabs.filter((tab) => !tab.current)];\n const cleanupRequired = observation?.cleanupRequired === true;\n const failureNotice =\n !cleanupRequired && failure !== undefined && isBrowserFailureKind(failure.code) ? (\n \n invoke(OPEN_ENDPOINT, follow || preview === undefined ? {} : { tab: preview })\n }\n />\n ) : null;\n let visibleError: string | undefined = failure?.message;\n if (cleanupRequired) visibleError = t('entry.view.cleanupFailed');\n if (failureNotice !== null) visibleError = undefined;\n const provisioning = observation?.provisioning ?? null;\n const paused = observation?.takeover === true;\n const viewerUrl =\n observation?.running === true &&\n (observation?.target === 'container' || observation?.target === 'local')\n ? baseRelative(observation.viewerUrl)\n : undefined;\n const narrowViewer = typeof window !== 'undefined' && window.innerWidth < 700;\n const viewerDesign =\n observation?.target === 'local' && (inputMode === 'trackpad' || narrowViewer)\n ? { width: 390, height: 700 }\n : { width: 1024, height: 768 };\n const identity = `${botSlug ?? ''}:${profileOverride ?? info.browserProfile ?? ''}:${observation?.target ?? ''}`;\n const scope = `${identity}:${viewerUrl ?? ''}`;\n const previous = previousViewer.current;\n if (viewerScope.current !== scope) {\n viewerScope.current = scope;\n viewerRequest.current += 1;\n previousViewer.current = { identity, url: viewerUrl };\n if (interaction) setInteraction(false);\n if ((previous.identity !== identity || previous.url !== undefined) && viewer !== undefined)\n setViewer(undefined);\n }\n if (!paused && interaction) setInteraction(false);\n const viewerTranslate: ViewerTranslate = (key) => t(key);\n const postTakeoverEnable = (): void => {\n if (botSlug === undefined || viewerUrl === undefined) return;\n const request = ++viewerRequest.current;\n const expectedScope = viewerScope.current;\n setBusy(true);\n setFailure(undefined);\n void requestJson<{ takeover: boolean }>(TAKEOVER_ENDPOINT, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ slug: botSlug, active: true }),\n })\n .then((result) => {\n if (\n mounted.current &&\n request === viewerRequest.current &&\n viewerScope.current === expectedScope\n ) {\n store.confirmTakeover(result.takeover);\n setInteraction(result.takeover);\n }\n })\n .catch((cause: unknown) => {\n if (mounted.current && request === viewerRequest.current) setFailure(readFailure(cause));\n })\n .finally(() => {\n if (mounted.current) {\n setBusy(false);\n store.refresh();\n }\n });\n };\n const toggleTakeover = (): void => {\n if (interaction) {\n disableInteraction();\n if (observation?.handoffPending !== true) invoke(TAKEOVER_ENDPOINT, { active: false });\n return;\n }\n if (busy || botSlug === undefined || viewerUrl === undefined) return;\n postTakeoverEnable();\n };\n const botName = info.displayName ?? botSlug ?? '';\n const takeoverTitle =\n interaction && paused\n ? `${t('entry.view.browserTitle', { name: botName })} · ${t('entry.takeover.active')}`\n : t('entry.view.browserTitle', { name: botName });\n const toggleRef = useRef(toggleTakeover);\n toggleRef.current = toggleTakeover;\n const messageResource = useMountedResource(() => {\n const onMessage = (event: MessageEvent): void => {\n const data = event.data as { type?: unknown } | null;\n if (typeof window === 'undefined' || event.origin !== window.location.origin) return;\n if (data === null || typeof data !== 'object' || data.type !== 'bh-takeover-toggle') return;\n const ours = [...document.querySelectorAll('iframe')].some(\n (frame) =>\n frame.contentWindow === event.source &&\n (frame.getAttribute('src') ?? '').includes('/botharness-browser/viewer/'),\n );\n if (!ours) return;\n toggleRef.current();\n };\n window.addEventListener('message', onMessage);\n return () => window.removeEventListener('message', onMessage);\n }, []);\n const takeoverNote = useRef(undefined);\n const wantTakeoverNote = interaction && paused;\n if (takeoverNote.current !== wantTakeoverNote && typeof document !== 'undefined') {\n takeoverNote.current = wantTakeoverNote;\n try {\n for (const frame of Array.from(document.querySelectorAll('iframe'))) {\n if ((frame.getAttribute('src') ?? '').includes('/botharness-browser/viewer/')) {\n frame.contentWindow?.postMessage(\n { type: 'bh-takeover-state', active: wantTakeoverNote },\n window.location.origin,\n );\n }\n }\n } catch {\n void 0;\n }\n }\n const bodyResource = useCallback(\n (node: HTMLDivElement | null): void => {\n interactionResource(node);\n messageResource(node);\n },\n [interactionResource, messageResource],\n );\n\n const invoke = (endpoint: string, body: Record = {}): void => {\n if (busy || botSlug === undefined) return;\n setBusy(true);\n setProfileInvalid(false);\n setFailure(undefined);\n void requestJson<{ ok: boolean; viewerUrl?: string | null; takeover?: boolean }>(endpoint, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ slug: botSlug, ...body }),\n })\n .then((result) => {\n if (typeof result.takeover === 'boolean') store.confirmTakeover(result.takeover);\n if (\n endpoint === OPEN_ENDPOINT &&\n result.viewerUrl !== undefined &&\n result.viewerUrl !== null\n ) {\n setViewer(baseRelative(result.viewerUrl));\n setInteraction(false);\n }\n if (endpoint === STOP_ENDPOINT) {\n setViewer(undefined);\n setInteraction(false);\n }\n })\n .catch((cause: unknown) => setFailure(readFailure(cause)))\n .finally(() => {\n setBusy(false);\n store.refresh();\n });\n };\n\n const onFollow = (next: boolean): void => {\n setFollow(next);\n if (next) {\n setPreview(undefined);\n store.setTab(undefined);\n } else {\n const selected = focused ?? preview;\n setPreview(selected);\n store.setTab(selected);\n }\n };\n\n const onSelectTab = (targetId: string): void => {\n setFollow(false);\n setPreview(targetId);\n store.setTab(targetId);\n };\n\n const onPause = (): void => {\n disableInteraction();\n invoke(TAKEOVER_ENDPOINT, { active: !paused });\n };\n\n const currentProfile = profileOverride ?? info.browserProfile ?? '';\n\n const saveProfile = (name: string): void => {\n const rpc = connectionRpc;\n if (rpc === undefined || botSlug === undefined || busy) return;\n const trimmed = name.trim();\n const next = trimmed === 'default' ? '' : trimmed;\n if (next === currentProfile) {\n setProfileInvalid(false);\n setFailure(undefined);\n return;\n }\n disableInteraction();\n setViewer(undefined);\n setBusy(true);\n setProfileInvalid(false);\n setFailure(undefined);\n void rpc\n .call('/api', 'botharness/browserProfileSet', { args: { slug: botSlug, profile: next } })\n .then((result) => {\n if (!result.ok) {\n setProfileInvalid(true);\n setFailure({ message: result.error?.message ?? t('entry.profile.failed') });\n return;\n }\n const value = result.value as { bot?: { browserProfile?: unknown } };\n setProfileOverride(\n typeof value.bot?.browserProfile === 'string' ? value.bot.browserProfile : '',\n );\n setPreview(undefined);\n store.setTab(undefined);\n infoStore.refresh();\n })\n .catch((cause: unknown) => {\n setProfileInvalid(true);\n setFailure(readFailure(cause));\n })\n .finally(() => {\n setBusy(false);\n store.refresh();\n });\n };\n\n if (!cleanupRequired && observation?.target === 'profile-control')\n return (\n \n );\n\n if (!cleanupRequired && observation?.target === 'daily-control')\n return (\n \n );\n\n if (!cleanupRequired && observation?.target === 'extension')\n return (\n \n );\n\n return (\n
\n \n \n {observation?.running === true ? (\n {t('entry.chip.running')}\n ) : (\n {t('entry.chip.stopped')}\n )}\n {paused ? {t('entry.chip.paused')} : null}\n \n }\n detail={\n
\n
\n {t('entry.profile.label')}\n \n
\n {viewerUrl === undefined ? (\n
\n {t('entry.view.follow')}\n \n
\n ) : null}\n
\n {viewerUrl === undefined ? (\n \n invoke(OPEN_ENDPOINT, follow || preview === undefined ? {} : { tab: preview })\n }\n >\n {t(busy ? 'entry.view.opening' : 'entry.view.open')}\n \n ) : (\n {\n if (viewerUrl !== undefined) setViewer(viewerUrl);\n }}\n >\n \n \n {t('entry.view.fullscreen')}\n \n \n )}\n \n {t(paused ? 'entry.view.resume' : 'entry.view.pause')}\n \n {observation?.running === true || cleanupRequired ? (\n invoke(STOP_ENDPOINT)}\n >\n {t('entry.view.stop')}\n \n ) : null}\n
\n
\n }\n />\n
\n {viewerUrl === undefined ? (\n <>\n {observation?.frame === null || observation?.frame === undefined ? (\n
{t('entry.view.noFrame')}
\n ) : (\n {t('entry.label')}\n )}\n \n ) : (\n \n {failure.message}\n
\n )\n }\n busy={busy}\n stopping={false}\n hideStop\n hideInteractiveToggle\n allowFrameInput\n onStop={() => invoke(STOP_ENDPOINT)}\n interactive={interaction && paused}\n onToggleInteractive={toggleTakeover}\n onDisableInteraction={disableInteraction}\n expanded={viewer === viewerUrl}\n onExpandedChange={(next) => {\n setViewer(next ? viewerUrl : undefined);\n if (!next) disableInteraction();\n }}\n extraControls={\n <>\n {showHeaderTakeover ? (\n setInputMode('trackpad')}\n >\n \n \n {t('entry.view.inputMode.trackpad')}\n \n \n ) : null}\n {showHeaderTakeover ? (\n \n \n \n \n {t(interaction ? 'entry.takeover.stop' : 'entry.takeover.start')}\n \n \n \n ) : null}\n \n }\n />\n )}\n {tabs.length === 0 ? (\n
{t('entry.view.noTabs')}
\n ) : (\n
    \n {orderedTabs.map((tab) => (\n
  • \n
    \n onSelectTab(tab.targetId)}\n >\n \n \n \n \n \n {tab.title === '' ? tab.url : tab.title}\n \n {tab.title === '' ? null : (\n {tab.url}\n )}\n \n \n
    \n
  • \n ))}\n
\n )}\n {provisioning !== null ? : null}\n {failureNotice}\n {visibleError !== undefined ? (\n
\n {visibleError}\n
\n ) : null}\n \n );\n}\n\nfunction createBrowserBody(t: BrowserTranslate): ComponentType {\n return function BrowserBodyView(props: Omit): ReactElement {\n useState(() => recordViewerOpen(connectionRpc, 'browser'));\n const store = botInfoStore(props.botSlug);\n const info = useSyncExternalStore(store.subscribe, store.getSnapshot);\n if (info.browserAccess === false)\n return {t('entry.access.description')};\n return ;\n };\n}\n\nfunction createBrowserBadge(t: BrowserTranslate): ComponentType {\n return function BrowserBadge({ botSlug }: Omit) {\n const store = botInfoStore(botSlug);\n const info = useSyncExternalStore(store.subscribe, store.getSnapshot);\n if (info.browserAccess !== true) return null;\n return (\n \n );\n };\n}\n\nfunction createBrowserHeader(t: BrowserTranslate): ComponentType {\n return function BrowserHeaderView(props: Omit): ReactElement {\n return ;\n };\n}\n\nexport function apply(ctx: BrowserClientContext): void {\n botInfoStores.clear();\n const t = ctx.locale.bind(LOCALE_NS);\n registerBrowserSettings(ctx, t);\n ctx.effect(() => {\n const sheet = document.createElement('style');\n sheet.dataset.plugin = '@botharness/browser';\n sheet.dataset.pluginCss = '@botharness/browser/client.css';\n sheet.textContent = styles;\n document.head.append(sheet);\n return () => sheet.remove();\n }, 'botharness-browser: styles');\n ctx.effect(() => ctx.locale.register(LOCALE_NS, { zh, en }), 'botharness-browser: dictionaries');\n ctx.inject(['channelSidebar', 'connection'], (sidebarCtx) => {\n const registry = (sidebarCtx as unknown as { channelSidebar?: ChannelSidebarRegistryLike })\n .channelSidebar;\n connectionRpc = (sidebarCtx as unknown as { connection?: { rpc?: ConnectionRpcLike } })\n .connection?.rpc;\n if (registry === undefined) return;\n ctx.effect(\n () =>\n registry.register({\n id: ENTRY_ID,\n icon: 'globe',\n label: t('entry.label'),\n order: 41,\n scope: 'personabot',\n component: createBrowserBody(t),\n headerAction: createBrowserHeader(t),\n badge: createBrowserBadge(t),\n tab: 'screen',\n }),\n 'botharness-browser: channel sidebar entry',\n );\n });\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA,IAAI,SAAS,CAAC;EAEd,IAAI;EAEJ,SAAS,gBAAiB;GACzB,IAAI,mBAAmB,OAAO;GAC9B,oBAAoB;GAEpB,OAAO,eAAe,QAAQ,cAAc,EAC1C,OAAO,KACT,CAAC;GACD,OAAO,SAAS,KAAK;GACrB,IAAI,wBAAQ,IAAI,QAAQ;GACxB,IAAI,cAAc;GAClB,SAAS,aAAa,SAAS;IAC7B,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI,WAAW,MAAM;KACnB,eAAe,QAAQ,iBAAiB;KACxC,aAAa,QAAQ,eAAe;KACpC,YAAY,QAAQ;IACtB;IACA,OAAO,SAAS,SAAS;KACvB,IAAI,oBAAoB,CAAC;KACzB,IAAI,YAAY;KAChB,IAAI,cAAc;KAClB,IAAI,cAAc;KAClB,IAAI,YAAY,eAAe,OAAO;KACtC,IAAI,SAAS,IAAI,MAAM,UAAU,MAAM;KACvC,KAAK,IAAI,IAAI,GAAG,IAAI,UAAU,QAAQ,KACpC,OAAO,KAAK,UAAU;KAExB,OAAO,OAAO,SAAS,GAAG;MACxB,IAAI,gBAAgB,OAAO,IAAI;MAC/B,IAAI,iBAAiB,QAAQ,kBAAkB,OAC7C;MAEF,IAAI,MAAM,QAAQ,aAAa,GAAG;OAChC,KAAK,IAAI,KAAK,GAAG,KAAK,cAAc,QAAQ,MAC1C,OAAO,KAAK,cAAc,GAAG;OAE/B;MACF;MACA,IAAI,QAAQ,aAAa,OAAO,UAAU,aAAa,IAAI;MAC3D,IAAI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AAG;IACL,CACF;IACA,CACE,UACA;KACE,IAAI;KACJ,IAAI;KACJ,GAAG;IACL,CACF;GACF;GACA,mBAAmB,CACjB,CACE,QACA,EACE,GAAG,sHACL,CACF,GACA,CACE,QACA,EACE,GAAG,yGACL,CACF,CACF;GACA,OAAO,CACL,CACE,YACA,EACE,QAAQ,oCACV,CACF,GACA,CACE,QACA,EACE,GAAG,6GACL,CACF,CACF;GACA,cAAc;IACZ,CACE,QACA,EACE,GAAG,6GACL,CACF;IACA,CACE,QACA,EACE,GAAG,WACL,CACF;IACA,CACE,QACA,EACE,GAAG,WACL,CACF;IACA,CACE,UACA;KACE,IAAI;KACJ,IAAI;KACJ,GAAG;IACL,CACF;GACF;GACA,OAAO;IACL,CACE,QACA,EACE,GAAG,4CACL,CACF;IACA,CACE,QACA,EACE,GAAG,8BACL,CACF;IACA,CACE,QACA,EACE,GAAG,6BACL,CACF;IACA,CACE,UACA;KACE,IAAI;KACJ,IAAI;KACJ,GAAG;IACL,CACF;GACF;GACA,cAAc;IACZ,CACE,QACA,EACE,GAAG,WACL,CACF;IACA,CACE,QACA,EACE,GAAG,WACL,CACF;IACA,CACE,UACA;KACE,IAAI;KACJ,IAAI;KACJ,GAAG;IACL,CACF;IACA,CACE,UACA;KACE,IAAI;KACJ,IAAI;KACJ,GAAG;IACL,CACF;GACF;GACA,UAAU,CACR,CACE,QACA,EACE,GAAG,0UACL,CACF,GACA,CACE,UACA;IACE,IAAI;IACJ,IAAI;IACJ,GAAG;GACL,CACF,CACF;GACA,SAAS;IACP,CACE,QACA;KACE,OAAO;KACP,QAAQ;KACR,GAAG;KACH,GAAG;KACH,IAAI;IACN,CACF;IACA,CACE,QACA;KACE,IAAI;KACJ,IAAI;KACJ,IAAI;KACJ,IAAI;IACN,CACF;IACA,CACE,QACA;KACE,IAAI;KACJ,IAAI;KACJ,IAAI;KACJ,IAAI;IACN,CACF;GACF;GACA,OAAO;IACL,CACE,UACA;KACE,IAAI;KACJ,IAAI;KACJ,GA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2B;GACpE;EACF;EAEA,SAAgB,MAAM,KAAiC;GACrD,cAAc,MAAM;GACpB,MAAM,IAAI,IAAI,OAAO,KAAK,SAAS;GACnC,wBAAwB,KAAK,CAAC;GAC9B,IAAI,aAAa;IACf,MAAM,QAAQ,SAAS,cAAc,OAAO;IAC5C,MAAM,QAAQ,SAAS;IACvB,MAAM,QAAQ,YAAY;IAC1B,MAAM,cAAc;IACpB,SAAS,KAAK,OAAO,KAAK;IAC1B,aAAa,MAAM,OAAO;GAC5B,GAAG,4BAA4B;GAC/B,IAAI,aAAa,IAAI,OAAO,SAAS,WAAW;IAAE;IAAI;GAAG,CAAC,GAAG,kCAAkC;GAC/F,IAAI,OAAO,CAAC,kBAAkB,YAAY,IAAI,eAAe;IAC3D,MAAM,WAAY,WACf;IACH,gBAAiB,WACd,YAAY;IACf,IAAI,aAAa,KAAA,GAAW;IAC5B,IAAI,aAEA,SAAS,SAAS;KAChB,IAAI;KACJ,MAAM;KACN,OAAO,EAAE,aAAa;KACtB,OAAO;KACP,OAAO;KACP,WAAW,kBAAkB,CAAC;KAC9B,cAAc,oBAAoB,CAAC;KACnC,OAAO,mBAAmB,CAAC;KAC3B,KAAK;IACP,CAAC,GACH,2CACF;GACF,CAAC;EACH"} \ No newline at end of file +{"version":3,"file":"client.js","names":["createElement","stylex","space","x1","x2","x3","x4","x5","x6","text","metaSize","metaLine","bodySize","bodyLine","titleSize","titleLine","regular","strong","radius","xs","sm","md","lg","panel","round","border","hairline","focus","size","inlineIcon","icon","row","nav","dialog","small","bodyMax","medium","wide","actionColor","secondary","hover","danger","dangerLabel","color","fg","muted","subtle","divider","borderStrong","selected","navSelected","accent","accentText","onAccent","onDanger","dangerEdge","dangerSoft","warning","warningEdge","warningSoft","success","surface","elevated","base","modal","well","accentTint","ReactElement","ReactNode","stylex","ChannelSidebarIcon","border","color","radius","size","space","text","EmptyState","title","description","action","status","undefined","PanelEmptyState","icon","children","useRef","useCallback","Button","Pill","IconFullscreenOutlineRegular","useState","StateDot","useRef","useCallback","Fragment","createContext","useContext","PrimitiveTooltip","ReactElement","ReactNode","stylex","color","space","text","styles","note","kogj98","kGuDYH","kLWn49","kHjlTd","$$css","inset","k8WAf4","kg3NbH","muted","kMwMTN","subtle","danger","success","warning","NoteTone","Note","tone","children","props","useState","ReactElement","ReactNode","stylex","Button","Note","color","radius","space","text","MissingPackagesAccess","MissingPackagesLabels","missing","manual","install","copy","copied","formatProgressMiB","bytes","toFixed","ProgressLine","percent","label","value","Math","max","min","MissingPackages","command","access","installing","busy","onInstall","labels","children","setCopied","navigator","clipboard","writeText","then","undefined","useState","useRef","useCallback","native","useId","useRef","useId","useState","Input","IconChevronDownOutlineRegular","createPortal","MenuSurface","IconPlusOutlineRegular","NativeMenu","Menu","ComponentProps","createPortal","stylex","useMountedResource","border","space","MenuPoint","x","y","pointerMenuPosition","point","width","height","viewport","top","margin","Number","parseFloat","x4","Math","max","min","PointerMenuProps","Omit","container","Element","align","PointerMenu","document","body","props","mount","HTMLSpanElement","node","menu","querySelector","HTMLElement","originalMaxWidth","getComputedStyle","maxWidth","originalMinWidth","minWidth","place","scale","getBoundingClientRect","cssZoom","currentCSSZoom","undefined","scaleX","scaleY","root","documentElement","clearance","hasAttribute","getPropertyValue","availableWidth","innerWidth","style","Infinity","maxHeight","innerHeight","box","desired","left","observer","ResizeObserver","observe","window","addEventListener","disconnect","removeEventListener","className","ButtonHTMLAttributes","InputHTMLAttributes","ReactElement","ReactNode","stylex","actionColor","border","color","radius","size","space","text","pillStyles","pill","k1xSpc","kGNEyG","kOIVth","ks0D6T","kZKoxP","kg3NbH","kMzoRj","kaIpWk","kWkggS","kMwMTN","kMv6JI","kGuDYH","kLWn49","khDVqt","kkrTdU","kSiTet","kI3sdo","kInvED","$$css","PillButton","children","rest","Omit","HTMLButtonElement","PillFileButton","input","HTMLInputElement","PointerMenu","MenuPoint","useMountedResource","useRef","useState","ReactElement","ReactNode","stylex","IconChevronDownOutlineRegular","pillStyles","color","space","SelectOption","value","Value","label","SelectProps","options","onChange","disabled","align","autoFocus","reselect","Select","open","setOpen","point","setPoint","trigger","HTMLButtonElement","active","mount","node","current","place","rect","getBoundingClientRect","scale","offsetHeight","height","next","x","right","left","y","bottom","Number","parseFloat","x2","previous","resize","ResizeObserver","undefined","observe","document","documentElement","observer","MutationObserver","attributes","attributeFilter","window","addEventListener","disconnect","removeEventListener","close","button","menu","activeElement","closest","queueMicrotask","focused","isConnected","body","contains","focus","preventScroll","find","option","event","stopPropagation","props","pill","map","id","useId","ReactElement","ReactNode","Ref","stylex","border","color","space","text","NARROW","COMPACT","SettingsRows","children","rootRef","HTMLDivElement","SettingsSectionProps","title","description","SettingsSection","id","undefined","SettingsRowProps","control","data","Readonly","Record","SettingsRow","titleId","descriptionId","SettingsValue","useState","useMemo","useSyncExternalStore","useState","useRef","useCallback","Tag","Button","Input","useState","useRef","useCallback","Tag","Button","useState","useRef","useCallback","Tag","Button","Input","useState","useRef","useSyncExternalStore","useId","useCallback","Tag","Switch","Button","IconFullscreenOutlineRegular"],"sources":["../../../node_modules/.pnpm/@stylexjs+stylex@0.19.1/node_modules/@stylexjs/stylex/lib/es/stylex.mjs","../../client/src/client/channel-sidebar-icon.tsx","../../client/src/client/ds/tokens.stylex.ts","../../client/src/client/ds/empty-state.tsx","../../client/src/client/mounted-resource.ts","../../client/src/client/remote-viewer/tokens.ts","../../client/src/client/remote-viewer/viewer-state.ts","../../client/src/client/remote-viewer/frame-liveness.ts","../../client/src/client/remote-viewer/index.tsx","../../client/src/client/ds/tooltip.tsx","../../client/src/client/telemetry-surface.ts","../../client/src/client/sidebar-card.tsx","../src/client/locale.ts","../src/failure-kinds.ts","../../client/src/client/ds/note.tsx","../../client/src/client/missing-packages.tsx","../src/client/browser-failure.tsx","../../client/src/client/anchored-panel.ts","../../client/src/client/combobox.tsx","../src/client/profile-combobox.tsx","../../client/src/client/appearance-scope.ts","../../client/src/client/appearance-primitives.tsx","../../client/src/client/ds/pointer-menu.tsx","../../client/src/client/ds/pill-button.tsx","../../client/src/client/ds/select.tsx","../../client/src/client/ds/settings-row.tsx","../src/client/settings.tsx","../src/client/profile-browser.tsx","../src/client/daily-browser.tsx","../src/client/borrowed-browser.tsx","../../client/src/client/ds/stylex-css.ts","../src/client/styles.ts","../src/client/access-power-icon.tsx","../src/client/viewer-icons.tsx","../src/client/index.tsx"],"sourcesContent":["var styleq = {};\n\nvar hasRequiredStyleq;\n\nfunction requireStyleq () {\n\tif (hasRequiredStyleq) return styleq;\n\thasRequiredStyleq = 1;\n\n\tObject.defineProperty(styleq, \"__esModule\", {\n\t value: true\n\t});\n\tstyleq.styleq = void 0;\n\tvar cache = new WeakMap();\n\tvar compiledKey = '$$css';\n\tfunction createStyleq(options) {\n\t var disableCache;\n\t var disableMix;\n\t var transform;\n\t if (options != null) {\n\t disableCache = options.disableCache === true;\n\t disableMix = options.disableMix === true;\n\t transform = options.transform;\n\t }\n\t return function styleq() {\n\t var definedProperties = [];\n\t var className = '';\n\t var inlineStyle = null;\n\t var debugString = '';\n\t var nextCache = disableCache ? null : cache;\n\t var styles = new Array(arguments.length);\n\t for (var i = 0; i < arguments.length; i++) {\n\t styles[i] = arguments[i];\n\t }\n\t while (styles.length > 0) {\n\t var possibleStyle = styles.pop();\n\t if (possibleStyle == null || possibleStyle === false) {\n\t continue;\n\t }\n\t if (Array.isArray(possibleStyle)) {\n\t for (var _i = 0; _i < possibleStyle.length; _i++) {\n\t styles.push(possibleStyle[_i]);\n\t }\n\t continue;\n\t }\n\t var style = transform != null ? transform(possibleStyle) : possibleStyle;\n\t if (style.$$css != null) {\n\t var classNameChunk = '';\n\t if (nextCache != null && nextCache.has(style)) {\n\t var cacheEntry = nextCache.get(style);\n\t if (cacheEntry != null) {\n\t classNameChunk = cacheEntry[0];\n\t debugString = cacheEntry[2];\n\t definedProperties.push.apply(definedProperties, cacheEntry[1]);\n\t nextCache = cacheEntry[3];\n\t }\n\t } else {\n\t var definedPropertiesChunk = [];\n\t for (var prop in style) {\n\t var value = style[prop];\n\t if (prop === compiledKey) {\n\t var compiledKeyValue = style[prop];\n\t if (compiledKeyValue !== true) {\n\t debugString = debugString ? compiledKeyValue + '; ' + debugString : compiledKeyValue;\n\t }\n\t continue;\n\t }\n\t if (typeof value === 'string' || value === null) {\n\t if (!definedProperties.includes(prop)) {\n\t definedProperties.push(prop);\n\t if (nextCache != null) {\n\t definedPropertiesChunk.push(prop);\n\t }\n\t if (typeof value === 'string') {\n\t classNameChunk += classNameChunk ? ' ' + value : value;\n\t }\n\t }\n\t } else {\n\t console.error(\"styleq: \".concat(prop, \" typeof \").concat(String(value), \" is not \\\"string\\\" or \\\"null\\\".\"));\n\t }\n\t }\n\t if (nextCache != null) {\n\t var weakMap = new WeakMap();\n\t nextCache.set(style, [classNameChunk, definedPropertiesChunk, debugString, weakMap]);\n\t nextCache = weakMap;\n\t }\n\t }\n\t if (classNameChunk) {\n\t className = className ? classNameChunk + ' ' + className : classNameChunk;\n\t }\n\t } else {\n\t if (disableMix) {\n\t if (inlineStyle == null) {\n\t inlineStyle = {};\n\t }\n\t inlineStyle = Object.assign({}, style, inlineStyle);\n\t } else {\n\t var subStyle = null;\n\t for (var _prop in style) {\n\t var _value = style[_prop];\n\t if (_value !== undefined) {\n\t if (!definedProperties.includes(_prop)) {\n\t if (_value != null) {\n\t if (inlineStyle == null) {\n\t inlineStyle = {};\n\t }\n\t if (subStyle == null) {\n\t subStyle = {};\n\t }\n\t subStyle[_prop] = _value;\n\t }\n\t definedProperties.push(_prop);\n\t nextCache = null;\n\t }\n\t }\n\t }\n\t if (subStyle != null) {\n\t inlineStyle = Object.assign(subStyle, inlineStyle);\n\t }\n\t }\n\t }\n\t }\n\t var styleProps = [className, inlineStyle, debugString];\n\t return styleProps;\n\t };\n\t}\n\tvar styleq$1 = styleq.styleq = createStyleq();\n\tstyleq$1.factory = createStyleq;\n\treturn styleq;\n}\n\nvar styleqExports = /*@__PURE__*/ requireStyleq();\n\nconst errorForFn = name => new Error(`Unexpected 'stylex.${name}' call at runtime. Styles must be compiled by '@stylexjs/babel-plugin'.`);\nconst errorForType = key => errorForFn(`types.${key}`);\nconst create = function stylexCreate(_styles) {\n throw errorForFn('create');\n};\nconst createTheme = (_baseTokens, _overrides) => {\n throw errorForFn('createTheme');\n};\nconst defineConsts = function stylexDefineConsts(_styles) {\n throw errorForFn('defineConsts');\n};\nconst defineVars = function stylexDefineVars(_styles) {\n throw errorForFn('defineVars');\n};\nconst unstable_conditional = function stylexConditional(_value) {\n throw errorForFn('unstable_conditional');\n};\nconst unstable_defineVarsNested = function stylexDefineVarsNested(_styles) {\n throw errorForFn('unstable_defineVarsNested');\n};\nconst unstable_defineConstsNested = function stylexDefineConstsNested(_styles) {\n throw errorForFn('unstable_defineConstsNested');\n};\nconst unstable_createThemeNested = (_baseTokens, _overrides) => {\n throw errorForFn('unstable_createThemeNested');\n};\nconst defineMarker = () => {\n throw errorForFn('defineMarker');\n};\nconst firstThatWorks = (..._styles) => {\n throw errorForFn('firstThatWorks');\n};\nconst keyframes = _keyframes => {\n throw errorForFn('keyframes');\n};\nconst positionTry = _positionTry => {\n throw errorForFn('positionTry');\n};\nfunction props(...styles) {\n const [className, style, dataStyleSrc] = styleqExports.styleq(styles);\n const result = {};\n if (className != null && className !== '') {\n result.className = className;\n }\n if (style != null && Object.keys(style).length > 0) {\n result.style = style;\n }\n if (dataStyleSrc != null && dataStyleSrc !== '') {\n result['data-style-src'] = dataStyleSrc;\n }\n return result;\n}\nconst toKebabCase = str => str.replace(/([A-Z])/g, '-$1').toLowerCase();\nfunction attrs(...styles) {\n const {\n className,\n style,\n 'data-style-src': dataStyleSrc\n } = props.apply(this, styles);\n const result = {};\n if (className != null) {\n result.class = className;\n }\n if (style != null) {\n result.style = Object.entries(style).map(([key, value]) => `${toKebabCase(key)}:${value}`).join(';');\n }\n if (dataStyleSrc != null) {\n result['data-style-src'] = dataStyleSrc;\n }\n return result;\n}\nconst viewTransitionClass = _viewTransitionClass => {\n throw errorForFn('viewTransitionClass');\n};\nconst defaultMarker = () => {\n throw errorForFn('defaultMarker');\n};\nconst when = {\n ancestor: _p => {\n throw errorForFn('when.ancestor');\n },\n descendant: _p => {\n throw errorForFn('when.descendant');\n },\n siblingBefore: _p => {\n throw errorForFn('when.siblingBefore');\n },\n siblingAfter: _p => {\n throw errorForFn('when.siblingAfter');\n },\n anySibling: _p => {\n throw errorForFn('when.anySibling');\n }\n};\nconst env = Object.freeze({});\nconst types = {\n angle: _v => {\n throw errorForType('angle');\n },\n color: _v => {\n throw errorForType('color');\n },\n url: _v => {\n throw errorForType('url');\n },\n image: _v => {\n throw errorForType('image');\n },\n integer: _v => {\n throw errorForType('integer');\n },\n lengthPercentage: _v => {\n throw errorForType('lengthPercentage');\n },\n length: _v => {\n throw errorForType('length');\n },\n percentage: _v => {\n throw errorForType('percentage');\n },\n number: _v => {\n throw errorForType('number');\n },\n resolution: _v => {\n throw errorForType('resolution');\n },\n time: _v => {\n throw errorForType('time');\n },\n transformFunction: _v => {\n throw errorForType('transformFunction');\n },\n transformList: _v => {\n throw errorForType('transformList');\n }\n};\nconst legacyMerge = /*@__PURE__*/ function () {\n function _legacyMerge(...styles) {\n const [className] = styleqExports.styleq(styles);\n return className;\n }\n _legacyMerge.create = create;\n _legacyMerge.createTheme = createTheme;\n _legacyMerge.defineConsts = defineConsts;\n _legacyMerge.defineMarker = defineMarker;\n _legacyMerge.defineVars = defineVars;\n _legacyMerge.defaultMarker = defaultMarker;\n _legacyMerge.firstThatWorks = firstThatWorks;\n _legacyMerge.keyframes = keyframes;\n _legacyMerge.positionTry = positionTry;\n _legacyMerge.props = props;\n _legacyMerge.attrs = attrs;\n _legacyMerge.types = types;\n _legacyMerge.when = when;\n _legacyMerge.viewTransitionClass = viewTransitionClass;\n _legacyMerge.env = env;\n _legacyMerge.unstable_conditional = unstable_conditional;\n _legacyMerge.unstable_defineVarsNested = unstable_defineVarsNested;\n _legacyMerge.unstable_defineConstsNested = unstable_defineConstsNested;\n _legacyMerge.unstable_createThemeNested = unstable_createThemeNested;\n return _legacyMerge;\n}();\n\nexport { attrs, create, createTheme, defaultMarker, defineConsts, defineMarker, defineVars, env, firstThatWorks, keyframes, legacyMerge, positionTry, props, types, unstable_conditional, unstable_createThemeNested, unstable_defineConstsNested, unstable_defineVarsNested, viewTransitionClass, when };\n","/**\n * Vendored Channel sidebar glyphs from lucide-react@1.46.0 (ISC, ADR-0032).\n *\n * Source: the matching lucide `dist/esm/icons/*.mjs` glyph data. Vendored at the\n * stock 2-unit stroke without adding a `lucide-react` runtime dependency.\n *\n * ISC License\n *\n * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT).\n * All other copyright (c) for Lucide are held by Lucide Contributors 2022.\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\nimport { createElement, type ReactElement } from 'react';\n\nconst glyphs: Record][]> = {\n image: [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2', ry: '2' }],\n ['circle', { cx: '9', cy: '9', r: '2' }],\n ['path', { d: 'm21 15-4-4L7 21' }],\n ],\n 'arrow-left': [\n ['path', { d: 'm12 19-7-7 7-7' }],\n ['path', { d: 'M19 12H5' }],\n ],\n 'chevron-right': [['path', { d: 'm9 18 6-6-6-6' }]],\n store: [\n ['path', { d: 'M15 21v-5a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v5' }],\n [\n 'path',\n {\n d: 'M17.774 10.31a1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.451 0 1.12 1.12 0 0 0-1.548 0 2.5 2.5 0 0 1-3.452 0 1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.77-3.248l2.889-4.184A2 2 0 0 1 7 2h10a2 2 0 0 1 1.653.873l2.895 4.192a2.5 2.5 0 0 1-3.774 3.244',\n },\n ],\n ['path', { d: 'M4 10.95V19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8.05' }],\n ],\n house: [['path', { d: 'm3 10 9-7 9 7v10a1 1 0 0 1-1 1h-5v-7H9v7H4a1 1 0 0 1-1-1z' }]],\n search: [\n ['path', { d: 'm21 21-4.34-4.34' }],\n ['circle', { cx: '11', cy: '11', r: '8' }],\n ],\n hash: [\n ['line', { x1: '4', x2: '20', y1: '9', y2: '9' }],\n ['line', { x1: '4', x2: '20', y1: '15', y2: '15' }],\n ['line', { x1: '10', x2: '8', y1: '3', y2: '21' }],\n ['line', { x1: '16', x2: '14', y1: '3', y2: '21' }],\n ],\n 'messages-circle': [\n [\n 'path',\n {\n d: 'M19.95 10.05a7 7 0 011.412 7.872 1 1 0 00-.058.787l.675 2.089a1 1 0 01-1.236 1.168l-2.155-.631a1 1 0 00-.745.06 7 7 0 01-7.793-1.445',\n },\n ],\n [\n 'path',\n {\n d: 'M2.696 12.708a1 1 0 00-.058-.785 7 7 0 113.518 3.473 1 1 0 00-.744-.061l-2.155.63a1 1 0 01-1.236-1.167z',\n },\n ],\n ],\n 'text-quote': [\n ['path', { d: 'M17 5H3' }],\n ['path', { d: 'M21 12H8' }],\n ['path', { d: 'M21 19H8' }],\n ['path', { d: 'M3 12v7' }],\n ],\n brain: [\n ['path', { d: 'M12 18V5' }],\n ['path', { d: 'M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4' }],\n ['path', { d: 'M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5' }],\n ['path', { d: 'M17.997 5.125a4 4 0 0 1 2.526 5.77' }],\n ['path', { d: 'M18 18a4 4 0 0 0 2-7.464' }],\n ['path', { d: 'M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517' }],\n ['path', { d: 'M6 18a4 4 0 0 1-2-7.464' }],\n ['path', { d: 'M6.003 5.125a4 4 0 0 0-2.526 5.77' }],\n ],\n file: [\n [\n 'path',\n {\n d: 'M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z',\n },\n ],\n ['path', { d: 'M14 2v5a1 1 0 0 0 1 1h5' }],\n ],\n terminal: [\n ['path', { d: 'M12 19h8' }],\n ['path', { d: 'm4 17 6-6-6-6' }],\n ],\n archive: [\n ['rect', { width: '20', height: '5', x: '2', y: '3', rx: '1' }],\n ['path', { d: 'M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8' }],\n ['path', { d: 'M10 12h4' }],\n ],\n 'archive-restore': [\n ['rect', { width: '20', height: '5', x: '2', y: '3', rx: '1' }],\n ['path', { d: 'M4 8v11a2 2 0 0 0 2 2h2' }],\n ['path', { d: 'M20 8v11a2 2 0 0 1-2 2h-2' }],\n ['path', { d: 'm9 15 3-3 3 3' }],\n ['path', { d: 'M12 12v9' }],\n ],\n 'alarm-clock': [\n ['circle', { cx: '12', cy: '13', r: '8' }],\n ['path', { d: 'M12 9v4l2 2' }],\n ['path', { d: 'M5 3 2 6' }],\n ['path', { d: 'm22 6-3-3' }],\n ['path', { d: 'M6.38 18.7 4 21' }],\n ['path', { d: 'M17.64 18.67 20 21' }],\n ],\n 'bell-ring': [\n ['path', { d: 'M10.268 21a2 2 0 0 0 3.464 0' }],\n ['path', { d: 'M22 8c0-2.3-.8-4.3-2-6' }],\n [\n 'path',\n {\n d: 'M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326',\n },\n ],\n ['path', { d: 'M4 2C2.8 3.7 2 5.7 2 8' }],\n ],\n bell: [\n ['path', { d: 'M10.268 21a2 2 0 0 0 3.464 0' }],\n [\n 'path',\n {\n d: 'M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326',\n },\n ],\n ],\n 'bell-off': [\n ['path', { d: 'M10.268 21a2 2 0 0 0 3.464 0' }],\n [\n 'path',\n {\n d: 'M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742',\n },\n ],\n ['path', { d: 'm2 2 20 20' }],\n ['path', { d: 'M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05' }],\n ],\n cpu: [\n ['path', { d: 'M12 20v2' }],\n ['path', { d: 'M12 2v2' }],\n ['path', { d: 'M17 20v2' }],\n ['path', { d: 'M17 2v2' }],\n ['path', { d: 'M2 12h2' }],\n ['path', { d: 'M2 17h2' }],\n ['path', { d: 'M2 7h2' }],\n ['path', { d: 'M20 12h2' }],\n ['path', { d: 'M20 17h2' }],\n ['path', { d: 'M20 7h2' }],\n ['path', { d: 'M7 20v2' }],\n ['path', { d: 'M7 2v2' }],\n ['rect', { x: '4', y: '4', width: '16', height: '16', rx: '2' }],\n ['rect', { x: '8', y: '8', width: '8', height: '8', rx: '1' }],\n ],\n 'id-card': [\n ['path', { d: 'M13 19a4 4 0 00-8 0' }],\n ['path', { d: 'M16 10h2' }],\n ['path', { d: 'M16 14h2' }],\n ['circle', { cx: '9', cy: '12', r: '3' }],\n ['rect', { x: '2', y: '5', width: '20', height: '14', rx: '2' }],\n ],\n plug: [\n ['path', { d: 'M12 22v-5' }],\n ['path', { d: 'M15 8V2' }],\n [\n 'path',\n {\n d: 'M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z',\n },\n ],\n ['path', { d: 'M9 8V2' }],\n ],\n ruler: [\n [\n 'path',\n {\n d: 'M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z',\n },\n ],\n ['path', { d: 'm14.5 12.5 2-2' }],\n ['path', { d: 'm11.5 9.5 2-2' }],\n ['path', { d: 'm8.5 6.5 2-2' }],\n ['path', { d: 'm17.5 15.5 2-2' }],\n ],\n compass: [\n ['circle', { cx: '12', cy: '12', r: '10' }],\n [\n 'path',\n {\n d: 'm16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z',\n },\n ],\n ],\n gauge: [\n ['path', { d: 'm12 14 4-4' }],\n ['path', { d: 'M3.34 19a10 10 0 1 1 17.32 0' }],\n ],\n 'user-check': [\n ['path', { d: 'm16 11 2 2 4-4' }],\n ['path', { d: 'M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2' }],\n ['circle', { cx: '9', cy: '7', r: '4' }],\n ],\n 'shield-check': [\n [\n 'path',\n {\n d: 'M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z',\n },\n ],\n ['path', { d: 'm9 12 2 2 4-4' }],\n ],\n upload: [\n ['path', { d: 'M12 3v12' }],\n ['path', { d: 'm17 8-5-5-5 5' }],\n ['path', { d: 'M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4' }],\n ],\n package: [\n [\n 'path',\n {\n d: 'M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z',\n },\n ],\n ['path', { d: 'M12 22V12' }],\n ['path', { d: 'M3.29 7 12 12l8.71-5' }],\n ['path', { d: 'm7.5 4.27 9 5.15' }],\n ],\n plus: [\n ['path', { d: 'M5 12h14' }],\n ['path', { d: 'M12 5v14' }],\n ],\n user: [\n ['path', { d: 'M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2' }],\n ['circle', { cx: '12', cy: '7', r: '4' }],\n ],\n bot: [\n ['path', { d: 'M12 8V4H8' }],\n ['rect', { width: '16', height: '12', x: '4', y: '8', rx: '2' }],\n ['path', { d: 'M2 14h2' }],\n ['path', { d: 'M20 14h2' }],\n ['path', { d: 'M15 13v2' }],\n ['path', { d: 'M9 13v2' }],\n ],\n 'list-checks': [\n ['path', { d: 'M13 5h8' }],\n ['path', { d: 'M13 12h8' }],\n ['path', { d: 'M13 19h8' }],\n ['path', { d: 'm3 17 2 2 4-4' }],\n ['path', { d: 'm3 7 2 2 4-4' }],\n ],\n palette: [\n [\n 'path',\n {\n d: 'M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z',\n },\n ],\n ['circle', { cx: '13.5', cy: '6.5', r: '.5', fill: 'currentColor' }],\n ['circle', { cx: '17.5', cy: '10.5', r: '.5', fill: 'currentColor' }],\n ['circle', { cx: '6.5', cy: '12.5', r: '.5', fill: 'currentColor' }],\n ['circle', { cx: '8.5', cy: '7.5', r: '.5', fill: 'currentColor' }],\n ],\n 'image-up': [\n [\n 'path',\n {\n d: 'M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21',\n },\n ],\n ['path', { d: 'm14 19.5 3-3 3 3' }],\n ['path', { d: 'M17 22v-5.5' }],\n ['circle', { cx: '9', cy: '9', r: '2' }],\n ],\n lock: [\n ['rect', { width: '18', height: '11', x: '3', y: '11', rx: '2', ry: '2' }],\n ['path', { d: 'M7 11V7a5 5 0 0 1 10 0v4' }],\n ],\n play: [\n [\n 'path',\n {\n d: 'M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z',\n },\n ],\n ],\n 'lock-open': [\n ['rect', { width: '18', height: '11', x: '3', y: '11', rx: '2', ry: '2' }],\n ['path', { d: 'M7 11V7a5 5 0 0 1 9.9-1' }],\n ],\n eye: [\n [\n 'path',\n {\n d: 'M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0',\n },\n ],\n ['circle', { cx: '12', cy: '12', r: '3' }],\n ],\n 'eye-off': [\n [\n 'path',\n {\n d: 'M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49',\n },\n ],\n ['path', { d: 'M14.084 14.158a3 3 0 0 1-4.242-4.242' }],\n [\n 'path',\n {\n d: 'M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143',\n },\n ],\n ['path', { d: 'm2 2 20 20' }],\n ],\n files: [\n [\n 'path',\n {\n d: 'M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8',\n },\n ],\n [\n 'path',\n {\n d: 'M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z',\n },\n ],\n [\n 'path',\n {\n d: 'M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1',\n },\n ],\n ],\n 'git-branch': [\n [\n 'path',\n {\n d: 'M15 6a9 9 0 0 0-9 9V3',\n },\n ],\n [\n 'circle',\n {\n cx: '18',\n cy: '6',\n r: '3',\n },\n ],\n [\n 'circle',\n {\n cx: '6',\n cy: '18',\n r: '3',\n },\n ],\n ],\n 'messages-square': [\n [\n 'path',\n {\n d: 'M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z',\n },\n ],\n [\n 'path',\n {\n d: 'M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1',\n },\n ],\n ],\n inbox: [\n [\n 'polyline',\n {\n points: '22 12 16 12 14 15 10 15 8 12 2 12',\n },\n ],\n [\n 'path',\n {\n d: 'M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z',\n },\n ],\n ],\n 'folder-key': [\n [\n 'path',\n {\n d: 'M13 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v1.36',\n },\n ],\n [\n 'path',\n {\n d: 'M19 12v6',\n },\n ],\n [\n 'path',\n {\n d: 'M19 14h2',\n },\n ],\n [\n 'circle',\n {\n cx: '19',\n cy: '20',\n r: '2',\n },\n ],\n ],\n users: [\n [\n 'path',\n {\n d: 'M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2',\n },\n ],\n [\n 'path',\n {\n d: 'M16 3.128a4 4 0 0 1 0 7.744',\n },\n ],\n [\n 'path',\n {\n d: 'M22 21v-2a4 4 0 0 0-3-3.87',\n },\n ],\n [\n 'circle',\n {\n cx: '9',\n cy: '7',\n r: '4',\n },\n ],\n ],\n 'settings-2': [\n [\n 'path',\n {\n d: 'M14 17H5',\n },\n ],\n [\n 'path',\n {\n d: 'M19 7h-9',\n },\n ],\n [\n 'circle',\n {\n cx: '17',\n cy: '17',\n r: '3',\n },\n ],\n [\n 'circle',\n {\n cx: '7',\n cy: '7',\n r: '3',\n },\n ],\n ],\n settings: [\n [\n 'path',\n {\n d: 'M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915',\n },\n ],\n [\n 'circle',\n {\n cx: '12',\n cy: '12',\n r: '3',\n },\n ],\n ],\n monitor: [\n [\n 'rect',\n {\n width: '20',\n height: '14',\n x: '2',\n y: '3',\n rx: '2',\n },\n ],\n [\n 'line',\n {\n x1: '8',\n x2: '16',\n y1: '21',\n y2: '21',\n },\n ],\n [\n 'line',\n {\n x1: '12',\n x2: '12',\n y1: '17',\n y2: '21',\n },\n ],\n ],\n globe: [\n [\n 'circle',\n {\n cx: '12',\n cy: '12',\n r: '10',\n },\n ],\n [\n 'path',\n {\n d: 'M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20',\n },\n ],\n [\n 'path',\n {\n d: 'M2 12h20',\n },\n ],\n ],\n 'panel-right': [\n [\n 'rect',\n {\n width: '18',\n height: '18',\n x: '3',\n y: '3',\n rx: '2',\n },\n ],\n [\n 'path',\n {\n d: 'M15 3v18',\n },\n ],\n ],\n 'panels-top-left': [\n [\n 'rect',\n {\n width: '18',\n height: '18',\n x: '3',\n y: '3',\n rx: '2',\n },\n ],\n [\n 'path',\n {\n d: 'M3 9h18',\n },\n ],\n [\n 'path',\n {\n d: 'M9 21V9',\n },\n ],\n ],\n 'grip-vertical': [\n ['circle', { cx: '9', cy: '12', r: '1' }],\n ['circle', { cx: '9', cy: '5', r: '1' }],\n ['circle', { cx: '9', cy: '19', r: '1' }],\n ['circle', { cx: '15', cy: '12', r: '1' }],\n ['circle', { cx: '15', cy: '5', r: '1' }],\n ['circle', { cx: '15', cy: '19', r: '1' }],\n ],\n star: [\n [\n 'path',\n {\n d: 'M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z',\n },\n ],\n ],\n copy: [\n ['rect', { width: '14', height: '14', x: '8', y: '8', rx: '2', ry: '2' }],\n ['path', { d: 'M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2' }],\n ],\n 'external-link': [\n ['path', { d: 'M15 3h6v6' }],\n ['path', { d: 'M10 14 21 3' }],\n ['path', { d: 'M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6' }],\n ],\n sun: [\n ['circle', { cx: '12', cy: '12', r: '4' }],\n ['path', { d: 'M12 2v2' }],\n ['path', { d: 'M12 20v2' }],\n ['path', { d: 'm4.93 4.93 1.41 1.41' }],\n ['path', { d: 'm17.66 17.66 1.41 1.41' }],\n ['path', { d: 'M2 12h2' }],\n ['path', { d: 'M20 12h2' }],\n ['path', { d: 'm6.34 17.66-1.41 1.41' }],\n ['path', { d: 'm19.07 4.93-1.41 1.41' }],\n ],\n moon: [\n [\n 'path',\n {\n d: 'M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401',\n },\n ],\n ],\n crop: [\n ['path', { d: 'M6 2v14a2 2 0 0 0 2 2h14' }],\n ['path', { d: 'M18 22V8a2 2 0 0 0-2-2H2' }],\n ],\n ban: [\n ['circle', { cx: '12', cy: '12', r: '10' }],\n ['path', { d: 'M4.929 4.929 19.07 19.071' }],\n ],\n x: [\n ['path', { d: 'M18 6 6 18' }],\n ['path', { d: 'm6 6 12 12' }],\n ],\n 'message-square': [\n [\n 'path',\n {\n d: 'M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z',\n },\n ],\n ],\n keyboard: [\n ['path', { d: 'M10 8h.01' }],\n ['path', { d: 'M12 12h.01' }],\n ['path', { d: 'M14 8h.01' }],\n ['path', { d: 'M16 12h.01' }],\n ['path', { d: 'M18 8h.01' }],\n ['path', { d: 'M6 8h.01' }],\n ['path', { d: 'M7 16h10' }],\n ['path', { d: 'M8 12h.01' }],\n ['rect', { width: '20', height: '16', x: '2', y: '4', rx: '2' }],\n ],\n smartphone: [\n ['rect', { width: '14', height: '20', x: '5', y: '2', rx: '2', ry: '2' }],\n ['path', { d: 'M12 18h.01' }],\n ],\n 'sliders-horizontal': [\n ['path', { d: 'M10 5H3' }],\n ['path', { d: 'M12 19H3' }],\n ['path', { d: 'M14 3v4' }],\n ['path', { d: 'M16 17v4' }],\n ['path', { d: 'M21 12h-9' }],\n ['path', { d: 'M21 19h-5' }],\n ['path', { d: 'M21 5h-7' }],\n ['path', { d: 'M8 10v4' }],\n ['path', { d: 'M8 12H3' }],\n ],\n info: [\n ['circle', { cx: '12', cy: '12', r: '10' }],\n ['path', { d: 'M12 16v-4' }],\n ['path', { d: 'M12 8h.01' }],\n ],\n puzzle: [\n [\n 'path',\n {\n d: 'M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z',\n },\n ],\n ],\n check: [\n [\n 'path',\n {\n d: 'M20 6 9 17l-5-5',\n },\n ],\n ],\n laptop: [\n [\n 'path',\n {\n d: 'M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z',\n },\n ],\n ['path', { d: 'M20.054 15.987H3.946' }],\n ],\n server: [\n ['rect', { width: '20', height: '8', x: '2', y: '2', rx: '2', ry: '2' }],\n ['rect', { width: '20', height: '8', x: '2', y: '14', rx: '2', ry: '2' }],\n ['line', { x1: '6', x2: '6.01', y1: '6', y2: '6' }],\n ['line', { x1: '6', x2: '6.01', y1: '18', y2: '18' }],\n ],\n building: [\n ['path', { d: 'M12 10h.01' }],\n ['path', { d: 'M12 14h.01' }],\n ['path', { d: 'M12 6h.01' }],\n ['path', { d: 'M16 10h.01' }],\n ['path', { d: 'M16 14h.01' }],\n ['path', { d: 'M16 6h.01' }],\n ['path', { d: 'M8 10h.01' }],\n ['path', { d: 'M8 14h.01' }],\n ['path', { d: 'M8 6h.01' }],\n ['path', { d: 'M9 22v-3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3' }],\n ['rect', { x: '4', y: '2', width: '16', height: '20', rx: '2' }],\n ],\n briefcase: [\n ['path', { d: 'M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16' }],\n ['rect', { width: '20', height: '14', x: '2', y: '6', rx: '2' }],\n ],\n 'flask-conical': [\n [\n 'path',\n {\n d: 'M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2',\n },\n ],\n ['path', { d: 'M6.453 15h11.094' }],\n ['path', { d: 'M8.5 2h7' }],\n ],\n 'gamepad-2': [\n ['line', { x1: '6', x2: '10', y1: '11', y2: '11' }],\n ['line', { x1: '8', x2: '8', y1: '9', y2: '13' }],\n ['line', { x1: '15', x2: '15.01', y1: '12', y2: '12' }],\n ['line', { x1: '18', x2: '18.01', y1: '10', y2: '10' }],\n [\n 'path',\n {\n d: 'M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z',\n },\n ],\n ],\n paintbrush: [\n ['path', { d: 'm14.622 17.897-10.68-2.913' }],\n [\n 'path',\n {\n d: 'M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z',\n },\n ],\n [\n 'path',\n {\n d: 'M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15',\n },\n ],\n ],\n 'audio-lines': [\n ['path', { d: 'M2 10v3' }],\n ['path', { d: 'M6 6v11' }],\n ['path', { d: 'M10 3v18' }],\n ['path', { d: 'M14 8v7' }],\n ['path', { d: 'M18 5v13' }],\n ['path', { d: 'M22 10v3' }],\n ],\n 'book-open': [\n ['path', { d: 'M12 5v16' }],\n [\n 'path',\n {\n d: 'M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z',\n },\n ],\n ],\n zap: [\n [\n 'path',\n {\n d: 'M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z',\n },\n ],\n ],\n heart: [\n [\n 'path',\n {\n d: 'M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5',\n },\n ],\n ],\n leaf: [\n [\n 'path',\n {\n d: 'M11 20a10 10 0 0010-10 25.9 25.9 0 00-1.04-7.281 1 1 0 00-1.755-.325C15.833 5.5 13 5.5 9.8 6.1A7 7 0 0011 20',\n },\n ],\n ['path', { d: 'M2 21a5 5 0 012.911-4.544C7.613 15.212 8.351 15.24 11 13' }],\n ],\n phone: [\n [\n 'path',\n {\n d: 'M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384',\n },\n ],\n ],\n video: [\n ['path', { d: 'm16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5' }],\n ['rect', { x: '2', y: '6', width: '14', height: '12', rx: '2' }],\n ],\n 'video-off': [\n ['path', { d: 'M10.66 6H14a2 2 0 0 1 2 2v2.5l5.248-3.062A.5.5 0 0 1 22 7.87v8.196' }],\n ['path', { d: 'M16 16a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2' }],\n ['path', { d: 'm2 2 20 20' }],\n ],\n 'phone-off': [\n [\n 'path',\n {\n d: 'M10.1 13.9a14 14 0 0 0 3.732 2.668 1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2 18 18 0 0 1-12.728-5.272',\n },\n ],\n ['path', { d: 'M22 2 2 22' }],\n [\n 'path',\n {\n d: 'M4.76 13.582A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 .244.473',\n },\n ],\n ],\n mic: [\n ['path', { d: 'M12 19v3' }],\n ['path', { d: 'M19 10v2a7 7 0 0 1-14 0v-2' }],\n ['rect', { x: '9', y: '2', width: '6', height: '13', rx: '3' }],\n ],\n 'mic-off': [\n ['path', { d: 'M12 19v3' }],\n ['path', { d: 'M15 9.34V5a3 3 0 0 0-5.68-1.33' }],\n ['path', { d: 'M16.95 16.95A7 7 0 0 1 5 12v-2' }],\n ['path', { d: 'M18.89 13.23A7 7 0 0 0 19 12v-2' }],\n ['path', { d: 'm2 2 20 20' }],\n ['path', { d: 'M9 9v3a3 3 0 0 0 5.12 2.12' }],\n ],\n tv: [\n ['path', { d: 'm17 2-5 5-5-5' }],\n ['rect', { width: '20', height: '15', x: '2', y: '7', rx: '2' }],\n ],\n};\n\nexport function ChannelSidebarIcon({\n name = 'panels-top-left',\n size = 16,\n}: {\n name?: string | undefined;\n size?: number | string;\n}): ReactElement {\n const nodes = Object.hasOwn(glyphs, name) ? glyphs[name]! : glyphs['panels-top-left']!;\n return (\n \n {nodes.map(([tag, attributes], index) => createElement(tag, { ...attributes, key: index }))}\n \n );\n}\n","import * as stylex from '@stylexjs/stylex';\n\nexport const space = stylex.defineConsts({\n x1: '2px',\n x2: '4px',\n x3: '8px',\n x4: '12px',\n x5: '16px',\n x6: '24px',\n});\n\nexport const text = stylex.defineConsts({\n metaSize: '12px',\n metaLine: '16px',\n bodySize: '13px',\n bodyLine: '20px',\n titleSize: '14px',\n titleLine: '20px',\n regular: '400',\n strong: '500',\n});\n\nexport const radius = stylex.defineConsts({\n xs: 'var(--dsw-radius-xs, 4px)',\n sm: 'var(--dsw-radius-sm, 8px)',\n md: 'var(--dsw-radius-md, 12px)',\n lg: 'var(--dsw-radius-lg, 16px)',\n panel: 'var(--dsw-radius-panel)',\n round: '50%',\n});\n\nexport const border = stylex.defineConsts({\n hairline: '1px',\n focus: 'var(--dsw-focus-ring-width, 2px)',\n});\n\nexport const size = stylex.defineConsts({\n inlineIcon: '26px',\n icon: '28px',\n row: '32px',\n nav: '40px',\n});\n\nexport const dialog = stylex.defineConsts({\n small: 'min(440px, calc(100vw - 32px))',\n bodyMax: 'min(60vh, 520px)',\n medium: 'min(760px, calc(100vw - 32px))',\n wide: 'min(1060px, calc(100vw - 32px))',\n});\n\nexport const actionColor = stylex.defineConsts({\n secondary:\n 'color-mix(in srgb, var(--dsw-alias-label-primary) 8%, var(--dsw-alias-bg-module-platform))',\n hover:\n 'color-mix(in srgb, var(--dsw-alias-label-primary) 13%, var(--dsw-alias-bg-module-platform))',\n danger:\n 'color-mix(in srgb, var(--dsw-alias-state-error-primary) 10%, var(--dsw-alias-bg-module-platform))',\n dangerLabel:\n 'color-mix(in srgb, var(--dsw-alias-state-error-primary) 65%, var(--dsw-alias-label-primary))',\n});\n\nexport const color = stylex.defineConsts({\n fg: 'var(--dsw-alias-label-primary)',\n muted: 'var(--dsw-alias-label-secondary)',\n subtle: 'var(--dsw-alias-label-tertiary)',\n divider: 'var(--dsw-alias-border-l1)',\n border: 'var(--dsw-alias-border-l2)',\n borderStrong: 'var(--dsw-alias-border-l3)',\n hover: 'var(--dsw-alias-interactive-bg-hover)',\n selected: 'var(--dsw-alias-interactive-bg-active)',\n navSelected: 'var(--dsw-specific-sidebar-nav-item-active)',\n accent: 'var(--dsw-alias-state-business-primary)',\n accentText: 'var(--dsw-alias-link)',\n onAccent: 'var(--dsw-alias-label-primary-foreground)',\n danger: 'var(--dsw-alias-state-error-primary)',\n onDanger: 'var(--dsw-alias-label-primary-foreground)',\n dangerEdge: 'var(--dsw-alias-state-error-secondary)',\n dangerSoft: 'var(--dsw-alias-interactive-bg-hover-danger)',\n warning: 'var(--dsw-alias-state-warn-primary)',\n warningEdge: 'var(--dsw-alias-state-warn-secondary)',\n warningSoft: 'var(--dsw-alias-state-warn-tertiary)',\n success: 'var(--dsw-alias-state-success-primary)',\n surface: 'var(--dsw-alias-bg-module-platform)',\n elevated: 'var(--dsw-alias-button-elevated-fill)',\n base: 'var(--dsw-alias-bg-base)',\n modal: 'var(--dsw-alias-bg-layer-2)',\n well: 'var(--dsw-alias-bg-base)',\n accentTint: 'var(--dsw-alias-state-business-tertiary)',\n});\n","import type { ReactElement, ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\n\nimport { ChannelSidebarIcon } from '../channel-sidebar-icon.js';\nimport { border, color, radius, size, space, text } from './tokens.stylex.js';\n\nconst styles = stylex.create({\n root: {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n gap: space.x3,\n marginBlock: space.x4,\n paddingBlock: space.x6,\n paddingInline: space.x5,\n borderWidth: border.hairline,\n borderStyle: 'dashed',\n borderColor: color.border,\n borderRadius: radius.md,\n textAlign: 'center',\n },\n panel: {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n flexGrow: 1,\n gap: space.x4,\n padding: space.x5,\n boxSizing: 'border-box',\n textAlign: 'center',\n color: color.muted,\n },\n icon: { width: size.nav, height: size.nav, flexShrink: 0, color: color.subtle },\n title: {\n margin: 0,\n color: color.fg,\n fontSize: text.bodySize,\n lineHeight: text.bodyLine,\n fontWeight: text.strong,\n },\n description: {\n margin: 0,\n maxWidth: '360px',\n color: color.muted,\n fontSize: text.metaSize,\n lineHeight: text.metaLine,\n },\n});\n\nexport function EmptyState({\n title,\n description,\n action,\n status = false,\n}: {\n readonly title: ReactNode;\n readonly description?: ReactNode;\n readonly action?: ReactNode;\n readonly status?: boolean;\n}): ReactElement {\n return (\n
\n

{title}

\n {description === undefined ? null : (\n

{description}

\n )}\n {action}\n
\n );\n}\n\nexport function PanelEmptyState({\n icon,\n children,\n action,\n}: {\n readonly icon?: string | undefined;\n readonly children: ReactNode;\n readonly action?: ReactNode;\n}): ReactElement {\n return (\n
\n \n \n \n

{children}

\n {action === undefined ? null :
{action}
}\n
\n );\n}\n","import { useCallback, useRef, type DependencyList, type RefCallback } from 'react';\n\nexport function useMountedResource(\n start: (node: T) => void | (() => void),\n dependencies: DependencyList,\n): RefCallback {\n const cleanup = useRef<(() => void) | undefined>(undefined);\n return useCallback((node: T | null) => {\n cleanup.current?.();\n cleanup.current = undefined;\n if (node !== null) cleanup.current = start(node) || undefined;\n }, dependencies);\n}\n","export const BH = {\n labelSecondary: 'var(--dsw-alias-label-secondary)',\n hoverFill: 'var(--dsw-alias-interactive-bg-hover)',\n errorPrimary: 'var(--dsw-alias-state-error-primary)',\n radiusMd: 'var(--dsw-radius-md)',\n labelPrimary: 'var(--dsw-alias-label-primary, #0f1115)',\n labelPrimaryForeground: 'var(--dsw-alias-label-primary-foreground, #ffffff)',\n borderL2: 'var(--dsw-alias-border-l2, #0000001a)',\n borderL3: 'var(--dsw-alias-border-l3, #0000001f)',\n borderL4: 'var(--dsw-alias-border-l4, #00000029)',\n bgBase: 'var(--dsw-alias-bg-base, #ffffff)',\n buttonPrimaryFill: 'var(--dsw-alias-button-primary-fill, #0f1115)',\n buttonElevatedFill: 'var(--dsw-alias-button-elevated-fill, transparent)',\n businessPrimary: 'var(--dsw-alias-state-business-primary, #4176e6)',\n hoverScrim: 'color-mix(in srgb, var(--dsw-alias-bg-base) 35%, transparent)',\n} as const;\n\nexport const VIDEO_SURFACE = {\n background: '#000000',\n spinnerTrack: 'rgba(255, 255, 255, 0.18)',\n spinnerArc: '#ffffff',\n onVideo: '#ffffff',\n} as const;\n","import type { ViewerKey } from './locale.js';\n\nexport type ViewerAction = 'open' | 'collapse';\n\nexport function nextExpanded(action: ViewerAction): boolean {\n return action === 'open';\n}\n\nexport type FramePhase = 'connecting' | 'live' | 'empty';\n\nexport const PHASE_SMOOTH_AFTER = 2;\n\nexport interface SmoothedPhase {\n readonly phase: FramePhase;\n readonly streak: number;\n}\n\nexport function smoothPhase(shown: FramePhase, raw: FramePhase, streak: number): SmoothedPhase {\n if (raw === 'live') return { phase: 'live', streak: 0 };\n if (shown !== 'live') return { phase: raw, streak: 0 };\n const next = streak + 1;\n if (next >= PHASE_SMOOTH_AFTER) return { phase: raw, streak: next };\n return { phase: shown, streak: next };\n}\n\nexport function dotStateFor(phase: FramePhase): 'done' | 'ongoing' | 'error' {\n if (phase === 'live') return 'done';\n if (phase === 'empty') return 'error';\n return 'ongoing';\n}\n\nexport function statusKeyFor(phase: FramePhase, reconnecting: boolean): ViewerKey {\n if (phase === 'live') return 'entry.live';\n if (phase === 'empty') return 'entry.noScreen';\n return reconnecting ? 'entry.reconnecting' : 'entry.connecting';\n}\n\nexport function stopKey(busy: boolean, stopping: boolean): ViewerKey {\n return busy || stopping ? 'entry.stopping' : 'entry.stop';\n}\n\nconst EXIT_REPORT = /^exited code=\\d+$/;\n\nexport function isExitReport(detail: string | undefined): boolean {\n return detail !== undefined && EXIT_REPORT.test(detail);\n}\n","import type { FramePhase } from './viewer-state.js';\n\nexport const EMPTY_AFTER_MISSES = 6;\n\nexport const BUSY_EMPTY_AFTER = 30;\n\nexport const QUIET_TOLERANCE = 4;\n\nexport const QUIET_ABANDON = 120;\n\nexport const LOSS_REMOUNT_AFTER = 3;\n\nexport const MAX_AUTO_RELOAD = 3;\n\nconst STATUS_ELEMENT_ID = 'status-display';\n\nconst BUSY_TEXT = /connecting|reconnect|disconnect|failed|error/i;\n\nexport interface StreamSample {\n readonly sized: boolean;\n readonly busy: boolean;\n readonly signature?: number;\n}\n\nexport interface StreamTracker {\n readonly misses: number;\n readonly busyStreak: number;\n readonly quiet: number;\n readonly lastSignature?: number;\n readonly live?: true;\n}\n\nexport function hashBytes(data: Uint8ClampedArray): number {\n let hash = 0x81_9c_9d_c5;\n for (let index = 0; index < data.length; index += 1) {\n hash ^= data[index] ?? 0;\n hash = Math.imul(hash, 0x01_00_01_93);\n }\n return hash >>> 0;\n}\n\nexport function upstreamBusy(doc: Document | null | undefined): boolean {\n try {\n const element = doc?.getElementById(STATUS_ELEMENT_ID) as HTMLElement | null;\n if (element === null || element === undefined) return false;\n if (element.classList.contains('hidden')) return false;\n return BUSY_TEXT.test(element.textContent ?? '');\n } catch {\n return false;\n }\n}\n\nfunction signatureOf(\n doc: Document,\n surface: HTMLVideoElement | HTMLCanvasElement,\n): number | undefined {\n try {\n const scratch = doc.createElement('canvas');\n scratch.width = 16;\n scratch.height = 16;\n const context = scratch.getContext('2d', { willReadFrequently: true });\n if (context === null) return undefined;\n context.drawImage(surface, 0, 0, 16, 16);\n return hashBytes(context.getImageData(0, 0, 16, 16).data);\n } catch {\n return undefined;\n }\n}\n\nexport function sampleSurface(doc: Document | null | undefined): StreamSample {\n const busy = upstreamBusy(doc);\n let sized = false;\n let signature: number | undefined;\n try {\n const surface = doc?.getElementById('videoCanvas') as\n | HTMLVideoElement\n | HTMLCanvasElement\n | null;\n const videoWidth = (surface as { readonly videoWidth?: unknown } | null)?.videoWidth;\n const canvasWidth = (surface as { readonly width?: unknown } | null)?.width;\n const width =\n typeof videoWidth === 'number'\n ? videoWidth\n : typeof canvasWidth === 'number'\n ? canvasWidth\n : 0;\n sized = surface !== null && surface !== undefined && width > 0;\n if (sized && surface !== null && surface !== undefined && doc !== null && doc !== undefined) {\n signature = signatureOf(doc, surface);\n }\n } catch {\n signature = undefined;\n }\n return signature === undefined ? { sized, busy } : { sized, busy, signature };\n}\nfunction withSignature(\n base: { readonly misses: number; readonly busyStreak: number; readonly quiet: number },\n signature: number | undefined,\n): StreamTracker {\n return signature === undefined ? { ...base } : { ...base, lastSignature: signature };\n}\n\nfunction withPreviousSignature(\n base: { readonly misses: number; readonly busyStreak: number; readonly quiet: number },\n prev: StreamTracker,\n): StreamTracker {\n return prev.lastSignature === undefined\n ? { ...base }\n : { ...base, lastSignature: prev.lastSignature };\n}\n\nexport function shouldRemountLoss(lossStreak: number): boolean {\n return lossStreak >= LOSS_REMOUNT_AFTER;\n}\n\nexport function shouldAutoReload(phase: FramePhase, everLive: boolean, attempts: number): boolean {\n return phase === 'empty' && !everLive && attempts < MAX_AUTO_RELOAD;\n}\n\nexport function nextStreamTracker(\n prev: StreamTracker,\n sample: StreamSample,\n): { readonly tracker: StreamTracker; readonly phase: FramePhase } {\n const signature = sample.signature;\n if (!sample.sized) {\n const misses = prev.misses + 1;\n return {\n tracker: withSignature({ misses, busyStreak: 0, quiet: 0 }, signature),\n phase: misses >= EMPTY_AFTER_MISSES ? 'empty' : 'connecting',\n };\n }\n if (sample.busy) {\n const busyStreak = prev.busyStreak + 1;\n return {\n tracker: withPreviousSignature({ misses: prev.misses, busyStreak, quiet: 0 }, prev),\n phase: busyStreak >= BUSY_EMPTY_AFTER ? 'empty' : 'connecting',\n };\n }\n const changed =\n signature !== undefined && prev.lastSignature !== undefined && signature !== prev.lastSignature;\n if (changed) {\n return {\n tracker: { ...withSignature({ misses: 0, busyStreak: 0, quiet: 0 }, signature), live: true },\n phase: 'live',\n };\n }\n if (signature === undefined) {\n return { tracker: { misses: 0, busyStreak: 0, quiet: 0, live: true }, phase: 'live' };\n }\n const quiet = prev.quiet + 1;\n if (quiet >= QUIET_ABANDON) {\n return {\n tracker: withSignature({ misses: EMPTY_AFTER_MISSES, busyStreak: 0, quiet }, signature),\n phase: 'empty',\n };\n }\n if (prev.live === true || quiet >= QUIET_TOLERANCE) {\n return {\n tracker: { ...withSignature({ misses: 0, busyStreak: 0, quiet }, signature), live: true },\n phase: 'live',\n };\n }\n return {\n tracker: withSignature({ misses: prev.misses, busyStreak: 0, quiet }, signature),\n phase: 'connecting',\n };\n}\n","import {\n Fragment,\n useCallback,\n useRef,\n useState,\n type CSSProperties,\n type ReactElement,\n type ReactNode,\n type RefCallback,\n} from 'react';\nimport {\n Button,\n IconFullscreenOutlineRegular,\n Pill,\n StateDot,\n} from '@deepseek-ai/dsh-client-ui-primitives';\nimport { useMountedResource } from '../mounted-resource.js';\nimport { BH, VIDEO_SURFACE } from './tokens.js';\nimport {\n dotStateFor,\n nextExpanded,\n smoothPhase,\n statusKeyFor,\n stopKey,\n type FramePhase,\n} from './viewer-state.js';\nimport {\n LOSS_REMOUNT_AFTER,\n nextStreamTracker,\n sampleSurface,\n shouldAutoReload,\n shouldRemountLoss,\n type StreamTracker,\n} from './frame-liveness.js';\nimport type { ViewerTranslate } from './locale.js';\nexport type ViewerLifecycleEvent =\n | { readonly type: 'mount' }\n | { readonly type: 'overlay'; readonly open: boolean }\n | { readonly type: 'phase'; readonly from: FramePhase; readonly to: FramePhase }\n | { readonly type: 'auto-reload'; readonly attempt: number }\n | { readonly type: 'manual-retry' }\n | { readonly type: 'loss-remount'; readonly streak: number };\n\nexport const SPIN_STYLE = '@keyframes bc-spin { to { transform: rotate(360deg); } }';\n\nfunction useStreamPhase(onSample: (phase: FramePhase) => void): RefCallback {\n return useMountedResource(\n (iframe) => {\n let active = true;\n let tracker: StreamTracker = { misses: 0, busyStreak: 0, quiet: 0 };\n let timer: ReturnType | undefined;\n const check = (): void => {\n if (!active) return;\n let doc: Document | null = null;\n try {\n doc = iframe.contentDocument;\n } catch {\n doc = null;\n }\n const next = nextStreamTracker(tracker, sampleSurface(doc));\n tracker = next.tracker;\n onSample(next.phase);\n timer = setTimeout(check, 1000);\n };\n timer = setTimeout(check, 300);\n return () => {\n active = false;\n if (timer !== undefined) clearTimeout(timer);\n };\n },\n [onSample],\n );\n}\n\nexport function ScreenIndicator({ label = '连接中' }: { readonly label?: string }): ReactElement {\n const size = 26;\n const stroke = 2;\n const radius = (size - stroke) / 2;\n const circumference = 2 * Math.PI * radius;\n return (\n \n
\n \n \n \n \n {label}\n
\n \n );\n}\n\nfunction ScreenEmpty({\n t,\n onRetry,\n}: {\n readonly t: ViewerTranslate;\n readonly onRetry: () => void;\n}): ReactElement {\n return (\n \n
\n {t('entry.noScreen')}\n \n
\n \n );\n}\n\nexport interface StreamOverlayProps {\n readonly phase: FramePhase;\n readonly reconnecting: boolean;\n readonly hovered: boolean;\n readonly t: ViewerTranslate;\n readonly onRetry: () => void;\n readonly onOpen: () => void;\n}\n\nexport function StreamOverlay(props: StreamOverlayProps): ReactElement | null {\n const { phase, reconnecting, hovered, t, onRetry, onOpen } = props;\n if (phase === 'connecting') {\n return ;\n }\n if (phase === 'empty') {\n return ;\n }\n if (!hovered) return null;\n return (\n \n \n \n {t('entry.openFullscreen')}\n \n \n );\n}\n\ninterface ScaledFrameProps {\n readonly src: string;\n readonly title: string;\n readonly design: { width: number; height: number };\n readonly interactive: boolean;\n readonly fit?: 'width' | 'contain';\n readonly iframeRef?: RefCallback;\n}\n\nfunction ScaledFrame({\n src,\n title,\n design,\n interactive,\n fit = 'width',\n iframeRef,\n}: ScaledFrameProps): ReactElement {\n const DESIGN_WIDTH = design.width;\n const DESIGN_HEIGHT = design.height;\n const [box, setBox] = useState({ width: DESIGN_WIDTH, height: DESIGN_HEIGHT });\n const resizeResource = useMountedResource(\n (element) => {\n const frame = element.querySelector('iframe');\n if (frame !== null) {\n frame.inert = !interactive;\n if (!interactive) frame.blur();\n }\n const update = (): void =>\n setBox({ width: element.clientWidth, height: element.clientHeight });\n update();\n const observer = new ResizeObserver(update);\n observer.observe(element);\n return () => observer.disconnect();\n },\n [interactive],\n );\n\n const scale =\n fit === 'contain'\n ? Math.min(box.width / DESIGN_WIDTH, box.height / DESIGN_HEIGHT)\n : box.width / DESIGN_WIDTH;\n const offsetX = fit === 'contain' ? Math.max(0, (box.width - DESIGN_WIDTH * scale) / 2) : 0;\n const offsetY = fit === 'contain' ? Math.max(0, (box.height - DESIGN_HEIGHT * scale) / 2) : 0;\n\n return (\n \n \n \n );\n}\n\nfunction CollapseIcon(): ReactElement {\n return (\n \n \n \n \n \n \n );\n}\n\nexport interface ViewerTitleBarProps {\n readonly t: ViewerTranslate;\n readonly title: string;\n readonly phase: FramePhase;\n readonly reconnecting: boolean;\n readonly busy: boolean;\n readonly stopping: boolean;\n readonly interactive: boolean;\n readonly extraControls?: ReactNode;\n readonly onToggleInteractive: () => void;\n readonly onStop: () => void;\n readonly onCollapse: () => void;\n readonly hideStop?: boolean | undefined;\n readonly hideInteractiveToggle?: boolean | undefined;\n}\n\nfunction StopButton({\n t,\n busy,\n stopping,\n onStop,\n}: {\n readonly t: ViewerTranslate;\n readonly busy: boolean;\n readonly stopping: boolean;\n readonly onStop: () => void;\n}): ReactElement {\n return (\n \n );\n}\n\nexport function ViewerTitleBar(props: ViewerTitleBarProps): ReactElement {\n const {\n t,\n title,\n phase,\n reconnecting,\n busy,\n stopping,\n interactive,\n extraControls,\n onToggleInteractive,\n onStop,\n onCollapse,\n hideStop,\n hideInteractiveToggle,\n } = props;\n return (\n \n \n \n {title}\n \n {t(statusKeyFor(phase, reconnecting))}\n {interactive ? null : (\n {t('entry.watchOnly')}\n )}\n \n {extraControls}\n {hideInteractiveToggle ? null : (\n \n {t(interactive ? 'entry.interactive.disable' : 'entry.interactive.enable')}\n \n )}\n {hideStop === true ? null : (\n \n )}\n \n \n \n \n );\n}\n\nexport interface RemoteViewerProps {\n readonly t: ViewerTranslate;\n readonly title: string;\n readonly src: string;\n readonly design: { width: number; height: number };\n readonly busy: boolean;\n readonly stopping: boolean;\n readonly onStop: () => void;\n readonly footer?: ReactNode;\n readonly notice?: ReactNode;\n readonly extraControls?: ReactNode;\n readonly onEvent?: (event: ViewerLifecycleEvent) => void;\n readonly interactive?: boolean;\n readonly onToggleInteractive?: () => void;\n readonly onDisableInteraction?: () => void;\n readonly expanded?: boolean;\n readonly onExpandedChange?: (expanded: boolean) => void;\n readonly hideStop?: boolean | undefined;\n readonly hideInteractiveToggle?: boolean | undefined;\n readonly allowFrameInput?: boolean | undefined;\n}\n\nexport function RemoteViewer({\n t,\n title,\n src,\n design,\n busy,\n stopping,\n onStop,\n footer,\n notice,\n extraControls,\n onEvent,\n interactive,\n onToggleInteractive,\n onDisableInteraction,\n expanded: controlledExpanded,\n onExpandedChange,\n hideStop,\n hideInteractiveToggle,\n allowFrameInput,\n}: RemoteViewerProps): ReactElement {\n const entryRef = useRef(null);\n const mounted = useRef(false);\n const [hovered, setHovered] = useState(false);\n const [ownExpanded, setOwnExpanded] = useState(false);\n const expanded = controlledExpanded ?? ownExpanded;\n const setExpanded = (next: boolean): void => {\n setOwnExpanded(next);\n onExpandedChange?.(next);\n };\n const [inputEnabled, setInputEnabled] = useState(false);\n const [reloadKey, setReloadKey] = useState(0);\n const [reconnecting, setReconnecting] = useState(false);\n const wasReady = useRef(false);\n const autoReloads = useRef(0);\n const lossStreak = useRef(0);\n const phaseRef = useRef('connecting');\n\n const [smooth, setSmooth] = useState<{ phase: FramePhase; streak: number }>({\n phase: 'connecting',\n streak: 0,\n });\n const resetFrame = useCallback(() => {\n phaseRef.current = 'connecting';\n setSmooth({ phase: 'connecting', streak: 0 });\n setReloadKey((key) => key + 1);\n }, []);\n const onSample = useCallback(\n (nextPhase: FramePhase): void => {\n const fromPhase = phaseRef.current;\n if (fromPhase !== nextPhase) {\n phaseRef.current = nextPhase;\n setSmooth((current) => smoothPhase(current.phase, nextPhase, current.streak));\n onEvent?.({ type: 'phase', from: fromPhase, to: nextPhase });\n }\n if (nextPhase === 'live') {\n wasReady.current = true;\n autoReloads.current = 0;\n lossStreak.current = 0;\n setReconnecting(false);\n return;\n }\n if (wasReady.current) {\n lossStreak.current += 1;\n if (shouldRemountLoss(lossStreak.current)) {\n wasReady.current = false;\n lossStreak.current = 0;\n onEvent?.({ type: 'loss-remount', streak: LOSS_REMOUNT_AFTER });\n setReconnecting(true);\n resetFrame();\n return;\n }\n }\n if (\n fromPhase !== nextPhase &&\n shouldAutoReload(nextPhase, wasReady.current, autoReloads.current)\n ) {\n autoReloads.current += 1;\n onEvent?.({ type: 'auto-reload', attempt: autoReloads.current });\n resetFrame();\n }\n },\n [resetFrame, onEvent],\n );\n const streamRef = useStreamPhase(onSample);\n const phase = smooth.phase;\n\n const reconnect = (): void => {\n onEvent?.({ type: 'manual-retry' });\n setReconnecting(true);\n autoReloads.current = 0;\n lossStreak.current = 0;\n wasReady.current = false;\n resetFrame();\n };\n const openViewer = (): void => {\n setExpanded(nextExpanded('open'));\n onEvent?.({ type: 'overlay', open: true });\n };\n const collapseViewer = (): void => {\n setInputEnabled(false);\n onDisableInteraction?.();\n setExpanded(nextExpanded('collapse'));\n onEvent?.({ type: 'overlay', open: false });\n requestAnimationFrame(() => entryRef.current?.focus());\n };\n const dialogResource = useMountedResource(\n (dialog) => {\n if (!mounted.current) {\n mounted.current = true;\n onEvent?.({ type: 'mount' });\n }\n if (!expanded) return;\n const onKey = (event: KeyboardEvent): void => {\n if (event.key !== 'Tab') return;\n const focusable = [\n ...dialog.querySelectorAll(\n 'button, [href], iframe, [tabindex]:not([tabindex=\"-1\"])',\n ),\n ].filter((element) => element.tabIndex !== -1);\n const first = focusable[0];\n const last = focusable.at(-1);\n if (first === undefined || last === undefined) return;\n const active = document.activeElement;\n if (event.shiftKey && (active === first || active === dialog)) {\n event.preventDefault();\n last.focus();\n } else if (!event.shiftKey && active === last) {\n event.preventDefault();\n first.focus();\n }\n };\n document.addEventListener('keydown', onKey);\n const previousOverflow = document.body.style.overflow;\n document.body.style.overflow = 'hidden';\n dialog.focus();\n return () => {\n document.removeEventListener('keydown', onKey);\n document.body.style.overflow = previousOverflow;\n };\n },\n [expanded, onDisableInteraction, onEvent],\n );\n\n const statusText = t(statusKeyFor(phase, reconnecting));\n const openable = phase === 'live' && !expanded;\n\n const overlay = (\n \n );\n\n const stopLabel = t(stopKey(busy, stopping));\n const rowButton = (disabled: boolean): CSSProperties => ({\n flex: 1,\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n height: 28,\n padding: '0 10px',\n borderRadius: 14,\n border: `1px solid ${BH.borderL3}`,\n background: BH.buttonElevatedFill,\n color: BH.labelPrimary,\n fontSize: 12,\n ...(disabled ? { opacity: 0.4, cursor: 'not-allowed' } : { cursor: 'pointer' }),\n });\n\n return (\n \n \n {expanded ? (\n setInputEnabled((current) => !current))\n }\n onStop={onStop}\n onCollapse={collapseViewer}\n hideStop={hideStop}\n hideInteractiveToggle={hideInteractiveToggle}\n />\n ) : null}\n {notice}\n setHovered(true)}\n onMouseLeave={() => setHovered(false)}\n onClick={() => {\n if (openable) openViewer();\n }}\n onKeyDown={(event) => {\n if (!openable) return;\n if (event.key !== 'Enter' && event.key !== ' ') return;\n event.preventDefault();\n openViewer();\n }}\n style={\n expanded\n ? { position: 'relative', flex: 1, minHeight: 0 }\n : { position: 'relative', cursor: openable ? 'pointer' : 'default' }\n }\n >\n \n {overlay}\n \n {expanded ? null : (\n \n \n {title}\n \n
\n {hideStop === true ? null : (\n \n {stopLabel}\n \n )}\n \n {t('entry.reconnect')}\n \n
\n {footer}\n
\n )}\n \n );\n}\n","import {\n createContext,\n type Context,\n useContext,\n type ComponentProps,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport { Tooltip as PrimitiveTooltip } from '@deepseek-ai/dsh-client-ui-primitives';\n\nconst shared = globalThis as typeof globalThis & Record | undefined>;\nconst InstantTooltips = (shared[Symbol.for('botharness.instant-tooltips')] ??=\n createContext(false));\n\nexport function InstantTooltipScope({ children }: { readonly children: ReactNode }): ReactElement {\n return {children};\n}\n\nexport function Tooltip(props: ComponentProps): ReactElement {\n const instant = useContext(InstantTooltips);\n return instant ? (\n \n ) : (\n \n );\n}\n","export type ClientTelemetrySurface = 'desktop_app' | 'browser';\n\nexport interface TelemetryRpc {\n call(path: string, method: string, options?: { args?: unknown }): Promise;\n}\n\nexport function telemetrySurface(): ClientTelemetrySurface {\n return typeof globalThis === 'object' && 'dshDesktop' in globalThis ? 'desktop_app' : 'browser';\n}\n\nexport function recordViewerOpen(\n rpc: TelemetryRpc | undefined,\n panel: 'browser' | 'computer',\n): void {\n void rpc\n ?.call('/api', 'botharness/telemetryEvent', {\n args: {\n event: 'viewer:subpanel_open',\n properties: { panel, surface: telemetrySurface() },\n },\n })\n .catch(() => {});\n}\n","import type { ReactElement, ReactNode, Ref } from 'react';\n\nimport { ChannelSidebarIcon } from './channel-sidebar-icon.js';\n\nexport function SidebarCardList({\n label,\n className,\n listRef,\n flush = false,\n children,\n}: {\n label?: string | undefined;\n className?: string | undefined;\n listRef?: Ref | undefined;\n flush?: boolean | undefined;\n children: ReactNode;\n}): ReactElement {\n return (\n \n {children}\n \n );\n}\n\nexport interface SidebarCardRowProps {\n icon?: string | undefined;\n leading?: ReactNode | undefined;\n selection?: { checked: boolean; multiple?: boolean } | undefined;\n iconLabel?: string | undefined;\n title: ReactNode;\n titleClassName?: string | undefined;\n badge?: ReactNode | undefined;\n summary?: ReactNode | undefined;\n flipKey?: string | undefined;\n hint?: string | undefined;\n chips?: ReactNode | undefined;\n meta?: ReactNode | undefined;\n trailing?: ReactNode | undefined;\n detail?: ReactNode | undefined;\n onClick?: () => void | undefined;\n disabled?: boolean | undefined;\n muted?: boolean | undefined;\n mainClassName?: string | undefined;\n dialog?: boolean | undefined;\n expanded?: boolean | undefined;\n controls?: string | undefined;\n state?: string | undefined;\n anchor?: string | undefined;\n}\n\nexport function SidebarCardRow({\n icon,\n leading,\n iconLabel,\n selection,\n title,\n titleClassName,\n badge,\n summary,\n flipKey,\n hint,\n chips,\n meta,\n trailing,\n detail,\n onClick,\n disabled,\n muted,\n mainClassName,\n dialog,\n expanded,\n controls,\n state,\n anchor,\n}: SidebarCardRowProps): ReactElement {\n const body = (\n <>\n {leading === undefined ? null : {leading}}\n {icon === undefined ? null : (\n \n \n
\n )}\n \n {badge === undefined ? (\n \n {title}\n \n ) : (\n \n \n {title}\n \n {badge}\n
\n )}\n {summary === undefined ? null : {summary}}\n {chips === undefined ? null : {chips}}\n {meta === undefined ? null : {meta}}\n \n \n );\n const className = mainClassName === undefined ? 'bh-card-main' : 'bh-card-main ' + mainClassName;\n return (\n \n
\n {selection?.multiple === true ? (\n \n ) : onClick === undefined ? (\n
\n {body}\n
\n ) : (\n \n {body}\n \n )}\n {trailing === undefined ? null : {trailing}}\n
\n {detail === undefined ? null : (\n
\n {detail}\n
\n )}\n \n );\n}\n","export const LOCALE_NS = 'botharness-browser';\n\nexport const zh = {\n 'entry.profile.install': '安装 BotHarness Profile 控制扩展',\n 'entry.profile.instructions':\n '在 BotHarness Profile 控制扩展中输入地址和配对码,并确认允许整个 Profile。',\n 'entry.profile.forget': '解除 Profile 配对',\n 'entry.profile.disconnected': 'Profile 已配对,连接已断开',\n 'entry.profile.connected': 'Profile 已连接',\n 'entry.profile.pair': '配对 Chrome Profile',\n 'entry.profile.scope': '此 Chrome Profile 的所有普通网页标签页',\n 'settings.profile-control': '日常 Chrome · 整个 Profile',\n 'settings.daily-control': '日常 Chrome · 控制',\n 'entry.daily.install': '安装 Playwright 扩展',\n 'entry.daily.connect': '连接现有页面',\n 'entry.daily.select': '请在 Chrome 中选择一个现有标签页',\n 'entry.daily.confirm': '已连接,尚未允许操作',\n 'entry.daily.controlled': '已允许此页面的读取、输入和点击',\n 'entry.daily.allow': '允许控制此页面',\n\n 'entry.live': '已连接',\n 'entry.noScreen': '暂无画面',\n 'entry.connecting': '连接中',\n 'entry.reconnecting': '正在重新连接',\n 'entry.reconnect': '重新连接',\n 'entry.openFullscreen': '打开大屏',\n 'entry.collapseFullscreen': '收起全屏',\n 'entry.interactive.disable': '停止交互',\n 'entry.interactive.enable': '开启交互',\n 'entry.watchOnly': '观看模式',\n 'entry.stop': '停止',\n 'entry.stopping': '停止中',\n\n 'settings.localDriver': '本机驱动',\n 'settings.containerDriver': '容器驱动',\n 'settings.driver.current': '默认',\n 'settings.driver.agent-browser': 'agent-browser(试用)',\n 'settings.section': '浏览器控制',\n 'settings.target': '操作目标',\n 'settings.local': '本机 Browser',\n 'settings.container': 'Docker Browser',\n 'settings.extension': '日常浏览器',\n 'entry.borrow.none': '尚未借用标签页',\n 'entry.borrow.readOnly': '只读借用中',\n 'entry.borrow.pair': '连接浏览器扩展',\n 'entry.borrow.return': '归还标签页',\n 'entry.borrow.code': '配对码',\n 'entry.borrow.cancel': '取消配对',\n 'entry.borrow.instructions':\n '在扩展中输入此地址和配对码,再选择借出当前页面。配对码 5 分钟内有效,仅可使用一次。',\n 'entry.view.interaction': '允许 Human 操作',\n 'entry.view.inputMode.direct': '直接点按',\n 'entry.view.inputMode.trackpad': '触控板',\n 'entry.view.close': '关闭',\n 'entry.view.container': '容器浏览器',\n 'entry.view.browserTitle': '{name}的浏览器',\n 'entry.takeover.start': '接管',\n 'entry.takeover.stop': '取消接管',\n 'entry.takeover.active': '接管中',\n 'entry.label': '浏览器',\n 'entry.access.title': 'Browser Access',\n 'entry.access.on': 'Browser Access 已开启',\n 'entry.access.description': '开启后,该 Bot 的会话可以使用浏览器',\n 'entry.access.enable': '启用 Browser Access',\n 'entry.access.disable': '停用 Browser Access',\n 'entry.access.failed': '切换 Browser Access 失败',\n 'entry.access.failureHint': '授权失败',\n 'entry.profile.label': 'Profile',\n 'entry.profile.default': 'default',\n 'entry.profile.failed': '切换浏览器 profile 失败',\n 'entry.profile.choose': '选择浏览器 Profile',\n 'entry.profile.create': '创建“{name}”',\n 'entry.view.follow': '跟随 Bot',\n 'entry.view.pause': '暂停 Bot',\n 'entry.view.resume': '继续',\n 'entry.view.open': '打开 Bot 浏览器',\n 'entry.view.fullscreen': '全屏',\n 'entry.view.stop': '停止',\n 'entry.view.cleanupFailed': '浏览器清理失败。点击“停止”重试。',\n 'entry.view.opening': '正在打开…',\n 'entry.view.noFrame': '暂无画面',\n 'entry.view.noTabs': '暂无标签页',\n 'entry.view.tabs': '标签页',\n 'entry.chip.running': '运行中',\n 'entry.chip.stopped': '未运行',\n 'entry.chip.paused': '已暂停',\n 'entry.chip.disconnected': '未连接',\n 'entry.chip.connecting': '连接中',\n 'entry.chip.confirm': '待允许',\n 'entry.chip.controlled': '可操作',\n 'entry.chip.unpaired': '未配对',\n 'entry.chip.offline': '已断开',\n 'entry.chip.connected': '已连接',\n 'entry.chip.notShared': '未借用',\n 'entry.chip.readOnly': '只读',\n 'entry.provision.preparing': '正在准备下载浏览器…',\n 'entry.provision.downloading': '正在下载浏览器…{percent}%({downloaded}/{total})',\n 'entry.fail.details': '详情',\n 'entry.fail.provision-no-network.title': '浏览器下载失败——本机网络似乎不通。',\n 'entry.fail.provision-no-network.fault': '这是本机网络的问题,不是你的设置问题。',\n 'entry.fail.provision-no-network.action': '让本机连上网后,再点一次“打开”。',\n 'entry.fail.provision-no-disk-space.title': '浏览器下载失败——磁盘空间不足。',\n 'entry.fail.provision-no-disk-space.fault': '这是本机剩余空间的问题。',\n 'entry.fail.provision-no-disk-space.action': '至少腾出 500 MB 空间后,再点一次“打开”。',\n 'entry.fail.provision-no-permission.title': '浏览器下载失败——下载目录不可写。',\n 'entry.fail.provision-no-permission.fault': '这是本机目录权限的问题。',\n 'entry.fail.provision-no-permission.action':\n '请机器管理员放开浏览器目录的写权限后,再点一次“打开”。',\n 'entry.fail.provision-missing-libs.title': '这台机器缺少浏览器需要的系统库。',\n 'entry.install.missing': '需要安装 {count} 个系统包。',\n 'entry.install.manual':\n '安装需要管理员密码。请在这台机器的终端里运行下面的命令,装好后再点「打开」。',\n 'entry.install.button': '一键安装',\n 'entry.install.copy': '复制命令',\n 'entry.install.copied': '已复制',\n 'entry.install.progress': '正在安装系统库:{percent}%',\n 'entry.fail.provision-missing-libs.fault': '这是机器环境的问题,不是浏览器设置的问题。',\n 'entry.fail.provision-missing-libs.action':\n 'Ubuntu 24.04 上按“详情”里的命令安装系统库,装好后再点“打开”。',\n 'entry.fail.provision-failed.title': '浏览器下载失败。',\n 'entry.fail.provision-failed.fault': '暂时看不出具体原因。',\n 'entry.fail.provision-failed.action': '再点一次“打开”重试;多次失败请把“详情”发给机器管理员。',\n 'entry.fail.startup-missing-binary.title': '配置的浏览器文件不存在。',\n 'entry.fail.startup-missing-binary.fault': '这是插件配置里的浏览器路径问题。',\n 'entry.fail.startup-missing-binary.action':\n '修正浏览器插件配置中的 browserPath,或清空它改用自动下载。',\n 'entry.fail.startup-spawn-failed.title': '浏览器程序无法启动。',\n 'entry.fail.startup-spawn-failed.fault':\n '本机拦截或删除了浏览器文件——常见是杀毒软件,偶尔是权限问题。',\n 'entry.fail.startup-spawn-failed.action':\n '把浏览器目录加入杀毒软件白名单(或找机器管理员看权限),再点一次“打开”。',\n 'entry.fail.startup-sandbox.title': '浏览器因系统沙箱限制拒绝启动。',\n 'entry.fail.startup-sandbox.fault': '这是本机系统限制的问题。',\n 'entry.fail.startup-sandbox.action':\n 'Ubuntu 23.10 起通常是 AppArmor 限制了用户命名空间:按“详情”给这个浏览器加 AppArmor 配置后,再点一次“打开”。',\n 'entry.fail.startup-crashed.title': '浏览器在启动过程中退出了。',\n 'entry.fail.startup-crashed.fault': '这是本机浏览器的问题,不是页面问题。',\n 'entry.fail.startup-crashed.action': '再点一次“打开”重试;多次失败请把“详情”发给机器管理员。',\n 'entry.fail.startup-timeout.title': '浏览器启动超时。',\n 'entry.fail.startup-timeout.fault': '这台机器可能比较慢或负载较高。',\n 'entry.fail.startup-timeout.action': '再点一次“打开”重试;多次失败请重启机器或联系管理员。',\n 'entry.error': '浏览器操作失败',\n};\n\nexport type BrowserKey = keyof typeof zh;\n\nexport const en: Record = {\n 'entry.profile.install': 'Install BotHarness Profile Control extension',\n 'entry.profile.instructions':\n 'Enter the address and code in the BotHarness Profile Control extension and confirm Profile-wide access.',\n 'entry.profile.forget': 'Forget Profile pairing',\n 'entry.profile.disconnected': 'Profile paired · disconnected',\n 'entry.profile.connected': 'Profile connected',\n 'entry.profile.pair': 'Pair Chrome Profile',\n 'entry.profile.scope': 'All ordinary webpage tabs in this Chrome Profile',\n 'settings.profile-control': 'Daily Chrome · Entire Profile',\n 'settings.daily-control': 'Daily Chrome · Control',\n 'entry.daily.install': 'Install Playwright extension',\n 'entry.daily.connect': 'Connect existing page',\n 'entry.daily.select': 'Select one existing Chrome tab',\n 'entry.daily.confirm': 'Connected · control not granted',\n 'entry.daily.controlled': 'This document allows observe, type and click',\n 'entry.daily.allow': 'Allow control of this document',\n\n 'entry.live': 'Connected',\n 'entry.noScreen': 'No screen',\n 'entry.connecting': 'Connecting',\n 'entry.reconnecting': 'Reconnecting',\n 'entry.reconnect': 'Reconnect',\n 'entry.openFullscreen': 'Open fullscreen',\n 'entry.collapseFullscreen': 'Leave fullscreen',\n 'entry.interactive.disable': 'Disable interaction',\n 'entry.interactive.enable': 'Enable interaction',\n 'entry.watchOnly': 'Watch only',\n 'entry.stop': 'Stop',\n 'entry.stopping': 'Stopping',\n\n 'settings.localDriver': 'Local driver',\n 'settings.containerDriver': 'Container driver',\n 'settings.driver.current': 'Default',\n 'settings.driver.agent-browser': 'agent-browser (trial)',\n 'settings.section': 'Browser',\n 'settings.target': 'Browser Target',\n 'settings.local': 'Local Browser',\n 'settings.container': 'Docker Browser',\n 'settings.extension': 'Daily Browser',\n 'entry.borrow.none': 'No shared tab',\n 'entry.borrow.readOnly': 'Shared read-only',\n 'entry.borrow.pair': 'Connect browser extension',\n 'entry.borrow.return': 'Return tab',\n 'entry.borrow.code': 'Pairing code',\n 'entry.borrow.cancel': 'Cancel pairing',\n 'entry.borrow.instructions':\n 'Enter this address and code in the extension, then share the current page. The code expires in 5 minutes and can be used once.',\n 'entry.view.interaction': 'Enable Human interaction',\n 'entry.view.inputMode.direct': 'Direct tap',\n 'entry.view.inputMode.trackpad': 'Trackpad',\n 'entry.view.close': 'Close',\n 'entry.view.container': 'Container Browser',\n 'entry.view.browserTitle': \"{name}'s Browser\",\n 'entry.takeover.start': 'Take over',\n 'entry.takeover.stop': 'Release',\n 'entry.takeover.active': 'Taking over',\n 'entry.label': 'Browser',\n 'entry.access.title': 'Browser Access',\n 'entry.access.on': 'Browser Access is on',\n 'entry.access.description': \"This PersonaBot's sessions may use the browser\",\n 'entry.access.enable': 'Enable Browser Access',\n 'entry.access.disable': 'Disable Browser Access',\n 'entry.access.failed': 'Failed to switch Browser Access',\n 'entry.access.failureHint': 'Access failed',\n 'entry.profile.label': 'Profile',\n 'entry.profile.default': 'default',\n 'entry.profile.failed': 'Failed to switch the browser profile',\n 'entry.profile.choose': 'Choose browser profile',\n 'entry.profile.create': 'Create “{name}”',\n 'entry.view.follow': 'Follow the Bot',\n 'entry.view.pause': 'Pause Bot',\n 'entry.view.resume': 'Resume',\n 'entry.view.open': 'Open Bot Browser',\n 'entry.view.fullscreen': 'Fullscreen',\n 'entry.view.stop': 'Stop',\n 'entry.view.cleanupFailed': 'Browser cleanup failed. Click Stop to retry.',\n 'entry.view.opening': 'Opening…',\n 'entry.view.noFrame': 'No frame yet',\n 'entry.view.noTabs': 'No tabs yet',\n 'entry.view.tabs': 'Tabs',\n 'entry.chip.running': 'Running',\n 'entry.chip.stopped': 'Stopped',\n 'entry.chip.paused': 'Paused',\n 'entry.chip.disconnected': 'Not connected',\n 'entry.chip.connecting': 'Connecting',\n 'entry.chip.confirm': 'Needs approval',\n 'entry.chip.controlled': 'Controllable',\n 'entry.chip.unpaired': 'Not paired',\n 'entry.chip.offline': 'Disconnected',\n 'entry.chip.connected': 'Connected',\n 'entry.chip.notShared': 'Not shared',\n 'entry.chip.readOnly': 'Read-only',\n 'entry.provision.preparing': 'Preparing the browser download…',\n 'entry.provision.downloading': 'Downloading browser… {percent}% ({downloaded} / {total})',\n 'entry.fail.details': 'Details',\n 'entry.fail.provision-no-network.title':\n 'The browser download failed — this machine looks offline.',\n 'entry.fail.provision-no-network.fault':\n 'This is about the network on this machine, not your settings.',\n 'entry.fail.provision-no-network.action':\n 'Reconnect this machine to the internet, then click Open again.',\n 'entry.fail.provision-no-disk-space.title': 'The browser download failed — the disk is full.',\n 'entry.fail.provision-no-disk-space.fault': 'This is about free space on this machine.',\n 'entry.fail.provision-no-disk-space.action': 'Free at least 500 MB, then click Open again.',\n 'entry.fail.provision-no-permission.title':\n 'The browser download failed — the download folder is not writable.',\n 'entry.fail.provision-no-permission.fault': 'This is about folder permissions on this machine.',\n 'entry.fail.provision-no-permission.action':\n 'Ask the machine owner to make the browser folder writable, then click Open again.',\n 'entry.fail.provision-missing-libs.title':\n 'This machine is missing system libraries the browser needs.',\n 'entry.install.missing': '{count} system packages need to be installed.',\n 'entry.install.manual':\n 'Installing needs an administrator password. Run this command in a terminal on this machine, then click Open again.',\n 'entry.install.button': 'Install',\n 'entry.install.copy': 'Copy command',\n 'entry.install.copied': 'Copied',\n 'entry.install.progress': 'Installing system libraries: {percent}%',\n 'entry.fail.provision-missing-libs.fault':\n 'This is about the machine setup, not your browser settings.',\n 'entry.fail.provision-missing-libs.action':\n 'On Ubuntu 24.04, install them with the command in Details, then click Open again.',\n 'entry.fail.provision-failed.title': 'The browser download failed.',\n 'entry.fail.provision-failed.fault': 'The cause is unclear from here.',\n 'entry.fail.provision-failed.action':\n 'Click Open to retry; if it keeps failing, show Details to the machine owner.',\n 'entry.fail.startup-missing-binary.title': 'The configured browser file does not exist.',\n 'entry.fail.startup-missing-binary.fault':\n 'This is about the browser path in the plugin configuration.',\n 'entry.fail.startup-missing-binary.action':\n 'Fix browserPath in the browser plugin configuration, or clear it to use the automatic download.',\n 'entry.fail.startup-spawn-failed.title': 'The browser program could not be started.',\n 'entry.fail.startup-spawn-failed.fault':\n 'This machine blocked or removed the browser file — often antivirus, sometimes permissions.',\n 'entry.fail.startup-spawn-failed.action':\n 'Allow-list the browser folder in your antivirus (or ask the machine owner about permissions), then click Open again.',\n 'entry.fail.startup-sandbox.title': 'The browser refused to start because of its OS sandbox.',\n 'entry.fail.startup-sandbox.fault': 'This is about OS restrictions on this machine.',\n 'entry.fail.startup-sandbox.action':\n 'On Ubuntu 23.10 and later this is usually AppArmor restricting user namespaces: add the AppArmor profile from Details for this browser, then click Open again.',\n 'entry.fail.startup-crashed.title': 'The browser exited during startup.',\n 'entry.fail.startup-crashed.fault': 'This is about the browser on this machine, not the page.',\n 'entry.fail.startup-crashed.action':\n 'Click Open to retry; if it keeps failing, show Details to the machine owner.',\n 'entry.fail.startup-timeout.title': 'The browser took too long to start.',\n 'entry.fail.startup-timeout.fault': 'This machine may be slow or overloaded.',\n 'entry.fail.startup-timeout.action':\n 'Click Open to retry; if it keeps failing, restart the machine or ask its owner.',\n 'entry.error': 'Browser action failed',\n};\n\nexport type BrowserTranslate = (\n key: BrowserKey,\n params?: Record,\n) => string;\n","export type BrowserFailureKind =\n | 'provision-no-network'\n | 'provision-no-disk-space'\n | 'provision-no-permission'\n | 'provision-missing-libs'\n | 'provision-failed'\n | 'startup-missing-binary'\n | 'startup-spawn-failed'\n | 'startup-sandbox'\n | 'startup-crashed'\n | 'startup-timeout';\n\nexport const BROWSER_FAILURE_KINDS: readonly BrowserFailureKind[] = [\n 'provision-no-network',\n 'provision-no-disk-space',\n 'provision-no-permission',\n 'provision-missing-libs',\n 'provision-failed',\n 'startup-missing-binary',\n 'startup-spawn-failed',\n 'startup-sandbox',\n 'startup-crashed',\n 'startup-timeout',\n];\n\nexport function isBrowserFailureKind(value: unknown): value is BrowserFailureKind {\n return typeof value === 'string' && (BROWSER_FAILURE_KINDS as readonly string[]).includes(value);\n}\n\nexport interface BrowserInstallProgress {\n readonly downloadedBytes: number;\n readonly totalBytes: number;\n}\n","import type { ReactElement, ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\n\nimport { color, space, text } from './tokens.stylex.js';\n\nconst styles = stylex.create({\n note: {\n margin: 0,\n fontSize: text.metaSize,\n lineHeight: text.metaLine,\n overflowWrap: 'anywhere',\n },\n inset: { paddingBlock: space.x2, paddingInline: space.x2 },\n muted: { color: color.muted },\n subtle: { color: color.subtle },\n danger: { color: color.danger },\n success: { color: color.success },\n warning: { color: color.warning },\n});\n\nexport type NoteTone = 'muted' | 'subtle' | 'danger' | 'success' | 'warning';\n\nexport function Note({\n tone = 'muted',\n inset = false,\n children,\n}: {\n readonly tone?: NoteTone;\n readonly inset?: boolean;\n readonly children: ReactNode;\n}): ReactElement {\n return (\n \n {children}\n

\n );\n}\n","import { useState, type ReactElement, type ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { Button } from '@deepseek-ai/dsh-client-ui-primitives';\nimport { Note } from './ds/note.js';\nimport { color, radius, space, text } from './ds/tokens.stylex.js';\n\nconst styles = stylex.create({\n root: {\n display: 'grid',\n gap: space.x3,\n justifyItems: 'start',\n width: '100%',\n },\n progress: {\n display: 'grid',\n gap: space.x1,\n width: '100%',\n color: color.muted,\n fontSize: text.metaSize,\n lineHeight: text.metaLine,\n },\n bar: {\n width: '100%',\n height: '6px',\n accentColor: color.accent,\n },\n command: {\n margin: 0,\n width: '100%',\n boxSizing: 'border-box',\n paddingBlock: space.x2,\n paddingInline: space.x2,\n borderRadius: radius.sm,\n backgroundColor: color.hover,\n color: color.fg,\n fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Consolas, monospace',\n fontSize: text.metaSize,\n lineHeight: text.metaLine,\n whiteSpace: 'pre-wrap',\n overflowWrap: 'anywhere',\n },\n actions: {\n display: 'flex',\n gap: space.x2,\n flexWrap: 'wrap',\n },\n});\n\nexport type MissingPackagesAccess = 'root' | 'sudo' | 'none';\n\nexport interface MissingPackagesLabels {\n readonly missing: string;\n readonly manual: string;\n readonly install: string;\n readonly copy: string;\n readonly copied: string;\n}\n\nexport function formatProgressMiB(bytes: number): string {\n return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;\n}\n\nexport function ProgressLine({\n percent,\n label,\n}: {\n readonly percent: number;\n readonly label: string;\n}): ReactElement {\n const value = Math.max(0, Math.min(100, percent));\n return (\n
\n \n {label}\n
\n );\n}\n\nexport function MissingPackages({\n command,\n access,\n installing,\n busy = false,\n onInstall,\n labels,\n children,\n}: {\n readonly command: string;\n readonly access: MissingPackagesAccess;\n readonly installing?: { readonly percent: number; readonly label: string } | undefined;\n readonly busy?: boolean;\n readonly onInstall: () => void;\n readonly labels: MissingPackagesLabels;\n readonly children?: ReactNode;\n}): ReactElement {\n const [copied, setCopied] = useState(false);\n const copy = (): void => {\n void navigator.clipboard?.writeText(command).then(() => setCopied(true));\n };\n return (\n
\n {installing === undefined ? (\n {labels.missing}\n ) : (\n \n )}\n {access === 'none' && installing === undefined ? (\n <>\n {labels.manual}\n
{command}
\n \n ) : null}\n
\n {access !== 'none' && installing === undefined ? (\n \n ) : null}\n {access === 'none' ? (\n \n ) : null}\n {children}\n
\n
\n );\n}\n","import { useCallback, useRef, useState, type ReactElement } from 'react';\n\nimport {\n isBrowserFailureKind,\n type BrowserFailureKind,\n type BrowserInstallProgress,\n} from '../failure-kinds.js';\nimport {\n MissingPackages,\n type MissingPackagesAccess,\n} from '../../../client/src/client/missing-packages.js';\nimport type { BrowserTranslate } from './locale.js';\n\nexport interface BrowserFailure {\n readonly message: string;\n readonly code?: string;\n readonly detail?: string;\n readonly packages?: readonly string[];\n}\n\nexport class BrowserApiError extends Error {\n readonly code?: string;\n readonly detail?: string;\n readonly packages?: readonly string[];\n\n constructor(message: string, code?: string, detail?: string, packages?: readonly string[]) {\n super(message);\n this.name = 'BrowserApiError';\n if (code !== undefined) this.code = code;\n if (detail !== undefined) this.detail = detail;\n if (packages !== undefined) this.packages = packages;\n }\n}\n\nexport function readFailure(cause: unknown): BrowserFailure {\n if (cause instanceof BrowserApiError)\n return {\n message: cause.message,\n ...(cause.code === undefined ? {} : { code: cause.code }),\n ...(cause.detail === undefined ? {} : { detail: cause.detail }),\n ...(cause.packages === undefined ? {} : { packages: cause.packages }),\n };\n return { message: cause instanceof Error ? cause.message : String(cause) };\n}\n\ninterface InstallState {\n readonly access?: MissingPackagesAccess;\n readonly state?: 'installing' | 'installed' | 'failed';\n readonly percent?: number;\n readonly text?: string;\n}\n\nconst INSTALL_ENDPOINT = './api/browser/install-packages';\n\nfunction BrowserMissingLibs({\n packages,\n t,\n onRetry,\n}: {\n readonly packages: readonly string[];\n readonly t: BrowserTranslate;\n readonly onRetry?: (() => void) | undefined;\n}): ReactElement {\n const [install, setInstall] = useState({});\n const [busy, setBusy] = useState(false);\n const [error, setError] = useState();\n const retried = useRef(false);\n const read = useCallback(async (): Promise => {\n const response = await fetch(INSTALL_ENDPOINT, { cache: 'no-store' });\n const next = (await response.json()) as InstallState;\n setInstall(next);\n return next;\n }, []);\n const resource = useCallback(\n (node: HTMLDivElement | null): void => {\n if (node === null) return;\n void read().catch(() => undefined);\n },\n [read],\n );\n const poll = (): void => {\n void read()\n .then((next) => {\n if (next.state === 'installing') {\n setTimeout(poll, 1000);\n return;\n }\n if (next.state === 'installed' && !retried.current) {\n retried.current = true;\n onRetry?.();\n }\n })\n .catch((cause: unknown) => setError(String(cause)));\n };\n const start = (): void => {\n setBusy(true);\n setError(undefined);\n void fetch(INSTALL_ENDPOINT, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ authorize: true, packages }),\n })\n .then(async (response) => {\n if (!response.ok) throw new Error(((await response.json()) as { error?: string }).error);\n poll();\n })\n .catch((cause: unknown) => setError(String(cause)))\n .finally(() => setBusy(false));\n };\n const installing = install.state === 'installing';\n return (\n
\n {install.state === 'failed' && install.text !== undefined ? (\n
{install.text}
\n ) : null}\n {error === undefined ? null :
{error}
}\n \n
\n );\n}\n\nexport function BrowserFailureNotice({\n failure,\n t,\n onRetry,\n}: {\n readonly failure: BrowserFailure;\n readonly t: BrowserTranslate;\n readonly onRetry?: (() => void) | undefined;\n}): ReactElement | null {\n if (!isBrowserFailureKind(failure.code)) return null;\n const kind: BrowserFailureKind = failure.code;\n return (\n
\n
{t(`entry.fail.${kind}.title`)}
\n
{t(`entry.fail.${kind}.fault`)}
\n {kind === 'provision-missing-libs' && (failure.packages?.length ?? 0) > 0 ? (\n \n ) : (\n
{t(`entry.fail.${kind}.action`)}
\n )}\n {failure.detail === undefined || failure.detail === '' ? null : (\n
\n {t('entry.fail.details')}\n
{failure.detail}
\n
\n )}\n
\n );\n}\n\nfunction formatMiB(bytes: number): string {\n return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;\n}\n\nexport function BrowserProvisionProgress({\n progress,\n t,\n}: {\n readonly progress: BrowserInstallProgress;\n readonly t: BrowserTranslate;\n}): ReactElement {\n if (progress.totalBytes <= 0)\n return (\n
\n {t('entry.provision.preparing')}\n
\n );\n const percent = Math.max(\n 0,\n Math.min(99, Math.floor((progress.downloadedBytes / progress.totalBytes) * 100)),\n );\n return (\n
\n \n \n {t('entry.provision.downloading', {\n percent: String(percent),\n downloaded: formatMiB(progress.downloadedBytes),\n total: formatMiB(progress.totalBytes),\n })}\n \n
\n );\n}\n","import * as native from '@deepseek-ai/dsh-client-ui-primitives';\nimport { useId, useLayoutEffect, type CSSProperties, type RefObject } from 'react';\n\nconst useLegacyPosition = 'useAnchoredPosition' in native ? native.useAnchoredPosition : undefined;\n\nexport function useAnchoredPanel({\n open,\n anchorRef,\n panelRef,\n gap,\n margin,\n matchWidth = false,\n}: {\n open: boolean;\n anchorRef: RefObject;\n panelRef: RefObject;\n gap: number;\n margin: number;\n matchWidth?: boolean;\n}): CSSProperties {\n const position = useLegacyPosition?.({ open, anchorRef, panelRef, gap, margin });\n const id = useId();\n const name = `--bh-panel-${id.replace(/[^a-zA-Z0-9_-]/gu, '')}`;\n useLayoutEffect(() => {\n const anchor = anchorRef.current;\n if (useLegacyPosition !== undefined || !open || anchor === null) return;\n const previous = anchor.style.getPropertyValue('anchor-name');\n const priority = anchor.style.getPropertyPriority('anchor-name');\n anchor.style.setProperty('anchor-name', name);\n return () => anchor.style.setProperty('anchor-name', previous, priority);\n }, [open, anchorRef, name]);\n if (useLegacyPosition !== undefined) {\n return {\n ...position,\n ...(matchWidth ? { width: anchorRef.current?.getBoundingClientRect().width ?? 200 } : {}),\n visibility: position === null ? 'hidden' : undefined,\n };\n }\n return {\n position: 'fixed',\n positionAnchor: name,\n top: `max(${margin}px, var(--dsh-frame-overlay-top, ${margin}px), calc(anchor(bottom) + ${gap}px))`,\n bottom: margin,\n left: `max(${margin}px, anchor(left))`,\n right: margin,\n alignSelf: 'start',\n justifySelf: 'start',\n margin: 0,\n height: 'fit-content',\n maxWidth: `calc(100vw - ${margin * 2}px)`,\n positionTryFallbacks: 'flip-block, flip-inline, flip-block flip-inline',\n ...(matchWidth ? { width: `min(anchor-size(width), calc(100vw - ${margin * 2}px))` } : {}),\n };\n}\n","import { useAnchoredPanel } from './anchored-panel.js';\nimport { border, color, radius, space, text } from './ds/tokens.stylex.js';\nimport { useId, useRef, useState, type KeyboardEvent, type ReactElement } from 'react';\nimport { createPortal } from 'react-dom';\nimport {\n IconChevronDownOutlineRegular,\n IconPlusOutlineRegular,\n Input,\n MenuSurface,\n useDismissOnOutsidePointer,\n} from '@deepseek-ai/dsh-client-ui-primitives';\n\nexport interface ComboboxOption {\n readonly value: string;\n readonly label: string;\n readonly hint?: string | undefined;\n readonly disabled?: boolean | undefined;\n}\n\nexport const COMBOBOX_CSS = `\n.bh-combobox { position: relative; flex: 1; min-width: 0; }\n.bh-combobox-input { display: flex; padding-right: ${space.x6}; }\n.bh-combobox input { width: 100%; text-overflow: ellipsis; }\n.bh-combobox input[readonly] { cursor: pointer; }\n.bh-combobox-toggle {\n position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px;\n display: flex; align-items: center; justify-content: center;\n border: 0; border-radius: ${radius.sm}; padding: 0;\n color: var(--dsw-alias-label-secondary); background: transparent; cursor: pointer;\n}\n.bh-combobox-toggle:hover { background: var(--dsw-alias-interactive-bg-hover); }\n.bh-combobox-toggle:disabled { opacity: 0.5; cursor: default; }\n.bh-combobox-list {\n position: fixed; z-index: 1100; box-sizing: border-box;\n background: var(--dsw-alias-bg-base);\n --dsw-elevation-stroke-color: var(--dsw-alias-border-l1);\n box-shadow: var(--dsw-elevation-prominent);\n}\n.bh-combobox-scroll > button {\n display: flex; align-items: baseline; justify-content: space-between; gap: ${space.x4};\n width: 100%; min-height: 34px; padding: ${space.x2} ${space.x3};\n border: 0; border-radius: ${radius.sm}; background: transparent;\n color: var(--dsw-alias-label-primary); text-align: left; font: inherit; font-size: ${text.bodySize}; line-height: ${text.bodyLine}; cursor: pointer;\n overflow-wrap: anywhere;\n}\n.bh-combobox-scroll > button[aria-selected=\"true\"] { font-weight: ${text.strong}; }\n.bh-combobox-scroll > button:disabled { color: var(--dsw-alias-label-tertiary); cursor: default; }\n.bh-combobox-scroll > button:not(:disabled):hover, .bh-combobox-scroll > button[data-active] {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n.bh-combobox-scroll { max-height: 260px; overflow-y: auto; padding: ${space.x2}; box-sizing: border-box; }\n.bh-combobox-hint { flex: none; color: var(--dsw-alias-label-secondary); font-size: ${text.metaSize}; font-weight: ${text.regular}; }\n.bh-combobox-empty { padding: ${space.x2} ${space.x3}; color: var(--dsw-alias-label-secondary); font-size: ${text.bodySize}; }\n.bh-combobox-scroll > .bh-combobox-action { justify-content: flex-start; align-items: center; gap: ${space.x2}; border-top: ${border.hairline} solid ${color.divider}; border-radius: 0; margin-top: ${space.x2}; }\n`;\n\nexport function Combobox({\n value,\n options,\n onSelect,\n label,\n toggleLabel,\n disabled = false,\n invalid = false,\n errorId,\n placeholder,\n emptyLabel,\n fallbackValue,\n createLabel,\n searchable = true,\n className,\n action,\n}: {\n readonly value: string;\n readonly options: readonly ComboboxOption[];\n readonly onSelect: (value: string) => void;\n readonly label: string;\n readonly toggleLabel: string;\n readonly disabled?: boolean;\n readonly invalid?: boolean;\n readonly errorId?: string;\n readonly placeholder?: string;\n readonly emptyLabel?: string;\n readonly fallbackValue?: string;\n readonly createLabel?: (query: string) => string;\n readonly searchable?: boolean;\n readonly className?: string;\n readonly action?: {\n readonly label: string;\n readonly onSelect: () => void;\n readonly disabled?: boolean;\n };\n}): ReactElement {\n const root = useRef(null);\n const panel = useRef(null);\n const listId = useId();\n const actionValue = `${listId}-action`;\n const [open, setOpen] = useState(false);\n const [query, setQuery] = useState(undefined);\n const [active, setActive] = useState(undefined);\n const current = value === '' && fallbackValue !== undefined ? fallbackValue : value;\n const display = options.find((option) => option.value === current)?.label ?? current;\n const trimmed = query?.trim() ?? '';\n const needle = trimmed.toLowerCase();\n const matches: ComboboxOption[] = options.filter((option) =>\n [option.label, option.value, option.hint ?? ''].some((text) =>\n text.toLowerCase().includes(needle),\n ),\n );\n const canCreate =\n createLabel !== undefined &&\n trimmed !== '' &&\n !options.some((option) => option.value === trimmed);\n const choices: ComboboxOption[] = canCreate\n ? [...matches, { value: trimmed, label: createLabel(trimmed) }]\n : matches;\n const shown =\n action === undefined\n ? choices\n : [...choices, { value: actionValue, label: action.label, disabled: action.disabled }];\n const enabled = shown.filter((option) => option.disabled !== true);\n const hasPopup = shown.length > 0 || (choices.length === 0 && emptyLabel !== undefined);\n const highlighted = shown.findIndex(\n (option) => option.value === active && option.disabled !== true,\n );\n const position = useAnchoredPanel({\n open,\n anchorRef: root,\n panelRef: panel,\n matchWidth: true,\n gap: 4,\n margin: 12,\n });\n useDismissOnOutsidePointer(root, open, setOpen, panel);\n\n const dismiss = (): void => {\n setOpen(false);\n setQuery(undefined);\n setActive(undefined);\n };\n const select = (next: string): void => {\n dismiss();\n if (action !== undefined && next === actionValue) action.onSelect();\n else onSelect(next);\n };\n const typedChoice = (): string | undefined => {\n if (query === undefined) return current === '' ? undefined : current;\n if (trimmed === '') return fallbackValue;\n if (createLabel !== undefined) return trimmed;\n const available = matches.filter((option) => option.disabled !== true);\n const exact = available.find(\n (option) => option.value.toLowerCase() === needle || option.label.toLowerCase() === needle,\n );\n return (exact ?? available[0])?.value;\n };\n const onKeyDown = (event: KeyboardEvent): void => {\n if (event.nativeEvent.isComposing) return;\n if (event.key === 'Escape') {\n if (!open) return;\n event.preventDefault();\n event.stopPropagation();\n dismiss();\n } else if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n event.preventDefault();\n setOpen(true);\n if (enabled.length === 0) return;\n const offset = event.key === 'ArrowDown' ? 1 : -1;\n const at = enabled.findIndex((option) => option.value === active);\n const next =\n enabled[\n at < 0\n ? offset === 1\n ? 0\n : enabled.length - 1\n : (at + offset + enabled.length) % enabled.length\n ];\n setActive(next?.value);\n const index = shown.findIndex((option) => option.value === next?.value);\n document.getElementById(`${listId}-${index}`)?.scrollIntoView?.({ block: 'nearest' });\n } else if (event.key === 'Enter' && open) {\n event.preventDefault();\n const choice = shown[highlighted]?.value ?? typedChoice();\n if (choice === undefined) dismiss();\n else select(choice);\n }\n };\n\n return (\n \n = 0 ? `${listId}-${highlighted}` : undefined\n }\n aria-invalid={invalid}\n aria-describedby={invalid ? errorId : undefined}\n value={query ?? display}\n placeholder={placeholder}\n disabled={disabled}\n autoComplete=\"off\"\n readOnly={!searchable}\n data-searchable={searchable || undefined}\n onFocus={(event) => {\n if (searchable) event.currentTarget.select();\n setOpen(true);\n }}\n onClick={() => setOpen(true)}\n onChange={(event) => {\n setQuery(event.target.value);\n setActive(undefined);\n setOpen(true);\n }}\n onBlur={dismiss}\n onKeyDown={onKeyDown}\n />\n event.preventDefault()}\n onClick={() => {\n if (open) dismiss();\n else {\n root.current?.querySelector('input')?.focus();\n setOpen(true);\n }\n }}\n >\n \n \n {open && !disabled && hasPopup\n ? createPortal(\n \n
\n {choices.length === 0 && emptyLabel !== undefined ? (\n
{emptyLabel}
\n ) : null}\n {shown.map((option, index) => (\n event.preventDefault()}\n onMouseEnter={() => {\n if (option.disabled !== true) setActive(option.value);\n }}\n onClick={() => select(option.value)}\n >\n {option.value === actionValue ? : null}\n {option.label}\n {option.hint === undefined ? null : (\n {option.hint}\n )}\n \n ))}\n
\n ,\n document.body,\n )\n : null}\n \n );\n}\n","import type { ReactElement } from 'react';\n\nimport { Combobox } from '../../../client/src/client/combobox.js';\nimport type { BrowserTranslate } from './locale.js';\n\nexport function ProfileCombobox({\n value,\n profiles,\n disabled,\n invalid,\n errorId,\n onSelect,\n t,\n}: {\n readonly value: string;\n readonly profiles: readonly string[];\n readonly disabled: boolean;\n readonly invalid: boolean;\n readonly errorId: string;\n readonly onSelect: (name: string) => void;\n readonly t: BrowserTranslate;\n}): ReactElement {\n const names = [...new Set(['default', ...profiles, value === '' ? 'default' : value])];\n return (\n ({ value: name, label: name }))}\n onSelect={onSelect}\n label={t('entry.profile.label')}\n toggleLabel={t('entry.profile.choose')}\n disabled={disabled}\n invalid={invalid}\n errorId={errorId}\n fallbackValue=\"default\"\n createLabel={(name) => t('entry.profile.create', { name })}\n />\n );\n}\n","import { BUBBLE_SURFACES, readable } from '@botharness/host-client/shared/bot-name-color';\nimport { space } from './ds/tokens.stylex.js';\nimport { panelMaterials, validTargetId } from './appearance-panels.js';\nimport { appearanceMaterials } from './appearance-materials.js';\nimport {\n APPEARANCE_KEY,\n APPEARANCE_PRIMARY,\n Appearance,\n type AppearanceSnapshot,\n} from './appearance.js';\nimport { NATIVE_LIGHT, NATIVE_DARK } from './appearance-native-tokens.js';\nexport const APPEARANCE_CLASS = 'bh-appearance-scope';\nexport function appearanceCss(snapshot: AppearanceSnapshot): string {\n const { config, mode } = snapshot;\n const selected = config.modes[mode];\n const primary = selected.primary ?? APPEARANCE_PRIMARY[selected.preset][mode];\n const materials = appearanceMaterials(selected, mode);\n const tokens: Record = {\n ...NATIVE_LIGHT,\n ...(mode === 'dark' ? NATIVE_DARK : {}),\n };\n for (const part of ['header', 'body'] as const) {\n const material = materials[part];\n tokens[`--bh-global-${part}-fill`] =\n `color-mix(in srgb, ${material.color} ${material.opacity}%, transparent)`;\n tokens[`--bh-global-${part}-blur`] = `${material.blur}px`;\n }\n tokens['--dsw-alias-state-business-primary'] = primary;\n tokens['--dsw-alias-link'] = readable(primary, BUBBLE_SURFACES[mode].surface, 4.6);\n tokens['--dsw-alias-state-business-secondary'] =\n `color-mix(in srgb, ${primary} 45%, transparent)`;\n tokens['--dsw-alias-state-business-tertiary'] = `color-mix(in srgb, ${primary} 14%, transparent)`;\n tokens['--dsw-specific-sidebar-nav-item-active'] =\n `color-mix(in srgb, ${primary} 14%, transparent)`;\n return `.bh-root,.bh-workspace-mount[data-workspace-enabled],.${APPEARANCE_CLASS},[data-bh-appearance-owned]{color:var(--dsw-alias-label-primary);color-scheme:${mode};${Object.entries(\n tokens,\n )\n .map(([k, v]) => `${k}:${v}`)\n .join(\n ';',\n )}}:root [data-bh-appearance-owned][data-menu-material],:root .${APPEARANCE_CLASS}[data-menu-material],:root .${APPEARANCE_CLASS} [data-menu-material]{--dsw-elevation-stroke-color:var(--dsw-alias-border-${mode === 'dark' ? 'l3' : 'l4'})}${materialCss()}${panelCss(snapshot)}`;\n}\n\nexport function mountAppearance(owner: Appearance): () => void {\n const style = document.createElement('style');\n style.dataset.plugin = '@botharness/ui';\n style.dataset.pluginCss = '@botharness/ui/appearance';\n const update = () => {\n style.textContent = appearanceCss(owner.getSnapshot());\n style.dataset.bhAppearance = owner.getSnapshot().mode;\n document.documentElement.dataset.bhAppearance = owner.getSnapshot().mode;\n };\n const media = window.matchMedia('(prefers-color-scheme: dark)');\n const onStorage = (event: StorageEvent) => {\n if (event.key === APPEARANCE_KEY || event.key === null) owner.refresh();\n };\n update();\n document.head.appendChild(style);\n const off = owner.subscribe(update);\n media.addEventListener('change', owner.refresh);\n window.addEventListener('storage', onStorage);\n return () => {\n off();\n style.remove();\n delete document.documentElement.dataset.bhAppearance;\n media.removeEventListener('change', owner.refresh);\n window.removeEventListener('storage', onStorage);\n };\n}\n\nfunction materialCss(): string {\n const scope = ':root .bh-workspace-mount[data-workspace-enabled]';\n return `\n${scope} .bh-dock-theme { --dv-group-view-background-color:transparent; --dv-tabs-and-actions-container-background-color:transparent; --dv-activegroup-visiblepanel-tab-background-color:transparent; --dv-inactivegroup-visiblepanel-tab-background-color:transparent; --dv-activegroup-hiddenpanel-tab-background-color:transparent; --dv-inactivegroup-hiddenpanel-tab-background-color:transparent; }\n${scope} .bh-root, ${scope} .bh-workspace-rail { background:transparent; }\n${scope} .dv-tabs-and-actions-container, ${scope} .bh-channel-session-header { background:var(--bh-global-header-fill); backdrop-filter:blur(var(--bh-global-header-blur)); }\n${scope} [data-appearance-header] { background:var(--bh-global-header-fill); backdrop-filter:blur(var(--bh-global-header-blur)); }\n${scope} .bh-channel-subpanel-body { display:flex; flex-direction:column; flex:1; min-height:0; min-width:0; overflow:auto; }\n${scope} .bh-channel-subpanel-body > section { flex:1; min-height:0; }\n${scope} .bh-memory-commit-view { display:flex; flex-direction:column; padding:0; }\n${scope} .bh-memory-commit-header { margin:0; flex-shrink:0; }\n${scope} .bh-memory-detail-body { flex:1; padding:${space.x3} ${space.x4}; }\n${scope} [data-appearance-body], ${scope} .dv-content-container { background:var(--bh-global-body-fill); backdrop-filter:blur(var(--bh-global-body-blur)); }\n`;\n}\n\nfunction panelCss({ config, mode }: AppearanceSnapshot): string {\n return Object.keys(config.modes[mode].panels ?? {})\n .filter(validTargetId)\n .map((id) => {\n const material = panelMaterials(config.modes[mode], mode, id);\n const scope = `:root .bh-workspace-mount[data-workspace-enabled] .dv-groupview:has(> .dv-tabs-and-actions-container .dv-active-tab [data-dock-header=\"${id.slice(5)}\"])`;\n return (['header', 'body'] as const)\n .map(\n (part) =>\n `${scope} > ${part === 'header' ? '.dv-tabs-and-actions-container' : '.dv-content-container'}, :root .bh-workspace-mount[data-workspace-enabled] [data-appearance-${part}=\"${id.slice(5)}\"] { background:color-mix(in srgb, ${material[part].color} ${material[part].opacity}%, transparent); backdrop-filter:blur(${material[part].blur}px); }`,\n )\n .join('');\n })\n .join('');\n}\n","import { Modal as NativeModal, Menu as NativeMenu } from '@deepseek-ai/dsh-client-ui-primitives';\nimport type { ComponentProps, RefObject } from 'react';\nimport { APPEARANCE_CLASS } from './appearance-scope.js';\nexport function Modal(props: ComponentProps) {\n return (\n \n );\n}\ntype MenuProps = Omit, 'getAnchorRect'> & {\n anchorRef?: RefObject;\n};\n\nexport function Menu(props: MenuProps) {\n const { anchorRef } = props;\n const legacyAnchor =\n anchorRef === undefined\n ? {}\n : {\n getAnchorRect: () => anchorRef.current?.getBoundingClientRect() ?? null,\n };\n return (\n \n );\n}\n","import { Menu } from '../appearance-primitives.js';\nimport type { ComponentProps } from 'react';\nimport { createPortal } from 'react-dom';\nimport * as stylex from '@stylexjs/stylex';\n\nimport { useMountedResource } from '../mounted-resource.js';\nimport { border, space } from './tokens.stylex.js';\n\nexport interface MenuPoint {\n readonly x: number;\n readonly y: number;\n}\n\nexport function pointerMenuPosition(\n point: MenuPoint,\n width: number,\n height: number,\n viewport: { width: number; height: number; top: number },\n) {\n const margin = Number.parseFloat(space.x4);\n return {\n x: Math.max(margin, Math.min(point.x, viewport.width - width - margin)),\n y: Math.max(\n Math.max(margin, viewport.top),\n Math.min(point.y, viewport.height - height - margin),\n ),\n };\n}\n\ntype PointerMenuProps = Omit<\n ComponentProps,\n 'open' | 'portal' | 'anchorRef' | 'side' | 'align' | 'className'\n> & { point: MenuPoint; container?: Element; align?: 'start' | 'end' };\n\nexport function PointerMenu({\n point,\n container = document.body,\n align = 'start',\n ...props\n}: PointerMenuProps) {\n const mount = useMountedResource(\n (node) => {\n const menu = node.querySelector('[role=\"menu\"]');\n if (!menu) return;\n const originalMaxWidth = Number.parseFloat(getComputedStyle(menu).maxWidth);\n const originalMinWidth = Number.parseFloat(getComputedStyle(menu).minWidth);\n const place = () => {\n const scale = node.getBoundingClientRect();\n if (!scale.width || !scale.height) return;\n const cssZoom =\n 'currentCSSZoom' in node && typeof node.currentCSSZoom === 'number'\n ? node.currentCSSZoom\n : undefined;\n const scaleX = cssZoom ?? scale.width;\n const scaleY = cssZoom ?? scale.height;\n const root = document.documentElement;\n const clearance = root.hasAttribute('data-fullscreen')\n ? 0\n : Number.parseFloat(\n getComputedStyle(root).getPropertyValue('--dsh-frame-top-clearance'),\n ) || 0;\n const margin = Number.parseFloat(space.x4);\n const availableWidth = Math.max(0, innerWidth - 2 * margin) / scaleX;\n menu.style.minWidth = `${Math.min(originalMinWidth || 0, availableWidth)}px`;\n menu.style.maxWidth = `${Math.min(originalMaxWidth || Infinity, availableWidth)}px`;\n menu.style.maxHeight = `${Math.max(0, innerHeight - Math.max(margin, clearance) - margin) / scaleY}px`;\n const box = menu.getBoundingClientRect();\n const desired = pointerMenuPosition(\n { x: align === 'end' ? point.x - box.width : point.x, y: point.y },\n box.width,\n box.height,\n {\n width: innerWidth,\n height: innerHeight,\n top: clearance,\n },\n );\n const left = Number.parseFloat(node.style.left) || 0;\n const top = Number.parseFloat(node.style.top) || 0;\n node.style.left = `${left + (desired.x - box.left) / scaleX}px`;\n node.style.top = `${top + (desired.y - box.top) / scaleY}px`;\n };\n place();\n const observer =\n typeof ResizeObserver === 'undefined' ? undefined : new ResizeObserver(place);\n observer?.observe(menu);\n observer?.observe(node);\n window.addEventListener('resize', place);\n window.addEventListener('scroll', place, true);\n return () => {\n observer?.disconnect();\n window.removeEventListener('resize', place);\n window.removeEventListener('scroll', place, true);\n };\n },\n [point.x, point.y, align],\n );\n return createPortal(\n \n \n ,\n container,\n );\n}\n\nconst styles = stylex.create({\n origin: {\n position: 'fixed',\n left: 0,\n top: 0,\n width: border.hairline,\n height: border.hairline,\n zIndex: 1100,\n pointerEvents: 'none',\n },\n menu: { pointerEvents: 'auto' },\n});\n","import type { ButtonHTMLAttributes, InputHTMLAttributes, ReactElement, ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\n\nimport { actionColor, border, color, radius, size, space, text } from './tokens.stylex.js';\n\nexport const pillStyles = stylex.create({\n pill: {\n display: 'inline-flex',\n alignItems: 'center',\n gap: space.x2,\n maxWidth: '100%',\n height: size.icon,\n paddingInline: `${space.x4} ${space.x3}`,\n borderWidth: 0,\n borderRadius: radius.sm,\n backgroundColor: { default: actionColor.secondary, ':hover': actionColor.hover },\n color: color.fg,\n fontFamily: 'inherit',\n fontSize: text.bodySize,\n lineHeight: text.bodyLine,\n whiteSpace: 'nowrap',\n cursor: { default: 'pointer', ':disabled': 'default' },\n opacity: { default: 1, ':disabled': 0.5 },\n outline: { default: 'none', ':focus-visible': `${border.focus} solid ${color.accent}` },\n outlineOffset: '1px',\n },\n});\n\nexport function PillButton({\n children,\n ...rest\n}: { readonly children: ReactNode } & Omit<\n ButtonHTMLAttributes,\n 'className' | 'style' | 'type' | 'children'\n>): ReactElement {\n return (\n \n );\n}\n\nexport function PillFileButton({\n children,\n ...input\n}: { readonly children: ReactNode } & Omit<\n InputHTMLAttributes,\n 'className' | 'style' | 'type' | 'children' | 'hidden'\n>): ReactElement {\n return (\n \n );\n}\n","import { PointerMenu, type MenuPoint } from './pointer-menu.js';\nimport { useMountedResource } from '../mounted-resource.js';\nimport { useRef, useState, type ReactElement, type ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { IconChevronDownOutlineRegular } from '@deepseek-ai/dsh-client-ui-primitives';\n\nimport { pillStyles } from './pill-button.js';\nimport { color, space } from './tokens.stylex.js';\n\nconst styles = stylex.create({\n label: {\n minWidth: 0,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n },\n chevron: {\n display: 'inline-flex',\n flexShrink: 0,\n color: color.muted,\n },\n});\n\nexport interface SelectOption {\n readonly value: Value;\n readonly label: ReactNode;\n}\n\nexport interface SelectProps {\n readonly label: string;\n readonly value: Value;\n readonly options: readonly SelectOption[];\n readonly onChange: (value: Value) => void;\n readonly disabled?: boolean;\n readonly align?: 'start' | 'end';\n readonly autoFocus?: boolean;\n readonly reselect?: boolean;\n}\n\nexport function Select({\n label,\n value,\n options,\n onChange,\n disabled = false,\n align = 'end',\n autoFocus = false,\n reselect = false,\n}: SelectProps): ReactElement {\n const [open, setOpen] = useState(false);\n const [point, setPoint] = useState();\n const trigger = useRef(null);\n const active = open && !disabled;\n const mount = useMountedResource(\n (node) => {\n trigger.current = node;\n if (!active)\n return () => {\n trigger.current = null;\n };\n const place = () => {\n const rect = node.getBoundingClientRect();\n const scale = node.offsetHeight > 0 ? rect.height / node.offsetHeight : 1;\n const next = {\n x: align === 'end' ? rect.right : rect.left,\n y: rect.bottom + Number.parseFloat(space.x2) * scale,\n };\n setPoint((previous) => (previous?.x === next.x && previous.y === next.y ? previous : next));\n };\n place();\n const resize = typeof ResizeObserver === 'undefined' ? undefined : new ResizeObserver(place);\n resize?.observe(node);\n resize?.observe(document.documentElement);\n const observer = new MutationObserver(place);\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['style', 'data-fullscreen'],\n });\n window.addEventListener('resize', place);\n window.addEventListener('scroll', place, true);\n return () => {\n trigger.current = null;\n resize?.disconnect();\n observer.disconnect();\n window.removeEventListener('resize', place);\n window.removeEventListener('scroll', place, true);\n };\n },\n [active, align],\n );\n const close = () => {\n const button = trigger.current;\n const menu = document.activeElement?.closest('[data-pointer-menu]');\n setOpen(false);\n setPoint(undefined);\n queueMicrotask(() => {\n const focused = document.activeElement;\n if (\n button?.isConnected &&\n !button.disabled &&\n (focused === document.body || (focused !== null && menu?.contains(focused)))\n )\n button.focus({ preventScroll: true });\n });\n };\n const current = options.find((option) => option.value === value);\n return (\n <>\n {\n if (active) event.stopPropagation();\n }}\n onClick={() => {\n if (active) close();\n else setOpen(true);\n }}\n {...stylex.props(pillStyles.pill)}\n >\n {current?.label}\n \n \n \n \n {active && point ? (\n }\n items={options.map((option) => ({ id: option.value, label: option.label }))}\n selectedId={value}\n onSelect={(id) => {\n close();\n const next = options.find((option) => option.value === id);\n if (next !== undefined && (reselect || next.value !== value)) onChange(next.value);\n }}\n onClose={close}\n />\n ) : null}\n \n );\n}\n","import { useId, type ReactElement, type ReactNode, type Ref } from 'react';\nimport * as stylex from '@stylexjs/stylex';\n\nimport { border, color, space, text } from './tokens.stylex.js';\n\nconst NARROW = '@media (max-width: 648px)';\nconst COMPACT = '@container bh-settings (max-width: 480px)';\n\nconst styles = stylex.create({\n rows: {\n display: 'flex',\n flexDirection: 'column',\n minWidth: 0,\n },\n section: {\n display: 'flex',\n flexDirection: 'column',\n minWidth: 0,\n paddingTop: { default: space.x5, ':first-child': 0 },\n },\n sectionHead: {\n display: 'flex',\n flexDirection: 'column',\n gap: space.x1,\n paddingBottom: space.x2,\n },\n sectionTitle: {\n margin: 0,\n color: color.muted,\n fontSize: text.metaSize,\n lineHeight: text.metaLine,\n fontWeight: text.strong,\n },\n row: {\n display: 'flex',\n alignItems: { default: 'center', [NARROW]: 'stretch', [COMPACT]: 'stretch' },\n flexDirection: { default: 'row', [NARROW]: 'column', [COMPACT]: 'column' },\n gap: { default: space.x4, [NARROW]: space.x3, [COMPACT]: space.x3 },\n minWidth: 0,\n paddingBlock: space.x4,\n borderBottomWidth: border.hairline,\n borderBottomStyle: 'solid',\n borderBottomColor: { default: color.divider, ':last-child': 'transparent' },\n },\n text: {\n display: 'flex',\n flexDirection: 'column',\n gap: space.x1,\n flexGrow: 1,\n flexShrink: 1,\n flexBasis: 0,\n minWidth: 0,\n },\n title: {\n color: color.fg,\n fontSize: text.titleSize,\n lineHeight: text.titleLine,\n fontWeight: text.strong,\n overflowWrap: 'anywhere',\n },\n description: {\n color: color.muted,\n fontSize: text.metaSize,\n lineHeight: text.metaLine,\n overflowWrap: 'anywhere',\n },\n control: {\n display: 'flex',\n flexWrap: 'wrap',\n alignItems: 'center',\n justifyContent: { default: 'flex-end', [NARROW]: 'flex-start', [COMPACT]: 'flex-start' },\n gap: space.x3,\n flexShrink: 0,\n minWidth: 0,\n maxWidth: { default: '60%', [NARROW]: '100%', [COMPACT]: '100%' },\n },\n value: {\n color: color.muted,\n fontSize: text.bodySize,\n lineHeight: text.bodyLine,\n textAlign: 'end',\n overflowWrap: 'anywhere',\n },\n});\n\nexport function SettingsRows({\n children,\n rootRef,\n}: {\n readonly children: ReactNode;\n readonly rootRef?: Ref | undefined;\n}): ReactElement {\n return (\n
\n {children}\n
\n );\n}\n\nexport interface SettingsSectionProps {\n readonly title?: ReactNode;\n readonly description?: ReactNode;\n readonly children: ReactNode;\n}\n\nexport function SettingsSection({\n title,\n description,\n children,\n}: SettingsSectionProps): ReactElement {\n const id = useId();\n return (\n \n {title === undefined ? null : (\n
\n

\n {title}\n

\n {description === undefined ? null : (\n
{description}
\n )}\n
\n )}\n {children}\n \n );\n}\n\nexport interface SettingsRowProps {\n readonly title: ReactNode;\n readonly description?: ReactNode;\n readonly control?: ReactNode;\n readonly children?: ReactNode;\n readonly rootRef?: Ref | undefined;\n readonly data?: Readonly>;\n}\n\nexport function SettingsRow({\n title,\n description,\n control,\n children,\n rootRef,\n data,\n}: SettingsRowProps): ReactElement {\n const id = useId();\n const titleId = `${id}-title`;\n const descriptionId = `${id}-description`;\n return (\n \n
\n
\n {title}\n
\n {description === undefined ? null : (\n
\n {description}\n
\n )}\n {children}\n
\n {control === undefined ? null :
{control}
}\n \n );\n}\n\nexport function SettingsValue({ children }: { readonly children: ReactNode }): ReactElement {\n return {children};\n}\n","import { useMemo, useState, useSyncExternalStore, type ReactElement } from 'react';\nimport { Note } from '../../../client/src/client/ds/note.js';\nimport { Select } from '../../../client/src/client/ds/select.js';\nimport { SettingsRow, SettingsRows } from '../../../client/src/client/ds/settings-row.js';\nimport type { BrowserClientContext } from './index.js';\nimport { LOCALE_NS, type BrowserTranslate } from './locale.js';\n\ninterface TargetScope {\n getSnapshot(): {\n status: string;\n writable: boolean;\n value:\n | {\n target?: 'local' | 'container' | 'extension' | 'daily-control' | 'profile-control';\n localDriver?: 'current' | 'agent-browser';\n containerDriver?: 'current' | 'agent-browser';\n }\n | undefined;\n };\n subscribe(listener: () => void): () => void;\n set(field: string, value: unknown): Promise;\n}\n\nfunction ConfigChoice({\n scope,\n field,\n value,\n writable,\n title,\n items,\n}: {\n scope: TargetScope;\n field: 'target' | 'localDriver' | 'containerDriver';\n value: string;\n writable: boolean;\n title: string;\n items: { id: string; label: string }[];\n}): ReactElement {\n const [saving, setSaving] = useState(false);\n const [error, setError] = useState();\n return (\n <>\n ({ value: item.id, label: item.label }))}\n disabled={!writable || saving}\n onChange={(id) => {\n setSaving(true);\n setError(undefined);\n void scope\n .set(field, id)\n .then(() => {\n if (scope.getSnapshot().value?.[field] !== id)\n throw new Error('Browser setting was not saved');\n })\n .catch((cause: unknown) => setError(String(cause)))\n .finally(() => setSaving(false));\n }}\n />\n }\n />\n {error === undefined ? null : {error}}\n \n );\n}\n\nexport function BrowserTargetSettings({\n scope,\n t,\n}: {\n scope: TargetScope;\n t: BrowserTranslate;\n}): ReactElement {\n const store = useMemo(\n () => ({\n subscribe: (listener: () => void) => scope.subscribe(listener),\n getSnapshot: () => scope.getSnapshot(),\n }),\n [scope],\n );\n const snapshot = useSyncExternalStore(store.subscribe, store.getSnapshot);\n const target = snapshot.value?.target ?? 'local';\n return (\n \n ({ id, label: t(`settings.${id}`) }))}\n />\n {target !== 'local' && target !== 'container' ? null : (\n ({\n id,\n label: t(`settings.driver.${id}`),\n }))}\n />\n )}\n \n );\n}\n\nexport function registerBrowserSettings(ctx: BrowserClientContext, t: BrowserTranslate): void {\n ctx.inject(['configForms', 'slots'], (settingsCtx) => {\n const native = settingsCtx as unknown as {\n configForms: { get(namespace: string): TargetScope };\n slots: {\n inject(name: string, callback: () => unknown): () => void;\n register(\n options: {\n name: string;\n id: string;\n order: number;\n label: () => string;\n locale: string;\n inject: () => { scope: TargetScope; t: BrowserTranslate };\n },\n component: typeof BrowserTargetSettings,\n ): () => void;\n };\n };\n const scope = native.configForms.get('botharness-browser');\n return native.slots.inject('botharness.settings.section', () =>\n native.slots.register(\n {\n name: 'botharness.settings.section',\n id: 'browser',\n order: 32,\n label: () => t('settings.section'),\n locale: LOCALE_NS,\n inject: () => ({ scope, t }),\n },\n BrowserTargetSettings,\n ),\n );\n });\n}\n","import { useCallback, useRef, useState, type ReactElement } from 'react';\nimport { Button, Input, Tag } from '@deepseek-ai/dsh-client-ui-primitives';\nimport { SidebarCardList, SidebarCardRow } from '../../../client/src/client/sidebar-card.js';\nimport type { BrowserTranslate } from './locale.js';\n\nimport type { ProfileView } from '../profile-control.js';\n\nexport function ProfileBrowserControl({\n slug,\n view,\n paused,\n enabled,\n t,\n refresh,\n}: {\n readonly slug: string | undefined;\n readonly view: ProfileView | undefined;\n readonly paused: boolean;\n readonly enabled: boolean;\n readonly t: BrowserTranslate;\n readonly refresh: () => void;\n}): ReactElement {\n const [pair, setPair] = useState<{ code: string; expiresAt: number } | undefined>();\n const [busy, setBusy] = useState(false);\n const [error, setError] = useState();\n const active = useRef(false);\n const sequence = useRef(0);\n const resource = useCallback((node: HTMLDivElement | null): void => {\n active.current = node !== null;\n if (node === null) sequence.current += 1;\n }, []);\n const invoke = (action: 'pair' | 'forget' | 'pause'): void => {\n if (slug === undefined || busy) return;\n const request = ++sequence.current;\n setBusy(true);\n setError(undefined);\n setPair(undefined);\n void fetch(action === 'pause' ? './api/browser/takeover' : `./api/browser/profile/${action}`, {\n method: 'POST',\n cache: 'no-store',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ slug, ...(action === 'pause' ? { active: !paused } : {}) }),\n })\n .then(async (response) => {\n const body = (await response.json()) as {\n ok: boolean;\n error?: string;\n code?: string;\n expiresAt?: number;\n };\n if (!response.ok || !body.ok) throw new Error(body.error ?? t('entry.error'));\n if (!active.current || sequence.current !== request) return;\n if (action === 'pair' && body.code !== undefined && body.expiresAt !== undefined)\n setPair({ code: body.code, expiresAt: body.expiresAt });\n })\n .catch((cause: unknown) => {\n if (active.current && sequence.current === request)\n setError(cause instanceof Error ? cause.message : t('entry.error'));\n })\n .finally(() => {\n if (active.current && sequence.current === request) {\n setBusy(false);\n refresh();\n }\n });\n };\n return (\n
\n \n \n {view?.paired !== true ? (\n {t('entry.chip.unpaired')}\n ) : view.connected ? (\n {t('entry.chip.connected')}\n ) : (\n {t('entry.chip.offline')}\n )}\n {paused ? {t('entry.chip.paused')} : null}\n \n }\n meta={\n <>\n {t('entry.profile.scope')}\n \n {view?.paired\n ? t(view.connected ? 'entry.profile.connected' : 'entry.profile.disconnected')\n : t('entry.view.noTabs')}\n {view?.connected ? ` · ${view.tabs}` : ''}\n \n \n }\n detail={\n
\n \n {t('entry.profile.install')}\n \n
\n invoke(view?.paired ? 'forget' : 'pair')}\n >\n {t(view?.paired ? 'entry.profile.forget' : 'entry.profile.pair')}\n \n {view?.connected ? (\n invoke('pause')}\n >\n {t(paused ? 'entry.view.resume' : 'entry.view.pause')}\n \n ) : null}\n
\n {view?.paired || pair === undefined ? null : (\n <>\n {t('entry.profile.instructions')}\n \n {location.origin}\n \n )}\n
\n }\n />\n
\n {error === undefined ? null : (\n
\n {error}\n
\n )}\n
\n );\n}\n","import { useCallback, useRef, useState, type ReactElement } from 'react';\nimport { Button, Tag } from '@deepseek-ai/dsh-client-ui-primitives';\nimport { SidebarCardList, SidebarCardRow } from '../../../client/src/client/sidebar-card.js';\nimport type { DailyView } from '../daily.js';\nimport type { BrowserTranslate } from './locale.js';\n\nexport function DailyBrowserControl({\n slug,\n view,\n enabled,\n paused,\n t,\n refresh,\n}: {\n readonly slug: string | undefined;\n readonly view: DailyView | null;\n readonly enabled: boolean;\n readonly paused: boolean;\n readonly t: BrowserTranslate;\n readonly refresh: () => void;\n}): ReactElement {\n const [busy, setBusy] = useState(false);\n const [error, setError] = useState();\n const mounted = useRef(false);\n const resource = useCallback((node: HTMLDivElement | null): void => {\n mounted.current = node !== null;\n }, []);\n const invoke = (action: 'connect' | 'grant' | 'return' | 'pause'): void => {\n if (busy || slug === undefined) return;\n setBusy(true);\n setError(undefined);\n void fetch(action === 'pause' ? './api/browser/takeover' : `./api/browser/daily/${action}`, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ slug, ...(action === 'pause' ? { active: !paused } : {}) }),\n })\n .then(async (response) => {\n const body = (await response.json()) as { ok: boolean; error?: string };\n if (!response.ok || !body.ok) throw new Error(body.error ?? t('entry.error'));\n })\n .catch((cause: unknown) => {\n if (mounted.current) setError(cause instanceof Error ? cause.message : t('entry.error'));\n })\n .finally(() => {\n if (mounted.current) {\n setBusy(false);\n refresh();\n }\n });\n };\n return (\n
\n \n \n {view === null || view.state === 'error' ? (\n {t('entry.chip.disconnected')}\n ) : view.state === 'connecting' ? (\n {t('entry.chip.connecting')}\n ) : view.state === 'confirm' ? (\n {t('entry.chip.confirm')}\n ) : (\n {t('entry.chip.controlled')}\n )}\n {paused && view?.state === 'controlled' ? (\n {t('entry.chip.paused')}\n ) : null}\n \n }\n meta={\n view === null || view.state === 'error' ? undefined : (\n \n {t(\n view.state === 'connecting'\n ? 'entry.daily.select'\n : view.state === 'confirm'\n ? 'entry.daily.confirm'\n : 'entry.daily.controlled',\n )}\n \n )\n }\n detail={\n
\n {view === null || view.state === 'error' || view.url === '' ? null : (\n <>\n {view.title || view.url}\n {view.url}\n \n )}\n \n {t('entry.daily.install')}\n \n
\n {view === null || view.state === 'error' ? (\n invoke('connect')}\n >\n {t('entry.daily.connect')}\n \n ) : (\n <>\n {view.state === 'confirm' ? (\n invoke('grant')}\n >\n {t('entry.daily.allow')}\n \n ) : null}\n {view.state === 'controlled' ? (\n invoke('pause')}\n >\n {t(paused ? 'entry.view.resume' : 'entry.view.pause')}\n \n ) : null}\n invoke('return')}\n >\n {t(\n view.state === 'connecting' ? 'entry.borrow.cancel' : 'entry.borrow.return',\n )}\n \n \n )}\n
\n
\n }\n />\n
\n {view?.error === undefined ? null : (\n
\n {view.error}\n
\n )}\n {error === undefined ? null : (\n
\n {error}\n
\n )}\n
\n );\n}\n","import { useCallback, useRef, useState, type ReactElement } from 'react';\nimport { Button, Input, Tag } from '@deepseek-ai/dsh-client-ui-primitives';\nimport { SidebarCardList, SidebarCardRow } from '../../../client/src/client/sidebar-card.js';\nimport type { BrowserTranslate } from './locale.js';\n\nexport interface BorrowedTabView {\n readonly title: string;\n readonly url: string;\n readonly expiresAt: number;\n}\n\nexport function BorrowedBrowser({\n slug,\n tab,\n enabled,\n t,\n refresh,\n}: {\n readonly slug: string | undefined;\n readonly tab: BorrowedTabView | null | undefined;\n readonly enabled: boolean;\n readonly t: BrowserTranslate;\n readonly refresh: () => void;\n}): ReactElement {\n const [pair, setPair] = useState<{ code: string; expiresAt: number } | undefined>();\n const [busy, setBusy] = useState(false);\n const [error, setError] = useState();\n const active = useRef(false);\n const sequence = useRef(0);\n const resource = useCallback((node: HTMLDivElement | null): void => {\n active.current = node !== null;\n if (node === null) sequence.current += 1;\n }, []);\n const invoke = (action: 'pair' | 'return'): void => {\n if (slug === undefined || busy) return;\n const request = ++sequence.current;\n setBusy(true);\n setError(undefined);\n setPair(undefined);\n void fetch(`./api/browser/borrow/${action}`, {\n method: 'POST',\n cache: 'no-store',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ slug }),\n })\n .then(async (response) => {\n const body = (await response.json()) as {\n ok: boolean;\n error?: string;\n code?: string;\n expiresAt?: number;\n };\n if (!response.ok || !body.ok) throw new Error(body.error ?? t('entry.error'));\n if (!active.current || sequence.current !== request) return;\n if (action === 'pair' && body.code !== undefined && body.expiresAt !== undefined)\n setPair({ code: body.code, expiresAt: body.expiresAt });\n })\n .catch((cause: unknown) => {\n if (active.current && sequence.current === request)\n setError(cause instanceof Error ? cause.message : t('entry.error'));\n })\n .finally(() => {\n if (active.current && sequence.current === request) {\n setBusy(false);\n refresh();\n }\n });\n };\n return (\n
\n \n {t('entry.chip.notShared')}\n ) : (\n {t('entry.chip.readOnly')}\n )\n }\n meta={{t(tab == null ? 'entry.borrow.none' : 'entry.borrow.readOnly')}}\n detail={\n
\n {tab == null ? null : (\n <>\n {tab.title || tab.url}\n {tab.url}\n \n )}\n invoke(tab == null ? 'pair' : 'return')}\n >\n {t(tab == null ? 'entry.borrow.pair' : 'entry.borrow.return')}\n \n {tab != null || pair === undefined ? null : (\n <>\n {t('entry.borrow.instructions')}\n \n {location.origin}\n {\n sequence.current += 1;\n setPair(undefined);\n invoke('return');\n }}\n >\n {t('entry.borrow.cancel')}\n \n \n )}\n
\n }\n />\n
\n {error === undefined ? null : (\n
\n {error}\n
\n )}\n
\n );\n}\n","export const STYLEX_CSS: string = '@bh-stylex-css';\n","import { border, color, radius, space, text } from '../../../client/src/client/ds/tokens.stylex.js';\nimport { COMBOBOX_CSS } from '../../../client/src/client/combobox.js';\nimport { STYLEX_CSS } from '../../../client/src/client/ds/stylex-css.js';\n\nexport const styles =\n COMBOBOX_CSS +\n `\n.bh-browser-access-control { position: relative; display: flex; align-items: center; }\n.bh-browser-borrow { display: grid; gap: ${space.x3}; font-size: ${text.metaSize}; }\n.bh-browser-borrow-title, .bh-browser-daily-install { color: var(--dsw-alias-label-primary); text-underline-offset: 3px; }\n.bh-browser-borrow-url { overflow-wrap: anywhere; }\n.bh-browser-borrow-url { color: var(--dsw-alias-label-secondary); }\n.bh-browser-access-power {\n display: flex; align-items: center; justify-content: center; width: 28px; height: 28px;\n padding: 0; border: 0; border-radius: ${radius.md}; background: transparent;\n color: var(--dsw-alias-label-secondary); cursor: pointer;\n}\n.bh-browser-access-power:hover { background: var(--dsw-alias-interactive-bg-hover); }\n.bh-browser-access-power[aria-pressed='true'] { color: var(--dsw-alias-state-business-primary); background: var(--dsw-alias-interactive-bg-hover); }\n.bh-browser-access-power:focus-visible { outline: ${border.focus} solid var(--dsw-alias-state-business-primary); outline-offset: 2px; }\n.bh-browser-access-power:disabled { opacity: 0.5; cursor: default; }\n.bh-browser-access-power.bh-access-failed { color: var(--dsw-alias-state-error-primary); }\n.bh-browser-access-error { order: -1; padding: 0 ${space.x2}; color: var(--dsw-alias-state-error-primary); font-size: ${text.metaSize}; line-height: ${text.metaLine}; white-space: nowrap; }\n\n.bh-browser-local { display: grid; gap: ${space.x3}; font-size: ${text.metaSize}; }\n.bh-browser-card-detail { display: grid; gap: ${space.x3}; justify-items: start; font-size: ${text.metaSize}; }\n.bh-browser-card-field { display: flex; align-items: center; justify-content: space-between; gap: ${space.x3}; width: 100%; color: var(--dsw-alias-label-secondary); }\n.bh-browser-card-field > span:first-child { flex: none; }\n.bh-browser-cards .bh-card-meta [role=\"status\"] { color: inherit; }\n.bh-browser-note { color: var(--dsw-alias-label-secondary); }\n.bh-browser-frame { display: block; width: 100%; border: ${border.hairline} solid ${color.divider}; border-radius: ${radius.md}; }\n.bh-browser-actions { display: flex; flex-wrap: wrap; gap: ${space.x3}; }\n.bh-browser-tab[aria-pressed=\"true\"] { background: var(--dsw-alias-interactive-bg-hover); }\n.bh-browser-tab[aria-current=\"true\"] .bh-browser-tab-title { font-weight: ${text.strong}; }\n.bh-browser-tab .bh-browser-tab-url { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.bh-browser-tabs .bh-card-main { padding: ${space.x3} ${space.x3}; }\n.bh-browser-error { color: var(--dsw-alias-state-error-primary); overflow-wrap: anywhere; }\n.bh-viewer-btn-content { display: inline-flex; align-items: center; gap: ${space.x2}; }\n@media (max-width: 560px) {\n [data-bh-viewer-btn-label] { display: none; }\n}\n.bh-browser-progress { display: grid; gap: ${space.x2}; color: var(--dsw-alias-label-secondary); }\n.bh-browser-progress-bar { width: 100%; height: 6px; accent-color: var(--dsw-alias-state-business-primary); }\n.bh-browser-failure { display: grid; gap: ${space.x2}; overflow-wrap: anywhere; }\n.bh-browser-failure-title { color: var(--dsw-alias-label-primary); font-weight: ${text.strong}; }\n.bh-browser-failure-fault, .bh-browser-failure-action { color: var(--dsw-alias-label-secondary); }\n.bh-browser-failure-details { color: var(--dsw-alias-label-secondary); }\n.bh-browser-failure-details pre { overflow-x: auto; white-space: pre-wrap; font-size: ${text.metaSize}; }\n` +\n STYLEX_CSS;\n","/**\n * Vendored Access Power glyph from lucide-react@1.46.0 (ISC, ADR-0032).\n *\n * Source: the lucide `dist/esm/icons/power.mjs` glyph data. Vendored at the\n * stock 2-unit stroke without adding a `lucide-react` runtime dependency.\n *\n * ISC License\n *\n * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT).\n * All other copyright (c) for Lucide are held by Lucide Contributors 2022.\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\nimport type { ReactElement } from 'react';\nexport function AccessPowerIcon(): ReactElement {\n return (\n \n \n \n \n );\n}\n","import type { ReactElement } from 'react';\n\nfunction baseProps(size: number): {\n width: number;\n height: number;\n viewBox: string;\n fill: string;\n stroke: string;\n strokeWidth: number;\n strokeLinecap: 'round';\n strokeLinejoin: 'round';\n 'aria-hidden': true;\n} {\n return {\n width: size,\n height: size,\n viewBox: '0 0 24 24',\n fill: 'none',\n stroke: 'currentColor',\n strokeWidth: 2,\n strokeLinecap: 'round',\n strokeLinejoin: 'round',\n 'aria-hidden': true,\n };\n}\n\nexport function TrackpadIcon({ size = 14 }: { readonly size?: number }): ReactElement {\n return (\n \n \n \n \n );\n}\n\nexport function TakeoverIcon({ size = 14 }: { readonly size?: number }): ReactElement {\n return (\n \n \n \n \n \n );\n}\n","import { PanelEmptyState } from '../../../client/src/client/ds/empty-state.js';\nimport { RemoteViewer } from '../../../client/src/client/remote-viewer/index.js';\nimport type { ViewerTranslate } from '../../../client/src/client/remote-viewer/locale.js';\nimport {\n useId,\n useCallback,\n useRef,\n useState,\n useSyncExternalStore,\n type ComponentType,\n type ReactElement,\n} from 'react';\nimport {\n Button,\n IconFullscreenOutlineRegular,\n Switch,\n Tag,\n} from '@deepseek-ai/dsh-client-ui-primitives';\nimport { Tooltip } from '../../../client/src/client/ds/tooltip.js';\nimport { ChannelSidebarIcon } from '../../../client/src/client/channel-sidebar-icon.js';\nimport { useMountedResource } from '../../../client/src/client/mounted-resource.js';\nimport { recordViewerOpen } from '../../../client/src/client/telemetry-surface.js';\nimport { SidebarCardList, SidebarCardRow } from '../../../client/src/client/sidebar-card.js';\nimport type {} from '@deepseek-ai/dsh-client-ui-slots';\n\nimport { LOCALE_NS, en, zh, type BrowserTranslate } from './locale.js';\nimport {\n BrowserApiError,\n BrowserFailureNotice,\n BrowserProvisionProgress,\n readFailure,\n type BrowserFailure,\n} from './browser-failure.js';\nimport { isBrowserFailureKind } from '../failure-kinds.js';\nimport { ProfileCombobox } from './profile-combobox.js';\nimport { registerBrowserSettings } from './settings.js';\nimport { ProfileBrowserControl } from './profile-browser.js';\nimport type { ProfileView } from '../profile-control.js';\nimport { DailyBrowserControl } from './daily-browser.js';\nimport type { DailyView } from '../daily.js';\nimport { BorrowedBrowser, type BorrowedTabView } from './borrowed-browser.js';\nimport { styles } from './styles.js';\n\nconst ENTRY_ID = 'botharness-browser';\nconst OBSERVATION_ENDPOINT = './api/browser/observation';\nconst TAKEOVER_ENDPOINT = './api/browser/takeover';\nconst OPEN_ENDPOINT = './api/browser/open';\nconst STOP_ENDPOINT = './api/browser/stop';\nconst baseRelative = (path: string | null | undefined): string | undefined =>\n path === null || path === undefined ? undefined : path.startsWith('/') ? `.${path}` : path;\n\nimport { AccessPowerIcon } from './access-power-icon.js';\nimport { TakeoverIcon, TrackpadIcon } from './viewer-icons.js';\n\nexport const name = 'botharness-browser-client';\n\nexport const inject = ['channelSidebar', 'connection', 'locale'];\n\nexport interface BrowserClientContext {\n readonly locale: {\n bind(namespace: string): BrowserTranslate;\n register(namespace: string, dictionaries: { zh: unknown; en: unknown }): () => void;\n };\n inject(names: readonly string[], callback: (ctx: BrowserClientContext) => void): void;\n effect(callback: () => () => void, name: string): void;\n}\n\ninterface ChannelSidebarEntryProps {\n readonly botSlug?: string;\n readonly t: BrowserTranslate;\n readonly expanded?: boolean;\n readonly setExpanded?: (expanded: boolean) => void;\n readonly setExpandable?: (expandable: boolean) => void;\n}\n\ninterface ChannelSidebarRegistryLike {\n register(entry: {\n readonly id: string;\n readonly label: string;\n readonly icon?: string;\n readonly order: number;\n readonly scope: 'channel' | 'personabot';\n readonly component: ComponentType;\n readonly headerAction?: ComponentType;\n readonly badge?: ComponentType;\n readonly tab?: string;\n }): () => void;\n}\n\ninterface ConnectionRpcLike {\n call(\n path: string,\n method: string,\n options?: { args?: unknown },\n ): Promise<{ ok: boolean; value?: unknown; error?: { message?: string } }>;\n}\n\nlet connectionRpc: ConnectionRpcLike | undefined;\n\ninterface BotInfoView {\n readonly displayName: string | undefined;\n readonly browserAccess: boolean | undefined;\n readonly browserProfile: string | undefined;\n readonly profiles: readonly string[];\n}\n\ninterface BrowserTabView {\n readonly targetId: string;\n readonly url: string;\n readonly title: string;\n readonly current: boolean;\n}\n\ninterface BrowserObservation {\n readonly target?: 'local' | 'container' | 'extension' | 'daily-control' | 'profile-control';\n readonly daily?: DailyView | null;\n readonly profile?: ProfileView;\n readonly borrowed?: BorrowedTabView | null;\n readonly viewerUrl?: string | null;\n readonly cleanupRequired?: boolean;\n readonly running: boolean;\n readonly frame: string | null;\n readonly focused: string | null;\n readonly takeover: boolean;\n readonly handoffPending?: boolean;\n readonly provisioning?: { downloadedBytes: number; totalBytes: number } | null;\n readonly tabs: readonly BrowserTabView[];\n readonly profiles?: readonly string[];\n}\n\nasync function requestJson(url: string, init?: RequestInit): Promise {\n const response = await fetch(url, { cache: 'no-store', ...init });\n const body = (await response.json()) as T & {\n ok?: boolean;\n error?: string;\n code?: string;\n detail?: string;\n packages?: string[];\n };\n if (!response.ok || body.ok === false) {\n throw new BrowserApiError(\n body.error ?? `HTTP ${String(response.status)}`,\n body.code,\n body.detail,\n body.packages,\n );\n }\n return body;\n}\n\ninterface ReadableStore {\n subscribe(listener: () => void): () => void;\n getSnapshot(): T;\n}\n\ntype BotInfoStore = ReadableStore & {\n refresh(): void;\n setAccess(enabled: boolean): void;\n};\n\nconst botInfoStores = new Map();\n\nfunction botInfoStore(botSlug: string | undefined): BotInfoStore {\n const key = botSlug ?? '';\n const existing = botInfoStores.get(key);\n if (existing !== undefined) return existing;\n const created = createBotInfoStore(botSlug);\n botInfoStores.set(key, created);\n return created;\n}\n\nfunction createBotInfoStore(botSlug: string | undefined): BotInfoStore {\n let info: BotInfoView = {\n displayName: undefined,\n browserAccess: undefined,\n browserProfile: undefined,\n profiles: [],\n };\n const listeners = new Set<() => void>();\n let loadedAt = Number.NEGATIVE_INFINITY;\n const load = (): void => {\n const rpc = connectionRpc;\n if (rpc === undefined || botSlug === undefined) return;\n void rpc\n .call('/api', 'botharness/list', { args: {} })\n .then((result) => {\n if (!result.ok) return;\n const value = result.value as {\n bots?: readonly {\n slug?: unknown;\n displayName?: unknown;\n browserAccess?: unknown;\n browserProfile?: unknown;\n }[];\n };\n const bots = value.bots ?? [];\n const match = bots.find((bot) => bot.slug === botSlug);\n if (match === undefined) return;\n const profiles = [\n ...new Set(\n bots\n .map((bot) => (typeof bot.browserProfile === 'string' ? bot.browserProfile : ''))\n .filter((name) => name !== ''),\n ),\n ].sort();\n info = {\n displayName:\n typeof match.displayName === 'string' && match.displayName.length > 0\n ? match.displayName\n : undefined,\n browserAccess: match.browserAccess === true,\n browserProfile:\n typeof match.browserProfile === 'string' && match.browserProfile !== ''\n ? match.browserProfile\n : undefined,\n profiles,\n };\n for (const listener of listeners) listener();\n })\n .catch(() => undefined);\n };\n return {\n setAccess(enabled) {\n info = { ...info, browserAccess: enabled };\n for (const listener of listeners) listener();\n },\n subscribe(listener) {\n if (listeners.size === 0 && Date.now() - loadedAt > 5000) {\n loadedAt = Date.now();\n load();\n }\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n getSnapshot: () => info,\n refresh: load,\n };\n}\n\ninterface ObservationStore {\n subscribe(listener: () => void): () => void;\n getSnapshot(): BrowserObservation | undefined;\n setTab(targetId: string | undefined): void;\n refresh(): void;\n confirmTakeover(active: boolean): void;\n}\n\nfunction observationUrl(botSlug: string | undefined, tabId: string | undefined): string {\n const base = `${OBSERVATION_ENDPOINT}?slug=${encodeURIComponent(botSlug ?? '')}`;\n return tabId === undefined || tabId === '' ? base : `${base}&tab=${encodeURIComponent(tabId)}`;\n}\n\nfunction createObservationStore(botSlug: string | undefined): ObservationStore {\n let value: BrowserObservation | undefined;\n let tab: string | undefined;\n let timer: ReturnType | undefined;\n let refreshing = false;\n let revision = 0;\n let refreshAgain = false;\n const listeners = new Set<() => void>();\n const refresh = async (): Promise => {\n if (refreshing) {\n refreshAgain = true;\n return;\n }\n refreshing = true;\n const requestedTab = tab;\n const requestedRevision = revision;\n try {\n const next = await requestJson(observationUrl(botSlug, requestedTab));\n if (tab === requestedTab && revision === requestedRevision) value = next;\n } catch {\n if (tab === requestedTab && revision === requestedRevision) value = undefined;\n } finally {\n refreshing = false;\n }\n for (const listener of listeners) listener();\n if (refreshAgain && listeners.size > 0) {\n refreshAgain = false;\n void refresh();\n }\n };\n return {\n subscribe(listener) {\n listeners.add(listener);\n if (listeners.size === 1) {\n void refresh();\n timer = setInterval(() => void refresh(), 1500);\n }\n return () => {\n listeners.delete(listener);\n if (listeners.size === 0 && timer !== undefined) {\n clearInterval(timer);\n timer = undefined;\n }\n };\n },\n getSnapshot: () => value,\n setTab(targetId) {\n tab = targetId;\n void refresh();\n },\n confirmTakeover(active) {\n revision += 1;\n if (value !== undefined) value = { ...value, takeover: active };\n for (const listener of listeners) listener();\n },\n refresh: () => void refresh(),\n };\n}\n\nfunction BrowserHeaderAction({\n botSlug,\n t,\n setExpandable,\n setExpanded,\n}: ChannelSidebarEntryProps): ReactElement {\n const store = botInfoStore(botSlug);\n const [busy, setBusy] = useState(false);\n const inFlight = useRef(false);\n const [error, setError] = useState(false);\n const subscribe = (listener: () => void): (() => void) => {\n const sync = (): void => {\n setExpandable?.(store.getSnapshot().browserAccess !== undefined);\n };\n const unsubscribe = store.subscribe(() => {\n sync();\n listener();\n });\n sync();\n return unsubscribe;\n };\n const info = useSyncExternalStore(subscribe, store.getSnapshot);\n const accessOn = info.browserAccess === true;\n\n const onToggle = (next: boolean): void => {\n const rpc = connectionRpc;\n if (rpc === undefined || botSlug === undefined || inFlight.current) return;\n inFlight.current = true;\n setBusy(true);\n setError(false);\n void rpc\n .call('/api', 'botharness/browserAccessSet', { args: { slug: botSlug, enabled: next } })\n .then((result) => {\n if (!result.ok) {\n setError(true);\n return;\n }\n const value = result.value as { bot?: { browserAccess?: unknown } };\n const applied = value.bot?.browserAccess === true;\n store.setAccess(applied);\n setExpanded?.(applied);\n })\n .catch(() => {\n setError(true);\n })\n .finally(() => {\n inFlight.current = false;\n setBusy(false);\n });\n };\n\n const label = t(accessOn ? 'entry.access.disable' : 'entry.access.enable');\n return (\n \n \n onToggle(!accessOn)}\n >\n \n \n \n {error ? (\n \n {t('entry.access.failureHint')}\n \n ) : null}\n \n );\n}\n\nfunction BrowserBody({ botSlug, t }: ChannelSidebarEntryProps): ReactElement {\n const [store] = useState(() => createObservationStore(botSlug));\n const infoStore = botInfoStore(botSlug);\n const observation = useSyncExternalStore(store.subscribe, store.getSnapshot);\n const info = useSyncExternalStore(infoStore.subscribe, infoStore.getSnapshot);\n const [follow, setFollow] = useState(true);\n const [preview, setPreview] = useState(undefined);\n const [busy, setBusy] = useState(false);\n const errorId = useId();\n const [profileInvalid, setProfileInvalid] = useState(false);\n const [profileOverride, setProfileOverride] = useState(undefined);\n const [failure, setFailure] = useState(undefined);\n const [viewer, setViewer] = useState();\n const [interaction, setInteraction] = useState(false);\n const viewerScope = useRef('');\n const previousViewer = useRef<{ identity: string; url: string | undefined }>({\n identity: '',\n url: undefined,\n });\n const mounted = useRef(true);\n const viewerRequest = useRef(0);\n const interactionResource = useCallback((node: HTMLDivElement | null): void => {\n mounted.current = node !== null;\n if (node === null) viewerRequest.current += 1;\n }, []);\n const disableInteraction = useCallback(() => {\n viewerRequest.current += 1;\n setInteraction(false);\n }, []);\n const [inputMode, setInputMode] = useState<'direct' | 'trackpad'>(() =>\n typeof window !== 'undefined' &&\n window.innerWidth < 768 &&\n typeof window.matchMedia === 'function' &&\n window.matchMedia('(pointer: coarse)').matches\n ? 'trackpad'\n : 'direct',\n );\n const finePointer =\n typeof window !== 'undefined' &&\n typeof window.matchMedia === 'function' &&\n window.matchMedia('(pointer: fine)').matches;\n const showHeaderTakeover = inputMode === 'direct' && finePointer;\n\n const tabs = observation?.tabs ?? [];\n const focused = observation?.focused ?? null;\n const currentTab = tabs.find((tab) => tab.current);\n const orderedTabs =\n currentTab === undefined ? tabs : [currentTab, ...tabs.filter((tab) => !tab.current)];\n const cleanupRequired = observation?.cleanupRequired === true;\n const failureNotice =\n !cleanupRequired && failure !== undefined && isBrowserFailureKind(failure.code) ? (\n \n invoke(OPEN_ENDPOINT, follow || preview === undefined ? {} : { tab: preview })\n }\n />\n ) : null;\n let visibleError: string | undefined = failure?.message;\n if (cleanupRequired) visibleError = t('entry.view.cleanupFailed');\n if (failureNotice !== null) visibleError = undefined;\n const provisioning = observation?.provisioning ?? null;\n const paused = observation?.takeover === true;\n const viewerUrl =\n observation?.running === true &&\n (observation?.target === 'container' || observation?.target === 'local')\n ? baseRelative(observation.viewerUrl)\n : undefined;\n const narrowViewer = typeof window !== 'undefined' && window.innerWidth < 700;\n const viewerDesign =\n observation?.target === 'local' && (inputMode === 'trackpad' || narrowViewer)\n ? { width: 390, height: 700 }\n : { width: 1024, height: 768 };\n const identity = `${botSlug ?? ''}:${profileOverride ?? info.browserProfile ?? ''}:${observation?.target ?? ''}`;\n const scope = `${identity}:${viewerUrl ?? ''}`;\n const previous = previousViewer.current;\n if (viewerScope.current !== scope) {\n viewerScope.current = scope;\n viewerRequest.current += 1;\n previousViewer.current = { identity, url: viewerUrl };\n if (interaction) setInteraction(false);\n if ((previous.identity !== identity || previous.url !== undefined) && viewer !== undefined)\n setViewer(undefined);\n }\n if (!paused && interaction) setInteraction(false);\n const viewerTranslate: ViewerTranslate = (key) => t(key);\n const postTakeoverEnable = (): void => {\n if (botSlug === undefined || viewerUrl === undefined) return;\n const request = ++viewerRequest.current;\n const expectedScope = viewerScope.current;\n setBusy(true);\n setFailure(undefined);\n void requestJson<{ takeover: boolean }>(TAKEOVER_ENDPOINT, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ slug: botSlug, active: true }),\n })\n .then((result) => {\n if (\n mounted.current &&\n request === viewerRequest.current &&\n viewerScope.current === expectedScope\n ) {\n store.confirmTakeover(result.takeover);\n setInteraction(result.takeover);\n }\n })\n .catch((cause: unknown) => {\n if (mounted.current && request === viewerRequest.current) setFailure(readFailure(cause));\n })\n .finally(() => {\n if (mounted.current) {\n setBusy(false);\n store.refresh();\n }\n });\n };\n const toggleTakeover = (): void => {\n if (interaction) {\n disableInteraction();\n if (observation?.handoffPending !== true) invoke(TAKEOVER_ENDPOINT, { active: false });\n return;\n }\n if (busy || botSlug === undefined || viewerUrl === undefined) return;\n postTakeoverEnable();\n };\n const botName = info.displayName ?? botSlug ?? '';\n const takeoverTitle =\n interaction && paused\n ? `${t('entry.view.browserTitle', { name: botName })} · ${t('entry.takeover.active')}`\n : t('entry.view.browserTitle', { name: botName });\n const toggleRef = useRef(toggleTakeover);\n toggleRef.current = toggleTakeover;\n const messageResource = useMountedResource(() => {\n const onMessage = (event: MessageEvent): void => {\n const data = event.data as { type?: unknown } | null;\n if (typeof window === 'undefined' || event.origin !== window.location.origin) return;\n if (data === null || typeof data !== 'object' || data.type !== 'bh-takeover-toggle') return;\n const ours = [...document.querySelectorAll('iframe')].some(\n (frame) =>\n frame.contentWindow === event.source &&\n (frame.getAttribute('src') ?? '').includes('/botharness-browser/viewer/'),\n );\n if (!ours) return;\n toggleRef.current();\n };\n window.addEventListener('message', onMessage);\n return () => window.removeEventListener('message', onMessage);\n }, []);\n const takeoverNote = useRef(undefined);\n const wantTakeoverNote = interaction && paused;\n if (takeoverNote.current !== wantTakeoverNote && typeof document !== 'undefined') {\n takeoverNote.current = wantTakeoverNote;\n try {\n for (const frame of Array.from(document.querySelectorAll('iframe'))) {\n if ((frame.getAttribute('src') ?? '').includes('/botharness-browser/viewer/')) {\n frame.contentWindow?.postMessage(\n { type: 'bh-takeover-state', active: wantTakeoverNote },\n window.location.origin,\n );\n }\n }\n } catch {\n void 0;\n }\n }\n const bodyResource = useCallback(\n (node: HTMLDivElement | null): void => {\n interactionResource(node);\n messageResource(node);\n },\n [interactionResource, messageResource],\n );\n\n const invoke = (endpoint: string, body: Record = {}): void => {\n if (busy || botSlug === undefined) return;\n setBusy(true);\n setProfileInvalid(false);\n setFailure(undefined);\n void requestJson<{ ok: boolean; viewerUrl?: string | null; takeover?: boolean }>(endpoint, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ slug: botSlug, ...body }),\n })\n .then((result) => {\n if (typeof result.takeover === 'boolean') store.confirmTakeover(result.takeover);\n if (\n endpoint === OPEN_ENDPOINT &&\n result.viewerUrl !== undefined &&\n result.viewerUrl !== null\n ) {\n setViewer(baseRelative(result.viewerUrl));\n setInteraction(false);\n }\n if (endpoint === STOP_ENDPOINT) {\n setViewer(undefined);\n setInteraction(false);\n }\n })\n .catch((cause: unknown) => setFailure(readFailure(cause)))\n .finally(() => {\n setBusy(false);\n store.refresh();\n });\n };\n\n const onFollow = (next: boolean): void => {\n setFollow(next);\n if (next) {\n setPreview(undefined);\n store.setTab(undefined);\n } else {\n const selected = focused ?? preview;\n setPreview(selected);\n store.setTab(selected);\n }\n };\n\n const onSelectTab = (targetId: string): void => {\n setFollow(false);\n setPreview(targetId);\n store.setTab(targetId);\n };\n\n const onPause = (): void => {\n disableInteraction();\n invoke(TAKEOVER_ENDPOINT, { active: !paused });\n };\n\n const currentProfile = profileOverride ?? info.browserProfile ?? '';\n\n const saveProfile = (name: string): void => {\n const rpc = connectionRpc;\n if (rpc === undefined || botSlug === undefined || busy) return;\n const trimmed = name.trim();\n const next = trimmed === 'default' ? '' : trimmed;\n if (next === currentProfile) {\n setProfileInvalid(false);\n setFailure(undefined);\n return;\n }\n disableInteraction();\n setViewer(undefined);\n setBusy(true);\n setProfileInvalid(false);\n setFailure(undefined);\n void rpc\n .call('/api', 'botharness/browserProfileSet', { args: { slug: botSlug, profile: next } })\n .then((result) => {\n if (!result.ok) {\n setProfileInvalid(true);\n setFailure({ message: result.error?.message ?? t('entry.profile.failed') });\n return;\n }\n const value = result.value as { bot?: { browserProfile?: unknown } };\n setProfileOverride(\n typeof value.bot?.browserProfile === 'string' ? value.bot.browserProfile : '',\n );\n setPreview(undefined);\n store.setTab(undefined);\n infoStore.refresh();\n })\n .catch((cause: unknown) => {\n setProfileInvalid(true);\n setFailure(readFailure(cause));\n })\n .finally(() => {\n setBusy(false);\n store.refresh();\n });\n };\n\n if (!cleanupRequired && observation?.target === 'profile-control')\n return (\n \n );\n\n if (!cleanupRequired && observation?.target === 'daily-control')\n return (\n \n );\n\n if (!cleanupRequired && observation?.target === 'extension')\n return (\n \n );\n\n return (\n
\n \n \n {observation?.running === true ? (\n {t('entry.chip.running')}\n ) : (\n {t('entry.chip.stopped')}\n )}\n {paused ? {t('entry.chip.paused')} : null}\n \n }\n detail={\n
\n
\n {t('entry.profile.label')}\n \n
\n {viewerUrl === undefined ? (\n
\n {t('entry.view.follow')}\n \n
\n ) : null}\n
\n {viewerUrl === undefined ? (\n \n invoke(OPEN_ENDPOINT, follow || preview === undefined ? {} : { tab: preview })\n }\n >\n {t(busy ? 'entry.view.opening' : 'entry.view.open')}\n \n ) : (\n {\n if (viewerUrl !== undefined) setViewer(viewerUrl);\n }}\n >\n \n \n {t('entry.view.fullscreen')}\n \n \n )}\n \n {t(paused ? 'entry.view.resume' : 'entry.view.pause')}\n \n {observation?.running === true || cleanupRequired ? (\n invoke(STOP_ENDPOINT)}\n >\n {t('entry.view.stop')}\n \n ) : null}\n
\n
\n }\n />\n
\n {viewerUrl === undefined ? (\n <>\n {observation?.frame === null || observation?.frame === undefined ? (\n
{t('entry.view.noFrame')}
\n ) : (\n {t('entry.label')}\n )}\n \n ) : (\n \n {failure.message}\n
\n )\n }\n busy={busy}\n stopping={false}\n hideStop\n hideInteractiveToggle\n allowFrameInput\n onStop={() => invoke(STOP_ENDPOINT)}\n interactive={interaction && paused}\n onToggleInteractive={toggleTakeover}\n onDisableInteraction={disableInteraction}\n expanded={viewer === viewerUrl}\n onExpandedChange={(next) => {\n setViewer(next ? viewerUrl : undefined);\n if (!next) disableInteraction();\n }}\n extraControls={\n <>\n {showHeaderTakeover ? (\n setInputMode('trackpad')}\n >\n \n \n {t('entry.view.inputMode.trackpad')}\n \n \n ) : null}\n {showHeaderTakeover ? (\n \n \n \n \n {t(interaction ? 'entry.takeover.stop' : 'entry.takeover.start')}\n \n \n \n ) : null}\n \n }\n />\n )}\n {tabs.length === 0 ? (\n
{t('entry.view.noTabs')}
\n ) : (\n
    \n {orderedTabs.map((tab) => (\n
  • \n
    \n onSelectTab(tab.targetId)}\n >\n \n \n \n \n \n {tab.title === '' ? tab.url : tab.title}\n \n {tab.title === '' ? null : (\n {tab.url}\n )}\n \n \n
    \n
  • \n ))}\n
\n )}\n {provisioning !== null ? : null}\n {failureNotice}\n {visibleError !== undefined ? (\n
\n {visibleError}\n
\n ) : null}\n \n );\n}\n\nfunction createBrowserBody(t: BrowserTranslate): ComponentType {\n return function BrowserBodyView(props: Omit): ReactElement {\n useState(() => recordViewerOpen(connectionRpc, 'browser'));\n const store = botInfoStore(props.botSlug);\n const info = useSyncExternalStore(store.subscribe, store.getSnapshot);\n if (info.browserAccess === false)\n return {t('entry.access.description')};\n return ;\n };\n}\n\nfunction createBrowserBadge(t: BrowserTranslate): ComponentType {\n return function BrowserBadge({ botSlug }: Omit) {\n const store = botInfoStore(botSlug);\n const info = useSyncExternalStore(store.subscribe, store.getSnapshot);\n if (info.browserAccess !== true) return null;\n return (\n \n );\n };\n}\n\nfunction createBrowserHeader(t: BrowserTranslate): ComponentType {\n return function BrowserHeaderView(props: Omit): ReactElement {\n return ;\n };\n}\n\nexport function apply(ctx: BrowserClientContext): void {\n botInfoStores.clear();\n const t = ctx.locale.bind(LOCALE_NS);\n registerBrowserSettings(ctx, t);\n ctx.effect(() => {\n const sheet = document.createElement('style');\n sheet.dataset.plugin = '@botharness/browser';\n sheet.dataset.pluginCss = '@botharness/browser/client.css';\n sheet.textContent = styles;\n document.head.append(sheet);\n return () => sheet.remove();\n }, 'botharness-browser: styles');\n ctx.effect(() => ctx.locale.register(LOCALE_NS, { zh, en }), 'botharness-browser: dictionaries');\n ctx.inject(['channelSidebar', 'connection'], (sidebarCtx) => {\n const registry = (sidebarCtx as unknown as { channelSidebar?: ChannelSidebarRegistryLike })\n .channelSidebar;\n connectionRpc = (sidebarCtx as unknown as { connection?: { rpc?: ConnectionRpcLike } })\n .connection?.rpc;\n if (registry === undefined) return;\n ctx.effect(\n () =>\n registry.register({\n id: ENTRY_ID,\n icon: 'globe',\n label: t('entry.label'),\n order: 41,\n scope: 'personabot',\n component: createBrowserBody(t),\n headerAction: createBrowserHeader(t),\n badge: createBrowserBadge(t),\n tab: 'screen',\n }),\n 'botharness-browser: channel sidebar entry',\n );\n });\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA,IAAI,SAAS,CAAC;EAEd,IAAI;EAEJ,SAAS,gBAAiB;GACzB,IAAI,mBAAmB,OAAO;GAC9B,oBAAoB;GAEpB,OAAO,eAAe,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AAM,IAAI;IAAK,IAAI;GAAI,CAAC,GACzE,CAAC,QAAQ,EAAE,GAAG,2BAA2B,CAAC,CAC5C;GACA,MAAM,CACJ,CACE,QACA,EACE,GAAG,qFACL,CACF,CACF;GACA,aAAa,CACX,CAAC,QAAQ;IAAE,OAAO;IAAM,QAAQ;IAAM,GAAG;IAAK,GAAG;IAAM,IAAI;IAAK,IAAI;GAAI,CAAC,GACzE,CAAC,QAAQ,EAAE,GAAG,0BAA0B,CAAC,CAC3C;GACA,KAAK,CACH,CACE,QACA,EACE,GAAG,wGACL,CACF,GACA,CAAC,UAAU;IAAE,IAAI;IAAM,IAAI;IAAM,GAAG;GAAI,CAAC,CAC3C;GACA,WAAW;IACT,CACE,QACA,EACE,GAAG,iGACL,CACF;IACA,CAAC,QAAQ,EAAE,GAAG,uCAAuC,CAAC;IACtD,CACE,QACA,EACE,GAAG,+FACL,CACF;IACA,CAAC,QAAQ,EAAE,GAAG,aAAa,CAAC;GAC9B;GACA,OAAO;IACL,CACE,QACA,EACE,GAAG,4DACL,CACF;IACA,CACE,QACA,EACE,GAAG,+EACL,CACF;IACA,CACE,QACA,EACE,GAAG,0DACL,CACF;GACF;GACA,cAAc;IACZ,CACE,QACA,EACE,GAAG,wBACL,CACF;IACA,CACE,UACA;KACE,IAAI;KACJ,IAAI;KACJ,GAAG;IACL,CACF;IACA,CACE,UACA;KACE,IAAI;KACJ,IAAI;KACJ,GAAG;IACL,CACF;GACF;GACA,mBAAmB,CACjB,CACE,QACA,EACE,GAAG,sHACL,CACF,GACA,CACE,QACA,EACE,GAAG,yGACL,CACF,CACF;GACA,OAAO,CACL,CACE,YACA,EACE,QAAQ,oCACV,CACF,GACA,CACE,QACA,EACE,GAAG,6GACL,CACF,CACF;GACA,cAAc;IACZ,CACE,QACA,EACE,GAAG,6GACL,CACF;IACA,CACE,QACA,EACE,GAAG,WACL,CACF;IACA,CACE,QACA,EACE,GAAG,WACL,CACF;IACA,CACE,UACA;KACE,IAAI;KACJ,IAAI;KACJ,GAAG;IACL,CACF;GACF;GACA,OAAO;IACL,CACE,QACA,EACE,GAAG,4CACL,CACF;IACA,CACE,QACA,EACE,GAAG,8BACL,CACF;IACA,CACE,QACA,EACE,GAAG,6BACL,CACF;IACA,CACE,UACA;KACE,IAAI;KACJ,IAAI;KACJ,GAAG;IACL,CACF;GACF;GACA,cAAc;IACZ,CACE,QACA,EACE,GAAG,WACL,CACF;IACA,CACE,QACA,EACE,GAAG,WACL,CACF;IACA,CACE,UACA;KACE,IAAI;KACJ,IAAI;KACJ,GAAG;IACL,CACF;IACA,CACE,UACA;KACE,IAAI;KACJ,IAAI;KACJ,GAAG;IACL,CACF;GACF;GACA,UAAU,CACR,CACE,QACA,EACE,GAAG,0UACL,CACF,GACA,CACE,UACA;IACE,IAAI;IACJ,IAAI;IACJ,GAAG;GACL,CACF,CACF;GACA,SAAS;IACP,CACE,QACA;KACE,OAAO;KACP,QAAQ;KACR,GAAG;KACH,GAAG;KACH,IAAI;IACN,CACF;IACA,CACE,QACA;KACE,IAAI;KACJ,IAAI;KACJ,IAAI;KACJ,IAAI;IACN,CACF;IACA,CACE,QACA;KACE,IAAI;KACJ,IAAI;KACJ,IAAI;KACJ,IAAI;IACN,CACF;GACF;GACA,OAAO;IACL,CACE,UACA;KACE,IAAI;KACJ,IAAI;KACJ,GAAG;IACL,CACF;IACA,CACE,QACA,EACE,GAAG,kDACL,CACF;IACA,CACE,QACA,EACE,GAAG,WACL,CACF;GACF;GACA,eAAe,CACb,CACE,QACA;IACE,OAAO;IACP,QAAQ;IACR,GAAG;IACH,GAAG;IACH,IAAI;GACN,CACF,GACA,CACE,QACA,EACE,GAAG,WACL,CACF,CACF;GACA,mBAAmB;IACjB,CACE,QACA;KACE,OAAO;KACP,QAAQ;KACR,GAAG;KACH,GAAG;KACH,IAAI;IACN,CACF;IACA,CACE,QACA,EACE,GAAG,UACL,CACF;IACA,CACE,QACA,EACE,GAAG,UACL,CACF;GACF;GACA,iBAAiB;IACf,CAAC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C;GAC/F,IAAI,OAAO,CAAC,kBAAkB,YAAY,IAAI,eAAe;IAC3D,MAAM,WAAY,WACf;IACH,gBAAiB,WACd,YAAY;IACf,IAAI,aAAa,KAAA,GAAW;IAC5B,IAAI,aAEA,SAAS,SAAS;KAChB,IAAI;KACJ,MAAM;KACN,OAAO,EAAE,aAAa;KACtB,OAAO;KACP,OAAO;KACP,WAAW,kBAAkB,CAAC;KAC9B,cAAc,oBAAoB,CAAC;KACnC,OAAO,mBAAmB,CAAC;KAC3B,KAAK;IACP,CAAC,GACH,2CACF;GACF,CAAC;EACH"} \ No newline at end of file diff --git a/packages/computer/lib/client.js.map b/packages/computer/lib/client.js.map index bd8ec09a09..8051b0e59f 100644 --- a/packages/computer/lib/client.js.map +++ b/packages/computer/lib/client.js.map @@ -1 +1 @@ -{"version":3,"file":"client.js","names":["createElement","stylex","space","x1","x2","x3","x4","x5","x6","text","metaSize","metaLine","bodySize","bodyLine","titleSize","titleLine","regular","strong","radius","xs","sm","md","lg","panel","round","border","hairline","focus","size","inlineIcon","icon","row","nav","dialog","small","bodyMax","medium","wide","actionColor","secondary","hover","danger","dangerLabel","color","fg","muted","subtle","divider","borderStrong","selected","navSelected","accent","accentText","onAccent","onDanger","dangerEdge","dangerSoft","warning","warningEdge","warningSoft","success","surface","elevated","base","modal","well","accentTint","ReactElement","ReactNode","stylex","ChannelSidebarIcon","border","color","radius","size","space","text","EmptyState","title","description","action","status","undefined","PanelEmptyState","icon","children","useMountedResource","useRef","useCallback","useMountedResource","Button","Pill","IconFullscreenOutlineRegular","useState","StateDot","useRef","useCallback","Fragment","createContext","useContext","PrimitiveTooltip","useRef","useCallback","ReactElement","ReactNode","stylex","color","space","text","styles","note","kogj98","kGuDYH","kLWn49","kHjlTd","$$css","inset","k8WAf4","kg3NbH","muted","kMwMTN","subtle","danger","success","warning","NoteTone","Note","tone","children","props","ButtonHTMLAttributes","InputHTMLAttributes","ReactElement","ReactNode","stylex","actionColor","border","color","radius","size","space","text","pillStyles","pill","k1xSpc","kGNEyG","kOIVth","ks0D6T","kZKoxP","kg3NbH","kMzoRj","kaIpWk","kWkggS","kMwMTN","kMv6JI","kGuDYH","kLWn49","khDVqt","kkrTdU","kSiTet","kI3sdo","kInvED","$$css","PillButton","children","rest","Omit","HTMLButtonElement","PillFileButton","input","HTMLInputElement","Menu","NativeMenu","Menu","ComponentProps","createPortal","stylex","useMountedResource","border","space","MenuPoint","x","y","pointerMenuPosition","point","width","height","viewport","top","margin","Number","parseFloat","x4","Math","max","min","PointerMenuProps","Omit","container","Element","align","PointerMenu","document","body","props","mount","HTMLSpanElement","node","menu","querySelector","HTMLElement","originalMaxWidth","getComputedStyle","maxWidth","originalMinWidth","minWidth","place","scale","getBoundingClientRect","cssZoom","currentCSSZoom","undefined","scaleX","scaleY","root","documentElement","clearance","hasAttribute","getPropertyValue","availableWidth","innerWidth","style","Infinity","maxHeight","innerHeight","box","desired","left","observer","ResizeObserver","observe","window","addEventListener","disconnect","removeEventListener","className","PointerMenu","MenuPoint","useMountedResource","useRef","useState","ReactElement","ReactNode","stylex","IconChevronDownOutlineRegular","pillStyles","color","space","SelectOption","value","Value","label","SelectProps","options","onChange","disabled","align","autoFocus","reselect","Select","open","setOpen","point","setPoint","trigger","HTMLButtonElement","active","mount","node","current","place","rect","getBoundingClientRect","scale","offsetHeight","height","next","x","right","left","y","bottom","Number","parseFloat","x2","previous","resize","ResizeObserver","undefined","observe","document","documentElement","observer","MutationObserver","attributes","attributeFilter","window","addEventListener","disconnect","removeEventListener","close","button","menu","activeElement","closest","queueMicrotask","focused","isConnected","body","contains","focus","preventScroll","find","option","event","stopPropagation","props","pill","map","id","useId","ReactElement","ReactNode","Ref","stylex","border","color","space","text","NARROW","COMPACT","SettingsRows","children","rootRef","HTMLDivElement","SettingsSectionProps","title","description","SettingsSection","id","undefined","SettingsRowProps","control","data","Readonly","Record","SettingsRow","titleId","descriptionId","SettingsValue","useState","ReactElement","ReactNode","stylex","Button","Note","color","radius","space","text","MissingPackagesAccess","MissingPackagesLabels","missing","manual","install","copy","copied","formatProgressMiB","bytes","toFixed","ProgressLine","percent","label","value","Math","max","min","MissingPackages","command","access","installing","busy","onInstall","labels","children","setCopied","navigator","clipboard","writeText","then","undefined","localSetupFailure","useCallback","useState","ReactElement","stylex","Button","Tag","Note","space","MissingPackages","ProgressLine","formatProgressMiB","SidebarCardList","SidebarCardRow","ComputerTranslate","useMountedResource","LocalMissing","packages","command","install","LocalStatus","target","probe","available","detail","status","refusal","permissions","accessibility","screenRecording","state","phase","progress","percent","downloadedBytes","totalBytes","missing","text","LocalComputerStatus","t","payload","setPayload","busy","setBusy","error","setError","refresh","signal","AbortSignal","response","fetch","credentials","undefined","ok","Error","next","json","aborted","old","resource","HTMLDivElement","controller","AbortController","pending","poll","Promise","any","timeout","timer","setInterval","abort","clearInterval","installing","preparing","failureDetail","failure","post","path","body","Record","method","headers","JSON","stringify","then","refused","catch","code","finally","check","authorize","granted","download","installLabel","label","join","String","checkButton","length","manual","copy","copied","downloaded","total","permission","useCallback","useRef","useState","useSyncExternalStore","ReactElement","useMountedResource","stylex","IconChevronDownOutlineRegular","IconFolderOpenOutlineRegular","Input","Menu","Switch","InjectFace","PropsLocale","COMPUTER_TARGET_FIELD","COMPUTER_AUTO_ALLOW_FIELD","COMPUTER_EXPORT_DIR_FIELD","COMPUTER_IDLE_STOP_FIELD","ComputerSettings","Note","PillButton","PillFileButton","Select","SettingsRow","SettingsRows","border","color","space","text","LocalComputerStatus","ComputerTarget","PHASE_LABEL","ComputerTranslate","ComputerSettingsSnapshot","target","exportDir","idleStopMinutes","autoAllowActions","status","writable","ComputerSettingsScope","getSnapshot","value","subscribe","listener","set","field","Promise","ExportDirRejectedError","Error","constructor","name","displayExportDir","configured","hostDir","ComputerSettingsPrefs","snapshot","listeners","Set","scope","detach","attach","sync","undefined","add","delete","setTarget","setExportDir","publish","error","setIdleStopMinutes","catch","setAutoAllowActions","previous","patch","Partial","next","ComputerSettingsFace","prefs","pickerAvailable","pickDirectory","openDirectory","dir","exportArchive","archive","downloadToken","downloadUrl","importArchive","file","requestUpload","sendUploadBytes","uploadToken","File","listArchives","hostExportDir","IDLE_OPTIONS","const","EXPORT_ENDPOINT","IMPORT_ENDPOINT","EXPORTS_ENDPOINT","STATUS_ENDPOINT","OPEN_DIR_ENDPOINT","DOWNLOAD_ENDPOINT","UPLOAD_ENDPOINT","UPLOAD_CONTENT_ENDPOINT","requestJson","url","init","RequestInit","T","response","fetch","credentials","ok","String","json","postAuthorized","body","Record","method","headers","JSON","stringify","authorize","createComputerSettingsFace","options","createXhr","XMLHttpRequest","payload","encodeURIComponent","resolve","reject","xhr","open","withCredentials","setRequestHeader","onload","parse","responseText","onerror","send","files","Selector","label","onToggle","disabled","ComputerSettingsRows","t","targetError","setTargetError","targetSaving","setTargetSaving","idleOpen","setIdleOpen","importOpen","setImportOpen","archives","setArchives","busy","setBusy","confirming","setConfirming","exportTarget","setExportTarget","manualOpen","setManualOpen","manualPath","setManualPath","saving","setSaving","dirNote","setDirNote","transferNote","setTransferNote","download","setDownload","token","uploadName","setUploadName","uploadFile","pickerBroken","setPickerBroken","setHostDir","livePhase","setLivePhase","liveElapsed","setLiveElapsed","hostDirResource","HTMLSpanElement","active","then","busyResource","startedAt","Date","now","controller","AbortController","pending","tick","signal","aborted","Math","round","phase","AbortSignal","any","timeout","timer","setInterval","abort","clearInterval","phaseKey","hasDir","canAdjust","pickDirectoryInto","apply","pickExportDir","startExport","saveManualPath","trim","startsWith","test","finally","runExport","autoOpen","runImport","takeUploadFile","current","runUpload","openImport","length","openDir","selectedFile","map","id","className","event","minutes","Number","globalThis","location","assign","seconds","useState","useCallback","Tag","Button","useSyncExternalStore","useRef"],"sources":["../../../node_modules/.pnpm/@stylexjs+stylex@0.19.1/node_modules/@stylexjs/stylex/lib/es/stylex.mjs","../../client/src/client/channel-sidebar-icon.tsx","../../client/src/client/ds/tokens.stylex.ts","../../client/src/client/ds/empty-state.tsx","../../client/src/client/mounted-resource.ts","../../client/src/client/remote-viewer/tokens.ts","../../client/src/client/remote-viewer/viewer-state.ts","../../client/src/client/remote-viewer/frame-liveness.ts","../../client/src/client/remote-viewer/index.tsx","../src/client/viewer-events.ts","../src/client/locale.ts","../../client/src/client/ds/tooltip.tsx","../../client/src/client/sidebar-card.tsx","../src/settings.ts","../src/client/mounted-resource.ts","../../client/src/client/ds/note.tsx","../../client/src/client/ds/pill-button.tsx","../../client/src/client/appearance-scope.ts","../../client/src/client/appearance-primitives.tsx","../../client/src/client/ds/pointer-menu.tsx","../../client/src/client/ds/select.tsx","../../client/src/client/ds/settings-row.tsx","../src/client/local-setup-copy.ts","../../client/src/client/missing-packages.tsx","../src/client/local-computer.tsx","../src/client/settings-rows.tsx","../../client/src/client/telemetry-surface.ts","../src/client/access-power-icon.tsx","../../client/src/client/ds/stylex-css.ts","../src/client/index.tsx"],"sourcesContent":["var styleq = {};\n\nvar hasRequiredStyleq;\n\nfunction requireStyleq () {\n\tif (hasRequiredStyleq) return styleq;\n\thasRequiredStyleq = 1;\n\n\tObject.defineProperty(styleq, \"__esModule\", {\n\t value: true\n\t});\n\tstyleq.styleq = void 0;\n\tvar cache = new WeakMap();\n\tvar compiledKey = '$$css';\n\tfunction createStyleq(options) {\n\t var disableCache;\n\t var disableMix;\n\t var transform;\n\t if (options != null) {\n\t disableCache = options.disableCache === true;\n\t disableMix = options.disableMix === true;\n\t transform = options.transform;\n\t }\n\t return function styleq() {\n\t var definedProperties = [];\n\t var className = '';\n\t var inlineStyle = null;\n\t var debugString = '';\n\t var nextCache = disableCache ? null : cache;\n\t var styles = new Array(arguments.length);\n\t for (var i = 0; i < arguments.length; i++) {\n\t styles[i] = arguments[i];\n\t }\n\t while (styles.length > 0) {\n\t var possibleStyle = styles.pop();\n\t if (possibleStyle == null || possibleStyle === false) {\n\t continue;\n\t }\n\t if (Array.isArray(possibleStyle)) {\n\t for (var _i = 0; _i < possibleStyle.length; _i++) {\n\t styles.push(possibleStyle[_i]);\n\t }\n\t continue;\n\t }\n\t var style = transform != null ? transform(possibleStyle) : possibleStyle;\n\t if (style.$$css != null) {\n\t var classNameChunk = '';\n\t if (nextCache != null && nextCache.has(style)) {\n\t var cacheEntry = nextCache.get(style);\n\t if (cacheEntry != null) {\n\t classNameChunk = cacheEntry[0];\n\t debugString = cacheEntry[2];\n\t definedProperties.push.apply(definedProperties, cacheEntry[1]);\n\t nextCache = cacheEntry[3];\n\t }\n\t } else {\n\t var definedPropertiesChunk = [];\n\t for (var prop in style) {\n\t var value = style[prop];\n\t if (prop === compiledKey) {\n\t var compiledKeyValue = style[prop];\n\t if (compiledKeyValue !== true) {\n\t debugString = debugString ? compiledKeyValue + '; ' + debugString : compiledKeyValue;\n\t }\n\t continue;\n\t }\n\t if (typeof value === 'string' || value === null) {\n\t if (!definedProperties.includes(prop)) {\n\t definedProperties.push(prop);\n\t if (nextCache != null) {\n\t definedPropertiesChunk.push(prop);\n\t }\n\t if (typeof value === 'string') {\n\t classNameChunk += classNameChunk ? ' ' + value : value;\n\t }\n\t }\n\t } else {\n\t console.error(\"styleq: \".concat(prop, \" typeof \").concat(String(value), \" is not \\\"string\\\" or \\\"null\\\".\"));\n\t }\n\t }\n\t if (nextCache != null) {\n\t var weakMap = new WeakMap();\n\t nextCache.set(style, [classNameChunk, definedPropertiesChunk, debugString, weakMap]);\n\t nextCache = weakMap;\n\t }\n\t }\n\t if (classNameChunk) {\n\t className = className ? classNameChunk + ' ' + className : classNameChunk;\n\t }\n\t } else {\n\t if (disableMix) {\n\t if (inlineStyle == null) {\n\t inlineStyle = {};\n\t }\n\t inlineStyle = Object.assign({}, style, inlineStyle);\n\t } else {\n\t var subStyle = null;\n\t for (var _prop in style) {\n\t var _value = style[_prop];\n\t if (_value !== undefined) {\n\t if (!definedProperties.includes(_prop)) {\n\t if (_value != null) {\n\t if (inlineStyle == null) {\n\t inlineStyle = {};\n\t }\n\t if (subStyle == null) {\n\t subStyle = {};\n\t }\n\t subStyle[_prop] = _value;\n\t }\n\t definedProperties.push(_prop);\n\t nextCache = null;\n\t }\n\t }\n\t }\n\t if (subStyle != null) {\n\t inlineStyle = Object.assign(subStyle, inlineStyle);\n\t }\n\t }\n\t }\n\t }\n\t var styleProps = [className, inlineStyle, debugString];\n\t return styleProps;\n\t };\n\t}\n\tvar styleq$1 = styleq.styleq = createStyleq();\n\tstyleq$1.factory = createStyleq;\n\treturn styleq;\n}\n\nvar styleqExports = /*@__PURE__*/ requireStyleq();\n\nconst errorForFn = name => new Error(`Unexpected 'stylex.${name}' call at runtime. Styles must be compiled by '@stylexjs/babel-plugin'.`);\nconst errorForType = key => errorForFn(`types.${key}`);\nconst create = function stylexCreate(_styles) {\n throw errorForFn('create');\n};\nconst createTheme = (_baseTokens, _overrides) => {\n throw errorForFn('createTheme');\n};\nconst defineConsts = function stylexDefineConsts(_styles) {\n throw errorForFn('defineConsts');\n};\nconst defineVars = function stylexDefineVars(_styles) {\n throw errorForFn('defineVars');\n};\nconst unstable_conditional = function stylexConditional(_value) {\n throw errorForFn('unstable_conditional');\n};\nconst unstable_defineVarsNested = function stylexDefineVarsNested(_styles) {\n throw errorForFn('unstable_defineVarsNested');\n};\nconst unstable_defineConstsNested = function stylexDefineConstsNested(_styles) {\n throw errorForFn('unstable_defineConstsNested');\n};\nconst unstable_createThemeNested = (_baseTokens, _overrides) => {\n throw errorForFn('unstable_createThemeNested');\n};\nconst defineMarker = () => {\n throw errorForFn('defineMarker');\n};\nconst firstThatWorks = (..._styles) => {\n throw errorForFn('firstThatWorks');\n};\nconst keyframes = _keyframes => {\n throw errorForFn('keyframes');\n};\nconst positionTry = _positionTry => {\n throw errorForFn('positionTry');\n};\nfunction props(...styles) {\n const [className, style, dataStyleSrc] = styleqExports.styleq(styles);\n const result = {};\n if (className != null && className !== '') {\n result.className = className;\n }\n if (style != null && Object.keys(style).length > 0) {\n result.style = style;\n }\n if (dataStyleSrc != null && dataStyleSrc !== '') {\n result['data-style-src'] = dataStyleSrc;\n }\n return result;\n}\nconst toKebabCase = str => str.replace(/([A-Z])/g, '-$1').toLowerCase();\nfunction attrs(...styles) {\n const {\n className,\n style,\n 'data-style-src': dataStyleSrc\n } = props.apply(this, styles);\n const result = {};\n if (className != null) {\n result.class = className;\n }\n if (style != null) {\n result.style = Object.entries(style).map(([key, value]) => `${toKebabCase(key)}:${value}`).join(';');\n }\n if (dataStyleSrc != null) {\n result['data-style-src'] = dataStyleSrc;\n }\n return result;\n}\nconst viewTransitionClass = _viewTransitionClass => {\n throw errorForFn('viewTransitionClass');\n};\nconst defaultMarker = () => {\n throw errorForFn('defaultMarker');\n};\nconst when = {\n ancestor: _p => {\n throw errorForFn('when.ancestor');\n },\n descendant: _p => {\n throw errorForFn('when.descendant');\n },\n siblingBefore: _p => {\n throw errorForFn('when.siblingBefore');\n },\n siblingAfter: _p => {\n throw errorForFn('when.siblingAfter');\n },\n anySibling: _p => {\n throw errorForFn('when.anySibling');\n }\n};\nconst env = Object.freeze({});\nconst types = {\n angle: _v => {\n throw errorForType('angle');\n },\n color: _v => {\n throw errorForType('color');\n },\n url: _v => {\n throw errorForType('url');\n },\n image: _v => {\n throw errorForType('image');\n },\n integer: _v => {\n throw errorForType('integer');\n },\n lengthPercentage: _v => {\n throw errorForType('lengthPercentage');\n },\n length: _v => {\n throw errorForType('length');\n },\n percentage: _v => {\n throw errorForType('percentage');\n },\n number: _v => {\n throw errorForType('number');\n },\n resolution: _v => {\n throw errorForType('resolution');\n },\n time: _v => {\n throw errorForType('time');\n },\n transformFunction: _v => {\n throw errorForType('transformFunction');\n },\n transformList: _v => {\n throw errorForType('transformList');\n }\n};\nconst legacyMerge = /*@__PURE__*/ function () {\n function _legacyMerge(...styles) {\n const [className] = styleqExports.styleq(styles);\n return className;\n }\n _legacyMerge.create = create;\n _legacyMerge.createTheme = createTheme;\n _legacyMerge.defineConsts = defineConsts;\n _legacyMerge.defineMarker = defineMarker;\n _legacyMerge.defineVars = defineVars;\n _legacyMerge.defaultMarker = defaultMarker;\n _legacyMerge.firstThatWorks = firstThatWorks;\n _legacyMerge.keyframes = keyframes;\n _legacyMerge.positionTry = positionTry;\n _legacyMerge.props = props;\n _legacyMerge.attrs = attrs;\n _legacyMerge.types = types;\n _legacyMerge.when = when;\n _legacyMerge.viewTransitionClass = viewTransitionClass;\n _legacyMerge.env = env;\n _legacyMerge.unstable_conditional = unstable_conditional;\n _legacyMerge.unstable_defineVarsNested = unstable_defineVarsNested;\n _legacyMerge.unstable_defineConstsNested = unstable_defineConstsNested;\n _legacyMerge.unstable_createThemeNested = unstable_createThemeNested;\n return _legacyMerge;\n}();\n\nexport { attrs, create, createTheme, defaultMarker, defineConsts, defineMarker, defineVars, env, firstThatWorks, keyframes, legacyMerge, positionTry, props, types, unstable_conditional, unstable_createThemeNested, unstable_defineConstsNested, unstable_defineVarsNested, viewTransitionClass, when };\n","/**\n * Vendored Channel sidebar glyphs from lucide-react@1.46.0 (ISC, ADR-0032).\n *\n * Source: the matching lucide `dist/esm/icons/*.mjs` glyph data. Vendored at the\n * stock 2-unit stroke without adding a `lucide-react` runtime dependency.\n *\n * ISC License\n *\n * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT).\n * All other copyright (c) for Lucide are held by Lucide Contributors 2022.\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\nimport { createElement, type ReactElement } from 'react';\n\nconst glyphs: Record][]> = {\n image: [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2', ry: '2' }],\n ['circle', { cx: '9', cy: '9', r: '2' }],\n ['path', { d: 'm21 15-4-4L7 21' }],\n ],\n 'arrow-left': [\n ['path', { d: 'm12 19-7-7 7-7' }],\n ['path', { d: 'M19 12H5' }],\n ],\n 'chevron-right': [['path', { d: 'm9 18 6-6-6-6' }]],\n store: [\n ['path', { d: 'M15 21v-5a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v5' }],\n [\n 'path',\n {\n d: 'M17.774 10.31a1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.451 0 1.12 1.12 0 0 0-1.548 0 2.5 2.5 0 0 1-3.452 0 1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.77-3.248l2.889-4.184A2 2 0 0 1 7 2h10a2 2 0 0 1 1.653.873l2.895 4.192a2.5 2.5 0 0 1-3.774 3.244',\n },\n ],\n ['path', { d: 'M4 10.95V19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8.05' }],\n ],\n house: [['path', { d: 'm3 10 9-7 9 7v10a1 1 0 0 1-1 1h-5v-7H9v7H4a1 1 0 0 1-1-1z' }]],\n search: [\n ['path', { d: 'm21 21-4.34-4.34' }],\n ['circle', { cx: '11', cy: '11', r: '8' }],\n ],\n hash: [\n ['line', { x1: '4', x2: '20', y1: '9', y2: '9' }],\n ['line', { x1: '4', x2: '20', y1: '15', y2: '15' }],\n ['line', { x1: '10', x2: '8', y1: '3', y2: '21' }],\n ['line', { x1: '16', x2: '14', y1: '3', y2: '21' }],\n ],\n 'messages-circle': [\n [\n 'path',\n {\n d: 'M19.95 10.05a7 7 0 011.412 7.872 1 1 0 00-.058.787l.675 2.089a1 1 0 01-1.236 1.168l-2.155-.631a1 1 0 00-.745.06 7 7 0 01-7.793-1.445',\n },\n ],\n [\n 'path',\n {\n d: 'M2.696 12.708a1 1 0 00-.058-.785 7 7 0 113.518 3.473 1 1 0 00-.744-.061l-2.155.63a1 1 0 01-1.236-1.167z',\n },\n ],\n ],\n 'text-quote': [\n ['path', { d: 'M17 5H3' }],\n ['path', { d: 'M21 12H8' }],\n ['path', { d: 'M21 19H8' }],\n ['path', { d: 'M3 12v7' }],\n ],\n brain: [\n ['path', { d: 'M12 18V5' }],\n ['path', { d: 'M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4' }],\n ['path', { d: 'M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5' }],\n ['path', { d: 'M17.997 5.125a4 4 0 0 1 2.526 5.77' }],\n ['path', { d: 'M18 18a4 4 0 0 0 2-7.464' }],\n ['path', { d: 'M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517' }],\n ['path', { d: 'M6 18a4 4 0 0 1-2-7.464' }],\n ['path', { d: 'M6.003 5.125a4 4 0 0 0-2.526 5.77' }],\n ],\n file: [\n [\n 'path',\n {\n d: 'M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z',\n },\n ],\n ['path', { d: 'M14 2v5a1 1 0 0 0 1 1h5' }],\n ],\n terminal: [\n ['path', { d: 'M12 19h8' }],\n ['path', { d: 'm4 17 6-6-6-6' }],\n ],\n archive: [\n ['rect', { width: '20', height: '5', x: '2', y: '3', rx: '1' }],\n ['path', { d: 'M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8' }],\n ['path', { d: 'M10 12h4' }],\n ],\n 'archive-restore': [\n ['rect', { width: '20', height: '5', x: '2', y: '3', rx: '1' }],\n ['path', { d: 'M4 8v11a2 2 0 0 0 2 2h2' }],\n ['path', { d: 'M20 8v11a2 2 0 0 1-2 2h-2' }],\n ['path', { d: 'm9 15 3-3 3 3' }],\n ['path', { d: 'M12 12v9' }],\n ],\n 'alarm-clock': [\n ['circle', { cx: '12', cy: '13', r: '8' }],\n ['path', { d: 'M12 9v4l2 2' }],\n ['path', { d: 'M5 3 2 6' }],\n ['path', { d: 'm22 6-3-3' }],\n ['path', { d: 'M6.38 18.7 4 21' }],\n ['path', { d: 'M17.64 18.67 20 21' }],\n ],\n 'bell-ring': [\n ['path', { d: 'M10.268 21a2 2 0 0 0 3.464 0' }],\n ['path', { d: 'M22 8c0-2.3-.8-4.3-2-6' }],\n [\n 'path',\n {\n d: 'M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326',\n },\n ],\n ['path', { d: 'M4 2C2.8 3.7 2 5.7 2 8' }],\n ],\n bell: [\n ['path', { d: 'M10.268 21a2 2 0 0 0 3.464 0' }],\n [\n 'path',\n {\n d: 'M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326',\n },\n ],\n ],\n 'bell-off': [\n ['path', { d: 'M10.268 21a2 2 0 0 0 3.464 0' }],\n [\n 'path',\n {\n d: 'M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742',\n },\n ],\n ['path', { d: 'm2 2 20 20' }],\n ['path', { d: 'M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05' }],\n ],\n cpu: [\n ['path', { d: 'M12 20v2' }],\n ['path', { d: 'M12 2v2' }],\n ['path', { d: 'M17 20v2' }],\n ['path', { d: 'M17 2v2' }],\n ['path', { d: 'M2 12h2' }],\n ['path', { d: 'M2 17h2' }],\n ['path', { d: 'M2 7h2' }],\n ['path', { d: 'M20 12h2' }],\n ['path', { d: 'M20 17h2' }],\n ['path', { d: 'M20 7h2' }],\n ['path', { d: 'M7 20v2' }],\n ['path', { d: 'M7 2v2' }],\n ['rect', { x: '4', y: '4', width: '16', height: '16', rx: '2' }],\n ['rect', { x: '8', y: '8', width: '8', height: '8', rx: '1' }],\n ],\n 'id-card': [\n ['path', { d: 'M13 19a4 4 0 00-8 0' }],\n ['path', { d: 'M16 10h2' }],\n ['path', { d: 'M16 14h2' }],\n ['circle', { cx: '9', cy: '12', r: '3' }],\n ['rect', { x: '2', y: '5', width: '20', height: '14', rx: '2' }],\n ],\n plug: [\n ['path', { d: 'M12 22v-5' }],\n ['path', { d: 'M15 8V2' }],\n [\n 'path',\n {\n d: 'M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z',\n },\n ],\n ['path', { d: 'M9 8V2' }],\n ],\n ruler: [\n [\n 'path',\n {\n d: 'M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z',\n },\n ],\n ['path', { d: 'm14.5 12.5 2-2' }],\n ['path', { d: 'm11.5 9.5 2-2' }],\n ['path', { d: 'm8.5 6.5 2-2' }],\n ['path', { d: 'm17.5 15.5 2-2' }],\n ],\n compass: [\n ['circle', { cx: '12', cy: '12', r: '10' }],\n [\n 'path',\n {\n d: 'm16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z',\n },\n ],\n ],\n gauge: [\n ['path', { d: 'm12 14 4-4' }],\n ['path', { d: 'M3.34 19a10 10 0 1 1 17.32 0' }],\n ],\n 'user-check': [\n ['path', { d: 'm16 11 2 2 4-4' }],\n ['path', { d: 'M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2' }],\n ['circle', { cx: '9', cy: '7', r: '4' }],\n ],\n 'shield-check': [\n [\n 'path',\n {\n d: 'M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z',\n },\n ],\n ['path', { d: 'm9 12 2 2 4-4' }],\n ],\n upload: [\n ['path', { d: 'M12 3v12' }],\n ['path', { d: 'm17 8-5-5-5 5' }],\n ['path', { d: 'M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4' }],\n ],\n package: [\n [\n 'path',\n {\n d: 'M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z',\n },\n ],\n ['path', { d: 'M12 22V12' }],\n ['path', { d: 'M3.29 7 12 12l8.71-5' }],\n ['path', { d: 'm7.5 4.27 9 5.15' }],\n ],\n plus: [\n ['path', { d: 'M5 12h14' }],\n ['path', { d: 'M12 5v14' }],\n ],\n user: [\n ['path', { d: 'M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2' }],\n ['circle', { cx: '12', cy: '7', r: '4' }],\n ],\n bot: [\n ['path', { d: 'M12 8V4H8' }],\n ['rect', { width: '16', height: '12', x: '4', y: '8', rx: '2' }],\n ['path', { d: 'M2 14h2' }],\n ['path', { d: 'M20 14h2' }],\n ['path', { d: 'M15 13v2' }],\n ['path', { d: 'M9 13v2' }],\n ],\n 'list-checks': [\n ['path', { d: 'M13 5h8' }],\n ['path', { d: 'M13 12h8' }],\n ['path', { d: 'M13 19h8' }],\n ['path', { d: 'm3 17 2 2 4-4' }],\n ['path', { d: 'm3 7 2 2 4-4' }],\n ],\n palette: [\n [\n 'path',\n {\n d: 'M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z',\n },\n ],\n ['circle', { cx: '13.5', cy: '6.5', r: '.5', fill: 'currentColor' }],\n ['circle', { cx: '17.5', cy: '10.5', r: '.5', fill: 'currentColor' }],\n ['circle', { cx: '6.5', cy: '12.5', r: '.5', fill: 'currentColor' }],\n ['circle', { cx: '8.5', cy: '7.5', r: '.5', fill: 'currentColor' }],\n ],\n 'image-up': [\n [\n 'path',\n {\n d: 'M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21',\n },\n ],\n ['path', { d: 'm14 19.5 3-3 3 3' }],\n ['path', { d: 'M17 22v-5.5' }],\n ['circle', { cx: '9', cy: '9', r: '2' }],\n ],\n lock: [\n ['rect', { width: '18', height: '11', x: '3', y: '11', rx: '2', ry: '2' }],\n ['path', { d: 'M7 11V7a5 5 0 0 1 10 0v4' }],\n ],\n play: [\n [\n 'path',\n {\n d: 'M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z',\n },\n ],\n ],\n 'lock-open': [\n ['rect', { width: '18', height: '11', x: '3', y: '11', rx: '2', ry: '2' }],\n ['path', { d: 'M7 11V7a5 5 0 0 1 9.9-1' }],\n ],\n eye: [\n [\n 'path',\n {\n d: 'M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0',\n },\n ],\n ['circle', { cx: '12', cy: '12', r: '3' }],\n ],\n 'eye-off': [\n [\n 'path',\n {\n d: 'M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49',\n },\n ],\n ['path', { d: 'M14.084 14.158a3 3 0 0 1-4.242-4.242' }],\n [\n 'path',\n {\n d: 'M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143',\n },\n ],\n ['path', { d: 'm2 2 20 20' }],\n ],\n files: [\n [\n 'path',\n {\n d: 'M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8',\n },\n ],\n [\n 'path',\n {\n d: 'M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z',\n },\n ],\n [\n 'path',\n {\n d: 'M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1',\n },\n ],\n ],\n 'git-branch': [\n [\n 'path',\n {\n d: 'M15 6a9 9 0 0 0-9 9V3',\n },\n ],\n [\n 'circle',\n {\n cx: '18',\n cy: '6',\n r: '3',\n },\n ],\n [\n 'circle',\n {\n cx: '6',\n cy: '18',\n r: '3',\n },\n ],\n ],\n 'messages-square': [\n [\n 'path',\n {\n d: 'M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z',\n },\n ],\n [\n 'path',\n {\n d: 'M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1',\n },\n ],\n ],\n inbox: [\n [\n 'polyline',\n {\n points: '22 12 16 12 14 15 10 15 8 12 2 12',\n },\n ],\n [\n 'path',\n {\n d: 'M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z',\n },\n ],\n ],\n 'folder-key': [\n [\n 'path',\n {\n d: 'M13 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v1.36',\n },\n ],\n [\n 'path',\n {\n d: 'M19 12v6',\n },\n ],\n [\n 'path',\n {\n d: 'M19 14h2',\n },\n ],\n [\n 'circle',\n {\n cx: '19',\n cy: '20',\n r: '2',\n },\n ],\n ],\n users: [\n [\n 'path',\n {\n d: 'M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2',\n },\n ],\n [\n 'path',\n {\n d: 'M16 3.128a4 4 0 0 1 0 7.744',\n },\n ],\n [\n 'path',\n {\n d: 'M22 21v-2a4 4 0 0 0-3-3.87',\n },\n ],\n [\n 'circle',\n {\n cx: '9',\n cy: '7',\n r: '4',\n },\n ],\n ],\n 'settings-2': [\n [\n 'path',\n {\n d: 'M14 17H5',\n },\n ],\n [\n 'path',\n {\n d: 'M19 7h-9',\n },\n ],\n [\n 'circle',\n {\n cx: '17',\n cy: '17',\n r: '3',\n },\n ],\n [\n 'circle',\n {\n cx: '7',\n cy: '7',\n r: '3',\n },\n ],\n ],\n settings: [\n [\n 'path',\n {\n d: 'M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915',\n },\n ],\n [\n 'circle',\n {\n cx: '12',\n cy: '12',\n r: '3',\n },\n ],\n ],\n monitor: [\n [\n 'rect',\n {\n width: '20',\n height: '14',\n x: '2',\n y: '3',\n rx: '2',\n },\n ],\n [\n 'line',\n {\n x1: '8',\n x2: '16',\n y1: '21',\n y2: '21',\n },\n ],\n [\n 'line',\n {\n x1: '12',\n x2: '12',\n y1: '17',\n y2: '21',\n },\n ],\n ],\n globe: [\n [\n 'circle',\n {\n cx: '12',\n cy: '12',\n r: '10',\n },\n ],\n [\n 'path',\n {\n d: 'M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20',\n },\n ],\n [\n 'path',\n {\n d: 'M2 12h20',\n },\n ],\n ],\n 'panel-right': [\n [\n 'rect',\n {\n width: '18',\n height: '18',\n x: '3',\n y: '3',\n rx: '2',\n },\n ],\n [\n 'path',\n {\n d: 'M15 3v18',\n },\n ],\n ],\n 'panels-top-left': [\n [\n 'rect',\n {\n width: '18',\n height: '18',\n x: '3',\n y: '3',\n rx: '2',\n },\n ],\n [\n 'path',\n {\n d: 'M3 9h18',\n },\n ],\n [\n 'path',\n {\n d: 'M9 21V9',\n },\n ],\n ],\n 'grip-vertical': [\n ['circle', { cx: '9', cy: '12', r: '1' }],\n ['circle', { cx: '9', cy: '5', r: '1' }],\n ['circle', { cx: '9', cy: '19', r: '1' }],\n ['circle', { cx: '15', cy: '12', r: '1' }],\n ['circle', { cx: '15', cy: '5', r: '1' }],\n ['circle', { cx: '15', cy: '19', r: '1' }],\n ],\n star: [\n [\n 'path',\n {\n d: 'M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z',\n },\n ],\n ],\n copy: [\n ['rect', { width: '14', height: '14', x: '8', y: '8', rx: '2', ry: '2' }],\n ['path', { d: 'M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2' }],\n ],\n 'external-link': [\n ['path', { d: 'M15 3h6v6' }],\n ['path', { d: 'M10 14 21 3' }],\n ['path', { d: 'M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6' }],\n ],\n sun: [\n ['circle', { cx: '12', cy: '12', r: '4' }],\n ['path', { d: 'M12 2v2' }],\n ['path', { d: 'M12 20v2' }],\n ['path', { d: 'm4.93 4.93 1.41 1.41' }],\n ['path', { d: 'm17.66 17.66 1.41 1.41' }],\n ['path', { d: 'M2 12h2' }],\n ['path', { d: 'M20 12h2' }],\n ['path', { d: 'm6.34 17.66-1.41 1.41' }],\n ['path', { d: 'm19.07 4.93-1.41 1.41' }],\n ],\n moon: [\n [\n 'path',\n {\n d: 'M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401',\n },\n ],\n ],\n crop: [\n ['path', { d: 'M6 2v14a2 2 0 0 0 2 2h14' }],\n ['path', { d: 'M18 22V8a2 2 0 0 0-2-2H2' }],\n ],\n ban: [\n ['circle', { cx: '12', cy: '12', r: '10' }],\n ['path', { d: 'M4.929 4.929 19.07 19.071' }],\n ],\n x: [\n ['path', { d: 'M18 6 6 18' }],\n ['path', { d: 'm6 6 12 12' }],\n ],\n 'message-square': [\n [\n 'path',\n {\n d: 'M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z',\n },\n ],\n ],\n keyboard: [\n ['path', { d: 'M10 8h.01' }],\n ['path', { d: 'M12 12h.01' }],\n ['path', { d: 'M14 8h.01' }],\n ['path', { d: 'M16 12h.01' }],\n ['path', { d: 'M18 8h.01' }],\n ['path', { d: 'M6 8h.01' }],\n ['path', { d: 'M7 16h10' }],\n ['path', { d: 'M8 12h.01' }],\n ['rect', { width: '20', height: '16', x: '2', y: '4', rx: '2' }],\n ],\n smartphone: [\n ['rect', { width: '14', height: '20', x: '5', y: '2', rx: '2', ry: '2' }],\n ['path', { d: 'M12 18h.01' }],\n ],\n 'sliders-horizontal': [\n ['path', { d: 'M10 5H3' }],\n ['path', { d: 'M12 19H3' }],\n ['path', { d: 'M14 3v4' }],\n ['path', { d: 'M16 17v4' }],\n ['path', { d: 'M21 12h-9' }],\n ['path', { d: 'M21 19h-5' }],\n ['path', { d: 'M21 5h-7' }],\n ['path', { d: 'M8 10v4' }],\n ['path', { d: 'M8 12H3' }],\n ],\n info: [\n ['circle', { cx: '12', cy: '12', r: '10' }],\n ['path', { d: 'M12 16v-4' }],\n ['path', { d: 'M12 8h.01' }],\n ],\n puzzle: [\n [\n 'path',\n {\n d: 'M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z',\n },\n ],\n ],\n check: [\n [\n 'path',\n {\n d: 'M20 6 9 17l-5-5',\n },\n ],\n ],\n laptop: [\n [\n 'path',\n {\n d: 'M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z',\n },\n ],\n ['path', { d: 'M20.054 15.987H3.946' }],\n ],\n server: [\n ['rect', { width: '20', height: '8', x: '2', y: '2', rx: '2', ry: '2' }],\n ['rect', { width: '20', height: '8', x: '2', y: '14', rx: '2', ry: '2' }],\n ['line', { x1: '6', x2: '6.01', y1: '6', y2: '6' }],\n ['line', { x1: '6', x2: '6.01', y1: '18', y2: '18' }],\n ],\n building: [\n ['path', { d: 'M12 10h.01' }],\n ['path', { d: 'M12 14h.01' }],\n ['path', { d: 'M12 6h.01' }],\n ['path', { d: 'M16 10h.01' }],\n ['path', { d: 'M16 14h.01' }],\n ['path', { d: 'M16 6h.01' }],\n ['path', { d: 'M8 10h.01' }],\n ['path', { d: 'M8 14h.01' }],\n ['path', { d: 'M8 6h.01' }],\n ['path', { d: 'M9 22v-3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3' }],\n ['rect', { x: '4', y: '2', width: '16', height: '20', rx: '2' }],\n ],\n briefcase: [\n ['path', { d: 'M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16' }],\n ['rect', { width: '20', height: '14', x: '2', y: '6', rx: '2' }],\n ],\n 'flask-conical': [\n [\n 'path',\n {\n d: 'M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2',\n },\n ],\n ['path', { d: 'M6.453 15h11.094' }],\n ['path', { d: 'M8.5 2h7' }],\n ],\n 'gamepad-2': [\n ['line', { x1: '6', x2: '10', y1: '11', y2: '11' }],\n ['line', { x1: '8', x2: '8', y1: '9', y2: '13' }],\n ['line', { x1: '15', x2: '15.01', y1: '12', y2: '12' }],\n ['line', { x1: '18', x2: '18.01', y1: '10', y2: '10' }],\n [\n 'path',\n {\n d: 'M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z',\n },\n ],\n ],\n paintbrush: [\n ['path', { d: 'm14.622 17.897-10.68-2.913' }],\n [\n 'path',\n {\n d: 'M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z',\n },\n ],\n [\n 'path',\n {\n d: 'M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15',\n },\n ],\n ],\n 'audio-lines': [\n ['path', { d: 'M2 10v3' }],\n ['path', { d: 'M6 6v11' }],\n ['path', { d: 'M10 3v18' }],\n ['path', { d: 'M14 8v7' }],\n ['path', { d: 'M18 5v13' }],\n ['path', { d: 'M22 10v3' }],\n ],\n 'book-open': [\n ['path', { d: 'M12 5v16' }],\n [\n 'path',\n {\n d: 'M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z',\n },\n ],\n ],\n zap: [\n [\n 'path',\n {\n d: 'M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z',\n },\n ],\n ],\n heart: [\n [\n 'path',\n {\n d: 'M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5',\n },\n ],\n ],\n leaf: [\n [\n 'path',\n {\n d: 'M11 20a10 10 0 0010-10 25.9 25.9 0 00-1.04-7.281 1 1 0 00-1.755-.325C15.833 5.5 13 5.5 9.8 6.1A7 7 0 0011 20',\n },\n ],\n ['path', { d: 'M2 21a5 5 0 012.911-4.544C7.613 15.212 8.351 15.24 11 13' }],\n ],\n phone: [\n [\n 'path',\n {\n d: 'M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384',\n },\n ],\n ],\n video: [\n ['path', { d: 'm16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5' }],\n ['rect', { x: '2', y: '6', width: '14', height: '12', rx: '2' }],\n ],\n 'video-off': [\n ['path', { d: 'M10.66 6H14a2 2 0 0 1 2 2v2.5l5.248-3.062A.5.5 0 0 1 22 7.87v8.196' }],\n ['path', { d: 'M16 16a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2' }],\n ['path', { d: 'm2 2 20 20' }],\n ],\n 'phone-off': [\n [\n 'path',\n {\n d: 'M10.1 13.9a14 14 0 0 0 3.732 2.668 1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2 18 18 0 0 1-12.728-5.272',\n },\n ],\n ['path', { d: 'M22 2 2 22' }],\n [\n 'path',\n {\n d: 'M4.76 13.582A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 .244.473',\n },\n ],\n ],\n mic: [\n ['path', { d: 'M12 19v3' }],\n ['path', { d: 'M19 10v2a7 7 0 0 1-14 0v-2' }],\n ['rect', { x: '9', y: '2', width: '6', height: '13', rx: '3' }],\n ],\n 'mic-off': [\n ['path', { d: 'M12 19v3' }],\n ['path', { d: 'M15 9.34V5a3 3 0 0 0-5.68-1.33' }],\n ['path', { d: 'M16.95 16.95A7 7 0 0 1 5 12v-2' }],\n ['path', { d: 'M18.89 13.23A7 7 0 0 0 19 12v-2' }],\n ['path', { d: 'm2 2 20 20' }],\n ['path', { d: 'M9 9v3a3 3 0 0 0 5.12 2.12' }],\n ],\n tv: [\n ['path', { d: 'm17 2-5 5-5-5' }],\n ['rect', { width: '20', height: '15', x: '2', y: '7', rx: '2' }],\n ],\n};\n\nexport function ChannelSidebarIcon({\n name = 'panels-top-left',\n size = 16,\n}: {\n name?: string | undefined;\n size?: number | string;\n}): ReactElement {\n const nodes = Object.hasOwn(glyphs, name) ? glyphs[name]! : glyphs['panels-top-left']!;\n return (\n \n {nodes.map(([tag, attributes], index) => createElement(tag, { ...attributes, key: index }))}\n \n );\n}\n","import * as stylex from '@stylexjs/stylex';\n\nexport const space = stylex.defineConsts({\n x1: '2px',\n x2: '4px',\n x3: '8px',\n x4: '12px',\n x5: '16px',\n x6: '24px',\n});\n\nexport const text = stylex.defineConsts({\n metaSize: '12px',\n metaLine: '16px',\n bodySize: '13px',\n bodyLine: '20px',\n titleSize: '14px',\n titleLine: '20px',\n regular: '400',\n strong: '500',\n});\n\nexport const radius = stylex.defineConsts({\n xs: 'var(--dsw-radius-xs, 4px)',\n sm: 'var(--dsw-radius-sm, 8px)',\n md: 'var(--dsw-radius-md, 12px)',\n lg: 'var(--dsw-radius-lg, 16px)',\n panel: 'var(--dsw-radius-panel)',\n round: '50%',\n});\n\nexport const border = stylex.defineConsts({\n hairline: '1px',\n focus: 'var(--dsw-focus-ring-width, 2px)',\n});\n\nexport const size = stylex.defineConsts({\n inlineIcon: '26px',\n icon: '28px',\n row: '32px',\n nav: '40px',\n});\n\nexport const dialog = stylex.defineConsts({\n small: 'min(440px, calc(100vw - 32px))',\n bodyMax: 'min(60vh, 520px)',\n medium: 'min(760px, calc(100vw - 32px))',\n wide: 'min(1060px, calc(100vw - 32px))',\n});\n\nexport const actionColor = stylex.defineConsts({\n secondary:\n 'color-mix(in srgb, var(--dsw-alias-label-primary) 8%, var(--dsw-alias-bg-module-platform))',\n hover:\n 'color-mix(in srgb, var(--dsw-alias-label-primary) 13%, var(--dsw-alias-bg-module-platform))',\n danger:\n 'color-mix(in srgb, var(--dsw-alias-state-error-primary) 10%, var(--dsw-alias-bg-module-platform))',\n dangerLabel:\n 'color-mix(in srgb, var(--dsw-alias-state-error-primary) 65%, var(--dsw-alias-label-primary))',\n});\n\nexport const color = stylex.defineConsts({\n fg: 'var(--dsw-alias-label-primary)',\n muted: 'var(--dsw-alias-label-secondary)',\n subtle: 'var(--dsw-alias-label-tertiary)',\n divider: 'var(--dsw-alias-border-l1)',\n border: 'var(--dsw-alias-border-l2)',\n borderStrong: 'var(--dsw-alias-border-l3)',\n hover: 'var(--dsw-alias-interactive-bg-hover)',\n selected: 'var(--dsw-alias-interactive-bg-active)',\n navSelected: 'var(--dsw-specific-sidebar-nav-item-active)',\n accent: 'var(--dsw-alias-state-business-primary)',\n accentText: 'var(--dsw-alias-link)',\n onAccent: 'var(--dsw-alias-label-primary-foreground)',\n danger: 'var(--dsw-alias-state-error-primary)',\n onDanger: 'var(--dsw-alias-label-primary-foreground)',\n dangerEdge: 'var(--dsw-alias-state-error-secondary)',\n dangerSoft: 'var(--dsw-alias-interactive-bg-hover-danger)',\n warning: 'var(--dsw-alias-state-warn-primary)',\n warningEdge: 'var(--dsw-alias-state-warn-secondary)',\n warningSoft: 'var(--dsw-alias-state-warn-tertiary)',\n success: 'var(--dsw-alias-state-success-primary)',\n surface: 'var(--dsw-alias-bg-module-platform)',\n elevated: 'var(--dsw-alias-button-elevated-fill)',\n base: 'var(--dsw-alias-bg-base)',\n modal: 'var(--dsw-alias-bg-layer-2)',\n well: 'var(--dsw-alias-bg-base)',\n accentTint: 'var(--dsw-alias-state-business-tertiary)',\n});\n","import type { ReactElement, ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\n\nimport { ChannelSidebarIcon } from '../channel-sidebar-icon.js';\nimport { border, color, radius, size, space, text } from './tokens.stylex.js';\n\nconst styles = stylex.create({\n root: {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n gap: space.x3,\n marginBlock: space.x4,\n paddingBlock: space.x6,\n paddingInline: space.x5,\n borderWidth: border.hairline,\n borderStyle: 'dashed',\n borderColor: color.border,\n borderRadius: radius.md,\n textAlign: 'center',\n },\n panel: {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n flexGrow: 1,\n gap: space.x4,\n padding: space.x5,\n boxSizing: 'border-box',\n textAlign: 'center',\n color: color.muted,\n },\n icon: { width: size.nav, height: size.nav, flexShrink: 0, color: color.subtle },\n title: {\n margin: 0,\n color: color.fg,\n fontSize: text.bodySize,\n lineHeight: text.bodyLine,\n fontWeight: text.strong,\n },\n description: {\n margin: 0,\n maxWidth: '360px',\n color: color.muted,\n fontSize: text.metaSize,\n lineHeight: text.metaLine,\n },\n});\n\nexport function EmptyState({\n title,\n description,\n action,\n status = false,\n}: {\n readonly title: ReactNode;\n readonly description?: ReactNode;\n readonly action?: ReactNode;\n readonly status?: boolean;\n}): ReactElement {\n return (\n
\n

{title}

\n {description === undefined ? null : (\n

{description}

\n )}\n {action}\n
\n );\n}\n\nexport function PanelEmptyState({\n icon,\n children,\n action,\n}: {\n readonly icon?: string | undefined;\n readonly children: ReactNode;\n readonly action?: ReactNode;\n}): ReactElement {\n return (\n
\n \n \n \n

{children}

\n {action === undefined ? null :
{action}
}\n
\n );\n}\n","import { useCallback, useRef, type DependencyList, type RefCallback } from 'react';\n\nexport function useMountedResource(\n start: (node: T) => void | (() => void),\n dependencies: DependencyList,\n): RefCallback {\n const cleanup = useRef<(() => void) | undefined>(undefined);\n return useCallback((node: T | null) => {\n cleanup.current?.();\n cleanup.current = undefined;\n if (node !== null) cleanup.current = start(node) || undefined;\n }, dependencies);\n}\n","export const BH = {\n labelSecondary: 'var(--dsw-alias-label-secondary)',\n hoverFill: 'var(--dsw-alias-interactive-bg-hover)',\n errorPrimary: 'var(--dsw-alias-state-error-primary)',\n radiusMd: 'var(--dsw-radius-md)',\n labelPrimary: 'var(--dsw-alias-label-primary, #0f1115)',\n labelPrimaryForeground: 'var(--dsw-alias-label-primary-foreground, #ffffff)',\n borderL2: 'var(--dsw-alias-border-l2, #0000001a)',\n borderL3: 'var(--dsw-alias-border-l3, #0000001f)',\n borderL4: 'var(--dsw-alias-border-l4, #00000029)',\n bgBase: 'var(--dsw-alias-bg-base, #ffffff)',\n buttonPrimaryFill: 'var(--dsw-alias-button-primary-fill, #0f1115)',\n buttonElevatedFill: 'var(--dsw-alias-button-elevated-fill, transparent)',\n businessPrimary: 'var(--dsw-alias-state-business-primary, #4176e6)',\n hoverScrim: 'color-mix(in srgb, var(--dsw-alias-bg-base) 35%, transparent)',\n} as const;\n\nexport const VIDEO_SURFACE = {\n background: '#000000',\n spinnerTrack: 'rgba(255, 255, 255, 0.18)',\n spinnerArc: '#ffffff',\n onVideo: '#ffffff',\n} as const;\n","import type { ViewerKey } from './locale.js';\n\nexport type ViewerAction = 'open' | 'collapse';\n\nexport function nextExpanded(action: ViewerAction): boolean {\n return action === 'open';\n}\n\nexport type FramePhase = 'connecting' | 'live' | 'empty';\n\nexport const PHASE_SMOOTH_AFTER = 2;\n\nexport interface SmoothedPhase {\n readonly phase: FramePhase;\n readonly streak: number;\n}\n\nexport function smoothPhase(shown: FramePhase, raw: FramePhase, streak: number): SmoothedPhase {\n if (raw === 'live') return { phase: 'live', streak: 0 };\n if (shown !== 'live') return { phase: raw, streak: 0 };\n const next = streak + 1;\n if (next >= PHASE_SMOOTH_AFTER) return { phase: raw, streak: next };\n return { phase: shown, streak: next };\n}\n\nexport function dotStateFor(phase: FramePhase): 'done' | 'ongoing' | 'error' {\n if (phase === 'live') return 'done';\n if (phase === 'empty') return 'error';\n return 'ongoing';\n}\n\nexport function statusKeyFor(phase: FramePhase, reconnecting: boolean): ViewerKey {\n if (phase === 'live') return 'entry.live';\n if (phase === 'empty') return 'entry.noScreen';\n return reconnecting ? 'entry.reconnecting' : 'entry.connecting';\n}\n\nexport function stopKey(busy: boolean, stopping: boolean): ViewerKey {\n return busy || stopping ? 'entry.stopping' : 'entry.stop';\n}\n\nconst EXIT_REPORT = /^exited code=\\d+$/;\n\nexport function isExitReport(detail: string | undefined): boolean {\n return detail !== undefined && EXIT_REPORT.test(detail);\n}\n","import type { FramePhase } from './viewer-state.js';\n\nexport const EMPTY_AFTER_MISSES = 6;\n\nexport const BUSY_EMPTY_AFTER = 30;\n\nexport const QUIET_TOLERANCE = 4;\n\nexport const QUIET_ABANDON = 120;\n\nexport const LOSS_REMOUNT_AFTER = 3;\n\nexport const MAX_AUTO_RELOAD = 3;\n\nconst STATUS_ELEMENT_ID = 'status-display';\n\nconst BUSY_TEXT = /connecting|reconnect|disconnect|failed|error/i;\n\nexport interface StreamSample {\n readonly sized: boolean;\n readonly busy: boolean;\n readonly signature?: number;\n}\n\nexport interface StreamTracker {\n readonly misses: number;\n readonly busyStreak: number;\n readonly quiet: number;\n readonly lastSignature?: number;\n readonly live?: true;\n}\n\nexport function hashBytes(data: Uint8ClampedArray): number {\n let hash = 0x81_9c_9d_c5;\n for (let index = 0; index < data.length; index += 1) {\n hash ^= data[index] ?? 0;\n hash = Math.imul(hash, 0x01_00_01_93);\n }\n return hash >>> 0;\n}\n\nexport function upstreamBusy(doc: Document | null | undefined): boolean {\n try {\n const element = doc?.getElementById(STATUS_ELEMENT_ID) as HTMLElement | null;\n if (element === null || element === undefined) return false;\n if (element.classList.contains('hidden')) return false;\n return BUSY_TEXT.test(element.textContent ?? '');\n } catch {\n return false;\n }\n}\n\nfunction signatureOf(\n doc: Document,\n surface: HTMLVideoElement | HTMLCanvasElement,\n): number | undefined {\n try {\n const scratch = doc.createElement('canvas');\n scratch.width = 16;\n scratch.height = 16;\n const context = scratch.getContext('2d', { willReadFrequently: true });\n if (context === null) return undefined;\n context.drawImage(surface, 0, 0, 16, 16);\n return hashBytes(context.getImageData(0, 0, 16, 16).data);\n } catch {\n return undefined;\n }\n}\n\nexport function sampleSurface(doc: Document | null | undefined): StreamSample {\n const busy = upstreamBusy(doc);\n let sized = false;\n let signature: number | undefined;\n try {\n const surface = doc?.getElementById('videoCanvas') as\n | HTMLVideoElement\n | HTMLCanvasElement\n | null;\n const videoWidth = (surface as { readonly videoWidth?: unknown } | null)?.videoWidth;\n const canvasWidth = (surface as { readonly width?: unknown } | null)?.width;\n const width =\n typeof videoWidth === 'number'\n ? videoWidth\n : typeof canvasWidth === 'number'\n ? canvasWidth\n : 0;\n sized = surface !== null && surface !== undefined && width > 0;\n if (sized && surface !== null && surface !== undefined && doc !== null && doc !== undefined) {\n signature = signatureOf(doc, surface);\n }\n } catch {\n signature = undefined;\n }\n return signature === undefined ? { sized, busy } : { sized, busy, signature };\n}\nfunction withSignature(\n base: { readonly misses: number; readonly busyStreak: number; readonly quiet: number },\n signature: number | undefined,\n): StreamTracker {\n return signature === undefined ? { ...base } : { ...base, lastSignature: signature };\n}\n\nfunction withPreviousSignature(\n base: { readonly misses: number; readonly busyStreak: number; readonly quiet: number },\n prev: StreamTracker,\n): StreamTracker {\n return prev.lastSignature === undefined\n ? { ...base }\n : { ...base, lastSignature: prev.lastSignature };\n}\n\nexport function shouldRemountLoss(lossStreak: number): boolean {\n return lossStreak >= LOSS_REMOUNT_AFTER;\n}\n\nexport function shouldAutoReload(phase: FramePhase, everLive: boolean, attempts: number): boolean {\n return phase === 'empty' && !everLive && attempts < MAX_AUTO_RELOAD;\n}\n\nexport function nextStreamTracker(\n prev: StreamTracker,\n sample: StreamSample,\n): { readonly tracker: StreamTracker; readonly phase: FramePhase } {\n const signature = sample.signature;\n if (!sample.sized) {\n const misses = prev.misses + 1;\n return {\n tracker: withSignature({ misses, busyStreak: 0, quiet: 0 }, signature),\n phase: misses >= EMPTY_AFTER_MISSES ? 'empty' : 'connecting',\n };\n }\n if (sample.busy) {\n const busyStreak = prev.busyStreak + 1;\n return {\n tracker: withPreviousSignature({ misses: prev.misses, busyStreak, quiet: 0 }, prev),\n phase: busyStreak >= BUSY_EMPTY_AFTER ? 'empty' : 'connecting',\n };\n }\n const changed =\n signature !== undefined && prev.lastSignature !== undefined && signature !== prev.lastSignature;\n if (changed) {\n return {\n tracker: { ...withSignature({ misses: 0, busyStreak: 0, quiet: 0 }, signature), live: true },\n phase: 'live',\n };\n }\n if (signature === undefined) {\n return { tracker: { misses: 0, busyStreak: 0, quiet: 0, live: true }, phase: 'live' };\n }\n const quiet = prev.quiet + 1;\n if (quiet >= QUIET_ABANDON) {\n return {\n tracker: withSignature({ misses: EMPTY_AFTER_MISSES, busyStreak: 0, quiet }, signature),\n phase: 'empty',\n };\n }\n if (prev.live === true || quiet >= QUIET_TOLERANCE) {\n return {\n tracker: { ...withSignature({ misses: 0, busyStreak: 0, quiet }, signature), live: true },\n phase: 'live',\n };\n }\n return {\n tracker: withSignature({ misses: prev.misses, busyStreak: 0, quiet }, signature),\n phase: 'connecting',\n };\n}\n","import {\n Fragment,\n useCallback,\n useRef,\n useState,\n type CSSProperties,\n type ReactElement,\n type ReactNode,\n type RefCallback,\n} from 'react';\nimport {\n Button,\n IconFullscreenOutlineRegular,\n Pill,\n StateDot,\n} from '@deepseek-ai/dsh-client-ui-primitives';\nimport { useMountedResource } from '../mounted-resource.js';\nimport { BH, VIDEO_SURFACE } from './tokens.js';\nimport {\n dotStateFor,\n nextExpanded,\n smoothPhase,\n statusKeyFor,\n stopKey,\n type FramePhase,\n} from './viewer-state.js';\nimport {\n LOSS_REMOUNT_AFTER,\n nextStreamTracker,\n sampleSurface,\n shouldAutoReload,\n shouldRemountLoss,\n type StreamTracker,\n} from './frame-liveness.js';\nimport type { ViewerTranslate } from './locale.js';\nexport type ViewerLifecycleEvent =\n | { readonly type: 'mount' }\n | { readonly type: 'overlay'; readonly open: boolean }\n | { readonly type: 'phase'; readonly from: FramePhase; readonly to: FramePhase }\n | { readonly type: 'auto-reload'; readonly attempt: number }\n | { readonly type: 'manual-retry' }\n | { readonly type: 'loss-remount'; readonly streak: number };\n\nexport const SPIN_STYLE = '@keyframes bc-spin { to { transform: rotate(360deg); } }';\n\nfunction useStreamPhase(onSample: (phase: FramePhase) => void): RefCallback {\n return useMountedResource(\n (iframe) => {\n let active = true;\n let tracker: StreamTracker = { misses: 0, busyStreak: 0, quiet: 0 };\n let timer: ReturnType | undefined;\n const check = (): void => {\n if (!active) return;\n let doc: Document | null = null;\n try {\n doc = iframe.contentDocument;\n } catch {\n doc = null;\n }\n const next = nextStreamTracker(tracker, sampleSurface(doc));\n tracker = next.tracker;\n onSample(next.phase);\n timer = setTimeout(check, 1000);\n };\n timer = setTimeout(check, 300);\n return () => {\n active = false;\n if (timer !== undefined) clearTimeout(timer);\n };\n },\n [onSample],\n );\n}\n\nexport function ScreenIndicator({ label = '连接中' }: { readonly label?: string }): ReactElement {\n const size = 26;\n const stroke = 2;\n const radius = (size - stroke) / 2;\n const circumference = 2 * Math.PI * radius;\n return (\n \n
\n \n \n \n \n {label}\n
\n \n );\n}\n\nfunction ScreenEmpty({\n t,\n onRetry,\n}: {\n readonly t: ViewerTranslate;\n readonly onRetry: () => void;\n}): ReactElement {\n return (\n \n
\n {t('entry.noScreen')}\n \n
\n \n );\n}\n\nexport interface StreamOverlayProps {\n readonly phase: FramePhase;\n readonly reconnecting: boolean;\n readonly hovered: boolean;\n readonly t: ViewerTranslate;\n readonly onRetry: () => void;\n readonly onOpen: () => void;\n}\n\nexport function StreamOverlay(props: StreamOverlayProps): ReactElement | null {\n const { phase, reconnecting, hovered, t, onRetry, onOpen } = props;\n if (phase === 'connecting') {\n return ;\n }\n if (phase === 'empty') {\n return ;\n }\n if (!hovered) return null;\n return (\n \n \n \n {t('entry.openFullscreen')}\n \n \n );\n}\n\ninterface ScaledFrameProps {\n readonly src: string;\n readonly title: string;\n readonly design: { width: number; height: number };\n readonly interactive: boolean;\n readonly fit?: 'width' | 'contain';\n readonly iframeRef?: RefCallback;\n}\n\nfunction ScaledFrame({\n src,\n title,\n design,\n interactive,\n fit = 'width',\n iframeRef,\n}: ScaledFrameProps): ReactElement {\n const DESIGN_WIDTH = design.width;\n const DESIGN_HEIGHT = design.height;\n const [box, setBox] = useState({ width: DESIGN_WIDTH, height: DESIGN_HEIGHT });\n const resizeResource = useMountedResource(\n (element) => {\n const frame = element.querySelector('iframe');\n if (frame !== null) {\n frame.inert = !interactive;\n if (!interactive) frame.blur();\n }\n const update = (): void =>\n setBox({ width: element.clientWidth, height: element.clientHeight });\n update();\n const observer = new ResizeObserver(update);\n observer.observe(element);\n return () => observer.disconnect();\n },\n [interactive],\n );\n\n const scale =\n fit === 'contain'\n ? Math.min(box.width / DESIGN_WIDTH, box.height / DESIGN_HEIGHT)\n : box.width / DESIGN_WIDTH;\n const offsetX = fit === 'contain' ? Math.max(0, (box.width - DESIGN_WIDTH * scale) / 2) : 0;\n const offsetY = fit === 'contain' ? Math.max(0, (box.height - DESIGN_HEIGHT * scale) / 2) : 0;\n\n return (\n \n \n \n );\n}\n\nfunction CollapseIcon(): ReactElement {\n return (\n \n \n \n \n \n \n );\n}\n\nexport interface ViewerTitleBarProps {\n readonly t: ViewerTranslate;\n readonly title: string;\n readonly phase: FramePhase;\n readonly reconnecting: boolean;\n readonly busy: boolean;\n readonly stopping: boolean;\n readonly interactive: boolean;\n readonly extraControls?: ReactNode;\n readonly onToggleInteractive: () => void;\n readonly onStop: () => void;\n readonly onCollapse: () => void;\n readonly hideStop?: boolean | undefined;\n readonly hideInteractiveToggle?: boolean | undefined;\n}\n\nfunction StopButton({\n t,\n busy,\n stopping,\n onStop,\n}: {\n readonly t: ViewerTranslate;\n readonly busy: boolean;\n readonly stopping: boolean;\n readonly onStop: () => void;\n}): ReactElement {\n return (\n \n );\n}\n\nexport function ViewerTitleBar(props: ViewerTitleBarProps): ReactElement {\n const {\n t,\n title,\n phase,\n reconnecting,\n busy,\n stopping,\n interactive,\n extraControls,\n onToggleInteractive,\n onStop,\n onCollapse,\n hideStop,\n hideInteractiveToggle,\n } = props;\n return (\n \n \n \n {title}\n \n {t(statusKeyFor(phase, reconnecting))}\n {interactive ? null : (\n {t('entry.watchOnly')}\n )}\n \n {extraControls}\n {hideInteractiveToggle ? null : (\n \n {t(interactive ? 'entry.interactive.disable' : 'entry.interactive.enable')}\n \n )}\n {hideStop === true ? null : (\n \n )}\n \n \n \n \n );\n}\n\nexport interface RemoteViewerProps {\n readonly t: ViewerTranslate;\n readonly title: string;\n readonly src: string;\n readonly design: { width: number; height: number };\n readonly busy: boolean;\n readonly stopping: boolean;\n readonly onStop: () => void;\n readonly footer?: ReactNode;\n readonly notice?: ReactNode;\n readonly extraControls?: ReactNode;\n readonly onEvent?: (event: ViewerLifecycleEvent) => void;\n readonly interactive?: boolean;\n readonly onToggleInteractive?: () => void;\n readonly onDisableInteraction?: () => void;\n readonly expanded?: boolean;\n readonly onExpandedChange?: (expanded: boolean) => void;\n readonly hideStop?: boolean | undefined;\n readonly hideInteractiveToggle?: boolean | undefined;\n readonly allowFrameInput?: boolean | undefined;\n}\n\nexport function RemoteViewer({\n t,\n title,\n src,\n design,\n busy,\n stopping,\n onStop,\n footer,\n notice,\n extraControls,\n onEvent,\n interactive,\n onToggleInteractive,\n onDisableInteraction,\n expanded: controlledExpanded,\n onExpandedChange,\n hideStop,\n hideInteractiveToggle,\n allowFrameInput,\n}: RemoteViewerProps): ReactElement {\n const entryRef = useRef(null);\n const mounted = useRef(false);\n const [hovered, setHovered] = useState(false);\n const [ownExpanded, setOwnExpanded] = useState(false);\n const expanded = controlledExpanded ?? ownExpanded;\n const setExpanded = (next: boolean): void => {\n setOwnExpanded(next);\n onExpandedChange?.(next);\n };\n const [inputEnabled, setInputEnabled] = useState(false);\n const [reloadKey, setReloadKey] = useState(0);\n const [reconnecting, setReconnecting] = useState(false);\n const wasReady = useRef(false);\n const autoReloads = useRef(0);\n const lossStreak = useRef(0);\n const phaseRef = useRef('connecting');\n\n const [smooth, setSmooth] = useState<{ phase: FramePhase; streak: number }>({\n phase: 'connecting',\n streak: 0,\n });\n const resetFrame = useCallback(() => {\n phaseRef.current = 'connecting';\n setSmooth({ phase: 'connecting', streak: 0 });\n setReloadKey((key) => key + 1);\n }, []);\n const onSample = useCallback(\n (nextPhase: FramePhase): void => {\n const fromPhase = phaseRef.current;\n if (fromPhase !== nextPhase) {\n phaseRef.current = nextPhase;\n setSmooth((current) => smoothPhase(current.phase, nextPhase, current.streak));\n onEvent?.({ type: 'phase', from: fromPhase, to: nextPhase });\n }\n if (nextPhase === 'live') {\n wasReady.current = true;\n autoReloads.current = 0;\n lossStreak.current = 0;\n setReconnecting(false);\n return;\n }\n if (wasReady.current) {\n lossStreak.current += 1;\n if (shouldRemountLoss(lossStreak.current)) {\n wasReady.current = false;\n lossStreak.current = 0;\n onEvent?.({ type: 'loss-remount', streak: LOSS_REMOUNT_AFTER });\n setReconnecting(true);\n resetFrame();\n return;\n }\n }\n if (\n fromPhase !== nextPhase &&\n shouldAutoReload(nextPhase, wasReady.current, autoReloads.current)\n ) {\n autoReloads.current += 1;\n onEvent?.({ type: 'auto-reload', attempt: autoReloads.current });\n resetFrame();\n }\n },\n [resetFrame, onEvent],\n );\n const streamRef = useStreamPhase(onSample);\n const phase = smooth.phase;\n\n const reconnect = (): void => {\n onEvent?.({ type: 'manual-retry' });\n setReconnecting(true);\n autoReloads.current = 0;\n lossStreak.current = 0;\n wasReady.current = false;\n resetFrame();\n };\n const openViewer = (): void => {\n setExpanded(nextExpanded('open'));\n onEvent?.({ type: 'overlay', open: true });\n };\n const collapseViewer = (): void => {\n setInputEnabled(false);\n onDisableInteraction?.();\n setExpanded(nextExpanded('collapse'));\n onEvent?.({ type: 'overlay', open: false });\n requestAnimationFrame(() => entryRef.current?.focus());\n };\n const dialogResource = useMountedResource(\n (dialog) => {\n if (!mounted.current) {\n mounted.current = true;\n onEvent?.({ type: 'mount' });\n }\n if (!expanded) return;\n const onKey = (event: KeyboardEvent): void => {\n if (event.key !== 'Tab') return;\n const focusable = [\n ...dialog.querySelectorAll(\n 'button, [href], iframe, [tabindex]:not([tabindex=\"-1\"])',\n ),\n ].filter((element) => element.tabIndex !== -1);\n const first = focusable[0];\n const last = focusable.at(-1);\n if (first === undefined || last === undefined) return;\n const active = document.activeElement;\n if (event.shiftKey && (active === first || active === dialog)) {\n event.preventDefault();\n last.focus();\n } else if (!event.shiftKey && active === last) {\n event.preventDefault();\n first.focus();\n }\n };\n document.addEventListener('keydown', onKey);\n const previousOverflow = document.body.style.overflow;\n document.body.style.overflow = 'hidden';\n dialog.focus();\n return () => {\n document.removeEventListener('keydown', onKey);\n document.body.style.overflow = previousOverflow;\n };\n },\n [expanded, onDisableInteraction, onEvent],\n );\n\n const statusText = t(statusKeyFor(phase, reconnecting));\n const openable = phase === 'live' && !expanded;\n\n const overlay = (\n \n );\n\n const stopLabel = t(stopKey(busy, stopping));\n const rowButton = (disabled: boolean): CSSProperties => ({\n flex: 1,\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n height: 28,\n padding: '0 10px',\n borderRadius: 14,\n border: `1px solid ${BH.borderL3}`,\n background: BH.buttonElevatedFill,\n color: BH.labelPrimary,\n fontSize: 12,\n ...(disabled ? { opacity: 0.4, cursor: 'not-allowed' } : { cursor: 'pointer' }),\n });\n\n return (\n \n \n {expanded ? (\n setInputEnabled((current) => !current))\n }\n onStop={onStop}\n onCollapse={collapseViewer}\n hideStop={hideStop}\n hideInteractiveToggle={hideInteractiveToggle}\n />\n ) : null}\n {notice}\n setHovered(true)}\n onMouseLeave={() => setHovered(false)}\n onClick={() => {\n if (openable) openViewer();\n }}\n onKeyDown={(event) => {\n if (!openable) return;\n if (event.key !== 'Enter' && event.key !== ' ') return;\n event.preventDefault();\n openViewer();\n }}\n style={\n expanded\n ? { position: 'relative', flex: 1, minHeight: 0 }\n : { position: 'relative', cursor: openable ? 'pointer' : 'default' }\n }\n >\n \n {overlay}\n \n {expanded ? null : (\n \n \n {title}\n \n
\n {hideStop === true ? null : (\n \n {stopLabel}\n \n )}\n \n {t('entry.reconnect')}\n \n
\n {footer}\n
\n )}\n \n );\n}\n","export const VIEWER_EVENT_ENDPOINT = './api/computer/diagnostics/viewer';\n\nexport type { ViewerLifecycleEvent } from '../../../client/src/client/remote-viewer/index.js';\nimport type { ViewerLifecycleEvent } from '../../../client/src/client/remote-viewer/index.js';\nexport function viewerEventText(event: ViewerLifecycleEvent): string {\n switch (event.type) {\n case 'mount':\n return 'viewer mount docked';\n case 'overlay':\n return event.open ? 'viewer overlay open' : 'viewer overlay closed';\n case 'phase':\n return `viewer phase ${event.from}>${event.to}`;\n case 'auto-reload':\n return `viewer auto-reload attempt=${String(event.attempt)}`;\n case 'manual-retry':\n return 'viewer manual-retry';\n case 'loss-remount':\n return `viewer loss-remount streak=${String(event.streak)}`;\n }\n}\n\nexport async function reportViewerEvent(\n fetchImpl: typeof fetch | undefined,\n detail: string,\n): Promise {\n try {\n await (fetchImpl ?? fetch)(VIEWER_EVENT_ENDPOINT, {\n method: 'POST',\n credentials: 'same-origin',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ detail }),\n });\n } catch {}\n}\n","import type { TranslateNS } from '@deepseek-ai/dsh-client-ui-slots';\n\nexport const LOCALE_NS = 'botharness-computer';\n\nexport const zh = {\n 'local.error.permissions': '请在 macOS 系统设置中允许所需权限。',\n 'local.error.disk': '磁盘空间不足。请释放空间后重新检查。',\n 'local.error.write': '无法写入桌面组件。请检查安装目录权限后重试。',\n 'local.error.download': '桌面组件下载失败。请检查网络后重试。',\n 'local.error.verify': '桌面组件校验失败。请重新检查以下载安装。',\n 'local.error.install': '桌面组件安装失败。请检查磁盘空间和目录权限后重试。',\n 'local.error.settings': '无法打开系统设置。请手动打开“隐私与安全性”。',\n 'local.error.target': '操作目标已变更。请确认当前目标后重试。',\n 'local.error.request': '无法连接电脑服务。请检查 DSH 是否运行后重试。',\n 'local.error.setup': '电脑检查失败。请重试;若仍失败,请查看诊断日志。',\n 'local.open.accessibility': '打开辅助功能设置',\n 'local.open.screen': '打开屏幕录制设置',\n 'local.permissions.help':\n '允许运行 DSH 的应用访问这些权限,然后完全退出并重新打开该应用,再检查一次。',\n\n 'rows.target.title': '操作目标',\n 'rows.target.description': '本 Profile 的所有 Bot 共用一个目标;切换后需要重新授权操作。',\n 'rows.target.local': '本机 Computer',\n 'rows.target.container': 'Docker Computer',\n 'local.title': '本机 Computer',\n 'local.granted': '桌面权限已授予',\n 'local.description':\n '直接操作运行 DSH 的这台电脑(macOS、Windows 或 Linux)。首次检查会安装桌面操作组件;没有显示器的 Linux 服务器会启动一个虚拟桌面。登录请在这台电脑上完成。',\n 'local.check': '检查权限',\n 'local.downloading': '正在下载桌面操作组件 {percent}%({downloaded} / {total})',\n 'local.installing': '正在安装 {packages}:{percent}%',\n 'local.missing': '这台机器缺少桌面组件:{packages}',\n 'local.missing.manual':\n '安装需要管理员密码。请在这台机器的终端里运行下面的命令;装好后这里会自动重新检查。',\n 'local.install': '一键安装',\n 'local.copy': '复制命令',\n 'local.copied': '已复制',\n 'local.checking': '正在检查…',\n 'local.chip.granted': '已授权',\n 'local.chip.checking': '检查中',\n 'local.chip.unchecked': '未检查',\n 'local.chip.failed': '需要处理',\n 'local.chip.missing': '缺少组件',\n\n 'entry.label': '电脑',\n 'entry.screen.title': '{name} 的屏幕',\n 'entry.shared':\n '这台电脑由本 profile 的所有 PersonaBot 共享:各自拥有自己的窗口,共享登录态与文件。',\n 'entry.access.title': 'Computer Access',\n 'entry.access.on': 'Computer Access 已开启',\n 'entry.access.enable': '启用 Computer Access',\n 'entry.access.disable': '停用 Computer Access',\n 'entry.access.description': '开启后,该 Bot 的会话可以操作这台电脑',\n 'entry.access.failed': '切换 Computer Access 失败',\n 'entry.access.failureHint': '授权失败',\n 'entry.start': '启动',\n 'entry.starting': '启动中…',\n 'entry.chip.setup': '需要设置',\n 'entry.chip.authorize': '待授权',\n 'entry.chip.running': '运行中',\n 'entry.chip.stopped': '未启动',\n 'entry.chip.failed': '出错',\n 'entry.stop': '停止',\n 'entry.stopping': '停止中…',\n 'entry.reconnect': '重新连接',\n 'entry.connecting': '连接中',\n 'entry.reconnecting': '正在重新连接',\n 'entry.live': '已连接',\n 'entry.noScreen': '暂无画面',\n 'entry.openFullscreen': '打开大屏',\n 'entry.watchOnly': '观看模式 · 开启交互后可操作键盘鼠标',\n 'entry.interactive.enable': '开启交互',\n 'entry.interactive.disable': '停止交互',\n 'entry.collapseFullscreen': '收起全屏',\n 'entry.recentLogs': '近期动态',\n 'entry.recentLogs.empty': '暂无运行记录',\n 'entry.recentLogs.failed': '读取运行记录失败',\n 'entry.authorize': '授权并启动',\n 'entry.cancel': '取消',\n 'entry.remember': '本次会话内不再询问',\n 'entry.authorizeIntro': '启动会在你的机器上执行:',\n 'entry.authorize.probe': '检测本机容器运行时;缺失时只给安装引导,不会自动安装',\n 'entry.authorize.volume': '创建/复用持久卷(登录态与文件保留在这台电脑上)',\n 'entry.authorize.pull': '拉取镜像(首次约 1.2 GB 网络流量)并创建容器',\n 'entry.authorize.bind': '把 Web VNC 绑定到 127.0.0.1 的本地端口,仅本机可访问',\n 'entry.authorize.storage': '存储位置:{target}',\n 'entry.authorize.storageBindRisk':\n 'Bind mount 把浏览器 profile(含 SQLite 与缓存)直接落在宿主目录;在 Docker Desktop / Colima 等虚拟文件共享下文件锁不可靠,可能损坏数据,仅建议 Linux 原生 Docker 使用。详见 Docker 文档:https://docs.docker.com/storage/bind-mounts/',\n 'entry.phase.pulling': '正在拉取镜像',\n 'entry.phase.starting': '正在启动',\n 'entry.phase.stopping': '正在停止',\n 'entry.phase.exporting': '正在导出',\n 'entry.phase.importing': '正在导入',\n 'entry.phase.working': '处理中',\n 'entry.wait': '请稍候',\n 'entry.elapsed': '已用时 {seconds}s',\n 'entry.updated': '最后更新 {seconds}s 前',\n 'entry.setup':\n '未检测到容器运行时。任选其一安装后重试:\\n\\nColima(推荐,MIT):\\n brew install colima docker\\n brew services start colima\\n\\n或 Docker Desktop:https://www.docker.com/products/docker-desktop/',\n 'section.title': '电脑控制',\n 'section.description': '操作目标与 Computer 权限',\n 'rows.exportDir.title': 'Computer 导出目录',\n 'rows.exportDir.current': '当前:{dir}',\n 'rows.exportDir.empty': '未配置时使用默认导出目录',\n 'rows.exportDir.pick': '选择…',\n 'rows.exportDir.manual': '手动输入路径',\n 'rows.exportDir.save': '保存',\n 'rows.exportDir.saving': '正在保存…',\n 'rows.exportDir.saved': '导出目录已保存:{dir}',\n 'rows.exportDir.needsAbsolute': '路径必须是绝对路径,例如 /path/to/exports',\n 'rows.exportDir.saveRejected': 'Host 未接受该导出目录,已恢复原值;请重试',\n 'rows.exportDir.open': '打开目录',\n 'rows.idle.title': '空闲停止',\n 'rows.idle.description': '无观看者时 Computer 自动停止的等待时间',\n 'rows.idle.minutes': '{minutes} 分钟',\n 'rows.autoAllow.title': '自动允许 Computer 操作',\n 'rows.autoAllow.description': '打开后,PersonaBot 在 Computer 上的操作不再逐会话询问;默认关闭。',\n 'rows.exportSection.title': '导出',\n 'rows.exportSection.description': '把 Computer 的持久存储打包成一个归档',\n 'rows.importSection.title': '导入',\n 'rows.importSection.description': '从归档恢复 Computer',\n 'rows.export': '导出',\n 'rows.exporting': '导出中…',\n 'rows.download': '下载',\n 'rows.exportTo': '导出到…',\n 'rows.authorizeExport': '授权并导出',\n 'rows.exportTarget': '导出至:{dir}',\n 'rows.import': '导入…',\n 'rows.importing': '导入中…',\n 'rows.chooseFile': '选择归档文件…',\n 'rows.cancelImport': '取消导入',\n 'rows.authorizeImportConfirm': '授权并导入',\n 'rows.exported': '已导出:{archive}',\n 'rows.exportedDone': '导出完成。',\n 'rows.imported': '已从 {file} 导入并重启 Computer。',\n 'rows.noArchives': '该目录还没有归档;先导出一次。',\n 'rows.noSettings': '设置服务不可用:可以导出/导入,但无法修改目录与空闲时间。',\n 'rows.pickerFallback': '目录选择器不可用;可手动输入路径,或继续使用当前目录:{dir}',\n} as const;\n\nexport const en: Record = {\n 'local.error.permissions': 'Allow the required permissions in macOS System Settings.',\n 'local.error.disk': 'Not enough disk space. Free some space and check again.',\n 'local.error.write': 'Could not write the desktop helper. Check folder permissions and retry.',\n 'local.error.download': 'Could not download the desktop helper. Check your connection and retry.',\n 'local.error.verify': 'Desktop helper verification failed. Check again to reinstall it.',\n 'local.error.install':\n 'Could not install the desktop helper. Check disk space and folder permissions, then retry.',\n 'local.error.settings': 'Could not open System Settings. Open Privacy & Security manually.',\n 'local.error.target': 'The Computer target changed. Check the selected target and retry.',\n 'local.error.request':\n 'Could not reach the computer service. Check that DSH is running and retry.',\n 'local.error.setup':\n 'Computer setup failed. Retry; if it still fails, check the diagnostic logs.',\n 'local.open.accessibility': 'Open Accessibility settings',\n 'local.open.screen': 'Open Screen Recording settings',\n 'local.permissions.help':\n 'Allow these permissions for the app running DSH, fully quit and reopen that app, then check again.',\n\n 'rows.target.title': 'Computer Target',\n 'rows.target.description':\n 'All Bots in this Profile share one target. Switching requires new action authorization.',\n 'rows.target.local': 'Local Computer',\n 'rows.target.container': 'Docker Computer',\n 'local.title': 'Local Computer',\n 'local.granted': 'Desktop permissions granted',\n 'local.description':\n 'Uses the computer running DSH (macOS, Windows or Linux). The first check installs the required desktop helper; a Linux server without a display gets a virtual one. Complete logins on this computer.',\n 'local.check': 'Check permissions',\n 'local.downloading': 'Downloading the desktop helper {percent}% ({downloaded} / {total})',\n 'local.installing': 'Installing {packages}: {percent}%',\n 'local.missing': 'This machine is missing desktop packages: {packages}',\n 'local.missing.manual':\n 'Installing needs an administrator password. Run this command in a terminal on this machine; this card checks again on its own once it is done.',\n 'local.install': 'Install',\n 'local.copy': 'Copy command',\n 'local.copied': 'Copied',\n 'local.checking': 'Checking…',\n 'local.chip.granted': 'Granted',\n 'local.chip.checking': 'Checking',\n 'local.chip.unchecked': 'Not checked',\n 'local.chip.failed': 'Needs attention',\n 'local.chip.missing': 'Missing parts',\n\n 'entry.label': 'Computer',\n 'entry.screen.title': \"{name}'s screen\",\n 'entry.shared':\n 'This Computer is shared by every PersonaBot in the profile: each keeps its own window and they share logins and files.',\n 'entry.access.title': 'Computer Access',\n 'entry.access.on': 'Computer Access is on',\n 'entry.access.enable': 'Enable Computer Access',\n 'entry.access.disable': 'Disable Computer Access',\n 'entry.access.description': \"This PersonaBot's sessions may act on the Computer\",\n 'entry.access.failed': 'Could not change Computer Access',\n 'entry.access.failureHint': 'Access failed',\n 'entry.start': 'Start',\n 'entry.starting': 'Starting…',\n 'entry.chip.setup': 'Needs setup',\n 'entry.chip.authorize': 'Needs approval',\n 'entry.chip.running': 'Running',\n 'entry.chip.stopped': 'Stopped',\n 'entry.chip.failed': 'Error',\n 'entry.stop': 'Stop',\n 'entry.stopping': 'Stopping…',\n 'entry.reconnect': 'Reconnect',\n 'entry.connecting': 'Connecting',\n 'entry.reconnecting': 'Reconnecting',\n 'entry.live': 'Connected',\n 'entry.noScreen': 'No picture',\n 'entry.openFullscreen': 'Open fullscreen',\n 'entry.watchOnly': 'Watch-only — enable input to use keyboard and mouse',\n 'entry.interactive.enable': 'Enable input',\n 'entry.interactive.disable': 'Stop input',\n 'entry.collapseFullscreen': 'Leave fullscreen',\n 'entry.recentLogs': 'Recent activity',\n 'entry.recentLogs.empty': 'No operational records yet',\n 'entry.recentLogs.failed': 'Could not load operational records',\n 'entry.authorize': 'Authorize and start',\n 'entry.cancel': 'Cancel',\n 'entry.remember': \"Don't ask again in this session\",\n 'entry.authorizeIntro': 'Starting runs these steps on your machine:',\n 'entry.authorize.probe':\n 'Detect the local container runtime; a missing one only gets setup guidance, never an automatic install',\n 'entry.authorize.volume':\n 'Create or reuse the persistent volume (logins and files stay on this Computer)',\n 'entry.authorize.pull': 'Pull the image (about 1.2 GB the first time) and create the container',\n 'entry.authorize.bind':\n 'Bind the web VNC endpoint to a loopback port, reachable only from this machine',\n 'entry.authorize.storage': 'Storage location: {target}',\n 'entry.authorize.storageBindRisk':\n 'A bind mount places the browser profile (including SQLite and caches) directly on a host directory; file locking over virtual filesystem sharing (Docker Desktop, Colima, …) is unreliable and can corrupt data — recommended only for native Linux Docker. See the Docker docs: https://docs.docker.com/storage/bind-mounts/',\n 'entry.phase.pulling': 'Pulling the image',\n 'entry.phase.starting': 'Starting',\n 'entry.phase.stopping': 'Stopping',\n 'entry.phase.exporting': 'Exporting',\n 'entry.phase.importing': 'Importing',\n 'entry.phase.working': 'Working',\n 'entry.wait': 'Please wait',\n 'entry.elapsed': 'Elapsed {seconds}s',\n 'entry.updated': 'Last update {seconds}s ago',\n 'entry.setup':\n 'No container runtime found. Install one of these, then retry:\\n\\nColima (recommended, MIT):\\n brew install colima docker\\n brew services start colima\\n\\nOr Docker Desktop: https://www.docker.com/products/docker-desktop/',\n 'section.title': 'Computer',\n 'section.description': 'Computer target and permissions',\n 'rows.exportDir.title': 'Computer export directory',\n 'rows.exportDir.current': 'Current: {dir}',\n 'rows.exportDir.empty': 'Uses the default export directory when none is set',\n 'rows.exportDir.pick': 'Choose…',\n 'rows.exportDir.manual': 'Type a path',\n 'rows.exportDir.save': 'Save',\n 'rows.exportDir.saving': 'Saving…',\n 'rows.exportDir.saved': 'Export directory saved: {dir}',\n 'rows.exportDir.needsAbsolute': 'Path must be absolute, e.g. /path/to/exports',\n 'rows.exportDir.saveRejected':\n 'The Host did not accept the export directory — the previous value was restored; try again',\n 'rows.exportDir.open': 'Open folder',\n 'rows.idle.title': 'Idle stop',\n 'rows.idle.description': 'How long the Computer waits without viewers before stopping',\n 'rows.idle.minutes': '{minutes} min',\n 'rows.autoAllow.title': 'Auto-allow Computer actions',\n 'rows.autoAllow.description':\n 'When on, PersonaBot actions on the Computer run without a per-session approval; off by default.',\n 'rows.exportSection.title': 'Export',\n 'rows.exportSection.description': \"Pack the Computer's persistent store into one archive\",\n 'rows.importSection.title': 'Import',\n 'rows.importSection.description': 'Restore the Computer from an archive',\n 'rows.export': 'Export',\n 'rows.exporting': 'Exporting…',\n 'rows.download': 'Download',\n 'rows.exportTo': 'Export to…',\n 'rows.authorizeExport': 'Authorize and export',\n 'rows.exportTarget': 'Export to: {dir}',\n 'rows.import': 'Import…',\n 'rows.importing': 'Importing…',\n 'rows.chooseFile': 'Choose archive file…',\n 'rows.cancelImport': 'Cancel import',\n 'rows.authorizeImportConfirm': 'Authorize and import',\n 'rows.exported': 'Exported: {archive}',\n 'rows.exportedDone': 'Export complete.',\n 'rows.imported': 'Imported {file} and restarted the Computer.',\n 'rows.noArchives': 'No archives in that directory yet — export once first.',\n 'rows.noSettings':\n 'Settings service unavailable: export and import still work, but the directory and idle time cannot be changed.',\n 'rows.pickerFallback':\n 'Directory picker unavailable — type a path or use the current directory: {dir}',\n};\n\nexport type ComputerKey = keyof typeof zh;\n\nexport const PHASE_LABEL: Partial> = {\n pulling: 'entry.phase.pulling',\n starting: 'entry.phase.starting',\n stopping: 'entry.phase.stopping',\n exporting: 'entry.phase.exporting',\n importing: 'entry.phase.importing',\n};\n\nexport type ComputerTranslate = TranslateNS;\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface LocaleNamespaceMap {\n 'botharness-computer': ComputerKey;\n }\n}\n","import {\n createContext,\n type Context,\n useContext,\n type ComponentProps,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport { Tooltip as PrimitiveTooltip } from '@deepseek-ai/dsh-client-ui-primitives';\n\nconst shared = globalThis as typeof globalThis & Record | undefined>;\nconst InstantTooltips = (shared[Symbol.for('botharness.instant-tooltips')] ??=\n createContext(false));\n\nexport function InstantTooltipScope({ children }: { readonly children: ReactNode }): ReactElement {\n return {children};\n}\n\nexport function Tooltip(props: ComponentProps): ReactElement {\n const instant = useContext(InstantTooltips);\n return instant ? (\n \n ) : (\n \n );\n}\n","import type { ReactElement, ReactNode, Ref } from 'react';\n\nimport { ChannelSidebarIcon } from './channel-sidebar-icon.js';\n\nexport function SidebarCardList({\n label,\n className,\n listRef,\n flush = false,\n children,\n}: {\n label?: string | undefined;\n className?: string | undefined;\n listRef?: Ref | undefined;\n flush?: boolean | undefined;\n children: ReactNode;\n}): ReactElement {\n return (\n \n {children}\n \n );\n}\n\nexport interface SidebarCardRowProps {\n icon?: string | undefined;\n leading?: ReactNode | undefined;\n selection?: { checked: boolean; multiple?: boolean } | undefined;\n iconLabel?: string | undefined;\n title: ReactNode;\n titleClassName?: string | undefined;\n badge?: ReactNode | undefined;\n summary?: ReactNode | undefined;\n flipKey?: string | undefined;\n hint?: string | undefined;\n chips?: ReactNode | undefined;\n meta?: ReactNode | undefined;\n trailing?: ReactNode | undefined;\n detail?: ReactNode | undefined;\n onClick?: () => void | undefined;\n disabled?: boolean | undefined;\n muted?: boolean | undefined;\n mainClassName?: string | undefined;\n dialog?: boolean | undefined;\n expanded?: boolean | undefined;\n controls?: string | undefined;\n state?: string | undefined;\n anchor?: string | undefined;\n}\n\nexport function SidebarCardRow({\n icon,\n leading,\n iconLabel,\n selection,\n title,\n titleClassName,\n badge,\n summary,\n flipKey,\n hint,\n chips,\n meta,\n trailing,\n detail,\n onClick,\n disabled,\n muted,\n mainClassName,\n dialog,\n expanded,\n controls,\n state,\n anchor,\n}: SidebarCardRowProps): ReactElement {\n const body = (\n <>\n {leading === undefined ? null : {leading}}\n {icon === undefined ? null : (\n \n \n
\n )}\n \n {badge === undefined ? (\n \n {title}\n \n ) : (\n \n \n {title}\n \n {badge}\n
\n )}\n {summary === undefined ? null : {summary}}\n {chips === undefined ? null : {chips}}\n {meta === undefined ? null : {meta}}\n \n \n );\n const className = mainClassName === undefined ? 'bh-card-main' : 'bh-card-main ' + mainClassName;\n return (\n \n
\n {selection?.multiple === true ? (\n \n ) : onClick === undefined ? (\n
\n {body}\n
\n ) : (\n \n {body}\n \n )}\n {trailing === undefined ? null : {trailing}}\n
\n {detail === undefined ? null : (\n
\n {detail}\n
\n )}\n \n );\n}\n","import type { ComputerTarget } from './target.js';\n\nexport const COMPUTER_SETTINGS_NAMESPACE = 'botharness-computer';\n\nexport const COMPUTER_EXPORT_DIR_FIELD = 'exportDir';\n\nexport const COMPUTER_IDLE_STOP_FIELD = 'idleStopMinutes';\n\nexport const COMPUTER_AUTO_ALLOW_FIELD = 'autoAllowActions';\n\nexport const COMPUTER_TARGET_FIELD = 'target';\n\nexport interface ComputerSettings {\n target?: ComputerTarget;\n exportDir: string;\n idleStopMinutes: number;\n autoAllowActions: boolean;\n}\n","import { useCallback, useRef, type DependencyList, type RefCallback } from 'react';\n\nexport function useMountedResource(\n start: (node: T) => void | (() => void),\n dependencies: DependencyList,\n): RefCallback {\n const cleanup = useRef<(() => void) | undefined>(undefined);\n return useCallback((node: T | null) => {\n cleanup.current?.();\n cleanup.current = undefined;\n if (node !== null) cleanup.current = start(node) || undefined;\n }, dependencies);\n}\n","import type { ReactElement, ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\n\nimport { color, space, text } from './tokens.stylex.js';\n\nconst styles = stylex.create({\n note: {\n margin: 0,\n fontSize: text.metaSize,\n lineHeight: text.metaLine,\n overflowWrap: 'anywhere',\n },\n inset: { paddingBlock: space.x2, paddingInline: space.x2 },\n muted: { color: color.muted },\n subtle: { color: color.subtle },\n danger: { color: color.danger },\n success: { color: color.success },\n warning: { color: color.warning },\n});\n\nexport type NoteTone = 'muted' | 'subtle' | 'danger' | 'success' | 'warning';\n\nexport function Note({\n tone = 'muted',\n inset = false,\n children,\n}: {\n readonly tone?: NoteTone;\n readonly inset?: boolean;\n readonly children: ReactNode;\n}): ReactElement {\n return (\n \n {children}\n

\n );\n}\n","import type { ButtonHTMLAttributes, InputHTMLAttributes, ReactElement, ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\n\nimport { actionColor, border, color, radius, size, space, text } from './tokens.stylex.js';\n\nexport const pillStyles = stylex.create({\n pill: {\n display: 'inline-flex',\n alignItems: 'center',\n gap: space.x2,\n maxWidth: '100%',\n height: size.icon,\n paddingInline: `${space.x4} ${space.x3}`,\n borderWidth: 0,\n borderRadius: radius.sm,\n backgroundColor: { default: actionColor.secondary, ':hover': actionColor.hover },\n color: color.fg,\n fontFamily: 'inherit',\n fontSize: text.bodySize,\n lineHeight: text.bodyLine,\n whiteSpace: 'nowrap',\n cursor: { default: 'pointer', ':disabled': 'default' },\n opacity: { default: 1, ':disabled': 0.5 },\n outline: { default: 'none', ':focus-visible': `${border.focus} solid ${color.accent}` },\n outlineOffset: '1px',\n },\n});\n\nexport function PillButton({\n children,\n ...rest\n}: { readonly children: ReactNode } & Omit<\n ButtonHTMLAttributes,\n 'className' | 'style' | 'type' | 'children'\n>): ReactElement {\n return (\n \n );\n}\n\nexport function PillFileButton({\n children,\n ...input\n}: { readonly children: ReactNode } & Omit<\n InputHTMLAttributes,\n 'className' | 'style' | 'type' | 'children' | 'hidden'\n>): ReactElement {\n return (\n \n );\n}\n","import { BUBBLE_SURFACES, readable } from './bot-name-color.js';\nimport { space } from './ds/tokens.stylex.js';\nimport { panelMaterials, validTargetId } from './appearance-panels.js';\nimport { appearanceMaterials } from './appearance-materials.js';\nimport {\n APPEARANCE_KEY,\n APPEARANCE_PRIMARY,\n Appearance,\n type AppearanceSnapshot,\n} from './appearance.js';\nimport { NATIVE_LIGHT, NATIVE_DARK } from './appearance-native-tokens.js';\nexport const APPEARANCE_CLASS = 'bh-appearance-scope';\nexport function appearanceCss(snapshot: AppearanceSnapshot): string {\n const { config, mode } = snapshot;\n const selected = config.modes[mode];\n const primary = selected.primary ?? APPEARANCE_PRIMARY[selected.preset][mode];\n const materials = appearanceMaterials(selected, mode);\n const tokens: Record = {\n ...NATIVE_LIGHT,\n ...(mode === 'dark' ? NATIVE_DARK : {}),\n };\n for (const part of ['header', 'body'] as const) {\n const material = materials[part];\n tokens[`--bh-global-${part}-fill`] =\n `color-mix(in srgb, ${material.color} ${material.opacity}%, transparent)`;\n tokens[`--bh-global-${part}-blur`] = `${material.blur}px`;\n }\n tokens['--dsw-alias-state-business-primary'] = primary;\n tokens['--dsw-alias-link'] = readable(primary, BUBBLE_SURFACES[mode].surface, 4.6);\n tokens['--dsw-alias-state-business-secondary'] =\n `color-mix(in srgb, ${primary} 45%, transparent)`;\n tokens['--dsw-alias-state-business-tertiary'] = `color-mix(in srgb, ${primary} 14%, transparent)`;\n tokens['--dsw-specific-sidebar-nav-item-active'] =\n `color-mix(in srgb, ${primary} 14%, transparent)`;\n return `.bh-root,.bh-workspace-mount[data-workspace-enabled],.${APPEARANCE_CLASS},[data-bh-appearance-owned]{color:var(--dsw-alias-label-primary);color-scheme:${mode};${Object.entries(\n tokens,\n )\n .map(([k, v]) => `${k}:${v}`)\n .join(\n ';',\n )}}:root [data-bh-appearance-owned][data-menu-material],:root .${APPEARANCE_CLASS}[data-menu-material],:root .${APPEARANCE_CLASS} [data-menu-material]{--dsw-elevation-stroke-color:var(--dsw-alias-border-${mode === 'dark' ? 'l3' : 'l4'})}${materialCss()}${panelCss(snapshot)}`;\n}\n\nexport function mountAppearance(owner: Appearance): () => void {\n const style = document.createElement('style');\n style.dataset.plugin = '@botharness/ui';\n style.dataset.pluginCss = '@botharness/ui/appearance';\n const update = () => {\n style.textContent = appearanceCss(owner.getSnapshot());\n style.dataset.bhAppearance = owner.getSnapshot().mode;\n document.documentElement.dataset.bhAppearance = owner.getSnapshot().mode;\n };\n const media = window.matchMedia('(prefers-color-scheme: dark)');\n const onStorage = (event: StorageEvent) => {\n if (event.key === APPEARANCE_KEY || event.key === null) owner.refresh();\n };\n update();\n document.head.appendChild(style);\n const off = owner.subscribe(update);\n media.addEventListener('change', owner.refresh);\n window.addEventListener('storage', onStorage);\n return () => {\n off();\n style.remove();\n delete document.documentElement.dataset.bhAppearance;\n media.removeEventListener('change', owner.refresh);\n window.removeEventListener('storage', onStorage);\n };\n}\n\nfunction materialCss(): string {\n const scope = ':root .bh-workspace-mount[data-workspace-enabled]';\n return `\n${scope} .bh-dock-theme { --dv-group-view-background-color:transparent; --dv-tabs-and-actions-container-background-color:transparent; --dv-activegroup-visiblepanel-tab-background-color:transparent; --dv-inactivegroup-visiblepanel-tab-background-color:transparent; --dv-activegroup-hiddenpanel-tab-background-color:transparent; --dv-inactivegroup-hiddenpanel-tab-background-color:transparent; }\n${scope} .bh-root, ${scope} .bh-workspace-rail { background:transparent; }\n${scope} .dv-tabs-and-actions-container, ${scope} .bh-channel-session-header { background:var(--bh-global-header-fill); backdrop-filter:blur(var(--bh-global-header-blur)); }\n${scope} [data-appearance-header] { background:var(--bh-global-header-fill); backdrop-filter:blur(var(--bh-global-header-blur)); }\n${scope} .bh-channel-subpanel-body { display:flex; flex-direction:column; flex:1; min-height:0; min-width:0; overflow:auto; }\n${scope} .bh-channel-subpanel-body > section { flex:1; min-height:0; }\n${scope} .bh-memory-commit-view { display:flex; flex-direction:column; padding:0; }\n${scope} .bh-memory-commit-header { margin:0; flex-shrink:0; }\n${scope} .bh-memory-detail-body { flex:1; padding:${space.x3} ${space.x4}; }\n${scope} [data-appearance-body], ${scope} .dv-content-container { background:var(--bh-global-body-fill); backdrop-filter:blur(var(--bh-global-body-blur)); }\n`;\n}\n\nfunction panelCss({ config, mode }: AppearanceSnapshot): string {\n return Object.keys(config.modes[mode].panels ?? {})\n .filter(validTargetId)\n .map((id) => {\n const material = panelMaterials(config.modes[mode], mode, id);\n const scope = `:root .bh-workspace-mount[data-workspace-enabled] .dv-groupview:has(> .dv-tabs-and-actions-container .dv-active-tab [data-dock-header=\"${id.slice(5)}\"])`;\n return (['header', 'body'] as const)\n .map(\n (part) =>\n `${scope} > ${part === 'header' ? '.dv-tabs-and-actions-container' : '.dv-content-container'}, :root .bh-workspace-mount[data-workspace-enabled] [data-appearance-${part}=\"${id.slice(5)}\"] { background:color-mix(in srgb, ${material[part].color} ${material[part].opacity}%, transparent); backdrop-filter:blur(${material[part].blur}px); }`,\n )\n .join('');\n })\n .join('');\n}\n","import { Modal as NativeModal, Menu as NativeMenu } from '@deepseek-ai/dsh-client-ui-primitives';\nimport type { ComponentProps, RefObject } from 'react';\nimport { APPEARANCE_CLASS } from './appearance-scope.js';\nexport function Modal(props: ComponentProps) {\n return (\n \n );\n}\ntype MenuProps = Omit, 'getAnchorRect'> & {\n anchorRef?: RefObject;\n};\n\nexport function Menu(props: MenuProps) {\n const { anchorRef } = props;\n const legacyAnchor =\n anchorRef === undefined\n ? {}\n : {\n getAnchorRect: () => anchorRef.current?.getBoundingClientRect() ?? null,\n };\n return (\n \n );\n}\n","import { Menu } from '../appearance-primitives.js';\nimport type { ComponentProps } from 'react';\nimport { createPortal } from 'react-dom';\nimport * as stylex from '@stylexjs/stylex';\n\nimport { useMountedResource } from '../mounted-resource.js';\nimport { border, space } from './tokens.stylex.js';\n\nexport interface MenuPoint {\n readonly x: number;\n readonly y: number;\n}\n\nexport function pointerMenuPosition(\n point: MenuPoint,\n width: number,\n height: number,\n viewport: { width: number; height: number; top: number },\n) {\n const margin = Number.parseFloat(space.x4);\n return {\n x: Math.max(margin, Math.min(point.x, viewport.width - width - margin)),\n y: Math.max(\n Math.max(margin, viewport.top),\n Math.min(point.y, viewport.height - height - margin),\n ),\n };\n}\n\ntype PointerMenuProps = Omit<\n ComponentProps,\n 'open' | 'portal' | 'anchorRef' | 'side' | 'align' | 'className'\n> & { point: MenuPoint; container?: Element; align?: 'start' | 'end' };\n\nexport function PointerMenu({\n point,\n container = document.body,\n align = 'start',\n ...props\n}: PointerMenuProps) {\n const mount = useMountedResource(\n (node) => {\n const menu = node.querySelector('[role=\"menu\"]');\n if (!menu) return;\n const originalMaxWidth = Number.parseFloat(getComputedStyle(menu).maxWidth);\n const originalMinWidth = Number.parseFloat(getComputedStyle(menu).minWidth);\n const place = () => {\n const scale = node.getBoundingClientRect();\n if (!scale.width || !scale.height) return;\n const cssZoom =\n 'currentCSSZoom' in node && typeof node.currentCSSZoom === 'number'\n ? node.currentCSSZoom\n : undefined;\n const scaleX = cssZoom ?? scale.width;\n const scaleY = cssZoom ?? scale.height;\n const root = document.documentElement;\n const clearance = root.hasAttribute('data-fullscreen')\n ? 0\n : Number.parseFloat(\n getComputedStyle(root).getPropertyValue('--dsh-frame-top-clearance'),\n ) || 0;\n const margin = Number.parseFloat(space.x4);\n const availableWidth = Math.max(0, innerWidth - 2 * margin) / scaleX;\n menu.style.minWidth = `${Math.min(originalMinWidth || 0, availableWidth)}px`;\n menu.style.maxWidth = `${Math.min(originalMaxWidth || Infinity, availableWidth)}px`;\n menu.style.maxHeight = `${Math.max(0, innerHeight - Math.max(margin, clearance) - margin) / scaleY}px`;\n const box = menu.getBoundingClientRect();\n const desired = pointerMenuPosition(\n { x: align === 'end' ? point.x - box.width : point.x, y: point.y },\n box.width,\n box.height,\n {\n width: innerWidth,\n height: innerHeight,\n top: clearance,\n },\n );\n const left = Number.parseFloat(node.style.left) || 0;\n const top = Number.parseFloat(node.style.top) || 0;\n node.style.left = `${left + (desired.x - box.left) / scaleX}px`;\n node.style.top = `${top + (desired.y - box.top) / scaleY}px`;\n };\n place();\n const observer =\n typeof ResizeObserver === 'undefined' ? undefined : new ResizeObserver(place);\n observer?.observe(menu);\n observer?.observe(node);\n window.addEventListener('resize', place);\n window.addEventListener('scroll', place, true);\n return () => {\n observer?.disconnect();\n window.removeEventListener('resize', place);\n window.removeEventListener('scroll', place, true);\n };\n },\n [point.x, point.y, align],\n );\n return createPortal(\n \n \n ,\n container,\n );\n}\n\nconst styles = stylex.create({\n origin: {\n position: 'fixed',\n left: 0,\n top: 0,\n width: border.hairline,\n height: border.hairline,\n zIndex: 1100,\n pointerEvents: 'none',\n },\n menu: { pointerEvents: 'auto' },\n});\n","import { PointerMenu, type MenuPoint } from './pointer-menu.js';\nimport { useMountedResource } from '../mounted-resource.js';\nimport { useRef, useState, type ReactElement, type ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { IconChevronDownOutlineRegular } from '@deepseek-ai/dsh-client-ui-primitives';\n\nimport { pillStyles } from './pill-button.js';\nimport { color, space } from './tokens.stylex.js';\n\nconst styles = stylex.create({\n label: {\n minWidth: 0,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n },\n chevron: {\n display: 'inline-flex',\n flexShrink: 0,\n color: color.muted,\n },\n});\n\nexport interface SelectOption {\n readonly value: Value;\n readonly label: ReactNode;\n}\n\nexport interface SelectProps {\n readonly label: string;\n readonly value: Value;\n readonly options: readonly SelectOption[];\n readonly onChange: (value: Value) => void;\n readonly disabled?: boolean;\n readonly align?: 'start' | 'end';\n readonly autoFocus?: boolean;\n readonly reselect?: boolean;\n}\n\nexport function Select({\n label,\n value,\n options,\n onChange,\n disabled = false,\n align = 'end',\n autoFocus = false,\n reselect = false,\n}: SelectProps): ReactElement {\n const [open, setOpen] = useState(false);\n const [point, setPoint] = useState();\n const trigger = useRef(null);\n const active = open && !disabled;\n const mount = useMountedResource(\n (node) => {\n trigger.current = node;\n if (!active)\n return () => {\n trigger.current = null;\n };\n const place = () => {\n const rect = node.getBoundingClientRect();\n const scale = node.offsetHeight > 0 ? rect.height / node.offsetHeight : 1;\n const next = {\n x: align === 'end' ? rect.right : rect.left,\n y: rect.bottom + Number.parseFloat(space.x2) * scale,\n };\n setPoint((previous) => (previous?.x === next.x && previous.y === next.y ? previous : next));\n };\n place();\n const resize = typeof ResizeObserver === 'undefined' ? undefined : new ResizeObserver(place);\n resize?.observe(node);\n resize?.observe(document.documentElement);\n const observer = new MutationObserver(place);\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['style', 'data-fullscreen'],\n });\n window.addEventListener('resize', place);\n window.addEventListener('scroll', place, true);\n return () => {\n trigger.current = null;\n resize?.disconnect();\n observer.disconnect();\n window.removeEventListener('resize', place);\n window.removeEventListener('scroll', place, true);\n };\n },\n [active, align],\n );\n const close = () => {\n const button = trigger.current;\n const menu = document.activeElement?.closest('[data-pointer-menu]');\n setOpen(false);\n setPoint(undefined);\n queueMicrotask(() => {\n const focused = document.activeElement;\n if (\n button?.isConnected &&\n !button.disabled &&\n (focused === document.body || (focused !== null && menu?.contains(focused)))\n )\n button.focus({ preventScroll: true });\n });\n };\n const current = options.find((option) => option.value === value);\n return (\n <>\n {\n if (active) event.stopPropagation();\n }}\n onClick={() => {\n if (active) close();\n else setOpen(true);\n }}\n {...stylex.props(pillStyles.pill)}\n >\n {current?.label}\n \n \n \n \n {active && point ? (\n }\n items={options.map((option) => ({ id: option.value, label: option.label }))}\n selectedId={value}\n onSelect={(id) => {\n close();\n const next = options.find((option) => option.value === id);\n if (next !== undefined && (reselect || next.value !== value)) onChange(next.value);\n }}\n onClose={close}\n />\n ) : null}\n \n );\n}\n","import { useId, type ReactElement, type ReactNode, type Ref } from 'react';\nimport * as stylex from '@stylexjs/stylex';\n\nimport { border, color, space, text } from './tokens.stylex.js';\n\nconst NARROW = '@media (max-width: 648px)';\nconst COMPACT = '@container bh-settings (max-width: 480px)';\n\nconst styles = stylex.create({\n rows: {\n display: 'flex',\n flexDirection: 'column',\n minWidth: 0,\n },\n section: {\n display: 'flex',\n flexDirection: 'column',\n minWidth: 0,\n paddingTop: { default: space.x5, ':first-child': 0 },\n },\n sectionHead: {\n display: 'flex',\n flexDirection: 'column',\n gap: space.x1,\n paddingBottom: space.x2,\n },\n sectionTitle: {\n margin: 0,\n color: color.muted,\n fontSize: text.metaSize,\n lineHeight: text.metaLine,\n fontWeight: text.strong,\n },\n row: {\n display: 'flex',\n alignItems: { default: 'center', [NARROW]: 'stretch', [COMPACT]: 'stretch' },\n flexDirection: { default: 'row', [NARROW]: 'column', [COMPACT]: 'column' },\n gap: { default: space.x4, [NARROW]: space.x3, [COMPACT]: space.x3 },\n minWidth: 0,\n paddingBlock: space.x4,\n borderBottomWidth: border.hairline,\n borderBottomStyle: 'solid',\n borderBottomColor: { default: color.divider, ':last-child': 'transparent' },\n },\n text: {\n display: 'flex',\n flexDirection: 'column',\n gap: space.x1,\n flexGrow: 1,\n flexShrink: 1,\n flexBasis: 0,\n minWidth: 0,\n },\n title: {\n color: color.fg,\n fontSize: text.titleSize,\n lineHeight: text.titleLine,\n fontWeight: text.strong,\n overflowWrap: 'anywhere',\n },\n description: {\n color: color.muted,\n fontSize: text.metaSize,\n lineHeight: text.metaLine,\n overflowWrap: 'anywhere',\n },\n control: {\n display: 'flex',\n flexWrap: 'wrap',\n alignItems: 'center',\n justifyContent: { default: 'flex-end', [NARROW]: 'flex-start', [COMPACT]: 'flex-start' },\n gap: space.x3,\n flexShrink: 0,\n minWidth: 0,\n maxWidth: { default: '60%', [NARROW]: '100%', [COMPACT]: '100%' },\n },\n value: {\n color: color.muted,\n fontSize: text.bodySize,\n lineHeight: text.bodyLine,\n textAlign: 'end',\n overflowWrap: 'anywhere',\n },\n});\n\nexport function SettingsRows({\n children,\n rootRef,\n}: {\n readonly children: ReactNode;\n readonly rootRef?: Ref | undefined;\n}): ReactElement {\n return (\n
\n {children}\n
\n );\n}\n\nexport interface SettingsSectionProps {\n readonly title?: ReactNode;\n readonly description?: ReactNode;\n readonly children: ReactNode;\n}\n\nexport function SettingsSection({\n title,\n description,\n children,\n}: SettingsSectionProps): ReactElement {\n const id = useId();\n return (\n \n {title === undefined ? null : (\n
\n

\n {title}\n

\n {description === undefined ? null : (\n
{description}
\n )}\n
\n )}\n {children}\n \n );\n}\n\nexport interface SettingsRowProps {\n readonly title: ReactNode;\n readonly description?: ReactNode;\n readonly control?: ReactNode;\n readonly children?: ReactNode;\n readonly rootRef?: Ref | undefined;\n readonly data?: Readonly>;\n}\n\nexport function SettingsRow({\n title,\n description,\n control,\n children,\n rootRef,\n data,\n}: SettingsRowProps): ReactElement {\n const id = useId();\n const titleId = `${id}-title`;\n const descriptionId = `${id}-description`;\n return (\n \n
\n
\n {title}\n
\n {description === undefined ? null : (\n
\n {description}\n
\n )}\n {children}\n
\n {control === undefined ? null :
{control}
}\n \n );\n}\n\nexport function SettingsValue({ children }: { readonly children: ReactNode }): ReactElement {\n return {children};\n}\n","import type { ComputerTranslate } from './locale.js';\n\nexport function localSetupFailure(code: string | undefined, t: ComputerTranslate): string {\n switch (code) {\n case 'permissions-required':\n return t('local.error.permissions');\n case 'disk-full':\n return t('local.error.disk');\n case 'runtime-write-refused':\n return t('local.error.write');\n case 'download-failed':\n return t('local.error.download');\n case 'verification-failed':\n return t('local.error.verify');\n case 'installation-failed':\n return t('local.error.install');\n case 'settings-open-failed':\n return t('local.error.settings');\n case 'target-changed':\n return t('local.error.target');\n case 'request-failed':\n return t('local.error.request');\n default:\n return t('local.error.setup');\n }\n}\n","import { useState, type ReactElement, type ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { Button } from '@deepseek-ai/dsh-client-ui-primitives';\nimport { Note } from './ds/note.js';\nimport { color, radius, space, text } from './ds/tokens.stylex.js';\n\nconst styles = stylex.create({\n root: {\n display: 'grid',\n gap: space.x3,\n justifyItems: 'start',\n width: '100%',\n },\n progress: {\n display: 'grid',\n gap: space.x1,\n width: '100%',\n color: color.muted,\n fontSize: text.metaSize,\n lineHeight: text.metaLine,\n },\n bar: {\n width: '100%',\n height: '6px',\n accentColor: color.accent,\n },\n command: {\n margin: 0,\n width: '100%',\n boxSizing: 'border-box',\n paddingBlock: space.x2,\n paddingInline: space.x2,\n borderRadius: radius.sm,\n backgroundColor: color.hover,\n color: color.fg,\n fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Consolas, monospace',\n fontSize: text.metaSize,\n lineHeight: text.metaLine,\n whiteSpace: 'pre-wrap',\n overflowWrap: 'anywhere',\n },\n actions: {\n display: 'flex',\n gap: space.x2,\n flexWrap: 'wrap',\n },\n});\n\nexport type MissingPackagesAccess = 'root' | 'sudo' | 'none';\n\nexport interface MissingPackagesLabels {\n readonly missing: string;\n readonly manual: string;\n readonly install: string;\n readonly copy: string;\n readonly copied: string;\n}\n\nexport function formatProgressMiB(bytes: number): string {\n return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;\n}\n\nexport function ProgressLine({\n percent,\n label,\n}: {\n readonly percent: number;\n readonly label: string;\n}): ReactElement {\n const value = Math.max(0, Math.min(100, percent));\n return (\n
\n \n {label}\n
\n );\n}\n\nexport function MissingPackages({\n command,\n access,\n installing,\n busy = false,\n onInstall,\n labels,\n children,\n}: {\n readonly command: string;\n readonly access: MissingPackagesAccess;\n readonly installing?: { readonly percent: number; readonly label: string } | undefined;\n readonly busy?: boolean;\n readonly onInstall: () => void;\n readonly labels: MissingPackagesLabels;\n readonly children?: ReactNode;\n}): ReactElement {\n const [copied, setCopied] = useState(false);\n const copy = (): void => {\n void navigator.clipboard?.writeText(command).then(() => setCopied(true));\n };\n return (\n
\n {installing === undefined ? (\n {labels.missing}\n ) : (\n \n )}\n {access === 'none' && installing === undefined ? (\n <>\n {labels.manual}\n
{command}
\n \n ) : null}\n
\n {access !== 'none' && installing === undefined ? (\n \n ) : null}\n {access === 'none' ? (\n \n ) : null}\n {children}\n
\n
\n );\n}\n","import { localSetupFailure } from './local-setup-copy.js';\nimport { useCallback, useState, type ReactElement } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { Button, Tag } from '@deepseek-ai/dsh-client-ui-primitives';\nimport { Note } from '../../../client/src/client/ds/note.js';\nimport { space } from '../../../client/src/client/ds/tokens.stylex.js';\nimport {\n MissingPackages,\n ProgressLine,\n formatProgressMiB,\n} from '../../../client/src/client/missing-packages.js';\nimport { SidebarCardList, SidebarCardRow } from '../../../client/src/client/sidebar-card.js';\nimport type { ComputerTranslate } from './locale.js';\nimport { useMountedResource } from './mounted-resource.js';\n\nconst styles = stylex.create({\n detail: {\n display: 'grid',\n gap: space.x3,\n justifyItems: 'start',\n },\n});\n\ninterface LocalMissing {\n packages?: string[];\n command?: string;\n install?: 'root' | 'sudo' | 'none';\n}\n\ninterface LocalStatus {\n target?: string;\n probe?: { available?: boolean; detail?: string };\n status?: {\n refusal?: string;\n permissions?: { accessibility: boolean; screenRecording: boolean };\n state?: string;\n phase?: string;\n detail?: string;\n progress?: { percent?: number; downloadedBytes?: number; totalBytes?: number };\n missing?: LocalMissing;\n };\n install?: { state?: string; packages?: string[]; percent?: number; text?: string };\n}\n\nexport function LocalComputerStatus({ t }: { t: ComputerTranslate }): ReactElement {\n const [payload, setPayload] = useState();\n const [busy, setBusy] = useState(false);\n const [error, setError] = useState();\n const refresh = useCallback(async (signal?: AbortSignal) => {\n const response = await fetch('./api/computer/status', {\n credentials: 'same-origin',\n ...(signal === undefined ? {} : { signal }),\n });\n if (!response.ok) throw new Error('request-failed');\n const next = (await response.json()) as LocalStatus;\n if (!signal?.aborted) {\n setPayload(next);\n setError((old) => (old === 'request-failed' ? undefined : old));\n }\n }, []);\n const resource = useMountedResource(() => {\n const controller = new AbortController();\n let pending = false;\n const poll = async (): Promise => {\n if (pending || controller.signal.aborted) return;\n pending = true;\n try {\n await refresh(AbortSignal.any([controller.signal, AbortSignal.timeout(10_000)]));\n } catch {\n if (!controller.signal.aborted) setError('request-failed');\n } finally {\n pending = false;\n }\n };\n void poll();\n const timer = setInterval(() => void poll(), 2000);\n return () => {\n controller.abort();\n clearInterval(timer);\n };\n }, [refresh]);\n const installing = payload?.install?.state === 'installing';\n const preparing = busy || installing || payload?.status?.phase === 'starting';\n const missing = payload?.status?.missing;\n const failureDetail =\n error ??\n (payload?.install?.state === 'failed' ? payload.install.text : undefined) ??\n (missing === undefined ? payload?.status?.detail : undefined) ??\n payload?.probe?.detail;\n const failure =\n failureDetail === undefined\n ? undefined\n : localSetupFailure(error ?? payload?.status?.refusal, t);\n const permissions =\n payload?.status?.refusal === 'permissions-required' ? payload.status.permissions : undefined;\n const post = (path: string, body: Record): void => {\n setBusy(true);\n setError(undefined);\n void fetch(path, {\n method: 'POST',\n credentials: 'same-origin',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify(body),\n })\n .then(async (response) => {\n if (!response.ok) {\n const refused = (await response.json().catch(() => ({}))) as { code?: string };\n setError(refused.code ?? 'request-failed');\n return;\n }\n await refresh();\n })\n .catch(() => setError('request-failed'))\n .finally(() => setBusy(false));\n };\n const check = (): void => post('./api/computer/start', { authorize: true, target: 'local' });\n const install = (): void => post('./api/computer/install-packages', { authorize: true });\n const granted = payload?.status?.state === 'running';\n const download = payload?.status?.progress;\n const installLabel = installing\n ? {\n percent: payload?.install?.percent ?? 0,\n label: t('local.installing', {\n packages: (payload?.install?.packages ?? []).join(', '),\n percent: String(payload?.install?.percent ?? 0),\n }),\n }\n : undefined;\n const checkButton = (\n \n {t(preparing ? 'local.checking' : 'local.check')}\n \n );\n const packages = installing ? (payload?.install?.packages ?? []) : (missing?.packages ?? []);\n const body =\n packages.length > 0 && (missing !== undefined || installing) ? (\n \n {checkButton}\n \n ) : (\n <>\n {payload?.status?.phase === 'starting' && (download?.totalBytes ?? 0) > 0 ? (\n \n ) : null}\n {permissions ? (\n <>\n {!permissions.accessibility ? (\n \n post('./api/computer/open-permission-settings', {\n authorize: true,\n permission: 'accessibility',\n })\n }\n >\n {t('local.open.accessibility')}\n \n ) : null}\n {!permissions.screenRecording ? (\n \n post('./api/computer/open-permission-settings', {\n authorize: true,\n permission: 'screen-recording',\n })\n }\n >\n {t('local.open.screen')}\n \n ) : null}\n {t('local.permissions.help')}\n \n ) : null}\n {checkButton}\n \n );\n return (\n
\n \n {t('local.chip.granted')}\n ) : preparing ? (\n {t('local.chip.checking')}\n ) : missing !== undefined ? (\n {t('local.chip.missing')}\n ) : failure === undefined ? (\n {t('local.chip.unchecked')}\n ) : (\n {t('local.chip.failed')}\n )\n }\n meta={t(granted ? 'local.granted' : 'local.description')}\n detail={\n
\n {failure === undefined ? null : {failure}}\n {body}\n
\n }\n />\n
\n
\n );\n}\n","import { useCallback, useRef, useState, useSyncExternalStore, type ReactElement } from 'react';\nimport { useMountedResource } from './mounted-resource.js';\n\nimport * as stylex from '@stylexjs/stylex';\nimport {\n IconChevronDownOutlineRegular,\n IconFolderOpenOutlineRegular,\n Input,\n Menu,\n Switch,\n} from '@deepseek-ai/dsh-client-ui-primitives';\nimport type { InjectFace, PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';\n\nimport {\n COMPUTER_TARGET_FIELD,\n COMPUTER_AUTO_ALLOW_FIELD,\n COMPUTER_EXPORT_DIR_FIELD,\n COMPUTER_IDLE_STOP_FIELD,\n type ComputerSettings,\n} from '../settings.js';\nimport { Note } from '../../../client/src/client/ds/note.js';\nimport { PillButton, PillFileButton } from '../../../client/src/client/ds/pill-button.js';\nimport { Select } from '../../../client/src/client/ds/select.js';\nimport { SettingsRow, SettingsRows } from '../../../client/src/client/ds/settings-row.js';\nimport { border, color, space, text } from '../../../client/src/client/ds/tokens.stylex.js';\nimport { LocalComputerStatus } from './local-computer.js';\nimport type { ComputerTarget } from '../target.js';\n\nimport { PHASE_LABEL, type ComputerTranslate } from './locale.js';\n\nexport interface ComputerSettingsSnapshot {\n target: ComputerTarget;\n exportDir: string;\n idleStopMinutes: number;\n autoAllowActions: boolean;\n status: 'loading' | 'ready' | 'unavailable';\n writable: boolean;\n}\n\nexport interface ComputerSettingsScope {\n getSnapshot(): {\n status: 'loading' | 'ready' | 'unavailable';\n value: ComputerSettings | undefined;\n writable: boolean;\n };\n subscribe(listener: () => void): () => void;\n set(field: string, value: unknown): Promise;\n}\n\nexport class ExportDirRejectedError extends Error {\n constructor() {\n super('the Host did not accept the export directory');\n this.name = 'ExportDirRejectedError';\n }\n}\n\nexport function displayExportDir(configured: string, hostDir: string | undefined): string {\n return configured !== '' ? configured : (hostDir ?? '');\n}\n\nexport class ComputerSettingsPrefs {\n private snapshot: ComputerSettingsSnapshot = {\n target: 'container',\n exportDir: '',\n idleStopMinutes: 30,\n autoAllowActions: false,\n status: 'loading',\n writable: false,\n };\n\n private readonly listeners = new Set<() => void>();\n\n private scope: ComputerSettingsScope | undefined;\n\n private detach: (() => void) | undefined;\n\n attach(scope: ComputerSettingsScope): () => void {\n this.detach?.();\n this.scope = scope;\n this.detach = scope.subscribe(() => {\n this.sync();\n });\n this.sync();\n return () => {\n this.detach?.();\n this.detach = undefined;\n this.scope = undefined;\n };\n }\n\n getSnapshot = (): ComputerSettingsSnapshot => this.snapshot;\n\n subscribe = (listener: () => void): (() => void) => {\n this.listeners.add(listener);\n return () => {\n this.listeners.delete(listener);\n };\n };\n\n async setTarget(target: ComputerTarget): Promise {\n if (this.scope === undefined) throw new Error('Computer settings are unavailable');\n await this.scope.set(COMPUTER_TARGET_FIELD, target);\n this.sync();\n if (this.snapshot.target !== target) throw new Error('Computer Target was not saved');\n }\n\n async setExportDir(exportDir: string): Promise {\n if (this.scope === undefined) throw new ExportDirRejectedError();\n this.publish({ exportDir });\n try {\n await this.scope.set(COMPUTER_EXPORT_DIR_FIELD, exportDir);\n } catch (error) {\n this.sync();\n throw error;\n }\n if (this.snapshot.exportDir !== exportDir) throw new ExportDirRejectedError();\n }\n\n setIdleStopMinutes(idleStopMinutes: number): void {\n this.publish({ idleStopMinutes });\n void this.scope?.set(COMPUTER_IDLE_STOP_FIELD, idleStopMinutes).catch(() => undefined);\n }\n\n setAutoAllowActions(autoAllowActions: boolean): void {\n const previous = this.snapshot.autoAllowActions;\n this.publish({ autoAllowActions });\n void this.scope?.set(COMPUTER_AUTO_ALLOW_FIELD, autoAllowActions).catch(() => {\n this.publish({ autoAllowActions: previous });\n });\n }\n\n private publish(patch: Partial): void {\n this.snapshot = { ...this.snapshot, ...patch };\n for (const listener of this.listeners) listener();\n }\n\n private sync(): void {\n const scope = this.scope;\n if (scope === undefined) return;\n const next = scope.getSnapshot();\n const value = next.value;\n this.snapshot = {\n target: value?.target ?? 'container',\n exportDir: value?.exportDir ?? '',\n idleStopMinutes: value?.idleStopMinutes ?? 30,\n autoAllowActions: value?.autoAllowActions ?? false,\n status: next.status,\n writable: next.writable,\n };\n for (const listener of this.listeners) listener();\n }\n}\n\nexport interface ComputerSettingsFace {\n prefs: ComputerSettingsPrefs;\n pickerAvailable: boolean;\n pickDirectory: () => Promise;\n openDirectory: (dir: string) => Promise;\n exportArchive: (dir?: string) => Promise<{ archive: string; downloadToken?: string }>;\n downloadUrl: (downloadToken: string) => string;\n importArchive: (file: string) => Promise;\n requestUpload: (file: string) => Promise;\n sendUploadBytes: (uploadToken: string, file: File) => Promise;\n listArchives: () => Promise;\n hostExportDir: () => Promise;\n}\n\nconst IDLE_OPTIONS = [15, 30, 60, 120, 240] as const;\n\nconst styles = stylex.create({\n intro: {\n margin: 0,\n paddingTop: space.x5,\n paddingBottom: space.x2,\n color: color.muted,\n fontSize: text.metaSize,\n lineHeight: text.metaLine,\n },\n chevron: {\n display: 'inline-flex',\n flexShrink: 0,\n color: color.muted,\n },\n manual: {\n display: 'flex',\n alignItems: 'center',\n gap: space.x4,\n minWidth: 0,\n paddingBlock: space.x4,\n borderBottomWidth: border.hairline,\n borderBottomStyle: 'solid',\n borderBottomColor: color.divider,\n },\n manualInput: {\n flexGrow: 1,\n flexShrink: 1,\n flexBasis: 0,\n minWidth: 0,\n },\n file: {\n margin: 0,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n color: color.muted,\n fontSize: text.metaSize,\n lineHeight: text.metaLine,\n },\n});\n\nconst EXPORT_ENDPOINT = './api/computer/export';\nconst IMPORT_ENDPOINT = './api/computer/import';\nconst EXPORTS_ENDPOINT = './api/computer/exports';\nconst STATUS_ENDPOINT = './api/computer/status';\nconst OPEN_DIR_ENDPOINT = './api/computer/open-dir';\nconst DOWNLOAD_ENDPOINT = './api/computer/download';\nconst UPLOAD_ENDPOINT = './api/computer/upload';\nconst UPLOAD_CONTENT_ENDPOINT = './api/computer/upload-content';\n\nasync function requestJson(url: string, init?: RequestInit): Promise {\n const response = await fetch(url, { credentials: 'same-origin', ...init });\n if (!response.ok) throw new Error(`${String(response.status)} ${await response.text()}`);\n return (await response.json()) as T;\n}\n\nasync function postAuthorized(url: string, body: Record = {}): Promise {\n await requestJson(url, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ authorize: true, ...body }),\n });\n}\n\nexport function createComputerSettingsFace(options: {\n prefs: ComputerSettingsPrefs;\n pickDirectory?: (() => Promise) | undefined;\n createXhr?: (() => XMLHttpRequest) | undefined;\n}): ComputerSettingsFace {\n const { prefs } = options;\n return {\n prefs,\n pickerAvailable: options.pickDirectory !== undefined,\n pickDirectory: async () =>\n options.pickDirectory === undefined ? null : options.pickDirectory(),\n openDirectory: async (dir) => {\n await postAuthorized(OPEN_DIR_ENDPOINT, dir === '' ? {} : { dir });\n },\n exportArchive: async (dir) => {\n if (dir !== undefined && dir !== '') await prefs.setExportDir(dir);\n const payload = await requestJson<{ archive?: string; downloadToken?: string }>(\n EXPORT_ENDPOINT,\n {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify(\n dir === undefined || dir === '' ? { authorize: true } : { authorize: true, dir },\n ),\n },\n );\n return {\n archive: payload.archive ?? '',\n ...(payload.downloadToken === undefined ? {} : { downloadToken: payload.downloadToken }),\n };\n },\n downloadUrl: (downloadToken) =>\n `${DOWNLOAD_ENDPOINT}?token=${encodeURIComponent(downloadToken)}`,\n importArchive: async (file) => {\n await postAuthorized(IMPORT_ENDPOINT, { file });\n },\n requestUpload: async (file) => {\n const payload = await requestJson<{ uploadToken?: string }>(UPLOAD_ENDPOINT, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ authorize: true, file }),\n });\n if (payload.uploadToken === undefined) throw new Error('upload not accepted');\n return payload.uploadToken;\n },\n sendUploadBytes: (uploadToken, file) =>\n new Promise((resolve, reject) => {\n const createXhr = options.createXhr ?? (() => new XMLHttpRequest());\n const xhr = createXhr();\n xhr.open('POST', `${UPLOAD_CONTENT_ENDPOINT}?token=${encodeURIComponent(uploadToken)}`);\n xhr.withCredentials = true;\n xhr.setRequestHeader('content-type', 'application/octet-stream');\n xhr.onload = () => {\n if (xhr.status !== 200) {\n reject(new Error(`upload failed: HTTP ${String(xhr.status)}`));\n return;\n }\n try {\n const payload = JSON.parse(xhr.responseText) as {\n ok?: unknown;\n error?: unknown;\n };\n if (payload.ok === true) resolve();\n else\n reject(\n new Error(typeof payload.error === 'string' ? payload.error : 'upload failed'),\n );\n } catch (error: unknown) {\n reject(error instanceof Error ? error : new Error(String(error)));\n }\n };\n xhr.onerror = () => reject(new Error('upload transport failed'));\n xhr.send(file);\n }),\n listArchives: async () => {\n const payload = await requestJson<{ files?: string[] }>(EXPORTS_ENDPOINT);\n return payload.files ?? [];\n },\n hostExportDir: async () => {\n const payload = await requestJson<{ exportDir?: string }>(STATUS_ENDPOINT);\n return payload.exportDir ?? '';\n },\n };\n}\n\nfunction Selector({\n label,\n open,\n onToggle,\n disabled,\n}: {\n readonly label: string;\n readonly open: boolean;\n readonly onToggle: () => void;\n readonly disabled?: boolean | undefined;\n}): ReactElement {\n return (\n \n {label}\n \n \n \n \n );\n}\n\nexport function ComputerSettingsRows({\n t,\n prefs,\n pickerAvailable,\n pickDirectory,\n openDirectory,\n exportArchive,\n downloadUrl,\n importArchive,\n requestUpload,\n sendUploadBytes,\n listArchives,\n hostExportDir,\n}: PropsLocale<'botharness-computer'> & InjectFace): ReactElement {\n const snapshot = useSyncExternalStore(prefs.subscribe, prefs.getSnapshot);\n const [targetError, setTargetError] = useState();\n const [targetSaving, setTargetSaving] = useState(false);\n const [idleOpen, setIdleOpen] = useState(false);\n const [importOpen, setImportOpen] = useState(false);\n const [archives, setArchives] = useState(undefined);\n const [busy, setBusy] = useState<'export' | 'import' | 'upload' | undefined>(undefined);\n const [confirming, setConfirming] = useState<'export' | 'import' | undefined>(undefined);\n const [exportTarget, setExportTarget] = useState(undefined);\n const [manualOpen, setManualOpen] = useState(false);\n const [manualPath, setManualPath] = useState('');\n const [saving, setSaving] = useState(false);\n const [dirNote, setDirNote] = useState(undefined);\n const [transferNote, setTransferNote] = useState(undefined);\n const [download, setDownload] = useState<{ archive: string; token: string } | undefined>(\n undefined,\n );\n const [uploadName, setUploadName] = useState(undefined);\n const uploadFile = useRef(null);\n const [pickerBroken, setPickerBroken] = useState(false);\n const [hostDir, setHostDir] = useState(undefined);\n const [livePhase, setLivePhase] = useState(undefined);\n const [liveElapsed, setLiveElapsed] = useState(0);\n\n const hostDirResource = useMountedResource(() => {\n if (snapshot.target === 'local') return;\n if (snapshot.status !== 'unavailable' && snapshot.exportDir !== '') return;\n let active = true;\n void hostExportDir()\n .then((dir) => {\n if (active) setHostDir(dir);\n })\n .catch(() => undefined);\n return () => {\n active = false;\n };\n }, [hostExportDir, snapshot.status, snapshot.exportDir, snapshot.target]);\n\n const busyResource = useMountedResource(() => {\n setLivePhase(undefined);\n setLiveElapsed(0);\n const startedAt = Date.now();\n const controller = new AbortController();\n let pending = false;\n const tick = async (): Promise => {\n if (controller.signal.aborted) return;\n setLiveElapsed(Math.round((Date.now() - startedAt) / 1000));\n if (pending) return;\n pending = true;\n try {\n const payload = await requestJson<{ status?: { phase?: string } }>(STATUS_ENDPOINT, {\n signal: AbortSignal.any([controller.signal, AbortSignal.timeout(10_000)]),\n });\n if (!controller.signal.aborted) setLivePhase(payload.status?.phase);\n } catch {\n } finally {\n pending = false;\n }\n };\n void tick();\n const timer = setInterval(() => void tick(), 1000);\n return () => {\n controller.abort();\n clearInterval(timer);\n };\n }, [busy]);\n\n const phaseKey = livePhase === undefined ? undefined : PHASE_LABEL[livePhase];\n\n const exportDir = displayExportDir(snapshot.exportDir, hostDir);\n const hasDir = exportDir !== '';\n const writable = snapshot.status === 'ready' && snapshot.writable;\n const canAdjust = pickerAvailable && !pickerBroken;\n\n const pickDirectoryInto = useCallback(\n (apply: (dir: string) => void) => {\n void pickDirectory()\n .then((dir) => {\n if (dir !== null) apply(dir);\n })\n .catch(() => {\n setPickerBroken(true);\n setManualOpen(false);\n setDirNote(t('rows.pickerFallback', { dir: exportDir }));\n });\n },\n [exportDir, pickDirectory, t],\n );\n\n const pickExportDir = useCallback(() => {\n pickDirectoryInto((dir) => {\n setManualPath(dir);\n setDirNote(undefined);\n void prefs.setExportDir(dir).catch((error: unknown) => setDirNote(String(error)));\n });\n }, [pickDirectoryInto, prefs]);\n\n const startExport = useCallback(() => {\n if (!canAdjust) {\n setExportTarget(undefined);\n setConfirming('export');\n return;\n }\n pickDirectory()\n .then((dir) => {\n if (dir === null) return;\n setExportTarget(dir);\n setConfirming('export');\n })\n .catch(() => {\n setPickerBroken(true);\n setManualOpen(false);\n setDirNote(t('rows.pickerFallback', { dir: exportDir }));\n setExportTarget(undefined);\n setConfirming('export');\n });\n }, [canAdjust, exportDir, pickDirectory, t]);\n\n const saveManualPath = useCallback(() => {\n const dir = manualPath.trim();\n if (dir === '') return;\n if (!dir.startsWith('/') && !/^[A-Za-z]:[\\\\/]/u.test(dir)) {\n setDirNote(t('rows.exportDir.needsAbsolute'));\n return;\n }\n setSaving(true);\n setDirNote(undefined);\n void prefs\n .setExportDir(dir)\n .then(() => {\n setManualOpen(false);\n setDirNote(t('rows.exportDir.saved', { dir }));\n })\n .catch((error: unknown) =>\n setDirNote(\n error instanceof ExportDirRejectedError\n ? t('rows.exportDir.saveRejected')\n : String(error),\n ),\n )\n .finally(() => setSaving(false));\n }, [manualPath, prefs, t]);\n\n const runExport = useCallback(() => {\n const autoOpen = !canAdjust;\n setConfirming(undefined);\n setBusy('export');\n setTransferNote(undefined);\n setDownload(undefined);\n void exportArchive(exportTarget)\n .then(({ archive, downloadToken }) => {\n setTransferNote(archive === '' ? t('rows.exportedDone') : t('rows.exported', { archive }));\n if (archive !== '' && downloadToken !== undefined) {\n setDownload({ archive, token: downloadToken });\n }\n if (autoOpen) void openDirectory(exportDir).catch(() => undefined);\n })\n .catch((error: unknown) => setTransferNote(String(error)))\n .finally(() => setBusy(undefined));\n }, [canAdjust, exportArchive, exportDir, exportTarget, openDirectory, t]);\n\n const runImport = useCallback(\n (file: string) => {\n setImportOpen(false);\n setConfirming(undefined);\n setBusy('import');\n setTransferNote(undefined);\n void importArchive(file)\n .then(() => setTransferNote(t('rows.imported', { file })))\n .catch((error: unknown) => setTransferNote(String(error)))\n .finally(() => setBusy(undefined));\n },\n [importArchive, t],\n );\n\n const takeUploadFile = useCallback((file: File | null) => {\n if (file === null) return;\n uploadFile.current = file;\n setUploadName(file.name);\n setTransferNote(undefined);\n }, []);\n\n const runUpload = useCallback(() => {\n const file = uploadFile.current;\n const name = uploadName;\n if (file === null || name === undefined) return;\n setConfirming(undefined);\n setBusy('upload');\n setTransferNote(undefined);\n void requestUpload(name)\n .then((token) => sendUploadBytes(token, file))\n .then(() => importArchive(name))\n .then(() => {\n setTransferNote(t('rows.imported', { file: name }));\n setUploadName(undefined);\n uploadFile.current = null;\n })\n .catch((error: unknown) => setTransferNote(String(error)))\n .finally(() => setBusy(undefined));\n }, [uploadName, requestUpload, sendUploadBytes, importArchive, t]);\n\n const openImport = useCallback(() => {\n if (importOpen) {\n setImportOpen(false);\n return;\n }\n void listArchives()\n .then((files) => {\n setArchives(files);\n if (files.length === 0) {\n setImportOpen(false);\n setTransferNote(t('rows.noArchives'));\n } else {\n setImportOpen(true);\n }\n })\n .catch((error: unknown) => setTransferNote(String(error)));\n }, [importOpen, listArchives, t]);\n\n const openDir = useCallback(() => {\n void openDirectory(exportDir).catch((error: unknown) => setDirNote(String(error)));\n }, [exportDir, openDirectory]);\n\n const selectedFile = uploadName ?? (confirming === 'import' ? archives?.[0] : undefined);\n\n return (\n \n \n );\n}\n","export type ClientTelemetrySurface = 'desktop_app' | 'browser';\n\nexport interface TelemetryRpc {\n call(path: string, method: string, options?: { args?: unknown }): Promise;\n}\n\nexport function telemetrySurface(): ClientTelemetrySurface {\n return typeof globalThis === 'object' && 'dshDesktop' in globalThis ? 'desktop_app' : 'browser';\n}\n\nexport function recordViewerOpen(\n rpc: TelemetryRpc | undefined,\n panel: 'browser' | 'computer',\n): void {\n void rpc\n ?.call('/api', 'botharness/telemetryEvent', {\n args: {\n event: 'viewer:subpanel_open',\n properties: { panel, surface: telemetrySurface() },\n },\n })\n .catch(() => {});\n}\n","/**\n * Vendored Access Power glyph from lucide-react@1.46.0 (ISC, ADR-0032).\n *\n * Source: the lucide `dist/esm/icons/power.mjs` glyph data. Vendored at the\n * stock 2-unit stroke without adding a `lucide-react` runtime dependency.\n *\n * ISC License\n *\n * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT).\n * All other copyright (c) for Lucide are held by Lucide Contributors 2022.\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\nimport type { ReactElement } from 'react';\nexport function AccessPowerIcon(): ReactElement {\n return (\n \n \n \n \n );\n}\n","export const STYLEX_CSS: string = '@bh-stylex-css';\n","import { PanelEmptyState } from '../../../client/src/client/ds/empty-state.js';\nimport { border, color, radius, space, text } from '../../../client/src/client/ds/tokens.stylex.js';\nimport {\n RemoteViewer,\n type ViewerLifecycleEvent,\n} from '../../../client/src/client/remote-viewer/index.js';\nimport { BH } from '../../../client/src/client/remote-viewer/tokens.js';\nimport {\n useCallback,\n useRef,\n useState,\n useSyncExternalStore,\n type CSSProperties,\n type ComponentType,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport { isExitReport } from './viewer-state.js';\nimport { reportViewerEvent, viewerEventText } from './viewer-events.js';\nimport {\n LOCALE_NS,\n PHASE_LABEL,\n en,\n zh,\n type ComputerKey,\n type ComputerTranslate,\n} from './locale.js';\nimport { Button, Tag } from '@deepseek-ai/dsh-client-ui-primitives';\nimport { Tooltip } from '../../../client/src/client/ds/tooltip.js';\nimport { SidebarCardList, SidebarCardRow } from '../../../client/src/client/sidebar-card.js';\nimport type { Context as ClientContext } from '@deepseek-ai/cordis';\nimport type {} from '@deepseek-ai/dsh-client-ui-settings/client';\n\nimport { COMPUTER_SETTINGS_NAMESPACE, type ComputerSettings } from '../settings.js';\nimport type { ComputerStorage } from '../provider.js';\nimport {\n ComputerSettingsPrefs,\n ComputerSettingsRows,\n createComputerSettingsFace,\n type ComputerSettingsScope,\n} from './settings-rows.js';\nimport { LocalComputerStatus } from './local-computer.js';\nimport { useMountedResource } from './mounted-resource.js';\nimport { recordViewerOpen } from '../../../client/src/client/telemetry-surface.js';\n\nimport { AccessPowerIcon } from './access-power-icon.js';\nimport { STYLEX_CSS } from '../../../client/src/client/ds/stylex-css.js';\n\nconst ACCESS_STYLE = `\n.bh-computer-access-control { position: relative; display: flex; align-items: center; }\n.bh-computer-access-power {\n display: flex; align-items: center; justify-content: center; width: 28px; height: 28px;\n padding: 0; border: 0; border-radius: ${radius.md}; background: transparent;\n color: ${color.muted}; cursor: pointer;\n}\n.bh-computer-access-power:hover { background: ${color.hover}; }\n.bh-computer-access-power[aria-pressed='true'] { color: ${color.accent}; background: ${color.hover}; }\n.bh-computer-access-power:focus-visible { outline: ${border.focus} solid ${color.accent}; outline-offset: 2px; }\n.bh-computer-access-power:disabled { opacity: 0.5; cursor: default; }\n.bh-computer-access-power.bh-access-failed { color: ${color.danger}; }\n.bh-computer-access-error { order: -1; padding: 0 ${space.x2}; color: ${color.danger}; font-size: ${text.metaSize}; line-height: ${text.metaLine}; white-space: nowrap; }\n\n`;\n\nexport const name = 'botharness-computer-client';\n\nexport const inject = ['slots', 'channelSidebar', 'connection', 'locale'];\n\nconst STATUS_ENDPOINT = './api/computer/status';\nconst START_ENDPOINT = './api/computer/start';\nconst STOP_ENDPOINT = './api/computer/stop';\nconst VIEWER_SRC = './botharness-computer/viewer/';\nconst APPROVED_KEY = 'botharness-computer-start-approved';\nconst ENTRY_ID = 'botharness-computer';\n\ntype ComputerState = 'absent' | 'stopped' | 'running' | 'failed';\ntype ComputerPhase =\n | 'idle'\n | 'pulling'\n | 'starting'\n | 'running'\n | 'stopping'\n | 'exporting'\n | 'importing'\n | 'failed';\n\ninterface ComputerProgress {\n readonly percent?: number;\n readonly text?: string;\n readonly updatedAt?: number;\n}\n\ninterface ComputerStatusPayload {\n readonly target?: 'local' | 'container';\n resolution?: string;\n readonly provider: string | null;\n readonly probe: { readonly available: boolean; readonly detail?: string };\n readonly exportDir?: string;\n readonly status: {\n readonly state: ComputerState;\n readonly phase?: ComputerPhase;\n readonly detail?: string;\n readonly progress?: ComputerProgress;\n readonly storage?: ComputerStorage;\n };\n}\n\ninterface ChannelSidebarEntryProps {\n readonly scope: 'channel' | 'personabot';\n readonly channelId: string;\n readonly botSlug: string | undefined;\n readonly actions: unknown;\n readonly setExpanded?: (expanded: boolean) => void;\n readonly setExpandable?: (expandable: boolean) => void;\n}\n\ninterface ConnectionRpcLike {\n call(\n channel: string,\n endpoint: string,\n payload: unknown,\n signal?: AbortSignal,\n ): Promise<\n | { readonly ok: true; readonly value: unknown }\n | { readonly ok: false; readonly error: { readonly message?: string } }\n >;\n}\n\nlet connectionRpc: ConnectionRpcLike | undefined;\n\ninterface ChannelSidebarRegistryLike {\n register(entry: {\n readonly id: string;\n readonly label: string;\n readonly icon?: string;\n readonly order?: number;\n readonly scope: 'channel' | 'personabot';\n readonly component: ComponentType;\n readonly headerAction?: ComponentType;\n readonly badge?: ComponentType;\n readonly tab?: string;\n }): () => void;\n}\n\nasync function requestJson(url: string, init?: RequestInit): Promise {\n const response = await fetch(url, { credentials: 'same-origin', ...init });\n if (!response.ok) throw new Error(`${String(response.status)} ${await response.text()}`);\n return (await response.json()) as T;\n}\n\nconst SETUP_GUIDANCE_KEY: ComputerKey = 'entry.setup';\n\nconst SHARED_NOTE_KEY: ComputerKey = 'entry.shared';\n\nconst AUTHORIZATION_POINTS: readonly ComputerKey[] = [\n 'entry.authorize.probe',\n 'entry.authorize.volume',\n 'entry.authorize.pull',\n 'entry.authorize.bind',\n];\n\nconst noteStyle: CSSProperties = { opacity: 0.7, fontSize: 12, whiteSpace: 'pre-wrap' };\nconst buttonStyle: CSSProperties = {\n padding: '4px 10px',\n borderRadius: 6,\n border: `1px solid ${BH.borderL3}`,\n background: 'transparent',\n color: 'inherit',\n cursor: 'pointer',\n fontSize: 12,\n};\nconst terminalStyle: CSSProperties = {\n fontFamily: 'ui-monospace, SFMono-Regular, Menlo, monospace',\n fontSize: 11,\n opacity: 0.7,\n whiteSpace: 'pre-wrap',\n wordBreak: 'break-all',\n};\n\nconst DESIGN_WIDTH = 1280;\nconst DESIGN_HEIGHT = 800;\n\nfunction designOf(resolution: string | undefined): { width: number; height: number } {\n const match = /^(\\d{2,5})x(\\d{2,5})$/u.exec(resolution ?? '');\n if (match === null) return { width: DESIGN_WIDTH, height: DESIGN_HEIGHT };\n return { width: Number(match[1]), height: Number(match[2]) };\n}\n\nexport interface RecentLogRow {\n readonly id: number;\n readonly ts: number;\n readonly plugin: string;\n readonly owner: string;\n readonly kind: string;\n readonly detail: string;\n}\n\nexport function RecentLogsList({\n entries,\n}: {\n readonly entries: readonly RecentLogRow[];\n}): ReactElement {\n return (\n
\n {entries.map((entry) => (\n
\n {new Date(entry.ts).toLocaleTimeString()} [{entry.kind}] {entry.detail}\n
\n ))}\n
\n );\n}\n\nexport function RecentLogs({ t }: { readonly t: ComputerTranslate }): ReactElement {\n const [open, setOpen] = useState(false);\n const [entries, setEntries] = useState(undefined);\n const [failed, setFailed] = useState(false);\n const loadResource = useMountedResource(() => {\n const controller = new AbortController();\n requestJson<{ entries: RecentLogRow[] }>('./api/computer/logs?limit=10', {\n signal: controller.signal,\n })\n .then((result) => {\n if (!controller.signal.aborted) setEntries(result.entries);\n })\n .catch(() => {\n if (!controller.signal.aborted) setFailed(true);\n });\n return () => controller.abort();\n }, []);\n return (\n
\n {open && entries === undefined && !failed ?
\n );\n}\n\nexport {\n ScreenIndicator,\n StreamOverlay,\n ViewerTitleBar,\n} from '../../../client/src/client/remote-viewer/index.js';\n\nfunction RunningCard({\n t,\n botSlug,\n busy,\n stopping,\n resolution,\n onStop,\n}: {\n readonly t: ComputerTranslate;\n readonly botSlug: string | undefined;\n readonly busy: boolean;\n readonly stopping: boolean;\n readonly resolution?: string;\n readonly onStop: () => void;\n}): ReactElement {\n const onEvent = useCallback((event: ViewerLifecycleEvent) => {\n void reportViewerEvent(undefined, viewerEventText(event));\n }, []);\n return (\n }\n onEvent={onEvent}\n />\n );\n}\n\nexport interface ComputerEntryViewProps {\n readonly t: ComputerTranslate;\n readonly state: ComputerState;\n readonly phase?: ComputerPhase;\n readonly detail?: string;\n readonly progress?: ComputerProgress;\n readonly runtimeAvailable: boolean;\n readonly confirming: boolean;\n readonly busy: boolean;\n readonly elapsed: number;\n readonly nowTs: number;\n readonly error?: string;\n readonly botSlug?: string;\n readonly storage?: ComputerStorage;\n readonly resolution?: string;\n readonly onStart: () => void;\n readonly onConfirmStart: () => void;\n readonly onStop: () => void;\n readonly onApprove: (remember: boolean) => void;\n readonly onCancel: () => void;\n}\n\nexport function ComputerEntryView(props: ComputerEntryViewProps): ReactElement {\n const {\n t,\n state,\n phase,\n detail,\n progress,\n runtimeAvailable,\n confirming,\n busy,\n elapsed,\n nowTs,\n error,\n botSlug,\n storage,\n resolution,\n onStart,\n onConfirmStart,\n onStop,\n onApprove,\n onCancel,\n } = props;\n\n const title = t('rows.target.container');\n const card = (\n chip: ReactElement,\n rest: { meta?: ReactNode; detail?: ReactNode },\n ): ReactElement => (\n \n \n \n );\n\n if (!runtimeAvailable) {\n return card({t('entry.chip.setup')}, {\n detail:
{t(SETUP_GUIDANCE_KEY)}
,\n });\n }\n\n if (confirming) {\n return card({t('entry.chip.authorize')}, {\n detail: (\n
\n
{t('entry.authorizeIntro')}
\n
    \n {AUTHORIZATION_POINTS.map((point) => (\n
  • {t(point)}
  • \n ))}\n
\n {storage === undefined ? null : (\n
\n {t('entry.authorize.storage', { target: storage.target })}\n {storage.ignoredReason === undefined ? '' : `(${storage.ignoredReason})`}\n
\n )}\n {storage?.migrationHint === undefined ? null : (\n
{storage.migrationHint}
\n )}\n {storage?.kind === 'bind' ? (\n
{t('entry.authorize.storageBindRisk')}
\n ) : null}\n \n
\n \n \n
\n
\n ),\n });\n }\n\n const inProgress =\n phase === 'pulling' ||\n phase === 'starting' ||\n phase === 'stopping' ||\n phase === 'exporting' ||\n phase === 'importing';\n\n if (state === 'running') {\n return (\n
\n {card({t('entry.chip.running')}, {\n meta: t('entry.screen.title', { name: botSlug ?? 'PersonaBot' }),\n })}\n \n
\n );\n }\n\n if (inProgress) {\n return card({t(PHASE_LABEL[phase] ?? 'entry.phase.working')}, {\n meta: (\n \n {t('entry.elapsed', { seconds: elapsed })}\n {progress?.updatedAt === undefined\n ? ''\n : ` · ${t('entry.updated', {\n seconds: Math.max(0, Math.round((nowTs - progress.updatedAt) / 1000)),\n })}`}\n \n ),\n detail: (\n
\n \n \n
\n
{progress?.text ?? detail ?? t('entry.wait')}
\n \n ),\n });\n }\n\n const failed = error !== undefined || state === 'failed';\n return card(\n failed ? (\n {t('entry.chip.failed')}\n ) : (\n {t('entry.chip.stopped')}\n ),\n {\n meta: (\n \n {error ?? (isExitReport(detail) ? undefined : detail) ?? t(SHARED_NOTE_KEY)}\n \n ),\n detail: (\n \n ),\n },\n );\n}\n\nexport function createComputerEntry(\n t: ComputerTranslate,\n): (props: ChannelSidebarEntryProps) => ReactElement {\n return function ComputerEntryWithLocale(props: ChannelSidebarEntryProps): ReactElement {\n const { computerAccess } = useBotInfo(props.botSlug);\n if (computerAccess === false)\n return {t('entry.access.description')};\n return ;\n };\n}\n\nexport function createComputerBadge(\n t: ComputerTranslate,\n): (props: ChannelSidebarEntryProps) => ReactElement | null {\n return function ComputerBadge({ botSlug }: ChannelSidebarEntryProps): ReactElement | null {\n const { computerAccess } = useBotInfo(botSlug);\n if (computerAccess !== true) return null;\n return (\n \n );\n };\n}\n\ninterface BotInfo {\n readonly displayName: string | undefined;\n readonly computerAccess: boolean | undefined;\n}\n\ninterface ReadableStore {\n subscribe(listener: () => void): () => void;\n getSnapshot(): T;\n}\n\nconst botInfoStores = new Map<\n string,\n ReadableStore & { setAccess(enabled: boolean): void }\n>();\n\nfunction botInfoStore(\n botSlug: string | undefined,\n): ReadableStore & { setAccess(enabled: boolean): void } {\n const key = botSlug ?? '';\n const existing = botInfoStores.get(key);\n if (existing !== undefined) return existing;\n const created = createBotInfoStore(botSlug);\n botInfoStores.set(key, created);\n return created;\n}\n\nfunction createBotInfoStore(\n botSlug: string | undefined,\n): ReadableStore & { setAccess(enabled: boolean): void } {\n let info: BotInfo = { displayName: undefined, computerAccess: undefined };\n const listeners = new Set<() => void>();\n let loadedAt = Number.NEGATIVE_INFINITY;\n const load = (): void => {\n const rpc = connectionRpc;\n if (rpc === undefined || botSlug === undefined) return;\n void rpc\n .call('/api', 'botharness/list', { args: {} })\n .then((result) => {\n if (!result.ok) return;\n const value = result.value as {\n bots?: readonly { slug?: unknown; displayName?: unknown; computerAccess?: unknown }[];\n };\n const match = (value.bots ?? []).find((bot) => bot.slug === botSlug);\n if (match === undefined) return;\n info = {\n displayName:\n typeof match.displayName === 'string' && match.displayName.length > 0\n ? match.displayName\n : undefined,\n computerAccess: match.computerAccess === true,\n };\n for (const listener of listeners) listener();\n })\n .catch(() => undefined);\n };\n return {\n setAccess(enabled) {\n info = { ...info, computerAccess: enabled };\n for (const listener of listeners) listener();\n },\n subscribe(listener) {\n if (listeners.size === 0 && Date.now() - loadedAt > 5000) {\n loadedAt = Date.now();\n load();\n }\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n getSnapshot: () => info,\n };\n}\n\nfunction useBotInfo(botSlug: string | undefined): BotInfo {\n const store = botInfoStore(botSlug);\n const info = useSyncExternalStore(store.subscribe, store.getSnapshot);\n return { displayName: info.displayName ?? botSlug, computerAccess: info.computerAccess };\n}\n\nfunction ComputerHeaderAction({\n botSlug,\n t,\n setExpandable,\n setExpanded,\n}: ChannelSidebarEntryProps & { t: ComputerTranslate }): ReactElement {\n const store = botInfoStore(botSlug);\n const [busy, setBusy] = useState(false);\n const inFlight = useRef(false);\n const [error, setError] = useState(false);\n const subscribe = (listener: () => void): (() => void) => {\n const sync = (): void => {\n setExpandable?.(store.getSnapshot().computerAccess !== undefined);\n };\n const unsubscribe = store.subscribe(() => {\n sync();\n listener();\n });\n sync();\n return unsubscribe;\n };\n const info = useSyncExternalStore(subscribe, store.getSnapshot);\n const accessOn = info.computerAccess === true;\n\n const onToggle = (next: boolean): void => {\n const rpc = connectionRpc;\n if (rpc === undefined || botSlug === undefined || inFlight.current) return;\n inFlight.current = true;\n setBusy(true);\n setError(false);\n void rpc\n .call('/api', 'botharness/computerAccessSet', { args: { slug: botSlug, enabled: next } })\n .then((result) => {\n if (!result.ok) {\n setError(true);\n return;\n }\n const value = result.value as { bot?: { computerAccess?: unknown } };\n const applied = value.bot?.computerAccess === true;\n store.setAccess(applied);\n setExpanded?.(applied);\n })\n .catch(() => {\n setError(true);\n })\n .finally(() => {\n inFlight.current = false;\n setBusy(false);\n });\n };\n\n const label = t(accessOn ? 'entry.access.disable' : 'entry.access.enable');\n return (\n \n \n onToggle(!accessOn)}\n >\n \n \n \n {error ? (\n \n {t('entry.access.failureHint')}\n \n ) : null}\n \n );\n}\n\nexport function createComputerHeader(\n t: ComputerTranslate,\n): (props: ChannelSidebarEntryProps) => ReactElement {\n return function ComputerHeaderWithLocale(props: ChannelSidebarEntryProps): ReactElement {\n return ;\n };\n}\n\nfunction ComputerEntry({\n botSlug,\n t,\n}: ChannelSidebarEntryProps & { t: ComputerTranslate }): ReactElement {\n const { displayName } = useBotInfo(botSlug);\n const [payload, setPayload] = useState();\n const [error, setError] = useState();\n const [busy, setBusy] = useState(false);\n const [confirming, setConfirming] = useState(false);\n const [approved, setApproved] = useState(\n () => globalThis.sessionStorage?.getItem(APPROVED_KEY) === '1',\n );\n const [elapsed, setElapsed] = useState(0);\n const [nowTs, setNowTs] = useState(() => Date.now());\n const refresh = useCallback(async (signal?: AbortSignal) => {\n try {\n const next = await requestJson(\n STATUS_ENDPOINT,\n signal === undefined ? undefined : { signal },\n );\n if (signal?.aborted) return;\n setPayload(next);\n setError(undefined);\n } catch (cause) {\n if (!signal?.aborted) setError(String(cause));\n }\n }, []);\n\n const statusResource = useMountedResource(() => {\n recordViewerOpen(connectionRpc, 'computer');\n const controller = new AbortController();\n let pending = false;\n const poll = async (): Promise => {\n if (pending || controller.signal.aborted) return;\n pending = true;\n try {\n await refresh(AbortSignal.any([controller.signal, AbortSignal.timeout(10_000)]));\n } finally {\n pending = false;\n }\n };\n void poll();\n const timer = setInterval(() => void poll(), 3000);\n return () => {\n controller.abort();\n clearInterval(timer);\n };\n }, [refresh]);\n\n const phase = payload?.status.phase;\n const inProgress =\n phase === 'pulling' ||\n phase === 'starting' ||\n phase === 'stopping' ||\n phase === 'exporting' ||\n phase === 'importing';\n\n const progressResource = useMountedResource(() => {\n const startedAt = Date.now();\n setElapsed(0);\n const timer = setInterval(() => {\n setNowTs(Date.now());\n setElapsed(Math.round((Date.now() - startedAt) / 1000));\n }, 1000);\n return () => clearInterval(timer);\n }, [inProgress]);\n\n const act = useCallback(\n async (endpoint: string) => {\n setBusy(true);\n try {\n await requestJson(endpoint, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({\n authorize: true,\n ...(endpoint === START_ENDPOINT && typeof navigator !== 'undefined'\n ? { language: navigator.language }\n : {}),\n }),\n });\n await refresh();\n } catch (cause) {\n setError(String(cause));\n } finally {\n setBusy(false);\n }\n },\n [refresh],\n );\n\n const onStart = useCallback(() => {\n if (!approved) {\n setConfirming(true);\n return;\n }\n void act(START_ENDPOINT);\n }, [act, approved]);\n\n const onConfirmStart = useCallback(() => {\n setConfirming(false);\n void act(START_ENDPOINT);\n }, [act]);\n\n const onApprove = useCallback((remember: boolean) => {\n if (remember) {\n globalThis.sessionStorage?.setItem(APPROVED_KEY, '1');\n setApproved(true);\n }\n }, []);\n\n return (\n
\n {inProgress ?
\n );\n}\n\nexport function apply(ctx: ClientContext): void {\n botInfoStores.clear();\n const settingsPrefs = new ComputerSettingsPrefs();\n ctx.inject(['configForms'], (settingsCtx) => {\n const scope = settingsCtx.configForms.get(\n COMPUTER_SETTINGS_NAMESPACE,\n ) as unknown as ComputerSettingsScope;\n const release = settingsPrefs.attach(scope);\n return () => {\n release();\n };\n });\n ctx.inject(['uiWorkspace', 'slots'], (workspaceCtx) => {\n const workspace = (\n workspaceCtx as unknown as { uiWorkspace?: { pickDirectory?: () => Promise } }\n ).uiWorkspace;\n const face = createComputerSettingsFace({\n prefs: settingsPrefs,\n pickDirectory: workspace?.pickDirectory?.bind(workspace),\n });\n workspaceCtx.slots.inject('botharness.settings.section', () =>\n workspaceCtx.slots.register(\n {\n name: 'botharness.settings.section',\n id: 'computer',\n order: 30,\n label: () => t('section.title'),\n locale: LOCALE_NS,\n inject: () => face,\n },\n ComputerSettingsRows,\n ),\n );\n });\n ctx.effect(() => {\n if (typeof document === 'undefined') return () => {};\n const style = document.createElement('style');\n style.setAttribute('data-botharness-computer', 'client');\n style.dataset.plugin = '@botharness/computer';\n style.dataset.pluginCss = '@botharness/computer/client.css';\n style.textContent = ACCESS_STYLE + STYLEX_CSS;\n document.head.appendChild(style);\n return () => {\n style.remove();\n };\n }, 'botharness-computer: client styles');\n const t = ctx.locale.bind(LOCALE_NS);\n ctx.effect(() => ctx.locale.register(LOCALE_NS, { zh, en }), 'botharness-computer: dictionaries');\n ctx.inject(['channelSidebar', 'connection'], (sidebarCtx) => {\n const registry = (sidebarCtx as unknown as { channelSidebar?: ChannelSidebarRegistryLike })\n .channelSidebar;\n connectionRpc = (sidebarCtx as unknown as { connection?: { rpc?: ConnectionRpcLike } })\n .connection?.rpc;\n if (registry === undefined) return;\n ctx.effect(\n () =>\n registry.register({\n id: ENTRY_ID,\n icon: 'monitor',\n label: t('entry.label'),\n order: 40,\n scope: 'personabot',\n component: createComputerEntry(t),\n headerAction: createComputerHe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AAO,CACL,CACE,YACA,EACE,QAAQ,oCACV,CACF,GACA,CACE,QACA,EACE,GAAG,6GACL,CACF,CACF;GACA,cAAc;IACZ,CACE,QACA,EACE,GAAG,6GACL,CACF;IACA,CACE,QACA,EACE,GAAG,WACL,CACF;IACA,CACE,QACA,EACE,GAAG,WACL,CACF;IACA,CACE,UACA;KACE,IAAI;KACJ,IAAI;KACJ,GAAG;IACL,CACF;GACF;GACA,OAAO;IACL,CACE,QACA,EACE,GAAG,4CACL,CACF;IACA,CACE,QACA,EACE,GAAG,8BACL,CACF;IACA,CACE,QACA,EACE,GAAG,6BACL,CACF;IACA,CACE,UACA;KACE,IAAI;KACJ,IAAI;KACJ,GAAG;IACL,CACF;GACF;GACA,cAAc;IACZ,CACE,QACA,EACE,GAAG,WACL,CACF;IACA,CACE,QACA,EACE,GAAG,WACL,CACF;IACA,CACE,UACA;KACE,IAAI;KACJ,IAAI;KACJ,GAAG;IACL,CACF;IACA,CACE,UACA;KACE,IAAI;KACJ,IAAI;KACJ,GAAG;IACL,CACF;GACF;GACA,UAAU,CACR,CACE,QACA,EACE,GAAG,0UACL,CACF,GACA,CACE,UACA;IACE,IAAI;IACJ,IAAI;IACJ,GAAG;GACL,CACF,CACF;GACA,SAAS;IACP,CACE,QACA;KACE,OAAO;KACP,QAAQ;KACR,GAAG;KACH,GAAG;KACH,IAAI;IACN,CACF;IACA,CACE,QACA;KACE,IAAI;KACJ,IAAI;KACJ,IAAI;KACJ,IAAI;IACN,CACF;IACA,CACE,QACA;KACE,IAAI;KACJ,IAAI;KACJ,IAAI;KACJ,IAAI;IACN,CACF;GACF;GACA,OAAO;IACL,CACE,UACA;KACE,IAAI;KACJ,IAAI;KACJ,GAAG;IACL,CACF;IACA,CACE,QACA,EACE,GAAG,kDACL,CACF;IACA,CACE,QACA,EACE,GAAG,WACL,CACF;GACF;GACA,eAAe,CACb,CACE,QACA;IACE,OAAO;IACP,QAAQ;IACR,GAAG;IACH,GAAG;IACH,IAAI;GACN,C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Q,YAAY;IAC1B,MAAM,cAAc,eAAe;IACnC,SAAS,KAAK,YAAY,KAAK;IAC/B,aAAa;KACX,MAAM,OAAO;IACf;GACF,GAAG,oCAAoC;GACvC,MAAM,IAAI,IAAI,OAAO,KAAK,SAAS;GACnC,IAAI,aAAa,IAAI,OAAO,SAAS,WAAW;IAAE;IAAI;GAAG,CAAC,GAAG,mCAAmC;GAChG,IAAI,OAAO,CAAC,kBAAkB,YAAY,IAAI,eAAe;IAC3D,MAAM,WAAY,WACf;IACH,gBAAiB,WACd,YAAY;IACf,IAAI,aAAa,KAAA,GAAW;IAC5B,IAAI,aAEA,SAAS,SAAS;KAChB,IAAI;KACJ,MAAM;KACN,OAAO,EAAE,aAAa;KACtB,OAAO;KACP,OAAO;KACP,WAAW,oBAAoB,CAAC;KAChC,cAAc,qBAAqB,CAAC;KACpC,OAAO,oBAAoB,CAAC;KAC5B,KAAK;IACP,CAAC,GACH,4CACF;GACF,CAAC;EACH"} \ No newline at end of file +{"version":3,"file":"client.js","names":["createElement","stylex","space","x1","x2","x3","x4","x5","x6","text","metaSize","metaLine","bodySize","bodyLine","titleSize","titleLine","regular","strong","radius","xs","sm","md","lg","panel","round","border","hairline","focus","size","inlineIcon","icon","row","nav","dialog","small","bodyMax","medium","wide","actionColor","secondary","hover","danger","dangerLabel","color","fg","muted","subtle","divider","borderStrong","selected","navSelected","accent","accentText","onAccent","onDanger","dangerEdge","dangerSoft","warning","warningEdge","warningSoft","success","surface","elevated","base","modal","well","accentTint","ReactElement","ReactNode","stylex","ChannelSidebarIcon","border","color","radius","size","space","text","EmptyState","title","description","action","status","undefined","PanelEmptyState","icon","children","useMountedResource","useRef","useCallback","useMountedResource","Button","Pill","IconFullscreenOutlineRegular","useState","StateDot","useRef","useCallback","Fragment","createContext","useContext","PrimitiveTooltip","useRef","useCallback","ReactElement","ReactNode","stylex","color","space","text","styles","note","kogj98","kGuDYH","kLWn49","kHjlTd","$$css","inset","k8WAf4","kg3NbH","muted","kMwMTN","subtle","danger","success","warning","NoteTone","Note","tone","children","props","ButtonHTMLAttributes","InputHTMLAttributes","ReactElement","ReactNode","stylex","actionColor","border","color","radius","size","space","text","pillStyles","pill","k1xSpc","kGNEyG","kOIVth","ks0D6T","kZKoxP","kg3NbH","kMzoRj","kaIpWk","kWkggS","kMwMTN","kMv6JI","kGuDYH","kLWn49","khDVqt","kkrTdU","kSiTet","kI3sdo","kInvED","$$css","PillButton","children","rest","Omit","HTMLButtonElement","PillFileButton","input","HTMLInputElement","Menu","NativeMenu","Menu","ComponentProps","createPortal","stylex","useMountedResource","border","space","MenuPoint","x","y","pointerMenuPosition","point","width","height","viewport","top","margin","Number","parseFloat","x4","Math","max","min","PointerMenuProps","Omit","container","Element","align","PointerMenu","document","body","props","mount","HTMLSpanElement","node","menu","querySelector","HTMLElement","originalMaxWidth","getComputedStyle","maxWidth","originalMinWidth","minWidth","place","scale","getBoundingClientRect","cssZoom","currentCSSZoom","undefined","scaleX","scaleY","root","documentElement","clearance","hasAttribute","getPropertyValue","availableWidth","innerWidth","style","Infinity","maxHeight","innerHeight","box","desired","left","observer","ResizeObserver","observe","window","addEventListener","disconnect","removeEventListener","className","PointerMenu","MenuPoint","useMountedResource","useRef","useState","ReactElement","ReactNode","stylex","IconChevronDownOutlineRegular","pillStyles","color","space","SelectOption","value","Value","label","SelectProps","options","onChange","disabled","align","autoFocus","reselect","Select","open","setOpen","point","setPoint","trigger","HTMLButtonElement","active","mount","node","current","place","rect","getBoundingClientRect","scale","offsetHeight","height","next","x","right","left","y","bottom","Number","parseFloat","x2","previous","resize","ResizeObserver","undefined","observe","document","documentElement","observer","MutationObserver","attributes","attributeFilter","window","addEventListener","disconnect","removeEventListener","close","button","menu","activeElement","closest","queueMicrotask","focused","isConnected","body","contains","focus","preventScroll","find","option","event","stopPropagation","props","pill","map","id","useId","ReactElement","ReactNode","Ref","stylex","border","color","space","text","NARROW","COMPACT","SettingsRows","children","rootRef","HTMLDivElement","SettingsSectionProps","title","description","SettingsSection","id","undefined","SettingsRowProps","control","data","Readonly","Record","SettingsRow","titleId","descriptionId","SettingsValue","useState","ReactElement","ReactNode","stylex","Button","Note","color","radius","space","text","MissingPackagesAccess","MissingPackagesLabels","missing","manual","install","copy","copied","formatProgressMiB","bytes","toFixed","ProgressLine","percent","label","value","Math","max","min","MissingPackages","command","access","installing","busy","onInstall","labels","children","setCopied","navigator","clipboard","writeText","then","undefined","localSetupFailure","useCallback","useState","ReactElement","stylex","Button","Tag","Note","space","MissingPackages","ProgressLine","formatProgressMiB","SidebarCardList","SidebarCardRow","ComputerTranslate","useMountedResource","LocalMissing","packages","command","install","LocalStatus","target","probe","available","detail","status","refusal","permissions","accessibility","screenRecording","state","phase","progress","percent","downloadedBytes","totalBytes","missing","text","LocalComputerStatus","t","payload","setPayload","busy","setBusy","error","setError","refresh","signal","AbortSignal","response","fetch","credentials","undefined","ok","Error","next","json","aborted","old","resource","HTMLDivElement","controller","AbortController","pending","poll","Promise","any","timeout","timer","setInterval","abort","clearInterval","installing","preparing","failureDetail","failure","post","path","body","Record","method","headers","JSON","stringify","then","refused","catch","code","finally","check","authorize","granted","download","installLabel","label","join","String","checkButton","length","manual","copy","copied","downloaded","total","permission","useCallback","useRef","useState","useSyncExternalStore","ReactElement","useMountedResource","stylex","IconChevronDownOutlineRegular","IconFolderOpenOutlineRegular","Input","Menu","Switch","InjectFace","PropsLocale","COMPUTER_TARGET_FIELD","COMPUTER_AUTO_ALLOW_FIELD","COMPUTER_EXPORT_DIR_FIELD","COMPUTER_IDLE_STOP_FIELD","ComputerSettings","Note","PillButton","PillFileButton","Select","SettingsRow","SettingsRows","border","color","space","text","LocalComputerStatus","ComputerTarget","PHASE_LABEL","ComputerTranslate","ComputerSettingsSnapshot","target","exportDir","idleStopMinutes","autoAllowActions","status","writable","ComputerSettingsScope","getSnapshot","value","subscribe","listener","set","field","Promise","ExportDirRejectedError","Error","constructor","name","displayExportDir","configured","hostDir","ComputerSettingsPrefs","snapshot","listeners","Set","scope","detach","attach","sync","undefined","add","delete","setTarget","setExportDir","publish","error","setIdleStopMinutes","catch","setAutoAllowActions","previous","patch","Partial","next","ComputerSettingsFace","prefs","pickerAvailable","pickDirectory","openDirectory","dir","exportArchive","archive","downloadToken","downloadUrl","importArchive","file","requestUpload","sendUploadBytes","uploadToken","File","listArchives","hostExportDir","IDLE_OPTIONS","const","EXPORT_ENDPOINT","IMPORT_ENDPOINT","EXPORTS_ENDPOINT","STATUS_ENDPOINT","OPEN_DIR_ENDPOINT","DOWNLOAD_ENDPOINT","UPLOAD_ENDPOINT","UPLOAD_CONTENT_ENDPOINT","requestJson","url","init","RequestInit","T","response","fetch","credentials","ok","String","json","postAuthorized","body","Record","method","headers","JSON","stringify","authorize","createComputerSettingsFace","options","createXhr","XMLHttpRequest","payload","encodeURIComponent","resolve","reject","xhr","open","withCredentials","setRequestHeader","onload","parse","responseText","onerror","send","files","Selector","label","onToggle","disabled","ComputerSettingsRows","t","targetError","setTargetError","targetSaving","setTargetSaving","idleOpen","setIdleOpen","importOpen","setImportOpen","archives","setArchives","busy","setBusy","confirming","setConfirming","exportTarget","setExportTarget","manualOpen","setManualOpen","manualPath","setManualPath","saving","setSaving","dirNote","setDirNote","transferNote","setTransferNote","download","setDownload","token","uploadName","setUploadName","uploadFile","pickerBroken","setPickerBroken","setHostDir","livePhase","setLivePhase","liveElapsed","setLiveElapsed","hostDirResource","HTMLSpanElement","active","then","busyResource","startedAt","Date","now","controller","AbortController","pending","tick","signal","aborted","Math","round","phase","AbortSignal","any","timeout","timer","setInterval","abort","clearInterval","phaseKey","hasDir","canAdjust","pickDirectoryInto","apply","pickExportDir","startExport","saveManualPath","trim","startsWith","test","finally","runExport","autoOpen","runImport","takeUploadFile","current","runUpload","openImport","length","openDir","selectedFile","map","id","className","event","minutes","Number","globalThis","location","assign","seconds","useState","useCallback","Tag","Button","useSyncExternalStore","useRef"],"sources":["../../../node_modules/.pnpm/@stylexjs+stylex@0.19.1/node_modules/@stylexjs/stylex/lib/es/stylex.mjs","../../client/src/client/channel-sidebar-icon.tsx","../../client/src/client/ds/tokens.stylex.ts","../../client/src/client/ds/empty-state.tsx","../../client/src/client/mounted-resource.ts","../../client/src/client/remote-viewer/tokens.ts","../../client/src/client/remote-viewer/viewer-state.ts","../../client/src/client/remote-viewer/frame-liveness.ts","../../client/src/client/remote-viewer/index.tsx","../src/client/viewer-events.ts","../src/client/locale.ts","../../client/src/client/ds/tooltip.tsx","../../client/src/client/sidebar-card.tsx","../src/settings.ts","../src/client/mounted-resource.ts","../../client/src/client/ds/note.tsx","../../client/src/client/ds/pill-button.tsx","../../client/src/client/appearance-scope.ts","../../client/src/client/appearance-primitives.tsx","../../client/src/client/ds/pointer-menu.tsx","../../client/src/client/ds/select.tsx","../../client/src/client/ds/settings-row.tsx","../src/client/local-setup-copy.ts","../../client/src/client/missing-packages.tsx","../src/client/local-computer.tsx","../src/client/settings-rows.tsx","../../client/src/client/telemetry-surface.ts","../src/client/access-power-icon.tsx","../../client/src/client/ds/stylex-css.ts","../src/client/index.tsx"],"sourcesContent":["var styleq = {};\n\nvar hasRequiredStyleq;\n\nfunction requireStyleq () {\n\tif (hasRequiredStyleq) return styleq;\n\thasRequiredStyleq = 1;\n\n\tObject.defineProperty(styleq, \"__esModule\", {\n\t value: true\n\t});\n\tstyleq.styleq = void 0;\n\tvar cache = new WeakMap();\n\tvar compiledKey = '$$css';\n\tfunction createStyleq(options) {\n\t var disableCache;\n\t var disableMix;\n\t var transform;\n\t if (options != null) {\n\t disableCache = options.disableCache === true;\n\t disableMix = options.disableMix === true;\n\t transform = options.transform;\n\t }\n\t return function styleq() {\n\t var definedProperties = [];\n\t var className = '';\n\t var inlineStyle = null;\n\t var debugString = '';\n\t var nextCache = disableCache ? null : cache;\n\t var styles = new Array(arguments.length);\n\t for (var i = 0; i < arguments.length; i++) {\n\t styles[i] = arguments[i];\n\t }\n\t while (styles.length > 0) {\n\t var possibleStyle = styles.pop();\n\t if (possibleStyle == null || possibleStyle === false) {\n\t continue;\n\t }\n\t if (Array.isArray(possibleStyle)) {\n\t for (var _i = 0; _i < possibleStyle.length; _i++) {\n\t styles.push(possibleStyle[_i]);\n\t }\n\t continue;\n\t }\n\t var style = transform != null ? transform(possibleStyle) : possibleStyle;\n\t if (style.$$css != null) {\n\t var classNameChunk = '';\n\t if (nextCache != null && nextCache.has(style)) {\n\t var cacheEntry = nextCache.get(style);\n\t if (cacheEntry != null) {\n\t classNameChunk = cacheEntry[0];\n\t debugString = cacheEntry[2];\n\t definedProperties.push.apply(definedProperties, cacheEntry[1]);\n\t nextCache = cacheEntry[3];\n\t }\n\t } else {\n\t var definedPropertiesChunk = [];\n\t for (var prop in style) {\n\t var value = style[prop];\n\t if (prop === compiledKey) {\n\t var compiledKeyValue = style[prop];\n\t if (compiledKeyValue !== true) {\n\t debugString = debugString ? compiledKeyValue + '; ' + debugString : compiledKeyValue;\n\t }\n\t continue;\n\t }\n\t if (typeof value === 'string' || value === null) {\n\t if (!definedProperties.includes(prop)) {\n\t definedProperties.push(prop);\n\t if (nextCache != null) {\n\t definedPropertiesChunk.push(prop);\n\t }\n\t if (typeof value === 'string') {\n\t classNameChunk += classNameChunk ? ' ' + value : value;\n\t }\n\t }\n\t } else {\n\t console.error(\"styleq: \".concat(prop, \" typeof \").concat(String(value), \" is not \\\"string\\\" or \\\"null\\\".\"));\n\t }\n\t }\n\t if (nextCache != null) {\n\t var weakMap = new WeakMap();\n\t nextCache.set(style, [classNameChunk, definedPropertiesChunk, debugString, weakMap]);\n\t nextCache = weakMap;\n\t }\n\t }\n\t if (classNameChunk) {\n\t className = className ? classNameChunk + ' ' + className : classNameChunk;\n\t }\n\t } else {\n\t if (disableMix) {\n\t if (inlineStyle == null) {\n\t inlineStyle = {};\n\t }\n\t inlineStyle = Object.assign({}, style, inlineStyle);\n\t } else {\n\t var subStyle = null;\n\t for (var _prop in style) {\n\t var _value = style[_prop];\n\t if (_value !== undefined) {\n\t if (!definedProperties.includes(_prop)) {\n\t if (_value != null) {\n\t if (inlineStyle == null) {\n\t inlineStyle = {};\n\t }\n\t if (subStyle == null) {\n\t subStyle = {};\n\t }\n\t subStyle[_prop] = _value;\n\t }\n\t definedProperties.push(_prop);\n\t nextCache = null;\n\t }\n\t }\n\t }\n\t if (subStyle != null) {\n\t inlineStyle = Object.assign(subStyle, inlineStyle);\n\t }\n\t }\n\t }\n\t }\n\t var styleProps = [className, inlineStyle, debugString];\n\t return styleProps;\n\t };\n\t}\n\tvar styleq$1 = styleq.styleq = createStyleq();\n\tstyleq$1.factory = createStyleq;\n\treturn styleq;\n}\n\nvar styleqExports = /*@__PURE__*/ requireStyleq();\n\nconst errorForFn = name => new Error(`Unexpected 'stylex.${name}' call at runtime. Styles must be compiled by '@stylexjs/babel-plugin'.`);\nconst errorForType = key => errorForFn(`types.${key}`);\nconst create = function stylexCreate(_styles) {\n throw errorForFn('create');\n};\nconst createTheme = (_baseTokens, _overrides) => {\n throw errorForFn('createTheme');\n};\nconst defineConsts = function stylexDefineConsts(_styles) {\n throw errorForFn('defineConsts');\n};\nconst defineVars = function stylexDefineVars(_styles) {\n throw errorForFn('defineVars');\n};\nconst unstable_conditional = function stylexConditional(_value) {\n throw errorForFn('unstable_conditional');\n};\nconst unstable_defineVarsNested = function stylexDefineVarsNested(_styles) {\n throw errorForFn('unstable_defineVarsNested');\n};\nconst unstable_defineConstsNested = function stylexDefineConstsNested(_styles) {\n throw errorForFn('unstable_defineConstsNested');\n};\nconst unstable_createThemeNested = (_baseTokens, _overrides) => {\n throw errorForFn('unstable_createThemeNested');\n};\nconst defineMarker = () => {\n throw errorForFn('defineMarker');\n};\nconst firstThatWorks = (..._styles) => {\n throw errorForFn('firstThatWorks');\n};\nconst keyframes = _keyframes => {\n throw errorForFn('keyframes');\n};\nconst positionTry = _positionTry => {\n throw errorForFn('positionTry');\n};\nfunction props(...styles) {\n const [className, style, dataStyleSrc] = styleqExports.styleq(styles);\n const result = {};\n if (className != null && className !== '') {\n result.className = className;\n }\n if (style != null && Object.keys(style).length > 0) {\n result.style = style;\n }\n if (dataStyleSrc != null && dataStyleSrc !== '') {\n result['data-style-src'] = dataStyleSrc;\n }\n return result;\n}\nconst toKebabCase = str => str.replace(/([A-Z])/g, '-$1').toLowerCase();\nfunction attrs(...styles) {\n const {\n className,\n style,\n 'data-style-src': dataStyleSrc\n } = props.apply(this, styles);\n const result = {};\n if (className != null) {\n result.class = className;\n }\n if (style != null) {\n result.style = Object.entries(style).map(([key, value]) => `${toKebabCase(key)}:${value}`).join(';');\n }\n if (dataStyleSrc != null) {\n result['data-style-src'] = dataStyleSrc;\n }\n return result;\n}\nconst viewTransitionClass = _viewTransitionClass => {\n throw errorForFn('viewTransitionClass');\n};\nconst defaultMarker = () => {\n throw errorForFn('defaultMarker');\n};\nconst when = {\n ancestor: _p => {\n throw errorForFn('when.ancestor');\n },\n descendant: _p => {\n throw errorForFn('when.descendant');\n },\n siblingBefore: _p => {\n throw errorForFn('when.siblingBefore');\n },\n siblingAfter: _p => {\n throw errorForFn('when.siblingAfter');\n },\n anySibling: _p => {\n throw errorForFn('when.anySibling');\n }\n};\nconst env = Object.freeze({});\nconst types = {\n angle: _v => {\n throw errorForType('angle');\n },\n color: _v => {\n throw errorForType('color');\n },\n url: _v => {\n throw errorForType('url');\n },\n image: _v => {\n throw errorForType('image');\n },\n integer: _v => {\n throw errorForType('integer');\n },\n lengthPercentage: _v => {\n throw errorForType('lengthPercentage');\n },\n length: _v => {\n throw errorForType('length');\n },\n percentage: _v => {\n throw errorForType('percentage');\n },\n number: _v => {\n throw errorForType('number');\n },\n resolution: _v => {\n throw errorForType('resolution');\n },\n time: _v => {\n throw errorForType('time');\n },\n transformFunction: _v => {\n throw errorForType('transformFunction');\n },\n transformList: _v => {\n throw errorForType('transformList');\n }\n};\nconst legacyMerge = /*@__PURE__*/ function () {\n function _legacyMerge(...styles) {\n const [className] = styleqExports.styleq(styles);\n return className;\n }\n _legacyMerge.create = create;\n _legacyMerge.createTheme = createTheme;\n _legacyMerge.defineConsts = defineConsts;\n _legacyMerge.defineMarker = defineMarker;\n _legacyMerge.defineVars = defineVars;\n _legacyMerge.defaultMarker = defaultMarker;\n _legacyMerge.firstThatWorks = firstThatWorks;\n _legacyMerge.keyframes = keyframes;\n _legacyMerge.positionTry = positionTry;\n _legacyMerge.props = props;\n _legacyMerge.attrs = attrs;\n _legacyMerge.types = types;\n _legacyMerge.when = when;\n _legacyMerge.viewTransitionClass = viewTransitionClass;\n _legacyMerge.env = env;\n _legacyMerge.unstable_conditional = unstable_conditional;\n _legacyMerge.unstable_defineVarsNested = unstable_defineVarsNested;\n _legacyMerge.unstable_defineConstsNested = unstable_defineConstsNested;\n _legacyMerge.unstable_createThemeNested = unstable_createThemeNested;\n return _legacyMerge;\n}();\n\nexport { attrs, create, createTheme, defaultMarker, defineConsts, defineMarker, defineVars, env, firstThatWorks, keyframes, legacyMerge, positionTry, props, types, unstable_conditional, unstable_createThemeNested, unstable_defineConstsNested, unstable_defineVarsNested, viewTransitionClass, when };\n","/**\n * Vendored Channel sidebar glyphs from lucide-react@1.46.0 (ISC, ADR-0032).\n *\n * Source: the matching lucide `dist/esm/icons/*.mjs` glyph data. Vendored at the\n * stock 2-unit stroke without adding a `lucide-react` runtime dependency.\n *\n * ISC License\n *\n * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT).\n * All other copyright (c) for Lucide are held by Lucide Contributors 2022.\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\nimport { createElement, type ReactElement } from 'react';\n\nconst glyphs: Record][]> = {\n image: [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2', ry: '2' }],\n ['circle', { cx: '9', cy: '9', r: '2' }],\n ['path', { d: 'm21 15-4-4L7 21' }],\n ],\n 'arrow-left': [\n ['path', { d: 'm12 19-7-7 7-7' }],\n ['path', { d: 'M19 12H5' }],\n ],\n 'chevron-right': [['path', { d: 'm9 18 6-6-6-6' }]],\n store: [\n ['path', { d: 'M15 21v-5a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v5' }],\n [\n 'path',\n {\n d: 'M17.774 10.31a1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.451 0 1.12 1.12 0 0 0-1.548 0 2.5 2.5 0 0 1-3.452 0 1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.77-3.248l2.889-4.184A2 2 0 0 1 7 2h10a2 2 0 0 1 1.653.873l2.895 4.192a2.5 2.5 0 0 1-3.774 3.244',\n },\n ],\n ['path', { d: 'M4 10.95V19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8.05' }],\n ],\n house: [['path', { d: 'm3 10 9-7 9 7v10a1 1 0 0 1-1 1h-5v-7H9v7H4a1 1 0 0 1-1-1z' }]],\n search: [\n ['path', { d: 'm21 21-4.34-4.34' }],\n ['circle', { cx: '11', cy: '11', r: '8' }],\n ],\n hash: [\n ['line', { x1: '4', x2: '20', y1: '9', y2: '9' }],\n ['line', { x1: '4', x2: '20', y1: '15', y2: '15' }],\n ['line', { x1: '10', x2: '8', y1: '3', y2: '21' }],\n ['line', { x1: '16', x2: '14', y1: '3', y2: '21' }],\n ],\n 'messages-circle': [\n [\n 'path',\n {\n d: 'M19.95 10.05a7 7 0 011.412 7.872 1 1 0 00-.058.787l.675 2.089a1 1 0 01-1.236 1.168l-2.155-.631a1 1 0 00-.745.06 7 7 0 01-7.793-1.445',\n },\n ],\n [\n 'path',\n {\n d: 'M2.696 12.708a1 1 0 00-.058-.785 7 7 0 113.518 3.473 1 1 0 00-.744-.061l-2.155.63a1 1 0 01-1.236-1.167z',\n },\n ],\n ],\n 'text-quote': [\n ['path', { d: 'M17 5H3' }],\n ['path', { d: 'M21 12H8' }],\n ['path', { d: 'M21 19H8' }],\n ['path', { d: 'M3 12v7' }],\n ],\n brain: [\n ['path', { d: 'M12 18V5' }],\n ['path', { d: 'M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4' }],\n ['path', { d: 'M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5' }],\n ['path', { d: 'M17.997 5.125a4 4 0 0 1 2.526 5.77' }],\n ['path', { d: 'M18 18a4 4 0 0 0 2-7.464' }],\n ['path', { d: 'M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517' }],\n ['path', { d: 'M6 18a4 4 0 0 1-2-7.464' }],\n ['path', { d: 'M6.003 5.125a4 4 0 0 0-2.526 5.77' }],\n ],\n file: [\n [\n 'path',\n {\n d: 'M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z',\n },\n ],\n ['path', { d: 'M14 2v5a1 1 0 0 0 1 1h5' }],\n ],\n terminal: [\n ['path', { d: 'M12 19h8' }],\n ['path', { d: 'm4 17 6-6-6-6' }],\n ],\n archive: [\n ['rect', { width: '20', height: '5', x: '2', y: '3', rx: '1' }],\n ['path', { d: 'M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8' }],\n ['path', { d: 'M10 12h4' }],\n ],\n 'archive-restore': [\n ['rect', { width: '20', height: '5', x: '2', y: '3', rx: '1' }],\n ['path', { d: 'M4 8v11a2 2 0 0 0 2 2h2' }],\n ['path', { d: 'M20 8v11a2 2 0 0 1-2 2h-2' }],\n ['path', { d: 'm9 15 3-3 3 3' }],\n ['path', { d: 'M12 12v9' }],\n ],\n 'alarm-clock': [\n ['circle', { cx: '12', cy: '13', r: '8' }],\n ['path', { d: 'M12 9v4l2 2' }],\n ['path', { d: 'M5 3 2 6' }],\n ['path', { d: 'm22 6-3-3' }],\n ['path', { d: 'M6.38 18.7 4 21' }],\n ['path', { d: 'M17.64 18.67 20 21' }],\n ],\n 'bell-ring': [\n ['path', { d: 'M10.268 21a2 2 0 0 0 3.464 0' }],\n ['path', { d: 'M22 8c0-2.3-.8-4.3-2-6' }],\n [\n 'path',\n {\n d: 'M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326',\n },\n ],\n ['path', { d: 'M4 2C2.8 3.7 2 5.7 2 8' }],\n ],\n bell: [\n ['path', { d: 'M10.268 21a2 2 0 0 0 3.464 0' }],\n [\n 'path',\n {\n d: 'M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326',\n },\n ],\n ],\n 'bell-off': [\n ['path', { d: 'M10.268 21a2 2 0 0 0 3.464 0' }],\n [\n 'path',\n {\n d: 'M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742',\n },\n ],\n ['path', { d: 'm2 2 20 20' }],\n ['path', { d: 'M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05' }],\n ],\n cpu: [\n ['path', { d: 'M12 20v2' }],\n ['path', { d: 'M12 2v2' }],\n ['path', { d: 'M17 20v2' }],\n ['path', { d: 'M17 2v2' }],\n ['path', { d: 'M2 12h2' }],\n ['path', { d: 'M2 17h2' }],\n ['path', { d: 'M2 7h2' }],\n ['path', { d: 'M20 12h2' }],\n ['path', { d: 'M20 17h2' }],\n ['path', { d: 'M20 7h2' }],\n ['path', { d: 'M7 20v2' }],\n ['path', { d: 'M7 2v2' }],\n ['rect', { x: '4', y: '4', width: '16', height: '16', rx: '2' }],\n ['rect', { x: '8', y: '8', width: '8', height: '8', rx: '1' }],\n ],\n 'id-card': [\n ['path', { d: 'M13 19a4 4 0 00-8 0' }],\n ['path', { d: 'M16 10h2' }],\n ['path', { d: 'M16 14h2' }],\n ['circle', { cx: '9', cy: '12', r: '3' }],\n ['rect', { x: '2', y: '5', width: '20', height: '14', rx: '2' }],\n ],\n plug: [\n ['path', { d: 'M12 22v-5' }],\n ['path', { d: 'M15 8V2' }],\n [\n 'path',\n {\n d: 'M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z',\n },\n ],\n ['path', { d: 'M9 8V2' }],\n ],\n ruler: [\n [\n 'path',\n {\n d: 'M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z',\n },\n ],\n ['path', { d: 'm14.5 12.5 2-2' }],\n ['path', { d: 'm11.5 9.5 2-2' }],\n ['path', { d: 'm8.5 6.5 2-2' }],\n ['path', { d: 'm17.5 15.5 2-2' }],\n ],\n compass: [\n ['circle', { cx: '12', cy: '12', r: '10' }],\n [\n 'path',\n {\n d: 'm16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z',\n },\n ],\n ],\n gauge: [\n ['path', { d: 'm12 14 4-4' }],\n ['path', { d: 'M3.34 19a10 10 0 1 1 17.32 0' }],\n ],\n 'user-check': [\n ['path', { d: 'm16 11 2 2 4-4' }],\n ['path', { d: 'M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2' }],\n ['circle', { cx: '9', cy: '7', r: '4' }],\n ],\n 'shield-check': [\n [\n 'path',\n {\n d: 'M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z',\n },\n ],\n ['path', { d: 'm9 12 2 2 4-4' }],\n ],\n upload: [\n ['path', { d: 'M12 3v12' }],\n ['path', { d: 'm17 8-5-5-5 5' }],\n ['path', { d: 'M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4' }],\n ],\n package: [\n [\n 'path',\n {\n d: 'M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z',\n },\n ],\n ['path', { d: 'M12 22V12' }],\n ['path', { d: 'M3.29 7 12 12l8.71-5' }],\n ['path', { d: 'm7.5 4.27 9 5.15' }],\n ],\n plus: [\n ['path', { d: 'M5 12h14' }],\n ['path', { d: 'M12 5v14' }],\n ],\n user: [\n ['path', { d: 'M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2' }],\n ['circle', { cx: '12', cy: '7', r: '4' }],\n ],\n bot: [\n ['path', { d: 'M12 8V4H8' }],\n ['rect', { width: '16', height: '12', x: '4', y: '8', rx: '2' }],\n ['path', { d: 'M2 14h2' }],\n ['path', { d: 'M20 14h2' }],\n ['path', { d: 'M15 13v2' }],\n ['path', { d: 'M9 13v2' }],\n ],\n 'list-checks': [\n ['path', { d: 'M13 5h8' }],\n ['path', { d: 'M13 12h8' }],\n ['path', { d: 'M13 19h8' }],\n ['path', { d: 'm3 17 2 2 4-4' }],\n ['path', { d: 'm3 7 2 2 4-4' }],\n ],\n palette: [\n [\n 'path',\n {\n d: 'M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z',\n },\n ],\n ['circle', { cx: '13.5', cy: '6.5', r: '.5', fill: 'currentColor' }],\n ['circle', { cx: '17.5', cy: '10.5', r: '.5', fill: 'currentColor' }],\n ['circle', { cx: '6.5', cy: '12.5', r: '.5', fill: 'currentColor' }],\n ['circle', { cx: '8.5', cy: '7.5', r: '.5', fill: 'currentColor' }],\n ],\n 'image-up': [\n [\n 'path',\n {\n d: 'M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21',\n },\n ],\n ['path', { d: 'm14 19.5 3-3 3 3' }],\n ['path', { d: 'M17 22v-5.5' }],\n ['circle', { cx: '9', cy: '9', r: '2' }],\n ],\n lock: [\n ['rect', { width: '18', height: '11', x: '3', y: '11', rx: '2', ry: '2' }],\n ['path', { d: 'M7 11V7a5 5 0 0 1 10 0v4' }],\n ],\n play: [\n [\n 'path',\n {\n d: 'M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z',\n },\n ],\n ],\n 'lock-open': [\n ['rect', { width: '18', height: '11', x: '3', y: '11', rx: '2', ry: '2' }],\n ['path', { d: 'M7 11V7a5 5 0 0 1 9.9-1' }],\n ],\n eye: [\n [\n 'path',\n {\n d: 'M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0',\n },\n ],\n ['circle', { cx: '12', cy: '12', r: '3' }],\n ],\n 'eye-off': [\n [\n 'path',\n {\n d: 'M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49',\n },\n ],\n ['path', { d: 'M14.084 14.158a3 3 0 0 1-4.242-4.242' }],\n [\n 'path',\n {\n d: 'M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143',\n },\n ],\n ['path', { d: 'm2 2 20 20' }],\n ],\n files: [\n [\n 'path',\n {\n d: 'M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8',\n },\n ],\n [\n 'path',\n {\n d: 'M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z',\n },\n ],\n [\n 'path',\n {\n d: 'M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1',\n },\n ],\n ],\n 'git-branch': [\n [\n 'path',\n {\n d: 'M15 6a9 9 0 0 0-9 9V3',\n },\n ],\n [\n 'circle',\n {\n cx: '18',\n cy: '6',\n r: '3',\n },\n ],\n [\n 'circle',\n {\n cx: '6',\n cy: '18',\n r: '3',\n },\n ],\n ],\n 'messages-square': [\n [\n 'path',\n {\n d: 'M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z',\n },\n ],\n [\n 'path',\n {\n d: 'M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1',\n },\n ],\n ],\n inbox: [\n [\n 'polyline',\n {\n points: '22 12 16 12 14 15 10 15 8 12 2 12',\n },\n ],\n [\n 'path',\n {\n d: 'M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z',\n },\n ],\n ],\n 'folder-key': [\n [\n 'path',\n {\n d: 'M13 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v1.36',\n },\n ],\n [\n 'path',\n {\n d: 'M19 12v6',\n },\n ],\n [\n 'path',\n {\n d: 'M19 14h2',\n },\n ],\n [\n 'circle',\n {\n cx: '19',\n cy: '20',\n r: '2',\n },\n ],\n ],\n users: [\n [\n 'path',\n {\n d: 'M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2',\n },\n ],\n [\n 'path',\n {\n d: 'M16 3.128a4 4 0 0 1 0 7.744',\n },\n ],\n [\n 'path',\n {\n d: 'M22 21v-2a4 4 0 0 0-3-3.87',\n },\n ],\n [\n 'circle',\n {\n cx: '9',\n cy: '7',\n r: '4',\n },\n ],\n ],\n 'settings-2': [\n [\n 'path',\n {\n d: 'M14 17H5',\n },\n ],\n [\n 'path',\n {\n d: 'M19 7h-9',\n },\n ],\n [\n 'circle',\n {\n cx: '17',\n cy: '17',\n r: '3',\n },\n ],\n [\n 'circle',\n {\n cx: '7',\n cy: '7',\n r: '3',\n },\n ],\n ],\n settings: [\n [\n 'path',\n {\n d: 'M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915',\n },\n ],\n [\n 'circle',\n {\n cx: '12',\n cy: '12',\n r: '3',\n },\n ],\n ],\n monitor: [\n [\n 'rect',\n {\n width: '20',\n height: '14',\n x: '2',\n y: '3',\n rx: '2',\n },\n ],\n [\n 'line',\n {\n x1: '8',\n x2: '16',\n y1: '21',\n y2: '21',\n },\n ],\n [\n 'line',\n {\n x1: '12',\n x2: '12',\n y1: '17',\n y2: '21',\n },\n ],\n ],\n globe: [\n [\n 'circle',\n {\n cx: '12',\n cy: '12',\n r: '10',\n },\n ],\n [\n 'path',\n {\n d: 'M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20',\n },\n ],\n [\n 'path',\n {\n d: 'M2 12h20',\n },\n ],\n ],\n 'panel-right': [\n [\n 'rect',\n {\n width: '18',\n height: '18',\n x: '3',\n y: '3',\n rx: '2',\n },\n ],\n [\n 'path',\n {\n d: 'M15 3v18',\n },\n ],\n ],\n 'panels-top-left': [\n [\n 'rect',\n {\n width: '18',\n height: '18',\n x: '3',\n y: '3',\n rx: '2',\n },\n ],\n [\n 'path',\n {\n d: 'M3 9h18',\n },\n ],\n [\n 'path',\n {\n d: 'M9 21V9',\n },\n ],\n ],\n 'grip-vertical': [\n ['circle', { cx: '9', cy: '12', r: '1' }],\n ['circle', { cx: '9', cy: '5', r: '1' }],\n ['circle', { cx: '9', cy: '19', r: '1' }],\n ['circle', { cx: '15', cy: '12', r: '1' }],\n ['circle', { cx: '15', cy: '5', r: '1' }],\n ['circle', { cx: '15', cy: '19', r: '1' }],\n ],\n star: [\n [\n 'path',\n {\n d: 'M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z',\n },\n ],\n ],\n copy: [\n ['rect', { width: '14', height: '14', x: '8', y: '8', rx: '2', ry: '2' }],\n ['path', { d: 'M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2' }],\n ],\n 'external-link': [\n ['path', { d: 'M15 3h6v6' }],\n ['path', { d: 'M10 14 21 3' }],\n ['path', { d: 'M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6' }],\n ],\n sun: [\n ['circle', { cx: '12', cy: '12', r: '4' }],\n ['path', { d: 'M12 2v2' }],\n ['path', { d: 'M12 20v2' }],\n ['path', { d: 'm4.93 4.93 1.41 1.41' }],\n ['path', { d: 'm17.66 17.66 1.41 1.41' }],\n ['path', { d: 'M2 12h2' }],\n ['path', { d: 'M20 12h2' }],\n ['path', { d: 'm6.34 17.66-1.41 1.41' }],\n ['path', { d: 'm19.07 4.93-1.41 1.41' }],\n ],\n moon: [\n [\n 'path',\n {\n d: 'M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401',\n },\n ],\n ],\n crop: [\n ['path', { d: 'M6 2v14a2 2 0 0 0 2 2h14' }],\n ['path', { d: 'M18 22V8a2 2 0 0 0-2-2H2' }],\n ],\n ban: [\n ['circle', { cx: '12', cy: '12', r: '10' }],\n ['path', { d: 'M4.929 4.929 19.07 19.071' }],\n ],\n x: [\n ['path', { d: 'M18 6 6 18' }],\n ['path', { d: 'm6 6 12 12' }],\n ],\n 'message-square': [\n [\n 'path',\n {\n d: 'M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z',\n },\n ],\n ],\n keyboard: [\n ['path', { d: 'M10 8h.01' }],\n ['path', { d: 'M12 12h.01' }],\n ['path', { d: 'M14 8h.01' }],\n ['path', { d: 'M16 12h.01' }],\n ['path', { d: 'M18 8h.01' }],\n ['path', { d: 'M6 8h.01' }],\n ['path', { d: 'M7 16h10' }],\n ['path', { d: 'M8 12h.01' }],\n ['rect', { width: '20', height: '16', x: '2', y: '4', rx: '2' }],\n ],\n smartphone: [\n ['rect', { width: '14', height: '20', x: '5', y: '2', rx: '2', ry: '2' }],\n ['path', { d: 'M12 18h.01' }],\n ],\n 'sliders-horizontal': [\n ['path', { d: 'M10 5H3' }],\n ['path', { d: 'M12 19H3' }],\n ['path', { d: 'M14 3v4' }],\n ['path', { d: 'M16 17v4' }],\n ['path', { d: 'M21 12h-9' }],\n ['path', { d: 'M21 19h-5' }],\n ['path', { d: 'M21 5h-7' }],\n ['path', { d: 'M8 10v4' }],\n ['path', { d: 'M8 12H3' }],\n ],\n info: [\n ['circle', { cx: '12', cy: '12', r: '10' }],\n ['path', { d: 'M12 16v-4' }],\n ['path', { d: 'M12 8h.01' }],\n ],\n puzzle: [\n [\n 'path',\n {\n d: 'M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z',\n },\n ],\n ],\n check: [\n [\n 'path',\n {\n d: 'M20 6 9 17l-5-5',\n },\n ],\n ],\n laptop: [\n [\n 'path',\n {\n d: 'M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z',\n },\n ],\n ['path', { d: 'M20.054 15.987H3.946' }],\n ],\n server: [\n ['rect', { width: '20', height: '8', x: '2', y: '2', rx: '2', ry: '2' }],\n ['rect', { width: '20', height: '8', x: '2', y: '14', rx: '2', ry: '2' }],\n ['line', { x1: '6', x2: '6.01', y1: '6', y2: '6' }],\n ['line', { x1: '6', x2: '6.01', y1: '18', y2: '18' }],\n ],\n building: [\n ['path', { d: 'M12 10h.01' }],\n ['path', { d: 'M12 14h.01' }],\n ['path', { d: 'M12 6h.01' }],\n ['path', { d: 'M16 10h.01' }],\n ['path', { d: 'M16 14h.01' }],\n ['path', { d: 'M16 6h.01' }],\n ['path', { d: 'M8 10h.01' }],\n ['path', { d: 'M8 14h.01' }],\n ['path', { d: 'M8 6h.01' }],\n ['path', { d: 'M9 22v-3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3' }],\n ['rect', { x: '4', y: '2', width: '16', height: '20', rx: '2' }],\n ],\n briefcase: [\n ['path', { d: 'M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16' }],\n ['rect', { width: '20', height: '14', x: '2', y: '6', rx: '2' }],\n ],\n 'flask-conical': [\n [\n 'path',\n {\n d: 'M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2',\n },\n ],\n ['path', { d: 'M6.453 15h11.094' }],\n ['path', { d: 'M8.5 2h7' }],\n ],\n 'gamepad-2': [\n ['line', { x1: '6', x2: '10', y1: '11', y2: '11' }],\n ['line', { x1: '8', x2: '8', y1: '9', y2: '13' }],\n ['line', { x1: '15', x2: '15.01', y1: '12', y2: '12' }],\n ['line', { x1: '18', x2: '18.01', y1: '10', y2: '10' }],\n [\n 'path',\n {\n d: 'M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z',\n },\n ],\n ],\n paintbrush: [\n ['path', { d: 'm14.622 17.897-10.68-2.913' }],\n [\n 'path',\n {\n d: 'M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z',\n },\n ],\n [\n 'path',\n {\n d: 'M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15',\n },\n ],\n ],\n 'audio-lines': [\n ['path', { d: 'M2 10v3' }],\n ['path', { d: 'M6 6v11' }],\n ['path', { d: 'M10 3v18' }],\n ['path', { d: 'M14 8v7' }],\n ['path', { d: 'M18 5v13' }],\n ['path', { d: 'M22 10v3' }],\n ],\n 'book-open': [\n ['path', { d: 'M12 5v16' }],\n [\n 'path',\n {\n d: 'M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z',\n },\n ],\n ],\n zap: [\n [\n 'path',\n {\n d: 'M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z',\n },\n ],\n ],\n heart: [\n [\n 'path',\n {\n d: 'M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5',\n },\n ],\n ],\n leaf: [\n [\n 'path',\n {\n d: 'M11 20a10 10 0 0010-10 25.9 25.9 0 00-1.04-7.281 1 1 0 00-1.755-.325C15.833 5.5 13 5.5 9.8 6.1A7 7 0 0011 20',\n },\n ],\n ['path', { d: 'M2 21a5 5 0 012.911-4.544C7.613 15.212 8.351 15.24 11 13' }],\n ],\n phone: [\n [\n 'path',\n {\n d: 'M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384',\n },\n ],\n ],\n video: [\n ['path', { d: 'm16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5' }],\n ['rect', { x: '2', y: '6', width: '14', height: '12', rx: '2' }],\n ],\n 'video-off': [\n ['path', { d: 'M10.66 6H14a2 2 0 0 1 2 2v2.5l5.248-3.062A.5.5 0 0 1 22 7.87v8.196' }],\n ['path', { d: 'M16 16a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2' }],\n ['path', { d: 'm2 2 20 20' }],\n ],\n 'phone-off': [\n [\n 'path',\n {\n d: 'M10.1 13.9a14 14 0 0 0 3.732 2.668 1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2 18 18 0 0 1-12.728-5.272',\n },\n ],\n ['path', { d: 'M22 2 2 22' }],\n [\n 'path',\n {\n d: 'M4.76 13.582A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 .244.473',\n },\n ],\n ],\n mic: [\n ['path', { d: 'M12 19v3' }],\n ['path', { d: 'M19 10v2a7 7 0 0 1-14 0v-2' }],\n ['rect', { x: '9', y: '2', width: '6', height: '13', rx: '3' }],\n ],\n 'mic-off': [\n ['path', { d: 'M12 19v3' }],\n ['path', { d: 'M15 9.34V5a3 3 0 0 0-5.68-1.33' }],\n ['path', { d: 'M16.95 16.95A7 7 0 0 1 5 12v-2' }],\n ['path', { d: 'M18.89 13.23A7 7 0 0 0 19 12v-2' }],\n ['path', { d: 'm2 2 20 20' }],\n ['path', { d: 'M9 9v3a3 3 0 0 0 5.12 2.12' }],\n ],\n tv: [\n ['path', { d: 'm17 2-5 5-5-5' }],\n ['rect', { width: '20', height: '15', x: '2', y: '7', rx: '2' }],\n ],\n};\n\nexport function ChannelSidebarIcon({\n name = 'panels-top-left',\n size = 16,\n}: {\n name?: string | undefined;\n size?: number | string;\n}): ReactElement {\n const nodes = Object.hasOwn(glyphs, name) ? glyphs[name]! : glyphs['panels-top-left']!;\n return (\n \n {nodes.map(([tag, attributes], index) => createElement(tag, { ...attributes, key: index }))}\n \n );\n}\n","import * as stylex from '@stylexjs/stylex';\n\nexport const space = stylex.defineConsts({\n x1: '2px',\n x2: '4px',\n x3: '8px',\n x4: '12px',\n x5: '16px',\n x6: '24px',\n});\n\nexport const text = stylex.defineConsts({\n metaSize: '12px',\n metaLine: '16px',\n bodySize: '13px',\n bodyLine: '20px',\n titleSize: '14px',\n titleLine: '20px',\n regular: '400',\n strong: '500',\n});\n\nexport const radius = stylex.defineConsts({\n xs: 'var(--dsw-radius-xs, 4px)',\n sm: 'var(--dsw-radius-sm, 8px)',\n md: 'var(--dsw-radius-md, 12px)',\n lg: 'var(--dsw-radius-lg, 16px)',\n panel: 'var(--dsw-radius-panel)',\n round: '50%',\n});\n\nexport const border = stylex.defineConsts({\n hairline: '1px',\n focus: 'var(--dsw-focus-ring-width, 2px)',\n});\n\nexport const size = stylex.defineConsts({\n inlineIcon: '26px',\n icon: '28px',\n row: '32px',\n nav: '40px',\n});\n\nexport const dialog = stylex.defineConsts({\n small: 'min(440px, calc(100vw - 32px))',\n bodyMax: 'min(60vh, 520px)',\n medium: 'min(760px, calc(100vw - 32px))',\n wide: 'min(1060px, calc(100vw - 32px))',\n});\n\nexport const actionColor = stylex.defineConsts({\n secondary:\n 'color-mix(in srgb, var(--dsw-alias-label-primary) 8%, var(--dsw-alias-bg-module-platform))',\n hover:\n 'color-mix(in srgb, var(--dsw-alias-label-primary) 13%, var(--dsw-alias-bg-module-platform))',\n danger:\n 'color-mix(in srgb, var(--dsw-alias-state-error-primary) 10%, var(--dsw-alias-bg-module-platform))',\n dangerLabel:\n 'color-mix(in srgb, var(--dsw-alias-state-error-primary) 65%, var(--dsw-alias-label-primary))',\n});\n\nexport const color = stylex.defineConsts({\n fg: 'var(--dsw-alias-label-primary)',\n muted: 'var(--dsw-alias-label-secondary)',\n subtle: 'var(--dsw-alias-label-tertiary)',\n divider: 'var(--dsw-alias-border-l1)',\n border: 'var(--dsw-alias-border-l2)',\n borderStrong: 'var(--dsw-alias-border-l3)',\n hover: 'var(--dsw-alias-interactive-bg-hover)',\n selected: 'var(--dsw-alias-interactive-bg-active)',\n navSelected: 'var(--dsw-specific-sidebar-nav-item-active)',\n accent: 'var(--dsw-alias-state-business-primary)',\n accentText: 'var(--dsw-alias-link)',\n onAccent: 'var(--dsw-alias-label-primary-foreground)',\n danger: 'var(--dsw-alias-state-error-primary)',\n onDanger: 'var(--dsw-alias-label-primary-foreground)',\n dangerEdge: 'var(--dsw-alias-state-error-secondary)',\n dangerSoft: 'var(--dsw-alias-interactive-bg-hover-danger)',\n warning: 'var(--dsw-alias-state-warn-primary)',\n warningEdge: 'var(--dsw-alias-state-warn-secondary)',\n warningSoft: 'var(--dsw-alias-state-warn-tertiary)',\n success: 'var(--dsw-alias-state-success-primary)',\n surface: 'var(--dsw-alias-bg-module-platform)',\n elevated: 'var(--dsw-alias-button-elevated-fill)',\n base: 'var(--dsw-alias-bg-base)',\n modal: 'var(--dsw-alias-bg-layer-2)',\n well: 'var(--dsw-alias-bg-base)',\n accentTint: 'var(--dsw-alias-state-business-tertiary)',\n});\n","import type { ReactElement, ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\n\nimport { ChannelSidebarIcon } from '../channel-sidebar-icon.js';\nimport { border, color, radius, size, space, text } from './tokens.stylex.js';\n\nconst styles = stylex.create({\n root: {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n gap: space.x3,\n marginBlock: space.x4,\n paddingBlock: space.x6,\n paddingInline: space.x5,\n borderWidth: border.hairline,\n borderStyle: 'dashed',\n borderColor: color.border,\n borderRadius: radius.md,\n textAlign: 'center',\n },\n panel: {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n flexGrow: 1,\n gap: space.x4,\n padding: space.x5,\n boxSizing: 'border-box',\n textAlign: 'center',\n color: color.muted,\n },\n icon: { width: size.nav, height: size.nav, flexShrink: 0, color: color.subtle },\n title: {\n margin: 0,\n color: color.fg,\n fontSize: text.bodySize,\n lineHeight: text.bodyLine,\n fontWeight: text.strong,\n },\n description: {\n margin: 0,\n maxWidth: '360px',\n color: color.muted,\n fontSize: text.metaSize,\n lineHeight: text.metaLine,\n },\n});\n\nexport function EmptyState({\n title,\n description,\n action,\n status = false,\n}: {\n readonly title: ReactNode;\n readonly description?: ReactNode;\n readonly action?: ReactNode;\n readonly status?: boolean;\n}): ReactElement {\n return (\n
\n

{title}

\n {description === undefined ? null : (\n

{description}

\n )}\n {action}\n
\n );\n}\n\nexport function PanelEmptyState({\n icon,\n children,\n action,\n}: {\n readonly icon?: string | undefined;\n readonly children: ReactNode;\n readonly action?: ReactNode;\n}): ReactElement {\n return (\n
\n \n \n \n

{children}

\n {action === undefined ? null :
{action}
}\n
\n );\n}\n","import { useCallback, useRef, type DependencyList, type RefCallback } from 'react';\n\nexport function useMountedResource(\n start: (node: T) => void | (() => void),\n dependencies: DependencyList,\n): RefCallback {\n const cleanup = useRef<(() => void) | undefined>(undefined);\n return useCallback((node: T | null) => {\n cleanup.current?.();\n cleanup.current = undefined;\n if (node !== null) cleanup.current = start(node) || undefined;\n }, dependencies);\n}\n","export const BH = {\n labelSecondary: 'var(--dsw-alias-label-secondary)',\n hoverFill: 'var(--dsw-alias-interactive-bg-hover)',\n errorPrimary: 'var(--dsw-alias-state-error-primary)',\n radiusMd: 'var(--dsw-radius-md)',\n labelPrimary: 'var(--dsw-alias-label-primary, #0f1115)',\n labelPrimaryForeground: 'var(--dsw-alias-label-primary-foreground, #ffffff)',\n borderL2: 'var(--dsw-alias-border-l2, #0000001a)',\n borderL3: 'var(--dsw-alias-border-l3, #0000001f)',\n borderL4: 'var(--dsw-alias-border-l4, #00000029)',\n bgBase: 'var(--dsw-alias-bg-base, #ffffff)',\n buttonPrimaryFill: 'var(--dsw-alias-button-primary-fill, #0f1115)',\n buttonElevatedFill: 'var(--dsw-alias-button-elevated-fill, transparent)',\n businessPrimary: 'var(--dsw-alias-state-business-primary, #4176e6)',\n hoverScrim: 'color-mix(in srgb, var(--dsw-alias-bg-base) 35%, transparent)',\n} as const;\n\nexport const VIDEO_SURFACE = {\n background: '#000000',\n spinnerTrack: 'rgba(255, 255, 255, 0.18)',\n spinnerArc: '#ffffff',\n onVideo: '#ffffff',\n} as const;\n","import type { ViewerKey } from './locale.js';\n\nexport type ViewerAction = 'open' | 'collapse';\n\nexport function nextExpanded(action: ViewerAction): boolean {\n return action === 'open';\n}\n\nexport type FramePhase = 'connecting' | 'live' | 'empty';\n\nexport const PHASE_SMOOTH_AFTER = 2;\n\nexport interface SmoothedPhase {\n readonly phase: FramePhase;\n readonly streak: number;\n}\n\nexport function smoothPhase(shown: FramePhase, raw: FramePhase, streak: number): SmoothedPhase {\n if (raw === 'live') return { phase: 'live', streak: 0 };\n if (shown !== 'live') return { phase: raw, streak: 0 };\n const next = streak + 1;\n if (next >= PHASE_SMOOTH_AFTER) return { phase: raw, streak: next };\n return { phase: shown, streak: next };\n}\n\nexport function dotStateFor(phase: FramePhase): 'done' | 'ongoing' | 'error' {\n if (phase === 'live') return 'done';\n if (phase === 'empty') return 'error';\n return 'ongoing';\n}\n\nexport function statusKeyFor(phase: FramePhase, reconnecting: boolean): ViewerKey {\n if (phase === 'live') return 'entry.live';\n if (phase === 'empty') return 'entry.noScreen';\n return reconnecting ? 'entry.reconnecting' : 'entry.connecting';\n}\n\nexport function stopKey(busy: boolean, stopping: boolean): ViewerKey {\n return busy || stopping ? 'entry.stopping' : 'entry.stop';\n}\n\nconst EXIT_REPORT = /^exited code=\\d+$/;\n\nexport function isExitReport(detail: string | undefined): boolean {\n return detail !== undefined && EXIT_REPORT.test(detail);\n}\n","import type { FramePhase } from './viewer-state.js';\n\nexport const EMPTY_AFTER_MISSES = 6;\n\nexport const BUSY_EMPTY_AFTER = 30;\n\nexport const QUIET_TOLERANCE = 4;\n\nexport const QUIET_ABANDON = 120;\n\nexport const LOSS_REMOUNT_AFTER = 3;\n\nexport const MAX_AUTO_RELOAD = 3;\n\nconst STATUS_ELEMENT_ID = 'status-display';\n\nconst BUSY_TEXT = /connecting|reconnect|disconnect|failed|error/i;\n\nexport interface StreamSample {\n readonly sized: boolean;\n readonly busy: boolean;\n readonly signature?: number;\n}\n\nexport interface StreamTracker {\n readonly misses: number;\n readonly busyStreak: number;\n readonly quiet: number;\n readonly lastSignature?: number;\n readonly live?: true;\n}\n\nexport function hashBytes(data: Uint8ClampedArray): number {\n let hash = 0x81_9c_9d_c5;\n for (let index = 0; index < data.length; index += 1) {\n hash ^= data[index] ?? 0;\n hash = Math.imul(hash, 0x01_00_01_93);\n }\n return hash >>> 0;\n}\n\nexport function upstreamBusy(doc: Document | null | undefined): boolean {\n try {\n const element = doc?.getElementById(STATUS_ELEMENT_ID) as HTMLElement | null;\n if (element === null || element === undefined) return false;\n if (element.classList.contains('hidden')) return false;\n return BUSY_TEXT.test(element.textContent ?? '');\n } catch {\n return false;\n }\n}\n\nfunction signatureOf(\n doc: Document,\n surface: HTMLVideoElement | HTMLCanvasElement,\n): number | undefined {\n try {\n const scratch = doc.createElement('canvas');\n scratch.width = 16;\n scratch.height = 16;\n const context = scratch.getContext('2d', { willReadFrequently: true });\n if (context === null) return undefined;\n context.drawImage(surface, 0, 0, 16, 16);\n return hashBytes(context.getImageData(0, 0, 16, 16).data);\n } catch {\n return undefined;\n }\n}\n\nexport function sampleSurface(doc: Document | null | undefined): StreamSample {\n const busy = upstreamBusy(doc);\n let sized = false;\n let signature: number | undefined;\n try {\n const surface = doc?.getElementById('videoCanvas') as\n | HTMLVideoElement\n | HTMLCanvasElement\n | null;\n const videoWidth = (surface as { readonly videoWidth?: unknown } | null)?.videoWidth;\n const canvasWidth = (surface as { readonly width?: unknown } | null)?.width;\n const width =\n typeof videoWidth === 'number'\n ? videoWidth\n : typeof canvasWidth === 'number'\n ? canvasWidth\n : 0;\n sized = surface !== null && surface !== undefined && width > 0;\n if (sized && surface !== null && surface !== undefined && doc !== null && doc !== undefined) {\n signature = signatureOf(doc, surface);\n }\n } catch {\n signature = undefined;\n }\n return signature === undefined ? { sized, busy } : { sized, busy, signature };\n}\nfunction withSignature(\n base: { readonly misses: number; readonly busyStreak: number; readonly quiet: number },\n signature: number | undefined,\n): StreamTracker {\n return signature === undefined ? { ...base } : { ...base, lastSignature: signature };\n}\n\nfunction withPreviousSignature(\n base: { readonly misses: number; readonly busyStreak: number; readonly quiet: number },\n prev: StreamTracker,\n): StreamTracker {\n return prev.lastSignature === undefined\n ? { ...base }\n : { ...base, lastSignature: prev.lastSignature };\n}\n\nexport function shouldRemountLoss(lossStreak: number): boolean {\n return lossStreak >= LOSS_REMOUNT_AFTER;\n}\n\nexport function shouldAutoReload(phase: FramePhase, everLive: boolean, attempts: number): boolean {\n return phase === 'empty' && !everLive && attempts < MAX_AUTO_RELOAD;\n}\n\nexport function nextStreamTracker(\n prev: StreamTracker,\n sample: StreamSample,\n): { readonly tracker: StreamTracker; readonly phase: FramePhase } {\n const signature = sample.signature;\n if (!sample.sized) {\n const misses = prev.misses + 1;\n return {\n tracker: withSignature({ misses, busyStreak: 0, quiet: 0 }, signature),\n phase: misses >= EMPTY_AFTER_MISSES ? 'empty' : 'connecting',\n };\n }\n if (sample.busy) {\n const busyStreak = prev.busyStreak + 1;\n return {\n tracker: withPreviousSignature({ misses: prev.misses, busyStreak, quiet: 0 }, prev),\n phase: busyStreak >= BUSY_EMPTY_AFTER ? 'empty' : 'connecting',\n };\n }\n const changed =\n signature !== undefined && prev.lastSignature !== undefined && signature !== prev.lastSignature;\n if (changed) {\n return {\n tracker: { ...withSignature({ misses: 0, busyStreak: 0, quiet: 0 }, signature), live: true },\n phase: 'live',\n };\n }\n if (signature === undefined) {\n return { tracker: { misses: 0, busyStreak: 0, quiet: 0, live: true }, phase: 'live' };\n }\n const quiet = prev.quiet + 1;\n if (quiet >= QUIET_ABANDON) {\n return {\n tracker: withSignature({ misses: EMPTY_AFTER_MISSES, busyStreak: 0, quiet }, signature),\n phase: 'empty',\n };\n }\n if (prev.live === true || quiet >= QUIET_TOLERANCE) {\n return {\n tracker: { ...withSignature({ misses: 0, busyStreak: 0, quiet }, signature), live: true },\n phase: 'live',\n };\n }\n return {\n tracker: withSignature({ misses: prev.misses, busyStreak: 0, quiet }, signature),\n phase: 'connecting',\n };\n}\n","import {\n Fragment,\n useCallback,\n useRef,\n useState,\n type CSSProperties,\n type ReactElement,\n type ReactNode,\n type RefCallback,\n} from 'react';\nimport {\n Button,\n IconFullscreenOutlineRegular,\n Pill,\n StateDot,\n} from '@deepseek-ai/dsh-client-ui-primitives';\nimport { useMountedResource } from '../mounted-resource.js';\nimport { BH, VIDEO_SURFACE } from './tokens.js';\nimport {\n dotStateFor,\n nextExpanded,\n smoothPhase,\n statusKeyFor,\n stopKey,\n type FramePhase,\n} from './viewer-state.js';\nimport {\n LOSS_REMOUNT_AFTER,\n nextStreamTracker,\n sampleSurface,\n shouldAutoReload,\n shouldRemountLoss,\n type StreamTracker,\n} from './frame-liveness.js';\nimport type { ViewerTranslate } from './locale.js';\nexport type ViewerLifecycleEvent =\n | { readonly type: 'mount' }\n | { readonly type: 'overlay'; readonly open: boolean }\n | { readonly type: 'phase'; readonly from: FramePhase; readonly to: FramePhase }\n | { readonly type: 'auto-reload'; readonly attempt: number }\n | { readonly type: 'manual-retry' }\n | { readonly type: 'loss-remount'; readonly streak: number };\n\nexport const SPIN_STYLE = '@keyframes bc-spin { to { transform: rotate(360deg); } }';\n\nfunction useStreamPhase(onSample: (phase: FramePhase) => void): RefCallback {\n return useMountedResource(\n (iframe) => {\n let active = true;\n let tracker: StreamTracker = { misses: 0, busyStreak: 0, quiet: 0 };\n let timer: ReturnType | undefined;\n const check = (): void => {\n if (!active) return;\n let doc: Document | null = null;\n try {\n doc = iframe.contentDocument;\n } catch {\n doc = null;\n }\n const next = nextStreamTracker(tracker, sampleSurface(doc));\n tracker = next.tracker;\n onSample(next.phase);\n timer = setTimeout(check, 1000);\n };\n timer = setTimeout(check, 300);\n return () => {\n active = false;\n if (timer !== undefined) clearTimeout(timer);\n };\n },\n [onSample],\n );\n}\n\nexport function ScreenIndicator({ label = '连接中' }: { readonly label?: string }): ReactElement {\n const size = 26;\n const stroke = 2;\n const radius = (size - stroke) / 2;\n const circumference = 2 * Math.PI * radius;\n return (\n \n
\n \n \n \n \n {label}\n
\n \n );\n}\n\nfunction ScreenEmpty({\n t,\n onRetry,\n}: {\n readonly t: ViewerTranslate;\n readonly onRetry: () => void;\n}): ReactElement {\n return (\n \n
\n {t('entry.noScreen')}\n \n
\n \n );\n}\n\nexport interface StreamOverlayProps {\n readonly phase: FramePhase;\n readonly reconnecting: boolean;\n readonly hovered: boolean;\n readonly t: ViewerTranslate;\n readonly onRetry: () => void;\n readonly onOpen: () => void;\n}\n\nexport function StreamOverlay(props: StreamOverlayProps): ReactElement | null {\n const { phase, reconnecting, hovered, t, onRetry, onOpen } = props;\n if (phase === 'connecting') {\n return ;\n }\n if (phase === 'empty') {\n return ;\n }\n if (!hovered) return null;\n return (\n \n \n \n {t('entry.openFullscreen')}\n \n \n );\n}\n\ninterface ScaledFrameProps {\n readonly src: string;\n readonly title: string;\n readonly design: { width: number; height: number };\n readonly interactive: boolean;\n readonly fit?: 'width' | 'contain';\n readonly iframeRef?: RefCallback;\n}\n\nfunction ScaledFrame({\n src,\n title,\n design,\n interactive,\n fit = 'width',\n iframeRef,\n}: ScaledFrameProps): ReactElement {\n const DESIGN_WIDTH = design.width;\n const DESIGN_HEIGHT = design.height;\n const [box, setBox] = useState({ width: DESIGN_WIDTH, height: DESIGN_HEIGHT });\n const resizeResource = useMountedResource(\n (element) => {\n const frame = element.querySelector('iframe');\n if (frame !== null) {\n frame.inert = !interactive;\n if (!interactive) frame.blur();\n }\n const update = (): void =>\n setBox({ width: element.clientWidth, height: element.clientHeight });\n update();\n const observer = new ResizeObserver(update);\n observer.observe(element);\n return () => observer.disconnect();\n },\n [interactive],\n );\n\n const scale =\n fit === 'contain'\n ? Math.min(box.width / DESIGN_WIDTH, box.height / DESIGN_HEIGHT)\n : box.width / DESIGN_WIDTH;\n const offsetX = fit === 'contain' ? Math.max(0, (box.width - DESIGN_WIDTH * scale) / 2) : 0;\n const offsetY = fit === 'contain' ? Math.max(0, (box.height - DESIGN_HEIGHT * scale) / 2) : 0;\n\n return (\n \n \n \n );\n}\n\nfunction CollapseIcon(): ReactElement {\n return (\n \n \n \n \n \n \n );\n}\n\nexport interface ViewerTitleBarProps {\n readonly t: ViewerTranslate;\n readonly title: string;\n readonly phase: FramePhase;\n readonly reconnecting: boolean;\n readonly busy: boolean;\n readonly stopping: boolean;\n readonly interactive: boolean;\n readonly extraControls?: ReactNode;\n readonly onToggleInteractive: () => void;\n readonly onStop: () => void;\n readonly onCollapse: () => void;\n readonly hideStop?: boolean | undefined;\n readonly hideInteractiveToggle?: boolean | undefined;\n}\n\nfunction StopButton({\n t,\n busy,\n stopping,\n onStop,\n}: {\n readonly t: ViewerTranslate;\n readonly busy: boolean;\n readonly stopping: boolean;\n readonly onStop: () => void;\n}): ReactElement {\n return (\n \n );\n}\n\nexport function ViewerTitleBar(props: ViewerTitleBarProps): ReactElement {\n const {\n t,\n title,\n phase,\n reconnecting,\n busy,\n stopping,\n interactive,\n extraControls,\n onToggleInteractive,\n onStop,\n onCollapse,\n hideStop,\n hideInteractiveToggle,\n } = props;\n return (\n \n \n \n {title}\n \n {t(statusKeyFor(phase, reconnecting))}\n {interactive ? null : (\n {t('entry.watchOnly')}\n )}\n \n {extraControls}\n {hideInteractiveToggle ? null : (\n \n {t(interactive ? 'entry.interactive.disable' : 'entry.interactive.enable')}\n \n )}\n {hideStop === true ? null : (\n \n )}\n \n \n \n \n );\n}\n\nexport interface RemoteViewerProps {\n readonly t: ViewerTranslate;\n readonly title: string;\n readonly src: string;\n readonly design: { width: number; height: number };\n readonly busy: boolean;\n readonly stopping: boolean;\n readonly onStop: () => void;\n readonly footer?: ReactNode;\n readonly notice?: ReactNode;\n readonly extraControls?: ReactNode;\n readonly onEvent?: (event: ViewerLifecycleEvent) => void;\n readonly interactive?: boolean;\n readonly onToggleInteractive?: () => void;\n readonly onDisableInteraction?: () => void;\n readonly expanded?: boolean;\n readonly onExpandedChange?: (expanded: boolean) => void;\n readonly hideStop?: boolean | undefined;\n readonly hideInteractiveToggle?: boolean | undefined;\n readonly allowFrameInput?: boolean | undefined;\n}\n\nexport function RemoteViewer({\n t,\n title,\n src,\n design,\n busy,\n stopping,\n onStop,\n footer,\n notice,\n extraControls,\n onEvent,\n interactive,\n onToggleInteractive,\n onDisableInteraction,\n expanded: controlledExpanded,\n onExpandedChange,\n hideStop,\n hideInteractiveToggle,\n allowFrameInput,\n}: RemoteViewerProps): ReactElement {\n const entryRef = useRef(null);\n const mounted = useRef(false);\n const [hovered, setHovered] = useState(false);\n const [ownExpanded, setOwnExpanded] = useState(false);\n const expanded = controlledExpanded ?? ownExpanded;\n const setExpanded = (next: boolean): void => {\n setOwnExpanded(next);\n onExpandedChange?.(next);\n };\n const [inputEnabled, setInputEnabled] = useState(false);\n const [reloadKey, setReloadKey] = useState(0);\n const [reconnecting, setReconnecting] = useState(false);\n const wasReady = useRef(false);\n const autoReloads = useRef(0);\n const lossStreak = useRef(0);\n const phaseRef = useRef('connecting');\n\n const [smooth, setSmooth] = useState<{ phase: FramePhase; streak: number }>({\n phase: 'connecting',\n streak: 0,\n });\n const resetFrame = useCallback(() => {\n phaseRef.current = 'connecting';\n setSmooth({ phase: 'connecting', streak: 0 });\n setReloadKey((key) => key + 1);\n }, []);\n const onSample = useCallback(\n (nextPhase: FramePhase): void => {\n const fromPhase = phaseRef.current;\n if (fromPhase !== nextPhase) {\n phaseRef.current = nextPhase;\n setSmooth((current) => smoothPhase(current.phase, nextPhase, current.streak));\n onEvent?.({ type: 'phase', from: fromPhase, to: nextPhase });\n }\n if (nextPhase === 'live') {\n wasReady.current = true;\n autoReloads.current = 0;\n lossStreak.current = 0;\n setReconnecting(false);\n return;\n }\n if (wasReady.current) {\n lossStreak.current += 1;\n if (shouldRemountLoss(lossStreak.current)) {\n wasReady.current = false;\n lossStreak.current = 0;\n onEvent?.({ type: 'loss-remount', streak: LOSS_REMOUNT_AFTER });\n setReconnecting(true);\n resetFrame();\n return;\n }\n }\n if (\n fromPhase !== nextPhase &&\n shouldAutoReload(nextPhase, wasReady.current, autoReloads.current)\n ) {\n autoReloads.current += 1;\n onEvent?.({ type: 'auto-reload', attempt: autoReloads.current });\n resetFrame();\n }\n },\n [resetFrame, onEvent],\n );\n const streamRef = useStreamPhase(onSample);\n const phase = smooth.phase;\n\n const reconnect = (): void => {\n onEvent?.({ type: 'manual-retry' });\n setReconnecting(true);\n autoReloads.current = 0;\n lossStreak.current = 0;\n wasReady.current = false;\n resetFrame();\n };\n const openViewer = (): void => {\n setExpanded(nextExpanded('open'));\n onEvent?.({ type: 'overlay', open: true });\n };\n const collapseViewer = (): void => {\n setInputEnabled(false);\n onDisableInteraction?.();\n setExpanded(nextExpanded('collapse'));\n onEvent?.({ type: 'overlay', open: false });\n requestAnimationFrame(() => entryRef.current?.focus());\n };\n const dialogResource = useMountedResource(\n (dialog) => {\n if (!mounted.current) {\n mounted.current = true;\n onEvent?.({ type: 'mount' });\n }\n if (!expanded) return;\n const onKey = (event: KeyboardEvent): void => {\n if (event.key !== 'Tab') return;\n const focusable = [\n ...dialog.querySelectorAll(\n 'button, [href], iframe, [tabindex]:not([tabindex=\"-1\"])',\n ),\n ].filter((element) => element.tabIndex !== -1);\n const first = focusable[0];\n const last = focusable.at(-1);\n if (first === undefined || last === undefined) return;\n const active = document.activeElement;\n if (event.shiftKey && (active === first || active === dialog)) {\n event.preventDefault();\n last.focus();\n } else if (!event.shiftKey && active === last) {\n event.preventDefault();\n first.focus();\n }\n };\n document.addEventListener('keydown', onKey);\n const previousOverflow = document.body.style.overflow;\n document.body.style.overflow = 'hidden';\n dialog.focus();\n return () => {\n document.removeEventListener('keydown', onKey);\n document.body.style.overflow = previousOverflow;\n };\n },\n [expanded, onDisableInteraction, onEvent],\n );\n\n const statusText = t(statusKeyFor(phase, reconnecting));\n const openable = phase === 'live' && !expanded;\n\n const overlay = (\n \n );\n\n const stopLabel = t(stopKey(busy, stopping));\n const rowButton = (disabled: boolean): CSSProperties => ({\n flex: 1,\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n height: 28,\n padding: '0 10px',\n borderRadius: 14,\n border: `1px solid ${BH.borderL3}`,\n background: BH.buttonElevatedFill,\n color: BH.labelPrimary,\n fontSize: 12,\n ...(disabled ? { opacity: 0.4, cursor: 'not-allowed' } : { cursor: 'pointer' }),\n });\n\n return (\n \n \n {expanded ? (\n setInputEnabled((current) => !current))\n }\n onStop={onStop}\n onCollapse={collapseViewer}\n hideStop={hideStop}\n hideInteractiveToggle={hideInteractiveToggle}\n />\n ) : null}\n {notice}\n setHovered(true)}\n onMouseLeave={() => setHovered(false)}\n onClick={() => {\n if (openable) openViewer();\n }}\n onKeyDown={(event) => {\n if (!openable) return;\n if (event.key !== 'Enter' && event.key !== ' ') return;\n event.preventDefault();\n openViewer();\n }}\n style={\n expanded\n ? { position: 'relative', flex: 1, minHeight: 0 }\n : { position: 'relative', cursor: openable ? 'pointer' : 'default' }\n }\n >\n \n {overlay}\n \n {expanded ? null : (\n \n \n {title}\n \n
\n {hideStop === true ? null : (\n \n {stopLabel}\n \n )}\n \n {t('entry.reconnect')}\n \n
\n {footer}\n
\n )}\n \n );\n}\n","export const VIEWER_EVENT_ENDPOINT = './api/computer/diagnostics/viewer';\n\nexport type { ViewerLifecycleEvent } from '../../../client/src/client/remote-viewer/index.js';\nimport type { ViewerLifecycleEvent } from '../../../client/src/client/remote-viewer/index.js';\nexport function viewerEventText(event: ViewerLifecycleEvent): string {\n switch (event.type) {\n case 'mount':\n return 'viewer mount docked';\n case 'overlay':\n return event.open ? 'viewer overlay open' : 'viewer overlay closed';\n case 'phase':\n return `viewer phase ${event.from}>${event.to}`;\n case 'auto-reload':\n return `viewer auto-reload attempt=${String(event.attempt)}`;\n case 'manual-retry':\n return 'viewer manual-retry';\n case 'loss-remount':\n return `viewer loss-remount streak=${String(event.streak)}`;\n }\n}\n\nexport async function reportViewerEvent(\n fetchImpl: typeof fetch | undefined,\n detail: string,\n): Promise {\n try {\n await (fetchImpl ?? fetch)(VIEWER_EVENT_ENDPOINT, {\n method: 'POST',\n credentials: 'same-origin',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ detail }),\n });\n } catch {}\n}\n","import type { TranslateNS } from '@deepseek-ai/dsh-client-ui-slots';\n\nexport const LOCALE_NS = 'botharness-computer';\n\nexport const zh = {\n 'local.error.permissions': '请在 macOS 系统设置中允许所需权限。',\n 'local.error.disk': '磁盘空间不足。请释放空间后重新检查。',\n 'local.error.write': '无法写入桌面组件。请检查安装目录权限后重试。',\n 'local.error.download': '桌面组件下载失败。请检查网络后重试。',\n 'local.error.verify': '桌面组件校验失败。请重新检查以下载安装。',\n 'local.error.install': '桌面组件安装失败。请检查磁盘空间和目录权限后重试。',\n 'local.error.settings': '无法打开系统设置。请手动打开“隐私与安全性”。',\n 'local.error.target': '操作目标已变更。请确认当前目标后重试。',\n 'local.error.request': '无法连接电脑服务。请检查 DSH 是否运行后重试。',\n 'local.error.setup': '电脑检查失败。请重试;若仍失败,请查看诊断日志。',\n 'local.open.accessibility': '打开辅助功能设置',\n 'local.open.screen': '打开屏幕录制设置',\n 'local.permissions.help':\n '允许运行 DSH 的应用访问这些权限,然后完全退出并重新打开该应用,再检查一次。',\n\n 'rows.target.title': '操作目标',\n 'rows.target.description': '本 Profile 的所有 Bot 共用一个目标;切换后需要重新授权操作。',\n 'rows.target.local': '本机 Computer',\n 'rows.target.container': 'Docker Computer',\n 'local.title': '本机 Computer',\n 'local.granted': '桌面权限已授予',\n 'local.description':\n '直接操作运行 DSH 的这台电脑(macOS、Windows 或 Linux)。首次检查会安装桌面操作组件;没有显示器的 Linux 服务器会启动一个虚拟桌面。登录请在这台电脑上完成。',\n 'local.check': '检查权限',\n 'local.downloading': '正在下载桌面操作组件 {percent}%({downloaded} / {total})',\n 'local.installing': '正在安装 {packages}:{percent}%',\n 'local.missing': '这台机器缺少桌面组件:{packages}',\n 'local.missing.manual':\n '安装需要管理员密码。请在这台机器的终端里运行下面的命令;装好后这里会自动重新检查。',\n 'local.install': '一键安装',\n 'local.copy': '复制命令',\n 'local.copied': '已复制',\n 'local.checking': '正在检查…',\n 'local.chip.granted': '已授权',\n 'local.chip.checking': '检查中',\n 'local.chip.unchecked': '未检查',\n 'local.chip.failed': '需要处理',\n 'local.chip.missing': '缺少组件',\n\n 'entry.label': '电脑',\n 'entry.screen.title': '{name} 的屏幕',\n 'entry.shared':\n '这台电脑由本 profile 的所有 PersonaBot 共享:各自拥有自己的窗口,共享登录态与文件。',\n 'entry.access.title': 'Computer Access',\n 'entry.access.on': 'Computer Access 已开启',\n 'entry.access.enable': '启用 Computer Access',\n 'entry.access.disable': '停用 Computer Access',\n 'entry.access.description': '开启后,该 Bot 的会话可以操作这台电脑',\n 'entry.access.failed': '切换 Computer Access 失败',\n 'entry.access.failureHint': '授权失败',\n 'entry.start': '启动',\n 'entry.starting': '启动中…',\n 'entry.chip.setup': '需要设置',\n 'entry.chip.authorize': '待授权',\n 'entry.chip.running': '运行中',\n 'entry.chip.stopped': '未启动',\n 'entry.chip.failed': '出错',\n 'entry.stop': '停止',\n 'entry.stopping': '停止中…',\n 'entry.reconnect': '重新连接',\n 'entry.connecting': '连接中',\n 'entry.reconnecting': '正在重新连接',\n 'entry.live': '已连接',\n 'entry.noScreen': '暂无画面',\n 'entry.openFullscreen': '打开大屏',\n 'entry.watchOnly': '观看模式 · 开启交互后可操作键盘鼠标',\n 'entry.interactive.enable': '开启交互',\n 'entry.interactive.disable': '停止交互',\n 'entry.collapseFullscreen': '收起全屏',\n 'entry.recentLogs': '近期动态',\n 'entry.recentLogs.empty': '暂无运行记录',\n 'entry.recentLogs.failed': '读取运行记录失败',\n 'entry.authorize': '授权并启动',\n 'entry.cancel': '取消',\n 'entry.remember': '本次会话内不再询问',\n 'entry.authorizeIntro': '启动会在你的机器上执行:',\n 'entry.authorize.probe': '检测本机容器运行时;缺失时只给安装引导,不会自动安装',\n 'entry.authorize.volume': '创建/复用持久卷(登录态与文件保留在这台电脑上)',\n 'entry.authorize.pull': '拉取镜像(首次约 1.2 GB 网络流量)并创建容器',\n 'entry.authorize.bind': '把 Web VNC 绑定到 127.0.0.1 的本地端口,仅本机可访问',\n 'entry.authorize.storage': '存储位置:{target}',\n 'entry.authorize.storageBindRisk':\n 'Bind mount 把浏览器 profile(含 SQLite 与缓存)直接落在宿主目录;在 Docker Desktop / Colima 等虚拟文件共享下文件锁不可靠,可能损坏数据,仅建议 Linux 原生 Docker 使用。详见 Docker 文档:https://docs.docker.com/storage/bind-mounts/',\n 'entry.phase.pulling': '正在拉取镜像',\n 'entry.phase.starting': '正在启动',\n 'entry.phase.stopping': '正在停止',\n 'entry.phase.exporting': '正在导出',\n 'entry.phase.importing': '正在导入',\n 'entry.phase.working': '处理中',\n 'entry.wait': '请稍候',\n 'entry.elapsed': '已用时 {seconds}s',\n 'entry.updated': '最后更新 {seconds}s 前',\n 'entry.setup':\n '未检测到容器运行时。任选其一安装后重试:\\n\\nColima(推荐,MIT):\\n brew install colima docker\\n brew services start colima\\n\\n或 Docker Desktop:https://www.docker.com/products/docker-desktop/',\n 'section.title': '电脑控制',\n 'section.description': '操作目标与 Computer 权限',\n 'rows.exportDir.title': 'Computer 导出目录',\n 'rows.exportDir.current': '当前:{dir}',\n 'rows.exportDir.empty': '未配置时使用默认导出目录',\n 'rows.exportDir.pick': '选择…',\n 'rows.exportDir.manual': '手动输入路径',\n 'rows.exportDir.save': '保存',\n 'rows.exportDir.saving': '正在保存…',\n 'rows.exportDir.saved': '导出目录已保存:{dir}',\n 'rows.exportDir.needsAbsolute': '路径必须是绝对路径,例如 /path/to/exports',\n 'rows.exportDir.saveRejected': 'Host 未接受该导出目录,已恢复原值;请重试',\n 'rows.exportDir.open': '打开目录',\n 'rows.idle.title': '空闲停止',\n 'rows.idle.description': '无观看者时 Computer 自动停止的等待时间',\n 'rows.idle.minutes': '{minutes} 分钟',\n 'rows.autoAllow.title': '自动允许 Computer 操作',\n 'rows.autoAllow.description': '打开后,PersonaBot 在 Computer 上的操作不再逐会话询问;默认关闭。',\n 'rows.exportSection.title': '导出',\n 'rows.exportSection.description': '把 Computer 的持久存储打包成一个归档',\n 'rows.importSection.title': '导入',\n 'rows.importSection.description': '从归档恢复 Computer',\n 'rows.export': '导出',\n 'rows.exporting': '导出中…',\n 'rows.download': '下载',\n 'rows.exportTo': '导出到…',\n 'rows.authorizeExport': '授权并导出',\n 'rows.exportTarget': '导出至:{dir}',\n 'rows.import': '导入…',\n 'rows.importing': '导入中…',\n 'rows.chooseFile': '选择归档文件…',\n 'rows.cancelImport': '取消导入',\n 'rows.authorizeImportConfirm': '授权并导入',\n 'rows.exported': '已导出:{archive}',\n 'rows.exportedDone': '导出完成。',\n 'rows.imported': '已从 {file} 导入并重启 Computer。',\n 'rows.noArchives': '该目录还没有归档;先导出一次。',\n 'rows.noSettings': '设置服务不可用:可以导出/导入,但无法修改目录与空闲时间。',\n 'rows.pickerFallback': '目录选择器不可用;可手动输入路径,或继续使用当前目录:{dir}',\n} as const;\n\nexport const en: Record = {\n 'local.error.permissions': 'Allow the required permissions in macOS System Settings.',\n 'local.error.disk': 'Not enough disk space. Free some space and check again.',\n 'local.error.write': 'Could not write the desktop helper. Check folder permissions and retry.',\n 'local.error.download': 'Could not download the desktop helper. Check your connection and retry.',\n 'local.error.verify': 'Desktop helper verification failed. Check again to reinstall it.',\n 'local.error.install':\n 'Could not install the desktop helper. Check disk space and folder permissions, then retry.',\n 'local.error.settings': 'Could not open System Settings. Open Privacy & Security manually.',\n 'local.error.target': 'The Computer target changed. Check the selected target and retry.',\n 'local.error.request':\n 'Could not reach the computer service. Check that DSH is running and retry.',\n 'local.error.setup':\n 'Computer setup failed. Retry; if it still fails, check the diagnostic logs.',\n 'local.open.accessibility': 'Open Accessibility settings',\n 'local.open.screen': 'Open Screen Recording settings',\n 'local.permissions.help':\n 'Allow these permissions for the app running DSH, fully quit and reopen that app, then check again.',\n\n 'rows.target.title': 'Computer Target',\n 'rows.target.description':\n 'All Bots in this Profile share one target. Switching requires new action authorization.',\n 'rows.target.local': 'Local Computer',\n 'rows.target.container': 'Docker Computer',\n 'local.title': 'Local Computer',\n 'local.granted': 'Desktop permissions granted',\n 'local.description':\n 'Uses the computer running DSH (macOS, Windows or Linux). The first check installs the required desktop helper; a Linux server without a display gets a virtual one. Complete logins on this computer.',\n 'local.check': 'Check permissions',\n 'local.downloading': 'Downloading the desktop helper {percent}% ({downloaded} / {total})',\n 'local.installing': 'Installing {packages}: {percent}%',\n 'local.missing': 'This machine is missing desktop packages: {packages}',\n 'local.missing.manual':\n 'Installing needs an administrator password. Run this command in a terminal on this machine; this card checks again on its own once it is done.',\n 'local.install': 'Install',\n 'local.copy': 'Copy command',\n 'local.copied': 'Copied',\n 'local.checking': 'Checking…',\n 'local.chip.granted': 'Granted',\n 'local.chip.checking': 'Checking',\n 'local.chip.unchecked': 'Not checked',\n 'local.chip.failed': 'Needs attention',\n 'local.chip.missing': 'Missing parts',\n\n 'entry.label': 'Computer',\n 'entry.screen.title': \"{name}'s screen\",\n 'entry.shared':\n 'This Computer is shared by every PersonaBot in the profile: each keeps its own window and they share logins and files.',\n 'entry.access.title': 'Computer Access',\n 'entry.access.on': 'Computer Access is on',\n 'entry.access.enable': 'Enable Computer Access',\n 'entry.access.disable': 'Disable Computer Access',\n 'entry.access.description': \"This PersonaBot's sessions may act on the Computer\",\n 'entry.access.failed': 'Could not change Computer Access',\n 'entry.access.failureHint': 'Access failed',\n 'entry.start': 'Start',\n 'entry.starting': 'Starting…',\n 'entry.chip.setup': 'Needs setup',\n 'entry.chip.authorize': 'Needs approval',\n 'entry.chip.running': 'Running',\n 'entry.chip.stopped': 'Stopped',\n 'entry.chip.failed': 'Error',\n 'entry.stop': 'Stop',\n 'entry.stopping': 'Stopping…',\n 'entry.reconnect': 'Reconnect',\n 'entry.connecting': 'Connecting',\n 'entry.reconnecting': 'Reconnecting',\n 'entry.live': 'Connected',\n 'entry.noScreen': 'No picture',\n 'entry.openFullscreen': 'Open fullscreen',\n 'entry.watchOnly': 'Watch-only — enable input to use keyboard and mouse',\n 'entry.interactive.enable': 'Enable input',\n 'entry.interactive.disable': 'Stop input',\n 'entry.collapseFullscreen': 'Leave fullscreen',\n 'entry.recentLogs': 'Recent activity',\n 'entry.recentLogs.empty': 'No operational records yet',\n 'entry.recentLogs.failed': 'Could not load operational records',\n 'entry.authorize': 'Authorize and start',\n 'entry.cancel': 'Cancel',\n 'entry.remember': \"Don't ask again in this session\",\n 'entry.authorizeIntro': 'Starting runs these steps on your machine:',\n 'entry.authorize.probe':\n 'Detect the local container runtime; a missing one only gets setup guidance, never an automatic install',\n 'entry.authorize.volume':\n 'Create or reuse the persistent volume (logins and files stay on this Computer)',\n 'entry.authorize.pull': 'Pull the image (about 1.2 GB the first time) and create the container',\n 'entry.authorize.bind':\n 'Bind the web VNC endpoint to a loopback port, reachable only from this machine',\n 'entry.authorize.storage': 'Storage location: {target}',\n 'entry.authorize.storageBindRisk':\n 'A bind mount places the browser profile (including SQLite and caches) directly on a host directory; file locking over virtual filesystem sharing (Docker Desktop, Colima, …) is unreliable and can corrupt data — recommended only for native Linux Docker. See the Docker docs: https://docs.docker.com/storage/bind-mounts/',\n 'entry.phase.pulling': 'Pulling the image',\n 'entry.phase.starting': 'Starting',\n 'entry.phase.stopping': 'Stopping',\n 'entry.phase.exporting': 'Exporting',\n 'entry.phase.importing': 'Importing',\n 'entry.phase.working': 'Working',\n 'entry.wait': 'Please wait',\n 'entry.elapsed': 'Elapsed {seconds}s',\n 'entry.updated': 'Last update {seconds}s ago',\n 'entry.setup':\n 'No container runtime found. Install one of these, then retry:\\n\\nColima (recommended, MIT):\\n brew install colima docker\\n brew services start colima\\n\\nOr Docker Desktop: https://www.docker.com/products/docker-desktop/',\n 'section.title': 'Computer',\n 'section.description': 'Computer target and permissions',\n 'rows.exportDir.title': 'Computer export directory',\n 'rows.exportDir.current': 'Current: {dir}',\n 'rows.exportDir.empty': 'Uses the default export directory when none is set',\n 'rows.exportDir.pick': 'Choose…',\n 'rows.exportDir.manual': 'Type a path',\n 'rows.exportDir.save': 'Save',\n 'rows.exportDir.saving': 'Saving…',\n 'rows.exportDir.saved': 'Export directory saved: {dir}',\n 'rows.exportDir.needsAbsolute': 'Path must be absolute, e.g. /path/to/exports',\n 'rows.exportDir.saveRejected':\n 'The Host did not accept the export directory — the previous value was restored; try again',\n 'rows.exportDir.open': 'Open folder',\n 'rows.idle.title': 'Idle stop',\n 'rows.idle.description': 'How long the Computer waits without viewers before stopping',\n 'rows.idle.minutes': '{minutes} min',\n 'rows.autoAllow.title': 'Auto-allow Computer actions',\n 'rows.autoAllow.description':\n 'When on, PersonaBot actions on the Computer run without a per-session approval; off by default.',\n 'rows.exportSection.title': 'Export',\n 'rows.exportSection.description': \"Pack the Computer's persistent store into one archive\",\n 'rows.importSection.title': 'Import',\n 'rows.importSection.description': 'Restore the Computer from an archive',\n 'rows.export': 'Export',\n 'rows.exporting': 'Exporting…',\n 'rows.download': 'Download',\n 'rows.exportTo': 'Export to…',\n 'rows.authorizeExport': 'Authorize and export',\n 'rows.exportTarget': 'Export to: {dir}',\n 'rows.import': 'Import…',\n 'rows.importing': 'Importing…',\n 'rows.chooseFile': 'Choose archive file…',\n 'rows.cancelImport': 'Cancel import',\n 'rows.authorizeImportConfirm': 'Authorize and import',\n 'rows.exported': 'Exported: {archive}',\n 'rows.exportedDone': 'Export complete.',\n 'rows.imported': 'Imported {file} and restarted the Computer.',\n 'rows.noArchives': 'No archives in that directory yet — export once first.',\n 'rows.noSettings':\n 'Settings service unavailable: export and import still work, but the directory and idle time cannot be changed.',\n 'rows.pickerFallback':\n 'Directory picker unavailable — type a path or use the current directory: {dir}',\n};\n\nexport type ComputerKey = keyof typeof zh;\n\nexport const PHASE_LABEL: Partial> = {\n pulling: 'entry.phase.pulling',\n starting: 'entry.phase.starting',\n stopping: 'entry.phase.stopping',\n exporting: 'entry.phase.exporting',\n importing: 'entry.phase.importing',\n};\n\nexport type ComputerTranslate = TranslateNS;\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface LocaleNamespaceMap {\n 'botharness-computer': ComputerKey;\n }\n}\n","import {\n createContext,\n type Context,\n useContext,\n type ComponentProps,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport { Tooltip as PrimitiveTooltip } from '@deepseek-ai/dsh-client-ui-primitives';\n\nconst shared = globalThis as typeof globalThis & Record | undefined>;\nconst InstantTooltips = (shared[Symbol.for('botharness.instant-tooltips')] ??=\n createContext(false));\n\nexport function InstantTooltipScope({ children }: { readonly children: ReactNode }): ReactElement {\n return {children};\n}\n\nexport function Tooltip(props: ComponentProps): ReactElement {\n const instant = useContext(InstantTooltips);\n return instant ? (\n \n ) : (\n \n );\n}\n","import type { ReactElement, ReactNode, Ref } from 'react';\n\nimport { ChannelSidebarIcon } from './channel-sidebar-icon.js';\n\nexport function SidebarCardList({\n label,\n className,\n listRef,\n flush = false,\n children,\n}: {\n label?: string | undefined;\n className?: string | undefined;\n listRef?: Ref | undefined;\n flush?: boolean | undefined;\n children: ReactNode;\n}): ReactElement {\n return (\n \n {children}\n \n );\n}\n\nexport interface SidebarCardRowProps {\n icon?: string | undefined;\n leading?: ReactNode | undefined;\n selection?: { checked: boolean; multiple?: boolean } | undefined;\n iconLabel?: string | undefined;\n title: ReactNode;\n titleClassName?: string | undefined;\n badge?: ReactNode | undefined;\n summary?: ReactNode | undefined;\n flipKey?: string | undefined;\n hint?: string | undefined;\n chips?: ReactNode | undefined;\n meta?: ReactNode | undefined;\n trailing?: ReactNode | undefined;\n detail?: ReactNode | undefined;\n onClick?: () => void | undefined;\n disabled?: boolean | undefined;\n muted?: boolean | undefined;\n mainClassName?: string | undefined;\n dialog?: boolean | undefined;\n expanded?: boolean | undefined;\n controls?: string | undefined;\n state?: string | undefined;\n anchor?: string | undefined;\n}\n\nexport function SidebarCardRow({\n icon,\n leading,\n iconLabel,\n selection,\n title,\n titleClassName,\n badge,\n summary,\n flipKey,\n hint,\n chips,\n meta,\n trailing,\n detail,\n onClick,\n disabled,\n muted,\n mainClassName,\n dialog,\n expanded,\n controls,\n state,\n anchor,\n}: SidebarCardRowProps): ReactElement {\n const body = (\n <>\n {leading === undefined ? null : {leading}}\n {icon === undefined ? null : (\n \n \n
\n )}\n \n {badge === undefined ? (\n \n {title}\n \n ) : (\n \n \n {title}\n \n {badge}\n
\n )}\n {summary === undefined ? null : {summary}}\n {chips === undefined ? null : {chips}}\n {meta === undefined ? null : {meta}}\n \n \n );\n const className = mainClassName === undefined ? 'bh-card-main' : 'bh-card-main ' + mainClassName;\n return (\n \n
\n {selection?.multiple === true ? (\n \n ) : onClick === undefined ? (\n
\n {body}\n
\n ) : (\n \n {body}\n \n )}\n {trailing === undefined ? null : {trailing}}\n
\n {detail === undefined ? null : (\n
\n {detail}\n
\n )}\n \n );\n}\n","import type { ComputerTarget } from './target.js';\n\nexport const COMPUTER_SETTINGS_NAMESPACE = 'botharness-computer';\n\nexport const COMPUTER_EXPORT_DIR_FIELD = 'exportDir';\n\nexport const COMPUTER_IDLE_STOP_FIELD = 'idleStopMinutes';\n\nexport const COMPUTER_AUTO_ALLOW_FIELD = 'autoAllowActions';\n\nexport const COMPUTER_TARGET_FIELD = 'target';\n\nexport interface ComputerSettings {\n target?: ComputerTarget;\n exportDir: string;\n idleStopMinutes: number;\n autoAllowActions: boolean;\n}\n","import { useCallback, useRef, type DependencyList, type RefCallback } from 'react';\n\nexport function useMountedResource(\n start: (node: T) => void | (() => void),\n dependencies: DependencyList,\n): RefCallback {\n const cleanup = useRef<(() => void) | undefined>(undefined);\n return useCallback((node: T | null) => {\n cleanup.current?.();\n cleanup.current = undefined;\n if (node !== null) cleanup.current = start(node) || undefined;\n }, dependencies);\n}\n","import type { ReactElement, ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\n\nimport { color, space, text } from './tokens.stylex.js';\n\nconst styles = stylex.create({\n note: {\n margin: 0,\n fontSize: text.metaSize,\n lineHeight: text.metaLine,\n overflowWrap: 'anywhere',\n },\n inset: { paddingBlock: space.x2, paddingInline: space.x2 },\n muted: { color: color.muted },\n subtle: { color: color.subtle },\n danger: { color: color.danger },\n success: { color: color.success },\n warning: { color: color.warning },\n});\n\nexport type NoteTone = 'muted' | 'subtle' | 'danger' | 'success' | 'warning';\n\nexport function Note({\n tone = 'muted',\n inset = false,\n children,\n}: {\n readonly tone?: NoteTone;\n readonly inset?: boolean;\n readonly children: ReactNode;\n}): ReactElement {\n return (\n \n {children}\n

\n );\n}\n","import type { ButtonHTMLAttributes, InputHTMLAttributes, ReactElement, ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\n\nimport { actionColor, border, color, radius, size, space, text } from './tokens.stylex.js';\n\nexport const pillStyles = stylex.create({\n pill: {\n display: 'inline-flex',\n alignItems: 'center',\n gap: space.x2,\n maxWidth: '100%',\n height: size.icon,\n paddingInline: `${space.x4} ${space.x3}`,\n borderWidth: 0,\n borderRadius: radius.sm,\n backgroundColor: { default: actionColor.secondary, ':hover': actionColor.hover },\n color: color.fg,\n fontFamily: 'inherit',\n fontSize: text.bodySize,\n lineHeight: text.bodyLine,\n whiteSpace: 'nowrap',\n cursor: { default: 'pointer', ':disabled': 'default' },\n opacity: { default: 1, ':disabled': 0.5 },\n outline: { default: 'none', ':focus-visible': `${border.focus} solid ${color.accent}` },\n outlineOffset: '1px',\n },\n});\n\nexport function PillButton({\n children,\n ...rest\n}: { readonly children: ReactNode } & Omit<\n ButtonHTMLAttributes,\n 'className' | 'style' | 'type' | 'children'\n>): ReactElement {\n return (\n \n );\n}\n\nexport function PillFileButton({\n children,\n ...input\n}: { readonly children: ReactNode } & Omit<\n InputHTMLAttributes,\n 'className' | 'style' | 'type' | 'children' | 'hidden'\n>): ReactElement {\n return (\n \n );\n}\n","import { BUBBLE_SURFACES, readable } from '@botharness/host-client/shared/bot-name-color';\nimport { space } from './ds/tokens.stylex.js';\nimport { panelMaterials, validTargetId } from './appearance-panels.js';\nimport { appearanceMaterials } from './appearance-materials.js';\nimport {\n APPEARANCE_KEY,\n APPEARANCE_PRIMARY,\n Appearance,\n type AppearanceSnapshot,\n} from './appearance.js';\nimport { NATIVE_LIGHT, NATIVE_DARK } from './appearance-native-tokens.js';\nexport const APPEARANCE_CLASS = 'bh-appearance-scope';\nexport function appearanceCss(snapshot: AppearanceSnapshot): string {\n const { config, mode } = snapshot;\n const selected = config.modes[mode];\n const primary = selected.primary ?? APPEARANCE_PRIMARY[selected.preset][mode];\n const materials = appearanceMaterials(selected, mode);\n const tokens: Record = {\n ...NATIVE_LIGHT,\n ...(mode === 'dark' ? NATIVE_DARK : {}),\n };\n for (const part of ['header', 'body'] as const) {\n const material = materials[part];\n tokens[`--bh-global-${part}-fill`] =\n `color-mix(in srgb, ${material.color} ${material.opacity}%, transparent)`;\n tokens[`--bh-global-${part}-blur`] = `${material.blur}px`;\n }\n tokens['--dsw-alias-state-business-primary'] = primary;\n tokens['--dsw-alias-link'] = readable(primary, BUBBLE_SURFACES[mode].surface, 4.6);\n tokens['--dsw-alias-state-business-secondary'] =\n `color-mix(in srgb, ${primary} 45%, transparent)`;\n tokens['--dsw-alias-state-business-tertiary'] = `color-mix(in srgb, ${primary} 14%, transparent)`;\n tokens['--dsw-specific-sidebar-nav-item-active'] =\n `color-mix(in srgb, ${primary} 14%, transparent)`;\n return `.bh-root,.bh-workspace-mount[data-workspace-enabled],.${APPEARANCE_CLASS},[data-bh-appearance-owned]{color:var(--dsw-alias-label-primary);color-scheme:${mode};${Object.entries(\n tokens,\n )\n .map(([k, v]) => `${k}:${v}`)\n .join(\n ';',\n )}}:root [data-bh-appearance-owned][data-menu-material],:root .${APPEARANCE_CLASS}[data-menu-material],:root .${APPEARANCE_CLASS} [data-menu-material]{--dsw-elevation-stroke-color:var(--dsw-alias-border-${mode === 'dark' ? 'l3' : 'l4'})}${materialCss()}${panelCss(snapshot)}`;\n}\n\nexport function mountAppearance(owner: Appearance): () => void {\n const style = document.createElement('style');\n style.dataset.plugin = '@botharness/ui';\n style.dataset.pluginCss = '@botharness/ui/appearance';\n const update = () => {\n style.textContent = appearanceCss(owner.getSnapshot());\n style.dataset.bhAppearance = owner.getSnapshot().mode;\n document.documentElement.dataset.bhAppearance = owner.getSnapshot().mode;\n };\n const media = window.matchMedia('(prefers-color-scheme: dark)');\n const onStorage = (event: StorageEvent) => {\n if (event.key === APPEARANCE_KEY || event.key === null) owner.refresh();\n };\n update();\n document.head.appendChild(style);\n const off = owner.subscribe(update);\n media.addEventListener('change', owner.refresh);\n window.addEventListener('storage', onStorage);\n return () => {\n off();\n style.remove();\n delete document.documentElement.dataset.bhAppearance;\n media.removeEventListener('change', owner.refresh);\n window.removeEventListener('storage', onStorage);\n };\n}\n\nfunction materialCss(): string {\n const scope = ':root .bh-workspace-mount[data-workspace-enabled]';\n return `\n${scope} .bh-dock-theme { --dv-group-view-background-color:transparent; --dv-tabs-and-actions-container-background-color:transparent; --dv-activegroup-visiblepanel-tab-background-color:transparent; --dv-inactivegroup-visiblepanel-tab-background-color:transparent; --dv-activegroup-hiddenpanel-tab-background-color:transparent; --dv-inactivegroup-hiddenpanel-tab-background-color:transparent; }\n${scope} .bh-root, ${scope} .bh-workspace-rail { background:transparent; }\n${scope} .dv-tabs-and-actions-container, ${scope} .bh-channel-session-header { background:var(--bh-global-header-fill); backdrop-filter:blur(var(--bh-global-header-blur)); }\n${scope} [data-appearance-header] { background:var(--bh-global-header-fill); backdrop-filter:blur(var(--bh-global-header-blur)); }\n${scope} .bh-channel-subpanel-body { display:flex; flex-direction:column; flex:1; min-height:0; min-width:0; overflow:auto; }\n${scope} .bh-channel-subpanel-body > section { flex:1; min-height:0; }\n${scope} .bh-memory-commit-view { display:flex; flex-direction:column; padding:0; }\n${scope} .bh-memory-commit-header { margin:0; flex-shrink:0; }\n${scope} .bh-memory-detail-body { flex:1; padding:${space.x3} ${space.x4}; }\n${scope} [data-appearance-body], ${scope} .dv-content-container { background:var(--bh-global-body-fill); backdrop-filter:blur(var(--bh-global-body-blur)); }\n`;\n}\n\nfunction panelCss({ config, mode }: AppearanceSnapshot): string {\n return Object.keys(config.modes[mode].panels ?? {})\n .filter(validTargetId)\n .map((id) => {\n const material = panelMaterials(config.modes[mode], mode, id);\n const scope = `:root .bh-workspace-mount[data-workspace-enabled] .dv-groupview:has(> .dv-tabs-and-actions-container .dv-active-tab [data-dock-header=\"${id.slice(5)}\"])`;\n return (['header', 'body'] as const)\n .map(\n (part) =>\n `${scope} > ${part === 'header' ? '.dv-tabs-and-actions-container' : '.dv-content-container'}, :root .bh-workspace-mount[data-workspace-enabled] [data-appearance-${part}=\"${id.slice(5)}\"] { background:color-mix(in srgb, ${material[part].color} ${material[part].opacity}%, transparent); backdrop-filter:blur(${material[part].blur}px); }`,\n )\n .join('');\n })\n .join('');\n}\n","import { Modal as NativeModal, Menu as NativeMenu } from '@deepseek-ai/dsh-client-ui-primitives';\nimport type { ComponentProps, RefObject } from 'react';\nimport { APPEARANCE_CLASS } from './appearance-scope.js';\nexport function Modal(props: ComponentProps) {\n return (\n \n );\n}\ntype MenuProps = Omit, 'getAnchorRect'> & {\n anchorRef?: RefObject;\n};\n\nexport function Menu(props: MenuProps) {\n const { anchorRef } = props;\n const legacyAnchor =\n anchorRef === undefined\n ? {}\n : {\n getAnchorRect: () => anchorRef.current?.getBoundingClientRect() ?? null,\n };\n return (\n \n );\n}\n","import { Menu } from '../appearance-primitives.js';\nimport type { ComponentProps } from 'react';\nimport { createPortal } from 'react-dom';\nimport * as stylex from '@stylexjs/stylex';\n\nimport { useMountedResource } from '../mounted-resource.js';\nimport { border, space } from './tokens.stylex.js';\n\nexport interface MenuPoint {\n readonly x: number;\n readonly y: number;\n}\n\nexport function pointerMenuPosition(\n point: MenuPoint,\n width: number,\n height: number,\n viewport: { width: number; height: number; top: number },\n) {\n const margin = Number.parseFloat(space.x4);\n return {\n x: Math.max(margin, Math.min(point.x, viewport.width - width - margin)),\n y: Math.max(\n Math.max(margin, viewport.top),\n Math.min(point.y, viewport.height - height - margin),\n ),\n };\n}\n\ntype PointerMenuProps = Omit<\n ComponentProps,\n 'open' | 'portal' | 'anchorRef' | 'side' | 'align' | 'className'\n> & { point: MenuPoint; container?: Element; align?: 'start' | 'end' };\n\nexport function PointerMenu({\n point,\n container = document.body,\n align = 'start',\n ...props\n}: PointerMenuProps) {\n const mount = useMountedResource(\n (node) => {\n const menu = node.querySelector('[role=\"menu\"]');\n if (!menu) return;\n const originalMaxWidth = Number.parseFloat(getComputedStyle(menu).maxWidth);\n const originalMinWidth = Number.parseFloat(getComputedStyle(menu).minWidth);\n const place = () => {\n const scale = node.getBoundingClientRect();\n if (!scale.width || !scale.height) return;\n const cssZoom =\n 'currentCSSZoom' in node && typeof node.currentCSSZoom === 'number'\n ? node.currentCSSZoom\n : undefined;\n const scaleX = cssZoom ?? scale.width;\n const scaleY = cssZoom ?? scale.height;\n const root = document.documentElement;\n const clearance = root.hasAttribute('data-fullscreen')\n ? 0\n : Number.parseFloat(\n getComputedStyle(root).getPropertyValue('--dsh-frame-top-clearance'),\n ) || 0;\n const margin = Number.parseFloat(space.x4);\n const availableWidth = Math.max(0, innerWidth - 2 * margin) / scaleX;\n menu.style.minWidth = `${Math.min(originalMinWidth || 0, availableWidth)}px`;\n menu.style.maxWidth = `${Math.min(originalMaxWidth || Infinity, availableWidth)}px`;\n menu.style.maxHeight = `${Math.max(0, innerHeight - Math.max(margin, clearance) - margin) / scaleY}px`;\n const box = menu.getBoundingClientRect();\n const desired = pointerMenuPosition(\n { x: align === 'end' ? point.x - box.width : point.x, y: point.y },\n box.width,\n box.height,\n {\n width: innerWidth,\n height: innerHeight,\n top: clearance,\n },\n );\n const left = Number.parseFloat(node.style.left) || 0;\n const top = Number.parseFloat(node.style.top) || 0;\n node.style.left = `${left + (desired.x - box.left) / scaleX}px`;\n node.style.top = `${top + (desired.y - box.top) / scaleY}px`;\n };\n place();\n const observer =\n typeof ResizeObserver === 'undefined' ? undefined : new ResizeObserver(place);\n observer?.observe(menu);\n observer?.observe(node);\n window.addEventListener('resize', place);\n window.addEventListener('scroll', place, true);\n return () => {\n observer?.disconnect();\n window.removeEventListener('resize', place);\n window.removeEventListener('scroll', place, true);\n };\n },\n [point.x, point.y, align],\n );\n return createPortal(\n \n \n ,\n container,\n );\n}\n\nconst styles = stylex.create({\n origin: {\n position: 'fixed',\n left: 0,\n top: 0,\n width: border.hairline,\n height: border.hairline,\n zIndex: 1100,\n pointerEvents: 'none',\n },\n menu: { pointerEvents: 'auto' },\n});\n","import { PointerMenu, type MenuPoint } from './pointer-menu.js';\nimport { useMountedResource } from '../mounted-resource.js';\nimport { useRef, useState, type ReactElement, type ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { IconChevronDownOutlineRegular } from '@deepseek-ai/dsh-client-ui-primitives';\n\nimport { pillStyles } from './pill-button.js';\nimport { color, space } from './tokens.stylex.js';\n\nconst styles = stylex.create({\n label: {\n minWidth: 0,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n },\n chevron: {\n display: 'inline-flex',\n flexShrink: 0,\n color: color.muted,\n },\n});\n\nexport interface SelectOption {\n readonly value: Value;\n readonly label: ReactNode;\n}\n\nexport interface SelectProps {\n readonly label: string;\n readonly value: Value;\n readonly options: readonly SelectOption[];\n readonly onChange: (value: Value) => void;\n readonly disabled?: boolean;\n readonly align?: 'start' | 'end';\n readonly autoFocus?: boolean;\n readonly reselect?: boolean;\n}\n\nexport function Select({\n label,\n value,\n options,\n onChange,\n disabled = false,\n align = 'end',\n autoFocus = false,\n reselect = false,\n}: SelectProps): ReactElement {\n const [open, setOpen] = useState(false);\n const [point, setPoint] = useState();\n const trigger = useRef(null);\n const active = open && !disabled;\n const mount = useMountedResource(\n (node) => {\n trigger.current = node;\n if (!active)\n return () => {\n trigger.current = null;\n };\n const place = () => {\n const rect = node.getBoundingClientRect();\n const scale = node.offsetHeight > 0 ? rect.height / node.offsetHeight : 1;\n const next = {\n x: align === 'end' ? rect.right : rect.left,\n y: rect.bottom + Number.parseFloat(space.x2) * scale,\n };\n setPoint((previous) => (previous?.x === next.x && previous.y === next.y ? previous : next));\n };\n place();\n const resize = typeof ResizeObserver === 'undefined' ? undefined : new ResizeObserver(place);\n resize?.observe(node);\n resize?.observe(document.documentElement);\n const observer = new MutationObserver(place);\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['style', 'data-fullscreen'],\n });\n window.addEventListener('resize', place);\n window.addEventListener('scroll', place, true);\n return () => {\n trigger.current = null;\n resize?.disconnect();\n observer.disconnect();\n window.removeEventListener('resize', place);\n window.removeEventListener('scroll', place, true);\n };\n },\n [active, align],\n );\n const close = () => {\n const button = trigger.current;\n const menu = document.activeElement?.closest('[data-pointer-menu]');\n setOpen(false);\n setPoint(undefined);\n queueMicrotask(() => {\n const focused = document.activeElement;\n if (\n button?.isConnected &&\n !button.disabled &&\n (focused === document.body || (focused !== null && menu?.contains(focused)))\n )\n button.focus({ preventScroll: true });\n });\n };\n const current = options.find((option) => option.value === value);\n return (\n <>\n {\n if (active) event.stopPropagation();\n }}\n onClick={() => {\n if (active) close();\n else setOpen(true);\n }}\n {...stylex.props(pillStyles.pill)}\n >\n {current?.label}\n \n \n \n \n {active && point ? (\n }\n items={options.map((option) => ({ id: option.value, label: option.label }))}\n selectedId={value}\n onSelect={(id) => {\n close();\n const next = options.find((option) => option.value === id);\n if (next !== undefined && (reselect || next.value !== value)) onChange(next.value);\n }}\n onClose={close}\n />\n ) : null}\n \n );\n}\n","import { useId, type ReactElement, type ReactNode, type Ref } from 'react';\nimport * as stylex from '@stylexjs/stylex';\n\nimport { border, color, space, text } from './tokens.stylex.js';\n\nconst NARROW = '@media (max-width: 648px)';\nconst COMPACT = '@container bh-settings (max-width: 480px)';\n\nconst styles = stylex.create({\n rows: {\n display: 'flex',\n flexDirection: 'column',\n minWidth: 0,\n },\n section: {\n display: 'flex',\n flexDirection: 'column',\n minWidth: 0,\n paddingTop: { default: space.x5, ':first-child': 0 },\n },\n sectionHead: {\n display: 'flex',\n flexDirection: 'column',\n gap: space.x1,\n paddingBottom: space.x2,\n },\n sectionTitle: {\n margin: 0,\n color: color.muted,\n fontSize: text.metaSize,\n lineHeight: text.metaLine,\n fontWeight: text.strong,\n },\n row: {\n display: 'flex',\n alignItems: { default: 'center', [NARROW]: 'stretch', [COMPACT]: 'stretch' },\n flexDirection: { default: 'row', [NARROW]: 'column', [COMPACT]: 'column' },\n gap: { default: space.x4, [NARROW]: space.x3, [COMPACT]: space.x3 },\n minWidth: 0,\n paddingBlock: space.x4,\n borderBottomWidth: border.hairline,\n borderBottomStyle: 'solid',\n borderBottomColor: { default: color.divider, ':last-child': 'transparent' },\n },\n text: {\n display: 'flex',\n flexDirection: 'column',\n gap: space.x1,\n flexGrow: 1,\n flexShrink: 1,\n flexBasis: 0,\n minWidth: 0,\n },\n title: {\n color: color.fg,\n fontSize: text.titleSize,\n lineHeight: text.titleLine,\n fontWeight: text.strong,\n overflowWrap: 'anywhere',\n },\n description: {\n color: color.muted,\n fontSize: text.metaSize,\n lineHeight: text.metaLine,\n overflowWrap: 'anywhere',\n },\n control: {\n display: 'flex',\n flexWrap: 'wrap',\n alignItems: 'center',\n justifyContent: { default: 'flex-end', [NARROW]: 'flex-start', [COMPACT]: 'flex-start' },\n gap: space.x3,\n flexShrink: 0,\n minWidth: 0,\n maxWidth: { default: '60%', [NARROW]: '100%', [COMPACT]: '100%' },\n },\n value: {\n color: color.muted,\n fontSize: text.bodySize,\n lineHeight: text.bodyLine,\n textAlign: 'end',\n overflowWrap: 'anywhere',\n },\n});\n\nexport function SettingsRows({\n children,\n rootRef,\n}: {\n readonly children: ReactNode;\n readonly rootRef?: Ref | undefined;\n}): ReactElement {\n return (\n
\n {children}\n
\n );\n}\n\nexport interface SettingsSectionProps {\n readonly title?: ReactNode;\n readonly description?: ReactNode;\n readonly children: ReactNode;\n}\n\nexport function SettingsSection({\n title,\n description,\n children,\n}: SettingsSectionProps): ReactElement {\n const id = useId();\n return (\n \n {title === undefined ? null : (\n
\n

\n {title}\n

\n {description === undefined ? null : (\n
{description}
\n )}\n
\n )}\n {children}\n \n );\n}\n\nexport interface SettingsRowProps {\n readonly title: ReactNode;\n readonly description?: ReactNode;\n readonly control?: ReactNode;\n readonly children?: ReactNode;\n readonly rootRef?: Ref | undefined;\n readonly data?: Readonly>;\n}\n\nexport function SettingsRow({\n title,\n description,\n control,\n children,\n rootRef,\n data,\n}: SettingsRowProps): ReactElement {\n const id = useId();\n const titleId = `${id}-title`;\n const descriptionId = `${id}-description`;\n return (\n \n
\n
\n {title}\n
\n {description === undefined ? null : (\n
\n {description}\n
\n )}\n {children}\n
\n {control === undefined ? null :
{control}
}\n \n );\n}\n\nexport function SettingsValue({ children }: { readonly children: ReactNode }): ReactElement {\n return {children};\n}\n","import type { ComputerTranslate } from './locale.js';\n\nexport function localSetupFailure(code: string | undefined, t: ComputerTranslate): string {\n switch (code) {\n case 'permissions-required':\n return t('local.error.permissions');\n case 'disk-full':\n return t('local.error.disk');\n case 'runtime-write-refused':\n return t('local.error.write');\n case 'download-failed':\n return t('local.error.download');\n case 'verification-failed':\n return t('local.error.verify');\n case 'installation-failed':\n return t('local.error.install');\n case 'settings-open-failed':\n return t('local.error.settings');\n case 'target-changed':\n return t('local.error.target');\n case 'request-failed':\n return t('local.error.request');\n default:\n return t('local.error.setup');\n }\n}\n","import { useState, type ReactElement, type ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { Button } from '@deepseek-ai/dsh-client-ui-primitives';\nimport { Note } from './ds/note.js';\nimport { color, radius, space, text } from './ds/tokens.stylex.js';\n\nconst styles = stylex.create({\n root: {\n display: 'grid',\n gap: space.x3,\n justifyItems: 'start',\n width: '100%',\n },\n progress: {\n display: 'grid',\n gap: space.x1,\n width: '100%',\n color: color.muted,\n fontSize: text.metaSize,\n lineHeight: text.metaLine,\n },\n bar: {\n width: '100%',\n height: '6px',\n accentColor: color.accent,\n },\n command: {\n margin: 0,\n width: '100%',\n boxSizing: 'border-box',\n paddingBlock: space.x2,\n paddingInline: space.x2,\n borderRadius: radius.sm,\n backgroundColor: color.hover,\n color: color.fg,\n fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Consolas, monospace',\n fontSize: text.metaSize,\n lineHeight: text.metaLine,\n whiteSpace: 'pre-wrap',\n overflowWrap: 'anywhere',\n },\n actions: {\n display: 'flex',\n gap: space.x2,\n flexWrap: 'wrap',\n },\n});\n\nexport type MissingPackagesAccess = 'root' | 'sudo' | 'none';\n\nexport interface MissingPackagesLabels {\n readonly missing: string;\n readonly manual: string;\n readonly install: string;\n readonly copy: string;\n readonly copied: string;\n}\n\nexport function formatProgressMiB(bytes: number): string {\n return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;\n}\n\nexport function ProgressLine({\n percent,\n label,\n}: {\n readonly percent: number;\n readonly label: string;\n}): ReactElement {\n const value = Math.max(0, Math.min(100, percent));\n return (\n
\n \n {label}\n
\n );\n}\n\nexport function MissingPackages({\n command,\n access,\n installing,\n busy = false,\n onInstall,\n labels,\n children,\n}: {\n readonly command: string;\n readonly access: MissingPackagesAccess;\n readonly installing?: { readonly percent: number; readonly label: string } | undefined;\n readonly busy?: boolean;\n readonly onInstall: () => void;\n readonly labels: MissingPackagesLabels;\n readonly children?: ReactNode;\n}): ReactElement {\n const [copied, setCopied] = useState(false);\n const copy = (): void => {\n void navigator.clipboard?.writeText(command).then(() => setCopied(true));\n };\n return (\n
\n {installing === undefined ? (\n {labels.missing}\n ) : (\n \n )}\n {access === 'none' && installing === undefined ? (\n <>\n {labels.manual}\n
{command}
\n \n ) : null}\n
\n {access !== 'none' && installing === undefined ? (\n \n ) : null}\n {access === 'none' ? (\n \n ) : null}\n {children}\n
\n
\n );\n}\n","import { localSetupFailure } from './local-setup-copy.js';\nimport { useCallback, useState, type ReactElement } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { Button, Tag } from '@deepseek-ai/dsh-client-ui-primitives';\nimport { Note } from '../../../client/src/client/ds/note.js';\nimport { space } from '../../../client/src/client/ds/tokens.stylex.js';\nimport {\n MissingPackages,\n ProgressLine,\n formatProgressMiB,\n} from '../../../client/src/client/missing-packages.js';\nimport { SidebarCardList, SidebarCardRow } from '../../../client/src/client/sidebar-card.js';\nimport type { ComputerTranslate } from './locale.js';\nimport { useMountedResource } from './mounted-resource.js';\n\nconst styles = stylex.create({\n detail: {\n display: 'grid',\n gap: space.x3,\n justifyItems: 'start',\n },\n});\n\ninterface LocalMissing {\n packages?: string[];\n command?: string;\n install?: 'root' | 'sudo' | 'none';\n}\n\ninterface LocalStatus {\n target?: string;\n probe?: { available?: boolean; detail?: string };\n status?: {\n refusal?: string;\n permissions?: { accessibility: boolean; screenRecording: boolean };\n state?: string;\n phase?: string;\n detail?: string;\n progress?: { percent?: number; downloadedBytes?: number; totalBytes?: number };\n missing?: LocalMissing;\n };\n install?: { state?: string; packages?: string[]; percent?: number; text?: string };\n}\n\nexport function LocalComputerStatus({ t }: { t: ComputerTranslate }): ReactElement {\n const [payload, setPayload] = useState();\n const [busy, setBusy] = useState(false);\n const [error, setError] = useState();\n const refresh = useCallback(async (signal?: AbortSignal) => {\n const response = await fetch('./api/computer/status', {\n credentials: 'same-origin',\n ...(signal === undefined ? {} : { signal }),\n });\n if (!response.ok) throw new Error('request-failed');\n const next = (await response.json()) as LocalStatus;\n if (!signal?.aborted) {\n setPayload(next);\n setError((old) => (old === 'request-failed' ? undefined : old));\n }\n }, []);\n const resource = useMountedResource(() => {\n const controller = new AbortController();\n let pending = false;\n const poll = async (): Promise => {\n if (pending || controller.signal.aborted) return;\n pending = true;\n try {\n await refresh(AbortSignal.any([controller.signal, AbortSignal.timeout(10_000)]));\n } catch {\n if (!controller.signal.aborted) setError('request-failed');\n } finally {\n pending = false;\n }\n };\n void poll();\n const timer = setInterval(() => void poll(), 2000);\n return () => {\n controller.abort();\n clearInterval(timer);\n };\n }, [refresh]);\n const installing = payload?.install?.state === 'installing';\n const preparing = busy || installing || payload?.status?.phase === 'starting';\n const missing = payload?.status?.missing;\n const failureDetail =\n error ??\n (payload?.install?.state === 'failed' ? payload.install.text : undefined) ??\n (missing === undefined ? payload?.status?.detail : undefined) ??\n payload?.probe?.detail;\n const failure =\n failureDetail === undefined\n ? undefined\n : localSetupFailure(error ?? payload?.status?.refusal, t);\n const permissions =\n payload?.status?.refusal === 'permissions-required' ? payload.status.permissions : undefined;\n const post = (path: string, body: Record): void => {\n setBusy(true);\n setError(undefined);\n void fetch(path, {\n method: 'POST',\n credentials: 'same-origin',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify(body),\n })\n .then(async (response) => {\n if (!response.ok) {\n const refused = (await response.json().catch(() => ({}))) as { code?: string };\n setError(refused.code ?? 'request-failed');\n return;\n }\n await refresh();\n })\n .catch(() => setError('request-failed'))\n .finally(() => setBusy(false));\n };\n const check = (): void => post('./api/computer/start', { authorize: true, target: 'local' });\n const install = (): void => post('./api/computer/install-packages', { authorize: true });\n const granted = payload?.status?.state === 'running';\n const download = payload?.status?.progress;\n const installLabel = installing\n ? {\n percent: payload?.install?.percent ?? 0,\n label: t('local.installing', {\n packages: (payload?.install?.packages ?? []).join(', '),\n percent: String(payload?.install?.percent ?? 0),\n }),\n }\n : undefined;\n const checkButton = (\n \n {t(preparing ? 'local.checking' : 'local.check')}\n \n );\n const packages = installing ? (payload?.install?.packages ?? []) : (missing?.packages ?? []);\n const body =\n packages.length > 0 && (missing !== undefined || installing) ? (\n \n {checkButton}\n \n ) : (\n <>\n {payload?.status?.phase === 'starting' && (download?.totalBytes ?? 0) > 0 ? (\n \n ) : null}\n {permissions ? (\n <>\n {!permissions.accessibility ? (\n \n post('./api/computer/open-permission-settings', {\n authorize: true,\n permission: 'accessibility',\n })\n }\n >\n {t('local.open.accessibility')}\n \n ) : null}\n {!permissions.screenRecording ? (\n \n post('./api/computer/open-permission-settings', {\n authorize: true,\n permission: 'screen-recording',\n })\n }\n >\n {t('local.open.screen')}\n \n ) : null}\n {t('local.permissions.help')}\n \n ) : null}\n {checkButton}\n \n );\n return (\n
\n \n {t('local.chip.granted')}\n ) : preparing ? (\n {t('local.chip.checking')}\n ) : missing !== undefined ? (\n {t('local.chip.missing')}\n ) : failure === undefined ? (\n {t('local.chip.unchecked')}\n ) : (\n {t('local.chip.failed')}\n )\n }\n meta={t(granted ? 'local.granted' : 'local.description')}\n detail={\n
\n {failure === undefined ? null : {failure}}\n {body}\n
\n }\n />\n
\n
\n );\n}\n","import { useCallback, useRef, useState, useSyncExternalStore, type ReactElement } from 'react';\nimport { useMountedResource } from './mounted-resource.js';\n\nimport * as stylex from '@stylexjs/stylex';\nimport {\n IconChevronDownOutlineRegular,\n IconFolderOpenOutlineRegular,\n Input,\n Menu,\n Switch,\n} from '@deepseek-ai/dsh-client-ui-primitives';\nimport type { InjectFace, PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';\n\nimport {\n COMPUTER_TARGET_FIELD,\n COMPUTER_AUTO_ALLOW_FIELD,\n COMPUTER_EXPORT_DIR_FIELD,\n COMPUTER_IDLE_STOP_FIELD,\n type ComputerSettings,\n} from '../settings.js';\nimport { Note } from '../../../client/src/client/ds/note.js';\nimport { PillButton, PillFileButton } from '../../../client/src/client/ds/pill-button.js';\nimport { Select } from '../../../client/src/client/ds/select.js';\nimport { SettingsRow, SettingsRows } from '../../../client/src/client/ds/settings-row.js';\nimport { border, color, space, text } from '../../../client/src/client/ds/tokens.stylex.js';\nimport { LocalComputerStatus } from './local-computer.js';\nimport type { ComputerTarget } from '../target.js';\n\nimport { PHASE_LABEL, type ComputerTranslate } from './locale.js';\n\nexport interface ComputerSettingsSnapshot {\n target: ComputerTarget;\n exportDir: string;\n idleStopMinutes: number;\n autoAllowActions: boolean;\n status: 'loading' | 'ready' | 'unavailable';\n writable: boolean;\n}\n\nexport interface ComputerSettingsScope {\n getSnapshot(): {\n status: 'loading' | 'ready' | 'unavailable';\n value: ComputerSettings | undefined;\n writable: boolean;\n };\n subscribe(listener: () => void): () => void;\n set(field: string, value: unknown): Promise;\n}\n\nexport class ExportDirRejectedError extends Error {\n constructor() {\n super('the Host did not accept the export directory');\n this.name = 'ExportDirRejectedError';\n }\n}\n\nexport function displayExportDir(configured: string, hostDir: string | undefined): string {\n return configured !== '' ? configured : (hostDir ?? '');\n}\n\nexport class ComputerSettingsPrefs {\n private snapshot: ComputerSettingsSnapshot = {\n target: 'container',\n exportDir: '',\n idleStopMinutes: 30,\n autoAllowActions: false,\n status: 'loading',\n writable: false,\n };\n\n private readonly listeners = new Set<() => void>();\n\n private scope: ComputerSettingsScope | undefined;\n\n private detach: (() => void) | undefined;\n\n attach(scope: ComputerSettingsScope): () => void {\n this.detach?.();\n this.scope = scope;\n this.detach = scope.subscribe(() => {\n this.sync();\n });\n this.sync();\n return () => {\n this.detach?.();\n this.detach = undefined;\n this.scope = undefined;\n };\n }\n\n getSnapshot = (): ComputerSettingsSnapshot => this.snapshot;\n\n subscribe = (listener: () => void): (() => void) => {\n this.listeners.add(listener);\n return () => {\n this.listeners.delete(listener);\n };\n };\n\n async setTarget(target: ComputerTarget): Promise {\n if (this.scope === undefined) throw new Error('Computer settings are unavailable');\n await this.scope.set(COMPUTER_TARGET_FIELD, target);\n this.sync();\n if (this.snapshot.target !== target) throw new Error('Computer Target was not saved');\n }\n\n async setExportDir(exportDir: string): Promise {\n if (this.scope === undefined) throw new ExportDirRejectedError();\n this.publish({ exportDir });\n try {\n await this.scope.set(COMPUTER_EXPORT_DIR_FIELD, exportDir);\n } catch (error) {\n this.sync();\n throw error;\n }\n if (this.snapshot.exportDir !== exportDir) throw new ExportDirRejectedError();\n }\n\n setIdleStopMinutes(idleStopMinutes: number): void {\n this.publish({ idleStopMinutes });\n void this.scope?.set(COMPUTER_IDLE_STOP_FIELD, idleStopMinutes).catch(() => undefined);\n }\n\n setAutoAllowActions(autoAllowActions: boolean): void {\n const previous = this.snapshot.autoAllowActions;\n this.publish({ autoAllowActions });\n void this.scope?.set(COMPUTER_AUTO_ALLOW_FIELD, autoAllowActions).catch(() => {\n this.publish({ autoAllowActions: previous });\n });\n }\n\n private publish(patch: Partial): void {\n this.snapshot = { ...this.snapshot, ...patch };\n for (const listener of this.listeners) listener();\n }\n\n private sync(): void {\n const scope = this.scope;\n if (scope === undefined) return;\n const next = scope.getSnapshot();\n const value = next.value;\n this.snapshot = {\n target: value?.target ?? 'container',\n exportDir: value?.exportDir ?? '',\n idleStopMinutes: value?.idleStopMinutes ?? 30,\n autoAllowActions: value?.autoAllowActions ?? false,\n status: next.status,\n writable: next.writable,\n };\n for (const listener of this.listeners) listener();\n }\n}\n\nexport interface ComputerSettingsFace {\n prefs: ComputerSettingsPrefs;\n pickerAvailable: boolean;\n pickDirectory: () => Promise;\n openDirectory: (dir: string) => Promise;\n exportArchive: (dir?: string) => Promise<{ archive: string; downloadToken?: string }>;\n downloadUrl: (downloadToken: string) => string;\n importArchive: (file: string) => Promise;\n requestUpload: (file: string) => Promise;\n sendUploadBytes: (uploadToken: string, file: File) => Promise;\n listArchives: () => Promise;\n hostExportDir: () => Promise;\n}\n\nconst IDLE_OPTIONS = [15, 30, 60, 120, 240] as const;\n\nconst styles = stylex.create({\n intro: {\n margin: 0,\n paddingTop: space.x5,\n paddingBottom: space.x2,\n color: color.muted,\n fontSize: text.metaSize,\n lineHeight: text.metaLine,\n },\n chevron: {\n display: 'inline-flex',\n flexShrink: 0,\n color: color.muted,\n },\n manual: {\n display: 'flex',\n alignItems: 'center',\n gap: space.x4,\n minWidth: 0,\n paddingBlock: space.x4,\n borderBottomWidth: border.hairline,\n borderBottomStyle: 'solid',\n borderBottomColor: color.divider,\n },\n manualInput: {\n flexGrow: 1,\n flexShrink: 1,\n flexBasis: 0,\n minWidth: 0,\n },\n file: {\n margin: 0,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n color: color.muted,\n fontSize: text.metaSize,\n lineHeight: text.metaLine,\n },\n});\n\nconst EXPORT_ENDPOINT = './api/computer/export';\nconst IMPORT_ENDPOINT = './api/computer/import';\nconst EXPORTS_ENDPOINT = './api/computer/exports';\nconst STATUS_ENDPOINT = './api/computer/status';\nconst OPEN_DIR_ENDPOINT = './api/computer/open-dir';\nconst DOWNLOAD_ENDPOINT = './api/computer/download';\nconst UPLOAD_ENDPOINT = './api/computer/upload';\nconst UPLOAD_CONTENT_ENDPOINT = './api/computer/upload-content';\n\nasync function requestJson(url: string, init?: RequestInit): Promise {\n const response = await fetch(url, { credentials: 'same-origin', ...init });\n if (!response.ok) throw new Error(`${String(response.status)} ${await response.text()}`);\n return (await response.json()) as T;\n}\n\nasync function postAuthorized(url: string, body: Record = {}): Promise {\n await requestJson(url, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ authorize: true, ...body }),\n });\n}\n\nexport function createComputerSettingsFace(options: {\n prefs: ComputerSettingsPrefs;\n pickDirectory?: (() => Promise) | undefined;\n createXhr?: (() => XMLHttpRequest) | undefined;\n}): ComputerSettingsFace {\n const { prefs } = options;\n return {\n prefs,\n pickerAvailable: options.pickDirectory !== undefined,\n pickDirectory: async () =>\n options.pickDirectory === undefined ? null : options.pickDirectory(),\n openDirectory: async (dir) => {\n await postAuthorized(OPEN_DIR_ENDPOINT, dir === '' ? {} : { dir });\n },\n exportArchive: async (dir) => {\n if (dir !== undefined && dir !== '') await prefs.setExportDir(dir);\n const payload = await requestJson<{ archive?: string; downloadToken?: string }>(\n EXPORT_ENDPOINT,\n {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify(\n dir === undefined || dir === '' ? { authorize: true } : { authorize: true, dir },\n ),\n },\n );\n return {\n archive: payload.archive ?? '',\n ...(payload.downloadToken === undefined ? {} : { downloadToken: payload.downloadToken }),\n };\n },\n downloadUrl: (downloadToken) =>\n `${DOWNLOAD_ENDPOINT}?token=${encodeURIComponent(downloadToken)}`,\n importArchive: async (file) => {\n await postAuthorized(IMPORT_ENDPOINT, { file });\n },\n requestUpload: async (file) => {\n const payload = await requestJson<{ uploadToken?: string }>(UPLOAD_ENDPOINT, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ authorize: true, file }),\n });\n if (payload.uploadToken === undefined) throw new Error('upload not accepted');\n return payload.uploadToken;\n },\n sendUploadBytes: (uploadToken, file) =>\n new Promise((resolve, reject) => {\n const createXhr = options.createXhr ?? (() => new XMLHttpRequest());\n const xhr = createXhr();\n xhr.open('POST', `${UPLOAD_CONTENT_ENDPOINT}?token=${encodeURIComponent(uploadToken)}`);\n xhr.withCredentials = true;\n xhr.setRequestHeader('content-type', 'application/octet-stream');\n xhr.onload = () => {\n if (xhr.status !== 200) {\n reject(new Error(`upload failed: HTTP ${String(xhr.status)}`));\n return;\n }\n try {\n const payload = JSON.parse(xhr.responseText) as {\n ok?: unknown;\n error?: unknown;\n };\n if (payload.ok === true) resolve();\n else\n reject(\n new Error(typeof payload.error === 'string' ? payload.error : 'upload failed'),\n );\n } catch (error: unknown) {\n reject(error instanceof Error ? error : new Error(String(error)));\n }\n };\n xhr.onerror = () => reject(new Error('upload transport failed'));\n xhr.send(file);\n }),\n listArchives: async () => {\n const payload = await requestJson<{ files?: string[] }>(EXPORTS_ENDPOINT);\n return payload.files ?? [];\n },\n hostExportDir: async () => {\n const payload = await requestJson<{ exportDir?: string }>(STATUS_ENDPOINT);\n return payload.exportDir ?? '';\n },\n };\n}\n\nfunction Selector({\n label,\n open,\n onToggle,\n disabled,\n}: {\n readonly label: string;\n readonly open: boolean;\n readonly onToggle: () => void;\n readonly disabled?: boolean | undefined;\n}): ReactElement {\n return (\n \n {label}\n \n \n \n \n );\n}\n\nexport function ComputerSettingsRows({\n t,\n prefs,\n pickerAvailable,\n pickDirectory,\n openDirectory,\n exportArchive,\n downloadUrl,\n importArchive,\n requestUpload,\n sendUploadBytes,\n listArchives,\n hostExportDir,\n}: PropsLocale<'botharness-computer'> & InjectFace): ReactElement {\n const snapshot = useSyncExternalStore(prefs.subscribe, prefs.getSnapshot);\n const [targetError, setTargetError] = useState();\n const [targetSaving, setTargetSaving] = useState(false);\n const [idleOpen, setIdleOpen] = useState(false);\n const [importOpen, setImportOpen] = useState(false);\n const [archives, setArchives] = useState(undefined);\n const [busy, setBusy] = useState<'export' | 'import' | 'upload' | undefined>(undefined);\n const [confirming, setConfirming] = useState<'export' | 'import' | undefined>(undefined);\n const [exportTarget, setExportTarget] = useState(undefined);\n const [manualOpen, setManualOpen] = useState(false);\n const [manualPath, setManualPath] = useState('');\n const [saving, setSaving] = useState(false);\n const [dirNote, setDirNote] = useState(undefined);\n const [transferNote, setTransferNote] = useState(undefined);\n const [download, setDownload] = useState<{ archive: string; token: string } | undefined>(\n undefined,\n );\n const [uploadName, setUploadName] = useState(undefined);\n const uploadFile = useRef(null);\n const [pickerBroken, setPickerBroken] = useState(false);\n const [hostDir, setHostDir] = useState(undefined);\n const [livePhase, setLivePhase] = useState(undefined);\n const [liveElapsed, setLiveElapsed] = useState(0);\n\n const hostDirResource = useMountedResource(() => {\n if (snapshot.target === 'local') return;\n if (snapshot.status !== 'unavailable' && snapshot.exportDir !== '') return;\n let active = true;\n void hostExportDir()\n .then((dir) => {\n if (active) setHostDir(dir);\n })\n .catch(() => undefined);\n return () => {\n active = false;\n };\n }, [hostExportDir, snapshot.status, snapshot.exportDir, snapshot.target]);\n\n const busyResource = useMountedResource(() => {\n setLivePhase(undefined);\n setLiveElapsed(0);\n const startedAt = Date.now();\n const controller = new AbortController();\n let pending = false;\n const tick = async (): Promise => {\n if (controller.signal.aborted) return;\n setLiveElapsed(Math.round((Date.now() - startedAt) / 1000));\n if (pending) return;\n pending = true;\n try {\n const payload = await requestJson<{ status?: { phase?: string } }>(STATUS_ENDPOINT, {\n signal: AbortSignal.any([controller.signal, AbortSignal.timeout(10_000)]),\n });\n if (!controller.signal.aborted) setLivePhase(payload.status?.phase);\n } catch {\n } finally {\n pending = false;\n }\n };\n void tick();\n const timer = setInterval(() => void tick(), 1000);\n return () => {\n controller.abort();\n clearInterval(timer);\n };\n }, [busy]);\n\n const phaseKey = livePhase === undefined ? undefined : PHASE_LABEL[livePhase];\n\n const exportDir = displayExportDir(snapshot.exportDir, hostDir);\n const hasDir = exportDir !== '';\n const writable = snapshot.status === 'ready' && snapshot.writable;\n const canAdjust = pickerAvailable && !pickerBroken;\n\n const pickDirectoryInto = useCallback(\n (apply: (dir: string) => void) => {\n void pickDirectory()\n .then((dir) => {\n if (dir !== null) apply(dir);\n })\n .catch(() => {\n setPickerBroken(true);\n setManualOpen(false);\n setDirNote(t('rows.pickerFallback', { dir: exportDir }));\n });\n },\n [exportDir, pickDirectory, t],\n );\n\n const pickExportDir = useCallback(() => {\n pickDirectoryInto((dir) => {\n setManualPath(dir);\n setDirNote(undefined);\n void prefs.setExportDir(dir).catch((error: unknown) => setDirNote(String(error)));\n });\n }, [pickDirectoryInto, prefs]);\n\n const startExport = useCallback(() => {\n if (!canAdjust) {\n setExportTarget(undefined);\n setConfirming('export');\n return;\n }\n pickDirectory()\n .then((dir) => {\n if (dir === null) return;\n setExportTarget(dir);\n setConfirming('export');\n })\n .catch(() => {\n setPickerBroken(true);\n setManualOpen(false);\n setDirNote(t('rows.pickerFallback', { dir: exportDir }));\n setExportTarget(undefined);\n setConfirming('export');\n });\n }, [canAdjust, exportDir, pickDirectory, t]);\n\n const saveManualPath = useCallback(() => {\n const dir = manualPath.trim();\n if (dir === '') return;\n if (!dir.startsWith('/') && !/^[A-Za-z]:[\\\\/]/u.test(dir)) {\n setDirNote(t('rows.exportDir.needsAbsolute'));\n return;\n }\n setSaving(true);\n setDirNote(undefined);\n void prefs\n .setExportDir(dir)\n .then(() => {\n setManualOpen(false);\n setDirNote(t('rows.exportDir.saved', { dir }));\n })\n .catch((error: unknown) =>\n setDirNote(\n error instanceof ExportDirRejectedError\n ? t('rows.exportDir.saveRejected')\n : String(error),\n ),\n )\n .finally(() => setSaving(false));\n }, [manualPath, prefs, t]);\n\n const runExport = useCallback(() => {\n const autoOpen = !canAdjust;\n setConfirming(undefined);\n setBusy('export');\n setTransferNote(undefined);\n setDownload(undefined);\n void exportArchive(exportTarget)\n .then(({ archive, downloadToken }) => {\n setTransferNote(archive === '' ? t('rows.exportedDone') : t('rows.exported', { archive }));\n if (archive !== '' && downloadToken !== undefined) {\n setDownload({ archive, token: downloadToken });\n }\n if (autoOpen) void openDirectory(exportDir).catch(() => undefined);\n })\n .catch((error: unknown) => setTransferNote(String(error)))\n .finally(() => setBusy(undefined));\n }, [canAdjust, exportArchive, exportDir, exportTarget, openDirectory, t]);\n\n const runImport = useCallback(\n (file: string) => {\n setImportOpen(false);\n setConfirming(undefined);\n setBusy('import');\n setTransferNote(undefined);\n void importArchive(file)\n .then(() => setTransferNote(t('rows.imported', { file })))\n .catch((error: unknown) => setTransferNote(String(error)))\n .finally(() => setBusy(undefined));\n },\n [importArchive, t],\n );\n\n const takeUploadFile = useCallback((file: File | null) => {\n if (file === null) return;\n uploadFile.current = file;\n setUploadName(file.name);\n setTransferNote(undefined);\n }, []);\n\n const runUpload = useCallback(() => {\n const file = uploadFile.current;\n const name = uploadName;\n if (file === null || name === undefined) return;\n setConfirming(undefined);\n setBusy('upload');\n setTransferNote(undefined);\n void requestUpload(name)\n .then((token) => sendUploadBytes(token, file))\n .then(() => importArchive(name))\n .then(() => {\n setTransferNote(t('rows.imported', { file: name }));\n setUploadName(undefined);\n uploadFile.current = null;\n })\n .catch((error: unknown) => setTransferNote(String(error)))\n .finally(() => setBusy(undefined));\n }, [uploadName, requestUpload, sendUploadBytes, importArchive, t]);\n\n const openImport = useCallback(() => {\n if (importOpen) {\n setImportOpen(false);\n return;\n }\n void listArchives()\n .then((files) => {\n setArchives(files);\n if (files.length === 0) {\n setImportOpen(false);\n setTransferNote(t('rows.noArchives'));\n } else {\n setImportOpen(true);\n }\n })\n .catch((error: unknown) => setTransferNote(String(error)));\n }, [importOpen, listArchives, t]);\n\n const openDir = useCallback(() => {\n void openDirectory(exportDir).catch((error: unknown) => setDirNote(String(error)));\n }, [exportDir, openDirectory]);\n\n const selectedFile = uploadName ?? (confirming === 'import' ? archives?.[0] : undefined);\n\n return (\n \n \n );\n}\n","export type ClientTelemetrySurface = 'desktop_app' | 'browser';\n\nexport interface TelemetryRpc {\n call(path: string, method: string, options?: { args?: unknown }): Promise;\n}\n\nexport function telemetrySurface(): ClientTelemetrySurface {\n return typeof globalThis === 'object' && 'dshDesktop' in globalThis ? 'desktop_app' : 'browser';\n}\n\nexport function recordViewerOpen(\n rpc: TelemetryRpc | undefined,\n panel: 'browser' | 'computer',\n): void {\n void rpc\n ?.call('/api', 'botharness/telemetryEvent', {\n args: {\n event: 'viewer:subpanel_open',\n properties: { panel, surface: telemetrySurface() },\n },\n })\n .catch(() => {});\n}\n","/**\n * Vendored Access Power glyph from lucide-react@1.46.0 (ISC, ADR-0032).\n *\n * Source: the lucide `dist/esm/icons/power.mjs` glyph data. Vendored at the\n * stock 2-unit stroke without adding a `lucide-react` runtime dependency.\n *\n * ISC License\n *\n * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT).\n * All other copyright (c) for Lucide are held by Lucide Contributors 2022.\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\nimport type { ReactElement } from 'react';\nexport function AccessPowerIcon(): ReactElement {\n return (\n \n \n \n \n );\n}\n","export const STYLEX_CSS: string = '@bh-stylex-css';\n","import { PanelEmptyState } from '../../../client/src/client/ds/empty-state.js';\nimport { border, color, radius, space, text } from '../../../client/src/client/ds/tokens.stylex.js';\nimport {\n RemoteViewer,\n type ViewerLifecycleEvent,\n} from '../../../client/src/client/remote-viewer/index.js';\nimport { BH } from '../../../client/src/client/remote-viewer/tokens.js';\nimport {\n useCallback,\n useRef,\n useState,\n useSyncExternalStore,\n type CSSProperties,\n type ComponentType,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport { isExitReport } from './viewer-state.js';\nimport { reportViewerEvent, viewerEventText } from './viewer-events.js';\nimport {\n LOCALE_NS,\n PHASE_LABEL,\n en,\n zh,\n type ComputerKey,\n type ComputerTranslate,\n} from './locale.js';\nimport { Button, Tag } from '@deepseek-ai/dsh-client-ui-primitives';\nimport { Tooltip } from '../../../client/src/client/ds/tooltip.js';\nimport { SidebarCardList, SidebarCardRow } from '../../../client/src/client/sidebar-card.js';\nimport type { Context as ClientContext } from '@deepseek-ai/cordis';\nimport type {} from '@deepseek-ai/dsh-client-ui-settings/client';\n\nimport { COMPUTER_SETTINGS_NAMESPACE, type ComputerSettings } from '../settings.js';\nimport type { ComputerStorage } from '../provider.js';\nimport {\n ComputerSettingsPrefs,\n ComputerSettingsRows,\n createComputerSettingsFace,\n type ComputerSettingsScope,\n} from './settings-rows.js';\nimport { LocalComputerStatus } from './local-computer.js';\nimport { useMountedResource } from './mounted-resource.js';\nimport { recordViewerOpen } from '../../../client/src/client/telemetry-surface.js';\n\nimport { AccessPowerIcon } from './access-power-icon.js';\nimport { STYLEX_CSS } from '../../../client/src/client/ds/stylex-css.js';\n\nconst ACCESS_STYLE = `\n.bh-computer-access-control { position: relative; display: flex; align-items: center; }\n.bh-computer-access-power {\n display: flex; align-items: center; justify-content: center; width: 28px; height: 28px;\n padding: 0; border: 0; border-radius: ${radius.md}; background: transparent;\n color: ${color.muted}; cursor: pointer;\n}\n.bh-computer-access-power:hover { background: ${color.hover}; }\n.bh-computer-access-power[aria-pressed='true'] { color: ${color.accent}; background: ${color.hover}; }\n.bh-computer-access-power:focus-visible { outline: ${border.focus} solid ${color.accent}; outline-offset: 2px; }\n.bh-computer-access-power:disabled { opacity: 0.5; cursor: default; }\n.bh-computer-access-power.bh-access-failed { color: ${color.danger}; }\n.bh-computer-access-error { order: -1; padding: 0 ${space.x2}; color: ${color.danger}; font-size: ${text.metaSize}; line-height: ${text.metaLine}; white-space: nowrap; }\n\n`;\n\nexport const name = 'botharness-computer-client';\n\nexport const inject = ['slots', 'channelSidebar', 'connection', 'locale'];\n\nconst STATUS_ENDPOINT = './api/computer/status';\nconst START_ENDPOINT = './api/computer/start';\nconst STOP_ENDPOINT = './api/computer/stop';\nconst VIEWER_SRC = './botharness-computer/viewer/';\nconst APPROVED_KEY = 'botharness-computer-start-approved';\nconst ENTRY_ID = 'botharness-computer';\n\ntype ComputerState = 'absent' | 'stopped' | 'running' | 'failed';\ntype ComputerPhase =\n | 'idle'\n | 'pulling'\n | 'starting'\n | 'running'\n | 'stopping'\n | 'exporting'\n | 'importing'\n | 'failed';\n\ninterface ComputerProgress {\n readonly percent?: number;\n readonly text?: string;\n readonly updatedAt?: number;\n}\n\ninterface ComputerStatusPayload {\n readonly target?: 'local' | 'container';\n resolution?: string;\n readonly provider: string | null;\n readonly probe: { readonly available: boolean; readonly detail?: string };\n readonly exportDir?: string;\n readonly status: {\n readonly state: ComputerState;\n readonly phase?: ComputerPhase;\n readonly detail?: string;\n readonly progress?: ComputerProgress;\n readonly storage?: ComputerStorage;\n };\n}\n\ninterface ChannelSidebarEntryProps {\n readonly scope: 'channel' | 'personabot';\n readonly channelId: string;\n readonly botSlug: string | undefined;\n readonly actions: unknown;\n readonly setExpanded?: (expanded: boolean) => void;\n readonly setExpandable?: (expandable: boolean) => void;\n}\n\ninterface ConnectionRpcLike {\n call(\n channel: string,\n endpoint: string,\n payload: unknown,\n signal?: AbortSignal,\n ): Promise<\n | { readonly ok: true; readonly value: unknown }\n | { readonly ok: false; readonly error: { readonly message?: string } }\n >;\n}\n\nlet connectionRpc: ConnectionRpcLike | undefined;\n\ninterface ChannelSidebarRegistryLike {\n register(entry: {\n readonly id: string;\n readonly label: string;\n readonly icon?: string;\n readonly order?: number;\n readonly scope: 'channel' | 'personabot';\n readonly component: ComponentType;\n readonly headerAction?: ComponentType;\n readonly badge?: ComponentType;\n readonly tab?: string;\n }): () => void;\n}\n\nasync function requestJson(url: string, init?: RequestInit): Promise {\n const response = await fetch(url, { credentials: 'same-origin', ...init });\n if (!response.ok) throw new Error(`${String(response.status)} ${await response.text()}`);\n return (await response.json()) as T;\n}\n\nconst SETUP_GUIDANCE_KEY: ComputerKey = 'entry.setup';\n\nconst SHARED_NOTE_KEY: ComputerKey = 'entry.shared';\n\nconst AUTHORIZATION_POINTS: readonly ComputerKey[] = [\n 'entry.authorize.probe',\n 'entry.authorize.volume',\n 'entry.authorize.pull',\n 'entry.authorize.bind',\n];\n\nconst noteStyle: CSSProperties = { opacity: 0.7, fontSize: 12, whiteSpace: 'pre-wrap' };\nconst buttonStyle: CSSProperties = {\n padding: '4px 10px',\n borderRadius: 6,\n border: `1px solid ${BH.borderL3}`,\n background: 'transparent',\n color: 'inherit',\n cursor: 'pointer',\n fontSize: 12,\n};\nconst terminalStyle: CSSProperties = {\n fontFamily: 'ui-monospace, SFMono-Regular, Menlo, monospace',\n fontSize: 11,\n opacity: 0.7,\n whiteSpace: 'pre-wrap',\n wordBreak: 'break-all',\n};\n\nconst DESIGN_WIDTH = 1280;\nconst DESIGN_HEIGHT = 800;\n\nfunction designOf(resolution: string | undefined): { width: number; height: number } {\n const match = /^(\\d{2,5})x(\\d{2,5})$/u.exec(resolution ?? '');\n if (match === null) return { width: DESIGN_WIDTH, height: DESIGN_HEIGHT };\n return { width: Number(match[1]), height: Number(match[2]) };\n}\n\nexport interface RecentLogRow {\n readonly id: number;\n readonly ts: number;\n readonly plugin: string;\n readonly owner: string;\n readonly kind: string;\n readonly detail: string;\n}\n\nexport function RecentLogsList({\n entries,\n}: {\n readonly entries: readonly RecentLogRow[];\n}): ReactElement {\n return (\n
\n {entries.map((entry) => (\n
\n {new Date(entry.ts).toLocaleTimeString()} [{entry.kind}] {entry.detail}\n
\n ))}\n
\n );\n}\n\nexport function RecentLogs({ t }: { readonly t: ComputerTranslate }): ReactElement {\n const [open, setOpen] = useState(false);\n const [entries, setEntries] = useState(undefined);\n const [failed, setFailed] = useState(false);\n const loadResource = useMountedResource(() => {\n const controller = new AbortController();\n requestJson<{ entries: RecentLogRow[] }>('./api/computer/logs?limit=10', {\n signal: controller.signal,\n })\n .then((result) => {\n if (!controller.signal.aborted) setEntries(result.entries);\n })\n .catch(() => {\n if (!controller.signal.aborted) setFailed(true);\n });\n return () => controller.abort();\n }, []);\n return (\n
\n {open && entries === undefined && !failed ?
\n );\n}\n\nexport {\n ScreenIndicator,\n StreamOverlay,\n ViewerTitleBar,\n} from '../../../client/src/client/remote-viewer/index.js';\n\nfunction RunningCard({\n t,\n botSlug,\n busy,\n stopping,\n resolution,\n onStop,\n}: {\n readonly t: ComputerTranslate;\n readonly botSlug: string | undefined;\n readonly busy: boolean;\n readonly stopping: boolean;\n readonly resolution?: string;\n readonly onStop: () => void;\n}): ReactElement {\n const onEvent = useCallback((event: ViewerLifecycleEvent) => {\n void reportViewerEvent(undefined, viewerEventText(event));\n }, []);\n return (\n }\n onEvent={onEvent}\n />\n );\n}\n\nexport interface ComputerEntryViewProps {\n readonly t: ComputerTranslate;\n readonly state: ComputerState;\n readonly phase?: ComputerPhase;\n readonly detail?: string;\n readonly progress?: ComputerProgress;\n readonly runtimeAvailable: boolean;\n readonly confirming: boolean;\n readonly busy: boolean;\n readonly elapsed: number;\n readonly nowTs: number;\n readonly error?: string;\n readonly botSlug?: string;\n readonly storage?: ComputerStorage;\n readonly resolution?: string;\n readonly onStart: () => void;\n readonly onConfirmStart: () => void;\n readonly onStop: () => void;\n readonly onApprove: (remember: boolean) => void;\n readonly onCancel: () => void;\n}\n\nexport function ComputerEntryView(props: ComputerEntryViewProps): ReactElement {\n const {\n t,\n state,\n phase,\n detail,\n progress,\n runtimeAvailable,\n confirming,\n busy,\n elapsed,\n nowTs,\n error,\n botSlug,\n storage,\n resolution,\n onStart,\n onConfirmStart,\n onStop,\n onApprove,\n onCancel,\n } = props;\n\n const title = t('rows.target.container');\n const card = (\n chip: ReactElement,\n rest: { meta?: ReactNode; detail?: ReactNode },\n ): ReactElement => (\n \n \n \n );\n\n if (!runtimeAvailable) {\n return card({t('entry.chip.setup')}, {\n detail:
{t(SETUP_GUIDANCE_KEY)}
,\n });\n }\n\n if (confirming) {\n return card({t('entry.chip.authorize')}, {\n detail: (\n
\n
{t('entry.authorizeIntro')}
\n
    \n {AUTHORIZATION_POINTS.map((point) => (\n
  • {t(point)}
  • \n ))}\n
\n {storage === undefined ? null : (\n
\n {t('entry.authorize.storage', { target: storage.target })}\n {storage.ignoredReason === undefined ? '' : `(${storage.ignoredReason})`}\n
\n )}\n {storage?.migrationHint === undefined ? null : (\n
{storage.migrationHint}
\n )}\n {storage?.kind === 'bind' ? (\n
{t('entry.authorize.storageBindRisk')}
\n ) : null}\n \n
\n \n \n
\n
\n ),\n });\n }\n\n const inProgress =\n phase === 'pulling' ||\n phase === 'starting' ||\n phase === 'stopping' ||\n phase === 'exporting' ||\n phase === 'importing';\n\n if (state === 'running') {\n return (\n
\n {card({t('entry.chip.running')}, {\n meta: t('entry.screen.title', { name: botSlug ?? 'PersonaBot' }),\n })}\n \n
\n );\n }\n\n if (inProgress) {\n return card({t(PHASE_LABEL[phase] ?? 'entry.phase.working')}, {\n meta: (\n \n {t('entry.elapsed', { seconds: elapsed })}\n {progress?.updatedAt === undefined\n ? ''\n : ` · ${t('entry.updated', {\n seconds: Math.max(0, Math.round((nowTs - progress.updatedAt) / 1000)),\n })}`}\n \n ),\n detail: (\n
\n \n \n
\n
{progress?.text ?? detail ?? t('entry.wait')}
\n \n ),\n });\n }\n\n const failed = error !== undefined || state === 'failed';\n return card(\n failed ? (\n {t('entry.chip.failed')}\n ) : (\n {t('entry.chip.stopped')}\n ),\n {\n meta: (\n \n {error ?? (isExitReport(detail) ? undefined : detail) ?? t(SHARED_NOTE_KEY)}\n \n ),\n detail: (\n \n ),\n },\n );\n}\n\nexport function createComputerEntry(\n t: ComputerTranslate,\n): (props: ChannelSidebarEntryProps) => ReactElement {\n return function ComputerEntryWithLocale(props: ChannelSidebarEntryProps): ReactElement {\n const { computerAccess } = useBotInfo(props.botSlug);\n if (computerAccess === false)\n return {t('entry.access.description')};\n return ;\n };\n}\n\nexport function createComputerBadge(\n t: ComputerTranslate,\n): (props: ChannelSidebarEntryProps) => ReactElement | null {\n return function ComputerBadge({ botSlug }: ChannelSidebarEntryProps): ReactElement | null {\n const { computerAccess } = useBotInfo(botSlug);\n if (computerAccess !== true) return null;\n return (\n \n );\n };\n}\n\ninterface BotInfo {\n readonly displayName: string | undefined;\n readonly computerAccess: boolean | undefined;\n}\n\ninterface ReadableStore {\n subscribe(listener: () => void): () => void;\n getSnapshot(): T;\n}\n\nconst botInfoStores = new Map<\n string,\n ReadableStore & { setAccess(enabled: boolean): void }\n>();\n\nfunction botInfoStore(\n botSlug: string | undefined,\n): ReadableStore & { setAccess(enabled: boolean): void } {\n const key = botSlug ?? '';\n const existing = botInfoStores.get(key);\n if (existing !== undefined) return existing;\n const created = createBotInfoStore(botSlug);\n botInfoStores.set(key, created);\n return created;\n}\n\nfunction createBotInfoStore(\n botSlug: string | undefined,\n): ReadableStore & { setAccess(enabled: boolean): void } {\n let info: BotInfo = { displayName: undefined, computerAccess: undefined };\n const listeners = new Set<() => void>();\n let loadedAt = Number.NEGATIVE_INFINITY;\n const load = (): void => {\n const rpc = connectionRpc;\n if (rpc === undefined || botSlug === undefined) return;\n void rpc\n .call('/api', 'botharness/list', { args: {} })\n .then((result) => {\n if (!result.ok) return;\n const value = result.value as {\n bots?: readonly { slug?: unknown; displayName?: unknown; computerAccess?: unknown }[];\n };\n const match = (value.bots ?? []).find((bot) => bot.slug === botSlug);\n if (match === undefined) return;\n info = {\n displayName:\n typeof match.displayName === 'string' && match.displayName.length > 0\n ? match.displayName\n : undefined,\n computerAccess: match.computerAccess === true,\n };\n for (const listener of listeners) listener();\n })\n .catch(() => undefined);\n };\n return {\n setAccess(enabled) {\n info = { ...info, computerAccess: enabled };\n for (const listener of listeners) listener();\n },\n subscribe(listener) {\n if (listeners.size === 0 && Date.now() - loadedAt > 5000) {\n loadedAt = Date.now();\n load();\n }\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n getSnapshot: () => info,\n };\n}\n\nfunction useBotInfo(botSlug: string | undefined): BotInfo {\n const store = botInfoStore(botSlug);\n const info = useSyncExternalStore(store.subscribe, store.getSnapshot);\n return { displayName: info.displayName ?? botSlug, computerAccess: info.computerAccess };\n}\n\nfunction ComputerHeaderAction({\n botSlug,\n t,\n setExpandable,\n setExpanded,\n}: ChannelSidebarEntryProps & { t: ComputerTranslate }): ReactElement {\n const store = botInfoStore(botSlug);\n const [busy, setBusy] = useState(false);\n const inFlight = useRef(false);\n const [error, setError] = useState(false);\n const subscribe = (listener: () => void): (() => void) => {\n const sync = (): void => {\n setExpandable?.(store.getSnapshot().computerAccess !== undefined);\n };\n const unsubscribe = store.subscribe(() => {\n sync();\n listener();\n });\n sync();\n return unsubscribe;\n };\n const info = useSyncExternalStore(subscribe, store.getSnapshot);\n const accessOn = info.computerAccess === true;\n\n const onToggle = (next: boolean): void => {\n const rpc = connectionRpc;\n if (rpc === undefined || botSlug === undefined || inFlight.current) return;\n inFlight.current = true;\n setBusy(true);\n setError(false);\n void rpc\n .call('/api', 'botharness/computerAccessSet', { args: { slug: botSlug, enabled: next } })\n .then((result) => {\n if (!result.ok) {\n setError(true);\n return;\n }\n const value = result.value as { bot?: { computerAccess?: unknown } };\n const applied = value.bot?.computerAccess === true;\n store.setAccess(applied);\n setExpanded?.(applied);\n })\n .catch(() => {\n setError(true);\n })\n .finally(() => {\n inFlight.current = false;\n setBusy(false);\n });\n };\n\n const label = t(accessOn ? 'entry.access.disable' : 'entry.access.enable');\n return (\n \n \n onToggle(!accessOn)}\n >\n \n \n \n {error ? (\n \n {t('entry.access.failureHint')}\n \n ) : null}\n \n );\n}\n\nexport function createComputerHeader(\n t: ComputerTranslate,\n): (props: ChannelSidebarEntryProps) => ReactElement {\n return function ComputerHeaderWithLocale(props: ChannelSidebarEntryProps): ReactElement {\n return ;\n };\n}\n\nfunction ComputerEntry({\n botSlug,\n t,\n}: ChannelSidebarEntryProps & { t: ComputerTranslate }): ReactElement {\n const { displayName } = useBotInfo(botSlug);\n const [payload, setPayload] = useState();\n const [error, setError] = useState();\n const [busy, setBusy] = useState(false);\n const [confirming, setConfirming] = useState(false);\n const [approved, setApproved] = useState(\n () => globalThis.sessionStorage?.getItem(APPROVED_KEY) === '1',\n );\n const [elapsed, setElapsed] = useState(0);\n const [nowTs, setNowTs] = useState(() => Date.now());\n const refresh = useCallback(async (signal?: AbortSignal) => {\n try {\n const next = await requestJson(\n STATUS_ENDPOINT,\n signal === undefined ? undefined : { signal },\n );\n if (signal?.aborted) return;\n setPayload(next);\n setError(undefined);\n } catch (cause) {\n if (!signal?.aborted) setError(String(cause));\n }\n }, []);\n\n const statusResource = useMountedResource(() => {\n recordViewerOpen(connectionRpc, 'computer');\n const controller = new AbortController();\n let pending = false;\n const poll = async (): Promise => {\n if (pending || controller.signal.aborted) return;\n pending = true;\n try {\n await refresh(AbortSignal.any([controller.signal, AbortSignal.timeout(10_000)]));\n } finally {\n pending = false;\n }\n };\n void poll();\n const timer = setInterval(() => void poll(), 3000);\n return () => {\n controller.abort();\n clearInterval(timer);\n };\n }, [refresh]);\n\n const phase = payload?.status.phase;\n const inProgress =\n phase === 'pulling' ||\n phase === 'starting' ||\n phase === 'stopping' ||\n phase === 'exporting' ||\n phase === 'importing';\n\n const progressResource = useMountedResource(() => {\n const startedAt = Date.now();\n setElapsed(0);\n const timer = setInterval(() => {\n setNowTs(Date.now());\n setElapsed(Math.round((Date.now() - startedAt) / 1000));\n }, 1000);\n return () => clearInterval(timer);\n }, [inProgress]);\n\n const act = useCallback(\n async (endpoint: string) => {\n setBusy(true);\n try {\n await requestJson(endpoint, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({\n authorize: true,\n ...(endpoint === START_ENDPOINT && typeof navigator !== 'undefined'\n ? { language: navigator.language }\n : {}),\n }),\n });\n await refresh();\n } catch (cause) {\n setError(String(cause));\n } finally {\n setBusy(false);\n }\n },\n [refresh],\n );\n\n const onStart = useCallback(() => {\n if (!approved) {\n setConfirming(true);\n return;\n }\n void act(START_ENDPOINT);\n }, [act, approved]);\n\n const onConfirmStart = useCallback(() => {\n setConfirming(false);\n void act(START_ENDPOINT);\n }, [act]);\n\n const onApprove = useCallback((remember: boolean) => {\n if (remember) {\n globalThis.sessionStorage?.setItem(APPROVED_KEY, '1');\n setApproved(true);\n }\n }, []);\n\n return (\n
\n {inProgress ?
\n );\n}\n\nexport function apply(ctx: ClientContext): void {\n botInfoStores.clear();\n const settingsPrefs = new ComputerSettingsPrefs();\n ctx.inject(['configForms'], (settingsCtx) => {\n const scope = settingsCtx.configForms.get(\n COMPUTER_SETTINGS_NAMESPACE,\n ) as unknown as ComputerSettingsScope;\n const release = settingsPrefs.attach(scope);\n return () => {\n release();\n };\n });\n ctx.inject(['uiWorkspace', 'slots'], (workspaceCtx) => {\n const workspace = (\n workspaceCtx as unknown as { uiWorkspace?: { pickDirectory?: () => Promise } }\n ).uiWorkspace;\n const face = createComputerSettingsFace({\n prefs: settingsPrefs,\n pickDirectory: workspace?.pickDirectory?.bind(workspace),\n });\n workspaceCtx.slots.inject('botharness.settings.section', () =>\n workspaceCtx.slots.register(\n {\n name: 'botharness.settings.section',\n id: 'computer',\n order: 30,\n label: () => t('section.title'),\n locale: LOCALE_NS,\n inject: () => face,\n },\n ComputerSettingsRows,\n ),\n );\n });\n ctx.effect(() => {\n if (typeof document === 'undefined') return () => {};\n const style = document.createElement('style');\n style.setAttribute('data-botharness-computer', 'client');\n style.dataset.plugin = '@botharness/computer';\n style.dataset.pluginCss = '@botharness/computer/client.css';\n style.textContent = ACCESS_STYLE + STYLEX_CSS;\n document.head.appendChild(style);\n return () => {\n style.remove();\n };\n }, 'botharness-computer: client styles');\n const t = ctx.locale.bind(LOCALE_NS);\n ctx.effect(() => ctx.locale.register(LOCALE_NS, { zh, en }), 'botharness-computer: dictionaries');\n ctx.inject(['channelSidebar', 'connection'], (sidebarCtx) => {\n const registry = (sidebarCtx as unknown as { channelSidebar?: ChannelSidebarRegistryLike })\n .channelSidebar;\n connectionRpc = (sidebarCtx as unknown as { connection?: { rpc?: ConnectionRpcLike } })\n .connection?.rpc;\n if (registry === undefined) return;\n ctx.effect(\n () =>\n registry.register({\n id: ENTRY_ID,\n icon: 'monitor',\n label: t('entry.label'),\n order: 40,\n scope: 'personabot',\n component: createComputerEntry(t),\n headerAction: createComputerHeader(t),\n badge: createComputerBadge(t),\n tab: 'screen',\n }),\n 'botharness-computer: channel sidebar entry',\n );\n });\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;EAAA,IAAI,SAAS,CAAC;EAEd,IAAI;EAEJ,SAAS,gBAAiB;GACzB,IAAI,mBAAmB,OAAO;GAC9B,oBAAoB;GAEpB,OAAO,eAAe,QAAQ,cAAc,EAC1C,OAAO,KACT,CAAC;GACD,OAAO,SAAS,KAAK;GACrB,IAAI,wBAAQ,IAAI,QAAQ;GACxB,IAAI,cAAc;GAClB,SAAS,aAAa,SAAS;IAC7B,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI,WAAW,MAAM;KACnB,eAAe,QAAQ,iBAAiB;KACxC,aAAa,QAAQ,eAAe;KACpC,YAAY,QAAQ;IACtB;IACA,OAAO,SAAS,SAAS;KACvB,IAAI,oBAAoB,CAAC;KACzB,IAAI,YAAY;KAChB,IAAI,cAAc;KAClB,IAAI,cAAc;KAClB,IAAI,YAAY,eAAe,OAAO;KACtC,IAAI,SAAS,IAAI,MAAM,UAAU,MAAM;KACvC,KAAK,IAAI,IAAI,GAAG,IAAI,UAAU,QAAQ,KACpC,OAAO,KAAK,UAAU;KAExB,OAAO,OAAO,SAAS,GAAG;MACxB,IAAI,gBAAgB,OAAO,IAAI;MAC/B,IAAI,iBAAiB,QAAQ,kBAAkB,OAC7C;MAEF,IAAI,MAAM,QAAQ,aAAa,GAAG;OAChC,KAAK,IAAI,KAAK,GAAG,KAAK,cAAc,QAAQ,MAC1C,OAAO,KAAK,cAAc,GAAG;OAE/B;MACF;MACA,IAAI,QAAQ,aAAa,OAAO,UAAU,aAAa,IAAI;MAC3D,IAAI,MAAM,SAAS,MAAM;OACvB,IAAI,iBAAiB;OACrB,IAAI,aA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J,GAAG;IACL,CACF;GACF;GACA,mBAAmB,CACjB,CACE,QACA,EACE,GAAG,sHACL,CACF,GACA,CACE,QACA,EACE,GAAG,yGACL,CACF,CACF;GACA,OAAO,CACL,CACE,YACA,EACE,QAAQ,oCACV,CACF,GACA,CACE,QACA,EACE,GAAG,6GACL,CACF,CACF;GACA,cAAc;IACZ,CACE,QACA,EACE,GAAG,6GACL,CACF;IACA,CACE,QACA,EACE,GAAG,WACL,CACF;IACA,CACE,QACA,EACE,GAAG,WACL,CACF;IACA,CACE,UACA;KACE,IAAI;KACJ,IAAI;KACJ,GAAG;IACL,CACF;GACF;GACA,OAAO;IACL,CACE,QACA,EACE,GAAG,4CACL,CACF;IACA,CACE,QACA,EACE,GAAG,8BACL,CACF;IACA,CACE,QACA,EACE,GAAG,6BACL,CACF;IACA,CACE,UACA;KACE,IAAI;KACJ,IAAI;KACJ,GAAG;IACL,CACF;GACF;GACA,cAAc;IACZ,CACE,QACA,EACE,GAAG,WACL,CACF;IACA,CACE,QACA,EACE,GAAG,WACL,CACF;IACA,CACE,UACA;KACE,IAAI;KACJ,IAAI;KACJ,GAAG;IACL,CACF;IACA,CACE,UACA;KACE,IAAI;KACJ,IAAI;KACJ,GAAG;IACL,CACF;GACF;GACA,UAAU,CACR,CACE,QACA,EACE,GAAG,0UACL,CACF,GACA,CACE,UACA;IACE,IAAI;IACJ,IAAI;IACJ,GAAG;GACL,CACF,CACF;GACA,SAAS;IACP,CACE,QACA;KACE,OAAO;KACP,QAAQ;KACR,GAAG;KACH,GAAG;KACH,IAAI;IACN,CACF;IACA,CACE,QACA;KACE,IAAI;KACJ,IAAI;KACJ,IAAI;KACJ,IAAI;IACN,CACF;IACA,CACE,QACA;KACE,IAAI;KACJ,IAAI;KACJ,IAAI;KACJ,IAAI;IACN,CACF;GACF;GACA,OAAO;IACL,CACE,UACA;KACE,IAAI;KACJ,IAAI;KACJ,GAAG;IACL,CACF;IACA,CACE,QACA,EACE,GAAG,kDACL,CACF;IACA,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a,CAAC;IACnD,MAAM,QAAQ,SAAS,cAAc,OAAO;IAC5C,MAAM,aAAa,4BAA4B,QAAQ;IACvD,MAAM,QAAQ,SAAS;IACvB,MAAM,QAAQ,YAAY;IAC1B,MAAM,cAAc,eAAe;IACnC,SAAS,KAAK,YAAY,KAAK;IAC/B,aAAa;KACX,MAAM,OAAO;IACf;GACF,GAAG,oCAAoC;GACvC,MAAM,IAAI,IAAI,OAAO,KAAK,SAAS;GACnC,IAAI,aAAa,IAAI,OAAO,SAAS,WAAW;IAAE;IAAI;GAAG,CAAC,GAAG,mCAAmC;GAChG,IAAI,OAAO,CAAC,kBAAkB,YAAY,IAAI,eAAe;IAC3D,MAAM,WAAY,WACf;IACH,gBAAiB,WACd,YAAY;IACf,IAAI,aAAa,KAAA,GAAW;IAC5B,IAAI,aAEA,SAAS,SAAS;KAChB,IAAI;KACJ,MAAM;KACN,OAAO,EAAE,aAAa;KACtB,OAAO;KACP,OAAO;KACP,WAAW,oBAAoB,CAAC;KAChC,cAAc,qBAAqB,CAAC;KACpC,OAAO,oBAAoB,CAAC;KAC5B,KAAK;IACP,CAAC,GACH,4CACF;GACF,CAAC;EACH"} \ No newline at end of file From 87298f5991882e34a3d8432916982116aad271e7 Mon Sep 17 00:00:00 2001 From: DoodleBear Date: Mon, 16 Nov 2026 08:37:51 +0900 Subject: [PATCH 5/6] fix(client): route Team invitations in Add Host to the sign-in stepper The Add Host dialog pairs through the reciprocal relationship path, which rejected Team invitations as invalid pairing links. It now recognises a Team invitation first and opens the stepper, or explains why the invitation cannot be used. The stepper names the Host and username and drops the duplicate Cancel when embedded in settings. Issue: #4201 Co-Authored-By: Claude Opus 5.5 --- packages/client/src/client/host-tabs.tsx | 30 +++++++++----- .../client/src/client/team-sign-in-dialog.tsx | 40 +++++++++++++------ .../client/test/team-sign-in-dialog.test.ts | 24 +++++++++++ 3 files changed, 72 insertions(+), 22 deletions(-) diff --git a/packages/client/src/client/host-tabs.tsx b/packages/client/src/client/host-tabs.tsx index 044be344f3..d97e949c5c 100644 --- a/packages/client/src/client/host-tabs.tsx +++ b/packages/client/src/client/host-tabs.tsx @@ -21,7 +21,8 @@ import { useThisHost, getThisHost } from './this-host.js'; import { useMountedResource } from './mounted-resource.js'; import { createConnectionControl, type ConnectionAttempt } from './connection-control.js'; import { ConnectionProgress } from './connection-progress.js'; -import { TeamSignInDialog } from './team-sign-in-dialog.js'; +import { TeamSignInDialog, teamSignInErrorText } from './team-sign-in-dialog.js'; +import { parseTeamInvitation } from '@botharness/host-protocol/team-invitation'; import type { TeamSignInTarget } from '@botharness/host-client/team-sign-in'; export { useThisHost } from './this-host.js'; import { HostGlyph } from './host-glyph.js'; @@ -344,6 +345,18 @@ const PAIR_ERRORS: Partial> = { 'this-host': 'remoteHosts.error.this-host', }; +export function teamInvitationLink( + link: string, +): ReturnType | undefined { + try { + const url = new URL(link.trim()); + if (url.protocol !== 'deepseekbot:' || url.hostname !== 'team') return undefined; + } catch { + return undefined; + } + return parseTeamInvitation(link.trim()); +} + export function AddRemoteHostDialog({ onClose, onBack, @@ -365,7 +378,6 @@ export function AddRemoteHostDialog({ const [error, setError] = useState(); const control = useRef>(); const attemptId = useRef(); - const attemptLink = useRef(''); const [team, setTeam] = useState(); const [manual, setManual] = useState<{ route: string; username: string }>(); const mount = useMountedResource(() => { @@ -375,12 +387,6 @@ export function AddRemoteHostDialog({ const off = owner.subscribe(() => { if (!attemptId.current) return; const next = owner.getSnapshot(attemptId.current); - if (next?.state === 'failed' && next.code === 'team-sign-in-required') { - attemptId.current = undefined; - setAttempt(undefined); - setTeam({ kind: 'invitation', link: attemptLink.current }); - return; - } setAttempt(next); if (next?.state === 'connected' && next.hostId) { const looks = hostLooks(); @@ -428,8 +434,13 @@ export function AddRemoteHostDialog({ request, ); } else { + const invitation = teamInvitationLink(link); + if (invitation !== undefined) { + if (invitation.ok) setTeam({ kind: 'invitation', link: link.trim() }); + else setError(teamSignInErrorText(t, invitation.code)); + return; + } attemptId.current = crypto.randomUUID(); - attemptLink.current = link.trim(); owner.execute({ action: 'start', attemptId: attemptId.current, link }, request); } } catch { @@ -459,6 +470,7 @@ export function AddRemoteHostDialog({ title={t('teamSignIn.titleGeneric')} description={t('teamSignIn.manualHint')} inline={inline} + showCancel={!inline} footerContainer={footerContainer} labels={{ close: t('common.close'), cancel: t('connections.back') }} submitLabel={t('teamSignIn.continue')} diff --git a/packages/client/src/client/team-sign-in-dialog.tsx b/packages/client/src/client/team-sign-in-dialog.tsx index e1cf88e01b..2d974ec508 100644 --- a/packages/client/src/client/team-sign-in-dialog.tsx +++ b/packages/client/src/client/team-sign-in-dialog.tsx @@ -187,6 +187,7 @@ export function TeamSignInDialog({ ); const submitLabel: BotHarnessKey = - state.kind === 'fingerprint' - ? 'connect.matches' - : state.kind === 'sign-in' - ? 'teamSignIn.signIn' - : state.kind === 'password-change' - ? 'teamSignIn.changeSubmit' - : 'teamSignIn.finish'; + flow === undefined + ? 'teamSignIn.continue' + : state.kind === 'fingerprint' + ? 'connect.matches' + : state.kind === 'sign-in' + ? 'teamSignIn.signIn' + : state.kind === 'password-change' + ? 'teamSignIn.changeSubmit' + : 'teamSignIn.finish'; const ready = flow !== undefined && (state.kind === 'fingerprint' || @@ -224,6 +227,7 @@ export function TeamSignInDialog({ hostName === '' ? t('teamSignIn.titleGeneric') : t('teamSignIn.title', { host: hostName }) } inline={inline} + showCancel={!inline} footerContainer={footerContainer} labels={{ close: t('common.close'), cancel: t('common.cancel') }} submitLabel={t(submitLabel)} @@ -247,9 +251,14 @@ export function TeamSignInDialog({ ) : null ) : state.kind === 'fingerprint' ? ( <> -

- {t('teamSignIn.as', { username: state.username })} -

+
+

+ {state.host.name} +

+

+ {t('teamSignIn.as', { username: state.username })} +

+

{t('teamSignIn.fingerprintHint')}

{state.host.fingerprint} @@ -257,9 +266,14 @@ export function TeamSignInDialog({ ) : state.kind === 'sign-in' ? ( <> -

- {t('teamSignIn.as', { username: state.username })} -

+
+

+ {state.host.name} +

+

+ {t('teamSignIn.as', { username: state.username })} +

+
({ })); import { TeamSignInDialog } from '../src/client/team-sign-in-dialog.js'; +import { teamInvitationLink } from '../src/client/host-tabs.js'; import { zhTranslate } from '../src/client/locale.js'; const host = { id: 'h-team', name: 'Acme', fingerprint: 'AAAA BBBB CCCC' }; @@ -215,4 +216,27 @@ describe('Team sign-in dialog', () => { await act(async () => again.unmount()); container.remove(); }); + + it('recognises Team invitations before the pairing path sees them', () => { + const payload = Buffer.from( + JSON.stringify({ + v: 1, + host: { + id: 'h-team', + name: 'Acme', + fingerprint: '1c46 d94c f1d1 4ffe 7838 53c4 99a8 3f95 e570 d6cd dad3 8d54 19d3 c97f b4ed a407', + }, + routes: [], + username: 'alice', + expiresAt: new Date(Date.now() + 60_000).toISOString(), + }), + ).toString('base64url'); + expect(teamInvitationLink(`deepseekbot://team?i=${payload}`)?.ok).toBe(true); + expect(teamInvitationLink('deepseekbot://team?i=***')).toEqual({ + ok: false, + code: 'invitation-invalid', + }); + expect(teamInvitationLink('deepseekbot://pair?p=abc')).toBeUndefined(); + expect(teamInvitationLink('not a link')).toBeUndefined(); + }); }); From a2541122d7749e712f8cac03e1f85361e2976a85 Mon Sep 17 00:00:00 2001 From: DoodleBear Date: Mon, 16 Nov 2026 08:55:46 +0900 Subject: [PATCH 6/6] fix(docs): keep generated private deployment guide pages untracked The package extraction commit re-added four generated pages that main stopped tracking. Issue: #4201 Co-Authored-By: Claude Opus 5.5 --- .../docs-zh/docs/private-named-tunnel.mdx | 66 ---------------- .../content/docs-zh/docs/private-relay.mdx | 78 ------------------- .../docs/docs/private-named-tunnel.mdx | 66 ---------------- .../src/content/docs/docs/private-relay.mdx | 78 ------------------- 4 files changed, 288 deletions(-) delete mode 100644 apps/docs/src/content/docs-zh/docs/private-named-tunnel.mdx delete mode 100644 apps/docs/src/content/docs-zh/docs/private-relay.mdx delete mode 100644 apps/docs/src/content/docs/docs/private-named-tunnel.mdx delete mode 100644 apps/docs/src/content/docs/docs/private-relay.mdx diff --git a/apps/docs/src/content/docs-zh/docs/private-named-tunnel.mdx b/apps/docs/src/content/docs-zh/docs/private-named-tunnel.mdx deleted file mode 100644 index f371de3cb0..0000000000 --- a/apps/docs/src/content/docs-zh/docs/private-named-tunnel.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -title: "Cloudflare Named Tunnel" -description: "手动或通过自己的 agent 配置固定隧道。" -sidebar: - order: 15 ---- - -使用自己 Cloudflare 账号下的固定主机名。Tobs 在电脑上运行内置 cloudflared,主动向 Cloudflare 建立出站隧道。手机访问该 HTTPS 主机名,再经隧道连接 Host 的加密设备通道,家中电脑不需要公网入站端口。这种方式使用 Cloudflare 基础设施,不依赖官方 Tobs Connect。 - -其他选择:[私有连接总览](private-connect.zh.md)、[HTTPS 入口](private-ingress.zh.md)、[Docker Relay](private-relay.zh.md)。 - -## 准备 - -- 按[安装教程](https://tobs.app/docs/installation/)准备 Tobs 与手机 App,保留现有 Host Profile。 -- Cloudflare 账号、该账号下的域名、未使用的主机名(例如 `bot.example.com`),以及创建 Tunnel/DNS 路由的权限。 -- 电脑到 Cloudflare 的出站连通性。域名注册和服务商费用另算,不保证所有账号或网络都免费可用。 - -控制台操作以当前 [Cloudflare 官方教程](https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/get-started/create-remote-tunnel/)为准。不要执行其中的连接器安装命令,Tobs 会运行自己的连接器。 - -## 配置固定地址 - -1. 在 Cloudflare One 打开 **Networks → Connectors → Cloudflare Tunnels**(控制台名称可能变化),创建 Cloudflared Tunnel,私下保管连接器令牌。 -2. 打开 **Bot 设置 → 连接 → 添加连接 → 用手机连接这台电脑 → 已安装 App,开始连接 → 进阶方式 → 固定 Cloudflare Tunnel**。旧版本入口为**私有连接 → 固定地址**。 -3. 填写纯主机名,例如 `bot.example.com`,在受保护字段填写连接器令牌并保存,记下 Tobs 的专用设备网关端口。完成下一步前,公网检查可能失败。 -4. 在该 Tunnel 的 **Published application routes**(旧称 Public Hostname)中,将主机名指向 HTTP 服务 `http://127.0.0.1:PORT`,把 `PORT` 换成 Tobs 实际显示的端口。连接器在 Host 上运行,loopback 指的就是 Host。不要转发 DSH 网页/管理端口。 -5. 等 Tobs 公网检查通过后显示手机配对码,完成[所选连接验证](private-connect.zh.md#验证所选连接)。 - -交互式 Cloudflare Access 登录页可能拦住手机 WebSocket,只使用已明确兼容手机的路径。拥有主机名或服务商账号不等于获得 Host 控制权。 - -## CLI 方式 - -新安装提供 `tobs` 命令;已有 `deepseekbot` 用户可继续使用原命令。 - -使用现有本机 Host 及平常的连接参数和私有令牌文件。连接器令牌从仅本人可读的私有文件传入: - -```bash -tobs private-tunnel-enable --hostname bot.example.com --token-stdin --confirm < /absolute/private/connector-token.txt -tobs devices -``` - -先检查已有连接,不覆盖已占用的 custom 位置。较新 Host 还提供[独立连接命令](bot-cli.zh.md)。 - -## 复制给你的 agent - -复制完整代码块,替换公开主机名,也可以让 agent 再询问。 - -```text -帮我为现有 Tobs Host 配置自己的 Cloudflare Named Tunnel。先读 https://tobs.app/docs/private-named-tunnel/;不可访问时读 https://github.com/BotHarness/DeepSeekBot/blob/main/docs/private-named-tunnel.zh.md。目标主机名:bot.example.com(替换成我的)。 - -1. 检查已安装 Tobs 版本、实际运行的 Host/Profile、CLI 帮助、已有私有连接,以及我的 Cloudflare 账号和域名权限。保留数据、配对、DNS 和其他隧道。不能操作电脑/账号时,提供准确手动步骤并标为待完成。 -2. 约定空闲主机名、具体资源及网络发布范围,不购买域名或开启付费服务,服务商登录由我完成。连接器令牌只通过本地受保护输入或私有文件/stdin 传入,不进入聊天、命令参数或日志。 -3. 创建约定的 Tunnel,配置 Tobs 固定地址,只将主机名转发到 Tobs 显示的专用设备网关 loopback 端口。使用内置 cloudflared,不额外启动连接器,不发布 Host 管理入口。custom 位置已被占用时,询问保留哪条,不自动覆盖。 -4. 检查 DNS、可信 HTTPS、WebSocket 转发和 Tobs 公网可达性,按错误原因修复,不跳过证书验证或切换官方 Connect。检查通过前不提供配对码。 -5. 让我在本机扫码、核对 Host 指纹并批准准确手机公钥,配对材料不进入聊天。用手机流量或外部 Wi-Fi 验证真实 Bot 回复,经授权再验证连接器重启后固定地址可用。不能仅凭健康检查或进程运行宣布完成。 -6. 报告修改资源、真实结果和待完成的手机/网络步骤,给出仅针对这条 Tunnel/DNS 的恢复与移除方法。保留 Profile 和其他资源;撤销手机与移除隧道分别处理。 -``` - -## 恢复与移除 - -已启用的 Named Tunnel 随 Host 重启恢复,主机名不变。电脑休眠或停止时无法访问。`dns` 错误检查主机名/DNS 路由;源站失败检查准确的 HTTP loopback 端口;连接器拒绝检查私有令牌/账号。保持 TLS 验证开启。 - -带停止/恢复控件的版本中,停止保留配置;移除忘记该连接,丢失的手机需单独撤销。退役时确认没有其他服务依赖,再只删除这条 Tunnel 和对应 DNS 路由,保留其他连接器与 DNS。 - -## 验证范围 - -[PR #3780](https://github.com/BotHarness/DeepSeekBot/pull/3780) 记录了免费套餐域名上 Named Tunnel 的 iOS 模拟器配对、真实回复、同地址连接器恢复及撤销验证。真机、中国大陆运营商与媒体功能仍需单独验收。 diff --git a/apps/docs/src/content/docs-zh/docs/private-relay.mdx b/apps/docs/src/content/docs-zh/docs/private-relay.mdx deleted file mode 100644 index bd64f9a0ae..0000000000 --- a/apps/docs/src/content/docs-zh/docs/private-relay.mdx +++ /dev/null @@ -1,78 +0,0 @@ ---- -title: "Docker 私有 Relay" -description: "手动或通过 agent 在自己的服务器上部署多 Host 中继。" -sidebar: - order: 15 ---- - -在自己管理的服务器上运行 Tobs 中继。一个部署支持最多 16 台电脑,各自独立认领和准入,不需要官方 Tobs 账号或 Cloudflare 账号。其他方式见[选择私有连接](private-connect.zh.md)。 - -**需要手机和电脑都能访问的公网 HTTPS 入口。** 可以使用已有公网服务器,或已正确配置公网访问的家用服务器/NAS。仅有域名、仅在家中 NAT 内运行 Docker,都不等于可以远程连接。部署不会自动购买服务器、修改 DNS 或路由器端口,也不保证所有运营商都可达。 - -## 部署 - -中继部署文件与多 Host 配置要求 **Tobs 1.7.0 或更新版本**;Host 更旧时先按[安装/升级教程](https://tobs.app/docs/installation/)升级。打开与已安装 Host 匹配的 [Tobs Release](https://github.com/BotHarness/DeepSeekBot/releases),下载源码归档,将完整 `deploy/private-relay` 目录复制到服务器并记录标签/提交。不要从任意移动分支部署或对现有部署重复初始化。该目录运行中继,不是将 Bot Host 装进 Docker 的镜像。 - -服务器需安装 Docker Compose 和 Node 24。将发布版本的 `deploy/private-relay` 目录复制到你管理的绝对路径,配置已有域名指向服务器,确保公网 TCP 80/443 可达且未被其他服务占用。Caddy 自动申请和续期证书;证书签发与运营商连通性仍需检查。 - -例如文件放在 `/opt/botharness-private`,在**该服务器的 Bash** 中执行;请替换为实际完整目录和域名: - -```bash -node /opt/botharness-private/setup.mjs relay.example.com -docker compose --project-name botharness-private --project-directory /opt/botharness-private --file /opt/botharness-private/compose.yaml up --build --detach -``` - -设置程序生成私有 `.env` 和 `bootstrap.secret`,不会打印密钥。不要提交、截图或分享这些文件。Compose 将密钥传入容器环境,服务器管理员仍可查看;这不能防范服务器管理员。中继以非特权用户运行,持久化准入凭据的哈希,转发加密数据,不保存聊天历史。 - -## 认领与手机配对 - -先检查公网 DNS/TLS,再从服务器之外请求 `https://relay.example.com/health`,应显示支持 `botharness-private-v1` 和 `botharness-private-v2`。健康检查只证明中继可达,不证明手机可用。如果其他服务占用 80/443,保留它并明确适配已有 HTTPS 代理,不原样启动 Compose 示例。 - -1. 在可信电脑打开**Bot 设置 → 连接 → 添加连接 → 用手机连接这台电脑 → 已安装 App,开始连接 → 进阶方式 → Docker 中继**。 -2. 填写 HTTPS 地址,并私下从服务器的 `bootstrap.secret` 复制首次设置密钥。不要发送到聊天或写入命令参数。 -3. 点击**认领并连接**,等待已连接。本机设置成功、容器运行或健康检查成功,均不能证明手机外网可达。 -4. 显示配对码,用手机扫描,核对完整 Host 指纹;再在电脑端核对并批准准确手机公钥。 -5. 从手机向 Bot 发消息,检查真实回复。外网验收使用手机流量,不只是在家中 Wi-Fi 测试。 - -首次成功认领者取得中继管理权;并发和重复认领会被拒绝。中继管理权不等于 Host 控制权,Host 身份和设备批准仍需独立核验。二维码含敏感中继准入信息,不要公开。撤销手机会拒绝 Host 访问并关闭已有加密连接;本切片不会因此替所有其他手机轮换共享中继准入密钥。 - -## 一个中继服务多台电脑 - -一个部署最多服务 16 台电脑。每台电脑有自己的一次性认领密钥、自己的所有者凭据和自己的手机准入,所以和一台电脑配对的手机无法经中继访问另一台,释放或撤销一台电脑也不会影响其他电脑。 - -在服务器上为每台新增电脑生成密钥: - -```bash -node /opt/botharness-private/setup.mjs add-host office-mac -``` - -它会写入 `host-office-mac.secret`(密钥,只留在服务器上),并只把它的哈希追加到 `hosts/keys`。中继每次认领时都会读取这个文件,不需要重启。在那台电脑上按上面的步骤认领,只是粘贴 `host-office-mac.secret` 的内容,而不是 `bootstrap.secret`。第一台电脑继续使用 `bootstrap.secret`。 - -从单台电脑的部署升级:拉取新的 `deploy/private-relay` 文件,在同一个项目目录运行 `docker compose --project-name botharness-private --project-directory /opt/botharness-private --file /opt/botharness-private/compose.yaml up --build --detach`。原有认领、手机和数据卷都照常工作,之后再用 `add-host` 添加电脑。线上协议见[中继标准](private-relay-standard.zh.md),附第三方中继可用的一致性测试脚本。 - -## 失败恢复 - -- **无法连接:**检查公网 DNS、端口、HTTPS 证书和容器状态。不要关闭证书校验;私有连接失败不会偷偷使用官方中继。 -- **已被认领:**回到原电脑和原 Profile,不要为了消除错误删除中继数据卷。 -- **认领时断网:**电脑会在请求前保存私有凭据。只有中继已接受认领时,重启才可重连;认领从未到达中继时,Host 会持续重试控制连接并显示 `private-relay-unreachable`,使用该所有者凭据认证的 `GET /status` 返回 `404`,再次从界面认领可能返回 `private-relay-already-configured`。保留 Profile 和中继状态排查,不重复认领、删除凭据或重置卷来强行恢复。目前没有已定义的重复认领恢复流程。 -- **服务器重启:**保留 `relay-data`、Caddy 数据卷和电脑凭据。删除卷是破坏性重建,不是升级步骤。 -- **手机丢失:**在可信电脑撤销旧设备。若所有可信密钥均丢失,需要重建并重新配对;服务器账号无法恢复旧 Host 身份。 - -停止部署时使用相同的绝对 Compose 路径和项目名执行 `down`,**不要加 `--volumes`**,不要改动其他服务。当前不含离线云队列、远程唤醒、新媒体能力或免费托管保证。中国大陆普通网络仍需单独通过发布验收。 - -CLI 见[私有连接命令](bot-cli.zh.md#docker-私有连接)。真机验收记录在 [#3746](https://github.com/BotHarness/DeepSeekBot/issues/3746);本文不代表已验收通过。 - -## 复制给你的 agent - -复制完整代码块,另外提供公开部署信息和已授权服务器访问方式;认领密钥不进入聊天。 - -```text -帮我在自己的服务器上部署 Tobs Docker 私有 Relay,再连接现有 Host。先读 https://tobs.app/docs/private-relay/ 和 https://tobs.app/docs/private-relay-standard/;不可访问时读 https://github.com/BotHarness/DeepSeekBot/blob/main/docs/private-relay.zh.md 和 https://github.com/BotHarness/DeepSeekBot/blob/main/docs/private-relay-standard.zh.md。缺少时询问公开主机名、已授权服务器访问方式、部署目录和目标 Host。 - -1. 检查 Host 版本/Profile/私有模式,以及服务器 DNS/入站连通性、Docker Compose、Node 24、已有项目和端口归属。家庭内网容器/域名本身不提供公网访问。保留其他服务栈和 Host 数据/配对。Docker Relay 是互斥模式,改变已有私有模式前先询问。 -2. 约定具体资源,不购买基础设施、开启付费服务、替换无关 DNS 或停止占用 80/443 的服务。选择与已安装受支持 Host 匹配的源码发布/标签,记录固定提交,复制完整 deploy/private-relay 目录。需要服务商登录/管理员确认时由我完成。 -3. 仅新部署运行 setup.mjs 配置约定主机名,再以明确项目名和目录启动 Compose。.env、bootstrap.secret、新 Host 密钥和所有者令牌留在本机私有位置;秘密只通过受保护输入/文件/stdin 传递,不进聊天、进程参数或日志。保留已有初始化文件/卷,不为强行认领重置或重复初始化。 -4. 验证公网可信 HTTPS 和 /health,再从实际本机 Host 用界面或 private-connect --hostname --token-stdin --confirm 认领,密钥从私有文件传入。结果未知时不自动重放,检查同一 Profile/状态,不暗中使用官方 Connect。 -5. 让我在本机扫码、核对 Host 指纹并批准准确手机公钥,二维码不进聊天。手机使用流量/外部 Wi-Fi 验证真实 Bot 回复,再经授权保留持久化卷重启并验证手机重连。新增电脑分别使用 add-host 密钥独立批准,不重复使用 bootstrap.secret。 -6. 分别报告服务健康、Host 连接、真实手机回复和待测试项目。提供不泄密的诊断和保留 relay-data/Caddy 卷及 Host Profile 的升级/回退方法。停止用同一项目的 down,不加 --volumes。仅经授权撤销测试手机;退役中继不等于撤销手机。 -``` diff --git a/apps/docs/src/content/docs/docs/private-named-tunnel.mdx b/apps/docs/src/content/docs/docs/private-named-tunnel.mdx deleted file mode 100644 index 8e856acf3d..0000000000 --- a/apps/docs/src/content/docs/docs/private-named-tunnel.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -title: "Cloudflare Named Tunnel" -description: "Set up your own fixed tunnel, manually or with your agent." -sidebar: - order: 15 ---- - -Use a fixed hostname under your own Cloudflare account. Tobs runs bundled cloudflared on your computer and opens an outbound tunnel to Cloudflare. Your phone reaches that HTTPS hostname and the tunnel forwards the encrypted device channel to the Host. Your home computer needs no public inbound port. This uses Cloudflare infrastructure, independently of official Tobs Connect. - -Other choices: [private connections](private-connect.md), [HTTPS ingress](private-ingress.md), [Docker relay](private-relay.md). - -## Prepare - -- Install Tobs and the phone App using the [installation guide](https://tobs.app/en/docs/installation/). Keep your existing Host Profile. -- Have a Cloudflare account, a domain on that account, an unused hostname such as `bot.example.com`, and permission to create its Tunnel/DNS route. -- The computer must reach Cloudflare outbound. Domain registration/provider charges are separate; do not assume every account or network is free or supported. - -Use the current [Cloudflare dashboard guide](https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/get-started/create-remote-tunnel/). Do not execute its connector install command: Tobs runs its own connector. - -## Configure the fixed address - -1. In Cloudflare One, open **Networks → Connectors → Cloudflare Tunnels** (dashboard labels can change). Create a Cloudflared Tunnel. Keep its connector token private. -2. Open **Bot settings → Connections → Add connection → Connect your phone to this computer → App installed, start connecting → Advanced methods → Fixed Cloudflare Tunnel**. Older versions show **Private connection → Fixed address**. -3. Enter only the hostname, for example `bot.example.com`, and enter the connector token in the protected field. Save and note Tobs's gateway-only port. The public check may fail until the next step. -4. In that Tunnel's **Published application routes** (formerly Public Hostname), route the hostname to HTTP service `http://127.0.0.1:PORT`, replacing `PORT` with Tobs's exact port. The connector runs on the Host, so loopback refers to the Host. Never forward the DSH web/admin port. -5. Wait for Tobs's public check to pass, show the phone pairing code, and complete [route verification](private-connect.md#verify-the-selected-route). - -An interactive Cloudflare Access login challenge can block the phone's WebSocket; use only a path explicitly compatible with the phone. The hostname or provider account alone never grants Host control. - -## CLI alternative - -New installations provide `tobs`; existing `deepseekbot` users may keep their command. - -Use the existing local Host and its usual connection/token-file arguments. Read the connector token from a private file readable only by you: - -```bash -tobs private-tunnel-enable --hostname bot.example.com --token-stdin --confirm < /absolute/private/connector-token.txt -tobs devices -``` - -Inspect existing routes first. Do not overwrite an occupied custom slot. Newer Hosts also expose [independent route commands](bot-cli.md#independently-managed-private-routes). - -## Copy to your agent - -Copy the whole block; replace the public hostname or let the agent ask for it. - -```text -Configure my existing Tobs Host with my own Cloudflare Named Tunnel. Read https://tobs.app/en/docs/private-named-tunnel/ first; if unavailable, use https://github.com/BotHarness/DeepSeekBot/blob/main/docs/private-named-tunnel.md. My intended hostname: bot.example.com (replace with mine). - -1. Inspect the installed Tobs version, actual running Host/Profile, CLI help, existing private routes and my Cloudflare account/domain access. Preserve data, pairings, DNS and other tunnels. If you cannot operate the computer/account, give exact manual steps and mark them pending. -2. Agree on an unused hostname and the concrete resources/network publication. Do not buy a domain or activate paid services. Let me complete provider login. Handle connector tokens only through protected local input or private files/stdin, never chat, command arguments or logs. -3. Create the agreed Tunnel, configure Tobs Fixed address and forward its hostname only to the gateway-only loopback port Tobs reports. Use bundled cloudflared; do not start a second connector or publish Host administration. If a private route already occupies the custom slot, ask what to keep rather than replacing it automatically. -4. Check DNS, trusted HTTPS, WebSocket forwarding and Tobs public readiness. Fix the reported cause without skipping certificate validation or falling back to official Connect. Do not offer a pairing code until ready. -5. Let me scan locally, compare the Host fingerprint and approve the exact phone key. Keep pairing material out of chat. Verify a real Bot reply on mobile data/outside Wi-Fi and, when authorized, a connector restart on the same hostname. A health check/process alone is not completion. -6. Report changed resources, actual results and pending phone/network steps. Provide recovery and removal instructions limited to this Tunnel/DNS route. Preserve the Profile and unrelated resources; phone revocation is separate from tunnel removal. -``` - -## Recovery and removal - -An enabled Named Tunnel restores with the Host and keeps its hostname. A sleeping/stopped computer is unavailable. For `dns`, check the hostname/DNS route; for an origin failure, check the exact HTTP loopback port; for a connector refusal, check the private token/account. Keep TLS validation enabled. - -On versions with Stop/Resume, Stop retains configuration. Remove forgets that route; revoke a lost phone separately. When retiring the deployment, confirm no other service depends on the Tunnel, then remove only its Tunnel and matching DNS route. Preserve other connectors and DNS records. - -## Qualification - -[PR #3780](https://github.com/BotHarness/DeepSeekBot/pull/3780) records iOS Simulator pairing, real replies, same-address connector recovery and revocation through a Named Tunnel on a free-plan domain. Physical phones, mainland carriers and media features remain separately qualified. diff --git a/apps/docs/src/content/docs/docs/private-relay.mdx b/apps/docs/src/content/docs/docs/private-relay.mdx deleted file mode 100644 index 5c34cc55df..0000000000 --- a/apps/docs/src/content/docs/docs/private-relay.mdx +++ /dev/null @@ -1,78 +0,0 @@ ---- -title: "Docker private relay" -description: "Deploy a multi-Host relay on your server, manually or with your agent." -sidebar: - order: 15 ---- - -Run the Tobs relay on a server you control. One deployment supports up to 16 computers with independent claims and admission. No official Tobs account or Cloudflare account is required. See [Choose a private connection](private-connect.md) for the other options. - -**You need a public HTTPS endpoint reachable by both your phone and computer.** Use an existing public server, or a home/NAS endpoint with correctly configured public connectivity. A domain alone or Docker running only behind home NAT does not provide remote access. This setup does not purchase infrastructure, open router ports, configure DNS, or guarantee connectivity across every carrier. - -## Prepare the server - -Relay deployment files and multi-Host setup require **Tobs 1.7.0 or later**. If the installed Host is older, follow the [installation/upgrade guide](https://tobs.app/en/docs/installation/) first. Open the [Tobs release](https://github.com/BotHarness/DeepSeekBot/releases) matching your installed Host, download its source archive and copy the complete `deploy/private-relay` directory to your server. Record its tag/commit. Do not deploy an arbitrary moving branch or initialize over an existing deployment. This runs a relay, not a Docker image of the Bot Host. - -Install Docker Compose and Node 24 on the server. Copy the released `deploy/private-relay` directory to an absolute directory you control. Point an existing DNS name to that server and make inbound TCP 80/443 reachable. Other applications must not already own these ports. Caddy obtains and renews the HTTPS certificate; certificate issuance and carrier reachability can fail independently. - -For example, if you placed the files at `/opt/botharness-private`, run these commands in **Bash on that server**, substituting your actual full directory and domain: - -```bash -node /opt/botharness-private/setup.mjs relay.example.com -docker compose --project-name botharness-private --project-directory /opt/botharness-private --file /opt/botharness-private/compose.yaml up --build --detach -``` - -Setup creates private `.env` and `bootstrap.secret` files without printing the key. Keep both out of git, screenshots and shared logs. Compose passes the key to its container environment, which machine administrators can inspect; this does not protect secrets from administrators of that server. The relay runs as an unprivileged user, persists only hashed admission credentials, and carries encrypted application frames rather than chat history. - -## Claim and pair - -First check public DNS/TLS and request `https://relay.example.com/health` from outside the server. It should advertise `botharness-private-v1` and `botharness-private-v2`. A health response proves relay reachability, not phone access. If 80/443 belong to another service, preserve it and deliberately adapt the existing HTTPS proxy instead of starting the unmodified Compose example. - -1. On your trusted desktop, open **Bot settings → Connections → Add connection → Connect your phone to this computer → App installed, start connecting → Advanced methods → Docker relay**. -2. Enter the HTTPS origin and privately copy the initial setup key from the server's `bootstrap.secret` file. Do not send it to another person or put it into command arguments. -3. Choose **Claim and connect**. Wait for **Connected**. A successful local setup, container start or health response alone is not proof that your phone can reach it. -4. Choose **Show phone pairing code**. On the native phone, scan it and verify the full Host fingerprint against the trusted desktop. On the desktop, compare and approve the exact phone key. -5. Send a Bot message from the phone and check the actual reply. For external-access acceptance use mobile data, not only home Wi-Fi. - -The first successful claim wins. A repeated or competing claim is refused. Relay admission is not Host authorization: the pinned Host key and per-Host device approval remain mandatory. The QR includes sensitive relay admission material; treat it like a pairing invitation. Revoking a phone denies Host access and closes its active encrypted channels, even though the relay admission token shared by the phones of that computer is not rotated. - -## More computers on one relay - -One deployment serves up to 16 computers. Each computer gets its own one-time claim key, its own owner credential and its own phone admission, so a phone paired with one computer cannot reach another through the relay, and releasing or revoking one computer never affects the others. - -On the server, create a key for each extra computer: - -```bash -node /opt/botharness-private/setup.mjs add-host office-mac -``` - -This writes `host-office-mac.secret` (the key, private to the server) and appends only its hash to `hosts/keys`, which the relay reads on every claim, so no restart is needed. On that computer, claim with the same steps as above but paste the contents of `host-office-mac.secret` instead of `bootstrap.secret`. The first computer keeps using `bootstrap.secret`. - -Upgrading a single-computer deployment: pull the new `deploy/private-relay` files, then `docker compose --project-name botharness-private --project-directory /opt/botharness-private --file /opt/botharness-private/compose.yaml up --build --detach` with the same project directory. The existing claim, phones and volumes keep working unchanged; add more computers with `add-host` afterwards. The wire protocol is documented in [the relay standard](private-relay-standard.md), with a conformance script for third-party relays. - -## Failures and recovery - -- **Cannot reach the service:** check public DNS, inbound ports, HTTPS certificate and Docker status. Do not disable certificate validation. The app does not silently use the official relay. -- **Already claimed:** continue from the original desktop/Profile. Do not delete the relay data volume to make the error disappear. -- **Connection interrupted during claim:** the desktop saves private owner credentials before claiming. Restart reconnects only if the relay accepted that claim. If the claim never reached the relay, the Host keeps retrying its control connection with `private-relay-unreachable`; an authenticated `GET /status` with that owner credential returns `404`. Repeating the in-app claim can report `private-relay-already-configured`. Preserve the Profile and relay state for diagnosis; do not repeat the claim, delete credentials or reset volumes to force recovery. No repeat-claim recovery procedure is currently defined. -- **Server restart:** retain the `relay-data` and Caddy volumes and the desktop credential store. The same owner and phone pairing should reconnect. Removing a volume is destructive recovery, not an upgrade step. -- **Phone lost:** use the Host's existing paired-device revoke control. If all trusted Host credentials are lost, rebuild and re-pair; a server account cannot recover the original Host identity. - -Stop only this deployment with the same absolute Compose path and project name, using `down` **without** `--volumes`. Do not touch unrelated stacks. This candidate has no cloud offline queue, no remote wake, no new media promise, and no guaranteed free hosting allowance. Mainland ordinary-network qualification remains an explicit release gate. - -CLI operators can use [the private connection commands](bot-cli.md#docker-private-connectivity). Native acceptance evidence is tracked in [#3746](https://github.com/BotHarness/DeepSeekBot/issues/3746); this guide does not claim that acceptance has passed. - -## Copy to your agent - -Copy this whole block. Provide public deployment inputs and authorized server access separately; keep bootstrap keys out of chat. - -```text -Deploy a Tobs Docker private relay on my own server and connect my existing Host. Read https://tobs.app/en/docs/private-relay/ and https://tobs.app/en/docs/private-relay-standard/. If unavailable, read https://github.com/BotHarness/DeepSeekBot/blob/main/docs/private-relay.md and https://github.com/BotHarness/DeepSeekBot/blob/main/docs/private-relay-standard.md. Ask for the public hostname, authorized server access, deployment directory and target Host if missing. - -1. Inspect the Host version/Profile/private mode and server DNS/inbound connectivity, Docker Compose, Node 24, existing projects and port ownership. A home-only container/domain does not create internet reachability. Preserve other stacks and Host data/pairings. Docker relay is exclusive: ask before changing an existing private mode. -2. Agree on concrete resources. Do not purchase infrastructure, activate paid services, replace unrelated DNS or stop another service on 80/443. Use the source release/tag matching the supported installed Host, record its immutable revision and copy the complete deploy/private-relay directory. Let me complete provider login/privileged confirmation when needed. -3. Only for a new deployment, run setup.mjs with the agreed hostname, then Compose with an explicit project name and directory. Keep .env, bootstrap.secret, extra Host keys and owner tokens private. Secrets enter through protected local input/files/stdin, never chat, process arguments or logs. Preserve existing setup files/volumes; do not reset or repeat initialization to force a claim. -4. Verify public trusted HTTPS and /health. Claim from the actual local Host using its UI or private-connect --hostname --token-stdin --confirm with the key from a private file. Never automatically replay an unknown-outcome claim; inspect the same Profile/status. Do not fall back to official Connect. -5. Let me scan locally, compare the Host fingerprint and approve the exact phone key. Keep the QR out of chat. Verify a real Bot reply on mobile data/outside Wi-Fi, then an authorized restart retaining persistent volumes and phone reconnect. Additional computers each need a separate add-host key and independent approval; never reuse bootstrap.secret. -6. Report service health, Host connection, actual phone reply and pending checks separately. Provide diagnostics without secrets and upgrade/rollback instructions retaining relay-data/Caddy volumes and the Host Profile. Shutdown uses the same project's down without --volumes. Revoke a test phone only when authorized; retiring the relay is not phone revocation. -```