sessionmessenger

package
v0.67.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package sessionmessenger owns source-side durable session-message delivery.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeliveryError

type DeliveryError struct {
	MessageID         string
	TargetWBSessionID string
	Cause             error
}

DeliveryError preserves the caller-owned durable identity needed to retry an ambiguous transport or a post-delivery source-recording failure.

func (*DeliveryError) Error

func (err *DeliveryError) Error() string

func (*DeliveryError) Unwrap

func (err *DeliveryError) Unwrap() error

type Hooks

type Hooks struct {
	BeforeCourier func(sessionmove.MessageState) error
}

Hooks are test-only crash-boundary probes. Production callers leave them empty; they never change the durable protocol.

type Options

type Options struct {
	Store             sessionmove.Store
	ProjectsRoot      string
	TargetWBSessionID string
	SourceSession     session.Record
	Kind              sessionmove.MessageKind
	Body              string
	MessageID         string
	ResumeMessageID   string
	Now               func() time.Time
	NewDeliverer      func(sessionmove.SuccessorAddress, sessioncourier.MessageSynchestraOptions) (sessioncourier.MessageDeliverer, error)
	RecordSent        func(WorkLogRecord) error
	Hooks             Hooks
}

Options selects a successor solely by its durable WB session address. A fresh caller supplies MessageID; a retry supplies only ResumeMessageID and therefore cannot accidentally construct different bytes.

type Result

type Result struct {
	Message sessionmove.Message          `json:"message"`
	Digest  sessionmove.Digest           `json:"message_digest"`
	Receipt sessionmove.MessageReceipt   `json:"receipt"`
	Address sessionmove.SuccessorAddress `json:"successor_address"`
	Replay  bool                         `json:"replay"`
}

Result identifies the exact durable outbox message and its target acknowledgement. Receipt means recorded+pasted, never agent-processed.

func Send

func Send(ctx context.Context, options Options) (Result, error)

Send persists exact message bytes before courier use, then records only an acknowledgement that those bytes were recorded and pasted at the verified successor pane. It holds the handoff execution fence across one courier attempt so concurrent local retries cannot create duplicate attempts.

type WorkLogRecord

type WorkLogRecord struct {
	ProjectsRoot   string
	Request        sessionmove.Request
	RequestDigest  sessionmove.Digest
	HandoffReceipt sessionmove.Receipt
	Address        sessionmove.SuccessorAddress
	SourceSession  session.Record
	Message        sessionmove.Message
	Record         sessionmove.MessageRecord
	MessageReceipt sessionmove.MessageReceipt
}

WorkLogRecord is the exact source-side evidence recorded only after the target has acknowledged durable recording plus a successful tmux paste.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL