scaffold: M0 skeleton + agent onboarding (build, architecture, progress)
Turn the design into a buildable, dependency-free M0 skeleton plus the
onboarding layer so a new agent can pick up instantly.
Build system:
- CMake + CMakePresets (dev = no deps; server-release = vcpkg) + vcpkg.json
- Skeleton builds with just a C++20 compiler; deps stay off until needed
- .gitattributes (LF), .gitignore, .clang-format
Core (libvoicecat):
- core/include/voicecat.h: full C ABI (the client/server contract), stubbed
- core/proto/voicecat.proto: control-plane wire format, matches docs/protocol.md
- src/{net,crypto,codec,protocol,session,audio,core}: subsystem stubs that
return VC_ERR_NOT_IMPLEMENTED, each pointing to its design doc
- server/ (voicecat-server) and tools/vccli/ link the core
- tests/: CTest smoke test asserting the C ABI contract (behavior, not just build)
- clients/{apple,windows}: M4 placeholders
Onboarding for agents:
- CLAUDE.md: hub — build/test commands, architecture at a glance, doc map, rules
- AGENTS.md: working method (behavior-driven; clean compile is the floor not the goal)
- PROGRESS.md: living tracker — M0 done, M1 task checklist, "where we left off"
Verified: cmake --preset dev && cmake --build --preset dev && ctest --preset dev → green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 21:09:09 +02:00
|
|
|
/*
|
docs: add build/manual-testing guide, fix stale M0 stub claims in headers
- docs/building.md: explains what each CMake preset (dev, m1-dev, m2-dev,
server-release) is actually for, and how to build voicecat-server + vccli
for manual testing. Linked from CLAUDE.md's doc index.
- core/include/voicecat.h, core/src/voicecat.cpp, core/src/protocol/protocol.h,
server/src/main.cpp: doc-header comments still claimed M0-skeleton/stub
behavior (VC_ERR_NOT_IMPLEMENTED everywhere, "prints what it would do",
protobuf codegen "commented") that M1-M3 made real. Updated to describe
current behavior, with the dev-preset stub fallback noted explicitly where
it still applies.
2026-06-16 16:30:07 +02:00
|
|
|
* voicecat-server entry point.
|
scaffold: M0 skeleton + agent onboarding (build, architecture, progress)
Turn the design into a buildable, dependency-free M0 skeleton plus the
onboarding layer so a new agent can pick up instantly.
Build system:
- CMake + CMakePresets (dev = no deps; server-release = vcpkg) + vcpkg.json
- Skeleton builds with just a C++20 compiler; deps stay off until needed
- .gitattributes (LF), .gitignore, .clang-format
Core (libvoicecat):
- core/include/voicecat.h: full C ABI (the client/server contract), stubbed
- core/proto/voicecat.proto: control-plane wire format, matches docs/protocol.md
- src/{net,crypto,codec,protocol,session,audio,core}: subsystem stubs that
return VC_ERR_NOT_IMPLEMENTED, each pointing to its design doc
- server/ (voicecat-server) and tools/vccli/ link the core
- tests/: CTest smoke test asserting the C ABI contract (behavior, not just build)
- clients/{apple,windows}: M4 placeholders
Onboarding for agents:
- CLAUDE.md: hub — build/test commands, architecture at a glance, doc map, rules
- AGENTS.md: working method (behavior-driven; clean compile is the floor not the goal)
- PROGRESS.md: living tracker — M0 done, M1 task checklist, "where we left off"
Verified: cmake --preset dev && cmake --build --preset dev && ctest --preset dev → green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 21:09:09 +02:00
|
|
|
*
|
docs: add build/manual-testing guide, fix stale M0 stub claims in headers
- docs/building.md: explains what each CMake preset (dev, m1-dev, m2-dev,
server-release) is actually for, and how to build voicecat-server + vccli
for manual testing. Linked from CLAUDE.md's doc index.
- core/include/voicecat.h, core/src/voicecat.cpp, core/src/protocol/protocol.h,
server/src/main.cpp: doc-header comments still claimed M0-skeleton/stub
behavior (VC_ERR_NOT_IMPLEMENTED everywhere, "prints what it would do",
protobuf codegen "commented") that M1-M3 made real. Updated to describe
current behavior, with the dev-preset stub fallback noted explicitly where
it still applies.
2026-06-16 16:30:07 +02:00
|
|
|
* Goal (docs/deployment.md): one command, zero config, encrypted + listening. Parses flags
|
|
|
|
|
* (see docs/building.md for the full list + manual-testing walkthrough) and hands off to
|
|
|
|
|
* Server::run() (server.cpp), which really does generate the identity/cert, open the SQLite
|
|
|
|
|
* store, and bind the TCP/TLS + UDP listeners.
|
scaffold: M0 skeleton + agent onboarding (build, architecture, progress)
Turn the design into a buildable, dependency-free M0 skeleton plus the
onboarding layer so a new agent can pick up instantly.
Build system:
- CMake + CMakePresets (dev = no deps; server-release = vcpkg) + vcpkg.json
- Skeleton builds with just a C++20 compiler; deps stay off until needed
- .gitattributes (LF), .gitignore, .clang-format
Core (libvoicecat):
- core/include/voicecat.h: full C ABI (the client/server contract), stubbed
- core/proto/voicecat.proto: control-plane wire format, matches docs/protocol.md
- src/{net,crypto,codec,protocol,session,audio,core}: subsystem stubs that
return VC_ERR_NOT_IMPLEMENTED, each pointing to its design doc
- server/ (voicecat-server) and tools/vccli/ link the core
- tests/: CTest smoke test asserting the C ABI contract (behavior, not just build)
- clients/{apple,windows}: M4 placeholders
Onboarding for agents:
- CLAUDE.md: hub — build/test commands, architecture at a glance, doc map, rules
- AGENTS.md: working method (behavior-driven; clean compile is the floor not the goal)
- PROGRESS.md: living tracker — M0 done, M1 task checklist, "where we left off"
Verified: cmake --preset dev && cmake --build --preset dev && ctest --preset dev → green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 21:09:09 +02:00
|
|
|
*/
|
|
|
|
|
#include <cstdio>
|
|
|
|
|
#include <cstring>
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
|
|
#include "server.h"
|
|
|
|
|
#include "voicecat.h"
|
|
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
|
|
|
|
void print_help(const char* argv0) {
|
|
|
|
|
std::printf(
|
|
|
|
|
"voicecat-server %s\n\n"
|
|
|
|
|
"Usage: %s [options]\n"
|
|
|
|
|
" --port <n> control+media port (default 8384)\n"
|
|
|
|
|
" --data-dir <path> data directory (default ./voicecat-data)\n"
|
|
|
|
|
" --name <name> server name\n"
|
|
|
|
|
" --no-guests disable guest access\n"
|
|
|
|
|
" --print-config print effective config and exit\n"
|
|
|
|
|
" --version print version and exit\n"
|
|
|
|
|
" --help this help\n",
|
|
|
|
|
vc_version_string(), argv0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
|
|
int main(int argc, char** argv) {
|
|
|
|
|
voicecat::server::Config cfg;
|
|
|
|
|
bool print_config_only = false;
|
|
|
|
|
|
|
|
|
|
for (int i = 1; i < argc; ++i) {
|
|
|
|
|
const char* a = argv[i];
|
|
|
|
|
auto next = [&]() -> const char* { return (i + 1 < argc) ? argv[++i] : ""; };
|
|
|
|
|
if (std::strcmp(a, "--help") == 0) {
|
|
|
|
|
print_help(argv[0]);
|
|
|
|
|
return 0;
|
|
|
|
|
} else if (std::strcmp(a, "--version") == 0) {
|
|
|
|
|
std::printf("voicecat-server %s (protocol v%d)\n", vc_version_string(),
|
|
|
|
|
VOICECAT_PROTOCOL_VERSION);
|
|
|
|
|
return 0;
|
|
|
|
|
} else if (std::strcmp(a, "--port") == 0) {
|
|
|
|
|
cfg.bind_port = static_cast<uint16_t>(std::atoi(next()));
|
|
|
|
|
} else if (std::strcmp(a, "--data-dir") == 0) {
|
|
|
|
|
cfg.data_dir = next();
|
|
|
|
|
} else if (std::strcmp(a, "--name") == 0) {
|
|
|
|
|
cfg.server_name = next();
|
|
|
|
|
} else if (std::strcmp(a, "--no-guests") == 0) {
|
|
|
|
|
cfg.allow_guests = false;
|
|
|
|
|
} else if (std::strcmp(a, "--print-config") == 0) {
|
|
|
|
|
print_config_only = true;
|
|
|
|
|
} else {
|
|
|
|
|
std::fprintf(stderr, "unknown option: %s (try --help)\n", a);
|
|
|
|
|
return 2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::printf("[voicecat-server %s] starting\n", vc_version_string());
|
|
|
|
|
voicecat::server::Server server(cfg);
|
|
|
|
|
if (print_config_only) {
|
|
|
|
|
// run() currently just prints config; in M1 split this into a pure config dump.
|
|
|
|
|
}
|
|
|
|
|
return server.run();
|
|
|
|
|
}
|