Documentation
¶
Index ¶
- Constants
- func BuildPrompt(manifest *SkillManifest, skillContent string) string
- func DeleteManagedSourceSkill(ctx context.Context, storage ManagedSkillStorage, workspaceExternalID string, ...) error
- func ExistsInWorkspace(ctx context.Context, storage workspaceSkillStore, ...) (bool, error)
- func ExtractInstructions(data []byte) string
- func FindSkillMD(dir string) (string, error)
- func KeyToName(key string) string
- func ManagedSourceSkillName(integration string) string
- func ManagedSourceSkillSource(integration string) string
- func ManifestKey(name string) string
- func NameToPath(name string) string
- func PathToName(path string) string
- func SkillNameFromPath(path string) string
- func UpsertManagedSourceSkill(ctx context.Context, storage ManagedSkillStorage, workspaceExternalID string, ...) error
- func ValidateContent(content string) error
- func WriteInstalledMeta(skillDir string, meta *InstalledSkill) error
- type AirstoreSkillMeta
- type Copilot
- func (c *Copilot) CreateDraft(workspaceID string) *Draft
- func (c *Copilot) Generate(ctx context.Context, draft *Draft, userMessage string) (*types.SkillDraftResponse, error)
- func (c *Copilot) GenerateStream(ctx context.Context, draft *Draft, userMessage string, ...) (*types.SkillDraftResponse, error)
- func (c *Copilot) IndexDraftCreated(ctx context.Context, workspaceID, draftID, description, skillName string) error
- func (c *Copilot) IndexDraftInstalled(ctx context.Context, workspaceID, draftID, skillName string) error
- func (c *Copilot) InstallDraft(ctx context.Context, draft *Draft) (*SkillManifest, error)
- func (c *Copilot) ListDrafts(ctx context.Context, workspaceID string) ([]DraftSummary, error)
- func (c *Copilot) LoadDraft(ctx context.Context, workspaceID, draftID string) (*Draft, error)
- func (c *Copilot) PersistMessage(ctx context.Context, draftID, role, content string) error
- func (c *Copilot) PersistMeta(ctx context.Context, draft *Draft) error
- func (c *Copilot) PersistSkill(ctx context.Context, draftID, content string) error
- func (c *Copilot) PersistStatus(ctx context.Context, draftID, status string) error
- type Draft
- type DraftIndexEntry
- type DraftMessage
- type DraftSummary
- type InstalledSkill
- type ManagedSkillStorage
- type PartialSkillDraftResponse
- type SkillManifest
- func InstallContent(ctx context.Context, storage workspaceSkillStore, workspaceExternalID string, ...) (*SkillManifest, string, error)
- func Parse(data []byte) (*SkillManifest, error)
- func ParseFile(path string) (*SkillManifest, string, error)
- func ResolveInstallName(requestedName string, content []byte) (*SkillManifest, string, error)
Constants ¶
const ( Dir = types.DirNameSkills // S3 prefix (no leading slash) ManifestFile = "SKILL.md" // manifest filename InstalledMetaFile = ".installed.json" // install state file )
Variables ¶
This section is empty.
Functions ¶
func BuildPrompt ¶
func BuildPrompt(manifest *SkillManifest, skillContent string) string
BuildPrompt constructs the task prompt from a SKILL.md file's instructions. The prompt includes the skill name and the full instruction body so the agent has complete context when the hook triggers.
func DeleteManagedSourceSkill ¶ added in v0.1.71
func ExistsInWorkspace ¶ added in v0.1.103
func ExtractInstructions ¶
ExtractInstructions returns everything after the frontmatter block.
func FindSkillMD ¶
FindSkillMD looks for a SKILL.md file in a directory.
func ManagedSourceSkillName ¶ added in v0.1.71
func ManagedSourceSkillSource ¶ added in v0.1.71
func ManifestKey ¶
ManifestKey returns the S3 key for a skill's manifest: "skills/{name}/SKILL.md"
func NameToPath ¶
NameToPath converts a skill name to airstore path: "/skills/{name}"
func PathToName ¶
PathToName extracts skill name from an airstore path like "/skills/email-triage".
func SkillNameFromPath ¶
SkillNameFromPath derives a skill name from a directory path. e.g., "./email-triage/" → "email-triage"
func UpsertManagedSourceSkill ¶ added in v0.1.71
func ValidateContent ¶ added in v0.1.97
ValidateContent checks if a skill content string is a valid SKILL.md.
func WriteInstalledMeta ¶
func WriteInstalledMeta(skillDir string, meta *InstalledSkill) error
WriteInstalledMeta saves installed skill metadata to a directory.
Types ¶
type AirstoreSkillMeta ¶
type AirstoreSkillMeta struct {
Needs []string // integration names (gmail, slack, github, etc.)
Writes []string // output paths (created on install)
}
AirstoreSkillMeta holds Airstore-specific metadata extensions.
type Copilot ¶ added in v0.1.97
type Copilot struct {
// contains filtered or unexported fields
}
func NewCopilot ¶ added in v0.1.97
func NewCopilot(s2 *common.S2Client, storage *clients.StorageClient) *Copilot
func (*Copilot) CreateDraft ¶ added in v0.1.97
func (*Copilot) Generate ¶ added in v0.1.97
func (c *Copilot) Generate(ctx context.Context, draft *Draft, userMessage string) (*types.SkillDraftResponse, error)
Generate calls the BAML WriteSkill function and returns the response. It also persists messages and skill content to S2.
func (*Copilot) GenerateStream ¶ added in v0.1.97
func (c *Copilot) GenerateStream( ctx context.Context, draft *Draft, userMessage string, onChunk func(partial *PartialSkillDraftResponse), ) (*types.SkillDraftResponse, error)
GenerateStream calls the BAML WriteSkill function with streaming and sends partial results to the provided callback. Returns the final response.
func (*Copilot) IndexDraftCreated ¶ added in v0.1.97
func (*Copilot) IndexDraftInstalled ¶ added in v0.1.97
func (*Copilot) InstallDraft ¶ added in v0.1.97
InstallDraft validates and installs the current draft skill content.
func (*Copilot) ListDrafts ¶ added in v0.1.97
ListDrafts returns summaries of all drafts for a workspace.
func (*Copilot) PersistMessage ¶ added in v0.1.97
func (*Copilot) PersistMeta ¶ added in v0.1.97
func (*Copilot) PersistSkill ¶ added in v0.1.97
type Draft ¶ added in v0.1.97
type Draft struct {
ID string `json:"id"`
WorkspaceID string `json:"workspace_id"`
Status string `json:"status"` // "active", "installed", "discarded"
SkillContent string `json:"skill_content"`
Messages []DraftMessage `json:"messages"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
}
type DraftIndexEntry ¶ added in v0.1.97
type DraftIndexEntry struct {
Type string `json:"type"` // "created" or "installed"
DraftID string `json:"draft_id"`
Description string `json:"description,omitempty"`
SkillName string `json:"skill_name,omitempty"`
Timestamp int64 `json:"ts"`
}
DraftIndexEntry is appended to the workspace-level index stream.
type DraftMessage ¶ added in v0.1.97
type DraftSummary ¶ added in v0.1.97
type DraftSummary struct {
ID string `json:"id"`
Status string `json:"status"`
SkillName string `json:"skill_name,omitempty"`
Description string `json:"description,omitempty"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
}
DraftSummary is the API representation of a draft for listing.
type InstalledSkill ¶
type InstalledSkill struct {
Name string `json:"name"`
Description string `json:"description"`
Needs []string `json:"needs"`
Source string `json:"source"` // where the skill was installed from (airstore://, github.com/, or local path)
}
InstalledSkill holds runtime info about an installed skill.
func ReadInstalledMeta ¶
func ReadInstalledMeta(skillDir string) (*InstalledSkill, error)
ReadInstalledMeta loads the installed skill metadata from a directory.
type ManagedSkillStorage ¶ added in v0.1.71
type ManagedSkillStorage interface {
WorkspaceBucketName(workspaceExternalId string) string
Upload(ctx context.Context, bucket, key string, data []byte) error
ListObjects(ctx context.Context, bucket, prefix string, maxKeys int32) (*s3.ListObjectsV2Output, error)
Delete(ctx context.Context, bucket, key string) error
}
type PartialSkillDraftResponse ¶ added in v0.1.97
PartialSkillDraftResponse is a simplified view of a streaming chunk for API consumers.
type SkillManifest ¶
type SkillManifest struct {
Name string `yaml:"name"`
Description string `yaml:"description"`
License string `yaml:"license,omitempty"`
Compatibility string `yaml:"compatibility,omitempty"`
Metadata map[string]any `yaml:"metadata,omitempty"`
AllowedTools string `yaml:"allowed-tools,omitempty"`
}
SkillManifest represents the parsed frontmatter of a SKILL.md file, aligned with the Agent Skills specification (https://agentskills.io/specification).
func InstallContent ¶ added in v0.1.103
func Parse ¶
func Parse(data []byte) (*SkillManifest, error)
Parse extracts a SkillManifest from the YAML frontmatter of a SKILL.md file.
The format follows the Agent Skills specification (https://agentskills.io/specification):
---
name: email-triage
description: Categorizes emails by urgency. Use when processing Gmail inbox.
license: MIT
metadata:
author: beam-cloud
version: "1.0"
airstore:
needs:
- gmail
writes:
- /reports/email-triage/
---
# Instructions
...
func ParseFile ¶
func ParseFile(path string) (*SkillManifest, string, error)
ParseFile reads a SKILL.md file and returns its manifest and full content.
func ResolveInstallName ¶ added in v0.1.103
func ResolveInstallName(requestedName string, content []byte) (*SkillManifest, string, error)
func (*SkillManifest) AirstoreMetadata ¶
func (m *SkillManifest) AirstoreMetadata() *AirstoreSkillMeta
AirstoreMetadata returns Airstore-specific extensions from metadata.airstore.