clientconfig

package
v0.1.22 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	VersionV1     = "moltnet.client.v1"
	LegacyVersion = "spawnfile.moltnet-http-skill.v1"
	DefaultPath   = ".moltnet/config.json"
	LegacyPath    = ".spawnfile/moltnet.json"
)
View Source
const (
	MaxOutboundDMPeers = 256
)

Variables

View Source
var DefaultDiscoveryOrder = []string{
	DefaultPath,
	LegacyPath,
}

Functions

func DefaultPathForWorkspace

func DefaultPathForWorkspace(workspace string) string

func DiscoverPath

func DiscoverPath(explicit string) (string, bool, error)

Types

type AgentConfig

type AgentConfig struct {
	Name    string `json:"name,omitempty"`
	Runtime string `json:"runtime,omitempty"`
}

type AttachmentConfig

type AttachmentConfig struct {
	AgentName       string                     `json:"agent_name,omitempty"`
	Auth            AuthConfig                 `json:"auth"`
	BaseURL         string                     `json:"base_url"`
	DMs             *bridgeconfig.DMConfig     `json:"dms,omitempty"`
	OutboundDMPEers []string                   `json:"outbound_dm_peers,omitempty"`
	MemberID        string                     `json:"member_id"`
	NetworkID       string                     `json:"network_id"`
	Rooms           []bridgeconfig.RoomBinding `json:"rooms,omitempty"`
	Runtime         string                     `json:"runtime,omitempty"`
}

func (AttachmentConfig) OutboundDMPeers added in v0.1.14

func (a AttachmentConfig) OutboundDMPeers() []string

func (AttachmentConfig) ResolveToken

func (a AttachmentConfig) ResolveToken() (string, error)

func (AttachmentConfig) Validate

func (a AttachmentConfig) Validate() error

type AuthConfig

type AuthConfig struct {
	Mode         string `json:"mode"`
	Registration string `json:"registration,omitempty"`
	Token        string `json:"token,omitempty"`
	TokenEnv     string `json:"token_env,omitempty"`
	TokenPath    string `json:"token_path,omitempty"`
}

func (AuthConfig) HasTokenSource added in v0.1.1

func (a AuthConfig) HasTokenSource() bool

type Config

type Config struct {
	Version     string             `json:"version"`
	Agent       AgentConfig        `json:"agent"`
	Attachments []AttachmentConfig `json:"attachments"`
}

func LoadFile

func LoadFile(path string) (Config, error)

func (Config) ResolveAttachment

func (c Config) ResolveAttachment(networkID string) (AttachmentConfig, error)

func (Config) ResolveAttachmentFor added in v0.1.1

func (c Config) ResolveAttachmentFor(networkID string, memberID string) (AttachmentConfig, error)

func (Config) ResolveTokenPaths added in v0.1.1

func (c Config) ResolveTokenPaths(baseDir string) Config

func (Config) Validate

func (c Config) Validate() error

Jump to

Keyboard shortcuts

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