Adapters in src/glue for all ports of agent/ports.h (store, runtime, shell, ui, mcp, skills, plexer, tui, ops, scheduler db), llm log sink and box, repl::ReplHost over agent::Agent, cap-speak, serve-mcp, telegram and tui-local seams. main.cpp dispatches the flags in tai.py main() order. Tests: tests/glue_persist.py (real model, restart persistence, one-shot shell call), tests/glue_flags.py, tests/glue_ports.cpp. Spec: docs/glue.md, gaps: docs/glue-issues.md. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
24 lines
728 B
C++
24 lines
728 B
C++
// detz entry point: parse the command line and hand it to the glue (docs/glue.md).
|
|
#include <unistd.h>
|
|
#include <climits>
|
|
#include <string>
|
|
#include "cli/cli.h"
|
|
#include "glue/glue_app.h"
|
|
#include "version.hpp"
|
|
|
|
namespace {
|
|
std::string running_binary(const char* argv0) {
|
|
char buf[PATH_MAX];
|
|
ssize_t n = readlink("/proc/self/exe", buf, sizeof buf - 1);
|
|
if (n > 0) return std::string(buf, static_cast<size_t>(n));
|
|
return argv0 ? argv0 : "detz";
|
|
}
|
|
} // namespace
|
|
|
|
int main(int argc, char** argv) {
|
|
detz::cli::Parser parser;
|
|
detz::cli::Options options = parser.parseOpts(argc, argv);
|
|
detz::glue::GlueApp app(options, std::string(detz::kVersion), running_binary(argc > 0 ? argv[0] : nullptr));
|
|
return app.run();
|
|
}
|