Commit Graph

117 Commits

Author SHA1 Message Date
dccd79c05a feat: add markdown module header and async bash execution result structs
Introduce `include/markdown.h` with retoor copyright header and add `r_process_result_t` struct plus `r_bash_execute_ext` / `r_process_result_free` declarations to `include/bash_executor.h` for advanced async process handling.
2026-01-29 05:54:10 +00:00
8215d7012d feat: add agent subagent support, bash timeout, context manager improvements, and benchmark script
- Add agent_set_is_subagent and agent_set_tool_registry to agent API for subagent support
- Add timeout_seconds parameter to r_bash_execute to prevent hanging processes
- Refactor context_manager truncation logic with dynamic ratio-based truncation and total size calculation
- Add messages_to_json_string helper and r_config_get_max_tokens accessor
- Introduce tool_registry_get_specialized for type-filtered tool registries
- Add completion_phrases and passive_phrases detection to agent completion logic
- Suppress spinner in http_client when stderr is not a TTY
- Add comprehensive agent_benchmark.py with TestCase framework and logging
2026-01-29 05:01:05 +00:00
a72e4116b1 chore: add build directory to gitignore and trim trailing whitespace from bin entry 2026-01-29 01:29:50 +00:00
a985c56650 chore: fix relative include path for r_error.h in string.h header 2026-01-29 01:29:33 +00:00
f8fbafa19a chore: remove trailing whitespace from README.md line 42 2026-01-29 01:27:20 +00:00
dc150f2ea2 chore: remove entire agent, auth, browse, chat, db_utils, and http_curl source trees
This commit deletes the complete implementation of the agent loop, authentication module, web browsing utilities, chat prompt builder, database helper, and HTTP client. All corresponding header files and test harnesses are also removed. The diff shows the deletion of 6 source files and 6 header files totaling over 1000 lines of code, including the agent state machine, API key resolution logic, curl-based HTTP functions, SQLite database initialization and CRUD operations, and the JSON chat prompt construction.
2026-01-29 01:21:11 +00:00
65630263c1 feat: add parallel thread execution for tool calls and port scanning with configurable concurrency
Implement pthread-based parallel execution in tool_registry_execute to run tool calls concurrently, replacing the previous sequential loop. Add tool_thread_args_t struct and tool_thread_func wrapper for thread-safe execution. Introduce MAX_PARALLEL_PROBES constant and probe_t struct in network_port_scan_execute to enable concurrent socket probing with non-blocking connect patterns, replacing the single-threaded sequential port scan loop.
2026-01-28 23:51:24 +00:00
20d92682b2 feat: add bash_repair, context_manager, json_repair, python_repair, and r_diff modules with Makefile integration 2026-01-28 23:38:21 +00:00
216627e777 feat: add context overflow detection and automatic history shrinking in agent loop
Implement context manager integration that detects API errors indicating context length exceeded, then automatically shrinks message history and retries the request. Add new messages API functions (remove_range, get_object, replace_at) and a new R_ERROR_CONTEXT_TOO_LONG error code to support this functionality.
2026-01-28 19:15:02 +00:00
09e3f62a34 feat: stream agent response incrementally and remove duplicate rendering in main loop 2026-01-28 19:06:18 +00:00
c9a29efc5d chore: update system prompt instructions for tool calls and communication rules 2026-01-28 18:55:47 +00:00
c096e43c96 chore: add ANSI dim/bold escape codes to stderr output in bash executor and tool registry 2026-01-28 18:50:07 +00:00
88458a81c9 chore: reformat indentation from 4-space to 2-space style in src/main.c 2026-01-28 18:47:14 +00:00
7f799e8fa5 chore: remove AppRun, compose.yml, collect_so_files.sh and database.db; add include headers and refactor Makefile with src directory structure 2026-01-28 18:34:39 +00:00
00b4c2a479 chore: add spinner animation and working directory to agent init payload 2025-12-26 09:16:59 +00:00
9fe393c9e8 chore: remove unused json-c includes and web_search_news function from browse.h 2025-12-26 06:24:13 +00:00
15e6b86290 feat: replace direct openai_chat calls with agent_chat and add autonomous agent pipeline with iteration control 2025-12-18 00:08:38 +00:00
09d8a1de30 chore: normalize code style and remove trailing whitespace across multiple source files 2025-09-27 19:20:18 +00:00
aed84c8f00 fix: replace unsafe sprintf with snprintf and fix memory leak in curl_get/curl_post 2025-05-29 18:59:25 +00:00
9c7e5e7259 feat: make tools parameter optional via R_USE_TOOLS env var check
Add use_tools() helper that reads R_USE_TOOLS environment variable to
conditionally include tools descriptions in chat JSON output, defaulting
to true when unset or unrecognized.
2025-05-29 00:40:09 +00:00
ae8377b0a4 feat: add get_env_string helper and R_SYSTEM_MESSAGE env support, update init prompt with key-stemming instruction 2025-05-24 13:21:13 +00:00
956d1af1ec feat: add Python code execution tool and RAG side project with Makefile targets 2025-05-14 03:23:36 +00:00
a35080015a fix: replace raw env pointer with strdup to avoid dangling reference in get_prompt_model 2025-05-14 00:43:33 +00:00
a19800f7ae chore: normalize indentation to 2 spaces and reorder includes in browse.h, db_utils.c, main.c, and messages.h 2025-05-05 12:33:08 +00:00
0ecaab39c2 feat: conditionally add strict parameter to all tool descriptions via get_use_strict() guard 2025-05-05 12:31:35 +00:00
580e352295 chore: add recursive mkdir and parent dir creation for write_file in tools.h 2025-05-05 12:09:21 +00:00
2b66f755b7 fix: remove duplicate -lnettle from CFLAGS and add mkdir -p bin before build target 2025-04-12 22:32:34 +00:00
b3921685c3 chore: add publish step after build to copy binary to release directory 2025-04-12 22:29:43 +00:00
1cbb3afd48 chore: add publish target dependency to build and replace publish script with curl download 2025-04-12 22:21:00 +00:00
844a5875fb chore: add libtinfo-dev and libgnutls-dev to Dockerfile apt dependencies 2025-04-12 22:16:03 +00:00
606bc27834 feat: add AppImage build pipeline with desktop integration and dependency bundling
Implement full AppImage packaging support including AppRun entry point, .desktop launcher, icon asset, and recursive shared library collection via collect_so_files.sh. The Makefile build target now generates a portable Linux executable by assembling the directory structure, copying the binary to AppImage/usr/bin/r, running the dependency collector, and invoking appimagetool to produce a self-contained AppImage binary. Also update .gitignore to exclude the AppImage build directory and add shell scripts to the ignore list.
2025-04-08 22:00:21 +00:00
0f43cd435c docs: add Grok AI model support and run command example to readme 2025-04-08 08:26:32 +00:00
f786943906 docs: add environment setup tips and OpenAI/Grok config examples to README
The diff adds a tip about creating bash files for environment variables and symlinking them for easy access, along with new configuration sections for OpenAI (using gpt-4o-mini) and Grok (using grok-2 with strict mode disabled) API setups in the README documentation.
2025-04-08 08:22:47 +00:00
7046b3e551 feat: enforce strict mode via R_USE_STRICT env var and truncate oversized tool results and content 2025-04-08 08:17:27 +00:00
e6784bc68c fix: correct glob pattern to match nested directories in build script
The fix changes the glob pattern from a literal dot to a wildcard asterisk when the target directory is ".", enabling recursive matching of files in subdirectories during the build process.
2025-04-07 08:24:38 +00:00
682b050ed4 fix: replace dot-only target_dir with wildcard for nested directory matching in rglob
The change adds a conditional check in `tool_function_directory_rglob` that converts a target_dir of "." to "*", enabling the recursive glob to match files in nested subdirectories rather than only the current directory's immediate contents.
2025-04-07 08:24:11 +00:00
3974d391b2 chore: strip trailing whitespace and placeholder license section from README.md 2025-04-03 11:24:37 +00:00
997fce03b2 docs: add comprehensive project overview, features, prerequisites, and configuration examples to readme 2025-04-03 11:22:50 +00:00
bfb1e2b901 chore: remove trailing whitespace from README.md line 42 and add debug logging for curl requests and JSON parsing failures 2025-04-03 11:18:56 +00:00
ec1e14d947 chore: append 2>&1 redirect to shell commands lacking stderr handling in tools.h 2025-04-03 03:38:30 +00:00
0e8fdda063 fix: add error handling for memory allocation, database, and OpenAI failures across multiple C modules 2025-04-03 03:26:11 +00:00
a71258a566 feat: add R_BASE_URL env var support with joinpath helper for dynamic API URL construction
Replace hardcoded global API URL variables with getter functions that check the R_BASE_URL environment variable, falling back to the static defaults. Introduce a joinpath utility in utils.h to safely concatenate a base URL with a path segment, handling trailing slashes and leading path slashes. Remove conditional compilation blocks for RD and OLLAMA backends, consolidating all API URL logic into the new get_completions_api_url and get_models_api_url functions. Update all call sites in openai.h to use the new getter functions instead of direct global variable access.
2025-04-03 00:18:41 +00:00
f73f9b3c50 chore: remove placeholder progress message and add tools command with claude backend
- Remove the initial commit placeholder progress message from Makefile
- Add `!tools` command to REPL that prints available tools descriptions
- Include tools.h header and integrate tools_descriptions() function
- Switch default RD backend from DeepInfra/Llama to Anthropic/Claude models
- Update advanced_model and fast_model to claude-3-5-haiku-20241022
- Change completions_api_url to Anthropic API endpoint
- Enable verbose mode by default (is_verbose = true)
- Update README to reflect new Claude/Ollama focus and remove old download links
2025-04-02 13:37:59 +00:00
5e34d03629 feat: add file version history tracking with db_store_file_version on write
Introduce a new `file_version_history` table to the SQLite schema and implement the `db_store_file_version` function that reads a file's current content and inserts a version record before overwriting it. The `tool_function_write_file` now calls this backup function prior to opening the file for writing, ensuring every write operation creates a recoverable snapshot.
2025-03-30 12:34:25 +00:00
62142a4946 chore: delete unused script.sh shell file from repository root 2025-03-30 00:48:51 +00:00
35f2f150b5 chore: remove empty placeholder commit and delete unused inplace_url.h header 2025-03-30 00:48:35 +00:00
120fe71ecd chore: remove cgi-bin gpt scripts, malloc wrappers, and dead repl help/debug commands 2025-03-30 00:47:00 +00:00
d3bfa84254 feat: add MinGW cross-compilation target and Docker support for build environment
Add build_mingw target using x86_64-w64-mingw32-gcc cross-compiler with
dedicated MinGW flags and publish step. Introduce Dockerfile with Ubuntu
base image installing all required build dependencies (gcc, make, readline,
ncurses, curl, openssl, json-c, sqlite3, python3-dev). Add compose.yml for
convenient Docker-based development shell with mounted working directory.
Extend Makefile with docker, docker_make, docker_run, run_mingw targets and
suppress error output on publish commands for build and build_free targets.
2025-03-30 00:09:06 +00:00
f7561f291d feat: extend supported file extensions list and add cross-platform path handling in utils 2025-03-29 23:13:42 +00:00
605f396464 fix: correct typo in indexer.h header guard macro name and remove unused prompt_max_tokens 2025-03-28 22:22:57 +00:00