Documentation
¶
Index ¶
- func Cancel(home string, sess Session, msgID string) error
- func Enqueue(home string, sess Session, text string) (string, error)
- func EnqueueWith(home string, sess Session, text string, opts EnqueueOptions) (string, error)
- func MessageStatus(home string, sess Session, msgID string) (string, error)
- func RunSessionDrainer(ctx context.Context, home string, sess Session, provider agenttty.Provider)
- func SendToAgentSession(store agentstorage.Store, runner, agentSessionID, message string, ...) (msgID string, err error)
- func StartDrainer(home string, sess Session, provider agenttty.Provider)
- func StartSessionDrainer(ctx context.Context, home string, sess Session, provider agenttty.Provider)
- func WaitForDelivery(home string, sess Session, msgID string, opts WaitOptions) error
- type EnqueueOptions
- type Entry
- type Session
- type WaitMode
- type WaitOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnqueueWith ¶ added in v0.0.55
EnqueueWith is Enqueue with options (e.g. NoSubmit from send --no-submit).
func MessageStatus ¶
MessageStatus reports whether a session-local message is still queued. Returns "pending" when the message is in the queue, "delivered" when the id was assigned but is no longer queued (delivered, cancelled, or timed out).
func RunSessionDrainer ¶ added in v0.0.55
RunSessionDrainer is a durable session-owned queue consumer. It reuses drainStep (flock + WaitUntilWritable + SendMessage + FIFO dequeue) and keeps polling while the queue is empty until ctx is cancelled. Intended to run inside the live TTY serve process so --no-wait enqueues deliver without a blocking CLI send.
func SendToAgentSession ¶ added in v0.0.51
func SendToAgentSession(store agentstorage.Store, runner, agentSessionID, message string, waitOpts WaitOptions) (msgID string, err error)
SendToAgentSession resolves an agent session to a live TTY, enqueues a message, optionally starts the drainer, and waits per waitOpts.
func StartDrainer ¶
StartDrainer launches a background loop that elects a drainer via flock and delivers pending messages FIFO when the terminal becomes writable. The loop exits when the queue is empty or a drain step fails unrecoverably. Prefer RunSessionDrainer for session-owned consumers that must survive empty queues.
func StartSessionDrainer ¶ added in v0.0.55
func StartSessionDrainer(ctx context.Context, home string, sess Session, provider agenttty.Provider)
StartSessionDrainer starts RunSessionDrainer in a new goroutine.
func WaitForDelivery ¶
func WaitForDelivery(home string, sess Session, msgID string, opts WaitOptions) error
WaitForDelivery polls until msgID is absent from the queue or a max-wait deadline expires.
Types ¶
type EnqueueOptions ¶ added in v0.0.55
type EnqueueOptions struct {
// NoSubmit stores Entry.NoSubmit so drain does not auto-submit (no forced \n / Enter).
NoSubmit bool
}
EnqueueOptions configures Enqueue behavior.
type Entry ¶
type Entry struct {
ID string `json:"id"`
Text string `json:"text"`
TerminalSessionID string `json:"terminal_session_id"`
Runner string `json:"runner"`
EnqueuedAt time.Time `json:"enqueued_at"`
// NoSubmit: when true, drain injects without trailing Enter / forced grok \n.
NoSubmit bool `json:"no_submit,omitempty"`
}
Entry is one pending send-queue message.