toolgenfixture

package
v0.68.2 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: AGPL-3.0 Imports: 4 Imported by: ? modules, 0 packages

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 toolgenfixture pins toolgen's declaration-only path against a real package: agent-tools/session.yaml is generated into tool_gen.go here, and this file supplies both the hand-written type the generated names must not collide with and a Handler implementation the generated Dispatch must accept.

It exists outside internal/ on purpose. toolgen prunes stale generated files under its output root, and a fixture living there would be deleted on the next run.

Index

Constants

View Source
const ToolPrefix = "session"

ToolPrefix is the family every generated session tool name starts with.

Variables

This section is empty.

Functions

func Dispatch

func Dispatch(ctx context.Context, h Handler, action string, args map[string]any) (any, error)

func ToolNames

func ToolNames() []string

ToolNames lists every generated tool name, for callers that gate on names.

Types

type ActionTool

type ActionTool = toolmeta.ActionTool

ActionTool describes one generated tool: an exact schema bound to one action.

func ActionTools

func ActionTools() []ActionTool

ActionTools lists every generated tool in a stable order.

type Handler

type Handler interface {
	List(context.Context, SessionListInput) (any, error)
	Send(context.Context, SessionSendInput) (any, error)
}

type Handlers

type Handlers struct{}

Handlers implements the generated Handler interface.

func (Handlers) List

func (Handlers) Send

type SendInput

type SendInput struct {
	Authority string
	SessionID string
}

SendInput is hand-written, and shares its name with what a naive generator would emit for session/send. internal/agent/session/access has exactly this collision; the generated type is SessionSendInput.

type SessionListInput

type SessionListInput struct {
	IncludeArchived *bool  `json:"include_archived,omitempty"`
	PageSize        int    `json:"page_size,omitempty"`
	PageToken       string `json:"page_token,omitempty"`
}

type SessionSendInput

type SessionSendInput struct {
	Message   string `json:"message,omitempty"`
	SessionId string `json:"session_id,omitempty"`
	Wait      *bool  `json:"wait,omitempty"`
}

Jump to

Keyboard shortcuts

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