Implement bounded repository navigation with repo-lens
CI / build (debug, map[compiler:appleclang os:macos-latest]) (push) Canceled after 0s
CI / build (debug, map[compiler:clang os:ubuntu-latest]) (push) Canceled after 0s
CI / build (debug, map[compiler:gcc os:ubuntu-latest]) (push) Canceled after 0s
CI / build (debug, map[compiler:msvc os:windows-latest]) (push) Canceled after 0s
CI / build (release, map[compiler:appleclang os:macos-latest]) (push) Canceled after 0s
CI / build (release, map[compiler:clang os:ubuntu-latest]) (push) Canceled after 0s
CI / build (release, map[compiler:gcc os:ubuntu-latest]) (push) Canceled after 0s
CI / build (release, map[compiler:msvc os:windows-latest]) (push) Canceled after 0s
CI / build (sanitizers, map[compiler:appleclang os:macos-latest]) (push) Canceled after 0s
CI / build (sanitizers, map[compiler:clang os:ubuntu-latest]) (push) Canceled after 0s
CI / build (sanitizers, map[compiler:gcc os:ubuntu-latest]) (push) Canceled after 0s
CI / build (sanitizers, map[compiler:msvc os:windows-latest]) (push) Canceled after 0s

- Add map, find, and around commands with repository root discovery
- Stream literal ripgrep searches with match counts and result limits
- Add direct subprocess execution and explicit error returns
- Disable C++ exceptions and add navigation tests
- Support CMake installation and document builds and deployment
- Add a reusable agent skill and document skill discovery
This commit is contained in:
wilmc committed 2026-10-09 13:15:00 +02:00
1 parent 70c43b6a68
commit a0fbb9f50e
22 files changed
+1185 -112

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
#pragma once
#include <filesystem>
#include <optional>
#include <string>
#include <string_view>
#include <vector>
namespace rl
{
[[nodiscard]] auto repository_root(std::filesystem::path& root, std::string& error) noexcept -> bool;
[[nodiscard]] auto number(std::string_view text) noexcept -> std::optional<std::size_t>;
struct source_location
{
std::filesystem::path file;
std::size_t line;
};
[[nodiscard]] auto parse_location(std::string_view text) noexcept -> std::optional<source_location>;
[[nodiscard]] auto read_lines(const std::filesystem::path& file, std::vector<std::string>& lines, std::string& error) noexcept -> bool;
auto map_sections(const std::vector<std::string>& lines, std::string_view term) -> std::string;
} // namespace rl
+19
View File
@@ -0,0 +1,19 @@
#pragma once
#include <filesystem>
#include <functional>
#include <string>
#include <string_view>
#include <vector>
namespace rl
{
struct process_result
{
int exit_code;
std::string error;
};
// Streams stdout; stderr is retained up to 4096 bytes for diagnostics.
[[nodiscard]] auto run_process(const std::vector<std::string>& args, const std::filesystem::path& directory,
const std::function<void(std::string_view)>& consume) noexcept -> process_result;
} // namespace rl
+3 -3
View File
@@ -10,8 +10,8 @@ namespace rl
class RepoLensToolAround final : public IRepoLensTool
{
public:
[[nodiscard]] auto execute(std::string_view args) noexcept -> exit_code override;
[[nodiscard]] auto execute(arguments args) noexcept -> exit_code override;
};
}
} // namespace rl
#endif //REPO_LENSE_TOOL_AROUND_HPP_INCLUDED
#endif // REPO_LENSE_TOOL_AROUND_HPP_INCLUDED
+3 -3
View File
@@ -10,8 +10,8 @@ namespace rl
class RepoLensToolFind final : public IRepoLensTool
{
public:
[[nodiscard]] auto execute(std::string_view args) noexcept -> exit_code override;
[[nodiscard]] auto execute(arguments args) noexcept -> exit_code override;
};
}
} // namespace rl
#endif //REPO_LENSE_TOOL_FIND_HPP_INCLUDED
#endif // REPO_LENSE_TOOL_FIND_HPP_INCLUDED
+12 -10
View File
@@ -2,6 +2,7 @@
#define REPO_LENSE_TOOL_INTERFACE_HPP_INCLUDED
#include <cstdint>
#include <span>
#include <string_view>
#pragma once
@@ -10,20 +11,21 @@ namespace rl
{
using exit_code = std::int32_t;
using arguments = std::span<const std::string_view>;
class IRepoLensTool
{
public:
IRepoLensTool() noexcept = default;
virtual ~IRepoLensTool() noexcept = default;
IRepoLensTool(const IRepoLensTool&) noexcept = delete;
IRepoLensTool(IRepoLensTool&&) noexcept = delete;
auto operator=(const IRepoLensTool&) noexcept -> IRepoLensTool& = delete;
auto operator=(IRepoLensTool&&) noexcept -> IRepoLensTool& = delete;
public:
IRepoLensTool() noexcept = default;
virtual ~IRepoLensTool() noexcept = default;
IRepoLensTool(const IRepoLensTool&) noexcept = delete;
IRepoLensTool(IRepoLensTool&&) noexcept = delete;
auto operator=(const IRepoLensTool&) noexcept -> IRepoLensTool& = delete;
auto operator=(IRepoLensTool&&) noexcept -> IRepoLensTool& = delete;
[[nodiscard]] virtual auto execute(std::string_view arguments) noexcept -> exit_code = 0;
[[nodiscard]] virtual auto execute(arguments args) noexcept -> exit_code = 0;
};
}
} // namespace rl
#endif //REPO_LENSE_TOOL_INTERFACE_HPP_INCLUDED
#endif // REPO_LENSE_TOOL_INTERFACE_HPP_INCLUDED
+3 -3
View File
@@ -10,8 +10,8 @@ namespace rl
class RepoLensToolMap final : public IRepoLensTool
{
public:
[[nodiscard]] auto execute(std::string_view args) noexcept -> exit_code override;
[[nodiscard]] auto execute(arguments args) noexcept -> exit_code override;
};
}
} // namespace rl
#endif //REPO_LENSE_TOOL_MAP_HPP_INCLUDED
#endif // REPO_LENSE_TOOL_MAP_HPP_INCLUDED