marketplace

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultCatalogURL = "https://download.op-agent.com/marketplace/latest/index.json"
)

Variables

View Source
var BuiltinManagedItems = []BuiltinItem{}

Functions

func InstallPath

func InstallPath(baseDir string, kind Kind, id string) string

func InstallPathForScope

func InstallPathForScope(baseDir string, kind Kind, id string, orgID string) string

func LegacyStatePath

func LegacyStatePath(baseDir string) string

func RequiredMarker

func RequiredMarker(kind Kind) string

func StatePath

func StatePath(baseDir string) string

Types

type ActionResult

type ActionResult struct {
	Success bool      `json:"success"`
	Error   string    `json:"error,omitempty"`
	Item    *ListItem `json:"item,omitempty"`
}

type Asset

type Asset struct {
	URL    string `json:"url"`
	SHA256 string `json:"sha256"`
}

type BuiltinItem

type BuiltinItem struct {
	Kind     Kind
	ID       string
	Required bool
}

type Catalog

type Catalog struct {
	Version     string        `json:"version"`
	GeneratedAt string        `json:"generatedAt,omitempty"`
	Items       []CatalogItem `json:"items"`
}

type CatalogItem

type CatalogItem struct {
	ID          string           `json:"id"`
	Kind        Kind             `json:"kind"`
	Name        string           `json:"name"`
	Description string           `json:"description"`
	Builtin     bool             `json:"builtin"`
	Version     string           `json:"version"`
	Assets      map[string]Asset `json:"assets"`
	Scope       string           `json:"scope,omitempty"`
	OrgID       string           `json:"orgID,omitempty"`
	OrgName     string           `json:"orgName,omitempty"`
}

type ItemStatus

type ItemStatus string
const (
	StatusNotInstalled ItemStatus = "not_installed"
	StatusInstalled    ItemStatus = "installed"
	StatusUpdateAvail  ItemStatus = "update_available"
)

type Kind

type Kind string
const (
	KindAgent Kind = "agent"
	KindSkill Kind = "skill"
	KindTool  Kind = "tool"
)

type ListItem

type ListItem struct {
	ID                 string     `json:"id"`
	Kind               Kind       `json:"kind"`
	Scope              string     `json:"scope,omitempty"`
	OrgID              string     `json:"orgID,omitempty"`
	OrgName            string     `json:"orgName,omitempty"`
	LocalName          string     `json:"localName,omitempty"`
	Name               string     `json:"name"`
	Description        string     `json:"description"`
	Builtin            bool       `json:"builtin"`
	Version            string     `json:"version,omitempty"`
	InstalledVersion   string     `json:"installedVersion,omitempty"`
	InstallPath        string     `json:"installPath"`
	SourceURL          string     `json:"sourceUrl,omitempty"`
	Managed            bool       `json:"managed"`
	UpdateAvailable    bool       `json:"updateAvailable"`
	InUse              bool       `json:"inUse"`
	Status             ItemStatus `json:"status"`
	MissingFromCatalog bool       `json:"missingFromCatalog"`
}

type ListResult

type ListResult struct {
	Items          []ListItem `json:"items"`
	CatalogVersion string     `json:"catalogVersion,omitempty"`
	GeneratedAt    string     `json:"generatedAt,omitempty"`
	Error          string     `json:"error,omitempty"`
}

type ManagedItemRecord

type ManagedItemRecord struct {
	ID               string   `json:"id"`
	Kind             Kind     `json:"kind"`
	Scope            string   `json:"scope,omitempty"`
	OrgID            string   `json:"orgID,omitempty"`
	OrgName          string   `json:"orgName,omitempty"`
	LocalName        string   `json:"localName,omitempty"`
	InstalledVersion string   `json:"installedVersion,omitempty"`
	SourceURL        string   `json:"sourceUrl,omitempty"`
	Managed          bool     `json:"managed"`
	Builtin          bool     `json:"builtin"`
	InstallPath      string   `json:"installPath"`
	ProjectedPaths   []string `json:"projectedPaths,omitempty"`
	LastCheckedAt    int64    `json:"lastCheckedAt"`
	UpdateAvailable  bool     `json:"updateAvailable"`
}

type Options

type Options struct {
	CatalogURL string
	HTTPClient *http.Client
}

type OrgListResult

type OrgListResult struct {
	Orgs  []OrgView `json:"orgs"`
	Error string    `json:"error,omitempty"`
}

type OrgView

type OrgView struct {
	ID   string `json:"id"`
	Slug string `json:"slug"`
	Name string `json:"name"`
	Role string `json:"role,omitempty"`
}

type Service

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

func NewService

func NewService(baseDir string, options Options) *Service

func (*Service) GetState

func (s *Service) GetState(ctx context.Context) (*StateResult, error)

func (*Service) InstallItem

func (s *Service) InstallItem(ctx context.Context, kind Kind, id string, usage UsageReport) (*ActionResult, error)

func (*Service) InstallOrgItem

func (s *Service) InstallOrgItem(ctx context.Context, orgID string, kind Kind, id string, usage UsageReport) (*ActionResult, error)

func (*Service) ListItems

func (s *Service) ListItems(ctx context.Context, force bool, usage UsageReport) (*ListResult, error)

func (*Service) ListItemsForOrg

func (s *Service) ListItemsForOrg(ctx context.Context, orgID string, force bool, usage UsageReport) (*ListResult, error)

func (*Service) ListOrgs

func (s *Service) ListOrgs(ctx context.Context) (*OrgListResult, error)

func (*Service) Reconcile

func (s *Service) Reconcile(ctx context.Context) error

func (*Service) Refresh

func (s *Service) Refresh(ctx context.Context, usage UsageReport) (*ListResult, error)

func (*Service) RefreshForOrg

func (s *Service) RefreshForOrg(ctx context.Context, orgID string, usage UsageReport) (*ListResult, error)

func (*Service) UpdateItem

func (s *Service) UpdateItem(ctx context.Context, kind Kind, id string, usage UsageReport) (*ActionResult, error)

func (*Service) UpdateOrgItem

func (s *Service) UpdateOrgItem(ctx context.Context, orgID string, kind Kind, id string, usage UsageReport) (*ActionResult, error)

type StateFile

type StateFile struct {
	Version            int                 `json:"version"`
	LastCatalogVersion string              `json:"lastCatalogVersion,omitempty"`
	LastCatalogAt      string              `json:"lastCatalogAt,omitempty"`
	Items              []ManagedItemRecord `json:"items"`
}

type StateResult

type StateResult struct {
	State          *StateFile `json:"state"`
	CatalogVersion string     `json:"catalogVersion,omitempty"`
	GeneratedAt    string     `json:"generatedAt,omitempty"`
}

type UsageReport

type UsageReport struct {
	Agents []string `json:"agents,omitempty"`
	Skills []string `json:"skills,omitempty"`
	Tools  []string `json:"tools,omitempty"`
}

Jump to

Keyboard shortcuts

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