Open source AI coding agent. Designed for large projects and real world tasks.
Go aiai-agentsai-developer-toolsai-toolsclicommand-linedeveloper-toolsgitgolanggpt-4llmopenaipolyglot-programmingterminalterminal-basedterminal-ui
spinner improvements
Dane Schneidercaa1e6b28f5c
diff --git a/app/cli/auth/account.go b/app/cli/auth/account.goindex 95b0110d..c0394f55 100644--- a/app/cli/auth/account.go+++ b/app/cli/auth/account.go@@ -90,7 +90,9 @@ func selectOrSignInOrCreate() error {return fmt.Errorf("error selecting account: account not found")}+ term.StartSpinner("")orgs, apiErr := apiClient.ListOrgs()+ term.StopSpinner()if apiErr != nil {return fmt.Errorf("error listing orgs: %v", apiErr.Msg)@@ -164,7 +166,10 @@ func promptSignInNewAccount() error {}func verifyEmail(email, host string) (bool, string, error) {++ term.StartSpinner("")res, apiErr := apiClient.CreateEmailVerification(email, host, "")+ term.StopSpinner()if apiErr != nil {return false, "", fmt.Errorf("error creating email verification: %v", apiErr.Msg)@@ -182,10 +187,12 @@ func verifyEmail(email, host string) (bool, string, error) {}func signIn(email, pin, host string) error {+ term.StartSpinner("")res, apiErr := apiClient.SignIn(shared.SignInRequest{Email: email,Pin: pin,}, host)+ term.StopSpinner()if apiErr != nil {return fmt.Errorf("error signing in: %v", apiErr.Msg)@@ -225,11 +232,13 @@ func createAccount(email, pin, host string) error {return fmt.Errorf("error prompting name: %v", err)}+ term.StartSpinner("π Creating account...")res, apiErr := apiClient.CreateAccount(shared.CreateAccountRequest{Email: email,UserName: name,Pin: pin,}, host)+ term.StopSpinner()if apiErr != nil {return fmt.Errorf("error creating account: %v", apiErr.Msg)diff --git a/app/cli/auth/auth.go b/app/cli/auth/auth.goindex fd13da1a..dc70532e 100644--- a/app/cli/auth/auth.go+++ b/app/cli/auth/auth.go@@ -44,7 +44,9 @@ func MustResolveAuth(requireOrg bool) {Current = &authif requireOrg && Current.OrgId == "" {+ term.StartSpinner("")orgs, apiErr := apiClient.ListOrgs()+ term.StopSpinner()if apiErr != nil {term.OutputErrorAndExit("Error listing orgs: %v", apiErr.Msg)diff --git a/app/cli/auth/org.go b/app/cli/auth/org.goindex d7e102ec..576bc914 100644--- a/app/cli/auth/org.go+++ b/app/cli/auth/org.go@@ -70,10 +70,12 @@ func createOrg() (*shared.Org, error) {return nil, fmt.Errorf("error prompting auto add domain users: %v", err)}+ term.StartSpinner("")res, apiErr := apiClient.CreateOrg(shared.CreateOrgRequest{Name: name,AutoAddDomainUsers: autoAddDomainUsers,})+ term.StopSpinner()if apiErr != nil {return nil, fmt.Errorf("error creating org: %v", apiErr.Msg)diff --git a/app/cli/auth/trial.go b/app/cli/auth/trial.goindex dd6015ca..77bad928 100644--- a/app/cli/auth/trial.go+++ b/app/cli/auth/trial.go@@ -43,6 +43,7 @@ func ConvertTrial() error {return fmt.Errorf("error prompting auto add domain users: %v", err)}+ term.StartSpinner("")res, apiErr := apiClient.ConvertTrial(shared.ConvertTrialRequest{Email: email,Pin: pin,@@ -50,6 +51,7 @@ func ConvertTrial() error {OrgName: orgName,OrgAutoAddDomainUsers: autoAddDomainUsers,})+ term.StopSpinner()if apiErr != nil {return fmt.Errorf("error converting trial: %v", apiErr)@@ -80,13 +82,11 @@ func startTrial() error {res, apiErr := apiClient.StartTrial()+ term.StopSpinner()if apiErr != nil {- term.StopSpinner()return fmt.Errorf("error starting trial: %v", apiErr.Msg)}- term.StopSpinner()-err := setAuth(&types.ClientAuth{ClientAccount: types.ClientAccount{Email: res.Email,diff --git a/app/cli/cmd/branches.go b/app/cli/cmd/branches.goindex bd3b9b50..c53bd917 100644--- a/app/cli/cmd/branches.go+++ b/app/cli/cmd/branches.go@@ -35,8 +35,12 @@ func branches(cmd *cobra.Command, args []string) {return}+ term.StartSpinner("")+branches, apiErr := api.Client.ListBranches(lib.CurrentPlanId)+ term.StopSpinner()+if apiErr != nil {term.OutputErrorAndExit("Error getting branches: %v", apiErr)returndiff --git a/app/cli/cmd/cd.go b/app/cli/cmd/cd.goindex 1653e9b5..85046efe 100644--- a/app/cli/cmd/cd.go+++ b/app/cli/cmd/cd.go@@ -38,7 +38,9 @@ func cd(cmd *cobra.Command, args []string) {var plan *shared.Plan+ term.StartSpinner("")plans, apiErr := api.Client.ListPlans([]string{lib.CurrentProjectId})+ term.StopSpinner()if apiErr != nil {term.OutputErrorAndExit("Error getting plans: %v", apiErr)diff --git a/app/cli/cmd/changes.go b/app/cli/cmd/changes.goindex 58e6d584..ba94b899 100644--- a/app/cli/cmd/changes.go+++ b/app/cli/cmd/changes.go@@ -28,7 +28,7 @@ func changes(cmd *cobra.Command, args []string) {auth.MustResolveAuthWithOrg()lib.MustResolveProject()- term.StartSpinner("π¬ Checking plan state...")+ term.StartSpinner("")currentPlanState, apiErr := api.Client.GetCurrentPlanState(lib.CurrentPlanId, lib.CurrentBranch)diff --git a/app/cli/cmd/checkout.go b/app/cli/cmd/checkout.goindex 8f535b48..1b6e0687 100644--- a/app/cli/cmd/checkout.go+++ b/app/cli/cmd/checkout.go@@ -47,7 +47,9 @@ func checkout(cmd *cobra.Command, args []string) {nameOrIdx = strings.TrimSpace(args[0])}+ term.StartSpinner("")branches, apiErr := api.Client.ListBranches(lib.CurrentPlanId)+ term.StopSpinner()if apiErr != nil {term.OutputErrorAndExit("Error getting branches: %v", apiErr)@@ -121,16 +123,15 @@ func checkout(cmd *cobra.Command, args []string) {}if willCreate {- term.StartSpinner("π± Creating branch...")+ term.StartSpinner("")err := api.Client.CreateBranch(lib.CurrentPlanId, lib.CurrentBranch, shared.CreateBranchRequest{Name: branchName})+ term.StopSpinner()if err != nil {- term.StopSpinner()term.OutputErrorAndExit("Error creating branch: %v", err)return}- term.StopSpinner()// fmt.Printf("β Created branch %s\n", color.New(color.Bold, color.FgHiGreen).Sprint(branchName))}diff --git a/app/cli/cmd/clear.go b/app/cli/cmd/clear.goindex 2bef38a8..ad1e17ad 100644--- a/app/cli/cmd/clear.go+++ b/app/cli/cmd/clear.go@@ -27,7 +27,9 @@ func clearAllContext(cmd *cobra.Command, args []string) {return}+ term.StartSpinner("")contexts, err := api.Client.ListContext(lib.CurrentPlanId, lib.CurrentBranch)+ term.StopSpinner()if err != nil {term.OutputErrorAndExit("Error retrieving context: %v", err)diff --git a/app/cli/cmd/connect.go b/app/cli/cmd/connect.goindex 1caf3ba9..2f14af1f 100644--- a/app/cli/cmd/connect.go+++ b/app/cli/cmd/connect.go@@ -42,7 +42,9 @@ func connect(cmd *cobra.Command, args []string) {return}+ term.StartSpinner("")apiErr := api.Client.ConnectPlan(planId, branch, stream.OnStreamPlan)+ term.StopSpinner()if apiErr != nil {term.OutputErrorAndExit("Error connecting to stream: %v", apiErr)diff --git a/app/cli/cmd/convo.go b/app/cli/cmd/convo.goindex 11362606..310473be 100644--- a/app/cli/cmd/convo.go+++ b/app/cli/cmd/convo.go@@ -30,7 +30,10 @@ func convo(cmd *cobra.Command, args []string) {auth.MustResolveAuthWithOrg()lib.MustResolveProject()+ term.StartSpinner("")conversation, apiErr := api.Client.ListConvo(lib.CurrentPlanId, lib.CurrentBranch)+ term.StopSpinner()+if apiErr != nil {term.OutputErrorAndExit("Error loading conversation: %v", apiErr.Msg)}diff --git a/app/cli/cmd/current.go b/app/cli/cmd/current.goindex 552994fc..a273f511 100644--- a/app/cli/cmd/current.go+++ b/app/cli/cmd/current.go@@ -36,7 +36,10 @@ func current(cmd *cobra.Command, args []string) {return}+ term.StartSpinner("")plan, err := api.Client.GetPlan(lib.CurrentPlanId)+ term.StopSpinner()+if err != nil {term.OutputErrorAndExit("Error getting plan: %v", err)returndiff --git a/app/cli/cmd/delete_branch.go b/app/cli/cmd/delete_branch.goindex 397e88aa..6bab3ccb 100644--- a/app/cli/cmd/delete_branch.go+++ b/app/cli/cmd/delete_branch.go@@ -46,7 +46,9 @@ func deleteBranch(cmd *cobra.Command, args []string) {return}+ term.StartSpinner("")branches, apiErr := api.Client.ListBranches(lib.CurrentPlanId)+ term.StopSpinner()if apiErr != nil {term.OutputErrorAndExit("Error getting branches: %v", apiErr)@@ -112,7 +114,9 @@ func deleteBranch(cmd *cobra.Command, args []string) {return}+ term.StartSpinner("")apiErr = api.Client.DeleteBranch(lib.CurrentPlanId, branch)+ term.StopSpinner()if apiErr != nil {term.OutputErrorAndExit("Error deleting branch: %v", apiErr)diff --git a/app/cli/cmd/delete_plan.go b/app/cli/cmd/delete_plan.goindex 86d7f75c..8c62328f 100644--- a/app/cli/cmd/delete_plan.go+++ b/app/cli/cmd/delete_plan.go@@ -50,7 +50,9 @@ func del(cmd *cobra.Command, args []string) {}var plan *shared.Plan+ term.StartSpinner("")plans, apiErr := api.Client.ListPlans([]string{lib.CurrentProjectId})+ term.StopSpinner()if apiErr != nil {term.OutputErrorAndExit("Error getting plans: %v", apiErr)@@ -107,7 +109,9 @@ func del(cmd *cobra.Command, args []string) {term.OutputErrorAndExit("Plan not found")}+ term.StartSpinner("")apiErr = api.Client.DeletePlan(plan.Id)+ term.StopSpinner()if apiErr != nil {term.OutputErrorAndExit("Error deleting plan: %s", apiErr.Msg)@@ -124,7 +128,10 @@ func del(cmd *cobra.Command, args []string) {}func delAll() {+ term.StartSpinner("")err := api.Client.DeleteAllPlans(lib.CurrentProjectId)+ term.StopSpinner()+if err != nil {term.OutputErrorAndExit("Error deleting all plans: %v", err)}diff --git a/app/cli/cmd/log.go b/app/cli/cmd/log.goindex e6daafb9..856ac559 100644--- a/app/cli/cmd/log.go+++ b/app/cli/cmd/log.go@@ -36,7 +36,10 @@ func runLog(cmd *cobra.Command, args []string) {return}+ term.StartSpinner("")res, apiErr := api.Client.ListLogs(lib.CurrentPlanId, lib.CurrentBranch)+ term.StopSpinner()+if apiErr != nil {term.OutputErrorAndExit("Error getting logs: %v", apiErr)}diff --git a/app/cli/cmd/ls.go b/app/cli/cmd/ls.goindex 3bd18858..c8031940 100644--- a/app/cli/cmd/ls.go+++ b/app/cli/cmd/ls.go@@ -26,7 +26,9 @@ func listContext(cmd *cobra.Command, args []string) {auth.MustResolveAuthWithOrg()lib.MustResolveProject()+ term.StartSpinner("")contexts, err := api.Client.ListContext(lib.CurrentPlanId, lib.CurrentBranch)+ term.StopSpinner()if err != nil {term.OutputErrorAndExit("Error listing context: %v", err)diff --git a/app/cli/cmd/models.go b/app/cli/cmd/models.goindex 887d98fd..c414d3ee 100644--- a/app/cli/cmd/models.go+++ b/app/cli/cmd/models.go@@ -29,7 +29,9 @@ func models(cmd *cobra.Command, args []string) {auth.MustResolveAuthWithOrg()lib.MustResolveProject()+ term.StartSpinner("")settings, err := api.Client.GetSettings(lib.CurrentPlanId, lib.CurrentBranch)+ term.StopSpinner()if err != nil {term.OutputErrorAndExit("Error getting settings: %v", err)diff --git a/app/cli/cmd/new.go b/app/cli/cmd/new.goindex 036f3958..205c7729 100644--- a/app/cli/cmd/new.go+++ b/app/cli/cmd/new.go@@ -35,7 +35,9 @@ func new(cmd *cobra.Command, args []string) {auth.MustResolveAuthWithOrg()lib.MustResolveOrCreateProject()+ term.StartSpinner("")res, apiErr := api.Client.CreatePlan(lib.CurrentProjectId, shared.CreatePlanRequest{Name: name})+ term.StopSpinner()if apiErr != nil {if apiErr.Type == shared.ApiErrorTypeTrialPlansExceeded {diff --git a/app/cli/cmd/plans.go b/app/cli/cmd/plans.goindex 97233e33..92e35704 100644--- a/app/cli/cmd/plans.go+++ b/app/cli/cmd/plans.go@@ -106,7 +106,9 @@ func plans(cmd *cobra.Command, args []string) {return}+ term.StartSpinner("")plans, apiErr := api.Client.ListPlans(projectIds)+ term.StopSpinner()if apiErr != nil {term.OutputErrorAndExit("Error getting plans: %v", apiErr)diff --git a/app/cli/cmd/ps.go b/app/cli/cmd/ps.goindex e618d334..e553f5d5 100644--- a/app/cli/cmd/ps.go+++ b/app/cli/cmd/ps.go@@ -33,7 +33,9 @@ func ps(cmd *cobra.Command, args []string) {return}+ term.StartSpinner("")res, apiErr := api.Client.ListPlansRunning([]string{lib.CurrentProjectId}, true)+ term.StopSpinner()if apiErr != nil {term.OutputErrorAndExit("Error getting running plans: %v", apiErr)diff --git a/app/cli/cmd/rewind.go b/app/cli/cmd/rewind.goindex 9b0936bc..d9bd22be 100644--- a/app/cli/cmd/rewind.go+++ b/app/cli/cmd/rewind.go@@ -46,6 +46,7 @@ func rewind(cmd *cobra.Command, args []string) {stepsOrSha = "1"}+ term.StartSpinner("")logsRes, apiErr := api.Client.ListLogs(lib.CurrentPlanId, lib.CurrentBranch)if apiErr != nil {@@ -81,6 +82,7 @@ func rewind(cmd *cobra.Command, args []string) {// Rewind to the target sha_, apiErr = api.Client.RewindPlan(lib.CurrentPlanId, lib.CurrentBranch, shared.RewindPlanRequest{Sha: targetSha})+ term.StopSpinner()if apiErr != nil {term.OutputErrorAndExit("Error rewinding plan: %v", apiErr)diff --git a/app/cli/cmd/rm.go b/app/cli/cmd/rm.goindex 189f7140..6423e4be 100644--- a/app/cli/cmd/rm.go+++ b/app/cli/cmd/rm.go@@ -30,6 +30,7 @@ func contextRm(cmd *cobra.Command, args []string) {return}+ term.StartSpinner("")contexts, err := api.Client.ListContext(lib.CurrentPlanId, lib.CurrentBranch)if err != nil {@@ -61,6 +62,7 @@ func contextRm(cmd *cobra.Command, args []string) {res, err := api.Client.DeleteContext(lib.CurrentPlanId, lib.CurrentBranch, shared.DeleteContextRequest{Ids: deleteIds,})+ term.StopSpinner()if err != nil {term.OutputErrorAndExit("Error deleting context: %v", err)@@ -68,6 +70,7 @@ func contextRm(cmd *cobra.Command, args []string) {fmt.Println("β " + res.Msg)} else {+ term.StopSpinner()fmt.Println("π€·ββοΈ No context removed")}}diff --git a/app/cli/cmd/set_model.go b/app/cli/cmd/set_model.goindex ac481608..699ef8b3 100644--- a/app/cli/cmd/set_model.go+++ b/app/cli/cmd/set_model.go@@ -31,7 +31,10 @@ func modelsSet(cmd *cobra.Command, args []string) {auth.MustResolveAuthWithOrg()lib.MustResolveProject()+ term.StartSpinner("")originalSettings, apiErr := api.Client.GetSettings(lib.CurrentPlanId, lib.CurrentBranch)+ term.StopSpinner()+if apiErr != nil {term.OutputErrorAndExit("Error getting current settings: %v", apiErr)return@@ -354,12 +357,15 @@ func modelsSet(cmd *cobra.Command, args []string) {return}+ term.StartSpinner("")res, apiErr := api.Client.UpdateSettings(lib.CurrentPlanId,lib.CurrentBranch,shared.UpdateSettingsRequest{Settings: settings,})+ term.StopSpinner()+if apiErr != nil {term.OutputErrorAndExit("Error updating settings: %v", apiErr)returndiff --git a/app/cli/cmd/stop.go b/app/cli/cmd/stop.goindex 21cc4813..a9a02d06 100644--- a/app/cli/cmd/stop.go+++ b/app/cli/cmd/stop.go@@ -37,7 +37,9 @@ func stop(cmd *cobra.Command, args []string) {return}+ term.StartSpinner("")apiErr := api.Client.StopPlan(planId, branch)+ term.StopSpinner()if apiErr != nil {term.OutputErrorAndExit("Error stopping stream: %v", apiErr.Msg)diff --git a/app/cli/fs/fs.go b/app/cli/fs/fs.goindex 16ced131..c7628a90 100644--- a/app/cli/fs/fs.go+++ b/app/cli/fs/fs.go@@ -121,25 +121,33 @@ func IsGitRepo(dir string) bool {return isGitRepo}-func GetProjectPaths(baseDir string) (map[string]bool, *ignore.GitIgnore, error) {+type ProjectPaths struct {+ ActivePaths map[string]bool+ AllPaths map[string]bool+ PlandexIgnored *ignore.GitIgnore+ IgnoredPaths map[string]string+}++func GetProjectPaths(baseDir string) (*ProjectPaths, error) {if ProjectRoot == "" {- return nil, nil, fmt.Errorf("no project root found")+ return nil, fmt.Errorf("no project root found")}return GetPaths(baseDir, ProjectRoot)}-func GetPaths(baseDir, currentDir string) (map[string]bool, *ignore.GitIgnore, error) {+func GetPaths(baseDir, currentDir string) (*ProjectPaths, error) {ignored, err := GetPlandexIgnore(currentDir)if err != nil {- return nil, nil, err+ return nil, err}- paths := map[string]bool{}- ignoredPaths := map[string]bool{}+ allPaths := map[string]bool{}+ activePaths := map[string]bool{}- dirs := map[string]bool{}+ allDirs := map[string]bool{}+ activeDirs := map[string]bool{}isGitRepo := IsGitRepo(baseDir)@@ -177,11 +185,10 @@ func GetPaths(baseDir, currentDir string) (map[string]bool, *ignore.GitIgnore, e}if ignored != nil && ignored.MatchesPath(relFile) {- ignoredPaths[relFile] = truecontinue}- paths[relFile] = true+ activePaths[relFile] = true}errCh <- nil@@ -213,11 +220,10 @@ func GetPaths(baseDir, currentDir string) (map[string]bool, *ignore.GitIgnore, e}if ignored != nil && ignored.MatchesPath(relFile) {- ignoredPaths[relFile] = truecontinue}- paths[relFile] = true+ activePaths[relFile] = true}errCh <- nil@@ -233,30 +239,40 @@ func GetPaths(baseDir, currentDir string) (map[string]bool, *ignore.GitIgnore, e}if info.IsDir() {+ if info.Name() == ".git" {+ return filepath.SkipDir+ }+ if info.Name() == ".plandex" || info.Name() == ".plandex-dev" {+ return filepath.SkipDir+ }+relPath, err := filepath.Rel(currentDir, path)if err != nil {return err}+ allDirs[relPath] = true+if ignored != nil && ignored.MatchesPath(relPath) {- ignoredPaths[relPath] = truereturn filepath.SkipDir}- dirs[relPath] = true- } else if !isGitRepo {+ activeDirs[relPath] = true+ } else {relPath, err := filepath.Rel(currentDir, path)if err != nil {return err}+ allPaths[relPath] = true+if ignored != nil && ignored.MatchesPath(relPath) {- ignoredPaths[relPath] = truereturn nil}- // lock isn't need here because isGitRepo is false, which makes this the only routine- paths[relPath] = true+ mu.Lock()+ defer mu.Unlock()+ activePaths[relPath] = true}return nil@@ -273,16 +289,35 @@ func GetPaths(baseDir, currentDir string) (map[string]bool, *ignore.GitIgnore, efor i := 0; i < numRoutines; i++ {err := <-errChif err != nil {- return nil, nil, err+ return nil, err}}- for dir := range dirs {- paths[dir] = true+ for dir := range allDirs {+ allPaths[dir] = true+ }++ for dir := range activeDirs {+ activePaths[dir] = true}- return paths, ignored, nil+ ignoredPaths := map[string]string{}+ for path := range allPaths {+ if _, ok := activePaths[path]; !ok {+ if ignored != nil && ignored.MatchesPath(path) {+ ignoredPaths[path] = "plandex"+ } else {+ ignoredPaths[path] = "git"+ }+ }+ }+ return &ProjectPaths{+ ActivePaths: activePaths,+ AllPaths: allPaths,+ PlandexIgnored: ignored,+ IgnoredPaths: ignoredPaths,+ }, nil}func GetPlandexIgnore(dir string) (*ignore.GitIgnore, error) {diff --git a/app/cli/go.mod b/app/cli/go.modindex 299dd064..c38f941f 100644--- a/app/cli/go.mod+++ b/app/cli/go.mod@@ -5,6 +5,7 @@ go 1.21.3require (github.com/atotto/clipboard v0.1.4github.com/charmbracelet/lipgloss v0.9.1+ github.com/davecgh/go-spew v1.1.1github.com/fatih/color v1.16.0github.com/muesli/reflow v0.3.0github.com/muesli/termenv v0.15.2diff --git a/app/cli/lib/active_stream.go b/app/cli/lib/active_stream.goindex 8f80c090..1336eeaa 100644--- a/app/cli/lib/active_stream.go+++ b/app/cli/lib/active_stream.go@@ -9,7 +9,9 @@ import ()func SelectActiveStream(args []string) (string, string, bool) {+ term.StartSpinner("")res, apiErr := api.Client.ListPlansRunning([]string{CurrentProjectId}, false)+ term.StopSpinner()if apiErr != nil {term.OutputErrorAndExit("Error getting running plans: %v", apiErr)diff --git a/app/cli/lib/apply.go b/app/cli/lib/apply.goindex fdd66825..9c5a588e 100644--- a/app/cli/lib/apply.go+++ b/app/cli/lib/apply.go@@ -12,7 +12,7 @@ import ()func ApplyPlan(planId, branch string, autoConfirm bool) error {- term.StartSpinner("π¬ Checking plan state...")+ term.StartSpinner("")currentPlanState, apiErr := api.Client.GetCurrentPlanState(planId, branch)@@ -159,7 +159,9 @@ func ApplyPlan(planId, branch string, autoConfirm bool) error {}}+ term.StartSpinner("")apiErr := api.Client.ApplyPlan(planId, branch)+ term.StopSpinner()if apiErr != nil {aborted = truediff --git a/app/cli/lib/context_load.go b/app/cli/lib/context_load.goindex af9577a8..9edbbab2 100644--- a/app/cli/lib/context_load.go+++ b/app/cli/lib/context_load.go@@ -14,7 +14,6 @@ import ("github.com/fatih/color""github.com/plandex/plandex/shared"- ignore "github.com/sabhiram/go-gitignore")func MustLoadContext(resources []string, params *types.LoadContextParams) {@@ -72,24 +71,23 @@ func MustLoadContext(resources []string, params *types.LoadContextParams) {ignoredPaths := make(map[string]string)if len(inputFilePaths) > 0 {- projectPaths := make(map[string]bool)- var plandexIgnored *ignore.GitIgnore+ baseDir := fs.GetBaseDirForFilePaths(inputFilePaths)- if !params.ForceSkipIgnore {- baseDir := fs.GetBaseDirForFilePaths(inputFilePaths)+ paths, err := fs.GetProjectPaths(baseDir)+ if err != nil {+ onErr(fmt.Errorf("failed to get project paths: %v", err))+ }- projectPaths, plandexIgnored, err = fs.GetProjectPaths(baseDir)- if err != nil {- onErr(fmt.Errorf("failed to get project paths: %v", err))- }+ // fmt.Println("active paths", len(paths.ActivePaths))+ // fmt.Println("ignored paths", len(paths.IgnoredPaths))+ // fmt.Println("all paths", len(paths.AllPaths))+ if !params.ForceSkipIgnore {var filteredPaths []stringfor _, inputFilePath := range inputFilePaths {- if _, ok := projectPaths[inputFilePath]; !ok {- if plandexIgnored != nil && plandexIgnored.MatchesPath(inputFilePath) {- ignoredPaths[inputFilePath] = "plandex"- } else {- ignoredPaths[inputFilePath] = "git"+ if _, ok := paths.ActivePaths[inputFilePath]; !ok {+ if _, ok := paths.IgnoredPaths[inputFilePath]; ok {+ ignoredPaths[inputFilePath] = paths.IgnoredPaths[inputFilePath]}} else {filteredPaths = append(filteredPaths, inputFilePath)@@ -111,12 +109,12 @@ func MustLoadContext(resources []string, params *types.LoadContextParams) {if !params.ForceSkipIgnore {var filteredPaths []stringfor _, path := range flattenedPaths {- if _, ok := projectPaths[path]; ok {+ if _, ok := paths.ActivePaths[path]; ok {filteredPaths = append(filteredPaths, path)- } else if plandexIgnored != nil && plandexIgnored.MatchesPath(path) {- ignoredPaths[path] = "plandex"} else {- ignoredPaths[path] = "git"+ if _, ok := paths.IgnoredPaths[path]; ok {+ ignoredPaths[path] = paths.IgnoredPaths[path]+ }}}flattenedPaths = filteredPaths@@ -150,12 +148,12 @@ func MustLoadContext(resources []string, params *types.LoadContextParams) {if !params.ForceSkipIgnore {var filteredPaths []stringfor _, path := range flattenedPaths {- if _, ok := projectPaths[path]; ok {+ if _, ok := paths.ActivePaths[path]; ok {filteredPaths = append(filteredPaths, path)- } else if plandexIgnored != nil && plandexIgnored.MatchesPath(path) {- ignoredPaths[path] = "plandex"} else {- ignoredPaths[path] = "git"+ if _, ok := paths.IgnoredPaths[path]; ok {+ ignoredPaths[path] = paths.IgnoredPaths[path]+ }}}flattenedPaths = filteredPathsdiff --git a/app/cli/plan_exec/build.go b/app/cli/plan_exec/build.goindex 473e3712..de4eb067 100644--- a/app/cli/plan_exec/build.go+++ b/app/cli/plan_exec/build.go@@ -14,7 +14,7 @@ import ()func Build(params ExecParams, buildBg bool) (bool, error) {- term.StartSpinner("ποΈ Starting build...")+ term.StartSpinner("")contexts, apiErr := api.Client.ListContext(params.CurrentPlanId, params.CurrentBranch)@@ -30,7 +30,7 @@ func Build(params ExecParams, buildBg bool) (bool, error) {return false, nil}- projectPaths, _, err := fs.GetProjectPaths(fs.GetBaseDirForContexts(contexts))+ paths, err := fs.GetProjectPaths(fs.GetBaseDirForContexts(contexts))if err != nil {return false, fmt.Errorf("error getting project paths: %v", err)@@ -38,7 +38,7 @@ func Build(params ExecParams, buildBg bool) (bool, error) {apiErr = api.Client.BuildPlan(params.CurrentPlanId, params.CurrentBranch, shared.BuildPlanRequest{ConnectStream: !buildBg,- ProjectPaths: projectPaths,+ ProjectPaths: paths.ActivePaths,ApiKey: os.Getenv("OPENAI_API_KEY"),}, stream.OnStreamPlan)diff --git a/app/cli/plan_exec/tell.go b/app/cli/plan_exec/tell.goindex 08f395ea..196b72d4 100644--- a/app/cli/plan_exec/tell.go+++ b/app/cli/plan_exec/tell.go@@ -22,6 +22,7 @@ func TellPlan(tellNoBuild,isUserContinue bool,) {+ term.StartSpinner("")contexts, apiErr := api.Client.ListContext(params.CurrentPlanId, params.CurrentBranch)if apiErr != nil {@@ -40,7 +41,7 @@ func TellPlan(os.Exit(0)}- projectPaths, _, err := fs.GetProjectPaths(fs.GetBaseDirForContexts(contexts))+ paths, err := fs.GetProjectPaths(fs.GetBaseDirForContexts(contexts))if err != nil {term.OutputErrorAndExit("Error getting project paths: %v", err)@@ -66,7 +67,7 @@ func TellPlan(Prompt: prompt,ConnectStream: !tellBg,AutoContinue: !tellStop,- ProjectPaths: projectPaths,+ ProjectPaths: paths.ActivePaths,BuildMode: buildMode,IsUserContinue: isUserContinue,ApiKey: os.Getenv("OPENAI_API_KEY"),diff --git a/app/cli/stream_tui/run.go b/app/cli/stream_tui/run.goindex df79d9e1..5f286400 100644--- a/app/cli/stream_tui/run.go+++ b/app/cli/stream_tui/run.go@@ -57,7 +57,7 @@ func StartStreamUI(prompt string, buildOnly bool) error {if mod.stopped {fmt.Println()- color.New(color.BgBlack, color.Bold, color.FgHiRed).Print(" π stopped early by user ")+ color.New(color.BgBlack, color.Bold, color.FgHiRed).Print(" π stopped early ")fmt.Println()}diff --git a/app/cli/term/errors.go b/app/cli/term/errors.goindex b6b391d9..f6d1e231 100644--- a/app/cli/term/errors.go+++ b/app/cli/term/errors.go@@ -15,6 +15,7 @@ func OutputNoApiKeyMsgAndExit() {}func OutputErrorAndExit(msg string, args ...interface{}) {+ StopSpinner()msg = fmt.Sprintf(msg, args...)displayMsg := ""diff --git a/app/cli/term/spinner.go b/app/cli/term/spinner.goindex f7f24428..c1f1c42b 100644--- a/app/cli/term/spinner.go+++ b/app/cli/term/spinner.go@@ -6,7 +6,8 @@ import ("github.com/briandowns/spinner")-const minDuration = 700 * time.Millisecond+const withMissageMinDuration = 700 * time.Millisecond+const withoutMissageMinDuration = 400 * time.Millisecondvar s = spinner.New(spinner.CharSets[33], 100*time.Millisecond)var startedAt time.Time@@ -32,8 +33,11 @@ func StartSpinner(msg string) {func StopSpinner() {elapsed := time.Since(startedAt)- if elapsed < minDuration {- time.Sleep(minDuration - elapsed)++ if lastMessage != "" && elapsed < withMissageMinDuration {+ time.Sleep(withMissageMinDuration - elapsed)+ } else if elapsed < withoutMissageMinDuration {+ time.Sleep(withoutMissageMinDuration - elapsed)}s.Stop()