/**
 * Kimi Wire Protocol Types — aligned with official spec v1.7
 *
 * Source: https://www.kimi.com/code/docs/en/kimi-code-cli/customization/wire-protocol.html
 * Protocol: JSON-RPC 2.0 based, bidirectional via stdin/stdout
 */
// ───────────────────────────────────────────────────────────────
// Standard Error Codes
// ───────────────────────────────────────────────────────────────
export const JSONRPC_PARSE_ERROR = -32700;
export const JSONRPC_INVALID_REQUEST = -32600;
export const JSONRPC_METHOD_NOT_FOUND = -32601;
export const JSONRPC_INVALID_PARAMS = -32602;
export const JSONRPC_INTERNAL_ERROR = -32603;
export const WIRE_TURN_IN_PROGRESS = -32000;
export const WIRE_LLM_NOT_SET = -32001;
export const WIRE_LLM_NOT_SUPPORTED = -32002;
export const WIRE_LLM_SERVICE_ERROR = -32003;
// ───────────────────────────────────────────────────────────────
// Type Guards
// ───────────────────────────────────────────────────────────────
export function isTextPart(part) {
    return part.type === "text";
}
export function isThinkPart(part) {
    return part.type === "think";
}
export function isImageURLPart(part) {
    return part.type === "image_url";
}
export function isAudioURLPart(part) {
    return part.type === "audio_url";
}
export function isVideoURLPart(part) {
    return part.type === "video_url";
}
export function isWireEventMessage(msg) {
    return (typeof msg === "object" &&
        msg !== null &&
        "type" in msg &&
        typeof msg.type === "string" &&
        "payload" in msg &&
        typeof msg.payload === "object");
}
export function isDisplayBlock(value) {
    return (typeof value === "object" &&
        value !== null &&
        "type" in value &&
        typeof value.type === "string");
}
/** Type guard for wire request messages */
export function isWireRequestMessage(msg) {
    return (typeof msg === "object" &&
        msg !== null &&
        "type" in msg &&
        typeof msg.type === "string" &&
        "payload" in msg &&
        typeof msg.payload === "object");
}
