MCPcopy Index your code
hub / github.com/docker/docker-agent / refreshToolView

Method refreshToolView

pkg/tui/components/transcript/transcript.go:154–168  ·  view source on GitHub ↗

refreshToolView applies a status to tool message i and recreates its view.

(i int, status types.ToolStatus)

Source from the content-addressed store, hash-verified

152
153// refreshToolView applies a status to tool message i and recreates its view.
154func (t *Transcript) refreshToolView(i int, status types.ToolStatus) tea.Cmd {
155 msg := t.msgs[i]
156 msg.ToolStatus = status
157 if status == types.ToolStatusRunning && msg.StartedAt == nil {
158 now := time.Now()
159 msg.StartedAt = &now
160 }
161 animation.StopView(t.views[i])
162 var prev *types.Message
163 if i > 0 {
164 prev = t.msgs[i-1]
165 }
166 t.views[i] = t.newView(msg, prev)
167 return t.views[i].Init()
168}
169
170// LastIs reports whether the most recent message has the given type.
171func (t *Transcript) LastIs(typ types.MessageType) bool {

Callers 3

AddOrUpdateToolCallMethod · 0.95
SetToolStatusMethod · 0.95
FinalizeToolCallsMethod · 0.95

Calls 4

newViewMethod · 0.95
StopViewFunction · 0.92
NowMethod · 0.80
InitMethod · 0.65

Tested by

no test coverage detected