detector

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: Apache-2.0 Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectProjectPM

func DetectProjectPM(exec executor.Executor, projectDir string) string

DetectProjectPM detects which package manager a project uses based on lock files.

Types

type AICLIDetector

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

AICLIDetector detects AI CLI tools.

func NewAICLIDetector

func NewAICLIDetector(exec executor.Executor) *AICLIDetector

func (*AICLIDetector) Detect

func (d *AICLIDetector) Detect(ctx context.Context) []model.AITool

type AgentDetector

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

AgentDetector detects general-purpose AI agents.

func NewAgentDetector

func NewAgentDetector(exec executor.Executor) *AgentDetector

func (*AgentDetector) Detect

func (d *AgentDetector) Detect(ctx context.Context, searchDirs []string) []model.AITool

type BrewDetector added in v1.10.0

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

BrewDetector detects Homebrew installation and packages.

func NewBrewDetector added in v1.10.0

func NewBrewDetector(exec executor.Executor) *BrewDetector

func (*BrewDetector) DetectBrew added in v1.10.0

func (d *BrewDetector) DetectBrew(ctx context.Context) *model.PkgManager

DetectBrew checks if Homebrew is installed and returns its version info. Returns nil if Homebrew is not found.

func (*BrewDetector) ListCasks added in v1.10.0

func (d *BrewDetector) ListCasks(ctx context.Context) []model.BrewPackage

ListCasks returns installed Homebrew casks with versions.

func (*BrewDetector) ListCasksRich added in v1.11.0

func (d *BrewDetector) ListCasksRich(ctx context.Context) []model.BrewPackage

ListCasksRich returns installed casks with metadata. Same strategy as ListFormulaeRich.

func (*BrewDetector) ListFormulae added in v1.10.0

func (d *BrewDetector) ListFormulae(ctx context.Context) []model.BrewPackage

ListFormulae returns installed Homebrew formulae with versions.

func (*BrewDetector) ListFormulaeRich added in v1.11.0

func (d *BrewDetector) ListFormulaeRich(ctx context.Context) []model.BrewPackage

ListFormulaeRich returns installed formulae with metadata. Uses two sources:

  1. brew info --json=v2 for desc/license/homepage (subprocess, but comprehensive)
  2. INSTALL_RECEIPT.json from Cellar for tap/install_time/dependency (file read, fast)

Falls back gracefully: if JSON command fails, reads receipts only. If receipts fail, falls back to basic `brew list --versions`.

type BrewScanner added in v1.10.0

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

BrewScanner performs enterprise-mode Homebrew scanning (raw output, base64 encoded).

func NewBrewScanner added in v1.10.0

func NewBrewScanner(exec executor.Executor, log *progress.Logger) *BrewScanner

func (*BrewScanner) ScanCasks added in v1.10.0

func (s *BrewScanner) ScanCasks(ctx context.Context) (model.BrewScanResult, bool)

ScanCasks runs `brew list --cask --versions` and returns raw base64-encoded output.

func (*BrewScanner) ScanFormulae added in v1.10.0

func (s *BrewScanner) ScanFormulae(ctx context.Context) (model.BrewScanResult, bool)

ScanFormulae runs `brew list --formula --versions` and returns raw base64-encoded output.

type ExtensionDetector

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

ExtensionDetector collects IDE extensions.

func NewExtensionDetector

func NewExtensionDetector(exec executor.Executor) *ExtensionDetector

func (*ExtensionDetector) Detect

func (d *ExtensionDetector) Detect(ctx context.Context, searchDirs []string, ides []model.IDE) []model.Extension

func (*ExtensionDetector) DetectEclipsePlugins added in v1.10.0

func (d *ExtensionDetector) DetectEclipsePlugins(ctx context.Context, ides []model.IDE) []model.Extension

DetectEclipsePlugins scans Eclipse installations for plugins. On macOS: scans features/dropins directories. On Windows: multi-stage pipeline using detected IDE paths, path probes, and drive letter scanning, with validation before reporting.

func (*ExtensionDetector) DetectJetBrainsPlugins added in v1.10.0

func (d *ExtensionDetector) DetectJetBrainsPlugins() []model.Extension

