Documentation
¶
Overview ¶
Package flowstore manages flow stores (taps) for sharing AI flows via GitHub.
Index ¶
- Constants
- func GetFlowsDir() (string, error)
- type Flow
- type FlowMeta
- type GitHubFile
- type MCPMeta
- type Manifest
- type Store
- func (s *Store) AddTap(urlOrShorthand string, alias string) (string, error)
- func (s *Store) FetchFlow(tap *Tap, flowName string) ([]byte, error)
- func (s *Store) FetchManifest(tap *Tap) (*Manifest, error)
- func (s *Store) FetchManifestForceRefresh(tap *Tap) (*Manifest, error)
- func (s *Store) ForceRefreshAllManifests() error
- func (s *Store) GetAllTaps() []*Tap
- func (s *Store) GetInstalledFlowPath(tapName, flowName string) (string, bool)
- func (s *Store) GetOfficialTap() *Tap
- func (s *Store) GetStoreDir() string
- func (s *Store) GetTaps() []Tap
- func (s *Store) InstallFlow(tapName, flowName string) error
- func (s *Store) ListAllFlows() []Flow
- func (s *Store) ListAllMCPs() []TappedMCP
- func (s *Store) RemoveTap(name string) error
- func (s *Store) UninstallFlow(tapName, flowName string) error
- func (s *Store) UpdateAllManifests() error
- type StoreConfig
- type Tap
- type TappedMCP
Constants ¶
const ( // OfficialStoreName is the name of the official Astonish flow store OfficialStoreName = "official" // OfficialStoreURL is the GitHub repository for the official store OfficialStoreURL = "github.com/schardosin/astonish-flows" )
Variables ¶
This section is empty.
Functions ¶
func GetFlowsDir ¶
GetFlowsDir returns the new flows directory (for user-created flows)
Types ¶
type Flow ¶
type Flow struct {
Name string `json:"name"`
Description string `json:"description"`
Tags []string `json:"tags"`
TapName string `json:"tap_name"` // Which tap this flow belongs to
Installed bool `json:"installed"` // Whether it's installed locally
LocalPath string `json:"local_path"` // Path if installed
}
Flow represents a flow available in a store
type FlowMeta ¶
type FlowMeta struct {
Description string `yaml:"description" json:"description"`
Tags []string `yaml:"tags" json:"tags"`
}
FlowMeta contains metadata about a flow from the manifest
type GitHubFile ¶
type GitHubFile struct {
Name string `json:"name"`
Path string `json:"path"`
Type string `json:"type"` // "file" or "dir"
DownloadURL string `json:"download_url"`
Content string `json:"content"`
Encoding string `json:"encoding"`
}
GitHubFile represents a file from the GitHub API
type MCPMeta ¶ added in v1.2.8
type MCPMeta struct {
ID string `yaml:"id" json:"id"` // Unique identifier (e.g., "github.com/owner/repo")
Name string `yaml:"name" json:"name"` // Display name (can have spaces)
Description string `yaml:"description" json:"description"`
Author string `yaml:"author" json:"author"`
GithubUrl string `yaml:"githubUrl" json:"githubUrl"`
GithubStars int `yaml:"githubStars" json:"githubStars"`
RequiresApiKey bool `yaml:"requiresApiKey" json:"requiresApiKey"`
Command string `yaml:"command" json:"command"`
Args []string `yaml:"args" json:"args"`
Env map[string]string `yaml:"env" json:"env"`
Tags []string `yaml:"tags" json:"tags"`
Transport string `yaml:"transport" json:"transport"` // "stdio" or "sse"
URL string `yaml:"url" json:"url"` // For SSE transport
}
MCPMeta contains metadata about an MCP server from the manifest
type Manifest ¶
type Manifest struct {
Name string `yaml:"name" json:"name"`
Author string `yaml:"author" json:"author"`
Description string `yaml:"description" json:"description"`
Flows map[string]FlowMeta `yaml:"flows" json:"flows"`
MCPs map[string]MCPMeta `yaml:"mcps" json:"mcps"` // MCP servers from this tap
}
Manifest represents the required manifest.yaml in a tap repository
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store manages all flow stores
func (*Store) AddTap ¶
AddTap adds a new tap by GitHub URL with smart naming: - "owner" → assumes owner/astonish-flows, tap name = "owner" - "owner/repo" → if repo != "astonish-flows", tap name = "owner-repo" - alias parameter overrides the tap name Validates that the repository exists and contains a manifest.yaml
func (*Store) FetchManifest ¶
FetchManifest fetches the manifest.yaml from a tap's GitHub repository
func (*Store) FetchManifestForceRefresh ¶ added in v1.3.0
FetchManifestForceRefresh fetches the manifest from GitHub, bypassing CDN cache Uses the commit SHA instead of branch name to guarantee no CDN caching
func (*Store) ForceRefreshAllManifests ¶ added in v1.3.0
ForceRefreshAllManifests fetches manifests from remote, ignoring all caches including GitHub CDN cache by fetching via commit SHA
func (*Store) GetAllTaps ¶
GetAllTaps returns official + custom taps
func (*Store) GetInstalledFlowPath ¶
GetInstalledFlowPath returns the path to an installed flow, if it exists
func (*Store) GetOfficialTap ¶
GetOfficialTap returns the official store tap
func (*Store) GetStoreDir ¶
GetStoreDir returns the store directory
func (*Store) InstallFlow ¶
InstallFlow downloads and caches a flow locally
func (*Store) ListAllFlows ¶
ListAllFlows returns all flows from all taps (requires manifests to be loaded)
func (*Store) ListAllMCPs ¶ added in v1.2.8
ListAllMCPs returns all MCP servers from all taps (requires manifests to be loaded)
func (*Store) UninstallFlow ¶
UninstallFlow removes a cached flow
func (*Store) UpdateAllManifests ¶
UpdateAllManifests fetches fresh manifests for all taps
type StoreConfig ¶
type StoreConfig struct {
Taps []Tap `yaml:"taps" json:"taps"`
}
StoreConfig is persisted in config.yaml
type Tap ¶
type Tap struct {
Name string `yaml:"name" json:"name"` // e.g., "myuser/my-flows" or "official"
URL string `yaml:"url" json:"url"` // Full GitHub URL
Branch string `yaml:"branch" json:"branch"` // Git branch (defaults to "main")
Manifest *Manifest `yaml:"-" json:"-"` // Cached manifest (not persisted)
}
Tap represents a flow store repository
type TappedMCP ¶ added in v1.2.8
type TappedMCP struct {
ID string `json:"id"` // Unique identifier
Name string `json:"name"` // Display name
Description string `json:"description"`
Author string `json:"author"`
GithubUrl string `json:"githubUrl"`
GithubStars int `json:"githubStars"`
RequiresApiKey bool `json:"requiresApiKey"`
Command string `json:"command"`
Args []string `json:"args"`
Env map[string]string `json:"env"`
Tags []string `json:"tags"`
Transport string `json:"transport"` // "stdio" or "sse"
URL string `json:"url"` // For SSE transport
TapName string `json:"tap_name"` // Which tap this MCP belongs to
}
TappedMCP represents an MCP server available from a tapped repository