agent-first-data 0.41.0

Self-describing data and structured CLI contracts for AI agents — field-name suffixes for units and secrets, the afdata CLI for rendering, validation, path guards, and reading or editing structured documents (JSON, TOML, YAML, dotenv, INI, Markdown), plus libraries for Rust, Go, Python, TypeScript, and Bash.
Documentation
//go:build windows

package afdata

import (
	"errors"
	"syscall"
)

// errorNoData is ERROR_NO_DATA: "The pipe is being closed", which a write to a
// pipe whose reader has exited returns alongside ERROR_BROKEN_PIPE.
const errorNoData syscall.Errno = 232

// isClosedReader reports whether err means the reading end of the output
// stream has gone away, which a CLI treats as success.
func isClosedReader(err error) bool {
	return errors.Is(err, syscall.EPIPE) ||
		errors.Is(err, syscall.ERROR_BROKEN_PIPE) ||
		errors.Is(err, errorNoData)
}