kitsetup

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package kitsetup contains agent creation logic used by both the CLI binary and the SDK's kit.New(). It is internal — external SDK consumers should use kit.New() which delegates here.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildProviderConfig

func BuildProviderConfig() (*models.ProviderConfig, string, error)

BuildProviderConfig creates a *models.ProviderConfig from the current viper state. All entry points (root, script, SDK) converge through this function.

Types

type AgentSetupOptions

type AgentSetupOptions struct {
	// MCPConfig is the MCP server configuration. Required.
	MCPConfig *config.Config
	// ShowSpinner shows a loading spinner for Ollama models.
	ShowSpinner bool
	// SpinnerFunc provides the spinner implementation (nil = no spinner).
	SpinnerFunc agent.SpinnerFunc
	// UseBufferedLogger captures debug messages for later display (root
	// non-interactive path). When false a simple logger is used instead.
	UseBufferedLogger bool
	// Quiet suppresses output. Replaces the cmd package's quietFlag variable.
	Quiet bool
	// CoreTools overrides the default core tool set. If empty, core.AllTools()
	// is used. Allows SDK users to pass custom tools (e.g. with WithWorkDir).
	CoreTools []fantasy.AgentTool
	// ExtraTools are additional tools added alongside core, MCP, and extension
	// tools. They do not replace the defaults — they extend them.
	ExtraTools []fantasy.AgentTool
	// ToolWrapper is an optional function that wraps tools after extension
	// wrapping. Used by the SDK hook system. Both wrappers compose:
	// extension wrapper runs first (inner), then this wrapper (outer).
	ToolWrapper func([]fantasy.AgentTool) []fantasy.AgentTool
}

AgentSetupOptions configures agent creation.

type AgentSetupResult

type AgentSetupResult struct {
	Agent          *agent.Agent
	BufferedLogger *tools.BufferedDebugLogger
	// ExtRunner is the extension runner (nil when --no-extensions or no
	// extensions were discovered).
	ExtRunner *extensions.Runner
}

AgentSetupResult bundles the created agent and any debug logger so the caller can flush buffered messages when appropriate.

func SetupAgent

func SetupAgent(ctx context.Context, opts AgentSetupOptions) (*AgentSetupResult, error)

SetupAgent creates an agent from the current viper state + the provided options. It wraps BuildProviderConfig and agent.CreateAgent.

Jump to

Keyboard shortcuts

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