migrate

package
v2.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2026 License: MIT Imports: 32 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Bringing in the setup of another agent program (Claude Code, Codex, OpenClaw, ...)

Index

Constants

View Source
const (
	BotIdentity = "identity"
	BotMemory   = "memory"
	BotFacts    = "facts"
	BotSkills   = "skills"
	BotRoutines = "routines"
	BotRun      = "run-routines"
	BotApps     = "apps"
)

Options every program of bots has, its things grouped by them

View Source
const (
	// Things are being taken in, or the import was cut short while they were
	Running = "running"
	Done    = "done"
	// Taken back
	Undone = "undone"
)

States of an import as the record keeps it

Variables

This section is empty.

Functions

func Digest

func Digest(value any) string

Sums up a value as JSON writes it, which two readings of the same thing share

func Entries

func Entries(text string) []string

Entries splits a markdown file into memory entries: each bullet and paragraph is its own entry, after the headings above it, without code and tables, and each entry appears once.

func FilesDigest

func FilesDigest(files map[string]string) string

Digest of files by their slash separated paths, as TreeDigest gives it of a folder that holds them, so a skill written out compares with one kept

func Folder

func Folder(cfg *config.Config, id string) string

Where one import of the profile of the settings keeps files for the user

func Frontmatter

func Frontmatter(text string) (map[string]any, string)

The fields of the YAML front matter a markdown file opens with, and the text after it. No fields for a file with none

func Home

func Home(cfg *config.Config) string

Finds the home folder of the user as the environment of the profile names it

func Masked

func Masked(name string, data []byte) []byte

A file as it is kept for the user: JSON with the values of secret named fields and the token shaped values masked, any other text with what reads as a secret masked

func Number

func Number(value any) (float64, bool)

Reads a decoded value as a number, false for one that is none

func Plain

func Plain(text string) string

JSON with its comments and the commas before a closing bracket left out, strings left as they are

func ReadJSON

func ReadJSON(path string) (map[string]any, error)

ReadJSON returns a JSON file's object, read the way programs that allow comments and trailing commas read their files. A missing file gives nil and no error.

func ReadTOML

func ReadTOML(path string) (map[string]any, error)

ReadTOML returns a TOML file's table. A missing file gives nil and no error.

func ReadText

func ReadText(path string) (string, error)

Text of a file as UTF-8 with its line ends made \n, a byte order mark and bytes that are no UTF-8 dropped

func SecretKey

func SecretKey(name string) bool

Whether a name of a field or a variable says its value is a secret, in any way it is written: OPENAI_API_KEY, apiKey, bot-token

func SkillFolders

func SkillFolders(root string, nested bool) []string

Folders below the root that hold a SKILL.md, a skill's folder not entered further, each folder once whatever links lead to it, sorted

func SkillText

func SkillText(name, title, description, body string) string

SkillText returns a SKILL.md's text: its name and description on one line as front matter, then its body, under a heading with its title when the body opens without one. The description keeps at most 1024 characters, the Agent Skills specification's limit.

func Slug

func Slug(name, fallback string) string

Slug returns a name of lower case letters, digits and dashes for a skill, a server or a folder, or the fallback when no usable character is left. It keeps at most 64 characters, the Agent Skills specification's limit for a skill name, which skill_manage enforces.

func Stamps

func Stamps(paths []string) string

Digest of files by their paths and when each last changed, which tells a later reading whether any changed or came, without reading them: for a program's sessions, which are many and large

func Strings

func Strings(value any) map[string]string

Texts of a table of names and values, the values that are no text left out

func Table

func Table(object map[string]any, key string) map[string]any

Reads the table under a key of a decoded object, nil when it holds none

func Text

func Text(value any) string

Reads a value of a decoded object as text: a string trimmed, a number or a boolean as written, empty for anything else

func Texts

func Texts(value any) []string

Reads a list value as texts, the empty ones left out. A single text as a list of it

func TreeDigest

func TreeDigest(dir string, left ...string) string

Digest of a folder: the path and the bytes of every file in it, the folders and files named left out