DetectJetBrainsPlugins scans JetBrains and Android Studio plugin directories and returns detected plugins as model.Extension entries. Bundled plugins (from app bundle) are tagged "bundled". User-installed plugins (from ~/Library/Application Support/) are tagged "user_installed".

func (*ExtensionDetector) DetectXcodeExtensions added in v1.10.0

func (d *ExtensionDetector) DetectXcodeExtensions(ctx context.Context) []model.Extension

DetectXcodeExtensions uses macOS pluginkit to find installed Xcode Source Editor extensions.

type FrameworkDetector

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

FrameworkDetector detects AI frameworks and runtimes.

func NewFrameworkDetector

func NewFrameworkDetector(exec executor.Executor) *FrameworkDetector

func (*FrameworkDetector) Detect

func (d *FrameworkDetector) Detect(ctx context.Context) []model.AITool

type IDEDetector

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

IDEDetector detects installed IDEs and AI desktop apps.

func NewIDEDetector

func NewIDEDetector(exec executor.Executor) *IDEDetector

func (*IDEDetector) Detect

func (d *IDEDetector) Detect(ctx context.Context) []model.IDE

type JetBrainsPluginDetector added in v1.10.1

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

JetBrainsPluginDetector collects user-installed plugins from JetBrains-family IDEs.

It reads product-info.json from each detected IDE's install path to obtain the dataDirectoryName and productVendor, then scans the platform-specific config directory for user-installed plugins:

  • macOS: ~/Library/Application Support/<vendor>/<dataDirectoryName>/plugins/
  • Windows: %APPDATA%/<vendor>/<dataDirectoryName>/plugins/
  • Linux: ~/.config/<vendor>/<dataDirectoryName>/plugins/ (XDG_CONFIG_HOME respected)

Also checks for custom plugin path overrides in idea.properties. Plugin version is extracted from JAR filenames matching <pluginDirName>-<version>.jar.

func NewJetBrainsPluginDetector added in v1.10.1

func NewJetBrainsPluginDetector(exec executor.Executor) *JetBrainsPluginDetector

func (*JetBrainsPluginDetector) Detect added in v1.10.1

Detect scans for user-installed plugins across all detected JetBrains-family IDEs.

type MCPDetector

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

MCPDetector collects MCP configuration files.

func NewMCPDetector

func NewMCPDetector(exec executor.Executor) *MCPDetector

func (*MCPDetector) Detect

func (d *MCPDetector) Detect(_ context.Context, userIdentity string, enterprise bool) []model.MCPConfig

Detect finds MCP configs. If enterprise is true, includes base64-encoded content. Returns community-mode MCPConfig structs (enterprise mode uses MCPConfigEnterprise separately).

func (*MCPDetector) DetectEnterprise

func (d *MCPDetector) DetectEnterprise(_ context.Context) []model.MCPConfigEnterprise

DetectEnterprise returns enterprise-mode MCP configs with base64 content.

type NodePMDetector

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

NodePMDetector detects installed Node.js package managers.

func NewNodePMDetector

func NewNodePMDetector(exec executor.Executor) *NodePMDetector

func (*NodePMDetector) DetectManagers

func (d *NodePMDetector) DetectManagers(ctx context.Context) []model.PkgManager

type NodeProjectDetector

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

NodeProjectDetector scans for Node.js projects.

func NewNodeProjectDetector

func NewNodeProjectDetector(exec executor.Executor) *NodeProjectDetector

func (*NodeProjectDetector) CountProjects

func (d *NodeProjectDetector) CountProjects(_ context.Context, searchDirs []string) int

CountProjects counts the number of Node.js projects found under the given directories.

func (*NodeProjectDetector) ListProjects added in v1.10.0

func (d *NodeProjectDetector) ListProjects(searchDirs []string) []model.ProjectInfo

ListProjects returns Node.js project paths with their detected package manager and the dependencies listed in package.json.

type NodeScanner

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

NodeScanner performs enterprise-mode node scanning (raw output, base64 encoded).

func NewNodeScanner

func NewNodeScanner(exec executor.Executor, log *progress.Logger, loggedInUser string) *NodeScanner

func (*NodeScanner) ScanGlobalPackages

func (s *NodeScanner) ScanGlobalPackages(ctx context.Context) []model.NodeScanResult

ScanGlobalPackages runs npm/yarn/pnpm list -g and returns raw base64-encoded results.

func (*NodeScanner) ScanProjects

