Files
kit/sdk/types.go
T
Ed Zynda 0703dd1602 fix: eliminate escape sequence leak from spinner tea.Program instances
Each spinner created a new tea.NewProgram which sent DECRQM queries for
synchronized output mode 2026. When the program exited and restored
cooked terminal mode, the terminal's DECRPM response leaked as visible
^[[?2026;2$y characters. Replace Bubble Tea spinner with a simple
goroutine animation loop writing directly to stderr via lipgloss.
2026-02-25 18:17:25 +03:00

27 lines
920 B
Go

package sdk
import (
"charm.land/fantasy"
"github.com/mark3labs/mcphost/internal/session"
)
// Message is an alias for session.Message providing SDK users with access
// to message structures for conversation history and tool interactions.
type Message = session.Message
// ToolCall is an alias for session.ToolCall representing a tool invocation
// with its name, arguments, and result within a conversation.
type ToolCall = session.ToolCall
// ConvertToFantasyMessage converts an SDK message to the underlying fantasy message
// format used by the agent for LLM interactions.
func ConvertToFantasyMessage(msg *Message) fantasy.Message {
return msg.ConvertToFantasyMessage()
}
// ConvertFromFantasyMessage converts a fantasy message from the agent to an SDK
// message format for use in the SDK API.
func ConvertFromFantasyMessage(msg fantasy.Message) Message {
return session.ConvertFromFantasyMessage(msg)
}