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

Function stdoutAsContext

pkg/hooks/executor.go:410–424  ·  view source on GitHub ↗

stdoutAsContext reports whether plain stdout (non-JSON, exit 0) from a hook should be routed into Result.AdditionalContext. It is the runtime's emit site that decides whether AdditionalContext is surfaced; events that don't consume it MUST drop plain stdout so hook authors don't think their output m

(event EventType)

Source from the content-addressed store, hash-verified

408// hook authors don't think their output mattered when it would have
409// been thrown away.
410func stdoutAsContext(event EventType) bool {
411 switch event {
412 case EventPostToolUse,
413 EventSessionStart,
414 EventUserPromptSubmit,
415 EventUserSteeringMessagesSubmit,
416 EventUserFollowupSubmit,
417 EventTurnStart,
418 EventPreCompact,
419 EventStop,
420 EventWorktreeCreate:
421 return true
422 }
423 return false
424}
425
426// aggregate combines per-hook results into a single [Result].
427func aggregate(results []hookResult, event EventType) *Result {

Callers 1

aggregateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected