"use strict";
/**
 * Cursor Protobuf Schema Constants
 * Field definitions and wire types for ConnectRPC protocol
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.hasUnknownConnectFrameFlags = exports.isEndStreamConnectFrame = exports.isCompressedConnectFrame = exports.CONNECT_FRAME_FLAG_MASK = exports.COMPRESS_FLAG = exports.CONNECT_FRAME_FLAG = exports.FIELD = exports.THINKING_LEVEL = exports.UNIFIED_MODE = exports.ROLE = exports.WIRE_TYPE = void 0;
/** Wire types for protobuf encoding */
exports.WIRE_TYPE = {
    VARINT: 0,
    FIXED64: 1,
    LEN: 2,
    FIXED32: 5,
};
/** Message role constants */
exports.ROLE = {
    USER: 1,
    ASSISTANT: 2,
};
/** Unified mode constants */
exports.UNIFIED_MODE = {
    CHAT: 1,
    AGENT: 2,
};
/** Thinking level constants */
exports.THINKING_LEVEL = {
    UNSPECIFIED: 0,
    MEDIUM: 1,
    HIGH: 2,
};
/** Field numbers namespaced by protobuf message type */
exports.FIELD = {
    /** StreamUnifiedChatRequestWithTools (top level) */
    Request: { REQUEST: 1 },
    /** StreamUnifiedChatRequest */
    Chat: {
        MESSAGES: 1,
        UNKNOWN_2: 2,
        INSTRUCTION: 3,
        UNKNOWN_4: 4,
        MODEL: 5,
        WEB_TOOL: 8,
        UNKNOWN_13: 13,
        CURSOR_SETTING: 15,
        UNKNOWN_19: 19,
        CONVERSATION_ID: 23,
        METADATA: 26,
        IS_AGENTIC: 27,
        SUPPORTED_TOOLS: 29,
        MESSAGE_IDS: 30,
        MCP_TOOLS: 34,
        LARGE_CONTEXT: 35,
        UNKNOWN_38: 38,
        UNIFIED_MODE: 46,
        UNKNOWN_47: 47,
        SHOULD_DISABLE_TOOLS: 48,
        THINKING_LEVEL: 49,
        UNKNOWN_51: 51,
        UNKNOWN_53: 53,
        UNIFIED_MODE_NAME: 54,
    },
    /** ConversationMessage */
    Message: {
        CONTENT: 1,
        ROLE: 2,
        ID: 13,
        TOOL_RESULTS: 18,
        IS_AGENTIC: 29,
        UNIFIED_MODE: 47,
        SUPPORTED_TOOLS: 51,
    },
    /** ConversationMessage.ToolResult */
    ToolResult: {
        CALL_ID: 1,
        NAME: 2,
        INDEX: 3,
        RAW_ARGS: 5,
        RESULT: 8,
    },
    /** Model */
    Model: { NAME: 1, EMPTY: 4 },
    /** Instruction */
    Instruction: { TEXT: 1 },
    /** CursorSetting (U6_FIELD_* are sub-fields of Unknown6 nested message) */
    Setting: {
        PATH: 1,
        UNKNOWN_3: 3,
        UNKNOWN_6: 6,
        UNKNOWN_8: 8,
        UNKNOWN_9: 9,
        U6_FIELD_1: 1,
        U6_FIELD_2: 2,
    },
    /** Metadata */
    Metadata: { PLATFORM: 1, ARCH: 2, VERSION: 3, CWD: 4, TIMESTAMP: 5 },
    /** MessageId */
    MessageId: { ID: 1, SUMMARY: 2, ROLE: 3 },
    /** MCPTool */
    McpTool: { NAME: 1, DESC: 2, PARAMS: 3, SERVER: 4 },
    /** StreamUnifiedChatResponseWithTools (response top-level) */
    Response: { TOOL_CALL: 1, RESPONSE: 2 },
    /** ClientSideToolV2Call */
    ToolCall: { ID: 3, NAME: 9, RAW_ARGS: 10, IS_LAST: 11, MCP_PARAMS: 27 },
    /** MCPParams */
    McpParams: { TOOLS_LIST: 1 },
    /** MCPParams.Tool (nested) */
    McpNested: { NAME: 1, PARAMS: 3 },
    /** StreamUnifiedChatResponse */
    ChatResponse: { TEXT: 1, THINKING: 25 },
    /** Thinking */
    Thinking: { TEXT: 1 },
};
/** Bit flags for ConnectRPC envelopes. */
exports.CONNECT_FRAME_FLAG = {
    COMPRESSED: 0x01,
    END_STREAM: 0x02,
};
/** ConnectRPC frame flag presets. */
exports.COMPRESS_FLAG = {
    NONE: 0x00,
    GZIP: exports.CONNECT_FRAME_FLAG.COMPRESSED,
    END_STREAM: exports.CONNECT_FRAME_FLAG.END_STREAM,
    GZIP_END_STREAM: exports.CONNECT_FRAME_FLAG.COMPRESSED | exports.CONNECT_FRAME_FLAG.END_STREAM,
};
exports.CONNECT_FRAME_FLAG_MASK = exports.CONNECT_FRAME_FLAG.COMPRESSED | exports.CONNECT_FRAME_FLAG.END_STREAM;
function isCompressedConnectFrame(flags) {
    return (flags & exports.CONNECT_FRAME_FLAG.COMPRESSED) === exports.CONNECT_FRAME_FLAG.COMPRESSED;
}
exports.isCompressedConnectFrame = isCompressedConnectFrame;
function isEndStreamConnectFrame(flags) {
    return (flags & exports.CONNECT_FRAME_FLAG.END_STREAM) === exports.CONNECT_FRAME_FLAG.END_STREAM;
}
exports.isEndStreamConnectFrame = isEndStreamConnectFrame;
function hasUnknownConnectFrameFlags(flags) {
    return (flags & ~exports.CONNECT_FRAME_FLAG_MASK) !== 0;
}
exports.hasUnknownConnectFrameFlags = hasUnknownConnectFrameFlags;
//# sourceMappingURL=cursor-protobuf-schema.js.map