remote

package
v1.65.6 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

* ChatCLI - Command Line Interface for LLM interaction * Copyright (c) 2024 Edilson Freitas * License: MIT

* ChatCLI - Remote Plugin Implementation * client/remote/remote_plugin.go * Copyright (c) 2024 Edilson Freitas * License: MIT

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client implements llm/client.LLMClient by delegating to a remote ChatCLI gRPC server.

func NewClient

func NewClient(cfg Config, logger *zap.Logger) (*Client, error)

NewClient creates a new remote gRPC client that implements LLMClient.

func (*Client) Close

func (c *Client) Close() error

Close closes the gRPC connection.

func (*Client) DeleteSession added in v1.65.0

func (c *Client) DeleteSession(ctx context.Context, name string) error

DeleteSession deletes a session from the remote server.

func (*Client) DownloadPlugin added in v1.60.0

func (c *Client) DownloadPlugin(ctx context.Context, pluginName, targetDir string) (string, error)

DownloadPlugin downloads a plugin binary from the server to the specified directory.

func (*Client) ExecuteRemotePlugin added in v1.60.0

func (c *Client) ExecuteRemotePlugin(ctx context.Context, pluginName string, args []string) (string, error)

ExecuteRemotePlugin executes a plugin on the remote server.

func (*Client) GetAgentDefinition added in v1.60.0

func (c *Client) GetAgentDefinition(ctx context.Context, name string) (*RemoteAgentInfo, error)

GetAgentDefinition fetches the full definition of a remote agent.

func (*Client) GetModelName

func (c *Client) GetModelName() string

GetModelName returns the remote server's model name. This satisfies the LLMClient interface.

func (*Client) GetProvider

func (c *Client) GetProvider() string

GetProvider returns the remote server's provider.

func (*Client) GetServerInfo

func (c *Client) GetServerInfo(ctx context.Context) (*ServerInfo, error)

GetServerInfo fetches server metadata including watcher status.

func (*Client) GetSkillContent added in v1.60.0

func (c *Client) GetSkillContent(ctx context.Context, name string) (*RemoteSkillInfo, error)

GetSkillContent fetches the full content of a remote skill.

func (*Client) GetWatcherStatus

func (c *Client) GetWatcherStatus(ctx context.Context) (*WatcherStatus, error)

GetWatcherStatus fetches the K8s watcher status from the server.

func (*Client) Health

func (c *Client) Health(ctx context.Context) (bool, string, error)

Health checks if the remote server is healthy.

func (*Client) ListRemoteAgents added in v1.60.0

func (c *Client) ListRemoteAgents(ctx context.Context) ([]RemoteAgentInfo, error)

ListRemoteAgents lists all agents available on the server.

func (*Client) ListRemotePlugins added in v1.60.0

func (c *Client) ListRemotePlugins(ctx context.Context) ([]RemotePluginInfo, error)

ListRemotePlugins lists all plugins available on the server.

func (*Client) ListRemoteSkills added in v1.60.0

func (c *Client) ListRemoteSkills(ctx context.Context) ([]RemoteSkillInfo, error)

ListRemoteSkills lists all skills available on the server.

func (*Client) ListSessions

func (c *Client) ListSessions(ctx context.Context) ([]string, error)

ListSessions lists sessions from the remote server.

func (*Client) LoadSession

func (c *Client) LoadSession(ctx context.Context, name string) ([]models.Message, error)

LoadSession loads a session from the remote server.

func (*Client) LoadSessionV2 added in v1.65.2

func (c *Client) LoadSessionV2(ctx context.Context, name string) (*models.SessionData, error)

LoadSessionV2 loads a full v2 session from the remote server. Falls back to v1 (chat history only) if the server doesn't support v2.

func (*Client) SaveSession

func (c *Client) SaveSession(ctx context.Context, name string, history []models.Message) error

SaveSession saves a session to the remote server.

func (*Client) SaveSessionV2 added in v1.65.2

func (c *Client) SaveSessionV2(ctx context.Context, name string, sd *models.SessionData) error

SaveSessionV2 saves a full v2 session (with scoped histories) to the remote server. It also populates the v1 messages field for backward compatibility with older servers.

func (*Client) SendPrompt

func (c *Client) SendPrompt(ctx context.Context, prompt string, history []models.Message, maxTokens int) (string, error)

SendPrompt sends a prompt to the remote server and returns the response. This satisfies the LLMClient interface.

type Config

type Config struct {
	Address        string            // server address (host:port)
	Token          string            // auth token for gRPC server authentication
	TLS            bool              // use TLS
	CertFile       string            // CA certificate file for TLS (optional)
	ClientAPIKey   string            // optional: client's own LLM API key/OAuth token (forwarded to server)
	Provider       string            // optional: override server's default provider (e.g., "GOOGLEAI")
	Model          string            // optional: override server's default model (e.g., "gemini-2.0-flash")
	ProviderConfig map[string]string // optional: provider-specific config (StackSpot, Ollama, etc.)
}

Config holds remote client configuration.

type RemoteAgentInfo added in v1.60.0

type RemoteAgentInfo struct {
	Name        string
	Description string
	Skills      []string
	Plugins     []string
	Model       string
	Content     string
}

RemoteAgentInfo holds agent metadata from the server.

type RemotePlugin added in v1.60.0

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

RemotePlugin implements the plugins.Plugin interface by delegating execution to a remote ChatCLI server via gRPC.

func NewRemotePlugin added in v1.60.0

func NewRemotePlugin(info *pb.PluginInfo, client *Client) *RemotePlugin

NewRemotePlugin creates a RemotePlugin from server-provided metadata.

func NewRemotePluginFromInfo added in v1.60.0

func NewRemotePluginFromInfo(info RemotePluginInfo, client *Client) *RemotePlugin

NewRemotePluginFromInfo creates a RemotePlugin from a RemotePluginInfo struct.

func (*RemotePlugin) Description added in v1.60.0

func (p *RemotePlugin) Description() string

func (*RemotePlugin) Execute added in v1.60.0

func (p *RemotePlugin) Execute(ctx context.Context, args []string) (string, error)

Execute runs the plugin on the remote server.

func (*RemotePlugin) ExecuteWithStream added in v1.60.0

func (p *RemotePlugin) ExecuteWithStream(ctx context.Context, args []string, onOutput func(string)) (string, error)

ExecuteWithStream runs the plugin on the remote server with optional output callback.

func (*RemotePlugin) IsRemote added in v1.60.0

func (p *RemotePlugin) IsRemote() bool

IsRemote returns true to indicate this is a remote plugin.

func (*RemotePlugin) Name added in v1.60.0

func (p *RemotePlugin) Name() string

func (*RemotePlugin) Path added in v1.60.0

func (p *RemotePlugin) Path() string

func (*RemotePlugin) Schema added in v1.60.0

func (p *RemotePlugin) Schema() string

func (*RemotePlugin) Usage added in v1.60.0

func (p *RemotePlugin) Usage() string

func (*RemotePlugin) Version added in v1.60.0

func (p *RemotePlugin) Version() string

type RemotePluginInfo added in v1.60.0

type RemotePluginInfo struct {
	Name        string
	Description string
	Usage       string
	Version     string
	Schema      string
}

RemotePluginInfo holds plugin metadata from the server.

type RemoteSkillInfo added in v1.60.0

type RemoteSkillInfo struct {
	Name         string
	Description  string
	Content      string
	AllowedTools []string
	Subskills    map[string]string
	Scripts      map[string]string
}

RemoteSkillInfo holds skill metadata from the server.

type ServerInfo

type ServerInfo struct {
	Version            string
	Provider           string
	Model              string
	AvailableProviders []string
	WatcherActive      bool
	WatcherTarget      string
	PluginCount        int32
	AgentCount         int32
	SkillCount         int32
}

ServerInfo holds server metadata returned by GetServerInfo.

type WatcherStatus

type WatcherStatus struct {
	Active        bool
	Deployment    string
	Namespace     string
	StatusSummary string
	AlertCount    int
	SnapshotCount int
	PodCount      int
}

WatcherStatus holds the K8s watcher status from the server.

Jump to

Keyboard shortcuts

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