func Truth

func Truth(value any) bool

Whether a decoded value says yes: true, a number that is not zero, or a word that says so

func Where

func Where(p Place) string

Where returns a setup's source location, in words.

Types

type Again

type Again int

What an earlier import of the same source and place did with a thing

const (
	// It was never seen
	First Again = iota
	// It came, and it is the same at its source since
	Unchanged
	// It came, and it changed at its source since while what the import left here did not: it comes again over that
	Changed
	// It came, and it changed at its source and here since: a conflict
	Edited
	// The user left it
	Dropped
)

type App

type App struct {
	Name, URL string
}

Something a bot is connected to, an MCP server when it has a remote address

type Aside

type Aside struct {
	Source string    `json:"source"`
	Title  string    `json:"title"`
	From   string    `json:"from"`
	To     string    `json:"to"`
	At     time.Time `json:"at"`
}

A program's folder put aside at the user's ask

type Ask

type Ask struct {
	// Name of the source
	Source string
	// Where to read, the first place found when empty, none for a reply pasted
	Place string
	// Reply pasted, for a source that takes one
	Text string
	// Options taken that are off unless taken, and options left, by id
	With, Without []string
	// Which preset of the source applies, its options taken in place of those on by default
	Preset string
	// What the user gave, each value by name, such as the folder OpenClaw's workspace instructions go to
	Values map[string]string
	// Which pieces of the setup are taken, every one when none, such as the bots of a Grok Bot export
	Parts []string
	// Whether keys, tokens and passwords come too
	Keys bool
	// How a conflict is settled unless the thing is settled on its own: kept when empty
	Settle Settle
	// Things taken or left, and how each conflict is settled, by key, over what the rest says
	Choices map[string]Choice
	// Profile made for the setup, which it all comes into. The profile of the settings when empty
	Into string
	// Goes on while the program runs
	Anyway bool
}

What a user asks of a source: which setup, which of it, and how

func AskOf

func AskOf(imp Import) Ask

What the user asked of an import, asked again of its source

type Bot

type Bot struct {
	Name, Title string
	// Its role and its lasting rules
	Instructions string
	// What it remembers of the work, and what it knows of the user, one fact each
	Memories, Facts []string
	Skills          []BotSkill
	Routines        []Routine
	Apps            []App
	// MCP servers it was set up with in full
	Servers []Server
	// Where it was read, as a user reads it
	From string
}

What a program that keeps bots, such as Grok Bot or OpenBot, holds of one bot, as its export or its database tells it

type BotSkill

type BotSkill struct {
	Name, Description, Instructions, Folder string
}

A skill of a bot: its text, or the folder it is kept in

type Busy

type Busy struct {
	Said string
}

Refusal of an import, or of putting a program's folder aside, while the program runs: done all the same once the user says so

func (*Busy) Error

func (b *Busy) Error() string

type Choice

type Choice struct {
	Take   bool
	Settle Settle
}

What the user said of one thing of a plan

type Cleaned

type Cleaned struct {
	// Where the folder went, or would go
	To string
	// What the folder held that the program works with, each a phrase, said before it moves
	Held []string
}

What putting a program's folder aside did, or would do

type Did

type Did string

What landing a thing did

const (
	Added    Did = "added"
	Replaced Did = "replaced"
	Renamed  Did = "renamed"
	Merged   Did = "merged"
)

type Earlier

type Earlier func(rel string) ([]byte, bool)

A file of the profile as the snapshot taken before the import held it, false when it held none

type Field

type Field struct {
	Name, Title, About string
	// It names a folder of this computer
	Folder bool
}

A value a user may give a source, such as the folder its workspace instructions go to

type File

type File struct {
	// Where it goes inside the folder, slash separated
	Name string
	Data []byte
}

Something kept for the user as it is, such as settings with no place here, in the folder of the import

func (File) Kind

func (File) Kind() Kind

type Fit

type Fit struct {
	State State
	// What taking it in does, a phrase: "Adds the MCP server github"
	Does string
	// What the profile holds of it now, a phrase, for a conflict: "Working folder is ~/work"
	Held string
	// What keeps it from coming, a sentence, for one refused
	Why string
	// Where it lands, as a user reads it
	To string
	// Ways besides keeping what is held a conflict may be settled
	Settles []Settle
	// What the profile holds of it now, summed up, which a later import compares with what it wrote. Empty for a kind that only adds
	Digest string
	// Something to know before it comes, a sentence
	Note string
	// Why it comes only when the user takes it themselves, such as risky patterns a scan found in it. Empty for one that comes as asked
	Ask string
}

What taking a thing in would do to a profile, as the feature that takes it says

type Found

type Found struct {
	Source Source
	Places []Spot
}

A program whose setup is on this computer, with the places it keeps it and what the profile did with each

type Held

type Held struct {
	Kind  Kind   `json:"kind"`
	Title string `json:"title"`
	// What the thing was at its source as the import saw it, summed up
	Digest string `json:"digest"`
	// The user left it
	Left bool `json:"left,omitempty"`
	// What landing it did, nil for one left, one held already and one that failed
	Landed *Landed `json:"landed,omitempty"`
	// Why it failed
	Failed string `json:"failed,omitempty"`
	// Place of it among the things the import landed, from 1, which an undo goes back through last first
	Turn int `json:"turn,omitempty"`
}

What an import did with one thing

type Hook

type Hook struct {
	// Hook point, such as pre_tool_call
	Event string
	// Tools it is for, a pattern of their names, every tool when empty
	Matcher string
	Command string
	// Seconds it may take, icebath's when 0
	Timeout int
}

A command icebath runs on an event of the agent

func (Hook) Kind

func (Hook) Kind() Kind

type Identity

type Identity struct {
	// Who it was in the program, said in the heading of the text
	Name string
	Text string
}

Who the agent is, the profile's SOUL.md

func (Identity) Kind

func (Identity) Kind() Kind

type Import

type Import struct {
	ID     string    `json:"id"`
	Source string    `json:"source"`
	Title  string    `json:"title"`
	Place  string    `json:"place"`
	At     time.Time `json:"at"`
	// Which snapshot was taken before it, empty for none
	Snapshot string            `json:"snapshot,omitempty"`
	With     []string          `json:"with,omitempty"`
	Without  []string          `json:"without,omitempty"`
	Preset   string            `json:"preset,omitempty"`
	Values   map[string]string `json:"values,omitempty"`
	Parts    []string          `json:"parts,omitempty"`
	Keys     bool              `json:"keys,omitempty"`
	Settle   Settle            `json:"settle,omitempty"`
	State    string            `json:"state"`
	// What the import did with each thing it saw, by the thing's key
	Things map[string]Held `json:"things"`
	// When it was taken back
	Undone time.Time `json:"undone,omitzero"`
}

One import into a profile, with what the user asked of it so a later import asks the same

type Instructions

type Instructions struct {
	Folder, Name, Text string
}

An instruction file the agent reads in a folder it works in, such as AGENTS.md

func (Instructions) Kind

func (Instructions) Kind() Kind

type Item

type Item struct {
	Thing Thing
	Fit   Fit
	Again Again
	Take  bool
	// How it lands when it differs from what the profile holds
	Settle Settle
}

A thing of a plan: what it is, how it fits, what an earlier import did with it, and whether and how it comes

func (Item) Comes

func (i Item) Comes() bool

Whether the item comes in: taken, and settled otherwise than kept where it differs from what the profile holds

func (Item) Landing

func (i Item) Landing() Settle

Settle the item lands with: none for one the profile holds nothing of, as settled for one that differs

type Job

type Job struct {
	Name, Prompt string
	// When it runs, as a scheduled job takes it: a cron expression, every 30m, a time
	Schedule string
	// Time zone its schedule is in, the profile's when empty
	Zone string
	// It waits until the user resumes it, so it does not run twice while the program still runs it
	Paused bool
	// What it loads before it runs, skills by their names here
	Skills  []string
	Workdir string
}

