Documentation
¶
Index ¶
- Constants
- Variables
- func CanonicalDirectory(path string) (string, error)
- type File
- type ManagedFile
- type Paths
- type Profile
- type ProfileSnapshot
- type ProjectLocation
- type ProjectProfile
- type ProjectTrust
- type ProjectTrustState
- type Store
- func (s *Store) CreateProfile(name string) (Profile, error)
- func (s *Store) DeleteProfile(name string) error
- func (s *Store) Load() (File, error)
- func (s *Store) Path() string
- func (s *Store) Profile(name string) (Profile, error)
- func (s *Store) ProfileNames() ([]string, string, error)
- func (s *Store) RestoreProfile(snapshot ProfileSnapshot) error
- func (s *Store) SetDefault(name string) error
- func (s *Store) SnapshotProfile(name string) (ProfileSnapshot, error)
- func (s *Store) TrustProject(project ProjectProfile) error
- func (s *Store) UntrustProject(configPath string) (bool, error)
- func (s *Store) Update(fn func(*File) error) error
- func (s *Store) UpsertProfile(p Profile) error
Constants ¶
View Source
const ( Endpoint = "https://mcp.talentohq.com/mcp" Scope = "mcp_access" )
View Source
const ProjectConfigMaxBytes int64 = 64 << 10
Variables ¶
View Source
var ErrProjectConfigNotFound = errors.New("no .talento/config.json found")
Functions ¶
func CanonicalDirectory ¶
Types ¶
type File ¶
type File struct {
SchemaVersion int `json:"schema_version"`
DefaultProfile string `json:"default_profile,omitempty"`
Profiles map[string]Profile `json:"profiles"`
ManagedFiles map[string]ManagedFile `json:"managed_files,omitempty"`
ProjectTrust map[string]ProjectTrust `json:"project_trust,omitempty"`
UpdatedAt time.Time `json:"updated_at"`
}
type ManagedFile ¶
type ManagedFile struct {
Path string `json:"path"`
Digest string `json:"digest"`
Kind string `json:"kind"`
Agent string `json:"agent,omitempty"`
Method string `json:"method,omitempty"`
RegistrationID string `json:"registration_id,omitempty"`
Scope string `json:"scope"`
Version string `json:"version"`
UpdatedAt time.Time `json:"updated_at"`
}
type Paths ¶
func ResolvePaths ¶
type Profile ¶
type Profile struct {
Name string `json:"name"`
Endpoint string `json:"endpoint"`
ClientID string `json:"client_id,omitempty"`
RedirectURI string `json:"redirect_uri,omitempty"`
RegistrationScope string `json:"registration_scope,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type ProfileSnapshot ¶
type ProjectLocation ¶
type ProjectLocation struct {
ProjectDir string `json:"project_dir"`
ConfigPath string `json:"config_path"`
}
func LocateProjectConfig ¶
func LocateProjectConfig(start string) (ProjectLocation, error)
LocateProjectConfig performs the same canonical, nearest-ancestor and no-symlink checks as discovery without parsing the file. This lets a user remove a stale trust record even after the project file becomes malformed.
type ProjectProfile ¶
type ProjectProfile struct {
ProjectDir string `json:"project_dir"`
ConfigPath string `json:"config_path"`
Profile string `json:"profile"`
Digest string `json:"sha256"`
}
func DiscoverProjectProfile ¶
func DiscoverProjectProfile(start string) (ProjectProfile, error)
DiscoverProjectProfile resolves start to a canonical directory, walks toward the filesystem root, and parses the nearest project selector. The .talento directory and config file must both be real filesystem entries, not symlinks.
type ProjectTrust ¶
type ProjectTrust struct {
ProjectDir string `json:"project_dir"`
ConfigPath string `json:"config_path"`
Profile string `json:"profile"`
Digest string `json:"sha256"`
UpdatedAt time.Time `json:"updated_at"`
}
ProjectTrust is non-secret metadata in the owner-only global config. A record authorizes exactly one canonical path and one exact project file.
func (*ProjectTrust) UnmarshalJSON ¶
func (record *ProjectTrust) UnmarshalJSON(data []byte) error
type ProjectTrustState ¶
type ProjectTrustState string
const ( ProjectTrusted ProjectTrustState = "trusted" ProjectUntrusted ProjectTrustState = "untrusted" ProjectStale ProjectTrustState = "stale" )
func ProjectTrustStatus ¶
func ProjectTrustStatus(project ProjectProfile, records map[string]ProjectTrust) ProjectTrustState
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) DeleteProfile ¶
func (*Store) RestoreProfile ¶
func (s *Store) RestoreProfile(snapshot ProfileSnapshot) error
func (*Store) SetDefault ¶
func (*Store) SnapshotProfile ¶
func (s *Store) SnapshotProfile(name string) (ProfileSnapshot, error)
func (*Store) TrustProject ¶
func (s *Store) TrustProject(project ProjectProfile) error
func (*Store) UpsertProfile ¶
Click to show internal directories.
Click to hide internal directories.