Documentation
¶
Index ¶
- Constants
- func DefinitionMaps() []map[string]any
- func Register[T any](name string, factory func(Dependencies) AgentTool[T])
- func SchemaRevision() string
- type AgentTool
- type AppAgentTool
- type AppAgentToolOptions
- type ComponentSchemaAgentTool
- type Definition
- type Dependencies
- type Registry
- type Result
Constants ¶
const AppAgentToolName = "superplane_app"
const ComponentSchemaAgentToolName = "superplane_component_schema"
Variables ¶
This section is empty.
Functions ¶
func DefinitionMaps ¶
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 (t *AppAgentTool) Call(ctx context.Context, session agents.AgentSessionContext, input canvasactions.Input) (Result, error)
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 (t *ComponentSchemaAgentTool) InputSchema() agents.CustomToolInputSchema
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.