A prompt the agent runs on a schedule

func (Job) Kind

func (Job) Kind() Kind

type Kind

type Kind string

What sort of thing another agent's setup holds, which decides the feature that takes it in

func (Kind) Title

func (k Kind) Title() string

What a user reads for the kind, its name for one Kinds does not hold

type KindInfo

type KindInfo struct {
	ID    Kind
	Title string
}

A kind as a plan lists it

func Kinds

func Kinds() []KindInfo

Every kind, in the order a plan lists them and an import lands them: providers and keys before the model that names them, skills before the jobs that load them

type Landed

type Landed struct {
	Did Did `json:"did"`
	// What it landed as, such as the key of a setting, the id of a provider or the path of a file. The new name of one renamed
	Name string `json:"name,omitempty"`
	// What the profile held before, for an undo. Never a secret
	Before any `json:"before,omitempty"`
	// What it wrote, summed up, which an undo and a later import compare with what is held then
	Digest string `json:"digest,omitempty"`
	// What it added piece by piece, such as entries of memory or the ids of sessions, which an undo takes out again
	Parts []string `json:"parts,omitempty"`
	// What was done, a sentence
	Said string `json:"said"`
}

What an import did with one thing, kept in the record for an undo and a later import

type Lander

type Lander struct {
	Kind Kind
	// What taking the thing in would do to the profile of the settings, read without changing anything
	Plan func(ctx context.Context, cfg *config.Config, thing Thing) Fit
	// Takes the thing in, settled as the user said for one that differs
	Land func(ctx context.Context, cfg *config.Config, thing Thing, settle Settle) (Landed, error)
	// Takes back what an import did, leaving what changed since. What it did, a sentence. Earlier reads the profile as it was
	Undo func(ctx context.Context, cfg *config.Config, landed Landed, earlier Earlier) (string, error)
}

A feature that takes in things of one kind through its own door

type Landers

type Landers []Lander

A registrant of fixed landers, which brings no source

func (Landers) Sources

func (Landers) Sources() []Source

func (Landers) Takes

func (l Landers) Takes() []Lander

type Memory

type Memory struct {
	// What the agent knows of the user, rather than its notes
	User    bool
	Entries []string
}

Entries of what the agent remembers

func (Memory) Kind

func (Memory) Kind() Kind

type Migrate

type Migrate struct {
	Registry
	// contains filtered or unexported fields
}

The setups of other agent programs every profile can bring in: the sources and the features that take what they hold, the record of each profile's imports, the snapshot taken before one and the offer made at a profile's first start

func New

func New(cfg *config.Config, pr *profile.Profiles, bk *backup.Backup) *Migrate

func (*Migrate) Again

func (m *Migrate) Again(ctx context.Context, cfg *config.Config, source, place string, anyway bool, say Progress) (Result, error)

Brings in again what changed at the source and place of the newest import of them into the profile of the settings, as the user asked of it then: what is unchanged is left, what changed there and is untouched here comes over what the import left, what changed here too stays as it is. Anyway goes on while the program runs

func (*Migrate) Apply

func (m *Migrate) Apply(ctx context.Context, cfg *config.Config, ask Ask, digest string, say Progress) (Result, error)

Brings in what the plan of the ask takes, into the profile of the settings or the one the ask makes: the snapshot first when the settings ask for one, then each thing through the feature that takes it, the record written before the first and after each. A digest given is the plan the user saw, and the import is refused when the plan is no longer that one

func (*Migrate) Clean

func (m *Migrate) Clean(ctx context.Context, cfg *config.Config, name, path string, dry, anyway bool) (Cleaned, error)

Puts the folder of the program aside at the user's ask, as OpenClaw's cleanup renames it so neither the program nor the agent takes it up again by mistake. A dry run says where it would go and what it holds. Nothing of the folder is removed, and the record of the profile keeps where it went

func (*Migrate) Found

func (m *Migrate) Found(cfg *config.Config) []Found

