Skip to content

Commit 019972c

Browse files
committed
multi: Add session-scoped attachment upload flow
Add an attachment upload pipeline that streams photo/file data from iOS to the paired terminal session over RPC, avoiding server-side message persistence for binary payloads. Implement begin/chunk/commit/cancel handlers in the CLI session manager, with size limits and temp-file cleanup, and wire iOS composer UI controls for photo/files pickers, attachment chips, and send gating for ready attachments. Fix attachment RPC decoding to support wrapped result payloads so upload begin/chunk/commit responses are interpreted correctly.
1 parent bdf9983 commit 019972c

7 files changed

Lines changed: 1292 additions & 76 deletions

File tree

cli/internal/session/manager.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ type Manager struct {
8080
sessionActorClosed chan struct{}
8181

8282
lastTerminalKeepAliveSkipAt time.Time
83+
84+
// attachmentUploads tracks in-flight and recently committed attachment
85+
// uploads for session-scoped upload RPC methods.
86+
attachmentMu sync.Mutex
87+
attachmentUploads map[string]*attachmentUploadState
88+
lastAttachmentPruneAt time.Time
8389
}
8490

8591
// NewManager creates a new session manager.
@@ -106,6 +112,7 @@ func NewManager(cfg *config.Config, token string, debug bool) (*Manager, error)
106112
stopCh: make(chan struct{}),
107113
// Permission requests are owned by the SessionActor.
108114
sessionActorClosed: make(chan struct{}),
115+
attachmentUploads: make(map[string]*attachmentUploadState),
109116
}, nil
110117
}
111118

0 commit comments

Comments
 (0)