Documentation
¶
Index ¶
- type APIError
- type ActivationSummary
- type Client
- func (c *Client) CreateSkill(name, description string) (*Skill, error)
- func (c *Client) DownloadVersion(name string, version int) ([]byte, error)
- func (c *Client) GetActivations(name string) (*ActivationSummary, error)
- func (c *Client) GetManifest() ([]ManifestEntry, error)
- func (c *Client) GetSkill(name string) (*Skill, error)
- func (c *Client) Health() error
- func (c *Client) ImportResolve(url string) (*ResolveResponse, error)
- func (c *Client) ImportSkills(source ImportSource, skillNames []string, namespace string) (*ImportResponse, error)
- func (c *Client) ImportSources() ([]ImportSourceEntry, error)
- func (c *Client) ImportUpload(archive []byte) (*ResolveResponse, error)
- func (c *Client) ListSkills(limit, offset int) ([]Skill, int, error)
- func (c *Client) ListVersions(name string) ([]Version, error)
- func (c *Client) PublishVersion(name string, archive []byte) (*Version, json.RawMessage, error)
- func (c *Client) SearchSkills(query string, limit int) ([]Skill, error)
- type DiscoveredSkill
- type FailedSkill
- type FileEntry
- type ImportResponse
- type ImportSource
- type ImportSourceEntry
- type ImportedSkill
- type ManifestEntry
- type ResolveResponse
- type Skill
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActivationSummary ¶ added in v0.7.0
type ActivationSummary struct {
TotalCount int `json:"total_count"`
UniqueDevs int `json:"unique_devs"`
LastTriggered *time.Time `json:"last_triggered"`
ByAgent map[string]int `json:"by_agent"`
}
ActivationSummary holds the activation analytics for a single skill.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client communicates with the skael platform API. Every request includes the X-API-Key header for authentication.
func (*Client) CreateSkill ¶
CreateSkill calls POST /api/skills to create a new skill record.
func (*Client) DownloadVersion ¶
DownloadVersion calls GET /api/skills/{name}/versions/{v}/download and returns the raw archive bytes.
func (*Client) GetActivations ¶ added in v0.7.0
func (c *Client) GetActivations(name string) (*ActivationSummary, error)
GetActivations calls GET /api/skills/{name}/activations and returns the activation summary for the given skill. Returns a zero-value summary when the server responds with 404.
func (*Client) GetManifest ¶
func (c *Client) GetManifest() ([]ManifestEntry, error)
GetManifest calls GET /api/sync/manifest and returns the list of manifest entries used for client-side sync diffing.
func (*Client) GetSkill ¶
GetSkill calls GET /api/skills/{name}. It returns (nil, nil) when the server responds with 404.
func (*Client) Health ¶
Health calls GET /api/health and returns an error if the server is not reachable or returns a non-ok status.
func (*Client) ImportResolve ¶
func (c *Client) ImportResolve(url string) (*ResolveResponse, error)
func (*Client) ImportSkills ¶
func (c *Client) ImportSkills(source ImportSource, skillNames []string, namespace string) (*ImportResponse, error)
func (*Client) ImportSources ¶
func (c *Client) ImportSources() ([]ImportSourceEntry, error)
func (*Client) ImportUpload ¶
func (c *Client) ImportUpload(archive []byte) (*ResolveResponse, error)
func (*Client) ListSkills ¶
ListSkills calls GET /api/skills?limit=&offset= and returns the slice of skills together with the total count reported by the server.
func (*Client) ListVersions ¶ added in v0.7.0
ListVersions calls GET /api/skills/{name}/versions and returns all versions for the skill in ascending order.
func (*Client) PublishVersion ¶
PublishVersion uploads archive (a gzip-compressed tar) to POST /api/skills/{name}/versions.
On success it returns the new Version record. On 422 (critical security scan) it returns (nil, scanBody, err) where scanBody is the raw JSON scan report embedded in the error response.
type DiscoveredSkill ¶
type FailedSkill ¶
type ImportResponse ¶
type ImportResponse struct {
Imported []ImportedSkill `json:"imported"`
Failed []FailedSkill `json:"failed"`
}
type ImportSource ¶
type ImportSourceEntry ¶
type ImportedSkill ¶
type ManifestEntry ¶
type ManifestEntry struct {
Name string `json:"name"`
Version int `json:"version"`
Checksum string `json:"checksum"`
}
ManifestEntry holds the sync metadata for a single skill.
type ResolveResponse ¶
type ResolveResponse struct {
Source ImportSource `json:"source"`
Skills []DiscoveredSkill `json:"skills"`
PluginName string `json:"plugin_name,omitempty"`
}
type Skill ¶
type Skill struct {
Name string `json:"name"`
DisplayName string `json:"display_name,omitempty"`
Description string `json:"description"`
LatestVersion int `json:"latest_version"`
Author string `json:"author"`
License string `json:"license"`
Compatibility string `json:"compatibility"`
Tags []string `json:"tags"`
SpecCompliance string `json:"spec_compliance"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Frontmatter json.RawMessage `json:"frontmatter"`
}
Skill is the client-side representation of a skill returned by the API.
type Version ¶
type Version struct {
Version int `json:"version"`
Checksum string `json:"checksum"`
Changelog string `json:"changelog"`
ScanResult json.RawMessage `json:"scan_result,omitempty"`
CreatedAt time.Time `json:"created_at"`
Created bool `json:"created"`
}
Version is the client-side representation of a published skill version.