Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/actions/action_registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,18 @@ void ActionRegistry::set_enabled(const std::string& name, bool enabled) {
enabled_.erase(name);
}

void ActionRegistry::disable_all() {
enabled_.clear();
}

void ActionRegistry::reset_to_defaults() {
enabled_.clear();
for (auto& [name, entry] : actions_) {
if (entry.def.default_enabled)
enabled_.insert(name);
}
}

bool ActionRegistry::is_enabled(const std::string& name) const {
return enabled_.count(name) > 0;
}
Expand Down
2 changes: 2 additions & 0 deletions src/actions/action_registry.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ class ActionRegistry {

// Enable/disable actions for LLM visibility
void set_enabled(const std::string& name, bool enabled);
void disable_all();
void reset_to_defaults();
bool is_enabled(const std::string& name) const;
std::vector<std::string> list_enabled_actions() const;
int num_enabled() const;
Expand Down
2 changes: 1 addition & 1 deletion src/actions/notes_actions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void register_notes_actions(ActionRegistry& registry) {
registry.register_action(
{"create_note", "Create a new note in Apple Notes",
"{\"title\": \"note title\"}",
true,
false,
"productivity",
"Create a note called Meeting Notes",
"rcli action create_note '{\"title\": \"Meeting Notes\"}'"},
Expand Down
2 changes: 1 addition & 1 deletion src/actions/reminders_actions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void register_reminders_actions(ActionRegistry& registry) {
registry.register_action(
{"create_reminder", "Create a reminder in Apple Reminders",
"{\"title\": \"reminder text\"}",
true,
false,
"productivity",
"Remind me to buy groceries",
"rcli action create_reminder '{\"title\": \"Buy groceries\"}'"},
Expand Down
10 changes: 5 additions & 5 deletions src/actions/system_actions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ void register_system_actions(ActionRegistry& registry) {
registry.register_action(
{"get_battery", "Get battery percentage and charging status",
"{}",
true,
false,
"system",
"What's my battery level?",
"rcli action get_battery '{}'"},
Expand All @@ -267,7 +267,7 @@ void register_system_actions(ActionRegistry& registry) {
registry.register_action(
{"get_wifi", "Get the current Wi-Fi network name",
"{}",
true,
false,
"system",
"What Wi-Fi am I connected to?",
"rcli action get_wifi '{}'"},
Expand Down Expand Up @@ -312,7 +312,7 @@ void register_system_actions(ActionRegistry& registry) {
registry.register_action(
{"empty_trash", "Empty the Trash",
"{}",
true,
false,
"system",
"Empty my trash",
"rcli action empty_trash '{}'"},
Expand All @@ -330,7 +330,7 @@ void register_system_actions(ActionRegistry& registry) {
registry.register_action(
{"set_brightness", "Set screen brightness (0-100)",
"{\"level\": \"0-100\"}",
true,
false,
"system",
"Set brightness to 50 percent",
"rcli action set_brightness '{\"level\": \"50\"}'"},
Expand All @@ -339,7 +339,7 @@ void register_system_actions(ActionRegistry& registry) {
registry.register_action(
{"toggle_do_not_disturb", "Toggle Do Not Disturb / Focus mode",
"{}",
true,
false,
"system",
"Turn on do not disturb",
"rcli action toggle_do_not_disturb '{}'"},
Expand Down
Loading
Loading