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>
This commit is contained in:
2026-06-15 21:09:09 +02:00
parent 268d511f79
commit b332b0972b
38 changed files with 1907 additions and 0 deletions

53
core/src/core/client.h Normal file
View File

@@ -0,0 +1,53 @@
/*
* client.h — the implementation type behind the opaque `vc_client*` handle.
*
* M0 skeleton: holds config/callbacks/state and returns VC_ERR_NOT_IMPLEMENTED for
* everything that needs a subsystem. As subsystems land (docs/architecture.md §2), this
* class wires them together: a net transport, a protocol state machine, a session model,
* and an audio engine, plus the event thread that drains into vc_callbacks.on_event.
*/
#ifndef VOICECAT_CORE_CLIENT_H
#define VOICECAT_CORE_CLIENT_H
#include "voicecat.h"
struct vc_client {
vc_client(const vc_config& cfg, vc_callbacks cb);
~vc_client();
vc_client(const vc_client&) = delete;
vc_client& operator=(const vc_client&) = delete;
vc_result connect(const char* host, uint16_t port);
vc_result disconnect();
vc_result authenticate_guest(const char* nickname);
vc_result authenticate_user(const char* username, const char* password);
vc_result join_channel(uint32_t channel_id, const char* password);
vc_result leave_channel();
vc_result stream_start(const vc_stream_desc& desc, uint32_t* out_stream_id);
vc_result stream_stop(uint32_t stream_id);
vc_result set_input_device(uint32_t stream_id, const char* device_id);
vc_result set_input_mode(vc_input_mode mode);
vc_result set_push_to_talk(bool active);
vc_result set_self_mute(bool mic_muted, bool deafened);
vc_result set_remote_stream(uint32_t user_id, uint32_t stream_id, float gain, bool muted,
bool noise_reduction);
vc_result send_text(vc_text_scope scope, uint32_t target_id, const char* utf8);
vc_result list_devices(vc_device_kind kind, vc_device_list* out);
vc_connection_state state() const { return state_; }
private:
// Deliver an event to the host application. Safe to call with cb_.on_event == nullptr.
void emit(const vc_event& ev) const;
vc_config cfg_{};
vc_callbacks cb_{};
vc_connection_state state_ = VC_STATE_DISCONNECTED;
};
#endif // VOICECAT_CORE_CLIENT_H