Documentation
¶
Overview ¶
Package profilesync syncs a person's Claude Code profile through the hub's store: the room is the person's (filestore.Profile), sealed with a room key that the hub's safe keeps for the person, and the plugins the settings enable are installed on each machine. It takes over from design-sync's profile agents (design-sync-profile-*), whose rooms and key it keeps: a machine that still has a design-sync identity opens the key wrapped for it once and puts it in the safe, and from then on every machine of the person reads it from there.
Index ¶
- Constants
- Variables
- func Identities(state string) []string
- func Key(ctx context.Context, safe Safe, folder string, room Room, identities []string) ([]byte, error)
- func Mark(dir string, plugins, skills bool) error
- func Run(ctx context.Context, o Options)
- type Options
- type Reconciler
- type Room
- type Safe
Constants ¶
const KeySecret = "profile-room-key"
KeySecret is the name the room key is kept under in the person's folder of the hub's safe.
Variables ¶
var ErrNoKey = errors.New("the profile's room key is neither in the hub's safe nor wrapped for this machine")
ErrNoKey: the room has a key, and neither the safe nor any design-sync identity on this machine opens it. Another machine of the person that has one puts it in the safe as soon as it runs.
Functions ¶
func Identities ¶
Identities are design-sync's identities on this machine: its profile agents kept them in the profile's state folder (state, absolute), as agent-<person>/identity.age.
func Key ¶
func Key(ctx context.Context, safe Safe, folder string, room Room, identities []string) ([]byte, error)
Key finds the room key: the safe's; else the one design-sync wrapped for an identity on this machine (put in the safe then); else, for a room nobody keyed yet and that holds nothing, a new one (put in the safe). folder is the safe's folder of the person ("me").
Types ¶
type Options ¶
type Options struct {
Home string
Workspace string
// State is the HOME-relative folder of the sync's state, design-sync's identities and the reload mark
// ("" = storelink.DefaultProfileState).
State string
// LocalKeys are settings keys that stay on the machine besides filesync.DefaultLocalKeys ("env.MY_ROOT").
LocalKeys []string
// Claude is the CLI the plugins are installed with ("" = claude on PATH).
Claude string
// Safe is the hub's safe, the person's secrets under Folder.
Safe Safe
Folder string
Link *storelink.Link
Log *slog.Logger
}
Options say whose profile syncs and how.
type Reconciler ¶
type Reconciler struct {
Home string
Claude string // the CLI; "" = `claude` on PATH
Log *slog.Logger
// contains filtered or unexported fields
}
Reconciler installs and updates one person's plugins with the official CLI (`claude plugin …`), as that person.