#include "rpc/dispatcher.hpp" namespace velox::daemon::rpc { namespace proto = velox::proto; namespace { // A method whose body arrives with the store / scheduler. Answers -32603 with a clear // message through the generated HandlerError channel (contracts/ 1.4.0, ADR 0014). template proto::HandlerResult not_implemented(const char* method) { return std::unexpected(proto::HandlerError{ proto::ErrorCode::InternalError, std::string("not implemented in this build: ") + method}); } } // namespace // --- session.* : handled in the server layer, unreachable here in the running daemon --- // Kept as explicit stubs so a direct dispatch() caller (a test, a future in-process client) // gets a clear answer rather than undefined behaviour from a missing override. proto::HandlerResult VeloxDispatcher::on_session_hello(const proto::SessionHelloParams&) { return not_implemented("session.hello"); } proto::HandlerResult VeloxDispatcher::on_session_pair(const proto::SessionPairParams&) { return not_implemented("session.pair"); } proto::HandlerResult VeloxDispatcher::on_session_subscribe(const proto::SessionSubscribeParams&) { return not_implemented("session.subscribe"); } // --- download.list : an empty table, so a client can connect and render --------------- proto::HandlerResult VeloxDispatcher::on_download_list(const proto::DownloadListParams&) { proto::DownloadListResult r; r.total = 0; return r; } // --- everything else : not implemented until the store and scheduler land ------------- proto::HandlerResult VeloxDispatcher::on_capture_getRules(const proto::CaptureGetRulesParams&) { return not_implemented("capture.getRules"); } proto::HandlerResult VeloxDispatcher::on_capture_offer(const proto::CaptureOfferParams&) { return not_implemented("capture.offer"); } proto::HandlerResult VeloxDispatcher::on_category_list(const proto::CategoryListParams&) { return not_implemented("category.list"); } proto::HandlerResult VeloxDispatcher::on_category_remove(const proto::CategoryRemoveParams&) { return not_implemented("category.remove"); } proto::HandlerResult VeloxDispatcher::on_category_upsert(const proto::CategoryUpsertParams&) { return not_implemented("category.upsert"); } proto::HandlerResult VeloxDispatcher::on_download_add(const proto::DownloadSpec&) { return not_implemented("download.add"); } proto::HandlerResult VeloxDispatcher::on_download_addBatch(const proto::DownloadAddBatchParams&) { return not_implemented("download.addBatch"); } proto::HandlerResult VeloxDispatcher::on_download_cancel(const proto::DownloadCancelParams&) { return not_implemented("download.cancel"); } proto::HandlerResult VeloxDispatcher::on_download_get(const proto::DownloadGetParams& params) { // No store is wired yet, so no task exists and every id is genuinely not-found. This // is the real -32010 answer (contracts/ error fixture download.get.not-found), not a // placeholder; it becomes a store lookup when store/ is wired in. return std::unexpected(proto::HandlerError{proto::ErrorCode::TaskNotFound, "no such task", nlohmann::json{{"taskId", params.taskId}}}); } proto::HandlerResult VeloxDispatcher::on_download_pause(const proto::DownloadPauseParams&) { return not_implemented("download.pause"); } proto::HandlerResult VeloxDispatcher::on_download_probe(const proto::DownloadProbeParams&) { return not_implemented("download.probe"); } proto::HandlerResult VeloxDispatcher::on_download_provideAuth(const proto::DownloadProvideAuthParams&) { return not_implemented("download.provideAuth"); } proto::HandlerResult VeloxDispatcher::on_download_refreshUrl(const proto::DownloadRefreshUrlParams&) { return not_implemented("download.refreshUrl"); } proto::HandlerResult VeloxDispatcher::on_download_remove(const proto::DownloadRemoveParams&) { return not_implemented("download.remove"); } proto::HandlerResult VeloxDispatcher::on_download_resume(const proto::DownloadResumeParams&) { return not_implemented("download.resume"); } proto::HandlerResult VeloxDispatcher::on_download_start(const proto::DownloadStartParams&) { return not_implemented("download.start"); } proto::HandlerResult VeloxDispatcher::on_download_update(const proto::DownloadUpdateParams&) { return not_implemented("download.update"); } proto::HandlerResult VeloxDispatcher::on_grabber_harvest(const proto::GrabberHarvestParams&) { return not_implemented("grabber.harvest"); } proto::HandlerResult VeloxDispatcher::on_grabber_start(const proto::GrabberStartParams&) { return not_implemented("grabber.start"); } proto::HandlerResult VeloxDispatcher::on_grabber_status(const proto::GrabberStatusParams&) { return not_implemented("grabber.status"); } proto::HandlerResult VeloxDispatcher::on_limiter_get(const proto::LimiterGetParams&) { return not_implemented("limiter.get"); } proto::HandlerResult VeloxDispatcher::on_limiter_set(const proto::Limiter&) { return not_implemented("limiter.set"); } proto::HandlerResult VeloxDispatcher::on_media_addVariant(const proto::MediaAddVariantParams&) { return not_implemented("media.addVariant"); } proto::HandlerResult VeloxDispatcher::on_media_listVariants(const proto::MediaListVariantsParams&) { return not_implemented("media.listVariants"); } proto::HandlerResult VeloxDispatcher::on_queue_list(const proto::QueueListParams&) { return not_implemented("queue.list"); } proto::HandlerResult VeloxDispatcher::on_queue_reorder(const proto::QueueReorderParams&) { return not_implemented("queue.reorder"); } proto::HandlerResult VeloxDispatcher::on_queue_start(const proto::QueueStartParams&) { return not_implemented("queue.start"); } proto::HandlerResult VeloxDispatcher::on_queue_stop(const proto::QueueStopParams&) { return not_implemented("queue.stop"); } proto::HandlerResult VeloxDispatcher::on_queue_upsert(const proto::QueueUpsertParams&) { return not_implemented("queue.upsert"); } proto::HandlerResult VeloxDispatcher::on_rules_list(const proto::RulesListParams&) { return not_implemented("rules.list"); } proto::HandlerResult VeloxDispatcher::on_rules_upsert(const proto::RulesUpsertParams&) { return not_implemented("rules.upsert"); } proto::HandlerResult VeloxDispatcher::on_schedule_get(const proto::ScheduleGetParams&) { return not_implemented("schedule.get"); } proto::HandlerResult VeloxDispatcher::on_schedule_set(const proto::ScheduleSetParams&) { return not_implemented("schedule.set"); } proto::HandlerResult VeloxDispatcher::on_settings_get(const proto::SettingsGetParams&) { return not_implemented("settings.get"); } proto::HandlerResult VeloxDispatcher::on_settings_set(const proto::SettingsSetParams&) { return not_implemented("settings.set"); } } // namespace velox::daemon::rpc