23 Commits

Author SHA1 Message Date
darthrubik d655a9d953 Merge remote-tracking branch 'origin/master' into feature/rebase 2026-07-23 16:59:40 -05:00
darthrubik 11484fec1e Adding the ability to handle non utf8 encodings 2026-07-10 15:29:08 -05:00
hal9000 da919f9f6e Merge origin/master into work branch (issue #169)
Resolved merge conflicts:
- CMakeLists.txt: Added both rebase_engine/utility and base64_util sources
- src/harness.cpp: Combined Content type with proper error handling
- src/main.cpp: Merged includes, test flags, and CLI parsing
  - Renamed conflicting flags: -B→-Z (build_rebase), -T→-W (edit_prompt), -b→-K (base64_decode)
- tests/CMakeLists.txt: Added all test targets from both branches
- src/rebase_engine.cpp: Fixed to use get_content_string() for Content variant type
- Updated test files to use new flag names (-Z, -W, -K)
2026-06-15 22:52:29 +00:00
darthrubik 0020669eb0 Adding read multi-modal tool 2026-06-15 16:53:42 -05:00
hal9000 ce40d1fe9d Issue 153: Add base64 encoding utility
- Add base64_encode() function to encode binary data to base64 string
- Add base64_decode() function to decode base64 string to binary data
- Add get_mime_type_from_extension() for MIME type detection based on file extension
- Add generate_data_uri() for data URI prefix generation
- Add test flags -B (encode), -b (decode), -T (mime type), -U (data URI)
- Add comprehensive tests in test_base64_encode.sh
- No new dependencies added
2026-06-12 07:16:40 -05:00
darthrubik 271ac96100 Refactor: Extract shared utilities from rebase_engine and editor
Create new utility module (include/utility.hpp, src/utility.cpp) containing
common code that was duplicated between rebase_engine.cpp and editor.cpp:

- trim() function
- random_string() function
- random_file_name() function
- Defer RAII helper class
- spawn_editor() function

Both rebase_engine.cpp and editor.cpp now include utility.hpp instead of
duplicating these functions.

All 33 unit tests pass.
2026-05-29 16:30:54 -05:00
darthrubik adc4be09ce Implement RebaseEngine::parse_rebase_file() for issue #95
Add rebase parser that validates rebase editor format with:
- RebaseCommand enum (Pick, Edit, Drop)
- RebaseLine struct (command, index, role)
- parse_rebase_file() with strict validation and error aggregation

Validations:
- Invalid commands (not pick/edit/drop)
- Index out of range
- Duplicate indices
- Missing/malformed role brackets
- Invalid role values (must be user/assistant/tool)
- Comment lines (#) and empty lines are skipped

Tests cover all validation scenarios via -P debug flag.
2026-05-29 15:05:57 -05:00
darthrubik 6de57de2f5 Issue #43: Foundation - C++23 upgrade and basic error infrastructure
- Upgrade CMakeLists.txt from C++20 to C++23 to enable std::expected
- Add parse_json_safely() to json_types.hpp: wraps json::parse with
  allow_exceptions=false, returns discarded JSON on parse failure
- Add expect_or_exit() to json_types.hpp: helper for std::expected that
  prints error to stderr and exits on failure
- Add test flags (-J, -E, -e) to CLI for testing the new functions
- Add bash tests for parse_json_safely() and expect_or_exit()
2026-05-27 16:27:41 -05:00
darthrubik 5fd0ec56a1 Refactor skill module architecture: consolidate into single skill.hpp/skill.cpp
Consolidate skill_parsing, skill_scanner, and skill_tool modules into
a single skill.hpp / skill.cpp pair as specified in issue #16.

Changes:
- Created include/skill.hpp with all declarations
- Created src/skill.cpp with all implementations
- Updated CMakeLists.txt to use the new consolidated file
- Updated src/main.cpp to include the new consolidated header
- Removed old files: skill_parsing.hpp/cpp, skill_scanner.hpp/cpp,
  skill_tool.hpp/cpp

All 21 tests pass without regression.
2026-05-21 15:04:40 -05:00
darthrubik adfb070e6c Skill Tool Implementation & XML Output
- Added make_skill_tool() which looks up requested skills in an enabled map.
- Tool returns XML-wrapped string with <skill_content> and <skill_files>.
- Skill files are returned as absolute paths.
- Added SkillToolParams to json_types.hpp.
- Registered skill_tool in main.cpp with the enabled map built from SkillScanner.
- Added test_tool_skill.sh to verify XML structure and absolute paths.
- Updated CMakeLists.txt and tests/CMakeLists.txt accordingly.
2026-05-20 16:22:02 -05:00
darthrubik c9461f2e88 YAML Frontmatter Parsing & Debug Parsing
- Add skill_parsing.hpp and skill_parsing.cpp for YAML frontmatter parsing
- Extract name (required) and description (optional) from SKILL.md files
- Add -y flag to print parsed metadata and exit
- Add test_skill_parsing.sh to verify the -y flag functionality
- Update CMakeLists.txt to include the new source and test
2026-05-20 16:21:58 -05:00
darthrubik 6c898ca415 Implement directory scanning and debug listing for skills
- Add SkillScanner class to recursively find SKILL.md files
- Scan standard global (~/.local/share/harness/skills/, ~/.config/harness/skills/) and local (./skills/, ./.skills/) paths
- Add -D flag to print all discovered file paths and exit
- Add unit test for scanner functionality
- Update CMakeLists.txt and main.cpp accordingly
2026-05-20 16:21:49 -05:00
darthrubik c5f4fd2cf0 Adding editor support when not using -m 2026-05-13 15:26:03 -05:00
darthrubik feb06b5f6d Adding first pass at automated tests 2026-05-09 08:54:19 -05:00
darthrubik 8ad222a597 First version of debug client 2026-05-08 17:11:01 -05:00
darthrubik 4f1210baea Adding grep tool 2026-05-06 08:47:26 -05:00
darthrubik 1e1f2603c1 Build windows standard libs as static 2026-05-05 14:45:13 -05:00
darthrubik 7a368fa86b First pass windows build 2026-05-05 09:22:41 -05:00
darthrubik 3ce89b690a Adding read file tool 2026-05-04 13:36:53 -05:00
darthrubik 1732b68dcc Adding file list tool 2026-05-04 13:30:39 -05:00
darthrubik 46a98ebcfd Adding edit tool basically cloned from opencode 2026-04-29 06:42:51 -05:00
darthrubik 07e978f8f9 Add subagent mode via agent-as-tool pattern
Each AgentProfile defines a model and a subset of tools. Profiles are
registered as callable tools in the main harness so the orchestrator LLM
can delegate tasks to specialized subagents. Each invocation runs an
isolated Harness with fresh history; only the final answer is returned,
keeping the orchestrator context clean.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 18:45:43 -05:00
darthrubik 5a40ebd8d8 Initial implementation of drharness AI harness
C++20 agentic loop targeting a local Ollama instance via the OpenAI-compatible
/v1/chat/completions API. Includes an extensible tool registry pattern and a
shell command runner as the first tool. Builds with CMake + system libcurl +
nlohmann-json.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 18:09:34 -05:00