Add explicit system("clear") call and newline in handle_sigint to visually reset the terminal display before showing the double-Ctrl+C exit message, ensuring clean output regardless of prior screen state.
- 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
Add a new `message_add_object` function in messages.h that appends a json_object to the global message list. Modify openai_chat in openai.h to call this function after processing a chat completion, ensuring the assistant's response object is stored. Also comment out the previous `message_add_tool_call` call to avoid duplicate message storage when tool calls are present, and add a missing `continue` in main.c's repl loop after the dump command to prevent fallthrough.
Implement auth_init() in auth.h to detect API keys from environment variables (R_KEY or OPENAI_API_KEY) and set auth_type accordingly. In main.c, call auth_init() during init() and replace the conditional commercial/free version startup messages with a simple carriage return clear.
Add AUTH_TYPE enum and global auth_type variable to auth.h, replacing the FREE_VERSION preprocessor conditional in chat.h with a dynamic get_prompt_model() function that returns "gpt-3.5-turbo" for free users and "gpt-4o-mini" for API key holders. Update all references to prompt_model to use the new function, enabling runtime model switching without recompilation.
Add initial project structure including .gitignore for build artifacts,
Makefile with gcc build and run targets, README placeholder, cgi-bin
directory with gpt.py and gpt_template.html, and core C headers for
chat, http, line input, markdown rendering, and messages.