MCPcopy Index your code
hub / github.com/deepnote/deepnote / getAgentBlockLabel

Function getAgentBlockLabel

packages/cli/src/utils/block-label.ts:52–63  ·  view source on GitHub ↗

* Get label for an agent block - show first non-empty line of the prompt.

(content: string)

Source from the content-addressed store, hash-verified

50 * Get label for an agent block - show first non-empty line of the prompt.
51 */
52function getAgentBlockLabel(content: string): string {
53 const lines = content.split('\n')
54
55 for (const line of lines) {
56 const trimmed = line.trim()
57 if (trimmed) {
58 return truncate(`prompt: ${trimmed}`, MAX_LABEL_LENGTH)
59 }
60 }
61
62 return 'agent (empty prompt)'
63}
64
65/**
66 * Get label for a code block - prefer first comment, fall back to first line.

Callers 1

getBlockLabelFunction · 0.85

Calls 1

truncateFunction · 0.85

Tested by

no test coverage detected