Skip to content

armgit / ax

Public Imported from GitHub
0

Agent Executor (AX) is Google's open agentic orchestration runtime

Go

Add ShowResumption (#201)

Jaana Dogan4341302eb8be
diff --git a/cmd/ax/exec.go b/cmd/ax/exec.go
index 5010195..7dbc7ff 100644
--- a/cmd/ax/exec.go
+++ b/cmd/ax/exec.go
@@ -329,8 +329,7 @@ func promptUser(d *internal.Display, input string) (string, bool, error) {
d.DisplayInput(input)
if strings.ToLower(strings.TrimSpace(input)) == "q" {
- fmt.Println("Goodbye!")
- fmt.Printf("To resume this conversation, ax exec --conversation %s\n", execConversationID)
+ d.ShowResumption(execConversationID)
return "", true, nil
}
return input, false, nil
diff --git a/cmd/ax/internal/display.go b/cmd/ax/internal/display.go
index b9e91b5..326d661 100644
--- a/cmd/ax/internal/display.go
+++ b/cmd/ax/internal/display.go
@@ -37,6 +37,7 @@ type Display struct {
userStyle lipgloss.Style
checkpointStyle lipgloss.Style
idStyle lipgloss.Style
+ resumeStyle lipgloss.Style
loadingVisible atomic.Bool
loadingStopCh chan bool
@@ -45,12 +46,10 @@ type Display struct {
func NewDisplay(id string) *Display {
return &Display{
id: id,
- userStyle: lipgloss.NewStyle().
- Foreground(purple),
- checkpointStyle: lipgloss.NewStyle().
- Foreground(comment),
- idStyle: lipgloss.NewStyle().
- Foreground(comment),
+ userStyle: lipgloss.NewStyle().Foreground(purple),
+ checkpointStyle: lipgloss.NewStyle().Foreground(comment),
+ idStyle: lipgloss.NewStyle().Foreground(comment),
+ resumeStyle: lipgloss.NewStyle().Foreground(comment),
loadingStopCh: make(chan bool),
}
}
@@ -120,3 +119,8 @@ func (d *Display) PromptForInput() (string, error) {
}
return userInput, nil
}
+
+func (d *Display) ShowResumption(id string) {
+ fmt.Println(d.resumeStyle.Render("To resume the conversation,"))
+ fmt.Println(d.resumeStyle.Render(fmt.Sprintf("ax exec --conversation %s", id)))
+}
\ No newline at end of file