I think it could be interesting to expose browser agent sessions to applications, in particular for efficient compaction by the app itself.
Couple of ideas:
- new events on MCPContext:
sessionstart, sessioncompaction:
sessionstart fire when the UA starts the session, which I guess would be soon after document load (except if the session is shared between documents and was started earlier?) and would allow the app to send it's first observation.
sessioncompaction: fired when the context reaches an implementation define limit. The UA could just clear the context, and then the app could use the event to send an observation for the compacted state
- both would require app driven observations.
The main benefit would be to allow the app itself to manage the context of the session, given that it is likely the app dev itself who is best placed to decide how to compact; for example for a ui app it could just send an observation with the latest relevant state, and then from then on only send deltas, and then resend the full state on compaction.
I think it could be interesting to expose browser agent sessions to applications, in particular for efficient compaction by the app itself.
Couple of ideas:
sessionstart,sessioncompaction:sessionstartfire when the UA starts the session, which I guess would be soon after document load (except if the session is shared between documents and was started earlier?) and would allow the app to send it's first observation.sessioncompaction: fired when the context reaches an implementation define limit. The UA could just clear the context, and then the app could use the event to send an observation for the compacted stateThe main benefit would be to allow the app itself to manage the context of the session, given that it is likely the app dev itself who is best placed to decide how to compact; for example for a ui app it could just send an observation with the latest relevant state, and then from then on only send deltas, and then resend the full state on compaction.