openclaw

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetChannelAllowFrom

func GetChannelAllowFrom(ch any) []string

func GetProviderConfig

func GetProviderConfig(models *OpenClawModels) map[string]OpenClawProviderConfig

func GetProviderConfigFromDir

func GetProviderConfigFromDir(dir string) map[string]ProviderConfig

Types

type Action

type Action = internal.Action

type AgentBinding

type AgentBinding struct {
	AgentID string       `json:"agent_id"`
	Match   BindingMatch `json:"match"`
}

type AgentConfig

type AgentConfig struct {
	ID        string            `json:"id"`
	Default   bool              `json:"default,omitempty"`
	Name      string            `json:"name,omitempty"`
	Workspace string            `json:"workspace,omitempty"`
	Model     *AgentModelConfig `json:"model,omitempty"`
	Skills    []string          `json:"skills,omitempty"`
}

type AgentDefaults

type AgentDefaults struct {
	Workspace           string   `json:"workspace"`
	RestrictToWorkspace bool     `json:"restrict_to_workspace"`
	Provider            string   `json:"provider"`
	ModelName           string   `json:"model_name"`
	Model               string   `json:"model,omitempty"`
	ModelFallbacks      []string `json:"model_fallbacks,omitempty"`
	ImageModel          string   `json:"image_model,omitempty"`
	ImageModelFallbacks []string `json:"image_model_fallbacks,omitempty"`
	MaxTokens           int      `json:"max_tokens"`
	Temperature         *float64 `json:"temperature,omitempty"`
	MaxToolIterations   int      `json:"max_tool_iterations"`
}

type AgentModelConfig

type AgentModelConfig struct {
	Primary   string   `json:"primary,omitempty"`
	Fallbacks []string `json:"fallbacks,omitempty"`
}

type AgentsConfig

type AgentsConfig struct {
	Defaults AgentDefaults `json:"defaults"`
	List     []AgentConfig `json:"list,omitempty"`
}

type BindingMatch

type BindingMatch struct {
	Channel   string     `json:"channel"`
	AccountID string     `json:"account_id,omitempty"`
	Peer      *PeerMatch `json:"peer,omitempty"`
	GuildID   string     `json:"guild_id,omitempty"`
	TeamID    string     `json:"team_id,omitempty"`
}

type BraveConfig

type BraveConfig struct {
	Enabled    bool     `json:"enabled"`
	APIKey     string   `json:"api_key"`
	APIKeys    []string `json:"api_keys"`
	MaxResults int      `json:"max_results"`
}

type ChannelsConfig

type ChannelsConfig struct {
	WhatsApp WhatsAppConfig `json:"whatsapp"`
	Telegram TelegramConfig `json:"telegram"`
	Feishu   FeishuConfig   `json:"feishu"`
	Discord  DiscordConfig  `json:"discord"`
	MaixCam  MaixCamConfig  `json:"maixcam"`
	QQ       QQConfig       `json:"qq"`
	DingTalk DingTalkConfig `json:"dingtalk"`
	Slack    SlackConfig    `json:"slack"`
	Matrix   MatrixConfig   `json:"matrix"`
	LINE     LINEConfig     `json:"line"`
}

func (ChannelsConfig) ToStandardChannels

func (c ChannelsConfig) ToStandardChannels() config.ChannelsConfig

type Cost

type Cost struct {
	Input      float64 `json:"input"`
	Output     float64 `json:"output"`
	CacheRead  float64 `json:"cacheRead"`
	CacheWrite float64 `json:"cacheWrite"`
}

type CronConfig

type CronConfig struct {
	ExecTimeoutMinutes int `json:"exec_timeout_minutes"`
}

type DingTalkConfig

type DingTalkConfig struct {
	Enabled      bool     `json:"enabled"`
	ClientID     string   `json:"client_id"`
	ClientSecret string   `json:"client_secret"`
	AllowFrom    []string `json:"allow_from"`
}

