@@ -569,9 +569,9 @@ func toolIcon(sty *styles.Styles, status ToolStatus) string {
572−// toolParamList formats parameters as "main (key=value, ...)" with truncation.
573// toolParamList formats tool parameters as "main (key=value, ...)" with truncation.
572// toolParamList formats tool parameters as "main (key=value, ...)" with truncation.
573+// When opts.ExpandedContent is true, the output wraps instead of truncating.
574−func toolParamList(sty *styles.Styles, params []string, width int) string {
574+func toolParamList(sty *styles.Styles, params []string, width int, opts *ToolRenderOpts) string {
575 // minSpaceForMainParam is the min space required for the main param
575 // minSpaceForMainParam is the min space required for the main param
576 // if this is less that the value set we will only show the main param nothing else
576 // if this is less that the value set we will only show the main param nothing else
577 const minSpaceForMainParam = 30
577 const minSpaceForMainParam = 30
@@ -598,14 +598,18 @@ func toolParamList(sty *styles.Styles, params []string, width int) string {
601− if width >= 0 {
601+ if width >= 0 && (opts == nil || !opts.ExpandedContent) {
602 output = ansi.Truncate(output, width, "…")
602 output = ansi.Truncate(output, width, "…")
603+ } else if opts != nil && opts.ExpandedContent && width > 0 && lipgloss.Width(output) > width {
604+ output = ansi.Hardwrap(output, width, false)
604 return sty.Tool.ParamMain.Render(output)
606 return sty.Tool.ParamMain.Render(output)
607// toolHeader builds the tool header line: "● ToolName params..."
609// toolHeader builds the tool header line: "● ToolName params..."
610+// When opts.ExpandedContent is true, long parameters wrap instead of truncating.
608−func toolHeader(sty *styles.Styles, status ToolStatus, name string, width int, nested bool, params ...string) string {
611+func toolHeader(sty *styles.Styles, status ToolStatus, name string, width int, opts *ToolRenderOpts, params ...string) string {
612+ nested := opts != nil && opts.Compact
609 icon := toolIcon(sty, status)
613 icon := toolIcon(sty, status)
610 nameStyle := sty.Tool.NameNormal
614 nameStyle := sty.Tool.NameNormal
611 if nested {
615 if nested {
@@ -615,7 +619,18 @@ func toolHeader(sty *styles.Styles, status ToolStatus, name string, width int, n
615 prefix := fmt.Sprintf("%s %s ", icon, toolName)
619 prefix := fmt.Sprintf("%s %s ", icon, toolName)
616 prefixWidth := lipgloss.Width(prefix)
620 prefixWidth := lipgloss.Width(prefix)
617 remainingWidth := width - prefixWidth
621 remainingWidth := width - prefixWidth
618− paramsStr := toolParamList(sty, params, remainingWidth)
622+ paramsStr := toolParamList(sty, params, remainingWidth, opts)
624+ // When expanded, toolParamList may return multiple lines. Indent
625+ // continuation lines to align with the first line's param text.
626+ if strings.Contains(paramsStr, "\n") {
627+ lines := strings.Split(paramsStr, "\n")
628+ indent := strings.Repeat(" ", prefixWidth)
629+ for i := 1; i < len(lines); i++ {
630+ lines[i] = indent + lines[i]
632+ return prefix + strings.Join(lines, "\n")
619 return prefix + paramsStr
634 return prefix + paramsStr