Documentation
¶
Index ¶
- func CheckSDKVersion(dir string, projectType ProjectType, settingsMap map[string]string) error
- func CreateDockerIgnoreFile(dir string, projectType ProjectType) error
- func CreateDockerfile(dir string, projectType ProjectType, settingsMap map[string]string, ...) error
- func DetectEnvFile(maybeFile string, skipPrompts bool) (string, map[string]string, error)
- func FindNodeBinary() (string, error)
- func FindPythonBinary(dir string, projectType ProjectType) (string, []string, error)
- func GenerateDockerArtifacts(dir string, projectType ProjectType, settingsMap map[string]string, ...) ([]byte, []byte, error)
- func HasDockerIgnore(dir string) (bool, error)
- func HasDockerfile(dir string) (bool, error)
- func IsVersionSatisfied(version, minVersion string) (bool, error)
- func LoadDockerDaemonImage(ctx context.Context, ref string) (v1.Image, io.Closer, error)
- func ParseCpu(cpu string) (string, error)
- func ParseEnvFile(file string) (map[string]string, error)
- func ParseMem(mem string, suffix bool) (string, error)
- func ResolveInstalledSDKVersion(dir, entrypoint string, projectType ProjectType) string
- func ResolveNodeAgentVersion(nodeBin, fromDir string) string
- func ResolvePythonAgentVersion(dir string, projectType ProjectType) (version string, notInstalled bool)
- type PackageInfo
- type ProjectType
- type VersionCheckResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckSDKVersion ¶ added in v2.5.0
func CheckSDKVersion(dir string, projectType ProjectType, settingsMap map[string]string) error
CheckSDKVersion performs a comprehensive check for livekit-agents packages
func CreateDockerIgnoreFile ¶ added in v2.12.1
func CreateDockerIgnoreFile(dir string, projectType ProjectType) error
func CreateDockerfile ¶
func DetectEnvFile ¶ added in v2.4.5
func FindNodeBinary ¶ added in v2.18.0
FindNodeBinary locates the Node binary used to run a JS/TS agent.
func FindPythonBinary ¶ added in v2.18.0
func FindPythonBinary(dir string, projectType ProjectType) (string, []string, error)
FindPythonBinary locates a Python binary for the given project type.
func GenerateDockerArtifacts ¶ added in v2.5.2
func GenerateDockerArtifacts(dir string, projectType ProjectType, settingsMap map[string]string, skipPrompts bool) ([]byte, []byte, error)
GenerateDockerArtifacts returns the Dockerfile and .dockerignore contents for the provided project type without writing them to disk. The Dockerfile content may be templated/validated (e.g., Python entrypoint).
func HasDockerIgnore ¶ added in v2.12.1
func HasDockerfile ¶ added in v2.4.5
func IsVersionSatisfied ¶ added in v2.16.7
IsVersionSatisfied checks if a version satisfies the minimum requirement
func LoadDockerDaemonImage ¶ added in v2.16.3
LoadDockerDaemonImage loads a v1.Image from the local Docker daemon by tag or equivalent RepoTag. The caller must Close() the returned closer after finishing with the image (e.g. after pushing layers).
func ResolveInstalledSDKVersion ¶ added in v2.18.0
func ResolveInstalledSDKVersion(dir, entrypoint string, projectType ProjectType) string
ResolveInstalledSDKVersion returns the installed agents SDK version for the project as its own runtime resolves it, or "" when it can't be determined. For Node the resolution starts from the entrypoint's directory so monorepo and workspace layouts (where the dep is a workspace:* symlink, not a versioned entry in the root package.json) report the version that will actually run; entrypoint is relative to dir.
func ResolveNodeAgentVersion ¶ added in v2.18.0
ResolveNodeAgentVersion returns the installed @livekit/agents version as Node resolves it from fromDir, or "" if it can't be determined.
func ResolvePythonAgentVersion ¶ added in v2.18.0
func ResolvePythonAgentVersion(dir string, projectType ProjectType) (version string, notInstalled bool)
ResolvePythonAgentVersion returns the installed livekit-agents version read via the project's interpreter, so any installer (uv, pip, poetry) reports the version that will actually run. notInstalled reports that the interpreter ran but the package is missing from its environment; version is "" when it can't be determined at all (no interpreter, probe failure, etc.).
Types ¶
type PackageInfo ¶ added in v2.5.0
type PackageInfo struct {
Name string
Version string
FoundInFile string
ProjectType ProjectType
Ecosystem string // "pypi" or "npm"
}
PackageInfo represents information about a package found in a project
type ProjectType ¶ added in v2.5.0
type ProjectType string
const ( ProjectTypePythonPip ProjectType = "python.pip" ProjectTypePythonUV ProjectType = "python.uv" ProjectTypeNode ProjectType = "node" ProjectTypeUnknown ProjectType = "unknown" )
func DetectProjectRoot ¶ added in v2.16.4
func DetectProjectRoot(dir string) (string, ProjectType, error)
DetectProjectRoot walks up from dir to find a directory containing project files (pyproject.toml, requirements.txt, package.json, etc). Returns the absolute path to the project root and the detected project type.
func DetectProjectType ¶ added in v2.5.0
func DetectProjectType(dir fs.FS) (ProjectType, error)
func (ProjectType) DefaultEntrypoint ¶ added in v2.5.2
func (p ProjectType) DefaultEntrypoint() string
func (ProjectType) FileExt ¶ added in v2.5.0
func (p ProjectType) FileExt() string
func (ProjectType) IsNode ¶ added in v2.5.0
func (p ProjectType) IsNode() bool
func (ProjectType) IsPython ¶ added in v2.5.0
func (p ProjectType) IsPython() bool
func (ProjectType) Lang ¶ added in v2.5.0
func (p ProjectType) Lang() string
type VersionCheckResult ¶ added in v2.5.0
type VersionCheckResult struct {
PackageInfo
MinVersion string
Satisfied bool
Error error
}
VersionCheckResult represents the result of a version check