feat(chat): Swift chat parity (abort/sessions/stream)
This commit is contained in:
@@ -4,6 +4,7 @@ public enum ClawdisChatTransportEvent: Sendable {
|
||||
case health(ok: Bool)
|
||||
case tick
|
||||
case chat(ClawdisChatEventPayload)
|
||||
case agent(ClawdisAgentEventPayload)
|
||||
case seqGap
|
||||
}
|
||||
|
||||
@@ -16,6 +17,9 @@ public protocol ClawdisChatTransport: Sendable {
|
||||
idempotencyKey: String,
|
||||
attachments: [ClawdisChatAttachmentPayload]) async throws -> ClawdisChatSendResponse
|
||||
|
||||
func abortRun(sessionKey: String, runId: String) async throws
|
||||
func listSessions(limit: Int?) async throws -> ClawdisChatSessionsListResponse
|
||||
|
||||
func requestHealth(timeoutMs: Int) async throws -> Bool
|
||||
func events() -> AsyncStream<ClawdisChatTransportEvent>
|
||||
|
||||
@@ -24,4 +28,18 @@ public protocol ClawdisChatTransport: Sendable {
|
||||
|
||||
extension ClawdisChatTransport {
|
||||
public func setActiveSessionKey(_: String) async throws {}
|
||||
|
||||
public func abortRun(sessionKey _: String, runId _: String) async throws {
|
||||
throw NSError(
|
||||
domain: "ClawdisChatTransport",
|
||||
code: 0,
|
||||
userInfo: [NSLocalizedDescriptionKey: "chat.abort not supported by this transport"])
|
||||
}
|
||||
|
||||
public func listSessions(limit _: Int?) async throws -> ClawdisChatSessionsListResponse {
|
||||
throw NSError(
|
||||
domain: "ClawdisChatTransport",
|
||||
code: 0,
|
||||
userInfo: [NSLocalizedDescriptionKey: "sessions.list not supported by this transport"])
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user