Programs whose setup is on this computer as the environment of the profile names it, in the order they were registered, each with the imports the profile made of it. A program none of whose places is there and that the profile never imported is left out

func (*Migrate) Plan

func (m *Migrate) Plan(ctx context.Context, cfg *config.Config, ask Ask) (Plan, error)

Plans bringing in what the source holds at the place the ask names into the profile of the settings, or the one it makes

func (*Migrate) Register

func (m *Migrate) Register(registrant Registrant)

Adds a registrant. A registry nested in the host reaches it through Host

func (*Migrate) Standings

func (m *Migrate) Standings(ctx context.Context, cfg *config.Config) ([]Standing, error)

Every setup the profile of the settings brought in and did not take back, newest first, each read again from its source and set against what its imports did, so a source that changed since is seen

func (*Migrate) Start

func (m *Migrate) Start()

Offers the profile in use, once, to bring in the setups of other agent programs found on this computer, unless the settings turn the offer off. At its first start, in the background

func (*Migrate) Telling

func (m *Migrate) Telling(tell func(profile, text string))

Has the host tell the user on a profile something once, such as the setups it found at the profile's first start

func (*Migrate) Undo

func (m *Migrate) Undo(ctx context.Context, cfg *config.Config, source, place, id string, say Progress) (Result, error)

Takes back an import into the profile of the settings, the one of the id, otherwise the newest of the source and place: what each thing of it did is undone by the feature that took it in, what changed here since is left as it is and said so

type Model

type Model struct {
	// Which provider serves it, as the setup names it: the provider of a Provider thing of the same setup or a kind of icebath. Empty for
	// the one in use
	Provider string
	Name     string
	// How hard it thinks, such as low, medium, high or xhigh, empty to leave it
	Effort string
	// Most steps one reply may take, 0 to leave it
	Turns int
	// Longest one reply may take, in seconds, 0 to leave it
	Seconds int
	// Task is the helper task that the model does, such as compression, when the model is a helper model rather than the agent's model.
	// Its provider and model land in that task's auxiliary settings.
	Task string
}

Which model the agent answers with, and how hard it thinks

func (Model) Kind

func (Model) Kind() Kind

type Option

type Option struct {
	ID, Title, About string
	// Left unless the user takes it
	Off bool
	// It moves keys, tokens or passwords
	Keys bool
}

A group of things of a source a user takes or leaves as a whole, such as an option of OpenClaw's catalog

func BotOptions

func BotOptions(product string) []Option

The options of a program of bots, the product named in their words

type Outcome

type Outcome struct {
	Key, Title string
	Kind       Kind
	// What was done, a sentence. Why it failed for one that did
	Said   string
	Failed bool
}

One thing an import or an undo did, or could not do

type Person

type Person struct {
	// Chat app, by the name icebath gives it, such as telegram
	App, ID, Name string
}

Someone who may write to the agent on a chat app

func (Person) Kind

func (Person) Kind() Kind

type Place

type Place struct {
	// Folder or file it is read from
	Path string
	// What it is, a phrase: "the folder of Claude Code", "an export in Downloads"
	Label string
}

Where a program keeps its setup on this computer

type Plan

type Plan struct {
	Source Source
	Place  Place
	// Which profile it comes into, and whether that profile is made for it
	Profile string
	Made    bool
	Items   []Item
	// Sentences said above the things, and what of the setup has no place here
	Notes, Left []string
	// Processes of the program running now
	Running []string
	// Import of the same source and place this one follows, empty for the first
	After string
	// What the plan would do, summed up, which an import checks again before it writes
	Digest string
}

What an import would do

func (Plan) Taken

func (p Plan) Taken() []Item

Items the plan takes in

type Preset

type Preset struct {
	Name, Title string
	Options     []string
}

Named set of the options of a source, taken in place of those on by default

type Progress

type Progress func(line string, outcome *Outcome)

Told as an import or an undo goes: a line a user reads, or what came of one thing

type Provider

