Commit Graph

4183 Commits

Author SHA1 Message Date
Mohamed Boudra
edf47a24bc refactor(agent): consolidate agent type definitions and add multi-agent-type support 2025-10-26 18:03:03 +01:00
Mohamed Boudra
700840da5a refactor(agent-stream): convert ScrollView to inverted FlatList for better performance 2025-10-26 17:04:22 +01:00
Mohamed Boudra
2c1b5b13fe fix(agent): track initialization state to prevent duplicate agent initialization 2025-10-26 16:28:55 +01:00
Mohamed Boudra
cf7e14e36b fix(keyboard): use transform instead of padding for keyboard animation 2025-10-26 16:19:30 +01:00
Mohamed Boudra
985e9db6db fix(chat): maintain scroll position when keyboard appears
When the keyboard appeared, the chat content would get pushed up and the user would lose sight of what they were viewing. This happened because the outer container had keyboard-aware padding, but the ScrollView's content padding was static.

Now the ScrollView's contentContainerStyle receives animated padding that matches the keyboard height, ensuring the content maintains its relative position and the user keeps seeing the same messages when the keyboard appears.

Changes:
- Pass keyboardHeight SharedValue to AgentStreamView
- Add animated contentPaddingStyle that adjusts for keyboard
- Apply dynamic padding to ScrollView contentContainerStyle
- Content now smoothly adjusts as keyboard animates in/out

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-26 15:08:52 +01:00
Mohamed Boudra
e82a7410e7 fix(agent-stream): prevent visible scroll animation on initial load
When loading an agent chat with existing messages, the ScrollView would render at the top and then animate scrolling to the bottom, creating a jarring user experience.

Now the initial scroll to bottom happens instantly (no animation), and only subsequent auto-scrolls (when new messages arrive) are animated. This provides a smooth loading experience while maintaining smooth animations for new content.

Changes:
- Add hasScrolledInitially ref to track first scroll
- Use animated: false for initial scroll, animated: true for subsequent scrolls
- Remove debug console.log from scroll handler

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-26 15:05:11 +01:00
Mohamed Boudra
d47019919e refactor(ui): improve footer controls layout and add scroll-to-bottom button
Simplify agent screen layout by removing redundant status bar container and consolidating all footer controls into the input area component. Add smooth fade animations for realtime mode transitions and a floating scroll-to-bottom button for better UX.

Changes:
- Consolidate status bar and controls into AgentInputArea for cleaner layout hierarchy
- Add scroll-to-bottom button to AgentStreamView with fade animations
- Fix realtime controls stacking on non-agent screens
- Add lastActivityAt serialization to MCP server agent responses
- Remove unnecessary layout wrapper in agent screen

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-26 15:03:33 +01:00
Mohamed Boudra
c4bb10d3c9 feat: add voice note recording overlay with transcription feedback and worktree support 2025-10-26 13:48:14 +01:00
Mohamed Boudra
dcfdccf07f fix(worktree): implement worktree creation for agent isolation
- Add worktree utility functions for git worktree management
- Fix stale closure issue in create-agent-modal causing worktreeName to not be sent
- Refactor create-agent-modal to use useCallback for all functions in proper order
- Add tilde path expansion before worktree creation to fix "Not in a git repository" error
- Add worktreeName parameter to create_agent_request WebSocket message
- Add debug logging for worktree creation flow
- Remove noisy logging (message chunk updates, session updates, agent update notifications)

The worktree feature allows creating isolated git worktrees for each agent,
enabling work on different branches simultaneously without conflicts.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-26 13:28:05 +01:00
Mohamed Boudra
4323d7d193 fix(session): emit agent_status on mode change for immediate UI update
When a user accepts an ExitPlanMode permission, the agent sends a
current_mode_update notification. Previously this was only forwarded
as an agent_update message, but the frontend relies on agent_status
messages to update the mode selector UI.

