parity: full 61-tool catalog + select_tools, tag/secret helpers

This commit is contained in:
2026-10-24 07:05:42 +02:00
parent fc8ae44d96
commit a9bcb7cb16
5 changed files with 109 additions and 3 deletions
+1 -1
View File
@@ -1 +1 @@
0.1.2
1.44.2
+23
View File
@@ -0,0 +1,23 @@
#include "agent/tools.h"
#include <algorithm>
#include <cctype>
#include <set>
namespace detz::agent {
static std::set<std::string> words(const std::string& t){
std::set<std::string> w; std::string cur;
for(char c: t){ if(std::isalnum((unsigned char)c)) cur+=std::tolower(c); else { if(cur.size())w.insert(cur); cur.clear(); } }
if(cur.size())w.insert(cur); return w;
}
std::vector<std::string> SelectTools(const std::string& text){
auto w = words(text); std::vector<std::string> out;
for(auto& n: ToolNames()){
if(std::find(CoreTools().begin(),CoreTools().end(),n)!=CoreTools().end()){ out.push_back(n); continue; }
std::string tok; bool hit=false;
std::string cur;
for(char c: n+std::string("_")){ if(c=='_'){ if(cur.size()>=4&&w.count(cur))hit=true; cur.clear(); } else cur+=c; }
if(w.count(n)) hit=true;
if(hit) out.push_back(n);
}
return out;
}
} // namespace detz::agent
+30
View File
@@ -0,0 +1,30 @@
#pragma once
#include <string>
#include <vector>
namespace detz::agent {
// Full 61-tool catalog, mirrors tai.py TOOL_SCHEMAS order.
inline const std::vector<std::string>& ToolNames() {
static const std::vector<std::string> v = {
"shell","read_file","write_file","edit_file","web_search","describe_image",
"web_fetch","speak","listen","remember","recall","load_skill",
"get_current_terminal_content","list_terminals","tail_terminals",
"export_terminal_log","plexer_send","plexer_read","plexer_type",
"plexer_status","plexer_show","tui_screen","tui_keys","tui_type",
"tui_click","tui_goto","tui_result","fork","poll","ask_user","sysinfo",
"create_skill","install_skill","store_secret","list_secrets","delete_secret",
"schedule","unschedule","schedules","record_save","record_read",
"record_search","record_delete","graph_link","graph_query","delete_file",
"audit","restore","release","tags","install","create_bot","search",
"mcp_add","mcp_list","mcp_enable","mcp_disable","mcp_remove","mcp_tools",
"mcp_call","mcp_login"};
return v;
}
inline const std::vector<std::string>& CoreTools() {
static const std::vector<std::string> v = {
"shell","read_file","write_file","remember","recall","load_skill",
"fork","poll","ask_user"};
return v;
}
// select_tools mirror: core always picked; others picked on token/tag match.
std::vector<std::string> SelectTools(const std::string& text);
} // namespace detz::agent
+55
View File
@@ -0,0 +1,55 @@
# tai CAP agent manifest. Emitted by `tai.py --cap-manifest`.
[agent]
name = "tai"
binary = "tai.py"
profiles = ["coding"]
[probe]
command = ["tai.py", "--version"]
version_pattern = "tai (\\\\d+\\\\.\\\\d+\\\\.\\\\d+)"
[startup]
command = ["tai.py"]
ready_when = { pattern = "type /help for commands" }
init_timeout_seconds = 60
[fast_path]
stream_json = ["tai.py", "--cap-speak"]
grpc = false
acp_stdio = false
a2a_serve_at = false
[pty]
cols = 200
rows = 50
bracketed_paste = false
sigint_cancels_turn = "graceful"
queued_input_supported = false
[parse]
idle = ["^tai\\\\[.*\\\\]› $"]
error_lines = ["^seal error:", "^sandbox unavailable:"]
[capabilities]
streaming_output = true
queued_input = false
mid_turn_cancel = "graceful"
multi_session = true
input_modalities = ["text"]
output_modalities = ["text"]
[capabilities.ask_user]
yes_no = true
options = false
free_text = true
[capabilities.coding]
revision = "2026-05-18"
fs = { read = true, write = true, list = true, exists = true, scope = "workspace_only" }
terminal = { enabled = true, concurrent_max = 4 }
tool_permission = "interactive"
artifacts = ["diff", "transcript"]
[cost]
metered = true
currency = "USD"
-2
View File
@@ -3,8 +3,6 @@
// Mocked transport only in tests; no real network here.
#include <functional>
#include <stdexcept>
#include <stdexcept>
#include <stdexcept>
#include <map>
#include <optional>
#include <string>