4aee356486
- Proto definitions for SearchRequest/SearchResponse/SearchResult - SearchService implementing MusicFs trait - Query validation (empty check, 256 char max, limit cap at 10k) - Streaming support via tokio mpsc channel Ultraworked with [Sisyphus](https://github.com/code-yeongyu/claude-agent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
32 lines
659 B
Protocol Buffer
32 lines
659 B
Protocol Buffer
syntax = "proto3";
|
|
|
|
package musicfs.v1;
|
|
|
|
service MusicFS {
|
|
rpc Search(SearchRequest) returns (SearchResponse);
|
|
rpc SearchStream(SearchRequest) returns (stream SearchResult);
|
|
}
|
|
|
|
message SearchRequest {
|
|
string query = 1;
|
|
optional uint32 limit = 2;
|
|
optional uint32 offset = 3;
|
|
optional string origin_id = 4;
|
|
}
|
|
|
|
message SearchResponse {
|
|
repeated SearchResult results = 1;
|
|
uint64 total_matches = 2;
|
|
uint32 query_time_ms = 3;
|
|
}
|
|
|
|
message SearchResult {
|
|
int64 file_id = 1;
|
|
string virtual_path = 2;
|
|
optional string artist = 3;
|
|
optional string album = 4;
|
|
optional string title = 5;
|
|
float score = 6;
|
|
map<string, string> highlights = 7;
|
|
}
|