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

Method InjectUserMessage

pkg/app/app.go:754–756  ·  view source on GitHub ↗

InjectUserMessage feeds content into the app exactly as if the user had typed and submitted it in the TUI. It is the entry point external drivers (the --listen control plane) use to send follow-up prompts: routing through the normal SendMsg path means the message is queued when the agent is busy, tr

(ctx context.Context, content string)

Source from the content-addressed store, hash-verified

752// SendMsg is a TUI message, not a runtime.Event, so SSE subscribers (which
753// forward only runtime.Events) ignore it; it reaches the TUI program alone.
754func (a *App) InjectUserMessage(ctx context.Context, content string) {
755 a.sendEvent(ctx, messages.SendMsg{Content: content})
756}
757
758// SubscribeWith subscribes to app events using a custom send function.
759// Multiple concurrent subscribers are supported: a single fan-out goroutine

Callers 1

Calls 1

sendEventMethod · 0.95

Tested by 1