pluginsdk

package
v0.4.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package pluginsdk is imported by FlatRun plugin binaries to serve their routes over the host-provided socket. See examples/plugins/hello for usage.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AgentCallback

func AgentCallback() (baseURL, token string)

AgentCallback returns the agent API base URL and token a plugin can use to call back into the agent. Either may be empty when the host did not grant callback access.

func Serve

func Serve(info pluginapi.Info, handler http.Handler, tools ...Tool) error

Serve runs the plugin until the host stops it. handler serves the plugin's own routes (nil if the plugin only reports info); tools are advertised to the assistant and dispatched over the tool-exec endpoint. It returns an error if the process was not launched by the host (the socket env var is unset) or the socket cannot be served.

Types

type Tool

type Tool struct {
	Spec pluginapi.ToolSpec
	Run  func(args map[string]any) (string, error)
}

Tool is a plugin capability the AI assistant can invoke. Run receives the parsed args and returns the textual result the model reads.

Jump to

Keyboard shortcuts

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