publish

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: BSD-2-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package publish turns a matched task event into a notification-publish command and sends it into the shared notification core.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildCommand

BuildCommand builds the notification-publish command for one matched task event.

The command is typed agent-escalation and carries no target: the deployed routing table owns the channel decision, and a non-nil target would override it. Nothing is sent and nothing is validated here; the caller validates before sending.

Types

type Publisher

type Publisher interface {
	Publish(ctx context.Context, event TaskEvent) error
}

Publisher publishes one notification per matched task event, suppressing repeats of the same task and phase inside its window.

func NewPublisher

func NewPublisher(
	sender notification.NotificationPublishCommandSender,
	topicPrefix base.TopicPrefix,
	dedupTTL time.Duration,
	currentDateTimeGetter libtime.CurrentDateTimeGetter,
) Publisher

NewPublisher returns a Publisher that publishes through sender and keeps its own dedup window (one instance per watcher entry, using that entry's TTL). The window is measured on currentDateTimeGetter, so expiry is testable without sleeping.

type TaskEvent

type TaskEvent struct {
	Vault    string
	TasksDir string
	TaskName string
	Status   string
	Phase    string
	Assignee string
}

TaskEvent is one matched task change, carrying everything the notification message and its metadata need.

Jump to

Keyboard shortcuts

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