type Provider struct {
	// What the program calls it, which a model names it by
	Name  string
	Title string
	// Where its API is reached, which tells its kind: the kind whose hosts it is on, otherwise one of an address of its own
	Address string
	// Shape its requests take when it is no kind icebath knows: openai, responses or anthropic
	API string
	// Where its key is read from, a variable as the program names it. The key itself when the program keeps one
	Variable, Key string
	// Program whose sign-in on this computer its account uses, such as Claude Code, instead of a key
	SignIn string
	// Every model the program lists for it
	Models []string
}

What a setup says of a provider of models the agent may answer with, and of the key or the sign-in its accounts use

func (Provider) Kind

func (Provider) Kind() Kind

type Reader

type Reader interface {
	// What of icebath reads the variable, as a user reads it. Empty for nothing of the registrant's
	Reads(cfg *config.Config, name string) string
}

Registrant whose feature reads variables of the profile's environment no setting names, such as the keys of voices, which a key another agent kept may go into

type Reads

type Reads func(cfg *config.Config, name string) string

What a feature says of the variables it reads, which brings no source

func (Reads) Reads

func (r Reads) Reads(cfg *config.Config, name string) string

func (Reads) Sources

func (Reads) Sources() []Source

type Record

type Record struct {
	Version int `json:"version"`
	// When the profile was told of the setups found at its first start, zero before
	Offered time.Time `json:"offered,omitzero"`
	Imports []Import  `json:"imports"`
	// Folders of programs put aside at the user's ask
	Cleaned []Aside `json:"cleaned,omitempty"`
}

What a profile brought in from other agent programs, which a profile that keeps syncing them holds a copy of

func Read

func Read(cfg *config.Config) (Record, error)

Reads the record of the profile of the settings, an empty one when it has none

func (Record) Import

func (r Record) Import(id string) (Import, bool)

Finds the import of the id, false for none

func (Record) Last

func (r Record) Last(source, place string) (Import, bool)

The newest import of the source and place that is not taken back, false for none

func (Record) Of

func (r Record) Of(source, place string) []Import

Imports of the source from the place, oldest first

func (Record) Places

func (r Record) Places() []Import

Every place the imports of the record came from, each source and place once, the newest import of each first

func (Record) Standing

func (r Record) Standing(source, place string) map[string]Held

What the profile holds of the source and place as its imports left it: the things of every import not taken back, a later one over an earlier, each with the import that did it

type Registrant

type Registrant interface {
	// Programs whose setup the registrant reads
	Sources() []Source
}

type Registry

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

func (*Registry) Host

func (r *Registry) Host() *Migrate

Hands a plugin the host the registry is nested in

func (*Registry) Reads

func (r *Registry) Reads(cfg *config.Config, name string) string

What of icebath the registrants say reads the variable, those of nested registries in their place. Empty for nothing

func (*Registry) Register

func (r *Registry) Register(registrant Registrant)

func (*Registry) Source

func (r *Registry) Source(name string) (Source, bool)

Finds the source of the name, false for none

func (*Registry) Sources

func (r *Registry) Sources() []Source

Every source the registrants bring, those of nested registries in their place, the first of a name winning

func (*Registry) Takes

func (r *Registry) Takes() []Lander

Every lander the registrants bring, those of nested registries in their place, the first of a kind winning

type Result

type Result struct {
	// Which import it was, the profile it came into, the snapshot taken before it and the folder of what it kept for the user
	ID, Profile, Snapshot, Folder string
	Outcomes                      []Outcome
	// Things that failed
	Failed int
}

What came of an import or an undo

type Routine

type Routine struct {
	Name, Instruction string
	// A cron expression, every 30m or a time a scheduled job takes. Empty for one an event starts
	Schedule string
	// What starts it when no schedule does, and its details, such as the channel it listens to
	Trigger, Details string
	Zone             string
	Paused           bool
	// What it uses, skills by their names in the program
	Skills []string
}

Work a bot runs on a schedule or on an event

type Rule

type Rule struct {
	Pattern string
	Deny    bool
}

A command the agent runs without asking, or never

func (Rule) Kind

func (Rule) Kind() Kind

type Server

