Documentation
¶
Overview ¶
Package rawmsg converts the RawMessagesInfo format returned by the klaus agent's messages MCP tool into simple role/content pairs.
The agent now returns messages as json.RawMessage items with fields like type, subtype, text, tool_name, and timestamp instead of the old role/content format.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Message ¶
Message is a simplified role/content pair suitable for display.
func Convert ¶
func Convert(data json.RawMessage) Message
Convert converts a single json.RawMessage into a role/content Message.
func Parse ¶
Parse attempts to parse a JSON string as a RawResponse and convert its messages to role/content pairs. It returns the status, total count, and converted messages. If the input does not match the raw format (e.g. it lacks the "total" field), ok is false and the caller should fall back to the legacy format.
type RawResponse ¶
type RawResponse struct {
Status string `json:"status"`
Total int `json:"total"`
Messages []json.RawMessage `json:"messages"`
}
RawResponse is the JSON payload returned by the agent's messages MCP tool in the new RawMessagesInfo format.