toolgenfixture

package
v0.68.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

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