sessionmessage

package
v0.109.1 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package sessionmessage owns durable follow-up delivery to a completed session-move successor. Couriers transport canonical bytes; this package alone admits the inbox, verifies the live target, and attempts one paste.

Index

Constants

This section is empty.

Variables

View Source
var ErrMessagePasteAmbiguous = errors.New("session message paste outcome is ambiguous")

ErrMessagePasteAmbiguous means a durable intent exists but no durable pasted receipt does. WB will not automatically paste the message again.

Functions

This section is empty.

Types

type Hooks

type Hooks struct {
	AfterPaste func() error
}

type Options

type Options struct {
	Store          sessionmove.Store
	ProjectsRoot   string
	LocalMachine   string
	SessionDir     string
	RawMessage     []byte
	Tmux           tmux
	LookupSession  func(string, int) (session.Record, bool, error)
	RecordReceived func(WorkLogRecord) error
	Now            func() time.Time
	Hooks          Hooks
}

type Pane

type Pane struct {
	SessionName string
	ID          string
	PID         int
	Count       int
}

Pane is the exact single pane returned by one bounded list-panes query.

type Result

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

func Receive

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

Receive admits exact canonical bytes before inspecting target state. The typed canonical JSON is intentionally the agent-facing prompt contract: its kind and reply_to fields make even an empty-body request_handoff actionable. Once Receive publishes a paste intent it makes at most one automatic paste attempt.

type WorkLogRecord

type WorkLogRecord struct {
	ProjectsRoot  string
	Request       sessionmove.Request
	RequestDigest sessionmove.Digest
	Receipt       sessionmove.Receipt
	Message       sessionmove.Message
	Record        sessionmove.MessageRecord
}

WorkLogRecord is the exact target-side evidence passed to the Work Log adapter. Production omits Message.Body from the event it writes.

Jump to

Keyboard shortcuts

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