Now we detect current_mode_update notifications and emit an additional
agent_status message immediately, ensuring the UI updates without
waiting for the agent to complete its turn.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-26 10:18:51 +01:00
Mohamed Boudra
7fee9d4dc4 refactor(agent-manager): add error logging for agent prompt refusal 2025-10-26 09:52:43 +01:00
Mohamed Boudra
fdaf403f13 chore(deps): upgrade claude-code-acp to v0.8.5 and improve test lifecycle management 2025-10-26 09:51:18 +01:00
Mohamed Boudra
7d1ef63c8f chore(deps): upgrade claude-code-acp to v0.8.4 and optimize image upload implementation 2025-10-26 09:07:41 +01:00
Mohamed Boudra
b1faab72ce chore(deps): upgrade claude-code-acp to v0.8.4 and mark express dependencies as optional 2025-10-26 08:57:57 +01:00
Mohamed Boudra
1d8e86985b test(agent-manager): add session ID verification and improve agent state persistence 2025-10-26 08:29:52 +01:00
Mohamed Boudra
604e359437 test(agent-manager): add test for loading persisted agent and sending new prompt 2025-10-26 07:59:35 +01:00
Mohamed Boudra
9f22acfead fix(agent-manager): persist agent state before killing to enable resumption 2025-10-26 07:53:51 +01:00
Mohamed Boudra
a81a8a86b8 test: replace console.log with assertion for agent mode verification 2025-10-26 07:44:33 +01:00
Mohamed Boudra
0cc9666df0 chore: reset agents.json and add mode change handling to agent manager 2025-10-26 07:41:27 +01:00
Mohamed Boudra
a3224175ee feat: add image upload support to agent chat with attachment preview 2025-10-26 07:35:06 +01:00
Mohamed Boudra
faf087b3a6 refactor: standardize footer height calculations and alignment across components 2025-10-25 22:14:15 +02:00
Mohamed Boudra
a405c29ab1 feat: replace single realtime button with three-button footer navigation
Replace the centered realtime button in the global footer with three buttons:
- Agents: Navigate to home screen
- New Agent: Open create agent modal
- Realtime: Start realtime mode (existing functionality)

This provides easier access to core navigation actions from any non-agent screen.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 21:59:10 +02:00
Mohamed Boudra
8d591da671 refactor: add dynamic input height, agent sorting, and last activity tracking 2025-10-25 21:56:44 +02:00
Mohamed Boudra
1d6de732b6 feat: implement graceful agent shutdown and update dev script
- Add graceful shutdown to AgentManager that waits for processing agents to complete
- Update server to handle SIGTERM and SIGINT with proper agent cleanup
- Switch dev script to use node --watch --import tsx for faster restarts
- Add shutdown timeout handling with configurable wait period

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 21:20:27 +02:00
Mohamed Boudra
c277f3fd7c chore: add claude-code-acp dependency to root package and update agent state 2025-10-25 20:50:12 +02:00
Mohamed Boudra
1fd9b77680 refactor: upgrade claude-code-acp to v0.8.3 and optimize agent initialization flow 2025-10-25 19:37:13 +02:00
Mohamed Boudra
42e5f864a6 refactor: improve formatting consistency and session persistence in agent management 2025-10-25 18:50:56 +02:00
Mohamed Boudra
d2313b9d1c refactor: memoize useWebSocket return value and improve formatting consistency 2025-10-25 18:49:42 +02:00
Mohamed Boudra
64d1518a6f Prompt is too long 2025-10-25 15:14:44 +02:00
Mohamed Boudra
3115c702bf refactor(server): implement lazy agent initialization with state machine pattern 2025-10-24 20:18:25 +02:00
Mohamed Boudra
8d93eeb5c5 feat: switch to local claude-code-acp package and remove screen transition animations 2025-10-24 18:10:12 +02:00
Mohamed Boudra
dd4fa90c5a fix: resolve session resumption issue by storing Claude's internal session ID
- Add discriminated union for agent options with proper type (claude)
- Store Claude's internal session ID separately from ACP session ID
- Use Zod schema validation for persisted agents
- Use correct session ID when resuming agents (Claude ID for Claude agents)
- Update to @boudra/claude-code-acp@0.8.1 which extracts Claude session ID
2025-10-24 17:09:37 +02:00
Mohamed Boudra
ff02b500e0 feat: add voice detection gating for TTS playback and optimize agent screen rendering 2025-10-24 15:52:47 +02:00
Mohamed Boudra
ce2ca53c58 feat: restore keyboard animation for footer controls
Added useReanimatedKeyboardAnimation to GlobalFooter to animate the entire
footer (status bar + controls) up when keyboard opens. Uses translateY
transform to shift footer above keyboard with smooth native timing.

Applied to all footer variants:
- Agent screen with registered controls
- Realtime mode on non-agent screens
- Button mode on non-agent screens

Maintains all recent fixes (portal architecture, tight spacing, smooth
transitions) while restoring the keyboard avoidance behavior.

Implementation by Codex.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 11:47:37 +02:00
Mohamed Boudra
13f59102b9 fix: remove excessive bottom padding causing gap between status bar and controls
The animated keyboard style was adding FOOTER_HEIGHT + insets.bottom as padding,
creating a massive gap. Removed footer height from padding calculation - keyboard
padding only needs to account for keyboard height, not footer.

Fixed by Codex.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 11:41:52 +02:00
Mohamed Boudra
cc00d82f8f fix: remove excessive padding between status bar and footer controls
Removed 24px bottom padding from footerContainer that was creating a large
gap between AgentStatusBar and the GlobalFooter controls below.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 11:37:29 +02:00
Mohamed Boudra
f2fe25de23 refactor: implement footer controls context for smooth transitions
Codex implemented a portal/context architecture to eliminate layout jank:

- Created FooterControlsProvider context with register/unregister methods
- GlobalFooter now reserves fixed height (88px + insets) for all modes
- Both AgentInputArea and RealtimeControls stack absolutely in same space
- Single shared Reanimated value drives cross-fade (250ms)
- Agent screen registers controls via context instead of rendering inline
- Content padding adjusted to account for footer height
- Borders and safe area moved to shared container
- AgentInputArea simplified to pure component (no internal animations)

This guarantees:
- No layout shifts during transitions
- Smooth cross-fade between control modes
- No gaps or double borders
- Both controls never occupy layout space simultaneously

Implementation by OpenAI Codex per architectural recommendation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 11:36:17 +02:00
Mohamed Boudra
6f4d47848c fix: use absolute positioning for hidden AgentInputArea to prevent layout space
AgentInputArea was still taking up 88px height when opacity was 0, creating
a gap between status bar and realtime controls. Now switches to position
absolute when hidden (opacity < 0.5) to remove from layout flow completely.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 11:25:12 +02:00
Mohamed Boudra
465aa1cd78 fix: smooth transition between text and realtime controls with coordinated animations
- Keep AgentInputArea always mounted, animate opacity (0→1 / 1→0) instead of unmounting
- Use controlled opacity animation for GlobalFooter's RealtimeControls on agent screen
- Both controls fade in/out over 250ms, synchronized for smooth cross-fade
- Disable pointer events on hidden controls to prevent interaction issues
- Keep FadeIn/FadeOut behavior on non-agent screens (home, orchestrator) unchanged

This eliminates the layout "push" effect where GlobalFooter would take up space
while fading in, causing visible jank. Now both controls overlay and cross-fade
smoothly without affecting layout.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 11:23:37 +02:00
Mohamed Boudra
7f15e7ebe3 fix: remove gap between status bar and realtime controls in agent mode
- Only apply bottom padding to footer container when NOT in realtime mode
- When realtime is active, GlobalFooter handles the bottom padding
- This eliminates the large gap between status bar and realtime controls

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 11:19:58 +02:00
Mohamed Boudra
9299bb5d4c refactor: restore agent status bar and clean up input area layout
- Add AgentStatusBar back to agent screen layout above controls
- Remove duplicate mode badge from AgentInputArea (now only in status bar)
- Simplify AgentInputArea to horizontal layout matching RealtimeControls
- Set both controls to height: 88 for consistent sizing
- Remove conditional rendering that caused component to unmount

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 11:19:19 +02:00
Mohamed Boudra
3483bd9afd fix: improve realtime controls layout and add agent status bar
- Change realtime controls to horizontal layout with fixed height (88px)
- Add orientation prop to VolumeMeter for horizontal/vertical modes
- Create AgentStatusBar component showing mode badge and agent status
- Add agent persistence system for managing agent state across restarts
- Fix bottom sheet dismiss handling to clear state properly
- Remove debug timer from realtime controls

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 11:17:05 +02:00
Mohamed Boudra
d24bf65fe9 refactor: improve UI consistency across message components and theme styles 2025-10-23 22:46:09 +02:00
Mohamed Boudra
29e6da8536 feat: add screenshot and settings for Claude, refactor agent stream and orchestrator views
- Introduced a new screenshot image for the app.
- Added local settings for Claude permissions.
- Refactored AgentStreamView and OrchestratorMessagesView to utilize new types for tool calls and permissions.
- Updated ToolCallBottomSheet to handle selected tool calls more efficiently.
- Enhanced type definitions for shared data structures related to tool calls and permissions.
2025-10-23 22:12:02 +02:00
Mohamed Boudra
a0f45f2cfc fix: correct typescript ref types for bottom sheet and audio player 2025-10-23 20:06:11 +02:00
Mohamed Boudra
e7306ab495 fix: update expo-two-way-audio dependency to @boudra/expo-two-way-audio 2025-10-23 20:03:57 +02:00
Mohamed Boudra
15320819a7 fix: migrate to @boudra/expo-two-way-audio and add tool call details bottom sheet 2025-10-23 20:01:52 +02:00
Mohamed Boudra
74fffcd8a3 refactor: optimize audio initialization and fix agent interactions
- Lazy initialize audio (on-demand instead of mount) in both player and Speechmatics hooks
- Add audio session teardown on stop for proper cleanup
- Implement agent audio recording with sendAgentAudio in AgentInputArea
- Fix Android navigation race condition in CreateAgentModal (navigate before closing)
- Add animations to global footer and agent screen (FadeIn/FadeOut)
- Auto-cancel stuck agents when sending new messages
- Fix permission request ID propagation from AgentManager to Session
- Apply theme background color via AppContainer wrapper

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-23 13:15:18 +02:00
Mohamed Boudra
10189514dd ```
refactor: centralize global footer and simplify agent screen input handling
```
2025-10-23 12:35:28 +02:00
Mohamed Boudra
027ae59ae7 ```
fix: stop audio playback when ending realtime session
```
2025-10-23 12:29:21 +02:00