Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions cmd/lk/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ func createAgent(ctx context.Context, cmd *cli.Command) error {
lkConfig = config.NewLiveKitTOML(subdomainMatches[1]).WithDefaultAgent()
}
if !silent {
fmt.Printf("Creating new agent\n")
fmt.Printf("Creating new agent deployment\n")
}

secrets, err := requireSecrets(ctx, cmd, false, false)
Expand All @@ -540,10 +540,10 @@ func createAgent(ctx context.Context, cmd *cli.Command) error {
}

projectType, err := agentfs.DetectProjectType(os.DirFS(workingDir))
fmt.Printf("Detected project type [%s]\n", util.Accented(string(projectType)))
if err != nil {
return fmt.Errorf("unable to determine project type: %w, please use a supported project type, or create your own Dockerfile in the current directory", err)
return fmt.Errorf("unable to determine agent language: %w, please navigate to a directory containing an agent written in a supported language", err)
}
fmt.Printf("Detected agent language [%s]\n", util.Accented(string(projectType)))

if err := requireDockerfile(ctx, cmd, workingDir, projectType, settingsMap); err != nil {
return err
Expand Down Expand Up @@ -717,8 +717,9 @@ func deployAgent(ctx context.Context, cmd *cli.Command) error {

projectType, err := agentfs.DetectProjectType(os.DirFS(workingDir))
if err != nil {
return fmt.Errorf("unable to determine project type: %w, please use a supported project type, or create your own Dockerfile in the current directory", err)
return fmt.Errorf("unable to determine agent language: %w, please make sure you are inside a directory containing an agent written in a supported language", err)
}
fmt.Printf("Detected agent language [%s]\n", util.Accented(string(projectType)))

settingsMap, err := getClientSettings(ctx, cmd.Bool("silent"))
if err != nil {
Expand Down Expand Up @@ -1436,10 +1437,10 @@ func generateAgentDockerfile(ctx context.Context, cmd *cli.Command) error {
}

projectType, err := agentfs.DetectProjectType(os.DirFS(workingDir))
fmt.Printf("Detected project type [%s]\n", util.Accented(string(projectType)))
if err != nil {
return fmt.Errorf("unable to determine project type: %w, please use a supported project type, or create your own Dockerfile in the current directory", err)
return fmt.Errorf("unable to determine agent language: %w, please make sure you are inside a directory containing an agent written in a supported language", err)
}
fmt.Printf("Detected agent language [%s]\n", util.Accented(string(projectType)))

dockerfilePath := filepath.Join(workingDir, "Dockerfile")
dockerignorePath := filepath.Join(workingDir, ".dockerignore")
Expand Down
2 changes: 1 addition & 1 deletion pkg/agentfs/detect.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,5 @@ func DetectProjectType(dir fs.FS) (ProjectType, error) {
return ProjectTypePythonPip, nil
}

return ProjectTypeUnknown, errors.New("project type could not be identified; expected package.json, requirements.txt, pyproject.toml, or lock files")
return ProjectTypeUnknown, errors.New("expected package.json, requirements.txt, pyproject.toml, or lock files")
}
2 changes: 1 addition & 1 deletion pkg/agentfs/sdk_version_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func CheckSDKVersion(dir string, projectType ProjectType, settingsMap map[string
// Find the best result (prefer lock files over source files)
bestResult := findBestResult(results)
if bestResult == nil {
return fmt.Errorf("package %s not found in any project files", getTargetPackageName(projectType))
return fmt.Errorf("package %s not found in any project files. Are you sure this is an agent?", getTargetPackageName(projectType))
}

if !bestResult.Satisfied {
Expand Down
Loading