func (s *NodeScanner) ScanProjects(ctx context.Context, searchDirs []string) []model.NodeScanResult

ScanProjects finds package.json files, sorts by most recently modified, then scans. Respects the size limit (default 500MB, override via STEPSEC_MAX_NODE_SCAN_BYTES).

type PythonPMDetector added in v1.10.0

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

PythonPMDetector detects installed Python package managers.

func NewPythonPMDetector added in v1.10.0

func NewPythonPMDetector(exec executor.Executor) *PythonPMDetector

func (*PythonPMDetector) DetectManagers added in v1.10.0

func (d *PythonPMDetector) DetectManagers(ctx context.Context) []model.PkgManager

func (*PythonPMDetector) ListPackages added in v1.10.0

func (d *PythonPMDetector) ListPackages(ctx context.Context) []model.PythonPackage

ListPackages returns installed Python packages using pip3.

type PythonProjectDetector added in v1.10.0

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

PythonProjectDetector scans for Python projects with virtual environments.

func NewPythonProjectDetector added in v1.10.0

func NewPythonProjectDetector(exec executor.Executor) *PythonProjectDetector

func (*PythonProjectDetector) CountProjects added in v1.10.0

func (d *PythonProjectDetector) CountProjects(_ context.Context, searchDirs []string) int

CountProjects counts Python projects with virtual environments.

func (*PythonProjectDetector) ListProjects added in v1.10.0

func (d *PythonProjectDetector) ListProjects(searchDirs []string) []model.ProjectInfo

ListProjects returns Python projects that have a virtual environment, along with the packages installed in each venv.

Note: ProjectInfo.Path is the venv directory itself (not the project root, unlike Node detection). This lets multiple venvs under the same parent directory each surface as their own entry. The package_manager field is still derived from marker files in the parent directory.

type PythonScanner added in v1.10.0

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

PythonScanner performs enterprise-mode Python scanning (raw output, base64 encoded).

func NewPythonScanner added in v1.10.0

func NewPythonScanner(exec executor.Executor, log *progress.Logger) *PythonScanner

func (*PythonScanner) ScanGlobalPackages added in v1.10.0

func (s *PythonScanner) ScanGlobalPackages(ctx context.Context) []model.PythonScanResult

ScanGlobalPackages runs pip3/conda/uv list and returns raw base64-encoded results.

type SystemPkgDetector added in v1.11.0

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

SystemPkgDetector detects installed system packages on Linux.

func NewSystemPkgDetector added in v1.11.0

func NewSystemPkgDetector(exec executor.Executor) *SystemPkgDetector

func (*SystemPkgDetector) Detect added in v1.11.0

Detect finds the active system package manager and returns its info. Returns nil on non-Linux platforms or if no known PM is found.

func (*SystemPkgDetector) DetectAdditionalManagers added in v1.11.0

func (d *SystemPkgDetector) DetectAdditionalManagers(ctx context.Context) []model.PkgManager

DetectAdditionalManagers returns snap and/or flatpak if installed. These coexist with the system PM — a machine can have rpm + snap + flatpak.

func (*SystemPkgDetector) ListFlatpakPackages added in v1.11.0

func (d *SystemPkgDetector) ListFlatpakPackages(ctx context.Context) []model.SystemPackage

ListFlatpakPackages returns installed flatpak applications with runtime and branch info.

func (*SystemPkgDetector) ListPackages added in v1.11.0

func (d *SystemPkgDetector) ListPackages(ctx context.Context) []model.SystemPackage

ListPackages returns all installed system packages. Uses the first detected package manager from sysPkgSpecs. For apk, it prefers reading /lib/apk/db/installed directly for richer metadata.

func (*SystemPkgDetector) ListPackagesApkDB added in v1.11.0

func (d *SystemPkgDetector) ListPackagesApkDB(ctx context.Context) []model.SystemPackage

ListPackagesApkDB reads /lib/apk/db/installed directly for rich metadata. Falls back to the standard apk list --installed approach if the file is unreadable.

func (*SystemPkgDetector) ListSnapPackages added in v1.11.0

func (d *SystemPkgDetector) ListSnapPackages(ctx context.Context) []model.SystemPackage

ListSnapPackages returns installed snap packages with confinement and channel info.

Jump to

Keyboard shortcuts

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