This commit is contained in:
2026-01-29 00:38:21 +01:00
parent 1f381906d1
commit df124bb10b
22 changed files with 2885 additions and 4 deletions
+8
View File
@@ -0,0 +1,8 @@
// retoor <retoor@molodetz.nl>
#ifndef BASH_REPAIR_H
#define BASH_REPAIR_H
char *bash_repair_command(const char *src);
#endif
+20
View File
@@ -0,0 +1,20 @@
// retoor <retoor@molodetz.nl>
#ifndef R_CONTEXT_MANAGER_H
#define R_CONTEXT_MANAGER_H
#include "messages.h"
#include "r_error.h"
/**
* Shrinks the context of the given messages to fit within model limits.
* Uses a smart trimming algorithm:
* 1. Truncates the middle of large messages (preserving start and end).
* 2. Removes oldest conversation pairs (user/assistant) if needed.
* 3. Never touches the 'system' message or the very last user message.
*
* Returns R_SUCCESS if shrinkage was performed, or error if not possible.
*/
r_status_t context_manager_shrink(messages_handle msgs);
#endif
+8
View File
@@ -0,0 +1,8 @@
// retoor <retoor@molodetz.nl>
#ifndef JSON_REPAIR_H
#define JSON_REPAIR_H
char *json_repair_string(const char *src);
#endif
+8
View File
@@ -0,0 +1,8 @@
// retoor <retoor@molodetz.nl>
#ifndef PYTHON_REPAIR_H
#define PYTHON_REPAIR_H
char *python_repair_code(const char *src);
#endif
+16
View File
@@ -0,0 +1,16 @@
// retoor <retoor@molodetz.nl>
#ifndef R_DIFF_H
#define R_DIFF_H
/**
* Prints a beautiful, colorized diff between two strings to stderr.
* Mimics the style of 'git diff'.
*
* @param path The path of the file being changed (for the header).
* @param old_content The original content.
* @param new_content The new content.
*/
void r_diff_print(const char *path, const char *old_content, const char *new_content);
#endif