Skip to content

Open source AI coding agent. Designed for large projects and real world tasks.

CLI tweaks, apply script prompt update

Dane Schneider768447a86017
diff --git a/app/cli/cmd/repl.go b/app/cli/cmd/repl.go
index 9f35730a..9afedded 100644
--- a/app/cli/cmd/repl.go
+++ b/app/cli/cmd/repl.go
@@ -305,6 +305,8 @@ func executor(in string, p *prompt.Prompt) {
if input == "" {
return
}
+ // condense whitespace
+ input = strings.Join(strings.Fields(input), " ")
// Handle plandex/pdx command prefix
if strings.HasPrefix(lastLine, "plandex ") || strings.HasPrefix(lastLine, "pdx ") {
diff --git a/app/cli/stream_tui/update.go b/app/cli/stream_tui/update.go
index 6bbde480..654e64e9 100644
--- a/app/cli/stream_tui/update.go
+++ b/app/cli/stream_tui/update.go
@@ -113,7 +113,6 @@ func (m streamUIModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
case buildStatusPollMsg:
state := m.readState()
- log.Println("buildStatusPollMsg")
numPaths := len(m.tokensByPath)
numFinished := 0
@@ -234,7 +233,11 @@ func (m *streamUIModel) getViewportDimensions() (int, int) {
var buildHeight int
if m.building {
- buildHeight = len(m.getRows(false))
+ if m.buildViewCollapsed {
+ buildHeight = 3
+ } else {
+ buildHeight = len(m.getRows(false))
+ }
}
var processingHeight int
diff --git a/app/cli/stream_tui/view.go b/app/cli/stream_tui/view.go
index 74031d8e..587cd44b 100644
--- a/app/cli/stream_tui/view.go
+++ b/app/cli/stream_tui/view.go
@@ -81,7 +81,7 @@ func (m streamUIModel) doRenderBuild(outputStatic bool) string {
style = lipgloss.NewStyle().Width(m.width).BorderStyle(lipgloss.NormalBorder()).BorderTop(true).BorderForeground(lipgloss.Color(borderColor))
}
- if m.buildViewCollapsed {
+ if !outputStatic && m.buildViewCollapsed {
// Render collapsed view
inProgress := 0
total := len(m.tokensByPath)
@@ -105,10 +105,10 @@ func (m streamUIModel) doRenderBuild(outputStatic bool) string {
var summary string
if total > 0 {
- summary = fmt.Sprintf(" %d %s", total, lbl)
+ summary = fmt.Sprintf(" πŸ“„ %d %s", total, lbl)
}
if inProgress > 0 {
- summary += fmt.Sprintf(" β€’ editing %d %s", inProgress, m.buildSpinner.View())
+ summary += fmt.Sprintf(" β€’ πŸ“ editing %d %s", inProgress, m.buildSpinner.View())
}
if hasApplyScript {
if total > 0 {
@@ -152,9 +152,9 @@ func (m streamUIModel) getBuildHeader(static bool) string {
// Add collapse/expand hint
var hint string
if !static {
- hint = "↓ collapse"
+ hint = "(↓) collapse"
if m.buildViewCollapsed {
- hint = "↑ expand"
+ hint = "(↑) expand"
}
}
padding := m.width - lipgloss.Width(head) - lipgloss.Width(hint) - 1 // 1 for space
diff --git a/app/cli/term/format.go b/app/cli/term/format.go
index 427f5125..0b84ebf0 100644
--- a/app/cli/term/format.go
+++ b/app/cli/term/format.go
@@ -77,9 +77,9 @@ func GetPlain(input string) string {
s := wordwrap.String(input, min(width-2, 80))
// add padding
lines := strings.Split(s, "\n")
- for i := range lines {
- lines[i] = " " + lines[i]
- }
+ // for i := range lines {
+ // lines[i] = " " + lines[i]
+ // }
s = strings.Join(lines, "\n")
s = termenv.String(s).Foreground(GetStreamForegroundColor()).String()
diff --git a/app/server/model/prompts/apply_exec.go b/app/server/model/prompts/apply_exec.go
index c31c41cd..f98cafa6 100644
--- a/app/server/model/prompts/apply_exec.go
+++ b/app/server/model/prompts/apply_exec.go
@@ -877,6 +877,11 @@ CRITICAL: The script must handle both program execution and security carefully:
6. Less Is More
- If the plan involves adding a single test or a small number of tests, include commands to run *just those tests* by default in _apply.sh rather than running the entire test suite. Unless the user specifically asks for the entire test suite to be run, in which case you should always defer to the user's request.
- Apply the same principle to other commands. Be minimal and selective when choosing which commands to run.
+
+Remember:
+- Do NOT tell the user to run _apply.sh. It will be run automatically when the plan is applied.
+- Do NOT tell the user to make _apply.sh executable or grant it permissions. This will all be done automatically.
+- The user CANNOT run _apply.sh manually, so DO NOT tell them to do so. It is an ephemeral script that is only used to apply the plan. It does not remain on the user's machine after the plan is applied.
`
var NoApplyScriptPlanningPrompt = `