channels

package
v0.0.0-...-e472c37 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const SyncRequestTimeout = 360 * time.Second

SyncRequestTimeout is how long the router holds a channel-initiated tasks/send request open waiting for the agent's response. It is the ceiling on how long a channel-initiated tool call can spend awaiting a human DEFER approval before the HTTP call times out (the request context is cancelled and the deferral is abandoned). See #314 for lifting this via async delivery.

Variables

This section is empty.

Functions

func EnvVarsFromConfig

func EnvVarsFromConfig(workDir string, channelNames []string) (envVars []string, missing []string, err error)

EnvVarsFromConfig returns the sorted, deduped union of env-var names that the configured channel adapters require. The canonical source is the project's per-channel YAML — every setting key ending in "_env" declares an env var name (e.g. "bot_token_env: SLACK_BOT_TOKEN"), matching the runtime contract used by channels.ResolveEnvVars.

channelNames are the values from forge.yaml's `channels:` list. For each name, the file workDir/<name>-config.yaml is consulted. A missing file is reported via missing[] and produces no env vars; parse errors are returned.

This is the single canonical source — build stages, container packaging, and any other tooling that needs to know "which env vars do my channels require" should call this. Adding a new channel adapter requires no edits here: it ships its own *-config.yaml template and the helper picks it up.

func LoadChannelConfig

func LoadChannelConfig(path string) (*channels.ChannelConfig, error)

LoadChannelConfig reads and parses a channel adapter YAML config file.

Types

type Router

type Router struct {
	// contains filtered or unexported fields
}

Router forwards channel events to an A2A agent server via JSON-RPC over HTTP.

func NewRouter

func NewRouter(agentURL, bearerToken string) *Router

NewRouter creates a Router that forwards events to the A2A server at agentURL. If bearerToken is non-empty, it is sent as an Authorization header on requests.

func (*Router) Handler

func (r *Router) Handler() channels.EventHandler

Handler returns an EventHandler suitable for passing to ChannelPlugin.Start().

Jump to

Keyboard shortcuts

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