Help us shape the future of Go! Take the 2026 Go Developer Survey

builtin

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 67 Imported by: 0

Documentation

Overview

Package builtin provides Alchemy blockchain API handler implementation

Package builtin provides blockchain monitoring handler implementation

Package builtin provides IPFS skill implementation using Kubo RPC client.

Package builtin provides crypto utility functions using modern Go crypto libraries

Package builtin provides wallet security monitoring handler implementation

ElevenLabs text-to-speech tool.

Ported from celeste-tts-bot/internal/tts/client.go. Generates speech audio via the ElevenLabs API and saves/plays it locally.

Audio project pipeline — declarative timeline-based audio rendering.

The model constructs a JSON project file describing the mix timeline, then calls render. The tool handles all ffmpeg complexity, progress reporting, and validation. Similar to how a video renderer takes a project file and produces output.

Index

Constants

View Source
const SubmitPlanName = "submit_plan"

SubmitPlanName is the plan-mode tool's name; the chat's plan-mode filter lets it through alongside the read-only tools.

Variables

View Source
var AlchemyNetworks = map[string]struct {
	Name    string
	ChainID int64
}{
	"eth-mainnet":      {"Ethereum Mainnet", 1},
	"eth-sepolia":      {"Ethereum Sepolia Testnet", 11155111},
	"polygon-mainnet":  {"Polygon Mainnet", 137},
	"polygon-amoy":     {"Polygon Amoy Testnet", 80002},
	"arbitrum-mainnet": {"Arbitrum One", 42161},
	"arbitrum-sepolia": {"Arbitrum Sepolia", 421614},
	"optimism-mainnet": {"Optimism Mainnet", 10},
	"optimism-sepolia": {"Optimism Sepolia", 11155420},
	"base-mainnet":     {"Base Mainnet", 8453},
	"base-sepolia":     {"Base Sepolia", 84532},
}

Supported Alchemy networks with chain IDs

Functions

func BuildAlchemyURL

func BuildAlchemyURL(network, apiKey string) string

BuildAlchemyURL constructs the Alchemy API URL

func NormalizeAddress

func NormalizeAddress(addr string) (string, error)

NormalizeAddress returns a checksummed Ethereum address using EIP-55 This is the proper way to handle Ethereum addresses

func PlanPath

func PlanPath(workspace string) string

PlanPath is where a workspace's approved plan lives.

func RegisterAll

func RegisterAll(registry *tools.Registry, workspace string, configLoader ConfigLoader, tracker *checkpoints.FileTracker, snapshots *checkpoints.SnapshotManager, policy *sandbox.Policy)

RegisterAll registers all built-in tools with the registry. tracker and snapshots are optional; pass nil to disable file checkpointing. policy is bash's OS sandbox (2.0 W4); nil runs bash with the denylist alone.

func RegisterCodeGraphTools

func RegisterCodeGraphTools(registry *tools.Registry, indexer *codegraph.Indexer)

RegisterCodeGraphTools registers code graph tools with the given indexer. Called after the indexer is initialized during startup.

func RegisterCollectionsTools

func RegisterCollectionsTools(registry *tools.Registry, cfg *config.Config)

RegisterCollectionsTools registers collections search if active collections exist.

func RegisterConfigTools

func RegisterConfigTools(registry *tools.Registry, configLoader ConfigLoader)

RegisterConfigTools registers the chat skills that need a config loader (weather, tarot, twitch, youtube, upscale and the crypto tools), Chat only. A nil loader registers nothing. RegisterAll calls it; the chat calls it on top of loop.Setup's registry, which has no loader (2.0 F2d).

func RegisterCryptoTools

func RegisterCryptoTools(registry *tools.Registry, configLoader ConfigLoader)

RegisterCryptoTools registers all crypto/blockchain tools.

func ValidateAlchemyNetwork

func ValidateAlchemyNetwork(network string) error

ValidateAlchemyNetwork checks if a network identifier is valid

func WalletSecurityHandlerFunc

func WalletSecurityHandlerFunc(args map[string]any, configLoader ConfigLoader) (any, error)

WalletSecurityHandlerFunc is the exported entry point for wallet security operations. It is used by the monitor daemon to perform periodic wallet checks.

func WeiToEther

func WeiToEther(wei *big.Int) string

WeiToEther converts Wei (*big.Int) to Ether as a formatted string Uses params.Ether from go-ethereum for accurate conversion

func WeiToGwei

func WeiToGwei(wei *big.Int) int64

WeiToGwei converts Wei to Gwei (useful for displaying gas prices)

Types

type AlchemyConfig

type AlchemyConfig struct {
	APIKey         string
	DefaultNetwork string
	TimeoutSeconds int
}

AlchemyConfig holds Alchemy API configuration.

type AlchemyTool

type AlchemyTool struct {
	BaseTool
	// contains filtered or unexported fields
}

AlchemyTool provides blockchain data and analytics via Alchemy API.

func NewAlchemyTool

func NewAlchemyTool(configLoader ConfigLoader) *AlchemyTool

