Commit Graph

19 Commits

Author SHA1 Message Date
3d4b57d8ae fix: comment out max_tokens field and add missing includes across multiple headers 2025-03-28 01:41:15 +00:00
9348e4ebea chore: add sqlite3 link, increase prompt tokens, expand history path, and refine tool descriptions 2025-03-27 22:08:00 +00:00
eccb17d766 chore: add sqlite3 link flag, verbose mode, and new browse/db_utils modules to build system 2025-03-22 02:15:49 +00:00
0689101e72 feat: add real-time stdout printing during terminal command execution in tools.h
The change inserts a `printf("%s", output)` call inside the `tool_function_linux_terminal` function, immediately after reallocating the output buffer and before appending new data. This enables real-time display of captured process output to the console as chunks are received, rather than only returning the final aggregated string. The modification affects the core execution loop in `tools.h` where command output is accumulated from the process stream.
2025-03-21 08:19:41 +00:00
50419881dd feat: add double-sigint exit, --free flag, model command, and index_source_directory tool
- Add SIGINT handler that exits on two Ctrl+C presses within 1 second
- Introduce --free flag to switch auth type to AUTH_TYPE_FREE via auth_free()
- Implement "model" REPL command to print current prompt model name
- Register index_source_directory tool description and function in tools.h
2025-03-21 00:15:40 +00:00
6b08d3334c fix: return empty string instead of null on glob failure in directory glob
The tool_function_directory_glob function previously returned NULL when the glob
pattern failed to match, causing a null pointer dereference in the user profile
avatar loader when it attempted to process the result. Changed the return value
to an empty string to ensure callers always receive a valid pointer.
2025-03-19 20:25:34 +00:00
6e3e899832 chore: remove FREE_VERSION conditional and add --py flag for python file inclusion 2025-03-16 21:46:09 +00:00
8b25cb93d4 chore: add static qualifiers to global variables and const-correctness to tool result parameters 2025-03-16 06:36:13 +00:00
8d1968ce97 fix: add null checks for openai responses and implement interactive terminal tool with home directory expansion 2025-03-05 22:53:35 +00:00
8a13f1a59c chore: replace placeholder branding with final logo and color scheme 2025-03-03 16:06:05 +00:00
d819021fdb chore: add directory_rglob tool declaration and registration to tools.h 2025-03-03 13:51:13 +00:00
be5e2e4c05 fix: clarify directory_glob tool description to specify glob format output 2025-03-03 13:09:28 +00:00
c247e3b1bb fix: remove debug print statements from chat_json and tools_descriptions functions 2025-03-03 12:57:16 +00:00
b54efff1f3 feat: add file system tools and debug logging for prompt and tool descriptions 2025-03-03 12:51:57 +00:00
0bc2698d83 fix: return strdup instead of string literal in popen error paths in tools.h
The error return paths in tool_function_bash were returning string literals instead of heap-allocated copies via strdup, causing potential null pointer dereference when callers attempt to free the returned pointer. This fix ensures both "Popen failed!" and "Failed to allocate memory!" error messages are properly duplicated on the heap before being returned.
2025-03-03 08:52:28 +00:00
00c45e0978 fix: return error strings instead of NULL on popen and realloc failures in tool_function_bash 2025-03-03 08:48:50 +00:00
f8667d1a4b feat: add bash command execution tool with popen-based output capture
Implement a new `tool_function_bash` that executes shell commands via `popen` and captures their output into a dynamically allocated buffer. Register the corresponding `tool_description_bash` JSON schema and include it in the `tools_descriptions` array alongside the existing HTTP GET tool. Also change the history file path from `~/.calpaca_history` to `.r_history` and remove the redundant `read_history` call before adding new history entries.
2025-03-03 08:39:19 +00:00
38b233bfcf chore: remove trailing blank lines and debug printfs from openai.h and tools.h 2025-03-03 07:32:41 +00:00
e4f71ccea8 feat: add tool calling support with http_fetch function and message handling
Implement tool calling infrastructure including tools.h with http_fetch function description and execution, message_add_tool_call and message_add_tool_result helpers in messages.h, tool descriptions injection into user messages and chat_json, http header parsing utilities in http.h, curl_get function in http_curl.h, and tool call execution loop in openai_chat that recursively processes tool results.
2025-03-03 07:07:17 +00:00