MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / getBasherFinishedOutputPreview

Function getBasherFinishedOutputPreview

cli/src/utils/agent-display.ts:47–63  ·  view source on GitHub ↗
(
  agentBlock: AgentContentBlock,
  maxLength = DEFAULT_BASHER_OUTPUT_PREVIEW_MAX_LENGTH,
)

Source from the content-addressed store, hash-verified

45}
46
47export function getBasherFinishedOutputPreview(
48 agentBlock: AgentContentBlock,
49 maxLength = DEFAULT_BASHER_OUTPUT_PREVIEW_MAX_LENGTH,
50): string | undefined {
51 if (
52 getAgentBaseName(agentBlock.agentType) !== 'basher' ||
53 agentBlock.status === 'running'
54 ) {
55 return undefined
56 }
57
58 const blocks = agentBlock.blocks ?? []
59 return (
60 truncateToSingleLinePreview(getTextOutput(blocks), maxLength) ??
61 truncateToSingleLinePreview(getCommandOutput(blocks), maxLength)
62 )
63}
64
65function getTextOutput(
66 blocks: NonNullable<AgentContentBlock['blocks']>,

Callers 2

getCollapsedPreviewFunction · 0.90

Calls 4

getAgentBaseNameFunction · 0.90
getTextOutputFunction · 0.85
getCommandOutputFunction · 0.85

Tested by

no test coverage detected