Compare commits

..

286 Commits

Author SHA1 Message Date
AI Christianson 18dd8a7c06 get rid of pointless fn 2025-03-16 12:53:00 -04:00
AI Christianson 80e8a712ac verbose console logging by default for server 2025-03-16 10:05:53 -04:00
AI Christianson 3c0319d50f server config 2025-03-15 22:45:15 -04:00
AI Christianson 8d44ba0824 expert/web enabled based on config 2025-03-15 22:16:50 -04:00
AI Christianson 1dc9326154 get model from config 2025-03-15 22:02:05 -04:00
AI Christianson c848c04ee3 only migrate in main 2025-03-15 21:48:51 -04:00
AI Christianson fee23fcc21 add /v1/spawn-agent 2025-03-15 21:35:43 -04:00
AI Christianson 510e1016f8 make it so we have only one server entrypoint 2025-03-15 16:34:49 -04:00
AI Christianson 64a04e2535 make 1818 the default port 2025-03-15 16:24:34 -04:00
AI Christianson c18c4dbd22 session API endpoint 2025-03-15 16:12:17 -04:00
AI Christianson 77cfbdeca7 webui -> server 2025-03-15 15:14:56 -04:00
AI Christianson e0aab1021b use pydantic models 2025-03-15 14:29:42 -04:00
Ariel Frischer 5d07a7f7b8
Merge pull request #137 from ariel-frischer/use-correct-37-sonnet-state-modifier
Use correct state_modifier when using openrouter claude 3.7
2025-03-15 09:54:27 -07:00
Ariel Frischer 6c159d39d4 feat(agent_utils.py): add get_model_name_from_chat_model function to improve model handling
refactor(build_agent_kwargs): simplify state modifier logic by using model name instead of model attribute
2025-03-15 09:48:52 -07:00
Andrew I. Christianson cde8eee4fa
Merge pull request #136 from ariel-frischer/fix-undefined-model-2
Fix undefined model.model when using openrouter sonnet 3.7
2025-03-15 12:41:09 -04:00
Ariel Frischer f1274b3164 refactor(anthropic_token_limiter.py): update model parameter type in state_modifier to BaseChatModel for better compatibility
feat(anthropic_token_limiter.py): add get_model_name_from_chat_model function to extract model name from BaseChatModel instances
style(anthropic_token_limiter.py): format code for better readability and consistency in function definitions and logging messages
2025-03-15 09:37:26 -07:00
Andrew I. Christianson 9225ec3f2a
Merge pull request #135 from ariel-frischer/fix-undefined-model
fix(agent_utils.py): add check for model attribute to prevent errors …
2025-03-15 12:25:37 -04:00
Ariel Frischer bef504d756 fix(agent_utils.py): add check for model attribute to prevent errors when model does not have 'model' attribute 2025-03-15 09:23:01 -07:00
AI Christianson 75636f0477 webui -> server 2025-03-15 10:02:05 -04:00
Andrew I. Christianson a3dfb81840
Merge pull request #133 from andrewdkennedy1/detect-shell-env
Update shell.py for native windows support
2025-03-14 20:32:11 -04:00
Andrew 05eb50bd97
Update shell.py
adding windows support so shell commands run native without wsl
2025-03-14 16:37:32 -07:00
AI Christianson 46dd75a7e3 fixed session panel 2025-03-14 18:02:21 -04:00
AI Christianson e692f383c4 logos 2025-03-14 17:46:33 -04:00
AI Christianson 6e5f58e18d move theme toggle to right side 2025-03-14 17:37:35 -04:00
AI Christianson 7671312435 get rid of Sessions heading 2025-03-14 17:29:32 -04:00
AI Christianson f7aaccec76 ux 2025-03-14 17:28:21 -04:00
AI Christianson f1277aadf1 session panel spacing 2025-03-14 17:08:14 -04:00
Andrew I. Christianson aaf09c5df6
Merge pull request #132 from ariel-frischer/fix-token-limiter-2
Fix Sonnet 3.7 Token Limiter - Adjust Effective Max Input Tokens
2025-03-14 16:42:39 -04:00
AI Christianson 997c5e7ea7 make session list take up full width 2025-03-14 16:33:04 -04:00
Ariel Frischer 92faf8fc2d feat(anthropic_token_limiter): add get_provider_and_model_for_agent_type function to streamline provider and model retrieval based on agent type
fix(anthropic_token_limiter): refactor get_model_token_limit to use the new get_provider_and_model_for_agent_type function for cleaner code
test(anthropic_token_limiter): add unit tests for get_provider_and_model_for_agent_type and adjust_claude_37_token_limit functions to ensure correctness and coverage
2025-03-14 13:31:51 -07:00
AI Christianson 7d85dc2b05 click overlap event issue 2025-03-14 16:27:10 -04:00
Ariel Frischer 29c9cac4f4 feat(main.py): reorganize litellm configuration to improve clarity and maintainability
feat(agent_utils.py): add model detection utilities for Claude 3.7 models
fix(agent_utils.py): update get_model_token_limit to handle Claude 3.7 token limits correctly
test(model_detection.py): add unit tests for model detection utilities
chore(agent_utils.py): remove deprecated is_anthropic_claude function and related tests
style(agent_utils.py): format code for better readability and consistency
2025-03-14 13:10:44 -07:00
Andrew I. Christianson fe3adbd241
Merge pull request #131 from therality/master
Remove get_aider_executable and associated test
2025-03-14 15:40:39 -04:00
Will 5445a5c4a9 Removing get_aider_executable test as no longer relevant 2025-03-14 15:35:34 -04:00
Will 39ed523288 Removing get_aidr_executable as no longer a depedency 2025-03-14 15:29:11 -04:00
Andrew I. Christianson 0fe019bc9a
Merge pull request #130 from therality/master
Adding prompt-toolkit as dependency
2025-03-14 15:26:25 -04:00
Will 3f28ea80aa
Merge branch 'ai-christianson:master' into master 2025-03-14 15:25:35 -04:00
AI Christianson 0c40fa72c3 style/hmr 2025-03-14 15:09:22 -04:00
AI Christianson 07c6c2e5b5 fix hot reload on dev server 2025-03-14 10:25:22 -04:00
AI Christianson fe3984329d make sure session list hides when open and window expanded 2025-03-14 10:16:23 -04:00
AI Christianson 0a46e3c92b FAB color 2025-03-14 10:11:42 -04:00
AI Christianson 8a507f245e floating action button for sessions panel 2025-03-14 10:08:17 -04:00
AI Christianson af16879dd6 ui styling 2025-03-14 09:15:11 -04:00
AI Christianson f29658fee8 ui styling 2025-03-14 08:54:24 -04:00
Will 996608e4e3 Adding prompt-toolkit as dependency 2025-03-13 21:37:04 -04:00
AI Christianson 262c9f7d77 fix dark colors 2025-03-13 20:02:50 -04:00
AI Christianson d5d250b215 fix dark theme 2025-03-13 19:53:00 -04:00
AI Christianson 9f24c6bef9 remove junk 2025-03-13 18:47:36 -04:00
AI Christianson 1ced6ece4c agent ui components 2025-03-13 18:25:21 -04:00
AI Christianson a9c7f92687 style 2025-03-13 16:48:29 -04:00
AI Christianson 4685550605 integrate shadcn 2025-03-13 15:19:11 -04:00
AI Christianson a2129641ae Revert "shadcn integration"
This reverts commit 9d585f38b5.
2025-03-13 14:13:04 -04:00
AI Christianson 9d585f38b5 shadcn integration 2025-03-13 13:51:35 -04:00
AI Christianson fa66066c07 set up frontend/ infra 2025-03-13 12:18:54 -04:00
AI Christianson c511cefc67 add check for fallback handler 2025-03-13 08:48:51 -04:00
AI Christianson f08e9455b6 version bump 2025-03-13 07:17:26 -04:00
AI Christianson be0b566edb fix ERROR - Error getting expert guidance for planning: module 'ra_aid.agent_utils' has no attribute 'process_thinking_content' 2025-03-13 07:11:32 -04:00
AI Christianson be415ca968 fix config param error 2025-03-13 07:02:25 -04:00
AI Christianson 715d5f483d version bump 2025-03-13 07:02:25 -04:00
Andrew I. Christianson 85cabe4d37
Merge pull request #126 from nahsra/patch-1
Fix dev dependencies instructions
2025-03-12 19:37:48 -04:00
Arshan Dabirsiaghi 80cafa9a40
fix dev dependencies instructions 2025-03-12 19:15:54 -04:00
AI Christianson 26b1dbe966 reasoning assistance docs 2025-03-12 17:09:27 -04:00
Andrew I. Christianson a9656552a9
Merge pull request #124 from ariel-frischer/fix-token-limiter
Fix Sonnet 3.7 Token Limiter API Errors
2025-03-12 14:59:33 -04:00
Ariel Frischer b6f0f6a577 fix(llm.py): remove unnecessary thinking_kwargs from ChatOpenAI parameters to streamline client creation 2025-03-12 11:50:32 -07:00
Ariel Frischer 77a256317a feat: add session and trajectory models to track application state and events
- Introduce a new `Session` model to store information about each program run, including command line arguments and environment details.
- Implement a `Trajectory` model to log significant events and errors during execution, enhancing debugging and monitoring capabilities.
- Update various repository classes to support session and trajectory management, allowing for better tracking of user interactions and system behavior.
- Modify existing functions to record relevant events in the trajectory, ensuring comprehensive logging of application activities.
- Enhance error handling by logging errors to the trajectory, providing insights into failures and system performance.

feat(vsc): add initial setup for VS Code extension "ra-aid" with essential files and configurations
chore(vsc): create tasks.json for managing build and watch tasks in VS Code
chore(vsc): add .vscodeignore to exclude unnecessary files from the extension package
docs(vsc): create CHANGELOG.md to document changes and updates for the extension
docs(vsc): add README.md with instructions and information about the extension
feat(vsc): include esbuild.js for building and bundling the extension
chore(vsc): add eslint.config.mjs for TypeScript linting configuration
chore(vsc): create package.json with dependencies and scripts for the extension
feat(vsc): implement extension logic in src/extension.ts with webview support
test(vsc): add initial test suite in extension.test.ts for extension functionality
chore(vsc): create tsconfig.json for TypeScript compiler options
docs(vsc): add vsc-extension-quickstart.md for guidance on extension development
2025-03-12 11:47:21 -07:00
Ariel Frischer fdd73f149c feat(agent_utils.py): add support for sonnet_35_state_modifier for Claude 3.5 models to enhance token management
chore(anthropic_message_utils.py): remove debug print statements to clean up code and improve readability
chore(anthropic_token_limiter.py): remove debug print statements and replace with logging for better monitoring
test(test_anthropic_token_limiter.py): update tests to verify correct behavior of sonnet_35_state_modifier without patching internal logic
2025-03-12 11:16:54 -07:00
AI Christianson 12d27952d5 add --show-cost flag 2025-03-12 10:21:06 -04:00
AI Christianson 826c53e01a improve prompts 2025-03-12 08:24:41 -04:00
Ariel Frischer 7cfbcb5a2e chore(anthropic_token_limiter.py): comment out max_input_tokens and related debug prints to clean up code and reduce clutter during execution 2025-03-12 00:12:39 -07:00
Ariel Frischer d15d249929 fix(test_agent_utils.py): add name parameter to mock_react calls to ensure consistency in agent creation tests 2025-03-11 23:55:43 -07:00
Ariel Frischer 8d2d273c6b refactor(tests): move token limit tests from test_agent_utils.py to test_anthropic_token_limiter.py for better organization and clarity 2025-03-11 23:53:37 -07:00
Ariel Frischer e42f281f94 chore(anthropic_message_utils.py): remove unused fix_anthropic_message_content function to clean up codebase
chore(anthropic_token_limiter.py): remove import of fix_anthropic_message_content as it is no longer needed
test: add unit tests for has_tool_use and is_tool_pair functions to ensure correct functionality
test: enhance test coverage for anthropic_trim_messages with tool use scenarios to validate message handling
2025-03-11 23:48:08 -07:00
Ariel Frischer 376d486db8 refactor(anthropic_message_utils.py): clean up whitespace and improve code readability by removing unnecessary blank lines and aligning code formatting
fix(anthropic_message_utils.py): add warning in docstring for anthropic_trim_messages function to indicate incomplete implementation and clarify behavior
fix(anthropic_message_utils.py): ensure consistent formatting in conditional statements and improve readability of logical checks
2025-03-11 23:38:31 -07:00
Ariel Frischer a3284c9d7e feat(anthropic_token_limiter.py): add dataclass import for future use and improve code readability by restructuring import statements 2025-03-11 23:37:20 -07:00
Ariel Frischer ee73c85b02 feat(anthropic_message_utils.py): add utilities for handling Anthropic-specific message formats and trimming to improve message processing
fix(agent_utils.py): remove debug print statement for max_input_tokens to clean up code
refactor(anthropic_token_limiter.py): update state_modifier to use anthropic_trim_messages for better token management and maintain message structure
2025-03-11 23:24:57 -07:00
Ariel Frischer 09ba1ee0b9 refactor(anthropic_token_limiter.py): rename messages_to_dict to message_to_dict for consistency and clarity
feat(anthropic_token_limiter.py): add convert_message_to_litellm_format function to standardize message format for litellm
fix(anthropic_token_limiter.py): update wrapped_token_counter to handle only BaseMessage objects and improve token counting logic
chore(anthropic_token_limiter.py): add debug print statements to track token counts before and after trimming messages
2025-03-11 21:26:57 -07:00
AI Christianson c8fbd942ac session model 2025-03-11 20:11:14 -04:00
Ariel Frischer 5c9a1e81d2 feat(main.py): refactor imports for better organization and readability
feat(main.py): add DEFAULT_MODEL constant to centralize model configuration
feat(main.py): enhance logging and error handling for better debugging
feat(main.py): implement state_modifier for managing token limits in agent state
feat(anthropic_token_limiter.py): create utilities for handling token limits with Anthropic models
feat(output.py): add print_messages_compact function for debugging message output
test(anthropic_token_limiter.py): add unit tests for token limit utilities and state management
2025-03-11 14:03:18 -07:00
AI Christianson 376fe18b83 activity panel 2025-03-11 14:55:43 -04:00
AI Christianson 89ee1d96ef vsc icon 2025-03-11 14:15:37 -04:00
AI Christianson 750c0d893b vscode extension 2025-03-11 13:32:46 -04:00
AI Christianson 37764c7d56 fix tests 2025-03-11 11:25:27 -04:00
AI Christianson ae9cf5021b record trajectory at all steps 2025-03-11 11:01:05 -04:00
AI Christianson 5d899d3d13 trajectory 2025-03-11 08:56:12 -04:00
AI Christianson d0985b6b84 store trajectory for tasks 2025-03-11 08:41:59 -04:00
AI Christianson 7038a61693 mock repos for test 2025-03-11 08:41:51 -04:00
AI Christianson 96093e8dfc trajectory for stage transitions 2025-03-11 08:34:08 -04:00
Andrew I. Christianson b4b0fdd686
Merge pull request #120 from ariel-frischer/cost-display
Add Cost Display for Default ReAct Agent
2025-03-10 20:12:01 -04:00
Ariel Frischer 4aa1b0ba93 refactor(agent_utils.py): remove unused run_research_agent and run_web_research_agent functions to clean up code and improve maintainability
refactor(agent_utils.py): import run_research_agent and run_web_research_agent from their respective modules to streamline the code structure and enhance clarity
2025-03-10 17:09:05 -07:00
Ariel Frischer c4b2d2bb51 fix(agent_utils.py): remove merge conflict markers and clean up imports to ensure code integrity
refactor(agent_utils.py): consolidate research agent imports for better organization and readability
2025-03-10 17:07:24 -07:00
Ariel Frischer 89e4556e7b feat: implement trajectory model and repository for tracking agent actions
This commit introduces a new `Trajectory` model to the database, which tracks the sequence of actions taken by agents, including tool executions and their results. The addition of the `TrajectoryRepository` allows for storing and retrieving these trajectories, enabling better analysis of agent behavior and debugging of issues.

