Add MonitorAlbumStream bidirectional streaming RPC with automatic and manual interaction modes

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/claude-agent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
Alexander
2026-05-11 10:26:37 +02:00
parent f5e2f764b5
commit 24f355c5ae
4 changed files with 2187 additions and 0 deletions
@@ -4,6 +4,7 @@ option go_package = "homelab.lan/music-agregator/gen/music_agregator/v1/";
service MusicAgregatorService {
rpc MonitorAlbum(MonitorAlbumRequest) returns (MonitorAlbumResponse) {}
rpc MonitorAlbumStream(stream MonitorAlbumStreamRequest) returns (stream MonitorAlbumStreamResponse) {}
rpc GetArtists(GetArtistsRequest) returns (GetArtistsResponse) {}
rpc GetAlbum(GetAlbumRequest) returns (GetAlbumResponse) {}
rpc AnalyzeAlbumRelease(AnalyzeAlbumReleaseRequest) returns (AnalyzeAlbumReleaseResponse) {}
@@ -161,3 +162,149 @@ message MonitoredRelease {
int32 seeders = 17;
string tracker = 18;
}
enum InteractionMode {
INTERACTION_MODE_AUTOMATIC = 0;
INTERACTION_MODE_MANUAL = 1;
}
enum MonitorStep {
MONITOR_STEP_UNSPECIFIED = 0;
MONITOR_STEP_FETCHING_METADATA = 1;
MONITOR_STEP_CHECKING_OWNED = 2;
MONITOR_STEP_SEARCHING_INDEXER = 3;
MONITOR_STEP_PARSING_RESULTS = 4;
MONITOR_STEP_FILTERING_QUALITY = 5;
MONITOR_STEP_SELECTING_RELEASE = 6;
MONITOR_STEP_ADDING_TORRENT = 7;
MONITOR_STEP_SAVING = 8;
MONITOR_STEP_COMPLETE = 9;
}
enum PromptType {
PROMPT_TYPE_UNSPECIFIED = 0;
PROMPT_TYPE_CONFIRM = 1;
PROMPT_TYPE_SELECT_ONE = 2;
PROMPT_TYPE_SELECT_MANY = 3;
}
message MonitorAlbumStreamRequest {
oneof message {
StartMonitorRequest start = 1;
UserDecision decision = 2;
CancelRequest cancel = 3;
}
}
message StartMonitorRequest {
string album_id = 1;
IndexerOptions indexer_options = 2;
QualityType quality = 3;
InteractionMode mode = 4;
}
message UserDecision {
string prompt_id = 1;
oneof decision {
bool confirm = 2;
string selected_id = 3;
SelectedIds selected_ids = 4;
}
}
message SelectedIds {
repeated string ids = 1;
}
message CancelRequest {}
message MonitorAlbumStreamResponse {
oneof message {
StatusUpdate status = 1;
PromptForDecision prompt = 2;
MonitorAlbumResponse result = 3;
ErrorUpdate error = 4;
}
}
message StatusUpdate {
MonitorStep step = 1;
string message = 2;
oneof data {
StreamAlbumInfo album_info = 10;
TorrentList torrents = 11;
ReleaseInfo release_info = 12;
}
}
message PromptForDecision {
string prompt_id = 1;
PromptType type = 2;
string message = 3;
int32 timeout_seconds = 4;
oneof options {
ConfirmPrompt confirm = 10;
SelectOnePrompt select_one = 11;
SelectManyPrompt select_many = 12;
}
}
message ErrorUpdate {
MonitorStep failed_step = 1;
string message = 2;
bool recoverable = 3;
}
message StreamAlbumInfo {
string artist = 1;
string title = 2;
string release_date = 3;
bool already_owned = 4;
string owned_quality = 5;
}
message TorrentList {
repeated TorrentSummary torrents = 1;
}
message TorrentSummary {
string id = 1;
string title = 2;
string tracker = 3;
int32 seeders = 4;
string format = 5;
bool lossless = 6;
}
message ReleaseInfo {
string info_hash = 1;
string format = 2;
int32 bit_depth = 3;
int32 sample_rate = 4;
int32 seeders = 5;
string tracker = 6;
}
message ConfirmPrompt {
string confirm_label = 1;
string cancel_label = 2;
bool default_value = 3;
}
message SelectOnePrompt {
repeated SelectOption options = 1;
string default_id = 2;
}
message SelectManyPrompt {
repeated SelectOption options = 1;
repeated string default_ids = 2;
int32 min_selections = 3;
int32 max_selections = 4;
}
message SelectOption {
string id = 1;
string label = 2;
string description = 3;
}