NewAlchemyTool creates an AlchemyTool.

func (*AlchemyTool) Execute

func (t *AlchemyTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type AlertsLog

type AlertsLog struct {
	Alerts []SecurityAlert `json:"alerts"`
}

AlertsLog stores all security alerts

type ApprovalEvent

type ApprovalEvent struct {
	Owner         string   // Wallet that granted approval
	Spender       string   // Contract/address that can spend
	Value         *big.Int // Approved amount
	TokenContract string   // ERC20 contract address
	TxHash        string
	BlockNumber   string
	LogIndex      string
	IsUnlimited   bool // True if value == max uint256
}

ApprovalEvent represents an ERC20 token approval

type AskTool

type AskTool struct {
	BaseTool
	// contains filtered or unexported fields
}

AskTool lets the model ask the user a structured multiple-choice question mid-turn. It blocks until the user answers (interactive TUI) or returns an error result in non-interactive contexts.

func NewAskTool

func NewAskTool(registry *tools.Registry) *AskTool

NewAskTool creates the ask tool bound to the registry that carries the interactive callback.

func (*AskTool) Execute

func (t *AskTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type AssetTransfer

type AssetTransfer struct {
	Category        string
	BlockNum        string
	From            string
	To              string
	Value           float64
	Asset           string
	Hash            string
	UniqueID        string // Alchemy's per-transfer id within the tx
	RawContract     struct{ Address string }
	TokenId         string
	ERC721TokenId   string
	ERC1155Metadata []struct {
		TokenId string
		Value   string
	}
}

AssetTransfer represents a blockchain asset transfer

type AudioProject

type AudioProject struct {
	Name    string       `json:"name"`    // project name
	Output  string       `json:"output"`  // output filename (required)
	Tracks  []AudioTrack `json:"tracks"`  // timeline tracks
	Version string       `json:"version"` // schema version
}

AudioProject is the declarative project file schema.

type AudioProjectTool

type AudioProjectTool struct {
	BaseTool
	// contains filtered or unexported fields
}

AudioProjectTool handles the project-based render pipeline.

func NewAudioProjectTool

func NewAudioProjectTool(workspace string) *AudioProjectTool

func (*AudioProjectTool) Execute

func (t *AudioProjectTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type AudioTrack

type AudioTrack struct {
	File   string  `json:"file"`            // path to audio file
	Role   string  `json:"role"`            // "voice", "bed", "sfx" — determines behavior
	Volume float64 `json:"volume"`          // 0.0-1.0
	Start  float64 `json:"start"`           // start time in seconds on timeline
	End    float64 `json:"end,omitempty"`   // optional: cut at this second (0 = play full)
	Loop   bool    `json:"loop,omitempty"`  // loop for full output duration (beds only)
	Label  string  `json:"label,omitempty"` // human-readable label for progress display
}

AudioTrack is a single audio element on the timeline.

type Base64DecodeTool

type Base64DecodeTool struct {
	BaseTool
}

Base64DecodeTool decodes a base64 string.

func NewBase64DecodeTool

func NewBase64DecodeTool() *Base64DecodeTool

NewBase64DecodeTool creates a Base64DecodeTool.

func (*Base64DecodeTool) Execute

func (t *Base64DecodeTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type Base64EncodeTool

type Base64EncodeTool struct {
	BaseTool
}

Base64EncodeTool encodes text to base64.

func NewBase64EncodeTool

func NewBase64EncodeTool() *Base64EncodeTool

NewBase64EncodeTool creates a Base64EncodeTool.

func (*Base64EncodeTool) Execute

func (t *Base64EncodeTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type BaseTool

type BaseTool struct {
	ToolName        string
	ToolDescription string
	ToolParameters  json.RawMessage
	ReadOnly        bool
	ConcurrencySafe bool
	Interrupt       tools.InterruptBehavior
	RequiredFields  []string
	// ExecTimeout is this tool's own execution timeout; zero uses the
	// caller's default (tools.Timeouter).
	ExecTimeout time.Duration
}

BaseTool provides a reusable base implementation of the tools.Tool interface. Concrete tools can embed BaseTool and override Execute.

func (*BaseTool) Description

func (b *BaseTool) Description() string

func (*BaseTool) Execute

func (b *BaseTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

Execute is a default implementation that returns an error. Concrete tools should override this method.

func (*BaseTool) InterruptBehavior

func (b *BaseTool) InterruptBehavior() tools.InterruptBehavior

func (*BaseTool) IsConcurrencySafe

func (b *BaseTool) IsConcurrencySafe(input map[string]any) bool

func (*BaseTool) IsReadOnly

func (b *BaseTool) IsReadOnly() bool

func (*BaseTool) Name

func (b *BaseTool) Name() string

func (*BaseTool) Parameters

func (b *BaseTool) Parameters() json.RawMessage

func (*BaseTool) Timeout

func (b *BaseTool) Timeout() time.Duration

func (*BaseTool) ValidateInput

func (b *BaseTool) ValidateInput(input map[string]any) error

ValidateInput checks that all required fields are present and non-empty.

type BashTool

type BashTool struct {
	BaseTool
	// contains filtered or unexported fields
}

BashTool executes shell commands in the workspace directory.

func NewBashTool

func NewBashTool(workspace string, policy *sandbox.Policy) *BashTool

NewBashTool creates a BashTool bound to the given workspace directory. Its commands run under policy's OS sandbox when it is enabled and one is available (2.0 W4); nil runs them with the denylist alone.

func (*BashTool) Execute

func (t *BashTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

func (*BashTool) RiskLevel

func (t *BashTool) RiskLevel(input map[string]any) string

RiskLevel rates a bash call for the permission prompt (tools.RiskRater): "destructive" when the command deletes, overwrites or kills (anything the bash tool refuses, the destructive-bash rule fires on, or a destructive verb anywhere in the line, nested shells included), else "write". A call with no readable command is rated destructive.

type BlockmonConfig

type BlockmonConfig struct {
	AlchemyAPIKey       string
	WebhookURL          string
	DefaultNetwork      string
	PollIntervalSeconds int
}

BlockmonConfig holds blockchain monitoring configuration.

type BlockmonTool

type BlockmonTool struct {
	BaseTool
	// contains filtered or unexported fields
}

BlockmonTool provides real-time blockchain monitoring.

func NewBlockmonTool

func NewBlockmonTool(configLoader ConfigLoader) *BlockmonTool

NewBlockmonTool creates a BlockmonTool.

func (*BlockmonTool) Execute

func (t *BlockmonTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type CodeGraphTool

type CodeGraphTool struct {
	BaseTool
	// contains filtered or unexported fields
}

CodeGraphTool queries call relationships in the code graph. Supports queries like "what calls X", "callers of Z". Edge kinds are calls, references (Go: a function taken as a value) and implements (Go: interface method to implementing method); embeds are not tracked.

func NewCodeGraphTool

func NewCodeGraphTool(indexer *codegraph.Indexer) *CodeGraphTool

NewCodeGraphTool creates a CodeGraphTool backed by the given indexer.

func (*CodeGraphTool) Execute

func (t *CodeGraphTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type CodeImpactTool

type CodeImpactTool struct {
	BaseTool
	// contains filtered or unexported fields
}

CodeImpactTool analyzes the blast radius of code changes.

func NewCodeImpactTool

func NewCodeImpactTool(indexer *codegraph.Indexer) *CodeImpactTool

func (*CodeImpactTool) Execute

func (t *CodeImpactTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type CodeReviewTool

type CodeReviewTool struct {
	BaseTool
	// contains filtered or unexported fields
}

CodeReviewTool performs automated code review using structural analysis of the code graph. It detects issues that grep alone can't find by combining graph connectivity (edges, call chains) with body content analysis in a single pass over all indexed functions.

func NewCodeReviewTool

func NewCodeReviewTool(indexer *codegraph.Indexer) *CodeReviewTool

NewCodeReviewTool creates the unified graph-based code review tool.

func (*CodeReviewTool) Execute

func (t *CodeReviewTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type CodeSearchTool

type CodeSearchTool struct {
	BaseTool
	// contains filtered or unexported fields
}

CodeSearchTool searches the code graph for symbols matching a query. Supports semantic search (MinHash similarity) and keyword search (exact match).

func NewCodeSearchTool

func NewCodeSearchTool(indexer *codegraph.Indexer) *CodeSearchTool

NewCodeSearchTool creates a CodeSearchTool backed by the given indexer.

func (*CodeSearchTool) Execute

func (t *CodeSearchTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type CodeSnapshotTool

type CodeSnapshotTool struct {
	BaseTool
	// contains filtered or unexported fields
}

CodeSnapshotTool takes and manages graph snapshots.

func NewCodeSnapshotTool

func NewCodeSnapshotTool(indexer *codegraph.Indexer) *CodeSnapshotTool

func (*CodeSnapshotTool) Execute

func (t *CodeSnapshotTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type CodeSymbolsTool

type CodeSymbolsTool struct {
	BaseTool
	// contains filtered or unexported fields
}

CodeSymbolsTool lists symbols in a file or package without reading full source. Solves the "main.go is 3000 lines" problem by showing what's in a file before the model decides what to read.

func NewCodeSymbolsTool

func NewCodeSymbolsTool(indexer *codegraph.Indexer) *CodeSymbolsTool

NewCodeSymbolsTool creates a CodeSymbolsTool backed by the given indexer.

func (*CodeSymbolsTool) Execute

func (t *CodeSymbolsTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type CollectionsSearchTool

type CollectionsSearchTool struct {
	BaseTool
	// contains filtered or unexported fields
}

CollectionsSearchTool searches xAI collections using the documents/search API. This is the explicit RAG search — not the implicit collection_ids parameter on chat completions, which xAI doesn't reliably use for retrieval.

func NewCollectionsSearchTool

func NewCollectionsSearchTool(cfg *config.Config) *CollectionsSearchTool

NewCollectionsSearchTool creates a collections search tool.

func (*CollectionsSearchTool) Execute

func (t *CollectionsSearchTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type ConfigLoader

type ConfigLoader interface {
	GetTarotConfig() (TarotConfig, error)
	GetVeniceConfig() (VeniceConfig, error)
	GetWeatherConfig() (WeatherConfig, error)
	GetTwitchConfig() (TwitchConfig, error)
	GetYouTubeConfig() (YouTubeConfig, error)
	GetIPFSConfig() (IPFSConfig, error)
	GetAlchemyConfig() (AlchemyConfig, error)
	GetBlockmonConfig() (BlockmonConfig, error)
	GetWalletSecurityConfig() (WalletSecuritySettingsConfig, error)
}

ConfigLoader provides access to configuration values. This interface mirrors skills.ConfigLoader exactly so that config.NewConfigLoader(cfg) satisfies both.

type CurrencyTool

type CurrencyTool struct {
	BaseTool
}

CurrencyTool converts between currencies.

func NewCurrencyTool

func NewCurrencyTool() *CurrencyTool

NewCurrencyTool creates a CurrencyTool.

func (*CurrencyTool) Execute

func (t *CurrencyTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type FindToolsTool

type FindToolsTool struct {
	BaseTool
	// contains filtered or unexported fields
}

FindToolsTool lets the model search for and activate additional tools by capability when the tool it needs is hidden under discovery mode. It searches ALL registered tools (via GetAll, which is unfiltered) with BM25.

func NewFindToolsTool

func NewFindToolsTool(registry *tools.Registry) *FindToolsTool

NewFindToolsTool constructs the find_tools tool. It must be registered VISIBLE (never hidden), or the model cannot escape an empty tool list.

func (*FindToolsTool) Execute

func (t *FindToolsTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type GitLogTool

type GitLogTool struct {
	BaseTool
	// contains filtered or unexported fields
}

GitLogTool runs git log with configurable options.

func NewGitLogTool

func NewGitLogTool(workspace string) *GitLogTool

NewGitLogTool creates a GitLogTool bound to the given workspace.

func (*GitLogTool) Execute

func (t *GitLogTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type GitStatusTool

type GitStatusTool struct {
	BaseTool
	// contains filtered or unexported fields
}

GitStatusTool runs git status and git diff --stat in the workspace.

func NewGitStatusTool

func NewGitStatusTool(workspace string) *GitStatusTool

NewGitStatusTool creates a GitStatusTool bound to the given workspace.

func (*GitStatusTool) Execute

func (t *GitStatusTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type HashTool

type HashTool struct {
	BaseTool
}

HashTool generates cryptographic hashes.

func NewHashTool

func NewHashTool() *HashTool

NewHashTool creates a HashTool.

func (*HashTool) Execute

func (t *HashTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type IPFSConfig

type IPFSConfig struct {
	Provider       string
	APIKey         string
	APISecret      string
	ProjectID      string
	GatewayURL     string
	TimeoutSeconds int
}

IPFSConfig holds IPFS configuration.

type IPFSTool

type IPFSTool struct {
	BaseTool
	// contains filtered or unexported fields
}

IPFSTool provides IPFS decentralized storage operations.

func NewIPFSTool

func NewIPFSTool(configLoader ConfigLoader) *IPFSTool

NewIPFSTool creates an IPFSTool.

func (*IPFSTool) Execute

func (t *IPFSTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type ListFilesTool

type ListFilesTool struct {
	BaseTool
	// contains filtered or unexported fields
}

ListFilesTool lists files and directories inside the workspace.

func NewListFilesTool

func NewListFilesTool(workspace string) *ListFilesTool

NewListFilesTool creates a ListFilesTool bound to the given workspace directory.

func (*ListFilesTool) Execute

func (t *ListFilesTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type MonitoredWallet

type MonitoredWallet struct {
	Address string    `json:"address"` // EIP-55 checksummed
	Label   string    `json:"label"`
	Network string    `json:"network"`
	AddedAt time.Time `json:"added_at"`
}

MonitoredWallet represents a wallet being monitored

type Note

type Note struct {
	Title   string    `json:"title"`
	Content string    `json:"content"`
	Created time.Time `json:"created"`
	Updated time.Time `json:"updated"`
}

Note represents a note entry.

type NoteGetTool

type NoteGetTool struct {
	BaseTool
}

NoteGetTool retrieves a note by title.

func NewNoteGetTool

func NewNoteGetTool() *NoteGetTool

NewNoteGetTool creates a NoteGetTool.

func (*NoteGetTool) Execute

func (t *NoteGetTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type NoteListTool

type NoteListTool struct {
	BaseTool
}

NoteListTool lists all saved notes.

func NewNoteListTool

func NewNoteListTool() *NoteListTool

NewNoteListTool creates a NoteListTool.

func (*NoteListTool) Execute

func (t *NoteListTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type NoteSaveTool

type NoteSaveTool struct {
	BaseTool
}

NoteSaveTool saves a note.

func NewNoteSaveTool

func NewNoteSaveTool() *NoteSaveTool

NewNoteSaveTool creates a NoteSaveTool.

func (*NoteSaveTool) Execute

func (t *NoteSaveTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type PasswordTool

type PasswordTool struct {
	BaseTool
}

PasswordTool generates secure random passwords.

func NewPasswordTool

func NewPasswordTool() *PasswordTool

NewPasswordTool creates a PasswordTool.

func (*PasswordTool) Execute

func (t *PasswordTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type PatchFileOption

type PatchFileOption func(*PatchFileTool)

PatchFileOption configures optional dependencies for PatchFileTool.

func WithPatchFileSnapshots

func WithPatchFileSnapshots(sm *checkpoints.SnapshotManager) PatchFileOption

WithPatchFileSnapshots attaches a SnapshotManager for file checkpointing.

func WithPatchFileTracker

func WithPatchFileTracker(ft *checkpoints.FileTracker) PatchFileOption

WithPatchFileTracker attaches a FileTracker for stale detection.

type PatchFileTool

type PatchFileTool struct {
	BaseTool
	// contains filtered or unexported fields
}

PatchFileTool performs surgical string replacements in workspace files.

func NewPatchFileTool

func NewPatchFileTool(workspace string, opts ...PatchFileOption) *PatchFileTool

NewPatchFileTool creates a PatchFileTool bound to the given workspace directory. Optional dependencies can be provided for stale detection and file checkpointing.

func (*PatchFileTool) Execute

func (t *PatchFileTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type PlanFile

type PlanFile struct {
	Goal       string     `json:"goal"`
	Steps      []PlanStep `json:"steps"`
	ApprovedAt time.Time  `json:"approved_at"`
}

PlanFile is .celeste/plan.json: the approved plan.

func LoadPlan

func LoadPlan(workspace string) (*PlanFile, error)

LoadPlan reads the workspace's approved plan. A missing file is an error satisfying errors.Is(err, fs.ErrNotExist).

type PlanStep

type PlanStep struct {
	Title  string `json:"title"`
	Detail string `json:"detail,omitempty"`
	TodoID int    `json:"todo_id"`
}

PlanStep is one step of an approved plan, with the todo item it became.

type QRCodeTool

type QRCodeTool struct {
	BaseTool
}

QRCodeTool generates QR codes from text.

func NewQRCodeTool

func NewQRCodeTool() *QRCodeTool

NewQRCodeTool creates a QRCodeTool.

func (*QRCodeTool) Execute

func (t *QRCodeTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type ReadFileOption

type ReadFileOption func(*ReadFileTool)

ReadFileOption configures optional dependencies for ReadFileTool.

func WithMaxResultBytes

func WithMaxResultBytes(n int) ReadFileOption

WithMaxResultBytes overrides the returned-content byte budget (mainly for tests).

func WithReadFileTracker

func WithReadFileTracker(ft *checkpoints.FileTracker) ReadFileOption

WithReadFileTracker attaches a FileTracker for stale detection.

type ReadFileTool

type ReadFileTool struct {
	BaseTool
	// contains filtered or unexported fields
}

ReadFileTool reads text files from the workspace.

func NewReadFileTool

func NewReadFileTool(workspace string, opts ...ReadFileOption) *ReadFileTool

NewReadFileTool creates a ReadFileTool bound to the given workspace directory. An optional FileTracker records mtimes after each read for stale detection.

func (*ReadFileTool) Execute

func (t *ReadFileTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type RecallToolResultTool

type RecallToolResultTool struct {
	BaseTool
	// contains filtered or unexported fields
}

RecallToolResultTool returns a tool result that context compaction pruned from the conversation (#174), or the full output of one the loop capped and spilled to disk when it was recorded (#211).

func NewRecallToolResultTool

func NewRecallToolResultTool(store *compact.Store) *RecallToolResultTool

NewRecallToolResultTool creates the tool over store (nil: the default ~/.celeste/tool-results/pruned).

func (*RecallToolResultTool) Execute

func (t *RecallToolResultTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type Reminder

type Reminder struct {
	ID      string    `json:"id"`
	Message string    `json:"message"`
	Time    time.Time `json:"time"`
	Created time.Time `json:"created"`
}

Reminder represents a reminder entry.

type ReminderListTool

type ReminderListTool struct {
	BaseTool
}

ReminderListTool lists all active reminders.

func NewReminderListTool

func NewReminderListTool() *ReminderListTool

NewReminderListTool creates a ReminderListTool.

func (*ReminderListTool) Execute

func (t *ReminderListTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type ReminderSetTool

type ReminderSetTool struct {
	BaseTool
}

ReminderSetTool sets a reminder.

func NewReminderSetTool

func NewReminderSetTool() *ReminderSetTool

NewReminderSetTool creates a ReminderSetTool.

func (*ReminderSetTool) Execute

func (t *ReminderSetTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type SaveMemoryTool

type SaveMemoryTool struct {
	BaseTool
	// contains filtered or unexported fields
}

SaveMemoryTool allows the LLM to persist learned facts about the project or user across conversations.

func NewSaveMemoryTool

func NewSaveMemoryTool(workspace string) *SaveMemoryTool

NewSaveMemoryTool creates a tool for saving memories to the project store.

func (*SaveMemoryTool) Execute

func (t *SaveMemoryTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type SearchTool

type SearchTool struct {
	BaseTool
	// contains filtered or unexported fields
}

SearchTool searches for text patterns in workspace files.

func NewSearchTool

func NewSearchTool(workspace string) *SearchTool

NewSearchTool creates a SearchTool bound to the given workspace directory.

func (*SearchTool) Execute

func (t *SearchTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type SecurityAlert

type SecurityAlert struct {
	ID             string         `json:"id"`             // alert_<timestamp>_<random>
	WalletAddress  string         `json:"wallet_address"` // Affected wallet
	AlertType      string         `json:"alert_type"`     // dust_attack, nft_scam, dangerous_approval, large_transfer
	Severity       string         `json:"severity"`       // low, medium, high, critical
	TxHash         string         `json:"tx_hash"`        // Transaction hash
	BlockNumber    string         `json:"block_number"`
	Description    string         `json:"description"` // Human-readable description
	Details        map[string]any `json:"details"`     // Type-specific details
	DetectedAt     time.Time      `json:"detected_at"`
	Acknowledged   bool           `json:"acknowledged"`
	AcknowledgedAt *time.Time     `json:"acknowledged_at,omitempty"`
	// Key identifies the on-chain event (network, wallet, type, tx and the
	// transfer or log within it); an event is stored once.
	Key string `json:"key,omitempty"`
}

SecurityAlert represents a detected security threat

type ShellOptions

type ShellOptions = shellrun.Options

ShellOptions is one model-chosen shell command for RunShell.

type ShellResult

type ShellResult = shellrun.Result

ShellResult is what RunShell observed.

func RunShell

func RunShell(ctx context.Context, o ShellOptions) ShellResult

RunShell runs one model-chosen shell command (ruling 1): the denylist first, then shellrun.Run (own process group, killed whole on timeout, bounded pipe wait, output cap). User-authored commands (custom tools, --verify-cmd) are trusted input and call shellrun.Run directly.

type SpliceFileOption

type SpliceFileOption func(*SpliceFileTool)

SpliceFileOption configures optional dependencies for SpliceFileTool.

func WithSpliceFileSnapshots

func WithSpliceFileSnapshots(sm *checkpoints.SnapshotManager) SpliceFileOption

WithSpliceFileSnapshots attaches a SnapshotManager for file checkpointing.

func WithSpliceFileTracker

func WithSpliceFileTracker(ft *checkpoints.FileTracker) SpliceFileOption

WithSpliceFileTracker attaches a FileTracker for stale detection.

type SpliceFileTool

type SpliceFileTool struct {
	BaseTool
	// contains filtered or unexported fields
}

SpliceFileTool moves a region of bytes between files deterministically. The model supplies paths + anchors/line-ranges — never the content itself — so a large byte-move (relocating a big block, extracting inline CSS to an external file) never routes the payload through the model, where it would be slow and a silent-corruption vector. It is the deterministic counterpart to patch_file.

func NewSpliceFileTool

func NewSpliceFileTool(workspace string, opts ...SpliceFileOption) *SpliceFileTool

NewSpliceFileTool creates a SpliceFileTool bound to the given workspace.

func (*SpliceFileTool) Execute

func (t *SpliceFileTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type SubmitPlanTool

type SubmitPlanTool struct {
	BaseTool

	// DefaultGoal, when set, supplies the goal a submission leaves out
	// (the chat's /plan <goal>).
	DefaultGoal func() string
	// Todos is the store approved steps go to: the registry's todo tool's
	// store when there is one, so the tool never overwrites them from a
	// stale copy. Nil opens the workspace's list.
	Todos *TodoStore
	// contains filtered or unexported fields
}

SubmitPlanTool is the chat's plan-mode exit: the model submits ordered steps, the user approves them in the ask modal, and the approved plan is written to .celeste/plan.json with one todo item per step. It is registered only on the chat's registry.

It reports read-only: it changes nothing until the user approves in its own modal, so it needs no permission prompt in front of that one.

func NewSubmitPlanTool

func NewSubmitPlanTool(workspace string, ask func(context.Context, tools.AskRequest) (tools.AskResponse, error), approved func(PlanFile)) *SubmitPlanTool

NewSubmitPlanTool builds submit_plan for workspace. ask presents the approval (nil or failing: headless, an error); approved runs after an approved plan is saved, with that plan (the chat leaves plan mode).

func (*SubmitPlanTool) Execute

func (t *SubmitPlanTool) Execute(ctx context.Context, input map[string]any, _ chan<- tools.ProgressEvent) (tools.ToolResult, error)

Execute validates the plan, asks the user, and on approval saves it and creates the todo items.

type TTSTool

type TTSTool struct {
	BaseTool
	// contains filtered or unexported fields
}

TTSTool generates speech audio via ElevenLabs.

func NewTTSTool

func NewTTSTool(workspace string) *TTSTool

func (*TTSTool) Execute

func (t *TTSTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type TarotConfig

type TarotConfig struct {
	FunctionURL string
	AuthToken   string
}

TarotConfig holds tarot function configuration.

type TarotTool

type TarotTool struct {
	BaseTool
	// contains filtered or unexported fields
}

TarotTool generates tarot card readings.

func NewTarotTool

func NewTarotTool(configLoader ConfigLoader) *TarotTool

NewTarotTool creates a TarotTool.

func (*TarotTool) Execute

func (t *TarotTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type TimezoneConverterTool

type TimezoneConverterTool struct {
	BaseTool
}

TimezoneConverterTool converts time between timezones.

func NewTimezoneConverterTool

func NewTimezoneConverterTool() *TimezoneConverterTool

NewTimezoneConverterTool creates a TimezoneConverterTool.

func (*TimezoneConverterTool) Execute

func (tool *TimezoneConverterTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type TodoItem

type TodoItem struct {
	ID          int    `json:"id"`
	Title       string `json:"title"`
	Description string `json:"description,omitempty"`
	Status      string `json:"status"` // "pending", "in_progress", "done"
}

TodoItem represents a single task.

type TodoStore

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

TodoStore is a thread-safe file-backed store for todo items.

func NewTodoStore

func NewTodoStore(workspace string) *TodoStore

NewTodoStore creates a TodoStore. If workspace is non-empty, persists to .celeste/tasks.json in the workspace directory.

func (*TodoStore) ClearDone

func (s *TodoStore) ClearDone() int

ClearDone removes all completed items.

func (*TodoStore) Create

func (s *TodoStore) Create(title, description string) TodoItem

Create adds a new todo item and returns it.

func (*TodoStore) Delete

func (s *TodoStore) Delete(id int) error

Delete removes an item by ID.

func (*TodoStore) List

func (s *TodoStore) List() []TodoItem

List returns all items.

func (*TodoStore) Update

func (s *TodoStore) Update(id int, status string) (TodoItem, error)

Update changes the status of an item by ID.

type TodoTool

type TodoTool struct {
	BaseTool
	// contains filtered or unexported fields
}

TodoTool is a built-in tool for managing task lists during a session.

func NewTodoTool

func NewTodoTool(workspace string) *TodoTool

NewTodoTool creates a TodoTool with file-backed persistence in the workspace.

func (*TodoTool) Execute

func (t *TodoTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

Execute runs the todo action.

func (*TodoTool) InternalState

func (t *TodoTool) InternalState(input map[string]any) bool

InternalState reports that create, update and list change (or read) only the session's todo list, which tracks the model's own progress: the permission checker auto-allows them, so an approved plan's status updates never prompt (#357). delete and clear_done still ask.

func (*TodoTool) Store

func (t *TodoTool) Store() *TodoStore

Store is the tool's todo store. It keeps the list in memory, so anything else that changes the same workspace's list while the tool is live must go through it (submit_plan), or the tool's next save overwrites it.

type TwitchConfig

type TwitchConfig struct {
	ClientID        string
	ClientSecret    string
	DefaultStreamer string
}

TwitchConfig holds Twitch API configuration.

type TwitchTool

type TwitchTool struct {
	BaseTool
	// contains filtered or unexported fields
}

TwitchTool checks if a Twitch streamer is live.

func NewTwitchTool

func NewTwitchTool(configLoader ConfigLoader) *TwitchTool

NewTwitchTool creates a TwitchTool.

func (*TwitchTool) Execute

func (t *TwitchTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type UUIDTool

type UUIDTool struct {
	BaseTool
}

UUIDTool generates UUID v4 values.

func NewUUIDTool

func NewUUIDTool() *UUIDTool

NewUUIDTool creates a UUIDTool.

func (*UUIDTool) Execute

func (t *UUIDTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type UnitConverterTool

type UnitConverterTool struct {
	BaseTool
}

UnitConverterTool converts between units of measurement.

func NewUnitConverterTool

func NewUnitConverterTool() *UnitConverterTool

NewUnitConverterTool creates a UnitConverterTool.

func (*UnitConverterTool) Execute

func (t *UnitConverterTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type UpscaleImageTool

type UpscaleImageTool struct {
	BaseTool
	// contains filtered or unexported fields
}

UpscaleImageTool upscales images using Venice.ai.

func NewUpscaleImageTool

func NewUpscaleImageTool(configLoader ConfigLoader) *UpscaleImageTool

NewUpscaleImageTool creates an UpscaleImageTool.

func (*UpscaleImageTool) Execute

func (t *UpscaleImageTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type VeniceConfig

type VeniceConfig struct {
	APIKey     string
	BaseURL    string
	Model      string // Chat model (venice-uncensored)
	ImageModel string // Image generation model (lustify-sdxl, animewan, hidream, wai-Illustrious)
	Upscaler   string
}

VeniceConfig holds Venice.ai configuration.

type WalletSecurityConfig

type WalletSecurityConfig struct {
	MonitoredWallets []MonitoredWallet `json:"monitored_wallets"`
	// LastCheckedBlock is the single checkpoint of the old file format. It
	// is read only from a file without LastCheckedBlocks and never written.
	LastCheckedBlock string `json:"last_checked_block,omitempty"`
	// LastCheckedBlocks is the scan checkpoint per network: the last block
	// fully scanned for every wallet on it. The next scan starts after it.
	LastCheckedBlocks   map[string]string `json:"last_checked_blocks,omitempty"`
	PollIntervalSeconds int               `json:"poll_interval_seconds"`
}

WalletSecurityConfig holds wallet security configuration

type WalletSecuritySettingsConfig

type WalletSecuritySettingsConfig struct {
	Enabled      bool
	PollInterval int    // seconds
	AlertLevel   string // minimum severity to alert on
}

WalletSecuritySettingsConfig holds wallet security settings.

type WalletSecurityTool

type WalletSecurityTool struct {
	BaseTool
	// contains filtered or unexported fields
}

WalletSecurityTool monitors wallet addresses for security threats.

func NewWalletSecurityTool

func NewWalletSecurityTool(configLoader ConfigLoader) *WalletSecurityTool

NewWalletSecurityTool creates a WalletSecurityTool.

func (*WalletSecurityTool) Execute

func (t *WalletSecurityTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type WeatherConfig

type WeatherConfig struct {
	DefaultZipCode string
}

WeatherConfig holds weather skill configuration.

type WeatherTool

type WeatherTool struct {
	BaseTool
	// contains filtered or unexported fields
}

WeatherTool gets weather forecast for a location.

func NewWeatherTool

func NewWeatherTool(configLoader ConfigLoader) *WeatherTool

NewWeatherTool creates a WeatherTool.

func (*WeatherTool) Execute

func (t *WeatherTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type WebFetchTool

type WebFetchTool struct {
	BaseTool
	// contains filtered or unexported fields
}

WebFetchTool fetches a URL and converts the HTML content to markdown.

Only public addresses are fetched: the address a connection actually goes to is checked when it is dialed (every redirect hop included), so a host name that resolves, or later re-resolves, to a loopback, private-network, link-local, metadata, documentation or other reserved address is refused. "web_fetch_allow_private": true in the config, or CELESTE_WEB_FETCH_ALLOW_PRIVATE=1, lifts that for local docs servers.

func NewWebFetchTool

func NewWebFetchTool() *WebFetchTool

NewWebFetchTool creates a WebFetchTool.

func (*WebFetchTool) Execute

func (t *WebFetchTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type WebSearchTool

type WebSearchTool struct {
	BaseTool
	// contains filtered or unexported fields
}

WebSearchTool performs web searches via DuckDuckGo HTML.

func NewWebSearchTool

func NewWebSearchTool() *WebSearchTool

NewWebSearchTool creates a WebSearchTool.

func (*WebSearchTool) Execute

func (t *WebSearchTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type WriteFileOption

type WriteFileOption func(*WriteFileTool)

WriteFileOption configures optional dependencies for WriteFileTool.

func WithWriteFileSnapshots

func WithWriteFileSnapshots(sm *checkpoints.SnapshotManager) WriteFileOption

WithWriteFileSnapshots attaches a SnapshotManager for file checkpointing.

func WithWriteFileTracker

func WithWriteFileTracker(ft *checkpoints.FileTracker) WriteFileOption

WithWriteFileTracker attaches a FileTracker for stale detection.

type WriteFileTool

type WriteFileTool struct {
	BaseTool
	// contains filtered or unexported fields
}

WriteFileTool writes text files to the workspace.

func NewWriteFileTool

func NewWriteFileTool(workspace string, opts ...WriteFileOption) *WriteFileTool

NewWriteFileTool creates a WriteFileTool bound to the given workspace directory. Optional dependencies can be provided for stale detection and file checkpointing.

func (*WriteFileTool) Execute

func (t *WriteFileTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

type YouTubeConfig

type YouTubeConfig struct {
	APIKey         string
	DefaultChannel string
}

YouTubeConfig holds YouTube API configuration.

type YouTubeTool

type YouTubeTool struct {
	BaseTool
	// contains filtered or unexported fields
}

YouTubeTool gets recent videos from a YouTube channel.

func NewYouTubeTool

func NewYouTubeTool(configLoader ConfigLoader) *YouTubeTool

NewYouTubeTool creates a YouTubeTool.

func (*YouTubeTool) Execute

func (t *YouTubeTool) Execute(ctx context.Context, input map[string]any, progress chan<- tools.ProgressEvent) (tools.ToolResult, error)

Jump to

Keyboard shortcuts

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