message

package
v0.3.49 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package message provides relay, broadcast, read, report-back, and worker enumeration.

Index

Constants

View Source
const LargeMessageThreshold = 200

LargeMessageThreshold is the character count above which messages use file indirection.

Variables

This section is empty.

Functions

This section is empty.

Types

type BroadcastResult

type BroadcastResult struct {
	Registered int // total workers in manifest
	Delivered  int // workers that received the message
}

BroadcastResult distinguishes "no registered workers" from "registered but none reachable."

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service provides messaging operations between questmaster sessions.

func NewService

func NewService(store *state.Store, client *tmux.Client) *Service

NewService creates a messaging service.

func (*Service) Broadcast

func (s *Service) Broadcast(ctx context.Context, masterID, message string) (BroadcastResult, error)

Broadcast sends a message to all workers of a master session.

func (*Service) BroadcastFrom

func (s *Service) BroadcastFrom(ctx context.Context, senderID, masterID, message string) (BroadcastResult, error)

BroadcastFrom sends a message with sender provenance to all workers of a master session.

func (*Service) Read

func (s *Service) Read(ctx context.Context, workerID string, lines int) (string, error)

Read captures output from a worker's primary pane.

func (*Service) Relay

func (s *Service) Relay(ctx context.Context, workerID, message string) error

Relay sends a message to a worker's primary pane.

func (*Service) RelayFrom

func (s *Service) RelayFrom(ctx context.Context, senderID, targetID, message string) error

RelayFrom sends a message to a worker's primary pane with sender provenance.

func (*Service) Report

func (s *Service) Report(ctx context.Context, sessionID, message string) error

Report sends a report-back message from a worker to its master's primary pane. Formats as [WORKER:<sessionID>] <message> per the worker report-back contract.

func (*Service) Workers

func (s *Service) Workers(ctx context.Context, masterID string) ([]WorkerInfo, error)

Workers returns status information for all workers of a master session.

type WorkerInfo

type WorkerInfo struct {
	SessionID string `json:"session_id"`
	Status    string `json:"status"`
	Title     string `json:"title"`
}

WorkerInfo holds status information for a worker session.

Jump to

Keyboard shortcuts

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