type Server struct {
	Name string
	// Program run on this computer and its arguments, or the address of a server reached over HTTP
	Command string
	Args    []string
	URL     string
	// Variables it is started with and headers its requests carry that hold no secret
	Env, Headers map[string]string
	// Variables and headers that hold one, each kept in the profile's .env and named in its settings
	Secrets, SecretHeaders map[string]string
	// Variables of the profile's environment it is handed by name, such as those a program read from its own
	Passed []string
	Cwd    string
	Off    bool
	// Seconds one call may take, and connecting may take, 0 for icebath's
	Timeout, Connect float64
	// Tools it gives the agent alone, or all but these
	Include, Exclude []string
}

An MCP server the agent connects to

func ServerOf

func ServerOf(name string, entry map[string]any) (Server, bool)

ServerOf reads an MCP server entry in the format most agent programs use: command, args, env and cwd for a local program, url (or serverUrl, httpUrl) and headers for an HTTP server, disabled or enabled, and a timeout. Variables and headers with secret names or values are stored separately. It returns false for an entry without a command or an address.

func ServersOf

func ServersOf(table map[string]any) []Server

Reads a table of entries by name as servers, sorted by name

func (Server) Bare

func (s Server) Bare() Server

The server with the values of its secrets left out, their names kept, for a setup brought in without its keys

func (Server) Kind

func (Server) Kind() Kind

type Sessions

type Sessions struct {
	// Name of the session importer
	Importer string
	Paths    []string
}

Conversations of the program a session importer reads

func (Sessions) Kind

func (Sessions) Kind() Kind

type Setting

type Setting struct {
	Key   string
	Value any
	// Its values, a list, are added to the list the setting holds rather than taking its place, such as domains of a blocklist
	Add bool
}

A value for one setting of icebath, by its key

func (Setting) Kind

func (Setting) Kind() Kind

type Settle

type Settle string

How a conflict is settled

const (
	// What the profile holds stays, and the thing does not come
	Keep Settle = "keep"
	// The thing comes over what the profile holds
	Replace Settle = "replace"
	// The thing comes beside what the profile holds, under another name
	Rename Settle = "rename"
	// What the thing adds comes, what the profile holds stays
	Merge Settle = "merge"
)

type Setup

type Setup struct {
	Things []Thing
	// Sentences the plan says above the things, such as bots an export left out
	Notes []string
	// What of the setup has no place here and was left where it is, each a sentence
	Left []string
}

What a source holds at a place, read for a plan

func BotThings

func BotThings(product, category string, bots []Bot, ask Ask) Setup

Things a program of bots holds: each bot's identity, memory, facts, skills, routines and apps, the bot its part. With one bot, its role becomes who the agent is. With several, notes each named for its bot. Event routines are kept as notes to set up again, apps without a remote MCP address are left for the user to connect

type Skill

type Skill struct {
	Name        string
	Description string
	// Where it is copied from, empty for one of Files
	Folder string
	// What it is made of, each file by its path inside it, SKILL.md among them
	Files map[string]string
	// Folder of the skills it goes in, such as claude-code
	Category string
}

What a skill is made of: a folder holding SKILL.md, or its files written out

func (Skill) Kind

func (Skill) Kind() Kind

type Source

type Source struct {
	// How the record and /migrate call it: claude-code, codex, openclaw
	Name, Title string
	// What of its setup comes, a phrase: "settings, memory, skills, MCP servers and sessions"
	About string
	// Places its setup is kept on this computer as the environment of the profile names them, those there alone, the main one first
	Find func(cfg *config.Config) []Place
	// What of the setup at the place can come into a profile, read without changing anything. Ask carries the text pasted and the
	// values given
	Read func(ctx context.Context, cfg *config.Config, place Place, ask Ask) (Setup, error)
	// Groups of things a user takes or leaves as a whole, in the order a plan lists them
	Options []Option
	Presets []Preset
	Fields  []Field
	// Processes of the program running now, each a phrase a user reads before an import. nil for a program that keeps none
	Running func(ctx context.Context) []string
	// Puts the program's folder aside at the user's ask, as OpenClaw's cleanup does. nil for a program whose folder stays as it is
	Clean func(ctx context.Context, place Place, dry bool) (Cleaned, error)
	// What the user sends the program so it writes the export this source reads, empty for one whose files are read as they are
	Prompt string
	// It takes a reply pasted, such as the export a bot wrote in a chat
	Pasted bool
}