type DiscordConfig

type DiscordConfig struct {
	Enabled     bool     `json:"enabled"`
	Token       string   `json:"token"`
	MentionOnly bool     `json:"mention_only"`
	AllowFrom   []string `json:"allow_from"`
}

type DuckDuckGoConfig

type DuckDuckGoConfig struct {
	Enabled    bool `json:"enabled"`
	MaxResults int  `json:"max_results"`
}

type ExecConfig

type ExecConfig struct {
	EnableDenyPatterns bool     `json:"enable_deny_patterns"`
	CustomDenyPatterns []string `json:"custom_deny_patterns"`
}

type FeishuConfig

type FeishuConfig struct {
	Enabled           bool     `json:"enabled"`
	AppID             string   `json:"app_id"`
	AppSecret         string   `json:"app_secret"`
	EncryptKey        string   `json:"encrypt_key"`
	VerificationToken string   `json:"verification_token"`
	AllowFrom         []string `json:"allow_from"`
}

type GatewayConfig

type GatewayConfig struct {
	Host string `json:"host"`
	Port int    `json:"port"`
}

func (GatewayConfig) ToStandardGateway

func (c GatewayConfig) ToStandardGateway() config.GatewayConfig

type LINEConfig

type LINEConfig struct {
	Enabled            bool     `json:"enabled"`
	ChannelSecret      string   `json:"channel_secret"`
	ChannelAccessToken string   `json:"channel_access_token"`
	WebhookHost        string   `json:"webhook_host"`
	WebhookPort        int      `json:"webhook_port"`
	WebhookPath        string   `json:"webhook_path"`
	AllowFrom          []string `json:"allow_from"`
}

type MaixCamConfig

type MaixCamConfig struct {
	Enabled   bool     `json:"enabled"`
	Host      string   `json:"host"`
	Port      int      `json:"port"`
	AllowFrom []string `json:"allow_from"`
}

type MatrixConfig added in v0.2.1

type MatrixConfig struct {
	Enabled     bool     `json:"enabled"`
	Homeserver  string   `json:"homeserver"`
	UserID      string   `json:"user_id"`
	AccessToken string   `json:"access_token"`
	AllowFrom   []string `json:"allow_from"`
}

type ModelConfig

type ModelConfig struct {
	ModelName string `json:"model_name"`
	Model     string `json:"model"`
	APIBase   string `json:"api_base,omitempty"`
	APIKey    string `json:"api_key"`
	Proxy     string `json:"proxy,omitempty"`
}

type OpenClawAgentDefaults

type OpenClawAgentDefaults struct {
	Model     *OpenClawAgentModel `json:"model"`
	Workspace *string             `json:"workspace"`
	Tools     *OpenClawAgentTools `json:"tools"`
	Identity  *string             `json:"identity"`
}

type OpenClawAgentEntry

type OpenClawAgentEntry struct {
	ID        string              `json:"id"`
	Name      *string             `json:"name"`
	Model     *OpenClawAgentModel `json:"model"`
	Tools     *OpenClawAgentTools `json:"tools"`
	Workspace *string             `json:"workspace"`
	Skills    []string            `json:"skills"`
	Identity  *string             `json:"identity"`
}

type OpenClawAgentModel

type OpenClawAgentModel struct {
	Simple    string   `json:"-"`
	Primary   *string  `json:"primary"`
	Fallbacks []string `json:"fallbacks"`
}

func (*OpenClawAgentModel) GetFallbacks

func (m *OpenClawAgentModel) GetFallbacks() []string

func (*OpenClawAgentModel) GetPrimary

func (m *OpenClawAgentModel) GetPrimary() string

type OpenClawAgentTools

type OpenClawAgentTools struct {
	Profile   *string  `json:"profile"`
	Allow     []string `json:"allow"`
	Deny      []string `json:"deny"`
	AlsoAllow []string `json:"alsoAllow"`
}

type OpenClawAgents

type OpenClawAgents struct {
	Defaults *OpenClawAgentDefaults `json:"defaults"`
	List     []OpenClawAgentEntry   `json:"list"`
}

type OpenClawAuth

type OpenClawAuth struct {
	Profiles json.RawMessage `json:"profiles"`
	Order    json.RawMessage `json:"order"`
}

type OpenClawBlueBubblesConfig

type OpenClawBlueBubblesConfig struct {
	ServerURL *string  `json:"serverUrl"`
	Password  *string  `json:"password"`
	DmPolicy  *string  `json:"dmPolicy"`
	AllowFrom []string `json:"allowFrom"`
	Enabled   *bool    `json:"enabled"`
}

type OpenClawChannels

type OpenClawChannels struct {
	Telegram    *OpenClawTelegramConfig    `json:"telegram"`
	Discord     *OpenClawDiscordConfig     `json:"discord"`
	Slack       *OpenClawSlackConfig       `json:"slack"`
	WhatsApp    *OpenClawWhatsAppConfig    `json:"whatsapp"`
	Signal      *OpenClawSignalConfig      `json:"signal"`
	Matrix      *OpenClawMatrixConfig      `json:"matrix"`
	GoogleChat  *OpenClawGoogleChatConfig  `json:"googlechat"`
	Teams       *OpenClawTeamsConfig       `json:"msteams"`
	IRC         *OpenClawIrcConfig         `json:"irc"`
	Mattermost  *OpenClawMattermostConfig  `json:"mattermost"`
	Feishu      *OpenClawFeishuConfig      `json:"feishu"`
	IMessage    *OpenClawIMessageConfig    `json:"imessage"`
	BlueBubbles *OpenClawBlueBubblesConfig `json:"bluebubbles"`
	QQ          *OpenClawQQConfig          `json:"qq"`
	DingTalk    *OpenClawDingTalkConfig    `json:"dingtalk"`
	MaixCam     *OpenClawMaixCamConfig     `json:"maixcam"`
}

type OpenClawConfig

type OpenClawConfig struct {
	Auth     *OpenClawAuth     `json:"auth"`
	Models   *OpenClawModels   `json:"models"`
	Agents   *OpenClawAgents   `json:"agents"`
	Tools    *OpenClawTools    `json:"tools"`
	Channels *OpenClawChannels `json:"channels"`
	Cron     json.RawMessage   `json:"cron"`
	Hooks    json.RawMessage   `json:"hooks"`
	Skills   *OpenClawSkills   `json:"skills"`
	Memory   json.RawMessage   `json:"memory"`
	Session  json.RawMessage   `json:"session"`
}

func LoadOpenClawConfig

func LoadOpenClawConfig(path string) (*OpenClawConfig, error)

func LoadOpenClawConfigFromDir

func LoadOpenClawConfigFromDir(dir string) (*OpenClawConfig, error)

func (*OpenClawConfig) ConvertToPicoClaw

func (c *OpenClawConfig) ConvertToPicoClaw(sourceHome string) (*PicoClawConfig, []string, error)

func (*OpenClawConfig) GetAgents

func (c *OpenClawConfig) GetAgents() []OpenClawAgentEntry

func (*OpenClawConfig) GetDefaultModel

func (c *OpenClawConfig) GetDefaultModel() (provider, model string)

func (*OpenClawConfig) GetDefaultWorkspace

func (c *OpenClawConfig) GetDefaultWorkspace() string

func (*OpenClawConfig) GetEnabled

func (c *OpenClawConfig) GetEnabled() bool

func (*OpenClawConfig) HasAuthProfiles

func (c *OpenClawConfig) HasAuthProfiles() bool

func (*OpenClawConfig) HasCron

func (c *OpenClawConfig) HasCron() bool

func (*OpenClawConfig) HasHooks

func (c *OpenClawConfig) HasHooks() bool

func (*OpenClawConfig) HasMemory

func (c *OpenClawConfig) HasMemory() bool

func (*OpenClawConfig) HasSession

func (c *OpenClawConfig) HasSession() bool

func (*OpenClawConfig) HasSkills

func (c *OpenClawConfig) HasSkills() bool

func (*OpenClawConfig) IsChannelEnabled

func (c *OpenClawConfig) IsChannelEnabled(name string) bool

type OpenClawDingTalkConfig

type OpenClawDingTalkConfig struct {
	AppID     *string  `json:"appId"`
	AppSecret *string  `json:"appSecret"`
	DmPolicy  *string  `json:"dmPolicy"`
	AllowFrom []string `json:"allowFrom"`
	Enabled   *bool    `json:"enabled"`
}

type OpenClawDiscordConfig

type OpenClawDiscordConfig struct {
	Token       *string         `json:"token"`
	Guilds      json.RawMessage `json:"guilds"`
	DmPolicy    *string         `json:"dmPolicy"`
	GroupPolicy *string         `json:"groupPolicy"`
	AllowFrom   []string        `json:"allowFrom"`
	Enabled     *bool           `json:"enabled"`
}

type OpenClawFeishuConfig

type OpenClawFeishuConfig struct {
	AppID             *string  `json:"appId"`
	AppSecret         *string  `json:"appSecret"`
	Domain            *string  `json:"domain"`
	DmPolicy          *string  `json:"dmPolicy"`
	Enabled           *bool    `json:"enabled"`
	VerificationToken *string  `json:"verificationToken"`
	EncryptKey        *string  `json:"encryptKey"`
	AllowFrom         []string `json:"allowFrom"`
}

type OpenClawGoogleChatConfig

type OpenClawGoogleChatConfig struct {
	ServiceAccountFile *string `json:"serviceAccountFile"`
	WebhookPath        *string `json:"webhookPath"`
	BotUser            *string `json:"botUser"`
	DmPolicy           *string `json:"dmPolicy"`
	Enabled            *bool   `json:"enabled"`
}

type OpenClawIMessageConfig

type OpenClawIMessageConfig struct {
	CliPath   *string  `json:"cliPath"`
	DbPath    *string  `json:"dbPath"`
	DmPolicy  *string  `json:"dmPolicy"`
	AllowFrom []string `json:"allowFrom"`
	Enabled   *bool    `json:"enabled"`
}

type OpenClawIrcConfig

type OpenClawIrcConfig struct {
	Host      *string  `json:"host"`
	Port      *int     `json:"port"`
	TLS       *bool    `json:"tls"`
	Nick      *string  `json:"nick"`
	Password  *string  `json:"password"`
	Channels  []string `json:"channels"`
	DmPolicy  *string  `json:"dmPolicy"`
	AllowFrom []string `json:"allowFrom"`
	Enabled   *bool    `json:"enabled"`
}

type OpenClawMaixCamConfig

type OpenClawMaixCamConfig struct {
	Host      *string  `json:"host"`
	Port      *int     `json:"port"`
	DmPolicy  *string  `json:"dmPolicy"`
	AllowFrom []string `json:"allowFrom"`
	Enabled   *bool    `json:"enabled"`
}

type OpenClawMatrixConfig

type OpenClawMatrixConfig struct {
	Homeserver  *string  `json:"homeserver"`
	UserID      *string  `json:"userId"`
	AccessToken *string  `json:"accessToken"`
	Rooms       []string `json:"rooms"`
	DmPolicy    *string  `json:"dmPolicy"`
	AllowFrom   []string `json:"allowFrom"`
	Enabled     *bool    `json:"enabled"`
}

type OpenClawMattermostConfig

type OpenClawMattermostConfig struct {
	BotToken  *string  `json:"botToken"`
	BaseURL   *string  `json:"baseUrl"`
	DmPolicy  *string  `json:"dmPolicy"`
	AllowFrom []string `json:"allowFrom"`
	Enabled   *bool    `json:"enabled"`
}

type OpenClawModelConfig

type OpenClawModelConfig struct {
	ID            string   `json:"id"`
	Name          string   `json:"name"`
	Reasoning     bool     `json:"reasoning"`
	Input         []string `json:"input"`
	Cost          Cost     `json:"cost"`
	ContextWindow int      `json:"contextWindow"`
	MaxTokens     int      `json:"maxTokens"`
	Api           string   `json:"api,omitempty"`
}

type OpenClawModels

type OpenClawModels struct {
	Providers map[string]json.RawMessage `json:"providers"`
}

type OpenClawProviderConfig

type OpenClawProviderConfig struct {
	APIKey  string `json:"api_key"`
	BaseURL string `json:"base_url"`
}

type OpenClawQQConfig

type OpenClawQQConfig struct {
	AppID     *string  `json:"appId"`
	AppSecret *string  `json:"appSecret"`
	DmPolicy  *string  `json:"dmPolicy"`
	AllowFrom []string `json:"allowFrom"`
	Enabled   *bool    `json:"enabled"`
}

type OpenClawSignalConfig

type OpenClawSignalConfig struct {
	HttpUrl   *string  `json:"httpUrl"`
	HttpHost  *string  `json:"httpHost"`
	HttpPort  *int     `json:"httpPort"`
	Account   *string  `json:"account"`
	DmPolicy  *string  `json:"dmPolicy"`
	AllowFrom []string `json:"allowFrom"`
	Enabled   *bool    `json:"enabled"`
}

type OpenClawSkills

type OpenClawSkills struct {
	Entries map[string]json.RawMessage `json:"entries"`
	Load    json.RawMessage            `json:"load"`
}

type OpenClawSlackConfig

type OpenClawSlackConfig struct {
	BotToken    *string  `json:"botToken"`
	AppToken    *string  `json:"appToken"`
	DmPolicy    *string  `json:"dmPolicy"`
	GroupPolicy *string  `json:"groupPolicy"`
	AllowFrom   []string `json:"allowFrom"`
	Enabled     *bool    `json:"enabled"`
}

type OpenClawTeamsConfig

type OpenClawTeamsConfig struct {
	AppID       *string  `json:"appId"`
	AppPassword *string  `json:"appPassword"`
	TenantID    *string  `json:"tenantId"`
	DmPolicy    *string  `json:"dmPolicy"`
	AllowFrom   []string `json:"allowFrom"`
	Enabled     *bool    `json:"enabled"`
}

type OpenClawTelegramConfig

type OpenClawTelegramConfig struct {
	BotToken    *string  `json:"botToken"`
	AllowFrom   []string `json:"allowFrom"`
	GroupPolicy *string  `json:"groupPolicy"`
	DmPolicy    *string  `json:"dmPolicy"`
	Enabled     *bool    `json:"enabled"`
}

type OpenClawTools

type OpenClawTools struct {
	Profile *string  `json:"profile"`
	Allow   []string `json:"allow"`
	Deny    []string `json:"deny"`
}

type OpenClawWhatsAppConfig

type OpenClawWhatsAppConfig struct {
	AuthDir     *string  `json:"authDir"`
	DmPolicy    *string  `json:"dmPolicy"`
	AllowFrom   []string `json:"allowFrom"`
	GroupPolicy *string  `json:"groupPolicy"`
	Enabled     *bool    `json:"enabled"`
	BridgeURL   *string  `json:"bridgeUrl"`
}

type OpenclawHandler

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

func (*OpenclawHandler) ExecuteConfigMigration

func (o *OpenclawHandler) ExecuteConfigMigration(srcConfigPath, dstConfigPath string) error

func (*OpenclawHandler) GetMigrateableDirs

func (o *OpenclawHandler) GetMigrateableDirs() []string

func (*OpenclawHandler) GetMigrateableFiles

func (o *OpenclawHandler) GetMigrateableFiles() []string

func (*OpenclawHandler) GetSourceConfigFile

func (o *OpenclawHandler) GetSourceConfigFile() (string, error)

func (*OpenclawHandler) GetSourceHome

func (o *OpenclawHandler) GetSourceHome() (string, error)

func (*OpenclawHandler) GetSourceName

func (o *OpenclawHandler) GetSourceName() string

func (*OpenclawHandler) GetSourceWorkspace

func (o *OpenclawHandler) GetSourceWorkspace() (string, error)

type Operation

type Operation = internal.Operation

func NewOpenclawHandler

func NewOpenclawHandler(opts Options) (Operation, error)

type Options

type Options = internal.Options

type PeerMatch

type PeerMatch struct {
	Kind string `json:"kind"`
	ID   string `json:"id"`
}

type PerplexityConfig

type PerplexityConfig struct {
	Enabled    bool     `json:"enabled"`
	APIKey     string   `json:"api_key"`
	APIKeys    []string `json:"api_keys"`
	MaxResults int      `json:"max_results"`
}

type PicoClawConfig

type PicoClawConfig struct {
	Agents    AgentsConfig   `json:"agents"`
	Bindings  []AgentBinding `json:"bindings,omitempty"`
	Channels  ChannelsConfig `json:"channels"`
	ModelList []ModelConfig  `json:"model_list"`
	Gateway   GatewayConfig  `json:"gateway"`
	Tools     ToolsConfig    `json:"tools"`
}

func (*PicoClawConfig) ToStandardConfig

func (c *PicoClawConfig) ToStandardConfig() *config.Config

type ProviderConfig

type ProviderConfig struct {
	BaseUrl string        `json:"baseUrl"`
	Api     string        `json:"api"`
	Models  []ModelConfig `json:"models"`
	ApiKey  string        `json:"apiKey"`
}

type QQConfig

type QQConfig struct {
	Enabled   bool     `json:"enabled"`
	AppID     string   `json:"app_id"`
	AppSecret string   `json:"app_secret"`
	AllowFrom []string `json:"allow_from"`
}

type Result

type Result = internal.Result

type SlackConfig

type SlackConfig struct {
	Enabled   bool     `json:"enabled"`
	BotToken  string   `json:"bot_token"`
	AppToken  string   `json:"app_token"`
	AllowFrom []string `json:"allow_from"`
}

type TavilyConfig

type TavilyConfig struct {
	Enabled    bool     `json:"enabled"`
	APIKey     string   `json:"api_key"`
	APIKeys    []string `json:"api_keys"`
	BaseURL    string   `json:"base_url"`
	MaxResults int      `json:"max_results"`
}

type TelegramConfig

type TelegramConfig struct {
	Enabled   bool     `json:"enabled"`
	Token     string   `json:"token"`
	Proxy     string   `json:"proxy"`
	AllowFrom []string `json:"allow_from"`
}

type ToolsConfig

type ToolsConfig struct {
	Web  WebToolsConfig `json:"web"`
	Cron CronConfig     `json:"cron"`
	Exec ExecConfig     `json:"exec"`
}

func (ToolsConfig) ToStandardTools

func (c ToolsConfig) ToStandardTools() config.ToolsConfig

type WebToolsConfig

type WebToolsConfig struct {
	Brave      BraveConfig      `json:"brave"`
	Tavily     TavilyConfig     `json:"tavily"`
	DuckDuckGo DuckDuckGoConfig `json:"duckduckgo"`
	Perplexity PerplexityConfig `json:"perplexity"`
	Proxy      string           `json:"proxy,omitempty"`
}

type WhatsAppConfig

type WhatsAppConfig struct {
	Enabled   bool     `json:"enabled"`
	BridgeURL string   `json:"bridge_url"`
	AllowFrom []string `json:"allow_from"`
}

Jump to

Keyboard shortcuts

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