05ae530442
Install current verified harness releases inside Docker, preserve persistent accounts and settings, and provide separate interactive and pipeline model defaults with terminal onboarding and fuzzy pickers. Add Docker-aware authoring transport, Pi stage execution, bounded workflow controls, reliable final-result readback and usage settlement, and finite short-lived CLI pipe draining. Keep dated installation evidence and packaged authoring guidance consistent. Verified with a real Docker installation, both harness stages and interactive authors, the built-in plan/implement/review starter, independent host race/vet checks, installer tests, and packaged skill tests. Generated release receipts stay ignored in clean checkouts.
54 lines
1.3 KiB
Go
54 lines
1.3 KiB
Go
package tui
|
|
|
|
import (
|
|
"fmt"
|
|
"os/exec"
|
|
|
|
"git.a-wan.net/alan/pipelines/internal/runinspect"
|
|
tea "github.com/charmbracelet/bubbletea"
|
|
)
|
|
|
|
type debugClosedMsg struct{ err error }
|
|
|
|
func (m Model) selectedRunID() int64 {
|
|
if !m.runOpen || m.runStartRequest != "" {
|
|
return 0
|
|
}
|
|
if m.runDetail != nil {
|
|
return m.runDetail.ID
|
|
}
|
|
if m.requestedRunID > 0 {
|
|
return 0
|
|
}
|
|
runs := m.visibleRuns()
|
|
if len(runs) > 0 {
|
|
return runs[min(m.runIndex, len(runs)-1)].ID
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (m Model) debugRun() (tea.Model, tea.Cmd) {
|
|
id := m.selectedRunID()
|
|
if id <= 0 {
|
|
m.appendLine("Select a loaded run to debug.")
|
|
return m, nil
|
|
}
|
|
m.editorDebugRunID = id
|
|
m.editorOpen = true
|
|
m.editorIndex = 0
|
|
m.editorInput = newInput()
|
|
m.editorInput.Placeholder = "Search configured harnesses or nvim…"
|
|
m.editorDraft = nil
|
|
return m, m.editorInput.Focus()
|
|
}
|
|
|
|
func (m Model) debugUsing(id int64, choice string) (tea.Model, tea.Cmd) {
|
|
cli, err := runinspect.CLIExecutable()
|
|
if err != nil {
|
|
m.appendLine("debug: pipelines CLI is unavailable: " + err.Error())
|
|
return m, nil
|
|
}
|
|
cmd := exec.Command(cli, "--url", m.url, "debug", fmt.Sprint(id), "--harness", choice, "--yes")
|
|
return m.confirmMutation(fmt.Sprintf("Open a new debugging session for run #%d?", id), func() tea.Cmd { return tea.ExecProcess(cmd, func(err error) tea.Msg { return debugClosedMsg{err} }) })
|
|
}
|