Documentation
¶
Overview ¶
Package detection provides project type detection and configuration generation.
Package detection provides project type detection functionality ¶
Package detection provides project type detection functionality
Index ¶
- Constants
- Variables
- func DetectAIIDE() string
- func DetectLLMModel() string
- func EmitDeprecationWarning(detectorName string)
- type AIProvider
- type BaseDetector
- type Cache
- type Components
- type ContentMatcher
- type DatabasePattern
- type DetectionManager
- func (dm *DetectionManager) DetectAsync(ctx context.Context, dir string) <-chan *DetectionResult
- func (dm *DetectionManager) DetectProject(ctx context.Context, dir string) (*ProjectInfo, error)
- func (dm *DetectionManager) GetConfidenceThreshold(detectionType string) float64
- func (dm *DetectionManager) RegisterDefaultTasks()
- func (dm *DetectionManager) RegisterDetectionTask(detector Detector, weight float64, timeout time.Duration)
- func (dm *DetectionManager) SetCacheTTL(ttl time.Duration)
- func (dm *DetectionManager) SetConfidenceThreshold(detectionType string, threshold float64)
- type DetectionPattern
- type DetectionResult
- type DetectionTask
- type Detector
- type DetectorRegistry
- type DjangoDetector
- type DockerDetector
- type DockerImageVerificationResult
- type FastAPIDetector
- type FrameworkDetector
- type FrameworkPattern
- type GenericDetector
- type GoDetector
- type LLMDetector
- type LangchainNextJSDetector
- type LlamaPythonDetector
- type MEANDetector
- type MERNDetector
- type NestJSDetector
- type NextjsDetector
- type NodeDetector
- type PERNDetector
- type PatternType
- type ProjectDetector
- type ProjectInfo
- type PythonDetector
- type ReactDetector
- type StackDefinition
- type StackDetector
- type TechStack
- type VectorDBPattern
- type VueDetector
Constants ¶
const ( // CacheDir is the directory where cache files are stored CacheDir = ".nexlayer" // CacheFile is the name of the cache file CacheFile = "detection-cache.json" // DefaultCacheTTL is the default time-to-live for cached detection results DefaultCacheTTL = 5 * time.Minute // MaxCacheTTL is the maximum allowed TTL for any cache entry MaxCacheTTL = 24 * time.Hour )
Variables ¶
var AIProviders = []AIProvider{
{
Name: "OpenAI",
EnvKeyPattern: "OPENAI_API_KEY",
DependencyName: "openai",
},
{
Name: "Anthropic",
EnvKeyPattern: "ANTHROPIC_API_KEY",
DependencyName: "anthropic",
},
{
Name: "Google Gemini",
EnvKeyPattern: "GEMINI_API_KEY",
DependencyName: "@google/generative-ai",
},
{
Name: "Grok",
EnvKeyPattern: "GROK_API_KEY",
DependencyName: "grok-ai",
},
{
Name: "DeepSeek",
EnvKeyPattern: "DEEPSEEK_API_KEY",
DependencyName: "deepseek",
},
{
Name: "Together AI",
EnvKeyPattern: "TOGETHER_API_KEY",
DependencyName: "together-ai",
},
{
Name: "Ollama",
EnvKeyPattern: "OLLAMA_API_KEY",
DependencyName: "ollama",
},
}
AI provider detection patterns
var ContentMatchers = map[types.ProjectType]map[string]ContentMatcher{ types.TypeReact: { "package.json": func(content string) bool { return strings.Contains(content, `"react"`) || strings.Contains(content, `"@vitejs/plugin-react"`) || strings.Contains(content, `"react-scripts"`) }, }, types.TypeVue: { "package.json": func(content string) bool { return strings.Contains(content, `"vue"`) || strings.Contains(content, `"@vue/cli-service"`) || strings.Contains(content, `"nuxt"`) }, }, types.TypeExpress: { "package.json": func(content string) bool { return strings.Contains(content, `"express"`) }, }, types.TypeFlask: { "app.py": func(content string) bool { return strings.Contains(content, "from flask import") }, }, types.TypeFastAPI: { "main.py": func(content string) bool { return strings.Contains(content, "from fastapi import") }, }, types.TypeSpringBoot: { "pom.xml": func(content string) bool { return strings.Contains(content, "spring-boot") }, }, }
Framework content matchers for package.json and other files
var DatabasePatterns = []DatabasePattern{
{
Type: "postgres",
Dependency: "pg|postgres|postgresql|sequelize|typeorm|prisma",
Image: "postgres:15-alpine",
Port: 5432,
MountPath: "/var/lib/postgresql/data",
DefaultSize: "10Gi",
},
{
Type: "mongodb",
Dependency: "mongodb|mongoose",
Image: "mongo:6-jammy",
Port: 27017,
MountPath: "/data/db",
DefaultSize: "10Gi",
},
{
Type: "mysql",
Dependency: "mysql|mysql2",
Image: "mysql:8",
Port: 3306,
MountPath: "/var/lib/mysql",
DefaultSize: "10Gi",
},
{
Type: "redis",
Dependency: "redis",
Image: "redis:7-alpine",
Port: 6379,
MountPath: "/data",
DefaultSize: "5Gi",
},
{
Type: "cassandra",
Dependency: "cassandra",
Image: "cassandra:latest",
Port: 9042,
MountPath: "/var/lib/cassandra",
DefaultSize: "20Gi",
},
}
Database detection patterns
var Patterns = []FrameworkPattern{ { Type: types.TypeNextJS, FilePattern: "next.config.js", Image: "nexlayer/node-runtime:nextjs-latest", Port: 3000, }, { Type: types.TypeNextJS, FilePattern: "next.config.ts", Image: "nexlayer/node-runtime:nextjs-latest", Port: 3000, }, { Type: types.TypeReact, FilePattern: "vite.config.js", Image: "nexlayer/node-runtime:react-latest", Port: 3000, }, { Type: types.TypeReact, FilePattern: "package.json", Image: "nexlayer/node-runtime:react-latest", Port: 3000, }, { Type: types.TypeAngular, FilePattern: "angular.json", Image: "nexlayer/node-runtime:angular-latest", Port: 4200, }, { Type: types.TypeVue, FilePattern: "vue.config.js", Image: "nexlayer/node-runtime:vue-latest", Port: 3000, }, { Type: types.TypeVue, FilePattern: "package.json", Image: "nexlayer/node-runtime:vue-latest", Port: 3000, }, { Type: types.TypeExpress, FilePattern: "package.json", Image: "nexlayer/node-runtime:express-latest", Port: 3000, }, { Type: types.TypeNestJS, FilePattern: "nest-cli.json", Image: "nexlayer/node-runtime:nestjs-latest", Port: 3000, }, { Type: types.TypeDjango, FilePattern: "manage.py", Image: "nexlayer/python-runtime:django-latest", Port: 8000, }, { Type: types.TypeFlask, FilePattern: "app.py", Image: "nexlayer/python-runtime:flask-latest", Port: 5000, }, { Type: types.TypeFastAPI, FilePattern: "main.py", Image: "nexlayer/python-runtime:fastapi-latest", Port: 8000, }, { Type: types.TypeGo, FilePattern: "go.mod", Image: "nexlayer/go-runtime:latest", Port: 8080, }, { Type: types.TypeSpringBoot, FilePattern: "pom.xml", Image: "nexlayer/java-runtime:springboot-latest", Port: 8080, }, { Type: types.TypeDotNet, FilePattern: "*.csproj", Image: "nexlayer/dotnet-runtime:latest", Port: 5000, }, }
Framework detection patterns
var TechStackDefinitions = map[string]StackDefinition{ "nextjs": { Name: "Next.js", Description: "React framework for production-grade applications", Components: Components{ Frontend: []string{"nextjs"}, }, RequiredComponents: []string{"nextjs"}, MainPatterns: []DetectionPattern{ { Type: PatternFile, Pattern: "next.config.js|next.config.mjs", Path: "", Confidence: 0.8, }, { Type: PatternDependency, Pattern: "next", Path: "package.json", Confidence: 0.8, }, }, RecommendedRuntime: "nexlayer/node-runtime:next-js-latest", }, "nextjs-typescript": { Name: "Next.js (TypeScript)", Description: "Next.js with TypeScript configuration", Components: Components{ Frontend: []string{"nextjs", "typescript"}, }, RequiredComponents: []string{"nextjs", "typescript"}, MainPatterns: []DetectionPattern{ { Type: PatternFile, Pattern: "next.config.ts", Path: "", Confidence: 0.9, }, { Type: PatternFile, Pattern: "tsconfig.json", Path: "", Confidence: 0.7, }, }, RecommendedRuntime: "nexlayer/node-runtime:next-js-latest", }, "react-vite": { Name: "React with Vite", Description: "React application using Vite build tool", Components: Components{ Frontend: []string{"react", "vite"}, }, RequiredComponents: []string{"react", "vite"}, MainPatterns: []DetectionPattern{ { Type: PatternFile, Pattern: "vite.config.js|vite.config.ts", Path: "", Confidence: 0.8, }, { Type: PatternDependency, Pattern: "react", Path: "package.json", Confidence: 0.7, }, }, RecommendedRuntime: "nexlayer/node-runtime:react-latest", }, "angular": { Name: "Angular", Description: "Angular application", Components: Components{ Frontend: []string{"angular"}, }, RequiredComponents: []string{"angular"}, MainPatterns: []DetectionPattern{ { Type: PatternFile, Pattern: "angular.json", Path: "", Confidence: 0.9, }, }, RecommendedRuntime: "nexlayer/node-runtime:angular-latest", }, "vue": { Name: "Vue.js", Description: "Vue.js application", Components: Components{ Frontend: []string{"vue"}, }, RequiredComponents: []string{"vue"}, MainPatterns: []DetectionPattern{ { Type: PatternFile, Pattern: "vue.config.js|vite.config.js", Path: "", Confidence: 0.8, }, }, RecommendedRuntime: "nexlayer/node-runtime:vue-latest", }, "express": { Name: "Express.js", Description: "Express.js backend application", Components: Components{ Backend: []string{"express"}, }, RequiredComponents: []string{"express"}, MainPatterns: []DetectionPattern{ { Type: PatternFile, Pattern: "server.js|app.js", Path: "", Confidence: 0.7, }, { Type: PatternDependency, Pattern: "express", Path: "package.json", Confidence: 0.8, }, }, RecommendedRuntime: "nexlayer/node-runtime:express-latest", }, "nestjs": { Name: "NestJS", Description: "NestJS backend application", Components: Components{ Backend: []string{"nestjs"}, }, RequiredComponents: []string{"nestjs"}, MainPatterns: []DetectionPattern{ { Type: PatternFile, Pattern: "nest-cli.json", Path: "", Confidence: 0.9, }, }, RecommendedRuntime: "nexlayer/node-runtime:nest-js-latest", }, "gatsby": { Name: "Gatsby", Description: "Gatsby static site generator", Components: Components{ Frontend: []string{"gatsby"}, }, RequiredComponents: []string{"gatsby"}, MainPatterns: []DetectionPattern{ { Type: PatternFile, Pattern: "gatsby-config.js|gatsby-config.ts", Path: "", Confidence: 0.9, }, }, RecommendedRuntime: "nexlayer/node-runtime:gatsby-latest", }, "nextjs-supabase": { Name: "Next.js + Supabase", Description: "Next.js application with Supabase backend", Components: Components{ Frontend: []string{"nextjs"}, Backend: []string{"supabase"}, }, RequiredComponents: []string{"nextjs", "supabase"}, MainPatterns: []DetectionPattern{ { Type: PatternFile, Pattern: "next.config.js", Path: "", Confidence: 0.8, }, { Type: PatternEnvironment, Pattern: "SUPABASE_.+", Path: ".env", Confidence: 0.7, }, }, RecommendedRuntime: "nexlayer/node-runtime:next-js-latest", }, "nextjs-supabase-langchain": { Name: "Next.js + Supabase + LangChain", Description: "AI-powered Next.js application with Supabase and LangChain", Components: Components{ Frontend: []string{"nextjs"}, Backend: []string{"supabase"}, AI: []string{"langchain"}, }, RequiredComponents: []string{"nextjs", "supabase", "langchain"}, MainPatterns: []DetectionPattern{ { Type: PatternDependency, Pattern: "langchain", Path: "package.json", Confidence: 0.8, }, { Type: PatternEnvironment, Pattern: "LANGCHAIN_.+", Path: ".env", Confidence: 0.7, }, }, RecommendedRuntime: "nexlayer/node-runtime:next-js-latest", }, "python-fastapi-langchain": { Name: "FastAPI + LangChain", Description: "Python FastAPI application with LangChain integration", Components: Components{ Backend: []string{"fastapi"}, AI: []string{"langchain"}, }, RequiredComponents: []string{"fastapi", "langchain"}, MainPatterns: []DetectionPattern{ { Type: PatternDependency, Pattern: "fastapi", Path: "requirements.txt", Confidence: 0.8, }, { Type: PatternDependency, Pattern: "langchain", Path: "requirements.txt", Confidence: 0.8, }, }, RecommendedRuntime: "nexlayer/python:langchain-latest", }, "python-fastapi-together": { Name: "FastAPI + Together AI", Description: "Python FastAPI application with Together AI integration", Components: Components{ Backend: []string{"fastapi"}, AI: []string{"together"}, }, RequiredComponents: []string{"fastapi"}, MainPatterns: []DetectionPattern{ { Type: PatternEnvironment, Pattern: "TOGETHER_.+", Path: ".env", Confidence: 0.7, }, }, RecommendedRuntime: "nexlayer/python:together-latest", }, "django-postgres": { Name: "Django + PostgreSQL", Description: "Django application with PostgreSQL database", Components: Components{ Backend: []string{"django"}, Database: []string{"postgres"}, }, RequiredComponents: []string{"django"}, MainPatterns: []DetectionPattern{ { Type: PatternFile, Pattern: "manage.py", Path: "", Confidence: 0.9, }, { Type: PatternDependency, Pattern: "psycopg2", Path: "requirements.txt", Confidence: 0.7, }, }, RecommendedRuntime: "nexlayer/python:django-latest", }, "chain-ai-langchain": { Name: "Chain AI + LangChain", Description: "Chain AI application with LangChain integration", Components: Components{ AI: []string{"chain-ai", "langchain"}, }, RequiredComponents: []string{"chain-ai", "langchain"}, MainPatterns: []DetectionPattern{ { Type: PatternDependency, Pattern: "CHAINAI_.+", Path: ".env", Confidence: 0.8, }, }, RecommendedRuntime: "nexlayer/chain-ai:latest", }, }
TechStackDefinitions defines patterns for detecting technology stacks
var VectorDBPatterns = []VectorDBPattern{
{
Type: "pinecone",
Dependency: "pinecone-client",
Image: "pinecone/server:latest",
Port: 8080,
MountPath: "/data",
},
{
Type: "milvus",
Dependency: "pymilvus",
Image: "milvusdb/milvus:latest",
Port: 19530,
MountPath: "/var/lib/milvus",
},
{
Type: "weaviate",
Dependency: "weaviate-client",
Image: "semitechnologies/weaviate:latest",
Port: 8080,
MountPath: "/var/lib/weaviate",
},
{
Type: "qdrant",
Dependency: "qdrant-client",
Image: "qdrant/qdrant:latest",
Port: 6333,
MountPath: "/qdrant/storage",
},
}
Vector database detection patterns
Functions ¶
func EmitDeprecationWarning ¶
func EmitDeprecationWarning(detectorName string)
EmitDeprecationWarning logs a deprecation warning for a detector This function should be called at the beginning of the Detect method in deprecated detectors
Types ¶
type AIProvider ¶
AIProvider represents an AI provider detection pattern
type BaseDetector ¶
type BaseDetector struct {
// contains filtered or unexported fields
}
BaseDetector provides common functionality for all detectors
func NewBaseDetector ¶
func NewBaseDetector(name string, confidence float64) *BaseDetector
NewBaseDetector creates a new base detector with the given name and confidence
func NewStackBaseDetector ¶
func NewStackBaseDetector(name string, confidence float64) *BaseDetector
NewStackBaseDetector creates a new base detector with the given name and confidence
func (*BaseDetector) Detect ¶
func (d *BaseDetector) Detect(ctx context.Context, dir string) (*ProjectInfo, error)
Detect implements the Detector interface for the BaseDetector This is a base implementation that should be overridden by specific detectors
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache provides simple file-based caching for project detection results
func (*Cache) Get ¶
func (c *Cache) Get(dir string) *types.ProjectInfo
Get retrieves project info from cache if available and not expired. It first checks the in-memory cache, then falls back to the disk cache. Returns nil if the cache entry is not found or has expired.
func (*Cache) Invalidate ¶
Invalidate removes a specific cache entry
type Components ¶
type Components struct {
Frontend []string
Backend []string
Database []string
AI []string
Deployment []string
}
Components represents the components of a technology stack
type ContentMatcher ¶
ContentMatcher represents a function that matches content in a file
type DatabasePattern ¶
type DatabasePattern struct {
Type string
Dependency string
Image string
MountPath string
DefaultSize string
Port int
}
DatabasePattern represents a database detection pattern
type DetectionManager ¶
type DetectionManager struct {
// contains filtered or unexported fields
}
DetectionManager handles asynchronous detection operations
func NewDetectionManager ¶
func NewDetectionManager(registry *DetectorRegistry) *DetectionManager
NewDetectionManager creates a new detection manager with default settings
func (*DetectionManager) DetectAsync ¶
func (dm *DetectionManager) DetectAsync(ctx context.Context, dir string) <-chan *DetectionResult
DetectAsync runs all registered detection tasks asynchronously
func (*DetectionManager) DetectProject ¶
func (dm *DetectionManager) DetectProject(ctx context.Context, dir string) (*ProjectInfo, error)
DetectProject performs detection and returns a project info This is a synchronous version of DetectAsync for backward compatibility
func (*DetectionManager) GetConfidenceThreshold ¶
func (dm *DetectionManager) GetConfidenceThreshold(detectionType string) float64
GetConfidenceThreshold gets the confidence threshold for a detection type
func (*DetectionManager) RegisterDefaultTasks ¶
func (dm *DetectionManager) RegisterDefaultTasks()
RegisterDefaultTasks registers all the default detection tasks
func (*DetectionManager) RegisterDetectionTask ¶
func (dm *DetectionManager) RegisterDetectionTask(detector Detector, weight float64, timeout time.Duration)
RegisterDetectionTask adds a new detection task to the manager
func (*DetectionManager) SetCacheTTL ¶
func (dm *DetectionManager) SetCacheTTL(ttl time.Duration)
SetCacheTTL sets how long detection results should be cached
func (*DetectionManager) SetConfidenceThreshold ¶
func (dm *DetectionManager) SetConfidenceThreshold(detectionType string, threshold float64)
SetConfidenceThreshold sets the confidence threshold for a specific detection type
type DetectionPattern ¶
type DetectionPattern struct {
Type PatternType
Pattern string // Regex pattern or exact match
Path string // Where to look (package.json, requirements.txt, etc.)
Confidence float64
}
DetectionPattern defines a pattern to match in a project
type DetectionResult ¶
type DetectionResult struct {
ProjectTypes map[string]float64 // Map of project type to confidence level
Editors map[string]float64 // Map of editors to confidence level
ProjectInfo *ProjectInfo // Consolidated project info
Metadata map[string]interface{} // Additional metadata from detection
CompletedAt time.Time // When the detection completed
// contains filtered or unexported fields
}
DetectionResult represents the result of multiple asynchronous detections
type DetectionTask ¶
DetectionTask represents a detection operation that can run asynchronously
type Detector ¶
type Detector interface {
// Detect analyzes a directory to detect project information
Detect(ctx context.Context, dir string) (*ProjectInfo, error)
// Name returns the detector name
Name() string
}
Detector defines the interface for project detectors
func NewDockerDetector ¶
func NewDockerDetector() Detector
NewDockerDetector creates a new detector for Docker projects
func NewGoDetector ¶
func NewGoDetector() Detector
NewGoDetector creates a new detector for Go projects
func NewJetBrainsDetector ¶
func NewJetBrainsDetector() Detector
NewJetBrainsDetector creates a new detector for JetBrains IDEs
func NewLLMDetector ¶
func NewLLMDetector() Detector
NewLLMDetector creates a new detector for AI/LLM-powered IDEs
func NewNodeJSDetector ¶
func NewNodeJSDetector() Detector
NewNodeJSDetector creates a new detector for Node.js projects
func NewPythonDetector ¶
func NewPythonDetector() Detector
NewPythonDetector creates a new detector for Python projects
func NewVSCodeDetector ¶
func NewVSCodeDetector() Detector
NewVSCodeDetector creates a new detector for VS Code
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) ClearCache ¶
func (r *DetectorRegistry) ClearCache()
ClearCache clears the detection cache
func (*DetectorRegistry) DetectProject ¶
func (r *DetectorRegistry) DetectProject(dir string) (*types.ProjectInfo, error)
DetectProject attempts to detect project type using all registered detectors
func (*DetectorRegistry) GetDetectors ¶
func (r *DetectorRegistry) GetDetectors() []ProjectDetector
GetDetectors returns all registered detectors
type DjangoDetector ¶
type DjangoDetector struct{}
DjangoDetector detects Django projects
func (*DjangoDetector) Detect ¶
func (d *DjangoDetector) Detect(dir string) (*types.ProjectInfo, error)
func (*DjangoDetector) Priority ¶
func (d *DjangoDetector) Priority() int
type DockerDetector ¶
type DockerDetector struct{}
DockerDetector detects Docker projects
func (*DockerDetector) Detect ¶
func (d *DockerDetector) Detect(dir string) (*types.ProjectInfo, error)
func (*DockerDetector) Priority ¶
func (d *DockerDetector) Priority() int
type DockerImageVerificationResult ¶
type DockerImageVerificationResult struct {
Message string
Registry string
Repository string
Tag string
Suggestions []string
Valid bool
IsPrivate bool
}
DockerImageVerificationResult contains the result of a Docker image verification
func VerifyDockerImage ¶
func VerifyDockerImage(ctx context.Context, image string) (*DockerImageVerificationResult, error)
VerifyDockerImage checks if a Docker image is valid and accessible It returns a verification result with details about the image
type FastAPIDetector ¶
type FastAPIDetector struct{}
FastAPIDetector detects FastAPI projects
func (*FastAPIDetector) Detect ¶
func (d *FastAPIDetector) Detect(dir string) (*types.ProjectInfo, error)
func (*FastAPIDetector) Priority ¶
func (d *FastAPIDetector) Priority() int
type FrameworkDetector ¶
type FrameworkDetector struct{}
FrameworkDetector implements project type detection
func (*FrameworkDetector) Detect ¶
func (d *FrameworkDetector) Detect(dir string) (*types.ProjectInfo, error)
Detect attempts to determine the project type and metadata
type FrameworkPattern ¶
type FrameworkPattern struct {
Type types.ProjectType
FilePattern string
Image string
Port int
}
FrameworkPattern represents a framework detection pattern
type GenericDetector ¶
type GenericDetector struct{}
GenericDetector uses simple file existence checks to detect project types
func (*GenericDetector) Detect ¶
func (d *GenericDetector) Detect(dir string) (*types.ProjectInfo, error)
func (*GenericDetector) Priority ¶
func (d *GenericDetector) Priority() int
type GoDetector ¶
type GoDetector struct{}
GoDetector detects Go projects
func (*GoDetector) Detect ¶
func (d *GoDetector) Detect(dir string) (*types.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) (*types.ProjectInfo, error)
func (*LLMDetector) Priority ¶
func (d *LLMDetector) Priority() int
type LangchainNextJSDetector ¶
type LangchainNextJSDetector struct{}
LangchainNextJSDetector detects Next.js projects with Langchain integration
func (*LangchainNextJSDetector) Detect ¶
func (d *LangchainNextJSDetector) Detect(dir string) (*types.ProjectInfo, error)
func (*LangchainNextJSDetector) Priority ¶
func (d *LangchainNextJSDetector) Priority() int
type LlamaPythonDetector ¶
type LlamaPythonDetector struct{}
LlamaPythonDetector detects Python projects using Llama
func (*LlamaPythonDetector) Detect ¶
func (d *LlamaPythonDetector) Detect(dir string) (*types.ProjectInfo, error)
func (*LlamaPythonDetector) Priority ¶
func (d *LlamaPythonDetector) 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) (*types.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) (*types.ProjectInfo, error)
func (*MERNDetector) Priority ¶
func (d *MERNDetector) Priority() int
type NestJSDetector ¶
type NestJSDetector struct{}
NestJSDetector detects NestJS projects
func (*NestJSDetector) Detect ¶
func (d *NestJSDetector) Detect(dir string) (*types.ProjectInfo, error)
func (*NestJSDetector) Priority ¶
func (d *NestJSDetector) Priority() int
type NextjsDetector ¶
type NextjsDetector struct{}
NextjsDetector implements project type detection for Next.js projects
func (*NextjsDetector) Detect ¶
func (d *NextjsDetector) Detect(dir string) (*types.ProjectInfo, error)
Detect attempts to determine if this is a Next.js project
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) (*types.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) (*types.ProjectInfo, error)
func (*PERNDetector) Priority ¶
func (d *PERNDetector) Priority() int
type PatternType ¶
type PatternType string
PatternType defines the type of pattern to match
const ( PatternDependency PatternType = "dependency" PatternFile PatternType = "file" PatternImport PatternType = "import" PatternContent PatternType = "content" PatternEnvironment PatternType = "environment" )
type ProjectDetector ¶
type ProjectDetector interface {
// Detect attempts to determine the project type and gather relevant info
Detect(dir string) (*types.ProjectInfo, error)
// Priority returns the detection priority (higher runs first)
Priority() int
}
ProjectDetector defines the interface for project detection
type ProjectInfo ¶
type ProjectInfo struct {
Dependencies map[string]string
Metadata map[string]interface{}
Scripts map[string]string
LLMModel string
Framework string
Language string
Path string
Version string
Editor string
LLMProvider string
Type string
ImageTag string
Name string
Port int
Confidence float64
HasDocker bool
}
ProjectInfo contains detected information about a project
type PythonDetector ¶
type PythonDetector struct{}
PythonDetector detects Python projects
func (*PythonDetector) Detect ¶
func (d *PythonDetector) Detect(dir string) (*types.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) (*types.ProjectInfo, error)
func (*ReactDetector) Priority ¶
func (d *ReactDetector) Priority() int
type StackDefinition ¶
type StackDefinition struct {
Name string
Description string
RecommendedRuntime string
Components Components
RequiredComponents []string
OptionalComponents []string
MainPatterns []DetectionPattern
ExtraPatterns []DetectionPattern
}
StackDefinition defines a technology stack and its detection patterns
type StackDetector ¶
type StackDetector struct {
BaseDetector
// contains filtered or unexported fields
}
StackDetector is a unified detector for common technology stacks
func NewStackDetector ¶
func NewStackDetector() *StackDetector
NewStackDetector creates a new detector for common technology stacks
func (*StackDetector) Detect ¶
func (d *StackDetector) Detect(dir string) (*types.ProjectInfo, error)
Detect analyzes a project to determine its technology stack
func (*StackDetector) Priority ¶
func (d *StackDetector) Priority() int
Priority returns the detection priority
type TechStack ¶
type TechStack struct {
Name string
Frontend string
Backend string
Database string
Deployment string
AIIntegration []string
Confidence float64
}
TechStack represents a complete technology stack
type VectorDBPattern ¶
type VectorDBPattern struct {
Type string
Dependency string
Image string
MountPath string
Port int
}
VectorDBPattern represents a vector database detection pattern
type VueDetector ¶
type VueDetector struct{}
VueDetector detects Vue.js projects
func (*VueDetector) Detect ¶
func (d *VueDetector) Detect(dir string) (*types.ProjectInfo, error)
func (*VueDetector) Priority ¶
func (d *VueDetector) Priority() int