agenttools

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const AppAgentToolName = "superplane_app"
View Source
const ComponentSchemaAgentToolName = "superplane_component_schema"

Variables

This section is empty.

Functions

func DefinitionMaps

func DefinitionMaps() []map[string]any

DefinitionMaps returns Anthropic-compatible custom tool definitions.

func Register

func Register[T any](name string, factory func(Dependencies) AgentTool[T])

Register adds a managed-agent custom tool factory to the global registry. Tool packages call Register from init, following the integration registry pattern used elsewhere in SuperPlane.

func SchemaRevision

func SchemaRevision() string

SchemaRevision identifies the provider-facing custom tool contract. The hash changes when tool names, descriptions, or input schemas change; bump toolContractRevision for behavior changes that keep the JSON schema stable.

Types

type AgentTool

type AgentTool[T any] interface {
	Definition
	Call(ctx context.Context, session agents.AgentSessionContext, input T) (Result, error)
}

AgentTool is implemented by concrete managed-agent tools. Each tool owns a typed input contract and does not need to know about provider event payloads.

type AppAgentTool

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

func NewAppAgentTool

func NewAppAgentTool(opts AppAgentToolOptions) *AppAgentTool

func (*AppAgentTool) Call

func (*AppAgentTool) Description

func (t *AppAgentTool) Description() string

func (*AppAgentTool) InputSchema

func (t *AppAgentTool) InputSchema() agents.CustomToolInputSchema

func (*AppAgentTool) Name

func (t *AppAgentTool) Name() string

type AppAgentToolOptions

type AppAgentToolOptions struct {
	Encryptor      crypto.Encryptor
	Registry       *registry.Registry
	GitProvider    gitprovider.Provider
	WebhookBaseURL string
	AuthService    authorization.Authorization
	UsageService   usage.Service
}

type ComponentSchemaAgentTool

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

func NewComponentSchemaAgentTool

func NewComponentSchemaAgentTool(registry *registry.Registry) *ComponentSchemaAgentTool

func (*ComponentSchemaAgentTool) Call

func (t *ComponentSchemaAgentTool) Call(_ context.Context, _ agents.AgentSessionContext, input superPlaneComponentSchemaInput) (Result, error)

func (*ComponentSchemaAgentTool) Description

func (t *ComponentSchemaAgentTool) Description() string

func (*ComponentSchemaAgentTool) InputSchema

func (*ComponentSchemaAgentTool) Name

func (t *ComponentSchemaAgentTool) Name() string

type Definition

type Definition interface {
	Name() string
	Description() string
	InputSchema() agents.CustomToolInputSchema
}

Definition is the provider-facing metadata for a managed-agent custom tool.

func DefaultDefinitions

func DefaultDefinitions() []Definition

DefaultDefinitions returns the provider-facing metadata for all registered tools without requiring worker-only runtime dependencies.

type Dependencies

type Dependencies struct {
	Encryptor         crypto.Encryptor
	ComponentRegistry *componentregistry.Registry
	GitProvider       gitprovider.Provider
	WebhookBaseURL    string
	AuthService       authorization.Authorization
	UsageService      usage.Service
}

Dependencies are shared by registered tools that need backend services to execute provider custom tool calls.

type Registry

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

func NewRegistry

func NewRegistry(deps Dependencies) *Registry

NewRegistry instantiates all registered managed-agent custom tools.

func (*Registry) Definitions

func (r *Registry) Definitions() []Definition

Definitions returns the registered custom tool definitions in stable name order.

func (*Registry) ExecuteCustomTool

func (r *Registry) ExecuteCustomTool(ctx context.Context, session agents.AgentSessionContext, toolUse agents.CustomToolUse) agents.CustomToolResult

ExecuteCustomTool dispatches one provider custom tool invocation to the matching registered backend implementation.

type Result

type Result struct {
	Payload any
}

Result is the backend payload returned by a tool after a typed call.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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