webhook

package
v1.10.2 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package webhook provides a standalone HTTP POST client for sending notifications to a configured webhook URL. It handles Slack auto-detection and formatting so that callers (CLI, IPC, MCP) share a single code path.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatSlackText

func FormatSlackText(p Payload) string

FormatSlackText produces a human-readable Slack mrkdwn message from a payload.

func IsSlackWebhook

func IsSlackWebhook(url string) bool

IsSlackWebhook returns true if the URL is a Slack incoming webhook.

func PostNotification

func PostNotification(url, kind, agent, message, project string) error

PostNotification sends a single notification to the webhook URL. It auto-detects Slack webhooks and formats accordingly. Returns an error if the POST fails or the server returns a non-2xx status.

Types

type Payload

type Payload struct {
	Kind      string `json:"kind"`
	Agent     string `json:"agent"`
	BeadID    string `json:"bead_id,omitempty"`
	Detail    string `json:"detail"`
	Timestamp string `json:"timestamp"`
	Project   string `json:"project"`
}

Payload is the JSON body POSTed to the webhook URL.

Jump to

Keyboard shortcuts

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