assets

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Copyright © 2025 KubeRocketAI Team

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	// DefaultAgentIcon is the placeholder icon used when an agent doesn't define an icon
	DefaultAgentIcon = "🤖"

	// Source type constants
	FilesystemSourceType = "filesystem"
	EmbeddedSourceType   = "embedded"
)
View Source
const (
	// Main framework directory structure
	KrciAIDir    = ".krci-ai"
	BundleDir    = "bundle"
	DataDir      = "data"
	TasksDir     = "tasks"
	TemplatesDir = "templates"

	// GitHub tools configuration
	GitHubToolsList = "" /* 163-byte string literal not displayed */
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	Agent struct {
		Identity AgentIdentity `yaml:"identity"`
	} `yaml:"agent"`
}

Agent represents the structure of an agent YAML file

type AgentData

type AgentData struct {
	Agent struct {
		Identity struct {
			Role string `yaml:"role"`
		} `yaml:"identity"`
	} `yaml:"agent"`
}

AgentData represents the parsed YAML structure for agent files

type AgentDependencyInfo added in v0.21.3

type AgentDependencyInfo struct {
	AgentInfo
	Tasks     []string `json:"tasks"`
	Templates []string `json:"templates"`
	DataFiles []string `json:"data_files"`
}

AgentDependencyInfo extends AgentInfo with dependency information

type AgentIdentity

type AgentIdentity struct {
	Name        string `yaml:"name"`
	ID          string `yaml:"id"`
	Version     string `yaml:"version"`
	Description string `yaml:"description"`
	Role        string `yaml:"role"`
	Goal        string `yaml:"goal"`
	Icon        string `yaml:"icon"`
}

AgentIdentity represents the identity section of an agent YAML

type AgentInfo

type AgentInfo struct {
	Name        string `yaml:"name"`
	Description string `yaml:"description"`
	Role        string `yaml:"role"`
	Goal        string `yaml:"goal"`
	Icon        string `yaml:"icon"`
	FilePath    string `yaml:"-"` // Not from YAML, computed
	ShortName   string `yaml:"-"` // Not from YAML, computed
}

AgentInfo represents basic information about an agent

type AssetSource added in v0.28.0

type AssetSource interface {
	// ListAgentFiles returns a list of agent YAML file paths
	ListAgentFiles() ([]string, error)

	// ReadFile reads a file from the source
	ReadFile(path string) ([]byte, error)

	// Exists checks if a file exists in the source
	Exists(path string) bool

	// GetSourceType returns the type of source for logging/debugging
	GetSourceType() string
}

AssetSource abstracts different sources of framework assets (filesystem vs embedded)

type ClaudeIntegration

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

ClaudeIntegration implements IDEIntegration for Claude Code

func (*ClaudeIntegration) GenerateContent

func (c *ClaudeIntegration) GenerateContent(agentName, role string, yamlContent []byte) string

func (*ClaudeIntegration) GetDirectoryPath

func (c *ClaudeIntegration) GetDirectoryPath() string

func (*ClaudeIntegration) GetFileExtension

func (c *ClaudeIntegration) GetFileExtension() string

type CursorIntegration

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

CursorIntegration implements IDEIntegration for Cursor IDE

func (*CursorIntegration) GenerateContent

func (c *CursorIntegration) GenerateContent(agentName, role string, yamlContent []byte) string

func (*CursorIntegration) GetDirectoryPath

func (c *CursorIntegration) GetDirectoryPath() string

func (*CursorIntegration) GetFileExtension

func (c *CursorIntegration) GetFileExtension() string

type Discovery

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

Discovery handles discovery and parsing of framework assets from any source

func NewDiscovery

func NewDiscovery(targetDir string, embeddedAssets embed.FS) *Discovery

NewDiscovery creates a new asset discovery service for filesystem assets

func NewDiscoveryWithSource added in v0.28.0

func NewDiscoveryWithSource(targetDir string, embeddedAssets embed.FS, source AssetSource) *Discovery

NewDiscoveryWithSource creates a new asset discovery service with a specific source

func (*Discovery) DiscoverAgentWithDependencies added in v0.26.0

func (d *Discovery) DiscoverAgentWithDependencies(shortName string) (AgentDependencyInfo, error)

func (*Discovery) DiscoverAgents

func (d *Discovery) DiscoverAgents() ([]AgentInfo, error)

DiscoverAgents discovers and returns information about agents from the configured source

func (*Discovery) DiscoverAgentsWithDependencies added in v0.21.3

func (d *Discovery) DiscoverAgentsWithDependencies(agentNames ...string) ([]AgentDependencyInfo, error)

DiscoverAgentsWithDependencies discovers and returns agents with their complete dependency information. If agentNames is empty, discovers all agents (filesystem behavior). If agentNames provided, filters to specific agents (embedded behavior).

func (*Discovery) DiscoverEmbeddedAgents added in v0.28.0

func (d *Discovery) DiscoverEmbeddedAgents(embeddedAssets embed.FS) ([]AgentInfo, error)

DiscoverEmbeddedAgents discovers agents from embedded filesystem using the unified AssetSource approach

func (*Discovery) FormatAgentDependencyTable added in v0.21.3

func (d *Discovery) FormatAgentDependencyTable(agents []AgentDependencyInfo) string

FormatAgentDependencyTable formats agent dependency information as a table

func (*Discovery) FormatAgentSummary

func (d *Discovery) FormatAgentSummary(agent AgentInfo) string

FormatAgentSummary returns a formatted string summarizing agent information

func (*Discovery) GetAgentByName

func (d *Discovery) GetAgentByName(name string) (*AgentInfo, error)

GetAgentByName returns information about a specific agent by name

func (*Discovery) GetAgentByShortName added in v0.26.0

func (d *Discovery) GetAgentByShortName(shortName string) (*AgentInfo, error)

GetAgentByShortName returns information about a specific agent by short name

func (*Discovery) ListAvailableAgents

func (d *Discovery) ListAvailableAgents() ([]string, error)

ListAvailableAgents returns a simple list of agent names

func (*Discovery) ValidateAgentStructure

func (d *Discovery) ValidateAgentStructure(filePath string) error

ValidateAgentStructure performs basic validation of agent file structure

func (*Discovery) ValidateEmbeddedAgentNames added in v0.28.0

func (d *Discovery) ValidateEmbeddedAgentNames(embeddedAssets embed.FS, agentNames []string) error

ValidateEmbeddedAgentNames validates that agent names exist in embedded assets using unified validation

type EmbeddedAssetSource added in v0.28.0

type EmbeddedAssetSource interface {
	AssetSource
	// GetEmbeddedFS returns the underlying embedded filesystem for validation operations
	GetEmbeddedFS() embed.FS
}

EmbeddedAssetSource extends AssetSource with embedded-specific functionality

type EmbeddedSource added in v0.28.0

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

EmbeddedSource implements AssetSource for embedded framework assets

func NewEmbeddedSource added in v0.28.0

func NewEmbeddedSource(embeddedAssets embed.FS) *EmbeddedSource

NewEmbeddedSource creates a new embedded asset source

func (*EmbeddedSource) Exists added in v0.28.0

func (es *EmbeddedSource) Exists(path string) bool

func (*EmbeddedSource) GetEmbeddedFS added in v0.28.0

func (es *EmbeddedSource) GetEmbeddedFS() embed.FS

GetEmbeddedFS implements EmbeddedAssetSource interface

func (*EmbeddedSource) GetSourceType added in v0.28.0

func (es *EmbeddedSource) GetSourceType() string

func (*EmbeddedSource) ListAgentFiles added in v0.28.0

func (es *EmbeddedSource) ListAgentFiles() ([]string, error)

func (*EmbeddedSource) ReadFile added in v0.28.0

func (es *EmbeddedSource) ReadFile(path string) ([]byte, error)

type FilesystemSource added in v0.28.0

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

FilesystemSource implements AssetSource for installed framework files

func NewFilesystemSource added in v0.28.0

func NewFilesystemSource(baseDir string) *FilesystemSource

NewFilesystemSource creates a new filesystem-based asset source

func (*FilesystemSource) Exists added in v0.28.0

func (fs *FilesystemSource) Exists(path string) bool

func (*FilesystemSource) GetSourceType added in v0.28.0

func (fs *FilesystemSource) GetSourceType() string

func (*FilesystemSource) ListAgentFiles added in v0.28.0

func (fs *FilesystemSource) ListAgentFiles() ([]string, error)

func (*FilesystemSource) ReadFile added in v0.28.0

func (fs *FilesystemSource) ReadFile(path string) ([]byte, error)

type IDEIntegration

type IDEIntegration interface {
	GetDirectoryPath() string
	GetFileExtension() string
	GenerateContent(agentName, role string, yamlContent []byte) string
}

IDEIntegration defines the interface for IDE-specific integrations

type Installer

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

Installer handles installation of framework assets

func NewInstaller

func NewInstaller(targetDir string, embeddedAssets embed.FS) *Installer

NewInstaller creates a new asset installer

func (*Installer) GetAgentsPath

func (i *Installer) GetAgentsPath() string

GetAgentsPath returns the path to the agents directory

func (*Installer) GetClaudeCommandsPath

func (i *Installer) GetClaudeCommandsPath() string

GetClaudeCommandsPath returns the path to the Claude commands directory

func (*Installer) GetCursorRulesPath

func (i *Installer) GetCursorRulesPath() string

GetCursorRulesPath returns the path to the Cursor rules directory

func (*Installer) GetDataPath

func (i *Installer) GetDataPath() string

GetDataPath returns the path to the data directory

func (*Installer) GetInstallationPath

func (i *Installer) GetInstallationPath() string

GetInstallationPath returns the full path to the .krci-ai directory

func (*Installer) GetTasksPath

func (i *Installer) GetTasksPath() string

GetTasksPath returns the path to the tasks directory

func (*Installer) GetTemplatesPath

func (i *Installer) GetTemplatesPath() string

GetTemplatesPath returns the path to the templates directory

func (*Installer) GetVSCodeChatmodesPath

func (i *Installer) GetVSCodeChatmodesPath() string

GetVSCodeChatmodesPath returns the path to the VS Code chatmodes directory

func (*Installer) GetWindsurfRulesPath

func (i *Installer) GetWindsurfRulesPath() string

GetWindsurfRulesPath returns the path to the Windsurf rules directory

func (*Installer) Install

func (i *Installer) Install() error

Install installs framework assets to the target directory

func (*Installer) InstallClaudeIntegration

func (i *Installer) InstallClaudeIntegration() error

InstallClaudeIntegration creates .claude/commands directory and generates .md files for agents

func (*Installer) InstallCursorIntegration

func (i *Installer) InstallCursorIntegration() error

InstallCursorIntegration creates .cursor/rules directory and generates .mdc files for agents

func (*Installer) InstallSelective added in v0.28.0

func (i *Installer) InstallSelective(agentNames []string) error

InstallSelective installs only specified agents and their dependencies using existing bundle logic

func (*Installer) InstallVSCodeIntegration

func (i *Installer) InstallVSCodeIntegration() error

InstallVSCodeIntegration creates .github/chatmodes directory and generates .chatmode.md files for agents

func (*Installer) InstallWindsurfIntegration

func (i *Installer) InstallWindsurfIntegration() error

InstallWindsurfIntegration creates .windsurf/rules directory and generates .md files for agents

func (*Installer) IsInstalled

func (i *Installer) IsInstalled() bool

IsInstalled checks if the framework is properly installed in the target directory

func (*Installer) ListInstalledAgents

func (i *Installer) ListInstalledAgents() ([]string, error)

ListInstalledAgents returns a list of installed agent file names

func (*Installer) ValidateInstallation

func (i *Installer) ValidateInstallation() error

ValidateInstallation performs basic validation of the installation

type VSCodeIntegration

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

VSCodeIntegration implements IDEIntegration for VS Code

func (*VSCodeIntegration) GenerateContent

func (v *VSCodeIntegration) GenerateContent(agentName, role string, yamlContent []byte) string

func (*VSCodeIntegration) GetDirectoryPath

func (v *VSCodeIntegration) GetDirectoryPath() string

func (*VSCodeIntegration) GetFileExtension

func (v *VSCodeIntegration) GetFileExtension() string

type WindsurfIntegration

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

WindsurfIntegration implements IDEIntegration for Windsurf IDE

func (*WindsurfIntegration) GenerateContent

func (w *WindsurfIntegration) GenerateContent(agentName, role string, yamlContent []byte) string

func (*WindsurfIntegration) GetDirectoryPath

func (w *WindsurfIntegration) GetDirectoryPath() string

func (*WindsurfIntegration) GetFileExtension

func (w *WindsurfIntegration) GetFileExtension() string

Jump to

Keyboard shortcuts

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