clawdex-mobile 5.0.1 → 5.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/docs/setup-and-operations.md +3 -1
- package/docs/troubleshooting.md +1 -0
- package/package.json +18 -8
- package/scripts/setup-secure-dev.sh +26 -17
- package/services/rust-bridge/Cargo.lock +1 -1
- package/services/rust-bridge/Cargo.toml +1 -1
- package/vendor/bridge-binaries/darwin-arm64/codex-rust-bridge +0 -0
- package/vendor/bridge-binaries/darwin-x64/codex-rust-bridge +0 -0
- package/vendor/bridge-binaries/linux-x64/codex-rust-bridge +0 -0
- package/vendor/bridge-binaries/win32-x64/codex-rust-bridge.exe +0 -0
- package/.artifacts/bridge-binaries/bridge-binaries-darwin-arm64/codex-rust-bridge +0 -0
- package/.artifacts/bridge-binaries/bridge-binaries-darwin-x64/codex-rust-bridge +0 -0
- package/.artifacts/bridge-binaries/bridge-binaries-linux-x64/codex-rust-bridge +0 -0
- package/.artifacts/bridge-binaries/bridge-binaries-win32-x64/codex-rust-bridge.exe +0 -0
- package/.github/workflows/ci.yml +0 -80
- package/.github/workflows/npm-release.yml +0 -208
- package/.github/workflows/pages.yml +0 -41
- package/AGENTS.md +0 -273
- package/STATUS.md +0 -115
- package/apps/mobile/.env.example +0 -6
- package/apps/mobile/App.tsx +0 -943
- package/apps/mobile/app.json +0 -77
- package/apps/mobile/assets/brand/adaptive-icon.png +0 -0
- package/apps/mobile/assets/brand/app-icon.png +0 -0
- package/apps/mobile/assets/brand/favicon.png +0 -0
- package/apps/mobile/assets/brand/mark.png +0 -0
- package/apps/mobile/assets/brand/splash-icon-white.png +0 -0
- package/apps/mobile/assets/brand/splash-icon.png +0 -0
- package/apps/mobile/babel.config.js +0 -7
- package/apps/mobile/eas.json +0 -40
- package/apps/mobile/eslint.config.cjs +0 -28
- package/apps/mobile/index.js +0 -5
- package/apps/mobile/package.json +0 -57
- package/apps/mobile/plugins/withAndroidCleartextTraffic.js +0 -14
- package/apps/mobile/src/api/__tests__/chatMapping.test.ts +0 -351
- package/apps/mobile/src/api/__tests__/client.test.ts +0 -1494
- package/apps/mobile/src/api/__tests__/ws.test.ts +0 -640
- package/apps/mobile/src/api/account.ts +0 -47
- package/apps/mobile/src/api/chatMapping.ts +0 -1048
- package/apps/mobile/src/api/client.ts +0 -1430
- package/apps/mobile/src/api/rateLimits.ts +0 -143
- package/apps/mobile/src/api/types.ts +0 -435
- package/apps/mobile/src/api/ws.ts +0 -852
- package/apps/mobile/src/bridgeUrl.ts +0 -105
- package/apps/mobile/src/components/ActivityBar.tsx +0 -95
- package/apps/mobile/src/components/ApprovalBanner.tsx +0 -207
- package/apps/mobile/src/components/BrandMark.tsx +0 -43
- package/apps/mobile/src/components/ChatHeader.tsx +0 -107
- package/apps/mobile/src/components/ChatInput.tsx +0 -457
- package/apps/mobile/src/components/ChatMessage.tsx +0 -959
- package/apps/mobile/src/components/ComposerUsageLimits.tsx +0 -167
- package/apps/mobile/src/components/SelectionSheet.tsx +0 -466
- package/apps/mobile/src/components/StatusLine.tsx +0 -52
- package/apps/mobile/src/components/ToolBlock.tsx +0 -67
- package/apps/mobile/src/components/TypingIndicator.tsx +0 -64
- package/apps/mobile/src/components/VoiceRecordingWaveform.tsx +0 -181
- package/apps/mobile/src/components/WorkspacePickerModal.tsx +0 -812
- package/apps/mobile/src/components/__tests__/chat-input-layout.test.ts +0 -35
- package/apps/mobile/src/components/__tests__/chatImageSource.test.ts +0 -44
- package/apps/mobile/src/components/__tests__/composerUsageLimits.test.ts +0 -138
- package/apps/mobile/src/components/__tests__/voiceWaveform.test.ts +0 -31
- package/apps/mobile/src/components/chat-input-layout.ts +0 -59
- package/apps/mobile/src/components/chatImageSource.ts +0 -86
- package/apps/mobile/src/components/usageLimitBadges.ts +0 -109
- package/apps/mobile/src/components/voiceWaveform.ts +0 -46
- package/apps/mobile/src/config.ts +0 -64
- package/apps/mobile/src/hooks/useVoiceRecorder.ts +0 -271
- package/apps/mobile/src/navigation/DrawerContent.tsx +0 -1129
- package/apps/mobile/src/navigation/__tests__/chatThreadTree.test.ts +0 -89
- package/apps/mobile/src/navigation/__tests__/drawerChats.test.ts +0 -65
- package/apps/mobile/src/navigation/chatThreadTree.ts +0 -191
- package/apps/mobile/src/navigation/drawerChats.ts +0 -9
- package/apps/mobile/src/screens/GitScreen.tsx +0 -1489
- package/apps/mobile/src/screens/MainScreen.tsx +0 -10511
- package/apps/mobile/src/screens/OnboardingScreen.tsx +0 -1746
- package/apps/mobile/src/screens/PrivacyScreen.tsx +0 -196
- package/apps/mobile/src/screens/SettingsScreen.tsx +0 -870
- package/apps/mobile/src/screens/TerminalScreen.tsx +0 -248
- package/apps/mobile/src/screens/TermsScreen.tsx +0 -192
- package/apps/mobile/src/screens/__tests__/agentThreadDisplay.test.ts +0 -80
- package/apps/mobile/src/screens/__tests__/agentThreads.test.ts +0 -170
- package/apps/mobile/src/screens/__tests__/gitDiff.test.ts +0 -131
- package/apps/mobile/src/screens/__tests__/planCardState.test.ts +0 -88
- package/apps/mobile/src/screens/__tests__/subAgentTranscript.test.ts +0 -102
- package/apps/mobile/src/screens/__tests__/transcriptMessages.test.ts +0 -97
- package/apps/mobile/src/screens/agentThreadDisplay.ts +0 -261
- package/apps/mobile/src/screens/agentThreads.ts +0 -167
- package/apps/mobile/src/screens/gitDiff.ts +0 -380
- package/apps/mobile/src/screens/planCardState.ts +0 -40
- package/apps/mobile/src/screens/subAgentTranscript.ts +0 -149
- package/apps/mobile/src/screens/transcriptMessages.ts +0 -102
- package/apps/mobile/src/theme.ts +0 -106
- package/apps/mobile/src/types/assets.d.ts +0 -4
- package/apps/mobile/tsconfig.json +0 -33
- package/docs/app-review-notes.md +0 -116
- package/docs/codex-app-server-cli-gap-tracker.md +0 -90
- package/docs/eas-builds.md +0 -91
- package/docs/open-source-license-requirements.md +0 -32
- package/docs/plans/2026-02-20-codex-desktop-style-redesign.md +0 -190
- package/docs/plans/2026-02-20-codex-mobile-implementation.md +0 -1630
- package/docs/plans/2026-02-21-codex-ui-redesign-design.md +0 -101
- package/docs/plans/2026-02-21-codex-ui-redesign.md +0 -1229
- package/docs/privacy-policy.md +0 -54
- package/docs/realtime-streaming-limitations.md +0 -161
- package/docs/terms-of-service.md +0 -33
- package/docs/voice-transcription.md +0 -87
- package/scripts/codex-live-demo.sh +0 -69
- package/scripts/start-bridge-secure.sh +0 -5
- package/scripts/start-expo.sh +0 -176
- package/scripts/sync-versions.js +0 -63
- package/scripts/teardown.sh +0 -136
- package/services/mac-bridge/.env.example +0 -10
- package/services/mac-bridge/codex-types/AbsolutePathBuf.ts +0 -14
- package/services/mac-bridge/codex-types/AddConversationListenerParams.ts +0 -6
- package/services/mac-bridge/codex-types/AddConversationSubscriptionResponse.ts +0 -5
- package/services/mac-bridge/codex-types/AgentMessageContent.ts +0 -5
- package/services/mac-bridge/codex-types/AgentMessageContentDeltaEvent.ts +0 -5
- package/services/mac-bridge/codex-types/AgentMessageDeltaEvent.ts +0 -5
- package/services/mac-bridge/codex-types/AgentMessageEvent.ts +0 -5
- package/services/mac-bridge/codex-types/AgentMessageItem.ts +0 -21
- package/services/mac-bridge/codex-types/AgentReasoningDeltaEvent.ts +0 -5
- package/services/mac-bridge/codex-types/AgentReasoningEvent.ts +0 -5
- package/services/mac-bridge/codex-types/AgentReasoningRawContentDeltaEvent.ts +0 -5
- package/services/mac-bridge/codex-types/AgentReasoningRawContentEvent.ts +0 -5
- package/services/mac-bridge/codex-types/AgentReasoningSectionBreakEvent.ts +0 -5
- package/services/mac-bridge/codex-types/AgentStatus.ts +0 -8
- package/services/mac-bridge/codex-types/ApplyPatchApprovalParams.ts +0 -21
- package/services/mac-bridge/codex-types/ApplyPatchApprovalRequestEvent.ts +0 -23
- package/services/mac-bridge/codex-types/ApplyPatchApprovalResponse.ts +0 -6
- package/services/mac-bridge/codex-types/ArchiveConversationParams.ts +0 -6
- package/services/mac-bridge/codex-types/ArchiveConversationResponse.ts +0 -5
- package/services/mac-bridge/codex-types/AskForApproval.ts +0 -9
- package/services/mac-bridge/codex-types/AuthMode.ts +0 -8
- package/services/mac-bridge/codex-types/AuthStatusChangeNotification.ts +0 -9
- package/services/mac-bridge/codex-types/BackgroundEventEvent.ts +0 -5
- package/services/mac-bridge/codex-types/ByteRange.ts +0 -13
- package/services/mac-bridge/codex-types/CallToolResult.ts +0 -9
- package/services/mac-bridge/codex-types/CancelLoginChatGptParams.ts +0 -5
- package/services/mac-bridge/codex-types/CancelLoginChatGptResponse.ts +0 -5
- package/services/mac-bridge/codex-types/ClientInfo.ts +0 -5
- package/services/mac-bridge/codex-types/ClientNotification.ts +0 -5
- package/services/mac-bridge/codex-types/ClientRequest.ts +0 -60
- package/services/mac-bridge/codex-types/CodexErrorInfo.ts +0 -8
- package/services/mac-bridge/codex-types/CollabAgentInteractionBeginEvent.ts +0 -23
- package/services/mac-bridge/codex-types/CollabAgentInteractionEndEvent.ts +0 -28
- package/services/mac-bridge/codex-types/CollabAgentSpawnBeginEvent.ts +0 -19
- package/services/mac-bridge/codex-types/CollabAgentSpawnEndEvent.ts +0 -28
- package/services/mac-bridge/codex-types/CollabCloseBeginEvent.ts +0 -18
- package/services/mac-bridge/codex-types/CollabCloseEndEvent.ts +0 -24
- package/services/mac-bridge/codex-types/CollabResumeBeginEvent.ts +0 -18
- package/services/mac-bridge/codex-types/CollabResumeEndEvent.ts +0 -24
- package/services/mac-bridge/codex-types/CollabWaitingBeginEvent.ts +0 -18
- package/services/mac-bridge/codex-types/CollabWaitingEndEvent.ts +0 -19
- package/services/mac-bridge/codex-types/CollaborationMode.ts +0 -10
- package/services/mac-bridge/codex-types/CollaborationModeMask.ts +0 -11
- package/services/mac-bridge/codex-types/ContentItem.ts +0 -5
- package/services/mac-bridge/codex-types/ContextCompactedEvent.ts +0 -5
- package/services/mac-bridge/codex-types/ContextCompactionItem.ts +0 -5
- package/services/mac-bridge/codex-types/ConversationGitInfo.ts +0 -5
- package/services/mac-bridge/codex-types/ConversationSummary.ts +0 -8
- package/services/mac-bridge/codex-types/CreditsSnapshot.ts +0 -5
- package/services/mac-bridge/codex-types/CustomPrompt.ts +0 -5
- package/services/mac-bridge/codex-types/DeprecationNoticeEvent.ts +0 -13
- package/services/mac-bridge/codex-types/DynamicToolCallRequest.ts +0 -6
- package/services/mac-bridge/codex-types/ElicitationRequestEvent.ts +0 -5
- package/services/mac-bridge/codex-types/ErrorEvent.ts +0 -6
- package/services/mac-bridge/codex-types/EventMsg.ts +0 -78
- package/services/mac-bridge/codex-types/ExecApprovalRequestEvent.ts +0 -44
- package/services/mac-bridge/codex-types/ExecCommandApprovalParams.ts +0 -16
- package/services/mac-bridge/codex-types/ExecCommandApprovalResponse.ts +0 -6
- package/services/mac-bridge/codex-types/ExecCommandBeginEvent.ts +0 -35
- package/services/mac-bridge/codex-types/ExecCommandEndEvent.ts +0 -64
- package/services/mac-bridge/codex-types/ExecCommandOutputDeltaEvent.ts +0 -18
- package/services/mac-bridge/codex-types/ExecCommandSource.ts +0 -5
- package/services/mac-bridge/codex-types/ExecCommandStatus.ts +0 -5
- package/services/mac-bridge/codex-types/ExecOneOffCommandParams.ts +0 -6
- package/services/mac-bridge/codex-types/ExecOneOffCommandResponse.ts +0 -5
- package/services/mac-bridge/codex-types/ExecOutputStream.ts +0 -5
- package/services/mac-bridge/codex-types/ExecPolicyAmendment.ts +0 -12
- package/services/mac-bridge/codex-types/ExitedReviewModeEvent.ts +0 -6
- package/services/mac-bridge/codex-types/FileChange.ts +0 -5
- package/services/mac-bridge/codex-types/ForcedLoginMethod.ts +0 -5
- package/services/mac-bridge/codex-types/ForkConversationParams.ts +0 -7
- package/services/mac-bridge/codex-types/ForkConversationResponse.ts +0 -7
- package/services/mac-bridge/codex-types/FunctionCallOutputBody.ts +0 -6
- package/services/mac-bridge/codex-types/FunctionCallOutputContentItem.ts +0 -9
- package/services/mac-bridge/codex-types/FunctionCallOutputPayload.ts +0 -12
- package/services/mac-bridge/codex-types/FuzzyFileSearchParams.ts +0 -5
- package/services/mac-bridge/codex-types/FuzzyFileSearchResponse.ts +0 -6
- package/services/mac-bridge/codex-types/FuzzyFileSearchResult.ts +0 -8
- package/services/mac-bridge/codex-types/FuzzyFileSearchSessionCompletedNotification.ts +0 -5
- package/services/mac-bridge/codex-types/FuzzyFileSearchSessionUpdatedNotification.ts +0 -6
- package/services/mac-bridge/codex-types/GetAuthStatusParams.ts +0 -5
- package/services/mac-bridge/codex-types/GetAuthStatusResponse.ts +0 -6
- package/services/mac-bridge/codex-types/GetConversationSummaryParams.ts +0 -6
- package/services/mac-bridge/codex-types/GetConversationSummaryResponse.ts +0 -6
- package/services/mac-bridge/codex-types/GetHistoryEntryResponseEvent.ts +0 -10
- package/services/mac-bridge/codex-types/GetUserAgentResponse.ts +0 -5
- package/services/mac-bridge/codex-types/GetUserSavedConfigResponse.ts +0 -6
- package/services/mac-bridge/codex-types/GhostCommit.ts +0 -8
- package/services/mac-bridge/codex-types/GitDiffToRemoteParams.ts +0 -5
- package/services/mac-bridge/codex-types/GitDiffToRemoteResponse.ts +0 -6
- package/services/mac-bridge/codex-types/GitSha.ts +0 -5
- package/services/mac-bridge/codex-types/HistoryEntry.ts +0 -5
- package/services/mac-bridge/codex-types/InitializeCapabilities.ts +0 -17
- package/services/mac-bridge/codex-types/InitializeParams.ts +0 -7
- package/services/mac-bridge/codex-types/InitializeResponse.ts +0 -5
- package/services/mac-bridge/codex-types/InputItem.ts +0 -10
- package/services/mac-bridge/codex-types/InputModality.ts +0 -8
- package/services/mac-bridge/codex-types/InterruptConversationParams.ts +0 -6
- package/services/mac-bridge/codex-types/InterruptConversationResponse.ts +0 -6
- package/services/mac-bridge/codex-types/ItemCompletedEvent.ts +0 -7
- package/services/mac-bridge/codex-types/ItemStartedEvent.ts +0 -7
- package/services/mac-bridge/codex-types/ListConversationsParams.ts +0 -5
- package/services/mac-bridge/codex-types/ListConversationsResponse.ts +0 -6
- package/services/mac-bridge/codex-types/ListCustomPromptsResponseEvent.ts +0 -9
- package/services/mac-bridge/codex-types/ListRemoteSkillsResponseEvent.ts +0 -9
- package/services/mac-bridge/codex-types/ListSkillsResponseEvent.ts +0 -9
- package/services/mac-bridge/codex-types/LocalShellAction.ts +0 -6
- package/services/mac-bridge/codex-types/LocalShellExecAction.ts +0 -5
- package/services/mac-bridge/codex-types/LocalShellStatus.ts +0 -5
- package/services/mac-bridge/codex-types/LoginApiKeyParams.ts +0 -5
- package/services/mac-bridge/codex-types/LoginApiKeyResponse.ts +0 -5
- package/services/mac-bridge/codex-types/LoginChatGptCompleteNotification.ts +0 -8
- package/services/mac-bridge/codex-types/LoginChatGptResponse.ts +0 -5
- package/services/mac-bridge/codex-types/LogoutChatGptResponse.ts +0 -5
- package/services/mac-bridge/codex-types/McpAuthStatus.ts +0 -5
- package/services/mac-bridge/codex-types/McpInvocation.ts +0 -18
- package/services/mac-bridge/codex-types/McpListToolsResponseEvent.ts +0 -25
- package/services/mac-bridge/codex-types/McpStartupCompleteEvent.ts +0 -6
- package/services/mac-bridge/codex-types/McpStartupFailure.ts +0 -5
- package/services/mac-bridge/codex-types/McpStartupStatus.ts +0 -5
- package/services/mac-bridge/codex-types/McpStartupUpdateEvent.ts +0 -14
- package/services/mac-bridge/codex-types/McpToolCallBeginEvent.ts +0 -10
- package/services/mac-bridge/codex-types/McpToolCallEndEvent.ts +0 -15
- package/services/mac-bridge/codex-types/MessagePhase.ts +0 -11
- package/services/mac-bridge/codex-types/ModeKind.ts +0 -8
- package/services/mac-bridge/codex-types/ModelRerouteEvent.ts +0 -6
- package/services/mac-bridge/codex-types/ModelRerouteReason.ts +0 -5
- package/services/mac-bridge/codex-types/NetworkAccess.ts +0 -8
- package/services/mac-bridge/codex-types/NetworkApprovalContext.ts +0 -6
- package/services/mac-bridge/codex-types/NetworkApprovalProtocol.ts +0 -5
- package/services/mac-bridge/codex-types/NewConversationParams.ts +0 -8
- package/services/mac-bridge/codex-types/NewConversationResponse.ts +0 -7
- package/services/mac-bridge/codex-types/ParsedCommand.ts +0 -12
- package/services/mac-bridge/codex-types/PatchApplyBeginEvent.ts +0 -23
- package/services/mac-bridge/codex-types/PatchApplyEndEvent.ts +0 -36
- package/services/mac-bridge/codex-types/PatchApplyStatus.ts +0 -5
- package/services/mac-bridge/codex-types/Personality.ts +0 -5
- package/services/mac-bridge/codex-types/PlanDeltaEvent.ts +0 -5
- package/services/mac-bridge/codex-types/PlanItem.ts +0 -5
- package/services/mac-bridge/codex-types/PlanItemArg.ts +0 -6
- package/services/mac-bridge/codex-types/PlanType.ts +0 -5
- package/services/mac-bridge/codex-types/Profile.ts +0 -9
- package/services/mac-bridge/codex-types/RateLimitSnapshot.ts +0 -8
- package/services/mac-bridge/codex-types/RateLimitWindow.ts +0 -17
- package/services/mac-bridge/codex-types/RawResponseItemEvent.ts +0 -6
- package/services/mac-bridge/codex-types/ReadOnlyAccess.ts +0 -19
- package/services/mac-bridge/codex-types/ReasoningContentDeltaEvent.ts +0 -5
- package/services/mac-bridge/codex-types/ReasoningEffort.ts +0 -8
- package/services/mac-bridge/codex-types/ReasoningItem.ts +0 -5
- package/services/mac-bridge/codex-types/ReasoningItemContent.ts +0 -5
- package/services/mac-bridge/codex-types/ReasoningItemReasoningSummary.ts +0 -5
- package/services/mac-bridge/codex-types/ReasoningRawContentDeltaEvent.ts +0 -5
- package/services/mac-bridge/codex-types/ReasoningSummary.ts +0 -10
- package/services/mac-bridge/codex-types/RemoteSkillDownloadedEvent.ts +0 -8
- package/services/mac-bridge/codex-types/RemoteSkillSummary.ts +0 -5
- package/services/mac-bridge/codex-types/RemoveConversationListenerParams.ts +0 -5
- package/services/mac-bridge/codex-types/RemoveConversationSubscriptionResponse.ts +0 -5
- package/services/mac-bridge/codex-types/RequestId.ts +0 -5
- package/services/mac-bridge/codex-types/RequestUserInputEvent.ts +0 -15
- package/services/mac-bridge/codex-types/RequestUserInputQuestion.ts +0 -6
- package/services/mac-bridge/codex-types/RequestUserInputQuestionOption.ts +0 -5
- package/services/mac-bridge/codex-types/Resource.ts +0 -9
- package/services/mac-bridge/codex-types/ResourceTemplate.ts +0 -9
- package/services/mac-bridge/codex-types/ResponseItem.ts +0 -18
- package/services/mac-bridge/codex-types/ResumeConversationParams.ts +0 -8
- package/services/mac-bridge/codex-types/ResumeConversationResponse.ts +0 -7
- package/services/mac-bridge/codex-types/ReviewCodeLocation.ts +0 -9
- package/services/mac-bridge/codex-types/ReviewDecision.ts +0 -9
- package/services/mac-bridge/codex-types/ReviewFinding.ts +0 -9
- package/services/mac-bridge/codex-types/ReviewLineRange.ts +0 -8
- package/services/mac-bridge/codex-types/ReviewOutputEvent.ts +0 -9
- package/services/mac-bridge/codex-types/ReviewRequest.ts +0 -9
- package/services/mac-bridge/codex-types/ReviewTarget.ts +0 -9
- package/services/mac-bridge/codex-types/SandboxMode.ts +0 -5
- package/services/mac-bridge/codex-types/SandboxPolicy.ts +0 -44
- package/services/mac-bridge/codex-types/SandboxSettings.ts +0 -6
- package/services/mac-bridge/codex-types/SendUserMessageParams.ts +0 -7
- package/services/mac-bridge/codex-types/SendUserMessageResponse.ts +0 -5
- package/services/mac-bridge/codex-types/SendUserTurnParams.ts +0 -16
- package/services/mac-bridge/codex-types/SendUserTurnResponse.ts +0 -5
- package/services/mac-bridge/codex-types/ServerNotification.ts +0 -45
- package/services/mac-bridge/codex-types/ServerRequest.ts +0 -16
- package/services/mac-bridge/codex-types/SessionConfiguredEvent.ts +0 -57
- package/services/mac-bridge/codex-types/SessionConfiguredNotification.ts +0 -8
- package/services/mac-bridge/codex-types/SessionNetworkProxyRuntime.ts +0 -5
- package/services/mac-bridge/codex-types/SessionSource.ts +0 -6
- package/services/mac-bridge/codex-types/SetDefaultModelParams.ts +0 -6
- package/services/mac-bridge/codex-types/SetDefaultModelResponse.ts +0 -5
- package/services/mac-bridge/codex-types/Settings.ts +0 -9
- package/services/mac-bridge/codex-types/SkillDependencies.ts +0 -6
- package/services/mac-bridge/codex-types/SkillErrorInfo.ts +0 -5
- package/services/mac-bridge/codex-types/SkillInterface.ts +0 -5
- package/services/mac-bridge/codex-types/SkillMetadata.ts +0 -12
- package/services/mac-bridge/codex-types/SkillScope.ts +0 -5
- package/services/mac-bridge/codex-types/SkillToolDependency.ts +0 -5
- package/services/mac-bridge/codex-types/SkillsListEntry.ts +0 -7
- package/services/mac-bridge/codex-types/StepStatus.ts +0 -5
- package/services/mac-bridge/codex-types/StreamErrorEvent.ts +0 -12
- package/services/mac-bridge/codex-types/SubAgentSource.ts +0 -6
- package/services/mac-bridge/codex-types/TerminalInteractionEvent.ts +0 -17
- package/services/mac-bridge/codex-types/TextElement.ts +0 -14
- package/services/mac-bridge/codex-types/ThreadId.ts +0 -5
- package/services/mac-bridge/codex-types/ThreadNameUpdatedEvent.ts +0 -6
- package/services/mac-bridge/codex-types/ThreadRolledBackEvent.ts +0 -9
- package/services/mac-bridge/codex-types/TokenCountEvent.ts +0 -7
- package/services/mac-bridge/codex-types/TokenUsage.ts +0 -5
- package/services/mac-bridge/codex-types/TokenUsageInfo.ts +0 -6
- package/services/mac-bridge/codex-types/Tool.ts +0 -9
- package/services/mac-bridge/codex-types/Tools.ts +0 -5
- package/services/mac-bridge/codex-types/TurnAbortReason.ts +0 -5
- package/services/mac-bridge/codex-types/TurnAbortedEvent.ts +0 -6
- package/services/mac-bridge/codex-types/TurnCompleteEvent.ts +0 -5
- package/services/mac-bridge/codex-types/TurnDiffEvent.ts +0 -5
- package/services/mac-bridge/codex-types/TurnItem.ts +0 -11
- package/services/mac-bridge/codex-types/TurnStartedEvent.ts +0 -6
- package/services/mac-bridge/codex-types/UndoCompletedEvent.ts +0 -5
- package/services/mac-bridge/codex-types/UndoStartedEvent.ts +0 -5
- package/services/mac-bridge/codex-types/UpdatePlanArgs.ts +0 -10
- package/services/mac-bridge/codex-types/UserInfoResponse.ts +0 -5
- package/services/mac-bridge/codex-types/UserInput.ts +0 -16
- package/services/mac-bridge/codex-types/UserMessageEvent.ts +0 -22
- package/services/mac-bridge/codex-types/UserMessageItem.ts +0 -6
- package/services/mac-bridge/codex-types/UserSavedConfig.ts +0 -14
- package/services/mac-bridge/codex-types/Verbosity.ts +0 -9
- package/services/mac-bridge/codex-types/ViewImageToolCallEvent.ts +0 -13
- package/services/mac-bridge/codex-types/WarningEvent.ts +0 -5
- package/services/mac-bridge/codex-types/WebSearchAction.ts +0 -5
- package/services/mac-bridge/codex-types/WebSearchBeginEvent.ts +0 -5
- package/services/mac-bridge/codex-types/WebSearchEndEvent.ts +0 -6
- package/services/mac-bridge/codex-types/WebSearchItem.ts +0 -6
- package/services/mac-bridge/codex-types/WebSearchMode.ts +0 -5
- package/services/mac-bridge/codex-types/index.ts +0 -234
- package/services/mac-bridge/codex-types/serde_json/JsonValue.ts +0 -5
- package/services/mac-bridge/codex-types/v2/Account.ts +0 -6
- package/services/mac-bridge/codex-types/v2/AccountLoginCompletedNotification.ts +0 -5
- package/services/mac-bridge/codex-types/v2/AccountRateLimitsUpdatedNotification.ts +0 -6
- package/services/mac-bridge/codex-types/v2/AccountUpdatedNotification.ts +0 -6
- package/services/mac-bridge/codex-types/v2/AgentMessageDeltaNotification.ts +0 -5
- package/services/mac-bridge/codex-types/v2/AnalyticsConfig.ts +0 -6
- package/services/mac-bridge/codex-types/v2/AppBranding.ts +0 -8
- package/services/mac-bridge/codex-types/v2/AppDisabledReason.ts +0 -5
- package/services/mac-bridge/codex-types/v2/AppInfo.ts +0 -19
- package/services/mac-bridge/codex-types/v2/AppListUpdatedNotification.ts +0 -9
- package/services/mac-bridge/codex-types/v2/AppMetadata.ts +0 -7
- package/services/mac-bridge/codex-types/v2/AppReview.ts +0 -5
- package/services/mac-bridge/codex-types/v2/AppScreenshot.ts +0 -5
- package/services/mac-bridge/codex-types/v2/AppsConfig.ts +0 -6
- package/services/mac-bridge/codex-types/v2/AppsListParams.ts +0 -24
- package/services/mac-bridge/codex-types/v2/AppsListResponse.ts +0 -14
- package/services/mac-bridge/codex-types/v2/AskForApproval.ts +0 -5
- package/services/mac-bridge/codex-types/v2/ByteRange.ts +0 -5
- package/services/mac-bridge/codex-types/v2/CancelLoginAccountParams.ts +0 -5
- package/services/mac-bridge/codex-types/v2/CancelLoginAccountResponse.ts +0 -6
- package/services/mac-bridge/codex-types/v2/CancelLoginAccountStatus.ts +0 -5
- package/services/mac-bridge/codex-types/v2/ChatgptAuthTokensRefreshParams.ts +0 -16
- package/services/mac-bridge/codex-types/v2/ChatgptAuthTokensRefreshReason.ts +0 -5
- package/services/mac-bridge/codex-types/v2/ChatgptAuthTokensRefreshResponse.ts +0 -5
- package/services/mac-bridge/codex-types/v2/CodexErrorInfo.ts +0 -11
- package/services/mac-bridge/codex-types/v2/CollabAgentState.ts +0 -6
- package/services/mac-bridge/codex-types/v2/CollabAgentStatus.ts +0 -5
- package/services/mac-bridge/codex-types/v2/CollabAgentTool.ts +0 -5
- package/services/mac-bridge/codex-types/v2/CollabAgentToolCallStatus.ts +0 -5
- package/services/mac-bridge/codex-types/v2/CommandAction.ts +0 -5
- package/services/mac-bridge/codex-types/v2/CommandExecParams.ts +0 -6
- package/services/mac-bridge/codex-types/v2/CommandExecResponse.ts +0 -5
- package/services/mac-bridge/codex-types/v2/CommandExecutionApprovalDecision.ts +0 -6
- package/services/mac-bridge/codex-types/v2/CommandExecutionOutputDeltaNotification.ts +0 -5
- package/services/mac-bridge/codex-types/v2/CommandExecutionRequestApprovalParams.ts +0 -37
- package/services/mac-bridge/codex-types/v2/CommandExecutionRequestApprovalResponse.ts +0 -6
- package/services/mac-bridge/codex-types/v2/CommandExecutionStatus.ts +0 -5
- package/services/mac-bridge/codex-types/v2/Config.ts +0 -17
- package/services/mac-bridge/codex-types/v2/ConfigBatchWriteParams.ts +0 -10
- package/services/mac-bridge/codex-types/v2/ConfigEdit.ts +0 -7
- package/services/mac-bridge/codex-types/v2/ConfigLayer.ts +0 -7
- package/services/mac-bridge/codex-types/v2/ConfigLayerMetadata.ts +0 -6
- package/services/mac-bridge/codex-types/v2/ConfigLayerSource.ts +0 -16
- package/services/mac-bridge/codex-types/v2/ConfigReadParams.ts +0 -11
- package/services/mac-bridge/codex-types/v2/ConfigReadResponse.ts +0 -8
- package/services/mac-bridge/codex-types/v2/ConfigRequirements.ts +0 -9
- package/services/mac-bridge/codex-types/v2/ConfigRequirementsReadResponse.ts +0 -10
- package/services/mac-bridge/codex-types/v2/ConfigValueWriteParams.ts +0 -11
- package/services/mac-bridge/codex-types/v2/ConfigWarningNotification.ts +0 -22
- package/services/mac-bridge/codex-types/v2/ConfigWriteResponse.ts +0 -12
- package/services/mac-bridge/codex-types/v2/ContextCompactedNotification.ts +0 -8
- package/services/mac-bridge/codex-types/v2/CreditsSnapshot.ts +0 -5
- package/services/mac-bridge/codex-types/v2/DeprecationNoticeNotification.ts +0 -13
- package/services/mac-bridge/codex-types/v2/DynamicToolCallOutputContentItem.ts +0 -5
- package/services/mac-bridge/codex-types/v2/DynamicToolCallParams.ts +0 -6
- package/services/mac-bridge/codex-types/v2/DynamicToolCallResponse.ts +0 -6
- package/services/mac-bridge/codex-types/v2/DynamicToolSpec.ts +0 -6
- package/services/mac-bridge/codex-types/v2/ErrorNotification.ts +0 -6
- package/services/mac-bridge/codex-types/v2/ExecPolicyAmendment.ts +0 -5
- package/services/mac-bridge/codex-types/v2/ExperimentalFeature.ts +0 -37
- package/services/mac-bridge/codex-types/v2/ExperimentalFeatureListParams.ts +0 -13
- package/services/mac-bridge/codex-types/v2/ExperimentalFeatureListResponse.ts +0 -11
- package/services/mac-bridge/codex-types/v2/ExperimentalFeatureStage.ts +0 -5
- package/services/mac-bridge/codex-types/v2/FeedbackUploadParams.ts +0 -5
- package/services/mac-bridge/codex-types/v2/FeedbackUploadResponse.ts +0 -5
- package/services/mac-bridge/codex-types/v2/FileChangeApprovalDecision.ts +0 -5
- package/services/mac-bridge/codex-types/v2/FileChangeOutputDeltaNotification.ts +0 -5
- package/services/mac-bridge/codex-types/v2/FileChangeRequestApprovalParams.ts +0 -14
- package/services/mac-bridge/codex-types/v2/FileChangeRequestApprovalResponse.ts +0 -6
- package/services/mac-bridge/codex-types/v2/FileUpdateChange.ts +0 -6
- package/services/mac-bridge/codex-types/v2/GetAccountParams.ts +0 -13
- package/services/mac-bridge/codex-types/v2/GetAccountRateLimitsResponse.ts +0 -14
- package/services/mac-bridge/codex-types/v2/GetAccountResponse.ts +0 -6
- package/services/mac-bridge/codex-types/v2/GitInfo.ts +0 -5
- package/services/mac-bridge/codex-types/v2/HazelnutScope.ts +0 -5
- package/services/mac-bridge/codex-types/v2/ItemCompletedNotification.ts +0 -6
- package/services/mac-bridge/codex-types/v2/ItemStartedNotification.ts +0 -6
- package/services/mac-bridge/codex-types/v2/ListMcpServerStatusParams.ts +0 -13
- package/services/mac-bridge/codex-types/v2/ListMcpServerStatusResponse.ts +0 -11
- package/services/mac-bridge/codex-types/v2/LoginAccountParams.ts +0 -21
- package/services/mac-bridge/codex-types/v2/LoginAccountResponse.ts +0 -9
- package/services/mac-bridge/codex-types/v2/LogoutAccountResponse.ts +0 -5
- package/services/mac-bridge/codex-types/v2/McpAuthStatus.ts +0 -5
- package/services/mac-bridge/codex-types/v2/McpServerOauthLoginCompletedNotification.ts +0 -5
- package/services/mac-bridge/codex-types/v2/McpServerOauthLoginParams.ts +0 -5
- package/services/mac-bridge/codex-types/v2/McpServerOauthLoginResponse.ts +0 -5
- package/services/mac-bridge/codex-types/v2/McpServerRefreshResponse.ts +0 -5
- package/services/mac-bridge/codex-types/v2/McpServerStatus.ts +0 -9
- package/services/mac-bridge/codex-types/v2/McpToolCallError.ts +0 -5
- package/services/mac-bridge/codex-types/v2/McpToolCallProgressNotification.ts +0 -5
- package/services/mac-bridge/codex-types/v2/McpToolCallResult.ts +0 -6
- package/services/mac-bridge/codex-types/v2/McpToolCallStatus.ts +0 -5
- package/services/mac-bridge/codex-types/v2/MergeStrategy.ts +0 -5
- package/services/mac-bridge/codex-types/v2/Model.ts +0 -8
- package/services/mac-bridge/codex-types/v2/ModelListParams.ts +0 -17
- package/services/mac-bridge/codex-types/v2/ModelListResponse.ts +0 -11
- package/services/mac-bridge/codex-types/v2/ModelRerouteReason.ts +0 -5
- package/services/mac-bridge/codex-types/v2/ModelReroutedNotification.ts +0 -6
- package/services/mac-bridge/codex-types/v2/NetworkAccess.ts +0 -5
- package/services/mac-bridge/codex-types/v2/NetworkRequirements.ts +0 -5
- package/services/mac-bridge/codex-types/v2/OverriddenMetadata.ts +0 -7
- package/services/mac-bridge/codex-types/v2/PatchApplyStatus.ts +0 -5
- package/services/mac-bridge/codex-types/v2/PatchChangeKind.ts +0 -5
- package/services/mac-bridge/codex-types/v2/PlanDeltaNotification.ts +0 -9
- package/services/mac-bridge/codex-types/v2/ProductSurface.ts +0 -5
- package/services/mac-bridge/codex-types/v2/ProfileV2.ts +0 -11
- package/services/mac-bridge/codex-types/v2/RateLimitSnapshot.ts +0 -8
- package/services/mac-bridge/codex-types/v2/RateLimitWindow.ts +0 -5
- package/services/mac-bridge/codex-types/v2/RawResponseItemCompletedNotification.ts +0 -6
- package/services/mac-bridge/codex-types/v2/ReadOnlyAccess.ts +0 -6
- package/services/mac-bridge/codex-types/v2/ReasoningEffortOption.ts +0 -6
- package/services/mac-bridge/codex-types/v2/ReasoningSummaryPartAddedNotification.ts +0 -5
- package/services/mac-bridge/codex-types/v2/ReasoningSummaryTextDeltaNotification.ts +0 -5
- package/services/mac-bridge/codex-types/v2/ReasoningTextDeltaNotification.ts +0 -5
- package/services/mac-bridge/codex-types/v2/RemoteSkillSummary.ts +0 -5
- package/services/mac-bridge/codex-types/v2/ResidencyRequirement.ts +0 -5
- package/services/mac-bridge/codex-types/v2/ReviewDelivery.ts +0 -5
- package/services/mac-bridge/codex-types/v2/ReviewStartParams.ts +0 -12
- package/services/mac-bridge/codex-types/v2/ReviewStartResponse.ts +0 -13
- package/services/mac-bridge/codex-types/v2/ReviewTarget.ts +0 -9
- package/services/mac-bridge/codex-types/v2/SandboxMode.ts +0 -5
- package/services/mac-bridge/codex-types/v2/SandboxPolicy.ts +0 -8
- package/services/mac-bridge/codex-types/v2/SandboxWorkspaceWrite.ts +0 -5
- package/services/mac-bridge/codex-types/v2/SessionSource.ts +0 -6
- package/services/mac-bridge/codex-types/v2/SkillDependencies.ts +0 -6
- package/services/mac-bridge/codex-types/v2/SkillErrorInfo.ts +0 -5
- package/services/mac-bridge/codex-types/v2/SkillInterface.ts +0 -5
- package/services/mac-bridge/codex-types/v2/SkillMetadata.ts +0 -12
- package/services/mac-bridge/codex-types/v2/SkillScope.ts +0 -5
- package/services/mac-bridge/codex-types/v2/SkillToolDependency.ts +0 -5
- package/services/mac-bridge/codex-types/v2/SkillsConfigWriteParams.ts +0 -5
- package/services/mac-bridge/codex-types/v2/SkillsConfigWriteResponse.ts +0 -5
- package/services/mac-bridge/codex-types/v2/SkillsListEntry.ts +0 -7
- package/services/mac-bridge/codex-types/v2/SkillsListExtraRootsForCwd.ts +0 -5
- package/services/mac-bridge/codex-types/v2/SkillsListParams.ts +0 -18
- package/services/mac-bridge/codex-types/v2/SkillsListResponse.ts +0 -6
- package/services/mac-bridge/codex-types/v2/SkillsRemoteReadParams.ts +0 -7
- package/services/mac-bridge/codex-types/v2/SkillsRemoteReadResponse.ts +0 -6
- package/services/mac-bridge/codex-types/v2/SkillsRemoteWriteParams.ts +0 -5
- package/services/mac-bridge/codex-types/v2/SkillsRemoteWriteResponse.ts +0 -5
- package/services/mac-bridge/codex-types/v2/TerminalInteractionNotification.ts +0 -5
- package/services/mac-bridge/codex-types/v2/TextElement.ts +0 -14
- package/services/mac-bridge/codex-types/v2/TextPosition.ts +0 -13
- package/services/mac-bridge/codex-types/v2/TextRange.ts +0 -6
- package/services/mac-bridge/codex-types/v2/Thread.ts +0 -51
- package/services/mac-bridge/codex-types/v2/ThreadArchiveParams.ts +0 -5
- package/services/mac-bridge/codex-types/v2/ThreadArchiveResponse.ts +0 -5
- package/services/mac-bridge/codex-types/v2/ThreadArchivedNotification.ts +0 -5
- package/services/mac-bridge/codex-types/v2/ThreadCompactStartParams.ts +0 -5
- package/services/mac-bridge/codex-types/v2/ThreadCompactStartResponse.ts +0 -5
- package/services/mac-bridge/codex-types/v2/ThreadForkParams.ts +0 -28
- package/services/mac-bridge/codex-types/v2/ThreadForkResponse.ts +0 -9
- package/services/mac-bridge/codex-types/v2/ThreadItem.ts +0 -81
- package/services/mac-bridge/codex-types/v2/ThreadListParams.ts +0 -39
- package/services/mac-bridge/codex-types/v2/ThreadListResponse.ts +0 -11
- package/services/mac-bridge/codex-types/v2/ThreadLoadedListParams.ts +0 -13
- package/services/mac-bridge/codex-types/v2/ThreadLoadedListResponse.ts +0 -14
- package/services/mac-bridge/codex-types/v2/ThreadNameUpdatedNotification.ts +0 -5
- package/services/mac-bridge/codex-types/v2/ThreadReadParams.ts +0 -9
- package/services/mac-bridge/codex-types/v2/ThreadReadResponse.ts +0 -6
- package/services/mac-bridge/codex-types/v2/ThreadResumeParams.ts +0 -37
- package/services/mac-bridge/codex-types/v2/ThreadResumeResponse.ts +0 -9
- package/services/mac-bridge/codex-types/v2/ThreadRollbackParams.ts +0 -12
- package/services/mac-bridge/codex-types/v2/ThreadRollbackResponse.ts +0 -14
- package/services/mac-bridge/codex-types/v2/ThreadSetNameParams.ts +0 -5
- package/services/mac-bridge/codex-types/v2/ThreadSetNameResponse.ts +0 -5
- package/services/mac-bridge/codex-types/v2/ThreadSortKey.ts +0 -5
- package/services/mac-bridge/codex-types/v2/ThreadSourceKind.ts +0 -5
- package/services/mac-bridge/codex-types/v2/ThreadStartParams.ts +0 -17
- package/services/mac-bridge/codex-types/v2/ThreadStartResponse.ts +0 -9
- package/services/mac-bridge/codex-types/v2/ThreadStartedNotification.ts +0 -6
- package/services/mac-bridge/codex-types/v2/ThreadTokenUsage.ts +0 -6
- package/services/mac-bridge/codex-types/v2/ThreadTokenUsageUpdatedNotification.ts +0 -6
- package/services/mac-bridge/codex-types/v2/ThreadUnarchiveParams.ts +0 -5
- package/services/mac-bridge/codex-types/v2/ThreadUnarchiveResponse.ts +0 -6
- package/services/mac-bridge/codex-types/v2/ThreadUnarchivedNotification.ts +0 -5
- package/services/mac-bridge/codex-types/v2/TokenUsageBreakdown.ts +0 -5
- package/services/mac-bridge/codex-types/v2/ToolRequestUserInputAnswer.ts +0 -8
- package/services/mac-bridge/codex-types/v2/ToolRequestUserInputOption.ts +0 -8
- package/services/mac-bridge/codex-types/v2/ToolRequestUserInputParams.ts +0 -9
- package/services/mac-bridge/codex-types/v2/ToolRequestUserInputQuestion.ts +0 -9
- package/services/mac-bridge/codex-types/v2/ToolRequestUserInputResponse.ts +0 -9
- package/services/mac-bridge/codex-types/v2/ToolsV2.ts +0 -5
- package/services/mac-bridge/codex-types/v2/Turn.ts +0 -18
- package/services/mac-bridge/codex-types/v2/TurnCompletedNotification.ts +0 -6
- package/services/mac-bridge/codex-types/v2/TurnDiffUpdatedNotification.ts +0 -9
- package/services/mac-bridge/codex-types/v2/TurnError.ts +0 -6
- package/services/mac-bridge/codex-types/v2/TurnInterruptParams.ts +0 -5
- package/services/mac-bridge/codex-types/v2/TurnInterruptResponse.ts +0 -5
- package/services/mac-bridge/codex-types/v2/TurnPlanStep.ts +0 -6
- package/services/mac-bridge/codex-types/v2/TurnPlanStepStatus.ts +0 -5
- package/services/mac-bridge/codex-types/v2/TurnPlanUpdatedNotification.ts +0 -6
- package/services/mac-bridge/codex-types/v2/TurnStartParams.ts +0 -44
- package/services/mac-bridge/codex-types/v2/TurnStartResponse.ts +0 -6
- package/services/mac-bridge/codex-types/v2/TurnStartedNotification.ts +0 -6
- package/services/mac-bridge/codex-types/v2/TurnStatus.ts +0 -5
- package/services/mac-bridge/codex-types/v2/TurnSteerParams.ts +0 -11
- package/services/mac-bridge/codex-types/v2/TurnSteerResponse.ts +0 -5
- package/services/mac-bridge/codex-types/v2/UserInput.ts +0 -10
- package/services/mac-bridge/codex-types/v2/WebSearchAction.ts +0 -5
- package/services/mac-bridge/codex-types/v2/WindowsWorldWritableWarningNotification.ts +0 -5
- package/services/mac-bridge/codex-types/v2/WriteStatus.ts +0 -5
- package/services/mac-bridge/codex-types/v2/index.ts +0 -204
- package/services/mac-bridge/eslint.config.cjs +0 -22
- package/services/mac-bridge/package.json +0 -30
- package/services/mac-bridge/schema.ts +0 -0
- package/services/mac-bridge/src/index.ts +0 -18
- package/services/mac-bridge/src/server.ts +0 -426
- package/services/mac-bridge/src/services/__tests__/gitService.test.ts +0 -157
- package/services/mac-bridge/src/services/__tests__/realtimeHub.test.ts +0 -116
- package/services/mac-bridge/src/services/__tests__/terminalService.test.ts +0 -51
- package/services/mac-bridge/src/services/codexAppServerClient.ts +0 -507
- package/services/mac-bridge/src/services/codexCliAdapter.ts +0 -622
- package/services/mac-bridge/src/services/gitService.ts +0 -61
- package/services/mac-bridge/src/services/realtimeHub.ts +0 -25
- package/services/mac-bridge/src/services/terminalService.ts +0 -226
- package/services/mac-bridge/src/types.ts +0 -151
- package/services/mac-bridge/src/utils/__tests__/threadMapping.test.ts +0 -397
- package/services/mac-bridge/src/utils/threadMapping.ts +0 -176
- package/services/mac-bridge/tsconfig.json +0 -16
- package/services/mac-bridge/vitest.config.ts +0 -9
- package/services/rust-bridge/.env.example +0 -14
- package/services/rust-bridge/package.json +0 -13
- package/services/rust-bridge/security_best_practices_report.md +0 -24
- package/site/index.html +0 -54
- package/site/privacy/index.html +0 -80
- package/site/styles.css +0 -135
- package/site/support/index.html +0 -51
- package/site/terms/index.html +0 -68
- package/tsconfig.json +0 -4
|
@@ -1,1630 +0,0 @@
|
|
|
1
|
-
# Codex Desktop-Style Mobile Implementation Plan
|
|
2
|
-
|
|
3
|
-
> **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.
|
|
4
|
-
|
|
5
|
-
**Goal:** Replace the bottom tab navigator with a hidden left drawer and dark Codex-style theme across all screens, with a compose/chat main screen.
|
|
6
|
-
|
|
7
|
-
**Architecture:** React Navigation Drawer wraps all screens; custom DrawerContent renders the thread list + nav items; MainScreen combines the compose ("Let's build") view and the chat view in one screen controlled by `selectedThread` state.
|
|
8
|
-
|
|
9
|
-
**Tech Stack:** React Native 0.81, Expo 54, `@react-navigation/drawer`, `react-native-reanimated` (already transitively installed via gesture-handler), `@expo/vector-icons` (already installed)
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## Task 1: Install drawer dependency
|
|
14
|
-
|
|
15
|
-
**Files:**
|
|
16
|
-
- Modify: `apps/mobile/package.json`
|
|
17
|
-
|
|
18
|
-
**Step 1: Install the package**
|
|
19
|
-
|
|
20
|
-
```bash
|
|
21
|
-
cd apps/mobile
|
|
22
|
-
npx expo install @react-navigation/drawer
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
Expected output: `added N packages` with no errors.
|
|
26
|
-
|
|
27
|
-
**Step 2: Verify it resolves**
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
node -e "require('@react-navigation/drawer'); console.log('ok')"
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
Expected: `ok`
|
|
34
|
-
|
|
35
|
-
**Step 3: Commit**
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
git add apps/mobile/package.json package-lock.json
|
|
39
|
-
git commit -m "chore: add @react-navigation/drawer dependency"
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
---
|
|
43
|
-
|
|
44
|
-
## Task 2: Replace theme.ts with Codex dark theme
|
|
45
|
-
|
|
46
|
-
**Files:**
|
|
47
|
-
- Modify: `apps/mobile/src/theme.ts`
|
|
48
|
-
|
|
49
|
-
**Step 1: Replace the entire file**
|
|
50
|
-
|
|
51
|
-
```ts
|
|
52
|
-
// apps/mobile/src/theme.ts
|
|
53
|
-
import { Platform, StyleSheet } from 'react-native';
|
|
54
|
-
|
|
55
|
-
export const colors = {
|
|
56
|
-
// Backgrounds
|
|
57
|
-
bgMain: '#0D1117',
|
|
58
|
-
bgSidebar: '#161B22',
|
|
59
|
-
bgItem: '#21262D',
|
|
60
|
-
bgInput: '#161B22',
|
|
61
|
-
|
|
62
|
-
// Borders
|
|
63
|
-
border: '#30363D',
|
|
64
|
-
|
|
65
|
-
// Text
|
|
66
|
-
textPrimary: '#E6EDF3',
|
|
67
|
-
textMuted: '#8B949E',
|
|
68
|
-
|
|
69
|
-
// Accent
|
|
70
|
-
accent: '#E5622A',
|
|
71
|
-
accentPressed: '#C44E1F',
|
|
72
|
-
|
|
73
|
-
// Message bubbles
|
|
74
|
-
userBubble: '#1C2128',
|
|
75
|
-
|
|
76
|
-
// Status
|
|
77
|
-
statusRunning: '#3B82F6',
|
|
78
|
-
statusComplete: '#22C55E',
|
|
79
|
-
statusError: '#EF4444',
|
|
80
|
-
statusIdle: '#6B7280',
|
|
81
|
-
|
|
82
|
-
// Misc
|
|
83
|
-
error: '#EF4444',
|
|
84
|
-
errorBg: 'rgba(239, 68, 68, 0.1)',
|
|
85
|
-
white: '#FFFFFF',
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
export const spacing = {
|
|
89
|
-
xs: 4,
|
|
90
|
-
sm: 8,
|
|
91
|
-
md: 12,
|
|
92
|
-
lg: 16,
|
|
93
|
-
xl: 20,
|
|
94
|
-
xxl: 24,
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
export const radius = {
|
|
98
|
-
sm: 8,
|
|
99
|
-
md: 12,
|
|
100
|
-
lg: 16,
|
|
101
|
-
full: 999,
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
export const shadow = StyleSheet.create({
|
|
105
|
-
sm: Platform.select({
|
|
106
|
-
ios: {
|
|
107
|
-
shadowColor: '#000',
|
|
108
|
-
shadowOffset: { width: 0, height: 2 },
|
|
109
|
-
shadowOpacity: 0.3,
|
|
110
|
-
shadowRadius: 6,
|
|
111
|
-
},
|
|
112
|
-
default: { elevation: 3 },
|
|
113
|
-
}) as object,
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
export const typography = {
|
|
117
|
-
largeTitle: {
|
|
118
|
-
fontSize: 24,
|
|
119
|
-
fontWeight: '700' as const,
|
|
120
|
-
color: colors.textPrimary,
|
|
121
|
-
letterSpacing: -0.3,
|
|
122
|
-
},
|
|
123
|
-
headline: {
|
|
124
|
-
fontSize: 15,
|
|
125
|
-
fontWeight: '600' as const,
|
|
126
|
-
color: colors.textPrimary,
|
|
127
|
-
},
|
|
128
|
-
body: {
|
|
129
|
-
fontSize: 14,
|
|
130
|
-
fontWeight: '400' as const,
|
|
131
|
-
color: colors.textPrimary,
|
|
132
|
-
lineHeight: 20,
|
|
133
|
-
},
|
|
134
|
-
caption: {
|
|
135
|
-
fontSize: 12,
|
|
136
|
-
fontWeight: '400' as const,
|
|
137
|
-
color: colors.textMuted,
|
|
138
|
-
},
|
|
139
|
-
mono: {
|
|
140
|
-
fontSize: 12,
|
|
141
|
-
fontFamily: Platform.select({ ios: 'Menlo', default: 'monospace' }),
|
|
142
|
-
color: colors.textPrimary,
|
|
143
|
-
lineHeight: 18,
|
|
144
|
-
},
|
|
145
|
-
};
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
**Step 2: Commit**
|
|
149
|
-
|
|
150
|
-
```bash
|
|
151
|
-
git add apps/mobile/src/theme.ts
|
|
152
|
-
git commit -m "feat: replace theme with Codex dark palette"
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
---
|
|
156
|
-
|
|
157
|
-
## Task 3: Create DrawerContent component
|
|
158
|
-
|
|
159
|
-
**Files:**
|
|
160
|
-
- Create: `apps/mobile/src/navigation/DrawerContent.tsx`
|
|
161
|
-
|
|
162
|
-
**Step 1: Create the navigation directory**
|
|
163
|
-
|
|
164
|
-
```bash
|
|
165
|
-
mkdir -p apps/mobile/src/navigation
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
**Step 2: Create DrawerContent.tsx**
|
|
169
|
-
|
|
170
|
-
```tsx
|
|
171
|
-
// apps/mobile/src/navigation/DrawerContent.tsx
|
|
172
|
-
import { Ionicons } from '@expo/vector-icons';
|
|
173
|
-
import type { DrawerContentComponentProps } from '@react-navigation/drawer';
|
|
174
|
-
import { useCallback, useEffect, useState } from 'react';
|
|
175
|
-
import {
|
|
176
|
-
ActivityIndicator,
|
|
177
|
-
FlatList,
|
|
178
|
-
Pressable,
|
|
179
|
-
SafeAreaView,
|
|
180
|
-
StyleSheet,
|
|
181
|
-
Text,
|
|
182
|
-
View,
|
|
183
|
-
} from 'react-native';
|
|
184
|
-
|
|
185
|
-
import type { MacBridgeApiClient } from '../api/client';
|
|
186
|
-
import type { BridgeWsEvent, ThreadSummary } from '../api/types';
|
|
187
|
-
import type { MacBridgeWsClient } from '../api/ws';
|
|
188
|
-
import { colors, spacing, typography } from '../theme';
|
|
189
|
-
|
|
190
|
-
interface DrawerContentProps extends DrawerContentComponentProps {
|
|
191
|
-
api: MacBridgeApiClient;
|
|
192
|
-
ws: MacBridgeWsClient;
|
|
193
|
-
selectedThreadId: string | null;
|
|
194
|
-
onSelectThread: (id: string) => void;
|
|
195
|
-
onNewThread: () => void;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
export function DrawerContent({
|
|
199
|
-
navigation,
|
|
200
|
-
api,
|
|
201
|
-
ws,
|
|
202
|
-
selectedThreadId,
|
|
203
|
-
onSelectThread,
|
|
204
|
-
onNewThread,
|
|
205
|
-
}: DrawerContentProps) {
|
|
206
|
-
const [threads, setThreads] = useState<ThreadSummary[]>([]);
|
|
207
|
-
const [loading, setLoading] = useState(true);
|
|
208
|
-
|
|
209
|
-
const loadThreads = useCallback(async () => {
|
|
210
|
-
try {
|
|
211
|
-
const data = await api.listThreads();
|
|
212
|
-
setThreads(sortThreads(data));
|
|
213
|
-
} catch {
|
|
214
|
-
// silently fail - user will see empty list
|
|
215
|
-
} finally {
|
|
216
|
-
setLoading(false);
|
|
217
|
-
}
|
|
218
|
-
}, [api]);
|
|
219
|
-
|
|
220
|
-
useEffect(() => {
|
|
221
|
-
void loadThreads();
|
|
222
|
-
}, [loadThreads]);
|
|
223
|
-
|
|
224
|
-
useEffect(() => {
|
|
225
|
-
return ws.onEvent((event: BridgeWsEvent) => {
|
|
226
|
-
if (event.type === 'thread.created' || event.type === 'thread.updated') {
|
|
227
|
-
setThreads((prev) => upsertThread(prev, event.payload));
|
|
228
|
-
}
|
|
229
|
-
if (event.type === 'thread.message.delta') {
|
|
230
|
-
setThreads((prev) =>
|
|
231
|
-
prev.map((t) =>
|
|
232
|
-
t.id === event.payload.threadId
|
|
233
|
-
? { ...t, lastMessagePreview: event.payload.content, updatedAt: event.payload.updatedAt }
|
|
234
|
-
: t
|
|
235
|
-
)
|
|
236
|
-
);
|
|
237
|
-
}
|
|
238
|
-
});
|
|
239
|
-
}, [ws]);
|
|
240
|
-
|
|
241
|
-
const handleSelectThread = useCallback(
|
|
242
|
-
(id: string) => {
|
|
243
|
-
onSelectThread(id);
|
|
244
|
-
navigation.closeDrawer();
|
|
245
|
-
},
|
|
246
|
-
[onSelectThread, navigation]
|
|
247
|
-
);
|
|
248
|
-
|
|
249
|
-
const handleNewThread = useCallback(() => {
|
|
250
|
-
onNewThread();
|
|
251
|
-
navigation.closeDrawer();
|
|
252
|
-
}, [onNewThread, navigation]);
|
|
253
|
-
|
|
254
|
-
return (
|
|
255
|
-
<SafeAreaView style={styles.container}>
|
|
256
|
-
{/* New Thread button */}
|
|
257
|
-
<View style={styles.header}>
|
|
258
|
-
<Pressable
|
|
259
|
-
style={({ pressed }) => [styles.newThreadBtn, pressed && styles.newThreadBtnPressed]}
|
|
260
|
-
onPress={handleNewThread}
|
|
261
|
-
>
|
|
262
|
-
<Ionicons name="add" size={16} color={colors.white} />
|
|
263
|
-
<Text style={styles.newThreadText}>New thread</Text>
|
|
264
|
-
</Pressable>
|
|
265
|
-
</View>
|
|
266
|
-
|
|
267
|
-
{/* Nav items */}
|
|
268
|
-
<NavItem
|
|
269
|
-
icon="terminal-outline"
|
|
270
|
-
label="Terminal"
|
|
271
|
-
onPress={() => { navigation.navigate('Terminal'); }}
|
|
272
|
-
/>
|
|
273
|
-
<NavItem
|
|
274
|
-
icon="git-branch-outline"
|
|
275
|
-
label="Git"
|
|
276
|
-
onPress={() => { navigation.navigate('Git'); }}
|
|
277
|
-
/>
|
|
278
|
-
|
|
279
|
-
{/* Threads section */}
|
|
280
|
-
<View style={styles.sectionHeader}>
|
|
281
|
-
<Text style={styles.sectionTitle}>Threads</Text>
|
|
282
|
-
</View>
|
|
283
|
-
|
|
284
|
-
{loading ? (
|
|
285
|
-
<ActivityIndicator color={colors.textMuted} style={styles.loader} />
|
|
286
|
-
) : (
|
|
287
|
-
<FlatList
|
|
288
|
-
data={threads}
|
|
289
|
-
keyExtractor={(item) => item.id}
|
|
290
|
-
style={styles.list}
|
|
291
|
-
showsVerticalScrollIndicator={false}
|
|
292
|
-
ListEmptyComponent={
|
|
293
|
-
<Text style={styles.emptyText}>No threads yet</Text>
|
|
294
|
-
}
|
|
295
|
-
renderItem={({ item }) => (
|
|
296
|
-
<Pressable
|
|
297
|
-
style={({ pressed }) => [
|
|
298
|
-
styles.threadItem,
|
|
299
|
-
item.id === selectedThreadId && styles.threadItemSelected,
|
|
300
|
-
pressed && styles.threadItemPressed,
|
|
301
|
-
]}
|
|
302
|
-
onPress={() => handleSelectThread(item.id)}
|
|
303
|
-
>
|
|
304
|
-
<Text style={styles.threadTitle} numberOfLines={1}>
|
|
305
|
-
{item.title || 'Untitled'}
|
|
306
|
-
</Text>
|
|
307
|
-
<Text style={styles.threadAge}>
|
|
308
|
-
{relativeTime(item.updatedAt)}
|
|
309
|
-
</Text>
|
|
310
|
-
</Pressable>
|
|
311
|
-
)}
|
|
312
|
-
/>
|
|
313
|
-
)}
|
|
314
|
-
|
|
315
|
-
{/* Settings pinned at bottom */}
|
|
316
|
-
<NavItem
|
|
317
|
-
icon="settings-outline"
|
|
318
|
-
label="Settings"
|
|
319
|
-
onPress={() => { navigation.navigate('Settings'); }}
|
|
320
|
-
style={styles.settingsItem}
|
|
321
|
-
/>
|
|
322
|
-
</SafeAreaView>
|
|
323
|
-
);
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
function NavItem({
|
|
327
|
-
icon,
|
|
328
|
-
label,
|
|
329
|
-
onPress,
|
|
330
|
-
style,
|
|
331
|
-
}: {
|
|
332
|
-
icon: keyof typeof Ionicons.glyphMap;
|
|
333
|
-
label: string;
|
|
334
|
-
onPress: () => void;
|
|
335
|
-
style?: object;
|
|
336
|
-
}) {
|
|
337
|
-
return (
|
|
338
|
-
<Pressable
|
|
339
|
-
style={({ pressed }) => [styles.navItem, pressed && styles.navItemPressed, style]}
|
|
340
|
-
onPress={onPress}
|
|
341
|
-
>
|
|
342
|
-
<Ionicons name={icon} size={16} color={colors.textMuted} />
|
|
343
|
-
<Text style={styles.navLabel}>{label}</Text>
|
|
344
|
-
</Pressable>
|
|
345
|
-
);
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
function sortThreads(threads: ThreadSummary[]): ThreadSummary[] {
|
|
349
|
-
return [...threads].sort((a, b) => b.updatedAt.localeCompare(a.updatedAt));
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
function upsertThread(threads: ThreadSummary[], summary: ThreadSummary): ThreadSummary[] {
|
|
353
|
-
const idx = threads.findIndex((t) => t.id === summary.id);
|
|
354
|
-
const next = idx === -1 ? [...threads, summary] : threads.map((t, i) => (i === idx ? summary : t));
|
|
355
|
-
return sortThreads(next);
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
function relativeTime(iso: string): string {
|
|
359
|
-
const diff = Date.now() - new Date(iso).getTime();
|
|
360
|
-
const days = Math.floor(diff / 86400000);
|
|
361
|
-
if (days === 0) return 'today';
|
|
362
|
-
if (days === 1) return '1d';
|
|
363
|
-
return `${days}d`;
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
const styles = StyleSheet.create({
|
|
367
|
-
container: {
|
|
368
|
-
flex: 1,
|
|
369
|
-
backgroundColor: colors.bgSidebar,
|
|
370
|
-
},
|
|
371
|
-
header: {
|
|
372
|
-
paddingHorizontal: spacing.lg,
|
|
373
|
-
paddingTop: spacing.md,
|
|
374
|
-
paddingBottom: spacing.lg,
|
|
375
|
-
},
|
|
376
|
-
newThreadBtn: {
|
|
377
|
-
flexDirection: 'row',
|
|
378
|
-
alignItems: 'center',
|
|
379
|
-
gap: spacing.sm,
|
|
380
|
-
backgroundColor: colors.accent,
|
|
381
|
-
borderRadius: 8,
|
|
382
|
-
paddingHorizontal: spacing.md,
|
|
383
|
-
paddingVertical: spacing.sm,
|
|
384
|
-
},
|
|
385
|
-
newThreadBtnPressed: {
|
|
386
|
-
backgroundColor: colors.accentPressed,
|
|
387
|
-
},
|
|
388
|
-
newThreadText: {
|
|
389
|
-
...typography.headline,
|
|
390
|
-
color: colors.white,
|
|
391
|
-
fontSize: 14,
|
|
392
|
-
},
|
|
393
|
-
navItem: {
|
|
394
|
-
flexDirection: 'row',
|
|
395
|
-
alignItems: 'center',
|
|
396
|
-
gap: spacing.md,
|
|
397
|
-
paddingHorizontal: spacing.lg,
|
|
398
|
-
paddingVertical: spacing.sm + 2,
|
|
399
|
-
},
|
|
400
|
-
navItemPressed: {
|
|
401
|
-
backgroundColor: colors.bgItem,
|
|
402
|
-
},
|
|
403
|
-
navLabel: {
|
|
404
|
-
...typography.body,
|
|
405
|
-
color: colors.textMuted,
|
|
406
|
-
},
|
|
407
|
-
sectionHeader: {
|
|
408
|
-
paddingHorizontal: spacing.lg,
|
|
409
|
-
paddingTop: spacing.lg,
|
|
410
|
-
paddingBottom: spacing.sm,
|
|
411
|
-
},
|
|
412
|
-
sectionTitle: {
|
|
413
|
-
...typography.caption,
|
|
414
|
-
textTransform: 'uppercase',
|
|
415
|
-
letterSpacing: 0.8,
|
|
416
|
-
color: colors.textMuted,
|
|
417
|
-
},
|
|
418
|
-
list: {
|
|
419
|
-
flex: 1,
|
|
420
|
-
},
|
|
421
|
-
loader: {
|
|
422
|
-
marginTop: spacing.xl,
|
|
423
|
-
},
|
|
424
|
-
emptyText: {
|
|
425
|
-
...typography.caption,
|
|
426
|
-
textAlign: 'center',
|
|
427
|
-
marginTop: spacing.xl,
|
|
428
|
-
},
|
|
429
|
-
threadItem: {
|
|
430
|
-
flexDirection: 'row',
|
|
431
|
-
alignItems: 'center',
|
|
432
|
-
justifyContent: 'space-between',
|
|
433
|
-
paddingHorizontal: spacing.lg,
|
|
434
|
-
paddingVertical: spacing.sm + 2,
|
|
435
|
-
},
|
|
436
|
-
threadItemSelected: {
|
|
437
|
-
backgroundColor: colors.bgItem,
|
|
438
|
-
borderLeftWidth: 3,
|
|
439
|
-
borderLeftColor: colors.accent,
|
|
440
|
-
},
|
|
441
|
-
threadItemPressed: {
|
|
442
|
-
backgroundColor: colors.bgItem,
|
|
443
|
-
},
|
|
444
|
-
threadTitle: {
|
|
445
|
-
...typography.body,
|
|
446
|
-
flex: 1,
|
|
447
|
-
marginRight: spacing.sm,
|
|
448
|
-
},
|
|
449
|
-
threadAge: {
|
|
450
|
-
...typography.caption,
|
|
451
|
-
flexShrink: 0,
|
|
452
|
-
},
|
|
453
|
-
settingsItem: {
|
|
454
|
-
borderTopWidth: StyleSheet.hairlineWidth,
|
|
455
|
-
borderTopColor: colors.border,
|
|
456
|
-
marginTop: spacing.sm,
|
|
457
|
-
paddingTop: spacing.md,
|
|
458
|
-
},
|
|
459
|
-
});
|
|
460
|
-
```
|
|
461
|
-
|
|
462
|
-
**Step 3: Commit**
|
|
463
|
-
|
|
464
|
-
```bash
|
|
465
|
-
git add apps/mobile/src/navigation/DrawerContent.tsx
|
|
466
|
-
git commit -m "feat: add DrawerContent component with thread list"
|
|
467
|
-
```
|
|
468
|
-
|
|
469
|
-
---
|
|
470
|
-
|
|
471
|
-
## Task 4: Create MainScreen (compose + chat)
|
|
472
|
-
|
|
473
|
-
**Files:**
|
|
474
|
-
- Create: `apps/mobile/src/screens/MainScreen.tsx`
|
|
475
|
-
|
|
476
|
-
This screen has two internal states controlled by `selectedThread`:
|
|
477
|
-
- `null` → compose view ("Let's build")
|
|
478
|
-
- `Thread` → chat view with messages
|
|
479
|
-
|
|
480
|
-
```tsx
|
|
481
|
-
// apps/mobile/src/screens/MainScreen.tsx
|
|
482
|
-
import { Ionicons } from '@expo/vector-icons';
|
|
483
|
-
import { useDrawerStatus } from '@react-navigation/drawer';
|
|
484
|
-
import type { DrawerNavigationProp } from '@react-navigation/drawer';
|
|
485
|
-
import {
|
|
486
|
-
type Dispatch,
|
|
487
|
-
type SetStateAction,
|
|
488
|
-
forwardRef,
|
|
489
|
-
useCallback,
|
|
490
|
-
useEffect,
|
|
491
|
-
useImperativeHandle,
|
|
492
|
-
useRef,
|
|
493
|
-
useState,
|
|
494
|
-
} from 'react';
|
|
495
|
-
import {
|
|
496
|
-
ActivityIndicator,
|
|
497
|
-
FlatList,
|
|
498
|
-
KeyboardAvoidingView,
|
|
499
|
-
Platform,
|
|
500
|
-
Pressable,
|
|
501
|
-
SafeAreaView,
|
|
502
|
-
ScrollView,
|
|
503
|
-
StyleSheet,
|
|
504
|
-
Text,
|
|
505
|
-
TextInput,
|
|
506
|
-
View,
|
|
507
|
-
} from 'react-native';
|
|
508
|
-
|
|
509
|
-
import type { MacBridgeApiClient } from '../api/client';
|
|
510
|
-
import type { BridgeWsEvent, Thread, ThreadMessage, ThreadSummary } from '../api/types';
|
|
511
|
-
import type { MacBridgeWsClient } from '../api/ws';
|
|
512
|
-
import { colors, radius, spacing, typography } from '../theme';
|
|
513
|
-
|
|
514
|
-
export interface MainScreenHandle {
|
|
515
|
-
openThread: (id: string) => void;
|
|
516
|
-
startNewThread: () => void;
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
interface MainScreenProps {
|
|
520
|
-
api: MacBridgeApiClient;
|
|
521
|
-
ws: MacBridgeWsClient;
|
|
522
|
-
navigation: DrawerNavigationProp<Record<string, undefined>>;
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
const SUGGESTIONS = [
|
|
526
|
-
'Explain the current codebase structure',
|
|
527
|
-
'Write tests for the main module',
|
|
528
|
-
'Find and fix any TypeScript errors',
|
|
529
|
-
'Summarize recent git changes',
|
|
530
|
-
];
|
|
531
|
-
|
|
532
|
-
export const MainScreen = forwardRef<MainScreenHandle, MainScreenProps>(
|
|
533
|
-
function MainScreen({ api, ws, navigation }, ref) {
|
|
534
|
-
const [selectedThread, setSelectedThread] = useState<Thread | null>(null);
|
|
535
|
-
const [selectedThreadId, setSelectedThreadId] = useState<string | null>(null);
|
|
536
|
-
const [draft, setDraft] = useState('');
|
|
537
|
-
const [sending, setSending] = useState(false);
|
|
538
|
-
const [creating, setCreating] = useState(false);
|
|
539
|
-
const [error, setError] = useState<string | null>(null);
|
|
540
|
-
const scrollRef = useRef<ScrollView>(null);
|
|
541
|
-
|
|
542
|
-
// Expose imperative handle so DrawerContent can drive selection
|
|
543
|
-
useImperativeHandle(ref, () => ({
|
|
544
|
-
openThread: (id: string) => {
|
|
545
|
-
void loadThread(id);
|
|
546
|
-
},
|
|
547
|
-
startNewThread: () => {
|
|
548
|
-
setSelectedThread(null);
|
|
549
|
-
setSelectedThreadId(null);
|
|
550
|
-
setDraft('');
|
|
551
|
-
setError(null);
|
|
552
|
-
},
|
|
553
|
-
}));
|
|
554
|
-
|
|
555
|
-
const loadThread = useCallback(
|
|
556
|
-
async (threadId: string) => {
|
|
557
|
-
try {
|
|
558
|
-
const thread = await api.getThread(threadId);
|
|
559
|
-
setSelectedThreadId(threadId);
|
|
560
|
-
setSelectedThread(thread);
|
|
561
|
-
setError(null);
|
|
562
|
-
} catch (err) {
|
|
563
|
-
setError((err as Error).message);
|
|
564
|
-
}
|
|
565
|
-
},
|
|
566
|
-
[api]
|
|
567
|
-
);
|
|
568
|
-
|
|
569
|
-
const createThread = useCallback(async () => {
|
|
570
|
-
const content = draft.trim();
|
|
571
|
-
if (!content) return;
|
|
572
|
-
try {
|
|
573
|
-
setCreating(true);
|
|
574
|
-
const created = await api.createThread({ message: content });
|
|
575
|
-
setDraft('');
|
|
576
|
-
setSelectedThreadId(created.id);
|
|
577
|
-
setSelectedThread(created);
|
|
578
|
-
setError(null);
|
|
579
|
-
} catch (err) {
|
|
580
|
-
setError((err as Error).message);
|
|
581
|
-
} finally {
|
|
582
|
-
setCreating(false);
|
|
583
|
-
}
|
|
584
|
-
}, [api, draft]);
|
|
585
|
-
|
|
586
|
-
const sendMessage = useCallback(async () => {
|
|
587
|
-
if (!selectedThreadId || !draft.trim()) return;
|
|
588
|
-
try {
|
|
589
|
-
setSending(true);
|
|
590
|
-
const updated = await api.sendThreadMessage(selectedThreadId, { content: draft.trim() });
|
|
591
|
-
setDraft('');
|
|
592
|
-
setSelectedThread(updated);
|
|
593
|
-
setError(null);
|
|
594
|
-
} catch (err) {
|
|
595
|
-
setError((err as Error).message);
|
|
596
|
-
} finally {
|
|
597
|
-
setSending(false);
|
|
598
|
-
}
|
|
599
|
-
}, [api, draft, selectedThreadId]);
|
|
600
|
-
|
|
601
|
-
// WebSocket updates
|
|
602
|
-
useEffect(() => {
|
|
603
|
-
return ws.onEvent((event: BridgeWsEvent) => {
|
|
604
|
-
if (event.type === 'thread.message') {
|
|
605
|
-
setSelectedThread((prev) => {
|
|
606
|
-
if (!prev || prev.id !== event.payload.threadId) return prev;
|
|
607
|
-
return {
|
|
608
|
-
...prev,
|
|
609
|
-
messages: upsertMessage(prev.messages, event.payload.message),
|
|
610
|
-
};
|
|
611
|
-
});
|
|
612
|
-
}
|
|
613
|
-
if (event.type === 'thread.message.delta') {
|
|
614
|
-
setSelectedThread((prev) => {
|
|
615
|
-
if (!prev || prev.id !== event.payload.threadId) return prev;
|
|
616
|
-
const exists = prev.messages.find((m) => m.id === event.payload.messageId);
|
|
617
|
-
const streamed: ThreadMessage = {
|
|
618
|
-
id: event.payload.messageId,
|
|
619
|
-
role: 'assistant',
|
|
620
|
-
content: event.payload.content,
|
|
621
|
-
createdAt: event.payload.updatedAt,
|
|
622
|
-
};
|
|
623
|
-
const messages = exists
|
|
624
|
-
? prev.messages.map((m) =>
|
|
625
|
-
m.id === event.payload.messageId ? { ...m, content: event.payload.content } : m
|
|
626
|
-
)
|
|
627
|
-
: [...prev.messages, streamed];
|
|
628
|
-
return { ...prev, messages };
|
|
629
|
-
});
|
|
630
|
-
// Scroll to bottom on new content
|
|
631
|
-
setTimeout(() => scrollRef.current?.scrollToEnd({ animated: true }), 50);
|
|
632
|
-
}
|
|
633
|
-
if (event.type === 'thread.updated' && selectedThreadId === event.payload.id) {
|
|
634
|
-
setSelectedThread((prev) => prev ? { ...prev, ...event.payload } : prev);
|
|
635
|
-
}
|
|
636
|
-
});
|
|
637
|
-
}, [ws, selectedThreadId]);
|
|
638
|
-
|
|
639
|
-
const handleSubmit = selectedThread ? sendMessage : createThread;
|
|
640
|
-
const isLoading = sending || creating;
|
|
641
|
-
|
|
642
|
-
return (
|
|
643
|
-
<SafeAreaView style={styles.container}>
|
|
644
|
-
{/* Header */}
|
|
645
|
-
<View style={styles.header}>
|
|
646
|
-
<Pressable onPress={() => navigation.openDrawer()} hitSlop={8}>
|
|
647
|
-
<Ionicons name="menu" size={22} color={colors.textMuted} />
|
|
648
|
-
</Pressable>
|
|
649
|
-
{selectedThread ? (
|
|
650
|
-
<Text style={styles.headerTitle} numberOfLines={1}>
|
|
651
|
-
{selectedThread.title || 'Thread'}
|
|
652
|
-
</Text>
|
|
653
|
-
) : (
|
|
654
|
-
<View style={{ flex: 1 }} />
|
|
655
|
-
)}
|
|
656
|
-
</View>
|
|
657
|
-
|
|
658
|
-
{/* Body */}
|
|
659
|
-
{selectedThread ? (
|
|
660
|
-
<ChatView
|
|
661
|
-
thread={selectedThread}
|
|
662
|
-
scrollRef={scrollRef}
|
|
663
|
-
/>
|
|
664
|
-
) : (
|
|
665
|
-
<ComposeView
|
|
666
|
-
onSuggestion={(s) => setDraft(s)}
|
|
667
|
-
/>
|
|
668
|
-
)}
|
|
669
|
-
|
|
670
|
-
{/* Error */}
|
|
671
|
-
{error ? (
|
|
672
|
-
<Text style={styles.errorText}>{error}</Text>
|
|
673
|
-
) : null}
|
|
674
|
-
|
|
675
|
-
{/* Input bar */}
|
|
676
|
-
<KeyboardAvoidingView
|
|
677
|
-
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
|
|
678
|
-
keyboardVerticalOffset={0}
|
|
679
|
-
>
|
|
680
|
-
<View style={styles.inputBar}>
|
|
681
|
-
<TextInput
|
|
682
|
-
style={styles.input}
|
|
683
|
-
value={draft}
|
|
684
|
-
onChangeText={setDraft}
|
|
685
|
-
placeholder={selectedThread ? 'Reply...' : 'Ask Codex anything, @ to add files'}
|
|
686
|
-
placeholderTextColor={colors.textMuted}
|
|
687
|
-
multiline
|
|
688
|
-
returnKeyType="send"
|
|
689
|
-
onSubmitEditing={() => void handleSubmit()}
|
|
690
|
-
/>
|
|
691
|
-
<Pressable
|
|
692
|
-
onPress={() => void handleSubmit()}
|
|
693
|
-
disabled={isLoading || !draft.trim()}
|
|
694
|
-
style={({ pressed }) => [
|
|
695
|
-
styles.sendBtn,
|
|
696
|
-
(!draft.trim() || isLoading) && styles.sendBtnDisabled,
|
|
697
|
-
pressed && styles.sendBtnPressed,
|
|
698
|
-
]}
|
|
699
|
-
>
|
|
700
|
-
{isLoading ? (
|
|
701
|
-
<ActivityIndicator size="small" color={colors.white} />
|
|
702
|
-
) : (
|
|
703
|
-
<Ionicons name="arrow-up" size={16} color={colors.white} />
|
|
704
|
-
)}
|
|
705
|
-
</Pressable>
|
|
706
|
-
</View>
|
|
707
|
-
</KeyboardAvoidingView>
|
|
708
|
-
</SafeAreaView>
|
|
709
|
-
);
|
|
710
|
-
}
|
|
711
|
-
);
|
|
712
|
-
|
|
713
|
-
// ── Compose View ───────────────────────────────────────────────────
|
|
714
|
-
|
|
715
|
-
function ComposeView({ onSuggestion }: { onSuggestion: (s: string) => void }) {
|
|
716
|
-
return (
|
|
717
|
-
<View style={styles.composeContainer}>
|
|
718
|
-
<Ionicons name="cube-outline" size={40} color={colors.textMuted} style={styles.composeIcon} />
|
|
719
|
-
<Text style={styles.composeTitle}>Let's build</Text>
|
|
720
|
-
<Text style={styles.composeSubtitle}>clawdex-mobile</Text>
|
|
721
|
-
<View style={styles.suggestions}>
|
|
722
|
-
{SUGGESTIONS.slice(0, 2).map((s) => (
|
|
723
|
-
<Pressable
|
|
724
|
-
key={s}
|
|
725
|
-
style={({ pressed }) => [styles.suggestionCard, pressed && styles.suggestionCardPressed]}
|
|
726
|
-
onPress={() => onSuggestion(s)}
|
|
727
|
-
>
|
|
728
|
-
<Text style={styles.suggestionText}>{s}</Text>
|
|
729
|
-
</Pressable>
|
|
730
|
-
))}
|
|
731
|
-
</View>
|
|
732
|
-
</View>
|
|
733
|
-
);
|
|
734
|
-
}
|
|
735
|
-
|
|
736
|
-
// ── Chat View ──────────────────────────────────────────────────────
|
|
737
|
-
|
|
738
|
-
function ChatView({
|
|
739
|
-
thread,
|
|
740
|
-
scrollRef,
|
|
741
|
-
}: {
|
|
742
|
-
thread: Thread;
|
|
743
|
-
scrollRef: React.RefObject<ScrollView | null>;
|
|
744
|
-
}) {
|
|
745
|
-
return (
|
|
746
|
-
<ScrollView
|
|
747
|
-
ref={scrollRef}
|
|
748
|
-
style={styles.messageList}
|
|
749
|
-
contentContainerStyle={styles.messageListContent}
|
|
750
|
-
showsVerticalScrollIndicator={false}
|
|
751
|
-
onContentSizeChange={() => scrollRef.current?.scrollToEnd({ animated: false })}
|
|
752
|
-
>
|
|
753
|
-
{thread.messages.map((msg) => (
|
|
754
|
-
<MessageBubble key={msg.id} message={msg} />
|
|
755
|
-
))}
|
|
756
|
-
</ScrollView>
|
|
757
|
-
);
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
function MessageBubble({ message }: { message: ThreadMessage }) {
|
|
761
|
-
const isUser = message.role === 'user';
|
|
762
|
-
return (
|
|
763
|
-
<View style={styles.messageWrapper}>
|
|
764
|
-
<Text style={styles.roleLabel}>{isUser ? 'YOU' : 'CODEX'}</Text>
|
|
765
|
-
<View style={[styles.bubble, isUser ? styles.userBubble : styles.assistantBubble]}>
|
|
766
|
-
<Text style={styles.messageText}>
|
|
767
|
-
{message.content || '▍'}
|
|
768
|
-
</Text>
|
|
769
|
-
</View>
|
|
770
|
-
</View>
|
|
771
|
-
);
|
|
772
|
-
}
|
|
773
|
-
|
|
774
|
-
// ── Helpers ────────────────────────────────────────────────────────
|
|
775
|
-
|
|
776
|
-
function upsertMessage(messages: ThreadMessage[], message: ThreadMessage): ThreadMessage[] {
|
|
777
|
-
const idx = messages.findIndex((m) => m.id === message.id);
|
|
778
|
-
if (idx === -1) return [...messages, message];
|
|
779
|
-
return messages.map((m, i) => (i === idx ? message : m));
|
|
780
|
-
}
|
|
781
|
-
|
|
782
|
-
// ── Styles ─────────────────────────────────────────────────────────
|
|
783
|
-
|
|
784
|
-
const styles = StyleSheet.create({
|
|
785
|
-
container: {
|
|
786
|
-
flex: 1,
|
|
787
|
-
backgroundColor: colors.bgMain,
|
|
788
|
-
},
|
|
789
|
-
header: {
|
|
790
|
-
flexDirection: 'row',
|
|
791
|
-
alignItems: 'center',
|
|
792
|
-
gap: spacing.md,
|
|
793
|
-
paddingHorizontal: spacing.lg,
|
|
794
|
-
paddingVertical: spacing.md,
|
|
795
|
-
borderBottomWidth: StyleSheet.hairlineWidth,
|
|
796
|
-
borderBottomColor: colors.border,
|
|
797
|
-
},
|
|
798
|
-
headerTitle: {
|
|
799
|
-
...typography.headline,
|
|
800
|
-
flex: 1,
|
|
801
|
-
},
|
|
802
|
-
|
|
803
|
-
// Compose
|
|
804
|
-
composeContainer: {
|
|
805
|
-
flex: 1,
|
|
806
|
-
alignItems: 'center',
|
|
807
|
-
justifyContent: 'center',
|
|
808
|
-
paddingHorizontal: spacing.xl,
|
|
809
|
-
paddingBottom: spacing.xxl * 2,
|
|
810
|
-
},
|
|
811
|
-
composeIcon: {
|
|
812
|
-
marginBottom: spacing.lg,
|
|
813
|
-
},
|
|
814
|
-
composeTitle: {
|
|
815
|
-
fontSize: 28,
|
|
816
|
-
fontWeight: '700',
|
|
817
|
-
color: colors.textPrimary,
|
|
818
|
-
marginBottom: spacing.xs,
|
|
819
|
-
},
|
|
820
|
-
composeSubtitle: {
|
|
821
|
-
...typography.body,
|
|
822
|
-
color: colors.textMuted,
|
|
823
|
-
marginBottom: spacing.xl * 2,
|
|
824
|
-
},
|
|
825
|
-
suggestions: {
|
|
826
|
-
flexDirection: 'row',
|
|
827
|
-
gap: spacing.md,
|
|
828
|
-
},
|
|
829
|
-
suggestionCard: {
|
|
830
|
-
flex: 1,
|
|
831
|
-
backgroundColor: colors.bgItem,
|
|
832
|
-
borderWidth: StyleSheet.hairlineWidth,
|
|
833
|
-
borderColor: colors.border,
|
|
834
|
-
borderRadius: radius.md,
|
|
835
|
-
padding: spacing.md,
|
|
836
|
-
},
|
|
837
|
-
suggestionCardPressed: {
|
|
838
|
-
backgroundColor: colors.bgSidebar,
|
|
839
|
-
},
|
|
840
|
-
suggestionText: {
|
|
841
|
-
...typography.caption,
|
|
842
|
-
color: colors.textPrimary,
|
|
843
|
-
lineHeight: 18,
|
|
844
|
-
},
|
|
845
|
-
|
|
846
|
-
// Chat
|
|
847
|
-
messageList: {
|
|
848
|
-
flex: 1,
|
|
849
|
-
},
|
|
850
|
-
messageListContent: {
|
|
851
|
-
padding: spacing.lg,
|
|
852
|
-
paddingBottom: spacing.xxl,
|
|
853
|
-
gap: spacing.lg,
|
|
854
|
-
},
|
|
855
|
-
messageWrapper: {
|
|
856
|
-
gap: spacing.xs,
|
|
857
|
-
},
|
|
858
|
-
roleLabel: {
|
|
859
|
-
fontSize: 11,
|
|
860
|
-
fontWeight: '600',
|
|
861
|
-
color: colors.textMuted,
|
|
862
|
-
letterSpacing: 0.8,
|
|
863
|
-
},
|
|
864
|
-
bubble: {
|
|
865
|
-
borderRadius: radius.md,
|
|
866
|
-
padding: spacing.md,
|
|
867
|
-
},
|
|
868
|
-
userBubble: {
|
|
869
|
-
backgroundColor: colors.userBubble,
|
|
870
|
-
borderWidth: StyleSheet.hairlineWidth,
|
|
871
|
-
borderColor: colors.border,
|
|
872
|
-
},
|
|
873
|
-
assistantBubble: {
|
|
874
|
-
backgroundColor: 'transparent',
|
|
875
|
-
paddingHorizontal: 0,
|
|
876
|
-
},
|
|
877
|
-
messageText: {
|
|
878
|
-
...typography.body,
|
|
879
|
-
},
|
|
880
|
-
|
|
881
|
-
// Input bar
|
|
882
|
-
inputBar: {
|
|
883
|
-
flexDirection: 'row',
|
|
884
|
-
alignItems: 'flex-end',
|
|
885
|
-
gap: spacing.sm,
|
|
886
|
-
paddingHorizontal: spacing.lg,
|
|
887
|
-
paddingVertical: spacing.md,
|
|
888
|
-
borderTopWidth: StyleSheet.hairlineWidth,
|
|
889
|
-
borderTopColor: colors.border,
|
|
890
|
-
backgroundColor: colors.bgMain,
|
|
891
|
-
},
|
|
892
|
-
input: {
|
|
893
|
-
flex: 1,
|
|
894
|
-
backgroundColor: colors.bgSidebar,
|
|
895
|
-
borderWidth: StyleSheet.hairlineWidth,
|
|
896
|
-
borderColor: colors.border,
|
|
897
|
-
borderRadius: radius.md,
|
|
898
|
-
paddingHorizontal: spacing.md,
|
|
899
|
-
paddingVertical: spacing.sm + 2,
|
|
900
|
-
color: colors.textPrimary,
|
|
901
|
-
fontSize: 14,
|
|
902
|
-
maxHeight: 120,
|
|
903
|
-
},
|
|
904
|
-
sendBtn: {
|
|
905
|
-
width: 34,
|
|
906
|
-
height: 34,
|
|
907
|
-
borderRadius: 17,
|
|
908
|
-
backgroundColor: colors.accent,
|
|
909
|
-
alignItems: 'center',
|
|
910
|
-
justifyContent: 'center',
|
|
911
|
-
},
|
|
912
|
-
sendBtnDisabled: {
|
|
913
|
-
backgroundColor: colors.bgItem,
|
|
914
|
-
},
|
|
915
|
-
sendBtnPressed: {
|
|
916
|
-
backgroundColor: colors.accentPressed,
|
|
917
|
-
},
|
|
918
|
-
|
|
919
|
-
// Error
|
|
920
|
-
errorText: {
|
|
921
|
-
...typography.caption,
|
|
922
|
-
color: colors.error,
|
|
923
|
-
paddingHorizontal: spacing.lg,
|
|
924
|
-
paddingBottom: spacing.xs,
|
|
925
|
-
},
|
|
926
|
-
});
|
|
927
|
-
```
|
|
928
|
-
|
|
929
|
-
**Step 2: Commit**
|
|
930
|
-
|
|
931
|
-
```bash
|
|
932
|
-
git add apps/mobile/src/screens/MainScreen.tsx
|
|
933
|
-
git commit -m "feat: add MainScreen with compose and chat views"
|
|
934
|
-
```
|
|
935
|
-
|
|
936
|
-
---
|
|
937
|
-
|
|
938
|
-
## Task 5: Rewrite App.tsx with DrawerNavigator
|
|
939
|
-
|
|
940
|
-
**Files:**
|
|
941
|
-
- Modify: `apps/mobile/App.tsx`
|
|
942
|
-
|
|
943
|
-
**Step 1: Replace App.tsx entirely**
|
|
944
|
-
|
|
945
|
-
```tsx
|
|
946
|
-
// apps/mobile/App.tsx
|
|
947
|
-
import 'react-native-gesture-handler';
|
|
948
|
-
|
|
949
|
-
import { createDrawerNavigator } from '@react-navigation/drawer';
|
|
950
|
-
import { NavigationContainer } from '@react-navigation/native';
|
|
951
|
-
import { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
952
|
-
import { View } from 'react-native';
|
|
953
|
-
|
|
954
|
-
import { MacBridgeApiClient } from './src/api/client';
|
|
955
|
-
import { MacBridgeWsClient } from './src/api/ws';
|
|
956
|
-
import { env } from './src/config';
|
|
957
|
-
import { DrawerContent } from './src/navigation/DrawerContent';
|
|
958
|
-
import { GitScreen } from './src/screens/GitScreen';
|
|
959
|
-
import { MainScreen, type MainScreenHandle } from './src/screens/MainScreen';
|
|
960
|
-
import { SettingsScreen } from './src/screens/SettingsScreen';
|
|
961
|
-
import { TerminalScreen } from './src/screens/TerminalScreen';
|
|
962
|
-
import { colors } from './src/theme';
|
|
963
|
-
|
|
964
|
-
type DrawerParamList = {
|
|
965
|
-
Main: undefined;
|
|
966
|
-
Terminal: undefined;
|
|
967
|
-
Git: undefined;
|
|
968
|
-
Settings: undefined;
|
|
969
|
-
};
|
|
970
|
-
|
|
971
|
-
const Drawer = createDrawerNavigator<DrawerParamList>();
|
|
972
|
-
|
|
973
|
-
export default function App() {
|
|
974
|
-
const api = useMemo(() => new MacBridgeApiClient({ baseUrl: env.macBridgeUrl }), []);
|
|
975
|
-
const ws = useMemo(() => new MacBridgeWsClient(api.wsUrl()), [api]);
|
|
976
|
-
const mainRef = useRef<MainScreenHandle>(null);
|
|
977
|
-
|
|
978
|
-
useEffect(() => {
|
|
979
|
-
ws.connect();
|
|
980
|
-
return () => ws.disconnect();
|
|
981
|
-
}, [ws]);
|
|
982
|
-
|
|
983
|
-
const handleSelectThread = useCallback((id: string) => {
|
|
984
|
-
mainRef.current?.openThread(id);
|
|
985
|
-
}, []);
|
|
986
|
-
|
|
987
|
-
const handleNewThread = useCallback(() => {
|
|
988
|
-
mainRef.current?.startNewThread();
|
|
989
|
-
}, []);
|
|
990
|
-
|
|
991
|
-
return (
|
|
992
|
-
<View style={{ flex: 1, backgroundColor: colors.bgMain }}>
|
|
993
|
-
<NavigationContainer>
|
|
994
|
-
<Drawer.Navigator
|
|
995
|
-
drawerContent={(props) => (
|
|
996
|
-
<DrawerContent
|
|
997
|
-
{...props}
|
|
998
|
-
api={api}
|
|
999
|
-
ws={ws}
|
|
1000
|
-
selectedThreadId={null}
|
|
1001
|
-
onSelectThread={handleSelectThread}
|
|
1002
|
-
onNewThread={handleNewThread}
|
|
1003
|
-
/>
|
|
1004
|
-
)}
|
|
1005
|
-
screenOptions={{
|
|
1006
|
-
headerShown: false,
|
|
1007
|
-
drawerStyle: { width: 280, backgroundColor: colors.bgSidebar },
|
|
1008
|
-
drawerType: 'front',
|
|
1009
|
-
overlayColor: 'rgba(0,0,0,0.5)',
|
|
1010
|
-
swipeEdgeWidth: 40,
|
|
1011
|
-
}}
|
|
1012
|
-
>
|
|
1013
|
-
<Drawer.Screen name="Main">
|
|
1014
|
-
{({ navigation }) => (
|
|
1015
|
-
<MainScreen ref={mainRef} api={api} ws={ws} navigation={navigation} />
|
|
1016
|
-
)}
|
|
1017
|
-
</Drawer.Screen>
|
|
1018
|
-
<Drawer.Screen name="Terminal">
|
|
1019
|
-
{() => <TerminalScreen api={api} ws={ws} />}
|
|
1020
|
-
</Drawer.Screen>
|
|
1021
|
-
<Drawer.Screen name="Git">
|
|
1022
|
-
{() => <GitScreen api={api} />}
|
|
1023
|
-
</Drawer.Screen>
|
|
1024
|
-
<Drawer.Screen name="Settings">
|
|
1025
|
-
{() => <SettingsScreen api={api} ws={ws} bridgeUrl={env.macBridgeUrl} />}
|
|
1026
|
-
</Drawer.Screen>
|
|
1027
|
-
</Drawer.Navigator>
|
|
1028
|
-
</NavigationContainer>
|
|
1029
|
-
</View>
|
|
1030
|
-
);
|
|
1031
|
-
}
|
|
1032
|
-
```
|
|
1033
|
-
|
|
1034
|
-
**Step 2: Commit**
|
|
1035
|
-
|
|
1036
|
-
```bash
|
|
1037
|
-
git add apps/mobile/App.tsx
|
|
1038
|
-
git commit -m "feat: replace bottom tabs with drawer navigator"
|
|
1039
|
-
```
|
|
1040
|
-
|
|
1041
|
-
---
|
|
1042
|
-
|
|
1043
|
-
## Task 6: Dark-theme TerminalScreen
|
|
1044
|
-
|
|
1045
|
-
**Files:**
|
|
1046
|
-
- Modify: `apps/mobile/src/screens/TerminalScreen.tsx`
|
|
1047
|
-
|
|
1048
|
-
Replace the entire file with a dark-themed version (no Glass imports):
|
|
1049
|
-
|
|
1050
|
-
```tsx
|
|
1051
|
-
// apps/mobile/src/screens/TerminalScreen.tsx
|
|
1052
|
-
import { Ionicons } from '@expo/vector-icons';
|
|
1053
|
-
import { useCallback, useEffect, useState } from 'react';
|
|
1054
|
-
import {
|
|
1055
|
-
KeyboardAvoidingView,
|
|
1056
|
-
Platform,
|
|
1057
|
-
Pressable,
|
|
1058
|
-
SafeAreaView,
|
|
1059
|
-
ScrollView,
|
|
1060
|
-
StyleSheet,
|
|
1061
|
-
Text,
|
|
1062
|
-
TextInput,
|
|
1063
|
-
View,
|
|
1064
|
-
} from 'react-native';
|
|
1065
|
-
|
|
1066
|
-
import type { MacBridgeApiClient } from '../api/client';
|
|
1067
|
-
import type { MacBridgeWsClient } from '../api/ws';
|
|
1068
|
-
import { colors, radius, spacing, typography } from '../theme';
|
|
1069
|
-
|
|
1070
|
-
interface TerminalScreenProps {
|
|
1071
|
-
api: MacBridgeApiClient;
|
|
1072
|
-
ws: MacBridgeWsClient;
|
|
1073
|
-
}
|
|
1074
|
-
|
|
1075
|
-
export function TerminalScreen({ api, ws }: TerminalScreenProps) {
|
|
1076
|
-
const [command, setCommand] = useState('pwd');
|
|
1077
|
-
const [output, setOutput] = useState('');
|
|
1078
|
-
const [running, setRunning] = useState(false);
|
|
1079
|
-
const [error, setError] = useState<string | null>(null);
|
|
1080
|
-
|
|
1081
|
-
const runCommand = useCallback(async () => {
|
|
1082
|
-
try {
|
|
1083
|
-
setRunning(true);
|
|
1084
|
-
const result = await api.execTerminal({ command });
|
|
1085
|
-
const lines = [
|
|
1086
|
-
`$ ${result.command}`,
|
|
1087
|
-
result.stdout || '(no stdout)',
|
|
1088
|
-
result.stderr ? `stderr:\n${result.stderr}` : null,
|
|
1089
|
-
`exit ${String(result.code)} · ${result.durationMs}ms`,
|
|
1090
|
-
].filter(Boolean).join('\n\n');
|
|
1091
|
-
setOutput(lines);
|
|
1092
|
-
setError(null);
|
|
1093
|
-
} catch (err) {
|
|
1094
|
-
setError((err as Error).message);
|
|
1095
|
-
} finally {
|
|
1096
|
-
setRunning(false);
|
|
1097
|
-
}
|
|
1098
|
-
}, [api, command]);
|
|
1099
|
-
|
|
1100
|
-
useEffect(() => {
|
|
1101
|
-
return ws.onEvent((event) => {
|
|
1102
|
-
if (event.type === 'terminal.executed') {
|
|
1103
|
-
setOutput((prev) => `${prev}\n\n[ws] ${event.payload.command} → ${String(event.payload.code)}`.trim());
|
|
1104
|
-
}
|
|
1105
|
-
});
|
|
1106
|
-
}, [ws]);
|
|
1107
|
-
|
|
1108
|
-
return (
|
|
1109
|
-
<SafeAreaView style={styles.container}>
|
|
1110
|
-
<View style={styles.header}>
|
|
1111
|
-
<Ionicons name="terminal" size={16} color={colors.textMuted} />
|
|
1112
|
-
<Text style={styles.headerTitle}>Terminal</Text>
|
|
1113
|
-
</View>
|
|
1114
|
-
|
|
1115
|
-
<KeyboardAvoidingView style={styles.body} behavior={Platform.OS === 'ios' ? 'padding' : undefined}>
|
|
1116
|
-
<ScrollView style={styles.output} contentContainerStyle={styles.outputContent}>
|
|
1117
|
-
<Text selectable style={styles.outputText}>
|
|
1118
|
-
{output || 'Run a command to see output.'}
|
|
1119
|
-
</Text>
|
|
1120
|
-
</ScrollView>
|
|
1121
|
-
|
|
1122
|
-
{error ? <Text style={styles.errorText}>{error}</Text> : null}
|
|
1123
|
-
|
|
1124
|
-
<View style={styles.inputRow}>
|
|
1125
|
-
<Text style={styles.prompt}>$</Text>
|
|
1126
|
-
<TextInput
|
|
1127
|
-
style={styles.input}
|
|
1128
|
-
value={command}
|
|
1129
|
-
onChangeText={setCommand}
|
|
1130
|
-
autoCapitalize="none"
|
|
1131
|
-
autoCorrect={false}
|
|
1132
|
-
returnKeyType="send"
|
|
1133
|
-
onSubmitEditing={() => void runCommand()}
|
|
1134
|
-
placeholder="command"
|
|
1135
|
-
placeholderTextColor={colors.textMuted}
|
|
1136
|
-
/>
|
|
1137
|
-
<Pressable
|
|
1138
|
-
onPress={() => void runCommand()}
|
|
1139
|
-
disabled={running || !command.trim()}
|
|
1140
|
-
style={({ pressed }) => [styles.runBtn, pressed && styles.runBtnPressed, running && styles.runBtnDisabled]}
|
|
1141
|
-
>
|
|
1142
|
-
<Ionicons name={running ? 'pause' : 'play'} size={14} color={colors.white} />
|
|
1143
|
-
</Pressable>
|
|
1144
|
-
</View>
|
|
1145
|
-
</KeyboardAvoidingView>
|
|
1146
|
-
</SafeAreaView>
|
|
1147
|
-
);
|
|
1148
|
-
}
|
|
1149
|
-
|
|
1150
|
-
const styles = StyleSheet.create({
|
|
1151
|
-
container: { flex: 1, backgroundColor: colors.bgMain },
|
|
1152
|
-
header: {
|
|
1153
|
-
flexDirection: 'row',
|
|
1154
|
-
alignItems: 'center',
|
|
1155
|
-
gap: spacing.sm,
|
|
1156
|
-
paddingHorizontal: spacing.lg,
|
|
1157
|
-
paddingVertical: spacing.md,
|
|
1158
|
-
borderBottomWidth: StyleSheet.hairlineWidth,
|
|
1159
|
-
borderBottomColor: colors.border,
|
|
1160
|
-
},
|
|
1161
|
-
headerTitle: { ...typography.headline },
|
|
1162
|
-
body: { flex: 1 },
|
|
1163
|
-
output: { flex: 1 },
|
|
1164
|
-
outputContent: { padding: spacing.lg },
|
|
1165
|
-
outputText: { ...typography.mono },
|
|
1166
|
-
errorText: {
|
|
1167
|
-
...typography.caption,
|
|
1168
|
-
color: colors.error,
|
|
1169
|
-
paddingHorizontal: spacing.lg,
|
|
1170
|
-
paddingBottom: spacing.xs,
|
|
1171
|
-
},
|
|
1172
|
-
inputRow: {
|
|
1173
|
-
flexDirection: 'row',
|
|
1174
|
-
alignItems: 'center',
|
|
1175
|
-
gap: spacing.sm,
|
|
1176
|
-
paddingHorizontal: spacing.lg,
|
|
1177
|
-
paddingVertical: spacing.md,
|
|
1178
|
-
borderTopWidth: StyleSheet.hairlineWidth,
|
|
1179
|
-
borderTopColor: colors.border,
|
|
1180
|
-
},
|
|
1181
|
-
prompt: { ...typography.mono, color: colors.accent },
|
|
1182
|
-
input: {
|
|
1183
|
-
flex: 1,
|
|
1184
|
-
...typography.mono,
|
|
1185
|
-
color: colors.textPrimary,
|
|
1186
|
-
backgroundColor: colors.bgSidebar,
|
|
1187
|
-
borderWidth: StyleSheet.hairlineWidth,
|
|
1188
|
-
borderColor: colors.border,
|
|
1189
|
-
borderRadius: radius.sm,
|
|
1190
|
-
paddingHorizontal: spacing.md,
|
|
1191
|
-
paddingVertical: spacing.sm,
|
|
1192
|
-
},
|
|
1193
|
-
runBtn: {
|
|
1194
|
-
width: 30,
|
|
1195
|
-
height: 30,
|
|
1196
|
-
borderRadius: 15,
|
|
1197
|
-
backgroundColor: colors.accent,
|
|
1198
|
-
alignItems: 'center',
|
|
1199
|
-
justifyContent: 'center',
|
|
1200
|
-
},
|
|
1201
|
-
runBtnPressed: { backgroundColor: colors.accentPressed },
|
|
1202
|
-
runBtnDisabled: { backgroundColor: colors.bgItem },
|
|
1203
|
-
});
|
|
1204
|
-
```
|
|
1205
|
-
|
|
1206
|
-
**Step 2: Commit**
|
|
1207
|
-
|
|
1208
|
-
```bash
|
|
1209
|
-
git add apps/mobile/src/screens/TerminalScreen.tsx
|
|
1210
|
-
git commit -m "feat: dark-theme terminal screen"
|
|
1211
|
-
```
|
|
1212
|
-
|
|
1213
|
-
---
|
|
1214
|
-
|
|
1215
|
-
## Task 7: Dark-theme GitScreen
|
|
1216
|
-
|
|
1217
|
-
**Files:**
|
|
1218
|
-
- Modify: `apps/mobile/src/screens/GitScreen.tsx`
|
|
1219
|
-
|
|
1220
|
-
Replace the entire file:
|
|
1221
|
-
|
|
1222
|
-
```tsx
|
|
1223
|
-
// apps/mobile/src/screens/GitScreen.tsx
|
|
1224
|
-
import { Ionicons } from '@expo/vector-icons';
|
|
1225
|
-
import { useCallback, useEffect, useState } from 'react';
|
|
1226
|
-
import {
|
|
1227
|
-
ActivityIndicator,
|
|
1228
|
-
Pressable,
|
|
1229
|
-
SafeAreaView,
|
|
1230
|
-
ScrollView,
|
|
1231
|
-
StyleSheet,
|
|
1232
|
-
Text,
|
|
1233
|
-
TextInput,
|
|
1234
|
-
View,
|
|
1235
|
-
} from 'react-native';
|
|
1236
|
-
|
|
1237
|
-
import type { MacBridgeApiClient } from '../api/client';
|
|
1238
|
-
import type { GitStatusResponse } from '../api/types';
|
|
1239
|
-
import { colors, radius, spacing, typography } from '../theme';
|
|
1240
|
-
|
|
1241
|
-
interface GitScreenProps {
|
|
1242
|
-
api: MacBridgeApiClient;
|
|
1243
|
-
}
|
|
1244
|
-
|
|
1245
|
-
export function GitScreen({ api }: GitScreenProps) {
|
|
1246
|
-
const [status, setStatus] = useState<GitStatusResponse | null>(null);
|
|
1247
|
-
const [diff, setDiff] = useState('');
|
|
1248
|
-
const [commitMessage, setCommitMessage] = useState('chore: checkpoint');
|
|
1249
|
-
const [loading, setLoading] = useState(true);
|
|
1250
|
-
const [committing, setCommitting] = useState(false);
|
|
1251
|
-
const [error, setError] = useState<string | null>(null);
|
|
1252
|
-
|
|
1253
|
-
const refresh = useCallback(async () => {
|
|
1254
|
-
try {
|
|
1255
|
-
setLoading(true);
|
|
1256
|
-
const [s, d] = await Promise.all([api.gitStatus(), api.gitDiff()]);
|
|
1257
|
-
setStatus(s);
|
|
1258
|
-
setDiff(d.diff);
|
|
1259
|
-
setError(null);
|
|
1260
|
-
} catch (err) {
|
|
1261
|
-
setError((err as Error).message);
|
|
1262
|
-
} finally {
|
|
1263
|
-
setLoading(false);
|
|
1264
|
-
}
|
|
1265
|
-
}, [api]);
|
|
1266
|
-
|
|
1267
|
-
useEffect(() => { void refresh(); }, [refresh]);
|
|
1268
|
-
|
|
1269
|
-
const commit = useCallback(async () => {
|
|
1270
|
-
try {
|
|
1271
|
-
setCommitting(true);
|
|
1272
|
-
const result = await api.gitCommit({ message: commitMessage });
|
|
1273
|
-
if (!result.committed) setError(result.stderr || 'Commit failed.');
|
|
1274
|
-
else setError(null);
|
|
1275
|
-
await refresh();
|
|
1276
|
-
} catch (err) {
|
|
1277
|
-
setError((err as Error).message);
|
|
1278
|
-
} finally {
|
|
1279
|
-
setCommitting(false);
|
|
1280
|
-
}
|
|
1281
|
-
}, [api, commitMessage, refresh]);
|
|
1282
|
-
|
|
1283
|
-
return (
|
|
1284
|
-
<SafeAreaView style={styles.container}>
|
|
1285
|
-
<View style={styles.header}>
|
|
1286
|
-
<Ionicons name="git-branch" size={16} color={colors.textMuted} />
|
|
1287
|
-
<Text style={styles.headerTitle}>Git</Text>
|
|
1288
|
-
<Pressable onPress={() => void refresh()} hitSlop={8} style={styles.refreshBtn}>
|
|
1289
|
-
<Ionicons name="refresh" size={16} color={colors.textMuted} />
|
|
1290
|
-
</Pressable>
|
|
1291
|
-
</View>
|
|
1292
|
-
|
|
1293
|
-
{loading ? (
|
|
1294
|
-
<ActivityIndicator color={colors.textMuted} style={styles.loader} />
|
|
1295
|
-
) : (
|
|
1296
|
-
<ScrollView style={styles.body} contentContainerStyle={styles.bodyContent}>
|
|
1297
|
-
{/* Branch info */}
|
|
1298
|
-
<View style={styles.infoRow}>
|
|
1299
|
-
<Text style={styles.infoLabel}>Branch</Text>
|
|
1300
|
-
<Text style={styles.infoValue}>{status?.branch ?? '—'}</Text>
|
|
1301
|
-
</View>
|
|
1302
|
-
<View style={[styles.infoRow, styles.infoRowBorder]}>
|
|
1303
|
-
<Text style={styles.infoLabel}>Status</Text>
|
|
1304
|
-
<Text style={[styles.infoValue, status?.clean ? styles.clean : styles.dirty]}>
|
|
1305
|
-
{status?.clean ? 'clean' : 'changes'}
|
|
1306
|
-
</Text>
|
|
1307
|
-
</View>
|
|
1308
|
-
|
|
1309
|
-
{/* Commit */}
|
|
1310
|
-
<Text style={styles.sectionLabel}>Commit message</Text>
|
|
1311
|
-
<TextInput
|
|
1312
|
-
style={styles.input}
|
|
1313
|
-
value={commitMessage}
|
|
1314
|
-
onChangeText={setCommitMessage}
|
|
1315
|
-
placeholder="Commit message..."
|
|
1316
|
-
placeholderTextColor={colors.textMuted}
|
|
1317
|
-
/>
|
|
1318
|
-
<Pressable
|
|
1319
|
-
onPress={() => void commit()}
|
|
1320
|
-
disabled={committing || !commitMessage.trim()}
|
|
1321
|
-
style={({ pressed }) => [
|
|
1322
|
-
styles.commitBtn,
|
|
1323
|
-
pressed && styles.commitBtnPressed,
|
|
1324
|
-
(committing || !commitMessage.trim()) && styles.commitBtnDisabled,
|
|
1325
|
-
]}
|
|
1326
|
-
>
|
|
1327
|
-
<Text style={styles.commitBtnText}>
|
|
1328
|
-
{committing ? 'Committing…' : 'Commit'}
|
|
1329
|
-
</Text>
|
|
1330
|
-
</Pressable>
|
|
1331
|
-
|
|
1332
|
-
{error ? <Text style={styles.errorText}>{error}</Text> : null}
|
|
1333
|
-
|
|
1334
|
-
{/* Diff */}
|
|
1335
|
-
<Text style={styles.sectionLabel}>Diff</Text>
|
|
1336
|
-
<ScrollView style={styles.diffBox} horizontal>
|
|
1337
|
-
<Text selectable style={styles.diffText}>{diff || 'No changes.'}</Text>
|
|
1338
|
-
</ScrollView>
|
|
1339
|
-
</ScrollView>
|
|
1340
|
-
)}
|
|
1341
|
-
</SafeAreaView>
|
|
1342
|
-
);
|
|
1343
|
-
}
|
|
1344
|
-
|
|
1345
|
-
const styles = StyleSheet.create({
|
|
1346
|
-
container: { flex: 1, backgroundColor: colors.bgMain },
|
|
1347
|
-
header: {
|
|
1348
|
-
flexDirection: 'row',
|
|
1349
|
-
alignItems: 'center',
|
|
1350
|
-
gap: spacing.sm,
|
|
1351
|
-
paddingHorizontal: spacing.lg,
|
|
1352
|
-
paddingVertical: spacing.md,
|
|
1353
|
-
borderBottomWidth: StyleSheet.hairlineWidth,
|
|
1354
|
-
borderBottomColor: colors.border,
|
|
1355
|
-
},
|
|
1356
|
-
headerTitle: { ...typography.headline, flex: 1 },
|
|
1357
|
-
refreshBtn: { marginLeft: 'auto' },
|
|
1358
|
-
loader: { marginTop: spacing.xxl },
|
|
1359
|
-
body: { flex: 1 },
|
|
1360
|
-
bodyContent: { padding: spacing.lg, gap: spacing.md },
|
|
1361
|
-
infoRow: {
|
|
1362
|
-
flexDirection: 'row',
|
|
1363
|
-
justifyContent: 'space-between',
|
|
1364
|
-
paddingVertical: spacing.sm,
|
|
1365
|
-
},
|
|
1366
|
-
infoRowBorder: {
|
|
1367
|
-
borderTopWidth: StyleSheet.hairlineWidth,
|
|
1368
|
-
borderTopColor: colors.border,
|
|
1369
|
-
},
|
|
1370
|
-
infoLabel: { ...typography.body, color: colors.textMuted },
|
|
1371
|
-
infoValue: { ...typography.body },
|
|
1372
|
-
clean: { color: colors.statusComplete },
|
|
1373
|
-
dirty: { color: colors.statusError },
|
|
1374
|
-
sectionLabel: {
|
|
1375
|
-
...typography.caption,
|
|
1376
|
-
textTransform: 'uppercase',
|
|
1377
|
-
letterSpacing: 0.6,
|
|
1378
|
-
marginTop: spacing.md,
|
|
1379
|
-
},
|
|
1380
|
-
input: {
|
|
1381
|
-
backgroundColor: colors.bgSidebar,
|
|
1382
|
-
borderWidth: StyleSheet.hairlineWidth,
|
|
1383
|
-
borderColor: colors.border,
|
|
1384
|
-
borderRadius: radius.sm,
|
|
1385
|
-
paddingHorizontal: spacing.md,
|
|
1386
|
-
paddingVertical: spacing.sm + 2,
|
|
1387
|
-
color: colors.textPrimary,
|
|
1388
|
-
fontSize: 14,
|
|
1389
|
-
},
|
|
1390
|
-
commitBtn: {
|
|
1391
|
-
backgroundColor: colors.accent,
|
|
1392
|
-
borderRadius: radius.sm,
|
|
1393
|
-
paddingVertical: spacing.sm + 2,
|
|
1394
|
-
alignItems: 'center',
|
|
1395
|
-
},
|
|
1396
|
-
commitBtnPressed: { backgroundColor: colors.accentPressed },
|
|
1397
|
-
commitBtnDisabled: { backgroundColor: colors.bgItem },
|
|
1398
|
-
commitBtnText: { ...typography.headline, color: colors.white, fontSize: 14 },
|
|
1399
|
-
errorText: { ...typography.caption, color: colors.error },
|
|
1400
|
-
diffBox: {
|
|
1401
|
-
backgroundColor: colors.bgSidebar,
|
|
1402
|
-
borderRadius: radius.sm,
|
|
1403
|
-
borderWidth: StyleSheet.hairlineWidth,
|
|
1404
|
-
borderColor: colors.border,
|
|
1405
|
-
padding: spacing.md,
|
|
1406
|
-
maxHeight: 300,
|
|
1407
|
-
},
|
|
1408
|
-
diffText: { ...typography.mono },
|
|
1409
|
-
});
|
|
1410
|
-
```
|
|
1411
|
-
|
|
1412
|
-
**Step 2: Commit**
|
|
1413
|
-
|
|
1414
|
-
```bash
|
|
1415
|
-
git add apps/mobile/src/screens/GitScreen.tsx
|
|
1416
|
-
git commit -m "feat: dark-theme git screen"
|
|
1417
|
-
```
|
|
1418
|
-
|
|
1419
|
-
---
|
|
1420
|
-
|
|
1421
|
-
## Task 8: Dark-theme SettingsScreen
|
|
1422
|
-
|
|
1423
|
-
**Files:**
|
|
1424
|
-
- Modify: `apps/mobile/src/screens/SettingsScreen.tsx`
|
|
1425
|
-
|
|
1426
|
-
Replace the entire file:
|
|
1427
|
-
|
|
1428
|
-
```tsx
|
|
1429
|
-
// apps/mobile/src/screens/SettingsScreen.tsx
|
|
1430
|
-
import { Ionicons } from '@expo/vector-icons';
|
|
1431
|
-
import { useCallback, useEffect, useState } from 'react';
|
|
1432
|
-
import { Pressable, SafeAreaView, StyleSheet, Text, View } from 'react-native';
|
|
1433
|
-
|
|
1434
|
-
import type { MacBridgeApiClient } from '../api/client';
|
|
1435
|
-
import type { MacBridgeWsClient } from '../api/ws';
|
|
1436
|
-
import { colors, spacing, typography } from '../theme';
|
|
1437
|
-
|
|
1438
|
-
interface SettingsScreenProps {
|
|
1439
|
-
api: MacBridgeApiClient;
|
|
1440
|
-
ws: MacBridgeWsClient;
|
|
1441
|
-
bridgeUrl: string;
|
|
1442
|
-
}
|
|
1443
|
-
|
|
1444
|
-
export function SettingsScreen({ api, ws, bridgeUrl }: SettingsScreenProps) {
|
|
1445
|
-
const [healthyAt, setHealthyAt] = useState<string | null>(null);
|
|
1446
|
-
const [uptimeSec, setUptimeSec] = useState<number | null>(null);
|
|
1447
|
-
const [wsConnected, setWsConnected] = useState(false);
|
|
1448
|
-
const [error, setError] = useState<string | null>(null);
|
|
1449
|
-
|
|
1450
|
-
const checkHealth = useCallback(async () => {
|
|
1451
|
-
try {
|
|
1452
|
-
const h = await api.health();
|
|
1453
|
-
setHealthyAt(h.at);
|
|
1454
|
-
setUptimeSec(h.uptimeSec);
|
|
1455
|
-
setError(null);
|
|
1456
|
-
} catch (err) {
|
|
1457
|
-
setError((err as Error).message);
|
|
1458
|
-
}
|
|
1459
|
-
}, [api]);
|
|
1460
|
-
|
|
1461
|
-
useEffect(() => {
|
|
1462
|
-
const t = setTimeout(() => void checkHealth(), 0);
|
|
1463
|
-
return () => clearTimeout(t);
|
|
1464
|
-
}, [checkHealth]);
|
|
1465
|
-
|
|
1466
|
-
useEffect(() => ws.onStatus(setWsConnected), [ws]);
|
|
1467
|
-
|
|
1468
|
-
return (
|
|
1469
|
-
<SafeAreaView style={styles.container}>
|
|
1470
|
-
<View style={styles.header}>
|
|
1471
|
-
<Ionicons name="settings" size={16} color={colors.textMuted} />
|
|
1472
|
-
<Text style={styles.headerTitle}>Settings</Text>
|
|
1473
|
-
</View>
|
|
1474
|
-
|
|
1475
|
-
<View style={styles.body}>
|
|
1476
|
-
<Text style={styles.sectionLabel}>Bridge</Text>
|
|
1477
|
-
<Text selectable style={styles.valueText}>{bridgeUrl}</Text>
|
|
1478
|
-
|
|
1479
|
-
<Text style={[styles.sectionLabel, styles.sectionLabelGap]}>Health</Text>
|
|
1480
|
-
<Row label="Status" value={healthyAt ? 'OK' : 'Unknown'} valueColor={healthyAt ? colors.statusComplete : colors.textMuted} />
|
|
1481
|
-
<Row label="Last seen" value={healthyAt ?? '—'} />
|
|
1482
|
-
<Row label="Uptime" value={uptimeSec !== null ? `${uptimeSec}s` : '—'} />
|
|
1483
|
-
<Row
|
|
1484
|
-
label="WebSocket"
|
|
1485
|
-
value={wsConnected ? 'Connected' : 'Disconnected'}
|
|
1486
|
-
valueColor={wsConnected ? colors.statusComplete : colors.statusError}
|
|
1487
|
-
/>
|
|
1488
|
-
|
|
1489
|
-
<Pressable
|
|
1490
|
-
onPress={() => void checkHealth()}
|
|
1491
|
-
style={({ pressed }) => [styles.refreshBtn, pressed && styles.refreshBtnPressed]}
|
|
1492
|
-
>
|
|
1493
|
-
<Ionicons name="refresh" size={14} color={colors.textMuted} />
|
|
1494
|
-
<Text style={styles.refreshBtnText}>Refresh health</Text>
|
|
1495
|
-
</Pressable>
|
|
1496
|
-
|
|
1497
|
-
{error ? <Text style={styles.errorText}>{error}</Text> : null}
|
|
1498
|
-
</View>
|
|
1499
|
-
</SafeAreaView>
|
|
1500
|
-
);
|
|
1501
|
-
}
|
|
1502
|
-
|
|
1503
|
-
function Row({ label, value, valueColor }: { label: string; value: string; valueColor?: string }) {
|
|
1504
|
-
return (
|
|
1505
|
-
<View style={styles.row}>
|
|
1506
|
-
<Text style={styles.rowLabel}>{label}</Text>
|
|
1507
|
-
<Text style={[styles.rowValue, valueColor ? { color: valueColor } : undefined]}>{value}</Text>
|
|
1508
|
-
</View>
|
|
1509
|
-
);
|
|
1510
|
-
}
|
|
1511
|
-
|
|
1512
|
-
const styles = StyleSheet.create({
|
|
1513
|
-
container: { flex: 1, backgroundColor: colors.bgMain },
|
|
1514
|
-
header: {
|
|
1515
|
-
flexDirection: 'row',
|
|
1516
|
-
alignItems: 'center',
|
|
1517
|
-
gap: spacing.sm,
|
|
1518
|
-
paddingHorizontal: spacing.lg,
|
|
1519
|
-
paddingVertical: spacing.md,
|
|
1520
|
-
borderBottomWidth: StyleSheet.hairlineWidth,
|
|
1521
|
-
borderBottomColor: colors.border,
|
|
1522
|
-
},
|
|
1523
|
-
headerTitle: { ...typography.headline },
|
|
1524
|
-
body: { padding: spacing.lg, gap: spacing.sm },
|
|
1525
|
-
sectionLabel: {
|
|
1526
|
-
...typography.caption,
|
|
1527
|
-
textTransform: 'uppercase',
|
|
1528
|
-
letterSpacing: 0.6,
|
|
1529
|
-
marginTop: spacing.sm,
|
|
1530
|
-
marginBottom: spacing.xs,
|
|
1531
|
-
},
|
|
1532
|
-
sectionLabelGap: { marginTop: spacing.xl },
|
|
1533
|
-
valueText: {
|
|
1534
|
-
...typography.mono,
|
|
1535
|
-
color: colors.textMuted,
|
|
1536
|
-
backgroundColor: colors.bgSidebar,
|
|
1537
|
-
borderRadius: 6,
|
|
1538
|
-
padding: spacing.sm,
|
|
1539
|
-
},
|
|
1540
|
-
row: {
|
|
1541
|
-
flexDirection: 'row',
|
|
1542
|
-
justifyContent: 'space-between',
|
|
1543
|
-
paddingVertical: spacing.xs + 2,
|
|
1544
|
-
borderBottomWidth: StyleSheet.hairlineWidth,
|
|
1545
|
-
borderBottomColor: colors.border,
|
|
1546
|
-
},
|
|
1547
|
-
rowLabel: { ...typography.body, color: colors.textMuted },
|
|
1548
|
-
rowValue: { ...typography.body },
|
|
1549
|
-
refreshBtn: {
|
|
1550
|
-
flexDirection: 'row',
|
|
1551
|
-
alignItems: 'center',
|
|
1552
|
-
gap: spacing.sm,
|
|
1553
|
-
marginTop: spacing.lg,
|
|
1554
|
-
paddingVertical: spacing.sm + 2,
|
|
1555
|
-
paddingHorizontal: spacing.md,
|
|
1556
|
-
borderWidth: StyleSheet.hairlineWidth,
|
|
1557
|
-
borderColor: colors.border,
|
|
1558
|
-
borderRadius: 8,
|
|
1559
|
-
alignSelf: 'flex-start',
|
|
1560
|
-
},
|
|
1561
|
-
refreshBtnPressed: { backgroundColor: colors.bgItem },
|
|
1562
|
-
refreshBtnText: { ...typography.body, color: colors.textMuted, fontSize: 13 },
|
|
1563
|
-
errorText: { ...typography.caption, color: colors.error, marginTop: spacing.md },
|
|
1564
|
-
});
|
|
1565
|
-
```
|
|
1566
|
-
|
|
1567
|
-
**Step 2: Commit**
|
|
1568
|
-
|
|
1569
|
-
```bash
|
|
1570
|
-
git add apps/mobile/src/screens/SettingsScreen.tsx
|
|
1571
|
-
git commit -m "feat: dark-theme settings screen"
|
|
1572
|
-
```
|
|
1573
|
-
|
|
1574
|
-
---
|
|
1575
|
-
|
|
1576
|
-
## Task 9: Remove unused files and verify build
|
|
1577
|
-
|
|
1578
|
-
**Files:**
|
|
1579
|
-
- Delete: `apps/mobile/src/screens/ThreadsScreen.tsx` (replaced by MainScreen)
|
|
1580
|
-
- Delete: `apps/mobile/src/components/Glass.tsx` (replaced by direct theme usage)
|
|
1581
|
-
- Delete: `apps/mobile/src/ui/` directory (old warm theme, no longer used)
|
|
1582
|
-
|
|
1583
|
-
**Step 1: Delete old files**
|
|
1584
|
-
|
|
1585
|
-
```bash
|
|
1586
|
-
rm apps/mobile/src/screens/ThreadsScreen.tsx
|
|
1587
|
-
rm apps/mobile/src/components/Glass.tsx
|
|
1588
|
-
rm -rf apps/mobile/src/ui/
|
|
1589
|
-
```
|
|
1590
|
-
|
|
1591
|
-
**Step 2: Verify TypeScript compiles**
|
|
1592
|
-
|
|
1593
|
-
```bash
|
|
1594
|
-
cd apps/mobile
|
|
1595
|
-
npx tsc --noEmit 2>&1 | grep -v '__tests__'
|
|
1596
|
-
```
|
|
1597
|
-
|
|
1598
|
-
Expected: no output (no errors in UI files).
|
|
1599
|
-
|
|
1600
|
-
**Step 3: Confirm Metro bundles without errors**
|
|
1601
|
-
|
|
1602
|
-
Check the Metro console — expected: `Bundled Nms apps/mobile/index.js (N modules)` with no red errors.
|
|
1603
|
-
|
|
1604
|
-
**Step 4: Commit**
|
|
1605
|
-
|
|
1606
|
-
```bash
|
|
1607
|
-
git add -A
|
|
1608
|
-
git commit -m "chore: remove old glass components and ThreadsScreen"
|
|
1609
|
-
```
|
|
1610
|
-
|
|
1611
|
-
---
|
|
1612
|
-
|
|
1613
|
-
## Verification
|
|
1614
|
-
|
|
1615
|
-
After all tasks:
|
|
1616
|
-
|
|
1617
|
-
1. Launch app — should show dark `#0D1117` background with `≡` hamburger top-left
|
|
1618
|
-
2. Swipe right from left edge — drawer slides open showing "New thread" button + threads + Terminal/Git/Settings nav items
|
|
1619
|
-
3. Tap a thread — drawer closes, chat view shows with messages
|
|
1620
|
-
4. Tap "New thread" — drawer closes, compose view shows "Let's build" hero
|
|
1621
|
-
5. Navigate to Terminal/Git/Settings from drawer — each screen shows dark theme
|
|
1622
|
-
6. Type a message and tap send — message appears as user bubble, assistant streams in
|
|
1623
|
-
|
|
1624
|
-
---
|
|
1625
|
-
|
|
1626
|
-
## Notes
|
|
1627
|
-
|
|
1628
|
-
- `react-native-reanimated` is already a transitive dependency of `react-native-gesture-handler` (already installed). Drawer uses it automatically.
|
|
1629
|
-
- The `selectedThreadId` prop passed to `DrawerContent` is `null` for now. If you want the drawer to highlight the active thread, wire it up via a shared state or context in a follow-up.
|
|
1630
|
-
- Suggestion cards show hardcoded strings for now. These can be made dynamic from the API later.
|