@@ -166,7 +166,7 @@ func RenderFocusView(mysis MysisInfo, logs []LogEntry, width, height int, isLoad
166166 }
167167
168168 // RenderFocusViewWithViewport renders the detailed mysis view using a scrollable viewport.
169-func RenderFocusViewWithViewport(mysis MysisInfo, vp viewport.Model, width int, isLoading bool, spinnerView string, verbose bool, totalLines int, focusIndex, totalMyses int, currentTick int64, err error) string {
169+func RenderFocusViewWithViewport(mysis MysisInfo, vp viewport.Model, width int, isLoading bool, spinnerView string, verbose bool, totalLines int, focusIndex, totalMyses int, currentTick int64, gameStateSnapshots []*store.GameStateSnapshot, err error) string {
170170 var sections []string
171171
172172 // Header with mysis name - spans full width (2 lines)
@@ -195,7 +195,12 @@ func RenderFocusViewWithViewport(mysis MysisInfo, vp viewport.Model, width int,
195195 infoPanel := panelStyle.Width(width - 2).Render(infoContent)
196196 sections = append(sections, infoPanel)
197197
198- // Conversation title with scroll indicator - spans full width
198+ // Two-column layout: Game State Sidebar | Conversation Log
199+ const sidebarWidth = 24 // Fixed width for game state sidebar (total including border)
200+ const columnGap = 2 // Gap between columns
201+ conversationWidth := width - sidebarWidth - columnGap
202+
203+ // Conversation title with scroll indicator
199204 scrollInfo := ""
200205 if !vp.AtBottom() && totalLines > 0 {
201206 currentLine := vp.YOffset + 1
@@ -204,10 +209,27 @@ func RenderFocusViewWithViewport(mysis MysisInfo, vp viewport.Model, width int,
204209 }
205210 scrollInfo = fmt.Sprintf(" LINE %d/%d", currentLine, totalLines)
206211 }
207- logTitle := renderSectionTitleWithSuffix("CONVERSATION LOG", scrollInfo, width)
208- sections = append(sections, logTitle)
212+ logTitle := renderSectionTitleWithSuffix("CONVERSATION LOG", scrollInfo, conversationWidth)
213+
214+ // Game state title
215+ gameStateTitle := renderSectionTitle("GAME STATE", sidebarWidth)
216+
217+ // Render game state sidebar content (returns lines without border)
218+ gameStateSidebarContent := renderGameStateSidebar(gameStateSnapshots, currentTick, sidebarWidth)
219+
220+ // Render sidebar with border using lipgloss
221+ // Width() sets CONTENT width, padding is added on top, border is INCLUDED in width
222+ // So: content_width + padding(2) = sidebarWidth
223+ // Therefore: content_width = sidebarWidth - 2
224+ sidebarStyle := lipgloss.NewStyle().
225+ Border(lipgloss.RoundedBorder()).
226+ BorderForeground(colorBorder).
227+ Width(sidebarWidth-2). // -2 for padding (border is included in width)
228+ Padding(0, 1) // 1 space padding on left/right
229+
230+ sidebarRendered := sidebarStyle.Render(strings.Join(gameStateSidebarContent, "\n"))
231+ gameStateSidebarLines := strings.Split(sidebarRendered, "\n")
209232
210- // Viewport content (scrollable) with scrollbar
211233 // Render scrollbar based on viewport state
212234 scrollOffset := vp.YOffset
213235 scrollbarStr := renderScrollbar(vp.Height, totalLines, scrollOffset)
@@ -216,8 +238,8 @@ func RenderFocusViewWithViewport(mysis MysisInfo, vp viewport.Model, width int,
216238 // Get viewport content lines
217239 vpContentLines := strings.Split(vp.View(), "\n")
218240
219- // Combine each line with scrollbar
220- combinedLines := make([]string, vp.Height)
241+ // Combine viewport content with scrollbar
242+ conversationLines := make([]string, vp.Height)
221243 for i := 0; i < vp.Height; i++ {
222244 var contentLine string
223245 if i < len(vpContentLines) {
@@ -229,16 +251,55 @@ func RenderFocusViewWithViewport(mysis MysisInfo, vp viewport.Model, width int,
229251 } else {
230252 scrollLine = " " // Empty if no scrollbar line
231253 }
232- combinedLines[i] = contentLine + scrollLine
254+ conversationLines[i] = contentLine + scrollLine
233255 }
234256
235- combinedContent := strings.Join(combinedLines, "\n")
236- vpView := logStyle.Width(width - 2).Render(combinedContent)
237- sections = append(sections, vpView)
257+ // Render conversation log (no border, just content)
258+ // The conversation log doesn't have a border, so we use the full conversationWidth
259+ conversationContent := strings.Join(conversationLines, "\n")
260+ conversationView := logStyle.Width(conversationWidth).Render(conversationContent)
261+ conversationViewLines := strings.Split(conversationView, "\n")
262+
263+ // Combine titles
264+ titleRow := lipgloss.JoinHorizontal(lipgloss.Top,
265+ gameStateTitle,
266+ strings.Repeat(" ", columnGap),
267+ logTitle,
268+ )
269+ sections = append(sections, titleRow)
270+
271+ // Combine sidebar and conversation content side by side
272+ maxLines := len(gameStateSidebarLines)
273+ if len(conversationViewLines) > maxLines {
274+ maxLines = len(conversationViewLines)
275+ }
276+
277+ for i := 0; i < maxLines; i++ {
278+ var leftLine, rightLine string
279+
280+ if i < len(gameStateSidebarLines) {
281+ leftLine = gameStateSidebarLines[i]
282+ } else {
283+ leftLine = strings.Repeat(" ", sidebarWidth)
284+ }
285+
286+ if i < len(conversationViewLines) {
287+ rightLine = conversationViewLines[i]
288+ } else {
289+ rightLine = strings.Repeat(" ", conversationWidth)
290+ }
291+
292+ combinedLine := lipgloss.JoinHorizontal(lipgloss.Top,
293+ leftLine,
294+ strings.Repeat(" ", columnGap),
295+ rightLine,
296+ )
297+ sections = append(sections, combinedLine)
298+ }
238299
239300 // Bottom border for conversation log - matches top border style
240- logBottomBorder := renderSectionTitle("", width)
241- sections = append(sections, logBottomBorder)
301+ logBottomBorder := renderSectionTitle("", conversationWidth)
302+ sections = append(sections, strings.Repeat(" ", sidebarWidth)+strings.Repeat(" ", columnGap)+logBottomBorder)
242303
243304 // Footer with scroll hints, verbose toggle, and error status
244305 verboseHint := ""
@@ -254,106 +315,141 @@ func RenderFocusViewWithViewport(mysis MysisInfo, vp viewport.Model, width int,
254315 return lipgloss.JoinVertical(lipgloss.Left, sections...)
255316 }
256317
257-// renderToolCallsEntry formats tool calls with special visual treatment.
258-// Format: ⚡ Calling tools: with bulleted list of tool names and arguments.
259-func renderToolCallsEntry(content string, contentWidth int, verbose bool) []string {
318+// renderToolCallsCompact formats tool calls in compact format.
319+// Format: ⚙ tool_name(args...) - truncated, no huge JSON
320+func renderToolCallsCompact(content string, contentWidth int) []string {
260321 // Parse tool calls from storage format
261322 stored := strings.TrimPrefix(content, constants.ToolCallStoragePrefix)
262323 if stored == "" {
263- return []string{"⚠️ Empty tool call record"}
324+ return []string{dimmedStyle.Render("⚠ Empty tool call")}
264325 }
265326
266327 var result []string
267- toolCallStyle := lipgloss.NewStyle().Foreground(colorTool).Bold(true)
328+ toolIconStyle := lipgloss.NewStyle().Foreground(colorTool)
268329 toolNameStyle := lipgloss.NewStyle().Foreground(colorTool).Bold(true)
269- toolArgStyle := lipgloss.NewStyle().Foreground(colorTool)
270- dimmedStyle := lipgloss.NewStyle().Foreground(colorMuted)
271-
272- // Header line
273- header := toolCallStyle.Render("⚡ Calling tools:")
274- result = append(result, header)
330+ toolArgStyle := lipgloss.NewStyle().Foreground(colorMuted)
275331
276332 // Parse each tool call record
277333 parts := strings.Split(stored, constants.ToolCallStorageRecordDelimiter)
278334 for _, part := range parts {
279335 fields := strings.SplitN(part, constants.ToolCallStorageFieldDelimiter, constants.ToolCallStorageFieldCount)
280336 if len(fields) < constants.ToolCallStorageFieldCount {
281- // Malformed: skip or show warning
282337 continue
283338 }
284339
285340 toolName := fields[1]
286341 argsJSON := fields[2]
287342
288- // Simplified argument format for non-verbose mode
289- if !verbose || argsJSON == "{}" {
290- // Show as: • tool_name() or • tool_name(arg: value)
291- var argsDisplay string
292- if argsJSON == "{}" {
293- argsDisplay = "()"
294- } else {
295- // Parse JSON and create simplified inline format
296- var args map[string]interface{}
297- if err := json.Unmarshal([]byte(argsJSON), &args); err == nil && len(args) > 0 {
298- // Sort keys for deterministic output
299- var keys []string
300- for k := range args {
301- keys = append(keys, k)
302- }
303- // Use simple lexicographic sort
304- for i := 0; i < len(keys); i++ {
305- for j := i + 1; j < len(keys); j++ {
306- if keys[i] > keys[j] {
307- keys[i], keys[j] = keys[j], keys[i]
308- }
343+ // Format: ⚙ tool_name(args...)
344+ var argsDisplay string
345+ if argsJSON == "{}" {
346+ argsDisplay = "()"
347+ } else {
348+ // Parse JSON and create compact inline format
349+ var args map[string]interface{}
350+ if err := json.Unmarshal([]byte(argsJSON), &args); err == nil && len(args) > 0 {
351+ // Sort keys for deterministic output
352+ var keys []string
353+ for k := range args {
354+ keys = append(keys, k)
355+ }
356+ // Simple lexicographic sort
357+ for i := 0; i < len(keys); i++ {
358+ for j := i + 1; j < len(keys); j++ {
359+ if keys[i] > keys[j] {
360+ keys[i], keys[j] = keys[j], keys[i]
309361 }
310362 }
363+ }
311364
312- var argParts []string
313- for _, k := range keys {
314- v := args[k]
315- // Format value based on type
316- var valStr string
317- switch v := v.(type) {
318- case string:
365+ var argParts []string
366+ for _, k := range keys {
367+ v := args[k]
368+ // Format value based on type
369+ var valStr string
370+ switch v := v.(type) {
371+ case string:
372+ // Truncate long strings
373+ if len(v) > 20 {
374+ valStr = fmt.Sprintf("%q", v[:20]+"...")
375+ } else {
319376 valStr = fmt.Sprintf("%q", v)
320- case float64, int, bool:
321- valStr = fmt.Sprintf("%v", v)
322- default:
323- // Complex types: use ellipsis
324- valStr = "{...}"
325377 }
326- argParts = append(argParts, fmt.Sprintf("%s: %s", k, valStr))
378+ case float64, int, bool:
379+ valStr = fmt.Sprintf("%v", v)
380+ default:
381+ // Complex types: use ellipsis
382+ valStr = "{...}"
327383 }
328- argsDisplay = "(" + strings.Join(argParts, ", ") + ")"
329- } else {
330- argsDisplay = "(...)"
384+ argParts = append(argParts, fmt.Sprintf("%s=%s", k, valStr))
331385 }
386+ argsDisplay = "(" + strings.Join(argParts, ", ") + ")"
387+ } else {
388+ argsDisplay = "(...)"
332389 }
390+ }
333391
334- toolLine := " • " + toolNameStyle.Render(toolName) + toolArgStyle.Render(argsDisplay)
335- result = append(result, toolLine)
336- } else {
337- // Verbose mode: show tool name with JSON tree below
338- toolLine := " • " + toolNameStyle.Render(toolName)
339- result = append(result, toolLine)
340-
341- if argsJSON != "{}" {
342- // Render JSON as indented tree
343- var args map[string]interface{}
344- if err := json.Unmarshal([]byte(argsJSON), &args); err == nil {
345- // Simple indented JSON rendering
346- jsonBytes, _ := json.MarshalIndent(args, " ", " ")
347- jsonLines := strings.Split(string(jsonBytes), "\n")
348- for _, line := range jsonLines {
349- result = append(result, dimmedStyle.Render(" "+line))
392+ // Truncate if too long
393+ toolLine := toolIconStyle.Render("⚙") + " " + toolNameStyle.Render(toolName) + toolArgStyle.Render(argsDisplay)
394+ if lipgloss.Width(toolLine) > contentWidth {
395+ // Truncate args
396+ maxArgsWidth := contentWidth - lipgloss.Width(toolIconStyle.Render("⚙")+" "+toolName) - 5
397+ if maxArgsWidth < 5 {
398+ maxArgsWidth = 5
399+ }
400+ argsDisplay = truncateWithEllipsis(argsDisplay, maxArgsWidth)
401+ toolLine = toolIconStyle.Render("⚙") + " " + toolNameStyle.Render(toolName) + toolArgStyle.Render(argsDisplay)
402+ }
403+
404+ result = append(result, toolLine)
405+ }
406+
407+ return result
408+}
409+
410+// renderToolResultCompact formats tool results compactly.
411+// Success: just ✓ Success
412+// Error: ✗ Error: message
413+func renderToolResultCompact(content string, contentWidth int, verbose bool) []string {
414+ // Strip tool call ID prefix if present (format: "call_xxx:json")
415+ jsonContent := content
416+ if idx := strings.Index(jsonContent, ":"); idx > 0 && strings.HasPrefix(jsonContent, "call_") {
417+ jsonContent = jsonContent[idx+1:]
418+ }
419+
420+ successStyle := lipgloss.NewStyle().Foreground(colorSuccess)
421+ errorStyle := lipgloss.NewStyle().Foreground(colorError)
422+
423+ // Check if it's an error
424+ if strings.Contains(jsonContent, "\"error\"") || strings.Contains(jsonContent, "\"isError\"") {
425+ // Parse error message
426+ var data map[string]interface{}
427+ if err := json.Unmarshal([]byte(jsonContent), &data); err == nil {
428+ if errMsg, ok := data["error"].(string); ok {
429+ // Show error message
430+ errorLine := errorStyle.Render("✗") + " " + errorStyle.Render("Error: "+errMsg)
431+ if verbose {
432+ // In verbose mode, show full error
433+ return wrapText(errorLine, contentWidth)
434+ }
435+ // Truncate error message
436+ if lipgloss.Width(errorLine) > contentWidth {
437+ maxErrWidth := contentWidth - 10
438+ if maxErrWidth < 10 {
439+ maxErrWidth = 10
350440 }
441+ errMsg = truncateWithEllipsis(errMsg, maxErrWidth)
442+ errorLine = errorStyle.Render("✗") + " " + errorStyle.Render("Error: "+errMsg)
351443 }
444+ return []string{errorLine}
352445 }
353446 }
447+ // Fallback: generic error
448+ return []string{errorStyle.Render("✗ Error")}
354449 }
355450
356- return result
451+ // Success: just show checkmark
452+ return []string{successStyle.Render("✓ Success")}
357453 }
358454
359455 func renderLogEntryImpl(entry LogEntry, maxWidth int, verbose bool, currentTick int64) []string {
@@ -403,10 +499,10 @@ func renderLogEntryImpl(entry LogEntry, maxWidth int, verbose bool, currentTick
403499 // Inside padding: 1 space on left and right of all content
404500 const padLeft = 1
405501 const padRight = 1
502+ const contentIndent = 4 // 4 spaces indent for content below header
406503
407- // Calculate content width (accounting for prefix, padding, and gap after prefix)
408- prefixWidth := lipgloss.Width(prefix) + 1 // +1 for space after prefix
409- contentWidth := maxWidth - prefixWidth - padLeft - padRight
504+ // Calculate content width (accounting for indent and padding)
505+ contentWidth := maxWidth - contentIndent - padLeft - padRight
410506 if contentWidth < 20 {
411507 contentWidth = 20
412508 }
@@ -416,26 +512,13 @@ func renderLogEntryImpl(entry LogEntry, maxWidth int, verbose bool, currentTick
416512
417513 // Check for tool calls (assistant messages with [TOOL_CALLS] prefix)
418514 if entry.Role == "assistant" && strings.HasPrefix(entry.Content, constants.ToolCallStoragePrefix) {
419- // Render tool calls with special visual treatment
420- wrappedLines = renderToolCallsEntry(entry.Content, contentWidth, verbose)
421- } else if entry.Role == "tool" && isJSON(entry.Content) {
422- // Extract JSON content (strip tool call ID prefix if present)
423- jsonContent := entry.Content
424- if idx := strings.Index(jsonContent, ":"); idx > 0 && strings.HasPrefix(jsonContent, "call_") {
425- jsonContent = jsonContent[idx+1:]
426- }
427-
428- // Render JSON as tree structure with width constraint
429- treeStr, err := renderJSONTree(jsonContent, verbose, contentWidth)
430- if err == nil {
431- // Tree rendering succeeded
432- wrappedLines = strings.Split(treeStr, "\n")
433- } else {
434- // Fall back to normal wrapping if JSON parsing fails
435- wrappedLines = wrapText(entry.Content, contentWidth)
436- }
515+ // Render tool calls with compact format
516+ wrappedLines = renderToolCallsCompact(entry.Content, contentWidth)
517+ } else if entry.Role == "tool" {
518+ // Tool results: only show errors, success is just a checkmark
519+ wrappedLines = renderToolResultCompact(entry.Content, contentWidth, verbose)
437520 } else {
438- // Normal text wrapping
521+ // Normal text wrapping (user messages, assistant replies)
439522 wrappedLines = wrapText(entry.Content, contentWidth)
440523 }
441524
@@ -466,21 +549,22 @@ func renderLogEntryImpl(entry LogEntry, maxWidth int, verbose bool, currentTick
466549 headerLine := leftPad + styledPrefix + styledSeparator + headerPadding
467550 result = append(result, headerLine)
468551
469- // Render content lines (start at left margin, no indentation)
552+ // Render content lines (4 spaces indented below header)
470553 for _, line := range wrappedLines {
471554 // Pad the line content to fill remaining width
472555 lineLen := lipgloss.Width(line)
473- remainingWidth := maxWidth - padLeft - lineLen - padRight
556+ remainingWidth := maxWidth - padLeft - contentIndent - lineLen - padRight
474557 if remainingWidth < 0 {
475558 remainingWidth = 0
476559 }
477560 paddedLine := line + strings.Repeat(" ", remainingWidth)
478561
479- // All content lines: left pad + content (no indent)
562+ // All content lines: left pad + 4 space indent + content
480563 contentLeftPad := contentStyle.Render(strings.Repeat(" ", padLeft))
564+ indent := contentStyle.Render(strings.Repeat(" ", contentIndent))
481565 styledContent := contentStyle.Render(paddedLine)
482566 rightPad := contentStyle.Render(strings.Repeat(" ", padRight))
483- result = append(result, contentLeftPad+styledContent+rightPad)
567+ result = append(result, contentLeftPad+indent+styledContent+rightPad)
484568 }
485569
486570 // Render reasoning if present
@@ -567,16 +651,18 @@ func renderLogEntryImpl(entry LogEntry, maxWidth int, verbose bool, currentTick
567651 truncPaddedLine := truncMsg + strings.Repeat(" ", truncRemainingWidth)
568652
569653 contentLeftPad := contentStyle.Render(strings.Repeat(" ", padLeft))
654+ indent := contentStyle.Render(strings.Repeat(" ", contentIndent))
570655 styledTrunc := dimmedStyle.Render(truncPaddedLine)
571656 rightPad := contentStyle.Render(strings.Repeat(" ", padRight))
572- result = append(result, contentLeftPad+styledTrunc+rightPad)
657+ result = append(result, contentLeftPad+indent+styledTrunc+rightPad)
573658 }
574659
575- // All lines: left pad + content (no indent, matches main message rendering)
660+ // All lines: left pad + 4 space indent + content (matches main message rendering)
576661 contentLeftPad := contentStyle.Render(strings.Repeat(" ", padLeft))
662+ indent := contentStyle.Render(strings.Repeat(" ", contentIndent))
577663 styledContent := reasoningStyle.Render(paddedLine)
578664 rightPad := contentStyle.Render(strings.Repeat(" ", padRight))
579- result = append(result, contentLeftPad+styledContent+rightPad)
665+ result = append(result, contentLeftPad+indent+styledContent+rightPad)
580666 }
581667 }
582668
@@ -657,3 +743,138 @@ func isJSON(s string) bool {
657743 return (strings.HasPrefix(s, "{") && strings.HasSuffix(s, "}")) ||
658744 (strings.HasPrefix(s, "[") && strings.HasSuffix(s, "]"))
659745 }
746+
747+// renderGameStateSidebar renders the game state sidebar showing all snapshots.
748+func renderGameStateSidebar(snapshots []*store.GameStateSnapshot, currentTick int64, width int) []string {
749+ var lines []string
750+
751+ if len(snapshots) == 0 {
752+ lines = append(lines, dimmedStyle.Render("No game state"))
753+ lines = append(lines, dimmedStyle.Render("available"))
754+ return lines
755+ }
756+
757+ // Group snapshots by category (same as buildGameStateSummary)
758+ statusTools := []string{"get_status", "get_player"}
759+ shipTools := []string{"get_ship", "get_cargo"}
760+ locationTools := []string{"get_system", "get_location", "get_poi"}
761+
762+ // Helper to render a snapshot group
763+ renderGroup := func(toolNames []string) {
764+ for _, snapshot := range snapshots {
765+ for _, toolName := range toolNames {
766+ if snapshot.ToolName == toolName {
767+ // Tool name with recency
768+ recency := snapshot.RecencyMessage(currentTick)
769+ toolHeader := labelStyle.Render(toolName)
770+ recencyText := dimmedStyle.Render(fmt.Sprintf(" (%s)", recency))
771+ lines = append(lines, toolHeader+recencyText)
772+
773+ // Extract and show compact info
774+ compactInfo := extractCompactInfoForTUI(snapshot.Content, toolName, width-4)
775+ lines = append(lines, compactInfo...)
776+ lines = append(lines, "") // Empty line between groups
777+ }
778+ }
779+ }
780+ }
781+
782+ renderGroup(statusTools)
783+ renderGroup(shipTools)
784+ renderGroup(locationTools)
785+
786+ // Remove trailing empty line if present
787+ if len(lines) > 0 && lines[len(lines)-1] == "" {
788+ lines = lines[:len(lines)-1]
789+ }
790+
791+ return lines
792+}
793+
794+// extractCompactInfoForTUI extracts key info from snapshot for TUI display.
795+func extractCompactInfoForTUI(content, toolName string, maxWidth int) []string {
796+ var lines []string
797+
798+ // Parse JSON content
799+ var data map[string]interface{}
800+ if err := json.Unmarshal([]byte(content), &data); err != nil {
801+ return lines
802+ }
803+
804+ switch toolName {
805+ case "get_status", "get_player":
806+ // Extract player data
807+ if player, ok := data["player"].(map[string]interface{}); ok {
808+ if credits, ok := player["credits"].(float64); ok {
809+ lines = append(lines, dimmedStyle.Render(fmt.Sprintf(" Credits: %d", int(credits))))
810+ }
811+ if location, ok := player["current_system"].(string); ok {
812+ lines = append(lines, dimmedStyle.Render(fmt.Sprintf(" System: %s", truncateWithEllipsis(location, maxWidth-10))))
813+ }
814+ }
815+ // Extract ship data from get_status
816+ if ship, ok := data["ship"].(map[string]interface{}); ok {
817+ if name, ok := ship["name"].(string); ok {
818+ lines = append(lines, dimmedStyle.Render(fmt.Sprintf(" Ship: %s", truncateWithEllipsis(name, maxWidth-8))))
819+ }
820+ if fuel, ok := ship["fuel"].(float64); ok {
821+ if maxFuel, ok := ship["max_fuel"].(float64); ok {
822+ lines = append(lines, dimmedStyle.Render(fmt.Sprintf(" Fuel: %d/%d", int(fuel), int(maxFuel))))
823+ }
824+ }
825+ if hull, ok := ship["hull"].(float64); ok {
826+ if maxHull, ok := ship["max_hull"].(float64); ok {
827+ lines = append(lines, dimmedStyle.Render(fmt.Sprintf(" Hull: %d/%d", int(hull), int(maxHull))))
828+ }
829+ }
830+ }
831+
832+ case "get_ship":
833+ if cargoUsed, ok := data["cargo_used"].(float64); ok {
834+ if cargoMax, ok := data["cargo_max"].(float64); ok {
835+ lines = append(lines, dimmedStyle.Render(fmt.Sprintf(" Cargo: %d/%d", int(cargoUsed), int(cargoMax))))
836+ }
837+ }
838+ if class, ok := data["class"].(map[string]interface{}); ok {
839+ if className, ok := class["name"].(string); ok {
840+ lines = append(lines, dimmedStyle.Render(fmt.Sprintf(" Class: %s", truncateWithEllipsis(className, maxWidth-9))))
841+ }
842+ }
843+
844+ case "get_cargo":
845+ if cargo, ok := data["cargo"].([]interface{}); ok {
846+ cargoUsed := 0
847+ for _, item := range cargo {
848+ if itemMap, ok := item.(map[string]interface{}); ok {
849+ name, _ := itemMap["name"].(string)
850+ qty, _ := itemMap["quantity"].(float64)
851+ if name != "" {
852+ cargoUsed += int(qty)
853+ lines = append(lines, dimmedStyle.Render(fmt.Sprintf(" • %s x%d", truncateWithEllipsis(name, maxWidth-10), int(qty))))
854+ }
855+ }
856+ }
857+ if capacity, ok := data["capacity"].(float64); ok {
858+ lines = append(lines, dimmedStyle.Render(fmt.Sprintf(" Total: %d/%d", cargoUsed, int(capacity))))
859+ }
860+ }
861+
862+ case "get_system":
863+ if pois, ok := data["pois"].([]interface{}); ok {
864+ poiCount := len(pois)
865+ lines = append(lines, dimmedStyle.Render(fmt.Sprintf(" POIs: %d", poiCount)))
866+ }
867+
868+ case "get_poi":
869+ if poi, ok := data["poi"].(map[string]interface{}); ok {
870+ if name, ok := poi["name"].(string); ok {
871+ lines = append(lines, dimmedStyle.Render(fmt.Sprintf(" %s", truncateWithEllipsis(name, maxWidth-2))))
872+ }
873+ if poiType, ok := poi["type"].(string); ok {
874+ lines = append(lines, dimmedStyle.Render(fmt.Sprintf(" Type: %s", poiType)))
875+ }
876+ }
877+ }
878+
879+ return lines
880+}