assets

package
v0.45.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2025 License: Apache-2.0 Imports: 11 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.

Index

Constants

View Source
const (
	// Main framework directory structure
	KrciAIDir    = ".krci-ai"
	BundleDir    = "bundle"
	DataDir      = "data"
	TasksDir     = "tasks"
	TemplatesDir = "templates"

	EmbeddedPrefix = "assets/framework/core"

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

	DefaultAgentIcon = "🤖"

	// File permissions
	DirectoryPermissions = 0755 // Read, write, execute for owner; read, execute for group and others
	FilePermissions      = 0644 // Read, write for owner; read for group and others
)

Variables

This section is empty.

Functions

func GetAgentsPath added in v0.38.0

func GetAgentsPath(frameworkDir string) string

func GetDataPath added in v0.38.0

func GetDataPath(frameworkDir string) string

func GetKrciPath added in v0.38.0

func GetKrciPath(projectDir string) string

func GetTasksPath added in v0.38.0

func GetTasksPath(frameworkDir string) string

func GetTemplatesPath added in v0.38.0

func GetTemplatesPath(frameworkDir string) string

Types

type Agent

type Agent struct {
	Name        string
	Description string
	Role        string
	Goal        string
	Icon        string
	Tasks       []Task
	FilePath    string
	ShortName   string
}

Agent represents basic information about an agent

func MakeAgent added in v0.38.0

func MakeAgent(path string, representation *processor.AgentYamlRepresentation, tasks []Task) Agent

func (*Agent) GetAllDataFilesPaths added in v0.38.0

func (a *Agent) GetAllDataFilesPaths() []string

func (*Agent) GetAllReferencedTasksPaths added in v0.38.4

func (a *Agent) GetAllReferencedTasksPaths() []string

func (*Agent) GetAllTasksPaths added in v0.38.0

func (a *Agent) GetAllTasksPaths() []string

func (*Agent) GetAllTemplatesPaths added in v0.38.0

func (a *Agent) GetAllTemplatesPaths() []string

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 DataFile added in v0.38.0

type DataFile struct {
	Path string
	Name 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(frameworkDir string) *Discovery

NewDiscovery creates a new asset discovery service for filesystem assets

func NewEmbeddedDiscovery added in v0.38.0

func NewEmbeddedDiscovery(embeddedFS embed.FS, frameworkDir string) *Discovery

NewEmbeddedDiscovery creates a new asset discovery service for embedded assets

func (*Discovery) GetAgent added in v0.38.0

func (d *Discovery) GetAgent(ctx context.Context, shortName string) (*Agent, error)

GetAgent returns an agent by short name. TODO: Method can be optimized by reading only one agent instead of all agents.

func (*Discovery) GetAgents added in v0.38.0

func (d *Discovery) GetAgents(ctx context.Context) ([]Agent, error)

func (*Discovery) GetAgentsByNames added in v0.38.0

func (d *Discovery) GetAgentsByNames(ctx context.Context, names []string) ([]Agent, error)

func (*Discovery) ReadFile added in v0.38.0

func (d *Discovery) ReadFile(filePath string) ([]byte, error)

ReadFile reads a file using the discovery's filesystem

type EmbeddedFileSystem added in v0.38.0

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

EmbeddedFileSystem implements FileSystem for embedded filesystems

func (EmbeddedFileSystem) ReadFile added in v0.38.0

func (efs EmbeddedFileSystem) ReadFile(name string) ([]byte, error)

func (EmbeddedFileSystem) WalkDir added in v0.38.0

func (efs EmbeddedFileSystem) WalkDir(root string, fn fs.WalkDirFunc) error

type FileSystem added in v0.38.0

type FileSystem interface {
	WalkDir(root string, fn fs.WalkDirFunc) error
	ReadFile(name string) ([]byte, error)
}

FileSystem interface abstracts file system operations for both OS and embedded filesystems

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(projectDir string, embeddedAssets embed.FS, discovery IstallerDiscovery) *Installer

NewInstaller creates a new asset installer

func (*Installer) GetAgentsPath

func (i *Installer) GetAgentsPath() string

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

func (*Installer) GetFrameworkPath added in v0.38.0

func (i *Installer) GetFrameworkPath() string

func (*Installer) GetTasksPath

func (i *Installer) GetTasksPath() string

func (*Installer) GetTemplatesPath

func (i *Installer) GetTemplatesPath() string

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) HasClaudeIntegration added in v0.44.0

func (i *Installer) HasClaudeIntegration() bool

HasClaudeIntegration checks if Claude Code integration directory exists

func (*Installer) HasCursorIntegration added in v0.44.0

func (i *Installer) HasCursorIntegration() bool

HasCursorIntegration checks if Cursor IDE integration directory exists

func (*Installer) HasVSCodeIntegration added in v0.44.0

func (i *Installer) HasVSCodeIntegration() bool

HasVSCodeIntegration checks if VS Code integration directory exists

func (*Installer) HasWindsurfIntegration added in v0.44.0

func (i *Installer) HasWindsurfIntegration() bool

HasWindsurfIntegration checks if Windsurf IDE integration directory exists

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) SyncClaudeIntegration added in v0.44.0

func (i *Installer) SyncClaudeIntegration() error

SyncClaudeIntegration syncs Claude Code integration from installed agents

func (*Installer) SyncCursorIntegration added in v0.44.0

func (i *Installer) SyncCursorIntegration() error

SyncCursorIntegration syncs Cursor IDE integration from installed agents

func (*Installer) SyncVSCodeIntegration added in v0.44.0

func (i *Installer) SyncVSCodeIntegration() error

SyncVSCodeIntegration syncs VS Code integration from installed agents

func (*Installer) SyncWindsurfIntegration added in v0.44.0

func (i *Installer) SyncWindsurfIntegration() error

SyncWindsurfIntegration syncs Windsurf IDE integration from installed agents

func (*Installer) ValidateInstallation

func (i *Installer) ValidateInstallation() error

ValidateInstallation performs basic validation of the installation

type IstallerDiscovery added in v0.38.0

type IstallerDiscovery interface {
	GetAgents(ctx context.Context) ([]Agent, error)
	GetAgentsByNames(ctx context.Context, names []string) ([]Agent, error)
}

type OSFileSystem added in v0.38.0

type OSFileSystem struct{}

OSFileSystem implements FileSystem for the operating system filesystem

func (OSFileSystem) ReadFile added in v0.38.0

func (OSFileSystem) ReadFile(name string) ([]byte, error)

func (OSFileSystem) WalkDir added in v0.38.0

func (OSFileSystem) WalkDir(root string, fn fs.WalkDirFunc) error

type Task added in v0.38.0

type Task struct {
	Path         string
	Name         string
	Dependencies TaskDependencies
}

func MakeTask added in v0.38.0

func MakeTask(basePath string, taskPath string, dependencies processor.TaskDependenciesYamlRepresentation) Task

type TaskDependencies added in v0.38.0

type TaskDependencies struct {
	Templates  []Template
	DataFiles  []DataFile
	Tasks      []TaskRef
	McpServers []string
}

func MakeTaskDependency added in v0.38.0

func MakeTaskDependency(basePath string, dependency processor.TaskDependenciesYamlRepresentation) TaskDependencies

type TaskRef added in v0.38.4

type TaskRef struct {
	Path string
	Name string
}

type Template added in v0.38.0

type Template struct {
	Path string
	Name string
}

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