Skip to content

feat(sessions): add message, attachment upload and event subscribe - #108

Open
ysyneu wants to merge 1 commit into
mainfrom
feat/session-message-subscribe
Open

ysyneu wants to merge 1 commit into
mainfrom
feat/session-message-subscribe

Conversation

@ysyneu

@ysyneu ysyneu commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

Adds the AI SRE session conversation surface to the SDK:

  • WriteCreate / WriteMessage send a message to a session, with optional surface, delivery_mode (reply_only) and file parts.
  • UploadAttachment posts a file to /safari/attachment/upload; SessionAttachment.FilePart() turns the result into a message part.
  • Subscribe opens the /safari/session/subscribe SSE stream with a resume cursor (no client timeout); NewSessionFrameReader decodes frames; stream errors surface as SessionStreamError.
  • openStream is shared by export and subscribe.

go test ./... and golangci-lint v2.13.0: 0 issues.

Needed by the flashduty safari send / safari watch CLI commands; a release tag is needed before the CLI PR can drop its local replace.

- WriteCreate / WriteMessage send a message to an AI SRE session, with
  optional surface and delivery_mode (reply_only) and file parts.
- UploadAttachment posts a file to /safari/attachment/upload and returns a
  SessionAttachment whose FilePart() can be attached to a message.
- Subscribe opens the /safari/session/subscribe SSE stream with a resume
  cursor; NewSessionFrameReader decodes frames, and stream errors surface as
  SessionStreamError. The stream uses a client copy without a timeout.
- openStream is shared by export and subscribe.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant