bridgeconfig

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VersionV1 = "moltnet.bridge.v1"

	AuthModeNone   = "none"
	AuthModeBearer = "bearer"
	AuthModeOpen   = "open"

	RuntimeTinyClaw   = "tinyclaw"
	RuntimeOpenClaw   = "openclaw"
	RuntimePicoClaw   = "picoclaw"
	RuntimeClaudeCode = "claude-code"
	RuntimeCodex      = "codex"
)
View Source
const (
	DefaultOpenClawGatewayURL = "ws://127.0.0.1:18789"
	DefaultPicoClawEventsURL  = "ws://127.0.0.1:18990/pico/ws"
	DefaultPicoClawCommand    = "picoclaw"
	DefaultTinyClawBaseURL    = "http://127.0.0.1:3777"
	DefaultTinyClawChannel    = "moltnet"
	DefaultClaudeCodeCommand  = "claude"
	DefaultCodexCommand       = "codex"
)
View Source
const AgentTokenPrefix = "magt_v1_"

Variables

This section is empty.

Functions

func IsAgentToken added in v0.1.1

func IsAgentToken(value string) bool

func PrepareTokenFileWrite added in v0.1.1

func PrepareTokenFileWrite(path string) error

func ReadTokenFile added in v0.1.1

func ReadTokenFile(path string) (string, error)

func WriteTokenFile added in v0.1.1

func WriteTokenFile(path string, token string) error

Types

type AgentConfig

type AgentConfig struct {
	ID   string `json:"id" yaml:"id"`
	Name string `json:"name,omitempty" yaml:"name,omitempty"`
}

type Config

type Config struct {
	Version string        `json:"version" yaml:"version"`
	Agent   AgentConfig   `json:"agent" yaml:"agent"`
	Moltnet MoltnetConfig `json:"moltnet" yaml:"moltnet"`
	Runtime RuntimeConfig `json:"runtime" yaml:"runtime"`
	Read    ReadConfig    `json:"read,omitempty" yaml:"read,omitempty"`
	Reply   ReplyConfig   `json:"reply,omitempty" yaml:"reply,omitempty"`
	Rooms   []RoomBinding `json:"rooms,omitempty" yaml:"rooms,omitempty"`
	DMs     *DMConfig     `json:"dms,omitempty" yaml:"dms,omitempty"`
}

func LoadFile

func LoadFile(path string) (Config, error)

func (Config) Normalized added in v0.0.2

func (c Config) Normalized() Config

func (Config) ResolveTokenPaths added in v0.1.1

func (c Config) ResolveTokenPaths(baseDir string) Config

func (Config) Validate

func (c Config) Validate() error

type DMConfig

type DMConfig struct {
	Enabled bool        `json:"enabled" yaml:"enabled"`
	Read    ReadConfig  `json:"read,omitempty" yaml:"read,omitempty"`
	Reply   ReplyConfig `json:"reply,omitempty" yaml:"reply,omitempty"`
}

type MoltnetConfig

type MoltnetConfig struct {
	AuthMode    string `json:"auth_mode,omitempty" yaml:"auth_mode,omitempty"`
	BaseURL     string `json:"base_url" yaml:"base_url"`
	NetworkID   string `json:"network_id" yaml:"network_id"`
	StaticToken bool   `json:"static_token,omitempty" yaml:"static_token,omitempty"`
	Token       string `json:"token,omitempty" yaml:"token,omitempty"`
	TokenEnv    string `json:"token_env,omitempty" yaml:"token_env,omitempty"`
	TokenPath   string `json:"token_path,omitempty" yaml:"token_path,omitempty"`
}

func (MoltnetConfig) EffectiveAuthMode added in v0.1.1

func (m MoltnetConfig) EffectiveAuthMode() string

func (MoltnetConfig) HasTokenSource added in v0.1.1

func (m MoltnetConfig) HasTokenSource() bool

func (MoltnetConfig) ResolveToken added in v0.1.1

func (m MoltnetConfig) ResolveToken() (string, bool, error)

func (MoltnetConfig) ResolveTokenPath added in v0.1.1

func (m MoltnetConfig) ResolveTokenPath(baseDir string) MoltnetConfig

func (MoltnetConfig) ValidateAuth added in v0.1.1

func (m MoltnetConfig) ValidateAuth() error

type MoltnetTokenConfig added in v0.1.1

type MoltnetTokenConfig struct {
	Token     string `json:"token,omitempty" yaml:"token,omitempty"`
	TokenEnv  string `json:"token_env,omitempty" yaml:"token_env,omitempty"`
	TokenPath string `json:"token_path,omitempty" yaml:"token_path,omitempty"`
}

func (MoltnetTokenConfig) HasTokenSource added in v0.1.1

func (m MoltnetTokenConfig) HasTokenSource() bool

func (MoltnetTokenConfig) ResolveTokenPath added in v0.1.1

func (m MoltnetTokenConfig) ResolveTokenPath(baseDir string) MoltnetTokenConfig

type ReadConfig

type ReadConfig string
const (
	ReadAll        ReadConfig = "all"
	ReadMentions   ReadConfig = "mentions"
	ReadThreadOnly ReadConfig = "thread_only"
)

type ReplyConfig

type ReplyConfig string
const (
	ReplyAuto   ReplyConfig = "auto"
	ReplyManual ReplyConfig = "manual"
	ReplyNever  ReplyConfig = "never"
)

type RoomBinding

type RoomBinding struct {
	ID    string      `json:"id" yaml:"id"`
	Read  ReadConfig  `json:"read,omitempty" yaml:"read,omitempty"`
	Reply ReplyConfig `json:"reply,omitempty" yaml:"reply,omitempty"`
}

type RuntimeConfig

type RuntimeConfig struct {
	Kind             string `json:"kind" yaml:"kind"`
	Token            string `json:"token,omitempty" yaml:"token,omitempty"`
	Channel          string `json:"channel,omitempty" yaml:"channel,omitempty"`
	Command          string `json:"command,omitempty" yaml:"command,omitempty"`
	ConfigPath       string `json:"config_path,omitempty" yaml:"config_path,omitempty"`
	HomePath         string `json:"home_path,omitempty" yaml:"home_path,omitempty"`
	GatewayURL       string `json:"gateway_url,omitempty" yaml:"gateway_url,omitempty"`
	InboundURL       string `json:"inbound_url,omitempty" yaml:"inbound_url,omitempty"`
	OutboundURL      string `json:"outbound_url,omitempty" yaml:"outbound_url,omitempty"`
	AckURL           string `json:"ack_url,omitempty" yaml:"ack_url,omitempty"`
	EventsURL        string `json:"events_url,omitempty" yaml:"events_url,omitempty"`
	ControlURL       string `json:"control_url,omitempty" yaml:"control_url,omitempty"`
	WorkspacePath    string `json:"workspace_path,omitempty" yaml:"workspace_path,omitempty"`
	SessionStorePath string `json:"session_store_path,omitempty" yaml:"session_store_path,omitempty"`
	SessionPrefix    string `json:"session_prefix,omitempty" yaml:"session_prefix,omitempty"`
	Driver           string `json:"driver,omitempty" yaml:"driver,omitempty"`
}

func (RuntimeConfig) Normalized added in v0.0.2

func (r RuntimeConfig) Normalized() RuntimeConfig

Jump to

Keyboard shortcuts

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