Skip to content

Swift SDK: inbox management (TS participant SDK parity) #1151

Description

@willwashburn

What the TS participant SDK provides

AgentRelay.inbox (packages/sdk/src/agent-relay.ts) exposes RelayMessaging['inbox'] (packages/sdk/src/messaging/types.ts, readonly inbox):

  • get(options?): Promise<RelayInbox> — inbox summary (channels, DMs, reactions, unread counts).
  • list(input?): Promise<InboxListResult> — list inbox items.
  • subscribe(input?): AsyncIterable<InboxItem> — stream inbox items.
  • ack / fail / defer / markRead — per-item delivery disposition, each returning RelayDeliveryResult.

What the Swift AgentRelaySDK lacks

AgentClient has no inbox surface. There is no inbox summary, no item listing, no inbox-scoped subscription, and no ack/fail/defer/markRead controls. (Note: this overlaps conceptually with delivery tracking, but the inbox APIs are item-oriented and have their own listing/subscription model — see the separate deliveries issue.)

Proposed Swift API sketch

public struct RelayInbox: Decodable, Sendable { /* summary */ }
public struct InboxItem: Decodable, Sendable {}

extension AgentClient {
    public func inbox(limit: Int? = nil) async throws -> RelayInbox
    public func inboxItems(/* filters */) async throws -> [InboxItem]
    public func inboxStream(/* filters */) -> AsyncStream<InboxItem>
    public func ack(inboxItem id: String) async throws
    public func fail(inboxItem id: String, reason: String?) async throws
    public func defer(inboxItem id: String, until: Date?) async throws
    public func markRead(inboxItem id: String) async throws
}

Part of bringing the Swift AgentRelaySDK to parity with the TS participant SDK (follow-up to #1143 / #1147).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions