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

Function transcriptBlockContentText

ui/runtime.go:739–762  ·  view source on GitHub ↗
(value any)

Source from the content-addressed store, hash-verified

737 }
738 return append(entries, map[string]any{"kind": kind, "text": text})
739}
740
741func formatUserTranscriptText(text string) string {
742 return strings.TrimSpace(text)
743}
744
745func formatAssistantTranscriptText(text string) string {
746 return strings.TrimSpace(text)
747}
748
749func formatHistoricalToolResult(block map[string]any) string {
750 content := transcriptBlockContentText(block["content"])
751 if content == "" {
752 content = stringFromAny(block["text"])
753 }
754 if content == "" {
755 return "[tool result]"
756 }
757 return "[tool result] " + truncateString(strings.Split(strings.TrimSpace(content), "\n")[0], 200)
758}
759
760func transcriptBlockContentText(value any) string {
761 switch typed := value.(type) {
762 case string:
763 return typed
764 case []map[string]any:
765 parts := make([]string, 0, len(typed))

Callers 1

Calls 2

stringFromAnyFunction · 0.70
nonEmptyStringsFunction · 0.70

Tested by

no test coverage detected