notice

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package notice carries short, user-facing messages raised while pi-go starts up or reconfigures itself — a skipped MCP server, a rerouted docs source, a blocked skill, an OAuth re-login.

These are not diagnostics, and os.Stderr is the wrong place for them once a front end owns the terminal: the TUI paints its frame with direct cursor control, so a stray write lands in the middle of the layout and stays there until the next full repaint, and the ACP server interleaves them with its protocol stream. Routing them through a sink lets the front end render them where the user is already looking.

The default sink writes to os.Stderr, which is correct for the non-interactive CLI: nothing else owns the terminal, and a warning that vanished entirely would be worse than one that scrolls past.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Notifyf

func Notifyf(format string, args ...any)

Notifyf formats a notice and delivers it to the installed sink. The message carries no trailing newline — a sink renders it as a single item, and the stderr fallback supplies the newline itself.

func SetSink

func SetSink(fn func(string)) func(string)

SetSink routes notices to fn instead of os.Stderr, returning the sink it replaced so a caller can restore it — tests rely on that, and so does a front end that exits before the process does. Passing nil restores the os.Stderr default.

fn is called from whichever goroutine raises the notice, including ones deep inside a lazily-connecting MCP toolset, so it must be safe for concurrent use and must not block: a sink that stalls stalls the agent turn behind it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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