MCPcopy
hub / github.com/docker/docker-agent / Append

Method Append

pkg/tui/components/transcript/transcript.go:50–55  ·  view source on GitHub ↗

Append adds a message and returns the new view's Init command (spinner and running-tool views use it to start the animation tick stream).

(msg *types.Message)

Source from the content-addressed store, hash-verified

48// Append adds a message and returns the new view's Init command (spinner
49// and running-tool views use it to start the animation tick stream).
50func (t *Transcript) Append(msg *types.Message) tea.Cmd {
51 v := t.newView(msg, t.lastMsg())
52 t.msgs = append(t.msgs, msg)
53 t.views = append(t.views, v)
54 return v.Init()
55}
56
57// newView creates the right view for a message, like the message list's
58// createToolCallView / createMessageView helpers.

Callers 14

AppendToLastMessageMethod · 0.95
AddOrUpdateToolCallMethod · 0.95
AddMethod · 0.45
TestAppendAndRenderFunction · 0.45
TestSetToolStatusFunction · 0.45
TestFinalizeToolCallsFunction · 0.45
TestRemoveLastFunction · 0.45

Calls 3

newViewMethod · 0.95
lastMsgMethod · 0.95
InitMethod · 0.65

Tested by 11

TestAppendAndRenderFunction · 0.36
TestSetToolStatusFunction · 0.36
TestFinalizeToolCallsFunction · 0.36
TestRemoveLastFunction · 0.36
TestMessagesFunction · 0.36