clip

package
v0.97.8 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package clip provides agent tools for creating and reading shareable markdown clips.

Index

Constants

View Source
const (
	// CreateToolName is the agent tool name for creating clips.
	CreateToolName = "create_clip"
	// GetToolName is the agent tool name for reading clips by slug.
	GetToolName = "get_clip"
)

Variables

This section is empty.

Functions

func AbsoluteURL

func AbsoluteURL(publicBase, relativeOrSlug string) string

AbsoluteURL builds a full clip URL from an optional public base and a relative path or slug.

func ActiveToolNames

func ActiveToolNames() []string

ActiveToolNames returns the default clip tool names.

func Register

func Register(registry *tool.Registry, publicBaseURL string) error

Register registers create_clip and get_clip on the given registry.

Types

type CreateTool

type CreateTool struct {
	// PublicBaseURL is the absolute site origin (e.g. https://flowbot.example.com).
	// When empty, config.App.Flowbot.URL is used.
	PublicBaseURL string
}

CreateTool creates a shareable markdown clip via the clip capability.

func (CreateTool) Description

func (CreateTool) Description() string

Description explains the tool to the model.

func (CreateTool) Execute

func (t CreateTool) Execute(ctx context.Context, id string, args map[string]any, _ tool.UpdateHandler) (msg.ToolResultMessage, error)

Execute creates a clip and returns the absolute public URL.

func (CreateTool) Name

func (CreateTool) Name() string

Name returns the tool identifier.

func (CreateTool) Parameters

func (CreateTool) Parameters() map[string]any

Parameters returns the JSON schema for tool arguments.

type GetTool

type GetTool struct{}

GetTool reads a shareable markdown clip by slug via the clip capability.

func (GetTool) Description

func (GetTool) Description() string

Description explains the tool to the model.

func (GetTool) Execute

func (GetTool) Execute(ctx context.Context, id string, args map[string]any, _ tool.UpdateHandler) (msg.ToolResultMessage, error)

Execute loads a clip and returns its metadata and markdown content.

func (GetTool) Name

func (GetTool) Name() string

Name returns the tool identifier.

func (GetTool) Parameters

func (GetTool) Parameters() map[string]any

Parameters returns the JSON schema for tool arguments.

Jump to

Keyboard shortcuts

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