e2e: main->RunTurn->RegisterAll executors; gated dispatch
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
#include "cli/cli.h"
|
||||
#include "agent/agent.h"
|
||||
#include "agent/exec.h"
|
||||
#include "agent/loop.h"
|
||||
#include "llm/llm.h"
|
||||
#include "version.hpp"
|
||||
#include <cstdio>
|
||||
#include <string>
|
||||
@@ -6,5 +10,12 @@ int main(int argc, char** argv){
|
||||
detz::cli::Parser p; auto cmd = p.parse(argc, argv);
|
||||
if(cmd.opts.version){ std::puts(std::string(detz::kVersion).c_str()); return 0; }
|
||||
if(cmd.opts.cap_manifest){ std::fputs("# tai CAP agent manifest\n", stdout); return 0; }
|
||||
if(cmd.name=="run" && !cmd.args.empty()){
|
||||
detz::agent::ToolRegistry reg; detz::agent::RegisterAll(reg, ".");
|
||||
std::string prompt; for(auto& a: cmd.args) prompt += a + " ";
|
||||
auto r = detz::agent::RunTurn(reg, prompt);
|
||||
std::fputs(r.output.c_str(), stdout);
|
||||
return r.ok?0:1;
|
||||
}
|
||||
return cmd.run();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user