Watch: show subagent requests on the parent's card, and settle threads by swipe, Settle all and the thread screen
This commit is contained in:
1 parent
a4754b65b0
commit
cf8995e63f
16 files changed
+347
-31
No files matched your search
@@ -134,6 +134,13 @@ extension PendingRequest.Question {
|
||||
}
|
||||
|
||||
struct FeedItem: Codable, Hashable, Sendable, Identifiable {
|
||||
/// The subagent a request came from, when a thread delegated work and that work waits on you.
|
||||
struct Via: Codable, Hashable, Sendable {
|
||||
var hostId: String
|
||||
var threadId: String
|
||||
var title: String
|
||||
}
|
||||
|
||||
var hostId: String
|
||||
var hostLabel: String
|
||||
var threadId: String
|
||||
@@ -144,9 +151,17 @@ struct FeedItem: Codable, Hashable, Sendable, Identifiable {
|
||||
var updatedAt: Date
|
||||
var lastMessage: String?
|
||||
var request: PendingRequest?
|
||||
/// Set when `request` and `phase` belong to a subagent rather than this thread. Older gateways
|
||||
/// leave it out, which decodes as nil.
|
||||
var via: Via? = nil
|
||||
|
||||
var id: String { "\(hostId)/\(threadId)" }
|
||||
var route: Route { .thread(hostId: hostId, threadId: threadId) }
|
||||
|
||||
/// The thread that answers `request`: the subagent named in `via`, or this thread.
|
||||
var requestThread: (hostId: String, threadId: String) {
|
||||
via.map { ($0.hostId, $0.threadId) } ?? (hostId, threadId)
|
||||
}
|
||||
}
|
||||
|
||||
struct Feed: Codable, Hashable, Sendable {
|
||||
|
||||
Reference in new issue
Block a user