Documentation
¶
Overview ¶
Package session is parley's reference client engine. A Session is one end of one channel; it drives the handshake, seals and opens messages, and runs the non-blocking model the spec describes — Send posts and returns, Poll collects what has arrived — over any parley.Relay. It implements parley.Session.
A Session expects one call in flight at a time (the natural shape for an MCP host, which dispatches tools sequentially). Send and Poll from separate goroutines on the same Session are not supported; two different Sessions are fully independent.
Index ¶
- type Session
- func (s *Session) Close(ctx context.Context, outcome string) error
- func (s *Session) Join(ctx context.Context, in parley.Invite) error
- func (s *Session) Open(ctx context.Context, topic string) (parley.Invite, error)
- func (s *Session) Peer() parley.Peer
- func (s *Session) Poll(ctx context.Context, wait time.Duration) ([]parley.Message, error)
- func (s *Session) Send(ctx context.Context, text string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
A Session is one agent's end of one channel. Whether this node opened or joined is captured entirely by which constructor ran (responder vs initiator, recorded in hs) and whether a topic was set — there is no separate role flag.
func New ¶
New returns a session that speaks through relay and mints invites pointing at host, the relay's public name (e.g. "parley.chat").