Additionally, the commit refactors existing code to utilize the new repository and model, improving the overall architecture and maintainability of the codebase. This change is essential for enhancing the capabilities of the agent system and providing a more robust framework for future development.
2025-03-10 17:05:34 -07:00
Ariel Frischer 4d4eb6cadb fix(tests): add cost_cb parameter to fake_print_agent_output function to enhance flexibility in testing
style(tests): add newline at the end of test_handle_api_error_resource_exhausted function for consistency with PEP 8 guidelines
2025-03-10 17:03:42 -07:00
Ariel Frischer 8f2adc7f61 fix(output.py): update subtitle text from "Total Cost" to "Cost" for clarity in cost information display 2025-03-10 17:01:00 -07:00
Ariel Frischer f43c5e72b6 feat(output.py): add get_cost_subtitle function to generate cost subtitles for agent output
refactor(output.py): simplify subtitle generation in print_agent_output function by using get_cost_subtitle
2025-03-10 16:58:39 -07:00
Ariel Frischer 416689b030 feat(agent_utils.py): pass callback to print_agent_output to track costs and tokens
feat(output.py): enhance print_agent_output to display cost and token information in the output panel
2025-03-10 16:51:42 -07:00
AI Christianson 909825bf1b refactor: extract get_most_recent_id 2025-03-10 19:37:39 -04:00
AI Christianson b3010bb649 add error info to trajectory records 2025-03-10 19:12:14 -04:00
AI Christianson 78983ec20b add trajectory table 2025-03-10 18:59:42 -04:00
AI Christianson a18998be0d add project info to reasoning assist prompts 2025-03-10 18:01:56 -04:00
AI Christianson 3db7cc2ca9 improve prompt 2025-03-10 17:47:31 -04:00
AI Christianson b5e4c64042 improve prompts; make list_directory more resilient 2025-03-10 16:41:09 -04:00
AI Christianson 7d579f5557 improve prompts 2025-03-10 15:37:38 -04:00
AI Christianson e81421a95a improve prompts 2025-03-10 15:30:22 -04:00
AI Christianson c98c107ce3 use expert model for reasoning assisted mode 2025-03-10 14:58:47 -04:00
AI Christianson 51fa86b5c4 refactor: extract run_task_implementation_agent 2025-03-10 14:44:34 -04:00
AI Christianson d8dcc8ca86 refactor: extract run_planning_agent 2025-03-10 14:19:06 -04:00
AI Christianson a437a1e8c3 prompt improvements 2025-03-10 13:46:08 -04:00
AI Christianson 4f2c36b958 refactor: extract research agent 2025-03-10 13:33:00 -04:00
Ariel Frischer 2899b5f848
feat(agent_utils.py): add AnthropicCallbackHandler to track token usage and costs for Anthropic models (#118)
style(agent_utils.py): format imports and code for better readability
refactor(agent_utils.py): standardize model name and cost calculation logic for clarity and maintainability
chore(anthropic_callback_handler.py): create a new file for the AnthropicCallbackHandler implementation and related functions
2025-03-10 07:08:12 -04:00
Ariel Frischer ddd0e2ae2d feat(agent_utils.py): add AnthropicCallbackHandler to track token usage and costs for Anthropic models
style(agent_utils.py): format imports and code for better readability
refactor(agent_utils.py): standardize model name and cost calculation logic for clarity and maintainability
chore(anthropic_callback_handler.py): create a new file for the AnthropicCallbackHandler implementation and related functions
2025-03-10 01:18:44 -07:00
AI Christianson d194868cff fix binary detection 2025-03-08 22:36:06 -05:00
Ariel Frischer 053908448f
fix(env_inv.py): handle None values in sorting of installations to prevent errors (#117) 2025-03-08 21:03:06 -05:00
AI Christianson d0bf78c5f0 support reasoning assistance in research phase. 2025-03-08 19:32:05 -05:00
AI Christianson 0a143e8fff improve prompts 2025-03-08 17:08:10 -05:00
AI Christianson eaf79fbee5 fix tests; improve prompts 2025-03-08 16:29:17 -05:00
AI Christianson fd772ee369 disable reasoning assistance by default 2025-03-08 15:36:21 -05:00
AI Christianson 35f91aa128 add flags to force enable/disable reasoning assistance 2025-03-08 15:36:00 -05:00
AI Christianson ff653c7208 reasoning assistance for implementation tasks 2025-03-08 15:12:13 -05:00
AI Christianson cfb0ec148f extract thinking processing 2025-03-08 14:48:46 -05:00
AI Christianson 8f1e072e20 improve reasoning assistance 2025-03-08 14:23:35 -05:00
AI Christianson 2130334837 improve reasoning assistance prompt 2025-03-08 13:50:10 -05:00
AI Christianson d7fb269f4d improve reasoning assistance prompt 2025-03-08 13:37:38 -05:00
AI Christianson e64c4066a6 implement reasoning-guided workflows 2025-03-08 13:35:06 -05:00
AI Christianson c323098aec include environment information in prompts 2025-03-08 12:01:40 -05:00
AI Christianson f1a33fc1c0 add environment inventory 2025-03-08 10:58:23 -05:00
AI Christianson b9241780d0 fix test 2025-03-08 09:30:52 -05:00
AI Christianson b262305592 thinking model docs 2025-03-08 09:05:59 -05:00
AI Christianson eff01b62aa improve prompts 2025-03-08 09:05:54 -05:00
AI Christianson c1b84cd645 tokens for qwq 2025-03-08 08:56:16 -05:00
AI Christianson b4d7cd30ce changelog 2025-03-08 08:32:17 -05:00
AI Christianson 96dbd1c4e7 add --show-thoughts flag 2025-03-08 08:31:45 -05:00
AI Christianson 4d2b10c80c fix tests 2025-03-08 08:16:21 -05:00
AI Christianson ffc340a82f changelog 2025-03-08 08:10:17 -05:00
AI Christianson 4a63946df5 upgrade langchain/langgraph deps 2025-03-08 07:57:50 -05:00
AI Christianson e49cce301f support think tag on expert 2025-03-07 21:37:34 -05:00
AI Christianson cf150173aa support think tag 2025-03-07 20:29:37 -05:00
AI Christianson 66287baf0e qwq 2025-03-07 19:56:40 -05:00
AI Christianson e08a8feabc fix tests 2025-03-07 19:21:44 -05:00
AI Christianson 1643518b50 version bump 2025-03-07 18:57:19 -05:00
AI Christianson 58c0739cfc fix tests 2025-03-07 18:47:12 -05:00
AI Christianson 60e4616313 fix agent context 2025-03-07 18:33:45 -05:00
AI Christianson 3607803bf5 use interrupt for tighter control of agent loop 2025-03-07 17:31:27 -05:00
AI Christianson 638776c8f8 fix test 2025-03-07 14:28:14 -05:00
AI Christianson 6e39d39b42 version bump 2025-03-07 14:14:34 -05:00
AI Christianson faf9821c84 update docs for memory management 2025-03-07 14:05:29 -05:00
AI Christianson 089bd9b368 add --wipe-project-memory flag 2025-03-07 12:06:40 -05:00
AI Christianson 95f9d8c2c4 clean up docs 2025-03-07 11:41:22 -05:00
AI Christianson 9e9c3ad3d2 should exit propagation 2025-03-07 11:25:46 -05:00
AI Christianson 77856bfa0c set agent_should_exit in gc agents 2025-03-07 10:35:02 -05:00
AI Christianson 53406f1ddf include memory in status panel 2025-03-07 09:45:38 -05:00
AI Christianson 85a461e048 fix web research 2025-03-07 09:16:39 -05:00
AI Christianson f0e098cd82 fix tests 2025-03-07 09:02:32 -05:00
AI Christianson 97716a941a fix tests 2025-03-07 08:51:35 -05:00
AI Christianson 756b7bf85a fix tests 2025-03-07 08:35:44 -05:00
AI Christianson 4ea13c6675 get rid of vercel 2025-03-07 08:31:50 -05:00
AI Christianson c637807e08 handle sonnet thinking tokens in expert tool 2025-03-06 10:30:58 -05:00
AI Christianson 254a9f4d13 version check 2025-03-05 14:46:39 -05:00
AI Christianson 07a5900b59 version 2025-03-05 07:43:18 -05:00
AI Christianson 0b621b6008 allow multiple string replacements 2025-03-04 21:34:29 -05:00
AI Christianson c9f3f37ca3 get rid of global memory 2025-03-04 21:25:37 -05:00
AI Christianson 5bd8c76a22 config repository 2025-03-04 21:01:08 -05:00
AI Christianson 3e68dd3fa6 add fixed_string param to ripgrep tool 2025-03-04 19:26:11 -05:00
AI Christianson 60a6707107 track agent depth via context 2025-03-04 19:05:33 -05:00
AI Christianson a1b268fdf4 get rid of global memory work log refs 2025-03-04 18:30:52 -05:00
AI Christianson d907a0ea9c key snippets 2025-03-04 17:49:17 -05:00
AI Christianson 47cb6b65ef fix duplicate implementation 2025-03-04 15:14:17 -05:00
AI Christianson 600bf355d9 use repo pattern 2025-03-04 14:59:45 -05:00
AI Christianson 0afed55809 get rid of dead code around implementation_requested 2025-03-04 13:10:52 -05:00
AI Christianson 7845f4d876 remove dead code 2025-03-04 12:46:14 -05:00
AI Christianson e9c6aa7b4f prompt improvements 2025-03-04 09:51:02 -05:00
AI Christianson bf96ddec45 fix tests 2025-03-04 09:33:00 -05:00
AI Christianson a0775e3792 ciayn fixes 2025-03-04 09:20:46 -05:00
AI Christianson fb030e9049 disallow repeat tool calls 2025-03-04 08:33:22 -05:00
AI Christianson 5dfb41b000 ignore .ra-aid in rg by default 2025-03-04 08:02:22 -05:00
AI Christianson 3d5b5850b4 multiple tool results in ciayn 2025-03-04 07:59:05 -05:00
AI Christianson bee7416bf2 ciayn fixes 2025-03-04 07:44:50 -05:00
AI Christianson 535c870568 fix validation 2025-03-04 01:48:12 -05:00
AI Christianson 13729f16ce AST-based parsing and validation of tool calls 2025-03-04 01:32:59 -05:00
AI Christianson 4859a4cdc5 fixes 2025-03-04 00:57:15 -05:00
AI Christianson 9cae0ef1fc project file and ciayn improvements 2025-03-04 00:49:48 -05:00
AI Christianson bd02bffc55 ciayn fixes 2025-03-03 23:50:55 -05:00
AI Christianson e45cd78c7f better ciayn status 2025-03-03 23:40:15 -05:00
AI Christianson 039aa8f22a ciayn improvements 2025-03-03 23:07:58 -05:00
AI Christianson 035544c77a research notes repo 2025-03-03 22:31:51 -05:00
AI Christianson 6562b6c332 fix binary file detection 2025-03-03 18:43:49 -05:00
AI Christianson 5202d2e7f3 use context vars for human input repo 2025-03-03 17:58:55 -05:00
AI Christianson fc58aa0b77 key snippets context var 2025-03-03 17:27:41 -05:00
AI Christianson ffd1ef15d4 adjust gc thresholds 2025-03-03 17:00:08 -05:00
AI Christianson 36e4004db0 use context vars for key facts repo 2025-03-03 16:58:03 -05:00
AI Christianson dd9af78693 eradicate dead coad 2025-03-03 08:06:12 -05:00
AI Christianson bc9d11e6e2 remove refs to global memory key snippets (dead code/obsolete) 2025-03-03 07:54:37 -05:00
AI Christianson 539af1d537 get rid of key snippet global memory refs 2025-03-02 22:00:40 -05:00
AI Christianson bd05dee716 include key facts/snippets in chat mode 2025-03-02 21:29:18 -05:00
AI Christianson 1c95080897 cleanup 2025-03-02 20:56:16 -05:00
AI Christianson 80e8d9134b include last human input in research prompt 2025-03-02 20:54:39 -05:00
AI Christianson 9a69bb173e do not gc key facts/snippets associated with current human input 2025-03-02 20:27:52 -05:00
AI Christianson f88ad5bc7a associate key facts and snippets with latest human input 2025-03-02 20:18:00 -05:00
AI Christianson 186904c0ca added human input table 2025-03-02 20:06:04 -05:00
AI Christianson d4353b1824 localize delete_key_snippets with gc agent 2025-03-02 19:56:42 -05:00
AI Christianson 332cbec826 key snippet gc 2025-03-02 19:41:48 -05:00
AI Christianson 772ce3e049 only access snippets via repository 2025-03-02 19:33:03 -05:00
AI Christianson cb3504016f fix tests 2025-03-02 19:18:45 -05:00
AI Christianson 038e7b886c key snippets db 2025-03-02 19:06:51 -05:00
AI Christianson be2eb298a5 improve prompts 2025-03-02 16:31:33 -05:00
AI Christianson 073c68d010 cleanup 2025-03-02 16:30:22 -05:00
AI Christianson 746649a1bb cleanup 2025-03-02 16:20:36 -05:00
AI Christianson 935a013a4c key facts repository 2025-03-02 16:00:55 -05:00
AI Christianson 8819f463a1 fix output 2025-03-02 15:28:32 -05:00
AI Christianson 714d55e50a fix tests/ra_aid/tools/test_memory.py::test_emit_key_facts_triggers_cleaner 2025-03-02 15:27:46 -05:00
AI Christianson 7ec6535eef gc fixups 2025-03-02 15:18:16 -05:00
AI Christianson 2418506d7e gc status panels 2025-03-02 15:04:25 -05:00
AI Christianson d41416b4d7 run gc in db ctx 2025-03-02 14:52:11 -05:00
AI Christianson 1855cc3252 cleaner -> gc 2025-03-02 14:44:39 -05:00
AI Christianson 14c9bdfdc7 key facts gc 2025-03-02 14:37:42 -05:00
AI Christianson 17ab6d2a50 refactor: agents/ -> agent_backends/ 2025-03-02 14:16:15 -05:00
AI Christianson 5736144d89 remove old prompts.py 2025-03-02 13:52:45 -05:00
AI Christianson fd1025f74c refactor prompts 2025-03-02 13:47:39 -05:00
AI Christianson c3504ee5e5 update docs to reflect standalone mode 2025-03-02 13:08:53 -05:00
AI Christianson cd29014282 collect verbose logs in files by default 2025-03-02 12:54:00 -05:00
AI Christianson c3f32d640d logging docs 2025-03-02 12:44:40 -05:00
AI Christianson 09bd7cbf4b add log mode and log level, support for logging to files in .ra-aid/logs/ 2025-03-02 12:18:27 -05:00
AI Christianson f89d40527d log to file 2025-03-01 22:50:54 -05:00
AI Christianson 23d5e267f4 key fact db 2025-03-01 22:41:35 -05:00
AI Christianson 50d618c8f8 improve prompts 2025-03-01 21:05:18 -05:00
Ariel Frischer e960a68d29
Binary Skipped ascii filetype fix (#108)
* chore: refactor code for improved readability and maintainability

- Standardize variable naming conventions for consistency.
- Improve logging messages for better clarity and debugging.
- Remove unnecessary imports and clean up code structure.
- Enhance error handling and logging in various modules.
- Update comments and docstrings for better understanding.
- Optimize imports and organize them logically.
- Ensure consistent formatting across files for better readability.
- Refactor functions to reduce complexity and improve performance.
- Add missing type hints and annotations for better code clarity.
- Improve test coverage and organization in test files.

style(tests): apply consistent formatting and spacing in test files for improved readability and maintainability

* chore(tests): remove redundant test for ensure_tables_created with no models to streamline test suite and reduce maintenance overhead

* fix(memory.py): update is_binary_file function to correctly identify binary files by returning True for non-text mime types
2025-02-28 06:47:35 -05:00
AI Christianson 429f854fb8 catch more rate limit errors 2025-02-27 22:42:06 -05:00
AI Christianson 99bbcdbc2f update docs on google gemini 2025-02-27 20:52:03 -05:00
AI Christianson 9924c70471 version bump 2025-02-27 11:45:45 -05:00
AI Christianson 346e22b5cb improve agent crash detection 2025-02-27 11:41:36 -05:00
AI Christianson 9202cf0d6d improve agent_should_exit logic 2025-02-27 10:46:57 -05:00
AI Christianson 9403b8c57f improve agent context inheritance 2025-02-27 10:31:55 -05:00
AI Christianson 6c85a39bbb added agent_should_exit context 2025-02-27 10:14:17 -05:00
AI Christianson 6d2b0a148d support context for ripgrep 2025-02-27 10:04:59 -05:00
AI Christianson a8030104fc version bump 2025-02-27 09:43:22 -05:00
AI Christianson d11393c898 improve chat prompt 2025-02-27 09:42:32 -05:00
AI Christianson fbc4e05d4e version bump 2025-02-27 09:25:06 -05:00
AI Christianson a791e9f2d9 improve prompts 2025-02-27 09:19:31 -05:00
AI Christianson 79ca08137c improve prompts 2025-02-27 09:15:32 -05:00
AI Christianson d6bcf44700 turn request_task_implementation return val into a string and add prompt to fix duplicated work. 2025-02-27 09:06:43 -05:00
AI Christianson 8760e6e152 turn request_implementation return val into a string and add prompt to fix duplicated work. 2025-02-27 08:52:54 -05:00
AI Christianson 1ce52774d7 fix langgraph prebuilt dep; remove modification tools from research phase 2025-02-27 08:36:16 -05:00
AI Christianson c89a92e4f0 prompts + remove oneshot in research 2025-02-26 22:09:04 -05:00
AI Christianson c83815c836 fix new project detection 2025-02-26 21:19:08 -05:00
AI Christianson 9f6089d0d7 improve prompts 2025-02-26 20:50:48 -05:00
AI Christianson 4cfb377bb1 improve prompts 2025-02-26 20:29:18 -05:00
AI Christianson 6b7d2374ee disable related if aider disabled 2025-02-26 20:27:03 -05:00
AI Christianson 65b8619517 aider-free mode 2025-02-26 20:15:00 -05:00
AI Christianson 4aeb52e41d enable file editing tools 2025-02-26 20:01:00 -05:00
AI Christianson 28d9032ca5 agent context 2025-02-26 19:30:08 -05:00
AI Christianson 724dbd4fda db migrations 2025-02-26 16:21:38 -05:00
AI Christianson e6d98737a8 fix logging 2025-02-26 15:25:43 -05:00
AI Christianson dbf4d954e1 base db infra 2025-02-26 11:44:18 -05:00
AI Christianson f05d30ff50 add db deps 2025-02-25 21:35:07 -05:00
AI Christianson 012d95cf00 version bump 2025-02-25 19:03:22 -05:00
AI Christianson 840abf96f7 fix tests 2025-02-25 18:38:00 -05:00
AI Christianson 9c76745bcc improve binary file filtering 2025-02-25 18:34:28 -05:00
AI Christianson 94d655ce91 skip binary files; update deps 2025-02-25 18:32:29 -05:00
AI Christianson 8d1e4a96bd improve prompts 2025-02-25 17:41:17 -05:00
AI Christianson f5de1e55b4 update deps 2025-02-25 17:41:08 -05:00
AI Christianson 0199f450ee version bump 2025-02-25 17:14:29 -05:00
AI Christianson 3f2a706ff6 improve prompts 2025-02-25 17:13:17 -05:00
AI Christianson 78793bb786 media query logo 2025-02-25 15:59:24 -05:00
AI Christianson 8c8ae5384d version bump 2025-02-25 15:34:03 -05:00
AI Christianson d3b4d9b8d9 fix capture bug 2025-02-25 15:13:33 -05:00
AI Christianson 7ae4c61af6 fix interactive capture; fix prompts 2025-02-25 14:59:13 -05:00
AI Christianson eede183110 fix junk in command capture 2025-02-25 14:46:53 -05:00
AI Christianson 2e13b2bf4d remove file 2025-02-25 14:16:50 -05:00
AI Christianson 804ebd76a5 fix windows 2025-02-25 14:15:28 -05:00
AI Christianson f14863a06d improve interactive history capture 2025-02-25 14:02:43 -05:00
AI Christianson a866b38883 fix linux interactive commands 2025-02-25 13:42:00 -05:00
AI Christianson ea44e5dd6a linux fixes 2025-02-25 13:41:55 -05:00
Mark Varkevisser d163a74c47
Add Windows compatibility improvements (#105)
* Add Windows compatibility improvements

1. Add error handling for Windows-specific modules
2. Update README with Windows installation instructions
3. Add Windows-specific tests
4. Improve cross-platform support in interactive.py

* Fix: Add missing subprocess import in Windows compatibility tests

* Improve Windows compatibility:

1. Add detailed error handling for Windows I/O operations
2. Enhance timeout messages with more descriptive information
3. Add comprehensive comments explaining Windows-specific code

* Fix WebUI: Improve message display, add syntax highlighting, animations, and fix WebSocket communication
2025-02-25 13:41:29 -05:00
AI Christianson 2f132bdeb5 version bump 2025-02-25 11:14:52 -05:00
AI Christianson 495ed838ea upgrade aider; optimize prompts 2025-02-25 11:12:12 -05:00
AI Christianson d8f1618b2b prompt improvements 2025-02-25 08:59:55 -05:00
AI Christianson 860eb484c7 prompt improvements 2025-02-25 08:54:29 -05:00
AI Christianson ac9aeece2a prompt improvements 2025-02-24 20:05:50 -05:00
AI Christianson 7b4359eb28 version bump 2025-02-24 19:57:22 -05:00
AI Christianson c37e5b0ac1 optimize prompts 2025-02-24 19:56:47 -05:00
AI Christianson 47d548180a version bump 2025-02-24 19:15:18 -05:00
AI Christianson 52722f6600 use latest aider; update tool calling prompts and minimize return values to improve tool calling performance 2025-02-24 19:08:12 -05:00
AI Christianson cc93961bf3 version bump 2025-02-24 15:49:47 -05:00
AI Christianson b600bd8d48 show version at startup 2025-02-24 15:45:56 -05:00
AI Christianson 6591400ad6 fix anthropic key error msg 2025-02-24 15:35:45 -05:00
AI Christianson 7f85e93431 sonnet 3.7 2025-02-24 14:44:40 -05:00
AI Christianson 04913bdaf3 fix bug where model selection on anthropic was always using default 2025-02-24 14:35:09 -05:00
305 changed files with 51495 additions and 5962 deletions

7
.gitignore vendored
View File

@ -13,4 +13,9 @@ __pycache__/
/htmlcov
.envrc
appmap.log
*.swp
/vsc/node_modules
/vsc/dist
node_modules/
/frontend/common/dist
/frontend/web/dist/

View File

@ -5,6 +5,198 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.17.1] 2025-03-13
### Fixed
- Fixed bug with `process_thinking_content` function by moving it from `agent_utils` to `ra_aid.text.processing` module
- Fixed config parameter handling in research request functions
- Updated development setup instructions in README to use `pip install -e ".[dev]"` instead of `pip install -r requirements-dev.txt`
## [0.17.0] 2025-03-12
### Added
- Added support for think tags in models with the new extract_think_tag function
- Enhanced CiaynAgent and expert tool to extract and display thinking content from <think>...</think> tags
- Added model parameters for think tag support
- Added comprehensive testing for think tag functionality
- Added `--show-thoughts` flag to show thoughts of thinking models
- Added `--show-cost` flag to display cost information during agent operations
- Enhanced cost tracking with AnthropicCallbackHandler for monitoring token usage and costs
- Added Session and Trajectory models to track application state and agent actions
- Added comprehensive environment inventory system for collecting and providing system information to agents
- Added repository implementations for Session and Trajectory models
- Added support for reasoning assistance in research phase
- Added new config parameters for managing cost display and reasoning assistance
### Changed
- Updated langchain/langgraph deps
- Improved trajectory tracking for better debugging and analysis
- Enhanced prompts throughout the system for better performance
- Improved token management with better handling of thinking tokens in Claude models
- Updated project information inclusion in prompts
- Reorganized agent code with better extraction of core functionality
- Refactored anthropic token limiting for better control over token usage
### Fixed
- Fixed binary file detection
- Fixed environment inventory sorting
- Fixed token limiter functionality
- Various test improvements and fixes
## [0.16.1] 2025-03-07
### Changed
- Replaced thread-local storage with contextvars in agent_context.py for better context isolation
- Improved React agent execution with LangGraph's interrupt mechanism
- Enhanced _run_agent_stream function to properly handle agent state and continuation
### Fixed
- Fixed tests to work with the new implementation
## [0.16.0] 2025-03-07
### Added
- Database-backed memory system with SQLite (.ra-aid/pk.db)
- Repository pattern for memory access (KeyFactRepository, KeySnippetRepository, ResearchNoteRepository)
- Memory garbage collection with configurable thresholds
- "--wipe-project-memory" flag to reset memory
- Memory statistics in status panel
- Propagation depth control for agent_should_exit
- Fixed string parameter for ripgrep tool
- Support for Claude 3.7 Sonnet thinking tokens in expert tool
### Changed
- Enhanced file logging with support for .ra-aid/logs/
- Improved CiaynAgent with better tool validation and execution
- Memory-related prompt improvements
### Fixed
- Various bug fixes in tool execution
- Test improvements for memory system
## [0.15.2] - 2025-02-27
### Added
- Added agent_should_exit context functionality with propagation to parent contexts
- Improved agent crash detection with non-propagating crash state
- Enhanced ripgrep tool with better context support
- Improved agent context inheritance
- Added comprehensive test coverage for exit and crash handling
## [0.15.1] - 2025-02-27
### Fixed
- Improved chat prompt to prevent endless loop behavior with sonnet 3.7.
## [0.15.0] - 2025-02-27
### Added
- Added database infrastructure with models, connections, and migrations
- Added agent context system for improved context management
- Added aider-free mode with command line option to disable aider-related functionality
- Added database-related dependencies
### Changed
- Improved file editing tools with enhanced functionality
- Enhanced agent implementation tools with modified return values and logic
- Improved agent tool prompts for better clarity and effectiveness
- Fixed langgraph prebuilt dependency
### Fixed
- Fixed project state detection logic with added tests
## [0.14.9] - 2025-02-25
### Added
- Added binary file detection and filtering to prevent binary files from being added to related files
- Added python-magic dependency for improved binary file detection
- Added support for "thinking" budget parameter for Claude 3.7 Sonnet
### Changed
- Updated dependencies:
- langchain-anthropic from 0.3.7 to 0.3.8
- langchain-google-genai from 2.0.10 to 2.0.11
- Improved shell command tool description to recommend keeping commands under 300 words
- Enhanced binary file filtering to include detailed reporting of skipped files
- Updated test assertions to be more flexible with parameter checking
## [0.14.8] - 2025-02-25
### Changed
- Improved programmer.py tool prompts for better clarity on related files visibility
- Enhanced programmer tool to remind users to call emit_related_files on any new files created
- Updated README.md to use media queries for showing different logos based on color scheme preference
## [0.14.7] - 2025-02-25
### Added
- Windows compatibility improvements
- Add error handling for Windows-specific modules
- Add Windows-specific tests for compatibility
### Changed
- Improve cross-platform support in interactive.py
- WebUI improvements
- Improve message display
- Add syntax highlighting
- Add animations
- Expert tool prompt improvements
### Fixed
- WebUI improvements
- Fix WebSocket communication
- Interactive command handling improvements
- Fix interactive history capture
- Fix command capture bugs
- Multiple fixes for interactive command execution on both Linux and Windows
- Enhance error handling for interactive processes
## [0.14.6] - 2025-02-25
### Added
- Added `--no-git` flag to aider commands to prevent git operations
### Changed
- Updated aider-chat dependency from 0.75 to 0.75.1
- Improved prompts for better tool effectiveness
- Enhanced emit_key_snippet documentation to focus on upcoming work relevance
## [0.14.5] - 2025-02-24
### Changed
- Optimized prompts
## [0.14.4] - 2025-02-24
### Changed
- Updated aider-chat dependency from 0.74.2 to 0.75
- Improved tool calling performance by minimizing tool return values
- Replaced emit_key_snippets with emit_key_snippet for simpler code snippet management
- Simplified return values for multiple tools to improve tool calling accuracy
- Updated tool prompts to remove unnecessary context cleanup references
- Reorganized order of tools in read-only tools list
### Fixed
- Fixed tests to align with updated tool return values
- Updated test assertions to match new simplified tool outputs
## [0.14.3] - 2025-02-24
### Added
- Added support for Claude 3.7 Sonnet model
- Added version display in startup configuration panel
### Changed
- Updated language library dependencies (langgraph, langchain-core, langchain, langchain-openai, langchain-google-genai)
- Changed default Anthropic model from Claude 3.5 Sonnet to Claude 3.7 Sonnet
### Fixed
- Fixed f-string syntax error in write_file.py
- Fixed bug where model selection on Anthropic was always using default instead of respecting user selection
- Fixed Anthropic key error message to reference the correct variable
- Added test for user-specified Anthropic model selection
## [0.14.2] - 2025-02-19
### Added

View File

@ -1,4 +1,4 @@
include LICENSE
include README.md
include CHANGELOG.md
recursive-include ra_aid/webui/static *
recursive-include ra_aid/server/static *

View File

@ -1,4 +1,8 @@
<img src="assets/RA-black-bg.png" alt="RA.Aid - Develop software autonomously." style="margin-bottom: 20px;">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="assets/logo-white-transparent.gif">
<source media="(prefers-color-scheme: light)" srcset="assets/logo-black-transparent.png">
<img src="assets/logo-black-transparent.png" alt="RA.Aid - Develop software autonomously." style="margin-bottom: 20px;">
</picture>
[![Python Versions](https://img.shields.io/badge/python-3.8%2B-blue)](https://www.python.org)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue)](LICENSE)
@ -6,7 +10,7 @@
**Develop software autonomously.**
RA.Aid (pronounced "raid") helps you develop software autonomously. It was made by putting `aider` (https://aider.chat/) in a LangChain ReAct agent loop. This unique combination allows developers to leverage `aider`'s code editing capabilities while benefiting from LangChain's agent-based task execution framework. The tool provides an intelligent assistant that can help with research, planning, and implementation of multi-step development tasks.
RA.Aid (pronounced "raid") helps you develop software autonomously. It is a standalone coding agent built on LangGraph's agent-based task execution framework. The tool provides an intelligent assistant that can help with research, planning, and implementation of multi-step development tasks. RA.Aid can optionally integrate with `aider` (https://aider.chat/) via the `--use-aider` flag to leverage its specialized code editing capabilities.
The result is **near-fully-autonomous software development**.
@ -25,6 +29,8 @@ Key sections:
- [Recommended Configuration](https://docs.ra-aid.ai/quickstart/recommended)
- [Open Models Setup](https://docs.ra-aid.ai/quickstart/open-models)
- [Usage Examples](https://docs.ra-aid.ai/category/usage)
- [Logging System](https://docs.ra-aid.ai/configuration/logging)
- [Memory Management](https://docs.ra-aid.ai/configuration/memory-management)
- [Contributing Guide](https://docs.ra-aid.ai/contributing)
- [Getting Help](https://docs.ra-aid.ai/getting-help)
@ -97,6 +103,31 @@ What sets RA.Aid apart is its ability to handle complex programming tasks that e
## Installation
### Windows Installation
1. Install Python 3.8 or higher from [python.org](https://www.python.org/downloads/)
2. Install required system dependencies:
```powershell
# Install Chocolatey if not already installed (run in admin PowerShell)
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
# Install ripgrep using Chocolatey
choco install ripgrep
```
3. Install RA.Aid:
```powershell
pip install ra-aid
```
4. Install Windows-specific dependencies:
```powershell
pip install pywin32
```
5. Set up your API keys in a `.env` file:
```env
ANTHROPIC_API_KEY=your_anthropic_key
OPENAI_API_KEY=your_openai_key
```
### Unix/Linux Installation
RA.Aid can be installed directly using pip:
```bash
@ -129,7 +160,7 @@ export GEMINI_API_KEY=your_api_key_here
export TAVILY_API_KEY=your_api_key_here
```
Note: The programmer tool (aider) will automatically select its model based on your available API keys:
Note: When using the `--use-aider` flag, the programmer tool (aider) will automatically select its model based on your available API keys:
- If ANTHROPIC_API_KEY is set, it will use Claude models
- If only OPENAI_API_KEY is set, it will use OpenAI models
- You can set multiple API keys to enable different features
@ -153,11 +184,14 @@ ra-aid -m "Your task or query here"
# Research-only mode (no implementation)
ra-aid -m "Explain the authentication flow" --research-only
# Enable verbose logging for detailed execution information
ra-aid -m "Add new feature" --verbose
# File logging with console warnings (default mode)
ra-aid -m "Add new feature" --log-mode file
# Console-only logging with detailed output
ra-aid -m "Add new feature" --log-mode console --log-level debug
```
More information is available in our [Usage Examples](https://docs.ra-aid.ai/category/usage).
More information is available in our [Usage Examples](https://docs.ra-aid.ai/category/usage), [Logging System](https://docs.ra-aid.ai/configuration/logging), and [Memory Management](https://docs.ra-aid.ai/configuration/memory-management) documentation.
### Command Line Options
@ -165,6 +199,7 @@ More information is available in our [Usage Examples](https://docs.ra-aid.ai/cat
- `--research-only`: Only perform research without implementation
- `--provider`: The LLM provider to use (choices: anthropic, openai, openrouter, openai-compatible, gemini)
- `--model`: The model name to use (required for non-Anthropic providers)
- `--use-aider`: Enable aider integration for code editing. When enabled, RA.Aid uses aider's specialized code editing capabilities instead of its own native file modification tools. This option is useful when you need aider's specific editing features or prefer its approach to code modifications. This feature is optional and disabled by default.
- `--research-provider`: Provider to use specifically for research tasks (falls back to --provider if not specified)
- `--research-model`: Model to use specifically for research tasks (falls back to --model if not specified)
- `--planner-provider`: Provider to use specifically for planning tasks (falls back to --provider if not specified)
@ -174,9 +209,15 @@ More information is available in our [Usage Examples](https://docs.ra-aid.ai/cat
- `--expert-model`: The model name to use for expert knowledge queries (required for non-OpenAI providers)
- `--hil, -H`: Enable human-in-the-loop mode for interactive assistance during task execution
- `--chat`: Enable chat mode with direct human interaction (implies --hil)
- `--verbose`: Enable verbose logging output
- `--log-mode`: Logging mode (choices: file, console)
- `file` (default): Logs to both file and console (only warnings and errors to console)
- `console`: Logs to console only at the specified log level with no file logging
- `--log-level`: Set specific logging level (debug, info, warning, error, critical)
- With `--log-mode=file`: Controls the file logging level (console still shows only warnings+)
- With `--log-mode=console`: Controls the console logging level directly
- Default: warning
- `--experimental-fallback-handler`: Enable experimental fallback handler to attempt to fix too calls when the same tool fails 3 times consecutively. (OPENAI_API_KEY recommended as openai has the top 5 tool calling models.) See `ra_aid/tool_leaderboard.py` for more info.
- `--pretty-logger`: Enables panel markdown formatted logger messages for debugging purposes.
- `--pretty-logger`: Enables colored panel-style formatted logging output for better readability.
- `--temperature`: LLM temperature (0.0-2.0) to control randomness in responses
- `--disable-limit-tokens`: Disable token limiting for Anthropic Claude react agents
- `--recursion-limit`: Maximum recursion depth for agent operations (default: 100)
@ -185,9 +226,9 @@ More information is available in our [Usage Examples](https://docs.ra-aid.ai/cat
- `--max-test-cmd-retries`: Maximum number of test command retry attempts (default: 3)
- `--test-cmd-timeout`: Timeout in seconds for test command execution (default: 300)
- `--version`: Show program version number and exit
- `--webui`: Launch the web interface (alpha feature)
- `--webui-host`: Host to listen on for web interface (default: 0.0.0.0) (alpha feature)
- `--webui-port`: Port to listen on for web interface (default: 8080) (alpha feature)
- `--server`: Launch the server with web interface (alpha feature)
- `--server-host`: Host to listen on for server (default: 0.0.0.0) (alpha feature)
- `--server-port`: Port to listen on for server (default: 1818) (alpha feature)
### Example Tasks
@ -264,30 +305,30 @@ Make sure to set your TAVILY_API_KEY environment variable to enable this feature
Enable with `--chat` to transform ra-aid into an interactive assistant that guides you through research and implementation tasks. Have a natural conversation about what you want to build, explore options together, and dispatch work - all while maintaining context of your discussion. Perfect for when you want to think through problems collaboratively rather than just executing commands.
### Web Interface
### Server with Web Interface
RA.Aid includes a modern web interface that provides:
RA.Aid includes a modern server with web interface that provides:
- Beautiful dark-themed chat interface
- Real-time streaming of command output
- Request history with quick resubmission
- Responsive design that works on all devices
To launch the web interface:
To launch the server with web interface:
```bash
# Start with default settings (0.0.0.0:8080)
ra-aid --webui
# Start with default settings (0.0.0.0:1818)
ra-aid --server
# Specify custom host and port
ra-aid --webui --webui-host 127.0.0.1 --webui-port 3000
ra-aid --server --server-host 127.0.0.1 --server-port 3000
```
Command line options for web interface:
- `--webui`: Launch the web interface
- `--webui-host`: Host to listen on (default: 0.0.0.0)
- `--webui-port`: Port to listen on (default: 8080)
Command line options for server with web interface:
- `--server`: Launch the server with web interface
- `--server-host`: Host to listen on (default: 0.0.0.0)
- `--server-port`: Port to listen on (default: 1818)
After starting the server, open your web browser to the displayed URL (e.g., http://localhost:8080). The interface provides:
After starting the server, open your web browser to the displayed URL (e.g., http://localhost:1818). The interface provides:
- Left sidebar showing request history
- Main chat area with real-time output
- Input box for typing requests
@ -324,9 +365,9 @@ ra-aid -m "Update all deprecated API calls" --cowboy-mode
### Model Configuration
RA.Aid supports multiple AI providers and models. The default model is Anthropic's Claude 3 Sonnet (`claude-3-5-sonnet-20241022`).
RA.Aid supports multiple AI providers and models. The default model is Anthropic's Claude 3 Sonnet (`claude-3-7-sonnet-20250219`).
The programmer tool (aider) automatically selects its model based on your available API keys. It will use Claude models if ANTHROPIC_API_KEY is set, or fall back to OpenAI models if only OPENAI_API_KEY is available.
When using the `--use-aider` flag, the programmer tool (aider) automatically selects its model based on your available API keys. It will use Claude models if ANTHROPIC_API_KEY is set, or fall back to OpenAI models if only OPENAI_API_KEY is available.
Note: The expert tool can be configured to use different providers (OpenAI, Anthropic, OpenRouter, Gemini) using the --expert-provider flag along with the corresponding EXPERT_*API_KEY environment variables. Each provider requires its own API key set through the appropriate environment variable.
@ -372,7 +413,7 @@ export GEMINI_API_KEY=your_api_key_here
1. **Using Anthropic (Default)**
```bash
# Uses default model (claude-3-5-sonnet-20241022)
# Uses default model (claude-3-7-sonnet-20250219)
ra-aid -m "Your task"
# Or explicitly specify:
@ -438,7 +479,7 @@ Note: For `AIDER_FLAGS`, you can specify flags with or without the leading `--`.
**Important Notes:**
- Performance varies between models. The default Claude 3 Sonnet model currently provides the best and most reliable results.
- Model configuration is done via command line arguments: `--provider` and `--model`
- The `--model` argument is required for all providers except Anthropic (which defaults to `claude-3-5-sonnet-20241022`)
- The `--model` argument is required for all providers except Anthropic (which defaults to `claude-3-7-sonnet-20250219`)
More information is available in our [Open Models Setup](https://docs.ra-aid.ai/quickstart/open-models) guide.
@ -500,7 +541,7 @@ source venv/bin/activate # On Windows use `venv\Scripts\activate`
3. Install development dependencies:
```bash
pip install -r requirements-dev.txt
pip install -e ".[dev]"
```
4. Run tests:

16
components.json Normal file
View File

@ -0,0 +1,16 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": false,
"tsx": true,
"tailwind": {
"config": "frontend/common/tailwind.config.js",
"css": "frontend/common/src/styles/global.css",
"baseColor": "zinc",
"cssVariables": true
},
"aliases": {
"components": "@ra-aid/common/components",
"utils": "@ra-aid/common/utils"
}
}

View File

@ -0,0 +1,8 @@
{
"label": "Configuration",
"position": 3,
"link": {
"type": "generated-index",
"description": "Configure RA.Aid for optimal performance and behavior."
}
}

View File

@ -0,0 +1,167 @@
# Logging System
RA.Aid includes a powerful and flexible logging system that helps you troubleshoot issues and monitor the tool's operation. This document explains how to configure and use the logging features effectively.
## Overview
The logging system in RA.Aid provides:
- Configurable logging modes for different use cases
- Multiple log levels for controlling verbosity
- File logging with rotation and backup capabilities
- Pretty console logging with formatted display
- Comprehensive log messages capturing agent activity
## Command Line Options
RA.Aid provides the following command line options to control logging behavior:
### Log Mode
The `--log-mode` option determines where logs are directed:
```bash
ra-aid -m "Add new feature" --log-mode file
```
Available modes:
- `file` (default): Logs are written to both file and console
- Console shows only warnings and errors
- File contains all logs at the specified log level
- `console`: Logs are only shown in the console at the specified log level
- No log files are created
### Log Level
The `--log-level` option controls the verbosity of logging:
```bash
ra-aid -m "Add new feature" --log-level debug
```
Available levels (case-insensitive):
- `debug`: Most verbose, includes detailed debugging information
- `info`: General information about operations
- `warning` (default): Potential issues that might need attention
- `error`: Error conditions that prevent normal operation
- `critical`: Critical errors that may cause the application to terminate
The log level affects different outputs depending on the log mode:
- With `--log-mode=file`: Controls the file logging level, while console still shows only warnings and errors
- With `--log-mode=console`: Controls the console logging level directly
### Pretty Logger
The `--pretty-logger` option enables formatted panel-style logging output:
```bash
ra-aid -m "Add new feature" --pretty-logger
```
When enabled, log messages appear in colored panels with titles indicating the log level:
- 🔥 CRITICAL: Bold red panels for critical errors
- ❌ ERROR: Red panels for errors
- ⚠️ WARNING: Yellow panels for warnings
- INFO: Green panels for informational messages
- 🐞 DEBUG: Blue panels for debug messages
## Log Files
When `--log-mode=file` is used, RA.Aid creates and maintains log files with the following characteristics:
### Location
Log files are stored in the `.ra-aid/logs/` directory in your current working directory:
```
.ra-aid/logs/ra_aid_YYYYMMDD_HHMMSS.log
```
RA.Aid automatically creates this directory if it doesn't exist.
### Naming Convention
Log files follow a timestamp-based naming pattern:
```
ra_aid_YYYYMMDD_HHMMSS.log
```
Where:
- `YYYYMMDD`: Year, month, and day when the log file was created
- `HHMMSS`: Hour, minute, and second when the log file was created
Example: `ra_aid_20250301_143027.log`
### Log Rotation
RA.Aid uses automatic log rotation to manage log file size and prevent excessive disk usage:
- Maximum file size: 5 MB
- Maximum backup files: 100
When a log file reaches 5 MB, it is renamed with a numeric suffix (e.g., `.1`, `.2`), and a new log file is created. Up to 100 backup files are maintained.
## Examples
### Basic Usage (Default)
Use the default file logging mode with warnings and errors:
```bash
ra-aid -m "Add new feature"
```
### Detailed File Logging
Log everything including debug messages to file (console still shows only warnings+):
```bash
ra-aid -m "Add new feature" --log-level debug
```
### Console-Only Debugging
Get detailed debug logs in the console without creating log files:
```bash
ra-aid -m "Add new feature" --log-mode console --log-level debug
```
### Informational Console Logging
Get informational console output without debug details:
```bash
ra-aid -m "Add new feature" --log-mode console --log-level info
```
### Pretty Logging Output
Use formatted panel-style logging for better readability:
```bash
ra-aid -m "Add new feature" --pretty-logger
```
## Debugging Tips
- For troubleshooting issues, start with `--log-mode console --log-level debug`
- Examine log files in `.ra-aid/logs/` for historical issues
- Use `--pretty-logger` when working with complex tasks for better log clarity
- For production use, the default settings (`--log-mode file --log-level warning`) provide a good balance of information without excessive output
## Log Message Format
Standard log messages follow this format:
```
YYYY-MM-DD HH:MM:SS,MS - logger_name - LEVEL - Message text
```
Example:
```
2025-03-01 14:30:27,123 - ra_aid.agent_utils - WARNING - Command execution timeout after 60 seconds
```

View File

@ -0,0 +1,124 @@
# Memory Management
## Introduction
RA.Aid's memory system enables the agent to persist knowledge across sessions, creating a more efficient and coherent experience. The memory stores key facts, code snippets, and research notes about your project, allowing RA.Aid to build on previous work and avoid redundant operations.
This persistent memory gives RA.Aid the ability to:
- Remember important project facts and architectural decisions
- Store relevant code snippets with their file locations
- Preserve research findings and technical notes
- Build contextual understanding of your project over time
## Database Architecture
RA.Aid's memory is stored in a SQLite database file located in a hidden `.ra-aid` directory within your current working directory. The specific file path is:
```
.ra-aid/pk.db
```
This database implements several key tables:
- `KeyFact`: Stores important facts about your project
- `KeySnippet`: Preserves code snippets with their file paths and line numbers
- `ResearchNote`: Contains detailed research findings
- `HumanInput`: Tracks user inputs to provide context for memory items
All memory items have timestamps (created_at, updated_at) that help with relevance tracking and garbage collection.
The memory system uses thread-local state via Python's contextvars to ensure thread safety when multiple components access the database simultaneously.
## Memory Repositories and Garbage Collection
RA.Aid implements the repository pattern for database access, with specialized repositories for each memory type:
- `KeyFactRepository`
- `KeySnippetRepository`
- `ResearchNoteRepository`
Each repository provides methods to add, query, and delete items while abstracting the underlying database implementation.
To prevent uncontrolled growth of the memory database, RA.Aid implements automatic garbage collection that triggers when specific thresholds are exceeded:
- Facts: > 50 items
- Snippets: > 35 items
- Notes: > 30 items
When garbage collection activates, specialized agents analyze all stored items, considering factors like:
- Relevance to the current task
- Age of the memory items
- Relationship to other items
- Overall importance
Memory items associated with the current human input are protected from garbage collection to preserve context for the active task.
## CLI Commands and Configuration
RA.Aid provides a CLI flag to completely reset the memory database:
```bash
ra-aid --wipe-project-memory [other arguments]
```
This flag deletes the entire `.ra-aid/pk.db` database file, giving you a fresh start with no stored memory.
The memory statistics are displayed in the status panel when you start RA.Aid, showing:
- The number of facts, snippets, and notes currently stored
- A reminder about the `--wipe-project-memory` flag when memory items exist
### When to Wipe Memory
You might want to wipe project memory in these situations:
1. **Major Codebase Changes**: When your project has undergone significant refactoring or structural changes, making the stored memory items obsolete.
2. **Fresh Start**: When beginning a new phase of development and you want to clear out irrelevant historical context.
3. **Incorrect Information**: If the agent has stored incorrect or outdated information that's affecting its performance.
4. **Troubleshooting**: When unexpected behavior might be related to the stored memory items.
## Troubleshooting
Common memory-related issues and their solutions:
### Issue: Agent recalling outdated information
**Solution**: Use `--wipe-project-memory` to reset the memory database, especially after major code changes.
### Issue: Database lockup or corruption
**Solution**:
1. Ensure RA.Aid has properly shut down before starting a new session
2. If issues persist, use `--wipe-project-memory` to recreate the database
3. Check the logs in `.ra-aid/logs/` for specific errors
### Issue: Memory items seem irrelevant
**Solution**:
- Let the automatic garbage collection work by continuing to use RA.Aid
- For immediate reset, use `--wipe-project-memory`
### Issue: Missing .ra-aid directory
**Solution**: The directory is automatically created when you run RA.Aid. If it's missing, simply run RA.Aid again.
## Examples / Use Cases
### Example 1: Wiping memory after major refactoring
```bash
# After refactoring your project structure
ra-aid --wipe-project-memory -m "Update the authentication system"
```
### Example 2: Starting a new development phase
```bash
# Before starting work on a new major feature
ra-aid --wipe-project-memory -m "Implement payment processing system"
```
### Example 3: Checking memory status without wiping
```bash
# Check the memory statistics in the status panel
ra-aid -m "Show me the project structure"
# Look for the 💾 Memory: X facts, Y snippets, Z notes line
```
### Example 4: Using memory during ongoing development
When working on a complex feature over multiple sessions, memory allows RA.Aid to:
1. Remember architectural decisions from previous sessions
2. Recall the context of partially implemented features
3. Build on previous research without repeating the same queries
4. Maintain awareness of project constraints and requirements

View File

@ -0,0 +1,96 @@
# Reasoning Assistance
## Overview
Reasoning Assistance is a feature in RA.Aid that helps weaker models make better decisions about tool usage and task planning. It leverages a stronger model (typically your expert model) to provide strategic guidance to the main agent model at the beginning of each agent stage.
This feature is particularly useful when working with less capable models that may struggle with complex reasoning, tool selection, or planning. By providing expert guidance upfront, these models can perform more effectively and produce better results.
## How It Works
When reasoning assistance is enabled, RA.Aid performs the following steps at the beginning of each agent stage (research, planning, implementation):
1. Makes a one-off call to the expert model with a specialized prompt that includes:
- A description of the current task and stage
- The complete list of available tools
- Instructions to provide strategic guidance on approaching the task
2. Incorporates the expert model's response into the main agent's prompt.
3. The main agent then proceeds with execution, guided by the expert's recommendations on which tools to use and how to approach the task
## Configuration
### Command Line Flags
You can enable or disable reasoning assistance using these command-line flags:
```bash
# Enable reasoning assistance
ra-aid -m "Your task description" --reasoning-assistance
# Disable reasoning assistance (overrides model defaults)
ra-aid -m "Your task description" --no-reasoning-assistance
```
## Examples
### Using Reasoning Assistance with Weaker Models
```bash
# Use qwen-qwq-32b as the expert model to provide guidance
ra-aid --model qwen-32b-coder-instruct --expert-model qwen-qwq-32b --reasoning-assistance -m "Create a simple web server in Python"
```
### Disabling Reasoning Assistance for Strong Models
Reasoning assistance has different defaults depending on which model is used. If you would like to explicitly disable reasoning assistance, use the `--no-reasoning-assistance` flag.
```bash
# Use Claude 3 Opus without reasoning assistance
ra-aid -m "Create a simple web server in Python" --model claude-3-opus-20240229 --no-reasoning-assistance
```
## Benefits and Use Cases
Reasoning assistance provides several advantages:
1. **Better Tool Selection**: Helps models choose the right tools for specific tasks
2. **Improved Planning**: Provides strategic guidance on how to approach complex problems
3. **Reduced Errors**: Decreases the likelihood of tool misuse or inefficient approaches
4. **Model Flexibility**: Allows using weaker models more effectively by augmenting their reasoning capabilities
5. **Consistency**: Ensures more consistent behavior across different models
Common use cases include:
- Working with open-source models that have less robust tool use capabilities
- Tackling complex tasks that require careful planning and tool sequencing
- Ensuring consistent behavior when switching between different models
## Best Practices
For optimal results with reasoning assistance:
1. **Use Strong Expert Models**: The quality of reasoning assistance depends on the expert model's capabilities. Use the strongest model available for the expert role.
2. **Enable for Weaker Models**: Enable reasoning assistance by default for models known to struggle with tool selection or complex reasoning.
3. **Disable for Strong Models**: Models like Claude 3 Opus or GPT-4 typically don't need reasoning assistance and might perform better without it.
4. **Custom Tasks**: For highly specialized or unusual tasks, manually enabling reasoning assistance can be beneficial even for stronger models.
5. **Review Generated Guidance**: If debugging issues, examine the expert guidance provided to understand how it's influencing the agent's behavior.
## Troubleshooting
Common issues and solutions:
| Issue | Possible Solution |
|-------|-------------------|
| Reasoning assistance seems to make no difference | Verify both `--reasoning-assistance` flag is set and check the logs to confirm the expert model is being called |
| Expert model provides irrelevant or incorrect agent guidance | Try using a stronger expert model with `--expert-model` flag |
| Agent ignores expert guidance | Some models may not correctly follow the guidance format; try a different agent model |
| Slow performance | Reasoning assistance requires an additional model call at the start of each stage; disable it for simpler tasks if speed is critical |
| Conflicting approach with custom instructions | If you're providing specific instructions that conflict with reasoning assistance, use `--no-reasoning-assistance` |
If problems persist, check if the expert model and agent model are compatible, and consider adjusting the temperature setting to control randomness in both models.

View File

@ -0,0 +1,140 @@
# Thinking Models
RA.Aid supports models that can reveal their internal reasoning process, providing greater transparency into how they arrive at their responses. This feature, called "thinking models," helps users better understand the model's decision-making and logic.
## Overview
Thinking models allow you to see the model's internal reasoning process separately from its final response. This offers several benefits:
- **Transparency**: Understand how the model interprets your instructions and reasons through problems
- **Debugging**: Identify where a model's reasoning might go astray
- **Learning**: Gain insights into the model's approach to problem-solving
- **Trust**: Build greater confidence in the model's outputs by seeing its thought process
RA.Aid extracts and displays thinking content in special "💭 Thoughts" panels, keeping the main response clean while still providing access to the reasoning behind it.
## How Thinking Models Work in RA.Aid
RA.Aid supports two different methods for implementing thinking models:
### 1. Explicit Think Tags
Some models, like `qwen-qwq-32b`, use explicit XML-style thinking tags to delineate their reasoning process:
```
<think>
First, I need to understand what this code does.
The function seems to be parsing a configuration file...
</think>
The function parse_config() has an issue with its error handling...
```
RA.Aid extracts the content between these `<think>...</think>` tags and displays it separately from the main response.
### 2. Native Thinking Mode
More advanced models, like Claude 3.7 Sonnet, have native thinking capabilities built in at the API level. When RA.Aid uses these models, it sends special configuration parameters in the API request:
```python
{"thinking": {"type": "enabled", "budget_tokens": 12000}}
```
These models return structured responses with separate thinking and response content, which RA.Aid processes and displays accordingly.
## Configuration and Setup
### Enabling Thinking Models
To enable the display of thinking content, use the `--show-thoughts` CLI flag when running RA.Aid:
```bash
ra-aid -m "Add error handling to the database module" --show-thoughts
```
When this flag is enabled, RA.Aid will display thinking content in separate panels whenever it's available from the model.
### Supported Models
Currently, the following models support thinking mode in RA.Aid:
| Model | Provider | Type |
|-------|----------|------|
| qwen-qwq-32b | openai-compatible | Explicit think tags |
| claude-3-7-sonnet-20250219 | anthropic | Native thinking mode |
Each model's support is configured in the `models_params.py` file using the appropriate parameter.
## Examples and Usage
### Using a Model with Explicit Think Tags
When using the `qwen-qwq-32b` model with the `--show-thoughts` flag:
```bash
ra-aid -m "Refactor the error handling logic" --provider openai-compatible --model qwen-qwq-32b --show-thoughts
```
The model might include explicit think tags in its response:
```
<think>
Let me analyze the existing error handling logic:
1. Current approach uses try/except blocks scattered throughout
2. Error messages are inconsistent
3. There's no central logging mechanism
I should suggest a unified error handling approach with proper logging.
</think>
I recommend refactoring the error handling logic by implementing a centralized error handler...
```
RA.Aid will extract this thinking content and display it in a separate panel titled "💭 Thoughts", while showing only the actual response in the main output.
### Using a Model with Native Thinking
When using Claude 3.7 Sonnet with the `--show-thoughts` flag:
```bash
ra-aid -m "Debug the database connection issue" --provider anthropic --model claude-3-7-sonnet-20250219 --show-thoughts
```
RA.Aid configures the model to use its native thinking mode, and then processes the structured response to show thinking content separately.
### Without the --show-thoughts Flag
If you run RA.Aid without the `--show-thoughts` flag, the thinking content is still extracted from the model responses, but it won't be displayed in the console. This gives you a cleaner output focused only on the model's final responses.
## Troubleshooting and Best Practices
### Common Issues
#### Thinking content not appearing
If you're not seeing thinking content despite using the `--show-thoughts` flag:
- Ensure you're using a model that supports thinking (qwen-qwq-32b or claude-3-7-sonnet-20250219)
- Verify that the model is properly configured in your environment
- Check that the model is actually including thinking content in its responses (not all prompts will generate thinking)
#### Excessive or irrelevant thinking
If the thinking content is too verbose or irrelevant:
- Try to formulate more specific and concise prompts
- Consider using a different model if the thinking style doesn't meet your needs
### Best Practices
For the most effective use of thinking models:
1. **Use selectively**: Enable `--show-thoughts` when you need to understand the model's reasoning process, but consider disabling it for routine tasks to keep output concise.
2. **Choose the right model**: Different models have different thinking styles. Claude models tend to provide more structured and methodical reasoning, while other models might have different approaches.
3. **Ask questions that benefit from reasoning**: Complex problem-solving, debugging, and analysis tasks benefit most from seeing the model's thought process.
4. **Compare thinking with output**: Use the thinking content to evaluate the quality of the model's reasoning and identify potential flaws in its approach.
5. **Provide clear instructions**: When the model's thinking seems off-track, provide clearer instructions in your next prompt to guide its reasoning process.

View File

@ -1,5 +1,23 @@
# Getting Help
## Troubleshooting Common Issues
Before seeking external help, check the following:
### Check the Logs
RA.Aid maintains detailed logs that can help diagnose many common issues. By default, logs are stored in the `.ra-aid/logs/` directory in your working directory.
1. Check the most recent log file in `.ra-aid/logs/` directory
2. Look for ERROR or WARNING level messages that might indicate what went wrong
3. For more detailed logging options, see the [Logging documentation](/configuration/logging)
### Common Problems
- **Error connecting to API**: Verify your API key is set correctly
- **Command not found**: Ensure RA.Aid is installed properly and in your PATH
- **Script execution failures**: Check that required dependencies are installed
## Bug Reports and Feature Requests
If you encounter any issues or have ideas for improvements, please file them on our [GitHub Issues page](https://github.com/ai-christianson/RA.Aid/issues).

View File

@ -5,7 +5,7 @@ slug: /
# Welcome to RA.Aid
RA.Aid (pronounced "raid") is your AI-powered development companion that helps you build software autonomously. Whether you're working on new features, refactoring code, or researching solutions, RA.Aid makes development faster and more efficient.
RA.Aid (pronounced "raid") is your AI-powered development companion that helps you build software autonomously. As a standalone coding agent built on LangChain's agent-based task execution framework, RA.Aid can handle research, planning, and implementation of your development tasks. Whether you're working on new features, refactoring code, or researching solutions, RA.Aid makes development faster and more efficient.
## Why RA.Aid?
@ -45,6 +45,8 @@ ra-aid -m "Add input validation to the login form"
- **Interactive Mode**: Get help when you need it through natural conversation
- **Multiple AI Providers**: Support for various AI models to suit your needs
- **Git Integration**: Works seamlessly with your version control
- **Standalone Code Agent**: Built-in code modification capabilities by default
- **Optional Aider Integration**: Use the `--use-aider` flag to leverage aider's specialized code editing abilities
## Next Steps

View File

@ -111,6 +111,36 @@ ra-aid -m "Your task" --provider openai-compatible --model your-model-name
- Supports temperature control
- Compatible with most OpenAI-style APIs
</TabItem>
<TabItem value="gemini" label="Google Gemini">
### Google Gemini Models
Google's Gemini models offer powerful multimodal capabilities with extensive code generation support.
```bash
# Environment setup
export GEMINI_API_KEY=your_api_key_here
# Basic usage
ra-aid -m "Your task" --provider gemini --model gemini-1.5-pro-latest
# With temperature control
ra-aid -m "Your task" --provider gemini --model gemini-1.5-flash-latest --temperature 0.5
```
**Available Models:**
- `gemini-pro`: Original Gemini Pro model
- `gemini-1.5-flash-latest`: Latest Gemini 1.5 Flash model (fast responses)
- `gemini-1.5-pro-latest`: Latest Gemini 1.5 Pro model (strong reasoning)
- `gemini-1.5-flash`: Gemini 1.5 Flash release
- `gemini-1.5-pro`: Gemini 1.5 Pro release
- `gemini-1.0-pro`: Original Gemini 1.0 Pro model
**Configuration Notes:**
- All Gemini models support a 128,000 token context window
- Temperature control is supported for creative vs. deterministic responses
- Obtain your API key from [AI Studio](https://aistudio.google.com/app/apikey)
</TabItem>
</Tabs>
## Advanced Configuration
@ -130,6 +160,10 @@ ra-aid -m "Your task" --expert-provider deepseek --expert-model deepseek-reasone
# OpenRouter expert
export EXPERT_OPENROUTER_API_KEY=your_key
ra-aid -m "Your task" --expert-provider openrouter --expert-model mistralai/mistral-large-2411
# Gemini expert
export EXPERT_GEMINI_API_KEY=your_key
ra-aid -m "Your task" --expert-provider gemini --expert-model gemini-2.0-flash-thinking-exp-1219
```
</TabItem>
@ -172,6 +206,7 @@ Complete list of supported environment variables:
| `GEMINI_API_KEY` | Gemini | API access |
| `EXPERT_OPENROUTER_API_KEY` | OpenRouter | Expert tool |
| `EXPERT_DEEPSEEK_API_KEY` | DeepSeek | Expert tool |
| `EXPERT_GEMINI_API_KEY` | Gemini | Expert tool |
## Troubleshooting

View File

@ -54,3 +54,23 @@ Or run with a single command:
```bash
ra-aid -m "Help me understand this code"
```
If you prefer to use aider's specialized code editing capabilities instead of RA.Aid's built-in file modification tools:
```bash
ra-aid -m "Implement this feature" --use-aider
```
You can control logging verbosity and location using the `--log-mode` and `--log-level` options:
```bash
# Log to file (with only warnings to console)
ra-aid -m "Your task" --log-mode file --log-level debug
# Log everything to console
ra-aid -m "Your task" --log-mode console --log-level info
```
For more detailed logging configuration, see the [Logging documentation](../configuration/logging.md).
For information on RA.Aid's memory management and how to reset memory when needed, see the [Memory Management documentation](../configuration/memory-management.md).

View File

@ -1,8 +1,8 @@
{
"label": "Usage",
"position": 3,
"position": 4,
"link": {
"type": "generated-index",
"description": "Learn how to use RA.Aid effectively in different scenarios."
}
}
}

View File

@ -5,7 +5,7 @@ import type * as Preset from '@docusaurus/preset-classic';
const config: Config = {
title: 'RA-Aid Documentation',
favicon: 'img/favicon.ico',
url: 'https://ra-aid.0.dev',
url: 'https://docs.ra-aid.ai',
baseUrl: '/',
onDuplicateRoutes: 'ignore',
@ -17,9 +17,7 @@ const config: Config = {
locales: ['en'],
},
plugins: [
'@docusaurus/plugin-vercel-analytics'
],
plugins: [],
presets: [
[

61
docs/package-lock.json generated
View File

@ -9,7 +9,6 @@
"version": "0.0.0",
"dependencies": {
"@docusaurus/core": "3.7.0",
"@docusaurus/plugin-vercel-analytics": "^3.7.0",
"@docusaurus/preset-classic": "3.7.0",
"@mdx-js/react": "^3.0.0",
"clsx": "^2.0.0",
@ -3530,66 +3529,6 @@
"react-dom": "^18.0.0 || ^19.0.0"
}
},
"node_modules/@docusaurus/plugin-vercel-analytics": {
"version": "3.7.0",
"resolved": "https://registry.npmjs.org/@docusaurus/plugin-vercel-analytics/-/plugin-vercel-analytics-3.7.0.tgz",
"integrity": "sha512-zEOsqNI3oj4WRO9Dbzsar9fctwAl60PZJqhu14X5W3z5zT/E1TFKrHW/oJHU/a1r5o9K2cFsSNdDn2tyuaFJoQ==",
"license": "MIT",
"dependencies": {
"@docusaurus/core": "3.7.0",
"@docusaurus/logger": "3.7.0",
"@docusaurus/types": "3.7.0",
"@docusaurus/utils": "3.7.0",
"@docusaurus/utils-validation": "3.7.0",
"@vercel/analytics": "^1.1.1",
"tslib": "^2.6.0"
},
"engines": {
"node": ">=18.0"
},
"peerDependencies": {
"react": "^18.0.0 || ^19.0.0",
"react-dom": "^18.0.0 || ^19.0.0"
}
},
"node_modules/@docusaurus/plugin-vercel-analytics/node_modules/@vercel/analytics": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/@vercel/analytics/-/analytics-1.5.0.tgz",
"integrity": "sha512-MYsBzfPki4gthY5HnYN7jgInhAZ7Ac1cYDoRWFomwGHWEX7odTEzbtg9kf/QSo7XEsEAqlQugA6gJ2WS2DEa3g==",
"license": "MPL-2.0",
"peerDependencies": {
"@remix-run/react": "^2",
"@sveltejs/kit": "^1 || ^2",
"next": ">= 13",
"react": "^18 || ^19 || ^19.0.0-rc",
"svelte": ">= 4",
"vue": "^3",
"vue-router": "^4"
},
"peerDependenciesMeta": {
"@remix-run/react": {
"optional": true
},
"@sveltejs/kit": {
"optional": true
},
"next": {
"optional": true
},
"react": {
"optional": true
},
"svelte": {
"optional": true
},
"vue": {
"optional": true
},
"vue-router": {
"optional": true
}
}
},
"node_modules/@docusaurus/preset-classic": {
"version": "3.7.0",
"resolved": "https://registry.npmjs.org/@docusaurus/preset-classic/-/preset-classic-3.7.0.tgz",

View File

@ -4,19 +4,20 @@
"private": true,
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
"build": "docusaurus build",
"start": "node scripts/version.js && docusaurus start",
"generate-version": "node scripts/version.js",
"build": "npm run generate-version && docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"clear": "docusaurus clear",
"serve": "docusaurus serve",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids",
"typecheck": "tsc"
"typecheck": "tsc",
"version-json": "node scripts/version.js"
},
"dependencies": {
"@docusaurus/core": "3.7.0",
"@docusaurus/plugin-vercel-analytics": "^3.7.0",
"@docusaurus/preset-classic": "3.7.0",
"@mdx-js/react": "^3.0.0",
"clsx": "^2.0.0",
@ -45,4 +46,4 @@
"engines": {
"node": ">=18.0"
}
}
}

31
docs/scripts/README.md Normal file
View File

@ -0,0 +1,31 @@
# Docusaurus Scripts
This directory contains utility scripts for the Docusaurus documentation site.
## version.js
This script reads the version from `../../ra_aid/__version__.py` and creates a `version.json` file in the Docusaurus `static/` directory, which will be included in the built site.
### Usage
The script is automatically run as part of the build and start processes via npm scripts defined in `package.json`, but can also be run manually:
```bash
# From docs directory
npm run version-json
# Or directly
node scripts/version.js
```
### Output
The script creates a `static/version.json` file with the following format:
```json
{
"version": "x.y.z"
}
```
This file will be available at `/version.json` in the built site, allowing client-side version checks.

62
docs/scripts/version.js Executable file
View File

@ -0,0 +1,62 @@
#!/usr/bin/env node
/**
* Script to read version from ra_aid/__version__.py and create version.json
* in the Docusaurus static directory.
*/
const fs = require('fs');
const path = require('path');
// Paths
const versionFilePath = path.resolve(__dirname, '../../ra_aid/__version__.py');
const outputPath = path.resolve(__dirname, '../static/version.json');
/**
* Extract version string from the __version__.py file
* @param {string} content - The file content
* @returns {string|null} - Extracted version or null if not found
*/
function extractVersion(content) {
const regex = /__version__\s*=\s*["']([^"']+)["']/;
const match = content.match(regex);
return match ? match[1] : null;
}
// Main function to create version.json
function createVersionJson() {
try {
// Read version file
console.log(`Reading version from ${versionFilePath}...`);
const versionFileContent = fs.readFileSync(versionFilePath, 'utf8');
// Extract version
const version = extractVersion(versionFileContent);
if (!version) {
console.error('Failed to extract version from file');
process.exit(1);
}
console.log(`Extracted version: ${version}`);
// Create version JSON
const versionJson = JSON.stringify({ version }, null, 2);
// Ensure static directory exists
const staticDir = path.dirname(outputPath);
if (!fs.existsSync(staticDir)) {
console.log(`Creating directory: ${staticDir}`);
fs.mkdirSync(staticDir, { recursive: true });
}
// Write JSON file
fs.writeFileSync(outputPath, versionJson);
console.log(`Version JSON written to ${outputPath}`);
} catch (error) {
console.error(`Error creating version.json: ${error.message}`);
process.exit(1);
}
}
// Execute the main function
createVersionJson();

1
docs/static/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
version.json

View File

@ -0,0 +1,11 @@
import * as React from "react";
import { type VariantProps } from "class-variance-authority";
declare const buttonVariants: (props?: ({
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
asChild?: boolean;
}
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
export { Button, buttonVariants };

View File

@ -0,0 +1,44 @@
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
import * as React from "react";
import { Slot } from "@radix-ui/react-slot";
import { cva } from "class-variance-authority";
import { cn } from "../../utils";
const buttonVariants = cva("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50", {
variants: {
variant: {
default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
ghost: "hover:bg-accent hover:text-accent-foreground",
link: "text-primary underline-offset-4 hover:underline",
},
size: {
default: "h-9 px-4 py-2",
sm: "h-8 rounded-md px-3 text-xs",
lg: "h-10 rounded-md px-8",
icon: "h-9 w-9",
},
},
defaultVariants: {
variant: "default",
size: "default",
},
});
const Button = React.forwardRef((_a, ref) => {
var { className, variant, size, asChild = false } = _a, props = __rest(_a, ["className", "variant", "size", "asChild"]);
const Comp = asChild ? Slot : "button";
return (React.createElement(Comp, Object.assign({ className: cn(buttonVariants({ variant, size, className })), ref: ref }, props)));
});
Button.displayName = "Button";
export { Button, buttonVariants };

View File

@ -0,0 +1,8 @@
import * as React from "react";
declare const Card: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLParagraphElement>>;
declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };

View File

@ -0,0 +1,44 @@
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
import * as React from "react";
import { cn } from "../../utils";
const Card = React.forwardRef((_a, ref) => {
var { className } = _a, props = __rest(_a, ["className"]);
return (React.createElement("div", Object.assign({ ref: ref, className: cn("rounded-xl border bg-card text-card-foreground shadow", className) }, props)));
});
Card.displayName = "Card";
const CardHeader = React.forwardRef((_a, ref) => {
var { className } = _a, props = __rest(_a, ["className"]);
return (React.createElement("div", Object.assign({ ref: ref, className: cn("flex flex-col space-y-1.5 p-6", className) }, props)));
});
CardHeader.displayName = "CardHeader";
const CardTitle = React.forwardRef((_a, ref) => {
var { className } = _a, props = __rest(_a, ["className"]);
return (React.createElement("h3", Object.assign({ ref: ref, className: cn("font-semibold leading-none tracking-tight", className) }, props)));
});
CardTitle.displayName = "CardTitle";
const CardDescription = React.forwardRef((_a, ref) => {
var { className } = _a, props = __rest(_a, ["className"]);
return (React.createElement("p", Object.assign({ ref: ref, className: cn("text-sm text-muted-foreground", className) }, props)));
});
CardDescription.displayName = "CardDescription";
const CardContent = React.forwardRef((_a, ref) => {
var { className } = _a, props = __rest(_a, ["className"]);
return (React.createElement("div", Object.assign({ ref: ref, className: cn("p-6 pt-0", className) }, props)));
});
CardContent.displayName = "CardContent";
const CardFooter = React.forwardRef((_a, ref) => {
var { className } = _a, props = __rest(_a, ["className"]);
return (React.createElement("div", Object.assign({ ref: ref, className: cn("flex items-center p-6 pt-0", className) }, props)));
});
CardFooter.displayName = "CardFooter";
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };

View File

@ -0,0 +1,9 @@
export * from './button';
export * from './card';
export * from './collapsible';
export * from './floating-action-button';
export * from './input';
export * from './layout';
export * from './sheet';
export * from './switch';
export * from './scroll-area';

View File

@ -0,0 +1,9 @@
export * from './button';
export * from './card';
export * from './collapsible';
export * from './floating-action-button';
export * from './input';
export * from './layout';
export * from './sheet';
export * from './switch';
export * from './scroll-area';

View File

@ -0,0 +1,5 @@
import * as React from "react";
export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
}
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
export { Input };

View File

@ -0,0 +1,19 @@
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
import * as React from "react";
import { cn } from "../../utils";
const Input = React.forwardRef((_a, ref) => {
var { className, type } = _a, props = __rest(_a, ["className", "type"]);
return (React.createElement("input", Object.assign({ type: type, className: cn("flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50", className), ref: ref }, props)));
});
Input.displayName = "Input";
export { Input };

View File

@ -0,0 +1,4 @@
import * as React from "react";
import * as SwitchPrimitives from "@radix-ui/react-switch";
declare const Switch: React.ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
export { Switch };

View File

@ -0,0 +1,21 @@
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
import * as React from "react";
import * as SwitchPrimitives from "@radix-ui/react-switch";
import { cn } from "../../utils";
const Switch = React.forwardRef((_a, ref) => {
var { className } = _a, props = __rest(_a, ["className"]);
return (React.createElement(SwitchPrimitives.Root, Object.assign({ className: cn("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input", className) }, props, { ref: ref }),
React.createElement(SwitchPrimitives.Thumb, { className: cn("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0") })));
});
Switch.displayName = SwitchPrimitives.Root.displayName;
export { Switch };

11
frontend/common/dist/index.d.ts vendored Normal file
View File

@ -0,0 +1,11 @@
import './styles/global.css';
export * from './utils/types';
export * from './utils';
export * from './components/ui';
export * from './components/TimelineStep';
export * from './components/TimelineFeed';
export * from './components/SessionDrawer';
export * from './components/SessionSidebar';
export * from './components/DefaultAgentScreen';
export declare const hello: () => void;
export { getSampleAgentSteps, getSampleAgentSessions } from './utils/sample-data';

22
frontend/common/dist/index.js vendored Normal file
View File

@ -0,0 +1,22 @@
// Entry point for @ra-aid/common package
import './styles/global.css';
// Export types first to avoid circular references
export * from './utils/types';
// Export utility functions
export * from './utils';
// Export UI components
export * from './components/ui';
// Export timeline components
export * from './components/TimelineStep';
export * from './components/TimelineFeed';
// Export session navigation components
export * from './components/SessionDrawer';
export * from './components/SessionSidebar';
// Export main screens
export * from './components/DefaultAgentScreen';
// Export the hello function (temporary example)
export const hello = () => {
console.log("Hello from @ra-aid/common");
};
// Directly export sample data functions
export { getSampleAgentSteps, getSampleAgentSessions } from './utils/sample-data';

1572
frontend/common/dist/styles/global.css vendored Normal file

File diff suppressed because it is too large Load Diff

7
frontend/common/dist/utils.d.ts vendored Normal file
View File

@ -0,0 +1,7 @@
import { type ClassValue } from "clsx";
/**
* Merges class names with Tailwind CSS classes
* Combines clsx for conditional logic and tailwind-merge for handling conflicting tailwind classes
*/
export declare function cn(...inputs: ClassValue[]): string;
export * from './utils';

11
frontend/common/dist/utils.js vendored Normal file
View File

@ -0,0 +1,11 @@
import { clsx } from "clsx";
import { twMerge } from "tailwind-merge";
/**
* Merges class names with Tailwind CSS classes
* Combines clsx for conditional logic and tailwind-merge for handling conflicting tailwind classes
*/
export function cn(...inputs) {
return twMerge(clsx(inputs));
}
// Re-export everything from utils directory
export * from './utils';

3155
frontend/common/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,43 @@
{
"name": "@ra-aid/common",
"version": "1.0.0",
"private": true,
"main": "src/index.ts",
"types": "src/index.ts",
"scripts": {
"build": "tsc && postcss src/styles/global.css -o dist/styles/global.css",
"dev": "tsc --watch",
"watch:css": "postcss src/styles/global.css -o dist/styles/global.css --watch",
"watch": "concurrently \"npm run dev\" \"npm run watch:css\"",
"prepare": "npm run build"
},
"dependencies": {
"@radix-ui/react-collapsible": "^1.1.3",
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-label": "^2.0.2",
"@radix-ui/react-popover": "^1.0.7",
"@radix-ui/react-scroll-area": "^1.2.3",
"@radix-ui/react-select": "^2.0.0",
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-switch": "^1.1.3",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.0",
"lucide-react": "^0.363.0",
"tailwind-merge": "^2.2.0",
"tailwindcss-animate": "^1.0.7"
},
"devDependencies": {
"@types/react": "^18.2.64",
"@types/react-dom": "^18.2.21",
"autoprefixer": "^10.4.17",
"concurrently": "^8.2.2",
"postcss": "^8.4.35",
"postcss-cli": "^10.1.0",
"tailwindcss": "^3.4.1",
"typescript": "^5.0.0"
},
"peerDependencies": {
"react": ">=18.0.0",
"react-dom": ">=18.0.0"
}
}

View File

@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

@ -0,0 +1,258 @@
import React, { useState, useEffect } from 'react';
import { createPortal } from 'react-dom';
import { PanelLeft } from 'lucide-react';
import {
Button,
Layout
} from './ui';
import { SessionDrawer } from './SessionDrawer';
import { SessionList } from './SessionList';
import { TimelineFeed } from './TimelineFeed';
import { getSampleAgentSessions, getSampleAgentSteps } from '../utils/sample-data';
import logoBlack from '../assets/logo-black-transparent.png';
import logoWhite from '../assets/logo-white-transparent.gif';
/**
* DefaultAgentScreen component
*
* Main application screen for displaying agent sessions and their steps.
* Handles state management, responsive design, and UI interactions.
*/
export const DefaultAgentScreen: React.FC = () => {
// State for drawer open/close
const [isDrawerOpen, setIsDrawerOpen] = useState(false);
// State for selected session
const [selectedSessionId, setSelectedSessionId] = useState<string | null>(null);
// State for theme (dark is default)
const [isDarkTheme, setIsDarkTheme] = useState(true);
// Get sample data
const sessions = getSampleAgentSessions();
const allSteps = getSampleAgentSteps();
// Set up theme on component mount
useEffect(() => {
const isDark = setupTheme();
setIsDarkTheme(isDark);
}, []);
// Set initial selected session if none selected
useEffect(() => {
if (!selectedSessionId && sessions.length > 0) {
setSelectedSessionId(sessions[0].id);
}
}, [sessions, selectedSessionId]);
// Close drawer when window resizes to desktop width
useEffect(() => {
const handleResize = () => {
// Check if we're at desktop size (corresponds to md: breakpoint in Tailwind)
if (window.innerWidth >= 768 && isDrawerOpen) {
setIsDrawerOpen(false);
}
};
// Add event listener
window.addEventListener('resize', handleResize);
// Clean up event listener on component unmount
return () => window.removeEventListener('resize', handleResize);
}, [isDrawerOpen]);
// Filter steps for selected session
const selectedSessionSteps = selectedSessionId
? allSteps.filter(step => sessions.find(s => s.id === selectedSessionId)?.steps.some(s => s.id === step.id))
: [];
// Handle session selection
const handleSessionSelect = (sessionId: string) => {
setSelectedSessionId(sessionId);
setIsDrawerOpen(false); // Close drawer on selection (mobile)
};
// Toggle theme function
const toggleTheme = () => {
const newIsDark = !isDarkTheme;
setIsDarkTheme(newIsDark);
// Update document element class
if (newIsDark) {
document.documentElement.classList.add('dark');
} else {
document.documentElement.classList.remove('dark');
}
// Save to localStorage
localStorage.setItem('theme', newIsDark ? 'dark' : 'light');
};
// Render header content
const headerContent = (
<div className="w-full flex items-center justify-between h-full px-4">
<div className="flex-initial">
{/* Use the appropriate logo based on theme */}
<img
src={isDarkTheme ? logoWhite : logoBlack}
alt="RA.Aid Logo"
className="h-8"
/>
</div>
<div className="flex-initial ml-auto">
{/* Theme toggle button */}
<Button
variant="ghost"
size="icon"
onClick={toggleTheme}
aria-label={isDarkTheme ? "Switch to light mode" : "Switch to dark mode"}
>
{isDarkTheme ? (
// Sun icon for light mode toggle
<svg
xmlns="http://www.w3.org/2000/svg"
width="20"
height="20"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<circle cx="12" cy="12" r="5" />
<line x1="12" y1="1" x2="12" y2="3" />
<line x1="12" y1="21" x2="12" y2="23" />
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64" />
<line x1="18.36" y1="18.36" x2="19.78" y2="19.78" />
<line x1="1" y1="12" x2="3" y2="12" />
<line x1="21" y1="12" x2="23" y2="12" />
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36" />
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22" />
</svg>
) : (
// Moon icon for dark mode toggle
<svg
xmlns="http://www.w3.org/2000/svg"
width="20"
height="20"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" />
</svg>
)}
</Button>
</div>
</div>
);
// Sidebar content with sessions list
const sidebarContent = (
<div className="h-full flex flex-col px-4 py-3">
<SessionList
sessions={sessions}
onSelectSession={handleSessionSelect}
currentSessionId={selectedSessionId || undefined}
className="flex-1 pr-1 -mr-1"
/>
</div>
);
// Render drawer
const drawerContent = (
<SessionDrawer
sessions={sessions}
currentSessionId={selectedSessionId || undefined}
onSelectSession={handleSessionSelect}
isOpen={isDrawerOpen}
onClose={() => setIsDrawerOpen(false)}
/>
);
// Render main content
const mainContent = (
selectedSessionId ? (
<>
<h2 className="text-xl font-semibold mb-4">
Session: {sessions.find(s => s.id === selectedSessionId)?.name || 'Unknown'}
</h2>
<TimelineFeed
steps={selectedSessionSteps}
/>
</>
) : (
<div className="flex items-center justify-center h-full">
<p className="text-muted-foreground">Select a session to view details</p>
</div>
)
);
// Floating action button component that uses Portal to render at document body level
const FloatingActionButton = ({ onClick }: { onClick: () => void }) => {
// Only render the portal on the client side, not during SSR
const [mounted, setMounted] = useState(false);
useEffect(() => {
setMounted(true);
return () => setMounted(false);
}, []);
const button = (
<Button
variant="default"
size="icon"
onClick={onClick}
aria-label="Toggle sessions panel"
className="h-14 w-14 rounded-full shadow-xl bg-zinc-800 hover:bg-zinc-700 text-zinc-100 flex items-center justify-center border-2 border-zinc-700 dark:border-zinc-600"
>
<PanelLeft className="h-6 w-6" />
</Button>
);
const container = (
<div className="fixed bottom-6 right-6 z-[9999] md:hidden" style={{ pointerEvents: 'auto' }}>
{button}
</div>
);
// Return null during SSR, or the portal on the client
return mounted ? createPortal(container, document.body) : null;
};
return (
<>
<Layout
header={headerContent}
sidebar={sidebarContent}
drawer={drawerContent}
>
{mainContent}
</Layout>
<FloatingActionButton onClick={() => setIsDrawerOpen(true)} />
</>
);
};
// Helper function for theme setup
const setupTheme = () => {
// Check if theme preference is stored in localStorage
const storedTheme = localStorage.getItem('theme');
// Default to dark mode unless explicitly set to light
const isDark = storedTheme ? storedTheme === 'dark' : true;
// Apply theme to document
if (isDark) {
document.documentElement.classList.add('dark');
} else {
document.documentElement.classList.remove('dark');
}
return isDark;
};

View File

@ -0,0 +1,47 @@
import React from 'react';
import {
Sheet,
SheetContent,
SheetHeader,
SheetTitle,
SheetClose
} from './ui/sheet';
import { AgentSession } from '../utils/types';
import { getSampleAgentSessions } from '../utils/sample-data';
import { SessionList } from './SessionList';
interface SessionDrawerProps {
onSelectSession?: (sessionId: string) => void;
currentSessionId?: string;
sessions?: AgentSession[];
isOpen?: boolean;
onClose?: () => void;
}
export const SessionDrawer: React.FC<SessionDrawerProps> = ({
onSelectSession,
currentSessionId,
sessions = getSampleAgentSessions(),
isOpen = false,
onClose
}) => {
return (
<Sheet open={isOpen} onOpenChange={onClose}>
<SheetContent
side="left"
className="w-full sm:max-w-md border-r border-border p-4"
>
<SheetHeader className="px-2">
<SheetTitle>Sessions</SheetTitle>
</SheetHeader>
<SessionList
sessions={sessions}
currentSessionId={currentSessionId}
onSelectSession={onSelectSession}
className="h-[calc(100vh-9rem)] mt-4"
wrapperComponent={SheetClose}
/>
</SheetContent>
</Sheet>
);
};

View File

@ -0,0 +1,93 @@
import React from 'react';
import { ScrollArea } from './ui/scroll-area';
import { AgentSession } from '../utils/types';
import { getSampleAgentSessions } from '../utils/sample-data';
interface SessionListProps {
onSelectSession?: (sessionId: string) => void;
currentSessionId?: string;
sessions?: AgentSession[];
className?: string;
wrapperComponent?: React.ElementType;
closeAction?: React.ReactNode;
}
export const SessionList: React.FC<SessionListProps> = ({
onSelectSession,
currentSessionId,
sessions = getSampleAgentSessions(),
className = '',
wrapperComponent: WrapperComponent = 'button',
closeAction
}) => {
// Get status color
const getStatusColor = (status: string) => {
switch (status) {
case 'active':
return 'bg-blue-500';
case 'completed':
return 'bg-green-500';
case 'error':
return 'bg-red-500';
default:
return 'bg-gray-500';
}
};
// Format timestamp
const formatDate = (date: Date) => {
return date.toLocaleDateString([], {
month: 'short',
day: 'numeric',
hour: '2-digit',
minute: '2-digit'
});
};
return (
<ScrollArea className={className}>
<div className="space-y-1.5 pt-1.5 pb-2">
{sessions.map((session) => {
const buttonContent = (
<>
<div className={`w-2.5 h-2.5 rounded-full ${getStatusColor(session.status)} mt-1.5 mr-3 flex-shrink-0`} />
<div className="flex-1 min-w-0 pr-1">
<div className="font-medium text-sm+ break-words">{session.name}</div>
<div className="text-xs text-muted-foreground mt-1 break-words">
{session.steps.length} steps {formatDate(session.updated)}
</div>
<div className="text-xs text-muted-foreground mt-0.5 break-words">
<span className="capitalize">{session.status}</span>
</div>
</div>
</>
);
return React.createElement(
WrapperComponent,
{
key: session.id,
onClick: () => onSelectSession?.(session.id),
className: `w-full flex items-start px-3 py-2.5 text-left rounded-md transition-colors hover:bg-accent/50 ${
currentSessionId === session.id ? 'bg-accent' : ''
}`
},
closeAction ? (
<>
{buttonContent}
<div className="ml-2 flex-shrink-0 self-center">
{React.cloneElement(closeAction as React.ReactElement, {
onClick: (e: React.MouseEvent) => {
e.stopPropagation();
onSelectSession?.(session.id);
}
})}
</div>
</>
) : buttonContent
);
})}
</div>
</ScrollArea>
);
};

View File

@ -0,0 +1,32 @@
import React from 'react';
import { AgentSession } from '../utils/types';
import { getSampleAgentSessions } from '../utils/sample-data';
import { SessionList } from './SessionList';
interface SessionSidebarProps {
onSelectSession?: (sessionId: string) => void;
currentSessionId?: string;
sessions?: AgentSession[];
className?: string;
}
export const SessionSidebar: React.FC<SessionSidebarProps> = ({
onSelectSession,
currentSessionId,
sessions = getSampleAgentSessions(),
className = ''
}) => {
return (
<div className={`flex flex-col h-full ${className}`}>
<div className="p-4 border-b border-border">
<h3 className="font-medium text-lg">Sessions</h3>
</div>
<SessionList
sessions={sessions}
currentSessionId={currentSessionId}
onSelectSession={onSelectSession}
className="flex-1"
/>
</div>
);
};

View File

@ -0,0 +1,45 @@
import React, { useMemo } from 'react';
import { TimelineStep } from './TimelineStep';
import { AgentStep } from '../utils/types';
interface TimelineFeedProps {
steps: AgentStep[];
maxHeight?: string;
}
export const TimelineFeed: React.FC<TimelineFeedProps> = ({
steps,
maxHeight
}) => {
// Always use 'desc' (newest first) sort order
const sortOrder = 'desc';
// Sort steps with newest first (desc order)
const sortedSteps = useMemo(() => {
return [...steps].sort((a, b) => {
return b.timestamp.getTime() - a.timestamp.getTime();
});
}, [steps]);
return (
<div className="w-full rounded-md bg-background">
<div
className="px-3 py-3 space-y-4 overflow-auto"
style={{ maxHeight: maxHeight || undefined }}
>
{sortedSteps.length > 0 ? (
sortedSteps.map((step) => (
<TimelineStep key={step.id} step={step} />
))
) : (
<div className="text-center text-muted-foreground py-12 border border-dashed border-border rounded-md">
<svg xmlns="http://www.w3.org/2000/svg" className="h-8 w-8 mx-auto mb-2 text-muted-foreground/50" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
<p>No steps to display</p>
</div>
)}
</div>
</div>
);
}

View File

@ -0,0 +1,99 @@
import React from 'react';
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from './ui/collapsible';
import { AgentStep } from '../utils/types';
interface TimelineStepProps {
step: AgentStep;
}
export const TimelineStep: React.FC<TimelineStepProps> = ({ step }) => {
// Get status color
const getStatusColor = (status: string) => {
switch (status) {
case 'completed':
return 'bg-green-500';
case 'in-progress':
return 'bg-blue-500';
case 'error':
return 'bg-red-500';
case 'pending':
return 'bg-yellow-500';
default:
return 'bg-gray-500';
}
};
// Get icon based on step type
const getTypeIcon = (type: string) => {
switch (type) {
case 'tool-execution':
return '🛠️';
case 'thinking':
return '💭';
case 'planning':
return '📝';
case 'implementation':
return '💻';
case 'user-input':
return '👤';
default:
return '▶️';
}
};
// Format timestamp
const formatTime = (timestamp: Date) => {
return timestamp.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
};
return (
<Collapsible className="w-full mb-5 border border-border rounded-md overflow-hidden shadow-sm hover:shadow-md transition-all duration-200">
<CollapsibleTrigger className="w-full flex items-center justify-between p-4 text-left hover:bg-accent/30 cursor-pointer group">
<div className="flex items-center space-x-3 min-w-0 flex-1 pr-3">
<div className={`flex-shrink-0 w-3 h-3 rounded-full ${getStatusColor(step.status)} ring-1 ring-ring/20`} />
<div className="flex-shrink-0 text-lg group-hover:scale-110 transition-transform">{getTypeIcon(step.type)}</div>
<div className="min-w-0 flex-1">
<div className="font-medium text-foreground break-words">{step.title}</div>
<div className="text-sm text-muted-foreground line-clamp-2">
{step.type === 'tool-execution' ? 'Run tool' : step.content.substring(0, 60)}
{step.content.length > 60 ? '...' : ''}
</div>
</div>
</div>
<div className="text-xs text-muted-foreground flex flex-col items-end flex-shrink-0 min-w-[70px] text-right">
<span className="font-medium">{formatTime(step.timestamp)}</span>
{step.duration && (
<span className="mt-1 px-2 py-0.5 bg-secondary/50 rounded-full">
{(step.duration / 1000).toFixed(1)}s
</span>
)}
</div>
</CollapsibleTrigger>
<CollapsibleContent>
<div className="p-5 bg-card/50 border-t border-border">
<div className="text-sm break-words text-foreground leading-relaxed">
{step.content}
</div>
{step.duration && (
<div className="mt-4 pt-3 border-t border-border/50">
<div className="text-xs text-muted-foreground flex items-center">
<svg
xmlns="http://www.w3.org/2000/svg"
className="h-3.5 w-3.5 mr-1"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
strokeWidth={2}
>
<circle cx="12" cy="12" r="10" />
<polyline points="12 6 12 12 16 14" />
</svg>
Duration: {(step.duration / 1000).toFixed(1)} seconds
</div>
</div>
)}
</div>
</CollapsibleContent>
</Collapsible>
);
};

View File

@ -0,0 +1,57 @@
import * as React from "react";
import { Slot } from "@radix-ui/react-slot";
import { cva, type VariantProps } from "class-variance-authority";
import { cn } from "../../utils";
const buttonVariants = cva(
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
{
variants: {
variant: {
default:
"bg-primary text-primary-foreground shadow hover:bg-primary/90",
destructive:
"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
outline:
"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
secondary:
"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
ghost: "hover:bg-accent hover:text-accent-foreground",
link: "text-primary underline-offset-4 hover:underline",
},
size: {
default: "h-9 px-4 py-2",
sm: "h-8 rounded-md px-3 text-xs",
lg: "h-10 rounded-md px-8",
icon: "h-9 w-9",
},
},
defaultVariants: {
variant: "default",
size: "default",
},
}
);
export interface ButtonProps
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
VariantProps<typeof buttonVariants> {
asChild?: boolean;
}
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
({ className, variant, size, asChild = false, ...props }, ref) => {
const Comp = asChild ? Slot : "button";
return (
<Comp
className={cn(buttonVariants({ variant, size, className }))}
ref={ref}
{...props}
/>
);
}
);
Button.displayName = "Button";
export { Button, buttonVariants };

View File

@ -0,0 +1,76 @@
import * as React from "react";
import { cn } from "../../utils";
const Card = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
<div
ref={ref}
className={cn(
"rounded-xl border bg-card text-card-foreground shadow",
className
)}
{...props}
/>
));
Card.displayName = "Card";
const CardHeader = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
<div
ref={ref}
className={cn("flex flex-col space-y-1.5 p-6", className)}
{...props}
/>
));
CardHeader.displayName = "CardHeader";
const CardTitle = React.forwardRef<
HTMLParagraphElement,
React.HTMLAttributes<HTMLHeadingElement>
>(({ className, ...props }, ref) => (
<h3
ref={ref}
className={cn("font-semibold leading-none tracking-tight", className)}
{...props}
/>
));
CardTitle.displayName = "CardTitle";
const CardDescription = React.forwardRef<
HTMLParagraphElement,
React.HTMLAttributes<HTMLParagraphElement>
>(({ className, ...props }, ref) => (
<p
ref={ref}
className={cn("text-sm text-muted-foreground", className)}
{...props}
/>
));
CardDescription.displayName = "CardDescription";
const CardContent = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
<div ref={ref} className={cn("p-6 pt-0", className)} {...props} />
));
CardContent.displayName = "CardContent";
const CardFooter = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
<div
ref={ref}
className={cn("flex items-center p-6 pt-0", className)}
{...props}
/>
));
CardFooter.displayName = "CardFooter";
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };

View File

@ -0,0 +1,27 @@
import * as React from "react"
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible"
import { cn } from "../../utils"
const Collapsible = CollapsiblePrimitive.Root
const CollapsibleTrigger = CollapsiblePrimitive.Trigger
const CollapsibleContent = React.forwardRef<
React.ElementRef<typeof CollapsiblePrimitive.Content>,
React.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Content>
>(({ className, children, ...props }, ref) => (
<CollapsiblePrimitive.Content
ref={ref}
className={cn(
"overflow-hidden data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
className
)}
{...props}
>
{children}
</CollapsiblePrimitive.Content>
))
CollapsibleContent.displayName = "CollapsibleContent"
export { Collapsible, CollapsibleTrigger, CollapsibleContent }

View File

@ -0,0 +1,36 @@
import React, { ReactNode } from 'react';
import { Button } from './button';
export interface FloatingActionButtonProps {
icon: ReactNode;
onClick: () => void;
ariaLabel?: string;
className?: string;
variant?: 'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link';
}
/**
* FloatingActionButton component
*
* A button typically used for primary actions on mobile layouts
* Designed to be used with the Layout component's floatingAction prop
*/
export const FloatingActionButton: React.FC<FloatingActionButtonProps> = ({
icon,
onClick,
ariaLabel = 'Action button',
className = '',
variant = 'default'
}) => {
return (
<Button
variant={variant}
size="icon"
onClick={onClick}
aria-label={ariaLabel}
className={`h-14 w-14 rounded-full shadow-xl bg-blue-600 hover:bg-blue-700 text-white flex items-center justify-center border-2 border-white dark:border-gray-800 ${className}`}
>
{icon}
</Button>
);
};

View File

@ -0,0 +1,9 @@
export * from './button';
export * from './card';
export * from './collapsible';
export * from './floating-action-button';
export * from './input';
export * from './layout';
export * from './sheet';
export * from './switch';
export * from './scroll-area';

View File

@ -0,0 +1,25 @@
import * as React from "react";
import { cn } from "../../utils";
export interface InputProps
extends React.InputHTMLAttributes<HTMLInputElement> {}
const Input = React.forwardRef<HTMLInputElement, InputProps>(
({ className, type, ...props }, ref) => {
return (
<input
type={type}
className={cn(
"flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
className
)}
ref={ref}
{...props}
/>
);
}
);
Input.displayName = "Input";
export { Input };

View File

@ -0,0 +1,56 @@
import React from 'react';
/**
* Layout component using Tailwind Grid utilities
* This component creates a responsive layout with:
* - Sticky header at the top (z-index 30)
* - Sidebar on desktop (hidden on mobile)
* - Main content area with proper positioning
* - Optional floating action button for mobile navigation
*/
export interface LayoutProps {
header: React.ReactNode;
sidebar?: React.ReactNode;
drawer?: React.ReactNode;
children: React.ReactNode;
floatingAction?: React.ReactNode;
}
export const Layout: React.FC<LayoutProps> = ({
header,
sidebar,
drawer,
children,
floatingAction
}) => {
return (
<div className="grid min-h-screen grid-cols-1 grid-rows-[64px_1fr] md:grid-cols-[280px_1fr] lg:grid-cols-[320px_1fr] xl:grid-cols-[350px_1fr] bg-background text-foreground relative">
{/* Header - always visible, spans full width */}
<header className="sticky top-0 z-30 h-16 flex items-center bg-background border-b border-border col-span-full">
{header}
</header>
{/* Sidebar - hidden on mobile, visible on tablet/desktop */}
{sidebar && (
<aside className="hidden md:block fixed top-16 bottom-0 w-[280px] lg:w-[320px] xl:w-[350px] overflow-y-auto z-20 bg-background border-r border-border">
{sidebar}
</aside>
)}
{/* Main content area */}
<main className="overflow-y-auto p-4 row-start-2 col-start-1 md:col-start-2 md:h-[calc(100vh-64px)]">
{children}
</main>
{/* Mobile drawer - rendered outside grid */}
{drawer}
{/* Floating action button for mobile */}
{floatingAction && (
<div className="fixed bottom-6 right-6 z-50 md:hidden">
{floatingAction}
</div>
)}
</div>
);
};

View File

@ -0,0 +1,47 @@
import * as React from "react"
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area"
import { cn } from "../../utils"
const ScrollArea = React.forwardRef<
React.ElementRef<typeof ScrollAreaPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>
>(({ className, children, ...props }, ref) => (
<ScrollAreaPrimitive.Root
ref={ref}
className={cn("relative overflow-hidden", className)}
{...props}
>
<ScrollAreaPrimitive.Viewport className="h-full w-full rounded-[inherit]">
{children}
</ScrollAreaPrimitive.Viewport>
<ScrollBar />
<ScrollBar orientation="horizontal" />
<ScrollAreaPrimitive.Corner />
</ScrollAreaPrimitive.Root>
))
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName
const ScrollBar = React.forwardRef<
React.ElementRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,
React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>
>(({ className, orientation = "vertical", ...props }, ref) => (
<ScrollAreaPrimitive.ScrollAreaScrollbar
ref={ref}
orientation={orientation}
className={cn(
"flex touch-none select-none transition-colors",
orientation === "vertical" &&
"h-full w-2.5 border-l border-l-transparent p-[1px]",
orientation === "horizontal" &&
"h-2.5 border-t border-t-transparent p-[1px]",
className
)}
{...props}
>
<ScrollAreaPrimitive.ScrollAreaThumb className="relative flex-1 rounded-full bg-border" />
</ScrollAreaPrimitive.ScrollAreaScrollbar>
))
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName
export { ScrollArea, ScrollBar }

View File

@ -0,0 +1,134 @@
import * as React from "react"
import * as SheetPrimitive from "@radix-ui/react-dialog"
import { cva, type VariantProps } from "class-variance-authority"
import { X } from "lucide-react"
import { cn } from "../../utils"
const Sheet = SheetPrimitive.Root
const SheetTrigger = SheetPrimitive.Trigger
const SheetClose = SheetPrimitive.Close
const SheetPortal = SheetPrimitive.Portal
const SheetOverlay = React.forwardRef<
React.ElementRef<typeof SheetPrimitive.Overlay>,
React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>
>(({ className, ...props }, ref) => (
<SheetPrimitive.Overlay
className={cn(
"fixed inset-0 z-70 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
className
)}
{...props}
ref={ref}
/>
))
SheetOverlay.displayName = SheetPrimitive.Overlay.displayName
const sheetVariants = cva(
"fixed z-70 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
{
variants: {
side: {
top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",
bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
left: "inset-y-0 left-0 h-full w-full border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
},
},
defaultVariants: {
side: "right",
},
}
)
interface SheetContentProps
extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,
VariantProps<typeof sheetVariants> {}
const SheetContent = React.forwardRef<
React.ElementRef<typeof SheetPrimitive.Content>,
SheetContentProps
>(({ side = "right", className, children, ...props }, ref) => (
<SheetPortal>
<SheetOverlay />
<SheetPrimitive.Content
ref={ref}
className={cn(sheetVariants({ side }), className)}
{...props}
>
{children}
<SheetPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary">
<X className="h-4 w-4" />
<span className="sr-only">Close</span>
</SheetPrimitive.Close>
</SheetPrimitive.Content>
</SheetPortal>
))
SheetContent.displayName = SheetPrimitive.Content.displayName
const SheetHeader = ({
className,
...props
}: React.HTMLAttributes<HTMLDivElement>) => (
<div
className={cn(
"flex flex-col space-y-2 text-center sm:text-left",
className
)}
{...props}
/>
)
SheetHeader.displayName = "SheetHeader"
const SheetFooter = ({
className,
...props
}: React.HTMLAttributes<HTMLDivElement>) => (
<div
className={cn(
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
className
)}
{...props}
/>
)
SheetFooter.displayName = "SheetFooter"
const SheetTitle = React.forwardRef<
React.ElementRef<typeof SheetPrimitive.Title>,
React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>
>(({ className, ...props }, ref) => (
<SheetPrimitive.Title
ref={ref}
className={cn("text-lg font-semibold text-foreground", className)}
{...props}
/>
))
SheetTitle.displayName = SheetPrimitive.Title.displayName
const SheetDescription = React.forwardRef<
React.ElementRef<typeof SheetPrimitive.Description>,
React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>
>(({ className, ...props }, ref) => (
<SheetPrimitive.Description
ref={ref}
className={cn("text-sm text-muted-foreground", className)}
{...props}
/>
))
SheetDescription.displayName = SheetPrimitive.Description.displayName
export {
Sheet,
SheetTrigger,
SheetClose,
SheetContent,
SheetHeader,
SheetFooter,
SheetTitle,
SheetDescription,
}

View File

@ -0,0 +1,27 @@
import * as React from "react";
import * as SwitchPrimitives from "@radix-ui/react-switch";
import { cn } from "../../utils";
const Switch = React.forwardRef<
React.ElementRef<typeof SwitchPrimitives.Root>,
React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>
>(({ className, ...props }, ref) => (
<SwitchPrimitives.Root
className={cn(
"peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
className
)}
{...props}
ref={ref}
>
<SwitchPrimitives.Thumb
className={cn(
"pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"
)}
/>
</SwitchPrimitives.Root>
));
Switch.displayName = SwitchPrimitives.Root.displayName;
export { Switch };

View File

@ -0,0 +1,33 @@
// Entry point for @ra-aid/common package
import './styles/global.css';
// Export types first to avoid circular references
export * from './utils/types';
// Export utility functions
export * from './utils';
// Export UI components
export * from './components/ui';
// Export timeline components
export * from './components/TimelineStep';
export * from './components/TimelineFeed';
// Export session navigation components
export * from './components/SessionDrawer';
export * from './components/SessionSidebar';
// Export main screens
export * from './components/DefaultAgentScreen';
// Export the hello function (temporary example)
export const hello = (): void => {
console.log("Hello from @ra-aid/common");
};
// Directly export sample data functions
export {
getSampleAgentSteps,
getSampleAgentSessions
} from './utils/sample-data';

View File

@ -0,0 +1,80 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer base {
:root {
--background: 0 0% 100%;
--foreground: 222.2 47.4% 11.2%;
--muted: 210 40% 96.1%;
--muted-foreground: 215.4 16.3% 46.9%;
--popover: 0 0% 100%;
--popover-foreground: 222.2 47.4% 11.2%;
--card: 0 0% 100%;
--card-foreground: 222.2 47.4% 11.2%;
--border: 214.3 31.8% 91.4%;
--input: 214.3 31.8% 91.4%;
--primary: 222.2 47.4% 11.2%;
--primary-foreground: 210 40% 98%;
--secondary: 210 40% 96.1%;
--secondary-foreground: 222.2 47.4% 11.2%;
--accent: 210 40% 96.1%;
--accent-foreground: 222.2 47.4% 11.2%;
--destructive: 0 100% 50%;
--destructive-foreground: 210 40% 98%;
--ring: 215 20.2% 65.1%;
--radius: 0.5rem;
}
.dark {
--background: 240 10% 3.9%; /* zinc-950 */
--foreground: 240 5% 96%; /* zinc-50 */
--card: 240 10% 3.9%; /* zinc-950 */
--card-foreground: 240 5% 96%; /* zinc-50 */
--popover: 240 10% 3.9%; /* zinc-950 */
--popover-foreground: 240 5% 96%; /* zinc-50 */
--primary: 240 5% 96%; /* zinc-50 */
--primary-foreground: 240 6% 10%; /* zinc-900 */
--secondary: 240 4% 16%; /* zinc-800 */
--secondary-foreground: 240 5% 96%; /* zinc-50 */
--muted: 240 4% 16%; /* zinc-800 */
--muted-foreground: 240 5% 65%; /* zinc-400 */
--accent: 240 4% 16%; /* zinc-800 */
--accent-foreground: 240 5% 96%; /* zinc-50 */
--destructive: 0 63% 31%; /* red-900 */
--destructive-foreground: 240 5% 96%; /* zinc-50 */
--border: 240 4% 16%; /* zinc-800 */
--input: 240 4% 16%; /* zinc-800 */
--ring: 240 5% 84%; /* zinc-300 */
--radius: 0.5rem;
}
}
@layer base {
* {
@apply border-border;
}
body {
@apply bg-background text-foreground;
font-feature-settings: "rlig" 1, "calt" 1;
}
}

24
frontend/common/src/types/image.d.ts vendored Normal file
View File

@ -0,0 +1,24 @@
declare module '*.png' {
const content: string;
export default content;
}
declare module '*.gif' {
const content: string;
export default content;
}
declare module '*.jpg' {
const content: string;
export default content;
}
declare module '*.jpeg' {
const content: string;
export default content;
}
declare module '*.svg' {
const content: string;
export default content;
}

View File

@ -0,0 +1,13 @@
import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";
/**
* Merges class names with Tailwind CSS classes
* Combines clsx for conditional logic and tailwind-merge for handling conflicting tailwind classes
*/
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
// Re-export everything from utils directory
export * from './utils';

View File

@ -0,0 +1,13 @@
import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";
/**
* Merges class names with Tailwind CSS classes
* Combines clsx for conditional logic and tailwind-merge for handling conflicting tailwind classes
*/
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
// Note: Sample data functions and types are now exported directly from the root index.ts
// to avoid circular references

View File

@ -0,0 +1,164 @@
/**
* Sample data utility for agent UI components demonstration
*/
import { AgentStep, AgentSession } from './types';
/**
* Returns an array of sample agent steps
*/
export function getSampleAgentSteps(): AgentStep[] {
return [
{
id: "step-1",
timestamp: new Date(Date.now() - 30 * 60000), // 30 minutes ago
status: 'completed',
type: 'planning',
title: 'Initial Planning',
content: 'I need to analyze the codebase structure to understand the existing components and their relationships.',
duration: 5200
},
{
id: "step-2",
timestamp: new Date(Date.now() - 25 * 60000), // 25 minutes ago
status: 'completed',
type: 'tool-execution',
title: 'List Directory Structure',
content: 'Executing: list_directory_tree(path="src/", max_depth=2)\n\n📁 /project/src/\n├── 📁 components/\n│ ├── 📁 ui/\n│ └── App.tsx\n├── 📁 utils/\n└── index.tsx',
duration: 1800
},
{
id: "step-3",
timestamp: new Date(Date.now() - 20 * 60000), // 20 minutes ago
status: 'completed',
type: 'thinking',
title: 'Component Analysis',
content: 'Based on the directory structure, I see that the UI components are organized in a dedicated folder. I should examine the existing component patterns before implementing new ones.',
duration: 3500
},
{
id: "step-4",
timestamp: new Date(Date.now() - 15 * 60000), // 15 minutes ago
status: 'completed',
type: 'tool-execution',
title: 'Read Component Code',
content: 'Executing: read_file_tool(filepath="src/components/ui/Button.tsx")\n\n```tsx\nimport { cn } from "../../utils";\n\nexport interface ButtonProps {\n // Component props...\n}\n\nexport function Button({ children, ...props }: ButtonProps) {\n // Component implementation...\n}\n```',
duration: 2100
},
{
id: "step-5",
timestamp: new Date(Date.now() - 10 * 60000), // 10 minutes ago
status: 'completed',
type: 'implementation',
title: 'Creating NavBar Component',
content: 'I\'m creating a NavBar component following the design system patterns:\n\n```tsx\nimport { cn } from "../../utils";\n\nexport interface NavBarProps {\n // New component props...\n}\n\nexport function NavBar({ ...props }: NavBarProps) {\n // New component implementation...\n}\n```',
duration: 6800
},
{
id: "step-6",
timestamp: new Date(Date.now() - 5 * 60000), // 5 minutes ago
status: 'in-progress',
type: 'implementation',
title: 'Styling Timeline Component',
content: 'Currently working on styling the Timeline component to match the design system:\n\n```tsx\n// Work in progress...\nexport function Timeline({ steps, ...props }: TimelineProps) {\n // Current implementation...\n}\n```',
},
{
id: "step-7",
timestamp: new Date(Date.now() - 2 * 60000), // 2 minutes ago
status: 'error',
type: 'tool-execution',
title: 'Running Tests',
content: 'Error executing: run_shell_command(command="npm test")\n\nTest failed: TypeError: Cannot read property \'steps\' of undefined',
duration: 3200
},
{
id: "step-8",
timestamp: new Date(), // Now
status: 'pending',
type: 'planning',
title: 'Next Steps',
content: 'Need to plan the implementation of the SessionDrawer component...',
}
];
}
/**
* Returns an array of sample agent sessions
*/
export function getSampleAgentSessions(): AgentSession[] {
const steps = getSampleAgentSteps();
return [
{
id: "session-1",
name: "UI Component Implementation",
created: new Date(Date.now() - 35 * 60000), // 35 minutes ago
updated: new Date(), // Now
status: 'active',
steps: steps
},
{
id: "session-2",
name: "API Integration",
created: new Date(Date.now() - 2 * 3600000), // 2 hours ago
updated: new Date(Date.now() - 30 * 60000), // 30 minutes ago
status: 'completed',
steps: [
{
id: "other-step-1",
timestamp: new Date(Date.now() - 2 * 3600000), // 2 hours ago
status: 'completed',
type: 'planning',
title: 'API Integration Planning',
content: 'Planning the integration with the backend API...',
duration: 4500
},
{
id: "other-step-2",
timestamp: new Date(Date.now() - 1.5 * 3600000), // 1.5 hours ago
status: 'completed',
type: 'implementation',
title: 'Implementing API Client',
content: 'Creating API client with fetch utilities...',
duration: 7200
},
{
id: "other-step-3",
timestamp: new Date(Date.now() - 1 * 3600000), // 1 hour ago
status: 'completed',
type: 'tool-execution',
title: 'Testing API Endpoints',
content: 'Running tests against API endpoints...',
duration: 5000
}
]
},
{
id: "session-3",
name: "Bug Fixes",
created: new Date(Date.now() - 5 * 3600000), // 5 hours ago
updated: new Date(Date.now() - 4 * 3600000), // 4 hours ago
status: 'error',
steps: [
{
id: "bug-step-1",
timestamp: new Date(Date.now() - 5 * 3600000), // 5 hours ago
status: 'completed',
type: 'planning',
title: 'Bug Analysis',
content: 'Analyzing reported bugs from issue tracker...',
duration: 3600
},
{
id: "bug-step-2",
timestamp: new Date(Date.now() - 4.5 * 3600000), // 4.5 hours ago
status: 'error',
type: 'implementation',
title: 'Fixing Authentication Bug',
content: 'Error: Unable to resolve dependency conflict with auth package',
duration: 2500
}
]
}
];
}

View File

@ -0,0 +1,28 @@
/**
* Common types for agent UI components
*/
/**
* Represents a single step in the agent process
*/
export interface AgentStep {
id: string;
timestamp: Date;
status: 'completed' | 'in-progress' | 'error' | 'pending';
type: 'tool-execution' | 'thinking' | 'planning' | 'implementation' | 'user-input';
title: string;
content: string;
duration?: number; // in milliseconds
}
/**
* Represents a session with multiple steps
*/
export interface AgentSession {
id: string;
name: string;
created: Date;
updated: Date;
status: 'active' | 'completed' | 'error';
steps: AgentStep[];
}

View File

@ -0,0 +1,18 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
presets: [require('./tailwind.preset')],
content: [
'./src/**/*.{js,jsx,ts,tsx}',
],
safelist: [
'dark',
{
pattern: /^dark:/,
variants: ['hover', 'focus', 'active']
}
],
theme: {
extend: {},
},
plugins: [],
}

View File

@ -0,0 +1,70 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
darkMode: ["class"],
theme: {
container: {
center: true,
padding: "2rem",
screens: {
"2xl": "1400px",
},
},
extend: {
colors: {
border: "hsl(var(--border))",
input: "hsl(var(--input))",
ring: "hsl(var(--ring))",
background: "hsl(var(--background))",
foreground: "hsl(var(--foreground))",
primary: {
DEFAULT: "hsl(var(--primary))",
foreground: "hsl(var(--primary-foreground))",
},
secondary: {
DEFAULT: "hsl(var(--secondary))",
foreground: "hsl(var(--secondary-foreground))",
},
destructive: {
DEFAULT: "hsl(var(--destructive))",
foreground: "hsl(var(--destructive-foreground))",
},
muted: {
DEFAULT: "hsl(var(--muted))",
foreground: "hsl(var(--muted-foreground))",
},
accent: {
DEFAULT: "hsl(var(--accent))",
foreground: "hsl(var(--accent-foreground))",
},
popover: {
DEFAULT: "hsl(var(--popover))",
foreground: "hsl(var(--popover-foreground))",
},
card: {
DEFAULT: "hsl(var(--card))",
foreground: "hsl(var(--card-foreground))",
},
},
borderRadius: {
lg: "var(--radius)",
md: "calc(var(--radius) - 2px)",
sm: "calc(var(--radius) - 4px)",
},
keyframes: {
"accordion-down": {
from: { height: "0" },
to: { height: "var(--radix-accordion-content-height)" },
},
"accordion-up": {
from: { height: "var(--radix-accordion-content-height)" },
to: { height: "0" },
},
},
animation: {
"accordion-down": "accordion-down 0.2s ease-out",
"accordion-up": "accordion-up 0.2s ease-out",
},
},
},
plugins: [require("tailwindcss-animate")],
}

View File

@ -0,0 +1,17 @@
{
"compilerOptions": {
"target": "ES6",
"module": "ESNext",
"moduleResolution": "node",
"declaration": true,
"jsx": "react",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"outDir": "dist",
"rootDir": "src",
"lib": ["DOM", "DOM.Iterable", "ESNext", "ES2016"]
},
"include": ["src"]
}

8255
frontend/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

13
frontend/package.json Normal file
View File

@ -0,0 +1,13 @@
{
"name": "frontend-monorepo",
"private": true,
"workspaces": [
"common",
"web",
"vsc"
],
"scripts": {
"install-all": "npm install",
"dev:web": "npm --workspace @ra-aid/web run dev"
}
}

View File

@ -0,0 +1,5 @@
import { defineConfig } from '@vscode/test-cli';
export default defineConfig({
files: 'out/test/**/*.test.js',
});

5
frontend/vsc/.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,5 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": ["dbaeumer.vscode-eslint", "connor4312.esbuild-problem-matchers", "ms-vscode.extension-test-runner"]
}

21
frontend/vsc/.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,21 @@
// A launch configuration that compiles the extension and then opens it inside a new window
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}"
}
]
}

13
frontend/vsc/.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,13 @@
// Place your settings in this file to overwrite default and user settings.
{
"files.exclude": {
"out": false, // set this to true to hide the "out" folder with the compiled JS files
"dist": false // set this to true to hide the "dist" folder with the compiled JS files
},
"search.exclude": {
"out": true, // set this to false to include "out" folder in search results
"dist": true // set this to false to include "dist" folder in search results
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off"
}

64
frontend/vsc/.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,64 @@
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
{
"version": "2.0.0",
"tasks": [
{
"label": "watch",
"dependsOn": [
"npm: watch:tsc",
"npm: watch:esbuild"
],
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
},
{
"type": "npm",
"script": "watch:esbuild",
"group": "build",
"problemMatcher": "$esbuild-watch",
"isBackground": true,
"label": "npm: watch:esbuild",
"presentation": {
"group": "watch",
"reveal": "never"
}
},
{
"type": "npm",
"script": "watch:tsc",
"group": "build",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"label": "npm: watch:tsc",
"presentation": {
"group": "watch",
"reveal": "never"
}
},
{
"type": "npm",
"script": "watch-tests",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never",
"group": "watchers"
},
"group": "build"
},
{
"label": "tasks: watch-tests",
"dependsOn": [
"npm: watch",
"npm: watch-tests"
],
"problemMatcher": []
}
]
}

View File

@ -0,0 +1,14 @@
.vscode/**
.vscode-test/**
out/**
node_modules/**
src/**
.gitignore
.yarnrc
esbuild.js
vsc-extension-quickstart.md
**/tsconfig.json
**/eslint.config.mjs
**/*.map
**/*.ts
**/.vscode-test.*

View File

@ -0,0 +1,9 @@
# Change Log
All notable changes to the "ra-aid" extension will be documented in this file.
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
## [Unreleased]
- Initial release

71
frontend/vsc/README.md Normal file
View File

@ -0,0 +1,71 @@
# ra-aid README
This is the README for your extension "ra-aid". After writing up a brief description, we recommend including the following sections.
## Features
Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file.
For example if there is an image subfolder under your extension project workspace:
\!\[feature X\]\(images/feature-x.png\)
> Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow.
## Requirements
If you have any requirements or dependencies, add a section describing those and how to install and configure them.
## Extension Settings
Include if your extension adds any VS Code settings through the `contributes.configuration` extension point.
For example:
This extension contributes the following settings:
* `myExtension.enable`: Enable/disable this extension.
* `myExtension.thing`: Set to `blah` to do something.
## Known Issues
Calling out known issues can help limit users opening duplicate issues against your extension.
## Release Notes
Users appreciate release notes as you update your extension.
### 1.0.0
Initial release of ...
### 1.0.1
Fixed issue #.
### 1.1.0
Added features X, Y, and Z.
---
## Following extension guidelines
Ensure that you've read through the extensions guidelines and follow the best practices for creating your extension.
* [Extension Guidelines](https://code.visualstudio.com/api/references/extension-guidelines)
## Working with Markdown
You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts:
* Split the editor (`Cmd+\` on macOS or `Ctrl+\` on Windows and Linux).
* Toggle preview (`Shift+Cmd+V` on macOS or `Shift+Ctrl+V` on Windows and Linux).
* Press `Ctrl+Space` (Windows, Linux, macOS) to see a list of Markdown snippets.
## For more information
* [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown)
* [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/)
**Enjoy!**

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

BIN
frontend/vsc/assets/RA.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

140
frontend/vsc/dist/extension.js vendored Normal file
View File

@ -0,0 +1,140 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/extension.ts
var extension_exports = {};
__export(extension_exports, {
activate: () => activate,
deactivate: () => deactivate
});
module.exports = __toCommonJS(extension_exports);
var vscode = __toESM(require("vscode"));
var RAWebviewViewProvider = class {
constructor(_extensionUri) {
this._extensionUri = _extensionUri;
}
/**
* Called when a view is first created to initialize the webview
*/
resolveWebviewView(webviewView, context, _token) {
webviewView.webview.options = {
// Enable JavaScript in the webview
enableScripts: true,
// Restrict the webview to only load resources from the extension's directory
localResourceRoots: [this._extensionUri]
};
webviewView.webview.html = this._getHtmlForWebview(webviewView.webview);
}
/**
* Creates HTML content for the webview with proper security policies
*/
_getHtmlForWebview(webview) {
const logoUri = webview.asWebviewUri(vscode.Uri.joinPath(this._extensionUri, "assets", "RA.png"));
const nonce = getNonce();
return `<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src ${webview.cspSource} https:; style-src ${webview.cspSource} 'unsafe-inline'; script-src 'nonce-${nonce}';">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>RA.Aid</title>
<style>
body {
padding: 0;
color: var(--vscode-foreground);
font-size: var(--vscode-font-size);
font-weight: var(--vscode-font-weight);
font-family: var(--vscode-font-family);
background-color: var(--vscode-editor-background);
}
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 20px;
text-align: center;
}
.logo {
width: 100px;
height: 100px;
margin-bottom: 20px;
}
h1 {
color: var(--vscode-editor-foreground);
font-size: 1.3em;
margin-bottom: 15px;
}
p {
color: var(--vscode-foreground);
margin-bottom: 10px;
}
</style>
</head>
<body>
<div class="container">
<img src="${logoUri}" alt="RA.Aid Logo" class="logo">
<h1>RA.Aid</h1>
<p>Your research and development assistant.</p>
<p>More features coming soon!</p>
</div>
</body>
</html>`;
}
};
function getNonce() {
let text = "";
const possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for (let i = 0; i < 32; i++) {
text += possible.charAt(Math.floor(Math.random() * possible.length));
}
return text;
}
function activate(context) {
console.log('Congratulations, your extension "ra-aid" is now active!');
const provider = new RAWebviewViewProvider(context.extensionUri);
const viewRegistration = vscode.window.registerWebviewViewProvider(
"ra-aid.view",
// Must match the view id in package.json
provider
);
context.subscriptions.push(viewRegistration);
const disposable = vscode.commands.registerCommand("ra-aid.helloWorld", () => {
vscode.window.showInformationMessage("Hello World from RA.Aid!");
});
context.subscriptions.push(disposable);
}
function deactivate() {
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
activate,
deactivate
});
//# sourceMappingURL=extension.js.map

6
frontend/vsc/dist/extension.js.map vendored Normal file
View File

@ -0,0 +1,6 @@
{
"version": 3,
"sources": ["../src/extension.ts"],
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,aAAwB;AAKxB,IAAM,wBAAN,MAAkE;AAAA,EAChE,YAA6B,eAA2B;AAA3B;AAAA,EAA4B;AAAA;AAAA;AAAA;AAAA,EAKlD,mBACL,aACA,SACA,QACA;AAEA,gBAAY,QAAQ,UAAU;AAAA;AAAA,MAE5B,eAAe;AAAA;AAAA,MAEf,oBAAoB,CAAC,KAAK,aAAa;AAAA,IACzC;AAGA,gBAAY,QAAQ,OAAO,KAAK,mBAAmB,YAAY,OAAO;AAAA,EACxE;AAAA;AAAA;AAAA;AAAA,EAKQ,mBAAmB,SAAiC;AAE1D,UAAM,UAAU,QAAQ,aAAoB,WAAI,SAAS,KAAK,eAAe,UAAU,QAAQ,CAAC;AAMhG,UAAM,QAAQ,SAAS;AAEvB,WAAO;AAAA;AAAA;AAAA;AAAA,0FAI+E,QAAQ,SAAS,sBAAsB,QAAQ,SAAS,uCAAuC,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAsCxK,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO3B;AACF;AAKA,SAAS,WAAW;AAClB,MAAI,OAAO;AACX,QAAM,WAAW;AACjB,WAAS,IAAI,GAAG,IAAI,IAAI,KAAK;AAC3B,YAAQ,SAAS,OAAO,KAAK,MAAM,KAAK,OAAO,IAAI,SAAS,MAAM,CAAC;AAAA,EACrE;AACA,SAAO;AACT;AAGO,SAAS,SAAS,SAAkC;AAEzD,UAAQ,IAAI,yDAAyD;AAGrE,QAAM,WAAW,IAAI,sBAAsB,QAAQ,YAAY;AAC/D,QAAM,mBAA0B,cAAO;AAAA,IACrC;AAAA;AAAA,IACA;AAAA,EACF;AACA,UAAQ,cAAc,KAAK,gBAAgB;AAK3C,QAAM,aAAoB,gBAAS,gBAAgB,qBAAqB,MAAM;AAG5E,IAAO,cAAO,uBAAuB,0BAA0B;AAAA,EACjE,CAAC;AAED,UAAQ,cAAc,KAAK,UAAU;AACvC;AAGO,SAAS,aAAa;AAAC;",
"names": []
}

56
frontend/vsc/esbuild.js Normal file
View File

@ -0,0 +1,56 @@
const esbuild = require("esbuild");
const production = process.argv.includes('--production');
const watch = process.argv.includes('--watch');
/**
* @type {import('esbuild').Plugin}
*/
const esbuildProblemMatcherPlugin = {
name: 'esbuild-problem-matcher',
setup(build) {
build.onStart(() => {
console.log('[watch] build started');
});
build.onEnd((result) => {
result.errors.forEach(({ text, location }) => {
console.error(`✘ [ERROR] ${text}`);
console.error(` ${location.file}:${location.line}:${location.column}:`);
});
console.log('[watch] build finished');
});
},
};
async function main() {
const ctx = await esbuild.context({
entryPoints: [
'src/extension.ts'
],
bundle: true,
format: 'cjs',
minify: production,
sourcemap: !production,
sourcesContent: false,
platform: 'node',
outfile: 'dist/extension.js',
external: ['vscode'],
logLevel: 'silent',
plugins: [
/* add to the end of plugins array */
esbuildProblemMatcherPlugin,
],
});
if (watch) {
await ctx.watch();
} else {
await ctx.rebuild();
await ctx.dispose();
}
}
main().catch(e => {
console.error(e);
process.exit(1);
});

View File

@ -0,0 +1,28 @@
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";
export default [{
files: ["**/*.ts"],
}, {
plugins: {
"@typescript-eslint": typescriptEslint,
},
languageOptions: {
parser: tsParser,
ecmaVersion: 2022,
sourceType: "module",
},
rules: {
"@typescript-eslint/naming-convention": ["warn", {
selector: "import",
format: ["camelCase", "PascalCase"],
}],
curly: "warn",
eqeqeq: "warn",
"no-throw-literal": "warn",
semi: "warn",
},
}];

5960
frontend/vsc/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

67
frontend/vsc/package.json Normal file
View File

@ -0,0 +1,67 @@
{
"name": "ra-aid",
"displayName": "RA.Aid",
"description": "Develop software autonomously.",
"version": "0.0.1",
"engines": {
"vscode": "^1.98.0"
},
"categories": [
"Other"
],
"activationEvents": [],
"main": "./dist/extension.js",
"contributes": {
"viewsContainers": {
"activitybar": [
{
"id": "ra-aid-view",
"title": "RA.Aid",
"icon": "assets/RA-white-transp.png"
}
]
},
"views": {
"ra-aid-view": [
{
"type": "webview",
"id": "ra-aid.view",
"name": "RA.Aid"
}
]
},
"commands": [
{
"command": "ra-aid.helloWorld",
"title": "Hello World"
}
]
},
"scripts": {
"vscode:prepublish": "npm run package",
"compile": "npm run check-types && npm run lint && node esbuild.js",
"watch": "npm-run-all -p watch:*",
"watch:esbuild": "node esbuild.js --watch",
"watch:tsc": "tsc --noEmit --watch --project tsconfig.json",
"package": "npm run check-types && npm run lint && node esbuild.js --production",
"compile-tests": "tsc -p . --outDir out",
"watch-tests": "tsc -p . -w --outDir out",
"pretest": "npm run compile-tests && npm run compile && npm run lint",
"check-types": "tsc --noEmit",
"lint": "eslint src",
"test": "vscode-test"
},
"devDependencies": {
"@types/vscode": "^1.98.0",
"@types/mocha": "^10.0.10",
"@types/node": "20.x",
"@typescript-eslint/eslint-plugin": "^8.25.0",
"@typescript-eslint/parser": "^8.25.0",
"eslint": "^9.21.0",
"esbuild": "^0.25.0",
"npm-run-all": "^4.1.5",
"typescript": "^5.7.3",
"@vscode/test-cli": "^0.0.10",
"@vscode/test-electron": "^2.4.1"
}
}

View File

@ -0,0 +1,133 @@
// The module 'vscode' contains the VS Code extensibility API
import * as vscode from 'vscode';
/**
* WebviewViewProvider implementation for the RA.Aid panel
*/
class RAWebviewViewProvider implements vscode.WebviewViewProvider {
constructor(private readonly _extensionUri: vscode.Uri) {}
/**
* Called when a view is first created to initialize the webview
*/
public resolveWebviewView(
webviewView: vscode.WebviewView,
context: vscode.WebviewViewResolveContext,
_token: vscode.CancellationToken
) {
// Set options for the webview
webviewView.webview.options = {
// Enable JavaScript in the webview
enableScripts: true,
// Restrict the webview to only load resources from the extension's directory
localResourceRoots: [this._extensionUri]
};
// Set the HTML content of the webview
webviewView.webview.html = this._getHtmlForWebview(webviewView.webview);
}
/**
* Creates HTML content for the webview with proper security policies
*/
private _getHtmlForWebview(webview: vscode.Webview): string {
// Create a URI to the extension's assets directory
const logoUri = webview.asWebviewUri(vscode.Uri.joinPath(this._extensionUri, 'assets', 'RA.png'));
// Create a URI to the script file
// const scriptUri = webview.asWebviewUri(vscode.Uri.joinPath(this._extensionUri, 'dist', 'webview.js'));
// Use a nonce to whitelist scripts
const nonce = getNonce();
return `<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src ${webview.cspSource} https:; style-src ${webview.cspSource} 'unsafe-inline'; script-src 'nonce-${nonce}';">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>RA.Aid</title>
<style>
body {
padding: 0;
color: var(--vscode-foreground);
font-size: var(--vscode-font-size);
font-weight: var(--vscode-font-weight);
font-family: var(--vscode-font-family);
background-color: var(--vscode-editor-background);
}
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 20px;
text-align: center;
}
.logo {
width: 100px;
height: 100px;
margin-bottom: 20px;
}
h1 {
color: var(--vscode-editor-foreground);
font-size: 1.3em;
margin-bottom: 15px;
}
p {
color: var(--vscode-foreground);
margin-bottom: 10px;
}
</style>
</head>
<body>
<div class="container">
<img src="${logoUri}" alt="RA.Aid Logo" class="logo">
<h1>RA.Aid</h1>
<p>Your research and development assistant.</p>
<p>More features coming soon!</p>
</div>
</body>
</html>`;
}
}
/**
* Generates a random nonce for CSP
*/
function getNonce() {
let text = '';
const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
for (let i = 0; i < 32; i++) {
text += possible.charAt(Math.floor(Math.random() * possible.length));
}
return text;
}
// This method is called when your extension is activated
export function activate(context: vscode.ExtensionContext) {
// Use the console to output diagnostic information (console.log) and errors (console.error)
console.log('Congratulations, your extension "ra-aid" is now active!');
// Register the WebviewViewProvider
const provider = new RAWebviewViewProvider(context.extensionUri);
const viewRegistration = vscode.window.registerWebviewViewProvider(
'ra-aid.view', // Must match the view id in package.json
provider
);
context.subscriptions.push(viewRegistration);
// The command has been defined in the package.json file
// Now provide the implementation of the command with registerCommand
// The commandId parameter must match the command field in package.json
const disposable = vscode.commands.registerCommand('ra-aid.helloWorld', () => {
// The code you place here will be executed every time your command is executed
// Display a message box to the user
vscode.window.showInformationMessage('Hello World from RA.Aid!');
});
context.subscriptions.push(disposable);
}
// This method is called when your extension is deactivated
export function deactivate() {}

View File

@ -0,0 +1,15 @@
import * as assert from 'assert';
// You can import and use all API from the 'vscode' module
// as well as import your extension to test it
import * as vscode from 'vscode';
// import * as myExtension from '../../extension';
suite('Extension Test Suite', () => {
vscode.window.showInformationMessage('Start all tests.');
test('Sample test', () => {
assert.strictEqual(-1, [1, 2, 3].indexOf(5));
assert.strictEqual(-1, [1, 2, 3].indexOf(0));
});
});

View File

@ -0,0 +1,16 @@
{
"compilerOptions": {
"module": "Node16",
"target": "ES2022",
"lib": [
"ES2022"
],
"sourceMap": true,
"rootDir": "src",
"strict": true, /* enable all strict type-checking options */
/* Additional Checks */
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
// "noUnusedParameters": true, /* Report errors on unused parameters. */
}
}

View File

@ -0,0 +1,48 @@
# Welcome to your VS Code Extension
## What's in the folder
* This folder contains all of the files necessary for your extension.
* `package.json` - this is the manifest file in which you declare your extension and command.
* The sample plugin registers a command and defines its title and command name. With this information VS Code can show the command in the command palette. It doesnt yet need to load the plugin.
* `src/extension.ts` - this is the main file where you will provide the implementation of your command.
* The file exports one function, `activate`, which is called the very first time your extension is activated (in this case by executing the command). Inside the `activate` function we call `registerCommand`.
* We pass the function containing the implementation of the command as the second parameter to `registerCommand`.
## Setup
* install the recommended extensions (amodio.tsl-problem-matcher, ms-vscode.extension-test-runner, and dbaeumer.vscode-eslint)
## Get up and running straight away
* Press `F5` to open a new window with your extension loaded.
* Run your command from the command palette by pressing (`Ctrl+Shift+P` or `Cmd+Shift+P` on Mac) and typing `Hello World`.
* Set breakpoints in your code inside `src/extension.ts` to debug your extension.
* Find output from your extension in the debug console.
## Make changes
* You can relaunch the extension from the debug toolbar after changing code in `src/extension.ts`.
* You can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes.
## Explore the API
* You can open the full set of our API when you open the file `node_modules/@types/vscode/index.d.ts`.
## Run tests
* Install the [Extension Test Runner](https://marketplace.visualstudio.com/items?itemName=ms-vscode.extension-test-runner)
* Run the "watch" task via the **Tasks: Run Task** command. Make sure this is running, or tests might not be discovered.
* Open the Testing view from the activity bar and click the Run Test" button, or use the hotkey `Ctrl/Cmd + ; A`
* See the output of the test result in the Test Results view.
* Make changes to `src/test/extension.test.ts` or create new test files inside the `test` folder.
* The provided test runner will only consider files matching the name pattern `**.test.ts`.
* You can create folders inside the `test` folder to structure your tests any way you want.
## Go further
* Reduce the extension size and improve the startup time by [bundling your extension](https://code.visualstudio.com/api/working-with-extensions/bundling-extension).
* [Publish your extension](https://code.visualstudio.com/api/working-with-extensions/publishing-extension) on the VS Code extension marketplace.
* Automate builds by setting up [Continuous Integration](https://code.visualstudio.com/api/working-with-extensions/continuous-integration).

16
frontend/web/index.html Normal file
View File

@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Demo page showcasing shadcn/ui components from the common package" />
<title>RA-Aid UI Components Demo</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>

26
frontend/web/package.json Normal file
View File

@ -0,0 +1,26 @@
{
"name": "@ra-aid/web",
"version": "1.0.0",
"private": true,
"main": "dist/index.js",
"scripts": {
"dev": "vite",
"build": "vite build"
},
"dependencies": {
"react": "^18.0.0",
"react-dom": "^18.0.0",
"@ra-aid/common": "1.0.0"
},
"devDependencies": {
"vite": "^4.0.0",
"@vitejs/plugin-react": "^3.0.0",
"typescript": "^5.0.0",
"tailwindcss": "^3.4.1",
"postcss": "^8.4.35",
"autoprefixer": "^10.4.17"
},
"optionalDependencies": {
"@tailwindcss/forms": "^0.5.7"
}
}

View File

@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}

View File

@ -0,0 +1,19 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import { DefaultAgentScreen } from '@ra-aid/common';
/**
* Main application entry point
* Simply renders the DefaultAgentScreen component from the common package
*/
const App = () => {
return <DefaultAgentScreen />;
};
// Mount the app to the root element
const root = ReactDOM.createRoot(document.getElementById('root')!);
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
);

View File

@ -0,0 +1,14 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
presets: [require('../common/tailwind.preset')],
content: [
'./src/**/*.{js,jsx,ts,tsx}',
'../common/src/**/*.{js,jsx,ts,tsx}'
],
theme: {
extend: {},
},
plugins: [
require('@tailwindcss/forms')
],
}

View File

@ -0,0 +1,15 @@
{
"compilerOptions": {
"target": "ES6",
"module": "ESNext",
"moduleResolution": "node",
"jsx": "react-jsx",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"outDir": "dist",
"rootDir": "src"
},
"include": ["src"]
}

View File

@ -0,0 +1,40 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import path from 'path';
import fs from 'fs';
// Get all component files from common package
const commonSrcDir = path.resolve(__dirname, '../common/src');
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
// Direct alias to the source directory
'@ra-aid/common': path.resolve(__dirname, '../common/src')
},
preserveSymlinks: true
},
optimizeDeps: {
// Exclude the common package from optimization so it can trigger hot reload
exclude: ['@ra-aid/common']
},
server: {
hmr: true,
watch: {
usePolling: true,
interval: 100,
// Make sure to explicitly NOT ignore the common package
ignored: [
'**/node_modules/**',
'**/dist/**',
'!**/common/src/**'
]
}
},
build: {
commonjsOptions: {
transformMixedEsModules: true
}
}
});

View File

@ -22,20 +22,21 @@ classifiers = [
"Topic :: Software Development :: Libraries :: Python Modules"
]
dependencies = [
"langchain-anthropic>=0.3.7",
"langchain-openai>=0.3.7",
"langchain-google-genai>=2.0.10",
"langgraph>=0.2.74",
"langgraph-checkpoint>=2.0.16",
"langchain-core>=0.3.39",
"langchain>=0.3.19",
"langchain-anthropic>=0.3.9",
"langchain-openai>=0.3.8",
"langchain-google-genai>=2.0.11",
"langgraph>=0.3.5",
"langgraph-checkpoint>=2.0.18",
"langchain-core>=0.3.5",
"langgraph-prebuilt>=0.1.2",
"langchain>=0.3.5",
"rich>=13.0.0",
"GitPython>=3.1",
"fuzzywuzzy==0.18.0",
"rapidfuzz>=3.11.0",
"pathspec>=0.11.0",
"pyte>=0.8.2",
"aider-chat>=0.74.2",
"aider-chat>=0.75.1",
"tavily-python>=0.5.0",
"litellm>=1.60.6",
"fastapi>=0.104.0",
@ -43,6 +44,13 @@ dependencies = [
"websockets>=12.0",
"jinja2>=3.1.2",
"python-Levenshtein>=0.26.1",
"python-magic>=0.4.27",
"peewee>=3.17.9",
"peewee-migrate>=1.13.0",
"platformdirs>=3.17.9",
"requests",
"packaging",
"prompt-toolkit"
]
[project.optional-dependencies]

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,3 @@
"""Version information."""
__version__ = "0.14.2"
__version__ = "0.17.1"

View File

Some files were not shown because too many files have changed in this diff Show More