agentproduct

package
v1.0.62-beta.8 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package agentproduct defines the caller-provided Agent product identity used for outbound observability and IM message display.

Index

Constants

View Source
const (
	// EnvName is the runtime override for the Agent product identity.
	EnvName = "DWS_AGENT_PRODUCT"
	// HeaderName is the observability header used for the Agent product.
	// It is intentionally separate from the routing/PAT claw-type header.
	HeaderName = "x-dws-agent-product"
	// MaxValueBytes bounds the value because it is attached to every outbound
	// MCP request. Supported values are ASCII, so bytes and characters match.
	MaxValueBytes = 64
)

Variables

View Source
var ErrInvalid = errors.New("invalid agent product")

ErrInvalid is returned when an Agent product value is unsafe or does not match the supported wire format. The error intentionally excludes the raw caller-controlled value.

Functions

func Parse

func Parse(raw string) (string, error)

Parse normalizes and validates a caller-provided Agent product. Only surrounding ASCII spaces and tabs are trimmed; other control or Unicode whitespace remains visible to validation and is rejected. An unset or ASCII-whitespace-only value means "use the edition default".

func ResolveFromEnv

func ResolveFromEnv(fallback string) (string, error)

ResolveFromEnv returns the validated DWS_AGENT_PRODUCT value, or fallback when the environment variable is unset or empty. Invalid caller input is returned as an error so command entrypoints can fail before network access.

Types

This section is empty.

Jump to

Keyboard shortcuts

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