MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / contentBlocks

Function contentBlocks

agentContext/blocks.go:3–20  ·  view source on GitHub ↗
(content any)

Source from the content-addressed store, hash-verified

1package agentContext
2
3func contentBlocks(content any) ([]map[string]any, bool) {
4 switch blocks := content.(type) {
5 case []map[string]any:
6 return blocks, true
7 case []any:
8 out := make([]map[string]any, 0, len(blocks))
9 for _, raw := range blocks {
10 block, ok := raw.(map[string]any)
11 if !ok {
12 continue
13 }
14 out = append(out, block)
15 }
16 return out, true
17 default:
18 return nil, false
19 }
20}
21
22func contentLike(original any, blocks []map[string]any) any {
23 if _, ok := original.([]any); ok {

Callers 12

totalResultCharsFunction · 0.70
countToolResultsFunction · 0.70
hasToolResultBlockFunction · 0.70
textFromMessageFunction · 0.70
SnipMessagesFunction · 0.70
isToolResultMessageFunction · 0.70
SnipCompactIfNeededFunction · 0.70
projectExchangeFunction · 0.70
BuildToolNameMapFunction · 0.70
iterToolResultBlockFunction · 0.70
MicroCompactMessagesFunction · 0.70
CountClearedToolResultFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected