delegate

package
v0.1.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 5 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package delegate is for Go agents on Lagrange that call other addresses. Calls made with Interceptor carry the agent's token, so Lagrange knows who is calling, and the platform task the agent is working on, so the call shows up nested under that task in the task tree and the live graph.

exec = delegate.Executor(exec) // remember the platform task of each execution
client, _ := a2aclient.NewFromCard(ctx, card, a2aclient.WithCallInterceptors(delegate.Interceptor(token)))
client.SendMessage(ctx, req) // ctx from Execute

Index

Constants

View Source
const HeaderTask = "Lagrange-Task"

HeaderTask carries the platform task an agent is working on: the relay sets it on requests to agents, and Interceptor sends it back on the agent's own calls.

View Source
const TagsKey = "https://threeagents.dev/ext/tags/v1"

TagsKey in a message's metadata holds the sender's tags for it, {"name": "value"}: short strings (up to 16, names up to 64 and values up to 256 characters) that the activity log records with the task, as data.tags of the entry that created it, so any client can group and label tasks (a subtask ID, a ticket, a customer).

Variables

This section is empty.

Functions

func Executor

Executor wraps exec so that the platform task of each execution (the Lagrange-Task header the relay sends) is in the context Execute gets.

func Interceptor

func Interceptor(token string) a2aclient.CallInterceptor

Interceptor authenticates calls with token (empty: anonymous) and passes on the platform task from ctx.

func Tag

func Tag(m *a2a.Message, tags map[string]string)

Tag puts tags on m, keeping the ones it has. Empty values are left out.

func Task

func Task(ctx context.Context) string

Task returns the platform task ctx belongs to, if any.

Types

This section is empty.

Jump to

Keyboard shortcuts

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