detection

package
v0.1.0-alpha.9 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package detection provides project type detection and configuration generation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectAIIDE

func DetectAIIDE() string

DetectAIIDE detects the AI-powered IDE in use

func DetectLLMModel

func DetectLLMModel() string

DetectLLMModel detects the LLM Model being used

func GenerateYAML

func GenerateYAML(info *ProjectInfo) (string, error)

GenerateYAML generates a nexlayer.yaml based on detected project info

Types

type DetectorRegistry

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

DetectorRegistry holds all registered project detectors

func NewDetectorRegistry

func NewDetectorRegistry() *DetectorRegistry

NewDetectorRegistry creates a new registry with all available detectors

func (*DetectorRegistry) DetectProject

func (r *DetectorRegistry) DetectProject(dir string) (*ProjectInfo, error)

DetectProject attempts to detect project type using all registered detectors

type DockerDetector

type DockerDetector struct{}

DockerDetector detects raw Docker projects

func (*DockerDetector) Detect

func (d *DockerDetector) Detect(dir string) (*ProjectInfo, error)

func (*DockerDetector) Priority

func (d *DockerDetector) Priority() int

type GoDetector

type GoDetector struct{}

GoDetector detects Go projects

func (*GoDetector) Detect

func (d *GoDetector) Detect(dir string) (*ProjectInfo, error)

func (*GoDetector) Priority

func (d *GoDetector) Priority() int

type LLMDetector

type LLMDetector struct{}

LLMDetector detects AI-powered IDEs or LLM-based coding assistants

func (*LLMDetector) Detect

func (d *LLMDetector) Detect(dir string) (*ProjectInfo, error)

func (*LLMDetector) Priority

func (d *LLMDetector) Priority() int

type MEANDetector

type MEANDetector struct{}

MEANDetector detects MEAN stack projects (MongoDB + Express + Angular + Node.js)

func (*MEANDetector) Detect

func (d *MEANDetector) Detect(dir string) (*ProjectInfo, error)

func (*MEANDetector) Priority

func (d *MEANDetector) Priority() int

type MERNDetector

type MERNDetector struct{}

MERNDetector detects MERN stack projects (MongoDB + Express + React + Node.js)

func (*MERNDetector) Detect

func (d *MERNDetector) Detect(dir string) (*ProjectInfo, error)

func (*MERNDetector) Priority

func (d *MERNDetector) Priority() int

type NextjsDetector

type NextjsDetector struct{}

NextjsDetector detects Next.js projects

func (*NextjsDetector) Detect

func (d *NextjsDetector) Detect(dir string) (*ProjectInfo, error)

func (*NextjsDetector) Priority

func (d *NextjsDetector) Priority() int

type NodeDetector

type NodeDetector struct{}

NodeDetector detects Node.js projects

func (*NodeDetector) Detect

func (d *NodeDetector) Detect(dir string) (*ProjectInfo, error)

func (*NodeDetector) Priority

func (d *NodeDetector) Priority() int

type PERNDetector

type PERNDetector struct{}

PERNDetector detects PERN stack projects (PostgreSQL + Express + React + Node.js)

func (*PERNDetector) Detect

func (d *PERNDetector) Detect(dir string) (*ProjectInfo, error)

func (*PERNDetector) Priority

func (d *PERNDetector) Priority() int

type ProjectDetector

type ProjectDetector interface {
	// Detect attempts to determine the project type and gather relevant info
	Detect(dir string) (*ProjectInfo, error)
	// Priority returns the detection priority (higher runs first)
	Priority() int
}

ProjectDetector defines the interface for project detection

type ProjectInfo

type ProjectInfo struct {
	Type         ProjectType       `json:"type"`
	Name         string            `json:"name"`
	Version      string            `json:"version,omitempty"`
	Dependencies map[string]string `json:"dependencies,omitempty"`
	Scripts      map[string]string `json:"scripts,omitempty"`
	Port         int               `json:"port,omitempty"`
	HasDocker    bool              `json:"has_docker"`
	LLMProvider  string            `json:"llm_provider,omitempty"` // AI-powered IDE
	LLMModel     string            `json:"llm_model,omitempty"`    // LLM Model being used
}

ProjectInfo contains detected information about a project

type ProjectType

type ProjectType string

ProjectType represents the detected type of project

const (
	// Base project types
	TypeUnknown   ProjectType = "unknown"
	TypeNextjs    ProjectType = "nextjs"
	TypeReact     ProjectType = "react"
	TypeNode      ProjectType = "node"
	TypePython    ProjectType = "python"
	TypeGo        ProjectType = "go"
	TypeDockerRaw ProjectType = "docker"

	// AI/LLM project types
	TypeLangchainNextjs ProjectType = "langchain-nextjs"
	TypeOpenAINode      ProjectType = "openai-node"
	TypeLlamaPython     ProjectType = "llama-py"

	// Full-stack project types
	TypeMERN ProjectType = "mern" // MongoDB + Express + React + Node.js
	TypePERN ProjectType = "pern" // PostgreSQL + Express + React + Node.js
	TypeMEAN ProjectType = "mean" // MongoDB + Express + Angular + Node.js
)

type PythonDetector

type PythonDetector struct{}

PythonDetector detects Python projects

func (*PythonDetector) Detect

func (d *PythonDetector) Detect(dir string) (*ProjectInfo, error)

func (*PythonDetector) Priority

func (d *PythonDetector) Priority() int

type ReactDetector

type ReactDetector struct{}

ReactDetector detects React projects

func (*ReactDetector) Detect

func (d *ReactDetector) Detect(dir string) (*ProjectInfo, error)

func (*ReactDetector) Priority

func (d *ReactDetector) Priority() int

Jump to

Keyboard shortcuts

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