server

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package server implements an HTTP/gRPC A2A (Agent-to-Agent) server for pi.

It mirrors the ACP server in internal/acp/server: the same pi runtime (PromptHandler) is exposed over the A2A protocol instead of ACP. The server serves an agent card at /.well-known/agent-card.json and accepts JSON-RPC A2A message requests on the root path, plus gRPC A2A on the same port (HTTP/2 with application/grpc content type), matching the kagent Substrate runtime contract.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Serve

func Serve(ctx context.Context, cfg ServeConfig) error

Serve runs pi as an A2A agent over HTTP/gRPC and returns when ctx is canceled. Serve does not close the listeners; callers own them.

Types

type ServeConfig

type ServeConfig struct {
	// Addr is the HTTP/gRPC listen address. Default ":8085".
	Addr string
	// ReadyAddr is the readiness listen address. Default ":8081".
	ReadyAddr string
	// Handler processes one A2A prompt turn. Required.
	Handler acpserver.PromptHandler
	// CWD is the working directory for sessions. Empty means current dir.
	CWD string
	// Logger receives diagnostic output. Optional.
	Logger *slog.Logger
}

ServeConfig configures a server.Serve run.

Jump to

Keyboard shortcuts

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