mirror of
https://github.com/mark3labs/kit.git
synced 2026-06-13 19:20:06 +00:00
0703dd1602
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.
27 lines
920 B
Go
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)
|
|
}
|