-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathopencode_command.hpp
More file actions
68 lines (52 loc) · 1.71 KB
/
Copy pathopencode_command.hpp
File metadata and controls
68 lines (52 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#pragma once
#include "../config/config.hpp"
#include <filesystem>
#include <functional>
#include <optional>
#include <string>
#include <vector>
namespace acecode {
struct OpencodeCommandInfo {
std::string name;
std::string description;
std::string agent;
std::string model;
std::string variant;
bool subtask = false;
bool has_subtask = false;
std::string template_text;
std::filesystem::path source_path;
};
struct ParsedSlashCommand {
std::string name;
std::string args;
};
struct OpencodeCommandExpansionOptions {
bool wrap_subtask_prompt = true;
};
std::vector<std::filesystem::path> opencode_command_config_roots(
const AppConfig& config,
const std::string& working_dir);
std::vector<OpencodeCommandInfo> load_opencode_commands_from_config_roots(
const std::vector<std::filesystem::path>& config_roots);
std::vector<OpencodeCommandInfo> load_opencode_commands(
const AppConfig& config,
const std::string& working_dir);
std::optional<OpencodeCommandInfo> find_opencode_command(
const AppConfig& config,
const std::string& working_dir,
const std::string& name);
std::optional<ParsedSlashCommand> parse_opencode_slash_command(
const std::string& input);
std::string expand_opencode_command_template(
const OpencodeCommandInfo& command,
const std::string& raw_args);
std::string build_opencode_subtask_prompt(
const OpencodeCommandInfo& command,
const std::string& expanded_prompt);
std::string expand_opencode_command(
const OpencodeCommandInfo& command,
const std::string& raw_args,
const OpencodeCommandExpansionOptions& options = {});
bool is_web_reserved_builtin_command(const std::string& name);
} // namespace acecode