Another agent program whose setup a profile can take in

func (Source) Option

func (s Source) Option(id string) (Option, bool)

Finds the option of the id, false for none

type Sources

type Sources []Source

A registrant of fixed sources

func (Sources) Sources

func (s Sources) Sources() []Source

type Spot

type Spot struct {
	Place Place
	// Newest import of it not taken back, zero for none
	Last Import
}

A place a program keeps its setup, and the newest import of it into the profile, if any

type Standing

type Standing struct {
	// Newest import of it not taken back
	Import Import
	// Why its source can't be read again, empty when it can
	Gone string
	// Things changed at the source since and untouched here, new at the source since, and changed at the source and here too
	Changed, Fresh, Edited int
}

How a setup a profile brought in stands against its source now

func (Standing) Moved

func (s Standing) Moved() bool

Whether the source changed since it was brought in

type State

type State int

How a thing fits the profile it would come into

const (
	// Nothing of it is here: it comes in
	Fresh State = iota
	// It is here as it is there: nothing to do
	Same
	// Something of its name is here and differs: a conflict the user settles
	Differs
	// It can't come, as Why says
	Refused
)

type Taker

type Taker interface {
	Takes() []Lander
}

Taker is a registrant with a feature that imports items from other agents' setups. A registrant that only imports items returns an empty source list.

type Thing

type Thing struct {
	// Name of it within the setup, the same from one reading to the next, its kind first: "server/github", "setting/terminal.cwd"
	Key string
	// What it is, as a user reads it: "MCP server github"
	Title string
	// Where it comes from: a file, and the place in it when the file holds more, such as "~/.claude.json, mcpServers.github"
	From string
	// The group of the source it belongs to, an option the user takes or leaves as a whole
	Option string
	// The piece of the setup it belongs to when the setup holds several, such as one bot of a Grok Bot export, which the user may pick
	Part  string
	Value Value
	// Tells a later reading whether it changed at its source: a sum of what it is there, made of the value when empty
	Digest string
	// It holds a key, a token or a password: it comes only when the user brings keys, and its value never leaves this computer
	Secret bool
	// Something the user should know of it, a sentence
	Note string
}

One thing of another agent's setup that can come into a profile

func ServerThing

func ServerThing(server Server, from, option string) Thing

Thing of a server read from a file

func (Thing) Kind

func (t Thing) Kind() Kind

Says what sort of thing it is, from its value

func (Thing) Shown

func (t Thing) Shown() string

Shown returns the whole thing in one line a user reads, with every secret in it shown by its ends only.

func (Thing) Sum

func (t Thing) Sum() string

Sum returns the thing's digest at its source: the digest its source gave, otherwise its value's digest.

type Value

type Value interface {
	Kind() Kind
}

What a thing holds, of one of the types below, which says its kind

type Variable

type Variable struct {
	Name, Value string
	// Its value is a key, a token or a password
	Secret bool
}

One value of the profile's environment by its name, such as the token of a chat app, which something of icebath reads

func (Variable) Kind

func (Variable) Kind() Kind

Directories

Path Synopsis
Screen of bringing in other agents' setups: the programs found on this computer with what the profile brought in of each and whether it changed since, the plan of one with what to take and what to leave and how each conflict is settled, the import on a job page, and bringing it in again, taking it back, pasting an export and putting a program's folder aside
Screen of bringing in other agents' setups: the programs found on this computer with what the profile brought in of each and whether it changed since, the plan of one with what to take and what to leave and how each conflict is settled, the import on a job page, and bringing it in again, taking it back, pasting an export and putting a program's folder aside

Jump to

Keyboard shortcuts

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