syntax = "proto3";

package flare.common.v1;


// 存储分片与游标；同步 API 见 sync.proto。

// 存储分片键（按会话分片）
message StorageShardKey {
  string tenant_id = 1;
  string conversation_id = 2;
  uint32 partition_id = 3;
}

/// 会话内游标（存储/拉取锚点；同步 API 见 sync.proto SyncRequest.last_seq / next_cursor）
message StorageCursor {
  string conversation_id = 1;
  uint64 seq = 2;
  int64 created_at = 3;
  string cursor_token = 4;
}

/// 范围查询（主查 conversation_id + seq 或 time；去重 client_msg_id）
message StorageRangeQuery {
  string conversation_id = 1;
  uint64 from_seq = 2;
  uint64 to_seq = 3;
  optional int64 from_time = 4;
  optional int64 to_time = 5;
  int32 limit = 6;
  string cursor = 7;
}

// 会话限流与推送策略（可选）

message ConversationStreamConfig {
  string conversation_id = 1;
  int32 send_rate_limit_per_second = 2;
  optional int32 member_count = 3;
  bool push_summary_only = 4;
}
