notify

package
v0.0.9 Latest Latest
Warning

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

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

Documentation

Overview

Package notify exec's a user-configured command for agent-driven notifications. Triggered explicitly by `boid task notify` calls; no payload diffing or polling.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	TaskID      string
	TaskTitle   string
	ProjectID   string
	ProjectName string
	Message     string
	JobID       string
	// URLPath, when non-empty, overrides the default BOID_TASK_URL target
	// resolution. The caller supplies a full path (e.g. "/tasks/abc/questions/q1")
	// and Notify prefixes it with PublicURL. Used by ask-mode notifications
	// so the user opens the Q&A page directly instead of the job terminal.
	URLPath string
}

Event carries the data passed to the notify command via env vars. All fields except TaskID and Message are best-effort: empty strings surface as empty env vars, which the user's script can ignore.

type Service

type Service struct {
	Command   []string
	PublicURL string
}

Service exec's the configured Command for each notification event. A nil receiver or empty Command makes Notify a no-op so the rest of the system does not need to special-case "notifications disabled".

func (*Service) Notify

func (s *Service) Notify(ctx context.Context, ev Event) error

Notify exec's the service's Command synchronously, passing event data through environment variables. Returns an error if the command fails to start or exits non-zero. Callers should treat the error as notification-side failure (the agent's intent is recorded by the calling boid task notify regardless).

Jump to

Keyboard shortcuts

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