Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 27 additions & 2 deletions proto/agynio/api/chat/v1/chat.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ service ChatService {
rpc UpdateChat(UpdateChatRequest) returns (UpdateChatResponse);

// List messages in a chat with pagination.
// Returns an unread_count derived from Threads.GetUnackedMessages.
// Returns an unread_count derived from Threads.GetUnackedMessageCounts.
// Read-only — does not change acknowledgment state.
rpc GetMessages(GetMessagesRequest) returns (GetMessagesResponse);

Expand All @@ -52,6 +52,19 @@ enum ChatStatus {
CHAT_STATUS_CLOSED = 2;
}

enum ChatActivityStatus {
// No workload activity data available (no non-passive agent participants
// or the thread is degraded).
CHAT_ACTIVITY_STATUS_UNSPECIFIED = 0;
// At least one most recent workload is running.
CHAT_ACTIVITY_STATUS_RUNNING = 1;
// At least one most recent workload is starting, stopping, or failed
// (non-degraded), and none are running.
CHAT_ACTIVITY_STATUS_PENDING = 2;
// All most recent workloads are stopped or absent.
CHAT_ACTIVITY_STATUS_FINISHED = 3;
}

// A chat thread between participants.
message Chat {
string id = 1; // UUID — maps to Threads thread_id
Expand All @@ -61,6 +74,18 @@ message Chat {
string organization_id = 5; // UUID — owning organization
ChatStatus status = 6;
optional string summary = 7;
// Workload activity summary for the chat. Derived from the most recent
// workload per (thread, agent) with aggregation RUNNING > PENDING > FINISHED.
// PENDING includes starting, stopping, and (non-degraded) failed workloads,
// so it may be set even when active_workload_ids is empty. UNSPECIFIED when
// workload activity is not tracked for this chat.
ChatActivityStatus activity_status = 8;
Comment thread
noa-lucent marked this conversation as resolved.
Comment thread
noa-lucent marked this conversation as resolved.
// Unacknowledged message count for the authenticated user in this chat.
// Derived from Threads.GetUnackedMessageCounts (missing entry => 0).
int32 unread_count = 9;
Comment thread
noa-lucent marked this conversation as resolved.
// Workload IDs in starting, running, or stopping state for this chat.
// Failed and stopped workloads are excluded.
repeated string active_workload_ids = 10;
}

// A participant in a chat.
Expand Down Expand Up @@ -138,7 +163,7 @@ message GetMessagesResponse {
repeated ChatMessage messages = 1;
string next_page_token = 2;
// Number of unacknowledged messages for the authenticated user in this
// chat. Derived from Threads.GetUnackedMessages.
// chat. Derived from Threads.GetUnackedMessageCounts (missing entry => 0).
int32 unread_count = 3;
}

Expand Down
1 change: 1 addition & 0 deletions proto/agynio/api/gateway/v1/threads.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ service ThreadsGateway {
rpc GetThread(agynio.api.threads.v1.GetThreadRequest) returns (agynio.api.threads.v1.GetThreadResponse);
rpc GetMessages(agynio.api.threads.v1.GetMessagesRequest) returns (agynio.api.threads.v1.GetMessagesResponse);
rpc GetUnackedMessages(agynio.api.threads.v1.GetUnackedMessagesRequest) returns (agynio.api.threads.v1.GetUnackedMessagesResponse);
rpc GetUnackedMessageCounts(agynio.api.threads.v1.GetUnackedMessageCountsRequest) returns (agynio.api.threads.v1.GetUnackedMessageCountsResponse);
rpc AckMessages(agynio.api.threads.v1.AckMessagesRequest) returns (agynio.api.threads.v1.AckMessagesResponse);
}
17 changes: 17 additions & 0 deletions proto/agynio/api/threads/v1/threads.proto
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ service ThreadsService {
// List unacknowledged messages for a participant across all threads.
rpc GetUnackedMessages(GetUnackedMessagesRequest) returns (GetUnackedMessagesResponse);

// Get unacknowledged message counts per thread for a participant.
rpc GetUnackedMessageCounts(GetUnackedMessageCountsRequest) returns (GetUnackedMessageCountsResponse);

// Acknowledge messages as processed by a participant.
rpc AckMessages(AckMessagesRequest) returns (AckMessagesResponse);
}
Expand Down Expand Up @@ -337,6 +340,20 @@ message GetUnackedMessagesResponse {
string next_page_token = 2;
}

// ===========================================================================
// GetUnackedMessageCounts
// ===========================================================================

message GetUnackedMessageCountsRequest {
string participant_id = 1; // UUID
}

message GetUnackedMessageCountsResponse {
// key = thread_id, value = unacknowledged message count.
// Only threads with unacknowledged messages are included (missing key => 0).
map<string, int32> counts_by_thread_id = 1;
Comment thread
noa-lucent marked this conversation as resolved.
}

// ===========================================================================
// AckMessages
// ===========================================================================
Expand Down
Loading